From d07afbc0818370f03ef840419e0bf4f654753ab8 Mon Sep 17 00:00:00 2001 From: sceptillion <33798691+sceptillion@users.noreply.github.com> Date: Sun, 10 Dec 2017 22:41:46 -0800 Subject: [PATCH] initial commit --- .gitattributes | 15 + .gitignore | 42 + Makefile | 98 + asm/code.s | 24158 +++ asm/code_800B540.s | 331349 ++++++++++++++++++++++++++++++++ asm/code_8272724.s | 551 + asm/crt0.s | 103 + asm/libc.s | 9071 + asm/m4a.s | 4625 + asm/macros.inc | 1 + asm/macros/function.inc | 29 + asm/rom_header.inc | 52 + asm/syscall.s | 34 + constants/gba_constants.inc | 490 + data/data.s | 12259 ++ data/data_8270000.s | 5 + data/libc_data.s | 85 + data/unk_data.s | 19 + include/gba/defines.h | 62 + include/gba/flash_internal.h | 73 + include/gba/gba.h | 11 + include/gba/io_reg.h | 727 + include/gba/m4a_internal.h | 463 + include/gba/macro.h | 137 + include/gba/multiboot.h | 55 + include/gba/syscall.h | 48 + include/gba/types.h | 129 + include/global.h | 39 + ld_script.sed | 14 + ld_script.txt | 107 + rom.md5 | 1 + src/agb_flash.c | 284 + src/agb_flash_1m.c | 85 + src/agb_flash_le.c | 30 + src/agb_flash_mx.c | 166 + src/main.c | 108 + sym_ewram.txt | 1054 + sym_ewram2.txt | 700 + sym_iwram.txt | 77 + 39 files changed, 387356 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 asm/code.s create mode 100644 asm/code_800B540.s create mode 100644 asm/code_8272724.s create mode 100644 asm/crt0.s create mode 100644 asm/libc.s create mode 100644 asm/m4a.s create mode 100644 asm/macros.inc create mode 100644 asm/macros/function.inc create mode 100644 asm/rom_header.inc create mode 100644 asm/syscall.s create mode 100644 constants/gba_constants.inc create mode 100644 data/data.s create mode 100644 data/data_8270000.s create mode 100644 data/libc_data.s create mode 100644 data/unk_data.s create mode 100644 include/gba/defines.h create mode 100644 include/gba/flash_internal.h create mode 100644 include/gba/gba.h create mode 100644 include/gba/io_reg.h create mode 100644 include/gba/m4a_internal.h create mode 100644 include/gba/macro.h create mode 100644 include/gba/multiboot.h create mode 100644 include/gba/syscall.h create mode 100644 include/gba/types.h create mode 100644 include/global.h create mode 100644 ld_script.sed create mode 100644 ld_script.txt create mode 100644 rom.md5 create mode 100644 src/agb_flash.c create mode 100644 src/agb_flash_1m.c create mode 100644 src/agb_flash_le.c create mode 100644 src/agb_flash_mx.c create mode 100644 src/main.c create mode 100644 sym_ewram.txt create mode 100644 sym_ewram2.txt create mode 100644 sym_iwram.txt diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..7c8d2699 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,15 @@ +*.pal text eol=crlf + +*.s text eol=lf +*.txt text eol=lf +Makefile text eol=lf +*.mk text eol=lf +*.c text eol=lf +*.h text eol=lf +*.pl text eol=lf +*.inc text eol=lf +*.sha1 text eol=lf +*.sed text eol=lf + +*.png binary +*.bin binary diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..7a883675 --- /dev/null +++ b/.gitignore @@ -0,0 +1,42 @@ +*.exe +*.o +*.i +*.elf +*.gba +*.1bpp +*.4bpp +*.8bpp +*.gbapal +*.lz +*.rl +*.pcm +*.latfont +*.hwjpnfont +*.fwjpnfont +*.bat +sound/**/*.bin +src/*.s +tools/agbcc +ld_script_ruby.txt +ld_script_sapphire.txt +*.map +*.id0 +*.id1 +*.id2 +*.nam +*.til +*.ld +tags +types_*.taghl +*.swp +*.swo +*.s.old +*.s.old2 +*.dump +*.sa* +Thumbs.db +build/ +.idea/ +*.DS_Store +*.pl +tools/ diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..bb5a2ed9 --- /dev/null +++ b/Makefile @@ -0,0 +1,98 @@ +AS := $(DEVKITARM)/bin/arm-none-eabi-as +ASFLAGS := -mcpu=arm7tdmi + +CC1 := tools/agbcc/bin/agbcc +override CFLAGS += -mthumb-interwork -Wimplicit -Wparentheses -Wunused -Werror -O2 -fhex-asm + +CPP := $(DEVKITARM)/bin/arm-none-eabi-cpp +CPPFLAGS := -I tools/agbcc/include -iquote include -nostdinc -undef + +LD := $(DEVKITARM)/bin/arm-none-eabi-ld + +OBJCOPY := $(DEVKITARM)/bin/arm-none-eabi-objcopy + +LIBGCC := tools/agbcc/lib/libgcc.a + +MD5 := md5sum -c + +GFX := tools/gbagfx/gbagfx +AIF := tools/aif2pcm/aif2pcm +MID := tools/mid2agb/mid2agb +SCANINC := tools/scaninc/scaninc +PREPROC := tools/preproc/preproc +RAMSCRGEN := tools/ramscrgen/ramscrgen + +# Clear the default suffixes. +.SUFFIXES: + +# Secondary expansion is required for dependency variables in object rules. +.SECONDEXPANSION: + +.PRECIOUS: %.1bpp %.4bpp %.8bpp %.gbapal %.lz %.rl %.pcm %.bin + +.PHONY: all clean tidy + +C_SRCS := $(wildcard src/*.c) +C_OBJS := $(C_SRCS:%.c=%.o) + +ASM_SRCS := $(wildcard asm/*.s) +ASM_OBJS := $(ASM_SRCS:%.s=%.o) + +DATA_ASM_SRCS := $(wildcard data/*.s) +DATA_ASM_OBJS := $(DATA_ASM_SRCS:%.s=%.o) + +OBJS := $(C_OBJS) $(ASM_OBJS) $(DATA_ASM_OBJS) + +all: pmd_red.gba + +# For contributors to make sure a change didn't affect the contents of the ROM. + +compare: all + @$(MD5) rom.md5 + +clean: tidy + +tidy: + rm -f pmd_red.gba pmd_red.elf pmd_red.map + rm -f $(ASM_OBJS) + rm -f $(DATA_ASM_OBJS) + rm -f $(C_OBJS) + rm -f $(ASM_OBJS) + rm -f $(DATA_ASM_OBJS) + rm -f $(C_SRCS:%.c=%.i) + rm -f $(C_SRCS:%.c=%.s) + rm -f *.ld + +src/agb_flash.o: CFLAGS := -O -mthumb-interwork +src/agb_flash_1m.o: CFLAGS := -O -mthumb-interwork +src/agb_flash_mx.o: CFLAGS := -O -mthumb-interwork + +$(C_OBJS): %.o : %.c + @$(CPP) $(CPPFLAGS) $< -o $*.i + @$(CC1) $(CFLAGS) $*.i -o $*.s + @printf ".text\n\t.align\t2, 0\n" >> $*.s + $(AS) $(ASFLAGS) -o $@ $*.s + +$(ASM_OBJS): %.o: %.s + $(AS) $(ASFLAGS) -o $@ $< + +$(DATA_ASM_OBJS): %.o: %.s + $(AS) $(ASFLAGS) -o $@ $< + +sym_ewram.ld: sym_ewram.txt + $(RAMSCRGEN) ewram_data sym_ewram.txt ENGLISH >$@ + +sym_ewram2.ld: sym_ewram2.txt + $(RAMSCRGEN) ewram_data sym_ewram2.txt ENGLISH >$@ + +sym_iwram.ld: sym_iwram.txt + $(RAMSCRGEN) iwram_data sym_iwram.txt ENGLISH >$@ + +ld_script.ld: ld_script.txt sym_ewram.ld sym_ewram2.ld sym_iwram.ld + sed -f ld_script.sed ld_script.txt >ld_script.ld + +pmd_red.elf: ld_script.ld $(OBJS) + $(LD) -T ld_script.ld -Map pmd_red.map -o $@ $(OBJS) $(LIBGCC) + +pmd_red.gba: pmd_red.elf + $(OBJCOPY) -O binary --gap-fill 0xFF --pad-to 0xA000000 $< $@ diff --git a/asm/code.s b/asm/code.s new file mode 100644 index 00000000..d78fb770 --- /dev/null +++ b/asm/code.s @@ -0,0 +1,24158 @@ + .include "constants/gba_constants.inc" + .include "asm/macros.inc" + + .syntax unified + + .text + + thumb_func_start sub_80001DC +sub_80001DC: + mov r0, sp + bx lr + thumb_func_end sub_80001DC + + thumb_func_start sub_80001E0 +sub_80001E0: + ldr r0, _080001E4 + bx lr + .align 2, 0 +_080001E4: .4byte gUnknown_3004000 + thumb_func_end sub_80001E0 + + arm_func_start sub_80001E8 +sub_80001E8: + stmdb sp!, {r4-r11} + mov r12, 0x4000000 + ldr r11, _08000224 + add r10, r11, 0x40 + mov r9, 0x1 + mov r8, 0 + strb r8, [r12, 0x208] + ldmia r10, {r0-r7} + stmia r10!, {r4-r7} + stmia r10!, {r0-r3} + ldr r0, [r11, 0x4] + str r8, [r11, 0x4] + strb r9, [r12, 0x208] + ldmia sp!, {r4-r11} + bx lr + .align 2, 0 +_08000224: .4byte gUnknown_202DCF8 + arm_func_end sub_80001E8 + + arm_func_start sub_8000228 +sub_8000228: + mov r12, 0x4000000 + add r12, r12, 0x120 + ldmia r12, {r0,r1} + stmdb sp!, {r7-r11} + ldr r11, _08000340 + mov r9, 0xFE + add r9, r9, 0xFE00 + ldrh r3, [r12, 0x8] + and r3, r3, 0x40 + strb r3, [r11, 0x9] + ldr r10, [r11, 0x14] + adds r3, r10, 0x1 + blt _08000284 + bne _08000278 + strh r9, [r12, 0xA] + add r8, r11, 0x28 + ldmia r8, {r2,r3} + mov r7, r2 + stmia r8, {r3,r7} + b _08000284 +_08000278: + ldr r3, [r11, 0x2C] + ldr r2, [r3, r10, lsl 1] + strh r2, [r12, 0xA] +_08000284: + cmp r10, 0xB + addlt r10, r10, 0x1 + strlt r10, [r11, 0x14] + stmdb sp!, {r0,r1,r5,r6} + mov r6, 0x3 +_08000298: + add r8, r11, 0x18 + add r8, r8, r6, lsl 2 + ldr r10, [r8] + mov r3, r6, lsl 1 + ldrh r5, [sp, r3] + cmp r5, r9 + bne _080002C8 + cmp r10, 0x9 + ble _080002C8 + mov r0, 0x1 + sub r10, r0, 0x2 + b _080002F4 +_080002C8: + ldr r0, [r8, 0x18] + mov r3, r10, lsl 1 + strh r5, [r0, r3] + cmp r10, 0x9 + bne _080002F4 + ldr r1, [r8, 0x28] + str r0, [r8, 0x28] + str r1, [r8, 0x18] + add r3, r11, 0x4 + mov r0, 0x1 + strb r0, [r3, r6] +_080002F4: + cmp r10, 0xB + addlt r10, r10, 0x1 + str r10, [r8] + subs r6, r6, 0x1 + bge _08000298 + ldrb r0, [r11] + cmp r0, 0 + beq _08000334 + ldr r7, _08000344 + mov r0, 0 + strh r0, [r7] + ldrh r0, [r12, 0x8] + orr r0, r0, 0x80 + strh r0, [r12, 0x8] + mov r0, 0xC0 + strh r0, [r7] +_08000334: + add sp, sp, 0x8 + ldmia sp!, {r5-r11} + bx lr + .align 2, 0 +_08000340: .4byte gUnknown_202DCF8 +_08000344: .4byte 0x0400010e + arm_func_end sub_8000228 + + thumb_func_start GameLoop +GameLoop: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + movs r0, 0x1 + mov r9, r0 + bl InitHeap + bl sub_8011A38 + bl sub_801180C + bl nullsub_1 + bl sub_8014144 + bl sub_808CDC0 + bl sub_8097670 + bl sub_8094F88 + bl sub_8094980 + bl sub_8094C14 + bl sub_8097F5C + bl sub_80923A0 + bl sub_8090998 + bl sub_809207C + bl sub_8092848 + bl sub_80950BC + bl sub_80958E8 + movs r0, 0x80 + lsls r0, 8 + movs r1, 0 + bl sub_800CD64 + bl sub_8012284 + movs r0, 0x1 + bl sub_8094998 + ldr r0, _08000498 + bl nullsub_22 + bl sub_800DAAC + movs r0, 0 + bl SetSavingIconCoords + movs r0, 0 + str r0, [sp] + mov r0, sp + bl sub_8011DAC + cmp r0, 0 + beq _080003D2 + bl sub_800135C +_080003D2: + movs r0, 0xE + bl sub_8001334 + movs r0, 0xF + bl sub_8001334 + movs r0, 0 + movs r1, 0x39 + bl sub_80015C0 + movs r0, 0x10 + bl sub_8001334 + movs r0, 0 + movs r1, 0x39 + bl sub_8001658 + cmp r0, 0 + bne _080003FE + movs r0, 0x11 + bl sub_8001334 +_080003FE: + movs r1, 0 + mov r10, r1 + ldr r2, _0800049C + mov r8, r2 +_08000406: + ldr r0, _080004A0 + mov r1, r10 + str r1, [r0] + movs r0, 0x2 + bl sub_800A8F8 + movs r0, 0x1 + bl sub_8004D8C + movs r0, 0 + bl xxx_update_some_bg_tiles + bl sub_80097B0 + movs r0, 0x2 + bl sub_800CDA8 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r1, _080004A4 + movs r2, 0x80 + lsls r2, 5 + adds r0, r2, 0 + strh r0, [r1] + bl sub_8000634 + movs r0, 0 + movs r1, 0 + bl sub_800CCA0 + movs r0, 0 + movs r1, 0 + bl sub_800CCAC + mov r0, r10 + mov r1, r8 + str r0, [r1] +_08000456: + mov r2, r8 + ldr r0, [r2] + adds r0, 0x1 + str r0, [r2] + movs r4, 0 +_08000460: + ldr r0, _080004A8 + ldr r0, [r0] + lsls r2, r4, 2 + ldr r1, [r0, 0x4] + adds r1, r2 + mov r0, r8 + ldr r2, [r0] + adds r0, r4, 0 + movs r3, 0 + bl SetBGPaletteBufferColorRGB + adds r4, 0x1 + cmp r4, 0xEF + ble _08000460 + movs r0, 0 + bl xxx_update_stuff + mov r1, r8 + ldr r0, [r1] + cmp r0, 0x1F + ble _08000456 + mov r2, r9 + cmp r2, 0 + beq _080004C0 + bl sub_8012468 + b _080004B2 + .align 2, 0 +_08000498: .4byte gUnknown_80B69BC +_0800049C: .4byte gUnknown_2000A80 +_080004A0: .4byte gUnknown_203B03C +_080004A4: .4byte gUnknown_2026E4E +_080004A8: .4byte gUnknown_203B038 +_080004AC: + movs r0, 0 + bl xxx_update_stuff +_080004B2: + bl sub_8012484 + lsls r0, 24 + cmp r0, 0 + bne _080004AC + bl sub_8012558 +_080004C0: + movs r0, 0x1 + mov r9, r0 + movs r0, 0x8 + bl sub_800BDFC + movs r4, 0x1 + movs r0, 0 + movs r1, 0x14 + bl sub_80095CC + bl InitMainMenu +_080004D8: + bl sub_80363E0 + lsls r0, 24 + cmp r0, 0 + beq _08000522 + ldr r3, _080004FC + ldrh r1, [r3, 0x2] + movs r2, 0x80 + lsls r2, 2 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _08000500 + movs r4, 0 + movs r0, 0x13 + bl SetBGOBJEnableFlags + b _08000516 + .align 2, 0 +_080004FC: .4byte gUnknown_20255F0 +_08000500: + cmp r4, 0 + bne _08000522 + ldrh r1, [r3] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _08000516 + movs r4, 0x1 + movs r0, 0 + bl SetBGOBJEnableFlags +_08000516: + cmp r4, 0 + bne _08000522 + movs r0, 0 + bl xxx_update_stuff + b _080004D8 +_08000522: + bl SetUpMenu + movs r0, 0 + bl xxx_update_stuff + bl UpdateMenu + adds r5, r0, 0 + bl CleanUpMenu + cmp r5, 0x2 + beq _08000542 + cmp r5, 0x4 + beq _08000542 + cmp r5, 0x3 + bne _080004D8 +_08000542: + bl sub_80357D0 + mov r1, r8 + ldr r0, [r1] + cmp r0, 0 + ble _08000580 + ldr r7, _08000598 + adds r6, r7, 0 +_08000552: + ldr r0, [r6] + subs r0, 0x1 + str r0, [r6] + movs r4, 0 +_0800055A: + ldr r0, _0800059C + ldr r0, [r0] + lsls r2, r4, 2 + ldr r1, [r0, 0x4] + adds r1, r2 + ldr r2, [r6] + adds r0, r4, 0 + movs r3, 0 + bl SetBGPaletteBufferColorRGB + adds r4, 0x1 + cmp r4, 0xEF + ble _0800055A + movs r0, 0 + bl xxx_update_stuff + ldr r0, [r7] + cmp r0, 0 + bgt _08000552 +_08000580: + ldr r0, _0800059C + ldr r0, [r0] + bl sub_800AA14 + cmp r5, 0x3 + beq _080005CA + cmp r5, 0x3 + bhi _080005A0 + cmp r5, 0x2 + beq _080005A6 + b _08000406 + .align 2, 0 +_08000598: .4byte gUnknown_2000A80 +_0800059C: .4byte gUnknown_203B038 +_080005A0: + cmp r5, 0x4 + beq _080005C6 + b _08000406 +_080005A6: + movs r0, 0x7 + bl sub_80953D4 + adds r1, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080005C2 + lsls r0, r1, 24 + lsrs r0, 24 + bl sub_8095240 + movs r0, 0x2 + b _080005D4 +_080005C2: + movs r0, 0x1 + b _080005D4 +_080005C6: + movs r0, 0x3 + b _080005D4 +_080005CA: + bl sub_80122A8 + bl nullsub_33 + movs r0, 0 +_080005D4: + bl sub_80009D0 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + b _08000406 + thumb_func_end GameLoop + + thumb_func_start xxx_update_stuff +xxx_update_stuff: + push {lr} + bl sub_80144C4 + movs r0, 0 + movs r1, 0 + bl sub_8005838 + ldr r0, _08000630 + ldr r0, [r0] + ldrb r0, [r0, 0xA] + bl nullsub_8 + bl sub_8005180 + bl sub_80060EC + bl sub_8011860 + bl sub_800CB20 + bl sub_800485C + bl CopySpritesToOam + bl sub_8005304 + bl TransferBGPaletteBuffer + bl xxx_call_update_bg_vram + bl sub_8009908 + bl xxx_call_update_bg_sound_input + movs r0, 0 + bl sub_8004D8C + pop {r0} + bx r0 + .align 2, 0 +_08000630: .4byte gUnknown_203B46C + thumb_func_end xxx_update_stuff + + thumb_func_start sub_8000634 +sub_8000634: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x18 + mov r1, sp + ldr r0, _08000708 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + add r5, sp, 0xC + adds r1, r5, 0 + ldr r0, _0800070C + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r0, _08000710 + movs r1, 0 + bl MemoryAlloc + adds r7, r0, 0 + movs r0, 0x3 + bl RandomCapped + adds r4, r0, 0 + lsls r4, 2 + adds r5, r4 + ldr r0, [r5] + ldr r5, _08000714 + adds r1, r5, 0 + bl sub_800A9EC + ldr r1, _08000718 + str r0, [r1] + mov r1, sp + adds r0, r1, r4 + ldr r0, [r0] + adds r1, r5, 0 + bl sub_800A9EC + mov r8, r0 + adds r0, r7, 0 + movs r1, 0 + mov r2, r8 + bl sub_800AAA8 + movs r2, 0 + ldr r0, _0800071C + movs r3, 0xC0 + lsls r3, 5 + adds r3, r0 + mov r9, r3 + movs r4, 0x80 + lsls r4, 5 + adds r4, r0 + mov r12, r4 +_080006A0: + movs r5, 0 + lsls r1, r2, 6 + adds r6, r2, 0x1 + mov r0, r9 + adds r4, r1, r0 + mov r2, r12 + adds r3, r1, r2 + movs r2, 0x80 + lsls r2, 4 + adds r0, r7, r2 + adds r2, r1, r0 + adds r1, r7 +_080006B8: + ldrh r0, [r1] + strh r0, [r3] + ldrh r0, [r2] + strh r0, [r4] + adds r4, 0x2 + adds r3, 0x2 + adds r2, 0x2 + adds r1, 0x2 + adds r5, 0x1 + cmp r5, 0x1F + ble _080006B8 + adds r2, r6, 0 + cmp r2, 0x1F + ble _080006A0 + movs r0, 0x2 + bl sub_80098F8 + movs r0, 0x3 + bl sub_80098F8 + ldr r0, _08000720 + movs r3, 0x80 + lsls r3, 5 + adds r1, r7, r3 + ldr r2, _08000724 + bl CpuCopy + mov r0, r8 + bl sub_800AA14 + adds r0, r7, 0 + bl MemoryFree + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08000708: .4byte gUnknown_80B69F8 +_0800070C: .4byte gUnknown_80B6A28 +_08000710: .4byte 0x00005b20 +_08000714: .4byte gUnknown_8380000 +_08000718: .4byte gUnknown_203B038 +_0800071C: .4byte gUnknown_202B038 +_08000720: .4byte 0x06008000 +_08000724: .4byte 0x00004b20 + thumb_func_end sub_8000634 + + thumb_func_start sub_8000728 +sub_8000728: + ldr r0, _08000730 + ldr r0, [r0] + bx lr + .align 2, 0 +_08000730: .4byte gUnknown_203B03C + thumb_func_end sub_8000728 + + thumb_func_start sub_8000734 +sub_8000734: + push {r4-r6,lr} + sub sp, 0xC + adds r5, r0, 0 + movs r4, 0 + movs r6, 0 + movs r0, 0 + bl xxx_update_some_bg_tiles + bl sub_8014144 + bl sub_80097B0 + movs r0, 0x2 + bl sub_800CDA8 + movs r0, 0 + movs r1, 0x14 + bl sub_80095CC + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0 + movs r1, 0x14 + bl sub_8009408 + ldr r0, _080007AC + movs r2, 0x80 + lsls r2, 5 + adds r1, r2, 0 + strh r1, [r0] + bl sub_8099648 + bl sub_8094C14 + movs r0, 0 + bl sub_8099690 + bl sub_8099744 + bl sub_8099750 + movs r0, 0x3 + bl sub_80063D8 + movs r0, 0 + movs r1, 0 + bl sub_8005838 + bl sub_80060EC + ldr r0, _080007B0 + movs r1, 0 + movs r2, 0 + movs r3, 0x20 + bl sub_80141B4 + b _08000892 + .align 2, 0 +_080007AC: .4byte gUnknown_2026E4E +_080007B0: .4byte gUnknown_80B6A34 +_080007B4: + cmp r4, 0x1 + beq _0800086C + cmp r4, 0x1 + bgt _080007C2 + cmp r4, 0 + beq _080007CC + b _0800088E +_080007C2: + cmp r4, 0x2 + beq _08000884 + cmp r4, 0x3 + beq _08000892 + b _0800088E +_080007CC: + str r4, [sp, 0x4] + movs r0, 0x3F + str r0, [sp] + mov r0, sp + bl sub_8097688 + bl sub_80140DC + cmp r5, 0x3 + bhi _080007EC + add r0, sp, 0x4 + movs r1, 0x1 + bl sub_801203C + adds r4, r0, 0 + b _080007EE +_080007EC: + movs r4, 0x2 +_080007EE: + cmp r4, 0 + bne _080007FA + ldr r0, _08000818 + bl sub_80121E0 + adds r4, r0, 0 +_080007FA: + bl sub_8014114 + cmp r4, 0 + bne _0800083C + cmp r5, 0x1 + beq _08000812 + cmp r5, 0x1 + bcc _08000820 + cmp r5, 0x2 + beq _08000820 + cmp r5, 0x3 + bne _08000820 +_08000812: + ldr r0, _0800081C + b _08000822 + .align 2, 0 +_08000818: .4byte 0x000f1206 +_0800081C: .4byte gUnknown_80B6A7C +_08000820: + ldr r0, _08000834 +_08000822: + movs r1, 0 + movs r2, 0 + ldr r3, _08000838 + bl sub_80141B4 + movs r6, 0x3C + movs r4, 0x1 + b _08000892 + .align 2, 0 +_08000834: .4byte gUnknown_80B6AA0 +_08000838: .4byte 0x00000321 +_0800083C: + cmp r4, 0x1 + bne _08000854 + ldr r0, _08000850 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_80141B4 + movs r4, 0x3 + b _08000892 + .align 2, 0 +_08000850: .4byte gUnknown_80B6B14 +_08000854: + ldr r0, _08000864 + movs r1, 0 + movs r2, 0 + ldr r3, _08000868 + bl sub_80141B4 +_08000860: + movs r4, 0x2 + b _08000892 + .align 2, 0 +_08000864: .4byte gUnknown_80B6B78 +_08000868: .4byte 0x00000301 +_0800086C: + cmp r6, 0 + ble _08000860 + ldr r0, _08000880 + ldrh r1, [r0, 0x2] + subs r6, 0x1 + movs r0, 0x3 + ands r1, r0 + cmp r1, 0 + beq _08000892 + b _08000860 + .align 2, 0 +_08000880: .4byte gUnknown_20255F0 +_08000884: + add r0, sp, 0x8 + bl sub_80144A4 + cmp r0, 0 + bne _08000892 +_0800088E: + movs r4, 0x1 + negs r4, r4 +_08000892: + movs r0, 0 + bl xxx_update_stuff + cmp r4, 0 + bge _080007B4 + bl sub_8014490 + movs r0, 0 + bl xxx_update_stuff + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0 + bl xxx_update_stuff + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8000734 + + thumb_func_start sub_80008C0 +sub_80008C0: + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r4, 0 + movs r6, 0 + movs r0, 0 + bl xxx_update_some_bg_tiles + bl sub_8014144 + bl sub_80097B0 + movs r0, 0x2 + bl sub_800CDA8 + movs r0, 0 + movs r1, 0x14 + bl sub_80095CC + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0 + movs r1, 0x14 + bl sub_8009408 + ldr r1, _08000930 + movs r2, 0x80 + lsls r2, 5 + adds r0, r2, 0 + strh r0, [r1] + bl sub_8099648 + bl sub_8094C14 + movs r0, 0 + bl sub_8099690 + bl sub_8099744 + bl sub_8099750 + movs r0, 0x3 + bl sub_80063D8 + cmp r5, 0x1 + beq _08000948 + cmp r5, 0x1 + bcc _08000934 + cmp r5, 0x2 + beq _08000950 + cmp r5, 0x3 + beq _08000950 + b _080009A2 + .align 2, 0 +_08000930: .4byte gUnknown_2026E4E +_08000934: + ldr r0, _08000944 + movs r1, 0 + movs r2, 0 + movs r3, 0x20 + bl sub_80141B4 + movs r4, 0x2 + b _080009A2 + .align 2, 0 +_08000944: .4byte gUnknown_80B6B88 +_08000948: + ldr r0, _0800094C + b _08000952 + .align 2, 0 +_0800094C: .4byte gUnknown_80B6BDC +_08000950: + ldr r0, _08000960 +_08000952: + ldr r3, _08000964 + movs r1, 0 + movs r2, 0 + bl sub_80141B4 +_0800095C: + movs r4, 0x1 + b _080009A2 + .align 2, 0 +_08000960: .4byte gUnknown_80B6CB8 +_08000964: .4byte 0x00000301 +_08000968: + cmp r4, 0x1 + beq _08000994 + cmp r4, 0x1 + bgt _08000976 + cmp r4, 0 + beq _0800097C + b _0800099E +_08000976: + cmp r4, 0x2 + beq _080009A2 + b _0800099E +_0800097C: + cmp r6, 0 + ble _0800095C + ldr r0, _08000990 + ldrh r1, [r0, 0x2] + subs r6, 0x1 + movs r0, 0x3 + ands r1, r0 + cmp r1, 0 + beq _080009A2 + b _0800095C + .align 2, 0 +_08000990: .4byte gUnknown_20255F0 +_08000994: + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080009A2 +_0800099E: + movs r4, 0x1 + negs r4, r4 +_080009A2: + movs r0, 0 + bl xxx_update_stuff + cmp r4, 0 + bge _08000968 + bl sub_8014490 + movs r0, 0 + bl xxx_update_stuff + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0 + bl xxx_update_stuff + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80008C0 + + thumb_func_start sub_80009D0 +sub_80009D0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, _08000A04 + add sp, r4 + adds r4, r0, 0 + movs r0, 0 + movs r1, 0x18 + bl sub_8001658 + adds r7, r0, 0 + movs r0, 0 + mov r10, r0 + bl sub_801180C + movs r0, 0x10 + bl sub_80118C4 + cmp r7, 0x7 + bne _08000A30 + cmp r4, 0x2 + bne _08000A08 + movs r7, 0x8 + b _08000A3A + .align 2, 0 +_08000A04: .4byte 0xfffffdd4 +_08000A08: + cmp r4, 0x3 + bne _08000A3A + movs r7, 0xB + movs r0, 0 + movs r1, 0x18 + movs r2, 0xB + bl sub_80018D8 + bl sub_8096BD0 + movs r0, 0x3 + bl sub_8000734 + b _08000A3A +_08000A24: + movs r3, 0x1 + mov r10, r3 + b _08000EC6 +_08000A2A: + movs r0, 0x1 + mov r10, r0 + b _08000EC6 +_08000A30: + cmp r7, 0 + beq _08000A3A + cmp r7, 0xB + beq _08000A3A + movs r7, 0x1 +_08000A3A: + movs r0, 0 + movs r1, 0x41 + bl sub_80015C0 +_08000A42: + cmp r7, 0x4 + bne _08000AB6 + movs r0, 0 + movs r1, 0xD + bl sub_8001658 + lsls r0, 16 + asrs r0, 16 + bl sub_8002658 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _08000A9C + movs r1, 0x8 + bl MemoryAlloc + str r0, [sp, 0x8] + mov r0, sp + strb r4, [r0, 0x4] + movs r0, 0x9 + bl sub_80023E4 + mov r1, sp + strb r0, [r1, 0x5] + mov r0, sp + bl sub_800F990 + ldr r0, [sp, 0x8] + bl MemoryFree + mov r0, sp + ldrb r0, [r0, 0xC] + cmp r0, 0x3A + beq _08000B70 + mov r0, sp + ldrb r0, [r0, 0xC] + cmp r0, 0 + beq _08000AA0 + bl sub_8002694 + lsls r0, 16 + asrs r2, r0, 16 + b _08000AA2 + .align 2, 0 +_08000A9C: .4byte 0x00004e30 +_08000AA0: + movs r2, 0x9 +_08000AA2: + movs r0, 0 + movs r1, 0xD + bl sub_80018D8 + movs r0, 0 + movs r1, 0xE + movs r2, 0 + bl sub_80018D8 + b _08000B70 +_08000AB6: + cmp r7, 0x5 + bne _08000B9C + movs r0, 0 + movs r1, 0x12 + bl sub_8001658 + lsls r0, 16 + asrs r0, 16 + mov r8, r0 + bl sub_80A2740 + lsls r0, 24 + lsrs r6, r0, 24 + movs r4, 0 + ldr r5, _08000B18 + add r5, sp +_08000AD6: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_80A28F0 + adds r1, r5, r4 + strb r0, [r1] + adds r4, 0x1 + cmp r4, 0x3E + ble _08000AD6 + cmp r6, 0x63 + beq _08000B70 + add r4, sp, 0xB8 + movs r0, 0x3F + strb r0, [r4, 0x4] + add r0, sp, 0xC0 + adds r1, r6, 0 + bl sub_80011CC + ldrb r1, [r4, 0xD] + add r0, sp, 0x128 + strb r1, [r0] + mov r0, r8 + bl sub_80A2750 + lsls r0, 16 + asrs r0, 16 + adds r5, r4, 0 + cmp r0, 0x1 + beq _08000B1C + cmp r0, 0x2 + beq _08000B3C + b _08000B50 + .align 2, 0 +_08000B18: .4byte 0x00000129 +_08000B1C: + add r4, sp, 0x170 + add r0, sp, 0x174 + mov r1, r8 + bl sub_80990EC + lsls r0, 24 + cmp r0, 0 + beq _08000B50 + ldrb r0, [r4, 0x10] + strb r0, [r5, 0x14] + add r0, sp, 0xD0 + add r1, sp, 0x18C + movs r2, 0x58 + bl memcpy + b _08000B50 +_08000B3C: + ldrb r0, [r5, 0x8] + add r1, sp, 0xD0 + bl sub_8096A08 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _08000B4E + movs r0, 0x1 +_08000B4E: + strb r0, [r5, 0x14] +_08000B50: + ldr r0, _08000B74 + movs r1, 0x8 + bl MemoryAlloc + add r4, sp, 0x168 + str r0, [r4] + adds r0, r5, 0 + bl sub_8010268 + ldr r0, [r4] + bl MemoryFree + add r0, sp, 0x16C + ldrb r0, [r0] + cmp r0, 0 + bne _08000B78 +_08000B70: + movs r7, 0x2 + b _08000A42 + .align 2, 0 +_08000B74: .4byte 0x00006474 +_08000B78: + movs r0, 0 + movs r1, 0x13 + mov r2, r8 + bl sub_80018D8 + ldr r1, _08000B98 + movs r0, 0x2 + str r0, [r1] + movs r0, 0x4 + bl sub_800A8F8 + movs r0, 0x5 + bl sub_8001334 + adds r5, r0, 0 + b _08000BEC + .align 2, 0 +_08000B98: .4byte gUnknown_203B03C +_08000B9C: + cmp r7, 0x8 + bne _08000BA4 + movs r5, 0 + b _08000BEC +_08000BA4: + cmp r7, 0x7 + bne _08000BAC + movs r5, 0x2 + b _08000BEC +_08000BAC: + cmp r7, 0xB + bne _08000BB6 + bl sub_80012C0 + b _08000BBE +_08000BB6: + cmp r7, 0xC + bne _08000BBE + bl sub_8001248 +_08000BBE: + ldr r1, _08000BE0 + movs r0, 0x2 + str r0, [r1] + movs r0, 0x4 + bl sub_800A8F8 + adds r0, r7, 0 + bl sub_8001334 + adds r5, r0, 0 + cmp r5, 0xE + bne _08000BD8 + b _08000EC6 +_08000BD8: + cmp r5, 0x5 + bne _08000BE4 + movs r7, 0x4 + b _08000A42 + .align 2, 0 +_08000BE0: .4byte gUnknown_203B03C +_08000BE4: + cmp r5, 0x6 + bne _08000BEC + movs r7, 0x5 + b _08000A42 +_08000BEC: + add r6, sp, 0x170 + movs r4, 0 + strb r4, [r6, 0x11] + strb r4, [r6, 0x10] + movs r3, 0xC6 + lsls r3, 1 + add r3, sp + mov r8, r3 + mov r0, r8 + movs r1, 0 + movs r2, 0x58 + bl MemoryFill8 + movs r0, 0 + mov r9, r0 + strh r4, [r6, 0x24] + cmp r5, 0x7 + beq _08000C3C + cmp r5, 0x8 + bne _08000C38 + add r0, sp, 0x174 + add r1, sp, 0x228 + bl sub_80991E0 + lsls r0, 24 + cmp r0, 0 + beq _08000C4C + ldrb r0, [r6, 0x4] + mov r1, r8 + bl sub_8096A08 + lsls r0, 24 + cmp r0, 0 + bne _08000C32 + b _08000D98 +_08000C32: + movs r0, 0x1 + strb r0, [r6, 0x10] + b _08000D98 +_08000C38: + cmp r5, 0xA + bne _08000C52 +_08000C3C: + add r0, sp, 0x174 + add r1, sp, 0x228 + bl sub_80991E0 + lsls r0, 24 + cmp r0, 0 + beq _08000C4C + b _08000D98 +_08000C4C: + movs r5, 0xD + movs r7, 0x9 + b _08000D98 +_08000C52: + cmp r5, 0x9 + bne _08000C6C + add r0, sp, 0x174 + add r1, sp, 0x228 + bl sub_80991E0 + lsls r0, 24 + cmp r0, 0 + beq _08000C66 + b _08000D98 +_08000C66: + movs r5, 0xB + movs r7, 0xC + b _08000D98 +_08000C6C: + cmp r5, 0 + bne _08000D04 + bl sub_8011FA8 + adds r1, r0, 0 + ldr r0, _08000CA0 + cmp r1, r0 + bne _08000CC8 + movs r2, 0x1 + strb r2, [r6, 0x11] + strb r2, [r6, 0x8] + mov r3, r9 + strb r3, [r6, 0xF] + ldr r0, _08000CA4 + ldr r1, [r0] + movs r3, 0xC + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _08000CA8 + strb r2, [r6, 0x10] + adds r1, 0x4 + mov r0, r8 + movs r2, 0x58 + bl memcpy + b _08000CAC + .align 2, 0 +_08000CA0: .4byte 0x000f1207 +_08000CA4: .4byte gUnknown_203B484 +_08000CA8: + mov r0, r9 + strb r0, [r6, 0x10] +_08000CAC: + ldr r4, _08000CC4 + ldr r0, [r4] + adds r0, 0x4 + movs r1, 0 + movs r2, 0x58 + bl MemoryFill8 + ldr r1, [r4] + movs r0, 0 + strh r0, [r1, 0xC] + b _08000CE4 + .align 2, 0 +_08000CC4: .4byte gUnknown_203B484 +_08000CC8: + ldr r0, _08000CD8 + cmp r1, r0 + bne _08000CDC + movs r5, 0x1 + movs r7, 0xB + bl sub_8096BD0 + b _08000CE4 + .align 2, 0 +_08000CD8: .4byte 0x000f1208 +_08000CDC: + movs r5, 0x1 + movs r7, 0xB + bl sub_8096BD0 +_08000CE4: + cmp r5, 0x1 + bne _08000D98 + ldr r4, _08000D00 + ldr r0, [r4] + adds r0, 0x4 + movs r1, 0 + movs r2, 0x58 + bl MemoryFill8 + ldr r1, [r4] + movs r0, 0 + strh r0, [r1, 0xC] + b _08000D98 + .align 2, 0 +_08000D00: .4byte gUnknown_203B484 +_08000D04: + cmp r5, 0x2 + bne _08000D98 + bl sub_8011C1C + cmp r0, 0x2 + bne _08000D34 + bl sub_8011FA8 + adds r1, r0, 0 + movs r0, 0x1 + strb r0, [r6, 0x8] + mov r3, r9 + strb r3, [r6, 0x11] + ldr r0, _08000D30 + cmp r1, r0 + beq _08000D36 + adds r0, 0x1 + movs r5, 0x1 + movs r7, 0xB + bl sub_8096BD0 + b _08000D36 + .align 2, 0 +_08000D30: .4byte 0x000f1207 +_08000D34: + movs r5, 0x3 +_08000D36: + cmp r5, 0x3 + bne _08000D7A + bl sub_8001170 + lsls r0, 24 + lsrs r4, r0, 24 + movs r5, 0x1 + movs r7, 0xB + bl sub_8096BD0 + cmp r4, 0x3F + beq _08000D70 + cmp r4, 0x63 + beq _08000D70 + adds r0, r4, 0 + bl sub_80900E4 + lsls r0, 24 + cmp r0, 0 + beq _08000D70 + bl sub_8011C1C + cmp r0, 0x2 + bne _08000D6C + movs r5, 0x3 + movs r7, 0x7 + b _08000D70 +_08000D6C: + movs r5, 0xC + movs r7, 0xA +_08000D70: + cmp r5, 0x1 + bne _08000D98 + bl sub_8011C1C + b _08000D98 +_08000D7A: + cmp r5, 0x4 + bne _08000D8E + movs r5, 0x1 + movs r7, 0xB + bl sub_8096BD0 + movs r0, 0x1 + bl sub_80008C0 + b _08000D98 +_08000D8E: + cmp r5, 0x1 + bne _08000D98 + movs r7, 0xB + bl sub_8096BD0 +_08000D98: + subs r0, r5, 0x7 + cmp r0, 0x3 + bls _08000DAC + cmp r5, 0 + beq _08000E1E + cmp r5, 0x2 + beq _08000DAC + cmp r5, 0x3 + beq _08000DAC + b _08000A42 +_08000DAC: + cmp r5, 0 + beq _08000E1E + cmp r5, 0x2 + beq _08000E1E + cmp r5, 0x3 + beq _08000E1E + bl sub_8001170 + lsls r0, 24 + lsrs r6, r0, 24 + bl sub_8097758 + cmp r5, 0x9 + bne _08000E00 + ldr r4, _08000DF4 + add r4, sp + adds r0, r4, 0 + bl sub_8099394 + lsls r0, 24 + cmp r0, 0 + beq _08000E00 + ldrb r0, [r4] + bl sub_8095228 + adds r2, r0, 0 + adds r0, 0x2C + ldrb r1, [r0] + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0x1 + ble _08000DF8 + subs r1, 0x1 + b _08000DFA + .align 2, 0 +_08000DF4: .4byte 0x0000022a +_08000DF8: + movs r1, 0 +_08000DFA: + adds r0, r2, 0 + adds r0, 0x2C + strb r1, [r0] +_08000E00: + cmp r6, 0x3F + bne _08000E0C + movs r0, 0 + bl sub_8000734 + b _08000E1E +_08000E0C: + adds r0, r6, 0 + bl sub_80900E4 + lsls r0, 24 + cmp r0, 0 + bne _08000E1E + movs r0, 0 + bl sub_8000734 +_08000E1E: + ldr r0, _08000E70 + movs r4, 0x1 + str r4, [r0] + movs r0, 0x3 + bl sub_800A8F8 + add r5, sp, 0x170 + str r4, [r5] + add r0, sp, 0x174 + bl sub_80011E8 + adds r0, r5, 0 + bl sub_8000EDC + add r4, sp, 0x1EC + movs r0, 0 + ldrsh r1, [r4, r0] + cmp r1, 0x3 + bne _08000E46 + b _08000A24 +_08000E46: + movs r0, 0x2 + negs r0, r0 + cmp r1, r0 + bne _08000E50 + b _08000A2A +_08000E50: + movs r0, 0 + movs r1, 0x41 + bl sub_80015C0 + ldrh r0, [r4] + adds r0, 0x1 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x6 + bhi _08000EBE + lsls r0, 2 + ldr r1, _08000E74 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08000E70: .4byte gUnknown_203B03C +_08000E74: .4byte _08000E78 + .align 2, 0 +_08000E78: + .4byte _08000EB6 + .4byte _08000EBE + .4byte _08000E94 + .4byte _08000EB2 + .4byte _08000EBE + .4byte _08000E94 + .4byte _08000EBE +_08000E94: + movs r7, 0x9 + movs r0, 0xF7 + lsls r0, 1 + add r0, sp + ldrb r0, [r0] + movs r3, 0x1 + cmp r0, 0 + beq _08000EA6 + movs r3, 0x2 +_08000EA6: + movs r0, 0 + movs r1, 0x41 + movs r2, 0 + bl sub_800199C + b _08000A42 +_08000EB2: + movs r7, 0xA + b _08000A42 +_08000EB6: + movs r7, 0xC + bl sub_8096BD0 + b _08000A42 +_08000EBE: + movs r7, 0xB + bl sub_8096BD0 + b _08000A42 +_08000EC6: + mov r0, r10 + movs r3, 0x8B + lsls r3, 2 + add sp, r3 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80009D0 + + thumb_func_start sub_8000EDC +sub_8000EDC: + push {r4-r7,lr} + sub sp, 0x8 + adds r4, r0, 0 + movs r5, 0x1 + ldr r0, _08000F24 + str r5, [r0] + movs r0, 0x3 + bl sub_800A8F8 + bl sub_8014144 + add r1, sp, 0x4 + mov r0, sp + bl sub_8043D50 + ldr r0, [sp] + movs r1, 0x7 + bl MemoryAlloc + str r0, [r4, 0x74] + ldr r0, [sp, 0x4] + movs r1, 0x7 + bl MemoryAlloc + str r0, [r4, 0x78] + ldrb r0, [r4, 0x8] + cmp r0, 0 + beq _08000F68 + ldr r0, [r4, 0x74] + ldr r1, [sp] + bl sub_801277C + adds r7, r4, 0 + adds r7, 0x7C + b _08000F2E + .align 2, 0 +_08000F24: .4byte gUnknown_203B03C +_08000F28: + movs r0, 0 + bl xxx_update_stuff +_08000F2E: + bl sub_80127A8 + lsls r0, 24 + cmp r0, 0 + bne _08000F28 + bl sub_8012828 + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_8012834 + bl sub_8011830 + cmp r5, 0 + beq _08000F58 + ldr r0, _08000F54 + bl sub_80121E0 + b _08000F5E + .align 2, 0 +_08000F54: .4byte 0x000f1208 +_08000F58: + ldr r0, _08000F64 + bl sub_80121E0 +_08000F5E: + bl sub_8011854 + b _08000F78 + .align 2, 0 +_08000F64: .4byte 0x000f1209 +_08000F68: + bl sub_809674C + bl sub_80961B4 + bl sub_808ED00 + adds r7, r4, 0 + adds r7, 0x7C +_08000F78: + cmp r5, 0 + beq _08000F92 + adds r0, r4, 0 + bl sub_8001340 + bl sub_8099648 + bl sub_8094C14 + movs r0, 0 + bl sub_8099690 + b _08000F96 +_08000F92: + movs r0, 0x5 + strh r0, [r7] +_08000F96: + adds r5, r7, 0 + movs r1, 0 + ldrsh r0, [r5, r1] + movs r6, 0x2 + negs r6, r6 + cmp r0, r6 + bne _08000FAC + adds r0, r4, 0 + adds r0, 0x84 + bl sub_809542C +_08000FAC: + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0x3 + beq _08000FB8 + cmp r0, r6 + bne _0800100C +_08000FB8: + adds r0, r4, 0 + adds r0, 0x80 + bl sub_8097688 + bl sub_8011924 + movs r1, 0 + ldrsh r0, [r7, r1] + cmp r0, r6 + bne _08000FD8 + ldr r0, [r4, 0x74] + ldr r1, [sp] + movs r2, 0x1 + bl sub_8012850 + b _08000FFA +_08000FD8: + ldr r0, [r4, 0x74] + ldr r1, [sp] + movs r2, 0 + bl sub_8012850 + b _08000FFA +_08000FE4: + cmp r0, 0x1 + bne _08000FF4 + ldr r0, [r4, 0x78] + bl MemoryFree + ldr r0, [r4, 0x74] + bl MemoryFree +_08000FF4: + movs r0, 0 + bl xxx_update_stuff +_08000FFA: + bl sub_80128B0 + cmp r0, 0x2 + beq _08001006 + cmp r0, 0x3 + bne _08000FE4 +_08001006: + bl sub_80129FC + b _0800101C +_0800100C: + bl sub_808ED00 + ldr r0, [r4, 0x78] + bl MemoryFree + ldr r0, [r4, 0x74] + bl MemoryFree +_0800101C: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8000EDC + + thumb_func_start sub_8001024 +sub_8001024: + push {r4,lr} + ldr r1, _08001040 + ldm r1!, {r2-r4} + stm r0!, {r2-r4} + ldm r1!, {r2-r4} + stm r0!, {r2-r4} + ldm r1!, {r2-r4} + stm r0!, {r2-r4} + ldm r1!, {r2-r4} + stm r0!, {r2-r4} + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08001040: .4byte gUnknown_203B040 + thumb_func_end sub_8001024 + + thumb_func_start sub_8001044 +sub_8001044: + push {r4,lr} + ldr r1, _08001060 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08001060: .4byte gUnknown_203B040 + thumb_func_end sub_8001044 + + thumb_func_start sub_8001064 +sub_8001064: + push {r4,r5,lr} + sub sp, 0x28 + bl sub_808D33C + cmp r0, 0 + bne _080010AE + ldr r5, _0800109C + ldrb r0, [r5, 0x8] + cmp r0, 0 + bne _080010A0 + add r4, sp, 0x14 + movs r0, 0x4 + ldrsh r1, [r5, r0] + adds r0, r4, 0 + bl sub_808D8BC + mov r0, sp + adds r1, r4, 0 + bl sub_80922F4 + movs r1, 0x4 + ldrsh r0, [r5, r1] + movs r1, 0x1 + mov r2, sp + bl sub_808CE74 + b _080010AE + .align 2, 0 +_0800109C: .4byte gUnknown_203B040 +_080010A0: + movs r4, 0x4 + ldrsh r0, [r5, r4] + adds r2, r5, 0 + adds r2, 0x8 + movs r1, 0x1 + bl sub_808CE74 +_080010AE: + bl sub_808D378 + cmp r0, 0 + bne _080010F2 + ldr r5, _080010E0 + ldrb r0, [r5, 0x1C] + cmp r0, 0 + bne _080010E4 + add r4, sp, 0x14 + movs r0, 0x6 + ldrsh r1, [r5, r0] + adds r0, r4, 0 + bl sub_808D8BC + mov r0, sp + adds r1, r4, 0 + bl sub_80922F4 + movs r1, 0x6 + ldrsh r0, [r5, r1] + movs r1, 0 + mov r2, sp + bl sub_808CE74 + b _080010F2 + .align 2, 0 +_080010E0: .4byte gUnknown_203B040 +_080010E4: + movs r4, 0x6 + ldrsh r0, [r5, r4] + adds r2, r5, 0 + adds r2, 0x1C + movs r1, 0 + bl sub_808CE74 +_080010F2: + ldr r3, _08001164 + movs r0, 0x4 + ldrsh r1, [r3, r0] + cmp r1, 0 + beq _08001126 + ldr r2, _08001168 + movs r4, 0x4 + ldrsh r0, [r2, r4] + cmp r0, 0 + beq _0800111C + cmp r1, r0 + beq _0800111C +_0800110A: + adds r2, 0x8 + movs r0, 0x4 + ldrsh r1, [r2, r0] + cmp r1, 0 + beq _0800111C + movs r4, 0x4 + ldrsh r0, [r3, r4] + cmp r0, r1 + bne _0800110A +_0800111C: + ldr r2, [r2] + movs r0, 0 + movs r1, 0x27 + bl sub_80018D8 +_08001126: + ldr r3, _08001164 + movs r0, 0x6 + ldrsh r1, [r3, r0] + cmp r1, 0 + beq _0800115A + ldr r2, _0800116C + movs r4, 0x4 + ldrsh r0, [r2, r4] + cmp r0, 0 + beq _08001150 + cmp r1, r0 + beq _08001150 +_0800113E: + adds r2, 0x8 + movs r0, 0x4 + ldrsh r1, [r2, r0] + cmp r1, 0 + beq _08001150 + movs r4, 0x6 + ldrsh r0, [r3, r4] + cmp r0, r1 + bne _0800113E +_08001150: + ldr r2, [r2] + movs r0, 0 + movs r1, 0x26 + bl sub_80018D8 +_0800115A: + add sp, 0x28 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08001164: .4byte gUnknown_203B040 +_08001168: .4byte gUnknown_80B690C +_0800116C: .4byte gUnknown_80B6994 + thumb_func_end sub_8001064 + + thumb_func_start sub_8001170 +sub_8001170: + push {r4,lr} + sub sp, 0x8 + add r4, sp, 0x4 + movs r0, 0x63 + strb r0, [r4] + mov r1, sp + adds r1, 0x2 + mov r0, sp + bl sub_80992E0 + lsls r0, 24 + cmp r0, 0 + beq _08001196 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + bl sub_80A2740 + b _080011BE +_08001196: + adds r0, r4, 0 + bl sub_8099328 + lsls r0, 24 + cmp r0, 0 + bne _080011C0 + adds r0, r4, 0 + bl sub_8099360 + lsls r0, 24 + cmp r0, 0 + bne _080011C0 + mov r0, sp + adds r0, 0x5 + bl sub_8099394 + lsls r0, 24 + cmp r0, 0 + beq _080011C0 + movs r0, 0x3F +_080011BE: + strb r0, [r4] +_080011C0: + ldrb r0, [r4] + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8001170 + + thumb_func_start sub_80011CC +sub_80011CC: + push {r4,r5,lr} + adds r4, r0, 0 + movs r5, 0 + strb r1, [r4] + strb r5, [r4, 0x1] + bl sub_80011E8 + strb r5, [r4, 0xB] + strb r5, [r4, 0x4] + strb r5, [r4, 0xC] + strb r5, [r4, 0xD] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80011CC + + thumb_func_start sub_80011E8 +sub_80011E8: + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x8 + bl sub_80023E4 + strb r0, [r4, 0x5] + movs r0, 0x3 + bl sub_80023E4 + strb r0, [r4, 0x6] + movs r0, 0x7 + bl sub_80023E4 + strb r0, [r4, 0x8] + movs r0, 0 + bl sub_80023E4 + strb r0, [r4, 0x9] + movs r0, 0x5 + bl sub_80023E4 + strb r0, [r4, 0xA] + movs r0, 0x18 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _0800123C + movs r0, 0x19 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _0800123C + movs r0, 0x1A + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _0800123C + movs r0, 0x1 + b _0800123E +_0800123C: + movs r0, 0 +_0800123E: + strb r0, [r4, 0x7] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80011E8 + + thumb_func_start sub_8001248 +sub_8001248: + push {r4,r5,lr} + movs r4, 0 + movs r5, 0 +_0800124E: + movs r0, 0x64 + bl RandomCapped + cmp r0, 0x31 + bgt _08001266 + lsls r0, r4, 2 + ldr r1, _080012B8 + ldr r1, [r1] + adds r0, r1 + strb r5, [r0, 0x2] + strb r5, [r0, 0x1] + strb r5, [r0] +_08001266: + adds r4, 0x1 + cmp r4, 0x13 + ble _0800124E + bl sub_80910B4 + movs r4, 0 + ldr r5, _080012BC + movs r3, 0x1 +_08001276: + movs r0, 0x58 + adds r1, r4, 0 + muls r1, r0 + ldr r0, [r5] + adds r1, r0, r1 + ldrh r2, [r1] + adds r0, r3, 0 + ands r0, r2 + cmp r0, 0 + beq _08001298 + lsrs r0, r2, 1 + ands r0, r3 + cmp r0, 0 + beq _08001298 + adds r1, 0x28 + movs r0, 0 + strb r0, [r1] +_08001298: + adds r4, 0x1 + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + ble _08001276 + ldr r0, _080012B8 + ldr r0, [r0] + movs r1, 0x98 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080012B8: .4byte gUnknown_203B460 +_080012BC: .4byte gUnknown_203B45C + thumb_func_end sub_8001248 + + thumb_func_start sub_80012C0 +sub_80012C0: + push {r4,r5,lr} + movs r3, 0 + ldr r4, _08001324 + movs r2, 0 +_080012C8: + lsls r1, r3, 2 + ldr r0, [r4] + adds r1, r0 + strb r2, [r1, 0x2] + strb r2, [r1, 0x1] + strb r2, [r1] + adds r3, 0x1 + cmp r3, 0x13 + ble _080012C8 + bl sub_80910B4 + movs r3, 0 + ldr r5, _08001328 + movs r4, 0x1 +_080012E4: + movs r0, 0x58 + adds r1, r3, 0 + muls r1, r0 + ldr r0, [r5] + adds r1, r0, r1 + ldrh r2, [r1] + adds r0, r4, 0 + ands r0, r2 + cmp r0, 0 + beq _08001306 + lsrs r0, r2, 1 + ands r0, r4 + cmp r0, 0 + beq _08001306 + adds r1, 0x28 + movs r0, 0 + strb r0, [r1] +_08001306: + adds r3, 0x1 + movs r0, 0xCE + lsls r0, 1 + cmp r3, r0 + ble _080012E4 + ldr r0, _08001324 + ldr r0, [r0] + movs r1, 0x98 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08001324: .4byte gUnknown_203B460 +_08001328: .4byte gUnknown_203B45C + thumb_func_end sub_80012C0 + + thumb_func_start nullsub_1 +nullsub_1: + bx lr + thumb_func_end nullsub_1 + + thumb_func_start nullsub_2 +nullsub_2: + bx lr + thumb_func_end nullsub_2 + + thumb_func_start sub_8001334 +sub_8001334: + push {lr} + bl sub_8098468 + pop {r1} + bx r1 + thumb_func_end sub_8001334 + + thumb_func_start sub_8001340 +sub_8001340: + push {r4,lr} + adds r4, r0, 0 + bl nullsub_2 + adds r0, r4, 0 + bl sub_8042F6C + bl nullsub_1 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8001340 + + thumb_func_start nullsub_3 +nullsub_3: + bx lr + thumb_func_end nullsub_3 + + thumb_func_start sub_800135C +sub_800135C: + push {r4-r7,lr} + movs r1, 0 + ldr r4, _0800138C + ldr r3, _08001390 + movs r2, 0 +_08001366: + adds r0, r1, r3 + strb r2, [r0] + adds r1, 0x1 + cmp r1, r4 + ble _08001366 + movs r6, 0 +_08001372: + lsls r1, r6, 4 + ldr r0, _08001394 + adds r5, r1, r0 + movs r1, 0 + ldrsh r0, [r5, r1] + adds r7, r6, 0x1 + cmp r0, 0 + beq _080013B4 + cmp r0, 0x8 + beq _080013B4 + movs r4, 0 + b _080013AC + .align 2, 0 +_0800138C: .4byte 0x000003ff +_08001390: .4byte gUnknown_2000A88 +_08001394: .4byte gUnknown_80B7394 +_08001398: + movs r0, 0xA + ldrsh r3, [r5, r0] + movs r0, 0 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_800199C + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 +_080013AC: + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r4, r0 + blt _08001398 +_080013B4: + lsls r0, r7, 16 + asrs r6, r0, 16 + cmp r6, 0x50 + ble _08001372 + movs r0, 0 + movs r1, 0x1 + bl sub_80015C0 + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl sub_8001BB4 + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + bl sub_8001BB4 + movs r0, 0x4 + movs r1, 0 + movs r2, 0 + bl sub_8001BB4 + movs r0, 0x5 + movs r1, 0 + movs r2, 0 + bl sub_8001BB4 + movs r0, 0x6 + movs r1, 0 + movs r2, 0 + bl sub_8001BB4 + movs r0, 0x7 + movs r1, 0 + movs r2, 0 + bl sub_8001BB4 + movs r0, 0x8 + movs r1, 0 + movs r2, 0 + bl sub_8001BB4 + movs r0, 0x9 + movs r1, 0 + movs r2, 0 + bl sub_8001BB4 + movs r0, 0xA + movs r1, 0 + movs r2, 0 + bl sub_8001BB4 + movs r0, 0xB + movs r1, 0 + movs r2, 0 + bl sub_8001BB4 + movs r0, 0xC + movs r1, 0 + movs r2, 0 + bl sub_8001BB4 + movs r0, 0 + movs r1, 0xD + movs r2, 0xA2 + bl sub_80018D8 + movs r0, 0 + movs r1, 0xE + movs r2, 0 + bl sub_80018D8 + movs r0, 0 + movs r1, 0xF + movs r2, 0xA2 + bl sub_80018D8 + movs r4, 0x1 + negs r4, r4 + movs r0, 0 + movs r1, 0x10 + adds r2, r4, 0 + bl sub_80018D8 + movs r0, 0 + movs r1, 0x11 + movs r2, 0x24 + bl sub_80018D8 + movs r0, 0 + movs r1, 0x12 + adds r2, r4, 0 + bl sub_80018D8 + movs r0, 0 + movs r1, 0x13 + movs r2, 0 + bl sub_80018D8 + movs r0, 0 + movs r1, 0x14 + adds r2, r4, 0 + bl sub_80018D8 + movs r0, 0 + movs r1, 0x16 + movs r2, 0 + bl sub_80018D8 + movs r0, 0 + movs r1, 0x18 + movs r2, 0 + bl sub_80018D8 + movs r0, 0 + movs r1, 0x19 + movs r2, 0 + bl sub_80018D8 + movs r0, 0 + movs r1, 0x1B + adds r2, r4, 0 + bl sub_80018D8 + movs r0, 0 + movs r1, 0x1C + movs r2, 0 + bl sub_80018D8 + movs r0, 0 + movs r1, 0x1D + movs r2, 0 + bl sub_80018D8 + movs r0, 0 + movs r1, 0x1E + movs r2, 0 + bl sub_80018D8 + movs r0, 0 + movs r1, 0x1F + movs r2, 0 + bl sub_80018D8 + movs r0, 0 + movs r1, 0x24 + bl sub_80015C0 + movs r0, 0 + movs r1, 0x25 + movs r2, 0 + bl sub_80018D8 + movs r0, 0 + movs r1, 0x26 + movs r2, 0 + bl sub_80018D8 + movs r0, 0 + movs r1, 0x27 + movs r2, 0 + bl sub_80018D8 + movs r0, 0 + movs r1, 0x28 + movs r2, 0 + bl sub_80018D8 + movs r0, 0 + movs r1, 0x29 + movs r2, 0 + bl sub_80018D8 + movs r0, 0 + movs r1, 0x2A + movs r2, 0 + bl sub_80018D8 + movs r0, 0 + movs r1, 0x2B + bl sub_80015C0 + movs r0, 0 + movs r1, 0x2C + bl sub_80015C0 + movs r0, 0 + movs r1, 0x2D + bl sub_80015C0 + movs r0, 0 + movs r1, 0x2E + bl sub_80015C0 + movs r0, 0 + movs r1, 0x2F + bl sub_80015C0 + movs r0, 0 + movs r1, 0x30 + bl sub_80015C0 + movs r0, 0 + movs r1, 0x31 + bl sub_80015C0 + movs r0, 0 + movs r1, 0x41 + bl sub_80015C0 + bl sub_80972F4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_800135C + + thumb_func_start sub_8001564 +sub_8001564: + push {lr} + bl nullsub_128 + pop {r0} + bx r0 + thumb_func_end sub_8001564 + + thumb_func_start sub_8001570 +sub_8001570: + push {r4-r7,lr} + adds r7, r0, 0 + lsls r1, 16 + asrs r6, r1, 16 + ldr r0, _08001584 + cmp r6, r0 + bgt _0800158C + lsls r1, r6, 4 + ldr r0, _08001588 + b _08001590 + .align 2, 0 +_08001584: .4byte 0x000003ff +_08001588: .4byte gUnknown_80B7394 +_0800158C: + lsls r1, r6, 4 + ldr r0, _08001598 +_08001590: + adds r5, r1, r0 + movs r4, 0 + b _080015B0 + .align 2, 0 +_08001598: .4byte 0x080b2d30 +_0800159C: + movs r0, 0xA + ldrsh r3, [r5, r0] + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_800199C + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 +_080015B0: + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r4, r0 + blt _0800159C + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8001570 + + thumb_func_start sub_80015C0 +sub_80015C0: + push {r4-r7,lr} + adds r7, r0, 0 + lsls r1, 16 + asrs r6, r1, 16 + ldr r0, _080015D4 + cmp r6, r0 + bgt _080015DC + lsls r1, r6, 4 + ldr r0, _080015D8 + b _080015E0 + .align 2, 0 +_080015D4: .4byte 0x000003ff +_080015D8: .4byte gUnknown_80B7394 +_080015DC: + lsls r1, r6, 4 + ldr r0, _080015E8 +_080015E0: + adds r5, r1, r0 + movs r4, 0 + b _080015FE + .align 2, 0 +_080015E8: .4byte 0x080b2d30 +_080015EC: + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r4, 0 + movs r3, 0 + bl sub_800199C + adds r0, r4, 0x1 + lsls r0, 16 + lsrs r4, r0, 16 +_080015FE: + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r4, r0 + blt _080015EC + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80015C0 + + thumb_func_start sub_800160C +sub_800160C: + push {r4,lr} + adds r3, r0, 0 + adds r4, r1, 0 + lsls r2, 16 + asrs r1, r2, 16 + ldr r0, _08001630 + cmp r1, r0 + bgt _0800163C + lsls r1, 4 + ldr r0, _08001634 + adds r1, r0 + str r1, [r3] + movs r2, 0x4 + ldrsh r0, [r1, r2] + ldr r1, _08001638 + adds r0, r1 + b _0800164C + .align 2, 0 +_08001630: .4byte 0x000003ff +_08001634: .4byte gUnknown_80B7394 +_08001638: .4byte gUnknown_2000A88 +_0800163C: + lsls r1, 4 + ldr r0, _08001654 + adds r1, r0 + str r1, [r3] + movs r2, 0x4 + ldrsh r0, [r1, r2] + lsls r0, 2 + adds r0, r4, r0 +_0800164C: + str r0, [r3, 0x4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08001654: .4byte 0x080b2d30 + thumb_func_end sub_800160C + + thumb_func_start sub_8001658 +sub_8001658: + push {r4,lr} + sub sp, 0x8 + adds r2, r0, 0 + lsls r1, 16 + asrs r4, r1, 16 + mov r0, sp + adds r1, r2, 0 + adds r2, r4, 0 + bl sub_800160C + ldr r0, [sp] + ldrh r0, [r0] + subs r0, 0x1 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + bls _0800167C + b _08001778 +_0800167C: + lsls r0, 2 + ldr r1, _08001688 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08001688: .4byte _0800168C + .align 2, 0 +_0800168C: + .4byte _080016AC + .4byte _080016C2 + .4byte _080016C8 + .4byte _080016D2 + .4byte _080016D8 + .4byte _080016E0 + .4byte _080016C2 + .4byte _080016E6 +_080016AC: + ldr r0, [sp] + movs r1, 0x6 + ldrsh r0, [r0, r1] + movs r1, 0x80 + lsls r1, 17 + lsls r1, r0 + lsrs r1, 24 + ldr r0, [sp, 0x4] + ldrb r0, [r0] + ands r1, r0 + b _0800173E +_080016C2: + ldr r0, [sp, 0x4] + ldrb r0, [r0] + b _0800177A +_080016C8: + ldr r0, [sp, 0x4] + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + b _0800177A +_080016D2: + ldr r0, [sp, 0x4] + ldrh r0, [r0] + b _0800177A +_080016D8: + ldr r0, [sp, 0x4] + movs r1, 0 + ldrsh r0, [r0, r1] + b _0800177A +_080016E0: + ldr r0, [sp, 0x4] + ldr r0, [r0] + b _0800177A +_080016E6: + adds r0, r4, 0 + subs r0, 0x17 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xC + bhi _08001778 + lsls r0, 2 + ldr r1, _080016FC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080016FC: .4byte _08001700 + .align 2, 0 +_08001700: + .4byte _08001734 + .4byte _08001778 + .4byte _08001778 + .4byte _08001778 + .4byte _08001778 + .4byte _08001778 + .4byte _08001778 + .4byte _08001778 + .4byte _08001778 + .4byte _08001746 + .4byte _0800174C + .4byte _08001754 + .4byte _08001764 +_08001734: + bl sub_8098F94 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 +_0800173E: + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + b _0800177A +_08001746: + bl sub_808D480 + b _0800177A +_0800174C: + movs r0, 0 + bl sub_808D544 + b _0800177A +_08001754: + ldr r0, _08001760 + ldr r0, [r0] + movs r1, 0x98 + lsls r1, 2 + b _0800176C + .align 2, 0 +_08001760: .4byte gUnknown_203B460 +_08001764: + ldr r0, _08001774 + ldr r0, [r0] + movs r1, 0x99 + lsls r1, 2 +_0800176C: + adds r0, r1 + ldr r0, [r0] + b _0800177A + .align 2, 0 +_08001774: .4byte gUnknown_203B460 +_08001778: + movs r0, 0 +_0800177A: + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8001658 + + thumb_func_start sub_8001784 +sub_8001784: + push {r4,r5,lr} + sub sp, 0x8 + adds r3, r0, 0 + lsls r1, 16 + asrs r5, r1, 16 + lsls r2, 16 + lsrs r4, r2, 16 + mov r0, sp + adds r1, r3, 0 + adds r2, r5, 0 + bl sub_800160C + ldr r0, [sp] + ldrh r0, [r0] + subs r0, 0x1 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + bls _080017AC + b _080018CC +_080017AC: + lsls r0, 2 + ldr r1, _080017B8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080017B8: .4byte _080017BC + .align 2, 0 +_080017BC: + .4byte _080017DC + .4byte _08001800 + .4byte _08001808 + .4byte _08001814 + .4byte _0800181E + .4byte _0800182A + .4byte _08001800 + .4byte _08001834 +_080017DC: + ldr r0, [sp] + ldrh r1, [r0, 0x6] + adds r1, r4, r1 + lsls r1, 16 + lsrs r0, r1, 19 + ldr r2, [sp, 0x4] + adds r2, r0 + movs r0, 0xE0 + lsls r0, 11 + ands r0, r1 + lsrs r0, 16 + movs r1, 0x80 + lsls r1, 17 + lsls r1, r0 + lsrs r1, 24 + ldrb r0, [r2] + ands r1, r0 + b _0800188E +_08001800: + ldr r0, [sp, 0x4] + adds r0, r4 + ldrb r0, [r0] + b _080018CE +_08001808: + ldr r0, [sp, 0x4] + adds r0, r4 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + b _080018CE +_08001814: + ldr r0, [sp, 0x4] + lsls r1, r4, 1 + adds r1, r0 + ldrh r0, [r1] + b _080018CE +_0800181E: + ldr r0, [sp, 0x4] + lsls r1, r4, 1 + adds r1, r0 + movs r2, 0 + ldrsh r0, [r1, r2] + b _080018CE +_0800182A: + ldr r0, [sp, 0x4] + lsls r1, r4, 2 + adds r1, r0 + ldr r0, [r1] + b _080018CE +_08001834: + adds r0, r5, 0 + subs r0, 0x17 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xC + bhi _080018CC + lsls r0, 2 + ldr r1, _0800184C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0800184C: .4byte _08001850 + .align 2, 0 +_08001850: + .4byte _08001884 + .4byte _080018CC + .4byte _080018CC + .4byte _080018CC + .4byte _080018CC + .4byte _080018CC + .4byte _080018CC + .4byte _080018CC + .4byte _080018CC + .4byte _08001896 + .4byte _0800189C + .4byte _080018A4 + .4byte _080018B8 +_08001884: + bl sub_8098F94 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 +_0800188E: + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + b _080018CE +_08001896: + bl sub_808D480 + b _080018CE +_0800189C: + movs r0, 0 + bl sub_808D544 + b _080018CE +_080018A4: + ldr r0, _080018B4 + ldr r0, [r0] + movs r1, 0x98 + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + b _080018CE + .align 2, 0 +_080018B4: .4byte gUnknown_203B460 +_080018B8: + ldr r0, _080018C8 + ldr r0, [r0] + movs r2, 0x99 + lsls r2, 2 + adds r0, r2 + ldr r0, [r0] + b _080018CE + .align 2, 0 +_080018C8: .4byte gUnknown_203B460 +_080018CC: + movs r0, 0 +_080018CE: + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8001784 + + thumb_func_start sub_80018D8 +sub_80018D8: + push {r4,r5,lr} + sub sp, 0x8 + adds r3, r0, 0 + adds r4, r2, 0 + lsls r1, 16 + asrs r5, r1, 16 + mov r0, sp + adds r1, r3, 0 + adds r2, r5, 0 + bl sub_800160C + ldr r0, [sp] + ldrh r0, [r0] + subs r0, 0x1 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + bhi _08001990 + lsls r0, 2 + ldr r1, _08001908 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08001908: .4byte _0800190C + .align 2, 0 +_0800190C: + .4byte _0800192C + .4byte _08001958 + .4byte _08001958 + .4byte _0800195E + .4byte _0800195E + .4byte _08001964 + .4byte _08001958 + .4byte _08001968 +_0800192C: + ldr r0, [sp] + movs r2, 0x6 + ldrsh r1, [r0, r2] + movs r0, 0x80 + lsls r0, 17 + lsls r0, r1 + lsrs r3, r0, 24 + cmp r4, 0 + beq _0800194A + ldr r2, [sp, 0x4] + ldrb r1, [r2] + adds r0, r3, 0 + orrs r0, r1 + strb r0, [r2] + b _08001990 +_0800194A: + ldr r2, [sp, 0x4] + ldrb r1, [r2] + adds r0, r3, 0 + orrs r0, r1 + eors r0, r3 + strb r0, [r2] + b _08001990 +_08001958: + ldr r0, [sp, 0x4] + strb r4, [r0] + b _08001990 +_0800195E: + ldr r0, [sp, 0x4] + strh r4, [r0] + b _08001990 +_08001964: + ldr r0, [sp, 0x4] + b _0800198E +_08001968: + cmp r5, 0x22 + beq _08001972 + cmp r5, 0x23 + beq _08001984 + b _08001990 +_08001972: + ldr r0, _08001980 + ldr r0, [r0] + movs r1, 0x98 + lsls r1, 2 + adds r0, r1 + b _0800198E + .align 2, 0 +_08001980: .4byte gUnknown_203B460 +_08001984: + ldr r0, _08001998 + ldr r0, [r0] + movs r2, 0x99 + lsls r2, 2 + adds r0, r2 +_0800198E: + str r4, [r0] +_08001990: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08001998: .4byte gUnknown_203B460 + thumb_func_end sub_80018D8 + + thumb_func_start sub_800199C +sub_800199C: + push {r4-r7,lr} + sub sp, 0x8 + adds r4, r0, 0 + adds r6, r3, 0 + lsls r1, 16 + asrs r7, r1, 16 + lsls r2, 16 + lsrs r5, r2, 16 + mov r0, sp + adds r1, r4, 0 + adds r2, r7, 0 + bl sub_800160C + ldr r0, [sp] + ldrh r0, [r0] + subs r0, 0x1 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x7 + bhi _08001A68 + lsls r0, 2 + ldr r1, _080019D0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080019D0: .4byte _080019D4 + .align 2, 0 +_080019D4: + .4byte _080019F4 + .4byte _08001A2C + .4byte _08001A2C + .4byte _08001A34 + .4byte _08001A34 + .4byte _08001A3E + .4byte _08001A2C + .4byte _08001A44 +_080019F4: + ldr r0, [sp] + ldrh r0, [r0, 0x6] + adds r0, r5, r0 + lsls r0, 16 + lsrs r2, r0, 19 + ldr r1, [sp, 0x4] + adds r3, r1, r2 + movs r1, 0xE0 + lsls r1, 11 + ands r1, r0 + lsrs r1, 16 + movs r0, 0x80 + lsls r0, 17 + lsls r0, r1 + lsrs r2, r0, 24 + cmp r6, 0 + beq _08001A20 + ldrb r1, [r3] + adds r0, r2, 0 + orrs r0, r1 + strb r0, [r3] + b _08001A68 +_08001A20: + ldrb r1, [r3] + adds r0, r2, 0 + orrs r0, r1 + eors r0, r2 + strb r0, [r3] + b _08001A68 +_08001A2C: + ldr r0, [sp, 0x4] + adds r0, r5 + strb r6, [r0] + b _08001A68 +_08001A34: + ldr r1, [sp, 0x4] + lsls r0, r5, 1 + adds r0, r1 + strh r6, [r0] + b _08001A68 +_08001A3E: + ldr r1, [sp, 0x4] + lsls r0, r5, 2 + b _08001A64 +_08001A44: + cmp r7, 0x22 + beq _08001A4E + cmp r7, 0x23 + beq _08001A5C + b _08001A68 +_08001A4E: + ldr r0, _08001A58 + ldr r0, [r0] + movs r1, 0x98 + lsls r1, 2 + b _08001A64 + .align 2, 0 +_08001A58: .4byte gUnknown_203B460 +_08001A5C: + ldr r0, _08001A70 + ldr r0, [r0] + movs r1, 0x99 + lsls r1, 2 +_08001A64: + adds r0, r1 + str r6, [r0] +_08001A68: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08001A70: .4byte gUnknown_203B460 + thumb_func_end sub_800199C + + thumb_func_start sub_8001A74 +sub_8001A74: + push {lr} + sub sp, 0x8 + adds r2, r0, 0 + lsls r2, 16 + asrs r2, 16 + mov r0, sp + movs r1, 0 + bl sub_800160C + ldr r0, [sp, 0x4] + add sp, 0x8 + pop {r1} + bx r1 + thumb_func_end sub_8001A74 + + thumb_func_start sub_8001A90 +sub_8001A90: + push {lr} + sub sp, 0x8 + adds r2, r0, 0 + lsls r2, 16 + asrs r2, 16 + mov r0, sp + movs r1, 0 + bl sub_800160C + ldr r0, [sp] + movs r1, 0x8 + ldrsh r0, [r0, r1] + add sp, 0x8 + pop {r1} + bx r1 + thumb_func_end sub_8001A90 + + thumb_func_start sub_8001AB0 +sub_8001AB0: + push {r4-r7,lr} + sub sp, 0x8 + adds r7, r0, 0 + lsls r1, 16 + asrs r5, r1, 16 + movs r6, 0 + mov r0, sp + movs r1, 0 + adds r2, r5, 0 + bl sub_800160C + movs r4, 0 + ldr r0, [sp] + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r6, r0 + bge _08001AEC +_08001AD2: + lsls r2, r4, 16 + lsrs r2, 16 + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_8001784 + adds r6, r0 + adds r4, 0x1 + ldr r0, [sp] + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r4, r0 + blt _08001AD2 +_08001AEC: + adds r0, r6, 0 + add sp, 0x8 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8001AB0 + + thumb_func_start sub_8001AF8 +sub_8001AF8: + push {r4,r5,lr} + sub sp, 0x8 + adds r3, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + lsls r3, 16 + asrs r3, 16 + mov r0, sp + movs r1, 0 + adds r2, r3, 0 + bl sub_800160C + ldr r1, [sp, 0x4] + movs r2, 0 + b _08001B1C +_08001B16: + strb r0, [r4] + adds r4, 0x1 + adds r2, 0x1 +_08001B1C: + cmp r2, r5 + bge _08001B28 + ldrb r0, [r1] + adds r1, 0x1 + cmp r0, 0 + bne _08001B16 +_08001B28: + movs r0, 0 + strb r0, [r4] + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8001AF8 + + thumb_func_start sub_8001B34 +sub_8001B34: + push {r4,lr} + sub sp, 0x8 + adds r3, r0, 0 + adds r4, r2, 0 + lsls r3, 16 + asrs r3, 16 + mov r0, sp + movs r1, 0 + adds r2, r3, 0 + bl sub_800160C + ldr r1, [sp, 0x4] + movs r2, 0 + b _08001B56 +_08001B50: + strb r0, [r1] + adds r1, 0x1 + adds r2, 0x1 +_08001B56: + cmp r2, r4 + bge _08001B62 + ldrb r0, [r1] + adds r1, 0x1 + cmp r0, 0 + bne _08001B50 +_08001B62: + ldr r0, [sp] + movs r3, 0x8 + ldrsh r0, [r0, r3] + cmp r2, r0 + bge _08001B7E + movs r3, 0 +_08001B6E: + strb r3, [r1] + adds r1, 0x1 + adds r2, 0x1 + ldr r0, [sp] + movs r4, 0x8 + ldrsh r0, [r0, r4] + cmp r2, r0 + blt _08001B6E +_08001B7E: + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8001B34 + + thumb_func_start sub_8001B88 +sub_8001B88: + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r4, 16 + asrs r4, 16 + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_8001784 + str r0, [r5] + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_8001784 + str r0, [r6] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8001B88 + + thumb_func_start sub_8001BB4 +sub_8001BB4: + push {r4-r6,lr} + sub sp, 0x14 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r0, 16 + asrs r4, r0, 16 + add r2, sp, 0x10 + adds r0, r4, 0 + add r1, sp, 0xC + bl sub_8001B88 + ldr r1, _08001C20 + ldr r3, [sp, 0xC] + ldr r0, [sp, 0x10] + str r0, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0x6 + adds r2, r4, 0 + bl Log + cmp r4, 0x3 + bne _08001BF8 + ldr r0, [sp, 0xC] + cmp r5, r0 + bne _08001BEE + ldr r0, [sp, 0x10] + cmp r6, r0 + beq _08001BF8 +_08001BEE: + movs r0, 0 + movs r1, 0x19 + movs r2, 0 + bl sub_80018D8 +_08001BF8: + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + adds r3, r5, 0 + bl sub_800199C + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x1 + adds r3, r6, 0 + bl sub_800199C + cmp r4, 0x4 + beq _08001C76 + cmp r4, 0x4 + bgt _08001C24 + cmp r4, 0x3 + beq _08001C2A + b _08001CBA + .align 2, 0 +_08001C20: .4byte gUnknown_80B72CC +_08001C24: + cmp r4, 0xC + beq _08001CA4 + b _08001CBA +_08001C2A: + subs r0, r5, 0x1 + cmp r0, 0x1A + bhi _08001CBA + movs r2, 0x1 + negs r2, r2 + movs r0, 0x3 + movs r1, 0x8 + bl sub_8001D44 + lsls r0, 24 + cmp r0, 0 + beq _08001C48 + movs r0, 0 + bl sub_80976F8 +_08001C48: + movs r0, 0x3 + movs r1, 0xB + movs r2, 0x3 + bl sub_8001D44 + lsls r0, 24 + cmp r0, 0 + beq _08001C5E + movs r0, 0x1 + bl sub_80976F8 +_08001C5E: + movs r0, 0x3 + movs r1, 0x11 + movs r2, 0 + bl sub_8001D44 + lsls r0, 24 + cmp r0, 0 + beq _08001CBA + movs r0, 0x2 + bl sub_80976F8 + b _08001CBA +_08001C76: + movs r0, 0x4 + movs r1, 0x1F + movs r2, 0 + bl sub_8001CC4 + lsls r0, 24 + cmp r0, 0 + bne _08001C8C + movs r0, 0x4 + bl sub_80976F8 +_08001C8C: + movs r0, 0x4 + movs r1, 0x20 + movs r2, 0 + bl sub_8001CC4 + lsls r0, 24 + cmp r0, 0 + bne _08001CBA + movs r0, 0x5 + bl sub_80976F8 + b _08001CBA +_08001CA4: + movs r0, 0xC + movs r1, 0x37 + movs r2, 0x2 + bl sub_8001CC4 + lsls r0, 24 + cmp r0, 0 + bne _08001CBA + movs r0, 0x3 + bl sub_80976F8 +_08001CBA: + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8001BB4 + + thumb_func_start sub_8001CC4 +sub_8001CC4: + push {r4-r7,lr} + adds r4, r0, 0 + adds r6, r1, 0 + adds r7, r2, 0 + lsls r4, 16 + asrs r4, 16 + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_8001784 + adds r5, r0, 0 + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_8001784 + cmp r5, 0x3A + beq _08001CFE + cmp r5, r6 + bcc _08001CFA + cmp r7, 0 + blt _08001CFE + cmp r5, r6 + bne _08001CFE + cmp r0, r7 + bge _08001CFE +_08001CFA: + movs r0, 0x1 + b _08001D00 +_08001CFE: + movs r0, 0 +_08001D00: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8001CC4 + + thumb_func_start sub_8001D08 +sub_8001D08: + push {r4-r7,lr} + adds r4, r0, 0 + adds r6, r1, 0 + adds r7, r2, 0 + lsls r4, 16 + asrs r4, 16 + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_8001784 + adds r5, r0, 0 + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_8001784 + cmp r5, r6 + bne _08001D3A + cmp r7, 0 + blt _08001D36 + cmp r0, r7 + bne _08001D3A +_08001D36: + movs r0, 0x1 + b _08001D3C +_08001D3A: + movs r0, 0 +_08001D3C: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8001D08 + + thumb_func_start sub_8001D44 +sub_8001D44: + push {r4-r7,lr} + adds r4, r0, 0 + adds r6, r1, 0 + adds r7, r2, 0 + lsls r4, 16 + asrs r4, 16 + movs r0, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_8001784 + adds r5, r0, 0 + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_8001784 + cmp r5, 0x3A + beq _08001D7E + cmp r5, r6 + bhi _08001D7A + cmp r7, 0 + blt _08001D7E + cmp r5, r6 + bne _08001D7E + cmp r0, r7 + ble _08001D7E +_08001D7A: + movs r0, 0x1 + b _08001D80 +_08001D7E: + movs r0, 0 +_08001D80: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8001D44 + + thumb_func_start sub_8001D88 +sub_8001D88: + push {lr} + sub sp, 0x8 + add r2, sp, 0x4 + movs r0, 0x3 + mov r1, sp + bl sub_8001B88 + ldr r0, [sp] + subs r0, 0x1 + cmp r0, 0x1A + bls _08001DA0 + b _080020D4 +_08001DA0: + movs r0, 0x4 + movs r1, 0x1F + movs r2, 0 + bl sub_8001CC4 + lsls r0, 24 + cmp r0, 0 + beq _08001E08 + movs r0, 0x3 + movs r1, 0xF + movs r2, 0x7 + bl sub_8001D44 + lsls r0, 24 + cmp r0, 0 + beq _08001DDE + movs r0, 0x4 + movs r1, 0x1F + movs r2, 0 + bl sub_8001BB4 + movs r0, 0xE + movs r1, 0x1 + bl sub_8097418 + movs r0, 0 + movs r1, 0x28 + movs r2, 0x2 + bl sub_80018D8 + b _08001E08 +_08001DDE: + movs r0, 0x4 + movs r1, 0 + movs r2, 0 + bl sub_8001D08 + lsls r0, 24 + cmp r0, 0 + beq _08001E08 + movs r0, 0x3 + movs r1, 0xF + movs r2, 0x3 + bl sub_8001D44 + lsls r0, 24 + cmp r0, 0 + beq _08001E08 + movs r0, 0x4 + movs r1, 0x1D + movs r2, 0x1 + bl sub_8001BB4 +_08001E08: + movs r0, 0x4 + movs r1, 0x1F + movs r2, 0 + bl sub_8001D08 + lsls r0, 24 + cmp r0, 0 + beq _08001E36 + movs r0, 0xE + bl sub_8092600 + lsls r0, 24 + cmp r0, 0 + beq _08001E36 + movs r0, 0x4 + movs r1, 0x1F + movs r2, 0x1 + bl sub_8001BB4 + movs r0, 0xF + movs r1, 0x1 + bl sub_809733C +_08001E36: + ldr r0, [sp] + cmp r0, 0x11 + bhi _08001E3E + b _080020D4 +_08001E3E: + movs r0, 0x25 + movs r1, 0x1 + bl sub_80973A8 + movs r0, 0xE7 + bl sub_8091130 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _08001E72 + ldr r0, _080020DC + ldr r0, [r0] + ldr r1, _080020E0 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + bne _08001E72 + movs r0, 0x5 + movs r1, 0x21 + movs r2, 0x3 + bl sub_8001D44 + lsls r0, 24 + cmp r0, 0 + beq _08001E7A +_08001E72: + movs r0, 0x22 + movs r1, 0x1 + bl sub_80973A8 +_08001E7A: + movs r0, 0x2B + bl sub_8092600 + lsls r0, 24 + cmp r0, 0 + beq _08001E8E + movs r0, 0x1F + movs r1, 0x1 + bl sub_80973A8 +_08001E8E: + movs r0, 0x24 + bl sub_8092600 + lsls r0, 24 + cmp r0, 0 + beq _08001EA2 + movs r0, 0x20 + movs r1, 0x1 + bl sub_80973A8 +_08001EA2: + movs r0, 0x23 + bl sub_8092600 + lsls r0, 24 + cmp r0, 0 + beq _08001EB6 + movs r0, 0x21 + movs r1, 0x1 + bl sub_80973A8 +_08001EB6: + movs r0, 0x19 + bl sub_8092600 + lsls r0, 24 + cmp r0, 0 + beq _08001ECA + movs r0, 0x23 + movs r1, 0x1 + bl sub_80973A8 +_08001ECA: + movs r0, 0x3 + bl sub_8092600 + lsls r0, 24 + cmp r0, 0 + beq _08001EE6 + movs r0, 0x24 + movs r1, 0x1 + bl sub_80973A8 + movs r0, 0x28 + movs r1, 0x1 + bl sub_80973A8 +_08001EE6: + movs r0, 0x2C + bl sub_8092600 + lsls r0, 24 + cmp r0, 0 + beq _08001F06 + movs r0, 0x2D + bl sub_8092600 + lsls r0, 24 + cmp r0, 0 + beq _08001F06 + movs r0, 0x26 + movs r1, 0x1 + bl sub_80973A8 +_08001F06: + movs r0, 0x5 + movs r1, 0 + movs r2, 0 + bl sub_8001D08 + lsls r0, 24 + cmp r0, 0 + beq _08001F20 + movs r0, 0x5 + movs r1, 0x21 + movs r2, 0x1 + bl sub_8001BB4 +_08001F20: + movs r0, 0xE2 + bl sub_8091130 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _08001F3E + ldr r0, _080020DC + ldr r0, [r0] + movs r1, 0x85 + lsls r1, 2 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _08001F7E +_08001F3E: + movs r0, 0x7 + movs r1, 0 + movs r2, 0 + bl sub_8001D08 + lsls r0, 24 + cmp r0, 0 + beq _08001F58 + movs r0, 0x7 + movs r1, 0x26 + movs r2, 0x1 + bl sub_8001BB4 +_08001F58: + movs r0, 0x9 + movs r1, 0 + movs r2, 0 + bl sub_8001D08 + lsls r0, 24 + cmp r0, 0 + beq _08001F7E + movs r0, 0x37 + bl sub_8092600 + lsls r0, 24 + cmp r0, 0 + beq _08001F7E + movs r0, 0x9 + movs r1, 0x2E + movs r2, 0x1 + bl sub_8001BB4 +_08001F7E: + movs r0, 0x9 + movs r1, 0x30 + movs r2, 0 + bl sub_8001CC4 + lsls r0, 24 + cmp r0, 0 + bne _0800202A + movs r0, 0x5 + movs r1, 0x22 + movs r2, 0 + bl sub_8001D08 + lsls r0, 24 + cmp r0, 0 + beq _08001FCC + movs r0, 0x90 + bl sub_808E734 + lsls r0, 24 + cmp r0, 0 + beq _08001FCC + movs r0, 0x91 + bl sub_808E734 + lsls r0, 24 + cmp r0, 0 + beq _08001FCC + movs r0, 0x92 + bl sub_808E734 + lsls r0, 24 + cmp r0, 0 + beq _08001FCC + movs r0, 0x5 + movs r1, 0x22 + movs r2, 0x1 + bl sub_8001BB4 +_08001FCC: + movs r0, 0xB + movs r1, 0 + movs r2, 0 + bl sub_8001D08 + lsls r0, 24 + cmp r0, 0 + beq _08002002 + movs r0, 0x5 + movs r1, 0x21 + movs r2, 0x3 + bl sub_8001D44 + lsls r0, 24 + cmp r0, 0 + beq _08002002 + movs r0, 0xE + bl sub_8092600 + lsls r0, 24 + cmp r0, 0 + beq _08002002 + movs r0, 0xB + movs r1, 0x33 + movs r2, 0x1 + bl sub_8001BB4 +_08002002: + movs r0, 0xE + bl sub_8092600 + lsls r0, 24 + cmp r0, 0 + beq _08002016 + movs r0, 0x27 + movs r1, 0x1 + bl sub_80973A8 +_08002016: + movs r0, 0xE + bl sub_8092600 + lsls r0, 24 + cmp r0, 0 + beq _0800202A + movs r0, 0x29 + movs r1, 0x1 + bl sub_80973A8 +_0800202A: + movs r0, 0x5 + movs r1, 0x22 + movs r2, 0 + bl sub_8001CC4 + lsls r0, 24 + cmp r0, 0 + bne _08002086 + movs r0, 0xA + movs r1, 0 + movs r2, 0 + bl sub_8001D08 + lsls r0, 24 + cmp r0, 0 + beq _0800205C + movs r0, 0xA + movs r1, 0x31 + movs r2, 0x1 + bl sub_8001BB4 + movs r0, 0x1B + movs r1, 0x1 + bl sub_809733C +_0800205C: + movs r0, 0xC + movs r1, 0 + movs r2, 0 + bl sub_8001D08 + lsls r0, 24 + cmp r0, 0 + beq _08002086 + movs r0, 0xB + movs r1, 0x34 + movs r2, 0 + bl sub_8001CC4 + lsls r0, 24 + cmp r0, 0 + bne _08002086 + movs r0, 0xC + movs r1, 0x35 + movs r2, 0x1 + bl sub_8001BB4 +_08002086: + movs r0, 0x6 + movs r1, 0 + movs r2, 0 + bl sub_8001D08 + lsls r0, 24 + cmp r0, 0 + beq _080020AE + movs r0, 0x89 + lsls r0, 1 + bl sub_808E734 + lsls r0, 24 + cmp r0, 0 + beq _080020AE + movs r0, 0x6 + movs r1, 0x24 + movs r2, 0x1 + bl sub_8001BB4 +_080020AE: + movs r0, 0x8 + movs r1, 0 + movs r2, 0 + bl sub_8001D08 + lsls r0, 24 + cmp r0, 0 + beq _080020D4 + ldr r0, _080020E4 + bl sub_808E734 + lsls r0, 24 + cmp r0, 0 + beq _080020D4 + movs r0, 0x8 + movs r1, 0x2C + movs r2, 0x1 + bl sub_8001BB4 +_080020D4: + add sp, 0x8 + pop {r0} + bx r0 + .align 2, 0 +_080020DC: .4byte gUnknown_203B460 +_080020E0: .4byte 0x0000021e +_080020E4: .4byte 0x00000113 + thumb_func_end sub_8001D88 + + thumb_func_start sub_80020E8 +sub_80020E8: + push {r4,lr} + adds r3, r0, 0 + adds r4, r1, 0 + cmp r2, 0xB + bhi _08002182 + lsls r0, r2, 2 + ldr r1, _080020FC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080020FC: .4byte _08002100 + .align 2, 0 +_08002100: + .4byte _08002130 + .4byte _08002134 + .4byte _08002138 + .4byte _0800213C + .4byte _08002142 + .4byte _0800214C + .4byte _08002156 + .4byte _0800215C + .4byte _08002162 + .4byte _08002168 + .4byte _08002170 + .4byte _0800217A +_08002130: + adds r0, r4, 0 + b _08002194 +_08002134: + subs r0, r3, r4 + b _08002194 +_08002138: + adds r0, r3, r4 + b _08002194 +_0800213C: + adds r0, r3, 0 + muls r0, r4 + b _08002194 +_08002142: + adds r0, r3, 0 + adds r1, r4, 0 + bl __divsi3 + b _08002194 +_0800214C: + adds r0, r3, 0 + adds r1, r4, 0 + bl __modsi3 + b _08002194 +_08002156: + ands r3, r4 + adds r0, r3, 0 + b _08002194 +_0800215C: + orrs r3, r4 + adds r0, r3, 0 + b _08002194 +_08002162: + eors r3, r4 + adds r0, r3, 0 + b _08002194 +_08002168: + movs r0, 0x1 + lsls r0, r4 + orrs r0, r3 + b _08002194 +_08002170: + movs r0, 0x1 + lsls r0, r4 + bics r3, r0 + adds r0, r3, 0 + b _08002194 +_0800217A: + adds r0, r4, 0 + bl sub_800451C + b _08002194 +_08002182: + ldr r0, _0800218C + ldr r1, _08002190 + bl FatalError + .align 2, 0 +_0800218C: .4byte gUnknown_80B7318 +_08002190: .4byte gUnknown_80B7324 +_08002194: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80020E8 + + thumb_func_start sub_800219C +sub_800219C: + push {r4,lr} + adds r3, r0, 0 + adds r4, r1, 0 + cmp r2, 0xA + bhi _08002248 + lsls r0, r2, 2 + ldr r1, _080021B0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080021B0: .4byte _080021B4 + .align 2, 0 +_080021B4: + .4byte _080021E0 + .4byte _080021E4 + .4byte _080021E8 + .4byte _080021FE + .4byte _08002212 + .4byte _08002208 + .4byte _0800221C + .4byte _080021F2 + .4byte _08002226 + .4byte _08002232 + .4byte _0800223E +_080021E0: + movs r0, 0x1 + b _08002258 +_080021E4: + movs r0, 0 + b _08002258 +_080021E8: + movs r0, 0 + cmp r3, r4 + bne _08002258 + movs r0, 0x1 + b _08002258 +_080021F2: + adds r1, r3, 0 + eors r1, r4 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + b _08002258 +_080021FE: + movs r0, 0 + cmp r3, r4 + ble _08002258 + movs r0, 0x1 + b _08002258 +_08002208: + movs r0, 0 + cmp r3, r4 + blt _08002258 + movs r0, 0x1 + b _08002258 +_08002212: + movs r0, 0 + cmp r3, r4 + bge _08002258 + movs r0, 0x1 + b _08002258 +_0800221C: + movs r0, 0 + cmp r3, r4 + bgt _08002258 + movs r0, 0x1 + b _08002258 +_08002226: + adds r0, r3, 0 + ands r0, r4 + cmp r0, 0 + beq _08002258 + movs r0, 0x1 + b _08002258 +_08002232: + adds r0, r3, 0 + eors r0, r4 + cmp r0, 0 + beq _08002258 + movs r0, 0x1 + b _08002258 +_0800223E: + asrs r3, r4 + movs r0, 0x1 + ands r3, r0 + adds r0, r3, 0 + b _08002258 +_08002248: + ldr r0, _08002250 + ldr r1, _08002254 + bl FatalError + .align 2, 0 +_08002250: .4byte gUnknown_80B7350 +_08002254: .4byte gUnknown_80B735C +_08002258: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_800219C + + thumb_func_start sub_8002260 +sub_8002260: + push {lr} + bl sub_80020E8 + pop {r1} + bx r1 + thumb_func_end sub_8002260 + + thumb_func_start sub_800226C +sub_800226C: + push {r4-r6,lr} + mov r6, r8 + push {r6} + mov r8, r0 + adds r4, r1, 0 + adds r5, r2, 0 + adds r6, r3, 0 + lsls r4, 16 + asrs r4, 16 + adds r1, r4, 0 + bl sub_8001658 + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_80020E8 + adds r2, r0, 0 + mov r0, r8 + adds r1, r4, 0 + bl sub_80018D8 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_800226C + + thumb_func_start sub_80022A0 +sub_80022A0: + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + mov r8, r0 + adds r5, r1, 0 + adds r4, r2, 0 + mov r9, r3 + lsls r5, 16 + asrs r5, 16 + lsls r4, 16 + asrs r4, 16 + adds r1, r5, 0 + bl sub_8001658 + adds r6, r0, 0 + mov r0, r8 + adds r1, r4, 0 + bl sub_8001658 + adds r1, r0, 0 + adds r0, r6, 0 + mov r2, r9 + bl sub_80020E8 + adds r2, r0, 0 + mov r0, r8 + adds r1, r5, 0 + bl sub_80018D8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80022A0 + + thumb_func_start sub_80022E8 +sub_80022E8: + push {lr} + bl sub_800219C + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_80022E8 + + thumb_func_start sub_80022F8 +sub_80022F8: + push {r4,r5,lr} + adds r4, r2, 0 + adds r5, r3, 0 + lsls r1, 16 + asrs r1, 16 + bl sub_8001658 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_800219C + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80022F8 + + thumb_func_start sub_8002318 +sub_8002318: + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r6, r0, 0 + adds r4, r2, 0 + mov r8, r3 + lsls r1, 16 + asrs r1, 16 + lsls r4, 16 + asrs r4, 16 + bl sub_8001658 + adds r5, r0, 0 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_8001658 + adds r1, r0, 0 + adds r0, r5, 0 + mov r2, r8 + bl sub_800219C + lsls r0, 24 + lsrs r0, 24 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8002318 + + thumb_func_start sub_8002354 +sub_8002354: + push {lr} + adds r1, r0, 0 + cmp r1, 0x3A + bls _08002362 + movs r0, 0x1 + negs r0, r0 + b _0800236C +_08002362: + ldr r0, _08002370 + lsls r1, 3 + adds r0, 0x4 + adds r1, r0 + ldr r0, [r1] +_0800236C: + pop {r1} + bx r1 + .align 2, 0 +_08002370: .4byte gUnknown_80B6D90 + thumb_func_end sub_8002354 + + thumb_func_start sub_8002374 +sub_8002374: + push {lr} + adds r1, r0, 0 + cmp r1, 0x3A + bls _08002384 + ldr r0, _08002380 + b _0800238C + .align 2, 0 +_08002380: .4byte gUnknown_80B7378 +_08002384: + ldr r0, _08002390 + lsls r1, 3 + adds r1, r0 + ldr r0, [r1] +_0800238C: + pop {r1} + bx r1 + .align 2, 0 +_08002390: .4byte gUnknown_80B6D90 + thumb_func_end sub_8002374 + + thumb_func_start sub_8002394 +sub_8002394: + push {lr} + adds r1, r0, 0 + subs r1, 0x12 + cmp r1, 0x8 + bhi _080023AC + ldr r0, _080023A8 + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + b _080023BA + .align 2, 0 +_080023A8: .4byte gUnknown_80B714C +_080023AC: + cmp r0, 0xF + beq _080023B8 + ldr r0, _080023B4 + b _080023BA + .align 2, 0 +_080023B4: .4byte gUnknown_80B7144 +_080023B8: + ldr r0, _080023C0 +_080023BA: + pop {r1} + bx r1 + .align 2, 0 +_080023C0: .4byte gUnknown_80B7388 + thumb_func_end sub_8002394 + + thumb_func_start sub_80023C4 +sub_80023C4: + push {lr} + adds r1, r0, 0 + cmp r1, 0x3 + bls _080023D4 + ldr r0, _080023D0 + b _080023DC + .align 2, 0 +_080023D0: .4byte gUnknown_80B7144 +_080023D4: + ldr r0, _080023E0 + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] +_080023DC: + pop {r1} + bx r1 + .align 2, 0 +_080023E0: .4byte gUnknown_80B71A0 + thumb_func_end sub_80023C4 + + thumb_func_start sub_80023E4 +sub_80023E4: + push {r4,lr} + cmp r0, 0x1D + bls _080023EC + b _0800264E +_080023EC: + lsls r0, 2 + ldr r1, _080023F8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080023F8: .4byte _080023FC + .align 2, 0 +_080023FC: + .4byte _08002474 + .4byte _08002482 + .4byte _0800248E + .4byte _0800249A + .4byte _080024A6 + .4byte _080024BE + .4byte _080024E6 + .4byte _080024F4 + .4byte _08002500 + .4byte _0800250C + .4byte _0800251A + .4byte _08002526 + .4byte _08002532 + .4byte _0800255A + .4byte _08002566 + .4byte _0800257A + .4byte _0800258E + .4byte _0800259C + .4byte _080025AA + .4byte _080025B8 + .4byte _080025C6 + .4byte _080025D4 + .4byte _080025E2 + .4byte _080025F0 + .4byte _080025FE + .4byte _0800260C + .4byte _0800261A + .4byte _08002628 + .4byte _08002630 + .4byte _08002644 +_08002474: + movs r2, 0x1 + negs r2, r2 + movs r0, 0x3 + movs r1, 0x2 + bl sub_8001D44 + b _08002648 +_08002482: + movs r0, 0x3 + movs r1, 0x3 + movs r2, 0x3 + bl sub_8001D44 + b _08002648 +_0800248E: + movs r0, 0x3 + movs r1, 0x4 + movs r2, 0x3 + bl sub_8001D44 + b _08002648 +_0800249A: + movs r0, 0x3 + movs r1, 0x5 + movs r2, 0 + bl sub_8001D44 + b _08002648 +_080024A6: + movs r4, 0 + movs r0, 0x3 + movs r1, 0xB + movs r2, 0 + bl sub_8001D44 + lsls r0, 24 + cmp r0, 0 + beq _08002556 + movs r0, 0x3 + movs r1, 0xD + b _080024D4 +_080024BE: + movs r4, 0 + movs r0, 0x3 + movs r1, 0xB + movs r2, 0x3 + bl sub_8001D44 + lsls r0, 24 + cmp r0, 0 + beq _08002556 + movs r0, 0x3 + movs r1, 0xF +_080024D4: + movs r2, 0 + bl sub_8001CC4 + lsls r0, 24 + lsrs r0, 24 + negs r1, r0 + orrs r1, r0 + lsrs r4, r1, 31 + b _08002556 +_080024E6: + movs r2, 0x1 + negs r2, r2 + movs r0, 0x3 + movs r1, 0x11 + bl sub_8001D44 + b _08002648 +_080024F4: + movs r0, 0x3 + movs r1, 0x12 + movs r2, 0x2 + bl sub_8001D44 + b _08002648 +_08002500: + movs r0, 0x3 + movs r1, 0x12 + movs r2, 0x3 + bl sub_8001D44 + b _08002648 +_0800250C: + movs r2, 0x1 + negs r2, r2 + movs r0, 0x3 + movs r1, 0x12 + bl sub_8001D44 + b _08002648 +_0800251A: + movs r0, 0x3 + movs r1, 0x5 + movs r2, 0x4 + bl sub_8001D44 + b _08002648 +_08002526: + movs r0, 0x3 + movs r1, 0x5 + movs r2, 0x4 + bl sub_8001D44 + b _08002648 +_08002532: + movs r4, 0 + movs r0, 0x3 + movs r1, 0xB + movs r2, 0x2 + bl sub_8001D08 + lsls r0, 24 + cmp r0, 0 + bne _08002556 + movs r0, 0x3 + movs r1, 0xB + movs r2, 0x3 + bl sub_8001D08 + lsls r0, 24 + cmp r0, 0 + bne _08002556 + movs r4, 0x1 +_08002556: + adds r0, r4, 0 + b _08002650 +_0800255A: + movs r0, 0x3 + movs r1, 0x10 + movs r2, 0x2 + bl sub_8001D08 + b _08002648 +_08002566: + movs r0, 0x3 + movs r1, 0x5 + movs r2, 0x7 + bl sub_8001CC4 + movs r1, 0 + lsls r0, 24 + cmp r0, 0 + bne _08002640 + b _0800263E +_0800257A: + movs r0, 0x3 + movs r1, 0xF + movs r2, 0 + bl sub_8001CC4 + movs r1, 0 + lsls r0, 24 + cmp r0, 0 + bne _08002640 + b _0800263E +_0800258E: + movs r2, 0x1 + negs r2, r2 + movs r0, 0x3 + movs r1, 0x7 + bl sub_8001D44 + b _08002648 +_0800259C: + movs r2, 0x1 + negs r2, r2 + movs r0, 0x3 + movs r1, 0xC + bl sub_8001D44 + b _08002648 +_080025AA: + movs r2, 0x1 + negs r2, r2 + movs r0, 0x3 + movs r1, 0xD + bl sub_8001D44 + b _08002648 +_080025B8: + movs r2, 0x1 + negs r2, r2 + movs r0, 0x3 + movs r1, 0xF + bl sub_8001D44 + b _08002648 +_080025C6: + movs r2, 0x1 + negs r2, r2 + movs r0, 0x3 + movs r1, 0x10 + bl sub_8001D44 + b _08002648 +_080025D4: + movs r2, 0x1 + negs r2, r2 + movs r0, 0x5 + movs r1, 0x21 + bl sub_8001D44 + b _08002648 +_080025E2: + movs r2, 0x1 + negs r2, r2 + movs r0, 0x5 + movs r1, 0x22 + bl sub_8001D44 + b _08002648 +_080025F0: + movs r2, 0x1 + negs r2, r2 + movs r0, 0x6 + movs r1, 0x24 + bl sub_8001D44 + b _08002648 +_080025FE: + movs r2, 0x1 + negs r2, r2 + movs r0, 0x7 + movs r1, 0x2A + bl sub_8001D44 + b _08002648 +_0800260C: + movs r2, 0x1 + negs r2, r2 + movs r0, 0x8 + movs r1, 0x2C + bl sub_8001D44 + b _08002648 +_0800261A: + movs r2, 0x1 + negs r2, r2 + movs r0, 0xA + movs r1, 0x31 + bl sub_8001D44 + b _08002648 +_08002628: + movs r0, 0x29 + bl sub_80973F4 + b _08002648 +_08002630: + bl sub_8092178 + movs r1, 0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6 + bne _08002640 +_0800263E: + movs r1, 0x1 +_08002640: + adds r0, r1, 0 + b _08002650 +_08002644: + bl sub_809761C +_08002648: + lsls r0, 24 + lsrs r0, 24 + b _08002650 +_0800264E: + movs r0, 0 +_08002650: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80023E4 + + thumb_func_start sub_8002658 +sub_8002658: + push {r4,r5,lr} + lsls r0, 16 + asrs r4, r0, 16 + ldr r1, _0800267C + ldrh r2, [r1] + movs r3, 0 + ldrsh r0, [r1, r3] + movs r3, 0x1 + negs r3, r3 + cmp r0, r3 + beq _0800268C +_0800266E: + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, r4 + bne _08002680 + ldrb r0, [r1, 0x2] + b _0800268E + .align 2, 0 +_0800267C: .4byte gUnknown_80B71E4 +_08002680: + adds r1, 0x4 + ldrh r2, [r1] + movs r5, 0 + ldrsh r0, [r1, r5] + cmp r0, r3 + bne _0800266E +_0800268C: + movs r0, 0 +_0800268E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8002658 + + thumb_func_start sub_8002694 +sub_8002694: + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r1, _080026B4 + movs r2, 0 + ldrsh r0, [r1, r2] + movs r2, 0x1 + negs r2, r2 + cmp r0, r2 + beq _080026C2 +_080026A8: + ldrb r0, [r1, 0x2] + cmp r0, r3 + bne _080026B8 + movs r4, 0 + ldrsh r0, [r1, r4] + b _080026C6 + .align 2, 0 +_080026B4: .4byte gUnknown_80B71E4 +_080026B8: + adds r1, 0x4 + movs r4, 0 + ldrsh r0, [r1, r4] + cmp r0, r2 + bne _080026A8 +_080026C2: + movs r0, 0x1 + negs r0, r0 +_080026C6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8002694 + + thumb_func_start sub_80026CC +sub_80026CC: + push {lr} + lsls r0, 16 + asrs r0, 16 + bl sub_8002658 + lsls r0, 24 + lsrs r0, 24 + bl sub_8092600 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_80026CC + + thumb_func_start sub_80026E8 +sub_80026E8: + push {lr} + lsls r0, 16 + asrs r0, 16 + bl sub_8002658 + lsls r0, 24 + lsrs r0, 24 + bl sub_80925EC + pop {r0} + bx r0 + thumb_func_end sub_80026E8 + + thumb_func_start sub_8002700 +sub_8002700: + push {lr} + ldr r1, _08002714 + movs r2, 0x80 + lsls r2, 3 + bl MemoryCopy8 + movs r0, 0x1 + pop {r1} + bx r1 + .align 2, 0 +_08002714: .4byte gUnknown_2000A88 + thumb_func_end sub_8002700 + + thumb_func_start sub_8002718 +sub_8002718: + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + mov r0, sp + movs r1, 0 + movs r2, 0 + bl sub_800160C + ldr r0, _08002748 + movs r2, 0x80 + lsls r2, 3 + adds r1, r4, 0 + bl MemoryCopy8 + ldr r0, [sp] + movs r2, 0xA + ldrsh r1, [r0, r2] + ldr r0, [sp, 0x4] + ldr r0, [r0] + cmp r1, r0 + bne _0800274C + movs r0, 0x1 + b _0800274E + .align 2, 0 +_08002748: .4byte gUnknown_2000A88 +_0800274C: + movs r0, 0 +_0800274E: + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8002718 + + thumb_func_start sub_8002758 +sub_8002758: + push {lr} + adds r2, r0, 0 + movs r0, 0 + movs r1, 0x1 + movs r3, 0x9 + bl sub_800226C + pop {r0} + bx r0 + thumb_func_end sub_8002758 + + thumb_func_start sub_800276C +sub_800276C: + movs r0, 0 + bx lr + thumb_func_end sub_800276C + + thumb_func_start nullsub_140 +nullsub_140: + bx lr + thumb_func_end nullsub_140 + + thumb_func_start sub_8002774 +sub_8002774: + sub sp, 0x4 + str r0, [sp] + mov r0, sp + ldrb r1, [r0, 0x2] + movs r0, 0xF8 + adds r2, r0, 0 + ands r2, r1 + lsls r2, 7 + mov r1, sp + ldrb r3, [r1, 0x1] + adds r1, r0, 0 + ands r1, r3 + lsls r1, 2 + orrs r2, r1 + mov r1, sp + ldrb r1, [r1] + ands r0, r1 + lsrs r0, 3 + orrs r0, r2 + add sp, 0x4 + bx lr + thumb_func_end sub_8002774 + + thumb_func_start sub_80027A0 +sub_80027A0: + push {r4,lr} + sub sp, 0x4 + lsls r0, 16 + lsrs r2, r0, 16 + adds r3, r2, 0 + mov r4, sp + movs r0, 0x1F + ands r0, r2 + lsls r1, r0, 3 + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _080027BE + movs r0, 0x7 + orrs r1, r0 +_080027BE: + strb r1, [r4] + mov r4, sp + movs r0, 0xF8 + lsls r0, 2 + ands r0, r2 + lsrs r1, r0, 2 + movs r0, 0x20 + ands r0, r2 + cmp r0, 0 + beq _080027D6 + movs r0, 0x7 + orrs r1, r0 +_080027D6: + strb r1, [r4, 0x1] + mov r2, sp + movs r0, 0xF8 + lsls r0, 7 + ands r0, r3 + lsrs r1, r0, 7 + movs r0, 0x80 + lsls r0, 3 + ands r3, r0 + cmp r3, 0 + beq _080027F0 + movs r0, 0x7 + orrs r1, r0 +_080027F0: + strb r1, [r2, 0x2] + mov r0, sp + movs r1, 0 + strb r1, [r0, 0x3] + ldr r0, [sp] + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80027A0 + + thumb_func_start sub_8002804 +sub_8002804: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r3, 0 +_0800280C: + adds r1, r5, r3 + adds r0, r2, r3 + ldrb r0, [r0] + muls r0, r4 + cmp r0, 0 + bge _0800281A + adds r0, 0xFF +_0800281A: + asrs r0, 8 + strb r0, [r1] + adds r3, 0x1 + cmp r3, 0x3 + ble _0800280C + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8002804 + + thumb_func_start sub_800282C +sub_800282C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x38 + mov r9, r0 + str r1, [sp, 0x20] + adds r7, r2, 0 + mov r8, r3 + adds r0, r1, 0 + bl __floatsisf + adds r1, r0, 0 + ldr r0, _08002904 + bl __divsf3 + str r0, [sp, 0x24] + movs r5, 0 + mov r0, sp + adds r0, 0x10 + str r0, [sp, 0x2C] + str r0, [sp, 0x34] + mov r10, sp +_0800285C: + adds r6, r7, r5 + movs r4, 0 + ldrsb r4, [r6, r4] + adds r0, r4, 0 + bl __floatsisf + cmp r4, 0 + bge _08002872 + ldr r1, _08002908 + bl __addsf3 +_08002872: + mov r1, r10 + adds r1, 0x4 + mov r10, r1 + subs r1, 0x4 + stm r1!, {r0} + mov r1, r8 + adds r0, r1, r5 + ldrb r0, [r0] + ldrb r1, [r6] + subs r0, r1 + bl __floatsisf + ldr r1, [sp, 0x24] + bl __mulsf3 + ldr r1, [sp, 0x34] + stm r1!, {r0} + str r1, [sp, 0x34] + adds r5, 0x1 + cmp r5, 0x3 + ble _0800285C + ldr r0, [r7] + mov r1, r9 + adds r1, 0x4 + mov r9, r1 + subs r1, 0x4 + stm r1!, {r0} + movs r5, 0x1 + ldr r0, [sp, 0x20] + subs r0, 0x1 + str r0, [sp, 0x28] + mov r1, r8 + ldr r1, [r1] + str r1, [sp, 0x30] + cmp r5, r0 + bge _080028EE +_080028BA: + movs r6, 0 + adds r5, 0x1 + mov r10, r5 + movs r0, 0x4 + add r0, r9 + mov r8, r0 + mov r5, sp + ldr r7, [sp, 0x2C] +_080028CA: + mov r1, r9 + adds r4, r1, r6 + ldr r0, [r5] + ldm r7!, {r1} + bl __addsf3 + stm r5!, {r0} + bl __fixunssfsi + strb r0, [r4] + adds r6, 0x1 + cmp r6, 0x3 + ble _080028CA + mov r9, r8 + mov r5, r10 + ldr r0, [sp, 0x28] + cmp r5, r0 + blt _080028BA +_080028EE: + ldr r1, [sp, 0x30] + mov r0, r9 + str r1, [r0] + add sp, 0x38 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08002904: .4byte 0x3f800000 +_08002908: .4byte 0x43800000 + thumb_func_end sub_800282C + + thumb_func_start sub_800290C +sub_800290C: + push {lr} + ldr r3, [r0] + cmp r3, r1 + ble _08002918 + str r1, [r0] + b _08002920 +_08002918: + negs r2, r1 + cmp r3, r2 + bge _08002920 + str r2, [r0] +_08002920: + ldr r2, [r0, 0x4] + cmp r2, r1 + bgt _0800292C + negs r1, r1 + cmp r2, r1 + bge _0800292E +_0800292C: + str r1, [r0, 0x4] +_0800292E: + pop {r0} + bx r0 + thumb_func_end sub_800290C + + thumb_func_start sub_8002934 +sub_8002934: + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + mov r10, r0 + adds r6, r1, 0 + mov r8, r2 + adds r4, r3, 0 + ldr r5, [sp, 0x1C] + adds r0, r4, r5 + mov r9, r0 + ldr r0, [r6] + muls r0, r4 + ldr r1, [r2] + muls r1, r5 + adds r0, r1 + mov r1, r9 + bl __divsi3 + mov r1, r10 + str r0, [r1] + ldr r0, [r6, 0x4] + muls r0, r4 + mov r2, r8 + ldr r1, [r2, 0x4] + muls r1, r5 + adds r0, r1 + mov r1, r9 + bl __divsi3 + mov r1, r10 + str r0, [r1, 0x4] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8002934 + + thumb_func_start sub_8002984 +sub_8002984: + push {r4,lr} + lsls r0, 24 + asrs r4, r0, 24 + lsls r1, 24 + lsrs r1, 24 + subs r0, r1, 0x1 + cmp r0, 0x8 + bhi _08002A68 + lsls r0, 2 + ldr r1, _080029A0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080029A0: .4byte _080029A4 + .align 2, 0 +_080029A4: + .4byte _080029C8 + .4byte _080029D0 + .4byte _080029D8 + .4byte _080029E0 + .4byte _080029E8 + .4byte _080029F4 + .4byte _08002A34 + .4byte _08002A4E + .4byte _08002A5E +_080029C8: + cmp r4, 0 + blt _08002A68 + adds r4, 0x7 + b _080029EE +_080029D0: + cmp r4, 0 + blt _08002A68 + adds r4, 0x1 + b _080029EE +_080029D8: + cmp r4, 0 + blt _08002A68 + adds r4, 0x6 + b _080029EE +_080029E0: + cmp r4, 0 + blt _08002A68 + adds r4, 0x2 + b _080029EE +_080029E8: + cmp r4, 0 + blt _08002A68 + adds r4, 0x4 +_080029EE: + movs r0, 0x7 + ands r4, r0 + b _08002A68 +_080029F4: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _08002A18 + movs r0, 0x2 + bl sub_800451C + adds r1, r4, 0x7 + lsls r0, 1 + adds r1, r0 + adds r0, r1, 0 + cmp r1, 0 + bge _08002A10 + adds r0, r1, 0x7 +_08002A10: + asrs r0, 3 + lsls r0, 3 + subs r0, r1, r0 + b _08002A64 +_08002A18: + movs r0, 0x3 + bl sub_800451C + adds r1, r4, 0x6 + lsls r0, 1 + adds r1, r0 + adds r0, r1, 0 + cmp r1, 0 + bge _08002A2C + adds r0, r1, 0x7 +_08002A2C: + asrs r0, 3 + lsls r0, 3 + subs r0, r1, r0 + b _08002A64 +_08002A34: + movs r0, 0x3 + bl sub_800451C + adds r1, r4, 0x7 + adds r1, r0 + adds r0, r1, 0 + cmp r1, 0 + bge _08002A46 + adds r0, r1, 0x7 +_08002A46: + asrs r0, 3 + lsls r0, 3 + subs r0, r1, r0 + b _08002A64 +_08002A4E: + movs r0, 0x8 + bl sub_800451C + movs r2, 0x2 + negs r2, r2 + adds r1, r2, 0 + ands r0, r1 + b _08002A64 +_08002A5E: + movs r0, 0x8 + bl sub_800451C +_08002A64: + lsls r0, 24 + asrs r4, r0, 24 +_08002A68: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8002984 + + thumb_func_start sub_8002A70 +sub_8002A70: + push {r4,lr} + lsls r0, 24 + asrs r3, r0, 24 + lsls r1, 24 + asrs r4, r1, 24 + lsls r2, 24 + lsrs r0, r2, 24 + cmp r3, r4 + beq _08002AFC + subs r0, 0x1 + cmp r0, 0xA + bhi _08002AFC + lsls r0, 2 + ldr r1, _08002A94 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08002A94: .4byte _08002A98 + .align 2, 0 +_08002A98: + .4byte _08002AC4 + .4byte _08002ACC + .4byte _08002AD4 + .4byte _08002ADC + .4byte _08002AFC + .4byte _08002AFC + .4byte _08002AFC + .4byte _08002AFC + .4byte _08002AFC + .4byte _08002AF2 + .4byte _08002AE8 +_08002AC4: + cmp r3, 0 + blt _08002AFC + adds r3, 0x7 + b _08002AE2 +_08002ACC: + cmp r3, 0 + blt _08002AFC + adds r3, 0x1 + b _08002AE2 +_08002AD4: + cmp r3, 0 + blt _08002AFC + adds r3, 0x6 + b _08002AE2 +_08002ADC: + cmp r3, 0 + blt _08002AFC + adds r3, 0x2 +_08002AE2: + movs r0, 0x7 + ands r3, r0 + b _08002AFC +_08002AE8: + adds r0, r3, 0 + adds r1, r4, 0 + bl sub_8002B04 + adds r3, r0, 0 +_08002AF2: + adds r0, r3, 0 + adds r1, r4, 0 + bl sub_8002B04 + adds r3, r0, 0 +_08002AFC: + adds r0, r3, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8002A70 + + thumb_func_start sub_8002B04 +sub_8002B04: + push {lr} + lsls r0, 24 + asrs r2, r0, 24 + lsls r1, 24 + asrs r1, 24 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08002B56 + adds r0, r2, 0 + subs r0, 0x8 + subs r1, r0 + adds r0, r1, 0 + cmp r1, 0 + bge _08002B24 + adds r0, r1, 0x7 +_08002B24: + asrs r0, 3 + lsls r0, 3 + subs r0, r1, r0 + cmp r0, 0 + beq _08002B56 + cmp r0, 0x3 + bgt _08002B40 + adds r1, r2, 0x1 + adds r0, r1, 0 + cmp r1, 0 + bge _08002B4C + adds r0, r2, 0 + adds r0, 0x8 + b _08002B4C +_08002B40: + adds r1, r2, 0x7 + adds r0, r1, 0 + cmp r1, 0 + bge _08002B4C + adds r0, r2, 0 + adds r0, 0xE +_08002B4C: + asrs r0, 3 + lsls r0, 3 + subs r0, r1, r0 + lsls r0, 24 + asrs r2, r0, 24 +_08002B56: + adds r0, r2, 0 + pop {r1} + bx r1 + thumb_func_end sub_8002B04 + + thumb_func_start sub_8002B5C +sub_8002B5C: + push {lr} + lsls r0, 24 + asrs r2, r0, 24 + lsls r1, 24 + asrs r1, 24 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08002BAE + adds r0, r2, 0 + subs r0, 0x8 + subs r1, r0 + adds r0, r1, 0 + cmp r1, 0 + bge _08002B7C + adds r0, r1, 0x7 +_08002B7C: + asrs r0, 3 + lsls r0, 3 + subs r0, r1, r0 + cmp r0, 0 + beq _08002BAE + cmp r0, 0x3 + bgt _08002B98 + adds r1, r2, 0x2 + adds r0, r1, 0 + cmp r1, 0 + bge _08002BA4 + adds r0, r2, 0 + adds r0, 0x9 + b _08002BA4 +_08002B98: + adds r1, r2, 0x6 + adds r0, r1, 0 + cmp r1, 0 + bge _08002BA4 + adds r0, r2, 0 + adds r0, 0xD +_08002BA4: + asrs r0, 3 + lsls r0, 3 + subs r0, r1, r0 + lsls r0, 24 + asrs r2, r0, 24 +_08002BAE: + movs r0, 0x6 + ands r2, r0 + adds r0, r2, 0 + pop {r1} + bx r1 + thumb_func_end sub_8002B5C + + thumb_func_start sub_8002BB8 +sub_8002BB8: + push {r4,r5,lr} + lsls r1, 24 + asrs r1, 21 + ldr r3, _08002BD8 + adds r1, r3 + ldr r5, [r1] + adds r3, r5, 0 + muls r3, r2 + ldr r1, [r1, 0x4] + adds r4, r1, 0 + muls r4, r2 + str r3, [r0] + str r4, [r0, 0x4] + pop {r4,r5} + pop {r2} + bx r2 + .align 2, 0 +_08002BD8: .4byte gUnknown_80B7E3C + thumb_func_end sub_8002BB8 + + thumb_func_start sub_8002BDC +sub_8002BDC: + push {lr} + ldr r1, [r0] + cmp r1, 0 + bge _08002BFA + ldr r0, [r0, 0x4] + cmp r0, 0 + bge _08002BEE + movs r0, 0x5 + b _08002C2A +_08002BEE: + cmp r0, 0 + ble _08002BF6 + movs r0, 0x7 + b _08002C2A +_08002BF6: + movs r0, 0x6 + b _08002C2A +_08002BFA: + cmp r1, 0 + ble _08002C14 + ldr r0, [r0, 0x4] + cmp r0, 0 + bge _08002C08 + movs r0, 0x3 + b _08002C2A +_08002C08: + cmp r0, 0 + ble _08002C10 + movs r0, 0x1 + b _08002C2A +_08002C10: + movs r0, 0x2 + b _08002C2A +_08002C14: + ldr r0, [r0, 0x4] + cmp r0, 0 + bge _08002C1E + movs r0, 0x4 + b _08002C2A +_08002C1E: + cmp r0, 0 + bgt _08002C28 + movs r0, 0x1 + negs r0, r0 + b _08002C2A +_08002C28: + movs r0, 0 +_08002C2A: + pop {r1} + bx r1 + thumb_func_end sub_8002BDC + + thumb_func_start sub_8002C30 +sub_8002C30: + push {lr} + ldr r1, [r0, 0x4] + cmp r1, 0 + bge _08002C3C + movs r0, 0x4 + b _08002C5A +_08002C3C: + cmp r1, 0 + ble _08002C44 + movs r0, 0 + b _08002C5A +_08002C44: + ldr r0, [r0] + cmp r0, 0 + bge _08002C4E + movs r0, 0x6 + b _08002C5A +_08002C4E: + cmp r0, 0 + bgt _08002C58 + movs r0, 0x1 + negs r0, r0 + b _08002C5A +_08002C58: + movs r0, 0x2 +_08002C5A: + pop {r1} + bx r1 + thumb_func_end sub_8002C30 + + thumb_func_start sub_8002C60 +sub_8002C60: + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, [r4] + cmp r0, 0 + bge _08002C6C + negs r0, r0 +_08002C6C: + adds r1, r0, 0 + ldr r3, [r4, 0x4] + adds r5, r3, 0 + cmp r3, 0 + bge _08002C78 + negs r5, r3 +_08002C78: + adds r2, r5, 0 + ldr r4, [r4] + cmp r4, 0 + bge _08002CA8 + cmp r3, 0 + bge _08002C94 + lsls r0, 1 + cmp r2, r0 + bgt _08002CD8 + lsls r0, r5, 1 + cmp r1, r0 + bgt _08002CA0 + movs r0, 0x5 + b _08002CE8 +_08002C94: + lsls r0, 1 + cmp r2, r0 + bgt _08002CE6 + lsls r0, r5, 1 + cmp r1, r0 + ble _08002CA4 +_08002CA0: + movs r0, 0x6 + b _08002CE8 +_08002CA4: + movs r0, 0x7 + b _08002CE8 +_08002CA8: + cmp r4, 0 + ble _08002CD4 + cmp r3, 0 + bge _08002CC0 + lsls r0, 1 + cmp r2, r0 + bgt _08002CD8 + lsls r0, r5, 1 + cmp r1, r0 + bgt _08002CCC + movs r0, 0x3 + b _08002CE8 +_08002CC0: + lsls r0, 1 + cmp r2, r0 + bgt _08002CE6 + lsls r0, r5, 1 + cmp r1, r0 + ble _08002CD0 +_08002CCC: + movs r0, 0x2 + b _08002CE8 +_08002CD0: + movs r0, 0x1 + b _08002CE8 +_08002CD4: + cmp r3, 0 + bge _08002CDC +_08002CD8: + movs r0, 0x4 + b _08002CE8 +_08002CDC: + cmp r3, 0 + bgt _08002CE6 + movs r0, 0x1 + negs r0, r0 + b _08002CE8 +_08002CE6: + movs r0, 0 +_08002CE8: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8002C60 + + thumb_func_start sub_8002CF0 +sub_8002CF0: + push {r4,lr} + adds r4, r0, 0 + ldr r3, [r4] + cmp r3, 0 + bge _08002CFC + negs r3, r3 +_08002CFC: + adds r1, r3, 0 + ldr r3, [r4, 0x4] + adds r0, r3, 0 + cmp r3, 0 + bge _08002D08 + negs r0, r3 +_08002D08: + adds r2, r0, 0 + ldr r0, [r4] + cmp r0, 0 + bge _08002D22 + cmp r3, 0 + bge _08002D1A + cmp r2, r1 + bgt _08002D3C + b _08002D1E +_08002D1A: + cmp r2, r1 + bgt _08002D4A +_08002D1E: + movs r0, 0x6 + b _08002D4C +_08002D22: + cmp r0, 0 + ble _08002D38 + cmp r3, 0 + bge _08002D30 + cmp r2, r1 + bgt _08002D3C + b _08002D34 +_08002D30: + cmp r2, r1 + bgt _08002D4A +_08002D34: + movs r0, 0x2 + b _08002D4C +_08002D38: + cmp r3, 0 + bge _08002D40 +_08002D3C: + movs r0, 0x4 + b _08002D4C +_08002D40: + cmp r3, 0 + bgt _08002D4A + movs r0, 0x1 + negs r0, r0 + b _08002D4C +_08002D4A: + movs r0, 0 +_08002D4C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8002CF0 + + thumb_func_start sub_8002D54 +sub_8002D54: + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r1, 0 + adds r5, r3, 0 + ldr r3, [r2] + ldr r1, [r0] + subs r3, r1 + str r3, [sp] + ldr r1, [r2, 0x4] + ldr r0, [r0, 0x4] + subs r1, r0 + str r1, [sp, 0x4] + adds r2, r3, 0 + cmp r2, 0 + blt _08002D8A + adds r2, 0x1 + ldr r0, [r4] + ldr r1, [r5] + adds r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + subs r2, r0 + str r2, [sp] + cmp r2, 0 + bge _08002DA4 + b _08002DA0 +_08002D8A: + subs r2, r3, 0x1 + ldr r0, [r4] + ldr r1, [r5] + adds r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + adds r2, r0 + str r2, [sp] + cmp r2, 0 + ble _08002DA4 +_08002DA0: + movs r0, 0 + str r0, [sp] +_08002DA4: + ldr r2, [sp, 0x4] + cmp r2, 0 + blt _08002DC2 + adds r2, 0x1 + ldr r0, [r4, 0x4] + ldr r1, [r5, 0x4] + adds r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + subs r2, r0 + str r2, [sp, 0x4] + cmp r2, 0 + bge _08002DDC + b _08002DD8 +_08002DC2: + subs r2, 0x1 + ldr r0, [r4, 0x4] + ldr r1, [r5, 0x4] + adds r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + adds r2, r0 + str r2, [sp, 0x4] + cmp r2, 0 + ble _08002DDC +_08002DD8: + movs r0, 0 + str r0, [sp, 0x4] +_08002DDC: + mov r0, sp + bl sub_8002CF0 + lsls r0, 24 + asrs r0, 24 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8002D54 + + thumb_func_start sub_8002DF0 +sub_8002DF0: + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r1, 0 + adds r5, r3, 0 + ldr r3, [r2] + ldr r1, [r0] + subs r3, r1 + str r3, [sp] + ldr r1, [r2, 0x4] + ldr r0, [r0, 0x4] + subs r1, r0 + str r1, [sp, 0x4] + adds r2, r3, 0 + cmp r2, 0 + blt _08002E26 + adds r2, 0x1 + ldr r0, [r4] + ldr r1, [r5] + adds r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + subs r2, r0 + str r2, [sp] + cmp r2, 0 + bge _08002E40 + b _08002E3C +_08002E26: + subs r2, r3, 0x1 + ldr r0, [r4] + ldr r1, [r5] + adds r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + adds r2, r0 + str r2, [sp] + cmp r2, 0 + ble _08002E40 +_08002E3C: + movs r0, 0 + str r0, [sp] +_08002E40: + ldr r2, [sp, 0x4] + cmp r2, 0 + blt _08002E5E + adds r2, 0x1 + ldr r0, [r4, 0x4] + ldr r1, [r5, 0x4] + adds r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + subs r2, r0 + str r2, [sp, 0x4] + cmp r2, 0 + bge _08002E78 + b _08002E74 +_08002E5E: + subs r2, 0x1 + ldr r0, [r4, 0x4] + ldr r1, [r5, 0x4] + adds r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + adds r2, r0 + str r2, [sp, 0x4] + cmp r2, 0 + ble _08002E78 +_08002E74: + movs r0, 0 + str r0, [sp, 0x4] +_08002E78: + mov r0, sp + bl sub_8002C60 + lsls r0, 24 + asrs r0, 24 + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8002DF0 + + thumb_func_start InitHeap +InitHeap: + push {lr} + bl InitHeapInternal + pop {r0} + bx r0 + thumb_func_end InitHeap + + thumb_func_start MemoryClear8 +MemoryClear8: + push {lr} + cmp r1, 0 + ble _08002EAA + movs r2, 0 +_08002EA0: + subs r1, 0x1 + strb r2, [r0] + adds r0, 0x1 + cmp r1, 0 + bgt _08002EA0 +_08002EAA: + pop {r0} + bx r0 + thumb_func_end MemoryClear8 + + thumb_func_start MemoryClear16 +MemoryClear16: + push {lr} + cmp r1, 0 + ble _08002EC2 + movs r2, 0 +_08002EB8: + subs r1, 0x2 + strh r2, [r0] + adds r0, 0x2 + cmp r1, 0 + bgt _08002EB8 +_08002EC2: + pop {r0} + bx r0 + thumb_func_end MemoryClear16 + + thumb_func_start MemoryClear32 +MemoryClear32: + push {lr} + bl CpuClear + pop {r0} + bx r0 + thumb_func_end MemoryClear32 + + thumb_func_start MemoryFill8 +MemoryFill8: + push {lr} + lsls r1, 24 + lsrs r1, 24 + cmp r2, 0 + ble _08002EE8 +_08002EDE: + subs r2, 0x1 + strb r1, [r0] + adds r0, 0x1 + cmp r2, 0 + bgt _08002EDE +_08002EE8: + pop {r0} + bx r0 + thumb_func_end MemoryFill8 + + thumb_func_start MemoryFill16 +MemoryFill16: + push {lr} + lsls r1, 16 + lsrs r1, 16 + cmp r2, 0 + ble _08002F00 +_08002EF6: + subs r2, 0x2 + strh r1, [r0] + adds r0, 0x2 + cmp r2, 0 + bgt _08002EF6 +_08002F00: + pop {r0} + bx r0 + thumb_func_end MemoryFill16 + + thumb_func_start MemoryFill32 +MemoryFill32: + push {lr} + cmp r2, 0 + ble _08002F12 +_08002F0A: + subs r2, 0x4 + stm r0!, {r1} + cmp r2, 0 + bgt _08002F0A +_08002F12: + pop {r0} + bx r0 + thumb_func_end MemoryFill32 + + thumb_func_start MemoryCopy8 +MemoryCopy8: + push {lr} + adds r3, r0, 0 + cmp r2, 0 + ble _08002F2E +_08002F20: + subs r2, 0x1 + ldrb r0, [r1] + strb r0, [r3] + adds r1, 0x1 + adds r3, 0x1 + cmp r2, 0 + bgt _08002F20 +_08002F2E: + pop {r0} + bx r0 + thumb_func_end MemoryCopy8 + + thumb_func_start MemoryCopy16 +MemoryCopy16: + push {lr} + adds r3, r0, 0 + cmp r2, 0 + ble _08002F4A +_08002F3C: + subs r2, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + cmp r2, 0 + bgt _08002F3C +_08002F4A: + pop {r0} + bx r0 + thumb_func_end MemoryCopy16 + + thumb_func_start MemoryCopy32 +MemoryCopy32: + push {lr} + adds r3, r0, 0 + cmp r2, 0 + ble _08002F62 +_08002F58: + subs r2, 0x4 + ldm r1!, {r0} + stm r3!, {r0} + cmp r2, 0 + bgt _08002F58 +_08002F62: + pop {r0} + bx r0 + thumb_func_end MemoryCopy32 + + thumb_func_start InitHeapInternal +InitHeapInternal: + push {lr} + sub sp, 0x8 + ldr r0, _08002F90 + str r0, [sp] + movs r0, 0x90 + lsls r0, 10 + str r0, [sp, 0x4] + ldr r1, _08002F94 + movs r0, 0 + str r0, [r1] + ldr r0, _08002F98 + ldr r2, _08002F9C + mov r1, sp + movs r3, 0x20 + bl DoInitHeap + add sp, 0x8 + pop {r0} + bx r0 + .align 2, 0 +_08002F90: .4byte gUnknown_20011D0 +_08002F94: .4byte gUnknown_2000EA8 +_08002F98: .4byte gUnknown_2000EB0 +_08002F9C: .4byte gUnknown_2000ED0 + thumb_func_end InitHeapInternal + + thumb_func_start DoInitHeap +DoInitHeap: + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + ldr r4, [r1, 0x4] + mov r9, r4 + movs r4, 0x4 + negs r4, r4 + mov r5, r9 + ands r5, r4 + mov r9, r5 + ldr r6, _08002FFC + ldr r4, _08003000 + mov r8, r4 + ldr r5, [r4] + lsls r4, r5, 2 + adds r4, r6 + str r0, [r4] + adds r5, 0x1 + mov r4, r8 + str r5, [r4] + ldr r5, [r1] + str r5, [r0, 0x14] + mov r1, r9 + str r1, [r0, 0x18] + movs r1, 0x2 + str r1, [r0] + movs r4, 0 + str r4, [r0, 0x4] + str r2, [r0, 0x8] + movs r1, 0x1 + str r1, [r0, 0xC] + str r3, [r0, 0x10] + str r4, [r2] + str r4, [r2, 0x4] + str r5, [r2, 0xC] + mov r5, r9 + str r5, [r2, 0x10] + str r4, [r2, 0x14] + str r4, [r2, 0x8] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08002FFC: .4byte gUnknown_2000E88 +_08003000: .4byte gUnknown_2000EA8 + thumb_func_end DoInitHeap + + thumb_func_start InitSubHeap +InitSubHeap: + push {r4,r5,lr} + sub sp, 0x8 + adds r3, r2, 0 + lsls r4, r3, 1 + adds r4, r3 + movs r2, 0x4 + negs r2, r2 + lsls r4, 3 + ldr r5, [r1, 0x4] + subs r5, r4 + ands r5, r2 + ldr r2, [r1] + adds r4, r2, r4 + str r4, [sp] + str r5, [sp, 0x4] + mov r1, sp + bl DoInitHeap + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end InitSubHeap + + thumb_func_start xxx_memory_attr_related +xxx_memory_attr_related: + push {lr} + adds r1, r0, 0 + cmp r1, 0 + bne _0800303C + movs r0, 0 + b _08003060 +_0800303C: + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08003048 + movs r0, 0x4 + b _08003060 +_08003048: + movs r2, 0x7 + ands r2, r1 + movs r0, 0x1 + cmp r2, 0x7 + beq _08003060 + movs r0, 0x2 + cmp r2, 0x1 + beq _08003060 + movs r0, 0x5 + cmp r2, 0x3 + bne _08003060 + movs r0, 0x3 +_08003060: + pop {r1} + bx r1 + thumb_func_end xxx_memory_attr_related + + thumb_func_start MemorySearchFromFront +MemorySearchFromFront: + push {r4-r7,lr} + adds r5, r0, 0 + adds r6, r2, 0 + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080030CC + movs r4, 0 + ldr r3, [r5, 0x8] + ldr r2, [r5, 0xC] + cmp r4, r2 + bge _08003104 + ldr r0, [r3, 0x4] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08003090 + ldr r0, [r3, 0x10] + cmp r0, r6 + blt _080030AC + movs r0, 0 + b _08003108 +_08003090: + adds r4, 0x1 + adds r3, 0x18 + cmp r4, r2 + bge _08003104 + ldr r0, [r3, 0x4] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08003090 + ldr r0, [r3, 0x10] + cmp r0, r6 + blt _080030AC +_080030A8: + adds r0, r4, 0 + b _08003108 +_080030AC: + cmp r4, r2 + bge _08003104 + movs r5, 0x1 + adds r1, r2, 0 +_080030B4: + ldr r0, [r3, 0x4] + ands r0, r5 + cmp r0, 0 + bne _080030C2 + ldr r0, [r3, 0x10] + cmp r0, r6 + bge _080030A8 +_080030C2: + adds r4, 0x1 + adds r3, 0x18 + cmp r4, r1 + blt _080030B4 + b _08003104 +_080030CC: + movs r7, 0x1 + negs r7, r7 + ldr r1, _08003100 + movs r4, 0 + ldr r3, [r5, 0x8] + ldr r2, [r5, 0xC] + cmp r4, r2 + bge _080030FC + movs r5, 0x1 +_080030DE: + ldr r0, [r3, 0x4] + ands r0, r5 + cmp r0, 0 + bne _080030F4 + ldr r0, [r3, 0x10] + cmp r0, r6 + blt _080030F4 + cmp r0, r1 + bge _080030F4 + adds r7, r4, 0 + adds r1, r0, 0 +_080030F4: + adds r4, 0x1 + adds r3, 0x18 + cmp r4, r2 + blt _080030DE +_080030FC: + adds r0, r7, 0 + b _08003108 + .align 2, 0 +_08003100: .4byte 0x00024001 +_08003104: + movs r0, 0x1 + negs r0, r0 +_08003108: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end MemorySearchFromFront + + thumb_func_start MemorySearchFromBack +MemorySearchFromBack: + push {r4-r7,lr} + adds r4, r0, 0 + adds r5, r2, 0 + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08003168 + ldr r0, [r4, 0xC] + subs r3, r0, 0x1 + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 3 + ldr r1, [r4, 0x8] + adds r2, r1, r0 + b _08003132 +_0800312E: + subs r3, 0x1 + subs r2, 0x18 +_08003132: + cmp r3, 0 + blt _080031A8 + ldr r0, [r2, 0x4] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0800312E + ldr r0, [r2, 0x10] + cmp r0, r5 + blt _0800314A +_08003146: + adds r0, r3, 0 + b _080031AC +_0800314A: + cmp r3, 0 + blt _080031A8 + movs r1, 0x1 +_08003150: + ldr r0, [r2, 0x4] + ands r0, r1 + cmp r0, 0 + bne _0800315E + ldr r0, [r2, 0x10] + cmp r0, r5 + bge _08003146 +_0800315E: + subs r3, 0x1 + subs r2, 0x18 + cmp r3, 0 + bge _08003150 + b _080031A8 +_08003168: + movs r7, 0x1 + negs r7, r7 + ldr r6, _080031A4 + ldr r0, [r4, 0xC] + subs r3, r0, 0x1 + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 3 + ldr r1, [r4, 0x8] + adds r2, r1, r0 + cmp r3, 0 + blt _080031A0 + movs r1, 0x1 +_08003182: + ldr r0, [r2, 0x4] + ands r0, r1 + cmp r0, 0 + bne _08003198 + ldr r0, [r2, 0x10] + cmp r0, r5 + blt _08003198 + cmp r0, r6 + bge _08003198 + adds r7, r3, 0 + adds r6, r0, 0 +_08003198: + subs r3, 0x1 + subs r2, 0x18 + cmp r3, 0 + bge _08003182 +_080031A0: + adds r0, r7, 0 + b _080031AC + .align 2, 0 +_080031A4: .4byte 0x00024001 +_080031A8: + movs r0, 0x1 + negs r0, r0 +_080031AC: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end MemorySearchFromBack + + thumb_func_start MemorySplitFront +MemorySplitFront: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + str r0, [sp, 0x8] + str r1, [sp, 0xC] + str r2, [sp] + str r3, [sp, 0x4] + adds r0, r3, 0 + adds r0, 0x3 + str r0, [sp, 0x10] + movs r0, 0x4 + negs r0, r0 + ldr r1, [sp, 0x10] + ands r1, r0 + str r1, [sp, 0x10] + ldr r2, [sp, 0xC] + lsls r2, 1 + mov r12, r2 + ldr r0, [sp, 0xC] + add r0, r12 + lsls r0, 3 + ldr r5, [sp, 0x8] + ldr r2, [r5, 0x8] + adds r4, r2, r0 + ldr r0, [r4, 0x10] + cmp r0, r1 + ble _08003260 + ldr r3, [r5, 0xC] + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 3 + adds r1, r2, r0 + mov r9, r12 + mov r10, r2 + mov r12, r3 + ldr r6, [r5, 0x10] + mov r8, r6 + ldr r7, [sp, 0xC] + cmp r12, r7 + ble _08003222 +_0800320A: + adds r2, r1, 0 + subs r2, 0x18 + adds r0, r2, 0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + subs r3, 0x1 + adds r1, r2, 0 + ldr r0, [sp, 0xC] + cmp r3, r0 + bgt _0800320A +_08003222: + mov r2, r12 + adds r2, 0x1 + ldr r1, [sp, 0x8] + str r2, [r1, 0xC] + cmp r2, r8 + ble _08003240 + ldr r0, _08003238 + ldr r1, _0800323C + mov r3, r8 + bl FatalError + .align 2, 0 +_08003238: .4byte gUnknown_80B7EB8 +_0800323C: .4byte gUnknown_80B7EC4 +_08003240: + ldr r0, [sp, 0xC] + add r0, r9 + lsls r0, 3 + adds r0, 0x18 + mov r2, r10 + adds r1, r2, r0 + ldr r0, [r1, 0xC] + ldr r5, [sp, 0x10] + adds r0, r5 + str r0, [r1, 0xC] + ldr r0, [r1, 0x10] + subs r0, r5 + str r0, [r1, 0x10] + str r5, [r4, 0x10] + ldr r6, [sp, 0x4] + str r6, [r4, 0x14] +_08003260: + ldr r0, [sp] + bl xxx_memory_attr_related + str r0, [r4] + ldr r7, [sp] + str r7, [r4, 0x4] + ldr r0, [sp, 0x34] + str r0, [r4, 0x8] + adds r0, r4, 0 + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end MemorySplitFront + + thumb_func_start MemorySplitBack +MemorySplitBack: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + str r0, [sp, 0x8] + str r1, [sp, 0xC] + str r2, [sp] + str r3, [sp, 0x4] + adds r0, r3, 0 + adds r0, 0x3 + str r0, [sp, 0x10] + movs r0, 0x4 + negs r0, r0 + ldr r1, [sp, 0x10] + ands r1, r0 + str r1, [sp, 0x10] + ldr r2, [sp, 0xC] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + ldr r5, [sp, 0x8] + ldr r1, [r5, 0x8] + adds r4, r1, r0 + ldr r0, [r4, 0x10] + ldr r6, [sp, 0x10] + cmp r0, r6 + ble _08003328 + ldr r3, [r5, 0xC] + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 3 + adds r1, r0 + mov r12, r3 + ldr r7, [r5, 0x10] + mov r8, r7 + ldr r0, [r4, 0xC] + mov r9, r0 + movs r2, 0x18 + adds r2, r4 + mov r10, r2 + ldr r5, [sp, 0xC] + cmp r12, r5 + ble _080032F6 +_080032DE: + adds r2, r1, 0 + subs r2, 0x18 + adds r0, r2, 0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + subs r3, 0x1 + adds r1, r2, 0 + ldr r6, [sp, 0xC] + cmp r3, r6 + bgt _080032DE +_080032F6: + mov r2, r12 + adds r2, 0x1 + ldr r7, [sp, 0x8] + str r2, [r7, 0xC] + cmp r2, r8 + ble _08003314 + ldr r0, _0800330C + ldr r1, _08003310 + mov r3, r8 + bl FatalError + .align 2, 0 +_0800330C: .4byte gUnknown_80B7EFC +_08003310: .4byte gUnknown_80B7EC4 +_08003314: + ldr r0, [r4, 0x10] + ldr r1, [sp, 0x10] + subs r0, r1 + str r0, [r4, 0x10] + add r0, r9 + mov r4, r10 + str r0, [r4, 0xC] + str r1, [r4, 0x10] + ldr r2, [sp, 0x4] + str r2, [r4, 0x14] +_08003328: + ldr r0, [sp] + bl xxx_memory_attr_related + str r0, [r4] + ldr r5, [sp] + str r5, [r4, 0x4] + ldr r0, [sp, 0x34] + str r0, [r4, 0x8] + adds r0, r4, 0 + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end MemorySplitBack + + thumb_func_start MemoryLocateSet +MemoryLocateSet: + push {r4-r7,lr} + sub sp, 0x8 + adds r5, r0, 0 + adds r7, r1, 0 + adds r6, r2, 0 + cmp r5, 0 + bne _0800335C + ldr r5, _08003390 +_0800335C: + asrs r4, r6, 8 + movs r0, 0x1 + orrs r4, r0 + movs r0, 0xFF + ands r6, r0 + movs r0, 0x2 + ands r0, r4 + cmp r0, 0 + beq _08003394 + adds r0, r5, 0 + adds r1, r4, 0 + adds r2, r7, 0 + bl MemorySearchFromFront + adds r1, r0, 0 + cmp r1, 0 + blt _080033B4 + str r6, [sp] + adds r0, r5, 0 + adds r2, r4, 0 + adds r3, r7, 0 + bl MemorySplitFront + ldr r0, [r0, 0xC] + b _080033CC + .align 2, 0 +_08003390: .4byte gUnknown_2000EB0 +_08003394: + adds r0, r5, 0 + adds r1, r4, 0 + adds r2, r7, 0 + bl MemorySearchFromBack + adds r1, r0, 0 + cmp r1, 0 + blt _080033B4 + str r6, [sp] + adds r0, r5, 0 + adds r2, r4, 0 + adds r3, r7, 0 + bl MemorySplitBack + ldr r0, [r0, 0xC] + b _080033CC +_080033B4: + ldr r0, _080033C4 + ldr r1, _080033C8 + str r4, [sp] + str r6, [sp, 0x4] + adds r2, r5, 0 + adds r3, r7, 0 + bl FatalError + .align 2, 0 +_080033C4: .4byte gUnknown_80B7F14 +_080033C8: .4byte gUnknown_80B7F20 +_080033CC: + add sp, 0x8 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end MemoryLocateSet + + thumb_func_start MemoryAlloc +MemoryAlloc: + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + ldr r0, _080033E8 + adds r1, r3, 0 + bl DoAlloc + pop {r1} + bx r1 + .align 2, 0 +_080033E8: .4byte gUnknown_2000EB0 + thumb_func_end MemoryAlloc + + thumb_func_start MemoryFree +MemoryFree: + push {lr} + adds r1, r0, 0 + ldr r0, _080033FC + bl DoFree + pop {r0} + bx r0 + .align 2, 0 +_080033FC: .4byte gUnknown_2000EB0 + thumb_func_end MemoryFree + + thumb_func_start CreateSubHeap +CreateSubHeap: + push {r4-r7,lr} + sub sp, 0xC + adds r4, r0, 0 + adds r5, r1, 0 + adds r7, r2, 0 + adds r6, r3, 0 + cmp r4, 0 + bne _08003412 + ldr r4, _0800342C +_08003412: + adds r0, r4, 0 + movs r1, 0x9 + adds r2, r5, 0 + bl MemorySearchFromBack + adds r1, r0, 0 + cmp r1, 0 + bge _08003438 + ldr r0, _08003430 + ldr r1, _08003434 + adds r2, r5, 0 + bl FatalError + .align 2, 0 +_0800342C: .4byte gUnknown_2000EB0 +_08003430: .4byte gUnknown_80B7F88 +_08003434: .4byte gUnknown_80B7F94 +_08003438: + str r6, [sp] + adds r0, r4, 0 + movs r2, 0x9 + adds r3, r5, 0 + bl MemorySplitBack + ldr r1, [r0, 0xC] + str r1, [sp, 0x4] + ldr r0, [r0, 0x10] + str r0, [sp, 0x8] + add r0, sp, 0x4 + adds r1, r7, 0 + bl DoCreateSubHeap + str r4, [r0, 0x4] + add sp, 0xC + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end CreateSubHeap + + thumb_func_start DoCreateSubHeap +DoCreateSubHeap: + push {r4,lr} + sub sp, 0x8 + adds r2, r1, 0 + ldr r4, [r0] + adds r1, r4, 0 + adds r1, 0x1C + str r1, [sp] + ldr r0, [r0, 0x4] + subs r0, 0x1C + str r0, [sp, 0x4] + adds r0, r4, 0 + mov r1, sp + bl InitSubHeap + adds r0, r4, 0 + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + thumb_func_end DoCreateSubHeap + + thumb_func_start xxx_unused_memory_free +xxx_unused_memory_free: + push {r4-r7,lr} + adds r4, r0, 0 + cmp r4, 0 + beq _08003504 + movs r1, 0 + ldr r0, [r4, 0xC] + cmp r0, 0x1 + bne _080034A2 + ldr r0, [r4, 0x8] + ldr r0, [r0, 0x4] + cmp r0, 0 + bne _080034A2 + movs r1, 0x1 +_080034A2: + cmp r1, 0 + beq _08003504 + movs r0, 0 + mov r12, r0 + movs r3, 0 + ldr r6, _080034E0 + ldr r0, [r6] + cmp r12, r0 + bge _080034F2 + ldr r5, _080034E4 + adds r1, r6, 0 + adds r7, r5, 0 + movs r2, 0 +_080034BC: + adds r0, r2, r5 + ldr r0, [r0] + cmp r0, r4 + bne _080034E8 + ldr r0, [r1] + subs r0, 0x1 + str r0, [r1] + cmp r3, r0 + bge _080034F8 + ldr r1, _080034E0 + adds r2, r7 +_080034D2: + ldr r0, [r2, 0x4] + stm r2!, {r0} + adds r3, 0x1 + ldr r0, [r1] + cmp r3, r0 + blt _080034D2 + b _080034F8 + .align 2, 0 +_080034E0: .4byte gUnknown_2000EA8 +_080034E4: .4byte gUnknown_2000E88 +_080034E8: + adds r2, 0x4 + adds r3, 0x1 + ldr r0, [r6] + cmp r3, r0 + blt _080034BC +_080034F2: + mov r0, r12 + cmp r0, 0 + beq _08003504 +_080034F8: + ldr r0, [r4, 0x4] + cmp r0, 0 + beq _08003504 + adds r1, r4, 0 + bl DoFree +_08003504: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end xxx_unused_memory_free + + thumb_func_start DoAlloc +DoAlloc: + push {lr} + movs r3, 0x80 + lsls r3, 1 + orrs r3, r2 + adds r2, r3, 0 + bl MemoryLocateSet + pop {r1} + bx r1 + thumb_func_end DoAlloc + + thumb_func_start DoFree +DoFree: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + cmp r4, 0 + bne _0800352E + ldr r4, _080035D4 +_0800352E: + cmp r1, 0 + beq _080035E4 + movs r0, 0 + mov r8, r0 + ldr r3, [r4, 0x8] + mov r12, r3 + ldr r3, [r4, 0xC] + cmp r8, r3 + bge _080035E4 + movs r2, 0 +_08003542: + mov r5, r12 + ldr r0, [r5, 0xC] + cmp r0, r1 + bne _080035D8 + str r2, [r5] + str r2, [r5, 0x4] + str r2, [r5, 0x14] + str r2, [r5, 0x8] + ldr r0, [r4, 0xC] + subs r0, 0x1 + cmp r8, r0 + bge _08003592 + mov r2, r12 + adds r2, 0x18 + ldr r0, [r2, 0x4] + cmp r0, 0 + bne _08003592 + ldr r0, [r5, 0x10] + ldr r1, [r2, 0x10] + adds r0, r1 + str r0, [r5, 0x10] + ldr r0, [r4, 0xC] + subs r0, 0x1 + str r0, [r4, 0xC] + mov r3, r8 + adds r3, 0x1 + cmp r3, r0 + bge _08003592 +_0800357A: + adds r0, r2, 0 + adds r1, r2, 0 + adds r1, 0x18 + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + adds r3, 0x1 + adds r2, 0x18 + ldr r0, [r4, 0xC] + cmp r3, r0 + blt _0800357A +_08003592: + mov r6, r8 + cmp r6, 0 + ble _080035E4 + mov r2, r12 + subs r2, 0x18 + ldr r0, [r2, 0x4] + cmp r0, 0 + bne _080035E4 + ldr r0, [r2, 0x10] + mov r7, r12 + ldr r1, [r7, 0x10] + adds r0, r1 + str r0, [r2, 0x10] + ldr r0, [r4, 0xC] + subs r0, 0x1 + str r0, [r4, 0xC] + mov r2, r12 + mov r3, r8 + cmp r3, r0 + bge _080035E4 +_080035BA: + adds r0, r2, 0 + adds r1, r2, 0 + adds r1, 0x18 + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + adds r3, 0x1 + adds r2, 0x18 + ldr r0, [r4, 0xC] + cmp r3, r0 + blt _080035BA + b _080035E4 + .align 2, 0 +_080035D4: .4byte gUnknown_2000EB0 +_080035D8: + movs r0, 0x1 + add r8, r0 + movs r5, 0x18 + add r12, r5 + cmp r8, r3 + blt _08003542 +_080035E4: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end DoFree + + thumb_func_start nullsub_141 +nullsub_141: + bx lr + thumb_func_end nullsub_141 + + thumb_func_start nullsub_142 +nullsub_142: + bx lr + thumb_func_end nullsub_142 + + thumb_func_start sub_80035F8 +sub_80035F8: + push {lr} + pop {r0} + bx r0 + thumb_func_end sub_80035F8 + + thumb_func_start sub_8003600 +sub_8003600: + push {r4-r6,lr} + ldr r1, _08003650 + ldr r6, _08003654 + movs r2, 0 + ldr r0, _08003658 + movs r3, 0x80 + lsls r3, 2 +_0800360E: + strb r2, [r0] + strb r2, [r0, 0x1] + strb r2, [r0, 0x2] + strb r2, [r0, 0x3] + adds r0, 0x4 + subs r3, 0x1 + cmp r3, 0 + bne _0800360E + movs r0, 0 + movs r5, 0x80 + lsls r5, 1 + ldr r4, _0800365C + movs r3, 0x20 + ldr r2, _08003660 +_0800362A: + strb r0, [r1] + strh r5, [r1, 0x2] + strb r0, [r1, 0x4] + strb r0, [r1, 0x5] + strb r0, [r1, 0x6] + strb r0, [r1, 0x7] + str r0, [r1, 0x8] + str r4, [r1, 0xC] + str r2, [r1, 0x10] + subs r3, 0x1 + adds r1, 0x14 + cmp r3, 0 + bge _0800362A + movs r0, 0x1 + strb r0, [r6] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08003650: .4byte gUnknown_3000C00 +_08003654: .4byte gUnknown_3001B58 +_08003658: .4byte gUnknown_3000400 +_0800365C: .4byte sub_8003A34 +_08003660: .4byte sub_8003A74 + thumb_func_end sub_8003600 + + thumb_func_start sub_8003664 +sub_8003664: + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 2 + ldr r0, _0800369C + adds r2, r0 + movs r3, 0 + movs r4, 0x1 + strb r4, [r2] + movs r0, 0 + strh r1, [r2, 0x2] + strb r0, [r2, 0x4] + strb r0, [r2, 0x5] + strb r0, [r2, 0x6] + strb r0, [r2, 0x7] + str r3, [r2, 0x8] + ldr r0, _080036A0 + str r0, [r2, 0xC] + ldr r0, _080036A4 + str r0, [r2, 0x10] + ldr r0, _080036A8 + strb r4, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800369C: .4byte gUnknown_3000C00 +_080036A0: .4byte sub_8003AC0 +_080036A4: .4byte sub_8003B50 +_080036A8: .4byte gUnknown_3001B58 + thumb_func_end sub_8003664 + + thumb_func_start sub_80036AC +sub_80036AC: + push {r4,lr} + sub sp, 0x4 + str r2, [sp] + lsls r0, 16 + lsrs r0, 16 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 2 + ldr r0, _080036E4 + adds r2, r0 + movs r3, 0 + movs r4, 0x1 + strb r4, [r2] + strh r1, [r2, 0x2] + ldr r0, [sp] + str r0, [r2, 0x4] + str r3, [r2, 0x8] + ldr r0, _080036E8 + str r0, [r2, 0xC] + ldr r0, _080036EC + str r0, [r2, 0x10] + ldr r0, _080036F0 + strb r4, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080036E4: .4byte gUnknown_3000C00 +_080036E8: .4byte sub_8003C18 +_080036EC: .4byte sub_8003D00 +_080036F0: .4byte gUnknown_3001B58 + thumb_func_end sub_80036AC + + thumb_func_start sub_80036F4 +sub_80036F4: + push {r4,lr} + sub sp, 0x4 + str r2, [sp] + lsls r0, 16 + lsrs r0, 16 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 2 + ldr r0, _0800372C + adds r2, r0 + movs r3, 0 + movs r4, 0x1 + strb r4, [r2] + strh r1, [r2, 0x2] + ldr r0, [sp] + str r0, [r2, 0x4] + str r3, [r2, 0x8] + ldr r0, _08003730 + str r0, [r2, 0xC] + ldr r0, _08003734 + str r0, [r2, 0x10] + ldr r0, _08003738 + strb r4, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800372C: .4byte gUnknown_3000C00 +_08003730: .4byte sub_8003E2C +_08003734: .4byte sub_8003EC0 +_08003738: .4byte gUnknown_3001B58 + thumb_func_end sub_80036F4 + + thumb_func_start sub_800373C +sub_800373C: + push {r4,lr} + lsls r0, 16 + lsrs r0, 16 + lsls r3, r0, 2 + adds r3, r0 + lsls r3, 2 + ldr r0, _08003770 + adds r3, r0 + movs r4, 0x1 + strb r4, [r3] + movs r0, 0 + strh r1, [r3, 0x2] + strb r0, [r3, 0x4] + strb r0, [r3, 0x5] + strb r0, [r3, 0x6] + strb r0, [r3, 0x7] + str r2, [r3, 0x8] + ldr r0, _08003774 + str r0, [r3, 0xC] + ldr r0, _08003778 + str r0, [r3, 0x10] + ldr r0, _0800377C + strb r4, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08003770: .4byte gUnknown_3000C00 +_08003774: .4byte sub_8003F60 +_08003778: .4byte sub_8004034 +_0800377C: .4byte gUnknown_3001B58 + thumb_func_end sub_800373C + + thumb_func_start sub_8003780 +sub_8003780: + push {r4,lr} + sub sp, 0x4 + str r2, [sp] + lsls r0, 16 + lsrs r0, 16 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 2 + ldr r0, _080037B8 + adds r2, r0 + movs r3, 0 + movs r4, 0x1 + strb r4, [r2] + strh r1, [r2, 0x2] + ldr r0, [sp] + str r0, [r2, 0x4] + str r3, [r2, 0x8] + ldr r0, _080037BC + str r0, [r2, 0xC] + ldr r0, _080037C0 + str r0, [r2, 0x10] + ldr r0, _080037C4 + strb r4, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080037B8: .4byte gUnknown_3000C00 +_080037BC: .4byte sub_8004170 +_080037C0: .4byte sub_8004264 +_080037C4: .4byte gUnknown_3001B58 + thumb_func_end sub_8003780 + + thumb_func_start sub_80037C8 +sub_80037C8: + push {r4,lr} + sub sp, 0x4 + str r2, [sp] + lsls r0, 16 + lsrs r0, 16 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 2 + ldr r0, _08003800 + adds r2, r0 + movs r3, 0 + movs r4, 0x1 + strb r4, [r2] + strh r1, [r2, 0x2] + ldr r0, [sp] + str r0, [r2, 0x4] + str r3, [r2, 0x8] + ldr r0, _08003804 + str r0, [r2, 0xC] + ldr r0, _08003808 + str r0, [r2, 0x10] + ldr r0, _0800380C + strb r4, [r0] + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08003800: .4byte gUnknown_3000C00 +_08003804: .4byte sub_8004388 +_08003808: .4byte sub_8004434 +_0800380C: .4byte gUnknown_3001B58 + thumb_func_end sub_80037C8 + + thumb_func_start sub_8003810 +sub_8003810: + sub sp, 0x4 + str r1, [sp] + lsls r0, 16 + lsrs r2, r0, 20 + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 2 + ldr r2, _08003838 + adds r1, r2 + movs r2, 0x1 + strb r2, [r1] + ldr r1, _0800383C + lsrs r0, 14 + adds r0, r1 + ldr r1, [sp] + str r1, [r0] + ldr r0, _08003840 + strb r2, [r0] + add sp, 0x4 + bx lr + .align 2, 0 +_08003838: .4byte gUnknown_3000C00 +_0800383C: .4byte gUnknown_3000400 +_08003840: .4byte gUnknown_3001B58 + thumb_func_end sub_8003810 + + thumb_func_start sub_8003844 +sub_8003844: + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 16 + lsrs r1, 16 + lsrs r0, 20 + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 2 + ldr r0, _08003880 + adds r2, r0 + movs r5, 0x1 + strb r5, [r2] + adds r0, r1, 0 + bl sub_80027A0 + str r0, [sp] + ldr r0, _08003884 + lsls r4, 2 + adds r4, r0 + ldr r0, [sp] + str r0, [r4] + ldr r0, _08003888 + strb r5, [r0] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08003880: .4byte gUnknown_3000C00 +_08003884: .4byte gUnknown_3000400 +_08003888: .4byte gUnknown_3001B58 + thumb_func_end sub_8003844 + + thumb_func_start sub_800388C +sub_800388C: + push {r4-r7,lr} + adds r6, r1, 0 + lsls r0, 16 + lsrs r1, r0, 16 + lsrs r4, r0, 20 + adds r3, r1, r2 + subs r0, r3, 0x1 + cmp r0, 0 + bge _080038A0 + adds r0, 0xF +_080038A0: + lsls r0, 12 + lsrs r3, r0, 16 + lsls r1, 2 + ldr r0, _080038E4 + adds r1, r0 + lsls r5, r4, 2 + ldr r7, _080038E8 + ldr r0, _080038EC + mov r12, r0 + cmp r2, 0 + ble _080038C0 +_080038B6: + ldm r6!, {r0} + stm r1!, {r0} + subs r2, 0x1 + cmp r2, 0 + bne _080038B6 +_080038C0: + adds r0, r5, r4 + lsls r0, 2 + adds r0, r7 + adds r2, r4, 0 + cmp r2, r3 + bgt _080038D8 + movs r1, 0x1 +_080038CE: + strb r1, [r0] + adds r2, 0x1 + adds r0, 0x14 + cmp r2, r3 + ble _080038CE +_080038D8: + movs r0, 0x1 + mov r1, r12 + strb r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080038E4: .4byte gUnknown_3000400 +_080038E8: .4byte gUnknown_3000C00 +_080038EC: .4byte gUnknown_3001B58 + thumb_func_end sub_800388C + + thumb_func_start sub_80038F0 +sub_80038F0: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + adds r5, r1, 0 + lsls r0, 16 + lsrs r1, r0, 16 + lsrs r6, r0, 20 + adds r3, r1, r2 + subs r0, r3, 0x1 + cmp r0, 0 + bge _0800390C + adds r0, 0xF +_0800390C: + lsls r0, 12 + lsrs r7, r0, 16 + lsls r1, 2 + ldr r0, _0800396C + adds r1, r0 + mov r8, r1 + lsls r0, r6, 2 + mov r9, r0 + cmp r2, 0 + ble _0800393C + adds r4, r2, 0 +_08003922: + ldrh r0, [r5] + adds r5, 0x2 + bl sub_80027A0 + str r0, [sp] + mov r1, r8 + adds r1, 0x4 + mov r8, r1 + subs r1, 0x4 + stm r1!, {r0} + subs r4, 0x1 + cmp r4, 0 + bne _08003922 +_0800393C: + mov r1, r9 + adds r0, r1, r6 + lsls r0, 2 + ldr r1, _08003970 + adds r0, r1 + adds r4, r6, 0 + ldr r2, _08003974 + cmp r4, r7 + bgt _0800395A + movs r1, 0x1 +_08003950: + strb r1, [r0] + adds r4, 0x1 + adds r0, 0x14 + cmp r4, r7 + ble _08003950 +_0800395A: + movs r0, 0x1 + strb r0, [r2] + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0800396C: .4byte gUnknown_3000400 +_08003970: .4byte gUnknown_3000C00 +_08003974: .4byte gUnknown_3001B58 + thumb_func_end sub_80038F0 + + thumb_func_start sub_8003978 +sub_8003978: + lsls r0, 16 + ldr r1, _08003984 + lsrs r0, 14 + adds r0, r1 + ldr r0, [r0] + bx lr + .align 2, 0 +_08003984: .4byte gUnknown_3000400 + thumb_func_end sub_8003978 + + thumb_func_start sub_8003988 +sub_8003988: + push {lr} + lsls r0, 16 + ldr r1, _080039A0 + lsrs r0, 14 + adds r0, r1 + ldr r0, [r0] + bl sub_8002774 + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + .align 2, 0 +_080039A0: .4byte gUnknown_3000400 + thumb_func_end sub_8003988 + + thumb_func_start sub_80039A4 +sub_80039A4: + lsls r0, 16 + lsrs r0, 16 + ldr r2, _080039B4 + ldrh r1, [r2] + orrs r0, r1 + strh r0, [r2] + bx lr + .align 2, 0 +_080039B4: .4byte gUnknown_3001B5A + thumb_func_end sub_80039A4 + + thumb_func_start sub_80039B8 +sub_80039B8: + push {r4,r5,lr} + ldr r0, _08003A28 + ldrb r0, [r0] + cmp r0, 0 + beq _08003A20 + ldr r4, _08003A2C + movs r1, 0x96 + lsls r1, 1 + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080039DA + movs r0, 0xA0 + lsls r0, 2 + adds r1, r4, r0 + movs r0, 0x1 + strb r0, [r1] +_080039DA: + movs r5, 0 +_080039DC: + ldrb r0, [r4] + cmp r0, 0 + beq _080039F0 + lsls r0, r5, 16 + lsrs r0, 16 + ldr r1, [r4, 0x10] + bl _call_via_r1 + movs r0, 0 + strb r0, [r4] +_080039F0: + adds r5, 0x1 + adds r4, 0x14 + cmp r5, 0x1F + ble _080039DC + ldr r0, _08003A2C + movs r1, 0xA0 + lsls r1, 2 + adds r5, r0, r1 + ldrb r0, [r5] + cmp r0, 0 + beq _08003A14 + ldr r2, [r4, 0xC] + movs r0, 0x20 + movs r1, 0xF0 + bl _call_via_r2 + movs r0, 0 + strb r0, [r5] +_08003A14: + ldr r1, _08003A30 + movs r0, 0x3 + strh r0, [r1] + ldr r1, _08003A28 + movs r0, 0 + strb r0, [r1] +_08003A20: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08003A28: .4byte gUnknown_3001B58 +_08003A2C: .4byte gUnknown_3000C00 +_08003A30: .4byte gUnknown_3001B5A + thumb_func_end sub_80039B8 + + thumb_func_start sub_8003A34 +sub_8003A34: + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, r1, 16 + lsrs r0, 16 + lsls r5, r0, 2 + ldr r1, _08003A70 + adds r5, r1 + ldrb r1, [r5, 0x2] + movs r2, 0xF8 + adds r3, r2, 0 + ands r3, r1 + lsls r3, 7 + ldrb r4, [r5, 0x1] + adds r1, r2, 0 + ands r1, r4 + lsls r1, 2 + orrs r3, r1 + ldrb r1, [r5] + ands r2, r1 + lsrs r2, 3 + orrs r2, r3 + mov r1, sp + strh r2, [r1] + bl SetBGPaletteBufferColor + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08003A70: .4byte gUnknown_3000400 + thumb_func_end sub_8003A34 + + thumb_func_start sub_8003A74 +sub_8003A74: + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 20 + lsrs r6, r0, 16 + lsls r1, r6, 2 + ldr r0, _08003ABC + adds r4, r1, r0 + movs r5, 0 + movs r7, 0xF8 +_08003A86: + ldrb r0, [r4, 0x2] + adds r1, r7, 0 + ands r1, r0 + lsls r1, 7 + ldrb r2, [r4, 0x1] + adds r0, r7, 0 + ands r0, r2 + lsls r0, 2 + orrs r1, r0 + ldrb r2, [r4] + adds r0, r7, 0 + ands r0, r2 + lsrs r0, 3 + orrs r0, r1 + mov r1, sp + strh r0, [r1] + adds r0, r6, r5 + bl SetBGPaletteBufferColor + adds r4, 0x4 + adds r5, 0x1 + cmp r5, 0xF + ble _08003A86 + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08003ABC: .4byte gUnknown_3000400 + thumb_func_end sub_8003A74 + + thumb_func_start sub_8003AC0 +sub_8003AC0: + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r7, r1, 16 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + ldr r0, _08003B04 + adds r1, r0 + ldrh r2, [r1, 0x2] + adds r6, r2, 0 + lsls r1, r7, 2 + ldr r0, _08003B08 + adds r4, r1, r0 + cmp r2, 0xFF + bls _08003B0C + ldrb r0, [r4, 0x2] + movs r1, 0xF8 + adds r2, r1, 0 + ands r2, r0 + lsls r2, 7 + ldrb r3, [r4, 0x1] + adds r0, r1, 0 + ands r0, r3 + lsls r0, 2 + orrs r2, r0 + ldrb r0, [r4] + ands r1, r0 + lsrs r1, 3 + orrs r1, r2 + b _08003B3A + .align 2, 0 +_08003B04: .4byte gUnknown_3000C00 +_08003B08: .4byte gUnknown_3000400 +_08003B0C: + cmp r2, 0 + bne _08003B16 + mov r0, sp + strh r2, [r0] + b _08003B3E +_08003B16: + ldrb r0, [r4, 0x2] + muls r0, r2 + asrs r0, 8 + movs r3, 0xF8 + ands r0, r3 + lsls r5, r0, 7 + ldrb r0, [r4, 0x1] + muls r0, r2 + asrs r0, 8 + ands r0, r3 + lsls r1, r0, 2 + orrs r1, r5 + ldrb r0, [r4] + muls r0, r6 + asrs r0, 8 + ands r0, r3 + lsrs r0, 3 + orrs r1, r0 +_08003B3A: + mov r0, sp + strh r1, [r0] +_08003B3E: + adds r0, r7, 0 + mov r1, sp + bl SetBGPaletteBufferColor + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8003AC0 + + thumb_func_start sub_8003B50 +sub_8003B50: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + ldr r2, _08003BAC + adds r1, r2 + ldrh r6, [r1, 0x2] + lsls r0, 20 + lsrs r7, r0, 16 + lsls r1, r7, 2 + ldr r0, _08003BB0 + adds r4, r1, r0 + cmp r6, 0xFF + bls _08003BB4 + movs r5, 0 + movs r6, 0xF8 +_08003B7A: + ldrb r0, [r4, 0x2] + adds r1, r6, 0 + ands r1, r0 + lsls r1, 7 + ldrb r2, [r4, 0x1] + adds r0, r6, 0 + ands r0, r2 + lsls r0, 2 + orrs r1, r0 + ldrb r2, [r4] + adds r0, r6, 0 + ands r0, r2 + lsrs r0, 3 + orrs r0, r1 + mov r1, sp + strh r0, [r1] + adds r0, r7, r5 + bl SetBGPaletteBufferColor + adds r4, 0x4 + adds r5, 0x1 + cmp r5, 0xF + ble _08003B7A + b _08003C0A + .align 2, 0 +_08003BAC: .4byte gUnknown_3000C00 +_08003BB0: .4byte gUnknown_3000400 +_08003BB4: + cmp r6, 0 + bne _08003BCE + mov r0, sp + strh r6, [r0] + movs r5, 0 +_08003BBE: + adds r0, r7, r5 + mov r1, sp + bl SetBGPaletteBufferColor + adds r5, 0x1 + cmp r5, 0xF + ble _08003BBE + b _08003C0A +_08003BCE: + movs r5, 0 + mov r8, sp +_08003BD2: + ldrb r0, [r4, 0x2] + muls r0, r6 + asrs r0, 8 + movs r3, 0xF8 + ands r0, r3 + lsls r2, r0, 7 + ldrb r0, [r4, 0x1] + muls r0, r6 + asrs r0, 8 + ands r0, r3 + lsls r1, r0, 2 + orrs r1, r2 + ldrb r0, [r4] + muls r0, r6 + asrs r0, 8 + ands r0, r3 + lsrs r0, 3 + orrs r1, r0 + mov r0, r8 + strh r1, [r0] + adds r0, r7, r5 + mov r1, sp + bl SetBGPaletteBufferColor + adds r4, 0x4 + adds r5, 0x1 + cmp r5, 0xF + ble _08003BD2 +_08003C0A: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8003B50 + + thumb_func_start sub_8003C18 +sub_8003C18: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r1, 16 + mov r8, r1 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + ldr r0, _08003C68 + adds r1, r0 + ldrh r2, [r1, 0x2] + mov r12, r2 + ldr r0, [r1, 0x4] + str r0, [sp] + mov r0, r8 + lsls r1, r0, 2 + ldr r0, _08003C6C + adds r4, r1, r0 + cmp r2, 0xFF + bls _08003C70 + ldrb r0, [r4, 0x2] + movs r1, 0xF8 + adds r2, r1, 0 + ands r2, r0 + lsls r2, 7 + ldrb r3, [r4, 0x1] + adds r0, r1, 0 + ands r0, r3 + lsls r0, 2 + orrs r2, r0 + ldrb r0, [r4] + ands r1, r0 + lsrs r1, 3 + orrs r1, r2 + b _08003CE8 + .align 2, 0 +_08003C68: .4byte gUnknown_3000C00 +_08003C6C: .4byte gUnknown_3000400 +_08003C70: + cmp r2, 0 + bne _08003C98 + mov r0, sp + ldrb r0, [r0, 0x2] + movs r1, 0xF8 + adds r2, r1, 0 + ands r2, r0 + lsls r2, 7 + mov r0, sp + ldrb r3, [r0, 0x1] + adds r0, r1, 0 + ands r0, r3 + lsls r0, 2 + orrs r2, r0 + mov r0, sp + ldrb r0, [r0] + ands r1, r0 + lsrs r1, 3 + orrs r1, r2 + b _08003CE8 +_08003C98: + movs r1, 0x80 + lsls r1, 1 + adds r0, r1, 0 + subs r0, r2 + lsls r0, 16 + lsrs r0, 16 + mov r1, sp + ldrb r1, [r1] + adds r7, r1, 0 + muls r7, r0 + mov r1, sp + ldrb r1, [r1, 0x1] + adds r6, r1, 0 + muls r6, r0 + mov r1, sp + ldrb r1, [r1, 0x2] + muls r1, r0 + ldrb r0, [r4, 0x2] + muls r0, r2 + adds r0, r1 + asrs r0, 8 + movs r3, 0xF8 + ands r0, r3 + lsls r5, r0, 7 + ldrb r0, [r4, 0x1] + muls r0, r2 + adds r0, r6 + asrs r0, 8 + ands r0, r3 + lsls r1, r0, 2 + orrs r1, r5 + ldrb r0, [r4] + mov r2, r12 + muls r2, r0 + adds r0, r2, 0 + adds r0, r7 + asrs r0, 8 + ands r0, r3 + lsrs r0, 3 + orrs r1, r0 +_08003CE8: + add r0, sp, 0x4 + strh r1, [r0] + adds r1, r0, 0 + mov r0, r8 + bl SetBGPaletteBufferColor + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8003C18 + + thumb_func_start sub_8003D00 +sub_8003D00: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + ldr r2, _08003D68 + adds r1, r2 + ldrh r6, [r1, 0x2] + ldr r1, [r1, 0x4] + str r1, [sp] + lsls r0, 20 + lsrs r0, 16 + mov r8, r0 + lsls r1, r0, 2 + ldr r0, _08003D6C + adds r4, r1, r0 + cmp r6, 0xFF + bls _08003D70 + movs r5, 0 + movs r7, 0xF8 + add r6, sp, 0x4 +_08003D36: + ldrb r0, [r4, 0x2] + adds r1, r7, 0 + ands r1, r0 + lsls r1, 7 + ldrb r2, [r4, 0x1] + adds r0, r7, 0 + ands r0, r2 + lsls r0, 2 + orrs r1, r0 + ldrb r2, [r4] + adds r0, r7, 0 + ands r0, r2 + lsrs r0, 3 + orrs r0, r1 + strh r0, [r6] + mov r1, r8 + adds r0, r1, r5 + adds r1, r6, 0 + bl SetBGPaletteBufferColor + adds r4, 0x4 + adds r5, 0x1 + cmp r5, 0xF + ble _08003D36 + b _08003E1C + .align 2, 0 +_08003D68: .4byte gUnknown_3000C00 +_08003D6C: .4byte gUnknown_3000400 +_08003D70: + cmp r6, 0 + bne _08003DAE + add r4, sp, 0x4 + mov r0, sp + ldrb r0, [r0, 0x2] + movs r1, 0xF8 + adds r2, r1, 0 + ands r2, r0 + lsls r2, 7 + mov r0, sp + ldrb r3, [r0, 0x1] + adds r0, r1, 0 + ands r0, r3 + lsls r0, 2 + orrs r2, r0 + mov r0, sp + ldrb r0, [r0] + ands r1, r0 + lsrs r1, 3 + orrs r1, r2 + strh r1, [r4] + movs r5, 0 +_08003D9C: + mov r2, r8 + adds r0, r2, r5 + adds r1, r4, 0 + bl SetBGPaletteBufferColor + adds r5, 0x1 + cmp r5, 0xF + ble _08003D9C + b _08003E1C +_08003DAE: + movs r1, 0x80 + lsls r1, 1 + adds r0, r1, 0 + subs r0, r6 + lsls r0, 16 + lsrs r0, 16 + mov r1, sp + ldrb r1, [r1] + adds r2, r1, 0 + muls r2, r0 + str r2, [sp, 0x8] + mov r1, sp + ldrb r1, [r1, 0x1] + adds r2, r1, 0 + muls r2, r0 + mov r10, r2 + mov r1, sp + ldrb r1, [r1, 0x2] + adds r2, r1, 0 + muls r2, r0 + mov r9, r2 + movs r5, 0 + add r7, sp, 0x4 +_08003DDC: + ldrb r0, [r4, 0x2] + muls r0, r6 + add r0, r9 + asrs r0, 8 + movs r3, 0xF8 + ands r0, r3 + lsls r2, r0, 7 + ldrb r0, [r4, 0x1] + muls r0, r6 + add r0, r10 + asrs r0, 8 + ands r0, r3 + lsls r1, r0, 2 + orrs r1, r2 + ldrb r0, [r4] + muls r0, r6 + ldr r2, [sp, 0x8] + adds r0, r2 + asrs r0, 8 + ands r0, r3 + lsrs r0, 3 + orrs r1, r0 + strh r1, [r7] + mov r1, r8 + adds r0, r1, r5 + adds r1, r7, 0 + bl SetBGPaletteBufferColor + adds r4, 0x4 + adds r5, 0x1 + cmp r5, 0xF + ble _08003DDC +_08003E1C: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8003D00 + + thumb_func_start sub_8003E2C +sub_8003E2C: + push {r4-r6,lr} + sub sp, 0x8 + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r6, r1, 16 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + ldr r0, _08003E74 + adds r1, r0 + ldrh r2, [r1, 0x2] + adds r5, r2, 0 + ldr r0, [r1, 0x4] + str r0, [sp] + cmp r2, 0xFF + bls _08003E78 + mov r0, sp + ldrb r0, [r0, 0x2] + movs r1, 0xF8 + adds r2, r1, 0 + ands r2, r0 + lsls r2, 7 + mov r0, sp + ldrb r3, [r0, 0x1] + adds r0, r1, 0 + ands r0, r3 + lsls r0, 2 + orrs r2, r0 + mov r0, sp + ldrb r0, [r0] + ands r1, r0 + lsrs r1, 3 + orrs r1, r2 + b _08003EAC + .align 2, 0 +_08003E74: .4byte gUnknown_3000C00 +_08003E78: + cmp r2, 0 + bne _08003E82 + add r0, sp, 0x4 + strh r2, [r0] + b _08003EB0 +_08003E82: + mov r0, sp + ldrb r0, [r0, 0x2] + muls r0, r2 + asrs r0, 8 + movs r3, 0xF8 + ands r0, r3 + lsls r4, r0, 7 + mov r0, sp + ldrb r0, [r0, 0x1] + muls r0, r2 + asrs r0, 8 + ands r0, r3 + lsls r1, r0, 2 + orrs r1, r4 + mov r0, sp + ldrb r0, [r0] + muls r0, r5 + asrs r0, 8 + ands r0, r3 + lsrs r0, 3 + orrs r1, r0 +_08003EAC: + add r0, sp, 0x4 + strh r1, [r0] +_08003EB0: + adds r1, r0, 0 + adds r0, r6, 0 + bl SetBGPaletteBufferColor + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8003E2C + + thumb_func_start sub_8003EC0 +sub_8003EC0: + push {r4-r6,lr} + sub sp, 0x8 + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + ldr r2, _08003F08 + adds r1, r2 + ldrh r2, [r1, 0x2] + adds r5, r2, 0 + ldr r1, [r1, 0x4] + str r1, [sp] + lsls r0, 20 + lsrs r6, r0, 16 + cmp r2, 0xFF + bls _08003F0C + mov r0, sp + ldrb r0, [r0, 0x2] + movs r1, 0xF8 + adds r2, r1, 0 + ands r2, r0 + lsls r2, 7 + mov r0, sp + ldrb r3, [r0, 0x1] + adds r0, r1, 0 + ands r0, r3 + lsls r0, 2 + orrs r2, r0 + mov r0, sp + ldrb r0, [r0] + ands r1, r0 + lsrs r1, 3 + orrs r1, r2 + b _08003F40 + .align 2, 0 +_08003F08: .4byte gUnknown_3000C00 +_08003F0C: + cmp r2, 0 + bne _08003F16 + add r0, sp, 0x4 + strh r2, [r0] + b _08003F44 +_08003F16: + mov r0, sp + ldrb r0, [r0, 0x2] + muls r0, r2 + asrs r0, 8 + movs r3, 0xF8 + ands r0, r3 + lsls r4, r0, 7 + mov r0, sp + ldrb r0, [r0, 0x1] + muls r0, r2 + asrs r0, 8 + ands r0, r3 + lsls r1, r0, 2 + orrs r1, r4 + mov r0, sp + ldrb r0, [r0] + muls r0, r5 + asrs r0, 8 + ands r0, r3 + lsrs r0, 3 + orrs r1, r0 +_08003F40: + add r0, sp, 0x4 + strh r1, [r0] +_08003F44: + adds r5, r0, 0 + movs r4, 0 +_08003F48: + adds r0, r6, r4 + adds r1, r5, 0 + bl SetBGPaletteBufferColor + adds r4, 0x1 + cmp r4, 0xF + ble _08003F48 + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8003EC0 + + thumb_func_start sub_8003F60 +sub_8003F60: + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r7, r1, 16 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + ldr r0, _08003FA8 + adds r1, r0 + ldrh r2, [r1, 0x2] + adds r3, r2, 0 + movs r0, 0xF + ands r0, r7 + lsls r0, 2 + ldr r1, [r1, 0x8] + adds r5, r1, r0 + lsls r1, r7, 2 + ldr r0, _08003FAC + adds r4, r1, r0 + cmp r2, 0xFF + bls _08003FB0 + ldrb r0, [r4, 0x2] + movs r1, 0xF8 + adds r2, r1, 0 + ands r2, r0 + lsls r2, 7 + ldrb r3, [r4, 0x1] + adds r0, r1, 0 + ands r0, r3 + lsls r0, 2 + orrs r2, r0 + ldrb r0, [r4] + b _08003FCA + .align 2, 0 +_08003FA8: .4byte gUnknown_3000C00 +_08003FAC: .4byte gUnknown_3000400 +_08003FB0: + cmp r2, 0 + bne _08003FD6 + ldrb r0, [r5, 0x2] + movs r1, 0xF8 + adds r2, r1, 0 + ands r2, r0 + lsls r2, 7 + ldrb r3, [r5, 0x1] + adds r0, r1, 0 + ands r0, r3 + lsls r0, 2 + orrs r2, r0 + ldrb r0, [r5] +_08003FCA: + ands r1, r0 + lsrs r1, 3 + orrs r1, r2 + mov r0, sp + strh r1, [r0] + b _08004024 +_08003FD6: + movs r1, 0x80 + lsls r1, 1 + adds r0, r1, 0 + subs r0, r3 + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r5] + adds r2, r1, 0 + muls r2, r0 + ldrb r1, [r4] + muls r1, r3 + adds r6, r2, r1 + ldrb r1, [r5, 0x1] + adds r2, r1, 0 + muls r2, r0 + ldrb r1, [r4, 0x1] + muls r1, r3 + adds r2, r1 + ldrb r1, [r5, 0x2] + muls r1, r0 + ldrb r0, [r4, 0x2] + muls r0, r3 + adds r0, r1, r0 + asrs r0, 8 + movs r3, 0xF8 + ands r0, r3 + lsls r1, r0, 7 + adds r0, r2, 0 + asrs r0, 8 + ands r0, r3 + lsls r2, r0, 2 + orrs r2, r1 + adds r0, r6, 0 + asrs r0, 8 + ands r0, r3 + lsrs r0, 3 + orrs r2, r0 + mov r0, sp + strh r2, [r0] +_08004024: + adds r0, r7, 0 + mov r1, sp + bl SetBGPaletteBufferColor + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8003F60 + + thumb_func_start sub_8004034 +sub_8004034: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + ldr r2, _0800409C + adds r1, r2 + ldrh r2, [r1, 0x2] + mov r8, r2 + ldr r5, [r1, 0x8] + lsls r0, 20 + lsrs r0, 16 + mov r10, r0 + lsls r1, r0, 2 + ldr r0, _080040A0 + adds r4, r1, r0 + cmp r2, 0xFF + bls _080040A4 + movs r7, 0 + movs r5, 0xF8 +_08004068: + ldrb r0, [r4, 0x2] + adds r1, r5, 0 + ands r1, r0 + lsls r1, 7 + ldrb r2, [r4, 0x1] + adds r0, r5, 0 + ands r0, r2 + lsls r0, 2 + orrs r1, r0 + ldrb r2, [r4] + adds r0, r5, 0 + ands r0, r2 + lsrs r0, 3 + orrs r0, r1 + mov r1, sp + strh r0, [r1] + mov r1, r10 + adds r0, r1, r7 + mov r1, sp + bl SetBGPaletteBufferColor + adds r4, 0x4 + adds r7, 0x1 + cmp r7, 0xF + ble _08004068 + b _0800415E + .align 2, 0 +_0800409C: .4byte gUnknown_3000C00 +_080040A0: .4byte gUnknown_3000400 +_080040A4: + mov r2, r8 + cmp r2, 0 + bne _080040E2 + movs r7, 0 + mov r6, sp + movs r4, 0xF8 +_080040B0: + ldrb r0, [r5, 0x2] + adds r1, r4, 0 + ands r1, r0 + lsls r1, 7 + ldrb r2, [r5, 0x1] + adds r0, r4, 0 + ands r0, r2 + lsls r0, 2 + orrs r1, r0 + ldrb r2, [r5] + adds r0, r4, 0 + ands r0, r2 + lsrs r0, 3 + orrs r0, r1 + strh r0, [r6] + mov r1, r10 + adds r0, r1, r7 + mov r1, sp + bl SetBGPaletteBufferColor + adds r5, 0x4 + adds r7, 0x1 + cmp r7, 0xF + ble _080040B0 + b _0800415E +_080040E2: + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + mov r1, r8 + subs r0, r1 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + movs r7, 0 + mov r2, sp + str r2, [sp, 0x4] +_080040F8: + ldrb r0, [r5] + mov r1, r9 + muls r1, r0 + ldrb r0, [r4] + mov r2, r8 + muls r2, r0 + adds r0, r2, 0 + adds r1, r0 + mov r12, r1 + ldrb r0, [r5, 0x1] + mov r1, r9 + muls r1, r0 + ldrb r0, [r4, 0x1] + mov r2, r8 + muls r2, r0 + adds r0, r2, 0 + adds r6, r1, r0 + ldrb r0, [r5, 0x2] + mov r1, r9 + muls r1, r0 + ldrb r0, [r4, 0x2] + mov r2, r8 + muls r2, r0 + adds r0, r2, 0 + adds r0, r1, r0 + asrs r0, 8 + movs r3, 0xF8 + ands r0, r3 + lsls r2, r0, 7 + adds r0, r6, 0 + asrs r0, 8 + ands r0, r3 + lsls r1, r0, 2 + orrs r1, r2 + mov r0, r12 + asrs r0, 8 + ands r0, r3 + lsrs r0, 3 + orrs r1, r0 + ldr r0, [sp, 0x4] + strh r1, [r0] + mov r1, r10 + adds r0, r1, r7 + mov r1, sp + bl SetBGPaletteBufferColor + adds r4, 0x4 + adds r5, 0x4 + adds r7, 0x1 + cmp r7, 0xF + ble _080040F8 +_0800415E: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8004034 + + thumb_func_start sub_8004170 +sub_8004170: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + ldr r0, _080041C4 + adds r1, r0 + ldrh r2, [r1, 0x2] + adds r4, r2, 0 + ldr r0, [r1, 0x4] + str r0, [sp] + mov r0, r9 + lsls r1, r0, 2 + ldr r0, _080041C8 + adds r6, r1, r0 + cmp r2, 0xFF + bls _080041CC + ldrb r0, [r6, 0x2] + movs r1, 0xF8 + adds r2, r1, 0 + ands r2, r0 + lsls r2, 7 + ldrb r3, [r6, 0x1] + adds r0, r1, 0 + ands r0, r3 + lsls r0, 2 + orrs r2, r0 + ldrb r0, [r6] + ands r1, r0 + lsrs r1, 3 + orrs r1, r2 + add r0, sp, 0x4 + strh r1, [r0] + b _0800424C + .align 2, 0 +_080041C4: .4byte gUnknown_3000C00 +_080041C8: .4byte gUnknown_3000400 +_080041CC: + mov r0, sp + ldrb r1, [r0] + movs r3, 0xFF + subs r0, r3, r1 + muls r0, r2 + cmp r0, 0 + bge _080041DC + adds r0, 0xFF +_080041DC: + asrs r0, 8 + adds r0, r1, r0 + lsls r0, 16 + lsrs r0, 16 + mov r8, r0 + mov r0, sp + ldrb r1, [r0, 0x1] + subs r0, r3, r1 + muls r0, r2 + cmp r0, 0 + bge _080041F4 + adds r0, 0xFF +_080041F4: + asrs r0, 8 + adds r0, r1, r0 + lsls r0, 16 + lsrs r7, r0, 16 + mov r0, sp + ldrb r1, [r0, 0x2] + subs r0, r3, r1 + muls r0, r4 + cmp r0, 0 + bge _0800420A + adds r0, 0xFF +_0800420A: + asrs r0, 8 + adds r0, r1, r0 + lsls r0, 16 + lsrs r0, 16 + ldrb r1, [r6, 0x2] + muls r0, r1 + movs r1, 0xFF + bl __divsi3 + adds r4, r0, 0 + movs r5, 0xF8 + ands r4, r5 + lsls r4, 7 + ldrb r0, [r6, 0x1] + muls r0, r7 + movs r1, 0xFF + bl __divsi3 + ands r0, r5 + lsls r0, 2 + orrs r4, r0 + ldrb r0, [r6] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + movs r1, 0xFF + bl __divsi3 + ands r0, r5 + lsrs r0, 3 + orrs r4, r0 + add r0, sp, 0x4 + strh r4, [r0] +_0800424C: + adds r1, r0, 0 + mov r0, r9 + bl SetBGPaletteBufferColor + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8004170 + + thumb_func_start sub_8004264 +sub_8004264: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + ldr r2, _080042CC + adds r1, r2 + ldrh r2, [r1, 0x2] + ldr r1, [r1, 0x4] + str r1, [sp] + lsls r0, 20 + lsrs r0, 16 + mov r9, r0 + lsls r1, r0, 2 + ldr r0, _080042D0 + adds r5, r1, r0 + cmp r2, 0xFF + bls _080042D4 + movs r6, 0 + movs r7, 0xF8 + add r4, sp, 0x4 +_0800429A: + ldrb r0, [r5, 0x2] + adds r1, r7, 0 + ands r1, r0 + lsls r1, 7 + ldrb r2, [r5, 0x1] + adds r0, r7, 0 + ands r0, r2 + lsls r0, 2 + orrs r1, r0 + ldrb r2, [r5] + adds r0, r7, 0 + ands r0, r2 + lsrs r0, 3 + orrs r0, r1 + strh r0, [r4] + mov r1, r9 + adds r0, r1, r6 + adds r1, r4, 0 + bl SetBGPaletteBufferColor + adds r5, 0x4 + adds r6, 0x1 + cmp r6, 0xF + ble _0800429A + b _08004378 + .align 2, 0 +_080042CC: .4byte gUnknown_3000C00 +_080042D0: .4byte gUnknown_3000400 +_080042D4: + mov r0, sp + ldrb r1, [r0] + movs r3, 0xFF + subs r0, r3, r1 + muls r0, r2 + cmp r0, 0 + bge _080042E4 + adds r0, 0xFF +_080042E4: + asrs r0, 8 + adds r0, r1, r0 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x8] + mov r0, sp + ldrb r1, [r0, 0x1] + subs r0, r3, r1 + muls r0, r2 + cmp r0, 0 + bge _080042FC + adds r0, 0xFF +_080042FC: + asrs r0, 8 + adds r0, r1, r0 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0xC] + mov r0, sp + ldrb r1, [r0, 0x2] + subs r0, r3, r1 + muls r0, r2 + cmp r0, 0 + bge _08004314 + adds r0, 0xFF +_08004314: + asrs r0, 8 + adds r0, r1, r0 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + movs r6, 0 + add r7, sp, 0x4 + movs r0, 0xF8 + mov r8, r0 +_08004326: + ldrb r0, [r5, 0x2] + mov r1, r10 + muls r1, r0 + adds r0, r1, 0 + movs r1, 0xFF + bl __divsi3 + adds r4, r0, 0 + mov r0, r8 + ands r4, r0 + lsls r4, 7 + ldrb r0, [r5, 0x1] + ldr r1, [sp, 0xC] + muls r0, r1 + movs r1, 0xFF + bl __divsi3 + mov r1, r8 + ands r0, r1 + lsls r0, 2 + orrs r4, r0 + ldrb r0, [r5] + ldr r1, [sp, 0x8] + muls r0, r1 + movs r1, 0xFF + bl __divsi3 + mov r1, r8 + ands r0, r1 + lsrs r0, 3 + orrs r4, r0 + strh r4, [r7] + mov r1, r9 + adds r0, r1, r6 + adds r1, r7, 0 + bl SetBGPaletteBufferColor + adds r5, 0x4 + adds r6, 0x1 + cmp r6, 0xF + ble _08004326 +_08004378: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8004264 + + thumb_func_start sub_8004388 +sub_8004388: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + ldr r0, _0800442C + adds r1, r0 + ldrh r2, [r1, 0x2] + ldr r0, [r1, 0x4] + str r0, [sp] + mov r0, r9 + lsls r1, r0, 2 + ldr r0, _08004430 + adds r6, r1, r0 + cmp r2, 0xFF + bls _080043BC + movs r2, 0x80 + lsls r2, 1 +_080043BC: + mov r0, sp + ldrb r0, [r0] + muls r0, r2 + lsls r0, 8 + lsrs r0, 16 + mov r8, r0 + mov r0, sp + ldrb r0, [r0, 0x1] + muls r0, r2 + lsls r0, 8 + lsrs r7, r0, 16 + mov r0, sp + ldrb r0, [r0, 0x2] + muls r0, r2 + lsls r0, 8 + lsrs r0, 16 + ldrb r1, [r6, 0x2] + muls r0, r1 + movs r1, 0xFF + bl __divsi3 + adds r4, r0, 0 + movs r5, 0xF8 + ands r4, r5 + lsls r4, 7 + ldrb r0, [r6, 0x1] + muls r0, r7 + movs r1, 0xFF + bl __divsi3 + ands r0, r5 + lsls r0, 2 + orrs r4, r0 + ldrb r0, [r6] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + movs r1, 0xFF + bl __divsi3 + ands r0, r5 + lsrs r0, 3 + orrs r4, r0 + add r1, sp, 0x4 + strh r4, [r1] + mov r0, r9 + bl SetBGPaletteBufferColor + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0800442C: .4byte gUnknown_3000C00 +_08004430: .4byte gUnknown_3000400 + thumb_func_end sub_8004388 + + thumb_func_start sub_8004434 +sub_8004434: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + lsls r0, 16 + lsrs r0, 16 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + ldr r2, _080044F8 + adds r1, r2 + ldrh r2, [r1, 0x2] + ldr r1, [r1, 0x4] + str r1, [sp] + lsls r0, 20 + lsrs r0, 16 + mov r9, r0 + lsls r1, r0, 2 + ldr r0, _080044FC + adds r5, r1, r0 + cmp r2, 0xFF + bls _08004468 + movs r2, 0x80 + lsls r2, 1 +_08004468: + mov r0, sp + ldrb r0, [r0] + muls r0, r2 + lsls r0, 8 + lsrs r0, 16 + str r0, [sp, 0x8] + mov r0, sp + ldrb r0, [r0, 0x1] + muls r0, r2 + lsls r0, 8 + lsrs r0, 16 + str r0, [sp, 0xC] + mov r0, sp + ldrb r0, [r0, 0x2] + muls r0, r2 + lsls r0, 8 + lsrs r0, 16 + mov r10, r0 + movs r6, 0 + movs r0, 0xF8 + mov r8, r0 + add r7, sp, 0x4 +_08004494: + ldrb r0, [r5, 0x2] + mov r1, r10 + muls r1, r0 + adds r0, r1, 0 + movs r1, 0xFF + bl __divsi3 + adds r4, r0, 0 + mov r0, r8 + ands r4, r0 + lsls r4, 7 + ldrb r0, [r5, 0x1] + ldr r1, [sp, 0xC] + muls r0, r1 + movs r1, 0xFF + bl __divsi3 + mov r1, r8 + ands r0, r1 + lsls r0, 2 + orrs r4, r0 + ldrb r0, [r5] + ldr r1, [sp, 0x8] + muls r0, r1 + movs r1, 0xFF + bl __divsi3 + mov r1, r8 + ands r0, r1 + lsrs r0, 3 + orrs r4, r0 + strh r4, [r7] + mov r1, r9 + adds r0, r1, r6 + adds r1, r7, 0 + bl SetBGPaletteBufferColor + adds r5, 0x4 + adds r6, 0x1 + cmp r6, 0xF + ble _08004494 + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080044F8: .4byte gUnknown_3000C00 +_080044FC: .4byte gUnknown_3000400 + thumb_func_end sub_8004434 + + thumb_func_start sub_8004500 +sub_8004500: + ldr r1, _08004514 + ldrh r2, [r1] + movs r0, 0x6D + muls r0, r2 + ldr r2, _08004518 + adds r0, r2 + strh r0, [r1] + ldrh r0, [r1] + bx lr + .align 2, 0 +_08004514: .4byte gUnknown_203B070 +_08004518: .4byte 0x000003fd + thumb_func_end sub_8004500 + + thumb_func_start sub_800451C +sub_800451C: + push {r4,lr} + adds r4, r0, 0 + bl sub_8004500 + muls r0, r4 + asrs r0, 16 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_800451C + + thumb_func_start sub_8004530 +sub_8004530: + push {r4,lr} + adds r4, r0, 0 + subs r0, r1, r4 + bl sub_800451C + adds r0, r4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8004530 + + thumb_func_start sub_8004544 +sub_8004544: + push {r4,r5,lr} + adds r3, r0, 0 + subs r4, r1, 0x1 + adds r2, r3, r4 + movs r5, 0 + cmp r5, r4 + bge _08004566 +_08004552: + ldrb r1, [r3] + ldrb r0, [r2] + strb r0, [r3] + adds r3, 0x1 + strb r1, [r2] + subs r2, 0x1 + adds r5, 0x1 + subs r4, 0x1 + cmp r5, r4 + blt _08004552 +_08004566: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8004544 + + thumb_func_start sub_800456C +sub_800456C: + push {r4-r7,lr} + adds r4, r1, 0 + cmp r4, 0 + ble _08004578 + movs r7, 0x1 + b _0800457E +_08004578: + negs r4, r4 + movs r7, 0x1 + negs r7, r7 +_0800457E: + cmp r2, 0 + ble _080045A0 + adds r6, r0, 0 + adds r5, r2, 0 +_08004586: + adds r0, r4, 0 + movs r1, 0xA + bl __modsi3 + stm r6!, {r0} + adds r0, r4, 0 + movs r1, 0xA + bl __divsi3 + adds r4, r0, 0 + subs r5, 0x1 + cmp r5, 0 + bne _08004586 +_080045A0: + adds r0, r7, 0 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_800456C + + thumb_func_start sub_80045A8 +sub_80045A8: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldm r4!, {r1} + movs r3, 0xA + cmp r2, 0x1 + ble _080045CA + subs r2, 0x1 +_080045B8: + ldm r4!, {r0} + muls r0, r3 + adds r1, r0 + subs r2, 0x1 + lsls r0, r3, 2 + adds r0, r3 + lsls r3, r0, 1 + cmp r2, 0 + bne _080045B8 +_080045CA: + adds r0, r1, 0 + cmp r5, 0 + bge _080045D2 + negs r0, r0 +_080045D2: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80045A8 + + thumb_func_start ConvertFromBCD +ConvertFromBCD: + push {r4,lr} + adds r1, r0, 0 + movs r2, 0x1 + movs r3, 0 + cmp r1, 0 + ble _080045FA + movs r4, 0xF +_080045E6: + adds r0, r1, 0 + ands r0, r4 + muls r0, r2 + adds r3, r0 + lsls r0, r2, 2 + adds r0, r2 + lsls r2, r0, 1 + asrs r1, 4 + cmp r1, 0 + bgt _080045E6 +_080045FA: + adds r0, r3, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end ConvertFromBCD + + thumb_func_start ConvertToBCD +ConvertToBCD: + push {r4-r6,lr} + adds r4, r0, 0 + movs r5, 0 + movs r6, 0 + cmp r4, 0 + ble _0800462C +_08004610: + adds r0, r4, 0 + movs r1, 0xA + bl __modsi3 + lsls r0, r5 + adds r6, r0 + adds r5, 0x4 + adds r0, r4, 0 + movs r1, 0xA + bl __divsi3 + adds r4, r0, 0 + cmp r4, 0 + bgt _08004610 +_0800462C: + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end ConvertToBCD + + thumb_func_start InitBGPaletteBuffer +InitBGPaletteBuffer: + push {lr} + movs r2, 0 + ldr r1, _0800465C + movs r0, 0x80 + lsls r0, 2 +_0800463E: + strh r2, [r1] + adds r1, 0x2 + subs r0, 0x1 + cmp r0, 0 + bne _0800463E + ldr r1, _08004660 + movs r2, 0x1 + adds r0, r1, 0 + adds r0, 0x1F +_08004650: + strb r2, [r0] + subs r0, 0x1 + cmp r0, r1 + bge _08004650 + pop {r0} + bx r0 + .align 2, 0 +_0800465C: .4byte gUnknown_20251F0 +_08004660: .4byte gUnknown_20251D0 + thumb_func_end InitBGPaletteBuffer + + thumb_func_start SetBGPaletteBufferColorRGB +SetBGPaletteBufferColorRGB: + push {r4-r7,lr} + adds r4, r0, 0 + adds r5, r1, 0 + cmp r2, 0 + bge _08004670 + movs r2, 0 +_08004670: + cmp r2, 0x1F + ble _08004676 + movs r2, 0x1F +_08004676: + ldr r1, _080046CC + adds r0, r4, 0 + cmp r4, 0 + bge _08004680 + adds r0, 0xF +_08004680: + asrs r0, 4 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + cmp r3, 0 + bne _080046D4 + ldr r0, _080046D0 + lsls r1, r4, 1 + adds r6, r1, r0 + ldrb r0, [r5, 0x2] + muls r0, r2 + cmp r0, 0 + bge _0800469C + adds r0, 0xFF +_0800469C: + asrs r0, 8 + movs r3, 0x1F + ands r0, r3 + lsls r4, r0, 10 + ldrb r0, [r5, 0x1] + muls r0, r2 + cmp r0, 0 + bge _080046AE + adds r0, 0xFF +_080046AE: + asrs r0, 8 + ands r0, r3 + lsls r1, r0, 5 + orrs r1, r4 + ldrb r0, [r5] + muls r0, r2 + cmp r0, 0 + bge _080046C0 + adds r0, 0xFF +_080046C0: + asrs r0, 8 + ands r0, r3 + orrs r1, r0 + strh r1, [r6] + b _08004722 + .align 2, 0 +_080046CC: .4byte gUnknown_20251D0 +_080046D0: .4byte gUnknown_20251F0 +_080046D4: + ldr r1, _08004728 + lsls r0, r4, 1 + adds r7, r0, r1 + ldrb r0, [r5, 0x2] + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x2] + muls r0, r2 + cmp r0, 0 + bge _080046EA + adds r0, 0xFF +_080046EA: + asrs r0, 8 + movs r4, 0x1F + ands r0, r4 + lsls r6, r0, 10 + ldrb r0, [r5, 0x1] + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0, 0x1] + muls r0, r2 + cmp r0, 0 + bge _08004702 + adds r0, 0xFF +_08004702: + asrs r0, 8 + ands r0, r4 + lsls r1, r0, 5 + orrs r1, r6 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r3 + ldrb r0, [r0] + muls r0, r2 + cmp r0, 0 + bge _0800471A + adds r0, 0xFF +_0800471A: + asrs r0, 8 + ands r0, r4 + orrs r1, r0 + strh r1, [r7] +_08004722: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08004728: .4byte gUnknown_20251F0 + thumb_func_end SetBGPaletteBufferColorRGB + + thumb_func_start SetBGPaletteBufferColorArray +SetBGPaletteBufferColorArray: + push {lr} + adds r2, r0, 0 + adds r3, r1, 0 + ldr r1, _08004764 + cmp r2, 0 + bge _0800473A + adds r0, 0xF +_0800473A: + asrs r0, 4 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + ldr r0, _08004768 + lsls r2, 1 + adds r2, r0 + ldrb r1, [r3, 0x2] + lsrs r1, 3 + lsls r1, 10 + ldrb r0, [r3, 0x1] + lsrs r0, 3 + lsls r0, 5 + orrs r1, r0 + ldrb r0, [r3] + lsrs r0, 3 + orrs r0, r1 + strh r0, [r2] + pop {r0} + bx r0 + .align 2, 0 +_08004764: .4byte gUnknown_20251D0 +_08004768: .4byte gUnknown_20251F0 + thumb_func_end SetBGPaletteBufferColorArray + + thumb_func_start SetBGPaletteBufferColor +SetBGPaletteBufferColor: + push {lr} + adds r2, r0, 0 + adds r3, r1, 0 + ldr r1, _08004790 + cmp r2, 0 + bge _0800477A + adds r0, 0xF +_0800477A: + asrs r0, 4 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + ldr r1, _08004794 + lsls r0, r2, 1 + adds r0, r1 + ldrh r1, [r3] + strh r1, [r0] + pop {r0} + bx r0 + .align 2, 0 +_08004790: .4byte gUnknown_20251D0 +_08004794: .4byte gUnknown_20251F0 + thumb_func_end SetBGPaletteBufferColor + + thumb_func_start nullsub_4 +nullsub_4: + bx lr + thumb_func_end nullsub_4 + + thumb_func_start nullsub_5 +nullsub_5: + bx lr + thumb_func_end nullsub_5 + + thumb_func_start nullsub_143 +nullsub_143: + bx lr + thumb_func_end nullsub_143 + + thumb_func_start TransferBGPaletteBuffer +TransferBGPaletteBuffer: + push {r4-r6,lr} + movs r6, 0 + movs r4, 0 + movs r5, 0xA0 + lsls r5, 19 +_080047AE: + ldr r0, _080047DC + adds r1, r6, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _080047CA + movs r0, 0 + strb r0, [r1] + lsls r1, r4, 1 + ldr r0, _080047E0 + adds r1, r0 + adds r0, r5, 0 + movs r2, 0x20 + bl CpuCopy +_080047CA: + adds r6, 0x1 + adds r5, 0x20 + adds r4, 0x10 + ldr r0, _080047E4 + cmp r4, r0 + ble _080047AE + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080047DC: .4byte gUnknown_20251D0 +_080047E0: .4byte gUnknown_20251F0 +_080047E4: .4byte 0x000001ff + thumb_func_end TransferBGPaletteBuffer + + thumb_func_start sub_80047E8 +sub_80047E8: + ldr r0, _08004840 + movs r3, 0 + movs r2, 0 + strh r2, [r0] + strh r2, [r0, 0x2] + strh r2, [r0, 0x4] + strh r2, [r0, 0x6] + ldr r0, _08004844 + strh r2, [r0] + strh r2, [r0, 0x2] + strh r2, [r0, 0x4] + strh r2, [r0, 0x6] + ldr r1, _08004848 + ldr r0, _0800484C + str r0, [r1] + ldr r0, _08004850 + str r2, [r0, 0x20] + ldr r1, _08004854 + strh r1, [r0] + movs r1, 0x1 + negs r1, r1 + strh r1, [r0, 0x2] + strh r1, [r0, 0x4] + strh r1, [r0, 0x6] + strh r1, [r0, 0x1C] + strh r1, [r0, 0x1E] + strh r1, [r0, 0x8] + strh r1, [r0, 0xA] + strh r1, [r0, 0xC] + strh r1, [r0, 0xE] + strh r1, [r0, 0x10] + strh r1, [r0, 0x12] + strh r1, [r0, 0x14] + strh r1, [r0, 0x16] + adds r1, r0, 0 + adds r1, 0x28 + strb r3, [r1] + adds r0, 0x29 + strb r3, [r0] + ldr r0, _08004858 + strh r2, [r0] + strh r2, [r0, 0x2] + bx lr + .align 2, 0 +_08004840: .4byte gUnknown_20255F0 +_08004844: .4byte gUnknown_2025638 +_08004848: .4byte gUnknown_202562C +_0800484C: .4byte 0x004a14c1 +_08004850: .4byte gUnknown_2025600 +_08004854: .4byte 0x0000ffff +_08004858: .4byte gUnknown_2025668 + thumb_func_end sub_80047E8 + + thumb_func_start sub_800485C +sub_800485C: + push {r4,r5,lr} + ldr r2, _080048A8 + ldr r1, _080048AC + adds r0, r2, 0 + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldr r0, [r0] + str r0, [r1] + movs r3, 0 + movs r0, 0 + strh r0, [r2] + strh r0, [r2, 0x2] + strh r0, [r2, 0x4] + strh r0, [r2, 0x6] + ldr r0, _080048B0 + ldr r1, _080048B4 + strh r1, [r0] + movs r1, 0x1 + negs r1, r1 + strh r1, [r0, 0x2] + strh r1, [r0, 0x4] + strh r1, [r0, 0x6] + strh r1, [r0, 0x8] + strh r1, [r0, 0xA] + strh r1, [r0, 0xC] + strh r1, [r0, 0xE] + strh r1, [r0, 0x10] + strh r1, [r0, 0x12] + strh r1, [r0, 0x14] + strh r1, [r0, 0x16] + adds r1, r0, 0 + adds r1, 0x28 + strb r3, [r1] + adds r0, 0x29 + strb r3, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080048A8: .4byte gUnknown_2025638 +_080048AC: .4byte gUnknown_20255F0 +_080048B0: .4byte gUnknown_2025600 +_080048B4: .4byte 0x0000ffff + thumb_func_end sub_800485C + + thumb_func_start sub_80048B8 +sub_80048B8: + movs r0, 0 + bx lr + thumb_func_end sub_80048B8 + + thumb_func_start sub_80048BC +sub_80048BC: + movs r0, 0 + bx lr + thumb_func_end sub_80048BC + + thumb_func_start sub_80048C0 +sub_80048C0: + movs r0, 0 + bx lr + thumb_func_end sub_80048C0 + + thumb_func_start sub_80048C4 +sub_80048C4: + movs r0, 0 + bx lr + thumb_func_end sub_80048C4 + + thumb_func_start sub_80048C8 +sub_80048C8: + movs r0, 0 + bx lr + thumb_func_end sub_80048C8 + + thumb_func_start sub_80048CC +sub_80048CC: + movs r0, 0 + bx lr + thumb_func_end sub_80048CC + + thumb_func_start sub_80048D0 +sub_80048D0: + ldr r1, _080048E8 + movs r0, 0 + strh r0, [r1, 0x4] + ldr r1, _080048EC + str r0, [r1, 0xC] + strh r0, [r1, 0x8] + ldr r1, _080048F0 + ldr r0, _080048F4 + strh r0, [r1] + strh r0, [r1, 0x2] + bx lr + .align 2, 0 +_080048E8: .4byte gUnknown_20255F0 +_080048EC: .4byte gUnknown_2025648 +_080048F0: .4byte gUnknown_2025668 +_080048F4: .4byte 0x000003e7 + thumb_func_end sub_80048D0 + + thumb_func_start sub_80048F8 +sub_80048F8: + ldr r0, _08004908 + movs r1, 0 + strh r1, [r0, 0x2] + ldr r0, _0800490C + strh r1, [r0, 0x2] + ldr r0, _08004910 + strh r1, [r0, 0x2] + bx lr + .align 2, 0 +_08004908: .4byte gUnknown_20255F0 +_0800490C: .4byte gUnknown_2025638 +_08004910: .4byte gUnknown_2025648 + thumb_func_end sub_80048F8 + + thumb_func_start sub_8004914 +sub_8004914: + ldr r0, _0800494C + movs r1, 0x5 + str r1, [r0, 0x20] + movs r2, 0 + movs r1, 0 + strh r1, [r0, 0x24] + ldr r1, _08004950 + strh r1, [r0] + movs r1, 0x1 + negs r1, r1 + strh r1, [r0, 0x2] + strh r1, [r0, 0x4] + strh r1, [r0, 0x6] + strh r1, [r0, 0x8] + strh r1, [r0, 0xA] + strh r1, [r0, 0xC] + strh r1, [r0, 0xE] + strh r1, [r0, 0x10] + strh r1, [r0, 0x12] + strh r1, [r0, 0x14] + strh r1, [r0, 0x16] + adds r1, r0, 0 + adds r1, 0x28 + strb r2, [r1] + adds r0, 0x29 + strb r2, [r0] + bx lr + .align 2, 0 +_0800494C: .4byte gUnknown_2025600 +_08004950: .4byte 0x0000ffff + thumb_func_end sub_8004914 + + thumb_func_start UpdateInput +UpdateInput: + push {r4-r6,lr} + ldr r4, _08004998 + ldr r5, _0800499C + adds r1, r4, 0 + adds r0, r5, 0 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldr r0, [r0] + str r0, [r1] + adds r0, r5, 0 + bl ReadKeyInput + ldrh r0, [r4] + ldrh r3, [r5] + eors r0, r3 + ands r0, r3 + strh r0, [r5, 0x2] + lsls r0, r3, 16 + lsrs r0, 16 + cmp r0, 0 + beq _080049A8 + ldrh r1, [r5, 0x8] + movs r0, 0xF0 + adds r2, r0, 0 + ands r2, r3 + ands r0, r1 + cmp r0, r2 + bne _080049A0 + ldr r0, [r5, 0xC] + cmp r0, 0x31 + bgt _080049AC + adds r0, 0x1 + str r0, [r5, 0xC] + b _080049AC + .align 2, 0 +_08004998: .4byte gUnknown_2025658 +_0800499C: .4byte gUnknown_2025648 +_080049A0: + strh r2, [r5, 0x8] + movs r0, 0x1 + str r0, [r5, 0xC] + b _080049AC +_080049A8: + str r0, [r5, 0xC] + strh r0, [r5, 0x8] +_080049AC: + ldr r0, _080049C4 + ldr r2, [r0, 0xC] + adds r3, r0, 0 + cmp r2, 0x1 + bne _080049C8 + ldrh r0, [r3, 0x8] + movs r1, 0xF0 + ands r1, r0 + ldrh r0, [r3, 0x2] + orrs r1, r0 + strh r1, [r3, 0x4] + b _080049E0 + .align 2, 0 +_080049C4: .4byte gUnknown_2025648 +_080049C8: + cmp r2, 0x30 + bne _080049DC + movs r0, 0x2B + str r0, [r3, 0xC] + ldrh r1, [r3, 0x8] + movs r0, 0xF0 + ands r0, r1 + ldrh r1, [r3, 0x2] + orrs r0, r1 + b _080049DE +_080049DC: + movs r0, 0 +_080049DE: + strh r0, [r3, 0x4] +_080049E0: + movs r0, 0 + strh r0, [r3, 0x6] + ldrh r1, [r3] + movs r5, 0x2 + adds r0, r5, 0 + ands r0, r1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0 + beq _08004A0C + ldr r0, _08004A08 + ldrh r2, [r0] + movs r4, 0 + ldrsh r1, [r0, r4] + adds r4, r0, 0 + cmp r1, 0x63 + bgt _08004A20 + adds r0, r2, 0x1 + strh r0, [r4] + b _08004A20 + .align 2, 0 +_08004A08: .4byte gUnknown_2025668 +_08004A0C: + ldr r1, _08004A44 + ldrh r0, [r1] + subs r0, 0x2 + lsls r0, 16 + lsrs r0, 16 + adds r4, r1, 0 + cmp r0, 0x9 + bhi _08004A1E + strh r5, [r3, 0x6] +_08004A1E: + strh r2, [r4] +_08004A20: + ldrh r1, [r3] + movs r5, 0x80 + lsls r5, 1 + adds r0, r5, 0 + ands r0, r1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0 + beq _08004A48 + ldrh r1, [r4, 0x2] + movs r6, 0x2 + ldrsh r0, [r4, r6] + cmp r0, 0x63 + bgt _08004A5E + adds r0, r1, 0x1 + strh r0, [r4, 0x2] + b _08004A5E + .align 2, 0 +_08004A44: .4byte gUnknown_2025668 +_08004A48: + ldrh r0, [r4, 0x2] + subs r0, 0x2 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x9 + bhi _08004A5C + ldrh r1, [r3, 0x6] + adds r0, r5, 0 + orrs r0, r1 + strh r0, [r3, 0x6] +_08004A5C: + strh r2, [r4, 0x2] +_08004A5E: + ldr r2, _08004A94 + ldrh r0, [r2] + ldrh r1, [r3] + orrs r0, r1 + strh r0, [r2] + ldrh r0, [r2, 0x2] + ldrh r1, [r3, 0x2] + orrs r0, r1 + strh r0, [r2, 0x2] + ldrh r0, [r2, 0x4] + ldrh r1, [r3, 0x4] + orrs r0, r1 + strh r0, [r2, 0x4] + ldrh r0, [r2, 0x6] + ldrh r1, [r3, 0x6] + orrs r0, r1 + strh r0, [r2, 0x6] + ldr r2, _08004A98 + ldrh r0, [r3] + ldr r1, _08004A9C + orrs r0, r1 + ldr r1, [r2] + muls r0, r1 + str r0, [r2] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08004A94: .4byte gUnknown_2025638 +_08004A98: .4byte gUnknown_202562C +_08004A9C: .4byte 0x054a1c41 + thumb_func_end UpdateInput + + thumb_func_start nullsub_6 +nullsub_6: + bx lr + thumb_func_end nullsub_6 + + thumb_func_start sub_8004AA4 +sub_8004AA4: + push {r4,r5,lr} + adds r3, r0, 0 + ldr r4, [r1, 0x4] + cmp r2, 0 + ble _08004AE8 +_08004AAE: + ldm r4!, {r1} + movs r5, 0 + ldrsh r0, [r1, r5] + cmp r0, 0 + beq _08004ADE + movs r0, 0x80 + lsls r0, 24 + str r0, [r3] + ldrh r0, [r1, 0x2] + strh r0, [r3, 0x6] + ldrh r0, [r1, 0x2] + strh r0, [r3, 0x4] + adds r0, r1, 0x4 + str r0, [r3, 0x8] + str r0, [r3, 0xC] + movs r5, 0 + ldrsh r0, [r1, r5] + lsls r0, 2 + adds r0, 0x4 + adds r0, r1, r0 + str r0, [r3, 0x10] + ldr r0, [r1, 0x4] + str r0, [r3, 0x14] + b _08004AE0 +_08004ADE: + str r0, [r3] +_08004AE0: + adds r3, 0x18 + subs r2, 0x1 + cmp r2, 0 + bne _08004AAE +_08004AE8: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8004AA4 + + thumb_func_start sub_8004AF0 +sub_8004AF0: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r1, 0 + adds r6, r2, 0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r7, 0 + cmp r7, r3 + bge _08004B6A + adds r5, r3, 0 +_08004B08: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8004D14 + lsls r0, 24 + cmp r0, 0 + beq _08004B60 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8004D40 + lsls r0, 24 + cmp r0, 0 + bne _08004B60 + mov r1, r8 + ldrh r0, [r4, 0x6] + subs r0, 0x1 + strh r0, [r4, 0x6] + lsls r0, 16 + cmp r0, 0 + bgt _08004B4E + ldrh r0, [r4, 0x4] + strh r0, [r4, 0x6] + ldr r1, [r4, 0xC] + ldr r0, [r4, 0x10] + cmp r1, r0 + bcc _08004B42 + ldr r0, [r4, 0x8] + str r0, [r4, 0xC] +_08004B42: + ldr r1, [r4, 0xC] + ldm r1!, {r0} + str r0, [r4, 0x14] + str r1, [r4, 0xC] + movs r1, 0x1 + movs r7, 0x1 +_08004B4E: + cmp r1, 0 + beq _08004B60 + adds r1, r4, 0 + adds r1, 0x14 + adds r0, r6, 0 + ldr r2, [sp, 0x18] + ldr r3, [sp, 0x1C] + bl SetBGPaletteBufferColorRGB +_08004B60: + subs r5, 0x1 + adds r4, 0x18 + adds r6, 0x1 + cmp r5, 0 + bne _08004B08 +_08004B6A: + adds r0, r7, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8004AF0 + + thumb_func_start sub_8004B78 +sub_8004B78: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r1, 0 + adds r6, r2, 0 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r7, 0 + cmp r7, r3 + bge _08004BF2 + adds r5, r3, 0 +_08004B90: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8004D14 + lsls r0, 24 + cmp r0, 0 + beq _08004BE8 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8004D40 + lsls r0, 24 + cmp r0, 0 + bne _08004BE8 + mov r1, r8 + ldrh r0, [r4, 0x6] + subs r0, 0x1 + strh r0, [r4, 0x6] + lsls r0, 16 + cmp r0, 0 + bgt _08004BD6 + ldrh r0, [r4, 0x4] + strh r0, [r4, 0x6] + ldr r1, [r4, 0xC] + ldr r0, [r4, 0x10] + cmp r1, r0 + bcc _08004BCA + ldr r0, [r4, 0x8] + str r0, [r4, 0xC] +_08004BCA: + ldr r1, [r4, 0xC] + ldm r1!, {r0} + str r0, [r4, 0x14] + str r1, [r4, 0xC] + movs r1, 0x1 + movs r7, 0x1 +_08004BD6: + cmp r1, 0 + beq _08004BE8 + adds r1, r4, 0 + adds r1, 0x14 + adds r0, r6, 0 + ldr r2, [sp, 0x18] + ldr r3, [sp, 0x1C] + bl nullsub_4 +_08004BE8: + subs r5, 0x1 + adds r4, 0x18 + adds r6, 0x1 + cmp r5, 0 + bne _08004B90 +_08004BF2: + adds r0, r7, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8004B78 + + thumb_func_start sub_8004C00 +sub_8004C00: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r4, r0, 0 + adds r7, r1, 0 + mov r10, r3 + ldr r0, [sp, 0x28] + mov r8, r0 + movs r1, 0 + mov r9, r1 + cmp r9, r2 + bge _08004CDC + adds r6, r2, 0 +_08004C20: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8004D14 + lsls r0, 24 + cmp r0, 0 + beq _08004CD2 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8004D40 + lsls r0, 24 + cmp r0, 0 + bne _08004CD2 + ldrh r0, [r4, 0x6] + subs r0, 0x1 + strh r0, [r4, 0x6] + lsls r0, 16 + cmp r0, 0 + bgt _08004C64 + ldrh r0, [r4, 0x4] + strh r0, [r4, 0x6] + ldr r1, [r4, 0xC] + ldr r0, [r4, 0x10] + cmp r1, r0 + bcc _08004C58 + ldr r0, [r4, 0x8] + str r0, [r4, 0xC] +_08004C58: + ldr r1, [r4, 0xC] + ldm r1!, {r0} + str r0, [r4, 0x14] + str r1, [r4, 0xC] + movs r2, 0x1 + mov r9, r2 +_08004C64: + mov r3, r8 + movs r5, 0 + ldrsh r0, [r3, r5] + ldrb r2, [r4, 0x14] + adds r1, r0, r2 + movs r5, 0x2 + ldrsh r0, [r3, r5] + ldrb r2, [r4, 0x15] + adds r3, r0, r2 + mov r5, r8 + movs r2, 0x4 + ldrsh r0, [r5, r2] + ldrb r2, [r4, 0x16] + adds r5, r0, r2 + cmp r1, 0xFF + ble _08004C86 + movs r1, 0xFF +_08004C86: + cmp r3, 0xFF + ble _08004C8C + movs r3, 0xFF +_08004C8C: + cmp r5, 0xFF + ble _08004C92 + movs r5, 0xFF +_08004C92: + cmp r1, 0 + bge _08004C98 + movs r1, 0 +_08004C98: + cmp r3, 0 + bge _08004C9E + movs r3, 0 +_08004C9E: + cmp r5, 0 + bge _08004CA4 + movs r5, 0 +_08004CA4: + lsls r1, 24 + lsrs r1, 24 + ldr r2, _08004CF0 + ldr r0, [sp] + ands r0, r2 + orrs r0, r1 + lsls r2, r3, 24 + lsrs r2, 16 + ldr r1, _08004CF4 + ands r0, r1 + orrs r0, r2 + lsls r2, r5, 24 + lsrs r2, 8 + ldr r1, _08004CF8 + ands r0, r1 + orrs r0, r2 + str r0, [sp] + adds r0, r7, 0 + mov r1, sp + mov r2, r10 + ldr r3, [sp, 0x24] + bl SetBGPaletteBufferColorRGB +_08004CD2: + subs r6, 0x1 + adds r4, 0x18 + adds r7, 0x1 + cmp r6, 0 + bne _08004C20 +_08004CDC: + mov r0, r9 + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08004CF0: .4byte 0xffffff00 +_08004CF4: .4byte 0xffff00ff +_08004CF8: .4byte 0xff00ffff + thumb_func_end sub_8004C00 + + thumb_func_start sub_8004CFC +sub_8004CFC: + push {lr} + cmp r1, 0 + ble _08004D0E + movs r2, 0 +_08004D04: + str r2, [r0] + adds r0, 0x18 + subs r1, 0x1 + cmp r1, 0 + bne _08004D04 +_08004D0E: + pop {r0} + bx r0 + thumb_func_end sub_8004CFC + + thumb_func_start sub_8004D14 +sub_8004D14: + push {r4,lr} + adds r2, r0, 0 + movs r3, 0 + cmp r3, r1 + bge _08004D36 + movs r4, 0x80 + lsls r4, 24 +_08004D22: + ldr r0, [r2] + ands r0, r4 + cmp r0, 0 + beq _08004D2E + movs r0, 0x1 + b _08004D38 +_08004D2E: + adds r2, 0x18 + adds r3, 0x1 + cmp r3, r1 + blt _08004D22 +_08004D36: + movs r0, 0 +_08004D38: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8004D14 + + thumb_func_start sub_8004D40 +sub_8004D40: + push {r4-r6,lr} + adds r3, r0, 0 + adds r4, r1, 0 + movs r1, 0 + cmp r1, r4 + bge _08004D70 + movs r6, 0x80 + lsls r6, 24 + movs r5, 0x80 + lsls r5, 22 +_08004D54: + ldr r2, [r3] + adds r0, r2, 0 + ands r0, r6 + cmp r0, 0 + beq _08004D6A + ands r2, r5 + cmp r2, 0 + bne _08004D68 + movs r0, 0 + b _08004D72 +_08004D68: + adds r3, 0x18 +_08004D6A: + adds r1, 0x1 + cmp r1, r4 + blt _08004D54 +_08004D70: + movs r0, 0x1 +_08004D72: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8004D40 + + thumb_func_start sub_8004D78 +sub_8004D78: + push {lr} + movs r0, 0x1 + bl sub_8004D8C + movs r0, 0 + bl SetSavingIconCoords + pop {r0} + bx r0 + thumb_func_end sub_8004D78 + + thumb_func_start sub_8004D8C +sub_8004D8C: + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r1, _08004E68 + movs r0, 0 + str r0, [r1] + ldr r1, _08004E6C + ldr r0, _08004E70 + str r0, [r1] + ldr r1, _08004E74 + ldr r0, _08004E78 + str r0, [r1] + ldr r0, _08004E7C + adds r1, r0, 0 + adds r1, 0x8 + adds r5, r0, 0 + movs r2, 0 + movs r3, 0xF0 +_08004DB0: + str r1, [r0] + str r2, [r0, 0x4] + adds r0, 0x8 + adds r1, 0x8 + str r1, [r0] + str r2, [r0, 0x4] + adds r0, 0x8 + adds r1, 0x8 + str r1, [r0] + str r2, [r0, 0x4] + adds r0, 0x8 + adds r1, 0x8 + str r1, [r0] + str r2, [r0, 0x4] + adds r0, 0x8 + adds r1, 0x8 + str r1, [r0] + str r2, [r0, 0x4] + adds r0, 0x8 + adds r1, 0x8 + str r1, [r0] + str r2, [r0, 0x4] + adds r0, 0x8 + adds r1, 0x8 + str r1, [r0] + str r2, [r0, 0x4] + adds r0, 0x8 + adds r1, 0x8 + str r1, [r0] + str r2, [r0, 0x4] + adds r0, 0x8 + adds r1, 0x8 + str r1, [r0] + str r2, [r0, 0x4] + adds r0, 0x8 + adds r1, 0x8 + str r1, [r0] + str r2, [r0, 0x4] + adds r0, 0x8 + adds r1, 0x8 + str r1, [r0] + str r2, [r0, 0x4] + adds r0, 0x8 + adds r1, 0x8 + str r1, [r0] + str r2, [r0, 0x4] + adds r0, 0x8 + adds r1, 0x8 + str r1, [r0] + str r2, [r0, 0x4] + adds r0, 0x8 + adds r1, 0x8 + str r1, [r0] + str r2, [r0, 0x4] + adds r0, 0x8 + adds r1, 0x8 + str r1, [r0] + str r2, [r0, 0x4] + adds r0, 0x8 + adds r1, 0x8 + str r1, [r0] + str r2, [r0, 0x4] + adds r0, 0x8 + adds r1, 0x8 + subs r3, 0x10 + cmp r3, 0 + bge _08004DB0 + cmp r4, 0 + beq _08004E50 + movs r2, 0 + ldr r1, _08004E80 + ldr r0, _08004E84 + movs r3, 0x7F +_08004E42: + str r2, [r0] + str r1, [r0, 0x4] + adds r1, 0x8 + adds r0, 0x8 + subs r3, 0x1 + cmp r3, 0 + bge _08004E42 +_08004E50: + movs r1, 0x80 + lsls r1, 4 + adds r0, r5, r1 + movs r1, 0 + str r1, [r0] + ldr r2, _08004E88 + adds r0, r5, r2 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08004E68: .4byte gUnknown_20266A8 +_08004E6C: .4byte gUnknown_2026E30 +_08004E70: .4byte 0x06010000 +_08004E74: .4byte gUnknown_203B074 +_08004E78: .4byte gUnknown_20266B0 +_08004E7C: .4byte gUnknown_20256A0 +_08004E80: .4byte gUnknown_20262A8 +_08004E84: .4byte gUnknown_2025EA8 +_08004E88: .4byte 0x00000804 + thumb_func_end sub_8004D8C + + thumb_func_start sub_8004E8C +sub_8004E8C: + ldr r1, _08004EA4 + strh r1, [r0] + movs r1, 0x1 + negs r1, r1 + strh r1, [r0, 0x2] + strh r1, [r0, 0x4] + movs r1, 0 + strh r1, [r0, 0x6] + strh r1, [r0, 0x8] + strh r1, [r0, 0xA] + bx lr + .align 2, 0 +_08004EA4: .4byte 0x0000ffff + thumb_func_end sub_8004E8C + + thumb_func_start sub_8004EA8 +sub_8004EA8: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + adds r5, r0, 0 + mov r8, r1 + adds r0, r2, 0 + adds r6, r3, 0 + cmp r0, 0 + beq _08004EC2 + bl sub_80052BC +_08004EC2: + ldr r0, _08004F40 + ldr r7, [r0] + mov r12, r0 + cmp r7, 0x7F + ble _08004ECE + b _08005082 +_08004ECE: + mov r2, sp + ldrh r0, [r5] + strh r0, [r2] + ldrh r0, [r5, 0x2] + strh r0, [r2, 0x2] + ldrh r4, [r5, 0x4] + ldr r0, _08004F44 + ands r0, r4 + strh r0, [r2, 0x4] + ldrh r3, [r5, 0x6] + ldr r0, _08004F48 + ands r0, r3 + strh r0, [r2, 0x6] + ldrh r0, [r5, 0x8] + strh r0, [r2, 0x8] + movs r1, 0xE0 + lsls r1, 4 + ands r1, r3 + lsrs r1, 9 + ldr r0, _08004F4C + ands r0, r4 + lsls r0, 4 + orrs r1, r0 + strh r1, [r2, 0xA] + lsls r1, r7, 3 + ldr r0, _08004F50 + adds r3, r1, r0 + mov r0, r8 + movs r2, 0x16 + ldrsh r1, [r0, r2] + mov r0, sp + ldrb r0, [r0, 0x3] + lsls r0, 24 + asrs r0, 24 + adds r7, r1, r0 + cmp r7, 0 + bge _08004F1A + movs r7, 0 +_08004F1A: + cmp r7, 0xFF + ble _08004F20 + movs r7, 0xFF +_08004F20: + cmp r6, 0 + bne _08004F54 + add r2, sp, 0x4 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + ldrh r0, [r2] + strh r0, [r3, 0x2] + adds r2, 0x2 + adds r1, r3, 0x4 + ldrh r0, [r2] + strh r0, [r1] + adds r2, 0x2 + ldrh r0, [r2] + strh r0, [r1, 0x2] + b _08004F86 + .align 2, 0 +_08004F40: .4byte gUnknown_20266A8 +_08004F44: .4byte 0x0000fcff +_08004F48: .4byte 0x0000f1ff +_08004F4C: .4byte 0x000003ff +_08004F50: .4byte gUnknown_20262A8 +_08004F54: + add r4, sp, 0x4 + ldrh r1, [r4] + ldrh r0, [r6] + ands r0, r1 + ldrh r1, [r6, 0x6] + orrs r0, r1 + strh r0, [r3] + adds r4, 0x2 + ldrh r1, [r4] + ldrh r0, [r6, 0x2] + ands r0, r1 + ldrh r1, [r6, 0x8] + orrs r0, r1 + strh r0, [r3, 0x2] + adds r4, 0x2 + adds r2, r3, 0x4 + ldrh r1, [r4] + ldrh r0, [r6, 0x4] + ands r0, r1 + ldrh r1, [r6, 0xA] + orrs r0, r1 + strh r0, [r2] + adds r4, 0x2 + ldrh r0, [r4] + strh r0, [r2, 0x2] +_08004F86: + mov r0, sp + ldrb r0, [r0, 0x2] + cmp r0, 0 + beq _08004FB0 + ldr r1, _08004FA8 + mov r0, sp + ldrb r0, [r0, 0x2] + lsls r0, 1 + adds r1, r0, r1 + movs r4, 0 + ldrsh r0, [r1, r4] + cmp r0, 0 + beq _08004FB0 + adds r1, r0, 0 + ldr r0, _08004FAC + ands r1, r0 + b _08004FC0 + .align 2, 0 +_08004FA8: .4byte gUnknown_2025672 +_08004FAC: .4byte 0x000003ff +_08004FB0: + ldrh r1, [r3, 0x4] + ldr r2, _08005090 + ands r1, r2 + mov r6, r8 + movs r4, 0x14 + ldrsh r0, [r6, r4] + adds r1, r0 + ands r1, r2 +_08004FC0: + ldrh r2, [r3, 0x4] + movs r0, 0xFC + lsls r0, 8 + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x4] + ldrh r4, [r3, 0x2] + ldr r5, _08005094 + adds r2, r5, 0 + ands r2, r4 + ldr r6, _08005098 + adds r1, r2, r6 + mov r2, r8 + movs r6, 0 + ldrsh r0, [r2, r6] + adds r2, r1, r0 + movs r0, 0x40 + negs r0, r0 + mov r9, r0 + cmp r2, r9 + blt _08005082 + cmp r2, 0xEF + bgt _08005082 + ands r2, r5 + movs r0, 0xFE + lsls r0, 8 + ands r0, r4 + orrs r0, r2 + strh r0, [r3, 0x2] + ldrh r0, [r3, 0x6] + lsls r4, r0, 16 + ldr r1, _0800509C + adds r5, r1, 0 + lsrs r2, r4, 20 + ldr r6, _080050A0 + adds r1, r2, r6 + mov r2, r8 + movs r6, 0x2 + ldrsh r0, [r2, r6] + adds r2, r1, r0 + cmp r2, r9 + blt _08005082 + cmp r2, 0x9F + bgt _08005082 + movs r0, 0xFF + ands r2, r0 + ldrh r1, [r3] + movs r0, 0xFF + lsls r0, 8 + ands r0, r1 + orrs r0, r2 + strh r0, [r3] + lsrs r0, r4, 17 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08005044 + mov r0, r8 + ldrb r1, [r0, 0x1E] + movs r0, 0xF + ands r1, r0 + lsls r1, 12 + ldrh r0, [r3, 0x4] + ands r0, r5 + orrs r0, r1 + strh r0, [r3, 0x4] +_08005044: + mov r0, sp + ldrb r0, [r0, 0x2] + cmp r0, 0 + beq _08005068 + ldr r1, _080050A4 + mov r0, sp + ldrb r0, [r0, 0x2] + lsls r0, 1 + adds r0, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0xF + ands r1, r0 + lsls r1, 12 + ldrh r0, [r3, 0x4] + ands r0, r5 + orrs r0, r1 + strh r0, [r3, 0x4] +_08005068: + ldr r0, _080050A8 + mov r4, r12 + ldr r3, [r4] + lsls r2, r3, 3 + adds r2, r0 + ldr r1, _080050AC + lsls r0, r7, 3 + adds r0, r1 + ldr r1, [r0] + str r1, [r2] + str r2, [r0] + adds r3, 0x1 + str r3, [r4] +_08005082: + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08005090: .4byte 0x000003ff +_08005094: .4byte 0x000001ff +_08005098: .4byte 0xffffff00 +_0800509C: .4byte 0x00000fff +_080050A0: .4byte 0xfffffe00 +_080050A4: .4byte gUnknown_2025682 +_080050A8: .4byte gUnknown_2025EA8 +_080050AC: .4byte gUnknown_20256A0 + thumb_func_end sub_8004EA8 + + thumb_func_start AddSprite +AddSprite: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + adds r7, r1, 0 + mov r8, r2 + adds r4, r3, 0 + ldr r0, _080050F4 + ldr r0, [r0] + cmp r0, 0x7F + bgt _08005168 + lsls r1, r0, 3 + ldr r0, _080050F8 + adds r5, r1, r0 + cmp r7, 0 + bge _080050D2 + movs r7, 0 +_080050D2: + cmp r7, 0xFF + ble _080050D8 + movs r7, 0xFF +_080050D8: + cmp r4, 0 + bne _080050FC + ldrh r0, [r6] + strh r0, [r5] + ldrh r0, [r6, 0x2] + strh r0, [r5, 0x2] + adds r1, r6, 0x4 + adds r2, r5, 0x4 + ldrh r0, [r1] + strh r0, [r2] + ldrh r0, [r1, 0x2] + strh r0, [r2, 0x2] + b _08005128 + .align 2, 0 +_080050F4: .4byte gUnknown_20266A8 +_080050F8: .4byte gUnknown_20262A8 +_080050FC: + ldrh r1, [r6] + ldrh r0, [r4] + ands r0, r1 + ldrh r1, [r4, 0x6] + orrs r0, r1 + strh r0, [r5] + ldrh r1, [r6, 0x2] + ldrh r0, [r4, 0x2] + ands r0, r1 + ldrh r1, [r4, 0x8] + orrs r0, r1 + strh r0, [r5, 0x2] + adds r2, r6, 0x4 + adds r3, r5, 0x4 + ldrh r1, [r2] + ldrh r0, [r4, 0x4] + ands r0, r1 + ldrh r1, [r4, 0xA] + orrs r0, r1 + strh r0, [r3] + ldrh r0, [r2, 0x2] + strh r0, [r3, 0x2] +_08005128: + ldrh r4, [r5, 0x6] + lsrs r4, 4 + adds r0, r4, 0 + movs r1, 0 + bl nullsub_3 + movs r0, 0xFF + ands r4, r0 + ldrh r1, [r5] + movs r0, 0xFF + lsls r0, 8 + ands r0, r1 + orrs r0, r4 + strh r0, [r5] + mov r0, r8 + cmp r0, 0 + beq _0800514E + bl sub_80052BC +_0800514E: + ldr r0, _08005174 + ldr r4, _08005178 + ldr r3, [r4] + lsls r2, r3, 3 + adds r2, r0 + ldr r1, _0800517C + lsls r0, r7, 3 + adds r0, r1 + ldr r1, [r0] + str r1, [r2] + str r2, [r0] + adds r3, 0x1 + str r3, [r4] +_08005168: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08005174: .4byte gUnknown_2025EA8 +_08005178: .4byte gUnknown_20266A8 +_0800517C: .4byte gUnknown_20256A0 + thumb_func_end AddSprite + + thumb_func_start sub_8005180 +sub_8005180: + push {lr} + ldr r2, _080051A8 + adds r1, r2, 0 + cmp r2, 0 + beq _0800519E +_0800518A: + ldr r0, [r1, 0x4] + cmp r0, 0 + beq _08005198 + cmp r2, 0 + beq _08005196 + str r1, [r2] +_08005196: + adds r2, r1, 0 +_08005198: + ldr r1, [r1] + cmp r1, 0 + bne _0800518A +_0800519E: + movs r0, 0 + str r0, [r2] + pop {r0} + bx r0 + .align 2, 0 +_080051A8: .4byte gUnknown_20256A0 + thumb_func_end sub_8005180 + + thumb_func_start CopySpritesToOam +CopySpritesToOam: + push {r4-r6,lr} + ldr r3, _08005204 + ldr r2, _08005208 + movs r4, 0 + ldr r6, _0800520C + cmp r3, 0 + beq _080051E0 + ldr r5, _08005210 +_080051BC: + ldr r1, [r3, 0x4] + cmp r1, 0 + beq _080051D6 + subs r2, 0x4 + ldrh r0, [r1, 0x4] + strh r0, [r2] + subs r2, 0x2 + ldrh r0, [r1, 0x2] + strh r0, [r2] + subs r2, 0x2 + ldrh r0, [r1] + strh r0, [r2] + adds r4, 0x1 +_080051D6: + ldr r3, [r3] + cmp r3, 0 + beq _080051E0 + cmp r2, r5 + bhi _080051BC +_080051E0: + ldr r1, _08005210 + cmp r2, r1 + bls _080051FA + movs r0, 0 + movs r3, 0xA0 +_080051EA: + subs r2, 0x4 + strh r0, [r2] + subs r2, 0x2 + strh r0, [r2] + subs r2, 0x2 + strh r3, [r2] + cmp r2, r1 + bhi _080051EA +_080051FA: + strh r4, [r6] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08005204: .4byte gUnknown_20256A0 +_08005208: .4byte 0x07000400 +_0800520C: .4byte gUnknown_2025670 +_08005210: .4byte 0x07000008 + thumb_func_end CopySpritesToOam + + thumb_func_start SetSavingIconCoords +SetSavingIconCoords: + push {lr} + adds r3, r0, 0 + cmp r3, 0 + bne _0800522C + ldr r1, _08005228 + strh r3, [r1] + movs r0, 0xA0 + strh r0, [r1, 0x2] + b _0800523C + .align 2, 0 +_08005228: .4byte gUnknown_2025694 +_0800522C: + ldr r1, _08005240 + ldrh r0, [r3] + movs r2, 0 + strh r0, [r1] + ldrh r0, [r3, 0x2] + strh r0, [r1, 0x2] + ldr r0, _08005244 + str r2, [r0] +_0800523C: + pop {r0} + bx r0 + .align 2, 0 +_08005240: .4byte gUnknown_2025694 +_08005244: .4byte gUnknown_2025698 + thumb_func_end SetSavingIconCoords + + thumb_func_start BlinkSavingIcon +BlinkSavingIcon: + push {r4,lr} + movs r2, 0xE0 + lsls r2, 19 + ldr r0, _08005280 + ldr r1, [r0] + adds r3, r1, 0 + adds r1, 0x1 + str r1, [r0] + movs r0, 0x10 + ands r3, r0 + cmp r3, 0 + beq _08005288 + movs r0, 0xA0 + strh r0, [r2] + adds r2, 0x2 + movs r1, 0x80 + lsls r1, 7 + adds r0, r1, 0 + strh r0, [r2] + adds r2, 0x2 + ldr r4, _08005284 + adds r0, r4, 0 + strh r0, [r2] + adds r2, 0x2 + movs r0, 0 + strh r0, [r2] + b _080052A8 + .align 2, 0 +_08005280: .4byte gUnknown_2025698 +_08005284: .4byte 0x0000f3fc +_08005288: + ldr r1, _080052B0 + ldrh r0, [r1, 0x2] + strh r0, [r2] + ldr r2, _080052B4 + movs r4, 0x80 + lsls r4, 7 + adds r0, r4, 0 + ldrh r1, [r1] + adds r0, r1 + strh r0, [r2] + adds r2, 0x2 + ldr r1, _080052B8 + adds r0, r1, 0 + strh r0, [r2] + adds r2, 0x2 + strh r3, [r2] +_080052A8: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080052B0: .4byte gUnknown_2025694 +_080052B4: .4byte 0x07000002 +_080052B8: .4byte 0x0000f3fc + thumb_func_end BlinkSavingIcon + + thumb_func_start sub_80052BC +sub_80052BC: + push {r4-r6,lr} + adds r3, r0, 0 + ldr r0, [r3, 0x4] + cmp r0, 0 + beq _080052F2 + ldr r5, _080052F8 + ldr r6, _080052FC + ldr r4, _08005300 +_080052CC: + ldr r2, [r5] + cmp r2, r6 + bcs _080052F2 + ldr r0, [r3, 0x4] + str r0, [r2] + ldr r0, [r3] + str r0, [r2, 0x4] + ldr r1, [r4] + str r1, [r2, 0x8] + ldr r0, [r3, 0x4] + adds r1, r0 + str r1, [r4] + adds r0, r2, 0 + adds r0, 0xC + str r0, [r5] + adds r3, 0x8 + ldr r0, [r3, 0x4] + cmp r0, 0 + bne _080052CC +_080052F2: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080052F8: .4byte gUnknown_203B074 +_080052FC: .4byte gUnknown_2026E30 +_08005300: .4byte gUnknown_2026E30 + thumb_func_end sub_80052BC + + thumb_func_start sub_8005304 +sub_8005304: + push {r4,lr} + ldr r4, _0800530C + b _0800532A + .align 2, 0 +_0800530C: .4byte gUnknown_20266B0 +_08005310: + ldr r1, [r4, 0x4] + cmp r1, 0 + beq _08005320 + ldr r0, [r4, 0x8] + ldr r2, [r4] + bl CpuCopy + b _08005328 +_08005320: + ldr r0, [r4, 0x8] + ldr r1, [r4] + bl CpuClear +_08005328: + adds r4, 0xC +_0800532A: + ldr r0, _08005338 + ldr r0, [r0] + cmp r4, r0 + bcc _08005310 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08005338: .4byte gUnknown_203B074 + thumb_func_end sub_8005304 + + thumb_func_start sub_800533C +sub_800533C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r1 + adds r5, r2, 0 + adds r7, r3, 0 + ldr r1, [sp, 0x18] + lsls r1, 24 + lsrs r6, r1, 24 + movs r2, 0x18 + ldrsh r1, [r5, r2] + lsls r1, 2 + adds r1, r0 + ldr r4, [r1] + ldr r1, _08005368 + movs r2, 0x14 + ldrsh r0, [r5, r2] + lsls r0, 5 + ldr r2, _0800536C + adds r0, r2 + str r0, [r1] + b _0800538E + .align 2, 0 +_08005368: .4byte gUnknown_2026E30 +_0800536C: .4byte 0x06010000 +_08005370: + cmp r6, 0 + beq _08005382 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + blt _08005382 + lsls r0, 2 + add r0, r8 + ldr r2, [r0] +_08005382: + adds r0, r4, 0 + adds r1, r5, 0 + adds r3, r7, 0 + bl sub_8004EA8 + adds r4, 0xA +_0800538E: + movs r2, 0 + ldrh r1, [r4] + ldr r0, _080053A8 + cmp r1, r0 + bne _08005370 + ldrh r0, [r4, 0x2] + cmp r0, r1 + bne _08005370 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080053A8: .4byte 0x0000ffff + thumb_func_end sub_800533C + + thumb_func_start sub_80053AC +sub_80053AC: + push {r4-r6,lr} + sub sp, 0xC + ldr r5, [sp, 0x1C] + ldr r6, [sp, 0x20] + ldr r4, [sp, 0x24] + lsls r4, 24 + lsrs r4, 24 + ldr r1, [r1, 0x4] + str r5, [sp] + str r6, [sp, 0x4] + str r4, [sp, 0x8] + bl sub_80053D0 + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80053AC + + thumb_func_start sub_80053D0 +sub_80053D0: + push {r4-r7,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + adds r7, r3, 0 + ldr r0, [sp, 0x1C] + lsls r0, 24 + movs r2, 0 + movs r3, 0x80 + lsls r3, 8 + strh r3, [r4] + cmp r0, 0 + beq _080053F6 + movs r0, 0x80 + lsls r0, 5 + adds r1, r0, 0 + adds r0, r3, 0 + orrs r0, r1 + strh r0, [r4] +_080053F6: + strh r2, [r4, 0x2] + ldr r0, [sp, 0x18] + strh r0, [r4, 0x4] + strh r2, [r4, 0xC] + strh r2, [r4, 0xE] + ldr r0, [sp, 0x14] + strh r0, [r4, 0x1C] + ldr r0, _08005438 + strh r0, [r4, 0x20] + movs r0, 0x1 + negs r0, r0 + strh r0, [r4, 0x22] + str r2, [r4, 0x14] + str r2, [r4, 0x18] + strh r2, [r4, 0x6] + ldr r1, [r5, 0x4] + lsls r0, r6, 2 + adds r0, r1 + ldr r1, [r0] + lsls r0, r7, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [r4, 0x28] + str r0, [r4, 0x2C] + ldr r0, [r5] + str r0, [r4, 0x34] + ldr r0, [r5, 0xC] + str r0, [r4, 0x38] + ldr r0, [r5, 0x10] + str r0, [r4, 0x30] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08005438: .4byte 0x0000ffff + thumb_func_end sub_80053D0 + + thumb_func_start sub_800543C +sub_800543C: + push {r4,r5,lr} + sub sp, 0x8 + ldr r5, [sp, 0x14] + ldr r4, [sp, 0x18] + lsls r4, 24 + lsrs r4, 24 + ldr r1, [r1, 0x4] + str r5, [sp] + str r4, [sp, 0x4] + bl sub_800545C + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_800543C + + thumb_func_start sub_800545C +sub_800545C: + push {r4-r7,lr} + adds r4, r0, 0 + adds r6, r1, 0 + adds r7, r2, 0 + adds r5, r3, 0 + ldr r0, [sp, 0x18] + lsls r0, 24 + movs r2, 0 + movs r3, 0x80 + lsls r3, 8 + strh r3, [r4] + cmp r0, 0 + beq _08005482 + movs r0, 0x80 + lsls r0, 5 + adds r1, r0, 0 + adds r0, r3, 0 + orrs r0, r1 + strh r0, [r4] +_08005482: + strh r2, [r4, 0x2] + ldr r0, [sp, 0x14] + strh r0, [r4, 0x4] + strh r2, [r4, 0xC] + strh r2, [r4, 0xE] + strh r5, [r4, 0x1C] + ldr r0, _080054B8 + strh r0, [r4, 0x20] + movs r0, 0x1 + negs r0, r0 + strh r0, [r4, 0x22] + str r2, [r4, 0x14] + str r2, [r4, 0x18] + strh r2, [r4, 0x6] + ldr r1, [r6, 0x4] + lsls r0, r7, 2 + adds r0, r1 + ldr r0, [r0] + ldr r0, [r0] + str r0, [r4, 0x28] + str r0, [r4, 0x2C] + ldr r0, [r6] + str r0, [r4, 0x34] + str r2, [r4, 0x30] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080054B8: .4byte 0x0000ffff + thumb_func_end sub_800545C + + thumb_func_start sub_80054BC +sub_80054BC: + push {r4,lr} + adds r4, r0, 0 + ldrh r1, [r4] + movs r0, 0x80 + lsls r0, 6 + ands r0, r1 + cmp r0, 0 + beq _080054D0 + movs r0, 0 + b _080054D2 +_080054D0: + lsrs r0, r1, 15 +_080054D2: + cmp r0, 0 + beq _08005586 + movs r1, 0x20 + ldrsh r0, [r4, r1] + ldrh r3, [r4] + cmp r0, 0 + blt _08005524 + movs r0, 0x80 + lsls r0, 7 + ands r0, r3 + cmp r0, 0 + bne _08005586 + ldrh r2, [r4, 0x6] + movs r0, 0x6 + ldrsh r1, [r4, r0] + ldr r0, _0800550C + cmp r1, r0 + bgt _080054FA + adds r0, r2, 0x1 + strh r0, [r4, 0x6] +_080054FA: + ldrh r1, [r4, 0x4] + movs r2, 0x4 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08005510 + subs r0, r1, 0x1 + strh r0, [r4, 0x4] + b _08005586 + .align 2, 0 +_0800550C: .4byte 0x0000752f +_08005510: + ldrh r1, [r4, 0x2] + movs r2, 0x2 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08005524 + subs r0, r1, 0x1 + strh r0, [r4, 0x2] + lsls r0, 16 + cmp r0, 0 + bgt _08005586 +_08005524: + ldr r0, [r4, 0x2C] + ldrb r0, [r0] + cmp r0, 0 + bne _08005550 + movs r0, 0x80 + lsls r0, 5 + ands r0, r3 + cmp r0, 0 + bne _08005542 + movs r1, 0x80 + lsls r1, 6 + adds r0, r1, 0 + orrs r0, r3 + strh r0, [r4] + b _08005586 +_08005542: + ldr r0, [r4, 0x28] + str r0, [r4, 0x2C] + bl Random + movs r1, 0x1 + ands r0, r1 + strh r0, [r4, 0x4] +_08005550: + ldrh r1, [r4] + movs r2, 0x80 + lsls r2, 4 + adds r0, r2, 0 + orrs r0, r1 + strh r0, [r4] + ldr r1, [r4, 0x2C] + ldrb r0, [r1] + strh r0, [r4, 0x2] + ldrh r0, [r1, 0x2] + strh r0, [r4, 0x20] + ldrh r0, [r1, 0x4] + strh r0, [r4, 0xC] + ldrh r0, [r1, 0x6] + strh r0, [r4, 0xE] + ldrh r0, [r1, 0x8] + strh r0, [r4, 0x10] + ldrh r0, [r1, 0xA] + strh r0, [r4, 0x12] + ldrb r0, [r1, 0x1] + str r0, [r4, 0x14] + ldrb r2, [r1, 0x1] + ldr r0, [r4, 0x18] + orrs r0, r2 + str r0, [r4, 0x18] + adds r1, 0xC + str r1, [r4, 0x2C] +_08005586: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80054BC + + thumb_func_start sub_800558C +sub_800558C: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r4, r1, 0 + adds r6, r2, 0 + adds r7, r3, 0 + ldrh r0, [r5] + lsrs r0, 15 + cmp r0, 0 + beq _08005602 + movs r1, 0x20 + ldrsh r0, [r5, r1] + cmp r0, 0 + bge _080055AE + adds r0, r5, 0 + bl sub_80054BC +_080055AE: + ldrh r0, [r5] + lsrs r0, 15 + cmp r0, 0 + beq _08005602 + ldrh r0, [r5, 0xC] + adds r0, r4 + strh r0, [r5, 0x8] + ldrh r0, [r5, 0xE] + adds r0, r6 + strh r0, [r5, 0xA] + adds r1, r5, 0 + adds r1, 0x26 + ldr r0, [sp, 0x18] + strb r0, [r1] + strh r7, [r5, 0x1E] + ldr r0, [r5, 0x34] + ldr r1, [r5, 0x38] + adds r2, r5, 0 + adds r2, 0x8 + movs r3, 0x22 + ldrsh r4, [r5, r3] + movs r6, 0x20 + ldrsh r3, [r5, r6] + eors r4, r3 + negs r3, r4 + orrs r3, r4 + lsrs r3, 31 + str r3, [sp] + ldr r3, [sp, 0x1C] + bl sub_800533C + ldrh r0, [r5, 0x20] + strh r0, [r5, 0x22] + ldrh r1, [r5] + movs r0, 0x80 + lsls r0, 4 + ands r0, r1 + cmp r0, 0 + beq _08005602 + ldr r0, _0800560C + ands r0, r1 + strh r0, [r5] +_08005602: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0800560C: .4byte 0x0000f7ff + thumb_func_end sub_800558C + + thumb_func_start sub_8005610 +sub_8005610: + push {lr} + ldr r0, [r0, 0x4] + bl sub_800561C + pop {r0} + bx r0 + thumb_func_end sub_8005610 + + thumb_func_start sub_800561C +sub_800561C: + push {r4-r7,lr} + adds r5, r0, 0 + adds r0, r1, 0 + adds r7, r2, 0 + adds r6, r3, 0 + ldr r1, [r5, 0x14] + cmp r1, 0 + beq _0800563A + lsls r0, 5 + ldr r2, _08005664 + adds r0, r2 + ldr r2, [r5, 0x1C] + lsls r2, 5 + bl CpuCopy +_0800563A: + ldr r0, [r5, 0x18] + cmp r0, 0 + beq _0800565C + movs r4, 0 +_08005642: + movs r1, 0xF0 + lsls r1, 1 + adds r0, r4, r1 + lsls r2, r4, 2 + ldr r1, [r5, 0x18] + adds r1, r2 + adds r2, r7, 0 + adds r3, r6, 0 + bl SetBGPaletteBufferColorRGB + adds r4, 0x1 + cmp r4, 0xF + ble _08005642 +_0800565C: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08005664: .4byte 0x06010000 + thumb_func_end sub_800561C + + thumb_func_start sub_8005668 +sub_8005668: + push {lr} + ldr r0, [r0, 0x4] + bl sub_8005674 + pop {r1} + bx r1 + thumb_func_end sub_8005668 + + thumb_func_start sub_8005674 +sub_8005674: + push {r4,lr} + adds r4, r0, 0 + ldr r3, [r4, 0x14] + cmp r3, 0 + beq _0800568E + lsls r0, r1, 5 + ldr r1, _08005698 + adds r0, r1 + ldr r2, [r4, 0x1C] + lsls r2, 5 + adds r1, r3, 0 + bl CpuCopy +_0800568E: + ldr r0, [r4, 0x18] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08005698: .4byte 0x06010000 + thumb_func_end sub_8005674 + + thumb_func_start sub_800569C +sub_800569C: + push {r4-r6,lr} + adds r3, r0, 0 + adds r4, r1, 0 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0 + strh r0, [r3] + strh r0, [r3, 0x2] + ldrh r0, [r4] + lsrs r0, 15 + cmp r0, 0 + beq _080056F8 + cmp r2, 0x3 + bhi _080056F8 + ldr r1, [r4, 0x30] + cmp r1, 0 + beq _080056F2 + movs r5, 0x20 + ldrsh r0, [r4, r5] + lsls r0, 4 + adds r5, r1, r0 + lsls r0, r2, 2 + adds r2, r5, r0 + movs r6, 0 + ldrsh r1, [r2, r6] + cmp r1, 0x63 + bne _080056E0 + movs r6, 0x2 + ldrsh r1, [r2, r6] + cmp r1, 0x63 + bne _080056E0 + strh r1, [r3] + strh r1, [r3, 0x2] + b _080056F8 +_080056E0: + adds r0, r5, r0 + ldrh r1, [r0] + ldrh r2, [r4, 0xC] + adds r1, r2 + strh r1, [r3] + ldrh r0, [r0, 0x2] + ldrh r4, [r4, 0xE] + adds r0, r4 + b _080056F6 +_080056F2: + movs r0, 0x63 + strh r0, [r3] +_080056F6: + strh r0, [r3, 0x2] +_080056F8: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_800569C + + thumb_func_start sub_8005700 +sub_8005700: + push {r4,r5,lr} + adds r3, r0, 0 + ldrh r0, [r1] + lsrs r0, 15 + cmp r0, 0 + beq _0800575C + ldr r2, [r1, 0x30] + cmp r2, 0 + beq _0800574C + movs r4, 0x20 + ldrsh r0, [r1, r4] + lsls r0, 4 + adds r2, r0 + adds r4, r2, 0 + adds r4, 0xC +_0800571E: + movs r5, 0 + ldrsh r0, [r2, r5] + cmp r0, 0x63 + bne _08005732 + movs r5, 0x2 + ldrsh r0, [r2, r5] + cmp r0, 0x63 + bne _08005732 + strh r0, [r3] + b _08005740 +_08005732: + ldrh r0, [r2] + ldrh r5, [r1, 0xC] + adds r0, r5 + strh r0, [r3] + ldrh r0, [r2, 0x2] + ldrh r5, [r1, 0xE] + adds r0, r5 +_08005740: + strh r0, [r3, 0x2] + adds r3, 0x4 + adds r2, 0x4 + cmp r2, r4 + ble _0800571E + b _0800575C +_0800574C: + movs r1, 0x63 + movs r0, 0x3 +_08005750: + strh r1, [r3] + strh r1, [r3, 0x2] + adds r3, 0x4 + subs r0, 0x1 + cmp r0, 0 + bge _08005750 +_0800575C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8005700 + + thumb_func_start sub_8005764 +sub_8005764: + push {lr} + ldr r1, [r1, 0x4] + bl sub_8005770 + pop {r0} + bx r0 + thumb_func_end sub_8005764 + + thumb_func_start sub_8005770 +sub_8005770: + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r2 + adds r7, r3, 0 + movs r5, 0 + adds r0, 0x10 + lsls r6, r0, 4 + adds r4, r1, 0 +_08005782: + adds r0, r6, r5 + adds r1, r4, 0 + mov r2, r8 + adds r3, r7, 0 + bl SetBGPaletteBufferColorRGB + adds r4, 0x4 + adds r5, 0x1 + cmp r5, 0xF + ble _08005782 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8005770 + + thumb_func_start nullsub_7 +nullsub_7: + bx lr + thumb_func_end nullsub_7 + + thumb_func_start nullsub_8 +nullsub_8: + bx lr + thumb_func_end nullsub_8 + + thumb_func_start nullsub_9 +nullsub_9: + bx lr + thumb_func_end nullsub_9 + + thumb_func_start nullsub_10 +nullsub_10: + bx lr + thumb_func_end nullsub_10 + + thumb_func_start nullsub_144 +nullsub_144: + bx lr + thumb_func_end nullsub_144 + + thumb_func_start nullsub_11 +nullsub_11: + bx lr + thumb_func_end nullsub_11 + + thumb_func_start nullsub_12 +nullsub_12: + bx lr + thumb_func_end nullsub_12 + + thumb_func_start nullsub_13 +nullsub_13: + bx lr + thumb_func_end nullsub_13 + + thumb_func_start nullsub_145 +nullsub_145: + bx lr + thumb_func_end nullsub_145 + + thumb_func_start nullsub_14 +nullsub_14: + bx lr + thumb_func_end nullsub_14 + + thumb_func_start nullsub_146 +nullsub_146: + bx lr + thumb_func_end nullsub_146 + + thumb_func_start nullsub_147 +nullsub_147: + bx lr + thumb_func_end nullsub_147 + + thumb_func_start nullsub_148 +nullsub_148: + bx lr + thumb_func_end nullsub_148 + + thumb_func_start nullsub_149 +nullsub_149: + bx lr + thumb_func_end nullsub_149 + + thumb_func_start sub_80057D8 +sub_80057D8: + movs r0, 0 + bx lr + thumb_func_end sub_80057D8 + + thumb_func_start sub_80057DC +sub_80057DC: + movs r0, 0 + bx lr + thumb_func_end sub_80057DC + + thumb_func_start nullsub_150 +nullsub_150: + bx lr + thumb_func_end nullsub_150 + + thumb_func_start nullsub_151 +nullsub_151: + bx lr + thumb_func_end nullsub_151 + + thumb_func_start sub_80057E8 +sub_80057E8: + ldr r1, _08005814 + movs r0, 0x1 + strb r0, [r1] + ldr r0, _08005818 + movs r2, 0 + str r2, [r0] + ldr r1, _0800581C + movs r0, 0x1 + str r0, [r1] + ldr r0, _08005820 + str r2, [r0] + ldr r0, _08005824 + str r2, [r0] + ldr r0, _08005828 + strb r2, [r0] + ldr r1, _0800582C + ldr r3, _08005830 + adds r0, r3, 0 + strh r0, [r1] + ldr r0, _08005834 + str r2, [r0] + bx lr + .align 2, 0 +_08005814: .4byte gUnknown_2026E4C +_08005818: .4byte gUnknown_2026E54 +_0800581C: .4byte gUnknown_2026E50 +_08005820: .4byte gUnknown_2026E58 +_08005824: .4byte gUnknown_2026E3C +_08005828: .4byte gUnknown_2026E38 +_0800582C: .4byte gUnknown_2026E4E +_08005830: .4byte 0x0000060c +_08005834: .4byte gUnknown_203B078 + thumb_func_end sub_80057E8 + + thumb_func_start sub_8005838 +sub_8005838: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + adds r5, r0, 0 + lsls r1, 24 + lsrs r1, 24 + ldr r0, _08005880 + ldrb r0, [r0] + cmp r0, 0 + bne _08005854 + movs r1, 0 +_08005854: + ldr r0, _08005884 + ldr r0, [r0] + ldr r3, _08005888 + cmp r0, 0 + bne _08005860 + ldr r3, _0800588C +_08005860: + ldr r0, _08005890 + ldr r2, [r0] + cmp r2, 0 + bne _0800586A + ldr r2, _08005894 +_0800586A: + ldr r0, _08005898 + str r3, [r0] + cmp r1, 0x5 + bls _08005876 + bl _08006094 +_08005876: + lsls r0, r1, 2 + ldr r1, _0800589C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08005880: .4byte gUnknown_2026E4C +_08005884: .4byte gUnknown_2026E54 +_08005888: .4byte gUnknown_20270E8 +_0800588C: .4byte gUnknown_2026E60 +_08005890: .4byte gUnknown_203B078 +_08005894: .4byte gUnknown_80B83EA +_08005898: .4byte gUnknown_2026E58 +_0800589C: .4byte _080058A0 + .align 2, 0 +_080058A0: + .4byte _080058B8 + .4byte _08005984 + .4byte _08005A98 + .4byte _08005BAC + .4byte _08005D46 + .4byte _08005E58 +_080058B8: + movs r1, 0 + movs r7, 0x9 +_080058BC: + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + subs r7, 0x1 + cmp r7, 0 + bge _080058BC + b _08006094 +_08005984: + ldr r1, _08005A94 + movs r7, 0x9 +_08005988: + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + subs r7, 0x1 + cmp r7, 0 + blt _08005A90 + b _08005988 +_08005A90: + b _08006094 + .align 2, 0 +_08005A94: .4byte gUnknown_80B816A +_08005A98: + ldr r1, _08005BA8 + movs r7, 0x9 +_08005A9C: + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + subs r7, 0x1 + cmp r7, 0 + blt _08005BA4 + b _08005A9C +_08005BA4: + b _08006094 + .align 2, 0 +_08005BA8: .4byte gUnknown_80B802A +_08005BAC: + ldr r0, [r5] + mov r10, r0 + cmp r0, 0 + bge _08005BBA + ldr r0, [r5, 0x8] + cmp r0, 0 + blt _08005BDC +_08005BBA: + ldr r1, [r5, 0x4] + cmp r1, 0 + bge _08005BC6 + ldr r0, [r5, 0xC] + cmp r0, 0 + blt _08005BDC +_08005BC6: + mov r4, r10 + cmp r4, 0xEF + ble _08005BD2 + ldr r0, [r5, 0x8] + cmp r0, 0xEF + bgt _08005BDC +_08005BD2: + cmp r1, 0x9F + ble _08005CA8 + ldr r0, [r5, 0xC] + cmp r0, 0x9F + ble _08005CA8 +_08005BDC: + movs r1, 0xF0 + movs r7, 0x9 +_08005BE0: + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + subs r7, 0x1 + cmp r7, 0 + bge _08005BE0 + b _08006094 +_08005CA8: + movs r7, 0 + mov r8, r1 + movs r6, 0x80 + lsls r6, 1 + mov r12, r6 + lsls r0, r1, 1 + ldr r1, _08005CCC + subs r6, r1, r0 + mov r9, r10 +_08005CBA: + cmp r8, r7 + ble _08005CD0 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + mov r4, r12 + strh r4, [r3] + b _08005D3A + .align 2, 0 +_08005CCC: .4byte gUnknown_80B8008 +_08005CD0: + ldr r1, [r5, 0xC] + cmp r1, r7 + bgt _08005CE2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + mov r0, r12 + b _08005D38 +_08005CE2: + mov r4, r8 + subs r0, r7, r4 + cmp r0, 0xF + bgt _08005CF0 + movs r0, 0 + ldrsh r1, [r6, r0] + b _08005D00 +_08005CF0: + subs r0, r1, r7 + cmp r0, 0xF + bgt _08005D10 + lsls r0, 1 + ldr r1, _08005D0C + adds r0, r1 + movs r4, 0 + ldrsh r1, [r0, r4] +_08005D00: + mov r0, r9 + adds r4, r0, r1 + ldr r0, [r5, 0x8] + subs r1, r0, r1 + b _08005D14 + .align 2, 0 +_08005D0C: .4byte gUnknown_80B8008 +_08005D10: + mov r4, r10 + ldr r1, [r5, 0x8] +_08005D14: + cmp r4, 0 + bge _08005D1A + movs r4, 0 +_08005D1A: + cmp r4, 0xEF + ble _08005D20 + movs r4, 0xEF +_08005D20: + cmp r1, 0 + bgt _08005D26 + movs r1, 0x1 +_08005D26: + cmp r1, 0xF0 + ble _08005D2C + movs r1, 0xF0 +_08005D2C: + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + lsls r0, r1, 8 + orrs r0, r4 +_08005D38: + strh r0, [r3] +_08005D3A: + adds r3, 0x2 + adds r6, 0x2 + adds r7, 0x1 + cmp r7, 0x9F + ble _08005CBA + b _08006094 +_08005D46: + ldr r1, _08005E54 + movs r7, 0xE +_08005D4A: + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + ldrh r0, [r1] + strh r0, [r3] + adds r1, 0x2 + adds r3, 0x2 + subs r7, 0x1 + cmp r7, 0 + blt _08005E52 + b _08005D4A +_08005E52: + b _08006094 + .align 2, 0 +_08005E54: .4byte gUnknown_80B82AA +_08005E58: + ldr r4, _08005FF4 + ldr r5, _08005FF8 + ldr r6, _08005FFC + movs r0, 0x80 + lsls r0, 1 + adds r1, r0, 0 + movs r7, 0xE +_08005E66: + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + ldrh r0, [r2] + strh r0, [r3] + adds r2, 0x2 + adds r3, 0x2 + strh r1, [r3] + adds r3, 0x2 + subs r7, 0x1 + cmp r7, 0 + bge _08005E66 + ldr r4, [r4] + str r4, [sp] + ldr r5, [r5] + str r5, [sp, 0x4] + ldr r6, [r6] + str r6, [sp, 0x8] + adds r1, r6, 0 + cmp r6, 0 + bge _08005F40 + adds r1, 0xFF +_08005F40: + asrs r1, 8 + adds r1, 0x1 + movs r0, 0x80 + lsls r0, 3 + bl __divsi3 + str r0, [sp, 0xC] + ldr r0, [sp, 0x4] + cmp r0, 0 + bge _08005F56 + adds r0, 0xFF +_08005F56: + asrs r4, r0, 8 + adds r5, r4, 0 + movs r3, 0 + lsls r0, r4, 2 + adds r7, r0, 0x2 + mov r9, r7 +_08005F62: + adds r0, r3, 0 + str r3, [sp, 0x10] + bl sub_8009C7C + ldr r1, [sp, 0x8] + muls r0, r1 + ldr r3, [sp, 0x10] + cmp r0, 0 + bge _08005F76 + adds r0, 0xFF +_08005F76: + asrs r0, 8 + ldr r2, [sp, 0x4] + adds r1, r2, r0 + cmp r1, 0 + bge _08005F82 + adds r1, 0xFF +_08005F82: + asrs r1, 8 + str r1, [sp, 0x14] + ldr r6, [sp, 0x4] + subs r0, r6, r0 + cmp r0, 0 + bge _08005F90 + adds r0, 0xFF +_08005F90: + asrs r0, 8 + mov r8, r0 + ldr r0, [sp, 0x14] + cmp r5, r0 + blt _08005FA4 + ldr r1, [sp, 0xC] + adds r1, r3 + mov r10, r1 + cmp r4, r8 + ble _0800608A +_08005FA4: + adds r0, r3, 0 + str r3, [sp, 0x10] + bl sub_8009D04 + ldr r2, [sp, 0x8] + muls r0, r2 + ldr r3, [sp, 0x10] + cmp r0, 0 + bge _08005FB8 + adds r0, 0xFF +_08005FB8: + asrs r0, 8 + ldr r6, [sp] + subs r1, r6, r0 + cmp r1, 0 + bge _08005FC4 + adds r1, 0xFF +_08005FC4: + asrs r1, 8 + ldr r2, [sp] + adds r0, r2, r0 + cmp r0, 0 + bge _08005FD0 + adds r0, 0xFF +_08005FD0: + asrs r0, 8 + cmp r1, 0 + bge _08005FD8 + movs r1, 0 +_08005FD8: + cmp r0, 0 + bge _08005FDE + movs r0, 0 +_08005FDE: + cmp r1, 0xEF + ble _08005FE4 + movs r1, 0x9F +_08005FE4: + cmp r0, 0xEF + ble _08005FEA + movs r0, 0x9F +_08005FEA: + cmp r1, r0 + ble _08006000 + lsls r2, r1, 8 + orrs r2, r0 + b _08006004 + .align 2, 0 +_08005FF4: .4byte gUnknown_2026E40 +_08005FF8: .4byte gUnknown_2026E44 +_08005FFC: .4byte gUnknown_2026E48 +_08006000: + lsls r2, r0, 8 + orrs r2, r1 +_08006004: + ldr r6, [sp, 0xC] + adds r3, r6 + mov r10, r3 + ldr r0, [sp, 0x14] + cmp r5, r0 + bge _0800604E + ldr r1, _08006030 + mov r12, r1 + ldr r3, _08006034 + add r3, r9 + ldr r1, _08006038 + add r1, r9 +_0800601C: + cmp r5, 0 + blt _0800603E + cmp r5, 0x9F + bgt _0800603E + mov r6, r12 + ldr r0, [r6] + cmp r0, 0 + bne _0800603C + strh r2, [r1] + b _0800603E + .align 2, 0 +_08006030: .4byte gUnknown_2026E54 +_08006034: .4byte gUnknown_20270E8 +_08006038: .4byte gUnknown_2026E60 +_0800603C: + strh r2, [r3] +_0800603E: + adds r3, 0x4 + adds r1, 0x4 + movs r0, 0x4 + add r9, r0 + adds r5, 0x1 + ldr r6, [sp, 0x14] + cmp r5, r6 + blt _0800601C +_0800604E: + cmp r4, r8 + ble _0800608A + ldr r6, _08006070 + ldr r0, _08006074 + adds r3, r7, r0 + ldr r0, _08006078 + adds r1, r7, r0 +_0800605C: + cmp r4, 0 + blt _0800607E + cmp r4, 0x9F + bgt _0800607E + ldr r0, [r6] + cmp r0, 0 + bne _0800607C + strh r2, [r1] + b _0800607E + .align 2, 0 +_08006070: .4byte gUnknown_2026E54 +_08006074: .4byte gUnknown_20270E8 +_08006078: .4byte gUnknown_2026E60 +_0800607C: + strh r2, [r3] +_0800607E: + subs r3, 0x4 + subs r1, 0x4 + subs r7, 0x4 + subs r4, 0x1 + cmp r4, r8 + bgt _0800605C +_0800608A: + mov r3, r10 + ldr r0, _080060A4 + cmp r3, r0 + bgt _08006094 + b _08005F62 +_08006094: + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080060A4: .4byte 0x000003ff + thumb_func_end sub_8005838 + + thumb_func_start sub_80060A8 +sub_80060A8: + push {lr} + ldr r1, _080060D8 + ldr r0, _080060DC + ldr r0, [r0] + str r0, [r1] + ldr r2, _080060E0 + movs r1, 0 + ldr r0, [r2] + cmp r0, 0 + bne _080060BE + movs r1, 0x1 +_080060BE: + str r1, [r2] + ldr r2, _080060E4 + movs r1, 0 + ldr r0, [r2] + cmp r0, 0 + bne _080060CC + movs r1, 0x1 +_080060CC: + str r1, [r2] + ldr r1, _080060E8 + movs r0, 0 + strb r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_080060D8: .4byte gUnknown_2026E3C +_080060DC: .4byte gUnknown_2026E58 +_080060E0: .4byte gUnknown_2026E54 +_080060E4: .4byte gUnknown_2026E50 +_080060E8: .4byte gUnknown_2026E38 + thumb_func_end sub_80060A8 + + thumb_func_start sub_80060EC +sub_80060EC: + push {lr} + ldr r1, _08006130 + ldr r0, _08006134 + ldr r0, [r0] + str r0, [r1] + ldr r2, _08006138 + movs r1, 0 + ldr r0, [r2] + cmp r0, 0 + bne _08006102 + movs r1, 0x1 +_08006102: + str r1, [r2] + ldr r2, _0800613C + movs r1, 0 + ldr r0, [r2] + cmp r0, 0 + bne _08006110 + movs r1, 0x1 +_08006110: + str r1, [r2] + ldr r0, _08006140 + ldrh r2, [r0] + movs r0, 0xF8 + lsls r0, 5 + ands r0, r2 + lsrs r0, 8 + movs r1, 0x1F + ands r1, r2 + bl sub_800CC44 + ldr r1, _08006144 + movs r0, 0x1 + strb r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_08006130: .4byte gUnknown_2026E3C +_08006134: .4byte gUnknown_2026E58 +_08006138: .4byte gUnknown_2026E54 +_0800613C: .4byte gUnknown_2026E50 +_08006140: .4byte gUnknown_2026E4E +_08006144: .4byte gUnknown_2026E38 + thumb_func_end sub_80060EC + + thumb_func_start SeedRng +SeedRng: + push {r4,lr} + ldr r4, _08006170 + ldrb r2, [r0] + ldrb r1, [r0, 0x1] + muls r2, r1 + ldrb r3, [r0, 0x2] + ldrb r1, [r0, 0x3] + muls r1, r3 + ldr r3, _08006174 + adds r1, r3 + adds r2, r1 + ldrb r1, [r0, 0x4] + ldrb r0, [r0, 0x5] + muls r0, r1 + adds r2, r0 + str r2, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08006170: .4byte gUnknown_203B07C +_08006174: .4byte 0x0000d305 + thumb_func_end SeedRng + + thumb_func_start Random16 +Random16: + ldr r2, _08006188 + ldr r1, [r2] + ldr r0, _0800618C + muls r0, r1 + adds r0, 0x1 + str r0, [r2] + asrs r0, 16 + bx lr + .align 2, 0 +_08006188: .4byte gUnknown_203B07C +_0800618C: .4byte 0x5d588b65 + thumb_func_end Random16 + + thumb_func_start Random +Random: + push {r4,lr} + bl Random16 + adds r4, r0, 0 + lsls r4, 16 + asrs r4, 16 + bl Random16 + lsls r0, 16 + asrs r0, 16 + lsls r4, 16 + orrs r4, r0 + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end Random + + thumb_func_start RandomCapped +RandomCapped: + push {r4,lr} + adds r4, r0, 0 + bl Random + ldr r1, _080061C8 + ands r0, r1 + muls r0, r4 + asrs r0, 16 + ands r0, r1 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080061C8: .4byte 0x0000ffff + thumb_func_end RandomCapped + + thumb_func_start RandomRange +RandomRange: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + cmp r5, r4 + beq _080061EC + cmp r5, r4 + blt _080061E4 + subs r0, r5, r4 + bl RandomCapped + adds r0, r4 + b _080061EC +_080061E4: + subs r0, r4, r5 + bl RandomCapped + adds r0, r5 +_080061EC: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end RandomRange + + thumb_func_start GetRngState +GetRngState: + ldr r0, _080061FC + ldr r0, [r0] + bx lr + .align 2, 0 +_080061FC: .4byte gUnknown_203B07C + thumb_func_end GetRngState + + thumb_func_start ReseedRng +ReseedRng: + push {r4,lr} + ldr r4, _08006214 + str r0, [r4] + bl Random + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08006214: .4byte gUnknown_203B07C + thumb_func_end ReseedRng + + thumb_func_start sub_8006218 +sub_8006218: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r1, _080062F4 + movs r0, 0 + str r0, [r1] + ldr r0, _080062F8 + ldr r5, _080062FC + adds r1, r5, 0 + bl sub_800A9EC + ldr r4, _08006300 + str r0, [r4] + ldr r0, _08006304 + adds r1, r5, 0 + bl sub_800A9EC + str r0, [r4, 0x4] + ldr r2, _08006308 + ldr r1, [r4] + ldr r1, [r1, 0x4] + str r1, [r2] + ldr r0, [r0, 0x4] + str r0, [r2, 0x4] + ldr r1, _0800630C + movs r0, 0xB + str r0, [r1] + movs r0, 0xC + str r0, [r1, 0x4] + ldr r0, _08006310 + movs r4, 0 + movs r3, 0 + adds r2, r0, 0 + adds r2, 0x46 + adds r0, 0x4 + movs r1, 0x3 +_08006264: + strh r3, [r0] + strh r3, [r0, 0x4] + strb r4, [r2] + adds r2, 0x48 + adds r0, 0x48 + subs r1, 0x1 + cmp r1, 0 + bge _08006264 + ldr r1, _08006314 + movs r0, 0 + strh r0, [r1] + movs r3, 0 + ldr r0, _08006318 + mov r9, r0 + ldr r1, _0800631C + mov r10, r1 + ldr r7, _08006320 + ldr r2, _08006324 + mov r8, r2 + movs r0, 0x80 + lsls r0, 4 + adds r6, r7, r0 + ldr r4, _08006328 + movs r5, 0 + mov r12, r6 +_08006296: + lsls r0, r3, 6 + adds r2, r0, r7 + mov r1, r8 + strh r1, [r2] + adds r1, r0, r6 + strh r4, [r1] + adds r3, 0x1 + add r0, r12 + adds r0, 0x2 + adds r2, 0x2 + movs r1, 0x1E +_080062AC: + strh r5, [r2] + strh r4, [r0] + adds r0, 0x2 + adds r2, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _080062AC + cmp r3, 0x13 + ble _08006296 + movs r1, 0 + movs r0, 0x1 + mov r2, r9 + strb r0, [r2] + ldr r0, _0800632C + mov r2, r10 + str r0, [r2] + ldr r0, _08006330 + str r1, [r0] + ldr r2, _08006334 + strb r1, [r2] + movs r0, 0x1 + ldr r1, _08006338 + str r0, [r1] + movs r0, 0x14 + ldr r2, _0800633C + str r0, [r2] + movs r0, 0 + bl xxx_update_some_bg_tiles + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080062F4: .4byte gUnknown_20274AC +_080062F8: .4byte gUnknown_80B87B4 +_080062FC: .4byte gUnknown_8300500 +_08006300: .4byte gUnknown_202AFB4 +_08006304: .4byte gUnknown_80B87BC +_08006308: .4byte gUnknown_2027490 +_0800630C: .4byte gUnknown_202B028 +_08006310: .4byte gUnknown_2027370 +_08006314: .4byte gUnknown_2027498 +_08006318: .4byte gUnknown_202B034 +_0800631C: .4byte gUnknown_202B030 +_08006320: .4byte gUnknown_202B038 +_08006324: .4byte 0x0000f279 +_08006328: .4byte 0x0000f27a +_0800632C: .4byte 0x88888888 +_08006330: .4byte gUnknown_203B078 +_08006334: .4byte gUnknown_20274A5 +_08006338: .4byte gUnknown_202B020 +_0800633C: .4byte gUnknown_202B024 + thumb_func_end sub_8006218 + + thumb_func_start xxx_update_some_bg_tiles +xxx_update_some_bg_tiles: + push {r4,r5,lr} + adds r1, r0, 0 + ldr r0, _08006360 + ldr r5, [r0] + ldr r4, _08006364 + str r1, [r0] + cmp r1, 0 + beq _08006354 + cmp r1, 0x2 + bne _0800636C +_08006354: + movs r0, 0x2 + bl sub_800CDA8 + ldr r2, _08006368 + b _08006374 + .align 2, 0 +_08006360: .4byte gUnknown_20274B0 +_08006364: .4byte 0x06004f40 +_08006368: .4byte gUnknown_80B87C4 +_0800636C: + movs r0, 0x1 + bl sub_800CDA8 + ldr r2, _080063A4 +_08006374: + ldr r1, _080063A8 + ldr r0, _080063AC + str r0, [r1] + ldm r2!, {r0} + stm r4!, {r0} + ldm r2!, {r0} + stm r4!, {r0} + ldm r2!, {r0} + stm r4!, {r0} + ldm r2!, {r0} + stm r4!, {r0} + ldm r2!, {r0} + stm r4!, {r0} + ldm r2!, {r0} + stm r4!, {r0} + ldm r2!, {r0} + stm r4!, {r0} + ldr r0, [r2] + str r0, [r4] + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080063A4: .4byte gUnknown_80B87E4 +_080063A8: .4byte gUnknown_202B030 +_080063AC: .4byte 0x88888888 + thumb_func_end xxx_update_some_bg_tiles + + thumb_func_start sub_80063B0 +sub_80063B0: + ldr r0, _080063B8 + ldr r0, [r0] + bx lr + .align 2, 0 +_080063B8: .4byte gUnknown_20274B0 + thumb_func_end sub_80063B0 + + thumb_func_start sub_80063BC +sub_80063BC: + ldr r1, _080063C8 + ldrb r2, [r1] + strb r0, [r1] + adds r0, r2, 0 + bx lr + .align 2, 0 +_080063C8: .4byte gUnknown_202B034 + thumb_func_end sub_80063BC + + thumb_func_start sub_80063CC +sub_80063CC: + ldr r1, _080063D4 + str r0, [r1] + bx lr + .align 2, 0 +_080063D4: .4byte gUnknown_20274AC + thumb_func_end sub_80063CC + + thumb_func_start sub_80063D8 +sub_80063D8: + push {lr} + adds r1, r0, 0 + cmp r1, 0 + bne _080063F0 + ldr r0, _080063E8 + ldr r0, [r0] + ldr r2, _080063EC + b _08006410 + .align 2, 0 +_080063E8: .4byte gUnknown_20274B0 +_080063EC: .4byte 0x88888888 +_080063F0: + movs r0, 0xF + ands r0, r1 + lsls r2, r0, 4 + orrs r2, r0 + lsls r1, r0, 8 + orrs r2, r1 + lsls r1, r0, 12 + orrs r2, r1 + lsls r1, r0, 16 + orrs r2, r1 + lsls r1, r0, 20 + orrs r2, r1 + lsls r1, r0, 24 + orrs r2, r1 + lsls r0, 28 + orrs r2, r0 +_08006410: + ldr r0, _08006418 + str r2, [r0] + pop {r0} + bx r0 + .align 2, 0 +_08006418: .4byte gUnknown_202B030 + thumb_func_end sub_80063D8 + + thumb_func_start sub_800641C +sub_800641C: + push {lr} + sub sp, 0x4 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + movs r3, 0 + str r3, [sp] + mov r3, sp + bl sub_8006438 + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_800641C + + thumb_func_start sub_8006438 +sub_8006438: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + adds r4, r0, 0 + mov r8, r3 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0x2 + mov r9, r0 + cmp r4, 0 + bne _0800645C + ldr r4, _080064F0 +_0800645C: + cmp r2, 0 + beq _08006464 + bl sub_8009388 +_08006464: + bl sub_800898C + movs r6, 0 + adds r5, r4, 0 + adds r5, 0xC + ldr r1, _080064F4 + str r1, [sp, 0x18] +_08006472: + ldr r0, [sp, 0x18] + adds r1, r4, 0 + ldm r1!, {r2,r3,r7} + stm r0!, {r2,r3,r7} + ldm r1!, {r2,r3,r7} + stm r0!, {r2,r3,r7} + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _080064C4 + ldr r1, _080064F8 + lsls r0, r6, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [sp] + str r4, [sp, 0x4] + mov r2, r10 + str r2, [sp, 0x8] + mov r3, r9 + str r3, [sp, 0xC] + mov r7, r8 + str r7, [sp, 0x10] + movs r0, 0 + str r0, [sp, 0x14] + ldr r0, _080064FC + movs r1, 0xC0 + lsls r1, 19 + ldr r2, _08006500 + ldr r3, _08006504 + bl sub_8006554 + adds r0, r4, 0 + mov r1, r8 + bl sub_80089AC + movs r0, 0 + ldrsh r1, [r5, r0] + movs r2, 0x4 + ldrsh r0, [r5, r2] + muls r0, r1 + add r9, r0 +_080064C4: + adds r5, 0x18 + adds r4, 0x18 + ldr r3, [sp, 0x18] + adds r3, 0x18 + str r3, [sp, 0x18] + adds r6, 0x1 + cmp r6, 0x3 + ble _08006472 + ldr r2, _08006508 + ldr r0, _0800650C + ldr r1, _08006510 + str r0, [r2] + movs r0, 0x1 + strb r0, [r1] + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080064F0: .4byte gUnknown_80B857C +_080064F4: .4byte gUnknown_202AFC0 +_080064F8: .4byte gUnknown_80B8804 +_080064FC: .4byte gUnknown_2027370 +_08006500: .4byte gUnknown_20274B4 +_08006504: .4byte gUnknown_202B038 +_08006508: .4byte gUnknown_203B078 +_0800650C: .4byte gUnknown_3000E94 +_08006510: .4byte gUnknown_20274A5 + thumb_func_end sub_8006438 + + thumb_func_start nullsub_152 +nullsub_152: + bx lr + thumb_func_end nullsub_152 + + thumb_func_start sub_8006518 +sub_8006518: + push {r4-r7,lr} + ldr r4, _0800653C + adds r2, r0, 0 + movs r3, 0x3 +_08006520: + adds r1, r2, 0 + adds r0, r4, 0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r4, 0x18 + adds r2, 0x18 + subs r3, 0x1 + cmp r3, 0 + bge _08006520 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0800653C: .4byte gUnknown_202AFC0 + thumb_func_end sub_8006518 + + thumb_func_start nullsub_153 +nullsub_153: + bx lr + thumb_func_end nullsub_153 + + thumb_func_start sub_8006544 +sub_8006544: + ldr r1, _08006550 + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bx lr + .align 2, 0 +_08006550: .4byte gUnknown_80B8814 + thumb_func_end sub_8006544 + + thumb_func_start sub_8006554 +sub_8006554: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + str r0, [sp, 0x4] + adds r7, r1, 0 + adds r6, r2, 0 + str r3, [sp, 0x8] + ldr r1, [sp, 0x4C] + ldr r3, [sp, 0x50] + ldr r2, [sp, 0x54] + ldr r0, [sp, 0x58] + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0xC] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x10] + ldr r1, [sp, 0x44] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 3 + ldr r4, [sp, 0x4] + adds r5, r4, r0 + ldr r0, [sp, 0x48] + movs r4, 0x8 + ldrsh r1, [r0, r4] + movs r4, 0 + ldrsh r0, [r2, r4] + adds r1, r0 + str r1, [sp, 0x14] + ldr r0, [sp, 0x48] + movs r4, 0xA + ldrsh r1, [r0, r4] + movs r4, 0x2 + ldrsh r0, [r2, r4] + adds r4, r1, r0 + mov r0, sp + ldrh r0, [r0, 0x14] + strh r0, [r5] + strh r4, [r5, 0x2] + ldr r1, [sp, 0x48] + ldrh r0, [r1, 0xC] + strh r0, [r5, 0x4] + ldrh r0, [r1, 0x10] + strh r0, [r5, 0x8] + ldrh r0, [r1, 0xE] + strh r0, [r5, 0x6] + ldr r0, [r1, 0x4] + str r0, [r5, 0xC] + str r3, [r5, 0x10] + cmp r0, 0x6 + bne _080065C6 + str r3, [r5, 0x14] + b _080065D6 +_080065C6: + ldr r2, [sp, 0x48] + movs r0, 0x12 + ldrsh r1, [r2, r0] + movs r2, 0x4 + ldrsh r0, [r5, r2] + muls r0, r1 + adds r0, r3, r0 + str r0, [r5, 0x14] +_080065D6: + ldr r0, [r5, 0x10] + lsls r0, 5 + adds r0, r6, r0 + str r0, [r5, 0x18] + ldr r0, [r5, 0x14] + lsls r0, 5 + adds r1, r6, r0 + str r1, [r5, 0x1C] + ldr r3, [sp, 0x48] + movs r6, 0x12 + ldrsh r1, [r3, r6] + str r1, [r5, 0x24] + adds r0, r7, r0 + str r0, [r5, 0x28] + ldr r3, [r5, 0xC] + cmp r3, 0x6 + bne _0800660C + movs r7, 0x4 + ldrsh r2, [r5, r7] + movs r1, 0x6 + ldrsh r0, [r5, r1] + ldr r6, [sp, 0x48] + movs r7, 0x12 + ldrsh r1, [r6, r7] + adds r0, r1 + muls r0, r2 + b _08006616 +_0800660C: + movs r0, 0x4 + ldrsh r1, [r5, r0] + movs r2, 0x6 + ldrsh r0, [r5, r2] + muls r0, r1 +_08006616: + lsls r0, 5 + str r0, [r5, 0x2C] + movs r0, 0 + str r0, [r5, 0x30] + str r0, [r5, 0x34] + str r0, [r5, 0x38] + movs r6, 0x4 + ldrsh r0, [r5, r6] + lsls r0, 3 + subs r0, 0x8 + str r0, [r5, 0x20] + movs r1, 0 + cmp r3, 0 + bne _08006634 + movs r1, 0x1 +_08006634: + adds r0, r5, 0 + adds r0, 0x45 + strb r1, [r0] + movs r7, 0x8 + ldrsh r0, [r5, r7] + cmp r0, 0 + bne _08006644 + b _0800676C +_08006644: + ldr r0, [sp, 0x48] + ldrb r1, [r0] + movs r0, 0xA0 + ands r0, r1 + adds r1, r5, 0 + adds r1, 0x46 + str r1, [sp, 0x1C] + cmp r0, 0x80 + beq _08006752 + subs r7, r4, 0x1 + ldr r0, [r5, 0xC] + cmp r0, 0x6 + bne _080066A8 + movs r2, 0 + mov r8, r2 + ldr r3, [sp, 0xC] + cmp r3, 0 + beq _0800666C + ldr r6, [r5, 0x14] + mov r8, r6 +_0800666C: + ldr r0, [sp, 0x48] + ldr r3, [r0, 0x14] + ldr r1, [sp, 0x8] + str r1, [sp] + adds r0, r5, 0 + adds r1, r7, 0 + mov r2, r8 + bl sub_8006E94 + adds r7, r4, 0x2 + ldr r2, [sp, 0xC] + cmp r2, 0 + beq _0800669A + movs r3, 0x4 + ldrsh r1, [r5, r3] + ldr r4, [sp, 0x48] + movs r6, 0x12 + ldrsh r0, [r4, r6] + adds r0, 0x2 + muls r1, r0 + ldr r0, [r5, 0x14] + adds r0, r1 + b _0800669C +_0800669A: + movs r0, 0 +_0800669C: + mov r8, r0 + movs r1, 0x6 + ldrsh r0, [r5, r1] + subs r0, 0x2 + str r0, [sp, 0x18] + b _080066CA +_080066A8: + adds r0, r5, 0 + adds r1, r7, 0 + ldr r2, [sp, 0x8] + ldr r3, [sp, 0x10] + bl sub_800677C + adds r7, r4, 0 + movs r2, 0 + mov r8, r2 + ldr r3, [sp, 0xC] + cmp r3, 0 + beq _080066C4 + ldr r4, [r5, 0x14] + mov r8, r4 +_080066C4: + movs r0, 0x6 + ldrsh r6, [r5, r0] + str r6, [sp, 0x18] +_080066CA: + movs r1, 0 + mov r9, r1 + adds r2, r5, 0 + adds r2, 0x46 + str r2, [sp, 0x1C] + ldr r3, [sp, 0x18] + cmp r9, r3 + bge _08006746 +_080066DA: + ldr r4, [sp, 0x14] + subs r4, 0x1 + ldr r6, [sp, 0x8] + str r6, [sp] + adds r0, r5, 0 + adds r1, r4, 0 + adds r2, r7, 0 + mov r3, r9 + bl sub_80069CC + ldr r4, [sp, 0x14] + movs r6, 0 + movs r1, 0x4 + ldrsh r0, [r5, r1] + adds r2, r7, 0x1 + mov r10, r2 + mov r3, r9 + adds r3, 0x1 + str r3, [sp, 0x20] + cmp r6, r0 + bge _0800672A +_08006704: + ldr r0, [sp, 0x8] + str r0, [sp] + adds r0, r5, 0 + adds r1, r4, 0 + adds r2, r7, 0 + mov r3, r8 + bl sub_8006AC4 + adds r4, 0x1 + ldr r1, [sp, 0xC] + cmp r1, 0 + beq _08006720 + movs r2, 0x1 + add r8, r2 +_08006720: + adds r6, 0x1 + movs r3, 0x4 + ldrsh r0, [r5, r3] + cmp r6, r0 + blt _08006704 +_0800672A: + ldr r6, [sp, 0x8] + str r6, [sp] + adds r0, r5, 0 + adds r1, r4, 0 + adds r2, r7, 0 + mov r3, r9 + bl sub_8006B70 + mov r7, r10 + ldr r0, [sp, 0x20] + mov r9, r0 + ldr r1, [sp, 0x18] + cmp r9, r1 + blt _080066DA +_08006746: + adds r0, r5, 0 + adds r1, r7, 0 + ldr r2, [sp, 0x8] + ldr r3, [sp, 0x10] + bl sub_8006C44 +_08006752: + ldr r2, [sp, 0x48] + ldrb r1, [r2] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08006766 + ldr r0, [sp, 0x4] + ldr r1, [sp, 0x44] + bl sub_8008C6C +_08006766: + movs r0, 0 + ldr r3, [sp, 0x1C] + strb r0, [r3] +_0800676C: + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8006554 + + thumb_func_start sub_800677C +sub_800677C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r6, r0, 0 + adds r4, r1, 0 + str r2, [sp] + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + movs r1, 0 + ldrsh r0, [r6, r1] + subs r3, r0, 0x1 + cmp r4, 0x1C + ble _080067A0 + b _080069AE +_080067A0: + cmp r4, 0 + bge _080067A6 + b _080069AE +_080067A6: + ldr r0, [r6, 0xC] + cmp r0, 0x7 + bls _080067AE + b _080069AE +_080067AE: + lsls r0, 2 + ldr r1, _080067B8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080067B8: .4byte _080067BC + .align 2, 0 +_080067BC: + .4byte _080069AE + .4byte _080069AE + .4byte _080069AE + .4byte _080067DC + .4byte _0800689C + .4byte _08006920 + .4byte _080069AE + .4byte _0800696C +_080067DC: + lsls r1, r3, 1 + lsls r2, r4, 6 + ldr r4, [sp] + adds r0, r2, r4 + adds r1, r0 + ldr r7, _08006800 + adds r0, r7, 0 + strh r0, [r1] + adds r5, r2, 0 + mov r0, r9 + cmp r0, 0 + beq _08006808 + movs r2, 0x80 + lsls r2, 4 + adds r1, r2 + ldr r4, _08006804 + adds r0, r4, 0 + b _08006812 + .align 2, 0 +_08006800: .4byte 0x0000f2d8 +_08006804: .4byte 0x0000f293 +_08006808: + movs r7, 0x80 + lsls r7, 4 + adds r1, r7 + ldr r2, _08006878 + adds r0, r2, 0 +_08006812: + strh r0, [r1] + adds r3, 0x1 + movs r4, 0 + movs r7, 0x4 + ldrsh r0, [r6, r7] + cmp r4, r0 + bge _08006856 + ldr r0, _0800687C + mov r8, r0 + lsls r0, r3, 1 + ldr r2, [sp] + movs r7, 0x80 + lsls r7, 4 + adds r1, r2, r7 + adds r1, r5, r1 + adds r2, r0, r1 + ldr r7, [sp] + adds r1, r5, r7 + adds r1, r0, r1 + ldr r0, _08006878 + mov r12, r0 +_0800683C: + mov r7, r8 + strh r7, [r1] + mov r0, r12 + strh r0, [r2] + adds r2, 0x2 + adds r1, 0x2 + adds r3, 0x1 + adds r4, 0x1 + movs r0, 0x4 + ldrsh r7, [r6, r0] + mov r10, r7 + cmp r4, r10 + blt _0800683C +_08006856: + lsls r0, r3, 1 + ldr r2, [sp] + adds r1, r5, r2 + adds r1, r0, r1 + ldr r4, _08006880 + adds r0, r4, 0 + strh r0, [r1] + mov r7, r9 + cmp r7, 0 + beq _08006888 + movs r0, 0x80 + lsls r0, 4 + adds r1, r0 + ldr r2, _08006884 + adds r0, r2, 0 + strh r0, [r1] + b _080069AE + .align 2, 0 +_08006878: .4byte 0x0000f2db +_0800687C: .4byte 0x0000f2d9 +_08006880: .4byte 0x0000f6d8 +_08006884: .4byte 0x0000f693 +_08006888: + movs r4, 0x80 + lsls r4, 4 + adds r1, r4 + ldr r7, _08006898 + adds r0, r7, 0 + strh r0, [r1] + b _080069AE + .align 2, 0 +_08006898: .4byte 0x0000f2db +_0800689C: + lsls r1, r3, 1 + lsls r2, r4, 6 + ldr r0, [sp] + adds r0, r2 + mov r12, r0 + add r1, r12 + ldr r4, _08006910 + adds r0, r4, 0 + strh r0, [r1] + movs r7, 0x80 + lsls r7, 4 + mov r8, r7 + add r1, r8 + ldr r0, _08006914 + mov r9, r0 + strh r0, [r1] + adds r3, 0x1 + movs r4, 0 + movs r1, 0x4 + ldrsh r0, [r6, r1] + adds r5, r2, 0 + cmp r4, r0 + bge _080068F6 + ldr r2, _08006918 + mov r10, r2 + lsls r1, r3, 1 + ldr r0, [sp] + add r0, r8 + adds r0, r5, r0 + adds r2, r1, r0 + add r1, r12 + mov r12, r9 +_080068DC: + mov r7, r10 + strh r7, [r1] + mov r0, r12 + strh r0, [r2] + adds r2, 0x2 + adds r1, 0x2 + adds r3, 0x1 + adds r4, 0x1 + movs r0, 0x4 + ldrsh r7, [r6, r0] + mov r8, r7 + cmp r4, r8 + blt _080068DC +_080068F6: + lsls r0, r3, 1 + ldr r2, [sp] + adds r1, r5, r2 + adds r0, r1 + ldr r4, _0800691C + adds r1, r4, 0 + strh r1, [r0] + movs r7, 0x80 + lsls r7, 4 + adds r0, r7 + ldr r2, _08006914 + adds r1, r2, 0 + b _080069AC + .align 2, 0 +_08006910: .4byte 0x0000f2e8 +_08006914: .4byte 0x0000f2db +_08006918: .4byte 0x0000f2e9 +_0800691C: .4byte 0x0000f6e8 +_08006920: + lsls r0, r3, 1 + lsls r2, r4, 6 + ldr r4, [sp] + adds r4, r2 + mov r12, r4 + add r0, r12 + ldr r7, _08006960 + adds r1, r7, 0 + strh r1, [r0] + adds r3, 0x1 + movs r1, 0x4 + ldrsh r0, [r6, r1] + adds r5, r2, 0 + cmp r0, 0 + ble _08006954 + ldr r2, _08006964 + adds r1, r2, 0 + adds r4, r0, 0 + lsls r0, r3, 1 + add r0, r12 +_08006948: + strh r1, [r0] + adds r0, 0x2 + adds r3, 0x1 + subs r4, 0x1 + cmp r4, 0 + bne _08006948 +_08006954: + lsls r0, r3, 1 + ldr r4, [sp] + adds r1, r5, r4 + adds r0, r1 + ldr r7, _08006968 + b _080069AA + .align 2, 0 +_08006960: .4byte 0x0000f2dc +_08006964: .4byte 0x0000f2dd +_08006968: .4byte 0x0000f6dc +_0800696C: + lsls r0, r3, 1 + lsls r2, r4, 6 + ldr r1, [sp] + adds r1, r2 + mov r12, r1 + add r0, r12 + ldr r4, _080069C0 + adds r1, r4, 0 + strh r1, [r0] + adds r3, 0x1 + movs r7, 0x4 + ldrsh r0, [r6, r7] + adds r5, r2, 0 + cmp r0, 0 + ble _080069A0 + ldr r2, _080069C4 + adds r1, r2, 0 + adds r4, r0, 0 + lsls r0, r3, 1 + add r0, r12 +_08006994: + strh r1, [r0] + adds r0, 0x2 + adds r3, 0x1 + subs r4, 0x1 + cmp r4, 0 + bne _08006994 +_080069A0: + lsls r0, r3, 1 + ldr r4, [sp] + adds r1, r5, r4 + adds r0, r1 + ldr r7, _080069C8 +_080069AA: + adds r1, r7, 0 +_080069AC: + strh r1, [r0] +_080069AE: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080069C0: .4byte 0x0000f293 +_080069C4: .4byte 0x0000f297 +_080069C8: .4byte 0x0000f693 + thumb_func_end sub_800677C + + thumb_func_start sub_80069CC +sub_80069CC: + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + adds r5, r3, 0 + ldr r3, [sp, 0x10] + cmp r2, 0x1C + bgt _08006ABA + cmp r2, 0 + blt _08006ABA + ldr r0, [r6, 0xC] + cmp r0, 0x7 + bhi _08006ABA + lsls r0, 2 + ldr r1, _080069F0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080069F0: .4byte _080069F4 + .align 2, 0 +_080069F4: + .4byte _08006A14 + .4byte _08006ABA + .4byte _08006ABA + .4byte _08006A60 + .4byte _08006A7C + .4byte _08006A9C + .4byte _08006A60 + .4byte _08006AAC +_08006A14: + cmp r5, 0 + bne _08006A34 + lsls r1, r4, 1 + lsls r0, r2, 6 + adds r0, r3 + adds r1, r0 + ldr r2, _08006A30 + adds r0, r2, 0 + strh r0, [r1] + movs r0, 0x80 + lsls r0, 4 + adds r1, r0 + adds r2, 0x44 + b _08006A92 + .align 2, 0 +_08006A30: .4byte 0x0000f297 +_08006A34: + movs r1, 0x6 + ldrsh r0, [r6, r1] + subs r0, 0x1 + cmp r5, r0 + bne _08006A60 + lsls r1, r4, 1 + lsls r0, r2, 6 + adds r0, r3 + adds r1, r0 + ldr r2, _08006A58 + adds r0, r2, 0 + strh r0, [r1] + movs r0, 0x80 + lsls r0, 4 + adds r1, r0 + ldr r2, _08006A5C + b _08006A92 + .align 2, 0 +_08006A58: .4byte 0x0000fa97 +_08006A5C: .4byte 0x0000f2db +_08006A60: + lsls r1, r4, 1 + lsls r0, r2, 6 + adds r0, r3 + adds r1, r0 + ldr r2, _08006A78 + adds r0, r2, 0 + strh r0, [r1] + movs r0, 0x80 + lsls r0, 4 + adds r1, r0 + adds r2, 0x1 + b _08006A92 + .align 2, 0 +_08006A78: .4byte 0x0000f2da +_08006A7C: + lsls r1, r4, 1 + lsls r0, r2, 6 + adds r0, r3 + adds r1, r0 + ldr r2, _08006A98 + adds r0, r2, 0 + strh r0, [r1] + movs r0, 0x80 + lsls r0, 4 + adds r1, r0 + subs r2, 0xF +_08006A92: + adds r0, r2, 0 + strh r0, [r1] + b _08006ABA + .align 2, 0 +_08006A98: .4byte 0x0000f2ea +_08006A9C: + lsls r0, r4, 1 + lsls r1, r2, 6 + adds r1, r3 + adds r0, r1 + ldr r2, _08006AA8 + b _08006AB6 + .align 2, 0 +_08006AA8: .4byte 0x0000f2de +_08006AAC: + lsls r0, r4, 1 + lsls r1, r2, 6 + adds r1, r3 + adds r0, r1 + ldr r2, _08006AC0 +_08006AB6: + adds r1, r2, 0 + strh r1, [r0] +_08006ABA: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08006AC0: .4byte 0x0000f2b6 + thumb_func_end sub_80069CC + + thumb_func_start sub_8006AC4 +sub_8006AC4: + push {r4,r5,lr} + adds r4, r1, 0 + ldr r5, [sp, 0xC] + cmp r2, 0x1C + bgt _08006B64 + cmp r2, 0 + blt _08006B64 + ldr r0, [r0, 0xC] + cmp r0, 0x7 + bhi _08006B64 + lsls r0, 2 + ldr r1, _08006AE4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08006AE4: .4byte _08006AE8 + .align 2, 0 +_08006AE8: + .4byte _08006B2C + .4byte _08006B2C + .4byte _08006B08 + .4byte _08006B2C + .4byte _08006B2C + .4byte _08006B54 + .4byte _08006B2C + .4byte _08006B54 +_08006B08: + lsls r1, r4, 1 + lsls r0, r2, 6 + adds r0, r5 + adds r1, r0 + ldr r2, _08006B24 + adds r0, r2, 0 + orrs r3, r0 + strh r3, [r1] + movs r0, 0x80 + lsls r0, 4 + adds r1, r0 + ldr r2, _08006B28 + b _08006B44 + .align 2, 0 +_08006B24: .4byte 0xfffff000 +_08006B28: .4byte 0x0000f278 +_08006B2C: + lsls r1, r4, 1 + lsls r0, r2, 6 + adds r0, r5 + adds r1, r0 + ldr r2, _08006B4C + adds r0, r2, 0 + orrs r3, r0 + strh r3, [r1] + movs r0, 0x80 + lsls r0, 4 + adds r1, r0 + ldr r2, _08006B50 +_08006B44: + adds r0, r2, 0 + strh r0, [r1] + b _08006B64 + .align 2, 0 +_08006B4C: .4byte 0xfffff000 +_08006B50: .4byte 0x0000f2db +_08006B54: + lsls r0, r4, 1 + lsls r1, r2, 6 + adds r1, r5 + adds r0, r1 + ldr r2, _08006B6C + adds r1, r2, 0 + orrs r3, r1 + strh r3, [r0] +_08006B64: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08006B6C: .4byte 0xfffff000 + thumb_func_end sub_8006AC4 + + thumb_func_start sub_8006B70 +sub_8006B70: + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + adds r5, r3, 0 + ldr r3, [sp, 0x10] + cmp r2, 0x1C + bgt _08006C3A + cmp r2, 0 + blt _08006C3A + ldr r0, [r6, 0xC] + cmp r0, 0x7 + bhi _08006C3A + lsls r0, 2 + ldr r1, _08006B94 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08006B94: .4byte _08006B98 + .align 2, 0 +_08006B98: + .4byte _08006BB8 + .4byte _08006C3A + .4byte _08006C3A + .4byte _08006BE8 + .4byte _08006BF8 + .4byte _08006C1C + .4byte _08006BE8 + .4byte _08006C2C +_08006BB8: + cmp r5, 0 + bne _08006BCC + lsls r1, r4, 1 + lsls r0, r2, 6 + adds r0, r3 + adds r1, r0 + ldr r2, _08006BC8 + b _08006C02 + .align 2, 0 +_08006BC8: .4byte 0x0000f697 +_08006BCC: + movs r1, 0x6 + ldrsh r0, [r6, r1] + subs r0, 0x1 + cmp r5, r0 + bne _08006BE8 + lsls r1, r4, 1 + lsls r0, r2, 6 + adds r0, r3 + adds r1, r0 + ldr r2, _08006BE4 + b _08006C02 + .align 2, 0 +_08006BE4: .4byte 0x0000fe97 +_08006BE8: + lsls r1, r4, 1 + lsls r0, r2, 6 + adds r0, r3 + adds r1, r0 + ldr r2, _08006BF4 + b _08006C02 + .align 2, 0 +_08006BF4: .4byte 0x0000f6da +_08006BF8: + lsls r1, r4, 1 + lsls r0, r2, 6 + adds r0, r3 + adds r1, r0 + ldr r2, _08006C14 +_08006C02: + adds r0, r2, 0 + strh r0, [r1] + movs r0, 0x80 + lsls r0, 4 + adds r1, r0 + ldr r2, _08006C18 + adds r0, r2, 0 + strh r0, [r1] + b _08006C3A + .align 2, 0 +_08006C14: .4byte 0x0000f6ea +_08006C18: .4byte 0x0000f2db +_08006C1C: + lsls r0, r4, 1 + lsls r1, r2, 6 + adds r1, r3 + adds r0, r1 + ldr r2, _08006C28 + b _08006C36 + .align 2, 0 +_08006C28: .4byte 0x0000f6de +_08006C2C: + lsls r0, r4, 1 + lsls r1, r2, 6 + adds r1, r3 + adds r0, r1 + ldr r2, _08006C40 +_08006C36: + adds r1, r2, 0 + strh r1, [r0] +_08006C3A: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08006C40: .4byte 0x0000f6b6 + thumb_func_end sub_8006B70 + + thumb_func_start sub_8006C44 +sub_8006C44: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r6, r0, 0 + adds r4, r1, 0 + str r2, [sp] + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + movs r1, 0 + ldrsh r0, [r6, r1] + subs r3, r0, 0x1 + cmp r4, 0x1C + ble _08006C68 + b _08006E76 +_08006C68: + cmp r4, 0 + bge _08006C6E + b _08006E76 +_08006C6E: + ldr r0, [r6, 0xC] + cmp r0, 0x7 + bls _08006C76 + b _08006E76 +_08006C76: + lsls r0, 2 + ldr r1, _08006C80 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08006C80: .4byte _08006C84 + .align 2, 0 +_08006C84: + .4byte _08006E76 + .4byte _08006E76 + .4byte _08006E76 + .4byte _08006CA4 + .4byte _08006D64 + .4byte _08006DE8 + .4byte _08006CA4 + .4byte _08006E34 +_08006CA4: + lsls r1, r3, 1 + lsls r2, r4, 6 + ldr r4, [sp] + adds r0, r2, r4 + adds r1, r0 + ldr r7, _08006CC8 + adds r0, r7, 0 + strh r0, [r1] + adds r5, r2, 0 + mov r0, r9 + cmp r0, 0 + beq _08006CD0 + movs r2, 0x80 + lsls r2, 4 + adds r1, r2 + ldr r4, _08006CCC + adds r0, r4, 0 + b _08006CDA + .align 2, 0 +_08006CC8: .4byte 0x0000fad8 +_08006CCC: .4byte 0x0000fa93 +_08006CD0: + movs r7, 0x80 + lsls r7, 4 + adds r1, r7 + ldr r2, _08006D40 + adds r0, r2, 0 +_08006CDA: + strh r0, [r1] + adds r3, 0x1 + movs r4, 0 + movs r7, 0x4 + ldrsh r0, [r6, r7] + cmp r4, r0 + bge _08006D1E + ldr r0, _08006D44 + mov r8, r0 + lsls r0, r3, 1 + ldr r2, [sp] + movs r7, 0x80 + lsls r7, 4 + adds r1, r2, r7 + adds r1, r5, r1 + adds r2, r0, r1 + ldr r7, [sp] + adds r1, r5, r7 + adds r1, r0, r1 + ldr r0, _08006D40 + mov r12, r0 +_08006D04: + mov r7, r8 + strh r7, [r1] + mov r0, r12 + strh r0, [r2] + adds r2, 0x2 + adds r1, 0x2 + adds r3, 0x1 + adds r4, 0x1 + movs r0, 0x4 + ldrsh r7, [r6, r0] + mov r10, r7 + cmp r4, r10 + blt _08006D04 +_08006D1E: + lsls r0, r3, 1 + ldr r2, [sp] + adds r1, r5, r2 + adds r1, r0, r1 + ldr r4, _08006D48 + adds r0, r4, 0 + strh r0, [r1] + mov r7, r9 + cmp r7, 0 + beq _08006D50 + movs r0, 0x80 + lsls r0, 4 + adds r1, r0 + ldr r2, _08006D4C + adds r0, r2, 0 + strh r0, [r1] + b _08006E76 + .align 2, 0 +_08006D40: .4byte 0x0000f2db +_08006D44: .4byte 0x0000fad9 +_08006D48: .4byte 0x0000fed8 +_08006D4C: .4byte 0x0000fe93 +_08006D50: + movs r4, 0x80 + lsls r4, 4 + adds r1, r4 + ldr r7, _08006D60 + adds r0, r7, 0 + strh r0, [r1] + b _08006E76 + .align 2, 0 +_08006D60: .4byte 0x0000f2db +_08006D64: + lsls r1, r3, 1 + lsls r2, r4, 6 + ldr r0, [sp] + adds r0, r2 + mov r12, r0 + add r1, r12 + ldr r4, _08006DD8 + adds r0, r4, 0 + strh r0, [r1] + movs r7, 0x80 + lsls r7, 4 + mov r8, r7 + add r1, r8 + ldr r0, _08006DDC + mov r9, r0 + strh r0, [r1] + adds r3, 0x1 + movs r4, 0 + movs r1, 0x4 + ldrsh r0, [r6, r1] + adds r5, r2, 0 + cmp r4, r0 + bge _08006DBE + ldr r2, _08006DE0 + mov r10, r2 + lsls r1, r3, 1 + ldr r0, [sp] + add r0, r8 + adds r0, r5, r0 + adds r2, r1, r0 + add r1, r12 + mov r12, r9 +_08006DA4: + mov r7, r10 + strh r7, [r1] + mov r0, r12 + strh r0, [r2] + adds r2, 0x2 + adds r1, 0x2 + adds r3, 0x1 + adds r4, 0x1 + movs r0, 0x4 + ldrsh r7, [r6, r0] + mov r8, r7 + cmp r4, r8 + blt _08006DA4 +_08006DBE: + lsls r0, r3, 1 + ldr r2, [sp] + adds r1, r5, r2 + adds r0, r1 + ldr r4, _08006DE4 + adds r1, r4, 0 + strh r1, [r0] + movs r7, 0x80 + lsls r7, 4 + adds r0, r7 + ldr r2, _08006DDC + adds r1, r2, 0 + b _08006E74 + .align 2, 0 +_08006DD8: .4byte 0x0000fae8 +_08006DDC: .4byte 0x0000f2db +_08006DE0: .4byte 0x0000fae9 +_08006DE4: .4byte 0x0000fee8 +_08006DE8: + lsls r0, r3, 1 + lsls r2, r4, 6 + ldr r4, [sp] + adds r4, r2 + mov r12, r4 + add r0, r12 + ldr r7, _08006E28 + adds r1, r7, 0 + strh r1, [r0] + adds r3, 0x1 + movs r1, 0x4 + ldrsh r0, [r6, r1] + adds r5, r2, 0 + cmp r0, 0 + ble _08006E1C + ldr r2, _08006E2C + adds r1, r2, 0 + adds r4, r0, 0 + lsls r0, r3, 1 + add r0, r12 +_08006E10: + strh r1, [r0] + adds r0, 0x2 + adds r3, 0x1 + subs r4, 0x1 + cmp r4, 0 + bne _08006E10 +_08006E1C: + lsls r0, r3, 1 + ldr r4, [sp] + adds r1, r5, r4 + adds r0, r1 + ldr r7, _08006E30 + b _08006E72 + .align 2, 0 +_08006E28: .4byte 0x0000fadc +_08006E2C: .4byte 0x0000fadd +_08006E30: .4byte 0x0000fedc +_08006E34: + lsls r0, r3, 1 + lsls r2, r4, 6 + ldr r1, [sp] + adds r1, r2 + mov r12, r1 + add r0, r12 + ldr r4, _08006E88 + adds r1, r4, 0 + strh r1, [r0] + adds r3, 0x1 + movs r7, 0x4 + ldrsh r0, [r6, r7] + adds r5, r2, 0 + cmp r0, 0 + ble _08006E68 + ldr r2, _08006E8C + adds r1, r2, 0 + adds r4, r0, 0 + lsls r0, r3, 1 + add r0, r12 +_08006E5C: + strh r1, [r0] + adds r0, 0x2 + adds r3, 0x1 + subs r4, 0x1 + cmp r4, 0 + bne _08006E5C +_08006E68: + lsls r0, r3, 1 + ldr r4, [sp] + adds r1, r5, r4 + adds r0, r1 + ldr r7, _08006E90 +_08006E72: + adds r1, r7, 0 +_08006E74: + strh r1, [r0] +_08006E76: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08006E88: .4byte 0x0000fa93 +_08006E8C: .4byte 0x0000fa97 +_08006E90: .4byte 0x0000fe93 + thumb_func_end sub_8006C44 + + thumb_func_start sub_8006E94 +sub_8006E94: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x30 + str r0, [sp] + adds r4, r1, 0 + adds r7, r2, 0 + str r3, [sp, 0x4] + movs r1, 0 + ldrsh r0, [r0, r1] + mov r10, r0 + movs r2, 0x1 + negs r2, r2 + add r2, r10 + movs r3, 0 + str r3, [sp, 0x8] + cmp r4, 0x1C + ble _08006EBE + b _080072FE +_08006EBE: + cmp r4, 0 + bge _08006EC4 + b _080072FE +_08006EC4: + lsls r1, r2, 1 + lsls r4, 6 + ldr r6, [sp, 0x50] + adds r5, r4, r6 + adds r1, r5 + ldr r0, _08006F9C + adds r3, r0, 0 + strh r3, [r1] + movs r2, 0x80 + lsls r2, 4 + adds r0, r1, r2 + ldr r6, _08006FA0 + adds r2, r6, 0 + strh r2, [r0] + adds r0, r1, 0 + adds r0, 0x40 + strh r3, [r0] + movs r0, 0x84 + lsls r0, 4 + adds r0, r1, r0 + strh r2, [r0] + adds r2, r1, 0 + adds r2, 0x80 + ldr r3, _08006FA4 + adds r0, r3, 0 + strh r0, [r2] + movs r6, 0x88 + lsls r6, 4 + adds r1, r6 + ldr r2, _08006FA8 + adds r0, r2, 0 + strh r0, [r1] + mov r12, r10 + movs r3, 0 + str r4, [sp, 0x18] + ldr r4, [sp, 0x4] + ldrb r4, [r4] + cmp r3, r4 + blt _08006F14 + b _08007238 +_08006F14: + adds r2, r5, 0 + mov r5, r12 + lsls r1, r5, 1 + ldr r0, [sp, 0x50] + adds r0, 0x80 + ldr r6, [sp, 0x18] + adds r0, r6, r0 + adds r0, r1 + mov r9, r0 + ldr r0, [sp, 0x50] + adds r0, 0x40 + adds r0, r6, r0 + adds r0, r1 + mov r8, r0 + ldr r4, [sp, 0x50] + movs r5, 0x80 + lsls r5, 4 + adds r0, r4, r5 + adds r0, r6, r0 + adds r0, r1, r0 + str r0, [sp, 0x20] + movs r6, 0x84 + lsls r6, 4 + adds r0, r4, r6 + ldr r4, [sp, 0x18] + adds r0, r4, r0 + adds r0, r1 + mov r10, r0 + adds r4, r1, r2 + ldr r5, [sp, 0x18] + str r5, [sp, 0x10] + str r2, [sp, 0x1C] + str r1, [sp, 0x24] +_08006F56: + ldr r6, [sp, 0x4] + ldrb r6, [r6, 0x1] + cmp r3, r6 + bne _08006F60 + b _080070C8 +_08006F60: + ldr r0, [sp, 0x8] + cmp r0, 0 + bne _08007008 + ldr r1, [sp, 0x4] + ldrb r0, [r1, 0x3] + asrs r0, r3 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08006FB8 + movs r1, 0x1F + cmp r3, 0 + bne _08006F7C + movs r1, 0x1B +_08006F7C: + movs r2, 0x9E + lsls r2, 2 + adds r0, r1, r2 + ldr r5, _08006FAC + adds r1, r5, 0 + orrs r0, r1 + strh r0, [r4] + ldr r6, _08006FB0 + adds r0, r6, 0 + mov r1, r8 + strh r0, [r1] + ldr r5, _08006FB4 + mov r2, r9 + strh r5, [r2] + b _08006FDC + .align 2, 0 +_08006F9C: .4byte 0x0000f278 +_08006FA0: .4byte 0x0000f27a +_08006FA4: .4byte 0x0000f2d8 +_08006FA8: .4byte 0x0000f2db +_08006FAC: .4byte 0xfffff400 +_08006FB0: .4byte 0x0000f2b6 +_08006FB4: .4byte 0x0000f2d9 +_08006FB8: + movs r1, 0x6B + cmp r3, 0 + bne _08006FC0 + movs r1, 0x67 +_08006FC0: + movs r6, 0x9E + lsls r6, 2 + adds r0, r1, r6 + ldr r2, _08006FF4 + adds r1, r2, 0 + orrs r0, r1 + strh r0, [r4] + ldr r5, _08006FF8 + adds r0, r5, 0 + mov r6, r8 + strh r0, [r6] + ldr r1, _08006FFC + mov r0, r9 + strh r1, [r0] +_08006FDC: + ldr r2, _08007000 + adds r0, r2, 0 + ldr r5, [sp, 0x20] + strh r0, [r5] + ldr r0, _08007004 + mov r6, r10 + strh r0, [r6] + movs r1, 0x88 + lsls r1, 4 + adds r0, r4, r1 + adds r2, 0x61 + b _0800708E + .align 2, 0 +_08006FF4: .4byte 0xfffff400 +_08006FF8: .4byte 0x0000f2ef +_08006FFC: .4byte 0x0000f2d9 +_08007000: .4byte 0x0000f27a +_08007004: .4byte 0x0000f2db +_08007008: + ldr r5, [sp, 0x4] + ldrb r0, [r5, 0x3] + asrs r0, r3 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0800704C + ldrb r0, [r5] + subs r0, 0x1 + movs r1, 0x1F + cmp r3, r0 + bne _08007022 + movs r1, 0x1B +_08007022: + movs r6, 0x9E + lsls r6, 2 + adds r0, r1, r6 + ldr r2, _08007040 + adds r1, r2, 0 + orrs r0, r1 + strh r0, [r4] + ldr r5, _08007044 + adds r0, r5, 0 + mov r6, r8 + strh r0, [r6] + ldr r1, _08007048 + mov r0, r9 + strh r1, [r0] + b _08007076 + .align 2, 0 +_08007040: .4byte 0xfffff000 +_08007044: .4byte 0x0000f6b6 +_08007048: .4byte 0x0000f2d9 +_0800704C: + ldr r2, [sp, 0x4] + ldrb r0, [r2] + subs r0, 0x1 + movs r1, 0x6B + cmp r3, r0 + bne _0800705A + movs r1, 0x67 +_0800705A: + movs r5, 0x9E + lsls r5, 2 + adds r0, r1, r5 + ldr r6, _080070B0 + adds r1, r6, 0 + orrs r0, r1 + strh r0, [r4] + ldr r1, _080070B4 + adds r0, r1, 0 + mov r2, r8 + strh r0, [r2] + ldr r6, _080070B8 + mov r5, r9 + strh r6, [r5] +_08007076: + ldr r1, _080070BC + adds r0, r1, 0 + ldr r2, [sp, 0x20] + strh r0, [r2] + ldr r5, _080070C0 + adds r0, r5, 0 + mov r6, r10 + strh r0, [r6] + movs r1, 0x88 + lsls r1, 4 + adds r0, r4, r1 + ldr r2, _080070C4 +_0800708E: + strh r2, [r0] + movs r5, 0x2 + add r9, r5 + add r8, r5 + ldr r6, [sp, 0x20] + adds r6, 0x2 + str r6, [sp, 0x20] + add r10, r5 + adds r4, 0x2 + ldr r0, [sp, 0x24] + adds r0, 0x2 + str r0, [sp, 0x24] + movs r1, 0x1 + add r12, r1 + adds r3, 0x1 + str r3, [sp, 0x14] + b _08007226 + .align 2, 0 +_080070B0: .4byte 0xfffff000 +_080070B4: .4byte 0x0000f6ef +_080070B8: .4byte 0x0000f2d9 +_080070BC: .4byte 0x0000f27a +_080070C0: .4byte 0x0000f6db +_080070C4: .4byte 0x0000f2db +_080070C8: + movs r2, 0x1 + str r2, [sp, 0x8] + ldr r5, _08007128 + adds r0, r5, 0 + strh r0, [r4] + ldr r6, _0800712C + adds r0, r6, 0 + ldr r1, [sp, 0x20] + strh r0, [r1] + ldr r2, _08007130 + adds r0, r2, 0 + mov r5, r8 + strh r0, [r5] + ldr r0, _08007134 + mov r6, r10 + strh r0, [r6] + ldr r1, _08007138 + adds r0, r1, 0 + mov r2, r9 + strh r0, [r2] + movs r5, 0x88 + lsls r5, 4 + adds r0, r4, r5 + ldr r6, _08007134 + strh r6, [r0] + movs r0, 0x2 + add r9, r0 + add r8, r0 + ldr r1, [sp, 0x20] + adds r1, 0x2 + str r1, [sp, 0x20] + add r10, r0 + adds r4, 0x2 + ldr r2, [sp, 0x24] + adds r2, 0x2 + str r2, [sp, 0x24] + movs r5, 0x1 + add r12, r5 + cmp r7, 0 + beq _0800713C + adds r7, 0x1 + cmp r7, 0 + beq _0800713C + ldr r6, [sp] + movs r1, 0x4 + ldrsh r0, [r6, r1] + adds r2, r7, r0 + b _0800713E + .align 2, 0 +_08007128: .4byte 0x0000f2e0 +_0800712C: .4byte 0x0000f2e2 +_08007130: .4byte 0x0000f2da +_08007134: .4byte 0x0000f2db +_08007138: .4byte 0x0000f6e7 +_0800713C: + movs r2, 0 +_0800713E: + movs r5, 0 + str r5, [sp, 0xC] + adds r3, 0x1 + str r3, [sp, 0x14] + ldr r6, [sp, 0x4] + ldrb r6, [r6, 0x2] + cmp r5, r6 + bge _080071E0 + ldr r0, [sp, 0x50] + adds r0, 0x80 + ldr r1, [sp, 0x10] + adds r0, r1, r0 + ldr r3, [sp, 0x24] + adds r0, r3, r0 + str r0, [sp, 0x2C] + ldr r0, [sp, 0x50] + adds r0, 0x40 + adds r0, r1, r0 + adds r5, r3, r0 + ldr r6, [sp, 0x1C] + adds r3, r6 +_08007168: + ldr r1, _08007310 + adds r0, r1, 0 + strh r0, [r3] + movs r6, 0x80 + lsls r6, 4 + adds r6, r3, r6 + str r6, [sp, 0x28] + adds r1, 0x1 + adds r0, r1, 0 + strh r0, [r6] + adds r0, r7, 0 + ldr r6, _08007314 + orrs r0, r6 + strh r0, [r5] + movs r1, 0x84 + lsls r1, 4 + adds r0, r3, r1 + ldr r6, _08007318 + strh r6, [r0] + adds r0, r2, 0 + ldr r1, _08007314 + orrs r0, r1 + ldr r6, [sp, 0x2C] + strh r0, [r6] + movs r1, 0x88 + lsls r1, 4 + adds r0, r3, r1 + ldr r6, _08007318 + strh r6, [r0] + ldr r0, [sp, 0x2C] + adds r0, 0x2 + str r0, [sp, 0x2C] + adds r5, 0x2 + adds r3, 0x2 + movs r1, 0x2 + add r9, r1 + add r8, r1 + ldr r6, [sp, 0x20] + adds r6, 0x2 + str r6, [sp, 0x20] + add r10, r1 + adds r4, 0x2 + ldr r0, [sp, 0x24] + adds r0, 0x2 + str r0, [sp, 0x24] + movs r1, 0x1 + add r12, r1 + cmp r7, 0 + beq _080071CC + adds r7, 0x1 +_080071CC: + cmp r2, 0 + beq _080071D2 + adds r2, 0x1 +_080071D2: + ldr r6, [sp, 0xC] + adds r6, 0x1 + str r6, [sp, 0xC] + ldr r0, [sp, 0x4] + ldrb r0, [r0, 0x2] + cmp r6, r0 + blt _08007168 +_080071E0: + ldr r1, _0800731C + adds r0, r1, 0 + strh r0, [r4] + ldr r2, _08007320 + adds r0, r2, 0 + ldr r3, [sp, 0x20] + strh r0, [r3] + ldr r5, _08007324 + adds r0, r5, 0 + mov r6, r8 + strh r0, [r6] + ldr r1, _08007318 + mov r0, r10 + strh r1, [r0] + adds r2, 0x5 + adds r0, r2, 0 + mov r3, r9 + strh r0, [r3] + movs r5, 0x88 + lsls r5, 4 + adds r0, r4, r5 + strh r1, [r0] + movs r6, 0x2 + add r9, r6 + add r8, r6 + ldr r0, [sp, 0x20] + adds r0, 0x2 + str r0, [sp, 0x20] + add r10, r6 + adds r4, 0x2 + ldr r1, [sp, 0x24] + adds r1, 0x2 + str r1, [sp, 0x24] + movs r2, 0x1 + add r12, r2 +_08007226: + cmp r7, 0 + beq _0800722C + adds r7, 0x1 +_0800722C: + ldr r3, [sp, 0x14] + ldr r5, [sp, 0x4] + ldrb r5, [r5] + cmp r3, r5 + bge _08007238 + b _08006F56 +_08007238: + ldr r6, [sp] + movs r0, 0 + ldrsh r1, [r6, r0] + movs r2, 0x4 + ldrsh r0, [r6, r2] + adds r0, r1, r0 + cmp r12, r0 + bge _080072BC + ldr r3, _08007328 + adds r4, r3, 0 + mov r8, r0 + mov r5, r12 + lsls r1, r5, 1 + ldr r0, [sp, 0x50] + adds r0, 0x80 + ldr r6, [sp, 0x18] + adds r0, r6, r0 + adds r5, r1, r0 + ldr r0, [sp, 0x50] + adds r0, 0x40 + adds r0, r6, r0 + adds r3, r1, r0 + ldr r0, [sp, 0x50] + adds r6, r0 + adds r2, r1, r6 + movs r1, 0x80 + lsls r1, 4 + mov r10, r1 + movs r6, 0x84 + lsls r6, 4 + mov r9, r6 + mov r0, r8 + mov r1, r12 + subs r0, r1 + mov r12, r0 +_0800727E: + strh r4, [r2] + mov r6, r10 + adds r0, r2, r6 + ldr r1, _0800732C + strh r1, [r0] + strh r4, [r3] + mov r6, r9 + adds r0, r2, r6 + strh r1, [r0] + adds r1, 0x5F + adds r0, r1, 0 + strh r0, [r5] + movs r6, 0x88 + lsls r6, 4 + adds r1, r2, r6 + ldr r6, _08007318 + adds r0, r6, 0 + strh r0, [r1] + adds r5, 0x2 + adds r3, 0x2 + adds r2, 0x2 + movs r0, 0x1 + negs r0, r0 + add r12, r0 + cmp r7, 0 + beq _080072B4 + adds r7, 0x1 +_080072B4: + mov r1, r12 + cmp r1, 0 + bne _0800727E + mov r12, r8 +_080072BC: + mov r2, r12 + lsls r1, r2, 1 + ldr r3, [sp, 0x18] + ldr r4, [sp, 0x50] + adds r0, r3, r4 + adds r1, r0 + ldr r5, _08007328 + adds r3, r5, 0 + strh r3, [r1] + movs r6, 0x80 + lsls r6, 4 + adds r0, r1, r6 + ldr r4, _0800732C + adds r2, r4, 0 + strh r2, [r0] + adds r0, r1, 0 + adds r0, 0x40 + strh r3, [r0] + movs r5, 0x84 + lsls r5, 4 + adds r0, r1, r5 + strh r2, [r0] + adds r2, r1, 0 + adds r2, 0x80 + ldr r6, _08007330 + adds r0, r6, 0 + strh r0, [r2] + movs r0, 0x88 + lsls r0, 4 + adds r1, r0 + ldr r2, _08007318 + adds r0, r2, 0 + strh r0, [r1] +_080072FE: + add sp, 0x30 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08007310: .4byte 0x0000f2e1 +_08007314: .4byte 0xfffff000 +_08007318: .4byte 0x0000f2db +_0800731C: .4byte 0x0000f6e0 +_08007320: .4byte 0x0000f2e2 +_08007324: .4byte 0x0000f6da +_08007328: .4byte 0x0000f278 +_0800732C: .4byte 0x0000f27a +_08007330: .4byte 0x0000f6d8 + thumb_func_end sub_8006E94 + + thumb_func_start sub_8007334 +sub_8007334: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 3 + ldr r0, _080073AC + adds r3, r1, r0 + ldr r5, [r3, 0x14] + movs r0, 0x2 + ldrsh r6, [r3, r0] + movs r2, 0 + movs r1, 0x6 + ldrsh r0, [r3, r1] + cmp r2, r0 + bge _080073A0 + ldr r7, _080073B0 + mov r9, r7 +_0800735A: + movs r0, 0 + ldrsh r1, [r3, r0] + movs r4, 0 + movs r7, 0x4 + ldrsh r0, [r3, r7] + adds r7, r6, 0x1 + adds r2, 0x1 + mov r12, r2 + cmp r4, r0 + bge _08007394 + movs r0, 0xFC + lsls r0, 8 + mov r8, r0 + lsls r1, 1 + lsls r0, r6, 6 + add r0, r9 + adds r2, r1, r0 +_0800737C: + ldrh r0, [r2] + mov r1, r8 + ands r1, r0 + orrs r1, r5 + strh r1, [r2] + adds r2, 0x2 + adds r5, 0x1 + adds r4, 0x1 + movs r1, 0x4 + ldrsh r0, [r3, r1] + cmp r4, r0 + blt _0800737C +_08007394: + adds r6, r7, 0 + mov r2, r12 + movs r7, 0x6 + ldrsh r0, [r3, r7] + cmp r2, r0 + blt _0800735A +_080073A0: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080073AC: .4byte gUnknown_2027370 +_080073B0: .4byte gUnknown_202B038 + thumb_func_end sub_8007334 + + thumb_func_start nullsub_154 +nullsub_154: + bx lr + thumb_func_end nullsub_154 + + thumb_func_start sub_80073B8 +sub_80073B8: + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 3 + ldr r0, _080073D8 + adds r1, r0 + ldr r0, [r1, 0x2C] + lsrs r0, 2 + lsls r0, 2 + ldr r2, [r1, 0x1C] + adds r0, r2, r0 + str r0, [r1, 0x3C] + str r2, [r1, 0x40] + adds r1, 0x46 + movs r0, 0x1 + strb r0, [r1] + bx lr + .align 2, 0 +_080073D8: .4byte gUnknown_2027370 + thumb_func_end sub_80073B8 + + thumb_func_start nullsub_155 +nullsub_155: + bx lr + thumb_func_end nullsub_155 + + thumb_func_start sub_80073E0 +sub_80073E0: + push {r4,lr} + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 3 + ldr r0, _08007434 + adds r3, r1, r0 + adds r0, r3, 0 + adds r0, 0x44 + ldrb r4, [r0] + cmp r4, 0 + bne _08007424 + ldr r2, [r3, 0x3C] + ldr r0, [r3, 0x1C] + subs r0, r2, r0 + asrs r0, 2 + lsls r0, 2 + ldr r1, [r3, 0x28] + adds r1, r0 + str r1, [r3, 0x30] + str r2, [r3, 0x34] + ldr r0, [r3, 0x40] + subs r0, r2 + asrs r0, 2 + adds r0, 0x1 + lsls r0, 2 + str r0, [r3, 0x38] + ldr r1, [r3, 0x2C] + cmp r0, r1 + blt _0800741C + str r1, [r3, 0x38] +_0800741C: + ldr r0, [r3, 0x38] + cmp r0, 0 + bge _08007424 + str r4, [r3, 0x38] +_08007424: + adds r1, r3, 0 + adds r1, 0x46 + movs r0, 0 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08007434: .4byte gUnknown_2027370 + thumb_func_end sub_80073E0 + + thumb_func_start nullsub_156 +nullsub_156: + bx lr + thumb_func_end nullsub_156 + + thumb_func_start sub_800743C +sub_800743C: + push {r4-r6,lr} + sub sp, 0x8 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + ldr r1, [sp, 0x18] + ldr r0, _08007460 + str r3, [sp] + str r1, [sp, 0x4] + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl xxx_draw_char + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08007460: .4byte gUnknown_2027370 + thumb_func_end sub_800743C + + thumb_func_start sub_8007464 +sub_8007464: + movs r0, 0 + bx lr + thumb_func_end sub_8007464 + + thumb_func_start xxx_draw_char +xxx_draw_char: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + adds r6, r1, 0 + mov r10, r2 + adds r4, r3, 0 + ldr r2, [sp, 0x48] + ldr r3, [sp, 0x4C] + lsls r1, r3, 3 + adds r1, r3 + lsls r1, 3 + adds r5, r0, r1 + ldr r1, _080074B8 + movs r0, 0xF + ands r2, r0 + lsls r2, 2 + adds r2, r1 + ldr r2, [r2] + str r2, [sp, 0x18] + ldr r0, _080074BC + ldr r0, [r0] + cmp r0, 0x1 + bne _080074CC + cmp r4, 0x70 + beq _080074B0 + cmp r4, 0x6A + beq _080074B0 + cmp r4, 0x71 + beq _080074B0 + cmp r4, 0x79 + beq _080074B0 + cmp r4, 0x67 + bne _080074C0 +_080074B0: + movs r0, 0x2 + add r10, r0 + b _080074CC + .align 2, 0 +_080074B8: .4byte gUnknown_80B853C +_080074BC: .4byte gUnknown_20274AC +_080074C0: + ldr r0, _080074F8 + cmp r4, r0 + bne _080074CC + movs r1, 0x2 + negs r1, r1 + add r10, r1 +_080074CC: + adds r0, r4, 0 + bl sub_8008584 + str r0, [sp] + ldr r2, [r0] + str r2, [sp, 0x4] + str r2, [sp, 0xC] + adds r3, r2, 0 + subs r3, 0x6 + str r3, [sp, 0x8] + ldr r0, _080074FC + ldrb r0, [r0] + cmp r0, 0 + beq _08007500 + ldr r4, [sp] + ldrb r1, [r4, 0xA] + lsrs r7, r1, 1 + movs r0, 0x1 + adds r2, r7, 0 + ands r2, r0 + str r2, [sp, 0x1C] + b _08007508 + .align 2, 0 +_080074F8: .4byte 0x00008199 +_080074FC: .4byte gUnknown_202B034 +_08007500: + movs r3, 0 + str r3, [sp, 0x1C] + ldr r4, [sp] + ldrb r1, [r4, 0xA] +_08007508: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08007512 + b _08007670 +_08007512: + mov r0, r10 + cmp r0, 0 + bge _0800751A + adds r0, 0x7 +_0800751A: + asrs r4, r0, 3 + movs r7, 0x4 + ldrsh r0, [r5, r7] + muls r0, r4 + adds r2, r6, 0 + cmp r6, 0 + bge _0800752A + adds r2, r6, 0x7 +_0800752A: + asrs r2, 3 + adds r0, r2 + lsls r0, 5 + ldr r1, [r5, 0x18] + adds r3, r1, r0 + lsls r0, r4, 3 + mov r1, r10 + subs r0, r1, r0 + lsls r0, 2 + adds r3, r0 + lsls r0, r2, 3 + subs r0, r6, r0 + lsls r0, 4 + ldr r1, _08007664 + adds r0, r1 + mov r12, r0 + mov r9, r2 + str r4, [sp, 0x14] + movs r2, 0x8 + ldrsh r0, [r5, r2] + cmp r4, r0 + blt _08007558 + b _0800786C +_08007558: + movs r4, 0 + str r4, [sp, 0x10] + ldr r2, _08007668 + ldr r1, _0800766C + ldr r0, [r1] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + cmp r4, r0 + blt _0800756E + b _0800786C +_0800756E: + adds r4, r2, 0 +_08007570: + ldr r6, [sp, 0x4] + ldrh r0, [r6, 0x2] + lsls r2, r0, 16 + ldrh r0, [r6] + orrs r2, r0 + cmp r2, 0 + beq _080075CC + movs r7, 0x4 + ldrsh r0, [r5, r7] + cmp r9, r0 + bge _080075A6 + mov r0, r12 + ldr r1, [r0] + ands r1, r2 + ldr r0, [r0, 0x8] + lsls r1, r0 + ldr r0, [r3] + orrs r0, r1 + str r0, [r3] + ldr r0, [r5, 0x3C] + cmp r0, r3 + bls _0800759E + str r3, [r5, 0x3C] +_0800759E: + ldr r0, [r5, 0x40] + cmp r0, r3 + bcs _080075A6 + str r3, [r5, 0x40] +_080075A6: + movs r1, 0x4 + ldrsh r0, [r5, r1] + subs r0, 0x1 + cmp r9, r0 + bge _080075CC + adds r3, 0x20 + mov r6, r12 + ldr r0, [r6, 0x4] + ands r2, r0 + ldr r0, [r6, 0xC] + lsrs r2, r0 + ldr r0, [r3] + orrs r0, r2 + str r0, [r3] + ldr r0, [r5, 0x40] + cmp r0, r3 + bcs _080075CA + str r3, [r5, 0x40] +_080075CA: + subs r3, 0x20 +_080075CC: + ldr r7, [sp, 0x4] + ldrh r2, [r7, 0x4] + cmp r2, 0 + beq _08007620 + movs r1, 0x4 + ldrsh r0, [r5, r1] + subs r0, 0x1 + cmp r9, r0 + bge _080075FA + adds r3, 0x20 + mov r6, r12 + ldr r1, [r6] + ands r1, r2 + ldr r0, [r6, 0x8] + lsls r1, r0 + ldr r0, [r3] + orrs r0, r1 + str r0, [r3] + ldr r0, [r5, 0x40] + cmp r0, r3 + bcs _080075F8 + str r3, [r5, 0x40] +_080075F8: + subs r3, 0x20 +_080075FA: + movs r7, 0x4 + ldrsh r0, [r5, r7] + subs r0, 0x2 + cmp r9, r0 + bge _08007620 + adds r3, 0x40 + mov r1, r12 + ldr r0, [r1, 0x4] + ands r2, r0 + ldr r0, [r1, 0xC] + lsrs r2, r0 + ldr r0, [r3] + orrs r0, r2 + str r0, [r3] + ldr r0, [r5, 0x40] + cmp r0, r3 + bcs _0800761E + str r3, [r5, 0x40] +_0800761E: + subs r3, 0x40 +_08007620: + ldr r2, [sp, 0x4] + adds r2, 0x6 + str r2, [sp, 0x4] + adds r3, 0x4 + movs r6, 0x1 + add r10, r6 + movs r0, 0x7 + mov r7, r10 + ands r0, r7 + cmp r0, 0 + bne _0800764E + ldr r0, [r5, 0x20] + lsls r0, 2 + adds r3, r0 + ldr r0, [sp, 0x14] + adds r0, 0x1 + str r0, [sp, 0x14] + movs r1, 0x8 + ldrsh r0, [r5, r1] + ldr r2, [sp, 0x14] + cmp r2, r0 + blt _0800764E + b _0800786C +_0800764E: + ldr r6, [sp, 0x10] + adds r6, 0x1 + str r6, [sp, 0x10] + ldr r7, _0800766C + ldr r0, [r7] + lsls r0, 2 + adds r0, r4 + ldr r0, [r0] + cmp r6, r0 + blt _08007570 + b _0800786C + .align 2, 0 +_08007664: .4byte gUnknown_80B85DC +_08007668: .4byte gUnknown_202B028 +_0800766C: .4byte gUnknown_20274AC +_08007670: + movs r0, 0 + str r0, [sp, 0x20] + mov r0, r10 + cmp r0, 0 + bge _0800767C + adds r0, 0x7 +_0800767C: + asrs r4, r0, 3 + movs r1, 0x4 + ldrsh r0, [r5, r1] + adds r1, r4, 0 + muls r1, r0 + adds r0, r6, 0 + cmp r6, 0 + bge _0800768E + adds r0, r6, 0x7 +_0800768E: + asrs r2, r0, 3 + adds r0, r1, r2 + lsls r0, 5 + ldr r1, [r5, 0x18] + adds r3, r1, r0 + lsls r0, r4, 3 + mov r7, r10 + subs r0, r7, r0 + lsls r0, 2 + adds r3, r0 + lsls r0, r2, 3 + subs r0, r6, r0 + lsls r0, 4 + ldr r1, _0800788C + adds r0, r1 + mov r12, r0 + mov r9, r2 + str r4, [sp, 0x14] + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r4, r0 + blt _080076BC + b _0800786C +_080076BC: + movs r2, 0 + str r2, [sp, 0x10] + ldr r2, _08007890 + ldr r1, _08007894 + ldr r0, [r1] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + ldr r4, [sp, 0x10] + cmp r4, r0 + blt _080076D4 + b _0800786C +_080076D4: + ldr r6, [sp, 0x4] + ldrh r0, [r6, 0x2] + lsls r4, r0, 16 + ldrh r0, [r6] + orrs r4, r0 + ldr r1, _08007898 + ands r1, r4 + ldr r0, [sp, 0x18] + ands r0, r4 + adds r2, r1, r0 + ldr r7, [sp, 0x1C] + cmp r7, 0 + beq _08007724 + ldr r1, [sp, 0xC] + ldrh r0, [r1, 0x2] + lsls r0, 16 + ldrh r1, [r1] + orrs r0, r1 + lsls r1, r0, 4 + mvns r6, r4 + mov r8, r6 + bics r1, r4 + ldr r7, _0800789C + ldr r6, [r7] + ands r1, r6 + orrs r2, r1 + ldr r0, [sp, 0x20] + cmp r0, 0 + beq _08007724 + ldr r1, [sp, 0x8] + ldrh r0, [r1, 0x2] + lsls r0, 16 + ldrh r1, [r1] + orrs r0, r1 + lsls r1, r0, 4 + eors r1, r4 + mov r4, r8 + ands r1, r4 + ands r1, r6 + orrs r2, r1 +_08007724: + cmp r2, 0 + beq _08007776 + movs r6, 0x4 + ldrsh r0, [r5, r6] + cmp r9, r0 + bge _08007750 + mov r7, r12 + ldr r1, [r7] + ands r1, r2 + ldr r0, [r7, 0x8] + lsls r1, r0 + ldr r0, [r3] + orrs r0, r1 + str r0, [r3] + ldr r0, [r5, 0x3C] + cmp r0, r3 + bls _08007748 + str r3, [r5, 0x3C] +_08007748: + ldr r0, [r5, 0x40] + cmp r0, r3 + bcs _08007750 + str r3, [r5, 0x40] +_08007750: + movs r1, 0x4 + ldrsh r0, [r5, r1] + subs r0, 0x1 + cmp r9, r0 + bge _08007776 + adds r3, 0x20 + mov r4, r12 + ldr r0, [r4, 0x4] + ands r2, r0 + ldr r0, [r4, 0xC] + lsrs r2, r0 + ldr r0, [r3] + orrs r0, r2 + str r0, [r3] + ldr r0, [r5, 0x40] + cmp r0, r3 + bcs _08007774 + str r3, [r5, 0x40] +_08007774: + subs r3, 0x20 +_08007776: + ldr r6, [sp, 0x4] + ldrh r4, [r6, 0x4] + ldr r1, _08007898 + ands r1, r4 + ldr r0, [sp, 0x18] + ands r0, r4 + adds r2, r1, r0 + ldr r7, [sp, 0x1C] + cmp r7, 0 + beq _080077CC + ldr r1, [sp, 0xC] + ldrh r0, [r1, 0x4] + lsls r1, r0, 4 + ldr r6, [sp, 0xC] + ldrh r0, [r6, 0x2] + movs r7, 0xF + mov r8, r7 + lsrs r0, 12 + orrs r1, r0 + mvns r0, r4 + str r0, [sp, 0x24] + bics r1, r4 + ldr r7, _0800789C + ldr r6, [r7] + ands r1, r6 + orrs r2, r1 + ldr r0, [sp, 0x20] + cmp r0, 0 + beq _080077CC + ldr r1, [sp, 0x8] + ldrh r0, [r1, 0x4] + lsls r1, r0, 4 + ldr r7, [sp, 0x8] + ldrh r0, [r7, 0x2] + lsrs r0, 12 + mov r7, r8 + ands r0, r7 + orrs r1, r0 + eors r1, r4 + ldr r0, [sp, 0x24] + ands r1, r0 + ands r1, r6 + orrs r2, r1 +_080077CC: + cmp r2, 0 + beq _0800781C + movs r1, 0x4 + ldrsh r0, [r5, r1] + subs r0, 0x1 + cmp r9, r0 + bge _080077F6 + adds r3, 0x20 + mov r4, r12 + ldr r1, [r4] + ands r1, r2 + ldr r0, [r4, 0x8] + lsls r1, r0 + ldr r0, [r3] + orrs r0, r1 + str r0, [r3] + ldr r0, [r5, 0x40] + cmp r0, r3 + bcs _080077F4 + str r3, [r5, 0x40] +_080077F4: + subs r3, 0x20 +_080077F6: + movs r6, 0x4 + ldrsh r0, [r5, r6] + subs r0, 0x2 + cmp r9, r0 + bge _0800781C + adds r3, 0x40 + mov r7, r12 + ldr r0, [r7, 0x4] + ands r2, r0 + ldr r0, [r7, 0xC] + lsrs r2, r0 + ldr r0, [r3] + orrs r0, r2 + str r0, [r3] + ldr r0, [r5, 0x40] + cmp r0, r3 + bcs _0800781A + str r3, [r5, 0x40] +_0800781A: + subs r3, 0x40 +_0800781C: + movs r0, 0x1 + str r0, [sp, 0x20] + ldr r1, [sp, 0x4] + adds r1, 0x6 + str r1, [sp, 0x4] + ldr r2, [sp, 0x8] + adds r2, 0x6 + str r2, [sp, 0x8] + ldr r4, [sp, 0xC] + adds r4, 0x6 + str r4, [sp, 0xC] + adds r3, 0x4 + add r10, r0 + movs r0, 0x7 + mov r6, r10 + ands r0, r6 + cmp r0, 0 + bne _08007854 + ldr r0, [r5, 0x20] + lsls r0, 2 + adds r3, r0 + ldr r7, [sp, 0x14] + adds r7, 0x1 + str r7, [sp, 0x14] + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r7, r0 + bge _0800786C +_08007854: + ldr r2, [sp, 0x10] + adds r2, 0x1 + str r2, [sp, 0x10] + ldr r4, _08007894 + ldr r0, [r4] + lsls r0, 2 + ldr r6, _08007890 + adds r0, r6 + ldr r0, [r0] + cmp r2, r0 + bge _0800786C + b _080076D4 +_0800786C: + ldr r7, [sp] + movs r1, 0x6 + ldrsh r0, [r7, r1] + ldr r2, _080078A0 + movs r3, 0 + ldrsh r1, [r2, r3] + adds r0, r1 + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0800788C: .4byte gUnknown_80B85DC +_08007890: .4byte gUnknown_202B028 +_08007894: .4byte gUnknown_20274AC +_08007898: .4byte 0x11111111 +_0800789C: .4byte gUnknown_202B030 +_080078A0: .4byte gUnknown_2027498 + thumb_func_end xxx_draw_char + + thumb_func_start sub_80078A4 +sub_80078A4: + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + adds r4, r2, 0 + mov r8, r3 + ldr r0, [sp, 0x18] + str r0, [sp] + adds r0, r5, 0 + bl sub_800792C + adds r4, 0x1 + ldr r0, _080078E4 + ldr r0, [r0] + movs r1, 0xF + ands r0, r1 + str r0, [sp] + adds r0, r5, 0 + adds r1, r6, 0 + adds r2, r4, 0 + mov r3, r8 + bl sub_800792C + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080078E4: .4byte gUnknown_202B030 + thumb_func_end sub_80078A4 + + thumb_func_start sub_80078E8 +sub_80078E8: + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + adds r4, r2, 0 + mov r8, r3 + ldr r0, [sp, 0x18] + str r0, [sp] + adds r0, r5, 0 + bl nullsub_129 + adds r4, 0x1 + ldr r0, _08007928 + ldr r0, [r0] + movs r1, 0xF + ands r0, r1 + str r0, [sp] + adds r0, r5, 0 + adds r1, r6, 0 + adds r2, r4, 0 + mov r3, r8 + bl nullsub_129 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08007928: .4byte gUnknown_202B030 + thumb_func_end sub_80078E8 + + thumb_func_start sub_800792C +sub_800792C: + push {r4-r6,lr} + sub sp, 0x8 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + ldr r1, [sp, 0x18] + ldr r0, _08007950 + str r3, [sp] + str r1, [sp, 0x4] + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_8007958 + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08007950: .4byte gUnknown_2027370 + thumb_func_end sub_800792C + + thumb_func_start nullsub_129 +nullsub_129: + bx lr + thumb_func_end nullsub_129 + + thumb_func_start sub_8007958 +sub_8007958: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x24 + mov r8, r2 + adds r7, r3, 0 + ldr r2, [sp, 0x40] + mov r12, r2 + ldr r3, [sp, 0x44] + lsls r2, r1, 3 + adds r2, r1 + lsls r2, 3 + adds r5, r0, r2 + ldr r1, _08007A68 + movs r0, 0xF + ands r3, r0 + lsls r3, 2 + adds r3, r1 + ldr r3, [r3] + mov r9, r3 + adds r0, r7, 0 + cmp r7, 0 + bge _0800798A + adds r0, r7, 0x7 +_0800798A: + asrs r4, r0, 3 + movs r1, 0x4 + ldrsh r0, [r5, r1] + muls r0, r4 + mov r2, r8 + cmp r2, 0 + bge _0800799A + adds r2, 0x7 +_0800799A: + asrs r2, 3 + adds r0, r2 + lsls r0, 5 + ldr r1, [r5, 0x18] + adds r3, r1, r0 + lsls r0, r4, 3 + subs r0, r7, r0 + lsls r0, 2 + adds r3, r0 + adds r6, r2, 0 + movs r2, 0x8 + ldrsh r0, [r5, r2] + cmp r4, r0 + bge _08007A58 + mov r1, sp + ldr r0, _08007A6C + ldm r0!, {r2,r4,r7} + stm r1!, {r2,r4,r7} + ldm r0!, {r2,r4,r7} + stm r1!, {r2,r4,r7} + ldm r0!, {r2,r4,r7} + stm r1!, {r2,r4,r7} + mov r4, r12 + cmp r4, 0 + ble _08007A58 + ldr r7, _08007A70 +_080079CE: + mov r1, r12 + cmp r1, 0x7 + ble _080079D6 + movs r1, 0x8 +_080079D6: + mov r0, r8 + cmp r0, 0 + bge _080079DE + adds r0, 0x7 +_080079DE: + asrs r0, 3 + lsls r0, 3 + mov r2, r8 + subs r0, r2, r0 + lsls r0, 4 + adds r4, r0, r7 + lsls r0, r1, 2 + add r0, sp + ldr r2, [r0] + ldr r1, _08007A74 + ands r1, r2 + mov r0, r9 + ands r0, r2 + adds r2, r1, r0 + cmp r2, 0 + beq _08007A48 + movs r1, 0x4 + ldrsh r0, [r5, r1] + cmp r6, r0 + bge _08007A24 + ldr r1, [r4] + ands r1, r2 + ldr r0, [r4, 0x8] + lsls r1, r0 + ldr r0, [r3] + orrs r0, r1 + str r0, [r3] + ldr r0, [r5, 0x3C] + cmp r0, r3 + bls _08007A1C + str r3, [r5, 0x3C] +_08007A1C: + ldr r0, [r5, 0x40] + cmp r0, r3 + bcs _08007A24 + str r3, [r5, 0x40] +_08007A24: + movs r1, 0x4 + ldrsh r0, [r5, r1] + subs r0, 0x1 + cmp r6, r0 + bge _08007A48 + adds r3, 0x20 + ldr r0, [r4, 0x4] + ands r2, r0 + ldr r0, [r4, 0xC] + lsrs r2, r0 + ldr r0, [r3] + orrs r0, r2 + str r0, [r3] + ldr r0, [r5, 0x40] + cmp r0, r3 + bcs _08007A46 + str r3, [r5, 0x40] +_08007A46: + subs r3, 0x20 +_08007A48: + adds r6, 0x1 + adds r3, 0x20 + movs r2, 0x8 + negs r2, r2 + add r12, r2 + mov r4, r12 + cmp r4, 0 + bgt _080079CE +_08007A58: + add sp, 0x24 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08007A68: .4byte gUnknown_80B853C +_08007A6C: .4byte gUnknown_80B8824 +_08007A70: .4byte gUnknown_80B85DC +_08007A74: .4byte 0x11111111 + thumb_func_end sub_8007958 + + thumb_func_start sub_8007A78 +sub_8007A78: + push {r4-r6,lr} + sub sp, 0x8 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + ldr r1, [sp, 0x18] + ldr r0, _08007A9C + str r3, [sp] + str r1, [sp, 0x4] + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_8007AA4 + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08007A9C: .4byte gUnknown_2027370 + thumb_func_end sub_8007A78 + + thumb_func_start nullsub_157 +nullsub_157: + bx lr + thumb_func_end nullsub_157 + + thumb_func_start sub_8007AA4 +sub_8007AA4: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x20 + mov r9, r2 + adds r5, r3, 0 + ldr r7, [sp, 0x3C] + ldr r3, [sp, 0x40] + lsls r2, r1, 3 + adds r2, r1 + lsls r2, 3 + adds r4, r0, r2 + ldr r1, _08007B28 + movs r0, 0xF + ands r3, r0 + lsls r3, 2 + adds r3, r1 + ldr r0, [r3] + ldr r1, _08007B2C + adds r1, r0 + mov r12, r1 + mov r1, sp + ldr r0, _08007B30 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3} + stm r1!, {r2,r3} + adds r0, r5, 0 + cmp r5, 0 + bge _08007AE8 + adds r0, r5, 0x7 +_08007AE8: + asrs r3, r0, 3 + movs r0, 0x4 + ldrsh r6, [r4, r0] + mov r8, r6 + mov r0, r8 + muls r0, r3 + mov r2, r9 + cmp r2, 0 + bge _08007AFC + adds r2, 0x7 +_08007AFC: + asrs r2, 3 + adds r0, r2 + lsls r0, 5 + ldr r1, [r4, 0x18] + adds r1, r0 + lsls r0, r3, 3 + subs r0, r5, r0 + lsls r0, 2 + adds r1, r0 + movs r0, 0x7 + mov r6, r9 + ands r0, r6 + lsls r0, 2 + add r0, sp + ldr r0, [r0] + mov r6, r12 + ands r6, r0 + mov r12, r6 + cmp r2, r8 + bge _08007B6E + b _08007B48 + .align 2, 0 +_08007B28: .4byte gUnknown_80B853C +_08007B2C: .4byte 0x11111111 +_08007B30: .4byte gUnknown_80B8848 +_08007B34: + adds r5, 0x1 + adds r1, 0x4 + movs r0, 0x7 + ands r0, r5 + cmp r0, 0 + bne _08007B46 + ldr r0, [r4, 0x20] + lsls r0, 2 + adds r1, r0 +_08007B46: + subs r7, 0x1 +_08007B48: + cmp r7, 0 + ble _08007B6E + movs r2, 0x8 + ldrsh r0, [r4, r2] + cmp r3, r0 + bge _08007B6E + ldr r0, [r1] + mov r6, r12 + orrs r0, r6 + str r0, [r1] + ldr r0, [r4, 0x3C] + cmp r0, r1 + bls _08007B64 + str r1, [r4, 0x3C] +_08007B64: + ldr r0, [r4, 0x40] + cmp r0, r1 + bcs _08007B34 + str r1, [r4, 0x40] + b _08007B34 +_08007B6E: + add sp, 0x20 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8007AA4 + + thumb_func_start sub_8007B7C +sub_8007B7C: + push {r4-r6,lr} + sub sp, 0x8 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + ldr r1, [sp, 0x18] + ldr r0, _08007BA0 + str r3, [sp] + str r1, [sp, 0x4] + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_8007BA8 + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08007BA0: .4byte gUnknown_2027370 + thumb_func_end sub_8007B7C + + thumb_func_start nullsub_158 +nullsub_158: + bx lr + thumb_func_end nullsub_158 + + thumb_func_start sub_8007BA8 +sub_8007BA8: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + str r2, [sp] + lsls r2, r1, 3 + adds r2, r1 + lsls r2, 3 + adds r0, r2 + mov r12, r0 + adds r0, r3, 0 + cmp r3, 0 + bge _08007BC8 + adds r0, r3, 0x7 +_08007BC8: + asrs r0, 3 + str r0, [sp, 0x8] + mov r1, r12 + movs r2, 0x8 + ldrsh r0, [r1, r2] + ldr r4, [sp, 0x8] + cmp r4, r0 + bge _08007CC4 + movs r7, 0x4 + ldrsh r0, [r1, r7] + adds r1, r4, 0 + muls r1, r0 + ldr r0, [sp] + cmp r0, 0 + bge _08007BE8 + adds r0, 0x7 +_08007BE8: + asrs r0, 3 + adds r0, r1, r0 + lsls r0, 5 + mov r2, r12 + ldr r1, [r2, 0x18] + adds r4, r1, r0 + ldr r7, [sp, 0x8] + lsls r0, r7, 3 + subs r0, r3, r0 + lsls r0, 2 + adds r4, r0 + movs r0, 0 + str r0, [sp, 0x4] + ldr r1, [sp, 0x44] + cmp r0, r1 + bge _08007CC4 +_08007C08: + adds r2, r4, 0 + ldr r0, [sp] + cmp r0, 0 + bge _08007C12 + adds r0, 0x7 +_08007C12: + asrs r1, r0, 3 + movs r7, 0 + mov r8, r7 + adds r3, 0x1 + str r3, [sp, 0xC] + adds r4, 0x4 + str r4, [sp, 0x14] + ldr r0, [sp, 0x40] + cmp r8, r0 + bge _08007C94 +_08007C26: + mov r3, r12 + movs r4, 0x4 + ldrsh r0, [r3, r4] + cmp r1, r0 + bge _08007C94 + movs r6, 0xF0 + lsls r6, 24 + movs r5, 0xE0 + lsls r5, 24 + movs r7, 0 + str r7, [sp, 0x1C] + ldr r4, [r2] + adds r3, r4, 0 + mov r0, r12 + ldr r0, [r0, 0x3C] + mov r9, r0 + mov r7, r12 + ldr r7, [r7, 0x40] + mov r10, r7 + adds r1, 0x1 + str r1, [sp, 0x10] + adds r0, r2, 0 + adds r0, 0x20 + str r0, [sp, 0x18] + movs r1, 0x8 + add r8, r1 + movs r1, 0x7 +_08007C5C: + adds r0, r4, 0 + ands r0, r6 + cmp r0, 0 + bne _08007C6A + ldr r7, [sp, 0x1C] + orrs r7, r5 + str r7, [sp, 0x1C] +_08007C6A: + lsrs r6, 4 + lsrs r5, 4 + subs r1, 0x1 + cmp r1, 0 + bge _08007C5C + ldr r0, [sp, 0x1C] + orrs r3, r0 + str r3, [r2] + cmp r9, r2 + bls _08007C82 + mov r1, r12 + str r2, [r1, 0x3C] +_08007C82: + cmp r10, r2 + bcs _08007C8A + mov r3, r12 + str r2, [r3, 0x40] +_08007C8A: + ldr r1, [sp, 0x10] + ldr r2, [sp, 0x18] + ldr r4, [sp, 0x40] + cmp r8, r4 + blt _08007C26 +_08007C94: + ldr r3, [sp, 0xC] + ldr r4, [sp, 0x14] + movs r0, 0x7 + ands r0, r3 + cmp r0, 0 + bne _08007CB8 + mov r7, r12 + ldr r0, [r7, 0x20] + lsls r0, 2 + adds r4, r0 + ldr r0, [sp, 0x8] + adds r0, 0x1 + str r0, [sp, 0x8] + movs r1, 0x8 + ldrsh r0, [r7, r1] + ldr r2, [sp, 0x8] + cmp r2, r0 + bge _08007CC4 +_08007CB8: + ldr r7, [sp, 0x4] + adds r7, 0x1 + str r7, [sp, 0x4] + ldr r0, [sp, 0x44] + cmp r7, r0 + blt _08007C08 +_08007CC4: + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8007BA8 + + thumb_func_start sub_8007CD4 +sub_8007CD4: + push {r4-r6,lr} + sub sp, 0x8 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + ldr r1, [sp, 0x18] + ldr r0, _08007CF8 + str r3, [sp] + str r1, [sp, 0x4] + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_8007D00 + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08007CF8: .4byte gUnknown_2027370 + thumb_func_end sub_8007CD4 + + thumb_func_start nullsub_159 +nullsub_159: + bx lr + thumb_func_end nullsub_159 + + thumb_func_start sub_8007D00 +sub_8007D00: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + str r2, [sp] + lsls r2, r1, 3 + adds r2, r1 + lsls r2, 3 + adds r0, r2 + mov r12, r0 + adds r0, r3, 0 + cmp r3, 0 + bge _08007D20 + adds r0, r3, 0x7 +_08007D20: + asrs r0, 3 + str r0, [sp, 0x8] + mov r1, r12 + movs r2, 0x8 + ldrsh r0, [r1, r2] + ldr r4, [sp, 0x8] + cmp r4, r0 + bge _08007E0E + movs r5, 0x4 + ldrsh r0, [r1, r5] + adds r1, r4, 0 + muls r1, r0 + ldr r0, [sp] + cmp r0, 0 + bge _08007D40 + adds r0, 0x7 +_08007D40: + asrs r0, 3 + adds r0, r1, r0 + lsls r0, 5 + mov r2, r12 + ldr r1, [r2, 0x18] + adds r4, r1, r0 + ldr r5, [sp, 0x8] + lsls r0, r5, 3 + subs r0, r3, r0 + lsls r0, 2 + adds r4, r0 + movs r0, 0 + b _08007E06 +_08007D5A: + adds r2, r4, 0 + ldr r0, [sp] + cmp r0, 0 + bge _08007D64 + adds r0, 0x7 +_08007D64: + asrs r1, r0, 3 + movs r5, 0 + mov r8, r5 + adds r3, 0x1 + str r3, [sp, 0xC] + adds r4, 0x4 + str r4, [sp, 0x14] + ldr r0, [sp, 0x40] + cmp r8, r0 + bge _08007DE0 +_08007D78: + mov r3, r12 + movs r4, 0x4 + ldrsh r0, [r3, r4] + cmp r1, r0 + bge _08007DE0 + movs r4, 0xF0 + lsls r4, 24 + movs r6, 0xE0 + lsls r6, 24 + movs r7, 0 + ldr r5, [r2] + str r5, [sp, 0x1C] + adds r3, r5, 0 + mov r0, r12 + ldr r0, [r0, 0x3C] + mov r9, r0 + mov r5, r12 + ldr r5, [r5, 0x40] + mov r10, r5 + adds r1, 0x1 + str r1, [sp, 0x10] + adds r0, r2, 0 + adds r0, 0x20 + str r0, [sp, 0x18] + movs r1, 0x8 + add r8, r1 + movs r1, 0x7 +_08007DAE: + ldr r0, [sp, 0x1C] + ands r0, r4 + cmp r0, r6 + bne _08007DB8 + orrs r7, r4 +_08007DB8: + lsrs r4, 4 + lsrs r6, 4 + subs r1, 0x1 + cmp r1, 0 + bge _08007DAE + bics r3, r7 + str r3, [r2] + cmp r9, r2 + bls _08007DCE + mov r3, r12 + str r2, [r3, 0x3C] +_08007DCE: + cmp r10, r2 + bcs _08007DD6 + mov r4, r12 + str r2, [r4, 0x40] +_08007DD6: + ldr r1, [sp, 0x10] + ldr r2, [sp, 0x18] + ldr r5, [sp, 0x40] + cmp r8, r5 + blt _08007D78 +_08007DE0: + ldr r3, [sp, 0xC] + ldr r4, [sp, 0x14] + movs r0, 0x7 + ands r0, r3 + cmp r0, 0 + bne _08007E02 + mov r1, r12 + ldr r0, [r1, 0x20] + lsls r0, 2 + adds r4, r0 + ldr r2, [sp, 0x8] + adds r2, 0x1 + str r2, [sp, 0x8] + movs r5, 0x8 + ldrsh r0, [r1, r5] + cmp r2, r0 + bge _08007E0E +_08007E02: + ldr r0, [sp, 0x4] + adds r0, 0x1 +_08007E06: + str r0, [sp, 0x4] + ldr r1, [sp, 0x44] + cmp r0, r1 + blt _08007D5A +_08007E0E: + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8007D00 + + thumb_func_start sub_8007E20 +sub_8007E20: + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x14 + mov r8, r0 + mov r9, r1 + ldr r4, [sp, 0x2C] + ldr r5, [sp, 0x30] + ldr r6, [sp, 0x34] + ldr r0, _08007E58 + ldr r1, _08007E5C + str r2, [sp] + str r3, [sp, 0x4] + str r4, [sp, 0x8] + str r5, [sp, 0xC] + str r6, [sp, 0x10] + mov r2, r8 + mov r3, r9 + bl sub_8007E64 + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08007E58: .4byte gUnknown_2027370 +_08007E5C: .4byte gUnknown_202B038 + thumb_func_end sub_8007E20 + + thumb_func_start nullsub_160 +nullsub_160: + bx lr + thumb_func_end nullsub_160 + + thumb_func_start sub_8007E64 +sub_8007E64: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + str r1, [sp] + str r3, [sp, 0x4] + ldr r7, [sp, 0x30] + ldr r1, [sp, 0x34] + mov r9, r1 + ldr r1, [sp, 0x38] + mov r10, r1 + ldr r5, [sp, 0x3C] + lsls r1, r2, 3 + adds r1, r2 + lsls r1, 3 + adds r4, r0, r1 + adds r0, r3, 0 + cmp r0, 0 + bge _08007E90 + adds r0, 0x7 +_08007E90: + asrs r0, 3 + str r0, [sp, 0x4] + adds r0, r7, 0 + cmp r7, 0 + bge _08007E9C + adds r0, r7, 0x7 +_08007E9C: + asrs r7, r0, 3 + mov r0, r9 + cmp r0, 0 + bge _08007EA6 + adds r0, 0x7 +_08007EA6: + asrs r0, 3 + mov r9, r0 + mov r0, r10 + cmp r0, 0 + bge _08007EB2 + adds r0, 0x7 +_08007EB2: + asrs r0, 3 + mov r10, r0 + ldr r2, [sp, 0x40] + lsls r2, 12 + str r2, [sp, 0x40] + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r7, r0 + bge _08007F98 + movs r2, 0x4 + ldrsh r0, [r4, r2] + muls r0, r7 + ldr r1, [sp, 0x4] + adds r0, r1 + lsls r0, 5 + ldr r1, [r4, 0x18] + adds r1, r0 + mov r8, r1 + movs r2, 0 + b _08007F92 +_08007EDA: + ldr r6, [sp, 0x4] + mov r3, r8 + adds r0, r7, 0x1 + str r0, [sp, 0xC] + mov r1, r9 + cmp r1, 0 + ble _08007F7A + mov r12, r9 +_08007EEA: + movs r2, 0x4 + ldrsh r0, [r4, r2] + cmp r6, r0 + bge _08007F68 + ldr r0, [r4, 0x3C] + cmp r0, r3 + bls _08007EFA + str r3, [r4, 0x3C] +_08007EFA: + ldm r5!, {r0} + stm r3!, {r0} + ldm r5!, {r0} + stm r3!, {r0} + ldm r5!, {r0} + stm r3!, {r0} + ldm r5!, {r0} + stm r3!, {r0} + ldm r5!, {r0} + stm r3!, {r0} + ldm r5!, {r0} + stm r3!, {r0} + ldm r5!, {r0} + stm r3!, {r0} + ldr r0, [r5] + stm r3!, {r0} + ldr r0, [r4, 0x40] + cmp r0, r3 + bcs _08007F22 + str r3, [r4, 0x40] +_08007F22: + adds r5, 0x4 + movs r1, 0x2 + ldrsh r0, [r4, r1] + adds r0, r7 + movs r2, 0 + ldrsh r1, [r4, r2] + adds r1, r6 + lsls r1, 1 + lsls r0, 6 + ldr r2, [sp] + adds r0, r2 + adds r1, r0 + ldrh r2, [r1] + ldr r0, _08007F64 + ands r0, r2 + strh r0, [r1] + movs r1, 0x2 + ldrsh r0, [r4, r1] + adds r0, r7 + movs r2, 0 + ldrsh r1, [r4, r2] + adds r1, r6 + lsls r1, 1 + lsls r0, 6 + ldr r2, [sp] + adds r0, r2 + adds r1, r0 + ldrh r2, [r1] + ldr r0, [sp, 0x40] + orrs r0, r2 + strh r0, [r1] + b _08007F6C + .align 2, 0 +_08007F64: .4byte 0x00000fff +_08007F68: + adds r3, 0x20 + adds r5, 0x20 +_08007F6C: + adds r6, 0x1 + movs r0, 0x1 + negs r0, r0 + add r12, r0 + mov r1, r12 + cmp r1, 0 + bne _08007EEA +_08007F7A: + ldr r7, [sp, 0xC] + ldr r0, [r4, 0x20] + lsls r0, 2 + add r8, r0 + movs r2, 0x20 + add r8, r2 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r7, r0 + bge _08007F98 + ldr r2, [sp, 0x8] + adds r2, 0x1 +_08007F92: + str r2, [sp, 0x8] + cmp r2, r10 + blt _08007EDA +_08007F98: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8007E64 + + thumb_func_start sub_8007FA8 +sub_8007FA8: + adds r3, r0, 0 + lsrs r0, r3, 28 + lsrs r1, r3, 20 + movs r2, 0xF0 + ands r1, r2 + orrs r0, r1 + lsrs r1, r3, 12 + movs r2, 0xF0 + lsls r2, 4 + ands r1, r2 + orrs r0, r1 + lsrs r1, r3, 4 + movs r2, 0xF0 + lsls r2, 8 + ands r1, r2 + orrs r0, r1 + lsls r1, r3, 4 + movs r2, 0xF0 + lsls r2, 12 + ands r1, r2 + orrs r0, r1 + lsls r1, r3, 12 + movs r2, 0xF0 + lsls r2, 16 + ands r1, r2 + orrs r0, r1 + lsls r1, r3, 20 + movs r2, 0xF0 + lsls r2, 20 + ands r1, r2 + orrs r0, r1 + lsls r3, 28 + orrs r0, r3 + bx lr + thumb_func_end sub_8007FA8 + + thumb_func_start sub_8007FEC +sub_8007FEC: + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x14 + mov r8, r0 + mov r9, r1 + ldr r4, [sp, 0x2C] + ldr r5, [sp, 0x30] + ldr r6, [sp, 0x34] + ldr r0, _08008024 + ldr r1, _08008028 + str r2, [sp] + str r3, [sp, 0x4] + str r4, [sp, 0x8] + str r5, [sp, 0xC] + str r6, [sp, 0x10] + mov r2, r8 + mov r3, r9 + bl sub_8008030 + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08008024: .4byte gUnknown_2027370 +_08008028: .4byte gUnknown_202B038 + thumb_func_end sub_8007FEC + + thumb_func_start nullsub_161 +nullsub_161: + bx lr + thumb_func_end nullsub_161 + + thumb_func_start sub_8008030 +sub_8008030: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + str r1, [sp] + ldr r1, [sp, 0x30] + mov r8, r1 + ldr r6, [sp, 0x3C] + lsls r1, r2, 3 + adds r1, r2 + lsls r1, 3 + adds r5, r0, r1 + adds r0, r3, 0 + cmp r3, 0 + bge _08008054 + adds r0, r3, 0x7 +_08008054: + asrs r3, r0, 3 + mov r0, r8 + cmp r0, 0 + bge _0800805E + adds r0, 0x7 +_0800805E: + asrs r0, 3 + mov r8, r0 + ldr r0, [sp, 0x34] + cmp r0, 0 + bge _0800806A + adds r0, 0x7 +_0800806A: + asrs r0, 3 + str r0, [sp, 0x34] + ldr r0, [sp, 0x38] + cmp r0, 0 + bge _08008076 + adds r0, 0x7 +_08008076: + asrs r0, 3 + str r0, [sp, 0x38] + ldr r2, [sp, 0x40] + lsls r2, 12 + str r2, [sp, 0x40] + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r8, r0 + blt _0800808A + b _08008194 +_0800808A: + movs r2, 0x4 + ldrsh r0, [r5, r2] + mov r1, r8 + muls r1, r0 + adds r0, r1, 0 + ldr r1, [sp, 0x34] + adds r2, r3, r1 + adds r0, r2 + lsls r0, 5 + ldr r1, [r5, 0x18] + adds r1, r0 + mov r10, r1 + movs r3, 0 + str r3, [sp, 0x4] + str r2, [sp, 0xC] + ldr r0, [sp, 0x38] + cmp r3, r0 + bge _08008194 +_080080AE: + ldr r7, [sp, 0xC] + mov r4, r10 + mov r1, r8 + adds r1, 0x1 + str r1, [sp, 0x8] + ldr r2, [sp, 0x34] + cmp r2, 0 + ble _08008172 + mov r9, r2 +_080080C0: + subs r7, 0x1 + subs r4, 0x20 + movs r3, 0x4 + ldrsh r0, [r5, r3] + cmp r7, r0 + bge _08008164 + ldr r0, [r5, 0x3C] + cmp r0, r4 + bls _080080D4 + str r4, [r5, 0x3C] +_080080D4: + ldm r6!, {r0} + bl sub_8007FA8 + str r0, [r4] + ldm r6!, {r0} + bl sub_8007FA8 + str r0, [r4, 0x4] + ldm r6!, {r0} + bl sub_8007FA8 + str r0, [r4, 0x8] + ldm r6!, {r0} + bl sub_8007FA8 + str r0, [r4, 0xC] + ldm r6!, {r0} + bl sub_8007FA8 + str r0, [r4, 0x10] + ldm r6!, {r0} + bl sub_8007FA8 + str r0, [r4, 0x14] + ldm r6!, {r0} + bl sub_8007FA8 + str r0, [r4, 0x18] + ldm r6!, {r0} + bl sub_8007FA8 + str r0, [r4, 0x1C] + adds r1, r4, 0 + adds r1, 0x20 + ldr r0, [r5, 0x40] + cmp r0, r1 + bcs _08008120 + str r1, [r5, 0x40] +_08008120: + movs r1, 0x2 + ldrsh r0, [r5, r1] + add r0, r8 + movs r2, 0 + ldrsh r1, [r5, r2] + adds r1, r7 + lsls r1, 1 + lsls r0, 6 + ldr r3, [sp] + adds r0, r3 + adds r1, r0 + ldrh r0, [r1] + ldr r3, _08008160 + adds r2, r3, 0 + ands r0, r2 + strh r0, [r1] + movs r1, 0x2 + ldrsh r0, [r5, r1] + add r0, r8 + movs r2, 0 + ldrsh r1, [r5, r2] + adds r1, r7 + lsls r1, 1 + lsls r0, 6 + ldr r3, [sp] + adds r0, r3 + adds r1, r0 + ldrh r2, [r1] + ldr r0, [sp, 0x40] + orrs r0, r2 + strh r0, [r1] + b _08008166 + .align 2, 0 +_08008160: .4byte 0x00000fff +_08008164: + adds r6, 0x20 +_08008166: + movs r0, 0x1 + negs r0, r0 + add r9, r0 + mov r1, r9 + cmp r1, 0 + bne _080080C0 +_08008172: + ldr r2, [sp, 0x8] + mov r8, r2 + ldr r0, [r5, 0x20] + lsls r0, 2 + add r10, r0 + movs r3, 0x20 + add r10, r3 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r8, r0 + bge _08008194 + ldr r2, [sp, 0x4] + adds r2, 0x1 + str r2, [sp, 0x4] + ldr r3, [sp, 0x38] + cmp r2, r3 + blt _080080AE +_08008194: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8008030 + + thumb_func_start sub_80081A4 +sub_80081A4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + str r1, [sp] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 3 + ldr r0, _08008234 + adds r6, r1, r0 + lsls r3, 7 + ldr r0, _08008238 + adds r3, r0 + ldr r0, [sp] + cmp r0, 0 + bge _080081CA + adds r0, 0x7 +_080081CA: + asrs r0, 3 + str r0, [sp] + adds r0, r2, 0 + cmp r2, 0 + bge _080081D6 + adds r0, r2, 0x7 +_080081D6: + asrs r2, r0, 3 + movs r0, 0x2 + mov r9, r0 + mov r10, r0 + movs r1, 0x8 + ldrsh r0, [r6, r1] + cmp r2, r0 + bge _08008262 + movs r7, 0x4 + ldrsh r0, [r6, r7] + muls r0, r2 + ldr r1, [sp] + adds r0, r1 + lsls r0, 5 + ldr r1, [r6, 0x28] + adds r5, r1, r0 + movs r7, 0 + mov r8, r7 +_080081FA: + ldr r4, [sp] + adds r1, r5, 0 + adds r2, 0x1 + mov r12, r2 + mov r0, r9 + cmp r0, 0 + beq _08008248 + mov r2, r9 +_0800820A: + movs r7, 0x4 + ldrsh r0, [r6, r7] + cmp r4, r0 + bge _0800823C + ldm r3!, {r0} + stm r1!, {r0} + ldm r3!, {r0} + stm r1!, {r0} + ldm r3!, {r0} + stm r1!, {r0} + ldm r3!, {r0} + stm r1!, {r0} + ldm r3!, {r0} + stm r1!, {r0} + ldm r3!, {r0} + stm r1!, {r0} + ldm r3!, {r0} + stm r1!, {r0} + ldm r3!, {r0} + stm r1!, {r0} + b _08008240 + .align 2, 0 +_08008234: .4byte gUnknown_2027370 +_08008238: .4byte gUnknown_80B86B4 +_0800823C: + adds r1, 0x20 + adds r3, 0x20 +_08008240: + adds r4, 0x1 + subs r2, 0x1 + cmp r2, 0 + bne _0800820A +_08008248: + mov r2, r12 + ldr r0, [r6, 0x20] + lsls r0, 2 + adds r5, r0 + adds r5, 0x20 + movs r1, 0x8 + ldrsh r0, [r6, r1] + cmp r2, r0 + bge _08008262 + movs r7, 0x1 + add r8, r7 + cmp r8, r10 + blt _080081FA +_08008262: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80081A4 + + thumb_func_start sub_8008274 +sub_8008274: + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r3, r1, 0 + ldr r0, _08008290 + ldr r1, _08008294 + str r2, [sp] + adds r2, r4, 0 + bl sub_800829C + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08008290: .4byte gUnknown_2027370 +_08008294: .4byte gUnknown_202B038 + thumb_func_end sub_8008274 + + thumb_func_start nullsub_162 +nullsub_162: + bx lr + thumb_func_end nullsub_162 + + thumb_func_start sub_800829C +sub_800829C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r1 + ldr r7, [sp, 0x18] + lsls r1, r2, 3 + adds r1, r2 + lsls r1, 3 + adds r4, r0, r1 + lsls r7, 12 + ldr r0, [r4, 0x18] + movs r1, 0x4 + ldrsh r2, [r4, r1] + movs r5, 0x8 + ldrsh r1, [r4, r5] + lsls r1, 5 + muls r1, r2 + adds r2, r3, 0 + bl sub_800AAB4 + movs r2, 0 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r2, r0 + bge _08008312 + movs r0, 0x4 + ldrsh r5, [r4, r0] + mov r12, r5 +_080082D4: + adds r5, r2, 0x1 + mov r1, r12 + cmp r1, 0 + ble _08008308 + movs r0, 0x2 + ldrsh r1, [r4, r0] + adds r1, r2 + movs r2, 0 + ldrsh r0, [r4, r2] + lsls r1, 6 + ldr r6, _08008330 + lsls r0, 1 + adds r0, r1 + mov r1, r8 + adds r2, r0, r1 + movs r0, 0x4 + ldrsh r3, [r4, r0] +_080082F6: + ldrh r1, [r2] + adds r0, r6, 0 + ands r0, r1 + orrs r0, r7 + strh r0, [r2] + adds r2, 0x2 + subs r3, 0x1 + cmp r3, 0 + bne _080082F6 +_08008308: + adds r2, r5, 0 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r2, r0 + blt _080082D4 +_08008312: + ldr r0, [r4, 0x28] + str r0, [r4, 0x30] + ldr r0, [r4, 0x1C] + str r0, [r4, 0x34] + ldr r0, [r4, 0x2C] + str r0, [r4, 0x38] + adds r1, r4, 0 + adds r1, 0x44 + movs r0, 0x1 + strb r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08008330: .4byte 0x00000fff + thumb_func_end sub_800829C + + thumb_func_start sub_8008334 +sub_8008334: + push {r4-r7,lr} + adds r7, r0, 0 + mov r12, r1 + ldr r4, [r7] + ldr r1, [r1] + movs r3, 0 + movs r2, 0 + movs r6, 0xF + movs r5, 0x1C +_08008346: + lsls r2, 4 + lsls r3, 4 + adds r0, r4, 0 + ands r0, r6 + orrs r2, r0 + adds r0, r1, 0 + ands r0, r6 + orrs r3, r0 + lsrs r4, 4 + lsrs r1, 4 + subs r5, 0x4 + cmp r5, 0 + bge _08008346 + str r3, [r7] + mov r0, r12 + str r2, [r0] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8008334 + + thumb_func_start sub_800836C +sub_800836C: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r3, r2, 0 + ldr r0, _08008384 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_800838C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08008384: .4byte gUnknown_2027370 + thumb_func_end sub_800836C + + thumb_func_start nullsub_163 +nullsub_163: + bx lr + thumb_func_end nullsub_163 + + thumb_func_start sub_800838C +sub_800838C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r4, r1, 3 + adds r4, r1 + lsls r4, 3 + adds r7, r0, r4 + adds r0, r1, 0 + adds r1, r2, 0 + adds r2, r3, 0 + bl sub_8008274 + movs r0, 0 + mov r9, r0 + b _08008452 +_080083AE: + movs r1, 0x4 + ldrsh r0, [r7, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + mov r8, r0 + ldrh r1, [r7, 0x4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080083C8 + movs r0, 0x1 + add r8, r0 +_080083C8: + movs r6, 0 + movs r1, 0x1 + add r1, r9 + mov r10, r1 + cmp r6, r8 + bge _08008450 +_080083D4: + movs r0, 0x4 + ldrsh r1, [r7, r0] + mov r0, r9 + muls r0, r1 + adds r4, r0, r6 + lsls r4, 5 + ldr r5, [r7, 0x18] + adds r4, r5, r4 + subs r0, 0x1 + subs r1, r6 + adds r0, r1 + lsls r0, 5 + adds r5, r0 + adds r0, r4, 0 + adds r4, 0x4 + adds r1, r5, 0 + adds r5, 0x4 + bl sub_8008334 + adds r0, r4, 0 + adds r4, 0x4 + adds r1, r5, 0 + adds r5, 0x4 + bl sub_8008334 + adds r0, r4, 0 + adds r4, 0x4 + adds r1, r5, 0 + adds r5, 0x4 + bl sub_8008334 + adds r0, r4, 0 + adds r4, 0x4 + adds r1, r5, 0 + adds r5, 0x4 + bl sub_8008334 + adds r0, r4, 0 + adds r4, 0x4 + adds r1, r5, 0 + adds r5, 0x4 + bl sub_8008334 + adds r0, r4, 0 + adds r4, 0x4 + adds r1, r5, 0 + adds r5, 0x4 + bl sub_8008334 + adds r0, r4, 0 + adds r4, 0x4 + adds r1, r5, 0 + adds r5, 0x4 + bl sub_8008334 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8008334 + adds r6, 0x1 + cmp r6, r8 + blt _080083D4 +_08008450: + mov r9, r10 +_08008452: + movs r1, 0x8 + ldrsh r0, [r7, r1] + cmp r9, r0 + blt _080083AE + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_800838C + + thumb_func_start sub_8008468 +sub_8008468: + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x10 + adds r6, r0, 0 + mov r8, r1 + ldr r4, [sp, 0x24] + ldr r5, [sp, 0x28] + ldr r0, _08008498 + ldr r1, _0800849C + str r2, [sp] + str r3, [sp, 0x4] + str r4, [sp, 0x8] + str r5, [sp, 0xC] + adds r2, r6, 0 + mov r3, r8 + bl sub_80084A4 + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08008498: .4byte gUnknown_2027370 +_0800849C: .4byte gUnknown_202B038 + thumb_func_end sub_8008468 + + thumb_func_start nullsub_164 +nullsub_164: + bx lr + thumb_func_end nullsub_164 + + thumb_func_start sub_80084A4 +sub_80084A4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + str r1, [sp] + mov r10, r3 + ldr r6, [sp, 0x24] + ldr r7, [sp, 0x28] + ldr r1, [sp, 0x2C] + mov r12, r1 + lsls r1, r2, 3 + adds r1, r2 + lsls r1, 3 + adds r4, r0, r1 + mov r0, r10 + cmp r0, 0 + bge _080084CC + adds r0, 0x7 +_080084CC: + asrs r0, 3 + mov r10, r0 + adds r0, r6, 0 + cmp r6, 0 + bge _080084D8 + adds r0, r6, 0x7 +_080084D8: + asrs r6, r0, 3 + adds r0, r7, 0 + cmp r7, 0 + bge _080084E2 + adds r0, r7, 0x7 +_080084E2: + asrs r7, r0, 3 + mov r0, r12 + cmp r0, 0 + bge _080084EC + adds r0, 0x7 +_080084EC: + asrs r0, 3 + mov r12, r0 + ldr r2, [sp, 0x30] + lsls r2, 12 + str r2, [sp, 0x30] + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r6, r0 + bge _08008570 + movs r2, 0 + mov r8, r2 + cmp r8, r12 + bge _08008570 +_08008506: + mov r3, r10 + adds r0, r6, 0x1 + mov r9, r0 + cmp r7, 0 + ble _0800855E + adds r5, r7, 0 +_08008512: + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r3, r0 + bge _08008556 + movs r2, 0x2 + ldrsh r0, [r4, r2] + adds r0, r6 + movs r2, 0 + ldrsh r1, [r4, r2] + adds r1, r3 + lsls r1, 1 + lsls r0, 6 + ldr r2, [sp] + adds r0, r2 + adds r1, r0 + ldrh r2, [r1] + ldr r0, _08008580 + ands r0, r2 + strh r0, [r1] + movs r1, 0x2 + ldrsh r0, [r4, r1] + adds r0, r6 + movs r2, 0 + ldrsh r1, [r4, r2] + adds r1, r3 + lsls r1, 1 + lsls r0, 6 + ldr r2, [sp] + adds r0, r2 + adds r1, r0 + ldrh r2, [r1] + ldr r0, [sp, 0x30] + orrs r0, r2 + strh r0, [r1] +_08008556: + adds r3, 0x1 + subs r5, 0x1 + cmp r5, 0 + bne _08008512 +_0800855E: + mov r6, r9 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r6, r0 + bge _08008570 + movs r2, 0x1 + add r8, r2 + cmp r8, r12 + blt _08008506 +_08008570: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08008580: .4byte 0x00000fff + thumb_func_end sub_80084A4 + + thumb_func_start sub_8008584 +sub_8008584: + push {r4,r5,lr} + adds r3, r0, 0 + ldr r1, _080085C4 + ldr r0, _080085C8 + ldr r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r2, [r0] + ldr r5, [r2, 0x4] + ldr r0, _080085CC + adds r1, r3, r0 + ldr r0, _080085D0 + cmp r1, r0 + bhi _080085D4 + movs r2, 0xFF + ands r2, r3 + movs r1, 0xFF + lsls r1, 8 + ands r1, r3 + asrs r1, 8 + subs r2, 0x20 + subs r1, 0xF8 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 5 + adds r0, r2 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r5, r1 + b _08008624 + .align 2, 0 +_080085C4: .4byte gUnknown_2027490 +_080085C8: .4byte gUnknown_20274AC +_080085CC: .4byte 0xffff0800 +_080085D0: .4byte 0x000007fe +_080085D4: + movs r4, 0 + ldr r0, [r2] + subs r2, r0, 0x1 + cmp r4, r2 + bge _08008614 + lsrs r0, r2, 31 + adds r0, r2, r0 + b _08008602 +_080085E4: + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrh r0, [r0, 0x4] + cmp r0, r3 + bge _080085F6 + adds r4, r1, 0x1 + b _080085F8 +_080085F6: + adds r2, r1, 0 +_080085F8: + cmp r4, r2 + bge _08008614 + adds r0, r4, r2 + lsrs r1, r0, 31 + adds r0, r1 +_08008602: + asrs r1, r0, 1 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r5 + ldrh r0, [r0, 0x4] + cmp r0, r3 + bne _080085E4 + adds r4, r1, 0 +_08008614: + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r1, r5, r0 + ldrh r0, [r1, 0x4] + cmp r0, r3 + beq _08008624 + ldr r1, _0800862C +_08008624: + adds r0, r1, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0800862C: .4byte gUnknown_80B86A4 + thumb_func_end sub_8008584 + + thumb_func_start sub_8008630 +sub_8008630: + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + adds r3, r1, 0 + adds r2, r1, 0 + subs r2, 0x30 + lsls r0, r2, 24 + lsrs r0, 24 + cmp r0, 0x9 + bhi _08008648 + adds r0, r2, 0 + b _0800865C +_08008648: + adds r0, r1, 0 + subs r0, 0x61 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bls _08008658 + movs r0, 0x1 + b _0800865C +_08008658: + adds r0, r3, 0 + subs r0, 0x57 +_0800865C: + pop {r1} + bx r1 + thumb_func_end sub_8008630 + + thumb_func_start xxx_get_next_char_from_string +xxx_get_next_char_from_string: + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + ldrb r1, [r5] + cmp r1, 0x7E + bne _08008696 + adds r5, 0x1 + ldrb r0, [r5] + bl sub_8008630 + adds r4, r0, 0 + ldrb r0, [r5, 0x1] + bl sub_8008630 + lsls r4, 4 + adds r4, r0 + ldrb r0, [r5] + cmp r0, 0 + beq _08008690 + adds r5, 0x1 + ldrb r0, [r5] + cmp r0, 0 + beq _08008690 + adds r5, 0x1 +_08008690: + str r4, [r6] + adds r0, r5, 0 + b _080086B2 +_08008696: + adds r0, r1, 0 + subs r0, 0x81 + cmp r0, 0x3 + bls _080086A2 + cmp r1, 0x87 + bne _080086AE +_080086A2: + ldrb r0, [r5, 0x1] + lsls r1, 8 + orrs r0, r1 + str r0, [r6] + adds r0, r5, 0x2 + b _080086B2 +_080086AE: + str r1, [r6] + adds r0, r5, 0x1 +_080086B2: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end xxx_get_next_char_from_string + + thumb_func_start nullsub_165 +nullsub_165: + bx lr + thumb_func_end nullsub_165 + + thumb_func_start nullsub_166 +nullsub_166: + bx lr + thumb_func_end nullsub_166 + + thumb_func_start nullsub_167 +nullsub_167: + bx lr + thumb_func_end nullsub_167 + + thumb_func_start nullsub_168 +nullsub_168: + bx lr + thumb_func_end nullsub_168 + + thumb_func_start sub_80086C8 +sub_80086C8: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + mov r9, r2 + ldr r7, [sp, 0x30] + lsls r2, r1, 3 + adds r2, r1 + lsls r2, 3 + adds r0, r2 + mov r12, r0 + mov r0, r9 + cmp r0, 0 + bge _080086F2 + ldr r1, [sp, 0x2C] + add r1, r9 + str r1, [sp, 0x2C] + movs r2, 0 + mov r9, r2 +_080086F2: + cmp r3, 0 + bge _080086FA + adds r7, r3 + movs r3, 0 +_080086FA: + ldr r0, [sp, 0x2C] + add r0, r9 + mov r4, r12 + movs r5, 0x4 + ldrsh r2, [r4, r5] + lsls r1, r2, 3 + cmp r0, r1 + ble _08008710 + mov r0, r9 + subs r0, r1, r0 + str r0, [sp, 0x2C] +_08008710: + adds r1, r3, r7 + mov r4, r12 + movs r5, 0x8 + ldrsh r0, [r4, r5] + lsls r0, 3 + cmp r1, r0 + ble _08008720 + subs r7, r0, r3 +_08008720: + adds r1, r3, 0 + cmp r3, 0 + bge _08008728 + adds r1, r3, 0x7 +_08008728: + asrs r1, 3 + muls r2, r1 + mov r0, r9 + cmp r0, 0 + bge _08008734 + adds r0, 0x7 +_08008734: + asrs r0, 3 + adds r0, r2, r0 + lsls r0, 3 + lsls r1, 3 + subs r1, r3, r1 + adds r0, r1 + lsls r0, 2 + mov r2, r12 + ldr r1, [r2, 0x18] + b _080087D6 +_08008748: + adds r2, r5, 0 + ldr r4, [sp, 0x2C] + mov r6, r9 + mov r1, r12 + ldr r0, [r1, 0x3C] + cmp r0, r5 + bls _08008758 + str r5, [r1, 0x3C] +_08008758: + subs r0, r7, 0x1 + str r0, [sp, 0x4] + adds r3, 0x1 + str r3, [sp, 0x8] + mov r1, r12 + ldr r1, [r1, 0x40] + str r1, [sp] + adds r0, r5, 0x4 + mov r10, r0 + cmp r4, 0 + ble _080087B6 + ldr r1, _0800878C + mov r8, r1 + movs r7, 0x7 +_08008774: + cmp r4, 0x7 + bgt _08008790 + adds r3, r4, 0 + adds r0, r4, 0 + ands r0, r7 + adds r0, 0x8 + lsls r0, 2 + add r0, r8 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + b _080087AA + .align 2, 0 +_0800878C: .4byte gUnknown_80B8868 +_08008790: + adds r1, r6, 0 + ands r1, r7 + cmp r1, 0 + beq _080087A8 + movs r0, 0x8 + subs r3, r0, r1 + lsls r0, r1, 2 + add r0, r8 + ldr r1, [r2] + ldr r0, [r0] + ands r1, r0 + b _080087AA +_080087A8: + movs r3, 0x8 +_080087AA: + str r1, [r2] + adds r2, 0x20 + subs r4, r3 + adds r6, r3 + cmp r4, 0 + bgt _08008774 +_080087B6: + ldr r7, [sp, 0x4] + ldr r3, [sp, 0x8] + ldr r2, [sp] + cmp r2, r5 + bcs _080087C4 + mov r4, r12 + str r5, [r4, 0x40] +_080087C4: + mov r5, r10 + movs r0, 0x7 + ands r0, r3 + cmp r0, 0 + bne _080087D8 + mov r5, r12 + ldr r0, [r5, 0x20] + lsls r0, 2 + mov r1, r10 +_080087D6: + adds r5, r1, r0 +_080087D8: + cmp r7, 0 + bgt _08008748 + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80086C8 + + thumb_func_start sub_80087EC +sub_80087EC: + push {r4-r6,lr} + sub sp, 0x8 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + ldr r1, [sp, 0x18] + ldr r0, _08008810 + str r3, [sp] + str r1, [sp, 0x4] + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_8008818 + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08008810: .4byte gUnknown_2027370 + thumb_func_end sub_80087EC + + thumb_func_start nullsub_176 +nullsub_176: + bx lr + thumb_func_end nullsub_176 + + thumb_func_start sub_8008818 +sub_8008818: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r3, 0 + ldr r7, [sp, 0x18] + ldr r3, [sp, 0x1C] + mov r12, r3 + lsls r3, r1, 3 + adds r3, r1 + lsls r3, 3 + adds r4, r0, r3 + cmp r2, 0 + bge _08008834 + adds r2, 0x7 +_08008834: + asrs r2, 3 + mov r8, r2 + adds r3, r5, 0 + cmp r3, 0 + bge _08008840 + adds r3, 0x7 +_08008840: + asrs r3, 3 + movs r2, 0 + cmp r2, r12 + bge _08008892 +_08008848: + movs r1, 0x4 + ldrsh r0, [r4, r1] + muls r0, r3 + add r0, r8 + lsls r0, 5 + ldr r1, [r4, 0x18] + adds r1, r0 + movs r5, 0 + adds r3, 0x1 + adds r6, r2, 0 + adds r6, 0x8 + cmp r5, r7 + bge _0800888C + movs r2, 0 +_08008864: + ldr r0, [r4, 0x3C] + cmp r0, r1 + bls _0800886C + str r1, [r4, 0x3C] +_0800886C: + stm r1!, {r2} + stm r1!, {r2} + stm r1!, {r2} + stm r1!, {r2} + stm r1!, {r2} + stm r1!, {r2} + stm r1!, {r2} + str r2, [r1] + ldr r0, [r4, 0x40] + cmp r0, r1 + bcs _08008884 + str r1, [r4, 0x40] +_08008884: + adds r1, 0x4 + adds r5, 0x8 + cmp r5, r7 + blt _08008864 +_0800888C: + adds r2, r6, 0 + cmp r2, r12 + blt _08008848 +_08008892: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8008818 + + thumb_func_start xxx_call_update_bg_vram +xxx_call_update_bg_vram: + push {lr} + movs r1, 0 + ldr r2, _080088C0 + ldrb r0, [r2] + cmp r0, 0 + beq _080088AE + strb r1, [r2] + bl sub_80099C0 +_080088AE: + ldr r0, _080088C4 + bl xxx_update_bg_vram + lsls r0, 24 + lsrs r1, r0, 24 + adds r0, r1, 0 + pop {r1} + bx r1 + .align 2, 0 +_080088C0: .4byte gUnknown_20274A5 +_080088C4: .4byte gUnknown_2027370 + thumb_func_end xxx_call_update_bg_vram + + thumb_func_start xxx_update_bg_vram +xxx_update_bg_vram: + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r0 + movs r2, 0 + movs r1, 0 + movs r7, 0xD0 + lsls r7, 4 +_080088D8: + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 3 + mov r3, r8 + adds r4, r3, r0 + movs r5, 0x4 + ldrsh r0, [r4, r5] + adds r6, r1, 0x1 + cmp r0, 0 + beq _0800897A + ldr r5, [r4, 0x38] + cmp r5, 0 + beq _0800897A + adds r0, r4, 0 + adds r0, 0x45 + ldrb r0, [r0] + cmp r0, 0 + beq _0800894C + ldr r0, [r4, 0x28] + ldr r1, [r4, 0x18] + adds r2, r7, 0 + bl CpuCopy + ldr r0, [r4, 0x18] + adds r2, r0, r7 + ldr r0, [r4, 0x28] + adds r1, r0, r7 + movs r3, 0 + b _08008938 +_08008912: + ldm r2!, {r0} + stm r1!, {r0} + ldm r2!, {r0} + stm r1!, {r0} + ldm r2!, {r0} + stm r1!, {r0} + ldm r2!, {r0} + stm r1!, {r0} + ldm r2!, {r0} + stm r1!, {r0} + ldr r0, _08008944 + stm r1!, {r0} + ldr r0, _08008948 + stm r1!, {r0} + movs r0, 0x1 + negs r0, r0 + stm r1!, {r0} + adds r2, 0xC + adds r3, 0x1 +_08008938: + movs r5, 0x4 + ldrsh r0, [r4, r5] + cmp r3, r0 + blt _08008912 + movs r0, 0 + b _0800896A + .align 2, 0 +_08008944: .4byte 0xdddddddd +_08008948: .4byte 0xeeeeeeee +_0800894C: + ldr r0, [r4, 0x30] + ldr r1, [r4, 0x34] + adds r2, r5, 0 + bl CpuCopy + lsrs r1, r5, 2 + lsls r1, 2 + ldr r0, [r4, 0x34] + adds r0, r1 + str r0, [r4, 0x34] + ldr r0, [r4, 0x30] + adds r0, r5 + str r0, [r4, 0x30] + ldr r0, [r4, 0x38] + subs r0, r5 +_0800896A: + str r0, [r4, 0x38] + ldr r1, [r4, 0x38] + cmp r1, 0 + bne _08008978 + adds r0, r4, 0 + adds r0, 0x44 + strb r1, [r0] +_08008978: + movs r2, 0x1 +_0800897A: + adds r1, r6, 0 + cmp r1, 0x3 + ble _080088D8 + adds r0, r2, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end xxx_update_bg_vram + + thumb_func_start sub_800898C +sub_800898C: + push {lr} + ldr r1, _080089A4 + ldr r2, _080089A8 + movs r3, 0xA0 + lsls r3, 1 + adds r0, r1, r3 +_08008998: + strh r2, [r0] + subs r0, 0x2 + cmp r0, r1 + bge _08008998 + pop {r0} + bx r0 + .align 2, 0 +_080089A4: .4byte gUnknown_3000E94 +_080089A8: .4byte 0x0000f0f0 + thumb_func_end sub_800898C + + thumb_func_start sub_80089AC +sub_80089AC: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r1, [r4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080089C8 + b _08008C44 +_080089C8: + ldr r6, _08008A3C + ldr r7, [r4, 0x4] + cmp r7, 0x1 + bne _08008A60 + movs r0, 0x8 + ldrsh r2, [r4, r0] + movs r1, 0 + ldrsh r0, [r5, r1] + adds r2, r0 + lsls r3, r2, 3 + mov r12, r3 + movs r7, 0xA + ldrsh r1, [r4, r7] + movs r3, 0x2 + ldrsh r0, [r5, r3] + adds r1, r0 + lsls r5, r1, 3 + movs r7, 0xC + ldrsh r0, [r4, r7] + adds r2, r0 + lsls r7, r2, 3 + movs r2, 0xE + ldrsh r0, [r4, r2] + adds r1, r0 + lsls r2, r1, 3 + cmp r0, 0 + bne _08008A00 + b _08008C44 +_08008A00: + cmp r5, 0 + bge _08008A06 + movs r5, 0 +_08008A06: + cmp r2, 0 + bge _08008A0C + movs r2, 0 +_08008A0C: + cmp r5, 0xA0 + ble _08008A12 + movs r5, 0xA0 +_08008A12: + cmp r2, 0xA0 + ble _08008A18 + movs r2, 0xA0 +_08008A18: + cmp r5, r2 + blt _08008A1E + b _08008C44 +_08008A1E: + lsls r3, r5, 1 + adds r1, r6, r3 + ldrb r0, [r1] + cmp r0, 0xF0 + bne _08008A40 + ldrb r0, [r1, 0x1] + cmp r0, 0xF0 + bne _08008A40 + strb r7, [r1] + adds r3, 0x1 + adds r0, r6, r3 + mov r1, r12 + strb r1, [r0] + b _08008A58 + .align 2, 0 +_08008A3C: .4byte gUnknown_3000E94 +_08008A40: + adds r1, r6, r3 + ldrb r0, [r1] + cmp r0, r7 + bge _08008A4A + strb r7, [r1] +_08008A4A: + adds r3, 0x1 + adds r3, r6, r3 + ldrb r0, [r3] + cmp r0, r12 + ble _08008A58 + mov r0, r12 + strb r0, [r3] +_08008A58: + adds r5, 0x1 + cmp r5, r2 + blt _08008A1E + b _08008C44 +_08008A60: + cmp r7, 0x6 + beq _08008A66 + b _08008BA8 +_08008A66: + movs r2, 0x8 + ldrsh r1, [r4, r2] + movs r3, 0 + ldrsh r0, [r5, r3] + adds r1, r0 + lsls r3, r1, 3 + subs r7, r3, 0x5 + mov r9, r7 + movs r2, 0xA + ldrsh r0, [r4, r2] + movs r7, 0x2 + ldrsh r2, [r5, r7] + adds r0, r2 + lsls r2, r0, 3 + subs r5, r2, 0x4 + movs r7, 0xC + ldrsh r2, [r4, r7] + adds r1, r2 + lsls r1, 3 + adds r1, 0x5 + str r1, [sp] + movs r2, 0xE + ldrsh r1, [r4, r2] + adds r0, r1 + lsls r0, 3 + adds r0, 0x5 + mov r8, r0 + adds r3, 0x3 + mov r12, r3 + ldr r2, [r4, 0x14] + ldrb r1, [r2, 0x2] + subs r0, r1, 0x1 + ldrb r3, [r2] + adds r0, r3 + adds r0, 0x2 + lsls r0, 3 + add r0, r12 + subs r0, 0x4 + mov r10, r0 + ldrb r0, [r2, 0x1] + adds r0, 0x1 + lsls r0, 3 + mov r7, r9 + adds r4, r7, r0 + adds r1, 0x2 + lsls r1, 3 + adds r1, r4, r1 + subs r7, r1, 0x4 + cmp r5, 0 + bge _08008ACC + movs r5, 0 +_08008ACC: + mov r0, r8 + cmp r0, 0 + bge _08008AD6 + movs r1, 0 + mov r8, r1 +_08008AD6: + cmp r5, 0xA0 + ble _08008ADC + movs r5, 0xA0 +_08008ADC: + mov r2, r8 + cmp r2, 0xA0 + ble _08008AE6 + movs r3, 0xA0 + mov r8, r3 +_08008AE6: + movs r3, 0x3 +_08008AE8: + lsls r2, r5, 1 + adds r1, r6, r2 + ldrb r0, [r1] + cmp r0, 0xF0 + bne _08008B02 + ldrb r0, [r1, 0x1] + cmp r0, 0xF0 + bne _08008B02 + strb r7, [r1] + adds r2, 0x1 + adds r0, r6, r2 + strb r4, [r0] + b _08008B18 +_08008B02: + adds r1, r6, r2 + ldrb r0, [r1] + cmp r0, r7 + bge _08008B0C + strb r7, [r1] +_08008B0C: + adds r2, 0x1 + adds r2, r6, r2 + ldrb r0, [r2] + cmp r0, r4 + ble _08008B18 + strb r4, [r2] +_08008B18: + adds r5, 0x1 + subs r3, 0x1 + cmp r3, 0 + bge _08008AE8 + movs r3, 0x7 +_08008B22: + lsls r1, r5, 1 + adds r2, r6, r1 + ldrb r0, [r2] + cmp r0, 0xF0 + bne _08008B40 + ldrb r0, [r2, 0x1] + cmp r0, 0xF0 + bne _08008B40 + mov r7, r10 + strb r7, [r2] + adds r1, 0x1 + adds r0, r6, r1 + mov r1, r12 + strb r1, [r0] + b _08008B5A +_08008B40: + adds r2, r6, r1 + ldrb r0, [r2] + cmp r0, r10 + bge _08008B4C + mov r7, r10 + strb r7, [r2] +_08008B4C: + adds r1, 0x1 + adds r1, r6, r1 + ldrb r0, [r1] + cmp r0, r12 + ble _08008B5A + mov r0, r12 + strb r0, [r1] +_08008B5A: + adds r5, 0x1 + subs r3, 0x1 + cmp r3, 0 + bge _08008B22 + cmp r5, r8 + bge _08008C44 +_08008B66: + lsls r1, r5, 1 + adds r2, r6, r1 + ldrb r0, [r2] + cmp r0, 0xF0 + bne _08008B86 + ldrb r0, [r2, 0x1] + cmp r0, 0xF0 + bne _08008B86 + mov r3, sp + ldrb r3, [r3] + strb r3, [r2] + adds r1, 0x1 + adds r0, r6, r1 + mov r7, r9 + strb r7, [r0] + b _08008BA0 +_08008B86: + adds r2, r6, r1 + ldrb r0, [r2] + ldr r3, [sp] + cmp r0, r3 + bge _08008B92 + strb r3, [r2] +_08008B92: + adds r1, 0x1 + adds r1, r6, r1 + ldrb r0, [r1] + cmp r0, r9 + ble _08008BA0 + mov r0, r9 + strb r0, [r1] +_08008BA0: + adds r5, 0x1 + cmp r5, r8 + blt _08008B66 + b _08008C44 +_08008BA8: + movs r1, 0x8 + ldrsh r0, [r4, r1] + movs r2, 0 + ldrsh r1, [r5, r2] + adds r0, r1 + lsls r1, r0, 3 + subs r1, 0x5 + mov r8, r1 + movs r3, 0xA + ldrsh r2, [r4, r3] + movs r3, 0x2 + ldrsh r1, [r5, r3] + adds r2, r1 + lsls r5, r2, 3 + mov r9, r5 + mov r3, r9 + subs r3, 0x5 + movs r5, 0xC + ldrsh r1, [r4, r5] + adds r0, r1 + lsls r0, 3 + adds r0, 0x5 + mov r12, r0 + movs r1, 0xE + ldrsh r0, [r4, r1] + adds r2, r0 + lsls r1, r2, 3 + adds r5, r1, 0x5 + cmp r0, 0 + beq _08008C44 + cmp r7, 0 + bne _08008BEC + adds r3, 0x8 + subs r5, r1, 0x3 +_08008BEC: + cmp r3, 0 + bge _08008BF2 + movs r3, 0 +_08008BF2: + cmp r5, 0 + bge _08008BF8 + movs r5, 0 +_08008BF8: + cmp r3, 0xA0 + ble _08008BFE + movs r3, 0xA0 +_08008BFE: + cmp r5, 0xA0 + ble _08008C40 + movs r5, 0xA0 + b _08008C40 +_08008C06: + lsls r1, r3, 1 + adds r2, r6, r1 + ldrb r0, [r2] + cmp r0, 0xF0 + bne _08008C24 + ldrb r0, [r2, 0x1] + cmp r0, 0xF0 + bne _08008C24 + mov r7, r12 + strb r7, [r2] + adds r1, 0x1 + adds r0, r6, r1 + mov r1, r8 + strb r1, [r0] + b _08008C3E +_08008C24: + adds r2, r6, r1 + ldrb r0, [r2] + cmp r0, r12 + bge _08008C30 + mov r7, r12 + strb r7, [r2] +_08008C30: + adds r1, 0x1 + adds r1, r6, r1 + ldrb r0, [r1] + cmp r0, r8 + ble _08008C3E + mov r0, r8 + strb r0, [r1] +_08008C3E: + adds r3, 0x1 +_08008C40: + cmp r3, r5 + blt _08008C06 +_08008C44: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80089AC + + thumb_func_start sub_8008C54 +sub_8008C54: + push {lr} + adds r1, r0, 0 + ldr r0, _08008C64 + bl sub_8008C6C + pop {r0} + bx r0 + .align 2, 0 +_08008C64: .4byte gUnknown_2027370 + thumb_func_end sub_8008C54 + + thumb_func_start nullsub_169 +nullsub_169: + bx lr + thumb_func_end nullsub_169 + + thumb_func_start sub_8008C6C +sub_8008C6C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + mov r9, r0 + mov r8, r1 + lsls r0, r1, 3 + add r0, r8 + lsls r0, 3 + mov r1, r9 + adds r6, r1, r0 + adds r0, r6, 0 + adds r0, 0x45 + ldrb r0, [r0] + cmp r0, 0 + bne _08008CBE + movs r2, 0x4 + ldrsh r0, [r6, r2] + movs r7, 0x8 + ldrsh r1, [r6, r7] + muls r0, r1 + lsls r4, r0, 5 + movs r5, 0 + movs r0, 0x44 + adds r0, r6 + mov r10, r0 + cmp r5, r4 + bge _08008D1E +_08008CA8: + lsrs r1, r5, 2 + lsls r1, 2 + ldr r0, [r6, 0x18] + adds r0, r1 + movs r1, 0x20 + bl CpuClear + adds r5, 0x20 + cmp r5, r4 + blt _08008CA8 + b _08008D1E +_08008CBE: + movs r1, 0x4 + ldrsh r0, [r6, r1] + movs r2, 0x8 + ldrsh r1, [r6, r2] + subs r1, 0x1 + muls r1, r0 + lsls r1, 5 + str r1, [sp, 0x8] + ldr r4, [r6, 0x18] + movs r5, 0 + movs r7, 0x44 + adds r7, r6 + mov r10, r7 + cmp r5, r0 + bge _08008D04 + movs r0, 0x1 + negs r0, r0 + mov r12, r0 + movs r1, 0 + ldr r3, _08008D84 + ldr r2, _08008D88 +_08008CE8: + mov r7, r12 + stm r4!, {r7} + stm r4!, {r3} + stm r4!, {r2} + stm r4!, {r1} + stm r4!, {r1} + stm r4!, {r1} + stm r4!, {r1} + stm r4!, {r1} + adds r5, 0x1 + movs r7, 0x4 + ldrsh r0, [r6, r7] + cmp r5, r0 + blt _08008CE8 +_08008D04: + movs r5, 0 + ldr r0, [sp, 0x8] + cmp r5, r0 + bge _08008D1E +_08008D0C: + adds r0, r4, 0 + movs r1, 0x20 + bl CpuClear + adds r4, 0x20 + adds r5, 0x20 + ldr r1, [sp, 0x8] + cmp r5, r1 + blt _08008D0C +_08008D1E: + ldr r0, [r6, 0xC] + cmp r0, 0x6 + bne _08008D60 + adds r5, r6, 0 + adds r5, 0x46 + movs r4, 0 + movs r0, 0x1 + strb r0, [r5] + movs r2, 0x4 + ldrsh r0, [r6, r2] + lsls r0, 3 + str r0, [sp] + movs r0, 0xE + str r0, [sp, 0x4] + mov r0, r9 + mov r1, r8 + movs r2, 0 + movs r3, 0xA + bl sub_8007958 + movs r7, 0x4 + ldrsh r0, [r6, r7] + lsls r0, 3 + str r0, [sp] + movs r0, 0xD + str r0, [sp, 0x4] + mov r0, r9 + mov r1, r8 + movs r2, 0 + movs r3, 0xB + bl sub_8007958 + strb r4, [r5] +_08008D60: + ldr r0, [r6, 0x28] + str r0, [r6, 0x30] + ldr r0, [r6, 0x1C] + str r0, [r6, 0x34] + ldr r0, [r6, 0x2C] + str r0, [r6, 0x38] + movs r0, 0x1 + mov r1, r10 + strb r0, [r1] + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08008D84: .4byte 0xeeeeeeee +_08008D88: .4byte 0xdddddddd + thumb_func_end sub_8008C6C + + thumb_func_start sub_8008D8C +sub_8008D8C: + push {lr} + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 3 + ldr r0, _08008DA4 + adds r1, r0 + ldr r0, [r1, 0x38] + cmp r0, 0 + beq _08008DA0 + movs r0, 0x1 +_08008DA0: + pop {r1} + bx r1 + .align 2, 0 +_08008DA4: .4byte gUnknown_2027370 + thumb_func_end sub_8008D8C + + thumb_func_start sub_8008DA8 +sub_8008DA8: + movs r0, 0 + bx lr + thumb_func_end sub_8008DA8 + + thumb_func_start sub_8008DAC +sub_8008DAC: + ldr r3, _08008DC0 + lsls r0, 1 + lsls r1, 6 + adds r0, r1 + adds r0, r3 + strh r2, [r0] + ldr r1, _08008DC4 + movs r0, 0x1 + strb r0, [r1] + bx lr + .align 2, 0 +_08008DC0: .4byte gUnknown_202B038 +_08008DC4: .4byte gUnknown_20274A5 + thumb_func_end sub_8008DAC + + thumb_func_start sub_8008DC8 +sub_8008DC8: + push {r4,lr} + ldr r4, _08008DEC + lsls r0, 1 + lsls r1, 6 + adds r0, r1 + adds r1, r0, r4 + strh r2, [r1] + movs r1, 0x80 + lsls r1, 4 + adds r4, r1 + adds r0, r4 + strh r3, [r0] + ldr r1, _08008DF0 + movs r0, 0x1 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08008DEC: .4byte gUnknown_202B038 +_08008DF0: .4byte gUnknown_20274A5 + thumb_func_end sub_8008DC8 + + thumb_func_start sub_8008DF4 +sub_8008DF4: + push {r4-r7,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r3, r2, 0 + ldrb r0, [r3] + ldr r1, _08008E4C + mov r12, r1 + cmp r0, 0 + beq _08008E3E + ldr r6, _08008E50 +_08008E08: + ldrb r1, [r3] + adds r0, r1, 0 + subs r0, 0x61 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x19 + bhi _08008E1E + adds r0, r1, 0 + subs r0, 0x20 + lsls r0, 24 + lsrs r1, r0, 24 +_08008E1E: + lsls r2, r4, 1 + lsls r0, r5, 6 + adds r2, r0 + adds r2, r6 + movs r7, 0x96 + lsls r7, 2 + adds r0, r1, r7 + ldr r7, _08008E54 + adds r1, r7, 0 + orrs r0, r1 + strh r0, [r2] + adds r3, 0x1 + adds r4, 0x1 + ldrb r0, [r3] + cmp r0, 0 + bne _08008E08 +_08008E3E: + movs r0, 0x1 + mov r1, r12 + strb r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08008E4C: .4byte gUnknown_20274A5 +_08008E50: .4byte gUnknown_202B038 +_08008E54: .4byte 0xfffff000 + thumb_func_end sub_8008DF4 + + thumb_func_start sub_8008E58 +sub_8008E58: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + mov r8, r1 + adds r4, r2, 0 + ldrb r0, [r4] + ldr r7, _08008EC4 + cmp r0, 0 + beq _08008EB4 + adds r1, r0, 0 + cmp r3, 0 + beq _08008EB4 + ldr r0, _08008EC8 + mov r12, r0 +_08008E76: + adds r0, r1, 0 + subs r0, 0x61 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x19 + bhi _08008E8A + adds r0, r1, 0 + subs r0, 0x20 + lsls r0, 24 + lsrs r1, r0, 24 +_08008E8A: + lsls r2, r5, 1 + mov r6, r8 + lsls r0, r6, 6 + adds r2, r0 + add r2, r12 + movs r6, 0x96 + lsls r6, 2 + adds r0, r1, r6 + ldr r6, _08008ECC + adds r1, r6, 0 + orrs r0, r1 + strh r0, [r2] + adds r4, 0x1 + adds r5, 0x1 + subs r3, 0x1 + ldrb r0, [r4] + cmp r0, 0 + beq _08008EB4 + adds r1, r0, 0 + cmp r3, 0 + bne _08008E76 +_08008EB4: + movs r0, 0x1 + strb r0, [r7] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08008EC4: .4byte gUnknown_20274A5 +_08008EC8: .4byte gUnknown_202B038 +_08008ECC: .4byte 0xfffff000 + thumb_func_end sub_8008E58 + + thumb_func_start sub_8008ED0 +sub_8008ED0: + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + movs r5, 0 + b _08008F64 +_08008EDA: + ldr r0, _08008F18 + cmp r1, r0 + beq _08008F64 + adds r0, 0x2 + cmp r1, r0 + beq _08008F64 + cmp r1, 0x1B + beq _08008F7E + cmp r1, 0x23 + bne _08008F44 + ldrb r0, [r2] + cmp r0, 0x6E + beq _08008F7E + cmp r0, 0x5B + beq _08008F7E + cmp r0, 0x50 + beq _08008F7E + cmp r0, 0x57 + beq _08008F40 + cmp r0, 0x57 + bgt _08008F22 + cmp r0, 0x43 + beq _08008F38 + cmp r0, 0x43 + bgt _08008F1C + cmp r0, 0x2B + beq _08008F40 + cmp r0, 0x3D + beq _08008F34 + b _08008F64 + .align 2, 0 +_08008F18: .4byte 0x000082a0 +_08008F1C: + cmp r0, 0x52 + beq _08008F3C + b _08008F64 +_08008F22: + cmp r0, 0x72 + beq _08008F3C + cmp r0, 0x72 + bgt _08008F30 + cmp r0, 0x63 + beq _08008F38 + b _08008F64 +_08008F30: + cmp r0, 0x7E + bne _08008F64 +_08008F34: + adds r4, r2, 0x2 + b _08008F64 +_08008F38: + adds r4, 0x2 + b _08008F64 +_08008F3C: + adds r4, 0x1 + b _08008F64 +_08008F40: + adds r4, r2, 0x1 + b _08008F64 +_08008F44: + cmp r1, 0x60 + bne _08008F4C + adds r5, 0x6 + b _08008F64 +_08008F4C: + adds r0, r1, 0 + bl sub_8008584 + cmp r0, 0 + beq _08008F64 + movs r1, 0x6 + ldrsh r0, [r0, r1] + ldr r1, _08008F88 + movs r2, 0 + ldrsh r1, [r1, r2] + adds r0, r1 + adds r5, r0 +_08008F64: + adds r0, r4, 0 + mov r1, sp + bl xxx_get_next_char_from_string + adds r2, r0, 0 + adds r4, r2, 0 + ldr r1, [sp] + cmp r1, 0 + beq _08008F7E + cmp r1, 0xD + beq _08008F7E + cmp r1, 0xA + bne _08008EDA +_08008F7E: + adds r0, r5, 0 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08008F88: .4byte gUnknown_2027498 + thumb_func_end sub_8008ED0 + + thumb_func_start sub_8008F8C +sub_8008F8C: + push {r4-r6,lr} + sub sp, 0x10 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + ldr r1, [sp, 0x20] + ldr r2, [sp, 0x24] + ldr r0, _08008FB8 + str r3, [sp] + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + str r2, [sp, 0xC] + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl xxx_draw_string + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08008FB8: .4byte gUnknown_2027370 + thumb_func_end sub_8008F8C + + thumb_func_start xxx_call_draw_string +xxx_call_draw_string: + push {r4-r6,lr} + sub sp, 0x10 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + ldr r1, [sp, 0x20] + ldr r0, _08008FE8 + str r3, [sp] + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0xD + str r1, [sp, 0xC] + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl xxx_draw_string + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08008FE8: .4byte gUnknown_2027370 + thumb_func_end xxx_call_draw_string + + thumb_func_start nullsub_170 +nullsub_170: + bx lr + thumb_func_end nullsub_170 + + thumb_func_start sub_8008FF0 +sub_8008FF0: + push {r4-r6,lr} + sub sp, 0x10 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + ldr r1, [sp, 0x20] + ldr r0, _0800901C + str r3, [sp] + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r1, 0xD + str r1, [sp, 0xC] + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl xxx_draw_string + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0800901C: .4byte gUnknown_2027370 + thumb_func_end sub_8008FF0 + + thumb_func_start nullsub_171 +nullsub_171: + bx lr + thumb_func_end nullsub_171 + + thumb_func_start xxx_draw_string +xxx_draw_string: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x40 + adds r5, r0, 0 + adds r4, r3, 0 + ldr r0, [sp, 0x5C] + mov r8, r0 + ldr r7, [sp, 0x64] + add r0, sp, 0x8 + strh r1, [r0] + strh r2, [r0, 0x2] + str r1, [sp, 0x14] + movs r0, 0x7 + str r0, [sp, 0x18] + add r2, sp, 0x3C + mov r9, r2 + b _08009128 +_0800904A: + ldr r0, _08009058 + cmp r3, r0 + bne _08009060 + ldr r1, _0800905C + movs r0, 0 + str r0, [r1] + b _08009128 + .align 2, 0 +_08009058: .4byte 0x000082a0 +_0800905C: .4byte gUnknown_20274AC +_08009060: + ldr r0, _08009070 + cmp r3, r0 + bne _08009078 + ldr r1, _08009074 + movs r0, 0x1 + str r0, [r1] + b _08009128 + .align 2, 0 +_08009070: .4byte 0x000082a2 +_08009074: .4byte gUnknown_20274AC +_08009078: + cmp r3, 0x1B + beq _0800914A + cmp r3, 0xD + beq _08009084 + cmp r3, 0xA + bne _08009096 +_08009084: + add r1, sp, 0x8 + ldr r0, [sp, 0x14] + strh r0, [r1] + adds r0, r1, 0 + ldrh r0, [r0, 0x2] + ldr r3, [sp, 0x68] + adds r0, r3 + strh r0, [r1, 0x2] + b _08009128 +_08009096: + cmp r3, 0x1D + bne _080090AA + add r1, sp, 0x8 + ldr r0, [sp, 0x14] + strh r0, [r1] + adds r0, r1, 0 + ldrh r0, [r0, 0x2] + adds r0, 0x5 + strh r0, [r1, 0x2] + b _08009128 +_080090AA: + cmp r3, 0x60 + bne _080090B8 + add r1, sp, 0x8 + adds r0, r1, 0 + ldrh r0, [r0] + adds r0, 0x6 + b _08009126 +_080090B8: + cmp r7, 0 + bne _080090E0 + add r0, sp, 0x8 + movs r6, 0 + ldrsh r1, [r0, r6] + movs r6, 0x2 + ldrsh r2, [r0, r6] + ldr r0, [sp, 0x18] + str r0, [sp] + mov r0, r8 + str r0, [sp, 0x4] + adds r0, r5, 0 + bl xxx_draw_char + add r2, sp, 0x8 + adds r1, r2, 0 + ldrh r1, [r1] + adds r1, r0 + strh r1, [r2] + b _08009128 +_080090E0: + adds r0, r3, 0 + bl sub_8008584 + adds r2, r0, 0 + cmp r2, 0 + beq _08009128 + add r0, sp, 0x8 + movs r3, 0 + ldrsh r1, [r0, r3] + ldr r0, _08009158 + movs r6, 0 + ldrsh r0, [r0, r6] + adds r0, 0xA + movs r3, 0x6 + ldrsh r2, [r2, r3] + subs r0, r2 + lsrs r2, r0, 31 + adds r0, r2 + asrs r0, 1 + adds r1, r0 + add r0, sp, 0x8 + movs r6, 0x2 + ldrsh r2, [r0, r6] + ldr r3, [sp, 0x3C] + ldr r0, [sp, 0x18] + str r0, [sp] + mov r0, r8 + str r0, [sp, 0x4] + adds r0, r5, 0 + bl xxx_draw_char + add r1, sp, 0x8 + adds r0, r1, 0 + ldrh r0, [r0] + adds r0, r7 +_08009126: + strh r0, [r1] +_08009128: + adds r0, r5, 0 + adds r1, r4, 0 + add r2, sp, 0x8 + bl sub_80091AC + adds r4, r0, 0 + mov r1, r9 + bl xxx_get_next_char_from_string + adds r4, r0, 0 + ldr r3, [sp, 0x3C] + cmp r3, 0 + beq _0800914A + ldr r2, [sp, 0x60] + cmp r3, r2 + beq _0800914A + b _0800904A +_0800914A: + add sp, 0x40 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08009158: .4byte gUnknown_2027498 + thumb_func_end xxx_draw_string + + thumb_func_start sub_800915C +sub_800915C: + push {r4,lr} + adds r3, r0, 0 + movs r2, 0 +_08009162: + ldrb r0, [r1] + cmp r0, 0x2E + beq _08009184 + subs r0, 0x30 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x9 + bhi _08009186 + lsls r0, r2, 2 + adds r0, r2 + lsls r2, r0, 1 + adds r0, r2, 0 + subs r0, 0x30 + ldrb r4, [r1] + adds r2, r0, r4 + adds r1, 0x1 + b _08009162 +_08009184: + adds r1, 0x1 +_08009186: + strh r2, [r3] + adds r0, r1, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_800915C + + thumb_func_start sub_8009190 +sub_8009190: + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + ldr r0, _080091A4 + adds r1, r3, 0 + bl sub_80091AC + pop {r1} + bx r1 + .align 2, 0 +_080091A4: .4byte gUnknown_2027370 + thumb_func_end sub_8009190 + + thumb_func_start sub_80091A8 +sub_80091A8: + adds r0, 0x1 + bx lr + thumb_func_end sub_80091A8 + + thumb_func_start sub_80091AC +sub_80091AC: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r8, r0 + adds r4, r1, 0 + adds r5, r2, 0 + movs r0, 0 + mov r9, r0 + movs r7, 0x1 +_080091C0: + ldrb r0, [r4] + cmp r0, 0x23 + beq _080091C8 + b _0800937A +_080091C8: + ldrb r0, [r4, 0x1] + adds r1, r0, 0 + cmp r1, 0x5B + bne _08009216 + adds r2, r4, 0 + adds r4, 0x2 + adds r0, r5, 0 + adds r0, 0x21 + mov r1, r9 + strb r1, [r0] + ldrb r1, [r4] + adds r6, r0, 0 + cmp r1, 0 + beq _080091F6 + cmp r1, 0x5D + beq _080091F4 +_080091E8: + adds r4, 0x1 + ldrb r0, [r4] + cmp r0, 0 + beq _080091F6 + cmp r0, 0x5D + bne _080091E8 +_080091F4: + adds r4, 0x1 +_080091F6: + ldr r3, [r5, 0x24] + cmp r3, 0 + beq _0800920C + adds r0, r2, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl _call_via_r3 + cmp r0, 0 + beq _0800920C + adds r4, r0, 0 +_0800920C: + ldrb r0, [r6] + cmp r0, 0 + beq _08009214 + b _0800937A +_08009214: + b _080091C0 +_08009216: + cmp r1, 0x3D + bne _08009220 + ldrb r0, [r4, 0x2] + strh r0, [r5] + b _080092BA +_08009220: + cmp r1, 0x79 + bne _0800922A + ldrb r0, [r4, 0x2] + strh r0, [r5, 0x2] + b _080092BA +_0800922A: + cmp r1, 0x3E + bne _0800923A + adds r1, r4, 0x2 + adds r0, r5, 0 + bl sub_800915C + adds r4, r0, 0 + b _080091C0 +_0800923A: + cmp r1, 0x2E + bne _08009246 + ldrh r0, [r5] + ldrb r2, [r4, 0x2] + adds r0, r2 + b _0800926E +_08009246: + cmp r1, 0x6E + bne _08009258 + ldr r0, [r5, 0xC] + strh r0, [r5] + ldrh r0, [r5, 0x2] + adds r0, 0xB + strh r0, [r5, 0x2] + adds r4, 0x2 + b _080091C0 +_08009258: + cmp r1, 0x3A + bne _08009264 + ldrh r0, [r5] + strh r0, [r5, 0x4] + adds r4, 0x2 + b _080091C0 +_08009264: + cmp r1, 0x3B + bne _08009274 + ldrh r0, [r5, 0x4] + ldrb r3, [r4, 0x2] + adds r0, r3 +_0800926E: + strh r0, [r5] + adds r4, 0x3 + b _080091C0 +_08009274: + cmp r1, 0x2B + bne _0800929A + adds r4, 0x2 + adds r0, r4, 0 + bl sub_8008ED0 + mov r2, r8 + movs r3, 0x4 + ldrsh r1, [r2, r3] + lsls r1, 3 + subs r1, r0 + strh r1, [r5] + movs r1, 0 + ldrsh r0, [r5, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + strh r0, [r5] + b _080091C0 +_0800929A: + cmp r1, 0x43 + bne _080092A4 + ldr r0, [r5, 0x10] + str r0, [r5, 0x14] + b _080092DC +_080092A4: + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5F + bne _080092CC + ldr r0, [r5, 0x10] + str r0, [r5, 0x14] + ldr r1, _080092C8 + ldrb r0, [r4, 0x2] + adds r0, r1 + ldrb r0, [r0] + str r0, [r5, 0x10] +_080092BA: + adds r4, 0x3 + ldrb r0, [r4] + cmp r0, 0x2E + beq _080092C4 + b _080091C0 +_080092C4: + adds r4, 0x1 + b _080091C0 + .align 2, 0 +_080092C8: .4byte gUnknown_202749A +_080092CC: + cmp r0, 0x52 + bne _080092D4 + ldr r0, [r5, 0x14] + b _080092EE +_080092D4: + cmp r0, 0x63 + bne _080092E8 + ldr r0, [r5, 0x10] + str r0, [r5, 0x18] +_080092DC: + ldrb r0, [r4, 0x2] + bl sub_800963C + str r0, [r5, 0x10] + adds r4, 0x3 + b _080091C0 +_080092E8: + cmp r0, 0x72 + bne _080092F4 + ldr r0, [r5, 0x18] +_080092EE: + str r0, [r5, 0x10] + adds r4, 0x2 + b _080091C0 +_080092F4: + cmp r0, 0x53 + bne _08009314 + ldr r3, _08009310 + ldrb r2, [r4, 0x2] + movs r0, 0x7F + adds r1, r0, 0 + ands r1, r2 + adds r1, r3 + ldrb r2, [r4, 0x3] + ands r0, r2 + strb r0, [r1] + adds r4, 0x4 + b _080091C0 + .align 2, 0 +_08009310: .4byte gUnknown_20274A6 +_08009314: + cmp r0, 0x57 + bne _0800933A + adds r4, 0x2 + mov r2, r8 + movs r3, 0 + ldrsh r0, [r2, r3] + lsls r0, 3 + ldrh r1, [r5] + adds r0, r1 + subs r0, 0x2 + strh r0, [r5, 0x8] + movs r3, 0x2 + ldrsh r0, [r2, r3] + lsls r0, 3 + ldrh r1, [r5, 0x2] + adds r0, r1 + adds r0, 0x3 + strh r0, [r5, 0xA] + b _0800935C +_0800933A: + cmp r0, 0x50 + bne _08009350 + adds r4, 0x2 + ldr r0, _0800934C + strh r0, [r5, 0x2] + mov r2, r9 + str r2, [r5, 0x1C] + b _0800935C + .align 2, 0 +_0800934C: .4byte 0x0000270f +_08009350: + cmp r0, 0x70 + bne _08009368 + adds r4, 0x2 + ldr r0, _08009364 + strh r0, [r5, 0x2] + str r7, [r5, 0x1C] +_0800935C: + adds r0, r5, 0 + adds r0, 0x20 + strb r7, [r0] + b _0800937A + .align 2, 0 +_08009364: .4byte 0x0000270f +_08009368: + cmp r0, 0x7E + bne _0800937A + ldrb r0, [r4, 0x2] + str r0, [r5, 0x2C] + adds r0, r5, 0 + adds r0, 0x21 + strb r7, [r0] + adds r4, 0x3 + b _080091C0 +_0800937A: + adds r0, r4, 0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80091AC + + thumb_func_start sub_8009388 +sub_8009388: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r2, _080093F4 + ldr r6, _080093F8 + strh r6, [r2] + movs r0, 0x80 + lsls r0, 4 + adds r5, r2, r0 + ldr r4, _080093FC + strh r4, [r5] + ldr r0, _08009400 + ldr r3, [r0] + ldr r0, _08009404 + ldr r1, [r0] + mov r9, r0 + cmp r3, r1 + bge _080093E6 + mov r8, r2 + mov r12, r6 + adds r6, r5, 0 + movs r5, 0 + adds r7, r6, 0 +_080093B8: + lsls r0, r3, 6 + mov r1, r8 + adds r2, r0, r1 + mov r1, r12 + strh r1, [r2] + adds r1, r0, r6 + strh r4, [r1] + adds r3, 0x1 + adds r0, r7 + adds r0, 0x2 + adds r2, 0x2 + movs r1, 0x1E +_080093D0: + strh r5, [r2] + strh r4, [r0] + adds r0, 0x2 + adds r2, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _080093D0 + mov r1, r9 + ldr r0, [r1] + cmp r3, r0 + blt _080093B8 +_080093E6: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080093F4: .4byte gUnknown_202B038 +_080093F8: .4byte 0x0000f279 +_080093FC: .4byte 0x0000f27a +_08009400: .4byte gUnknown_202B020 +_08009404: .4byte gUnknown_202B024 + thumb_func_end sub_8009388 + + thumb_func_start sub_8009408 +sub_8009408: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r5, r1, 0 + ldr r1, _08009478 + ldr r6, _0800947C + strh r6, [r1] + movs r2, 0x80 + lsls r2, 4 + adds r4, r1, r2 + ldr r2, _08009480 + strh r2, [r4] + adds r3, r0, 0 + ldr r0, _08009484 + mov r10, r0 + cmp r3, r5 + bge _08009464 + mov r9, r1 + mov r8, r6 + adds r7, r4, 0 + adds r4, r2, 0 + movs r6, 0 + mov r12, r7 +_0800943A: + lsls r0, r3, 6 + mov r1, r9 + adds r2, r0, r1 + mov r1, r8 + strh r1, [r2] + adds r1, r0, r7 + strh r4, [r1] + adds r3, 0x1 + add r0, r12 + adds r0, 0x2 + adds r2, 0x2 + movs r1, 0x1E +_08009452: + strh r6, [r2] + strh r4, [r0] + adds r0, 0x2 + adds r2, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _08009452 + cmp r3, r5 + blt _0800943A +_08009464: + movs r0, 0x1 + mov r2, r10 + strb r0, [r2] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08009478: .4byte gUnknown_202B038 +_0800947C: .4byte 0x0000f279 +_08009480: .4byte 0x0000f27a +_08009484: .4byte gUnknown_20274A5 + thumb_func_end sub_8009408 + + thumb_func_start sub_8009488 +sub_8009488: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 3 + ldr r0, _08009514 + adds r4, r1, r0 + movs r0, 0x2 + ldrsh r1, [r4, r0] + movs r3, 0 + movs r2, 0x6 + ldrsh r0, [r4, r2] + cmp r3, r0 + bge _08009506 + ldr r6, _08009518 + mov r9, r6 + ldr r0, _0800951C + mov r8, r0 + movs r2, 0x80 + lsls r2, 4 + add r2, r8 + mov r10, r2 +_080094BA: + movs r6, 0 + ldrsh r2, [r4, r6] + movs r5, 0 + movs r6, 0x4 + ldrsh r0, [r4, r6] + adds r6, r1, 0x1 + adds r7, r3, 0x1 + cmp r5, r0 + bge _080094FA + movs r0, 0xFC + lsls r0, 8 + mov r12, r0 + lsls r2, 1 + lsls r1, 6 + mov r3, r10 + adds r0, r1, r3 + adds r3, r2, r0 + add r1, r8 + adds r2, r1 +_080094E0: + ldrh r0, [r2] + mov r1, r12 + ands r1, r0 + strh r1, [r2] + mov r0, r9 + strh r0, [r3] + adds r3, 0x2 + adds r2, 0x2 + adds r5, 0x1 + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r5, r0 + blt _080094E0 +_080094FA: + adds r1, r6, 0 + adds r3, r7, 0 + movs r2, 0x6 + ldrsh r0, [r4, r2] + cmp r3, r0 + blt _080094BA +_08009506: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08009514: .4byte gUnknown_2027370 +_08009518: .4byte 0x0000f27a +_0800951C: .4byte gUnknown_202B038 + thumb_func_end sub_8009488 + + thumb_func_start nullsub_172 +nullsub_172: + bx lr + thumb_func_end nullsub_172 + + thumb_func_start sub_8009524 +sub_8009524: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 3 + ldr r0, _080095BC + adds r4, r1, r0 + movs r1, 0x2 + ldrsh r0, [r4, r1] + subs r1, r0, 0x1 + movs r3, 0 + movs r2, 0x6 + ldrsh r0, [r4, r2] + adds r0, 0x2 + cmp r3, r0 + bge _080095AE + ldr r6, _080095C0 + mov r9, r6 + ldr r0, _080095C4 + mov r8, r0 + movs r2, 0x80 + lsls r2, 4 + add r2, r8 + mov r10, r2 +_0800955A: + movs r6, 0 + ldrsh r0, [r4, r6] + subs r2, r0, 0x1 + movs r5, 0 + movs r6, 0x4 + ldrsh r0, [r4, r6] + adds r0, 0x2 + adds r6, r1, 0x1 + adds r7, r3, 0x1 + cmp r5, r0 + bge _080095A0 + movs r0, 0xFC + lsls r0, 8 + mov r12, r0 + lsls r2, 1 + lsls r1, 6 + mov r3, r10 + adds r0, r1, r3 + adds r3, r2, r0 + add r1, r8 + adds r2, r1 +_08009584: + ldrh r0, [r2] + mov r1, r12 + ands r1, r0 + strh r1, [r2] + mov r0, r9 + strh r0, [r3] + adds r3, 0x2 + adds r2, 0x2 + adds r5, 0x1 + movs r1, 0x4 + ldrsh r0, [r4, r1] + adds r0, 0x2 + cmp r5, r0 + blt _08009584 +_080095A0: + adds r1, r6, 0 + adds r3, r7, 0 + movs r2, 0x6 + ldrsh r0, [r4, r2] + adds r0, 0x2 + cmp r3, r0 + blt _0800955A +_080095AE: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080095BC: .4byte gUnknown_2027370 +_080095C0: .4byte 0x0000f27a +_080095C4: .4byte gUnknown_202B038 + thumb_func_end sub_8009524 + + thumb_func_start nullsub_173 +nullsub_173: + bx lr + thumb_func_end nullsub_173 + + thumb_func_start sub_80095CC +sub_80095CC: + ldr r2, _080095D8 + str r0, [r2] + ldr r0, _080095DC + str r1, [r0] + bx lr + .align 2, 0 +_080095D8: .4byte gUnknown_202B020 +_080095DC: .4byte gUnknown_202B024 + thumb_func_end sub_80095CC + + thumb_func_start nullsub_174 +nullsub_174: + bx lr + thumb_func_end nullsub_174 + + thumb_func_start sub_80095E4 +sub_80095E4: + push {lr} + cmp r1, 0 + bne _080095EC + movs r1, 0xA +_080095EC: + muls r1, r0 + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + beq _08009604 + adds r0, r1, 0 + cmp r1, 0 + bge _080095FE + adds r0, r1, 0x7 +_080095FE: + asrs r0, 3 + adds r0, 0x1 + b _0800960E +_08009604: + adds r0, r1, 0 + cmp r0, 0 + bge _0800960C + adds r0, 0x7 +_0800960C: + asrs r0, 3 +_0800960E: + pop {r1} + bx r1 + thumb_func_end sub_80095E4 + + thumb_func_start sub_8009614 +sub_8009614: + push {lr} + muls r1, r0 + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + beq _0800962E + adds r0, r1, 0 + cmp r1, 0 + bge _08009628 + adds r0, r1, 0x7 +_08009628: + asrs r0, 3 + adds r0, 0x1 + b _08009638 +_0800962E: + adds r0, r1, 0 + cmp r0, 0 + bge _08009636 + adds r0, 0x7 +_08009636: + asrs r0, 3 +_08009638: + pop {r1} + bx r1 + thumb_func_end sub_8009614 + + thumb_func_start sub_800963C +sub_800963C: + push {lr} + lsls r0, 24 + lsrs r0, 24 + adds r2, r0, 0 + cmp r0, 0xF + bls _080096DA + adds r1, r0, 0 + subs r1, 0x30 + lsls r0, r1, 24 + lsrs r0, 24 + cmp r0, 0xF + bhi _08009658 + adds r0, r1, 0 + b _080096DA +_08009658: + adds r0, r2, 0 + subs r0, 0x43 + cmp r0, 0x14 + bhi _080096D8 + lsls r0, 2 + ldr r1, _0800966C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0800966C: .4byte _08009670 + .align 2, 0 +_08009670: + .4byte _080096D0 + .4byte _080096D0 + .4byte _080096C8 + .4byte _080096D8 + .4byte _080096CC + .4byte _080096C4 + .4byte _080096C4 + .4byte _080096D8 + .4byte _080096D8 + .4byte _080096D8 + .4byte _080096CC + .4byte _080096D0 + .4byte _080096D8 + .4byte _080096D8 + .4byte _080096D8 + .4byte _080096D8 + .4byte _080096C8 + .4byte _080096C8 + .4byte _080096D8 + .4byte _080096D8 + .4byte _080096D4 +_080096C4: + movs r0, 0x4 + b _080096DA +_080096C8: + movs r0, 0xF + b _080096DA +_080096CC: + movs r0, 0x5 + b _080096DA +_080096D0: + movs r0, 0x6 + b _080096DA +_080096D4: + movs r0, 0x2 + b _080096DA +_080096D8: + movs r0, 0x7 +_080096DA: + pop {r1} + bx r1 + thumb_func_end sub_800963C + + thumb_func_start sub_80096E0 +sub_80096E0: + push {r4-r6,lr} + ldr r1, _0800978C + movs r0, 0x1 + strb r0, [r1] + movs r1, 0xC0 + lsls r1, 19 + movs r5, 0 + ldr r3, _08009790 + ldr r0, _08009794 + movs r2, 0 +_080096F4: + stm r1!, {r2} + adds r5, 0x1 + cmp r5, r3 + bls _080096F4 + movs r1, 0xA0 + lsls r1, 19 + movs r5, 0 + movs r2, 0 +_08009704: + stm r1!, {r2} + adds r5, 0x1 + cmp r5, 0xFF + bls _08009704 + movs r1, 0xE0 + lsls r1, 19 + movs r5, 0 + ldr r2, _08009798 +_08009714: + stm r1!, {r2} + adds r5, 0x1 + cmp r5, 0xFF + bls _08009714 + ldr r4, _0800979C + adds r1, r4, 0 + bl sub_800A9EC + adds r6, r0, 0 + ldr r1, [r6, 0x4] + ldm r1!, {r5} + ldr r0, _080097A0 + lsls r2, r5, 5 + bl CpuCopy + adds r0, r6, 0 + bl sub_800AA14 + ldr r0, _080097A4 + adds r1, r4, 0 + bl sub_800A9EC + adds r6, r0, 0 + ldr r1, [r6, 0x4] + ldm r1!, {r5} + ldr r0, _080097A8 + lsls r2, r5, 5 + bl CpuCopy + adds r0, r6, 0 + bl sub_800AA14 + bl sub_80097B0 + ldr r0, _080097AC + adds r1, r4, 0 + bl sub_800A9EC + adds r6, r0, 0 + ldr r4, [r6, 0x4] + movs r5, 0 +_08009766: + movs r1, 0xF8 + lsls r1, 1 + adds r0, r5, r1 + adds r1, r4, 0 + bl SetBGPaletteBufferColorArray + adds r4, 0x4 + adds r5, 0x1 + cmp r5, 0xF + ble _08009766 + adds r0, r6, 0 + bl sub_800AA14 + bl TransferBGPaletteBuffer + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0800978C: .4byte gUnknown_203B090 +_08009790: .4byte 0x00005fff +_08009794: .4byte gUnknown_80B88B0 +_08009798: .4byte 0x00a000a0 +_0800979C: .4byte gUnknown_8300500 +_080097A0: .4byte 0x06004f00 +_080097A4: .4byte gUnknown_80B88B8 +_080097A8: .4byte 0x06017e00 +_080097AC: .4byte gUnknown_80B88C0 + thumb_func_end sub_80096E0 + + thumb_func_start sub_80097B0 +sub_80097B0: + push {r4-r6,lr} + ldr r0, _080097F8 + ldr r1, _080097FC + bl sub_800A9EC + adds r6, r0, 0 + ldr r4, _08009800 + ldr r1, [r6, 0x4] + movs r2, 0x80 + lsls r2, 2 + adds r0, r4, 0 + bl CpuCopy + bl sub_80063B0 + adds r5, r4, 0 + adds r5, 0x40 + cmp r0, 0x1 + bne _080097D8 + adds r5, r4, 0 +_080097D8: + movs r4, 0 +_080097DA: + adds r0, r4, 0 + adds r0, 0xF0 + adds r1, r5, 0 + bl SetBGPaletteBufferColorArray + adds r5, 0x4 + adds r4, 0x1 + cmp r4, 0xF + ble _080097DA + adds r0, r6, 0 + bl sub_800AA14 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080097F8: .4byte gUnknown_80B88CC +_080097FC: .4byte gUnknown_8300500 +_08009800: .4byte gUnknown_202D038 + thumb_func_end sub_80097B0 + + thumb_func_start sub_8009804 +sub_8009804: + push {lr} + movs r1, 0xC0 + lsls r1, 19 + movs r0, 0 + ldr r3, _0800987C + movs r2, 0 +_08009810: + stm r1!, {r2} + adds r0, 0x1 + cmp r0, r3 + bls _08009810 + ldr r1, _08009880 + movs r0, 0 + ldr r3, _08009884 + movs r2, 0 +_08009820: + stm r1!, {r2} + adds r0, 0x1 + cmp r0, r3 + bls _08009820 + ldr r1, _08009888 + movs r0, 0 + ldr r3, _0800988C + movs r2, 0 +_08009830: + stm r1!, {r2} + adds r0, 0x1 + cmp r0, r3 + bls _08009830 + ldr r1, _08009890 + movs r0, 0 + ldr r3, _08009894 + movs r2, 0 +_08009840: + stm r1!, {r2} + adds r0, 0x1 + cmp r0, r3 + bls _08009840 + movs r1, 0xA0 + lsls r1, 19 + movs r0, 0 + movs r2, 0 +_08009850: + stm r1!, {r2} + adds r0, 0x1 + cmp r0, 0x77 + bls _08009850 + ldr r1, _08009898 + movs r0, 0 + movs r2, 0 +_0800985E: + stm r1!, {r2} + adds r0, 0x1 + cmp r0, 0x77 + bls _0800985E + movs r1, 0xE0 + lsls r1, 19 + movs r0, 0 + ldr r2, _0800989C +_0800986E: + stm r1!, {r2} + adds r0, 0x1 + cmp r0, 0xFF + bls _0800986E + pop {r0} + bx r0 + .align 2, 0 +_0800987C: .4byte 0x000013bf +_08009880: .4byte 0x06007000 +_08009884: .4byte 0x000003ff +_08009888: .4byte 0x06008000 +_0800988C: .4byte 0x00001fff +_08009890: .4byte 0x06010000 +_08009894: .4byte 0x00001f7f +_08009898: .4byte 0x05000200 +_0800989C: .4byte 0x00a000a0 + thumb_func_end sub_8009804 + + thumb_func_start sub_80098A0 +sub_80098A0: + ldr r0, _080098B4 + movs r1, 0 + str r1, [r0] + ldr r0, _080098B8 + strb r1, [r0] + strb r1, [r0, 0x1] + strb r1, [r0, 0x2] + strb r1, [r0, 0x3] + bx lr + .align 2, 0 +_080098B4: .4byte gUnknown_202D23C +_080098B8: .4byte gUnknown_202D238 + thumb_func_end sub_80098A0 + + thumb_func_start sub_80098BC +sub_80098BC: + push {r4-r7,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + ldr r7, _080098F0 + ldr r3, [r7] + cmp r3, 0x7 + bgt _080098E8 + ldr r2, _080098F4 + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 2 + adds r0, r1, r2 + str r4, [r0] + adds r0, r2, 0x4 + adds r0, r1, r0 + str r5, [r0] + adds r2, 0x8 + adds r1, r2 + str r6, [r1] + adds r0, r3, 0x1 + str r0, [r7] +_080098E8: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080098F0: .4byte gUnknown_202D23C +_080098F4: .4byte gUnknown_202D240 + thumb_func_end sub_80098BC + + thumb_func_start sub_80098F8 +sub_80098F8: + ldr r1, _08009904 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + bx lr + .align 2, 0 +_08009904: .4byte gUnknown_202D238 + thumb_func_end sub_80098F8 + + thumb_func_start sub_8009908 +sub_8009908: + push {r4-r7,lr} + movs r5, 0 + ldr r0, _08009994 + ldr r0, [r0] + cmp r5, r0 + bge _08009936 + ldr r4, _08009998 + adds r7, r4, 0 + movs r6, 0 +_0800991A: + ldr r0, [r4] + adds r1, r7, 0x4 + adds r1, r6, r1 + ldr r1, [r1] + ldr r2, [r4, 0x8] + bl CpuCopy + adds r4, 0xC + adds r6, 0xC + adds r5, 0x1 + ldr r0, _08009994 + ldr r0, [r0] + cmp r5, r0 + blt _0800991A +_08009936: + ldr r0, _08009994 + movs r5, 0 + str r5, [r0] + ldr r4, _0800999C + ldrb r0, [r4] + cmp r0, 0 + beq _08009952 + strb r5, [r4] + ldr r0, _080099A0 + ldr r1, _080099A4 + movs r2, 0x80 + lsls r2, 4 + bl CpuCopy +_08009952: + ldrb r0, [r4, 0x1] + cmp r0, 0 + beq _08009966 + strb r5, [r4, 0x1] + ldr r0, _080099A8 + ldr r1, _080099AC + movs r2, 0x80 + lsls r2, 4 + bl CpuCopy +_08009966: + ldrb r0, [r4, 0x2] + cmp r0, 0 + beq _0800997A + strb r5, [r4, 0x2] + ldr r0, _080099B0 + ldr r1, _080099B4 + movs r2, 0x80 + lsls r2, 4 + bl CpuCopy +_0800997A: + ldrb r0, [r4, 0x3] + cmp r0, 0 + beq _0800998E + strb r5, [r4, 0x3] + ldr r0, _080099B8 + ldr r1, _080099BC + movs r2, 0x80 + lsls r2, 4 + bl CpuCopy +_0800998E: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08009994: .4byte gUnknown_202D23C +_08009998: .4byte gUnknown_202D240 +_0800999C: .4byte gUnknown_202D238 +_080099A0: .4byte 0x06006000 +_080099A4: .4byte gUnknown_202B038 +_080099A8: .4byte 0x06006800 +_080099AC: .4byte gUnknown_202B838 +_080099B0: .4byte 0x06007000 +_080099B4: .4byte gUnknown_202C038 +_080099B8: .4byte 0x06007800 +_080099BC: .4byte gUnknown_202C838 + thumb_func_end sub_8009908 + + thumb_func_start sub_80099C0 +sub_80099C0: + push {r4,r5,lr} + ldr r0, _080099E4 + ldr r4, _080099E8 + movs r5, 0x80 + lsls r5, 4 + adds r1, r4, 0 + adds r2, r5, 0 + bl CpuCopy + ldr r0, _080099EC + adds r4, r5 + adds r1, r4, 0 + adds r2, r5, 0 + bl CpuCopy + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080099E4: .4byte 0x06006000 +_080099E8: .4byte gUnknown_202B038 +_080099EC: .4byte 0x06006800 + thumb_func_end sub_80099C0 + + thumb_func_start sub_80099F0 +sub_80099F0: + push {lr} + adds r2, r0, 0 + ldr r0, _08009A0C + movs r1, 0x7 + movs r3, 0xE2 + lsls r3, 1 + adds r0, r3 +_080099FE: + str r2, [r0] + subs r0, 0x40 + subs r1, 0x1 + cmp r1, 0 + bge _080099FE + pop {r0} + bx r0 + .align 2, 0 +_08009A0C: .4byte gUnknown_202D038 + thumb_func_end sub_80099F0 + + thumb_func_start sub_8009A10 +sub_8009A10: + push {lr} + ldr r0, [r0, 0x4] + bl sub_8009A1C + pop {r0} + bx r0 + thumb_func_end sub_8009A10 + + thumb_func_start sub_8009A1C +sub_8009A1C: + push {r4-r6,lr} + adds r6, r0, 0 + ldr r0, _08009A30 + str r3, [r0] + ldr r3, [r6, 0xC] + movs r0, 0xC0 + lsls r0, 19 + adds r2, r0 + movs r5, 0 + b _08009A56 + .align 2, 0 +_08009A30: .4byte gUnknown_202D2A0 +_08009A34: + ldm r3!, {r0} + stm r2!, {r0} + ldm r3!, {r0} + stm r2!, {r0} + ldm r3!, {r0} + stm r2!, {r0} + ldm r3!, {r0} + stm r2!, {r0} + ldm r3!, {r0} + stm r2!, {r0} + ldm r3!, {r0} + stm r2!, {r0} + ldm r3!, {r0} + stm r2!, {r0} + ldm r3!, {r0} + stm r2!, {r0} + adds r5, 0x1 +_08009A56: + ldr r0, [r6, 0x8] + cmp r5, r0 + ble _08009A34 + movs r5, 0 + lsls r4, r1, 6 +_08009A60: + adds r0, r5, 0 + adds r0, 0xE0 + ldr r1, [r6, 0x10] + adds r1, r4 + bl SetBGPaletteBufferColorArray + adds r4, 0x4 + adds r5, 0x1 + cmp r5, 0xF + ble _08009A60 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8009A1C + + thumb_func_start sub_8009A7C +sub_8009A7C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + str r0, [sp] + adds r5, r1, 0 + str r2, [sp, 0x4] + str r3, [sp, 0x8] + ldr r0, [sp, 0x38] + ldr r3, [sp, 0x40] + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _08009AB4 + ldr r1, [r0] + movs r2, 0 + str r2, [sp, 0x10] + cmp r1, 0 + bne _08009AA8 + movs r7, 0x1 + str r7, [sp, 0x10] +_08009AA8: + ldr r1, [sp] + ldr r0, [r1] + cmp r5, r0 + blt _08009AB8 + movs r0, 0 + b _08009BCE + .align 2, 0 +_08009AB4: .4byte gUnknown_202D2A0 +_08009AB8: + lsls r5, 2 + mov r8, r5 + cmp r4, 0 + beq _08009AFA + movs r0, 0 + ldr r2, _08009B74 + mov r10, r2 + ldr r4, _08009B78 + mov r9, r4 + ldr r1, [sp, 0x10] + lsls r7, r1, 1 +_08009ACE: + ldr r2, [sp, 0x10] + adds r4, r0, 0x1 + mov r12, r4 + cmp r2, 0x1D + bgt _08009AF4 + mov r6, r10 + mov r5, r9 + movs r4, 0 + lsls r0, 6 + adds r1, r7, r0 +_08009AE2: + ldr r0, [r5] + lsls r0, 11 + adds r0, r1, r0 + adds r0, r6 + strh r4, [r0] + adds r1, 0x2 + adds r2, 0x1 + cmp r2, 0x1D + ble _08009AE2 +_08009AF4: + mov r0, r12 + cmp r0, 0x13 + ble _08009ACE +_08009AFA: + ldr r7, [sp] + ldr r0, [r7, 0x4] + add r0, r8 + ldr r5, [r0] + ldrh r0, [r5, 0x4] + mov r9, r0 + ldrh r1, [r5, 0x6] + str r1, [sp, 0xC] + ldr r2, [sp, 0x3C] + cmp r2, 0 + beq _08009B14 + ldrh r0, [r5, 0x8] + str r0, [r2] +_08009B14: + cmp r3, 0 + beq _08009B28 + ldrh r0, [r5, 0xA] + strh r0, [r3] + ldrh r0, [r5, 0xC] + strh r0, [r3, 0x2] + ldrh r0, [r5, 0xE] + strh r0, [r3, 0x4] + ldrh r0, [r5, 0x10] + strh r0, [r3, 0x6] +_08009B28: + adds r5, 0x14 + ldr r4, [sp, 0x8] + str r4, [sp, 0x14] + movs r6, 0 + movs r0, 0 + ldr r7, [sp, 0xC] + cmp r0, r7 + bge _08009BC4 + cmp r4, 0x13 + bgt _08009BC4 +_08009B3C: + ldr r3, [sp, 0x4] + adds r0, 0x1 + mov r12, r0 + ldr r0, [sp, 0x14] + adds r0, 0x1 + mov r8, r0 + mov r1, r9 + cmp r1, 0 + beq _08009BB4 + ldr r2, _08009B74 + mov r10, r2 + mov r2, r9 +_08009B54: + cmp r6, 0 + bne _08009B80 + ldrh r1, [r5] + adds r5, 0x2 + adds r0, r1, 0 + movs r4, 0xF0 + lsls r4, 8 + ands r0, r4 + cmp r0, 0 + bne _08009B6E + ldr r6, _08009B7C + ands r6, r1 + movs r1, 0 +_08009B6E: + adds r4, r1, 0 + b _08009B82 + .align 2, 0 +_08009B74: .4byte gUnknown_202B038 +_08009B78: .4byte gUnknown_202D2A0 +_08009B7C: .4byte 0x000003ff +_08009B80: + movs r4, 0 +_08009B82: + cmp r6, 0 + beq _08009B88 + subs r6, 0x1 +_08009B88: + ldr r7, [sp, 0x10] + cmp r3, r7 + blt _08009BAC + cmp r3, 0x1D + bgt _08009BAC + ldr r0, [sp, 0x14] + cmp r0, 0 + blt _08009BAC + lsls r0, r3, 1 + ldr r7, [sp, 0x14] + lsls r1, r7, 6 + adds r0, r1 + ldr r7, _08009BE0 + ldr r1, [r7] + lsls r1, 11 + adds r0, r1 + add r0, r10 + strh r4, [r0] +_08009BAC: + subs r2, 0x1 + adds r3, 0x1 + cmp r2, 0 + bne _08009B54 +_08009BB4: + mov r0, r12 + mov r1, r8 + str r1, [sp, 0x14] + ldr r2, [sp, 0xC] + cmp r0, r2 + bge _08009BC4 + cmp r1, 0x13 + ble _08009B3C +_08009BC4: + ldr r4, _08009BE0 + ldr r0, [r4] + bl sub_80098F8 + movs r0, 0x1 +_08009BCE: + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08009BE0: .4byte gUnknown_202D2A0 + thumb_func_end sub_8009A7C + + thumb_func_start sub_8009BE4 +sub_8009BE4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r0, 0x20 + mov r12, r0 + ldr r0, _08009C54 + ldr r1, [r0] + movs r2, 0 + mov r10, r2 + mov r9, r0 + cmp r1, 0 + bne _08009C04 + movs r7, 0x1 + mov r10, r7 +_08009C04: + movs r0, 0 + mov r1, r10 + lsls r1, 1 + mov r8, r1 +_08009C0C: + mov r1, r10 + adds r3, r0, 0x1 + cmp r1, r12 + bge _08009C36 + ldr r6, _08009C58 + ldr r5, _08009C54 + movs r4, 0 + lsls r0, 6 + mov r7, r8 + adds r2, r7, r0 + mov r0, r12 + subs r1, r0, r1 +_08009C24: + ldr r0, [r5] + lsls r0, 11 + adds r0, r2, r0 + adds r0, r6 + strh r4, [r0] + adds r2, 0x2 + subs r1, 0x1 + cmp r1, 0 + bne _08009C24 +_08009C36: + adds r0, r3, 0 + cmp r0, 0x1F + ble _08009C0C + mov r1, r9 + ldr r0, [r1] + bl sub_80098F8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08009C54: .4byte gUnknown_202D2A0 +_08009C58: .4byte gUnknown_202B038 + thumb_func_end sub_8009BE4 + + thumb_func_start sub_8009C5C +sub_8009C5C: + push {lr} + adds r1, r0, 0 + cmp r1, 0xFF + ble _08009C6C + movs r1, 0x3 + bl __modsi3 + b _08009C72 +_08009C6C: + ldr r0, _08009C78 + adds r0, r1, r0 + ldrb r0, [r0] +_08009C72: + pop {r1} + bx r1 + .align 2, 0 +_08009C78: .4byte gUnknown_80B88E4 + thumb_func_end sub_8009C5C + + thumb_func_start sub_8009C7C +sub_8009C7C: + push {lr} + adds r2, r0, 0 + movs r3, 0xC0 + lsls r3, 4 + adds r1, r2, 0 + ands r1, r3 + movs r0, 0x80 + lsls r0, 3 + cmp r1, r0 + beq _08009CB8 + cmp r1, r0 + bgt _08009C9A + cmp r1, 0 + beq _08009CA8 + b _08009CFC +_08009C9A: + movs r0, 0x80 + lsls r0, 4 + cmp r1, r0 + beq _08009CD0 + cmp r1, r3 + beq _08009CE0 + b _08009CFC +_08009CA8: + ldr r0, _08009CB0 + ldr r1, _08009CB4 + ands r1, r2 + b _08009CBE + .align 2, 0 +_08009CB0: .4byte gUnknown_80B8AE4 +_08009CB4: .4byte 0x000003ff +_08009CB8: + ldr r0, _08009CC8 + ldr r1, _08009CCC + bics r1, r2 +_08009CBE: + lsls r1, 1 + adds r1, r0 + movs r2, 0 + ldrsh r0, [r1, r2] + b _08009CFE + .align 2, 0 +_08009CC8: .4byte gUnknown_80B8AE4 +_08009CCC: .4byte 0x000003ff +_08009CD0: + ldr r0, _08009CD8 + ldr r1, _08009CDC + ands r1, r2 + b _08009CE6 + .align 2, 0 +_08009CD8: .4byte gUnknown_80B8AE4 +_08009CDC: .4byte 0x000003ff +_08009CE0: + ldr r0, _08009CF4 + ldr r1, _08009CF8 + bics r1, r2 +_08009CE6: + lsls r1, 1 + adds r1, r0 + movs r2, 0 + ldrsh r0, [r1, r2] + negs r0, r0 + b _08009CFE + .align 2, 0 +_08009CF4: .4byte gUnknown_80B8AE4 +_08009CF8: .4byte 0x000003ff +_08009CFC: + movs r0, 0 +_08009CFE: + pop {r1} + bx r1 + thumb_func_end sub_8009C7C + + thumb_func_start sub_8009D04 +sub_8009D04: + push {lr} + adds r2, r0, 0 + movs r3, 0xC0 + lsls r3, 4 + adds r1, r2, 0 + ands r1, r3 + movs r0, 0x80 + lsls r0, 3 + cmp r1, r0 + beq _08009D40 + cmp r1, r0 + bgt _08009D22 + cmp r1, 0 + beq _08009D30 + b _08009D84 +_08009D22: + movs r0, 0x80 + lsls r0, 4 + cmp r1, r0 + beq _08009D50 + cmp r1, r3 + beq _08009D6C + b _08009D84 +_08009D30: + ldr r0, _08009D38 + ldr r1, _08009D3C + bics r1, r2 + b _08009D72 + .align 2, 0 +_08009D38: .4byte gUnknown_80B8AE4 +_08009D3C: .4byte 0x000003ff +_08009D40: + ldr r0, _08009D48 + ldr r1, _08009D4C + ands r1, r2 + b _08009D56 + .align 2, 0 +_08009D48: .4byte gUnknown_80B8AE4 +_08009D4C: .4byte 0x000003ff +_08009D50: + ldr r0, _08009D64 + ldr r1, _08009D68 + bics r1, r2 +_08009D56: + lsls r1, 1 + adds r1, r0 + movs r2, 0 + ldrsh r0, [r1, r2] + negs r0, r0 + b _08009D86 + .align 2, 0 +_08009D64: .4byte gUnknown_80B8AE4 +_08009D68: .4byte 0x000003ff +_08009D6C: + ldr r0, _08009D7C + ldr r1, _08009D80 + ands r1, r2 +_08009D72: + lsls r1, 1 + adds r1, r0 + movs r2, 0 + ldrsh r0, [r1, r2] + b _08009D86 + .align 2, 0 +_08009D7C: .4byte gUnknown_80B8AE4 +_08009D80: .4byte 0x000003ff +_08009D84: + movs r0, 0 +_08009D86: + pop {r1} + bx r1 + thumb_func_end sub_8009D04 + + thumb_func_start sub_8009D8C +sub_8009D8C: + push {lr} + cmp r0, r2 + bcc _08009D9A + cmp r0, r2 + bhi _08009D9E + cmp r1, r3 + bcs _08009D9E +_08009D9A: + movs r0, 0x1 + b _08009DA0 +_08009D9E: + movs r0, 0 +_08009DA0: + pop {r1} + bx r1 + thumb_func_end sub_8009D8C + + thumb_func_start sub_8009DA4 +sub_8009DA4: + push {r4,r5,lr} + lsrs r2, r0, 31 + adds r5, r2, 0 + lsrs r3, r1, 31 + adds r4, r3, 0 + cmp r0, 0 + beq _08009DB6 + cmp r1, 0 + bne _08009DBA +_08009DB6: + movs r0, 0 + b _08009DD0 +_08009DBA: + cmp r2, 0 + beq _08009DC0 + negs r0, r0 +_08009DC0: + cmp r3, 0 + beq _08009DC6 + negs r1, r1 +_08009DC6: + bl sub_8009E14 + cmp r5, r4 + beq _08009DD0 + negs r0, r0 +_08009DD0: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8009DA4 + + thumb_func_start sub_8009DD8 +sub_8009DD8: + push {r4,r5,lr} + lsrs r2, r0, 31 + adds r5, r2, 0 + lsrs r3, r1, 31 + adds r4, r3, 0 + cmp r1, 0 + bne _08009DF0 + ldr r0, _08009DEC + b _08009E0E + .align 2, 0 +_08009DEC: .4byte 0x7fffffff +_08009DF0: + cmp r0, 0 + bne _08009DF8 + movs r0, 0 + b _08009E0E +_08009DF8: + cmp r2, 0 + beq _08009DFE + negs r0, r0 +_08009DFE: + cmp r3, 0 + beq _08009E04 + negs r1, r1 +_08009E04: + bl sub_8009EA0 + cmp r5, r4 + beq _08009E0E + negs r0, r0 +_08009E0E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8009DD8 + + thumb_func_start sub_8009E14 +sub_8009E14: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + cmp r0, 0 + beq _08009E24 + cmp r1, 0 + bne _08009E28 +_08009E24: + movs r0, 0 + b _08009E94 +_08009E28: + movs r5, 0 + adds r3, r0, 0 + mov r12, r5 + movs r6, 0 + movs r4, 0 + movs r0, 0x80 + lsls r0, 24 + mov r8, r0 + movs r7, 0x3F + mov r9, r7 +_08009E3C: + adds r2, r4, 0 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08009E50 + adds r4, r3 + adds r6, r5 + cmp r2, r4 + bls _08009E50 + adds r6, 0x1 +_08009E50: + lsrs r1, 1 + movs r2, 0x1 + mov r0, r12 + ands r0, r2 + cmp r0, 0 + beq _08009E60 + mov r0, r8 + orrs r1, r0 +_08009E60: + mov r7, r12 + lsrs r7, 1 + mov r12, r7 + lsls r5, 1 + adds r0, r3, 0 + mov r7, r8 + ands r0, r7 + cmp r0, 0 + beq _08009E74 + orrs r5, r2 +_08009E74: + lsls r3, 1 + movs r0, 0x1 + negs r0, r0 + add r9, r0 + mov r7, r9 + cmp r7, 0 + bge _08009E3C + lsrs r1, r4, 7 + ands r1, r2 + lsrs r4, 8 + lsls r0, r6, 24 + orrs r4, r0 + cmp r1, 0 + beq _08009E92 + adds r4, 0x1 +_08009E92: + adds r0, r4, 0 +_08009E94: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8009E14 + + thumb_func_start sub_8009EA0 +sub_8009EA0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + cmp r1, 0 + bne _08009EB8 + ldr r0, _08009EB4 + b _08009F58 + .align 2, 0 +_08009EB4: .4byte 0x7fffffff +_08009EB8: + cmp r0, 0 + bne _08009EC0 + movs r0, 0 + b _08009F58 +_08009EC0: + lsrs r7, r0, 24 + lsls r6, r0, 8 + mov r10, r1 + movs r0, 0 + mov r9, r0 + movs r5, 0 + movs r4, 0 + movs r1, 0x1 + mov r8, r1 + movs r2, 0x3F + str r2, [sp] +_08009ED6: + lsls r5, 1 + adds r0, r4, 0 + movs r1, 0x80 + lsls r1, 24 + ands r0, r1 + cmp r0, 0 + beq _08009EE8 + mov r2, r8 + orrs r5, r2 +_08009EE8: + movs r1, 0x2 + negs r1, r1 + lsls r4, 1 + adds r0, r7, 0 + movs r2, 0x80 + lsls r2, 24 + ands r0, r2 + cmp r0, 0 + beq _08009EFE + mov r0, r8 + orrs r4, r0 +_08009EFE: + lsls r7, 1 + adds r0, r6, 0 + movs r2, 0x80 + lsls r2, 24 + ands r0, r2 + cmp r0, 0 + beq _08009F10 + mov r0, r8 + orrs r7, r0 +_08009F10: + lsls r6, 1 + ands r6, r1 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + mov r3, r10 + bl sub_8009D8C + lsls r0, 24 + cmp r0, 0 + bne _08009F3A + adds r0, r4, 0 + movs r1, 0x1 + mov r2, r10 + subs r4, r2 + movs r2, 0 + subs r5, r2 + cmp r0, r4 + bcs _08009F3C + subs r5, 0x1 + b _08009F3C +_08009F3A: + movs r1, 0 +_08009F3C: + mov r0, r9 + lsls r0, 1 + mov r9, r0 + cmp r1, 0 + beq _08009F4C + mov r1, r8 + orrs r0, r1 + mov r9, r0 +_08009F4C: + ldr r2, [sp] + subs r2, 0x1 + str r2, [sp] + cmp r2, 0 + bge _08009ED6 + mov r0, r9 +_08009F58: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8009EA0 + + thumb_func_start sub_8009F68 +sub_8009F68: + push {r4-r7,lr} + adds r5, r0, 0 + adds r6, r1, 0 + adds r4, r6, 0 + cmp r6, 0 + bge _08009F76 + negs r4, r6 +_08009F76: + movs r7, 0x80 + lsls r7, 1 + cmp r4, 0 + beq _08009FA0 +_08009F7E: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _08009F90 + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_8009DA4 + adds r7, r0, 0 +_08009F90: + adds r0, r5, 0 + adds r1, r5, 0 + bl sub_8009DA4 + adds r5, r0, 0 + asrs r4, 1 + cmp r4, 0 + bne _08009F7E +_08009FA0: + cmp r6, 0 + bge _08009FB0 + movs r0, 0x80 + lsls r0, 1 + adds r1, r7, 0 + bl sub_8009DD8 + b _08009FB2 +_08009FB0: + adds r0, r7, 0 +_08009FB2: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8009F68 + + thumb_func_start sub_8009FB8 +sub_8009FB8: + push {r4-r7,lr} + adds r5, r0, 0 + adds r6, r1, 0 + cmp r5, 0 + bge _08009FC4 + negs r5, r5 +_08009FC4: + cmp r6, 0 + bge _08009FCA + negs r6, r6 +_08009FCA: + cmp r5, r6 + bge _08009FD4 + adds r4, r5, 0 + adds r5, r6, 0 + adds r6, r4, 0 +_08009FD4: + cmp r6, 0 + beq _0800A016 + movs r7, 0x2 +_08009FDA: + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_8009DD8 + adds r4, r0, 0 + adds r1, r4, 0 + bl sub_8009DA4 + adds r4, r0, 0 + movs r0, 0x80 + lsls r0, 3 + adds r1, r4, r0 + adds r0, r4, 0 + bl sub_8009DD8 + adds r4, r0, 0 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8009DA4 + lsls r0, 1 + adds r5, r0 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_8009DA4 + adds r6, r0, 0 + subs r7, 0x1 + cmp r7, 0 + bge _08009FDA +_0800A016: + adds r0, r5, 0 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8009FB8 + + thumb_func_start sub_800A020 +sub_800A020: + push {r4,lr} + adds r3, r0, 0 + ldr r4, _0800A044 + lsrs r2, r1, 16 + str r2, [r3] + lsls r0, r1, 16 + str r0, [r3, 0x4] + movs r0, 0x80 + lsls r0, 8 + ands r0, r1 + cmp r0, 0 + beq _0800A03C + orrs r2, r4 + str r2, [r3] +_0800A03C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800A044: .4byte 0xffff0000 + thumb_func_end sub_800A020 + + thumb_func_start sub_800A048 +sub_800A048: + push {lr} + ldrh r1, [r0] + lsls r2, r1, 16 + ldr r0, [r0, 0x4] + lsrs r1, r0, 16 + orrs r2, r1 + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0800A060 + adds r2, 0x1 +_0800A060: + adds r0, r2, 0 + pop {r1} + bx r1 + thumb_func_end sub_800A048 + + thumb_func_start sub_800A068 +sub_800A068: + push {lr} + ldrb r1, [r0] + lsls r2, r1, 24 + ldr r0, [r0, 0x4] + lsrs r1, r0, 8 + orrs r2, r1 + movs r1, 0x80 + lsls r1, 8 + ands r0, r1 + cmp r0, 0 + beq _0800A080 + adds r2, 0x1 +_0800A080: + adds r0, r2, 0 + pop {r1} + bx r1 + thumb_func_end sub_800A068 + + thumb_func_start sub_800A088 +sub_800A088: + push {lr} + adds r2, r0, 0 + lsls r0, r1, 8 + str r0, [r2, 0x4] + asrs r1, 24 + str r1, [r2] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0800A0A4 + movs r0, 0x80 + negs r0, r0 + orrs r1, r0 + b _0800A0A8 +_0800A0A4: + movs r0, 0x7F + ands r1, r0 +_0800A0A8: + str r1, [r2] + pop {r0} + bx r0 + thumb_func_end sub_800A088 + + thumb_func_start sub_800A0B0 +sub_800A0B0: + push {lr} + ldr r2, [r0, 0x4] + ldr r3, [r0] + cmp r2, 0 + bne _0800A0C2 + cmp r3, 0 + bne _0800A0C2 + movs r0, 0 + b _0800A254 +_0800A0C2: + cmp r2, 0 + ble _0800A18C + cmp r3, 0 + ble _0800A124 + cmp r2, r3 + bge _0800A0F0 + asrs r1, r3, 8 + cmp r1, 0 + beq _0800A0FE + adds r0, r2, 0 + bl __divsi3 + adds r2, r0, 0 + cmp r2, 0xFF + ble _0800A0E2 + movs r2, 0xFF +_0800A0E2: + ldr r0, _0800A0EC + lsls r1, r2, 2 + adds r1, r0 + ldr r0, [r1] + b _0800A252 + .align 2, 0 +_0800A0EC: .4byte gUnknown_80B92E4 +_0800A0F0: + adds r1, r2, 0 + cmp r2, 0 + bge _0800A0F8 + adds r1, 0xFF +_0800A0F8: + asrs r1, 8 + cmp r1, 0 + bne _0800A104 +_0800A0FE: + movs r0, 0x80 + lsls r0, 2 + b _0800A254 +_0800A104: + adds r0, r3, 0 + bl __divsi3 + adds r2, r0, 0 + cmp r2, 0xFF + ble _0800A112 + movs r2, 0xFF +_0800A112: + ldr r1, _0800A120 + lsls r0, r2, 2 + adds r0, r1 + ldr r1, [r0] + movs r0, 0x40 + b _0800A250 + .align 2, 0 +_0800A120: .4byte gUnknown_80B92E4 +_0800A124: + negs r3, r3 + cmp r2, r3 + bge _0800A158 + adds r1, r3, 0 + cmp r3, 0 + bge _0800A132 + adds r1, 0xFF +_0800A132: + asrs r1, 8 + cmp r1, 0 + beq _0800A166 + adds r0, r2, 0 + bl __divsi3 + adds r2, r0, 0 + cmp r2, 0xFF + ble _0800A146 + movs r2, 0xFF +_0800A146: + ldr r1, _0800A154 + lsls r0, r2, 2 + adds r0, r1 + ldr r1, [r0] + movs r0, 0x80 + b _0800A250 + .align 2, 0 +_0800A154: .4byte gUnknown_80B92E4 +_0800A158: + adds r1, r2, 0 + cmp r2, 0 + bge _0800A160 + adds r1, 0xFF +_0800A160: + asrs r1, 8 + cmp r1, 0 + bne _0800A16C +_0800A166: + movs r0, 0xC0 + lsls r0, 3 + b _0800A254 +_0800A16C: + adds r0, r3, 0 + bl __divsi3 + adds r2, r0, 0 + cmp r2, 0xFF + ble _0800A17A + movs r2, 0xFF +_0800A17A: + ldr r0, _0800A188 + lsls r1, r2, 2 + adds r1, r0 + ldr r0, [r1] + adds r0, 0x40 + b _0800A252 + .align 2, 0 +_0800A188: .4byte gUnknown_80B92E4 +_0800A18C: + negs r2, r2 + cmp r3, 0 + ble _0800A1F0 + cmp r2, r3 + bge _0800A1BC + asrs r1, r3, 8 + cmp r1, 0 + beq _0800A1CA + adds r0, r2, 0 + bl __divsi3 + adds r2, r0, 0 + cmp r2, 0xFF + ble _0800A1AA + movs r2, 0xFF +_0800A1AA: + ldr r1, _0800A1B8 + lsls r0, r2, 2 + adds r0, r1 + ldr r1, [r0] + movs r0, 0x80 + lsls r0, 1 + b _0800A250 + .align 2, 0 +_0800A1B8: .4byte gUnknown_80B92E4 +_0800A1BC: + adds r1, r2, 0 + cmp r2, 0 + bge _0800A1C4 + adds r1, 0xFF +_0800A1C4: + asrs r1, 8 + cmp r1, 0 + bne _0800A1D0 +_0800A1CA: + movs r0, 0xE0 + lsls r0, 4 + b _0800A254 +_0800A1D0: + adds r0, r3, 0 + bl __divsi3 + adds r2, r0, 0 + cmp r2, 0xFF + ble _0800A1DE + movs r2, 0xFF +_0800A1DE: + ldr r0, _0800A1EC + lsls r1, r2, 2 + adds r1, r0 + ldr r0, [r1] + adds r0, 0xC0 + b _0800A252 + .align 2, 0 +_0800A1EC: .4byte gUnknown_80B92E4 +_0800A1F0: + negs r3, r3 + cmp r2, r3 + bge _0800A224 + adds r1, r3, 0 + cmp r3, 0 + bge _0800A1FE + adds r1, 0xFF +_0800A1FE: + asrs r1, 8 + cmp r1, 0 + beq _0800A232 + adds r0, r2, 0 + bl __divsi3 + adds r2, r0, 0 + cmp r2, 0xFF + ble _0800A212 + movs r2, 0xFF +_0800A212: + ldr r0, _0800A220 + lsls r1, r2, 2 + adds r1, r0 + ldr r0, [r1] + adds r0, 0x80 + b _0800A252 + .align 2, 0 +_0800A220: .4byte gUnknown_80B92E4 +_0800A224: + adds r0, r2, 0 + cmp r0, 0 + bge _0800A22C + adds r0, 0xFF +_0800A22C: + asrs r1, r0, 8 + cmp r1, 0 + bne _0800A238 +_0800A232: + movs r0, 0xA0 + lsls r0, 4 + b _0800A254 +_0800A238: + adds r0, r3, 0 + bl __divsi3 + adds r2, r0, 0 + cmp r2, 0xFF + ble _0800A246 + movs r2, 0xFF +_0800A246: + ldr r1, _0800A258 + lsls r0, r2, 2 + adds r0, r1 + ldr r1, [r0] + movs r0, 0xC0 +_0800A250: + subs r0, r1 +_0800A252: + lsls r0, 4 +_0800A254: + pop {r1} + bx r1 + .align 2, 0 +_0800A258: .4byte gUnknown_80B92E4 + thumb_func_end sub_800A0B0 + + thumb_func_start sub_800A25C +sub_800A25C: + push {lr} + adds r1, r0, 0 + ldr r0, [r1] + mvns r2, r0 + str r2, [r1] + ldr r0, [r1, 0x4] + mvns r0, r0 + adds r0, 0x1 + str r0, [r1, 0x4] + cmp r0, 0 + bne _0800A276 + adds r0, r2, 0x1 + str r0, [r1] +_0800A276: + pop {r0} + bx r0 + thumb_func_end sub_800A25C + + thumb_func_start sub_800A27C +sub_800A27C: + push {lr} + adds r1, r0, 0 + ldr r0, [r1] + cmp r0, 0 + bge _0800A29A + mvns r2, r0 + str r2, [r1] + ldr r0, [r1, 0x4] + mvns r0, r0 + adds r0, 0x1 + str r0, [r1, 0x4] + cmp r0, 0 + bne _0800A29A + adds r0, r2, 0x1 + str r0, [r1] +_0800A29A: + pop {r0} + bx r0 + thumb_func_end sub_800A27C + + thumb_func_start sub_800A2A0 +sub_800A2A0: + push {lr} + adds r1, r0, 0 + ldr r0, [r1] + cmp r0, 0 + bne _0800A2B4 + ldr r0, [r1, 0x4] + cmp r0, 0 + bne _0800A2B4 + movs r0, 0x1 + b _0800A2B6 +_0800A2B4: + movs r0, 0 +_0800A2B6: + pop {r1} + bx r1 + thumb_func_end sub_800A2A0 + + thumb_func_start sub_800A2BC +sub_800A2BC: + push {lr} + adds r2, r0, 0 + adds r3, r1, 0 + ldr r1, [r2] + ldr r0, [r3] + cmp r1, r0 + bne _0800A2D6 + ldr r1, [r2, 0x4] + ldr r0, [r3, 0x4] + cmp r1, r0 + bne _0800A2D6 + movs r0, 0x1 + b _0800A2D8 +_0800A2D6: + movs r0, 0 +_0800A2D8: + pop {r1} + bx r1 + thumb_func_end sub_800A2BC + + thumb_func_start sub_800A2DC +sub_800A2DC: + push {lr} + ldr r0, [r0] + cmp r0, 0 + blt _0800A2E8 + movs r0, 0 + b _0800A2EA +_0800A2E8: + movs r0, 0x1 +_0800A2EA: + pop {r1} + bx r1 + thumb_func_end sub_800A2DC + + thumb_func_start sub_800A2F0 +sub_800A2F0: + push {r4,r5,lr} + adds r3, r0, 0 + adds r2, r1, 0 + ldr r4, [r3] + lsrs r1, r4, 31 + ldr r5, [r2] + cmp r5, 0 + bge _0800A304 + movs r0, 0x2 + orrs r1, r0 +_0800A304: + cmp r1, 0x1 + beq _0800A326 + cmp r1, 0x1 + ble _0800A314 + cmp r1, 0x2 + beq _0800A32A + cmp r1, 0x3 + beq _0800A32E +_0800A314: + ldr r1, [r3, 0x4] + ldr r3, [r2, 0x4] + adds r0, r4, 0 + adds r2, r5, 0 + bl sub_8009D8C + lsls r0, 24 + lsrs r0, 24 + b _0800A346 +_0800A326: + movs r0, 0x1 + b _0800A346 +_0800A32A: + movs r0, 0 + b _0800A346 +_0800A32E: + ldr r1, [r3, 0x4] + ldr r3, [r2, 0x4] + adds r0, r4, 0 + adds r2, r5, 0 + bl sub_8009D8C + movs r1, 0 + lsls r0, 24 + cmp r0, 0 + bne _0800A344 + movs r1, 0x1 +_0800A344: + adds r0, r1, 0 +_0800A346: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_800A2F0 + + thumb_func_start sub_800A34C +sub_800A34C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + adds r6, r0, 0 + ldr r0, [r1] + str r0, [sp] + ldr r0, [r1, 0x4] + str r0, [sp, 0x4] + ldr r0, [r2] + str r0, [sp, 0x8] + ldr r0, [r2, 0x4] + add r5, sp, 0x8 + str r0, [r5, 0x4] + mov r0, sp + bl sub_800A2DC + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + mov r10, r8 + adds r0, r5, 0 + bl sub_800A2DC + lsls r0, 24 + lsrs r7, r0, 24 + mov r9, r7 + mov r0, sp + bl sub_800A2A0 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _0800A39A + movs r0, 0 + str r0, [r6] + b _0800A3DE +_0800A39A: + adds r0, r5, 0 + bl sub_800A2A0 + lsls r0, 24 + cmp r0, 0 + beq _0800A3AC + str r4, [r6] + str r4, [r6, 0x4] + b _0800A3E0 +_0800A3AC: + mov r0, r8 + cmp r0, 0 + beq _0800A3B8 + mov r0, sp + bl sub_800A25C +_0800A3B8: + cmp r7, 0 + beq _0800A3C2 + adds r0, r5, 0 + bl sub_800A25C +_0800A3C2: + add r4, sp, 0x10 + adds r0, r4, 0 + mov r1, sp + adds r2, r5, 0 + bl sub_800A4E4 + cmp r10, r9 + beq _0800A3D8 + adds r0, r4, 0 + bl sub_800A25C +_0800A3D8: + ldr r0, [sp, 0x10] + str r0, [r6] + ldr r0, [r4, 0x4] +_0800A3DE: + str r0, [r6, 0x4] +_0800A3E0: + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_800A34C + + thumb_func_start sub_800A3F0 +sub_800A3F0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + adds r6, r0, 0 + ldr r0, [r1] + str r0, [sp] + ldr r0, [r1, 0x4] + str r0, [sp, 0x4] + ldr r0, [r2] + str r0, [sp, 0x8] + ldr r0, [r2, 0x4] + add r5, sp, 0x8 + str r0, [r5, 0x4] + mov r0, sp + bl sub_800A2DC + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + mov r10, r8 + adds r0, r5, 0 + bl sub_800A2DC + lsls r0, 24 + lsrs r7, r0, 24 + mov r9, r7 + adds r0, r5, 0 + bl sub_800A2A0 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _0800A448 + ldr r0, _0800A444 + str r0, [r6] + movs r0, 0x1 + negs r0, r0 + b _0800A48C + .align 2, 0 +_0800A444: .4byte 0x7fffffff +_0800A448: + mov r0, sp + bl sub_800A2A0 + lsls r0, 24 + cmp r0, 0 + beq _0800A45A + str r4, [r6] + str r4, [r6, 0x4] + b _0800A48E +_0800A45A: + mov r0, r8 + cmp r0, 0 + beq _0800A466 + mov r0, sp + bl sub_800A25C +_0800A466: + cmp r7, 0 + beq _0800A470 + adds r0, r5, 0 + bl sub_800A25C +_0800A470: + add r4, sp, 0x10 + adds r0, r4, 0 + mov r1, sp + adds r2, r5, 0 + bl sub_800A5A4 + cmp r10, r9 + beq _0800A486 + adds r0, r4, 0 + bl sub_800A25C +_0800A486: + ldr r0, [sp, 0x10] + str r0, [r6] + ldr r0, [r4, 0x4] +_0800A48C: + str r0, [r6, 0x4] +_0800A48E: + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_800A3F0 + + thumb_func_start sub_800A4A0 +sub_800A4A0: + push {r4,r5,lr} + sub sp, 0x10 + adds r5, r0, 0 + ldr r0, [r5] + str r0, [sp] + ldr r0, [r5, 0x4] + str r0, [sp, 0x4] + mov r0, sp + bl sub_800A2A0 + lsls r0, 24 + cmp r0, 0 + beq _0800A4C0 + movs r0, 0 + str r0, [r5] + b _0800A4D8 +_0800A4C0: + mov r0, sp + bl sub_800A27C + add r4, sp, 0x8 + adds r0, r4, 0 + mov r1, sp + mov r2, sp + bl sub_800A4E4 + ldr r0, [sp, 0x8] + str r0, [r5] + ldr r0, [r4, 0x4] +_0800A4D8: + str r0, [r5, 0x4] + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_800A4A0 + + thumb_func_start sub_800A4E4 +sub_800A4E4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r8, r0 + adds r5, r1, 0 + adds r6, r2, 0 + adds r0, r5, 0 + bl sub_800A2A0 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _0800A50C + movs r0, 0 + mov r1, r8 + str r0, [r1] + str r0, [r1, 0x4] + b _0800A596 +_0800A50C: + adds r0, r6, 0 + bl sub_800A2A0 + lsls r0, 24 + cmp r0, 0 + beq _0800A520 + mov r7, r8 + str r4, [r7] + str r4, [r7, 0x4] + b _0800A596 +_0800A520: + ldr r1, [r5] + ldr r4, [r5, 0x4] + ldr r0, [r6] + mov r10, r0 + ldr r2, [r6, 0x4] + movs r6, 0 + movs r5, 0 + movs r7, 0x80 + lsls r7, 24 + mov r9, r7 + movs r0, 0x3F + mov r12, r0 +_0800A538: + adds r3, r5, 0 + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _0800A54C + adds r5, r4 + adds r6, r1 + cmp r3, r5 + bls _0800A54C + adds r6, 0x1 +_0800A54C: + lsrs r2, 1 + movs r3, 0x1 + mov r0, r10 + ands r0, r3 + cmp r0, 0 + beq _0800A55C + mov r7, r9 + orrs r2, r7 +_0800A55C: + mov r0, r10 + lsrs r0, 1 + mov r10, r0 + lsls r1, 1 + adds r0, r4, 0 + mov r7, r9 + ands r0, r7 + cmp r0, 0 + beq _0800A570 + orrs r1, r3 +_0800A570: + lsls r4, 1 + movs r0, 0x1 + negs r0, r0 + add r12, r0 + mov r7, r12 + cmp r7, 0 + bge _0800A538 + lsrs r1, r5, 15 + ands r1, r3 + lsrs r5, 16 + lsls r0, r6, 16 + orrs r5, r0 + lsrs r6, 16 + cmp r1, 0 + beq _0800A590 + adds r5, 0x1 +_0800A590: + mov r0, r8 + str r6, [r0] + str r5, [r0, 0x4] +_0800A596: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_800A4E4 + + thumb_func_start sub_800A5A4 +sub_800A5A4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + str r0, [sp] + adds r5, r1, 0 + mov r8, r2 + mov r0, r8 + bl sub_800A2A0 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _0800A5D8 + ldr r0, _0800A5D4 + ldr r1, [sp] + str r0, [r1] + movs r0, 0x1 + negs r0, r0 + str r0, [r1, 0x4] + b _0800A6BE + .align 2, 0 +_0800A5D4: .4byte 0x7fffffff +_0800A5D8: + adds r0, r5, 0 + bl sub_800A2A0 + lsls r0, 24 + cmp r0, 0 + beq _0800A5EC + ldr r2, [sp] + str r4, [r2] + str r4, [r2, 0x4] + b _0800A6BE +_0800A5EC: + ldr r0, [r5] + lsls r7, r0, 16 + ldr r1, [r5, 0x4] + lsrs r0, r1, 16 + orrs r7, r0 + lsls r6, r1, 16 + movs r0, 0x80 + lsls r0, 8 + orrs r6, r0 + mov r0, r8 + ldr r0, [r0] + str r0, [sp, 0x4] + mov r1, r8 + ldr r1, [r1, 0x4] + str r1, [sp, 0x8] + movs r2, 0 + str r2, [sp, 0xC] + mov r9, r2 + movs r5, 0 + movs r4, 0 + movs r0, 0x80 + lsls r0, 24 + mov r10, r0 + movs r1, 0x1 + mov r8, r1 + movs r2, 0x3F + str r2, [sp, 0x10] +_0800A622: + lsls r5, 1 + adds r0, r4, 0 + mov r1, r10 + ands r0, r1 + cmp r0, 0 + beq _0800A632 + mov r2, r8 + orrs r5, r2 +_0800A632: + movs r1, 0x2 + negs r1, r1 + lsls r4, 1 + adds r0, r7, 0 + mov r2, r10 + ands r0, r2 + cmp r0, 0 + beq _0800A646 + mov r0, r8 + orrs r4, r0 +_0800A646: + lsls r7, 1 + adds r0, r6, 0 + mov r2, r10 + ands r0, r2 + cmp r0, 0 + beq _0800A656 + mov r0, r8 + orrs r7, r0 +_0800A656: + lsls r6, 1 + ands r6, r1 + adds r0, r5, 0 + adds r1, r4, 0 + ldr r2, [sp, 0x4] + ldr r3, [sp, 0x8] + bl sub_8009D8C + lsls r0, 24 + cmp r0, 0 + bne _0800A680 + adds r0, r4, 0 + movs r1, 0x1 + ldr r2, [sp, 0x8] + subs r4, r2 + ldr r2, [sp, 0x4] + subs r5, r2 + cmp r0, r4 + bcs _0800A682 + subs r5, 0x1 + b _0800A682 +_0800A680: + movs r1, 0 +_0800A682: + ldr r0, [sp, 0xC] + lsls r0, 1 + str r0, [sp, 0xC] + mov r0, r9 + mov r2, r10 + ands r0, r2 + cmp r0, 0 + beq _0800A69A + ldr r0, [sp, 0xC] + mov r2, r8 + orrs r0, r2 + str r0, [sp, 0xC] +_0800A69A: + mov r0, r9 + lsls r0, 1 + mov r9, r0 + cmp r1, 0 + beq _0800A6AA + mov r1, r8 + orrs r0, r1 + mov r9, r0 +_0800A6AA: + ldr r2, [sp, 0x10] + subs r2, 0x1 + str r2, [sp, 0x10] + cmp r2, 0 + bge _0800A622 + ldr r0, [sp, 0xC] + ldr r1, [sp] + str r0, [r1] + mov r2, r9 + str r2, [r1, 0x4] +_0800A6BE: + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_800A5A4 + + thumb_func_start sub_800A6D0 +sub_800A6D0: + push {r4,lr} + adds r4, r0, 0 + ldr r3, [r1] + ldr r0, [r2] + adds r3, r0 + ldr r1, [r1, 0x4] + ldr r0, [r2, 0x4] + adds r0, r1, r0 + cmp r0, r1 + bcs _0800A6E6 + adds r3, 0x1 +_0800A6E6: + str r3, [r4] + str r0, [r4, 0x4] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_800A6D0 + + thumb_func_start sub_800A6F0 +sub_800A6F0: + push {r4,lr} + adds r4, r0, 0 + ldr r3, [r1] + ldr r0, [r2] + subs r3, r0 + ldr r1, [r1, 0x4] + ldr r0, [r2, 0x4] + subs r0, r1, r0 + cmp r0, r1 + bls _0800A706 + subs r3, 0x1 +_0800A706: + str r3, [r4] + str r0, [r4, 0x4] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_800A6F0 + + thumb_func_start sub_800A710 +sub_800A710: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x18 + mov r8, r0 + adds r6, r2, 0 + ldr r0, [r1] + str r0, [sp] + ldr r0, [r1, 0x4] + str r0, [sp, 0x4] + adds r4, r6, 0 + cmp r6, 0 + bge _0800A72C + negs r4, r6 +_0800A72C: + movs r0, 0 + str r0, [sp, 0x8] + movs r1, 0x80 + lsls r1, 9 + add r0, sp, 0x8 + str r1, [r0, 0x4] + adds r7, r0, 0 + cmp r4, 0 + beq _0800A75E + adds r5, r7, 0 +_0800A740: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _0800A752 + adds r0, r5, 0 + adds r1, r5, 0 + mov r2, sp + bl sub_800A34C +_0800A752: + mov r0, sp + bl sub_800A4A0 + asrs r4, 1 + cmp r4, 0 + bne _0800A740 +_0800A75E: + cmp r6, 0 + bge _0800A776 + movs r0, 0 + str r0, [sp, 0x10] + movs r0, 0x80 + lsls r0, 9 + add r1, sp, 0x10 + str r0, [r1, 0x4] + adds r0, r7, 0 + adds r2, r7, 0 + bl sub_800A3F0 +_0800A776: + ldr r0, [sp, 0x8] + mov r1, r8 + str r0, [r1] + ldr r0, [r7, 0x4] + str r0, [r1, 0x4] + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_800A710 + + thumb_func_start sub_800A78C +sub_800A78C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + mov r10, r0 + ldr r0, [r1] + ldr r1, [r1, 0x4] + str r0, [sp] + str r1, [sp, 0x4] + ldr r0, [r2] + ldr r1, [r2, 0x4] + str r0, [sp, 0x8] + str r1, [sp, 0xC] + mov r0, sp + bl sub_800A27C + add r4, sp, 0x8 + adds r0, r4, 0 + bl sub_800A27C + mov r0, sp + adds r1, r4, 0 + bl sub_800A2F0 + lsls r0, 24 + mov r8, r4 + cmp r0, 0 + beq _0800A7DC + ldr r2, [sp] + ldr r3, [sp, 0x4] + str r2, [sp, 0x10] + str r3, [sp, 0x14] + ldr r0, [sp, 0x8] + ldr r1, [sp, 0xC] + str r0, [sp] + str r1, [sp, 0x4] + str r2, [sp, 0x8] + str r3, [sp, 0xC] +_0800A7DC: + mov r0, r8 + bl sub_800A2A0 + lsls r0, 24 + cmp r0, 0 + bne _0800A878 + movs r0, 0 + mov r9, r0 + add r7, sp, 0x10 + add r6, sp, 0x18 + b _0800A800 +_0800A7F2: + mov r0, r8 + mov r1, r8 + adds r2, r7, 0 + bl sub_800A34C + movs r2, 0x1 + add r9, r2 +_0800A800: + adds r4, r7, 0 + mov r1, r8 + adds r0, r4, 0 + mov r2, sp + bl sub_800A3F0 + adds r0, r4, 0 + bl sub_800A4A0 + ldr r0, [sp, 0x10] + str r0, [sp, 0x18] + ldr r1, [r4, 0x4] + movs r0, 0x80 + lsls r0, 11 + adds r1, r0 + adds r5, r6, 0 + str r1, [r5, 0x4] + ldr r0, [r4, 0x4] + cmp r1, r0 + bcs _0800A82E + ldr r0, [sp, 0x18] + adds r0, 0x1 + str r0, [sp, 0x18] +_0800A82E: + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_800A3F0 + adds r0, r5, 0 + mov r1, sp + adds r2, r4, 0 + bl sub_800A34C + ldr r0, [sp, 0x18] + lsls r1, r0, 1 + str r1, [sp, 0x18] + ldr r0, [r5, 0x4] + cmp r0, 0 + bge _0800A854 + movs r0, 0x1 + orrs r1, r0 + str r1, [sp, 0x18] +_0800A854: + ldr r0, [r6, 0x4] + lsls r0, 1 + str r0, [r6, 0x4] + ldr r2, [sp, 0x4] + ldr r1, [sp] + ldr r0, [sp, 0x18] + adds r1, r0 + str r1, [sp] + ldr r0, [r6, 0x4] + adds r0, r2, r0 + str r0, [sp, 0x4] + cmp r2, r0 + bls _0800A872 + adds r0, r1, 0x1 + str r0, [sp] +_0800A872: + mov r2, r9 + cmp r2, 0x2 + bne _0800A7F2 +_0800A878: + ldr r0, [sp] + ldr r1, [sp, 0x4] + mov r2, r10 + str r0, [r2] + str r1, [r2, 0x4] + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_800A78C + + thumb_func_start sub_800A894 +sub_800A894: + push {lr} + adds r2, r0, 0 + adds r0, r1, 0 + cmp r0, 0 + bgt _0800A8A0 + movs r0, 0x1 +_0800A8A0: + ldr r1, _0800A8BC + cmp r0, r1 + ble _0800A8A8 + adds r0, r1, 0 +_0800A8A8: + ldr r1, _0800A8C0 + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [r2, 0x4] + movs r0, 0 + str r0, [r2] + pop {r0} + bx r0 + .align 2, 0 +_0800A8BC: .4byte 0x0000012b +_0800A8C0: .4byte gUnknown_80B96E4 + thumb_func_end sub_800A894 + + thumb_func_start sub_800A8C4 +sub_800A8C4: + push {r4,lr} + ldr r3, _0800A8EC + ldr r4, _0800A8F0 + movs r2, 0 + ldr r0, _0800A8F4 + movs r1, 0x3F +_0800A8D0: + str r2, [r0] + str r2, [r0, 0x4] + adds r0, 0x8 + subs r1, 0x1 + cmp r1, 0 + bge _0800A8D0 + movs r0, 0 + str r0, [r3] + movs r0, 0x1 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800A8EC: .4byte gUnknown_203B094 +_0800A8F0: .4byte gUnknown_202D2A4 +_0800A8F4: .4byte gUnknown_202D2A8 + thumb_func_end sub_800A8C4 + + thumb_func_start sub_800A8F8 +sub_800A8F8: + ldr r1, _0800A904 + ldr r2, [r1] + str r0, [r1] + adds r0, r2, 0 + bx lr + .align 2, 0 +_0800A904: .4byte gUnknown_202D2A4 + thumb_func_end sub_800A8F8 + + thumb_func_start sub_800A908 +sub_800A908: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x12C + mov r8, r0 + adds r4, r1, 0 + ldr r1, _0800A93C + adds r0, r4, 0 + bl strcmp + cmp r0, 0 + beq _0800A922 + movs r0, 0x1 +_0800A922: + movs r1, 0 + lsls r0, 24 + cmp r0, 0 + bne _0800A92C + movs r1, 0x1 +_0800A92C: + cmp r1, 0 + beq _0800A9B6 + ldr r7, [r4, 0xC] + movs r6, 0 + ldr r0, [r4, 0x8] + subs r5, r0, 0x1 + b _0800A94A + .align 2, 0 +_0800A93C: .4byte gUnknown_80B9B94 +_0800A940: + cmp r0, 0 + bge _0800A948 + adds r6, r4, 0x1 + b _0800A94A +_0800A948: + adds r5, r4, 0 +_0800A94A: + cmp r6, r5 + bge _0800A968 + adds r0, r6, r5 + lsrs r1, r0, 31 + adds r0, r1 + asrs r4, r0, 1 + lsls r0, r4, 3 + adds r0, r7 + ldr r0, [r0] + mov r1, r8 + bl strcmp + cmp r0, 0 + bne _0800A940 + adds r6, r4, 0 +_0800A968: + lsls r0, r6, 3 + adds r6, r7, r0 + ldr r0, [r6] + mov r1, r8 + bl strcmp + cmp r0, 0 + beq _0800A994 + ldr r1, _0800A984 + mov r0, sp + mov r2, r8 + bl sprintf + b _0800A9B6 + .align 2, 0 +_0800A984: .4byte gUnknown_80B9B9C +_0800A988: + str r6, [r2] + adds r0, r7, 0x4 + adds r0, r3, r0 + str r1, [r0] + adds r0, r2, 0 + b _0800A9B8 +_0800A994: + ldr r0, _0800A9C4 + ldr r0, [r0] + movs r4, 0 + ldr r5, _0800A9C8 + adds r7, r5, 0 +_0800A99E: + adds r0, 0x1 + cmp r0, 0x3F + ble _0800A9A6 + movs r0, 0 +_0800A9A6: + lsls r3, r0, 3 + adds r2, r3, r5 + ldr r1, [r2] + cmp r1, 0 + beq _0800A988 + adds r4, 0x1 + cmp r4, 0x3F + ble _0800A99E +_0800A9B6: + movs r0, 0 +_0800A9B8: + add sp, 0x12C + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0800A9C4: .4byte gUnknown_203B094 +_0800A9C8: .4byte gUnknown_202D2A8 + thumb_func_end sub_800A908 + + thumb_func_start sub_800A9CC +sub_800A9CC: + ldr r1, [r0] + ldr r1, [r1, 0x4] + str r1, [r0, 0x4] + adds r0, r1, 0 + bx lr + thumb_func_end sub_800A9CC + + thumb_func_start sub_800A9D8 +sub_800A9D8: + push {r4,lr} + adds r4, r0, 0 + bl sub_800A9CC + adds r0, r4, 0 + bl sub_800AA48 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_800A9D8 + + thumb_func_start sub_800A9EC +sub_800A9EC: + push {r4,lr} + bl sub_800A908 + adds r4, r0, 0 + cmp r4, 0 + beq _0800A9FE + movs r1, 0 + bl sub_800A9D8 +_0800A9FE: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_800A9EC + + thumb_func_start sub_800AA08 +sub_800AA08: + push {lr} + bl sub_800A9EC + pop {r1} + bx r1 + thumb_func_end sub_800AA08 + + thumb_func_start sub_800AA14 +sub_800AA14: + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0 + ldr r0, _0800AA30 + movs r3, 0 + ldr r5, _0800AA34 + adds r2, r0, 0x4 +_0800AA22: + cmp r0, r4 + bne _0800AA38 + str r3, [r0] + str r3, [r2] + str r1, [r5] + b _0800AA42 + .align 2, 0 +_0800AA30: .4byte gUnknown_202D2A8 +_0800AA34: .4byte gUnknown_203B094 +_0800AA38: + adds r2, 0x8 + adds r0, 0x8 + adds r1, 0x1 + cmp r1, 0x3F + ble _0800AA22 +_0800AA42: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_800AA14 + + thumb_func_start sub_800AA48 +sub_800AA48: + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, [r5, 0x4] + ldr r1, [r4] + ldr r0, _0800AA60 + cmp r1, r0 + beq _0800AA68 + ldr r0, _0800AA64 + cmp r1, r0 + beq _0800AA6E + adds r0, r4, 0 + b _0800AA72 + .align 2, 0 +_0800AA60: .4byte 0x30524953 +_0800AA64: .4byte 0x4f524953 +_0800AA68: + adds r0, r4, 0 + bl nullsub_15 +_0800AA6E: + ldr r0, [r4, 0x4] + str r0, [r5, 0x4] +_0800AA72: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_800AA48 + + thumb_func_start sub_800AA78 +sub_800AA78: + push {r4,lr} + adds r4, r0, 0 + ldr r1, [r4] + ldr r0, _0800AA90 + cmp r1, r0 + bne _0800AA94 + adds r0, r4, 0 + bl nullsub_15 + ldr r0, [r4, 0x4] + b _0800AA96 + .align 2, 0 +_0800AA90: .4byte 0x30524953 +_0800AA94: + adds r0, r4, 0 +_0800AA96: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_800AA78 + + thumb_func_start nullsub_15 +nullsub_15: + bx lr + thumb_func_end nullsub_15 + + thumb_func_start nullsub_16 +nullsub_16: + bx lr + thumb_func_end nullsub_16 + + thumb_func_start nullsub_175 +nullsub_175: + bx lr + thumb_func_end nullsub_175 + + thumb_func_start sub_800AAA8 +sub_800AAA8: + push {lr} + ldr r2, [r2, 0x4] + bl sub_800AAB4 + pop {r1} + bx r1 + thumb_func_end sub_800AAA8 + + thumb_func_start sub_800AAB4 +sub_800AAB4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + mov r12, r0 + str r1, [sp, 0x24] + mov r8, r2 + ldrb r0, [r2, 0x5] + ldrb r1, [r2, 0x6] + lsls r1, 8 + adds r0, r1 + str r0, [sp, 0x28] + movs r6, 0 + mov r10, r6 + movs r0, 0x8 + mov r9, r0 + ldrb r0, [r2] + cmp r0, 0x41 + bne _0800AB04 + ldrb r0, [r2, 0x1] + adds r1, r0, 0 + cmp r1, 0x54 + bne _0800AB0C + ldrb r0, [r2, 0x2] + cmp r0, 0x34 + bne _0800AB0C + ldrb r0, [r2, 0x3] + cmp r0, 0x50 + bne _0800AB0C + ldrb r1, [r2, 0x10] + ldrb r0, [r2, 0x11] + lsls r0, 8 + adds r1, r0 + ldr r2, [sp, 0x24] + cmp r2, 0 + beq _0800AB08 + cmp r2, r1 + beq _0800AB08 +_0800AB04: + movs r0, 0 + b _0800AE16 +_0800AB08: + movs r1, 0x12 + b _0800AB26 +_0800AB0C: + mov r3, r8 + ldrb r0, [r3] + cmp r0, 0x41 + bne _0800AB04 + cmp r1, 0x54 + bne _0800AB04 + ldrb r0, [r3, 0x2] + cmp r0, 0x33 + bne _0800AB04 + ldrb r0, [r3, 0x3] + cmp r0, 0x50 + bne _0800AB04 + movs r1, 0x10 +_0800AB26: + mov r2, r8 + ldrb r0, [r2, 0x4] + cmp r0, 0x4E + bne _0800AB4A + movs r7, 0 + b _0800AB40 +_0800AB32: + mov r1, r12 + adds r0, r1, r7 + mov r2, r8 + adds r1, r7, r2 + ldrb r1, [r1, 0x7] + strb r1, [r0] + adds r7, 0x1 +_0800AB40: + ldr r3, [sp, 0x28] + cmp r7, r3 + blt _0800AB32 + adds r0, r7, 0 + b _0800AE16 +_0800AB4A: + mov r2, r8 + ldrb r0, [r2, 0x7] + adds r0, 0x3 + str r0, [sp] + ldrb r0, [r2, 0x8] + adds r0, 0x3 + str r0, [sp, 0x4] + ldrb r0, [r2, 0x9] + adds r0, 0x3 + str r0, [sp, 0x8] + ldrb r0, [r2, 0xA] + adds r0, 0x3 + str r0, [sp, 0xC] + ldrb r0, [r2, 0xB] + adds r0, 0x3 + str r0, [sp, 0x10] + ldrb r0, [r2, 0xC] + adds r0, 0x3 + str r0, [sp, 0x14] + ldrb r0, [r2, 0xD] + adds r0, 0x3 + str r0, [sp, 0x18] + ldrb r0, [r2, 0xE] + adds r0, 0x3 + str r0, [sp, 0x1C] + ldrb r0, [r2, 0xF] + adds r0, 0x3 + str r0, [sp, 0x20] + adds r7, r1, 0 + ldr r3, [sp, 0x28] + cmp r7, r3 + blt _0800AB8C + b _0800AE14 +_0800AB8C: + ldr r0, [sp, 0x24] + cmp r0, 0 + beq _0800AB96 + cmp r6, r0 + bge _0800AB04 +_0800AB96: + mov r1, r9 + cmp r1, 0x8 + bne _0800ABAA + mov r2, r8 + adds r0, r2, r7 + ldrb r0, [r0] + mov r10, r0 + adds r7, 0x1 + movs r3, 0 + mov r9, r3 +_0800ABAA: + movs r0, 0x80 + mov r1, r10 + ands r0, r1 + cmp r0, 0 + beq _0800ABB6 + b _0800ADF0 +_0800ABB6: + mov r3, r8 + adds r2, r3, r7 + ldrb r1, [r2] + lsrs r0, r1, 4 + adds r3, r0, 0x3 + movs r0, 0xF + ands r0, r1 + lsls r5, r0, 8 + ldr r0, [sp] + cmp r3, r0 + bne _0800ABCE + movs r3, 0x1F +_0800ABCE: + ldr r0, [sp, 0x4] + cmp r3, r0 + bne _0800ABD6 + movs r3, 0x1E +_0800ABD6: + ldr r0, [sp, 0x8] + cmp r3, r0 + bne _0800ABDE + movs r3, 0x1D +_0800ABDE: + ldr r0, [sp, 0xC] + cmp r3, r0 + bne _0800ABE6 + movs r3, 0x1C +_0800ABE6: + ldr r0, [sp, 0x10] + cmp r3, r0 + bne _0800ABEE + movs r3, 0x1B +_0800ABEE: + ldr r0, [sp, 0x14] + cmp r3, r0 + bne _0800ABF6 + movs r3, 0x1A +_0800ABF6: + ldr r0, [sp, 0x18] + cmp r3, r0 + bne _0800ABFE + movs r3, 0x19 +_0800ABFE: + ldr r0, [sp, 0x1C] + cmp r3, r0 + bne _0800AC06 + movs r3, 0x18 +_0800AC06: + ldr r0, [sp, 0x20] + cmp r3, r0 + bne _0800AC0E + movs r3, 0x17 +_0800AC0E: + adds r0, r3, 0 + subs r0, 0x17 + cmp r0, 0x8 + bls _0800AC18 + b _0800ADB0 +_0800AC18: + lsls r0, 2 + ldr r1, _0800AC24 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0800AC24: .4byte _0800AC28 + .align 2, 0 +_0800AC28: + .4byte _0800AD7C + .4byte _0800AD48 + .4byte _0800AD20 + .4byte _0800ACFA + .4byte _0800ACD6 + .4byte _0800ACB4 + .4byte _0800AC8C + .4byte _0800AC66 + .4byte _0800AC4C +_0800AC4C: + ldrb r1, [r2] + movs r0, 0xF + adds r7, 0x1 + mov r3, r12 + adds r2, r3, r6 + ands r0, r1 + lsls r1, r0, 4 + orrs r1, r0 + strb r1, [r2] + adds r6, 0x1 + adds r0, r3, r6 + strb r1, [r0] + b _0800ADA4 +_0800AC66: + ldrb r0, [r2] + movs r5, 0xF + ands r5, r0 + adds r7, 0x1 + mov r1, r12 + adds r3, r1, r6 + movs r2, 0xF + lsls r0, r5, 4 + adds r1, r5, 0x1 + ands r1, r2 + orrs r0, r1 + strb r0, [r3] + adds r6, 0x1 + mov r3, r12 + adds r2, r3, r6 + lsls r0, r1, 4 + orrs r0, r1 + strb r0, [r2] + b _0800ADA4 +_0800AC8C: + ldrb r0, [r2] + movs r3, 0xF + movs r5, 0xF + ands r5, r0 + adds r7, 0x1 + mov r1, r12 + adds r4, r1, r6 + adds r2, r5, 0 + ands r2, r3 + lsls r1, r2, 4 + subs r0, r5, 0x1 + ands r0, r3 + orrs r0, r1 + strb r0, [r4] + adds r6, 0x1 + mov r3, r12 + adds r0, r3, r6 + orrs r1, r2 + strb r1, [r0] + b _0800ADA4 +_0800ACB4: + ldrb r0, [r2] + movs r3, 0xF + movs r5, 0xF + ands r5, r0 + adds r7, 0x1 + mov r1, r12 + adds r2, r1, r6 + adds r1, r5, 0 + ands r1, r3 + lsls r0, r1, 4 + orrs r0, r1 + strb r0, [r2] + adds r6, 0x1 + mov r0, r12 + adds r2, r0, r6 + subs r0, r5, 0x1 + b _0800AD68 +_0800ACD6: + ldrb r0, [r2] + movs r4, 0xF + movs r5, 0xF + ands r5, r0 + adds r7, 0x1 + mov r2, r12 + adds r3, r2, r6 + adds r1, r5, 0 + ands r1, r4 + lsls r2, r1, 4 + adds r0, r2, 0 + orrs r0, r1 + strb r0, [r3] + adds r6, 0x1 + mov r3, r12 + adds r1, r3, r6 + subs r0, r5, 0x1 + b _0800AD9E +_0800ACFA: + ldrb r0, [r2] + movs r5, 0xF + ands r5, r0 + adds r7, 0x1 + mov r1, r12 + adds r3, r1, r6 + movs r2, 0xF + lsls r0, r5, 4 + subs r1, r5, 0x1 + ands r1, r2 + orrs r0, r1 + strb r0, [r3] + adds r6, 0x1 + mov r3, r12 + adds r2, r3, r6 + lsls r0, r1, 4 + orrs r0, r1 + strb r0, [r2] + b _0800ADA4 +_0800AD20: + ldrb r0, [r2] + movs r3, 0xF + movs r5, 0xF + ands r5, r0 + adds r7, 0x1 + mov r1, r12 + adds r4, r1, r6 + adds r2, r5, 0 + ands r2, r3 + lsls r1, r2, 4 + adds r0, r5, 0x1 + ands r0, r3 + orrs r0, r1 + strb r0, [r4] + adds r6, 0x1 + mov r3, r12 + adds r0, r3, r6 + orrs r1, r2 + strb r1, [r0] + b _0800ADA4 +_0800AD48: + ldrb r0, [r2] + movs r3, 0xF + movs r5, 0xF + ands r5, r0 + adds r7, 0x1 + mov r1, r12 + adds r2, r1, r6 + adds r1, r5, 0 + ands r1, r3 + lsls r0, r1, 4 + orrs r0, r1 + strb r0, [r2] + adds r6, 0x1 + mov r0, r12 + adds r2, r0, r6 + adds r0, r5, 0x1 +_0800AD68: + ands r0, r3 + lsls r0, 4 + orrs r0, r1 + strb r0, [r2] + adds r6, 0x1 + mov r4, r9 + adds r4, 0x1 + mov r1, r10 + lsls r2, r1, 1 + b _0800AE08 +_0800AD7C: + ldrb r0, [r2] + movs r4, 0xF + movs r5, 0xF + ands r5, r0 + adds r7, 0x1 + mov r2, r12 + adds r3, r2, r6 + adds r1, r5, 0 + ands r1, r4 + lsls r2, r1, 4 + adds r0, r2, 0 + orrs r0, r1 + strb r0, [r3] + adds r6, 0x1 + mov r3, r12 + adds r1, r3, r6 + adds r0, r5, 0x1 +_0800AD9E: + ands r0, r4 + orrs r2, r0 + strb r2, [r1] +_0800ADA4: + adds r6, 0x1 + mov r4, r9 + adds r4, 0x1 + mov r0, r10 + lsls r2, r0, 1 + b _0800AE08 +_0800ADB0: + adds r7, 0x1 + mov r1, r8 + adds r0, r1, r7 + ldrb r0, [r0] + adds r5, r0 + adds r7, 0x1 + ldr r2, _0800ADEC + adds r0, r5, r2 + adds r5, r0, r6 + mov r4, r9 + adds r4, 0x1 + mov r0, r10 + lsls r2, r0, 1 + cmp r3, 0 + beq _0800AE08 +_0800ADCE: + mov r1, r12 + adds r1, r6 + mov r10, r1 + mov r0, r12 + adds r0, r5 + ldrb r1, [r0] + mov r0, r10 + strb r1, [r0] + adds r6, 0x1 + adds r5, 0x1 + subs r3, 0x1 + cmp r3, 0 + bne _0800ADCE + b _0800AE08 + .align 2, 0 +_0800ADEC: .4byte 0xfffff000 +_0800ADF0: + mov r1, r12 + adds r0, r1, r6 + mov r2, r8 + adds r1, r2, r7 + ldrb r1, [r1] + strb r1, [r0] + adds r6, 0x1 + adds r7, 0x1 + mov r4, r9 + adds r4, 0x1 + mov r3, r10 + lsls r2, r3, 1 +_0800AE08: + mov r9, r4 + mov r10, r2 + ldr r0, [sp, 0x28] + cmp r7, r0 + bge _0800AE14 + b _0800AB8C +_0800AE14: + adds r0, r6, 0 +_0800AE16: + add sp, 0x2C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_800AAB4 + + thumb_func_start sub_800AE28 +sub_800AE28: + push {lr} + ldr r2, [r2, 0x4] + bl sub_800AE34 + pop {r1} + bx r1 + thumb_func_end sub_800AE28 + + thumb_func_start sub_800AE34 +sub_800AE34: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x34 + str r1, [sp, 0x24] + mov r10, r2 + ldrb r2, [r2, 0x5] + mov r3, r10 + ldrb r1, [r3, 0x6] + lsls r1, 8 + adds r2, r1 + str r2, [sp, 0x28] + movs r1, 0 + mov r9, r1 + movs r2, 0 + str r2, [sp, 0x2C] + movs r3, 0x8 + str r3, [sp, 0x30] + bl sub_800B1BC + mov r1, r10 + ldrb r0, [r1] + cmp r0, 0x41 + bne _0800AE90 + ldrb r0, [r1, 0x1] + adds r1, r0, 0 + cmp r1, 0x54 + bne _0800AE98 + mov r2, r10 + ldrb r0, [r2, 0x2] + cmp r0, 0x34 + bne _0800AE98 + ldrb r0, [r2, 0x3] + cmp r0, 0x50 + bne _0800AE98 + ldrb r1, [r2, 0x10] + ldrb r0, [r2, 0x11] + lsls r0, 8 + adds r1, r0 + ldr r3, [sp, 0x24] + cmp r3, 0 + beq _0800AE94 + cmp r3, r1 + beq _0800AE94 +_0800AE90: + movs r0, 0 + b _0800B1AA +_0800AE94: + movs r1, 0x12 + b _0800AEB2 +_0800AE98: + mov r2, r10 + ldrb r0, [r2] + cmp r0, 0x41 + bne _0800AE90 + cmp r1, 0x54 + bne _0800AE90 + ldrb r0, [r2, 0x2] + cmp r0, 0x33 + bne _0800AE90 + ldrb r0, [r2, 0x3] + cmp r0, 0x50 + bne _0800AE90 + movs r1, 0x10 +_0800AEB2: + mov r3, r10 + ldrb r0, [r3, 0x4] + cmp r0, 0x4E + bne _0800AEE0 + movs r0, 0 + mov r8, r0 + ldr r1, [sp, 0x28] + cmp r8, r1 + bge _0800AED8 +_0800AEC4: + mov r0, r8 + add r0, r10 + ldrb r0, [r0, 0x7] + bl sub_800B220 + movs r2, 0x1 + add r8, r2 + ldr r3, [sp, 0x28] + cmp r8, r3 + blt _0800AEC4 +_0800AED8: + bl sub_800B270 + mov r0, r8 + b _0800B1AA +_0800AEE0: + mov r2, r10 + ldrb r0, [r2, 0x7] + adds r0, 0x3 + str r0, [sp] + ldrb r0, [r2, 0x8] + adds r0, 0x3 + str r0, [sp, 0x4] + ldrb r0, [r2, 0x9] + adds r0, 0x3 + str r0, [sp, 0x8] + ldrb r0, [r2, 0xA] + adds r0, 0x3 + str r0, [sp, 0xC] + ldrb r0, [r2, 0xB] + adds r0, 0x3 + str r0, [sp, 0x10] + ldrb r0, [r2, 0xC] + adds r0, 0x3 + str r0, [sp, 0x14] + ldrb r0, [r2, 0xD] + adds r0, 0x3 + str r0, [sp, 0x18] + ldrb r0, [r2, 0xE] + adds r0, 0x3 + str r0, [sp, 0x1C] + ldrb r0, [r2, 0xF] + adds r0, 0x3 + str r0, [sp, 0x20] + mov r8, r1 + ldr r3, [sp, 0x28] + cmp r8, r3 + blt _0800AF22 + b _0800B1A4 +_0800AF22: + ldr r0, [sp, 0x24] + cmp r0, 0 + beq _0800AF2C + cmp r9, r0 + bge _0800AE90 +_0800AF2C: + ldr r1, [sp, 0x30] + cmp r1, 0x8 + bne _0800AF42 + mov r0, r10 + add r0, r8 + ldrb r0, [r0] + str r0, [sp, 0x2C] + movs r2, 0x1 + add r8, r2 + movs r3, 0 + str r3, [sp, 0x30] +_0800AF42: + movs r0, 0x80 + ldr r1, [sp, 0x2C] + ands r0, r1 + cmp r0, 0 + beq _0800AF4E + b _0800B180 +_0800AF4E: + mov r2, r10 + add r2, r8 + ldrb r1, [r2] + lsrs r0, r1, 4 + adds r3, r0, 0x3 + movs r0, 0xF + ands r0, r1 + lsls r7, r0, 8 + ldr r0, [sp] + cmp r3, r0 + bne _0800AF66 + movs r3, 0x1F +_0800AF66: + ldr r0, [sp, 0x4] + cmp r3, r0 + bne _0800AF6E + movs r3, 0x1E +_0800AF6E: + ldr r0, [sp, 0x8] + cmp r3, r0 + bne _0800AF76 + movs r3, 0x1D +_0800AF76: + ldr r0, [sp, 0xC] + cmp r3, r0 + bne _0800AF7E + movs r3, 0x1C +_0800AF7E: + ldr r0, [sp, 0x10] + cmp r3, r0 + bne _0800AF86 + movs r3, 0x1B +_0800AF86: + ldr r0, [sp, 0x14] + cmp r3, r0 + bne _0800AF8E + movs r3, 0x1A +_0800AF8E: + ldr r0, [sp, 0x18] + cmp r3, r0 + bne _0800AF96 + movs r3, 0x19 +_0800AF96: + ldr r0, [sp, 0x1C] + cmp r3, r0 + bne _0800AF9E + movs r3, 0x18 +_0800AF9E: + ldr r0, [sp, 0x20] + cmp r3, r0 + bne _0800AFA6 + movs r3, 0x17 +_0800AFA6: + adds r0, r3, 0 + subs r0, 0x17 + cmp r0, 0x8 + bls _0800AFB0 + b _0800B13C +_0800AFB0: + lsls r0, 2 + ldr r1, _0800AFBC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0800AFBC: .4byte _0800AFC0 + .align 2, 0 +_0800AFC0: + .4byte _0800B104 + .4byte _0800B0DE + .4byte _0800B0BA + .4byte _0800B090 + .4byte _0800B06E + .4byte _0800B048 + .4byte _0800B024 + .4byte _0800AFFE + .4byte _0800AFE4 +_0800AFE4: + ldrb r0, [r2] + movs r1, 0xF + movs r2, 0x1 + add r8, r2 + ands r1, r0 + lsls r4, r1, 4 + orrs r4, r1 + adds r0, r4, 0 + bl sub_800B220 + movs r3, 0x1 + add r9, r3 + b _0800B128 +_0800AFFE: + ldrb r0, [r2] + movs r6, 0xF + ands r6, r0 + movs r2, 0x1 + add r8, r2 + movs r1, 0xF + lsls r0, r6, 4 + adds r4, r6, 0x1 + ands r4, r1 + orrs r0, r4 + bl sub_800B220 + movs r3, 0x1 + add r9, r3 + lsls r0, r4, 4 + orrs r0, r4 + lsls r0, 24 + lsrs r0, 24 + b _0800B12A +_0800B024: + ldrb r0, [r2] + movs r1, 0xF + movs r6, 0xF + ands r6, r0 + movs r2, 0x1 + add r8, r2 + adds r5, r6, 0 + ands r5, r1 + lsls r4, r5, 4 + subs r0, r6, 0x1 + ands r0, r1 + orrs r0, r4 + bl sub_800B220 + movs r3, 0x1 + add r9, r3 + orrs r4, r5 + b _0800B128 +_0800B048: + ldrb r0, [r2] + movs r5, 0xF + movs r6, 0xF + ands r6, r0 + movs r2, 0x1 + add r8, r2 + adds r4, r6, 0 + ands r4, r5 + lsls r0, r4, 4 + orrs r0, r4 + bl sub_800B220 + movs r3, 0x1 + add r9, r3 + subs r0, r6, 0x1 + ands r0, r5 + lsls r0, 4 + orrs r0, r4 + b _0800B12A +_0800B06E: + ldrb r0, [r2] + movs r5, 0xF + movs r6, 0xF + ands r6, r0 + movs r2, 0x1 + add r8, r2 + adds r1, r6, 0 + ands r1, r5 + lsls r4, r1, 4 + adds r0, r4, 0 + orrs r0, r1 + bl sub_800B220 + movs r3, 0x1 + add r9, r3 + subs r0, r6, 0x1 + b _0800B124 +_0800B090: + ldrb r0, [r2] + movs r6, 0xF + ands r6, r0 + movs r2, 0x1 + add r8, r2 + movs r1, 0xF + lsls r0, r6, 4 + subs r4, r6, 0x1 + ands r4, r1 + orrs r0, r4 + lsls r0, 24 + lsrs r0, 24 + bl sub_800B220 + movs r3, 0x1 + add r9, r3 + lsls r0, r4, 4 + orrs r0, r4 + lsls r0, 24 + lsrs r0, 24 + b _0800B12A +_0800B0BA: + ldrb r0, [r2] + movs r1, 0xF + movs r6, 0xF + ands r6, r0 + movs r2, 0x1 + add r8, r2 + adds r5, r6, 0 + ands r5, r1 + lsls r4, r5, 4 + adds r0, r6, 0x1 + ands r0, r1 + orrs r0, r4 + bl sub_800B220 + movs r3, 0x1 + add r9, r3 + orrs r4, r5 + b _0800B128 +_0800B0DE: + ldrb r0, [r2] + movs r5, 0xF + movs r6, 0xF + ands r6, r0 + movs r2, 0x1 + add r8, r2 + adds r4, r6, 0 + ands r4, r5 + lsls r0, r4, 4 + orrs r0, r4 + bl sub_800B220 + movs r3, 0x1 + add r9, r3 + adds r0, r6, 0x1 + ands r0, r5 + lsls r0, 4 + orrs r0, r4 + b _0800B12A +_0800B104: + ldrb r0, [r2] + movs r5, 0xF + movs r6, 0xF + ands r6, r0 + movs r2, 0x1 + add r8, r2 + adds r1, r6, 0 + ands r1, r5 + lsls r4, r1, 4 + adds r0, r4, 0 + orrs r0, r1 + bl sub_800B220 + movs r3, 0x1 + add r9, r3 + adds r0, r6, 0x1 +_0800B124: + ands r0, r5 + orrs r4, r0 +_0800B128: + adds r0, r4, 0 +_0800B12A: + bl sub_800B220 + movs r0, 0x1 + add r9, r0 + ldr r5, [sp, 0x30] + adds r5, 0x1 + ldr r1, [sp, 0x2C] + lsls r4, r1, 1 + b _0800B198 +_0800B13C: + movs r2, 0x1 + add r8, r2 + mov r0, r10 + add r0, r8 + ldrb r0, [r0] + adds r7, r0 + add r8, r2 + ldr r1, _0800B17C + adds r0, r7, r1 + mov r2, r9 + adds r7, r0, r2 + ldr r5, [sp, 0x30] + adds r5, 0x1 + ldr r0, [sp, 0x2C] + lsls r4, r0, 1 + cmp r3, 0 + beq _0800B198 + adds r6, r3, 0 +_0800B160: + adds r0, r7, 0 + bl sub_800B1E0 + lsls r0, 24 + lsrs r0, 24 + bl sub_800B220 + movs r1, 0x1 + add r9, r1 + adds r7, 0x1 + subs r6, 0x1 + cmp r6, 0 + bne _0800B160 + b _0800B198 + .align 2, 0 +_0800B17C: .4byte 0xfffff000 +_0800B180: + mov r0, r10 + add r0, r8 + ldrb r0, [r0] + bl sub_800B220 + movs r2, 0x1 + add r9, r2 + add r8, r2 + ldr r5, [sp, 0x30] + adds r5, 0x1 + ldr r3, [sp, 0x2C] + lsls r4, r3, 1 +_0800B198: + str r5, [sp, 0x30] + str r4, [sp, 0x2C] + ldr r0, [sp, 0x28] + cmp r8, r0 + bge _0800B1A4 + b _0800AF22 +_0800B1A4: + bl sub_800B270 + mov r0, r9 +_0800B1AA: + add sp, 0x34 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_800AE34 + + thumb_func_start sub_800B1BC +sub_800B1BC: + ldr r1, _0800B1D0 + str r0, [r1] + ldr r1, _0800B1D4 + str r0, [r1] + ldr r0, _0800B1D8 + movs r1, 0 + str r1, [r0] + ldr r0, _0800B1DC + str r1, [r0] + bx lr + .align 2, 0 +_0800B1D0: .4byte gUnknown_202D4A8 +_0800B1D4: .4byte gUnknown_202D4AC +_0800B1D8: .4byte gUnknown_202D4B0 +_0800B1DC: .4byte gUnknown_202D4B4 + thumb_func_end sub_800B1BC + + thumb_func_start sub_800B1E0 +sub_800B1E0: + push {lr} + adds r2, r0, 0 + cmp r2, 0 + bge _0800B1EA + adds r0, r2, 0x3 +_0800B1EA: + asrs r0, 2 + ldr r1, _0800B20C + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x3 + ands r1, r2 + cmp r1, 0x1 + beq _0800B210 + cmp r1, 0x1 + ble _0800B216 + cmp r1, 0x2 + beq _0800B214 + cmp r1, 0x3 + beq _0800B218 + b _0800B216 + .align 2, 0 +_0800B20C: .4byte gUnknown_202D4AC +_0800B210: + lsrs r0, 8 + b _0800B216 +_0800B214: + lsrs r0, 16 +_0800B216: + lsls r0, 24 +_0800B218: + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_800B1E0 + + thumb_func_start sub_800B220 +sub_800B220: + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r4, _0800B260 + ldr r2, _0800B264 + ldr r3, _0800B268 + ldr r1, [r3] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + lsls r0, r1 + ldr r1, [r4] + orrs r1, r0 + str r1, [r4] + ldr r2, _0800B26C + ldr r0, [r2] + str r1, [r0] + ldr r0, [r3] + adds r0, 0x1 + str r0, [r3] + cmp r0, 0x4 + bne _0800B258 + ldr r0, [r2] + adds r0, 0x4 + str r0, [r2] + movs r0, 0 + str r0, [r4] + str r0, [r3] +_0800B258: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800B260: .4byte gUnknown_202D4B0 +_0800B264: .4byte gUnknown_80B9BB8 +_0800B268: .4byte gUnknown_202D4B4 +_0800B26C: .4byte gUnknown_202D4A8 + thumb_func_end sub_800B220 + + thumb_func_start sub_800B270 +sub_800B270: + push {lr} + ldr r0, _0800B288 + ldr r0, [r0] + cmp r0, 0 + beq _0800B284 + ldr r0, _0800B28C + ldr r1, [r0] + ldr r0, _0800B290 + ldr r0, [r0] + str r0, [r1] +_0800B284: + pop {r0} + bx r0 + .align 2, 0 +_0800B288: .4byte gUnknown_202D4B4 +_0800B28C: .4byte gUnknown_202D4A8 +_0800B290: .4byte gUnknown_202D4B0 + thumb_func_end sub_800B270 + + thumb_func_start sub_800B294 +sub_800B294: + push {lr} + adds r1, r0, 0 + ldrb r0, [r1] + cmp r0, 0x41 + bne _0800B2CC + ldrb r0, [r1, 0x1] + adds r2, r0, 0 + cmp r2, 0x54 + bne _0800B2B2 + ldrb r0, [r1, 0x2] + cmp r0, 0x34 + bne _0800B2B2 + ldrb r0, [r1, 0x3] + cmp r0, 0x50 + beq _0800B2C8 +_0800B2B2: + ldrb r0, [r1] + cmp r0, 0x41 + bne _0800B2CC + cmp r2, 0x54 + bne _0800B2CC + ldrb r0, [r1, 0x2] + cmp r0, 0x33 + bne _0800B2CC + ldrb r0, [r1, 0x3] + cmp r0, 0x50 + bne _0800B2CC +_0800B2C8: + movs r0, 0x1 + b _0800B2CE +_0800B2CC: + movs r0, 0 +_0800B2CE: + pop {r1} + bx r1 + thumb_func_end sub_800B294 + + thumb_func_start sub_800B2D4 +sub_800B2D4: + push {r4-r6,lr} + adds r6, r0, 0 + adds r5, r1, 0 + adds r4, r2, 0 + movs r2, 0 + cmp r2, r4 + bge _0800B324 +_0800B2E2: + adds r0, r6, r2 + ldrb r1, [r0] + adds r0, r5, r2 + ldrb r3, [r0] + adds r0, r1, 0 + subs r0, 0x41 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x19 + bhi _0800B2FE + adds r0, r1, 0 + adds r0, 0x20 + lsls r0, 24 + lsrs r1, r0, 24 +_0800B2FE: + adds r0, r3, 0 + subs r0, 0x41 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x19 + bhi _0800B312 + adds r0, r3, 0 + adds r0, 0x20 + lsls r0, 24 + lsrs r3, r0, 24 +_0800B312: + cmp r1, r3 + beq _0800B31A + movs r0, 0x1 + b _0800B326 +_0800B31A: + cmp r1, 0 + beq _0800B324 + adds r2, 0x1 + cmp r2, r4 + blt _0800B2E2 +_0800B324: + movs r0, 0 +_0800B326: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_800B2D4 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/code_800B540.s b/asm/code_800B540.s new file mode 100644 index 00000000..017ac055 --- /dev/null +++ b/asm/code_800B540.s @@ -0,0 +1,331349 @@ + .include "constants/gba_constants.inc" + .include "asm/macros.inc" + + .syntax unified + + .text + + thumb_func_start sub_800B540 +sub_800B540: + push {r4,lr} + ldr r1, _0800B5C8 + movs r2, 0 + adds r0, r1, 0 + adds r0, 0x14 +_0800B54A: + str r2, [r0] + subs r0, 0x4 + cmp r0, r1 + bge _0800B54A + bl nullsub_17 + bl sub_800BD08 + ldr r1, _0800B5CC +_0800B55C: + ldrh r0, [r1] + cmp r0, 0x9F + bls _0800B55C + ldr r4, _0800B5D0 + ldrh r0, [r4] + movs r1, 0x45 + eors r0, r1 + strh r0, [r4] + movs r2, 0x80 + lsls r2, 19 + ldrb r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strb r0, [r2] + ldr r0, _0800B5D4 + bl sub_800B6B0 + ldr r1, _0800B5D8 + movs r0, 0xC1 + lsls r0, 16 + str r0, [r1] + ldrh r0, [r4] + ldr r2, _0800B5DC + adds r1, r2, 0 + orrs r0, r1 + strh r0, [r4] + ldr r1, _0800B5E0 + movs r0, 0x28 + strh r0, [r1] + ldr r1, _0800B5E4 + movs r2, 0x1 + negs r2, r2 + adds r0, r2, 0 + strh r0, [r1] + ldr r1, _0800B5E8 + movs r0, 0 + strh r0, [r1] + bl sub_800D6AC + bl sub_800D7D0 + ldr r1, _0800B5EC + movs r0, 0x1 + strb r0, [r1] + bl sub_800B5F0 + ldr r1, _0800B5CC +_0800B5BA: + ldrh r0, [r1] + cmp r0, 0x9F + bls _0800B5BA + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800B5C8: .4byte gUnknown_202D5F0 +_0800B5CC: .4byte 0x04000006 +_0800B5D0: .4byte 0x04000200 +_0800B5D4: .4byte gUnknown_80B9C00 +_0800B5D8: .4byte 0x0400010c +_0800B5DC: .4byte 0x00002045 +_0800B5E0: .4byte 0x04000004 +_0800B5E4: .4byte gUnknown_203B0AE +_0800B5E8: .4byte gUnknown_203B0AC +_0800B5EC: .4byte gUnknown_203B098 + thumb_func_end sub_800B540 + + thumb_func_start sub_800B5F0 +sub_800B5F0: + push {lr} + ldr r0, _0800B610 + ldrb r0, [r0] + cmp r0, 0 + beq _0800B618 + ldr r3, _0800B614 + ldrh r1, [r3] + movs r2, 0x1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _0800B618 + strh r2, [r3] + movs r0, 0x1 + b _0800B61A + .align 2, 0 +_0800B610: .4byte gUnknown_203B098 +_0800B614: .4byte 0x04000208 +_0800B618: + movs r0, 0 +_0800B61A: + pop {r1} + bx r1 + thumb_func_end sub_800B5F0 + + thumb_func_start sub_800B620 +sub_800B620: + push {lr} + ldr r0, _0800B640 + ldrb r0, [r0] + cmp r0, 0 + beq _0800B648 + ldr r2, _0800B644 + ldrh r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0800B648 + movs r0, 0 + strh r0, [r2] + movs r0, 0x1 + b _0800B64A + .align 2, 0 +_0800B640: .4byte gUnknown_203B098 +_0800B644: .4byte 0x04000208 +_0800B648: + movs r0, 0 +_0800B64A: + pop {r1} + bx r1 + thumb_func_end sub_800B620 + + thumb_func_start sub_800B650 +sub_800B650: + push {lr} + ldr r0, _0800B66C + ldrb r0, [r0] + cmp r0, 0 + beq _0800B674 + ldr r0, _0800B670 + ldrh r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0800B674 + movs r0, 0x1 + b _0800B676 + .align 2, 0 +_0800B66C: .4byte gUnknown_203B098 +_0800B670: .4byte 0x04000208 +_0800B674: + movs r0, 0 +_0800B676: + pop {r1} + bx r1 + thumb_func_end sub_800B650 + + thumb_func_start sub_800B67C +sub_800B67C: + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + ldr r0, _0800B6A4 + ldrb r0, [r0] + cmp r0, 0 + beq _0800B69E + ldr r3, _0800B6A8 + movs r0, 0 + strh r0, [r3] + ldr r2, _0800B6AC + ldrh r1, [r2] + adds r0, r4, 0 + orrs r0, r1 + strh r0, [r2] + movs r0, 0x1 + strh r0, [r3] +_0800B69E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800B6A4: .4byte gUnknown_203B098 +_0800B6A8: .4byte 0x04000208 +_0800B6AC: .4byte INTR_CHECK + thumb_func_end sub_800B67C + + thumb_func_start sub_800B6B0 +sub_800B6B0: + push {r4,lr} + ldr r1, _0800B6D0 + ldr r2, _0800B6D4 + bl CpuSet + ldr r0, _0800B6D8 + ldr r4, _0800B6DC + ldr r2, _0800B6E0 + adds r1, r4, 0 + bl CpuSet + ldr r0, _0800B6E4 + str r4, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800B6D0: .4byte gIntrTable +_0800B6D4: .4byte 0x04000006 +_0800B6D8: .4byte IntrMain +_0800B6DC: .4byte gUnknown_202D4B8 +_0800B6E0: .4byte 0x04000048 +_0800B6E4: .4byte INTR_VECTOR + thumb_func_end sub_800B6B0 + + thumb_func_start sub_800B6E8 +sub_800B6E8: + lsls r0, 2 + ldr r1, _0800B6F0 + adds r0, r1 + bx lr + .align 2, 0 +_0800B6F0: .4byte gIntrTable + thumb_func_end sub_800B6E8 + + thumb_func_start sub_800B6F4 +sub_800B6F4: + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_800B620 + lsls r0, 24 + ldr r1, _0800B71C + lsls r4, 2 + adds r4, r1 + ldr r6, [r4] + str r5, [r4] + cmp r0, 0 + beq _0800B712 + bl sub_800B5F0 +_0800B712: + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0800B71C: .4byte gUnknown_202D5F0 + thumb_func_end sub_800B6F4 + + thumb_func_start sub_800B720 +sub_800B720: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + str r1, [sp] + lsls r0, 16 + asrs r0, 16 + str r0, [sp, 0xC] + bl sub_800B620 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + ldr r0, _0800B780 + mov r8, r0 + ldr r1, _0800B784 + mov r10, r1 + ldr r2, _0800B788 + mov r9, r2 + ldr r5, _0800B78C + mov r12, r5 +_0800B74E: + movs r7, 0 + str r7, [sp, 0x10] + movs r4, 0 + ldr r3, _0800B784 + mov r1, r8 + movs r2, 0 + ldrsh r0, [r1, r2] + ldr r6, _0800B78C + ldr r5, [sp, 0xC] + lsls r5, 16 + str r5, [sp, 0x8] + cmp r4, r0 + bge _0800B7BA + movs r7, 0 + ldrsh r1, [r3, r7] + ldrh r2, [r6] + movs r5, 0 + ldrsh r0, [r6, r5] + cmp r1, r0 + bne _0800B790 + adds r0, r2, 0x1 + mov r7, r9 + ands r0, r7 + strh r0, [r6] + b _0800B74E + .align 2, 0 +_0800B780: .4byte gUnknown_203B0AA +_0800B784: .4byte gUnknown_202D608 +_0800B788: .4byte 0x00007fff +_0800B78C: .4byte gUnknown_203B0A8 +_0800B790: + adds r4, 0x1 + adds r3, 0x8 + mov r1, r8 + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r4, r0 + bge _0800B7BA + movs r5, 0 + ldrsh r1, [r3, r5] + mov r7, r12 + ldrh r2, [r7] + movs r5, 0 + ldrsh r0, [r7, r5] + cmp r1, r0 + bne _0800B790 + adds r0, r2, 0x1 + mov r7, r9 + ands r0, r7 + strh r0, [r6] + movs r0, 0x1 + str r0, [sp, 0x10] +_0800B7BA: + ldr r1, [sp, 0x10] + cmp r1, 0 + bne _0800B74E + movs r4, 0 + mov r3, r10 + ldr r2, _0800B84C + movs r5, 0 + ldrsh r1, [r2, r5] + cmp r4, r1 + bge _0800B7EA + movs r7, 0x2 + ldrsh r0, [r3, r7] + ldr r2, [sp, 0xC] + cmp r0, r2 + bgt _0800B7EA +_0800B7D8: + adds r4, 0x1 + adds r3, 0x8 + cmp r4, r1 + bge _0800B7EA + movs r5, 0x2 + ldrsh r0, [r3, r5] + ldr r7, [sp, 0xC] + cmp r0, r7 + ble _0800B7D8 +_0800B7EA: + ldr r1, _0800B84C + movs r2, 0 + ldrsh r0, [r1, r2] + subs r2, r0, 0x1 + lsls r0, r2, 3 + mov r5, r10 + adds r3, r0, r5 + lsls r5, r4, 3 + cmp r2, r4 + blt _0800B80E +_0800B7FE: + ldr r0, [r3] + ldr r1, [r3, 0x4] + str r0, [r3, 0x8] + str r1, [r3, 0xC] + subs r2, 0x1 + subs r3, 0x8 + cmp r2, r4 + bge _0800B7FE +_0800B80E: + ldr r7, _0800B84C + ldrh r0, [r7] + adds r0, 0x1 + strh r0, [r7] + mov r0, r10 + adds r1, r5, r0 + ldrh r0, [r6] + strh r0, [r1] + ldr r2, [sp, 0x8] + lsrs r0, r2, 16 + strh r0, [r1, 0x2] + mov r0, r10 + adds r0, 0x4 + adds r0, r5, r0 + ldr r5, [sp] + str r5, [r0] + ldr r7, [sp, 0x4] + cmp r7, 0 + beq _0800B838 + bl sub_800B5F0 +_0800B838: + movs r1, 0 + ldrsh r0, [r6, r1] + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0800B84C: .4byte gUnknown_203B0AA + thumb_func_end sub_800B720 + + thumb_func_start sub_800B850 +sub_800B850: + push {r4-r7,lr} + lsls r0, 16 + asrs r6, r0, 16 + bl sub_800B620 + lsls r0, 24 + lsrs r5, r0, 24 + movs r2, 0 + ldr r4, _0800B8A0 + ldr r3, _0800B8A4 + movs r1, 0 + ldrsh r0, [r3, r1] + cmp r2, r0 + bge _0800B8B4 + adds r1, r3, 0 +_0800B86E: + movs r7, 0 + ldrsh r0, [r4, r7] + cmp r0, r6 + bne _0800B8A8 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r2, r0 + bge _0800B896 + ldr r3, _0800B8A4 +_0800B886: + ldr r0, [r4, 0x8] + ldr r1, [r4, 0xC] + stm r4!, {r0,r1} + adds r2, 0x1 + movs r7, 0 + ldrsh r0, [r3, r7] + cmp r2, r0 + blt _0800B886 +_0800B896: + cmp r5, 0 + beq _0800B8BC + bl sub_800B5F0 + b _0800B8BC + .align 2, 0 +_0800B8A0: .4byte gUnknown_202D608 +_0800B8A4: .4byte gUnknown_203B0AA +_0800B8A8: + adds r2, 0x1 + adds r4, 0x8 + movs r7, 0 + ldrsh r0, [r3, r7] + cmp r2, r0 + blt _0800B86E +_0800B8B4: + cmp r5, 0 + beq _0800B8BC + bl sub_800B5F0 +_0800B8BC: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_800B850 + + thumb_func_start nullsub_177 +nullsub_177: + bx lr + thumb_func_end nullsub_177 + + thumb_func_start VBlankIntr +VBlankIntr: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, _0800B95C + ldr r1, [r0] + adds r1, 0x1 + str r1, [r0] + bl SoundVSync + bl BlinkSavingIcon + ldr r0, _0800B960 + ldr r0, [r0, 0x4] + cmp r0, 0 + beq _0800B8EE + bl _call_via_r0 +_0800B8EE: + movs r2, 0 + ldr r3, _0800B964 + movs r1, 0 + ldrsh r0, [r3, r1] + adds r6, r3, 0 + ldr r7, _0800B968 + ldr r1, _0800B96C + mov r12, r1 + ldr r1, _0800B970 + mov r8, r1 + ldr r1, _0800B974 + mov r9, r1 + ldr r1, _0800B978 + mov r10, r1 + cmp r2, r0 + bge _0800B920 + ldr r5, _0800B97C + ldr r4, _0800B980 +_0800B912: + ldm r5!, {r0,r1} + stm r4!, {r0,r1} + adds r2, 0x1 + movs r1, 0 + ldrsh r0, [r3, r1] + cmp r2, r0 + blt _0800B912 +_0800B920: + ldrh r0, [r6] + strh r0, [r7] + movs r1, 0x1 + negs r1, r1 + adds r0, r1, 0 + mov r1, r12 + strh r0, [r1] + mov r1, r8 + strh r0, [r1] + mov r1, r9 + strh r0, [r1] + ldr r1, _0800B984 + movs r0, 0x28 + strh r0, [r1] + mov r1, r10 + ldrb r0, [r1] + cmp r0, 0 + bne _0800B948 + bl UpdateSound +_0800B948: + movs r0, 0x1 + bl sub_800B67C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0800B95C: .4byte gUnknown_203B0A0 +_0800B960: .4byte gUnknown_202D5F0 +_0800B964: .4byte gUnknown_203B0AA +_0800B968: .4byte gUnknown_203B0AC +_0800B96C: .4byte gUnknown_203B0AE +_0800B970: .4byte gUnknown_203B0B0 +_0800B974: .4byte gUnknown_203B0B2 +_0800B978: .4byte gUnknown_203B099 +_0800B97C: .4byte gUnknown_202D608 +_0800B980: .4byte gUnknown_202D648 +_0800B984: .4byte 0x04000004 + thumb_func_end VBlankIntr + + thumb_func_start VCountIntr +VCountIntr: + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, _0800BA44 + ldrh r0, [r0] + lsls r0, 16 + asrs r6, r0, 16 + ldr r0, _0800BA48 + movs r2, 0 + ldrsh r1, [r0, r2] + adds r7, r0, 0 + cmp r1, 0 + bge _0800B9B2 + ldr r0, _0800BA4C + ldr r0, [r0, 0x8] + cmp r0, 0 + beq _0800B9AE + bl _call_via_r0 +_0800B9AE: + movs r0, 0 + strh r0, [r7] +_0800B9B2: + ldr r0, _0800BA50 + movs r3, 0 + ldrsh r2, [r7, r3] + movs r3, 0 + ldrsh r1, [r0, r3] + mov r8, r0 + cmp r2, r1 + bge _0800BA34 + ldr r1, _0800BA54 + adds r0, r2, 0 + lsls r0, 3 + adds r0, r1 + movs r3, 0x2 + ldrsh r0, [r0, r3] + cmp r0, r6 + bgt _0800BA10 + adds r5, r1, 0 + adds r4, r7, 0 +_0800B9D6: + movs r1, 0 + ldrsh r0, [r4, r1] + lsls r0, 3 + adds r1, r5, 0x4 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + beq _0800B9EA + bl _call_via_r0 +_0800B9EA: + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + ldr r1, _0800BA50 + lsls r0, 16 + asrs r0, 16 + movs r2, 0 + ldrsh r1, [r1, r2] + cmp r0, r1 + bge _0800BA34 + movs r3, 0 + ldrsh r0, [r4, r3] + lsls r0, 3 + adds r0, r5 + movs r1, 0x2 + ldrsh r0, [r0, r1] + ldr r7, _0800BA48 + cmp r0, r6 + ble _0800B9D6 +_0800BA10: + movs r2, 0 + ldrsh r1, [r7, r2] + mov r3, r8 + movs r2, 0 + ldrsh r0, [r3, r2] + cmp r1, r0 + bge _0800BA34 + ldr r2, _0800BA58 + ldr r1, _0800BA54 + movs r3, 0 + ldrsh r0, [r7, r3] + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x2] + lsls r0, 8 + movs r1, 0x28 + orrs r0, r1 + strh r0, [r2] +_0800BA34: + movs r0, 0x4 + bl sub_800B67C + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0800BA44: .4byte 0x04000006 +_0800BA48: .4byte gUnknown_203B0AE +_0800BA4C: .4byte gUnknown_202D5F0 +_0800BA50: .4byte gUnknown_203B0AC +_0800BA54: .4byte gUnknown_202D648 +_0800BA58: .4byte 0x04000004 + thumb_func_end VCountIntr + + thumb_func_start sub_800BA5C +sub_800BA5C: + push {r4,lr} + ldr r4, _0800BAA4 + ldrb r0, [r4] + cmp r0, 0 + beq _0800BA72 + ldr r1, _0800BAA8 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bl xxx_update_bg_sound_input +_0800BA72: + movs r0, 0x1 + strb r0, [r4] + ldr r1, _0800BAAC + movs r0, 0 + strb r0, [r1] + ldr r1, _0800BAA8 + movs r0, 0 + str r0, [r1] + bl nullsub_25 + ldr r1, _0800BAB0 +_0800BA88: + ldrh r0, [r1] + cmp r0, 0x9F + bhi _0800BA88 + ldr r1, _0800BAB4 + movs r0, 0x1 + strb r0, [r1] + bl VBlankIntrWait + bl nullsub_18 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800BAA4: .4byte gUnknown_203B09A +_0800BAA8: .4byte gUnknown_203B09C +_0800BAAC: .4byte gUnknown_203B09B +_0800BAB0: .4byte 0x04000006 +_0800BAB4: .4byte gUnknown_203B099 + thumb_func_end sub_800BA5C + + thumb_func_start xxx_update_bg_sound_input +xxx_update_bg_sound_input: + push {r4,r5,lr} + ldr r1, _0800BACC + ldrb r4, [r1] + cmp r4, 0 + beq _0800BAD4 + ldr r1, _0800BAD0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + b _0800BAFE + .align 2, 0 +_0800BACC: .4byte gUnknown_203B09B +_0800BAD0: .4byte gUnknown_203B09C +_0800BAD4: + movs r0, 0x1 + strb r0, [r1] + ldr r0, _0800BB04 + strb r4, [r0] + ldr r0, _0800BB08 + str r4, [r0] + bl UpdateBGControlRegisters + ldr r5, _0800BB0C + ldrb r0, [r5] + cmp r0, 0 + beq _0800BAF0 + bl UpdateSound +_0800BAF0: + bl UpdateInput + strb r4, [r5] + ldr r0, _0800BB10 + ldr r1, _0800BB14 + ldr r1, [r1] + str r1, [r0] +_0800BAFE: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0800BB04: .4byte gUnknown_203B09A +_0800BB08: .4byte gUnknown_203B09C +_0800BB0C: .4byte gUnknown_203B099 +_0800BB10: .4byte gUnknown_203B0A4 +_0800BB14: .4byte gUnknown_203B0A0 + thumb_func_end xxx_update_bg_sound_input + + thumb_func_start Timer3Intr +Timer3Intr: + push {lr} + ldr r0, _0800BB30 + ldr r0, [r0, 0x10] + cmp r0, 0 + beq _0800BB26 + bl _call_via_r0 +_0800BB26: + movs r0, 0x40 + bl sub_800B67C + pop {r0} + bx r0 + .align 2, 0 +_0800BB30: .4byte gUnknown_202D5F0 + thumb_func_end Timer3Intr + + thumb_func_start sub_800BB34 +sub_800BB34: + ldr r0, _0800BB3C + ldr r0, [r0] + bx lr + .align 2, 0 +_0800BB3C: .4byte gUnknown_203B0A0 + thumb_func_end sub_800BB34 + + thumb_func_start nullsub_178 +nullsub_178: + bx lr + thumb_func_end nullsub_178 + + thumb_func_start sub_800BB44 +sub_800BB44: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r2, _0800BBF0 + ldrh r0, [r2] + ldr r1, _0800BBF4 + cmp r0, r1 + beq _0800BB60 +_0800BB5A: + ldrh r0, [r2] + cmp r0, r1 + bne _0800BB5A +_0800BB60: + bl sub_800B620 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + ldr r1, _0800BBF8 +_0800BB6C: + ldrh r0, [r1] + cmp r0, 0x9F + bls _0800BB6C + movs r0, 0x80 + lsls r0, 19 + mov r9, r0 + ldrh r1, [r0] + mov r8, r1 + movs r0, 0x80 + mov r2, r9 + strh r0, [r2] + movs r7, 0xA0 + lsls r7, 19 + ldr r1, _0800BBFC + adds r0, r1, 0 + strh r0, [r7] + ldr r5, _0800BC00 + ldrh r4, [r5] + movs r2, 0xC0 + lsls r2, 6 + adds r0, r2, 0 + strh r0, [r5] + ldr r0, _0800BC04 + mov r10, r0 + ldr r1, _0800BC08 + adds r0, r1, 0 + mov r2, r10 + strh r0, [r2] + ldr r6, _0800BC0C + movs r0, 0x1 + strh r0, [r6] + bl SoundBiasReset + swi 0x3 + bl SoundBiasSet + movs r0, 0 + strh r0, [r6] + strh r4, [r5] + mov r1, r10 + strh r0, [r1] + mov r1, r8 + mov r2, r9 + strh r1, [r2] + strh r0, [r7] + ldr r2, [sp] + cmp r2, 0 + beq _0800BBD0 + bl sub_800B5F0 +_0800BBD0: + ldr r2, _0800BBF0 + ldrh r0, [r2] + ldr r1, _0800BBF4 + cmp r0, r1 + beq _0800BBE0 +_0800BBDA: + ldrh r0, [r2] + cmp r0, r1 + bne _0800BBDA +_0800BBE0: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0800BBF0: .4byte 0x04000130 +_0800BBF4: .4byte 0x000003ff +_0800BBF8: .4byte 0x04000006 +_0800BBFC: .4byte 0x00007fff +_0800BC00: .4byte 0x04000200 +_0800BC04: .4byte 0x04000132 +_0800BC08: .4byte 0x00008304 +_0800BC0C: .4byte 0x04000208 + thumb_func_end sub_800BB44 + + thumb_func_start nullsub_17 +nullsub_17: + bx lr + thumb_func_end nullsub_17 + + thumb_func_start UpdateBGControlRegisters +UpdateBGControlRegisters: + push {r4,lr} + sub sp, 0x10 + ldr r0, _0800BC2C + ldrb r0, [r0] + cmp r0, 0x1 + bne _0800BC30 + str r0, [sp] + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0 + b _0800BC3A + .align 2, 0 +_0800BC2C: .4byte gUnknown_202D7FE +_0800BC30: + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + movs r0, 0x2 +_0800BC3A: + str r0, [sp, 0x8] + movs r0, 0x3 + str r0, [sp, 0xC] + ldr r1, _0800BCA8 + ldr r2, _0800BCAC + ldrh r0, [r2, 0x4] + strh r0, [r1] + adds r1, 0x2 + ldrh r0, [r2, 0x6] + strh r0, [r1] + adds r1, 0x2 + ldr r2, _0800BCB0 + ldrh r0, [r2, 0x4] + strh r0, [r1] + adds r1, 0x2 + ldrh r0, [r2, 0x6] + strh r0, [r1] + adds r1, 0x2 + ldr r3, _0800BCB4 + ldrh r0, [r3, 0x4] + strh r0, [r1] + adds r1, 0x2 + ldrh r0, [r3, 0x6] + strh r0, [r1] + adds r1, 0x2 + ldr r2, _0800BCB8 + ldrh r0, [r2, 0x4] + strh r0, [r1] + adds r1, 0x2 + ldrh r0, [r2, 0x6] + strh r0, [r1] + ldr r2, _0800BCBC + ldr r0, [sp] + movs r4, 0xB0 + lsls r4, 6 + adds r1, r4, 0 + orrs r0, r1 + strh r0, [r2] + adds r2, 0x2 + ldr r0, [sp, 0x4] + movs r4, 0xB4 + lsls r4, 6 + adds r1, r4, 0 + orrs r0, r1 + strh r0, [r2] + ldrh r1, [r3, 0x2] + movs r0, 0x80 + lsls r0, 8 + cmp r1, r0 + bne _0800BCC8 + ldr r0, _0800BCC0 + ldr r1, [sp, 0x8] + ldr r3, _0800BCC4 + adds r2, r3, 0 + b _0800BCD2 + .align 2, 0 +_0800BCA8: .4byte 0x04000010 +_0800BCAC: .4byte gUnknown_202D698 +_0800BCB0: .4byte gUnknown_202D6A0 +_0800BCB4: .4byte gUnknown_202D6A8 +_0800BCB8: .4byte gUnknown_202D6B0 +_0800BCBC: .4byte 0x04000008 +_0800BCC0: .4byte 0x0400000c +_0800BCC4: .4byte 0x00002e08 +_0800BCC8: + ldr r0, _0800BCF4 + ldr r1, [sp, 0x8] + movs r4, 0xB8 + lsls r4, 6 + adds r2, r4, 0 +_0800BCD2: + orrs r1, r2 + strh r1, [r0] + ldr r2, _0800BCF8 + ldr r0, [sp, 0xC] + ldr r3, _0800BCFC + adds r1, r3, 0 + orrs r0, r1 + strh r0, [r2] + ldr r1, _0800BD00 + ldr r0, _0800BD04 + ldrh r0, [r0] + strh r0, [r1] + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800BCF4: .4byte 0x0400000c +_0800BCF8: .4byte 0x0400000e +_0800BCFC: .4byte 0x00002f08 +_0800BD00: .4byte 0x04000050 +_0800BD04: .4byte gUnknown_202D7FC + thumb_func_end UpdateBGControlRegisters + + thumb_func_start sub_800BD08 +sub_800BD08: + push {r4,lr} + ldr r1, _0800BDA8 + ldrh r2, [r1, 0xA] + ldr r4, _0800BDAC + adds r0, r4, 0 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + ldr r3, _0800BDB0 + adds r0, r3, 0 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + adds r1, 0xC + ldrh r2, [r1, 0xA] + adds r0, r4, 0 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + adds r0, r3, 0 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + adds r1, 0xC + ldrh r2, [r1, 0xA] + adds r0, r4, 0 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r2, [r1, 0xA] + adds r0, r3, 0 + ands r0, r2 + strh r0, [r1, 0xA] + ldrh r0, [r1, 0xA] + ldr r0, _0800BDB4 + ldrh r1, [r0, 0xA] + ands r4, r1 + strh r4, [r0, 0xA] + ldrh r1, [r0, 0xA] + ands r3, r1 + strh r3, [r0, 0xA] + ldrh r0, [r0, 0xA] + bl sub_80AEF24 + ldr r0, _0800BDB8 + movs r2, 0 + strh r2, [r0] + ldr r0, _0800BDBC + ldr r3, _0800BDC0 + adds r1, r3, 0 + strh r1, [r0] + ldr r0, _0800BDC4 + strh r1, [r0] + ldr r1, _0800BDC8 + subs r3, 0x2 + adds r0, r3, 0 + strh r0, [r1] + ldr r0, _0800BDCC + strh r2, [r0] + ldr r0, _0800BDD0 + strh r2, [r0] + ldr r0, _0800BDD4 + strb r2, [r0] + ldr r0, _0800BDD8 + movs r4, 0 + movs r2, 0 + movs r1, 0x7 +_0800BD8C: + strh r2, [r0] + strh r3, [r0, 0x2] + strh r2, [r0, 0x4] + strb r4, [r0, 0x6] + subs r1, 0x1 + adds r0, 0x8 + cmp r1, 0 + bge _0800BD8C + bl nullsub_19 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800BDA8: .4byte 0x040000b0 +_0800BDAC: .4byte 0x0000c5ff +_0800BDB0: .4byte 0x00007fff +_0800BDB4: .4byte 0x040000d4 +_0800BDB8: .4byte gUnknown_202D688 +_0800BDBC: .4byte gUnknown_202D68A +_0800BDC0: .4byte 0x000003e7 +_0800BDC4: .4byte gUnknown_202D68C +_0800BDC8: .4byte gUnknown_202D68E +_0800BDCC: .4byte gUnknown_202D690 +_0800BDD0: .4byte gUnknown_202D692 +_0800BDD4: .4byte gUnknown_202D694 +_0800BDD8: .4byte gUnknown_3000FD8 + thumb_func_end sub_800BD08 + + thumb_func_start sub_800BDDC +sub_800BDDC: + push {lr} + bl sub_800BF80 + ldr r0, _0800BDF4 + bl sub_800C298 + ldr r0, _0800BDF8 + bl sub_800C298 + pop {r0} + bx r0 + .align 2, 0 +_0800BDF4: .4byte 0x000003e6 +_0800BDF8: .4byte 0x000003e5 + thumb_func_end sub_800BDDC + + thumb_func_start sub_800BDFC +sub_800BDFC: + push {r4-r6,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r6, r4, 0 + adds r0, r4, 0 + bl sub_800CA9C + lsls r0, 24 + cmp r0, 0 + beq _0800BE78 + ldr r0, _0800BE40 + cmp r4, r0 + beq _0800BE78 + ldr r5, _0800BE44 + ldrh r0, [r5] + cmp r4, r0 + bne _0800BE2C + ldr r0, _0800BE48 + ldrh r0, [r0] + subs r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bls _0800BE78 +_0800BE2C: + adds r0, r4, 0 + bl sub_800CAE0 + lsls r0, 16 + cmp r0, 0 + beq _0800BE4C + adds r0, r4, 0 + bl nullsub_20 + b _0800BE78 + .align 2, 0 +_0800BE40: .4byte 0x000003e7 +_0800BE44: .4byte gUnknown_202D68A +_0800BE48: .4byte gUnknown_202D688 +_0800BE4C: + bl sub_800B620 + lsls r0, 24 + lsrs r4, r0, 24 + strh r6, [r5] + ldr r1, _0800BE80 + movs r0, 0x1 + strb r0, [r1] + ldr r0, _0800BE84 + ldrh r0, [r0] + cmp r0, 0 + bne _0800BE70 + ldr r1, _0800BE88 + movs r0, 0x1 + strh r0, [r1] + adds r0, r6, 0 + bl sub_80AEFA8 +_0800BE70: + cmp r4, 0 + beq _0800BE78 + bl sub_800B5F0 +_0800BE78: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0800BE80: .4byte gUnknown_202D694 +_0800BE84: .4byte gUnknown_202D690 +_0800BE88: .4byte gUnknown_202D688 + thumb_func_end sub_800BDFC + + thumb_func_start sub_800BE8C +sub_800BE8C: + push {r4-r7,lr} + lsls r0, 16 + lsrs r6, r0, 16 + lsls r4, r1, 16 + lsrs r5, r4, 16 + adds r0, r6, 0 + bl sub_800CA9C + lsls r0, 24 + cmp r0, 0 + beq _0800BF2E + ldr r0, _0800BECC + cmp r6, r0 + beq _0800BF2E + ldr r0, _0800BED0 + ldrh r0, [r0] + cmp r6, r0 + bne _0800BEBE + ldr r0, _0800BED4 + ldrh r0, [r0] + subs r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bls _0800BF2E +_0800BEBE: + movs r0, 0x80 + lsls r0, 1 + cmp r5, r0 + bls _0800BED8 + movs r5, 0x10 + b _0800BEE0 + .align 2, 0 +_0800BECC: .4byte 0x000003e7 +_0800BED0: .4byte gUnknown_202D68A +_0800BED4: .4byte gUnknown_202D688 +_0800BED8: + lsrs r5, r4, 20 + cmp r5, 0 + bne _0800BEE0 + movs r5, 0x1 +_0800BEE0: + bl sub_800B620 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r0, _0800BF34 + strh r6, [r0] + ldr r1, _0800BF38 + movs r0, 0x1 + strb r0, [r1] + ldr r0, _0800BF3C + ldrh r0, [r0] + cmp r0, 0 + bne _0800BF26 + ldr r0, _0800BF40 + movs r1, 0x1 + strh r1, [r0] + adds r0, r6, 0 + bl sub_80AEFA8 + ldr r4, _0800BF44 + adds r0, r4, 0 + bl sub_80AF198 + adds r0, r4, 0 + movs r1, 0xFF + movs r2, 0 + bl sub_80AFF50 + adds r0, r6, 0 + bl sub_80AF074 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80AF170 +_0800BF26: + cmp r7, 0 + beq _0800BF2E + bl sub_800B5F0 +_0800BF2E: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0800BF34: .4byte gUnknown_202D68A +_0800BF38: .4byte gUnknown_202D694 +_0800BF3C: .4byte gUnknown_202D690 +_0800BF40: .4byte gUnknown_202D688 +_0800BF44: .4byte gUnknown_20008F0 + thumb_func_end sub_800BE8C + + thumb_func_start sub_800BF48 +sub_800BF48: + push {r4,lr} + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, _0800BF64 + ldrh r4, [r0] + ldr r0, _0800BF68 + cmp r4, r0 + bne _0800BF70 + adds r0, r1, 0 + bl sub_800BDFC + ldr r0, _0800BF6C + strh r4, [r0] + b _0800BF74 + .align 2, 0 +_0800BF64: .4byte gUnknown_202D68A +_0800BF68: .4byte 0x000003e7 +_0800BF6C: .4byte gUnknown_202D68C +_0800BF70: + ldr r0, _0800BF7C + strh r1, [r0] +_0800BF74: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800BF7C: .4byte gUnknown_202D68C + thumb_func_end sub_800BF48 + + thumb_func_start sub_800BF80 +sub_800BF80: + push {r4,lr} + bl sub_800B620 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _0800BFBC + ldrh r0, [r0] + cmp r0, 0 + bne _0800BFA2 + ldr r0, _0800BFC0 + ldrh r1, [r0] + ldr r0, _0800BFC4 + cmp r1, r0 + beq _0800BFA2 + ldr r0, _0800BFC8 + bl sub_80AF7C0 +_0800BFA2: + ldr r0, _0800BFC0 + ldr r2, _0800BFC4 + adds r1, r2, 0 + strh r1, [r0] + ldr r0, _0800BFCC + strh r1, [r0] + cmp r4, 0 + beq _0800BFB6 + bl sub_800B5F0 +_0800BFB6: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800BFBC: .4byte gUnknown_202D690 +_0800BFC0: .4byte gUnknown_202D68A +_0800BFC4: .4byte 0x000003e7 +_0800BFC8: .4byte gUnknown_20008F0 +_0800BFCC: .4byte gUnknown_202D68C + thumb_func_end sub_800BF80 + + thumb_func_start sub_800BFD0 +sub_800BFD0: + push {r4,r5,lr} + lsls r1, r0, 16 + movs r0, 0x80 + lsls r0, 17 + cmp r1, r0 + bls _0800BFE0 + movs r4, 0x10 + b _0800BFE8 +_0800BFE0: + lsrs r4, r1, 20 + cmp r4, 0 + bne _0800BFE8 + movs r4, 0x1 +_0800BFE8: + bl sub_800B620 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _0800C018 + ldrh r0, [r0] + cmp r0, 0 + bne _0800C03C + ldr r3, _0800C01C + ldrh r0, [r3] + ldr r2, _0800C020 + cmp r0, r2 + beq _0800C044 + ldr r1, _0800C024 + ldrh r0, [r1] + cmp r0, 0x2 + bne _0800C02C + movs r0, 0x3 + strh r0, [r1] + ldr r0, _0800C028 + adds r1, r4, 0 + bl sub_80AF140 + b _0800C044 + .align 2, 0 +_0800C018: .4byte gUnknown_202D690 +_0800C01C: .4byte gUnknown_202D68A +_0800C020: .4byte 0x000003e7 +_0800C024: .4byte gUnknown_202D688 +_0800C028: .4byte gUnknown_20008F0 +_0800C02C: + strh r2, [r3] + ldr r0, _0800C038 + bl sub_80AF7C0 + b _0800C044 + .align 2, 0 +_0800C038: .4byte gUnknown_20008F0 +_0800C03C: + ldr r1, _0800C05C + ldr r2, _0800C060 + adds r0, r2, 0 + strh r0, [r1] +_0800C044: + ldr r1, _0800C064 + ldr r2, _0800C060 + adds r0, r2, 0 + strh r0, [r1] + cmp r5, 0 + beq _0800C054 + bl sub_800B5F0 +_0800C054: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0800C05C: .4byte gUnknown_202D68A +_0800C060: .4byte 0x000003e7 +_0800C064: .4byte gUnknown_202D68C + thumb_func_end sub_800BFD0 + + thumb_func_start sub_800C068 +sub_800C068: + ldr r0, _0800C070 + ldrh r0, [r0] + bx lr + .align 2, 0 +_0800C070: .4byte gUnknown_202D68A + thumb_func_end sub_800C068 + + thumb_func_start sub_800C074 +sub_800C074: + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsrs r5, r0, 16 + mov r8, r5 + lsls r1, 16 + lsrs r6, r1, 16 + ldr r0, _0800C0FC + cmp r5, r0 + bne _0800C08C + b _0800C208 +_0800C08C: + movs r7, 0x80 + lsls r7, 1 + cmp r6, r7 + bls _0800C096 + adds r6, r7, 0 +_0800C096: + adds r0, r5, 0 + bl sub_800CACC + lsls r0, 24 + cmp r0, 0 + bne _0800C0A4 + b _0800C1B0 +_0800C0A4: + adds r0, r5, 0 + bl sub_800CAE0 + lsls r0, 16 + lsrs r7, r0, 16 + cmp r7, 0x1 + beq _0800C0B4 + b _0800C1D0 +_0800C0B4: + bl sub_800B620 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r6, _0800C100 + strh r5, [r6] + ldr r4, _0800C104 + ldrh r0, [r4] + adds r2, r0, 0 + cmp r2, 0 + bne _0800C144 + ldr r0, _0800C108 + ldrh r1, [r0] + ldr r0, _0800C10C + cmp r1, r0 + beq _0800C12C + ldr r0, _0800C110 + ldrh r1, [r0] + subs r0, r1, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _0800C120 + strh r7, [r4] + ldr r1, _0800C114 + movs r0, 0x10 + strh r0, [r1] + ldr r0, _0800C118 + strb r2, [r0] + ldr r0, _0800C11C + movs r1, 0x1 + bl sub_80AF150 + b _0800C15E + .align 2, 0 +_0800C0FC: .4byte 0x000003e5 +_0800C100: .4byte gUnknown_202D68E +_0800C104: .4byte gUnknown_202D690 +_0800C108: .4byte gUnknown_202D68A +_0800C10C: .4byte 0x000003e7 +_0800C110: .4byte gUnknown_202D688 +_0800C114: .4byte gUnknown_202D692 +_0800C118: .4byte gUnknown_202D694 +_0800C11C: .4byte gUnknown_20008F0 +_0800C120: + lsls r0, r1, 16 + lsrs r0, 16 + cmp r0, 0x3 + bne _0800C12C + movs r0, 0x2 + b _0800C15C +_0800C12C: + movs r0, 0x3 + strh r0, [r4] + ldr r0, _0800C140 + bl sub_80AF7C0 + ldrh r0, [r6] + bl sub_80AEFA8 + b _0800C15E + .align 2, 0 +_0800C140: .4byte gUnknown_20008F0 +_0800C144: + subs r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bls _0800C15E + ldr r0, _0800C17C + bl sub_80AF7C0 + ldrh r0, [r6] + bl sub_80AEFA8 + movs r0, 0x3 +_0800C15C: + strh r0, [r4] +_0800C15E: + ldr r0, _0800C180 + ldrh r0, [r0] + cmp r0, 0x26 + bgt _0800C184 + cmp r0, 0x25 + bge _0800C19A + cmp r0, 0x1A + blt _0800C1A0 + cmp r0, 0x1F + ble _0800C19A + cmp r0, 0x23 + bgt _0800C1A0 + cmp r0, 0x22 + blt _0800C1A0 + b _0800C19A + .align 2, 0 +_0800C17C: .4byte gUnknown_20008F0 +_0800C180: .4byte gUnknown_202D68A +_0800C184: + cmp r0, 0x7A + beq _0800C19A + cmp r0, 0x7A + bgt _0800C196 + cmp r0, 0x77 + bgt _0800C1A0 + cmp r0, 0x75 + blt _0800C1A0 + b _0800C19A +_0800C196: + cmp r0, 0x7F + bne _0800C1A0 +_0800C19A: + ldr r1, _0800C1AC + movs r0, 0x1 + strb r0, [r1] +_0800C1A0: + mov r0, r8 + cmp r0, 0 + beq _0800C208 + bl sub_800B5F0 + b _0800C208 + .align 2, 0 +_0800C1AC: .4byte gUnknown_202D694 +_0800C1B0: + adds r0, r5, 0 + bl sub_800CAAC + lsls r0, 24 + cmp r0, 0 + beq _0800C208 + adds r0, r5, 0 + bl sub_800CAE0 + lsls r0, 16 + lsrs r0, 16 + lsls r2, r0, 3 + ldr r1, _0800C1D8 + adds r4, r2, r1 + cmp r0, 0x1 + bhi _0800C1DC +_0800C1D0: + adds r0, r5, 0 + bl nullsub_20 + b _0800C208 + .align 2, 0 +_0800C1D8: .4byte gUnknown_3000FD8 +_0800C1DC: + bl sub_800B620 + lsls r0, 24 + lsrs r5, r0, 24 + mov r0, r8 + bl sub_80AEFA8 + movs r0, 0x1 + strh r0, [r4] + mov r0, r8 + strh r0, [r4, 0x2] + cmp r6, r7 + bne _0800C1FA + movs r0, 0 + b _0800C1FC +_0800C1FA: + movs r0, 0x1 +_0800C1FC: + strb r0, [r4, 0x6] + strh r6, [r4, 0x4] + cmp r5, 0 + beq _0800C208 + bl sub_800B5F0 +_0800C208: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_800C074 + + thumb_func_start sub_800C214 +sub_800C214: + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 16 + lsrs r7, r1, 16 + movs r0, 0x80 + lsls r0, 1 + cmp r7, r0 + bls _0800C22C + adds r7, r0, 0 +_0800C22C: + adds r0, r5, 0 + bl sub_800CACC + lsls r0, 24 + cmp r0, 0 + bne _0800C286 + adds r0, r5, 0 + bl sub_800CAAC + lsls r0, 24 + cmp r0, 0 + beq _0800C286 + adds r0, r5, 0 + bl sub_800CAE0 + lsls r0, 16 + lsrs r0, 16 + ldr r2, _0800C290 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + mov r8, r1 + lsls r2, r0, 3 + ldr r1, _0800C294 + adds r4, r2, r1 + cmp r0, 0x1 + bls _0800C286 + bl sub_800B620 + lsls r0, 24 + lsrs r6, r0, 24 + ldrh r0, [r4, 0x2] + cmp r0, r5 + bne _0800C27E + mov r0, r8 + movs r1, 0xF + adds r2, r7, 0 + bl sub_80AFF50 +_0800C27E: + cmp r6, 0 + beq _0800C286 + bl sub_800B5F0 +_0800C286: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0800C290: .4byte 0x09e8665c +_0800C294: .4byte gUnknown_3000FD8 + thumb_func_end sub_800C214 + + thumb_func_start sub_800C298 +sub_800C298: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, _0800C2F0 + mov r8, r0 + cmp r5, r8 + bne _0800C2FC + bl sub_800B620 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r4, _0800C2F4 + ldr r0, _0800C2F8 + movs r1, 0 + mov r10, r1 + movs r7, 0 + adds r6, r0, 0 + adds r6, 0x18 + movs r5, 0x4 +_0800C2C8: + ldr r0, [r6] + bl sub_80AF7C0 + strh r7, [r4] + mov r2, r8 + strh r2, [r4, 0x2] + strh r7, [r4, 0x4] + mov r0, r10 + strb r0, [r4, 0x6] + adds r6, 0xC + subs r5, 0x1 + adds r4, 0x8 + cmp r5, 0 + bge _0800C2C8 + mov r1, r9 + cmp r1, 0 + beq _0800C3DE + bl sub_800B5F0 + b _0800C3DE + .align 2, 0 +_0800C2F0: .4byte 0x000003e5 +_0800C2F4: .4byte gUnknown_3000FE8 +_0800C2F8: .4byte 0x09e8665c +_0800C2FC: + adds r0, r5, 0 + bl sub_800CAAC + lsls r0, 24 + cmp r0, 0 + beq _0800C364 + adds r0, r5, 0 + bl sub_800CAE0 + lsls r0, 16 + lsrs r0, 16 + ldr r2, _0800C330 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldr r7, [r1] + lsls r2, r0, 3 + ldr r1, _0800C334 + adds r4, r2, r1 + cmp r0, 0x1 + bhi _0800C338 + adds r0, r5, 0 + bl nullsub_21 + b _0800C3DE + .align 2, 0 +_0800C330: .4byte 0x09e8665c +_0800C334: .4byte gUnknown_3000FD8 +_0800C338: + bl sub_800B620 + lsls r0, 24 + lsrs r6, r0, 24 + ldrh r0, [r4, 0x2] + cmp r0, r5 + bne _0800C35A + adds r0, r7, 0 + bl sub_80AF7C0 + movs r1, 0 + movs r0, 0 + strh r0, [r4] + mov r2, r8 + strh r2, [r4, 0x2] + strh r0, [r4, 0x4] + strb r1, [r4, 0x6] +_0800C35A: + cmp r6, 0 + beq _0800C3DE + bl sub_800B5F0 + b _0800C3DE +_0800C364: + ldr r0, _0800C398 + cmp r5, r0 + bne _0800C3A8 + bl sub_800B620 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _0800C39C + ldrh r0, [r0] + cmp r0, 0 + beq _0800C38C + ldr r1, _0800C3A0 + ldrh r0, [r1] + cmp r0, r8 + beq _0800C38C + mov r0, r8 + strh r0, [r1] + ldr r0, _0800C3A4 + bl sub_80AF7C0 +_0800C38C: + cmp r4, 0 + beq _0800C3DE + bl sub_800B5F0 + b _0800C3DE + .align 2, 0 +_0800C398: .4byte 0x000003e6 +_0800C39C: .4byte gUnknown_202D690 +_0800C3A0: .4byte gUnknown_202D68E +_0800C3A4: .4byte gUnknown_2000970 +_0800C3A8: + adds r0, r5, 0 + bl sub_800CACC + lsls r0, 24 + cmp r0, 0 + beq _0800C3DE + bl sub_800B620 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, _0800C3EC + ldrh r0, [r0] + cmp r0, 0 + beq _0800C3D6 + ldr r1, _0800C3F0 + ldrh r0, [r1] + cmp r0, r5 + bne _0800C3D6 + mov r2, r8 + strh r2, [r1] + ldr r0, _0800C3F4 + bl sub_80AF7C0 +_0800C3D6: + cmp r4, 0 + beq _0800C3DE + bl sub_800B5F0 +_0800C3DE: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0800C3EC: .4byte gUnknown_202D690 +_0800C3F0: .4byte gUnknown_202D68E +_0800C3F4: .4byte gUnknown_2000970 + thumb_func_end sub_800C298 + + thumb_func_start sub_800C3F8 +sub_800C3F8: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 16 + movs r0, 0x80 + lsls r0, 17 + cmp r1, r0 + bls _0800C416 + movs r0, 0x10 + mov r9, r0 + b _0800C422 +_0800C416: + lsrs r1, 20 + mov r9, r1 + cmp r1, 0 + bne _0800C422 + movs r1, 0x1 + mov r9, r1 +_0800C422: + ldr r0, _0800C460 + mov r8, r0 + cmp r4, r8 + bne _0800C496 + bl sub_800B620 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + movs r7, 0x2 + ldr r5, _0800C464 + ldr r0, _0800C468 + adds r6, r0, 0 + adds r6, 0x18 +_0800C43E: + ldrh r0, [r5, 0x2] + cmp r0, r8 + beq _0800C47E + lsls r0, r7, 16 + lsrs r0, 16 + bl sub_800CAF0 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _0800C46C + ldr r0, [r6] + mov r1, r9 + bl sub_80AF140 + b _0800C47E + .align 2, 0 +_0800C460: .4byte 0x000003e5 +_0800C464: .4byte gUnknown_3000FE8 +_0800C468: .4byte 0x09e8665c +_0800C46C: + ldr r0, [r6] + bl sub_80AF7C0 + strh r4, [r5] + mov r1, r8 + strh r1, [r5, 0x2] + strh r4, [r5, 0x4] + movs r0, 0 + strb r0, [r5, 0x6] +_0800C47E: + adds r6, 0xC + adds r7, 0x1 + adds r5, 0x8 + cmp r7, 0x6 + ble _0800C43E + mov r1, r10 + cmp r1, 0 + bne _0800C490 + b _0800C5BE +_0800C490: + bl sub_800B5F0 + b _0800C5BE +_0800C496: + adds r0, r4, 0 + bl sub_800CAAC + lsls r0, 24 + cmp r0, 0 + beq _0800C508 + adds r0, r4, 0 + bl sub_800CAE0 + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, r4, 3 + ldr r0, _0800C4E4 + adds r5, r1, r0 + ldr r1, _0800C4E8 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r0, r1 + ldr r6, [r0] + bl sub_800B620 + lsls r0, 24 + lsrs r7, r0, 24 + ldrh r0, [r5, 0x2] + cmp r0, r8 + beq _0800C4FE + adds r0, r4, 0 + bl sub_800CAF0 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _0800C4EC + adds r0, r6, 0 + mov r1, r9 + bl sub_80AF140 + b _0800C4FE + .align 2, 0 +_0800C4E4: .4byte gUnknown_3000FD8 +_0800C4E8: .4byte 0x09e8665c +_0800C4EC: + adds r0, r6, 0 + bl sub_80AF7C0 + movs r0, 0 + strh r4, [r5] + mov r1, r8 + strh r1, [r5, 0x2] + strh r4, [r5, 0x4] + strb r0, [r5, 0x6] +_0800C4FE: + cmp r7, 0 + beq _0800C5BE + bl sub_800B5F0 + b _0800C5BE +_0800C508: + ldr r0, _0800C53C + cmp r4, r0 + bne _0800C564 + bl sub_800B620 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _0800C540 + ldrh r0, [r0] + cmp r0, 0 + beq _0800C556 + ldr r4, _0800C544 + ldrh r0, [r4] + cmp r0, r8 + beq _0800C556 + movs r0, 0x1 + bl sub_800CAF0 + lsls r0, 24 + cmp r0, 0 + beq _0800C54C + ldr r0, _0800C548 + mov r1, r9 + bl sub_80AF140 + b _0800C556 + .align 2, 0 +_0800C53C: .4byte 0x000003e6 +_0800C540: .4byte gUnknown_202D690 +_0800C544: .4byte gUnknown_202D68E +_0800C548: .4byte gUnknown_2000970 +_0800C54C: + ldr r0, _0800C560 + bl sub_80AF7C0 + mov r0, r8 + strh r0, [r4] +_0800C556: + cmp r5, 0 + beq _0800C5BE + bl sub_800B5F0 + b _0800C5BE + .align 2, 0 +_0800C560: .4byte gUnknown_2000970 +_0800C564: + adds r0, r4, 0 + bl sub_800CACC + lsls r0, 24 + cmp r0, 0 + beq _0800C5BE + bl sub_800B620 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r0, _0800C5A0 + ldrh r0, [r0] + cmp r0, 0 + beq _0800C5B6 + ldr r5, _0800C5A4 + ldrh r0, [r5] + cmp r0, r4 + bne _0800C5B6 + movs r0, 0x1 + bl sub_800CAF0 + lsls r0, 24 + cmp r0, 0 + beq _0800C5AC + ldr r0, _0800C5A8 + mov r1, r9 + bl sub_80AF140 + b _0800C5B6 + .align 2, 0 +_0800C5A0: .4byte gUnknown_202D690 +_0800C5A4: .4byte gUnknown_202D68E +_0800C5A8: .4byte gUnknown_2000970 +_0800C5AC: + ldr r0, _0800C5CC + bl sub_80AF7C0 + mov r1, r8 + strh r1, [r5] +_0800C5B6: + cmp r6, 0 + beq _0800C5BE + bl sub_800B5F0 +_0800C5BE: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0800C5CC: .4byte gUnknown_2000970 + thumb_func_end sub_800C3F8 + + thumb_func_start sub_800C5D0 +sub_800C5D0: + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + adds r0, r4, 0 + bl sub_800CACC + lsls r0, 24 + cmp r0, 0 + beq _0800C600 + ldr r0, _0800C5F8 + ldrh r0, [r0] + cmp r0, 0 + beq _0800C630 + ldr r0, _0800C5FC + ldrh r0, [r0] + cmp r0, r4 + bne _0800C630 + movs r0, 0x1 + b _0800C632 + .align 2, 0 +_0800C5F8: .4byte gUnknown_202D690 +_0800C5FC: .4byte gUnknown_202D68E +_0800C600: + adds r0, r4, 0 + bl sub_800CAAC + lsls r0, 24 + cmp r0, 0 + beq _0800C630 + adds r0, r4, 0 + bl sub_800CAE0 + lsls r0, 16 + lsrs r0, 16 + lsls r2, r0, 3 + ldr r1, _0800C62C + adds r2, r1 + cmp r0, 0x1 + bls _0800C630 + ldrh r0, [r2, 0x2] + cmp r0, r5 + bne _0800C630 + movs r0, 0x1 + b _0800C632 + .align 2, 0 +_0800C62C: .4byte gUnknown_3000FD8 +_0800C630: + movs r0, 0 +_0800C632: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_800C5D0 + + thumb_func_start SoundVSync +SoundVSync: + push {r4,lr} + bl sub_800B620 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl m4aSoundVSync + cmp r4, 0 + beq _0800C650 + bl sub_800B5F0 +_0800C650: + pop {r4} + pop {r0} + bx r0 + thumb_func_end SoundVSync + + thumb_func_start nullsub_18 +nullsub_18: + bx lr + thumb_func_end nullsub_18 + + thumb_func_start UpdateSound +UpdateSound: + push {r4-r7,lr} + mov r7, r8 + push {r7} + bl m4aSoundMain + ldr r4, _0800C680 + ldrh r0, [r4] + cmp r0, 0 + bne _0800C670 + b _0800C7E0 +_0800C670: + cmp r0, 0x2 + beq _0800C6C0 + cmp r0, 0x2 + bgt _0800C684 + cmp r0, 0x1 + beq _0800C68E + b _0800C8A2 + .align 2, 0 +_0800C680: .4byte gUnknown_202D690 +_0800C684: + cmp r0, 0x3 + beq _0800C700 + cmp r0, 0x4 + beq _0800C730 + b _0800C8A2 +_0800C68E: + ldr r2, _0800C69C + ldrh r0, [r2] + cmp r0, 0 + beq _0800C6A0 + subs r0, 0x1 + strh r0, [r2] + b _0800C8A2 + .align 2, 0 +_0800C69C: .4byte gUnknown_202D692 +_0800C6A0: + ldr r3, _0800C6B4 + ldrh r1, [r3] + ldr r0, _0800C6B8 + cmp r1, r0 + bne _0800C6BC + movs r0, 0x4 + strh r0, [r4] + movs r0, 0x20 + strh r0, [r2] + b _0800C8A2 + .align 2, 0 +_0800C6B4: .4byte gUnknown_202D68E +_0800C6B8: .4byte 0x000003e5 +_0800C6BC: + ldrh r0, [r3] + b _0800C6E4 +_0800C6C0: + ldr r0, _0800C6F0 + ldrh r1, [r0] + ldr r0, _0800C6F4 + cmp r1, r0 + beq _0800C6D8 + movs r0, 0 + bl sub_800CAF0 + lsls r0, 24 + cmp r0, 0 + beq _0800C6D8 + b _0800C8A2 +_0800C6D8: + ldr r2, _0800C6F8 + ldrh r1, [r2] + ldr r0, _0800C6FC + cmp r1, r0 + beq _0800C718 + ldrh r0, [r2] +_0800C6E4: + bl sub_80AEFA8 + movs r0, 0x3 + strh r0, [r4] + b _0800C8A2 + .align 2, 0 +_0800C6F0: .4byte gUnknown_202D68A +_0800C6F4: .4byte 0x000003e7 +_0800C6F8: .4byte gUnknown_202D68E +_0800C6FC: .4byte 0x000003e5 +_0800C700: + ldr r0, _0800C724 + ldrh r1, [r0] + ldr r0, _0800C728 + cmp r1, r0 + beq _0800C718 + movs r0, 0x1 + bl sub_800CAF0 + lsls r0, 24 + cmp r0, 0 + bne _0800C718 + b _0800C8A2 +_0800C718: + movs r0, 0x4 + strh r0, [r4] + ldr r1, _0800C72C + movs r0, 0x20 + strh r0, [r1] + b _0800C8A2 + .align 2, 0 +_0800C724: .4byte gUnknown_202D68E +_0800C728: .4byte 0x000003e5 +_0800C72C: .4byte gUnknown_202D692 +_0800C730: + ldr r0, _0800C74C + ldrh r1, [r0] + ldr r0, _0800C750 + cmp r1, r0 + beq _0800C754 + movs r0, 0x1 + bl sub_800CAF0 + lsls r0, 24 + cmp r0, 0 + beq _0800C748 + b _0800C8A2 +_0800C748: + b _0800C75A + .align 2, 0 +_0800C74C: .4byte gUnknown_202D68E +_0800C750: .4byte 0x000003e5 +_0800C754: + ldr r0, _0800C76C + bl sub_80AF7C0 +_0800C75A: + ldr r1, _0800C770 + ldrh r0, [r1] + adds r2, r0, 0 + cmp r2, 0 + beq _0800C774 + subs r0, 0x1 + strh r0, [r1] + b _0800C8A2 + .align 2, 0 +_0800C76C: .4byte gUnknown_2000970 +_0800C770: .4byte gUnknown_202D692 +_0800C774: + ldr r3, _0800C794 + ldrh r1, [r3] + ldr r0, _0800C798 + cmp r1, r0 + beq _0800C7B4 + ldr r1, _0800C79C + movs r0, 0x1 + strh r0, [r1] + ldr r0, _0800C7A0 + ldrb r0, [r0] + cmp r0, 0 + beq _0800C7A4 + ldrh r0, [r3] + bl sub_80AEFA8 + b _0800C7BE + .align 2, 0 +_0800C794: .4byte gUnknown_202D68A +_0800C798: .4byte 0x000003e7 +_0800C79C: .4byte gUnknown_202D688 +_0800C7A0: .4byte gUnknown_202D694 +_0800C7A4: + ldr r0, _0800C7B0 + movs r1, 0x4 + bl sub_80AF170 + b _0800C7BE + .align 2, 0 +_0800C7B0: .4byte gUnknown_20008F0 +_0800C7B4: + ldr r0, _0800C7CC + strh r2, [r0] + ldr r0, _0800C7D0 + bl sub_80AF7C0 +_0800C7BE: + ldr r1, _0800C7D4 + movs r0, 0 + strh r0, [r1] + ldr r1, _0800C7D8 + ldr r2, _0800C7DC + b _0800C84C + .align 2, 0 +_0800C7CC: .4byte gUnknown_202D688 +_0800C7D0: .4byte gUnknown_20008F0 +_0800C7D4: .4byte gUnknown_202D690 +_0800C7D8: .4byte gUnknown_202D68E +_0800C7DC: .4byte 0x000003e5 +_0800C7E0: + ldr r5, _0800C810 + ldrh r0, [r5] + cmp r0, 0 + beq _0800C864 + cmp r0, 0x3 + bgt _0800C8A2 + cmp r0, 0x2 + bge _0800C81C + cmp r0, 0x1 + bne _0800C8A2 + ldr r0, _0800C814 + ldrh r1, [r0] + ldr r0, _0800C818 + cmp r1, r0 + beq _0800C80A + movs r0, 0 + bl sub_800CAF0 + lsls r0, 24 + cmp r0, 0 + beq _0800C8A2 +_0800C80A: + movs r0, 0x2 + strh r0, [r5] + b _0800C8A2 + .align 2, 0 +_0800C810: .4byte gUnknown_202D688 +_0800C814: .4byte gUnknown_202D68A +_0800C818: .4byte 0x000003e7 +_0800C81C: + ldr r0, _0800C834 + ldrh r1, [r0] + ldr r0, _0800C838 + cmp r1, r0 + beq _0800C83C + movs r0, 0 + bl sub_800CAF0 + lsls r0, 24 + cmp r0, 0 + bne _0800C8A2 + b _0800C842 + .align 2, 0 +_0800C834: .4byte gUnknown_202D68A +_0800C838: .4byte 0x000003e7 +_0800C83C: + ldr r0, _0800C854 + bl sub_80AF7C0 +_0800C842: + ldr r1, _0800C858 + movs r0, 0 + strh r0, [r1] + ldr r1, _0800C85C + ldr r2, _0800C860 +_0800C84C: + adds r0, r2, 0 + strh r0, [r1] + b _0800C8A2 + .align 2, 0 +_0800C854: .4byte gUnknown_20008F0 +_0800C858: .4byte gUnknown_202D688 +_0800C85C: .4byte gUnknown_202D68A +_0800C860: .4byte 0x000003e7 +_0800C864: + movs r0, 0 + bl sub_800CAF0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0800C8A2 + ldr r6, _0800C890 + ldrh r2, [r6] + adds r1, r2, 0 + ldr r4, _0800C894 + cmp r1, r4 + beq _0800C89C + movs r0, 0x1 + strh r0, [r5] + ldr r0, _0800C898 + strh r2, [r0] + adds r0, r1, 0 + bl sub_80AEFA8 + strh r4, [r6] + b _0800C8A2 + .align 2, 0 +_0800C890: .4byte gUnknown_202D68C +_0800C894: .4byte 0x000003e7 +_0800C898: .4byte gUnknown_202D68A +_0800C89C: + strh r0, [r5] + ldr r0, _0800C8C4 + strh r1, [r0] +_0800C8A2: + movs r5, 0x2 + ldr r4, _0800C8C8 + ldr r0, _0800C8CC + mov r8, r0 + movs r6, 0x18 + movs r7, 0 +_0800C8AE: + ldrh r1, [r4, 0x2] + cmp r1, r8 + beq _0800C926 + ldrh r0, [r4] + cmp r0, 0x1 + beq _0800C8D0 + cmp r0, 0x1 + ble _0800C926 + cmp r0, 0x2 + beq _0800C8F0 + b _0800C926 + .align 2, 0 +_0800C8C4: .4byte gUnknown_202D68A +_0800C8C8: .4byte gUnknown_3000FE8 +_0800C8CC: .4byte 0x000003e5 +_0800C8D0: + ldr r0, _0800C8EC + cmp r1, r0 + beq _0800C8E4 + lsls r0, r5, 16 + lsrs r0, 16 + bl sub_800CAF0 + lsls r0, 24 + cmp r0, 0 + beq _0800C926 +_0800C8E4: + movs r0, 0x2 + strh r0, [r4] + b _0800C926 + .align 2, 0 +_0800C8EC: .4byte 0x000003e7 +_0800C8F0: + lsls r0, r5, 16 + lsrs r0, 16 + bl sub_800CAF0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _0800C91C + ldrb r0, [r4, 0x6] + cmp r0, 0 + beq _0800C926 + strb r7, [r4, 0x6] + ldr r0, _0800C918 + adds r0, r6, r0 + ldr r0, [r0] + ldrh r2, [r4, 0x4] + movs r1, 0xFF + bl sub_80AFF50 + b _0800C926 + .align 2, 0 +_0800C918: .4byte 0x09e8665c +_0800C91C: + strh r0, [r4] + mov r1, r8 + strh r1, [r4, 0x2] + strh r0, [r4, 0x4] + strb r7, [r4, 0x6] +_0800C926: + adds r6, 0xC + adds r5, 0x1 + adds r4, 0x8 + cmp r5, 0x6 + ble _0800C8AE + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end UpdateSound + + thumb_func_start sub_800C93C +sub_800C93C: + push {r4,r5,lr} + ldr r0, _0800C984 + movs r1, 0x10 + bl sub_800C3F8 + ldr r0, _0800C988 + movs r1, 0x10 + bl sub_800C3F8 + bl sub_800B620 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _0800C98C + ldrh r3, [r0] + cmp r3, 0 + bne _0800C9AC + ldr r0, _0800C990 + ldrh r1, [r0] + ldr r0, _0800C994 + cmp r1, r0 + beq _0800C9AC + ldr r1, _0800C998 + ldrh r2, [r1] + subs r0, r2, 0x1 + lsls r0, 16 + lsrs r0, 16 + adds r4, r1, 0 + cmp r0, 0x1 + bhi _0800C9AC + adds r1, r2, 0 + cmp r1, 0x2 + bne _0800C9A0 + ldr r0, _0800C99C + strb r3, [r0] + b _0800C9A8 + .align 2, 0 +_0800C984: .4byte 0x000003e5 +_0800C988: .4byte 0x000003e6 +_0800C98C: .4byte gUnknown_202D690 +_0800C990: .4byte gUnknown_202D68A +_0800C994: .4byte 0x000003e7 +_0800C998: .4byte gUnknown_202D688 +_0800C99C: .4byte gUnknown_202D694 +_0800C9A0: + cmp r1, 0x1 + bne _0800C9A8 + ldr r0, _0800C9C4 + strb r1, [r0] +_0800C9A8: + movs r0, 0x4 + strh r0, [r4] +_0800C9AC: + ldr r0, _0800C9C8 + bl sub_80AF7C0 + bl sub_80AF5AC + cmp r5, 0 + beq _0800C9BE + bl sub_800B5F0 +_0800C9BE: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0800C9C4: .4byte gUnknown_202D694 +_0800C9C8: .4byte gUnknown_20008F0 + thumb_func_end sub_800C93C + + thumb_func_start sub_800C9CC +sub_800C9CC: + push {r4,lr} + bl sub_800B620 + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_80AF628 + ldr r0, _0800CA08 + ldrh r0, [r0] + cmp r0, 0 + bne _0800CA22 + ldr r2, _0800CA0C + ldrh r1, [r2] + ldr r0, _0800CA10 + cmp r1, r0 + beq _0800CA22 + ldr r1, _0800CA14 + ldrh r0, [r1] + cmp r0, 0x4 + bne _0800CA22 + movs r0, 0x1 + strh r0, [r1] + ldr r0, _0800CA18 + ldrb r0, [r0] + cmp r0, 0 + beq _0800CA1C + ldrh r0, [r2] + bl sub_80AEFA8 + b _0800CA22 + .align 2, 0 +_0800CA08: .4byte gUnknown_202D690 +_0800CA0C: .4byte gUnknown_202D68A +_0800CA10: .4byte 0x000003e7 +_0800CA14: .4byte gUnknown_202D688 +_0800CA18: .4byte gUnknown_202D694 +_0800CA1C: + ldr r0, _0800CA30 + bl sub_80AF108 +_0800CA22: + cmp r4, 0 + beq _0800CA2A + bl sub_800B5F0 +_0800CA2A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800CA30: .4byte gUnknown_20008F0 + thumb_func_end sub_800C9CC + + thumb_func_start nullsub_179 +nullsub_179: + bx lr + thumb_func_end nullsub_179 + + thumb_func_start sub_800CA38 +sub_800CA38: + push {r4,lr} + adds r4, r0, 0 + bl sub_800CA9C + lsls r0, 24 + cmp r0, 0 + beq _0800CA54 + lsls r0, r4, 16 + lsrs r0, 16 + bl sub_800CAE0 + lsls r0, 16 + cmp r0, 0 + beq _0800CA70 +_0800CA54: + adds r0, r4, 0 + bl sub_800CACC + lsls r0, 24 + cmp r0, 0 + beq _0800CA74 + lsls r0, r4, 16 + lsrs r0, 16 + bl sub_800CAE0 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bne _0800CA90 +_0800CA70: + movs r0, 0x1 + b _0800CA92 +_0800CA74: + adds r0, r4, 0 + bl sub_800CAAC + lsls r0, 24 + cmp r0, 0 + beq _0800CA90 + lsls r0, r4, 16 + lsrs r0, 16 + bl sub_800CAE0 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _0800CA70 +_0800CA90: + movs r0, 0 +_0800CA92: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_800CA38 + + thumb_func_start nullsub_19 +nullsub_19: + bx lr + thumb_func_end nullsub_19 + + thumb_func_start sub_800CA9C +sub_800CA9C: + push {lr} + cmp r0, 0x80 + bls _0800CAA6 + movs r0, 0 + b _0800CAA8 +_0800CAA6: + movs r0, 0x1 +_0800CAA8: + pop {r1} + bx r1 + thumb_func_end sub_800CA9C + + thumb_func_start sub_800CAAC +sub_800CAAC: + push {lr} + ldr r1, _0800CABC + adds r0, r1 + ldr r1, _0800CAC0 + cmp r0, r1 + bls _0800CAC4 + movs r0, 0 + b _0800CAC6 + .align 2, 0 +_0800CABC: .4byte 0xfffffed4 +_0800CAC0: .4byte 0x0000027f +_0800CAC4: + movs r0, 0x1 +_0800CAC6: + pop {r1} + bx r1 + thumb_func_end sub_800CAAC + + thumb_func_start sub_800CACC +sub_800CACC: + push {lr} + subs r0, 0xC8 + cmp r0, 0x13 + bls _0800CAD8 + movs r0, 0 + b _0800CADA +_0800CAD8: + movs r0, 0x1 +_0800CADA: + pop {r1} + bx r1 + thumb_func_end sub_800CACC + + thumb_func_start sub_800CAE0 +sub_800CAE0: + lsls r0, 16 + ldr r1, _0800CAEC + lsrs r0, 13 + adds r0, r1 + ldrh r0, [r0, 0x4] + bx lr + .align 2, 0 +_0800CAEC: .4byte 0x09e866bc + thumb_func_end sub_800CAE0 + + thumb_func_start sub_800CAF0 +sub_800CAF0: + push {lr} + lsls r0, 16 + lsrs r0, 16 + ldr r2, _0800CB0C + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldr r0, [r1] + ldrh r0, [r0, 0x4] + cmp r0, 0 + beq _0800CB10 + movs r0, 0x1 + b _0800CB12 + .align 2, 0 +_0800CB0C: .4byte 0x09e8665c +_0800CB10: + movs r0, 0 +_0800CB12: + pop {r1} + bx r1 + thumb_func_end sub_800CAF0 + + thumb_func_start nullsub_20 +nullsub_20: + bx lr + thumb_func_end nullsub_20 + + thumb_func_start nullsub_21 +nullsub_21: + bx lr + thumb_func_end nullsub_21 + + thumb_func_start sub_800CB20 +sub_800CB20: + push {lr} + bl sub_800BA5C + ldr r1, _0800CB48 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r0, _0800CB4C + ldrh r1, [r0] + movs r0, 0x5 + ands r0, r1 + cmp r0, 0 + beq _0800CB3E + bl Random +_0800CB3E: + bl Random + pop {r0} + bx r0 + .align 2, 0 +_0800CB48: .4byte gUnknown_203B0B8 +_0800CB4C: .4byte gUnknown_203B0BC + thumb_func_end sub_800CB20 + + thumb_func_start sub_800CB50 +sub_800CB50: + ldr r0, _0800CB58 + ldr r0, [r0] + bx lr + .align 2, 0 +_0800CB58: .4byte gUnknown_203B0B8 + thumb_func_end sub_800CB50 + + thumb_func_start nullsub_180 +nullsub_180: + bx lr + thumb_func_end nullsub_180 + + thumb_func_start xxx_call_update_bg_sound_input +xxx_call_update_bg_sound_input: + push {lr} + bl xxx_update_bg_sound_input + pop {r0} + bx r0 + thumb_func_end xxx_call_update_bg_sound_input + + thumb_func_start nullsub_181 +nullsub_181: + bx lr + thumb_func_end nullsub_181 + + thumb_func_start sub_800CB70 +sub_800CB70: + movs r0, 0 + bx lr + thumb_func_end sub_800CB70 + + thumb_func_start ReadKeyInput +ReadKeyInput: + push {r4,lr} + adds r2, r0, 0 + ldr r0, _0800CC38 + ldrh r1, [r0] + ldr r3, _0800CC3C + adds r0, r3, 0 + adds r3, r0, 0 + eors r3, r1 + movs r0, 0 + strh r0, [r2] + movs r1, 0x40 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _0800CB94 + strh r1, [r2] +_0800CB94: + movs r0, 0x80 + ands r0, r3 + cmp r0, 0 + beq _0800CBA4 + ldrh r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strh r0, [r2] +_0800CBA4: + movs r0, 0x20 + ands r0, r3 + cmp r0, 0 + beq _0800CBB4 + ldrh r0, [r2] + movs r1, 0x20 + orrs r0, r1 + strh r0, [r2] +_0800CBB4: + movs r0, 0x10 + ands r0, r3 + cmp r0, 0 + beq _0800CBC4 + ldrh r0, [r2] + movs r1, 0x10 + orrs r0, r1 + strh r0, [r2] +_0800CBC4: + movs r0, 0x1 + ands r0, r3 + cmp r0, 0 + beq _0800CBD4 + ldrh r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r2] +_0800CBD4: + movs r0, 0x2 + ands r0, r3 + cmp r0, 0 + beq _0800CBE4 + ldrh r0, [r2] + movs r1, 0x2 + orrs r0, r1 + strh r0, [r2] +_0800CBE4: + movs r0, 0x8 + ands r0, r3 + cmp r0, 0 + beq _0800CBF4 + ldrh r0, [r2] + movs r1, 0x8 + orrs r0, r1 + strh r0, [r2] +_0800CBF4: + movs r0, 0x4 + ands r0, r3 + cmp r0, 0 + beq _0800CC04 + ldrh r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strh r0, [r2] +_0800CC04: + movs r4, 0x80 + lsls r4, 1 + adds r0, r3, 0 + ands r0, r4 + cmp r0, 0 + beq _0800CC18 + ldrh r1, [r2] + adds r0, r4, 0 + orrs r0, r1 + strh r0, [r2] +_0800CC18: + movs r4, 0x80 + lsls r4, 2 + adds r0, r3, 0 + ands r0, r4 + cmp r0, 0 + beq _0800CC2C + ldrh r1, [r2] + adds r0, r4, 0 + orrs r0, r1 + strh r0, [r2] +_0800CC2C: + ldr r0, _0800CC40 + strh r3, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800CC38: .4byte 0x04000130 +_0800CC3C: .4byte 0x000003ff +_0800CC40: .4byte gUnknown_203B0BC + thumb_func_end ReadKeyInput + + thumb_func_start sub_800CC44 +sub_800CC44: + push {lr} + adds r2, r1, 0 + cmp r0, 0 + bge _0800CC50 + movs r0, 0 + b _0800CC56 +_0800CC50: + cmp r0, 0x10 + ble _0800CC56 + movs r0, 0x10 +_0800CC56: + cmp r2, 0 + bge _0800CC5E + movs r2, 0 + b _0800CC64 +_0800CC5E: + cmp r2, 0x10 + ble _0800CC64 + movs r2, 0x10 +_0800CC64: + ldr r1, _0800CC7C + strb r0, [r1] + ldr r0, _0800CC80 + strb r2, [r0] + ldr r2, _0800CC84 + ldrb r1, [r1] + ldrb r0, [r0] + lsls r0, 8 + orrs r1, r0 + strh r1, [r2] + pop {r0} + bx r0 + .align 2, 0 +_0800CC7C: .4byte gUnknown_202D6B8 +_0800CC80: .4byte gUnknown_202D6B9 +_0800CC84: .4byte gUnknown_202D7FA + thumb_func_end sub_800CC44 + + thumb_func_start sub_800CC88 +sub_800CC88: + ldr r2, _0800CC90 + strh r0, [r2, 0x4] + strh r1, [r2, 0x6] + bx lr + .align 2, 0 +_0800CC90: .4byte gUnknown_202D698 + thumb_func_end sub_800CC88 + + thumb_func_start sub_800CC94 +sub_800CC94: + ldr r2, _0800CC9C + strh r0, [r2, 0x4] + strh r1, [r2, 0x6] + bx lr + .align 2, 0 +_0800CC9C: .4byte gUnknown_202D6A0 + thumb_func_end sub_800CC94 + + thumb_func_start sub_800CCA0 +sub_800CCA0: + ldr r2, _0800CCA8 + strh r0, [r2, 0x4] + strh r1, [r2, 0x6] + bx lr + .align 2, 0 +_0800CCA8: .4byte gUnknown_202D6A8 + thumb_func_end sub_800CCA0 + + thumb_func_start sub_800CCAC +sub_800CCAC: + ldr r2, _0800CCB4 + strh r0, [r2, 0x4] + strh r1, [r2, 0x6] + bx lr + .align 2, 0 +_0800CCB4: .4byte gUnknown_202D6B0 + thumb_func_end sub_800CCAC + + thumb_func_start sub_800CCB8 +sub_800CCB8: + push {lr} + cmp r0, 0x1 + beq _0800CCD4 + cmp r0, 0x1 + ble _0800CCCA + cmp r0, 0x2 + beq _0800CCDE + cmp r0, 0x3 + beq _0800CCE8 +_0800CCCA: + adds r0, r1, 0 + adds r1, r2, 0 + bl sub_800CC88 + b _0800CCF0 +_0800CCD4: + adds r0, r1, 0 + adds r1, r2, 0 + bl sub_800CC94 + b _0800CCF0 +_0800CCDE: + adds r0, r1, 0 + adds r1, r2, 0 + bl sub_800CCA0 + b _0800CCF0 +_0800CCE8: + adds r0, r1, 0 + adds r1, r2, 0 + bl sub_800CCAC +_0800CCF0: + pop {r0} + bx r0 + thumb_func_end sub_800CCB8 + + thumb_func_start sub_800CCF4 +sub_800CCF4: + push {lr} + cmp r0, 0x1 + beq _0800CD10 + cmp r0, 0x1 + ble _0800CD06 + cmp r0, 0x2 + beq _0800CD18 + cmp r0, 0x3 + beq _0800CD20 +_0800CD06: + ldr r0, _0800CD0C + b _0800CD22 + .align 2, 0 +_0800CD0C: .4byte gUnknown_202D698 +_0800CD10: + ldr r0, _0800CD14 + b _0800CD22 + .align 2, 0 +_0800CD14: .4byte gUnknown_202D6A0 +_0800CD18: + ldr r0, _0800CD1C + b _0800CD22 + .align 2, 0 +_0800CD1C: .4byte gUnknown_202D6A8 +_0800CD20: + ldr r0, _0800CD28 +_0800CD22: + strh r1, [r0, 0x4] + pop {r0} + bx r0 + .align 2, 0 +_0800CD28: .4byte gUnknown_202D6B0 + thumb_func_end sub_800CCF4 + + thumb_func_start sub_800CD2C +sub_800CD2C: + push {lr} + cmp r0, 0x1 + beq _0800CD48 + cmp r0, 0x1 + ble _0800CD3E + cmp r0, 0x2 + beq _0800CD50 + cmp r0, 0x3 + beq _0800CD58 +_0800CD3E: + ldr r0, _0800CD44 + b _0800CD5A + .align 2, 0 +_0800CD44: .4byte gUnknown_202D698 +_0800CD48: + ldr r0, _0800CD4C + b _0800CD5A + .align 2, 0 +_0800CD4C: .4byte gUnknown_202D6A0 +_0800CD50: + ldr r0, _0800CD54 + b _0800CD5A + .align 2, 0 +_0800CD54: .4byte gUnknown_202D6A8 +_0800CD58: + ldr r0, _0800CD60 +_0800CD5A: + strh r1, [r0, 0x6] + pop {r0} + bx r0 + .align 2, 0 +_0800CD60: .4byte gUnknown_202D6B0 + thumb_func_end sub_800CD2C + + thumb_func_start sub_800CD64 +sub_800CD64: + ldr r2, _0800CD7C + strb r1, [r2] + ldr r2, _0800CD80 + negs r1, r0 + orrs r1, r0 + asrs r1, 31 + movs r3, 0x80 + lsls r3, 8 + adds r0, r3, 0 + ands r1, r0 + strh r1, [r2, 0x2] + bx lr + .align 2, 0 +_0800CD7C: .4byte gUnknown_202D7FE +_0800CD80: .4byte gUnknown_202D6A8 + thumb_func_end sub_800CD64 + + thumb_func_start SetBGOBJEnableFlags +SetBGOBJEnableFlags: + push {r4,lr} + movs r3, 0x80 + lsls r3, 19 + ldrh r1, [r3] + ldr r2, _0800CDA4 + ands r2, r1 + lsls r0, 8 + movs r4, 0xF8 + lsls r4, 5 + adds r1, r4, 0 + bics r1, r0 + orrs r2, r1 + strh r2, [r3] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800CDA4: .4byte 0x0000e0ff + thumb_func_end SetBGOBJEnableFlags + + thumb_func_start sub_800CDA8 +sub_800CDA8: + ldr r1, _0800CDBC + str r0, [r1] + ldr r2, _0800CDC0 + ldr r1, _0800CDC4 + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] + bx lr + .align 2, 0 +_0800CDBC: .4byte gUnknown_202D800 +_0800CDC0: .4byte gUnknown_202D7FC +_0800CDC4: .4byte gUnknown_203B0BE + thumb_func_end sub_800CDA8 + + thumb_func_start sub_800CDC8 +sub_800CDC8: + ldr r0, _0800CDD0 + ldr r0, [r0] + bx lr + .align 2, 0 +_0800CDD0: .4byte gUnknown_202D800 + thumb_func_end sub_800CDC8 + + thumb_func_start nullsub_22 +nullsub_22: + bx lr + thumb_func_end nullsub_22 + + thumb_func_start nullsub_23 +nullsub_23: + bx lr + thumb_func_end nullsub_23 + + thumb_func_start nullsub_182 +nullsub_182: + bx lr + thumb_func_end nullsub_182 + + thumb_func_start sub_800CDE0 +sub_800CDE0: + movs r0, 0x1 + bx lr + thumb_func_end sub_800CDE0 + + thumb_func_start CpuCopy +CpuCopy: + push {lr} + adds r3, r0, 0 + cmp r2, 0 + bge _0800CDEE + adds r2, 0x3 +_0800CDEE: + lsls r2, 9 + lsrs r2, 11 + movs r0, 0x80 + lsls r0, 19 + orrs r2, r0 + adds r0, r1, 0 + adds r1, r3, 0 + bl CpuSet + pop {r0} + bx r0 + thumb_func_end CpuCopy + + thumb_func_start CpuClear +CpuClear: + push {lr} + sub sp, 0x4 + adds r3, r0, 0 + movs r0, 0 + str r0, [sp] + cmp r1, 0 + bge _0800CE14 + adds r1, 0x3 +_0800CE14: + lsls r2, r1, 9 + lsrs r2, 11 + movs r0, 0xA0 + lsls r0, 19 + orrs r2, r0 + mov r0, sp + adds r1, r3, 0 + bl CpuSet + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end CpuClear + + thumb_func_start CpuFill +CpuFill: + push {lr} + sub sp, 0x4 + adds r3, r0, 0 + str r1, [sp] + cmp r2, 0 + bge _0800CE3A + adds r2, 0x3 +_0800CE3A: + lsls r2, 9 + lsrs r2, 11 + movs r0, 0xA0 + lsls r0, 19 + orrs r2, r0 + mov r0, sp + adds r1, r3, 0 + bl CpuSet + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end CpuFill + + thumb_func_start sub_800CE54 +sub_800CE54: + push {lr} + ldr r2, _0800CEC0 + ldrh r0, [r2] + movs r3, 0x80 + lsls r3, 8 + adds r1, r3, 0 + orrs r0, r1 + ldr r1, _0800CEC4 + ands r0, r1 + strh r0, [r2] + mov r8, r8 + mov r8, r8 + mov r8, r8 + mov r8, r8 + ldr r1, _0800CEC8 + ands r0, r1 + strh r0, [r2] + ldr r1, _0800CECC + ldr r2, _0800CED0 + adds r0, r2, 0 + strh r0, [r1] + adds r1, 0x2 + movs r0, 0x3D + strh r0, [r1] + adds r1, 0x6 + ldr r0, _0800CED4 + ldrh r0, [r0] + strh r0, [r1] + adds r1, 0x2 + ldr r0, _0800CED8 + ldrh r0, [r0] + strh r0, [r1] + ldr r0, _0800CEDC + ldrb r1, [r0] + cmp r1, 0 + beq _0800CEF4 + ldr r1, _0800CEE0 + ldr r0, _0800CEE4 + ldr r2, [r0] + adds r0, r2, 0x4 + str r0, [r1] + ldr r3, _0800CEE8 + str r3, [r1, 0x4] + ldr r0, _0800CEEC + str r0, [r1, 0x8] + ldr r0, [r1, 0x8] + ldrh r0, [r2] + strh r0, [r3] + subs r1, 0x6E + ldrh r0, [r2, 0x2] + strh r0, [r1] + ldr r0, _0800CEF0 + movs r1, 0xA0 + b _0800CEFE + .align 2, 0 +_0800CEC0: .4byte 0x040000ba +_0800CEC4: .4byte 0x0000cdff +_0800CEC8: .4byte 0x00007fff +_0800CECC: .4byte 0x04000048 +_0800CED0: .4byte 0x00003f3f +_0800CED4: .4byte gUnknown_202D7FC +_0800CED8: .4byte gUnknown_202D7FA +_0800CEDC: .4byte gUnknown_2026E38 +_0800CEE0: .4byte 0x040000b0 +_0800CEE4: .4byte gUnknown_2026E3C +_0800CEE8: .4byte 0x04000040 +_0800CEEC: .4byte 0xa2600002 +_0800CEF0: .4byte 0x04000044 +_0800CEF4: + ldr r0, _0800CF08 + strh r1, [r0] + adds r0, 0x2 + strh r1, [r0] + adds r0, 0x2 +_0800CEFE: + strh r1, [r0] + adds r0, 0x2 + strh r1, [r0] + pop {r0} + bx r0 + .align 2, 0 +_0800CF08: .4byte 0x04000040 + thumb_func_end sub_800CE54 + + thumb_func_start sub_800CF0C +sub_800CF0C: + push {lr} + bl IdentifyFlash + lsls r0, 16 + cmp r0, 0 + bne _0800CF32 + movs r0, 0x3 + bl sub_800B6E8 + adds r1, r0, 0 + movs r0, 0x2 + bl SetFlashTimerIntr + lsls r0, 16 + cmp r0, 0 + bne _0800CF32 + ldr r1, _0800CF38 + movs r0, 0x1 + strb r0, [r1] +_0800CF32: + pop {r0} + bx r0 + .align 2, 0 +_0800CF38: .4byte gUnknown_203B0B4 + thumb_func_end sub_800CF0C + + thumb_func_start sub_800CF3C +sub_800CF3C: + push {lr} + ldr r0, _0800CF54 + ldrb r0, [r0] + cmp r0, 0 + beq _0800CF4E + ldr r0, _0800CF58 + ldr r0, [r0] + bl _call_via_r0 +_0800CF4E: + pop {r0} + bx r0 + .align 2, 0 +_0800CF54: .4byte gUnknown_203B0B4 +_0800CF58: .4byte EraseFlashChip + thumb_func_end sub_800CF3C + + thumb_func_start sub_800CF5C +sub_800CF5C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + adds r5, r2, 0 + ldr r0, _0800CFAC + ldrb r0, [r0] + cmp r0, 0 + beq _0800CFB4 + adds r4, r1, 0 + ldr r0, _0800CFB0 + cmp r5, r0 + ble _0800CF94 + movs r7, 0x80 + lsls r7, 5 + mov r8, r0 +_0800CF7C: + lsls r0, r6, 16 + lsrs r0, 16 + movs r1, 0 + adds r2, r4, 0 + adds r3, r7, 0 + bl ReadFlash + adds r6, 0x1 + adds r4, r7 + subs r5, r7 + cmp r5, r8 + bgt _0800CF7C +_0800CF94: + cmp r5, 0 + ble _0800CFA6 + lsls r0, r6, 16 + lsrs r0, 16 + movs r1, 0 + adds r2, r4, 0 + adds r3, r5, 0 + bl ReadFlash +_0800CFA6: + movs r0, 0 + b _0800CFB6 + .align 2, 0 +_0800CFAC: .4byte gUnknown_203B0B4 +_0800CFB0: .4byte 0x00000fff +_0800CFB4: + movs r0, 0x3 +_0800CFB6: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_800CF5C + + thumb_func_start sub_800CFC0 +sub_800CFC0: + push {r4-r6,lr} + ldr r4, _0800CFD8 + add sp, r4 + adds r6, r0, 0 + adds r5, r2, 0 + ldr r0, _0800CFDC + ldrb r0, [r0] + cmp r0, 0 + beq _0800D03C + movs r2, 0x1 + adds r4, r1, 0 + b _0800CFEC + .align 2, 0 +_0800CFD8: .4byte 0xfffff000 +_0800CFDC: .4byte gUnknown_203B0B4 +_0800CFE0: + adds r6, 0x1 + movs r0, 0x80 + lsls r0, 5 + adds r4, r0 + ldr r0, _0800D034 + adds r5, r0 +_0800CFEC: + ldr r0, _0800D038 + cmp r5, r0 + ble _0800D002 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_800D04C + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _0800CFE0 +_0800D002: + cmp r2, 0 + beq _0800D03C + cmp r5, 0 + ble _0800D02C + movs r2, 0x80 + lsls r2, 5 + mov r0, sp + movs r1, 0xFF + bl MemoryFill8 + mov r0, sp + adds r1, r4, 0 + adds r2, r5, 0 + bl MemoryCopy8 + adds r0, r6, 0 + mov r1, sp + bl sub_800D04C + lsls r0, 24 + lsrs r2, r0, 24 +_0800D02C: + cmp r2, 0 + beq _0800D03C + movs r0, 0 + b _0800D03E + .align 2, 0 +_0800D034: .4byte 0xfffff000 +_0800D038: .4byte 0x00000fff +_0800D03C: + movs r0, 0x3 +_0800D03E: + movs r3, 0x80 + lsls r3, 5 + add sp, r3 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_800CFC0 + + thumb_func_start sub_800D04C +sub_800D04C: + push {r4-r7,lr} + adds r5, r1, 0 + movs r6, 0x3 + ldr r7, _0800D07C + lsls r0, 16 + lsrs r4, r0, 16 +_0800D058: + ldr r2, [r7] + adds r0, r4, 0 + adds r1, r5, 0 + bl _call_via_r2 + lsls r0, 16 + cmp r0, 0 + bne _0800D080 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x80 + lsls r2, 5 + bl VerifyFlashSectorNBytes + cmp r0, 0 + bne _0800D080 + movs r0, 0x1 + b _0800D08A + .align 2, 0 +_0800D07C: .4byte ProgramFlashSector +_0800D080: + adds r0, r6, 0 + subs r6, 0x1 + cmp r0, 0 + bgt _0800D058 + movs r0, 0 +_0800D08A: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_800D04C + + thumb_func_start Hang +Hang: + push {lr} +_0800D092: + swi 0x2 + b _0800D092 + thumb_func_end Hang + + thumb_func_start sub_800D098 +sub_800D098: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r1, _0800D138 +_0800D0A4: + ldrh r0, [r1] + cmp r0, 0x9F + bls _0800D0A4 + movs r1, 0x80 + lsls r1, 19 + ldrh r0, [r1] + adds r7, r0, 0 + movs r0, 0 + strh r0, [r1] + movs r1, 0xA0 + lsls r1, 19 + ldr r2, _0800D13C + adds r0, r2, 0 + strh r0, [r1] + ldr r2, _0800D140 + ldrh r0, [r2] + ldr r1, _0800D144 + cmp r0, r1 + beq _0800D0D0 +_0800D0CA: + ldrh r0, [r2] + cmp r0, r1 + bne _0800D0CA +_0800D0D0: + ldr r6, _0800D148 + movs r0, 0 + mov r8, r0 + strh r0, [r6] + ldr r5, _0800D14C + ldrh r4, [r5] + movs r1, 0xC0 + lsls r1, 6 + adds r0, r1, 0 + strh r0, [r5] + ldr r2, _0800D150 + mov r10, r2 + ldr r1, _0800D154 + adds r0, r1, 0 + strh r0, [r2] + movs r2, 0x1 + mov r9, r2 + strh r2, [r6] + bl SoundBiasReset + swi 0x3 + bl SoundBiasSet + mov r0, r8 + strh r0, [r6] + strh r4, [r5] + mov r1, r10 + strh r0, [r1] + mov r2, r9 + strh r2, [r6] + ldr r1, _0800D138 +_0800D10E: + ldrh r0, [r1] + cmp r0, 0x9F + bls _0800D10E + movs r0, 0x80 + lsls r0, 19 + strh r7, [r0] + ldr r2, _0800D140 + ldrh r0, [r2] + ldr r1, _0800D144 + cmp r0, r1 + beq _0800D12A +_0800D124: + ldrh r0, [r2] + cmp r0, r1 + bne _0800D124 +_0800D12A: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0800D138: .4byte 0x04000006 +_0800D13C: .4byte 0x0000efff +_0800D140: .4byte 0x04000130 +_0800D144: .4byte 0x000003ff +_0800D148: .4byte 0x04000208 +_0800D14C: .4byte 0x04000200 +_0800D150: .4byte 0x04000132 +_0800D154: .4byte 0x0000c304 + thumb_func_end sub_800D098 + + thumb_func_start sub_800D158 +sub_800D158: + push {r1-r3} + push {lr} + ldr r1, [sp, 0x4] + add r2, sp, 0x8 + bl vsprintf + pop {r3} + add sp, 0xC + bx r3 + thumb_func_end sub_800D158 + + thumb_func_start sub_800D16C +sub_800D16C: + push {r0-r3} + push {lr} + mov r12, r4 + ldr r4, _0800D198 + add sp, r4 + mov r4, r12 + ldr r0, _0800D19C + add r0, sp + ldr r1, [r0] + movs r2, 0x81 + lsls r2, 3 + add r2, sp + mov r0, sp + bl vsprintf + movs r3, 0x80 + lsls r3, 3 + add sp, r3 + pop {r3} + add sp, 0x10 + bx r3 + .align 2, 0 +_0800D198: .4byte 0xfffffc00 +_0800D19C: .4byte 0x00000404 + thumb_func_end sub_800D16C + + thumb_func_start sub_800D1A0 +sub_800D1A0: + push {r3} + add sp, 0x4 + bx lr + thumb_func_end sub_800D1A0 + + thumb_func_start nullsub_183 +nullsub_183: + bx lr + thumb_func_end nullsub_183 + + thumb_func_start nullsub_188 +nullsub_188: + bx lr + thumb_func_end nullsub_188 + + thumb_func_start nullsub_184 +nullsub_184: + bx lr + thumb_func_end nullsub_184 + + thumb_func_start sub_800D1B4 +sub_800D1B4: + movs r0, 0 + bx lr + thumb_func_end sub_800D1B4 + + thumb_func_start sub_800D1B8 +sub_800D1B8: + adds r0, r2, 0 + bx lr + thumb_func_end sub_800D1B8 + + thumb_func_start nullsub_187 +nullsub_187: + bx lr + thumb_func_end nullsub_187 + + thumb_func_start sub_800D1C0 +sub_800D1C0: + push {lr} + ldr r1, _0800D1D4 + ldr r0, [r1] + cmp r0, 0x2 + bne _0800D1D8 + ldr r0, [r1, 0x4] + cmp r0, 0x2 + bne _0800D1D8 + movs r0, 0x1 + b _0800D1DA + .align 2, 0 +_0800D1D4: .4byte gUnknown_202DB60 +_0800D1D8: + movs r0, 0 +_0800D1DA: + pop {r1} + bx r1 + thumb_func_end sub_800D1C0 + + thumb_func_start sub_800D1E0 +sub_800D1E0: + push {r4-r7,lr} + movs r0, 0 + ldr r1, _0800D218 + mov r12, r1 + ldr r6, _0800D21C + ldr r7, _0800D220 + movs r5, 0x1 +_0800D1EE: + movs r2, 0 + lsls r1, r0, 4 + adds r4, r0, 0x1 + lsls r0, 2 + adds r3, r0, r7 + add r1, r12 +_0800D1FA: + ldrh r0, [r1] + cmp r0, r6 + bne _0800D202 + str r5, [r3] +_0800D202: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, 0x7 + bls _0800D1FA + adds r0, r4, 0 + cmp r0, 0x1 + ble _0800D1EE + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0800D218: .4byte gUnknown_202DB30 +_0800D21C: .4byte 0x0000fdfd +_0800D220: .4byte gUnknown_202DB60 + thumb_func_end sub_800D1E0 + + thumb_func_start sub_800D224 +sub_800D224: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + str r0, [sp] + movs r6, 0 + ldr r0, _0800D280 + mov r12, r0 + ldr r1, _0800D284 + mov r10, r1 + movs r2, 0x2 + mov r9, r2 +_0800D240: + ldr r1, [sp] + asrs r1, r6 + movs r0, 0x1 + ands r1, r0 + adds r3, r6, 0x1 + mov r8, r3 + cmp r1, 0 + beq _0800D2CE + lsls r0, r6, 2 + ldr r1, _0800D288 + adds r2, r0, r1 + ldr r1, [r2] + adds r5, r0, 0 + cmp r1, 0x1 + bne _0800D2CE + lsls r0, r6, 5 + adds r0, r6 + lsls r0, 3 + ldr r1, _0800D28C + adds r7, r0, r1 + movs r4, 0 + mov r3, r12 + adds r0, r5, r3 + ldr r1, [r0] + mov r3, r10 + ldr r0, [r3] + lsrs r0, 1 + cmp r1, r0 + bcc _0800D290 + mov r0, r9 + str r0, [r2] + b _0800D2C4 + .align 2, 0 +_0800D280: .4byte gUnknown_202DB58 +_0800D284: .4byte gUnknown_202DB74 +_0800D288: .4byte gUnknown_202DB60 +_0800D28C: .4byte gUnknown_202D910 +_0800D290: + mov r1, r12 + adds r0, r5, r1 + ldr r3, [r0] + adds r2, r3, r4 + lsls r2, 1 + adds r2, r7 + lsls r0, r4, 1 + lsls r1, r6, 4 + adds r0, r1 + ldr r1, _0800D2E4 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r2] + adds r4, 0x1 + cmp r4, 0x7 + bhi _0800D2C4 + adds r1, r3, r4 + mov r2, r10 + ldr r0, [r2] + lsrs r0, 1 + cmp r1, r0 + bcc _0800D290 + ldr r3, _0800D2E8 + adds r0, r5, r3 + mov r1, r9 + str r1, [r0] +_0800D2C4: + mov r2, r12 + adds r1, r5, r2 + ldr r0, [r1] + adds r0, 0x8 + str r0, [r1] +_0800D2CE: + mov r6, r8 + cmp r6, 0x1 + ble _0800D240 + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0800D2E4: .4byte gUnknown_202DB30 +_0800D2E8: .4byte gUnknown_202DB60 + thumb_func_end sub_800D224 + + thumb_func_start sub_800D2EC +sub_800D2EC: + push {r4-r7,lr} + ldr r0, _0800D318 + mov r12, r0 + ldr r3, _0800D31C + adds r7, r3, 0 + ldr r6, _0800D320 + ldr r2, _0800D324 + adds r5, r2, 0 + adds r5, 0xE + ldr r4, _0800D328 +_0800D300: + ldr r0, [r4] + lsrs r0, 1 + ldr r1, [r7] + cmp r1, r0 + bcs _0800D32C + lsls r0, r1, 1 + add r0, r12 + ldrh r0, [r0] + strh r0, [r2] + adds r0, r1, 0x1 + str r0, [r3] + b _0800D32E + .align 2, 0 +_0800D318: .4byte gUnknown_202D808 +_0800D31C: .4byte gUnknown_202DB50 +_0800D320: .4byte 0x0000fcfc +_0800D324: .4byte gUnknown_202DB20 +_0800D328: .4byte gUnknown_202DB74 +_0800D32C: + strh r6, [r2] +_0800D32E: + adds r2, 0x2 + cmp r2, r5 + bls _0800D300 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_800D2EC + + thumb_func_start sub_800D33C +sub_800D33C: + push {r4,r5,lr} + movs r5, 0 + ldr r1, _0800D370 + ldr r4, _0800D374 + ldr r0, [r4] + str r0, [r1] + ldr r0, _0800D378 + ldr r1, _0800D37C + bl sub_800D820 + adds r2, r0, 0 + str r2, [r4] + ldr r1, _0800D380 + ldrb r0, [r1] + cmp r0, 0 + bne _0800D384 + movs r0, 0x80 + lsls r0, 1 + ands r0, r2 + cmp r0, 0 + beq _0800D36A + movs r0, 0x1 + strb r0, [r1] +_0800D36A: + movs r0, 0 + b _0800D40E + .align 2, 0 +_0800D370: .4byte gUnknown_202DB6C +_0800D374: .4byte gUnknown_202DB68 +_0800D378: .4byte gUnknown_202DB20 +_0800D37C: .4byte gUnknown_202DB30 +_0800D380: .4byte gUnknown_202DB70 +_0800D384: + movs r0, 0x80 + lsls r0, 5 + ands r0, r2 + cmp r0, 0 + beq _0800D392 + movs r0, 0x3 + b _0800D40E +_0800D392: + movs r0, 0x80 + lsls r0, 6 + ands r0, r2 + cmp r0, 0 + beq _0800D3A0 + movs r0, 0x4 + b _0800D40E +_0800D3A0: + movs r0, 0x80 + lsls r0, 8 + ands r0, r2 + cmp r0, 0 + beq _0800D3BA + lsls r1, r2, 28 + lsrs r1, 28 + lsls r0, r2, 20 + lsrs r0, 28 + cmp r1, r0 + beq _0800D3BA + movs r0, 0x5 + b _0800D40E +_0800D3BA: + ldr r4, _0800D3F8 + ldr r0, _0800D3FC + ldr r2, [r4] + ldr r0, [r0] + orrs r0, r2 + movs r1, 0xE + ands r0, r1 + cmp r0, 0 + beq _0800D40C + ldr r0, _0800D400 + ldr r1, [r0] + lsls r1, 26 + lsrs r1, 30 + movs r0, 0x1 + lsls r0, r1 + ands r2, r0 + cmp r2, 0 + beq _0800D40C + bl sub_800D1E0 + ldr r0, [r4] + bl sub_800D224 + ldr r0, [r4] + bl sub_800D1C0 + lsls r0, 24 + cmp r0, 0 + beq _0800D404 + movs r0, 0x2 + b _0800D40E + .align 2, 0 +_0800D3F8: .4byte gUnknown_202DB68 +_0800D3FC: .4byte gUnknown_202DB6C +_0800D400: .4byte 0x04000128 +_0800D404: + ldr r0, [r4] + bl sub_800D2EC + movs r5, 0x1 +_0800D40C: + adds r0, r5, 0 +_0800D40E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_800D33C + + thumb_func_start sub_800D414 +sub_800D414: + push {r4,lr} + ldr r0, _0800D468 + movs r4, 0 + str r4, [r0] + ldr r0, _0800D46C + str r4, [r0] + ldr r0, _0800D470 + strb r4, [r0] + ldr r0, _0800D474 + str r4, [r0] + ldr r0, _0800D478 + str r4, [r0] + str r4, [r0, 0x4] + ldr r0, _0800D47C + movs r1, 0x10 + bl MemoryClear16 + ldr r0, _0800D480 + movs r1, 0x20 + bl MemoryClear16 + ldr r0, _0800D484 + str r4, [r0] + ldr r0, _0800D488 + str r4, [r0] + str r4, [r0, 0x4] + ldr r0, _0800D48C + movs r1, 0x84 + lsls r1, 1 + bl MemoryClear16 + ldr r0, _0800D490 + movs r1, 0x84 + lsls r1, 2 + bl MemoryClear16 + bl sub_800D6AC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800D468: .4byte gUnknown_202DB68 +_0800D46C: .4byte gUnknown_202DB6C +_0800D470: .4byte gUnknown_202DB70 +_0800D474: .4byte gUnknown_202DB74 +_0800D478: .4byte gUnknown_202DB60 +_0800D47C: .4byte gUnknown_202DB20 +_0800D480: .4byte gUnknown_202DB30 +_0800D484: .4byte gUnknown_202DB50 +_0800D488: .4byte gUnknown_202DB58 +_0800D48C: .4byte gUnknown_202D808 +_0800D490: .4byte gUnknown_202D910 + thumb_func_end sub_800D414 + + thumb_func_start sub_800D494 +sub_800D494: + push {r4,lr} + ldr r0, _0800D4E4 + movs r4, 0 + str r4, [r0] + ldr r0, _0800D4E8 + str r4, [r0] + ldr r0, _0800D4EC + strb r4, [r0] + ldr r0, _0800D4F0 + str r4, [r0] + ldr r0, _0800D4F4 + str r4, [r0] + str r4, [r0, 0x4] + ldr r0, _0800D4F8 + movs r1, 0x10 + bl MemoryClear16 + ldr r0, _0800D4FC + movs r1, 0x20 + bl MemoryClear16 + ldr r0, _0800D500 + str r4, [r0] + ldr r0, _0800D504 + str r4, [r0] + str r4, [r0, 0x4] + ldr r0, _0800D508 + movs r1, 0x84 + lsls r1, 1 + bl MemoryClear16 + ldr r0, _0800D50C + movs r1, 0x84 + lsls r1, 2 + bl MemoryClear16 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800D4E4: .4byte gUnknown_202DB68 +_0800D4E8: .4byte gUnknown_202DB6C +_0800D4EC: .4byte gUnknown_202DB70 +_0800D4F0: .4byte gUnknown_202DB74 +_0800D4F4: .4byte gUnknown_202DB60 +_0800D4F8: .4byte gUnknown_202DB20 +_0800D4FC: .4byte gUnknown_202DB30 +_0800D500: .4byte gUnknown_202DB50 +_0800D504: .4byte gUnknown_202DB58 +_0800D508: .4byte gUnknown_202D808 +_0800D50C: .4byte gUnknown_202D910 + thumb_func_end sub_800D494 + + thumb_func_start sub_800D510 +sub_800D510: + ldr r1, _0800D51C + movs r2, 0x80 + lsls r2, 8 + adds r0, r2, 0 + strh r0, [r1] + bx lr + .align 2, 0 +_0800D51C: .4byte 0x04000134 + thumb_func_end sub_800D510 + + thumb_func_start sub_800D520 +sub_800D520: + push {r4,r5,lr} + sub sp, 0x4 + mov r1, sp + movs r0, 0x1 + strh r0, [r1] + ldr r0, _0800D568 + ldrb r1, [r0] + movs r0, 0x30 + ands r0, r1 + cmp r0, 0 + bne _0800D55C + mov r1, sp + mov r0, sp + ldrh r0, [r0] + subs r0, 0x1 + strh r0, [r1] + ldrh r0, [r1] + ldr r1, _0800D56C + cmp r0, r1 + beq _0800D55C + mov r4, sp + adds r5, r1, 0 +_0800D54C: + bl VBlankIntrWait + ldrh r0, [r4] + subs r0, 0x1 + strh r0, [r4] + ldrh r0, [r4] + cmp r0, r5 + bne _0800D54C +_0800D55C: + bl sub_800D7D0 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0800D568: .4byte 0x04000128 +_0800D56C: .4byte 0x0000ffff + thumb_func_end sub_800D520 + + thumb_func_start sub_800D570 +sub_800D570: + push {lr} + bl sub_800D7B8 + pop {r0} + bx r0 + thumb_func_end sub_800D570 + + thumb_func_start sub_800D57C +sub_800D57C: + ldr r0, _0800D584 + ldrb r0, [r0] + bx lr + .align 2, 0 +_0800D584: .4byte gUnknown_202DB70 + thumb_func_end sub_800D57C + + thumb_func_start sub_800D588 +sub_800D588: + ldr r0, _0800D598 + ldr r0, [r0] + movs r1, 0x80 + ands r0, r1 + lsls r0, 24 + lsrs r0, 24 + bx lr + .align 2, 0 +_0800D598: .4byte gUnknown_202DB68 + thumb_func_end sub_800D588 + + thumb_func_start sub_800D59C +sub_800D59C: + push {r4-r6,lr} + adds r3, r0, 0 + adds r2, r1, 0 + movs r5, 0 + ldr r6, _0800D5F4 + ldr r4, _0800D5F8 + adds r0, r2, 0x1 + movs r1, 0x2 + negs r1, r1 + ands r0, r1 + adds r0, 0x8 + str r0, [r4] + adds r0, r6, 0x4 + adds r1, r3, 0 + bl CpuCopy + ldr r0, _0800D5FC + strh r0, [r6] + strh r5, [r6, 0x2] + movs r2, 0 + ldr r0, [r4] + lsrs r0, 1 + subs r0, 0x2 + cmp r5, r0 + bcs _0800D5DE + adds r3, r0, 0 + adds r1, r6, 0 +_0800D5D2: + ldrh r0, [r1] + adds r5, r0 + adds r1, 0x2 + adds r2, 0x1 + cmp r2, r3 + bcc _0800D5D2 +_0800D5DE: + ldr r2, _0800D5F4 + mvns r1, r5 + ldr r0, _0800D5F8 + ldr r0, [r0] + lsrs r0, 1 + subs r1, r0 + strh r1, [r2, 0x2] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0800D5F4: .4byte gUnknown_202D808 +_0800D5F8: .4byte gUnknown_202DB74 +_0800D5FC: .4byte 0x0000fdfd + thumb_func_end sub_800D59C + + thumb_func_start sub_800D600 +sub_800D600: + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r6, 0 + ldr r0, _0800D64C + mov r8, r0 + ldr r7, _0800D650 + ldr r0, [r7] + lsrs r0, 1 + subs r0, 0x2 + mov r12, r0 + movs r5, 0 +_0800D618: + movs r4, 0 + mov r2, r8 + adds r1, r5, r2 + movs r3, 0 + cmp r4, r12 + bcs _0800D636 + ldr r0, [r7] + lsrs r0, 1 + subs r2, r0, 0x2 +_0800D62A: + ldrh r0, [r1] + adds r4, r0 + adds r1, 0x2 + adds r3, 0x1 + cmp r3, r2 + bcc _0800D62A +_0800D636: + ldr r0, [r7] + lsrs r0, 1 + ldr r2, _0800D654 + adds r1, r2, 0 + subs r1, r0 + lsls r0, r4, 16 + lsls r1, 16 + cmp r0, r1 + beq _0800D658 + movs r0, 0 + b _0800D666 + .align 2, 0 +_0800D64C: .4byte gUnknown_202D910 +_0800D650: .4byte gUnknown_202DB74 +_0800D654: .4byte 0x0000ffff +_0800D658: + movs r0, 0x84 + lsls r0, 1 + adds r5, r0 + adds r6, 0x1 + cmp r6, 0x1 + bls _0800D618 + movs r0, 0x1 +_0800D666: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_800D600 + + thumb_func_start sub_800D670 +sub_800D670: + push {lr} + adds r3, r1, 0 + lsls r1, r0, 5 + adds r1, r0 + lsls r1, 3 + ldr r0, _0800D688 + adds r1, r0 + adds r0, r3, 0 + bl CpuCopy + pop {r0} + bx r0 + .align 2, 0 +_0800D688: .4byte gUnknown_202D914 + thumb_func_end sub_800D670 + + thumb_func_start sub_800D68C +sub_800D68C: + push {lr} + adds r1, r0, 0 + lsls r0, r1, 5 + adds r0, r1 + lsls r0, 3 + ldr r1, _0800D6A8 + adds r0, r1 + movs r2, 0x84 + lsls r2, 1 + movs r1, 0 + bl MemoryFill8 + pop {r0} + bx r0 + .align 2, 0 +_0800D6A8: .4byte gUnknown_202D910 + thumb_func_end sub_800D68C + + thumb_func_start sub_800D6AC +sub_800D6AC: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + ldr r3, _0800D784 + movs r4, 0 + strh r4, [r3] + ldr r2, _0800D788 + ldrh r1, [r2] + ldr r0, _0800D78C + ands r0, r1 + strh r0, [r2] + movs r0, 0x1 + strh r0, [r3] + ldr r0, _0800D790 + strh r4, [r0] + subs r2, 0xD8 + movs r0, 0x80 + lsls r0, 6 + str r0, [r2] + ldrh r0, [r2] + ldr r3, _0800D794 + adds r1, r3, 0 + orrs r0, r1 + strh r0, [r2] + movs r0, 0 + str r0, [sp] + ldr r4, _0800D798 + ldr r2, _0800D79C + mov r0, sp + adds r1, r4, 0 + bl CpuSet + ldr r0, _0800D7A0 + ldr r1, _0800D7A4 + ldr r2, _0800D7A8 + bl CpuSet + ldr r0, _0800D7AC + ldr r1, _0800D7B0 + ldr r2, _0800D7B4 + bl CpuSet + movs r0, 0x1 + negs r0, r0 + str r0, [r4, 0x14] + adds r0, r4, 0 + adds r0, 0x60 + str r0, [r4, 0x28] + adds r0, 0x18 + str r0, [r4, 0x2C] + movs r3, 0 + adds r5, r4, 0 + adds r5, 0xC0 + movs r2, 0 + movs r7, 0x30 + adds r7, r4 + mov r8, r7 + movs r0, 0x90 + adds r0, r4 + mov r12, r0 + adds r6, r4, 0 + adds r6, 0xA8 + movs r7, 0x40 + adds r7, r4 + mov r9, r7 +_0800D732: + lsls r1, r3, 2 + mov r7, r12 + adds r0, r2, r7 + mov r7, r8 + adds r7, 0x4 + mov r8, r7 + subs r7, 0x4 + stm r7!, {r0} + adds r0, r2, r6 + mov r7, r9 + adds r7, 0x4 + mov r9, r7 + subs r7, 0x4 + stm r7!, {r0} + adds r0, r4, 0 + adds r0, 0x50 + adds r1, r0 + str r5, [r1] + adds r5, 0x48 + adds r2, 0x48 + adds r3, 0x1 + cmp r3, 0x1 + ble _0800D732 + movs r0, 0 + ldr r3, _0800D784 + strh r0, [r3] + ldr r2, _0800D788 + ldrh r0, [r2] + movs r1, 0x80 + orrs r0, r1 + strh r0, [r2] + movs r0, 0x1 + strh r0, [r3] + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0800D784: .4byte 0x04000208 +_0800D788: .4byte 0x04000200 +_0800D78C: .4byte 0x0000ff3f +_0800D790: .4byte 0x04000134 +_0800D794: .4byte 0x00004003 +_0800D798: .4byte gUnknown_202DCF8 +_0800D79C: .4byte 0x05000048 +_0800D7A0: .4byte sub_80001E8 +_0800D7A4: .4byte gUnknown_202DB78 +_0800D7A8: .4byte 0x04000010 +_0800D7AC: .4byte sub_8000228 +_0800D7B0: .4byte gUnknown_202DBB8 +_0800D7B4: .4byte 0x04000050 + thumb_func_end sub_800D6AC + + thumb_func_start sub_800D7B8 +sub_800D7B8: + push {lr} + ldr r1, _0800D7CC + ldrb r0, [r1] + cmp r0, 0 + beq _0800D7C6 + movs r0, 0x1 + strb r0, [r1, 0x8] +_0800D7C6: + pop {r0} + bx r0 + .align 2, 0 +_0800D7CC: .4byte gUnknown_202DCF8 + thumb_func_end sub_800D7B8 + + thumb_func_start sub_800D7D0 +sub_800D7D0: + push {r4,lr} + ldr r3, _0800D804 + movs r4, 0 + strh r4, [r3] + ldr r2, _0800D808 + ldrh r1, [r2] + ldr r0, _0800D80C + ands r0, r1 + strh r0, [r2] + movs r0, 0x1 + strh r0, [r3] + ldr r1, _0800D810 + ldr r2, _0800D814 + adds r0, r2, 0 + strh r0, [r1] + subs r1, 0x1C + ldr r0, _0800D818 + str r0, [r1] + adds r1, 0xF6 + movs r0, 0xC0 + strh r0, [r1] + ldr r0, _0800D81C + strb r4, [r0, 0x8] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800D804: .4byte 0x04000208 +_0800D808: .4byte 0x04000200 +_0800D80C: .4byte 0x0000ff3f +_0800D810: .4byte 0x04000128 +_0800D814: .4byte 0x00002003 +_0800D818: .4byte 0x0000b1fc +_0800D81C: .4byte gUnknown_202DCF8 + thumb_func_end sub_800D7D0 + + thumb_func_start sub_800D820 +sub_800D820: + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r0 + mov r12, r1 + ldr r5, _0800D844 + ldr r6, [r5] + ldr r0, _0800D848 + ldrb r2, [r0, 0x1] + adds r7, r0, 0 + cmp r2, 0x1 + beq _0800D8AA + cmp r2, 0x1 + bgt _0800D84C + cmp r2, 0 + beq _0800D852 + b _0800D8E8 + .align 2, 0 +_0800D844: .4byte 0x04000128 +_0800D848: .4byte gUnknown_202DCF8 +_0800D84C: + cmp r2, 0x2 + beq _0800D8DC + b _0800D8E8 +_0800D852: + ldr r1, [r7, 0x14] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _0800D8A6 + movs r0, 0x88 + adds r4, r6, 0 + ands r4, r0 + cmp r4, 0x8 + bne _0800D8E8 + movs r1, 0x4 + adds r0, r6, 0 + ands r0, r1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0800D8A6 + ldr r3, _0800D8C0 + strh r0, [r3] + ldr r2, _0800D8C4 + ldrh r1, [r2] + ldr r0, _0800D8C8 + ands r0, r1 + strh r0, [r2] + ldrh r0, [r2] + movs r1, 0x40 + orrs r0, r1 + strh r0, [r2] + movs r0, 0x1 + strh r0, [r3] + ldrb r1, [r5, 0x1] + movs r0, 0x41 + negs r0, r0 + ands r0, r1 + strb r0, [r5, 0x1] + ldr r1, _0800D8CC + movs r0, 0xC0 + strh r0, [r1] + subs r1, 0xF6 + ldr r0, _0800D8D0 + str r0, [r1] + strb r4, [r7] +_0800D8A6: + movs r0, 0x1 + strb r0, [r7, 0x1] +_0800D8AA: + ldr r1, _0800D8D4 + ldrb r0, [r1, 0x2] + cmp r0, 0 + beq _0800D8DC + ldrb r0, [r1, 0xA] + cmp r0, 0x7 + bhi _0800D8D8 + adds r0, 0x1 + strb r0, [r1, 0xA] + b _0800D8DC + .align 2, 0 +_0800D8C0: .4byte 0x04000208 +_0800D8C4: .4byte 0x04000200 +_0800D8C8: .4byte 0x0000ff7f +_0800D8CC: .4byte 0x04000202 +_0800D8D0: .4byte 0x0000b1fc +_0800D8D4: .4byte gUnknown_202DCF8 +_0800D8D8: + movs r0, 0x2 + strb r0, [r1, 0x1] +_0800D8DC: + mov r0, r12 + bl sub_800D9B8 + mov r0, r8 + bl sub_800D944 +_0800D8E8: + ldr r1, _0800D908 + ldrb r0, [r1, 0xB] + adds r0, 0x1 + strb r0, [r1, 0xB] + ldrb r3, [r1, 0x3] + ldrb r0, [r1, 0x2] + lsls r2, r0, 8 + ldrb r0, [r1] + adds r7, r1, 0 + cmp r0, 0x8 + bne _0800D90C + movs r0, 0x80 + orrs r0, r2 + orrs r0, r3 + b _0800D910 + .align 2, 0 +_0800D908: .4byte gUnknown_202DCF8 +_0800D90C: + adds r0, r3, 0 + orrs r0, r2 +_0800D910: + adds r2, r0, 0 + ldrb r0, [r7, 0x9] + cmp r0, 0 + beq _0800D91E + movs r0, 0x80 + lsls r0, 5 + orrs r2, r0 +_0800D91E: + ldrb r0, [r7, 0xA] + lsrs r0, 3 + lsls r1, r0, 15 + lsls r0, r6, 26 + lsrs r0, 30 + cmp r0, 0x1 + bls _0800D936 + movs r0, 0x80 + lsls r0, 6 + orrs r0, r1 + orrs r0, r2 + b _0800D93A +_0800D936: + adds r0, r2, 0 + orrs r0, r1 +_0800D93A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_800D820 + + thumb_func_start sub_800D944 +sub_800D944: + push {r4,r5,lr} + movs r5, 0 + ldr r4, _0800D9AC + ldr r2, [r4, 0x28] + ldrb r1, [r4, 0xB] + strb r1, [r2] + ldr r3, [r4, 0x28] + ldrb r1, [r4, 0x2] + ldrb r2, [r4, 0x3] + eors r1, r2 + strb r1, [r3, 0x1] + ldr r1, [r4, 0x28] + strh r5, [r1, 0x2] + ldr r1, [r4, 0x28] + adds r1, 0x4 + ldr r2, _0800D9B0 + bl CpuSet + movs r2, 0 + ldr r1, [r4, 0x28] +_0800D96C: + ldrh r0, [r1] + adds r5, r0 + adds r1, 0x2 + adds r2, 0x1 + cmp r2, 0x9 + bls _0800D96C + adds r2, r4, 0 + ldr r1, [r2, 0x28] + mvns r0, r5 + subs r0, 0xC + strh r0, [r1, 0x2] + ldrb r0, [r2] + cmp r0, 0 + beq _0800D98E + ldr r1, _0800D9B4 + movs r0, 0 + strh r0, [r1] +_0800D98E: + movs r0, 0x1 + negs r0, r0 + str r0, [r4, 0x14] + ldrb r0, [r4] + cmp r0, 0 + beq _0800D9A6 + ldrb r0, [r4, 0x8] + cmp r0, 0 + beq _0800D9A6 + ldr r1, _0800D9B4 + movs r0, 0xC0 + strh r0, [r1] +_0800D9A6: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0800D9AC: .4byte gUnknown_202DCF8 +_0800D9B0: .4byte 0x04000004 +_0800D9B4: .4byte 0x0400010e + thumb_func_end sub_800D944 + + thumb_func_start sub_800D9B8 +sub_800D9B8: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + str r0, [sp, 0x8] + ldr r0, _0800DA68 + bl _call_via_r0 + str r0, [sp] + ldr r1, _0800DA6C + movs r0, 0 + strb r0, [r1, 0x3] + movs r6, 0 + add r0, sp, 0x4 + mov r10, r0 + mov r9, r1 + movs r1, 0x50 + add r1, r9 + mov r8, r1 +_0800D9E2: + movs r3, 0 + movs r2, 0 + lsls r5, r6, 2 + mov r0, sp + adds r4, r0, r6 + adds r7, r6, 0x1 + mov r1, r8 + adds r0, r5, r1 + ldr r1, [r0] +_0800D9F4: + ldrh r0, [r1] + adds r3, r0 + adds r1, 0x2 + adds r2, 0x1 + cmp r2, 0x9 + bls _0800D9F4 + ldrb r0, [r4] + cmp r0, 0 + beq _0800DA32 + lsls r0, r3, 16 + asrs r0, 16 + movs r2, 0xD + negs r2, r2 + cmp r0, r2 + bne _0800DA32 + mov r1, r8 + adds r0, r5, r1 + ldr r0, [r0] + adds r0, 0x4 + lsls r1, r6, 4 + ldr r2, [sp, 0x8] + adds r1, r2, r1 + ldr r2, _0800DA70 + bl CpuSet + movs r0, 0x1 + lsls r0, r6 + mov r2, r9 + ldrb r1, [r2, 0x3] + orrs r0, r1 + strb r0, [r2, 0x3] +_0800DA32: + movs r0, 0 + str r0, [sp, 0x4] + mov r1, r8 + adds r0, r5, r1 + ldr r1, [r0] + adds r1, 0x4 + mov r0, r10 + ldr r2, _0800DA74 + bl CpuSet + adds r6, r7, 0 + cmp r6, 0x1 + ble _0800D9E2 + ldr r1, _0800DA6C + ldrb r0, [r1, 0x2] + ldrb r2, [r1, 0x3] + orrs r0, r2 + strb r0, [r1, 0x2] + ldrb r0, [r1, 0x3] + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0800DA68: .4byte gUnknown_202DB78 +_0800DA6C: .4byte gUnknown_202DCF8 +_0800DA70: .4byte 0x04000004 +_0800DA74: .4byte 0x05000004 + thumb_func_end sub_800D9B8 + + thumb_func_start nullsub_189 +nullsub_189: + bx lr + thumb_func_end nullsub_189 + + thumb_func_start nullsub_190 +nullsub_190: + bx lr + thumb_func_end nullsub_190 + + thumb_func_start nullsub_191 +nullsub_191: + bx lr + thumb_func_end nullsub_191 + + thumb_func_start nullsub_192 +nullsub_192: + bx lr + thumb_func_end nullsub_192 + + thumb_func_start nullsub_193 +nullsub_193: + bx lr + thumb_func_end nullsub_193 + + thumb_func_start nullsub_194 +nullsub_194: + bx lr + thumb_func_end nullsub_194 + + thumb_func_start nullsub_195 +nullsub_195: + bx lr + thumb_func_end nullsub_195 + + thumb_func_start sub_800DA94 +sub_800DA94: + movs r0, 0 + bx lr + thumb_func_end sub_800DA94 + + thumb_func_start sub_800DA98 +sub_800DA98: + movs r0, 0 + bx lr + thumb_func_end sub_800DA98 + + thumb_func_start sub_800DA9C +sub_800DA9C: + movs r0, 0 + bx lr + thumb_func_end sub_800DA9C + + thumb_func_start nullsub_196 +nullsub_196: + bx lr + thumb_func_end nullsub_196 + + thumb_func_start nullsub_197 +nullsub_197: + bx lr + thumb_func_end nullsub_197 + + thumb_func_start nullsub_198 +nullsub_198: + bx lr + thumb_func_end nullsub_198 + + thumb_func_start sub_800DAAC +sub_800DAAC: + movs r0, 0 + bx lr + thumb_func_end sub_800DAAC + + thumb_func_start sub_800DAB0 +sub_800DAB0: + movs r0, 0 + bx lr + thumb_func_end sub_800DAB0 + + thumb_func_start sub_800DAB4 +sub_800DAB4: + movs r0, 0 + bx lr + thumb_func_end sub_800DAB4 + + thumb_func_start sub_800DAB8 +sub_800DAB8: + movs r0, 0 + bx lr + thumb_func_end sub_800DAB8 + + thumb_func_start sub_800DABC +sub_800DABC: + movs r0, 0 + bx lr + thumb_func_end sub_800DABC + + thumb_func_start sub_800DAC0 +sub_800DAC0: + push {r4-r6,lr} + adds r6, r0, 0 + ldr r5, _0800DB38 + ldr r0, [r5] + cmp r0, 0 + beq _0800DAD0 + bl sub_800DB7C +_0800DAD0: + ldr r4, _0800DB3C + adds r0, r4, 0 + movs r1, 0xB + bl MemoryAlloc + str r0, [r5] + adds r1, r4, 0 + bl MemoryClear8 + ldr r1, [r5] + ldr r2, _0800DB40 + adds r0, r1, r2 + str r6, [r0] + movs r2, 0x1 + negs r2, r2 + movs r0, 0x1F +_0800DAF0: + str r2, [r1, 0x4] + subs r0, 0x1 + adds r1, 0xD0 + cmp r0, 0 + bge _0800DAF0 + adds r0, r6, 0 + bl sub_800ED38 + bl sub_800F034 + ldr r0, _0800DB38 + ldr r0, [r0] + ldr r1, _0800DB40 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + beq _0800DB4C + cmp r0, 0x1 + bne _0800DB6C + ldr r0, _0800DB44 + ldr r1, _0800DB48 + bl sub_800AA08 + adds r4, r0, 0 + cmp r4, 0 + beq _0800DB6C + movs r1, 0x92 + lsls r1, 2 + movs r2, 0x1F + movs r3, 0 + bl sub_8005610 + adds r0, r4, 0 + bl sub_800AA14 + b _0800DB6C + .align 2, 0 +_0800DB38: .4byte gUnknown_203B0CC +_0800DB3C: .4byte 0x00001a18 +_0800DB40: .4byte 0x00001a04 +_0800DB44: .4byte gUnknown_80B9C6C +_0800DB48: .4byte 0x09740000 +_0800DB4C: + ldr r0, _0800DB74 + ldr r1, _0800DB78 + bl sub_800AA08 + adds r4, r0, 0 + cmp r4, 0 + beq _0800DB6C + movs r1, 0x92 + lsls r1, 2 + movs r2, 0x1F + movs r3, 0 + bl sub_8005610 + adds r0, r4, 0 + bl sub_800AA14 +_0800DB6C: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0800DB74: .4byte gUnknown_80B9C74 +_0800DB78: .4byte 0x09740000 + thumb_func_end sub_800DAC0 + + thumb_func_start sub_800DB7C +sub_800DB7C: + push {r4-r6,lr} + ldr r0, _0800DBB8 + ldr r4, [r0] + movs r6, 0x1 + negs r6, r6 + movs r5, 0x1F +_0800DB88: + ldr r0, [r4, 0x4] + cmp r0, r6 + beq _0800DB92 + bl sub_800DC14 +_0800DB92: + subs r5, 0x1 + adds r4, 0xD0 + cmp r5, 0 + bge _0800DB88 + bl sub_800F078 + bl sub_800ED64 + ldr r4, _0800DBB8 + ldr r0, [r4] + cmp r0, 0 + beq _0800DBB2 + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0800DBB2: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0800DBB8: .4byte gUnknown_203B0CC + thumb_func_end sub_800DB7C + + thumb_func_start sub_800DBBC +sub_800DBBC: + push {r4-r6,lr} + ldr r0, _0800DBFC + ldr r4, [r0] + movs r6, 0x1 + negs r6, r6 + movs r5, 0x1F +_0800DBC8: + ldr r0, [r4, 0x4] + cmp r0, r6 + beq _0800DBD2 + bl sub_800DC14 +_0800DBD2: + subs r5, 0x1 + adds r4, 0xD0 + cmp r5, 0 + bge _0800DBC8 + ldr r0, _0800DBFC + ldr r0, [r0] + movs r2, 0x1 + negs r2, r2 + movs r1, 0x1F +_0800DBE4: + str r2, [r0, 0x4] + subs r1, 0x1 + adds r0, 0xD0 + cmp r1, 0 + bge _0800DBE4 + bl sub_800ED80 + bl sub_800F094 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0800DBFC: .4byte gUnknown_203B0CC + thumb_func_end sub_800DBBC + + thumb_func_start sub_800DC00 +sub_800DC00: + push {lr} + ldr r0, _0800DC10 + ldr r0, [r0] + cmp r0, 0 + beq _0800DC0C + movs r0, 0x1 +_0800DC0C: + pop {r1} + bx r1 + .align 2, 0 +_0800DC10: .4byte gUnknown_203B0CC + thumb_func_end sub_800DC00 + + thumb_func_start sub_800DC14 +sub_800DC14: + push {r4,r5,lr} + bl sub_800E2C0 + adds r1, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0800DC96 + ldr r2, _0800DC60 + movs r0, 0xD0 + muls r1, r0 + ldr r0, [r2] + adds r5, r0, r1 + ldr r0, [r5, 0x34] + cmp r0, 0x4 + bne _0800DC56 + bl sub_8009BE4 + bl sub_8000728 + cmp r0, 0x1 + bne _0800DC56 + bl sub_8040238 + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + movs r0, 0x80 + lsls r0, 8 + movs r1, 0 + bl sub_800CD64 +_0800DC56: + ldr r0, [r5, 0x34] + cmp r0, 0x3 + bne _0800DC82 + movs r4, 0 + b _0800DC66 + .align 2, 0 +_0800DC60: .4byte gUnknown_203B0CC +_0800DC64: + adds r4, 0x1 +_0800DC66: + cmp r4, 0x1 + bgt _0800DC90 + adds r0, r4, 0 + bl sub_800F18C + adds r2, r0, 0 + ldr r1, [r2] + ldr r0, [r5, 0x38] + cmp r1, r0 + bne _0800DC64 + ldr r0, [r2, 0x4] + subs r0, 0x1 + str r0, [r2, 0x4] + b _0800DC90 +_0800DC82: + movs r0, 0x1 + bl sub_800F18C + movs r1, 0 + str r1, [r0, 0x4] + subs r1, 0x1 + str r1, [r0] +_0800DC90: + adds r0, r5, 0 + bl sub_800DCA8 +_0800DC96: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_800DC14 + + thumb_func_start sub_800DC9C +sub_800DC9C: + push {lr} + bl sub_800E900 + pop {r1} + bx r1 + thumb_func_end sub_800DC9C + + thumb_func_start sub_800DCA8 +sub_800DCA8: + push {r4,r5,lr} + movs r1, 0x1 + negs r1, r1 + str r1, [r0, 0x4] + adds r1, r0, 0 + adds r1, 0x54 + movs r5, 0 + strb r5, [r1] + adds r4, r0, 0 + adds r4, 0xB8 + ldr r0, [r4] + cmp r0, 0 + beq _0800DCC8 + bl sub_800F204 + str r5, [r4] +_0800DCC8: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_800DCA8 + + thumb_func_start sub_800DCD0 +sub_800DCD0: + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, [r4, 0x4C] + movs r5, 0x1 + negs r5, r5 + cmp r0, r5 + beq _0800DCFA + ldr r0, [r4, 0x50] + cmp r0, 0 + bne _0800DCFA + bl sub_8000728 + cmp r0, 0x2 + beq _0800DCF6 + ldr r0, [r4, 0x4C] + lsls r0, 16 + lsrs r0, 16 + bl sub_8011988 +_0800DCF6: + str r5, [r4, 0x4C] + str r5, [r4, 0x50] +_0800DCFA: + ldr r0, [r4, 0x50] + cmp r0, 0 + ble _0800DD04 + subs r0, 0x1 + str r0, [r4, 0x50] +_0800DD04: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_800DCD0 + + thumb_func_start sub_800DD0C +sub_800DD0C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r5, r0, 0 + adds r6, r1, 0 + movs r0, 0x58 + adds r0, r5 + mov r8, r0 + ldrh r1, [r0] + movs r0, 0x80 + lsls r0, 6 + ands r0, r1 + cmp r0, 0 + beq _0800DD2E + movs r0, 0 + b _0800DD30 +_0800DD2E: + lsrs r0, r1, 15 +_0800DD30: + cmp r0, 0 + bne _0800DD64 + adds r0, r5, 0 + bl sub_800DCA8 + ldr r0, [r5, 0x34] + cmp r0, 0x3 + bne _0800DD60 + movs r4, 0 + b _0800DD46 +_0800DD44: + adds r4, 0x1 +_0800DD46: + cmp r4, 0x1 + bgt _0800DD60 + adds r0, r4, 0 + bl sub_800F18C + adds r2, r0, 0 + ldr r1, [r2] + ldr r0, [r5, 0x38] + cmp r1, r0 + bne _0800DD44 + ldr r0, [r2, 0x4] + subs r0, 0x1 + str r0, [r2, 0x4] +_0800DD60: + movs r0, 0 + b _0800DE28 +_0800DD64: + mov r0, r8 + bl sub_80054BC + movs r4, 0 + ldr r0, [r5, 0x8] + movs r1, 0x7 + ands r0, r1 + cmp r0, 0 + bne _0800DD88 + ldr r0, [r5, 0x14] + cmp r0, 0x5 + bgt _0800DD84 + cmp r0, 0x3 + blt _0800DD84 + subs r4, 0x3 + b _0800DD8A +_0800DD84: + adds r4, 0x3 + b _0800DD8A +_0800DD88: + movs r4, 0x3 +_0800DD8A: + movs r2, 0 + ldr r1, [r5, 0x20] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0800DD9E + ldrh r0, [r5, 0x1E] + lsls r0, 16 + ldrh r2, [r5, 0x1C] + orrs r2, r0 +_0800DD9E: + lsls r0, r2, 16 + asrs r1, r0, 16 + adds r7, r0, 0 + cmp r1, 0x63 + beq _0800DE26 + asrs r0, r2, 16 + adds r2, r0, 0 + cmp r2, 0x63 + beq _0800DE26 + ldr r3, [r5, 0x24] + ldr r0, _0800DE34 + cmp r3, r0 + bne _0800DDCA + movs r1, 0x1A + ldrsh r0, [r5, r1] + movs r3, 0x2 + ldrsh r1, [r6, r3] + subs r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + adds r3, r0, r4 +_0800DDCA: + movs r4, 0x18 + ldrsh r0, [r5, r4] + movs r4, 0 + ldrsh r1, [r6, r4] + subs r0, r1 + asrs r1, r7, 16 + adds r4, r0, r1 + movs r7, 0x1A + ldrsh r0, [r5, r7] + movs r7, 0x2 + ldrsh r1, [r6, r7] + subs r0, r1 + adds r2, r0, r2 + adds r0, r5, 0 + adds r0, 0xCC + ldrh r0, [r0] + ldrh r1, [r5, 0x18] + adds r0, r1 + strh r0, [r5, 0x18] + adds r0, r5, 0 + adds r0, 0xCE + ldrh r0, [r0] + ldrh r7, [r5, 0x1A] + adds r0, r7 + strh r0, [r5, 0x1A] + adds r1, r4, 0 + adds r1, 0x3F + movs r0, 0xB7 + lsls r0, 1 + cmp r1, r0 + bhi _0800DE26 + movs r0, 0x40 + negs r0, r0 + cmp r2, r0 + ble _0800DE26 + cmp r2, 0xDF + bgt _0800DE26 + ldr r0, [r5, 0x3C] + str r0, [sp] + adds r0, r5, 0 + adds r0, 0x28 + str r0, [sp, 0x4] + mov r0, r8 + adds r1, r4, 0 + bl sub_800558C +_0800DE26: + movs r0, 0x1 +_0800DE28: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0800DE34: .4byte 0x0000ffff + thumb_func_end sub_800DD0C + + thumb_func_start sub_800DE38 +sub_800DE38: + push {r4,r5,lr} + adds r5, r0, 0 + adds r0, 0x58 + ldrh r1, [r0] + movs r0, 0x80 + lsls r0, 6 + ands r0, r1 + cmp r0, 0 + beq _0800DE4E + movs r0, 0 + b _0800DE50 +_0800DE4E: + lsrs r0, r1, 15 +_0800DE50: + cmp r0, 0 + bne _0800DE84 + adds r0, r5, 0 + bl sub_800DCA8 + ldr r0, [r5, 0x34] + cmp r0, 0x3 + bne _0800DE80 + movs r4, 0 + b _0800DE66 +_0800DE64: + adds r4, 0x1 +_0800DE66: + cmp r4, 0x1 + bgt _0800DE80 + adds r0, r4, 0 + bl sub_800F18C + adds r2, r0, 0 + ldr r1, [r2] + ldr r0, [r5, 0x38] + cmp r1, r0 + bne _0800DE64 + ldr r0, [r2, 0x4] + subs r0, 0x1 + str r0, [r2, 0x4] +_0800DE80: + movs r0, 0 + b _0800DE86 +_0800DE84: + movs r0, 0x1 +_0800DE86: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_800DE38 + + thumb_func_start sub_800DE8C +sub_800DE8C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + adds r6, r0, 0 + movs r0, 0x94 + adds r0, r6 + mov r8, r0 + ldr r4, [r0, 0x18] + cmp r4, 0 + beq _0800DEA4 + b _0800E09C +_0800DEA4: + ldr r1, [r0, 0x14] + movs r7, 0x1 + str r7, [sp] + adds r0, r6, 0 + adds r0, 0xAC + str r0, [sp, 0x4] + add r2, sp, 0xC + str r2, [sp, 0x8] + mov r0, r8 + movs r2, 0 + movs r3, 0 + bl sub_8009A7C + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0800DEC8 + b _0800E030 +_0800DEC8: + add r0, sp, 0xC + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _0800DEE8 + adds r0, r6, 0 + adds r0, 0xB4 + strb r7, [r0] + ldr r0, _0800DF0C + ldr r0, [r0] + ldr r2, _0800DF10 + adds r1, r0, r2 + str r4, [r1] + ldr r1, _0800DF14 + adds r0, r1 + str r4, [r0] +_0800DEE8: + add r0, sp, 0xC + ldrh r0, [r0, 0x2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + beq _0800DF6C + cmp r0, 0x63 + bne _0800DF1C + ldr r0, _0800DF0C + ldr r0, [r0] + ldr r1, _0800DF10 + adds r2, r0, r1 + ldr r1, _0800DF18 + str r1, [r2] + ldr r2, _0800DF14 + adds r0, r2 + str r4, [r0] + b _0800DF6C + .align 2, 0 +_0800DF0C: .4byte gUnknown_203B0CC +_0800DF10: .4byte 0x00001a08 +_0800DF14: .4byte 0x00001a0c +_0800DF18: .4byte 0x00000c1c +_0800DF1C: + cmp r0, 0 + ble _0800DF50 + ldr r0, _0800DF40 + ldr r4, [r0] + ldr r0, _0800DF44 + adds r5, r4, r0 + ldr r1, _0800DF48 + adds r4, r1 + add r0, sp, 0xC + movs r2, 0x2 + ldrsh r1, [r0, r2] + ldr r0, _0800DF4C + bl __divsi3 + str r0, [r4] + str r0, [r5] + b _0800DF6C + .align 2, 0 +_0800DF40: .4byte gUnknown_203B0CC +_0800DF44: .4byte 0x00001a08 +_0800DF48: .4byte 0x00001a0c +_0800DF4C: .4byte 0x00000c1c +_0800DF50: + ldr r0, _0800DFA4 + ldr r4, [r0] + ldr r0, _0800DFA8 + adds r1, r4, r0 + ldr r0, _0800DFAC + str r0, [r1] + ldr r1, _0800DFB0 + adds r4, r1 + add r1, sp, 0xC + movs r2, 0x2 + ldrsh r1, [r1, r2] + bl __divsi3 + str r0, [r4] +_0800DF6C: + mov r0, r8 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0 + bne _0800DF78 + b _0800E094 +_0800DF78: + ldr r0, _0800DFA4 + ldr r1, [r0] + ldr r2, _0800DFB4 + adds r0, r1, r2 + ldr r0, [r0] + cmp r0, 0 + beq _0800DFB8 + cmp r0, 0x1 + bne _0800DFEA + adds r0, r6, 0 + adds r0, 0xB8 + ldr r0, [r0] + ldr r0, [r0, 0x4] + ldr r1, [r0, 0x10] + movs r0, 0xE0 + lsls r0, 2 + adds r1, r0 + movs r0, 0xE0 + movs r2, 0x10 + bl sub_809971C + b _0800DFEA + .align 2, 0 +_0800DFA4: .4byte gUnknown_203B0CC +_0800DFA8: .4byte 0x00001a08 +_0800DFAC: .4byte 0x00000c1c +_0800DFB0: .4byte 0x00001a0c +_0800DFB4: .4byte 0x00001a04 +_0800DFB8: + ldr r2, _0800E010 + adds r0, r1, r2 + ldr r0, [r0] + movs r1, 0x64 + bl __divsi3 + adds r7, r0, 0 + movs r4, 0 + adds r6, 0xB8 + movs r5, 0xE0 + lsls r5, 2 +_0800DFCE: + adds r0, r4, 0 + adds r0, 0xE0 + ldr r1, [r6] + ldr r1, [r1, 0x4] + ldr r1, [r1, 0x10] + adds r1, r5 + adds r2, r7, 0 + movs r3, 0 + bl SetBGPaletteBufferColorRGB + adds r5, 0x4 + adds r4, 0x1 + cmp r4, 0xF + ble _0800DFCE +_0800DFEA: + ldr r1, _0800E014 + ldr r2, _0800E018 + adds r0, r2, 0 + strh r0, [r1] + ldr r0, _0800E01C + ldr r0, [r0] + ldr r1, _0800E010 + adds r2, r0, r1 + adds r1, 0x4 + adds r0, r1 + ldr r1, [r2] + ldr r0, [r0] + adds r1, r0 + str r1, [r2] + cmp r1, 0 + bge _0800E020 + movs r0, 0 + str r0, [r2] + b _0800E094 + .align 2, 0 +_0800E010: .4byte 0x00001a08 +_0800E014: .4byte gUnknown_2026E4E +_0800E018: .4byte 0x00000a0a +_0800E01C: .4byte gUnknown_203B0CC +_0800E020: + ldr r0, _0800E02C + cmp r1, r0 + ble _0800E094 + str r0, [r2] + b _0800E094 + .align 2, 0 +_0800E02C: .4byte 0x00000c1c +_0800E030: + bl sub_8009BE4 + adds r0, r6, 0 + bl sub_800DCA8 + bl sub_8000728 + cmp r0, 0x1 + bne _0800E058 + bl sub_8040238 + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + movs r0, 0x80 + lsls r0, 8 + movs r1, 0 + bl sub_800CD64 +_0800E058: + ldr r4, _0800E084 + ldr r0, [r4] + ldr r2, _0800E088 + adds r0, r2 + ldr r0, [r0] + bl sub_800CDA8 + ldr r1, _0800E08C + ldr r0, [r4] + ldr r2, _0800E090 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + movs r0, 0x1 + bl sub_800F18C + str r5, [r0, 0x4] + movs r1, 0x1 + negs r1, r1 + str r1, [r0] + movs r0, 0 + b _0800E0A6 + .align 2, 0 +_0800E084: .4byte gUnknown_203B0CC +_0800E088: .4byte 0x00001a10 +_0800E08C: .4byte gUnknown_2026E4E +_0800E090: .4byte 0x00001a14 +_0800E094: + mov r1, r8 + ldr r0, [r1, 0x14] + adds r0, 0x1 + str r0, [r1, 0x14] +_0800E09C: + mov r2, r8 + ldr r0, [r2, 0x18] + subs r0, 0x1 + str r0, [r2, 0x18] + movs r0, 0x1 +_0800E0A6: + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_800DE8C + + thumb_func_start sub_800E0B4 +sub_800E0B4: + push {r4-r6,lr} + sub sp, 0x8 + adds r5, r0, 0 + ldr r0, [r5, 0xC] + bl sub_800ECA4 + adds r6, r0, 0 + ldr r0, [r6] + str r0, [r5, 0x34] + ldr r0, [r6, 0x4] + str r0, [r5, 0x38] + ldr r0, [r6, 0x10] + str r0, [r5, 0x4C] + ldr r0, [r5, 0x10] + ldr r1, [r6, 0x14] + adds r0, r1 + str r0, [r5, 0x50] + adds r0, r6, 0 + adds r0, 0x21 + ldrb r0, [r0] + adds r1, r5, 0 + adds r1, 0x55 + strb r0, [r1] + adds r0, r6, 0 + adds r0, 0x20 + ldrb r1, [r0] + adds r0, r5, 0 + adds r0, 0x54 + strb r1, [r0] + adds r0, 0x64 + ldr r0, [r0] + bl sub_800E2B8 + adds r2, r0, 0 + str r2, [r5, 0x8] + ldr r3, [r6, 0xC] + str r3, [r5, 0x40] + ldr r1, [r5, 0x14] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0800E114 + movs r0, 0x7 + ands r0, r2 + cmp r0, 0 + bne _0800E114 + adds r0, r3, r1 + str r0, [r5, 0x40] +_0800E114: + ldr r0, [r5, 0x34] + cmp r0, 0x3 + beq _0800E12E + cmp r0, 0x3 + bhi _0800E128 + cmp r0, 0x1 + bcc _0800E184 + movs r0, 0x92 + lsls r0, 2 + b _0800E132 +_0800E128: + cmp r0, 0x4 + beq _0800E140 + b _0800E184 +_0800E12E: + movs r0, 0xDC + lsls r0, 2 +_0800E132: + str r0, [r5, 0x48] + ldr r0, [r6, 0x8] + str r0, [r5, 0x3C] + movs r0, 0x1 + negs r0, r0 + str r0, [r5, 0x44] + b _0800E184 +_0800E140: + movs r0, 0x1 + negs r0, r0 + str r0, [r5, 0x48] + ldr r0, [r6, 0x8] + str r0, [r5, 0x3C] + movs r0, 0xF0 + lsls r0, 4 + str r0, [r5, 0x44] + ldr r4, _0800E194 + ldr r0, [r4] + ldr r2, _0800E198 + adds r1, r0, r2 + movs r2, 0 + str r2, [r1] + ldr r3, _0800E19C + adds r0, r3 + str r2, [r0] + bl sub_800CDC8 + ldr r2, [r4] + ldr r4, _0800E1A0 + adds r1, r2, r4 + str r0, [r1] + ldr r0, _0800E1A4 + ldrh r0, [r0] + ldr r1, _0800E1A8 + adds r2, r1 + strh r0, [r2] + ldrb r0, [r6, 0x18] + cmp r0, 0 + beq _0800E184 + movs r0, 0x5 + bl sub_800CDA8 +_0800E184: + ldr r0, [r5, 0x34] + cmp r0, 0x3 + beq _0800E1C2 + cmp r0, 0x3 + bls _0800E1AC + cmp r0, 0x4 + beq _0800E1E4 + b _0800E200 + .align 2, 0 +_0800E194: .4byte gUnknown_203B0CC +_0800E198: .4byte 0x00001a08 +_0800E19C: .4byte 0x00001a0c +_0800E1A0: .4byte 0x00001a10 +_0800E1A4: .4byte gUnknown_2026E4E +_0800E1A8: .4byte 0x00001a14 +_0800E1AC: + cmp r0, 0x1 + bcc _0800E200 + adds r0, r5, 0 + adds r0, 0x58 + adds r1, r5, 0 + adds r1, 0xB8 + ldr r1, [r1] + ldr r2, [r5, 0x40] + movs r3, 0x92 + lsls r3, 2 + b _0800E1D2 +_0800E1C2: + adds r0, r5, 0 + adds r0, 0x58 + adds r1, r5, 0 + adds r1, 0xB8 + ldr r1, [r1] + ldr r2, [r5, 0x40] + movs r3, 0xDC + lsls r3, 2 +_0800E1D2: + movs r4, 0 + str r4, [sp] + adds r4, r5, 0 + adds r4, 0x55 + ldrb r4, [r4] + str r4, [sp, 0x4] + bl sub_800543C + b _0800E200 +_0800E1E4: + adds r0, r5, 0 + adds r0, 0xB8 + ldr r0, [r0] + adds r1, r5, 0 + adds r1, 0x94 + ldr r0, [r0, 0x4] + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2,r3} + stm r1!, {r2,r3} + adds r1, r5, 0 + adds r1, 0xB4 + movs r0, 0 + strb r0, [r1] +_0800E200: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_800E0B4 + + thumb_func_start sub_800E208 +sub_800E208: + push {r4-r7,lr} + adds r7, r0, 0 + adds r6, r1, 0 + ldr r0, _0800E220 + ldr r4, [r0] + ldr r0, [r6] + cmp r0, 0 + bne _0800E224 +_0800E218: + movs r0, 0x1 + negs r0, r0 + b _0800E2B0 + .align 2, 0 +_0800E220: .4byte gUnknown_203B0CC +_0800E224: + movs r1, 0 +_0800E226: + ldr r5, [r4, 0x4] + movs r0, 0x1 + negs r0, r0 + cmp r5, r0 + bne _0800E2A8 + adds r0, r4, 0 + movs r1, 0xD0 + bl MemoryClear8 + ldr r0, [r6] + bl sub_800ECA4 + adds r1, r0, 0 + ldr r2, [r1] + cmp r2, 0x2 + bne _0800E254 + ldr r0, _0800E2A0 + ldr r0, [r0] + ldr r3, _0800E2A4 + adds r0, r3 + ldr r0, [r0] + cmp r0, 0x1 + bne _0800E218 +_0800E254: + cmp r2, 0x1 + bne _0800E266 + ldr r0, _0800E2A0 + ldr r0, [r0] + ldr r3, _0800E2A4 + adds r0, r3 + ldr r0, [r0] + cmp r0, 0 + bne _0800E218 +_0800E266: + ldr r1, [r1, 0x4] + adds r0, r2, 0 + bl sub_800F1C0 + adds r1, r4, 0 + adds r1, 0xB8 + str r0, [r1] + cmp r0, 0 + beq _0800E218 + str r7, [r4] + bl sub_800E2F0 + str r0, [r4, 0x4] + adds r1, r4, 0 + adds r1, 0xC + adds r0, r6, 0 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldr r0, [r0] + str r0, [r1] + adds r0, r4, 0 + bl sub_800E0B4 + ldr r0, [r4, 0x4] + b _0800E2B0 + .align 2, 0 +_0800E2A0: .4byte gUnknown_203B0CC +_0800E2A4: .4byte 0x00001a04 +_0800E2A8: + adds r1, 0x1 + adds r4, 0xD0 + cmp r1, 0x1F + ble _0800E226 +_0800E2B0: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_800E208 + + thumb_func_start sub_800E2B8 +sub_800E2B8: + ldr r0, [r0, 0x4] + ldr r0, [r0, 0x8] + bx lr + thumb_func_end sub_800E2B8 + + thumb_func_start sub_800E2C0 +sub_800E2C0: + push {lr} + adds r3, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r3, r0 + beq _0800E2E8 + ldr r0, _0800E2DC + ldr r1, [r0] + movs r2, 0 +_0800E2D2: + ldr r0, [r1, 0x4] + cmp r0, r3 + bne _0800E2E0 + adds r0, r2, 0 + b _0800E2EC + .align 2, 0 +_0800E2DC: .4byte gUnknown_203B0CC +_0800E2E0: + adds r2, 0x1 + adds r1, 0xD0 + cmp r2, 0x1F + ble _0800E2D2 +_0800E2E8: + movs r0, 0x1 + negs r0, r0 +_0800E2EC: + pop {r1} + bx r1 + thumb_func_end sub_800E2C0 + + thumb_func_start sub_800E2F0 +sub_800E2F0: + ldr r0, _0800E304 + ldr r1, [r0] + movs r0, 0xD0 + lsls r0, 5 + adds r1, r0 + ldr r0, [r1] + adds r2, r0, 0x1 + str r2, [r1] + bx lr + .align 2, 0 +_0800E304: .4byte gUnknown_203B0CC + thumb_func_end sub_800E2F0 + + thumb_func_start sub_800E308 +sub_800E308: + push {r4-r7,lr} + sub sp, 0x50 + adds r4, r0, 0 + adds r7, r1, 0 + ldrh r0, [r4] + bl sub_800ECB8 + movs r1, 0x6 + ldrsh r0, [r0, r1] + str r0, [sp, 0x28] + ldr r0, [r4, 0x10] + str r0, [sp, 0x2C] + ldr r0, [r4, 0xC] + str r0, [sp, 0x30] + ldr r0, [r4, 0x4] + str r0, [sp, 0x34] + ldr r0, [r4, 0x8] + str r0, [sp, 0x38] + movs r2, 0x2 + ldrsh r0, [r4, r2] + ldrh r1, [r4] + bl sub_800E750 + str r0, [sp, 0x3C] + ldr r0, _0800E3A0 + str r0, [sp, 0x40] + add r1, sp, 0x44 + ldr r0, _0800E3A4 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + add r1, sp, 0x28 + mov r0, sp + movs r2, 0x28 + bl memcpy + movs r0, 0x2 + mov r1, sp + bl sub_800E208 + adds r5, r0, 0 + movs r6, 0x1 + negs r6, r6 + cmp r5, r6 + beq _0800E396 + adds r0, r5, 0 + bl sub_800E2C0 + adds r1, r0, 0 + cmp r1, r6 + beq _0800E396 + ldr r2, _0800E3A8 + movs r0, 0xD0 + muls r1, r0 + ldr r0, [r2] + adds r2, r0, r1 + adds r1, r2, 0 + adds r1, 0xBC + ldr r0, [r4, 0x4] + str r0, [r1] + adds r1, 0x4 + ldr r0, [r7] + str r0, [r1] + ldrh r1, [r4, 0x2] + adds r0, r2, 0 + adds r0, 0xC4 + strh r1, [r0] + adds r1, r2, 0 + adds r1, 0xC8 + ldr r0, [r2, 0x1C] + str r0, [r1] + adds r0, r5, 0 +_0800E396: + add sp, 0x50 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0800E3A0: .4byte 0x0000ffff +_0800E3A4: .4byte gUnknown_80B9C60 +_0800E3A8: .4byte gUnknown_203B0CC + thumb_func_end sub_800E308 + + thumb_func_start sub_800E3AC +sub_800E3AC: + push {r4-r6,lr} + adds r4, r1, 0 + adds r6, r2, 0 + bl sub_800E2C0 + adds r1, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0800E43C + ldr r2, _0800E444 + movs r0, 0xD0 + muls r1, r0 + ldr r0, [r2] + adds r5, r0, r1 + ldr r0, [r4] + str r0, [r5, 0x18] + adds r0, r5, 0 + adds r0, 0xC0 + movs r2, 0 + ldrsh r1, [r0, r2] + subs r0, 0x4 + movs r3, 0 + ldrsh r0, [r0, r3] + subs r2, r1, r0 + cmp r2, 0 + bge _0800E3E4 + negs r2, r2 +_0800E3E4: + adds r0, r5, 0 + adds r0, 0xC2 + movs r3, 0 + ldrsh r1, [r0, r3] + subs r0, 0x4 + movs r3, 0 + ldrsh r0, [r0, r3] + subs r1, r0 + cmp r1, 0 + bge _0800E3FA + negs r1, r1 +_0800E3FA: + cmp r1, r2 + bge _0800E400 + adds r1, r2, 0 +_0800E400: + cmp r1, 0 + bge _0800E406 + adds r1, 0x3 +_0800E406: + asrs r4, r1, 2 + subs r1, r4, 0x1 + ldrh r0, [r5, 0x1E] + adds r0, 0x9 + strh r0, [r5, 0x1E] + movs r2, 0x1C + ldrsh r0, [r5, r2] + muls r0, r1 + strh r0, [r5, 0x1C] + movs r3, 0x1E + ldrsh r0, [r5, r3] + muls r0, r1 + strh r0, [r5, 0x1E] + movs r1, 0x1C + ldrsh r0, [r5, r1] + adds r1, r4, 0 + bl __divsi3 + strh r0, [r5, 0x1C] + movs r2, 0x1E + ldrsh r0, [r5, r2] + adds r1, r4, 0 + bl __divsi3 + subs r0, 0x9 + strh r0, [r5, 0x1E] + str r6, [r5, 0x24] +_0800E43C: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0800E444: .4byte gUnknown_203B0CC + thumb_func_end sub_800E3AC + + thumb_func_start sub_800E448 +sub_800E448: + push {r4,lr} + sub sp, 0x50 + adds r4, r1, 0 + lsls r0, 24 + lsrs r0, 24 + bl sub_800ECE4 + lsls r0, 16 + asrs r0, 16 + str r0, [sp, 0x28] + movs r2, 0 + str r2, [sp, 0x2C] + movs r1, 0x1 + negs r1, r1 + str r1, [sp, 0x30] + ldr r0, [r4] + str r0, [sp, 0x34] + str r2, [sp, 0x38] + str r1, [sp, 0x3C] + ldr r0, _0800E494 + str r0, [sp, 0x40] + add r1, sp, 0x44 + ldr r0, _0800E498 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + add r1, sp, 0x28 + mov r0, sp + movs r2, 0x28 + bl memcpy + movs r0, 0x3 + mov r1, sp + bl sub_800E208 + add sp, 0x50 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0800E494: .4byte 0x0000ffff +_0800E498: .4byte gUnknown_80B9C60 + thumb_func_end sub_800E448 + + thumb_func_start sub_800E49C +sub_800E49C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x50 + adds r7, r1, 0 + mov r8, r2 + lsls r0, 24 + lsrs r0, 24 + lsls r3, 24 + lsrs r6, r3, 24 + cmp r6, 0 + beq _0800E4BA + bl sub_800ECF8 + b _0800E4BE +_0800E4BA: + bl sub_800ED0C +_0800E4BE: + lsls r0, 16 + asrs r4, r0, 16 + adds r0, r4, 0 + bl sub_800E700 + adds r5, r0, 0 + str r4, [sp, 0x28] + movs r1, 0 + str r1, [sp, 0x2C] + movs r4, 0x1 + negs r4, r4 + str r4, [sp, 0x30] + ldr r0, [r7] + str r0, [sp, 0x34] + str r1, [sp, 0x38] + str r4, [sp, 0x3C] + str r1, [sp, 0x40] + add r1, sp, 0x44 + ldr r0, _0800E508 + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + add r1, sp, 0x28 + mov r0, sp + movs r2, 0x28 + bl memcpy + ldr r0, [sp, 0x68] + str r0, [sp, 0x18] + cmp r6, 0 + beq _0800E50C + cmp r5, r4 + beq _0800E516 + str r5, [sp, 0x14] + lsls r0, r5, 2 + add r0, r8 + ldr r0, [r0] + b _0800E514 + .align 2, 0 +_0800E508: .4byte gUnknown_80B9C60 +_0800E50C: + movs r0, 0x3 + str r0, [sp, 0x14] + mov r1, r8 + ldr r0, [r1, 0xC] +_0800E514: + str r0, [sp, 0x10] +_0800E516: + movs r0, 0x4 + mov r1, sp + bl sub_800E208 + add sp, 0x50 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_800E49C + + thumb_func_start sub_800E52C +sub_800E52C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1B0 + adds r7, r0, 0 + ldrh r0, [r7] + cmp r0, 0x52 + bne _0800E628 + mov r1, sp + ldr r0, _0800E618 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r4,r5} + stm r1!, {r4,r5} + movs r0, 0 + mov r10, r0 + mov r9, r0 + mov r8, sp + add r6, sp, 0x20 + adds r4, r6, 0 +_0800E55C: + ldrh r0, [r7] + bl sub_800ECB8 + movs r1, 0x2 + ldrsh r0, [r0, r1] + str r0, [r4] + ldr r0, [r7, 0x10] + str r0, [r4, 0x4] + ldr r0, [r7, 0xC] + str r0, [r4, 0x8] + ldr r0, [r7, 0x4] + str r0, [r4, 0xC] + ldrh r0, [r4, 0xE] + adds r0, 0x40 + strh r0, [r4, 0xE] + ldr r0, [r7, 0x8] + str r0, [r4, 0x10] + mov r2, r8 + ldrh r0, [r2] + ldrh r3, [r4, 0x10] + adds r0, r3 + strh r0, [r4, 0x10] + ldrh r0, [r4, 0x12] + subs r0, 0x40 + ldrh r5, [r2, 0x2] + adds r0, r5 + strh r0, [r4, 0x12] + movs r1, 0x2 + ldrsh r0, [r7, r1] + ldrh r1, [r7] + bl sub_800E750 + str r0, [r4, 0x14] + ldr r0, _0800E61C + str r0, [r4, 0x18] + adds r1, r6, 0 + adds r1, 0x1C + ldr r0, _0800E620 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + movs r0, 0x1 + adds r1, r6, 0 + bl sub_800E208 + adds r5, r0, 0 + bl sub_800E2C0 + adds r1, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0800E5D4 + ldr r2, _0800E624 + movs r0, 0xD0 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + adds r0, 0xCC + movs r1, 0x6 + strh r1, [r0] +_0800E5D4: + mov r0, r9 + cmp r0, 0 + bne _0800E5DC + mov r10, r5 +_0800E5DC: + movs r1, 0x4 + add r8, r1 + adds r4, 0x28 + adds r6, 0x28 + movs r2, 0x1 + add r9, r2 + mov r3, r9 + cmp r3, 0x7 + ble _0800E55C + movs r4, 0x6 + mov r9, r4 +_0800E5F2: + ldrh r0, [r7] + bl sub_800ECB8 + movs r5, 0x2 + ldrsh r0, [r0, r5] + bl sub_800ECA4 + ldr r0, [r0, 0x4] + bl sub_800F15C + movs r0, 0x1 + negs r0, r0 + add r9, r0 + mov r1, r9 + cmp r1, 0 + bge _0800E5F2 + mov r0, r10 + b _0800E67E + .align 2, 0 +_0800E618: .4byte gUnknown_80B9C7C +_0800E61C: .4byte 0x0000ffff +_0800E620: .4byte gUnknown_80B9C60 +_0800E624: .4byte gUnknown_203B0CC +_0800E628: + add r6, sp, 0x160 + add r5, sp, 0x188 + ldrh r0, [r7] + bl sub_800ECB8 + movs r2, 0x2 + ldrsh r0, [r0, r2] + str r0, [r5] + add r1, sp, 0x18C + ldr r0, [r7, 0x10] + str r0, [r1] + add r1, sp, 0x190 + ldr r0, [r7, 0xC] + str r0, [r1] + add r1, sp, 0x194 + ldr r0, [r7, 0x4] + str r0, [r1] + add r1, sp, 0x198 + ldr r0, [r7, 0x8] + str r0, [r1] + add r4, sp, 0x19C + movs r3, 0x2 + ldrsh r0, [r7, r3] + ldrh r1, [r7] + bl sub_800E750 + str r0, [r4] + add r1, sp, 0x1A0 + ldr r0, _0800E690 + str r0, [r1] + add r1, sp, 0x1A4 + ldr r0, _0800E694 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + adds r0, r6, 0 + adds r1, r5, 0 + movs r2, 0x28 + bl memcpy + movs r0, 0x1 + adds r1, r6, 0 + bl sub_800E208 +_0800E67E: + add sp, 0x1B0 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0800E690: .4byte 0x0000ffff +_0800E694: .4byte gUnknown_80B9C60 + thumb_func_end sub_800E52C + + thumb_func_start sub_800E698 +sub_800E698: + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + bl sub_800E2C0 + adds r1, r0, 0 + movs r3, 0x1 + negs r3, r3 + cmp r1, r3 + beq _0800E6D2 + ldr r2, _0800E6C8 + movs r0, 0xD0 + muls r1, r0 + ldr r0, [r2] + adds r1, r0, r1 + ldr r0, [r4] + str r0, [r1, 0x18] + ldr r0, [r1, 0x20] + cmp r0, r3 + beq _0800E6CC + ldr r0, [r5] + str r0, [r1, 0x1C] + b _0800E6D2 + .align 2, 0 +_0800E6C8: .4byte gUnknown_203B0CC +_0800E6CC: + movs r0, 0 + strh r0, [r1, 0x1C] + strh r0, [r1, 0x1E] +_0800E6D2: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_800E698 + + thumb_func_start sub_800E6D8 +sub_800E6D8: + push {lr} + bl sub_800E2C0 + adds r1, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _0800E6EC + adds r0, r1, 0 + b _0800E6F8 +_0800E6EC: + ldr r2, _0800E6FC + movs r0, 0xD0 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + ldr r0, [r0, 0x20] +_0800E6F8: + pop {r1} + bx r1 + .align 2, 0 +_0800E6FC: .4byte gUnknown_203B0CC + thumb_func_end sub_800E6D8 + + thumb_func_start sub_800E700 +sub_800E700: + push {lr} + lsls r0, 16 + asrs r0, 16 + bl sub_800E900 + pop {r1} + bx r1 + thumb_func_end sub_800E700 + + thumb_func_start sub_800E710 +sub_800E710: + push {r4-r6,lr} + lsls r0, 16 + asrs r5, r0, 16 + lsls r1, 16 + lsrs r1, 16 + adds r0, r1, 0 + bl sub_800ECB8 + adds r4, r0, 0 + ldr r0, [r4, 0x20] + bl sub_800ECD0 + adds r1, r0, 0 + movs r2, 0 + ldr r0, [r4, 0x1C] + cmp r2, r0 + bge _0800E748 + adds r3, r0, 0 +_0800E734: + movs r6, 0 + ldrsh r0, [r1, r6] + cmp r0, r5 + bne _0800E740 + ldr r0, [r1, 0x4] + b _0800E74A +_0800E740: + adds r2, 0x1 + adds r1, 0xC + cmp r2, r3 + blt _0800E734 +_0800E748: + ldr r0, [r4, 0x14] +_0800E74A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_800E710 + + thumb_func_start sub_800E750 +sub_800E750: + push {r4-r6,lr} + lsls r0, 16 + asrs r5, r0, 16 + lsls r1, 16 + lsrs r1, 16 + adds r0, r1, 0 + bl sub_800ECB8 + adds r4, r0, 0 + ldr r0, [r4, 0x20] + bl sub_800ECD0 + adds r1, r0, 0 + movs r2, 0 + ldr r0, [r4, 0x1C] + cmp r2, r0 + bge _0800E788 + adds r3, r0, 0 +_0800E774: + movs r6, 0 + ldrsh r0, [r1, r6] + cmp r0, r5 + bne _0800E780 + ldr r0, [r1, 0x4] + b _0800E78A +_0800E780: + adds r2, 0x1 + adds r1, 0xC + cmp r2, r3 + blt _0800E774 +_0800E788: + ldr r0, [r4, 0x14] +_0800E78A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_800E750 + + thumb_func_start sub_800E790 +sub_800E790: + push {r4-r6,lr} + lsls r0, 16 + asrs r5, r0, 16 + lsls r1, 16 + lsrs r1, 16 + adds r0, r1, 0 + bl sub_800ECB8 + adds r4, r0, 0 + ldr r0, [r4, 0x20] + bl sub_800ECD0 + adds r1, r0, 0 + movs r2, 0 + ldr r0, [r4, 0x1C] + cmp r2, r0 + bge _0800E7C8 + adds r3, r0, 0 +_0800E7B4: + movs r6, 0 + ldrsh r0, [r1, r6] + cmp r0, r5 + bne _0800E7C0 + ldr r0, [r1, 0x8] + b _0800E7CA +_0800E7C0: + adds r2, 0x1 + adds r1, 0xC + cmp r2, r3 + blt _0800E7B4 +_0800E7C8: + ldr r0, [r4, 0x18] +_0800E7CA: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_800E790 + + thumb_func_start sub_800E7D0 +sub_800E7D0: + push {r4-r6,lr} + sub sp, 0x10 + adds r4, r0, 0 + movs r6, 0 + ldrh r0, [r4] + bl sub_800ECB8 + movs r1, 0 + ldrsh r0, [r0, r1] + str r0, [sp] + ldrh r0, [r4] + bl sub_800ECB8 + movs r1, 0x2 + ldrsh r0, [r0, r1] + str r0, [sp, 0x4] + ldrh r0, [r4] + bl sub_800ECB8 + movs r1, 0x4 + ldrsh r0, [r0, r1] + str r0, [sp, 0x8] + ldrh r0, [r4] + bl sub_800ECB8 + movs r1, 0x6 + ldrsh r0, [r0, r1] + str r0, [sp, 0xC] + movs r5, 0 + mov r4, sp + b _0800E812 +_0800E80E: + adds r4, 0x4 + adds r5, 0x1 +_0800E812: + cmp r5, 0x3 + bgt _0800E82C + ldr r0, [r4] + bl sub_800ECA4 + movs r1, 0 + ldr r0, [r0] + cmp r0, 0x4 + bne _0800E826 + movs r1, 0x1 +_0800E826: + adds r6, r1, 0 + cmp r6, 0 + beq _0800E80E +_0800E82C: + adds r0, r6, 0 + add sp, 0x10 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_800E7D0 + + thumb_func_start sub_800E838 +sub_800E838: + push {r4,r5,lr} + sub sp, 0x10 + adds r4, r0, 0 + adds r5, r1, 0 + ldrh r0, [r4] + bl sub_800ECB8 + movs r1, 0 + ldrsh r0, [r0, r1] + str r0, [sp] + ldrh r0, [r4] + bl sub_800ECB8 + movs r1, 0x2 + ldrsh r0, [r0, r1] + str r0, [sp, 0x4] + ldrh r0, [r4] + bl sub_800ECB8 + movs r1, 0x4 + ldrsh r0, [r0, r1] + str r0, [sp, 0x8] + ldrh r0, [r4] + bl sub_800ECB8 + movs r1, 0x6 + ldrsh r0, [r0, r1] + str r0, [sp, 0xC] + lsls r5, 2 + mov r1, sp + adds r0, r1, r5 + ldr r0, [r0] + bl sub_800ECA4 + movs r1, 0 + ldr r0, [r0] + cmp r0, 0x4 + bne _0800E886 + movs r1, 0x1 +_0800E886: + adds r0, r1, 0 + add sp, 0x10 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_800E838 + + thumb_func_start sub_800E890 +sub_800E890: + push {r4,lr} + adds r4, r0, 0 + ldr r0, [r4] + bl sub_800E900 + str r0, [r4, 0x14] + movs r0, 0x7 + adds r1, r4, 0 + bl sub_800E208 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_800E890 + + thumb_func_start sub_800E8AC +sub_800E8AC: + push {r4-r7,lr} + adds r4, r1, 0 + adds r5, r2, 0 + adds r6, r3, 0 + ldr r7, [sp, 0x14] + bl sub_800E2C0 + adds r1, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0800E8F2 + ldr r2, _0800E8F8 + movs r0, 0xD0 + muls r1, r0 + ldr r0, [r2] + adds r1, r0, r1 + cmp r4, 0 + beq _0800E8D6 + ldr r0, [r4] + str r0, [r1, 0x18] +_0800E8D6: + cmp r5, 0 + beq _0800E8DE + ldr r0, [r5] + str r0, [r1, 0x1C] +_0800E8DE: + ldr r0, _0800E8FC + cmp r6, r0 + beq _0800E8E6 + str r6, [r1, 0x24] +_0800E8E6: + cmp r7, 0 + beq _0800E8F2 + adds r1, 0x28 + adds r0, r7, 0 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} +_0800E8F2: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0800E8F8: .4byte gUnknown_203B0CC +_0800E8FC: .4byte 0x0000ffff + thumb_func_end sub_800E8AC + + thumb_func_start sub_800E900 +sub_800E900: + push {lr} + bl sub_800ECA4 + ldr r0, [r0, 0x1C] + pop {r1} + bx r1 + thumb_func_end sub_800E900 + + thumb_func_start sub_800E90C +sub_800E90C: + push {r4-r7,lr} + adds r5, r0, 0 + movs r7, 0 + ldr r0, _0800E938 + ldr r4, [r0] + movs r6, 0x1F +_0800E918: + ldr r1, [r4, 0x4] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0800E960 + ldr r0, [r4, 0x10] + cmp r0, 0 + bgt _0800E94A + ldr r0, [r4, 0x34] + cmp r0, 0x4 + bne _0800E93C + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_800DE8C + b _0800E944 + .align 2, 0 +_0800E938: .4byte gUnknown_203B0CC +_0800E93C: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_800DD0C +_0800E944: + ldr r0, [r4, 0x10] + cmp r0, 0 + ble _0800E94E +_0800E94A: + subs r0, 0x1 + str r0, [r4, 0x10] +_0800E94E: + adds r0, r4, 0 + bl sub_800DCD0 + adds r0, r4, 0 + adds r0, 0x54 + ldrb r0, [r0] + cmp r0, 0 + bne _0800E960 + movs r7, 0x1 +_0800E960: + subs r6, 0x1 + adds r4, 0xD0 + cmp r6, 0 + bge _0800E918 + adds r0, r7, 0 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_800E90C + + thumb_func_start sub_800E970 +sub_800E970: + push {r4,r5,lr} + ldr r0, _0800E9A4 + ldr r4, [r0] + movs r5, 0x1F +_0800E978: + ldr r1, [r4, 0x4] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0800E994 + ldr r0, [r4, 0x10] + cmp r0, 0 + bgt _0800E994 + ldr r0, [r4, 0x34] + cmp r0, 0x4 + beq _0800E994 + adds r0, r4, 0 + bl sub_800DE38 +_0800E994: + subs r5, 0x1 + adds r4, 0xD0 + cmp r5, 0 + bge _0800E978 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0800E9A4: .4byte gUnknown_203B0CC + thumb_func_end sub_800E970 + + thumb_func_start sub_800E9A8 +sub_800E9A8: + push {lr} + adds r3, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r3, r0 + beq _0800E9DC + ldr r0, _0800E9D0 + ldr r1, [r0] + movs r2, 0 +_0800E9BA: + ldr r0, [r1, 0x4] + cmp r0, r3 + bne _0800E9D4 + adds r0, r1, 0 + adds r0, 0x54 + ldrb r0, [r0] + cmp r0, 0 + bne _0800E9DC + movs r0, 0x1 + b _0800E9DE + .align 2, 0 +_0800E9D0: .4byte gUnknown_203B0CC +_0800E9D4: + adds r2, 0x1 + adds r1, 0xD0 + cmp r2, 0x1F + ble _0800E9BA +_0800E9DC: + movs r0, 0 +_0800E9DE: + pop {r1} + bx r1 + thumb_func_end sub_800E9A8 + + thumb_func_start sub_800E9E4 +sub_800E9E4: + push {lr} + bl sub_800E2C0 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0800E9F6 + movs r0, 0 + b _0800E9F8 +_0800E9F6: + movs r0, 0x1 +_0800E9F8: + pop {r1} + bx r1 + thumb_func_end sub_800E9E4 + + thumb_func_start sub_800E9FC +sub_800E9FC: + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + ldr r0, _0800EA38 + ldr r1, [r0] + movs r2, 0 + movs r4, 0x1 + negs r4, r4 +_0800EA0C: + ldr r0, [r1, 0x4] + cmp r0, r4 + beq _0800EA20 + cmp r3, 0 + bne _0800EA3C + adds r0, r1, 0 + adds r0, 0x54 + ldrb r0, [r0] + cmp r0, 0 + beq _0800EA3C +_0800EA20: + adds r2, 0x1 + adds r1, 0xD0 + cmp r2, 0x1F + ble _0800EA0C + bl sub_800EC74 + lsls r0, 24 + cmp r0, 0 + bne _0800EA3C + movs r0, 0 + b _0800EA3E + .align 2, 0 +_0800EA38: .4byte gUnknown_203B0CC +_0800EA3C: + movs r0, 0x1 +_0800EA3E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_800E9FC + + thumb_func_start sub_800EA44 +sub_800EA44: + push {r4-r6,lr} + lsls r0, 16 + asrs r5, r0, 16 + lsls r1, 16 + lsrs r1, 16 + adds r0, r1, 0 + bl sub_800ECB8 + adds r4, r0, 0 + ldr r0, [r4, 0x20] + bl sub_800ECD0 + adds r1, r0, 0 + movs r2, 0 + ldr r0, [r4, 0x1C] + cmp r2, r0 + bge _0800EA7C + adds r3, r0, 0 +_0800EA68: + movs r6, 0 + ldrsh r0, [r1, r6] + cmp r0, r5 + bne _0800EA74 + ldrb r0, [r1, 0x2] + b _0800EA7E +_0800EA74: + adds r2, 0x1 + adds r1, 0xC + cmp r2, r3 + blt _0800EA68 +_0800EA7C: + ldrb r0, [r4, 0x10] +_0800EA7E: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_800EA44 + + thumb_func_start sub_800EA84 +sub_800EA84: + push {r4,lr} + sub sp, 0x50 + adds r4, r0, 0 + ldrh r0, [r4] + bl sub_800ECB8 + movs r1, 0 + ldrsh r0, [r0, r1] + str r0, [sp, 0x28] + ldr r0, [r4, 0x10] + str r0, [sp, 0x2C] + ldr r0, [r4, 0xC] + str r0, [sp, 0x30] + ldr r0, [r4, 0x4] + str r0, [sp, 0x34] + ldr r0, [r4, 0x8] + str r0, [sp, 0x38] + ldrh r0, [r4] + bl sub_800ECB8 + movs r2, 0 + ldrsh r0, [r0, r2] + bl sub_800EBBC + str r0, [sp, 0x3C] + ldr r0, _0800EADC + str r0, [sp, 0x40] + add r1, sp, 0x44 + ldr r0, _0800EAE0 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + add r1, sp, 0x28 + mov r0, sp + movs r2, 0x28 + bl memcpy + movs r0, 0x5 + mov r1, sp + bl sub_800E208 + add sp, 0x50 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0800EADC: .4byte 0x0000ffff +_0800EAE0: .4byte gUnknown_80B9C60 + thumb_func_end sub_800EA84 + + thumb_func_start sub_800EAE4 +sub_800EAE4: + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + bl sub_800E2C0 + adds r1, r0, 0 + movs r3, 0x1 + negs r3, r3 + cmp r1, r3 + beq _0800EB1E + ldr r2, _0800EB14 + movs r0, 0xD0 + muls r1, r0 + ldr r0, [r2] + adds r1, r0, r1 + ldr r0, [r4] + str r0, [r1, 0x18] + ldr r0, [r1, 0x20] + cmp r0, r3 + beq _0800EB18 + ldr r0, [r5] + str r0, [r1, 0x1C] + b _0800EB1E + .align 2, 0 +_0800EB14: .4byte gUnknown_203B0CC +_0800EB18: + movs r0, 0 + strh r0, [r1, 0x1C] + strh r0, [r1, 0x1E] +_0800EB1E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_800EAE4 + + thumb_func_start sub_800EB24 +sub_800EB24: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x20 + adds r6, r1, 0 + mov r8, r2 + adds r5, r3, 0 + ldr r4, [sp, 0x38] + bl sub_800E2C0 + adds r1, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0800EBB0 + ldr r2, _0800EB8C + movs r0, 0xD0 + muls r1, r0 + ldr r0, [r2] + adds r2, r0, r1 + adds r0, r2, 0 + adds r0, 0xCC + ldr r0, [r0] + cmp r0, 0 + bne _0800EB5A + ldr r0, [r6] + str r0, [r2, 0x18] +_0800EB5A: + ldr r0, [r2] + cmp r0, 0x6 + beq _0800EB94 + ldr r0, [r2, 0x8] + movs r1, 0x7 + mov r12, r1 + ands r0, r1 + cmp r0, 0 + bne _0800EB94 + mov r1, sp + ldr r0, _0800EB90 + ldm r0!, {r3,r6,r7} + stm r1!, {r3,r6,r7} + ldm r0!, {r3,r6,r7} + stm r1!, {r3,r6,r7} + ldm r0!, {r3,r6} + stm r1!, {r3,r6} + mov r7, r12 + ands r4, r7 + lsls r0, r4, 2 + add r0, sp + ldr r0, [r0] + adds r0, r5, r0 + b _0800EB96 + .align 2, 0 +_0800EB8C: .4byte gUnknown_203B0CC +_0800EB90: .4byte gUnknown_80B9C9C +_0800EB94: + adds r0, r5, 0x1 +_0800EB96: + str r0, [r2, 0x24] + ldr r1, [r2, 0x20] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0800EBAA + mov r1, r8 + ldr r0, [r1] + str r0, [r2, 0x1C] + b _0800EBB0 +_0800EBAA: + movs r0, 0 + strh r0, [r2, 0x1C] + strh r0, [r2, 0x1E] +_0800EBB0: + add sp, 0x20 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_800EB24 + + thumb_func_start sub_800EBBC +sub_800EBBC: + push {lr} + bl sub_800ECA4 + ldr r0, [r0, 0x1C] + pop {r1} + bx r1 + thumb_func_end sub_800EBBC + + thumb_func_start sub_800EBC8 +sub_800EBC8: + push {r4,lr} + sub sp, 0x50 + adds r4, r0, 0 + ldrh r0, [r4] + bl sub_800ECB8 + movs r1, 0x4 + ldrsh r0, [r0, r1] + str r0, [sp, 0x28] + ldr r0, [r4, 0x10] + str r0, [sp, 0x2C] + ldr r0, [r4, 0xC] + str r0, [sp, 0x30] + ldr r0, [r4, 0x4] + str r0, [sp, 0x34] + ldr r0, [r4, 0x8] + str r0, [sp, 0x38] + ldrh r0, [r4] + bl sub_800ECB8 + movs r2, 0x4 + ldrsh r0, [r0, r2] + bl sub_800EC68 + str r0, [sp, 0x3C] + ldr r0, _0800EC20 + str r0, [sp, 0x40] + add r1, sp, 0x44 + ldr r0, _0800EC24 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + add r1, sp, 0x28 + mov r0, sp + movs r2, 0x28 + bl memcpy + movs r0, 0x6 + mov r1, sp + bl sub_800E208 + add sp, 0x50 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0800EC20: .4byte 0x0000ffff +_0800EC24: .4byte gUnknown_80B9C60 + thumb_func_end sub_800EBC8 + + thumb_func_start sub_800EC28 +sub_800EC28: + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + bl sub_800E2C0 + adds r1, r0, 0 + movs r3, 0x1 + negs r3, r3 + cmp r1, r3 + beq _0800EC62 + ldr r2, _0800EC58 + movs r0, 0xD0 + muls r1, r0 + ldr r0, [r2] + adds r1, r0, r1 + ldr r0, [r4] + str r0, [r1, 0x18] + ldr r0, [r1, 0x20] + cmp r0, r3 + beq _0800EC5C + ldr r0, [r5] + str r0, [r1, 0x1C] + b _0800EC62 + .align 2, 0 +_0800EC58: .4byte gUnknown_203B0CC +_0800EC5C: + movs r0, 0 + strh r0, [r1, 0x1C] + strh r0, [r1, 0x1E] +_0800EC62: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_800EC28 + + thumb_func_start sub_800EC68 +sub_800EC68: + push {lr} + bl sub_800ECA4 + ldr r0, [r0, 0x1C] + pop {r1} + bx r1 + thumb_func_end sub_800EC68 + + thumb_func_start sub_800EC74 +sub_800EC74: + push {lr} + movs r0, 0x1 + bl sub_800F19C + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_800EC74 + + thumb_func_start sub_800EC84 +sub_800EC84: + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl sub_800ECB8 + ldrb r0, [r0, 0x8] + pop {r1} + bx r1 + thumb_func_end sub_800EC84 + + thumb_func_start sub_800EC94 +sub_800EC94: + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl sub_800ECB8 + ldrb r0, [r0, 0x9] + pop {r1} + bx r1 + thumb_func_end sub_800EC94 + + thumb_func_start sub_800ECA4 +sub_800ECA4: + adds r1, r0, 0 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _0800ECB4 + adds r0, r1 + bx lr + .align 2, 0 +_0800ECB4: .4byte gUnknown_80B9CC4 + thumb_func_end sub_800ECA4 + + thumb_func_start sub_800ECB8 +sub_800ECB8: + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + ldr r1, _0800ECCC + adds r0, r1 + bx lr + .align 2, 0 +_0800ECCC: .4byte gUnknown_80BDBC4 + thumb_func_end sub_800ECB8 + + thumb_func_start sub_800ECD0 +sub_800ECD0: + adds r1, r0, 0 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, _0800ECE0 + adds r0, r1 + bx lr + .align 2, 0 +_0800ECE0: .4byte gUnknown_80C183C + thumb_func_end sub_800ECD0 + + thumb_func_start sub_800ECE4 +sub_800ECE4: + lsls r0, 24 + ldr r1, _0800ECF4 + lsrs r0, 23 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + bx lr + .align 2, 0 +_0800ECF4: .4byte gUnknown_80CE73C + thumb_func_end sub_800ECE4 + + thumb_func_start sub_800ECF8 +sub_800ECF8: + lsls r0, 24 + ldr r1, _0800ED08 + lsrs r0, 22 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + bx lr + .align 2, 0 +_0800ED08: .4byte gUnknown_80CE37C + thumb_func_end sub_800ECF8 + + thumb_func_start sub_800ED0C +sub_800ED0C: + lsls r0, 24 + ldr r1, _0800ED1C + lsrs r0, 22 + adds r0, r1 + movs r1, 0x2 + ldrsh r0, [r0, r1] + bx lr + .align 2, 0 +_0800ED1C: .4byte gUnknown_80CE37C + thumb_func_end sub_800ED0C + + thumb_func_start sub_800ED20 +sub_800ED20: + lsls r0, 16 + lsrs r0, 16 + ldr r2, _0800ED34 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r2, 0xC + adds r1, r2 + ldr r0, [r1] + bx lr + .align 2, 0 +_0800ED34: .4byte gUnknown_80BDBC4 + thumb_func_end sub_800ED20 + + thumb_func_start sub_800ED38 +sub_800ED38: + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, _0800ED60 + ldr r0, [r4] + cmp r0, 0 + bne _0800ED54 + movs r0, 0x4C + movs r1, 0xB + bl MemoryAlloc + str r0, [r4] + movs r1, 0x4C + bl MemoryClear8 +_0800ED54: + ldr r0, [r4] + str r5, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0800ED60: .4byte gUnknown_203B0D0 + thumb_func_end sub_800ED38 + + thumb_func_start sub_800ED64 +sub_800ED64: + push {r4,lr} + ldr r4, _0800ED7C + ldr r0, [r4] + cmp r0, 0 + beq _0800ED76 + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0800ED76: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800ED7C: .4byte gUnknown_203B0D0 + thumb_func_end sub_800ED64 + + thumb_func_start sub_800ED80 +sub_800ED80: + push {r4,lr} + ldr r2, _0800EDAC + ldr r1, [r2] + movs r0, 0 + str r0, [r1] + adds r4, r2, 0 + movs r3, 0 + movs r2, 0x4 + movs r1, 0x1 +_0800ED92: + ldr r0, [r4] + adds r0, r2 + str r3, [r0] + str r3, [r0, 0x4] + str r3, [r0, 0x8] + adds r2, 0x24 + subs r1, 0x1 + cmp r1, 0 + bge _0800ED92 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800EDAC: .4byte gUnknown_203B0D0 + thumb_func_end sub_800ED80 + + thumb_func_start sub_800EDB0 +sub_800EDB0: + push {r4,r5,lr} + adds r4, r0, 0 + movs r3, 0 + ldr r5, _0800EDDC + movs r2, 0 +_0800EDBA: + ldr r1, [r5] + adds r0, r1, 0x4 + adds r0, r2 + ldr r0, [r0] + cmp r0, 0 + bne _0800EDE0 + adds r1, r2 + adds r1, 0x4 + adds r0, r4, 0 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + movs r0, 0x1 + b _0800EDEA + .align 2, 0 +_0800EDDC: .4byte gUnknown_203B0D0 +_0800EDE0: + adds r2, 0x24 + adds r3, 0x1 + cmp r3, 0x1 + ble _0800EDBA + movs r0, 0 +_0800EDEA: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_800EDB0 + + thumb_func_start sub_800EDF0 +sub_800EDF0: + push {r4,lr} + sub sp, 0x24 + adds r4, r1, 0 + cmp r0, 0 + beq _0800EE00 + cmp r0, 0x1 + beq _0800EE1A + b _0800EE44 +_0800EE00: + movs r0, 0x3 + str r0, [sp] + movs r0, 0xE + str r0, [sp, 0xC] + movs r1, 0x1 + negs r1, r1 + str r1, [sp, 0x10] + movs r0, 0xDC + lsls r0, 2 + str r0, [sp, 0x18] + movs r0, 0x1F + str r0, [sp, 0x1C] + b _0800EE40 +_0800EE1A: + movs r0, 0x4 + str r0, [sp] + movs r0, 0xE + str r0, [sp, 0xC] + movs r0, 0xF0 + lsls r0, 4 + str r0, [sp, 0x10] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x18] + str r0, [sp, 0x1C] + bl sub_8000728 + movs r2, 0x2 + eors r0, r2 + negs r1, r0 + orrs r1, r0 + asrs r1, 31 + ands r1, r2 +_0800EE40: + str r1, [sp, 0x14] + str r4, [sp, 0x4] +_0800EE44: + ldr r0, [r4, 0x4] + str r0, [sp, 0x8] + movs r0, 0 + str r0, [sp, 0x20] + mov r0, sp + bl sub_800EDB0 + add sp, 0x24 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_800EDF0 + + thumb_func_start sub_800EE5C +sub_800EE5C: + push {r4-r6,lr} + adds r4, r0, 0 + bl sub_800ECA4 + adds r6, r0, 0 + cmp r4, 0 + beq _0800EEC2 + ldr r2, [r6] + subs r0, r2, 0x1 + cmp r0, 0x1 + bls _0800EEC2 + ldr r1, [r6, 0x4] + adds r0, r2, 0 + bl sub_800F1C0 + adds r5, r0, 0 + cmp r5, 0 + beq _0800EEC2 + ldr r0, [r6] + ldr r1, [r6, 0x4] + bl sub_800F0F4 + adds r4, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r4, r0 + bne _0800EE9A + adds r0, r5, 0 + bl sub_800F204 + b _0800EEC2 +_0800EE9A: + movs r0, 0x2 + negs r0, r0 + cmp r4, r0 + beq _0800EEB6 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_800F13C + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_800EDF0 + b _0800EEBC +_0800EEB6: + adds r0, r5, 0 + bl sub_800F204 +_0800EEBC: + ldr r0, [r6, 0x4] + bl sub_800F15C +_0800EEC2: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_800EE5C + + thumb_func_start sub_800EEC8 +sub_800EEC8: + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl sub_800ECB8 + movs r1, 0 + ldrsh r0, [r0, r1] + bl sub_800EE5C + pop {r0} + bx r0 + thumb_func_end sub_800EEC8 + + thumb_func_start sub_800EEE0 +sub_800EEE0: + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl sub_800ECB8 + movs r1, 0x4 + ldrsh r0, [r0, r1] + bl sub_800EE5C + pop {r0} + bx r0 + thumb_func_end sub_800EEE0 + + thumb_func_start sub_800EEF8 +sub_800EEF8: + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl sub_800ECB8 + movs r1, 0x2 + ldrsh r0, [r0, r1] + bl sub_800EE5C + pop {r0} + bx r0 + thumb_func_end sub_800EEF8 + + thumb_func_start sub_800EF10 +sub_800EF10: + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl sub_800ECB8 + movs r1, 0x6 + ldrsh r0, [r0, r1] + bl sub_800EE5C + pop {r0} + bx r0 + thumb_func_end sub_800EF10 + + thumb_func_start sub_800EF28 +sub_800EF28: + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_800ECE4 + lsls r0, 16 + asrs r0, 16 + bl sub_800EE5C + pop {r0} + bx r0 + thumb_func_end sub_800EF28 + + thumb_func_start sub_800EF40 +sub_800EF40: + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + cmp r1, 0 + beq _0800EF52 + bl sub_800ECF8 + b _0800EF56 +_0800EF52: + bl sub_800ED0C +_0800EF56: + lsls r0, 16 + asrs r0, 16 + bl sub_800EE5C + pop {r0} + bx r0 + thumb_func_end sub_800EF40 + + thumb_func_start sub_800EF64 +sub_800EF64: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r0, _0800EF9C + mov r9, r0 + movs r1, 0x4 + mov r8, r1 + movs r7, 0 + movs r6, 0 + movs r5, 0x1 +_0800EF7A: + mov r0, r9 + ldr r1, [r0] + adds r0, r1, 0x4 + adds r0, r7 + ldr r0, [r0] + cmp r0, 0 + beq _0800F01A + mov r0, r8 + adds r4, r1, r0 + ldr r0, [r4] + cmp r0, 0x3 + beq _0800EFA0 + cmp r0, 0x3 + bls _0800F018 + cmp r0, 0x4 + beq _0800EFDA + b _0800F018 + .align 2, 0 +_0800EF9C: .4byte gUnknown_203B0D0 +_0800EFA0: + ldr r0, [r4, 0x8] + ldr r1, [r4, 0x18] + bl sub_8005674 + mov r1, r9 + ldr r0, [r1] + ldr r0, [r0] + cmp r0, 0 + beq _0800EFCA + cmp r0, 0x1 + bne _0800F00C + ldr r0, [r4, 0x8] + ldr r1, [r0, 0x18] + ldr r0, [r4, 0xC] + adds r0, 0x10 + lsls r0, 20 + lsrs r0, 16 + movs r2, 0x10 + bl sub_809971C + b _0800F00C +_0800EFCA: + ldr r0, [r4, 0xC] + ldr r1, [r4, 0x8] + ldr r1, [r1, 0x18] + ldr r2, [r4, 0x1C] + ldr r3, [r4, 0x20] + bl sub_8005770 + b _0800F00C +_0800EFDA: + bl sub_8000728 + cmp r0, 0x1 + bne _0800F000 + movs r0, 0 + movs r1, 0x1 + bl sub_800CD64 + movs r0, 0 + bl sub_8052210 + movs r0, 0x5 + movs r1, 0 + bl sub_803EAF0 + bl sub_800CB20 + bl xxx_call_update_bg_vram +_0800F000: + ldr r0, [r4, 0x8] + ldr r1, [r4, 0xC] + ldr r2, [r4, 0x10] + ldr r3, [r4, 0x14] + bl sub_8009A1C +_0800F00C: + ldr r0, [r4, 0x4] + cmp r0, 0 + beq _0800F018 + bl sub_800F204 + str r6, [r4, 0x4] +_0800F018: + str r6, [r4] +_0800F01A: + movs r0, 0x24 + add r8, r0 + adds r7, 0x24 + subs r5, 0x1 + cmp r5, 0 + bge _0800EF7A + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_800EF64 + + thumb_func_start sub_800F034 +sub_800F034: + push {r4-r6,lr} + ldr r4, _0800F074 + ldr r0, [r4] + cmp r0, 0 + bne _0800F04E + movs r0, 0x10 + movs r1, 0xB + bl MemoryAlloc + str r0, [r4] + movs r1, 0x10 + bl MemoryClear8 +_0800F04E: + movs r3, 0 + adds r6, r4, 0 + movs r5, 0x1 + negs r5, r5 + movs r4, 0 +_0800F058: + ldr r0, [r6] + lsls r2, r3, 3 + adds r1, r0, r2 + str r5, [r1] + adds r0, 0x4 + adds r0, r2 + str r4, [r0] + adds r3, 0x1 + cmp r3, 0x1 + ble _0800F058 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0800F074: .4byte gUnknown_203B0D4 + thumb_func_end sub_800F034 + + thumb_func_start sub_800F078 +sub_800F078: + push {r4,lr} + ldr r4, _0800F090 + ldr r0, [r4] + cmp r0, 0 + beq _0800F08A + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0800F08A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800F090: .4byte gUnknown_203B0D4 + thumb_func_end sub_800F078 + + thumb_func_start sub_800F094 +sub_800F094: + push {r4-r6,lr} + movs r3, 0 + ldr r6, _0800F0BC + movs r5, 0x1 + negs r5, r5 + movs r4, 0 +_0800F0A0: + ldr r0, [r6] + lsls r2, r3, 3 + adds r1, r0, r2 + str r5, [r1] + adds r0, 0x4 + adds r0, r2 + str r4, [r0] + adds r3, 0x1 + cmp r3, 0x1 + ble _0800F0A0 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0800F0BC: .4byte gUnknown_203B0D4 + thumb_func_end sub_800F094 + + thumb_func_start sub_800F0C0 +sub_800F0C0: + push {lr} + cmp r0, 0x3 + bne _0800F0D8 + ldr r0, _0800F0D4 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, r1 + bne _0800F0EC + movs r0, 0 + b _0800F0F0 + .align 2, 0 +_0800F0D4: .4byte gUnknown_203B0D4 +_0800F0D8: + ldr r0, _0800F0E8 + ldr r0, [r0] + ldr r0, [r0, 0x8] + cmp r0, r1 + bne _0800F0EC + movs r0, 0x1 + b _0800F0F0 + .align 2, 0 +_0800F0E8: .4byte gUnknown_203B0D4 +_0800F0EC: + movs r0, 0x3 + negs r0, r0 +_0800F0F0: + pop {r1} + bx r1 + thumb_func_end sub_800F0C0 + + thumb_func_start sub_800F0F4 +sub_800F0F4: + push {lr} + cmp r0, 0x3 + bne _0800F114 + ldr r0, _0800F110 + ldr r2, [r0] + ldr r0, [r2] + cmp r0, r1 + beq _0800F11E + ldr r0, [r2, 0x4] + cmp r0, 0 + bne _0800F132 + movs r0, 0 + b _0800F136 + .align 2, 0 +_0800F110: .4byte gUnknown_203B0D4 +_0800F114: + ldr r0, _0800F124 + ldr r2, [r0] + ldr r0, [r2, 0x8] + cmp r0, r1 + bne _0800F128 +_0800F11E: + movs r0, 0x2 + negs r0, r0 + b _0800F136 + .align 2, 0 +_0800F124: .4byte gUnknown_203B0D4 +_0800F128: + ldr r0, [r2, 0xC] + cmp r0, 0 + bne _0800F132 + movs r0, 0x1 + b _0800F136 +_0800F132: + movs r0, 0x1 + negs r0, r0 +_0800F136: + pop {r1} + bx r1 + thumb_func_end sub_800F0F4 + + thumb_func_start sub_800F13C +sub_800F13C: + push {lr} + ldr r1, _0800F158 + ldr r3, [r1] + lsls r1, r0, 3 + adds r0, r3, 0x4 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + bne _0800F154 + adds r1, r3, r1 + ldr r0, [r2, 0x4] + str r0, [r1] +_0800F154: + pop {r0} + bx r0 + .align 2, 0 +_0800F158: .4byte gUnknown_203B0D4 + thumb_func_end sub_800F13C + + thumb_func_start sub_800F15C +sub_800F15C: + push {r4,r5,lr} + adds r4, r0, 0 + movs r3, 0 + ldr r5, _0800F17C +_0800F164: + ldr r1, [r5] + lsls r2, r3, 3 + adds r0, r1, r2 + ldr r0, [r0] + cmp r0, r4 + bne _0800F180 + adds r1, 0x4 + adds r1, r2 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + b _0800F186 + .align 2, 0 +_0800F17C: .4byte gUnknown_203B0D4 +_0800F180: + adds r3, 0x1 + cmp r3, 0x1 + ble _0800F164 +_0800F186: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_800F15C + + thumb_func_start sub_800F18C +sub_800F18C: + ldr r1, _0800F198 + lsls r0, 3 + ldr r1, [r1] + adds r1, r0 + adds r0, r1, 0 + bx lr + .align 2, 0 +_0800F198: .4byte gUnknown_203B0D4 + thumb_func_end sub_800F18C + + thumb_func_start sub_800F19C +sub_800F19C: + push {lr} + ldr r1, _0800F1B4 + ldr r1, [r1] + lsls r0, 3 + adds r1, 0x4 + adds r1, r0 + ldr r0, [r1] + cmp r0, 0 + beq _0800F1B8 + movs r0, 0x1 + b _0800F1BA + .align 2, 0 +_0800F1B4: .4byte gUnknown_203B0D4 +_0800F1B8: + movs r0, 0 +_0800F1BA: + pop {r1} + bx r1 + thumb_func_end sub_800F19C + + thumb_func_start sub_800F1C0 +sub_800F1C0: + push {lr} + sub sp, 0x8 + adds r2, r1, 0 + cmp r0, 0x1 + bcc _0800F1EC + cmp r0, 0x3 + bls _0800F1D4 + cmp r0, 0x4 + beq _0800F1E4 + b _0800F1EC +_0800F1D4: + ldr r1, _0800F1E0 + mov r0, sp + bl sprintf + b _0800F1EC + .align 2, 0 +_0800F1E0: .4byte gUnknown_80CE77C +_0800F1E4: + ldr r1, _0800F1FC + mov r0, sp + bl sprintf +_0800F1EC: + ldr r1, _0800F200 + mov r0, sp + bl sub_800AA08 + add sp, 0x8 + pop {r1} + bx r1 + .align 2, 0 +_0800F1FC: .4byte gUnknown_80CE788 +_0800F200: .4byte 0x09740000 + thumb_func_end sub_800F1C0 + + thumb_func_start sub_800F204 +sub_800F204: + push {lr} + bl sub_800AA14 + pop {r0} + bx r0 + thumb_func_end sub_800F204 + + thumb_func_start sub_800F210 +sub_800F210: + push {r4,lr} + adds r4, r0, 0 + movs r3, 0 + ldr r0, _0800F230 + ldr r0, [r0] + adds r1, r0, 0x4 + adds r2, r0, 0 + adds r2, 0x8 +_0800F220: + ldrb r0, [r1] + cmp r0, 0 + beq _0800F234 + ldr r0, [r2] + cmp r0, r4 + bne _0800F234 + adds r0, r1, 0 + b _0800F240 + .align 2, 0 +_0800F230: .4byte gUnknown_203B0D8 +_0800F234: + adds r1, 0x40 + adds r2, 0x40 + adds r3, 0x1 + cmp r3, 0x15 + ble _0800F220 + movs r0, 0 +_0800F240: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_800F210 + + thumb_func_start sub_800F248 +sub_800F248: + push {lr} + movs r2, 0 + ldr r0, _0800F25C + ldr r0, [r0] + adds r1, r0, 0x4 +_0800F252: + ldrb r0, [r1] + cmp r0, 0 + bne _0800F260 + adds r0, r1, 0 + b _0800F26A + .align 2, 0 +_0800F25C: .4byte gUnknown_203B0D8 +_0800F260: + adds r1, 0x40 + adds r2, 0x1 + cmp r2, 0x15 + ble _0800F252 + movs r0, 0 +_0800F26A: + pop {r1} + bx r1 + thumb_func_end sub_800F248 + + thumb_func_start sub_800F270 +sub_800F270: + push {r4-r6,lr} + adds r2, r0, 0 + lsls r0, r1, 3 + adds r0, 0x28 + adds r3, r2, r0 + movs r5, 0x80 + lsls r5, 21 + cmp r1, 0 + bne _0800F284 + movs r5, 0x1 +_0800F284: + movs r6, 0x80 + lsls r6, 21 + cmp r1, 0 + bne _0800F290 + movs r6, 0x80 + lsls r6, 20 +_0800F290: + movs r4, 0x1 + cmp r1, 0 + bne _0800F298 + movs r4, 0x1C +_0800F298: + ldr r0, [r2, 0xC] + cmp r0, 0 + bne _0800F2A4 + b _0800F2CC +_0800F2A0: + adds r0, r1, 0 + b _0800F2CE +_0800F2A4: + ldr r2, [r3] + adds r1, r5, 0 + cmp r2, 0 + beq _0800F2AE + adds r1, r2, 0 +_0800F2AE: + movs r2, 0 + cmp r2, r4 + bge _0800F2CC + adds r3, r0, 0 +_0800F2B6: + lsls r1, 1 + cmp r1, r6 + bls _0800F2BE + adds r1, r5, 0 +_0800F2BE: + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _0800F2A0 + adds r2, 0x1 + cmp r2, r4 + blt _0800F2B6 +_0800F2CC: + movs r0, 0 +_0800F2CE: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_800F270 + + thumb_func_start sub_800F2D4 +sub_800F2D4: + push {lr} + movs r1, 0 + cmp r0, 0 + beq _0800F2E4 +_0800F2DC: + lsrs r0, 1 + adds r1, 0x1 + cmp r0, 0 + bne _0800F2DC +_0800F2E4: + adds r0, r1, 0 + pop {r1} + bx r1 + thumb_func_end sub_800F2D4 + + thumb_func_start sub_800F2EC +sub_800F2EC: + push {r4-r7,lr} + sub sp, 0xC + adds r5, r0, 0 + adds r6, r1, 0 + adds r7, r2, 0 + lsls r0, r6, 3 + adds r0, 0x28 + adds r4, r5, r0 + ldr r0, [r5, 0xC] + cmp r0, 0 + bne _0800F306 + str r0, [r4] + b _0800F35C +_0800F306: + ldr r0, [r4] + cmp r0, 0 + bne _0800F30E + str r0, [r4, 0x4] +_0800F30E: + ldr r0, [r4, 0x4] + cmp r0, 0 + bgt _0800F32A + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_800F270 + adds r1, r0, 0 + ldr r0, [r4] + cmp r0, r1 + beq _0800F326 + str r1, [r4] +_0800F326: + movs r0, 0x3C + b _0800F32C +_0800F32A: + subs r0, 0x1 +_0800F32C: + str r0, [r4, 0x4] + ldrb r0, [r5, 0x10] + cmp r0, 0 + beq _0800F35C + ldr r0, [r4] + cmp r0, 0 + beq _0800F35C + bl sub_800F2D4 + adds r1, r0, 0 + movs r2, 0x8 + ldrsh r0, [r5, r2] + adds r2, r5, 0 + adds r2, 0x14 + lsls r3, r6, 2 + adds r3, 0x18 + adds r3, r5, r3 + str r7, [sp] + ldrb r4, [r5, 0x11] + str r4, [sp, 0x4] + ldr r4, [r5, 0x4] + str r4, [sp, 0x8] + bl sub_800F364 +_0800F35C: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_800F2EC + + thumb_func_start sub_800F364 +sub_800F364: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + mov r12, r2 + ldr r0, [sp, 0x20] + mov r8, r0 + ldr r4, [sp, 0x24] + ldr r0, _0800F410 + lsls r1, 3 + adds r2, r1, r0 + ldr r0, [r2] + ldr r1, [r2, 0x4] + str r0, [sp] + str r1, [sp, 0x4] + lsls r2, r0, 1 + ldr r1, [sp] + adds r2, r1 + lsls r2, 3 + ldr r0, _0800F414 + adds r2, r0 + ldr r0, [r2, 0x8] + ldr r6, _0800F418 + adds r7, r0, r6 + movs r0, 0x3 + ands r4, r0 + lsls r4, 10 + ldr r5, _0800F41C + ldrh r1, [r5, 0x4] + ldr r0, _0800F420 + ands r0, r1 + orrs r0, r4 + strh r0, [r5, 0x4] + mov r0, r12 + movs r4, 0 + ldrsh r1, [r0, r4] + ldr r0, [r2] + lsls r0, 2 + subs r1, r0 + mov r6, r8 + movs r4, 0 + ldrsh r0, [r6, r4] + subs r1, r0 + movs r6, 0 + ldrsh r0, [r3, r6] + adds r4, r1, r0 + mov r0, r12 + movs r6, 0x2 + ldrsh r1, [r0, r6] + ldr r0, [r2, 0x4] + lsls r0, 2 + subs r1, r0 + mov r2, r8 + movs r6, 0x2 + ldrsh r0, [r2, r6] + subs r1, r0 + movs r2, 0x2 + ldrsh r0, [r3, r2] + adds r3, r1, r0 + adds r6, r3, 0 + subs r6, 0x10 + movs r0, 0x20 + negs r0, r0 + cmp r4, r0 + bge _0800F3E8 + b _0800F5E4 +_0800F3E8: + cmp r3, r0 + bge _0800F3EE + b _0800F5E4 +_0800F3EE: + cmp r4, 0xEF + ble _0800F3F4 + b _0800F5E4 +_0800F3F4: + cmp r3, 0x9F + ble _0800F3FA + b _0800F5E4 +_0800F3FA: + ldr r0, [sp] + subs r0, 0x1 + cmp r0, 0xF + bls _0800F404 + b _0800F5A6 +_0800F404: + lsls r0, 2 + ldr r1, _0800F424 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0800F410: .4byte gUnknown_80D3474 +_0800F414: .4byte gUnknown_80CE79C +_0800F418: .4byte 0x0000032b +_0800F41C: .4byte gUnknown_203B0DC +_0800F420: .4byte 0x0000f3ff +_0800F424: .4byte _0800F428 + .align 2, 0 +_0800F428: + .4byte _0800F468 + .4byte _0800F4CC + .4byte _0800F4CC + .4byte _0800F574 + .4byte _0800F538 + .4byte _0800F4CC + .4byte _0800F4CC + .4byte _0800F498 + .4byte _0800F4CC + .4byte _0800F4CC + .4byte _0800F4CC + .4byte _0800F468 + .4byte _0800F4CC + .4byte _0800F468 + .4byte _0800F4CC + .4byte _0800F500 +_0800F468: + ldrh r2, [r5] + ldr r1, _0800F48C + adds r0, r1, 0 + ands r0, r2 + strh r0, [r5] + ldrh r0, [r5, 0x2] + ands r1, r0 + ldr r0, _0800F490 + ands r4, r0 + movs r0, 0xFE + lsls r0, 8 + ands r1, r0 + orrs r1, r4 + strh r1, [r5, 0x2] + ldr r1, _0800F494 + ands r1, r6 + b _0800F59A + .align 2, 0 +_0800F48C: .4byte 0x00003fff +_0800F490: .4byte 0x000001ff +_0800F494: .4byte 0x00000fff +_0800F498: + movs r3, 0x80 + lsls r3, 8 + ldrh r2, [r5] + ldr r1, _0800F4C0 + adds r0, r1, 0 + ands r0, r2 + orrs r0, r3 + strh r0, [r5] + ldrh r0, [r5, 0x2] + ands r1, r0 + ldr r0, _0800F4C4 + ands r4, r0 + movs r0, 0xFE + lsls r0, 8 + ands r1, r0 + orrs r1, r4 + strh r1, [r5, 0x2] + ldr r1, _0800F4C8 + ands r1, r6 + b _0800F59A + .align 2, 0 +_0800F4C0: .4byte 0x00003fff +_0800F4C4: .4byte 0x000001ff +_0800F4C8: .4byte 0x00000fff +_0800F4CC: + ldrh r2, [r5] + ldr r1, _0800F4F4 + adds r0, r1, 0 + ands r0, r2 + strh r0, [r5] + movs r2, 0x80 + lsls r2, 7 + ldrh r0, [r5, 0x2] + ands r1, r0 + orrs r1, r2 + ldr r0, _0800F4F8 + ands r4, r0 + movs r0, 0xFE + lsls r0, 8 + ands r1, r0 + orrs r1, r4 + strh r1, [r5, 0x2] + ldr r1, _0800F4FC + ands r1, r6 + b _0800F59A + .align 2, 0 +_0800F4F4: .4byte 0x00003fff +_0800F4F8: .4byte 0x000001ff +_0800F4FC: .4byte 0x00000fff +_0800F500: + ldrh r2, [r5] + ldr r1, _0800F52C + adds r0, r1, 0 + ands r0, r2 + strh r0, [r5] + movs r2, 0x80 + lsls r2, 7 + ldrh r0, [r5, 0x2] + ands r1, r0 + orrs r1, r2 + adds r2, r4, 0 + adds r2, 0x8 + ldr r0, _0800F530 + ands r2, r0 + movs r0, 0xFE + lsls r0, 8 + ands r1, r0 + orrs r1, r2 + strh r1, [r5, 0x2] + ldr r1, _0800F534 + ands r1, r6 + b _0800F59A + .align 2, 0 +_0800F52C: .4byte 0x00003fff +_0800F530: .4byte 0x000001ff +_0800F534: .4byte 0x00000fff +_0800F538: + movs r3, 0x80 + lsls r3, 7 + ldrh r2, [r5] + ldr r1, _0800F568 + adds r0, r1, 0 + ands r0, r2 + orrs r0, r3 + strh r0, [r5] + movs r2, 0x80 + lsls r2, 8 + ldrh r0, [r5, 0x2] + ands r1, r0 + orrs r1, r2 + ldr r0, _0800F56C + ands r4, r0 + movs r0, 0xFE + lsls r0, 8 + ands r1, r0 + orrs r1, r4 + strh r1, [r5, 0x2] + ldr r1, _0800F570 + ands r1, r6 + b _0800F59A + .align 2, 0 +_0800F568: .4byte 0x00003fff +_0800F56C: .4byte 0x000001ff +_0800F570: .4byte 0x00000fff +_0800F574: + ldrh r2, [r5] + ldr r1, _0800F5F0 + adds r0, r1, 0 + ands r0, r2 + strh r0, [r5] + movs r2, 0x80 + lsls r2, 8 + ldrh r0, [r5, 0x2] + ands r1, r0 + orrs r1, r2 + ldr r0, _0800F5F4 + ands r4, r0 + movs r0, 0xFE + lsls r0, 8 + ands r1, r0 + orrs r1, r4 + strh r1, [r5, 0x2] + ldr r1, _0800F5F8 + ands r1, r3 +_0800F59A: + lsls r1, 4 + ldrh r2, [r5, 0x6] + movs r0, 0xF + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x6] +_0800F5A6: + ldr r0, _0800F5FC + ands r7, r0 + ldrh r1, [r5, 0x4] + movs r0, 0xFC + lsls r0, 8 + ands r0, r1 + orrs r0, r7 + movs r1, 0xF + ldr r3, [sp, 0x4] + ands r1, r3 + lsls r1, 12 + ldr r2, _0800F5F8 + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x4] + mov r4, r12 + movs r6, 0x2 + ldrsh r1, [r4, r6] + mov r2, r8 + movs r3, 0x2 + ldrsh r0, [r2, r3] + subs r1, r0 + lsrs r0, r1, 31 + adds r1, r0 + asrs r1, 1 + adds r1, 0x1 + adds r0, r5, 0 + movs r2, 0 + movs r3, 0 + bl AddSprite +_0800F5E4: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0800F5F0: .4byte 0x00003fff +_0800F5F4: .4byte 0x000001ff +_0800F5F8: .4byte 0x00000fff +_0800F5FC: .4byte 0x000003ff + thumb_func_end sub_800F364 + + thumb_func_start sub_800F600 +sub_800F600: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + ldr r0, _0800F660 + adds r1, r0 + ldr r7, [r1, 0x14] + ldr r3, [r1, 0x10] + ldr r2, [r1] + ldr r0, [r1, 0x4] + muls r0, r2 + lsls r4, r0, 5 + mov r8, r4 + ldr r0, [r1, 0x8] + ldr r1, _0800F664 + adds r0, r1 + lsls r5, r0, 5 + adds r6, r5, 0 + ldr r0, _0800F668 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0 + bge _0800F63C + adds r0, 0x3 +_0800F63C: + asrs r0, 2 + adds r1, r3, 0 + bl __modsi3 + muls r0, r4 + ldr r1, _0800F66C + adds r0, r1 + adds r1, r7, r0 + mov r2, r9 + cmp r2, 0 + beq _0800F674 + ldr r2, _0800F670 + adds r0, r5, r2 + adds r2, r4, 0 + bl sub_80098BC + b _0800F67E + .align 2, 0 +_0800F660: .4byte gUnknown_80CE79C +_0800F664: .4byte 0x0000032b +_0800F668: .4byte gUnknown_203B0D8 +_0800F66C: .4byte gUnknown_80CE934 +_0800F670: .4byte 0x06010000 +_0800F674: + ldr r2, _0800F68C + adds r0, r6, r2 + mov r2, r8 + bl CpuCopy +_0800F67E: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0800F68C: .4byte 0x06010000 + thumb_func_end sub_800F600 + + thumb_func_start sub_800F690 +sub_800F690: + push {r4,r5,lr} + ldr r5, _0800F738 + ldr r0, [r5] + cmp r0, 0 + bne _0800F6AC + ldr r4, _0800F73C + adds r0, r4, 0 + movs r1, 0xC + bl MemoryAlloc + str r0, [r5] + adds r1, r4, 0 + bl MemoryClear8 +_0800F6AC: + ldr r1, [r5] + movs r0, 0 + str r0, [r1] + movs r0, 0x1 + movs r1, 0 + bl sub_800F600 + movs r0, 0x2 + movs r1, 0 + bl sub_800F600 + movs r0, 0x3 + movs r1, 0 + bl sub_800F600 + movs r0, 0x4 + movs r1, 0 + bl sub_800F600 + movs r0, 0x5 + movs r1, 0 + bl sub_800F600 + movs r0, 0x6 + movs r1, 0 + bl sub_800F600 + movs r0, 0x7 + movs r1, 0 + bl sub_800F600 + movs r0, 0x8 + movs r1, 0 + bl sub_800F600 + movs r0, 0x9 + movs r1, 0 + bl sub_800F600 + movs r0, 0xA + movs r1, 0 + bl sub_800F600 + movs r0, 0xB + movs r1, 0 + bl sub_800F600 + movs r0, 0xC + movs r1, 0 + bl sub_800F600 + movs r0, 0xD + movs r1, 0 + bl sub_800F600 + movs r0, 0xE + movs r1, 0 + bl sub_800F600 + movs r0, 0xF + movs r1, 0 + bl sub_800F600 + movs r0, 0x10 + movs r1, 0 + bl sub_800F600 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0800F738: .4byte gUnknown_203B0D8 +_0800F73C: .4byte 0x00000584 + thumb_func_end sub_800F690 + + thumb_func_start sub_800F740 +sub_800F740: + push {r4,lr} + ldr r4, _0800F758 + ldr r0, [r4] + cmp r0, 0 + beq _0800F752 + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0800F752: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0800F758: .4byte gUnknown_203B0D8 + thumb_func_end sub_800F740 + + thumb_func_start sub_800F75C +sub_800F75C: + push {r4-r7,lr} + adds r4, r0, 0 + adds r7, r2, 0 + lsls r1, 16 + asrs r5, r1, 16 + lsls r3, 24 + lsrs r6, r3, 24 + ldr r0, _0800F790 + ldr r0, [r0] + cmp r0, 0 + beq _0800F788 + adds r0, r4, 0 + bl sub_800F210 + cmp r0, 0 + beq _0800F788 + movs r1, 0 + strh r5, [r0, 0x8] + str r7, [r0, 0xC] + strb r6, [r0, 0x10] + adds r0, 0x38 + strb r1, [r0] +_0800F788: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0800F790: .4byte gUnknown_203B0D8 + thumb_func_end sub_800F75C + + thumb_func_start sub_800F794 +sub_800F794: + push {r4-r6,lr} + adds r1, r0, 0 + adds r4, r2, 0 + adds r5, r3, 0 + ldr r6, [sp, 0x10] + ldr r0, _0800F7CC + ldr r0, [r0] + cmp r0, 0 + beq _0800F7C6 + adds r0, r1, 0 + bl sub_800F210 + adds r2, r0, 0 + cmp r2, 0 + beq _0800F7C6 + adds r1, r2, 0 + adds r1, 0x38 + movs r0, 0x1 + strb r0, [r1] + strh r4, [r2, 0x3C] + strh r5, [r2, 0x3E] + ldr r0, [r6] + str r0, [r2, 0x20] + ldr r0, [r6, 0xC] + str r0, [r2, 0x24] +_0800F7C6: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0800F7CC: .4byte gUnknown_203B0D8 + thumb_func_end sub_800F794 + + thumb_func_start sub_800F7D0 +sub_800F7D0: + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r0 + ldr r0, _0800F800 + ldr r0, [r0] + cmp r0, 0 + beq _0800F8C0 + ldr r1, [r0] + adds r0, r1, 0 + cmp r1, 0 + bge _0800F7EA + adds r0, r1, 0x3 +_0800F7EA: + asrs r0, 2 + lsls r0, 2 + subs r0, r1, r0 + cmp r0, 0x1 + beq _0800F82A + cmp r0, 0x1 + bgt _0800F804 + cmp r0, 0 + beq _0800F80E + b _0800F888 + .align 2, 0 +_0800F800: .4byte gUnknown_203B0D8 +_0800F804: + cmp r0, 0x2 + beq _0800F846 + cmp r0, 0x3 + beq _0800F868 + b _0800F888 +_0800F80E: + movs r0, 0x1 + movs r1, 0x1 + bl sub_800F600 + movs r0, 0x2 + movs r1, 0x1 + bl sub_800F600 + movs r0, 0x3 + movs r1, 0x1 + bl sub_800F600 + movs r0, 0x4 + b _0800F860 +_0800F82A: + movs r0, 0x5 + movs r1, 0x1 + bl sub_800F600 + movs r0, 0x6 + movs r1, 0x1 + bl sub_800F600 + movs r0, 0x7 + movs r1, 0x1 + bl sub_800F600 + movs r0, 0x8 + b _0800F860 +_0800F846: + movs r0, 0x9 + movs r1, 0x1 + bl sub_800F600 + movs r0, 0xA + movs r1, 0x1 + bl sub_800F600 + movs r0, 0xB + movs r1, 0x1 + bl sub_800F600 + movs r0, 0xC +_0800F860: + movs r1, 0x1 + bl sub_800F600 + b _0800F888 +_0800F868: + movs r0, 0xD + movs r1, 0x1 + bl sub_800F600 + movs r0, 0xE + movs r1, 0x1 + bl sub_800F600 + movs r0, 0xF + movs r1, 0x1 + bl sub_800F600 + movs r0, 0x10 + movs r1, 0x1 + bl sub_800F600 +_0800F888: + movs r5, 0 + movs r6, 0x4 +_0800F88C: + ldr r7, _0800F8CC + ldr r4, [r7] + lsls r0, r5, 6 + adds r0, r4, r0 + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _0800F8B0 + adds r4, r6 + adds r0, r4, 0 + movs r1, 0 + mov r2, r8 + bl sub_800F2EC + adds r0, r4, 0 + movs r1, 0x1 + mov r2, r8 + bl sub_800F2EC +_0800F8B0: + adds r6, 0x40 + adds r5, 0x1 + cmp r5, 0x15 + ble _0800F88C + ldr r1, [r7] + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_0800F8C0: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0800F8CC: .4byte gUnknown_203B0D8 + thumb_func_end sub_800F7D0 + + thumb_func_start sub_800F8D0 +sub_800F8D0: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + adds r7, r2, 0 + mov r8, r3 + lsls r1, 16 + asrs r6, r1, 16 + ldr r0, _0800F92C + ldr r0, [r0] + cmp r0, 0 + beq _0800F920 + adds r0, r5, 0 + bl sub_800F210 + adds r4, r0, 0 + cmp r4, 0 + bne _0800F920 + bl sub_800F248 + adds r1, r0, 0 + cmp r1, 0 + beq _0800F920 + movs r0, 0x1 + strb r0, [r1] + str r5, [r1, 0x4] + strh r6, [r1, 0x8] + str r4, [r1, 0xC] + ldr r0, [r7] + str r0, [r1, 0x14] + mov r0, r8 + strb r0, [r1, 0x11] + ldr r0, _0800F930 + ldr r0, [r0] + str r0, [r1, 0x1C] + str r0, [r1, 0x18] + str r4, [r1, 0x28] + str r4, [r1, 0x2C] + str r4, [r1, 0x30] + str r4, [r1, 0x34] +_0800F920: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0800F92C: .4byte gUnknown_203B0D8 +_0800F930: .4byte gUnknown_80D3564 + thumb_func_end sub_800F8D0 + + thumb_func_start sub_800F934 +sub_800F934: + push {lr} + adds r1, r0, 0 + ldr r0, _0800F954 + ldr r0, [r0] + cmp r0, 0 + beq _0800F950 + adds r0, r1, 0 + bl sub_800F210 + cmp r0, 0 + beq _0800F950 + movs r1, 0x40 + bl MemoryClear8 +_0800F950: + pop {r0} + bx r0 + .align 2, 0 +_0800F954: .4byte gUnknown_203B0D8 + thumb_func_end sub_800F934 + + thumb_func_start sub_800F958 +sub_800F958: + push {r4-r7,lr} + adds r4, r0, 0 + adds r6, r1, 0 + adds r5, r2, 0 + adds r7, r3, 0 + ldr r0, _0800F98C + ldr r0, [r0] + cmp r0, 0 + beq _0800F984 + adds r0, r4, 0 + bl sub_800F210 + adds r3, r0, 0 + cmp r3, 0 + beq _0800F984 + ldr r0, [r6] + str r0, [r3, 0x14] + strb r7, [r3, 0x11] + ldr r0, [r5] + str r0, [r3, 0x18] + ldr r0, [r5, 0xC] + str r0, [r3, 0x1C] +_0800F984: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0800F98C: .4byte gUnknown_203B0D8 + thumb_func_end sub_800F958 + + thumb_func_start sub_800F990 +sub_800F990: + push {r4-r7,lr} + sub sp, 0x8 + adds r6, r0, 0 + ldr r4, _0800FA20 + ldr r0, [r6, 0x8] + str r0, [r4] + ldr r1, _0800FA24 + ldr r2, _0800FA28 + adds r0, r2, 0 + strh r0, [r1] + movs r0, 0 + movs r1, 0x14 + bl sub_80095CC + movs r0, 0x2 + bl xxx_update_some_bg_tiles + ldr r1, [r4] + ldr r0, _0800FA2C + adds r2, r1, r0 + ldr r0, _0800FA30 + str r0, [r2] + ldrb r0, [r6, 0x5] + ldr r2, _0800FA34 + adds r1, r2 + movs r5, 0 + strb r0, [r1] + bl sub_8010DA4 + ldr r0, [r4] + ldr r2, _0800FA38 + adds r1, r0, r2 + movs r2, 0x1 + negs r2, r2 + str r2, [r1] + ldr r1, _0800FA3C + adds r0, r1 + str r2, [r0] + ldrb r0, [r6, 0x4] + bl sub_800FC5C + ldr r0, [r4] + ldr r2, _0800FA40 + adds r1, r0, r2 + adds r2, 0x4 + adds r0, r2 + ldr r0, [r0] + str r0, [r1] + ldr r1, _0800FA44 + movs r0, 0xFF + strb r0, [r1] + ldr r0, _0800FA48 + strb r5, [r0] + bl sub_8011760 + add r7, sp, 0x4 +_0800FA00: + movs r5, 0 + str r5, [sp] + str r5, [sp, 0x4] + mov r0, sp + adds r1, r7, 0 + bl sub_800FAA8 + cmp r0, 0x1 + bne _0800FA4C + ldr r0, [sp] + ldr r1, [sp, 0x4] + movs r2, 0x32 + bl sub_80100C0 + b _0800FA00 + .align 2, 0 +_0800FA20: .4byte gUnknown_203B0E4 +_0800FA24: .4byte gUnknown_2026E4E +_0800FA28: .4byte 0x00001010 +_0800FA2C: .4byte 0x00004014 +_0800FA30: .4byte gUnknown_80D3570 +_0800FA34: .4byte 0x00004a2c +_0800FA38: .4byte 0x00004a28 +_0800FA3C: .4byte 0x00004a1c +_0800FA40: .4byte 0x00004a20 +_0800FA44: .4byte gUnknown_202DE18 +_0800FA48: .4byte gUnknown_202DE19 +_0800FA4C: + cmp r0, 0x2 + bne _0800FA6C + bl sub_800FB6C + lsls r0, 24 + cmp r0, 0 + beq _0800FA00 + ldr r0, [r4] + ldr r1, _0800FA68 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r6, 0xC] + b _0800FA92 + .align 2, 0 +_0800FA68: .4byte 0x00004df4 +_0800FA6C: + cmp r0, 0x3 + bne _0800FA00 + ldr r0, [r4] + ldr r2, _0800FA8C + adds r1, r0, r2 + adds r2, 0x8 + adds r0, r2 + ldr r1, [r1] + ldr r0, [r0] + cmp r1, r0 + beq _0800FA90 + movs r1, 0 + movs r2, 0xA + bl sub_80100C0 + b _0800FA00 + .align 2, 0 +_0800FA8C: .4byte 0x00004a18 +_0800FA90: + strb r5, [r6, 0xC] +_0800FA92: + bl sub_800FC28 + bl sub_8010EF0 + bl nullsub_16 + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_800F990 + + thumb_func_start sub_800FAA8 +sub_800FAA8: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r8, r0 + mov r9, r1 + movs r5, 0 + bl sub_8011300 + bl sub_8011398 +_0800FABE: + bl sub_801169C + bl sub_8010014 + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0xFF + beq _0800FB1C + ldr r6, _0800FB50 + ldr r2, [r6] + ldr r1, _0800FB54 + adds r0, r2, r1 + ldr r4, [r0] + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 4 + adds r0, r2 + lsls r1, r3, 1 + ldr r7, _0800FB58 + adds r0, r7 + adds r1, r0, r1 + movs r7, 0 + ldrsh r0, [r1, r7] + cmp r0, 0 + blt _0800FB1C + adds r1, r0, 0 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + ldr r7, _0800FB5C + adds r0, r7 + adds r0, r2, r0 + ldrb r0, [r0] + cmp r0, 0 + beq _0800FB1C + movs r5, 0x1 + mov r0, r8 + str r1, [r0] + mov r1, r9 + str r3, [r1] + ldr r1, [r6] + ldr r2, _0800FB60 + adds r0, r1, r2 + str r3, [r0] + ldr r7, _0800FB64 + adds r1, r7 + str r4, [r1] +_0800FB1C: + ldr r4, _0800FB68 + ldrh r1, [r4, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0800FB2E + bl sub_80117D0 + movs r5, 0x2 +_0800FB2E: + ldrh r1, [r4, 0x2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0800FB3E + bl sub_80117E4 + movs r5, 0x3 +_0800FB3E: + cmp r5, 0 + beq _0800FABE + adds r0, r5, 0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0800FB50: .4byte gUnknown_203B0E4 +_0800FB54: .4byte 0x00004a18 +_0800FB58: .4byte 0x0000401a +_0800FB5C: .4byte 0x00004018 +_0800FB60: .4byte 0x00004a28 +_0800FB64: .4byte 0x00004a1c +_0800FB68: .4byte gUnknown_20255F0 + thumb_func_end sub_800FAA8 + + thumb_func_start sub_800FB6C +sub_800FB6C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r0, 0 + mov r8, r0 + bl sub_8011494 + ldr r7, _0800FBE8 + ldr r6, _0800FBEC +_0800FB7E: + ldr r5, [r7] + ldr r1, _0800FBF0 + adds r4, r5, r1 + adds r0, r4, 0 + bl AddMenuCursorSprite + bl sub_801169C + ldrh r1, [r6, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0800FBA2 + adds r0, r4, 0 + bl MoveMenuCursorDown + bl sub_80117F8 +_0800FBA2: + ldrh r1, [r6, 0x4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0800FBB6 + adds r0, r4, 0 + bl MoveMenuCursorUp + bl sub_80117F8 +_0800FBB6: + ldrh r1, [r6, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0800FBCA + ldr r2, _0800FBF4 + adds r0, r5, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _0800FC00 +_0800FBCA: + bl sub_80117D0 + ldr r1, [r7] + movs r3, 0x18 + ldrsh r2, [r4, r3] + ldr r3, _0800FBF8 + adds r0, r1, r3 + adds r0, r2 + ldrb r0, [r0] + ldr r2, _0800FBFC + adds r1, r2 + strb r0, [r1] + movs r3, 0x1 + mov r8, r3 + b _0800FC16 + .align 2, 0 +_0800FBE8: .4byte gUnknown_203B0E4 +_0800FBEC: .4byte gUnknown_20255F0 +_0800FBF0: .4byte 0x00004dfc +_0800FBF4: .4byte 0x00004e25 +_0800FBF8: .4byte 0x00004dec +_0800FBFC: .4byte 0x00004df4 +_0800FC00: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0800FC12 + ldr r1, _0800FC24 + adds r0, r5, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0800FB7E +_0800FC12: + bl sub_80117E4 +_0800FC16: + mov r0, r8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0800FC24: .4byte 0x00004e26 + thumb_func_end sub_800FB6C + + thumb_func_start sub_800FC28 +sub_800FC28: + push {r4,r5,lr} + bl sub_8011168 + bl sub_80117AC + ldr r5, _0800FC54 + movs r4, 0x3B +_0800FC36: + ldr r1, [r5] + ldr r0, _0800FC58 + adds r1, r0 + ldr r0, [r1] + subs r0, 0x2 + str r0, [r1] + bl sub_801169C + subs r4, 0x1 + cmp r4, 0 + bge _0800FC36 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0800FC54: .4byte gUnknown_203B0E4 +_0800FC58: .4byte 0x00004dcc + thumb_func_end sub_800FC28 + + thumb_func_start sub_800FC5C +sub_800FC5C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x40 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x14] + movs r0, 0 + str r0, [sp, 0x18] + mov r8, r0 + ldr r1, _0800FD1C + mov r9, r1 + ldr r2, _0800FD20 + str r2, [sp, 0x38] +_0800FC7C: + movs r7, 0 + movs r3, 0 + mov r10, r3 + mov r4, r9 + ldr r0, [r4] + ldr r1, [sp, 0x38] + adds r6, r0, r1 + ldr r2, _0800FD24 + adds r0, r2 + mov r3, r8 + lsls r1, r3, 5 + ldr r0, [r0] + adds r2, r0, r1 + adds r1, r6, 0x2 + movs r5, 0x7 +_0800FC9A: + ldrh r0, [r1] + ldr r4, _0800FD28 + orrs r0, r4 + strh r0, [r1] + adds r1, 0x2 + subs r5, 0x1 + cmp r5, 0 + bge _0800FC9A + movs r5, 0 + adds r1, r2, 0 + adds r1, 0x8 +_0800FCB0: + adds r4, r1, r5 + ldrb r0, [r4] + str r1, [sp, 0x3C] + bl sub_800FFE8 + lsls r0, 24 + ldr r1, [sp, 0x3C] + cmp r0, 0 + beq _0800FCE4 + ldrb r0, [r4] + ldr r7, [sp, 0x14] + cmp r0, r7 + bne _0800FCCE + mov r2, r8 + str r2, [sp, 0x18] +_0800FCCE: + cmp r0, 0 + bne _0800FCE2 + mov r3, r9 + ldr r0, [r3] + ldr r4, _0800FD2C + adds r0, r4 + mov r7, r8 + str r7, [r0] + movs r0, 0x1 + mov r10, r0 +_0800FCE2: + movs r7, 0x1 +_0800FCE4: + adds r5, 0x1 + cmp r5, 0x7 + ble _0800FCB0 + cmp r7, 0 + beq _0800FD30 + movs r5, 0 + movs r4, 0x1 + strb r4, [r6] + adds r3, r6, 0 + adds r3, 0x14 + mov r1, r9 + ldr r0, [r1] + ldr r1, [r0, 0x8] + movs r2, 0x1 + mov r7, r10 + cmp r7, 0 + beq _0800FD08 + movs r2, 0xC +_0800FD08: + movs r0, 0x40 + str r0, [sp] + str r5, [sp, 0x4] + str r4, [sp, 0x8] + adds r0, r3, 0 + movs r3, 0 + bl sub_80053AC + b _0800FD32 + .align 2, 0 +_0800FD1C: .4byte gUnknown_203B0E4 +_0800FD20: .4byte 0x00004018 +_0800FD24: .4byte 0x00004014 +_0800FD28: .4byte 0x0000ffff +_0800FD2C: .4byte 0x00004a24 +_0800FD30: + strb r7, [r6] +_0800FD32: + ldr r0, [sp, 0x38] + adds r0, 0x50 + str r0, [sp, 0x38] + movs r1, 0x1 + add r8, r1 + mov r2, r8 + cmp r2, 0x1F + ble _0800FC7C + movs r3, 0 + mov r8, r3 + ldr r4, [sp, 0x18] + lsls r4, 5 + str r4, [sp, 0x34] +_0800FD4C: + mov r7, r8 + lsls r0, r7, 2 + add r0, r8 + lsls r0, 4 + ldr r1, _0800FEDC + adds r0, r1 + ldr r2, _0800FEE0 + ldr r1, [r2] + adds r3, r1, r0 + ldr r4, _0800FEE4 + adds r1, r4 + lsls r2, r7, 5 + ldr r0, [r1] + adds r0, r2 + str r0, [sp, 0x1C] + ldrb r0, [r3] + adds r7, 0x1 + str r7, [sp, 0x28] + cmp r0, 0 + bne _0800FD76 + b _0800FF56 +_0800FD76: + movs r5, 0 + adds r3, 0x2 + mov r10, r3 + ldr r4, [sp, 0x1C] + adds r4, 0x10 + ldr r6, _0800FEE0 +_0800FD82: + lsls r0, r5, 1 + mov r1, r10 + adds r2, r1, r0 + ldr r1, _0800FEE8 + strh r1, [r2] + adds r1, r4, r0 + ldrh r3, [r1] + movs r7, 0 + ldrsh r0, [r1, r7] + cmp r0, 0 + blt _0800FDB0 + adds r1, r0, 0 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + ldr r1, _0800FEDC + adds r0, r1 + ldr r1, [r6] + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _0800FDB0 + strh r3, [r2] +_0800FDB0: + adds r5, 0x1 + cmp r5, 0x7 + ble _0800FD82 + ldr r3, _0800FEE0 + ldr r2, [r3] + ldr r4, _0800FEEC + adds r0, r2, r4 + ldr r1, [r0] + ldr r7, _0800FEF0 + adds r0, r2, r7 + ldr r3, [r0] + cmp r1, 0 + blt _0800FDEC + cmp r3, 0 + blt _0800FDEC + lsls r0, r3, 2 + adds r0, r3 + lsls r0, 4 + ldr r4, _0800FEDC + adds r0, r4 + adds r0, r2, r0 + ldrb r0, [r0] + cmp r0, 0 + beq _0800FDEC + adds r1, 0x4 + movs r0, 0x7 + ands r1, r0 + lsls r0, r1, 1 + add r0, r10 + strh r3, [r0] +_0800FDEC: + movs r5, 0 +_0800FDEE: + movs r7, 0x1 + negs r7, r7 + str r7, [sp, 0x20] + ldr r0, _0800FEF4 + str r0, [sp, 0x24] + lsls r0, r5, 1 + mov r2, r10 + adds r1, r2, r0 + movs r3, 0 + ldrsh r1, [r1, r3] + str r0, [sp, 0x30] + adds r4, r5, 0x1 + str r4, [sp, 0x2C] + cmp r1, 0 + blt _0800FE0E + b _0800FF4E +_0800FE0E: + movs r6, 0 +_0800FE10: + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 4 + ldr r7, _0800FEDC + adds r0, r7 + ldr r2, _0800FEE0 + ldr r1, [r2] + adds r3, r1, r0 + ldr r4, _0800FEE4 + adds r1, r4 + lsls r2, r6, 5 + ldr r0, [r1] + adds r2, r0, r2 + adds r7, r6, 0x1 + mov r9, r7 + cmp r6, r8 + bne _0800FE34 + b _0800FF3A +_0800FE34: + ldrb r0, [r3] + cmp r0, 0 + bne _0800FE3C + b _0800FF3A +_0800FE3C: + movs r1, 0x4 + ldrsh r0, [r2, r1] + ldr r3, [sp, 0x1C] + movs r4, 0x4 + ldrsh r1, [r3, r4] + subs r0, r1 + lsls r0, 8 + str r0, [sp, 0xC] + movs r7, 0x6 + ldrsh r0, [r2, r7] + movs r2, 0x6 + ldrsh r1, [r3, r2] + subs r0, r1 + lsls r0, 8 + str r0, [sp, 0x10] + add r0, sp, 0xC + bl sub_800A0B0 + adds r2, r0, 0 + ldr r0, [sp, 0xC] + cmp r0, 0 + bge _0800FE6A + adds r0, 0x3 +_0800FE6A: + asrs r1, r0, 2 + str r1, [sp, 0xC] + ldr r0, [sp, 0x10] + cmp r0, 0 + bge _0800FE76 + adds r0, 0x3 +_0800FE76: + asrs r0, 2 + str r0, [sp, 0x10] + cmp r1, 0 + bge _0800FE80 + adds r1, 0xFF +_0800FE80: + asrs r1, 8 + str r1, [sp, 0xC] + cmp r0, 0 + bge _0800FE8A + adds r0, 0xFF +_0800FE8A: + asrs r0, 8 + str r0, [sp, 0x10] + cmp r1, 0 + bne _0800FE96 + movs r0, 0x1 + str r0, [sp, 0xC] +_0800FE96: + ldr r0, [sp, 0x10] + cmp r0, 0 + bne _0800FEA0 + movs r0, 0x1 + str r0, [sp, 0x10] +_0800FEA0: + movs r7, 0 + cmp r5, 0x2 + bne _0800FF04 + ldr r1, _0800FEF8 + ldr r4, _0800FEFC + movs r3, 0x8 + cmp r2, r1 + ble _0800FEB8 + ldr r0, _0800FF00 +_0800FEB2: + adds r2, r0 + cmp r2, r1 + bgt _0800FEB2 +_0800FEB8: + cmp r2, 0 + bge _0800FEC6 + movs r0, 0x80 + lsls r0, 5 +_0800FEC0: + adds r2, r0 + cmp r2, 0 + blt _0800FEC0 +_0800FEC6: + adds r1, r3, r4 + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, r2 + blt _0800FF20 + movs r4, 0x2 + ldrsh r0, [r1, r4] + cmp r0, r2 + ble _0800FF1C + b _0800FF20 + .align 2, 0 +_0800FEDC: .4byte 0x00004018 +_0800FEE0: .4byte gUnknown_203B0E4 +_0800FEE4: .4byte 0x00004014 +_0800FEE8: .4byte 0x0000ffff +_0800FEEC: .4byte 0x00004a28 +_0800FEF0: .4byte 0x00004a1c +_0800FEF4: .4byte 0x000f423f +_0800FEF8: .4byte 0x00000fff +_0800FEFC: .4byte gUnknown_80D3EBC +_0800FF00: .4byte 0xfffff000 +_0800FF04: + ldr r0, _0800FFC8 + lsls r1, r5, 2 + adds r1, r0 + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, r2 + bgt _0800FF1C + movs r4, 0x2 + ldrsh r0, [r1, r4] + cmp r0, r2 + ble _0800FF1C + movs r7, 0x1 +_0800FF1C: + cmp r7, 0 + beq _0800FF3A +_0800FF20: + ldr r0, [sp, 0xC] + adds r1, r0, 0 + muls r1, r0 + ldr r0, [sp, 0x10] + adds r7, r0, 0 + muls r7, r0 + adds r0, r7, 0 + adds r1, r0 + ldr r0, [sp, 0x24] + cmp r0, r1 + ble _0800FF3A + str r1, [sp, 0x24] + str r6, [sp, 0x20] +_0800FF3A: + mov r6, r9 + cmp r6, 0x1F + bgt _0800FF42 + b _0800FE10 +_0800FF42: + ldr r1, [sp, 0x20] + cmp r1, 0 + blt _0800FF4E + ldr r0, [sp, 0x30] + add r0, r10 + strh r1, [r0] +_0800FF4E: + ldr r5, [sp, 0x2C] + cmp r5, 0x7 + bgt _0800FF56 + b _0800FDEE +_0800FF56: + ldr r3, [sp, 0x28] + mov r8, r3 + cmp r3, 0x1F + bgt _0800FF60 + b _0800FD4C +_0800FF60: + ldr r4, _0800FFCC + ldr r1, [r4] + ldr r7, _0800FFD0 + adds r0, r1, r7 + ldr r1, [r1, 0xC] + movs r2, 0 + str r2, [sp] + str r2, [sp, 0x4] + movs r2, 0x1 + str r2, [sp, 0x8] + movs r2, 0 + movs r3, 0 + bl sub_80053AC + ldr r2, [r4] + ldr r1, _0800FFD4 + adds r0, r2, r1 + ldr r3, [sp, 0x18] + str r3, [r0] + ldr r4, _0800FFD8 + adds r1, r2, r4 + ldr r7, _0800FFDC + adds r0, r2, r7 + ldr r0, [r0] + ldr r3, [sp, 0x34] + adds r0, r3, r0 + ldr r0, [r0, 0x4] + str r0, [r1] + ldrh r0, [r1] + subs r0, 0x78 + subs r4, 0x4 + adds r1, r2, r4 + strh r0, [r1] + ldr r7, _0800FFE0 + adds r0, r2, r7 + ldrh r0, [r0] + subs r0, 0x50 + ldr r1, _0800FFE4 + adds r2, r1 + strh r0, [r2] + bl sub_8011240 + bl sub_80110B0 + add sp, 0x40 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0800FFC8: .4byte gUnknown_80D3EBC +_0800FFCC: .4byte gUnknown_203B0E4 +_0800FFD0: .4byte 0x00004c10 +_0800FFD4: .4byte 0x00004a18 +_0800FFD8: .4byte 0x00004dd8 +_0800FFDC: .4byte 0x00004014 +_0800FFE0: .4byte 0x00004dda +_0800FFE4: .4byte 0x00004dd6 + thumb_func_end sub_800FC5C + + thumb_func_start sub_800FFE8 +sub_800FFE8: + push {lr} + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x39 + bhi _08010004 + cmp r0, 0 + beq _0801000C + ldr r0, _08010008 + ldr r0, [r0] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0801000C +_08010004: + movs r0, 0 + b _0801000E + .align 2, 0 +_08010008: .4byte gUnknown_203B468 +_0801000C: + movs r0, 0x1 +_0801000E: + pop {r1} + bx r1 + thumb_func_end sub_800FFE8 + + thumb_func_start sub_8010014 +sub_8010014: + push {r4,r5,lr} + sub sp, 0x20 + ldr r1, _08010094 + mov r0, sp + movs r2, 0x10 + bl memcpy + add r4, sp, 0x10 + ldr r1, _08010098 + adds r0, r4, 0 + movs r2, 0x10 + bl memcpy + movs r2, 0 + ldr r0, _0801009C + ldrh r3, [r0] + movs r0, 0x80 + lsls r0, 1 + ands r0, r3 + mov r5, sp + cmp r0, 0 + beq _08010042 + adds r5, r4, 0 +_08010042: + adds r1, r3, 0 + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0801004E + movs r2, 0x1 +_0801004E: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0801005A + movs r0, 0x2 + orrs r2, r0 +_0801005A: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08010066 + movs r0, 0x4 + orrs r2, r0 +_08010066: + movs r0, 0x20 + ands r0, r3 + cmp r0, 0 + beq _08010072 + movs r0, 0x8 + orrs r2, r0 +_08010072: + ldr r3, _080100A0 + adds r2, r5, r2 + ldrb r1, [r2] + ldrb r0, [r3] + cmp r0, r1 + bne _080100A8 + ldr r1, _080100A4 + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bls _080100B0 + ldrb r0, [r2] + b _080100B2 + .align 2, 0 +_08010094: .4byte gUnknown_80D3EDC +_08010098: .4byte gUnknown_80D3EEC +_0801009C: .4byte gUnknown_20255F0 +_080100A0: .4byte gUnknown_202DE18 +_080100A4: .4byte gUnknown_202DE19 +_080100A8: + strb r1, [r3] + ldr r1, _080100BC + movs r0, 0 + strb r0, [r1] +_080100B0: + movs r0, 0xFF +_080100B2: + add sp, 0x20 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080100BC: .4byte gUnknown_202DE19 + thumb_func_end sub_8010014 + + thumb_func_start sub_80100C0 +sub_80100C0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + str r0, [sp, 0xC] + mov r8, r2 + ldr r4, _080101E0 + ldr r2, [r4] + ldr r3, _080101E4 + adds r0, r2, r3 + ldr r2, [r2, 0xC] + movs r3, 0x7 + ands r3, r1 + movs r1, 0 + str r1, [sp] + str r1, [sp, 0x4] + movs r1, 0x1 + str r1, [sp, 0x8] + adds r1, r2, 0 + movs r2, 0 + bl sub_80053AC + bl sub_8011168 + ldr r0, [r4] + ldr r2, _080101E8 + adds r1, r0, r2 + ldr r1, [r1] + ldr r3, _080101EC + adds r0, r3 + ldr r2, [r0] + lsls r1, 5 + adds r1, r2 + ldr r1, [r1, 0x4] + mov r9, r1 + ldr r1, [sp, 0xC] + lsls r0, r1, 5 + adds r0, r2 + ldr r0, [r0, 0x4] + str r0, [sp, 0x10] + bl sub_80117F8 + movs r7, 0 + cmp r7, r8 + bge _0801018A + ldr r2, [sp, 0x10] + lsls r1, r2, 16 + asrs r1, 16 + mov r3, r9 + lsls r0, r3, 16 + asrs r0, 16 + subs r1, r0 + str r1, [sp, 0x14] + movs r0, 0 + mov r10, r0 +_08010132: + ldr r0, _080101E0 + ldr r6, [r0] + lsls r5, r7, 8 + mov r0, r10 + mov r1, r8 + bl __divsi3 + cmp r0, 0 + bge _08010146 + adds r0, 0xFF +_08010146: + asrs r0, 8 + add r0, r9 + ldr r2, _080101F0 + adds r1, r6, r2 + strh r0, [r1] + ldr r3, [sp, 0x10] + asrs r0, r3, 16 + mov r1, r9 + asrs r4, r1, 16 + subs r0, r4 + muls r0, r5 + mov r1, r8 + bl __divsi3 + cmp r0, 0 + bge _08010168 + adds r0, 0xFF +_08010168: + asrs r0, 8 + adds r0, r4 + ldr r2, _080101F4 + adds r1, r6, r2 + strh r0, [r1] + bl sub_8011240 + bl sub_80110B0 + bl sub_801169C + ldr r3, [sp, 0x14] + lsls r0, r3, 8 + add r10, r0 + adds r7, 0x1 + cmp r7, r8 + blt _08010132 +_0801018A: + ldr r4, _080101E0 + ldr r0, [r4] + ldr r2, _080101E8 + adds r1, r0, r2 + ldr r3, [sp, 0xC] + str r3, [r1] + ldr r1, _080101F0 + adds r2, r0, r1 + ldr r3, _080101EC + adds r0, r3 + ldr r1, [r0] + ldr r3, [sp, 0xC] + lsls r0, r3, 5 + adds r0, r1 + ldr r0, [r0, 0x4] + str r0, [r2] + bl sub_8011240 + bl sub_80110B0 + bl sub_801169C + ldr r1, [r4] + ldr r2, _080101E4 + adds r0, r1, r2 + ldr r1, [r1, 0xC] + movs r2, 0 + str r2, [sp] + str r2, [sp, 0x4] + movs r2, 0x1 + str r2, [sp, 0x8] + movs r2, 0 + movs r3, 0 + bl sub_80053AC + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080101E0: .4byte gUnknown_203B0E4 +_080101E4: .4byte 0x00004c10 +_080101E8: .4byte 0x00004a18 +_080101EC: .4byte 0x00004014 +_080101F0: .4byte 0x00004dd8 +_080101F4: .4byte 0x00004dda + thumb_func_end sub_80100C0 + + thumb_func_start sub_80101F8 +sub_80101F8: + push {lr} + adds r3, r0, 0 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0 + bne _08010218 + ldr r0, _08010214 + adds r2, r3, 0 + adds r2, 0x50 + adds r1, r3, 0 + movs r3, 0 + bl sub_8014BC4 + b _08010220 + .align 2, 0 +_08010214: .4byte gUnknown_80D3EFC +_08010218: + adds r0, r3, 0 + movs r2, 0 + bl sub_8092578 +_08010220: + pop {r0} + bx r0 + thumb_func_end sub_80101F8 + + thumb_func_start sub_8010224 +sub_8010224: + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r7, 0 + ldr r0, _08010248 + adds r4, r0, 0x4 + adds r5, r0, 0 + adds r5, 0x8 +_08010234: + movs r2, 0 + adds r3, r5, 0 +_08010238: + adds r0, r3, r2 + ldrb r0, [r0] + cmp r0, r6 + bne _0801024C + ldrh r0, [r4] + strh r0, [r1] + ldrh r0, [r4, 0x2] + b _08010260 + .align 2, 0 +_08010248: .4byte gUnknown_80D3570 +_0801024C: + adds r2, 0x1 + cmp r2, 0x7 + ble _08010238 + adds r4, 0x20 + adds r5, 0x20 + adds r7, 0x1 + cmp r7, 0x1F + ble _08010234 + movs r0, 0 + strh r0, [r1] +_08010260: + strh r0, [r1, 0x2] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8010224 + + thumb_func_start sub_8010268 +sub_8010268: + push {r4-r6,lr} + ldr r4, _080102D4 + add sp, r4 + adds r5, r0, 0 + ldr r1, _080102D8 + adds r0, 0xB0 + ldr r0, [r0] + str r0, [r1] + ldr r1, _080102DC + ldr r2, _080102E0 + adds r0, r2, 0 + strh r0, [r1] + movs r0, 0 + movs r1, 0x14 + bl sub_80095CC + movs r0, 0x2 + bl xxx_update_some_bg_tiles + bl sub_801059C + adds r0, r5, 0x4 + bl sub_8010494 + bl sub_801178C + movs r4, 0x3B +_0801029E: + bl sub_8010960 + subs r4, 0x1 + cmp r4, 0 + bge _0801029E + ldrb r0, [r5, 0x4] + ldrb r1, [r5, 0x8] + bl sub_8010344 + adds r0, r5, 0 + adds r0, 0x8 + bl sub_8010B74 + adds r6, r5, 0 + adds r6, 0x70 + movs r4, 0x3B +_080102BE: + bl sub_8010960 + subs r4, 0x1 + cmp r4, 0 + bge _080102BE + ldrb r0, [r5, 0x14] + cmp r0, 0 + beq _080102E4 + movs r0, 0x20 + ldrsh r1, [r5, r0] + b _080102E6 + .align 2, 0 +_080102D4: .4byte 0xfffffc14 +_080102D8: .4byte gUnknown_203B0E8 +_080102DC: .4byte gUnknown_2026E4E +_080102E0: .4byte 0x00000a06 +_080102E4: + movs r1, 0 +_080102E6: + ldrb r0, [r5, 0x8] + ldrb r3, [r6] + movs r4, 0 + str r4, [sp] + add r2, sp, 0x4 + bl sub_809034C + cmp r0, 0 + beq _0801031C + cmp r0, 0x1 + bne _0801030A + add r0, sp, 0x4 + bl sub_8010C10 + adds r0, r5, 0 + adds r0, 0xB4 + strb r4, [r0] + b _0801032C +_0801030A: + cmp r0, 0x2 + bne _0801032C + add r0, sp, 0x4 + bl sub_8010C58 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _08010326 +_0801031C: + adds r1, r5, 0 + adds r1, 0xB4 + movs r0, 0x1 + strb r0, [r1] + b _0801032C +_08010326: + adds r0, r5, 0 + adds r0, 0xB4 + strb r1, [r0] +_0801032C: + bl sub_801091C + bl sub_801073C + bl nullsub_16 + movs r3, 0xFB + lsls r3, 2 + add sp, r3 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8010268 + + thumb_func_start sub_8010344 +sub_8010344: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + lsls r0, 24 + lsls r1, 24 + ldr r2, _08010470 + lsrs r0, 22 + adds r0, r2 + lsrs r1, 22 + adds r1, r2 + ldr r2, [r1] + str r2, [sp, 0x14] + movs r3, 0 + ldrsh r5, [r1, r3] + ldr r1, [r0] + mov r9, r1 + movs r2, 0 + ldrsh r6, [r0, r2] + subs r2, r5, r6 + cmp r2, 0 + bge _08010376 + negs r2, r2 +_08010376: + ldr r3, [sp, 0x14] + asrs r0, r3, 16 + mov r3, r9 + asrs r1, r3, 16 + subs r4, r0, r1 + adds r3, r4, 0 + str r0, [sp, 0x18] + mov r8, r1 + cmp r4, 0 + bge _0801038C + negs r4, r4 +_0801038C: + cmp r4, r2 + bge _08010392 + adds r4, r2, 0 +_08010392: + lsrs r0, r4, 31 + adds r0, r4, r0 + asrs r4, r0, 1 + subs r0, r6, r5 + str r0, [sp, 0xC] + str r3, [sp, 0x10] + add r0, sp, 0xC + bl sub_800A0B0 + ldr r1, _08010474 + adds r3, r0, r1 + cmp r3, 0 + bge _080103B0 + ldr r2, _08010478 + adds r3, r0, r2 +_080103B0: + asrs r3, 9 + movs r0, 0x7 + ands r3, r0 + ldr r0, _0801047C + ldr r1, [r0] + ldr r2, _08010480 + adds r0, r1, r2 + ldr r2, _08010484 + adds r1, r2 + ldr r1, [r1] + movs r2, 0 + str r2, [sp] + str r2, [sp, 0x4] + movs r2, 0x1 + str r2, [sp, 0x8] + movs r2, 0 + bl sub_80053AC + movs r7, 0 + cmp r7, r4 + bge _08010448 + mov r10, r5 +_080103DC: + ldr r0, _0801047C + ldr r6, [r0] + mov r3, r9 + lsls r0, r3, 16 + asrs r0, 16 + mov r1, r10 + subs r0, r1, r0 + lsls r5, r7, 8 + muls r0, r5 + adds r1, r4, 0 + bl __divsi3 + cmp r0, 0 + bge _080103FA + adds r0, 0xFF +_080103FA: + asrs r0, 8 + add r0, r9 + ldr r2, _08010488 + adds r1, r6, r2 + strh r0, [r1] + ldr r3, [sp, 0x18] + mov r1, r8 + subs r0, r3, r1 + muls r0, r5 + adds r1, r4, 0 + bl __divsi3 + cmp r0, 0 + bge _08010418 + adds r0, 0xFF +_08010418: + asrs r0, 8 + add r0, r8 + ldr r2, _0801048C + adds r1, r6, r2 + strh r0, [r1] + bl sub_8010798 + bl sub_8010858 + bl sub_8010960 + ldr r0, _08010490 + ldrh r1, [r0, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08010448 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08010448 + adds r7, 0x1 + cmp r7, r4 + blt _080103DC +_08010448: + ldr r0, _0801047C + ldr r0, [r0] + ldr r3, _08010488 + adds r0, r3 + ldr r1, [sp, 0x14] + str r1, [r0] + bl sub_8010798 + bl sub_8010858 + bl sub_8010960 + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08010470: .4byte gUnknown_80D3F14 +_08010474: .4byte 0xfffffc00 +_08010478: .4byte 0xfffffdff +_0801047C: .4byte gUnknown_203B0E8 +_08010480: .4byte 0x00005114 +_08010484: .4byte 0x0000110c +_08010488: .4byte 0x000052dc +_0801048C: .4byte 0x000052de +_08010490: .4byte gUnknown_20255F0 + thumb_func_end sub_8010344 + + thumb_func_start sub_8010494 +sub_8010494: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + mov r9, r0 + movs r5, 0 + ldr r0, _080104C0 + mov r10, r0 + mov r8, r5 +_080104AA: + mov r1, r10 + ldr r0, [r1] + mov r3, r8 + adds r4, r0, r3 + cmp r5, 0x3E + bgt _080104C4 + mov r0, r9 + adds r0, 0x6D + adds r0, r5 + ldrb r0, [r0] + b _080104C6 + .align 2, 0 +_080104C0: .4byte gUnknown_203B0E8 +_080104C4: + movs r0, 0x1 +_080104C6: + cmp r0, 0 + beq _0801050C + movs r7, 0 + movs r6, 0x1 + strb r6, [r4] + adds r3, r4, 0 + adds r3, 0x8 + mov r1, r10 + ldr r0, [r1] + ldr r1, _08010504 + adds r0, r1 + ldr r1, [r0] + movs r2, 0x1 + cmp r5, 0x3F + bne _080104E6 + movs r2, 0xC +_080104E6: + movs r0, 0x40 + str r0, [sp] + str r7, [sp, 0x4] + str r6, [sp, 0x8] + adds r0, r3, 0 + movs r3, 0 + bl sub_80053AC + ldr r1, _08010508 + lsls r0, r5, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [r4, 0x4] + b _0801050E + .align 2, 0 +_08010504: .4byte 0x00001108 +_08010508: .4byte gUnknown_80D3F14 +_0801050C: + strb r0, [r4] +_0801050E: + movs r3, 0x44 + add r8, r3 + adds r5, 0x1 + cmp r5, 0x3F + ble _080104AA + movs r2, 0 + ldr r4, _0801057C + ldr r1, [r4] + ldr r3, _08010580 + adds r0, r1, r3 + ldr r3, _08010584 + adds r1, r3 + ldr r1, [r1] + str r2, [sp] + str r2, [sp, 0x4] + movs r2, 0x1 + str r2, [sp, 0x8] + movs r2, 0 + movs r3, 0 + bl sub_80053AC + ldr r2, [r4] + ldr r4, _08010588 + adds r3, r2, r4 + ldr r1, _0801058C + mov r4, r9 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [r3] + ldrh r0, [r3] + subs r0, 0x78 + ldr r3, _08010590 + adds r1, r2, r3 + strh r0, [r1] + ldr r4, _08010594 + adds r0, r2, r4 + ldrh r0, [r0] + subs r0, 0x50 + ldr r1, _08010598 + adds r2, r1 + strh r0, [r2] + bl sub_8010798 + bl sub_8010858 + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0801057C: .4byte gUnknown_203B0E8 +_08010580: .4byte 0x00005114 +_08010584: .4byte 0x0000110c +_08010588: .4byte 0x000052dc +_0801058C: .4byte gUnknown_80D3F14 +_08010590: .4byte 0x000052d8 +_08010594: .4byte 0x000052de +_08010598: .4byte 0x000052da + thumb_func_end sub_8010494 + + thumb_func_start sub_801059C +sub_801059C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + bl sub_808D33C + adds r7, r0, 0 + ldr r6, _080106E4 + ldr r0, [r6] + ldr r5, _080106E8 + adds r1, r5, 0 + bl sub_800A9EC + str r0, [sp, 0xC] + ldr r0, [r6, 0x4] + adds r1, r5, 0 + bl sub_800A9EC + str r0, [sp, 0x10] + ldr r1, _080106EC + movs r0, 0x8 + ldrsh r2, [r7, r0] + mov r0, sp + bl sprintf + ldr r1, _080106F0 + mov r8, r1 + mov r0, sp + bl sub_800A9EC + ldr r4, _080106F4 + ldr r1, [r4] + ldr r2, _080106F8 + adds r1, r2 + str r0, [r1] + ldr r0, _080106FC + adds r1, r5, 0 + bl sub_800A9EC + ldr r1, [r4] + ldr r3, _08010700 + mov r9, r3 + add r1, r9 + str r0, [r1] + ldr r0, [r6, 0x8] + adds r1, r5, 0 + bl sub_800A9EC + ldr r1, [r4] + ldr r2, _08010704 + mov r10, r2 + add r1, r10 + str r0, [r1] + ldr r0, _08010708 + mov r1, r8 + bl sub_800A9EC + ldr r1, [r4] + ldr r3, _0801070C + adds r1, r3 + str r0, [r1] + ldr r0, [r6, 0xC] + adds r1, r5, 0 + bl sub_800A9EC + ldr r1, [r4] + movs r2, 0x88 + lsls r2, 5 + adds r1, r2 + str r0, [r1] + movs r3, 0x8 + ldrsh r0, [r7, r3] + movs r1, 0 + bl sub_808DD68 + ldr r1, [r4] + ldr r3, _08010710 + adds r2, r1, r3 + lsls r0, 24 + lsrs r0, 24 + str r0, [r2] + add r1, r9 + ldr r0, [r1] + movs r1, 0x40 + movs r2, 0x1F + movs r3, 0 + bl sub_8005610 + ldr r0, _08010714 + movs r1, 0 + ldr r2, [sp, 0xC] + bl sub_800AE28 + ldr r1, [r4] + ldr r2, _08010718 + adds r0, r1, r2 + add r1, r10 + ldr r1, [r1] + movs r2, 0x10 + bl sub_8004AA4 + movs r1, 0x80 + lsls r1, 7 + ldr r0, [r4] + ldr r3, _0801071C + adds r0, r3 + ldr r2, [sp, 0x10] + bl sub_800AAA8 + ldr r1, [r4] + ldr r2, _08010720 + adds r0, r1, r2 + movs r2, 0 + str r2, [r0] + ldr r3, _08010724 + adds r0, r1, r3 + strh r2, [r0] + ldr r0, _08010728 + adds r1, r0 + strh r2, [r1] + movs r3, 0 + ldr r1, _0801072C + mov r9, r1 + mov r8, r4 + ldr r7, _08010730 + ldr r2, _08010734 + adds r4, r2, 0 + ldr r6, _08010738 + movs r5, 0 +_080106A2: + mov r0, r8 + ldr r2, [r0] + lsls r0, r3, 1 + adds r1, r2, r7 + adds r1, r0 + ldrh r0, [r1] + orrs r0, r4 + strh r0, [r1] + adds r2, r6 + adds r2, r3 + strb r5, [r2] + adds r3, 0x1 + cmp r3, r9 + ble _080106A2 + ldr r0, [sp, 0xC] + bl sub_800AA14 + ldr r0, [sp, 0x10] + bl sub_800AA14 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080106E4: .4byte gUnknown_80D4014 +_080106E8: .4byte gUnknown_8380000 +_080106EC: .4byte gUnknown_80D405C +_080106F0: .4byte gUnknown_8510000 +_080106F4: .4byte gUnknown_203B0E8 +_080106F8: .4byte 0x0000110c +_080106FC: .4byte gUnknown_80D4064 +_08010700: .4byte 0x00001108 +_08010704: .4byte 0x00001110 +_08010708: .4byte gUnknown_80D406C +_0801070C: .4byte 0x00001104 +_08010710: .4byte 0x000052d4 +_08010714: .4byte 0x06008000 +_08010718: .4byte 0x00005150 +_0801071C: .4byte 0x00001114 +_08010720: .4byte 0x000052d0 +_08010724: .4byte 0x000052d8 +_08010728: .4byte 0x000052da +_0801072C: .4byte 0x000005db +_08010730: .4byte 0x000052e0 +_08010734: .4byte 0x0000ffff +_08010738: .4byte 0x00005e98 + thumb_func_end sub_801059C + + thumb_func_start sub_801073C +sub_801073C: + push {r4,lr} + ldr r4, _08010784 + ldr r0, [r4] + ldr r1, _08010788 + adds r0, r1 + ldr r0, [r0] + bl sub_800AA14 + ldr r0, [r4] + ldr r1, _0801078C + adds r0, r1 + ldr r0, [r0] + bl sub_800AA14 + ldr r0, [r4] + ldr r1, _08010790 + adds r0, r1 + ldr r0, [r0] + bl sub_800AA14 + ldr r0, [r4] + movs r1, 0x88 + lsls r1, 5 + adds r0, r1 + ldr r0, [r0] + bl sub_800AA14 + ldr r0, [r4] + ldr r1, _08010794 + adds r0, r1 + ldr r0, [r0] + bl sub_800AA14 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08010784: .4byte gUnknown_203B0E8 +_08010788: .4byte 0x00001110 +_0801078C: .4byte 0x0000110c +_08010790: .4byte 0x00001108 +_08010794: .4byte 0x00001104 + thumb_func_end sub_801073C + + thumb_func_start sub_8010798 +sub_8010798: + push {r4-r6,lr} + ldr r2, _080107BC + ldr r0, [r2] + ldr r1, _080107C0 + adds r3, r0, r1 + movs r4, 0 + ldrsh r1, [r3, r4] + ldr r5, _080107C4 + adds r4, r0, r5 + movs r6, 0 + ldrsh r0, [r4, r6] + subs r1, r0 + adds r5, r2, 0 + cmp r1, 0x2F + bgt _080107C8 + ldrh r0, [r3] + subs r0, 0x30 + b _080107D0 + .align 2, 0 +_080107BC: .4byte gUnknown_203B0E8 +_080107C0: .4byte 0x000052dc +_080107C4: .4byte 0x000052d8 +_080107C8: + cmp r1, 0xC0 + ble _080107D2 + ldrh r0, [r3] + subs r0, 0xC0 +_080107D0: + strh r0, [r4] +_080107D2: + ldr r0, [r5] + ldr r1, _080107F0 + adds r3, r0, r1 + movs r2, 0 + ldrsh r1, [r3, r2] + ldr r4, _080107F4 + adds r2, r0, r4 + movs r6, 0 + ldrsh r0, [r2, r6] + subs r1, r0 + cmp r1, 0x2F + bgt _080107F8 + ldrh r0, [r3] + subs r0, 0x30 + b _08010800 + .align 2, 0 +_080107F0: .4byte 0x000052de +_080107F4: .4byte 0x000052da +_080107F8: + cmp r1, 0x70 + ble _08010802 + ldrh r0, [r3] + subs r0, 0x70 +_08010800: + strh r0, [r2] +_08010802: + adds r3, r5, 0 + ldr r0, [r3] + ldr r4, _08010850 + adds r1, r0, r4 + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0 + bge _08010816 + movs r0, 0 + strh r0, [r1] +_08010816: + ldr r0, [r3] + ldr r2, _08010854 + adds r1, r0, r2 + movs r6, 0 + ldrsh r0, [r1, r6] + cmp r0, 0 + bge _08010828 + movs r0, 0 + strh r0, [r1] +_08010828: + ldr r0, [r3] + adds r1, r0, r4 + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0xEF + ble _08010838 + movs r0, 0xF0 + strh r0, [r1] +_08010838: + ldr r0, [r5] + adds r2, r0, r2 + movs r4, 0 + ldrsh r0, [r2, r4] + cmp r0, 0x9F + ble _08010848 + movs r0, 0xA0 + strh r0, [r2] +_08010848: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08010850: .4byte 0x000052d8 +_08010854: .4byte 0x000052da + thumb_func_end sub_8010798 + + thumb_func_start sub_8010858 +sub_8010858: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r0, _080108FC + ldr r1, [r0] + ldr r2, _08010900 + adds r1, r2 + ldrh r1, [r1] + lsls r1, 16 + asrs r6, r1, 19 + adds r2, r6, 0 + movs r3, 0 + mov r10, r0 + movs r0, 0x1F + mov r9, r0 +_0801087C: + mov r1, r10 + ldr r0, [r1] + ldr r1, _08010904 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 16 + asrs r4, r0, 19 + lsls r1, r2, 7 + adds r2, 0x1 + mov r12, r2 + adds r3, 0x1 + mov r8, r3 + movs r7, 0x1E + lsls r0, r4, 1 + adds r5, r0, r1 +_0801089A: + mov r2, r9 + ands r4, r2 + ands r6, r2 + lsls r2, r4, 1 + lsls r0, r6, 6 + adds r2, r0 + ldr r3, _08010908 + adds r3, r2, r3 + str r3, [sp] + mov r0, r10 + ldr r1, [r0] + ldr r3, _0801090C + adds r0, r1, r3 + adds r0, r5 + ldrh r0, [r0] + ldr r3, [sp] + strh r0, [r3] + ldr r0, _08010910 + adds r2, r0 + ldr r3, _08010914 + adds r1, r3 + adds r1, r5 + ldrh r0, [r1] + strh r0, [r2] + adds r5, 0x2 + adds r4, 0x1 + subs r7, 0x1 + cmp r7, 0 + bge _0801089A + mov r2, r12 + adds r6, 0x1 + mov r3, r8 + cmp r3, 0x14 + ble _0801087C + movs r0, 0x2 + bl sub_80098F8 + movs r0, 0x3 + bl sub_80098F8 + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080108FC: .4byte gUnknown_203B0E8 +_08010900: .4byte 0x000052da +_08010904: .4byte 0x000052d8 +_08010908: .4byte gUnknown_202C038 +_0801090C: .4byte 0x00003114 +_08010910: .4byte gUnknown_202C838 +_08010914: .4byte 0x00001114 + thumb_func_end sub_8010858 + + thumb_func_start nullsub_24 +nullsub_24: + bx lr + thumb_func_end nullsub_24 + + thumb_func_start sub_801091C +sub_801091C: + push {r4,r5,lr} + bl sub_8010950 + bl sub_80117C4 + ldr r5, _08010948 + movs r4, 0x3B +_0801092A: + ldr r1, [r5] + ldr r0, _0801094C + adds r1, r0 + ldr r0, [r1] + subs r0, 0x2 + str r0, [r1] + bl sub_8010960 + subs r4, 0x1 + cmp r4, 0 + bge _0801092A + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08010948: .4byte gUnknown_203B0E8 +_0801094C: .4byte 0x000052d0 + thumb_func_end sub_801091C + + thumb_func_start sub_8010950 +sub_8010950: + push {lr} + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r0} + bx r0 + thumb_func_end sub_8010950 + + thumb_func_start sub_8010960 +sub_8010960: + push {r4-r6,lr} + ldr r6, _080109EC + ldr r1, [r6] + ldr r4, _080109F0 + adds r0, r1, r4 + movs r2, 0 + ldrsh r0, [r0, r2] + ldr r5, _080109F4 + adds r1, r5 + movs r2, 0 + ldrsh r1, [r1, r2] + bl sub_800CCA0 + ldr r1, [r6] + adds r4, r1, r4 + movs r2, 0 + ldrsh r0, [r4, r2] + adds r1, r5 + movs r2, 0 + ldrsh r1, [r1, r2] + bl sub_800CCAC + movs r0, 0x1 + bl sub_8010A88 + bl sub_8010A00 + movs r0, 0 + movs r1, 0 + bl sub_8005838 + ldr r0, _080109F8 + ldr r0, [r0] + ldrb r0, [r0, 0xA] + bl nullsub_8 + bl sub_8005180 + bl sub_80060EC + ldr r0, _080109FC + ldr r0, [r0] + bl sub_8094FB4 + bl sub_800CB20 + bl sub_800485C + bl CopySpritesToOam + bl sub_8005304 + bl TransferBGPaletteBuffer + bl xxx_call_update_bg_vram + bl nullsub_24 + bl sub_8009908 + bl xxx_call_update_bg_sound_input + bl sub_8011860 + movs r0, 0 + bl sub_8004D8C + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080109EC: .4byte gUnknown_203B0E8 +_080109F0: .4byte 0x000052d8 +_080109F4: .4byte 0x000052da +_080109F8: .4byte gUnknown_203B46C +_080109FC: .4byte gUnknown_203B47C + thumb_func_end sub_8010960 + + thumb_func_start sub_8010A00 +sub_8010A00: + push {r4-r6,lr} + movs r3, 0 + ldr r6, _08010A7C + ldr r0, [r6] + ldr r2, _08010A80 + adds r1, r0, r2 + ldr r2, [r1] + cmp r2, 0x1E + bgt _08010A74 + movs r3, 0x88 + lsls r3, 5 + adds r0, r3 + ldr r0, [r0] + ldr r5, [r0, 0x4] + adds r0, r2, 0x1 + str r0, [r1] + cmp r0, 0x1E + ble _08010A28 + movs r0, 0x1F + str r0, [r1] +_08010A28: + movs r4, 0 +_08010A2A: + ldr r0, [r6] + ldr r1, _08010A80 + adds r0, r1 + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + movs r3, 0 + bl SetBGPaletteBufferColorRGB + adds r5, 0x4 + adds r4, 0x1 + cmp r4, 0xDF + ble _08010A2A + ldr r0, _08010A7C + ldr r0, [r0] + ldr r2, _08010A84 + adds r0, r2 + ldr r0, [r0] + ldr r5, [r0, 0x4] + movs r4, 0 +_08010A52: + movs r3, 0x80 + lsls r3, 1 + adds r0, r4, r3 + ldr r1, _08010A7C + ldr r1, [r1] + ldr r2, _08010A80 + adds r1, r2 + ldr r2, [r1] + adds r1, r5, 0 + movs r3, 0 + bl SetBGPaletteBufferColorRGB + adds r5, 0x4 + adds r4, 0x1 + cmp r4, 0xEF + ble _08010A52 + movs r3, 0x1 +_08010A74: + adds r0, r3, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08010A7C: .4byte gUnknown_203B0E8 +_08010A80: .4byte 0x000052d0 +_08010A84: .4byte 0x00001104 + thumb_func_end sub_8010A00 + + thumb_func_start sub_8010A88 +sub_8010A88: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + add r0, sp, 0x8 + bl sub_8004E8C + add r1, sp, 0x8 + ldr r0, _08010B58 + strh r0, [r1, 0x4] + movs r0, 0x80 + lsls r0, 4 + strh r0, [r1, 0xA] + ldr r6, _08010B5C + ldr r0, [r6] + ldr r2, _08010B60 + adds r1, r0, r2 + ldr r5, [r1] + ldr r3, _08010B64 + adds r0, r3 + bl sub_80054BC + mov r0, r9 + cmp r0, 0 + beq _08010AF6 + ldr r4, [r6] + ldr r1, _08010B64 + adds r0, r4, r1 + ldr r2, _08010B68 + adds r1, r4, r2 + movs r3, 0 + ldrsh r1, [r1, r3] + lsls r2, r5, 16 + asrs r2, 16 + subs r1, r2 + ldr r3, _08010B6C + adds r2, r4, r3 + movs r3, 0 + ldrsh r2, [r2, r3] + asrs r3, r5, 16 + subs r2, r3 + ldr r3, _08010B70 + adds r4, r3 + ldr r3, [r4] + str r3, [sp] + add r3, sp, 0x8 + str r3, [sp, 0x4] + movs r3, 0x3 + bl sub_800558C +_08010AF6: + lsls r0, r5, 16 + asrs r0, 16 + mov r10, r0 + movs r7, 0 + asrs r5, 16 + mov r8, r5 + movs r6, 0x3F +_08010B04: + ldr r1, _08010B5C + ldr r0, [r1] + adds r4, r0, r7 + ldrb r0, [r4] + cmp r0, 0 + beq _08010B40 + adds r5, r4, 0 + adds r5, 0x8 + adds r0, r5, 0 + bl sub_80054BC + mov r2, r9 + cmp r2, 0 + beq _08010B40 + movs r3, 0x4 + ldrsh r1, [r4, r3] + mov r0, r10 + subs r1, r0 + movs r3, 0x6 + ldrsh r2, [r4, r3] + mov r0, r8 + subs r2, r0 + movs r0, 0 + str r0, [sp] + add r3, sp, 0x8 + str r3, [sp, 0x4] + adds r0, r5, 0 + movs r3, 0x1 + bl sub_800558C +_08010B40: + adds r7, 0x44 + subs r6, 0x1 + cmp r6, 0 + bge _08010B04 + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08010B58: .4byte 0x0000f3ff +_08010B5C: .4byte gUnknown_203B0E8 +_08010B60: .4byte 0x000052d8 +_08010B64: .4byte 0x00005114 +_08010B68: .4byte 0x000052dc +_08010B6C: .4byte 0x000052de +_08010B70: .4byte 0x000052d4 + thumb_func_end sub_8010A88 + + thumb_func_start sub_8010B74 +sub_8010B74: + push {r4,r5,lr} + sub sp, 0x64 + adds r5, r0, 0 + add r4, sp, 0x4 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x60 + bl memset + movs r2, 0x3 + str r2, [sp, 0x8] + movs r0, 0xC + strh r0, [r4, 0x8] + movs r1, 0x2 + strh r1, [r4, 0xA] + movs r0, 0x10 + strh r0, [r4, 0xC] + strh r1, [r4, 0xE] + strh r1, [r4, 0x10] + str r2, [sp, 0x20] + str r2, [sp, 0x38] + str r2, [sp, 0x50] + ldr r0, _08010BC0 + ldr r0, [r0] + ldr r2, _08010BC4 + adds r1, r0, r2 + movs r2, 0 + ldrsh r1, [r1, r2] + ldr r2, _08010BC8 + adds r0, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + subs r1, r0 + cmp r1, 0x50 + bgt _08010BCC + add r1, sp, 0x4 + movs r0, 0x11 + b _08010BD0 + .align 2, 0 +_08010BC0: .4byte gUnknown_203B0E8 +_08010BC4: .4byte 0x000052de +_08010BC8: .4byte 0x000052da +_08010BCC: + add r1, sp, 0x4 + movs r0, 0x1 +_08010BD0: + strh r0, [r1, 0xA] + add r0, sp, 0x4 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0 + bl sub_80073B8 + ldr r0, _08010C08 + adds r1, r5, 0 + bl sub_809027C + ldr r2, _08010C0C + movs r0, 0 + str r0, [sp] + movs r0, 0xC + movs r1, 0x2 + movs r3, 0 + bl sub_8014FF0 + movs r0, 0 + bl sub_80073E0 + add sp, 0x64 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08010C08: .4byte gUnknown_202DF98 +_08010C0C: .4byte gUnknown_80D4074 + thumb_func_end sub_8010B74 + + thumb_func_start sub_8010C10 +sub_8010C10: + push {r4,lr} + sub sp, 0x18 + movs r2, 0 + str r2, [sp] + movs r1, 0x3 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + str r2, [sp, 0xC] + ldr r1, _08010C54 + str r1, [sp, 0x10] + movs r1, 0 + movs r3, 0 + bl sub_8014248 +_08010C2C: + bl sub_80144C4 + bl sub_8010960 + add r0, sp, 0x14 + bl sub_80144A4 + cmp r0, 0 + bne _08010C2C + movs r4, 0x9 +_08010C40: + bl sub_8010960 + subs r4, 0x1 + cmp r4, 0 + bge _08010C40 + add sp, 0x18 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08010C54: .4byte 0x00000301 + thumb_func_end sub_8010C10 + + thumb_func_start sub_8010C58 +sub_8010C58: + push {r4-r6,lr} + sub sp, 0x38 + adds r5, r0, 0 + movs r2, 0 + ldrb r0, [r5] + ldr r3, _08010D70 + add r6, sp, 0x2C + cmp r0, 0 + beq _08010C7C + adds r1, r5, 0 +_08010C6C: + ldrb r0, [r1] + cmp r0, 0xA + bne _08010C74 + adds r2, 0xC +_08010C74: + adds r1, 0x1 + ldrb r0, [r1] + cmp r0, 0 + bne _08010C6C +_08010C7C: + adds r2, 0xB + adds r0, r2, 0 + cmp r2, 0 + bge _08010C86 + adds r0, r2, 0x7 +_08010C86: + asrs r2, r0, 3 + movs r0, 0x13 + subs r0, r2 + movs r4, 0 + strh r0, [r3, 0xA] + strh r2, [r3, 0x10] + strh r2, [r3, 0xE] + movs r0, 0xE + subs r0, r2 + strh r0, [r3, 0x22] + adds r0, r3, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0 + bl sub_80073B8 + str r4, [sp] + movs r0, 0x4 + movs r1, 0 + adds r2, r5, 0 + movs r3, 0 + bl sub_8014FF0 + movs r0, 0 + bl sub_80073E0 + movs r0, 0x1 + bl sub_80073B8 + ldr r2, _08010D74 + str r4, [sp] + movs r0, 0xA + movs r1, 0 + movs r3, 0x1 + bl sub_8014FF0 + ldr r2, _08010D78 + str r4, [sp] + movs r0, 0xA + movs r1, 0xC + movs r3, 0x1 + bl sub_8014FF0 + movs r0, 0x1 + bl sub_80073E0 + add r0, sp, 0x4 + movs r2, 0x1 + strh r2, [r0, 0x18] + movs r1, 0x2 + strh r1, [r0, 0x1A] + strh r1, [r0, 0x1C] + strh r4, [r0, 0x1E] + strh r4, [r0, 0x20] + strh r4, [r0, 0x4] + strh r4, [r0, 0x6] + str r2, [sp, 0x4] + strh r4, [r0, 0xC] + strh r4, [r0, 0xE] + strh r4, [r0, 0x14] + strh r4, [r0, 0x16] + movs r1, 0x8 + strh r1, [r0, 0x8] + strh r1, [r0, 0xA] + movs r1, 0x18 + bl sub_80137B0 + adds r0, r6, 0 + bl sub_801317C + ldr r4, _08010D7C +_08010D18: + add r0, sp, 0x4 + bl AddMenuCursorSprite + bl sub_8010960 + ldrh r1, [r4, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08010D36 + add r0, sp, 0x4 + bl MoveMenuCursorDown + bl sub_80117F8 +_08010D36: + ldrh r1, [r4, 0x4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08010D4A + add r0, sp, 0x4 + bl MoveMenuCursorUp + bl sub_80117F8 +_08010D4A: + ldrh r1, [r4, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08010D5E + mov r0, sp + adds r0, 0x2D + ldrb r0, [r0] + cmp r0, 0 + beq _08010D18 +_08010D5E: + bl sub_80117D0 + add r0, sp, 0x4 + movs r1, 0x18 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08010D80 + movs r0, 0 + b _08010D82 + .align 2, 0 +_08010D70: .4byte gUnknown_203B0EC +_08010D74: .4byte gUnknown_80D407C +_08010D78: .4byte gUnknown_80D4080 +_08010D7C: .4byte gUnknown_20255F0 +_08010D80: + movs r0, 0x1 +_08010D82: + add sp, 0x38 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8010C58 + + thumb_func_start sub_8010D8C +sub_8010D8C: + lsls r0, 24 + ldr r2, _08010DA0 + lsrs r0, 22 + adds r0, r2 + ldrh r2, [r0] + strh r2, [r1] + ldrh r0, [r0, 0x2] + strh r0, [r1, 0x2] + bx lr + .align 2, 0 +_08010DA0: .4byte gUnknown_80D3F14 + thumb_func_end sub_8010D8C + + thumb_func_start sub_8010DA4 +sub_8010DA4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + bl sub_808D33C + mov r9, r0 + ldr r6, _08010EBC + ldr r0, [r6] + ldr r5, _08010EC0 + adds r1, r5, 0 + bl sub_800A9EC + mov r10, r0 + ldr r0, [r6, 0x4] + adds r1, r5, 0 + bl sub_800A9EC + adds r7, r0, 0 + ldr r1, _08010EC4 + mov r0, r9 + movs r3, 0x8 + ldrsh r2, [r0, r3] + mov r0, sp + bl sprintf + ldr r0, _08010EC8 + mov r8, r0 + mov r0, sp + mov r1, r8 + bl sub_800A9EC + ldr r4, _08010ECC + ldr r1, [r4] + str r0, [r1, 0xC] + ldr r0, _08010ED0 + adds r1, r5, 0 + bl sub_800A9EC + ldr r1, [r4] + str r0, [r1, 0x8] + ldr r0, [r6, 0x8] + adds r1, r5, 0 + bl sub_800A9EC + ldr r1, [r4] + str r0, [r1, 0x10] + ldr r0, _08010ED4 + mov r1, r8 + bl sub_800A9EC + ldr r1, [r4] + str r0, [r1, 0x4] + ldr r0, [r6, 0xC] + adds r1, r5, 0 + bl sub_800A9EC + ldr r1, [r4] + str r0, [r1] + mov r1, r9 + movs r2, 0x8 + ldrsh r0, [r1, r2] + movs r1, 0 + bl sub_808DD68 + ldr r2, [r4] + ldr r3, _08010ED8 + adds r1, r2, r3 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + ldr r0, [r2, 0x8] + movs r1, 0x40 + movs r2, 0x1F + movs r3, 0 + bl sub_8005610 + ldr r0, _08010EDC + movs r1, 0 + mov r2, r10 + bl sub_800AE28 + ldr r1, [r4] + ldr r2, _08010EE0 + adds r0, r1, r2 + ldr r1, [r1, 0x10] + movs r2, 0x10 + bl sub_8004AA4 + movs r1, 0x80 + lsls r1, 7 + ldr r0, [r4] + adds r0, 0x14 + adds r2, r7, 0 + bl sub_800AAA8 + ldr r1, [r4] + ldr r3, _08010EE4 + adds r0, r1, r3 + movs r2, 0 + str r2, [r0] + adds r3, 0x8 + adds r0, r1, r3 + strh r2, [r0] + ldr r0, _08010EE8 + adds r1, r0 + strh r2, [r1] + ldr r5, _08010EEC + movs r3, 0 + movs r1, 0x7 +_08010E84: + ldr r0, [r4] + adds r0, r2, r0 + adds r0, r5 + strh r3, [r0] + adds r2, 0x3C + subs r1, 0x1 + cmp r1, 0 + bge _08010E84 + mov r0, r10 + bl sub_800AA14 + adds r0, r7, 0 + bl sub_800AA14 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08010EBC: .4byte gUnknown_80D408C +_08010EC0: .4byte gUnknown_8380000 +_08010EC4: .4byte gUnknown_80D40E4 +_08010EC8: .4byte gUnknown_8510000 +_08010ECC: .4byte gUnknown_203B0E4 +_08010ED0: .4byte gUnknown_80D40EC +_08010ED4: .4byte gUnknown_80D40F4 +_08010ED8: .4byte 0x00004dd0 +_08010EDC: .4byte 0x06008000 +_08010EE0: .4byte 0x00004c4c +_08010EE4: .4byte 0x00004dcc +_08010EE8: .4byte 0x00004dd6 +_08010EEC: .4byte 0x00004a30 + thumb_func_end sub_8010DA4 + + thumb_func_start sub_8010EF0 +sub_8010EF0: + push {r4,lr} + ldr r4, _08010F24 + ldr r0, [r4] + ldr r0, [r0, 0x10] + bl sub_800AA14 + ldr r0, [r4] + ldr r0, [r0, 0x8] + bl sub_800AA14 + ldr r0, [r4] + ldr r0, [r0, 0xC] + bl sub_800AA14 + ldr r0, [r4] + ldr r0, [r0] + bl sub_800AA14 + ldr r0, [r4] + ldr r0, [r0, 0x4] + bl sub_800AA14 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08010F24: .4byte gUnknown_203B0E4 + thumb_func_end sub_8010EF0 + + thumb_func_start sub_8010F28 +sub_8010F28: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + add r0, sp, 0x8 + bl sub_8004E8C + add r1, sp, 0x8 + ldr r0, _08011080 + strh r0, [r1, 0x4] + movs r0, 0x80 + lsls r0, 4 + strh r0, [r1, 0xA] + ldr r6, _08011084 + ldr r0, [r6] + ldr r2, _08011088 + adds r1, r0, r2 + ldr r1, [r1] + mov r8, r1 + ldr r4, _0801108C + adds r0, r4 + bl sub_80054BC + ldr r3, [r6] + adds r4, r3, r4 + ldr r7, _08011090 + adds r0, r3, r7 + movs r2, 0 + ldrsh r1, [r0, r2] + mov r7, r8 + lsls r5, r7, 16 + asrs r5, 16 + subs r1, r5 + ldr r2, _08011094 + adds r0, r3, r2 + movs r7, 0 + ldrsh r2, [r0, r7] + mov r7, r8 + asrs r0, r7, 16 + subs r2, r0 + ldr r0, _08011098 + adds r3, r0 + ldr r0, [r3] + str r0, [sp] + add r3, sp, 0x8 + str r3, [sp, 0x4] + adds r0, r4, 0 + movs r3, 0x3 + bl sub_800558C + movs r7, 0 + mov r10, r6 + ldr r6, _0801109C + mov r9, r5 +_08010F98: + mov r4, r10 + ldr r0, [r4] + adds r4, r0, r6 + ldr r1, _080110A0 + adds r0, r1 + lsls r1, r7, 5 + ldr r0, [r0] + adds r5, r0, r1 + ldrb r0, [r4] + cmp r0, 0 + beq _08010FD8 + adds r4, 0x14 + adds r0, r4, 0 + bl sub_80054BC + movs r2, 0x4 + ldrsh r1, [r5, r2] + mov r3, r9 + subs r1, r3 + movs r0, 0x6 + ldrsh r2, [r5, r0] + mov r3, r8 + asrs r0, r3, 16 + subs r2, r0 + movs r0, 0 + str r0, [sp] + add r0, sp, 0x8 + str r0, [sp, 0x4] + adds r0, r4, 0 + movs r3, 0x1 + bl sub_800558C +_08010FD8: + adds r6, 0x50 + adds r7, 0x1 + cmp r7, 0x1F + ble _08010F98 + movs r5, 0 + ldr r1, _08011084 + mov r9, r1 + ldr r6, _080110A4 + movs r2, 0 + str r2, [sp, 0x14] +_08010FEC: + mov r3, r9 + ldr r1, [r3] + ldr r4, [sp, 0x14] + adds r0, r4, r1 + ldr r7, _080110A4 + adds r0, r7 + ldrh r0, [r0] + lsrs r0, 15 + cmp r0, 0 + beq _08011062 + adds r0, r1, r6 + bl sub_80054BC + ldr r0, _080110A8 + ldrh r0, [r0] + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _0801101E + movs r0, 0x1 + ands r0, r5 + cmp r0, 0 + beq _08011062 +_0801101E: + mov r3, r9 + ldr r4, [r3] + adds r0, r4, r6 + ldr r1, _080110AC + lsls r3, r5, 2 + adds r3, r1 + movs r7, 0 + ldrsh r1, [r3, r7] + ldr r7, _08011090 + adds r2, r4, r7 + movs r7, 0 + ldrsh r2, [r2, r7] + adds r1, r2 + mov r7, r8 + lsls r2, r7, 16 + asrs r2, 16 + subs r1, r2 + movs r7, 0x2 + ldrsh r2, [r3, r7] + ldr r3, _08011094 + adds r3, r4 + movs r4, 0 + ldrsh r3, [r3, r4] + adds r2, r3 + mov r7, r8 + asrs r3, r7, 16 + subs r2, r3 + movs r3, 0 + str r3, [sp] + add r3, sp, 0x8 + str r3, [sp, 0x4] + movs r3, 0x2 + bl sub_800558C +_08011062: + adds r6, 0x3C + ldr r4, [sp, 0x14] + adds r4, 0x3C + str r4, [sp, 0x14] + adds r5, 0x1 + cmp r5, 0x7 + ble _08010FEC + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08011080: .4byte 0x0000f3ff +_08011084: .4byte gUnknown_203B0E4 +_08011088: .4byte 0x00004dd4 +_0801108C: .4byte 0x00004c10 +_08011090: .4byte 0x00004dd8 +_08011094: .4byte 0x00004dda +_08011098: .4byte 0x00004dd0 +_0801109C: .4byte 0x00004018 +_080110A0: .4byte 0x00004014 +_080110A4: .4byte 0x00004a30 +_080110A8: .4byte gUnknown_20255F0 +_080110AC: .4byte gUnknown_80D40C4 + thumb_func_end sub_8010F28 + + thumb_func_start sub_80110B0 +sub_80110B0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r0, _08011150 + ldr r1, [r0] + ldr r2, _08011154 + adds r1, r2 + ldrh r1, [r1] + lsls r1, 16 + asrs r6, r1, 19 + adds r2, r6, 0 + movs r3, 0 + mov r10, r0 + movs r0, 0x1F + mov r9, r0 +_080110D4: + mov r1, r10 + ldr r0, [r1] + ldr r1, _08011158 + adds r0, r1 + ldrh r0, [r0] + lsls r0, 16 + asrs r4, r0, 19 + lsls r1, r2, 7 + adds r2, 0x1 + mov r12, r2 + adds r3, 0x1 + mov r8, r3 + movs r7, 0x1E + lsls r0, r4, 1 + adds r5, r0, r1 +_080110F2: + mov r2, r9 + ands r4, r2 + ands r6, r2 + lsls r2, r4, 1 + lsls r0, r6, 6 + adds r2, r0 + ldr r3, _0801115C + adds r3, r2, r3 + str r3, [sp] + mov r0, r10 + ldr r1, [r0] + ldr r3, _08011160 + adds r0, r1, r3 + adds r0, r5 + ldrh r0, [r0] + ldr r3, [sp] + strh r0, [r3] + ldr r0, _08011164 + adds r2, r0 + adds r1, 0x14 + adds r1, r5 + ldrh r0, [r1] + strh r0, [r2] + adds r5, 0x2 + adds r4, 0x1 + subs r7, 0x1 + cmp r7, 0 + bge _080110F2 + mov r2, r12 + adds r6, 0x1 + mov r3, r8 + cmp r3, 0x14 + ble _080110D4 + movs r0, 0x2 + bl sub_80098F8 + movs r0, 0x3 + bl sub_80098F8 + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08011150: .4byte gUnknown_203B0E4 +_08011154: .4byte 0x00004dd6 +_08011158: .4byte 0x00004dd4 +_0801115C: .4byte gUnknown_202C038 +_08011160: .4byte 0x00002014 +_08011164: .4byte gUnknown_202C838 + thumb_func_end sub_80110B0 + + thumb_func_start sub_8011168 +sub_8011168: + push {r4,r5,lr} + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r3, _080111B0 + ldr r1, [r3] + ldr r2, _080111B4 + adds r0, r1, r2 + movs r2, 0 + str r2, [r0] + ldr r4, _080111B8 + adds r0, r1, r4 + str r2, [r0] + adds r4, 0x4 + adds r0, r1, r4 + str r2, [r0] + ldr r0, _080111BC + adds r1, r0 + str r2, [r1] + adds r5, r3, 0 + ldr r4, _080111C0 + movs r3, 0 + movs r1, 0x7 +_0801119A: + ldr r0, [r5] + adds r0, r2, r0 + adds r0, r4 + strh r3, [r0] + adds r2, 0x3C + subs r1, 0x1 + cmp r1, 0 + bge _0801119A + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080111B0: .4byte gUnknown_203B0E4 +_080111B4: .4byte 0x00004ddc +_080111B8: .4byte 0x00004de0 +_080111BC: .4byte 0x00004de8 +_080111C0: .4byte 0x00004a30 + thumb_func_end sub_8011168 + + thumb_func_start sub_80111C4 +sub_80111C4: + push {r4-r6,lr} + movs r3, 0 + ldr r6, _08011238 + ldr r0, [r6] + ldr r2, _0801123C + adds r1, r0, r2 + ldr r2, [r1] + cmp r2, 0x1E + bgt _0801122E + ldr r0, [r0] + ldr r5, [r0, 0x4] + adds r0, r2, 0x1 + str r0, [r1] + cmp r0, 0x1E + ble _080111E6 + movs r0, 0x1F + str r0, [r1] +_080111E6: + movs r4, 0 +_080111E8: + ldr r0, [r6] + ldr r1, _0801123C + adds r0, r1 + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + movs r3, 0 + bl SetBGPaletteBufferColorRGB + adds r5, 0x4 + adds r4, 0x1 + cmp r4, 0xDF + ble _080111E8 + ldr r0, _08011238 + ldr r0, [r0] + ldr r0, [r0, 0x4] + ldr r5, [r0, 0x4] + movs r4, 0 +_0801120C: + movs r2, 0x80 + lsls r2, 1 + adds r0, r4, r2 + ldr r1, _08011238 + ldr r1, [r1] + ldr r2, _0801123C + adds r1, r2 + ldr r2, [r1] + adds r1, r5, 0 + movs r3, 0 + bl SetBGPaletteBufferColorRGB + adds r5, 0x4 + adds r4, 0x1 + cmp r4, 0xEF + ble _0801120C + movs r3, 0x1 +_0801122E: + adds r0, r3, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08011238: .4byte gUnknown_203B0E4 +_0801123C: .4byte 0x00004dcc + thumb_func_end sub_80111C4 + + thumb_func_start sub_8011240 +sub_8011240: + push {r4-r6,lr} + ldr r2, _08011264 + ldr r0, [r2] + ldr r1, _08011268 + adds r3, r0, r1 + movs r4, 0 + ldrsh r1, [r3, r4] + ldr r5, _0801126C + adds r4, r0, r5 + movs r6, 0 + ldrsh r0, [r4, r6] + subs r1, r0 + adds r5, r2, 0 + cmp r1, 0x2F + bgt _08011270 + ldrh r0, [r3] + subs r0, 0x30 + b _08011278 + .align 2, 0 +_08011264: .4byte gUnknown_203B0E4 +_08011268: .4byte 0x00004dd8 +_0801126C: .4byte 0x00004dd4 +_08011270: + cmp r1, 0xC0 + ble _0801127A + ldrh r0, [r3] + subs r0, 0xC0 +_08011278: + strh r0, [r4] +_0801127A: + ldr r0, [r5] + ldr r1, _08011298 + adds r3, r0, r1 + movs r2, 0 + ldrsh r1, [r3, r2] + ldr r4, _0801129C + adds r2, r0, r4 + movs r6, 0 + ldrsh r0, [r2, r6] + subs r1, r0 + cmp r1, 0x2F + bgt _080112A0 + ldrh r0, [r3] + subs r0, 0x30 + b _080112A8 + .align 2, 0 +_08011298: .4byte 0x00004dda +_0801129C: .4byte 0x00004dd6 +_080112A0: + cmp r1, 0x70 + ble _080112AA + ldrh r0, [r3] + subs r0, 0x70 +_080112A8: + strh r0, [r2] +_080112AA: + adds r3, r5, 0 + ldr r0, [r3] + ldr r4, _080112F8 + adds r1, r0, r4 + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0 + bge _080112BE + movs r0, 0 + strh r0, [r1] +_080112BE: + ldr r0, [r3] + ldr r2, _080112FC + adds r1, r0, r2 + movs r6, 0 + ldrsh r0, [r1, r6] + cmp r0, 0 + bge _080112D0 + movs r0, 0 + strh r0, [r1] +_080112D0: + ldr r0, [r3] + adds r1, r0, r4 + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0xEF + ble _080112E0 + movs r0, 0xEF + strh r0, [r1] +_080112E0: + ldr r0, [r5] + adds r2, r0, r2 + movs r4, 0 + ldrsh r0, [r2, r4] + cmp r0, 0x97 + ble _080112F0 + movs r0, 0x97 + strh r0, [r2] +_080112F0: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080112F8: .4byte 0x00004dd4 +_080112FC: .4byte 0x00004dd6 + thumb_func_end sub_8011240 + + thumb_func_start sub_8011300 +sub_8011300: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + ldr r0, _08011388 + ldr r2, [r0] + ldr r1, _0801138C + adds r0, r2, r1 + ldr r1, [r0] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + ldr r3, _08011390 + adds r0, r3 + adds r2, r0 + mov r9, r2 + movs r4, 0 + ldr r0, _08011394 + mov r8, r0 + movs r7, 0 + mov r6, r8 + movs r5, 0 +_0801132E: + ldr r0, _08011388 + ldr r2, [r0] + adds r0, r5, r2 + add r0, r8 + strh r7, [r0] + lsls r1, r4, 1 + mov r0, r9 + adds r0, 0x2 + adds r1, r0, r1 + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0 + blt _08011370 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 4 + ldr r0, _08011390 + adds r1, r0 + adds r1, r2, r1 + ldrb r0, [r1] + cmp r0, 0 + beq _08011370 + adds r0, r2, r6 + ldr r1, [r2, 0x8] + adds r2, r4, 0x4 + movs r3, 0x40 + str r3, [sp] + str r7, [sp, 0x4] + movs r3, 0x1 + str r3, [sp, 0x8] + movs r3, 0 + bl sub_80053AC +_08011370: + adds r6, 0x3C + adds r5, 0x3C + adds r4, 0x1 + cmp r4, 0x7 + ble _0801132E + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08011388: .4byte gUnknown_203B0E4 +_0801138C: .4byte 0x00004a18 +_08011390: .4byte 0x00004018 +_08011394: .4byte 0x00004a30 + thumb_func_end sub_8011300 + + thumb_func_start sub_8011398 +sub_8011398: + push {r4-r6,lr} + sub sp, 0x12C + ldr r5, _080113F4 + ldr r0, [r5] + ldr r2, _080113F8 + adds r1, r0, r2 + ldr r1, [r1] + ldr r3, _080113FC + adds r0, r3 + lsls r1, 5 + ldr r0, [r0] + adds r6, r0, r1 + add r4, sp, 0xCC + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x60 + bl memset + movs r2, 0x3 + str r2, [r4, 0x4] + movs r0, 0x7 + strh r0, [r4, 0x8] + movs r1, 0x2 + strh r1, [r4, 0xA] + movs r0, 0x15 + strh r0, [r4, 0xC] + strh r1, [r4, 0xE] + strh r1, [r4, 0x10] + str r2, [r4, 0x1C] + str r2, [r4, 0x34] + str r2, [r4, 0x4C] + ldr r0, [r5] + ldr r2, _08011400 + adds r1, r0, r2 + movs r3, 0 + ldrsh r1, [r1, r3] + subs r2, 0x4 + adds r0, r2 + movs r3, 0 + ldrsh r0, [r0, r3] + subs r1, r0 + cmp r1, 0x50 + bgt _08011404 + movs r0, 0x11 + b _08011406 + .align 2, 0 +_080113F4: .4byte gUnknown_203B0E4 +_080113F8: .4byte 0x00004a18 +_080113FC: .4byte 0x00004014 +_08011400: .4byte 0x00004dda +_08011404: + movs r0, 0x1 +_08011406: + strh r0, [r4, 0xA] + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0 + bl sub_80073B8 + ldr r1, _0801147C + ldr r2, [r6] + add r0, sp, 0x4 + bl sub_800D158 + movs r0, 0 + str r0, [sp] + movs r0, 0xC + movs r1, 0x2 + add r2, sp, 0x4 + movs r3, 0 + bl sub_8014FF0 + movs r0, 0 + bl sub_80073E0 + ldr r0, _08011480 + ldr r1, [r0] + ldr r0, _08011484 + adds r2, r1, r0 + movs r3, 0x8 + ldrsh r0, [r4, r3] + lsls r0, 3 + subs r0, 0x5 + str r0, [r2] + ldr r0, _08011488 + adds r2, r1, r0 + movs r3, 0xA + ldrsh r0, [r4, r3] + lsls r0, 3 + adds r0, 0x5 + str r0, [r2] + ldr r0, _0801148C + adds r2, r1, r0 + movs r3, 0xC + ldrsh r0, [r4, r3] + lsls r0, 3 + adds r0, 0xA + str r0, [r2] + ldr r0, _08011490 + adds r1, r0 + movs r2, 0xE + ldrsh r0, [r4, r2] + lsls r0, 3 + adds r0, 0xA + str r0, [r1] + add sp, 0x12C + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0801147C: .4byte gUnknown_80D40FC +_08011480: .4byte gUnknown_203B0E4 +_08011484: .4byte 0x00004ddc +_08011488: .4byte 0x00004de0 +_0801148C: .4byte 0x00004de4 +_08011490: .4byte 0x00004de8 + thumb_func_end sub_8011398 + + thumb_func_start sub_8011494 +sub_8011494: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC8 + ldr r0, _08011610 + ldr r2, [r0] + ldr r1, _08011614 + adds r0, r2, r1 + ldr r0, [r0] + ldr r3, _08011618 + adds r1, r2, r3 + lsls r0, 5 + ldr r1, [r1] + adds r1, r0 + mov r8, r1 + ldr r0, _0801161C + adds r7, r2, r0 + add r4, sp, 0x64 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x60 + bl memset + movs r0, 0x6 + str r0, [sp, 0x68] + add r1, sp, 0x6C + movs r0, 0x7 + strh r0, [r1] + movs r2, 0x2 + strh r2, [r1, 0x2] + add r1, sp, 0x70 + movs r0, 0x15 + strh r0, [r1] + mov r0, sp + adds r0, 0x72 + strh r2, [r0] + add r0, sp, 0x74 + strh r2, [r0] + add r5, sp, 0xC4 + str r5, [sp, 0x78] + movs r1, 0x3 + str r1, [sp, 0x80] + add r0, sp, 0x94 + str r1, [r0, 0x4] + add r0, sp, 0xAC + str r1, [r0, 0x4] + add r0, sp, 0x4 + adds r1, r4, 0 + movs r2, 0x60 + bl memcpy + movs r1, 0 + mov r9, r1 + movs r6, 0 + mov r10, r5 +_08011506: + mov r0, r8 + adds r0, 0x8 + adds r4, r0, r6 + ldrb r0, [r4] + bl sub_800FFE8 + lsls r0, 24 + cmp r0, 0 + beq _0801152A + ldr r0, _08011610 + ldr r0, [r0] + ldr r2, _08011620 + adds r0, r2 + add r0, r9 + ldrb r1, [r4] + strb r1, [r0] + movs r3, 0x1 + add r9, r3 +_0801152A: + adds r6, 0x1 + cmp r6, 0x7 + ble _08011506 + ldr r5, _08011610 + ldr r0, [r5] + ldr r1, _08011624 + adds r0, r1 + mov r2, r9 + str r2, [r0] + movs r4, 0 + movs r0, 0x1 + mov r3, r10 + strb r0, [r3] + add r0, sp, 0xC4 + strb r4, [r0, 0x1] + movs r1, 0x12 + strb r1, [r0, 0x2] + strb r4, [r0, 0x3] + strh r4, [r7, 0x18] + strh r2, [r7, 0x1A] + mov r0, r9 + strh r0, [r7, 0x1C] + strh r4, [r7, 0x1E] + strh r4, [r7, 0x20] + strh r4, [r7, 0x4] + movs r0, 0x10 + strh r0, [r7, 0x6] + str r4, [r7] + strh r4, [r7, 0xC] + strh r4, [r7, 0xE] + strh r4, [r7, 0x14] + strh r4, [r7, 0x16] + movs r0, 0x8 + strh r0, [r7, 0x8] + strh r0, [r7, 0xA] + adds r0, r7, 0 + adds r0, 0x28 + bl sub_801317C + movs r1, 0x1C + ldrsh r0, [r7, r1] + movs r1, 0 + bl sub_80095E4 + adds r1, r0, 0 + add r3, sp, 0x4 + adds r2, r3, 0 + adds r0, r1, 0x2 + strh r0, [r2, 0xE] + strh r0, [r3, 0x10] + lsls r1, 3 + adds r0, r7, 0 + bl sub_80137B0 + add r0, sp, 0x4 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r1, [r5] + ldr r2, _08011628 + adds r0, r1, r2 + str r4, [r0] + ldr r3, _0801162C + adds r0, r1, r3 + str r4, [r0] + adds r2, 0x8 + adds r0, r1, r2 + str r4, [r0] + adds r3, 0x8 + adds r1, r3 + str r4, [r1] + movs r0, 0 + bl sub_80073B8 + ldr r2, _08011630 + str r4, [sp] + movs r0, 0x10 + movs r1, 0 + movs r3, 0 + bl sub_8014FF0 + movs r6, 0 + cmp r6, r9 + bge _08011678 + add r0, sp, 0x64 + mov r8, r0 + ldr r1, _08011634 + mov r10, r1 +_080115DC: + adds r0, r7, 0 + adds r1, r6, 0 + bl sub_8013800 + adds r4, r0, 0 + ldr r2, _08011610 + ldr r0, [r2] + ldr r3, _08011620 + adds r0, r3 + adds r0, r6 + ldrb r5, [r0] + ldr r0, _08011638 + adds r1, r5, 0 + bl sub_80101F8 + cmp r5, 0 + bne _08011640 + str r5, [sp] + movs r0, 0xC + adds r1, r4, 0 + ldr r2, _0801163C + movs r3, 0 + bl sub_8014FF0 + b _08011672 + .align 2, 0 +_08011610: .4byte gUnknown_203B0E4 +_08011614: .4byte 0x00004a18 +_08011618: .4byte 0x00004014 +_0801161C: .4byte 0x00004dfc +_08011620: .4byte 0x00004dec +_08011624: .4byte 0x00004df8 +_08011628: .4byte 0x00004ddc +_0801162C: .4byte 0x00004de0 +_08011630: .4byte gUnknown_80D4104 +_08011634: .4byte gUnknown_202DE30 +_08011638: .4byte gUnknown_202DE58 +_0801163C: .4byte gUnknown_80D4120 +_08011640: + ldr r1, _08011690 + ldr r0, [r1] + ldr r2, _08011694 + adds r0, r2 + ldrb r2, [r0] + adds r0, r5, 0 + mov r1, r8 + bl sub_80926F8 + mov r3, r8 + movs r1, 0x2 + ldrsh r0, [r3, r1] + mov r2, r10 + str r0, [r2] + movs r1, 0 + ldrsh r0, [r3, r1] + str r0, [r2, 0x4] + movs r0, 0 + str r0, [sp] + movs r0, 0xC + adds r1, r4, 0 + ldr r2, _08011698 + movs r3, 0 + bl sub_8014FF0 +_08011672: + adds r6, 0x1 + cmp r6, r9 + blt _080115DC +_08011678: + movs r0, 0 + bl sub_80073E0 + add sp, 0xC8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08011690: .4byte gUnknown_203B0E4 +_08011694: .4byte 0x00004a2c +_08011698: .4byte gUnknown_80D4124 + thumb_func_end sub_8011494 + + thumb_func_start sub_801169C +sub_801169C: + push {r4-r6,lr} + sub sp, 0x8 + ldr r5, _08011744 + ldr r1, [r5] + ldr r4, _08011748 + adds r0, r1, r4 + movs r2, 0 + ldrsh r0, [r0, r2] + ldr r6, _0801174C + adds r1, r6 + movs r3, 0 + ldrsh r1, [r1, r3] + bl sub_800CCA0 + ldr r1, [r5] + adds r4, r1, r4 + movs r2, 0 + ldrsh r0, [r4, r2] + adds r1, r6 + movs r3, 0 + ldrsh r1, [r1, r3] + bl sub_800CCAC + bl sub_8010F28 + bl sub_80111C4 + lsls r0, 24 + lsrs r0, 24 + ldr r2, [r5] + ldr r3, _08011750 + adds r1, r2, r3 + ldr r3, _08011754 + adds r2, r3 + ldr r2, [r2] + str r2, [sp] + movs r2, 0 + str r2, [sp, 0x4] + movs r2, 0xB0 + movs r3, 0x10 + bl sub_8004AF0 + movs r0, 0 + movs r1, 0 + bl sub_8005838 + ldr r0, _08011758 + ldr r0, [r0] + ldrb r0, [r0, 0xA] + bl nullsub_8 + bl sub_8005180 + bl sub_80060EC + ldr r0, _0801175C + ldr r0, [r0] + bl sub_8094FB4 + bl sub_800CB20 + bl sub_800485C + bl CopySpritesToOam + bl sub_8005304 + bl TransferBGPaletteBuffer + bl xxx_call_update_bg_vram + bl sub_8009908 + bl xxx_call_update_bg_sound_input + bl sub_8011860 + movs r0, 0 + bl sub_8004D8C + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08011744: .4byte gUnknown_203B0E4 +_08011748: .4byte 0x00004dd4 +_0801174C: .4byte 0x00004dd6 +_08011750: .4byte 0x00004c4c +_08011754: .4byte 0x00004dcc +_08011758: .4byte gUnknown_203B46C +_0801175C: .4byte gUnknown_203B47C + thumb_func_end sub_801169C + + thumb_func_start sub_8011760 +sub_8011760: + push {lr} + movs r0, 0xD + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _08011776 + movs r0, 0x13 + bl sub_800BDFC + b _08011788 +_08011776: + movs r0, 0xC + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _08011788 + movs r0, 0x7 + bl sub_800BDFC +_08011788: + pop {r0} + bx r0 + thumb_func_end sub_8011760 + + thumb_func_start sub_801178C +sub_801178C: + push {lr} + movs r0, 0xD + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _080117A2 + movs r0, 0x13 + bl sub_800BDFC + b _080117A8 +_080117A2: + movs r0, 0x7 + bl sub_800BDFC +_080117A8: + pop {r0} + bx r0 + thumb_func_end sub_801178C + + thumb_func_start sub_80117AC +sub_80117AC: + push {lr} + movs r0, 0xD + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + bne _080117C0 + movs r0, 0x1E + bl sub_800BFD0 +_080117C0: + pop {r0} + bx r0 + thumb_func_end sub_80117AC + + thumb_func_start sub_80117C4 +sub_80117C4: + push {lr} + movs r0, 0x1E + bl sub_800BFD0 + pop {r0} + bx r0 + thumb_func_end sub_80117C4 + + thumb_func_start sub_80117D0 +sub_80117D0: + push {lr} + movs r0, 0x97 + lsls r0, 1 + movs r1, 0x80 + lsls r1, 1 + bl sub_800C074 + pop {r0} + bx r0 + thumb_func_end sub_80117D0 + + thumb_func_start sub_80117E4 +sub_80117E4: + push {lr} + ldr r0, _080117F4 + movs r1, 0x80 + lsls r1, 1 + bl sub_800C074 + pop {r0} + bx r0 + .align 2, 0 +_080117F4: .4byte 0x0000012f + thumb_func_end sub_80117E4 + + thumb_func_start sub_80117F8 +sub_80117F8: + push {lr} + ldr r0, _08011808 + movs r1, 0x80 + lsls r1, 1 + bl sub_800C074 + pop {r0} + bx r0 + .align 2, 0 +_08011808: .4byte 0x0000012d + thumb_func_end sub_80117F8 + + thumb_func_start sub_801180C +sub_801180C: + ldr r0, _08011820 + movs r1, 0 + str r1, [r0] + ldr r0, _08011824 + strh r1, [r0] + ldr r0, _08011828 + strh r1, [r0] + ldr r0, _0801182C + strh r1, [r0] + bx lr + .align 2, 0 +_08011820: .4byte gUnknown_202DE1C +_08011824: .4byte gUnknown_202DE20 +_08011828: .4byte gUnknown_202DE22 +_0801182C: .4byte gUnknown_202DE24 + thumb_func_end sub_801180C + + thumb_func_start sub_8011830 +sub_8011830: + push {lr} + bl sub_800C93C + ldr r0, _08011848 + movs r1, 0 + strh r1, [r0] + ldr r0, _0801184C + strh r1, [r0] + ldr r0, _08011850 + strh r1, [r0] + pop {r0} + bx r0 + .align 2, 0 +_08011848: .4byte gUnknown_202DE20 +_0801184C: .4byte gUnknown_202DE22 +_08011850: .4byte gUnknown_202DE24 + thumb_func_end sub_8011830 + + thumb_func_start sub_8011854 +sub_8011854: + push {lr} + bl sub_800C9CC + pop {r0} + bx r0 + thumb_func_end sub_8011854 + + thumb_func_start sub_8011860 +sub_8011860: + push {lr} + ldr r1, _08011898 + ldrh r2, [r1] + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0 + ble _08011872 + subs r0, r2, 0x1 + strh r0, [r1] +_08011872: + ldr r1, _0801189C + ldrh r2, [r1] + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0 + ble _08011882 + subs r0, r2, 0x1 + strh r0, [r1] +_08011882: + ldr r1, _080118A0 + ldrh r2, [r1] + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0 + ble _08011892 + subs r0, r2, 0x1 + strh r0, [r1] +_08011892: + pop {r0} + bx r0 + .align 2, 0 +_08011898: .4byte gUnknown_202DE20 +_0801189C: .4byte gUnknown_202DE22 +_080118A0: .4byte gUnknown_202DE24 + thumb_func_end sub_8011860 + + thumb_func_start sub_80118A4 +sub_80118A4: + push {lr} + bl sub_8011924 + ldr r0, _080118BC + bl sub_801199C + ldr r0, _080118C0 + bl sub_801199C + pop {r0} + bx r0 + .align 2, 0 +_080118BC: .4byte 0x000003e6 +_080118C0: .4byte 0x000003e5 + thumb_func_end sub_80118A4 + + thumb_func_start sub_80118C4 +sub_80118C4: + push {r4,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + adds r0, r4, 0 + bl sub_800BFD0 + ldr r0, _080118E8 + adds r1, r4, 0 + bl sub_800C3F8 + ldr r0, _080118EC + adds r1, r4, 0 + bl sub_800C3F8 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080118E8: .4byte 0x000003e6 +_080118EC: .4byte 0x000003e5 + thumb_func_end sub_80118C4 + + thumb_func_start sub_80118F0 +sub_80118F0: + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl sub_800BDFC + pop {r0} + bx r0 + thumb_func_end sub_80118F0 + + thumb_func_start sub_8011900 +sub_8011900: + push {lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r1, 16 + bl sub_800BE8C + pop {r0} + bx r0 + thumb_func_end sub_8011900 + + thumb_func_start sub_8011914 +sub_8011914: + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl sub_800BF48 + pop {r0} + bx r0 + thumb_func_end sub_8011914 + + thumb_func_start sub_8011924 +sub_8011924: + push {lr} + bl sub_800BF80 + pop {r0} + bx r0 + thumb_func_end sub_8011924 + + thumb_func_start sub_8011930 +sub_8011930: + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl sub_800BFD0 + pop {r0} + bx r0 + thumb_func_end sub_8011930 + + thumb_func_start sub_8011940 +sub_8011940: + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + bl sub_800C068 + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, _08011960 + cmp r4, r0 + bne _08011964 + eors r1, r4 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + b _0801196C + .align 2, 0 +_08011960: .4byte 0x000003e7 +_08011964: + movs r0, 0 + cmp r1, r4 + bne _0801196C + movs r0, 0x1 +_0801196C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8011940 + + thumb_func_start sub_8011974 +sub_8011974: + push {lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r1, 16 + bl sub_800C074 + pop {r0} + bx r0 + thumb_func_end sub_8011974 + + thumb_func_start sub_8011988 +sub_8011988: + push {lr} + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x80 + lsls r1, 1 + bl sub_800C074 + pop {r0} + bx r0 + thumb_func_end sub_8011988 + + thumb_func_start sub_801199C +sub_801199C: + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl sub_800C298 + pop {r0} + bx r0 + thumb_func_end sub_801199C + + thumb_func_start sub_80119AC +sub_80119AC: + push {lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 16 + lsrs r1, 16 + bl sub_800C3F8 + pop {r0} + bx r0 + thumb_func_end sub_80119AC + + thumb_func_start sub_80119C0 +sub_80119C0: + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl sub_800C5D0 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_80119C0 + + thumb_func_start sub_80119D4 +sub_80119D4: + push {r4,lr} + adds r2, r0, 0 + ldr r4, _080119FC + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + bgt _080119F6 + ldr r1, _08011A00 + lsls r0, r2, 1 + adds r0, r1 + ldrh r0, [r0] + movs r1, 0x80 + lsls r1, 1 + bl sub_800C074 + movs r0, 0x4 + strh r0, [r4] +_080119F6: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080119FC: .4byte gUnknown_202DE20 +_08011A00: .4byte gUnknown_80D4144 + thumb_func_end sub_80119D4 + + thumb_func_start sub_8011A04 +sub_8011A04: + push {lr} + ldr r1, _08011A24 + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0 + bgt _08011A1E + movs r0, 0x3 + strh r0, [r1] + ldr r0, _08011A28 + movs r1, 0x80 + lsls r1, 1 + bl sub_800C074 +_08011A1E: + pop {r0} + bx r0 + .align 2, 0 +_08011A24: .4byte gUnknown_202DE22 +_08011A28: .4byte 0x00000131 + thumb_func_end sub_8011A04 + + thumb_func_start sub_8011A2C +sub_8011A2C: + ldr r1, _08011A34 + str r0, [r1] + bx lr + .align 2, 0 +_08011A34: .4byte gUnknown_202DE1C + thumb_func_end sub_8011A2C + + thumb_func_start sub_8011A38 +sub_8011A38: + push {lr} + bl nullsub_26 + bl nullsub_27 + bl nullsub_29 + bl nullsub_30 + bl nullsub_31 + bl nullsub_32 + bl nullsub_28 + ldr r1, _08011A60 + movs r0, 0x1 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_08011A60: .4byte gUnknown_203B14C + thumb_func_end sub_8011A38 + + thumb_func_start nullsub_25 +nullsub_25: + bx lr + thumb_func_end nullsub_25 + + thumb_func_start nullsub_26 +nullsub_26: + bx lr + thumb_func_end nullsub_26 + + thumb_func_start sub_8011A6C +sub_8011A6C: + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r0, r1, 0 + cmp r0, 0 + beq _08011A90 + ldr r1, _08011A8C + ldr r2, [r0, 0x8] + ldr r3, [r0] + ldr r0, [r0, 0x4] + str r0, [sp] + adds r0, r4, 0 + bl sprintf + b _08011A98 + .align 2, 0 +_08011A8C: .4byte gUnknown_80D418C +_08011A90: + ldr r1, _08011AA0 + adds r0, r4, 0 + bl sprintf +_08011A98: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08011AA0: .4byte gUnknown_80D41B0 + thumb_func_end sub_8011A6C + + thumb_func_start sub_8011AA4 +sub_8011AA4: + push {r4,r5,lr} + sub sp, 0x8 + ldr r5, _08011AC4 + ldr r3, [r1, 0x8] + ldr r4, [r1] + str r4, [sp] + ldr r1, [r1, 0x4] + str r1, [sp, 0x4] + adds r1, r5, 0 + bl sprintf + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08011AC4: .4byte gUnknown_80D41C4 + thumb_func_end sub_8011AA4 + + thumb_func_start sub_8011AC8 +sub_8011AC8: + push {r2,r3} + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, [sp, 0x10] + add r2, sp, 0x14 + bl vsprintf + adds r0, r4, 0 + bl strlen + adds r4, r0 + ldr r1, _08011AFC + ldr r2, [r5, 0x8] + ldr r3, [r5] + ldr r0, [r5, 0x4] + str r0, [sp] + adds r0, r4, 0 + bl sprintf + add sp, 0x4 + pop {r4,r5} + pop {r3} + add sp, 0x8 + bx r3 + .align 2, 0 +_08011AFC: .4byte gUnknown_80D41EC + thumb_func_end sub_8011AC8 + + thumb_func_start nullsub_199 +nullsub_199: + bx lr + thumb_func_end nullsub_199 + + thumb_func_start nullsub_27 +nullsub_27: + bx lr + thumb_func_end nullsub_27 + + thumb_func_start sub_8011B08 +sub_8011B08: + ldr r1, _08011B10 + movs r0, 0x1 + strb r0, [r1] + bx lr + .align 2, 0 +_08011B10: .4byte gUnknown_203B150 + thumb_func_end sub_8011B08 + + thumb_func_start sub_8011B14 +sub_8011B14: + ldr r1, _08011B1C + movs r0, 0 + strb r0, [r1] + bx lr + .align 2, 0 +_08011B1C: .4byte gUnknown_203B150 + thumb_func_end sub_8011B14 + + thumb_func_start sub_8011B20 +sub_8011B20: + push {lr} + ldr r1, _08011B38 + movs r2, 0 + ldrb r0, [r1] + cmp r0, 0 + bne _08011B2E + movs r2, 0x1 +_08011B2E: + strb r2, [r1] + ldrb r0, [r1] + pop {r1} + bx r1 + .align 2, 0 +_08011B38: .4byte gUnknown_203B150 + thumb_func_end sub_8011B20 + + thumb_func_start sub_8011B3C +sub_8011B3C: + ldr r0, _08011B44 + ldrb r0, [r0] + bx lr + .align 2, 0 +_08011B44: .4byte gUnknown_203B150 + thumb_func_end sub_8011B3C + + thumb_func_start nullsub_137 +nullsub_137: + bx lr + thumb_func_end nullsub_137 + + thumb_func_start sub_8011B4C +sub_8011B4C: + push {lr} + sub sp, 0x100 + adds r2, r0, 0 + cmp r2, 0 + beq _08011B5E + mov r0, sp + bl sub_8011AA4 + b _08011B66 +_08011B5E: + ldr r2, _08011B6C + mov r0, sp + bl sub_8011AA4 +_08011B66: + add sp, 0x100 + pop {r0} + bx r0 + .align 2, 0 +_08011B6C: .4byte gUnknown_80D421C + thumb_func_end sub_8011B4C + + thumb_func_start sub_8011B70 +sub_8011B70: + push {r0-r3} + push {lr} + sub sp, 0x100 + ldr r1, [sp, 0x104] + add r2, sp, 0x108 + mov r0, sp + bl vsprintf + add sp, 0x100 + pop {r3} + add sp, 0x10 + bx r3 + thumb_func_end sub_8011B70 + + thumb_func_start sub_8011B88 +sub_8011B88: + push {r0-r3} + push {lr} + sub sp, 0x100 + ldr r1, [sp, 0x104] + add r2, sp, 0x108 + mov r0, sp + bl vsprintf + add sp, 0x100 + pop {r3} + add sp, 0x10 + bx r3 + thumb_func_end sub_8011B88 + + thumb_func_start nullsub_28 +nullsub_28: + bx lr + thumb_func_end nullsub_28 + + thumb_func_start sub_8011BA4 +sub_8011BA4: + movs r0, 0 + bx lr + thumb_func_end sub_8011BA4 + + thumb_func_start sub_8011BA8 +sub_8011BA8: + movs r0, 0 + bx lr + thumb_func_end sub_8011BA8 + + thumb_func_start sub_8011BAC +sub_8011BAC: + ldr r0, _08011BB0 + bx lr + .align 2, 0 +_08011BB0: .4byte gUnknown_80D4288 + thumb_func_end sub_8011BAC + + thumb_func_start sub_8011BB4 +sub_8011BB4: + push {lr} + bl Hang + pop {r0} + bx r0 + thumb_func_end sub_8011BB4 + + thumb_func_start Log +Log: + push {r1-r3} + add sp, 0xC + bx lr + thumb_func_end Log + + thumb_func_start sub_8011BC8 +sub_8011BC8: + push {r2,r3} + add sp, 0x8 + bx lr + thumb_func_end sub_8011BC8 + + thumb_func_start nullsub_29 +nullsub_29: + bx lr + thumb_func_end nullsub_29 + + thumb_func_start nullsub_30 +nullsub_30: + bx lr + thumb_func_end nullsub_30 + + thumb_func_start nullsub_31 +nullsub_31: + bx lr + thumb_func_end nullsub_31 + + thumb_func_start nullsub_32 +nullsub_32: + bx lr + thumb_func_end nullsub_32 + + thumb_func_start sub_8011BE0 +sub_8011BE0: + push {lr} + bl Hang + pop {r0} + bx r0 + thumb_func_end sub_8011BE0 + + thumb_func_start FatalError +FatalError: + push {r1-r3} + push {r4,lr} + sub sp, 0x100 + adds r1, r0, 0 + ldr r4, [sp, 0x108] + ldr r0, _08011C14 + bl sub_8011B4C + add r2, sp, 0x10C + mov r0, sp + adds r1, r4, 0 + bl vsprintf + ldr r0, _08011C18 + mov r1, sp + bl sub_8011B70 + bl sub_8011BE0 + .align 2, 0 +_08011C14: .4byte gUnknown_80D42C0 +_08011C18: .4byte gUnknown_80D42D4 + thumb_func_end FatalError + + thumb_func_start sub_8011C1C +sub_8011C1C: + ldr r0, _08011C24 + ldr r0, [r0] + bx lr + .align 2, 0 +_08011C24: .4byte gUnknown_203B17C + thumb_func_end sub_8011C1C + + thumb_func_start sub_8011C28 +sub_8011C28: + ldr r1, _08011C30 + str r0, [r1] + bx lr + .align 2, 0 +_08011C30: .4byte gUnknown_203B17C + thumb_func_end sub_8011C28 + + thumb_func_start sub_8011C34 +sub_8011C34: + ldr r0, _08011C3C + ldr r0, [r0] + bx lr + .align 2, 0 +_08011C3C: .4byte gUnknown_202DE28 + thumb_func_end sub_8011C34 + + thumb_func_start sub_8011C40 +sub_8011C40: + ldr r1, _08011C48 + str r0, [r1] + bx lr + .align 2, 0 +_08011C48: .4byte gUnknown_202DE28 + thumb_func_end sub_8011C40 + + thumb_func_start sub_8011C4C +sub_8011C4C: + ldr r0, _08011C54 + ldr r0, [r0] + bx lr + .align 2, 0 +_08011C54: .4byte gUnknown_203B180 + thumb_func_end sub_8011C4C + + thumb_func_start sub_8011C58 +sub_8011C58: + push {r4,lr} + adds r4, r0, 0 + movs r2, 0 + lsrs r1, 2 + cmp r1, 0x1 + ble _08011C72 + adds r3, r4, 0x4 + subs r1, 0x1 +_08011C68: + ldm r3!, {r0} + adds r2, r0 + subs r1, 0x1 + cmp r1, 0 + bne _08011C68 +_08011C72: + str r2, [r4] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8011C58 + + thumb_func_start sub_8011C7C +sub_8011C7C: + push {r4,lr} + adds r4, r0, 0 + movs r2, 0 + lsrs r1, 2 + cmp r1, 0x1 + ble _08011C96 + adds r3, r4, 0x4 + subs r1, 0x1 +_08011C8C: + ldm r3!, {r0} + adds r2, r0 + subs r1, 0x1 + cmp r1, 0 + bne _08011C8C +_08011C96: + ldr r0, [r4] + cmp r0, r2 + bne _08011CA0 + movs r0, 0 + b _08011CA2 +_08011CA0: + movs r0, 0x1 +_08011CA2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8011C7C + + thumb_func_start sub_8011CA8 +sub_8011CA8: + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + ldr r0, _08011CCC + ldr r0, [r0] + ldr r0, _08011CD0 + adds r1, r2, r0 + cmp r1, 0 + bge _08011CBE + ldr r0, _08011CD4 + adds r1, r2, r0 +_08011CBE: + asrs r1, 12 + ldr r0, [r3] + adds r0, r1 + str r0, [r3] + pop {r0} + bx r0 + .align 2, 0 +_08011CCC: .4byte gUnknown_203B184 +_08011CD0: .4byte 0x00000fff +_08011CD4: .4byte 0x00001ffe + thumb_func_end sub_8011CA8 + + thumb_func_start sub_8011CD8 +sub_8011CD8: + push {r4-r6,lr} + adds r5, r1, 0 + adds r4, r2, 0 + ldr r6, [r0] + adds r1, r4, 0 + bl sub_8011CA8 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8011C58 + ldr r0, _08011D04 + ldr r0, [r0] + cmp r0, 0 + bne _08011D08 + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_800CFC0 + adds r1, r0, 0 + b _08011D28 + .align 2, 0 +_08011D04: .4byte gUnknown_203B184 +_08011D08: + bl sub_800DAB8 + lsls r0, 24 + cmp r0, 0 + beq _08011D38 + lsls r0, r6, 16 + lsrs r0, 16 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_800DAB4 + lsls r0, 24 + movs r1, 0 + cmp r0, 0 + bne _08011D28 + movs r1, 0x3 +_08011D28: + cmp r1, 0x4 + bne _08011D30 + movs r0, 0x1 + b _08011D3A +_08011D30: + cmp r1, 0 + bne _08011D38 + movs r0, 0 + b _08011D3A +_08011D38: + movs r0, 0x2 +_08011D3A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8011CD8 + + thumb_func_start sub_8011D40 +sub_8011D40: + push {r4-r6,lr} + adds r5, r1, 0 + adds r4, r2, 0 + ldr r6, [r0] + adds r1, r4, 0 + bl sub_8011CA8 + ldr r0, _08011D64 + ldr r0, [r0] + cmp r0, 0 + bne _08011D68 + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_800CF5C + adds r1, r0, 0 + b _08011D86 + .align 2, 0 +_08011D64: .4byte gUnknown_203B184 +_08011D68: + bl sub_800DAB8 + lsls r0, 24 + cmp r0, 0 + beq _08011D8A + lsls r0, r6, 16 + lsrs r0, 16 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_800DAB0 + lsls r0, 24 + movs r1, 0 + cmp r0, 0 + beq _08011D8A +_08011D86: + cmp r1, 0 + beq _08011D8E +_08011D8A: + movs r0, 0x1 + b _08011DA2 +_08011D8E: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8011C7C + lsls r0, 24 + cmp r0, 0 + bne _08011DA0 + movs r0, 0 + b _08011DA2 +_08011DA0: + movs r0, 0x2 +_08011DA2: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8011D40 + + thumb_func_start sub_8011DA8 +sub_8011DA8: + movs r0, 0x1 + bx lr + thumb_func_end sub_8011DA8 + + thumb_func_start sub_8011DAC +sub_8011DAC: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + ldr r0, _08011DE4 + mov r8, r0 + movs r1, 0x5 + bl MemoryAlloc + adds r5, r0, 0 + movs r1, 0x89 + lsls r1, 3 + adds r4, r5, r1 + adds r0, r6, 0 + adds r1, r5, 0 + mov r2, r8 + bl sub_8011D40 + adds r7, r0, 0 + cmp r7, 0 + beq _08011DE8 + adds r0, r6, 0 + adds r1, r5, 0 + mov r2, r8 + bl sub_8011D40 + adds r7, r0, 0 + b _08011DF0 + .align 2, 0 +_08011DE4: .4byte 0x000057d4 +_08011DE8: + adds r0, r6, 0 + mov r1, r8 + bl sub_8011CA8 +_08011DF0: + cmp r7, 0 + beq _08011DF6 + b _08011F6E +_08011DF6: + ldr r2, _08011E38 + adds r0, r5, r2 + ldr r1, [r0] + ldr r0, _08011E3C + cmp r1, r0 + beq _08011E04 + movs r7, 0x4 +_08011E04: + cmp r7, 0 + beq _08011E0A + b _08011F6E +_08011E0A: + ldr r0, _08011E40 + ldr r1, [r0] + cmp r1, 0 + bne _08011E48 + ldr r1, _08011E44 + adds r0, r5, r1 + ldr r0, [r0] + bl sub_8011C28 + movs r2, 0x83 + lsls r2, 3 + adds r0, r5, r2 + ldr r0, [r0] + bl sub_8011C40 + movs r1, 0x84 + lsls r1, 3 + adds r0, r5, r1 + ldr r0, [r0] + bl ReseedRng + b _08011E60 + .align 2, 0 +_08011E38: .4byte 0x00000414 +_08011E3C: .4byte 0x05071412 +_08011E40: .4byte gUnknown_203B184 +_08011E44: .4byte 0x0000041c +_08011E48: + ldr r2, _08011E80 + adds r0, r5, r2 + ldr r0, [r0] + str r0, [r1, 0x54] + subs r2, 0x4 + adds r0, r5, r2 + ldr r0, [r0] + str r0, [r1, 0x50] + adds r2, 0x8 + adds r0, r5, r2 + ldr r0, [r0] + str r0, [r1, 0x58] +_08011E60: + cmp r7, 0 + beq _08011E66 + b _08011F6E +_08011E66: + ldr r0, _08011E84 + ldr r0, [r0] + cmp r0, 0 + bne _08011E88 + adds r0, r5, 0x4 + bl sub_8002718 + lsls r0, 24 + cmp r0, 0 + bne _08011E94 + movs r7, 0x4 + b _08011F6E + .align 2, 0 +_08011E80: .4byte 0x0000041c +_08011E84: .4byte gUnknown_203B184 +_08011E88: + ldr r0, [r0, 0x4C] + adds r1, r5, 0x4 + movs r2, 0x80 + lsls r2, 3 + bl MemoryCopy8 +_08011E94: + cmp r7, 0 + bne _08011F6E + ldr r6, _08011F80 + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_808EE9C + adds r1, r0, 0 + ldr r2, _08011F84 + adds r0, r5, r2 + ldr r0, [r0] + cmp r1, r0 + beq _08011EB0 + movs r7, 0x3 +_08011EB0: + adds r4, r6 + movs r6, 0x96 + lsls r6, 2 + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_808F2B0 + adds r1, r0, 0 + movs r2, 0x85 + lsls r2, 3 + adds r0, r5, r2 + ldr r0, [r0] + cmp r1, r0 + beq _08011ECE + movs r7, 0x3 +_08011ECE: + adds r4, r6 + movs r6, 0xEC + lsls r6, 1 + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_8091D14 + adds r1, r0, 0 + movs r2, 0x86 + lsls r2, 3 + adds r0, r5, r2 + ldr r0, [r0] + cmp r1, r0 + beq _08011EEC + movs r7, 0x3 +_08011EEC: + adds r4, r6 + adds r0, r4, 0 + movs r1, 0x10 + bl sub_809222C + adds r1, r0, 0 + ldr r2, _08011F88 + adds r0, r5, r2 + ldr r0, [r0] + cmp r1, r0 + beq _08011F04 + movs r7, 0x3 +_08011F04: + adds r4, 0x10 + adds r0, r4, 0 + movs r1, 0x8 + bl sub_80927F4 + adds r1, r0, 0 + movs r2, 0x87 + lsls r2, 3 + adds r0, r5, r2 + ldr r0, [r0] + cmp r1, r0 + beq _08011F1E + movs r7, 0x3 +_08011F1E: + adds r4, 0x8 + movs r6, 0x80 + lsls r6, 1 + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_8097D98 + adds r1, r0, 0 + ldr r2, _08011F8C + adds r0, r5, r2 + ldr r0, [r0] + cmp r1, r0 + beq _08011F3A + movs r7, 0x3 +_08011F3A: + adds r4, r6 + ldr r6, _08011F90 + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_80954CC + adds r1, r0, 0 + movs r2, 0x88 + lsls r2, 3 + adds r0, r5, r2 + ldr r0, [r0] + cmp r1, r0 + beq _08011F56 + movs r7, 0x3 +_08011F56: + adds r4, r6 + ldr r1, _08011F94 + adds r0, r4, 0 + bl sub_8096FA0 + adds r1, r0, 0 + ldr r2, _08011F98 + adds r0, r5, r2 + ldr r0, [r0] + cmp r1, r0 + beq _08011F6E + movs r7, 0x3 +_08011F6E: + adds r0, r5, 0 + bl MemoryFree + adds r0, r7, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08011F80: .4byte 0x00004650 +_08011F84: .4byte 0x00000424 +_08011F88: .4byte 0x00000434 +_08011F8C: .4byte 0x0000043c +_08011F90: .4byte 0x00000594 +_08011F94: .4byte 0x00000221 +_08011F98: .4byte 0x00000444 + thumb_func_end sub_8011DAC + + thumb_func_start sub_8011F9C +sub_8011F9C: + push {lr} + bl sub_8011D40 + pop {r1} + bx r1 + thumb_func_end sub_8011F9C + + thumb_func_start sub_8011FA8 +sub_8011FA8: + push {r4,r5,lr} + sub sp, 0x4 + movs r4, 0x80 + lsls r4, 4 + adds r0, r4, 0 + movs r1, 0x5 + bl MemoryAlloc + adds r5, r0, 0 + movs r0, 0x1F + str r0, [sp] + mov r0, sp + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_8011D40 + adds r2, r0, 0 + cmp r2, 0 + bne _08011FD8 + ldr r1, [r5, 0x14] + ldr r0, _08011FF0 + cmp r1, r0 + beq _08011FD8 + movs r2, 0x4 +_08011FD8: + ldr r4, _08011FF4 + cmp r2, 0 + bne _08011FE0 + ldr r4, [r5, 0x18] +_08011FE0: + adds r0, r5, 0 + bl MemoryFree + adds r0, r4, 0 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08011FF0: .4byte 0x05071412 +_08011FF4: .4byte 0x000f1209 + thumb_func_end sub_8011FA8 + + thumb_func_start sub_8011FF8 +sub_8011FF8: + push {r4-r6,lr} + sub sp, 0x4 + movs r4, 0x80 + lsls r4, 4 + adds r0, r4, 0 + movs r1, 0x5 + bl MemoryAlloc + adds r5, r0, 0 + movs r0, 0x1F + str r0, [sp] + movs r6, 0 + mov r0, sp + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_8011D40 + cmp r0, 0 + bne _08012028 + ldr r1, [r5, 0x14] + ldr r0, _08012038 + cmp r1, r0 + bne _08012028 + movs r6, 0x1 +_08012028: + adds r0, r5, 0 + bl MemoryFree + adds r0, r6, 0 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08012038: .4byte 0x05071412 + thumb_func_end sub_8011FF8 + + thumb_func_start sub_801203C +sub_801203C: + push {r4-r7,lr} + adds r7, r0, 0 + adds r4, r1, 0 + ldr r0, _08012078 + movs r1, 0x5 + bl MemoryAlloc + adds r6, r0, 0 + movs r0, 0x89 + lsls r0, 3 + adds r5, r6, r0 + ldr r0, _0801207C + ldr r2, [r0] + cmp r2, 0 + bne _08012084 + ldr r1, _08012080 + adds r0, r6, r1 + str r4, [r0] + bl sub_8011C34 + movs r2, 0x83 + lsls r2, 3 + adds r1, r6, r2 + str r0, [r1] + bl GetRngState + movs r2, 0x84 + lsls r2, 3 + adds r1, r6, r2 + b _0801209E + .align 2, 0 +_08012078: .4byte 0x000057d4 +_0801207C: .4byte gUnknown_203B184 +_08012080: .4byte 0x0000041c +_08012084: + ldr r0, _080120C8 + adds r1, r6, r0 + ldr r0, [r2, 0x54] + str r0, [r1] + movs r0, 0x83 + lsls r0, 3 + adds r1, r6, r0 + ldr r0, [r2, 0x50] + str r0, [r1] + movs r0, 0x84 + lsls r0, 3 + adds r1, r6, r0 + ldr r0, [r2, 0x58] +_0801209E: + str r0, [r1] + ldr r2, _080120CC + adds r1, r6, r2 + ldr r0, _080120D0 + str r0, [r1] + bl sub_8011C4C + adds r1, r0, 0 + ldr r2, _080120D4 + adds r0, r6, r2 + movs r2, 0x10 + bl strncpy + ldr r0, _080120D8 + ldr r1, [r0] + cmp r1, 0 + bne _080120DC + adds r0, r6, 0x4 + bl sub_8002700 + b _080120E8 + .align 2, 0 +_080120C8: .4byte 0x0000041c +_080120CC: .4byte 0x00000414 +_080120D0: .4byte 0x05071412 +_080120D4: .4byte 0x00000404 +_080120D8: .4byte gUnknown_203B184 +_080120DC: + adds r0, r6, 0x4 + ldr r1, [r1, 0x4C] + movs r2, 0x80 + lsls r2, 3 + bl MemoryCopy8 +_080120E8: + ldr r4, _080121A4 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_808ED78 + ldr r2, _080121A8 + adds r1, r6, r2 + str r0, [r1] + adds r5, r4 + movs r4, 0x96 + lsls r4, 2 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_808F154 + movs r2, 0x85 + lsls r2, 3 + adds r1, r6, r2 + str r0, [r1] + adds r5, r4 + subs r4, 0x80 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8091C68 + movs r2, 0x86 + lsls r2, 3 + adds r1, r6, r2 + str r0, [r1] + adds r5, r4 + adds r0, r5, 0 + movs r1, 0x10 + bl sub_80921C4 + ldr r2, _080121AC + adds r1, r6, r2 + str r0, [r1] + adds r5, 0x10 + adds r0, r5, 0 + movs r1, 0x8 + bl sub_80927A8 + movs r2, 0x87 + lsls r2, 3 + adds r1, r6, r2 + str r0, [r1] + adds r5, 0x8 + subs r4, 0xD8 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8097D60 + ldr r2, _080121B0 + adds r1, r6, r2 + str r0, [r1] + adds r5, r4 + ldr r4, _080121B4 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8095624 + movs r2, 0x88 + lsls r2, 3 + adds r1, r6, r2 + str r0, [r1] + adds r5, r4 + ldr r1, _080121B8 + adds r0, r5, 0 + bl sub_80970D8 + ldr r2, _080121BC + adds r1, r6, r2 + str r0, [r1] + ldr r4, _080121C0 + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_8011CD8 + adds r5, r0, 0 + adds r0, r7, 0 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_8011CD8 + adds r4, r0, 0 + adds r0, r6, 0 + bl MemoryFree + cmp r5, 0 + beq _080121C4 + adds r0, r5, 0 + b _080121CE + .align 2, 0 +_080121A4: .4byte 0x00004650 +_080121A8: .4byte 0x00000424 +_080121AC: .4byte 0x00000434 +_080121B0: .4byte 0x0000043c +_080121B4: .4byte 0x00000594 +_080121B8: .4byte 0x00000221 +_080121BC: .4byte 0x00000444 +_080121C0: .4byte 0x000057d4 +_080121C4: + cmp r4, 0 + bne _080121CC + movs r0, 0 + b _080121CE +_080121CC: + adds r0, r4, 0 +_080121CE: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_801203C + + thumb_func_start sub_80121D4 +sub_80121D4: + push {lr} + bl sub_8011CD8 + pop {r1} + bx r1 + thumb_func_end sub_80121D4 + + thumb_func_start sub_80121E0 +sub_80121E0: + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r6, 0x80 + lsls r6, 4 + adds r0, r6, 0 + movs r1, 0x5 + bl MemoryAlloc + adds r4, r0, 0 + movs r0, 0x1F + str r0, [sp] + str r5, [r4, 0x18] + bl sub_809769C + ldr r0, [r0] + str r0, [r4, 0x1C] + ldr r0, _0801223C + str r0, [r4, 0x14] + bl sub_8011C4C + adds r1, r0, 0 + adds r0, r4, 0x4 + movs r2, 0x10 + bl strncpy + adds r0, r4, 0 + adds r0, 0x20 + movs r1, 0 + bl sub_80958E4 + mov r0, sp + adds r1, r4, 0 + adds r2, r6, 0 + bl sub_8011CD8 + adds r5, r0, 0 + adds r0, r4, 0 + bl MemoryFree + adds r0, r5, 0 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0801223C: .4byte 0x05071412 + thumb_func_end sub_80121E0 + + thumb_func_start sub_8012240 +sub_8012240: + push {r4,r5,lr} + movs r4, 0x80 + lsls r4, 4 + adds r0, r4, 0 + movs r1, 0x5 + bl MemoryAlloc + adds r5, r0, 0 + movs r1, 0xFF + movs r2, 0x4 + bl MemoryFill8 + bl sub_8011830 + movs r0, 0x1F + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_800CFC0 + adds r4, r0, 0 + bl sub_8011854 + adds r0, r5, 0 + bl MemoryFree + cmp r4, 0 + bne _0801227A + movs r0, 0 + b _0801227C +_0801227A: + movs r0, 0x2 +_0801227C: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8012240 + + thumb_func_start sub_8012284 +sub_8012284: + push {lr} + bl sub_80122D0 + bl sub_80122F4 + bl sub_8012300 + pop {r0} + bx r0 + thumb_func_end sub_8012284 + + thumb_func_start sub_8012298 +sub_8012298: + push {lr} + bl sub_80976A8 + bl sub_80122A8 + pop {r0} + bx r0 + thumb_func_end sub_8012298 + + thumb_func_start sub_80122A8 +sub_80122A8: + push {lr} + bl sub_80122D0 + bl sub_80122F4 + bl sub_8012300 + bl sub_8012240 + pop {r0} + bx r0 + thumb_func_end sub_80122A8 + + thumb_func_start nullsub_33 +nullsub_33: + bx lr + thumb_func_end nullsub_33 + + thumb_func_start sub_80122C4 +sub_80122C4: + push {lr} + bl sub_80122A8 + pop {r0} + bx r0 + thumb_func_end sub_80122C4 + + thumb_func_start sub_80122D0 +sub_80122D0: + push {lr} + movs r0, 0 + bl sub_8011C28 + movs r0, 0x1 + negs r0, r0 + bl sub_8011C40 + bl sub_8097748 + ldr r0, _080122F0 + ldr r0, [r0] + bl sub_8094FA8 + pop {r0} + bx r0 + .align 2, 0 +_080122F0: .4byte gUnknown_203B47C + thumb_func_end sub_80122D0 + + thumb_func_start sub_80122F4 +sub_80122F4: + push {lr} + bl sub_800135C + pop {r0} + bx r0 + thumb_func_end sub_80122F4 + + thumb_func_start sub_8012300 +sub_8012300: + push {lr} + bl sub_80923B8 + bl sub_808CE08 + bl sub_80909D8 + bl sub_8092094 + bl sub_80972F4 + bl sub_8095118 + bl sub_8095900 + bl sub_80974E8 + movs r0, 0x1 + bl sub_8094998 + bl sub_8097F74 + pop {r0} + bx r0 + thumb_func_end sub_8012300 + + thumb_func_start nullsub_200 +nullsub_200: + bx lr + thumb_func_end nullsub_200 + + thumb_func_start sub_8012334 +sub_8012334: + push {lr} + adds r2, r0, 0 + ldr r0, _08012390 + str r2, [r0] + cmp r2, 0 + beq _080123C8 + ldr r1, _08012394 + ldr r0, [r2] + str r0, [r1] + ldr r1, _08012398 + ldr r0, [r2, 0x4] + str r0, [r1] + ldr r1, _0801239C + ldr r0, [r2, 0x8] + str r0, [r1] + ldr r1, _080123A0 + ldr r0, [r2, 0xC] + str r0, [r1] + ldr r1, _080123A4 + ldr r0, [r2, 0x10] + str r0, [r1] + ldr r1, _080123A8 + ldr r0, [r2, 0x14] + str r0, [r1] + ldr r1, _080123AC + ldr r0, [r2, 0x18] + str r0, [r1] + ldr r1, _080123B0 + ldr r0, [r2, 0x1C] + str r0, [r1] + ldr r1, _080123B4 + ldr r0, [r2, 0x20] + str r0, [r1] + ldr r1, _080123B8 + ldr r0, [r2, 0x24] + str r0, [r1] + ldr r1, _080123BC + ldr r0, [r2, 0x28] + str r0, [r1] + ldr r1, _080123C0 + ldr r0, [r2, 0x2C] + str r0, [r1] + ldr r1, _080123C4 + ldr r0, [r2, 0x30] + b _0801242E + .align 2, 0 +_08012390: .4byte gUnknown_203B184 +_08012394: .4byte gUnknown_203B460 +_08012398: .4byte gUnknown_203B45C +_0801239C: .4byte gUnknown_203B480 +_080123A0: .4byte gUnknown_203B484 +_080123A4: .4byte gUnknown_203B488 +_080123A8: .4byte gUnknown_203B48C +_080123AC: .4byte gUnknown_203B490 +_080123B0: .4byte gUnknown_203B464 +_080123B4: .4byte gUnknown_203B494 +_080123B8: .4byte gUnknown_203B498 +_080123BC: .4byte gUnknown_203B468 +_080123C0: .4byte gUnknown_203B46C +_080123C4: .4byte gUnknown_203B47C +_080123C8: + bl sub_80909D0 + ldr r1, _08012434 + str r0, [r1] + bl sub_808CE00 + ldr r1, _08012438 + str r0, [r1] + bl sub_80950F8 + ldr r1, _0801243C + str r0, [r1] + bl sub_8095100 + ldr r1, _08012440 + str r0, [r1] + bl sub_8095108 + ldr r1, _08012444 + str r0, [r1] + bl sub_8095110 + ldr r1, _08012448 + str r0, [r1] + bl sub_80958F8 + ldr r1, _0801244C + str r0, [r1] + bl sub_809208C + ldr r1, _08012450 + str r0, [r1] + bl sub_8097680 + ldr r1, _08012454 + str r0, [r1] + bl sub_8097F6C + ldr r1, _08012458 + str r0, [r1] + bl sub_80923B0 + ldr r1, _0801245C + str r0, [r1] + bl sub_8094990 + ldr r1, _08012460 + str r0, [r1] + bl sub_8094FA0 + ldr r1, _08012464 +_0801242E: + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_08012434: .4byte gUnknown_203B460 +_08012438: .4byte gUnknown_203B45C +_0801243C: .4byte gUnknown_203B480 +_08012440: .4byte gUnknown_203B484 +_08012444: .4byte gUnknown_203B488 +_08012448: .4byte gUnknown_203B48C +_0801244C: .4byte gUnknown_203B490 +_08012450: .4byte gUnknown_203B464 +_08012454: .4byte gUnknown_203B494 +_08012458: .4byte gUnknown_203B498 +_0801245C: .4byte gUnknown_203B468 +_08012460: .4byte gUnknown_203B46C +_08012464: .4byte gUnknown_203B47C + thumb_func_end sub_8012334 + + thumb_func_start sub_8012468 +sub_8012468: + push {r4,lr} + ldr r4, _08012480 + movs r0, 0x8 + movs r1, 0x5 + bl MemoryAlloc + str r0, [r4] + movs r1, 0x1 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08012480: .4byte gUnknown_203B188 + thumb_func_end sub_8012468 + + thumb_func_start sub_8012484 +sub_8012484: + push {r4,r5,lr} + sub sp, 0x8 + ldr r1, _080124A0 + ldr r0, [r1] + ldr r0, [r0] + adds r4, r1, 0 + cmp r0, 0x6 + bhi _0801254C + lsls r0, 2 + ldr r1, _080124A4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080124A0: .4byte gUnknown_203B188 +_080124A4: .4byte _080124A8 + .align 2, 0 +_080124A8: + .4byte _080124C4 + .4byte _080124CC + .4byte _080124E8 + .4byte _0801251C + .4byte _08012534 + .4byte _0801254C + .4byte _08012548 +_080124C4: + ldr r1, [r4] + movs r0, 0x1 + str r0, [r1] + b _0801254C +_080124CC: + movs r0, 0 + str r0, [sp] + mov r0, sp + bl sub_8011DAC + ldr r1, _080124E4 + ldr r1, [r1] + str r0, [r1, 0x4] + movs r0, 0x2 + str r0, [r1] + b _0801254C + .align 2, 0 +_080124E4: .4byte gUnknown_203B188 +_080124E8: + adds r5, r4, 0 + ldr r1, [r5] + ldr r0, [r1, 0x4] + cmp r0, 0 + beq _0801253C + bl sub_8011FF8 + lsls r0, 24 + cmp r0, 0 + beq _08012518 + ldr r0, _08012510 + ldr r3, _08012514 + movs r1, 0 + movs r2, 0 + bl sub_80141B4 + ldr r1, [r5] + movs r0, 0x3 + str r0, [r1] + b _0801254C + .align 2, 0 +_08012510: .4byte gUnknown_80D4354 +_08012514: .4byte 0x00000301 +_08012518: + ldr r1, [r4] + b _0801252A +_0801251C: + add r0, sp, 0x4 + bl sub_80144A4 + cmp r0, 0 + bne _0801254C + ldr r0, _08012530 + ldr r1, [r0] +_0801252A: + movs r0, 0x4 + str r0, [r1] + b _0801254C + .align 2, 0 +_08012530: .4byte gUnknown_203B188 +_08012534: + bl sub_8012298 + ldr r0, _08012544 + ldr r1, [r0] +_0801253C: + movs r0, 0x6 + str r0, [r1] + b _0801254C + .align 2, 0 +_08012544: .4byte gUnknown_203B188 +_08012548: + movs r0, 0 + b _0801254E +_0801254C: + movs r0, 0x1 +_0801254E: + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8012484 + + thumb_func_start sub_8012558 +sub_8012558: + push {r4,lr} + ldr r4, _08012570 + ldr r0, [r4] + cmp r0, 0 + beq _0801256A + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0801256A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08012570: .4byte gUnknown_203B188 + thumb_func_end sub_8012558 + + thumb_func_start sub_8012574 +sub_8012574: + push {r4-r6,lr} + lsls r0, 16 + asrs r4, r0, 16 + bl sub_80993D8 + ldr r5, _080125D4 + movs r0, 0x20 + movs r1, 0x5 + bl MemoryAlloc + str r0, [r5] + movs r6, 0 + movs r1, 0 + strh r4, [r0, 0x1C] + str r1, [r0, 0xC] + str r1, [r0, 0x10] + cmp r4, 0 + beq _080125BA + adds r0, r4, 0 + bl sub_808DDD0 + ldr r1, [r5] + str r0, [r1, 0xC] + ldr r0, [r0, 0x4] + str r0, [r1, 0x10] + strb r6, [r1, 0x18] + ldr r0, [r5] + strb r6, [r0, 0x19] + ldr r0, [r5] + strb r6, [r0, 0x1A] + ldr r1, [r5] + movs r0, 0x2 + strh r0, [r1, 0x14] + movs r0, 0x8 + strh r0, [r1, 0x16] +_080125BA: + ldr r1, [r5] + ldr r0, [r1, 0xC] + cmp r0, 0 + beq _080125DC + adds r2, r1, 0 + adds r2, 0xC + ldr r0, _080125D8 + movs r1, 0 + movs r3, 0x20 + bl sub_80141B4 + b _080125E8 + .align 2, 0 +_080125D4: .4byte gUnknown_203B18C +_080125D8: .4byte gUnknown_80D4398 +_080125DC: + ldr r0, _080125F8 + movs r1, 0 + movs r2, 0 + movs r3, 0x20 + bl sub_80141B4 +_080125E8: + ldr r0, _080125FC + ldr r1, [r0] + movs r0, 0x3 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080125F8: .4byte gUnknown_80D4398 +_080125FC: .4byte gUnknown_203B18C + thumb_func_end sub_8012574 + + thumb_func_start sub_8012600 +sub_8012600: + push {r4,r5,lr} + sub sp, 0x8 + movs r5, 0 + ldr r0, _08012628 + ldr r2, [r0] + ldr r1, [r2, 0xC] + adds r4, r0, 0 + cmp r1, 0 + beq _08012616 + adds r5, r2, 0 + adds r5, 0xC +_08012616: + ldr r0, [r2] + cmp r0, 0x7 + bls _0801261E + b _08012738 +_0801261E: + lsls r0, 2 + ldr r1, _0801262C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08012628: .4byte gUnknown_203B18C +_0801262C: .4byte _08012630 + .align 2, 0 +_08012630: + .4byte _08012650 + .4byte _08012654 + .4byte _08012738 + .4byte _08012678 + .4byte _08012680 + .4byte _0801271C + .4byte _08012738 + .4byte _08012734 +_08012650: + ldr r1, [r4] + b _0801272A +_08012654: + ldr r1, [r4] + ldr r0, [r1, 0x4] + adds r0, 0x1 + str r0, [r1, 0x4] + cmp r0, 0x8 + ble _08012738 + ldr r0, _08012674 + movs r1, 0 + movs r2, 0 + movs r3, 0x20 + bl sub_80141B4 + ldr r1, [r4] + movs r0, 0x3 + str r0, [r1] + b _08012738 + .align 2, 0 +_08012674: .4byte gUnknown_80D43D8 +_08012678: + ldr r1, [r4] + movs r0, 0x4 + str r0, [r1] + b _08012738 +_08012680: + movs r0, 0 + str r0, [sp] + bl sub_80140DC + bl sub_8011C1C + adds r1, r0, 0 + mov r0, sp + bl sub_801203C + ldr r4, _080126B8 + ldr r1, [r4] + str r0, [r1, 0x8] + cmp r0, 0 + beq _080126C4 + cmp r0, 0x1 + beq _080126DC + ldr r0, [r1, 0xC] + cmp r0, 0 + beq _080126F4 + ldr r0, _080126BC +_080126AA: + ldr r3, _080126C0 + movs r1, 0 + adds r2, r5, 0 + bl sub_80141B4 + b _08012700 + .align 2, 0 +_080126B8: .4byte gUnknown_203B18C +_080126BC: .4byte gUnknown_80D44B0 +_080126C0: .4byte 0x00000101 +_080126C4: + ldr r0, [r1, 0xC] + cmp r0, 0 + beq _080126D4 + ldr r0, _080126D0 + b _080126AA + .align 2, 0 +_080126D0: .4byte gUnknown_80D4438 +_080126D4: + ldr r0, _080126D8 + b _080126F6 + .align 2, 0 +_080126D8: .4byte gUnknown_80D4438 +_080126DC: + ldr r0, _080126F0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_80141B4 + ldr r1, [r4] + movs r0, 0x6 + b _08012706 + .align 2, 0 +_080126F0: .4byte gUnknown_80D444C +_080126F4: + ldr r0, _08012710 +_080126F6: + ldr r3, _08012714 + movs r1, 0 + adds r2, r5, 0 + bl sub_80141B4 +_08012700: + ldr r0, _08012718 + ldr r1, [r0] + movs r0, 0x5 +_08012706: + str r0, [r1] + bl sub_8014114 + b _08012738 + .align 2, 0 +_08012710: .4byte gUnknown_80D44B0 +_08012714: .4byte 0x00000101 +_08012718: .4byte gUnknown_203B18C +_0801271C: + add r0, sp, 0x4 + bl sub_80144A4 + cmp r0, 0 + bne _08012738 + ldr r0, _08012730 + ldr r1, [r0] +_0801272A: + movs r0, 0x7 + str r0, [r1] + b _08012738 + .align 2, 0 +_08012730: .4byte gUnknown_203B18C +_08012734: + movs r0, 0 + b _0801273A +_08012738: + movs r0, 0x1 +_0801273A: + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8012600 + + thumb_func_start sub_8012744 +sub_8012744: + ldr r0, _0801274C + ldr r0, [r0] + ldr r0, [r0, 0x8] + bx lr + .align 2, 0 +_0801274C: .4byte gUnknown_203B18C + thumb_func_end sub_8012744 + + thumb_func_start sub_8012750 +sub_8012750: + push {r4,lr} + ldr r4, _08012778 + ldr r0, [r4] + cmp r0, 0 + beq _0801276E + ldr r0, [r0, 0xC] + cmp r0, 0 + beq _08012764 + bl sub_800AA14 +_08012764: + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0801276E: + bl sub_80993E4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08012778: .4byte gUnknown_203B18C + thumb_func_end sub_8012750 + + thumb_func_start sub_801277C +sub_801277C: + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + ldr r4, _080127A4 + movs r0, 0x10 + movs r1, 0x5 + bl MemoryAlloc + str r0, [r4] + str r5, [r0, 0x4] + str r6, [r0, 0x8] + movs r1, 0 + strb r1, [r0, 0xC] + ldr r1, [r4] + movs r0, 0x1 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080127A4: .4byte gUnknown_203B190 + thumb_func_end sub_801277C + + thumb_func_start sub_80127A8 +sub_80127A8: + push {r4,r5,lr} + sub sp, 0x8 + ldr r5, _080127C0 + ldr r2, [r5] + ldr r4, [r2] + cmp r4, 0x1 + beq _080127D4 + cmp r4, 0x1 + bgt _080127C4 + cmp r4, 0 + beq _080127CE + b _0801281E + .align 2, 0 +_080127C0: .4byte gUnknown_203B190 +_080127C4: + cmp r4, 0x2 + beq _08012808 + cmp r4, 0x3 + beq _0801281A + b _0801281E +_080127CE: + movs r0, 0x1 + str r0, [r2] + b _0801281E +_080127D4: + movs r0, 0x10 + str r0, [sp] + ldr r1, [r2, 0x4] + ldr r2, [r2, 0x8] + mov r0, sp + bl sub_8011F9C + cmp r0, 0 + bne _080127EC + ldr r0, [r5] + strb r4, [r0, 0xC] + b _08012812 +_080127EC: + ldr r0, _08012800 + ldr r3, _08012804 + movs r1, 0 + movs r2, 0 + bl sub_80141B4 + ldr r1, [r5] + movs r0, 0x2 + str r0, [r1] + b _0801281E + .align 2, 0 +_08012800: .4byte gUnknown_80D44C8 +_08012804: .4byte 0x00000301 +_08012808: + add r0, sp, 0x4 + bl sub_80144A4 + cmp r0, 0 + bne _0801281E +_08012812: + ldr r1, [r5] + movs r0, 0x3 + str r0, [r1] + b _0801281E +_0801281A: + movs r0, 0 + b _08012820 +_0801281E: + movs r0, 0x1 +_08012820: + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80127A8 + + thumb_func_start sub_8012828 +sub_8012828: + ldr r0, _08012830 + ldr r0, [r0] + ldrb r0, [r0, 0xC] + bx lr + .align 2, 0 +_08012830: .4byte gUnknown_203B190 + thumb_func_end sub_8012828 + + thumb_func_start sub_8012834 +sub_8012834: + push {r4,lr} + ldr r4, _0801284C + ldr r0, [r4] + cmp r0, 0 + beq _08012846 + bl MemoryFree + movs r0, 0 + str r0, [r4] +_08012846: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801284C: .4byte gUnknown_203B190 + thumb_func_end sub_8012834 + + thumb_func_start sub_8012850 +sub_8012850: + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r6, r0, 0 + mov r8, r1 + lsls r4, r2, 24 + lsrs r4, 24 + ldr r5, _0801288C + movs r0, 0x14 + movs r1, 0x5 + bl MemoryAlloc + str r0, [r5] + str r6, [r0, 0x4] + mov r1, r8 + str r1, [r0, 0x8] + movs r1, 0 + strb r4, [r0, 0xC] + ldr r0, [r5] + str r1, [r0] + ldrb r0, [r0, 0xC] + cmp r0, 0 + beq _08012894 + ldr r0, _08012890 + movs r2, 0 + movs r3, 0x20 + bl sub_80141B4 + b _080128A0 + .align 2, 0 +_0801288C: .4byte gUnknown_203B194 +_08012890: .4byte gUnknown_80D45AC +_08012894: + ldr r0, _080128AC + movs r1, 0 + movs r2, 0 + movs r3, 0x20 + bl sub_80141B4 +_080128A0: + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080128AC: .4byte gUnknown_80D45AC + thumb_func_end sub_8012850 + + thumb_func_start sub_80128B0 +sub_80128B0: + push {r4,lr} + sub sp, 0x8 + ldr r1, _080128CC + ldr r0, [r1] + ldr r0, [r0] + adds r4, r1, 0 + cmp r0, 0x5 + bls _080128C2 + b _080129F0 +_080128C2: + lsls r0, 2 + ldr r1, _080128D0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080128CC: .4byte gUnknown_203B194 +_080128D0: .4byte _080128D4 + .align 2, 0 +_080128D4: + .4byte _080128EC + .4byte _080128F4 + .4byte _0801291C + .4byte _080129C8 + .4byte _080129F0 + .4byte _080129E0 +_080128EC: + ldr r1, [r4] + movs r0, 0x1 + str r0, [r1] + b _080129F0 +_080128F4: + bl sub_80140DC + movs r0, 0x10 + str r0, [sp] + ldr r4, _08012918 + ldr r0, [r4] + ldr r1, [r0, 0x4] + ldr r2, [r0, 0x8] + mov r0, sp + bl sub_80121D4 + ldr r1, [r4] + str r0, [r1, 0x10] + movs r0, 0x2 + str r0, [r1] + movs r0, 0x1 + b _080129F2 + .align 2, 0 +_08012918: .4byte gUnknown_203B194 +_0801291C: + movs r0, 0 + str r0, [sp] + ldr r0, [r4] + ldr r0, [r0, 0x10] + cmp r0, 0 + bne _08012934 + mov r0, sp + movs r1, 0x2 + bl sub_801203C + ldr r1, [r4] + str r0, [r1, 0x10] +_08012934: + ldr r0, [r4] + ldr r0, [r0, 0x10] + cmp r0, 0 + beq _08012964 + cmp r0, 0x1 + beq _080129AC + ldr r0, _08012958 + bl sub_80121E0 + ldr r0, _0801295C + ldr r3, _08012960 + movs r1, 0 + movs r2, 0 + bl sub_80141B4 + ldr r1, [r4] + movs r0, 0x3 + b _080129BC + .align 2, 0 +_08012958: .4byte 0x000f1209 +_0801295C: .4byte gUnknown_80D47A0 +_08012960: .4byte 0x00000301 +_08012964: + ldr r0, _08012980 + bl sub_80121E0 + ldr r0, [r4] + ldrb r0, [r0, 0xC] + cmp r0, 0 + beq _0801298C + ldr r0, _08012984 + ldr r3, _08012988 + movs r1, 0 + movs r2, 0 + bl sub_80141B4 + b _08012998 + .align 2, 0 +_08012980: .4byte 0x000f1207 +_08012984: .4byte gUnknown_80D45F4 +_08012988: .4byte 0x00000301 +_0801298C: + ldr r0, _080129A0 + ldr r3, _080129A4 + movs r1, 0 + movs r2, 0 + bl sub_80141B4 +_08012998: + ldr r0, _080129A8 + ldr r1, [r0] + movs r0, 0x3 + b _080129BC + .align 2, 0 +_080129A0: .4byte gUnknown_80D4668 +_080129A4: .4byte 0x00000301 +_080129A8: .4byte gUnknown_203B194 +_080129AC: + ldr r0, _080129C4 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_80141B4 + ldr r1, [r4] + movs r0, 0x4 +_080129BC: + str r0, [r1] + bl sub_8014114 + b _080129F0 + .align 2, 0 +_080129C4: .4byte gUnknown_80D473C +_080129C8: + add r0, sp, 0x4 + bl sub_80144A4 + cmp r0, 0 + bne _080129F0 + ldr r0, _080129DC + ldr r1, [r0] + movs r0, 0x5 + str r0, [r1] + b _080129F0 + .align 2, 0 +_080129DC: .4byte gUnknown_203B194 +_080129E0: + ldr r0, [r4] + ldr r0, [r0, 0x10] + cmp r0, 0 + bne _080129EC + movs r0, 0x2 + b _080129F2 +_080129EC: + movs r0, 0x3 + b _080129F2 +_080129F0: + movs r0, 0 +_080129F2: + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80128B0 + + thumb_func_start sub_80129FC +sub_80129FC: + push {r4,lr} + ldr r4, _08012A14 + ldr r0, [r4] + cmp r0, 0 + beq _08012A0E + bl MemoryFree + movs r0, 0 + str r0, [r4] +_08012A0E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08012A14: .4byte gUnknown_203B194 + thumb_func_end sub_80129FC + + thumb_func_start sub_8012A18 +sub_8012A18: + push {lr} + bl sub_8011860 + bl sub_80144C4 + ldr r0, _08012A60 + ldr r0, [r0] + ldrb r0, [r0, 0xA] + bl nullsub_8 + bl sub_8005180 + bl sub_80060EC + bl sub_800CB20 + bl sub_800485C + bl CopySpritesToOam + bl sub_8005304 + bl TransferBGPaletteBuffer + bl xxx_call_update_bg_vram + bl sub_8009908 + bl xxx_call_update_bg_sound_input + movs r0, 0 + bl sub_8004D8C + pop {r0} + bx r0 + .align 2, 0 +_08012A60: .4byte gUnknown_203B46C + thumb_func_end sub_8012A18 + + thumb_func_start sub_8012A64 +sub_8012A64: + push {r4,lr} + adds r4, r0, 0 + cmp r4, 0 + beq _08012A94 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08012A7A + adds r0, r4, 0 + bl nullsub_34 +_08012A7A: + ldrb r1, [r4, 0x1] + cmp r1, 0 + beq _08012A88 + movs r0, 0 + strb r0, [r4, 0x1] + movs r0, 0x1 + b _08012A98 +_08012A88: + ldrb r0, [r4, 0x2] + cmp r0, 0 + beq _08012A94 + strb r1, [r4, 0x2] + movs r0, 0x2 + b _08012A98 +_08012A94: + bl sub_8012AE8 +_08012A98: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8012A64 + + thumb_func_start GetKeyPress +GetKeyPress: + push {lr} + adds r1, r0, 0 + cmp r1, 0 + beq _08012ADE + adds r0, 0x29 + ldrb r0, [r0] + cmp r0, 0 + beq _08012AB4 + movs r0, 0x1 + b _08012AE2 +_08012AB4: + adds r0, r1, 0 + adds r0, 0x2A + ldrb r0, [r0] + cmp r0, 0 + beq _08012AC2 + movs r0, 0x2 + b _08012AE2 +_08012AC2: + adds r0, r1, 0 + adds r0, 0x2C + ldrb r0, [r0] + cmp r0, 0 + beq _08012AD0 + movs r0, 0x9 + b _08012AE2 +_08012AD0: + adds r0, r1, 0 + adds r0, 0x2B + ldrb r0, [r0] + cmp r0, 0 + beq _08012ADE + movs r0, 0xA + b _08012AE2 +_08012ADE: + bl sub_8012AE8 +_08012AE2: + pop {r1} + bx r1 + thumb_func_end GetKeyPress + + thumb_func_start sub_8012AE8 +sub_8012AE8: + push {lr} + ldr r2, _08012B08 + ldrh r1, [r2] + movs r3, 0x80 + lsls r3, 1 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _08012B4A + ldrh r1, [r2, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08012B0C + movs r0, 0xB + b _08012BBE + .align 2, 0 +_08012B08: .4byte gUnknown_20255F0 +_08012B0C: + ldrh r1, [r2, 0x4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08012B1A + movs r0, 0xC + b _08012BBE +_08012B1A: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08012B26 + movs r0, 0xD + b _08012BBE +_08012B26: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08012B32 + movs r0, 0xE + b _08012BBE +_08012B32: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08012B3E + movs r0, 0xF + b _08012BBE +_08012B3E: + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _08012BBC + movs r0, 0x6 + b _08012BBE +_08012B4A: + ldrh r1, [r2, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08012B58 + movs r0, 0x1 + b _08012BBE +_08012B58: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08012B64 + movs r0, 0x2 + b _08012BBE +_08012B64: + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08012B70 + movs r0, 0x3 + b _08012BBE +_08012B70: + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08012B7C + movs r0, 0x4 + b _08012BBE +_08012B7C: + ldrh r1, [r2, 0x4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08012B8A + movs r0, 0x7 + b _08012BBE +_08012B8A: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08012B96 + movs r0, 0x8 + b _08012BBE +_08012B96: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08012BA2 + movs r0, 0x9 + b _08012BBE +_08012BA2: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08012BAE + movs r0, 0xA + b _08012BBE +_08012BAE: + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + cmp r0, 0 + beq _08012BBC + movs r0, 0x5 + b _08012BBE +_08012BBC: + movs r0, 0 +_08012BBE: + pop {r1} + bx r1 + thumb_func_end sub_8012AE8 + + thumb_func_start sub_8012BC4 +sub_8012BC4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + mov r10, r0 + mov r9, r1 + adds r1, r2, 0 + adds r7, r3, 0 + movs r0, 0 + mov r8, r0 + add r0, sp, 0x4 + adds r2, r7, 0 + bl sub_800456C + subs r5, r7, 0x1 + cmp r5, 0 + ble _08012C0A + lsls r0, r5, 2 + mov r1, sp + adds r1, r0 + adds r1, 0x4 + ldr r0, [r1] + cmp r0, 0 + bne _08012C0A + movs r2, 0xFF +_08012BFA: + str r2, [r1] + subs r1, 0x4 + subs r5, 0x1 + cmp r5, 0 + ble _08012C0A + ldr r0, [r1] + cmp r0, 0 + beq _08012BFA +_08012C0A: + movs r5, 0 + cmp r5, r7 + bge _08012C50 + ldr r0, [sp, 0x4] + cmp r0, 0xFF + beq _08012C50 + add r6, sp, 0x4 +_08012C18: + ldm r6!, {r0} + adds r0, 0x30 + lsls r0, 24 + lsrs r0, 24 + bl sub_8092288 + adds r4, r0, 0 + bl sub_8008584 + movs r1, 0x6 + ldrsh r0, [r0, r1] + add r8, r0 + mov r2, r10 + mov r1, r8 + subs r0, r2, r1 + ldr r2, [sp, 0x48] + str r2, [sp] + mov r1, r9 + adds r2, r4, 0 + ldr r3, [sp, 0x44] + bl sub_800743C + adds r5, 0x1 + cmp r5, r7 + bge _08012C50 + ldr r0, [r6] + cmp r0, 0xFF + bne _08012C18 +_08012C50: + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8012BC4 + + thumb_func_start sub_8012C60 +sub_8012C60: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + adds r0, r2, 0 + adds r7, r3, 0 + lsls r0, 24 + lsrs r0, 24 + bl sub_8092288 + adds r4, r0, 0 + bl sub_8008584 + adds r1, r0, 0 + movs r2, 0x6 + ldrsh r0, [r1, r2] + cmp r0, 0xB + bgt _08012C90 + movs r1, 0xC + subs r1, r0 + lsrs r0, r1, 31 + adds r1, r0 + asrs r0, r1, 1 + b _08012C92 +_08012C90: + movs r0, 0 +_08012C92: + adds r0, r5, r0 + ldr r1, [sp, 0x18] + str r1, [sp] + adds r1, r6, 0 + adds r2, r4, 0 + adds r3, r7, 0 + bl sub_800743C + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8012C60 + + thumb_func_start sub_8012CAC +sub_8012CAC: + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r0 + adds r4, r1, 0 + movs r7, 0 + movs r6, 0 + ldr r0, [r4] + cmp r0, 0 + beq _08012CE6 + movs r5, 0x80 + lsls r5, 9 +_08012CC4: + adds r0, r5, 0 + movs r1, 0x80 + lsls r1, 9 + adds r5, r1 + asrs r7, r0, 16 + ldr r0, [r4] + bl sub_8008ED0 + lsls r0, 16 + asrs r0, 16 + cmp r0, r6 + ble _08012CDE + adds r6, r0, 0 +_08012CDE: + adds r4, 0x8 + ldr r0, [r4] + cmp r0, 0 + bne _08012CC4 +_08012CE6: + adds r0, r6, 0 + cmp r0, 0 + bge _08012CEE + adds r0, 0x7 +_08012CEE: + asrs r0, 3 + adds r0, 0x2 + mov r1, r8 + strh r0, [r1, 0xC] + mov r0, r8 + adds r1, r7, 0 + bl sub_8012D08 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8012CAC + + thumb_func_start sub_8012D08 +sub_8012D08: + push {r4,lr} + adds r4, r0, 0 + adds r0, r1, 0 + movs r1, 0xC + bl sub_80095E4 + lsls r0, 16 + asrs r1, r0, 16 + ldr r0, [r4, 0x4] + cmp r0, 0x6 + bne _08012D24 + adds r0, r1, 0x2 + lsls r0, 16 + asrs r1, r0, 16 +_08012D24: + lsls r0, r1, 16 + lsrs r0, 16 + strh r0, [r4, 0xE] + strh r0, [r4, 0x10] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8012D08 + + thumb_func_start sub_8012D34 +sub_8012D34: + push {r4,lr} + adds r4, r0, 0 + adds r0, r1, 0 + movs r1, 0x18 + bl sub_8009614 + lsls r0, 16 + asrs r1, r0, 16 + ldr r0, [r4, 0x4] + cmp r0, 0x6 + bne _08012D50 + adds r0, r1, 0x2 + lsls r0, 16 + asrs r1, r0, 16 +_08012D50: + lsls r0, r1, 16 + lsrs r0, 16 + strh r0, [r4, 0xE] + strh r0, [r4, 0x10] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8012D34 + + thumb_func_start sub_8012D60 +sub_8012D60: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r4, r0, 0 + adds r5, r3, 0 + ldr r7, [sp, 0x20] + movs r3, 0 + movs r6, 0x1 + negs r6, r6 + mov r12, r3 + ldr r0, [sp, 0x24] + str r0, [r4, 0x10] + str r1, [r4, 0x4] + str r2, [r4, 0x8] + cmp r2, 0 + bne _08012D88 + ldr r0, _08012E00 + str r0, [r4, 0x8] +_08012D88: + str r5, [r4, 0xC] + ldr r0, [r1] + adds r5, r4, 0 + adds r5, 0x14 + movs r2, 0x4C + adds r2, r4 + mov r8, r2 + movs r2, 0x4D + adds r2, r4 + mov r9, r2 + movs r2, 0x4E + adds r2, r4 + mov r10, r2 + cmp r0, 0 + beq _08012DC6 +_08012DA6: + cmp r7, 0 + blt _08012DB2 + ldr r0, [r1, 0x4] + cmp r7, r0 + bne _08012DB2 + adds r6, r3, 0 +_08012DB2: + ldr r0, [r1] + ldrb r0, [r0] + cmp r0, 0x2A + bne _08012DBC + mov r12, r3 +_08012DBC: + adds r1, 0x8 + adds r3, 0x1 + ldr r0, [r1] + cmp r0, 0 + bne _08012DA6 +_08012DC6: + cmp r6, 0 + bge _08012DCC + mov r6, r12 +_08012DCC: + adds r0, r5, 0 + adds r1, r3, 0 + ldr r2, [sp, 0x24] + bl sub_8013134 + strh r6, [r4, 0x2C] + adds r0, r5, 0 + movs r1, 0 + bl sub_80137B0 + movs r0, 0x1 + mov r1, r8 + strb r0, [r1] + mov r2, r9 + strb r0, [r2] + mov r1, r10 + strb r0, [r1] + subs r0, 0x2 + str r0, [r4, 0x48] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08012E00: .4byte gUnknown_80D47B8 + thumb_func_end sub_8012D60 + + thumb_func_start sub_8012E04 +sub_8012E04: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r5, r0, 0 + adds r7, r1, 0 + mov r8, r2 + mov r9, r3 + ldr r3, [sp, 0x1C] + movs r1, 0 + movs r6, 0x1 + negs r6, r6 + movs r4, 0 + ldr r0, [r7] + cmp r0, 0 + beq _08012E46 + adds r2, r7, 0 +_08012E26: + cmp r3, 0 + blt _08012E32 + ldr r0, [r2, 0x4] + cmp r3, r0 + bne _08012E32 + adds r6, r1, 0 +_08012E32: + ldr r0, [r2] + ldrb r0, [r0] + cmp r0, 0x2A + bne _08012E3C + adds r4, r1, 0 +_08012E3C: + adds r2, 0x8 + adds r1, 0x1 + ldr r0, [r2] + cmp r0, 0 + bne _08012E26 +_08012E46: + cmp r6, 0 + bge _08012E4C + adds r6, r4, 0 +_08012E4C: + adds r4, r5, 0 + adds r4, 0x14 + adds r0, r4, 0 + ldr r2, [sp, 0x20] + bl sub_8013134 + strh r6, [r5, 0x2C] + adds r0, r4, 0 + movs r1, 0 + bl sub_80137B0 + ldr r0, [sp, 0x20] + str r0, [r5, 0x10] + mov r0, r8 + str r0, [r5, 0x8] + cmp r0, 0 + bne _08012E72 + ldr r0, _08012EA0 + str r0, [r5, 0x8] +_08012E72: + mov r0, r9 + str r0, [r5, 0xC] + str r7, [r5, 0x4] + adds r1, r5, 0 + adds r1, 0x4E + movs r0, 0 + strb r0, [r1] + adds r0, r5, 0 + adds r0, 0x4C + movs r1, 0x1 + strb r1, [r0] + adds r0, 0x1 + strb r1, [r0] + movs r0, 0x1 + negs r0, r0 + str r0, [r5, 0x48] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08012EA0: .4byte gUnknown_80D47B8 + thumb_func_end sub_8012E04 + + thumb_func_start sub_8012EA4 +sub_8012EA4: + push {lr} + adds r2, r0, 0 + adds r2, 0x4C + strb r1, [r2] + adds r2, 0x1 + movs r1, 0x1 + strb r1, [r2] + bl sub_8012EBC + pop {r0} + bx r0 + thumb_func_end sub_8012EA4 + + thumb_func_start sub_8012EBC +sub_8012EBC: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x164 + adds r5, r0, 0 + movs r0, 0x4D + adds r0, r5 + mov r8, r0 + ldrb r0, [r0] + cmp r0, 0 + beq _08012F9E + ldr r0, [r5, 0x10] + bl sub_80073B8 + ldr r2, [r5, 0x10] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 3 + ldr r1, _08012F54 + adds r0, r1 + ldr r0, [r0, 0xC] + cmp r0, 0x6 + bne _08012F24 + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + mov r4, sp + adds r4, r0 + adds r4, 0x4 + add r0, sp, 0x4 + bl sub_8006518 + ldr r0, [r5] + bl sub_8008ED0 + adds r1, r0, 0 + ldr r0, [r4, 0x14] + ldrb r0, [r0, 0x2] + lsls r0, 3 + subs r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + adds r0, 0x8 + ldr r2, [r5] + ldr r3, [r5, 0x10] + movs r1, 0 + str r1, [sp] + bl sub_8014FF0 +_08012F24: + ldr r7, [r5, 0x8] + ldr r4, [r5, 0x4] + ldr r6, [r5, 0xC] + movs r1, 0 + mov r9, r1 + ldr r0, [r4] + mov r10, r8 + cmp r0, 0 + beq _08012F92 + add r0, sp, 0x64 + mov r8, r0 +_08012F3A: + ldr r3, [r4] + ldrb r0, [r3] + cmp r0, 0x2A + bne _08012F44 + adds r3, 0x1 +_08012F44: + cmp r6, 0 + beq _08012F58 + ldrh r0, [r6] + lsls r0, 2 + adds r0, r7 + ldr r2, [r0] + adds r6, 0x2 + b _08012F64 + .align 2, 0 +_08012F54: .4byte gUnknown_2027370 +_08012F58: + ldr r0, [r4, 0x4] + cmp r0, 0 + bge _08012F62 + ldr r2, [r7, 0x4] + b _08012F64 +_08012F62: + ldr r2, [r7] +_08012F64: + mov r0, r8 + ldr r1, _08012FBC + bl sub_800D158 + adds r0, r5, 0 + adds r0, 0x14 + mov r1, r9 + bl sub_8013800 + adds r1, r0, 0 + ldr r3, [r5, 0x10] + movs r0, 0 + str r0, [sp] + movs r0, 0x8 + mov r2, r8 + bl sub_8014FF0 + adds r4, 0x8 + movs r1, 0x1 + add r9, r1 + ldr r0, [r4] + cmp r0, 0 + bne _08012F3A +_08012F92: + ldr r0, [r5, 0x10] + bl sub_80073E0 + movs r0, 0 + mov r1, r10 + strb r0, [r1] +_08012F9E: + adds r0, r5, 0 + adds r0, 0x4E + ldrb r0, [r0] + cmp r0, 0 + beq _08012FC8 + adds r0, r5, 0 + adds r0, 0x4C + ldrb r0, [r0] + cmp r0, 0 + beq _08012FC0 + adds r0, r5, 0 + adds r0, 0x14 + bl AddMenuCursorSprite + b _08012FC8 + .align 2, 0 +_08012FBC: .4byte gUnknown_80D4828 +_08012FC0: + adds r0, r5, 0 + adds r0, 0x14 + bl sub_8013660 +_08012FC8: + add sp, 0x164 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8012EBC + + thumb_func_start sub_8012FD8 +sub_8012FD8: + push {r4-r7,lr} + adds r4, r0, 0 + movs r0, 0x2C + ldrsh r7, [r4, r0] + adds r6, r4, 0 + adds r6, 0x4C + ldrb r0, [r6] + cmp r0, 0 + beq _08013094 + adds r5, r4, 0 + adds r5, 0x14 + adds r0, r5, 0 + bl GetKeyPress + cmp r0, 0x2 + beq _08013078 + cmp r0, 0x2 + bgt _08013002 + cmp r0, 0x1 + beq _08013028 + b _08013094 +_08013002: + cmp r0, 0x7 + beq _08013012 + cmp r0, 0x8 + bne _08013094 + adds r0, r5, 0 + bl MoveMenuCursorDown + b _08013018 +_08013012: + adds r0, r5, 0 + bl MoveMenuCursorUp +_08013018: + movs r1, 0x2C + ldrsh r0, [r4, r1] + cmp r7, r0 + beq _08013094 + movs r0, 0x3 + bl sub_80119D4 + b _08013094 +_08013028: + adds r0, r5, 0 + bl sub_80137A8 + adds r2, r0, 0 + lsls r1, r2, 3 + ldr r0, [r4, 0x4] + adds r0, r1 + ldr r3, [r0, 0x4] + cmp r3, 0 + blt _08013068 + ldr r1, [r4, 0xC] + cmp r1, 0 + beq _0801304C + lsls r0, r2, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0x1 + beq _08013068 +_0801304C: + str r3, [r4, 0x48] + adds r1, r4, 0 + adds r1, 0x4C + movs r0, 0 + strb r0, [r1] + strh r0, [r4, 0x38] + ldr r1, [r4, 0xC] + cmp r1, 0 + beq _08013070 + lsls r0, r2, 1 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0x2 + bne _08013070 +_08013068: + movs r0, 0x2 + bl sub_80119D4 + b _08013094 +_08013070: + movs r0, 0 + bl sub_80119D4 + b _08013094 +_08013078: + movs r1, 0x2E + ldrsh r0, [r4, r1] + ldr r1, [r4, 0x4] + lsls r0, 3 + adds r0, r1 + ldr r0, [r0, 0x4] + cmp r0, 0 + blt _08013094 + str r0, [r4, 0x48] + movs r0, 0 + strb r0, [r6] + movs r0, 0x1 + bl sub_80119D4 +_08013094: + adds r0, r4, 0 + bl sub_8012EBC + adds r0, r4, 0 + adds r0, 0x4C + ldrb r0, [r0] + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8012FD8 + + thumb_func_start sub_80130A8 +sub_80130A8: + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r4, 0 + adds r6, 0x4C + ldrb r0, [r6] + cmp r0, 0 + beq _08013100 + adds r5, r4, 0 + adds r5, 0x14 + adds r0, r5, 0 + bl GetKeyPress + cmp r0, 0x1 + beq _080130CA + cmp r0, 0x2 + beq _080130E6 + b _08013100 +_080130CA: + adds r0, r5, 0 + bl sub_80137A8 + lsls r0, 3 + ldr r1, [r4, 0x4] + adds r1, r0 + ldr r0, [r1, 0x4] + str r0, [r4, 0x48] + movs r0, 0 + strb r0, [r6] + strh r0, [r4, 0x38] + bl sub_80119D4 + b _08013100 +_080130E6: + movs r1, 0x2E + ldrsh r0, [r4, r1] + ldr r1, [r4, 0x4] + lsls r0, 3 + adds r0, r1 + ldr r0, [r0, 0x4] + cmp r0, 0 + blt _08013100 + str r0, [r4, 0x48] + movs r0, 0 + strb r0, [r6] + bl sub_80119D4 +_08013100: + adds r0, r4, 0 + bl sub_8012EBC + adds r0, r4, 0 + adds r0, 0x4C + ldrb r0, [r0] + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80130A8 + + thumb_func_start sub_8013114 +sub_8013114: + push {lr} + adds r2, r0, 0 + adds r0, 0x4C + ldrb r0, [r0] + cmp r0, 0 + beq _08013124 + movs r0, 0x1 + b _0801312E +_08013124: + cmp r1, 0 + beq _0801312C + ldr r0, [r2, 0x48] + str r0, [r1] +_0801312C: + movs r0, 0 +_0801312E: + pop {r1} + bx r1 + thumb_func_end sub_8013114 + + thumb_func_start sub_8013134 +sub_8013134: + push {r4,lr} + adds r4, r0, 0 + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 3 + ldr r3, _0801315C + adds r0, r3 + str r2, [r4] + movs r2, 0 + strh r2, [r4, 0x18] + strh r1, [r4, 0x1A] + strh r1, [r4, 0x1C] + strh r2, [r4, 0x1E] + strh r2, [r4, 0x4] + ldr r0, [r0, 0xC] + cmp r0, 0x6 + bne _08013160 + movs r0, 0x10 + b _08013162 + .align 2, 0 +_0801315C: .4byte gUnknown_2027370 +_08013160: + movs r0, 0x2 +_08013162: + strh r0, [r4, 0x6] + movs r0, 0 + strh r0, [r4, 0xC] + strh r0, [r4, 0xE] + strh r0, [r4, 0x14] + strh r0, [r4, 0x24] + adds r0, r4, 0 + adds r0, 0x28 + bl sub_801317C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8013134 + + thumb_func_start sub_801317C +sub_801317C: + push {lr} + movs r1, 0 + strb r1, [r0] + strb r1, [r0, 0x1] + strb r1, [r0, 0x2] + strb r1, [r0, 0x4] + strb r1, [r0, 0x3] + ldr r1, _080131A4 + strh r1, [r0, 0x8] + movs r1, 0x1 + negs r1, r1 + strh r1, [r0, 0xA] + adds r0, 0x8 + bl nullsub_7 + bl sub_8004914 + pop {r0} + bx r0 + .align 2, 0 +_080131A4: .4byte 0x0000ffff + thumb_func_end sub_801317C + + thumb_func_start AddMenuCursorSprite +AddMenuCursorSprite: + push {lr} + movs r1, 0 + bl AddMenuCursorSprite_ + pop {r0} + bx r0 + thumb_func_end AddMenuCursorSprite + + thumb_func_start AddMenuCursorSprite_ +AddMenuCursorSprite_: + push {r4-r6,lr} + sub sp, 0x8 + adds r6, r0, 0 + movs r0, 0 + movs r1, 0 + str r0, [sp] + str r1, [sp, 0x4] + movs r1, 0x1A + ldrsh r0, [r6, r1] + cmp r0, 0 + bgt _080131CC + b _080132D6 +_080131CC: + adds r0, r6, 0 + bl UpdateMenuCursorSpriteCoords + ldrh r1, [r6, 0x24] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _080132D6 + mov r0, sp + ldrh r0, [r0] + ldr r1, _080132FC + ands r1, r0 + ldr r3, _08013300 + ldr r0, [sp] + ands r0, r3 + orrs r0, r1 + str r0, [sp] + mov r1, sp + ldrh r1, [r1] + adds r2, r3, 0 + ands r2, r0 + orrs r2, r1 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r0, _08013304 + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r4, _08013308 + adds r0, r4, 0 + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r0, _0801330C + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r0, _08013310 + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r0, _08013314 + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + ands r3, r1 + orrs r3, r0 + str r3, [sp] + mov r3, sp + movs r2, 0xFD + lsls r2, 2 + ldrh r1, [r3, 0x4] + movs r0, 0xFC + lsls r0, 8 + ands r0, r1 + orrs r0, r2 + ands r0, r4 + movs r5, 0xF + movs r1, 0xF0 + lsls r1, 8 + ldr r4, _08013318 + ands r0, r4 + orrs r0, r1 + strh r0, [r3, 0x4] + ldrh r0, [r3, 0x6] + ldr r1, _0801331C + ands r1, r0 + ldr r0, _08013320 + ands r1, r0 + movs r2, 0x8 + ldrsh r0, [r6, r2] + ldr r2, _08013324 + ands r0, r2 + strh r0, [r3, 0x2] + movs r2, 0xA + ldrsh r0, [r6, r2] + adds r0, 0x1 + ands r0, r4 + lsls r0, 4 + ands r1, r5 + orrs r1, r0 + strh r1, [r3, 0x6] + mov r0, sp + movs r1, 0xFF + movs r2, 0 + movs r3, 0 + bl AddSprite +_080132D6: + adds r0, r6, 0 + bl sub_8013470 + movs r1, 0x14 + ldrsh r0, [r6, r1] + cmp r0, 0 + beq _080132EC + adds r0, r6, 0 + adds r0, 0x14 + bl sub_801332C +_080132EC: + ldrh r0, [r6, 0x24] + adds r0, 0x1 + strh r0, [r6, 0x24] + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080132FC: .4byte 0x0000feff +_08013300: .4byte 0xffff0000 +_08013304: .4byte 0x0000fdff +_08013308: .4byte 0x0000f3ff +_0801330C: .4byte 0x0000efff +_08013310: .4byte 0x0000dfff +_08013314: .4byte 0x00003fff +_08013318: .4byte 0x00000fff +_0801331C: .4byte 0x0000fffe +_08013320: .4byte 0x0000fffd +_08013324: .4byte 0x000001ff + thumb_func_end AddMenuCursorSprite_ + + thumb_func_start nullsub_34 +nullsub_34: + bx lr + thumb_func_end nullsub_34 + + thumb_func_start sub_801332C +sub_801332C: + push {r4-r6,lr} + sub sp, 0x8 + movs r1, 0 + movs r2, 0 + str r1, [sp] + str r2, [sp, 0x4] + mov r1, sp + ldrh r1, [r1] + ldr r2, _08013440 + ands r2, r1 + ldr r4, _08013444 + ldr r1, [sp] + ands r1, r4 + orrs r1, r2 + str r1, [sp] + mov r2, sp + ldrh r2, [r2] + adds r3, r4, 0 + ands r3, r1 + orrs r3, r2 + str r3, [sp] + mov r1, sp + ldrh r2, [r1] + ldr r1, _08013448 + ands r1, r2 + adds r2, r4, 0 + ands r2, r3 + orrs r2, r1 + str r2, [sp] + mov r1, sp + ldrh r1, [r1] + adds r3, r4, 0 + ands r3, r2 + orrs r3, r1 + str r3, [sp] + movs r5, 0x80 + lsls r5, 3 + mov r1, sp + ldrh r2, [r1] + ldr r6, _0801344C + adds r1, r6, 0 + ands r1, r2 + adds r2, r4, 0 + ands r2, r3 + orrs r2, r1 + str r2, [sp] + mov r1, sp + ldrh r1, [r1] + orrs r5, r1 + adds r3, r4, 0 + ands r3, r2 + orrs r3, r5 + str r3, [sp] + mov r1, sp + ldrh r2, [r1] + ldr r1, _08013450 + ands r1, r2 + adds r2, r4, 0 + ands r2, r3 + orrs r2, r1 + str r2, [sp] + mov r1, sp + ldrh r1, [r1] + adds r3, r4, 0 + ands r3, r2 + orrs r3, r1 + str r3, [sp] + mov r1, sp + ldrh r2, [r1] + ldr r1, _08013454 + ands r1, r2 + adds r2, r4, 0 + ands r2, r3 + orrs r2, r1 + str r2, [sp] + mov r1, sp + ldrh r1, [r1] + adds r3, r4, 0 + ands r3, r2 + orrs r3, r1 + str r3, [sp] + mov r1, sp + ldrh r2, [r1] + ldr r1, _08013458 + ands r1, r2 + adds r2, r4, 0 + ands r2, r3 + orrs r2, r1 + str r2, [sp] + mov r1, sp + ldrh r1, [r1] + ands r4, r2 + orrs r4, r1 + str r4, [sp] + mov r4, sp + ldr r3, _0801345C + ldrh r2, [r4, 0x4] + movs r1, 0xFC + lsls r1, 8 + ands r1, r2 + orrs r1, r3 + ands r1, r6 + movs r6, 0xF + movs r2, 0xF0 + lsls r2, 8 + ldr r5, _08013460 + ands r1, r5 + orrs r1, r2 + strh r1, [r4, 0x4] + ldrh r1, [r4, 0x6] + ldr r2, _08013464 + ands r2, r1 + ldr r1, _08013468 + ands r2, r1 + movs r3, 0 + ldrsh r1, [r0, r3] + ldr r3, _0801346C + ands r1, r3 + strh r1, [r4, 0x2] + movs r1, 0x2 + ldrsh r0, [r0, r1] + adds r0, 0x1 + ands r0, r5 + lsls r0, 4 + ands r2, r6 + orrs r2, r0 + strh r2, [r4, 0x6] + mov r0, sp + movs r1, 0xFF + movs r2, 0 + movs r3, 0 + bl AddSprite + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08013440: .4byte 0x0000feff +_08013444: .4byte 0xffff0000 +_08013448: .4byte 0x0000fdff +_0801344C: .4byte 0x0000f3ff +_08013450: .4byte 0x0000efff +_08013454: .4byte 0x0000dfff +_08013458: .4byte 0x00003fff +_0801345C: .4byte 0x000003f5 +_08013460: .4byte 0x00000fff +_08013464: .4byte 0x0000fffe +_08013468: .4byte 0x0000fffd +_0801346C: .4byte 0x000001ff + thumb_func_end sub_801332C + + thumb_func_start sub_8013470 +sub_8013470: + push {r4-r6,lr} + sub sp, 0x8 + adds r6, r0, 0 + movs r0, 0 + movs r1, 0 + str r0, [sp] + str r1, [sp, 0x4] + movs r1, 0xC + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _08013488 + b _08013624 +_08013488: + movs r2, 0x1E + ldrsh r0, [r6, r2] + cmp r0, 0 + beq _08013586 + mov r0, sp + ldrh r0, [r0] + ldr r1, _0801362C + ands r1, r0 + ldr r3, _08013630 + ldr r0, [sp] + ands r0, r3 + orrs r0, r1 + str r0, [sp] + mov r1, sp + ldrh r1, [r1] + adds r2, r3, 0 + ands r2, r0 + orrs r2, r1 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r0, _08013634 + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r4, _08013638 + adds r0, r4, 0 + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r0, _0801363C + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r0, _08013640 + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r0, _08013644 + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + ands r3, r1 + orrs r3, r0 + str r3, [sp] + mov r3, sp + ldr r2, _08013648 + ldrh r1, [r3, 0x4] + movs r0, 0xFC + lsls r0, 8 + ands r0, r1 + orrs r0, r2 + ands r0, r4 + movs r5, 0xF + movs r1, 0xF0 + lsls r1, 8 + ldr r4, _0801364C + ands r0, r4 + orrs r0, r1 + strh r0, [r3, 0x4] + ldrh r0, [r3, 0x6] + ldr r1, _08013650 + ands r1, r0 + ldr r0, _08013654 + ands r1, r0 + movs r2, 0xC + ldrsh r0, [r6, r2] + ldr r2, _08013658 + ands r0, r2 + strh r0, [r3, 0x2] + movs r2, 0xE + ldrsh r0, [r6, r2] + ands r0, r4 + lsls r0, 4 + ands r1, r5 + orrs r1, r0 + strh r1, [r3, 0x6] + mov r0, sp + movs r1, 0xFF + movs r2, 0 + movs r3, 0 + bl AddSprite +_08013586: + movs r1, 0x20 + ldrsh r0, [r6, r1] + cmp r0, 0 + beq _08013624 + adds r1, r0, 0 + movs r2, 0x1E + ldrsh r0, [r6, r2] + adds r0, 0x1 + cmp r1, r0 + beq _08013624 + mov r0, sp + ldrh r0, [r0] + ldr r1, _0801362C + ands r1, r0 + mov r0, sp + strh r1, [r0] + strh r1, [r0] + ldr r0, _08013634 + ands r0, r1 + mov r1, sp + strh r0, [r1] + strh r0, [r1] + ldr r4, _08013638 + ands r0, r4 + strh r0, [r1] + strh r0, [r1] + ldr r1, _0801363C + ands r1, r0 + mov r0, sp + strh r1, [r0] + strh r1, [r0] + ldr r2, _08013640 + ands r2, r1 + strh r2, [r0] + strh r2, [r0] + ldr r0, _08013644 + ands r0, r2 + mov r1, sp + strh r0, [r1] + strh r0, [r1] + mov r3, sp + ldr r2, _0801365C + ldrh r1, [r3, 0x4] + movs r0, 0xFC + lsls r0, 8 + ands r0, r1 + orrs r0, r2 + ands r0, r4 + movs r5, 0xF + movs r1, 0xF0 + lsls r1, 8 + ldr r4, _0801364C + ands r0, r4 + orrs r0, r1 + strh r0, [r3, 0x4] + ldrh r0, [r3, 0x6] + ldr r1, _08013650 + ands r1, r0 + ldr r0, _08013654 + ands r1, r0 + movs r2, 0xC + ldrsh r0, [r6, r2] + adds r0, 0xA + ldr r2, _08013658 + ands r0, r2 + strh r0, [r3, 0x2] + movs r2, 0xE + ldrsh r0, [r6, r2] + ands r0, r4 + lsls r0, 4 + ands r1, r5 + orrs r1, r0 + strh r1, [r3, 0x6] + mov r0, sp + movs r1, 0xFF + movs r2, 0 + movs r3, 0 + bl AddSprite +_08013624: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0801362C: .4byte 0x0000feff +_08013630: .4byte 0xffff0000 +_08013634: .4byte 0x0000fdff +_08013638: .4byte 0x0000f3ff +_0801363C: .4byte 0x0000efff +_08013640: .4byte 0x0000dfff +_08013644: .4byte 0x00003fff +_08013648: .4byte 0x000003f2 +_0801364C: .4byte 0x00000fff +_08013650: .4byte 0x0000fffe +_08013654: .4byte 0x0000fffd +_08013658: .4byte 0x000001ff +_0801365C: .4byte 0x000003f3 + thumb_func_end sub_8013470 + + thumb_func_start sub_8013660 +sub_8013660: + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x1A + ldrsh r0, [r4, r1] + cmp r0, 0 + ble _0801367A + adds r0, r4, 0 + bl UpdateMenuCursorSpriteCoords + adds r0, r4, 0 + adds r0, 0x8 + bl sub_801332C +_0801367A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8013660 + + thumb_func_start UpdateMenuCursorSpriteCoords +UpdateMenuCursorSpriteCoords: + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, [r5] + lsls r4, r0, 3 + adds r4, r0 + lsls r4, 3 + ldr r0, _080136B8 + adds r4, r0 + movs r1, 0 + ldrsh r0, [r4, r1] + lsls r0, 3 + ldrh r2, [r5, 0x4] + adds r0, r2 + strh r0, [r5, 0x8] + movs r0, 0x18 + ldrsh r1, [r5, r0] + adds r0, r5, 0 + bl sub_8013800 + movs r2, 0x2 + ldrsh r1, [r4, r2] + lsls r1, 3 + adds r1, r0 + strh r1, [r5, 0xA] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080136B8: .4byte gUnknown_2027370 + thumb_func_end UpdateMenuCursorSpriteCoords + + thumb_func_start MoveMenuCursorDown +MoveMenuCursorDown: + push {lr} + adds r1, r0, 0 + movs r3, 0 + strh r3, [r1, 0x24] + movs r0, 0x1A + ldrsh r2, [r1, r0] + cmp r2, 0 + ble _080136DA + ldrh r0, [r1, 0x18] + adds r0, 0x1 + strh r0, [r1, 0x18] + lsls r0, 16 + asrs r0, 16 + cmp r0, r2 + blt _080136DC +_080136DA: + strh r3, [r1, 0x18] +_080136DC: + pop {r0} + bx r0 + thumb_func_end MoveMenuCursorDown + + thumb_func_start sub_80136E0 +sub_80136E0: + push {r4,r5,lr} + adds r2, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + movs r1, 0 + strh r1, [r2, 0x24] + ldrh r4, [r2, 0x1A] + movs r0, 0x1A + ldrsh r3, [r2, r0] + cmp r3, 0 + ble _08013708 + ldrh r0, [r2, 0x18] + adds r0, 0x1 + strh r0, [r2, 0x18] + lsls r0, 16 + asrs r0, 16 + cmp r0, r3 + blt _08013710 + cmp r5, 0 + beq _0801370C +_08013708: + strh r1, [r2, 0x18] + b _08013710 +_0801370C: + subs r0, r4, 0x1 + strh r0, [r2, 0x18] +_08013710: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80136E0 + + thumb_func_start MoveMenuCursorUp +MoveMenuCursorUp: + push {r4,lr} + adds r1, r0, 0 + movs r2, 0 + strh r2, [r1, 0x24] + ldrh r3, [r1, 0x1A] + movs r4, 0x1A + ldrsh r0, [r1, r4] + cmp r0, 0 + bgt _0801372E + strh r2, [r1, 0x18] + b _0801373E +_0801372E: + ldrh r0, [r1, 0x18] + subs r0, 0x1 + strh r0, [r1, 0x18] + lsls r0, 16 + cmp r0, 0 + bge _0801373E + subs r0, r3, 0x1 + strh r0, [r1, 0x18] +_0801373E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end MoveMenuCursorUp + + thumb_func_start sub_8013744 +sub_8013744: + push {r4-r6,lr} + adds r2, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r5, r1, 0 + movs r3, 0 + strh r3, [r2, 0x24] + ldrh r4, [r2, 0x1A] + movs r6, 0x1A + ldrsh r0, [r2, r6] + cmp r0, 0 + bgt _08013760 + strh r3, [r2, 0x18] + b _08013778 +_08013760: + ldrh r0, [r2, 0x18] + subs r0, 0x1 + strh r0, [r2, 0x18] + lsls r0, 16 + cmp r0, 0 + bge _08013778 + cmp r1, 0 + beq _08013776 + subs r0, r4, 0x1 + strh r0, [r2, 0x18] + b _08013778 +_08013776: + strh r5, [r2, 0x18] +_08013778: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8013744 + + thumb_func_start sub_8013780 +sub_8013780: + push {lr} + adds r2, r0, 0 + cmp r1, 0 + bge _0801378E + movs r0, 0 + strh r0, [r2, 0x18] + b _080137A0 +_0801378E: + movs r3, 0x1A + ldrsh r0, [r2, r3] + cmp r1, r0 + blt _0801379E + ldrh r0, [r2, 0x1A] + subs r0, 0x1 + strh r0, [r2, 0x18] + b _080137A0 +_0801379E: + strh r1, [r2, 0x18] +_080137A0: + movs r0, 0 + strh r0, [r2, 0x24] + pop {r0} + bx r0 + thumb_func_end sub_8013780 + + thumb_func_start sub_80137A8 +sub_80137A8: + movs r1, 0x18 + ldrsh r0, [r0, r1] + bx lr + thumb_func_end sub_80137A8 + + thumb_func_start sub_80137B0 +sub_80137B0: + push {r4,lr} + adds r4, r0, 0 + cmp r1, 0 + ble _080137BC + lsls r0, r1, 8 + b _080137E2 +_080137BC: + ldr r3, _080137F4 + ldr r1, [r4] + lsls r0, r1, 3 + adds r0, r1 + lsls r1, r0, 3 + adds r0, r3, 0 + adds r0, 0xC + adds r0, r1, r0 + ldr r0, [r0] + movs r2, 0 + cmp r0, 0x6 + bne _080137D6 + movs r2, 0x10 +_080137D6: + adds r0, r1, r3 + movs r1, 0x6 + ldrsh r0, [r0, r1] + lsls r0, 3 + subs r0, r2 + lsls r0, 8 +_080137E2: + movs r2, 0x1C + ldrsh r1, [r4, r2] + bl __divsi3 + str r0, [r4, 0x10] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080137F4: .4byte gUnknown_2027370 + thumb_func_end sub_80137B0 + + thumb_func_start sub_80137F8 +sub_80137F8: + lsls r1, 8 + str r1, [r0, 0x10] + bx lr + thumb_func_end sub_80137F8 + + thumb_func_start sub_8013800 +sub_8013800: + push {lr} + movs r3, 0x6 + ldrsh r2, [r0, r3] + ldr r0, [r0, 0x10] + muls r0, r1 + cmp r0, 0 + bge _08013810 + adds r0, 0xFF +_08013810: + asrs r0, 8 + adds r0, r2, r0 + pop {r1} + bx r1 + thumb_func_end sub_8013800 + + thumb_func_start sub_8013818 +sub_8013818: + push {r4,lr} + adds r4, r0, 0 + str r3, [r4] + movs r0, 0 + strh r1, [r4, 0x22] + strh r2, [r4, 0x1C] + strh r0, [r4, 0x14] + strh r0, [r4, 0x24] + strh r0, [r4, 0x18] + strh r0, [r4, 0x1E] + adds r0, r4, 0 + adds r0, 0x28 + bl sub_801317C + adds r0, r4, 0 + bl sub_8013984 + adds r0, r4, 0 + movs r1, 0xC + bl sub_80137F8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8013818 + + thumb_func_start sub_8013848 +sub_8013848: + push {r4,lr} + adds r4, r0, 0 + str r3, [r4] + movs r0, 0 + strh r1, [r4, 0x22] + strh r2, [r4, 0x1C] + strh r0, [r4, 0x14] + strh r0, [r4, 0x24] + strh r0, [r4, 0x18] + strh r0, [r4, 0x1E] + adds r0, r4, 0 + adds r0, 0x28 + bl sub_801317C + adds r0, r4, 0 + bl sub_8013984 + adds r0, r4, 0 + movs r1, 0x18 + bl sub_80137F8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8013848 + + thumb_func_start sub_8013878 +sub_8013878: + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + cmp r6, 0 + bge _08013886 + movs r6, 0 + b _08013890 +_08013886: + movs r1, 0x22 + ldrsh r0, [r5, r1] + cmp r6, r0 + blt _08013890 + subs r6, r0, 0x1 +_08013890: + movs r0, 0x1C + ldrsh r1, [r5, r0] + adds r0, r6, 0 + bl __divsi3 + movs r4, 0 + strh r0, [r5, 0x1E] + movs r0, 0x1C + ldrsh r1, [r5, r0] + adds r0, r6, 0 + bl __modsi3 + strh r0, [r5, 0x18] + strh r4, [r5, 0x24] + adds r0, r5, 0 + bl sub_8013984 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8013878 + + thumb_func_start sub_80138B8 +sub_80138B8: + push {r4-r7,lr} + adds r5, r0, 0 + lsls r4, r1, 24 + lsrs r4, 24 + movs r0, 0x1E + ldrsh r7, [r5, r0] + movs r1, 0x18 + ldrsh r6, [r5, r1] + adds r0, r5, 0 + bl AddMenuCursorSprite + cmp r4, 0 + beq _0801391C + adds r0, r5, 0 + bl GetKeyPress + cmp r0, 0x8 + beq _080138F8 + cmp r0, 0x8 + bgt _080138E6 + cmp r0, 0x7 + beq _080138F0 + b _0801391C +_080138E6: + cmp r0, 0x9 + beq _0801390E + cmp r0, 0xA + beq _08013916 + b _0801391C +_080138F0: + adds r0, r5, 0 + bl MoveMenuCursorUp + b _080138FE +_080138F8: + adds r0, r5, 0 + bl MoveMenuCursorDown +_080138FE: + movs r1, 0x18 + ldrsh r0, [r5, r1] + cmp r6, r0 + beq _0801391C + movs r0, 0x3 + bl sub_80119D4 + b _0801391C +_0801390E: + adds r0, r5, 0 + bl sub_8013A7C + b _0801391C +_08013916: + adds r0, r5, 0 + bl sub_8013A54 +_0801391C: + movs r1, 0x1E + ldrsh r0, [r5, r1] + cmp r7, r0 + bne _08013928 + movs r0, 0 + b _08013930 +_08013928: + movs r0, 0x4 + bl sub_80119D4 + movs r0, 0x1 +_08013930: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80138B8 + + thumb_func_start sub_8013938 +sub_8013938: + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x1E + ldrsh r5, [r4, r0] + movs r0, 0 + strh r0, [r4, 0x1A] + strh r0, [r4, 0x14] + adds r0, r4, 0 + bl AddMenuCursorSprite + adds r0, r4, 0 + bl GetKeyPress + cmp r0, 0x9 + beq _0801395C + cmp r0, 0xA + beq _08013964 + b _0801396A +_0801395C: + adds r0, r4, 0 + bl sub_8013A7C + b _0801396A +_08013964: + adds r0, r4, 0 + bl sub_8013A54 +_0801396A: + movs r1, 0x1E + ldrsh r0, [r4, r1] + cmp r5, r0 + bne _08013976 + movs r0, 0 + b _0801397E +_08013976: + movs r0, 0x4 + bl sub_80119D4 + movs r0, 0x1 +_0801397E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8013938 + + thumb_func_start sub_8013984 +sub_8013984: + push {r4-r6,lr} + adds r4, r0, 0 + ldr r1, [r4] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 3 + ldr r1, _08013A20 + adds r6, r0, r1 + ldrh r1, [r4, 0x1C] + movs r2, 0x1C + ldrsh r0, [r4, r2] + cmp r0, 0 + bne _080139A2 + adds r0, r1, 0x1 + strh r0, [r4, 0x1C] +_080139A2: + movs r1, 0x22 + ldrsh r0, [r4, r1] + movs r2, 0x1C + ldrsh r1, [r4, r2] + bl __divsi3 + adds r5, r0, 0 + strh r5, [r4, 0x20] + movs r1, 0x22 + ldrsh r0, [r4, r1] + movs r2, 0x1C + ldrsh r1, [r4, r2] + bl __modsi3 + cmp r0, 0 + beq _080139C6 + adds r0, r5, 0x1 + strh r0, [r4, 0x20] +_080139C6: + movs r0, 0x1E + ldrsh r1, [r4, r0] + movs r2, 0x20 + ldrsh r0, [r4, r2] + subs r0, 0x1 + ldrh r5, [r4, 0x20] + cmp r1, r0 + ble _080139DA + subs r0, r5, 0x1 + strh r0, [r4, 0x1E] +_080139DA: + movs r0, 0x1E + ldrsh r1, [r4, r0] + movs r2, 0x20 + ldrsh r0, [r4, r2] + subs r0, 0x1 + cmp r1, r0 + bne _080139F8 + movs r1, 0x22 + ldrsh r0, [r4, r1] + movs r2, 0x1C + ldrsh r1, [r4, r2] + bl __modsi3 + cmp r0, 0 + bne _080139FA +_080139F8: + ldrh r0, [r4, 0x1C] +_080139FA: + strh r0, [r4, 0x1A] + movs r0, 0x18 + ldrsh r1, [r4, r0] + movs r2, 0x1A + ldrsh r0, [r4, r2] + subs r0, 0x1 + cmp r1, r0 + ble _08013A10 + ldrh r0, [r4, 0x1A] + subs r0, 0x1 + strh r0, [r4, 0x18] +_08013A10: + movs r1, 0 + strh r1, [r4, 0x4] + ldr r0, [r6, 0xC] + cmp r0, 0x6 + bne _08013A24 + movs r0, 0x10 + strh r0, [r4, 0x6] + b _08013A26 + .align 2, 0 +_08013A20: .4byte gUnknown_2027370 +_08013A24: + strh r1, [r4, 0x6] +_08013A26: + lsls r0, r5, 16 + asrs r0, 16 + cmp r0, 0x1 + bgt _08013A32 + movs r0, 0 + b _08013A40 +_08013A32: + movs r1, 0 + ldrsh r0, [r6, r1] + movs r2, 0x4 + ldrsh r1, [r6, r2] + adds r0, r1 + subs r0, 0x2 + lsls r0, 3 +_08013A40: + strh r0, [r4, 0xC] + movs r1, 0x2 + ldrsh r0, [r6, r1] + adds r0, 0x1 + lsls r0, 3 + subs r0, 0x2 + strh r0, [r4, 0xE] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8013984 + + thumb_func_start sub_8013A54 +sub_8013A54: + push {lr} + adds r2, r0, 0 + movs r0, 0x1E + ldrsh r1, [r2, r0] + movs r3, 0x20 + ldrsh r0, [r2, r3] + subs r0, 0x1 + cmp r1, r0 + bge _08013A6C + ldrh r0, [r2, 0x1E] + adds r0, 0x1 + b _08013A6E +_08013A6C: + movs r0, 0 +_08013A6E: + strh r0, [r2, 0x1E] + adds r0, r2, 0 + bl sub_8013984 + pop {r0} + bx r0 + thumb_func_end sub_8013A54 + + thumb_func_start sub_8013A7C +sub_8013A7C: + push {lr} + adds r1, r0, 0 + ldrh r2, [r1, 0x1E] + movs r3, 0x1E + ldrsh r0, [r1, r3] + cmp r0, 0 + bgt _08013A90 + ldrh r0, [r1, 0x20] + subs r0, 0x1 + b _08013A92 +_08013A90: + subs r0, r2, 0x1 +_08013A92: + strh r0, [r1, 0x1E] + adds r0, r1, 0 + bl sub_8013984 + pop {r0} + bx r0 + thumb_func_end sub_8013A7C + + thumb_func_start sub_8013AA0 +sub_8013AA0: + push {r4,r5,lr} + sub sp, 0x28 + adds r5, r0, 0 + ldrh r1, [r5, 0x28] + ldr r0, _08013B9C + ands r0, r1 + ldr r1, _08013BA0 + ands r0, r1 + ldr r4, _08013BA4 + ands r0, r4 + ldr r1, _08013BA8 + ands r0, r1 + ldr r1, _08013BAC + ands r0, r1 + movs r1, 0x80 + lsls r1, 7 + ldr r3, _08013BB0 + ands r0, r3 + orrs r0, r1 + strh r0, [r5, 0x28] + movs r1, 0x80 + lsls r1, 6 + ldrh r0, [r5, 0x2A] + ldr r2, _08013BB4 + ands r2, r0 + orrs r2, r1 + ands r2, r3 + movs r3, 0xFC + lsls r3, 2 + ldrh r1, [r5, 0x2C] + movs r0, 0xFC + lsls r0, 8 + ands r0, r1 + orrs r0, r3 + ands r0, r4 + movs r3, 0xF + movs r4, 0xF0 + lsls r4, 8 + ldr r1, _08013BB8 + ands r0, r1 + orrs r0, r4 + strh r0, [r5, 0x2C] + movs r0, 0xFE + lsls r0, 8 + ands r2, r0 + movs r0, 0xF0 + orrs r2, r0 + strh r2, [r5, 0x2A] + subs r1, 0xFF + ldrh r0, [r5, 0x2E] + ands r3, r0 + movs r0, 0 + orrs r3, r1 + strh r3, [r5, 0x2E] + adds r1, r5, 0 + adds r1, 0x26 + strb r0, [r1] + ldr r1, [r5, 0xC] + ldr r2, [r5, 0x10] + mov r0, sp + bl sub_800456C + ldr r0, [r5, 0x10] + adds r1, r5, 0 + adds r1, 0x25 + strb r0, [r1] + ldrb r2, [r1] + subs r0, r2, 0x1 + lsls r0, 2 + add r0, sp + ldr r0, [r0] + cmp r0, 0 + bne _08013B50 + cmp r2, 0x1 + bls _08013B50 + adds r2, r1, 0 +_08013B38: + ldrb r0, [r2] + subs r0, 0x1 + strb r0, [r2] + ldrb r1, [r2] + subs r0, r1, 0x1 + lsls r0, 2 + add r0, sp + ldr r0, [r0] + cmp r0, 0 + bne _08013B50 + cmp r1, 0x1 + bhi _08013B38 +_08013B50: + ldr r1, [r5, 0x4] + str r1, [r5] + ldr r2, [r5, 0x10] + mov r0, sp + bl sub_800456C + adds r0, r5, 0 + adds r0, 0x25 + ldrb r0, [r0] + subs r0, 0x1 + adds r1, r5, 0 + adds r1, 0x24 + strb r0, [r1] + ldrb r2, [r1] + lsls r0, r2, 2 + add r0, sp + ldr r0, [r0] + cmp r0, 0 + bne _08013B92 + cmp r2, 0 + beq _08013B92 + adds r2, r1, 0 +_08013B7C: + ldrb r0, [r2] + subs r0, 0x1 + strb r0, [r2] + ldrb r1, [r2] + lsls r0, r1, 2 + add r0, sp + ldr r0, [r0] + cmp r0, 0 + bne _08013B92 + cmp r1, 0 + bne _08013B7C +_08013B92: + add sp, 0x28 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08013B9C: .4byte 0x0000feff +_08013BA0: .4byte 0x0000fdff +_08013BA4: .4byte 0x0000f3ff +_08013BA8: .4byte 0x0000efff +_08013BAC: .4byte 0x0000dfff +_08013BB0: .4byte 0x00003fff +_08013BB4: .4byte 0x0000c1ff +_08013BB8: .4byte 0x00000fff + thumb_func_end sub_8013AA0 + + thumb_func_start sub_8013BBC +sub_8013BBC: + push {r4-r7,lr} + adds r7, r0, 0 + adds r4, r7, 0 + adds r4, 0x26 + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + adds r0, r7, 0 + bl sub_8013D10 + ldrb r1, [r4] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08013C26 + movs r2, 0x80 + lsls r2, 6 + ldrh r1, [r7, 0x2A] + ldr r4, _08013C38 + adds r0, r4, 0 + ands r0, r1 + orrs r0, r2 + strh r0, [r7, 0x2A] + adds r5, r7, 0 + adds r5, 0x28 + movs r6, 0x80 + lsls r6, 1 + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0 + bl AddSprite + ldrh r0, [r7, 0x2A] + ands r4, r0 + strh r4, [r7, 0x2A] + ldrh r1, [r7, 0x2E] + ldr r0, _08013C3C + lsrs r1, 4 + adds r1, 0x10 + ands r1, r0 + lsls r1, 4 + ldrh r2, [r7, 0x2E] + movs r0, 0xF + ands r0, r2 + orrs r0, r1 + strh r0, [r7, 0x2E] + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0 + bl AddSprite +_08013C26: + adds r0, r7, 0 + bl sub_8013DD0 + lsls r0, 24 + cmp r0, 0 + beq _08013C40 + movs r0, 0x1 + b _08013C62 + .align 2, 0 +_08013C38: .4byte 0x0000c1ff +_08013C3C: .4byte 0x00000fff +_08013C40: + bl sub_8012AE8 + cmp r0, 0x1 + beq _08013C56 + cmp r0, 0x2 + bne _08013C60 + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + b _08013C62 +_08013C56: + movs r0, 0 + bl sub_80119D4 + movs r0, 0x3 + b _08013C62 +_08013C60: + movs r0, 0 +_08013C62: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8013BBC + + thumb_func_start sub_8013C68 +sub_8013C68: + push {r4-r6,lr} + sub sp, 0x2C + adds r5, r0, 0 + ldr r1, [r5] + ldr r2, [r5, 0x10] + add r0, sp, 0x4 + bl sub_800456C + ldr r0, [r5, 0x10] + subs r4, r0, 0x1 + cmp r4, 0 + ble _08013CA0 + lsls r0, r4, 2 + mov r1, sp + adds r1, r0 + adds r1, 0x4 + ldr r0, [r1] + cmp r0, 0 + bne _08013CA0 + movs r2, 0xFF +_08013C90: + str r2, [r1] + subs r1, 0x4 + subs r4, 0x1 + cmp r4, 0 + ble _08013CA0 + ldr r0, [r1] + cmp r0, 0 + beq _08013C90 +_08013CA0: + movs r4, 0 + adds r0, r5, 0 + adds r0, 0x25 + adds r6, r0, 0 + b _08013CDA +_08013CAA: + lsls r0, r4, 2 + add r0, sp + adds r0, 0x4 + ldr r0, [r0] + cmp r0, 0xFF + bne _08013CBA + movs r3, 0x2A + b _08013CC0 +_08013CBA: + adds r0, 0x30 + lsls r0, 24 + lsrs r3, r0, 24 +_08013CC0: + adds r4, 0x1 + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 2 + ldr r0, [r5, 0x1C] + subs r0, r1 + ldr r1, [r5, 0x20] + ldr r2, [r5, 0x14] + str r2, [sp] + adds r2, r3, 0 + movs r3, 0x7 + bl sub_8012C60 +_08013CDA: + ldrb r0, [r6] + cmp r4, r0 + blt _08013CAA + movs r4, 0 + b _08013D02 +_08013CE4: + ldr r0, [r5, 0x14] + adds r4, 0x1 + lsls r2, r4, 1 + adds r2, r4 + lsls r2, 2 + ldr r1, [r5, 0x1C] + subs r1, r2 + subs r1, 0x1 + ldr r2, [r5, 0x20] + adds r2, 0xA + movs r3, 0x5 + str r3, [sp] + movs r3, 0xB + bl sub_800792C +_08013D02: + ldr r0, [r5, 0x10] + cmp r4, r0 + blt _08013CE4 + add sp, 0x2C + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8013C68 + + thumb_func_start sub_8013D10 +sub_8013D10: + push {r4-r7,lr} + adds r6, r0, 0 + ldr r0, [r6, 0x14] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 3 + ldr r0, _08013D34 + adds r7, r1, r0 + adds r4, r6, 0 + adds r4, 0x24 + ldrb r5, [r4] + bl sub_8012AE8 + cmp r0, 0x9 + beq _08013D38 + cmp r0, 0xA + beq _08013D4E + b _08013D62 + .align 2, 0 +_08013D34: .4byte gUnknown_2027370 +_08013D38: + ldrb r1, [r4] + adds r0, r6, 0 + adds r0, 0x25 + ldrb r0, [r0] + subs r0, 0x1 + cmp r1, r0 + bge _08013D4A + adds r0, r1, 0x1 + b _08013D5C +_08013D4A: + movs r0, 0 + b _08013D60 +_08013D4E: + ldrb r0, [r4] + cmp r0, 0 + bne _08013D5A + adds r0, r6, 0 + adds r0, 0x25 + ldrb r0, [r0] +_08013D5A: + subs r0, 0x1 +_08013D5C: + lsls r0, 24 + lsrs r0, 24 +_08013D60: + adds r5, r0, 0 +_08013D62: + adds r4, r6, 0 + adds r4, 0x24 + ldrb r0, [r4] + cmp r5, r0 + beq _08013D7C + strb r5, [r4] + movs r0, 0x3 + bl sub_80119D4 + adds r1, r6, 0 + adds r1, 0x26 + movs r0, 0x8 + strb r0, [r1] +_08013D7C: + ldrb r0, [r4] + adds r0, 0x1 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + ldr r2, [r6, 0x1C] + subs r2, r1 + movs r1, 0 + ldrsh r0, [r7, r1] + lsls r0, 3 + adds r2, r0 + subs r2, 0x3 + ldr r0, _08013DC8 + ands r2, r0 + ldrh r1, [r6, 0x2A] + movs r0, 0xFE + lsls r0, 8 + ands r0, r1 + orrs r0, r2 + strh r0, [r6, 0x2A] + movs r1, 0x2 + ldrsh r0, [r7, r1] + lsls r0, 3 + ldr r1, [r6, 0x20] + adds r1, r0 + subs r1, 0x7 + ldr r0, _08013DCC + ands r1, r0 + lsls r1, 4 + ldrh r2, [r6, 0x2E] + movs r0, 0xF + ands r0, r2 + orrs r0, r1 + strh r0, [r6, 0x2E] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08013DC8: .4byte 0x000001ff +_08013DCC: .4byte 0x00000fff + thumb_func_end sub_8013D10 + + thumb_func_start sub_8013DD0 +sub_8013DD0: + push {r4,r5,lr} + adds r4, r0, 0 + bl sub_8012AE8 + cmp r0, 0x7 + beq _08013DE4 + cmp r0, 0x8 + beq _08013E10 + movs r0, 0 + b _08013E4C +_08013DE4: + ldr r2, [r4] + ldr r0, [r4, 0xC] + cmp r2, r0 + beq _08013E18 + ldr r1, _08013E0C + adds r0, r4, 0 + adds r0, 0x24 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + adds r5, r2, r0 + movs r0, 0x3 + bl sub_80119D4 + ldr r0, [r4, 0xC] + cmp r5, r0 + bgt _08013E3E + b _08013E48 + .align 2, 0 +_08013E0C: .4byte gUnknown_80D4830 +_08013E10: + ldr r2, [r4] + ldr r0, [r4, 0x8] + cmp r2, r0 + bne _08013E22 +_08013E18: + movs r0, 0x2 + bl sub_80119D4 + movs r0, 0 + b _08013E4C +_08013E22: + ldr r1, _08013E44 + adds r0, r4, 0 + adds r0, 0x24 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + subs r5, r2, r0 + movs r0, 0x3 + bl sub_80119D4 + ldr r0, [r4, 0x8] + cmp r5, r0 + bge _08013E48 +_08013E3E: + str r0, [r4] + b _08013E4A + .align 2, 0 +_08013E44: .4byte gUnknown_80D4830 +_08013E48: + str r5, [r4] +_08013E4A: + movs r0, 0x1 +_08013E4C: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8013DD0 + + thumb_func_start sub_8013E54 +sub_8013E54: + push {r4-r6,lr} + sub sp, 0x8 + ldr r6, _08013F60 + movs r0, 0 + movs r1, 0 + str r0, [sp] + str r1, [sp, 0x4] + mov r0, sp + ldrh r0, [r0] + ldr r1, _08013F64 + ands r1, r0 + ldr r3, _08013F68 + ldr r0, [sp] + ands r0, r3 + orrs r0, r1 + str r0, [sp] + mov r1, sp + ldrh r1, [r1] + adds r2, r3, 0 + ands r2, r0 + orrs r2, r1 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r0, _08013F6C + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r5, _08013F70 + adds r0, r5, 0 + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r0, _08013F74 + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r0, _08013F78 + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + movs r4, 0x80 + lsls r4, 7 + mov r0, sp + ldrh r1, [r0] + ldr r0, _08013F7C + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + orrs r4, r0 + ands r3, r1 + orrs r3, r4 + str r3, [sp] + mov r3, sp + movs r2, 0xFC + lsls r2, 2 + ldrh r1, [r3, 0x4] + movs r0, 0xFC + lsls r0, 8 + ands r0, r1 + orrs r0, r2 + ands r0, r5 + movs r2, 0xF + movs r1, 0xF0 + lsls r1, 8 + ldr r4, _08013F80 + ands r0, r4 + orrs r0, r1 + strh r0, [r3, 0x4] + movs r1, 0x2 + ldrsh r0, [r6, r1] + lsls r0, 3 + adds r0, 0x80 + ands r0, r4 + lsls r0, 4 + ldrh r1, [r3, 0x6] + ands r2, r1 + orrs r2, r0 + strh r2, [r3, 0x6] + movs r0, 0x70 + strh r0, [r3, 0x2] + movs r1, 0x80 + lsls r1, 1 + mov r0, sp + movs r2, 0 + movs r3, 0 + bl AddSprite + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08013F60: .4byte gUnknown_2027370 +_08013F64: .4byte 0x0000feff +_08013F68: .4byte 0xffff0000 +_08013F6C: .4byte 0x0000fdff +_08013F70: .4byte 0x0000f3ff +_08013F74: .4byte 0x0000efff +_08013F78: .4byte 0x0000dfff +_08013F7C: .4byte 0x00003fff +_08013F80: .4byte 0x00000fff + thumb_func_end sub_8013E54 + + thumb_func_start sub_8013F84 +sub_8013F84: + push {r4-r6,lr} + sub sp, 0x8 + ldr r6, _08014090 + movs r0, 0 + movs r1, 0 + str r0, [sp] + str r1, [sp, 0x4] + mov r0, sp + ldrh r0, [r0] + ldr r1, _08014094 + ands r1, r0 + ldr r3, _08014098 + ldr r0, [sp] + ands r0, r3 + orrs r0, r1 + str r0, [sp] + mov r1, sp + ldrh r1, [r1] + adds r2, r3, 0 + ands r2, r0 + orrs r2, r1 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r0, _0801409C + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r5, _080140A0 + adds r0, r5, 0 + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r0, _080140A4 + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r0, _080140A8 + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + movs r4, 0x80 + lsls r4, 7 + mov r0, sp + ldrh r1, [r0] + ldr r0, _080140AC + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + orrs r4, r0 + ands r3, r1 + orrs r3, r4 + str r3, [sp] + mov r3, sp + movs r2, 0xFC + lsls r2, 2 + ldrh r1, [r3, 0x4] + movs r0, 0xFC + lsls r0, 8 + ands r0, r1 + orrs r0, r2 + ands r0, r5 + movs r2, 0xF + movs r1, 0xF0 + lsls r1, 8 + ldr r4, _080140B0 + ands r0, r4 + orrs r0, r1 + strh r0, [r3, 0x4] + movs r1, 0x2 + ldrsh r0, [r6, r1] + lsls r0, 3 + adds r0, 0x60 + ands r0, r4 + lsls r0, 4 + ldrh r1, [r3, 0x6] + ands r2, r1 + orrs r2, r0 + strh r2, [r3, 0x6] + movs r0, 0x70 + strh r0, [r3, 0x2] + movs r1, 0x80 + lsls r1, 1 + mov r0, sp + movs r2, 0 + movs r3, 0 + bl AddSprite + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08014090: .4byte gUnknown_2027370 +_08014094: .4byte 0x0000feff +_08014098: .4byte 0xffff0000 +_0801409C: .4byte 0x0000fdff +_080140A0: .4byte 0x0000f3ff +_080140A4: .4byte 0x0000efff +_080140A8: .4byte 0x0000dfff +_080140AC: .4byte 0x00003fff +_080140B0: .4byte 0x00000fff + thumb_func_end sub_8013F84 + + thumb_func_start sub_80140B4 +sub_80140B4: + push {r4-r7,lr} + ldr r4, _080140D8 + adds r2, r0, 0 + movs r3, 0x3 +_080140BC: + adds r1, r2, 0 + adds r0, r4, 0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r4, 0x18 + adds r2, 0x18 + subs r3, 0x1 + cmp r3, 0 + bge _080140BC + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080140D8: .4byte gUnknown_80D47C8 + thumb_func_end sub_80140B4 + + thumb_func_start sub_80140DC +sub_80140DC: + push {lr} + sub sp, 0x4 + ldr r0, _080140F4 + str r0, [sp] + mov r0, sp + bl SetSavingIconCoords + bl sub_8011830 + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_080140F4: .4byte 0x008000c8 + thumb_func_end sub_80140DC + + thumb_func_start sub_80140F8 +sub_80140F8: + push {lr} + sub sp, 0x4 + ldr r0, _08014110 + str r0, [sp] + mov r0, sp + bl SetSavingIconCoords + bl sub_8011830 + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08014110: .4byte 0x004000bc + thumb_func_end sub_80140F8 + + thumb_func_start sub_8014114 +sub_8014114: + push {lr} + bl sub_8011854 + movs r0, 0 + bl SetSavingIconCoords + pop {r0} + bx r0 + thumb_func_end sub_8014114 + + thumb_func_start nullsub_201 +nullsub_201: + bx lr + thumb_func_end nullsub_201 + + thumb_func_start sub_8014128 +sub_8014128: + push {lr} + bl sub_8012AE8 + cmp r0, 0x2 + beq _08014136 + movs r0, 0x1 + b _08014138 +_08014136: + movs r0, 0 +_08014138: + pop {r1} + bx r1 + thumb_func_end sub_8014128 + + thumb_func_start sub_801413C +sub_801413C: + movs r0, 0 + bx lr + thumb_func_end sub_801413C + + thumb_func_start sub_8014140 +sub_8014140: + movs r0, 0 + bx lr + thumb_func_end sub_8014140 + + thumb_func_start sub_8014144 +sub_8014144: + ldr r0, _0801415C + movs r2, 0 + str r2, [r0] + ldr r0, _08014160 + movs r1, 0x3C + str r1, [r0] + ldr r0, _08014164 + str r1, [r0] + ldr r0, _08014168 + str r2, [r0] + bx lr + .align 2, 0 +_0801415C: .4byte gUnknown_202E744 +_08014160: .4byte gUnknown_202E738 +_08014164: .4byte gUnknown_202E73C +_08014168: .4byte gUnknown_202E740 + thumb_func_end sub_8014144 + + thumb_func_start sub_801416C +sub_801416C: + push {lr} + adds r2, r0, 0 + adds r3, r1, 0 + movs r0, 0x1 + negs r0, r0 + cmp r2, r0 + bge _0801418C + ldr r0, _08014184 + str r3, [r0] + ldr r1, _08014188 + negs r0, r2 + b _08014194 + .align 2, 0 +_08014184: .4byte gUnknown_202E738 +_08014188: .4byte gUnknown_202E740 +_0801418C: + ldr r0, _080141A8 + str r2, [r0] + ldr r1, _080141AC + movs r0, 0 +_08014194: + str r0, [r1] + ldr r0, _080141B0 + adds r1, r3, 0 + cmp r1, 0 + bge _080141A0 + movs r1, 0 +_080141A0: + str r1, [r0] + pop {r0} + bx r0 + .align 2, 0 +_080141A8: .4byte gUnknown_202E738 +_080141AC: .4byte gUnknown_202E740 +_080141B0: .4byte gUnknown_202E73C + thumb_func_end sub_801416C + + thumb_func_start sub_80141B4 +sub_80141B4: + push {r4-r6,lr} + sub sp, 0x14 + lsls r3, 16 + lsrs r3, 16 + movs r6, 0x1 + negs r6, r6 + movs r5, 0 + str r5, [sp] + movs r4, 0x3 + str r4, [sp, 0x4] + str r5, [sp, 0x8] + str r2, [sp, 0xC] + str r3, [sp, 0x10] + adds r2, r6, 0 + movs r3, 0 + bl sub_8014248 + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80141B4 + + thumb_func_start sub_80141E0 +sub_80141E0: + push {r4-r6,lr} + sub sp, 0x14 + lsls r6, r2, 16 + movs r2, 0x1 + negs r2, r2 + ldr r3, _08014210 + movs r5, 0 + str r5, [sp] + movs r4, 0x3 + str r4, [sp, 0x4] + str r5, [sp, 0x8] + str r1, [sp, 0xC] + movs r1, 0xC0 + lsls r1, 18 + orrs r1, r6 + lsrs r1, 16 + str r1, [sp, 0x10] + movs r1, 0 + bl sub_8014248 + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08014210: .4byte gUnknown_80D485C + thumb_func_end sub_80141E0 + + thumb_func_start sub_8014214 +sub_8014214: + push {r4-r6,lr} + sub sp, 0x14 + lsls r6, r2, 16 + movs r2, 0x1 + negs r2, r2 + ldr r3, _08014244 + movs r5, 0 + str r5, [sp] + movs r4, 0x3 + str r4, [sp, 0x4] + str r5, [sp, 0x8] + str r1, [sp, 0xC] + movs r1, 0xC0 + lsls r1, 18 + orrs r1, r6 + lsrs r1, 16 + str r1, [sp, 0x10] + movs r1, 0 + bl sub_8014248 + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08014244: .4byte gUnknown_80D4880 + thumb_func_end sub_8014214 + + thumb_func_start sub_8014248 +sub_8014248: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r6, r1, 0 + mov r9, r2 + mov r8, r3 + ldr r5, [sp, 0x28] + ldr r7, [sp, 0x30] + ldr r1, [sp, 0x34] + lsls r1, 16 + lsrs r1, 16 + mov r10, r1 + movs r1, 0 + str r1, [sp] + ldr r4, _080142B8 + ldr r3, _080142BC + adds r2, r4, r3 + adds r1, r4, 0 + mov r3, r10 + bl sub_8014BC4 + ldr r0, _080142C0 + str r4, [r0] + ldr r0, _080142C4 + str r6, [r0, 0x24] + ldr r0, _080142C8 + str r5, [r0] + ldr r0, _080142CC + mov r4, r8 + str r4, [r0] + ldr r0, _080142D0 + ldr r5, [sp, 0x24] + str r5, [r0] + ldr r0, _080142D4 + mov r6, r9 + str r6, [r0] + ldr r0, _080142D8 + bl sub_801317C + movs r0, 0x10 + mov r1, r10 + ands r0, r1 + cmp r0, 0 + beq _080142E4 + ldr r2, _080142DC + adds r1, r2, 0 + ldr r0, _080142E0 + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldm r0!, {r3,r4,r6} + stm r1!, {r3,r4,r6} + b _080142F2 + .align 2, 0 +_080142B8: .4byte gUnknown_202E798 +_080142BC: .4byte 0x000003e7 +_080142C0: .4byte gUnknown_202E794 +_080142C4: .4byte gUnknown_202E748 +_080142C8: .4byte gUnknown_202EC10 +_080142CC: .4byte gUnknown_202EC14 +_080142D0: .4byte gUnknown_202EC18 +_080142D4: .4byte gUnknown_202EC1C +_080142D8: .4byte gUnknown_202EC28 +_080142DC: .4byte gUnknown_203B198 +_080142E0: .4byte gUnknown_80D48DC +_080142E4: + ldr r2, _08014358 + adds r1, r2, 0 + ldr r0, _0801435C + ldm r0!, {r3,r5,r6} + stm r1!, {r3,r5,r6} + ldm r0!, {r4-r6} + stm r1!, {r4-r6} +_080142F2: + adds r4, r2, 0 + movs r0, 0 + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + strh r0, [r4, 0x28] + movs r0, 0x40 + strb r0, [r4, 0x18] + cmp r7, 0 + beq _08014368 + ldr r1, [r7, 0x4] + cmp r1, 0 + beq _08014368 + ldrb r0, [r7, 0xC] + lsls r0, 3 + adds r1, 0x4 + adds r1, r0 + ldr r0, [r1] + cmp r0, 0 + beq _08014368 + ldrh r0, [r7, 0x8] + strh r0, [r4, 0x20] + ldrh r0, [r7, 0xA] + strh r0, [r4, 0x22] + movs r0, 0x5 + strh r0, [r4, 0x24] + strh r0, [r4, 0x26] + strh r0, [r4, 0x28] + movs r4, 0 +_0801432A: + adds r0, r4, 0 + adds r0, 0xE0 + ldr r2, [r7, 0x4] + ldrb r1, [r7, 0xC] + lsls r1, 3 + adds r2, r1 + lsls r3, r4, 2 + ldr r1, [r2] + adds r1, r3 + bl SetBGPaletteBufferColorArray + adds r4, 0x1 + cmp r4, 0xF + ble _0801432A + movs r0, 0x1 + str r0, [sp] + ldrb r0, [r7, 0xE] + cmp r0, 0 + beq _08014360 + ldr r1, _08014358 + movs r0, 0x7 + b _08014364 + .align 2, 0 +_08014358: .4byte gUnknown_203B198 +_0801435C: .4byte gUnknown_80D48C4 +_08014360: + ldr r1, _080143E8 + movs r0, 0x5 +_08014364: + str r0, [r1, 0x1C] + adds r4, r1, 0 +_08014368: + ldr r2, _080143EC + adds r1, r4, 0 + adds r1, 0x30 + adds r0, r2, 0 + ldm r0!, {r3,r5,r6} + stm r1!, {r3,r5,r6} + ldm r0!, {r3,r5,r6} + stm r1!, {r3,r5,r6} + adds r0, r4, 0 + adds r0, 0x48 + ldm r2!, {r1,r3,r5} + stm r0!, {r1,r3,r5} + ldm r2!, {r1,r3,r6} + stm r0!, {r1,r3,r6} + bl sub_8004914 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r1, _080143F0 + movs r4, 0 + movs r2, 0 + movs r0, 0x4 + strh r0, [r1] + strh r0, [r1, 0x2] + movs r0, 0x70 + strh r0, [r1, 0x8] + ldr r0, _080143F4 + movs r5, 0x2 + ldrsh r0, [r0, r5] + lsls r0, 3 + adds r0, 0x22 + strh r0, [r1, 0xA] + movs r0, 0x7 + str r0, [r1, 0x10] + str r2, [r1, 0x1C] + adds r1, 0x20 + strb r4, [r1] + movs r0, 0x10 + mov r6, r10 + ands r0, r6 + movs r1, 0x3 + cmp r0, 0 + beq _080143C6 + movs r1, 0x8 +_080143C6: + adds r0, r1, 0 + bl sub_80063D8 + ldr r0, _080143F8 + movs r1, 0x1 + str r1, [r0] + ldr r0, _080143FC + mov r2, r10 + strh r2, [r0] + movs r0, 0x20 + mov r3, r10 + ands r0, r3 + cmp r0, 0 + beq _08014404 + ldr r0, _08014400 + strb r1, [r0] + b _08014408 + .align 2, 0 +_080143E8: .4byte gUnknown_203B198 +_080143EC: .4byte gUnknown_80D48AC +_080143F0: .4byte gUnknown_202E748 +_080143F4: .4byte gUnknown_2027370 +_080143F8: .4byte gUnknown_202E744 +_080143FC: .4byte gUnknown_202E77C +_08014400: .4byte gUnknown_202E790 +_08014404: + ldr r0, _0801445C + strb r4, [r0] +_08014408: + movs r0, 0x80 + lsls r0, 3 + mov r4, r10 + ands r0, r4 + cmp r0, 0 + beq _08014418 + bl sub_8094C14 +_08014418: + ldr r0, _08014460 + movs r1, 0x1 + str r1, [r0] + ldr r0, _08014464 + str r1, [r0] + bl sub_80048F8 + ldr r1, _08014468 + movs r0, 0 + strb r0, [r1] + ldr r1, _0801446C + movs r0, 0 + str r0, [r1] + ldr r5, [sp] + cmp r5, 0 + beq _08014480 + ldr r0, [r7, 0x4] + ldrb r1, [r7, 0xC] + lsls r1, 3 + adds r0, 0x4 + adds r0, r1 + ldr r4, [r0] + movs r0, 0x1 + bl sub_80073B8 + ldrb r0, [r7, 0xD] + cmp r0, 0 + bne _08014470 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xE + bl sub_8008274 + b _0801447A + .align 2, 0 +_0801445C: .4byte gUnknown_202E790 +_08014460: .4byte gUnknown_202E788 +_08014464: .4byte gUnknown_202E78C +_08014468: .4byte gUnknown_202E791 +_0801446C: .4byte gUnknown_202E784 +_08014470: + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xE + bl sub_800836C +_0801447A: + movs r0, 0x1 + bl sub_80073E0 +_08014480: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8014248 + + thumb_func_start sub_8014490 +sub_8014490: + ldr r0, _0801449C + movs r1, 0 + str r1, [r0] + ldr r0, _080144A0 + str r1, [r0] + bx lr + .align 2, 0 +_0801449C: .4byte gUnknown_202E744 +_080144A0: .4byte gUnknown_202EC1C + thumb_func_end sub_8014490 + + thumb_func_start sub_80144A4 +sub_80144A4: + push {lr} + adds r1, r0, 0 + cmp r1, 0 + beq _080144B2 + ldr r0, _080144BC + ldr r0, [r0] + str r0, [r1] +_080144B2: + ldr r0, _080144C0 + ldr r0, [r0] + pop {r1} + bx r1 + .align 2, 0 +_080144BC: .4byte gUnknown_202EC1C +_080144C0: .4byte gUnknown_202E744 + thumb_func_end sub_80144A4 + + thumb_func_start sub_80144C4 +sub_80144C4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + movs r0, 0x1 + mov r10, r0 + ldr r1, _080144F4 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_080144DC: + ldr r0, _080144F8 + ldr r1, [r0] + adds r3, r0, 0 + cmp r1, 0xB + bls _080144E8 + b _08014A6A +_080144E8: + lsls r0, r1, 2 + ldr r1, _080144FC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080144F4: .4byte gUnknown_202E784 +_080144F8: .4byte gUnknown_202E744 +_080144FC: .4byte _08014500 + .align 2, 0 +_08014500: + .4byte _08014A72 + .4byte _08014530 + .4byte _08014708 + .4byte _08014A38 + .4byte _08014A48 + .4byte _08014A60 + .4byte _08014778 + .4byte _080147E2 + .4byte _080147E2 + .4byte _080147E2 + .4byte _080149D8 + .4byte _08014A04 +_08014530: + ldr r0, _08014540 + ldr r6, [r0] + ldr r0, _08014544 + ldrb r0, [r0] + cmp r0, 0 + beq _0801457C + ldr r7, _08014548 + b _08014580 + .align 2, 0 +_08014540: .4byte gUnknown_202E794 +_08014544: .4byte gUnknown_202E790 +_08014548: .4byte 0x0001869f +_0801454C: + str r2, [r3, 0x1C] + adds r1, r3, 0 + adds r1, 0x20 + movs r0, 0x1 + strb r0, [r1] + ldr r1, _0801456C + movs r0, 0x8 + str r0, [r1] + ldr r0, _08014570 + strb r2, [r0] + ldr r1, _08014574 + ldr r0, _08014578 + ldr r0, [r0] + str r0, [r1] + b _0801466C + .align 2, 0 +_0801456C: .4byte gUnknown_202E744 +_08014570: .4byte gUnknown_202E791 +_08014574: .4byte gUnknown_202E780 +_08014578: .4byte gUnknown_202E738 +_0801457C: + ldr r0, _08014594 + ldr r7, [r0] +_08014580: + ldr r1, _08014598 + movs r0, 0 + str r0, [r1, 0x2C] + bl sub_80073B8 + ldr r1, _0801459C + mov r8, r1 + ldr r2, _080145A0 + mov r9, r2 + b _08014652 + .align 2, 0 +_08014594: .4byte gUnknown_202E788 +_08014598: .4byte gUnknown_202E748 +_0801459C: .4byte gUnknown_202E744 +_080145A0: .4byte gUnknown_202E780 +_080145A4: + adds r0, r4, 0 + adds r0, 0x20 + ldrb r5, [r0] + cmp r5, 0 + beq _080145EC + movs r3, 0x2 + ldrsh r0, [r4, r3] + cmp r0, 0x22 + ble _080145CC + movs r0, 0x8 + mov r4, r8 + str r0, [r4] + ldr r0, _080145C8 + ldr r0, [r0] + mov r1, r9 + str r0, [r1] + b _080145DA + .align 2, 0 +_080145C8: .4byte gUnknown_202E738 +_080145CC: + movs r0, 0x7 + mov r2, r8 + str r0, [r2] + ldr r0, _080145E4 + ldr r0, [r0] + mov r3, r9 + str r0, [r3] +_080145DA: + ldr r1, _080145E8 + movs r0, 0 + strb r0, [r1] + b _0801466C + .align 2, 0 +_080145E4: .4byte gUnknown_202E73C +_080145E8: .4byte gUnknown_202E791 +_080145EC: + ldrb r0, [r6] + cmp r0, 0 + beq _0801466C + cmp r0, 0xD + beq _080145FA + cmp r0, 0xA + bne _08014608 +_080145FA: + movs r0, 0x4 + strh r0, [r4] + ldrh r0, [r4, 0x2] + adds r0, 0xB + strh r0, [r4, 0x2] + adds r6, 0x1 + b _08014630 +_08014608: + adds r0, r6, 0 + add r1, sp, 0x4 + bl xxx_get_next_char_from_string + adds r6, r0, 0 + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + ldr r2, [sp, 0x4] + ldr r3, [r4, 0x10] + str r5, [sp] + bl sub_800743C + ldrh r1, [r4] + adds r1, r0 + strh r1, [r4] + ldr r0, _08014694 + ldr r0, [r0] + str r0, [r4, 0x2C] +_08014630: + ldr r3, _08014698 + movs r4, 0x2 + ldrsh r0, [r3, r4] + cmp r0, 0x22 + ble _08014650 + ldr r0, _0801469C + ldrh r1, [r0] + movs r0, 0x10 + ands r0, r1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0 + bne _0801464C + b _0801454C +_0801464C: + movs r0, 0x4 + strh r0, [r3, 0x2] +_08014650: + subs r7, 0x1 +_08014652: + cmp r7, 0 + ble _0801466C + ldr r4, _08014698 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_8009190 + adds r6, r0, 0 + adds r0, r4, 0 + adds r0, 0x21 + ldrb r0, [r0] + cmp r0, 0 + beq _080145A4 +_0801466C: + movs r0, 0 + bl sub_80073E0 + ldr r4, _080146A0 + str r6, [r4] + ldr r0, _080146A4 + bl sub_801317C + ldr r0, [r4] + ldrb r0, [r0] + cmp r0, 0 + bne _080146BC + ldr r0, _080146A8 + ldr r0, [r0] + cmp r0, 0 + beq _080146B0 + ldr r1, _080146AC + movs r0, 0x3 + str r0, [r1] + b _08014A72 + .align 2, 0 +_08014694: .4byte gUnknown_202E78C +_08014698: .4byte gUnknown_202E748 +_0801469C: .4byte gUnknown_202E77C +_080146A0: .4byte gUnknown_202E794 +_080146A4: .4byte gUnknown_202EC28 +_080146A8: .4byte gUnknown_202EC14 +_080146AC: .4byte gUnknown_202E744 +_080146B0: + ldr r1, _080146B8 + movs r0, 0x6 + str r0, [r1] + b _08014A72 + .align 2, 0 +_080146B8: .4byte gUnknown_202E744 +_080146BC: + ldr r0, _080146E8 + movs r2, 0 + str r2, [r0, 0x30] + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0 + beq _080146FC + ldr r1, _080146EC + ldr r0, [r1] + cmp r0, 0x1 + beq _080146D4 + b _08014A72 +_080146D4: + movs r0, 0x7 + str r0, [r1] + ldr r0, _080146F0 + strb r2, [r0] + ldr r1, _080146F4 + ldr r0, _080146F8 + ldr r0, [r0] + str r0, [r1] + b _08014A72 + .align 2, 0 +_080146E8: .4byte gUnknown_202E748 +_080146EC: .4byte gUnknown_202E744 +_080146F0: .4byte gUnknown_202E791 +_080146F4: .4byte gUnknown_202E780 +_080146F8: .4byte gUnknown_202E738 +_080146FC: + ldr r1, _08014704 + movs r0, 0x2 + b _08014A68 + .align 2, 0 +_08014704: .4byte gUnknown_202E744 +_08014708: + ldr r4, _08014760 + ldrh r1, [r4] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08014718 + bl sub_8011A04 +_08014718: + ldrh r1, [r4] + movs r0, 0x2 + ands r0, r1 + ldr r2, _08014764 + cmp r0, 0 + bne _08014742 + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08014742 + ldr r0, _08014768 + ldrh r1, [r0, 0x2] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _08014742 + ldr r0, _0801476C + movs r1, 0x1 + strb r1, [r0] + ldr r0, _08014770 + str r0, [r2, 0x30] +_08014742: + ldr r1, [r2, 0x30] + adds r1, 0x1 + str r1, [r2, 0x30] + ldr r0, [r2, 0x2C] + cmp r1, r0 + bgt _08014750 + b _08014A72 +_08014750: + ldr r1, _08014774 + movs r0, 0x1 + str r0, [r1] + adds r1, r2, 0 + adds r1, 0x21 + movs r0, 0 + strb r0, [r1] + b _08014A6A + .align 2, 0 +_08014760: .4byte gUnknown_202E77C +_08014764: .4byte gUnknown_202E748 +_08014768: .4byte gUnknown_20255F0 +_0801476C: .4byte gUnknown_202E790 +_08014770: .4byte 0x0001869f +_08014774: .4byte gUnknown_202E744 +_08014778: + ldr r0, _080147B4 + ldrh r1, [r0] + movs r0, 0x80 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _080147DC + movs r0, 0x9 + str r0, [r3] + ldr r1, _080147B8 + movs r0, 0 + strb r0, [r1] + ldr r0, _080147BC + ldr r1, [r0] + cmp r1, 0 + ble _080147C8 + ldr r2, _080147C0 + ldr r0, _080147C4 + ldr r0, [r0] + subs r0, r1, r0 + str r0, [r2] + cmp r0, 0 + blt _080147A8 + b _08014A6A +_080147A8: + movs r0, 0xB + str r0, [r3] + movs r0, 0 + str r0, [r2] + b _08014A6A + .align 2, 0 +_080147B4: .4byte gUnknown_202E77C +_080147B8: .4byte gUnknown_202E791 +_080147BC: .4byte gUnknown_202E740 +_080147C0: .4byte gUnknown_202E780 +_080147C4: .4byte gUnknown_202E784 +_080147C8: + ldr r0, _080147D4 + ldr r1, _080147D8 + ldr r1, [r1] + str r1, [r0] + b _08014A6A + .align 2, 0 +_080147D4: .4byte gUnknown_202E780 +_080147D8: .4byte gUnknown_202E738 +_080147DC: + movs r0, 0xB + str r0, [r3] + b _08014A6A +_080147E2: + movs r5, 0 + ldr r0, _0801481C + adds r0, 0x20 + strb r5, [r0] + ldr r4, _08014820 + adds r0, r4, 0 + movs r1, 0 + bl nullsub_34 + ldr r0, _08014824 + ldrh r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08014802 + b _0801494C +_08014802: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0801482C + ldr r1, _08014828 + ldr r0, [r1] + cmp r0, 0 + bgt _08014814 + b _0801494C +_08014814: + subs r0, 0x1 + str r0, [r1] + b _08014856 + .align 2, 0 +_0801481C: .4byte gUnknown_202E748 +_08014820: .4byte gUnknown_202EC28 +_08014824: .4byte gUnknown_202E77C +_08014828: .4byte gUnknown_202E780 +_0801482C: + ldr r2, _080148E4 + ldrh r1, [r2, 0x2] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _0801483A + b _0801494C +_0801483A: + ldrb r0, [r4, 0x1] + cmp r0, 0 + beq _08014842 + b _0801494C +_08014842: + ldrh r1, [r2] + movs r0, 0xF2 + ands r0, r1 + cmp r0, 0x2 + bne _0801484E + b _0801494C +_0801484E: + ldrb r0, [r4, 0x5] + cmp r0, 0 + beq _08014856 + movs r5, 0x1 +_08014856: + cmp r5, 0 + bne _0801494C + ldr r1, _080148E8 + ldrb r0, [r1] + adds r2, r0, 0x1 + strb r2, [r1] + ldr r0, _080148EC + ldrh r7, [r0] + movs r0, 0x2 + ands r0, r7 + cmp r0, 0 + beq _08014870 + b _08014A72 +_08014870: + movs r0, 0x8 + ands r2, r0 + cmp r2, 0 + bne _0801487A + b _08014A72 +_0801487A: + ldr r3, _080148F0 + ldrh r1, [r3] + ldr r0, _080148F4 + ands r0, r1 + ldr r1, _080148F8 + ands r0, r1 + ldr r4, _080148FC + ands r0, r4 + ldr r1, _08014900 + ands r0, r1 + ldr r1, _08014904 + ands r0, r1 + movs r1, 0x80 + lsls r1, 7 + ldr r2, _08014908 + ands r0, r2 + orrs r0, r1 + strh r0, [r3] + ldrh r0, [r3, 0x2] + ldr r5, _0801490C + ands r5, r0 + ands r5, r2 + strh r5, [r3, 0x2] + movs r2, 0xFC + lsls r2, 2 + ldrh r1, [r3, 0x4] + movs r0, 0xFC + lsls r0, 8 + ands r0, r1 + orrs r0, r2 + ands r0, r4 + movs r6, 0xF + lsls r1, r6, 12 + ldr r2, _08014910 + ands r0, r2 + movs r4, 0 + mov r8, r4 + orrs r0, r1 + strh r0, [r3, 0x4] + movs r0, 0x10 + ands r0, r7 + adds r4, r3, 0 + cmp r0, 0 + beq _08014914 + movs r2, 0xF0 + lsls r2, 3 + ldrh r1, [r4, 0x6] + adds r0, r6, 0 + ands r0, r1 + orrs r0, r2 + strh r0, [r4, 0x6] + movs r0, 0x70 + b _08014932 + .align 2, 0 +_080148E4: .4byte gUnknown_20255F0 +_080148E8: .4byte gUnknown_202E791 +_080148EC: .4byte gUnknown_202E77C +_080148F0: .4byte gUnknown_202E6E0 +_080148F4: .4byte 0x0000feff +_080148F8: .4byte 0x0000fdff +_080148FC: .4byte 0x0000f3ff +_08014900: .4byte 0x0000efff +_08014904: .4byte 0x0000dfff +_08014908: .4byte 0x00003fff +_0801490C: .4byte 0x0000c1ff +_08014910: .4byte 0x00000fff +_08014914: + ldr r3, _08014944 + movs r0, 0xA + ldrsh r1, [r3, r0] + adds r1, 0x1 + ands r1, r2 + lsls r1, 4 + ldrh r2, [r4, 0x6] + adds r0, r6, 0 + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x6] + movs r1, 0x8 + ldrsh r0, [r3, r1] + ldr r1, _08014948 + ands r0, r1 +_08014932: + strh r0, [r4, 0x2] + movs r1, 0x80 + lsls r1, 1 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0 + bl AddSprite + b _08014A72 + .align 2, 0 +_08014944: .4byte gUnknown_202E748 +_08014948: .4byte 0x000001ff +_0801494C: + ldr r0, _08014960 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0 + bne _08014968 + ldr r1, _08014964 + movs r0, 0xB + str r0, [r1] + b _080149BA + .align 2, 0 +_08014960: .4byte gUnknown_202E794 +_08014964: .4byte gUnknown_202E744 +_08014968: + ldr r4, _08014974 + ldr r0, [r4] + cmp r0, 0x9 + bne _08014978 + movs r0, 0xB + b _080149B8 + .align 2, 0 +_08014974: .4byte gUnknown_202E744 +_08014978: + cmp r0, 0x8 + bne _080149B6 + ldr r2, _080149A0 + movs r1, 0x4 + strh r1, [r2] + movs r3, 0x2 + ldrsh r0, [r2, r3] + cmp r0, 0x22 + ble _080149B6 + strh r1, [r2, 0x2] + ldr r0, _080149A4 + ldrh r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080149A8 +_08014998: + movs r0, 0 + bl sub_8008C54 + b _080149B6 + .align 2, 0 +_080149A0: .4byte gUnknown_202E748 +_080149A4: .4byte gUnknown_202E77C +_080149A8: + ldr r1, [r2, 0x1C] + cmp r1, 0 + bne _08014998 + movs r0, 0xA + str r0, [r4] + str r1, [r2, 0x28] + b _080149BA +_080149B6: + movs r0, 0x1 +_080149B8: + str r0, [r4] +_080149BA: + ldr r1, _080149D0 + movs r0, 0x70 + strh r0, [r1, 0x8] + ldr r0, _080149D4 + movs r4, 0x2 + ldrsh r0, [r0, r4] + lsls r0, 3 + adds r0, 0x22 + strh r0, [r1, 0xA] + b _08014A72 + .align 2, 0 +_080149D0: .4byte gUnknown_202E748 +_080149D4: .4byte gUnknown_2027370 +_080149D8: + ldr r4, _080149F8 + ldr r0, [r4, 0x28] + adds r0, 0x1 + str r0, [r4, 0x28] + ldr r0, _080149FC + ldr r1, [r0] + movs r0, 0 + bl _call_via_r1 + ldr r0, [r4, 0x28] + cmp r0, 0x11 + ble _08014A72 + ldr r1, _08014A00 + movs r0, 0x1 + str r0, [r1] + b _08014A72 + .align 2, 0 +_080149F8: .4byte gUnknown_202E748 +_080149FC: .4byte gUnknown_203B088 +_08014A00: .4byte gUnknown_202E744 +_08014A04: + ldr r0, _08014A2C + ldrh r1, [r0] + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + beq _08014A34 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r1, _08014A30 + movs r0, 0 + str r0, [r1] + b _08014A72 + .align 2, 0 +_08014A2C: .4byte gUnknown_202E77C +_08014A30: .4byte gUnknown_202E744 +_08014A34: + str r0, [r3] + b _08014A72 +_08014A38: + bl sub_8014A88 + ldr r1, _08014A44 + movs r0, 0x4 + str r0, [r1] + b _08014A72 + .align 2, 0 +_08014A44: .4byte gUnknown_202E744 +_08014A48: + bl sub_8014B94 + lsls r0, 24 + cmp r0, 0 + beq _08014A72 + ldr r1, _08014A5C + movs r0, 0x5 + str r0, [r1] + b _08014A72 + .align 2, 0 +_08014A5C: .4byte gUnknown_202E744 +_08014A60: + bl nullsub_35 + ldr r1, _08014A84 + movs r0, 0xB +_08014A68: + str r0, [r1] +_08014A6A: + mov r0, r10 + cmp r0, 0 + beq _08014A72 + b _080144DC +_08014A72: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08014A84: .4byte gUnknown_202E744 + thumb_func_end sub_80144C4 + + thumb_func_start sub_8014A88 +sub_8014A88: + push {r4-r7,lr} + sub sp, 0x88 + ldr r0, _08014A98 + ldr r4, [r0] + movs r5, 0 + movs r7, 0 + movs r6, 0 + b _08014ABE + .align 2, 0 +_08014A98: .4byte gUnknown_202EC14 +_08014A9C: + adds r5, 0xC + ldr r0, [r4] + add r1, sp, 0x8 + add r2, sp, 0x88 + movs r3, 0 + bl sub_8014BC4 + add r0, sp, 0x8 + bl sub_8008ED0 + cmp r7, r0 + bge _08014AB6 + adds r7, r0, 0 +_08014AB6: + adds r4, 0x8 + adds r6, 0x1 + cmp r6, 0x9 + bgt _08014AC4 +_08014ABE: + ldr r0, [r4] + cmp r0, 0 + bne _08014A9C +_08014AC4: + adds r0, r5, 0 + cmp r5, 0 + bge _08014ACC + adds r0, r5, 0x7 +_08014ACC: + asrs r2, r0, 3 + movs r0, 0x7 + ands r5, r0 + cmp r5, 0 + beq _08014AD8 + adds r2, 0x1 +_08014AD8: + ldr r4, _08014B74 + ldr r0, _08014B78 + ldr r0, [r0] + str r0, [r4, 0x34] + adds r1, r7, 0 + cmp r1, 0 + bge _08014AE8 + adds r1, 0x7 +_08014AE8: + asrs r1, 3 + adds r1, 0x2 + strh r1, [r4, 0x3C] + adds r0, r4, 0 + adds r0, 0x40 + strh r2, [r0] + strh r2, [r4, 0x3E] + movs r0, 0x1C + subs r0, r1 + strh r0, [r4, 0x38] + movs r0, 0xE + subs r0, r2 + strh r0, [r4, 0x3A] + movs r0, 0x80 + strb r0, [r4] + movs r0, 0xC0 + strb r0, [r4, 0x18] + ldr r5, _08014B7C + ldr r0, [r5] + cmp r0, 0 + beq _08014B1E + adds r1, r4, 0 + adds r1, 0x48 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} +_08014B1E: + bl sub_8004914 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + bl sub_800641C + ldr r0, _08014B80 + ldr r1, _08014B84 + ldr r1, [r1] + ldr r2, _08014B88 + ldr r3, _08014B8C + ldr r3, [r3] + ldr r4, _08014B90 + ldr r4, [r4] + str r4, [sp] + movs r4, 0x2 + str r4, [sp, 0x4] + bl sub_8012D60 + ldr r0, [r5] + cmp r0, 0 + beq _08014B6A + movs r0, 0x3 + bl sub_80073B8 + ldr r0, [r5] + ldr r2, [r0, 0x18] + movs r0, 0 + str r0, [sp] + movs r0, 0x4 + movs r1, 0x2 + movs r3, 0x3 + bl xxx_call_draw_string + movs r0, 0x3 + bl sub_80073E0 +_08014B6A: + add sp, 0x88 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08014B74: .4byte gUnknown_203B198 +_08014B78: .4byte gUnknown_202EC10 +_08014B7C: .4byte gUnknown_202EC20 +_08014B80: .4byte gUnknown_202EBC0 +_08014B84: .4byte gUnknown_202EC14 +_08014B88: .4byte gUnknown_80D48A0 +_08014B8C: .4byte gUnknown_202EC18 +_08014B90: .4byte gUnknown_202EC1C + thumb_func_end sub_8014A88 + + thumb_func_start sub_8014B94 +sub_8014B94: + push {r4,lr} + ldr r4, _08014BA8 + adds r0, r4, 0 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + beq _08014BAC + movs r0, 0 + b _08014BB6 + .align 2, 0 +_08014BA8: .4byte gUnknown_202EBC0 +_08014BAC: + ldr r1, _08014BBC + adds r0, r4, 0 + bl sub_8013114 + movs r0, 0x1 +_08014BB6: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08014BBC: .4byte gUnknown_202EC1C + thumb_func_end sub_8014B94 + + thumb_func_start nullsub_35 +nullsub_35: + bx lr + thumb_func_end nullsub_35 + + thumb_func_start sub_8014BC4 +sub_8014BC4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x40 + adds r5, r0, 0 + str r1, [sp, 0x3C] + adds r7, r2, 0 + lsls r3, 16 + lsrs r3, 16 + mov r8, r3 + movs r0, 0x1 + mov r10, r0 + mov r9, r0 + subs r7, 0x1 + b _08014F62 +_08014BE6: + movs r1, 0x1 + b _08014C2C +_08014BEA: + mov r0, r10 + cmp r0, 0 + beq _08014C24 + movs r1, 0 + mov r10, r1 + mov r9, r1 + movs r0, 0x8 + mov r1, r8 + ands r0, r1 + cmp r0, 0 + beq _08014C2E + ldr r0, _08014C1C + add r4, sp, 0x3C + adds r1, r4, 0 + adds r2, r7, 0 + mov r3, r8 + bl sub_8014FA8 + ldr r0, _08014C20 + adds r1, r4, 0 + adds r2, r7, 0 + mov r3, r8 + bl sub_8014FA8 + b _08014C2E + .align 2, 0 +_08014C1C: .4byte gUnknown_202E5D8 +_08014C20: .4byte gUnknown_80D48F4 +_08014C24: + mov r0, r9 + cmp r0, 0 + beq _08014C2E + movs r1, 0 +_08014C2C: + mov r9, r1 +_08014C2E: + cmp r6, 0x23 + bne _08014C5A + ldrb r3, [r5, 0x1] + cmp r3, 0x50 + beq _08014C3C + cmp r3, 0x70 + bne _08014C42 +_08014C3C: + movs r0, 0x1 + mov r10, r0 + mov r9, r0 +_08014C42: + ldr r1, [sp, 0x3C] + adds r2, r1, 0x1 + cmp r2, r7 + bcs _08014C56 + movs r0, 0x23 + strb r0, [r1] + str r2, [sp, 0x3C] + strb r3, [r1, 0x1] + adds r0, r2, 0x1 + str r0, [sp, 0x3C] +_08014C56: + adds r5, 0x2 + b _08014F62 +_08014C5A: + cmp r6, 0x24 + beq _08014C60 + b _08014F26 +_08014C60: + movs r4, 0 + adds r5, 0x1 + ldrb r0, [r5] + subs r0, 0x24 + cmp r0, 0x52 + bls _08014C6E + b _08014F0E +_08014C6E: + lsls r0, 2 + ldr r1, _08014C78 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08014C78: .4byte _08014C7C + .align 2, 0 +_08014C7C: + .4byte _08014F04 + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0C + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014EC4 + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014E60 + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014E54 + .4byte _08014DC8 + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014DDC + .4byte _08014E10 + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014F0E + .4byte _08014E24 + .4byte _08014F0E + .4byte _08014E84 +_08014DC8: + adds r5, 0x1 + ldrb r0, [r5] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 4 + ldr r0, _08014DD8 + adds r4, r1, r0 + b _08014F0C + .align 2, 0 +_08014DD8: .4byte gUnknown_202CF58 +_08014DDC: + adds r5, 0x1 + ldrb r0, [r5] + cmp r0, 0x6D + bne _08014DFC + bl sub_808D3BC + adds r1, r0, 0 + ldr r4, _08014DF8 + adds r0, r4, 0 + movs r2, 0 + bl sub_808D9AC + b _08014F0E + .align 2, 0 +_08014DF8: .4byte gUnknown_202EB80 +_08014DFC: + ldrb r0, [r5] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 4 + ldr r0, _08014E0C + adds r4, r1, r0 + b _08014F0C + .align 2, 0 +_08014E0C: .4byte gUnknown_202D098 +_08014E10: + adds r5, 0x1 + ldrb r0, [r5] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 4 + ldr r0, _08014E20 + adds r4, r1, r0 + b _08014F0C + .align 2, 0 +_08014E20: .4byte gUnknown_202D3B8 +_08014E24: + adds r5, 0x1 + movs r0, 0 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _08014E40 + ldr r0, _08014E3C + bl sub_80920D8 + b _08014E48 + .align 2, 0 +_08014E3C: .4byte gUnknown_202E6E8 +_08014E40: + ldr r0, _08014E4C + ldr r1, _08014E50 + bl strcpy +_08014E48: + ldr r4, _08014E4C + b _08014F0E + .align 2, 0 +_08014E4C: .4byte gUnknown_202E6E8 +_08014E50: .4byte gUnknown_80D48F8 +_08014E54: + adds r5, 0x1 + ldr r4, _08014E5C + b _08014F0E + .align 2, 0 +_08014E5C: .4byte gUnknown_202E628 +_08014E60: + adds r5, 0x1 + ldr r1, _08014E7C + ldr r2, _08014E80 + ldrb r0, [r5] + subs r0, 0x30 + lsls r0, 2 + adds r0, r2 + adds r5, 0x1 + ldr r2, [r0] + mov r0, sp + bl sub_800D158 +_08014E78: + mov r4, sp + b _08014F0E + .align 2, 0 +_08014E7C: .4byte gUnknown_80D4900 +_08014E80: .4byte gUnknown_202DE30 +_08014E84: + adds r5, 0x1 + ldr r1, _08014EBC + ldrb r0, [r5] + subs r0, 0x30 + lsls r0, 2 + adds r0, r1 + ldr r3, [r0] + adds r5, 0x1 + ldr r1, _08014EC0 + ldrb r2, [r5] + subs r2, 0x30 + adds r5, 0x1 + mov r0, sp + bl sub_800D158 + mov r0, sp + ldrb r1, [r0] + cmp r1, 0 + beq _08014E78 + movs r2, 0x60 +_08014EAC: + cmp r1, 0x20 + bne _08014EB2 + strb r2, [r0] +_08014EB2: + adds r0, 0x1 + ldrb r1, [r0] + cmp r1, 0 + bne _08014EAC + b _08014E78 + .align 2, 0 +_08014EBC: .4byte gUnknown_202DE30 +_08014EC0: .4byte gUnknown_80D4904 +_08014EC4: + adds r5, 0x1 + ldr r1, _08014EFC + ldrb r0, [r5] + subs r0, 0x30 + lsls r0, 2 + adds r0, r1 + ldr r3, [r0] + adds r5, 0x1 + ldr r1, _08014F00 + ldrb r2, [r5] + subs r2, 0x30 + adds r5, 0x1 + mov r0, sp + bl sub_800D158 + mov r0, sp + ldrb r1, [r0] + cmp r1, 0 + beq _08014E78 + movs r2, 0x60 +_08014EEC: + cmp r1, 0x20 + bne _08014EF2 + strb r2, [r0] +_08014EF2: + adds r0, 0x1 + ldrb r1, [r0] + cmp r1, 0 + bne _08014EEC + b _08014E78 + .align 2, 0 +_08014EFC: .4byte gUnknown_202DE30 +_08014F00: .4byte gUnknown_80D4908 +_08014F04: + ldr r4, _08014F08 + b _08014F0E + .align 2, 0 +_08014F08: .4byte gUnknown_80D4910 +_08014F0C: + adds r5, 0x1 +_08014F0E: + cmp r4, 0 + beq _08014F62 + add r1, sp, 0x3C + adds r0, r4, 0 + adds r2, r7, 0 + mov r3, r8 + bl sub_8014FA8 + lsls r0, 24 + cmp r0, 0 + bne _08014F7E + b _08014F62 +_08014F26: + adds r0, r6, 0 + adds r0, 0x7F + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _08014F36 + cmp r6, 0x87 + bne _08014F54 +_08014F36: + ldr r0, [sp, 0x3C] + cmp r0, r7 + bcs _08014F42 + strb r6, [r0] + adds r0, 0x1 + str r0, [sp, 0x3C] +_08014F42: + adds r5, 0x1 + ldrb r1, [r5] + cmp r1, 0 + beq _08014F7E + ldr r0, [sp, 0x3C] + cmp r0, r7 + bcs _08014F60 + strb r1, [r0] + b _08014F5C +_08014F54: + ldr r0, [sp, 0x3C] + cmp r0, r7 + bcs _08014F60 + strb r6, [r0] +_08014F5C: + adds r0, 0x1 + str r0, [sp, 0x3C] +_08014F60: + adds r5, 0x1 +_08014F62: + ldrb r6, [r5] + cmp r6, 0 + beq _08014F7E + cmp r6, 0xD + beq _08014F72 + cmp r6, 0xA + beq _08014F72 + b _08014BEA +_08014F72: + movs r0, 0x80 + mov r1, r8 + ands r0, r1 + cmp r0, 0 + bne _08014F7E + b _08014BE6 +_08014F7E: + ldr r0, [sp, 0x3C] + movs r1, 0 + strb r1, [r0] + ldrb r0, [r5] + cmp r0, 0xD + bne _08014F8C + adds r5, 0x1 +_08014F8C: + ldrb r0, [r5] + cmp r0, 0xA + bne _08014F94 + adds r5, 0x1 +_08014F94: + adds r0, r5, 0 + add sp, 0x40 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8014BC4 + + thumb_func_start sub_8014FA8 +sub_8014FA8: + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r3, 16 + lsrs r3, 16 + ldr r2, [r5] + ldrb r1, [r4] + cmp r1, 0 + beq _08014FE4 + movs r0, 0x80 + ands r0, r3 + lsls r0, 16 + lsrs r3, r0, 16 +_08014FC4: + cmp r3, 0 + beq _08014FD2 + cmp r1, 0xD + bne _08014FD2 + str r2, [r5] + movs r0, 0x1 + b _08014FE8 +_08014FD2: + cmp r2, r6 + bcs _08014FDC + ldrb r0, [r4] + strb r0, [r2] + adds r2, 0x1 +_08014FDC: + adds r4, 0x1 + ldrb r1, [r4] + cmp r1, 0 + bne _08014FC4 +_08014FE4: + str r2, [r5] + movs r0, 0 +_08014FE8: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8014FA8 + + thumb_func_start sub_8014FF0 +sub_8014FF0: + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x1F8 + adds r5, r0, 0 + adds r6, r1, 0 + adds r0, r2, 0 + mov r8, r3 + ldr r4, [sp, 0x20C] + add r2, sp, 0x1F8 + add r1, sp, 0x4 + movs r3, 0 + bl sub_8014BC4 + ldr r1, _08015030 + add r1, sp + movs r0, 0 + strb r0, [r1] + str r4, [sp] + adds r0, r5, 0 + adds r1, r6, 0 + add r2, sp, 0x4 + mov r3, r8 + bl xxx_call_draw_string + add sp, 0x1F8 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08015030: .4byte 0x000001f7 + thumb_func_end sub_8014FF0 + + thumb_func_start sub_8015034 +sub_8015034: + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x1FC + adds r6, r0, 0 + mov r8, r1 + adds r0, r2, 0 + mov r9, r3 + ldr r4, [sp, 0x214] + ldr r5, [sp, 0x218] + add r2, sp, 0x1FC + add r1, sp, 0x8 + movs r3, 0 + bl sub_8014BC4 + ldr r1, _0801507C + add r1, sp + movs r0, 0 + strb r0, [r1] + str r4, [sp] + str r5, [sp, 0x4] + adds r0, r6, 0 + mov r1, r8 + add r2, sp, 0x8 + mov r3, r9 + bl sub_8008F8C + add sp, 0x1FC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0801507C: .4byte 0x000001fb + thumb_func_end sub_8015034 + + thumb_func_start sub_8015080 +sub_8015080: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + mov r8, r0 + mov r9, r1 + ldr r4, _08015158 + ldr r0, _0801515C + movs r1, 0x8 + bl MemoryAlloc + str r0, [r4] + movs r1, 0 + str r1, [r0] + mov r12, r4 + ldr r0, _08015160 + mov r10, r0 + mov r5, r12 + movs r3, 0 + movs r2, 0x3 +_080150AC: + mov r4, r12 + ldr r1, [r4] + adds r1, r3 + adds r1, 0x54 + mov r0, r10 + ldm r0!, {r4,r6,r7} + stm r1!, {r4,r6,r7} + ldm r0!, {r4,r6,r7} + stm r1!, {r4,r6,r7} + adds r3, 0x18 + subs r2, 0x1 + cmp r2, 0 + bge _080150AC + movs r4, 0 + ldr r1, [r5] + adds r1, 0x54 + ldr r0, _08015164 + ldm r0!, {r2,r6,r7} + stm r1!, {r2,r6,r7} + ldm r0!, {r3,r6,r7} + stm r1!, {r3,r6,r7} + ldr r1, [r5] + adds r1, 0x84 + ldr r0, _08015168 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldr r0, [r5] + adds r0, 0x84 + mov r1, r9 + bl sub_8012CAC + bl sub_8004914 + ldr r0, [r5] + adds r0, 0x54 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0 + bl sub_80073B8 + ldr r2, [r5] + adds r1, r2, 0 + adds r1, 0xB4 + ldr r6, _0801515C + adds r2, r6 + mov r0, r8 + movs r3, 0 + bl sub_8014BC4 + ldr r2, [r5] + adds r2, 0xB4 + str r4, [sp] + movs r0, 0x4 + movs r1, 0x4 + movs r3, 0 + bl xxx_call_draw_string + movs r0, 0 + bl sub_80073E0 + ldr r0, [r5] + adds r0, 0x4 + movs r1, 0x1 + negs r1, r1 + str r1, [sp] + movs r1, 0x2 + str r1, [sp, 0x4] + mov r1, r9 + movs r2, 0 + movs r3, 0 + bl sub_8012D60 + movs r0, 0x1 + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08015158: .4byte gUnknown_203B1F8 +_0801515C: .4byte 0x000004b4 +_08015160: .4byte gUnknown_80DAF70 +_08015164: .4byte gUnknown_80DAF88 +_08015168: .4byte gUnknown_80DAFA0 + thumb_func_end sub_8015080 + + thumb_func_start sub_801516C +sub_801516C: + push {r4,lr} + ldr r4, _08015184 + ldr r0, [r4] + adds r0, 0x4 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + beq _08015188 + movs r0, 0 + b _08015192 + .align 2, 0 +_08015184: .4byte gUnknown_203B1F8 +_08015188: + ldr r1, [r4] + adds r0, r1, 0x4 + bl sub_8013114 + movs r0, 0x3 +_08015192: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_801516C + + thumb_func_start sub_8015198 +sub_8015198: + ldr r0, _080151A0 + ldr r0, [r0] + ldr r0, [r0] + bx lr + .align 2, 0 +_080151A0: .4byte gUnknown_203B1F8 + thumb_func_end sub_8015198 + + thumb_func_start sub_80151A4 +sub_80151A4: + push {r4,lr} + ldr r4, _080151BC + ldr r0, [r4] + cmp r0, 0 + beq _080151B6 + bl MemoryFree + movs r0, 0 + str r0, [r4] +_080151B6: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080151BC: .4byte gUnknown_203B1F8 + thumb_func_end sub_80151A4 + + thumb_func_start sub_80151C0 +sub_80151C0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r5, r0, 0 + adds r6, r1, 0 + ldr r4, _080151FC + movs r0, 0xCC + lsls r0, 1 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r4] + str r5, [r0] + movs r1, 0 + strb r1, [r0, 0x19] + ldr r0, [r4] + strb r1, [r0, 0x18] + ldr r0, [r4] + strb r1, [r0, 0x4] + ldr r0, [r4] + ldr r0, [r0] + cmp r0, 0x5 + bhi _0801524C + lsls r0, 2 + ldr r1, _08015200 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080151FC: .4byte gUnknown_203B1FC +_08015200: .4byte _08015204 + .align 2, 0 +_08015204: + .4byte _0801524C + .4byte _0801524C + .4byte _0801524C + .4byte _0801524C + .4byte _0801521C + .4byte _08015234 +_0801521C: + ldr r1, _08015230 + ldr r2, [r1] + movs r0, 0x9 + strb r0, [r2, 0x1A] + ldr r2, [r1] + movs r0, 0x1 + strb r0, [r2, 0x4] + ldr r2, [r1] + movs r0, 0x36 + b _08015258 + .align 2, 0 +_08015230: .4byte gUnknown_203B1FC +_08015234: + ldr r1, _08015248 + ldr r2, [r1] + movs r0, 0x9 + strb r0, [r2, 0x1A] + ldr r2, [r1] + movs r0, 0x1 + strb r0, [r2, 0x4] + ldr r2, [r1] + movs r0, 0x18 + b _08015258 + .align 2, 0 +_08015248: .4byte gUnknown_203B1FC +_0801524C: + ldr r1, _08015374 + ldr r2, [r1] + movs r0, 0x6 + strb r0, [r2, 0x1A] + ldr r2, [r1] + movs r0, 0xA +_08015258: + strb r0, [r2, 0x1B] + mov r8, r1 + mov r0, r8 + ldr r2, [r0] + movs r1, 0x9A + lsls r1, 1 + adds r0, r2, r1 + str r6, [r0] + adds r1, r2, 0 + adds r1, 0xF8 + adds r0, r2, 0 + adds r0, 0xFC + str r0, [r1] + movs r2, 0 + mov r1, r8 + movs r3, 0 +_08015278: + ldr r0, [r1] + adds r0, 0xF8 + ldr r0, [r0] + adds r0, r2 + strb r3, [r0] + adds r2, 0x1 + cmp r2, 0x35 + ble _08015278 + ldr r5, _08015374 + ldr r2, [r5] + adds r0, r2, 0 + adds r0, 0xF8 + ldr r0, [r0] + movs r3, 0x9A + lsls r3, 1 + adds r1, r2, r3 + ldr r1, [r1] + ldrb r2, [r2, 0x1B] + bl MemoryCopy8 + movs r2, 0 + ldr r0, [r5] + ldrb r3, [r0, 0x1B] + cmp r2, r3 + bge _080152EA + adds r1, r0, 0 + adds r1, 0xF8 + ldr r0, [r1] + ldrb r0, [r0] + mov r8, r5 + cmp r0, 0 + beq _080152C8 +_080152B8: + adds r2, 0x1 + cmp r2, r3 + bge _080152EA + ldr r0, [r1] + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080152B8 +_080152C8: + mov r4, r8 + ldr r0, [r4] + ldrb r0, [r0, 0x1B] + cmp r2, r0 + bge _080152EA + mov r1, r8 + movs r3, 0 +_080152D6: + ldr r0, [r1] + adds r0, 0xF8 + ldr r0, [r0] + adds r0, r2 + strb r3, [r0] + adds r2, 0x1 + ldr r0, [r1] + ldrb r0, [r0, 0x1B] + cmp r2, r0 + blt _080152D6 +_080152EA: + bl sub_8015F44 + ldr r2, _08015374 + ldr r1, [r2] + strb r0, [r1, 0x1C] + ldr r1, [r2] + ldrb r0, [r1, 0x1C] + ldrb r5, [r1, 0x1B] + cmp r0, r5 + bne _08015302 + subs r0, 0x1 + strb r0, [r1, 0x1C] +_08015302: + movs r6, 0x1 + mov r12, r6 + ldr r6, [r2] + adds r5, r6, 0x6 + ldrh r1, [r6, 0x6] + ldr r0, _08015378 + ands r0, r1 + ldr r1, _0801537C + ands r0, r1 + ldr r2, _08015380 + ands r0, r2 + ldr r1, _08015384 + ands r0, r1 + ldr r1, _08015388 + ands r0, r1 + strh r0, [r6, 0x6] + ldrh r0, [r5, 0x4] + adds r3, r2, 0 + ands r3, r0 + movs r1, 0xF + movs r2, 0xF0 + lsls r2, 8 + ldr r0, _0801538C + ands r3, r0 + orrs r3, r2 + strh r3, [r5, 0x4] + ldrh r0, [r5, 0x2] + movs r4, 0xFE + lsls r4, 8 + ands r4, r0 + movs r0, 0xF0 + orrs r4, r0 + strh r4, [r5, 0x2] + movs r2, 0xF0 + lsls r2, 4 + ldrh r0, [r5, 0x6] + ands r1, r0 + movs r7, 0 + orrs r1, r2 + strh r1, [r5, 0x6] + ldrb r0, [r6, 0x4] + cmp r0, 0 + beq _0801539C + ldr r0, _08015390 + ands r4, r0 + ldr r1, _08015394 + movs r0, 0xFC + lsls r0, 8 + ands r3, r0 + orrs r3, r1 + strh r3, [r5, 0x4] + ldr r0, _08015398 + ands r4, r0 + strh r4, [r5, 0x2] + mov r7, r12 + b _080153BE + .align 2, 0 +_08015374: .4byte gUnknown_203B1FC +_08015378: .4byte 0x0000feff +_0801537C: .4byte 0x0000fdff +_08015380: .4byte 0x0000f3ff +_08015384: .4byte 0x0000efff +_08015388: .4byte 0x0000dfff +_0801538C: .4byte 0x00000fff +_08015390: .4byte 0x0000c1ff +_08015394: .4byte 0x000003f6 +_08015398: .4byte 0x00003fff +_0801539C: + movs r1, 0x80 + lsls r1, 6 + ldr r0, _08015468 + ands r4, r0 + orrs r4, r1 + orrs r4, r7 + movs r1, 0xFC + lsls r1, 2 + movs r0, 0xFC + lsls r0, 8 + ands r3, r0 + orrs r3, r1 + strh r3, [r5, 0x4] + ldr r0, _0801546C + ands r4, r0 + strh r4, [r5, 0x2] + mov r1, r12 +_080153BE: + movs r2, 0x80 + lsls r2, 7 + ldrh r1, [r6, 0x6] + ands r0, r1 + orrs r0, r2 + strh r0, [r6, 0x6] + ldr r5, _08015470 + ldr r1, [r5] + movs r0, 0x4 + strb r0, [r1, 0x16] + ldr r4, [r5] + adds r6, r4, 0 + adds r6, 0xE + ldrh r1, [r4, 0xE] + ldr r0, _08015474 + ands r0, r1 + ldr r1, _08015478 + ands r0, r1 + ldr r3, _0801547C + ands r0, r3 + ldr r1, _08015480 + ands r0, r1 + ldr r1, _08015484 + ands r0, r1 + ldr r1, _0801546C + ands r0, r1 + strh r0, [r4, 0xE] + movs r2, 0xFD + lsls r2, 2 + ldrh r1, [r6, 0x4] + movs r0, 0xFC + lsls r0, 8 + ands r0, r1 + orrs r0, r2 + ands r0, r3 + movs r2, 0xF + movs r3, 0xF0 + lsls r3, 8 + ldr r1, _08015488 + ands r0, r1 + orrs r0, r3 + strh r0, [r6, 0x4] + movs r0, 0xF0 + strh r0, [r6, 0x2] + subs r1, 0xFF + ldrh r0, [r6, 0x6] + ands r2, r0 + movs r0, 0 + orrs r2, r1 + strh r2, [r6, 0x6] + strb r0, [r4, 0x17] + mov r8, r5 + ldr r2, _0801548C + mov r10, r2 + mov r12, r8 + movs r3, 0x9C + lsls r3, 1 + mov r9, r3 + ldr r4, _08015490 + movs r3, 0 + movs r2, 0x3 +_08015438: + mov r5, r12 + ldr r1, [r5] + adds r1, r3 + add r1, r9 + adds r0, r4, 0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r3, 0x18 + subs r2, 0x1 + cmp r2, 0 + bge _08015438 + mov r6, r8 + ldr r1, [r6] + ldrb r0, [r1, 0x4] + cmp r0, 0 + beq _08015498 + movs r7, 0xA8 + lsls r7, 1 + adds r1, r7 + ldr r0, _08015494 + b _080154A0 + .align 2, 0 +_08015468: .4byte 0x0000c1ff +_0801546C: .4byte 0x00003fff +_08015470: .4byte gUnknown_203B1FC +_08015474: .4byte 0x0000feff +_08015478: .4byte 0x0000fdff +_0801547C: .4byte 0x0000f3ff +_08015480: .4byte 0x0000efff +_08015484: .4byte 0x0000dfff +_08015488: .4byte 0x00000fff +_0801548C: .4byte gUnknown_80DB550 +_08015490: .4byte gUnknown_80DB538 +_08015494: .4byte gUnknown_80DB580 +_08015498: + movs r0, 0xA8 + lsls r0, 1 + adds r1, r0 + ldr r0, _080154EC +_080154A0: + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + mov r0, r8 + ldr r1, [r0] + movs r4, 0x9C + lsls r4, 1 + adds r1, r4 + mov r0, r10 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r6,r7} + stm r1!, {r2,r6,r7} + bl sub_8004914 + mov r3, r8 + ldr r0, [r3] + adds r0, r4 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0x1 + bl sub_8015A08 + bl sub_8015C1C + bl sub_8015F84 + movs r0, 0x1 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080154EC: .4byte gUnknown_80DB568 + thumb_func_end sub_80151C0 + + thumb_func_start sub_80154F0 +sub_80154F0: + push {r4,r5,lr} + ldr r4, _08015558 + ldr r1, [r4] + ldrb r0, [r1, 0x16] + adds r0, 0x1 + strb r0, [r1, 0x16] + bl sub_80157D8 + ldr r2, [r4] + ldrb r1, [r2, 0x16] + movs r5, 0x8 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _0801551C + adds r0, r2, 0x6 + movs r1, 0x80 + lsls r1, 1 + movs r2, 0 + movs r3, 0 + bl AddSprite +_0801551C: + ldr r1, [r4] + ldrb r0, [r1, 0x17] + adds r0, 0x1 + strb r0, [r1, 0x17] + bl sub_80158BC + ldr r2, [r4] + ldrb r1, [r2, 0x17] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _08015544 + adds r0, r2, 0 + adds r0, 0xE + movs r1, 0x80 + lsls r1, 1 + movs r2, 0 + movs r3, 0 + bl AddSprite +_08015544: + bl sub_8012AE8 + subs r0, 0x1 + cmp r0, 0x5 + bhi _080155E2 + lsls r0, 2 + ldr r1, _0801555C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08015558: .4byte gUnknown_203B1FC +_0801555C: .4byte _08015560 + .align 2, 0 +_08015560: + .4byte _080155C0 + .4byte _080155C6 + .4byte _080155E2 + .4byte _080155D4 + .4byte _08015578 + .4byte _0801558C +_08015578: + ldr r0, _08015588 + ldr r1, [r0] + ldrb r0, [r1, 0x1C] + cmp r0, 0 + beq _080155B8 + subs r0, 0x1 + b _080155A8 + .align 2, 0 +_08015588: .4byte gUnknown_203B1FC +_0801558C: + ldr r5, _080155B4 + ldr r0, [r5] + ldrb r4, [r0, 0x1C] + ldrb r0, [r0, 0x1B] + subs r0, 0x1 + cmp r4, r0 + beq _080155B8 + bl sub_8015F44 + cmp r4, r0 + bge _080155B8 + ldr r1, [r5] + ldrb r0, [r1, 0x1C] + adds r0, 0x1 +_080155A8: + strb r0, [r1, 0x1C] + movs r0, 0x3 + bl sub_80119D4 + b _080155E2 + .align 2, 0 +_080155B4: .4byte gUnknown_203B1FC +_080155B8: + movs r0, 0x2 + bl sub_80119D4 + b _080155E2 +_080155C0: + bl sub_801560C + b _080155E4 +_080155C6: + bl sub_8015748 + lsls r0, 24 + cmp r0, 0 + beq _080155E2 + movs r0, 0x2 + b _080155E4 +_080155D4: + movs r0, 0x3 + bl sub_80119D4 + ldr r0, _080155EC + ldr r1, [r0] + movs r0, 0x5 + strb r0, [r1, 0x1A] +_080155E2: + movs r0, 0 +_080155E4: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080155EC: .4byte gUnknown_203B1FC + thumb_func_end sub_80154F0 + + thumb_func_start sub_80155F0 +sub_80155F0: + push {r4,lr} + ldr r4, _08015608 + ldr r0, [r4] + cmp r0, 0 + beq _08015602 + bl MemoryFree + movs r0, 0 + str r0, [r4] +_08015602: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08015608: .4byte gUnknown_203B1FC + thumb_func_end sub_80155F0 + + thumb_func_start sub_801560C +sub_801560C: + push {r4-r6,lr} + ldr r3, _08015640 + ldr r4, _08015644 + ldr r5, [r4] + ldrb r0, [r5, 0x1A] + lsls r1, r0, 1 + adds r1, r0 + ldrb r2, [r5, 0x19] + lsls r0, r2, 8 + subs r0, r2 + adds r0, r1 + lsls r0, 2 + adds r3, 0x8 + adds r0, r3 + ldr r6, [r0] + movs r0, 0x83 + lsls r0, 1 + cmp r6, r0 + beq _0801567A + cmp r6, r0 + bgt _08015648 + subs r0, 0x1 + cmp r6, r0 + beq _0801566C + b _080156BC + .align 2, 0 +_08015640: .4byte gUnknown_80DB0F8 +_08015644: .4byte gUnknown_203B1FC +_08015648: + ldr r0, _08015668 + cmp r6, r0 + bne _080156BC + movs r1, 0 + ldrb r0, [r5, 0x18] + cmp r0, 0 + bne _08015658 + movs r1, 0x1 +_08015658: + strb r1, [r5, 0x18] + movs r0, 0x4 + bl sub_80119D4 + movs r0, 0 + bl sub_8015A08 + b _0801573E + .align 2, 0 +_08015668: .4byte 0x00000107 +_0801566C: + bl sub_8015748 + lsls r0, 24 + cmp r0, 0 + beq _0801573E + movs r0, 0x2 + b _08015740 +_0801567A: + bl sub_8015F44 + cmp r0, 0 + beq _080156D4 + ldr r0, [r4] + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _08015696 + bl sub_8015F44 + ldr r1, [r4] + ldrb r1, [r1, 0x1B] + cmp r0, r1 + bne _080156D4 +_08015696: + movs r0, 0 + bl sub_80119D4 + ldr r0, _080156B8 + ldr r2, [r0] + movs r1, 0x9A + lsls r1, 1 + adds r0, r2, r1 + ldr r0, [r0] + adds r1, r2, 0 + adds r1, 0xF8 + ldr r1, [r1] + ldrb r2, [r2, 0x1B] + bl MemoryCopy8 + movs r0, 0x3 + b _08015740 + .align 2, 0 +_080156B8: .4byte gUnknown_203B1FC +_080156BC: + ldr r0, [r4] + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _080156DC + lsls r0, r6, 24 + lsrs r0, 24 + bl sub_803D0F0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _080156DC +_080156D4: + movs r0, 0x2 + bl sub_80119D4 + b _0801573E +_080156DC: + ldr r0, _08015728 + ldr r3, [r0] + ldrb r1, [r3, 0x18] + adds r4, r0, 0 + cmp r1, 0x1 + bne _0801570A + ldrb r0, [r3, 0x1B] + subs r2, r0, 0x2 + ldrb r3, [r3, 0x1C] + cmp r2, r3 + blt _0801570A + adds r3, r4, 0 +_080156F4: + ldr r0, [r3] + adds r0, 0xF8 + ldr r0, [r0] + adds r0, r2 + ldrb r1, [r0] + strb r1, [r0, 0x1] + subs r2, 0x1 + ldr r0, [r3] + ldrb r0, [r0, 0x1C] + cmp r2, r0 + bge _080156F4 +_0801570A: + ldr r0, [r4] + ldrb r1, [r0, 0x1C] + adds r0, 0xF8 + ldr r0, [r0] + adds r0, r1 + strb r6, [r0] + ldr r1, [r4] + ldrb r2, [r1, 0x1C] + ldrb r0, [r1, 0x1B] + subs r0, 0x1 + cmp r2, r0 + bge _0801572C + adds r0, r2, 0x1 + strb r0, [r1, 0x1C] + b _08015730 + .align 2, 0 +_08015728: .4byte gUnknown_203B1FC +_0801572C: + movs r0, 0x5 + strb r0, [r1, 0x1A] +_08015730: + movs r0, 0 + bl sub_80119D4 + bl sub_8015C1C + bl sub_8015F84 +_0801573E: + movs r0, 0 +_08015740: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_801560C + + thumb_func_start sub_8015748 +sub_8015748: + push {r4,lr} + ldr r4, _0801576C + ldr r2, [r4] + ldrb r1, [r2, 0x1C] + adds r0, r2, 0 + adds r0, 0xF8 + ldr r0, [r0] + adds r0, r1 + ldrb r3, [r0] + cmp r3, 0 + bne _08015790 + cmp r1, 0 + bne _08015770 + movs r0, 0x2 + bl sub_80119D4 + movs r0, 0x1 + b _080157CE + .align 2, 0 +_0801576C: .4byte gUnknown_203B1FC +_08015770: + subs r0, r1, 0x1 + strb r0, [r2, 0x1C] + ldr r0, [r4] + ldrb r1, [r0, 0x1C] + adds r0, 0xF8 + ldr r0, [r0] + adds r0, r1 + strb r3, [r0] + movs r0, 0x1 + bl sub_80119D4 + bl sub_8015C1C + bl sub_8015F84 + b _080157CC +_08015790: + bl sub_8015F44 + subs r3, r0, 0x1 + ldr r0, [r4] + ldrb r2, [r0, 0x1C] + cmp r2, r3 + bge _080157B0 +_0801579E: + ldr r0, [r4] + adds r0, 0xF8 + ldr r0, [r0] + adds r0, r2 + ldrb r1, [r0, 0x1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, r3 + blt _0801579E +_080157B0: + ldr r0, _080157D4 + ldr r0, [r0] + adds r0, 0xF8 + ldr r0, [r0] + adds r0, r3 + movs r1, 0 + strb r1, [r0] + movs r0, 0x1 + bl sub_80119D4 + bl sub_8015C1C + bl sub_8015F84 +_080157CC: + movs r0, 0 +_080157CE: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080157D4: .4byte gUnknown_203B1FC + thumb_func_end sub_8015748 + + thumb_func_start sub_80157D8 +sub_80157D8: + push {r4,r5,lr} + ldr r5, _080157EC + ldr r0, _080157F0 + ldr r0, [r0] + mov r12, r0 + ldr r0, [r0] + cmp r0, 0x4 + bne _080157F8 + ldr r3, _080157F4 + b _080157FE + .align 2, 0 +_080157EC: .4byte gUnknown_20273B8 +_080157F0: .4byte gUnknown_203B1FC +_080157F4: .4byte gUnknown_80DAFC0 +_080157F8: + cmp r0, 0x5 + bne _0801585C + ldr r3, _08015850 +_080157FE: + mov r1, r12 + ldrb r0, [r1, 0x1C] + lsls r0, 2 + adds r0, r3 + movs r2, 0 + ldrsh r1, [r0, r2] + movs r2, 0 + ldrsh r0, [r5, r2] + lsls r0, 3 + adds r1, r0 + ldr r0, _08015854 + ands r1, r0 + mov r4, r12 + adds r4, 0x6 + ldrh r2, [r4, 0x2] + movs r0, 0xFE + lsls r0, 8 + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x2] + mov r1, r12 + ldrb r0, [r1, 0x1C] + lsls r0, 2 + adds r0, r3 + movs r2, 0x2 + ldrsh r1, [r0, r2] + movs r3, 0x2 + ldrsh r0, [r5, r3] + lsls r0, 3 + adds r1, r0 + adds r1, 0x5 + ldr r0, _08015858 + ands r1, r0 + lsls r1, 4 + ldrh r2, [r4, 0x6] + movs r0, 0xF + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x6] + b _080158B0 + .align 2, 0 +_08015850: .4byte gUnknown_80DB098 +_08015854: .4byte 0x000001ff +_08015858: .4byte 0x00000fff +_0801585C: + mov r0, r12 + ldrb r1, [r0, 0x1C] + lsls r1, 1 + mov r2, r12 + adds r2, 0x1E + adds r2, r1 + adds r0, 0x8A + adds r0, r1 + movs r3, 0 + ldrsh r1, [r0, r3] + lsrs r0, r1, 31 + adds r1, r0 + asrs r1, 1 + ldrh r2, [r2] + adds r1, r2 + movs r2, 0 + ldrsh r0, [r5, r2] + lsls r0, 3 + adds r0, 0x1E + adds r1, r0 + lsls r1, 23 + lsrs r1, 23 + mov r3, r12 + adds r3, 0x6 + ldrh r2, [r3, 0x2] + movs r0, 0xFE + lsls r0, 8 + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x2] + movs r0, 0x2 + ldrsh r1, [r5, r0] + lsls r1, 3 + adds r1, 0x22 + ldr r0, _080158B8 + ands r1, r0 + lsls r1, 4 + ldrh r2, [r3, 0x6] + movs r0, 0xF + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x6] +_080158B0: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080158B8: .4byte 0x00000fff + thumb_func_end sub_80157D8 + + thumb_func_start sub_80158BC +sub_80158BC: + push {r4-r6,lr} + ldr r6, _080158D4 + bl sub_8012AE8 + cmp r0, 0x8 + beq _08015908 + cmp r0, 0x8 + bgt _080158D8 + cmp r0, 0x7 + beq _080158E2 + b _08015980 + .align 2, 0 +_080158D4: .4byte gUnknown_2027370 +_080158D8: + cmp r0, 0x9 + beq _08015930 + cmp r0, 0xA + beq _08015958 + b _08015980 +_080158E2: + ldr r4, _08015900 + ldr r3, _08015904 + ldr r2, [r3] + ldrb r0, [r2, 0x1A] + lsls r1, r0, 1 + adds r1, r0 + ldrb r2, [r2, 0x19] + lsls r0, r2, 8 + subs r0, r2 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0] + adds r5, r3, 0 + b _08015988 + .align 2, 0 +_08015900: .4byte gUnknown_80DB0F8 +_08015904: .4byte gUnknown_203B1FC +_08015908: + ldr r4, _08015928 + ldr r3, _0801592C + ldr r2, [r3] + ldrb r0, [r2, 0x1A] + lsls r1, r0, 1 + adds r1, r0 + ldrb r2, [r2, 0x19] + lsls r0, r2, 8 + subs r0, r2 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x1] + adds r5, r3, 0 + b _08015988 + .align 2, 0 +_08015928: .4byte gUnknown_80DB0F8 +_0801592C: .4byte gUnknown_203B1FC +_08015930: + ldr r4, _08015950 + ldr r3, _08015954 + ldr r2, [r3] + ldrb r0, [r2, 0x1A] + lsls r1, r0, 1 + adds r1, r0 + ldrb r2, [r2, 0x19] + lsls r0, r2, 8 + subs r0, r2 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x2] + adds r5, r3, 0 + b _08015988 + .align 2, 0 +_08015950: .4byte gUnknown_80DB0F8 +_08015954: .4byte gUnknown_203B1FC +_08015958: + ldr r4, _08015978 + ldr r3, _0801597C + ldr r2, [r3] + ldrb r0, [r2, 0x1A] + lsls r1, r0, 1 + adds r1, r0 + ldrb r2, [r2, 0x19] + lsls r0, r2, 8 + subs r0, r2 + adds r0, r1 + lsls r0, 2 + adds r0, r4 + ldrb r0, [r0, 0x3] + adds r5, r3, 0 + b _08015988 + .align 2, 0 +_08015978: .4byte gUnknown_80DB0F8 +_0801597C: .4byte gUnknown_203B1FC +_08015980: + ldr r1, _080159F8 + ldr r0, [r1] + ldrb r0, [r0, 0x1A] + adds r5, r1, 0 +_08015988: + adds r4, r5, 0 + ldr r1, [r4] + ldrb r2, [r1, 0x1A] + cmp r0, r2 + beq _080159A0 + strb r0, [r1, 0x1A] + movs r0, 0x3 + bl sub_80119D4 + ldr r1, [r4] + movs r0, 0x8 + strb r0, [r1, 0x17] +_080159A0: + ldr r3, _080159FC + ldr r4, [r5] + ldrb r0, [r4, 0x1A] + lsls r1, r0, 1 + adds r1, r0 + ldrb r2, [r4, 0x19] + lsls r0, r2, 8 + subs r0, r2 + adds r0, r1 + lsls r0, 2 + adds r0, r3 + movs r3, 0 + ldrsh r1, [r6, r3] + lsls r1, 3 + ldrb r2, [r0, 0x4] + adds r1, r2 + subs r1, 0x5 + movs r3, 0x2 + ldrsh r2, [r6, r3] + lsls r2, 3 + ldrb r0, [r0, 0x5] + adds r2, r0 + adds r2, 0x1 + ldr r0, _08015A00 + ands r1, r0 + adds r4, 0xE + ldrh r3, [r4, 0x2] + movs r0, 0xFE + lsls r0, 8 + ands r0, r3 + orrs r0, r1 + strh r0, [r4, 0x2] + ldr r0, _08015A04 + ands r2, r0 + lsls r2, 4 + ldrh r1, [r4, 0x6] + movs r0, 0xF + ands r0, r1 + orrs r0, r2 + strh r0, [r4, 0x6] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080159F8: .4byte gUnknown_203B1FC +_080159FC: .4byte gUnknown_80DB0F8 +_08015A00: .4byte 0x000001ff +_08015A04: .4byte 0x00000fff + thumb_func_end sub_80158BC + + thumb_func_start sub_8015A08 +sub_8015A08: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + movs r0, 0 + bl sub_8008C54 + movs r0, 0 + bl sub_80073B8 + ldr r3, _08015A68 + ldr r2, _08015A6C + ldr r0, [r2] + ldrb r1, [r0, 0x19] + lsls r0, r1, 8 + subs r0, r1 + lsls r0, 2 + adds r1, r3, 0 + adds r1, 0x8 + adds r0, r1 + ldr r4, [r0] + ldr r0, _08015A70 + cmp r4, r0 + bne _08015A3E + b _08015BC0 +_08015A3E: + mov r8, r2 + adds r7, r3, 0 + add r0, sp, 0x14 + mov r10, r0 + movs r6, 0 + mov r9, r6 +_08015A4A: + ldr r0, [r2] + ldrb r1, [r0, 0x19] + lsls r0, r1, 8 + subs r0, r1 + lsls r0, 2 + adds r0, r6, r0 + adds r0, r3 + ldrb r0, [r0, 0x6] + cmp r0, 0x2 + beq _08015AAA + cmp r0, 0x2 + bgt _08015A74 + cmp r0, 0x1 + beq _08015A7A + b _08015A82 + .align 2, 0 +_08015A68: .4byte gUnknown_80DB0F8 +_08015A6C: .4byte gUnknown_203B1FC +_08015A70: .4byte 0x00000109 +_08015A74: + cmp r0, 0x3 + beq _08015A7E + b _08015A82 +_08015A7A: + movs r5, 0x5 + b _08015AAC +_08015A7E: + movs r5, 0x7 + b _08015AAC +_08015A82: + movs r5, 0x7 + mov r1, r8 + ldr r0, [r1] + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _08015AAC + cmp r4, 0xFF + bgt _08015AA4 + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_803D0F0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _08015AAC + b _08015AAA +_08015AA4: + ldr r0, _08015ADC + cmp r4, r0 + bgt _08015AAC +_08015AAA: + movs r5, 0x2 +_08015AAC: + movs r0, 0x84 + lsls r0, 1 + cmp r4, r0 + beq _08015B9E + subs r0, 0x1 + cmp r4, r0 + bne _08015B04 + mov r2, r8 + ldr r0, [r2] + ldrb r2, [r0, 0x18] + cmp r2, 0 + bne _08015AE4 + ldrb r0, [r0, 0x19] + lsls r1, r0, 8 + subs r1, r0 + lsls r1, 2 + adds r1, r6, r1 + adds r1, r7 + ldrb r0, [r1, 0x4] + adds r0, 0x3 + ldrb r1, [r1, 0x5] + str r2, [sp] + ldr r2, _08015AE0 + b _08015B6A + .align 2, 0 +_08015ADC: .4byte 0x00000101 +_08015AE0: .4byte gUnknown_80DB598 +_08015AE4: + ldrb r0, [r0, 0x19] + lsls r1, r0, 8 + subs r1, r0 + lsls r1, 2 + adds r1, r6, r1 + adds r1, r7 + ldrb r0, [r1, 0x4] + adds r0, 0x3 + ldrb r1, [r1, 0x5] + mov r3, r9 + str r3, [sp] + ldr r2, _08015B00 + b _08015B6A + .align 2, 0 +_08015B00: .4byte gUnknown_80DB5A4 +_08015B04: + cmp r4, 0x20 + bne _08015B34 + add r0, sp, 0x4 + ldr r1, _08015B30 + adds r2, r5, 0 + bl sub_800D158 + mov r1, r8 + ldr r0, [r1] + ldrb r0, [r0, 0x19] + lsls r1, r0, 8 + subs r1, r0 + lsls r1, 2 + adds r1, r6, r1 + adds r1, r7 + ldrb r0, [r1, 0x4] + adds r0, 0x1 + ldrb r1, [r1, 0x5] + mov r2, r9 + str r2, [sp] + add r2, sp, 0x4 + b _08015B6A + .align 2, 0 +_08015B30: .4byte gUnknown_80DB5B0 +_08015B34: + cmp r4, 0xFF + ble _08015B7C + ldr r1, _08015B74 + movs r0, 0xFF + ands r4, r0 + lsls r0, r4, 2 + adds r0, r1 + ldr r3, [r0] + mov r0, r10 + ldr r1, _08015B78 + adds r2, r5, 0 + bl sub_800D158 + mov r3, r8 + ldr r0, [r3] + ldrb r0, [r0, 0x19] + lsls r1, r0, 8 + subs r1, r0 + lsls r1, 2 + adds r1, r6, r1 + adds r1, r7 + ldrb r0, [r1, 0x4] + adds r0, 0x3 + ldrb r1, [r1, 0x5] + mov r2, r9 + str r2, [sp] + mov r2, r10 +_08015B6A: + movs r3, 0 + bl xxx_call_draw_string + b _08015B9E + .align 2, 0 +_08015B74: .4byte gUnknown_80DB4F4 +_08015B78: .4byte gUnknown_80DB5B8 +_08015B7C: + mov r3, r8 + ldr r0, [r3] + ldrb r0, [r0, 0x19] + lsls r1, r0, 8 + subs r1, r0 + lsls r1, 2 + adds r1, r6, r1 + adds r1, r7 + ldrb r0, [r1, 0x4] + ldrb r1, [r1, 0x5] + lsls r2, r4, 24 + lsrs r2, 24 + mov r3, r9 + str r3, [sp] + adds r3, r5, 0 + bl sub_8012C60 +_08015B9E: + adds r6, 0xC + ldr r3, _08015C10 + ldr r2, _08015C14 + ldr r0, [r2] + ldrb r1, [r0, 0x19] + lsls r0, r1, 8 + subs r0, r1 + lsls r0, 2 + adds r0, r6, r0 + adds r1, r3, 0 + adds r1, 0x8 + adds r0, r1 + ldr r4, [r0] + ldr r0, _08015C18 + cmp r4, r0 + beq _08015BC0 + b _08015A4A +_08015BC0: + movs r4, 0xE + str r4, [sp] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0xE0 + bl sub_800792C + str r4, [sp] + movs r0, 0 + movs r1, 0 + movs r2, 0x47 + movs r3, 0xE0 + bl sub_800792C + str r4, [sp] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x48 + bl sub_8007A78 + str r4, [sp] + movs r0, 0 + movs r1, 0xDF + movs r2, 0 + movs r3, 0x48 + bl sub_8007A78 + movs r0, 0 + bl sub_80073E0 + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08015C10: .4byte gUnknown_80DB0F8 +_08015C14: .4byte gUnknown_203B1FC +_08015C18: .4byte 0x00000109 + thumb_func_end sub_8015A08 + + thumb_func_start sub_8015C1C +sub_8015C1C: + push {r4,r5,lr} + sub sp, 0x54 + movs r0, 0x1 + bl sub_8008C54 + movs r0, 0x1 + bl sub_80073B8 + ldr r0, _08015C74 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _08015C78 + movs r4, 0xE + str r4, [sp] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0xE0 + bl sub_800792C + str r4, [sp] + movs r0, 0x1 + movs r1, 0 + movs r2, 0x37 + movs r3, 0xE0 + bl sub_800792C + str r4, [sp] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0x38 + bl sub_8007A78 + str r4, [sp] + movs r0, 0x1 + movs r1, 0xDF + movs r2, 0 + movs r3, 0x38 + bl sub_8007A78 + b _08015CB2 + .align 2, 0 +_08015C74: .4byte gUnknown_203B1FC +_08015C78: + movs r4, 0xE + str r4, [sp] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0xB0 + bl sub_800792C + str r4, [sp] + movs r0, 0x1 + movs r1, 0 + movs r2, 0x27 + movs r3, 0xB0 + bl sub_800792C + str r4, [sp] + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0x28 + bl sub_8007A78 + str r4, [sp] + movs r0, 0x1 + movs r1, 0xAF + movs r2, 0 + movs r3, 0x28 + bl sub_8007A78 +_08015CB2: + ldr r0, _08015CC8 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0x5 + bhi _08015D50 + lsls r0, 2 + ldr r1, _08015CCC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08015CC8: .4byte gUnknown_203B1FC +_08015CCC: .4byte _08015CD0 + .align 2, 0 +_08015CD0: + .4byte _08015CE8 + .4byte _08015D18 + .4byte _08015CF8 + .4byte _08015D08 + .4byte _08015D28 + .4byte _08015D40 +_08015CE8: + ldr r2, _08015CF4 + movs r0, 0 + str r0, [sp] + movs r0, 0x8 + movs r1, 0x5 + b _08015D32 + .align 2, 0 +_08015CF4: .4byte gUnknown_80DB5C0 +_08015CF8: + ldr r2, _08015D04 + movs r0, 0 + str r0, [sp] + movs r0, 0x8 + movs r1, 0x5 + b _08015D32 + .align 2, 0 +_08015D04: .4byte gUnknown_80DB5D4 +_08015D08: + ldr r2, _08015D14 + movs r0, 0 + str r0, [sp] + movs r0, 0x8 + movs r1, 0x5 + b _08015D32 + .align 2, 0 +_08015D14: .4byte gUnknown_80DB5F8 +_08015D18: + ldr r2, _08015D24 + movs r0, 0 + str r0, [sp] + movs r0, 0x8 + movs r1, 0x5 + b _08015D32 + .align 2, 0 +_08015D24: .4byte gUnknown_80DB61C +_08015D28: + ldr r2, _08015D3C + movs r0, 0 + str r0, [sp] + movs r0, 0x36 + movs r1, 0x2 +_08015D32: + movs r3, 0x1 + bl xxx_call_draw_string + b _08015D50 + .align 2, 0 +_08015D3C: .4byte gUnknown_80DB638 +_08015D40: + ldr r2, _08015D64 + movs r0, 0 + str r0, [sp] + movs r0, 0x30 + movs r1, 0x4 + movs r3, 0x1 + bl xxx_call_draw_string +_08015D50: + ldr r5, _08015D68 + ldr r0, [r5] + ldr r1, [r0] + cmp r1, 0x4 + beq _08015D6C + cmp r1, 0x4 + bcc _08015D88 + cmp r1, 0x5 + beq _08015D7A + b _08015DFE + .align 2, 0 +_08015D64: .4byte gUnknown_80DB638 +_08015D68: .4byte gUnknown_203B1FC +_08015D6C: + adds r0, 0xF8 + ldr r0, [r0] + movs r1, 0x1 + movs r2, 0 + bl sub_8015E10 + b _08015DFE +_08015D7A: + adds r0, 0xF8 + ldr r0, [r0] + movs r1, 0x1 + movs r2, 0 + bl sub_8015EB4 + b _08015DFE +_08015D88: + bl sub_8016028 + adds r3, r0, 0 + movs r0, 0x4 + str r0, [sp] + movs r0, 0x1 + movs r1, 0x26 + movs r2, 0x21 + bl sub_80078A4 + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0xF8 + ldr r0, [r0] + ldrb r1, [r1, 0x1B] + bl sub_8015FEC + adds r4, r0, 0 + bl sub_8016028 + cmp r4, r0 + ble _08015DC0 + ldr r1, _08015DBC + ldr r0, [r5] + b _08015DD0 + .align 2, 0 +_08015DBC: .4byte gUnknown_80DB654 +_08015DC0: + bl sub_8015F44 + ldr r2, [r5] + ldrb r1, [r2, 0x1B] + cmp r0, r1 + bne _08015DE0 + ldr r1, _08015DDC + adds r0, r2, 0 +_08015DD0: + adds r0, 0xF8 + ldr r2, [r0] + add r0, sp, 0x4 + bl sub_800D158 + b _08015DEE + .align 2, 0 +_08015DDC: .4byte gUnknown_80DB65C +_08015DE0: + ldr r1, _08015E0C + adds r0, r2, 0 + adds r0, 0xF8 + ldr r2, [r0] + add r0, sp, 0x4 + bl sub_800D158 +_08015DEE: + movs r0, 0 + str r0, [sp] + movs r0, 0x26 + movs r1, 0x16 + add r2, sp, 0x4 + movs r3, 0x1 + bl xxx_call_draw_string +_08015DFE: + movs r0, 0x1 + bl sub_80073E0 + add sp, 0x54 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08015E0C: .4byte gUnknown_80DB664 + thumb_func_end sub_8015C1C + + thumb_func_start sub_8015E10 +sub_8015E10: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + mov r8, r0 + adds r7, r1, 0 + lsls r2, 16 + asrs r6, r2, 16 + ldr r5, _08015EB0 + movs r4, 0x35 +_08015E24: + movs r0, 0 + ldrsh r1, [r5, r0] + movs r0, 0x2 + ldrsh r2, [r5, r0] + adds r0, r6, 0 + adds r0, 0xB + adds r2, r0 + movs r0, 0x5 + str r0, [sp] + adds r0, r7, 0 + movs r3, 0xB + bl sub_80078A4 + adds r5, 0x4 + subs r4, 0x1 + cmp r4, 0 + bge _08015E24 + movs r4, 0 + mov r1, r8 + ldrb r0, [r1] + cmp r0, 0 + beq _08015EA4 + mov r5, r8 +_08015E52: + movs r3, 0x7 + cmp r4, 0x4 + ble _08015E7E + movs r3, 0x6 + cmp r4, 0xC + ble _08015E7E + movs r3, 0x7 + cmp r4, 0x11 + ble _08015E7E + cmp r4, 0x16 + ble _08015E7E + movs r3, 0x6 + cmp r4, 0x1E + ble _08015E7E + movs r3, 0x7 + cmp r4, 0x23 + ble _08015E7E + cmp r4, 0x28 + ble _08015E7E + cmp r4, 0x30 + bgt _08015E7E + movs r3, 0x6 +_08015E7E: + ldr r0, _08015EB0 + lsls r1, r4, 2 + adds r1, r0 + movs r2, 0 + ldrsh r0, [r1, r2] + movs r2, 0x2 + ldrsh r1, [r1, r2] + adds r1, r6 + ldrb r2, [r5] + str r7, [sp] + bl sub_8012C60 + adds r5, 0x1 + adds r4, 0x1 + cmp r4, 0x35 + bgt _08015EA4 + ldrb r0, [r5] + cmp r0, 0 + bne _08015E52 +_08015EA4: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08015EB0: .4byte gUnknown_80DAFC0 + thumb_func_end sub_8015E10 + + thumb_func_start sub_8015EB4 +sub_8015EB4: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + mov r8, r0 + adds r7, r1, 0 + lsls r2, 16 + asrs r6, r2, 16 + ldr r5, _08015F40 + movs r4, 0x17 +_08015EC8: + movs r0, 0 + ldrsh r1, [r5, r0] + movs r0, 0x2 + ldrsh r2, [r5, r0] + adds r0, r6, 0 + adds r0, 0xB + adds r2, r0 + movs r0, 0x5 + str r0, [sp] + adds r0, r7, 0 + movs r3, 0xC + bl sub_80078A4 + adds r5, 0x4 + subs r4, 0x1 + cmp r4, 0 + bge _08015EC8 + movs r4, 0 + mov r1, r8 + ldrb r0, [r1] + cmp r0, 0 + beq _08015F34 + mov r5, r8 +_08015EF6: + movs r3, 0x7 + cmp r4, 0x3 + ble _08015F0E + movs r3, 0x6 + cmp r4, 0x7 + ble _08015F0E + movs r3, 0x7 + cmp r4, 0xF + ble _08015F0E + cmp r4, 0x13 + bgt _08015F0E + movs r3, 0x6 +_08015F0E: + ldr r0, _08015F40 + lsls r1, r4, 2 + adds r1, r0 + movs r2, 0 + ldrsh r0, [r1, r2] + movs r2, 0x2 + ldrsh r1, [r1, r2] + adds r1, r6 + ldrb r2, [r5] + str r7, [sp] + bl sub_8012C60 + adds r5, 0x1 + adds r4, 0x1 + cmp r4, 0x17 + bgt _08015F34 + ldrb r0, [r5] + cmp r0, 0 + bne _08015EF6 +_08015F34: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08015F40: .4byte gUnknown_80DB098 + thumb_func_end sub_8015EB4 + + thumb_func_start sub_8015F44 +sub_8015F44: + push {r4,lr} + movs r2, 0 + ldr r0, _08015F78 + ldr r0, [r0] + ldrb r4, [r0, 0x1B] + cmp r2, r4 + bge _08015F7C + adds r3, r0, 0 + adds r3, 0xF8 + ldr r0, [r3] + ldrb r0, [r0] + cmp r0, 0 + beq _08015F7C + movs r2, 0x1 + movs r1, 0x1 +_08015F62: + cmp r1, r4 + bge _08015F7C + ldr r0, [r3] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08015F7C + adds r2, r1, 0x1 + adds r1, r2, 0 + b _08015F62 + .align 2, 0 +_08015F78: .4byte gUnknown_203B1FC +_08015F7C: + adds r0, r2, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8015F44 + + thumb_func_start sub_8015F84 +sub_8015F84: + push {r4-r7,lr} + movs r6, 0 + movs r5, 0 + ldr r3, _08015FBC + ldr r0, [r3] + ldrb r0, [r0, 0x1B] + cmp r5, r0 + bge _08015FE4 + adds r7, r3, 0 +_08015F96: + ldr r1, [r7] + lsls r4, r5, 1 + adds r0, r1, 0 + adds r0, 0x1E + adds r0, r4 + strh r6, [r0] + adds r0, r1, 0 + adds r0, 0xF8 + ldr r0, [r0] + adds r2, r0, r5 + ldrb r0, [r2] + cmp r0, 0 + bne _08015FC0 + adds r0, r1, 0 + adds r0, 0x8A + adds r0, r4 + movs r1, 0x8 + strh r1, [r0] + b _08015FE4 + .align 2, 0 +_08015FBC: .4byte gUnknown_203B1FC +_08015FC0: + ldrb r0, [r2] + bl sub_8092288 + bl sub_8008584 + ldr r3, [r7] + adds r1, r3, 0 + adds r1, 0x8A + adds r1, r4 + ldrh r2, [r0, 0x6] + strh r2, [r1] + movs r1, 0x6 + ldrsh r0, [r0, r1] + adds r6, r0 + adds r5, 0x1 + ldrb r3, [r3, 0x1B] + cmp r5, r3 + blt _08015F96 +_08015FE4: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8015F84 + + thumb_func_start sub_8015FEC +sub_8015FEC: + push {r4-r7,lr} + adds r2, r0, 0 + adds r5, r1, 0 + movs r7, 0 + movs r6, 0 + cmp r7, r5 + bge _08016020 + ldrb r0, [r2] + cmp r0, 0 + beq _08016020 + adds r4, r2, 0 +_08016002: + ldrb r0, [r4] + bl sub_8092288 + bl sub_8008584 + movs r1, 0x6 + ldrsh r0, [r0, r1] + adds r7, r0 + adds r4, 0x1 + adds r6, 0x1 + cmp r6, r5 + bge _08016020 + ldrb r0, [r4] + cmp r0, 0 + bne _08016002 +_08016020: + adds r0, r7, 0 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8015FEC + + thumb_func_start sub_8016028 +sub_8016028: + movs r0, 0x3C + bx lr + thumb_func_end sub_8016028 + + thumb_func_start sub_801602C +sub_801602C: + push {r4-r6,lr} + adds r6, r0, 0 + adds r5, r1, 0 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r4, _08016064 + movs r0, 0x50 + movs r1, 0x8 + bl MemoryAlloc + adds r1, r0, 0 + str r1, [r4] + str r6, [r1] + str r5, [r1, 0x8] + cmp r6, 0x1 + beq _0801606E + cmp r6, 0x1 + bcc _08016068 + cmp r6, 0x2 + beq _0801606E + cmp r6, 0x3 + beq _0801606E + b _08016070 + .align 2, 0 +_08016064: .4byte gUnknown_203B200 +_08016068: + movs r0, 0 + str r0, [r1, 0x4] + b _08016070 +_0801606E: + str r6, [r1, 0x4] +_08016070: + movs r0, 0 + bl sub_80160F4 + movs r0, 0x1 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_801602C + + thumb_func_start sub_8016080 +sub_8016080: + push {lr} + ldr r0, _08016098 + ldr r0, [r0] + ldr r0, [r0, 0xC] + cmp r0, 0x4 + bhi _080160D0 + lsls r0, 2 + ldr r1, _0801609C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08016098: .4byte gUnknown_203B200 +_0801609C: .4byte _080160A0 + .align 2, 0 +_080160A0: + .4byte _080160B4 + .4byte _080160BA + .4byte _080160C0 + .4byte _080160C6 + .4byte _080160CC +_080160B4: + bl sub_80161F8 + b _080160D0 +_080160BA: + bl sub_8016248 + b _080160D0 +_080160C0: + bl sub_8016280 + b _080160D0 +_080160C6: + bl sub_801629C + b _080160D0 +_080160CC: + movs r0, 0x3 + b _080160D2 +_080160D0: + movs r0, 0 +_080160D2: + pop {r1} + bx r1 + thumb_func_end sub_8016080 + + thumb_func_start sub_80160D8 +sub_80160D8: + push {r4,lr} + ldr r4, _080160F0 + ldr r0, [r4] + cmp r0, 0 + beq _080160EA + bl MemoryFree + movs r0, 0 + str r0, [r4] +_080160EA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080160F0: .4byte gUnknown_203B200 + thumb_func_end sub_80160D8 + + thumb_func_start sub_80160F4 +sub_80160F4: + push {lr} + ldr r1, _08016108 + ldr r1, [r1] + str r0, [r1, 0xC] + bl nullsub_36 + bl sub_8016110 + pop {r0} + bx r0 + .align 2, 0 +_08016108: .4byte gUnknown_203B200 + thumb_func_end sub_80160F4 + + thumb_func_start nullsub_36 +nullsub_36: + bx lr + thumb_func_end nullsub_36 + + thumb_func_start sub_8016110 +sub_8016110: + push {r4,lr} + sub sp, 0x14 + ldr r4, _08016128 + ldr r1, [r4] + ldr r0, [r1, 0xC] + cmp r0, 0x1 + beq _08016140 + cmp r0, 0x1 + bgt _0801612C + cmp r0, 0 + beq _08016136 + b _080161B8 + .align 2, 0 +_08016128: .4byte gUnknown_203B200 +_0801612C: + cmp r0, 0x2 + beq _08016194 + cmp r0, 0x3 + beq _080161AC + b _080161B8 +_08016136: + ldr r0, [r1, 0x4] + ldr r1, [r1, 0x8] + bl sub_80151C0 + b _080161B8 +_08016140: + bl sub_80161C8 + ldr r1, [r4] + ldr r0, [r1, 0x4] + cmp r0, 0x1 + bne _0801615C + ldr r0, _08016158 + ldr r1, [r1, 0x8] + movs r2, 0xA + bl sub_80922B4 + b _08016166 + .align 2, 0 +_08016158: .4byte gUnknown_202DF98 +_0801615C: + ldr r0, _08016188 + ldr r1, [r1, 0x8] + movs r2, 0xA + bl sub_80922B4 +_08016166: + ldr r0, _0801618C + ldr r1, _08016190 + ldr r3, [r1] + adds r3, 0x10 + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + str r2, [sp, 0xC] + movs r1, 0x20 + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0x3 + bl sub_8014248 + b _080161B8 + .align 2, 0 +_08016188: .4byte gUnknown_202DF98 +_0801618C: .4byte gUnknown_80DB688 +_08016190: .4byte gUnknown_203B200 +_08016194: + ldr r0, _080161A4 + ldr r3, _080161A8 + movs r1, 0 + movs r2, 0 + bl sub_80141B4 + b _080161B8 + .align 2, 0 +_080161A4: .4byte gUnknown_80DB6A4 +_080161A8: .4byte 0x00000121 +_080161AC: + ldr r0, _080161C0 + ldr r3, _080161C4 + movs r1, 0 + movs r2, 0 + bl sub_80141B4 +_080161B8: + add sp, 0x14 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080161C0: .4byte gUnknown_80DB6BC +_080161C4: .4byte 0x00000121 + thumb_func_end sub_8016110 + + thumb_func_start sub_80161C8 +sub_80161C8: + ldr r0, _080161EC + ldr r1, [r0] + ldr r0, _080161F0 + ldr r0, [r0] + str r0, [r1, 0x10] + movs r0, 0x2 + str r0, [r1, 0x14] + ldr r0, _080161F4 + ldr r0, [r0] + str r0, [r1, 0x18] + movs r0, 0x3 + str r0, [r1, 0x1C] + movs r0, 0 + str r0, [r1, 0x20] + movs r0, 0x1 + str r0, [r1, 0x24] + bx lr + .align 2, 0 +_080161EC: .4byte gUnknown_203B200 +_080161F0: .4byte gUnknown_80D4920 +_080161F4: .4byte gUnknown_80D4928 + thumb_func_end sub_80161C8 + + thumb_func_start sub_80161F8 +sub_80161F8: + push {r4,lr} + bl sub_80154F0 + cmp r0, 0x3 + bne _08016242 + bl sub_80155F0 + bl sub_80162B8 + lsls r0, 24 + cmp r0, 0 + beq _08016218 + movs r0, 0x3 + bl sub_80160F4 + b _08016242 +_08016218: + ldr r0, _08016238 + ldr r0, [r0] + ldr r0, [r0, 0x8] + movs r1, 0xA + bl sub_8015FEC + adds r4, r0, 0 + bl sub_8016028 + cmp r4, r0 + ble _0801623C + movs r0, 0x2 + bl sub_80160F4 + b _08016242 + .align 2, 0 +_08016238: .4byte gUnknown_203B200 +_0801623C: + movs r0, 0x1 + bl sub_80160F4 +_08016242: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80161F8 + + thumb_func_start sub_8016248 +sub_8016248: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0801627A + ldr r0, [sp] + cmp r0, 0x2 + beq _0801626C + cmp r0, 0x2 + bgt _08016266 + cmp r0, 0x1 + beq _08016274 + b _0801627A +_08016266: + cmp r0, 0x3 + beq _08016274 + b _0801627A +_0801626C: + movs r0, 0x4 + bl sub_80160F4 + b _0801627A +_08016274: + movs r0, 0 + bl sub_80160F4 +_0801627A: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8016248 + + thumb_func_start sub_8016280 +sub_8016280: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08016294 + movs r0, 0 + bl sub_80160F4 +_08016294: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8016280 + + thumb_func_start sub_801629C +sub_801629C: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080162B0 + movs r0, 0 + bl sub_80160F4 +_080162B0: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_801629C + + thumb_func_start sub_80162B8 +sub_80162B8: + push {lr} + movs r3, 0xA + movs r1, 0 + ldr r0, _080162D4 + ldr r0, [r0] + ldr r2, [r0, 0x8] +_080162C4: + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080162DE + cmp r0, 0x20 + beq _080162D8 + movs r0, 0 + b _080162E0 + .align 2, 0 +_080162D4: .4byte gUnknown_203B200 +_080162D8: + adds r1, 0x1 + cmp r1, r3 + blt _080162C4 +_080162DE: + movs r0, 0x1 +_080162E0: + pop {r1} + bx r1 + thumb_func_end sub_80162B8 + + thumb_func_start sub_80162E4 +sub_80162E4: + push {r4-r6,lr} + adds r4, r0, 0 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r5, _0801633C + movs r0, 0x84 + lsls r0, 1 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] + movs r6, 0 + str r6, [r0, 0x10] + str r4, [r0] + ldr r0, _08016340 + movs r1, 0x35 + bl sub_808D8E0 + ldr r4, _08016344 + adds r0, r4, 0 + movs r1, 0x35 + bl sub_808D8E0 + movs r0, 0x35 + bl sub_808D994 + adds r1, r0, 0 + subs r4, 0x50 + adds r0, r4, 0 + bl strcpy + ldr r5, [r5] + ldr r0, [r5] + cmp r0, 0x1 + bne _08016348 + adds r0, r5, 0 + adds r0, 0xA4 + str r6, [r0] + b _08016352 + .align 2, 0 +_0801633C: .4byte gUnknown_203B204 +_08016340: .4byte gUnknown_202E5D8 +_08016344: .4byte gUnknown_202E1C8 +_08016348: + adds r1, r5, 0 + adds r1, 0xA4 + adds r0, r5, 0 + adds r0, 0x94 + str r0, [r1] +_08016352: + movs r0, 0x35 + bl sub_808DDD0 + ldr r2, _0801639C + ldr r3, [r2] + adds r1, r3, 0 + adds r1, 0x94 + str r0, [r1] + adds r1, 0x4 + ldr r0, [r0, 0x4] + str r0, [r1] + adds r0, r3, 0 + adds r0, 0xA0 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0xA1 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0xA2 + strb r1, [r0] + ldr r1, [r2] + adds r2, r1, 0 + adds r2, 0x9C + movs r0, 0x2 + strh r0, [r2] + adds r1, 0x9E + movs r0, 0x8 + strh r0, [r1] + movs r0, 0 + bl sub_8016444 + movs r0, 0x1 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0801639C: .4byte gUnknown_203B204 + thumb_func_end sub_80162E4 + + thumb_func_start sub_80163A0 +sub_80163A0: + push {lr} + ldr r0, _080163B8 + ldr r0, [r0] + ldr r0, [r0, 0x4] + cmp r0, 0xC + bhi _08016410 + lsls r0, 2 + ldr r1, _080163BC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080163B8: .4byte gUnknown_203B204 +_080163BC: .4byte _080163C0 + .align 2, 0 +_080163C0: + .4byte _08016410 + .4byte _080163F4 + .4byte _080163FA + .4byte _08016410 + .4byte _08016410 + .4byte _08016410 + .4byte _0801640C + .4byte _08016410 + .4byte _08016400 + .4byte _08016410 + .4byte _08016410 + .4byte _08016406 + .4byte _08016410 +_080163F4: + bl sub_8016B24 + b _08016414 +_080163FA: + bl sub_80169BC + b _08016414 +_08016400: + bl sub_8016A18 + b _08016414 +_08016406: + bl sub_8016A8C + b _08016414 +_0801640C: + movs r0, 0x3 + b _08016416 +_08016410: + bl sub_8016B00 +_08016414: + movs r0, 0 +_08016416: + pop {r1} + bx r1 + thumb_func_end sub_80163A0 + + thumb_func_start sub_801641C +sub_801641C: + push {r4,lr} + ldr r4, _08016440 + ldr r0, [r4] + cmp r0, 0 + beq _08016438 + adds r0, 0x94 + ldr r0, [r0] + bl sub_800AA14 + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_08016438: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08016440: .4byte gUnknown_203B204 + thumb_func_end sub_801641C + + thumb_func_start sub_8016444 +sub_8016444: + push {lr} + ldr r1, _08016458 + ldr r1, [r1] + str r0, [r1, 0x4] + bl sub_801645C + bl sub_801653C + pop {r0} + bx r0 + .align 2, 0 +_08016458: .4byte gUnknown_203B204 + thumb_func_end sub_8016444 + + thumb_func_start sub_801645C +sub_801645C: + push {r4-r7,lr} + ldr r4, _0801647C + ldr r0, [r4] + adds r0, 0xA8 + bl sub_8006518 + ldr r0, [r4] + ldr r1, [r0, 0x4] + cmp r1, 0x8 + beq _080164AC + cmp r1, 0x8 + bgt _08016480 + cmp r1, 0x2 + beq _08016486 + b _080164F8 + .align 2, 0 +_0801647C: .4byte gUnknown_203B204 +_08016480: + cmp r1, 0xB + beq _080164AC + b _080164F8 +_08016486: + adds r0, 0xA8 + movs r1, 0x80 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0xC0 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0xD8 + strb r1, [r0] + ldr r1, [r4] + adds r1, 0xF0 + ldr r0, _080164A8 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r6,r7} + stm r1!, {r2,r6,r7} + b _080164D8 + .align 2, 0 +_080164A8: .4byte gUnknown_80DB6F4 +_080164AC: + ldr r4, _080164EC + ldr r0, [r4] + adds r0, 0xA8 + movs r1, 0x80 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0xC0 + strb r1, [r0] + ldr r1, [r4] + adds r1, 0xF0 + ldr r0, _080164F0 + ldm r0!, {r3,r5,r6} + stm r1!, {r3,r5,r6} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldr r1, [r4] + adds r1, 0xD8 + ldr r0, _080164F4 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} +_080164D8: + bl sub_8004914 + ldr r0, [r4] + adds r0, 0xA8 + movs r1, 0x1 + movs r2, 0 + bl sub_800641C + b _0801652E + .align 2, 0 +_080164EC: .4byte gUnknown_203B204 +_080164F0: .4byte gUnknown_80DB6F4 +_080164F4: .4byte gUnknown_80DB70C +_080164F8: + ldr r6, _08016534 + mov r12, r6 + ldr r4, _08016538 + movs r3, 0 + movs r2, 0x3 +_08016502: + mov r7, r12 + ldr r1, [r7] + adds r1, r3 + adds r1, 0xA8 + adds r0, r4, 0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r3, 0x18 + subs r2, 0x1 + cmp r2, 0 + bge _08016502 + bl sub_8004914 + ldr r0, _08016534 + ldr r0, [r0] + adds r0, 0xA8 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C +_0801652E: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08016534: .4byte gUnknown_203B204 +_08016538: .4byte gUnknown_80DB6DC + thumb_func_end sub_801645C + + thumb_func_start sub_801653C +sub_801653C: + push {r4,r5,lr} + sub sp, 0x14 + ldr r1, _08016558 + ldr r0, [r1] + ldr r0, [r0, 0x4] + adds r2, r1, 0 + cmp r0, 0xC + bls _0801654E + b _080168EC +_0801654E: + lsls r0, 2 + ldr r1, _0801655C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08016558: .4byte gUnknown_203B204 +_0801655C: .4byte _08016560 + .align 2, 0 +_08016560: + .4byte _08016594 + .4byte _080165B4 + .4byte _080168B2 + .4byte _08016650 + .4byte _08016668 + .4byte _080166C4 + .4byte _080168EC + .4byte _080166DC + .4byte _0801674C + .4byte _080167A8 + .4byte _080167CC + .4byte _0801685C + .4byte _080168C4 +_08016594: + ldr r2, [r2] + movs r0, 0x1 + str r0, [r2, 0x8] + ldr r3, _080165B0 + ldr r1, [r2] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] + adds r2, 0xA4 + ldr r2, [r2] + b _08016844 + .align 2, 0 +_080165B0: .4byte gUnknown_80D49E0 +_080165B4: + bl sub_8016900 + ldr r0, _080165FC + ldr r0, [r0] + mov r12, r0 + movs r0, 0x2 + mov r1, r12 + str r0, [r1, 0x8] + ldr r0, _08016600 + ldr r0, [r0] + movs r3, 0x99 + lsls r3, 2 + adds r0, r3 + ldr r4, [r0] + cmp r4, 0 + bne _08016608 + ldr r2, _08016604 + ldr r1, [r1] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 2 + adds r2, 0x4 + adds r0, r2 + ldr r0, [r0] + mov r5, r12 + ldr r2, [r5, 0x10] + mov r3, r12 + adds r3, 0x14 + mov r1, r12 + adds r1, 0x54 + str r1, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r4, [sp, 0x8] + b _08016632 + .align 2, 0 +_080165FC: .4byte gUnknown_203B204 +_08016600: .4byte gUnknown_203B460 +_08016604: .4byte gUnknown_80D49E0 +_08016608: + ldr r0, _08016648 + str r4, [r0] + ldr r2, _0801664C + mov r0, r12 + ldr r1, [r0] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 2 + adds r2, 0x8 + adds r0, r2 + ldr r0, [r0] + mov r1, r12 + ldr r2, [r1, 0x10] + mov r3, r12 + adds r3, 0x14 + adds r1, 0x54 + str r1, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] +_08016632: + mov r1, r12 + adds r1, 0xA4 + ldr r1, [r1] + str r1, [sp, 0xC] + movs r1, 0xC + str r1, [sp, 0x10] + movs r1, 0 + bl sub_8014248 + b _080168EC + .align 2, 0 +_08016648: .4byte gUnknown_202DE30 +_0801664C: .4byte gUnknown_80D49E0 +_08016650: + ldr r3, [r2] + movs r0, 0x1 + str r0, [r3, 0x8] + ldr r2, _08016664 + ldr r1, [r3] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 2 + adds r2, 0x38 + b _0801683C + .align 2, 0 +_08016664: .4byte gUnknown_80D49E0 +_08016668: + ldr r3, [r2] + movs r0, 0x6 + str r0, [r3, 0x8] + ldr r0, _08016698 + ldr r0, [r0] + movs r5, 0x99 + lsls r5, 2 + adds r0, r5 + ldr r1, [r0] + cmp r1, 0 + bne _080166A0 + ldr r2, _0801669C + ldr r1, [r3] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 2 + adds r2, 0x10 + adds r0, r2 + ldr r0, [r0] + adds r1, r3, 0 + adds r1, 0xA4 + ldr r2, [r1] + b _08016844 + .align 2, 0 +_08016698: .4byte gUnknown_203B460 +_0801669C: .4byte gUnknown_80D49E0 +_080166A0: + ldr r0, _080166BC + str r1, [r0] + ldr r2, _080166C0 + ldr r1, [r3] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 2 + adds r2, 0x14 + adds r0, r2 + ldr r0, [r0] + adds r1, r3, 0 + adds r1, 0xA4 + ldr r2, [r1] + b _08016844 + .align 2, 0 +_080166BC: .4byte gUnknown_202DE30 +_080166C0: .4byte gUnknown_80D49E0 +_080166C4: + ldr r3, [r2] + movs r0, 0x1 + str r0, [r3, 0x8] + ldr r2, _080166D8 + ldr r1, [r3] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 2 + adds r2, 0xC + b _0801683C + .align 2, 0 +_080166D8: .4byte gUnknown_80D49E0 +_080166DC: + ldr r0, _08016700 + ldr r1, [r0] + movs r3, 0x98 + lsls r3, 2 + adds r0, r1, r3 + ldr r0, [r0] + cmp r0, 0 + bne _08016708 + ldr r3, [r2] + movs r0, 0x1 + str r0, [r3, 0x8] + ldr r2, _08016704 + ldr r1, [r3] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 2 + adds r2, 0x1C + b _0801683C + .align 2, 0 +_08016700: .4byte gUnknown_203B460 +_08016704: .4byte gUnknown_80D49E0 +_08016708: + movs r5, 0x99 + lsls r5, 2 + adds r0, r1, r5 + ldr r1, [r0] + ldr r0, _0801672C + cmp r1, r0 + ble _08016734 + ldr r3, [r2] + movs r0, 0x1 + str r0, [r3, 0x8] + ldr r2, _08016730 + ldr r1, [r3] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 2 + adds r2, 0x20 + b _0801683C + .align 2, 0 +_0801672C: .4byte 0x0098967e +_08016730: .4byte gUnknown_80D49E0 +_08016734: + ldr r3, [r2] + movs r0, 0x8 + str r0, [r3, 0x8] + ldr r2, _08016748 + ldr r1, [r3] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 2 + adds r2, 0x18 + b _0801683C + .align 2, 0 +_08016748: .4byte gUnknown_80D49E0 +_0801674C: + ldr r4, [r2] + ldr r0, _080167A0 + ldr r3, [r0] + movs r1, 0x99 + lsls r1, 2 + adds r0, r3, r1 + ldr r1, [r0] + ldr r0, _080167A4 + subs r0, r1 + str r0, [r4, 0x70] + movs r5, 0x98 + lsls r5, 2 + adds r1, r3, r5 + ldr r1, [r1] + cmp r0, r1 + ble _0801676E + str r1, [r4, 0x70] +_0801676E: + ldr r2, [r2] + ldr r0, [r2, 0x70] + str r0, [r2, 0x68] + movs r0, 0x1 + str r0, [r2, 0x6C] + movs r0, 0x5 + str r0, [r2, 0x74] + movs r0, 0x2 + str r0, [r2, 0x78] + adds r0, r2, 0 + adds r0, 0xD8 + str r0, [r2, 0x7C] + adds r1, r2, 0 + adds r1, 0x80 + movs r0, 0x50 + str r0, [r1] + adds r1, 0x4 + movs r0, 0x12 + str r0, [r1] + adds r0, r2, 0 + adds r0, 0x64 + bl sub_8013AA0 + movs r0, 0x1 + b _080168AE + .align 2, 0 +_080167A0: .4byte gUnknown_203B460 +_080167A4: .4byte 0x0098967f +_080167A8: + ldr r3, [r2] + movs r0, 0x1 + str r0, [r3, 0x8] + ldr r1, _080167C4 + ldr r0, [r3, 0xC] + str r0, [r1] + ldr r2, _080167C8 + ldr r1, [r3] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 2 + adds r2, 0x24 + b _0801683C + .align 2, 0 +_080167C4: .4byte gUnknown_202DE30 +_080167C8: .4byte gUnknown_80D49E0 +_080167CC: + ldr r0, _080167F4 + ldr r3, [r0] + movs r1, 0x98 + lsls r1, 2 + adds r0, r3, r1 + ldr r1, [r0] + ldr r0, _080167F8 + cmp r1, r0 + ble _08016800 + ldr r3, [r2] + movs r0, 0x1 + str r0, [r3, 0x8] + ldr r2, _080167FC + ldr r1, [r3] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 2 + adds r2, 0x30 + b _0801683C + .align 2, 0 +_080167F4: .4byte gUnknown_203B460 +_080167F8: .4byte 0x0001869e +_080167FC: .4byte gUnknown_80D49E0 +_08016800: + movs r5, 0x99 + lsls r5, 2 + adds r4, r3, r5 + ldr r0, [r4] + cmp r0, 0 + bne _08016824 + ldr r3, [r2] + movs r0, 0x1 + str r0, [r3, 0x8] + ldr r2, _08016820 + ldr r1, [r3] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 2 + adds r2, 0x2C + b _0801683C + .align 2, 0 +_08016820: .4byte gUnknown_80D49E0 +_08016824: + ldr r3, [r2] + movs r0, 0xB + str r0, [r3, 0x8] + ldr r1, _08016850 + ldr r0, [r4] + str r0, [r1] + ldr r2, _08016854 + ldr r1, [r3] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 2 + adds r2, 0x28 +_0801683C: + adds r0, r2 + ldr r0, [r0] + adds r3, 0xA4 + ldr r2, [r3] +_08016844: + ldr r3, _08016858 + movs r1, 0 + bl sub_80141B4 + b _080168EC + .align 2, 0 +_08016850: .4byte gUnknown_202DE30 +_08016854: .4byte gUnknown_80D49E0 +_08016858: .4byte 0x0000010d +_0801685C: + ldr r4, [r2] + ldr r0, _080168BC + ldr r3, [r0] + movs r1, 0x98 + lsls r1, 2 + adds r0, r3, r1 + ldr r1, [r0] + ldr r0, _080168C0 + subs r0, r1 + str r0, [r4, 0x70] + movs r5, 0x99 + lsls r5, 2 + adds r1, r3, r5 + ldr r1, [r1] + cmp r0, r1 + ble _0801687E + str r1, [r4, 0x70] +_0801687E: + ldr r2, [r2] + ldr r0, [r2, 0x70] + str r0, [r2, 0x68] + movs r0, 0x1 + str r0, [r2, 0x6C] + movs r0, 0x5 + str r0, [r2, 0x74] + movs r0, 0x2 + str r0, [r2, 0x78] + adds r0, r2, 0 + adds r0, 0xD8 + str r0, [r2, 0x7C] + adds r1, r2, 0 + adds r1, 0x80 + movs r0, 0x50 + str r0, [r1] + adds r1, 0x4 + movs r0, 0x12 + str r0, [r1] + adds r0, r2, 0 + adds r0, 0x64 + bl sub_8013AA0 + movs r0, 0 +_080168AE: + bl sub_8016B48 +_080168B2: + movs r0, 0x3 + bl sub_8016BB8 + b _080168EC + .align 2, 0 +_080168BC: .4byte gUnknown_203B460 +_080168C0: .4byte 0x0001869f +_080168C4: + ldr r3, [r2] + movs r0, 0x1 + str r0, [r3, 0x8] + ldr r1, _080168F4 + ldr r0, [r3, 0xC] + str r0, [r1] + ldr r2, _080168F8 + ldr r1, [r3] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 2 + adds r2, 0x34 + adds r0, r2 + ldr r0, [r0] + adds r3, 0xA4 + ldr r2, [r3] + ldr r3, _080168FC + movs r1, 0 + bl sub_80141B4 +_080168EC: + add sp, 0x14 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080168F4: .4byte gUnknown_202DE30 +_080168F8: .4byte gUnknown_80D49E0 +_080168FC: .4byte 0x0000010d + thumb_func_end sub_801653C + + thumb_func_start sub_8016900 +sub_8016900: + push {r4-r7,lr} + ldr r4, _08016980 + ldr r0, [r4] + adds r0, 0x54 + movs r1, 0 + movs r2, 0x10 + bl MemoryFill16 + ldr r3, [r4] + movs r2, 0 + ldr r0, _08016984 + ldr r0, [r0] + str r0, [r3, 0x14] + movs r0, 0x2 + str r0, [r3, 0x18] + movs r1, 0x1 + ldr r0, _08016988 + ldr r0, [r0] + str r0, [r3, 0x1C] + movs r0, 0x3 + str r0, [r3, 0x20] + ldr r0, _0801698C + ldr r0, [r0] + str r0, [r3, 0x24] + movs r0, 0x4 + str r0, [r3, 0x28] + ldr r0, _08016990 + ldr r0, [r0] + str r0, [r3, 0x2C] + str r1, [r3, 0x30] + movs r6, 0x4 + str r2, [r3, 0x34] + str r1, [r3, 0x38] + movs r5, 0 + mov r12, r3 + adds r3, 0x18 + mov r2, r12 + adds r2, 0x54 +_0801694C: + ldrh r0, [r2] + cmp r0, 0 + bne _0801695C + ldr r1, [r3] + mov r7, r12 + ldr r0, [r7, 0x10] + cmp r1, r0 + beq _080169B6 +_0801695C: + adds r3, 0x8 + adds r2, 0x2 + adds r5, 0x1 + cmp r5, r6 + blt _0801694C + movs r5, 0 + cmp r5, r6 + bge _080169B6 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x54 + ldrh r0, [r0] + cmp r0, 0 + bne _08016994 + ldr r0, [r1, 0x18] + str r0, [r1, 0x10] + b _080169B6 + .align 2, 0 +_08016980: .4byte gUnknown_203B204 +_08016984: .4byte gUnknown_80D4958 +_08016988: .4byte gUnknown_80D4964 +_0801698C: .4byte gUnknown_80D4970 +_08016990: .4byte gUnknown_80D4934 +_08016994: + adds r5, 0x1 + cmp r5, r6 + bge _080169B6 + ldr r2, [r4] + lsls r0, r5, 1 + adds r1, r2, 0 + adds r1, 0x54 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _08016994 + lsls r0, r5, 3 + adds r1, r2, 0 + adds r1, 0x18 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x10] +_080169B6: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8016900 + + thumb_func_start sub_80169BC +sub_80169BC: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08016A10 + ldr r0, _080169E4 + ldr r1, [r0] + ldr r0, [sp] + str r0, [r1, 0x10] + ldr r0, [sp] + cmp r0, 0x2 + beq _080169F2 + cmp r0, 0x2 + bgt _080169E8 + cmp r0, 0x1 + beq _08016A0A + b _08016A10 + .align 2, 0 +_080169E4: .4byte gUnknown_203B204 +_080169E8: + cmp r0, 0x3 + beq _080169FA + cmp r0, 0x4 + beq _08016A02 + b _08016A10 +_080169F2: + movs r0, 0x7 + bl sub_8016444 + b _08016A10 +_080169FA: + movs r0, 0xA + bl sub_8016444 + b _08016A10 +_08016A02: + movs r0, 0x3 + bl sub_8016444 + b _08016A10 +_08016A0A: + movs r0, 0x4 + bl sub_8016444 +_08016A10: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80169BC + + thumb_func_start sub_8016A18 +sub_8016A18: + push {r4,lr} + ldr r4, _08016A38 + ldr r0, [r4] + adds r0, 0x64 + bl sub_8013BBC + cmp r0, 0x1 + beq _08016A3C + cmp r0, 0x1 + bcc _08016A86 + cmp r0, 0x2 + beq _08016A80 + cmp r0, 0x3 + beq _08016A44 + b _08016A86 + .align 2, 0 +_08016A38: .4byte gUnknown_203B204 +_08016A3C: + movs r0, 0x1 + bl sub_8016B48 + b _08016A86 +_08016A44: + ldr r3, [r4] + ldr r2, [r3, 0x64] + str r2, [r3, 0xC] + ldr r0, _08016A7C + ldr r0, [r0] + mov r12, r0 + movs r1, 0x99 + lsls r1, 2 + add r1, r12 + ldr r0, [r1] + adds r0, r2 + str r0, [r1] + movs r2, 0x98 + lsls r2, 2 + add r2, r12 + ldr r0, [r2] + ldr r1, [r3, 0xC] + subs r0, r1 + str r0, [r2] + movs r0, 0xA6 + lsls r0, 1 + bl sub_8011988 + movs r0, 0x9 + bl sub_8016444 + b _08016A86 + .align 2, 0 +_08016A7C: .4byte gUnknown_203B460 +_08016A80: + movs r0, 0x5 + bl sub_8016444 +_08016A86: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8016A18 + + thumb_func_start sub_8016A8C +sub_8016A8C: + push {r4,lr} + ldr r4, _08016AAC + ldr r0, [r4] + adds r0, 0x64 + bl sub_8013BBC + cmp r0, 0x1 + beq _08016AB0 + cmp r0, 0x1 + bcc _08016AFA + cmp r0, 0x2 + beq _08016AF4 + cmp r0, 0x3 + beq _08016AB8 + b _08016AFA + .align 2, 0 +_08016AAC: .4byte gUnknown_203B204 +_08016AB0: + movs r0, 0 + bl sub_8016B48 + b _08016AFA +_08016AB8: + ldr r3, [r4] + ldr r2, [r3, 0x64] + str r2, [r3, 0xC] + ldr r0, _08016AF0 + ldr r0, [r0] + mov r12, r0 + movs r1, 0x98 + lsls r1, 2 + add r1, r12 + ldr r0, [r1] + adds r0, r2 + str r0, [r1] + movs r2, 0x99 + lsls r2, 2 + add r2, r12 + ldr r0, [r2] + ldr r1, [r3, 0xC] + subs r0, r1 + str r0, [r2] + movs r0, 0xA6 + lsls r0, 1 + bl sub_8011988 + movs r0, 0xC + bl sub_8016444 + b _08016AFA + .align 2, 0 +_08016AF0: .4byte gUnknown_203B460 +_08016AF4: + movs r0, 0x5 + bl sub_8016444 +_08016AFA: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8016A8C + + thumb_func_start sub_8016B00 +sub_8016B00: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08016B18 + ldr r0, _08016B20 + ldr r0, [r0] + ldr r0, [r0, 0x8] + bl sub_8016444 +_08016B18: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08016B20: .4byte gUnknown_203B204 + thumb_func_end sub_8016B00 + + thumb_func_start sub_8016B24 +sub_8016B24: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0x4 + bne _08016B3C + ldr r0, _08016B44 + ldr r0, [r0] + ldr r0, [r0, 0x8] + bl sub_8016444 +_08016B3C: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08016B44: .4byte gUnknown_203B204 + thumb_func_end sub_8016B24 + + thumb_func_start sub_8016B48 +sub_8016B48: + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, _08016B7C + ldr r0, [r4] + ldr r0, [r0, 0x78] + bl sub_8008C54 + ldr r0, [r4] + ldr r0, [r0, 0x78] + bl sub_80073B8 + cmp r5, 0 + beq _08016B84 + ldr r0, _08016B80 + ldr r2, [r0] + ldr r0, [r4] + ldr r3, [r0, 0x78] + movs r0, 0 + str r0, [sp] + movs r0, 0xC + movs r1, 0 + bl xxx_call_draw_string + b _08016B96 + .align 2, 0 +_08016B7C: .4byte gUnknown_203B204 +_08016B80: .4byte gUnknown_80D49CC +_08016B84: + ldr r0, _08016BB0 + ldr r2, [r0] + ldr r0, [r4] + ldr r3, [r0, 0x78] + str r5, [sp] + movs r0, 0xC + movs r1, 0 + bl xxx_call_draw_string +_08016B96: + ldr r4, _08016BB4 + ldr r0, [r4] + adds r0, 0x64 + bl sub_8013C68 + ldr r0, [r4] + ldr r0, [r0, 0x78] + bl sub_80073E0 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08016BB0: .4byte gUnknown_80D49DC +_08016BB4: .4byte gUnknown_203B204 + thumb_func_end sub_8016B48 + + thumb_func_start sub_8016BB8 +sub_8016BB8: + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x8 + adds r4, r0, 0 + bl sub_8008C54 + adds r0, r4, 0 + bl sub_80073B8 + ldr r2, _08016C34 + movs r0, 0 + mov r8, r0 + str r0, [sp] + movs r0, 0x10 + movs r1, 0x4 + adds r3, r4, 0 + bl xxx_call_draw_string + ldr r6, _08016C38 + ldr r0, [r6] + movs r1, 0x98 + lsls r1, 2 + adds r0, r1 + ldr r2, [r0] + movs r5, 0x5 + str r5, [sp] + str r4, [sp, 0x4] + movs r0, 0x60 + movs r1, 0x4 + movs r3, 0x5 + bl sub_8012BC4 + ldr r2, _08016C3C + mov r0, r8 + str r0, [sp] + movs r0, 0x70 + movs r1, 0x4 + adds r3, r4, 0 + bl xxx_call_draw_string + ldr r0, [r6] + movs r1, 0x99 + lsls r1, 2 + adds r0, r1 + ldr r2, [r0] + str r5, [sp] + str r4, [sp, 0x4] + movs r0, 0xC8 + movs r1, 0x4 + movs r3, 0x7 + bl sub_8012BC4 + adds r0, r4, 0 + bl sub_80073E0 + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08016C34: .4byte gUnknown_80DB724 +_08016C38: .4byte gUnknown_203B460 +_08016C3C: .4byte gUnknown_80DB72C + thumb_func_end sub_8016BB8 + + thumb_func_start sub_8016C40 +sub_8016C40: + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + bl sub_8008C54 + adds r0, r4, 0 + bl sub_80073B8 + ldr r2, _08016C8C + movs r0, 0 + str r0, [sp] + movs r0, 0x6 + movs r1, 0 + adds r3, r4, 0 + bl xxx_call_draw_string + ldr r0, _08016C90 + ldr r0, [r0] + movs r1, 0x98 + lsls r1, 2 + adds r0, r1 + ldr r2, [r0] + movs r0, 0x5 + str r0, [sp] + str r4, [sp, 0x4] + movs r0, 0x2A + movs r1, 0xC + movs r3, 0x5 + bl sub_8012BC4 + adds r0, r4, 0 + bl sub_80073E0 + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08016C8C: .4byte gUnknown_80DB738 +_08016C90: .4byte gUnknown_203B460 + thumb_func_end sub_8016C40 + + thumb_func_start sub_8016C94 +sub_8016C94: + push {r4-r6,lr} + adds r4, r0, 0 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r5, _08016CF0 + movs r0, 0xA6 + lsls r0, 1 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] + movs r6, 0 + str r6, [r0, 0x18] + str r6, [r0, 0x1C] + str r6, [r0, 0x20] + str r4, [r0] + ldr r0, _08016CF4 + movs r1, 0x73 + bl sub_808D8E0 + ldr r4, _08016CF8 + adds r0, r4, 0 + movs r1, 0x73 + bl sub_808D8E0 + movs r0, 0x73 + bl sub_808D994 + adds r1, r0, 0 + subs r4, 0x50 + adds r0, r4, 0 + bl strcpy + ldr r5, [r5] + ldr r0, [r5] + cmp r0, 0x1 + bne _08016CFC + adds r0, r5, 0 + adds r0, 0xE8 + str r6, [r0] + b _08016D06 + .align 2, 0 +_08016CF0: .4byte gUnknown_203B208 +_08016CF4: .4byte gUnknown_202E5D8 +_08016CF8: .4byte gUnknown_202E1C8 +_08016CFC: + adds r1, r5, 0 + adds r1, 0xE8 + adds r0, r5, 0 + adds r0, 0xD8 + str r0, [r1] +_08016D06: + movs r0, 0x73 + bl sub_808DDD0 + ldr r2, _08016D50 + ldr r3, [r2] + adds r1, r3, 0 + adds r1, 0xD8 + str r0, [r1] + adds r1, 0x4 + ldr r0, [r0, 0x4] + str r0, [r1] + adds r0, r3, 0 + adds r0, 0xE4 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0xE5 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0xE6 + strb r1, [r0] + ldr r1, [r2] + adds r2, r1, 0 + adds r2, 0xE0 + movs r0, 0x2 + strh r0, [r2] + adds r1, 0xE2 + movs r0, 0x8 + strh r0, [r1] + movs r0, 0 + bl sub_8016E68 + movs r0, 0x1 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08016D50: .4byte gUnknown_203B208 + thumb_func_end sub_8016C94 + + thumb_func_start sub_8016D54 +sub_8016D54: + push {lr} + ldr r0, _08016D6C + ldr r0, [r0] + ldr r0, [r0, 0x4] + cmp r0, 0x1C + bhi _08016E34 + lsls r0, 2 + ldr r1, _08016D70 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08016D6C: .4byte gUnknown_203B208 +_08016D70: .4byte _08016D74 + .align 2, 0 +_08016D74: + .4byte _08016DE8 + .4byte _08016DE8 + .4byte _08016E34 + .4byte _08016E34 + .4byte _08016E30 + .4byte _08016E34 + .4byte _08016E34 + .4byte _08016E34 + .4byte _08016E34 + .4byte _08016E34 + .4byte _08016E34 + .4byte _08016E34 + .4byte _08016E34 + .4byte _08016DEE + .4byte _08016DEE + .4byte _08016DF4 + .4byte _08016DFA + .4byte _08016E00 + .4byte _08016E06 + .4byte _08016E34 + .4byte _08016E34 + .4byte _08016E34 + .4byte _08016E0C + .4byte _08016E0C + .4byte _08016E12 + .4byte _08016E18 + .4byte _08016E1E + .4byte _08016E24 + .4byte _08016E2A +_08016DE8: + bl sub_8017828 + b _08016E38 +_08016DEE: + bl sub_8017AF8 + b _08016E38 +_08016DF4: + bl sub_8017C7C + b _08016E38 +_08016DFA: + bl sub_8017DC0 + b _08016E38 +_08016E00: + bl sub_80178D0 + b _08016E38 +_08016E06: + bl sub_80179A8 + b _08016E38 +_08016E0C: + bl sub_8017B88 + b _08016E38 +_08016E12: + bl sub_8017C28 + b _08016E38 +_08016E18: + bl sub_8017D24 + b _08016E38 +_08016E1E: + bl sub_8017DDC + b _08016E38 +_08016E24: + bl sub_8017928 + b _08016E38 +_08016E2A: + bl sub_8017A1C + b _08016E38 +_08016E30: + movs r0, 0x3 + b _08016E3A +_08016E34: + bl sub_8017DF8 +_08016E38: + movs r0, 0 +_08016E3A: + pop {r1} + bx r1 + thumb_func_end sub_8016D54 + + thumb_func_start sub_8016E40 +sub_8016E40: + push {r4,lr} + ldr r4, _08016E64 + ldr r0, [r4] + cmp r0, 0 + beq _08016E5C + adds r0, 0xD8 + ldr r0, [r0] + bl sub_800AA14 + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_08016E5C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08016E64: .4byte gUnknown_203B208 + thumb_func_end sub_8016E40 + + thumb_func_start sub_8016E68 +sub_8016E68: + push {lr} + ldr r1, _08016E7C + ldr r1, [r1] + str r0, [r1, 0x4] + bl sub_8016E80 + bl sub_8016FF8 + pop {r0} + bx r0 + .align 2, 0 +_08016E7C: .4byte gUnknown_203B208 + thumb_func_end sub_8016E68 + + thumb_func_start sub_8016E80 +sub_8016E80: + push {r4-r7,lr} + ldr r4, _08016EA4 + ldr r0, [r4] + adds r0, 0xEC + bl sub_8006518 + ldr r0, [r4] + ldr r0, [r0, 0x4] + subs r0, 0xD + cmp r0, 0xC + bls _08016E98 + b _08016FB4 +_08016E98: + lsls r0, 2 + ldr r1, _08016EA8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08016EA4: .4byte gUnknown_203B208 +_08016EA8: .4byte _08016EAC + .align 2, 0 +_08016EAC: + .4byte _08016EE0 + .4byte _08016EE0 + .4byte _08016F94 + .4byte _08016FB4 + .4byte _08016FB4 + .4byte _08016FB4 + .4byte _08016FB4 + .4byte _08016FB4 + .4byte _08016FB4 + .4byte _08016F2C + .4byte _08016F2C + .4byte _08016F7C + .4byte _08016F94 +_08016EE0: + ldr r3, _08016F24 + ldr r1, [r3] + ldr r2, _08016F28 + adds r1, 0xEC + adds r0, r2, 0 + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldm r0!, {r4,r5,r7} + stm r1!, {r4,r5,r7} + ldr r1, [r3] + movs r6, 0x82 + lsls r6, 1 + adds r1, r6 + adds r0, r2, 0 + ldm r0!, {r4,r5,r7} + stm r1!, {r4,r5,r7} + ldm r0!, {r4,r6,r7} + stm r1!, {r4,r6,r7} + ldr r1, [r3] + movs r5, 0x8E + lsls r5, 1 + adds r1, r5 + adds r0, r2, 0 + ldm r0!, {r4,r6,r7} + stm r1!, {r4,r6,r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldr r0, [r3] + adds r0, 0xEC + ldm r2!, {r1,r3,r4} + stm r0!, {r1,r3,r4} + ldm r2!, {r5-r7} + stm r0!, {r5-r7} + b _08016FD8 + .align 2, 0 +_08016F24: .4byte gUnknown_203B208 +_08016F28: .4byte gUnknown_80DB748 +_08016F2C: + ldr r3, _08016F70 + ldr r1, [r3] + ldr r2, _08016F74 + adds r1, 0xEC + adds r0, r2, 0 + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldm r0!, {r4,r5,r7} + stm r1!, {r4,r5,r7} + ldr r1, [r3] + movs r6, 0x82 + lsls r6, 1 + adds r1, r6 + adds r0, r2, 0 + ldm r0!, {r4,r5,r7} + stm r1!, {r4,r5,r7} + ldm r0!, {r4,r6,r7} + stm r1!, {r4,r6,r7} + ldr r0, [r3] + movs r5, 0x8E + lsls r5, 1 + adds r0, r5 + ldm r2!, {r1,r6,r7} + stm r0!, {r1,r6,r7} + ldm r2!, {r4-r6} + stm r0!, {r4-r6} + ldr r1, [r3] + adds r1, 0xEC + ldr r0, _08016F78 + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + b _08016FD8 + .align 2, 0 +_08016F70: .4byte gUnknown_203B208 +_08016F74: .4byte gUnknown_80DB748 +_08016F78: .4byte gUnknown_80DB778 +_08016F7C: + ldr r0, _08016F8C + ldr r1, [r0] + movs r7, 0x82 + lsls r7, 1 + adds r1, r7 + ldr r0, _08016F90 + b _08016FA0 + .align 2, 0 +_08016F8C: .4byte gUnknown_203B208 +_08016F90: .4byte gUnknown_80DB790 +_08016F94: + ldr r0, _08016FAC + ldr r1, [r0] + movs r0, 0x8E + lsls r0, 1 + adds r1, r0 + ldr r0, _08016FB0 +_08016FA0: + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + b _08016FD8 + .align 2, 0 +_08016FAC: .4byte gUnknown_203B208 +_08016FB0: .4byte gUnknown_80DB760 +_08016FB4: + ldr r0, _08016FF0 + mov r12, r0 + ldr r4, _08016FF4 + movs r3, 0 + movs r2, 0x3 +_08016FBE: + mov r5, r12 + ldr r1, [r5] + adds r1, r3 + adds r1, 0xEC + adds r0, r4, 0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r3, 0x18 + subs r2, 0x1 + cmp r2, 0 + bge _08016FBE +_08016FD8: + bl sub_8004914 + ldr r0, _08016FF0 + ldr r0, [r0] + adds r0, 0xEC + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08016FF0: .4byte gUnknown_203B208 +_08016FF4: .4byte gUnknown_80DB748 + thumb_func_end sub_8016E80 + + thumb_func_start sub_8016FF8 +sub_8016FF8: + push {r4,r5,lr} + sub sp, 0x14 + ldr r1, _08017014 + ldr r0, [r1] + ldr r0, [r0, 0x4] + adds r4, r1, 0 + cmp r0, 0x1D + bls _0801700A + b _08017584 +_0801700A: + lsls r0, 2 + ldr r1, _08017018 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08017014: .4byte gUnknown_203B208 +_08017018: .4byte _0801701C + .align 2, 0 +_0801701C: + .4byte _08017094 + .4byte _080170BC + .4byte _0801710C + .4byte _0801713C + .4byte _08017584 + .4byte _0801715C + .4byte _0801718C + .4byte _080171BC + .4byte _080171EC + .4byte _0801721C + .4byte _0801724C + .4byte _0801726C + .4byte _0801728C + .4byte _080172AC + .4byte _080172BA + .4byte _080172C2 + .4byte _080174A8 + .4byte _080172E4 + .4byte _0801731C + .4byte _08017344 + .4byte _08017394 + .4byte _080173B4 + .4byte _080173E8 + .4byte _080173F6 + .4byte _08017404 + .4byte _08017474 + .4byte _080174A8 + .4byte _080174B2 + .4byte _080174E8 + .4byte _08017530 +_08017094: + bl sub_80175FC + ldr r2, _080170B4 + ldr r0, [r2] + adds r0, 0xE4 + movs r4, 0 + movs r1, 0x1 + strb r1, [r0] + ldr r3, _080170B8 + ldr r5, [r2] + ldr r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r0, r3 + b _080170DA + .align 2, 0 +_080170B4: .4byte gUnknown_203B208 +_080170B8: .4byte gUnknown_80D5404 +_080170BC: + bl sub_80175FC + ldr r1, _08017104 + ldr r0, [r1] + adds r0, 0xE4 + movs r4, 0 + strb r4, [r0] + ldr r2, _08017108 + ldr r5, [r1] + ldr r1, [r5] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0x4 + adds r0, r2 +_080170DA: + ldr r0, [r0] + ldr r2, [r5, 0x18] + adds r3, r5, 0 + adds r3, 0x24 + adds r1, r5, 0 + adds r1, 0x4C + str r1, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r4, [sp, 0x8] + adds r1, r5, 0 + adds r1, 0xE8 + ldr r1, [r1] + str r1, [sp, 0xC] + movs r1, 0xC + str r1, [sp, 0x10] + movs r1, 0 + bl sub_8014248 + b _08017584 + .align 2, 0 +_08017104: .4byte gUnknown_203B208 +_08017108: .4byte gUnknown_80D5404 +_0801710C: + ldr r0, [r4] + movs r1, 0x1 + str r1, [r0, 0x8] + adds r0, 0xE4 + movs r1, 0 + strb r1, [r0] + ldr r2, _08017134 + ldr r3, [r4] + ldr r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0x4C + adds r0, r2 + ldr r0, [r0] + adds r3, 0xE8 + ldr r2, [r3] + ldr r3, _08017138 + b _080173D8 + .align 2, 0 +_08017134: .4byte gUnknown_80D5404 +_08017138: .4byte 0x0000010d +_0801713C: + ldr r0, [r4] + movs r1, 0x4 + str r1, [r0, 0x8] + adds r0, 0xE4 + movs r1, 0x1 + strb r1, [r0] + ldr r2, _08017158 + ldr r3, [r4] + ldr r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0x8 + b _080173CE + .align 2, 0 +_08017158: .4byte gUnknown_80D5404 +_0801715C: + ldr r0, [r4] + movs r1, 0x1 + str r1, [r0, 0x8] + adds r0, 0xE4 + movs r1, 0 + strb r1, [r0] + ldr r2, _08017184 + ldr r3, [r4] + ldr r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0x34 + adds r0, r2 + ldr r0, [r0] + adds r3, 0xE8 + ldr r2, [r3] + ldr r3, _08017188 + b _080173D8 + .align 2, 0 +_08017184: .4byte gUnknown_80D5404 +_08017188: .4byte 0x0000010d +_0801718C: + ldr r0, [r4] + movs r1, 0x1 + str r1, [r0, 0x8] + adds r0, 0xE4 + movs r1, 0 + strb r1, [r0] + ldr r2, _080171B4 + ldr r3, [r4] + ldr r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0x38 + adds r0, r2 + ldr r0, [r0] + adds r3, 0xE8 + ldr r2, [r3] + ldr r3, _080171B8 + b _080173D8 + .align 2, 0 +_080171B4: .4byte gUnknown_80D5404 +_080171B8: .4byte 0x0000010d +_080171BC: + ldr r0, [r4] + movs r1, 0x1 + str r1, [r0, 0x8] + adds r0, 0xE4 + movs r1, 0 + strb r1, [r0] + ldr r2, _080171E4 + ldr r3, [r4] + ldr r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0x3C + adds r0, r2 + ldr r0, [r0] + adds r3, 0xE8 + ldr r2, [r3] + ldr r3, _080171E8 + b _080173D8 + .align 2, 0 +_080171E4: .4byte gUnknown_80D5404 +_080171E8: .4byte 0x0000010d +_080171EC: + ldr r0, [r4] + movs r1, 0x1 + str r1, [r0, 0x8] + adds r0, 0xE4 + movs r1, 0 + strb r1, [r0] + ldr r2, _08017214 + ldr r3, [r4] + ldr r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0x48 + adds r0, r2 + ldr r0, [r0] + adds r3, 0xE8 + ldr r2, [r3] + ldr r3, _08017218 + b _080173D8 + .align 2, 0 +_08017214: .4byte gUnknown_80D5404 +_08017218: .4byte 0x0000010d +_0801721C: + ldr r0, _08017244 + ldr r1, [r4] + adds r1, 0xC + movs r2, 0 + bl sub_8090E14 + ldr r0, [r4] + movs r1, 0xE + str r1, [r0, 0x8] + adds r0, 0xE4 + movs r1, 0 + strb r1, [r0] + ldr r2, _08017248 + ldr r3, [r4] + ldr r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0x40 + b _080173CE + .align 2, 0 +_08017244: .4byte gUnknown_202DE58 +_08017248: .4byte gUnknown_80D5404 +_0801724C: + ldr r0, [r4] + movs r1, 0xE + str r1, [r0, 0x8] + adds r0, 0xE4 + movs r1, 0 + strb r1, [r0] + ldr r2, _08017268 + ldr r3, [r4] + ldr r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0x44 + b _080173CE + .align 2, 0 +_08017268: .4byte gUnknown_80D5404 +_0801726C: + ldr r0, [r4] + movs r1, 0xD + str r1, [r0, 0x8] + adds r0, 0xE4 + movs r1, 0 + strb r1, [r0] + ldr r2, _08017288 + ldr r3, [r4] + ldr r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0xC + b _080173CE + .align 2, 0 +_08017288: .4byte gUnknown_80D5404 +_0801728C: + ldr r0, [r4] + movs r1, 0xE + str r1, [r0, 0x8] + adds r0, 0xE4 + movs r1, 0 + strb r1, [r0] + ldr r2, _080172A8 + ldr r3, [r4] + ldr r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0x10 + b _080173CE + .align 2, 0 +_080172A8: .4byte gUnknown_80D5404 +_080172AC: + movs r0, 0x3 + movs r1, 0x3 + movs r2, 0 + movs r3, 0xA + bl sub_801A5D8 + b _08017584 +_080172BA: + movs r0, 0x1 + bl sub_801A8D0 + b _08017584 +_080172C2: + bl sub_801A9E0 + bl sub_80176B8 + ldr r0, _080172E0 + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x58 + adds r1, r2, 0 + adds r1, 0x24 + adds r3, r2, 0 + adds r3, 0x4C + ldr r2, [r2, 0x1C] + b _08017494 + .align 2, 0 +_080172E0: .4byte gUnknown_203B208 +_080172E4: + bl sub_80177F8 + ldr r0, _08017310 + ldr r4, _08017314 + ldr r1, [r4] + adds r1, 0xC + movs r2, 0 + bl sub_8090E14 + ldr r0, [r4] + adds r0, 0xE4 + movs r5, 0 + strb r5, [r0] + ldr r2, _08017318 + ldr r4, [r4] + ldr r1, [r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0x14 + b _08017504 + .align 2, 0 +_08017310: .4byte gUnknown_202DE58 +_08017314: .4byte gUnknown_203B208 +_08017318: .4byte gUnknown_80D5404 +_0801731C: + bl sub_80177F8 + ldr r1, _0801733C + ldr r0, [r1] + adds r0, 0xE4 + movs r5, 0 + strb r5, [r0] + ldr r2, _08017340 + ldr r4, [r1] + ldr r1, [r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0x18 + b _08017504 + .align 2, 0 +_0801733C: .4byte gUnknown_203B208 +_08017340: .4byte gUnknown_80D5404 +_08017344: + bl sub_8090A34 + cmp r0, 0 + bne _0801735C + bl sub_801A928 + ldr r0, _08017358 + ldr r1, [r0] + movs r0, 0x1 + b _08017362 + .align 2, 0 +_08017358: .4byte gUnknown_203B208 +_0801735C: + ldr r0, _08017388 + ldr r1, [r0] + movs r0, 0xC +_08017362: + str r0, [r1, 0x8] + ldr r3, _08017388 + ldr r0, [r3] + adds r0, 0xE4 + movs r1, 0x1 + strb r1, [r0] + ldr r2, _0801738C + ldr r3, [r3] + ldr r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0x1C + adds r0, r2 + ldr r0, [r0] + adds r3, 0xE8 + ldr r2, [r3] + ldr r3, _08017390 + b _080173D8 + .align 2, 0 +_08017388: .4byte gUnknown_203B208 +_0801738C: .4byte gUnknown_80D5404 +_08017390: .4byte 0x0000010d +_08017394: + ldr r0, [r4] + movs r1, 0x16 + str r1, [r0, 0x8] + adds r0, 0xE4 + movs r1, 0 + strb r1, [r0] + ldr r2, _080173B0 + ldr r3, [r4] + ldr r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0x20 + b _080173CE + .align 2, 0 +_080173B0: .4byte gUnknown_80D5404 +_080173B4: + ldr r0, [r4] + movs r1, 0x17 + str r1, [r0, 0x8] + adds r0, 0xE4 + movs r1, 0 + strb r1, [r0] + ldr r2, _080173E0 + ldr r3, [r4] + ldr r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0x24 +_080173CE: + adds r0, r2 + ldr r0, [r0] + adds r3, 0xE8 + ldr r2, [r3] + ldr r3, _080173E4 +_080173D8: + movs r1, 0 + bl sub_80141B4 + b _08017584 + .align 2, 0 +_080173E0: .4byte gUnknown_80D5404 +_080173E4: .4byte 0x0000030d +_080173E8: + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0 + movs r3, 0xA + bl sub_801C8C4 + b _080173FC +_080173F6: + movs r0, 0x1 + bl sub_801CB5C +_080173FC: + movs r0, 0 + bl sub_801AD34 + b _08017584 +_08017404: + ldr r2, [r4] + adds r1, r2, 0 + adds r1, 0xB8 + movs r0, 0x2 + str r0, [r1] + subs r1, 0x8 + movs r0, 0x1 + str r0, [r1] + ldr r0, _08017430 + ldr r1, [r0] + ldrb r0, [r2, 0xE] + lsls r0, 1 + adds r1, 0x50 + adds r3, r1, r0 + ldrh r0, [r3] + cmp r0, 0x63 + bls _08017434 + adds r1, r2, 0 + adds r1, 0xB4 + movs r0, 0x63 + b _0801743A + .align 2, 0 +_08017430: .4byte gUnknown_203B460 +_08017434: + adds r1, r2, 0 + adds r1, 0xB4 + ldrh r0, [r3] +_0801743A: + str r0, [r1] + ldr r2, [r4] + adds r1, r2, 0 + adds r1, 0xAC + adds r0, r2, 0 + adds r0, 0xB4 + ldr r0, [r0] + str r0, [r1] + adds r1, 0x10 + movs r0, 0x1 + str r0, [r1] + adds r1, 0x4 + movs r3, 0x82 + lsls r3, 1 + adds r0, r2, r3 + str r0, [r1] + adds r1, 0x4 + movs r0, 0x28 + str r0, [r1] + adds r1, 0x4 + movs r0, 0x12 + str r0, [r1] + adds r0, r2, 0 + adds r0, 0xA8 + bl sub_8013AA0 + bl sub_8017598 + b _08017584 +_08017474: + bl sub_801CCD8 + movs r0, 0 + bl sub_801AD34 + bl sub_8017758 + ldr r0, _080174A4 + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x58 + adds r1, r2, 0 + adds r1, 0x24 + adds r3, r2, 0 + adds r3, 0x4C + ldr r2, [r2, 0x20] +_08017494: + str r2, [sp] + movs r2, 0x2 + str r2, [sp, 0x4] + movs r2, 0 + bl sub_8012D60 + b _08017584 + .align 2, 0 +_080174A4: .4byte gUnknown_203B208 +_080174A8: + ldr r0, [r4] + adds r0, 0xC + bl sub_801B3C0 + b _08017584 +_080174B2: + bl sub_80177F8 + ldr r0, _080174DC + ldr r4, _080174E0 + ldr r1, [r4] + adds r1, 0xC + movs r2, 0 + bl sub_8090E14 + ldr r0, [r4] + adds r0, 0xE4 + movs r5, 0 + strb r5, [r0] + ldr r2, _080174E4 + ldr r4, [r4] + ldr r1, [r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0x28 + b _08017504 + .align 2, 0 +_080174DC: .4byte gUnknown_202DE58 +_080174E0: .4byte gUnknown_203B208 +_080174E4: .4byte gUnknown_80D5404 +_080174E8: + bl sub_80177F8 + ldr r1, _08017528 + ldr r0, [r1] + adds r0, 0xE4 + movs r5, 0 + strb r5, [r0] + ldr r2, _0801752C + ldr r4, [r1] + ldr r1, [r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0x2C +_08017504: + adds r0, r2 + ldr r0, [r0] + adds r3, r4, 0 + adds r3, 0x24 + str r5, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r5, [sp, 0x8] + adds r4, 0xE8 + ldr r1, [r4] + str r1, [sp, 0xC] + movs r1, 0xC + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0x4 + bl sub_8014248 + b _08017584 + .align 2, 0 +_08017528: .4byte gUnknown_203B208 +_0801752C: .4byte gUnknown_80D5404 +_08017530: + movs r0, 0x1 + bl sub_801CF14 + lsls r0, 24 + cmp r0, 0 + bne _08017544 + bl sub_8090A34 + cmp r0, 0x13 + ble _08017554 +_08017544: + bl sub_801CBB8 + ldr r0, _08017550 + ldr r1, [r0] + movs r0, 0x1 + b _0801755A + .align 2, 0 +_08017550: .4byte gUnknown_203B208 +_08017554: + ldr r0, _0801758C + ldr r1, [r0] + movs r0, 0x15 +_0801755A: + str r0, [r1, 0x8] + ldr r3, _0801758C + ldr r0, [r3] + adds r0, 0xE4 + movs r1, 0x1 + strb r1, [r0] + ldr r2, _08017590 + ldr r3, [r3] + ldr r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0x30 + adds r0, r2 + ldr r0, [r0] + adds r3, 0xE8 + ldr r2, [r3] + ldr r3, _08017594 + movs r1, 0 + bl sub_80141B4 +_08017584: + add sp, 0x14 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0801758C: .4byte gUnknown_203B208 +_08017590: .4byte gUnknown_80D5404 +_08017594: .4byte 0x0000010d + thumb_func_end sub_8016FF8 + + thumb_func_start sub_8017598 +sub_8017598: + push {r4,lr} + sub sp, 0x4 + ldr r4, _080175F4 + ldr r0, [r4] + adds r0, 0xBC + ldr r0, [r0] + bl sub_8008C54 + ldr r0, [r4] + adds r0, 0xBC + ldr r0, [r0] + bl sub_80073B8 + ldr r2, _080175F8 + ldr r0, [r4] + adds r0, 0xBC + ldr r3, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0x4 + movs r1, 0 + bl xxx_call_draw_string + ldr r0, [r4] + adds r0, 0xA8 + bl sub_8013C68 + ldr r0, [r4] + adds r0, 0xBC + ldr r0, [r0] + bl sub_80073E0 + bl sub_801CCD8 + movs r0, 0 + bl sub_801AD34 + ldr r0, [r4] + adds r0, 0x58 + movs r1, 0 + bl sub_8012EA4 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080175F4: .4byte gUnknown_203B208 +_080175F8: .4byte gUnknown_80DB7A8 + thumb_func_end sub_8017598 + + thumb_func_start sub_80175FC +sub_80175FC: + push {r4-r7,lr} + ldr r4, _0801767C + ldr r0, [r4] + adds r0, 0x4C + movs r1, 0 + movs r2, 0xA + bl MemoryFill16 + ldr r3, [r4] + movs r2, 0 + ldr r0, _08017680 + ldr r0, [r0] + str r0, [r3, 0x24] + movs r0, 0x2 + str r0, [r3, 0x28] + movs r1, 0x1 + ldr r0, _08017684 + ldr r0, [r0] + str r0, [r3, 0x2C] + movs r0, 0x3 + str r0, [r3, 0x30] + ldr r0, _08017688 + ldr r0, [r0] + str r0, [r3, 0x34] + movs r0, 0x6 + str r0, [r3, 0x38] + ldr r0, _0801768C + ldr r0, [r0] + str r0, [r3, 0x3C] + str r1, [r3, 0x40] + movs r6, 0x4 + str r2, [r3, 0x44] + str r1, [r3, 0x48] + movs r5, 0 + mov r12, r3 + adds r3, 0x28 + mov r2, r12 + adds r2, 0x4C +_08017648: + ldrh r0, [r2] + cmp r0, 0 + bne _08017658 + ldr r1, [r3] + mov r7, r12 + ldr r0, [r7, 0x18] + cmp r1, r0 + beq _080176B2 +_08017658: + adds r3, 0x8 + adds r2, 0x2 + adds r5, 0x1 + cmp r5, r6 + blt _08017648 + movs r5, 0 + cmp r5, r6 + bge _080176B2 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x4C + ldrh r0, [r0] + cmp r0, 0 + bne _08017690 + ldr r0, [r1, 0x28] + str r0, [r1, 0x18] + b _080176B2 + .align 2, 0 +_0801767C: .4byte gUnknown_203B208 +_08017680: .4byte gUnknown_80D4958 +_08017684: .4byte gUnknown_80D4964 +_08017688: .4byte gUnknown_80D4970 +_0801768C: .4byte gUnknown_80D4934 +_08017690: + adds r5, 0x1 + cmp r5, r6 + bge _080176B2 + ldr r2, [r4] + lsls r0, r5, 1 + adds r1, r2, 0 + adds r1, 0x4C + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _08017690 + lsls r0, r5, 3 + adds r1, r2, 0 + adds r1, 0x28 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x18] +_080176B2: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80175FC + + thumb_func_start sub_80176B8 +sub_80176B8: + push {r4-r7,lr} + ldr r4, _08017724 + ldr r0, [r4] + adds r0, 0x4C + movs r1, 0 + movs r2, 0xA + bl MemoryFill16 + ldr r3, [r4] + movs r2, 0 + ldr r0, _08017728 + ldr r0, [r0] + str r0, [r3, 0x24] + movs r0, 0x2 + str r0, [r3, 0x28] + movs r1, 0x1 + ldr r0, _0801772C + ldr r0, [r0] + str r0, [r3, 0x2C] + movs r0, 0x6 + str r0, [r3, 0x30] + movs r6, 0x2 + str r2, [r3, 0x34] + str r1, [r3, 0x38] + movs r5, 0 + mov r12, r3 + adds r3, 0x28 + mov r2, r12 + adds r2, 0x4C +_080176F2: + ldrh r0, [r2] + cmp r0, 0 + bne _08017702 + ldr r1, [r3] + mov r7, r12 + ldr r0, [r7, 0x1C] + cmp r1, r0 + beq _08017752 +_08017702: + adds r3, 0x8 + adds r2, 0x2 + adds r5, 0x1 + cmp r5, r6 + blt _080176F2 + movs r5, 0 + cmp r5, r6 + bge _08017752 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x4C + ldrh r0, [r0] + cmp r0, 0 + bne _08017730 + ldr r0, [r1, 0x28] + str r0, [r1, 0x1C] + b _08017752 + .align 2, 0 +_08017724: .4byte gUnknown_203B208 +_08017728: .4byte gUnknown_80D4958 +_0801772C: .4byte gUnknown_80D4970 +_08017730: + adds r5, 0x1 + cmp r5, r6 + bge _08017752 + ldr r2, [r4] + lsls r0, r5, 1 + adds r1, r2, 0 + adds r1, 0x4C + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _08017730 + lsls r0, r5, 3 + adds r1, r2, 0 + adds r1, 0x28 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x1C] +_08017752: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80176B8 + + thumb_func_start sub_8017758 +sub_8017758: + push {r4-r7,lr} + ldr r4, _080177C4 + ldr r0, [r4] + adds r0, 0x4C + movs r1, 0 + movs r2, 0xA + bl MemoryFill16 + ldr r3, [r4] + movs r2, 0 + ldr r0, _080177C8 + ldr r0, [r0] + str r0, [r3, 0x24] + movs r0, 0x3 + str r0, [r3, 0x28] + movs r1, 0x1 + ldr r0, _080177CC + ldr r0, [r0] + str r0, [r3, 0x2C] + movs r0, 0x6 + str r0, [r3, 0x30] + movs r6, 0x2 + str r2, [r3, 0x34] + str r1, [r3, 0x38] + movs r5, 0 + mov r12, r3 + adds r3, 0x28 + mov r2, r12 + adds r2, 0x4C +_08017792: + ldrh r0, [r2] + cmp r0, 0 + bne _080177A2 + ldr r1, [r3] + mov r7, r12 + ldr r0, [r7, 0x20] + cmp r1, r0 + beq _080177F2 +_080177A2: + adds r3, 0x8 + adds r2, 0x2 + adds r5, 0x1 + cmp r5, r6 + blt _08017792 + movs r5, 0 + cmp r5, r6 + bge _080177F2 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x4C + ldrh r0, [r0] + cmp r0, 0 + bne _080177D0 + ldr r0, [r1, 0x28] + str r0, [r1, 0x20] + b _080177F2 + .align 2, 0 +_080177C4: .4byte gUnknown_203B208 +_080177C8: .4byte gUnknown_80D4964 +_080177CC: .4byte gUnknown_80D4970 +_080177D0: + adds r5, 0x1 + cmp r5, r6 + bge _080177F2 + ldr r2, [r4] + lsls r0, r5, 1 + adds r1, r2, 0 + adds r1, 0x4C + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _080177D0 + lsls r0, r5, 3 + adds r1, r2, 0 + adds r1, 0x28 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x20] +_080177F2: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8017758 + + thumb_func_start sub_80177F8 +sub_80177F8: + ldr r0, _0801781C + ldr r1, [r0] + movs r3, 0 + ldr r0, _08017820 + ldr r0, [r0] + str r0, [r1, 0x24] + movs r0, 0x4 + str r0, [r1, 0x28] + movs r2, 0x1 + ldr r0, _08017824 + ldr r0, [r0] + str r0, [r1, 0x2C] + movs r0, 0x5 + str r0, [r1, 0x30] + str r3, [r1, 0x34] + str r2, [r1, 0x38] + bx lr + .align 2, 0 +_0801781C: .4byte gUnknown_203B208 +_08017820: .4byte gUnknown_80D4920 +_08017824: .4byte gUnknown_80D4928 + thumb_func_end sub_80177F8 + + thumb_func_start sub_8017828 +sub_8017828: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080178C8 + ldr r1, [sp] + cmp r1, 0x1 + beq _08017842 + ldr r0, _08017854 + ldr r0, [r0] + str r1, [r0, 0x18] +_08017842: + ldr r0, [sp] + cmp r0, 0x2 + beq _08017862 + cmp r0, 0x2 + bgt _08017858 + cmp r0, 0x1 + beq _080178C2 + b _080178C8 + .align 2, 0 +_08017854: .4byte gUnknown_203B208 +_08017858: + cmp r0, 0x3 + beq _0801788E + cmp r0, 0x6 + beq _080178BA + b _080178C8 +_08017862: + bl sub_8090A34 + cmp r0, 0 + bne _08017872 + movs r0, 0x5 + bl sub_8016E68 + b _080178C8 +_08017872: + movs r0, 0 + bl sub_801CF50 + lsls r0, 24 + cmp r0, 0 + beq _08017886 + movs r0, 0x8 + bl sub_8016E68 + b _080178C8 +_08017886: + movs r0, 0xB + bl sub_8016E68 + b _080178C8 +_0801788E: + movs r0, 0x1 + bl sub_801CF14 + lsls r0, 24 + cmp r0, 0 + beq _080178A2 + movs r0, 0x7 + bl sub_8016E68 + b _080178C8 +_080178A2: + bl sub_8090A34 + cmp r0, 0x13 + ble _080178B2 + movs r0, 0x6 + bl sub_8016E68 + b _080178C8 +_080178B2: + movs r0, 0x14 + bl sub_8016E68 + b _080178C8 +_080178BA: + movs r0, 0x2 + bl sub_8016E68 + b _080178C8 +_080178C2: + movs r0, 0x3 + bl sub_8016E68 +_080178C8: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8017828 + + thumb_func_start sub_80178D0 +sub_80178D0: + push {r4,lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0801791E + ldr r0, [sp] + cmp r0, 0x4 + beq _080178F4 + cmp r0, 0x4 + bgt _080178EE + cmp r0, 0x1 + beq _08017918 + b _0801791E +_080178EE: + cmp r0, 0x5 + beq _08017918 + b _0801791E +_080178F4: + ldr r4, _08017914 + ldr r0, [r4] + adds r0, 0xC + bl sub_80917B8 + ldr r0, [r4] + ldr r0, [r0, 0x10] + bl sub_80911F8 + bl sub_80910B4 + movs r0, 0x13 + bl sub_8016E68 + b _0801791E + .align 2, 0 +_08017914: .4byte gUnknown_203B208 +_08017918: + movs r0, 0xE + bl sub_8016E68 +_0801791E: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80178D0 + + thumb_func_start sub_8017928 +sub_8017928: + push {lr} + sub sp, 0x8 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080179A2 + ldr r0, [sp] + cmp r0, 0x4 + beq _0801794C + cmp r0, 0x4 + bgt _08017946 + cmp r0, 0x1 + beq _0801799C + b _080179A2 +_08017946: + cmp r0, 0x5 + beq _0801799C + b _080179A2 +_0801794C: + ldr r0, _0801798C + ldr r1, [r0] + ldr r0, _08017990 + ldr r3, [r0] + ldrb r0, [r3, 0xE] + lsls r0, 1 + adds r1, 0x50 + adds r1, r0 + ldrb r2, [r3, 0xD] + ldrh r0, [r1] + subs r0, r2 + strh r0, [r1] + ldrb r2, [r3, 0xE] + ldr r1, _08017994 + ldr r0, [sp, 0x4] + ands r0, r1 + orrs r0, r2 + str r0, [sp, 0x4] + ldrb r1, [r3, 0xD] + lsls r1, 8 + ldr r2, _08017998 + ands r0, r2 + orrs r0, r1 + str r0, [sp, 0x4] + add r0, sp, 0x4 + bl sub_8091274 + movs r0, 0x1D + bl sub_8016E68 + b _080179A2 + .align 2, 0 +_0801798C: .4byte gUnknown_203B460 +_08017990: .4byte gUnknown_203B208 +_08017994: .4byte 0xffffff00 +_08017998: .4byte 0xffff00ff +_0801799C: + movs r0, 0x17 + bl sub_8016E68 +_080179A2: + add sp, 0x8 + pop {r0} + bx r0 + thumb_func_end sub_8017928 + + thumb_func_start sub_80179A8 +sub_80179A8: + push {r4-r7,lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08017A12 + ldr r0, [sp] + cmp r0, 0x4 + beq _080179CC + cmp r0, 0x4 + bgt _080179C6 + cmp r0, 0x1 + beq _08017A0C + b _08017A12 +_080179C6: + cmp r0, 0x5 + beq _08017A0C + b _08017A12 +_080179CC: + movs r5, 0 + ldr r6, _08017A08 + movs r7, 0 +_080179D2: + adds r0, r5, 0 + bl sub_801AED0 + cmp r0, 0 + beq _080179F2 + lsls r4, r5, 2 + ldr r0, [r6] + adds r0, r4 + bl sub_80917B8 + ldr r0, [r6] + adds r0, r4 + strb r7, [r0, 0x2] + ldr r0, [r6] + adds r0, r4 + strb r7, [r0] +_080179F2: + adds r5, 0x1 + cmp r5, 0x13 + ble _080179D2 + bl sub_80910B4 + bl sub_801AE84 + movs r0, 0x13 + bl sub_8016E68 + b _08017A12 + .align 2, 0 +_08017A08: .4byte gUnknown_203B460 +_08017A0C: + movs r0, 0xE + bl sub_8016E68 +_08017A12: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80179A8 + + thumb_func_start sub_8017A1C +sub_8017A1C: + push {r4-r6,lr} + sub sp, 0x8 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08017AEE + ldr r0, [sp] + cmp r0, 0x4 + beq _08017A40 + cmp r0, 0x4 + bgt _08017A3A + cmp r0, 0x1 + beq _08017AE8 + b _08017AEE +_08017A3A: + cmp r0, 0x5 + beq _08017AE8 + b _08017AEE +_08017A40: + movs r5, 0 + ldr r6, _08017A88 +_08017A44: + lsls r0, r5, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_801CFE0 + cmp r0, 0 + beq _08017ACE + ldr r1, _08017A8C + ldr r0, [sp, 0x4] + ands r0, r1 + orrs r0, r4 + str r0, [sp, 0x4] + add r4, sp, 0x4 + ldrb r0, [r4] + bl sub_8090A60 + lsls r0, 24 + cmp r0, 0 + beq _08017AA2 + ldr r2, _08017A90 + ldr r1, [r2] + ldrb r0, [r4] + lsls r0, 1 + adds r1, 0x50 + adds r1, r0 + ldrh r1, [r1] + cmp r1, 0x63 + bls _08017A94 + ldr r0, [sp, 0x4] + ands r0, r6 + movs r1, 0xC6 + lsls r1, 7 + b _08017A9C + .align 2, 0 +_08017A88: .4byte 0xffff00ff +_08017A8C: .4byte 0xffffff00 +_08017A90: .4byte gUnknown_203B460 +_08017A94: + lsls r1, 24 + lsrs r1, 16 + ldr r0, [sp, 0x4] + ands r0, r6 +_08017A9C: + orrs r0, r1 + str r0, [sp, 0x4] + b _08017AB0 +_08017AA2: + ldr r0, [sp, 0x4] + ands r0, r6 + movs r1, 0x80 + lsls r1, 1 + orrs r0, r1 + str r0, [sp, 0x4] + ldr r2, _08017AE4 +_08017AB0: + ldr r3, [r2] + add r0, sp, 0x4 + ldrb r1, [r4] + lsls r1, 1 + adds r3, 0x50 + adds r3, r1 + ldr r1, [sp, 0x4] + lsrs r1, 8 + lsls r1, 24 + lsrs r1, 24 + ldrh r2, [r3] + subs r2, r1 + strh r2, [r3] + bl sub_8091274 +_08017ACE: + adds r5, 0x1 + cmp r5, 0xEF + ble _08017A44 + bl sub_80910B4 + bl sub_801CF94 + movs r0, 0x1D + bl sub_8016E68 + b _08017AEE + .align 2, 0 +_08017AE4: .4byte gUnknown_203B460 +_08017AE8: + movs r0, 0x17 + bl sub_8016E68 +_08017AEE: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8017A1C + + thumb_func_start sub_8017AF8 +sub_8017AF8: + push {lr} + movs r0, 0x1 + bl sub_801A6E8 + cmp r0, 0x3 + beq _08017B14 + cmp r0, 0x3 + bhi _08017B0E + cmp r0, 0x2 + beq _08017B78 + b _08017B82 +_08017B0E: + cmp r0, 0x4 + beq _08017B50 + b _08017B82 +_08017B14: + bl sub_801AEA8 + cmp r0, 0 + beq _08017B2A + movs r0, 0 + bl sub_8099690 + movs r0, 0x12 + bl sub_8016E68 + b _08017B82 +_08017B2A: + bl sub_801A8AC + ldr r1, _08017B48 + ldr r2, [r1] + str r0, [r2, 0x10] + ldr r1, _08017B4C + ldr r1, [r1] + lsls r0, 2 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0xC] + movs r0, 0xF + bl sub_8016E68 + b _08017B82 + .align 2, 0 +_08017B48: .4byte gUnknown_203B208 +_08017B4C: .4byte gUnknown_203B460 +_08017B50: + bl sub_801A8AC + ldr r1, _08017B70 + ldr r2, [r1] + str r0, [r2, 0x10] + ldr r1, _08017B74 + ldr r1, [r1] + lsls r0, 2 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0xC] + movs r0, 0x10 + bl sub_8016E68 + b _08017B82 + .align 2, 0 +_08017B70: .4byte gUnknown_203B208 +_08017B74: .4byte gUnknown_203B460 +_08017B78: + bl sub_801A928 + movs r0, 0x1 + bl sub_8016E68 +_08017B82: + pop {r0} + bx r0 + thumb_func_end sub_8017AF8 + + thumb_func_start sub_8017B88 +sub_8017B88: + push {r4,lr} + movs r0, 0x1 + bl sub_801CA08 + cmp r0, 0x2 + beq _08017C10 + cmp r0, 0x2 + bhi _08017B9E + cmp r0, 0x1 + beq _08017C1C + b _08017C22 +_08017B9E: + cmp r0, 0x3 + beq _08017BA8 + cmp r0, 0x4 + beq _08017BE4 + b _08017C22 +_08017BA8: + bl sub_801CFB8 + cmp r0, 0 + beq _08017BB8 + movs r0, 0x1C + bl sub_8016E68 + b _08017C22 +_08017BB8: + bl sub_801CB24 + ldr r4, _08017BE0 + ldr r1, [r4] + strb r0, [r1, 0x14] + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0xC + ldrb r1, [r1, 0x14] + movs r2, 0 + bl sub_8090A8C + ldr r1, [r4] + movs r0, 0x1 + strb r0, [r1, 0xD] + movs r0, 0x19 + bl sub_8016E68 + b _08017C22 + .align 2, 0 +_08017BE0: .4byte gUnknown_203B208 +_08017BE4: + bl sub_801CB24 + ldr r4, _08017C0C + ldr r1, [r4] + strb r0, [r1, 0x14] + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0xC + ldrb r1, [r1, 0x14] + movs r2, 0 + bl sub_8090A8C + ldr r1, [r4] + movs r0, 0x1 + strb r0, [r1, 0xD] + movs r0, 0x1A + bl sub_8016E68 + b _08017C22 + .align 2, 0 +_08017C0C: .4byte gUnknown_203B208 +_08017C10: + bl sub_801CBB8 + movs r0, 0x1 + bl sub_8016E68 + b _08017C22 +_08017C1C: + movs r0, 0 + bl sub_801AD34 +_08017C22: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8017B88 + + thumb_func_start sub_8017C28 +sub_8017C28: + push {r4,lr} + movs r0, 0 + bl sub_801CA08 + ldr r4, _08017C54 + ldr r0, [r4] + adds r0, 0x58 + bl sub_8012FD8 + ldr r0, [r4] + adds r0, 0xA8 + bl sub_8013BBC + cmp r0, 0x1 + beq _08017C58 + cmp r0, 0x1 + bcc _08017C76 + cmp r0, 0x2 + beq _08017C70 + cmp r0, 0x3 + beq _08017C5E + b _08017C76 + .align 2, 0 +_08017C54: .4byte gUnknown_203B208 +_08017C58: + bl sub_8017598 + b _08017C76 +_08017C5E: + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0xA8 + ldr r1, [r1] + strb r1, [r0, 0xD] + movs r0, 0x1B + bl sub_8016E68 + b _08017C76 +_08017C70: + movs r0, 0x17 + bl sub_8016E68 +_08017C76: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8017C28 + + thumb_func_start sub_8017C7C +sub_8017C7C: + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + bl sub_801A6E8 + ldr r4, _08017CBC + ldr r0, [r4] + adds r0, 0x58 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _08017CAC + ldr r0, [r4] + adds r0, 0x58 + mov r1, sp + bl sub_8013114 + ldr r1, [sp] + cmp r1, 0x1 + beq _08017CAC + ldr r0, [r4] + str r1, [r0, 0x1C] +_08017CAC: + ldr r0, [sp] + cmp r0, 0x2 + beq _08017CC6 + cmp r0, 0x2 + bgt _08017CC0 + cmp r0, 0x1 + beq _08017D14 + b _08017D1A + .align 2, 0 +_08017CBC: .4byte gUnknown_203B208 +_08017CC0: + cmp r0, 0x6 + beq _08017D06 + b _08017D1A +_08017CC6: + movs r0, 0 + bl sub_8099690 + ldr r4, _08017CE4 + ldr r0, [r4] + ldrb r0, [r0, 0xE] + bl sub_8091524 + lsls r0, 24 + cmp r0, 0 + bne _08017CE8 + movs r0, 0x9 + bl sub_8016E68 + b _08017D1A + .align 2, 0 +_08017CE4: .4byte gUnknown_203B208 +_08017CE8: + ldr r0, [r4] + ldr r0, [r0, 0x10] + bl sub_801ADA0 + lsls r0, 24 + cmp r0, 0 + bne _08017CFE + movs r0, 0xA + bl sub_8016E68 + b _08017D1A +_08017CFE: + movs r0, 0x11 + bl sub_8016E68 + b _08017D1A +_08017D06: + movs r0, 0 + bl sub_8099690 + movs r0, 0x10 + bl sub_8016E68 + b _08017D1A +_08017D14: + movs r0, 0xE + bl sub_8016E68 +_08017D1A: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8017C7C + + thumb_func_start sub_8017D24 +sub_8017D24: + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + bl sub_801CA08 + ldr r4, _08017D64 + ldr r0, [r4] + adds r0, 0x58 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _08017D54 + ldr r0, [r4] + adds r0, 0x58 + mov r1, sp + bl sub_8013114 + ldr r1, [sp] + cmp r1, 0x1 + beq _08017D54 + ldr r0, [r4] + str r1, [r0, 0x20] +_08017D54: + ldr r0, [sp] + cmp r0, 0x3 + beq _08017D6E + cmp r0, 0x3 + bgt _08017D68 + cmp r0, 0x1 + beq _08017DB0 + b _08017DB6 + .align 2, 0 +_08017D64: .4byte gUnknown_203B208 +_08017D68: + cmp r0, 0x6 + beq _08017DA8 + b _08017DB6 +_08017D6E: + bl sub_8090A34 + cmp r0, 0x13 + ble _08017D82 + bl sub_801CBB8 + movs r0, 0x6 + bl sub_8016E68 + b _08017DB6 +_08017D82: + ldr r0, _08017D9C + ldr r0, [r0] + ldrb r0, [r0, 0xE] + bl sub_8090A60 + lsls r0, 24 + cmp r0, 0 + beq _08017DA0 + movs r0, 0x18 + bl sub_8016E68 + b _08017DB6 + .align 2, 0 +_08017D9C: .4byte gUnknown_203B208 +_08017DA0: + movs r0, 0x1B + bl sub_8016E68 + b _08017DB6 +_08017DA8: + movs r0, 0x1A + bl sub_8016E68 + b _08017DB6 +_08017DB0: + movs r0, 0x17 + bl sub_8016E68 +_08017DB6: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8017D24 + + thumb_func_start sub_8017DC0 +sub_8017DC0: + push {lr} + bl sub_801B410 + cmp r0, 0x1 + bls _08017DD8 + cmp r0, 0x3 + bhi _08017DD8 + bl sub_801B450 + movs r0, 0xE + bl sub_8016E68 +_08017DD8: + pop {r0} + bx r0 + thumb_func_end sub_8017DC0 + + thumb_func_start sub_8017DDC +sub_8017DDC: + push {lr} + bl sub_801B410 + cmp r0, 0x1 + bls _08017DF4 + cmp r0, 0x3 + bhi _08017DF4 + bl sub_801B450 + movs r0, 0x17 + bl sub_8016E68 +_08017DF4: + pop {r0} + bx r0 + thumb_func_end sub_8017DDC + + thumb_func_start sub_8017DF8 +sub_8017DF8: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08017E10 + ldr r0, _08017E18 + ldr r0, [r0] + ldr r0, [r0, 0x8] + bl sub_8016E68 +_08017E10: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08017E18: .4byte gUnknown_203B208 + thumb_func_end sub_8017DF8 + + thumb_func_start sub_8017E1C +sub_8017E1C: + push {r4,lr} + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r4, _08017E50 + movs r0, 0xA8 + lsls r0, 1 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r4] + movs r1, 0 + str r1, [r0, 0x14] + str r1, [r0, 0x18] + str r1, [r0, 0x1C] + movs r0, 0 + bl sub_8017F10 + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08017E50: .4byte gUnknown_203B20C + thumb_func_end sub_8017E1C + + thumb_func_start sub_8017E54 +sub_8017E54: + push {lr} + ldr r0, _08017E6C + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0xE + bhi _08017EEC + lsls r0, 2 + ldr r1, _08017E70 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08017E6C: .4byte gUnknown_203B20C +_08017E70: .4byte _08017E74 + .align 2, 0 +_08017E74: + .4byte _08017EB0 + .4byte _08017EB8 + .4byte _08017EEC + .4byte _08017EE8 + .4byte _08017EBE + .4byte _08017EBE + .4byte _08017EC4 + .4byte _08017ECA + .4byte _08017EEC + .4byte _08017EEC + .4byte _08017ED0 + .4byte _08017ED0 + .4byte _08017ED6 + .4byte _08017EDC + .4byte _08017EE2 +_08017EB0: + movs r0, 0x1 + bl sub_8017F10 + b _08017EEC +_08017EB8: + bl sub_8018588 + b _08017EEC +_08017EBE: + bl sub_8018620 + b _08017EEC +_08017EC4: + bl sub_8018904 + b _08017EEC +_08017ECA: + bl sub_8018AC8 + b _08017EEC +_08017ED0: + bl sub_80186F8 + b _08017EEC +_08017ED6: + bl sub_8018854 + b _08017EEC +_08017EDC: + bl sub_80189C8 + b _08017EEC +_08017EE2: + bl sub_8018AE4 + b _08017EEC +_08017EE8: + movs r0, 0x3 + b _08017EEE +_08017EEC: + movs r0, 0 +_08017EEE: + pop {r1} + bx r1 + thumb_func_end sub_8017E54 + + thumb_func_start sub_8017EF4 +sub_8017EF4: + push {r4,lr} + ldr r4, _08017F0C + ldr r0, [r4] + cmp r0, 0 + beq _08017F06 + bl MemoryFree + movs r0, 0 + str r0, [r4] +_08017F06: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08017F0C: .4byte gUnknown_203B20C + thumb_func_end sub_8017EF4 + + thumb_func_start sub_8017F10 +sub_8017F10: + push {lr} + ldr r1, _08017F24 + ldr r1, [r1] + str r0, [r1] + bl sub_8017F28 + bl sub_8018100 + pop {r0} + bx r0 + .align 2, 0 +_08017F24: .4byte gUnknown_203B20C + thumb_func_end sub_8017F10 + + thumb_func_start sub_8017F28 +sub_8017F28: + push {r4-r7,lr} + ldr r4, _08017F48 + ldr r0, [r4] + adds r0, 0xF0 + bl sub_8006518 + ldr r0, [r4] + ldr r0, [r0] + cmp r0, 0xD + bls _08017F3E + b _080180BC +_08017F3E: + lsls r0, 2 + ldr r1, _08017F4C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08017F48: .4byte gUnknown_203B20C +_08017F4C: .4byte _08017F50 + .align 2, 0 +_08017F50: + .4byte _080180BC + .4byte _08017F88 + .4byte _080180BC + .4byte _080180BC + .4byte _08017FE8 + .4byte _08017FE8 + .4byte _0801809C + .4byte _080180BC + .4byte _080180BC + .4byte _080180BC + .4byte _08018034 + .4byte _08018034 + .4byte _08018084 + .4byte _0801809C +_08017F88: + ldr r4, _08017FDC + ldr r1, [r4] + ldr r2, _08017FE0 + adds r1, 0xF0 + adds r0, r2, 0 + ldm r0!, {r3,r5,r6} + stm r1!, {r3,r5,r6} + ldm r0!, {r3,r5,r7} + stm r1!, {r3,r5,r7} + ldr r1, [r4] + movs r6, 0x84 + lsls r6, 1 + adds r1, r6 + adds r0, r2, 0 + ldm r0!, {r3,r5,r7} + stm r1!, {r3,r5,r7} + ldm r0!, {r3,r6,r7} + stm r1!, {r3,r6,r7} + ldr r0, [r4] + adds r0, 0xF0 + ldm r2!, {r5-r7} + stm r0!, {r5-r7} + ldm r2!, {r1,r3,r5} + stm r0!, {r1,r3,r5} + bl sub_80182E4 + ldr r2, [r4] + movs r0, 0x90 + lsls r0, 1 + adds r2, r0 + ldr r1, _08017FE4 + ldm r1!, {r3,r6,r7} + stm r2!, {r3,r6,r7} + ldm r1!, {r5-r7} + stm r2!, {r5-r7} + ldr r1, [r4] + adds r0, r1, r0 + adds r1, 0x20 + bl sub_8012CAC + b _080180E0 + .align 2, 0 +_08017FDC: .4byte gUnknown_203B20C +_08017FE0: .4byte gUnknown_80DB7B8 +_08017FE4: .4byte gUnknown_80DB7D0 +_08017FE8: + ldr r3, _0801802C + ldr r1, [r3] + ldr r2, _08018030 + adds r1, 0xF0 + adds r0, r2, 0 + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldm r0!, {r4,r5,r7} + stm r1!, {r4,r5,r7} + ldr r1, [r3] + movs r6, 0x84 + lsls r6, 1 + adds r1, r6 + adds r0, r2, 0 + ldm r0!, {r4,r5,r7} + stm r1!, {r4,r5,r7} + ldm r0!, {r4,r6,r7} + stm r1!, {r4,r6,r7} + ldr r1, [r3] + movs r5, 0x90 + lsls r5, 1 + adds r1, r5 + adds r0, r2, 0 + ldm r0!, {r4,r6,r7} + stm r1!, {r4,r6,r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldr r0, [r3] + adds r0, 0xF0 + ldm r2!, {r1,r3,r4} + stm r0!, {r1,r3,r4} + ldm r2!, {r5-r7} + stm r0!, {r5-r7} + b _080180E0 + .align 2, 0 +_0801802C: .4byte gUnknown_203B20C +_08018030: .4byte gUnknown_80DB7B8 +_08018034: + ldr r3, _08018078 + ldr r1, [r3] + ldr r2, _0801807C + adds r1, 0xF0 + adds r0, r2, 0 + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldm r0!, {r4,r5,r7} + stm r1!, {r4,r5,r7} + ldr r1, [r3] + movs r6, 0x84 + lsls r6, 1 + adds r1, r6 + adds r0, r2, 0 + ldm r0!, {r4,r5,r7} + stm r1!, {r4,r5,r7} + ldm r0!, {r4,r6,r7} + stm r1!, {r4,r6,r7} + ldr r0, [r3] + movs r5, 0x90 + lsls r5, 1 + adds r0, r5 + ldm r2!, {r1,r6,r7} + stm r0!, {r1,r6,r7} + ldm r2!, {r4-r6} + stm r0!, {r4-r6} + ldr r1, [r3] + adds r1, 0xF0 + ldr r0, _08018080 + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + b _080180E0 + .align 2, 0 +_08018078: .4byte gUnknown_203B20C +_0801807C: .4byte gUnknown_80DB7B8 +_08018080: .4byte gUnknown_80DB800 +_08018084: + ldr r0, _08018094 + ldr r1, [r0] + movs r7, 0x84 + lsls r7, 1 + adds r1, r7 + ldr r0, _08018098 + b _080180A8 + .align 2, 0 +_08018094: .4byte gUnknown_203B20C +_08018098: .4byte gUnknown_80DB818 +_0801809C: + ldr r0, _080180B4 + ldr r1, [r0] + movs r0, 0x90 + lsls r0, 1 + adds r1, r0 + ldr r0, _080180B8 +_080180A8: + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + b _080180E0 + .align 2, 0 +_080180B4: .4byte gUnknown_203B20C +_080180B8: .4byte gUnknown_80DB7E8 +_080180BC: + ldr r0, _080180F8 + mov r12, r0 + ldr r4, _080180FC + movs r3, 0 + movs r2, 0x3 +_080180C6: + mov r5, r12 + ldr r1, [r5] + adds r1, r3 + adds r1, 0xF0 + adds r0, r4, 0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r3, 0x18 + subs r2, 0x1 + cmp r2, 0 + bge _080180C6 +_080180E0: + bl sub_8004914 + ldr r0, _080180F8 + ldr r0, [r0] + adds r0, 0xF0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080180F8: .4byte gUnknown_203B20C +_080180FC: .4byte gUnknown_80DB7B8 + thumb_func_end sub_8017F28 + + thumb_func_start sub_8018100 +sub_8018100: + push {r4,lr} + sub sp, 0x8 + ldr r1, _0801811C + ldr r0, [r1] + ldr r0, [r0] + adds r4, r1, 0 + cmp r0, 0xE + bls _08018112 + b _08018278 +_08018112: + lsls r0, 2 + ldr r1, _08018120 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801811C: .4byte gUnknown_203B20C +_08018120: .4byte _08018124 + .align 2, 0 +_08018124: + .4byte _08018278 + .4byte _08018160 + .4byte _08018278 + .4byte _08018278 + .4byte _08018172 + .4byte _08018180 + .4byte _08018188 + .4byte _080181A8 + .4byte _08018278 + .4byte _08018278 + .4byte _080181B2 + .4byte _080181C0 + .4byte _080181CE + .4byte _0801823C + .4byte _08018270 +_08018160: + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0x70 + adds r1, r2, 0 + adds r1, 0x20 + adds r3, r2, 0 + adds r3, 0x60 + ldr r2, [r2, 0x14] + b _0801825C +_08018172: + movs r0, 0x3 + movs r1, 0x3 + movs r2, 0 + movs r3, 0xA + bl sub_801A5D8 + b _08018278 +_08018180: + movs r0, 0x1 + bl sub_801A8D0 + b _08018278 +_08018188: + bl sub_801A9E0 + bl sub_801841C + ldr r0, _080181A4 + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x70 + adds r1, r2, 0 + adds r1, 0x20 + adds r3, r2, 0 + adds r3, 0x60 + ldr r2, [r2, 0x18] + b _0801825C + .align 2, 0 +_080181A4: .4byte gUnknown_203B20C +_080181A8: + ldr r0, [r4] + adds r0, 0x8 + bl sub_801B3C0 + b _08018278 +_080181B2: + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0 + movs r3, 0xA + bl sub_801C8C4 + b _080181C6 +_080181C0: + movs r0, 0x1 + bl sub_801CB5C +_080181C6: + movs r0, 0 + bl sub_801AD34 + b _08018278 +_080181CE: + ldr r2, [r4] + adds r1, r2, 0 + adds r1, 0xD0 + movs r0, 0x2 + str r0, [r1] + subs r1, 0x8 + movs r0, 0x1 + str r0, [r1] + ldr r0, _080181F8 + ldr r1, [r0] + ldrb r0, [r2, 0xA] + lsls r0, 1 + adds r1, 0x50 + adds r3, r1, r0 + ldrh r0, [r3] + cmp r0, 0x63 + bls _080181FC + adds r1, r2, 0 + adds r1, 0xCC + movs r0, 0x63 + b _08018202 + .align 2, 0 +_080181F8: .4byte gUnknown_203B460 +_080181FC: + adds r1, r2, 0 + adds r1, 0xCC + ldrh r0, [r3] +_08018202: + str r0, [r1] + ldr r2, [r4] + adds r1, r2, 0 + adds r1, 0xC4 + adds r0, r2, 0 + adds r0, 0xCC + ldr r0, [r0] + str r0, [r1] + adds r1, 0x10 + movs r0, 0x1 + str r0, [r1] + adds r1, 0x4 + movs r3, 0x84 + lsls r3, 1 + adds r0, r2, r3 + str r0, [r1] + adds r1, 0x4 + movs r0, 0x28 + str r0, [r1] + adds r1, 0x4 + movs r0, 0x12 + str r0, [r1] + adds r0, r2, 0 + adds r0, 0xC0 + bl sub_8013AA0 + bl sub_8018280 + b _08018278 +_0801823C: + bl sub_801CCD8 + movs r0, 0 + bl sub_801AD34 + bl sub_80184D4 + ldr r0, _0801826C + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x70 + adds r1, r2, 0 + adds r1, 0x20 + adds r3, r2, 0 + adds r3, 0x60 + ldr r2, [r2, 0x1C] +_0801825C: + str r2, [sp] + movs r2, 0x2 + str r2, [sp, 0x4] + movs r2, 0 + bl sub_8012D60 + b _08018278 + .align 2, 0 +_0801826C: .4byte gUnknown_203B20C +_08018270: + ldr r0, [r4] + adds r0, 0x8 + bl sub_801B3C0 +_08018278: + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8018100 + + thumb_func_start sub_8018280 +sub_8018280: + push {r4,lr} + sub sp, 0x4 + ldr r4, _080182DC + ldr r0, [r4] + adds r0, 0xD4 + ldr r0, [r0] + bl sub_8008C54 + ldr r0, [r4] + adds r0, 0xD4 + ldr r0, [r0] + bl sub_80073B8 + ldr r2, _080182E0 + ldr r0, [r4] + adds r0, 0xD4 + ldr r3, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0x4 + movs r1, 0 + bl xxx_call_draw_string + ldr r0, [r4] + adds r0, 0xC0 + bl sub_8013C68 + ldr r0, [r4] + adds r0, 0xD4 + ldr r0, [r0] + bl sub_80073E0 + bl sub_801CCD8 + movs r0, 0 + bl sub_801AD34 + ldr r0, [r4] + adds r0, 0x70 + movs r1, 0 + bl sub_8012EA4 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080182DC: .4byte gUnknown_203B20C +_080182E0: .4byte gUnknown_80DB830 + thumb_func_end sub_8018280 + + thumb_func_start sub_80182E4 +sub_80182E4: + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r0, 0 + mov r8, r0 + ldr r4, _080183DC + ldr r0, [r4] + adds r0, 0x60 + movs r1, 0 + movs r2, 0x10 + bl MemoryFill16 + ldr r1, [r4] + ldr r0, _080183E0 + ldr r0, [r0] + str r0, [r1, 0x20] + movs r0, 0x2 + str r0, [r1, 0x24] + bl sub_8090A34 + cmp r0, 0 + beq _0801831C + movs r0, 0 + bl sub_801CF50 + lsls r0, 24 + cmp r0, 0 + beq _08018324 +_0801831C: + ldr r0, [r4] + adds r0, 0x60 + movs r1, 0x1 + strh r1, [r0] +_08018324: + movs r1, 0x1 + add r8, r1 + ldr r4, _080183DC + ldr r2, [r4] + mov r0, r8 + lsls r3, r0, 3 + adds r0, r2, 0 + adds r0, 0x20 + adds r0, r3 + ldr r1, _080183E4 + ldr r1, [r1] + str r1, [r0] + adds r2, 0x24 + adds r2, r3 + movs r0, 0x3 + str r0, [r2] + movs r0, 0x1 + bl sub_801CF14 + lsls r0, 24 + cmp r0, 0 + bne _08018358 + bl sub_8090A34 + cmp r0, 0x13 + ble _08018366 +_08018358: + ldr r0, [r4] + mov r2, r8 + lsls r1, r2, 1 + adds r0, 0x60 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0] +_08018366: + movs r0, 0x1 + add r8, r0 + ldr r4, _080183DC + ldr r7, [r4] + mov r2, r8 + lsls r1, r2, 3 + adds r2, r7, 0 + adds r2, 0x20 + adds r3, r2, r1 + ldr r0, _080183E8 + ldr r0, [r0] + str r0, [r3] + adds r6, r7, 0 + adds r6, 0x24 + adds r1, r6, r1 + movs r3, 0x1 + str r3, [r1] + add r8, r3 + mov r1, r8 + lsls r0, r1, 3 + adds r2, r0 + movs r1, 0 + str r1, [r2] + adds r0, r6, r0 + str r3, [r0] + movs r5, 0 + mov r12, r4 + cmp r5, r8 + bge _080183C0 + adds r4, r7, 0 + adds r2, r4, 0 + adds r2, 0x60 + adds r3, r6, 0 +_080183A8: + ldrh r0, [r2] + cmp r0, 0 + bne _080183B6 + ldr r1, [r3] + ldr r0, [r4, 0x14] + cmp r1, r0 + beq _08018410 +_080183B6: + adds r2, 0x2 + adds r3, 0x8 + adds r5, 0x1 + cmp r5, r8 + blt _080183A8 +_080183C0: + movs r5, 0 + cmp r5, r8 + bge _08018410 + mov r2, r12 + ldr r1, [r2] + adds r0, r1, 0 + adds r0, 0x60 + ldrh r0, [r0] + cmp r0, 0 + bne _080183EC + ldr r0, [r1, 0x24] + str r0, [r1, 0x14] + b _08018410 + .align 2, 0 +_080183DC: .4byte gUnknown_203B20C +_080183E0: .4byte gUnknown_80D4958 +_080183E4: .4byte gUnknown_80D4964 +_080183E8: .4byte gUnknown_80D4934 +_080183EC: + adds r5, 0x1 + cmp r5, r8 + bge _08018410 + mov r0, r12 + ldr r2, [r0] + lsls r0, r5, 1 + adds r1, r2, 0 + adds r1, 0x60 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _080183EC + lsls r0, r5, 3 + adds r1, r2, 0 + adds r1, 0x24 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x14] +_08018410: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80182E4 + + thumb_func_start sub_801841C +sub_801841C: + push {r4-r7,lr} + ldr r4, _080184A0 + ldr r0, [r4] + adds r0, 0x60 + movs r1, 0 + movs r2, 0x10 + bl MemoryFill16 + ldr r1, [r4] + ldr r0, _080184A4 + ldr r0, [r0] + str r0, [r1, 0x20] + movs r0, 0x2 + str r0, [r1, 0x24] + ldr r0, [r1, 0xC] + bl sub_801ADA0 + lsls r0, 24 + cmp r0, 0 + bne _0801844C + ldr r0, [r4] + adds r0, 0x60 + movs r1, 0x1 + strh r1, [r0] +_0801844C: + ldr r2, [r4] + movs r1, 0x1 + ldr r0, _080184A8 + ldr r0, [r0] + str r0, [r2, 0x28] + movs r0, 0x4 + str r0, [r2, 0x2C] + movs r5, 0x2 + movs r0, 0 + str r0, [r2, 0x30] + str r1, [r2, 0x34] + movs r3, 0 + adds r6, r4, 0 + mov r12, r2 + mov r4, r12 + adds r4, 0x60 + adds r2, 0x24 +_0801846E: + ldrh r0, [r4] + cmp r0, 0 + bne _0801847E + ldr r1, [r2] + mov r7, r12 + ldr r0, [r7, 0x18] + cmp r1, r0 + beq _080184CE +_0801847E: + adds r4, 0x2 + adds r2, 0x8 + adds r3, 0x1 + cmp r3, r5 + blt _0801846E + movs r3, 0 + cmp r3, r5 + bge _080184CE + ldr r1, [r6] + adds r0, r1, 0 + adds r0, 0x60 + ldrh r0, [r0] + cmp r0, 0 + bne _080184AC + ldr r0, [r1, 0x24] + str r0, [r1, 0x18] + b _080184CE + .align 2, 0 +_080184A0: .4byte gUnknown_203B20C +_080184A4: .4byte gUnknown_80D4958 +_080184A8: .4byte gUnknown_80D4970 +_080184AC: + adds r3, 0x1 + cmp r3, r5 + bge _080184CE + ldr r2, [r6] + lsls r0, r3, 1 + adds r1, r2, 0 + adds r1, 0x60 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _080184AC + lsls r0, r3, 3 + adds r1, r2, 0 + adds r1, 0x24 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x18] +_080184CE: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_801841C + + thumb_func_start sub_80184D4 +sub_80184D4: + push {r4-r7,lr} + ldr r4, _08018554 + ldr r0, [r4] + adds r0, 0x60 + movs r1, 0 + movs r2, 0x10 + bl MemoryFill16 + ldr r1, [r4] + ldr r0, _08018558 + ldr r0, [r0] + str r0, [r1, 0x20] + movs r0, 0x3 + str r0, [r1, 0x24] + bl sub_8090A34 + cmp r0, 0x13 + ble _08018500 + ldr r0, [r4] + adds r0, 0x60 + movs r1, 0x1 + strh r1, [r0] +_08018500: + ldr r2, [r4] + movs r1, 0x1 + ldr r0, _0801855C + ldr r0, [r0] + str r0, [r2, 0x28] + movs r0, 0x4 + str r0, [r2, 0x2C] + movs r5, 0x2 + movs r0, 0 + str r0, [r2, 0x30] + str r1, [r2, 0x34] + movs r3, 0 + adds r6, r4, 0 + mov r12, r2 + mov r4, r12 + adds r4, 0x60 + adds r2, 0x24 +_08018522: + ldrh r0, [r4] + cmp r0, 0 + bne _08018532 + ldr r1, [r2] + mov r7, r12 + ldr r0, [r7, 0x1C] + cmp r1, r0 + beq _08018582 +_08018532: + adds r4, 0x2 + adds r2, 0x8 + adds r3, 0x1 + cmp r3, r5 + blt _08018522 + movs r3, 0 + cmp r3, r5 + bge _08018582 + ldr r1, [r6] + adds r0, r1, 0 + adds r0, 0x60 + ldrh r0, [r0] + cmp r0, 0 + bne _08018560 + ldr r0, [r1, 0x24] + str r0, [r1, 0x1C] + b _08018582 + .align 2, 0 +_08018554: .4byte gUnknown_203B20C +_08018558: .4byte gUnknown_80D4964 +_0801855C: .4byte gUnknown_80D4970 +_08018560: + adds r3, 0x1 + cmp r3, r5 + bge _08018582 + ldr r2, [r6] + lsls r0, r3, 1 + adds r1, r2, 0 + adds r1, 0x60 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _08018560 + lsls r0, r3, 3 + adds r1, r2, 0 + adds r1, 0x24 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x1C] +_08018582: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80184D4 + + thumb_func_start sub_8018588 +sub_8018588: + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + ldr r4, _080185C4 + ldr r0, [r4] + adds r0, 0x70 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _080185B4 + ldr r0, [r4] + adds r0, 0x70 + mov r1, sp + bl sub_8013114 + ldr r1, [sp] + cmp r1, 0x1 + beq _080185B4 + ldr r0, [r4] + str r1, [r0, 0x14] +_080185B4: + ldr r0, [sp] + cmp r0, 0x2 + beq _080185CE + cmp r0, 0x2 + bgt _080185C8 + cmp r0, 0x1 + beq _08018610 + b _08018616 + .align 2, 0 +_080185C4: .4byte gUnknown_203B20C +_080185C8: + cmp r0, 0x3 + beq _080185EA + b _08018616 +_080185CE: + bl sub_8090A34 + cmp r0, 0 + beq _080185F6 + movs r0, 0 + bl sub_801CF50 + lsls r0, 24 + cmp r0, 0 + bne _080185F6 + movs r0, 0x4 + bl sub_8017F10 + b _08018616 +_080185EA: + movs r0, 0x1 + bl sub_801CF14 + lsls r0, 24 + cmp r0, 0 + beq _08018608 +_080185F6: + ldr r0, _08018604 + ldr r0, [r0] + adds r0, 0x70 + movs r1, 0x1 + bl sub_8012EA4 + b _08018616 + .align 2, 0 +_08018604: .4byte gUnknown_203B20C +_08018608: + movs r0, 0xA + bl sub_8017F10 + b _08018616 +_08018610: + movs r0, 0x3 + bl sub_8017F10 +_08018616: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8018588 + + thumb_func_start sub_8018620 +sub_8018620: + push {r4-r7,lr} + movs r0, 0x1 + bl sub_801A6E8 + cmp r0, 0x3 + beq _0801863C + cmp r0, 0x3 + bhi _08018636 + cmp r0, 0x2 + beq _080186E8 + b _080186F2 +_08018636: + cmp r0, 0x4 + beq _080186C0 + b _080186F2 +_0801863C: + bl sub_801AEA8 + cmp r0, 0 + beq _08018698 + movs r5, 0 + ldr r6, _0801868C + movs r7, 0 +_0801864A: + adds r0, r5, 0 + bl sub_801AED0 + cmp r0, 0 + beq _0801866A + lsls r4, r5, 2 + ldr r0, [r6] + adds r0, r4 + bl sub_80917B8 + ldr r0, [r6] + adds r0, r4 + strb r7, [r0, 0x2] + ldr r0, [r6] + adds r0, r4 + strb r7, [r0] +_0801866A: + adds r5, 0x1 + cmp r5, 0x13 + ble _0801864A + bl sub_80910B4 + bl sub_801AE84 + bl sub_8090A34 + cmp r0, 0 + bne _08018690 + bl sub_801A928 + movs r0, 0x1 + bl sub_8017F10 + b _080186F2 + .align 2, 0 +_0801868C: .4byte gUnknown_203B460 +_08018690: + movs r0, 0x5 + bl sub_8017F10 + b _080186F2 +_08018698: + bl sub_801A8AC + ldr r1, _080186B8 + ldr r2, [r1] + str r0, [r2, 0xC] + ldr r1, _080186BC + ldr r1, [r1] + lsls r0, 2 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x8] + movs r0, 0x6 + bl sub_8017F10 + b _080186F2 + .align 2, 0 +_080186B8: .4byte gUnknown_203B20C +_080186BC: .4byte gUnknown_203B460 +_080186C0: + bl sub_801A8AC + ldr r1, _080186E0 + ldr r2, [r1] + str r0, [r2, 0xC] + ldr r1, _080186E4 + ldr r1, [r1] + lsls r0, 2 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x8] + movs r0, 0x7 + bl sub_8017F10 + b _080186F2 + .align 2, 0 +_080186E0: .4byte gUnknown_203B20C +_080186E4: .4byte gUnknown_203B460 +_080186E8: + bl sub_801A928 + movs r0, 0x1 + bl sub_8017F10 +_080186F2: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8018620 + + thumb_func_start sub_80186F8 +sub_80186F8: + push {r4-r7,lr} + sub sp, 0x4 + movs r0, 0x1 + bl sub_801CA08 + cmp r0, 0x2 + bne _08018708 + b _08018838 +_08018708: + cmp r0, 0x2 + bhi _08018714 + cmp r0, 0x1 + bne _08018712 + b _08018844 +_08018712: + b _0801884A +_08018714: + cmp r0, 0x3 + beq _0801871E + cmp r0, 0x4 + beq _0801880C + b _0801884A +_0801871E: + bl sub_801CFB8 + cmp r0, 0 + beq _080187E0 + movs r6, 0 + mov r5, sp + ldr r7, _0801876C +_0801872C: + lsls r0, r6, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_801CFE0 + cmp r0, 0 + beq _080187B2 + ldr r1, _08018770 + ldr r0, [sp] + ands r0, r1 + orrs r0, r4 + str r0, [sp] + ldrb r0, [r5] + bl sub_8090A60 + lsls r0, 24 + cmp r0, 0 + beq _08018786 + ldr r2, _08018774 + ldr r1, [r2] + ldrb r0, [r5] + lsls r0, 1 + adds r1, 0x50 + adds r1, r0 + ldrh r1, [r1] + cmp r1, 0x63 + bls _08018778 + ldr r0, [sp] + ands r0, r7 + movs r1, 0xC6 + lsls r1, 7 + b _08018780 + .align 2, 0 +_0801876C: .4byte 0xffff00ff +_08018770: .4byte 0xffffff00 +_08018774: .4byte gUnknown_203B460 +_08018778: + lsls r1, 24 + lsrs r1, 16 + ldr r0, [sp] + ands r0, r7 +_08018780: + orrs r0, r1 + str r0, [sp] + b _08018794 +_08018786: + ldr r0, [sp] + ands r0, r7 + movs r1, 0x80 + lsls r1, 1 + orrs r0, r1 + str r0, [sp] + ldr r2, _080187DC +_08018794: + ldr r2, [r2] + ldrb r0, [r5] + lsls r0, 1 + adds r2, 0x50 + adds r2, r0 + ldr r0, [sp] + lsrs r0, 8 + lsls r0, 24 + lsrs r0, 24 + ldrh r1, [r2] + subs r1, r0 + strh r1, [r2] + mov r0, sp + bl sub_8091274 +_080187B2: + adds r6, 0x1 + cmp r6, 0xEF + ble _0801872C + bl sub_80910B4 + bl sub_801CF94 + movs r0, 0x1 + bl sub_801CF14 + lsls r0, 24 + cmp r0, 0 + bne _08018838 + bl sub_8090A34 + cmp r0, 0x13 + bgt _08018838 + movs r0, 0xB + bl sub_8017F10 + b _0801884A + .align 2, 0 +_080187DC: .4byte gUnknown_203B460 +_080187E0: + bl sub_801CB24 + ldr r4, _08018808 + ldr r1, [r4] + strb r0, [r1, 0x10] + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x8 + ldrb r1, [r1, 0x10] + movs r2, 0 + bl sub_8090A8C + ldr r1, [r4] + movs r0, 0x1 + strb r0, [r1, 0x9] + movs r0, 0xD + bl sub_8017F10 + b _0801884A + .align 2, 0 +_08018808: .4byte gUnknown_203B20C +_0801880C: + bl sub_801CB24 + ldr r4, _08018834 + ldr r1, [r4] + strb r0, [r1, 0x10] + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x8 + ldrb r1, [r1, 0x10] + movs r2, 0 + bl sub_8090A8C + ldr r1, [r4] + movs r0, 0x1 + strb r0, [r1, 0x9] + movs r0, 0xE + bl sub_8017F10 + b _0801884A + .align 2, 0 +_08018834: .4byte gUnknown_203B20C +_08018838: + bl sub_801CBB8 + movs r0, 0x1 + bl sub_8017F10 + b _0801884A +_08018844: + movs r0, 0 + bl sub_801AD34 +_0801884A: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80186F8 + + thumb_func_start sub_8018854 +sub_8018854: + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + bl sub_801CA08 + ldr r4, _080188E0 + ldr r0, [r4] + adds r0, 0x70 + bl sub_8012FD8 + ldr r0, [r4] + adds r0, 0xC0 + bl sub_8013BBC + cmp r0, 0x1 + beq _080188F8 + cmp r0, 0x1 + bcc _080188FC + cmp r0, 0x2 + beq _080188F0 + cmp r0, 0x3 + bne _080188FC + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0xC0 + ldr r0, [r0] + strb r0, [r1, 0x9] + ldr r0, _080188E4 + ldr r1, [r0] + ldr r3, [r4] + ldrb r0, [r3, 0xA] + lsls r0, 1 + adds r1, 0x50 + adds r1, r0 + ldrb r2, [r3, 0x9] + ldrh r0, [r1] + subs r0, r2 + strh r0, [r1] + ldrb r2, [r3, 0xA] + ldr r1, _080188E8 + ldr r0, [sp] + ands r0, r1 + orrs r0, r2 + str r0, [sp] + ldrb r1, [r3, 0x9] + lsls r1, 8 + ldr r2, _080188EC + ands r0, r2 + orrs r0, r1 + str r0, [sp] + mov r0, sp + bl sub_8091274 + movs r0, 0x1 + bl sub_801CF14 + lsls r0, 24 + cmp r0, 0 + bne _080188D2 + bl sub_8090A34 + cmp r0, 0x13 + ble _080188F0 +_080188D2: + bl sub_801CBB8 + movs r0, 0x1 + bl sub_8017F10 + b _080188FC + .align 2, 0 +_080188E0: .4byte gUnknown_203B20C +_080188E4: .4byte gUnknown_203B460 +_080188E8: .4byte 0xffffff00 +_080188EC: .4byte 0xffff00ff +_080188F0: + movs r0, 0xB + bl sub_8017F10 + b _080188FC +_080188F8: + bl sub_8018280 +_080188FC: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8018854 + + thumb_func_start sub_8018904 +sub_8018904: + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + bl sub_801A6E8 + ldr r4, _08018944 + ldr r0, [r4] + adds r0, 0x70 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _08018934 + ldr r0, [r4] + adds r0, 0x70 + mov r1, sp + bl sub_8013114 + ldr r1, [sp] + cmp r1, 0x1 + beq _08018934 + ldr r0, [r4] + str r1, [r0, 0x18] +_08018934: + ldr r0, [sp] + cmp r0, 0x2 + beq _0801894E + cmp r0, 0x2 + bgt _08018948 + cmp r0, 0x1 + beq _080189BA + b _080189C0 + .align 2, 0 +_08018944: .4byte gUnknown_203B20C +_08018948: + cmp r0, 0x4 + beq _080189AC + b _080189C0 +_0801894E: + ldr r4, _08018978 + ldr r0, [r4] + ldrb r0, [r0, 0xA] + bl sub_8091524 + lsls r0, 24 + cmp r0, 0 + beq _0801896C + ldr r0, [r4] + ldr r0, [r0, 0xC] + bl sub_801ADA0 + lsls r0, 24 + cmp r0, 0 + bne _0801897C +_0801896C: + ldr r0, [r4] + adds r0, 0x70 + movs r1, 0x1 + bl sub_8012EA4 + b _080189C0 + .align 2, 0 +_08018978: .4byte gUnknown_203B20C +_0801897C: + ldr r0, [r4] + adds r0, 0x8 + bl sub_80917B8 + ldr r0, [r4] + ldr r0, [r0, 0xC] + bl sub_80911F8 + bl sub_80910B4 + bl sub_8090A34 + cmp r0, 0 + bne _080189A4 + bl sub_801A928 + movs r0, 0x1 + bl sub_8017F10 + b _080189C0 +_080189A4: + movs r0, 0x5 + bl sub_8017F10 + b _080189C0 +_080189AC: + movs r0, 0 + bl sub_8099690 + movs r0, 0x7 + bl sub_8017F10 + b _080189C0 +_080189BA: + movs r0, 0x5 + bl sub_8017F10 +_080189C0: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8018904 + + thumb_func_start sub_80189C8 +sub_80189C8: + push {r4,lr} + sub sp, 0x8 + movs r0, 0 + str r0, [sp] + bl sub_801CA08 + ldr r4, _08018A08 + ldr r0, [r4] + adds r0, 0x70 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _080189F8 + ldr r0, [r4] + adds r0, 0x70 + mov r1, sp + bl sub_8013114 + ldr r1, [sp] + cmp r1, 0x1 + beq _080189F8 + ldr r0, [r4] + str r1, [r0, 0x1C] +_080189F8: + ldr r0, [sp] + cmp r0, 0x3 + beq _08018A12 + cmp r0, 0x3 + bgt _08018A0C + cmp r0, 0x1 + beq _08018AB8 + b _08018ABE + .align 2, 0 +_08018A08: .4byte gUnknown_203B20C +_08018A0C: + cmp r0, 0x4 + beq _08018AB0 + b _08018ABE +_08018A12: + bl sub_8090A34 + cmp r0, 0x13 + ble _08018A2C + ldr r0, _08018A28 + ldr r0, [r0] + adds r0, 0x70 + movs r1, 0x1 + bl sub_8012EA4 + b _08018ABE + .align 2, 0 +_08018A28: .4byte gUnknown_203B20C +_08018A2C: + ldr r4, _08018A44 + ldr r0, [r4] + ldrb r0, [r0, 0xA] + bl sub_8090A60 + lsls r0, 24 + cmp r0, 0 + beq _08018A48 + movs r0, 0xC + bl sub_8017F10 + b _08018ABE + .align 2, 0 +_08018A44: .4byte gUnknown_203B20C +_08018A48: + ldr r0, _08018A9C + ldr r1, [r0] + ldr r3, [r4] + ldrb r0, [r3, 0xA] + lsls r0, 1 + adds r1, 0x50 + adds r1, r0 + ldrb r2, [r3, 0x9] + ldrh r0, [r1] + subs r0, r2 + strh r0, [r1] + ldrb r2, [r3, 0xA] + ldr r1, _08018AA0 + ldr r0, [sp, 0x4] + ands r0, r1 + orrs r0, r2 + str r0, [sp, 0x4] + ldrb r1, [r3, 0x9] + lsls r1, 8 + ldr r2, _08018AA4 + ands r0, r2 + orrs r0, r1 + str r0, [sp, 0x4] + add r0, sp, 0x4 + bl sub_8091274 + movs r0, 0x1 + bl sub_801CF14 + lsls r0, 24 + cmp r0, 0 + bne _08018A90 + bl sub_8090A34 + cmp r0, 0x13 + ble _08018AA8 +_08018A90: + bl sub_801CBB8 + movs r0, 0x1 + bl sub_8017F10 + b _08018ABE + .align 2, 0 +_08018A9C: .4byte gUnknown_203B460 +_08018AA0: .4byte 0xffffff00 +_08018AA4: .4byte 0xffff00ff +_08018AA8: + movs r0, 0xB + bl sub_8017F10 + b _08018ABE +_08018AB0: + movs r0, 0xE + bl sub_8017F10 + b _08018ABE +_08018AB8: + movs r0, 0xB + bl sub_8017F10 +_08018ABE: + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80189C8 + + thumb_func_start sub_8018AC8 +sub_8018AC8: + push {lr} + bl sub_801B410 + cmp r0, 0x1 + bls _08018AE0 + cmp r0, 0x3 + bhi _08018AE0 + bl sub_801B450 + movs r0, 0x5 + bl sub_8017F10 +_08018AE0: + pop {r0} + bx r0 + thumb_func_end sub_8018AC8 + + thumb_func_start sub_8018AE4 +sub_8018AE4: + push {lr} + bl sub_801B410 + cmp r0, 0x1 + bls _08018AFC + cmp r0, 0x3 + bhi _08018AFC + bl sub_801B450 + movs r0, 0xB + bl sub_8017F10 +_08018AFC: + pop {r0} + bx r0 + thumb_func_end sub_8018AE4 + + thumb_func_start sub_8018B00 +sub_8018B00: + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _08018B30 + movs r0, 0xA4 + lsls r0, 1 + movs r1, 0x8 + bl MemoryAlloc + adds r1, r0, 0 + str r1, [r5] + movs r2, 0 + str r2, [r1, 0x28] + str r2, [r1, 0x2C] + str r2, [r1, 0x30] + str r4, [r1] + cmp r4, 0x1 + beq _08018B3A + cmp r4, 0x1 + bcc _08018B34 + cmp r4, 0x2 + beq _08018B44 + cmp r4, 0x3 + beq _08018B80 + b _08018BAE + .align 2, 0 +_08018B30: .4byte gUnknown_203B210 +_08018B34: + movs r0, 0x1 + strb r0, [r1, 0x4] + b _08018B46 +_08018B3A: + strb r4, [r1, 0x4] + ldr r0, [r5] + adds r0, 0xE4 + str r2, [r0] + b _08018B50 +_08018B44: + strb r2, [r1, 0x4] +_08018B46: + ldr r0, [r5] + adds r1, r0, 0 + adds r1, 0xE4 + adds r0, 0xD4 + str r0, [r1] +_08018B50: + ldr r0, _08018B78 + movs r5, 0xBE + lsls r5, 1 + adds r1, r5, 0 + bl sub_808D8E0 + ldr r4, _08018B7C + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_808D8E0 + adds r0, r5, 0 + bl sub_808D994 + adds r1, r0, 0 + subs r4, 0x50 + adds r0, r4, 0 + bl strcpy + b _08018BAE + .align 2, 0 +_08018B78: .4byte gUnknown_202E5D8 +_08018B7C: .4byte gUnknown_202E1C8 +_08018B80: + strb r2, [r1, 0x4] + ldr r0, [r5] + adds r0, 0xE4 + str r2, [r0] + ldr r0, _08018BF8 + movs r5, 0xBE + lsls r5, 1 + adds r1, r5, 0 + bl sub_808D8E0 + ldr r4, _08018BFC + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_808D8E0 + adds r0, r5, 0 + bl sub_808D994 + adds r1, r0, 0 + subs r4, 0x50 + adds r0, r4, 0 + bl strcpy +_08018BAE: + movs r0, 0xBE + lsls r0, 1 + bl sub_808DDD0 + ldr r2, _08018C00 + ldr r3, [r2] + adds r1, r3, 0 + adds r1, 0xD4 + str r0, [r1] + adds r1, 0x4 + ldr r0, [r0, 0x4] + str r0, [r1] + adds r0, r3, 0 + adds r0, 0xE0 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0xE1 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0xE2 + strb r1, [r0] + ldr r1, [r2] + adds r2, r1, 0 + adds r2, 0xDC + movs r0, 0x2 + strh r0, [r2] + adds r1, 0xDE + movs r0, 0x8 + strh r0, [r1] + movs r0, 0 + bl sub_8018D18 + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08018BF8: .4byte gUnknown_202E5D8 +_08018BFC: .4byte gUnknown_202E1C8 +_08018C00: .4byte gUnknown_203B210 + thumb_func_end sub_8018B00 + + thumb_func_start sub_8018C04 +sub_8018C04: + push {lr} + ldr r0, _08018C1C + ldr r0, [r0] + ldr r0, [r0, 0x8] + cmp r0, 0x1F + bhi _08018CE4 + lsls r0, 2 + ldr r1, _08018C20 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08018C1C: .4byte gUnknown_203B210 +_08018C20: .4byte _08018C24 + .align 2, 0 +_08018C24: + .4byte _08018CA4 + .4byte _08018CA4 + .4byte _08018CE4 + .4byte _08018CE4 + .4byte _08018CE0 + .4byte _08018CE4 + .4byte _08018CE4 + .4byte _08018CE4 + .4byte _08018CE4 + .4byte _08018CE4 + .4byte _08018CE4 + .4byte _08018CE4 + .4byte _08018CE4 + .4byte _08018CE4 + .4byte _08018CE4 + .4byte _08018CE4 + .4byte _08018CE4 + .4byte _08018CE4 + .4byte _08018CAA + .4byte _08018CAA + .4byte _08018CB6 + .4byte _08018CD4 + .4byte _08018CC2 + .4byte _08018CE4 + .4byte _08018CE4 + .4byte _08018CE4 + .4byte _08018CB0 + .4byte _08018CB0 + .4byte _08018CBC + .4byte _08018CDA + .4byte _08018CC8 + .4byte _08018CCE +_08018CA4: + bl sub_8019730 + b _08018CE8 +_08018CAA: + bl sub_80199CC + b _08018CE8 +_08018CB0: + bl sub_8019B08 + b _08018CE8 +_08018CB6: + bl sub_8019BBC + b _08018CE8 +_08018CBC: + bl sub_8019C78 + b _08018CE8 +_08018CC2: + bl sub_8019850 + b _08018CE8 +_08018CC8: + bl sub_80198E8 + b _08018CE8 +_08018CCE: + bl sub_8019944 + b _08018CE8 +_08018CD4: + bl sub_8019D30 + b _08018CE8 +_08018CDA: + bl sub_8019D4C + b _08018CE8 +_08018CE0: + movs r0, 0x3 + b _08018CEA +_08018CE4: + bl sub_8019D68 +_08018CE8: + movs r0, 0 +_08018CEA: + pop {r1} + bx r1 + thumb_func_end sub_8018C04 + + thumb_func_start sub_8018CF0 +sub_8018CF0: + push {r4,lr} + ldr r4, _08018D14 + ldr r0, [r4] + cmp r0, 0 + beq _08018D0C + adds r0, 0xD4 + ldr r0, [r0] + bl sub_800AA14 + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_08018D0C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08018D14: .4byte gUnknown_203B210 + thumb_func_end sub_8018CF0 + + thumb_func_start sub_8018D18 +sub_8018D18: + push {lr} + ldr r1, _08018D2C + ldr r1, [r1] + str r0, [r1, 0x8] + bl sub_8018D30 + bl sub_8018E88 + pop {r0} + bx r0 + .align 2, 0 +_08018D2C: .4byte gUnknown_203B210 + thumb_func_end sub_8018D18 + + thumb_func_start sub_8018D30 +sub_8018D30: + push {r4-r7,lr} + ldr r4, _08018D54 + ldr r0, [r4] + adds r0, 0xE8 + bl sub_8006518 + ldr r0, [r4] + ldr r0, [r0, 0x8] + subs r0, 0x12 + cmp r0, 0xA + bls _08018D48 + b _08018E44 +_08018D48: + lsls r0, 2 + ldr r1, _08018D58 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08018D54: .4byte gUnknown_203B210 +_08018D58: .4byte _08018D5C + .align 2, 0 +_08018D5C: + .4byte _08018D88 + .4byte _08018D88 + .4byte _08018E24 + .4byte _08018E44 + .4byte _08018E44 + .4byte _08018E44 + .4byte _08018E44 + .4byte _08018E44 + .4byte _08018DDC + .4byte _08018DDC + .4byte _08018E24 +_08018D88: + ldr r3, _08018DCC + ldr r1, [r3] + ldr r2, _08018DD0 + adds r1, 0xE8 + adds r0, r2, 0 + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldm r0!, {r4,r5,r7} + stm r1!, {r4,r5,r7} + ldr r0, [r3] + movs r6, 0x8C + lsls r6, 1 + adds r0, r6 + ldm r2!, {r1,r4,r7} + stm r0!, {r1,r4,r7} + ldm r2!, {r5-r7} + stm r0!, {r5-r7} + ldr r1, [r3] + adds r1, 0xE8 + ldr r0, _08018DD4 + ldm r0!, {r2,r4,r5} + stm r1!, {r2,r4,r5} + ldm r0!, {r2,r6,r7} + stm r1!, {r2,r6,r7} + ldr r1, [r3] + movs r3, 0x80 + lsls r3, 1 + adds r1, r3 + ldr r0, _08018DD8 + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + b _08018E68 + .align 2, 0 +_08018DCC: .4byte gUnknown_203B210 +_08018DD0: .4byte gUnknown_80DB840 +_08018DD4: .4byte gUnknown_80DB870 +_08018DD8: .4byte gUnknown_80DB888 +_08018DDC: + ldr r3, _08018E18 + ldr r1, [r3] + ldr r2, _08018E1C + adds r1, 0xE8 + adds r0, r2, 0 + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldm r0!, {r4,r5,r7} + stm r1!, {r4,r5,r7} + ldr r1, [r3] + movs r4, 0x80 + lsls r4, 1 + adds r1, r4 + adds r0, r2, 0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldr r0, [r3] + movs r6, 0x8C + lsls r6, 1 + adds r0, r6 + ldm r2!, {r1,r5,r7} + stm r0!, {r1,r5,r7} + ldm r2!, {r1,r6,r7} + stm r0!, {r1,r6,r7} + ldr r1, [r3] + adds r1, r4 + ldr r0, _08018E20 + b _08018E30 + .align 2, 0 +_08018E18: .4byte gUnknown_203B210 +_08018E1C: .4byte gUnknown_80DB840 +_08018E20: .4byte gUnknown_80DB888 +_08018E24: + ldr r0, _08018E3C + ldr r1, [r0] + movs r0, 0x8C + lsls r0, 1 + adds r1, r0 + ldr r0, _08018E40 +_08018E30: + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + b _08018E68 + .align 2, 0 +_08018E3C: .4byte gUnknown_203B210 +_08018E40: .4byte gUnknown_80DB858 +_08018E44: + ldr r0, _08018E80 + mov r12, r0 + ldr r4, _08018E84 + movs r3, 0 + movs r2, 0x3 +_08018E4E: + mov r5, r12 + ldr r1, [r5] + adds r1, r3 + adds r1, 0xE8 + adds r0, r4, 0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r3, 0x18 + subs r2, 0x1 + cmp r2, 0 + bge _08018E4E +_08018E68: + bl sub_8004914 + ldr r0, _08018E80 + ldr r0, [r0] + adds r0, 0xE8 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08018E80: .4byte gUnknown_203B210 +_08018E84: .4byte gUnknown_80DB840 + thumb_func_end sub_8018D30 + + thumb_func_start sub_8018E88 +sub_8018E88: + push {r4,lr} + sub sp, 0x14 + ldr r1, _08018EA4 + ldr r0, [r1] + ldr r0, [r0, 0x8] + adds r4, r1, 0 + cmp r0, 0x20 + bls _08018E9A + b _080194E8 +_08018E9A: + lsls r0, 2 + ldr r1, _08018EA8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08018EA4: .4byte gUnknown_203B210 +_08018EA8: .4byte _08018EAC + .align 2, 0 +_08018EAC: + .4byte _08018F30 + .4byte _08018F58 + .4byte _08018FA8 + .4byte _08018FD0 + .4byte _080194E8 + .4byte _08018FFC + .4byte _08019024 + .4byte _0801904C + .4byte _08019070 + .4byte _08019094 + .4byte _080190B8 + .4byte _080190DC + .4byte _08019104 + .4byte _0801912C + .4byte _08019164 + .4byte _0801918C + .4byte _080191B4 + .4byte _08019294 + .4byte _080191DC + .4byte _080191FA + .4byte _08019218 + .4byte _080193F4 + .4byte _08019254 + .4byte _08019314 + .4byte _0801933C + .4byte _080193FE + .4byte _08019364 + .4byte _08019372 + .4byte _08019380 + .4byte _080193F4 + .4byte _080193B4 + .4byte _0801946C + .4byte _080194C0 +_08018F30: + bl sub_8019DAC + bl sub_80194F8 + movs r0, 0 + bl sub_8019E04 + ldr r2, _08018F50 + ldr r0, _08018F54 + ldr r4, [r0] + ldr r1, [r4] + movs r0, 0x5C + muls r0, r1 + adds r0, r2 + b _08018F76 + .align 2, 0 +_08018F50: .4byte gUnknown_80D5EC8 +_08018F54: .4byte gUnknown_203B210 +_08018F58: + bl sub_8019DAC + bl sub_80194F8 + movs r0, 0 + bl sub_8019E04 + ldr r1, _08018FA0 + ldr r0, _08018FA4 + ldr r4, [r0] + ldr r2, [r4] + movs r0, 0x5C + muls r0, r2 + adds r1, 0x4 + adds r0, r1 +_08018F76: + ldr r0, [r0] + ldr r2, [r4, 0x28] + adds r3, r4, 0 + adds r3, 0x34 + adds r1, r4, 0 + adds r1, 0x74 + str r1, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + adds r1, r4, 0 + adds r1, 0xE4 + ldr r1, [r1] + str r1, [sp, 0xC] + movs r1, 0xC + str r1, [sp, 0x10] + movs r1, 0 + bl sub_8014248 + b _080194E8 + .align 2, 0 +_08018FA0: .4byte gUnknown_80D5EC8 +_08018FA4: .4byte gUnknown_203B210 +_08018FA8: + ldr r1, [r4] + movs r0, 0x1 + str r0, [r1, 0xC] + movs r0, 0 + bl sub_8019E04 + ldr r1, _08018FCC + ldr r2, [r4] + ldr r3, [r2] + movs r0, 0x5C + muls r0, r3 + adds r1, 0x58 + adds r0, r1 + ldr r0, [r0] + adds r2, 0xE4 + ldr r2, [r2] + b _08019454 + .align 2, 0 +_08018FCC: .4byte gUnknown_80D5EC8 +_08018FD0: + ldr r1, [r4] + movs r0, 0x4 + str r0, [r1, 0xC] + movs r0, 0 + bl sub_8019E04 + ldr r1, _08018FF4 + ldr r2, [r4] + ldr r3, [r2] + movs r0, 0x5C + muls r0, r3 + adds r1, 0x8 + adds r0, r1 + ldr r0, [r0] + adds r2, 0xE4 + ldr r2, [r2] + ldr r3, _08018FF8 + b _08019456 + .align 2, 0 +_08018FF4: .4byte gUnknown_80D5EC8 +_08018FF8: .4byte 0x0000030d +_08018FFC: + ldr r1, [r4] + movs r0, 0x1 + str r0, [r1, 0xC] + movs r0, 0 + bl sub_8019E04 + ldr r1, _08019020 + ldr r2, [r4] + ldr r3, [r2] + movs r0, 0x5C + muls r0, r3 + adds r1, 0x30 + adds r0, r1 + ldr r0, [r0] + adds r2, 0xE4 + ldr r2, [r2] + b _08019454 + .align 2, 0 +_08019020: .4byte gUnknown_80D5EC8 +_08019024: + ldr r1, [r4] + movs r0, 0x10 + str r0, [r1, 0xC] + movs r0, 0x1 + bl sub_8019E04 + ldr r1, _08019048 + ldr r2, [r4] + ldr r3, [r2] + movs r0, 0x5C + muls r0, r3 + adds r1, 0x34 + adds r0, r1 + ldr r0, [r0] + adds r2, 0xE4 + ldr r2, [r2] + b _08019454 + .align 2, 0 +_08019048: .4byte gUnknown_80D5EC8 +_0801904C: + ldr r1, [r4] + movs r0, 0x1 + str r0, [r1, 0xC] + bl sub_8019E04 + ldr r1, _0801906C + ldr r2, [r4] + ldr r3, [r2] + movs r0, 0x5C + muls r0, r3 + adds r1, 0x38 + adds r0, r1 + ldr r0, [r0] + adds r2, 0xE4 + ldr r2, [r2] + b _08019454 + .align 2, 0 +_0801906C: .4byte gUnknown_80D5EC8 +_08019070: + ldr r1, [r4] + movs r0, 0x1 + str r0, [r1, 0xC] + bl sub_8019E04 + ldr r1, _08019090 + ldr r2, [r4] + ldr r3, [r2] + movs r0, 0x5C + muls r0, r3 + adds r1, 0x3C + adds r0, r1 + ldr r0, [r0] + adds r2, 0xE4 + ldr r2, [r2] + b _08019454 + .align 2, 0 +_08019090: .4byte gUnknown_80D5EC8 +_08019094: + ldr r1, [r4] + movs r0, 0x1 + str r0, [r1, 0xC] + bl sub_8019E04 + ldr r1, _080190B4 + ldr r2, [r4] + ldr r3, [r2] + movs r0, 0x5C + muls r0, r3 + adds r1, 0x40 + adds r0, r1 + ldr r0, [r0] + adds r2, 0xE4 + ldr r2, [r2] + b _08019454 + .align 2, 0 +_080190B4: .4byte gUnknown_80D5EC8 +_080190B8: + ldr r1, [r4] + movs r0, 0x1 + str r0, [r1, 0xC] + bl sub_8019E04 + ldr r1, _080190D8 + ldr r2, [r4] + ldr r3, [r2] + movs r0, 0x5C + muls r0, r3 + adds r1, 0x44 + adds r0, r1 + ldr r0, [r0] + adds r2, 0xE4 + ldr r2, [r2] + b _08019454 + .align 2, 0 +_080190D8: .4byte gUnknown_80D5EC8 +_080190DC: + ldr r1, [r4] + movs r0, 0x1 + str r0, [r1, 0xC] + movs r0, 0 + bl sub_8019E04 + ldr r1, _08019100 + ldr r2, [r4] + ldr r3, [r2] + movs r0, 0x5C + muls r0, r3 + adds r1, 0x48 + adds r0, r1 + ldr r0, [r0] + adds r2, 0xE4 + ldr r2, [r2] + b _08019454 + .align 2, 0 +_08019100: .4byte gUnknown_80D5EC8 +_08019104: + ldr r1, [r4] + movs r0, 0x10 + str r0, [r1, 0xC] + movs r0, 0x1 + bl sub_8019E04 + ldr r1, _08019128 + ldr r2, [r4] + ldr r3, [r2] + movs r0, 0x5C + muls r0, r3 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + adds r2, 0xE4 + ldr r2, [r2] + b _08019454 + .align 2, 0 +_08019128: .4byte gUnknown_80D5EC8 +_0801912C: + ldr r0, _0801915C + ldr r1, [r4] + adds r1, 0x1C + movs r2, 0 + bl sub_8090E14 + ldr r1, [r4] + movs r0, 0x18 + str r0, [r1, 0xC] + movs r0, 0x1 + bl sub_8019E04 + ldr r1, _08019160 + ldr r2, [r4] + ldr r3, [r2] + movs r0, 0x5C + muls r0, r3 + adds r1, 0x50 + adds r0, r1 + ldr r0, [r0] + adds r2, 0xE4 + ldr r2, [r2] + b _08019454 + .align 2, 0 +_0801915C: .4byte gUnknown_202DE58 +_08019160: .4byte gUnknown_80D5EC8 +_08019164: + ldr r1, [r4] + movs r0, 0x18 + str r0, [r1, 0xC] + movs r0, 0x1 + bl sub_8019E04 + ldr r1, _08019188 + ldr r2, [r4] + ldr r3, [r2] + movs r0, 0x5C + muls r0, r3 + adds r1, 0x54 + adds r0, r1 + ldr r0, [r0] + adds r2, 0xE4 + ldr r2, [r2] + b _08019454 + .align 2, 0 +_08019188: .4byte gUnknown_80D5EC8 +_0801918C: + ldr r1, [r4] + movs r0, 0x12 + str r0, [r1, 0xC] + movs r0, 0 + bl sub_8019E04 + ldr r1, _080191B0 + ldr r2, [r4] + ldr r3, [r2] + movs r0, 0x5C + muls r0, r3 + adds r1, 0xC + adds r0, r1 + ldr r0, [r0] + adds r2, 0xE4 + ldr r2, [r2] + b _08019454 + .align 2, 0 +_080191B0: .4byte gUnknown_80D5EC8 +_080191B4: + ldr r1, [r4] + movs r0, 0x13 + str r0, [r1, 0xC] + movs r0, 0 + bl sub_8019E04 + ldr r1, _080191D8 + ldr r2, [r4] + ldr r3, [r2] + movs r0, 0x5C + muls r0, r3 + adds r1, 0x10 + adds r0, r1 + ldr r0, [r0] + adds r2, 0xE4 + ldr r2, [r2] + b _08019454 + .align 2, 0 +_080191D8: .4byte gUnknown_80D5EC8 +_080191DC: + ldr r0, [r4] + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _080191EC + movs r0, 0x3 + bl sub_8019E40 + b _080191F2 +_080191EC: + movs r0, 0x3 + bl sub_801A20C +_080191F2: + movs r0, 0 + bl sub_801AD34 + b _08019378 +_080191FA: + ldr r0, [r4] + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _0801920A + movs r0, 0x1 + bl sub_8019FCC + b _08019210 +_0801920A: + movs r0, 0x1 + bl sub_801A398 +_08019210: + movs r0, 0 + bl sub_801AD34 + b _08019378 +_08019218: + ldr r0, [r4] + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _08019226 + bl sub_801A0D8 + b _0801922A +_08019226: + bl sub_801A4A4 +_0801922A: + movs r0, 0 + bl sub_801AD34 + movs r0, 0x1 + bl sub_8016C40 + bl sub_80195C0 + ldr r0, _08019250 + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x84 + adds r1, r2, 0 + adds r1, 0x34 + adds r3, r2, 0 + adds r3, 0x74 + ldr r2, [r2, 0x30] + b _080193A0 + .align 2, 0 +_08019250: .4byte gUnknown_203B210 +_08019254: + bl sub_8019700 + ldr r0, _08019284 + ldr r4, _08019288 + ldr r1, [r4] + adds r1, 0x1C + movs r2, 0 + bl sub_8090E14 + ldr r1, _0801928C + ldr r0, [r4] + ldr r0, [r0, 0x10] + str r0, [r1] + movs r0, 0 + bl sub_8019E04 + ldr r1, _08019290 + ldr r4, [r4] + ldr r2, [r4] + movs r0, 0x5C + muls r0, r2 + adds r1, 0x14 + b _0801948C + .align 2, 0 +_08019284: .4byte gUnknown_202DE58 +_08019288: .4byte gUnknown_203B210 +_0801928C: .4byte gUnknown_202DE30 +_08019290: .4byte gUnknown_80D5EC8 +_08019294: + bl sub_8019D8C + cmp r0, 0 + bne _080192C0 + ldr r0, _080192AC + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _080192B0 + bl sub_801A010 + b _080192B4 + .align 2, 0 +_080192AC: .4byte gUnknown_203B210 +_080192B0: + bl sub_801A3DC +_080192B4: + ldr r0, _080192BC + ldr r1, [r0] + movs r0, 0xB + b _080192F2 + .align 2, 0 +_080192BC: .4byte gUnknown_203B210 +_080192C0: + bl sub_8090A34 + cmp r0, 0x13 + ble _080192EC + ldr r0, _080192D8 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _080192DC + bl sub_801A010 + b _080192E0 + .align 2, 0 +_080192D8: .4byte gUnknown_203B210 +_080192DC: + bl sub_801A3DC +_080192E0: + ldr r0, _080192E8 + ldr r1, [r0] + movs r0, 0x1 + b _080192F2 + .align 2, 0 +_080192E8: .4byte gUnknown_203B210 +_080192EC: + ldr r0, _0801930C + ldr r1, [r0] + movs r0, 0x10 +_080192F2: + str r0, [r1, 0xC] + movs r0, 0 + bl sub_8019E04 + ldr r2, _08019310 + ldr r0, _0801930C + ldr r1, [r0] + ldr r3, [r1] + movs r0, 0x5C + muls r0, r3 + adds r2, 0x18 + b _0801944C + .align 2, 0 +_0801930C: .4byte gUnknown_203B210 +_08019310: .4byte gUnknown_80D5EC8 +_08019314: + ldr r1, [r4] + movs r0, 0x1A + str r0, [r1, 0xC] + movs r0, 0 + bl sub_8019E04 + ldr r1, _08019338 + ldr r2, [r4] + ldr r3, [r2] + movs r0, 0x5C + muls r0, r3 + adds r1, 0x1C + adds r0, r1 + ldr r0, [r0] + adds r2, 0xE4 + ldr r2, [r2] + b _08019454 + .align 2, 0 +_08019338: .4byte gUnknown_80D5EC8 +_0801933C: + ldr r1, [r4] + movs r0, 0x1B + str r0, [r1, 0xC] + movs r0, 0 + bl sub_8019E04 + ldr r1, _08019360 + ldr r2, [r4] + ldr r3, [r2] + movs r0, 0x5C + muls r0, r3 + adds r1, 0x20 + adds r0, r1 + ldr r0, [r0] + adds r2, 0xE4 + ldr r2, [r2] + b _08019454 + .align 2, 0 +_08019360: .4byte gUnknown_80D5EC8 +_08019364: + movs r0, 0x4 + movs r1, 0x3 + movs r2, 0 + movs r3, 0xA + bl sub_801A5D8 + b _08019378 +_08019372: + movs r0, 0x1 + bl sub_801A8D0 +_08019378: + movs r0, 0x1 + bl sub_8016C40 + b _080194E8 +_08019380: + bl sub_801A9E0 + movs r0, 0x1 + bl sub_8016C40 + bl sub_8019660 + ldr r0, _080193B0 + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x84 + adds r1, r2, 0 + adds r1, 0x34 + adds r3, r2, 0 + adds r3, 0x74 + ldr r2, [r2, 0x2C] +_080193A0: + str r2, [sp] + movs r2, 0x2 + str r2, [sp, 0x4] + movs r2, 0 + bl sub_8012D60 + b _080194E8 + .align 2, 0 +_080193B0: .4byte gUnknown_203B210 +_080193B4: + bl sub_8019700 + ldr r0, _080193E4 + ldr r4, _080193E8 + ldr r1, [r4] + adds r1, 0x1C + movs r2, 0 + bl sub_8090E14 + ldr r1, _080193EC + ldr r0, [r4] + ldr r0, [r0, 0x10] + str r0, [r1] + movs r0, 0 + bl sub_8019E04 + ldr r1, _080193F0 + ldr r4, [r4] + ldr r2, [r4] + movs r0, 0x5C + muls r0, r2 + adds r1, 0x24 + b _0801948C + .align 2, 0 +_080193E4: .4byte gUnknown_202DE58 +_080193E8: .4byte gUnknown_203B210 +_080193EC: .4byte gUnknown_202DE30 +_080193F0: .4byte gUnknown_80D5EC8 +_080193F4: + ldr r0, [r4] + adds r0, 0x1C + bl sub_801B3C0 + b _080194E8 +_080193FE: + bl sub_8090A34 + cmp r0, 0 + beq _08019418 + ldr r0, _08019424 + ldr r0, [r0] + movs r1, 0x98 + lsls r1, 2 + adds r0, r1 + ldr r1, [r0] + ldr r0, _08019428 + cmp r1, r0 + ble _08019430 +_08019418: + bl sub_801A928 + ldr r0, _0801942C + ldr r1, [r0] + movs r0, 0x1 + b _08019436 + .align 2, 0 +_08019424: .4byte gUnknown_203B460 +_08019428: .4byte 0x0001869e +_0801942C: .4byte gUnknown_203B210 +_08019430: + ldr r0, _08019460 + ldr r1, [r0] + movs r0, 0x18 +_08019436: + str r0, [r1, 0xC] + movs r0, 0 + bl sub_8019E04 + ldr r2, _08019464 + ldr r0, _08019460 + ldr r1, [r0] + ldr r3, [r1] + movs r0, 0x5C + muls r0, r3 + adds r2, 0x2C +_0801944C: + adds r0, r2 + ldr r0, [r0] + adds r1, 0xE4 + ldr r2, [r1] +_08019454: + ldr r3, _08019468 +_08019456: + movs r1, 0 + bl sub_80141B4 + b _080194E8 + .align 2, 0 +_08019460: .4byte gUnknown_203B210 +_08019464: .4byte gUnknown_80D5EC8 +_08019468: .4byte 0x0000010d +_0801946C: + bl sub_8019700 + ldr r1, _080194B4 + ldr r4, _080194B8 + ldr r0, [r4] + ldr r0, [r0, 0x18] + str r0, [r1] + movs r0, 0 + bl sub_8019E04 + ldr r1, _080194BC + ldr r4, [r4] + ldr r2, [r4] + movs r0, 0x5C + muls r0, r2 + adds r1, 0x28 +_0801948C: + adds r0, r1 + ldr r0, [r0] + adds r3, r4, 0 + adds r3, 0x34 + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + adds r4, 0xE4 + ldr r1, [r4] + str r1, [sp, 0xC] + movs r1, 0xC + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0x5 + bl sub_8014248 + b _080194E8 + .align 2, 0 +_080194B4: .4byte gUnknown_202DE30 +_080194B8: .4byte gUnknown_203B210 +_080194BC: .4byte gUnknown_80D5EC8 +_080194C0: + ldr r1, [r4] + movs r0, 0x1 + str r0, [r1, 0xC] + movs r0, 0 + bl sub_8019E04 + ldr r1, _080194F0 + ldr r2, [r4] + ldr r3, [r2] + movs r0, 0x5C + muls r0, r3 + adds r1, 0x2C + adds r0, r1 + ldr r0, [r0] + adds r2, 0xE4 + ldr r2, [r2] + ldr r3, _080194F4 + movs r1, 0 + bl sub_80141B4 +_080194E8: + add sp, 0x14 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080194F0: .4byte gUnknown_80D5EC8 +_080194F4: .4byte 0x0000010d + thumb_func_end sub_8018E88 + + thumb_func_start sub_80194F8 +sub_80194F8: + push {r4-r7,lr} + ldr r4, _08019580 + ldr r0, [r4] + adds r0, 0x74 + movs r1, 0 + movs r2, 0x10 + bl MemoryFill16 + ldr r3, [r4] + movs r2, 0 + ldr r0, _08019584 + ldr r0, [r0] + str r0, [r3, 0x34] + movs r0, 0x2 + str r0, [r3, 0x38] + movs r1, 0x1 + ldr r0, _08019588 + ldr r0, [r0] + str r0, [r3, 0x3C] + movs r0, 0x3 + str r0, [r3, 0x40] + ldr r0, _0801958C + str r0, [r3, 0x44] + movs r0, 0x4 + str r0, [r3, 0x48] + ldr r0, _08019590 + ldr r0, [r0] + str r0, [r3, 0x4C] + movs r0, 0x7 + str r0, [r3, 0x50] + ldr r0, _08019594 + ldr r0, [r0] + str r0, [r3, 0x54] + str r1, [r3, 0x58] + movs r6, 0x5 + str r2, [r3, 0x5C] + str r1, [r3, 0x60] + movs r5, 0 + mov r12, r3 + adds r3, 0x38 + mov r2, r12 + adds r2, 0x74 +_0801954C: + ldrh r0, [r2] + cmp r0, 0 + bne _0801955C + ldr r1, [r3] + mov r7, r12 + ldr r0, [r7, 0x28] + cmp r1, r0 + beq _080195BA +_0801955C: + adds r3, 0x8 + adds r2, 0x2 + adds r5, 0x1 + cmp r5, r6 + blt _0801954C + movs r5, 0 + cmp r5, r6 + bge _080195BA + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x74 + ldrh r0, [r0] + cmp r0, 0 + bne _08019598 + ldr r0, [r1, 0x38] + str r0, [r1, 0x28] + b _080195BA + .align 2, 0 +_08019580: .4byte gUnknown_203B210 +_08019584: .4byte gUnknown_80D4978 +_08019588: .4byte gUnknown_80D4984 +_0801958C: .4byte gUnknown_80DB8A0 +_08019590: .4byte gUnknown_80D4970 +_08019594: .4byte gUnknown_80D4934 +_08019598: + adds r5, 0x1 + cmp r5, r6 + bge _080195BA + ldr r2, [r4] + lsls r0, r5, 1 + adds r1, r2, 0 + adds r1, 0x74 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _08019598 + lsls r0, r5, 3 + adds r1, r2, 0 + adds r1, 0x38 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x28] +_080195BA: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80194F8 + + thumb_func_start sub_80195C0 +sub_80195C0: + push {r4-r7,lr} + ldr r4, _0801962C + ldr r0, [r4] + adds r0, 0x74 + movs r1, 0 + movs r2, 0x10 + bl MemoryFill16 + ldr r3, [r4] + movs r2, 0 + ldr r0, _08019630 + ldr r0, [r0] + str r0, [r3, 0x34] + movs r0, 0x2 + str r0, [r3, 0x38] + movs r1, 0x1 + ldr r0, _08019634 + ldr r0, [r0] + str r0, [r3, 0x3C] + movs r0, 0x7 + str r0, [r3, 0x40] + movs r6, 0x2 + str r2, [r3, 0x44] + str r1, [r3, 0x48] + movs r5, 0 + mov r12, r3 + adds r3, 0x38 + mov r2, r12 + adds r2, 0x74 +_080195FA: + ldrh r0, [r2] + cmp r0, 0 + bne _0801960A + ldr r1, [r3] + mov r7, r12 + ldr r0, [r7, 0x30] + cmp r1, r0 + beq _0801965A +_0801960A: + adds r3, 0x8 + adds r2, 0x2 + adds r5, 0x1 + cmp r5, r6 + blt _080195FA + movs r5, 0 + cmp r5, r6 + bge _0801965A + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x74 + ldrh r0, [r0] + cmp r0, 0 + bne _08019638 + ldr r0, [r1, 0x38] + str r0, [r1, 0x30] + b _0801965A + .align 2, 0 +_0801962C: .4byte gUnknown_203B210 +_08019630: .4byte gUnknown_80D4978 +_08019634: .4byte gUnknown_80D4970 +_08019638: + adds r5, 0x1 + cmp r5, r6 + bge _0801965A + ldr r2, [r4] + lsls r0, r5, 1 + adds r1, r2, 0 + adds r1, 0x74 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _08019638 + lsls r0, r5, 3 + adds r1, r2, 0 + adds r1, 0x38 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x30] +_0801965A: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80195C0 + + thumb_func_start sub_8019660 +sub_8019660: + push {r4-r7,lr} + ldr r4, _080196CC + ldr r0, [r4] + adds r0, 0x74 + movs r1, 0 + movs r2, 0x10 + bl MemoryFill16 + ldr r3, [r4] + movs r2, 0 + ldr r0, _080196D0 + ldr r0, [r0] + str r0, [r3, 0x34] + movs r0, 0x3 + str r0, [r3, 0x38] + movs r1, 0x1 + ldr r0, _080196D4 + ldr r0, [r0] + str r0, [r3, 0x3C] + movs r0, 0x7 + str r0, [r3, 0x40] + movs r6, 0x2 + str r2, [r3, 0x44] + str r1, [r3, 0x48] + movs r5, 0 + mov r12, r3 + adds r3, 0x38 + mov r2, r12 + adds r2, 0x74 +_0801969A: + ldrh r0, [r2] + cmp r0, 0 + bne _080196AA + ldr r1, [r3] + mov r7, r12 + ldr r0, [r7, 0x2C] + cmp r1, r0 + beq _080196FA +_080196AA: + adds r3, 0x8 + adds r2, 0x2 + adds r5, 0x1 + cmp r5, r6 + blt _0801969A + movs r5, 0 + cmp r5, r6 + bge _080196FA + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x74 + ldrh r0, [r0] + cmp r0, 0 + bne _080196D8 + ldr r0, [r1, 0x38] + str r0, [r1, 0x2C] + b _080196FA + .align 2, 0 +_080196CC: .4byte gUnknown_203B210 +_080196D0: .4byte gUnknown_80D4984 +_080196D4: .4byte gUnknown_80D4970 +_080196D8: + adds r5, 0x1 + cmp r5, r6 + bge _080196FA + ldr r2, [r4] + lsls r0, r5, 1 + adds r1, r2, 0 + adds r1, 0x74 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _080196D8 + lsls r0, r5, 3 + adds r1, r2, 0 + adds r1, 0x38 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x2C] +_080196FA: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8019660 + + thumb_func_start sub_8019700 +sub_8019700: + ldr r0, _08019724 + ldr r1, [r0] + movs r3, 0 + ldr r0, _08019728 + ldr r0, [r0] + str r0, [r1, 0x34] + movs r0, 0x5 + str r0, [r1, 0x38] + movs r2, 0x1 + ldr r0, _0801972C + ldr r0, [r0] + str r0, [r1, 0x3C] + movs r0, 0x6 + str r0, [r1, 0x40] + str r3, [r1, 0x44] + str r2, [r1, 0x48] + bx lr + .align 2, 0 +_08019724: .4byte gUnknown_203B210 +_08019728: .4byte gUnknown_80D4920 +_0801972C: .4byte gUnknown_80D4928 + thumb_func_end sub_8019700 + + thumb_func_start sub_8019730 +sub_8019730: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + beq _08019740 + b _0801984A +_08019740: + ldr r1, [sp] + cmp r1, 0x1 + beq _0801974C + ldr r0, _08019760 + ldr r0, [r0] + str r1, [r0, 0x28] +_0801974C: + ldr r0, [sp] + subs r0, 0x1 + cmp r0, 0x6 + bls _08019756 + b _0801984A +_08019756: + lsls r0, 2 + ldr r1, _08019764 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08019760: .4byte gUnknown_203B210 +_08019764: .4byte _08019768 + .align 2, 0 +_08019768: + .4byte _08019844 + .4byte _08019784 + .4byte _080197AC + .4byte _080197E4 + .4byte _0801984A + .4byte _0801984A + .4byte _0801983C +_08019784: + bl sub_8019D8C + cmp r0, 0 + bne _08019794 + movs r0, 0x5 + bl sub_8018D18 + b _0801984A +_08019794: + bl sub_8090A34 + cmp r0, 0x13 + ble _080197A4 + movs r0, 0xA + bl sub_8018D18 + b _0801984A +_080197A4: + movs r0, 0xF + bl sub_8018D18 + b _0801984A +_080197AC: + bl sub_8090A34 + cmp r0, 0 + beq _080197EC + ldr r0, _080197D8 + ldr r0, [r0] + ldr r0, [r0, 0x14] + cmp r0, 0 + beq _080197FE + ldr r0, _080197DC + ldr r0, [r0] + movs r1, 0x98 + lsls r1, 2 + adds r0, r1 + ldr r1, [r0] + ldr r0, _080197E0 + cmp r1, r0 + bgt _08019822 + movs r0, 0x17 + bl sub_8018D18 + b _0801984A + .align 2, 0 +_080197D8: .4byte gUnknown_203B210 +_080197DC: .4byte gUnknown_203B460 +_080197E0: .4byte 0x0001869e +_080197E4: + bl sub_8090A34 + cmp r0, 0 + bne _080197F4 +_080197EC: + movs r0, 0x9 + bl sub_8018D18 + b _0801984A +_080197F4: + ldr r0, _08019808 + ldr r1, [r0] + ldr r0, [r1, 0x14] + cmp r0, 0 + bne _0801980C +_080197FE: + movs r0, 0x8 + bl sub_8018D18 + b _0801984A + .align 2, 0 +_08019808: .4byte gUnknown_203B210 +_0801980C: + ldr r0, _0801982C + ldr r0, [r0] + movs r2, 0x98 + lsls r2, 2 + adds r0, r2 + ldr r1, [r1, 0x18] + ldr r0, [r0] + adds r1, r0 + ldr r0, _08019830 + cmp r1, r0 + ble _08019834 +_08019822: + movs r0, 0x7 + bl sub_8018D18 + b _0801984A + .align 2, 0 +_0801982C: .4byte gUnknown_203B460 +_08019830: .4byte 0x0001869f +_08019834: + movs r0, 0x1F + bl sub_8018D18 + b _0801984A +_0801983C: + movs r0, 0x2 + bl sub_8018D18 + b _0801984A +_08019844: + movs r0, 0x3 + bl sub_8018D18 +_0801984A: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8019730 + + thumb_func_start sub_8019850 +sub_8019850: + push {r4,lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080198DE + ldr r0, [sp] + cmp r0, 0x5 + beq _08019874 + cmp r0, 0x5 + bgt _0801986E + cmp r0, 0x1 + beq _080198D8 + b _080198DE +_0801986E: + cmp r0, 0x6 + beq _080198D8 + b _080198DE +_08019874: + ldr r4, _080198A8 + ldr r0, [r4] + ldr r0, [r0, 0x10] + negs r0, r0 + bl sub_80913A0 + ldr r1, [r4] + ldrb r0, [r1, 0x4] + cmp r0, 0 + beq _080198AC + adds r0, r1, 0 + adds r0, 0x20 + ldrb r0, [r0] + bl sub_809185C + bl sub_8091274 + ldr r0, [r4] + adds r0, 0x20 + ldrb r0, [r0] + bl sub_8091840 + bl sub_8091874 + b _080198C8 + .align 2, 0 +_080198A8: .4byte gUnknown_203B210 +_080198AC: + adds r0, r1, 0 + adds r0, 0x21 + ldrb r0, [r0] + bl sub_8091A90 + bl sub_8091274 + ldr r0, [r4] + adds r0, 0x21 + ldrb r0, [r0] + bl sub_8091A74 + bl sub_8091AA8 +_080198C8: + movs r0, 0xA6 + lsls r0, 1 + bl sub_8011988 + movs r0, 0x11 + bl sub_8018D18 + b _080198DE +_080198D8: + movs r0, 0x10 + bl sub_8018D18 +_080198DE: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8019850 + + thumb_func_start sub_80198E8 +sub_80198E8: + push {r4,lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0801993A + ldr r0, [sp] + cmp r0, 0x5 + beq _0801990C + cmp r0, 0x5 + bgt _08019906 + cmp r0, 0x1 + beq _08019934 + b _0801993A +_08019906: + cmp r0, 0x6 + beq _08019934 + b _0801993A +_0801990C: + ldr r4, _08019930 + ldr r0, [r4] + ldr r0, [r0, 0x10] + bl sub_80913A0 + ldr r0, [r4] + ldr r0, [r0, 0x24] + bl sub_80911F8 + movs r0, 0xA6 + lsls r0, 1 + bl sub_8011988 + movs r0, 0x19 + bl sub_8018D18 + b _0801993A + .align 2, 0 +_08019930: .4byte gUnknown_203B210 +_08019934: + movs r0, 0x18 + bl sub_8018D18 +_0801993A: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80198E8 + + thumb_func_start sub_8019944 +sub_8019944: + push {r4,r5,lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080199C2 + ldr r0, [sp] + cmp r0, 0x5 + beq _08019968 + cmp r0, 0x5 + bgt _08019962 + cmp r0, 0x1 + beq _080199BC + b _080199C2 +_08019962: + cmp r0, 0x6 + beq _080199BC + b _080199C2 +_08019968: + movs r4, 0 + ldr r5, _080199B4 +_0801996C: + lsls r1, r4, 2 + ldr r0, [r5] + adds r2, r0, r1 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0801998E + ldrb r0, [r2, 0x2] + bl sub_80914E4 + lsls r0, 24 + cmp r0, 0 + beq _0801998E + adds r0, r4, 0 + bl sub_8091234 +_0801998E: + adds r4, 0x1 + cmp r4, 0x13 + ble _0801996C + bl sub_80910B4 + ldr r0, _080199B8 + ldr r0, [r0] + ldr r0, [r0, 0x18] + bl sub_80913A0 + movs r0, 0xA6 + lsls r0, 1 + bl sub_8011988 + movs r0, 0x20 + bl sub_8018D18 + b _080199C2 + .align 2, 0 +_080199B4: .4byte gUnknown_203B460 +_080199B8: .4byte gUnknown_203B210 +_080199BC: + movs r0, 0x1 + bl sub_8018D18 +_080199C2: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8019944 + + thumb_func_start sub_80199CC +sub_80199CC: + push {r4,r5,lr} + ldr r0, _080199E0 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _080199E4 + movs r0, 0x1 + bl sub_8019EDC + b _080199EA + .align 2, 0 +_080199E0: .4byte gUnknown_203B210 +_080199E4: + movs r0, 0x1 + bl sub_801A2A8 +_080199EA: + cmp r0, 0x2 + beq _08019AD4 + cmp r0, 0x2 + bhi _080199FA + cmp r0, 0x1 + bne _080199F8 + b _08019AF4 +_080199F8: + b _08019B00 +_080199FA: + cmp r0, 0x3 + beq _08019A04 + cmp r0, 0x4 + beq _08019A6C + b _08019B00 +_08019A04: + ldr r4, _08019A24 + ldr r0, [r4] + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _08019A28 + bl sub_8019FB0 + ldr r1, [r4] + adds r1, 0x20 + strb r0, [r1] + ldr r0, [r4] + adds r0, 0x20 + ldrb r0, [r0] + bl sub_809185C + b _08019A3C + .align 2, 0 +_08019A24: .4byte gUnknown_203B210 +_08019A28: + bl sub_801A37C + ldr r1, [r4] + adds r1, 0x21 + strb r0, [r1] + ldr r0, [r4] + adds r0, 0x21 + ldrb r0, [r0] + bl sub_8091A90 +_08019A3C: + adds r5, r0, 0 + ldr r4, _08019A68 + ldr r0, [r4] + adds r0, 0x1C + ldrb r1, [r5] + movs r2, 0 + bl sub_8090A8C + ldr r1, [r4] + ldrb r0, [r5, 0x1] + strb r0, [r1, 0x1D] + ldr r0, [r4] + adds r0, 0x1C + bl sub_8090C7C + ldr r1, [r4] + str r0, [r1, 0x10] + movs r0, 0x14 + bl sub_8018D18 + b _08019B00 + .align 2, 0 +_08019A68: .4byte gUnknown_203B210 +_08019A6C: + ldr r4, _08019A8C + ldr r0, [r4] + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _08019A90 + bl sub_8019FB0 + ldr r1, [r4] + adds r1, 0x20 + strb r0, [r1] + ldr r0, [r4] + adds r0, 0x20 + ldrb r0, [r0] + bl sub_809185C + b _08019AA4 + .align 2, 0 +_08019A8C: .4byte gUnknown_203B210 +_08019A90: + bl sub_801A37C + ldr r1, [r4] + adds r1, 0x21 + strb r0, [r1] + ldr r0, [r4] + adds r0, 0x21 + ldrb r0, [r0] + bl sub_8091A90 +_08019AA4: + adds r5, r0, 0 + ldr r4, _08019AD0 + ldr r0, [r4] + adds r0, 0x1C + ldrb r1, [r5] + movs r2, 0 + bl sub_8090A8C + ldr r1, [r4] + ldrb r0, [r5, 0x1] + strb r0, [r1, 0x1D] + ldr r0, [r4] + adds r0, 0x1C + bl sub_8090C7C + ldr r1, [r4] + str r0, [r1, 0x10] + movs r0, 0x15 + bl sub_8018D18 + b _08019B00 + .align 2, 0 +_08019AD0: .4byte gUnknown_203B210 +_08019AD4: + ldr r0, _08019AE4 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _08019AE8 + bl sub_801A010 + b _08019AEC + .align 2, 0 +_08019AE4: .4byte gUnknown_203B210 +_08019AE8: + bl sub_801A3DC +_08019AEC: + movs r0, 0x1 + bl sub_8018D18 + b _08019B00 +_08019AF4: + movs r0, 0 + bl sub_801AD34 + movs r0, 0x1 + bl sub_8016C40 +_08019B00: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80199CC + + thumb_func_start sub_8019B08 +sub_8019B08: + push {r4,lr} + movs r0, 0x1 + bl sub_801A6E8 + cmp r0, 0x4 + bhi _08019BB0 + lsls r0, 2 + ldr r1, _08019B20 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08019B20: .4byte _08019B24 + .align 2, 0 +_08019B24: + .4byte _08019BB6 + .4byte _08019BB0 + .4byte _08019BA4 + .4byte _08019B38 + .4byte _08019B6C +_08019B38: + bl sub_801A8AC + ldr r4, _08019B64 + ldr r2, [r4] + str r0, [r2, 0x24] + ldr r1, _08019B68 + ldr r1, [r1] + lsls r0, 2 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x1C] + adds r2, 0x1C + adds r0, r2, 0 + bl sub_8090CCC + ldr r1, [r4] + str r0, [r1, 0x10] + movs r0, 0x1C + bl sub_8018D18 + b _08019BB6 + .align 2, 0 +_08019B64: .4byte gUnknown_203B210 +_08019B68: .4byte gUnknown_203B460 +_08019B6C: + bl sub_801A8AC + ldr r4, _08019B9C + ldr r2, [r4] + str r0, [r2, 0x24] + ldr r1, _08019BA0 + ldr r1, [r1] + lsls r0, 2 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x1C] + adds r2, 0x1C + adds r0, r2, 0 + bl sub_8090CCC + ldr r1, [r4] + str r0, [r1, 0x10] + movs r0, 0 + bl sub_8099690 + movs r0, 0x1D + bl sub_8018D18 + b _08019BB6 + .align 2, 0 +_08019B9C: .4byte gUnknown_203B210 +_08019BA0: .4byte gUnknown_203B460 +_08019BA4: + bl sub_801A928 + movs r0, 0x1 + bl sub_8018D18 + b _08019BB6 +_08019BB0: + movs r0, 0x1 + bl sub_8016C40 +_08019BB6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8019B08 + + thumb_func_start sub_8019BBC +sub_8019BBC: + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + ldr r0, _08019BD8 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _08019BDC + movs r0, 0 + bl sub_8019EDC + b _08019BE2 + .align 2, 0 +_08019BD8: .4byte gUnknown_203B210 +_08019BDC: + movs r0, 0 + bl sub_801A2A8 +_08019BE2: + ldr r4, _08019C18 + ldr r0, [r4] + adds r0, 0x84 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _08019C06 + ldr r0, [r4] + adds r0, 0x84 + mov r1, sp + bl sub_8013114 + ldr r1, [sp] + cmp r1, 0x1 + beq _08019C06 + ldr r0, [r4] + str r1, [r0, 0x30] +_08019C06: + ldr r0, [sp] + cmp r0, 0x2 + beq _08019C22 + cmp r0, 0x2 + bgt _08019C1C + cmp r0, 0x1 + beq _08019C68 + b _08019C6E + .align 2, 0 +_08019C18: .4byte gUnknown_203B210 +_08019C1C: + cmp r0, 0x7 + beq _08019C60 + b _08019C6E +_08019C22: + ldr r0, _08019C3C + ldr r0, [r0] + movs r1, 0x98 + lsls r1, 2 + adds r0, r1 + ldr r1, [r0] + cmp r1, 0 + bne _08019C40 + movs r0, 0x6 + bl sub_8018D18 + b _08019C6E + .align 2, 0 +_08019C3C: .4byte gUnknown_203B460 +_08019C40: + ldr r0, _08019C54 + ldr r0, [r0] + ldr r0, [r0, 0x10] + cmp r0, r1 + ble _08019C58 + movs r0, 0xC + bl sub_8018D18 + b _08019C6E + .align 2, 0 +_08019C54: .4byte gUnknown_203B210 +_08019C58: + movs r0, 0x16 + bl sub_8018D18 + b _08019C6E +_08019C60: + movs r0, 0x15 + bl sub_8018D18 + b _08019C6E +_08019C68: + movs r0, 0x13 + bl sub_8018D18 +_08019C6E: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8019BBC + + thumb_func_start sub_8019C78 +sub_8019C78: + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + bl sub_801A6E8 + ldr r4, _08019CB8 + ldr r0, [r4] + adds r0, 0x84 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _08019CA8 + ldr r0, [r4] + adds r0, 0x84 + mov r1, sp + bl sub_8013114 + ldr r1, [sp] + cmp r1, 0x1 + beq _08019CA8 + ldr r0, [r4] + str r1, [r0, 0x2C] +_08019CA8: + ldr r0, [sp] + cmp r0, 0x3 + beq _08019CC2 + cmp r0, 0x3 + bgt _08019CBC + cmp r0, 0x1 + beq _08019D22 + b _08019D28 + .align 2, 0 +_08019CB8: .4byte gUnknown_203B210 +_08019CBC: + cmp r0, 0x7 + beq _08019D14 + b _08019D28 +_08019CC2: + movs r0, 0 + bl sub_8099690 + ldr r4, _08019CE0 + ldr r0, [r4] + ldrb r0, [r0, 0x1E] + bl sub_80914E4 + lsls r0, 24 + cmp r0, 0 + bne _08019CE4 + movs r0, 0xD + bl sub_8018D18 + b _08019D28 + .align 2, 0 +_08019CE0: .4byte gUnknown_203B210 +_08019CE4: + ldr r1, [r4] + ldr r0, _08019D04 + ldr r0, [r0] + movs r2, 0x98 + lsls r2, 2 + adds r0, r2 + ldr r1, [r1, 0x10] + ldr r0, [r0] + adds r1, r0 + ldr r0, _08019D08 + cmp r1, r0 + ble _08019D0C + movs r0, 0xE + bl sub_8018D18 + b _08019D28 + .align 2, 0 +_08019D04: .4byte gUnknown_203B460 +_08019D08: .4byte 0x0001869f +_08019D0C: + movs r0, 0x1E + bl sub_8018D18 + b _08019D28 +_08019D14: + movs r0, 0 + bl sub_8099690 + movs r0, 0x1D + bl sub_8018D18 + b _08019D28 +_08019D22: + movs r0, 0x1B + bl sub_8018D18 +_08019D28: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8019C78 + + thumb_func_start sub_8019D30 +sub_8019D30: + push {lr} + bl sub_801B410 + cmp r0, 0x1 + bls _08019D48 + cmp r0, 0x3 + bhi _08019D48 + bl sub_801B450 + movs r0, 0x13 + bl sub_8018D18 +_08019D48: + pop {r0} + bx r0 + thumb_func_end sub_8019D30 + + thumb_func_start sub_8019D4C +sub_8019D4C: + push {lr} + bl sub_801B410 + cmp r0, 0x1 + bls _08019D64 + cmp r0, 0x3 + bhi _08019D64 + bl sub_801B450 + movs r0, 0x1B + bl sub_8018D18 +_08019D64: + pop {r0} + bx r0 + thumb_func_end sub_8019D4C + + thumb_func_start sub_8019D68 +sub_8019D68: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08019D80 + ldr r0, _08019D88 + ldr r0, [r0] + ldr r0, [r0, 0xC] + bl sub_8018D18 +_08019D80: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08019D88: .4byte gUnknown_203B210 + thumb_func_end sub_8019D68 + + thumb_func_start sub_8019D8C +sub_8019D8C: + push {lr} + ldr r0, _08019DA0 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _08019DA4 + bl sub_8091A48 + b _08019DA8 + .align 2, 0 +_08019DA0: .4byte gUnknown_203B210 +_08019DA4: + bl sub_8091814 +_08019DA8: + pop {r1} + bx r1 + thumb_func_end sub_8019D8C + + thumb_func_start sub_8019DAC +sub_8019DAC: + push {r4,r5,lr} + ldr r0, _08019DFC + ldr r1, [r0] + movs r0, 0 + str r0, [r1, 0x14] + str r0, [r1, 0x18] + movs r5, 0 +_08019DBA: + ldr r0, _08019E00 + lsls r1, r5, 2 + ldr r0, [r0] + adds r4, r0, r1 + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08019DEE + ldrb r0, [r4, 0x2] + bl sub_80914E4 + lsls r0, 24 + cmp r0, 0 + beq _08019DEE + adds r0, r4, 0 + bl sub_8090CCC + ldr r1, _08019DFC + ldr r2, [r1] + ldr r1, [r2, 0x18] + adds r1, r0 + str r1, [r2, 0x18] + ldr r0, [r2, 0x14] + adds r0, 0x1 + str r0, [r2, 0x14] +_08019DEE: + adds r5, 0x1 + cmp r5, 0x13 + ble _08019DBA + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08019DFC: .4byte gUnknown_203B210 +_08019E00: .4byte gUnknown_203B460 + thumb_func_end sub_8019DAC + + thumb_func_start sub_8019E04 +sub_8019E04: + push {lr} + adds r2, r0, 0 + ldr r0, _08019E20 + ldr r1, [r0] + ldrb r0, [r1, 0x4] + cmp r0, 0 + beq _08019E2A + cmp r2, 0x1 + bne _08019E24 + adds r0, r1, 0 + adds r0, 0xE0 + strb r2, [r0] + b _08019E3A + .align 2, 0 +_08019E20: .4byte gUnknown_203B210 +_08019E24: + adds r1, 0xE0 + movs r0, 0 + b _08019E38 +_08019E2A: + cmp r2, 0x1 + bne _08019E34 + adds r1, 0xE0 + movs r0, 0x7 + b _08019E38 +_08019E34: + adds r1, 0xE0 + movs r0, 0x6 +_08019E38: + strb r0, [r1] +_08019E3A: + pop {r0} + bx r0 + thumb_func_end sub_8019E04 + + thumb_func_start sub_8019E40 +sub_8019E40: + push {r4-r6,lr} + adds r6, r0, 0 + bl sub_8091814 + cmp r0, 0 + beq _08019ED4 + ldr r5, _08019EC8 + movs r0, 0xA0 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] + str r6, [r0, 0x34] + lsls r1, r6, 1 + adds r1, r6 + lsls r1, 3 + adds r1, 0x3C + adds r1, r0, r1 + str r1, [r0, 0x38] + adds r0, 0x3C + bl sub_8006518 + ldr r1, [r5] + ldr r2, [r1, 0x34] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r1, 0x3C + ldr r0, _08019ECC + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r0, [r5] + ldr r1, [r0, 0x38] + adds r0, 0x9C + str r0, [r1, 0x14] + bl sub_8004914 + ldr r0, [r5] + adds r0, 0x3C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r4, [r5] + bl sub_8091814 + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0xA + adds r3, r6, 0 + bl sub_8013818 + ldr r0, [r5] + ldr r1, _08019ED0 + ldrh r1, [r1] + strh r1, [r0, 0x18] + bl sub_8013984 + bl sub_801A064 + bl sub_801A0D8 + movs r0, 0x1 + b _08019ED6 + .align 2, 0 +_08019EC8: .4byte gUnknown_203B214 +_08019ECC: .4byte gUnknown_80DB8CC +_08019ED0: .4byte gUnknown_203B218 +_08019ED4: + movs r0, 0 +_08019ED6: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8019E40 + + thumb_func_start sub_8019EDC +sub_8019EDC: + push {lr} + sub sp, 0x4 + lsls r0, 24 + cmp r0, 0 + bne _08019EF8 + ldr r0, _08019EF4 + ldr r0, [r0] + bl sub_8013660 + movs r0, 0 + b _08019FAA + .align 2, 0 +_08019EF4: .4byte gUnknown_203B214 +_08019EF8: + ldr r0, _08019F10 + ldr r0, [r0] + bl GetKeyPress + cmp r0, 0x2 + beq _08019F1A + cmp r0, 0x2 + bgt _08019F14 + cmp r0, 0x1 + beq _08019F24 + b _08019F88 + .align 2, 0 +_08019F10: .4byte gUnknown_203B214 +_08019F14: + cmp r0, 0x4 + beq _08019F7E + b _08019F88 +_08019F1A: + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + b _08019FAA +_08019F24: + bl sub_8019FB0 + lsls r0, 24 + lsrs r0, 24 + bl sub_809185C + ldrb r2, [r0] + lsls r2, 16 + ldr r3, _08019F68 + ldr r1, [sp] + ands r1, r3 + orrs r1, r2 + str r1, [sp] + ldrb r0, [r0, 0x1] + lsls r0, 8 + ldr r2, _08019F6C + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + bl sub_8090C7C + ldr r1, _08019F70 + ldr r1, [r1] + movs r2, 0x98 + lsls r2, 2 + adds r1, r2 + ldr r1, [r1] + cmp r0, r1 + ble _08019F74 + movs r0, 0x2 + bl sub_80119D4 + b _08019F7A + .align 2, 0 +_08019F68: .4byte 0xff00ffff +_08019F6C: .4byte 0xffff00ff +_08019F70: .4byte gUnknown_203B460 +_08019F74: + movs r0, 0 + bl sub_80119D4 +_08019F7A: + movs r0, 0x3 + b _08019FAA +_08019F7E: + movs r0, 0x4 + bl sub_80119D4 + movs r0, 0x4 + b _08019FAA +_08019F88: + ldr r0, _08019F9C + ldr r0, [r0] + movs r1, 0x1 + bl sub_80138B8 + lsls r0, 24 + cmp r0, 0 + bne _08019FA0 + movs r0, 0 + b _08019FAA + .align 2, 0 +_08019F9C: .4byte gUnknown_203B214 +_08019FA0: + bl sub_801A064 + bl sub_801A0D8 + movs r0, 0x1 +_08019FAA: + add sp, 0x4 + pop {r1} + bx r1 + thumb_func_end sub_8019EDC + + thumb_func_start sub_8019FB0 +sub_8019FB0: + ldr r0, _08019FC8 + ldr r1, [r0] + movs r0, 0x1E + ldrsh r2, [r1, r0] + movs r3, 0x1C + ldrsh r0, [r1, r3] + muls r0, r2 + ldrb r1, [r1, 0x18] + adds r0, r1 + lsls r0, 24 + lsrs r0, 24 + bx lr + .align 2, 0 +_08019FC8: .4byte gUnknown_203B214 + thumb_func_end sub_8019FB0 + + thumb_func_start sub_8019FCC +sub_8019FCC: + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8004914 + ldr r5, _0801A00C + ldr r0, [r5] + adds r0, 0x3C + movs r1, 0 + movs r2, 0 + bl sub_800641C + bl sub_8091814 + adds r1, r0, 0 + ldr r0, [r5] + strh r1, [r0, 0x22] + bl sub_8013984 + bl sub_801A064 + bl sub_801A0D8 + cmp r4, 0 + beq _0801A006 + ldr r0, [r5] + bl AddMenuCursorSprite +_0801A006: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0801A00C: .4byte gUnknown_203B214 + thumb_func_end sub_8019FCC + + thumb_func_start sub_801A010 +sub_801A010: + push {r4,r5,lr} + ldr r4, _0801A058 + ldr r2, [r4] + cmp r2, 0 + beq _0801A050 + ldr r1, _0801A05C + ldrh r0, [r2, 0x18] + strh r0, [r1] + ldr r0, [r2, 0x34] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x3C + ldr r0, _0801A060 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x3C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0801A050: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0801A058: .4byte gUnknown_203B214 +_0801A05C: .4byte gUnknown_203B218 +_0801A060: .4byte gUnknown_80DB8B4 + thumb_func_end sub_801A010 + + thumb_func_start sub_801A064 +sub_801A064: + push {r4,lr} + ldr r4, _0801A0D4 + ldr r0, [r4] + ldrh r1, [r0, 0x20] + adds r0, 0x9C + movs r2, 0 + strb r1, [r0] + ldr r0, [r4] + ldrh r1, [r0, 0x1E] + adds r0, 0x9D + strb r1, [r0] + ldr r0, [r4] + adds r0, 0x9E + movs r1, 0xA + strb r1, [r0] + ldr r0, [r4] + adds r0, 0x9F + strb r2, [r0] + ldr r0, [r4] + movs r1, 0x1A + ldrsh r0, [r0, r1] + movs r1, 0xC + bl sub_80095E4 + adds r0, 0x2 + lsls r0, 16 + ldr r2, [r4] + ldr r3, [r2, 0x34] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x4A + asrs r3, r0, 16 + lsrs r0, 16 + strh r0, [r1] + ldr r1, [r2, 0x34] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r2, r0 + adds r3, 0x2 + adds r2, 0x4C + strh r3, [r2] + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x3C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801A0D4: .4byte gUnknown_203B214 + thumb_func_end sub_801A064 + + thumb_func_start sub_801A0D8 +sub_801A0D8: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xB4 + ldr r4, _0801A1A4 + ldr r0, [r4] + ldr r0, [r0, 0x34] + bl sub_8008C54 + ldr r0, [r4] + ldr r0, [r0, 0x34] + bl sub_80073B8 + ldr r1, [r4] + movs r2, 0x1E + ldrsh r0, [r1, r2] + lsls r0, 3 + adds r0, 0xA + ldr r2, _0801A1A8 + ldr r3, [r1, 0x34] + movs r1, 0 + str r1, [sp] + bl xxx_call_draw_string + movs r6, 0 + ldr r0, [r4] + movs r1, 0x1A + ldrsh r0, [r0, r1] + cmp r6, r0 + bge _0801A1EC + adds r7, r4, 0 + add r4, sp, 0xB0 + mov r9, r6 + add r5, sp, 0x54 + add r2, sp, 0x60 + mov r8, r2 +_0801A122: + ldr r0, [r7] + movs r2, 0x1E + ldrsh r1, [r0, r2] + movs r2, 0x1C + ldrsh r0, [r0, r2] + muls r0, r1 + adds r0, r6 + lsls r0, 24 + lsrs r0, 24 + bl sub_809185C + ldrb r2, [r0] + lsls r2, 16 + ldr r3, _0801A1AC + ldr r1, [r4] + ands r1, r3 + orrs r1, r2 + str r1, [r4] + ldrb r2, [r0, 0x1] + lsls r2, 8 + ldr r0, _0801A1B0 + ands r1, r0 + orrs r1, r2 + ldr r0, _0801A1B4 + ands r1, r0 + movs r0, 0x3 + orrs r1, r0 + str r1, [r4] + movs r1, 0x1 + str r1, [sp, 0x54] + mov r0, r9 + strb r0, [r5, 0x4] + movs r0, 0x58 + strh r0, [r5, 0x6] + strb r1, [r5, 0x8] + add r0, sp, 0x4 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_8090E14 + adds r0, r4, 0 + bl sub_8090C7C + ldr r1, _0801A1B8 + ldr r1, [r1] + movs r2, 0x98 + lsls r2, 2 + adds r1, r2 + ldr r1, [r1] + cmp r0, r1 + bgt _0801A1BC + ldr r0, [r7] + adds r1, r6, 0 + bl sub_8013800 + adds r1, r0, 0 + ldr r0, [r7] + ldr r3, [r0, 0x34] + mov r0, r9 + str r0, [sp] + movs r0, 0x8 + add r2, sp, 0x4 + bl xxx_call_draw_string + b _0801A1E0 + .align 2, 0 +_0801A1A4: .4byte gUnknown_203B214 +_0801A1A8: .4byte gUnknown_80DB8E4 +_0801A1AC: .4byte 0xff00ffff +_0801A1B0: .4byte 0xffff00ff +_0801A1B4: .4byte 0xffffff00 +_0801A1B8: .4byte gUnknown_203B460 +_0801A1BC: + mov r0, r8 + ldr r1, _0801A204 + add r2, sp, 0x4 + bl sub_800D158 + ldr r0, [r7] + adds r1, r6, 0 + bl sub_8013800 + adds r1, r0, 0 + ldr r0, [r7] + ldr r3, [r0, 0x34] + mov r2, r9 + str r2, [sp] + movs r0, 0x8 + mov r2, r8 + bl xxx_call_draw_string +_0801A1E0: + adds r6, 0x1 + ldr r0, [r7] + movs r1, 0x1A + ldrsh r0, [r0, r1] + cmp r6, r0 + blt _0801A122 +_0801A1EC: + ldr r0, _0801A208 + ldr r0, [r0] + ldr r0, [r0, 0x34] + bl sub_80073E0 + add sp, 0xB4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0801A204: .4byte gUnknown_80DB8EC +_0801A208: .4byte gUnknown_203B214 + thumb_func_end sub_801A0D8 + + thumb_func_start sub_801A20C +sub_801A20C: + push {r4-r6,lr} + adds r6, r0, 0 + bl sub_8091A48 + cmp r0, 0 + beq _0801A2A0 + ldr r5, _0801A294 + movs r0, 0xA0 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] + str r6, [r0, 0x34] + lsls r1, r6, 1 + adds r1, r6 + lsls r1, 3 + adds r1, 0x3C + adds r1, r0, r1 + str r1, [r0, 0x38] + adds r0, 0x3C + bl sub_8006518 + ldr r1, [r5] + ldr r2, [r1, 0x34] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r1, 0x3C + ldr r0, _0801A298 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r0, [r5] + ldr r1, [r0, 0x38] + adds r0, 0x9C + str r0, [r1, 0x14] + bl sub_8004914 + ldr r0, [r5] + adds r0, 0x3C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r4, [r5] + bl sub_8091A48 + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0xA + adds r3, r6, 0 + bl sub_8013818 + ldr r0, [r5] + ldr r1, _0801A29C + ldrh r1, [r1] + strh r1, [r0, 0x18] + bl sub_8013984 + bl sub_801A430 + bl sub_801A4A4 + movs r0, 0x1 + b _0801A2A2 + .align 2, 0 +_0801A294: .4byte gUnknown_203B21C +_0801A298: .4byte gUnknown_80DB914 +_0801A29C: .4byte gUnknown_203B220 +_0801A2A0: + movs r0, 0 +_0801A2A2: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_801A20C + + thumb_func_start sub_801A2A8 +sub_801A2A8: + push {lr} + sub sp, 0x4 + lsls r0, 24 + cmp r0, 0 + bne _0801A2C4 + ldr r0, _0801A2C0 + ldr r0, [r0] + bl sub_8013660 + movs r0, 0 + b _0801A376 + .align 2, 0 +_0801A2C0: .4byte gUnknown_203B21C +_0801A2C4: + ldr r0, _0801A2DC + ldr r0, [r0] + bl GetKeyPress + cmp r0, 0x2 + beq _0801A2E6 + cmp r0, 0x2 + bgt _0801A2E0 + cmp r0, 0x1 + beq _0801A2F0 + b _0801A354 + .align 2, 0 +_0801A2DC: .4byte gUnknown_203B21C +_0801A2E0: + cmp r0, 0x4 + beq _0801A34A + b _0801A354 +_0801A2E6: + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + b _0801A376 +_0801A2F0: + bl sub_801A37C + lsls r0, 24 + lsrs r0, 24 + bl sub_8091A90 + ldrb r2, [r0] + lsls r2, 16 + ldr r3, _0801A334 + ldr r1, [sp] + ands r1, r3 + orrs r1, r2 + str r1, [sp] + ldrb r0, [r0, 0x1] + lsls r0, 8 + ldr r2, _0801A338 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + bl sub_8090C7C + ldr r1, _0801A33C + ldr r1, [r1] + movs r2, 0x98 + lsls r2, 2 + adds r1, r2 + ldr r1, [r1] + cmp r0, r1 + ble _0801A340 + movs r0, 0x2 + bl sub_80119D4 + b _0801A346 + .align 2, 0 +_0801A334: .4byte 0xff00ffff +_0801A338: .4byte 0xffff00ff +_0801A33C: .4byte gUnknown_203B460 +_0801A340: + movs r0, 0 + bl sub_80119D4 +_0801A346: + movs r0, 0x3 + b _0801A376 +_0801A34A: + movs r0, 0x4 + bl sub_80119D4 + movs r0, 0x4 + b _0801A376 +_0801A354: + ldr r0, _0801A368 + ldr r0, [r0] + movs r1, 0x1 + bl sub_80138B8 + lsls r0, 24 + cmp r0, 0 + bne _0801A36C + movs r0, 0 + b _0801A376 + .align 2, 0 +_0801A368: .4byte gUnknown_203B21C +_0801A36C: + bl sub_801A430 + bl sub_801A4A4 + movs r0, 0x1 +_0801A376: + add sp, 0x4 + pop {r1} + bx r1 + thumb_func_end sub_801A2A8 + + thumb_func_start sub_801A37C +sub_801A37C: + ldr r0, _0801A394 + ldr r1, [r0] + movs r0, 0x1E + ldrsh r2, [r1, r0] + movs r3, 0x1C + ldrsh r0, [r1, r3] + muls r0, r2 + ldrb r1, [r1, 0x18] + adds r0, r1 + lsls r0, 24 + lsrs r0, 24 + bx lr + .align 2, 0 +_0801A394: .4byte gUnknown_203B21C + thumb_func_end sub_801A37C + + thumb_func_start sub_801A398 +sub_801A398: + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8004914 + ldr r5, _0801A3D8 + ldr r0, [r5] + adds r0, 0x3C + movs r1, 0 + movs r2, 0 + bl sub_800641C + bl sub_8091A48 + adds r1, r0, 0 + ldr r0, [r5] + strh r1, [r0, 0x22] + bl sub_8013984 + bl sub_801A430 + bl sub_801A4A4 + cmp r4, 0 + beq _0801A3D2 + ldr r0, [r5] + bl AddMenuCursorSprite +_0801A3D2: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0801A3D8: .4byte gUnknown_203B21C + thumb_func_end sub_801A398 + + thumb_func_start sub_801A3DC +sub_801A3DC: + push {r4,r5,lr} + ldr r4, _0801A424 + ldr r2, [r4] + cmp r2, 0 + beq _0801A41C + ldr r1, _0801A428 + ldrh r0, [r2, 0x18] + strh r0, [r1] + ldr r0, [r2, 0x34] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x3C + ldr r0, _0801A42C + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x3C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0801A41C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0801A424: .4byte gUnknown_203B21C +_0801A428: .4byte gUnknown_203B220 +_0801A42C: .4byte gUnknown_80DB8FC + thumb_func_end sub_801A3DC + + thumb_func_start sub_801A430 +sub_801A430: + push {r4,lr} + ldr r4, _0801A4A0 + ldr r0, [r4] + ldrh r1, [r0, 0x20] + adds r0, 0x9C + movs r2, 0 + strb r1, [r0] + ldr r0, [r4] + ldrh r1, [r0, 0x1E] + adds r0, 0x9D + strb r1, [r0] + ldr r0, [r4] + adds r0, 0x9E + movs r1, 0xA + strb r1, [r0] + ldr r0, [r4] + adds r0, 0x9F + strb r2, [r0] + ldr r0, [r4] + movs r1, 0x1A + ldrsh r0, [r0, r1] + movs r1, 0xC + bl sub_80095E4 + adds r0, 0x2 + lsls r0, 16 + ldr r2, [r4] + ldr r3, [r2, 0x34] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x4A + asrs r3, r0, 16 + lsrs r0, 16 + strh r0, [r1] + ldr r1, [r2, 0x34] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r2, r0 + adds r3, 0x2 + adds r2, 0x4C + strh r3, [r2] + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x3C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801A4A0: .4byte gUnknown_203B21C + thumb_func_end sub_801A430 + + thumb_func_start sub_801A4A4 +sub_801A4A4: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xB4 + ldr r4, _0801A570 + ldr r0, [r4] + ldr r0, [r0, 0x34] + bl sub_8008C54 + ldr r0, [r4] + ldr r0, [r0, 0x34] + bl sub_80073B8 + ldr r1, [r4] + movs r2, 0x1E + ldrsh r0, [r1, r2] + lsls r0, 3 + adds r0, 0xA + ldr r2, _0801A574 + ldr r3, [r1, 0x34] + movs r1, 0 + str r1, [sp] + bl xxx_call_draw_string + movs r6, 0 + ldr r0, [r4] + movs r1, 0x1A + ldrsh r0, [r0, r1] + cmp r6, r0 + bge _0801A5B8 + adds r7, r4, 0 + add r4, sp, 0xB0 + mov r9, r6 + add r5, sp, 0x54 + add r2, sp, 0x60 + mov r8, r2 +_0801A4EE: + ldr r0, [r7] + movs r2, 0x1E + ldrsh r1, [r0, r2] + movs r2, 0x1C + ldrsh r0, [r0, r2] + muls r0, r1 + adds r0, r6 + lsls r0, 24 + lsrs r0, 24 + bl sub_8091A90 + ldrb r2, [r0] + lsls r2, 16 + ldr r3, _0801A578 + ldr r1, [r4] + ands r1, r3 + orrs r1, r2 + str r1, [r4] + ldrb r2, [r0, 0x1] + lsls r2, 8 + ldr r0, _0801A57C + ands r1, r0 + orrs r1, r2 + ldr r0, _0801A580 + ands r1, r0 + movs r0, 0x3 + orrs r1, r0 + str r1, [r4] + movs r1, 0x1 + str r1, [sp, 0x54] + mov r0, r9 + strb r0, [r5, 0x4] + movs r0, 0x58 + strh r0, [r5, 0x6] + strb r1, [r5, 0x8] + add r0, sp, 0x4 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_8090E14 + adds r0, r4, 0 + bl sub_8090C7C + ldr r1, _0801A584 + ldr r1, [r1] + movs r2, 0x98 + lsls r2, 2 + adds r1, r2 + ldr r1, [r1] + cmp r0, r1 + bgt _0801A588 + ldr r0, [r7] + adds r1, r6, 0 + bl sub_8013800 + adds r1, r0, 0 + ldr r0, [r7] + ldr r3, [r0, 0x34] + mov r0, r9 + str r0, [sp] + movs r0, 0x8 + add r2, sp, 0x4 + bl xxx_call_draw_string + b _0801A5AC + .align 2, 0 +_0801A570: .4byte gUnknown_203B21C +_0801A574: .4byte gUnknown_80DB92C +_0801A578: .4byte 0xff00ffff +_0801A57C: .4byte 0xffff00ff +_0801A580: .4byte 0xffffff00 +_0801A584: .4byte gUnknown_203B460 +_0801A588: + mov r0, r8 + ldr r1, _0801A5D0 + add r2, sp, 0x4 + bl sub_800D158 + ldr r0, [r7] + adds r1, r6, 0 + bl sub_8013800 + adds r1, r0, 0 + ldr r0, [r7] + ldr r3, [r0, 0x34] + mov r2, r9 + str r2, [sp] + movs r0, 0x8 + mov r2, r8 + bl xxx_call_draw_string +_0801A5AC: + adds r6, 0x1 + ldr r0, [r7] + movs r1, 0x1A + ldrsh r0, [r0, r1] + cmp r6, r0 + blt _0801A4EE +_0801A5B8: + ldr r0, _0801A5D4 + ldr r0, [r0] + ldr r0, [r0, 0x34] + bl sub_80073E0 + add sp, 0xB4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0801A5D0: .4byte gUnknown_80DB934 +_0801A5D4: .4byte gUnknown_203B21C + thumb_func_end sub_801A4A4 + + thumb_func_start sub_801A5D8 +sub_801A5D8: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + adds r6, r1, 0 + adds r7, r2, 0 + mov r8, r3 + bl sub_8090A34 + cmp r0, 0 + bne _0801A5F2 + movs r0, 0 + b _0801A6CC +_0801A5F2: + ldr r5, _0801A6D8 + ldr r0, [r5] + cmp r0, 0 + bne _0801A604 + movs r0, 0xF4 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] +_0801A604: + ldr r0, [r5] + str r4, [r0] + bl sub_80910B4 + bl sub_801AE84 + ldr r0, [r5] + adds r1, r0, 0 + adds r1, 0x88 + str r6, [r1] + adds r2, r0, 0 + adds r2, 0x8C + lsls r1, r6, 1 + adds r1, r6 + lsls r1, 3 + adds r1, 0x90 + adds r1, r0, r1 + str r1, [r2] + adds r0, 0x90 + bl sub_8006518 + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0x88 + ldr r2, [r0] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r1, 0x90 + ldr r0, _0801A6DC + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r2, [r5] + adds r0, r2, 0 + adds r0, 0x8C + ldr r1, [r0] + adds r0, 0x64 + str r0, [r1, 0x14] + cmp r7, 0 + beq _0801A66E + subs r0, 0x68 + ldr r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r1, r2, 0 + adds r1, 0x98 + adds r1, r0 + ldr r0, [r7] + str r0, [r1] +_0801A66E: + ldr r0, [r5] + adds r0, 0x8C + ldr r0, [r0] + mov r1, r8 + bl sub_8012D08 + movs r0, 0x1 + bl sub_8099690 + bl sub_8004914 + ldr r0, [r5] + adds r0, 0x90 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r4, [r5] + adds r4, 0x54 + bl sub_8090A34 + adds r1, r0, 0 + adds r0, r4, 0 + mov r2, r8 + adds r3, r6, 0 + bl sub_8013818 + ldr r2, [r5] + ldr r0, _0801A6E0 + ldrh r1, [r0] + adds r0, r2, 0 + adds r0, 0x6C + strh r1, [r0] + ldr r0, _0801A6E4 + ldrh r0, [r0] + adds r1, r2, 0 + adds r1, 0x72 + strh r0, [r1] + adds r0, r2, 0 + adds r0, 0x54 + bl sub_8013984 + bl sub_801A998 + bl sub_801A9E0 + movs r0, 0x1 +_0801A6CC: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0801A6D8: .4byte gUnknown_203B224 +_0801A6DC: .4byte gUnknown_80DB95C +_0801A6E0: .4byte gUnknown_203B228 +_0801A6E4: .4byte gUnknown_203B22A + thumb_func_end sub_801A5D8 + + thumb_func_start sub_801A6E8 +sub_801A6E8: + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 24 + cmp r0, 0 + bne _0801A704 + ldr r0, _0801A700 + ldr r0, [r0] + adds r0, 0x54 + bl sub_8013660 + movs r0, 0 + b _0801A8A2 + .align 2, 0 +_0801A700: .4byte gUnknown_203B224 +_0801A704: + ldr r0, _0801A720 + ldr r0, [r0] + adds r0, 0x54 + bl GetKeyPress + subs r0, 0x1 + cmp r0, 0x5 + bls _0801A716 + b _0801A87C +_0801A716: + lsls r0, 2 + ldr r1, _0801A724 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801A720: .4byte gUnknown_203B224 +_0801A724: .4byte _0801A728 + .align 2, 0 +_0801A728: + .4byte _0801A74A + .4byte _0801A740 + .4byte _0801A864 + .4byte _0801A806 + .4byte _0801A810 + .4byte _0801A810 +_0801A740: + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + b _0801A8A2 +_0801A74A: + ldr r1, _0801A760 + ldr r0, [r1] + ldr r0, [r0] + adds r4, r1, 0 + cmp r0, 0x5 + bhi _0801A802 + lsls r0, 2 + ldr r1, _0801A764 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801A760: .4byte gUnknown_203B224 +_0801A764: .4byte _0801A768 + .align 2, 0 +_0801A768: + .4byte _0801A780 + .4byte _0801A780 + .4byte _0801A780 + .4byte _0801A794 + .4byte _0801A7AC + .4byte _0801A7FC +_0801A780: + ldr r4, [r4] + bl sub_801A8AC + lsls r0, 2 + adds r4, 0x4 + adds r4, r0 + ldr r0, [r4] + cmp r0, 0 + bne _0801A7F4 + b _0801A7E2 +_0801A794: + bl sub_801AEA8 + cmp r0, 0 + bne _0801A7E2 + bl sub_801A8AC + bl sub_801ADA0 + lsls r0, 24 + cmp r0, 0 + bne _0801A7E2 + b _0801A7F4 +_0801A7AC: + ldr r5, _0801A7EC + ldr r4, [r5] + bl sub_801A8AC + lsls r0, 2 + adds r4, r0 + ldr r0, [r4] + str r0, [sp] + mov r0, sp + ldrb r0, [r0, 0x2] + bl sub_80914E4 + lsls r0, 24 + cmp r0, 0 + beq _0801A7F4 + mov r0, sp + bl sub_8090CCC + ldr r1, [r5] + movs r2, 0x98 + lsls r2, 2 + adds r1, r2 + ldr r1, [r1] + adds r0, r1 + ldr r1, _0801A7F0 + cmp r0, r1 + bgt _0801A7F4 +_0801A7E2: + movs r0, 0 + bl sub_80119D4 + b _0801A802 + .align 2, 0 +_0801A7EC: .4byte gUnknown_203B460 +_0801A7F0: .4byte 0x0001869f +_0801A7F4: + movs r0, 0x2 + bl sub_80119D4 + b _0801A802 +_0801A7FC: + movs r0, 0 + bl sub_80119D4 +_0801A802: + movs r0, 0x3 + b _0801A8A2 +_0801A806: + movs r0, 0x4 + bl sub_80119D4 + movs r0, 0x4 + b _0801A8A2 +_0801A810: + ldr r4, _0801A858 + ldr r0, [r4] + ldr r0, [r0] + cmp r0, 0x3 + bne _0801A87C + bl sub_801A8AC + adds r1, r0, 0 + ldr r0, [r4] + lsls r5, r1, 2 + adds r0, 0x4 + adds r0, r5 + ldr r0, [r0] + cmp r0, 0 + bne _0801A83A + adds r0, r1, 0 + bl sub_801ADA0 + lsls r0, 24 + cmp r0, 0 + beq _0801A85C +_0801A83A: + movs r0, 0x6 + bl sub_80119D4 + ldr r0, [r4] + adds r2, r0, 0x4 + adds r2, r5 + ldr r1, [r2] + movs r3, 0x1 + eors r1, r3 + str r1, [r2] + adds r0, 0x54 + movs r1, 0 + bl sub_80138B8 + b _0801A89C + .align 2, 0 +_0801A858: .4byte gUnknown_203B224 +_0801A85C: + movs r0, 0x2 + bl sub_80119D4 + b _0801A87C +_0801A864: + ldr r0, _0801A894 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0x2 + beq _0801A87C + movs r0, 0x5 + bl sub_80119D4 + bl sub_801AEF8 + bl sub_801A9E0 +_0801A87C: + ldr r0, _0801A894 + ldr r0, [r0] + adds r0, 0x54 + movs r1, 0x1 + bl sub_80138B8 + lsls r0, 24 + cmp r0, 0 + bne _0801A898 + movs r0, 0 + b _0801A8A2 + .align 2, 0 +_0801A894: .4byte gUnknown_203B224 +_0801A898: + bl sub_801A998 +_0801A89C: + bl sub_801A9E0 + movs r0, 0x1 +_0801A8A2: + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_801A6E8 + + thumb_func_start sub_801A8AC +sub_801A8AC: + ldr r0, _0801A8CC + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x72 + movs r3, 0 + ldrsh r1, [r0, r3] + subs r0, 0x2 + movs r3, 0 + ldrsh r0, [r0, r3] + muls r0, r1 + adds r1, r2, 0 + adds r1, 0x6C + movs r2, 0 + ldrsh r1, [r1, r2] + adds r0, r1 + bx lr + .align 2, 0 +_0801A8CC: .4byte gUnknown_203B224 + thumb_func_end sub_801A8AC + + thumb_func_start sub_801A8D0 +sub_801A8D0: + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + bl sub_8099690 + bl sub_8004914 + ldr r5, _0801A924 + ldr r0, [r5] + adds r0, 0x90 + movs r1, 0 + movs r2, 0 + bl sub_800641C + bl sub_80910B4 + bl sub_8090A34 + adds r1, r0, 0 + ldr r0, [r5] + adds r2, r0, 0 + adds r2, 0x76 + strh r1, [r2] + adds r0, 0x54 + bl sub_8013984 + bl sub_801A998 + bl sub_801A9E0 + cmp r4, 0 + beq _0801A91C + ldr r0, [r5] + adds r0, 0x54 + bl AddMenuCursorSprite +_0801A91C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0801A924: .4byte gUnknown_203B224 + thumb_func_end sub_801A8D0 + + thumb_func_start sub_801A928 +sub_801A928: + push {r4,r5,lr} + ldr r4, _0801A988 + ldr r2, [r4] + cmp r2, 0 + beq _0801A980 + ldr r1, _0801A98C + adds r0, r2, 0 + adds r0, 0x6C + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _0801A990 + adds r0, r2, 0 + adds r0, 0x72 + ldrh r0, [r0] + strh r0, [r1] + adds r0, r2, 0 + adds r0, 0x88 + ldr r0, [r0] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x90 + ldr r0, _0801A994 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + movs r0, 0 + bl sub_8099690 + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x90 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0801A980: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0801A988: .4byte gUnknown_203B224 +_0801A98C: .4byte gUnknown_203B228 +_0801A990: .4byte gUnknown_203B22A +_0801A994: .4byte gUnknown_80DB944 + thumb_func_end sub_801A928 + + thumb_func_start sub_801A998 +sub_801A998: + push {r4,lr} + ldr r4, _0801A9DC + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0x74 + ldrh r1, [r1] + adds r0, 0xF0 + movs r2, 0 + strb r1, [r0] + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0x72 + ldrh r1, [r1] + adds r0, 0xF1 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0xF2 + movs r1, 0xB + strb r1, [r0] + ldr r0, [r4] + adds r0, 0xF3 + strb r2, [r0] + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x90 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801A9DC: .4byte gUnknown_203B224 + thumb_func_end sub_801A998 + + thumb_func_start sub_801A9E0 +sub_801A9E0: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xCC + ldr r4, _0801AA2C + ldr r0, [r4] + adds r0, 0x88 + ldr r0, [r0] + bl sub_8008C54 + ldr r0, [r4] + adds r0, 0x88 + ldr r0, [r0] + bl sub_80073B8 + ldr r4, [r4] + adds r1, r4, 0 + adds r1, 0x72 + movs r2, 0 + ldrsh r0, [r1, r2] + lsls r0, 3 + adds r5, r0, 0 + adds r5, 0xA + movs r3, 0 + ldrsh r1, [r1, r3] + cmp r1, 0 + bne _0801AA34 + ldr r2, _0801AA30 + adds r0, r4, 0 + adds r0, 0x88 + ldr r3, [r0] + str r1, [sp] + adds r0, r5, 0 + movs r1, 0 + bl xxx_call_draw_string + b _0801AA48 + .align 2, 0 +_0801AA2C: .4byte gUnknown_203B224 +_0801AA30: .4byte gUnknown_80DB974 +_0801AA34: + ldr r2, _0801AA58 + adds r0, r4, 0 + adds r0, 0x88 + ldr r3, [r0] + movs r0, 0 + str r0, [sp] + adds r0, r5, 0 + movs r1, 0 + bl xxx_call_draw_string +_0801AA48: + movs r7, 0 + ldr r1, _0801AA5C + ldr r0, [r1] + adds r0, 0x6E + movs r4, 0 + ldrsh r0, [r0, r4] + b _0801AD0A + .align 2, 0 +_0801AA58: .4byte gUnknown_80DB984 +_0801AA5C: .4byte gUnknown_203B224 +_0801AA60: + ldr r2, [r1] + adds r0, r2, 0 + adds r0, 0x72 + movs r3, 0 + ldrsh r1, [r0, r3] + subs r0, 0x2 + movs r4, 0 + ldrsh r0, [r0, r4] + muls r0, r1 + adds r0, r7 + mov r8, r0 + ldr r0, _0801AA9C + ldr r0, [r0] + mov r3, r8 + lsls r1, r3, 2 + adds r0, r1 + ldr r0, [r0] + add r1, sp, 0xC8 + str r0, [r1] + ldr r0, [r2] + adds r4, r1, 0 + cmp r0, 0x5 + bls _0801AA90 + b _0801ACC4 +_0801AA90: + lsls r0, 2 + ldr r1, _0801AAA0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801AA9C: .4byte gUnknown_203B460 +_0801AAA0: .4byte _0801AAA4 + .align 2, 0 +_0801AAA4: + .4byte _0801AABC + .4byte _0801AAE4 + .4byte _0801AAE4 + .4byte _0801AB18 + .4byte _0801AB90 + .4byte _0801AC50 +_0801AABC: + add r0, sp, 0x4 + adds r1, r4, 0 + movs r2, 0 + bl sub_8090E14 + ldr r4, _0801AAE0 + ldr r0, [r4] + adds r0, 0x54 + adds r1, r7, 0 + bl sub_8013800 + adds r1, r0, 0 + ldr r0, [r4] + adds r0, 0x88 + ldr r3, [r0] + movs r0, 0 + str r0, [sp] + b _0801AC8C + .align 2, 0 +_0801AAE0: .4byte gUnknown_203B224 +_0801AAE4: + add r2, sp, 0x54 + movs r5, 0 + str r5, [sp, 0x54] + strb r5, [r2, 0x4] + movs r0, 0x1 + strb r0, [r2, 0x8] + strb r0, [r4] + add r1, sp, 0xC8 + add r0, sp, 0x4 + bl sub_8090E14 + ldr r4, _0801AB14 + ldr r0, [r4] + adds r0, 0x54 + adds r1, r7, 0 + bl sub_8013800 + adds r1, r0, 0 + ldr r0, [r4] + adds r0, 0x88 + ldr r3, [r0] + str r5, [sp] + b _0801AC8C + .align 2, 0 +_0801AB14: .4byte gUnknown_203B224 +_0801AB18: + add r2, sp, 0x60 + movs r6, 0 + str r6, [sp, 0x60] + strb r6, [r2, 0x4] + movs r0, 0x1 + strb r0, [r2, 0x8] + strb r0, [r4] + add r1, sp, 0xC8 + add r0, sp, 0x4 + bl sub_8090E14 + ldr r5, _0801AB60 + ldr r0, [r5] + mov r4, r8 + lsls r1, r4, 2 + adds r0, 0x4 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + bne _0801AB4E + mov r0, r8 + bl sub_801ADA0 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _0801AB64 +_0801AB4E: + ldr r0, [r5] + adds r0, 0x54 + adds r1, r7, 0 + bl sub_8013800 + adds r1, r0, 0 + ldr r0, [r5] + b _0801AC86 + .align 2, 0 +_0801AB60: .4byte gUnknown_203B224 +_0801AB64: + ldr r0, _0801AB88 + add r1, sp, 0x4 + movs r2, 0x50 + bl strncpy + ldr r0, [r5] + adds r0, 0x54 + adds r1, r7, 0 + bl sub_8013800 + adds r1, r0, 0 + ldr r2, _0801AB8C + ldr r0, [r5] + adds r0, 0x88 + ldr r3, [r0] + str r4, [sp] + b _0801AC3C + .align 2, 0 +_0801AB88: .4byte gUnknown_202DE58 +_0801AB8C: .4byte gUnknown_80DB994 +_0801AB90: + ldrb r0, [r4, 0x2] + bl sub_80914E4 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + beq _0801AC10 + add r2, sp, 0x6C + movs r1, 0x3 + str r1, [sp, 0x6C] + movs r6, 0 + strb r6, [r2, 0x4] + movs r0, 0x58 + strh r0, [r2, 0x6] + movs r0, 0x1 + strb r0, [r2, 0x8] + strb r1, [r4] + add r0, sp, 0x4 + adds r1, r4, 0 + bl sub_8090E14 + adds r0, r4, 0 + bl sub_8090CCC + ldr r1, _0801AC00 + ldr r1, [r1] + movs r2, 0x98 + lsls r2, 2 + adds r1, r2 + ldr r1, [r1] + adds r0, r1 + ldr r1, _0801AC04 + cmp r0, r1 + ble _0801AC76 + add r5, sp, 0x78 + ldr r1, _0801AC08 + adds r0, r5, 0 + add r2, sp, 0x4 + bl sub_800D158 + ldr r4, _0801AC0C + ldr r0, [r4] + adds r0, 0x54 + adds r1, r7, 0 + bl sub_8013800 + adds r1, r0, 0 + ldr r0, [r4] + adds r0, 0x88 + ldr r3, [r0] + str r6, [sp] + movs r0, 0x8 + adds r2, r5, 0 + bl xxx_call_draw_string + b _0801ACC4 + .align 2, 0 +_0801AC00: .4byte gUnknown_203B460 +_0801AC04: .4byte 0x0001869f +_0801AC08: .4byte gUnknown_80DB9A0 +_0801AC0C: .4byte gUnknown_203B224 +_0801AC10: + add r0, sp, 0x4 + adds r1, r4, 0 + movs r2, 0 + bl sub_8090E14 + ldr r0, _0801AC44 + add r1, sp, 0x4 + movs r2, 0x50 + bl strncpy + ldr r4, _0801AC48 + ldr r0, [r4] + adds r0, 0x54 + adds r1, r7, 0 + bl sub_8013800 + adds r1, r0, 0 + ldr r2, _0801AC4C + ldr r0, [r4] + adds r0, 0x88 + ldr r3, [r0] + str r5, [sp] +_0801AC3C: + movs r0, 0x8 + bl sub_8014FF0 + b _0801ACC4 + .align 2, 0 +_0801AC44: .4byte gUnknown_202DE58 +_0801AC48: .4byte gUnknown_203B224 +_0801AC4C: .4byte gUnknown_80DB994 +_0801AC50: + add r2, sp, 0x78 + movs r6, 0 + str r6, [sp, 0x78] + strb r6, [r2, 0x4] + movs r0, 0x1 + strb r0, [r2, 0x8] + strb r0, [r4] + add r4, sp, 0xC8 + add r0, sp, 0x4 + adds r1, r4, 0 + bl sub_8090E14 + ldrb r0, [r4, 0x2] + bl sub_8091764 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + beq _0801AC9C +_0801AC76: + ldr r4, _0801AC98 + ldr r0, [r4] + adds r0, 0x54 + adds r1, r7, 0 + bl sub_8013800 + adds r1, r0, 0 + ldr r0, [r4] +_0801AC86: + adds r0, 0x88 + ldr r3, [r0] + str r6, [sp] +_0801AC8C: + movs r0, 0x8 + add r2, sp, 0x4 + bl xxx_call_draw_string + b _0801ACC4 + .align 2, 0 +_0801AC98: .4byte gUnknown_203B224 +_0801AC9C: + ldr r0, _0801AD28 + add r1, sp, 0x4 + movs r2, 0x50 + bl strncpy + ldr r4, _0801AD2C + ldr r0, [r4] + adds r0, 0x54 + adds r1, r7, 0 + bl sub_8013800 + adds r1, r0, 0 + ldr r2, _0801AD30 + ldr r0, [r4] + adds r0, 0x88 + ldr r3, [r0] + str r5, [sp] + movs r0, 0x8 + bl sub_8014FF0 +_0801ACC4: + mov r0, r8 + bl sub_801AED0 + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0801ACFE + ldr r4, _0801AD2C + ldr r0, [r4] + adds r0, 0x54 + adds r1, r7, 0 + bl sub_8013800 + adds r2, r0, 0 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x88 + ldr r0, [r0] + adds r1, 0x8C + ldr r1, [r1] + movs r4, 0xC + ldrsh r3, [r1, r4] + subs r3, 0x2 + lsls r3, 3 + movs r1, 0xA + str r1, [sp] + movs r1, 0x8 + bl sub_8007B7C +_0801ACFE: + adds r7, 0x1 + ldr r1, _0801AD2C + ldr r0, [r1] + adds r0, 0x6E + movs r2, 0 + ldrsh r0, [r0, r2] +_0801AD0A: + adds r2, r1, 0 + cmp r7, r0 + bge _0801AD12 + b _0801AA60 +_0801AD12: + ldr r0, [r2] + adds r0, 0x88 + ldr r0, [r0] + bl sub_80073E0 + add sp, 0xCC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0801AD28: .4byte gUnknown_202DE58 +_0801AD2C: .4byte gUnknown_203B224 +_0801AD30: .4byte gUnknown_80DB994 + thumb_func_end sub_801A9E0 + + thumb_func_start sub_801AD34 +sub_801AD34: + push {r4-r6,lr} + sub sp, 0x8 + adds r4, r0, 0 + bl sub_8008C54 + adds r0, r4, 0 + bl sub_80073B8 + ldr r2, _0801AD98 + movs r6, 0 + str r6, [sp] + movs r0, 0x6 + movs r1, 0 + adds r3, r4, 0 + bl xxx_call_draw_string + bl sub_8090A34 + adds r2, r0, 0 + movs r5, 0x7 + str r5, [sp] + str r4, [sp, 0x4] + movs r0, 0x12 + movs r1, 0xD + movs r3, 0x2 + bl sub_8012BC4 + ldr r2, _0801AD9C + str r6, [sp] + movs r0, 0x16 + movs r1, 0xD + adds r3, r4, 0 + bl xxx_call_draw_string + str r5, [sp] + str r4, [sp, 0x4] + movs r0, 0x2B + movs r1, 0xD + movs r2, 0x14 + movs r3, 0x2 + bl sub_8012BC4 + adds r0, r4, 0 + bl sub_80073E0 + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0801AD98: .4byte gUnknown_80DB9A8 +_0801AD9C: .4byte gUnknown_80DB9B0 + thumb_func_end sub_801AD34 + + thumb_func_start sub_801ADA0 +sub_801ADA0: + push {r4-r6,lr} + ldr r5, _0801ADEC + ldr r1, [r5] + lsls r0, 2 + adds r1, r0 + ldr r6, [r1] + lsls r4, r6, 8 + lsrs r0, r4, 24 + bl sub_8091524 + lsls r0, 24 + cmp r0, 0 + beq _0801AE12 + lsrs r0, r4, 24 + bl sub_8090A60 + lsls r0, 24 + cmp r0, 0 + beq _0801ADF4 + lsrs r0, r4, 24 + bl sub_801AE24 + ldr r2, [r5] + lsrs r1, r4, 24 + lsls r1, 1 + adds r2, 0x50 + adds r2, r1 + lsls r0, 16 + lsrs r0, 16 + ldrh r2, [r2] + adds r0, r2 + lsrs r1, r6, 8 + lsls r1, 24 + lsrs r1, 24 + adds r0, r1 + ldr r1, _0801ADF0 + b _0801AE0E + .align 2, 0 +_0801ADEC: .4byte gUnknown_203B460 +_0801ADF0: .4byte 0x000003e7 +_0801ADF4: + lsrs r0, r4, 24 + bl sub_801AE24 + ldr r2, [r5] + lsrs r1, r4, 24 + lsls r1, 1 + adds r2, 0x50 + adds r2, r1 + lsls r0, 16 + lsrs r0, 16 + ldrh r2, [r2] + adds r0, r2 + ldr r1, _0801AE18 +_0801AE0E: + cmp r0, r1 + ble _0801AE1C +_0801AE12: + movs r0, 0 + b _0801AE1E + .align 2, 0 +_0801AE18: .4byte 0x000003e6 +_0801AE1C: + movs r0, 0x1 +_0801AE1E: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_801ADA0 + + thumb_func_start sub_801AE24 +sub_801AE24: + push {r4-r7,lr} + adds r7, r0, 0 + movs r5, 0 + movs r6, 0 + b _0801AE74 +_0801AE2E: + ldr r0, _0801AE64 + ldr r0, [r0] + lsls r1, r6, 2 + adds r0, 0x4 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + beq _0801AE72 + ldr r0, _0801AE68 + ldr r0, [r0] + adds r0, r1 + ldr r4, [r0] + lsls r1, r4, 8 + lsrs r0, r1, 24 + cmp r0, r7 + bne _0801AE72 + bl sub_8090A60 + lsls r0, 24 + cmp r0, 0 + beq _0801AE6C + lsrs r0, r4, 8 + lsls r0, 24 + lsrs r0, 24 + adds r0, r5, r0 + b _0801AE6E + .align 2, 0 +_0801AE64: .4byte gUnknown_203B224 +_0801AE68: .4byte gUnknown_203B460 +_0801AE6C: + adds r0, r5, 0x1 +_0801AE6E: + lsls r0, 16 + lsrs r5, r0, 16 +_0801AE72: + adds r6, 0x1 +_0801AE74: + bl sub_8090A34 + cmp r6, r0 + blt _0801AE2E + adds r0, r5, 0 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_801AE24 + + thumb_func_start sub_801AE84 +sub_801AE84: + push {r4,lr} + movs r2, 0 + ldr r4, _0801AEA4 + movs r3, 0 +_0801AE8C: + ldr r0, [r4] + lsls r1, r2, 2 + adds r0, 0x4 + adds r0, r1 + str r3, [r0] + adds r2, 0x1 + cmp r2, 0x13 + ble _0801AE8C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801AEA4: .4byte gUnknown_203B224 + thumb_func_end sub_801AE84 + + thumb_func_start sub_801AEA8 +sub_801AEA8: + push {lr} + movs r3, 0 + ldr r0, _0801AECC + ldr r0, [r0] + adds r1, r0, 0x4 + movs r2, 0x13 +_0801AEB4: + ldr r0, [r1] + cmp r0, 0 + beq _0801AEBC + adds r3, 0x1 +_0801AEBC: + adds r1, 0x4 + subs r2, 0x1 + cmp r2, 0 + bge _0801AEB4 + adds r0, r3, 0 + pop {r1} + bx r1 + .align 2, 0 +_0801AECC: .4byte gUnknown_203B224 + thumb_func_end sub_801AEA8 + + thumb_func_start sub_801AED0 +sub_801AED0: + ldr r1, _0801AEE0 + ldr r1, [r1] + lsls r0, 2 + adds r1, 0x4 + adds r1, r0 + ldr r0, [r1] + bx lr + .align 2, 0 +_0801AEE0: .4byte gUnknown_203B224 + thumb_func_end sub_801AED0 + + thumb_func_start sub_801AEE4 +sub_801AEE4: + ldr r2, _0801AEF4 + ldr r2, [r2] + lsls r0, 2 + adds r2, 0x4 + adds r2, r0 + str r1, [r2] + bx lr + .align 2, 0 +_0801AEF4: .4byte gUnknown_203B224 + thumb_func_end sub_801AEE4 + + thumb_func_start sub_801AEF8 +sub_801AEF8: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + movs r0, 0 + mov r9, r0 + b _0801AF78 +_0801AF08: + movs r1, 0x1 + add r1, r9 + mov r8, r1 + mov r7, r8 + b _0801AF6E +_0801AF12: + ldr r2, _0801AF90 + ldr r0, [r2] + mov r1, r9 + lsls r6, r1, 2 + adds r0, r6 + ldrb r0, [r0, 0x2] + str r2, [sp] + bl sub_8090D44 + adds r4, r0, 0 + ldr r2, [sp] + ldr r0, [r2] + lsls r5, r7, 2 + adds r0, r5 + ldrb r0, [r0, 0x2] + bl sub_8090D44 + ldr r2, [sp] + cmp r4, r0 + bgt _0801AF4C + cmp r4, r0 + bne _0801AF6C + ldr r0, [r2] + adds r1, r0, r6 + adds r0, r5 + ldrb r1, [r1, 0x1] + ldrb r0, [r0, 0x1] + cmp r1, r0 + bcs _0801AF6C +_0801AF4C: + ldr r0, [r2] + adds r2, r0, r6 + ldr r3, [r2] + adds r0, r5 + ldr r1, [r0] + str r1, [r2] + str r3, [r0] + ldr r0, _0801AF94 + ldr r0, [r0] + adds r0, 0x4 + adds r2, r0, r6 + ldr r3, [r2] + adds r0, r5 + ldr r1, [r0] + str r1, [r2] + str r3, [r0] +_0801AF6C: + adds r7, 0x1 +_0801AF6E: + bl sub_8090A34 + cmp r7, r0 + blt _0801AF12 + mov r9, r8 +_0801AF78: + bl sub_8090A34 + subs r0, 0x1 + cmp r9, r0 + blt _0801AF08 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0801AF90: .4byte gUnknown_203B460 +_0801AF94: .4byte gUnknown_203B224 + thumb_func_end sub_801AEF8 + + thumb_func_start sub_801AF98 +sub_801AF98: + ldr r0, _0801AFA0 + ldr r0, [r0] + bx lr + .align 2, 0 +_0801AFA0: .4byte gUnknown_203B224 + thumb_func_end sub_801AF98 + + thumb_func_start sub_801AFA4 +sub_801AFA4: + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _0801AFEC + movs r0, 0xA4 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] + str r4, [r0, 0x4] + ldr r1, _0801AFF0 + ldr r1, [r1] + lsls r4, 2 + adds r1, r4 + ldrb r1, [r1, 0x2] + strb r1, [r0, 0x8] + ldr r0, [r5] + ldrb r0, [r0, 0x8] + bl sub_80913CC + ldr r1, [r5] + strh r0, [r1, 0xA] + ldr r0, _0801AFF4 + ldrh r1, [r1, 0xA] + bl sub_8092C84 + movs r0, 0 + bl sub_8099690 + bl sub_801B2F4 + cmp r0, 0 + bne _0801AFF8 + movs r0, 0x3 + bl sub_801B064 + b _0801B004 + .align 2, 0 +_0801AFEC: .4byte gUnknown_203B22C +_0801AFF0: .4byte gUnknown_203B460 +_0801AFF4: .4byte gUnknown_202E1C8 +_0801AFF8: + ldr r1, [r5] + movs r0, 0x4 + str r0, [r1, 0x60] + movs r0, 0 + bl sub_801B064 +_0801B004: + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_801AFA4 + + thumb_func_start sub_801B00C +sub_801B00C: + push {lr} + ldr r0, _0801B024 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0x1 + beq _0801B036 + cmp r0, 0x1 + bgt _0801B028 + cmp r0, 0 + beq _0801B030 + b _0801B03C + .align 2, 0 +_0801B024: .4byte gUnknown_203B22C +_0801B028: + cmp r0, 0x4 + bne _0801B03C + movs r0, 0x3 + b _0801B042 +_0801B030: + bl sub_801B200 + b _0801B040 +_0801B036: + bl sub_801B2AC + b _0801B040 +_0801B03C: + bl sub_801B2D8 +_0801B040: + movs r0, 0 +_0801B042: + pop {r1} + bx r1 + thumb_func_end sub_801B00C + + thumb_func_start sub_801B048 +sub_801B048: + push {r4,lr} + ldr r4, _0801B060 + ldr r0, [r4] + cmp r0, 0 + beq _0801B05A + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0801B05A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801B060: .4byte gUnknown_203B22C + thumb_func_end sub_801B048 + + thumb_func_start sub_801B064 +sub_801B064: + push {lr} + ldr r1, _0801B078 + ldr r1, [r1] + str r0, [r1] + bl nullsub_37 + bl sub_801B080 + pop {r0} + bx r0 + .align 2, 0 +_0801B078: .4byte gUnknown_203B22C + thumb_func_end sub_801B064 + + thumb_func_start nullsub_37 +nullsub_37: + bx lr + thumb_func_end nullsub_37 + + thumb_func_start sub_801B080 +sub_801B080: + push {r4,lr} + sub sp, 0x14 + ldr r1, _0801B09C + ldr r0, [r1] + ldr r0, [r0] + adds r4, r1, 0 + cmp r0, 0x4 + bhi _0801B168 + lsls r0, 2 + ldr r1, _0801B0A0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801B09C: .4byte gUnknown_203B22C +_0801B0A0: .4byte _0801B0A4 + .align 2, 0 +_0801B0A4: + .4byte _0801B0B8 + .4byte _0801B0E8 + .4byte _0801B0FC + .4byte _0801B15C + .4byte _0801B168 +_0801B0B8: + bl sub_801B178 + ldr r0, _0801B0E0 + ldr r1, _0801B0E4 + ldr r3, [r1] + ldr r2, [r3, 0x60] + adds r3, 0x64 + movs r4, 0 + str r4, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r4, [sp, 0x8] + str r4, [sp, 0xC] + movs r1, 0x20 + str r1, [sp, 0x10] + movs r1, 0 + bl sub_8014248 + b _0801B168 + .align 2, 0 +_0801B0E0: .4byte gUnknown_80DB9BC +_0801B0E4: .4byte gUnknown_203B22C +_0801B0E8: + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0x58 + movs r3, 0 + ldrsh r1, [r0, r3] + adds r2, 0xC + movs r0, 0x2 + bl sub_801E80C + b _0801B168 +_0801B0FC: + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0xC + ldr r1, [r1, 0x5C] + adds r1, 0x2C + bl sub_8094060 + ldr r0, [r4] + ldrb r0, [r0, 0x8] + bl sub_80915A0 + lsls r0, 24 + cmp r0, 0 + bne _0801B138 + ldr r3, _0801B150 + ldr r1, [r3] + ldr r2, [r4] + ldr r0, [r2, 0x4] + lsls r0, 2 + adds r1, r0 + ldrb r0, [r2, 0x8] + subs r0, 0x7D + strb r0, [r1, 0x1] + ldr r1, [r3] + ldr r0, [r4] + ldr r0, [r0, 0x4] + lsls r0, 2 + adds r1, r0 + movs r0, 0x7C + strb r0, [r1, 0x2] +_0801B138: + movs r0, 0x9C + lsls r0, 1 + bl sub_8011988 + ldr r0, _0801B154 + ldr r3, _0801B158 + movs r1, 0 + movs r2, 0 + bl sub_80141B4 + b _0801B168 + .align 2, 0 +_0801B150: .4byte gUnknown_203B460 +_0801B154: .4byte gUnknown_80DB9E4 +_0801B158: .4byte 0x00000121 +_0801B15C: + ldr r0, _0801B170 + ldr r3, _0801B174 + movs r1, 0 + movs r2, 0 + bl sub_80141B4 +_0801B168: + add sp, 0x14 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801B170: .4byte gUnknown_80DBA0C +_0801B174: .4byte 0x00000121 + thumb_func_end sub_801B080 + + thumb_func_start sub_801B178 +sub_801B178: + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r5, 0 + ldr r1, _0801B1F4 + ldr r0, [r1] + ldr r0, [r0, 0x4C] + cmp r5, r0 + bge _0801B1D2 + ldr r0, _0801B1F8 + mov r8, r0 + adds r7, r1, 0 + movs r6, 0 +_0801B192: + ldr r4, _0801B1FC + adds r4, r6, r4 + ldr r0, [r7] + lsls r1, r5, 1 + adds r0, 0x50 + adds r0, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0x58 + muls r0, r1 + mov r2, r8 + ldr r1, [r2] + adds r1, r0 + adds r0, r4, 0 + bl sub_808DA34 + ldr r2, [r7] + lsls r1, r5, 3 + adds r0, r2, 0 + adds r0, 0x64 + adds r0, r1 + str r4, [r0] + adds r0, r2, 0 + adds r0, 0x68 + adds r0, r1 + adds r1, r5, 0x4 + str r1, [r0] + adds r6, 0x50 + adds r5, 0x1 + ldr r0, [r2, 0x4C] + cmp r5, r0 + blt _0801B192 +_0801B1D2: + ldr r0, _0801B1F4 + ldr r2, [r0] + lsls r3, r5, 3 + adds r0, r2, 0 + adds r0, 0x64 + adds r0, r3 + movs r1, 0 + str r1, [r0] + adds r2, 0x68 + adds r2, r3 + movs r0, 0x1 + str r0, [r2] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0801B1F4: .4byte gUnknown_203B22C +_0801B1F8: .4byte gUnknown_203B45C +_0801B1FC: .4byte gUnknown_202DF98 + thumb_func_end sub_801B178 + + thumb_func_start sub_801B200 +sub_801B200: + push {r4-r6,lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0801B2A4 + ldr r5, _0801B228 + ldr r3, [r5] + ldr r0, [sp] + str r0, [r3, 0x60] + ldr r1, [sp] + cmp r1, 0 + beq _0801B2A4 + cmp r1, 0x1 + bne _0801B22C + movs r0, 0x4 + bl sub_801B064 + b _0801B2A4 + .align 2, 0 +_0801B228: .4byte gUnknown_203B22C +_0801B22C: + subs r1, 0x4 + lsls r1, 1 + adds r0, r3, 0 + adds r0, 0x50 + adds r0, r1 + ldrh r0, [r0] + adds r1, r3, 0 + adds r1, 0x58 + strh r0, [r1] + ldr r2, _0801B26C + movs r0, 0 + ldrsh r1, [r1, r0] + movs r0, 0x58 + muls r0, r1 + ldr r1, [r2] + adds r1, r0 + str r1, [r3, 0x5C] + ldr r0, _0801B270 + bl sub_808DA34 + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0xC + ldr r1, [r1, 0x5C] + adds r1, 0x2C + bl sub_809401C + movs r4, 0 + adds r6, r5, 0 + movs r5, 0xC + b _0801B278 + .align 2, 0 +_0801B26C: .4byte gUnknown_203B45C +_0801B270: .4byte gUnknown_202E218 +_0801B274: + adds r5, 0x8 + adds r4, 0x1 +_0801B278: + cmp r4, 0x7 + bgt _0801B292 + ldr r3, [r6] + adds r2, r3, r5 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0801B274 + ldrh r1, [r3, 0xA] + adds r0, r2, 0 + bl sub_8092AD4 +_0801B292: + cmp r4, 0x3 + ble _0801B29E + movs r0, 0x1 + bl sub_801B064 + b _0801B2A4 +_0801B29E: + movs r0, 0x2 + bl sub_801B064 +_0801B2A4: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_801B200 + + thumb_func_start sub_801B2AC +sub_801B2AC: + push {lr} + bl sub_801E8C0 + cmp r0, 0x2 + beq _0801B2CA + cmp r0, 0x2 + bcc _0801B2D4 + cmp r0, 0x3 + bne _0801B2D4 + bl sub_801E93C + movs r0, 0x2 + bl sub_801B064 + b _0801B2D4 +_0801B2CA: + bl sub_801E93C + movs r0, 0 + bl sub_801B064 +_0801B2D4: + pop {r0} + bx r0 + thumb_func_end sub_801B2AC + + thumb_func_start sub_801B2D8 +sub_801B2D8: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0801B2EC + movs r0, 0x4 + bl sub_801B064 +_0801B2EC: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_801B2D8 + + thumb_func_start sub_801B2F4 +sub_801B2F4: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + mov r0, sp + bl sub_808D580 + adds r6, r0, 0 + ldr r2, _0801B36C + ldr r1, [r2] + movs r0, 0 + str r0, [r1, 0x4C] + movs r5, 0 + cmp r5, r6 + bge _0801B35A + ldr r0, _0801B370 + mov r8, r0 + adds r7, r2, 0 + mov r4, sp +_0801B31A: + ldr r1, [r4] + movs r0, 0x58 + muls r0, r1 + mov r2, r8 + ldr r1, [r2] + adds r1, r0 + ldr r0, [r7] + ldrh r0, [r0, 0xA] + movs r2, 0x8 + ldrsh r1, [r1, r2] + bl sub_808E190 + lsls r0, 24 + cmp r0, 0 + beq _0801B352 + ldr r2, [r7] + ldr r0, [r2, 0x4C] + lsls r0, 1 + adds r1, r2, 0 + adds r1, 0x50 + adds r1, r0 + ldr r0, [r4] + strh r0, [r1] + ldr r0, [r2, 0x4C] + cmp r0, 0x3 + bgt _0801B35A + adds r0, 0x1 + str r0, [r2, 0x4C] +_0801B352: + adds r4, 0x4 + adds r5, 0x1 + cmp r5, r6 + blt _0801B31A +_0801B35A: + ldr r0, _0801B36C + ldr r0, [r0] + ldr r0, [r0, 0x4C] + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0801B36C: .4byte gUnknown_203B22C +_0801B370: .4byte gUnknown_203B45C + thumb_func_end sub_801B2F4 + + thumb_func_start sub_801B374 +sub_801B374: + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0801B3A8 + ldr r4, [r1] + bl sub_80913CC + lsls r0, 16 + lsrs r6, r0, 16 + movs r5, 0 +_0801B388: + ldrh r0, [r4] + lsrs r0, 1 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0801B3AC + movs r0, 0x8 + ldrsh r1, [r4, r0] + adds r0, r6, 0 + bl sub_808E190 + lsls r0, 24 + cmp r0, 0 + beq _0801B3AC + movs r0, 0 + b _0801B3BA + .align 2, 0 +_0801B3A8: .4byte gUnknown_203B45C +_0801B3AC: + adds r5, 0x1 + adds r4, 0x58 + movs r0, 0xCE + lsls r0, 1 + cmp r5, r0 + ble _0801B388 + movs r0, 0x1 +_0801B3BA: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_801B374 + + thumb_func_start sub_801B3C0 +sub_801B3C0: + push {r4,r5,lr} + adds r5, r0, 0 + movs r0, 0x1 + bl sub_8004D8C + ldr r4, _0801B40C + movs r0, 0x94 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r4] + ldr r1, [r5] + str r1, [r0, 0x4] + adds r0, 0x88 + bl sub_801317C + ldr r0, [r4] + movs r1, 0 + str r1, [r0, 0x24] + adds r0, 0x28 + bl sub_80140B4 + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x28 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0 + bl sub_801B46C + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0801B40C: .4byte gUnknown_203B230 + thumb_func_end sub_801B3C0 + + thumb_func_start sub_801B410 +sub_801B410: + push {lr} + ldr r0, _0801B428 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0x1 + beq _0801B43C + cmp r0, 0x1 + bgt _0801B42C + cmp r0, 0 + beq _0801B436 + b _0801B446 + .align 2, 0 +_0801B428: .4byte gUnknown_203B230 +_0801B42C: + cmp r0, 0x2 + beq _0801B446 + cmp r0, 0x3 + beq _0801B442 + b _0801B446 +_0801B436: + bl sub_801B51C + b _0801B44A +_0801B43C: + bl sub_801B590 + b _0801B44A +_0801B442: + movs r0, 0x3 + b _0801B44C +_0801B446: + movs r0, 0x2 + b _0801B44C +_0801B44A: + movs r0, 0 +_0801B44C: + pop {r1} + bx r1 + thumb_func_end sub_801B410 + + thumb_func_start sub_801B450 +sub_801B450: + push {r4,lr} + ldr r4, _0801B468 + ldr r0, [r4] + cmp r0, 0 + beq _0801B462 + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0801B462: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801B468: .4byte gUnknown_203B230 + thumb_func_end sub_801B450 + + thumb_func_start sub_801B46C +sub_801B46C: + push {lr} + ldr r1, _0801B47C + ldr r1, [r1] + str r0, [r1] + bl sub_801B480 + pop {r0} + bx r0 + .align 2, 0 +_0801B47C: .4byte gUnknown_203B230 + thumb_func_end sub_801B46C + + thumb_func_start sub_801B480 +sub_801B480: + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, _0801B4B0 + ldr r0, [r5] + ldr r4, [r0] + cmp r4, 0x1 + beq _0801B4B4 + cmp r4, 0x1 + bgt _0801B50C + cmp r4, 0 + bne _0801B50C + ldr r0, [r0, 0x24] + bl sub_8008C54 + ldr r2, [r5] + adds r0, r2, 0x4 + ldr r1, [r2, 0x24] + adds r2, 0x10 + bl sub_80913E0 + ldr r1, [r5] + str r0, [r1, 0xC] + str r4, [r1, 0x20] + b _0801B50C + .align 2, 0 +_0801B4B0: .4byte gUnknown_203B230 +_0801B4B4: + ldr r0, [r0, 0x24] + bl sub_8008C54 + ldr r0, [r5] + ldr r0, [r0, 0x24] + bl sub_80073B8 + ldr r0, [r5] + ldr r1, [r0, 0x8] + lsls r1, 2 + adds r0, 0x10 + adds r0, r1 + ldr r1, [r0] + ldr r0, _0801B514 + ldr r1, [r1] + bl strcpy + ldr r2, _0801B518 + ldr r0, [r5] + ldr r3, [r0, 0x24] + movs r4, 0 + str r4, [sp] + movs r0, 0x10 + movs r1, 0 + bl sub_8014FF0 + ldr r3, [r5] + ldr r1, [r3, 0x8] + lsls r1, 2 + adds r0, r3, 0 + adds r0, 0x10 + adds r0, r1 + ldr r0, [r0] + ldr r2, [r0, 0x4] + ldr r3, [r3, 0x24] + str r4, [sp] + movs r0, 0x4 + movs r1, 0x10 + bl sub_8014FF0 + ldr r0, [r5] + ldr r0, [r0, 0x24] + bl sub_80073E0 +_0801B50C: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0801B514: .4byte gUnknown_202DF98 +_0801B518: .4byte gUnknown_80DBA4C + thumb_func_end sub_801B480 + + thumb_func_start sub_801B51C +sub_801B51C: + push {r4,lr} + ldr r0, _0801B558 + ldr r2, [r0] + ldr r1, [r2, 0xC] + adds r4, r0, 0 + cmp r1, 0 + beq _0801B540 + ldr r0, [r2, 0x20] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0801B538 + bl sub_8013F84 +_0801B538: + ldr r1, [r4] + ldr r0, [r1, 0x20] + adds r0, 0x1 + str r0, [r1, 0x20] +_0801B540: + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x88 + ldr r1, [r1, 0x24] + bl sub_8012A64 + cmp r0, 0x1 + beq _0801B55C + cmp r0, 0x2 + beq _0801B57E + b _0801B58A + .align 2, 0 +_0801B558: .4byte gUnknown_203B230 +_0801B55C: + movs r0, 0 + bl sub_80119D4 + ldr r1, [r4] + ldr r0, [r1, 0xC] + cmp r0, 0 + beq _0801B576 + movs r0, 0 + str r0, [r1, 0x8] + movs r0, 0x1 + bl sub_801B46C + b _0801B58A +_0801B576: + movs r0, 0x3 + bl sub_801B46C + b _0801B58A +_0801B57E: + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + bl sub_801B46C +_0801B58A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_801B51C + + thumb_func_start sub_801B590 +sub_801B590: + push {r4,lr} + ldr r0, _0801B5D0 + ldr r3, [r0] + ldr r1, [r3, 0xC] + subs r1, 0x1 + ldr r2, [r3, 0x8] + adds r4, r0, 0 + cmp r2, r1 + bge _0801B5B8 + ldr r0, [r3, 0x20] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0801B5B0 + bl sub_8013F84 +_0801B5B0: + ldr r1, [r4] + ldr r0, [r1, 0x20] + adds r0, 0x1 + str r0, [r1, 0x20] +_0801B5B8: + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x88 + ldr r1, [r1, 0x24] + bl sub_8012A64 + cmp r0, 0x1 + beq _0801B5D4 + cmp r0, 0x2 + beq _0801B5F8 + b _0801B604 + .align 2, 0 +_0801B5D0: .4byte gUnknown_203B230 +_0801B5D4: + movs r0, 0 + bl sub_80119D4 + ldr r0, [r4] + ldr r1, [r0, 0x8] + adds r1, 0x1 + str r1, [r0, 0x8] + ldr r0, [r0, 0xC] + cmp r1, r0 + bge _0801B5F0 + movs r0, 0x1 + bl sub_801B46C + b _0801B604 +_0801B5F0: + movs r0, 0 + bl sub_801B46C + b _0801B604 +_0801B5F8: + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + bl sub_801B46C +_0801B604: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_801B590 + + thumb_func_start sub_801B60C +sub_801B60C: + push {r4-r7,lr} + adds r5, r0, 0 + adds r4, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r2, 24 + lsrs r7, r2, 24 + ldr r6, _0801B650 + movs r0, 0xAA + lsls r0, 1 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r6] + adds r2, r0, 0 + adds r2, 0xC8 + movs r1, 0 + str r1, [r2] + str r5, [r0] + strb r4, [r0, 0x12] + ldr r0, [r6] + ldrb r0, [r0, 0x12] + bl sub_8090A60 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _0801B654 + ldr r0, [r6] + strb r7, [r0, 0x11] + ldr r0, [r6] + strb r7, [r0, 0xC] + b _0801B65E + .align 2, 0 +_0801B650: .4byte gUnknown_203B234 +_0801B654: + ldr r0, [r6] + strb r1, [r0, 0x11] + ldr r1, [r6] + movs r0, 0x1 + strb r0, [r1, 0xC] +_0801B65E: + ldr r5, _0801B6A0 + ldr r0, [r5] + movs r1, 0 + movs r2, 0x1 + strb r2, [r0, 0x10] + ldr r0, [r5] + str r1, [r0, 0x14] + strb r1, [r0, 0x18] + ldr r0, [r5] + strb r2, [r0, 0x1C] + ldr r4, _0801B6A4 + bl sub_808D33C + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0x6 + bl sub_808D9AC + ldr r0, _0801B6A8 + ldr r2, [r5] + adds r1, r2, 0 + adds r1, 0x10 + adds r2, 0x14 + bl sub_8090E14 + movs r0, 0 + bl sub_801B748 + movs r0, 0x1 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0801B6A0: .4byte gUnknown_203B234 +_0801B6A4: .4byte gUnknown_202DF98 +_0801B6A8: .4byte gUnknown_202DE58 + thumb_func_end sub_801B60C + + thumb_func_start sub_801B6AC +sub_801B6AC: + push {lr} + ldr r0, _0801B6C4 + ldr r0, [r0] + ldr r0, [r0, 0x4] + subs r0, 0x6 + cmp r0, 0xA + bhi _0801B720 + lsls r0, 2 + ldr r1, _0801B6C8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801B6C4: .4byte gUnknown_203B234 +_0801B6C8: .4byte _0801B6CC + .align 2, 0 +_0801B6CC: + .4byte _0801B6FC + .4byte _0801B702 + .4byte _0801B708 + .4byte _0801B708 + .4byte _0801B70E + .4byte _0801B714 + .4byte _0801B71A + .4byte _0801B720 + .4byte _0801B720 + .4byte _0801B720 + .4byte _0801B6F8 +_0801B6F8: + movs r0, 0x3 + b _0801B726 +_0801B6FC: + bl sub_801BC64 + b _0801B724 +_0801B702: + bl sub_801BC94 + b _0801B724 +_0801B708: + bl sub_801BCCC + b _0801B724 +_0801B70E: + bl sub_801BD80 + b _0801B724 +_0801B714: + bl sub_801BEAC + b _0801B724 +_0801B71A: + bl sub_801BE30 + b _0801B724 +_0801B720: + bl sub_801BEC8 +_0801B724: + movs r0, 0 +_0801B726: + pop {r1} + bx r1 + thumb_func_end sub_801B6AC + + thumb_func_start sub_801B72C +sub_801B72C: + push {r4,lr} + ldr r4, _0801B744 + ldr r0, [r4] + cmp r0, 0 + beq _0801B73E + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0801B73E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801B744: .4byte gUnknown_203B234 + thumb_func_end sub_801B72C + + thumb_func_start sub_801B748 +sub_801B748: + push {lr} + ldr r1, _0801B75C + ldr r1, [r1] + str r0, [r1, 0x4] + bl sub_801B760 + bl sub_801B874 + pop {r0} + bx r0 + .align 2, 0 +_0801B75C: .4byte gUnknown_203B234 + thumb_func_end sub_801B748 + + thumb_func_start sub_801B760 +sub_801B760: + push {r4-r7,lr} + ldr r0, _0801B77C + ldr r1, [r0] + ldr r1, [r1, 0x4] + subs r1, 0x1 + adds r4, r0, 0 + cmp r1, 0xE + bls _0801B772 + b _0801B86A +_0801B772: + lsls r0, r1, 2 + ldr r1, _0801B780 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801B77C: .4byte gUnknown_203B234 +_0801B780: .4byte _0801B784 + .align 2, 0 +_0801B784: + .4byte _0801B7C0 + .4byte _0801B86A + .4byte _0801B86A + .4byte _0801B86A + .4byte _0801B86A + .4byte _0801B7C0 + .4byte _0801B7C0 + .4byte _0801B7C0 + .4byte _0801B7C0 + .4byte _0801B800 + .4byte _0801B7C0 + .4byte _0801B840 + .4byte _0801B7C0 + .4byte _0801B7C0 + .4byte _0801B7C0 +_0801B7C0: + ldr r4, _0801B7F8 + ldr r0, [r4] + adds r0, 0xF4 + bl sub_8006518 + mov r12, r4 + ldr r4, _0801B7FC + movs r3, 0 + movs r2, 0x3 +_0801B7D2: + mov r0, r12 + ldr r1, [r0] + adds r1, r3 + adds r1, 0xF4 + adds r0, r4, 0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r3, 0x18 + subs r2, 0x1 + cmp r2, 0 + bge _0801B7D2 + bl sub_8004914 + ldr r0, _0801B7F8 + ldr r0, [r0] + b _0801B82E + .align 2, 0 +_0801B7F8: .4byte gUnknown_203B234 +_0801B7FC: .4byte gUnknown_80DBA58 +_0801B800: + ldr r0, [r4] + adds r0, 0xF4 + bl sub_8006518 + bl sub_801BB5C + ldr r2, [r4] + movs r0, 0x92 + lsls r0, 1 + adds r2, r0 + ldr r1, _0801B83C + ldm r1!, {r3,r5,r6} + stm r2!, {r3,r5,r6} + ldm r1!, {r3,r5,r7} + stm r2!, {r3,r5,r7} + ldr r1, [r4] + adds r0, r1, r0 + adds r1, 0xCC + bl sub_8012CAC + bl sub_8004914 + ldr r0, [r4] +_0801B82E: + adds r0, 0xF4 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + b _0801B86A + .align 2, 0 +_0801B83C: .4byte gUnknown_80DBA70 +_0801B840: + ldr r0, [r4] + adds r0, 0xF4 + bl sub_8006518 + ldr r1, [r4] + movs r6, 0x86 + lsls r6, 1 + adds r1, r6 + ldr r0, _0801B870 + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + bl sub_8004914 + ldr r0, [r4] + adds r0, 0xF4 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C +_0801B86A: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0801B870: .4byte gUnknown_80DBA88 + thumb_func_end sub_801B760 + + thumb_func_start sub_801B874 +sub_801B874: + push {r4,lr} + sub sp, 0x14 + ldr r1, _0801B890 + ldr r0, [r1] + ldr r0, [r0, 0x4] + adds r4, r1, 0 + cmp r0, 0x10 + bls _0801B886 + b _0801BB0E +_0801B886: + lsls r0, 2 + ldr r1, _0801B894 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801B890: .4byte gUnknown_203B234 +_0801B894: .4byte _0801B898 + .align 2, 0 +_0801B898: + .4byte _0801B8DC + .4byte _0801B9BC + .4byte _0801B9D8 + .4byte _0801B9E0 + .4byte _0801B9F0 + .4byte _0801B9F8 + .4byte _0801BA08 + .4byte _0801BA34 + .4byte _0801BA60 + .4byte _0801BA6E + .4byte _0801BA76 + .4byte _0801BA94 + .4byte _0801BA9E + .4byte _0801BAD0 + .4byte _0801BAE0 + .4byte _0801BAFC + .4byte _0801BB0E +_0801B8DC: + ldr r1, [r4] + ldrb r0, [r1, 0x12] + cmp r0, 0xEA + bne _0801B8FE + movs r0, 0x10 + str r0, [r1, 0x8] + movs r0, 0 + movs r1, 0x47 + movs r2, 0x1 + bl sub_8001784 + cmp r0, 0 + bne _0801B914 + movs r0, 0 + movs r1, 0x47 + movs r2, 0x1 + b _0801B92A +_0801B8FE: + cmp r0, 0xEB + bne _0801B938 + movs r0, 0x10 + str r0, [r1, 0x8] + movs r0, 0 + movs r1, 0x47 + movs r2, 0 + bl sub_8001784 + cmp r0, 0 + beq _0801B924 +_0801B914: + movs r0, 0xFA + lsls r0, 2 + bl sub_80913A0 + movs r0, 0x4 + bl sub_801B748 + b _0801BB0E +_0801B924: + movs r0, 0 + movs r1, 0x47 + movs r2, 0 +_0801B92A: + movs r3, 0x1 + bl sub_800199C + movs r0, 0x3 + bl sub_801B748 + b _0801BB0E +_0801B938: + bl sub_8090A34 + cmp r0, 0x13 + ble _0801B986 + ldr r0, [r4] + ldrb r0, [r0, 0x12] + bl sub_8091524 + lsls r0, 24 + cmp r0, 0 + beq _0801B968 + ldr r0, _0801B970 + ldr r1, [r0] + ldr r2, [r4] + ldrb r0, [r2, 0x12] + lsls r0, 1 + adds r1, 0x50 + adds r3, r1, r0 + ldrh r1, [r3] + ldrb r0, [r2, 0xC] + adds r1, r0 + ldr r0, _0801B974 + cmp r1, r0 + ble _0801B978 +_0801B968: + ldr r1, [r4] + movs r0, 0x6 + b _0801B99C + .align 2, 0 +_0801B970: .4byte gUnknown_203B460 +_0801B974: .4byte 0x000003e7 +_0801B978: + strh r1, [r3] + movs r0, 0xCB + bl sub_8011988 + ldr r1, [r4] + movs r0, 0x5 + b _0801B99C +_0801B986: + ldr r0, [r4] + adds r0, 0x10 + bl sub_8091290 + bl sub_80910B4 + movs r0, 0xCB + bl sub_8011988 + ldr r1, [r4] + movs r0, 0x10 +_0801B99C: + str r0, [r1, 0x8] + ldr r0, _0801B9B0 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0x1 + bne _0801B9B4 + movs r0, 0x2 + bl sub_801B748 + b _0801BB0E + .align 2, 0 +_0801B9B0: .4byte gUnknown_203B234 +_0801B9B4: + movs r0, 0x1 + bl sub_801B748 + b _0801BB0E +_0801B9BC: + movs r0, 0 + bl sub_808D544 + cmp r0, 0x1 + bgt _0801B9D0 + ldr r0, _0801B9CC + b _0801BAE8 + .align 2, 0 +_0801B9CC: .4byte gUnknown_80DBAA0 +_0801B9D0: + ldr r0, _0801B9D4 + b _0801BAE8 + .align 2, 0 +_0801B9D4: .4byte gUnknown_80DBAD0 +_0801B9D8: + ldr r0, _0801B9DC + b _0801BAE8 + .align 2, 0 +_0801B9DC: .4byte gUnknown_80DBB08 +_0801B9E0: + movs r0, 0xD4 + bl sub_8011988 + ldr r0, _0801B9EC + b _0801BAE8 + .align 2, 0 +_0801B9EC: .4byte gUnknown_80DBB38 +_0801B9F0: + ldr r0, _0801B9F4 + b _0801BAE8 + .align 2, 0 +_0801B9F4: .4byte gUnknown_80DBB9C +_0801B9F8: + ldr r1, [r4] + movs r0, 0x10 + str r0, [r1, 0x8] + ldr r0, _0801BA04 + b _0801BAE8 + .align 2, 0 +_0801BA04: .4byte gUnknown_80DBC28 +_0801BA08: + bl sub_801BB20 + ldr r0, _0801BA2C + ldr r1, _0801BA30 + ldr r3, [r1] + adds r3, 0xCC + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + str r2, [sp, 0xC] + str r2, [sp, 0x10] + movs r1, 0 + movs r2, 0x4 + bl sub_8014248 + b _0801BB0E + .align 2, 0 +_0801BA2C: .4byte gUnknown_80DBC60 +_0801BA30: .4byte gUnknown_203B234 +_0801BA34: + bl sub_801BC24 + ldr r0, _0801BA58 + ldr r1, _0801BA5C + ldr r3, [r1] + adds r3, 0xCC + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + str r2, [sp, 0xC] + str r2, [sp, 0x10] + movs r1, 0 + movs r2, 0x3 + bl sub_8014248 + b _0801BB0E + .align 2, 0 +_0801BA58: .4byte gUnknown_80DBC98 +_0801BA5C: .4byte gUnknown_203B234 +_0801BA60: + movs r0, 0x1 + movs r1, 0x3 + movs r2, 0 + movs r3, 0xA + bl sub_801A5D8 + b _0801BB0E +_0801BA6E: + movs r0, 0x1 + bl sub_801A8D0 + b _0801BB0E +_0801BA76: + bl sub_801A9E0 + ldr r0, _0801BA90 + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x28 + adds r1, r2, 0 + adds r1, 0xCC + adds r2, 0xC8 + ldr r2, [r2] + str r2, [sp] + movs r2, 0x2 + b _0801BAC0 + .align 2, 0 +_0801BA90: .4byte gUnknown_203B234 +_0801BA94: + ldr r0, [r4] + adds r0, 0x20 + bl sub_801B3C0 + b _0801BB0E +_0801BA9E: + bl sub_801A9E0 + ldr r4, _0801BACC + ldr r0, [r4] + adds r0, 0x28 + movs r1, 0 + bl sub_8012EA4 + bl sub_801BC24 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x78 + adds r1, 0xCC + movs r2, 0x3 + str r2, [sp] + movs r2, 0x1 +_0801BAC0: + str r2, [sp, 0x4] + movs r2, 0 + movs r3, 0 + bl sub_8012D60 + b _0801BB0E + .align 2, 0 +_0801BACC: .4byte gUnknown_203B234 +_0801BAD0: + ldr r1, [r4] + movs r0, 0x10 + str r0, [r1, 0x8] + ldr r0, _0801BADC + b _0801BAE8 + .align 2, 0 +_0801BADC: .4byte gUnknown_80DBCC4 +_0801BAE0: + ldr r1, [r4] + movs r0, 0x10 + str r0, [r1, 0x8] + ldr r0, _0801BAF4 +_0801BAE8: + ldr r3, _0801BAF8 + movs r1, 0 + movs r2, 0 + bl sub_80141B4 + b _0801BB0E + .align 2, 0 +_0801BAF4: .4byte gUnknown_80DBCE8 +_0801BAF8: .4byte 0x00000101 +_0801BAFC: + ldr r1, [r4] + movs r0, 0x10 + str r0, [r1, 0x8] + ldr r0, _0801BB18 + ldr r3, _0801BB1C + movs r1, 0 + movs r2, 0 + bl sub_80141B4 +_0801BB0E: + add sp, 0x14 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801BB18: .4byte gUnknown_80DBD24 +_0801BB1C: .4byte 0x00000101 + thumb_func_end sub_801B874 + + thumb_func_start sub_801BB20 +sub_801BB20: + ldr r0, _0801BB50 + ldr r3, [r0] + movs r2, 0 + adds r1, r3, 0 + adds r1, 0xCC + ldr r0, _0801BB54 + str r0, [r1] + adds r1, 0x4 + movs r0, 0x4 + str r0, [r1] + adds r1, 0x4 + ldr r0, _0801BB58 + str r0, [r1] + adds r1, 0x4 + movs r0, 0x5 + str r0, [r1] + adds r0, r3, 0 + adds r0, 0xDC + str r2, [r0] + adds r1, 0x8 + movs r0, 0x1 + negs r0, r0 + str r0, [r1] + bx lr + .align 2, 0 +_0801BB50: .4byte gUnknown_203B234 +_0801BB54: .4byte gUnknown_80DBD58 +_0801BB58: .4byte gUnknown_80DBD6C + thumb_func_end sub_801BB20 + + thumb_func_start sub_801BB5C +sub_801BB5C: + push {r4-r7,lr} + ldr r4, _0801BBEC + ldr r2, [r4] + adds r1, r2, 0 + adds r1, 0xCC + ldr r0, _0801BBF0 + str r0, [r1] + adds r1, 0x4 + movs r0, 0x6 + str r0, [r1] + ldr r0, [r2, 0x24] + bl sub_801ADA0 + lsls r0, 24 + cmp r0, 0 + bne _0801BB86 + ldr r0, [r4] + adds r0, 0xD0 + movs r1, 0x1 + negs r1, r1 + str r1, [r0] +_0801BB86: + ldr r0, [r4] + mov r12, r0 + movs r3, 0x1 + movs r2, 0x8 + mov r1, r12 + adds r1, 0xD4 + ldr r0, _0801BBF4 + str r0, [r1] + adds r1, 0x4 + movs r0, 0x7 + str r0, [r1] + adds r1, 0x4 + ldr r0, _0801BBF8 + ldr r0, [r0] + str r0, [r1] + mov r0, r12 + adds r0, 0xE0 + str r2, [r0] + movs r5, 0x3 + adds r1, 0x8 + movs r0, 0 + str r0, [r1] + mov r0, r12 + adds r0, 0xE8 + str r3, [r0] + movs r3, 0 + adds r6, r4, 0 + movs r7, 0x1 + negs r7, r7 + mov r4, r12 + adds r4, 0xC8 + subs r1, 0x14 +_0801BBC6: + ldr r2, [r1] + cmp r2, r7 + beq _0801BBD2 + ldr r0, [r4] + cmp r2, r0 + beq _0801BC1C +_0801BBD2: + adds r1, 0x8 + adds r3, 0x1 + cmp r3, r5 + blt _0801BBC6 + movs r3, 0 + cmp r3, r5 + bge _0801BC1C + ldr r2, [r6] + adds r0, r2, 0 + adds r0, 0xD0 + ldr r1, [r0] + b _0801BC0E + .align 2, 0 +_0801BBEC: .4byte gUnknown_203B234 +_0801BBF0: .4byte gUnknown_80DBD80 +_0801BBF4: .4byte gUnknown_80DBD88 +_0801BBF8: .4byte gUnknown_80D4970 +_0801BBFC: + adds r3, 0x1 + cmp r3, r5 + bge _0801BC1C + ldr r2, [r6] + lsls r0, r3, 3 + adds r1, r2, 0 + adds r1, 0xD0 + adds r1, r0 + ldr r1, [r1] +_0801BC0E: + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0801BBFC + adds r0, r2, 0 + adds r0, 0xC8 + str r1, [r0] +_0801BC1C: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_801BB5C + + thumb_func_start sub_801BC24 +sub_801BC24: + ldr r0, _0801BC58 + ldr r0, [r0] + mov r12, r0 + movs r3, 0 + mov r1, r12 + adds r1, 0xCC + ldr r0, _0801BC5C + ldr r0, [r0] + str r0, [r1] + adds r1, 0x4 + movs r0, 0x2 + str r0, [r1] + movs r2, 0x1 + adds r1, 0x4 + ldr r0, _0801BC60 + ldr r0, [r0] + str r0, [r1] + adds r1, 0x4 + movs r0, 0x3 + str r0, [r1] + mov r0, r12 + adds r0, 0xDC + str r3, [r0] + adds r0, 0x4 + str r2, [r0] + bx lr + .align 2, 0 +_0801BC58: .4byte gUnknown_203B234 +_0801BC5C: .4byte gUnknown_80D4920 +_0801BC60: .4byte gUnknown_80D4928 + thumb_func_end sub_801BC24 + + thumb_func_start sub_801BC64 +sub_801BC64: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0801BC8C + ldr r0, [sp] + cmp r0, 0x4 + beq _0801BC7E + cmp r0, 0x5 + beq _0801BC86 + b _0801BC8C +_0801BC7E: + movs r0, 0x8 + bl sub_801B748 + b _0801BC8C +_0801BC86: + movs r0, 0x7 + bl sub_801B748 +_0801BC8C: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_801BC64 + + thumb_func_start sub_801BC94 +sub_801BC94: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0801BCC6 + ldr r0, [sp] + cmp r0, 0x2 + beq _0801BCB8 + cmp r0, 0x2 + bgt _0801BCB2 + cmp r0, 0x1 + beq _0801BCC0 + b _0801BCC6 +_0801BCB2: + cmp r0, 0x3 + beq _0801BCC0 + b _0801BCC6 +_0801BCB8: + movs r0, 0xD + bl sub_801B748 + b _0801BCC6 +_0801BCC0: + movs r0, 0x6 + bl sub_801B748 +_0801BCC6: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_801BC94 + + thumb_func_start sub_801BCCC +sub_801BCCC: + push {lr} + movs r0, 0x1 + bl sub_801A6E8 + cmp r0, 0x4 + bhi _0801BD7A + lsls r0, 2 + ldr r1, _0801BCE4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801BCE4: .4byte _0801BCE8 + .align 2, 0 +_0801BCE8: + .4byte _0801BD7A + .4byte _0801BD7A + .4byte _0801BD70 + .4byte _0801BCFC + .4byte _0801BD34 +_0801BCFC: + bl sub_801A8AC + ldr r1, _0801BD28 + ldr r2, [r1] + str r0, [r2, 0x24] + ldr r1, _0801BD2C + ldr r1, [r1] + lsls r0, 2 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x20] + ldr r0, _0801BD30 + adds r1, r2, 0 + adds r1, 0x20 + adds r2, 0x14 + bl sub_8090E14 + movs r0, 0xA + bl sub_801B748 + b _0801BD7A + .align 2, 0 +_0801BD28: .4byte gUnknown_203B234 +_0801BD2C: .4byte gUnknown_203B460 +_0801BD30: .4byte gUnknown_202DEA8 +_0801BD34: + bl sub_801A8AC + ldr r1, _0801BD64 + ldr r2, [r1] + str r0, [r2, 0x24] + ldr r1, _0801BD68 + ldr r1, [r1] + lsls r0, 2 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x20] + ldr r0, _0801BD6C + adds r1, r2, 0 + adds r1, 0x20 + adds r2, 0x14 + bl sub_8090E14 + movs r0, 0 + bl sub_8099690 + movs r0, 0xB + bl sub_801B748 + b _0801BD7A + .align 2, 0 +_0801BD64: .4byte gUnknown_203B234 +_0801BD68: .4byte gUnknown_203B460 +_0801BD6C: .4byte gUnknown_202DEA8 +_0801BD70: + bl sub_801A928 + movs r0, 0x6 + bl sub_801B748 +_0801BD7A: + pop {r0} + bx r0 + thumb_func_end sub_801BCCC + + thumb_func_start sub_801BD80 +sub_801BD80: + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + bl sub_801A6E8 + ldr r4, _0801BDC4 + ldr r0, [r4] + adds r0, 0x28 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _0801BDB2 + ldr r0, [r4] + adds r0, 0x28 + mov r1, sp + bl sub_8013114 + ldr r1, [sp] + cmp r1, 0x1 + beq _0801BDB2 + ldr r0, [r4] + adds r0, 0xC8 + str r1, [r0] +_0801BDB2: + ldr r0, [sp] + cmp r0, 0x6 + beq _0801BDD2 + cmp r0, 0x6 + bgt _0801BDC8 + cmp r0, 0x1 + beq _0801BE22 + b _0801BE28 + .align 2, 0 +_0801BDC4: .4byte gUnknown_203B234 +_0801BDC8: + cmp r0, 0x7 + beq _0801BE0C + cmp r0, 0x8 + beq _0801BE14 + b _0801BE28 +_0801BDD2: + ldr r4, _0801BE08 + ldr r0, [r4] + adds r0, 0x20 + bl sub_80917B8 + ldr r0, [r4] + ldr r0, [r0, 0x24] + bl sub_80911F8 + ldr r0, [r4] + adds r0, 0x10 + bl sub_8091290 + bl sub_80910B4 + movs r0, 0xCB + bl sub_8011988 + movs r0, 0 + bl sub_8099690 + bl sub_801A928 + movs r0, 0xE + bl sub_801B748 + b _0801BE28 + .align 2, 0 +_0801BE08: .4byte gUnknown_203B234 +_0801BE0C: + movs r0, 0xC + bl sub_801B748 + b _0801BE28 +_0801BE14: + movs r0, 0 + bl sub_8099690 + movs r0, 0xB + bl sub_801B748 + b _0801BE28 +_0801BE22: + movs r0, 0x9 + bl sub_801B748 +_0801BE28: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_801BD80 + + thumb_func_start sub_801BE30 +sub_801BE30: + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + bl sub_801A6E8 + ldr r4, _0801BE70 + ldr r0, [r4] + adds r0, 0x28 + bl sub_8012FD8 + ldr r0, [r4] + adds r0, 0x78 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _0801BE5E + ldr r0, [r4] + adds r0, 0x78 + mov r1, sp + bl sub_8013114 +_0801BE5E: + ldr r0, [sp] + cmp r0, 0x2 + beq _0801BE80 + cmp r0, 0x2 + bgt _0801BE74 + cmp r0, 0x1 + beq _0801BE78 + b _0801BEA4 + .align 2, 0 +_0801BE70: .4byte gUnknown_203B234 +_0801BE74: + cmp r0, 0x3 + bne _0801BEA4 +_0801BE78: + movs r0, 0x9 + bl sub_801B748 + b _0801BEA4 +_0801BE80: + ldr r0, [r4] + ldr r0, [r0, 0x24] + bl sub_80911F8 + ldr r0, [r4] + adds r0, 0x10 + bl sub_8091290 + bl sub_80910B4 + movs r0, 0xCB + bl sub_8011988 + bl sub_801A928 + movs r0, 0xF + bl sub_801B748 +_0801BEA4: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_801BE30 + + thumb_func_start sub_801BEAC +sub_801BEAC: + push {lr} + bl sub_801B410 + cmp r0, 0x1 + bls _0801BEC4 + cmp r0, 0x3 + bhi _0801BEC4 + bl sub_801B450 + movs r0, 0x9 + bl sub_801B748 +_0801BEC4: + pop {r0} + bx r0 + thumb_func_end sub_801BEAC + + thumb_func_start sub_801BEC8 +sub_801BEC8: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0801BEE0 + ldr r0, _0801BEE8 + ldr r0, [r0] + ldr r0, [r0, 0x8] + bl sub_801B748 +_0801BEE0: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_0801BEE8: .4byte gUnknown_203B234 + thumb_func_end sub_801BEC8 + + thumb_func_start sub_801BEEC +sub_801BEEC: + push {r4-r6,lr} + lsls r0, 16 + asrs r5, r0, 16 + adds r0, r5, 0 + bl sub_801C5F0 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _0801BF40 + ldr r4, _0801BF38 + movs r0, 0x92 + lsls r0, 1 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r4] + str r6, [r0, 0x30] + strh r5, [r0, 0x4] + ldr r3, _0801BF3C + movs r1, 0x58 + adds r2, r5, 0 + muls r2, r1 + ldr r1, [r3] + adds r1, r2 + str r1, [r0, 0x8] + adds r0, 0xC + movs r2, 0x14 + ldrsh r1, [r1, r2] + bl sub_808EBA8 + ldr r1, [r4] + str r0, [r1, 0x2C] + movs r0, 0 + bl sub_801BFB4 + movs r0, 0x1 + b _0801BF42 + .align 2, 0 +_0801BF38: .4byte gUnknown_203B238 +_0801BF3C: .4byte gUnknown_203B45C +_0801BF40: + movs r0, 0 +_0801BF42: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_801BEEC + + thumb_func_start sub_801BF48 +sub_801BF48: + push {lr} + ldr r0, _0801BF60 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0x4 + bhi _0801BF90 + lsls r0, 2 + ldr r1, _0801BF64 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801BF60: .4byte gUnknown_203B238 +_0801BF64: .4byte _0801BF68 + .align 2, 0 +_0801BF68: + .4byte _0801BF80 + .4byte _0801BF80 + .4byte _0801BF86 + .4byte _0801BF8C + .4byte _0801BF7C +_0801BF7C: + movs r0, 0x3 + b _0801BF92 +_0801BF80: + bl sub_801C118 + b _0801BF90 +_0801BF86: + bl sub_801C1A0 + b _0801BF90 +_0801BF8C: + bl sub_801C228 +_0801BF90: + movs r0, 0 +_0801BF92: + pop {r1} + bx r1 + thumb_func_end sub_801BF48 + + thumb_func_start sub_801BF98 +sub_801BF98: + push {r4,lr} + ldr r4, _0801BFB0 + ldr r0, [r4] + cmp r0, 0 + beq _0801BFAA + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0801BFAA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801BFB0: .4byte gUnknown_203B238 + thumb_func_end sub_801BF98 + + thumb_func_start sub_801BFB4 +sub_801BFB4: + push {lr} + ldr r1, _0801BFC8 + ldr r1, [r1] + str r0, [r1] + bl sub_801BFCC + bl sub_801C03C + pop {r0} + bx r0 + .align 2, 0 +_0801BFC8: .4byte gUnknown_203B238 + thumb_func_end sub_801BFB4 + + thumb_func_start sub_801BFCC +sub_801BFCC: + push {r4-r7,lr} + ldr r4, _0801BFF0 + ldr r0, [r4] + adds r0, 0xC4 + bl sub_8006518 + ldr r1, [r4] + ldr r0, [r1] + cmp r0, 0x2 + bne _0801BFF8 + adds r1, 0xF4 + ldr r0, _0801BFF4 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + b _0801C01A + .align 2, 0 +_0801BFF0: .4byte gUnknown_203B238 +_0801BFF4: .4byte gUnknown_80DBDB0 +_0801BFF8: + mov r12, r4 + ldr r4, _0801C034 + movs r3, 0 + movs r2, 0x3 +_0801C000: + mov r0, r12 + ldr r1, [r0] + adds r1, r3 + adds r1, 0xC4 + adds r0, r4, 0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r3, 0x18 + subs r2, 0x1 + cmp r2, 0 + bge _0801C000 +_0801C01A: + bl sub_8004914 + ldr r0, _0801C038 + ldr r0, [r0] + adds r0, 0xC4 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0801C034: .4byte gUnknown_80DBD98 +_0801C038: .4byte gUnknown_203B238 + thumb_func_end sub_801BFCC + + thumb_func_start sub_801C03C +sub_801C03C: + push {lr} + sub sp, 0x8 + ldr r1, _0801C058 + ldr r0, [r1] + ldr r0, [r0] + adds r2, r1, 0 + cmp r0, 0x4 + bhi _0801C0C2 + lsls r0, 2 + ldr r1, _0801C05C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801C058: .4byte gUnknown_203B238 +_0801C05C: .4byte _0801C060 + .align 2, 0 +_0801C060: + .4byte _0801C074 + .4byte _0801C084 + .4byte _0801C08C + .4byte _0801C0B8 + .4byte _0801C0C2 +_0801C074: + ldr r0, [r2] + movs r1, 0x4 + ldrsh r0, [r0, r1] + movs r1, 0 + movs r2, 0x8 + bl sub_801C244 + b _0801C0C2 +_0801C084: + movs r0, 0x1 + bl sub_801C3B0 + b _0801C0C2 +_0801C08C: + bl sub_801C4C8 + bl sub_801C0C8 + ldr r0, _0801C0B4 + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x74 + adds r1, r2, 0 + adds r1, 0x34 + ldr r2, [r2, 0x30] + str r2, [sp] + movs r2, 0x2 + str r2, [sp, 0x4] + movs r2, 0 + movs r3, 0 + bl sub_8012D60 + b _0801C0C2 + .align 2, 0 +_0801C0B4: .4byte gUnknown_203B238 +_0801C0B8: + ldr r0, [r2] + adds r0, 0x28 + ldrb r0, [r0] + bl sub_801C620 +_0801C0C2: + add sp, 0x8 + pop {r0} + bx r0 + thumb_func_end sub_801C03C + + thumb_func_start sub_801C0C8 +sub_801C0C8: + push {r4,r5,lr} + ldr r3, _0801C10C + ldr r1, [r3] + movs r4, 0 + ldr r0, _0801C110 + str r0, [r1, 0x34] + movs r0, 0x2 + str r0, [r1, 0x38] + movs r2, 0x1 + ldr r0, _0801C114 + ldr r0, [r0] + str r0, [r1, 0x3C] + movs r0, 0x3 + str r0, [r1, 0x40] + movs r5, 0x2 + str r4, [r1, 0x44] + str r2, [r1, 0x48] + movs r2, 0 + ldr r4, [r1, 0x30] + adds r1, 0x38 +_0801C0F0: + ldr r0, [r1] + cmp r0, r4 + beq _0801C104 + adds r1, 0x8 + adds r2, 0x1 + cmp r2, r5 + blt _0801C0F0 + ldr r1, [r3] + movs r0, 0x2 + str r0, [r1, 0x30] +_0801C104: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0801C10C: .4byte gUnknown_203B238 +_0801C110: .4byte gUnknown_80DBDC8 +_0801C114: .4byte gUnknown_80D4970 + thumb_func_end sub_801C0C8 + + thumb_func_start sub_801C118 +sub_801C118: + push {lr} + movs r0, 0x1 + bl sub_801C308 + cmp r0, 0x4 + bhi _0801C19A + lsls r0, 2 + ldr r1, _0801C130 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801C130: .4byte _0801C134 + .align 2, 0 +_0801C134: + .4byte _0801C19A + .4byte _0801C19A + .4byte _0801C190 + .4byte _0801C148 + .4byte _0801C16C +_0801C148: + bl sub_801C390 + ldr r1, _0801C168 + ldr r2, [r1] + str r0, [r2, 0x24] + adds r1, r2, 0 + adds r1, 0xC + adds r1, r0 + ldrb r0, [r1] + adds r2, 0x28 + strb r0, [r2] + movs r0, 0x2 + bl sub_801BFB4 + b _0801C19A + .align 2, 0 +_0801C168: .4byte gUnknown_203B238 +_0801C16C: + bl sub_801C390 + ldr r1, _0801C18C + ldr r2, [r1] + str r0, [r2, 0x24] + adds r1, r2, 0 + adds r1, 0xC + adds r1, r0 + ldrb r0, [r1] + adds r2, 0x28 + strb r0, [r2] + movs r0, 0x3 + bl sub_801BFB4 + b _0801C19A + .align 2, 0 +_0801C18C: .4byte gUnknown_203B238 +_0801C190: + bl sub_801C3F8 + movs r0, 0x4 + bl sub_801BFB4 +_0801C19A: + pop {r0} + bx r0 + thumb_func_end sub_801C118 + + thumb_func_start sub_801C1A0 +sub_801C1A0: + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + bl sub_801C308 + ldr r4, _0801C1E0 + ldr r0, [r4] + adds r0, 0x74 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _0801C1D0 + ldr r0, [r4] + adds r0, 0x74 + mov r1, sp + bl sub_8013114 + ldr r1, [sp] + cmp r1, 0x1 + beq _0801C1D0 + ldr r0, [r4] + str r1, [r0, 0x30] +_0801C1D0: + ldr r0, [sp] + cmp r0, 0x2 + beq _0801C1EA + cmp r0, 0x2 + bgt _0801C1E4 + cmp r0, 0x1 + beq _0801C218 + b _0801C21E + .align 2, 0 +_0801C1E0: .4byte gUnknown_203B238 +_0801C1E4: + cmp r0, 0x3 + beq _0801C210 + b _0801C21E +_0801C1EA: + ldr r0, _0801C208 + bl sub_8011988 + ldr r0, _0801C20C + ldr r1, [r0] + ldr r0, [r1, 0x8] + adds r0, 0x20 + adds r1, 0x28 + ldrb r1, [r1] + bl sub_808EBF4 + movs r0, 0x1 + bl sub_801BFB4 + b _0801C21E + .align 2, 0 +_0801C208: .4byte 0x00000133 +_0801C20C: .4byte gUnknown_203B238 +_0801C210: + movs r0, 0x3 + bl sub_801BFB4 + b _0801C21E +_0801C218: + movs r0, 0x1 + bl sub_801BFB4 +_0801C21E: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_801C1A0 + + thumb_func_start sub_801C228 +sub_801C228: + push {lr} + bl sub_801C674 + cmp r0, 0x1 + bls _0801C240 + cmp r0, 0x3 + bhi _0801C240 + bl sub_801C6B4 + movs r0, 0x1 + bl sub_801BFB4 +_0801C240: + pop {r0} + bx r0 + thumb_func_end sub_801C228 + + thumb_func_start sub_801C244 +sub_801C244: + push {r4-r7,lr} + adds r6, r1, 0 + adds r7, r2, 0 + lsls r0, 16 + asrs r0, 16 + adds r4, r0, 0 + bl sub_801C5F0 + lsls r0, 24 + cmp r0, 0 + beq _0801C25E + movs r0, 0 + b _0801C2F6 +_0801C25E: + ldr r5, _0801C2FC + ldr r0, [r5] + cmp r0, 0 + bne _0801C270 + movs r0, 0xC4 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] +_0801C270: + ldr r0, [r5] + strh r4, [r0] + ldr r3, _0801C300 + movs r1, 0x58 + adds r2, r4, 0 + muls r2, r1 + ldr r1, [r3] + adds r1, r2 + str r1, [r0, 0x4] + adds r0, 0x8 + movs r2, 0x14 + ldrsh r1, [r1, r2] + bl sub_808EBA8 + adds r1, r0, 0 + ldr r0, [r5] + str r1, [r0, 0x20] + str r6, [r0, 0x58] + lsls r1, r6, 1 + adds r1, r6 + lsls r1, 3 + adds r1, 0x60 + adds r1, r0, r1 + str r1, [r0, 0x5C] + adds r0, 0x60 + bl sub_8006518 + ldr r1, [r5] + ldr r2, [r1, 0x58] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r1, 0x60 + ldr r0, _0801C304 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r1, [r5] + ldr r0, [r1, 0x5C] + adds r1, 0xC0 + str r1, [r0, 0x14] + adds r1, r7, 0 + bl sub_8012D08 + bl sub_8004914 + ldr r0, [r5] + adds r0, 0x60 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0x24 + ldr r1, [r1, 0x20] + adds r2, r7, 0 + adds r3, r6, 0 + bl sub_8013818 + bl sub_801C440 + bl sub_801C4C8 + movs r0, 0x1 +_0801C2F6: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0801C2FC: .4byte gUnknown_203B23C +_0801C300: .4byte gUnknown_203B45C +_0801C304: .4byte gUnknown_80DBDF0 + thumb_func_end sub_801C244 + + thumb_func_start sub_801C308 +sub_801C308: + push {lr} + lsls r0, 24 + cmp r0, 0 + bne _0801C324 + ldr r0, _0801C320 + ldr r0, [r0] + adds r0, 0x24 + bl sub_8013660 + movs r0, 0 + b _0801C38A + .align 2, 0 +_0801C320: .4byte gUnknown_203B23C +_0801C324: + ldr r0, _0801C33C + ldr r0, [r0] + adds r0, 0x24 + bl GetKeyPress + cmp r0, 0x2 + beq _0801C346 + cmp r0, 0x2 + bgt _0801C340 + cmp r0, 0x1 + beq _0801C350 + b _0801C364 + .align 2, 0 +_0801C33C: .4byte gUnknown_203B23C +_0801C340: + cmp r0, 0x4 + beq _0801C35A + b _0801C364 +_0801C346: + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + b _0801C38A +_0801C350: + movs r0, 0 + bl sub_80119D4 + movs r0, 0x3 + b _0801C38A +_0801C35A: + movs r0, 0x4 + bl sub_80119D4 + movs r0, 0x4 + b _0801C38A +_0801C364: + ldr r0, _0801C37C + ldr r0, [r0] + adds r0, 0x24 + movs r1, 0x1 + bl sub_80138B8 + lsls r0, 24 + cmp r0, 0 + bne _0801C380 + movs r0, 0 + b _0801C38A + .align 2, 0 +_0801C37C: .4byte gUnknown_203B23C +_0801C380: + bl sub_801C440 + bl sub_801C4C8 + movs r0, 0x1 +_0801C38A: + pop {r1} + bx r1 + thumb_func_end sub_801C308 + + thumb_func_start sub_801C390 +sub_801C390: + ldr r0, _0801C3AC + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x42 + movs r3, 0 + ldrsh r1, [r0, r3] + subs r0, 0x2 + movs r3, 0 + ldrsh r0, [r0, r3] + muls r0, r1 + movs r3, 0x3C + ldrsh r1, [r2, r3] + adds r0, r1 + bx lr + .align 2, 0 +_0801C3AC: .4byte gUnknown_203B23C + thumb_func_end sub_801C390 + + thumb_func_start sub_801C3B0 +sub_801C3B0: + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8004914 + ldr r5, _0801C3F4 + ldr r0, [r5] + adds r0, 0x60 + movs r1, 0 + movs r2, 0 + bl sub_800641C + ldr r0, [r5] + ldr r1, [r0, 0x20] + adds r2, r0, 0 + adds r2, 0x46 + strh r1, [r2] + adds r0, 0x24 + bl sub_8013984 + bl sub_801C440 + bl sub_801C4C8 + cmp r4, 0 + beq _0801C3EE + ldr r0, [r5] + adds r0, 0x24 + bl AddMenuCursorSprite +_0801C3EE: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0801C3F4: .4byte gUnknown_203B23C + thumb_func_end sub_801C3B0 + + thumb_func_start sub_801C3F8 +sub_801C3F8: + push {r4,r5,lr} + ldr r4, _0801C438 + ldr r2, [r4] + cmp r2, 0 + beq _0801C432 + ldr r0, [r2, 0x58] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x60 + ldr r0, _0801C43C + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x60 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0801C432: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0801C438: .4byte gUnknown_203B23C +_0801C43C: .4byte gUnknown_80DBDD8 + thumb_func_end sub_801C3F8 + + thumb_func_start sub_801C440 +sub_801C440: + push {r4,lr} + ldr r4, _0801C4C4 + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0x44 + ldrh r1, [r1] + adds r0, 0xC0 + movs r2, 0 + strb r1, [r0] + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0x42 + ldrh r1, [r1] + adds r0, 0xC1 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0xC2 + movs r1, 0xA + strb r1, [r0] + ldr r0, [r4] + adds r0, 0xC3 + strb r2, [r0] + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x60 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + movs r1, 0x3E + ldrsh r0, [r0, r1] + movs r1, 0xC + bl sub_80095E4 + adds r0, 0x2 + ldr r2, [r4] + ldr r3, [r2, 0x58] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x6E + lsls r0, 16 + lsrs r0, 16 + strh r0, [r1] + ldr r3, [r2, 0x58] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 3 + adds r2, r1 + adds r2, 0x70 + strh r0, [r2] + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x60 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801C4C4: .4byte gUnknown_203B23C + thumb_func_end sub_801C440 + + thumb_func_start sub_801C4C8 +sub_801C4C8: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + ldr r6, _0801C594 + ldr r0, [r6] + ldr r0, [r0, 0x58] + bl sub_8008C54 + ldr r0, [r6] + ldr r0, [r0, 0x58] + bl sub_80073B8 + ldr r0, [r6] + adds r1, r0, 0 + adds r1, 0x42 + movs r2, 0 + ldrsh r4, [r1, r2] + lsls r4, 3 + adds r5, r4, 0 + adds r5, 0xA + ldr r2, _0801C598 + ldr r3, [r0, 0x58] + movs r0, 0 + str r0, [sp] + adds r0, r5, 0 + movs r1, 0 + bl xxx_call_draw_string + adds r4, 0x4 + ldr r1, [r6] + adds r0, r1, 0 + adds r0, 0xC2 + ldrb r0, [r0] + lsls r0, 3 + adds r5, r4, r0 + adds r0, r1, 0 + adds r0, 0x42 + movs r3, 0 + ldrsh r2, [r0, r3] + adds r2, 0x1 + movs r0, 0x7 + str r0, [sp] + ldr r0, [r1, 0x58] + str r0, [sp, 0x4] + adds r0, r5, 0 + movs r1, 0 + movs r3, 0x1 + bl sub_8012BC4 + movs r5, 0 + ldr r0, [r6] + movs r1, 0x3E + ldrsh r0, [r0, r1] + cmp r5, r0 + bge _0801C5CC + ldr r2, _0801C59C + mov r8, r2 +_0801C53C: + ldr r2, [r6] + adds r0, r2, 0 + adds r0, 0x42 + movs r3, 0 + ldrsh r1, [r0, r3] + subs r0, 0x2 + movs r3, 0 + ldrsh r0, [r0, r3] + muls r1, r0 + adds r1, r5 + adds r0, r2, 0 + adds r0, 0x8 + adds r0, r1 + ldrb r4, [r0] + adds r0, r2, 0 + adds r0, 0x24 + adds r1, r5, 0 + bl sub_8013800 + adds r7, r0, 0 + adds r0, r4, 0 + bl sub_808EAB0 + adds r1, r0, 0 + mov r0, r8 + movs r2, 0x50 + bl strncpy + ldr r0, [r6] + ldr r0, [r0, 0x4] + adds r0, 0x20 + movs r1, 0x1 + lsls r1, r4 + bl sub_808ECD0 + lsls r0, 24 + cmp r0, 0 + beq _0801C5A4 + mov r0, r8 + subs r0, 0x50 + ldr r1, _0801C5A0 + bl strcpy + b _0801C5AE + .align 2, 0 +_0801C594: .4byte gUnknown_203B23C +_0801C598: .4byte gUnknown_80DBE08 +_0801C59C: .4byte gUnknown_202DEA8 +_0801C5A0: .4byte gUnknown_80DBE14 +_0801C5A4: + mov r0, r8 + subs r0, 0x50 + ldr r1, _0801C5E4 + bl strcpy +_0801C5AE: + ldr r0, [r6] + ldr r3, [r0, 0x58] + movs r0, 0 + str r0, [sp] + movs r0, 0xC + adds r1, r7, 0 + ldr r2, _0801C5E8 + bl sub_8014FF0 + adds r5, 0x1 + ldr r0, [r6] + movs r1, 0x3E + ldrsh r0, [r0, r1] + cmp r5, r0 + blt _0801C53C +_0801C5CC: + ldr r0, _0801C5EC + ldr r0, [r0] + ldr r0, [r0, 0x58] + bl sub_80073E0 + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0801C5E4: .4byte gUnknown_80DBE18 +_0801C5E8: .4byte gUnknown_80DBE1C +_0801C5EC: .4byte gUnknown_203B23C + thumb_func_end sub_801C4C8 + + thumb_func_start sub_801C5F0 +sub_801C5F0: + push {lr} + sub sp, 0x18 + lsls r0, 16 + asrs r0, 16 + ldr r2, _0801C614 + movs r1, 0x58 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + movs r2, 0x14 + ldrsh r1, [r0, r2] + mov r0, sp + bl sub_808EBA8 + cmp r0, 0 + beq _0801C618 + movs r0, 0 + b _0801C61A + .align 2, 0 +_0801C614: .4byte gUnknown_203B45C +_0801C618: + movs r0, 0x1 +_0801C61A: + add sp, 0x18 + pop {r1} + bx r1 + thumb_func_end sub_801C5F0 + + thumb_func_start sub_801C620 +sub_801C620: + push {r4-r6,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + bl sub_8004D8C + ldr r5, _0801C670 + movs r0, 0x94 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] + movs r6, 0 + strb r4, [r0, 0x4] + ldr r0, [r5] + adds r0, 0x88 + bl sub_801317C + ldr r0, [r5] + str r6, [r0, 0x24] + adds r0, 0x28 + bl sub_80140B4 + bl sub_8004914 + ldr r0, [r5] + adds r0, 0x28 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0 + bl sub_801C6D0 + movs r0, 0x1 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0801C670: .4byte gUnknown_203B240 + thumb_func_end sub_801C620 + + thumb_func_start sub_801C674 +sub_801C674: + push {lr} + ldr r0, _0801C68C + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0x1 + beq _0801C6A0 + cmp r0, 0x1 + bgt _0801C690 + cmp r0, 0 + beq _0801C69A + b _0801C6AA + .align 2, 0 +_0801C68C: .4byte gUnknown_203B240 +_0801C690: + cmp r0, 0x2 + beq _0801C6AA + cmp r0, 0x3 + beq _0801C6A6 + b _0801C6AA +_0801C69A: + bl sub_801C7D4 + b _0801C6AE +_0801C6A0: + bl sub_801C848 + b _0801C6AE +_0801C6A6: + movs r0, 0x3 + b _0801C6B0 +_0801C6AA: + movs r0, 0x2 + b _0801C6B0 +_0801C6AE: + movs r0, 0 +_0801C6B0: + pop {r1} + bx r1 + thumb_func_end sub_801C674 + + thumb_func_start sub_801C6B4 +sub_801C6B4: + push {r4,lr} + ldr r4, _0801C6CC + ldr r0, [r4] + cmp r0, 0 + beq _0801C6C6 + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0801C6C6: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801C6CC: .4byte gUnknown_203B240 + thumb_func_end sub_801C6B4 + + thumb_func_start sub_801C6D0 +sub_801C6D0: + push {lr} + ldr r1, _0801C6E0 + ldr r1, [r1] + str r0, [r1] + bl sub_801C6E4 + pop {r0} + bx r0 + .align 2, 0 +_0801C6E0: .4byte gUnknown_203B240 + thumb_func_end sub_801C6D0 + + thumb_func_start sub_801C6E4 +sub_801C6E4: + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, _0801C760 + ldr r0, [r5] + ldr r4, [r0] + cmp r4, 0x1 + beq _0801C76C + cmp r4, 0x1 + bgt _0801C7C4 + cmp r4, 0 + bne _0801C7C4 + ldr r0, [r0, 0x24] + bl sub_8008C54 + ldr r0, [r5] + ldr r0, [r0, 0x24] + bl sub_80073B8 + ldr r0, [r5] + ldrb r0, [r0, 0x4] + bl sub_808EAB0 + adds r1, r0, 0 + ldr r0, _0801C764 + bl strcpy + ldr r2, _0801C768 + str r4, [sp] + movs r0, 0x10 + movs r1, 0 + movs r3, 0 + bl sub_8014FF0 + ldr r0, [r5] + ldrb r0, [r0, 0x4] + bl sub_808EADC + adds r2, r0, 0 + ldr r0, [r5] + ldr r3, [r0, 0x24] + str r4, [sp] + movs r0, 0x8 + movs r1, 0x10 + bl xxx_call_draw_string + ldr r0, [r5] + ldr r0, [r0, 0x24] + bl sub_80073E0 + ldr r0, [r5] + ldrb r0, [r0, 0x4] + bl sub_808EADC + ldr r1, [r5] + adds r1, 0x10 + bl sub_8097DF0 + ldr r1, [r5] + str r0, [r1, 0xC] + str r4, [r1, 0x20] + b _0801C7C4 + .align 2, 0 +_0801C760: .4byte gUnknown_203B240 +_0801C764: .4byte gUnknown_202DE58 +_0801C768: .4byte gUnknown_80DBE2C +_0801C76C: + ldr r0, [r0, 0x24] + bl sub_8008C54 + ldr r0, [r5] + ldr r0, [r0, 0x24] + bl sub_80073B8 + ldr r0, [r5] + ldr r1, [r0, 0x8] + lsls r1, 2 + adds r0, 0x10 + adds r0, r1 + ldr r1, [r0] + ldr r0, _0801C7CC + ldr r1, [r1] + bl strcpy + ldr r2, _0801C7D0 + ldr r0, [r5] + ldr r3, [r0, 0x24] + movs r4, 0 + str r4, [sp] + movs r0, 0x10 + movs r1, 0 + bl sub_8014FF0 + ldr r3, [r5] + ldr r1, [r3, 0x8] + lsls r1, 2 + adds r0, r3, 0 + adds r0, 0x10 + adds r0, r1 + ldr r0, [r0] + ldr r2, [r0, 0x4] + ldr r3, [r3, 0x24] + str r4, [sp] + movs r0, 0x4 + movs r1, 0x10 + bl sub_8014FF0 + ldr r0, [r5] + ldr r0, [r0, 0x24] + bl sub_80073E0 +_0801C7C4: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0801C7CC: .4byte gUnknown_202DF98 +_0801C7D0: .4byte gUnknown_80DBE30 + thumb_func_end sub_801C6E4 + + thumb_func_start sub_801C7D4 +sub_801C7D4: + push {r4,lr} + ldr r0, _0801C810 + ldr r2, [r0] + ldr r1, [r2, 0xC] + adds r4, r0, 0 + cmp r1, 0 + beq _0801C7F8 + ldr r0, [r2, 0x20] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0801C7F0 + bl sub_8013F84 +_0801C7F0: + ldr r1, [r4] + ldr r0, [r1, 0x20] + adds r0, 0x1 + str r0, [r1, 0x20] +_0801C7F8: + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x88 + ldr r1, [r1, 0x24] + bl sub_8012A64 + cmp r0, 0x1 + beq _0801C814 + cmp r0, 0x2 + beq _0801C836 + b _0801C842 + .align 2, 0 +_0801C810: .4byte gUnknown_203B240 +_0801C814: + movs r0, 0 + bl sub_80119D4 + ldr r1, [r4] + ldr r0, [r1, 0xC] + cmp r0, 0 + beq _0801C82E + movs r0, 0 + str r0, [r1, 0x8] + movs r0, 0x1 + bl sub_801C6D0 + b _0801C842 +_0801C82E: + movs r0, 0x3 + bl sub_801C6D0 + b _0801C842 +_0801C836: + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + bl sub_801C6D0 +_0801C842: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_801C7D4 + + thumb_func_start sub_801C848 +sub_801C848: + push {r4,lr} + ldr r0, _0801C888 + ldr r3, [r0] + ldr r1, [r3, 0xC] + subs r1, 0x1 + ldr r2, [r3, 0x8] + adds r4, r0, 0 + cmp r2, r1 + bge _0801C870 + ldr r0, [r3, 0x20] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0801C868 + bl sub_8013F84 +_0801C868: + ldr r1, [r4] + ldr r0, [r1, 0x20] + adds r0, 0x1 + str r0, [r1, 0x20] +_0801C870: + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x88 + ldr r1, [r1, 0x24] + bl sub_8012A64 + cmp r0, 0x1 + beq _0801C88C + cmp r0, 0x2 + beq _0801C8B0 + b _0801C8BC + .align 2, 0 +_0801C888: .4byte gUnknown_203B240 +_0801C88C: + movs r0, 0 + bl sub_80119D4 + ldr r0, [r4] + ldr r1, [r0, 0x8] + adds r1, 0x1 + str r1, [r0, 0x8] + ldr r0, [r0, 0xC] + cmp r1, r0 + bge _0801C8A8 + movs r0, 0x1 + bl sub_801C6D0 + b _0801C8BC +_0801C8A8: + movs r0, 0 + bl sub_801C6D0 + b _0801C8BC +_0801C8B0: + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + bl sub_801C6D0 +_0801C8BC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_801C848 + + thumb_func_start sub_801C8C4 +sub_801C8C4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r4, r0, 0 + adds r6, r1, 0 + mov r9, r2 + mov r10, r3 + bl sub_801CF14 + lsls r0, 24 + cmp r0, 0 + beq _0801C8E4 + movs r0, 0 + b _0801C9D0 +_0801C8E4: + ldr r5, _0801C9E0 + ldr r0, [r5] + cmp r0, 0 + bne _0801C8F6 + ldr r0, _0801C9E4 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] +_0801C8F6: + ldr r0, [r5] + str r4, [r0] + bl sub_801CF94 + ldr r0, [r5] + movs r4, 0x9D + lsls r4, 3 + adds r1, r0, r4 + str r6, [r1] + ldr r1, _0801C9E8 + mov r8, r1 + adds r2, r0, r1 + lsls r1, r6, 1 + adds r1, r6 + lsls r1, 3 + movs r7, 0x9E + lsls r7, 3 + adds r1, r7 + adds r1, r0, r1 + str r1, [r2] + adds r0, r7 + bl sub_8006518 + ldr r1, [r5] + adds r4, r1, r4 + ldr r2, [r4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r1, r7 + ldr r0, _0801C9EC + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r2, [r5] + mov r1, r8 + adds r0, r2, r1 + ldr r1, [r0] + movs r3, 0xAA + lsls r3, 3 + adds r0, r2, r3 + str r0, [r1, 0x14] + mov r4, r9 + cmp r4, 0 + beq _0801C96C + movs r1, 0x9D + lsls r1, 3 + adds r0, r2, r1 + ldr r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + subs r3, 0x58 + adds r1, r2, r3 + adds r1, r0 + ldr r0, [r4] + str r0, [r1] +_0801C96C: + ldr r0, [r5] + add r0, r8 + ldr r0, [r0] + mov r1, r10 + bl sub_8012D08 + bl sub_8004914 + ldr r0, [r5] + adds r0, r7 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r4, [r5] + ldr r0, _0801C9F0 + adds r4, r0 + bl sub_801CE58 + adds r1, r0, 0 + adds r0, r4, 0 + mov r2, r10 + adds r3, r6, 0 + bl sub_8013818 + ldr r0, _0801C9F4 + ldr r4, [r5] + ldr r1, [r0] + ldr r0, [r4] + cmp r1, r0 + bne _0801C9C6 + ldr r0, _0801C9F8 + ldrh r1, [r0] + ldr r2, _0801C9FC + adds r0, r4, r2 + strh r1, [r0] + ldr r0, _0801CA00 + ldrh r1, [r0] + ldr r3, _0801CA04 + adds r0, r4, r3 + strh r1, [r0] + ldr r1, _0801C9F0 + adds r0, r4, r1 + bl sub_8013984 +_0801C9C6: + bl sub_801CC38 + bl sub_801CCD8 + movs r0, 0x1 +_0801C9D0: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0801C9E0: .4byte gUnknown_203B244 +_0801C9E4: .4byte 0x00000554 +_0801C9E8: .4byte 0x000004ec +_0801C9EC: .4byte gUnknown_80DBE54 +_0801C9F0: .4byte 0x000004b4 +_0801C9F4: .4byte gUnknown_203B248 +_0801C9F8: .4byte gUnknown_203B24C +_0801C9FC: .4byte 0x000004cc +_0801CA00: .4byte gUnknown_203B24E +_0801CA04: .4byte 0x000004d2 + thumb_func_end sub_801C8C4 + + thumb_func_start sub_801CA08 +sub_801CA08: + push {r4-r6,lr} + lsls r0, 24 + cmp r0, 0 + bne _0801CA28 + ldr r0, _0801CA20 + ldr r0, [r0] + ldr r1, _0801CA24 + adds r0, r1 + bl sub_8013660 + movs r0, 0 + b _0801CB1E + .align 2, 0 +_0801CA20: .4byte gUnknown_203B244 +_0801CA24: .4byte 0x000004b4 +_0801CA28: + ldr r0, _0801CA44 + ldr r0, [r0] + ldr r1, _0801CA48 + adds r0, r1 + bl GetKeyPress + subs r0, 0x1 + cmp r0, 0x5 + bhi _0801CAF2 + lsls r0, 2 + ldr r1, _0801CA4C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801CA44: .4byte gUnknown_203B244 +_0801CA48: .4byte 0x000004b4 +_0801CA4C: .4byte _0801CA50 + .align 2, 0 +_0801CA50: + .4byte _0801CA72 + .4byte _0801CA68 + .4byte _0801CAF2 + .4byte _0801CAE8 + .4byte _0801CA7C + .4byte _0801CA7C +_0801CA68: + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + b _0801CB1E +_0801CA72: + movs r0, 0 + bl sub_80119D4 + movs r0, 0x3 + b _0801CB1E +_0801CA7C: + ldr r0, _0801CAD8 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0x1 + bne _0801CAF2 + bl sub_801CB24 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + bl sub_801CFE0 + movs r6, 0 + cmp r0, 0 + bne _0801CAB0 + bl sub_8090A34 + adds r4, r0, 0 + bl sub_801CFB8 + adds r4, r0 + cmp r4, 0x13 + bgt _0801CAAC + movs r6, 0x1 +_0801CAAC: + cmp r6, 0 + beq _0801CAE0 +_0801CAB0: + movs r0, 0x6 + bl sub_80119D4 + ldr r0, _0801CAD8 + ldr r0, [r0] + lsls r1, r5, 2 + adds r2, r0, 0 + adds r2, 0xF4 + adds r2, r1 + ldr r1, [r2] + movs r3, 0x1 + eors r1, r3 + str r1, [r2] + ldr r1, _0801CADC + adds r0, r1 + movs r1, 0 + bl sub_80138B8 + b _0801CB18 + .align 2, 0 +_0801CAD8: .4byte gUnknown_203B244 +_0801CADC: .4byte 0x000004b4 +_0801CAE0: + movs r0, 0x2 + bl sub_80119D4 + b _0801CAF2 +_0801CAE8: + movs r0, 0x4 + bl sub_80119D4 + movs r0, 0x4 + b _0801CB1E +_0801CAF2: + ldr r0, _0801CB0C + ldr r0, [r0] + ldr r1, _0801CB10 + adds r0, r1 + movs r1, 0x1 + bl sub_80138B8 + lsls r0, 24 + cmp r0, 0 + bne _0801CB14 + movs r0, 0 + b _0801CB1E + .align 2, 0 +_0801CB0C: .4byte gUnknown_203B244 +_0801CB10: .4byte 0x000004b4 +_0801CB14: + bl sub_801CC38 +_0801CB18: + bl sub_801CCD8 + movs r0, 0x1 +_0801CB1E: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_801CA08 + + thumb_func_start sub_801CB24 +sub_801CB24: + ldr r0, _0801CB50 + ldr r0, [r0] + ldr r2, _0801CB54 + adds r1, r0, r2 + movs r3, 0 + ldrsh r2, [r1, r3] + movs r3, 0x9A + lsls r3, 3 + adds r1, r0, r3 + movs r3, 0 + ldrsh r1, [r1, r3] + muls r2, r1 + ldr r3, _0801CB58 + adds r1, r0, r3 + movs r3, 0 + ldrsh r1, [r1, r3] + adds r2, r1 + adds r0, 0x4 + adds r0, r2 + ldrb r0, [r0] + bx lr + .align 2, 0 +_0801CB50: .4byte gUnknown_203B244 +_0801CB54: .4byte 0x000004d2 +_0801CB58: .4byte 0x000004cc + thumb_func_end sub_801CB24 + + thumb_func_start sub_801CB5C +sub_801CB5C: + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8004914 + ldr r5, _0801CBAC + ldr r0, [r5] + movs r1, 0x9E + lsls r1, 3 + adds r0, r1 + movs r1, 0 + movs r2, 0 + bl sub_800641C + bl sub_801CE58 + adds r2, r0, 0 + ldr r0, [r5] + ldr r3, _0801CBB0 + adds r1, r0, r3 + strh r2, [r1] + ldr r1, _0801CBB4 + adds r0, r1 + bl sub_8013984 + bl sub_801CC38 + bl sub_801CCD8 + cmp r4, 0 + beq _0801CBA6 + ldr r0, [r5] + ldr r3, _0801CBB4 + adds r0, r3 + bl AddMenuCursorSprite +_0801CBA6: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0801CBAC: .4byte gUnknown_203B244 +_0801CBB0: .4byte 0x000004d6 +_0801CBB4: .4byte 0x000004b4 + thumb_func_end sub_801CB5C + + thumb_func_start sub_801CBB8 +sub_801CBB8: + push {r4-r6,lr} + ldr r5, _0801CC1C + ldr r2, [r5] + cmp r2, 0 + beq _0801CC16 + ldr r1, _0801CC20 + ldr r0, [r2] + str r0, [r1] + ldr r1, _0801CC24 + ldr r3, _0801CC28 + adds r0, r2, r3 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _0801CC2C + ldr r6, _0801CC30 + adds r0, r2, r6 + ldrh r0, [r0] + strh r0, [r1] + movs r1, 0x9D + lsls r1, 3 + adds r0, r2, r1 + ldr r0, [r0] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r2, r1 + movs r4, 0x9E + lsls r4, 3 + adds r1, r4 + ldr r0, _0801CC34 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + bl sub_8004914 + ldr r0, [r5] + adds r0, r4 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r5] + bl MemoryFree + movs r0, 0 + str r0, [r5] +_0801CC16: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0801CC1C: .4byte gUnknown_203B244 +_0801CC20: .4byte gUnknown_203B248 +_0801CC24: .4byte gUnknown_203B24C +_0801CC28: .4byte 0x000004cc +_0801CC2C: .4byte gUnknown_203B24E +_0801CC30: .4byte 0x000004d2 +_0801CC34: .4byte gUnknown_80DBE3C + thumb_func_end sub_801CBB8 + + thumb_func_start sub_801CC38 +sub_801CC38: + push {r4,r5,lr} + ldr r4, _0801CCC4 + ldr r0, [r4] + movs r1, 0xAA + lsls r1, 3 + adds r0, r1 + movs r2, 0 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r4] + ldr r1, _0801CCC8 + adds r0, r1 + strb r2, [r0] + ldr r0, [r4] + adds r1, 0x1 + adds r0, r1 + movs r1, 0xC + strb r1, [r0] + ldr r0, [r4] + ldr r1, _0801CCCC + adds r0, r1 + strb r2, [r0] + ldr r0, [r4] + ldr r2, _0801CCD0 + adds r0, r2 + movs r1, 0 + ldrsh r0, [r0, r1] + movs r1, 0xC + bl sub_80095E4 + adds r0, 0x2 + lsls r0, 16 + ldr r3, [r4] + movs r2, 0x9D + lsls r2, 3 + adds r5, r3, r2 + ldr r2, [r5] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 3 + adds r1, r3, r1 + ldr r2, _0801CCD4 + adds r1, r2 + asrs r2, r0, 16 + lsrs r0, 16 + strh r0, [r1] + ldr r1, [r5] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r3, r0 + adds r2, 0x2 + movs r0, 0xA0 + lsls r0, 3 + adds r3, r0 + strh r2, [r3] + bl sub_8004914 + ldr r0, [r4] + movs r1, 0x9E + lsls r1, 3 + adds r0, r1 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0801CCC4: .4byte gUnknown_203B244 +_0801CCC8: .4byte 0x00000551 +_0801CCCC: .4byte 0x00000553 +_0801CCD0: .4byte 0x000004ce +_0801CCD4: .4byte 0x000004fe + thumb_func_end sub_801CC38 + + thumb_func_start sub_801CCD8 +sub_801CCD8: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x58 + ldr r4, _0801CE38 + ldr r0, [r4] + movs r5, 0x9D + lsls r5, 3 + adds r0, r5 + ldr r0, [r0] + bl sub_8008C54 + ldr r0, [r4] + adds r0, r5 + ldr r0, [r0] + bl sub_80073B8 + ldr r2, _0801CE3C + ldr r0, [r4] + adds r0, r5 + ldr r3, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0xA + movs r1, 0 + bl xxx_call_draw_string + ldr r3, [r4] + ldr r1, _0801CE40 + adds r0, r3, r1 + ldrb r0, [r0] + lsls r0, 3 + adds r0, 0x4 + ldr r2, _0801CE44 + adds r1, r3, r2 + movs r6, 0 + ldrsh r2, [r1, r6] + adds r2, 0x1 + movs r1, 0x7 + str r1, [sp] + adds r3, r5 + ldr r1, [r3] + str r1, [sp, 0x4] + movs r1, 0 + movs r3, 0x2 + bl sub_8012BC4 + movs r7, 0 + ldr r0, [r4] + ldr r1, _0801CE48 + adds r0, r1 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r7, r0 + bge _0801CE1A + adds r6, r4, 0 + ldr r3, _0801CE4C + mov r9, r3 + mov r8, r5 +_0801CD50: + ldr r1, [r6] + ldr r4, _0801CE44 + adds r0, r1, r4 + movs r3, 0 + ldrsh r2, [r0, r3] + subs r4, 0x2 + adds r0, r1, r4 + movs r3, 0 + ldrsh r0, [r0, r3] + muls r0, r2 + adds r0, r7 + adds r1, 0x4 + adds r1, r0 + ldrb r5, [r1] + add r0, sp, 0x8 + adds r1, r5, 0 + movs r2, 0 + bl sub_8090DC4 + ldr r0, [r6] + add r0, r9 + adds r1, r7, 0 + bl sub_8013800 + adds r1, r0, 0 + ldr r0, [r6] + add r0, r8 + ldr r3, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0x8 + add r2, sp, 0x8 + bl xxx_call_draw_string + ldr r0, [r6] + add r0, r9 + adds r1, r7, 0 + bl sub_8013800 + adds r1, r0, 0 + ldr r4, [r6] + ldr r2, _0801CE50 + adds r0, r4, r2 + ldr r0, [r0] + movs r3, 0xC + ldrsh r0, [r0, r3] + lsls r0, 3 + subs r0, 0x2 + ldr r2, _0801CE54 + ldr r2, [r2] + lsls r3, r5, 1 + adds r2, 0x50 + adds r2, r3 + ldrh r2, [r2] + movs r3, 0x5 + str r3, [sp] + add r4, r8 + ldr r3, [r4] + str r3, [sp, 0x4] + movs r3, 0x3 + bl sub_8012BC4 + adds r0, r5, 0 + bl sub_801CFE0 + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0801CE0A + ldr r0, [r6] + ldr r4, _0801CE4C + adds r0, r4 + adds r1, r7, 0 + bl sub_8013800 + adds r2, r0, 0 + ldr r1, [r6] + movs r3, 0x9D + lsls r3, 3 + adds r0, r1, r3 + ldr r0, [r0] + adds r4, 0x38 + adds r1, r4 + ldr r1, [r1] + movs r4, 0xC + ldrsh r3, [r1, r4] + subs r3, 0x1 + lsls r3, 3 + movs r1, 0xA + str r1, [sp] + movs r1, 0x8 + bl sub_8007B7C +_0801CE0A: + adds r7, 0x1 + ldr r0, [r6] + ldr r1, _0801CE48 + adds r0, r1 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r7, r0 + blt _0801CD50 +_0801CE1A: + ldr r0, _0801CE38 + ldr r0, [r0] + movs r3, 0x9D + lsls r3, 3 + adds r0, r3 + ldr r0, [r0] + bl sub_80073E0 + add sp, 0x58 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0801CE38: .4byte gUnknown_203B244 +_0801CE3C: .4byte gUnknown_80DBE6C +_0801CE40: .4byte 0x00000552 +_0801CE44: .4byte 0x000004d2 +_0801CE48: .4byte 0x000004ce +_0801CE4C: .4byte 0x000004b4 +_0801CE50: .4byte 0x000004ec +_0801CE54: .4byte gUnknown_203B460 + thumb_func_end sub_801CCD8 + + thumb_func_start sub_801CE58 +sub_801CE58: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + movs r3, 0 + movs r6, 0x1 + ldr r4, _0801CF0C +_0801CE68: + ldr r0, [r4] + ldr r0, [r0] + cmp r0, 0x2 + beq _0801CE92 + ldr r0, _0801CF10 + ldr r0, [r0] + lsls r1, r6, 1 + adds r0, 0x50 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _0801CE9C + lsls r0, r6, 24 + lsrs r0, 24 + str r3, [sp] + bl sub_8091524 + lsls r0, 24 + ldr r3, [sp] + cmp r0, 0 + beq _0801CE9C +_0801CE92: + ldr r0, [r4] + adds r0, 0x4 + adds r0, r3 + strb r6, [r0] + adds r3, 0x1 +_0801CE9C: + adds r6, 0x1 + cmp r6, 0xEF + ble _0801CE68 + movs r6, 0 + subs r0, r3, 0x1 + mov r9, r0 + cmp r6, r9 + bge _0801CEFC +_0801CEAC: + adds r0, r6, 0x1 + mov r8, r0 + mov r5, r8 + cmp r8, r3 + bge _0801CEF6 + ldr r7, _0801CF0C +_0801CEB8: + ldr r0, [r7] + adds r0, 0x4 + adds r0, r6 + ldrb r0, [r0] + str r3, [sp] + bl sub_8090D44 + adds r4, r0, 0 + ldr r0, [r7] + adds r0, 0x4 + adds r0, r5 + ldrb r0, [r0] + bl sub_8090D44 + ldr r3, [sp] + cmp r4, r0 + ble _0801CEF0 + ldr r0, [r7] + adds r0, 0x4 + adds r1, r0, r6 + ldrb r2, [r1] + adds r0, r5 + ldrb r0, [r0] + strb r0, [r1] + ldr r0, [r7] + adds r0, 0x4 + adds r0, r5 + strb r2, [r0] +_0801CEF0: + adds r5, 0x1 + cmp r5, r3 + blt _0801CEB8 +_0801CEF6: + mov r6, r8 + cmp r6, r9 + blt _0801CEAC +_0801CEFC: + adds r0, r3, 0 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0801CF0C: .4byte gUnknown_203B244 +_0801CF10: .4byte gUnknown_203B460 + thumb_func_end sub_801CE58 + + thumb_func_start sub_801CF14 +sub_801CF14: + push {r4,lr} + cmp r0, 0x2 + bne _0801CF1E +_0801CF1A: + movs r0, 0 + b _0801CF46 +_0801CF1E: + movs r4, 0x1 +_0801CF20: + ldr r0, _0801CF4C + ldr r0, [r0] + lsls r1, r4, 1 + adds r0, 0x50 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + beq _0801CF3E + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8091524 + lsls r0, 24 + cmp r0, 0 + bne _0801CF1A +_0801CF3E: + adds r4, 0x1 + cmp r4, 0xEF + ble _0801CF20 + movs r0, 0x1 +_0801CF46: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0801CF4C: .4byte gUnknown_203B460 + thumb_func_end sub_801CF14 + + thumb_func_start sub_801CF50 +sub_801CF50: + push {r4,r5,lr} + cmp r0, 0x2 + bne _0801CF5A +_0801CF56: + movs r0, 0 + b _0801CF84 +_0801CF5A: + movs r4, 0x1 + ldr r5, _0801CF8C +_0801CF5E: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8091524 + lsls r0, 24 + cmp r0, 0 + beq _0801CF7C + ldr r0, _0801CF90 + ldr r0, [r0] + lsls r1, r4, 1 + adds r0, 0x50 + adds r0, r1 + ldrh r0, [r0] + cmp r0, r5 + bls _0801CF56 +_0801CF7C: + adds r4, 0x1 + cmp r4, 0xEF + ble _0801CF5E + movs r0, 0x1 +_0801CF84: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0801CF8C: .4byte 0x000003e6 +_0801CF90: .4byte gUnknown_203B460 + thumb_func_end sub_801CF50 + + thumb_func_start sub_801CF94 +sub_801CF94: + push {r4,lr} + movs r2, 0 + ldr r4, _0801CFB4 + movs r3, 0 +_0801CF9C: + ldr r0, [r4] + lsls r1, r2, 2 + adds r0, 0xF4 + adds r0, r1 + str r3, [r0] + adds r2, 0x1 + cmp r2, 0xEF + ble _0801CF9C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801CFB4: .4byte gUnknown_203B244 + thumb_func_end sub_801CF94 + + thumb_func_start sub_801CFB8 +sub_801CFB8: + push {lr} + movs r3, 0 + ldr r0, _0801CFDC + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0xF4 + movs r2, 0xEF +_0801CFC6: + ldr r0, [r1] + cmp r0, 0 + beq _0801CFCE + adds r3, 0x1 +_0801CFCE: + adds r1, 0x4 + subs r2, 0x1 + cmp r2, 0 + bge _0801CFC6 + adds r0, r3, 0 + pop {r1} + bx r1 + .align 2, 0 +_0801CFDC: .4byte gUnknown_203B244 + thumb_func_end sub_801CFB8 + + thumb_func_start sub_801CFE0 +sub_801CFE0: + lsls r0, 24 + ldr r1, _0801CFF0 + ldr r1, [r1] + lsrs r0, 22 + adds r1, 0xF4 + adds r1, r0 + ldr r0, [r1] + bx lr + .align 2, 0 +_0801CFF0: .4byte gUnknown_203B244 + thumb_func_end sub_801CFE0 + + thumb_func_start sub_801CFF4 +sub_801CFF4: + lsls r0, 24 + ldr r2, _0801D004 + ldr r2, [r2] + lsrs r0, 22 + adds r2, 0xF4 + adds r2, r0 + str r1, [r2] + bx lr + .align 2, 0 +_0801D004: .4byte gUnknown_203B244 + thumb_func_end sub_801CFF4 + + thumb_func_start sub_801D008 +sub_801D008: + ldr r0, _0801D010 + ldr r0, [r0] + bx lr + .align 2, 0 +_0801D010: .4byte gUnknown_203B244 + thumb_func_end sub_801D008 + + thumb_func_start sub_801D014 +sub_801D014: + push {r4,r5,lr} + adds r5, r0, 0 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r4, _0801D054 + movs r0, 0x8C + lsls r0, 1 + movs r1, 0x8 + bl MemoryAlloc + adds r2, r0, 0 + str r2, [r4] + ldr r0, _0801D058 + ldr r0, [r0] + str r0, [r2, 0x14] + str r5, [r2] + cmp r5, 0 + beq _0801D088 + movs r3, 0 + ldr r0, _0801D05C + ldr r1, [r0] + adds r4, r0, 0 + cmp r5, r1 + bne _0801D060 + strh r3, [r2, 0x4] + b _0801D08C + .align 2, 0 +_0801D054: .4byte gUnknown_203B250 +_0801D058: .4byte gUnknown_203B254 +_0801D05C: .4byte gUnknown_203B45C +_0801D060: + adds r3, 0x1 + movs r0, 0xCE + lsls r0, 1 + cmp r3, r0 + bgt _0801D08C + ldr r0, _0801D084 + ldr r2, [r0] + lsls r0, r3, 16 + asrs r0, 16 + movs r1, 0x58 + muls r1, r0 + ldr r0, [r4] + adds r0, r1 + ldr r1, [r2] + cmp r1, r0 + bne _0801D060 + strh r3, [r2, 0x4] + b _0801D08C + .align 2, 0 +_0801D084: .4byte gUnknown_203B250 +_0801D088: + ldr r0, _0801D0C4 + strh r0, [r2, 0x4] +_0801D08C: + bl sub_80A5728 + lsls r0, 16 + asrs r0, 16 + bl sub_8002658 + ldr r4, _0801D0C8 + ldr r1, [r4] + movs r5, 0 + strb r0, [r1, 0x6] + ldr r0, [r4] + strb r5, [r0, 0x8] + ldr r0, [r4] + strb r5, [r0, 0x9] + bl sub_808D33C + ldr r1, [r4] + str r0, [r1, 0xC] + strb r5, [r1, 0x7] + ldr r0, [r4] + ldr r0, [r0] + cmp r0, 0 + beq _0801D0CC + movs r0, 0x5 + bl sub_801D208 + b _0801D0D2 + .align 2, 0 +_0801D0C4: .4byte 0x0000019d +_0801D0C8: .4byte gUnknown_203B250 +_0801D0CC: + movs r0, 0 + bl sub_801D208 +_0801D0D2: + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_801D014 + + thumb_func_start sub_801D0DC +sub_801D0DC: + push {lr} + ldr r0, _0801D0F4 + ldr r0, [r0] + ldr r0, [r0, 0x10] + cmp r0, 0xC + bhi _0801D16C + lsls r0, 2 + ldr r1, _0801D0F8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801D0F4: .4byte gUnknown_203B250 +_0801D0F8: .4byte _0801D0FC + .align 2, 0 +_0801D0FC: + .4byte _0801D130 + .4byte _0801D130 + .4byte _0801D16C + .4byte _0801D136 + .4byte _0801D13C + .4byte _0801D142 + .4byte _0801D148 + .4byte _0801D148 + .4byte _0801D14E + .4byte _0801D154 + .4byte _0801D15A + .4byte _0801D160 + .4byte _0801D166 +_0801D130: + bl sub_801D680 + b _0801D170 +_0801D136: + bl sub_801D760 + b _0801D170 +_0801D13C: + bl sub_801D77C + b _0801D170 +_0801D142: + bl sub_801D798 + b _0801D170 +_0801D148: + bl sub_801D7CC + b _0801D170 +_0801D14E: + bl sub_801D808 + b _0801D170 +_0801D154: + bl sub_801D824 + b _0801D170 +_0801D15A: + bl sub_801D840 + b _0801D170 +_0801D160: + bl sub_801D85C + b _0801D170 +_0801D166: + bl sub_801D878 + b _0801D170 +_0801D16C: + movs r0, 0x3 + b _0801D172 +_0801D170: + movs r0, 0 +_0801D172: + pop {r1} + bx r1 + thumb_func_end sub_801D0DC + + thumb_func_start sub_801D178 +sub_801D178: + push {r4,lr} + ldr r0, _0801D188 + ldr r4, [r0] + ldrb r0, [r4, 0x9] + cmp r0, 0 + beq _0801D18C + movs r0, 0x2 + b _0801D1CC + .align 2, 0 +_0801D188: .4byte gUnknown_203B250 +_0801D18C: + ldrb r0, [r4, 0x7] + cmp r0, 0 + beq _0801D196 + movs r0, 0x3 + b _0801D1CC +_0801D196: + ldrb r0, [r4, 0x8] + cmp r0, 0 + beq _0801D1A0 + movs r0, 0x1 + b _0801D1CC +_0801D1A0: + bl sub_808D33C + ldr r1, [r4, 0xC] + cmp r1, r0 + bne _0801D1C6 + movs r0, 0x7 + bl sub_80A7AE8 + lsls r0, 16 + cmp r0, 0 + blt _0801D1CA + bl sub_808D3F8 + ldrh r0, [r0] + lsrs r0, 1 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0801D1CA +_0801D1C6: + movs r0, 0x4 + b _0801D1CC +_0801D1CA: + movs r0, 0 +_0801D1CC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_801D178 + + thumb_func_start sub_801D1D4 +sub_801D1D4: + ldr r0, _0801D1DC + ldr r0, [r0] + ldrb r0, [r0, 0x7] + bx lr + .align 2, 0 +_0801D1DC: .4byte gUnknown_203B250 + thumb_func_end sub_801D1D4 + + thumb_func_start sub_801D1E0 +sub_801D1E0: + push {r4,lr} + ldr r4, _0801D200 + ldr r2, [r4] + cmp r2, 0 + beq _0801D1FA + ldr r0, _0801D204 + ldr r1, [r2, 0x14] + str r1, [r0] + adds r0, r2, 0 + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0801D1FA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801D200: .4byte gUnknown_203B250 +_0801D204: .4byte gUnknown_203B254 + thumb_func_end sub_801D1E0 + + thumb_func_start sub_801D208 +sub_801D208: + push {lr} + ldr r1, _0801D21C + ldr r1, [r1] + str r0, [r1, 0x10] + bl sub_801D220 + bl sub_801D3A8 + pop {r0} + bx r0 + .align 2, 0 +_0801D21C: .4byte gUnknown_203B250 + thumb_func_end sub_801D208 + + thumb_func_start sub_801D220 +sub_801D220: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r4, _0801D248 + ldr r0, [r4] + adds r0, 0xB8 + bl sub_8006518 + ldr r0, [r4] + ldr r0, [r0, 0x10] + cmp r0, 0 + beq _0801D250 + cmp r0, 0x1 + beq _0801D2C0 + movs r2, 0 + adds r7, r4, 0 + ldr r3, _0801D24C + b _0801D368 + .align 2, 0 +_0801D248: .4byte gUnknown_203B250 +_0801D24C: .4byte gUnknown_80DBE7C +_0801D250: + bl sub_801D4C0 + ldr r0, [r4] + ldr r0, [r0] + cmp r0, 0 + beq _0801D290 + adds r7, r4, 0 + ldr r0, _0801D288 + mov r9, r0 + mov r12, r7 + ldr r2, _0801D28C + mov r8, r2 + movs r3, 0 + movs r2, 0x3 +_0801D26C: + mov r4, r12 + ldr r1, [r4] + adds r1, r3 + adds r1, 0xB8 + mov r0, r8 + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + adds r3, 0x18 + subs r2, 0x1 + cmp r2, 0 + bge _0801D26C + b _0801D2F6 + .align 2, 0 +_0801D288: .4byte gUnknown_80DBE98 +_0801D28C: .4byte gUnknown_80DBE7C +_0801D290: + adds r7, r4, 0 + mov r8, r7 + ldr r6, _0801D2BC + mov r9, r6 + movs r3, 0 + movs r2, 0x3 +_0801D29C: + mov r0, r8 + ldr r1, [r0] + adds r1, r3 + adds r1, 0xB8 + mov r0, r9 + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + movs r0, 0x18 + add r9, r0 + adds r3, 0x18 + subs r2, 0x1 + cmp r2, 0 + bge _0801D29C + b _0801D34E + .align 2, 0 +_0801D2BC: .4byte gUnknown_80DBEB0 +_0801D2C0: + bl sub_801D4C0 + ldr r0, [r4] + ldr r0, [r0] + cmp r0, 0 + beq _0801D324 + adds r7, r4, 0 + ldr r2, _0801D31C + mov r9, r2 + mov r8, r7 + ldr r3, _0801D320 + mov r12, r3 + movs r3, 0 + movs r2, 0x3 +_0801D2DC: + mov r4, r8 + ldr r1, [r4] + adds r1, r3 + adds r1, 0xB8 + mov r0, r12 + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + adds r3, 0x18 + subs r2, 0x1 + cmp r2, 0 + bge _0801D2DC +_0801D2F6: + ldr r1, [r7] + adds r1, 0xB8 + mov r0, r9 + ldm r0!, {r2,r5,r6} + stm r1!, {r2,r5,r6} + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldr r1, [r7] + adds r0, r1, 0 + adds r0, 0xB8 + adds r1, 0x68 + bl sub_8012CAC + ldr r0, [r7] + adds r0, 0xC4 + movs r1, 0x9 + strh r1, [r0] + b _0801D384 + .align 2, 0 +_0801D31C: .4byte gUnknown_80DBE98 +_0801D320: .4byte gUnknown_80DBE7C +_0801D324: + adds r7, r4, 0 + mov r8, r7 + ldr r6, _0801D364 + mov r9, r6 + movs r3, 0 + movs r2, 0x3 +_0801D330: + mov r0, r8 + ldr r1, [r0] + adds r1, r3 + adds r1, 0xB8 + mov r0, r9 + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + movs r0, 0x18 + add r9, r0 + adds r3, 0x18 + subs r2, 0x1 + cmp r2, 0 + bge _0801D330 +_0801D34E: + ldr r1, [r7] + adds r0, r1, 0 + adds r0, 0xB8 + adds r1, 0x68 + bl sub_8012CAC + ldr r0, [r7] + adds r0, 0xC4 + movs r1, 0x8 + strh r1, [r0] + b _0801D384 + .align 2, 0 +_0801D364: .4byte gUnknown_80DBEB0 +_0801D368: + ldr r0, [r7] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 3 + adds r0, r1 + adds r0, 0xB8 + adds r1, r3, 0 + ldm r1!, {r4-r6} + stm r0!, {r4-r6} + ldm r1!, {r4-r6} + stm r0!, {r4-r6} + adds r2, 0x1 + cmp r2, 0x3 + ble _0801D368 +_0801D384: + bl sub_8004914 + ldr r0, _0801D3A4 + ldr r0, [r0] + adds r0, 0xB8 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0801D3A4: .4byte gUnknown_203B250 + thumb_func_end sub_801D220 + + thumb_func_start sub_801D3A8 +sub_801D3A8: + push {r4-r6,lr} + sub sp, 0x8 + ldr r1, _0801D3C4 + ldr r0, [r1] + ldr r0, [r0, 0x10] + adds r6, r1, 0 + cmp r0, 0xC + bls _0801D3BA + b _0801D4B6 +_0801D3BA: + lsls r0, 2 + ldr r1, _0801D3C8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801D3C4: .4byte gUnknown_203B250 +_0801D3C8: .4byte _0801D3CC + .align 2, 0 +_0801D3CC: + .4byte _0801D400 + .4byte _0801D400 + .4byte _0801D4B6 + .4byte _0801D458 + .4byte _0801D462 + .4byte _0801D468 + .4byte _0801D472 + .4byte _0801D47A + .4byte _0801D482 + .4byte _0801D490 + .4byte _0801D49C + .4byte _0801D4AA + .4byte _0801D4B2 +_0801D400: + ldr r0, [r6] + ldr r5, [r0] + cmp r5, 0 + beq _0801D438 + ldr r4, _0801D434 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x7 + bl sub_808D9AC + ldr r2, [r6] + str r4, [r2, 0x18] + adds r0, r2, 0 + adds r0, 0x18 + adds r1, r2, 0 + adds r1, 0x68 + adds r3, r2, 0 + adds r3, 0xA8 + ldr r2, [r2, 0x14] + str r2, [sp] + movs r2, 0 + str r2, [sp, 0x4] + bl sub_8012D60 + b _0801D4B6 + .align 2, 0 +_0801D434: .4byte gUnknown_202DF98 +_0801D438: + bl sub_801D894 + ldr r2, [r6] + adds r0, r2, 0 + adds r0, 0x18 + adds r1, r2, 0 + adds r1, 0x68 + adds r3, r2, 0 + adds r3, 0xA8 + ldr r2, [r2, 0x14] + str r2, [sp] + str r5, [sp, 0x4] + movs r2, 0 + bl sub_8012D60 + b _0801D4B6 +_0801D458: + ldr r0, [r6] + ldr r0, [r0] + bl sub_80227B8 + b _0801D4B6 +_0801D462: + bl sub_8027074 + b _0801D4B6 +_0801D468: + ldr r0, [r6] + ldr r0, [r0] + bl sub_8025EF4 + b _0801D4B6 +_0801D472: + movs r0, 0 + bl sub_80252F0 + b _0801D4B6 +_0801D47A: + movs r0, 0x1 + bl sub_80252F0 + b _0801D4B6 +_0801D482: + ldr r0, [r6] + movs r1, 0x4 + ldrsh r0, [r0, r1] + movs r1, 0x2 + bl sub_8024458 + b _0801D4B6 +_0801D490: + ldr r0, [r6] + movs r1, 0x4 + ldrsh r0, [r0, r1] + bl sub_801BEEC + b _0801D4B6 +_0801D49C: + ldr r0, [r6] + ldrb r0, [r0, 0x6] + movs r1, 0x1 + movs r2, 0x2 + bl sub_8021774 + b _0801D4B6 +_0801D4AA: + movs r0, 0 + bl sub_802C860 + b _0801D4B6 +_0801D4B2: + bl sub_801DCC4 +_0801D4B6: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_801D3A8 + + thumb_func_start sub_801D4C0 +sub_801D4C0: + push {r4-r7,lr} + movs r6, 0 + ldr r4, _0801D554 + ldr r0, [r4] + adds r0, 0xA8 + movs r1, 0 + movs r2, 0x10 + bl MemoryFill16 + ldr r0, [r4] + ldrb r0, [r0, 0x6] + cmp r0, 0 + bne _0801D568 + bl sub_8096E2C + lsls r0, 24 + cmp r0, 0 + beq _0801D534 + ldr r1, [r4] + movs r0, 0x2 + str r0, [r1, 0x6C] + ldr r0, _0801D558 + str r0, [r1, 0x68] + bl sub_8090A34 + cmp r0, 0 + bne _0801D4FE + ldr r0, [r4] + adds r0, 0xA8 + movs r1, 0x1 + strh r1, [r0] +_0801D4FE: + ldr r1, [r4] + ldr r0, _0801D55C + str r0, [r1, 0x70] + movs r0, 0x4 + str r0, [r1, 0x74] + movs r6, 0x2 + movs r0, 0x2 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _0801D534 + ldr r1, [r4] + ldr r0, _0801D560 + str r0, [r1, 0x78] + movs r0, 0x9 + str r0, [r1, 0x7C] + bl sub_802C83C + lsls r0, 24 + cmp r0, 0 + beq _0801D532 + ldr r0, [r4] + adds r0, 0xAC + movs r1, 0x1 + strh r1, [r0] +_0801D532: + movs r6, 0x3 +_0801D534: + ldr r4, _0801D554 + ldr r2, [r4] + lsls r3, r6, 3 + adds r0, r2, 0 + adds r0, 0x68 + adds r0, r3 + ldr r1, _0801D564 + str r1, [r0] + adds r2, 0x6C + adds r2, r3 + movs r0, 0xB + str r0, [r2] + adds r6, 0x1 + adds r7, r4, 0 + b _0801D5E6 + .align 2, 0 +_0801D554: .4byte gUnknown_203B250 +_0801D558: .4byte gUnknown_80DBF10 +_0801D55C: .4byte gUnknown_80DBF18 +_0801D560: .4byte gUnknown_80DBF20 +_0801D564: .4byte gUnknown_80DBF2C +_0801D568: + ldr r0, _0801D63C + ldr r1, _0801D640 + bl strcpy + bl sub_8096E2C + lsls r0, 24 + cmp r0, 0 + beq _0801D5B6 + ldr r1, [r4] + ldr r0, _0801D644 + ldr r0, [r0] + str r0, [r1, 0x68] + movs r0, 0x5 + str r0, [r1, 0x6C] + movs r0, 0x4 + bl sub_8024108 + lsls r0, 24 + cmp r0, 0 + beq _0801D59A + ldr r0, [r4] + adds r0, 0xA8 + movs r1, 0x1 + strh r1, [r0] +_0801D59A: + movs r6, 0x1 + ldr r1, [r4] + movs r0, 0x2 + str r0, [r1, 0x74] + ldr r0, _0801D648 + str r0, [r1, 0x70] + bl sub_8090A34 + cmp r0, 0 + bne _0801D5B4 + ldr r0, [r4] + adds r0, 0xAA + strh r6, [r0] +_0801D5B4: + movs r6, 0x2 +_0801D5B6: + ldr r5, _0801D64C + ldr r1, [r5] + lsls r2, r6, 3 + adds r3, r1, 0 + adds r3, 0x68 + adds r4, r3, r2 + ldr r0, _0801D650 + ldr r0, [r0] + str r0, [r4] + adds r1, 0x6C + adds r2, r1, r2 + movs r0, 0x8 + str r0, [r2] + adds r6, 0x1 + lsls r2, r6, 3 + adds r3, r2 + ldr r0, _0801D654 + ldr r0, [r0] + str r0, [r3] + adds r1, r2 + movs r0, 0xA + str r0, [r1] + adds r6, 0x1 + adds r7, r5, 0 +_0801D5E6: + ldr r4, [r7] + lsls r2, r6, 3 + adds r0, r4, 0 + adds r0, 0x68 + adds r0, r2 + movs r1, 0 + str r1, [r0] + adds r1, r4, 0 + adds r1, 0x6C + adds r2, r1, r2 + movs r0, 0x1 + str r0, [r2] + movs r3, 0 + cmp r3, r6 + bge _0801D622 + adds r5, r4, 0 + adds r4, 0xA8 + adds r2, r1, 0 +_0801D60A: + ldrh r0, [r4] + cmp r0, 0 + bne _0801D618 + ldr r1, [r2] + ldr r0, [r5, 0x14] + cmp r1, r0 + beq _0801D67A +_0801D618: + adds r4, 0x2 + adds r2, 0x8 + adds r3, 0x1 + cmp r3, r6 + blt _0801D60A +_0801D622: + movs r3, 0 + cmp r3, r6 + bge _0801D67A + ldr r1, [r7] + adds r0, r1, 0 + adds r0, 0xA8 + ldrh r0, [r0] + cmp r0, 0 + bne _0801D658 + ldr r0, [r1, 0x6C] + str r0, [r1, 0x14] + b _0801D67A + .align 2, 0 +_0801D63C: .4byte gUnknown_202DF98 +_0801D640: .4byte gUnknown_80DBF34 +_0801D644: .4byte gUnknown_80D49A8 +_0801D648: .4byte gUnknown_80DBF10 +_0801D64C: .4byte gUnknown_203B250 +_0801D650: .4byte gUnknown_80D4970 +_0801D654: .4byte gUnknown_80D49B4 +_0801D658: + adds r3, 0x1 + cmp r3, r6 + bge _0801D67A + ldr r2, [r7] + lsls r0, r3, 1 + adds r1, r2, 0 + adds r1, 0xA8 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _0801D658 + lsls r0, r3, 3 + adds r1, r2, 0 + adds r1, 0x6C + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x14] +_0801D67A: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_801D4C0 + + thumb_func_start sub_801D680 +sub_801D680: + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + ldr r4, _0801D6C0 + ldr r0, [r4] + adds r0, 0x18 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _0801D6AC + ldr r0, [r4] + adds r0, 0x18 + mov r1, sp + bl sub_8013114 + ldr r1, [sp] + cmp r1, 0x1 + beq _0801D6AC + ldr r0, [r4] + str r1, [r0, 0x14] +_0801D6AC: + ldr r0, [sp] + subs r0, 0x1 + cmp r0, 0xA + bhi _0801D756 + lsls r0, 2 + ldr r1, _0801D6C4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801D6C0: .4byte gUnknown_203B250 +_0801D6C4: .4byte _0801D6C8 + .align 2, 0 +_0801D6C8: + .4byte _0801D750 + .4byte _0801D6F4 + .4byte _0801D704 + .4byte _0801D6FC + .4byte _0801D70C + .4byte _0801D714 + .4byte _0801D71C + .4byte _0801D724 + .4byte _0801D72C + .4byte _0801D734 + .4byte _0801D748 +_0801D6F4: + movs r0, 0x3 + bl sub_801D208 + b _0801D756 +_0801D6FC: + movs r0, 0x6 + bl sub_801D208 + b _0801D756 +_0801D704: + movs r0, 0x4 + bl sub_801D208 + b _0801D756 +_0801D70C: + movs r0, 0x7 + bl sub_801D208 + b _0801D756 +_0801D714: + movs r0, 0x8 + bl sub_801D208 + b _0801D756 +_0801D71C: + movs r0, 0x9 + bl sub_801D208 + b _0801D756 +_0801D724: + movs r0, 0xA + bl sub_801D208 + b _0801D756 +_0801D72C: + movs r0, 0xB + bl sub_801D208 + b _0801D756 +_0801D734: + ldr r0, _0801D744 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x9] + movs r0, 0x2 + bl sub_801D208 + b _0801D756 + .align 2, 0 +_0801D744: .4byte gUnknown_203B250 +_0801D748: + movs r0, 0xC + bl sub_801D208 + b _0801D756 +_0801D750: + movs r0, 0x2 + bl sub_801D208 +_0801D756: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_801D680 + + thumb_func_start sub_801D760 +sub_801D760: + push {lr} + bl sub_8022860 + cmp r0, 0x1 + bls _0801D778 + cmp r0, 0x3 + bhi _0801D778 + bl sub_8022908 + movs r0, 0x1 + bl sub_801D208 +_0801D778: + pop {r0} + bx r0 + thumb_func_end sub_801D760 + + thumb_func_start sub_801D77C +sub_801D77C: + push {lr} + bl sub_80270A4 + cmp r0, 0x1 + bls _0801D794 + cmp r0, 0x3 + bhi _0801D794 + bl sub_8027168 + movs r0, 0x1 + bl sub_801D208 +_0801D794: + pop {r0} + bx r0 + thumb_func_end sub_801D77C + + thumb_func_start sub_801D798 +sub_801D798: + push {lr} + bl sub_8025F68 + cmp r0, 0x1 + bls _0801D7C2 + cmp r0, 0x3 + bhi _0801D7C2 + bl sub_802604C + lsls r0, 24 + cmp r0, 0 + beq _0801D7B8 + ldr r0, _0801D7C8 + ldr r1, [r0] + ldrb r0, [r1, 0x6] + strb r0, [r1, 0x7] +_0801D7B8: + bl sub_8026058 + movs r0, 0x2 + bl sub_801D208 +_0801D7C2: + pop {r0} + bx r0 + .align 2, 0 +_0801D7C8: .4byte gUnknown_203B250 + thumb_func_end sub_801D798 + + thumb_func_start sub_801D7CC +sub_801D7CC: + push {r4,lr} + bl sub_8025354 + cmp r0, 0x1 + bls _0801D802 + cmp r0, 0x3 + bhi _0801D802 + bl sub_802540C + ldr r4, _0801D7F8 + ldr r1, [r4] + strb r0, [r1, 0x7] + bl sub_8025418 + ldr r0, [r4] + ldrb r0, [r0, 0x7] + cmp r0, 0 + beq _0801D7FC + movs r0, 0x2 + bl sub_801D208 + b _0801D802 + .align 2, 0 +_0801D7F8: .4byte gUnknown_203B250 +_0801D7FC: + movs r0, 0x1 + bl sub_801D208 +_0801D802: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_801D7CC + + thumb_func_start sub_801D808 +sub_801D808: + push {lr} + bl sub_80244E4 + cmp r0, 0x1 + bls _0801D820 + cmp r0, 0x3 + bhi _0801D820 + bl sub_802453C + movs r0, 0x1 + bl sub_801D208 +_0801D820: + pop {r0} + bx r0 + thumb_func_end sub_801D808 + + thumb_func_start sub_801D824 +sub_801D824: + push {lr} + bl sub_801BF48 + cmp r0, 0x1 + bls _0801D83C + cmp r0, 0x3 + bhi _0801D83C + bl sub_801BF98 + movs r0, 0x1 + bl sub_801D208 +_0801D83C: + pop {r0} + bx r0 + thumb_func_end sub_801D824 + + thumb_func_start sub_801D840 +sub_801D840: + push {lr} + bl sub_80217EC + cmp r0, 0x1 + bls _0801D858 + cmp r0, 0x3 + bhi _0801D858 + bl sub_8021830 + movs r0, 0x1 + bl sub_801D208 +_0801D858: + pop {r0} + bx r0 + thumb_func_end sub_801D840 + + thumb_func_start sub_801D85C +sub_801D85C: + push {lr} + bl sub_802C898 + cmp r0, 0x1 + bls _0801D874 + cmp r0, 0x3 + bhi _0801D874 + bl sub_802C8F4 + movs r0, 0x1 + bl sub_801D208 +_0801D874: + pop {r0} + bx r0 + thumb_func_end sub_801D85C + + thumb_func_start sub_801D878 +sub_801D878: + push {lr} + bl sub_801DCE8 + cmp r0, 0x1 + bls _0801D890 + cmp r0, 0x3 + bhi _0801D890 + bl sub_801DD50 + movs r0, 0x1 + bl sub_801D208 +_0801D890: + pop {r0} + bx r0 + thumb_func_end sub_801D878 + + thumb_func_start sub_801D894 +sub_801D894: + push {r4-r6,lr} + sub sp, 0x68 + ldr r0, _0801D8A8 + ldr r1, [r0] + ldrb r0, [r1, 0x6] + cmp r0, 0 + bne _0801D8AC + bl sub_8098FB4 + b _0801D8B2 + .align 2, 0 +_0801D8A8: .4byte gUnknown_203B250 +_0801D8AC: + ldrb r0, [r1, 0x6] + bl sub_8092524 +_0801D8B2: + add r2, sp, 0x68 + add r1, sp, 0x4 + movs r3, 0 + bl sub_8014BC4 + add r0, sp, 0x4 + bl sub_8008ED0 + movs r4, 0x80 + subs r4, r0 + lsrs r0, r4, 31 + adds r4, r0 + asrs r4, 1 + movs r0, 0x1 + bl sub_8008C54 + movs r0, 0x1 + bl sub_80073B8 + movs r6, 0 + str r6, [sp] + adds r0, r4, 0 + movs r1, 0x4 + add r2, sp, 0x4 + movs r3, 0x1 + bl xxx_call_draw_string + movs r0, 0x1 + bl sub_80073E0 + movs r0, 0x2 + bl sub_8008C54 + movs r0, 0x2 + bl sub_80073B8 + movs r0, 0x2 + movs r1, 0x8 + movs r2, 0x6 + bl sub_801D970 + ldr r5, _0801D964 + bl sub_8092178 + lsls r0, 24 + lsrs r0, 24 + bl sub_80921A8 + adds r4, r0, 0 + bl sub_8092110 + adds r3, r0, 0 + add r0, sp, 0x4 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_800D158 + str r6, [sp] + movs r0, 0x20 + movs r1, 0x4 + add r2, sp, 0x4 + movs r3, 0x2 + bl xxx_call_draw_string + ldr r1, _0801D968 + ldr r0, _0801D96C + ldr r0, [r0] + movs r2, 0x98 + lsls r2, 2 + adds r0, r2 + ldr r2, [r0] + add r0, sp, 0x4 + bl sub_800D158 + str r6, [sp] + movs r0, 0x20 + movs r1, 0x12 + add r2, sp, 0x4 + movs r3, 0x2 + bl xxx_call_draw_string + movs r0, 0x2 + bl sub_80073E0 + add sp, 0x68 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0801D964: .4byte gUnknown_80DBF3C +_0801D968: .4byte gUnknown_80DBF4C +_0801D96C: .4byte gUnknown_203B460 + thumb_func_end sub_801D894 + + thumb_func_start sub_801D970 +sub_801D970: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + mov r8, r0 + mov r9, r1 + mov r10, r2 + ldr r0, _0801D9DC + ldr r1, _0801D9E0 + bl sub_800A9EC + adds r7, r0, 0 + ldr r0, [r7, 0x4] + ldr r6, [r0] + ldr r5, [r0, 0x4] + movs r4, 0 +_0801D994: + adds r0, r4, 0 + adds r0, 0xE0 + adds r1, r5, 0 + bl SetBGPaletteBufferColorArray + adds r5, 0x4 + adds r4, 0x1 + cmp r4, 0xF + ble _0801D994 + bl sub_8092178 + lsls r0, 24 + lsrs r0, 17 + adds r6, r0 + movs r0, 0x10 + str r0, [sp] + str r6, [sp, 0x4] + movs r0, 0xE + str r0, [sp, 0x8] + mov r0, r8 + mov r1, r9 + mov r2, r10 + movs r3, 0x10 + bl sub_8007E20 + adds r0, r7, 0 + bl sub_800AA14 + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0801D9DC: .4byte gUnknown_80DBF60 +_0801D9E0: .4byte gUnknown_8380000 + thumb_func_end sub_801D970 + + thumb_func_start sub_801D9E4 +sub_801D9E4: + push {r4,r5,lr} + ldr r4, _0801DA50 + movs r0, 0xA0 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r4] + movs r1, 0x3 + str r1, [r0, 0x34] + adds r1, r0, 0 + adds r1, 0x84 + str r1, [r0, 0x38] + adds r0, 0x3C + bl sub_8006518 + ldr r1, [r4] + ldr r2, [r1, 0x34] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r1, 0x3C + ldr r0, _0801DA54 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldr r0, [r4] + ldr r1, [r0, 0x38] + adds r0, 0x9C + str r0, [r1, 0x14] + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x3C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + ldr r3, [r0, 0x34] + movs r1, 0xE5 + movs r2, 0xA + bl sub_8013818 + bl sub_801DB54 + bl sub_801DBD4 + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0801DA50: .4byte gUnknown_203B258 +_0801DA54: .4byte gUnknown_80DBF88 + thumb_func_end sub_801D9E4 + + thumb_func_start sub_801DA58 +sub_801DA58: + push {lr} + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + ldr r0, _0801DA74 + ldr r0, [r0] + bl sub_8013878 + bl sub_801DB54 + bl sub_801DBD4 + pop {r0} + bx r0 + .align 2, 0 +_0801DA74: .4byte gUnknown_203B258 + thumb_func_end sub_801DA58 + + thumb_func_start sub_801DA78 +sub_801DA78: + push {r4,lr} + ldr r4, _0801DA94 + ldr r0, [r4] + bl GetKeyPress + cmp r0, 0x1 + beq _0801DA98 + cmp r0, 0x2 + bne _0801DA9C + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + b _0801DAB8 + .align 2, 0 +_0801DA94: .4byte gUnknown_203B258 +_0801DA98: + movs r0, 0x3 + b _0801DAB8 +_0801DA9C: + ldr r0, [r4] + movs r1, 0x1 + bl sub_80138B8 + lsls r0, 24 + cmp r0, 0 + bne _0801DAAE + movs r0, 0 + b _0801DAB8 +_0801DAAE: + bl sub_801DB54 + bl sub_801DBD4 + movs r0, 0x1 +_0801DAB8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_801DA78 + + thumb_func_start sub_801DAC0 +sub_801DAC0: + ldr r0, _0801DAD8 + ldr r1, [r0] + ldrh r2, [r1, 0x1E] + ldrh r0, [r1, 0x1C] + adds r3, r0, 0 + muls r3, r2 + adds r0, r3, 0 + ldrh r1, [r1, 0x18] + adds r0, r1 + lsls r0, 16 + asrs r0, 16 + bx lr + .align 2, 0 +_0801DAD8: .4byte gUnknown_203B258 + thumb_func_end sub_801DAC0 + + thumb_func_start sub_801DADC +sub_801DADC: + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, _0801DB08 + ldr r0, [r5] + movs r1, 0xE5 + strh r1, [r0, 0x22] + bl sub_8013984 + bl sub_801DB54 + bl sub_801DBD4 + cmp r4, 0 + beq _0801DB02 + ldr r0, [r5] + bl AddMenuCursorSprite +_0801DB02: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0801DB08: .4byte gUnknown_203B258 + thumb_func_end sub_801DADC + + thumb_func_start sub_801DB0C +sub_801DB0C: + push {r4,r5,lr} + ldr r4, _0801DB4C + ldr r2, [r4] + cmp r2, 0 + beq _0801DB46 + ldr r0, [r2, 0x34] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x3C + ldr r0, _0801DB50 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x3C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0801DB46: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0801DB4C: .4byte gUnknown_203B258 +_0801DB50: .4byte gUnknown_80DBF70 + thumb_func_end sub_801DB0C + + thumb_func_start sub_801DB54 +sub_801DB54: + push {r4,lr} + ldr r4, _0801DBD0 + ldr r0, [r4] + adds r0, 0x9C + movs r2, 0 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0x9D + strb r2, [r0] + ldr r0, [r4] + adds r0, 0x9E + movs r1, 0x8 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0x9F + strb r2, [r0] + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x3C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + movs r1, 0x1A + ldrsh r0, [r0, r1] + movs r1, 0xC + bl sub_80095E4 + adds r0, 0x2 + lsls r0, 16 + ldr r2, [r4] + ldr r3, [r2, 0x34] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x4A + asrs r3, r0, 16 + lsrs r0, 16 + strh r0, [r1] + ldr r1, [r2, 0x34] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r2, r0 + adds r3, 0x2 + adds r2, 0x4C + strh r3, [r2] + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x3C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801DBD0: .4byte gUnknown_203B258 + thumb_func_end sub_801DB54 + + thumb_func_start sub_801DBD4 +sub_801DBD4: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + ldr r5, _0801DCB4 + ldr r0, [r5] + ldr r0, [r0, 0x34] + bl sub_8008C54 + ldr r0, [r5] + ldr r0, [r0, 0x34] + bl sub_80073B8 + ldr r2, _0801DCB8 + ldr r0, [r5] + ldr r3, [r0, 0x34] + movs r0, 0 + str r0, [sp] + movs r0, 0xA + movs r1, 0 + bl xxx_call_draw_string + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0x9E + ldrb r4, [r0] + lsls r4, 3 + subs r4, 0x2 + movs r0, 0x1E + ldrsh r2, [r1, r0] + adds r2, 0x1 + movs r0, 0x7 + str r0, [sp] + ldr r0, [r1, 0x34] + str r0, [sp, 0x4] + adds r0, r4, 0 + movs r1, 0 + movs r3, 0x2 + bl sub_8012BC4 + movs r6, 0 + ldr r0, [r5] + movs r1, 0x1A + ldrsh r0, [r0, r1] + cmp r6, r0 + bge _0801DC9C + adds r7, r5, 0 + mov r8, r6 +_0801DC34: + ldr r0, [r7] + ldrh r2, [r0, 0x1E] + ldrh r1, [r0, 0x1C] + adds r3, r2, 0 + muls r3, r1 + adds r1, r3, 0 + adds r1, r6 + lsls r1, 16 + asrs r1, 16 + lsls r5, r1, 1 + adds r5, r1 + lsls r5, 2 + ldr r1, _0801DCBC + adds r5, r1 + movs r2, 0x4 + ldrsh r1, [r5, r2] + lsls r4, r1, 3 + subs r4, r1 + lsls r4, 2 + ldr r1, _0801DCC0 + adds r4, r1 + adds r1, r6, 0 + bl sub_8013800 + adds r1, r0, 0 + ldr r2, [r4] + ldr r0, [r7] + ldr r3, [r0, 0x34] + mov r0, r8 + str r0, [sp] + movs r0, 0x8 + bl xxx_call_draw_string + ldr r0, [r7] + adds r1, r6, 0 + bl sub_8013800 + adds r1, r0, 0 + ldr r2, [r5, 0x8] + ldr r0, [r7] + ldr r3, [r0, 0x34] + mov r0, r8 + str r0, [sp] + movs r0, 0x3E + bl xxx_call_draw_string + adds r6, 0x1 + ldr r0, [r7] + movs r1, 0x1A + ldrsh r0, [r0, r1] + cmp r6, r0 + blt _0801DC34 +_0801DC9C: + ldr r0, _0801DCB4 + ldr r0, [r0] + ldr r0, [r0, 0x34] + bl sub_80073E0 + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0801DCB4: .4byte gUnknown_203B258 +_0801DCB8: .4byte gUnknown_80DBFA0 +_0801DCBC: .4byte gUnknown_811BAF4 +_0801DCC0: .4byte gUnknown_81188F0 + thumb_func_end sub_801DBD4 + + thumb_func_start sub_801DCC4 +sub_801DCC4: + push {r4,lr} + ldr r4, _0801DCE4 + movs r0, 0x8E + lsls r0, 1 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r4] + movs r0, 0 + bl sub_801DD6C + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0801DCE4: .4byte gUnknown_203B25C + thumb_func_end sub_801DCC4 + + thumb_func_start sub_801DCE8 +sub_801DCE8: + push {lr} + ldr r0, _0801DD00 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0x7 + bhi _0801DD48 + lsls r0, 2 + ldr r1, _0801DD04 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801DD00: .4byte gUnknown_203B25C +_0801DD04: .4byte _0801DD08 + .align 2, 0 +_0801DD08: + .4byte _0801DD2C + .4byte _0801DD2C + .4byte _0801DD28 + .4byte _0801DD32 + .4byte _0801DD32 + .4byte _0801DD38 + .4byte _0801DD3E + .4byte _0801DD44 +_0801DD28: + movs r0, 0x3 + b _0801DD4A +_0801DD2C: + bl sub_801E028 + b _0801DD48 +_0801DD32: + bl sub_801E088 + b _0801DD48 +_0801DD38: + bl sub_801E0E0 + b _0801DD48 +_0801DD3E: + bl sub_801E0FC + b _0801DD48 +_0801DD44: + bl sub_801E138 +_0801DD48: + movs r0, 0 +_0801DD4A: + pop {r1} + bx r1 + thumb_func_end sub_801DCE8 + + thumb_func_start sub_801DD50 +sub_801DD50: + push {r4,lr} + ldr r4, _0801DD68 + ldr r0, [r4] + cmp r0, 0 + beq _0801DD62 + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0801DD62: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801DD68: .4byte gUnknown_203B25C + thumb_func_end sub_801DD50 + + thumb_func_start sub_801DD6C +sub_801DD6C: + push {lr} + ldr r1, _0801DD80 + ldr r1, [r1] + str r0, [r1] + bl sub_801DD84 + bl sub_801DED0 + pop {r0} + bx r0 + .align 2, 0 +_0801DD80: .4byte gUnknown_203B25C + thumb_func_end sub_801DD6C + + thumb_func_start sub_801DD84 +sub_801DD84: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r4, _0801DDAC + ldr r0, [r4] + adds r0, 0xBC + bl sub_8006518 + ldr r0, [r4] + ldr r0, [r0] + cmp r0, 0 + beq _0801DDB4 + cmp r0, 0x1 + beq _0801DE38 + movs r3, 0 + adds r7, r4, 0 + ldr r2, _0801DDB0 + b _0801DE90 + .align 2, 0 +_0801DDAC: .4byte gUnknown_203B25C +_0801DDB0: .4byte gUnknown_80DBFB0 +_0801DDB4: + bl sub_801DFA4 + movs r3, 0 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0xAC + ldrh r0, [r0] + cmp r0, 0 + bne _0801DDCE + ldr r0, [r1, 0x70] + str r0, [r1, 0x18] + adds r7, r4, 0 + b _0801DDF2 +_0801DDCE: + adds r3, 0x1 + ldr r7, _0801DE2C + cmp r3, 0x7 + bgt _0801DDF2 + ldr r2, [r7] + lsls r0, r3, 1 + adds r1, r2, 0 + adds r1, 0xAC + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _0801DDCE + lsls r0, r3, 3 + adds r1, r2, 0 + adds r1, 0x70 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x18] +_0801DDF2: + ldr r0, _0801DE30 + mov r9, r0 + ldr r2, _0801DE2C + mov r12, r2 + ldr r3, _0801DE34 + mov r8, r3 + movs r2, 0 + movs r3, 0x3 +_0801DE02: + mov r4, r12 + ldr r1, [r4] + adds r1, r2 + adds r1, 0xBC + mov r0, r8 + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + adds r2, 0x18 + subs r3, 0x1 + cmp r3, 0 + bge _0801DE02 + ldr r1, [r7] + adds r1, 0xBC + mov r0, r9 + ldm r0!, {r2,r5,r6} + stm r1!, {r2,r5,r6} + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + b _0801DE70 + .align 2, 0 +_0801DE2C: .4byte gUnknown_203B25C +_0801DE30: .4byte gUnknown_80DBFCC +_0801DE34: .4byte gUnknown_80DBFB0 +_0801DE38: + bl sub_801DFA4 + mov r8, r4 + ldr r6, _0801DE88 + mov r12, r6 + mov r7, r8 + movs r2, 0 + movs r3, 0x3 +_0801DE48: + mov r0, r8 + ldr r1, [r0] + adds r1, r2 + adds r1, 0xBC + mov r0, r12 + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + adds r2, 0x18 + subs r3, 0x1 + cmp r3, 0 + bge _0801DE48 + ldr r1, [r7] + adds r1, 0xBC + ldr r0, _0801DE8C + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2,r5,r6} + stm r1!, {r2,r5,r6} +_0801DE70: + ldr r1, [r7] + adds r0, r1, 0 + adds r0, 0xBC + adds r1, 0x6C + bl sub_8012CAC + ldr r0, [r7] + adds r0, 0xC8 + movs r1, 0xA + strh r1, [r0] + b _0801DEAC + .align 2, 0 +_0801DE88: .4byte gUnknown_80DBFB0 +_0801DE8C: .4byte gUnknown_80DBFCC +_0801DE90: + ldr r0, [r7] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 3 + adds r0, r1 + adds r0, 0xBC + adds r1, r2, 0 + ldm r1!, {r4-r6} + stm r0!, {r4-r6} + ldm r1!, {r4-r6} + stm r0!, {r4-r6} + adds r3, 0x1 + cmp r3, 0x3 + ble _0801DE90 +_0801DEAC: + bl sub_8004914 + ldr r0, _0801DECC + ldr r0, [r0] + adds r0, 0xBC + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0801DECC: .4byte gUnknown_203B25C + thumb_func_end sub_801DD84 + + thumb_func_start sub_801DED0 +sub_801DED0: + push {r4,r5,lr} + sub sp, 0x14 + ldr r1, _0801DEEC + ldr r0, [r1] + ldr r0, [r0] + adds r3, r1, 0 + cmp r0, 0x7 + bhi _0801DF94 + lsls r0, 2 + ldr r1, _0801DEF0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801DEEC: .4byte gUnknown_203B25C +_0801DEF0: .4byte _0801DEF4 + .align 2, 0 +_0801DEF4: + .4byte _0801DF14 + .4byte _0801DF14 + .4byte _0801DF94 + .4byte _0801DF38 + .4byte _0801DF40 + .4byte _0801DF48 + .4byte _0801DF52 + .4byte _0801DF70 +_0801DF14: + ldr r2, [r3] + ldr r0, _0801DF34 + str r0, [r2, 0x1C] + adds r0, r2, 0 + adds r0, 0x1C + adds r1, r2, 0 + adds r1, 0x6C + adds r3, r2, 0 + adds r3, 0xAC + ldr r2, [r2, 0x18] + str r2, [sp] + movs r2, 0 + str r2, [sp, 0x4] + bl sub_8012D60 + b _0801DF94 + .align 2, 0 +_0801DF34: .4byte gUnknown_80DBFE4 +_0801DF38: + movs r0, 0 + bl sub_801E3F0 + b _0801DF94 +_0801DF40: + movs r0, 0x1 + bl sub_801E510 + b _0801DF94 +_0801DF48: + ldr r0, [r3] + ldr r0, [r0, 0x4] + bl sub_801E658 + b _0801DF94 +_0801DF52: + ldr r1, [r3] + ldr r0, _0801DF6C + adds r1, 0x8 + ldr r0, [r0] + ldm r0!, {r2,r4,r5} + stm r1!, {r2,r4,r5} + ldr r0, [r0] + str r0, [r1] + ldr r0, [r3] + adds r0, 0x8 + bl sub_801E198 + b _0801DF94 + .align 2, 0 +_0801DF6C: .4byte gUnknown_203B46C +_0801DF70: + bl sub_801DFE4 + ldr r0, _0801DF9C + ldr r1, _0801DFA0 + ldr r3, [r1] + adds r3, 0x6C + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + str r2, [sp, 0xC] + movs r1, 0x20 + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0x4 + bl sub_8014248 +_0801DF94: + add sp, 0x14 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0801DF9C: .4byte gUnknown_80DBFEC +_0801DFA0: .4byte gUnknown_203B25C + thumb_func_end sub_801DED0 + + thumb_func_start sub_801DFA4 +sub_801DFA4: + push {r4,lr} + ldr r4, _0801DFD8 + ldr r0, [r4] + adds r0, 0xAC + movs r1, 0 + movs r2, 0x10 + bl MemoryFill16 + ldr r0, [r4] + movs r3, 0 + ldr r1, _0801DFDC + str r1, [r0, 0x6C] + movs r1, 0x3 + str r1, [r0, 0x70] + movs r2, 0x1 + ldr r1, _0801DFE0 + str r1, [r0, 0x74] + movs r1, 0x2 + str r1, [r0, 0x78] + str r3, [r0, 0x7C] + adds r0, 0x80 + str r2, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801DFD8: .4byte gUnknown_203B25C +_0801DFDC: .4byte gUnknown_80DC000 +_0801DFE0: .4byte gUnknown_80DC010 + thumb_func_end sub_801DFA4 + + thumb_func_start sub_801DFE4 +sub_801DFE4: + push {r4,lr} + ldr r4, _0801E01C + ldr r0, [r4] + adds r0, 0xAC + movs r1, 0 + movs r2, 0x10 + bl MemoryFill16 + ldr r1, [r4] + movs r3, 0 + ldr r0, _0801E020 + ldr r0, [r0] + str r0, [r1, 0x6C] + movs r0, 0x4 + str r0, [r1, 0x70] + movs r2, 0x1 + ldr r0, _0801E024 + ldr r0, [r0] + str r0, [r1, 0x74] + movs r0, 0x5 + str r0, [r1, 0x78] + str r3, [r1, 0x7C] + adds r1, 0x80 + str r2, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801E01C: .4byte gUnknown_203B25C +_0801E020: .4byte gUnknown_80D4920 +_0801E024: .4byte gUnknown_80D4928 + thumb_func_end sub_801DFE4 + + thumb_func_start sub_801E028 +sub_801E028: + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + ldr r4, _0801E060 + ldr r0, [r4] + adds r0, 0x1C + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _0801E050 + ldr r0, [r4] + adds r0, 0x1C + mov r1, sp + bl sub_8013114 + ldr r1, [r4] + ldr r0, [sp] + str r0, [r1, 0x18] +_0801E050: + ldr r0, [sp] + cmp r0, 0x2 + beq _0801E06A + cmp r0, 0x2 + bgt _0801E064 + cmp r0, 0x1 + beq _0801E07A + b _0801E080 + .align 2, 0 +_0801E060: .4byte gUnknown_203B25C +_0801E064: + cmp r0, 0x3 + beq _0801E072 + b _0801E080 +_0801E06A: + movs r0, 0x3 + bl sub_801DD6C + b _0801E080 +_0801E072: + movs r0, 0x6 + bl sub_801DD6C + b _0801E080 +_0801E07A: + movs r0, 0x2 + bl sub_801DD6C +_0801E080: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_801E028 + + thumb_func_start sub_801E088 +sub_801E088: + push {lr} + movs r0, 0x1 + bl sub_801E474 + cmp r0, 0x4 + bhi _0801E0DA + lsls r0, 2 + ldr r1, _0801E0A0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801E0A0: .4byte _0801E0A4 + .align 2, 0 +_0801E0A4: + .4byte _0801E0DA + .4byte _0801E0DA + .4byte _0801E0D0 + .4byte _0801E0B8 + .4byte _0801E0B8 +_0801E0B8: + bl sub_801E4F4 + ldr r1, _0801E0CC + ldr r1, [r1] + str r0, [r1, 0x4] + movs r0, 0x5 + bl sub_801DD6C + b _0801E0DA + .align 2, 0 +_0801E0CC: .4byte gUnknown_203B25C +_0801E0D0: + bl sub_801E54C + movs r0, 0x1 + bl sub_801DD6C +_0801E0DA: + pop {r0} + bx r0 + thumb_func_end sub_801E088 + + thumb_func_start sub_801E0E0 +sub_801E0E0: + push {lr} + bl sub_801E6CC + cmp r0, 0x1 + bls _0801E0F8 + cmp r0, 0x3 + bhi _0801E0F8 + bl sub_801E724 + movs r0, 0x4 + bl sub_801DD6C +_0801E0F8: + pop {r0} + bx r0 + thumb_func_end sub_801E0E0 + + thumb_func_start sub_801E0FC +sub_801E0FC: + push {lr} + bl sub_801E218 + cmp r0, 0x1 + bls _0801E132 + cmp r0, 0x3 + bhi _0801E132 + bl sub_801E2C4 + ldr r0, _0801E128 + ldr r0, [r0] + adds r0, 0x8 + bl sub_80949DC + lsls r0, 24 + cmp r0, 0 + beq _0801E12C + movs r0, 0x1 + bl sub_801DD6C + b _0801E132 + .align 2, 0 +_0801E128: .4byte gUnknown_203B25C +_0801E12C: + movs r0, 0x7 + bl sub_801DD6C +_0801E132: + pop {r0} + bx r0 + thumb_func_end sub_801E0FC + + thumb_func_start sub_801E138 +sub_801E138: + push {r4,lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0801E18E + ldr r0, [sp] + cmp r0, 0x4 + beq _0801E15C + cmp r0, 0x4 + bgt _0801E156 + cmp r0, 0x1 + beq _0801E188 + b _0801E18E +_0801E156: + cmp r0, 0x5 + beq _0801E188 + b _0801E18E +_0801E15C: + ldr r1, _0801E180 + ldr r0, _0801E184 + ldr r0, [r0] + ldr r1, [r1] + adds r0, 0x8 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r0, [r0] + str r0, [r1] + bl sub_8094C14 + movs r0, 0 + bl sub_8099690 + movs r0, 0x1 + bl sub_801DD6C + b _0801E18E + .align 2, 0 +_0801E180: .4byte gUnknown_203B46C +_0801E184: .4byte gUnknown_203B25C +_0801E188: + movs r0, 0x1 + bl sub_801DD6C +_0801E18E: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_801E138 + + thumb_func_start sub_801E198 +sub_801E198: + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, _0801E210 + movs r0, 0xAC + movs r1, 0x8 + bl MemoryAlloc + str r0, [r4] + stm r0!, {r5} + bl sub_801317C + ldr r1, [r4] + movs r0, 0 + str r0, [r1, 0x44] + adds r0, r1, 0 + adds r0, 0x4C + str r0, [r1, 0x48] + bl sub_8006518 + ldr r1, [r4] + ldr r2, [r1, 0x44] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r1, 0x4C + ldr r0, _0801E214 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldr r0, [r4] + ldr r0, [r0, 0x48] + movs r1, 0x1 + bl sub_8012D08 + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x4C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x10 + ldr r3, [r1, 0x44] + movs r1, 0x1 + movs r2, 0x1 + bl sub_8013818 + bl nullsub_38 + bl sub_801E310 + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0801E210: .4byte gUnknown_203B260 +_0801E214: .4byte gUnknown_80DC03C + thumb_func_end sub_801E198 + + thumb_func_start sub_801E218 +sub_801E218: + push {r4,lr} + movs r4, 0 + bl sub_8012AE8 + cmp r0, 0x2 + beq _0801E238 + cmp r0, 0x2 + bgt _0801E22E + cmp r0, 0x1 + beq _0801E242 + b _0801E294 +_0801E22E: + cmp r0, 0x9 + beq _0801E24C + cmp r0, 0xA + beq _0801E26C + b _0801E294 +_0801E238: + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + b _0801E2BE +_0801E242: + movs r0, 0 + bl sub_80119D4 + movs r0, 0x3 + b _0801E2BE +_0801E24C: + ldr r0, _0801E264 + ldr r1, [r0] + movs r2, 0x28 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _0801E294 + ldr r1, [r1] + ldrb r0, [r1, 0x8] + cmp r0, 0 + bne _0801E268 + movs r0, 0x2 + b _0801E28A + .align 2, 0 +_0801E264: .4byte gUnknown_203B260 +_0801E268: + subs r0, 0x1 + b _0801E28A +_0801E26C: + ldr r0, _0801E284 + ldr r1, [r0] + movs r2, 0x28 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _0801E294 + ldr r1, [r1] + ldrb r0, [r1, 0x8] + cmp r0, 0x1 + bls _0801E288 + strb r4, [r1, 0x8] + b _0801E28C + .align 2, 0 +_0801E284: .4byte gUnknown_203B260 +_0801E288: + adds r0, 0x1 +_0801E28A: + strb r0, [r1, 0x8] +_0801E28C: + movs r0, 0x3 + bl sub_80119D4 + movs r4, 0x1 +_0801E294: + ldr r0, _0801E2B8 + ldr r0, [r0] + adds r0, 0x10 + movs r1, 0x1 + bl sub_80138B8 + lsls r0, 24 + cmp r0, 0 + bne _0801E2AA + cmp r4, 0x1 + bne _0801E2BC +_0801E2AA: + bl nullsub_38 + bl sub_801E310 + movs r0, 0x1 + b _0801E2BE + .align 2, 0 +_0801E2B8: .4byte gUnknown_203B260 +_0801E2BC: + movs r0, 0 +_0801E2BE: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_801E218 + + thumb_func_start sub_801E2C4 +sub_801E2C4: + push {r4,r5,lr} + ldr r4, _0801E304 + ldr r2, [r4] + cmp r2, 0 + beq _0801E2FE + ldr r0, [r2, 0x44] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x4C + ldr r0, _0801E308 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x4C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0801E2FE: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0801E304: .4byte gUnknown_203B260 +_0801E308: .4byte gUnknown_80DC020 + thumb_func_end sub_801E2C4 + + thumb_func_start nullsub_38 +nullsub_38: + bx lr + thumb_func_end nullsub_38 + + thumb_func_start sub_801E310 +sub_801E310: + push {r4-r6,lr} + sub sp, 0x4 + ldr r5, _0801E368 + ldr r0, [r5] + ldr r0, [r0, 0x44] + bl sub_8008C54 + ldr r0, [r5] + ldr r0, [r0, 0x44] + bl sub_80073B8 + ldr r2, _0801E36C + ldr r0, [r5] + ldr r3, [r0, 0x44] + movs r4, 0 + str r4, [sp] + movs r0, 0x10 + movs r1, 0 + bl xxx_call_draw_string + ldr r0, [r5] + adds r0, 0x10 + movs r1, 0 + bl sub_8013800 + adds r6, r0, 0 + ldr r2, _0801E370 + ldr r0, [r5] + ldr r3, [r0, 0x44] + str r4, [sp] + movs r0, 0x8 + adds r1, r6, 0 + bl xxx_call_draw_string + ldr r0, [r5] + ldr r0, [r0] + ldrb r0, [r0, 0x8] + cmp r0, 0x1 + beq _0801E384 + cmp r0, 0x1 + bgt _0801E374 + cmp r0, 0 + beq _0801E37A + b _0801E3D6 + .align 2, 0 +_0801E368: .4byte gUnknown_203B260 +_0801E36C: .4byte gUnknown_80DC054 +_0801E370: .4byte gUnknown_80DC064 +_0801E374: + cmp r0, 0x2 + beq _0801E3B0 + b _0801E3D6 +_0801E37A: + ldr r0, _0801E380 + b _0801E386 + .align 2, 0 +_0801E380: .4byte gUnknown_80DC084 +_0801E384: + ldr r0, _0801E3AC +_0801E386: + bl sub_8008ED0 + adds r4, r0, 0 + ldr r1, [r5] + ldr r0, [r1, 0x44] + ldr r1, [r1] + ldrb r2, [r1, 0x8] + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, 0x50 + adds r2, r6, 0 + adds r2, 0xA + movs r3, 0x7 + str r3, [sp] + adds r3, r4, 0 + bl sub_80078A4 + b _0801E3D6 + .align 2, 0 +_0801E3AC: .4byte gUnknown_80DC08C +_0801E3B0: + ldr r0, _0801E3E8 + bl sub_8008ED0 + adds r4, r0, 0 + ldr r1, [r5] + ldr r0, [r1, 0x44] + ldr r1, [r1] + ldrb r2, [r1, 0x8] + lsls r1, r2, 2 + adds r1, r2 + lsls r1, 3 + adds r1, 0x50 + adds r2, r6, 0 + adds r2, 0xA + movs r3, 0x7 + str r3, [sp] + adds r3, r4, 0 + bl sub_80078A4 +_0801E3D6: + ldr r0, _0801E3EC + ldr r0, [r0] + ldr r0, [r0, 0x44] + bl sub_80073E0 + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0801E3E8: .4byte gUnknown_80DC090 +_0801E3EC: .4byte gUnknown_203B260 + thumb_func_end sub_801E310 + + thumb_func_start sub_801E3F0 +sub_801E3F0: + push {r4-r6,lr} + adds r5, r0, 0 + ldr r4, _0801E46C + ldr r0, [r4] + cmp r0, 0 + bne _0801E406 + movs r0, 0x9C + movs r1, 0x8 + bl MemoryAlloc + str r0, [r4] +_0801E406: + ldr r0, [r4] + str r5, [r0, 0x34] + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 3 + adds r1, 0x3C + adds r1, r0, r1 + str r1, [r0, 0x38] + adds r0, 0x3C + bl sub_8006518 + ldr r1, [r4] + ldr r2, [r1, 0x34] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r1, 0x3C + ldr r0, _0801E470 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldr r0, [r4] + ldr r0, [r0, 0x38] + movs r1, 0xA + bl sub_8012D08 + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x3C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + movs r1, 0x5 + movs r2, 0xA + adds r3, r5, 0 + bl sub_8013818 + bl sub_801E594 + bl sub_801E5E8 + movs r0, 0x1 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0801E46C: .4byte gUnknown_203B264 +_0801E470: .4byte gUnknown_80DC0BC + thumb_func_end sub_801E3F0 + + thumb_func_start sub_801E474 +sub_801E474: + push {lr} + lsls r0, 24 + cmp r0, 0 + bne _0801E48C + ldr r0, _0801E488 + ldr r0, [r0] + bl sub_8013660 + movs r0, 0 + b _0801E4EE + .align 2, 0 +_0801E488: .4byte gUnknown_203B264 +_0801E48C: + ldr r0, _0801E4A4 + ldr r0, [r0] + bl GetKeyPress + cmp r0, 0x2 + beq _0801E4AE + cmp r0, 0x2 + bgt _0801E4A8 + cmp r0, 0x1 + beq _0801E4B8 + b _0801E4CC + .align 2, 0 +_0801E4A4: .4byte gUnknown_203B264 +_0801E4A8: + cmp r0, 0x4 + beq _0801E4C2 + b _0801E4CC +_0801E4AE: + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + b _0801E4EE +_0801E4B8: + movs r0, 0 + bl sub_80119D4 + movs r0, 0x3 + b _0801E4EE +_0801E4C2: + movs r0, 0x4 + bl sub_80119D4 + movs r0, 0x4 + b _0801E4EE +_0801E4CC: + ldr r0, _0801E4E0 + ldr r0, [r0] + movs r1, 0x1 + bl sub_80138B8 + lsls r0, 24 + cmp r0, 0 + bne _0801E4E4 + movs r0, 0 + b _0801E4EE + .align 2, 0 +_0801E4E0: .4byte gUnknown_203B264 +_0801E4E4: + bl sub_801E594 + bl sub_801E5E8 + movs r0, 0x1 +_0801E4EE: + pop {r1} + bx r1 + thumb_func_end sub_801E474 + + thumb_func_start sub_801E4F4 +sub_801E4F4: + ldr r0, _0801E50C + ldr r1, [r0] + movs r0, 0x1E + ldrsh r2, [r1, r0] + movs r3, 0x1C + ldrsh r0, [r1, r3] + muls r0, r2 + movs r2, 0x18 + ldrsh r1, [r1, r2] + adds r0, r1 + bx lr + .align 2, 0 +_0801E50C: .4byte gUnknown_203B264 + thumb_func_end sub_801E4F4 + + thumb_func_start sub_801E510 +sub_801E510: + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8004914 + ldr r5, _0801E548 + ldr r0, [r5] + adds r0, 0x3C + movs r1, 0 + movs r2, 0 + bl sub_800641C + ldr r0, [r5] + bl sub_8013984 + bl sub_801E594 + bl sub_801E5E8 + cmp r4, 0 + beq _0801E542 + ldr r0, [r5] + bl AddMenuCursorSprite +_0801E542: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0801E548: .4byte gUnknown_203B264 + thumb_func_end sub_801E510 + + thumb_func_start sub_801E54C +sub_801E54C: + push {r4,r5,lr} + ldr r4, _0801E58C + ldr r2, [r4] + cmp r2, 0 + beq _0801E586 + ldr r0, [r2, 0x34] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x3C + ldr r0, _0801E590 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x3C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0801E586: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0801E58C: .4byte gUnknown_203B264 +_0801E590: .4byte gUnknown_80DC0A0 + thumb_func_end sub_801E54C + + thumb_func_start sub_801E594 +sub_801E594: + push {r4,lr} + ldr r4, _0801E5E4 + ldr r0, [r4] + movs r1, 0x1A + ldrsh r0, [r0, r1] + movs r1, 0xC + bl sub_80095E4 + adds r0, 0x2 + lsls r0, 16 + ldr r2, [r4] + ldr r3, [r2, 0x34] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x4A + asrs r3, r0, 16 + lsrs r0, 16 + strh r0, [r1] + ldr r1, [r2, 0x34] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r2, r0 + adds r3, 0x2 + adds r2, 0x4C + strh r3, [r2] + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x3C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801E5E4: .4byte gUnknown_203B264 + thumb_func_end sub_801E594 + + thumb_func_start sub_801E5E8 +sub_801E5E8: + push {r4-r6,lr} + sub sp, 0x4 + ldr r4, _0801E64C + ldr r0, [r4] + ldr r0, [r0, 0x34] + bl sub_8008C54 + ldr r0, [r4] + ldr r0, [r0, 0x34] + bl sub_80073B8 + ldr r2, _0801E650 + ldr r0, [r4] + ldr r3, [r0, 0x34] + movs r0, 0 + str r0, [sp] + movs r0, 0x10 + movs r1, 0 + bl xxx_call_draw_string + movs r5, 0 + adds r6, r4, 0 + ldr r4, _0801E654 +_0801E616: + ldr r0, [r6] + adds r1, r5, 0 + bl sub_8013800 + adds r1, r0, 0 + ldr r2, [r4] + ldr r0, [r6] + ldr r3, [r0, 0x34] + movs r0, 0 + str r0, [sp] + movs r0, 0xA + bl xxx_call_draw_string + adds r4, 0x8 + adds r5, 0x1 + cmp r5, 0x4 + ble _0801E616 + ldr r0, _0801E64C + ldr r0, [r0] + ldr r0, [r0, 0x34] + bl sub_80073E0 + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0801E64C: .4byte gUnknown_203B264 +_0801E650: .4byte gUnknown_80DC0D4 +_0801E654: .4byte gUnknown_80DAA98 + thumb_func_end sub_801E5E8 + + thumb_func_start sub_801E658 +sub_801E658: + push {r4-r6,lr} + adds r5, r0, 0 + ldr r4, _0801E6C4 + movs r0, 0xA0 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r4] + movs r1, 0 + str r1, [r0, 0x34] + adds r1, r0, 0 + adds r1, 0x3C + str r1, [r0, 0x38] + adds r0, r1, 0 + bl sub_8006518 + ldr r1, [r4] + ldr r2, [r1, 0x34] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r1, 0x3C + ldr r0, _0801E6C8 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldr r0, [r4] + ldr r1, [r0, 0x38] + adds r0, 0x9C + str r0, [r1, 0x14] + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x3C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + ldr r3, [r0, 0x34] + movs r1, 0x5 + movs r2, 0x1 + bl sub_8013818 + ldr r0, [r4] + strh r5, [r0, 0x1E] + bl sub_801E714 + movs r0, 0x1 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0801E6C4: .4byte gUnknown_203B268 +_0801E6C8: .4byte gUnknown_80DC0FC + thumb_func_end sub_801E658 + + thumb_func_start sub_801E6CC +sub_801E6CC: + push {r4,lr} + ldr r4, _0801E6E8 + ldr r0, [r4] + bl GetKeyPress + cmp r0, 0x1 + beq _0801E6EC + cmp r0, 0x2 + bne _0801E6F6 + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + b _0801E70C + .align 2, 0 +_0801E6E8: .4byte gUnknown_203B268 +_0801E6EC: + movs r0, 0 + bl sub_80119D4 + movs r0, 0x3 + b _0801E70C +_0801E6F6: + ldr r0, [r4] + bl sub_8013938 + lsls r0, 24 + cmp r0, 0 + bne _0801E706 + movs r0, 0 + b _0801E70C +_0801E706: + bl sub_801E714 + movs r0, 0x1 +_0801E70C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_801E6CC + + thumb_func_start sub_801E714 +sub_801E714: + push {lr} + bl sub_801E76C + bl sub_801E7AC + pop {r0} + bx r0 + thumb_func_end sub_801E714 + + thumb_func_start sub_801E724 +sub_801E724: + push {r4,r5,lr} + ldr r4, _0801E764 + ldr r2, [r4] + cmp r2, 0 + beq _0801E75E + ldr r0, [r2, 0x34] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x3C + ldr r0, _0801E768 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x3C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0801E75E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0801E764: .4byte gUnknown_203B268 +_0801E768: .4byte gUnknown_80DC0E4 + thumb_func_end sub_801E724 + + thumb_func_start sub_801E76C +sub_801E76C: + push {r4,lr} + ldr r4, _0801E7A8 + ldr r0, [r4] + ldrh r1, [r0, 0x20] + adds r0, 0x9C + movs r2, 0 + strb r1, [r0] + ldr r0, [r4] + ldrh r1, [r0, 0x1E] + adds r0, 0x9D + strb r1, [r0] + ldr r0, [r4] + adds r0, 0x9E + movs r1, 0xF + strb r1, [r0] + ldr r0, [r4] + adds r0, 0x9F + strb r2, [r0] + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x3C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801E7A8: .4byte gUnknown_203B268 + thumb_func_end sub_801E76C + + thumb_func_start sub_801E7AC +sub_801E7AC: + push {r4-r6,lr} + sub sp, 0x4 + ldr r5, _0801E804 + ldr r0, [r5] + ldr r0, [r0, 0x34] + bl sub_80073B8 + ldr r3, [r5] + movs r0, 0x1E + ldrsh r1, [r3, r0] + lsls r1, 3 + adds r0, r1, 0 + adds r0, 0x10 + ldr r4, _0801E808 + adds r1, r4 + ldr r2, [r1] + ldr r3, [r3, 0x34] + movs r6, 0 + str r6, [sp] + movs r1, 0 + bl xxx_call_draw_string + ldr r1, [r5] + movs r2, 0x1E + ldrsh r0, [r1, r2] + lsls r0, 3 + adds r4, 0x4 + adds r0, r4 + ldr r2, [r0] + ldr r3, [r1, 0x34] + str r6, [sp] + movs r0, 0xA + movs r1, 0x14 + bl xxx_call_draw_string + ldr r0, [r5] + ldr r0, [r0, 0x34] + bl sub_80073E0 + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0801E804: .4byte gUnknown_203B268 +_0801E808: .4byte gUnknown_80DAA98 + thumb_func_end sub_801E7AC + + thumb_func_start sub_801E80C +sub_801E80C: + push {r4-r6,lr} + mov r6, r8 + push {r6} + mov r8, r0 + adds r4, r1, 0 + adds r6, r2, 0 + lsls r4, 16 + asrs r4, 16 + ldr r5, _0801E84C + movs r0, 0xC6 + lsls r0, 1 + movs r1, 0x8 + bl MemoryAlloc + adds r2, r0, 0 + str r2, [r5] + mov r0, r8 + str r0, [r2] + strh r4, [r2, 0xC] + str r6, [r2, 0x10] + ldrh r0, [r6, 0x22] + strh r0, [r2, 0x1C] + mov r1, r8 + cmp r1, 0 + bne _0801E850 + movs r3, 0x94 + lsls r3, 1 + adds r1, r2, r3 + movs r4, 0x8C + lsls r4, 1 + adds r0, r2, r4 + b _0801E858 + .align 2, 0 +_0801E84C: .4byte gUnknown_203B26C +_0801E850: + movs r0, 0x94 + lsls r0, 1 + adds r1, r2, r0 + movs r0, 0 +_0801E858: + str r0, [r1] + ldr r0, _0801E8B4 + bl sub_808DDD0 + ldr r2, _0801E8B8 + ldr r3, [r2] + movs r4, 0x8C + lsls r4, 1 + adds r1, r3, r4 + str r0, [r1] + adds r4, 0x4 + adds r1, r3, r4 + ldr r0, [r0, 0x4] + str r0, [r1] + movs r1, 0x92 + lsls r1, 1 + adds r0, r3, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + ldr r3, _0801E8BC + adds r0, r3 + strb r1, [r0] + ldr r0, [r2] + adds r4, 0xA + adds r0, r4 + strb r1, [r0] + ldr r2, [r2] + movs r0, 0x90 + lsls r0, 1 + adds r1, r2, r0 + movs r0, 0x2 + strh r0, [r1] + subs r3, 0x3 + adds r1, r2, r3 + movs r0, 0x8 + strh r0, [r1] + movs r0, 0 + bl sub_801E968 + movs r0, 0x1 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0801E8B4: .4byte 0x00000155 +_0801E8B8: .4byte gUnknown_203B26C +_0801E8BC: .4byte 0x00000125 + thumb_func_end sub_801E80C + + thumb_func_start sub_801E8C0 +sub_801E8C0: + push {lr} + ldr r0, _0801E8D8 + ldr r0, [r0] + ldr r0, [r0, 0x4] + cmp r0, 0x6 + bhi _0801E928 + lsls r0, 2 + ldr r1, _0801E8DC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801E8D8: .4byte gUnknown_203B26C +_0801E8DC: .4byte _0801E8E0 + .align 2, 0 +_0801E8E0: + .4byte _0801E8FC + .4byte _0801E8FC + .4byte _0801E902 + .4byte _0801E908 + .4byte _0801E90E + .4byte _0801E91C + .4byte _0801E924 +_0801E8FC: + bl sub_801ECBC + b _0801E928 +_0801E902: + bl sub_801ED28 + b _0801E928 +_0801E908: + bl sub_801EDA4 + b _0801E928 +_0801E90E: + bl sub_801EDC0 + ldr r0, _0801E920 + ldr r0, [r0] + ldr r0, [r0, 0x4] + cmp r0, 0x5 + bne _0801E928 +_0801E91C: + movs r0, 0x3 + b _0801E92A + .align 2, 0 +_0801E920: .4byte gUnknown_203B26C +_0801E924: + movs r0, 0x2 + b _0801E92A +_0801E928: + movs r0, 0 +_0801E92A: + pop {r1} + bx r1 + thumb_func_end sub_801E8C0 + + thumb_func_start sub_801E930 +sub_801E930: + ldr r0, _0801E938 + ldr r0, [r0] + ldrb r0, [r0, 0xE] + bx lr + .align 2, 0 +_0801E938: .4byte gUnknown_203B26C + thumb_func_end sub_801E930 + + thumb_func_start sub_801E93C +sub_801E93C: + push {r4,lr} + ldr r4, _0801E964 + ldr r0, [r4] + cmp r0, 0 + beq _0801E95C + movs r1, 0x8C + lsls r1, 1 + adds r0, r1 + ldr r0, [r0] + bl sub_800AA14 + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0801E95C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801E964: .4byte gUnknown_203B26C + thumb_func_end sub_801E93C + + thumb_func_start sub_801E968 +sub_801E968: + push {lr} + ldr r1, _0801E97C + ldr r1, [r1] + str r0, [r1, 0x4] + bl sub_801E980 + bl sub_801EA28 + pop {r0} + bx r0 + .align 2, 0 +_0801E97C: .4byte gUnknown_203B26C + thumb_func_end sub_801E968 + + thumb_func_start sub_801E980 +sub_801E980: + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, _0801E9D0 + ldr r0, [r4] + movs r5, 0x96 + lsls r5, 1 + adds r0, r5 + bl sub_8006518 + ldr r0, [r4] + ldr r0, [r0, 0x4] + cmp r0, 0x2 + bne _0801E9DC + bl sub_801EBC4 + ldr r1, [r4] + movs r0, 0xA2 + lsls r0, 1 + adds r1, r0 + ldr r0, _0801E9D4 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r6,r7} + stm r1!, {r2,r6,r7} + ldr r2, [r4] + movs r0, 0xAE + lsls r0, 1 + adds r2, r0 + ldr r1, _0801E9D8 + ldm r1!, {r3,r5,r6} + stm r2!, {r3,r5,r6} + ldm r1!, {r3,r5,r7} + stm r2!, {r3,r5,r7} + ldr r1, [r4] + adds r0, r1, r0 + adds r1, 0x28 + bl sub_8012CAC + b _0801EA00 + .align 2, 0 +_0801E9D0: .4byte gUnknown_203B26C +_0801E9D4: .4byte gUnknown_80DC11C +_0801E9D8: .4byte gUnknown_80DC134 +_0801E9DC: + mov r12, r4 + mov r8, r5 + ldr r4, _0801EA20 + movs r2, 0 + movs r3, 0x3 +_0801E9E6: + mov r6, r12 + ldr r1, [r6] + adds r1, r2 + add r1, r8 + adds r0, r4, 0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r2, 0x18 + subs r3, 0x1 + cmp r3, 0 + bge _0801E9E6 +_0801EA00: + bl sub_8004914 + ldr r0, _0801EA24 + ldr r0, [r0] + movs r7, 0x96 + lsls r7, 1 + adds r0, r7 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0801EA20: .4byte gUnknown_80DC11C +_0801EA24: .4byte gUnknown_203B26C + thumb_func_end sub_801E980 + + thumb_func_start sub_801EA28 +sub_801EA28: + push {r4,r5,lr} + sub sp, 0x14 + ldr r1, _0801EA44 + ldr r0, [r1] + ldr r0, [r0, 0x4] + adds r4, r1, 0 + cmp r0, 0x4 + bls _0801EA3A + b _0801EBB8 +_0801EA3A: + lsls r0, 2 + ldr r1, _0801EA48 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801EA44: .4byte gUnknown_203B26C +_0801EA48: .4byte _0801EA4C + .align 2, 0 +_0801EA4C: + .4byte _0801EA60 + .4byte _0801EA80 + .4byte _0801EA8A + .4byte _0801EAB4 + .4byte _0801EACA +_0801EA60: + ldr r0, [r4] + movs r2, 0xC + ldrsh r1, [r0, r2] + ldr r2, [r0, 0x10] + ldr r0, _0801EA7C + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + movs r0, 0x2 + movs r3, 0 + bl sub_801EE10 + b _0801EBB8 + .align 2, 0 +_0801EA7C: .4byte gUnknown_80DC164 +_0801EA80: + movs r0, 0x1 + movs r1, 0 + bl sub_801F1B0 + b _0801EBB8 +_0801EA8A: + movs r0, 0 + bl sub_801F280 + ldr r0, _0801EAB0 + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x78 + adds r1, r2, 0 + adds r1, 0x28 + adds r3, r2, 0 + adds r3, 0x68 + ldr r2, [r2, 0x24] + str r2, [sp] + movs r2, 0x2 + str r2, [sp, 0x4] + movs r2, 0 + bl sub_8012D60 + b _0801EBB8 + .align 2, 0 +_0801EAB0: .4byte gUnknown_203B26C +_0801EAB4: + ldr r2, [r4] + ldr r0, [r2, 0x20] + ldr r1, [r2, 0x10] + adds r2, 0x14 + bl sub_8093560 + ldr r0, [r4] + adds r0, 0x14 + bl sub_801F808 + b _0801EBB8 +_0801EACA: + bl sub_801EC7C + ldr r4, _0801EAF8 + ldr r5, _0801EAFC + ldr r0, [r5] + ldrh r1, [r0, 0x1C] + adds r0, r4, 0 + bl sub_8092C84 + adds r4, 0x50 + ldr r0, [r5] + ldrh r1, [r0, 0x1E] + adds r0, r4, 0 + bl sub_8092C84 + ldr r2, [r5] + ldr r3, [r2] + cmp r3, 0x1 + bls _0801EB00 + cmp r3, 0x2 + beq _0801EB68 + b _0801EBB8 + .align 2, 0 +_0801EAF8: .4byte gUnknown_202DF98 +_0801EAFC: .4byte gUnknown_203B26C +_0801EB00: + ldrb r4, [r2, 0xE] + cmp r4, 0 + beq _0801EB38 + ldr r1, _0801EB34 + movs r0, 0x64 + muls r0, r3 + adds r1, 0x30 + adds r0, r1 + ldr r0, [r0] + adds r3, r2, 0 + adds r3, 0x28 + adds r1, r2, 0 + adds r1, 0x68 + str r1, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r4, 0x94 + lsls r4, 1 + adds r1, r2, r4 + ldr r1, [r1] + str r1, [sp, 0xC] + movs r1, 0xC + b _0801EB86 + .align 2, 0 +_0801EB34: .4byte gUnknown_80D8888 +_0801EB38: + ldr r1, _0801EB64 + movs r0, 0x64 + muls r0, r3 + adds r1, 0x2C + adds r0, r1 + ldr r0, [r0] + adds r3, r2, 0 + adds r3, 0x28 + adds r1, r2, 0 + adds r1, 0x68 + str r1, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r4, [sp, 0x8] + movs r4, 0x94 + lsls r4, 1 + adds r1, r2, r4 + ldr r1, [r1] + str r1, [sp, 0xC] + movs r1, 0xC + b _0801EB86 + .align 2, 0 +_0801EB64: .4byte gUnknown_80D8888 +_0801EB68: + ldrb r4, [r2, 0xE] + cmp r4, 0 + beq _0801EB98 + ldr r0, _0801EB94 + adds r3, r2, 0 + adds r3, 0x28 + adds r1, r2, 0 + adds r1, 0x68 + str r1, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + str r1, [sp, 0xC] + movs r1, 0x20 +_0801EB86: + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0x5 + bl sub_8014248 + b _0801EBB8 + .align 2, 0 +_0801EB94: .4byte gUnknown_80DC1A0 +_0801EB98: + ldr r0, _0801EBC0 + adds r3, r2, 0 + adds r3, 0x28 + adds r1, r2, 0 + adds r1, 0x68 + str r1, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r4, [sp, 0x8] + str r4, [sp, 0xC] + movs r1, 0x20 + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0x5 + bl sub_8014248 +_0801EBB8: + add sp, 0x14 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0801EBC0: .4byte gUnknown_80DC1FC + thumb_func_end sub_801EA28 + + thumb_func_start sub_801EBC4 +sub_801EBC4: + push {r4,r5,lr} + movs r5, 0 + ldr r4, _0801EC48 + ldr r0, [r4] + adds r0, 0x68 + movs r1, 0 + movs r2, 0x10 + bl MemoryFill16 + ldr r1, [r4] + ldr r0, _0801EC4C + str r0, [r1, 0x28] + movs r0, 0x2 + str r0, [r1, 0x2C] + ldrh r0, [r1, 0x1E] + ldr r1, [r1, 0x10] + bl sub_80933A0 + lsls r0, 24 + cmp r0, 0 + beq _0801EBF6 + ldr r0, [r4] + ldr r0, [r0, 0x20] + cmp r0, 0x3 + ble _0801EBFE +_0801EBF6: + ldr r0, [r4] + adds r0, 0x68 + movs r1, 0x1 + strh r1, [r0] +_0801EBFE: + adds r5, 0x1 + ldr r4, _0801EC48 + ldr r0, [r4] + mov r12, r0 + lsls r1, r5, 3 + mov r3, r12 + adds r3, 0x28 + adds r2, r3, r1 + ldr r0, _0801EC50 + ldr r0, [r0] + str r0, [r2] + mov r2, r12 + adds r2, 0x2C + adds r1, r2, r1 + movs r0, 0x3 + str r0, [r1] + adds r5, 0x1 + lsls r1, r5, 3 + adds r3, r1 + movs r0, 0 + str r0, [r3] + adds r2, r1 + movs r0, 0x1 + str r0, [r2] + movs r3, 0 + cmp r3, r5 + bge _0801EC76 + mov r0, r12 + adds r0, 0x68 + ldrh r0, [r0] + cmp r0, 0 + bne _0801EC54 + mov r1, r12 + ldr r0, [r1, 0x2C] + str r0, [r1, 0x24] + b _0801EC76 + .align 2, 0 +_0801EC48: .4byte gUnknown_203B26C +_0801EC4C: .4byte gUnknown_80DC230 +_0801EC50: .4byte gUnknown_80D4970 +_0801EC54: + adds r3, 0x1 + cmp r3, r5 + bge _0801EC76 + ldr r2, [r4] + lsls r0, r3, 1 + adds r1, r2, 0 + adds r1, 0x68 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _0801EC54 + lsls r0, r3, 3 + adds r1, r2, 0 + adds r1, 0x2C + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x24] +_0801EC76: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_801EBC4 + + thumb_func_start sub_801EC7C +sub_801EC7C: + push {r4,lr} + ldr r4, _0801ECB0 + ldr r0, [r4] + adds r0, 0x68 + movs r1, 0 + movs r2, 0x10 + bl MemoryFill16 + ldr r1, [r4] + movs r3, 0 + ldr r0, _0801ECB4 + ldr r0, [r0] + str r0, [r1, 0x28] + movs r0, 0x4 + str r0, [r1, 0x2C] + movs r2, 0x1 + ldr r0, _0801ECB8 + ldr r0, [r0] + str r0, [r1, 0x30] + movs r0, 0x5 + str r0, [r1, 0x34] + str r3, [r1, 0x38] + str r2, [r1, 0x3C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801ECB0: .4byte gUnknown_203B26C +_0801ECB4: .4byte gUnknown_80D4920 +_0801ECB8: .4byte gUnknown_80D4928 + thumb_func_end sub_801EC7C + + thumb_func_start sub_801ECBC +sub_801ECBC: + push {lr} + movs r0, 0x1 + bl sub_801EF38 + cmp r0, 0x3 + beq _0801ECD8 + cmp r0, 0x3 + bhi _0801ECD2 + cmp r0, 0x2 + beq _0801ED18 + b _0801ED22 +_0801ECD2: + cmp r0, 0x4 + beq _0801ECF8 + b _0801ED22 +_0801ECD8: + bl sub_801F194 + ldr r1, _0801ECF4 + ldr r2, [r1] + str r0, [r2, 0x20] + ldr r1, [r2, 0x10] + lsls r0, 3 + adds r1, r0 + ldrh r0, [r1, 0x2] + strh r0, [r2, 0x1E] + movs r0, 0x2 + bl sub_801E968 + b _0801ED22 + .align 2, 0 +_0801ECF4: .4byte gUnknown_203B26C +_0801ECF8: + bl sub_801F194 + ldr r1, _0801ED14 + ldr r2, [r1] + str r0, [r2, 0x20] + ldr r1, [r2, 0x10] + lsls r0, 3 + adds r1, r0 + ldrh r0, [r1, 0x2] + strh r0, [r2, 0x1E] + movs r0, 0x3 + bl sub_801E968 + b _0801ED22 + .align 2, 0 +_0801ED14: .4byte gUnknown_203B26C +_0801ED18: + bl sub_801F214 + movs r0, 0x6 + bl sub_801E968 +_0801ED22: + pop {r0} + bx r0 + thumb_func_end sub_801ECBC + + thumb_func_start sub_801ED28 +sub_801ED28: + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + bl sub_801EF38 + ldr r4, _0801ED60 + ldr r0, [r4] + adds r0, 0x78 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _0801ED4E + ldr r0, [r4] + adds r0, 0x78 + mov r1, sp + bl sub_8013114 +_0801ED4E: + ldr r0, [sp] + cmp r0, 0x2 + beq _0801ED74 + cmp r0, 0x2 + bgt _0801ED64 + cmp r0, 0x1 + beq _0801ED6C + b _0801ED9A + .align 2, 0 +_0801ED60: .4byte gUnknown_203B26C +_0801ED64: + cmp r0, 0x3 + beq _0801ED94 + cmp r0, 0x5 + bne _0801ED9A +_0801ED6C: + movs r0, 0x1 + bl sub_801E968 + b _0801ED9A +_0801ED74: + ldr r0, _0801ED90 + bl sub_8011988 + ldr r1, [r4] + ldr r0, [r1, 0x20] + ldr r1, [r1, 0x10] + bl sub_80934B0 + ldr r1, [r4] + strb r0, [r1, 0xE] + movs r0, 0x4 + bl sub_801E968 + b _0801ED9A + .align 2, 0 +_0801ED90: .4byte 0x00000133 +_0801ED94: + movs r0, 0x3 + bl sub_801E968 +_0801ED9A: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_801ED28 + + thumb_func_start sub_801EDA4 +sub_801EDA4: + push {lr} + bl sub_801F890 + cmp r0, 0x1 + bls _0801EDBC + cmp r0, 0x3 + bhi _0801EDBC + bl sub_801F8D0 + movs r0, 0x1 + bl sub_801E968 +_0801EDBC: + pop {r0} + bx r0 + thumb_func_end sub_801EDA4 + + thumb_func_start sub_801EDC0 +sub_801EDC0: + push {r4,lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0801EE06 + ldr r0, [sp] + cmp r0, 0x4 + beq _0801EDE4 + cmp r0, 0x4 + bgt _0801EDDE + cmp r0, 0x1 + beq _0801EE00 + b _0801EE06 +_0801EDDE: + cmp r0, 0x5 + beq _0801EE00 + b _0801EE06 +_0801EDE4: + bl sub_801F214 + ldr r4, _0801EDFC + ldr r1, [r4] + ldr r0, [r1, 0x10] + ldr r1, [r1, 0x20] + bl sub_8093CF8 + ldr r1, [r4] + movs r0, 0x5 + str r0, [r1, 0x4] + b _0801EE06 + .align 2, 0 +_0801EDFC: .4byte gUnknown_203B26C +_0801EE00: + movs r0, 0x1 + bl sub_801E968 +_0801EE06: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_801EDC0 + + thumb_func_start sub_801EE10 +sub_801EE10: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r6, r0, 0 + mov r9, r2 + adds r4, r3, 0 + ldr r0, [sp, 0x20] + mov r8, r0 + lsls r1, 16 + asrs r7, r1, 16 + lsls r4, 24 + lsrs r4, 24 + ldr r5, _0801EF28 + movs r0, 0xBC + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] + movs r2, 0 + strb r4, [r0, 0x4] + ldr r0, [r5] + movs r1, 0x1 + strb r1, [r0, 0x5] + ldr r0, [r5] + strb r1, [r0, 0x6] + ldr r0, [r5] + strb r1, [r0, 0x7] + ldr r0, [r5] + str r6, [r0] + cmp r6, 0x1 + bls _0801EE5E + cmp r6, 0x3 + bhi _0801EE5E + strb r2, [r0, 0x5] + ldr r0, [r5] + strb r2, [r0, 0x6] + ldr r0, [r5] + strb r2, [r0, 0x7] +_0801EE5E: + ldr r4, _0801EF28 + ldr r3, [r4] + ldr r2, _0801EF2C + movs r0, 0x58 + adds r1, r7, 0 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + str r0, [r3, 0x8] + ldrb r0, [r0, 0x2] + strb r0, [r3, 0xC] + ldr r0, [r4] + mov r1, r9 + str r1, [r0, 0x10] + adds r0, 0xB8 + ldr r1, [sp, 0x1C] + str r1, [r0] + bl sub_801F3F8 + adds r5, r0, 0 + adds r6, r5, 0 + cmp r5, 0x4 + bge _0801EE8E + movs r6, 0x4 +_0801EE8E: + ldr r0, [r4] + adds r0, 0x58 + bl sub_8006518 + ldr r1, [r4] + mov r2, r8 + str r2, [r1, 0x50] + lsls r0, r2, 1 + add r0, r8 + lsls r0, 3 + adds r1, r0 + adds r1, 0x58 + ldr r0, _0801EF30 + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldr r0, [r4] + adds r0, 0xB8 + ldr r0, [r0] + cmp r0, 0 + beq _0801EED8 + mov r0, r8 + bl sub_8006544 + ldr r1, [r4] + str r0, [r1, 0x54] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 3 + adds r1, r2 + adds r1, 0x58 + ldr r0, _0801EF34 + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} +_0801EED8: + ldr r0, [r4] + ldr r2, [r0, 0x50] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 3 + adds r1, 0x58 + adds r0, r1 + adds r1, r6, 0 + bl sub_8012D08 + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x58 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + adds r0, 0x1C + adds r1, r5, 0 + adds r2, r5, 0 + mov r3, r8 + bl sub_8013818 + ldr r0, [r4] + adds r0, 0x1C + movs r1, 0 + bl sub_8013780 + movs r0, 0x1 + bl sub_801F280 + movs r0, 0x1 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0801EF28: .4byte gUnknown_203B270 +_0801EF2C: .4byte gUnknown_203B45C +_0801EF30: .4byte gUnknown_80DC25C +_0801EF34: .4byte gUnknown_80DC274 + thumb_func_end sub_801EE10 + + thumb_func_start sub_801EF38 +sub_801EF38: + push {r4-r7,lr} + lsls r0, 24 + movs r7, 0 + cmp r0, 0 + bne _0801EF54 + ldr r0, _0801EF50 + ldr r0, [r0] + adds r0, 0x1C + bl sub_8013660 + b _0801F18C + .align 2, 0 +_0801EF50: .4byte gUnknown_203B270 +_0801EF54: + ldr r0, _0801EF70 + ldr r0, [r0] + adds r0, 0x1C + bl GetKeyPress + subs r0, 0x1 + cmp r0, 0xC + bls _0801EF66 + b _0801F12E +_0801EF66: + lsls r0, 2 + ldr r1, _0801EF74 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801EF70: .4byte gUnknown_203B270 +_0801EF74: .4byte _0801EF78 + .align 2, 0 +_0801EF78: + .4byte _0801EFB6 + .4byte _0801EFAC + .4byte _0801F0E4 + .4byte _0801EFC0 + .4byte _0801F12E + .4byte _0801F12E + .4byte _0801EFE4 + .4byte _0801EFCA + .4byte _0801F12E + .4byte _0801F12E + .4byte _0801F074 + .4byte _0801F04C + .4byte _0801F018 +_0801EFAC: + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + b _0801F18E +_0801EFB6: + movs r0, 0 + bl sub_80119D4 + movs r0, 0x3 + b _0801F18E +_0801EFC0: + movs r0, 0x4 + bl sub_80119D4 + movs r0, 0x4 + b _0801F18E +_0801EFCA: + ldr r5, _0801EFE0 + ldr r0, [r5] + movs r1, 0x34 + ldrsh r6, [r0, r1] + adds r4, r0, 0 + adds r4, 0x1C + ldr r0, [r0, 0x10] + adds r1, r6, 0 + bl sub_8092E54 + b _0801EFF8 + .align 2, 0 +_0801EFE0: .4byte gUnknown_203B270 +_0801EFE4: + ldr r5, _0801F014 + ldr r0, [r5] + movs r1, 0x34 + ldrsh r6, [r0, r1] + adds r4, r0, 0 + adds r4, 0x1C + ldr r0, [r0, 0x10] + adds r1, r6, 0 + bl sub_8092EEC +_0801EFF8: + adds r1, r0, 0 + adds r0, r4, 0 + bl sub_8013780 + ldr r0, [r5] + movs r2, 0x34 + ldrsh r0, [r0, r2] + cmp r6, r0 + bne _0801F00C + b _0801F12E +_0801F00C: + movs r0, 0x3 + bl sub_80119D4 + b _0801F12E + .align 2, 0 +_0801F014: .4byte gUnknown_203B270 +_0801F018: + ldr r0, _0801F048 + ldr r2, [r0] + ldrb r1, [r2, 0x5] + adds r5, r0, 0 + cmp r1, 0 + bne _0801F026 + b _0801F12E +_0801F026: + movs r0, 0x34 + ldrsh r4, [r2, r0] + ldr r0, [r2, 0x10] + adds r1, r4, 0 + bl sub_809309C +_0801F032: + ldr r1, [r5] + strh r0, [r1, 0x34] + lsls r0, 16 + asrs r0, 16 + cmp r4, r0 + beq _0801F06C + movs r0, 0x3 + bl sub_80119D4 + b _0801F182 + .align 2, 0 +_0801F048: .4byte gUnknown_203B270 +_0801F04C: + ldr r0, _0801F068 + ldr r2, [r0] + ldrb r1, [r2, 0x5] + adds r5, r0, 0 + cmp r1, 0 + beq _0801F12E + movs r1, 0x34 + ldrsh r4, [r2, r1] + ldr r0, [r2, 0x10] + adds r1, r4, 0 + bl sub_809324C + b _0801F032 + .align 2, 0 +_0801F068: .4byte gUnknown_203B270 +_0801F06C: + movs r0, 0x2 + bl sub_80119D4 + b _0801F182 +_0801F074: + ldr r0, _0801F0C8 + ldr r2, [r0] + ldrb r1, [r2, 0x6] + adds r5, r0, 0 + cmp r1, 0 + beq _0801F12E + ldr r0, _0801F0CC + ldr r0, [r0] + movs r1, 0x98 + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0x95 + ble _0801F0D0 + movs r1, 0x34 + ldrsh r0, [r2, r1] + ldr r1, [r2, 0x10] + bl sub_8093318 + lsls r0, 24 + cmp r0, 0 + beq _0801F0D0 + ldr r1, [r5] + movs r2, 0x34 + ldrsh r0, [r1, r2] + ldr r1, [r1, 0x10] + bl sub_8093400 + movs r0, 0x6 + bl sub_80119D4 + movs r7, 0x1 + ldr r1, [r5] + ldrb r0, [r1, 0x4] + cmp r0, 0 + bne _0801F12E + strb r7, [r1, 0x4] + movs r0, 0xA6 + lsls r0, 1 + bl sub_8011988 + b _0801F12E + .align 2, 0 +_0801F0C8: .4byte gUnknown_203B270 +_0801F0CC: .4byte gUnknown_203B460 +_0801F0D0: + ldr r0, _0801F0E0 + ldr r1, [r0] + movs r2, 0x34 + ldrsh r0, [r1, r2] + ldr r1, [r1, 0x10] + bl sub_8093468 + b _0801F0FE + .align 2, 0 +_0801F0E0: .4byte gUnknown_203B270 +_0801F0E4: + ldr r0, _0801F10C + ldr r1, [r0] + ldrb r0, [r1, 0x7] + cmp r0, 0 + beq _0801F12E + ldrb r0, [r1, 0xC] + cmp r0, 0 + beq _0801F110 + movs r2, 0x34 + ldrsh r0, [r1, r2] + ldr r1, [r1, 0x10] + bl sub_80934DC +_0801F0FE: + lsls r0, 24 + cmp r0, 0 + bne _0801F120 + movs r0, 0x2 + bl sub_80119D4 + b _0801F12E + .align 2, 0 +_0801F10C: .4byte gUnknown_203B270 +_0801F110: + movs r2, 0x34 + ldrsh r0, [r1, r2] + ldr r1, [r1, 0x10] + bl sub_8093544 + lsls r0, 24 + cmp r0, 0 + beq _0801F128 +_0801F120: + movs r0, 0x6 + bl sub_80119D4 + b _0801F182 +_0801F128: + movs r0, 0x2 + bl sub_80119D4 +_0801F12E: + cmp r7, 0 + bne _0801F182 + movs r3, 0 + ldr r5, _0801F160 + movs r4, 0x1 +_0801F138: + ldr r2, [r5] + lsls r0, r3, 3 + ldr r1, [r2, 0x10] + adds r1, r0 + ldrb r1, [r1] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _0801F16C + movs r0, 0x2 + ands r0, r1 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _0801F164 + adds r0, r2, 0 + adds r0, 0x14 + adds r0, r3 + strb r4, [r0] + b _0801F16C + .align 2, 0 +_0801F160: .4byte gUnknown_203B270 +_0801F164: + adds r0, r2, 0 + adds r0, 0x14 + adds r0, r3 + strb r1, [r0] +_0801F16C: + adds r3, 0x1 + cmp r3, 0x7 + ble _0801F138 + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0x1C + adds r1, 0x14 + bl AddMenuCursorSprite_ + cmp r7, 0 + beq _0801F18C +_0801F182: + movs r0, 0x1 + bl sub_801F280 + movs r0, 0x1 + b _0801F18E +_0801F18C: + movs r0, 0 +_0801F18E: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_801EF38 + + thumb_func_start sub_801F194 +sub_801F194: + ldr r0, _0801F1A0 + ldr r0, [r0] + movs r1, 0x34 + ldrsh r0, [r0, r1] + bx lr + .align 2, 0 +_0801F1A0: .4byte gUnknown_203B270 + thumb_func_end sub_801F194 + + thumb_func_start sub_801F1A4 +sub_801F1A4: + ldr r0, _0801F1AC + ldr r0, [r0] + ldrb r0, [r0, 0x4] + bx lr + .align 2, 0 +_0801F1AC: .4byte gUnknown_203B270 + thumb_func_end sub_801F1A4 + + thumb_func_start sub_801F1B0 +sub_801F1B0: + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r1, 24 + ldr r4, _0801F210 + ldr r2, [r4] + ldrb r0, [r2, 0x4] + cmp r0, 0 + bne _0801F1C6 + strb r1, [r2, 0x4] +_0801F1C6: + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x58 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + bl sub_801F3F8 + adds r1, r0, 0 + ldr r0, [r4] + strh r1, [r0, 0x3E] + adds r0, 0x1C + bl sub_8013984 + ldr r1, [r4] + ldr r0, [r1, 0x10] + movs r2, 0x34 + ldrsh r1, [r1, r2] + bl sub_8092F4C + ldr r1, [r4] + strh r0, [r1, 0x34] + movs r0, 0x1 + bl sub_801F280 + cmp r5, 0 + beq _0801F208 + ldr r0, [r4] + adds r0, 0x1C + bl AddMenuCursorSprite +_0801F208: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0801F210: .4byte gUnknown_203B270 + thumb_func_end sub_801F1B0 + + thumb_func_start sub_801F214 +sub_801F214: + push {r4-r6,lr} + ldr r4, _0801F278 + ldr r2, [r4] + cmp r2, 0 + beq _0801F272 + ldr r0, [r2, 0x50] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r2, r1 + ldr r3, _0801F27C + adds r1, 0x58 + adds r0, r3, 0 + ldm r0!, {r2,r5,r6} + stm r1!, {r2,r5,r6} + ldm r0!, {r2,r5,r6} + stm r1!, {r2,r5,r6} + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0xB8 + ldr r0, [r0] + cmp r0, 0 + beq _0801F258 + ldr r0, [r2, 0x54] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x58 + adds r0, r3, 0 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} +_0801F258: + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x58 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0801F272: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0801F278: .4byte gUnknown_203B270 +_0801F27C: .4byte gUnknown_80DC240 + thumb_func_end sub_801F214 + + thumb_func_start sub_801F280 +sub_801F280: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r4, _0801F30C + ldr r0, [r4] + ldr r0, [r0, 0x50] + bl sub_8008C54 + ldr r0, [r4] + ldr r0, [r0, 0x50] + bl sub_80073B8 + ldr r0, [r4] + ldr r1, [r0, 0x8] + adds r1, 0x4C + add r0, sp, 0x4 + movs r2, 0xA + bl sub_80922B4 + ldr r0, _0801F310 + add r1, sp, 0x4 + bl strcpy + ldr r2, _0801F314 + ldr r0, [r4] + ldr r3, [r0, 0x50] + movs r0, 0 + str r0, [sp] + movs r0, 0xC + movs r1, 0 + bl sub_8014FF0 + movs r7, 0 + ldr r0, [r4] + movs r1, 0x36 + ldrsh r0, [r0, r1] + cmp r7, r0 + bge _0801F394 + add r5, sp, 0x18 + mov r8, r4 + movs r0, 0x1 + mov r9, r0 +_0801F2E0: + adds r0, r5, 0 + movs r1, 0 + movs r2, 0xC + bl memset + movs r0, 0x6A + str r0, [r5, 0x4] + mov r1, r8 + ldr r2, [r1] + lsls r1, r7, 3 + ldr r0, [r2, 0x10] + adds r4, r0, r1 + ldrb r1, [r4] + mov r0, r9 + ands r0, r1 + cmp r0, 0 + beq _0801F386 + ldrb r0, [r2, 0xC] + cmp r0, 0 + beq _0801F318 + movs r0, 0x2 + b _0801F31A + .align 2, 0 +_0801F30C: .4byte gUnknown_203B270 +_0801F310: .4byte gUnknown_202DF98 +_0801F314: .4byte gUnknown_80DC28C +_0801F318: + movs r0, 0x4 +_0801F31A: + str r0, [sp, 0x18] + mov r1, r8 + ldr r0, [r1] + ldrb r0, [r0, 0x6] + cmp r0, 0 + beq _0801F328 + mov r0, r9 +_0801F328: + strb r0, [r5, 0x9] + cmp r7, 0x3 + ble _0801F332 + mov r1, r9 + strb r1, [r5, 0x8] +_0801F332: + ldr r0, _0801F3EC + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_80928A0 + ldr r2, _0801F3F0 + ldr r0, [r2] + adds r0, 0x1C + adds r1, r7, 0 + str r2, [sp, 0x24] + bl sub_8013800 + adds r6, r0, 0 + ldrb r1, [r4] + movs r0, 0x2 + ands r0, r1 + movs r4, 0xD + ldr r2, [sp, 0x24] + cmp r0, 0 + bne _0801F372 + movs r4, 0x8 + cmp r7, 0 + beq _0801F372 + ldr r0, [r2] + ldr r0, [r0, 0x50] + subs r2, r6, 0x2 + movs r1, 0x7 + str r1, [sp] + movs r1, 0xC + movs r3, 0x78 + bl sub_800792C +_0801F372: + mov r1, r8 + ldr r0, [r1] + ldr r3, [r0, 0x50] + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + adds r1, r6, 0 + ldr r2, _0801F3F4 + bl sub_8014FF0 +_0801F386: + adds r7, 0x1 + mov r1, r8 + ldr r0, [r1] + movs r1, 0x36 + ldrsh r0, [r0, r1] + cmp r7, r0 + blt _0801F2E0 +_0801F394: + ldr r4, _0801F3F0 + ldr r0, [r4] + ldr r0, [r0, 0x50] + bl sub_80073E0 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0xB8 + ldr r0, [r0] + cmp r0, 0 + beq _0801F3DC + mov r0, r10 + cmp r0, 0 + beq _0801F3DC + ldr r0, [r1, 0x54] + bl sub_8008C54 + ldr r0, [r4] + ldr r0, [r0, 0x54] + bl sub_80073B8 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0xB8 + ldr r2, [r0] + ldr r3, [r1, 0x54] + movs r0, 0 + str r0, [sp] + movs r0, 0x8 + movs r1, 0 + bl sub_8014FF0 + ldr r0, [r4] + ldr r0, [r0, 0x54] + bl sub_80073E0 +_0801F3DC: + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0801F3EC: .4byte gUnknown_202DE58 +_0801F3F0: .4byte gUnknown_203B270 +_0801F3F4: .4byte gUnknown_80DC2A0 + thumb_func_end sub_801F280 + + thumb_func_start sub_801F3F8 +sub_801F3F8: + push {r4,r5,lr} + movs r4, 0 + ldr r0, _0801F424 + ldr r0, [r0] + movs r5, 0x1 + ldr r2, [r0, 0x10] + movs r3, 0x7 +_0801F406: + ldrb r1, [r2] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _0801F412 + adds r4, 0x1 +_0801F412: + adds r2, 0x8 + subs r3, 0x1 + cmp r3, 0 + bge _0801F406 + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0801F424: .4byte gUnknown_203B270 + thumb_func_end sub_801F3F8 + + thumb_func_start sub_801F428 +sub_801F428: + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + adds r4, r0, 0 + mov r9, r1 + lsls r4, 16 + asrs r4, 16 + ldr r5, _0801F50C + movs r0, 0xFA + lsls r0, 2 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] + ldr r3, _0801F510 + movs r1, 0x58 + adds r2, r4, 0 + muls r2, r1 + ldr r1, [r3] + adds r1, r2 + str r1, [r0] + adds r1, r0, 0 + adds r1, 0x8 + str r1, [r0, 0x4] + movs r4, 0xDF + lsls r4, 2 + adds r1, r0, r4 + mov r2, r9 + str r2, [r1] + movs r6, 0xE0 + lsls r6, 2 + adds r2, r0, r6 + mov r3, r9 + lsls r1, r3, 1 + add r1, r9 + lsls r1, 3 + movs r3, 0xE1 + lsls r3, 2 + mov r8, r3 + add r1, r8 + adds r1, r0, r1 + str r1, [r2] + add r0, r8 + bl sub_8006518 + ldr r1, [r5] + adds r4, r1, r4 + ldr r2, [r4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + add r1, r8 + ldr r0, _0801F514 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r1, [r5] + adds r6, r1, r6 + ldr r0, [r6] + movs r4, 0xF9 + lsls r4, 2 + adds r1, r4 + str r1, [r0, 0x14] + movs r2, 0 + movs r0, 0x1 + strb r0, [r1] + ldr r0, [r5] + ldr r1, _0801F518 + adds r0, r1 + strb r2, [r0] + ldr r0, [r5] + ldr r3, _0801F51C + adds r0, r3 + movs r1, 0xC + strb r1, [r0] + ldr r0, [r5] + adds r4, 0x3 + adds r0, r4 + strb r2, [r0] + bl sub_8004914 + ldr r0, [r5] + add r0, r8 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r4, [r5] + movs r0, 0xD2 + lsls r0, 2 + adds r4, r0 + bl sub_801F7E4 + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0x4 + mov r3, r9 + bl sub_8013818 + bl sub_801F690 + bl sub_801F700 + movs r0, 0x1 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0801F50C: .4byte gUnknown_203B274 +_0801F510: .4byte gUnknown_203B45C +_0801F514: .4byte gUnknown_80DC2C4 +_0801F518: .4byte 0x000003e5 +_0801F51C: .4byte 0x000003e6 + thumb_func_end sub_801F428 + + thumb_func_start sub_801F520 +sub_801F520: + push {lr} + lsls r0, 24 + cmp r0, 0 + bne _0801F540 + ldr r0, _0801F53C + ldr r0, [r0] + movs r1, 0xD2 + lsls r1, 2 + adds r0, r1 + bl sub_8013660 + movs r0, 0 + b _0801F5AE + .align 2, 0 +_0801F53C: .4byte gUnknown_203B274 +_0801F540: + ldr r0, _0801F55C + ldr r0, [r0] + movs r1, 0xD2 + lsls r1, 2 + adds r0, r1 + bl GetKeyPress + cmp r0, 0x2 + beq _0801F566 + cmp r0, 0x2 + bgt _0801F560 + cmp r0, 0x1 + beq _0801F570 + b _0801F584 + .align 2, 0 +_0801F55C: .4byte gUnknown_203B274 +_0801F560: + cmp r0, 0x4 + beq _0801F57A + b _0801F584 +_0801F566: + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + b _0801F5AE +_0801F570: + movs r0, 0 + bl sub_80119D4 + movs r0, 0x3 + b _0801F5AE +_0801F57A: + movs r0, 0x4 + bl sub_80119D4 + movs r0, 0x4 + b _0801F5AE +_0801F584: + ldr r0, _0801F5A0 + ldr r0, [r0] + movs r1, 0xD2 + lsls r1, 2 + adds r0, r1 + movs r1, 0x1 + bl sub_80138B8 + lsls r0, 24 + cmp r0, 0 + bne _0801F5A4 + movs r0, 0 + b _0801F5AE + .align 2, 0 +_0801F5A0: .4byte gUnknown_203B274 +_0801F5A4: + bl sub_801F690 + bl sub_801F700 + movs r0, 0x1 +_0801F5AE: + pop {r1} + bx r1 + thumb_func_end sub_801F520 + + thumb_func_start sub_801F5B4 +sub_801F5B4: + push {r4,lr} + ldr r0, _0801F5E8 + ldr r1, [r0] + ldr r2, [r1, 0x4] + ldr r3, _0801F5EC + adds r0, r1, r3 + movs r4, 0 + ldrsh r3, [r0, r4] + movs r4, 0xD9 + lsls r4, 2 + adds r0, r1, r4 + movs r4, 0 + ldrsh r0, [r0, r4] + muls r0, r3 + movs r3, 0xD8 + lsls r3, 2 + adds r1, r3 + movs r4, 0 + ldrsh r1, [r1, r4] + adds r0, r1 + lsls r0, 1 + adds r2, r0 + ldrh r0, [r2] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0801F5E8: .4byte gUnknown_203B274 +_0801F5EC: .4byte 0x00000366 + thumb_func_end sub_801F5B4 + + thumb_func_start sub_801F5F0 +sub_801F5F0: + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8004914 + ldr r5, _0801F638 + ldr r0, [r5] + movs r1, 0xE1 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + movs r2, 0 + bl sub_800641C + ldr r0, [r5] + movs r1, 0xD2 + lsls r1, 2 + adds r0, r1 + bl sub_8013984 + bl sub_801F690 + bl sub_801F700 + cmp r4, 0 + beq _0801F632 + ldr r0, [r5] + movs r1, 0xD2 + lsls r1, 2 + adds r0, r1 + bl AddMenuCursorSprite +_0801F632: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0801F638: .4byte gUnknown_203B274 + thumb_func_end sub_801F5F0 + + thumb_func_start sub_801F63C +sub_801F63C: + push {r4-r6,lr} + ldr r5, _0801F688 + ldr r2, [r5] + cmp r2, 0 + beq _0801F680 + movs r1, 0xDF + lsls r1, 2 + adds r0, r2, r1 + ldr r0, [r0] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r2, r1 + movs r4, 0xE1 + lsls r4, 2 + adds r1, r4 + ldr r0, _0801F68C + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + bl sub_8004914 + ldr r0, [r5] + adds r0, r4 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r5] + bl MemoryFree + movs r0, 0 + str r0, [r5] +_0801F680: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0801F688: .4byte gUnknown_203B274 +_0801F68C: .4byte gUnknown_80DC2AC + thumb_func_end sub_801F63C + + thumb_func_start sub_801F690 +sub_801F690: + push {r4,r5,lr} + ldr r5, _0801F6F4 + ldr r0, [r5] + ldr r1, _0801F6F8 + adds r0, r1 + movs r2, 0 + ldrsh r0, [r0, r2] + movs r1, 0xC + bl sub_80095E4 + adds r0, 0x2 + lsls r0, 16 + ldr r3, [r5] + movs r1, 0xDF + lsls r1, 2 + adds r4, r3, r1 + ldr r2, [r4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 3 + adds r1, r3, r1 + ldr r2, _0801F6FC + adds r1, r2 + asrs r2, r0, 16 + lsrs r0, 16 + strh r0, [r1] + ldr r1, [r4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r3, r0 + adds r2, 0x2 + movs r0, 0xE5 + lsls r0, 2 + adds r3, r0 + strh r2, [r3] + bl sub_8004914 + ldr r0, [r5] + movs r1, 0xE1 + lsls r1, 2 + adds r0, r1 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0801F6F4: .4byte gUnknown_203B274 +_0801F6F8: .4byte 0x00000362 +_0801F6FC: .4byte 0x00000392 + thumb_func_end sub_801F690 + + thumb_func_start sub_801F700 +sub_801F700: + push {r4-r7,lr} + sub sp, 0xB4 + ldr r6, _0801F7D4 + ldr r0, [r6] + movs r4, 0xDF + lsls r4, 2 + adds r0, r4 + ldr r0, [r0] + bl sub_8008C54 + ldr r0, [r6] + adds r0, r4 + ldr r0, [r0] + bl sub_80073B8 + add r5, sp, 0x34 + ldr r1, _0801F7D8 + ldr r0, [r6] + ldr r3, _0801F7DC + adds r2, r0, r3 + movs r7, 0 + ldrsh r2, [r2, r7] + adds r2, 0x1 + adds r3, 0x2 + adds r0, r3 + movs r7, 0 + ldrsh r3, [r0, r7] + adds r0, r5, 0 + bl sub_800D158 + ldr r0, [r6] + adds r0, r4 + ldr r3, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0x10 + movs r1, 0 + adds r2, r5, 0 + bl xxx_call_draw_string + movs r4, 0 + ldr r0, [r6] + ldr r1, _0801F7E0 + adds r0, r1 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r4, r0 + bge _0801F7BC + adds r5, r6, 0 +_0801F762: + ldr r1, [r5] + ldr r2, [r1, 0x4] + ldr r3, _0801F7DC + adds r0, r1, r3 + movs r6, 0 + ldrsh r3, [r0, r6] + movs r7, 0xD9 + lsls r7, 2 + adds r1, r7 + movs r6, 0 + ldrsh r0, [r1, r6] + muls r0, r3 + adds r0, r4 + lsls r0, 1 + adds r2, r0 + ldrh r1, [r2] + add r0, sp, 0x4 + bl sub_8092C84 + ldr r0, [r5] + subs r7, 0x1C + adds r0, r7 + adds r1, r4, 0 + bl sub_8013800 + adds r1, r0, 0 + ldr r0, [r5] + movs r2, 0xDF + lsls r2, 2 + adds r0, r2 + ldr r3, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0x8 + add r2, sp, 0x4 + bl xxx_call_draw_string + adds r4, 0x1 + ldr r0, [r5] + ldr r3, _0801F7E0 + adds r0, r3 + movs r6, 0 + ldrsh r0, [r0, r6] + cmp r4, r0 + blt _0801F762 +_0801F7BC: + ldr r0, _0801F7D4 + ldr r0, [r0] + movs r7, 0xDF + lsls r7, 2 + adds r0, r7 + ldr r0, [r0] + bl sub_80073E0 + add sp, 0xB4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0801F7D4: .4byte gUnknown_203B274 +_0801F7D8: .4byte gUnknown_80DC2DC +_0801F7DC: .4byte 0x00000366 +_0801F7E0: .4byte 0x00000362 + thumb_func_end sub_801F700 + + thumb_func_start sub_801F7E4 +sub_801F7E4: + push {r4,lr} + ldr r4, _0801F804 + ldr r1, [r4] + ldr r0, [r1, 0x4] + ldr r1, [r1] + bl sub_808E218 + ldr r0, [r4] + ldr r0, [r0, 0x4] + movs r1, 0xCF + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0801F804: .4byte gUnknown_203B274 + thumb_func_end sub_801F7E4 + + thumb_func_start sub_801F808 +sub_801F808: + push {r4,r5,lr} + adds r4, r0, 0 + movs r0, 0x1 + bl sub_8004D8C + ldr r5, _0801F88C + movs r0, 0xD4 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] + movs r1, 0 + str r1, [r0, 0x5C] + adds r1, r0, 0 + adds r1, 0x64 + str r1, [r0, 0x60] + adds r0, r1, 0 + bl sub_80140B4 + bl sub_8004914 + ldr r0, [r5] + adds r0, 0x64 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r5] + str r4, [r0, 0x4] + movs r2, 0x4 + ldrh r0, [r4, 0x6] + cmp r0, 0 + bne _0801F862 + adds r3, r5, 0 +_0801F84C: + subs r2, 0x1 + cmp r2, 0x1 + ble _0801F862 + ldr r0, [r3] + ldr r1, [r0, 0x4] + lsls r0, r2, 1 + adds r0, r1 + subs r0, 0x2 + ldrh r0, [r0] + cmp r0, 0 + beq _0801F84C +_0801F862: + ldr r4, _0801F88C + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x28 + ldr r3, [r1, 0x5C] + adds r1, r2, 0 + movs r2, 0x1 + bl sub_8013818 + ldr r0, [r4] + adds r0, 0xC8 + bl sub_801317C + movs r0, 0 + bl sub_801F918 + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0801F88C: .4byte gUnknown_203B278 + thumb_func_end sub_801F808 + + thumb_func_start sub_801F890 +sub_801F890: + push {lr} + ldr r0, _0801F8A8 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0x1 + beq _0801F8BC + cmp r0, 0x1 + bgt _0801F8AC + cmp r0, 0 + beq _0801F8B6 + b _0801F8C6 + .align 2, 0 +_0801F8A8: .4byte gUnknown_203B278 +_0801F8AC: + cmp r0, 0x2 + beq _0801F8C6 + cmp r0, 0x3 + beq _0801F8C2 + b _0801F8C6 +_0801F8B6: + bl sub_801FA58 + b _0801F8CA +_0801F8BC: + bl sub_801FAD4 + b _0801F8CA +_0801F8C2: + movs r0, 0x3 + b _0801F8CC +_0801F8C6: + movs r0, 0x2 + b _0801F8CC +_0801F8CA: + movs r0, 0 +_0801F8CC: + pop {r1} + bx r1 + thumb_func_end sub_801F890 + + thumb_func_start sub_801F8D0 +sub_801F8D0: + push {r4,r5,lr} + ldr r4, _0801F910 + ldr r2, [r4] + cmp r2, 0 + beq _0801F90A + ldr r0, [r2, 0x5C] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x64 + ldr r0, _0801F914 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x64 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0801F90A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0801F910: .4byte gUnknown_203B278 +_0801F914: .4byte gUnknown_80DC2F8 + thumb_func_end sub_801F8D0 + + thumb_func_start sub_801F918 +sub_801F918: + push {lr} + ldr r1, _0801F92C + ldr r1, [r1] + str r0, [r1] + bl sub_801F930 + bl sub_801F9A4 + pop {r0} + bx r0 + .align 2, 0 +_0801F92C: .4byte gUnknown_203B278 + thumb_func_end sub_801F918 + + thumb_func_start sub_801F930 +sub_801F930: + push {r4,lr} + ldr r4, _0801F94C + ldr r0, [r4] + adds r0, 0x64 + bl sub_80140B4 + ldr r2, [r4] + ldr r3, [r2] + cmp r3, 0 + beq _0801F950 + cmp r3, 0x1 + beq _0801F98C + b _0801F99C + .align 2, 0 +_0801F94C: .4byte gUnknown_203B278 +_0801F950: + ldr r0, [r2, 0x60] + adds r1, r2, 0 + adds r1, 0xC4 + str r1, [r0, 0x14] + adds r0, r2, 0 + adds r0, 0x48 + ldrh r0, [r0] + strb r0, [r1] + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0x46 + ldrh r1, [r1] + adds r0, 0xC5 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0xC6 + movs r1, 0x10 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0xC7 + strb r3, [r0] + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x64 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + b _0801F99C +_0801F98C: + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x64 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C +_0801F99C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_801F930 + + thumb_func_start sub_801F9A4 +sub_801F9A4: + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, _0801F9EC + ldr r0, [r5] + ldr r4, [r0] + cmp r4, 0x1 + beq _0801F9F0 + cmp r4, 0x1 + bgt _0801FA48 + cmp r4, 0 + bne _0801FA48 + ldr r0, [r0, 0x5C] + bl sub_8008C54 + ldr r3, [r5] + adds r2, r3, 0 + adds r2, 0x46 + movs r1, 0 + ldrsh r0, [r2, r1] + ldr r1, [r3, 0x4] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r3, 0x8] + movs r1, 0 + ldrsh r0, [r2, r1] + ldrh r1, [r3, 0x8] + ldr r2, [r3, 0x5C] + adds r3, 0x14 + bl sub_8093D9C + ldr r1, [r5] + str r0, [r1, 0x10] + str r4, [r1, 0x24] + b _0801FA48 + .align 2, 0 +_0801F9EC: .4byte gUnknown_203B278 +_0801F9F0: + ldr r0, [r0, 0x5C] + bl sub_8008C54 + ldr r0, [r5] + ldr r0, [r0, 0x5C] + bl sub_80073B8 + ldr r0, [r5] + ldr r1, [r0, 0xC] + lsls r1, 2 + adds r0, 0x14 + adds r0, r1 + ldr r1, [r0] + ldr r0, _0801FA50 + ldr r1, [r1] + bl strcpy + ldr r2, _0801FA54 + ldr r0, [r5] + ldr r3, [r0, 0x5C] + movs r4, 0 + str r4, [sp] + movs r0, 0x10 + movs r1, 0 + bl sub_8014FF0 + ldr r3, [r5] + ldr r1, [r3, 0xC] + lsls r1, 2 + adds r0, r3, 0 + adds r0, 0x14 + adds r0, r1 + ldr r0, [r0] + ldr r2, [r0, 0x4] + ldr r3, [r3, 0x5C] + str r4, [sp] + movs r0, 0x4 + movs r1, 0x10 + bl sub_8014FF0 + ldr r0, [r5] + ldr r0, [r0, 0x5C] + bl sub_80073E0 +_0801FA48: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0801FA50: .4byte gUnknown_202DF98 +_0801FA54: .4byte gUnknown_80DC310 + thumb_func_end sub_801F9A4 + + thumb_func_start sub_801FA58 +sub_801FA58: + push {r4,lr} + ldr r0, _0801FAA4 + ldr r2, [r0] + ldr r1, [r2, 0x10] + adds r4, r0, 0 + cmp r1, 0 + beq _0801FA7C + ldr r0, [r2, 0x24] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0801FA74 + bl sub_8013F84 +_0801FA74: + ldr r1, [r4] + ldr r0, [r1, 0x24] + adds r0, 0x1 + str r0, [r1, 0x24] +_0801FA7C: + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0xC8 + ldr r1, [r1, 0x5C] + bl sub_8012A64 + cmp r0, 0x1 + beq _0801FAA8 + cmp r0, 0x2 + beq _0801FAC2 + ldr r0, [r4] + adds r0, 0x28 + bl sub_8013938 + lsls r0, 24 + cmp r0, 0 + beq _0801FACE + movs r0, 0 + b _0801FACA + .align 2, 0 +_0801FAA4: .4byte gUnknown_203B278 +_0801FAA8: + movs r0, 0 + bl sub_80119D4 + ldr r1, [r4] + ldr r0, [r1, 0x10] + cmp r0, 0 + beq _0801FABE + movs r0, 0 + str r0, [r1, 0xC] + movs r0, 0x1 + b _0801FACA +_0801FABE: + movs r0, 0x3 + b _0801FACA +_0801FAC2: + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 +_0801FACA: + bl sub_801F918 +_0801FACE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_801FA58 + + thumb_func_start sub_801FAD4 +sub_801FAD4: + push {r4,lr} + ldr r0, _0801FB14 + ldr r3, [r0] + ldr r1, [r3, 0x10] + subs r1, 0x1 + ldr r2, [r3, 0xC] + adds r4, r0, 0 + cmp r2, r1 + bge _0801FAFC + ldr r0, [r3, 0x24] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0801FAF4 + bl sub_8013F84 +_0801FAF4: + ldr r1, [r4] + ldr r0, [r1, 0x24] + adds r0, 0x1 + str r0, [r1, 0x24] +_0801FAFC: + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0xC8 + ldr r1, [r1, 0x5C] + bl sub_8012A64 + cmp r0, 0x1 + beq _0801FB18 + cmp r0, 0x2 + beq _0801FB3C + b _0801FB48 + .align 2, 0 +_0801FB14: .4byte gUnknown_203B278 +_0801FB18: + movs r0, 0 + bl sub_80119D4 + ldr r0, [r4] + ldr r1, [r0, 0xC] + adds r1, 0x1 + str r1, [r0, 0xC] + ldr r0, [r0, 0x10] + cmp r1, r0 + bge _0801FB34 + movs r0, 0x1 + bl sub_801F918 + b _0801FB48 +_0801FB34: + movs r0, 0 + bl sub_801F918 + b _0801FB48 +_0801FB3C: + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + bl sub_801F918 +_0801FB48: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_801FAD4 + + thumb_func_start sub_801FB50 +sub_801FB50: + push {r4-r7,lr} + adds r4, r0, 0 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r6, _0801FBC0 + movs r0, 0xF0 + lsls r0, 1 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r6] + movs r7, 0 + str r7, [r0, 0x70] + str r7, [r0, 0x74] + str r7, [r0, 0x78] + str r4, [r0] + strb r7, [r0, 0x15] + ldr r0, _0801FBC4 + ldr r4, _0801FBC8 + adds r1, r4, 0 + bl sub_808D8E0 + ldr r5, _0801FBCC + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_808D8E0 + adds r0, r4, 0 + bl sub_808D994 + adds r1, r0, 0 + adds r0, r5, 0 + subs r0, 0x50 + bl strcpy + subs r5, 0xF0 + bl sub_808D33C + adds r1, r0, 0 + adds r0, r5, 0 + bl sub_808DA34 + ldr r2, [r6] + ldr r0, [r2] + cmp r0, 0x1 + bne _0801FBD0 + movs r1, 0xBE + lsls r1, 1 + adds r0, r2, r1 + str r7, [r0] + b _0801FBDE + .align 2, 0 +_0801FBC0: .4byte gUnknown_203B27C +_0801FBC4: .4byte gUnknown_202E5D8 +_0801FBC8: .4byte 0x00000155 +_0801FBCC: .4byte gUnknown_202E1C8 +_0801FBD0: + movs r3, 0xBE + lsls r3, 1 + adds r1, r2, r3 + movs r4, 0xB6 + lsls r4, 1 + adds r0, r2, r4 + str r0, [r1] +_0801FBDE: + ldr r0, _0801FC34 + bl sub_808DDD0 + ldr r2, _0801FC38 + ldr r3, [r2] + movs r4, 0xB6 + lsls r4, 1 + adds r1, r3, r4 + str r0, [r1] + adds r4, 0x4 + adds r1, r3, r4 + ldr r0, [r0, 0x4] + str r0, [r1] + movs r1, 0xBC + lsls r1, 1 + adds r0, r3, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + ldr r3, _0801FC3C + adds r0, r3 + strb r1, [r0] + ldr r0, [r2] + adds r4, 0xA + adds r0, r4 + strb r1, [r0] + ldr r2, [r2] + movs r0, 0xBA + lsls r0, 1 + adds r1, r2, r0 + movs r0, 0x2 + strh r0, [r1] + subs r3, 0x3 + adds r1, r2, r3 + movs r0, 0x8 + strh r0, [r1] + movs r0, 0 + bl sub_801FDA8 + movs r0, 0x1 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0801FC34: .4byte 0x00000155 +_0801FC38: .4byte gUnknown_203B27C +_0801FC3C: .4byte 0x00000179 + thumb_func_end sub_801FB50 + + thumb_func_start sub_801FC40 +sub_801FC40: + push {lr} + ldr r1, _0801FC5C + ldr r0, [r1] + ldr r0, [r0, 0x4] + adds r2, r1, 0 + cmp r0, 0x22 + bls _0801FC50 + b _0801FD70 +_0801FC50: + lsls r0, 2 + ldr r1, _0801FC60 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801FC5C: .4byte gUnknown_203B27C +_0801FC60: .4byte _0801FC64 + .align 2, 0 +_0801FC64: + .4byte _0801FCF0 + .4byte _0801FCF0 + .4byte _0801FCF6 + .4byte _0801FD70 + .4byte _0801FD70 + .4byte _0801FD70 + .4byte _0801FD70 + .4byte _0801FCFC + .4byte _0801FD02 + .4byte _0801FD70 + .4byte _0801FD70 + .4byte _0801FD70 + .4byte _0801FD70 + .4byte _0801FD50 + .4byte _0801FD70 + .4byte _0801FD08 + .4byte _0801FD08 + .4byte _0801FD0E + .4byte _0801FD14 + .4byte _0801FD1A + .4byte _0801FD70 + .4byte _0801FD20 + .4byte _0801FD20 + .4byte _0801FD26 + .4byte _0801FD2C + .4byte _0801FD70 + .4byte _0801FD70 + .4byte _0801FD70 + .4byte _0801FD70 + .4byte _0801FD32 + .4byte _0801FD38 + .4byte _0801FD38 + .4byte _0801FD3E + .4byte _0801FD44 + .4byte _0801FD4A +_0801FCF0: + bl sub_8021154 + b _0801FD74 +_0801FCF6: + bl sub_80209AC + b _0801FD74 +_0801FCFC: + bl sub_80209FC + b _0801FD74 +_0801FD02: + bl sub_8020A34 + b _0801FD74 +_0801FD08: + bl sub_8020A80 + b _0801FD74 +_0801FD0E: + bl sub_8020B38 + b _0801FD74 +_0801FD14: + bl sub_8020C2C + b _0801FD74 +_0801FD1A: + bl sub_8020C48 + b _0801FD74 +_0801FD20: + bl sub_8020C64 + b _0801FD74 +_0801FD26: + bl sub_8020CC0 + b _0801FD74 +_0801FD2C: + bl sub_8020D74 + b _0801FD74 +_0801FD32: + bl sub_8020D90 + b _0801FD74 +_0801FD38: + bl sub_8020DCC + b _0801FD74 +_0801FD3E: + bl sub_8020EB4 + b _0801FD74 +_0801FD44: + bl sub_80210C8 + b _0801FD74 +_0801FD4A: + bl sub_80210E4 + b _0801FD74 +_0801FD50: + ldr r0, [r2] + ldrb r0, [r0, 0x15] + cmp r0, 0x1 + bne _0801FD68 + ldr r0, _0801FD6C + ldr r1, [r0] + movs r0, 0x98 + lsls r0, 2 + adds r1, r0 + ldr r0, [r1] + subs r0, 0x96 + str r0, [r1] +_0801FD68: + movs r0, 0x3 + b _0801FD76 + .align 2, 0 +_0801FD6C: .4byte gUnknown_203B460 +_0801FD70: + bl sub_8021130 +_0801FD74: + movs r0, 0 +_0801FD76: + pop {r1} + bx r1 + thumb_func_end sub_801FC40 + + thumb_func_start sub_801FD7C +sub_801FD7C: + push {r4,lr} + ldr r4, _0801FDA4 + ldr r0, [r4] + cmp r0, 0 + beq _0801FD9C + movs r1, 0xB6 + lsls r1, 1 + adds r0, r1 + ldr r0, [r0] + bl sub_800AA14 + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0801FD9C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0801FDA4: .4byte gUnknown_203B27C + thumb_func_end sub_801FD7C + + thumb_func_start sub_801FDA8 +sub_801FDA8: + push {lr} + ldr r1, _0801FDBC + ldr r1, [r1] + str r0, [r1, 0x4] + bl sub_801FDC0 + bl sub_801FF28 + pop {r0} + bx r0 + .align 2, 0 +_0801FDBC: .4byte gUnknown_203B27C + thumb_func_end sub_801FDA8 + + thumb_func_start sub_801FDC0 +sub_801FDC0: + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, _0801FDE8 + ldr r0, [r4] + movs r5, 0xC0 + lsls r5, 1 + adds r0, r5 + bl sub_8006518 + ldr r0, [r4] + ldr r1, [r0, 0x4] + cmp r1, 0x11 + beq _0801FE38 + cmp r1, 0x11 + bgt _0801FDEC + cmp r1, 0x2 + beq _0801FDF6 + b _0801FED4 + .align 2, 0 +_0801FDE8: .4byte gUnknown_203B27C +_0801FDEC: + cmp r1, 0x17 + beq _0801FE6C + cmp r1, 0x20 + beq _0801FE88 + b _0801FED4 +_0801FDF6: + adds r0, r5 + movs r1, 0x80 + strb r1, [r0] + ldr r0, [r4] + movs r2, 0xCC + lsls r2, 1 + adds r0, r2 + strb r1, [r0] + ldr r0, [r4] + movs r3, 0xD8 + lsls r3, 1 + adds r0, r3 + strb r1, [r0] + ldr r1, [r4] + movs r6, 0xE4 + lsls r6, 1 + adds r1, r6 + ldr r0, _0801FE34 + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r6,r7} + stm r1!, {r2,r6,r7} + bl sub_8004914 + ldr r0, [r4] + adds r0, r5 + movs r1, 0x1 + movs r2, 0 + bl sub_800641C + b _0801FF14 + .align 2, 0 +_0801FE34: .4byte gUnknown_80DC37C +_0801FE38: + bl sub_80205D0 + ldr r2, [r4] + movs r0, 0xD8 + lsls r0, 1 + adds r2, r0 + ldr r1, _0801FE68 + ldm r1!, {r3,r5,r6} + stm r2!, {r3,r5,r6} + ldm r1!, {r3,r5,r7} + stm r2!, {r3,r5,r7} + ldr r1, [r4] + adds r0, r1, r0 + adds r1, 0x7C + bl sub_8012CAC + bl sub_8004914 + ldr r0, [r4] + movs r6, 0xC0 + lsls r6, 1 + adds r0, r6 + b _0801FEC2 + .align 2, 0 +_0801FE68: .4byte gUnknown_80DC334 +_0801FE6C: + bl sub_802069C + ldr r2, [r4] + movs r0, 0xD8 + lsls r0, 1 + adds r2, r0 + ldr r1, _0801FE84 + ldm r1!, {r3,r6,r7} + stm r2!, {r3,r6,r7} + ldm r1!, {r3,r6,r7} + stm r2!, {r3,r6,r7} + b _0801FEB0 + .align 2, 0 +_0801FE84: .4byte gUnknown_80DC334 +_0801FE88: + bl sub_802074C + ldr r1, [r4] + movs r7, 0xCC + lsls r7, 1 + adds r1, r7 + ldr r0, _0801FECC + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldr r2, [r4] + movs r0, 0xD8 + lsls r0, 1 + adds r2, r0 + ldr r1, _0801FED0 + ldm r1!, {r3,r6,r7} + stm r2!, {r3,r6,r7} + ldm r1!, {r3,r6,r7} + stm r2!, {r3,r6,r7} +_0801FEB0: + ldr r1, [r4] + adds r0, r1, r0 + adds r1, 0x7C + bl sub_8012CAC + bl sub_8004914 + ldr r0, [r4] + adds r0, r5 +_0801FEC2: + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + b _0801FF14 + .align 2, 0 +_0801FECC: .4byte gUnknown_80DC31C +_0801FED0: .4byte gUnknown_80DC34C +_0801FED4: + ldr r5, _0801FF20 + mov r12, r5 + movs r6, 0xC0 + lsls r6, 1 + mov r8, r6 + ldr r4, _0801FF24 + movs r3, 0 + movs r2, 0x3 +_0801FEE4: + mov r7, r12 + ldr r1, [r7] + adds r1, r3 + add r1, r8 + adds r0, r4, 0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r3, 0x18 + subs r2, 0x1 + cmp r2, 0 + bge _0801FEE4 + bl sub_8004914 + ldr r0, _0801FF20 + ldr r0, [r0] + movs r1, 0xC0 + lsls r1, 1 + adds r0, r1 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C +_0801FF14: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0801FF20: .4byte gUnknown_203B27C +_0801FF24: .4byte gUnknown_80DC31C + thumb_func_end sub_801FDC0 + + thumb_func_start sub_801FF28 +sub_801FF28: + push {r4,r5,lr} + sub sp, 0x14 + ldr r1, _0801FF44 + ldr r0, [r1] + ldr r0, [r0, 0x4] + adds r5, r1, 0 + cmp r0, 0x23 + bls _0801FF3A + b _08020562 +_0801FF3A: + lsls r0, 2 + ldr r1, _0801FF48 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0801FF44: .4byte gUnknown_203B27C +_0801FF48: .4byte _0801FF4C + .align 2, 0 +_0801FF4C: + .4byte _0801FFDC + .4byte _08020018 + .4byte _08020064 + .4byte _0802006C + .4byte _08020090 + .4byte _080200B4 + .4byte _080200D8 + .4byte _080200FC + .4byte _08020144 + .4byte _0802018C + .4byte _080201B0 + .4byte _080201D4 + .4byte _080201F8 + .4byte _08020562 + .4byte _0802021C + .4byte _08020240 + .4byte _0802024E + .4byte _08020256 + .4byte _08020274 + .4byte _08020282 + .4byte _0802028E + .4byte _080202B0 + .4byte _080202BE + .4byte _080202C6 + .4byte _080202E4 + .4byte _08020304 + .4byte _08020344 + .4byte _080203B0 + .4byte _080203D4 + .4byte _0802038C + .4byte _080203F8 + .4byte _08020428 + .4byte _08020434 + .4byte _08020460 + .4byte _08020478 + .4byte _08020500 +_0801FFDC: + ldr r0, [r5] + movs r4, 0x2 + str r4, [r0, 0x6C] + bl sub_8020574 + ldr r5, [r5] + str r4, [r5, 0x8] + ldr r2, _08020014 + ldr r1, [r5] + movs r0, 0x64 + muls r0, r1 + adds r0, r2 + ldr r0, [r0] + ldr r2, [r5, 0x6C] + adds r3, r5, 0 + adds r3, 0x7C + adds r1, r5, 0 + adds r1, 0xBC + str r1, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r4, 0xBE + lsls r4, 1 + adds r1, r5, r4 + b _0802004C + .align 2, 0 +_08020014: .4byte gUnknown_80D8888 +_08020018: + bl sub_8020574 + ldr r0, _0802005C + ldr r4, [r0] + movs r0, 0x2 + str r0, [r4, 0x8] + ldr r1, _08020060 + ldr r2, [r4] + movs r0, 0x64 + muls r0, r2 + adds r1, 0x4 + adds r0, r1 + ldr r0, [r0] + ldr r2, [r4, 0x6C] + adds r3, r4, 0 + adds r3, 0x7C + adds r1, r4, 0 + adds r1, 0xBC + str r1, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r5, 0xBE + lsls r5, 1 + adds r1, r4, r5 +_0802004C: + ldr r1, [r1] + str r1, [sp, 0xC] + movs r1, 0xC + str r1, [sp, 0x10] + movs r1, 0 + bl sub_8014248 + b _08020562 + .align 2, 0 +_0802005C: .4byte gUnknown_203B27C +_08020060: .4byte gUnknown_80D8888 +_08020064: + movs r0, 0x3 + bl sub_8016C40 + b _08020562 +_0802006C: + ldr r2, [r5] + movs r0, 0x1F + str r0, [r2, 0x8] + ldr r1, _0802008C + ldr r3, [r2] + movs r0, 0x64 + muls r0, r3 + adds r1, 0x8 + adds r0, r1 + ldr r0, [r0] + movs r1, 0xBE + lsls r1, 1 + adds r2, r1 + ldr r2, [r2] + b _0802052C + .align 2, 0 +_0802008C: .4byte gUnknown_80D8888 +_08020090: + ldr r2, [r5] + movs r0, 0x1F + str r0, [r2, 0x8] + ldr r1, _080200B0 + ldr r3, [r2] + movs r0, 0x64 + muls r0, r3 + adds r1, 0xC + adds r0, r1 + ldr r0, [r0] + movs r4, 0xBE + lsls r4, 1 + adds r2, r4 + ldr r2, [r2] + b _0802052C + .align 2, 0 +_080200B0: .4byte gUnknown_80D8888 +_080200B4: + ldr r2, [r5] + movs r0, 0x1F + str r0, [r2, 0x8] + ldr r1, _080200D4 + ldr r3, [r2] + movs r0, 0x64 + muls r0, r3 + adds r1, 0x10 + adds r0, r1 + ldr r0, [r0] + movs r5, 0xBE + lsls r5, 1 + adds r2, r5 + ldr r2, [r2] + b _0802052C + .align 2, 0 +_080200D4: .4byte gUnknown_80D8888 +_080200D8: + ldr r2, [r5] + movs r0, 0x1F + str r0, [r2, 0x8] + ldr r1, _080200F8 + ldr r3, [r2] + movs r0, 0x64 + muls r0, r3 + adds r1, 0x14 + adds r0, r1 + ldr r0, [r0] + movs r1, 0xBE + lsls r1, 1 + adds r2, r1 + ldr r2, [r2] + b _0802052C + .align 2, 0 +_080200F8: .4byte gUnknown_80D8888 +_080200FC: + bl sub_8020900 + ldr r1, _0802013C + ldr r0, _08020140 + ldr r4, [r0] + ldr r2, [r4] + movs r0, 0x64 + muls r0, r2 + adds r1, 0x18 + adds r0, r1 + ldr r0, [r0] + adds r3, r4, 0 + adds r3, 0x7C + adds r1, r4, 0 + adds r1, 0xBC + str r1, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r2, 0xBE + lsls r2, 1 + adds r1, r4, r2 + ldr r1, [r1] + str r1, [sp, 0xC] + movs r1, 0xC + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0x10 + bl sub_8014248 + b _08020562 + .align 2, 0 +_0802013C: .4byte gUnknown_80D8888 +_08020140: .4byte gUnknown_203B27C +_08020144: + bl sub_8020950 + ldr r1, _08020184 + ldr r0, _08020188 + ldr r4, [r0] + ldr r2, [r4] + movs r0, 0x64 + muls r0, r2 + adds r1, 0x54 + adds r0, r1 + ldr r0, [r0] + adds r3, r4, 0 + adds r3, 0x7C + adds r1, r4, 0 + adds r1, 0xBC + str r1, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r5, 0xBE + lsls r5, 1 + adds r1, r4, r5 + ldr r1, [r1] + str r1, [sp, 0xC] + movs r1, 0xC + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0xD + bl sub_8014248 + b _08020562 + .align 2, 0 +_08020184: .4byte gUnknown_80D8888 +_08020188: .4byte gUnknown_203B27C +_0802018C: + ldr r2, [r5] + movs r0, 0x1 + str r0, [r2, 0x8] + ldr r1, _080201AC + ldr r3, [r2] + movs r0, 0x64 + muls r0, r3 + adds r1, 0x58 + adds r0, r1 + ldr r0, [r0] + movs r1, 0xBE + lsls r1, 1 + adds r2, r1 + ldr r2, [r2] + b _0802052C + .align 2, 0 +_080201AC: .4byte gUnknown_80D8888 +_080201B0: + ldr r2, [r5] + movs r0, 0x1 + str r0, [r2, 0x8] + ldr r1, _080201D0 + ldr r3, [r2] + movs r0, 0x64 + muls r0, r3 + adds r1, 0x5C + adds r0, r1 + ldr r0, [r0] + movs r4, 0xBE + lsls r4, 1 + adds r2, r4 + ldr r2, [r2] + b _0802052C + .align 2, 0 +_080201D0: .4byte gUnknown_80D8888 +_080201D4: + ldr r2, [r5] + movs r0, 0x1 + str r0, [r2, 0x8] + ldr r1, _080201F4 + ldr r3, [r2] + movs r0, 0x64 + muls r0, r3 + adds r1, 0x60 + adds r0, r1 + ldr r0, [r0] + movs r5, 0xBE + lsls r5, 1 + adds r2, r5 + ldr r2, [r2] + b _0802052C + .align 2, 0 +_080201F4: .4byte gUnknown_80D8888 +_080201F8: + ldr r2, [r5] + movs r0, 0xD + str r0, [r2, 0x8] + ldr r1, _08020218 + ldr r3, [r2] + movs r0, 0x64 + muls r0, r3 + adds r1, 0x1C + adds r0, r1 + ldr r0, [r0] + movs r1, 0xBE + lsls r1, 1 + adds r2, r1 + ldr r2, [r2] + b _0802052C + .align 2, 0 +_08020218: .4byte gUnknown_80D8888 +_0802021C: + ldr r2, [r5] + movs r0, 0xF + str r0, [r2, 0x8] + ldr r1, _0802023C + ldr r3, [r2] + movs r0, 0x64 + muls r0, r3 + adds r1, 0x20 + adds r0, r1 + ldr r0, [r0] + movs r4, 0xBE + lsls r4, 1 + adds r2, r4 + ldr r2, [r2] + b _0802052C + .align 2, 0 +_0802023C: .4byte gUnknown_80D8888 +_08020240: + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + movs r3, 0xA + bl sub_8023868 + b _08020562 +_0802024E: + movs r0, 0x1 + bl sub_8023B7C + b _08020562 +_08020256: + bl sub_8023DA4 + ldr r0, _08020270 + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0xCC + adds r1, r2, 0 + adds r1, 0x7C + adds r3, r2, 0 + adds r3, 0xBC + ldr r2, [r2, 0x70] + b _0802044C + .align 2, 0 +_08020270: .4byte gUnknown_203B27C +_08020274: + ldr r0, [r5] + movs r5, 0xC + ldrsh r0, [r0, r5] + movs r1, 0x2 + bl sub_8024458 + b _08020562 +_08020282: + ldr r0, [r5] + movs r1, 0xC + ldrsh r0, [r0, r1] + bl sub_801BEEC + b _08020562 +_0802028E: + ldr r2, [r5] + movs r0, 0x15 + str r0, [r2, 0x8] + ldr r1, _080202AC + ldr r3, [r2] + movs r0, 0x64 + muls r0, r3 + adds r1, 0x24 + adds r0, r1 + ldr r0, [r0] + movs r4, 0xBE + lsls r4, 1 + adds r2, r4 + ldr r2, [r2] + b _0802052C + .align 2, 0 +_080202AC: .4byte gUnknown_80D8888 +_080202B0: + ldr r0, [r5] + movs r5, 0xC + ldrsh r0, [r0, r5] + movs r1, 0 + bl sub_801F428 + b _08020562 +_080202BE: + movs r0, 0x1 + bl sub_801F5F0 + b _08020562 +_080202C6: + bl sub_801F700 + ldr r0, _080202E0 + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0xCC + adds r1, r2, 0 + adds r1, 0x7C + adds r3, r2, 0 + adds r3, 0xBC + ldr r2, [r2, 0x74] + b _0802044C + .align 2, 0 +_080202E0: .4byte gUnknown_203B27C +_080202E4: + ldr r0, [r5] + ldrh r1, [r0, 0x1C] + adds r0, 0x64 + strh r1, [r0] + movs r2, 0x1 + adds r4, r5, 0 + movs r3, 0 +_080202F2: + ldr r0, [r4] + lsls r1, r2, 1 + adds r0, 0x64 + adds r0, r1 + strh r3, [r0] + adds r2, 0x1 + cmp r2, 0x3 + ble _080202F2 + b _0802046E +_08020304: + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0x24 + ldr r1, [r1, 0x10] + adds r1, 0x2C + bl sub_8094060 + ldr r1, [r5] + movs r0, 0x10 + str r0, [r1, 0x8] + ldr r0, _0802033C + ldrh r1, [r1, 0x1E] + bl sub_8092C84 + ldr r1, _08020340 + ldr r2, [r5] + ldr r3, [r2] + movs r0, 0x64 + muls r0, r3 + adds r1, 0x28 + adds r0, r1 + ldr r0, [r0] + movs r1, 0xBE + lsls r1, 1 + adds r2, r1 + ldr r2, [r2] + b _0802052C + .align 2, 0 +_0802033C: .4byte gUnknown_202DF98 +_08020340: .4byte gUnknown_80D8888 +_08020344: + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0x24 + ldr r1, [r1, 0x10] + adds r1, 0x2C + bl sub_8094060 + ldr r3, [r5] + movs r0, 0x10 + str r0, [r3, 0x8] + ldrb r0, [r3, 0x14] + cmp r0, 0 + beq _08020370 + ldr r1, _0802036C + ldr r2, [r3] + movs r0, 0x64 + muls r0, r2 + adds r1, 0x38 + b _08020520 + .align 2, 0 +_0802036C: .4byte gUnknown_80D8888 +_08020370: + ldr r1, _08020388 + ldr r2, [r3] + movs r0, 0x64 + muls r0, r2 + adds r1, 0x34 + adds r0, r1 + ldr r0, [r0] + movs r4, 0xBE + lsls r4, 1 + adds r1, r3, r4 + b _0802052A + .align 2, 0 +_08020388: .4byte gUnknown_80D8888 +_0802038C: + ldr r2, [r5] + ldr r0, [r2] + cmp r0, 0 + bne _080203A2 + movs r5, 0xC + ldrsh r1, [r2, r5] + adds r2, 0x24 + movs r0, 0 + bl sub_801E80C + b _08020562 +_080203A2: + movs r0, 0xC + ldrsh r1, [r2, r0] + adds r2, 0x24 + movs r0, 0x1 + bl sub_801E80C + b _08020562 +_080203B0: + ldr r2, [r5] + movs r0, 0x10 + str r0, [r2, 0x8] + ldr r1, _080203D0 + ldr r3, [r2] + movs r0, 0x64 + muls r0, r3 + adds r1, 0x3C + adds r0, r1 + ldr r0, [r0] + movs r1, 0xBE + lsls r1, 1 + adds r2, r1 + ldr r2, [r2] + b _0802052C + .align 2, 0 +_080203D0: .4byte gUnknown_80D8888 +_080203D4: + ldr r2, [r5] + movs r0, 0x10 + str r0, [r2, 0x8] + ldr r1, _080203F4 + ldr r3, [r2] + movs r0, 0x64 + muls r0, r3 + adds r1, 0x40 + adds r0, r1 + ldr r0, [r0] + movs r4, 0xBE + lsls r4, 1 + adds r2, r4 + ldr r2, [r2] + b _0802052C + .align 2, 0 +_080203F4: .4byte gUnknown_80D8888 +_080203F8: + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0x24 + ldr r1, [r1, 0x10] + adds r1, 0x2C + bl sub_809401C + ldr r0, [r5] + movs r5, 0xC + ldrsh r1, [r0, r5] + adds r2, r0, 0 + adds r2, 0x24 + ldrb r3, [r0, 0x15] + ldr r0, _08020424 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + movs r0, 0x1 + bl sub_801EE10 + b _08020562 + .align 2, 0 +_08020424: .4byte gUnknown_80DC394 +_08020428: + ldr r0, [r5] + ldrb r1, [r0, 0x15] + movs r0, 0x1 + bl sub_801F1B0 + b _08020562 +_08020434: + movs r0, 0 + bl sub_801F280 + ldr r0, _0802045C + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0xCC + adds r1, r2, 0 + adds r1, 0x7C + adds r3, r2, 0 + adds r3, 0xBC + ldr r2, [r2, 0x78] +_0802044C: + str r2, [sp] + movs r2, 0x2 + str r2, [sp, 0x4] + movs r2, 0 + bl sub_8012D60 + b _08020562 + .align 2, 0 +_0802045C: .4byte gUnknown_203B27C +_08020460: + ldr r2, [r5] + ldr r0, [r2, 0x18] + adds r1, r2, 0 + adds r1, 0x24 + adds r2, 0x64 + bl sub_8093560 +_0802046E: + ldr r0, [r5] + adds r0, 0x64 + bl sub_801F808 + b _08020562 +_08020478: + bl sub_80208B0 + ldr r0, _080204B8 + ldr r4, _080204BC + ldr r1, [r4] + ldrh r1, [r1, 0x20] + bl sub_8092C84 + ldr r4, [r4] + ldrb r5, [r4, 0x14] + cmp r5, 0 + beq _080204C4 + ldr r1, _080204C0 + ldr r2, [r4] + movs r0, 0x64 + muls r0, r2 + adds r1, 0x48 + adds r0, r1 + ldr r0, [r0] + adds r3, r4, 0 + adds r3, 0x7C + adds r1, r4, 0 + adds r1, 0xBC + str r1, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + movs r2, 0xBE + lsls r2, 1 + adds r1, r4, r2 + b _080204E8 + .align 2, 0 +_080204B8: .4byte gUnknown_202DFE8 +_080204BC: .4byte gUnknown_203B27C +_080204C0: .4byte gUnknown_80D8888 +_080204C4: + ldr r1, _080204FC + ldr r2, [r4] + movs r0, 0x64 + muls r0, r2 + adds r1, 0x44 + adds r0, r1 + ldr r0, [r0] + adds r3, r4, 0 + adds r3, 0x7C + adds r1, r4, 0 + adds r1, 0xBC + str r1, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r5, [sp, 0x8] + movs r5, 0xBE + lsls r5, 1 + adds r1, r4, r5 +_080204E8: + ldr r1, [r1] + str r1, [sp, 0xC] + movs r1, 0xC + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0x11 + bl sub_8014248 + b _08020562 + .align 2, 0 +_080204FC: .4byte gUnknown_80D8888 +_08020500: + ldr r1, [r5] + movs r0, 0x1F + str r0, [r1, 0x8] + ldr r0, _08020538 + ldrh r1, [r1, 0x20] + bl sub_8092C84 + ldr r3, [r5] + ldrb r0, [r3, 0x14] + cmp r0, 0 + beq _08020544 + ldr r1, _0802053C + ldr r2, [r3] + movs r0, 0x64 + muls r0, r2 + adds r1, 0x50 +_08020520: + adds r0, r1 + ldr r0, [r0] + movs r2, 0xBE + lsls r2, 1 + adds r1, r3, r2 +_0802052A: + ldr r2, [r1] +_0802052C: + ldr r3, _08020540 + movs r1, 0 + bl sub_80141B4 + b _08020562 + .align 2, 0 +_08020538: .4byte gUnknown_202DFE8 +_0802053C: .4byte gUnknown_80D8888 +_08020540: .4byte 0x0000010d +_08020544: + ldr r1, _0802056C + ldr r2, [r3] + movs r0, 0x64 + muls r0, r2 + adds r1, 0x4C + adds r0, r1 + ldr r0, [r0] + movs r4, 0xBE + lsls r4, 1 + adds r1, r3, r4 + ldr r2, [r1] + ldr r3, _08020570 + movs r1, 0 + bl sub_80141B4 +_08020562: + add sp, 0x14 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802056C: .4byte gUnknown_80D8888 +_08020570: .4byte 0x0000010d + thumb_func_end sub_801FF28 + + thumb_func_start sub_8020574 +sub_8020574: + push {r4,lr} + ldr r4, _080205C0 + ldr r0, [r4] + adds r0, 0xBC + movs r1, 0 + movs r2, 0x10 + bl MemoryFill16 + ldr r4, [r4] + movs r3, 0 + ldr r0, _080205C4 + str r0, [r4, 0x7C] + adds r1, r4, 0 + adds r1, 0x80 + movs r0, 0x2 + str r0, [r1] + movs r2, 0x1 + adds r1, 0x4 + ldr r0, _080205C8 + str r0, [r1] + adds r1, 0x4 + movs r0, 0xB + str r0, [r1] + adds r1, 0x4 + ldr r0, _080205CC + ldr r0, [r0] + str r0, [r1] + adds r0, r4, 0 + adds r0, 0x90 + str r2, [r0] + adds r0, 0x4 + str r3, [r0] + adds r0, 0x4 + str r2, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080205C0: .4byte gUnknown_203B27C +_080205C4: .4byte gUnknown_80DC3C4 +_080205C8: .4byte gUnknown_80DC3CC +_080205CC: .4byte gUnknown_80D4934 + thumb_func_end sub_8020574 + + thumb_func_start sub_80205D0 +sub_80205D0: + push {r4-r7,lr} + ldr r4, _08020660 + ldr r0, [r4] + adds r0, 0xBC + movs r1, 0 + movs r2, 0x10 + bl MemoryFill16 + ldr r0, [r4] + mov r12, r0 + movs r5, 0 + ldr r0, _08020664 + mov r1, r12 + str r0, [r1, 0x7C] + mov r2, r12 + adds r2, 0x80 + movs r0, 0x4 + str r0, [r2] + movs r3, 0x1 + adds r1, 0x84 + ldr r0, _08020668 + str r0, [r1] + adds r1, 0x4 + movs r0, 0xB + str r0, [r1] + adds r1, 0x4 + ldr r0, _0802066C + str r0, [r1] + adds r1, 0x4 + movs r0, 0xC + str r0, [r1] + movs r6, 0x3 + adds r1, 0x4 + ldr r0, _08020670 + str r0, [r1] + mov r0, r12 + adds r0, 0x98 + str r6, [r0] + movs r6, 0x4 + adds r0, 0x4 + str r5, [r0] + adds r0, 0x4 + str r3, [r0] + mov r3, r12 + adds r3, 0xBC +_0802062A: + ldrh r0, [r3] + cmp r0, 0 + bne _0802063A + ldr r1, [r2] + mov r7, r12 + ldr r0, [r7, 0x70] + cmp r1, r0 + beq _08020696 +_0802063A: + adds r2, 0x8 + adds r3, 0x2 + adds r5, 0x1 + cmp r5, r6 + blt _0802062A + movs r5, 0 + cmp r5, r6 + bge _08020696 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0xBC + ldrh r0, [r0] + cmp r0, 0 + bne _08020674 + adds r0, r1, 0 + adds r0, 0x80 + ldr r0, [r0] + str r0, [r1, 0x70] + b _08020696 + .align 2, 0 +_08020660: .4byte gUnknown_203B27C +_08020664: .4byte gUnknown_80DC3D8 +_08020668: .4byte gUnknown_80DC3E0 +_0802066C: .4byte gUnknown_80DC3E8 +_08020670: .4byte gUnknown_80DC3F4 +_08020674: + adds r5, 0x1 + cmp r5, r6 + bge _08020696 + ldr r2, [r4] + lsls r0, r5, 1 + adds r1, r2, 0 + adds r1, 0xBC + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _08020674 + lsls r0, r5, 3 + adds r1, r2, 0 + adds r1, 0x80 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x70] +_08020696: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80205D0 + + thumb_func_start sub_802069C +sub_802069C: + push {r4-r7,lr} + ldr r4, _08020718 + ldr r0, [r4] + adds r0, 0xBC + movs r1, 0 + movs r2, 0x10 + bl MemoryFill16 + ldr r0, [r4] + mov r12, r0 + movs r5, 0 + ldr r0, _0802071C + mov r1, r12 + str r0, [r1, 0x7C] + mov r3, r12 + adds r3, 0x80 + movs r0, 0x3 + str r0, [r3] + movs r2, 0x1 + adds r1, 0x84 + ldr r0, _08020720 + ldr r0, [r0] + str r0, [r1] + adds r1, 0x4 + movs r0, 0xB + str r0, [r1] + movs r6, 0x2 + mov r0, r12 + adds r0, 0x8C + str r5, [r0] + adds r0, 0x4 + str r2, [r0] + mov r2, r12 + adds r2, 0xBC +_080206E0: + ldrh r0, [r2] + cmp r0, 0 + bne _080206F0 + ldr r1, [r3] + mov r7, r12 + ldr r0, [r7, 0x74] + cmp r1, r0 + beq _08020746 +_080206F0: + adds r3, 0x8 + adds r2, 0x2 + adds r5, 0x1 + cmp r5, r6 + blt _080206E0 + movs r5, 0 + cmp r5, r6 + bge _08020746 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0xBC + ldrh r0, [r0] + cmp r0, 0 + bne _08020724 + adds r0, r1, 0 + adds r0, 0x80 + ldr r0, [r0] + str r0, [r1, 0x74] + b _08020746 + .align 2, 0 +_08020718: .4byte gUnknown_203B27C +_0802071C: .4byte gUnknown_80DC3F4 +_08020720: .4byte gUnknown_80D4970 +_08020724: + adds r5, 0x1 + cmp r5, r6 + bge _08020746 + ldr r2, [r4] + lsls r0, r5, 1 + adds r1, r2, 0 + adds r1, 0xBC + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _08020724 + lsls r0, r5, 3 + adds r1, r2, 0 + adds r1, 0x80 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x74] +_08020746: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_802069C + + thumb_func_start sub_802074C +sub_802074C: + push {r4-r7,lr} + movs r7, 0 + ldr r4, _08020780 + ldr r0, [r4] + adds r0, 0xBC + movs r1, 0 + movs r2, 0x10 + bl MemoryFill16 + ldr r1, [r4] + ldrb r0, [r1, 0x16] + cmp r0, 0 + beq _0802079C + ldr r0, [r1, 0x18] + adds r1, 0x24 + bl sub_80932E0 + lsls r0, 24 + cmp r0, 0 + beq _08020788 + ldr r0, [r4] + ldr r1, _08020784 + str r1, [r0, 0x7C] + adds r0, 0x80 + movs r1, 0x6 + b _08020792 + .align 2, 0 +_08020780: .4byte gUnknown_203B27C +_08020784: .4byte gUnknown_80DC400 +_08020788: + ldr r0, [r4] + ldr r1, _08020798 + str r1, [r0, 0x7C] + adds r0, 0x80 + movs r1, 0x5 +_08020792: + str r1, [r0] + mov r12, r4 + b _080207CA + .align 2, 0 +_08020798: .4byte gUnknown_80DC40C +_0802079C: + ldr r0, [r1, 0x18] + adds r1, 0x24 + bl sub_80932FC + lsls r0, 24 + cmp r0, 0 + beq _080207B4 + ldr r1, [r4] + ldr r0, _080207B0 + b _080207B8 + .align 2, 0 +_080207B0: .4byte gUnknown_80DC400 +_080207B4: + ldr r1, [r4] + ldr r0, _0802086C +_080207B8: + str r0, [r1, 0x7C] + ldr r2, _08020870 + ldr r0, [r2] + lsls r1, r7, 3 + adds r0, 0x80 + adds r0, r1 + movs r1, 0x7 + str r1, [r0] + mov r12, r2 +_080207CA: + adds r7, 0x1 + mov r0, r12 + ldr r4, [r0] + lsls r1, r7, 3 + adds r3, r4, 0 + adds r3, 0x7C + adds r2, r3, r1 + ldr r0, _08020874 + str r0, [r2] + adds r6, r4, 0 + adds r6, 0x80 + adds r1, r6, r1 + movs r0, 0x8 + str r0, [r1] + adds r7, 0x1 + lsls r1, r7, 3 + adds r2, r3, r1 + ldr r0, _08020878 + str r0, [r2] + adds r1, r6, r1 + movs r0, 0x9 + str r0, [r1] + adds r7, 0x1 + lsls r1, r7, 3 + adds r2, r3, r1 + ldr r0, _0802087C + str r0, [r2] + adds r1, r6, r1 + movs r0, 0xA + str r0, [r1] + adds r7, 0x1 + lsls r1, r7, 3 + adds r2, r3, r1 + ldr r0, _08020880 + ldr r0, [r0] + str r0, [r2] + adds r1, r6, r1 + movs r0, 0xB + str r0, [r1] + adds r7, 0x1 + lsls r1, r7, 3 + adds r3, r1 + movs r0, 0 + str r0, [r3] + adds r1, r6, r1 + movs r0, 0x1 + str r0, [r1] + movs r3, 0 + cmp r3, r7 + bge _0802084C + adds r5, r4, 0 + adds r4, 0xBC + adds r2, r6, 0 +_08020834: + ldrh r0, [r4] + cmp r0, 0 + bne _08020842 + ldr r1, [r2] + ldr r0, [r5, 0x78] + cmp r1, r0 + beq _080208A8 +_08020842: + adds r4, 0x2 + adds r2, 0x8 + adds r3, 0x1 + cmp r3, r7 + blt _08020834 +_0802084C: + movs r3, 0 + cmp r3, r7 + bge _080208A8 + mov r0, r12 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xBC + ldrh r0, [r0] + cmp r0, 0 + bne _08020884 + adds r0, r1, 0 + adds r0, 0x80 + ldr r0, [r0] + str r0, [r1, 0x78] + b _080208A8 + .align 2, 0 +_0802086C: .4byte gUnknown_80DC40C +_08020870: .4byte gUnknown_203B27C +_08020874: .4byte gUnknown_80DC410 +_08020878: .4byte gUnknown_80DC418 +_0802087C: .4byte gUnknown_80DC420 +_08020880: .4byte gUnknown_80D4970 +_08020884: + adds r3, 0x1 + cmp r3, r7 + bge _080208A8 + mov r0, r12 + ldr r2, [r0] + lsls r0, r3, 1 + adds r1, r2, 0 + adds r1, 0xBC + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _08020884 + lsls r0, r3, 3 + adds r1, r2, 0 + adds r1, 0x80 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x78] +_080208A8: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_802074C + + thumb_func_start sub_80208B0 +sub_80208B0: + push {r4,lr} + ldr r4, _080208F4 + ldr r0, [r4] + adds r0, 0xBC + movs r1, 0 + movs r2, 0x10 + bl MemoryFill16 + ldr r4, [r4] + movs r3, 0 + ldr r0, _080208F8 + ldr r0, [r0] + str r0, [r4, 0x7C] + adds r1, r4, 0 + adds r1, 0x80 + movs r0, 0x10 + str r0, [r1] + movs r2, 0x1 + adds r1, 0x4 + ldr r0, _080208FC + ldr r0, [r0] + str r0, [r1] + adds r1, 0x4 + movs r0, 0x11 + str r0, [r1] + adds r0, r4, 0 + adds r0, 0x8C + str r3, [r0] + adds r0, 0x4 + str r2, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080208F4: .4byte gUnknown_203B27C +_080208F8: .4byte gUnknown_80D4920 +_080208FC: .4byte gUnknown_80D4928 + thumb_func_end sub_80208B0 + + thumb_func_start sub_8020900 +sub_8020900: + push {r4,lr} + ldr r4, _08020944 + ldr r0, [r4] + adds r0, 0xBC + movs r1, 0 + movs r2, 0x10 + bl MemoryFill16 + ldr r3, [r4] + movs r2, 0 + ldr r0, _08020948 + ldr r0, [r0] + str r0, [r3, 0x7C] + adds r1, r3, 0 + adds r1, 0x80 + movs r0, 0x10 + str r0, [r1] + adds r1, 0x4 + ldr r0, _0802094C + ldr r0, [r0] + str r0, [r1] + adds r1, 0x4 + movs r0, 0x11 + str r0, [r1] + adds r0, r3, 0 + adds r0, 0x8C + str r2, [r0] + adds r1, 0x8 + movs r0, 0x1 + negs r0, r0 + str r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08020944: .4byte gUnknown_203B27C +_08020948: .4byte gUnknown_80D4920 +_0802094C: .4byte gUnknown_80D4928 + thumb_func_end sub_8020900 + + thumb_func_start sub_8020950 +sub_8020950: + push {r4,lr} + ldr r4, _0802099C + ldr r0, [r4] + adds r0, 0xBC + movs r1, 0 + movs r2, 0x10 + bl MemoryFill16 + ldr r4, [r4] + movs r3, 0 + ldr r0, _080209A0 + str r0, [r4, 0x7C] + adds r1, r4, 0 + adds r1, 0x80 + movs r0, 0xD + str r0, [r1] + movs r2, 0x1 + adds r1, 0x4 + ldr r0, _080209A4 + str r0, [r1] + adds r1, 0x4 + movs r0, 0xE + str r0, [r1] + adds r1, 0x4 + ldr r0, _080209A8 + str r0, [r1] + adds r1, 0x4 + movs r0, 0xF + str r0, [r1] + adds r0, r4, 0 + adds r0, 0x94 + str r3, [r0] + adds r0, 0x4 + str r2, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802099C: .4byte gUnknown_203B27C +_080209A0: .4byte gUnknown_80DC428 +_080209A4: .4byte gUnknown_80DC438 +_080209A8: .4byte gUnknown_80DC448 + thumb_func_end sub_8020950 + + thumb_func_start sub_80209AC +sub_80209AC: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080209F4 + ldr r0, _080209D4 + ldr r1, [r0] + ldr r0, [sp] + str r0, [r1, 0x6C] + ldr r0, [sp] + cmp r0, 0x2 + beq _080209DE + cmp r0, 0x2 + bgt _080209D8 + cmp r0, 0x1 + beq _080209EE + b _080209F4 + .align 2, 0 +_080209D4: .4byte gUnknown_203B27C +_080209D8: + cmp r0, 0xB + beq _080209E6 + b _080209F4 +_080209DE: + movs r0, 0xE + bl sub_801FDA8 + b _080209F4 +_080209E6: + movs r0, 0x8 + bl sub_801FDA8 + b _080209F4 +_080209EE: + movs r0, 0xC + bl sub_801FDA8 +_080209F4: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80209AC + + thumb_func_start sub_80209FC +sub_80209FC: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08020A2E + ldr r0, [sp] + cmp r0, 0x10 + beq _08020A20 + cmp r0, 0x10 + bgt _08020A1A + cmp r0, 0x1 + beq _08020A28 + b _08020A2E +_08020A1A: + cmp r0, 0x11 + beq _08020A28 + b _08020A2E +_08020A20: + movs r0, 0xE + bl sub_801FDA8 + b _08020A2E +_08020A28: + movs r0, 0xC + bl sub_801FDA8 +_08020A2E: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80209FC + + thumb_func_start sub_8020A34 +sub_8020A34: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08020A7A + ldr r0, [sp] + cmp r0, 0xD + beq _08020A5C + cmp r0, 0xD + bgt _08020A52 + cmp r0, 0x1 + beq _08020A74 + b _08020A7A +_08020A52: + cmp r0, 0xE + beq _08020A64 + cmp r0, 0xF + beq _08020A6C + b _08020A7A +_08020A5C: + movs r0, 0x9 + bl sub_801FDA8 + b _08020A7A +_08020A64: + movs r0, 0xA + bl sub_801FDA8 + b _08020A7A +_08020A6C: + movs r0, 0xB + bl sub_801FDA8 + b _08020A7A +_08020A74: + movs r0, 0x1 + bl sub_801FDA8 +_08020A7A: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8020A34 + + thumb_func_start sub_8020A80 +sub_8020A80: + push {r4,lr} + movs r0, 0x1 + bl sub_8023A94 + cmp r0, 0x4 + bhi _08020B32 + lsls r0, 2 + ldr r1, _08020A98 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08020A98: .4byte _08020A9C + .align 2, 0 +_08020A9C: + .4byte _08020B32 + .4byte _08020B32 + .4byte _08020B28 + .4byte _08020AB0 + .4byte _08020AEC +_08020AB0: + bl sub_8023B44 + ldr r4, _08020AE0 + ldr r1, [r4] + strh r0, [r1, 0xC] + ldr r3, _08020AE4 + movs r0, 0xC + ldrsh r2, [r1, r0] + movs r0, 0x58 + muls r2, r0 + ldr r0, [r3] + adds r0, r2 + str r0, [r1, 0x10] + ldrb r0, [r0, 0x2] + strb r0, [r1, 0x16] + ldr r0, _08020AE8 + ldr r1, [r4] + ldr r1, [r1, 0x10] + bl sub_808DA34 + movs r0, 0x11 + bl sub_801FDA8 + b _08020B32 + .align 2, 0 +_08020AE0: .4byte gUnknown_203B27C +_08020AE4: .4byte gUnknown_203B45C +_08020AE8: .4byte gUnknown_202E128 +_08020AEC: + bl sub_8023B44 + ldr r4, _08020B1C + ldr r1, [r4] + strh r0, [r1, 0xC] + ldr r3, _08020B20 + movs r0, 0xC + ldrsh r2, [r1, r0] + movs r0, 0x58 + muls r2, r0 + ldr r0, [r3] + adds r0, r2 + str r0, [r1, 0x10] + ldrb r0, [r0, 0x2] + strb r0, [r1, 0x16] + ldr r0, _08020B24 + ldr r1, [r4] + ldr r1, [r1, 0x10] + bl sub_808DA34 + movs r0, 0x12 + bl sub_801FDA8 + b _08020B32 + .align 2, 0 +_08020B1C: .4byte gUnknown_203B27C +_08020B20: .4byte gUnknown_203B45C +_08020B24: .4byte gUnknown_202E128 +_08020B28: + bl sub_8023C60 + movs r0, 0x7 + bl sub_801FDA8 +_08020B32: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8020A80 + + thumb_func_start sub_8020B38 +sub_8020B38: + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + bl sub_8023A94 + ldr r4, _08020B7C + ldr r0, [r4] + adds r0, 0xCC + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _08020B68 + ldr r0, [r4] + adds r0, 0xCC + mov r1, sp + bl sub_8013114 + ldr r1, [sp] + cmp r1, 0x1 + beq _08020B68 + ldr r0, [r4] + str r1, [r0, 0x70] +_08020B68: + ldr r0, [sp] + subs r0, 0x1 + cmp r0, 0x10 + bhi _08020C24 + lsls r0, 2 + ldr r1, _08020B80 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08020B7C: .4byte gUnknown_203B27C +_08020B80: .4byte _08020B84 + .align 2, 0 +_08020B84: + .4byte _08020BC8 + .4byte _08020C24 + .4byte _08020BD0 + .4byte _08020C0E + .4byte _08020C24 + .4byte _08020C24 + .4byte _08020C24 + .4byte _08020C24 + .4byte _08020C24 + .4byte _08020C24 + .4byte _08020C16 + .4byte _08020C1E + .4byte _08020C24 + .4byte _08020C24 + .4byte _08020C24 + .4byte _08020C24 + .4byte _08020BC8 +_08020BC8: + movs r0, 0x10 + bl sub_801FDA8 + b _08020C24 +_08020BD0: + ldr r0, _08020BF0 + ldr r0, [r0] + ldr r0, [r0, 0x10] + movs r1, 0x8 + ldrsh r0, [r0, r1] + bl sub_808E858 + lsls r0, 16 + movs r1, 0xCF + lsls r1, 17 + cmp r0, r1 + bne _08020BF4 + movs r0, 0x1C + bl sub_801FDA8 + b _08020C24 + .align 2, 0 +_08020BF0: .4byte gUnknown_203B27C +_08020BF4: + bl sub_8021178 + lsls r0, 24 + cmp r0, 0 + beq _08020C06 + movs r0, 0x1B + bl sub_801FDA8 + b _08020C24 +_08020C06: + movs r0, 0x14 + bl sub_801FDA8 + b _08020C24 +_08020C0E: + movs r0, 0x1E + bl sub_801FDA8 + b _08020C24 +_08020C16: + movs r0, 0x12 + bl sub_801FDA8 + b _08020C24 +_08020C1E: + movs r0, 0x13 + bl sub_801FDA8 +_08020C24: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8020B38 + + thumb_func_start sub_8020C2C +sub_8020C2C: + push {lr} + bl sub_80244E4 + cmp r0, 0x1 + bls _08020C44 + cmp r0, 0x3 + bhi _08020C44 + bl sub_802453C + movs r0, 0x10 + bl sub_801FDA8 +_08020C44: + pop {r0} + bx r0 + thumb_func_end sub_8020C2C + + thumb_func_start sub_8020C48 +sub_8020C48: + push {lr} + bl sub_801BF48 + cmp r0, 0x1 + bls _08020C60 + cmp r0, 0x3 + bhi _08020C60 + bl sub_801BF98 + movs r0, 0x10 + bl sub_801FDA8 +_08020C60: + pop {r0} + bx r0 + thumb_func_end sub_8020C48 + + thumb_func_start sub_8020C64 +sub_8020C64: + push {lr} + movs r0, 0x1 + bl sub_801F520 + cmp r0, 0x3 + beq _08020C80 + cmp r0, 0x3 + bhi _08020C7A + cmp r0, 0x2 + beq _08020CB0 + b _08020CBA +_08020C7A: + cmp r0, 0x4 + beq _08020C98 + b _08020CBA +_08020C80: + bl sub_801F5B4 + ldr r1, _08020C94 + ldr r1, [r1] + strh r0, [r1, 0x1C] + strh r0, [r1, 0x1E] + movs r0, 0x17 + bl sub_801FDA8 + b _08020CBA + .align 2, 0 +_08020C94: .4byte gUnknown_203B27C +_08020C98: + bl sub_801F5B4 + ldr r1, _08020CAC + ldr r1, [r1] + strh r0, [r1, 0x1C] + strh r0, [r1, 0x1E] + movs r0, 0x18 + bl sub_801FDA8 + b _08020CBA + .align 2, 0 +_08020CAC: .4byte gUnknown_203B27C +_08020CB0: + bl sub_801F63C + movs r0, 0x10 + bl sub_801FDA8 +_08020CBA: + pop {r0} + bx r0 + thumb_func_end sub_8020C64 + + thumb_func_start sub_8020CC0 +sub_8020CC0: + push {r4-r6,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + bl sub_801F520 + ldr r4, _08020D00 + ldr r0, [r4] + adds r0, 0xCC + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _08020CF0 + ldr r0, [r4] + adds r0, 0xCC + mov r1, sp + bl sub_8013114 + ldr r1, [sp] + cmp r1, 0x1 + beq _08020CF0 + ldr r0, [r4] + str r1, [r0, 0x74] +_08020CF0: + ldr r0, [sp] + cmp r0, 0x3 + beq _08020D14 + cmp r0, 0x3 + bgt _08020D04 + cmp r0, 0x1 + beq _08020D0C + b _08020D6C + .align 2, 0 +_08020D00: .4byte gUnknown_203B27C +_08020D04: + cmp r0, 0xB + beq _08020D66 + cmp r0, 0x11 + bne _08020D6C +_08020D0C: + movs r0, 0x16 + bl sub_801FDA8 + b _08020D6C +_08020D14: + bl sub_801F63C + ldr r4, _08020D30 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x24 + ldr r1, [r1, 0x10] + adds r1, 0x2C + bl sub_809401C + movs r5, 0 + adds r6, r4, 0 + movs r4, 0x24 + b _08020D38 + .align 2, 0 +_08020D30: .4byte gUnknown_203B27C +_08020D34: + adds r4, 0x8 + adds r5, 0x1 +_08020D38: + cmp r5, 0x7 + bgt _08020D52 + ldr r3, [r6] + adds r2, r3, r4 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08020D34 + ldrh r1, [r3, 0x1E] + adds r0, r2, 0 + bl sub_8092AD4 +_08020D52: + cmp r5, 0x3 + ble _08020D5E + movs r0, 0x1D + bl sub_801FDA8 + b _08020D6C +_08020D5E: + movs r0, 0x19 + bl sub_801FDA8 + b _08020D6C +_08020D66: + movs r0, 0x18 + bl sub_801FDA8 +_08020D6C: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8020CC0 + + thumb_func_start sub_8020D74 +sub_8020D74: + push {lr} + bl sub_801F890 + cmp r0, 0x1 + bls _08020D8C + cmp r0, 0x3 + bhi _08020D8C + bl sub_801F8D0 + movs r0, 0x16 + bl sub_801FDA8 +_08020D8C: + pop {r0} + bx r0 + thumb_func_end sub_8020D74 + + thumb_func_start sub_8020D90 +sub_8020D90: + push {lr} + bl sub_801E8C0 + cmp r0, 0x2 + beq _08020DBC + cmp r0, 0x2 + bcc _08020DC6 + cmp r0, 0x3 + bne _08020DC6 + bl sub_801E930 + ldr r1, _08020DB8 + ldr r1, [r1] + strb r0, [r1, 0x14] + bl sub_801E93C + movs r0, 0x1A + bl sub_801FDA8 + b _08020DC6 + .align 2, 0 +_08020DB8: .4byte gUnknown_203B27C +_08020DBC: + bl sub_801E93C + movs r0, 0x10 + bl sub_801FDA8 +_08020DC6: + pop {r0} + bx r0 + thumb_func_end sub_8020D90 + + thumb_func_start sub_8020DCC +sub_8020DCC: + push {lr} + movs r0, 0x1 + bl sub_801EF38 + cmp r0, 0x4 + bhi _08020EAA + lsls r0, 2 + ldr r1, _08020DE4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08020DE4: .4byte _08020DE8 + .align 2, 0 +_08020DE8: + .4byte _08020EAA + .4byte _08020E98 + .4byte _08020E64 + .4byte _08020DFC + .4byte _08020E30 +_08020DFC: + bl sub_801F1A4 + lsls r0, 24 + cmp r0, 0 + beq _08020E0E + ldr r0, _08020E2C + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x15] +_08020E0E: + bl sub_801F194 + ldr r1, _08020E2C + ldr r2, [r1] + str r0, [r2, 0x18] + lsls r0, 3 + adds r0, r2, r0 + ldrh r1, [r0, 0x26] + strh r1, [r2, 0x1C] + ldrh r0, [r0, 0x26] + strh r0, [r2, 0x20] + movs r0, 0x20 + bl sub_801FDA8 + b _08020EAA + .align 2, 0 +_08020E2C: .4byte gUnknown_203B27C +_08020E30: + bl sub_801F1A4 + lsls r0, 24 + cmp r0, 0 + beq _08020E42 + ldr r0, _08020E60 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x15] +_08020E42: + bl sub_801F194 + ldr r1, _08020E60 + ldr r2, [r1] + str r0, [r2, 0x18] + lsls r0, 3 + adds r0, r2, r0 + ldrh r1, [r0, 0x26] + strh r1, [r2, 0x1C] + ldrh r0, [r0, 0x26] + strh r0, [r2, 0x20] + movs r0, 0x21 + bl sub_801FDA8 + b _08020EAA + .align 2, 0 +_08020E60: .4byte gUnknown_203B27C +_08020E64: + bl sub_801F1A4 + lsls r0, 24 + cmp r0, 0 + beq _08020E76 + ldr r0, _08020E94 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x15] +_08020E76: + bl sub_801F214 + ldr r0, _08020E94 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x24 + ldr r1, [r1, 0x10] + adds r1, 0x2C + bl sub_8094060 + movs r0, 0x10 + bl sub_801FDA8 + b _08020EAA + .align 2, 0 +_08020E94: .4byte gUnknown_203B27C +_08020E98: + bl sub_801F1A4 + lsls r0, 24 + cmp r0, 0 + beq _08020EAA + ldr r0, _08020EB0 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x15] +_08020EAA: + pop {r0} + bx r0 + .align 2, 0 +_08020EB0: .4byte gUnknown_203B27C + thumb_func_end sub_8020DCC + + thumb_func_start sub_8020EB4 +sub_8020EB4: + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + bl sub_801EF38 + ldr r4, _08020EF8 + ldr r0, [r4] + adds r0, 0xCC + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _08020EE4 + ldr r0, [r4] + adds r0, 0xCC + mov r1, sp + bl sub_8013114 + ldr r1, [sp] + cmp r1, 0x1 + beq _08020EE4 + ldr r0, [r4] + str r1, [r0, 0x78] +_08020EE4: + ldr r0, [sp] + subs r0, 0x1 + cmp r0, 0x10 + bls _08020EEE + b _080210BE +_08020EEE: + lsls r0, 2 + ldr r1, _08020EFC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08020EF8: .4byte gUnknown_203B27C +_08020EFC: .4byte _08020F00 + .align 2, 0 +_08020F00: + .4byte _08021068 + .4byte _080210BE + .4byte _080210BE + .4byte _080210BE + .4byte _08020F44 + .4byte _08020F70 + .4byte _08020F8C + .4byte _08020FB8 + .4byte _08021034 + .4byte _08021074 + .4byte _080210B8 + .4byte _080210BE + .4byte _080210BE + .4byte _080210BE + .4byte _080210BE + .4byte _080210BE + .4byte _08021068 +_08020F44: + ldr r0, _08020F60 + ldr r1, [r0] + ldr r0, [r1, 0x18] + adds r1, 0x24 + bl sub_80934DC + lsls r0, 24 + cmp r0, 0 + beq _08020F68 + ldr r0, _08020F64 + bl sub_8011988 + b _08021068 + .align 2, 0 +_08020F60: .4byte gUnknown_203B27C +_08020F64: .4byte 0x00000133 +_08020F68: + movs r0, 0x2 + bl sub_80119D4 + b _08021068 +_08020F70: + ldr r0, _08020F84 + bl sub_8011988 + ldr r0, _08020F88 + ldr r1, [r0] + ldr r0, [r1, 0x18] + adds r1, 0x24 + bl sub_809352C + b _08021068 + .align 2, 0 +_08020F84: .4byte 0x00000133 +_08020F88: .4byte gUnknown_203B27C +_08020F8C: + ldr r0, _08020FA8 + ldr r1, [r0] + ldr r0, [r1, 0x18] + adds r1, 0x24 + bl sub_8093544 + lsls r0, 24 + cmp r0, 0 + beq _08020FB0 + ldr r0, _08020FAC + bl sub_8011988 + b _08021068 + .align 2, 0 +_08020FA8: .4byte gUnknown_203B27C +_08020FAC: .4byte 0x00000133 +_08020FB0: + movs r0, 0x2 + bl sub_80119D4 + b _08021068 +_08020FB8: + ldr r0, _08020FD8 + ldr r0, [r0] + movs r1, 0x98 + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0x95 + bgt _08020FDC + movs r0, 0x2 + bl sub_80119D4 + movs r0, 0x3 + bl sub_801FDA8 + b _080210BE + .align 2, 0 +_08020FD8: .4byte gUnknown_203B460 +_08020FDC: + ldr r4, _08020FFC + ldr r1, [r4] + ldr r0, [r1, 0x18] + adds r1, 0x24 + bl sub_8093318 + lsls r0, 24 + cmp r0, 0 + bne _08021000 + movs r0, 0x2 + bl sub_80119D4 + movs r0, 0x4 + bl sub_801FDA8 + b _080210BE + .align 2, 0 +_08020FFC: .4byte gUnknown_203B27C +_08021000: + ldr r1, [r4] + ldrb r0, [r1, 0x15] + cmp r0, 0 + bne _08021016 + movs r0, 0x1 + strb r0, [r1, 0x15] + movs r0, 0xA6 + lsls r0, 1 + bl sub_8011988 + b _0802101C +_08021016: + ldr r0, _0802102C + bl sub_8011988 +_0802101C: + ldr r0, _08021030 + ldr r1, [r0] + ldr r0, [r1, 0x18] + adds r1, 0x24 + bl sub_8093400 + b _08021068 + .align 2, 0 +_0802102C: .4byte 0x00000133 +_08021030: .4byte gUnknown_203B27C +_08021034: + ldr r4, _08021054 + ldr r1, [r4] + ldr r0, [r1, 0x18] + adds r1, 0x24 + bl sub_809333C + lsls r0, 24 + cmp r0, 0 + bne _08021058 + movs r0, 0x2 + bl sub_80119D4 + movs r0, 0x5 + bl sub_801FDA8 + b _080210BE + .align 2, 0 +_08021054: .4byte gUnknown_203B27C +_08021058: + ldr r0, _08021070 + bl sub_8011988 + ldr r1, [r4] + ldr r0, [r1, 0x18] + adds r1, 0x24 + bl sub_8093468 +_08021068: + movs r0, 0x1F + bl sub_801FDA8 + b _080210BE + .align 2, 0 +_08021070: .4byte 0x00000133 +_08021074: + ldr r4, _08021094 + ldr r1, [r4] + ldr r0, [r1, 0x18] + adds r1, 0x24 + bl sub_80933A0 + lsls r0, 24 + cmp r0, 0 + bne _08021098 + movs r0, 0x2 + bl sub_80119D4 + movs r0, 0x6 + bl sub_801FDA8 + b _080210BE + .align 2, 0 +_08021094: .4byte gUnknown_203B27C +_08021098: + ldr r0, _080210B4 + bl sub_8011988 + ldr r1, [r4] + ldr r0, [r1, 0x18] + adds r1, 0x24 + bl sub_80934B0 + ldr r1, [r4] + strb r0, [r1, 0x14] + movs r0, 0x22 + bl sub_801FDA8 + b _080210BE + .align 2, 0 +_080210B4: .4byte 0x00000133 +_080210B8: + movs r0, 0x21 + bl sub_801FDA8 +_080210BE: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8020EB4 + + thumb_func_start sub_80210C8 +sub_80210C8: + push {lr} + bl sub_801F890 + cmp r0, 0x1 + bls _080210E0 + cmp r0, 0x3 + bhi _080210E0 + bl sub_801F8D0 + movs r0, 0x1F + bl sub_801FDA8 +_080210E0: + pop {r0} + bx r0 + thumb_func_end sub_80210C8 + + thumb_func_start sub_80210E4 +sub_80210E4: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802112A + ldr r0, [sp] + cmp r0, 0x10 + beq _08021108 + cmp r0, 0x10 + bgt _08021102 + cmp r0, 0x1 + beq _08021124 + b _0802112A +_08021102: + cmp r0, 0x11 + beq _08021124 + b _0802112A +_08021108: + ldr r0, _08021120 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x24 + ldr r1, [r1, 0x18] + bl sub_8093CF8 + movs r0, 0x23 + bl sub_801FDA8 + b _0802112A + .align 2, 0 +_08021120: .4byte gUnknown_203B27C +_08021124: + movs r0, 0x1F + bl sub_801FDA8 +_0802112A: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80210E4 + + thumb_func_start sub_8021130 +sub_8021130: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08021148 + ldr r0, _08021150 + ldr r0, [r0] + ldr r0, [r0, 0x8] + bl sub_801FDA8 +_08021148: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08021150: .4byte gUnknown_203B27C + thumb_func_end sub_8021130 + + thumb_func_start sub_8021154 +sub_8021154: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0x4 + bne _0802116C + ldr r0, _08021174 + ldr r0, [r0] + ldr r0, [r0, 0x8] + bl sub_801FDA8 +_0802116C: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08021174: .4byte gUnknown_203B27C + thumb_func_end sub_8021154 + + thumb_func_start sub_8021178 +sub_8021178: + push {lr} + mov r12, r4 + ldr r4, _08021198 + add sp, r4 + mov r4, r12 + ldr r0, _0802119C + ldr r0, [r0] + ldr r1, [r0, 0x10] + mov r0, sp + bl sub_808E218 + cmp r0, 0 + beq _080211A0 + movs r0, 0 + b _080211A2 + .align 2, 0 +_08021198: .4byte 0xfffffcc0 +_0802119C: .4byte gUnknown_203B27C +_080211A0: + movs r0, 0x1 +_080211A2: + movs r3, 0xD0 + lsls r3, 2 + add sp, r3 + pop {r1} + bx r1 + thumb_func_end sub_8021178 + + thumb_func_start sub_80211AC +sub_80211AC: + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + bl sub_8021700 + lsls r0, 24 + cmp r0, 0 + beq _080211C0 + movs r0, 0 + b _08021258 +_080211C0: + ldr r5, _08021260 + movs r0, 0xE0 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] + str r4, [r0, 0x3C] + str r6, [r0, 0x74] + lsls r1, r6, 1 + adds r1, r6 + lsls r1, 3 + adds r1, 0x7C + adds r1, r0, r1 + str r1, [r0, 0x78] + adds r0, 0x7C + bl sub_8006518 + ldr r1, [r5] + ldr r2, [r1, 0x74] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r1, 0x7C + ldr r0, _08021264 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r0, [r5] + ldr r1, [r0, 0x78] + adds r0, 0xDC + str r0, [r1, 0x14] + bl sub_8004914 + ldr r0, [r5] + adds r0, 0x7C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r4, [r5] + adds r4, 0x40 + bl sub_8021664 + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0xA + adds r3, r6, 0 + bl sub_8013818 + ldr r0, _08021268 + ldr r2, [r5] + ldr r1, [r0] + ldr r0, [r2, 0x3C] + cmp r1, r0 + bne _0802124E + ldr r0, _0802126C + ldrh r1, [r0] + adds r0, r2, 0 + adds r0, 0x58 + strh r1, [r0] + ldr r0, _08021270 + ldrh r0, [r0] + adds r1, r2, 0 + adds r1, 0x5E + strh r0, [r1] + adds r0, r2, 0 + adds r0, 0x40 + bl sub_8013984 +_0802124E: + bl sub_8021410 + bl sub_8021494 + movs r0, 0x1 +_08021258: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08021260: .4byte gUnknown_203B280 +_08021264: .4byte gUnknown_80DC47C +_08021268: .4byte gUnknown_203B284 +_0802126C: .4byte gUnknown_203B288 +_08021270: .4byte gUnknown_203B28A + thumb_func_end sub_80211AC + + thumb_func_start sub_8021274 +sub_8021274: + push {r4,lr} + lsls r0, 24 + cmp r0, 0 + bne _08021290 + ldr r0, _0802128C + ldr r0, [r0] + adds r0, 0x40 + bl sub_8013660 + movs r0, 0 + b _08021326 + .align 2, 0 +_0802128C: .4byte gUnknown_203B280 +_08021290: + ldr r4, _080212A8 + ldr r0, [r4] + adds r0, 0x40 + bl GetKeyPress + cmp r0, 0x2 + beq _080212B2 + cmp r0, 0x2 + bgt _080212AC + cmp r0, 0x1 + beq _080212BC + b _08021300 + .align 2, 0 +_080212A8: .4byte gUnknown_203B280 +_080212AC: + cmp r0, 0x4 + beq _080212F6 + b _08021300 +_080212B2: + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + b _08021326 +_080212BC: + ldr r0, [r4] + ldr r0, [r0, 0x3C] + cmp r0, 0x2 + bne _080212EC + bl sub_802132C + lsls r0, 24 + lsrs r0, 24 + bl sub_8092544 + ldr r1, _080212E8 + ldr r1, [r1] + movs r2, 0x98 + lsls r2, 2 + adds r1, r2 + ldr r1, [r1] + cmp r0, r1 + ble _080212EC + movs r0, 0x2 + bl sub_80119D4 + b _080212F2 + .align 2, 0 +_080212E8: .4byte gUnknown_203B460 +_080212EC: + movs r0, 0 + bl sub_80119D4 +_080212F2: + movs r0, 0x3 + b _08021326 +_080212F6: + movs r0, 0x4 + bl sub_80119D4 + movs r0, 0x4 + b _08021326 +_08021300: + ldr r0, _08021318 + ldr r0, [r0] + adds r0, 0x40 + movs r1, 0x1 + bl sub_80138B8 + lsls r0, 24 + cmp r0, 0 + bne _0802131C + movs r0, 0 + b _08021326 + .align 2, 0 +_08021318: .4byte gUnknown_203B280 +_0802131C: + bl sub_8021410 + bl sub_8021494 + movs r0, 0x1 +_08021326: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8021274 + + thumb_func_start sub_802132C +sub_802132C: + ldr r0, _08021350 + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x5E + movs r3, 0 + ldrsh r1, [r0, r3] + subs r0, 0x2 + movs r3, 0 + ldrsh r0, [r0, r3] + muls r0, r1 + adds r1, r2, 0 + adds r1, 0x58 + movs r3, 0 + ldrsh r1, [r1, r3] + adds r0, r1 + adds r0, r2, r0 + ldrb r0, [r0] + bx lr + .align 2, 0 +_08021350: .4byte gUnknown_203B280 + thumb_func_end sub_802132C + + thumb_func_start sub_8021354 +sub_8021354: + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8004914 + ldr r5, _0802139C + ldr r0, [r5] + adds r0, 0x7C + movs r1, 0 + movs r2, 0 + bl sub_800641C + bl sub_8021664 + adds r1, r0, 0 + ldr r0, [r5] + adds r2, r0, 0 + adds r2, 0x62 + strh r1, [r2] + adds r0, 0x40 + bl sub_8013984 + bl sub_8021410 + bl sub_8021494 + cmp r4, 0 + beq _08021396 + ldr r0, [r5] + adds r0, 0x40 + bl AddMenuCursorSprite +_08021396: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802139C: .4byte gUnknown_203B280 + thumb_func_end sub_8021354 + + thumb_func_start sub_80213A0 +sub_80213A0: + push {r4,r5,lr} + ldr r4, _080213FC + ldr r2, [r4] + cmp r2, 0 + beq _080213F4 + ldr r1, _08021400 + ldr r0, [r2, 0x3C] + str r0, [r1] + ldr r1, _08021404 + adds r0, r2, 0 + adds r0, 0x58 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _08021408 + adds r0, r2, 0 + adds r0, 0x5E + ldrh r0, [r0] + strh r0, [r1] + ldr r0, [r2, 0x74] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x7C + ldr r0, _0802140C + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x7C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_080213F4: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080213FC: .4byte gUnknown_203B280 +_08021400: .4byte gUnknown_203B284 +_08021404: .4byte gUnknown_203B288 +_08021408: .4byte gUnknown_203B28A +_0802140C: .4byte gUnknown_80DC464 + thumb_func_end sub_80213A0 + + thumb_func_start sub_8021410 +sub_8021410: + push {r4,lr} + ldr r4, _08021490 + ldr r0, [r4] + adds r0, 0xDC + movs r2, 0 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0xDD + strb r2, [r0] + ldr r0, [r4] + adds r0, 0xDE + movs r1, 0xC + strb r1, [r0] + ldr r0, [r4] + adds r0, 0xDF + strb r2, [r0] + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x7C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + adds r0, 0x5A + movs r1, 0 + ldrsh r0, [r0, r1] + movs r1, 0xC + bl sub_80095E4 + adds r0, 0x2 + lsls r0, 16 + ldr r2, [r4] + ldr r3, [r2, 0x74] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x8A + asrs r3, r0, 16 + lsrs r0, 16 + strh r0, [r1] + ldr r1, [r2, 0x74] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r2, r0 + adds r3, 0x2 + adds r2, 0x8C + strh r3, [r2] + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x7C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08021490: .4byte gUnknown_203B280 + thumb_func_end sub_8021410 + + thumb_func_start sub_8021494 +sub_8021494: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xA8 + ldr r4, _08021568 + ldr r0, [r4] + ldr r0, [r0, 0x74] + bl sub_8008C54 + ldr r0, [r4] + ldr r0, [r0, 0x74] + bl sub_80073B8 + ldr r2, _0802156C + ldr r0, [r4] + ldr r3, [r0, 0x74] + movs r0, 0 + str r0, [sp] + movs r0, 0xA + movs r1, 0 + bl xxx_call_draw_string + ldr r3, [r4] + adds r0, r3, 0 + adds r0, 0xDE + ldrb r0, [r0] + lsls r0, 3 + adds r0, 0x4 + adds r1, r3, 0 + adds r1, 0x5E + movs r5, 0 + ldrsh r2, [r1, r5] + adds r2, 0x1 + movs r1, 0x7 + str r1, [sp] + ldr r1, [r3, 0x74] + str r1, [sp, 0x4] + movs r1, 0 + movs r3, 0x1 + bl sub_8012BC4 + movs r0, 0 + mov r9, r0 + ldr r0, [r4] + adds r0, 0x5A + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r9, r0 + blt _080214FC + b _08021646 +_080214FC: + mov r8, r4 + add r2, sp, 0x58 + mov r10, r2 +_08021502: + mov r3, r8 + ldr r2, [r3] + adds r0, r2, 0 + adds r0, 0x5E + movs r5, 0 + ldrsh r1, [r0, r5] + subs r0, 0x2 + movs r3, 0 + ldrsh r0, [r0, r3] + muls r0, r1 + add r0, r9 + adds r0, r2, r0 + ldrb r5, [r0] + adds r7, r5, 0 + ldr r6, [r2, 0x3C] + cmp r6, 0x2 + bne _0802159C + add r0, sp, 0x8 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_8092578 + adds r0, r5, 0 + bl sub_8092544 + ldr r1, _08021570 + ldr r1, [r1] + movs r5, 0x98 + lsls r5, 2 + adds r1, r5 + ldr r1, [r1] + cmp r0, r1 + bgt _08021574 + mov r1, r8 + ldr r0, [r1] + adds r0, 0x40 + mov r1, r9 + bl sub_8013800 + adds r1, r0, 0 + mov r2, r8 + ldr r0, [r2] + ldr r3, [r0, 0x74] + movs r0, 0 + str r0, [sp] + movs r0, 0x8 + add r2, sp, 0x8 + bl xxx_call_draw_string + b _08021632 + .align 2, 0 +_08021568: .4byte gUnknown_203B280 +_0802156C: .4byte gUnknown_80DC494 +_08021570: .4byte gUnknown_203B460 +_08021574: + mov r0, r10 + ldr r1, _08021598 + add r2, sp, 0x8 + bl sub_800D158 + mov r3, r8 + ldr r0, [r3] + adds r0, 0x40 + mov r1, r9 + bl sub_8013800 + adds r1, r0, 0 + mov r5, r8 + ldr r0, [r5] + ldr r3, [r0, 0x74] + movs r0, 0 + str r0, [sp] + b _080215FE + .align 2, 0 +_08021598: .4byte gUnknown_80DC4A4 +_0802159C: + cmp r6, 0 + bne _0802160C + ldr r0, _080215D4 + ldr r0, [r0] + adds r0, r5 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080215D8 + adds r0, r2, 0 + adds r0, 0x40 + mov r1, r9 + bl sub_8013800 + adds r4, r0, 0 + adds r0, r5, 0 + bl sub_8092524 + adds r2, r0, 0 + mov r1, r8 + ldr r0, [r1] + ldr r3, [r0, 0x74] + str r6, [sp] + movs r0, 0x8 + adds r1, r4, 0 + bl xxx_call_draw_string + b _08021632 + .align 2, 0 +_080215D4: .4byte gUnknown_203B468 +_080215D8: + adds r0, r5, 0 + bl sub_8092524 + adds r2, r0, 0 + mov r0, r10 + ldr r1, _08021608 + bl sub_800D158 + mov r2, r8 + ldr r0, [r2] + adds r0, 0x40 + mov r1, r9 + bl sub_8013800 + adds r1, r0, 0 + mov r3, r8 + ldr r0, [r3] + ldr r3, [r0, 0x74] + str r6, [sp] +_080215FE: + movs r0, 0x8 + mov r2, r10 + bl xxx_call_draw_string + b _08021632 + .align 2, 0 +_08021608: .4byte gUnknown_80DC4AC +_0802160C: + adds r0, r2, 0 + adds r0, 0x40 + mov r1, r9 + bl sub_8013800 + adds r4, r0, 0 + adds r0, r7, 0 + bl sub_8092524 + adds r2, r0, 0 + mov r5, r8 + ldr r0, [r5] + ldr r3, [r0, 0x74] + movs r0, 0 + str r0, [sp] + movs r0, 0x8 + adds r1, r4, 0 + bl xxx_call_draw_string +_08021632: + movs r0, 0x1 + add r9, r0 + mov r1, r8 + ldr r0, [r1] + adds r0, 0x5A + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r9, r0 + bge _08021646 + b _08021502 +_08021646: + ldr r0, _08021660 + ldr r0, [r0] + ldr r0, [r0, 0x74] + bl sub_80073E0 + add sp, 0xA8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08021660: .4byte gUnknown_203B280 + thumb_func_end sub_8021494 + + thumb_func_start sub_8021664 +sub_8021664: + push {r4-r6,lr} + movs r5, 0 + ldr r1, _0802167C + ldr r0, [r1] + ldr r0, [r0, 0x3C] + cmp r0, 0x1 + beq _08021692 + cmp r0, 0x1 + bcc _08021680 + cmp r0, 0x2 + beq _080216B4 + b _080216F2 + .align 2, 0 +_0802167C: .4byte gUnknown_203B280 +_08021680: + movs r4, 0x1 +_08021682: + ldr r0, [r1] + adds r0, r5 + strb r4, [r0] + adds r5, 0x1 + adds r4, 0x1 + cmp r4, 0x39 + ble _08021682 + b _080216F2 +_08021692: + movs r4, 0x1 + ldr r2, _080216B0 +_08021696: + ldr r0, [r2] + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _080216A8 + ldr r0, [r1] + adds r0, r5 + strb r4, [r0] + adds r5, 0x1 +_080216A8: + adds r4, 0x1 + cmp r4, 0x39 + ble _08021696 + b _080216F2 + .align 2, 0 +_080216B0: .4byte gUnknown_203B468 +_080216B4: + movs r4, 0x1 + adds r6, r1, 0 +_080216B8: + ldr r0, _080216FC + ldr r0, [r0] + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _080216EC + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8092534 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _080216E4 + cmp r0, 0x1 + bne _080216EC + movs r0, 0x6 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _080216EC +_080216E4: + ldr r0, [r6] + adds r0, r5 + strb r4, [r0] + adds r5, 0x1 +_080216EC: + adds r4, 0x1 + cmp r4, 0x39 + ble _080216B8 +_080216F2: + adds r0, r5, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080216FC: .4byte gUnknown_203B468 + thumb_func_end sub_8021664 + + thumb_func_start sub_8021700 +sub_8021700: + push {r4,lr} + cmp r0, 0x1 + beq _08021710 + cmp r0, 0x1 + bcc _08021754 + cmp r0, 0x2 + beq _0802172C + b _0802176A +_08021710: + movs r4, 0x1 + ldr r0, _08021728 + ldr r1, [r0] +_08021716: + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _08021754 + adds r4, 0x1 + cmp r4, 0x39 + ble _08021716 + b _0802176A + .align 2, 0 +_08021728: .4byte gUnknown_203B468 +_0802172C: + movs r4, 0x1 +_0802172E: + ldr r0, _08021750 + ldr r0, [r0] + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _08021764 + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8092534 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _08021754 + cmp r0, 0x1 + beq _08021758 + b _08021764 + .align 2, 0 +_08021750: .4byte gUnknown_203B468 +_08021754: + movs r0, 0 + b _0802176C +_08021758: + movs r0, 0x6 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + bne _08021754 +_08021764: + adds r4, 0x1 + cmp r4, 0x39 + ble _0802172E +_0802176A: + movs r0, 0x1 +_0802176C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8021700 + + thumb_func_start sub_8021774 +sub_8021774: + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r4, r0, 0 + adds r5, r1, 0 + mov r8, r2 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r6, _080217E4 + movs r0, 0xE0 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r6] + strb r4, [r0, 0xC] + ldr r0, [r6] + strb r5, [r0, 0xD] + ldr r0, [r6] + bl sub_801317C + bl sub_8021A60 + ldr r0, [r6] + mov r1, r8 + str r1, [r0, 0x74] + lsls r1, 1 + add r1, r8 + lsls r1, 3 + adds r1, 0x7C + adds r1, r0, r1 + str r1, [r0, 0x78] + adds r0, 0x7C + bl sub_8006518 + ldr r1, [r6] + ldr r2, [r1, 0x74] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r1, 0x7C + ldr r0, _080217E8 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + bl sub_8021820 + movs r0, 0x1 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080217E4: .4byte gUnknown_203B28C +_080217E8: .4byte gUnknown_80DC4D8 + thumb_func_end sub_8021774 + + thumb_func_start sub_80217EC +sub_80217EC: + push {lr} + ldr r0, _0802180C + ldr r0, [r0] + ldr r1, [r0, 0x74] + bl sub_8012A64 + cmp r0, 0x1 + beq _08021810 + cmp r0, 0x2 + bne _0802181A + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + b _0802181C + .align 2, 0 +_0802180C: .4byte gUnknown_203B28C +_08021810: + movs r0, 0 + bl sub_80119D4 + movs r0, 0x3 + b _0802181C +_0802181A: + movs r0, 0 +_0802181C: + pop {r1} + bx r1 + thumb_func_end sub_80217EC + + thumb_func_start sub_8021820 +sub_8021820: + push {lr} + bl sub_8021878 + bl sub_8021894 + pop {r0} + bx r0 + thumb_func_end sub_8021820 + + thumb_func_start sub_8021830 +sub_8021830: + push {r4,r5,lr} + ldr r4, _08021870 + ldr r2, [r4] + cmp r2, 0 + beq _0802186A + ldr r0, [r2, 0x74] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x7C + ldr r0, _08021874 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x7C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0802186A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08021870: .4byte gUnknown_203B28C +_08021874: .4byte gUnknown_80DC4BC + thumb_func_end sub_8021830 + + thumb_func_start sub_8021878 +sub_8021878: + push {lr} + bl sub_8004914 + ldr r0, _08021890 + ldr r0, [r0] + adds r0, 0x7C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r0} + bx r0 + .align 2, 0 +_08021890: .4byte gUnknown_203B28C + thumb_func_end sub_8021878 + + thumb_func_start sub_8021894 +sub_8021894: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x168 + ldr r4, _080218F8 + ldr r0, [r4] + ldr r0, [r0, 0x74] + bl sub_80073B8 + ldr r0, [r4] + ldrb r1, [r0, 0xC] + add r0, sp, 0x4 + movs r2, 0 + bl sub_8092578 + ldr r0, [r4] + ldr r3, [r0, 0x74] + movs r5, 0 + str r5, [sp] + movs r0, 0x14 + movs r1, 0 + add r2, sp, 0x4 + bl xxx_call_draw_string + ldr r0, [r4] + ldrb r0, [r0, 0xC] + bl sub_80925DC + adds r2, r0, 0 + ldr r0, [r4] + ldr r3, [r0, 0x74] + str r5, [sp] + movs r0, 0xA + movs r1, 0x14 + bl xxx_call_draw_string + ldr r4, [r4] + ldrb r0, [r4, 0xD] + cmp r0, 0 + beq _08021900 + ldr r2, _080218FC + ldr r3, [r4, 0x74] + str r5, [sp] + movs r0, 0x20 + movs r1, 0x3C + bl xxx_call_draw_string + b _0802190E + .align 2, 0 +_080218F8: .4byte gUnknown_203B28C +_080218FC: .4byte gUnknown_80DC4F0 +_08021900: + ldr r2, _0802193C + ldr r3, [r4, 0x74] + str r0, [sp] + movs r0, 0x20 + movs r1, 0x3C + bl xxx_call_draw_string +_0802190E: + ldr r4, _08021940 + ldr r0, [r4] + ldr r0, [r0, 0x74] + movs r5, 0x4 + str r5, [sp] + movs r1, 0x4 + movs r2, 0x40 + movs r3, 0x14 + bl sub_800792C + ldr r4, [r4] + ldrb r0, [r4, 0xD] + cmp r0, 0 + beq _08021944 + ldr r0, [r4, 0x74] + str r5, [sp] + movs r1, 0xB8 + movs r2, 0x40 + movs r3, 0x14 + bl sub_800792C + b _08021952 + .align 2, 0 +_0802193C: .4byte gUnknown_80DC518 +_08021940: .4byte gUnknown_203B28C +_08021944: + ldr r0, [r4, 0x74] + str r5, [sp] + movs r1, 0x5E + movs r2, 0x40 + movs r3, 0x6E + bl sub_800792C +_08021952: + ldr r5, _080219E8 + ldr r0, [r5] + ldr r0, [r0, 0x74] + movs r4, 0x4 + str r4, [sp] + movs r1, 0x4 + movs r2, 0x82 + movs r3, 0xC8 + bl sub_800792C + ldr r0, [r5] + ldr r0, [r0, 0x74] + str r4, [sp] + movs r1, 0x3 + movs r2, 0x40 + movs r3, 0x43 + bl sub_8007A78 + ldr r0, [r5] + ldr r0, [r0, 0x74] + str r4, [sp] + movs r1, 0xCC + movs r2, 0x40 + movs r3, 0x43 + bl sub_8007A78 + movs r6, 0 + ldr r0, [r5] + ldr r0, [r0, 0x70] + cmp r6, r0 + bge _08021A40 + add r7, sp, 0x104 + mov r8, r5 + mov r9, r6 +_08021996: + adds r0, r6, 0 + movs r1, 0x3 + bl __modsi3 + lsls r1, r0, 6 + subs r1, r0 + adds r5, r1, 0x7 + adds r0, r6, 0 + movs r1, 0x3 + bl __divsi3 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r4, r1, 0 + adds r4, 0x47 + mov r1, r8 + ldr r0, [r1] + lsls r1, r6, 1 + adds r0, 0xE + adds r0, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + adds r0, r7, 0 + bl sub_808D930 + mov r0, r8 + ldr r3, [r0] + lsls r1, r6, 2 + adds r0, r3, 0 + adds r0, 0x30 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0x1 + beq _08021A04 + cmp r0, 0x1 + bcc _080219EC + cmp r0, 0x2 + beq _08021A16 + b _08021A34 + .align 2, 0 +_080219E8: .4byte gUnknown_203B28C +_080219EC: + ldr r0, _08021A00 + ldr r2, [r0] + ldr r3, [r3, 0x74] + mov r1, r9 + str r1, [sp] + adds r0, r5, 0 + adds r1, r4, 0 + bl xxx_call_draw_string + b _08021A34 + .align 2, 0 +_08021A00: .4byte gUnknown_80D49BC +_08021A04: + ldr r3, [r3, 0x74] + mov r2, r9 + str r2, [sp] + adds r0, r5, 0 + adds r1, r4, 0 + adds r2, r7, 0 + bl xxx_call_draw_string + b _08021A34 +_08021A16: + add r0, sp, 0x4 + ldr r1, _08021A58 + adds r2, r7, 0 + bl sub_800D158 + mov r1, r8 + ldr r0, [r1] + ldr r3, [r0, 0x74] + mov r2, r9 + str r2, [sp] + adds r0, r5, 0 + adds r1, r4, 0 + add r2, sp, 0x4 + bl xxx_call_draw_string +_08021A34: + adds r6, 0x1 + mov r1, r8 + ldr r0, [r1] + ldr r0, [r0, 0x70] + cmp r6, r0 + blt _08021996 +_08021A40: + ldr r0, _08021A5C + ldr r0, [r0] + ldr r0, [r0, 0x74] + bl sub_80073E0 + add sp, 0x168 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08021A58: .4byte gUnknown_80DC524 +_08021A5C: .4byte gUnknown_203B28C + thumb_func_end sub_8021894 + + thumb_func_start sub_8021A60 +sub_8021A60: + push {r4-r7,lr} + ldr r2, _08021B4C + ldr r1, [r2] + movs r0, 0 + str r0, [r1, 0x70] + movs r6, 0 + adds r4, r2, 0 + movs r3, 0 +_08021A70: + ldr r1, [r4] + lsls r2, r6, 1 + adds r0, r1, 0 + adds r0, 0xE + adds r0, r2 + strh r3, [r0] + lsls r0, r6, 2 + adds r1, 0x30 + adds r1, r0 + str r3, [r1] + adds r6, 0x1 + cmp r6, 0xF + ble _08021A70 + movs r6, 0 + ldr r7, _08021B4C +_08021A8E: + lsls r0, r6, 16 + asrs r5, r0, 16 + ldr r4, [r7] + adds r0, r5, 0 + bl sub_808DBA8 + ldrb r1, [r4, 0xC] + lsls r0, 24 + lsrs r0, 24 + cmp r1, r0 + bne _08021AC4 + adds r0, r5, 0 + bl sub_808E858 + lsls r0, 16 + asrs r0, 16 + cmp r5, r0 + bne _08021AC4 + ldr r3, [r7] + ldr r1, [r3, 0x70] + lsls r2, r1, 1 + adds r0, r3, 0 + adds r0, 0xE + adds r0, r2 + strh r5, [r0] + adds r1, 0x1 + str r1, [r3, 0x70] +_08021AC4: + adds r6, 0x1 + ldr r0, _08021B50 + cmp r6, r0 + ble _08021A8E + movs r6, 0 +_08021ACE: + lsls r0, r6, 16 + asrs r4, r0, 16 + adds r0, r4, 0 + bl sub_8098134 + lsls r0, 24 + cmp r0, 0 + beq _08021AFC + adds r0, r4, 0 + bl sub_8021B58 + adds r2, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r2, r0 + beq _08021AFC + ldr r0, _08021B4C + ldr r1, [r0] + lsls r0, r2, 2 + adds r1, 0x30 + adds r1, r0 + movs r0, 0x1 + str r0, [r1] +_08021AFC: + adds r6, 0x1 + ldr r0, _08021B50 + cmp r6, r0 + ble _08021ACE + movs r6, 0 + ldr r4, _08021B54 +_08021B08: + movs r0, 0x58 + adds r1, r6, 0 + muls r1, r0 + ldr r0, [r4] + adds r2, r0, r1 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08021B3C + movs r1, 0x8 + ldrsh r0, [r2, r1] + bl sub_8021B58 + adds r2, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r2, r0 + beq _08021B3C + ldr r0, _08021B4C + ldr r1, [r0] + lsls r0, r2, 2 + adds r1, 0x30 + adds r1, r0 + movs r0, 0x2 + str r0, [r1] +_08021B3C: + adds r6, 0x1 + movs r0, 0xCE + lsls r0, 1 + cmp r6, r0 + ble _08021B08 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08021B4C: .4byte gUnknown_203B28C +_08021B50: .4byte 0x000001a7 +_08021B54: .4byte gUnknown_203B45C + thumb_func_end sub_8021A60 + + thumb_func_start sub_8021B58 +sub_8021B58: + push {r4,r5,lr} + lsls r0, 16 + asrs r0, 16 + bl sub_808E858 + lsls r0, 16 + asrs r4, r0, 16 + movs r2, 0 + ldr r0, _08021B84 + ldr r0, [r0] + ldr r1, [r0, 0x70] + cmp r2, r1 + bge _08021B90 + adds r3, r1, 0 + adds r1, r0, 0 + adds r1, 0xE +_08021B78: + movs r5, 0 + ldrsh r0, [r1, r5] + cmp r4, r0 + bne _08021B88 + adds r0, r2, 0 + b _08021B94 + .align 2, 0 +_08021B84: .4byte gUnknown_203B28C +_08021B88: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, r3 + blt _08021B78 +_08021B90: + movs r0, 0x1 + negs r0, r0 +_08021B94: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8021B58 + + thumb_func_start sub_8021B9C +sub_8021B9C: + push {r4-r6,lr} + adds r4, r0, 0 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r5, _08021BF8 + movs r0, 0x9C + lsls r0, 1 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] + movs r6, 0 + str r6, [r0, 0x14] + str r6, [r0, 0x18] + str r4, [r0] + ldr r0, _08021BFC + movs r1, 0x28 + bl sub_808D8E0 + ldr r4, _08021C00 + adds r0, r4, 0 + movs r1, 0x28 + bl sub_808D8E0 + movs r0, 0x28 + bl sub_808D994 + adds r1, r0, 0 + subs r4, 0x50 + adds r0, r4, 0 + bl strcpy + ldr r5, [r5] + ldr r0, [r5] + cmp r0, 0x1 + bne _08021C04 + adds r0, r5, 0 + adds r0, 0xCC + str r6, [r0] + b _08021C0E + .align 2, 0 +_08021BF8: .4byte gUnknown_203B290 +_08021BFC: .4byte gUnknown_202E5D8 +_08021C00: .4byte gUnknown_202E1C8 +_08021C04: + adds r1, r5, 0 + adds r1, 0xCC + adds r0, r5, 0 + adds r0, 0xBC + str r0, [r1] +_08021C0E: + movs r0, 0x28 + bl sub_808DDD0 + ldr r2, _08021C58 + ldr r3, [r2] + adds r1, r3, 0 + adds r1, 0xBC + str r0, [r1] + adds r1, 0x4 + ldr r0, [r0, 0x4] + str r0, [r1] + adds r0, r3, 0 + adds r0, 0xC8 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0xC9 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0xCA + strb r1, [r0] + ldr r1, [r2] + adds r2, r1, 0 + adds r2, 0xC4 + movs r0, 0x2 + strh r0, [r2] + adds r1, 0xC6 + movs r0, 0x8 + strh r0, [r1] + movs r0, 0 + bl sub_8021D44 + movs r0, 0x1 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08021C58: .4byte gUnknown_203B290 + thumb_func_end sub_8021B9C + + thumb_func_start sub_8021C5C +sub_8021C5C: + push {lr} + ldr r0, _08021C74 + ldr r0, [r0] + ldr r0, [r0, 0x4] + cmp r0, 0x17 + bhi _08021D10 + lsls r0, 2 + ldr r1, _08021C78 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08021C74: .4byte gUnknown_203B290 +_08021C78: .4byte _08021C7C + .align 2, 0 +_08021C7C: + .4byte _08021CDC + .4byte _08021CDC + .4byte _08021D10 + .4byte _08021D10 + .4byte _08021D0C + .4byte _08021D10 + .4byte _08021D10 + .4byte _08021D10 + .4byte _08021D10 + .4byte _08021CE2 + .4byte _08021CE2 + .4byte _08021CE8 + .4byte _08021D10 + .4byte _08021CF4 + .4byte _08021CFA + .4byte _08021D10 + .4byte _08021D00 + .4byte _08021CEE + .4byte _08021D10 + .4byte _08021D10 + .4byte _08021D10 + .4byte _08021D10 + .4byte _08021D06 + .4byte _08021D06 +_08021CDC: + bl sub_8022460 + b _08021D14 +_08021CE2: + bl sub_8022538 + b _08021D14 +_08021CE8: + bl sub_80225C8 + b _08021D14 +_08021CEE: + bl sub_80224D4 + b _08021D14 +_08021CF4: + bl sub_80226F0 + b _08021D14 +_08021CFA: + bl sub_8022790 + b _08021D14 +_08021D00: + bl sub_8022668 + b _08021D14 +_08021D06: + bl sub_8022684 + b _08021D14 +_08021D0C: + movs r0, 0x3 + b _08021D16 +_08021D10: + bl sub_80226CC +_08021D14: + movs r0, 0 +_08021D16: + pop {r1} + bx r1 + thumb_func_end sub_8021C5C + + thumb_func_start sub_8021D1C +sub_8021D1C: + push {r4,lr} + ldr r4, _08021D40 + ldr r0, [r4] + cmp r0, 0 + beq _08021D38 + adds r0, 0xBC + ldr r0, [r0] + bl sub_800AA14 + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_08021D38: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08021D40: .4byte gUnknown_203B290 + thumb_func_end sub_8021D1C + + thumb_func_start sub_8021D44 +sub_8021D44: + push {lr} + ldr r1, _08021D58 + ldr r1, [r1] + str r0, [r1, 0x4] + bl sub_8021D5C + bl sub_8021E0C + pop {r0} + bx r0 + .align 2, 0 +_08021D58: .4byte gUnknown_203B290 + thumb_func_end sub_8021D44 + + thumb_func_start sub_8021D5C +sub_8021D5C: + push {r4-r7,lr} + ldr r4, _08021D7C + ldr r0, [r4] + adds r0, 0xD0 + bl sub_8006518 + ldr r1, [r4] + ldr r0, [r1, 0x4] + cmp r0, 0x9 + blt _08021DC8 + cmp r0, 0xA + ble _08021D80 + cmp r0, 0xB + beq _08021DB0 + b _08021DC8 + .align 2, 0 +_08021D7C: .4byte gUnknown_203B290 +_08021D80: + ldr r2, _08021DA8 + adds r1, 0xD0 + adds r0, r2, 0 + ldm r0!, {r3,r5,r6} + stm r1!, {r3,r5,r6} + ldm r0!, {r3,r5,r7} + stm r1!, {r3,r5,r7} + ldr r0, [r4] + movs r6, 0x80 + lsls r6, 1 + adds r0, r6 + ldm r2!, {r1,r3,r7} + stm r0!, {r1,r3,r7} + ldm r2!, {r5-r7} + stm r0!, {r5-r7} + ldr r1, [r4] + adds r1, 0xE8 + ldr r0, _08021DAC + b _08021DB8 + .align 2, 0 +_08021DA8: .4byte gUnknown_80DC534 +_08021DAC: .4byte gUnknown_80DC564 +_08021DB0: + movs r0, 0x80 + lsls r0, 1 + adds r1, r0 + ldr r0, _08021DC4 +_08021DB8: + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + b _08021DEC + .align 2, 0 +_08021DC4: .4byte gUnknown_80DC54C +_08021DC8: + ldr r0, _08021E04 + mov r12, r0 + ldr r4, _08021E08 + movs r3, 0 + movs r2, 0x3 +_08021DD2: + mov r5, r12 + ldr r1, [r5] + adds r1, r3 + adds r1, 0xD0 + adds r0, r4, 0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r3, 0x18 + subs r2, 0x1 + cmp r2, 0 + bge _08021DD2 +_08021DEC: + bl sub_8004914 + ldr r0, _08021E04 + ldr r0, [r0] + adds r0, 0xD0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08021E04: .4byte gUnknown_203B290 +_08021E08: .4byte gUnknown_80DC534 + thumb_func_end sub_8021D5C + + thumb_func_start sub_8021E0C +sub_8021E0C: + push {r4,lr} + sub sp, 0x20 + ldr r1, _08021E28 + ldr r0, [r1] + ldr r0, [r0, 0x4] + adds r4, r1, 0 + cmp r0, 0x1C + bls _08021E1E + b _080222B6 +_08021E1E: + lsls r0, 2 + ldr r1, _08021E2C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08021E28: .4byte gUnknown_203B290 +_08021E2C: .4byte _08021E30 + .align 2, 0 +_08021E30: + .4byte _08021EA4 + .4byte _08021EC0 + .4byte _08021F38 + .4byte _08021F50 + .4byte _080222B6 + .4byte _08021F78 + .4byte _08021F90 + .4byte _08021F08 + .4byte _08021F20 + .4byte _08021FD8 + .4byte _08021FE2 + .4byte _08021FF0 + .4byte _0802208E + .4byte _080220B8 + .4byte _080220D8 + .4byte _080220EA + .4byte _08022080 + .4byte _08022024 + .4byte _08021FA8 + .4byte _08021FC0 + .4byte _08022138 + .4byte _08022150 + .4byte _08022168 + .4byte _08022176 + .4byte _0802217E + .4byte _08022238 + .4byte _08022250 + .4byte _08022268 + .4byte _08022294 +_08021EA4: + bl sub_80222C8 + ldr r2, _08021EB8 + ldr r0, _08021EBC + ldr r4, [r0] + ldr r1, [r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + b _08021ED4 + .align 2, 0 +_08021EB8: .4byte gUnknown_80D79A4 +_08021EBC: .4byte gUnknown_203B290 +_08021EC0: + bl sub_80222C8 + ldr r2, _08021F00 + ldr r0, _08021F04 + ldr r4, [r0] + ldr r1, [r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0x4 +_08021ED4: + adds r0, r2 + ldr r0, [r0] + ldr r2, [r4, 0x14] + adds r3, r4, 0 + adds r3, 0x1C + adds r1, r4, 0 + adds r1, 0x5C + str r1, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + adds r1, r4, 0 + adds r1, 0xCC + ldr r1, [r1] + str r1, [sp, 0xC] + movs r1, 0xC + str r1, [sp, 0x10] + movs r1, 0 + bl sub_8014248 + b _080222B6 + .align 2, 0 +_08021F00: .4byte gUnknown_80D79A4 +_08021F04: .4byte gUnknown_203B290 +_08021F08: + ldr r3, [r4] + movs r0, 0x9 + str r0, [r3, 0x8] + ldr r2, _08021F1C + ldr r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0xC + b _0802227A + .align 2, 0 +_08021F1C: .4byte gUnknown_80D79A4 +_08021F20: + ldr r3, [r4] + movs r0, 0xA + str r0, [r3, 0x8] + ldr r2, _08021F34 + ldr r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0x10 + b _0802227A + .align 2, 0 +_08021F34: .4byte gUnknown_80D79A4 +_08021F38: + ldr r3, [r4] + movs r0, 0x1 + str r0, [r3, 0x8] + ldr r2, _08021F4C + ldr r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0x4C + b _0802227A + .align 2, 0 +_08021F4C: .4byte gUnknown_80D79A4 +_08021F50: + ldr r3, [r4] + movs r0, 0x4 + str r0, [r3, 0x8] + ldr r2, _08021F70 + ldr r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0x8 + adds r0, r2 + ldr r0, [r0] + adds r3, 0xCC + ldr r2, [r3] + ldr r3, _08021F74 + b _08022284 + .align 2, 0 +_08021F70: .4byte gUnknown_80D79A4 +_08021F74: .4byte 0x0000030d +_08021F78: + ldr r3, [r4] + movs r0, 0x3 + str r0, [r3, 0x8] + ldr r2, _08021F8C + ldr r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0x20 + b _0802227A + .align 2, 0 +_08021F8C: .4byte gUnknown_80D79A4 +_08021F90: + ldr r3, [r4] + movs r0, 0xA + str r0, [r3, 0x8] + ldr r2, _08021FA4 + ldr r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0x24 + b _0802227A + .align 2, 0 +_08021FA4: .4byte gUnknown_80D79A4 +_08021FA8: + ldr r3, [r4] + movs r0, 0x3 + str r0, [r3, 0x8] + ldr r2, _08021FBC + ldr r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0x28 + b _0802227A + .align 2, 0 +_08021FBC: .4byte gUnknown_80D79A4 +_08021FC0: + ldr r3, [r4] + movs r0, 0xA + str r0, [r3, 0x8] + ldr r2, _08021FD4 + ldr r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0x2C + b _0802227A + .align 2, 0 +_08021FD4: .4byte gUnknown_80D79A4 +_08021FD8: + movs r0, 0x2 + movs r1, 0x3 + bl sub_80211AC + b _08021FE8 +_08021FE2: + movs r0, 0x1 + bl sub_8021354 +_08021FE8: + movs r0, 0x1 + bl sub_8016C40 + b _080222B6 +_08021FF0: + bl sub_8021494 + movs r0, 0x1 + bl sub_8016C40 + bl sub_8022380 + ldr r0, _08022020 + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x6C + adds r1, r2, 0 + adds r1, 0x1C + adds r3, r2, 0 + adds r3, 0x5C + ldr r2, [r2, 0x18] + str r2, [sp] + movs r2, 0x2 + str r2, [sp, 0x4] + movs r2, 0 + bl sub_8012D60 + b _080222B6 + .align 2, 0 +_08022020: .4byte gUnknown_203B290 +_08022024: + bl sub_8022420 + ldr r0, _08022070 + ldr r4, _08022074 + ldr r1, [r4] + ldrb r1, [r1, 0x10] + movs r2, 0 + bl sub_8092578 + ldr r1, _08022078 + ldr r4, [r4] + ldr r0, [r4, 0xC] + str r0, [r1] + ldr r2, _0802207C + ldr r1, [r4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0x14 + adds r0, r2 + ldr r0, [r0] + adds r3, r4, 0 + adds r3, 0x1C + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + adds r4, 0xCC + ldr r1, [r4] + str r1, [sp, 0xC] + movs r1, 0xC + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0x5 + bl sub_8014248 + b _080222B6 + .align 2, 0 +_08022070: .4byte gUnknown_202E628 +_08022074: .4byte gUnknown_203B290 +_08022078: .4byte gUnknown_202DE30 +_0802207C: .4byte gUnknown_80D79A4 +_08022080: + ldr r0, [r4] + ldrb r0, [r0, 0x10] + movs r1, 0 + movs r2, 0x2 + bl sub_8021774 + b _080222B6 +_0802208E: + ldr r1, [r4] + movs r0, 0xD + str r0, [r1, 0x8] + ldr r0, _080220B0 + ldrb r1, [r1, 0x10] + movs r2, 0 + bl sub_8092578 + ldr r2, _080220B4 + ldr r3, [r4] + ldr r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0x18 + b _0802227A + .align 2, 0 +_080220B0: .4byte gUnknown_202E628 +_080220B4: .4byte gUnknown_80D79A4 +_080220B8: + ldr r1, [r4] + movs r0, 0xE + str r0, [r1, 0x8] + ldr r0, _080220D4 + bl sub_8011988 + ldr r0, [r4] + movs r1, 0x98 + lsls r1, 1 + adds r0, r1 + movs r1, 0x1 + str r1, [r0] + b _080222B6 + .align 2, 0 +_080220D4: .4byte 0x0000025b +_080220D8: + ldr r0, [r4] + movs r1, 0xF + str r1, [r0, 0x8] + movs r1, 0x9A + lsls r1, 1 + adds r0, r1 + movs r1, 0x1E + str r1, [r0] + b _080222B6 +_080220EA: + movs r0, 0x2 + bl sub_8021700 + lsls r0, 24 + cmp r0, 0 + beq _08022108 + bl sub_80213A0 + ldr r0, _08022104 + ldr r1, [r0] + movs r0, 0x12 + b _0802210E + .align 2, 0 +_08022104: .4byte gUnknown_203B290 +_08022108: + ldr r0, _08022130 + ldr r1, [r0] + movs r0, 0x8 +_0802210E: + str r0, [r1, 0x8] + movs r0, 0xCE + bl sub_8011988 + ldr r3, _08022134 + ldr r0, _08022130 + ldr r2, [r0] + ldr r1, [r2] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r3, 0x1C + adds r0, r3 + ldr r0, [r0] + adds r2, 0xCC + ldr r2, [r2] + b _08022282 + .align 2, 0 +_08022130: .4byte gUnknown_203B290 +_08022134: .4byte gUnknown_80D79A4 +_08022138: + ldr r3, [r4] + movs r0, 0x16 + str r0, [r3, 0x8] + ldr r2, _0802214C + ldr r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0x30 + b _0802227A + .align 2, 0 +_0802214C: .4byte gUnknown_80D79A4 +_08022150: + ldr r3, [r4] + movs r0, 0x17 + str r0, [r3, 0x8] + ldr r2, _08022164 + ldr r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0x34 + b _0802227A + .align 2, 0 +_08022164: .4byte gUnknown_80D79A4 +_08022168: + movs r0, 0 + movs r1, 0x3 + movs r2, 0 + movs r3, 0xA + bl sub_8023144 + b _080222B6 +_08022176: + movs r0, 0x1 + bl sub_8023354 + b _080222B6 +_0802217E: + ldr r4, _080221A0 + ldr r0, [r4] + ldrb r0, [r0, 0x10] + add r1, sp, 0x14 + movs r2, 0 + movs r3, 0 + bl sub_8092638 + add r0, sp, 0x14 + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _080221A4 + ldr r1, [r4] + movs r0, 0x19 + str r0, [r1, 0x8] + b _080221FA + .align 2, 0 +_080221A0: .4byte gUnknown_203B290 +_080221A4: + ldr r0, [r4] + ldrb r0, [r0, 0x10] + bl sub_8092534 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _080221E0 + cmp r0, 0x2 + bgt _080221BE + cmp r0, 0x1 + beq _080221C4 + b _080221F0 +_080221BE: + cmp r0, 0x3 + beq _080221E8 + b _080221F0 +_080221C4: + movs r0, 0x6 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _080221D8 + ldr r1, [r4] + movs r0, 0x15 + str r0, [r1, 0x8] + b _080221FA +_080221D8: + ldr r1, [r4] + movs r0, 0x1A + str r0, [r1, 0x8] + b _080221FA +_080221E0: + ldr r1, [r4] + movs r0, 0x1B + str r0, [r1, 0x8] + b _080221FA +_080221E8: + ldr r1, [r4] + movs r0, 0x1C + str r0, [r1, 0x8] + b _080221FA +_080221F0: + ldr r2, _08022228 + ldr r1, [r2] + movs r0, 0x15 + str r0, [r1, 0x8] + adds r4, r2, 0 +_080221FA: + ldr r0, [r4] + movs r1, 0x12 + ldrsh r0, [r0, r1] + bl sub_808D994 + adds r1, r0, 0 + ldr r0, _0802222C + bl strcpy + ldr r0, _08022230 + ldr r1, [r4] + ldrb r1, [r1, 0x10] + movs r2, 0 + bl sub_8092578 + ldr r2, _08022234 + ldr r3, [r4] + ldr r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0x38 + b _0802227A + .align 2, 0 +_08022228: .4byte gUnknown_203B290 +_0802222C: .4byte gUnknown_202DF98 +_08022230: .4byte gUnknown_202E628 +_08022234: .4byte gUnknown_80D79A4 +_08022238: + ldr r3, [r4] + movs r0, 0x15 + str r0, [r3, 0x8] + ldr r2, _0802224C + ldr r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0x3C + b _0802227A + .align 2, 0 +_0802224C: .4byte gUnknown_80D79A4 +_08022250: + ldr r3, [r4] + movs r0, 0x15 + str r0, [r3, 0x8] + ldr r2, _08022264 + ldr r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0x40 + b _0802227A + .align 2, 0 +_08022264: .4byte gUnknown_80D79A4 +_08022268: + ldr r3, [r4] + movs r0, 0x15 + str r0, [r3, 0x8] + ldr r2, _0802228C + ldr r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0x44 +_0802227A: + adds r0, r2 + ldr r0, [r0] + adds r3, 0xCC + ldr r2, [r3] +_08022282: + ldr r3, _08022290 +_08022284: + movs r1, 0 + bl sub_80141B4 + b _080222B6 + .align 2, 0 +_0802228C: .4byte gUnknown_80D79A4 +_08022290: .4byte 0x0000010d +_08022294: + ldr r3, [r4] + movs r0, 0x15 + str r0, [r3, 0x8] + ldr r2, _080222C0 + ldr r1, [r3] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r2, 0x48 + adds r0, r2 + ldr r0, [r0] + adds r3, 0xCC + ldr r2, [r3] + ldr r3, _080222C4 + movs r1, 0 + bl sub_80141B4 +_080222B6: + add sp, 0x20 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080222C0: .4byte gUnknown_80D79A4 +_080222C4: .4byte 0x0000010d + thumb_func_end sub_8021E0C + + thumb_func_start sub_80222C8 +sub_80222C8: + push {r4-r7,lr} + ldr r4, _08022344 + ldr r0, [r4] + adds r0, 0x5C + movs r1, 0 + movs r2, 0x10 + bl MemoryFill16 + ldr r1, [r4] + movs r5, 0 + ldr r0, _08022348 + ldr r0, [r0] + str r0, [r1, 0x1C] + adds r3, r1, 0 + adds r3, 0x20 + movs r0, 0x2 + str r0, [r1, 0x20] + movs r2, 0x1 + ldr r0, _0802234C + ldr r0, [r0] + str r0, [r1, 0x24] + movs r0, 0x3 + str r0, [r1, 0x28] + ldr r0, _08022350 + ldr r0, [r0] + str r0, [r1, 0x2C] + movs r0, 0x4 + str r0, [r1, 0x30] + ldr r0, _08022354 + ldr r0, [r0] + str r0, [r1, 0x34] + str r2, [r1, 0x38] + movs r7, 0x4 + str r5, [r1, 0x3C] + str r2, [r3, 0x20] + adds r6, r1, 0 + adds r2, r6, 0 + adds r2, 0x5C +_08022314: + ldrh r0, [r2] + cmp r0, 0 + bne _08022322 + ldr r1, [r3] + ldr r0, [r6, 0x14] + cmp r1, r0 + beq _0802237A +_08022322: + adds r3, 0x8 + adds r2, 0x2 + adds r5, 0x1 + cmp r5, r7 + blt _08022314 + movs r5, 0 + cmp r5, r7 + bge _0802237A + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x5C + ldrh r0, [r0] + cmp r0, 0 + bne _08022358 + ldr r0, [r1, 0x20] + str r0, [r1, 0x14] + b _0802237A + .align 2, 0 +_08022344: .4byte gUnknown_203B290 +_08022348: .4byte gUnknown_80D4978 +_0802234C: .4byte gUnknown_80D499C +_08022350: .4byte gUnknown_80D4970 +_08022354: .4byte gUnknown_80D4934 +_08022358: + adds r5, 0x1 + cmp r5, r7 + bge _0802237A + ldr r2, [r4] + lsls r0, r5, 1 + adds r1, r2, 0 + adds r1, 0x5C + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _08022358 + lsls r0, r5, 3 + adds r1, r2, 0 + adds r1, 0x20 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x14] +_0802237A: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80222C8 + + thumb_func_start sub_8022380 +sub_8022380: + push {r4-r7,lr} + ldr r4, _080223EC + ldr r0, [r4] + adds r0, 0x5C + movs r1, 0 + movs r2, 0x10 + bl MemoryFill16 + ldr r3, [r4] + movs r2, 0 + ldr r0, _080223F0 + ldr r0, [r0] + str r0, [r3, 0x1C] + movs r0, 0x2 + str r0, [r3, 0x20] + movs r1, 0x1 + ldr r0, _080223F4 + ldr r0, [r0] + str r0, [r3, 0x24] + movs r0, 0x4 + str r0, [r3, 0x28] + movs r6, 0x2 + str r2, [r3, 0x2C] + str r1, [r3, 0x30] + movs r5, 0 + mov r12, r3 + adds r3, 0x20 + mov r2, r12 + adds r2, 0x5C +_080223BA: + ldrh r0, [r2] + cmp r0, 0 + bne _080223CA + ldr r1, [r3] + mov r7, r12 + ldr r0, [r7, 0x18] + cmp r1, r0 + beq _0802241A +_080223CA: + adds r3, 0x8 + adds r2, 0x2 + adds r5, 0x1 + cmp r5, r6 + blt _080223BA + movs r5, 0 + cmp r5, r6 + bge _0802241A + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x5C + ldrh r0, [r0] + cmp r0, 0 + bne _080223F8 + ldr r0, [r1, 0x20] + str r0, [r1, 0x18] + b _0802241A + .align 2, 0 +_080223EC: .4byte gUnknown_203B290 +_080223F0: .4byte gUnknown_80D4978 +_080223F4: .4byte gUnknown_80D4970 +_080223F8: + adds r5, 0x1 + cmp r5, r6 + bge _0802241A + ldr r2, [r4] + lsls r0, r5, 1 + adds r1, r2, 0 + adds r1, 0x5C + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _080223F8 + lsls r0, r5, 3 + adds r1, r2, 0 + adds r1, 0x20 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x18] +_0802241A: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8022380 + + thumb_func_start sub_8022420 +sub_8022420: + push {r4,lr} + ldr r4, _08022454 + ldr r0, [r4] + adds r0, 0x5C + movs r1, 0 + movs r2, 0x10 + bl MemoryFill16 + ldr r1, [r4] + movs r3, 0 + ldr r0, _08022458 + ldr r0, [r0] + str r0, [r1, 0x1C] + movs r0, 0x5 + str r0, [r1, 0x20] + movs r2, 0x1 + ldr r0, _0802245C + ldr r0, [r0] + str r0, [r1, 0x24] + movs r0, 0x6 + str r0, [r1, 0x28] + str r3, [r1, 0x2C] + str r2, [r1, 0x30] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08022454: .4byte gUnknown_203B290 +_08022458: .4byte gUnknown_80D4920 +_0802245C: .4byte gUnknown_80D4928 + thumb_func_end sub_8022420 + + thumb_func_start sub_8022460 +sub_8022460: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080224CC + ldr r1, [sp] + cmp r1, 0x1 + beq _0802247A + ldr r0, _0802248C + ldr r0, [r0] + str r1, [r0, 0x14] +_0802247A: + ldr r0, [sp] + cmp r0, 0x2 + beq _0802249A + cmp r0, 0x2 + bgt _08022490 + cmp r0, 0x1 + beq _080224C6 + b _080224CC + .align 2, 0 +_0802248C: .4byte gUnknown_203B290 +_08022490: + cmp r0, 0x3 + beq _080224B6 + cmp r0, 0x4 + beq _080224BE + b _080224CC +_0802249A: + movs r0, 0x2 + bl sub_8021700 + lsls r0, 24 + cmp r0, 0 + beq _080224AE + movs r0, 0x5 + bl sub_8021D44 + b _080224CC +_080224AE: + movs r0, 0x7 + bl sub_8021D44 + b _080224CC +_080224B6: + movs r0, 0x14 + bl sub_8021D44 + b _080224CC +_080224BE: + movs r0, 0x2 + bl sub_8021D44 + b _080224CC +_080224C6: + movs r0, 0x3 + bl sub_8021D44 +_080224CC: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8022460 + + thumb_func_start sub_80224D4 +sub_80224D4: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08022532 + ldr r0, [sp] + cmp r0, 0x5 + beq _080224F8 + cmp r0, 0x5 + bgt _080224F2 + cmp r0, 0x1 + beq _0802252C + b _08022532 +_080224F2: + cmp r0, 0x6 + beq _0802252C + b _08022532 +_080224F8: + ldr r0, _08022524 + ldr r2, [r0] + movs r0, 0x98 + lsls r0, 2 + adds r2, r0 + ldr r0, _08022528 + ldr r3, [r0] + ldr r0, [r2] + ldr r1, [r3, 0xC] + subs r0, r1 + str r0, [r2] + ldrb r0, [r3, 0x10] + bl sub_80925EC + movs r0, 0xA6 + lsls r0, 1 + bl sub_8011988 + movs r0, 0xC + bl sub_8021D44 + b _08022532 + .align 2, 0 +_08022524: .4byte gUnknown_203B460 +_08022528: .4byte gUnknown_203B290 +_0802252C: + movs r0, 0xA + bl sub_8021D44 +_08022532: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80224D4 + + thumb_func_start sub_8022538 +sub_8022538: + push {r4,lr} + movs r0, 0x1 + bl sub_8021274 + cmp r0, 0x4 + bhi _080225BC + lsls r0, 2 + ldr r1, _08022550 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08022550: .4byte _08022554 + .align 2, 0 +_08022554: + .4byte _080225C2 + .4byte _080225BC + .4byte _080225B0 + .4byte _08022568 + .4byte _0802258C +_08022568: + bl sub_802132C + ldr r4, _08022588 + ldr r1, [r4] + strb r0, [r1, 0x10] + ldr r0, [r4] + ldrb r0, [r0, 0x10] + bl sub_8092544 + ldr r1, [r4] + str r0, [r1, 0xC] + movs r0, 0xB + bl sub_8021D44 + b _080225C2 + .align 2, 0 +_08022588: .4byte gUnknown_203B290 +_0802258C: + bl sub_802132C + ldr r4, _080225AC + ldr r1, [r4] + strb r0, [r1, 0x10] + ldr r0, [r4] + ldrb r0, [r0, 0x10] + bl sub_8092544 + ldr r1, [r4] + str r0, [r1, 0xC] + movs r0, 0x10 + bl sub_8021D44 + b _080225C2 + .align 2, 0 +_080225AC: .4byte gUnknown_203B290 +_080225B0: + bl sub_80213A0 + movs r0, 0x1 + bl sub_8021D44 + b _080225C2 +_080225BC: + movs r0, 0x1 + bl sub_8016C40 +_080225C2: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8022538 + + thumb_func_start sub_80225C8 +sub_80225C8: + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + bl sub_8021274 + ldr r4, _08022608 + ldr r0, [r4] + adds r0, 0x6C + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _080225F8 + ldr r0, [r4] + adds r0, 0x6C + mov r1, sp + bl sub_8013114 + ldr r1, [sp] + cmp r1, 0x1 + beq _080225F8 + ldr r0, [r4] + str r1, [r0, 0x18] +_080225F8: + ldr r0, [sp] + cmp r0, 0x2 + beq _08022612 + cmp r0, 0x2 + bgt _0802260C + cmp r0, 0x1 + beq _08022658 + b _0802265E + .align 2, 0 +_08022608: .4byte gUnknown_203B290 +_0802260C: + cmp r0, 0x4 + beq _08022650 + b _0802265E +_08022612: + ldr r0, _0802262C + ldr r0, [r0] + movs r1, 0x98 + lsls r1, 2 + adds r0, r1 + ldr r1, [r0] + cmp r1, 0 + bne _08022630 + movs r0, 0x6 + bl sub_8021D44 + b _0802265E + .align 2, 0 +_0802262C: .4byte gUnknown_203B460 +_08022630: + ldr r0, _08022644 + ldr r0, [r0] + ldr r0, [r0, 0xC] + cmp r0, r1 + ble _08022648 + movs r0, 0x13 + bl sub_8021D44 + b _0802265E + .align 2, 0 +_08022644: .4byte gUnknown_203B290 +_08022648: + movs r0, 0x11 + bl sub_8021D44 + b _0802265E +_08022650: + movs r0, 0x10 + bl sub_8021D44 + b _0802265E +_08022658: + movs r0, 0xA + bl sub_8021D44 +_0802265E: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80225C8 + + thumb_func_start sub_8022668 +sub_8022668: + push {lr} + bl sub_80217EC + cmp r0, 0x1 + bls _08022680 + cmp r0, 0x3 + bhi _08022680 + bl sub_8021830 + movs r0, 0xA + bl sub_8021D44 +_08022680: + pop {r0} + bx r0 + thumb_func_end sub_8022668 + + thumb_func_start sub_8022684 +sub_8022684: + push {r4,lr} + movs r0, 0x1 + bl sub_8023278 + cmp r0, 0x2 + beq _080226BC + cmp r0, 0x2 + bcc _080226C6 + cmp r0, 0x3 + bne _080226C6 + bl sub_802331C + ldr r4, _080226B8 + ldr r1, [r4] + strh r0, [r1, 0x12] + movs r2, 0x12 + ldrsh r0, [r1, r2] + bl sub_808DBA8 + ldr r1, [r4] + strb r0, [r1, 0x10] + movs r0, 0x18 + bl sub_8021D44 + b _080226C6 + .align 2, 0 +_080226B8: .4byte gUnknown_203B290 +_080226BC: + bl sub_80233A0 + movs r0, 0x1 + bl sub_8021D44 +_080226C6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8022684 + + thumb_func_start sub_80226CC +sub_80226CC: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080226E4 + ldr r0, _080226EC + ldr r0, [r0] + ldr r0, [r0, 0x8] + bl sub_8021D44 +_080226E4: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_080226EC: .4byte gUnknown_203B290 + thumb_func_end sub_80226CC + + thumb_func_start sub_80226F0 +sub_80226F0: + push {r4,lr} + sub sp, 0x4 + mov r1, sp + movs r2, 0 + movs r0, 0x80 + strb r0, [r1] + strb r0, [r1, 0x1] + movs r0, 0x10 + strb r0, [r1, 0x2] + strb r2, [r1, 0x3] + bl sub_8099B94 + lsls r0, 24 + cmp r0, 0 + bne _08022782 + ldr r0, _08022728 + ldr r0, [r0] + movs r1, 0x98 + lsls r1, 1 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0x4 + bhi _0802275C + lsls r0, 2 + ldr r1, _0802272C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08022728: .4byte gUnknown_203B290 +_0802272C: .4byte _08022730 + .align 2, 0 +_08022730: + .4byte _0802275C + .4byte _08022744 + .4byte _08022750 + .4byte _08022744 + .4byte _08022750 +_08022744: + movs r0, 0x5 + movs r1, 0x2 + ldr r2, [sp] + bl sub_8099AFC + b _08022772 +_08022750: + movs r0, 0x5 + movs r1, 0x2 + ldr r2, [sp] + bl sub_8099A5C + b _08022772 +_0802275C: + ldr r4, _0802278C + ldr r0, [r4] + ldr r0, [r0, 0x8] + bl sub_8021D44 + ldr r0, [r4] + movs r1, 0x98 + lsls r1, 1 + adds r0, r1 + movs r1, 0 + str r1, [r0] +_08022772: + ldr r0, _0802278C + ldr r1, [r0] + movs r0, 0x98 + lsls r0, 1 + adds r1, r0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_08022782: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802278C: .4byte gUnknown_203B290 + thumb_func_end sub_80226F0 + + thumb_func_start sub_8022790 +sub_8022790: + push {lr} + ldr r0, _080227A8 + ldr r2, [r0] + movs r0, 0x9A + lsls r0, 1 + adds r1, r2, r0 + ldr r0, [r1] + cmp r0, 0 + beq _080227AC + subs r0, 0x1 + str r0, [r1] + b _080227B2 + .align 2, 0 +_080227A8: .4byte gUnknown_203B290 +_080227AC: + ldr r0, [r2, 0x8] + bl sub_8021D44 +_080227B2: + pop {r0} + bx r0 + thumb_func_end sub_8022790 + + thumb_func_start sub_80227B8 +sub_80227B8: + push {r4,r5,lr} + adds r5, r0, 0 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r4, _08022810 + movs r0, 0xD4 + lsls r0, 1 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r4] + adds r2, r0, 0 + adds r2, 0xF4 + movs r1, 0 + str r1, [r2] + str r5, [r0, 0x48] + cmp r5, 0 + beq _08022820 + ldr r4, _08022814 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x7 + bl sub_808D9AC + adds r4, 0x50 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x6 + bl sub_808D9AC + bl sub_809177C + lsls r0, 24 + cmp r0, 0 + beq _08022818 + movs r0, 0 + bl sub_8022924 + b _08022856 + .align 2, 0 +_08022810: .4byte gUnknown_203B294 +_08022814: .4byte gUnknown_202DF98 +_08022818: + movs r0, 0x11 + bl sub_8022924 + b _08022856 +_08022820: + ldr r4, _08022848 + ldr r5, _0802284C + adds r0, r4, 0 + adds r1, r5, 0 + bl strcpy + adds r4, 0x50 + adds r0, r4, 0 + adds r1, r5, 0 + bl strcpy + bl sub_8090A34 + cmp r0, 0 + bne _08022850 + movs r0, 0x12 + bl sub_8022924 + b _08022856 + .align 2, 0 +_08022848: .4byte gUnknown_202DF98 +_0802284C: .4byte gUnknown_80DC5EC +_08022850: + movs r0, 0 + bl sub_8022924 +_08022856: + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80227B8 + + thumb_func_start sub_8022860 +sub_8022860: + push {lr} + ldr r0, _08022878 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0x16 + bhi _080228FE + lsls r0, 2 + ldr r1, _0802287C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08022878: .4byte gUnknown_203B294 +_0802287C: .4byte _08022880 + .align 2, 0 +_08022880: + .4byte _080228DC + .4byte _080228DC + .4byte _080228E2 + .4byte _080228E8 + .4byte _080228EE + .4byte _080228FE + .4byte _080228FE + .4byte _080228FE + .4byte _080228FE + .4byte _080228FE + .4byte _080228FE + .4byte _080228FE + .4byte _080228FE + .4byte _080228FE + .4byte _080228FE + .4byte _080228FE + .4byte _080228FE + .4byte _080228FE + .4byte _080228FE + .4byte _080228FE + .4byte _080228FE + .4byte _080228F4 + .4byte _080228FA +_080228DC: + bl sub_8022E78 + b _08022902 +_080228E2: + bl sub_8022EF4 + b _08022902 +_080228E8: + bl sub_8023068 + b _08022902 +_080228EE: + bl sub_80230E8 + b _08022902 +_080228F4: + bl sub_8023104 + b _08022902 +_080228FA: + movs r0, 0x3 + b _08022904 +_080228FE: + bl sub_8023120 +_08022902: + movs r0, 0 +_08022904: + pop {r1} + bx r1 + thumb_func_end sub_8022860 + + thumb_func_start sub_8022908 +sub_8022908: + push {r4,lr} + ldr r4, _08022920 + ldr r0, [r4] + cmp r0, 0 + beq _0802291A + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0802291A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08022920: .4byte gUnknown_203B294 + thumb_func_end sub_8022908 + + thumb_func_start sub_8022924 +sub_8022924: + push {lr} + ldr r1, _08022938 + ldr r1, [r1] + str r0, [r1] + bl sub_802293C + bl sub_8022A10 + pop {r0} + bx r0 + .align 2, 0 +_08022938: .4byte gUnknown_203B294 + thumb_func_end sub_8022924 + + thumb_func_start sub_802293C +sub_802293C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, _08022964 + ldr r0, [r4] + movs r1, 0xA4 + lsls r1, 1 + adds r0, r1 + bl sub_8006518 + ldr r1, [r4] + ldr r0, [r1] + cmp r0, 0x3 + beq _080229A4 + cmp r0, 0x3 + bgt _08022968 + cmp r0, 0x2 + beq _08022972 + b _080229BC + .align 2, 0 +_08022964: .4byte gUnknown_203B294 +_08022968: + cmp r0, 0x10 + bgt _080229BC + cmp r0, 0xA + blt _080229BC + b _080229E6 +_08022972: + bl sub_8022D2C + ldr r2, [r4] + movs r0, 0xBC + lsls r0, 1 + adds r2, r0 + ldr r1, _080229A0 + ldm r1!, {r3,r5,r6} + stm r2!, {r3,r5,r6} + ldm r1!, {r3,r5,r7} + stm r2!, {r3,r5,r7} + ldr r1, [r4] + adds r0, r1, r0 + adds r1, 0xF8 + bl sub_8012CAC + ldr r0, [r4] + movs r6, 0xC2 + lsls r6, 1 + adds r0, r6 + movs r1, 0x6 + strh r1, [r0] + b _080229E6 + .align 2, 0 +_080229A0: .4byte gUnknown_80DC5BC +_080229A4: + movs r7, 0xB0 + lsls r7, 1 + adds r1, r7 + ldr r0, _080229B8 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + b _080229E6 + .align 2, 0 +_080229B8: .4byte gUnknown_80DC5D4 +_080229BC: + ldr r0, _08022A08 + mov r12, r0 + movs r1, 0xA4 + lsls r1, 1 + mov r8, r1 + ldr r4, _08022A0C + movs r3, 0 + movs r2, 0x3 +_080229CC: + mov r5, r12 + ldr r1, [r5] + adds r1, r3 + add r1, r8 + adds r0, r4, 0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r3, 0x18 + subs r2, 0x1 + cmp r2, 0 + bge _080229CC +_080229E6: + bl sub_8004914 + ldr r0, _08022A08 + ldr r0, [r0] + movs r6, 0xA4 + lsls r6, 1 + adds r0, r6 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08022A08: .4byte gUnknown_203B294 +_08022A0C: .4byte gUnknown_80DC5A4 + thumb_func_end sub_802293C + + thumb_func_start sub_8022A10 +sub_8022A10: + push {r4-r7,lr} + sub sp, 0x8 + ldr r1, _08022A2C + ldr r0, [r1] + ldr r0, [r0] + adds r4, r1, 0 + cmp r0, 0x16 + bls _08022A22 + b _08022D1E +_08022A22: + lsls r0, 2 + ldr r1, _08022A30 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08022A2C: .4byte gUnknown_203B294 +_08022A30: .4byte _08022A34 + .align 2, 0 +_08022A34: + .4byte _08022A90 + .4byte _08022AAA + .4byte _08022AB2 + .4byte _08022AE0 + .4byte _08022B10 + .4byte _08022B1A + .4byte _08022B24 + .4byte _08022B34 + .4byte _08022B44 + .4byte _08022B54 + .4byte _08022B64 + .4byte _08022C28 + .4byte _08022CA0 + .4byte _08022CA8 + .4byte _08022CB0 + .4byte _08022CB8 + .4byte _08022CC0 + .4byte _08022CC8 + .4byte _08022CD8 + .4byte _08022CE8 + .4byte _08022CF8 + .4byte _08022D14 + .4byte _08022D1E +_08022A90: + ldr r0, [r4] + ldr r0, [r0, 0x48] + cmp r0, 0 + beq _08022A9C + movs r0, 0x5 + b _08022A9E +_08022A9C: + movs r0, 0x1 +_08022A9E: + movs r1, 0x3 + movs r2, 0 + movs r3, 0xA + bl sub_801A5D8 + b _08022D22 +_08022AAA: + movs r0, 0x1 + bl sub_801A8D0 + b _08022D22 +_08022AB2: + bl sub_801A9E0 + ldr r0, _08022ADC + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x54 + adds r1, r2, 0 + adds r1, 0xF8 + movs r4, 0x9C + lsls r4, 1 + adds r3, r2, r4 + adds r2, 0xF4 + ldr r2, [r2] + str r2, [sp] + movs r2, 0x2 + str r2, [sp, 0x4] + movs r2, 0 + bl sub_8012D60 + b _08022D22 + .align 2, 0 +_08022ADC: .4byte gUnknown_203B294 +_08022AE0: + bl sub_801A9E0 + ldr r4, _08022B08 + ldr r0, [r4] + adds r0, 0x54 + movs r1, 0 + bl sub_8012EA4 + ldr r0, [r4] + adds r0, 0xA4 + ldr r1, _08022B0C + movs r2, 0x3 + str r2, [sp] + movs r2, 0x1 + str r2, [sp, 0x4] + movs r2, 0 + movs r3, 0 + bl sub_8012D60 + b _08022D22 + .align 2, 0 +_08022B08: .4byte gUnknown_203B294 +_08022B0C: .4byte gUnknown_80DC584 +_08022B10: + ldr r0, [r4] + adds r0, 0x50 + bl sub_801B3C0 + b _08022D22 +_08022B1A: + ldr r0, _08022B20 + b _08022D00 + .align 2, 0 +_08022B20: .4byte gUnknown_80DC5F4 +_08022B24: + ldr r0, _08022B2C + ldr r3, _08022B30 + b _08022D02 + .align 2, 0 +_08022B2C: .4byte gUnknown_80DC618 +_08022B30: .4byte 0x00000101 +_08022B34: + ldr r0, _08022B3C + ldr r3, _08022B40 + b _08022D02 + .align 2, 0 +_08022B3C: .4byte gUnknown_80DC674 +_08022B40: .4byte 0x00000101 +_08022B44: + ldr r0, _08022B4C + ldr r3, _08022B50 + b _08022D02 + .align 2, 0 +_08022B4C: .4byte gUnknown_80DC6CC +_08022B50: .4byte 0x00000101 +_08022B54: + ldr r0, _08022B5C + ldr r3, _08022B60 + b _08022D02 + .align 2, 0 +_08022B5C: .4byte gUnknown_80DC728 +_08022B60: .4byte 0x00000101 +_08022B64: + ldr r7, _08022B68 + b _08022B78 + .align 2, 0 +_08022B68: .4byte gUnknown_203B294 +_08022B6C: + ldr r1, [r4] + ldr r0, [r1, 0x40] + adds r0, 0x1 + str r0, [r1, 0x40] + cmp r0, 0x17 + bgt _08022C10 +_08022B78: + movs r5, 0 + movs r6, 0 + movs r3, 0 + ldr r2, [r4] + ldr r0, [r2, 0x38] + cmp r5, r0 + bge _08022BA4 + ldrb r1, [r2, 0x8] + b _08022B9C +_08022B8A: + adds r3, 0x1 + ldr r2, [r4] + ldr r0, [r2, 0x38] + cmp r3, r0 + bge _08022BA4 + adds r0, r2, 0 + adds r0, 0x8 + adds r0, r3 + ldrb r1, [r0] +_08022B9C: + ldr r0, [r2, 0x40] + cmp r1, r0 + bne _08022B8A + movs r5, 0x1 +_08022BA4: + movs r3, 0 + ldr r2, [r4] + ldr r0, [r2, 0x3C] + cmp r3, r0 + bge _08022BCE + adds r0, r2, 0 + adds r0, 0x20 + b _08022BC4 +_08022BB4: + adds r3, 0x1 + ldr r2, [r4] + ldr r0, [r2, 0x3C] + cmp r3, r0 + bge _08022BCE + adds r0, r2, 0 + adds r0, 0x20 + adds r0, r3 +_08022BC4: + ldrb r1, [r0] + ldr r0, [r2, 0x40] + cmp r1, r0 + bne _08022BB4 + movs r6, 0x1 +_08022BCE: + cmp r5, r6 + beq _08022B6C + ldr r1, [r7] + movs r0, 0xA + str r0, [r1, 0x4] + ldr r0, [r1, 0x40] + lsls r0, 24 + lsrs r0, 24 + bl sub_808EAB0 + adds r1, r0, 0 + ldr r0, _08022C18 + bl strcpy + movs r0, 0xCB + bl sub_8011988 + ldr r0, _08022C1C + movs r1, 0 + movs r2, 0 + ldr r3, _08022C20 + bl sub_80141B4 + ldr r1, [r7] + ldr r0, [r1, 0x40] + adds r0, 0x1 + str r0, [r1, 0x40] + ldr r0, _08022C24 + ldr r0, [r0] + ldr r0, [r0, 0x40] + cmp r0, 0x17 + bgt _08022C10 + b _08022D22 +_08022C10: + movs r0, 0xB + bl sub_8022924 + b _08022D22 + .align 2, 0 +_08022C18: .4byte gUnknown_202DEA8 +_08022C1C: .4byte gUnknown_80DC788 +_08022C20: .4byte 0x00000101 +_08022C24: .4byte gUnknown_203B294 +_08022C28: + ldr r1, [r4] + movs r0, 0x16 + str r0, [r1, 0x4] + bl nullsub_104 + ldr r0, [r4] + adds r0, 0x46 + ldrh r0, [r0] + cmp r0, 0x8 + bhi _08022C98 + lsls r0, 2 + ldr r1, _08022C48 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08022C48: .4byte _08022C4C + .align 2, 0 +_08022C4C: + .4byte _08022C70 + .4byte _08022C78 + .4byte _08022C80 + .4byte _08022C98 + .4byte _08022C88 + .4byte _08022C98 + .4byte _08022C98 + .4byte _08022C98 + .4byte _08022C90 +_08022C70: + movs r0, 0x16 + bl sub_8022924 + b _08022D22 +_08022C78: + movs r0, 0xD + bl sub_8022924 + b _08022D22 +_08022C80: + movs r0, 0xE + bl sub_8022924 + b _08022D22 +_08022C88: + movs r0, 0xF + bl sub_8022924 + b _08022D22 +_08022C90: + movs r0, 0x10 + bl sub_8022924 + b _08022D22 +_08022C98: + movs r0, 0xC + bl sub_8022924 + b _08022D22 +_08022CA0: + ldr r0, _08022CA4 + b _08022D00 + .align 2, 0 +_08022CA4: .4byte gUnknown_80DC7B4 +_08022CA8: + ldr r0, _08022CAC + b _08022D00 + .align 2, 0 +_08022CAC: .4byte gUnknown_80DC7FC +_08022CB0: + ldr r0, _08022CB4 + b _08022D00 + .align 2, 0 +_08022CB4: .4byte gUnknown_80DC81C +_08022CB8: + ldr r0, _08022CBC + b _08022D00 + .align 2, 0 +_08022CBC: .4byte gUnknown_80DC844 +_08022CC0: + ldr r0, _08022CC4 + b _08022D00 + .align 2, 0 +_08022CC4: .4byte gUnknown_80DC864 +_08022CC8: + ldr r1, [r4] + movs r0, 0x16 + str r0, [r1, 0x4] + ldr r0, _08022CD4 + b _08022D00 + .align 2, 0 +_08022CD4: .4byte gUnknown_80DC88C +_08022CD8: + ldr r1, [r4] + movs r0, 0x16 + str r0, [r1, 0x4] + ldr r0, _08022CE4 + b _08022D00 + .align 2, 0 +_08022CE4: .4byte gUnknown_80DC8AC +_08022CE8: + ldr r1, [r4] + movs r0, 0x16 + str r0, [r1, 0x4] + ldr r0, _08022CF4 + b _08022D00 + .align 2, 0 +_08022CF4: .4byte gUnknown_80DC8C8 +_08022CF8: + ldr r1, [r4] + movs r0, 0x16 + str r0, [r1, 0x4] + ldr r0, _08022D0C +_08022D00: + ldr r3, _08022D10 +_08022D02: + movs r1, 0 + movs r2, 0 + bl sub_80141B4 + b _08022D22 + .align 2, 0 +_08022D0C: .4byte gUnknown_80DC8DC +_08022D10: .4byte 0x00000301 +_08022D14: + ldr r0, [r4] + ldr r0, [r0, 0x4C] + bl sub_801AFA4 + b _08022D22 +_08022D1E: + bl sub_801A928 +_08022D22: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8022A10 + + thumb_func_start sub_8022D2C +sub_8022D2C: + push {r4-r7,lr} + movs r6, 0 + ldr r4, _08022D78 + ldr r0, [r4] + movs r1, 0x9C + lsls r1, 1 + adds r0, r1 + movs r1, 0 + movs r2, 0x10 + bl MemoryFill16 + ldr r2, [r4] + ldr r0, [r2, 0x48] + cmp r0, 0 + beq _08022D80 + adds r1, r2, 0 + adds r1, 0xF8 + ldr r0, _08022D7C + str r0, [r1] + adds r1, 0x4 + movs r0, 0x5 + str r0, [r1] + adds r0, r2, 0 + adds r0, 0x52 + ldrb r0, [r0] + bl sub_8091764 + lsls r0, 24 + cmp r0, 0 + bne _08022D74 + ldr r0, [r4] + movs r2, 0x9C + lsls r2, 1 + adds r0, r2 + movs r1, 0x1 + strh r1, [r0] +_08022D74: + movs r6, 0x1 + b _08022DBE + .align 2, 0 +_08022D78: .4byte gUnknown_203B294 +_08022D7C: .4byte gUnknown_80DC8F0 +_08022D80: + adds r0, r2, 0 + adds r0, 0x52 + ldrb r0, [r0] + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bne _08022DA4 + ldr r1, [r4] + adds r2, r1, 0 + adds r2, 0xF8 + ldr r0, _08022E38 + str r0, [r2] + adds r1, 0xFC + movs r0, 0x6 + str r0, [r1] + movs r6, 0x1 +_08022DA4: + ldr r2, [r4] + lsls r3, r6, 3 + adds r0, r2, 0 + adds r0, 0xF8 + adds r0, r3 + ldr r1, _08022E3C + ldr r1, [r1] + str r1, [r0] + adds r2, 0xFC + adds r2, r3 + movs r0, 0x4 + str r0, [r2] + adds r6, 0x1 +_08022DBE: + ldr r4, _08022E40 + ldr r0, [r4] + mov r12, r0 + lsls r1, r6, 3 + mov r2, r12 + adds r2, 0xF8 + adds r3, r2, r1 + ldr r0, _08022E44 + ldr r0, [r0] + str r0, [r3] + mov r3, r12 + adds r3, 0xFC + adds r1, r3, r1 + movs r0, 0x7 + str r0, [r1] + adds r6, 0x1 + lsls r1, r6, 3 + adds r2, r1 + movs r0, 0 + str r0, [r2] + adds r1, r3, r1 + movs r0, 0x1 + str r0, [r1] + movs r5, 0 + adds r7, r4, 0 + cmp r5, r6 + bge _08022E16 + mov r4, r12 + adds r4, 0xF4 + movs r2, 0x9C + lsls r2, 1 + add r2, r12 +_08022DFE: + ldrh r0, [r2] + cmp r0, 0 + bne _08022E0C + ldr r1, [r3] + ldr r0, [r4] + cmp r1, r0 + beq _08022E70 +_08022E0C: + adds r2, 0x2 + adds r3, 0x8 + adds r5, 0x1 + cmp r5, r6 + blt _08022DFE +_08022E16: + movs r5, 0 + cmp r5, r6 + bge _08022E70 + ldr r1, [r7] + movs r2, 0x9C + lsls r2, 1 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r0, 0 + bne _08022E48 + adds r0, r1, 0 + adds r0, 0xF4 + adds r1, 0xFC + ldr r1, [r1] + str r1, [r0] + b _08022E70 + .align 2, 0 +_08022E38: .4byte gUnknown_80DC8F8 +_08022E3C: .4byte gUnknown_80D4940 +_08022E40: .4byte gUnknown_203B294 +_08022E44: .4byte gUnknown_80D4970 +_08022E48: + adds r5, 0x1 + cmp r5, r6 + bge _08022E70 + ldr r3, [r7] + lsls r0, r5, 1 + movs r2, 0x9C + lsls r2, 1 + adds r1, r3, r2 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _08022E48 + adds r2, r3, 0 + adds r2, 0xF4 + lsls r1, r5, 3 + adds r0, r3, 0 + adds r0, 0xFC + adds r0, r1 + ldr r0, [r0] + str r0, [r2] +_08022E70: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8022D2C + + thumb_func_start sub_8022E78 +sub_8022E78: + push {lr} + movs r0, 0x1 + bl sub_801A6E8 + cmp r0, 0x3 + beq _08022E94 + cmp r0, 0x3 + bhi _08022E8E + cmp r0, 0x2 + beq _08022EE8 + b _08022EEE +_08022E8E: + cmp r0, 0x4 + beq _08022EBC + b _08022EEE +_08022E94: + bl sub_801A8AC + ldr r1, _08022EB4 + ldr r2, [r1] + str r0, [r2, 0x4C] + ldr r1, _08022EB8 + ldr r1, [r1] + lsls r0, 2 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x50] + movs r0, 0x2 + bl sub_8022924 + b _08022EEE + .align 2, 0 +_08022EB4: .4byte gUnknown_203B294 +_08022EB8: .4byte gUnknown_203B460 +_08022EBC: + bl sub_801A8AC + ldr r1, _08022EE0 + ldr r2, [r1] + str r0, [r2, 0x4C] + ldr r1, _08022EE4 + ldr r1, [r1] + lsls r0, 2 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x50] + movs r0, 0 + bl sub_8099690 + movs r0, 0x4 + bl sub_8022924 + b _08022EEE + .align 2, 0 +_08022EE0: .4byte gUnknown_203B294 +_08022EE4: .4byte gUnknown_203B460 +_08022EE8: + movs r0, 0x16 + bl sub_8022924 +_08022EEE: + pop {r0} + bx r0 + thumb_func_end sub_8022E78 + + thumb_func_start sub_8022EF4 +sub_8022EF4: + push {r4,r5,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + bl sub_801A6E8 + ldr r4, _08022F3C + ldr r0, [r4] + adds r0, 0x54 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _08022F26 + ldr r0, [r4] + adds r0, 0x54 + mov r1, sp + bl sub_8013114 + ldr r1, [sp] + cmp r1, 0x1 + beq _08022F26 + ldr r0, [r4] + adds r0, 0xF4 + str r1, [r0] +_08022F26: + ldr r0, [sp] + subs r0, 0x1 + cmp r0, 0x6 + bls _08022F30 + b _08023060 +_08022F30: + lsls r0, 2 + ldr r1, _08022F40 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08022F3C: .4byte gUnknown_203B294 +_08022F40: .4byte _08022F44 + .align 2, 0 +_08022F44: + .4byte _08022F60 + .4byte _08023060 + .4byte _08023060 + .4byte _0802304C + .4byte _08022F68 + .4byte _08023044 + .4byte _08023054 +_08022F60: + movs r0, 0x1 + bl sub_8022924 + b _08023060 +_08022F68: + ldr r4, _08022FEC + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x8 + ldr r1, [r1, 0x48] + movs r2, 0x14 + ldrsh r1, [r1, r2] + bl sub_808EBA8 + ldr r3, [r4] + str r0, [r3, 0x38] + ldr r0, [r3, 0x48] + adds r1, r3, 0 + adds r1, 0x52 + ldrb r1, [r1] + adds r3, 0x44 + movs r2, 0 + bl sub_80915F4 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x20 + ldr r1, [r1, 0x48] + movs r2, 0x14 + ldrsh r1, [r1, r2] + bl sub_808EBA8 + ldr r1, [r4] + str r0, [r1, 0x3C] + movs r0, 0x1 + str r0, [r1, 0x40] + adds r0, r1, 0 + adds r0, 0x44 + movs r2, 0 + ldrsh r5, [r0, r2] + ldr r0, _08022FF0 + ldr r3, _08022FF4 + ldr r2, [r1, 0x4C] + lsls r2, 2 + ldr r1, [r3] + adds r1, r2 + movs r2, 0 + bl sub_8090E14 + movs r0, 0x1 + negs r0, r0 + cmp r5, r0 + beq _08022FD0 + ldr r0, [r4] + ldr r0, [r0, 0x4C] + bl sub_80911F8 +_08022FD0: + movs r0, 0 + bl sub_8099690 + ldr r1, [r4] + movs r0, 0xA + str r0, [r1, 0x4] + adds r0, r5, 0x1 + cmp r0, 0x4 + bhi _08023030 + lsls r0, 2 + ldr r1, _08022FF8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08022FEC: .4byte gUnknown_203B294 +_08022FF0: .4byte gUnknown_202DE58 +_08022FF4: .4byte gUnknown_203B460 +_08022FF8: .4byte _08022FFC + .align 2, 0 +_08022FFC: + .4byte _08023030 + .4byte _08023010 + .4byte _08023018 + .4byte _08023020 + .4byte _08023028 +_08023010: + movs r0, 0x6 + bl sub_8022924 + b _08023060 +_08023018: + movs r0, 0x7 + bl sub_8022924 + b _08023060 +_08023020: + movs r0, 0x8 + bl sub_8022924 + b _08023060 +_08023028: + movs r0, 0x9 + bl sub_8022924 + b _08023060 +_08023030: + ldr r0, _08023040 + ldr r1, [r0] + movs r0, 0x16 + str r0, [r1, 0x4] + movs r0, 0x5 + bl sub_8022924 + b _08023060 + .align 2, 0 +_08023040: .4byte gUnknown_203B294 +_08023044: + movs r0, 0x15 + bl sub_8022924 + b _08023060 +_0802304C: + movs r0, 0x3 + bl sub_8022924 + b _08023060 +_08023054: + movs r0, 0 + bl sub_8099690 + movs r0, 0x4 + bl sub_8022924 +_08023060: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8022EF4 + + thumb_func_start sub_8023068 +sub_8023068: + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + bl sub_801A6E8 + ldr r4, _080230A8 + ldr r0, [r4] + adds r0, 0x54 + bl sub_8012FD8 + ldr r0, [r4] + adds r0, 0xA4 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _08023096 + ldr r0, [r4] + adds r0, 0xA4 + mov r1, sp + bl sub_8013114 +_08023096: + ldr r0, [sp] + cmp r0, 0x2 + beq _080230B8 + cmp r0, 0x2 + bgt _080230AC + cmp r0, 0x1 + beq _080230B0 + b _080230E0 + .align 2, 0 +_080230A8: .4byte gUnknown_203B294 +_080230AC: + cmp r0, 0x3 + bne _080230E0 +_080230B0: + movs r0, 0x1 + bl sub_8022924 + b _080230E0 +_080230B8: + ldr r0, [r4] + ldr r0, [r0, 0x4C] + bl sub_80911F8 + bl sub_8090A34 + cmp r0, 0 + bne _080230DA + movs r0, 0 + bl sub_8099690 + bl sub_801A928 + movs r0, 0x14 + bl sub_8022924 + b _080230E0 +_080230DA: + movs r0, 0x1 + bl sub_8022924 +_080230E0: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8023068 + + thumb_func_start sub_80230E8 +sub_80230E8: + push {lr} + bl sub_801B410 + cmp r0, 0x1 + bls _08023100 + cmp r0, 0x3 + bhi _08023100 + bl sub_801B450 + movs r0, 0x1 + bl sub_8022924 +_08023100: + pop {r0} + bx r0 + thumb_func_end sub_80230E8 + + thumb_func_start sub_8023104 +sub_8023104: + push {lr} + bl sub_801B00C + cmp r0, 0x1 + bls _0802311C + cmp r0, 0x3 + bhi _0802311C + bl sub_801B048 + movs r0, 0x1 + bl sub_8022924 +_0802311C: + pop {r0} + bx r0 + thumb_func_end sub_8023104 + + thumb_func_start sub_8023120 +sub_8023120: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08023138 + ldr r0, _08023140 + ldr r0, [r0] + ldr r0, [r0, 0x4] + bl sub_8022924 +_08023138: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08023140: .4byte gUnknown_203B294 + thumb_func_end sub_8023120 + + thumb_func_start sub_8023144 +sub_8023144: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r7, r1, 0 + mov r9, r2 + mov r10, r3 + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + bl sub_8023704 + lsls r0, 24 + cmp r0, 0 + beq _08023168 + movs r0, 0 + b _08023252 +_08023168: + ldr r6, _08023260 + ldr r0, [r6] + cmp r0, 0 + bne _0802317C + movs r0, 0xFF + lsls r0, 2 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r6] +_0802317C: + ldr r0, [r6] + strb r4, [r0] + ldr r0, [r6] + ldr r1, _08023264 + ldr r1, [r1] + str r1, [r0, 0x4] + movs r4, 0xE4 + lsls r4, 2 + adds r1, r0, r4 + str r7, [r1] + movs r1, 0xE5 + lsls r1, 2 + mov r8, r1 + adds r2, r0, r1 + lsls r1, r7, 1 + adds r1, r7 + lsls r1, 3 + movs r5, 0xE6 + lsls r5, 2 + adds r1, r5 + adds r1, r0, r1 + str r1, [r2] + adds r0, r5 + bl sub_8006518 + ldr r1, [r6] + adds r4, r1, r4 + ldr r2, [r4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r1, r5 + ldr r0, _08023268 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r2, [r6] + mov r1, r8 + adds r0, r2, r1 + ldr r1, [r0] + movs r3, 0xFE + lsls r3, 2 + adds r0, r2, r3 + str r0, [r1, 0x14] + mov r4, r9 + cmp r4, 0 + beq _080231F6 + movs r1, 0xE4 + lsls r1, 2 + adds r0, r2, r1 + ldr r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + subs r3, 0x58 + adds r1, r2, r3 + adds r1, r0 + ldr r0, [r4] + str r0, [r1] +_080231F6: + ldr r0, [r6] + add r0, r8 + ldr r0, [r0] + mov r1, r10 + bl sub_8012D08 + bl sub_8004914 + ldr r0, [r6] + adds r0, r5 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r4, [r6] + movs r5, 0xD7 + lsls r5, 2 + adds r4, r5 + bl sub_80236A4 + adds r1, r0, 0 + adds r0, r4, 0 + mov r2, r10 + adds r3, r7, 0 + bl sub_8013818 + ldr r0, [r6] + ldr r1, _0802326C + ldrh r2, [r1] + movs r4, 0xDD + lsls r4, 2 + adds r1, r0, r4 + strh r2, [r1] + ldr r1, _08023270 + ldrh r2, [r1] + ldr r3, _08023274 + adds r1, r0, r3 + strh r2, [r1] + adds r0, r5 + bl sub_8013984 + bl sub_8023420 + bl sub_80234BC + movs r0, 0x1 +_08023252: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08023260: .4byte gUnknown_3001B5C +_08023264: .4byte gUnknown_203B298 +_08023268: .4byte gUnknown_80DC91C +_0802326C: .4byte gUnknown_203B29C +_08023270: .4byte gUnknown_203B29E +_08023274: .4byte 0x0000037a + thumb_func_end sub_8023144 + + thumb_func_start sub_8023278 +sub_8023278: + push {r4,lr} + lsls r0, 24 + cmp r0, 0 + bne _08023298 + ldr r0, _08023294 + ldr r0, [r0] + movs r1, 0xD7 + lsls r1, 2 + adds r0, r1 + bl sub_8013660 + movs r0, 0 + b _08023316 + .align 2, 0 +_08023294: .4byte gUnknown_3001B5C +_08023298: + ldr r4, _080232B4 + ldr r0, [r4] + movs r1, 0xD7 + lsls r1, 2 + adds r0, r1 + bl GetKeyPress + cmp r0, 0x2 + beq _080232BE + cmp r0, 0x2 + bgt _080232B8 + cmp r0, 0x1 + beq _080232C8 + b _080232EC + .align 2, 0 +_080232B4: .4byte gUnknown_3001B5C +_080232B8: + cmp r0, 0x3 + beq _080232D2 + b _080232EC +_080232BE: + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + b _08023316 +_080232C8: + movs r0, 0 + bl sub_80119D4 + movs r0, 0x3 + b _08023316 +_080232D2: + movs r0, 0x5 + bl sub_80119D4 + ldr r0, [r4] + ldr r1, [r0, 0x4] + movs r2, 0x1 + cmp r1, 0x1 + bhi _080232E4 + adds r2, r1, 0x1 +_080232E4: + str r2, [r0, 0x4] + bl sub_80236A4 + b _0802330C +_080232EC: + ldr r0, _08023308 + ldr r0, [r0] + movs r1, 0xD7 + lsls r1, 2 + adds r0, r1 + movs r1, 0x1 + bl sub_80138B8 + lsls r0, 24 + cmp r0, 0 + bne _0802330C + movs r0, 0 + b _08023316 + .align 2, 0 +_08023308: .4byte gUnknown_3001B5C +_0802330C: + bl sub_8023420 + bl sub_80234BC + movs r0, 0x1 +_08023316: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8023278 + + thumb_func_start sub_802331C +sub_802331C: + ldr r0, _0802334C + ldr r0, [r0] + ldr r2, _08023350 + adds r1, r0, r2 + movs r3, 0 + ldrsh r2, [r1, r3] + movs r3, 0xDE + lsls r3, 2 + adds r1, r0, r3 + movs r3, 0 + ldrsh r1, [r1, r3] + muls r1, r2 + movs r3, 0xDD + lsls r3, 2 + adds r2, r0, r3 + movs r3, 0 + ldrsh r2, [r2, r3] + adds r1, r2 + lsls r1, 1 + adds r0, 0xC + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + bx lr + .align 2, 0 +_0802334C: .4byte gUnknown_3001B5C +_08023350: .4byte 0x0000037a + thumb_func_end sub_802331C + + thumb_func_start sub_8023354 +sub_8023354: + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8004914 + ldr r5, _0802339C + ldr r0, [r5] + movs r1, 0xE6 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + movs r2, 0 + bl sub_800641C + ldr r0, [r5] + movs r1, 0xD7 + lsls r1, 2 + adds r0, r1 + bl sub_8013984 + bl sub_8023420 + bl sub_80234BC + cmp r4, 0 + beq _08023396 + ldr r0, [r5] + movs r1, 0xD7 + lsls r1, 2 + adds r0, r1 + bl AddMenuCursorSprite +_08023396: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802339C: .4byte gUnknown_3001B5C + thumb_func_end sub_8023354 + + thumb_func_start sub_80233A0 +sub_80233A0: + push {r4-r6,lr} + ldr r5, _08023408 + ldr r2, [r5] + cmp r2, 0 + beq _08023400 + ldr r1, _0802340C + ldr r0, [r2, 0x4] + str r0, [r1] + ldr r1, _08023410 + movs r3, 0xDD + lsls r3, 2 + adds r0, r2, r3 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _08023414 + ldr r6, _08023418 + adds r0, r2, r6 + ldrh r0, [r0] + strh r0, [r1] + movs r1, 0xE4 + lsls r1, 2 + adds r0, r2, r1 + ldr r0, [r0] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r2, r1 + movs r4, 0xE6 + lsls r4, 2 + adds r1, r4 + ldr r0, _0802341C + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + bl sub_8004914 + ldr r0, [r5] + adds r0, r4 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r5] + bl MemoryFree + movs r0, 0 + str r0, [r5] +_08023400: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08023408: .4byte gUnknown_3001B5C +_0802340C: .4byte gUnknown_203B298 +_08023410: .4byte gUnknown_203B29C +_08023414: .4byte gUnknown_203B29E +_08023418: .4byte 0x0000037a +_0802341C: .4byte gUnknown_80DC904 + thumb_func_end sub_80233A0 + + thumb_func_start sub_8023420 +sub_8023420: + push {r4,r5,lr} + ldr r4, _080234A8 + ldr r0, [r4] + movs r1, 0xFE + lsls r1, 2 + adds r0, r1 + movs r2, 0 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r4] + ldr r1, _080234AC + adds r0, r1 + strb r2, [r0] + ldr r0, [r4] + adds r1, 0x1 + adds r0, r1 + movs r1, 0xC + strb r1, [r0] + ldr r0, [r4] + ldr r1, _080234B0 + adds r0, r1 + strb r2, [r0] + ldr r0, [r4] + ldr r2, _080234B4 + adds r0, r2 + movs r1, 0 + ldrsh r0, [r0, r1] + movs r1, 0xC + bl sub_80095E4 + adds r0, 0x2 + ldr r3, [r4] + movs r2, 0xE4 + lsls r2, 2 + adds r5, r3, r2 + ldr r2, [r5] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 3 + adds r1, r3, r1 + ldr r2, _080234B8 + adds r1, r2 + lsls r0, 16 + lsrs r0, 16 + strh r0, [r1] + ldr r2, [r5] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 3 + adds r3, r1 + movs r1, 0xEA + lsls r1, 2 + adds r3, r1 + strh r0, [r3] + bl sub_8004914 + ldr r0, [r4] + movs r2, 0xE6 + lsls r2, 2 + adds r0, r2 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080234A8: .4byte gUnknown_3001B5C +_080234AC: .4byte 0x000003f9 +_080234B0: .4byte 0x000003fb +_080234B4: .4byte 0x00000376 +_080234B8: .4byte 0x000003a6 + thumb_func_end sub_8023420 + + thumb_func_start sub_80234BC +sub_80234BC: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x178 + ldr r5, _0802368C + ldr r0, [r5] + movs r4, 0xE4 + lsls r4, 2 + adds r0, r4 + ldr r0, [r0] + bl sub_8008C54 + ldr r0, [r5] + adds r0, r4 + ldr r0, [r0] + bl sub_80073B8 + ldr r2, _08023690 + ldr r0, [r5] + adds r0, r4 + ldr r3, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0xA + movs r1, 0 + bl xxx_call_draw_string + ldr r3, [r5] + ldr r1, _08023694 + adds r0, r3, r1 + ldrb r0, [r0] + lsls r0, 3 + adds r0, 0x4 + ldr r2, _08023698 + adds r1, r3, r2 + movs r6, 0 + ldrsh r2, [r1, r6] + adds r2, 0x1 + movs r1, 0x7 + str r1, [sp] + adds r3, r4 + ldr r1, [r3] + str r1, [sp, 0x4] + movs r1, 0 + movs r3, 0x2 + bl sub_8012BC4 + movs r0, 0 + mov r10, r0 + ldr r0, [r5] + ldr r1, _0802369C + adds r0, r1 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r10, r0 + blt _08023532 + b _0802366C +_08023532: + ldr r3, _0802368C + ldr r0, [r3] + movs r6, 0xD7 + lsls r6, 2 + adds r0, r6 + mov r1, r10 + bl sub_8013800 + mov r8, r0 + ldr r0, _0802368C + ldr r1, [r0] + ldr r2, _08023698 + adds r0, r1, r2 + movs r3, 0 + ldrsh r2, [r0, r3] + adds r6, 0x1C + adds r0, r1, r6 + movs r3, 0 + ldrsh r0, [r0, r3] + muls r0, r2 + add r0, r10 + lsls r0, 1 + adds r1, 0xC + adds r1, r0 + movs r6, 0 + ldrsh r5, [r1, r6] + adds r0, r5, 0 + bl sub_808DBA8 + lsls r0, 24 + lsrs r0, 24 + add r4, sp, 0x16C + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl sub_8092638 + movs r7, 0x7 + ldrb r0, [r4, 0x4] + cmp r0, 0 + beq _08023594 + adds r0, r5, 0 + bl sub_808E734 + lsls r0, 24 + movs r7, 0x4 + cmp r0, 0 + beq _08023594 + movs r7, 0x5 +_08023594: + adds r0, r5, 0 + movs r1, 0 + bl sub_808DCA0 + lsls r0, 16 + asrs r4, r0, 16 + adds r0, r4, 0 + movs r1, 0xA + bl __modsi3 + adds r2, r0, 0 + adds r2, 0x30 + lsls r2, 24 + lsrs r2, 24 + ldr r6, _0802368C + ldr r0, [r6] + movs r1, 0xE4 + lsls r1, 2 + mov r9, r1 + add r0, r9 + ldr r0, [r0] + str r0, [sp] + movs r0, 0x14 + mov r1, r8 + adds r3, r7, 0 + bl sub_8012C60 + cmp r4, 0x9 + ble _08023628 + adds r0, r4, 0 + movs r1, 0xA + bl __divsi3 + adds r4, r0, 0 + movs r1, 0xA + bl __modsi3 + adds r2, r0, 0 + adds r2, 0x30 + lsls r2, 24 + lsrs r2, 24 + ldr r0, [r6] + movs r3, 0xE4 + lsls r3, 2 + adds r0, r3 + ldr r0, [r0] + str r0, [sp] + movs r0, 0xD + mov r1, r8 + adds r3, r7, 0 + bl sub_8012C60 + cmp r4, 0x9 + ble _08023628 + adds r0, r4, 0 + movs r1, 0xA + bl __divsi3 + movs r1, 0xA + bl __modsi3 + adds r2, r0, 0 + adds r2, 0x30 + lsls r2, 24 + lsrs r2, 24 + ldr r0, [r6] + add r0, r9 + ldr r0, [r0] + str r0, [sp] + movs r0, 0x6 + mov r1, r8 + adds r3, r7, 0 + bl sub_8012C60 +_08023628: + add r4, sp, 0x108 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_808D930 + add r0, sp, 0x8 + ldr r1, _080236A0 + adds r2, r7, 0 + adds r3, r4, 0 + bl sub_800D158 + ldr r6, _0802368C + ldr r0, [r6] + movs r1, 0xE4 + lsls r1, 2 + adds r0, r1 + ldr r3, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0x24 + mov r1, r8 + add r2, sp, 0x8 + bl xxx_call_draw_string + movs r2, 0x1 + add r10, r2 + ldr r0, [r6] + ldr r3, _0802369C + adds r0, r3 + movs r6, 0 + ldrsh r0, [r0, r6] + cmp r10, r0 + bge _0802366C + b _08023532 +_0802366C: + ldr r0, _0802368C + ldr r0, [r0] + movs r1, 0xE4 + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + bl sub_80073E0 + add sp, 0x178 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0802368C: .4byte gUnknown_3001B5C +_08023690: .4byte gUnknown_80DC934 +_08023694: .4byte 0x000003fa +_08023698: .4byte 0x0000037a +_0802369C: .4byte 0x00000376 +_080236A0: .4byte gUnknown_80DC93C + thumb_func_end sub_80234BC + + thumb_func_start sub_80236A4 +sub_80236A4: + push {r4,r5,lr} + ldr r0, _080236FC + ldr r1, [r0] + movs r0, 0 + str r0, [r1, 0x8] + movs r5, 0 +_080236B0: + lsls r0, r5, 16 + asrs r4, r0, 16 + adds r0, r4, 0 + bl sub_8098134 + lsls r0, 24 + cmp r0, 0 + beq _080236E2 + adds r0, r4, 0 + bl sub_808E858 + lsls r0, 16 + asrs r0, 16 + cmp r4, r0 + bne _080236E2 + ldr r0, _080236FC + ldr r3, [r0] + ldr r1, [r3, 0x8] + lsls r2, r1, 1 + adds r0, r3, 0 + adds r0, 0xC + adds r0, r2 + strh r5, [r0] + adds r1, 0x1 + str r1, [r3, 0x8] +_080236E2: + adds r5, 0x1 + ldr r0, _08023700 + cmp r5, r0 + ble _080236B0 + bl sub_8023730 + ldr r0, _080236FC + ldr r0, [r0] + ldr r0, [r0, 0x8] + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080236FC: .4byte gUnknown_3001B5C +_08023700: .4byte 0x000001a7 + thumb_func_end sub_80236A4 + + thumb_func_start sub_8023704 +sub_8023704: + push {r4,lr} + movs r4, 0 +_08023708: + lsls r0, r4, 16 + asrs r0, 16 + bl sub_8098134 + lsls r0, 24 + cmp r0, 0 + beq _0802371A + movs r0, 0 + b _08023724 +_0802371A: + adds r4, 0x1 + ldr r0, _0802372C + cmp r4, r0 + ble _08023708 + movs r0, 0x1 +_08023724: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0802372C: .4byte 0x000001a7 + thumb_func_end sub_8023704 + + thumb_func_start sub_8023730 +sub_8023730: + push {lr} + ldr r0, _08023744 + ldr r0, [r0] + ldr r0, [r0, 0x4] + cmp r0, 0x1 + beq _08023748 + cmp r0, 0x2 + beq _0802374E + b _08023752 + .align 2, 0 +_08023744: .4byte gUnknown_3001B5C +_08023748: + bl sub_8023758 + b _08023752 +_0802374E: + bl sub_80237E0 +_08023752: + pop {r0} + bx r0 + thumb_func_end sub_8023730 + + thumb_func_start sub_8023758 +sub_8023758: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + ldr r3, _080237DC + ldr r2, [r3] + ldr r1, [r2, 0x8] + lsls r0, r1, 1 + adds r0, 0xA + adds r2, r0 + mov r9, r2 + movs r2, 0 + subs r1, 0x1 + cmp r2, r1 + bge _080237CC +_08023778: + mov r5, r9 + ldr r0, [r3] + ldr r0, [r0, 0x8] + subs r7, r0, 0x1 + adds r0, r2, 0x1 + mov r8, r0 + cmp r7, r2 + ble _080237BE +_08023788: + subs r6, r5, 0x2 + movs r1, 0 + ldrsh r0, [r6, r1] + movs r1, 0x1 + str r2, [sp] + bl sub_808DCDC + adds r4, r0, 0 + movs r1, 0 + ldrsh r0, [r5, r1] + movs r1, 0x1 + bl sub_808DCDC + lsls r4, 16 + lsls r0, 16 + ldr r2, [sp] + cmp r4, r0 + ble _080237B6 + movs r0, 0 + ldrsh r1, [r5, r0] + ldrh r0, [r6] + strh r0, [r5] + strh r1, [r6] +_080237B6: + adds r5, r6, 0 + subs r7, 0x1 + cmp r7, r2 + bgt _08023788 +_080237BE: + mov r2, r8 + ldr r3, _080237DC + ldr r0, [r3] + ldr r0, [r0, 0x8] + subs r0, 0x1 + cmp r2, r0 + blt _08023778 +_080237CC: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080237DC: .4byte gUnknown_3001B5C + thumb_func_end sub_8023758 + + thumb_func_start sub_80237E0 +sub_80237E0: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + ldr r3, _08023864 + ldr r2, [r3] + ldr r1, [r2, 0x8] + lsls r0, r1, 1 + adds r0, 0xA + adds r2, r0 + mov r9, r2 + movs r2, 0 + subs r1, 0x1 + cmp r2, r1 + bge _08023854 +_08023800: + mov r5, r9 + ldr r0, [r3] + ldr r0, [r0, 0x8] + subs r7, r0, 0x1 + adds r0, r2, 0x1 + mov r8, r0 + cmp r7, r2 + ble _08023846 +_08023810: + subs r6, r5, 0x2 + movs r1, 0 + ldrsh r0, [r6, r1] + movs r1, 0 + str r2, [sp] + bl sub_808DCDC + adds r4, r0, 0 + movs r1, 0 + ldrsh r0, [r5, r1] + movs r1, 0 + bl sub_808DCDC + lsls r4, 16 + lsls r0, 16 + ldr r2, [sp] + cmp r4, r0 + ble _0802383E + movs r0, 0 + ldrsh r1, [r5, r0] + ldrh r0, [r6] + strh r0, [r5] + strh r1, [r6] +_0802383E: + adds r5, r6, 0 + subs r7, 0x1 + cmp r7, r2 + bgt _08023810 +_08023846: + mov r2, r8 + ldr r3, _08023864 + ldr r0, [r3] + ldr r0, [r0, 0x8] + subs r0, 0x1 + cmp r2, r0 + blt _08023800 +_08023854: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08023864: .4byte gUnknown_3001B5C + thumb_func_end sub_80237E0 + + thumb_func_start sub_8023868 +sub_8023868: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r5, r0, 0 + mov r8, r1 + mov r9, r2 + mov r10, r3 + bl sub_8024108 + lsls r0, 24 + cmp r0, 0 + beq _08023888 + movs r0, 0 + b _08023A6E +_08023888: + ldr r4, _080238AC + ldr r0, [r4] + cmp r0, 0 + bne _0802389C + movs r0, 0xFE + lsls r0, 2 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r4] +_0802389C: + ldr r1, [r4] + str r5, [r1] + ldr r0, _080238B0 + ldr r0, [r0] + cmp r0, r5 + beq _080238B4 + movs r0, 0x1 + b _080238B8 + .align 2, 0 +_080238AC: .4byte gUnknown_3001B60 +_080238B0: .4byte gUnknown_203B2A0 +_080238B4: + ldr r0, _080238E4 + ldr r0, [r0] +_080238B8: + str r0, [r1, 0x4] + ldr r2, _080238E8 + ldr r0, [r2] + movs r1, 0 + strb r1, [r0, 0x14] + ldr r0, [r2] + strb r1, [r0, 0x15] + ldr r0, [r2] + strb r1, [r0, 0x16] + ldr r0, [r2] + strb r1, [r0, 0x17] + ldr r0, [r2] + strb r1, [r0, 0x18] + ldr r0, [r2] + ldr r0, [r0] + cmp r0, 0x4 + bhi _08023980 + lsls r0, 2 + ldr r1, _080238EC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080238E4: .4byte gUnknown_203B2A4 +_080238E8: .4byte gUnknown_3001B60 +_080238EC: .4byte _080238F0 + .align 2, 0 +_080238F0: + .4byte _08023958 + .4byte _08023904 + .4byte _08023914 + .4byte _08023924 + .4byte _0802393C +_08023904: + ldr r0, _08023910 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x18] + b _08023958 + .align 2, 0 +_08023910: .4byte gUnknown_3001B60 +_08023914: + ldr r0, _08023920 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x14] + b _08023958 + .align 2, 0 +_08023920: .4byte gUnknown_3001B60 +_08023924: + ldr r2, _08023938 + ldr r0, [r2] + movs r1, 0x1 + strb r1, [r0, 0x17] + ldr r0, [r2] + strb r1, [r0, 0x15] + ldr r0, [r2] + strb r1, [r0, 0x16] + b _08023958 + .align 2, 0 +_08023938: .4byte gUnknown_3001B60 +_0802393C: + ldr r5, _0802397C + ldr r0, [r5] + movs r4, 0x1 + strb r4, [r0, 0x18] + ldr r0, [r5] + strb r4, [r0, 0x15] + movs r0, 0x9 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + bne _08023958 + ldr r0, [r5] + strb r4, [r0, 0x16] +_08023958: + ldr r4, _0802397C + ldr r0, [r4] + ldr r0, [r0] + cmp r0, 0x4 + bne _08023980 + bl sub_80A5728 + lsls r0, 16 + asrs r0, 16 + bl sub_8002658 + ldr r1, [r4] + movs r2, 0xD5 + lsls r2, 2 + adds r1, r2 + strb r0, [r1] + b _0802398E + .align 2, 0 +_0802397C: .4byte gUnknown_3001B60 +_08023980: + ldr r0, _08023A7C + ldr r0, [r0] + movs r3, 0xD5 + lsls r3, 2 + adds r0, r3 + movs r1, 0 + strb r1, [r0] +_0802398E: + ldr r5, _08023A7C + ldr r0, [r5] + movs r4, 0xE3 + lsls r4, 2 + adds r1, r0, r4 + mov r2, r8 + str r2, [r1] + movs r7, 0xE4 + lsls r7, 2 + adds r2, r0, r7 + mov r3, r8 + lsls r1, r3, 1 + add r1, r8 + lsls r1, 3 + movs r6, 0xE5 + lsls r6, 2 + adds r1, r6 + adds r1, r0, r1 + str r1, [r2] + adds r0, r6 + bl sub_8006518 + ldr r1, [r5] + adds r4, r1, r4 + ldr r2, [r4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r1, r6 + ldr r0, _08023A80 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r2, [r5] + adds r0, r2, r7 + ldr r1, [r0] + movs r4, 0xFD + lsls r4, 2 + adds r0, r2, r4 + str r0, [r1, 0x14] + mov r0, r9 + cmp r0, 0 + beq _08023A04 + movs r1, 0xE3 + lsls r1, 2 + adds r0, r2, r1 + ldr r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + movs r3, 0xE7 + lsls r3, 2 + adds r1, r2, r3 + adds r1, r0 + mov r4, r9 + ldr r0, [r4] + str r0, [r1] +_08023A04: + ldr r0, [r5] + adds r0, r7 + ldr r0, [r0] + mov r1, r10 + bl sub_8012D08 + bl sub_8004914 + ldr r0, [r5] + adds r0, r6 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r4, [r5] + movs r0, 0xD6 + lsls r0, 2 + adds r4, r0 + bl sub_8023F8C + adds r1, r0, 0 + adds r0, r4, 0 + mov r2, r10 + mov r3, r8 + bl sub_8013818 + ldr r0, _08023A84 + ldr r4, [r5] + ldr r1, [r0] + ldr r0, [r4] + cmp r1, r0 + bne _08023A64 + ldr r0, _08023A88 + ldrh r1, [r0] + movs r2, 0xDC + lsls r2, 2 + adds r0, r4, r2 + strh r1, [r0] + ldr r0, _08023A8C + ldrh r1, [r0] + ldr r3, _08023A90 + adds r0, r4, r3 + strh r1, [r0] + movs r1, 0xD6 + lsls r1, 2 + adds r0, r4, r1 + bl sub_8013984 +_08023A64: + bl sub_8023CF4 + bl sub_8023DA4 + movs r0, 0x1 +_08023A6E: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08023A7C: .4byte gUnknown_3001B60 +_08023A80: .4byte gUnknown_80DC968 +_08023A84: .4byte gUnknown_203B2A0 +_08023A88: .4byte gUnknown_203B2A8 +_08023A8C: .4byte gUnknown_203B2AA +_08023A90: .4byte 0x00000376 + thumb_func_end sub_8023868 + + thumb_func_start sub_8023A94 +sub_8023A94: + push {r4,lr} + lsls r0, 24 + cmp r0, 0 + bne _08023AB4 + ldr r0, _08023AB0 + ldr r0, [r0] + movs r1, 0xD6 + lsls r1, 2 + adds r0, r1 + bl sub_8013660 + movs r0, 0 + b _08023B3E + .align 2, 0 +_08023AB0: .4byte gUnknown_3001B60 +_08023AB4: + ldr r4, _08023AD0 + ldr r0, [r4] + movs r1, 0xD6 + lsls r1, 2 + adds r0, r1 + bl GetKeyPress + cmp r0, 0x2 + beq _08023ADE + cmp r0, 0x2 + bgt _08023AD4 + cmp r0, 0x1 + beq _08023AF2 + b _08023B16 + .align 2, 0 +_08023AD0: .4byte gUnknown_3001B60 +_08023AD4: + cmp r0, 0x3 + beq _08023AFC + cmp r0, 0x4 + beq _08023AE8 + b _08023B16 +_08023ADE: + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + b _08023B3E +_08023AE8: + movs r0, 0x4 + bl sub_80119D4 + movs r0, 0x4 + b _08023B3E +_08023AF2: + movs r0, 0 + bl sub_80119D4 + movs r0, 0x3 + b _08023B3E +_08023AFC: + movs r0, 0x5 + bl sub_80119D4 + ldr r0, [r4] + ldr r1, [r0, 0x4] + movs r2, 0x1 + cmp r1, 0x2 + bhi _08023B0E + adds r2, r1, 0x1 +_08023B0E: + str r2, [r0, 0x4] + bl sub_8023F8C + b _08023B34 +_08023B16: + ldr r0, _08023B30 + ldr r0, [r0] + movs r1, 0xD6 + lsls r1, 2 + adds r0, r1 + movs r1, 0x1 + bl sub_80138B8 + lsls r0, 24 + cmp r0, 0 + bne _08023B34 + movs r0, 0 + b _08023B3E + .align 2, 0 +_08023B30: .4byte gUnknown_3001B60 +_08023B34: + bl sub_8023CF4 + bl sub_8023DA4 + movs r0, 0x1 +_08023B3E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8023A94 + + thumb_func_start sub_8023B44 +sub_8023B44: + ldr r0, _08023B74 + ldr r0, [r0] + ldr r2, _08023B78 + adds r1, r0, r2 + movs r3, 0 + ldrsh r2, [r1, r3] + movs r3, 0xDD + lsls r3, 2 + adds r1, r0, r3 + movs r3, 0 + ldrsh r1, [r1, r3] + muls r1, r2 + movs r3, 0xDC + lsls r3, 2 + adds r2, r0, r3 + movs r3, 0 + ldrsh r2, [r2, r3] + adds r1, r2 + lsls r1, 1 + adds r0, 0x1A + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + bx lr + .align 2, 0 +_08023B74: .4byte gUnknown_3001B60 +_08023B78: .4byte 0x00000376 + thumb_func_end sub_8023B44 + + thumb_func_start sub_8023B7C +sub_8023B7C: + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8004914 + ldr r5, _08023BD0 + ldr r0, [r5] + movs r1, 0xE5 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + movs r2, 0 + bl sub_800641C + bl sub_8023BD8 + adds r2, r0, 0 + ldr r0, [r5] + ldr r3, _08023BD4 + adds r1, r0, r3 + strh r2, [r1] + movs r1, 0xD6 + lsls r1, 2 + adds r0, r1 + bl sub_8013984 + bl sub_8023CF4 + bl sub_8023DA4 + cmp r4, 0 + beq _08023BCA + ldr r0, [r5] + movs r3, 0xD6 + lsls r3, 2 + adds r0, r3 + bl AddMenuCursorSprite +_08023BCA: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08023BD0: .4byte gUnknown_3001B60 +_08023BD4: .4byte 0x0000037a + thumb_func_end sub_8023B7C + + thumb_func_start sub_8023BD8 +sub_8023BD8: + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r3, 0 + ldr r1, _08023C58 + ldr r0, [r1] + ldr r0, [r0, 0x8] + adds r7, r1, 0 + cmp r3, r0 + bge _08023C4A + ldr r0, _08023C5C + mov r8, r0 + mov r12, r7 +_08023BF2: + ldr r2, [r1] + lsls r4, r3, 1 + adds r0, r2, 0 + adds r0, 0x1A + adds r0, r4 + movs r5, 0 + ldrsh r1, [r0, r5] + movs r0, 0x58 + muls r0, r1 + mov r5, r8 + ldr r1, [r5] + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + adds r6, r3, 0x1 + cmp r0, 0 + bne _08023C3E + ldr r0, [r2, 0x8] + subs r0, 0x1 + str r0, [r2, 0x8] + cmp r3, r0 + bge _08023C3E + mov r5, r12 + adds r4, 0x2 +_08023C24: + ldr r2, [r5] + lsls r1, r3, 1 + adds r0, r2, 0 + adds r0, 0x1A + adds r1, r0, r1 + adds r0, r4 + ldrh r0, [r0] + strh r0, [r1] + adds r4, 0x2 + adds r3, 0x1 + ldr r0, [r2, 0x8] + cmp r3, r0 + blt _08023C24 +_08023C3E: + adds r3, r6, 0 + adds r1, r7, 0 + ldr r0, [r7] + ldr r0, [r0, 0x8] + cmp r3, r0 + blt _08023BF2 +_08023C4A: + ldr r0, [r7] + ldr r0, [r0, 0x8] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08023C58: .4byte gUnknown_3001B60 +_08023C5C: .4byte gUnknown_203B45C + thumb_func_end sub_8023BD8 + + thumb_func_start sub_8023C60 +sub_8023C60: + push {r4-r6,lr} + ldr r5, _08023CCC + ldr r2, [r5] + cmp r2, 0 + beq _08023CC6 + ldr r1, _08023CD0 + ldr r0, [r2] + str r0, [r1] + ldr r1, _08023CD4 + ldr r0, [r2, 0x4] + str r0, [r1] + ldr r1, _08023CD8 + movs r3, 0xDC + lsls r3, 2 + adds r0, r2, r3 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _08023CDC + ldr r6, _08023CE0 + adds r0, r2, r6 + ldrh r0, [r0] + strh r0, [r1] + movs r1, 0xE3 + lsls r1, 2 + adds r0, r2, r1 + ldr r0, [r0] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r2, r1 + movs r4, 0xE5 + lsls r4, 2 + adds r1, r4 + ldr r0, _08023CE4 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + bl sub_8004914 + ldr r0, [r5] + adds r0, r4 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r5] + bl MemoryFree + movs r0, 0 + str r0, [r5] +_08023CC6: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08023CCC: .4byte gUnknown_3001B60 +_08023CD0: .4byte gUnknown_203B2A0 +_08023CD4: .4byte gUnknown_203B2A4 +_08023CD8: .4byte gUnknown_203B2A8 +_08023CDC: .4byte gUnknown_203B2AA +_08023CE0: .4byte 0x00000376 +_08023CE4: .4byte gUnknown_80DC950 + thumb_func_end sub_8023C60 + + thumb_func_start sub_8023CE8 +sub_8023CE8: + ldr r0, _08023CF0 + ldr r0, [r0] + bx lr + .align 2, 0 +_08023CF0: .4byte gUnknown_3001B60 + thumb_func_end sub_8023CE8 + + thumb_func_start sub_8023CF4 +sub_8023CF4: + push {r4,r5,lr} + ldr r2, _08023D28 + ldr r0, [r2] + movs r1, 0xFD + lsls r1, 2 + adds r0, r1 + movs r3, 0 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r2] + ldr r1, _08023D2C + adds r0, r1 + strb r3, [r0] + ldr r0, [r2] + adds r1, 0x2 + adds r0, r1 + strb r3, [r0] + ldr r1, [r2] + ldr r0, [r1] + adds r5, r2, 0 + cmp r0, 0x2 + bne _08023D34 + ldr r0, _08023D30 + adds r1, r0 + b _08023D38 + .align 2, 0 +_08023D28: .4byte gUnknown_3001B60 +_08023D2C: .4byte 0x000003f5 +_08023D30: .4byte 0x000003f6 +_08023D34: + ldr r2, _08023D98 + adds r1, r2 +_08023D38: + movs r0, 0xC + strb r0, [r1] + ldr r0, [r5] + ldr r1, _08023D9C + adds r0, r1 + movs r2, 0 + ldrsh r0, [r0, r2] + movs r1, 0xC + bl sub_80095E4 + adds r0, 0x2 + ldr r3, [r5] + movs r1, 0xE3 + lsls r1, 2 + adds r4, r3, r1 + ldr r2, [r4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 3 + adds r1, r3, r1 + ldr r2, _08023DA0 + adds r1, r2 + lsls r0, 16 + lsrs r0, 16 + strh r0, [r1] + ldr r2, [r4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 3 + adds r3, r1 + movs r1, 0xE9 + lsls r1, 2 + adds r3, r1 + strh r0, [r3] + bl sub_8004914 + ldr r0, [r5] + movs r2, 0xE5 + lsls r2, 2 + adds r0, r2 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08023D98: .4byte 0x000003f6 +_08023D9C: .4byte 0x00000372 +_08023DA0: .4byte 0x000003a2 + thumb_func_end sub_8023CF4 + + thumb_func_start sub_8023DA4 +sub_8023DA4: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x58 + ldr r4, _08023DD8 + ldr r0, [r4] + movs r5, 0xE3 + lsls r5, 2 + adds r0, r5 + ldr r0, [r0] + bl sub_8008C54 + ldr r0, [r4] + adds r0, r5 + ldr r0, [r0] + bl sub_80073B8 + ldr r0, [r4] + ldr r1, [r0] + cmp r1, 0x2 + beq _08023DE0 + cmp r1, 0x4 + beq _08023E00 + ldr r2, _08023DDC + b _08023E02 + .align 2, 0 +_08023DD8: .4byte gUnknown_3001B60 +_08023DDC: .4byte gUnknown_80DC988 +_08023DE0: + add r0, sp, 0x8 + bl sub_80920D8 + ldr r0, [r4] + movs r1, 0xE3 + lsls r1, 2 + adds r0, r1 + ldr r3, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0xA + movs r1, 0 + add r2, sp, 0x8 + bl xxx_call_draw_string + b _08023E3C +_08023E00: + ldr r2, _08023EBC +_08023E02: + adds r0, r5 + ldr r3, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0xA + movs r1, 0 + bl xxx_call_draw_string + ldr r1, [r4] + ldr r2, _08023EC0 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 3 + adds r3, r0, 0x4 + ldr r4, _08023EC4 + adds r0, r1, r4 + movs r4, 0 + ldrsh r2, [r0, r4] + adds r2, 0x1 + movs r0, 0x7 + str r0, [sp] + adds r1, r5 + ldr r0, [r1] + str r0, [sp, 0x4] + adds r0, r3, 0 + movs r1, 0 + movs r3, 0x2 + bl sub_8012BC4 +_08023E3C: + movs r7, 0 + ldr r1, _08023EC8 + ldr r0, [r1] + ldr r2, _08023ECC + adds r0, r2 + movs r4, 0 + ldrsh r0, [r0, r4] + cmp r7, r0 + blt _08023E50 + b _08023F62 +_08023E50: + mov r8, r1 + add r0, sp, 0x30 + mov r9, r0 +_08023E56: + ldr r3, [r1] + ldr r1, _08023EC4 + adds r0, r3, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + movs r4, 0xDD + lsls r4, 2 + adds r0, r3, r4 + movs r2, 0 + ldrsh r0, [r0, r2] + muls r1, r0 + adds r1, r7 + lsls r1, 1 + adds r0, r3, 0 + adds r0, 0x1A + adds r0, r1 + movs r4, 0 + ldrsh r5, [r0, r4] + ldr r2, _08023ED0 + movs r0, 0x58 + adds r1, r5, 0 + muls r1, r0 + ldr r0, [r2] + adds r4, r0, r1 + movs r6, 0x7 + ldrh r0, [r4] + lsrs r0, 1 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08023ED4 + movs r0, 0 + ldrb r1, [r4, 0x4] + cmp r1, 0x41 + bne _08023E9E + movs r0, 0x1 +_08023E9E: + cmp r0, 0 + beq _08023EA4 + movs r6, 0x6 +_08023EA4: + movs r0, 0 + cmp r1, 0x40 + bne _08023EAC + movs r0, 0x1 +_08023EAC: + cmp r0, 0 + beq _08023EB2 + movs r6, 0x6 +_08023EB2: + ldrb r0, [r4, 0x2] + cmp r0, 0 + beq _08023EEA + movs r6, 0x5 + b _08023EEA + .align 2, 0 +_08023EBC: .4byte gUnknown_80DC980 +_08023EC0: .4byte 0x000003f6 +_08023EC4: .4byte 0x00000376 +_08023EC8: .4byte gUnknown_3001B60 +_08023ECC: .4byte 0x00000372 +_08023ED0: .4byte gUnknown_203B45C +_08023ED4: + ldrb r0, [r3, 0x18] + cmp r0, 0 + beq _08023EEA + adds r0, r5, 0 + bl sub_808D750 + lsls r0, 24 + movs r6, 0x2 + cmp r0, 0 + beq _08023EEA + movs r6, 0x4 +_08023EEA: + mov r0, r8 + ldr r1, [r0] + ldr r0, [r1] + cmp r0, 0x4 + bne _08023F02 + movs r2, 0xD5 + lsls r2, 2 + adds r0, r1, r2 + ldrb r1, [r0] + adds r0, r4, 0 + bl sub_8024184 +_08023F02: + adds r1, r4, 0 + adds r1, 0x4C + mov r0, r9 + movs r2, 0xA + bl sub_80922B4 + movs r0, 0x8 + ldrsh r1, [r4, r0] + add r0, sp, 0x44 + bl sub_808D930 + add r0, sp, 0x8 + ldr r1, _08023F80 + adds r2, r6, 0 + mov r3, r9 + bl sub_800D158 + mov r1, r8 + ldr r0, [r1] + movs r2, 0xD6 + lsls r2, 2 + adds r0, r2 + adds r1, r7, 0 + bl sub_8013800 + adds r1, r0, 0 + mov r4, r8 + ldr r0, [r4] + movs r2, 0xE3 + lsls r2, 2 + adds r0, r2 + ldr r3, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0x8 + add r2, sp, 0x8 + bl xxx_call_draw_string + adds r7, 0x1 + mov r1, r8 + ldr r0, [r4] + ldr r4, _08023F84 + adds r0, r4 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r7, r0 + bge _08023F62 + b _08023E56 +_08023F62: + ldr r0, _08023F88 + ldr r0, [r0] + movs r4, 0xE3 + lsls r4, 2 + adds r0, r4 + ldr r0, [r0] + bl sub_80073E0 + add sp, 0x58 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08023F80: .4byte gUnknown_80DC998 +_08023F84: .4byte 0x00000372 +_08023F88: .4byte gUnknown_3001B60 + thumb_func_end sub_8023DA4 + + thumb_func_start sub_8023F8C +sub_8023F8C: + push {r4-r7,lr} + ldr r2, _08023FD0 + ldr r1, [r2] + movs r0, 0 + str r0, [r1, 0x8] + ldrb r0, [r1, 0x15] + adds r6, r2, 0 + cmp r0, 0 + bne _08023FE2 + movs r4, 0 + ldr r2, _08023FD4 +_08023FA2: + movs r0, 0x58 + adds r1, r4, 0 + muls r1, r0 + ldr r0, [r2] + adds r1, r0, r1 + ldrb r0, [r1, 0x2] + cmp r0, 0 + beq _08023FD8 + ldrb r1, [r1] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08023FD8 + ldr r3, [r6] + ldr r1, [r3, 0x8] + lsls r2, r1, 1 + adds r0, r3, 0 + adds r0, 0x1A + adds r0, r2 + strh r4, [r0] + adds r1, 0x1 + str r1, [r3, 0x8] + b _08023FE2 + .align 2, 0 +_08023FD0: .4byte gUnknown_3001B60 +_08023FD4: .4byte gUnknown_203B45C +_08023FD8: + adds r4, 0x1 + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + ble _08023FA2 +_08023FE2: + ldr r0, [r6] + ldrb r0, [r0, 0x16] + cmp r0, 0 + bne _08024042 + movs r4, 0 + ldr r3, _08024034 +_08023FEE: + movs r0, 0x58 + adds r1, r4, 0 + muls r1, r0 + ldr r0, [r3] + adds r1, r0, r1 + movs r2, 0 + ldrb r0, [r1, 0x4] + cmp r0, 0x41 + bne _08024002 + movs r2, 0x1 +_08024002: + cmp r2, 0 + beq _08024038 + ldrb r0, [r1, 0x2] + cmp r0, 0 + bne _08024038 + ldrh r1, [r1] + lsrs r0, r1, 1 + movs r2, 0x1 + ands r0, r2 + cmp r0, 0 + beq _08024038 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _08024038 + ldr r3, [r6] + ldr r1, [r3, 0x8] + lsls r2, r1, 1 + adds r0, r3, 0 + adds r0, 0x1A + adds r0, r2 + strh r4, [r0] + adds r1, 0x1 + str r1, [r3, 0x8] + b _08024042 + .align 2, 0 +_08024034: .4byte gUnknown_203B45C +_08024038: + adds r4, 0x1 + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + ble _08023FEE +_08024042: + ldr r0, [r6] + ldr r1, [r0, 0x8] + str r1, [r0, 0xC] + ldrb r0, [r0, 0x17] + cmp r0, 0 + bne _080240A4 + movs r4, 0 + ldr r7, _08024100 + movs r5, 0x1 +_08024054: + movs r0, 0x58 + adds r1, r4, 0 + muls r1, r0 + ldr r0, [r7] + adds r1, r0, r1 + ldrh r2, [r1] + lsrs r0, r2, 1 + ands r0, r5 + cmp r0, 0 + beq _0802409A + adds r0, r5, 0 + ands r0, r2 + cmp r0, 0 + beq _0802409A + ldrb r0, [r1, 0x2] + cmp r0, 0 + bne _0802409A + movs r2, 0 + ldrb r0, [r1, 0x4] + cmp r0, 0x41 + bne _08024080 + movs r2, 0x1 +_08024080: + cmp r2, 0 + bne _0802409A + ldr r3, [r6] + ldr r1, [r3, 0x8] + lsls r2, r1, 1 + adds r0, r3, 0 + adds r0, 0x1A + adds r0, r2 + strh r4, [r0] + adds r1, 0x1 + str r1, [r3, 0x8] + cmp r1, 0x3 + bgt _080240A4 +_0802409A: + adds r4, 0x1 + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + ble _08024054 +_080240A4: + ldr r0, [r6] + ldr r1, [r0, 0x8] + str r1, [r0, 0x10] + ldrb r0, [r0, 0x14] + cmp r0, 0 + bne _080240EE + movs r4, 0 + ldr r7, _08024100 + movs r5, 0x1 +_080240B6: + movs r0, 0x58 + adds r1, r4, 0 + muls r1, r0 + ldr r0, [r7] + adds r1, r0, r1 + ldrh r1, [r1] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _080240E4 + lsrs r0, r1, 1 + ands r0, r5 + cmp r0, 0 + bne _080240E4 + ldr r3, [r6] + ldr r1, [r3, 0x8] + lsls r2, r1, 1 + adds r0, r3, 0 + adds r0, 0x1A + adds r0, r2 + strh r4, [r0] + adds r1, 0x1 + str r1, [r3, 0x8] +_080240E4: + adds r4, 0x1 + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + ble _080240B6 +_080240EE: + bl sub_80241A8 + ldr r0, _08024104 + ldr r0, [r0] + ldr r0, [r0, 0x8] + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08024100: .4byte gUnknown_203B45C +_08024104: .4byte gUnknown_3001B60 + thumb_func_end sub_8023F8C + + thumb_func_start sub_8024108 +sub_8024108: + push {r4-r7,lr} + adds r5, r0, 0 + movs r7, 0 + movs r6, 0x1 +_08024110: + ldr r2, _08024134 + movs r0, 0x58 + adds r1, r7, 0 + muls r1, r0 + ldr r0, [r2] + adds r4, r0, r1 + ldrh r1, [r4] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _08024172 + cmp r5, 0x2 + bne _08024138 + lsrs r0, r1, 1 + ands r0, r6 + cmp r0, 0 + beq _08024172 + b _0802416E + .align 2, 0 +_08024134: .4byte gUnknown_203B45C +_08024138: + cmp r5, 0x3 + bne _08024140 + lsrs r0, r1, 1 + b _08024168 +_08024140: + cmp r5, 0x4 + bne _0802416E + ldrb r0, [r4, 0x2] + cmp r0, 0 + bne _08024172 + movs r0, 0x9 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + bne _0802416E + movs r1, 0 + ldrb r0, [r4, 0x4] + cmp r0, 0x41 + bne _08024160 + movs r1, 0x1 +_08024160: + cmp r1, 0 + beq _0802416E + ldrh r0, [r4] + lsrs r0, 1 +_08024168: + ands r0, r6 + cmp r0, 0 + bne _08024172 +_0802416E: + movs r0, 0 + b _0802417E +_08024172: + adds r7, 0x1 + movs r0, 0xCE + lsls r0, 1 + cmp r7, r0 + ble _08024110 + movs r0, 0x1 +_0802417E: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8024108 + + thumb_func_start sub_8024184 +sub_8024184: + push {r4,lr} + lsls r4, r1, 24 + lsrs r4, 24 + movs r1, 0x8 + ldrsh r0, [r0, r1] + bl sub_808DBA8 + lsls r0, 24 + lsrs r0, 24 + cmp r4, r0 + beq _0802419E + movs r0, 0 + b _080241A0 +_0802419E: + movs r0, 0x1 +_080241A0: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8024184 + + thumb_func_start sub_80241A8 +sub_80241A8: + push {r4,lr} + ldr r4, _080241C0 + ldr r1, [r4] + ldr r0, [r1, 0x4] + cmp r0, 0x2 + beq _080241CA + cmp r0, 0x2 + bhi _080241C4 + cmp r0, 0x1 + beq _08024206 + b _08024222 + .align 2, 0 +_080241C0: .4byte gUnknown_3001B60 +_080241C4: + cmp r0, 0x3 + beq _080241E8 + b _08024222 +_080241CA: + ldr r0, [r1, 0xC] + ldr r1, [r1, 0x10] + cmp r0, r1 + beq _080241D6 + bl sub_80242D0 +_080241D6: + ldr r0, [r4] + ldr r2, [r0, 0x10] + ldr r1, [r0, 0x8] + cmp r2, r1 + beq _08024222 + adds r0, r2, 0 + bl sub_80242D0 + b _08024222 +_080241E8: + ldr r0, [r1, 0xC] + ldr r1, [r1, 0x10] + cmp r0, r1 + beq _080241F4 + bl sub_802437C +_080241F4: + ldr r0, [r4] + ldr r2, [r0, 0x10] + ldr r1, [r0, 0x8] + cmp r2, r1 + beq _08024222 + adds r0, r2, 0 + bl sub_802437C + b _08024222 +_08024206: + ldr r0, [r1, 0xC] + ldr r1, [r1, 0x10] + cmp r0, r1 + beq _08024212 + bl sub_8024228 +_08024212: + ldr r0, [r4] + ldr r2, [r0, 0x10] + ldr r1, [r0, 0x8] + cmp r2, r1 + beq _08024222 + adds r0, r2, 0 + bl sub_8024228 +_08024222: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80241A8 + + thumb_func_start sub_8024228 +sub_8024228: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + ldr r3, _080242C8 + lsls r2, r1, 1 + adds r2, 0x18 + ldr r3, [r3] + adds r3, r2 + str r3, [sp] + adds r2, r0, 0 + subs r1, 0x1 + cmp r2, r1 + bge _080242B8 + str r1, [sp, 0x4] +_0802424A: + ldr r5, [sp] + adds r7, r1, 0 + adds r0, r2, 0x1 + mov r10, r0 + cmp r7, r2 + ble _080242B0 + ldr r3, _080242CC + mov r9, r3 + movs r0, 0x58 + mov r8, r0 +_0802425E: + mov r3, r9 + ldr r1, [r3] + subs r6, r5, 0x2 + movs r3, 0 + ldrsh r0, [r6, r3] + mov r3, r8 + muls r3, r0 + adds r0, r3, 0 + adds r1, r0 + movs r3, 0x8 + ldrsh r0, [r1, r3] + str r2, [sp, 0x8] + bl sub_808DCFC + adds r4, r0, 0 + mov r0, r9 + ldr r1, [r0] + movs r3, 0 + ldrsh r0, [r5, r3] + mov r3, r8 + muls r3, r0 + adds r0, r3, 0 + adds r1, r0 + movs r3, 0x8 + ldrsh r0, [r1, r3] + bl sub_808DCFC + lsls r4, 16 + lsls r0, 16 + ldr r2, [sp, 0x8] + cmp r4, r0 + ble _080242A8 + movs r0, 0 + ldrsh r1, [r5, r0] + ldrh r0, [r6] + strh r0, [r5] + strh r1, [r6] +_080242A8: + adds r5, r6, 0 + subs r7, 0x1 + cmp r7, r2 + bgt _0802425E +_080242B0: + mov r2, r10 + ldr r1, [sp, 0x4] + cmp r2, r1 + blt _0802424A +_080242B8: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080242C8: .4byte gUnknown_3001B60 +_080242CC: .4byte gUnknown_203B45C + thumb_func_end sub_8024228 + + thumb_func_start sub_80242D0 +sub_80242D0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + ldr r3, _08024374 + lsls r2, r1, 1 + adds r2, 0x18 + ldr r3, [r3] + adds r3, r2 + str r3, [sp] + adds r2, r0, 0 + subs r1, 0x1 + cmp r2, r1 + bge _08024364 + str r1, [sp, 0x4] +_080242F2: + ldr r5, [sp] + adds r7, r1, 0 + adds r0, r2, 0x1 + mov r10, r0 + cmp r7, r2 + ble _0802435C + ldr r3, _08024378 + mov r9, r3 + movs r0, 0x58 + mov r8, r0 +_08024306: + mov r3, r9 + ldr r1, [r3] + subs r6, r5, 0x2 + movs r3, 0 + ldrsh r0, [r6, r3] + mov r3, r8 + muls r3, r0 + adds r0, r3, 0 + adds r1, r0 + movs r3, 0x8 + ldrsh r0, [r1, r3] + movs r1, 0 + str r2, [sp, 0x8] + bl sub_808DCDC + adds r4, r0, 0 + mov r0, r9 + ldr r1, [r0] + movs r3, 0 + ldrsh r0, [r5, r3] + mov r3, r8 + muls r3, r0 + adds r0, r3, 0 + adds r1, r0 + movs r3, 0x8 + ldrsh r0, [r1, r3] + movs r1, 0 + bl sub_808DCDC + lsls r4, 16 + lsls r0, 16 + ldr r2, [sp, 0x8] + cmp r4, r0 + ble _08024354 + movs r0, 0 + ldrsh r1, [r5, r0] + ldrh r0, [r6] + strh r0, [r5] + strh r1, [r6] +_08024354: + adds r5, r6, 0 + subs r7, 0x1 + cmp r7, r2 + bgt _08024306 +_0802435C: + mov r2, r10 + ldr r1, [sp, 0x4] + cmp r2, r1 + blt _080242F2 +_08024364: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08024374: .4byte gUnknown_3001B60 +_08024378: .4byte gUnknown_203B45C + thumb_func_end sub_80242D0 + + thumb_func_start sub_802437C +sub_802437C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r3, _080243E4 + lsls r2, r1, 1 + adds r2, 0x18 + ldr r3, [r3] + adds r3, r2 + mov r10, r3 + adds r7, r0, 0 + subs r1, 0x1 + cmp r7, r1 + bge _080243D6 + mov r9, r1 +_0802439C: + mov r4, r10 + adds r6, r1, 0 + adds r0, r7, 0x1 + mov r8, r0 + cmp r6, r7 + ble _080243CE +_080243A8: + subs r5, r4, 0x2 + movs r1, 0 + ldrsh r0, [r5, r1] + movs r2, 0 + ldrsh r1, [r4, r2] + bl sub_808D864 + lsls r0, 24 + cmp r0, 0 + beq _080243C6 + movs r0, 0 + ldrsh r1, [r4, r0] + ldrh r0, [r5] + strh r0, [r4] + strh r1, [r5] +_080243C6: + adds r4, r5, 0 + subs r6, 0x1 + cmp r6, r7 + bgt _080243A8 +_080243CE: + mov r7, r8 + mov r1, r9 + cmp r7, r1 + blt _0802439C +_080243D6: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080243E4: .4byte gUnknown_3001B60 + thumb_func_end sub_802437C + + thumb_func_start sub_80243E8 +sub_80243E8: + push {r4,r5,lr} + sub sp, 0x3C + ldr r3, _08024448 + ldr r0, _0802444C + ldr r0, [r0] + ldr r2, _08024450 + adds r1, r0, r2 + movs r4, 0 + ldrsh r2, [r1, r4] + movs r4, 0xDD + lsls r4, 2 + adds r1, r0, r4 + movs r4, 0 + ldrsh r1, [r1, r4] + muls r1, r2 + movs r4, 0xDC + lsls r4, 2 + adds r2, r0, r4 + movs r4, 0 + ldrsh r2, [r2, r4] + adds r1, r2 + lsls r1, 1 + adds r0, 0x1A + adds r0, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0x58 + muls r0, r1 + ldr r4, [r3] + adds r4, r0 + add r5, sp, 0x28 + adds r1, r4, 0 + adds r1, 0x4C + adds r0, r5, 0 + movs r2, 0xA + bl sub_80922B4 + ldr r1, _08024454 + mov r0, sp + adds r2, r5, 0 + bl sub_800D158 + adds r0, r4, 0 + add sp, 0x3C + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08024448: .4byte gUnknown_203B45C +_0802444C: .4byte gUnknown_3001B60 +_08024450: .4byte 0x00000376 +_08024454: .4byte gUnknown_80DC9A4 + thumb_func_end sub_80243E8 + + thumb_func_start sub_8024458 +sub_8024458: + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 16 + asrs r4, 16 + ldr r6, _080244DC + movs r0, 0xA6 + lsls r0, 1 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r6] + adds r1, r0, 0 + adds r1, 0x48 + strh r4, [r1] + adds r1, 0x98 + str r5, [r1] + adds r2, r0, 0 + adds r2, 0xE4 + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 3 + adds r1, 0xE8 + adds r1, r0, r1 + str r1, [r2] + adds r0, 0xE8 + bl sub_8006518 + ldr r1, [r6] + adds r0, r1, 0 + adds r0, 0xE0 + ldr r2, [r0] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r1, 0xE8 + ldr r0, _080244E0 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r2, [r6] + adds r0, r2, 0 + adds r0, 0xE4 + ldr r1, [r0] + movs r3, 0xA4 + lsls r3, 1 + adds r0, r2, r3 + str r0, [r1, 0x14] + movs r4, 0xA5 + lsls r4, 1 + adds r1, r2, r4 + movs r0, 0xA + strb r0, [r1] + bl sub_8024604 + bl sub_802452C + ldr r0, [r6] + bl sub_8013984 + movs r0, 0x1 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080244DC: .4byte gUnknown_203B2AC +_080244E0: .4byte gUnknown_80DC9C8 + thumb_func_end sub_8024458 + + thumb_func_start sub_80244E4 +sub_80244E4: + push {r4,lr} + ldr r4, _08024500 + ldr r0, [r4] + bl GetKeyPress + cmp r0, 0x1 + beq _08024504 + cmp r0, 0x2 + bne _0802450E + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + b _08024524 + .align 2, 0 +_08024500: .4byte gUnknown_203B2AC +_08024504: + movs r0, 0 + bl sub_80119D4 + movs r0, 0x3 + b _08024524 +_0802450E: + ldr r0, [r4] + bl sub_8013938 + lsls r0, 24 + cmp r0, 0 + bne _0802451E + movs r0, 0 + b _08024524 +_0802451E: + bl sub_802452C + movs r0, 0x1 +_08024524: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80244E4 + + thumb_func_start sub_802452C +sub_802452C: + push {lr} + bl sub_8024588 + bl sub_80245D0 + pop {r0} + bx r0 + thumb_func_end sub_802452C + + thumb_func_start sub_802453C +sub_802453C: + push {r4,r5,lr} + ldr r4, _08024580 + ldr r2, [r4] + cmp r2, 0 + beq _0802457A + adds r0, r2, 0 + adds r0, 0xE0 + ldr r0, [r0] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0xE8 + ldr r0, _08024584 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + bl sub_8004914 + ldr r0, [r4] + adds r0, 0xE8 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0802457A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08024580: .4byte gUnknown_203B2AC +_08024584: .4byte gUnknown_80DC9B0 + thumb_func_end sub_802453C + + thumb_func_start sub_8024588 +sub_8024588: + push {r4,lr} + ldr r4, _080245C4 + ldr r0, [r4] + ldrh r1, [r0, 0x20] + movs r2, 0xA4 + lsls r2, 1 + adds r0, r2 + movs r2, 0 + strb r1, [r0] + ldr r0, [r4] + ldrh r1, [r0, 0x1E] + ldr r3, _080245C8 + adds r0, r3 + strb r1, [r0] + ldr r0, [r4] + ldr r1, _080245CC + adds r0, r1 + strb r2, [r0] + bl sub_8004914 + ldr r0, [r4] + adds r0, 0xE8 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080245C4: .4byte gUnknown_203B2AC +_080245C8: .4byte 0x00000149 +_080245CC: .4byte 0x0000014b + thumb_func_end sub_8024588 + + thumb_func_start sub_80245D0 +sub_80245D0: + push {r4,lr} + sub sp, 0x4 + ldr r0, _08024600 + ldr r4, [r0] + movs r0, 0x1E + ldrsh r1, [r4, r0] + lsls r2, r1, 2 + adds r0, r4, 0 + adds r0, 0x34 + adds r0, r2 + ldr r0, [r0] + adds r2, r4, 0 + adds r2, 0x4C + adds r3, r4, 0 + adds r3, 0xB0 + adds r4, 0xE0 + ldr r4, [r4] + str r4, [sp] + bl sub_808F844 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08024600: .4byte gUnknown_203B2AC + thumb_func_end sub_80245D0 + + thumb_func_start sub_8024604 +sub_8024604: + push {r4,r5,lr} + ldr r4, _08024654 + ldr r0, [r4] + movs r1, 0x2 + str r1, [r0, 0x34] + movs r1, 0x3 + str r1, [r0, 0x38] + movs r1, 0x5 + str r1, [r0, 0x3C] + adds r1, r0, 0 + adds r1, 0xE0 + ldr r3, [r1] + movs r1, 0x3 + movs r2, 0x1 + bl sub_8013818 + ldr r0, [r4] + adds r5, r0, 0 + adds r5, 0x4C + ldr r2, _08024658 + adds r0, 0x48 + movs r3, 0 + ldrsh r1, [r0, r3] + movs r0, 0x58 + muls r0, r1 + ldr r4, [r2] + adds r4, r0 + movs r0, 0x7 + bl sub_80023E4 + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_808FF20 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08024654: .4byte gUnknown_203B2AC +_08024658: .4byte gUnknown_203B45C + thumb_func_end sub_8024604 + + thumb_func_start sub_802465C +sub_802465C: + push {r4,r5,lr} + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r5, _080246E8 + movs r0, 0xBA + lsls r0, 1 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] + movs r4, 0 + str r4, [r0, 0x28] + str r4, [r0, 0x2C] + str r4, [r0, 0x30] + bl sub_808D33C + ldr r1, [r5] + str r0, [r1, 0xC] + bl sub_808D824 + ldr r1, [r5] + strb r0, [r1, 0x10] + ldr r0, [r5] + strb r4, [r0] + ldr r0, _080246EC + bl sub_808DDD0 + ldr r2, [r5] + movs r3, 0x82 + lsls r3, 1 + adds r1, r2, r3 + str r0, [r1] + adds r3, 0x4 + adds r1, r2, r3 + ldr r0, [r0, 0x4] + str r0, [r1] + movs r1, 0x88 + lsls r1, 1 + adds r0, r2, r1 + strb r4, [r0] + ldr r0, [r5] + adds r3, 0x9 + adds r0, r3 + strb r4, [r0] + ldr r0, [r5] + adds r1, 0x2 + adds r0, r1 + strb r4, [r0] + ldr r2, [r5] + subs r3, 0x5 + adds r1, r2, r3 + movs r0, 0x2 + strh r0, [r1] + movs r0, 0x87 + lsls r0, 1 + adds r1, r2, r0 + movs r0, 0x8 + strh r0, [r1] + movs r0, 0 + bl sub_80247EC + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080246E8: .4byte gUnknown_203B2B0 +_080246EC: .4byte 0x00000155 + thumb_func_end sub_802465C + + thumb_func_start sub_80246F0 +sub_80246F0: + push {lr} + ldr r0, _08024708 + ldr r0, [r0] + ldr r0, [r0, 0x20] + cmp r0, 0x15 + bhi _080247A8 + lsls r0, 2 + ldr r1, _0802470C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08024708: .4byte gUnknown_203B2B0 +_0802470C: .4byte _08024710 + .align 2, 0 +_08024710: + .4byte _08024768 + .4byte _08024768 + .4byte _080247A8 + .4byte _080247A8 + .4byte _080247A4 + .4byte _0802476E + .4byte _08024774 + .4byte _08024774 + .4byte _0802477A + .4byte _08024780 + .4byte _08024786 + .4byte _0802478C + .4byte _0802478C + .4byte _08024792 + .4byte _08024798 + .4byte _080247A8 + .4byte _080247A8 + .4byte _080247A8 + .4byte _080247A8 + .4byte _080247A8 + .4byte _080247A8 + .4byte _0802479E +_08024768: + bl sub_8024E9C + b _080247AC +_0802476E: + bl sub_8024F00 + b _080247AC +_08024774: + bl sub_8024FD4 + b _080247AC +_0802477A: + bl sub_80250EC + b _080247AC +_08024780: + bl sub_80251CC + b _080247AC +_08024786: + bl sub_8024F70 + b _080247AC +_0802478C: + bl sub_8025058 + b _080247AC +_08024792: + bl sub_802515C + b _080247AC +_08024798: + bl sub_80251E8 + b _080247AC +_0802479E: + bl sub_8025204 + b _080247AC +_080247A4: + movs r0, 0x3 + b _080247AE +_080247A8: + bl sub_8025230 +_080247AC: + movs r0, 0 +_080247AE: + pop {r1} + bx r1 + thumb_func_end sub_80246F0 + + thumb_func_start sub_80247B4 +sub_80247B4: + ldr r0, _080247BC + ldr r0, [r0] + ldrb r0, [r0] + bx lr + .align 2, 0 +_080247BC: .4byte gUnknown_203B2B0 + thumb_func_end sub_80247B4 + + thumb_func_start sub_80247C0 +sub_80247C0: + push {r4,lr} + ldr r4, _080247E8 + ldr r0, [r4] + cmp r0, 0 + beq _080247E0 + movs r1, 0x82 + lsls r1, 1 + adds r0, r1 + ldr r0, [r0] + bl sub_800AA14 + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_080247E0: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080247E8: .4byte gUnknown_203B2B0 + thumb_func_end sub_80247C0 + + thumb_func_start sub_80247EC +sub_80247EC: + push {lr} + ldr r1, _08024800 + ldr r1, [r1] + str r0, [r1, 0x20] + bl sub_8024804 + bl sub_80248FC + pop {r0} + bx r0 + .align 2, 0 +_08024800: .4byte gUnknown_203B2B0 + thumb_func_end sub_80247EC + + thumb_func_start sub_8024804 +sub_8024804: + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, _0802482C + ldr r0, [r4] + movs r1, 0x8A + lsls r1, 1 + adds r0, r1 + bl sub_8006518 + ldr r0, [r4] + ldr r0, [r0, 0x20] + subs r0, 0x8 + cmp r0, 0x14 + bhi _080248A8 + lsls r0, 2 + ldr r1, _08024830 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802482C: .4byte gUnknown_203B2B0 +_08024830: .4byte _08024834 + .align 2, 0 +_08024834: + .4byte _08024888 + .4byte _080248A8 + .4byte _080248A8 + .4byte _080248A8 + .4byte _080248A8 + .4byte _08024888 + .4byte _080248A8 + .4byte _080248A8 + .4byte _080248A8 + .4byte _080248D2 + .4byte _080248D2 + .4byte _080248D2 + .4byte _080248A8 + .4byte _080248A8 + .4byte _080248D2 + .4byte _080248D2 + .4byte _080248D2 + .4byte _080248D2 + .4byte _080248D2 + .4byte _080248D2 + .4byte _080248D2 +_08024888: + ldr r0, _080248A0 + ldr r1, [r0] + movs r2, 0xA2 + lsls r2, 1 + adds r1, r2 + ldr r0, _080248A4 + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldm r0!, {r2,r6,r7} + stm r1!, {r2,r6,r7} + b _080248D2 + .align 2, 0 +_080248A0: .4byte gUnknown_203B2B0 +_080248A4: .4byte gUnknown_80DCA00 +_080248A8: + ldr r3, _080248F4 + mov r12, r3 + movs r4, 0x8A + lsls r4, 1 + mov r8, r4 + ldr r4, _080248F8 + movs r3, 0 + movs r2, 0x3 +_080248B8: + mov r5, r12 + ldr r1, [r5] + adds r1, r3 + add r1, r8 + adds r0, r4, 0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r3, 0x18 + subs r2, 0x1 + cmp r2, 0 + bge _080248B8 +_080248D2: + bl sub_8004914 + ldr r0, _080248F4 + ldr r0, [r0] + movs r6, 0x8A + lsls r6, 1 + adds r0, r6 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080248F4: .4byte gUnknown_203B2B0 +_080248F8: .4byte gUnknown_80DC9E8 + thumb_func_end sub_8024804 + + thumb_func_start sub_80248FC +sub_80248FC: + push {r4,r5,lr} + sub sp, 0x14 + ldr r1, _08024918 + ldr r0, [r1] + ldr r0, [r0, 0x20] + adds r5, r1, 0 + cmp r0, 0x1D + bls _0802490E + b _08024CF4 +_0802490E: + lsls r0, 2 + ldr r1, _0802491C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08024918: .4byte gUnknown_203B2B0 +_0802491C: .4byte _08024920 + .align 2, 0 +_08024920: + .4byte _08024998 + .4byte _080249D0 + .4byte _080249E8 + .4byte _080249F8 + .4byte _08024CF4 + .4byte _08024A14 + .4byte _08024A20 + .4byte _08024A2E + .4byte _08024A94 + .4byte _08024AC0 + .4byte _08024A36 + .4byte _08024A68 + .4byte _08024A76 + .4byte _08024A94 + .4byte _08024AC0 + .4byte _08024ACA + .4byte _08024AD8 + .4byte _08024AE8 + .4byte _08024B4C + .4byte _08024B74 + .4byte _08024C9C + .4byte _08024CC8 + .4byte _08024C1C + .4byte _08024C2C + .4byte _08024C3C + .4byte _08024C4C + .4byte _08024C5C + .4byte _08024C6C + .4byte _08024C7C + .4byte _08024C8C +_08024998: + bl sub_80252B8 + lsls r0, 24 + cmp r0, 0 + beq _080249B0 + ldr r0, _080249AC + ldr r1, [r0] + movs r0, 0x3 + b _080249B6 + .align 2, 0 +_080249AC: .4byte gUnknown_203B2B0 +_080249B0: + ldr r0, _080249C8 + ldr r1, [r0] + movs r0, 0x1 +_080249B6: + str r0, [r1, 0x28] + bl sub_8024CFC + ldr r0, _080249CC + ldr r1, _080249C8 + ldr r1, [r1] + ldr r2, [r1, 0x28] + b _08024A42 + .align 2, 0 +_080249C8: .4byte gUnknown_203B2B0 +_080249CC: .4byte gUnknown_80DCA34 +_080249D0: + bl sub_8024CFC + ldr r0, _080249E0 + ldr r1, _080249E4 + ldr r1, [r1] + ldr r2, [r1, 0x28] + b _08024A42 + .align 2, 0 +_080249E0: .4byte gUnknown_80DCAB8 +_080249E4: .4byte gUnknown_203B2B0 +_080249E8: + ldr r1, [r5] + movs r0, 0x1 + str r0, [r1, 0x24] + ldr r0, _080249F4 + b _08024CAE + .align 2, 0 +_080249F4: .4byte gUnknown_80DCAD0 +_080249F8: + ldr r1, [r5] + movs r0, 0x4 + str r0, [r1, 0x24] + movs r0, 0x8 + movs r1, 0x3C + bl sub_8011900 + ldr r0, _08024A0C + ldr r3, _08024A10 + b _08024CB0 + .align 2, 0 +_08024A0C: .4byte gUnknown_80DCD5C +_08024A10: .4byte 0x00000305 +_08024A14: + bl sub_8024D48 + ldr r0, _08024A1C + b _08024A3C + .align 2, 0 +_08024A1C: .4byte gUnknown_80DCD90 +_08024A20: + movs r0, 0x2 + movs r1, 0x3 + movs r2, 0 + movs r3, 0xA + bl sub_801A5D8 + b _08024CF4 +_08024A2E: + movs r0, 0x1 + bl sub_801A8D0 + b _08024CF4 +_08024A36: + bl sub_8024DBC + ldr r0, _08024A60 +_08024A3C: + ldr r1, _08024A64 + ldr r1, [r1] + ldr r2, [r1, 0x2C] +_08024A42: + adds r3, r1, 0 + adds r3, 0x34 + adds r1, 0x74 + str r1, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + str r1, [sp, 0xC] + movs r1, 0x5 + str r1, [sp, 0x10] + movs r1, 0 + bl sub_8014248 + b _08024CF4 + .align 2, 0 +_08024A60: .4byte gUnknown_80DCDB8 +_08024A64: .4byte gUnknown_203B2B0 +_08024A68: + movs r0, 0x2 + movs r1, 0x3 + movs r2, 0 + movs r3, 0xA + bl sub_801A5D8 + b _08024A7C +_08024A76: + movs r0, 0x1 + bl sub_801A8D0 +_08024A7C: + ldr r0, _08024A90 + ldr r0, [r0] + ldr r0, [r0, 0x14] + movs r1, 0x1 + bl sub_801AEE4 + bl sub_801A9E0 + b _08024CF4 + .align 2, 0 +_08024A90: .4byte gUnknown_203B2B0 +_08024A94: + bl sub_801A9E0 + bl sub_8024E30 + ldr r0, _08024ABC + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x84 + adds r1, r2, 0 + adds r1, 0x34 + adds r3, r2, 0 + adds r3, 0x74 + ldr r2, [r2, 0x30] + str r2, [sp] + movs r2, 0x2 + str r2, [sp, 0x4] + movs r2, 0 + bl sub_8012D60 + b _08024CF4 + .align 2, 0 +_08024ABC: .4byte gUnknown_203B2B0 +_08024AC0: + ldr r0, [r5] + adds r0, 0x1C + bl sub_801B3C0 + b _08024CF4 +_08024ACA: + ldr r1, [r5] + movs r0, 0x5 + str r0, [r1, 0x24] + ldr r0, _08024AD4 + b _08024CAE + .align 2, 0 +_08024AD4: .4byte gUnknown_80DCDDC +_08024AD8: + ldr r1, [r5] + movs r0, 0xA + str r0, [r1, 0x24] + ldr r0, _08024AE4 + b _08024CAE + .align 2, 0 +_08024AE4: .4byte gUnknown_80DCE18 +_08024AE8: + bl sub_8025254 + ldr r0, _08024B00 + ldr r1, [r0] + ldrh r2, [r1, 0x8] + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _08024B04 + movs r0, 0x12 + b _08024B3A + .align 2, 0 +_08024B00: .4byte gUnknown_203B2B0 +_08024B04: + lsls r0, r2, 16 + lsrs r0, 16 + cmp r0, 0x4 + bne _08024B10 + movs r0, 0x18 + b _08024B3A +_08024B10: + cmp r0, 0x2 + bne _08024B18 + movs r0, 0x17 + b _08024B3A +_08024B18: + cmp r0, 0x10 + bne _08024B20 + movs r0, 0x1B + b _08024B3A +_08024B20: + cmp r0, 0x20 + bne _08024B28 + movs r0, 0x19 + b _08024B3A +_08024B28: + cmp r0, 0x40 + bne _08024B30 + movs r0, 0x1A + b _08024B3A +_08024B30: + cmp r0, 0x8 + bne _08024B38 + movs r0, 0x1C + b _08024B3A +_08024B38: + movs r0, 0x1D +_08024B3A: + str r0, [r1, 0x24] + movs r0, 0x3C + bl sub_8011930 + ldr r0, _08024B48 + b _08024CAE + .align 2, 0 +_08024B48: .4byte gUnknown_80DCE38 +_08024B4C: + ldr r0, _08024B68 + ldr r1, [r5] + ldr r1, [r1, 0xC] + movs r2, 0x5 + bl sub_808D9AC + ldr r0, _08024B6C + bl sub_8011988 + ldr r1, [r5] + movs r0, 0x13 + str r0, [r1, 0x24] + ldr r0, _08024B70 + b _08024CAE + .align 2, 0 +_08024B68: .4byte gUnknown_202E2B8 +_08024B6C: .4byte 0x000001ff +_08024B70: .4byte gUnknown_80DCE68 +_08024B74: + ldr r0, [r5] + ldr r0, [r0, 0xC] + movs r1, 0x8 + ldrsh r0, [r0, r1] + bl sub_808D994 + adds r1, r0, 0 + ldr r4, _08024C10 + adds r0, r4, 0 + bl strcpy + ldr r0, [r5] + movs r2, 0xA + ldrsh r0, [r0, r2] + bl sub_808D994 + adds r1, r0, 0 + adds r4, 0x50 + adds r0, r4, 0 + bl strcpy + ldr r1, [r5] + movs r0, 0x1 + strb r0, [r1] + bl sub_80977D0 + ldr r1, [r5] + ldr r0, [r1, 0xC] + movs r2, 0xA + ldrsh r1, [r1, r2] + bl sub_808F734 + bl nullsub_104 + bl sub_808D33C + ldr r1, [r5] + str r0, [r1, 0xC] + ldr r0, [r1, 0x14] + cmp r0, 0x14 + beq _08024BCA + bl sub_8091234 +_08024BCA: + ldr r0, [r5] + ldr r0, [r0, 0x18] + cmp r0, 0x14 + beq _08024BD6 + bl sub_8091234 +_08024BD6: + bl sub_80910B4 + ldr r0, _08024C14 + bl sub_801199C + movs r0, 0xD2 + bl sub_8011988 + ldr r1, [r5] + ldrb r0, [r1, 0x10] + cmp r0, 0 + beq _08024C06 + ldr r0, [r1, 0xC] + adds r4, r0, 0 + adds r4, 0x4C + movs r1, 0x8 + ldrsh r0, [r0, r1] + bl sub_808D994 + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0xA + bl sub_8092310 +_08024C06: + ldr r1, [r5] + movs r0, 0x3 + str r0, [r1, 0x24] + ldr r0, _08024C18 + b _08024CAE + .align 2, 0 +_08024C10: .4byte gUnknown_202DF98 +_08024C14: .4byte 0x000001ff +_08024C18: .4byte gUnknown_80DCEB0 +_08024C1C: + ldr r1, [r5] + movs r0, 0x3 + str r0, [r1, 0x24] + ldr r0, _08024C28 + b _08024CAE + .align 2, 0 +_08024C28: .4byte gUnknown_80DCEDC +_08024C2C: + ldr r1, [r5] + movs r0, 0x3 + str r0, [r1, 0x24] + ldr r0, _08024C38 + b _08024CAE + .align 2, 0 +_08024C38: .4byte gUnknown_80DCF44 +_08024C3C: + ldr r1, [r5] + movs r0, 0x3 + str r0, [r1, 0x24] + ldr r0, _08024C48 + b _08024CAE + .align 2, 0 +_08024C48: .4byte gUnknown_80DCF88 +_08024C4C: + ldr r1, [r5] + movs r0, 0x3 + str r0, [r1, 0x24] + ldr r0, _08024C58 + b _08024CAE + .align 2, 0 +_08024C58: .4byte gUnknown_80DCFAC +_08024C5C: + ldr r1, [r5] + movs r0, 0x3 + str r0, [r1, 0x24] + ldr r0, _08024C68 + b _08024CAE + .align 2, 0 +_08024C68: .4byte gUnknown_80DCFF4 +_08024C6C: + ldr r1, [r5] + movs r0, 0x3 + str r0, [r1, 0x24] + ldr r0, _08024C78 + b _08024CAE + .align 2, 0 +_08024C78: .4byte gUnknown_80DD054 +_08024C7C: + ldr r1, [r5] + movs r0, 0x3 + str r0, [r1, 0x24] + ldr r0, _08024C88 + b _08024CAE + .align 2, 0 +_08024C88: .4byte gUnknown_80DD098 +_08024C8C: + ldr r1, [r5] + movs r0, 0x3 + str r0, [r1, 0x24] + ldr r0, _08024C98 + b _08024CAE + .align 2, 0 +_08024C98: .4byte gUnknown_80DD0E0 +_08024C9C: + movs r0, 0x8 + movs r1, 0x3C + bl sub_8011900 + ldr r0, _08024CBC + ldr r1, [r0] + movs r0, 0x15 + str r0, [r1, 0x24] + ldr r0, _08024CC0 +_08024CAE: + ldr r3, _08024CC4 +_08024CB0: + movs r1, 0 + movs r2, 0 + bl sub_80141B4 + b _08024CF4 + .align 2, 0 +_08024CBC: .4byte gUnknown_203B2B0 +_08024CC0: .4byte gUnknown_80DD104 +_08024CC4: .4byte 0x00000105 +_08024CC8: + ldr r1, [r5] + ldrb r0, [r1, 0x10] + cmp r0, 0 + beq _08024CE8 + ldr r0, [r1, 0xC] + adds r4, r0, 0 + adds r4, 0x4C + movs r2, 0x8 + ldrsh r0, [r0, r2] + bl sub_808D994 + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0xA + bl sub_8092310 +_08024CE8: + ldr r0, [r5] + ldr r1, [r0, 0xC] + adds r1, 0x4C + movs r0, 0 + bl sub_801602C +_08024CF4: + add sp, 0x14 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80248FC + + thumb_func_start sub_8024CFC +sub_8024CFC: + push {r4,lr} + ldr r4, _08024D38 + ldr r0, [r4] + adds r0, 0x74 + movs r1, 0 + movs r2, 0x10 + bl MemoryFill16 + ldr r1, [r4] + movs r3, 0 + ldr r0, _08024D3C + str r0, [r1, 0x34] + movs r0, 0x3 + str r0, [r1, 0x38] + movs r2, 0x1 + ldr r0, _08024D40 + ldr r0, [r0] + str r0, [r1, 0x3C] + movs r0, 0x2 + str r0, [r1, 0x40] + ldr r0, _08024D44 + ldr r0, [r0] + str r0, [r1, 0x44] + str r2, [r1, 0x48] + str r3, [r1, 0x4C] + str r2, [r1, 0x50] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08024D38: .4byte gUnknown_203B2B0 +_08024D3C: .4byte gUnknown_80DCA18 +_08024D40: .4byte gUnknown_80D4970 +_08024D44: .4byte gUnknown_80D4934 + thumb_func_end sub_8024CFC + + thumb_func_start sub_8024D48 +sub_8024D48: + push {r4-r7,lr} + ldr r4, _08024DAC + ldr r0, [r4] + adds r0, 0x74 + movs r1, 0 + movs r2, 0x10 + bl MemoryFill16 + ldr r3, [r4] + movs r2, 0 + ldr r0, _08024DB0 + str r0, [r3, 0x34] + movs r0, 0x4 + str r0, [r3, 0x38] + movs r1, 0x1 + ldr r0, _08024DB4 + str r0, [r3, 0x3C] + movs r0, 0x5 + str r0, [r3, 0x40] + ldr r0, _08024DB8 + ldr r0, [r0] + str r0, [r3, 0x44] + str r1, [r3, 0x48] + movs r6, 0x3 + str r2, [r3, 0x4C] + str r1, [r3, 0x50] + movs r5, 0 + mov r12, r3 + adds r3, 0x38 + mov r2, r12 + adds r2, 0x74 +_08024D86: + ldrh r0, [r2] + cmp r0, 0 + bne _08024D96 + ldr r1, [r3] + mov r7, r12 + ldr r0, [r7, 0x2C] + cmp r1, r0 + beq _08024DA6 +_08024D96: + adds r3, 0x8 + adds r2, 0x2 + adds r5, 0x1 + cmp r5, r6 + blt _08024D86 + ldr r1, [r4] + movs r0, 0x4 + str r0, [r1, 0x2C] +_08024DA6: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08024DAC: .4byte gUnknown_203B2B0 +_08024DB0: .4byte gUnknown_80DCA24 +_08024DB4: .4byte gUnknown_80DCA2C +_08024DB8: .4byte gUnknown_80D4934 + thumb_func_end sub_8024D48 + + thumb_func_start sub_8024DBC +sub_8024DBC: + push {r4-r7,lr} + ldr r4, _08024E20 + ldr r0, [r4] + adds r0, 0x74 + movs r1, 0 + movs r2, 0x10 + bl MemoryFill16 + ldr r3, [r4] + movs r2, 0 + ldr r0, _08024E24 + str r0, [r3, 0x34] + movs r0, 0x4 + str r0, [r3, 0x38] + movs r1, 0x1 + ldr r0, _08024E28 + str r0, [r3, 0x3C] + movs r0, 0x5 + str r0, [r3, 0x40] + ldr r0, _08024E2C + ldr r0, [r0] + str r0, [r3, 0x44] + str r1, [r3, 0x48] + movs r6, 0x3 + str r2, [r3, 0x4C] + str r1, [r3, 0x50] + movs r5, 0 + mov r12, r3 + adds r3, 0x38 + mov r2, r12 + adds r2, 0x74 +_08024DFA: + ldrh r0, [r2] + cmp r0, 0 + bne _08024E0A + ldr r1, [r3] + mov r7, r12 + ldr r0, [r7, 0x2C] + cmp r1, r0 + beq _08024E1A +_08024E0A: + adds r3, 0x8 + adds r2, 0x2 + adds r5, 0x1 + cmp r5, r6 + blt _08024DFA + ldr r1, [r4] + movs r0, 0x4 + str r0, [r1, 0x2C] +_08024E1A: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08024E20: .4byte gUnknown_203B2B0 +_08024E24: .4byte gUnknown_80DCA24 +_08024E28: .4byte gUnknown_80DCA2C +_08024E2C: .4byte gUnknown_80D4934 + thumb_func_end sub_8024DBC + + thumb_func_start sub_8024E30 +sub_8024E30: + push {r4-r7,lr} + ldr r4, _08024E90 + ldr r0, [r4] + adds r0, 0x74 + movs r1, 0 + movs r2, 0x10 + bl MemoryFill16 + ldr r3, [r4] + movs r2, 0 + ldr r0, _08024E94 + str r0, [r3, 0x34] + movs r0, 0x5 + str r0, [r3, 0x38] + movs r1, 0x1 + ldr r0, _08024E98 + ldr r0, [r0] + str r0, [r3, 0x3C] + movs r0, 0x2 + str r0, [r3, 0x40] + movs r6, 0x2 + str r2, [r3, 0x44] + str r1, [r3, 0x48] + movs r5, 0 + mov r12, r3 + adds r3, 0x38 + mov r2, r12 + adds r2, 0x74 +_08024E68: + ldrh r0, [r2] + cmp r0, 0 + bne _08024E78 + ldr r1, [r3] + mov r7, r12 + ldr r0, [r7, 0x30] + cmp r1, r0 + beq _08024E88 +_08024E78: + adds r3, 0x8 + adds r2, 0x2 + adds r5, 0x1 + cmp r5, r6 + blt _08024E68 + ldr r1, [r4] + movs r0, 0x5 + str r0, [r1, 0x30] +_08024E88: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08024E90: .4byte gUnknown_203B2B0 +_08024E94: .4byte gUnknown_80DCA2C +_08024E98: .4byte gUnknown_80D4970 + thumb_func_end sub_8024E30 + + thumb_func_start sub_8024E9C +sub_8024E9C: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08024EF8 + ldr r1, [sp] + cmp r1, 0x1 + beq _08024EB6 + ldr r0, _08024EC8 + ldr r0, [r0] + str r1, [r0, 0x28] +_08024EB6: + ldr r0, [sp] + cmp r0, 0x2 + beq _08024EEA + cmp r0, 0x2 + bgt _08024ECC + cmp r0, 0x1 + beq _08024EF2 + b _08024EF8 + .align 2, 0 +_08024EC8: .4byte gUnknown_203B2B0 +_08024ECC: + cmp r0, 0x3 + bne _08024EF8 + bl sub_80252B8 + lsls r0, 24 + cmp r0, 0 + beq _08024EE2 + movs r0, 0x5 + bl sub_80247EC + b _08024EF8 +_08024EE2: + movs r0, 0x16 + bl sub_80247EC + b _08024EF8 +_08024EEA: + movs r0, 0x2 + bl sub_80247EC + b _08024EF8 +_08024EF2: + movs r0, 0x3 + bl sub_80247EC +_08024EF8: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8024E9C + + thumb_func_start sub_8024F00 +sub_8024F00: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08024F6A + ldr r1, [sp] + cmp r1, 0x1 + beq _08024F1A + ldr r0, _08024F2C + ldr r0, [r0] + str r1, [r0, 0x2C] +_08024F1A: + ldr r0, [sp] + cmp r0, 0x4 + beq _08024F36 + cmp r0, 0x4 + bgt _08024F30 + cmp r0, 0x1 + beq _08024F64 + b _08024F6A + .align 2, 0 +_08024F2C: .4byte gUnknown_203B2B0 +_08024F30: + cmp r0, 0x5 + beq _08024F4C + b _08024F6A +_08024F36: + ldr r0, _08024F48 + ldr r1, [r0] + movs r0, 0x14 + str r0, [r1, 0x14] + str r0, [r1, 0x18] + movs r0, 0x11 + bl sub_80247EC + b _08024F6A + .align 2, 0 +_08024F48: .4byte gUnknown_203B2B0 +_08024F4C: + bl sub_8090A34 + cmp r0, 0 + bne _08024F5C + movs r0, 0xF + bl sub_80247EC + b _08024F6A +_08024F5C: + movs r0, 0x6 + bl sub_80247EC + b _08024F6A +_08024F64: + movs r0, 0x1 + bl sub_80247EC +_08024F6A: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8024F00 + + thumb_func_start sub_8024F70 +sub_8024F70: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08024FCC + ldr r1, [sp] + cmp r1, 0x1 + beq _08024F8A + ldr r0, _08024F9C + ldr r0, [r0] + str r1, [r0, 0x2C] +_08024F8A: + ldr r0, [sp] + cmp r0, 0x4 + beq _08024FA6 + cmp r0, 0x4 + bgt _08024FA0 + cmp r0, 0x1 + beq _08024FC6 + b _08024FCC + .align 2, 0 +_08024F9C: .4byte gUnknown_203B2B0 +_08024FA0: + cmp r0, 0x5 + beq _08024FAE + b _08024FCC +_08024FA6: + movs r0, 0x11 + bl sub_80247EC + b _08024FCC +_08024FAE: + bl sub_8090A34 + cmp r0, 0x1 + bgt _08024FBE + movs r0, 0x10 + bl sub_80247EC + b _08024FCC +_08024FBE: + movs r0, 0xB + bl sub_80247EC + b _08024FCC +_08024FC6: + movs r0, 0x1 + bl sub_80247EC +_08024FCC: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8024F70 + + thumb_func_start sub_8024FD4 +sub_8024FD4: + push {lr} + movs r0, 0x1 + bl sub_801A6E8 + cmp r0, 0x3 + beq _08024FF0 + cmp r0, 0x3 + bhi _08024FEA + cmp r0, 0x2 + beq _08025048 + b _08025052 +_08024FEA: + cmp r0, 0x4 + beq _0802501C + b _08025052 +_08024FF0: + bl sub_801A8AC + ldr r1, _08025014 + ldr r2, [r1] + str r0, [r2, 0x14] + movs r1, 0x14 + str r1, [r2, 0x18] + ldr r1, _08025018 + ldr r1, [r1] + lsls r0, 2 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x1C] + movs r0, 0x8 + bl sub_80247EC + b _08025052 + .align 2, 0 +_08025014: .4byte gUnknown_203B2B0 +_08025018: .4byte gUnknown_203B460 +_0802501C: + bl sub_801A8AC + ldr r1, _08025040 + ldr r2, [r1] + ldr r1, _08025044 + ldr r1, [r1] + lsls r0, 2 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x1C] + movs r0, 0 + bl sub_8099690 + movs r0, 0x9 + bl sub_80247EC + b _08025052 + .align 2, 0 +_08025040: .4byte gUnknown_203B2B0 +_08025044: .4byte gUnknown_203B460 +_08025048: + bl sub_801A928 + movs r0, 0x5 + bl sub_80247EC +_08025052: + pop {r0} + bx r0 + thumb_func_end sub_8024FD4 + + thumb_func_start sub_8025058 +sub_8025058: + push {r4,r5,lr} + movs r0, 0x1 + bl sub_801A6E8 + cmp r0, 0x3 + beq _08025074 + cmp r0, 0x3 + bhi _0802506E + cmp r0, 0x2 + beq _080250DC + b _080250E6 +_0802506E: + cmp r0, 0x4 + beq _080250B0 + b _080250E6 +_08025074: + ldr r5, _080250A0 + ldr r4, [r5] + bl sub_801A8AC + ldr r1, [r4, 0x14] + cmp r1, r0 + beq _080250A8 + bl sub_801A8AC + ldr r2, [r5] + str r0, [r2, 0x18] + ldr r1, _080250A4 + ldr r1, [r1] + lsls r0, 2 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x1C] + movs r0, 0xD + bl sub_80247EC + b _080250E6 + .align 2, 0 +_080250A0: .4byte gUnknown_203B2B0 +_080250A4: .4byte gUnknown_203B460 +_080250A8: + movs r0, 0x2 + bl sub_80119D4 + b _080250E6 +_080250B0: + bl sub_801A8AC + ldr r1, _080250D4 + ldr r2, [r1] + ldr r1, _080250D8 + ldr r1, [r1] + lsls r0, 2 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x1C] + movs r0, 0 + bl sub_8099690 + movs r0, 0xE + bl sub_80247EC + b _080250E6 + .align 2, 0 +_080250D4: .4byte gUnknown_203B2B0 +_080250D8: .4byte gUnknown_203B460 +_080250DC: + bl sub_801A928 + movs r0, 0xA + bl sub_80247EC +_080250E6: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8025058 + + thumb_func_start sub_80250EC +sub_80250EC: + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + bl sub_801A6E8 + ldr r4, _0802512C + ldr r0, [r4] + adds r0, 0x84 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _0802511C + ldr r0, [r4] + adds r0, 0x84 + mov r1, sp + bl sub_8013114 + ldr r1, [sp] + cmp r1, 0x1 + beq _0802511C + ldr r0, [r4] + str r1, [r0, 0x30] +_0802511C: + ldr r0, [sp] + cmp r0, 0x2 + beq _08025140 + cmp r0, 0x2 + bgt _08025130 + cmp r0, 0x1 + beq _0802514E + b _08025154 + .align 2, 0 +_0802512C: .4byte gUnknown_203B2B0 +_08025130: + cmp r0, 0x5 + bne _08025154 + bl sub_801A928 + movs r0, 0xA + bl sub_80247EC + b _08025154 +_08025140: + movs r0, 0 + bl sub_8099690 + movs r0, 0x9 + bl sub_80247EC + b _08025154 +_0802514E: + movs r0, 0x7 + bl sub_80247EC +_08025154: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80250EC + + thumb_func_start sub_802515C +sub_802515C: + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + bl sub_801A6E8 + ldr r4, _0802519C + ldr r0, [r4] + adds r0, 0x84 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _0802518C + ldr r0, [r4] + adds r0, 0x84 + mov r1, sp + bl sub_8013114 + ldr r1, [sp] + cmp r1, 0x1 + beq _0802518C + ldr r0, [r4] + str r1, [r0, 0x30] +_0802518C: + ldr r0, [sp] + cmp r0, 0x2 + beq _080251B0 + cmp r0, 0x2 + bgt _080251A0 + cmp r0, 0x1 + beq _080251BE + b _080251C4 + .align 2, 0 +_0802519C: .4byte gUnknown_203B2B0 +_080251A0: + cmp r0, 0x5 + bne _080251C4 + bl sub_801A928 + movs r0, 0x11 + bl sub_80247EC + b _080251C4 +_080251B0: + movs r0, 0 + bl sub_8099690 + movs r0, 0xE + bl sub_80247EC + b _080251C4 +_080251BE: + movs r0, 0xC + bl sub_80247EC +_080251C4: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_802515C + + thumb_func_start sub_80251CC +sub_80251CC: + push {lr} + bl sub_801B410 + cmp r0, 0x1 + bls _080251E4 + cmp r0, 0x3 + bhi _080251E4 + bl sub_801B450 + movs r0, 0x7 + bl sub_80247EC +_080251E4: + pop {r0} + bx r0 + thumb_func_end sub_80251CC + + thumb_func_start sub_80251E8 +sub_80251E8: + push {lr} + bl sub_801B410 + cmp r0, 0x1 + bls _08025200 + cmp r0, 0x3 + bhi _08025200 + bl sub_801B450 + movs r0, 0xC + bl sub_80247EC +_08025200: + pop {r0} + bx r0 + thumb_func_end sub_80251E8 + + thumb_func_start sub_8025204 +sub_8025204: + push {r4,lr} + bl sub_8016080 + cmp r0, 0x3 + bne _08025226 + bl sub_80160D8 + ldr r4, _0802522C + ldr r0, [r4] + ldr r0, [r0, 0xC] + bl sub_808D824 + ldr r1, [r4] + strb r0, [r1, 0x10] + movs r0, 0x3 + bl sub_80247EC +_08025226: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802522C: .4byte gUnknown_203B2B0 + thumb_func_end sub_8025204 + + thumb_func_start sub_8025230 +sub_8025230: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08025248 + ldr r0, _08025250 + ldr r0, [r0] + ldr r0, [r0, 0x24] + bl sub_80247EC +_08025248: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08025250: .4byte gUnknown_203B2B0 + thumb_func_end sub_8025230 + + thumb_func_start sub_8025254 +sub_8025254: + push {lr} + ldr r0, _08025268 + ldr r2, [r0] + ldr r1, [r2, 0x14] + adds r3, r0, 0 + cmp r1, 0x14 + bne _0802526C + movs r0, 0 + b _08025276 + .align 2, 0 +_08025268: .4byte gUnknown_203B2B0 +_0802526C: + ldr r0, _08025284 + ldr r0, [r0] + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0, 0x2] +_08025276: + strb r0, [r2, 0x4] + ldr r2, [r3] + ldr r1, [r2, 0x18] + cmp r1, 0x14 + bne _08025288 + movs r0, 0 + b _08025292 + .align 2, 0 +_08025284: .4byte gUnknown_203B460 +_08025288: + ldr r0, _080252B0 + ldr r0, [r0] + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0, 0x2] +_08025292: + strb r0, [r2, 0x5] + movs r0, 0xFF + bl RandomCapped + ldr r2, _080252B4 + ldr r1, [r2] + strb r0, [r1, 0x6] + ldr r1, [r2] + ldr r0, [r1, 0xC] + adds r1, 0x4 + movs r2, 0x1 + bl sub_808F468 + pop {r0} + bx r0 + .align 2, 0 +_080252B0: .4byte gUnknown_203B460 +_080252B4: .4byte gUnknown_203B2B0 + thumb_func_end sub_8025254 + + thumb_func_start sub_80252B8 +sub_80252B8: + push {r4,lr} + ldr r0, _080252E0 + ldr r1, [r0] + movs r3, 0 + movs r4, 0x1 + ldr r2, _080252E4 +_080252C4: + ldrh r0, [r1] + lsrs r0, 1 + ands r0, r4 + cmp r0, 0 + beq _080252D0 + adds r3, 0x1 +_080252D0: + subs r2, 0x1 + adds r1, 0x58 + cmp r2, 0 + bne _080252C4 + cmp r3, 0x1 + beq _080252E8 + movs r0, 0 + b _080252EA + .align 2, 0 +_080252E0: .4byte gUnknown_203B45C +_080252E4: .4byte 0x0000019d +_080252E8: + movs r0, 0x1 +_080252EA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80252B8 + + thumb_func_start sub_80252F0 +sub_80252F0: + push {r4-r6,lr} + adds r6, r0, 0 + cmp r6, 0x2 + bne _08025308 + movs r0, 0x4 + bl sub_8024108 + lsls r0, 24 + cmp r0, 0 + beq _08025308 + movs r0, 0 + b _0802534C +_08025308: + ldr r4, _08025340 + movs r0, 0xBC + lsls r0, 1 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r4] + movs r5, 0 + str r5, [r0, 0x70] + str r6, [r0] + bl sub_80A5728 + lsls r0, 16 + asrs r0, 16 + bl sub_8002658 + ldr r1, [r4] + strb r0, [r1, 0xC] + ldr r0, [r4] + strb r5, [r0, 0xD] + ldr r0, [r4] + ldr r0, [r0] + cmp r0, 0x2 + bne _08025344 + movs r0, 0 + bl sub_8025434 + b _0802534A + .align 2, 0 +_08025340: .4byte gUnknown_203B2B4 +_08025344: + movs r0, 0x1 + bl sub_8025434 +_0802534A: + movs r0, 0x1 +_0802534C: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80252F0 + + thumb_func_start sub_8025354 +sub_8025354: + push {lr} + ldr r0, _0802536C + ldr r0, [r0] + ldr r0, [r0, 0x4] + subs r0, 0x1 + cmp r0, 0x12 + bhi _08025400 + lsls r0, 2 + ldr r1, _08025370 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802536C: .4byte gUnknown_203B2B4 +_08025370: .4byte _08025374 + .align 2, 0 +_08025374: + .4byte _080253C4 + .4byte _080253C4 + .4byte _080253CA + .4byte _080253D0 + .4byte _080253D6 + .4byte _08025400 + .4byte _08025400 + .4byte _08025400 + .4byte _08025400 + .4byte _08025400 + .4byte _080253DC + .4byte _080253DC + .4byte _080253E2 + .4byte _080253E8 + .4byte _080253EE + .4byte _080253EE + .4byte _080253F4 + .4byte _080253FA + .4byte _080253C0 +_080253C0: + movs r0, 0x3 + b _08025406 +_080253C4: + bl sub_80259F0 + b _08025404 +_080253CA: + bl sub_8025A84 + b _08025404 +_080253D0: + bl sub_8025BCC + b _08025404 +_080253D6: + bl sub_8025BE8 + b _08025404 +_080253DC: + bl sub_8025C04 + b _08025404 +_080253E2: + bl sub_8025CB4 + b _08025404 +_080253E8: + bl sub_8025D90 + b _08025404 +_080253EE: + bl sub_8025DAC + b _08025404 +_080253F4: + bl sub_8025E08 + b _08025404 +_080253FA: + bl sub_8025E24 + b _08025404 +_08025400: + bl sub_8025E44 +_08025404: + movs r0, 0 +_08025406: + pop {r1} + bx r1 + thumb_func_end sub_8025354 + + thumb_func_start sub_802540C +sub_802540C: + ldr r0, _08025414 + ldr r0, [r0] + ldrb r0, [r0, 0xD] + bx lr + .align 2, 0 +_08025414: .4byte gUnknown_203B2B4 + thumb_func_end sub_802540C + + thumb_func_start sub_8025418 +sub_8025418: + push {r4,lr} + ldr r4, _08025430 + ldr r0, [r4] + cmp r0, 0 + beq _0802542A + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0802542A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08025430: .4byte gUnknown_203B2B4 + thumb_func_end sub_8025418 + + thumb_func_start sub_8025434 +sub_8025434: + push {lr} + ldr r1, _08025448 + ldr r1, [r1] + str r0, [r1, 0x4] + bl sub_802544C + bl sub_8025518 + pop {r0} + bx r0 + .align 2, 0 +_08025448: .4byte gUnknown_203B2B4 + thumb_func_end sub_8025434 + + thumb_func_start sub_802544C +sub_802544C: + push {r4-r7,lr} + ldr r4, _08025470 + ldr r0, [r4] + movs r1, 0x8C + lsls r1, 1 + adds r0, r1 + bl sub_8006518 + ldr r1, [r4] + ldr r0, [r1, 0x4] + cmp r0, 0x3 + beq _08025478 + cmp r0, 0xD + beq _080254B0 + movs r2, 0 + ldr r3, _08025474 + b _080254D8 + .align 2, 0 +_08025470: .4byte gUnknown_203B2B4 +_08025474: .4byte gUnknown_80DD148 +_08025478: + ldr r0, [r1] + cmp r0, 0 + bne _0802548E + movs r2, 0xB0 + lsls r2, 1 + adds r1, r2 + ldr r0, _080254A8 + ldm r0!, {r3,r5,r6} + stm r1!, {r3,r5,r6} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} +_0802548E: + bl sub_8025728 + ldr r2, [r4] + movs r0, 0xA4 + lsls r0, 1 + adds r2, r0 + ldr r1, _080254AC + ldm r1!, {r5-r7} + stm r2!, {r5-r7} + ldm r1!, {r3,r5,r6} + stm r2!, {r3,r5,r6} + b _080254C6 + .align 2, 0 +_080254A8: .4byte gUnknown_80DD190 +_080254AC: .4byte gUnknown_80DD160 +_080254B0: + bl sub_802591C + ldr r2, [r4] + movs r0, 0xA4 + lsls r0, 1 + adds r2, r0 + ldr r1, _080254D4 + ldm r1!, {r3,r5,r7} + stm r2!, {r3,r5,r7} + ldm r1!, {r3,r6,r7} + stm r2!, {r3,r6,r7} +_080254C6: + ldr r1, [r4] + adds r0, r1, r0 + adds r1, 0xC8 + bl sub_8012CAC + b _080254F8 + .align 2, 0 +_080254D4: .4byte gUnknown_80DD178 +_080254D8: + ldr r0, [r4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 3 + adds r0, r1 + movs r5, 0x8C + lsls r5, 1 + adds r0, r5 + adds r1, r3, 0 + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + adds r2, 0x1 + cmp r2, 0x3 + ble _080254D8 +_080254F8: + bl sub_8004914 + ldr r0, _08025514 + ldr r0, [r0] + movs r6, 0x8C + lsls r6, 1 + adds r0, r6 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08025514: .4byte gUnknown_203B2B4 + thumb_func_end sub_802544C + + thumb_func_start sub_8025518 +sub_8025518: + push {r4,r5,lr} + sub sp, 0xC + ldr r1, _08025534 + ldr r0, [r1] + ldr r0, [r0, 0x4] + adds r5, r1, 0 + cmp r0, 0x13 + bls _0802552A + b _08025720 +_0802552A: + lsls r0, 2 + ldr r1, _08025538 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08025534: .4byte gUnknown_203B2B4 +_08025538: .4byte _0802553C + .align 2, 0 +_0802553C: + .4byte _0802558C + .4byte _080255A0 + .4byte _080255BA + .4byte _080255C2 + .4byte _0802560C + .4byte _0802561A + .4byte _08025720 + .4byte _080256A8 + .4byte _0802567A + .4byte _08025688 + .4byte _08025698 + .4byte _08025626 + .4byte _08025634 + .4byte _0802563C + .4byte _08025668 + .4byte _080256CC + .4byte _080256F2 + .4byte _080256FC + .4byte _08025714 + .4byte _08025720 +_0802558C: + ldr r1, [r5] + movs r0, 0x1 + str r0, [r1, 0x8] + ldr r0, _08025598 + ldr r3, _0802559C + b _080256B8 + .align 2, 0 +_08025598: .4byte gUnknown_80DD1A8 +_0802559C: .4byte 0x00000301 +_080255A0: + movs r1, 0x4 + ldr r0, [r5] + ldr r0, [r0] + cmp r0, 0 + bne _080255AC + movs r1, 0x2 +_080255AC: + adds r0, r1, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0xA + bl sub_8023868 + b _08025720 +_080255BA: + movs r0, 0x1 + bl sub_8023B7C + b _08025720 +_080255C2: + ldr r1, [r5] + ldr r0, [r1] + cmp r0, 0 + bne _080255D2 + adds r1, 0x18 + movs r0, 0x3 + bl sub_8025E68 +_080255D2: + bl sub_8023DA4 + ldr r4, _08025608 + ldr r0, [r5] + ldr r1, [r0, 0x1C] + adds r0, r4, 0 + movs r2, 0x7 + bl sub_808D9AC + adds r4, 0x50 + ldr r0, [r5] + ldr r1, [r0, 0x1C] + adds r0, r4, 0 + movs r2, 0x6 + bl sub_808D9AC + ldr r2, [r5] + adds r0, r2, 0 + adds r0, 0x78 + adds r1, r2, 0 + adds r1, 0xC8 + movs r4, 0x84 + lsls r4, 1 + adds r3, r2, r4 + ldr r2, [r2, 0x70] + b _08025654 + .align 2, 0 +_08025608: .4byte gUnknown_202DF98 +_0802560C: + ldr r0, [r5] + movs r1, 0xE + ldrsh r0, [r0, r1] + movs r1, 0x2 + bl sub_8024458 + b _08025720 +_0802561A: + ldr r0, [r5] + movs r4, 0xE + ldrsh r0, [r0, r4] + bl sub_801BEEC + b _08025720 +_08025626: + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0xA + bl sub_801A5D8 + b _08025720 +_08025634: + movs r0, 0x1 + bl sub_801A8D0 + b _08025720 +_0802563C: + bl sub_801A9E0 + ldr r0, _08025664 + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x78 + adds r1, r2, 0 + adds r1, 0xC8 + movs r4, 0x84 + lsls r4, 1 + adds r3, r2, r4 + ldr r2, [r2, 0x74] +_08025654: + str r2, [sp] + movs r2, 0x2 + str r2, [sp, 0x4] + movs r2, 0 + bl sub_8012D60 + b _08025720 + .align 2, 0 +_08025664: .4byte gUnknown_203B2B4 +_08025668: + ldr r1, [r5] + adds r1, 0x14 + add r0, sp, 0x8 + bl sub_8090B64 + add r0, sp, 0x8 + bl sub_801B3C0 + b _08025720 +_0802567A: + ldr r1, [r5] + movs r0, 0x2 + str r0, [r1, 0x8] + ldr r0, _08025684 + b _080256B6 + .align 2, 0 +_08025684: .4byte gUnknown_80DD1C8 +_08025688: + ldr r1, [r5] + movs r0, 0x2 + str r0, [r1, 0x8] + ldr r0, _08025694 + b _080256B6 + .align 2, 0 +_08025694: .4byte gUnknown_80DD1EC +_08025698: + ldr r1, [r5] + movs r0, 0x2 + str r0, [r1, 0x8] + ldr r0, _080256A4 + b _080256B6 + .align 2, 0 +_080256A4: .4byte gUnknown_80DD240 +_080256A8: + ldr r1, [r5] + movs r0, 0x1 + str r0, [r1, 0x8] + movs r0, 0xCF + bl sub_8011988 + ldr r0, _080256C4 +_080256B6: + ldr r3, _080256C8 +_080256B8: + movs r1, 0 + movs r2, 0 + bl sub_80141B4 + b _08025720 + .align 2, 0 +_080256C4: .4byte gUnknown_80DD270 +_080256C8: .4byte 0x00000101 +_080256CC: + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0x28 + ldr r1, [r1, 0x1C] + adds r1, 0x2C + bl sub_809401C + ldr r2, [r5] + movs r0, 0xE + ldrsh r1, [r2, r0] + adds r2, 0x28 + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x3 + movs r3, 0 + bl sub_801EE10 + b _08025720 +_080256F2: + movs r0, 0x1 + movs r1, 0 + bl sub_801F1B0 + b _08025720 +_080256FC: + ldr r2, [r5] + ldr r0, [r2, 0x20] + adds r1, r2, 0 + adds r1, 0x28 + adds r2, 0x68 + bl sub_8093560 + ldr r0, [r5] + adds r0, 0x68 + bl sub_801F808 + b _08025720 +_08025714: + ldr r0, [r5] + ldr r1, [r0, 0x1C] + adds r1, 0x4C + movs r0, 0x2 + bl sub_801602C +_08025720: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8025518 + + thumb_func_start sub_8025728 +sub_8025728: + push {r4-r7,lr} + ldr r3, _080257CC + ldr r5, _080257D0 + ldr r0, [r5] + movs r1, 0xE + ldrsh r2, [r0, r1] + movs r1, 0x58 + muls r2, r1 + ldr r1, [r3] + adds r7, r1, r2 + movs r2, 0x84 + lsls r2, 1 + adds r0, r2 + movs r1, 0 + movs r2, 0x10 + bl MemoryFill16 + ldr r4, [r5] + ldr r0, [r4] + cmp r0, 0 + bne _080257E0 + adds r1, r4, 0 + adds r1, 0xC8 + ldr r0, _080257D4 + str r0, [r1] + adds r1, 0x4 + movs r0, 0xA + str r0, [r1] + bl sub_8090A34 + cmp r0, 0 + bne _08025774 + ldr r0, [r5] + movs r4, 0x84 + lsls r4, 1 + adds r0, r4 + movs r1, 0x1 + strh r1, [r0] +_08025774: + movs r6, 0x1 + ldr r1, [r5] + adds r2, r1, 0 + adds r2, 0xD0 + ldr r0, _080257D8 + str r0, [r2] + adds r1, 0xD4 + movs r0, 0xB + str r0, [r1] + bl sub_8090A34 + cmp r0, 0x13 + bgt _08025796 + ldr r0, [r5] + ldrb r0, [r0, 0x18] + cmp r0, 0 + bne _080257A0 +_08025796: + ldr r0, [r5] + movs r1, 0x85 + lsls r1, 1 + adds r0, r1 + strh r6, [r0] +_080257A0: + adds r6, 0x1 + adds r0, r7, 0 + bl sub_8025EC4 + lsls r0, 24 + cmp r0, 0 + beq _08025810 + ldr r0, _080257D0 + ldr r2, [r0] + lsls r3, r6, 3 + adds r0, r2, 0 + adds r0, 0xC8 + adds r0, r3 + ldr r1, _080257DC + str r1, [r0] + adds r2, 0xCC + adds r2, r3 + movs r0, 0x9 + str r0, [r2] + adds r6, 0x1 + b _08025810 + .align 2, 0 +_080257CC: .4byte gUnknown_203B45C +_080257D0: .4byte gUnknown_203B2B4 +_080257D4: .4byte gUnknown_80DD2B0 +_080257D8: .4byte gUnknown_80DD2B8 +_080257DC: .4byte gUnknown_80DD2C0 +_080257E0: + adds r1, r4, 0 + adds r1, 0xC8 + ldr r0, _080258D4 + str r0, [r1] + adds r1, 0x4 + movs r0, 0x7 + str r0, [r1] + ldr r0, [r4, 0x1C] + movs r2, 0x8 + ldrsh r0, [r0, r2] + bl sub_808DBA8 + ldrb r1, [r4, 0xC] + lsls r0, 24 + lsrs r0, 24 + cmp r1, r0 + bne _0802580E + ldr r0, [r5] + movs r4, 0x84 + lsls r4, 1 + adds r0, r4 + movs r1, 0x1 + strh r1, [r0] +_0802580E: + movs r6, 0x1 +_08025810: + movs r0, 0x8 + ldrsh r1, [r7, r0] + ldr r0, _080258D8 + cmp r1, r0 + bne _08025840 + adds r0, r7, 0 + bl sub_808D824 + lsls r0, 24 + cmp r0, 0 + beq _08025840 + ldr r0, _080258DC + ldr r2, [r0] + lsls r3, r6, 3 + adds r0, r2, 0 + adds r0, 0xC8 + adds r0, r3 + ldr r1, _080258E0 + str r1, [r0] + adds r2, 0xCC + adds r2, r3 + movs r0, 0x8 + str r0, [r2] + adds r6, 0x1 +_08025840: + ldr r4, _080258DC + ldr r5, [r4] + lsls r1, r6, 3 + adds r3, r5, 0 + adds r3, 0xC8 + adds r2, r3, r1 + ldr r0, _080258E4 + str r0, [r2] + adds r7, r5, 0 + adds r7, 0xCC + adds r1, r7, r1 + movs r0, 0x4 + str r0, [r1] + adds r6, 0x1 + lsls r1, r6, 3 + adds r2, r3, r1 + ldr r0, _080258E8 + str r0, [r2] + adds r1, r7, r1 + movs r0, 0x6 + str r0, [r1] + adds r6, 0x1 + lsls r1, r6, 3 + adds r2, r3, r1 + ldr r0, _080258EC + str r0, [r2] + adds r1, r7, r1 + movs r0, 0x5 + str r0, [r1] + adds r6, 0x1 + lsls r1, r6, 3 + adds r3, r1 + movs r0, 0 + str r0, [r3] + adds r1, r7, r1 + movs r0, 0x1 + str r0, [r1] + movs r3, 0 + mov r12, r4 + cmp r3, r6 + bge _080258B2 + movs r1, 0x84 + lsls r1, 1 + adds r4, r5, r1 + adds r2, r7, 0 +_0802589A: + ldrh r0, [r4] + cmp r0, 0 + bne _080258A8 + ldr r1, [r2] + ldr r0, [r5, 0x70] + cmp r1, r0 + beq _08025916 +_080258A8: + adds r4, 0x2 + adds r2, 0x8 + adds r3, 0x1 + cmp r3, r6 + blt _0802589A +_080258B2: + movs r3, 0 + cmp r3, r6 + bge _08025916 + mov r2, r12 + ldr r1, [r2] + movs r4, 0x84 + lsls r4, 1 + adds r0, r1, r4 + ldrh r0, [r0] + cmp r0, 0 + bne _080258F0 + adds r0, r1, 0 + adds r0, 0xCC + ldr r0, [r0] + str r0, [r1, 0x70] + b _08025916 + .align 2, 0 +_080258D4: .4byte gUnknown_80DD2CC +_080258D8: .4byte 0x0000013d +_080258DC: .4byte gUnknown_203B2B4 +_080258E0: .4byte gUnknown_80DD2D4 +_080258E4: .4byte gUnknown_80DD2DC +_080258E8: .4byte gUnknown_80DD2E4 +_080258EC: .4byte gUnknown_80DD2EC +_080258F0: + adds r3, 0x1 + cmp r3, r6 + bge _08025916 + mov r0, r12 + ldr r2, [r0] + lsls r0, r3, 1 + movs r4, 0x84 + lsls r4, 1 + adds r1, r2, r4 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _080258F0 + lsls r0, r3, 3 + adds r1, r2, 0 + adds r1, 0xCC + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x70] +_08025916: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8025728 + + thumb_func_start sub_802591C +sub_802591C: + push {r4-r7,lr} + ldr r5, _080259B8 + ldr r0, [r5] + movs r7, 0x84 + lsls r7, 1 + adds r0, r7 + movs r1, 0 + movs r2, 0x10 + bl MemoryFill16 + ldr r1, [r5] + adds r2, r1, 0 + adds r2, 0xC8 + ldr r0, _080259BC + str r0, [r2] + adds r1, 0xCC + movs r0, 0xA + str r0, [r1] + bl sub_8090A34 + cmp r0, 0 + bne _08025952 + ldr r0, [r5] + adds r1, r7, 0 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0] +_08025952: + ldr r4, [r5] + movs r2, 0x1 + adds r1, r4, 0 + adds r1, 0xD0 + ldr r0, _080259C0 + ldr r0, [r0] + str r0, [r1] + adds r1, 0x4 + movs r0, 0x4 + str r0, [r1] + movs r6, 0x2 + adds r1, 0x4 + movs r0, 0 + str r0, [r1] + adds r0, r4, 0 + adds r0, 0xDC + str r2, [r0] + movs r3, 0 + mov r12, r4 + adds r4, r7 + mov r2, r12 + adds r2, 0xCC +_0802597E: + ldrh r0, [r4] + cmp r0, 0 + bne _0802598E + ldr r1, [r2] + mov r7, r12 + ldr r0, [r7, 0x74] + cmp r1, r0 + beq _080259E8 +_0802598E: + adds r4, 0x2 + adds r2, 0x8 + adds r3, 0x1 + cmp r3, r6 + blt _0802597E + movs r3, 0 + cmp r3, r6 + bge _080259E8 + ldr r1, [r5] + movs r2, 0x84 + lsls r2, 1 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r0, 0 + bne _080259C4 + adds r0, r1, 0 + adds r0, 0xCC + ldr r0, [r0] + str r0, [r1, 0x74] + b _080259E8 + .align 2, 0 +_080259B8: .4byte gUnknown_203B2B4 +_080259BC: .4byte gUnknown_80DD2B0 +_080259C0: .4byte gUnknown_80D4970 +_080259C4: + adds r3, 0x1 + cmp r3, r6 + bge _080259E8 + ldr r2, [r5] + lsls r0, r3, 1 + movs r4, 0x84 + lsls r4, 1 + adds r1, r2, r4 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _080259C4 + lsls r0, r3, 3 + adds r1, r2, 0 + adds r1, 0xCC + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x74] +_080259E8: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_802591C + + thumb_func_start sub_80259F0 +sub_80259F0: + push {lr} + movs r0, 0x1 + bl sub_8023A94 + cmp r0, 0x3 + beq _08025A0C + cmp r0, 0x3 + bhi _08025A06 + cmp r0, 0x2 + beq _08025A74 + b _08025A7E +_08025A06: + cmp r0, 0x4 + beq _08025A40 + b _08025A7E +_08025A0C: + bl sub_8023B44 + ldr r1, _08025A38 + ldr r1, [r1] + strh r0, [r1, 0xE] + ldr r3, _08025A3C + movs r0, 0xE + ldrsh r2, [r1, r0] + movs r0, 0x58 + muls r2, r0 + ldr r0, [r3] + adds r0, r2 + str r0, [r1, 0x1C] + movs r2, 0xE + ldrsh r0, [r1, r2] + adds r1, 0x18 + bl sub_808D7DC + movs r0, 0x3 + bl sub_8025434 + b _08025A7E + .align 2, 0 +_08025A38: .4byte gUnknown_203B2B4 +_08025A3C: .4byte gUnknown_203B45C +_08025A40: + bl sub_8023B44 + ldr r1, _08025A6C + ldr r1, [r1] + strh r0, [r1, 0xE] + ldr r3, _08025A70 + movs r0, 0xE + ldrsh r2, [r1, r0] + movs r0, 0x58 + muls r2, r0 + ldr r0, [r3] + adds r0, r2 + str r0, [r1, 0x1C] + movs r2, 0xE + ldrsh r0, [r1, r2] + adds r1, 0x18 + bl sub_808D7DC + movs r0, 0x4 + bl sub_8025434 + b _08025A7E + .align 2, 0 +_08025A6C: .4byte gUnknown_203B2B4 +_08025A70: .4byte gUnknown_203B45C +_08025A74: + bl sub_8023C60 + movs r0, 0x13 + bl sub_8025434 +_08025A7E: + pop {r0} + bx r0 + thumb_func_end sub_80259F0 + + thumb_func_start sub_8025A84 +sub_8025A84: + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + bl sub_8023A94 + ldr r4, _08025AC8 + ldr r0, [r4] + adds r0, 0x78 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _08025AB4 + ldr r0, [r4] + adds r0, 0x78 + mov r1, sp + bl sub_8013114 + ldr r1, [sp] + cmp r1, 0x1 + beq _08025AB4 + ldr r0, [r4] + str r1, [r0, 0x70] +_08025AB4: + ldr r0, [sp] + subs r0, 0x1 + cmp r0, 0xA + bls _08025ABE + b _08025BC2 +_08025ABE: + lsls r0, 2 + ldr r1, _08025ACC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08025AC8: .4byte gUnknown_203B2B4 +_08025ACC: .4byte _08025AD0 + .align 2, 0 +_08025AD0: + .4byte _08025BBC + .4byte _08025BC2 + .4byte _08025BC2 + .4byte _08025BAC + .4byte _08025BB4 + .4byte _08025B9C + .4byte _08025AFC + .4byte _08025BA4 + .4byte _08025B70 + .4byte _08025B20 + .4byte _08025B28 +_08025AFC: + ldr r4, _08025B1C + ldr r0, [r4] + ldr r0, [r0, 0x1C] + movs r1, 0x8 + ldrsh r0, [r0, r1] + bl sub_808DBA8 + ldr r1, [r4] + strb r0, [r1, 0xD] + bl sub_8023C60 + movs r0, 0x13 + bl sub_8025434 + b _08025BC2 + .align 2, 0 +_08025B1C: .4byte gUnknown_203B2B4 +_08025B20: + movs r0, 0xB + bl sub_8025434 + b _08025BC2 +_08025B28: + ldr r0, _08025B68 + bl sub_8011988 + ldr r4, _08025B6C + ldr r1, [r4] + ldrb r0, [r1, 0x18] + cmp r0, 0 + beq _08025B40 + adds r0, r1, 0 + adds r0, 0x18 + bl sub_8091274 +_08025B40: + bl sub_80910B4 + ldr r0, [r4] + movs r1, 0 + strb r1, [r0, 0x18] + ldr r0, [r4] + strb r1, [r0, 0x19] + ldr r1, [r4] + movs r2, 0xE + ldrsh r0, [r1, r2] + adds r1, 0x18 + bl sub_808D800 + bl nullsub_104 + movs r0, 0xA + bl sub_8025434 + b _08025BC2 + .align 2, 0 +_08025B68: .4byte 0x0000014d +_08025B6C: .4byte gUnknown_203B2B4 +_08025B70: + ldr r0, _08025B94 + ldr r0, [r0] + ldr r2, [r0, 0x1C] + ldrh r1, [r2] + ldr r0, _08025B98 + ands r0, r1 + strh r0, [r2] + bl nullsub_104 + bl sub_808ED00 + bl sub_8023C60 + movs r0, 0x7 + bl sub_8025434 + b _08025BC2 + .align 2, 0 +_08025B94: .4byte gUnknown_203B2B4 +_08025B98: .4byte 0x0000fffd +_08025B9C: + movs r0, 0xF + bl sub_8025434 + b _08025BC2 +_08025BA4: + movs r0, 0x12 + bl sub_8025434 + b _08025BC2 +_08025BAC: + movs r0, 0x4 + bl sub_8025434 + b _08025BC2 +_08025BB4: + movs r0, 0x5 + bl sub_8025434 + b _08025BC2 +_08025BBC: + movs r0, 0x2 + bl sub_8025434 +_08025BC2: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8025A84 + + thumb_func_start sub_8025BCC +sub_8025BCC: + push {lr} + bl sub_80244E4 + cmp r0, 0x1 + bls _08025BE4 + cmp r0, 0x3 + bhi _08025BE4 + bl sub_802453C + movs r0, 0x2 + bl sub_8025434 +_08025BE4: + pop {r0} + bx r0 + thumb_func_end sub_8025BCC + + thumb_func_start sub_8025BE8 +sub_8025BE8: + push {lr} + bl sub_801BF48 + cmp r0, 0x1 + bls _08025C00 + cmp r0, 0x3 + bhi _08025C00 + bl sub_801BF98 + movs r0, 0x2 + bl sub_8025434 +_08025C00: + pop {r0} + bx r0 + thumb_func_end sub_8025BE8 + + thumb_func_start sub_8025C04 +sub_8025C04: + push {r4,lr} + movs r0, 0x1 + bl sub_801A6E8 + cmp r0, 0x4 + bhi _08025CAE + lsls r0, 2 + ldr r1, _08025C1C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08025C1C: .4byte _08025C20 + .align 2, 0 +_08025C20: + .4byte _08025CAE + .4byte _08025CAE + .4byte _08025CA4 + .4byte _08025C34 + .4byte _08025C68 +_08025C34: + bl sub_801A8AC + ldr r4, _08025C60 + ldr r2, [r4] + str r0, [r2, 0x10] + ldr r3, _08025C64 + ldr r1, [r3] + lsls r0, 2 + adds r1, r0 + ldrb r0, [r1, 0x2] + strb r0, [r2, 0x14] + ldr r2, [r4] + ldr r1, [r3] + ldr r0, [r2, 0x10] + lsls r0, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + strb r0, [r2, 0x15] + movs r0, 0xD + bl sub_8025434 + b _08025CAE + .align 2, 0 +_08025C60: .4byte gUnknown_203B2B4 +_08025C64: .4byte gUnknown_203B460 +_08025C68: + bl sub_801A8AC + ldr r4, _08025C9C + ldr r2, [r4] + str r0, [r2, 0x10] + ldr r3, _08025CA0 + ldr r1, [r3] + lsls r0, 2 + adds r1, r0 + ldrb r0, [r1, 0x2] + strb r0, [r2, 0x14] + ldr r2, [r4] + ldr r1, [r3] + ldr r0, [r2, 0x10] + lsls r0, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + strb r0, [r2, 0x15] + movs r0, 0 + bl sub_8099690 + movs r0, 0xE + bl sub_8025434 + b _08025CAE + .align 2, 0 +_08025C9C: .4byte gUnknown_203B2B4 +_08025CA0: .4byte gUnknown_203B460 +_08025CA4: + bl sub_801A928 + movs r0, 0x2 + bl sub_8025434 +_08025CAE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8025C04 + + thumb_func_start sub_8025CB4 +sub_8025CB4: + push {r4-r6,lr} + sub sp, 0x14 + movs r0, 0 + str r0, [sp, 0xC] + bl sub_801A6E8 + ldr r4, _08025CF4 + ldr r0, [r4] + adds r0, 0x78 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _08025CE4 + ldr r0, [r4] + adds r0, 0x78 + add r1, sp, 0xC + bl sub_8013114 + ldr r1, [sp, 0xC] + cmp r1, 0x1 + beq _08025CE4 + ldr r0, [r4] + str r1, [r0, 0x74] +_08025CE4: + ldr r0, [sp, 0xC] + cmp r0, 0x4 + beq _08025D74 + cmp r0, 0x4 + bgt _08025CF8 + cmp r0, 0x1 + beq _08025D82 + b _08025D88 + .align 2, 0 +_08025CF4: .4byte gUnknown_203B2B4 +_08025CF8: + cmp r0, 0xA + bne _08025D88 + movs r6, 0x8 + ldr r0, _08025D68 + bl sub_8011988 + ldr r5, _08025D6C + ldr r0, [r5] + ldr r0, [r0, 0x10] + bl sub_80911F8 + bl sub_80910B4 + ldr r1, [r5] + ldrb r0, [r1, 0x18] + cmp r0, 0 + beq _08025D24 + adds r0, r1, 0 + adds r0, 0x18 + bl sub_8091274 + movs r6, 0x9 +_08025D24: + add r4, sp, 0x10 + ldr r1, [r5] + adds r1, 0x14 + adds r0, r4, 0 + bl sub_8090B64 + movs r1, 0 + str r1, [sp] + mov r0, sp + strb r1, [r0, 0x4] + mov r1, sp + movs r0, 0x1 + strb r0, [r1, 0x8] + strb r0, [r4] + ldr r0, _08025D70 + adds r1, r4, 0 + mov r2, sp + bl sub_8090E14 + ldr r1, [r5] + movs r2, 0xE + ldrsh r0, [r1, r2] + adds r1, 0x14 + bl sub_808D800 + bl sub_801A928 + bl nullsub_104 + adds r0, r6, 0 + bl sub_8025434 + b _08025D88 + .align 2, 0 +_08025D68: .4byte 0x0000014d +_08025D6C: .4byte gUnknown_203B2B4 +_08025D70: .4byte gUnknown_202DEA8 +_08025D74: + movs r0, 0 + bl sub_8099690 + movs r0, 0xE + bl sub_8025434 + b _08025D88 +_08025D82: + movs r0, 0xC + bl sub_8025434 +_08025D88: + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8025CB4 + + thumb_func_start sub_8025D90 +sub_8025D90: + push {lr} + bl sub_801B410 + cmp r0, 0x1 + bls _08025DA8 + cmp r0, 0x3 + bhi _08025DA8 + bl sub_801B450 + movs r0, 0xC + bl sub_8025434 +_08025DA8: + pop {r0} + bx r0 + thumb_func_end sub_8025D90 + + thumb_func_start sub_8025DAC +sub_8025DAC: + push {lr} + movs r0, 0x1 + bl sub_801EF38 + cmp r0, 0x3 + beq _08025DC6 + cmp r0, 0x3 + bhi _08025DC2 + cmp r0, 0x2 + beq _08025DE4 + b _08025DFE +_08025DC2: + cmp r0, 0x4 + bne _08025DFE +_08025DC6: + bl sub_801F194 + ldr r1, _08025DE0 + ldr r1, [r1] + str r0, [r1, 0x20] + lsls r0, 3 + adds r0, r1, r0 + ldrh r0, [r0, 0x2A] + strh r0, [r1, 0x24] + movs r0, 0x11 + bl sub_8025434 + b _08025DFE + .align 2, 0 +_08025DE0: .4byte gUnknown_203B2B4 +_08025DE4: + bl sub_801F214 + ldr r0, _08025E04 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x28 + ldr r1, [r1, 0x1C] + adds r1, 0x2C + bl sub_8094060 + movs r0, 0x2 + bl sub_8025434 +_08025DFE: + pop {r0} + bx r0 + .align 2, 0 +_08025E04: .4byte gUnknown_203B2B4 + thumb_func_end sub_8025DAC + + thumb_func_start sub_8025E08 +sub_8025E08: + push {lr} + bl sub_801F890 + cmp r0, 0x1 + bls _08025E20 + cmp r0, 0x3 + bhi _08025E20 + bl sub_801F8D0 + movs r0, 0x10 + bl sub_8025434 +_08025E20: + pop {r0} + bx r0 + thumb_func_end sub_8025E08 + + thumb_func_start sub_8025E24 +sub_8025E24: + push {lr} + bl sub_8016080 + cmp r0, 0x3 + bhi _08025E40 + cmp r0, 0x2 + bcc _08025E40 + bl sub_80160D8 + bl nullsub_104 + movs r0, 0x2 + bl sub_8025434 +_08025E40: + pop {r0} + bx r0 + thumb_func_end sub_8025E24 + + thumb_func_start sub_8025E44 +sub_8025E44: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08025E5C + ldr r0, _08025E64 + ldr r0, [r0] + ldr r0, [r0, 0x8] + bl sub_8025434 +_08025E5C: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08025E64: .4byte gUnknown_203B2B4 + thumb_func_end sub_8025E44 + + thumb_func_start sub_8025E68 +sub_8025E68: + push {r4-r6,lr} + sub sp, 0x14 + adds r6, r0, 0 + adds r5, r1, 0 + bl sub_8008C54 + adds r0, r6, 0 + bl sub_80073B8 + add r4, sp, 0x10 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8090B64 + movs r5, 0 + str r5, [sp, 0x4] + add r0, sp, 0x4 + strb r5, [r0, 0x4] + adds r1, r0, 0 + movs r0, 0x1 + strb r0, [r1, 0x8] + strb r0, [r4] + ldr r0, _08025EBC + adds r1, r4, 0 + add r2, sp, 0x4 + bl sub_8090E14 + ldr r2, _08025EC0 + str r5, [sp] + movs r0, 0x4 + movs r1, 0x3 + adds r3, r6, 0 + bl sub_8014FF0 + adds r0, r6, 0 + bl sub_80073E0 + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08025EBC: .4byte gUnknown_202DE58 +_08025EC0: .4byte gUnknown_80DD2F8 + thumb_func_end sub_8025E68 + + thumb_func_start sub_8025EC4 +sub_8025EC4: + push {lr} + adds r1, r0, 0 + ldrb r0, [r1, 0x2] + cmp r0, 0 + bne _08025EE8 + movs r2, 0 + ldrb r0, [r1, 0x4] + cmp r0, 0x41 + bne _08025ED8 + movs r2, 0x1 +_08025ED8: + cmp r2, 0 + beq _08025EEC + movs r0, 0x8 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + bne _08025EEC +_08025EE8: + movs r0, 0 + b _08025EEE +_08025EEC: + movs r0, 0x1 +_08025EEE: + pop {r1} + bx r1 + thumb_func_end sub_8025EC4 + + thumb_func_start sub_8025EF4 +sub_8025EF4: + push {r4-r6,lr} + adds r4, r0, 0 + ldr r6, _08025F1C + movs r0, 0xA0 + lsls r0, 2 + movs r1, 0x8 + bl MemoryAlloc + adds r1, r0, 0 + str r1, [r6] + str r4, [r1, 0x18] + movs r5, 0 + ldr r0, _08025F20 + ldr r0, [r0] + cmp r4, r0 + bne _08025F24 + strh r5, [r1, 0xA] + adds r4, r6, 0 + b _08025F48 + .align 2, 0 +_08025F1C: .4byte gUnknown_203B2B8 +_08025F20: .4byte gUnknown_203B45C +_08025F24: + adds r5, 0x1 + movs r0, 0xCE + lsls r0, 1 + ldr r4, _08025F60 + cmp r5, r0 + bgt _08025F48 + ldr r3, [r4] + ldr r2, _08025F64 + lsls r0, r5, 16 + asrs r0, 16 + movs r1, 0x58 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + ldr r1, [r3, 0x18] + cmp r1, r0 + bne _08025F24 + strh r5, [r3, 0xA] +_08025F48: + ldr r1, [r4] + movs r0, 0 + str r0, [r1, 0x70] + str r0, [r1, 0x74] + str r0, [r1, 0x78] + strb r0, [r1, 0x8] + bl sub_8026074 + movs r0, 0x1 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08025F60: .4byte gUnknown_203B2B8 +_08025F64: .4byte gUnknown_203B45C + thumb_func_end sub_8025EF4 + + thumb_func_start sub_8025F68 +sub_8025F68: + push {lr} + ldr r0, _08025F80 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0x19 + bhi _0802603A + lsls r0, 2 + ldr r1, _08025F84 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08025F80: .4byte gUnknown_203B2B8 +_08025F84: .4byte _08025F88 + .align 2, 0 +_08025F88: + .4byte _08025FF0 + .4byte _08025FF8 + .4byte _08025FF8 + .4byte _08025FFE + .4byte _08026004 + .4byte _0802603A + .4byte _0802603A + .4byte _0802603A + .4byte _0802603A + .4byte _0802603A + .4byte _0802603A + .4byte _0802603A + .4byte _0802600A + .4byte _08026010 + .4byte _08026016 + .4byte _0802603A + .4byte _0802603A + .4byte _0802603A + .4byte _0802601C + .4byte _0802601C + .4byte _08026022 + .4byte _08026028 + .4byte _0802602E + .4byte _0802602E + .4byte _08026034 + .4byte _08026040 +_08025FF0: + movs r0, 0x1 + bl sub_8026074 + b _08026044 +_08025FF8: + bl sub_80268CC + b _08026044 +_08025FFE: + bl sub_8026A78 + b _08026044 +_08026004: + bl sub_8026A94 + b _08026044 +_0802600A: + bl sub_8026AB0 + b _08026044 +_08026010: + bl sub_8026B10 + b _08026044 +_08026016: + bl sub_8026B48 + b _08026044 +_0802601C: + bl sub_8026B64 + b _08026044 +_08026022: + bl sub_8026C14 + b _08026044 +_08026028: + bl sub_8026CF0 + b _08026044 +_0802602E: + bl sub_8026D0C + b _08026044 +_08026034: + bl sub_8026D6C + b _08026044 +_0802603A: + bl sub_8026D88 + b _08026044 +_08026040: + movs r0, 0x3 + b _08026046 +_08026044: + movs r0, 0 +_08026046: + pop {r1} + bx r1 + thumb_func_end sub_8025F68 + + thumb_func_start sub_802604C +sub_802604C: + ldr r0, _08026054 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + bx lr + .align 2, 0 +_08026054: .4byte gUnknown_203B2B8 + thumb_func_end sub_802604C + + thumb_func_start sub_8026058 +sub_8026058: + push {r4,lr} + ldr r4, _08026070 + ldr r0, [r4] + cmp r0, 0 + beq _0802606A + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0802606A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08026070: .4byte gUnknown_203B2B8 + thumb_func_end sub_8026058 + + thumb_func_start sub_8026074 +sub_8026074: + push {lr} + ldr r1, _08026088 + ldr r1, [r1] + str r0, [r1] + bl sub_802608C + bl sub_80261D0 + pop {r0} + bx r0 + .align 2, 0 +_08026088: .4byte gUnknown_203B2B8 + thumb_func_end sub_8026074 + + thumb_func_start sub_802608C +sub_802608C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, _080260B8 + ldr r0, [r4] + movs r5, 0x88 + lsls r5, 2 + adds r0, r5 + bl sub_8006518 + ldr r0, [r4] + ldr r0, [r0] + cmp r0, 0x1 + blt _08026178 + cmp r0, 0x2 + ble _080260BC + cmp r0, 0x14 + beq _0802614C + b _08026178 + .align 2, 0 +_080260B8: .4byte gUnknown_203B2B8 +_080260BC: + ldr r0, _0802613C + mov r12, r0 + ldr r1, _08026140 + mov r8, r1 + mov r9, r4 + mov r10, r5 + movs r3, 0 + movs r2, 0x3 +_080260CC: + mov r5, r9 + ldr r1, [r5] + adds r1, r3 + add r1, r10 + ldr r0, _08026144 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r3, 0x18 + subs r2, 0x1 + cmp r2, 0 + bge _080260CC + ldr r1, [r4] + movs r6, 0x88 + lsls r6, 2 + adds r1, r6 + mov r0, r12 + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldr r1, [r4] + movs r0, 0x9A + lsls r0, 2 + adds r1, r0 + mov r0, r8 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r6,r7} + stm r1!, {r2,r6,r7} + bl sub_80264CC + ldr r2, [r4] + movs r0, 0x94 + lsls r0, 2 + adds r2, r0 + ldr r1, _08026148 + ldm r1!, {r3,r5,r6} + stm r2!, {r3,r5,r6} + ldm r1!, {r3,r5,r7} + stm r2!, {r3,r5,r7} + ldr r1, [r4] + adds r0, r1, r0 + movs r6, 0xB6 + lsls r6, 1 + adds r1, r6 + bl sub_8012CAC + ldr r0, [r4] + movs r7, 0x97 + lsls r7, 2 + adds r0, r7 + movs r1, 0x9 + strh r1, [r0] + b _080261A2 + .align 2, 0 +_0802613C: .4byte gUnknown_80DD358 +_08026140: .4byte gUnknown_80DD370 +_08026144: .4byte gUnknown_80DD310 +_08026148: .4byte gUnknown_80DD328 +_0802614C: + bl sub_802678C + ldr r2, [r4] + movs r0, 0x94 + lsls r0, 2 + adds r2, r0 + ldr r1, _08026174 + ldm r1!, {r3,r5,r6} + stm r2!, {r3,r5,r6} + ldm r1!, {r3,r5,r7} + stm r2!, {r3,r5,r7} + ldr r1, [r4] + adds r0, r1, r0 + movs r6, 0xB6 + lsls r6, 1 + adds r1, r6 + bl sub_8012CAC + b _080261A2 + .align 2, 0 +_08026174: .4byte gUnknown_80DD340 +_08026178: + ldr r7, _080261C8 + mov r8, r7 + movs r0, 0x88 + lsls r0, 2 + mov r9, r0 + ldr r4, _080261CC + movs r3, 0 + movs r2, 0x3 +_08026188: + mov r5, r8 + ldr r1, [r5] + adds r1, r3 + add r1, r9 + adds r0, r4, 0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r3, 0x18 + subs r2, 0x1 + cmp r2, 0 + bge _08026188 +_080261A2: + bl sub_8004914 + ldr r0, _080261C8 + ldr r0, [r0] + movs r6, 0x88 + lsls r6, 2 + adds r0, r6 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080261C8: .4byte gUnknown_203B2B8 +_080261CC: .4byte gUnknown_80DD310 + thumb_func_end sub_802608C + + thumb_func_start sub_80261D0 +sub_80261D0: + push {r4,r5,lr} + sub sp, 0x18 + ldr r1, _080261EC + ldr r0, [r1] + ldr r0, [r0] + adds r4, r1, 0 + cmp r0, 0x19 + bls _080261E2 + b _080264BA +_080261E2: + lsls r0, 2 + ldr r1, _080261F0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080261EC: .4byte gUnknown_203B2B8 +_080261F0: .4byte _080261F4 + .align 2, 0 +_080261F4: + .4byte _080264BA + .4byte _0802625C + .4byte _080262A8 + .4byte _080262EC + .4byte _080262FA + .4byte _080263F8 + .4byte _0802640C + .4byte _08026420 + .4byte _08026434 + .4byte _08026448 + .4byte _0802648A + .4byte _080264A8 + .4byte _08026392 + .4byte _080263AC + .4byte _08026306 + .4byte _08026464 + .4byte _08026474 + .4byte _08026484 + .4byte _08026310 + .4byte _0802631E + .4byte _08026326 + .4byte _08026350 + .4byte _08026362 + .4byte _08026388 + .4byte _080263E0 + .4byte _080264BA +_0802625C: + movs r0, 0x3 + bl sub_8026E08 + ldr r5, _080262A0 + ldr r1, [r5] + adds r1, 0x14 + movs r0, 0 + bl sub_8026DAC + ldr r4, _080262A4 + ldr r0, [r5] + ldr r1, [r0, 0x18] + adds r0, r4, 0 + movs r2, 0x7 + bl sub_808D9AC + adds r4, 0x50 + ldr r0, [r5] + ldr r1, [r0, 0x18] + adds r0, r4, 0 + movs r2, 0x6 + bl sub_808D9AC + ldr r2, [r5] + adds r0, r2, 0 + adds r0, 0x7C + movs r3, 0xB6 + lsls r3, 1 + adds r1, r2, r3 + movs r4, 0x83 + lsls r4, 2 + adds r3, r2, r4 + ldr r2, [r2, 0x70] + b _0802633E + .align 2, 0 +_080262A0: .4byte gUnknown_203B2B8 +_080262A4: .4byte gUnknown_202DF98 +_080262A8: + movs r0, 0x3 + bl sub_8026E08 + ldr r5, _080262E4 + ldr r1, [r5] + adds r1, 0x14 + movs r0, 0 + bl sub_8026DAC + ldr r4, _080262E8 + ldr r0, [r5] + ldr r1, [r0, 0x18] + adds r0, r4, 0 + movs r2, 0x7 + bl sub_808D9AC + adds r4, 0x50 + ldr r0, [r5] + ldr r1, [r0, 0x18] + adds r0, r4, 0 + movs r2, 0x6 + bl sub_808D9AC + ldr r0, [r5] + adds r0, 0x7C + movs r1, 0x1 + bl sub_8012EA4 + b _080264BA + .align 2, 0 +_080262E4: .4byte gUnknown_203B2B8 +_080262E8: .4byte gUnknown_202DF98 +_080262EC: + ldr r0, [r4] + movs r1, 0xA + ldrsh r0, [r0, r1] + movs r1, 0x2 + bl sub_8024458 + b _080264BA +_080262FA: + ldr r0, [r4] + movs r3, 0xA + ldrsh r0, [r0, r3] + bl sub_801BEEC + b _080264BA +_08026306: + ldr r0, [r4] + ldr r0, [r0, 0x18] + bl sub_80227B8 + b _080264BA +_08026310: + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0xA + bl sub_801A5D8 + b _080264BA +_0802631E: + movs r0, 0x1 + bl sub_801A8D0 + b _080264BA +_08026326: + bl sub_801A9E0 + ldr r0, _0802634C + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0xCC + movs r4, 0xB6 + lsls r4, 1 + adds r1, r2, r4 + adds r4, 0xA0 + adds r3, r2, r4 + ldr r2, [r2, 0x74] +_0802633E: + str r2, [sp] + movs r2, 0x2 + str r2, [sp, 0x4] + movs r2, 0 + bl sub_8012D60 + b _080264BA + .align 2, 0 +_0802634C: .4byte gUnknown_203B2B8 +_08026350: + ldr r1, [r4] + adds r1, 0x10 + add r0, sp, 0x14 + bl sub_8090B64 + add r0, sp, 0x14 + bl sub_801B3C0 + b _080264BA +_08026362: + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x28 + ldr r1, [r1, 0x18] + adds r1, 0x2C + bl sub_809401C + ldr r2, [r4] + movs r0, 0xA + ldrsh r1, [r2, r0] + adds r2, 0x28 + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x3 + movs r3, 0 + bl sub_801EE10 + b _080264BA +_08026388: + movs r0, 0x1 + movs r1, 0 + bl sub_801F1B0 + b _080264BA +_08026392: + bl sub_8026878 + ldr r0, _080263A4 + ldr r1, _080263A8 + ldr r3, [r1] + movs r1, 0xDE + lsls r1, 1 + adds r3, r1 + b _080263BC + .align 2, 0 +_080263A4: .4byte gUnknown_80DD388 +_080263A8: .4byte gUnknown_203B2B8 +_080263AC: + bl sub_8026878 + ldr r0, _080263D8 + ldr r1, _080263DC + ldr r3, [r1] + movs r4, 0xDE + lsls r4, 1 + adds r3, r4 +_080263BC: + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + str r2, [sp, 0xC] + adds r1, 0xFD + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0x3 + bl sub_8014248 + b _080264BA + .align 2, 0 +_080263D8: .4byte gUnknown_80DD420 +_080263DC: .4byte gUnknown_203B2B8 +_080263E0: + ldr r2, [r4] + ldr r0, [r2, 0x20] + adds r1, r2, 0 + adds r1, 0x28 + adds r2, 0x68 + bl sub_8093560 + ldr r0, [r4] + adds r0, 0x68 + bl sub_801F808 + b _080264BA +_080263F8: + ldr r1, [r4] + movs r0, 0x19 + str r0, [r1, 0x4] + movs r0, 0xCF + bl sub_8011988 + ldr r0, _08026408 + b _08026492 + .align 2, 0 +_08026408: .4byte gUnknown_80DD4C4 +_0802640C: + ldr r1, [r4] + movs r0, 0x19 + str r0, [r1, 0x4] + movs r0, 0xCF + bl sub_8011988 + ldr r0, _0802641C + b _08026492 + .align 2, 0 +_0802641C: .4byte gUnknown_80DD4F4 +_08026420: + ldr r1, [r4] + movs r0, 0x19 + str r0, [r1, 0x4] + movs r0, 0xCC + bl sub_8011988 + ldr r0, _08026430 + b _08026492 + .align 2, 0 +_08026430: .4byte gUnknown_80DD534 +_08026434: + ldr r1, [r4] + movs r0, 0x9 + str r0, [r1, 0x4] + movs r0, 0xCA + bl sub_8011988 + ldr r0, _08026444 + b _08026492 + .align 2, 0 +_08026444: .4byte gUnknown_80DD564 +_08026448: + bl sub_8026FA4 + ldr r4, _08026460 + ldr r0, [r4] + ldr r0, [r0, 0x18] + bl sub_808D31C + ldr r1, [r4] + movs r0, 0x1 + strb r0, [r1, 0x8] + b _080264BA + .align 2, 0 +_08026460: .4byte gUnknown_203B2B8 +_08026464: + ldr r1, [r4] + movs r0, 0x2 + str r0, [r1, 0x4] + ldr r0, _08026470 + b _08026492 + .align 2, 0 +_08026470: .4byte gUnknown_80DD594 +_08026474: + ldr r1, [r4] + movs r0, 0x2 + str r0, [r1, 0x4] + ldr r0, _08026480 + b _08026492 + .align 2, 0 +_08026480: .4byte gUnknown_80DD5B8 +_08026484: + ldr r1, [r4] + movs r0, 0x2 + b _0802648E +_0802648A: + ldr r1, [r4] + movs r0, 0x19 +_0802648E: + str r0, [r1, 0x4] + ldr r0, _080264A0 +_08026492: + ldr r3, _080264A4 + movs r1, 0 + movs r2, 0 + bl sub_80141B4 + b _080264BA + .align 2, 0 +_080264A0: .4byte gUnknown_80DD60C +_080264A4: .4byte 0x00000101 +_080264A8: + ldr r1, [r4] + movs r0, 0x19 + str r0, [r1, 0x4] + ldr r0, _080264C4 + ldr r3, _080264C8 + movs r1, 0 + movs r2, 0 + bl sub_80141B4 +_080264BA: + add sp, 0x18 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080264C4: .4byte gUnknown_80DD63C +_080264C8: .4byte 0x00000101 + thumb_func_end sub_80261D0 + + thumb_func_start sub_80264CC +sub_80264CC: + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r3, _08026574 + ldr r4, _08026578 + ldr r0, [r4] + movs r1, 0xA + ldrsh r2, [r0, r1] + movs r1, 0x58 + muls r2, r1 + ldr r1, [r3] + adds r1, r2 + mov r8, r1 + movs r2, 0x83 + lsls r2, 2 + adds r0, r2 + movs r1, 0 + movs r2, 0x14 + bl MemoryFill16 + ldr r1, [r4] + ldr r0, [r1, 0x18] + ldrb r0, [r0, 0x2] + strb r0, [r1, 0x1C] + ldr r1, [r4] + movs r3, 0xA + ldrsh r0, [r1, r3] + adds r1, 0x14 + bl sub_808D7DC + mov r1, r8 + ldrh r0, [r1] + lsrs r0, 1 + movs r5, 0x1 + ands r0, r5 + cmp r0, 0 + beq _08026584 + ldr r2, [r4] + movs r3, 0xB6 + lsls r3, 1 + adds r1, r2, r3 + ldr r0, _0802657C + str r0, [r1] + movs r0, 0xB8 + lsls r0, 1 + adds r1, r2, r0 + movs r0, 0x7 + str r0, [r1] + mov r0, r8 + bl sub_8026E88 + lsls r0, 24 + cmp r0, 0 + bne _08026542 + ldr r0, [r4] + movs r1, 0x83 + lsls r1, 2 + adds r0, r1 + strh r5, [r0] +_08026542: + movs r6, 0x1 + movs r0, 0x8 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _080265B4 + mov r2, r8 + ldrb r0, [r2, 0x2] + cmp r0, 0 + bne _080265B4 + ldr r3, [r4] + movs r2, 0x8 + movs r4, 0xBA + lsls r4, 1 + adds r1, r3, r4 + ldr r0, _08026580 + str r0, [r1] + movs r1, 0xBC + lsls r1, 1 + adds r0, r3, r1 + str r2, [r0] + movs r6, 0x2 + b _080265B4 + .align 2, 0 +_08026574: .4byte gUnknown_203B45C +_08026578: .4byte gUnknown_203B2B8 +_0802657C: .4byte gUnknown_80DD664 +_08026580: .4byte gUnknown_80DD670 +_08026584: + ldr r2, [r4] + movs r3, 0xB6 + lsls r3, 1 + adds r1, r2, r3 + ldr r0, _08026734 + str r0, [r1] + movs r0, 0xB8 + lsls r0, 1 + adds r1, r2, r0 + movs r0, 0x6 + str r0, [r1] + movs r1, 0xA + ldrsh r0, [r2, r1] + bl sub_808D750 + lsls r0, 24 + cmp r0, 0 + bne _080265B2 + ldr r0, [r4] + movs r2, 0x83 + lsls r2, 2 + adds r0, r2 + strh r5, [r0] +_080265B2: + movs r6, 0x1 +_080265B4: + ldr r4, _08026738 + ldr r2, [r4] + lsls r3, r6, 3 + movs r7, 0xB6 + lsls r7, 1 + adds r0, r2, r7 + adds r0, r3 + ldr r1, _0802673C + str r1, [r0] + movs r5, 0xB8 + lsls r5, 1 + adds r2, r5 + adds r2, r3 + movs r0, 0xA + str r0, [r2] + bl sub_809177C + lsls r0, 24 + cmp r0, 0 + bne _080265EC + ldr r0, [r4] + lsls r1, r6, 1 + movs r3, 0x83 + lsls r3, 2 + adds r0, r3 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0] +_080265EC: + adds r6, 0x1 + ldr r2, [r4] + lsls r3, r6, 3 + adds r0, r2, r7 + adds r0, r3 + ldr r1, _08026740 + str r1, [r0] + adds r2, r5 + adds r2, r3 + movs r0, 0xB + str r0, [r2] + bl sub_8090A34 + cmp r0, 0 + bne _0802661A + ldr r0, [r4] + lsls r1, r6, 1 + movs r2, 0x83 + lsls r2, 2 + adds r0, r2 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0] +_0802661A: + adds r6, 0x1 + ldr r2, [r4] + lsls r3, r6, 3 + adds r0, r2, r7 + adds r0, r3 + ldr r1, _08026744 + str r1, [r0] + adds r2, r5 + adds r2, r3 + movs r0, 0xC + str r0, [r2] + bl sub_8090A34 + cmp r0, 0x13 + bgt _08026640 + ldr r0, [r4] + ldrb r0, [r0, 0x14] + cmp r0, 0 + bne _08026650 +_08026640: + ldr r0, [r4] + lsls r1, r6, 1 + movs r3, 0x83 + lsls r3, 2 + adds r0, r3 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0] +_08026650: + adds r6, 0x1 + mov r4, r8 + ldrh r0, [r4] + lsrs r0, 1 + movs r5, 0x1 + ands r0, r5 + cmp r0, 0 + bne _0802669A + ldr r4, _08026738 + ldr r3, [r4] + lsls r2, r6, 3 + movs r1, 0xB6 + lsls r1, 1 + adds r0, r3, r1 + adds r0, r2 + ldr r1, _08026748 + str r1, [r0] + movs r1, 0xB8 + lsls r1, 1 + adds r0, r3, r1 + adds r0, r2 + movs r1, 0x9 + str r1, [r0] + mov r0, r8 + bl sub_8026EB8 + lsls r0, 24 + cmp r0, 0 + bne _08026698 + ldr r0, [r4] + lsls r1, r6, 1 + movs r2, 0x83 + lsls r2, 2 + adds r0, r2 + adds r0, r1 + strh r5, [r0] +_08026698: + adds r6, 0x1 +_0802669A: + ldr r4, _08026738 + ldr r5, [r4] + lsls r1, r6, 3 + movs r0, 0xB6 + lsls r0, 1 + adds r3, r5, r0 + adds r2, r3, r1 + ldr r0, _0802674C + str r0, [r2] + movs r2, 0xB8 + lsls r2, 1 + adds r7, r5, r2 + adds r1, r7, r1 + movs r0, 0x4 + str r0, [r1] + adds r6, 0x1 + lsls r1, r6, 3 + adds r2, r3, r1 + ldr r0, _08026750 + str r0, [r2] + adds r1, r7, r1 + movs r0, 0xD + str r0, [r1] + adds r6, 0x1 + lsls r1, r6, 3 + adds r2, r3, r1 + ldr r0, _08026754 + str r0, [r2] + adds r1, r7, r1 + movs r0, 0x5 + str r0, [r1] + adds r6, 0x1 + lsls r1, r6, 3 + adds r3, r1 + movs r0, 0 + str r0, [r3] + adds r1, r7, r1 + movs r0, 0x1 + str r0, [r1] + movs r3, 0 + mov r12, r4 + cmp r3, r6 + bge _08026710 + adds r4, r7, 0 + movs r0, 0x83 + lsls r0, 2 + adds r2, r5, r0 +_080266F8: + ldrh r0, [r2] + cmp r0, 0 + bne _08026706 + ldr r1, [r4] + ldr r0, [r5, 0x70] + cmp r1, r0 + beq _08026780 +_08026706: + adds r4, 0x8 + adds r2, 0x2 + adds r3, 0x1 + cmp r3, r6 + blt _080266F8 +_08026710: + movs r3, 0 + cmp r3, r6 + bge _08026780 + mov r2, r12 + ldr r1, [r2] + movs r4, 0x83 + lsls r4, 2 + adds r0, r1, r4 + ldrh r0, [r0] + cmp r0, 0 + bne _08026758 + movs r2, 0xB8 + lsls r2, 1 + adds r0, r1, r2 + ldr r0, [r0] + str r0, [r1, 0x70] + b _08026780 + .align 2, 0 +_08026734: .4byte gUnknown_80DD67C +_08026738: .4byte gUnknown_203B2B8 +_0802673C: .4byte gUnknown_80DD688 +_08026740: .4byte gUnknown_80DD694 +_08026744: .4byte gUnknown_80DD69C +_08026748: .4byte gUnknown_80DD6A4 +_0802674C: .4byte gUnknown_80DD6B4 +_08026750: .4byte gUnknown_80DD6BC +_08026754: .4byte gUnknown_80DD6C4 +_08026758: + adds r3, 0x1 + cmp r3, r6 + bge _08026780 + mov r4, r12 + ldr r2, [r4] + lsls r0, r3, 1 + movs r4, 0x83 + lsls r4, 2 + adds r1, r2, r4 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _08026758 + lsls r0, r3, 3 + movs r3, 0xB8 + lsls r3, 1 + adds r1, r2, r3 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x70] +_08026780: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80264CC + + thumb_func_start sub_802678C +sub_802678C: + push {r4-r7,lr} + ldr r5, _08026840 + ldr r0, [r5] + movs r7, 0x83 + lsls r7, 2 + adds r0, r7 + movs r1, 0 + movs r2, 0x14 + bl MemoryFill16 + ldr r2, [r5] + movs r0, 0xB6 + lsls r0, 1 + adds r1, r2, r0 + ldr r0, _08026844 + str r0, [r1] + movs r3, 0xB8 + lsls r3, 1 + adds r1, r2, r3 + movs r0, 0xB + str r0, [r1] + bl sub_8090A34 + cmp r0, 0 + bne _080267C8 + ldr r0, [r5] + adds r4, r7, 0 + adds r0, r4 + movs r1, 0x1 + strh r1, [r0] +_080267C8: + ldr r4, [r5] + movs r2, 0x1 + movs r0, 0xBA + lsls r0, 1 + adds r1, r4, r0 + ldr r0, _08026848 + ldr r0, [r0] + str r0, [r1] + movs r3, 0xBC + lsls r3, 1 + adds r1, r4, r3 + movs r0, 0x4 + str r0, [r1] + movs r6, 0x2 + movs r0, 0xBE + lsls r0, 1 + adds r1, r4, r0 + movs r0, 0 + str r0, [r1] + movs r1, 0xC0 + lsls r1, 1 + adds r0, r4, r1 + str r2, [r0] + movs r3, 0 + mov r12, r4 + movs r4, 0xB8 + lsls r4, 1 + add r4, r12 + mov r0, r12 + adds r2, r0, r7 +_08026804: + ldrh r0, [r2] + cmp r0, 0 + bne _08026814 + ldr r1, [r4] + mov r7, r12 + ldr r0, [r7, 0x74] + cmp r1, r0 + beq _08026872 +_08026814: + adds r4, 0x8 + adds r2, 0x2 + adds r3, 0x1 + cmp r3, r6 + blt _08026804 + movs r3, 0 + cmp r3, r6 + bge _08026872 + ldr r1, [r5] + movs r2, 0x83 + lsls r2, 2 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r0, 0 + bne _0802684C + movs r3, 0xB8 + lsls r3, 1 + adds r0, r1, r3 + ldr r0, [r0] + str r0, [r1, 0x74] + b _08026872 + .align 2, 0 +_08026840: .4byte gUnknown_203B2B8 +_08026844: .4byte gUnknown_80DD694 +_08026848: .4byte gUnknown_80D4970 +_0802684C: + adds r3, 0x1 + cmp r3, r6 + bge _08026872 + ldr r2, [r5] + lsls r0, r3, 1 + movs r4, 0x83 + lsls r4, 2 + adds r1, r2, r4 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _0802684C + lsls r0, r3, 3 + movs r7, 0xB8 + lsls r7, 1 + adds r1, r2, r7 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x74] +_08026872: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_802678C + + thumb_func_start sub_8026878 +sub_8026878: + ldr r0, _080268C0 + ldr r0, [r0] + mov r12, r0 + movs r3, 0 + movs r1, 0xDE + lsls r1, 1 + add r1, r12 + ldr r0, _080268C4 + ldr r0, [r0] + str r0, [r1] + movs r1, 0xE0 + lsls r1, 1 + add r1, r12 + movs r0, 0x2 + str r0, [r1] + movs r2, 0x1 + movs r1, 0xE2 + lsls r1, 1 + add r1, r12 + ldr r0, _080268C8 + ldr r0, [r0] + str r0, [r1] + movs r1, 0xE4 + lsls r1, 1 + add r1, r12 + movs r0, 0x3 + str r0, [r1] + movs r0, 0xE6 + lsls r0, 1 + add r0, r12 + str r3, [r0] + movs r0, 0xE8 + lsls r0, 1 + add r0, r12 + str r2, [r0] + bx lr + .align 2, 0 +_080268C0: .4byte gUnknown_203B2B8 +_080268C4: .4byte gUnknown_80D4920 +_080268C8: .4byte gUnknown_80D4928 + thumb_func_end sub_8026878 + + thumb_func_start sub_80268CC +sub_80268CC: + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + ldr r4, _0802690C + ldr r0, [r4] + adds r0, 0x7C + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _080268F8 + ldr r0, [r4] + adds r0, 0x7C + mov r1, sp + bl sub_8013114 + ldr r1, [sp] + cmp r1, 0x1 + beq _080268F8 + ldr r0, [r4] + str r1, [r0, 0x70] +_080268F8: + ldr r0, [sp] + subs r0, 0x1 + cmp r0, 0xC + bls _08026902 + b _08026A6E +_08026902: + lsls r0, 2 + ldr r1, _08026910 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802690C: .4byte gUnknown_203B2B8 +_08026910: .4byte _08026914 + .align 2, 0 +_08026914: + .4byte _08026A68 + .4byte _08026A6E + .4byte _08026A6E + .4byte _08026A58 + .4byte _08026A60 + .4byte _08026948 + .4byte _0802698C + .4byte _080269B4 + .4byte _080269F0 + .4byte _08026A00 + .4byte _08026A08 + .4byte _08026A10 + .4byte _080269F8 +_08026948: + ldr r4, _08026984 + ldr r0, [r4] + movs r1, 0xA + ldrsh r0, [r0, r1] + bl sub_808D750 + lsls r0, 24 + cmp r0, 0 + beq _08026976 + ldr r0, [r4] + movs r2, 0xA + ldrsh r1, [r0, r2] + movs r0, 0x58 + muls r1, r0 + ldr r0, _08026988 + ldr r0, [r0] + adds r1, r0 + ldrh r2, [r1] + movs r0, 0x2 + orrs r0, r2 + strh r0, [r1] + bl nullsub_104 +_08026976: + bl sub_808ED00 + movs r0, 0x5 + bl sub_8026074 + b _08026A6E + .align 2, 0 +_08026984: .4byte gUnknown_203B2B8 +_08026988: .4byte gUnknown_203B45C +_0802698C: + ldr r0, _080269AC + ldr r0, [r0] + ldr r2, [r0, 0x18] + ldrh r1, [r2] + ldr r0, _080269B0 + ands r0, r1 + strh r0, [r2] + bl nullsub_104 + bl sub_808ED00 + movs r0, 0x6 + bl sub_8026074 + b _08026A6E + .align 2, 0 +_080269AC: .4byte gUnknown_203B2B8 +_080269B0: .4byte 0x0000fffd +_080269B4: + ldr r2, _080269E8 + ldr r0, _080269EC + ldr r0, [r0] + movs r3, 0xA + ldrsh r1, [r0, r3] + movs r0, 0x58 + muls r1, r0 + ldr r0, [r2] + adds r4, r0, r1 + bl sub_808D33C + ldrb r1, [r4, 0x2] + cmp r1, 0 + bne _080269DA + strb r1, [r0, 0x2] + movs r0, 0x1 + strb r0, [r4, 0x2] + bl nullsub_104 +_080269DA: + bl sub_808ED00 + movs r0, 0x7 + bl sub_8026074 + b _08026A6E + .align 2, 0 +_080269E8: .4byte gUnknown_203B45C +_080269EC: .4byte gUnknown_203B2B8 +_080269F0: + movs r0, 0xC + bl sub_8026074 + b _08026A6E +_080269F8: + movs r0, 0x16 + bl sub_8026074 + b _08026A6E +_08026A00: + movs r0, 0xE + bl sub_8026074 + b _08026A6E +_08026A08: + movs r0, 0x12 + bl sub_8026074 + b _08026A6E +_08026A10: + ldr r0, _08026A50 + bl sub_8011988 + ldr r4, _08026A54 + ldr r1, [r4] + ldrb r0, [r1, 0x14] + cmp r0, 0 + beq _08026A28 + adds r0, r1, 0 + adds r0, 0x14 + bl sub_8091274 +_08026A28: + bl sub_80910B4 + ldr r0, [r4] + movs r1, 0 + strb r1, [r0, 0x14] + ldr r0, [r4] + strb r1, [r0, 0x15] + ldr r1, [r4] + movs r2, 0xA + ldrsh r0, [r1, r2] + adds r1, 0x14 + bl sub_808D800 + bl nullsub_104 + movs r0, 0x11 + bl sub_8026074 + b _08026A6E + .align 2, 0 +_08026A50: .4byte 0x0000014d +_08026A54: .4byte gUnknown_203B2B8 +_08026A58: + movs r0, 0x3 + bl sub_8026074 + b _08026A6E +_08026A60: + movs r0, 0x4 + bl sub_8026074 + b _08026A6E +_08026A68: + movs r0, 0x19 + bl sub_8026074 +_08026A6E: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80268CC + + thumb_func_start sub_8026A78 +sub_8026A78: + push {lr} + bl sub_80244E4 + cmp r0, 0x1 + bls _08026A90 + cmp r0, 0x3 + bhi _08026A90 + bl sub_802453C + movs r0, 0x2 + bl sub_8026074 +_08026A90: + pop {r0} + bx r0 + thumb_func_end sub_8026A78 + + thumb_func_start sub_8026A94 +sub_8026A94: + push {lr} + bl sub_801BF48 + cmp r0, 0x1 + bls _08026AAC + cmp r0, 0x3 + bhi _08026AAC + bl sub_801BF98 + movs r0, 0x2 + bl sub_8026074 +_08026AAC: + pop {r0} + bx r0 + thumb_func_end sub_8026A94 + + thumb_func_start sub_8026AB0 +sub_8026AB0: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08026B08 + ldr r0, [sp] + cmp r0, 0x2 + beq _08026ADA + cmp r0, 0x2 + bgt _08026ACE + cmp r0, 0x1 + beq _08026AD2 + b _08026B08 +_08026ACE: + cmp r0, 0x3 + bne _08026B08 +_08026AD2: + movs r0, 0x2 + bl sub_8026074 + b _08026B08 +_08026ADA: + ldr r0, _08026AF0 + ldr r0, [r0] + ldr r0, [r0, 0x18] + ldrb r0, [r0, 0x4] + subs r0, 0x44 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _08026AF4 + movs r0, 0x1 + b _08026AF6 + .align 2, 0 +_08026AF0: .4byte gUnknown_203B2B8 +_08026AF4: + movs r0, 0 +_08026AF6: + cmp r0, 0 + beq _08026B02 + movs r0, 0xD + bl sub_8026074 + b _08026B08 +_08026B02: + movs r0, 0x8 + bl sub_8026074 +_08026B08: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8026AB0 + + thumb_func_start sub_8026B10 +sub_8026B10: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08026B40 + ldr r0, [sp] + cmp r0, 0x2 + beq _08026B3A + cmp r0, 0x2 + bgt _08026B2E + cmp r0, 0x1 + beq _08026B32 + b _08026B40 +_08026B2E: + cmp r0, 0x3 + bne _08026B40 +_08026B32: + movs r0, 0x2 + bl sub_8026074 + b _08026B40 +_08026B3A: + movs r0, 0x8 + bl sub_8026074 +_08026B40: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8026B10 + + thumb_func_start sub_8026B48 +sub_8026B48: + push {lr} + bl sub_8022860 + cmp r0, 0x1 + bls _08026B60 + cmp r0, 0x3 + bhi _08026B60 + bl sub_8022908 + movs r0, 0x2 + bl sub_8026074 +_08026B60: + pop {r0} + bx r0 + thumb_func_end sub_8026B48 + + thumb_func_start sub_8026B64 +sub_8026B64: + push {r4,lr} + movs r0, 0x1 + bl sub_801A6E8 + cmp r0, 0x4 + bhi _08026C0E + lsls r0, 2 + ldr r1, _08026B7C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08026B7C: .4byte _08026B80 + .align 2, 0 +_08026B80: + .4byte _08026C0E + .4byte _08026C0E + .4byte _08026C04 + .4byte _08026B94 + .4byte _08026BC8 +_08026B94: + bl sub_801A8AC + ldr r4, _08026BC0 + ldr r2, [r4] + str r0, [r2, 0xC] + ldr r3, _08026BC4 + ldr r1, [r3] + lsls r0, 2 + adds r1, r0 + ldrb r0, [r1, 0x2] + strb r0, [r2, 0x10] + ldr r2, [r4] + ldr r1, [r3] + ldr r0, [r2, 0xC] + lsls r0, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + strb r0, [r2, 0x11] + movs r0, 0x14 + bl sub_8026074 + b _08026C0E + .align 2, 0 +_08026BC0: .4byte gUnknown_203B2B8 +_08026BC4: .4byte gUnknown_203B460 +_08026BC8: + bl sub_801A8AC + ldr r4, _08026BFC + ldr r2, [r4] + str r0, [r2, 0xC] + ldr r3, _08026C00 + ldr r1, [r3] + lsls r0, 2 + adds r1, r0 + ldrb r0, [r1, 0x2] + strb r0, [r2, 0x10] + ldr r2, [r4] + ldr r1, [r3] + ldr r0, [r2, 0xC] + lsls r0, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + strb r0, [r2, 0x11] + movs r0, 0 + bl sub_8099690 + movs r0, 0x15 + bl sub_8026074 + b _08026C0E + .align 2, 0 +_08026BFC: .4byte gUnknown_203B2B8 +_08026C00: .4byte gUnknown_203B460 +_08026C04: + bl sub_801A928 + movs r0, 0x2 + bl sub_8026074 +_08026C0E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8026B64 + + thumb_func_start sub_8026C14 +sub_8026C14: + push {r4-r6,lr} + sub sp, 0x14 + movs r0, 0 + str r0, [sp, 0xC] + bl sub_801A6E8 + ldr r4, _08026C54 + ldr r0, [r4] + adds r0, 0xCC + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _08026C44 + ldr r0, [r4] + adds r0, 0xCC + add r1, sp, 0xC + bl sub_8013114 + ldr r1, [sp, 0xC] + cmp r1, 0x1 + beq _08026C44 + ldr r0, [r4] + str r1, [r0, 0x74] +_08026C44: + ldr r0, [sp, 0xC] + cmp r0, 0x4 + beq _08026CD4 + cmp r0, 0x4 + bgt _08026C58 + cmp r0, 0x1 + beq _08026CE2 + b _08026CE8 + .align 2, 0 +_08026C54: .4byte gUnknown_203B2B8 +_08026C58: + cmp r0, 0xB + bne _08026CE8 + movs r6, 0xF + ldr r0, _08026CC8 + bl sub_8011988 + ldr r5, _08026CCC + ldr r0, [r5] + ldr r0, [r0, 0xC] + bl sub_80911F8 + bl sub_80910B4 + ldr r1, [r5] + ldrb r0, [r1, 0x14] + cmp r0, 0 + beq _08026C84 + adds r0, r1, 0 + adds r0, 0x14 + bl sub_8091274 + movs r6, 0x10 +_08026C84: + add r4, sp, 0x10 + ldr r1, [r5] + adds r1, 0x10 + adds r0, r4, 0 + bl sub_8090B64 + movs r1, 0 + str r1, [sp] + mov r0, sp + strb r1, [r0, 0x4] + mov r1, sp + movs r0, 0x1 + strb r0, [r1, 0x8] + strb r0, [r4] + ldr r0, _08026CD0 + adds r1, r4, 0 + mov r2, sp + bl sub_8090E14 + ldr r1, [r5] + movs r2, 0xA + ldrsh r0, [r1, r2] + adds r1, 0x10 + bl sub_808D800 + bl sub_801A928 + bl nullsub_104 + adds r0, r6, 0 + bl sub_8026074 + b _08026CE8 + .align 2, 0 +_08026CC8: .4byte 0x0000014d +_08026CCC: .4byte gUnknown_203B2B8 +_08026CD0: .4byte gUnknown_202DEA8 +_08026CD4: + movs r0, 0 + bl sub_8099690 + movs r0, 0x15 + bl sub_8026074 + b _08026CE8 +_08026CE2: + movs r0, 0x13 + bl sub_8026074 +_08026CE8: + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8026C14 + + thumb_func_start sub_8026CF0 +sub_8026CF0: + push {lr} + bl sub_801B410 + cmp r0, 0x1 + bls _08026D08 + cmp r0, 0x3 + bhi _08026D08 + bl sub_801B450 + movs r0, 0x13 + bl sub_8026074 +_08026D08: + pop {r0} + bx r0 + thumb_func_end sub_8026CF0 + + thumb_func_start sub_8026D0C +sub_8026D0C: + push {lr} + movs r0, 0x1 + bl sub_801EF38 + cmp r0, 0x4 + bhi _08026D66 + lsls r0, 2 + ldr r1, _08026D24 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08026D24: .4byte _08026D28 + .align 2, 0 +_08026D28: + .4byte _08026D66 + .4byte _08026D66 + .4byte _08026D5C + .4byte _08026D3C + .4byte _08026D3C +_08026D3C: + bl sub_801F194 + ldr r1, _08026D58 + ldr r1, [r1] + str r0, [r1, 0x20] + lsls r0, 3 + adds r0, r1, r0 + ldrh r0, [r0, 0x2A] + strh r0, [r1, 0x24] + movs r0, 0x18 + bl sub_8026074 + b _08026D66 + .align 2, 0 +_08026D58: .4byte gUnknown_203B2B8 +_08026D5C: + bl sub_801F214 + movs r0, 0x2 + bl sub_8026074 +_08026D66: + pop {r0} + bx r0 + thumb_func_end sub_8026D0C + + thumb_func_start sub_8026D6C +sub_8026D6C: + push {lr} + bl sub_801F890 + cmp r0, 0x1 + bls _08026D84 + cmp r0, 0x3 + bhi _08026D84 + bl sub_801F8D0 + movs r0, 0x17 + bl sub_8026074 +_08026D84: + pop {r0} + bx r0 + thumb_func_end sub_8026D6C + + thumb_func_start sub_8026D88 +sub_8026D88: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08026DA0 + ldr r0, _08026DA8 + ldr r0, [r0] + ldr r0, [r0, 0x4] + bl sub_8026074 +_08026DA0: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08026DA8: .4byte gUnknown_203B2B8 + thumb_func_end sub_8026D88 + + thumb_func_start sub_8026DAC +sub_8026DAC: + push {r4-r6,lr} + sub sp, 0x14 + adds r6, r0, 0 + adds r5, r1, 0 + bl sub_8008C54 + adds r0, r6, 0 + bl sub_80073B8 + add r4, sp, 0x10 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8090B64 + movs r5, 0 + str r5, [sp, 0x4] + add r0, sp, 0x4 + strb r5, [r0, 0x4] + adds r1, r0, 0 + movs r0, 0x1 + strb r0, [r1, 0x8] + strb r0, [r4] + ldr r0, _08026E00 + adds r1, r4, 0 + add r2, sp, 0x4 + bl sub_8090E14 + ldr r2, _08026E04 + str r5, [sp] + movs r0, 0x4 + movs r1, 0x3 + adds r3, r6, 0 + bl sub_8014FF0 + adds r0, r6, 0 + bl sub_80073E0 + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08026E00: .4byte gUnknown_202DE58 +_08026E04: .4byte gUnknown_80DD6D0 + thumb_func_end sub_8026DAC + + thumb_func_start sub_8026E08 +sub_8026E08: + push {r4-r6,lr} + sub sp, 0x40 + adds r5, r0, 0 + bl sub_8008C54 + adds r0, r5, 0 + bl sub_80073B8 + ldr r6, _08026E78 + ldr r4, _08026E7C + ldr r0, [r4] + ldr r1, [r0, 0x18] + adds r1, 0x4C + adds r0, r6, 0 + movs r2, 0xA + bl sub_80922B4 + add r0, sp, 0x2C + ldr r1, [r4] + ldr r1, [r1, 0x18] + movs r2, 0x8 + ldrsh r1, [r1, r2] + bl sub_808D930 + ldr r1, _08026E80 + add r0, sp, 0x4 + adds r2, r6, 0 + bl sub_800D158 + add r0, sp, 0x4 + bl sub_8008ED0 + adds r1, r0, 0 + ldr r0, _08026E84 + movs r2, 0xC + ldrsh r0, [r0, r2] + lsls r0, 3 + subs r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + movs r1, 0 + str r1, [sp] + movs r1, 0x3 + add r2, sp, 0x4 + adds r3, r5, 0 + bl xxx_call_draw_string + adds r0, r5, 0 + bl sub_80073E0 + add sp, 0x40 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08026E78: .4byte gUnknown_202DF98 +_08026E7C: .4byte gUnknown_203B2B8 +_08026E80: .4byte gUnknown_80DD6E0 +_08026E84: .4byte gUnknown_80DD370 + thumb_func_end sub_8026E08 + + thumb_func_start sub_8026E88 +sub_8026E88: + push {lr} + adds r1, r0, 0 + ldrb r0, [r1, 0x2] + cmp r0, 0 + bne _08026EAC + movs r2, 0 + ldrb r0, [r1, 0x4] + cmp r0, 0x41 + bne _08026E9C + movs r2, 0x1 +_08026E9C: + cmp r2, 0 + beq _08026EB0 + movs r0, 0x8 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + bne _08026EB0 +_08026EAC: + movs r0, 0 + b _08026EB2 +_08026EB0: + movs r0, 0x1 +_08026EB2: + pop {r1} + bx r1 + thumb_func_end sub_8026E88 + + thumb_func_start sub_8026EB8 +sub_8026EB8: + push {r4,lr} + adds r4, r0, 0 + bl sub_808D3BC + cmp r0, r4 + beq _08026EFA + bl sub_808D3F8 + cmp r0, r4 + beq _08026EFA + ldrb r0, [r4, 0x2] + cmp r0, 0 + bne _08026EFA + movs r1, 0 + ldrb r0, [r4, 0x4] + cmp r0, 0x41 + bne _08026EDC + movs r1, 0x1 +_08026EDC: + cmp r1, 0 + beq _08026EEC + movs r0, 0x8 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _08026EFA +_08026EEC: + adds r0, r4, 0 + bl sub_8026F04 + cmp r0, 0x3 + beq _08026EFA + movs r0, 0x1 + b _08026EFC +_08026EFA: + movs r0, 0 +_08026EFC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8026EB8 + + thumb_func_start sub_8026F04 +sub_8026F04: + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x28 + ldrb r0, [r0] + cmp r0, 0 + bne _08026F14 + movs r0, 0 + b _08026F32 +_08026F14: + bl sub_8090A34 + cmp r0, 0x13 + bgt _08026F20 + movs r0, 0x1 + b _08026F32 +_08026F20: + adds r0, r4, 0 + bl sub_8026F38 + lsls r0, 24 + cmp r0, 0 + bne _08026F30 + movs r0, 0x3 + b _08026F32 +_08026F30: + movs r0, 0x2 +_08026F32: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8026F04 + + thumb_func_start sub_8026F38 +sub_8026F38: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r5, 0 + adds r4, 0x28 + ldrb r0, [r4] + bl sub_8091524 + lsls r0, 24 + cmp r0, 0 + beq _08026F74 + ldrb r0, [r4] + bl sub_8090A60 + lsls r0, 24 + cmp r0, 0 + beq _08026F80 + ldr r0, _08026F78 + ldr r1, [r0] + ldrb r0, [r4] + lsls r0, 1 + adds r1, 0x50 + adds r1, r0 + ldrh r1, [r1] + adds r0, r5, 0 + adds r0, 0x29 + ldrb r0, [r0] + adds r1, r0 + ldr r0, _08026F7C + cmp r1, r0 + ble _08026F94 +_08026F74: + movs r0, 0 + b _08026F96 + .align 2, 0 +_08026F78: .4byte gUnknown_203B460 +_08026F7C: .4byte 0x000003e7 +_08026F80: + ldr r0, _08026F9C + ldr r1, [r0] + ldrb r0, [r4] + lsls r0, 1 + adds r1, 0x50 + adds r1, r0 + ldrh r1, [r1] + ldr r0, _08026FA0 + cmp r1, r0 + bhi _08026F74 +_08026F94: + movs r0, 0x1 +_08026F96: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08026F9C: .4byte gUnknown_203B460 +_08026FA0: .4byte 0x000003e6 + thumb_func_end sub_8026F38 + + thumb_func_start sub_8026FA4 +sub_8026FA4: + push {r4,lr} + ldr r4, _08026FC0 + ldr r0, [r4] + ldr r0, [r0, 0x18] + bl sub_8026F04 + cmp r0, 0x1 + beq _08026FC4 + cmp r0, 0x1 + bcc _08027068 + cmp r0, 0x2 + beq _08026FF8 + b _08027068 + .align 2, 0 +_08026FC0: .4byte gUnknown_203B2B8 +_08026FC4: + ldr r0, _08026FF4 + bl sub_8011988 + ldr r0, [r4] + adds r0, 0x14 + bl sub_8091274 + bl sub_80910B4 + ldr r0, [r4] + movs r1, 0 + strb r1, [r0, 0x14] + ldr r0, [r4] + strb r1, [r0, 0x15] + ldr r1, [r4] + movs r2, 0xA + ldrsh r0, [r1, r2] + adds r1, 0x14 + bl sub_808D800 + movs r0, 0xA + bl sub_8026074 + b _0802706E + .align 2, 0 +_08026FF4: .4byte 0x0000014d +_08026FF8: + ldr r0, _08027024 + bl sub_8011988 + ldr r0, [r4] + ldrb r0, [r0, 0x14] + bl sub_8090A60 + lsls r0, 24 + cmp r0, 0 + beq _0802702C + ldr r0, _08027028 + ldr r1, [r0] + ldr r2, [r4] + ldrb r0, [r2, 0x14] + lsls r0, 1 + adds r1, 0x50 + adds r1, r0 + ldrh r0, [r1] + ldrb r2, [r2, 0x15] + adds r0, r2 + b _0802703E + .align 2, 0 +_08027024: .4byte 0x0000014d +_08027028: .4byte gUnknown_203B460 +_0802702C: + ldr r0, _08027060 + ldr r1, [r0] + ldr r0, [r4] + ldrb r0, [r0, 0x14] + lsls r0, 1 + adds r1, 0x50 + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 +_0802703E: + strh r0, [r1] + ldr r1, _08027064 + ldr r0, [r1] + movs r2, 0 + strb r2, [r0, 0x14] + ldr r0, [r1] + strb r2, [r0, 0x15] + ldr r1, [r1] + movs r2, 0xA + ldrsh r0, [r1, r2] + adds r1, 0x14 + bl sub_808D800 + movs r0, 0xB + bl sub_8026074 + b _0802706E + .align 2, 0 +_08027060: .4byte gUnknown_203B460 +_08027064: .4byte gUnknown_203B2B8 +_08027068: + movs r0, 0x19 + bl sub_8026074 +_0802706E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8026FA4 + + thumb_func_start sub_8027074 +sub_8027074: + push {r4,lr} + movs r0, 0 + bl sub_8004D8C + ldr r4, _080270A0 + movs r0, 0xF0 + lsls r0, 1 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r4] + movs r1, 0 + str r1, [r0, 0x70] + str r1, [r0, 0x74] + str r1, [r0, 0x78] + movs r0, 0 + bl sub_8027184 + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080270A0: .4byte gUnknown_203B2BC + thumb_func_end sub_8027074 + + thumb_func_start sub_80270A4 +sub_80270A4: + push {lr} + ldr r0, _080270BC + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0x11 + bhi _08027156 + lsls r0, 2 + ldr r1, _080270C0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080270BC: .4byte gUnknown_203B2BC +_080270C0: .4byte _080270C4 + .align 2, 0 +_080270C4: + .4byte _0802710C + .4byte _08027114 + .4byte _08027114 + .4byte _0802711A + .4byte _08027120 + .4byte _08027126 + .4byte _08027156 + .4byte _08027156 + .4byte _0802712C + .4byte _08027132 + .4byte _08027138 + .4byte _08027138 + .4byte _0802713E + .4byte _08027144 + .4byte _0802714A + .4byte _0802714A + .4byte _08027150 + .4byte _0802715C +_0802710C: + movs r0, 0x1 + bl sub_8027184 + b _08027160 +_08027114: + bl sub_80277FC + b _08027160 +_0802711A: + bl sub_80278B4 + b _08027160 +_08027120: + bl sub_8027A40 + b _08027160 +_08027126: + bl sub_8027A5C + b _08027160 +_0802712C: + bl sub_8027A78 + b _08027160 +_08027132: + bl sub_8027AE4 + b _08027160 +_08027138: + bl sub_8027B28 + b _08027160 +_0802713E: + bl sub_8027BD8 + b _08027160 +_08027144: + bl sub_8027C84 + b _08027160 +_0802714A: + bl sub_8027CA0 + b _08027160 +_08027150: + bl sub_8027D00 + b _08027160 +_08027156: + bl sub_8027D1C + b _08027160 +_0802715C: + movs r0, 0x3 + b _08027162 +_08027160: + movs r0, 0 +_08027162: + pop {r1} + bx r1 + thumb_func_end sub_80270A4 + + thumb_func_start sub_8027168 +sub_8027168: + push {r4,lr} + ldr r4, _08027180 + ldr r0, [r4] + cmp r0, 0 + beq _0802717A + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0802717A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08027180: .4byte gUnknown_203B2BC + thumb_func_end sub_8027168 + + thumb_func_start sub_8027184 +sub_8027184: + push {lr} + ldr r1, _08027198 + ldr r1, [r1] + str r0, [r1] + bl sub_802719C + bl sub_8027274 + pop {r0} + bx r0 + .align 2, 0 +_08027198: .4byte gUnknown_203B2BC + thumb_func_end sub_8027184 + + thumb_func_start sub_802719C +sub_802719C: + push {r4-r7,lr} + ldr r4, _080271C0 + ldr r0, [r4] + movs r1, 0xC0 + lsls r1, 1 + adds r0, r1 + bl sub_8006518 + ldr r1, [r4] + ldr r0, [r1] + cmp r0, 0x3 + beq _080271C8 + cmp r0, 0xC + beq _08027208 + movs r2, 0 + ldr r3, _080271C4 + b _08027234 + .align 2, 0 +_080271C0: .4byte gUnknown_203B2BC +_080271C4: .4byte gUnknown_80DD6EC +_080271C8: + movs r2, 0xE4 + lsls r2, 1 + adds r1, r2 + ldr r0, _08027200 + ldm r0!, {r3,r5,r6} + stm r1!, {r3,r5,r6} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + bl sub_802745C + ldr r2, [r4] + movs r0, 0xD8 + lsls r0, 1 + adds r2, r0 + ldr r1, _08027204 + ldm r1!, {r5-r7} + stm r2!, {r5-r7} + ldm r1!, {r3,r5,r6} + stm r2!, {r3,r5,r6} + ldr r1, [r4] + adds r0, r1, r0 + movs r7, 0x8E + lsls r7, 1 + adds r1, r7 + bl sub_8012CAC + b _08027254 + .align 2, 0 +_08027200: .4byte gUnknown_80DD74C +_08027204: .4byte gUnknown_80DD704 +_08027208: + bl sub_80276A8 + ldr r2, [r4] + movs r0, 0xD8 + lsls r0, 1 + adds r2, r0 + ldr r1, _08027230 + ldm r1!, {r3,r5,r6} + stm r2!, {r3,r5,r6} + ldm r1!, {r3,r5,r7} + stm r2!, {r3,r5,r7} + ldr r1, [r4] + adds r0, r1, r0 + movs r6, 0x8E + lsls r6, 1 + adds r1, r6 + bl sub_8012CAC + b _08027254 + .align 2, 0 +_08027230: .4byte gUnknown_80DD71C +_08027234: + ldr r0, [r4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 3 + adds r0, r1 + movs r7, 0xC0 + lsls r7, 1 + adds r0, r7 + adds r1, r3, 0 + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + adds r2, 0x1 + cmp r2, 0x3 + ble _08027234 +_08027254: + bl sub_8004914 + ldr r0, _08027270 + ldr r0, [r0] + movs r1, 0xC0 + lsls r1, 1 + adds r0, r1 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08027270: .4byte gUnknown_203B2BC + thumb_func_end sub_802719C + + thumb_func_start sub_8027274 +sub_8027274: + push {r4,lr} + sub sp, 0x18 + ldr r1, _08027290 + ldr r0, [r1] + ldr r0, [r0] + adds r4, r1, 0 + cmp r0, 0x11 + bls _08027286 + b _0802744A +_08027286: + lsls r0, 2 + ldr r1, _08027294 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08027290: .4byte gUnknown_203B2BC +_08027294: .4byte _08027298 + .align 2, 0 +_08027298: + .4byte _0802744A + .4byte _080272E0 + .4byte _080272EE + .4byte _080272F6 + .4byte _0802731A + .4byte _08027328 + .4byte _0802741C + .4byte _08027438 + .4byte _080273B6 + .4byte _080273D0 + .4byte _08027334 + .4byte _08027342 + .4byte _0802734A + .4byte _08027374 + .4byte _08027386 + .4byte _080273AC + .4byte _08027404 + .4byte _0802744A +_080272E0: + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0x7 + bl sub_8023868 + b _0802744A +_080272EE: + movs r0, 0x1 + bl sub_8023B7C + b _0802744A +_080272F6: + ldr r1, [r4] + adds r1, 0x14 + movs r0, 0x3 + bl sub_8027D40 + bl sub_8023DA4 + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0x7C + movs r3, 0x8E + lsls r3, 1 + adds r1, r2, r3 + movs r4, 0xB6 + lsls r4, 1 + adds r3, r2, r4 + ldr r2, [r2, 0x70] + b _08027362 +_0802731A: + ldr r0, [r4] + movs r1, 0x8 + ldrsh r0, [r0, r1] + movs r1, 0x2 + bl sub_8024458 + b _0802744A +_08027328: + ldr r0, [r4] + movs r3, 0x8 + ldrsh r0, [r0, r3] + bl sub_801BEEC + b _0802744A +_08027334: + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0xA + bl sub_801A5D8 + b _0802744A +_08027342: + movs r0, 0x1 + bl sub_801A8D0 + b _0802744A +_0802734A: + bl sub_801A9E0 + ldr r0, _08027370 + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x7C + movs r4, 0x8E + lsls r4, 1 + adds r1, r2, r4 + adds r4, 0x50 + adds r3, r2, r4 + ldr r2, [r2, 0x74] +_08027362: + str r2, [sp] + movs r2, 0x2 + str r2, [sp, 0x4] + movs r2, 0 + bl sub_8012D60 + b _0802744A + .align 2, 0 +_08027370: .4byte gUnknown_203B2BC +_08027374: + ldr r1, [r4] + adds r1, 0x10 + add r0, sp, 0x14 + bl sub_8090B64 + add r0, sp, 0x14 + bl sub_801B3C0 + b _0802744A +_08027386: + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x28 + ldr r1, [r1, 0x18] + adds r1, 0x2C + bl sub_809401C + ldr r2, [r4] + movs r0, 0x8 + ldrsh r1, [r2, r0] + adds r2, 0x28 + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + movs r0, 0x3 + movs r3, 0 + bl sub_801EE10 + b _0802744A +_080273AC: + movs r0, 0x1 + movs r1, 0 + bl sub_801F1B0 + b _0802744A +_080273B6: + bl sub_8027794 + ldr r0, _080273C8 + ldr r1, _080273CC + ldr r3, [r1] + movs r1, 0x8E + lsls r1, 1 + adds r3, r1 + b _080273E0 + .align 2, 0 +_080273C8: .4byte gUnknown_80DD764 +_080273CC: .4byte gUnknown_203B2BC +_080273D0: + bl sub_8027794 + ldr r0, _080273FC + ldr r1, _08027400 + ldr r3, [r1] + movs r4, 0x8E + lsls r4, 1 + adds r3, r4 +_080273E0: + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + str r2, [sp, 0xC] + adds r1, 0xFD + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0x3 + bl sub_8014248 + b _0802744A + .align 2, 0 +_080273FC: .4byte gUnknown_80DD7FC +_08027400: .4byte gUnknown_203B2BC +_08027404: + ldr r2, [r4] + ldr r0, [r2, 0x20] + adds r1, r2, 0 + adds r1, 0x28 + adds r2, 0x68 + bl sub_8093560 + ldr r0, [r4] + adds r0, 0x68 + bl sub_801F808 + b _0802744A +_0802741C: + ldr r1, [r4] + movs r0, 0x2 + str r0, [r1, 0x4] + ldr r0, _08027430 + ldr r3, _08027434 + movs r1, 0 + movs r2, 0 + bl sub_80141B4 + b _0802744A + .align 2, 0 +_08027430: .4byte gUnknown_80DD8A0 +_08027434: .4byte 0x00000101 +_08027438: + ldr r1, [r4] + movs r0, 0x2 + str r0, [r1, 0x4] + ldr r0, _08027454 + ldr r3, _08027458 + movs r1, 0 + movs r2, 0 + bl sub_80141B4 +_0802744A: + add sp, 0x18 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08027454: .4byte gUnknown_80DD8D0 +_08027458: .4byte 0x00000101 + thumb_func_end sub_8027274 + + thumb_func_start sub_802745C +sub_802745C: + push {r4-r7,lr} + ldr r3, _080274E4 + ldr r4, _080274E8 + ldr r0, [r4] + movs r1, 0x8 + ldrsh r2, [r0, r1] + movs r1, 0x58 + muls r2, r1 + ldr r1, [r3] + adds r5, r1, r2 + movs r2, 0xB6 + lsls r2, 1 + adds r0, r2 + movs r1, 0 + movs r2, 0x14 + bl MemoryFill16 + ldrh r0, [r5] + lsrs r0, 1 + movs r6, 0x1 + ands r0, r6 + cmp r0, 0 + beq _080274F4 + ldr r2, [r4] + movs r3, 0x8E + lsls r3, 1 + adds r1, r2, r3 + ldr r0, _080274EC + str r0, [r1] + movs r0, 0x90 + lsls r0, 1 + adds r1, r2, r0 + movs r0, 0x7 + str r0, [r1] + adds r0, r5, 0 + bl sub_8027D9C + lsls r0, 24 + cmp r0, 0 + bne _080274B6 + ldr r0, [r4] + movs r1, 0xB6 + lsls r1, 1 + adds r0, r1 + strh r6, [r0] +_080274B6: + movs r7, 0x1 + movs r0, 0x8 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _08027552 + ldrb r0, [r5, 0x2] + cmp r0, 0 + bne _08027552 + ldr r3, [r4] + movs r2, 0x8 + movs r4, 0x92 + lsls r4, 1 + adds r1, r3, r4 + ldr r0, _080274F0 + str r0, [r1] + movs r1, 0x94 + lsls r1, 1 + adds r0, r3, r1 + str r2, [r0] + b _08027550 + .align 2, 0 +_080274E4: .4byte gUnknown_203B45C +_080274E8: .4byte gUnknown_203B2BC +_080274EC: .4byte gUnknown_80DD8F8 +_080274F0: .4byte gUnknown_80DD904 +_080274F4: + ldr r2, [r4] + movs r3, 0x8E + lsls r3, 1 + adds r1, r2, r3 + ldr r0, _08027658 + str r0, [r1] + movs r0, 0x90 + lsls r0, 1 + adds r1, r2, r0 + movs r0, 0x6 + str r0, [r1] + movs r1, 0x8 + ldrsh r0, [r2, r1] + bl sub_808D750 + lsls r0, 24 + cmp r0, 0 + bne _08027522 + ldr r0, [r4] + movs r2, 0xB6 + lsls r2, 1 + adds r0, r2 + strh r6, [r0] +_08027522: + movs r7, 0x1 + ldr r2, [r4] + movs r3, 0x92 + lsls r3, 1 + adds r1, r2, r3 + ldr r0, _0802765C + str r0, [r1] + movs r0, 0x94 + lsls r0, 1 + adds r1, r2, r0 + movs r0, 0x9 + str r0, [r1] + adds r0, r5, 0 + bl sub_8027DCC + lsls r0, 24 + cmp r0, 0 + bne _08027550 + ldr r0, [r4] + movs r1, 0xB7 + lsls r1, 1 + adds r0, r1 + strh r7, [r0] +_08027550: + movs r7, 0x2 +_08027552: + ldr r4, _08027660 + ldr r2, [r4] + lsls r3, r7, 3 + movs r6, 0x8E + lsls r6, 1 + adds r0, r2, r6 + adds r0, r3 + ldr r1, _08027664 + str r1, [r0] + movs r5, 0x90 + lsls r5, 1 + adds r2, r5 + adds r2, r3 + movs r0, 0xA + str r0, [r2] + bl sub_8090A34 + cmp r0, 0 + bne _08027588 + ldr r0, [r4] + lsls r1, r7, 1 + movs r2, 0xB6 + lsls r2, 1 + adds r0, r2 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0] +_08027588: + adds r7, 0x1 + ldr r2, [r4] + lsls r3, r7, 3 + adds r0, r2, r6 + adds r0, r3 + ldr r1, _08027668 + str r1, [r0] + adds r2, r5 + adds r2, r3 + movs r0, 0xB + str r0, [r2] + bl sub_8090A34 + cmp r0, 0x13 + bgt _080275AE + ldr r0, [r4] + ldrb r0, [r0, 0x14] + cmp r0, 0 + bne _080275BE +_080275AE: + ldr r0, [r4] + lsls r1, r7, 1 + movs r3, 0xB6 + lsls r3, 1 + adds r0, r3 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0] +_080275BE: + adds r7, 0x1 + ldr r4, _08027660 + ldr r5, [r4] + lsls r1, r7, 3 + movs r0, 0x8E + lsls r0, 1 + adds r3, r5, r0 + adds r2, r3, r1 + ldr r0, _0802766C + str r0, [r2] + movs r2, 0x90 + lsls r2, 1 + adds r6, r5, r2 + adds r1, r6, r1 + movs r0, 0x4 + str r0, [r1] + adds r7, 0x1 + lsls r1, r7, 3 + adds r2, r3, r1 + ldr r0, _08027670 + str r0, [r2] + adds r1, r6, r1 + movs r0, 0xC + str r0, [r1] + adds r7, 0x1 + lsls r1, r7, 3 + adds r2, r3, r1 + ldr r0, _08027674 + str r0, [r2] + adds r1, r6, r1 + movs r0, 0x5 + str r0, [r1] + adds r7, 0x1 + lsls r1, r7, 3 + adds r3, r1 + movs r0, 0 + str r0, [r3] + adds r1, r6, r1 + movs r0, 0x1 + str r0, [r1] + movs r3, 0 + mov r12, r4 + cmp r3, r7 + bge _08027636 + adds r4, r6, 0 + movs r0, 0xB6 + lsls r0, 1 + adds r2, r5, r0 +_0802761E: + ldrh r0, [r2] + cmp r0, 0 + bne _0802762C + ldr r1, [r4] + ldr r0, [r5, 0x70] + cmp r1, r0 + beq _080276A0 +_0802762C: + adds r4, 0x8 + adds r2, 0x2 + adds r3, 0x1 + cmp r3, r7 + blt _0802761E +_08027636: + movs r3, 0 + cmp r3, r7 + bge _080276A0 + mov r2, r12 + ldr r1, [r2] + movs r4, 0xB6 + lsls r4, 1 + adds r0, r1, r4 + ldrh r0, [r0] + cmp r0, 0 + bne _08027678 + movs r2, 0x90 + lsls r2, 1 + adds r0, r1, r2 + ldr r0, [r0] + str r0, [r1, 0x70] + b _080276A0 + .align 2, 0 +_08027658: .4byte gUnknown_80DD910 +_0802765C: .4byte gUnknown_80DD91C +_08027660: .4byte gUnknown_203B2BC +_08027664: .4byte gUnknown_80DD92C +_08027668: .4byte gUnknown_80DD934 +_0802766C: .4byte gUnknown_80DD93C +_08027670: .4byte gUnknown_80DD944 +_08027674: .4byte gUnknown_80DD94C +_08027678: + adds r3, 0x1 + cmp r3, r7 + bge _080276A0 + mov r4, r12 + ldr r2, [r4] + lsls r0, r3, 1 + movs r4, 0xB6 + lsls r4, 1 + adds r1, r2, r4 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _08027678 + lsls r0, r3, 3 + movs r3, 0x90 + lsls r3, 1 + adds r1, r2, r3 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x70] +_080276A0: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_802745C + + thumb_func_start sub_80276A8 +sub_80276A8: + push {r4-r7,lr} + ldr r5, _0802775C + ldr r0, [r5] + movs r7, 0xB6 + lsls r7, 1 + adds r0, r7 + movs r1, 0 + movs r2, 0x14 + bl MemoryFill16 + ldr r2, [r5] + movs r0, 0x8E + lsls r0, 1 + adds r1, r2, r0 + ldr r0, _08027760 + str r0, [r1] + movs r3, 0x90 + lsls r3, 1 + adds r1, r2, r3 + movs r0, 0xA + str r0, [r1] + bl sub_8090A34 + cmp r0, 0 + bne _080276E4 + ldr r0, [r5] + adds r4, r7, 0 + adds r0, r4 + movs r1, 0x1 + strh r1, [r0] +_080276E4: + ldr r4, [r5] + movs r2, 0x1 + movs r0, 0x92 + lsls r0, 1 + adds r1, r4, r0 + ldr r0, _08027764 + ldr r0, [r0] + str r0, [r1] + movs r3, 0x94 + lsls r3, 1 + adds r1, r4, r3 + movs r0, 0x4 + str r0, [r1] + movs r6, 0x2 + movs r0, 0x96 + lsls r0, 1 + adds r1, r4, r0 + movs r0, 0 + str r0, [r1] + movs r1, 0x98 + lsls r1, 1 + adds r0, r4, r1 + str r2, [r0] + movs r3, 0 + mov r12, r4 + movs r4, 0x90 + lsls r4, 1 + add r4, r12 + mov r0, r12 + adds r2, r0, r7 +_08027720: + ldrh r0, [r2] + cmp r0, 0 + bne _08027730 + ldr r1, [r4] + mov r7, r12 + ldr r0, [r7, 0x74] + cmp r1, r0 + beq _0802778E +_08027730: + adds r4, 0x8 + adds r2, 0x2 + adds r3, 0x1 + cmp r3, r6 + blt _08027720 + movs r3, 0 + cmp r3, r6 + bge _0802778E + ldr r1, [r5] + movs r2, 0xB6 + lsls r2, 1 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r0, 0 + bne _08027768 + movs r3, 0x90 + lsls r3, 1 + adds r0, r1, r3 + ldr r0, [r0] + str r0, [r1, 0x74] + b _0802778E + .align 2, 0 +_0802775C: .4byte gUnknown_203B2BC +_08027760: .4byte gUnknown_80DD92C +_08027764: .4byte gUnknown_80D4970 +_08027768: + adds r3, 0x1 + cmp r3, r6 + bge _0802778E + ldr r2, [r5] + lsls r0, r3, 1 + movs r4, 0xB6 + lsls r4, 1 + adds r1, r2, r4 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _08027768 + lsls r0, r3, 3 + movs r7, 0x90 + lsls r7, 1 + adds r1, r2, r7 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x74] +_0802778E: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80276A8 + + thumb_func_start sub_8027794 +sub_8027794: + push {r4,lr} + ldr r4, _080277F0 + ldr r0, [r4] + movs r1, 0xB6 + lsls r1, 1 + adds r0, r1 + movs r1, 0 + movs r2, 0x14 + bl MemoryFill16 + ldr r4, [r4] + movs r3, 0 + movs r0, 0x8E + lsls r0, 1 + adds r1, r4, r0 + ldr r0, _080277F4 + ldr r0, [r0] + str r0, [r1] + movs r0, 0x90 + lsls r0, 1 + adds r1, r4, r0 + movs r0, 0x2 + str r0, [r1] + movs r2, 0x1 + movs r0, 0x92 + lsls r0, 1 + adds r1, r4, r0 + ldr r0, _080277F8 + ldr r0, [r0] + str r0, [r1] + movs r0, 0x94 + lsls r0, 1 + adds r1, r4, r0 + movs r0, 0x3 + str r0, [r1] + movs r1, 0x96 + lsls r1, 1 + adds r0, r4, r1 + str r3, [r0] + adds r1, 0x4 + adds r0, r4, r1 + str r2, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080277F0: .4byte gUnknown_203B2BC +_080277F4: .4byte gUnknown_80D4920 +_080277F8: .4byte gUnknown_80D4928 + thumb_func_end sub_8027794 + + thumb_func_start sub_80277FC +sub_80277FC: + push {r4,lr} + movs r0, 0x1 + bl sub_8023A94 + cmp r0, 0x4 + bhi _080278AE + lsls r0, 2 + ldr r1, _08027814 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08027814: .4byte _08027818 + .align 2, 0 +_08027818: + .4byte _080278AE + .4byte _080278AE + .4byte _080278A4 + .4byte _0802782C + .4byte _08027868 +_0802782C: + bl sub_8023B44 + ldr r4, _08027860 + ldr r1, [r4] + strh r0, [r1, 0x8] + ldr r3, _08027864 + movs r0, 0x8 + ldrsh r2, [r1, r0] + movs r0, 0x58 + muls r2, r0 + ldr r0, [r3] + adds r0, r2 + str r0, [r1, 0x18] + ldrb r0, [r0, 0x2] + strb r0, [r1, 0x1C] + ldr r1, [r4] + movs r2, 0x8 + ldrsh r0, [r1, r2] + adds r1, 0x14 + bl sub_808D7DC + movs r0, 0x3 + bl sub_8027184 + b _080278AE + .align 2, 0 +_08027860: .4byte gUnknown_203B2BC +_08027864: .4byte gUnknown_203B45C +_08027868: + bl sub_8023B44 + ldr r4, _0802789C + ldr r1, [r4] + strh r0, [r1, 0x8] + ldr r3, _080278A0 + movs r0, 0x8 + ldrsh r2, [r1, r0] + movs r0, 0x58 + muls r2, r0 + ldr r0, [r3] + adds r0, r2 + str r0, [r1, 0x18] + ldrb r0, [r0, 0x2] + strb r0, [r1, 0x1C] + ldr r1, [r4] + movs r2, 0x8 + ldrsh r0, [r1, r2] + adds r1, 0x14 + bl sub_808D7DC + movs r0, 0x4 + bl sub_8027184 + b _080278AE + .align 2, 0 +_0802789C: .4byte gUnknown_203B2BC +_080278A0: .4byte gUnknown_203B45C +_080278A4: + bl sub_8023C60 + movs r0, 0x11 + bl sub_8027184 +_080278AE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80277FC + + thumb_func_start sub_80278B4 +sub_80278B4: + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + bl sub_8023A94 + ldr r4, _080278F8 + ldr r0, [r4] + adds r0, 0x7C + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _080278E4 + ldr r0, [r4] + adds r0, 0x7C + mov r1, sp + bl sub_8013114 + ldr r1, [sp] + cmp r1, 0x1 + beq _080278E4 + ldr r0, [r4] + str r1, [r0, 0x70] +_080278E4: + ldr r0, [sp] + subs r0, 0x1 + cmp r0, 0xB + bls _080278EE + b _08027A36 +_080278EE: + lsls r0, 2 + ldr r1, _080278FC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080278F8: .4byte gUnknown_203B2BC +_080278FC: .4byte _08027900 + .align 2, 0 +_08027900: + .4byte _08027A30 + .4byte _08027A36 + .4byte _08027A36 + .4byte _08027A20 + .4byte _08027A28 + .4byte _08027930 + .4byte _0802796C + .4byte _0802798C + .4byte _080279C0 + .4byte _080279D0 + .4byte _080279D8 + .4byte _080279C8 +_08027930: + ldr r4, _08027964 + ldr r0, [r4] + movs r1, 0x8 + ldrsh r0, [r0, r1] + bl sub_808D750 + lsls r0, 24 + cmp r0, 0 + beq _0802795E + ldr r0, [r4] + movs r2, 0x8 + ldrsh r1, [r0, r2] + movs r0, 0x58 + muls r1, r0 + ldr r0, _08027968 + ldr r0, [r0] + adds r1, r0 + ldrh r2, [r1] + movs r0, 0x2 + orrs r0, r2 + strh r0, [r1] + bl nullsub_104 +_0802795E: + bl sub_808ED00 + b _08027A0E + .align 2, 0 +_08027964: .4byte gUnknown_203B2BC +_08027968: .4byte gUnknown_203B45C +_0802796C: + ldr r0, _08027984 + ldr r0, [r0] + ldr r2, [r0, 0x18] + ldrh r1, [r2] + ldr r0, _08027988 + ands r0, r1 + strh r0, [r2] + bl nullsub_104 + bl sub_808ED00 + b _08027A0E + .align 2, 0 +_08027984: .4byte gUnknown_203B2BC +_08027988: .4byte 0x0000fffd +_0802798C: + ldr r2, _080279B8 + ldr r0, _080279BC + ldr r0, [r0] + movs r3, 0x8 + ldrsh r1, [r0, r3] + movs r0, 0x58 + muls r1, r0 + ldr r0, [r2] + adds r4, r0, r1 + bl sub_808D33C + ldrb r1, [r4, 0x2] + cmp r1, 0 + bne _080279B2 + strb r1, [r0, 0x2] + movs r0, 0x1 + strb r0, [r4, 0x2] + bl nullsub_104 +_080279B2: + bl sub_808ED00 + b _08027A0E + .align 2, 0 +_080279B8: .4byte gUnknown_203B45C +_080279BC: .4byte gUnknown_203B2BC +_080279C0: + movs r0, 0x8 + bl sub_8027184 + b _08027A36 +_080279C8: + movs r0, 0xE + bl sub_8027184 + b _08027A36 +_080279D0: + movs r0, 0xA + bl sub_8027184 + b _08027A36 +_080279D8: + ldr r0, _08027A18 + bl sub_8011988 + ldr r4, _08027A1C + ldr r1, [r4] + ldrb r0, [r1, 0x14] + cmp r0, 0 + beq _080279F0 + adds r0, r1, 0 + adds r0, 0x14 + bl sub_8091274 +_080279F0: + bl sub_80910B4 + ldr r0, [r4] + movs r1, 0 + strb r1, [r0, 0x14] + ldr r0, [r4] + strb r1, [r0, 0x15] + ldr r1, [r4] + movs r2, 0x8 + ldrsh r0, [r1, r2] + adds r1, 0x14 + bl sub_808D800 + bl nullsub_104 +_08027A0E: + movs r0, 0x2 + bl sub_8027184 + b _08027A36 + .align 2, 0 +_08027A18: .4byte 0x0000014d +_08027A1C: .4byte gUnknown_203B2BC +_08027A20: + movs r0, 0x4 + bl sub_8027184 + b _08027A36 +_08027A28: + movs r0, 0x5 + bl sub_8027184 + b _08027A36 +_08027A30: + movs r0, 0x2 + bl sub_8027184 +_08027A36: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80278B4 + + thumb_func_start sub_8027A40 +sub_8027A40: + push {lr} + bl sub_80244E4 + cmp r0, 0x1 + bls _08027A58 + cmp r0, 0x3 + bhi _08027A58 + bl sub_802453C + movs r0, 0x2 + bl sub_8027184 +_08027A58: + pop {r0} + bx r0 + thumb_func_end sub_8027A40 + + thumb_func_start sub_8027A5C +sub_8027A5C: + push {lr} + bl sub_801BF48 + cmp r0, 0x1 + bls _08027A74 + cmp r0, 0x3 + bhi _08027A74 + bl sub_801BF98 + movs r0, 0x2 + bl sub_8027184 +_08027A74: + pop {r0} + bx r0 + thumb_func_end sub_8027A5C + + thumb_func_start sub_8027A78 +sub_8027A78: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08027AD8 + ldr r0, [sp] + cmp r0, 0x2 + beq _08027AA2 + cmp r0, 0x2 + bgt _08027A96 + cmp r0, 0x1 + beq _08027A9A + b _08027AD8 +_08027A96: + cmp r0, 0x3 + bne _08027AD8 +_08027A9A: + movs r0, 0x2 + bl sub_8027184 + b _08027AD8 +_08027AA2: + ldr r0, _08027AB8 + ldr r0, [r0] + ldr r0, [r0, 0x18] + ldrb r0, [r0, 0x4] + subs r0, 0x44 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _08027ABC + movs r0, 0x1 + b _08027ABE + .align 2, 0 +_08027AB8: .4byte gUnknown_203B2BC +_08027ABC: + movs r0, 0 +_08027ABE: + cmp r0, 0 + beq _08027ACA + movs r0, 0x9 + bl sub_8027184 + b _08027AD8 +_08027ACA: + bl sub_8027EB8 + ldr r0, _08027AE0 + ldr r0, [r0] + ldr r0, [r0, 0x18] + bl sub_808D31C +_08027AD8: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08027AE0: .4byte gUnknown_203B2BC + thumb_func_end sub_8027A78 + + thumb_func_start sub_8027AE4 +sub_8027AE4: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08027B1C + ldr r0, [sp] + cmp r0, 0x2 + beq _08027B0E + cmp r0, 0x2 + bgt _08027B02 + cmp r0, 0x1 + beq _08027B06 + b _08027B1C +_08027B02: + cmp r0, 0x3 + bne _08027B1C +_08027B06: + movs r0, 0x2 + bl sub_8027184 + b _08027B1C +_08027B0E: + bl sub_8027EB8 + ldr r0, _08027B24 + ldr r0, [r0] + ldr r0, [r0, 0x18] + bl sub_808D31C +_08027B1C: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08027B24: .4byte gUnknown_203B2BC + thumb_func_end sub_8027AE4 + + thumb_func_start sub_8027B28 +sub_8027B28: + push {r4,lr} + movs r0, 0x1 + bl sub_801A6E8 + cmp r0, 0x4 + bhi _08027BD2 + lsls r0, 2 + ldr r1, _08027B40 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08027B40: .4byte _08027B44 + .align 2, 0 +_08027B44: + .4byte _08027BD2 + .4byte _08027BD2 + .4byte _08027BC8 + .4byte _08027B58 + .4byte _08027B8C +_08027B58: + bl sub_801A8AC + ldr r4, _08027B84 + ldr r2, [r4] + str r0, [r2, 0xC] + ldr r3, _08027B88 + ldr r1, [r3] + lsls r0, 2 + adds r1, r0 + ldrb r0, [r1, 0x2] + strb r0, [r2, 0x10] + ldr r2, [r4] + ldr r1, [r3] + ldr r0, [r2, 0xC] + lsls r0, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + strb r0, [r2, 0x11] + movs r0, 0xC + bl sub_8027184 + b _08027BD2 + .align 2, 0 +_08027B84: .4byte gUnknown_203B2BC +_08027B88: .4byte gUnknown_203B460 +_08027B8C: + bl sub_801A8AC + ldr r4, _08027BC0 + ldr r2, [r4] + str r0, [r2, 0xC] + ldr r3, _08027BC4 + ldr r1, [r3] + lsls r0, 2 + adds r1, r0 + ldrb r0, [r1, 0x2] + strb r0, [r2, 0x10] + ldr r2, [r4] + ldr r1, [r3] + ldr r0, [r2, 0xC] + lsls r0, 2 + adds r1, r0 + ldrb r0, [r1, 0x1] + strb r0, [r2, 0x11] + movs r0, 0 + bl sub_8099690 + movs r0, 0xD + bl sub_8027184 + b _08027BD2 + .align 2, 0 +_08027BC0: .4byte gUnknown_203B2BC +_08027BC4: .4byte gUnknown_203B460 +_08027BC8: + bl sub_801A928 + movs r0, 0x2 + bl sub_8027184 +_08027BD2: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8027B28 + + thumb_func_start sub_8027BD8 +sub_8027BD8: + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + bl sub_801A6E8 + ldr r4, _08027C18 + ldr r0, [r4] + adds r0, 0x7C + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _08027C08 + ldr r0, [r4] + adds r0, 0x7C + mov r1, sp + bl sub_8013114 + ldr r1, [sp] + cmp r1, 0x1 + beq _08027C08 + ldr r0, [r4] + str r1, [r0, 0x74] +_08027C08: + ldr r0, [sp] + cmp r0, 0x4 + beq _08027C68 + cmp r0, 0x4 + bgt _08027C1C + cmp r0, 0x1 + beq _08027C76 + b _08027C7C + .align 2, 0 +_08027C18: .4byte gUnknown_203B2BC +_08027C1C: + cmp r0, 0xA + bne _08027C7C + ldr r0, _08027C60 + bl sub_8011988 + ldr r4, _08027C64 + ldr r0, [r4] + ldr r0, [r0, 0xC] + bl sub_80911F8 + bl sub_80910B4 + ldr r1, [r4] + ldrb r0, [r1, 0x14] + cmp r0, 0 + beq _08027C44 + adds r0, r1, 0 + adds r0, 0x14 + bl sub_8091274 +_08027C44: + ldr r1, [r4] + movs r2, 0x8 + ldrsh r0, [r1, r2] + adds r1, 0x10 + bl sub_808D800 + bl sub_801A928 + bl nullsub_104 + movs r0, 0x2 + bl sub_8027184 + b _08027C7C + .align 2, 0 +_08027C60: .4byte 0x0000014d +_08027C64: .4byte gUnknown_203B2BC +_08027C68: + movs r0, 0 + bl sub_8099690 + movs r0, 0xD + bl sub_8027184 + b _08027C7C +_08027C76: + movs r0, 0xB + bl sub_8027184 +_08027C7C: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8027BD8 + + thumb_func_start sub_8027C84 +sub_8027C84: + push {lr} + bl sub_801B410 + cmp r0, 0x1 + bls _08027C9C + cmp r0, 0x3 + bhi _08027C9C + bl sub_801B450 + movs r0, 0xB + bl sub_8027184 +_08027C9C: + pop {r0} + bx r0 + thumb_func_end sub_8027C84 + + thumb_func_start sub_8027CA0 +sub_8027CA0: + push {lr} + movs r0, 0x1 + bl sub_801EF38 + cmp r0, 0x4 + bhi _08027CFA + lsls r0, 2 + ldr r1, _08027CB8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08027CB8: .4byte _08027CBC + .align 2, 0 +_08027CBC: + .4byte _08027CFA + .4byte _08027CFA + .4byte _08027CF0 + .4byte _08027CD0 + .4byte _08027CD0 +_08027CD0: + bl sub_801F194 + ldr r1, _08027CEC + ldr r1, [r1] + str r0, [r1, 0x20] + lsls r0, 3 + adds r0, r1, r0 + ldrh r0, [r0, 0x2A] + strh r0, [r1, 0x24] + movs r0, 0x10 + bl sub_8027184 + b _08027CFA + .align 2, 0 +_08027CEC: .4byte gUnknown_203B2BC +_08027CF0: + bl sub_801F214 + movs r0, 0x2 + bl sub_8027184 +_08027CFA: + pop {r0} + bx r0 + thumb_func_end sub_8027CA0 + + thumb_func_start sub_8027D00 +sub_8027D00: + push {lr} + bl sub_801F890 + cmp r0, 0x1 + bls _08027D18 + cmp r0, 0x3 + bhi _08027D18 + bl sub_801F8D0 + movs r0, 0xF + bl sub_8027184 +_08027D18: + pop {r0} + bx r0 + thumb_func_end sub_8027D00 + + thumb_func_start sub_8027D1C +sub_8027D1C: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08027D34 + ldr r0, _08027D3C + ldr r0, [r0] + ldr r0, [r0, 0x4] + bl sub_8027184 +_08027D34: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08027D3C: .4byte gUnknown_203B2BC + thumb_func_end sub_8027D1C + + thumb_func_start sub_8027D40 +sub_8027D40: + push {r4-r6,lr} + sub sp, 0x14 + adds r6, r0, 0 + adds r5, r1, 0 + bl sub_8008C54 + adds r0, r6, 0 + bl sub_80073B8 + add r4, sp, 0x10 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8090B64 + movs r5, 0 + str r5, [sp, 0x4] + add r0, sp, 0x4 + strb r5, [r0, 0x4] + adds r1, r0, 0 + movs r0, 0x1 + strb r0, [r1, 0x8] + strb r0, [r4] + ldr r0, _08027D94 + adds r1, r4, 0 + add r2, sp, 0x4 + bl sub_8090E14 + ldr r2, _08027D98 + str r5, [sp] + movs r0, 0x4 + movs r1, 0x3 + adds r3, r6, 0 + bl sub_8014FF0 + adds r0, r6, 0 + bl sub_80073E0 + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08027D94: .4byte gUnknown_202DE58 +_08027D98: .4byte gUnknown_80DD958 + thumb_func_end sub_8027D40 + + thumb_func_start sub_8027D9C +sub_8027D9C: + push {lr} + adds r1, r0, 0 + ldrb r0, [r1, 0x2] + cmp r0, 0 + bne _08027DC0 + movs r2, 0 + ldrb r0, [r1, 0x4] + cmp r0, 0x41 + bne _08027DB0 + movs r2, 0x1 +_08027DB0: + cmp r2, 0 + beq _08027DC4 + movs r0, 0x8 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + bne _08027DC4 +_08027DC0: + movs r0, 0 + b _08027DC6 +_08027DC4: + movs r0, 0x1 +_08027DC6: + pop {r1} + bx r1 + thumb_func_end sub_8027D9C + + thumb_func_start sub_8027DCC +sub_8027DCC: + push {r4,lr} + adds r4, r0, 0 + bl sub_808D3BC + cmp r0, r4 + beq _08027E0E + bl sub_808D3F8 + cmp r0, r4 + beq _08027E0E + ldrb r0, [r4, 0x2] + cmp r0, 0 + bne _08027E0E + movs r1, 0 + ldrb r0, [r4, 0x4] + cmp r0, 0x41 + bne _08027DF0 + movs r1, 0x1 +_08027DF0: + cmp r1, 0 + beq _08027E00 + movs r0, 0x8 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _08027E0E +_08027E00: + adds r0, r4, 0 + bl sub_8027E18 + cmp r0, 0x3 + beq _08027E0E + movs r0, 0x1 + b _08027E10 +_08027E0E: + movs r0, 0 +_08027E10: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8027DCC + + thumb_func_start sub_8027E18 +sub_8027E18: + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x28 + ldrb r0, [r0] + cmp r0, 0 + bne _08027E28 + movs r0, 0 + b _08027E46 +_08027E28: + bl sub_8090A34 + cmp r0, 0x13 + bgt _08027E34 + movs r0, 0x1 + b _08027E46 +_08027E34: + adds r0, r4, 0 + bl sub_8027E4C + lsls r0, 24 + cmp r0, 0 + bne _08027E44 + movs r0, 0x3 + b _08027E46 +_08027E44: + movs r0, 0x2 +_08027E46: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8027E18 + + thumb_func_start sub_8027E4C +sub_8027E4C: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r5, 0 + adds r4, 0x28 + ldrb r0, [r4] + bl sub_8091524 + lsls r0, 24 + cmp r0, 0 + beq _08027E88 + ldrb r0, [r4] + bl sub_8090A60 + lsls r0, 24 + cmp r0, 0 + beq _08027E94 + ldr r0, _08027E8C + ldr r1, [r0] + ldrb r0, [r4] + lsls r0, 1 + adds r1, 0x50 + adds r1, r0 + ldrh r1, [r1] + adds r0, r5, 0 + adds r0, 0x29 + ldrb r0, [r0] + adds r1, r0 + ldr r0, _08027E90 + cmp r1, r0 + ble _08027EA8 +_08027E88: + movs r0, 0 + b _08027EAA + .align 2, 0 +_08027E8C: .4byte gUnknown_203B460 +_08027E90: .4byte 0x000003e7 +_08027E94: + ldr r0, _08027EB0 + ldr r1, [r0] + ldrb r0, [r4] + lsls r0, 1 + adds r1, 0x50 + adds r1, r0 + ldrh r1, [r1] + ldr r0, _08027EB4 + cmp r1, r0 + bhi _08027E88 +_08027EA8: + movs r0, 0x1 +_08027EAA: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08027EB0: .4byte gUnknown_203B460 +_08027EB4: .4byte 0x000003e6 + thumb_func_end sub_8027E4C + + thumb_func_start sub_8027EB8 +sub_8027EB8: + push {r4,lr} + ldr r4, _08027ED4 + ldr r0, [r4] + ldr r0, [r0, 0x18] + bl sub_8027E18 + cmp r0, 0x1 + beq _08027ED8 + cmp r0, 0x1 + bcc _08027F7C + cmp r0, 0x2 + beq _08027F0C + b _08027F7C + .align 2, 0 +_08027ED4: .4byte gUnknown_203B2BC +_08027ED8: + ldr r0, _08027F08 + bl sub_8011988 + ldr r0, [r4] + adds r0, 0x14 + bl sub_8091274 + bl sub_80910B4 + ldr r0, [r4] + movs r1, 0 + strb r1, [r0, 0x14] + ldr r0, [r4] + strb r1, [r0, 0x15] + ldr r1, [r4] + movs r2, 0x8 + ldrsh r0, [r1, r2] + adds r1, 0x14 + bl sub_808D800 + movs r0, 0x6 + bl sub_8027184 + b _08027F82 + .align 2, 0 +_08027F08: .4byte 0x0000014d +_08027F0C: + ldr r0, _08027F38 + bl sub_8011988 + ldr r0, [r4] + ldrb r0, [r0, 0x14] + bl sub_8090A60 + lsls r0, 24 + cmp r0, 0 + beq _08027F40 + ldr r0, _08027F3C + ldr r1, [r0] + ldr r2, [r4] + ldrb r0, [r2, 0x14] + lsls r0, 1 + adds r1, 0x50 + adds r1, r0 + ldrh r0, [r1] + ldrb r2, [r2, 0x15] + adds r0, r2 + b _08027F52 + .align 2, 0 +_08027F38: .4byte 0x0000014d +_08027F3C: .4byte gUnknown_203B460 +_08027F40: + ldr r0, _08027F74 + ldr r1, [r0] + ldr r0, [r4] + ldrb r0, [r0, 0x14] + lsls r0, 1 + adds r1, 0x50 + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 +_08027F52: + strh r0, [r1] + ldr r1, _08027F78 + ldr r0, [r1] + movs r2, 0 + strb r2, [r0, 0x14] + ldr r0, [r1] + strb r2, [r0, 0x15] + ldr r1, [r1] + movs r2, 0x8 + ldrsh r0, [r1, r2] + adds r1, 0x14 + bl sub_808D800 + movs r0, 0x7 + bl sub_8027184 + b _08027F82 + .align 2, 0 +_08027F74: .4byte gUnknown_203B460 +_08027F78: .4byte gUnknown_203B2BC +_08027F7C: + movs r0, 0x2 + bl sub_8027184 +_08027F82: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8027EB8 + + thumb_func_start sub_8027F88 +sub_8027F88: + push {r4-r6,lr} + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r5, _08028050 + movs r4, 0xA9 + lsls r4, 3 + adds r0, r4, 0 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] + movs r1, 0 + adds r2, r4, 0 + bl MemoryFill8 + ldr r1, [r5] + ldr r2, _08028054 + adds r0, r1, r2 + movs r6, 0 + str r6, [r0] + movs r3, 0x86 + lsls r3, 2 + adds r1, r3 + movs r0, 0xFF + strb r0, [r1] + ldr r0, [r5] + ldr r1, _08028058 + adds r0, r1 + ldr r1, _0802805C + strh r1, [r0] + ldr r0, _08028060 + movs r4, 0x98 + lsls r4, 1 + adds r1, r4, 0 + bl sub_808D8E0 + adds r0, r4, 0 + bl sub_808D994 + adds r1, r0, 0 + ldr r0, _08028064 + bl strcpy + adds r0, r4, 0 + bl sub_808DDD0 + ldr r2, [r5] + movs r3, 0x84 + lsls r3, 3 + adds r1, r2, r3 + str r0, [r1] + adds r3, 0x4 + adds r1, r2, r3 + ldr r0, [r0, 0x4] + str r0, [r1] + ldr r0, _08028068 + adds r2, r0 + strb r6, [r2] + ldr r0, [r5] + ldr r1, _0802806C + adds r0, r1 + strb r6, [r0] + ldr r0, [r5] + ldr r2, _08028070 + adds r0, r2 + strb r6, [r0] + ldr r1, [r5] + adds r3, 0x4 + adds r2, r1, r3 + movs r0, 0x2 + strh r0, [r2] + ldr r0, _08028074 + adds r1, r0 + movs r0, 0x8 + strh r0, [r1] + movs r2, 0 + movs r3, 0 + adds r1, r5, 0 +_0802802E: + ldr r0, [r5] + adds r0, 0x8 + adds r0, r2 + strb r3, [r0] + adds r2, 0x1 + cmp r2, 0x35 + ble _0802802E + ldr r1, [r1] + movs r0, 0x3D + str r0, [r1] + movs r0, 0 + bl sub_8028B04 + movs r0, 0x1 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08028050: .4byte gUnknown_203B2C0 +_08028054: .4byte 0x0000053c +_08028058: .4byte 0x00000544 +_0802805C: .4byte 0x0000ffff +_08028060: .4byte gUnknown_202E5D8 +_08028064: .4byte gUnknown_202DF98 +_08028068: .4byte 0x0000042c +_0802806C: .4byte 0x0000042d +_08028070: .4byte 0x0000042e +_08028074: .4byte 0x0000042a + thumb_func_end sub_8027F88 + + thumb_func_start sub_8028078 +sub_8028078: + push {lr} + ldr r0, _08028090 + ldr r0, [r0] + ldr r0, [r0, 0x4] + cmp r0, 0x3C + bls _08028086 + b _080282D4 +_08028086: + lsls r0, 2 + ldr r1, _08028094 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08028090: .4byte gUnknown_203B2C0 +_08028094: .4byte _08028098 + .align 2, 0 +_08028098: + .4byte _080282C4 + .4byte _080282C4 + .4byte _080282CA + .4byte _080282D0 + .4byte _08028222 + .4byte _08028234 + .4byte _08028228 + .4byte _0802822E + .4byte _0802823A + .4byte _080281FE + .4byte _08028272 + .4byte _08028278 + .4byte _0802828C + .4byte _0802827E + .4byte _0802828C + .4byte _0802827E + .4byte _0802828C + .4byte _08028286 + .4byte _08028294 + .4byte _0802829A + .4byte _080282B2 + .4byte _080282B8 + .4byte _080282BE + .4byte _080282A0 + .4byte _080282A6 + .4byte _080282AC + .4byte _08028240 + .4byte _08028248 + .4byte _0802824E + .4byte _0802824E + .4byte _0802825A + .4byte _0802826C + .4byte _08028260 + .4byte _08028266 + .4byte _08028254 + .4byte _08028204 + .4byte _0802820A + .4byte _080282CA + .4byte _08028210 + .4byte _08028216 + .4byte _0802821C + .4byte _080281E0 + .4byte _080281F2 + .4byte _080281E6 + .4byte _080281EC + .4byte _080281DA + .4byte _080281D4 + .4byte _080281F8 + .4byte _080281CE + .4byte _080281C2 + .4byte _080281AA + .4byte _080281B0 + .4byte _080281B6 + .4byte _080281BC + .4byte _080281C8 + .4byte _080281A4 + .4byte _0802819E + .4byte _080282CA + .4byte _08028192 + .4byte _08028198 + .4byte _0802818C +_0802818C: + bl sub_8029B34 + b _080282D4 +_08028192: + bl sub_8029AD8 + b _080282D4 +_08028198: + bl sub_8029AF4 + b _080282D4 +_0802819E: + bl sub_8029A88 + b _080282D4 +_080281A4: + bl sub_8029AB0 + b _080282D4 +_080281AA: + bl sub_80297B8 + b _080282D4 +_080281B0: + bl sub_80297D4 + b _080282D4 +_080281B6: + bl sub_8029884 + b _080282D4 +_080281BC: + bl sub_8029944 + b _080282D4 +_080281C2: + bl sub_80299AC + b _080282D4 +_080281C8: + bl sub_80299D8 + b _080282D4 +_080281CE: + bl sub_8029A6C + b _080282D4 +_080281D4: + bl sub_8029A18 + b _080282D4 +_080281DA: + bl sub_80295A8 + b _080282D4 +_080281E0: + bl sub_8029668 + b _080282D4 +_080281E6: + bl sub_8029684 + b _080282D4 +_080281EC: + bl sub_8029740 + b _080282D4 +_080281F2: + bl sub_80295D8 + b _080282D4 +_080281F8: + bl sub_802979C + b _080282D4 +_080281FE: + bl sub_8029358 + b _080282D4 +_08028204: + bl sub_8029374 + b _080282D4 +_0802820A: + bl sub_802939C + b _080282D4 +_08028210: + bl sub_80293D8 + b _080282D4 +_08028216: + bl sub_80293F4 + b _080282D4 +_0802821C: + bl sub_802955C + b _080282D4 +_08028222: + bl sub_80292A4 + b _080282D4 +_08028228: + bl sub_80292EC + b _080282D4 +_0802822E: + bl sub_802933C + b _080282D4 +_08028234: + bl sub_802958C + b _080282D4 +_0802823A: + bl sub_8029208 + b _080282D4 +_08028240: + movs r0, 0x1 + bl sub_8028DE8 + b _080282D4 +_08028248: + bl sub_8028F80 + b _080282D4 +_0802824E: + bl sub_8028FC0 + b _080282D4 +_08028254: + bl sub_8028FDC + b _080282D4 +_0802825A: + bl sub_80290D4 + b _080282D4 +_08028260: + bl sub_80290F0 + b _080282D4 +_08028266: + bl sub_80291AC + b _080282D4 +_0802826C: + bl sub_8029044 + b _080282D4 +_08028272: + bl sub_8028CFC + b _080282D4 +_08028278: + bl sub_8028D4C + b _080282D4 +_0802827E: + movs r0, 0xA + bl sub_8028DE8 + b _080282D4 +_08028286: + bl sub_8028E08 + b _080282D4 +_0802828C: + movs r0, 0x19 + bl sub_8028DE8 + b _080282D4 +_08028294: + bl sub_8028E24 + b _080282D4 +_0802829A: + bl sub_8028E54 + b _080282D4 +_080282A0: + bl sub_8028E84 + b _080282D4 +_080282A6: + bl sub_8028EAC + b _080282D4 +_080282AC: + bl sub_8028ED4 + b _080282D4 +_080282B2: + bl sub_8028F04 + b _080282D4 +_080282B8: + bl sub_8028F30 + b _080282D4 +_080282BE: + bl sub_8028F58 + b _080282D4 +_080282C4: + bl sub_8028BF0 + b _080282D4 +_080282CA: + bl sub_8028CE0 + b _080282D4 +_080282D0: + movs r0, 0x3 + b _080282D6 +_080282D4: + movs r0, 0 +_080282D6: + pop {r1} + bx r1 + thumb_func_end sub_8028078 + + thumb_func_start sub_80282DC +sub_80282DC: + ldr r1, _080282F4 + ldr r1, [r1] + movs r3, 0x86 + lsls r3, 2 + adds r2, r1, r3 + ldrb r2, [r2] + strb r2, [r0] + ldr r0, _080282F8 + adds r1, r0 + ldr r0, [r1] + bx lr + .align 2, 0 +_080282F4: .4byte gUnknown_203B2C0 +_080282F8: .4byte 0x0000053c + thumb_func_end sub_80282DC + + thumb_func_start sub_80282FC +sub_80282FC: + push {r4,lr} + ldr r4, _08028340 + ldr r0, [r4] + cmp r0, 0 + beq _08028338 + movs r1, 0x84 + lsls r1, 3 + adds r0, r1 + ldr r0, [r0] + bl sub_800AA14 + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] + bl sub_8031E10 + bl sub_8023C60 + bl sub_803084C + bl sub_80155F0 + bl sub_80310B4 + bl sub_8030DE4 + bl sub_802453C +_08028338: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08028340: .4byte gUnknown_203B2C0 + thumb_func_end sub_80282FC + + thumb_func_start nullsub_130 +nullsub_130: + bx lr + thumb_func_end nullsub_130 + + thumb_func_start sub_8028348 +sub_8028348: + push {r4-r6,lr} + sub sp, 0x14 + ldr r1, _08028368 + ldr r0, [r1] + ldr r0, [r0, 0x4] + adds r6, r1, 0 + cmp r0, 0x3C + bls _0802835C + bl _08028AF2 +_0802835C: + lsls r0, 2 + ldr r1, _0802836C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08028368: .4byte gUnknown_203B2C0 +_0802836C: .4byte _08028370 + .align 2, 0 +_08028370: + .4byte _08028A84 + .4byte _08028AB4 + .4byte _08028AE0 + .4byte _08028AF2 + .4byte _08028650 + .4byte _08028660 + .4byte _08028678 + .4byte _08028AF2 + .4byte _08028802 + .4byte _08028640 + .4byte _0802890C + .4byte _08028948 + .4byte _08028988 + .4byte _08028978 + .4byte _080289A0 + .4byte _08028990 + .4byte _080289B8 + .4byte _080289B0 + .4byte _080289C8 + .4byte _080289E8 + .4byte _08028A48 + .4byte _08028A58 + .4byte _08028A68 + .4byte _080289F8 + .4byte _08028A08 + .4byte _08028A18 + .4byte _08028850 + .4byte _08028860 + .4byte _08028868 + .4byte _08028878 + .4byte _08028890 + .4byte _080288A0 + .4byte _080288C6 + .4byte _08028AF2 + .4byte _08028888 + .4byte _08028790 + .4byte _08028AF2 + .4byte _080287C4 + .4byte _080287D4 + .4byte _080287DC + .4byte _08028AF2 + .4byte _080285CC + .4byte _080285DC + .4byte _080288C6 + .4byte _08028AF2 + .4byte _080285AC + .4byte _08028610 + .4byte _080285F8 + .4byte _08028600 + .4byte _0802856C + .4byte _080284F4 + .4byte _0802850C + .4byte _08028532 + .4byte _08028AF2 + .4byte _0802859C + .4byte _080284B8 + .4byte _080284A8 + .4byte _080284EC + .4byte _080284A0 + .4byte _08028464 + .4byte _08028490 +_08028464: + ldr r0, [r6] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + bl sub_8006518 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r6] + movs r2, 0x86 + lsls r2, 2 + adds r0, r2 + ldrb r0, [r0] + movs r1, 0 + bl sub_8031D70 + b _08028AF2 +_08028490: + ldr r0, _0802849C + ldr r2, [r6] + movs r3, 0x84 + lsls r3, 3 + adds r2, r3 + b _08028A72 + .align 2, 0 +_0802849C: .4byte gUnknown_80DDBA8 +_080284A0: + ldr r0, _080284A4 + b _08028A6A + .align 2, 0 +_080284A4: .4byte gUnknown_80DDBFC +_080284A8: + ldr r0, _080284B4 + ldr r2, [r6] + movs r1, 0x84 + lsls r1, 3 + adds r2, r1 + b _08028A72 + .align 2, 0 +_080284B4: .4byte gUnknown_80DDC30 +_080284B8: + ldr r0, [r6] + ldr r2, _080284D0 + adds r0, r2 + ldr r0, [r0] + cmp r0, 0xE + bne _080284C6 + b _08028AF2 +_080284C6: + cmp r0, 0xE + bhi _080284D4 + cmp r0, 0xD + beq _080284DA + b _08028AF2 + .align 2, 0 +_080284D0: .4byte 0x00000534 +_080284D4: + cmp r0, 0x10 + bls _080284DA + b _08028AF2 +_080284DA: + ldr r0, _080284E8 + ldr r2, [r6] + movs r3, 0x84 + lsls r3, 3 + adds r2, r3 + b _08028A72 + .align 2, 0 +_080284E8: .4byte gUnknown_80DDC70 +_080284EC: + ldr r0, _080284F0 + b _08028A6A + .align 2, 0 +_080284F0: .4byte gUnknown_80DDC30 +_080284F4: + ldr r0, _08028504 + ldr r3, _08028508 + movs r1, 0 + movs r2, 0 + bl sub_80141B4 + b _08028AF2 + .align 2, 0 +_08028504: .4byte gUnknown_80DDCBC +_08028508: .4byte 0x00000101 +_0802850C: + bl sub_8023CE8 + cmp r0, 0 + beq _08028516 + b _08028AF2 +_08028516: + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + movs r3, 0x9 + bl sub_8023868 + b _08028AF2 +_08028532: + ldr r0, [r6] + movs r4, 0xD7 + lsls r4, 2 + adds r0, r4 + bl sub_8006518 + ldr r1, [r6] + movs r5, 0x87 + lsls r5, 2 + adds r0, r1, r5 + adds r1, r4 + ldr r3, _08028564 + ldr r2, _08028568 + str r2, [sp] + movs r2, 0x1 + str r2, [sp, 0x4] + movs r2, 0 + str r2, [sp, 0x8] + str r2, [sp, 0xC] + movs r2, 0x3 + bl sub_8035C3C + bl sub_8023DA4 + b _080288F6 + .align 2, 0 +_08028564: .4byte gUnknown_80DDAE4 +_08028568: .4byte gUnknown_80DDAFC +_0802856C: + ldr r0, _08028594 + ldr r3, _08028598 + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + ldr r1, [r6] + movs r2, 0x84 + lsls r2, 3 + adds r1, r2 + str r1, [sp, 0xC] + movs r1, 0xC + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0xA + bl sub_8014248 + b _08028AF2 + .align 2, 0 +_08028594: .4byte gUnknown_80DDD2C +_08028598: .4byte gUnknown_80DDAA0 +_0802859C: + ldr r0, _080285A4 + ldr r3, _080285A8 + b _08028A1C + .align 2, 0 +_080285A4: .4byte gUnknown_80DDD88 +_080285A8: .4byte gUnknown_80DDA80 +_080285AC: + ldr r0, _080285C4 + ldr r3, _080285C8 + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + ldr r1, [r6] + movs r2, 0x84 + lsls r2, 3 + adds r1, r2 + b _08028A2E + .align 2, 0 +_080285C4: .4byte gUnknown_80DDDBC +_080285C8: .4byte gUnknown_80DDA64 +_080285CC: + ldr r0, _080285D8 + ldr r2, [r6] + movs r3, 0x84 + lsls r3, 3 + adds r2, r3 + b _08028A72 + .align 2, 0 +_080285D8: .4byte gUnknown_80DDDD8 +_080285DC: + bl sub_8030894 + cmp r0, 0 + beq _080285E6 + b _08028AF2 +_080285E6: + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0x4 + b _080288BA +_080285F8: + ldr r0, _080285FC + b _08028A6A + .align 2, 0 +_080285FC: .4byte gUnknown_80DDE20 +_08028600: + ldr r0, _0802860C + ldr r2, [r6] + movs r1, 0x84 + lsls r1, 3 + adds r2, r1 + b _08028A72 + .align 2, 0 +_0802860C: .4byte gUnknown_80DDE58 +_08028610: + ldr r0, _08028638 + ldr r3, _0802863C + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + ldr r1, [r6] + movs r2, 0x84 + lsls r2, 3 + adds r1, r2 + str r1, [sp, 0xC] + movs r1, 0xC + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0x11 + bl sub_8014248 + b _08028AF2 + .align 2, 0 +_08028638: .4byte gUnknown_80DDEC0 +_0802863C: .4byte gUnknown_80DDB60 +_08028640: + ldr r0, _0802864C + ldr r2, [r6] + movs r3, 0x84 + lsls r3, 3 + adds r2, r3 + b _08028A72 + .align 2, 0 +_0802864C: .4byte gUnknown_80DDF2C +_08028650: + ldr r0, _08028658 + ldr r3, _0802865C + b _08028A1C + .align 2, 0 +_08028658: .4byte gUnknown_80DDFB8 +_0802865C: .4byte gUnknown_80DDA48 +_08028660: + movs r0, 0 + bl nullsub_23 + ldr r0, _08028674 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_80141B4 + b _08028AF2 + .align 2, 0 +_08028674: .4byte gUnknown_80DE01C +_08028678: + ldr r1, [r6] + movs r0, 0 + str r0, [r1, 0x44] + bl sub_8011830 + ldr r0, [r6] + ldr r0, [r0, 0x40] + bl sub_8037B28 + adds r4, r0, 0 + ldr r0, [r6] + str r4, [r0, 0x44] + cmp r4, 0 + bne _0802878A + ldr r1, [r0, 0x40] + cmp r1, 0x3 + beq _080286A0 + cmp r1, 0x4 + beq _080286C2 + b _08028748 +_080286A0: + adds r0, 0x48 + movs r1, 0 + movs r2, 0x30 + bl MemoryFill8 + ldr r0, [r6] + adds r0, 0x78 + movs r1, 0 + movs r2, 0x30 + bl MemoryFill8 + ldr r2, [r6] + ldr r0, [r2, 0x40] + adds r1, r2, 0 + adds r1, 0x48 + adds r2, 0x78 + b _08028740 +_080286C2: + adds r0, 0xA8 + movs r1, 0 + movs r2, 0x88 + bl MemoryFill8 + ldr r0, [r6] + movs r5, 0x98 + lsls r5, 1 + adds r0, r5 + movs r1, 0 + movs r2, 0x88 + bl MemoryFill8 + ldr r1, [r6] + adds r0, r1, 0 + adds r0, 0xE0 + strh r4, [r0] + movs r2, 0xB4 + lsls r2, 1 + adds r0, r1, r2 + strh r4, [r0] + movs r3, 0x86 + lsls r3, 2 + adds r0, r1, r3 + ldrb r0, [r0] + bl sub_8095228 + ldr r1, [r6] + adds r1, 0xA8 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r2, [r6] + ldr r4, _08028760 + adds r3, r2, r4 + movs r0, 0 + ldrsh r1, [r3, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08028736 + adds r0, r2, 0 + adds r0, 0xD8 + ldr r1, _08028764 + ldr r1, [r1] + movs r2, 0 + ldrsh r3, [r3, r2] + movs r2, 0x58 + muls r2, r3 + adds r1, r2 + movs r2, 0x58 + bl memcpy +_08028736: + ldr r2, [r6] + ldr r0, [r2, 0x40] + adds r1, r2, 0 + adds r1, 0xA8 + adds r2, r5 +_08028740: + bl sub_8037D64 + ldr r1, [r6] + str r0, [r1, 0x44] +_08028748: + ldr r4, _08028768 + ldr r2, [r4] + ldr r0, [r2, 0x44] + cmp r0, 0 + bne _0802878A + ldr r0, [r2, 0x40] + cmp r0, 0x3 + beq _0802876C + cmp r0, 0x4 + beq _08028776 + b _0802878A + .align 2, 0 +_08028760: .4byte 0x00000544 +_08028764: .4byte gUnknown_203B45C +_08028768: .4byte gUnknown_203B2C0 +_0802876C: + adds r1, r2, 0 + adds r1, 0x48 + adds r2, 0x78 + movs r0, 0x3 + b _08028782 +_08028776: + adds r1, r2, 0 + adds r1, 0xA8 + movs r3, 0x98 + lsls r3, 1 + adds r2, r3 + movs r0, 0x4 +_08028782: + bl sub_80381F4 + ldr r1, [r4] + str r0, [r1, 0x44] +_0802878A: + bl sub_8011854 + b _08028AF2 +_08028790: + ldr r0, [r6] + ldr r4, _080287A8 + adds r0, r4 + ldr r0, [r0] + cmp r0, 0xE + bne _0802879E + b _08028AF2 +_0802879E: + cmp r0, 0xE + bhi _080287AC + cmp r0, 0xD + beq _080287B2 + b _08028AF2 + .align 2, 0 +_080287A8: .4byte 0x00000534 +_080287AC: + cmp r0, 0x10 + bls _080287B2 + b _08028AF2 +_080287B2: + ldr r0, _080287C0 + ldr r2, [r6] + movs r1, 0x84 + lsls r1, 3 + adds r2, r1 + b _08028A72 + .align 2, 0 +_080287C0: .4byte gUnknown_80DE06C +_080287C4: + ldr r0, _080287D0 + ldr r2, [r6] + movs r3, 0x84 + lsls r3, 3 + adds r2, r3 + b _08028A72 + .align 2, 0 +_080287D0: .4byte gUnknown_80DE0C0 +_080287D4: + ldr r0, _080287D8 + b _08028A6A + .align 2, 0 +_080287D8: .4byte gUnknown_80DE124 +_080287DC: + ldr r0, [r6] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + bl sub_8006518 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r1, [r6] + adds r1, 0x8 + movs r0, 0x4 + bl sub_80151C0 + b _08028AF2 +_08028802: + ldr r4, [r6] + movs r2, 0xA7 + lsls r2, 3 + adds r0, r4, r2 + ldr r2, [r0] + cmp r2, 0 + beq _08028816 + cmp r2, 0x2 + beq _08028824 + b _08028AF2 +_08028816: + ldr r0, _0802881C + ldr r3, _08028820 + b _0802882A + .align 2, 0 +_0802881C: .4byte gUnknown_80DE178 +_08028820: .4byte gUnknown_80DDB24 +_08028824: + ldr r0, _08028848 + ldr r3, _0802884C + movs r2, 0 +_0802882A: + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + movs r2, 0x84 + lsls r2, 3 + adds r1, r4, r2 + str r1, [sp, 0xC] + movs r1, 0xC + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0xD + bl sub_8014248 + b _08028AF2 + .align 2, 0 +_08028848: .4byte gUnknown_80DE1B4 +_0802884C: .4byte gUnknown_80DDB24 +_08028850: + ldr r0, _0802885C + ldr r2, [r6] + movs r3, 0x84 + lsls r3, 3 + adds r2, r3 + b _08028A72 + .align 2, 0 +_0802885C: .4byte gUnknown_80DE1E4 +_08028860: + ldr r0, _08028864 + b _08028A6A + .align 2, 0 +_08028864: .4byte gUnknown_80DE280 +_08028868: + ldr r0, _08028874 + ldr r2, [r6] + movs r1, 0x84 + lsls r1, 3 + adds r2, r1 + b _08028A72 + .align 2, 0 +_08028874: .4byte gUnknown_80DE2B0 +_08028878: + ldr r0, _08028884 + ldr r2, [r6] + movs r3, 0x84 + lsls r3, 3 + adds r2, r3 + b _08028A72 + .align 2, 0 +_08028884: .4byte gUnknown_80DE368 +_08028888: + ldr r0, _0802888C + b _08028A1A + .align 2, 0 +_0802888C: .4byte gUnknown_80DDDBC +_08028890: + ldr r0, _0802889C + ldr r2, [r6] + movs r1, 0x84 + lsls r1, 3 + adds r2, r1 + b _08028A72 + .align 2, 0 +_0802889C: .4byte gUnknown_80DE430 +_080288A0: + bl sub_8030894 + cmp r0, 0 + beq _080288AA + b _08028AF2 +_080288AA: + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0x2 +_080288BA: + movs r1, 0 + movs r2, 0 + movs r3, 0x6 + bl sub_80306A8 + b _08028AF2 +_080288C6: + ldr r0, [r6] + movs r4, 0xD7 + lsls r4, 2 + adds r0, r4 + bl sub_8006518 + ldr r1, [r6] + movs r5, 0x87 + lsls r5, 2 + adds r0, r1, r5 + adds r1, r4 + ldr r3, _08028904 + ldr r2, _08028908 + str r2, [sp] + movs r2, 0x1 + str r2, [sp, 0x4] + movs r2, 0 + str r2, [sp, 0x8] + str r2, [sp, 0xC] + movs r2, 0x3 + bl sub_8035C3C + bl sub_803092C +_080288F6: + ldr r0, [r6] + adds r0, r5 + movs r1, 0x3 + movs r2, 0x1 + bl sub_8035CF4 + b _08028AF2 + .align 2, 0 +_08028904: .4byte gUnknown_80DDACC +_08028908: .4byte gUnknown_80DDAFC +_0802890C: + bl sub_8095350 + ldr r1, _0802893C + ldr r1, [r1] + movs r3, 0xA8 + lsls r3, 3 + adds r2, r1, r3 + str r0, [r2] + movs r4, 0xA7 + lsls r4, 3 + adds r1, r4 + ldr r1, [r1] + cmp r1, 0x6 + beq _08028940 + cmp r1, 0x6 + bls _0802892E + b _08028AF2 +_0802892E: + cmp r1, 0x5 + beq _08028934 + b _08028AF2 +_08028934: + movs r0, 0x2 + bl sub_8030F58 + b _08028AF2 + .align 2, 0 +_0802893C: .4byte gUnknown_203B2C0 +_08028940: + movs r0, 0x4 + bl sub_8030F58 + b _08028AF2 +_08028948: + ldr r0, _08028970 + ldr r3, _08028974 + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + ldr r1, [r6] + movs r2, 0x84 + lsls r2, 3 + adds r1, r2 + str r1, [sp, 0xC] + movs r1, 0xC + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0x5 + bl sub_8014248 + b _08028AF2 + .align 2, 0 +_08028970: .4byte gUnknown_80DE48C +_08028974: .4byte gUnknown_80DD9EC +_08028978: + ldr r0, _08028984 + ldr r2, [r6] + movs r3, 0x84 + lsls r3, 3 + adds r2, r3 + b _08028A72 + .align 2, 0 +_08028984: .4byte gUnknown_80DE4B8 +_08028988: + ldr r0, _0802898C + b _08028A6A + .align 2, 0 +_0802898C: .4byte gUnknown_80DE4F0 +_08028990: + ldr r0, _0802899C + ldr r2, [r6] + movs r1, 0x84 + lsls r1, 3 + adds r2, r1 + b _08028A72 + .align 2, 0 +_0802899C: .4byte gUnknown_80DE524 +_080289A0: + ldr r0, _080289AC + ldr r2, [r6] + movs r3, 0x84 + lsls r3, 3 + adds r2, r3 + b _08028A72 + .align 2, 0 +_080289AC: .4byte gUnknown_80DE614 +_080289B0: + ldr r0, _080289B4 + b _08028A6A + .align 2, 0 +_080289B4: .4byte gUnknown_80DE648 +_080289B8: + ldr r0, _080289C4 + ldr r2, [r6] + movs r1, 0x84 + lsls r1, 3 + adds r2, r1 + b _08028A72 + .align 2, 0 +_080289C4: .4byte gUnknown_80DE694 +_080289C8: + ldr r0, _080289E0 + ldr r3, _080289E4 + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + ldr r1, [r6] + movs r2, 0x84 + lsls r2, 3 + adds r1, r2 + b _08028A2E + .align 2, 0 +_080289E0: .4byte gUnknown_80DE6D4 +_080289E4: .4byte gUnknown_80DDA48 +_080289E8: + ldr r0, _080289F0 + ldr r3, _080289F4 + b _08028A1C + .align 2, 0 +_080289F0: .4byte gUnknown_80DE754 +_080289F4: .4byte gUnknown_80DDA48 +_080289F8: + ldr r0, _08028A04 + ldr r2, [r6] + movs r1, 0x84 + lsls r1, 3 + adds r2, r1 + b _08028A72 + .align 2, 0 +_08028A04: .4byte gUnknown_80DE7B8 +_08028A08: + ldr r0, _08028A14 + ldr r2, [r6] + movs r3, 0x84 + lsls r3, 3 + adds r2, r3 + b _08028A72 + .align 2, 0 +_08028A14: .4byte gUnknown_80DE7E8 +_08028A18: + ldr r0, _08028A40 +_08028A1A: + ldr r3, _08028A44 +_08028A1C: + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + ldr r1, [r6] + movs r4, 0x84 + lsls r4, 3 + adds r1, r4 +_08028A2E: + str r1, [sp, 0xC] + movs r1, 0xC + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0x8 + bl sub_8014248 + b _08028AF2 + .align 2, 0 +_08028A40: .4byte gUnknown_80DE808 +_08028A44: .4byte gUnknown_80DDA64 +_08028A48: + ldr r0, _08028A54 + ldr r2, [r6] + movs r1, 0x84 + lsls r1, 3 + adds r2, r1 + b _08028A72 + .align 2, 0 +_08028A54: .4byte gUnknown_80DE830 +_08028A58: + ldr r0, _08028A64 + ldr r2, [r6] + movs r3, 0x84 + lsls r3, 3 + adds r2, r3 + b _08028A72 + .align 2, 0 +_08028A64: .4byte gUnknown_80DE864 +_08028A68: + ldr r0, _08028A7C +_08028A6A: + ldr r2, [r6] + movs r4, 0x84 + lsls r4, 3 + adds r2, r4 +_08028A72: + ldr r3, _08028A80 + movs r1, 0 + bl sub_80141B4 + b _08028AF2 + .align 2, 0 +_08028A7C: .4byte gUnknown_80DE7E8 +_08028A80: .4byte 0x0000010d +_08028A84: + ldr r0, _08028AAC + ldr r3, _08028AB0 + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + ldr r1, [r6] + movs r2, 0x84 + lsls r2, 3 + adds r1, r2 + str r1, [sp, 0xC] + movs r1, 0xC + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0 + bl sub_8014248 + b _08028AF2 + .align 2, 0 +_08028AAC: .4byte gUnknown_80DE8B4 +_08028AB0: .4byte gUnknown_80DD970 +_08028AB4: + ldr r0, _08028AD8 + ldr r3, _08028ADC + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + ldr r1, [r6] + movs r4, 0x84 + lsls r4, 3 + adds r1, r4 + str r1, [sp, 0xC] + movs r1, 0xC + str r1, [sp, 0x10] + movs r1, 0 + bl sub_8014248 + b _08028AF2 + .align 2, 0 +_08028AD8: .4byte gUnknown_80DE918 +_08028ADC: .4byte gUnknown_80DD970 +_08028AE0: + ldr r0, _08028AFC + ldr r2, [r6] + movs r1, 0x84 + lsls r1, 3 + adds r2, r1 + ldr r3, _08028B00 + movs r1, 0 + bl sub_80141B4 +_08028AF2: + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08028AFC: .4byte gUnknown_80DE93C +_08028B00: .4byte 0x0000010d + thumb_func_end sub_8028348 + + thumb_func_start sub_8028B04 +sub_8028B04: + push {lr} + ldr r1, _08028B18 + ldr r1, [r1] + str r0, [r1, 0x4] + bl nullsub_130 + bl sub_8028348 + pop {r0} + bx r0 + .align 2, 0 +_08028B18: .4byte gUnknown_203B2C0 + thumb_func_end sub_8028B04 + + thumb_func_start sub_8028B1C +sub_8028B1C: + push {lr} + cmp r0, 0xF + bhi _08028BE0 + lsls r0, 2 + ldr r1, _08028B2C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08028B2C: .4byte _08028B30 + .align 2, 0 +_08028B30: + .4byte _08028BE0 + .4byte _08028BA8 + .4byte _08028BA8 + .4byte _08028B70 + .4byte _08028B78 + .4byte _08028BA8 + .4byte _08028B80 + .4byte _08028B88 + .4byte _08028BE0 + .4byte _08028B90 + .4byte _08028BE0 + .4byte _08028B98 + .4byte _08028BE0 + .4byte _08028BA0 + .4byte _08028BA8 + .4byte _08028BCC +_08028B70: + ldr r0, _08028B74 + b _08028BAA + .align 2, 0 +_08028B74: .4byte gUnknown_80DE98C +_08028B78: + ldr r0, _08028B7C + b _08028BAA + .align 2, 0 +_08028B7C: .4byte gUnknown_80DE9F0 +_08028B80: + ldr r0, _08028B84 + b _08028BAA + .align 2, 0 +_08028B84: .4byte gUnknown_80DEA58 +_08028B88: + ldr r0, _08028B8C + b _08028BAA + .align 2, 0 +_08028B8C: .4byte gUnknown_80DEAB4 +_08028B90: + ldr r0, _08028B94 + b _08028BAA + .align 2, 0 +_08028B94: .4byte gUnknown_80DEB18 +_08028B98: + ldr r0, _08028B9C + b _08028BAA + .align 2, 0 +_08028B9C: .4byte gUnknown_80DEB18 +_08028BA0: + ldr r0, _08028BA4 + b _08028BAA + .align 2, 0 +_08028BA4: .4byte gUnknown_80DEB54 +_08028BA8: + ldr r0, _08028BC0 +_08028BAA: + ldr r1, _08028BC4 + ldr r2, [r1] + movs r1, 0x84 + lsls r1, 3 + adds r2, r1 + ldr r3, _08028BC8 + movs r1, 0 + bl sub_80141B4 + b _08028BE0 + .align 2, 0 +_08028BC0: .4byte gUnknown_80DE954 +_08028BC4: .4byte gUnknown_203B2C0 +_08028BC8: .4byte 0x0000010d +_08028BCC: + ldr r0, _08028BE4 + ldr r1, _08028BE8 + ldr r2, [r1] + movs r1, 0x84 + lsls r1, 3 + adds r2, r1 + ldr r3, _08028BEC + movs r1, 0 + bl sub_80141B4 +_08028BE0: + pop {r0} + bx r0 + .align 2, 0 +_08028BE4: .4byte gUnknown_80DEC00 +_08028BE8: .4byte gUnknown_203B2C0 +_08028BEC: .4byte 0x0000010d + thumb_func_end sub_8028B1C + + thumb_func_start sub_8028BF0 +sub_8028BF0: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08028CDA + ldr r2, _08028C20 + ldr r0, [r2] + movs r1, 0x8 + str r1, [r0, 0x40] + ldr r1, _08028C24 + adds r0, r1 + ldr r1, _08028C28 + strh r1, [r0] + ldr r0, [sp] + cmp r0, 0xA + bhi _08028CDA + lsls r0, 2 + ldr r1, _08028C2C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08028C20: .4byte gUnknown_203B2C0 +_08028C24: .4byte 0x00000544 +_08028C28: .4byte 0x0000ffff +_08028C2C: .4byte _08028C30 + .align 2, 0 +_08028C30: + .4byte _08028C5C + .4byte _08028C88 + .4byte _08028CA2 + .4byte _08028CCC + .4byte _08028CDA + .4byte _08028CDA + .4byte _08028CDA + .4byte _08028CDA + .4byte _08028CDA + .4byte _08028CDA + .4byte _08028CD4 +_08028C5C: + ldr r0, [r2] + movs r1, 0x3 + str r1, [r0, 0x40] + movs r1, 0xA7 + lsls r1, 3 + adds r0, r1 + movs r1, 0 + str r1, [r0] + bl sub_8095190 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _08028C80 + movs r0, 0x8 + bl sub_8028B04 + b _08028CDA +_08028C80: + movs r0, 0x9 + bl sub_8028B04 + b _08028CDA +_08028C88: + movs r0, 0x2 + bl sub_8095324 + cmp r0, 0 + beq _08028C9A + movs r0, 0x1E + bl sub_8028B04 + b _08028CDA +_08028C9A: + movs r0, 0x1A + bl sub_8028B04 + b _08028CDA +_08028CA2: + ldr r0, [r2] + movs r1, 0x4 + str r1, [r0, 0x40] + movs r1, 0xA7 + lsls r1, 3 + adds r0, r1 + movs r1, 0x2 + str r1, [r0] + movs r0, 0x4 + bl sub_8095324 + cmp r0, 0 + beq _08028CC4 + movs r0, 0x29 + bl sub_8028B04 + b _08028CDA +_08028CC4: + movs r0, 0x2F + bl sub_8028B04 + b _08028CDA +_08028CCC: + movs r0, 0xB + bl sub_8028B04 + b _08028CDA +_08028CD4: + movs r0, 0x2 + bl sub_8028B04 +_08028CDA: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8028BF0 + + thumb_func_start sub_8028CE0 +sub_8028CE0: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08028CF4 + movs r0, 0x3 + bl sub_8028B04 +_08028CF4: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8028CE0 + + thumb_func_start sub_8028CFC +sub_8028CFC: + push {r4,lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08028D42 + bl sub_8031050 + cmp r0, 0x3 + bhi _08028D42 + cmp r0, 0x2 + bcc _08028D42 + bl sub_8095350 + adds r4, r0, 0 + bl sub_80310B4 + ldr r0, _08028D38 + ldr r0, [r0] + movs r1, 0xA8 + lsls r1, 3 + adds r0, r1 + ldr r0, [r0] + cmp r4, r0 + beq _08028D3C + movs r0, 0x17 + bl sub_8028B04 + b _08028D42 + .align 2, 0 +_08028D38: .4byte gUnknown_203B2C0 +_08028D3C: + movs r0, 0x19 + bl sub_8028B04 +_08028D42: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8028CFC + + thumb_func_start sub_8028D4C +sub_8028D4C: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08028DE0 + ldr r0, _08028D78 + ldr r0, [r0] + movs r1, 0xA7 + lsls r1, 3 + adds r0, r1 + ldr r1, [sp] + str r1, [r0] + cmp r1, 0x6 + beq _08028DA2 + cmp r1, 0x6 + bgt _08028D7C + cmp r1, 0x5 + beq _08028D86 + b _08028DE0 + .align 2, 0 +_08028D78: .4byte gUnknown_203B2C0 +_08028D7C: + cmp r1, 0x7 + beq _08028DBE + cmp r1, 0xA + beq _08028DDA + b _08028DE0 +_08028D86: + movs r0, 0x2 + bl sub_8030C20 + lsls r0, 24 + cmp r0, 0 + beq _08028D9A + movs r0, 0xC + bl sub_8028B04 + b _08028DE0 +_08028D9A: + movs r0, 0xD + bl sub_8028B04 + b _08028DE0 +_08028DA2: + movs r0, 0x4 + bl sub_8030C20 + lsls r0, 24 + cmp r0, 0 + beq _08028DB6 + movs r0, 0xE + bl sub_8028B04 + b _08028DE0 +_08028DB6: + movs r0, 0xF + bl sub_8028B04 + b _08028DE0 +_08028DBE: + movs r0, 0 + bl sub_8030C20 + lsls r0, 24 + cmp r0, 0 + beq _08028DD2 + movs r0, 0x10 + bl sub_8028B04 + b _08028DE0 +_08028DD2: + movs r0, 0x11 + bl sub_8028B04 + b _08028DE0 +_08028DDA: + movs r0, 0x1 + bl sub_8028B04 +_08028DE0: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8028D4C + + thumb_func_start sub_8028DE8 +sub_8028DE8: + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08028DFE + adds r0, r4, 0 + bl sub_8028B04 +_08028DFE: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8028DE8 + + thumb_func_start sub_8028E08 +sub_8028E08: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08028E1C + movs r0, 0x12 + bl sub_8028B04 +_08028E1C: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8028E08 + + thumb_func_start sub_8028E24 +sub_8028E24: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08028E4C + ldr r0, [sp] + cmp r0, 0x8 + beq _08028E3E + cmp r0, 0xA + beq _08028E46 + b _08028E4C +_08028E3E: + movs r0, 0x13 + bl sub_8028B04 + b _08028E4C +_08028E46: + movs r0, 0x1 + bl sub_8028B04 +_08028E4C: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8028E24 + + thumb_func_start sub_8028E54 +sub_8028E54: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08028E7C + ldr r0, [sp] + cmp r0, 0x8 + beq _08028E6E + cmp r0, 0xA + beq _08028E76 + b _08028E7C +_08028E6E: + movs r0, 0x14 + bl sub_8028B04 + b _08028E7C +_08028E76: + movs r0, 0x1 + bl sub_8028B04 +_08028E7C: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8028E54 + + thumb_func_start sub_8028E84 +sub_8028E84: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08028EA4 + movs r0, 0x18 + bl sub_8028B04 + movs r0, 0x1 + bl sub_8011C28 + movs r0, 0 + bl sub_8012574 +_08028EA4: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8028E84 + + thumb_func_start sub_8028EAC +sub_8028EAC: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08028ECE + bl sub_8012600 + lsls r0, 24 + cmp r0, 0 + bne _08028ECE + bl sub_8012750 + movs r0, 0x19 + bl sub_8028B04 +_08028ECE: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8028EAC + + thumb_func_start sub_8028ED4 +sub_8028ED4: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08028EFE + ldr r0, [sp] + cmp r0, 0x8 + bne _08028EF0 + movs r0, 0xB + bl sub_8028B04 + b _08028EFE +_08028EF0: + cmp r0, 0x8 + blt _08028EFE + cmp r0, 0xA + bgt _08028EFE + movs r0, 0x2 + bl sub_8028B04 +_08028EFE: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8028ED4 + + thumb_func_start sub_8028F04 +sub_8028F04: + push {r4,lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08028F28 + movs r4, 0 +_08028F14: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8095240 + adds r4, 0x1 + cmp r4, 0x1F + ble _08028F14 + movs r0, 0x15 + bl sub_8028B04 +_08028F28: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8028F04 + + thumb_func_start sub_8028F30 +sub_8028F30: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08028F50 + movs r0, 0x16 + bl sub_8028B04 + movs r0, 0x1 + bl sub_8011C28 + movs r0, 0 + bl sub_8012574 +_08028F50: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8028F30 + + thumb_func_start sub_8028F58 +sub_8028F58: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08028F7A + bl sub_8012600 + lsls r0, 24 + cmp r0, 0 + bne _08028F7A + bl sub_8012750 + movs r0, 0x2 + bl sub_8028B04 +_08028F7A: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8028F58 + + thumb_func_start sub_8028F80 +sub_8028F80: + push {r4,lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08028FAE + ldr r4, _08028FB8 + ldr r0, [r4] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + bl sub_809927C + ldr r0, [r4] + ldr r1, _08028FBC + adds r0, r1 + movs r1, 0x1 + str r1, [r0] + movs r0, 0x3 + bl sub_8028B04 +_08028FAE: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08028FB8: .4byte gUnknown_203B2C0 +_08028FBC: .4byte 0x0000053c + thumb_func_end sub_8028F80 + + thumb_func_start sub_8028FC0 +sub_8028FC0: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08028FD4 + movs r0, 0x1 + bl sub_8028B04 +_08028FD4: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8028FC0 + + thumb_func_start sub_8028FDC +sub_8028FDC: + push {r4,lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802903C + ldr r0, [sp] + cmp r0, 0x8 + beq _08028FFC + cmp r0, 0x8 + blt _0802903C + cmp r0, 0xA + bgt _0802903C + movs r0, 0x1 + b _08029038 +_08028FFC: + ldr r0, _08029020 + ldr r0, [r0] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + bl sub_8095228 + adds r4, r0, 0 + ldrb r0, [r4, 0x4] + bl sub_80A2824 + lsls r0, 24 + cmp r0, 0 + bne _08029024 + movs r0, 0x1C + b _08029038 + .align 2, 0 +_08029020: .4byte gUnknown_203B2C0 +_08029024: + adds r0, r4, 0 + adds r0, 0x2C + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r0, 0 + bgt _08029036 + movs r0, 0x1D + b _08029038 +_08029036: + movs r0, 0x1B +_08029038: + bl sub_8028B04 +_0802903C: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8028FDC + + thumb_func_start sub_8029044 +sub_8029044: + push {r4,r5,lr} + movs r0, 0x1 + bl sub_8030768 + cmp r0, 0x3 + beq _0802906C + cmp r0, 0x3 + bhi _0802905A + cmp r0, 0x2 + beq _08029060 + b _080290CA +_0802905A: + cmp r0, 0x4 + beq _08029088 + b _080290CA +_08029060: + bl sub_803084C + movs r0, 0x1 + bl sub_8028B04 + b _080290CA +_0802906C: + bl sub_80307EC + ldr r1, _08029084 + ldr r1, [r1] + movs r2, 0x86 + lsls r2, 2 + adds r1, r2 + strb r0, [r1] + movs r0, 0x20 + bl sub_8028B04 + b _080290CA + .align 2, 0 +_08029084: .4byte gUnknown_203B2C0 +_08029088: + ldr r4, _080290D0 + ldr r1, [r4] + movs r0, 0x1F + str r0, [r1] + bl sub_80307EC + ldr r1, [r4] + movs r5, 0x86 + lsls r5, 2 + adds r1, r5 + strb r0, [r1] + ldr r0, [r4] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + bl sub_8006518 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + adds r0, r5 + ldrb r0, [r0] + movs r1, 0 + bl sub_8030D40 + movs r0, 0x21 + bl sub_8028B04 +_080290CA: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080290D0: .4byte gUnknown_203B2C0 + thumb_func_end sub_8029044 + + thumb_func_start sub_80290D4 +sub_80290D4: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080290E8 + movs r0, 0x1F + bl sub_8028B04 +_080290E8: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80290D4 + + thumb_func_start sub_80290F0 +sub_80290F0: + push {r4,lr} + sub sp, 0x4 + movs r0, 0x1 + negs r0, r0 + str r0, [sp] + movs r0, 0 + bl sub_8030768 + ldr r4, _08029134 + ldr r0, [r4] + movs r1, 0xC3 + lsls r1, 2 + adds r0, r1 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _08029122 + ldr r0, [r4] + movs r1, 0xC3 + lsls r1, 2 + adds r0, r1 + mov r1, sp + bl sub_8013114 +_08029122: + ldr r0, [sp] + cmp r0, 0xA + beq _08029184 + cmp r0, 0xA + bgt _08029138 + cmp r0, 0x4 + beq _08029184 + b _080291A0 + .align 2, 0 +_08029134: .4byte gUnknown_203B2C0 +_08029138: + cmp r0, 0xB + beq _08029142 + cmp r0, 0xC + beq _0802914E + b _080291A0 +_08029142: + bl sub_803084C + movs r0, 0x22 + bl sub_8028B04 + b _080291A0 +_0802914E: + ldr r0, [r4] + movs r1, 0x3D + str r1, [r0] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + bl sub_8006518 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0 + bl sub_8030D40 + movs r0, 0x21 + bl sub_8028B04 + b _080291A0 +_08029184: + ldr r0, _080291A8 + ldr r0, [r0] + movs r1, 0xD7 + lsls r1, 2 + adds r0, r1 + movs r1, 0x2 + bl sub_8035CC0 + movs r0, 0x1 + bl sub_8030810 + movs r0, 0x1F + bl sub_8028B04 +_080291A0: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080291A8: .4byte gUnknown_203B2C0 + thumb_func_end sub_80290F0 + + thumb_func_start sub_80291AC +sub_80291AC: + push {r4,lr} + bl sub_8030DA0 + cmp r0, 0x3 + bhi _08029200 + cmp r0, 0x2 + bcc _08029200 + bl sub_8030DE4 + bl sub_8004914 + ldr r4, _080291F8 + ldr r0, [r4] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + bl sub_803092C + ldr r4, [r4] + ldr r0, [r4] + cmp r0, 0x3D + bne _080291FC + movs r1, 0x87 + lsls r1, 2 + adds r0, r4, r1 + movs r1, 0x3 + movs r2, 0x1 + bl sub_8035CF4 + movs r0, 0x20 + bl sub_8028B04 + b _08029200 + .align 2, 0 +_080291F8: .4byte gUnknown_203B2C0 +_080291FC: + bl sub_8028B04 +_08029200: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80291AC + + thumb_func_start sub_8029208 +sub_8029208: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802929E + ldr r2, [sp] + cmp r2, 0xE + bgt _08029226 + cmp r2, 0xD + bge _0802922C + cmp r2, 0xA + beq _08029298 + b _0802929E +_08029226: + cmp r2, 0xF + beq _08029264 + b _0802929E +_0802922C: + ldr r0, _0802924C + ldr r0, [r0] + ldr r1, _08029250 + adds r2, r0, r1 + movs r1, 0xD + str r1, [r2] + movs r3, 0xA7 + lsls r3, 3 + adds r0, r3 + ldr r0, [r0] + cmp r0, 0 + beq _08029254 + cmp r0, 0x2 + beq _0802925C + b _0802929E + .align 2, 0 +_0802924C: .4byte gUnknown_203B2C0 +_08029250: .4byte 0x00000534 +_08029254: + movs r0, 0x4 + bl sub_8028B04 + b _0802929E +_0802925C: + movs r0, 0x30 + bl sub_8028B04 + b _0802929E +_08029264: + ldr r0, _08029280 + ldr r0, [r0] + ldr r3, _08029284 + adds r1, r0, r3 + str r2, [r1] + movs r1, 0xA7 + lsls r1, 3 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + beq _08029288 + cmp r0, 0x2 + beq _08029290 + b _0802929E + .align 2, 0 +_08029280: .4byte gUnknown_203B2C0 +_08029284: .4byte 0x00000534 +_08029288: + movs r0, 0x26 + bl sub_8028B04 + b _0802929E +_08029290: + movs r0, 0x3A + bl sub_8028B04 + b _0802929E +_08029298: + movs r0, 0x1 + bl sub_8028B04 +_0802929E: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8029208 + + thumb_func_start sub_80292A4 +sub_80292A4: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080292E6 + ldr r0, [sp] + cmp r0, 0x8 + beq _080292BE + cmp r0, 0xA + beq _080292E0 + b _080292E6 +_080292BE: + ldr r0, _080292DC + ldr r0, [r0] + movs r1, 0xA7 + lsls r1, 3 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + beq _080292D2 + cmp r0, 0x2 + bne _080292E6 +_080292D2: + movs r0, 0x5 + bl sub_8028B04 + b _080292E6 + .align 2, 0 +_080292DC: .4byte gUnknown_203B2C0 +_080292E0: + movs r0, 0x1 + bl sub_8028B04 +_080292E6: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80292A4 + + thumb_func_start sub_80292EC +sub_80292EC: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08029336 + ldr r0, _08029318 + ldr r1, [r0] + ldr r0, [r1, 0x44] + cmp r0, 0 + bne _0802932C + movs r2, 0xA7 + lsls r2, 3 + adds r0, r1, r2 + ldr r0, [r0] + cmp r0, 0 + beq _0802931C + cmp r0, 0x2 + beq _08029324 + b _08029336 + .align 2, 0 +_08029318: .4byte gUnknown_203B2C0 +_0802931C: + movs r0, 0x23 + bl sub_8028B04 + b _08029336 +_08029324: + movs r0, 0x37 + bl sub_8028B04 + b _08029336 +_0802932C: + bl sub_8028B1C + movs r0, 0x7 + bl sub_8028B04 +_08029336: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80292EC + + thumb_func_start sub_802933C +sub_802933C: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08029350 + movs r0, 0x1 + bl sub_8028B04 +_08029350: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_802933C + + thumb_func_start sub_8029358 +sub_8029358: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802936C + movs r0, 0x1 + bl sub_8028B04 +_0802936C: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8029358 + + thumb_func_start sub_8029374 +sub_8029374: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08029394 + movs r0, 0x24 + bl sub_8028B04 + movs r0, 0x1 + bl sub_8011C28 + movs r0, 0 + bl sub_8012574 +_08029394: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8029374 + + thumb_func_start sub_802939C +sub_802939C: + push {r4,lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080293D0 + bl sub_8012600 + lsls r0, 24 + cmp r0, 0 + bne _080293D0 + bl sub_8012744 + adds r4, r0, 0 + bl sub_8012750 + cmp r4, 0 + bne _080293CA + movs r0, 0x25 + bl sub_8028B04 + b _080293D0 +_080293CA: + movs r0, 0x2 + bl sub_8028B04 +_080293D0: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_802939C + + thumb_func_start sub_80293D8 +sub_80293D8: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080293EC + movs r0, 0x27 + bl sub_8028B04 +_080293EC: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80293D8 + + thumb_func_start sub_80293F4 +sub_80293F4: + push {r4,lr} + sub sp, 0x44 + bl sub_80154F0 + adds r4, r0, 0 + add r0, sp, 0x14 + movs r1, 0 + movs r2, 0x30 + bl MemoryFill8 + cmp r4, 0x2 + bne _0802940E + b _08029530 +_0802940E: + cmp r4, 0x3 + beq _08029414 + b _08029550 +_08029414: + ldr r0, _08029434 + ldr r1, [r0] + adds r1, 0x8 + movs r0, 0x1C + add r2, sp, 0x14 + bl sub_8039068 + subs r0, 0x7 + cmp r0, 0x11 + bls _0802942A + b _0802951C +_0802942A: + lsls r0, 2 + ldr r1, _08029438 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08029434: .4byte gUnknown_203B2C0 +_08029438: .4byte _0802943C + .align 2, 0 +_0802943C: + .4byte _080294C8 + .4byte _0802951C + .4byte _0802951C + .4byte _0802951C + .4byte _0802951C + .4byte _0802951C + .4byte _0802951C + .4byte _0802951C + .4byte _0802951C + .4byte _0802951C + .4byte _08029484 + .4byte _080294C0 + .4byte _0802951C + .4byte _0802951C + .4byte _0802951C + .4byte _080294F0 + .4byte _0802951C + .4byte _0802951C +_08029484: + ldr r0, _080294B4 + ldr r3, _080294B8 + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + ldr r1, _080294BC + ldr r1, [r1] + movs r2, 0x84 + lsls r2, 3 + adds r1, r2 + str r1, [sp, 0xC] + movs r1, 0xC + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0x8 + bl sub_8014248 + movs r0, 0x28 + bl sub_8028B04 + b _0802951C + .align 2, 0 +_080294B4: .4byte gUnknown_80DEC70 +_080294B8: .4byte gUnknown_80DDA48 +_080294BC: .4byte gUnknown_203B2C0 +_080294C0: + ldr r0, _080294C4 + b _080294CA + .align 2, 0 +_080294C4: .4byte gUnknown_80DECC0 +_080294C8: + ldr r0, _080294E4 +_080294CA: + ldr r1, _080294E8 + ldr r2, [r1] + movs r1, 0x84 + lsls r1, 3 + adds r2, r1 + ldr r3, _080294EC + movs r1, 0 + bl sub_80141B4 + movs r0, 0x7 + bl sub_8028B04 + b _0802951C + .align 2, 0 +_080294E4: .4byte gUnknown_80DEAB4 +_080294E8: .4byte gUnknown_203B2C0 +_080294EC: .4byte 0x0000010d +_080294F0: + ldr r0, [sp, 0x24] + bl sub_8095274 + add r1, sp, 0x14 + movs r0, 0x2 + strb r0, [r1] + adds r0, r1, 0 + bl sub_80951BC + ldr r0, _08029524 + ldr r1, _08029528 + ldr r2, [r1] + movs r1, 0x84 + lsls r1, 3 + adds r2, r1 + ldr r3, _0802952C + movs r1, 0 + bl sub_80141B4 + movs r0, 0x23 + bl sub_8028B04 +_0802951C: + bl sub_80155F0 + b _08029550 + .align 2, 0 +_08029524: .4byte gUnknown_80DECFC +_08029528: .4byte gUnknown_203B2C0 +_0802952C: .4byte 0x00000101 +_08029530: + bl sub_80155F0 + bl sub_8004914 + ldr r0, _08029558 + ldr r0, [r0] + movs r2, 0xEF + lsls r2, 2 + adds r0, r2 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0x1 + bl sub_8028B04 +_08029550: + add sp, 0x44 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08029558: .4byte gUnknown_203B2C0 + thumb_func_end sub_80293F4 + + thumb_func_start sub_802955C +sub_802955C: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08029584 + ldr r0, [sp] + cmp r0, 0x8 + beq _08029576 + cmp r0, 0xA + beq _0802957E + b _08029584 +_08029576: + movs r0, 0x26 + bl sub_8028B04 + b _08029584 +_0802957E: + movs r0, 0x1 + bl sub_8028B04 +_08029584: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_802955C + + thumb_func_start sub_802958C +sub_802958C: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080295A0 + movs r0, 0x6 + bl sub_8028B04 +_080295A0: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_802958C + + thumb_func_start sub_80295A8 +sub_80295A8: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080295D2 + ldr r0, [sp] + cmp r0, 0x8 + bne _080295C4 + movs r0, 0x8 + bl sub_8028B04 + b _080295D2 +_080295C4: + cmp r0, 0x8 + blt _080295D2 + cmp r0, 0xA + bgt _080295D2 + movs r0, 0x1 + bl sub_8028B04 +_080295D2: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80295A8 + + thumb_func_start sub_80295D8 +sub_80295D8: + push {r4,r5,lr} + movs r0, 0x1 + bl sub_8030768 + cmp r0, 0x3 + beq _08029600 + cmp r0, 0x3 + bhi _080295EE + cmp r0, 0x2 + beq _080295F4 + b _0802965E +_080295EE: + cmp r0, 0x4 + beq _0802961C + b _0802965E +_080295F4: + bl sub_803084C + movs r0, 0x1 + bl sub_8028B04 + b _0802965E +_08029600: + bl sub_80307EC + ldr r1, _08029618 + ldr r1, [r1] + movs r2, 0x86 + lsls r2, 2 + adds r1, r2 + strb r0, [r1] + movs r0, 0x2B + bl sub_8028B04 + b _0802965E + .align 2, 0 +_08029618: .4byte gUnknown_203B2C0 +_0802961C: + ldr r4, _08029664 + ldr r1, [r4] + movs r0, 0x2A + str r0, [r1] + bl sub_80307EC + ldr r1, [r4] + movs r5, 0x86 + lsls r5, 2 + adds r1, r5 + strb r0, [r1] + ldr r0, [r4] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + bl sub_8006518 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + adds r0, r5 + ldrb r0, [r0] + movs r1, 0 + bl sub_8030D40 + movs r0, 0x2C + bl sub_8028B04 +_0802965E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08029664: .4byte gUnknown_203B2C0 + thumb_func_end sub_80295D8 + + thumb_func_start sub_8029668 +sub_8029668: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802967C + movs r0, 0x2A + bl sub_8028B04 +_0802967C: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8029668 + + thumb_func_start sub_8029684 +sub_8029684: + push {r4,lr} + sub sp, 0x4 + movs r0, 0x1 + negs r0, r0 + str r0, [sp] + movs r0, 0 + bl sub_8030768 + ldr r4, _080296C8 + ldr r0, [r4] + movs r1, 0xC3 + lsls r1, 2 + adds r0, r1 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _080296B6 + ldr r0, [r4] + movs r1, 0xC3 + lsls r1, 2 + adds r0, r1 + mov r1, sp + bl sub_8013114 +_080296B6: + ldr r0, [sp] + cmp r0, 0xA + beq _08029718 + cmp r0, 0xA + bgt _080296CC + cmp r0, 0x4 + beq _08029718 + b _08029734 + .align 2, 0 +_080296C8: .4byte gUnknown_203B2C0 +_080296CC: + cmp r0, 0xB + beq _080296D6 + cmp r0, 0xC + beq _080296E2 + b _08029734 +_080296D6: + bl sub_803084C + movs r0, 0x2D + bl sub_8028B04 + b _08029734 +_080296E2: + ldr r0, [r4] + movs r1, 0x3D + str r1, [r0] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + bl sub_8006518 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0 + bl sub_8030D40 + movs r0, 0x2C + bl sub_8028B04 + b _08029734 +_08029718: + ldr r0, _0802973C + ldr r0, [r0] + movs r1, 0xD7 + lsls r1, 2 + adds r0, r1 + movs r1, 0x2 + bl sub_8035CC0 + movs r0, 0x1 + bl sub_8030810 + movs r0, 0x2A + bl sub_8028B04 +_08029734: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802973C: .4byte gUnknown_203B2C0 + thumb_func_end sub_8029684 + + thumb_func_start sub_8029740 +sub_8029740: + push {r4,lr} + bl sub_8030DA0 + cmp r0, 0x3 + bhi _08029794 + cmp r0, 0x2 + bcc _08029794 + bl sub_8030DE4 + bl sub_8004914 + ldr r4, _0802978C + ldr r0, [r4] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + bl sub_803092C + ldr r4, [r4] + ldr r0, [r4] + cmp r0, 0x3D + bne _08029790 + movs r1, 0x87 + lsls r1, 2 + adds r0, r4, r1 + movs r1, 0x3 + movs r2, 0x1 + bl sub_8035CF4 + movs r0, 0x2B + bl sub_8028B04 + b _08029794 + .align 2, 0 +_0802978C: .4byte gUnknown_203B2C0 +_08029790: + bl sub_8028B04 +_08029794: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8029740 + + thumb_func_start sub_802979C +sub_802979C: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080297B0 + movs r0, 0x1 + bl sub_8028B04 +_080297B0: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_802979C + + thumb_func_start sub_80297B8 +sub_80297B8: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080297CC + movs r0, 0x33 + bl sub_8028B04 +_080297CC: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80297B8 + + thumb_func_start sub_80297D4 +sub_80297D4: + push {r4,r5,lr} + movs r0, 0x1 + bl sub_8023A94 + cmp r0, 0x3 + beq _08029814 + cmp r0, 0x3 + bhi _080297EA + cmp r0, 0x2 + beq _080297F0 + b _08029876 +_080297EA: + cmp r0, 0x4 + beq _08029834 + b _08029876 +_080297F0: + bl sub_8023C60 + movs r0, 0x1 + bl sub_8028B04 + ldr r0, _08029808 + ldr r0, [r0] + ldr r1, _0802980C + adds r0, r1 + ldr r1, _08029810 + strh r1, [r0] + b _08029876 + .align 2, 0 +_08029808: .4byte gUnknown_203B2C0 +_0802980C: .4byte 0x00000544 +_08029810: .4byte 0x0000ffff +_08029814: + bl sub_8023B44 + ldr r1, _0802982C + ldr r1, [r1] + ldr r2, _08029830 + adds r1, r2 + strh r0, [r1] + movs r0, 0x34 + bl sub_8028B04 + b _08029876 + .align 2, 0 +_0802982C: .4byte gUnknown_203B2C0 +_08029830: .4byte 0x00000544 +_08029834: + ldr r4, _0802987C + ldr r1, [r4] + movs r0, 0x33 + str r0, [r1] + bl sub_8023B44 + adds r2, r0, 0 + ldr r0, [r4] + ldr r5, _08029880 + adds r1, r0, r5 + strh r2, [r1] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + bl sub_8006518 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + adds r0, r5 + movs r2, 0 + ldrsh r0, [r0, r2] + movs r1, 0 + bl sub_8024458 + movs r0, 0x35 + bl sub_8028B04 +_08029876: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802987C: .4byte gUnknown_203B2C0 +_08029880: .4byte 0x00000544 + thumb_func_end sub_80297D4 + + thumb_func_start sub_8029884 +sub_8029884: + push {r4,lr} + sub sp, 0x4 + movs r0, 0x1 + negs r0, r0 + str r0, [sp] + movs r0, 0 + bl sub_8023A94 + ldr r4, _080298C8 + ldr r0, [r4] + movs r1, 0xC3 + lsls r1, 2 + adds r0, r1 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _080298B6 + ldr r0, [r4] + movs r1, 0xC3 + lsls r1, 2 + adds r0, r1 + mov r1, sp + bl sub_8013114 +_080298B6: + ldr r0, [sp] + cmp r0, 0xA + beq _0802991C + cmp r0, 0xA + bgt _080298CC + cmp r0, 0x4 + beq _0802991C + b _08029938 + .align 2, 0 +_080298C8: .4byte gUnknown_203B2C0 +_080298CC: + cmp r0, 0xB + beq _080298D6 + cmp r0, 0xC + beq _080298E2 + b _08029938 +_080298D6: + bl sub_8023C60 + movs r0, 0x4 + bl sub_8028B04 + b _08029938 +_080298E2: + ldr r0, [r4] + movs r1, 0x3D + str r1, [r0] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + bl sub_8006518 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + ldr r1, _08029918 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + movs r1, 0 + bl sub_8024458 + movs r0, 0x35 + bl sub_8028B04 + b _08029938 + .align 2, 0 +_08029918: .4byte 0x00000544 +_0802991C: + ldr r0, _08029940 + ldr r0, [r0] + movs r1, 0xD7 + lsls r1, 2 + adds r0, r1 + movs r1, 0x3 + bl sub_8035CC0 + movs r0, 0x1 + bl sub_8023B7C + movs r0, 0x33 + bl sub_8028B04 +_08029938: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08029940: .4byte gUnknown_203B2C0 + thumb_func_end sub_8029884 + + thumb_func_start sub_8029944 +sub_8029944: + push {r4,lr} + bl sub_80244E4 + cmp r0, 0x1 + bne _08029954 + bl sub_802452C + b _080299A4 +_08029954: + cmp r0, 0x1 + bcc _080299A4 + cmp r0, 0x3 + bhi _080299A4 + bl sub_802453C + bl sub_8004914 + ldr r4, _0802999C + ldr r0, [r4] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0x1 + bl sub_8023B7C + ldr r4, [r4] + ldr r0, [r4] + cmp r0, 0x3D + bne _080299A0 + movs r1, 0x87 + lsls r1, 2 + adds r0, r4, r1 + movs r1, 0x3 + movs r2, 0x1 + bl sub_8035CF4 + movs r0, 0x34 + bl sub_8028B04 + b _080299A4 + .align 2, 0 +_0802999C: .4byte gUnknown_203B2C0 +_080299A0: + bl sub_8028B04 +_080299A4: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8029944 + + thumb_func_start sub_80299AC +sub_80299AC: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080299D2 + ldr r0, [sp] + cmp r0, 0xA + beq _080299CC + cmp r0, 0x12 + bne _080299D2 + movs r0, 0x4 + bl sub_8028B04 + b _080299D2 +_080299CC: + movs r0, 0x1 + bl sub_8028B04 +_080299D2: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80299AC + + thumb_func_start sub_80299D8 +sub_80299D8: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08029A12 + ldr r0, [sp] + cmp r0, 0x9 + beq _08029A04 + cmp r0, 0x9 + bgt _080299F6 + cmp r0, 0x8 + beq _080299FC + b _08029A12 +_080299F6: + cmp r0, 0xA + beq _08029A0C + b _08029A12 +_080299FC: + movs r0, 0x4 + bl sub_8028B04 + b _08029A12 +_08029A04: + movs r0, 0x32 + bl sub_8028B04 + b _08029A12 +_08029A0C: + movs r0, 0x1 + bl sub_8028B04 +_08029A12: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80299D8 + + thumb_func_start sub_8029A18 +sub_8029A18: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08029A66 + ldr r0, [sp] + cmp r0, 0x11 + beq _08029A3C + cmp r0, 0x11 + bgt _08029A36 + cmp r0, 0xA + beq _08029A60 + b _08029A66 +_08029A36: + cmp r0, 0x12 + beq _08029A58 + b _08029A66 +_08029A3C: + movs r0, 0x3 + bl sub_8024108 + lsls r0, 24 + cmp r0, 0 + beq _08029A50 + movs r0, 0x31 + bl sub_8028B04 + b _08029A66 +_08029A50: + movs r0, 0x32 + bl sub_8028B04 + b _08029A66 +_08029A58: + movs r0, 0x4 + bl sub_8028B04 + b _08029A66 +_08029A60: + movs r0, 0x1 + bl sub_8028B04 +_08029A66: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8029A18 + + thumb_func_start sub_8029A6C +sub_8029A6C: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08029A80 + movs r0, 0x2E + bl sub_8028B04 +_08029A80: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8029A6C + + thumb_func_start sub_8029A88 +sub_8029A88: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08029AAA + bl sub_8012600 + lsls r0, 24 + cmp r0, 0 + bne _08029AAA + bl sub_8012750 + movs r0, 0x39 + bl sub_8028B04 +_08029AAA: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8029A88 + + thumb_func_start sub_8029AB0 +sub_8029AB0: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08029AD0 + movs r0, 0x38 + bl sub_8028B04 + movs r0, 0x1 + bl sub_8011C28 + movs r0, 0 + bl sub_8012574 +_08029AD0: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8029AB0 + + thumb_func_start sub_8029AD8 +sub_8029AD8: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08029AEC + movs r0, 0x3B + bl sub_8028B04 +_08029AEC: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8029AD8 + + thumb_func_start sub_8029AF4 +sub_8029AF4: + push {lr} + bl sub_8031DCC + cmp r0, 0x1 + beq _08029B2C + cmp r0, 0x1 + bcc _08029B30 + cmp r0, 0x3 + bhi _08029B30 + bl sub_8031E10 + bl sub_8004914 + ldr r0, _08029B28 + ldr r0, [r0] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0x3C + bl sub_8028B04 + b _08029B30 + .align 2, 0 +_08029B28: .4byte gUnknown_203B2C0 +_08029B2C: + bl sub_8031E00 +_08029B30: + pop {r0} + bx r0 + thumb_func_end sub_8029AF4 + + thumb_func_start sub_8029B34 +sub_8029B34: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08029B48 + movs r0, 0x3 + bl sub_8028B04 +_08029B48: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8029B34 + + thumb_func_start sub_8029B50 +sub_8029B50: + push {r4,r5,lr} + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r5, _08029C3C + ldr r4, _08029C40 + adds r0, r4, 0 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] + movs r1, 0 + adds r2, r4, 0 + bl MemoryFill8 + ldr r0, _08029C44 + movs r4, 0x98 + lsls r4, 1 + adds r1, r4, 0 + bl sub_808D8E0 + adds r0, r4, 0 + bl sub_808D994 + adds r1, r0, 0 + ldr r0, _08029C48 + bl strcpy + adds r0, r4, 0 + bl sub_808DDD0 + ldr r2, [r5] + movs r3, 0x84 + lsls r3, 3 + adds r1, r2, r3 + str r0, [r1] + adds r3, 0x4 + adds r1, r2, r3 + ldr r0, [r0, 0x4] + str r0, [r1] + ldr r0, _08029C4C + adds r2, r0 + movs r1, 0 + strb r1, [r2] + ldr r0, [r5] + ldr r2, _08029C50 + adds r0, r2 + strb r1, [r0] + ldr r0, [r5] + adds r3, 0xA + adds r0, r3 + strb r1, [r0] + ldr r1, [r5] + movs r0, 0x85 + lsls r0, 3 + adds r2, r1, r0 + movs r0, 0x2 + strh r0, [r2] + ldr r2, _08029C54 + adds r1, r2 + movs r0, 0x8 + strh r0, [r1] + movs r1, 0 + movs r2, 0 +_08029BD8: + ldr r0, [r5] + adds r0, 0x8 + adds r0, r1 + strb r2, [r0] + adds r1, 0x1 + cmp r1, 0x35 + ble _08029BD8 + ldr r5, _08029C3C + ldr r1, [r5] + ldr r3, _08029C58 + adds r2, r1, r3 + movs r0, 0x3 + str r0, [r2] + movs r0, 0xA7 + lsls r0, 3 + adds r1, r0 + movs r0, 0x1 + str r0, [r1] + movs r0, 0x6 + bl sub_80953D4 + adds r4, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r4, r0 + beq _08029C60 + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8095228 + ldr r1, [r5] + ldr r2, _08029C5C + adds r3, r1, r2 + ldr r2, [r0, 0x20] + str r2, [r3] + movs r3, 0x86 + lsls r3, 2 + adds r1, r3 + strb r4, [r1] + ldr r1, [r5] + movs r2, 0x86 + lsls r2, 3 + adds r1, r2 + ldr r0, [r0, 0x10] + str r0, [r1] + movs r0, 0x5 + bl sub_802B2BC + b _08029C7C + .align 2, 0 +_08029C3C: .4byte gUnknown_203B2C4 +_08029C40: .4byte 0x00000564 +_08029C44: .4byte gUnknown_202E5D8 +_08029C48: .4byte gUnknown_202DF98 +_08029C4C: .4byte 0x0000042c +_08029C50: .4byte 0x0000042d +_08029C54: .4byte 0x0000042a +_08029C58: .4byte 0x00000534 +_08029C5C: .4byte 0x0000041c +_08029C60: + ldr r1, [r5] + ldr r3, _08029C8C + adds r2, r1, r3 + ldr r0, _08029C90 + ldr r0, [r0] + str r0, [r2] + movs r0, 0x86 + lsls r0, 2 + adds r1, r0 + movs r0, 0xFF + strb r0, [r1] + movs r0, 0 + bl sub_802B2BC +_08029C7C: + ldr r0, _08029C94 + ldr r1, [r0] + movs r0, 0x2B + str r0, [r1, 0x4] + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08029C8C: .4byte 0x0000041c +_08029C90: .4byte gUnknown_80DED44 +_08029C94: .4byte gUnknown_203B2C4 + thumb_func_end sub_8029B50 + + thumb_func_start sub_8029C98 +sub_8029C98: + push {lr} + ldr r0, _08029CB0 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x2A + bls _08029CA6 + b _08029E58 +_08029CA6: + lsls r0, 2 + ldr r1, _08029CB4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08029CB0: .4byte gUnknown_203B2C4 +_08029CB4: .4byte _08029CB8 + .align 2, 0 +_08029CB8: + .4byte _08029E48 + .4byte _08029E48 + .4byte _08029E4E + .4byte _08029E54 + .4byte _08029E42 + .4byte _08029D64 + .4byte _08029E3C + .4byte _08029E30 + .4byte _08029E36 + .4byte _08029E2A + .4byte _08029E24 + .4byte _08029E1E + .4byte _08029E0C + .4byte _08029E06 + .4byte _08029D76 + .4byte _08029D7C + .4byte _08029D8E + .4byte _08029D82 + .4byte _08029D88 + .4byte _08029D94 + .4byte _08029D9A + .4byte _08029DA0 + .4byte _08029DE8 + .4byte _08029DF4 + .4byte _08029DEE + .4byte _08029DB2 + .4byte _08029DB8 + .4byte _08029DAC + .4byte _08029DA6 + .4byte _08029DFA + .4byte _08029D6A + .4byte _08029D70 + .4byte _08029E00 + .4byte _08029DDC + .4byte _08029DE2 + .4byte _08029E58 + .4byte _08029DD6 + .4byte _08029DD0 + .4byte _08029DC4 + .4byte _08029DCA + .4byte _08029DBE + .4byte _08029E12 + .4byte _08029E18 +_08029D64: + bl sub_802AB7C + b _08029E58 +_08029D6A: + bl sub_8029F98 + b _08029E58 +_08029D70: + bl sub_8029EA8 + b _08029E58 +_08029D76: + bl sub_802A090 + b _08029E58 +_08029D7C: + bl sub_802A158 + b _08029E58 +_08029D82: + bl sub_802A174 + b _08029E58 +_08029D88: + bl sub_802A230 + b _08029E58 +_08029D8E: + bl sub_802A0C8 + b _08029E58 +_08029D94: + bl sub_802A28C + b _08029E58 +_08029D9A: + bl sub_802A39C + b _08029E58 +_08029DA0: + bl sub_802A33C + b _08029E58 +_08029DA6: + bl sub_802A458 + b _08029E58 +_08029DAC: + bl sub_802A4AC + b _08029E58 +_08029DB2: + bl sub_802A4D4 + b _08029E58 +_08029DB8: + bl sub_802A050 + b _08029E58 +_08029DBE: + bl sub_802A9FC + b _08029E58 +_08029DC4: + bl sub_802A4F0 + b _08029E58 +_08029DCA: + bl sub_802A50C + b _08029E58 +_08029DD0: + bl sub_802A6B4 + b _08029E58 +_08029DD6: + bl sub_802A718 + b _08029E58 +_08029DDC: + bl sub_802AB60 + b _08029E58 +_08029DE2: + bl sub_802AB98 + b _08029E58 +_08029DE8: + bl sub_802A740 + b _08029E58 +_08029DEE: + bl sub_802A68C + b _08029E58 +_08029DF4: + bl sub_802A6F0 + b _08029E58 +_08029DFA: + bl sub_802A75C + b _08029E58 +_08029E00: + bl sub_802A490 + b _08029E58 +_08029E06: + bl sub_802A474 + b _08029E58 +_08029E0C: + bl sub_802A798 + b _08029E58 +_08029E12: + bl sub_802A828 + b _08029E58 +_08029E18: + bl sub_802A850 + b _08029E58 +_08029E1E: + bl sub_802A8A0 + b _08029E58 +_08029E24: + bl sub_802A8BC + b _08029E58 +_08029E2A: + bl sub_802A910 + b _08029E58 +_08029E30: + bl sub_802A98C + b _08029E58 +_08029E36: + bl sub_802A9A8 + b _08029E58 +_08029E3C: + bl sub_802AA28 + b _08029E58 +_08029E42: + bl sub_802AAAC + b _08029E58 +_08029E48: + bl sub_802AAE4 + b _08029E58 +_08029E4E: + bl sub_802AAC8 + b _08029E58 +_08029E54: + movs r0, 0x3 + b _08029E5A +_08029E58: + movs r0, 0 +_08029E5A: + pop {r1} + bx r1 + thumb_func_end sub_8029C98 + + thumb_func_start sub_8029E60 +sub_8029E60: + push {r4,lr} + ldr r4, _08029EA4 + ldr r0, [r4] + cmp r0, 0 + beq _08029E9C + movs r1, 0x84 + lsls r1, 3 + adds r0, r1 + ldr r0, [r0] + bl sub_800AA14 + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] + bl sub_8030DE4 + bl sub_801B450 + bl sub_803084C + bl sub_801CBB8 + bl sub_80155F0 + bl sub_8031E10 + bl sub_802F2C0 +_08029E9C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08029EA4: .4byte gUnknown_203B2C4 + thumb_func_end sub_8029E60 + + thumb_func_start sub_8029EA8 +sub_8029EA8: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08029EBC + movs r0, 0x1 + bl sub_802B2BC +_08029EBC: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8029EA8 + + thumb_func_start sub_8029EC4 +sub_8029EC4: + push {lr} + cmp r0, 0xF + bhi _08029F88 + lsls r0, 2 + ldr r1, _08029ED4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08029ED4: .4byte _08029ED8 + .align 2, 0 +_08029ED8: + .4byte _08029F88 + .4byte _08029F50 + .4byte _08029F50 + .4byte _08029F18 + .4byte _08029F20 + .4byte _08029F50 + .4byte _08029F28 + .4byte _08029F30 + .4byte _08029F88 + .4byte _08029F38 + .4byte _08029F88 + .4byte _08029F40 + .4byte _08029F88 + .4byte _08029F48 + .4byte _08029F50 + .4byte _08029F74 +_08029F18: + ldr r0, _08029F1C + b _08029F52 + .align 2, 0 +_08029F1C: .4byte gUnknown_80DEF28 +_08029F20: + ldr r0, _08029F24 + b _08029F52 + .align 2, 0 +_08029F24: .4byte gUnknown_80DEF80 +_08029F28: + ldr r0, _08029F2C + b _08029F52 + .align 2, 0 +_08029F2C: .4byte gUnknown_80DEFDC +_08029F30: + ldr r0, _08029F34 + b _08029F52 + .align 2, 0 +_08029F34: .4byte gUnknown_80DF044 +_08029F38: + ldr r0, _08029F3C + b _08029F52 + .align 2, 0 +_08029F3C: .4byte gUnknown_80DF0A0 +_08029F40: + ldr r0, _08029F44 + b _08029F52 + .align 2, 0 +_08029F44: .4byte gUnknown_80DF0A0 +_08029F48: + ldr r0, _08029F4C + b _08029F52 + .align 2, 0 +_08029F4C: .4byte gUnknown_80DF0E0 +_08029F50: + ldr r0, _08029F68 +_08029F52: + ldr r1, _08029F6C + ldr r2, [r1] + movs r1, 0x84 + lsls r1, 3 + adds r2, r1 + ldr r3, _08029F70 + movs r1, 0 + bl sub_80141B4 + b _08029F88 + .align 2, 0 +_08029F68: .4byte gUnknown_80DEF04 +_08029F6C: .4byte gUnknown_203B2C4 +_08029F70: .4byte 0x0000010d +_08029F74: + ldr r0, _08029F8C + ldr r1, _08029F90 + ldr r2, [r1] + movs r1, 0x84 + lsls r1, 3 + adds r2, r1 + ldr r3, _08029F94 + movs r1, 0 + bl sub_80141B4 +_08029F88: + pop {r0} + bx r0 + .align 2, 0 +_08029F8C: .4byte gUnknown_80DF138 +_08029F90: .4byte gUnknown_203B2C4 +_08029F94: .4byte 0x0000010d + thumb_func_end sub_8029EC4 + + thumb_func_start sub_8029F98 +sub_8029F98: + push {r4-r6,lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + adds r6, r0, 0 + cmp r6, 0 + bne _0802A048 + ldr r4, _08029FE4 + ldr r0, [r4] + ldr r5, _08029FE8 + adds r0, r5 + movs r1, 0 + movs r2, 0x4 + bl MemoryFill8 + ldr r0, [r4] + ldr r1, _08029FEC + adds r0, r1 + strb r6, [r0] + ldr r0, [r4] + subs r1, 0x1 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r4] + adds r0, r5 + strb r6, [r0] + ldr r0, [r4] + ldr r1, [r0, 0x44] + cmp r1, 0 + bne _0802A03C + ldr r1, [r0, 0x40] + cmp r1, 0x6 + beq _08029FF0 + cmp r1, 0x7 + beq _0802A034 + b _0802A048 + .align 2, 0 +_08029FE4: .4byte gUnknown_203B2C4 +_08029FE8: .4byte 0x0000041c +_08029FEC: .4byte 0x0000041e +_08029FF0: + ldr r1, _0802A004 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0x4 + beq _0802A020 + cmp r0, 0x4 + bgt _0802A008 + cmp r0, 0x3 + beq _0802A00C + b _0802A020 + .align 2, 0 +_0802A004: .4byte 0x00000534 +_0802A008: + cmp r0, 0x6 + bgt _0802A020 +_0802A00C: + ldr r0, _0802A028 + ldr r1, _0802A02C + ldr r2, [r1] + movs r1, 0x84 + lsls r1, 3 + adds r2, r1 + ldr r3, _0802A030 + movs r1, 0 + bl sub_80141B4 +_0802A020: + movs r0, 0xD + bl sub_802B2BC + b _0802A048 + .align 2, 0 +_0802A028: .4byte gUnknown_80DF194 +_0802A02C: .4byte gUnknown_203B2C4 +_0802A030: .4byte 0x0000010d +_0802A034: + movs r0, 0x21 + bl sub_802B2BC + b _0802A048 +_0802A03C: + adds r0, r1, 0 + bl sub_8029EC4 + movs r0, 0x1F + bl sub_802B2BC +_0802A048: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8029F98 + + thumb_func_start sub_802A050 +sub_802A050: + push {lr} + bl sub_8031DCC + cmp r0, 0x1 + beq _0802A088 + cmp r0, 0x1 + bcc _0802A08C + cmp r0, 0x3 + bhi _0802A08C + bl sub_8031E10 + bl sub_8004914 + ldr r0, _0802A084 + ldr r0, [r0] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0x1B + bl sub_802B2BC + b _0802A08C + .align 2, 0 +_0802A084: .4byte gUnknown_203B2C4 +_0802A088: + bl sub_8031E00 +_0802A08C: + pop {r0} + bx r0 + thumb_func_end sub_802A050 + + thumb_func_start sub_802A090 +sub_802A090: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802A0C2 + ldr r0, [sp] + cmp r0, 0x7 + beq _0802A0B4 + cmp r0, 0x7 + bgt _0802A0AE + cmp r0, 0 + beq _0802A0BC + b _0802A0C2 +_0802A0AE: + cmp r0, 0x8 + beq _0802A0BC + b _0802A0C2 +_0802A0B4: + movs r0, 0x6 + bl sub_802B2BC + b _0802A0C2 +_0802A0BC: + movs r0, 0x1 + bl sub_802B2BC +_0802A0C2: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_802A090 + + thumb_func_start sub_802A0C8 +sub_802A0C8: + push {r4,r5,lr} + movs r0, 0x1 + bl sub_8030768 + cmp r0, 0x3 + beq _0802A0F0 + cmp r0, 0x3 + bhi _0802A0DE + cmp r0, 0x2 + beq _0802A0E4 + b _0802A14E +_0802A0DE: + cmp r0, 0x4 + beq _0802A10C + b _0802A14E +_0802A0E4: + bl sub_803084C + movs r0, 0x1 + bl sub_802B2BC + b _0802A14E +_0802A0F0: + bl sub_80307EC + ldr r1, _0802A108 + ldr r1, [r1] + movs r2, 0x86 + lsls r2, 2 + adds r1, r2 + strb r0, [r1] + movs r0, 0x11 + bl sub_802B2BC + b _0802A14E + .align 2, 0 +_0802A108: .4byte gUnknown_203B2C4 +_0802A10C: + ldr r4, _0802A154 + ldr r1, [r4] + movs r0, 0x10 + str r0, [r1, 0x4] + bl sub_80307EC + ldr r1, [r4] + movs r5, 0x86 + lsls r5, 2 + adds r1, r5 + strb r0, [r1] + ldr r0, [r4] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + bl sub_8006518 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + adds r0, r5 + ldrb r0, [r0] + movs r1, 0 + bl sub_8030D40 + movs r0, 0x12 + bl sub_802B2BC +_0802A14E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802A154: .4byte gUnknown_203B2C4 + thumb_func_end sub_802A0C8 + + thumb_func_start sub_802A158 +sub_802A158: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802A16C + movs r0, 0x10 + bl sub_802B2BC +_0802A16C: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_802A158 + + thumb_func_start sub_802A174 +sub_802A174: + push {r4,lr} + sub sp, 0x4 + movs r0, 0x1 + negs r0, r0 + str r0, [sp] + movs r0, 0 + bl sub_8030768 + ldr r4, _0802A1B8 + ldr r0, [r4] + movs r1, 0xC3 + lsls r1, 2 + adds r0, r1 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _0802A1A6 + ldr r0, [r4] + movs r1, 0xC3 + lsls r1, 2 + adds r0, r1 + mov r1, sp + bl sub_8013114 +_0802A1A6: + ldr r0, [sp] + cmp r0, 0xB + beq _0802A1C6 + cmp r0, 0xB + bgt _0802A1BC + cmp r0, 0 + beq _0802A208 + b _0802A224 + .align 2, 0 +_0802A1B8: .4byte gUnknown_203B2C4 +_0802A1BC: + cmp r0, 0xC + beq _0802A1D2 + cmp r0, 0xD + beq _0802A208 + b _0802A224 +_0802A1C6: + bl sub_803084C + movs r0, 0xE + bl sub_802B2BC + b _0802A224 +_0802A1D2: + ldr r0, [r4] + movs r1, 0x2B + str r1, [r0, 0x4] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + bl sub_8006518 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0 + bl sub_8030D40 + movs r0, 0x12 + bl sub_802B2BC + b _0802A224 +_0802A208: + ldr r0, _0802A22C + ldr r0, [r0] + movs r1, 0xD7 + lsls r1, 2 + adds r0, r1 + movs r1, 0x2 + bl sub_8035CC0 + movs r0, 0x1 + bl sub_8030810 + movs r0, 0x10 + bl sub_802B2BC +_0802A224: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802A22C: .4byte gUnknown_203B2C4 + thumb_func_end sub_802A174 + + thumb_func_start sub_802A230 +sub_802A230: + push {r4,lr} + bl sub_8030DA0 + cmp r0, 0x3 + bhi _0802A284 + cmp r0, 0x2 + bcc _0802A284 + bl sub_8030DE4 + bl sub_8004914 + ldr r4, _0802A27C + ldr r0, [r4] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + bl sub_803092C + ldr r4, [r4] + ldr r0, [r4, 0x4] + cmp r0, 0x2B + bne _0802A280 + movs r1, 0x87 + lsls r1, 2 + adds r0, r4, r1 + movs r1, 0x3 + movs r2, 0x1 + bl sub_8035CF4 + movs r0, 0x11 + bl sub_802B2BC + b _0802A284 + .align 2, 0 +_0802A27C: .4byte gUnknown_203B2C4 +_0802A280: + bl sub_802B2BC +_0802A284: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_802A230 + + thumb_func_start sub_802A28C +sub_802A28C: + push {r4-r6,lr} + ldr r4, _0802A2C0 + ldr r0, [r4] + ldr r5, _0802A2C4 + adds r0, r5 + movs r2, 0 + strb r2, [r0] + ldr r0, [r4] + ldr r1, _0802A2C8 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r4] + ldr r6, _0802A2CC + adds r0, r6 + strb r2, [r0] + movs r0, 0x1 + bl sub_801CA08 + cmp r0, 0x3 + beq _0802A2E2 + cmp r0, 0x3 + bhi _0802A2D0 + cmp r0, 0x2 + beq _0802A2D6 + b _0802A334 + .align 2, 0 +_0802A2C0: .4byte gUnknown_203B2C4 +_0802A2C4: .4byte 0x0000041e +_0802A2C8: .4byte 0x0000041d +_0802A2CC: .4byte 0x0000041c +_0802A2D0: + cmp r0, 0x4 + beq _0802A2FC + b _0802A334 +_0802A2D6: + bl sub_801CBB8 + movs r0, 0x1 + bl sub_802B2BC + b _0802A334 +_0802A2E2: + bl sub_801CB24 + ldr r1, [r4] + ldr r2, _0802A2F8 + adds r1, r2 + strb r0, [r1] + movs r0, 0x14 + bl sub_802B2BC + b _0802A334 + .align 2, 0 +_0802A2F8: .4byte 0x0000041e +_0802A2FC: + ldr r1, [r4] + movs r0, 0x13 + str r0, [r1, 0x4] + bl sub_801CB24 + ldr r1, [r4] + adds r1, r5 + strb r0, [r1] + ldr r0, [r4] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + bl sub_8006518 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + adds r0, r6 + bl sub_801B3C0 + movs r0, 0x15 + bl sub_802B2BC +_0802A334: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_802A28C + + thumb_func_start sub_802A33C +sub_802A33C: + push {r4,lr} + bl sub_801B410 + cmp r0, 0x1 + beq _0802A394 + cmp r0, 0x1 + bcc _0802A394 + cmp r0, 0x3 + bhi _0802A394 + bl sub_801B450 + bl sub_8004914 + ldr r4, _0802A38C + ldr r0, [r4] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0x1 + bl sub_801CB5C + ldr r4, [r4] + ldr r0, [r4, 0x4] + cmp r0, 0x2B + bne _0802A390 + movs r1, 0x87 + lsls r1, 2 + adds r0, r4, r1 + movs r1, 0x3 + movs r2, 0x1 + bl sub_8035CF4 + movs r0, 0x14 + bl sub_802B2BC + b _0802A394 + .align 2, 0 +_0802A38C: .4byte gUnknown_203B2C4 +_0802A390: + bl sub_802B2BC +_0802A394: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_802A33C + + thumb_func_start sub_802A39C +sub_802A39C: + push {r4,lr} + sub sp, 0x4 + movs r0, 0x1 + negs r0, r0 + str r0, [sp] + movs r0, 0 + bl sub_801CA08 + ldr r4, _0802A3E0 + ldr r0, [r4] + movs r1, 0xC3 + lsls r1, 2 + adds r0, r1 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _0802A3CE + ldr r0, [r4] + movs r1, 0xC3 + lsls r1, 2 + adds r0, r1 + mov r1, sp + bl sub_8013114 +_0802A3CE: + ldr r0, [sp] + cmp r0, 0xB + beq _0802A3EE + cmp r0, 0xB + bgt _0802A3E4 + cmp r0, 0 + beq _0802A430 + b _0802A44A + .align 2, 0 +_0802A3E0: .4byte gUnknown_203B2C4 +_0802A3E4: + cmp r0, 0xC + beq _0802A3FA + cmp r0, 0xD + beq _0802A430 + b _0802A44A +_0802A3EE: + bl sub_801CBB8 + movs r0, 0xC + bl sub_802B2BC + b _0802A44A +_0802A3FA: + ldr r0, [r4] + movs r1, 0x2B + str r1, [r0, 0x4] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + bl sub_8006518 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + ldr r1, _0802A42C + adds r0, r1 + bl sub_801B3C0 + movs r0, 0x15 + bl sub_802B2BC + b _0802A44A + .align 2, 0 +_0802A42C: .4byte 0x0000041c +_0802A430: + ldr r0, _0802A454 + ldr r0, [r0] + movs r1, 0xD7 + lsls r1, 2 + adds r0, r1 + movs r1, 0x3 + bl sub_8035CC0 + bl sub_801CCD8 + movs r0, 0x13 + bl sub_802B2BC +_0802A44A: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802A454: .4byte gUnknown_203B2C4 + thumb_func_end sub_802A39C + + thumb_func_start sub_802A458 +sub_802A458: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802A46C + movs r0, 0xD + bl sub_802B2BC +_0802A46C: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_802A458 + + thumb_func_start sub_802A474 +sub_802A474: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802A488 + movs r0, 0x3 + bl sub_802B2BC +_0802A488: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_802A474 + + thumb_func_start sub_802A490 +sub_802A490: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802A4A4 + movs r0, 0x3 + bl sub_802B2BC +_0802A4A4: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_802A490 + + thumb_func_start sub_802A4AC +sub_802A4AC: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802A4CC + movs r0, 0x18 + bl sub_802B2BC + movs r0, 0x1 + bl sub_8011C28 + movs r0, 0 + bl sub_8012574 +_0802A4CC: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_802A4AC + + thumb_func_start sub_802A4D4 +sub_802A4D4: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802A4E8 + movs r0, 0x1A + bl sub_802B2BC +_0802A4E8: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_802A4D4 + + thumb_func_start sub_802A4F0 +sub_802A4F0: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802A504 + movs r0, 0x27 + bl sub_802B2BC +_0802A504: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_802A4F0 + + thumb_func_start sub_802A50C +sub_802A50C: + push {r4,r5,lr} + sub sp, 0x44 + bl sub_80154F0 + adds r4, r0, 0 + add r0, sp, 0x14 + movs r1, 0 + movs r2, 0x30 + bl MemoryFill8 + cmp r4, 0x2 + bne _0802A526 + b _0802A660 +_0802A526: + cmp r4, 0x3 + beq _0802A52C + b _0802A680 +_0802A52C: + ldr r0, _0802A54C + ldr r1, [r0] + adds r1, 0x8 + movs r0, 0x20 + add r2, sp, 0x14 + bl sub_8039068 + subs r0, 0x7 + cmp r0, 0x11 + bls _0802A542 + b _0802A654 +_0802A542: + lsls r0, 2 + ldr r1, _0802A550 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802A54C: .4byte gUnknown_203B2C4 +_0802A550: .4byte _0802A554 + .align 2, 0 +_0802A554: + .4byte _0802A654 + .4byte _0802A654 + .4byte _0802A654 + .4byte _0802A654 + .4byte _0802A5F0 + .4byte _0802A654 + .4byte _0802A654 + .4byte _0802A654 + .4byte _0802A654 + .4byte _0802A654 + .4byte _0802A59C + .4byte _0802A654 + .4byte _0802A654 + .4byte _0802A5D8 + .4byte _0802A654 + .4byte _0802A654 + .4byte _0802A654 + .4byte _0802A618 +_0802A59C: + ldr r0, _0802A5CC + ldr r3, _0802A5D0 + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + ldr r1, _0802A5D4 + ldr r1, [r1] + movs r2, 0x84 + lsls r2, 3 + adds r1, r2 + str r1, [sp, 0xC] + movs r1, 0xC + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0x7 + bl sub_8014248 + movs r0, 0x28 + bl sub_802B2BC + b _0802A654 + .align 2, 0 +_0802A5CC: .4byte gUnknown_80DF1C0 +_0802A5D0: .4byte gUnknown_80DEE44 +_0802A5D4: .4byte gUnknown_203B2C4 +_0802A5D8: + ldr r0, _0802A5E8 + ldr r1, _0802A5EC + ldr r2, [r1] + movs r3, 0x84 + lsls r3, 3 + adds r2, r3 + b _0802A5FC + .align 2, 0 +_0802A5E8: .4byte gUnknown_80DF208 +_0802A5EC: .4byte gUnknown_203B2C4 +_0802A5F0: + ldr r0, _0802A60C + ldr r1, _0802A610 + ldr r2, [r1] + movs r4, 0x84 + lsls r4, 3 + adds r2, r4 +_0802A5FC: + ldr r3, _0802A614 + movs r1, 0 + bl sub_80141B4 + movs r0, 0x1F + bl sub_802B2BC + b _0802A654 + .align 2, 0 +_0802A60C: .4byte gUnknown_80DF0A0 +_0802A610: .4byte gUnknown_203B2C4 +_0802A614: .4byte 0x0000010d +_0802A618: + ldr r1, [sp, 0x24] + movs r0, 0x4 + bl sub_809539C + lsls r0, 24 + lsrs r0, 24 + bl sub_8095228 + adds r2, r0, 0 + add r1, sp, 0x14 + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + movs r1, 0x6 + strb r1, [r0] + ldr r0, _0802A65C + ldr r0, [r0] + movs r5, 0x86 + lsls r5, 3 + adds r0, r5 + ldr r1, [sp, 0x24] + str r1, [r0] + movs r0, 0x21 + bl sub_802B2BC +_0802A654: + bl sub_80155F0 + b _0802A680 + .align 2, 0 +_0802A65C: .4byte gUnknown_203B2C4 +_0802A660: + bl sub_80155F0 + bl sub_8004914 + ldr r0, _0802A688 + ldr r0, [r0] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0x1 + bl sub_802B2BC +_0802A680: + add sp, 0x44 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802A688: .4byte gUnknown_203B2C4 + thumb_func_end sub_802A50C + + thumb_func_start sub_802A68C +sub_802A68C: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802A6AE + bl sub_8012600 + lsls r0, 24 + cmp r0, 0 + bne _0802A6AE + bl sub_8012750 + movs r0, 0xD + bl sub_802B2BC +_0802A6AE: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_802A68C + + thumb_func_start sub_802A6B4 +sub_802A6B4: + push {r4,lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802A6E8 + bl sub_8012600 + lsls r0, 24 + cmp r0, 0 + bne _0802A6E8 + bl sub_8012744 + adds r4, r0, 0 + bl sub_8012750 + cmp r4, 0 + bne _0802A6E2 + movs r0, 0x20 + bl sub_802B2BC + b _0802A6E8 +_0802A6E2: + movs r0, 0x3 + bl sub_802B2BC +_0802A6E8: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_802A6B4 + + thumb_func_start sub_802A6F0 +sub_802A6F0: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802A710 + movs r0, 0x18 + bl sub_802B2BC + movs r0, 0x1 + bl sub_8011C28 + movs r0, 0 + bl sub_8012574 +_0802A710: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_802A6F0 + + thumb_func_start sub_802A718 +sub_802A718: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802A738 + movs r0, 0x25 + bl sub_802B2BC + movs r0, 0x1 + bl sub_8011C28 + movs r0, 0 + bl sub_8012574 +_0802A738: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_802A718 + + thumb_func_start sub_802A740 +sub_802A740: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802A754 + movs r0, 0x1E + bl sub_802B2BC +_0802A754: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_802A740 + + thumb_func_start sub_802A75C +sub_802A75C: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802A792 + ldr r0, [sp] + cmp r0, 0 + beq _0802A78C + cmp r0, 0x7 + bne _0802A792 + ldr r0, _0802A788 + ldr r0, [r0] + movs r1, 0xA7 + lsls r1, 3 + adds r0, r1 + ldr r0, [r0] + movs r0, 0x16 + bl sub_802B2BC + b _0802A792 + .align 2, 0 +_0802A788: .4byte gUnknown_203B2C4 +_0802A78C: + movs r0, 0x1 + bl sub_802B2BC +_0802A792: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_802A75C + + thumb_func_start sub_802A798 +sub_802A798: + push {r4,r5,lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802A81E + ldr r0, [sp] + cmp r0, 0x7 + beq _0802A7BC + cmp r0, 0x7 + bgt _0802A7B6 + cmp r0, 0 + beq _0802A818 + b _0802A81E +_0802A7B6: + cmp r0, 0x8 + beq _0802A810 + b _0802A81E +_0802A7BC: + ldr r4, _0802A800 + ldr r0, [r4] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + bl sub_8095228 + adds r2, r0, 0 + ldr r1, [r4] + ldr r3, _0802A804 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + beq _0802A7E2 + ldr r5, _0802A808 + adds r0, r1, r5 + ldr r0, [r0] + str r0, [r2, 0x20] +_0802A7E2: + ldr r0, _0802A80C + ldr r1, [r0] + ldr r0, [r4] + adds r0, r3 + ldrb r0, [r0] + lsls r0, 1 + adds r1, 0x50 + adds r1, r0 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + movs r0, 0x29 + bl sub_802B2BC + b _0802A81E + .align 2, 0 +_0802A800: .4byte gUnknown_203B2C4 +_0802A804: .4byte 0x0000041e +_0802A808: .4byte 0x0000041c +_0802A80C: .4byte gUnknown_203B460 +_0802A810: + movs r0, 0xB + bl sub_802B2BC + b _0802A81E +_0802A818: + movs r0, 0x1 + bl sub_802B2BC +_0802A81E: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_802A798 + + thumb_func_start sub_802A828 +sub_802A828: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802A848 + movs r0, 0x2A + bl sub_802B2BC + movs r0, 0x1 + bl sub_8011C28 + movs r0, 0 + bl sub_8012574 +_0802A848: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_802A828 + + thumb_func_start sub_802A850 +sub_802A850: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802A89A + bl sub_8012600 + lsls r0, 24 + cmp r0, 0 + bne _0802A89A + bl sub_8012750 + ldr r0, _0802A884 + ldr r0, [r0] + ldr r1, _0802A888 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0x3 + blt _0802A89A + cmp r0, 0x4 + ble _0802A88C + cmp r0, 0x5 + beq _0802A894 + b _0802A89A + .align 2, 0 +_0802A884: .4byte gUnknown_203B2C4 +_0802A888: .4byte 0x00000534 +_0802A88C: + movs r0, 0x1D + bl sub_802B2BC + b _0802A89A +_0802A894: + movs r0, 0x19 + bl sub_802B2BC +_0802A89A: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_802A850 + + thumb_func_start sub_802A8A0 +sub_802A8A0: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802A8B4 + movs r0, 0x13 + bl sub_802B2BC +_0802A8B4: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_802A8A0 + + thumb_func_start sub_802A8BC +sub_802A8BC: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802A90A + ldr r0, [sp] + cmp r0, 0 + beq _0802A904 + cmp r0, 0xA + bne _0802A90A + ldr r0, _0802A8EC + ldr r0, [r0] + ldr r1, _0802A8F0 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0x3 + blt _0802A90A + cmp r0, 0x4 + ble _0802A8F4 + cmp r0, 0x5 + beq _0802A8FC + b _0802A90A + .align 2, 0 +_0802A8EC: .4byte gUnknown_203B2C4 +_0802A8F0: .4byte 0x00000534 +_0802A8F4: + movs r0, 0x1D + bl sub_802B2BC + b _0802A90A +_0802A8FC: + movs r0, 0x19 + bl sub_802B2BC + b _0802A90A +_0802A904: + movs r0, 0x1 + bl sub_802B2BC +_0802A90A: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_802A8BC + + thumb_func_start sub_802A910 +sub_802A910: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802A986 + ldr r0, [sp] + cmp r0, 0x9 + beq _0802A934 + cmp r0, 0x9 + bgt _0802A92E + cmp r0, 0 + beq _0802A980 + b _0802A986 +_0802A92E: + cmp r0, 0xA + beq _0802A950 + b _0802A986 +_0802A934: + movs r0, 0 + bl sub_801CF14 + lsls r0, 24 + cmp r0, 0 + beq _0802A948 + movs r0, 0xA + bl sub_802B2BC + b _0802A986 +_0802A948: + movs r0, 0xB + bl sub_802B2BC + b _0802A986 +_0802A950: + ldr r0, _0802A968 + ldr r0, [r0] + ldr r1, _0802A96C + adds r0, r1 + ldr r0, [r0] + cmp r0, 0x3 + blt _0802A986 + cmp r0, 0x4 + ble _0802A970 + cmp r0, 0x5 + beq _0802A978 + b _0802A986 + .align 2, 0 +_0802A968: .4byte gUnknown_203B2C4 +_0802A96C: .4byte 0x00000534 +_0802A970: + movs r0, 0x1D + bl sub_802B2BC + b _0802A986 +_0802A978: + movs r0, 0x19 + bl sub_802B2BC + b _0802A986 +_0802A980: + movs r0, 0x1 + bl sub_802B2BC +_0802A986: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_802A910 + + thumb_func_start sub_802A98C +sub_802A98C: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802A9A0 + movs r0, 0x8 + bl sub_802B2BC +_0802A9A0: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_802A98C + + thumb_func_start sub_802A9A8 +sub_802A9A8: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802A9F6 + ldr r0, [sp] + cmp r0, 0 + beq _0802A9F0 + cmp r0, 0x7 + bne _0802A9F6 + ldr r0, _0802A9D8 + ldr r0, [r0] + ldr r1, _0802A9DC + adds r0, r1 + ldr r0, [r0] + cmp r0, 0x3 + blt _0802A9F6 + cmp r0, 0x4 + ble _0802A9E0 + cmp r0, 0x5 + beq _0802A9E8 + b _0802A9F6 + .align 2, 0 +_0802A9D8: .4byte gUnknown_203B2C4 +_0802A9DC: .4byte 0x00000534 +_0802A9E0: + movs r0, 0x1D + bl sub_802B2BC + b _0802A9F6 +_0802A9E8: + movs r0, 0x19 + bl sub_802B2BC + b _0802A9F6 +_0802A9F0: + movs r0, 0x1 + bl sub_802B2BC +_0802A9F6: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_802A9A8 + + thumb_func_start sub_802A9FC +sub_802A9FC: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802AA22 + ldr r0, [sp] + cmp r0, 0 + beq _0802AA1C + cmp r0, 0x7 + bne _0802AA22 + movs r0, 0x26 + bl sub_802B2BC + b _0802AA22 +_0802AA1C: + movs r0, 0x1 + bl sub_802B2BC +_0802AA22: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_802A9FC + + thumb_func_start sub_802AA28 +sub_802AA28: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802AAA6 + ldr r2, [sp] + cmp r2, 0 + beq _0802AAA0 + cmp r2, 0 + blt _0802AAA6 + cmp r2, 0x5 + bgt _0802AAA6 + cmp r2, 0x3 + blt _0802AAA6 + ldr r0, _0802AA7C + ldr r0, [r0] + ldr r3, _0802AA80 + adds r1, r0, r3 + str r2, [r1] + movs r1, 0xA7 + lsls r1, 3 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0x1 + bne _0802AA8C + movs r0, 0x5 + bl sub_80953D4 + lsls r0, 24 + lsrs r0, 24 + bl sub_8095228 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0 + beq _0802AA84 + movs r0, 0x7 + bl sub_802B2BC + b _0802AAA6 + .align 2, 0 +_0802AA7C: .4byte gUnknown_203B2C4 +_0802AA80: .4byte 0x00000534 +_0802AA84: + movs r0, 0x9 + bl sub_802B2BC + b _0802AAA6 +_0802AA8C: + cmp r2, 0x5 + bne _0802AA98 + movs r0, 0x26 + bl sub_802B2BC + b _0802AAA6 +_0802AA98: + movs r0, 0x1D + bl sub_802B2BC + b _0802AAA6 +_0802AAA0: + movs r0, 0x1 + bl sub_802B2BC +_0802AAA6: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_802AA28 + + thumb_func_start sub_802AAAC +sub_802AAAC: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802AAC0 + movs r0, 0x1 + bl sub_802B2BC +_0802AAC0: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_802AAAC + + thumb_func_start sub_802AAC8 +sub_802AAC8: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802AADC + movs r0, 0x3 + bl sub_802B2BC +_0802AADC: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_802AAC8 + + thumb_func_start sub_802AAE4 +sub_802AAE4: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802AB5A + ldr r2, [sp] + cmp r2, 0x1 + beq _0802AB08 + cmp r2, 0x1 + bgt _0802AB02 + cmp r2, 0 + beq _0802AB54 + b _0802AB5A +_0802AB02: + cmp r2, 0x2 + beq _0802AB38 + b _0802AB5A +_0802AB08: + ldr r0, _0802AB2C + ldr r0, [r0] + movs r1, 0x6 + str r1, [r0, 0x40] + movs r1, 0xA7 + lsls r1, 3 + adds r0, r1 + str r2, [r0] + movs r0, 0x5 + bl sub_8095324 + cmp r0, 0 + bne _0802AB30 + movs r0, 0x4 + bl sub_802B2BC + b _0802AB5A + .align 2, 0 +_0802AB2C: .4byte gUnknown_203B2C4 +_0802AB30: + movs r0, 0xF + bl sub_802B2BC + b _0802AB5A +_0802AB38: + ldr r0, _0802AB50 + ldr r0, [r0] + movs r1, 0x7 + str r1, [r0, 0x40] + movs r1, 0xA7 + lsls r1, 3 + adds r0, r1 + str r2, [r0] + movs r0, 0x6 + bl sub_802B2BC + b _0802AB5A + .align 2, 0 +_0802AB50: .4byte gUnknown_203B2C4 +_0802AB54: + movs r0, 0x2 + bl sub_802B2BC +_0802AB5A: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_802AAE4 + + thumb_func_start sub_802AB60 +sub_802AB60: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802AB74 + movs r0, 0x22 + bl sub_802B2BC +_0802AB74: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_802AB60 + + thumb_func_start sub_802AB7C +sub_802AB7C: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802AB90 + movs r0, 0x22 + bl sub_802B2BC +_0802AB90: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_802AB7C + + thumb_func_start sub_802AB98 +sub_802AB98: + push {r4,lr} + bl sub_802F298 + cmp r0, 0x3 + bne _0802ABE0 + bl sub_802F2C0 + ldr r0, _0802ABE8 + movs r4, 0x98 + lsls r4, 1 + adds r1, r4, 0 + bl sub_808D8E0 + adds r0, r4, 0 + bl sub_808D994 + adds r1, r0, 0 + ldr r0, _0802ABEC + bl strcpy + ldr r0, _0802ABF0 + ldr r0, [r0] + movs r1, 0x86 + lsls r1, 3 + adds r0, r1 + ldr r1, [r0] + movs r0, 0x6 + bl sub_809539C + lsls r0, 24 + lsrs r0, 24 + bl sub_8095240 + movs r0, 0x24 + bl sub_802B2BC +_0802ABE0: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802ABE8: .4byte gUnknown_202E5D8 +_0802ABEC: .4byte gUnknown_202DF98 +_0802ABF0: .4byte gUnknown_203B2C4 + thumb_func_end sub_802AB98 + + thumb_func_start nullsub_131 +nullsub_131: + bx lr + thumb_func_end nullsub_131 + + thumb_func_start sub_802ABF8 +sub_802ABF8: + push {r4-r6,lr} + sub sp, 0xB8 + ldr r1, _0802AC14 + ldr r0, [r1] + ldrb r0, [r0] + adds r6, r1, 0 + cmp r0, 0x2A + bls _0802AC0A + b _0802B2AA +_0802AC0A: + lsls r0, 2 + ldr r1, _0802AC18 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802AC14: .4byte gUnknown_203B2C4 +_0802AC18: .4byte _0802AC1C + .align 2, 0 +_0802AC1C: + .4byte _0802B1DC + .4byte _0802B1FC + .4byte _0802B22C + .4byte _0802B2AA + .4byte _0802B1D4 + .4byte _0802ACC8 + .4byte _0802B248 + .4byte _0802B194 + .4byte _0802B1A4 + .4byte _0802B168 + .4byte _0802B138 + .4byte _0802B128 + .4byte _0802B0F0 + .4byte _0802B0AC + .4byte _0802AD08 + .4byte _0802AD18 + .4byte _0802AD20 + .4byte _0802AD46 + .4byte _0802B2AA + .4byte _0802AD80 + .4byte _0802ADB0 + .4byte _0802B2AA + .4byte _0802B07C + .4byte _0802B094 + .4byte _0802B2AA + .4byte _0802AF50 + .4byte _0802AF1A + .4byte _0802AF46 + .4byte _0802B2AA + .4byte _0802B0A4 + .4byte _0802ADF8 + .4byte _0802B2AA + .4byte _0802AF70 + .4byte _0802AF78 + .4byte _0802AFAC + .4byte _0802B2AA + .4byte _0802AF60 + .4byte _0802B2AA + .4byte _0802AEEC + .4byte _0802AEF4 + .4byte _0802B2AA + .4byte _0802B110 + .4byte _0802B120 +_0802ACC8: + bl sub_808D33C + adds r1, r0, 0 + adds r1, 0x4C + add r0, sp, 0x14 + movs r2, 0xA + bl sub_80922B4 + ldr r5, _0802ACF8 + ldr r0, [r5] + ldr r4, _0802ACFC + adds r0, r4 + ldr r1, _0802AD00 + add r2, sp, 0x14 + bl sub_800D158 + ldr r2, [r5] + adds r4, r2, r4 + movs r0, 0x84 + lsls r0, 3 + adds r2, r0 + ldr r3, _0802AD04 + adds r0, r4, 0 + b _0802B238 + .align 2, 0 +_0802ACF8: .4byte gUnknown_203B2C4 +_0802ACFC: .4byte 0x00000434 +_0802AD00: .4byte gUnknown_80DF250 +_0802AD04: .4byte 0x0000010d +_0802AD08: + ldr r0, _0802AD10 + ldr r3, _0802AD14 + b _0802B1A8 + .align 2, 0 +_0802AD10: .4byte gUnknown_80DF304 +_0802AD14: .4byte gUnknown_80DEE60 +_0802AD18: + ldr r0, _0802AD1C + b _0802B22E + .align 2, 0 +_0802AD1C: .4byte gUnknown_80DF330 +_0802AD20: + bl sub_8030894 + cmp r0, 0 + beq _0802AD2A + b _0802B2AA +_0802AD2A: + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0x5 + movs r1, 0 + movs r2, 0 + movs r3, 0x6 + bl sub_80306A8 + b _0802B2AA +_0802AD46: + ldr r0, [r6] + movs r4, 0xD7 + lsls r4, 2 + adds r0, r4 + bl sub_8006518 + ldr r1, [r6] + movs r5, 0x87 + lsls r5, 2 + adds r0, r1, r5 + adds r1, r4 + ldr r3, _0802AD78 + ldr r2, _0802AD7C + str r2, [sp] + movs r2, 0x1 + str r2, [sp, 0x4] + movs r2, 0 + str r2, [sp, 0x8] + str r2, [sp, 0xC] + movs r2, 0x3 + bl sub_8035C3C + bl sub_803092C + b _0802ADE0 + .align 2, 0 +_0802AD78: .4byte gUnknown_80DED60 +_0802AD7C: .4byte gUnknown_80DED78 +_0802AD80: + bl sub_801D008 + cmp r0, 0 + beq _0802AD8A + b _0802B2AA +_0802AD8A: + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + add r2, sp, 0xB4 + ldr r0, _0802ADAC + str r0, [r2] + movs r0, 0 + movs r1, 0x1 + movs r3, 0x9 + bl sub_801C8C4 + b _0802B2AA + .align 2, 0 +_0802ADAC: .4byte 0x00020003 +_0802ADB0: + ldr r0, [r6] + movs r4, 0xD7 + lsls r4, 2 + adds r0, r4 + bl sub_8006518 + ldr r1, [r6] + movs r5, 0x87 + lsls r5, 2 + adds r0, r1, r5 + adds r1, r4 + ldr r3, _0802ADF0 + ldr r2, _0802ADF4 + str r2, [sp] + movs r2, 0x1 + str r2, [sp, 0x4] + movs r2, 0 + str r2, [sp, 0x8] + str r2, [sp, 0xC] + movs r2, 0x3 + bl sub_8035C3C + bl sub_801CCD8 +_0802ADE0: + ldr r0, [r6] + adds r0, r5 + movs r1, 0x3 + movs r2, 0x1 + bl sub_8035CF4 + b _0802B2AA + .align 2, 0 +_0802ADF0: .4byte gUnknown_80DED48 +_0802ADF4: .4byte gUnknown_80DED78 +_0802ADF8: + ldr r1, [r6] + movs r0, 0 + str r0, [r1, 0x44] + bl sub_8011830 + ldr r0, [r6] + ldr r0, [r0, 0x40] + bl sub_8037B28 + ldr r1, [r6] + str r0, [r1, 0x44] + cmp r0, 0 + bne _0802AEE6 + ldr r0, [r1, 0x40] + cmp r0, 0x6 + beq _0802AE1E + cmp r0, 0x7 + beq _0802AE5C + b _0802AE8C +_0802AE1E: + movs r4, 0xDC + lsls r4, 1 + adds r0, r1, r4 + movs r1, 0 + movs r2, 0x30 + bl MemoryFill8 + ldr r0, [r6] + movs r5, 0x86 + lsls r5, 2 + adds r0, r5 + ldrb r0, [r0] + bl sub_8095228 + ldr r1, [r6] + adds r1, r4 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldr r2, [r6] + ldr r0, [r2, 0x40] + adds r4, r2, r4 + movs r1, 0xF4 + lsls r1, 1 + adds r2, r1 + b _0802AE82 +_0802AE5C: + movs r4, 0xDC + lsls r4, 1 + adds r0, r1, r4 + movs r1, 0 + movs r2, 0x30 + bl MemoryFill8 + ldr r0, [r6] + movs r5, 0xF4 + lsls r5, 1 + adds r0, r5 + movs r1, 0 + movs r2, 0x30 + bl MemoryFill8 + ldr r2, [r6] + ldr r0, [r2, 0x40] + adds r4, r2, r4 + adds r2, r5 +_0802AE82: + adds r1, r4, 0 + bl sub_8037D64 + ldr r1, [r6] + str r0, [r1, 0x44] +_0802AE8C: + ldr r4, _0802AED0 + ldr r2, [r4] + ldr r0, [r2, 0x44] + cmp r0, 0 + bne _0802AEE6 + ldr r0, [r2, 0x40] + cmp r0, 0x7 + bhi _0802AEE6 + cmp r0, 0x6 + bcc _0802AEE6 + movs r3, 0xDC + lsls r3, 1 + adds r1, r2, r3 + movs r5, 0xF4 + lsls r5, 1 + adds r2, r5 + bl sub_80381F4 + ldr r1, [r4] + str r0, [r1, 0x44] + bl sub_800D588 + lsls r0, 24 + cmp r0, 0 + beq _0802AED4 + ldr r0, [r4] + movs r2, 0x86 + lsls r2, 3 + adds r1, r0, r2 + movs r3, 0xFC + lsls r3, 1 + adds r0, r3 + b _0802AEE2 + .align 2, 0 +_0802AED0: .4byte gUnknown_203B2C4 +_0802AED4: + ldr r0, [r4] + movs r5, 0x86 + lsls r5, 3 + adds r1, r0, r5 + movs r2, 0xE4 + lsls r2, 1 + adds r0, r2 +_0802AEE2: + ldr r0, [r0] + str r0, [r1] +_0802AEE6: + bl sub_8011854 + b _0802B2AA +_0802AEEC: + ldr r0, _0802AEF0 + b _0802B22E + .align 2, 0 +_0802AEF0: .4byte gUnknown_80DF380 +_0802AEF4: + ldr r0, [r6] + movs r5, 0xEF + lsls r5, 2 + adds r0, r5 + bl sub_8006518 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r1, [r6] + adds r1, 0x8 + movs r0, 0x4 + bl sub_80151C0 + b _0802B2AA +_0802AF1A: + ldr r0, [r6] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + bl sub_8006518 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r6] + movs r2, 0x86 + lsls r2, 2 + adds r0, r2 + ldrb r0, [r0] + movs r1, 0 + bl sub_8031D70 + b _0802B2AA +_0802AF46: + ldr r0, _0802AF4C + b _0802B22E + .align 2, 0 +_0802AF4C: .4byte gUnknown_80DF3B4 +_0802AF50: + ldr r0, _0802AF5C + ldr r2, [r6] + movs r5, 0x84 + lsls r5, 3 + adds r2, r5 + b _0802B236 + .align 2, 0 +_0802AF5C: .4byte gUnknown_80DF418 +_0802AF60: + ldr r0, _0802AF6C + ldr r2, [r6] + movs r1, 0x84 + lsls r1, 3 + adds r2, r1 + b _0802B236 + .align 2, 0 +_0802AF6C: .4byte gUnknown_80DF44C +_0802AF70: + ldr r0, _0802AF74 + b _0802B22E + .align 2, 0 +_0802AF74: .4byte gUnknown_80DF46C +_0802AF78: + ldr r0, [r6] + ldr r5, _0802AF90 + adds r0, r5 + ldr r0, [r0] + cmp r0, 0x4 + bne _0802AF86 + b _0802B2AA +_0802AF86: + cmp r0, 0x4 + bgt _0802AF94 + cmp r0, 0x3 + beq _0802AF9A + b _0802B2AA + .align 2, 0 +_0802AF90: .4byte 0x00000534 +_0802AF94: + cmp r0, 0x6 + ble _0802AF9A + b _0802B2AA +_0802AF9A: + ldr r0, _0802AFA8 + ldr r2, [r6] + movs r1, 0x84 + lsls r1, 3 + adds r2, r1 + b _0802B236 + .align 2, 0 +_0802AFA8: .4byte gUnknown_80DF4F4 +_0802AFAC: + movs r4, 0x98 + lsls r4, 1 + adds r0, r4, 0 + bl sub_808D994 + adds r1, r0, 0 + ldr r5, _0802B00C + ldr r0, [r5] + ldr r2, _0802B010 + adds r0, r2 + bl strcpy + ldr r1, [r5] + movs r3, 0xAA + lsls r3, 3 + adds r0, r1, r3 + movs r2, 0 + strh r4, [r0] + ldr r0, _0802B014 + adds r1, r0 + movs r0, 0x2 + strb r0, [r1] + ldr r0, [r5] + adds r3, 0x4 + adds r1, r0, r3 + str r2, [r1] + movs r1, 0x86 + lsls r1, 3 + adds r0, r1 + ldr r1, [r0] + movs r0, 0x6 + bl sub_809539C + lsls r0, 24 + lsrs r0, 24 + bl sub_8095228 + adds r2, r0, 0 + adds r0, 0x22 + ldrb r1, [r0] + cmp r1, 0 + beq _0802B018 + ldr r0, [r5] + movs r3, 0xAB + lsls r3, 3 + adds r0, r3 + b _0802B022 + .align 2, 0 +_0802B00C: .4byte gUnknown_203B2C4 +_0802B010: .4byte 0x0000053c +_0802B014: .4byte 0x00000552 +_0802B018: + ldr r0, [r5] + movs r5, 0xAB + lsls r5, 3 + adds r0, r5 + movs r1, 0 +_0802B022: + strb r1, [r0] + ldr r4, _0802B068 + ldr r0, [r4] + ldr r1, _0802B06C + adds r0, r1 + movs r5, 0 + movs r1, 0x1 + strb r1, [r0] + adds r0, r2, 0x4 + movs r1, 0 + bl sub_803C200 + ldr r1, [r4] + movs r3, 0xAC + lsls r3, 3 + adds r2, r1, r3 + str r0, [r2] + ldr r0, _0802B070 + adds r1, r0 + strb r5, [r1] + ldr r0, [r4] + ldr r1, _0802B074 + adds r0, r1 + strb r5, [r0] + ldr r0, [r4] + ldr r2, _0802B078 + adds r0, r2 + strb r5, [r0] + ldr r0, [r4] + subs r3, 0x24 + adds r0, r3 + movs r1, 0 + bl sub_802F204 + b _0802B2AA + .align 2, 0 +_0802B068: .4byte gUnknown_203B2C4 +_0802B06C: .4byte 0x0000055b +_0802B070: .4byte 0x00000559 +_0802B074: .4byte 0x0000055a +_0802B078: .4byte 0x0000055c +_0802B07C: + movs r0, 0 + bl nullsub_23 + ldr r0, _0802B090 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_80141B4 + b _0802B2AA + .align 2, 0 +_0802B090: .4byte gUnknown_80DF544 +_0802B094: + ldr r0, _0802B0A0 + ldr r2, [r6] + movs r5, 0x84 + lsls r5, 3 + adds r2, r5 + b _0802B236 + .align 2, 0 +_0802B0A0: .4byte gUnknown_80DF594 +_0802B0A4: + ldr r0, _0802B0A8 + b _0802B1A6 + .align 2, 0 +_0802B0A8: .4byte gUnknown_80DF5E4 +_0802B0AC: + bl sub_808D33C + adds r1, r0, 0 + add r6, sp, 0x64 + adds r1, 0x4C + adds r0, r6, 0 + movs r2, 0xA + bl sub_80922B4 + ldr r5, _0802B0E0 + ldr r0, [r5] + ldr r4, _0802B0E4 + adds r0, r4 + ldr r1, _0802B0E8 + adds r2, r6, 0 + bl sub_800D158 + ldr r2, [r5] + adds r4, r2, r4 + movs r3, 0x84 + lsls r3, 3 + adds r2, r3 + ldr r3, _0802B0EC + adds r0, r4, 0 + b _0802B238 + .align 2, 0 +_0802B0E0: .4byte gUnknown_203B2C4 +_0802B0E4: .4byte 0x00000434 +_0802B0E8: .4byte gUnknown_80DF63C +_0802B0EC: .4byte 0x0000010d +_0802B0F0: + ldr r0, _0802B108 + ldr r3, _0802B10C + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + ldr r1, [r6] + movs r5, 0x84 + lsls r5, 3 + adds r1, r5 + b _0802B1BA + .align 2, 0 +_0802B108: .4byte gUnknown_80DF694 +_0802B10C: .4byte gUnknown_80DEEE4 +_0802B110: + ldr r0, _0802B11C + ldr r2, [r6] + movs r1, 0x84 + lsls r1, 3 + adds r2, r1 + b _0802B236 + .align 2, 0 +_0802B11C: .4byte gUnknown_80DF44C +_0802B120: + ldr r0, _0802B124 + b _0802B22E + .align 2, 0 +_0802B124: .4byte gUnknown_80DF6F0 +_0802B128: + ldr r0, _0802B134 + ldr r2, [r6] + movs r5, 0x84 + lsls r5, 3 + adds r2, r5 + b _0802B236 + .align 2, 0 +_0802B134: .4byte gUnknown_80DF710 +_0802B138: + ldr r0, _0802B160 + ldr r3, _0802B164 + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + ldr r1, [r6] + movs r2, 0x84 + lsls r2, 3 + adds r1, r2 + str r1, [sp, 0xC] + movs r1, 0xC + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0 + bl sub_8014248 + b _0802B2AA + .align 2, 0 +_0802B160: .4byte gUnknown_80DF73C +_0802B164: .4byte gUnknown_80DEEBC +_0802B168: + ldr r0, _0802B18C + ldr r3, _0802B190 + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + ldr r1, [r6] + movs r5, 0x84 + lsls r5, 3 + adds r1, r5 + str r1, [sp, 0xC] + movs r1, 0xC + str r1, [sp, 0x10] + movs r1, 0 + bl sub_8014248 + b _0802B2AA + .align 2, 0 +_0802B18C: .4byte gUnknown_80DF77C +_0802B190: .4byte gUnknown_80DEE7C +_0802B194: + ldr r0, _0802B1A0 + ldr r2, [r6] + movs r1, 0x84 + lsls r1, 3 + adds r2, r1 + b _0802B236 + .align 2, 0 +_0802B1A0: .4byte gUnknown_80DF7D4 +_0802B1A4: + ldr r0, _0802B1CC +_0802B1A6: + ldr r3, _0802B1D0 +_0802B1A8: + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + ldr r1, [r6] + movs r2, 0x84 + lsls r2, 3 + adds r1, r2 +_0802B1BA: + str r1, [sp, 0xC] + movs r1, 0xC + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0x7 + bl sub_8014248 + b _0802B2AA + .align 2, 0 +_0802B1CC: .4byte gUnknown_80DF870 +_0802B1D0: .4byte gUnknown_80DEE44 +_0802B1D4: + ldr r0, _0802B1D8 + b _0802B22E + .align 2, 0 +_0802B1D8: .4byte gUnknown_80DF8B4 +_0802B1DC: + ldr r0, _0802B1F4 + ldr r3, _0802B1F8 + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + ldr r1, [r6] + movs r5, 0x84 + lsls r5, 3 + adds r1, r5 + b _0802B212 + .align 2, 0 +_0802B1F4: .4byte gUnknown_80DF8EC +_0802B1F8: .4byte gUnknown_80DEDB8 +_0802B1FC: + ldr r0, _0802B224 + ldr r3, _0802B228 + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + ldr r1, [r6] + movs r2, 0x84 + lsls r2, 3 + adds r1, r2 +_0802B212: + str r1, [sp, 0xC] + movs r1, 0xC + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0x1 + bl sub_8014248 + b _0802B2AA + .align 2, 0 +_0802B224: .4byte gUnknown_80DF928 +_0802B228: .4byte gUnknown_80DEDB8 +_0802B22C: + ldr r0, _0802B240 +_0802B22E: + ldr r2, [r6] + movs r3, 0x84 + lsls r3, 3 + adds r2, r3 +_0802B236: + ldr r3, _0802B244 +_0802B238: + movs r1, 0 + bl sub_80141B4 + b _0802B2AA + .align 2, 0 +_0802B240: .4byte gUnknown_80DF94C +_0802B244: .4byte 0x0000010d +_0802B248: + ldr r4, [r6] + movs r5, 0xA7 + lsls r5, 3 + adds r0, r4, r5 + ldr r0, [r0] + cmp r0, 0x1 + beq _0802B25C + cmp r0, 0x2 + beq _0802B288 + b _0802B2AA +_0802B25C: + ldr r0, _0802B280 + ldr r3, _0802B284 + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + movs r2, 0x84 + lsls r2, 3 + adds r1, r4, r2 + str r1, [sp, 0xC] + movs r1, 0xC + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0x3 + bl sub_8014248 + b _0802B2AA + .align 2, 0 +_0802B280: .4byte gUnknown_80DF96C +_0802B284: .4byte gUnknown_80DEE08 +_0802B288: + ldr r0, _0802B2B4 + ldr r3, _0802B2B8 + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + movs r5, 0x84 + lsls r5, 3 + adds r1, r4, r5 + str r1, [sp, 0xC] + movs r1, 0xC + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0x3 + bl sub_8014248 +_0802B2AA: + add sp, 0xB8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0802B2B4: .4byte gUnknown_80DF9A4 +_0802B2B8: .4byte gUnknown_80DEE08 + thumb_func_end sub_802ABF8 + + thumb_func_start sub_802B2BC +sub_802B2BC: + push {lr} + ldr r1, _0802B2D0 + ldr r1, [r1] + strb r0, [r1] + bl nullsub_131 + bl sub_802ABF8 + pop {r0} + bx r0 + .align 2, 0 +_0802B2D0: .4byte gUnknown_203B2C4 + thumb_func_end sub_802B2BC + + thumb_func_start sub_802B2D4 +sub_802B2D4: + push {r4,r5,lr} + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r5, _0802B348 + movs r4, 0xA0 + lsls r4, 1 + adds r0, r4, 0 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] + movs r1, 0 + adds r2, r4, 0 + bl MemoryFill8 + ldr r1, [r5] + movs r0, 0xFF + strb r0, [r1, 0x1] + ldr r0, _0802B34C + subs r4, 0x10 + adds r1, r4, 0 + bl sub_808D8E0 + adds r0, r4, 0 + bl sub_808DDD0 + ldr r1, [r5] + str r0, [r1, 0x4] + ldr r0, [r0, 0x4] + str r0, [r1, 0x8] + movs r2, 0 + strb r2, [r1, 0x10] + ldr r0, [r5] + strb r2, [r0, 0x11] + ldr r0, [r5] + strb r2, [r0, 0x12] + ldr r0, [r5] + movs r1, 0x2 + strh r1, [r0, 0xC] + movs r1, 0x8 + strh r1, [r0, 0xE] + adds r0, 0x1 + bl sub_8099394 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0802B350 + movs r0, 0 + bl sub_802B548 + movs r0, 0x1 + b _0802B352 + .align 2, 0 +_0802B348: .4byte gUnknown_203B2C8 +_0802B34C: .4byte gUnknown_202E5D8 +_0802B350: + movs r0, 0 +_0802B352: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_802B2D4 + + thumb_func_start sub_802B358 +sub_802B358: + push {lr} + ldr r0, _0802B370 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x5 + bhi _0802B3B2 + lsls r0, 2 + ldr r1, _0802B374 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802B370: .4byte gUnknown_203B2C8 +_0802B374: .4byte _0802B378 + .align 2, 0 +_0802B378: + .4byte _0802B390 + .4byte _0802B396 + .4byte _0802B39C + .4byte _0802B3A2 + .4byte _0802B3A8 + .4byte _0802B3AE +_0802B390: + bl sub_802B560 + b _0802B3B2 +_0802B396: + bl sub_802B57C + b _0802B3B2 +_0802B39C: + bl sub_802B5B8 + b _0802B3B2 +_0802B3A2: + bl sub_802B5FC + b _0802B3B2 +_0802B3A8: + bl sub_802B624 + b _0802B3B2 +_0802B3AE: + movs r0, 0x3 + b _0802B3B4 +_0802B3B2: + movs r0, 0 +_0802B3B4: + pop {r1} + bx r1 + thumb_func_end sub_802B358 + + thumb_func_start sub_802B3B8 +sub_802B3B8: + push {r4,lr} + ldr r4, _0802B3D8 + ldr r0, [r4] + cmp r0, 0 + beq _0802B3D2 + ldr r0, [r0, 0x4] + bl sub_800AA14 + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0802B3D2: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802B3D8: .4byte gUnknown_203B2C8 + thumb_func_end sub_802B3B8 + + thumb_func_start nullsub_132 +nullsub_132: + bx lr + thumb_func_end nullsub_132 + + thumb_func_start sub_802B3E0 +sub_802B3E0: + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x28 + ldr r1, _0802B404 + ldr r0, [r1] + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0x5 + bls _0802B3F8 + b _0802B532 +_0802B3F8: + lsls r0, 2 + ldr r1, _0802B408 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802B404: .4byte gUnknown_203B2C8 +_0802B408: .4byte _0802B40C + .align 2, 0 +_0802B40C: + .4byte _0802B424 + .4byte _0802B464 + .4byte _0802B50C + .4byte _0802B532 + .4byte _0802B524 + .4byte _0802B532 +_0802B424: + movs r0, 0 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _0802B438 + mov r0, sp + bl sub_80920D8 + b _0802B440 +_0802B438: + ldr r1, _0802B458 + mov r0, sp + bl strcpy +_0802B440: + ldr r4, _0802B45C + ldr r0, [r4] + adds r0, 0x14 + ldr r1, _0802B460 + mov r2, sp + bl sub_800D158 + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0x14 + b _0802B510 + .align 2, 0 +_0802B458: .4byte gUnknown_80DF9F0 +_0802B45C: .4byte gUnknown_203B2C8 +_0802B460: .4byte gUnknown_80DF9F8 +_0802B464: + movs r6, 0x98 + lsls r6, 1 + adds r0, r6, 0 + bl sub_808D994 + adds r1, r0, 0 + ldr r5, _0802B500 + ldr r0, [r5] + movs r2, 0x8A + lsls r2, 1 + mov r9, r2 + add r0, r9 + bl strcpy + ldr r2, [r5] + movs r3, 0x94 + lsls r3, 1 + adds r0, r2, r3 + movs r1, 0 + mov r8, r1 + movs r1, 0 + strh r6, [r0] + adds r3, 0x2 + adds r2, r3 + movs r0, 0x2 + strb r0, [r2] + ldr r0, [r5] + movs r2, 0x96 + lsls r2, 1 + adds r0, r2 + str r1, [r0] + bl sub_8097790 + ldr r0, [r5] + ldrb r0, [r0, 0x1] + bl sub_8095228 + adds r4, r0, 0 + adds r4, 0x4 + ldr r2, [r5] + adds r2, r6 + adds r0, r4, 0 + movs r1, 0 + bl sub_803C37C + adds r0, r4, 0 + movs r1, 0 + bl sub_803C200 + ldr r2, [r5] + movs r3, 0x9C + lsls r3, 1 + adds r1, r2, r3 + str r0, [r1] + ldr r1, _0802B504 + adds r0, r2, r1 + mov r2, r8 + strb r2, [r0] + ldr r0, [r5] + subs r3, 0x6 + adds r0, r3 + strb r2, [r0] + ldr r0, [r5] + ldr r2, _0802B508 + adds r1, r0, r2 + movs r0, 0xA + strb r0, [r1] + ldr r0, [r5] + adds r3, 0x2 + adds r0, r3 + mov r1, r8 + strb r1, [r0] + ldr r0, [r5] + add r0, r9 + movs r1, 0 + bl sub_802F204 + b _0802B532 + .align 2, 0 +_0802B500: .4byte gUnknown_203B2C8 +_0802B504: .4byte 0x00000131 +_0802B508: .4byte 0x00000133 +_0802B50C: + ldr r0, _0802B51C + ldr r2, [r2] +_0802B510: + adds r2, 0x4 + ldr r3, _0802B520 + movs r1, 0 + bl sub_80141B4 + b _0802B532 + .align 2, 0 +_0802B51C: .4byte gUnknown_80DFAA8 +_0802B520: .4byte 0x0000010d +_0802B524: + ldr r0, _0802B540 + ldr r2, [r2] + adds r2, 0x4 + ldr r3, _0802B544 + movs r1, 0 + bl sub_80141B4 +_0802B532: + add sp, 0x28 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0802B540: .4byte gUnknown_80DFB14 +_0802B544: .4byte 0x0000010d + thumb_func_end sub_802B3E0 + + thumb_func_start sub_802B548 +sub_802B548: + push {lr} + ldr r1, _0802B55C + ldr r1, [r1] + strb r0, [r1] + bl nullsub_132 + bl sub_802B3E0 + pop {r0} + bx r0 + .align 2, 0 +_0802B55C: .4byte gUnknown_203B2C8 + thumb_func_end sub_802B548 + + thumb_func_start sub_802B560 +sub_802B560: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802B574 + movs r0, 0x1 + bl sub_802B548 +_0802B574: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_802B560 + + thumb_func_start sub_802B57C +sub_802B57C: + push {r4,lr} + bl sub_802F298 + cmp r0, 0x3 + bne _0802B5AA + bl sub_802F2C0 + ldr r0, _0802B5B0 + movs r4, 0x98 + lsls r4, 1 + adds r1, r4, 0 + bl sub_808D8E0 + adds r0, r4, 0 + bl sub_808D994 + adds r1, r0, 0 + ldr r0, _0802B5B4 + bl strcpy + movs r0, 0x2 + bl sub_802B548 +_0802B5AA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802B5B0: .4byte gUnknown_202E5D8 +_0802B5B4: .4byte gUnknown_202DF98 + thumb_func_end sub_802B57C + + thumb_func_start sub_802B5B8 +sub_802B5B8: + push {r4,lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802B5EE + bl sub_8011C34 + adds r4, r0, 0 + ldr r0, _0802B5F8 + ldr r0, [r0] + ldrb r0, [r0, 0x1] + bl sub_8095228 + movs r1, 0x4 + strb r1, [r0] + str r4, [r0, 0x28] + movs r0, 0x3 + bl sub_802B548 + movs r0, 0x1 + bl sub_8011C28 + movs r0, 0 + bl sub_8012574 +_0802B5EE: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802B5F8: .4byte gUnknown_203B2C8 + thumb_func_end sub_802B5B8 + + thumb_func_start sub_802B5FC +sub_802B5FC: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802B61E + bl sub_8012600 + lsls r0, 24 + cmp r0, 0 + bne _0802B61E + bl sub_8012750 + movs r0, 0x4 + bl sub_802B548 +_0802B61E: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_802B5FC + + thumb_func_start sub_802B624 +sub_802B624: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802B638 + movs r0, 0x5 + bl sub_802B548 +_0802B638: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_802B624 + + thumb_func_start sub_802B640 +sub_802B640: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + adds r4, r1, 0 + mov r8, r2 + bl sub_802B9D8 + lsls r0, 24 + cmp r0, 0 + beq _0802B65A + movs r0, 0 + b _0802B706 +_0802B65A: + ldr r5, _0802B710 + ldr r0, [r5] + cmp r0, 0 + bne _0802B66C + movs r0, 0xD4 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] +_0802B66C: + ldr r0, [r5] + str r6, [r0, 0x6C] + lsls r1, r6, 1 + adds r1, r6 + lsls r1, 3 + adds r1, 0x74 + adds r1, r0, r1 + str r1, [r0, 0x70] + adds r0, 0x74 + bl sub_8006518 + ldr r1, [r5] + ldr r2, [r1, 0x6C] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r1, 0x74 + ldr r0, _0802B714 + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + cmp r4, 0 + beq _0802B6B0 + ldr r1, [r5] + ldr r2, [r1, 0x6C] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, 0x7C + adds r1, r0 + ldr r0, [r4] + str r0, [r1] +_0802B6B0: + ldr r0, [r5] + ldr r0, [r0, 0x70] + mov r1, r8 + bl sub_8012D08 + bl sub_8004914 + ldr r0, [r5] + adds r0, 0x74 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r4, [r5] + adds r4, 0x38 + bl sub_802B9A8 + adds r1, r0, 0 + adds r0, r4, 0 + mov r2, r8 + adds r3, r6, 0 + bl sub_8013818 + ldr r2, [r5] + ldr r0, _0802B718 + ldrh r1, [r0] + adds r0, r2, 0 + adds r0, 0x50 + strh r1, [r0] + ldr r0, _0802B71C + ldrh r0, [r0] + adds r1, r2, 0 + adds r1, 0x56 + strh r0, [r1] + adds r0, r2, 0 + adds r0, 0x38 + bl sub_8013984 + bl sub_802B880 + bl sub_802B8D4 + movs r0, 0x1 +_0802B706: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0802B710: .4byte gUnknown_203B2CC +_0802B714: .4byte gUnknown_80DFBEC +_0802B718: .4byte gUnknown_203B2D0 +_0802B71C: .4byte gUnknown_203B2D2 + thumb_func_end sub_802B640 + + thumb_func_start sub_802B720 +sub_802B720: + push {lr} + lsls r0, 24 + cmp r0, 0 + bne _0802B73C + ldr r0, _0802B738 + ldr r0, [r0] + adds r0, 0x38 + bl sub_8013660 + movs r0, 0 + b _0802B7A2 + .align 2, 0 +_0802B738: .4byte gUnknown_203B2CC +_0802B73C: + ldr r0, _0802B754 + ldr r0, [r0] + adds r0, 0x38 + bl GetKeyPress + cmp r0, 0x2 + beq _0802B75E + cmp r0, 0x2 + bgt _0802B758 + cmp r0, 0x1 + beq _0802B768 + b _0802B77C + .align 2, 0 +_0802B754: .4byte gUnknown_203B2CC +_0802B758: + cmp r0, 0x4 + beq _0802B772 + b _0802B77C +_0802B75E: + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + b _0802B7A2 +_0802B768: + movs r0, 0 + bl sub_80119D4 + movs r0, 0x3 + b _0802B7A2 +_0802B772: + movs r0, 0x4 + bl sub_80119D4 + movs r0, 0x4 + b _0802B7A2 +_0802B77C: + ldr r0, _0802B794 + ldr r0, [r0] + adds r0, 0x38 + movs r1, 0x1 + bl sub_80138B8 + lsls r0, 24 + cmp r0, 0 + bne _0802B798 + movs r0, 0 + b _0802B7A2 + .align 2, 0 +_0802B794: .4byte gUnknown_203B2CC +_0802B798: + bl sub_802B880 + bl sub_802B8D4 + movs r0, 0x1 +_0802B7A2: + pop {r1} + bx r1 + thumb_func_end sub_802B720 + + thumb_func_start sub_802B7A8 +sub_802B7A8: + ldr r0, _0802B7CC + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x56 + movs r3, 0 + ldrsh r1, [r0, r3] + subs r0, 0x2 + movs r3, 0 + ldrsh r0, [r0, r3] + muls r0, r1 + adds r1, r2, 0 + adds r1, 0x50 + movs r3, 0 + ldrsh r1, [r1, r3] + adds r0, r1 + adds r0, r2, r0 + ldrb r0, [r0] + bx lr + .align 2, 0 +_0802B7CC: .4byte gUnknown_203B2CC + thumb_func_end sub_802B7A8 + + thumb_func_start sub_802B7D0 +sub_802B7D0: + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8004914 + ldr r5, _0802B818 + ldr r0, [r5] + adds r0, 0x74 + movs r1, 0 + movs r2, 0 + bl sub_800641C + bl sub_802B9A8 + adds r1, r0, 0 + ldr r0, [r5] + adds r2, r0, 0 + adds r2, 0x5A + strh r1, [r2] + adds r0, 0x38 + bl sub_8013984 + bl sub_802B880 + bl sub_802B8D4 + cmp r4, 0 + beq _0802B812 + ldr r0, [r5] + adds r0, 0x38 + bl AddMenuCursorSprite +_0802B812: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802B818: .4byte gUnknown_203B2CC + thumb_func_end sub_802B7D0 + + thumb_func_start sub_802B81C +sub_802B81C: + push {r4,r5,lr} + ldr r4, _0802B870 + ldr r2, [r4] + cmp r2, 0 + beq _0802B86A + ldr r1, _0802B874 + adds r0, r2, 0 + adds r0, 0x50 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _0802B878 + adds r0, r2, 0 + adds r0, 0x56 + ldrh r0, [r0] + strh r0, [r1] + ldr r0, [r2, 0x6C] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x74 + ldr r0, _0802B87C + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x74 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0802B86A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802B870: .4byte gUnknown_203B2CC +_0802B874: .4byte gUnknown_203B2D0 +_0802B878: .4byte gUnknown_203B2D2 +_0802B87C: .4byte gUnknown_80DFBD0 + thumb_func_end sub_802B81C + + thumb_func_start sub_802B880 +sub_802B880: + push {r4,lr} + ldr r4, _0802B8D0 + ldr r0, [r4] + adds r0, 0x52 + movs r1, 0 + ldrsh r0, [r0, r1] + movs r1, 0xC + bl sub_80095E4 + adds r0, 0x2 + lsls r0, 16 + ldr r2, [r4] + ldr r3, [r2, 0x6C] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x82 + asrs r3, r0, 16 + lsrs r0, 16 + strh r0, [r1] + ldr r1, [r2, 0x6C] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r2, r0 + adds r3, 0x2 + adds r2, 0x84 + strh r3, [r2] + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x74 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802B8D0: .4byte gUnknown_203B2CC + thumb_func_end sub_802B880 + + thumb_func_start sub_802B8D4 +sub_802B8D4: + push {r4-r7,lr} + sub sp, 0x8 + ldr r4, _0802B99C + ldr r0, [r4] + ldr r0, [r0, 0x6C] + bl sub_8008C54 + ldr r0, [r4] + ldr r0, [r0, 0x6C] + bl sub_80073B8 + ldr r2, _0802B9A0 + ldr r0, [r4] + ldr r3, [r0, 0x6C] + movs r0, 0 + str r0, [sp] + movs r0, 0xA + movs r1, 0 + bl xxx_call_draw_string + ldr r0, _0802B9A4 + ldrb r0, [r0, 0x2] + lsls r0, 3 + adds r0, 0x4 + ldr r3, [r4] + adds r1, r3, 0 + adds r1, 0x56 + movs r5, 0 + ldrsh r2, [r1, r5] + adds r2, 0x1 + movs r1, 0x7 + str r1, [sp] + ldr r1, [r3, 0x6C] + str r1, [sp, 0x4] + movs r1, 0 + movs r3, 0x2 + bl sub_8012BC4 + movs r6, 0 + ldr r0, [r4] + adds r0, 0x52 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r6, r0 + bge _0802B98A + adds r7, r4, 0 +_0802B930: + ldr r0, [r7] + adds r0, 0x38 + adds r1, r6, 0 + bl sub_8013800 + adds r5, r0, 0 + ldr r1, [r7] + adds r0, r1, 0 + adds r0, 0x56 + movs r3, 0 + ldrsh r2, [r0, r3] + subs r0, 0x2 + movs r3, 0 + ldrsh r0, [r0, r3] + muls r0, r2 + adds r0, r6 + adds r0, r1, r0 + ldrb r4, [r0] + ldr r3, [r1, 0x6C] + movs r0, 0xA + adds r1, r5, 0 + movs r2, 0x6 + bl sub_803B6B0 + bl sub_802BC7C + adds r0, r4, 0 + bl sub_803C190 + adds r2, r0, 0 + ldr r0, [r7] + ldr r3, [r0, 0x6C] + movs r0, 0 + str r0, [sp] + movs r0, 0x15 + adds r1, r5, 0 + bl sub_8014FF0 + adds r6, 0x1 + ldr r0, [r7] + adds r0, 0x52 + movs r5, 0 + ldrsh r0, [r0, r5] + cmp r6, r0 + blt _0802B930 +_0802B98A: + ldr r0, _0802B99C + ldr r0, [r0] + ldr r0, [r0, 0x6C] + bl sub_80073E0 + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0802B99C: .4byte gUnknown_203B2CC +_0802B9A0: .4byte gUnknown_80DFC04 +_0802B9A4: .4byte gUnknown_80DFBE8 + thumb_func_end sub_802B8D4 + + thumb_func_start sub_802B9A8 +sub_802B9A8: + push {r4,r5,lr} + movs r5, 0 + movs r4, 0 +_0802B9AE: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8096E14 + lsls r0, 24 + cmp r0, 0 + beq _0802B9C6 + ldr r0, _0802B9D4 + ldr r0, [r0] + adds r0, r5 + strb r4, [r0] + adds r5, 0x1 +_0802B9C6: + adds r4, 0x1 + cmp r4, 0x37 + ble _0802B9AE + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0802B9D4: .4byte gUnknown_203B2CC + thumb_func_end sub_802B9A8 + + thumb_func_start sub_802B9D8 +sub_802B9D8: + push {r4,lr} + movs r4, 0 +_0802B9DC: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8096E14 + lsls r0, 24 + cmp r0, 0 + beq _0802B9EE + movs r0, 0 + b _0802B9F6 +_0802B9EE: + adds r4, 0x1 + cmp r4, 0x37 + ble _0802B9DC + movs r0, 0x1 +_0802B9F6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_802B9D8 + + thumb_func_start sub_802B9FC +sub_802B9FC: + push {r4-r7,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, _0802BA80 + movs r0, 0x94 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] + movs r6, 0 + strb r4, [r0, 0x4] + ldr r0, [r5] + adds r0, 0x88 + bl sub_801317C + ldr r1, [r5] + str r6, [r1, 0x24] + adds r1, 0x28 + ldr r0, _0802BA84 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldr r1, [r5] + ldr r2, _0802BA88 + adds r1, 0x40 + adds r0, r2, 0 + ldm r0!, {r3,r4,r7} + stm r1!, {r3,r4,r7} + ldm r0!, {r3,r4,r7} + stm r1!, {r3,r4,r7} + ldr r1, [r5] + adds r1, 0x58 + adds r0, r2, 0 + ldm r0!, {r3,r4,r7} + stm r1!, {r3,r4,r7} + ldm r0!, {r3,r4,r7} + stm r1!, {r3,r4,r7} + ldr r0, [r5] + adds r0, 0x70 + ldm r2!, {r1,r4,r7} + stm r0!, {r1,r4,r7} + ldm r2!, {r3,r4,r7} + stm r0!, {r3,r4,r7} + bl sub_8004914 + ldr r0, [r5] + adds r0, 0x28 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r5] + str r6, [r0, 0x8] + bl sub_802BCC4 + bl sub_802BC7C + movs r0, 0 + bl sub_802BB14 + movs r0, 0x1 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0802BA80: .4byte gUnknown_203B2D4 +_0802BA84: .4byte gUnknown_80DFC34 +_0802BA88: .4byte gUnknown_80DFC18 + thumb_func_end sub_802B9FC + + thumb_func_start sub_802BA8C +sub_802BA8C: + push {lr} + ldr r0, _0802BAA4 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0x1 + beq _0802BAB8 + cmp r0, 0x1 + bgt _0802BAA8 + cmp r0, 0 + beq _0802BAB2 + b _0802BAC2 + .align 2, 0 +_0802BAA4: .4byte gUnknown_203B2D4 +_0802BAA8: + cmp r0, 0x2 + beq _0802BAC2 + cmp r0, 0x3 + beq _0802BABE + b _0802BAC2 +_0802BAB2: + bl sub_802BB98 + b _0802BAC6 +_0802BAB8: + bl sub_802BC08 + b _0802BAC6 +_0802BABE: + movs r0, 0x3 + b _0802BAC8 +_0802BAC2: + movs r0, 0x2 + b _0802BAC8 +_0802BAC6: + movs r0, 0 +_0802BAC8: + pop {r1} + bx r1 + thumb_func_end sub_802BA8C + + thumb_func_start sub_802BACC +sub_802BACC: + push {r4,r5,lr} + ldr r4, _0802BB0C + ldr r2, [r4] + cmp r2, 0 + beq _0802BB06 + ldr r0, [r2, 0x24] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x28 + ldr r0, _0802BB10 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x28 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0802BB06: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802BB0C: .4byte gUnknown_203B2D4 +_0802BB10: .4byte gUnknown_80DFC18 + thumb_func_end sub_802BACC + + thumb_func_start sub_802BB14 +sub_802BB14: + push {lr} + ldr r1, _0802BB24 + ldr r1, [r1] + str r0, [r1] + bl sub_802BB28 + pop {r0} + bx r0 + .align 2, 0 +_0802BB24: .4byte gUnknown_203B2D4 + thumb_func_end sub_802BB14 + + thumb_func_start sub_802BB28 +sub_802BB28: + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, _0802BB94 + ldr r1, [r5] + ldr r0, [r1] + cmp r0, 0 + blt _0802BB8C + cmp r0, 0x1 + bgt _0802BB8C + ldr r0, [r1, 0x24] + bl sub_8008C54 + ldr r0, [r5] + ldr r0, [r0, 0x24] + bl sub_80073B8 + ldr r0, [r5] + ldrb r0, [r0, 0x4] + bl sub_803C190 + adds r2, r0, 0 + ldr r0, [r5] + ldr r3, [r0, 0x24] + movs r4, 0 + str r4, [sp] + movs r0, 0xA + movs r1, 0 + bl sub_8014FF0 + ldr r3, [r5] + ldr r1, [r3, 0x8] + lsls r1, 2 + adds r0, r3, 0 + adds r0, 0x10 + adds r0, r1 + ldr r2, [r0] + ldr r3, [r3, 0x24] + str r4, [sp] + movs r0, 0x6 + movs r1, 0x14 + bl sub_8014FF0 + ldr r0, [r5] + ldr r0, [r0, 0x24] + bl sub_80073E0 + ldr r1, [r5] + ldr r0, [r1, 0x8] + adds r0, 0x1 + str r0, [r1, 0x8] +_0802BB8C: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802BB94: .4byte gUnknown_203B2D4 + thumb_func_end sub_802BB28 + + thumb_func_start sub_802BB98 +sub_802BB98: + push {r4,lr} + ldr r0, _0802BBD4 + ldr r2, [r0] + ldr r1, [r2, 0xC] + adds r4, r0, 0 + cmp r1, 0 + beq _0802BBBC + ldr r0, [r2, 0x20] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0802BBB4 + bl sub_8013E54 +_0802BBB4: + ldr r1, [r4] + ldr r0, [r1, 0x20] + adds r0, 0x1 + str r0, [r1, 0x20] +_0802BBBC: + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x88 + ldr r1, [r1, 0x24] + bl sub_8012A64 + cmp r0, 0x1 + beq _0802BBD8 + cmp r0, 0x2 + beq _0802BBF6 + b _0802BC02 + .align 2, 0 +_0802BBD4: .4byte gUnknown_203B2D4 +_0802BBD8: + movs r0, 0 + bl sub_80119D4 + ldr r0, [r4] + ldr r0, [r0, 0xC] + cmp r0, 0 + beq _0802BBEE + movs r0, 0x1 + bl sub_802BB14 + b _0802BC02 +_0802BBEE: + movs r0, 0x3 + bl sub_802BB14 + b _0802BC02 +_0802BBF6: + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + bl sub_802BB14 +_0802BC02: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_802BB98 + + thumb_func_start sub_802BC08 +sub_802BC08: + push {r4,lr} + ldr r0, _0802BC44 + ldr r3, [r0] + ldr r2, [r3, 0x8] + ldr r1, [r3, 0xC] + adds r4, r0, 0 + cmp r2, r1 + bge _0802BC2E + ldr r0, [r3, 0x20] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0802BC26 + bl sub_8013E54 +_0802BC26: + ldr r1, [r4] + ldr r0, [r1, 0x20] + adds r0, 0x1 + str r0, [r1, 0x20] +_0802BC2E: + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x88 + ldr r1, [r1, 0x24] + bl sub_8012A64 + cmp r0, 0x1 + beq _0802BC48 + cmp r0, 0x2 + beq _0802BC68 + b _0802BC74 + .align 2, 0 +_0802BC44: .4byte gUnknown_203B2D4 +_0802BC48: + movs r0, 0 + bl sub_80119D4 + ldr r0, [r4] + ldr r1, [r0, 0x8] + ldr r0, [r0, 0xC] + cmp r1, r0 + bge _0802BC60 + movs r0, 0x1 + bl sub_802BB14 + b _0802BC74 +_0802BC60: + movs r0, 0x3 + bl sub_802BB14 + b _0802BC74 +_0802BC68: + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + bl sub_802BB14 +_0802BC74: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_802BC08 + + thumb_func_start sub_802BC7C +sub_802BC7C: + push {r4,lr} + ldr r4, _0802BCA4 + bl sub_808D3BC + adds r1, r0, 0 + adds r0, r4, 0 + bl sub_808DA34 + ldr r0, _0802BCA8 + ldr r0, [r0] + ldrb r0, [r0, 0xB] + cmp r0, 0x1 + bne _0802BCB0 + adds r0, r4, 0 + adds r0, 0x50 + ldr r1, _0802BCAC + bl strcpy + b _0802BCBA + .align 2, 0 +_0802BCA4: .4byte gUnknown_202DF98 +_0802BCA8: .4byte gUnknown_203B46C +_0802BCAC: .4byte gUnknown_80DFC4C +_0802BCB0: + adds r0, r4, 0 + adds r0, 0x50 + ldr r1, _0802BCC0 + bl strcpy +_0802BCBA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802BCC0: .4byte gUnknown_80DFC50 + thumb_func_end sub_802BC7C + + thumb_func_start sub_802BCC4 +sub_802BCC4: + push {r4,lr} + ldr r4, _0802BCDC + ldr r0, [r4] + ldrb r0, [r0, 0x4] + bl sub_803C1A0 + adds r3, r0, 0 + ldr r1, [r4] + movs r0, 0 + str r0, [r1, 0xC] + str r3, [r1, 0x10] + b _0802BD08 + .align 2, 0 +_0802BCDC: .4byte gUnknown_203B2D4 +_0802BCE0: + cmp r0, 0x23 + bne _0802BD06 + ldrb r2, [r3, 0x1] + cmp r2, 0x50 + beq _0802BCF0 + adds r1, r3, 0x2 + cmp r2, 0x70 + bne _0802BD02 +_0802BCF0: + ldr r0, [r4] + ldr r1, [r0, 0xC] + adds r1, 0x1 + str r1, [r0, 0xC] + lsls r1, 2 + adds r0, 0x10 + adds r0, r1 + adds r1, r3, 0x2 + str r1, [r0] +_0802BD02: + adds r3, r1, 0 + b _0802BD08 +_0802BD06: + adds r3, 0x1 +_0802BD08: + ldrb r0, [r3] + cmp r0, 0 + bne _0802BCE0 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_802BCC4 + + thumb_func_start sub_802BD14 +sub_802BD14: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + adds r4, r1, 0 + mov r8, r2 + bl sub_802C0E8 + lsls r0, 24 + cmp r0, 0 + beq _0802BD2E + movs r0, 0 + b _0802BDD4 +_0802BD2E: + ldr r5, _0802BDE0 + ldr r0, [r5] + cmp r0, 0 + bne _0802BD40 + movs r0, 0xA4 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] +_0802BD40: + ldr r0, [r5] + str r6, [r0, 0x38] + lsls r1, r6, 1 + adds r1, r6 + lsls r1, 3 + adds r1, 0x40 + adds r1, r0, r1 + str r1, [r0, 0x3C] + adds r0, 0x40 + bl sub_8006518 + ldr r1, [r5] + ldr r2, [r1, 0x38] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r1, 0x40 + ldr r0, _0802BDE4 + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldr r2, [r5] + ldr r1, [r2, 0x3C] + adds r0, r2, 0 + adds r0, 0xA0 + str r0, [r1, 0x14] + cmp r4, 0 + beq _0802BD8E + ldr r1, [r2, 0x38] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r1, r2, 0 + adds r1, 0x48 + adds r1, r0 + ldr r0, [r4] + str r0, [r1] +_0802BD8E: + ldr r0, [r5] + ldr r0, [r0, 0x3C] + mov r1, r8 + bl sub_8012D34 + bl sub_8004914 + ldr r0, [r5] + adds r0, 0x40 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r4, [r5] + adds r4, 0x4 + bl sub_802C0B8 + adds r1, r0, 0 + adds r0, r4, 0 + mov r2, r8 + adds r3, r6, 0 + bl sub_8013848 + ldr r0, [r5] + ldr r1, _0802BDE8 + ldrh r1, [r1] + strh r1, [r0, 0x1C] + adds r0, 0x4 + bl sub_8013984 + bl sub_802BF30 + bl sub_802BFA0 + movs r0, 0x1 +_0802BDD4: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0802BDE0: .4byte gUnknown_203B2D8 +_0802BDE4: .4byte gUnknown_80DFC74 +_0802BDE8: .4byte gUnknown_203B2DC + thumb_func_end sub_802BD14 + + thumb_func_start sub_802BDEC +sub_802BDEC: + push {lr} + lsls r0, 24 + cmp r0, 0 + bne _0802BE08 + ldr r0, _0802BE04 + ldr r0, [r0] + adds r0, 0x4 + bl sub_8013660 + movs r0, 0 + b _0802BE6E + .align 2, 0 +_0802BE04: .4byte gUnknown_203B2D8 +_0802BE08: + ldr r0, _0802BE20 + ldr r0, [r0] + adds r0, 0x4 + bl GetKeyPress + cmp r0, 0x2 + beq _0802BE2A + cmp r0, 0x2 + bgt _0802BE24 + cmp r0, 0x1 + beq _0802BE34 + b _0802BE48 + .align 2, 0 +_0802BE20: .4byte gUnknown_203B2D8 +_0802BE24: + cmp r0, 0x4 + beq _0802BE3E + b _0802BE48 +_0802BE2A: + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + b _0802BE6E +_0802BE34: + movs r0, 0 + bl sub_80119D4 + movs r0, 0x3 + b _0802BE6E +_0802BE3E: + movs r0, 0x4 + bl sub_80119D4 + movs r0, 0x4 + b _0802BE6E +_0802BE48: + ldr r0, _0802BE60 + ldr r0, [r0] + adds r0, 0x4 + movs r1, 0x1 + bl sub_80138B8 + lsls r0, 24 + cmp r0, 0 + bne _0802BE64 + movs r0, 0 + b _0802BE6E + .align 2, 0 +_0802BE60: .4byte gUnknown_203B2D8 +_0802BE64: + bl sub_802BF30 + bl sub_802BFA0 + movs r0, 0x1 +_0802BE6E: + pop {r1} + bx r1 + thumb_func_end sub_802BDEC + + thumb_func_start sub_802BE74 +sub_802BE74: + ldr r0, _0802BE90 + ldr r1, [r0] + movs r0, 0x22 + ldrsh r2, [r1, r0] + movs r3, 0x20 + ldrsh r0, [r1, r3] + muls r0, r2 + movs r3, 0x1C + ldrsh r2, [r1, r3] + adds r0, r2 + adds r1, r0 + ldrb r0, [r1] + bx lr + .align 2, 0 +_0802BE90: .4byte gUnknown_203B2D8 + thumb_func_end sub_802BE74 + + thumb_func_start sub_802BE94 +sub_802BE94: + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8004914 + ldr r5, _0802BED8 + ldr r0, [r5] + adds r0, 0x40 + movs r1, 0 + movs r2, 0 + bl sub_800641C + bl sub_802C0B8 + adds r1, r0, 0 + ldr r0, [r5] + strh r1, [r0, 0x26] + adds r0, 0x4 + bl sub_8013984 + bl sub_802BF30 + bl sub_802BFA0 + cmp r4, 0 + beq _0802BED2 + ldr r0, [r5] + adds r0, 0x4 + bl AddMenuCursorSprite +_0802BED2: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802BED8: .4byte gUnknown_203B2D8 + thumb_func_end sub_802BE94 + + thumb_func_start sub_802BEDC +sub_802BEDC: + push {r4,r5,lr} + ldr r4, _0802BF24 + ldr r2, [r4] + cmp r2, 0 + beq _0802BF1C + ldr r1, _0802BF28 + ldrh r0, [r2, 0x1C] + strh r0, [r1] + ldr r0, [r2, 0x38] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x40 + ldr r0, _0802BF2C + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x40 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0802BF1C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802BF24: .4byte gUnknown_203B2D8 +_0802BF28: .4byte gUnknown_203B2DC +_0802BF2C: .4byte gUnknown_80DFC5C + thumb_func_end sub_802BEDC + + thumb_func_start sub_802BF30 +sub_802BF30: + push {r4,lr} + ldr r4, _0802BF9C + ldr r0, [r4] + adds r0, 0xA0 + movs r2, 0 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0xA1 + strb r2, [r0] + ldr r0, [r4] + adds r0, 0xA2 + movs r1, 0xC + strb r1, [r0] + ldr r0, [r4] + adds r0, 0xA3 + strb r2, [r0] + ldr r0, [r4] + movs r1, 0x1E + ldrsh r0, [r0, r1] + movs r1, 0x18 + bl sub_8009614 + adds r0, 0x2 + lsls r0, 16 + ldr r2, [r4] + ldr r3, [r2, 0x38] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x4E + asrs r3, r0, 16 + lsrs r0, 16 + strh r0, [r1] + ldr r1, [r2, 0x38] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r2, r0 + adds r3, 0x2 + adds r2, 0x50 + strh r3, [r2] + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x40 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802BF9C: .4byte gUnknown_203B2D8 + thumb_func_end sub_802BF30 + + thumb_func_start sub_802BFA0 +sub_802BFA0: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xDC + ldr r4, _0802C060 + ldr r0, [r4] + ldr r0, [r0, 0x38] + bl sub_8008C54 + ldr r0, [r4] + ldr r0, [r0, 0x38] + bl sub_80073B8 + ldr r1, [r4] + movs r2, 0x22 + ldrsh r0, [r1, r2] + lsls r0, 3 + adds r0, 0xA + ldr r2, _0802C064 + ldr r3, [r1, 0x38] + movs r1, 0 + str r1, [sp] + bl xxx_call_draw_string + movs r6, 0 + ldr r0, [r4] + movs r3, 0x1E + ldrsh r0, [r0, r3] + cmp r6, r0 + bge _0802C09A + adds r7, r4, 0 + ldr r0, _0802C068 + mov r9, r0 + add r1, sp, 0x5C + mov r8, r1 +_0802BFE8: + ldr r1, [r7] + movs r3, 0x22 + ldrsh r2, [r1, r3] + movs r3, 0x20 + ldrsh r0, [r1, r3] + muls r0, r2 + adds r0, r6 + adds r1, r0 + ldrb r0, [r1] + bl sub_8095FE8 + adds r5, r0, 0 + ldr r0, [r7] + ldr r1, [r0, 0x38] + str r1, [sp, 0x4] + adds r0, 0x4 + adds r1, r6, 0 + bl sub_8013800 + str r0, [sp, 0x4C] + ldrb r0, [r5] + cmp r0, 0x1 + bne _0802C06C + ldr r0, [r7] + adds r0, 0x4 + adds r1, r6, 0 + bl sub_8013800 + adds r4, r0, 0 + ldr r0, [r7] + ldr r3, [r0, 0x38] + movs r0, 0xA + adds r1, r4, 0 + movs r2, 0x6 + bl sub_803B6B0 + bl sub_808D33C + adds r1, r0, 0 + mov r0, r9 + bl sub_808DA34 + ldrb r0, [r5, 0x5] + bl sub_803C190 + adds r1, r0, 0 + mov r0, r8 + mov r2, r9 + bl sub_800D158 + ldr r0, [r7] + ldr r3, [r0, 0x38] + movs r0, 0 + str r0, [sp] + movs r0, 0x15 + adds r1, r4, 0 + mov r2, r8 + bl xxx_call_draw_string + b _0802C08E + .align 2, 0 +_0802C060: .4byte gUnknown_203B2D8 +_0802C064: .4byte gUnknown_80DFC8C +_0802C068: .4byte gUnknown_202DF98 +_0802C06C: + adds r0, r5, 0 + add r1, sp, 0x4 + bl sub_803B35C + adds r0, r5, 0 + bl sub_80968B0 + lsls r0, 24 + cmp r0, 0 + beq _0802C088 + mov r1, sp + adds r1, 0x47 + movs r0, 0x2 + strb r0, [r1] +_0802C088: + add r0, sp, 0x4 + bl sub_803B6D4 +_0802C08E: + adds r6, 0x1 + ldr r0, [r7] + movs r1, 0x1E + ldrsh r0, [r0, r1] + cmp r6, r0 + blt _0802BFE8 +_0802C09A: + ldr r0, _0802C0B4 + ldr r0, [r0] + ldr r0, [r0, 0x38] + bl sub_80073E0 + add sp, 0xDC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0802C0B4: .4byte gUnknown_203B2D8 + thumb_func_end sub_802BFA0 + + thumb_func_start sub_802C0B8 +sub_802C0B8: + push {r4,r5,lr} + movs r5, 0 + movs r4, 0 +_0802C0BE: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8096000 + lsls r0, 24 + cmp r0, 0 + bne _0802C0D6 + ldr r0, _0802C0E4 + ldr r0, [r0] + adds r0, r5 + strb r4, [r0] + adds r5, 0x1 +_0802C0D6: + adds r4, 0x1 + cmp r4, 0x3 + ble _0802C0BE + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0802C0E4: .4byte gUnknown_203B2D8 + thumb_func_end sub_802C0B8 + + thumb_func_start sub_802C0E8 +sub_802C0E8: + push {r4,lr} + movs r4, 0 +_0802C0EC: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8096000 + lsls r0, 24 + cmp r0, 0 + bne _0802C0FE + movs r0, 0 + b _0802C106 +_0802C0FE: + adds r4, 0x1 + cmp r4, 0x3 + ble _0802C0EC + movs r0, 0x1 +_0802C106: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_802C0E8 + + thumb_func_start sub_802C10C +sub_802C10C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + adds r4, r1, 0 + mov r8, r2 + bl sub_802C4A4 + lsls r0, 24 + cmp r0, 0 + beq _0802C126 + movs r0, 0 + b _0802C1CC +_0802C126: + ldr r5, _0802C1D8 + ldr r0, [r5] + cmp r0, 0 + bne _0802C138 + movs r0, 0xA8 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] +_0802C138: + ldr r0, [r5] + str r6, [r0, 0x3C] + lsls r1, r6, 1 + adds r1, r6 + lsls r1, 3 + adds r1, 0x44 + adds r1, r0, r1 + str r1, [r0, 0x40] + adds r0, 0x44 + bl sub_8006518 + ldr r1, [r5] + ldr r2, [r1, 0x3C] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r1, 0x44 + ldr r0, _0802C1DC + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldr r2, [r5] + ldr r1, [r2, 0x40] + adds r0, r2, 0 + adds r0, 0xA4 + str r0, [r1, 0x14] + cmp r4, 0 + beq _0802C186 + ldr r1, [r2, 0x3C] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r1, r2, 0 + adds r1, 0x4C + adds r1, r0 + ldr r0, [r4] + str r0, [r1] +_0802C186: + ldr r0, [r5] + ldr r0, [r0, 0x40] + mov r1, r8 + bl sub_8012D34 + bl sub_8004914 + ldr r0, [r5] + adds r0, 0x44 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r4, [r5] + adds r4, 0x8 + bl sub_802C474 + adds r1, r0, 0 + adds r0, r4, 0 + mov r2, r8 + adds r3, r6, 0 + bl sub_8013848 + ldr r0, [r5] + ldr r1, _0802C1E0 + ldrh r1, [r1] + strh r1, [r0, 0x20] + adds r0, 0x8 + bl sub_8013984 + bl sub_802C328 + bl sub_802C39C + movs r0, 0x1 +_0802C1CC: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0802C1D8: .4byte gUnknown_203B2E0 +_0802C1DC: .4byte gUnknown_80DFCB4 +_0802C1E0: .4byte gUnknown_203B2E4 + thumb_func_end sub_802C10C + + thumb_func_start sub_802C1E4 +sub_802C1E4: + push {lr} + lsls r0, 24 + cmp r0, 0 + bne _0802C200 + ldr r0, _0802C1FC + ldr r0, [r0] + adds r0, 0x8 + bl sub_8013660 + movs r0, 0 + b _0802C266 + .align 2, 0 +_0802C1FC: .4byte gUnknown_203B2E0 +_0802C200: + ldr r0, _0802C218 + ldr r0, [r0] + adds r0, 0x8 + bl GetKeyPress + cmp r0, 0x2 + beq _0802C222 + cmp r0, 0x2 + bgt _0802C21C + cmp r0, 0x1 + beq _0802C22C + b _0802C240 + .align 2, 0 +_0802C218: .4byte gUnknown_203B2E0 +_0802C21C: + cmp r0, 0x4 + beq _0802C236 + b _0802C240 +_0802C222: + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + b _0802C266 +_0802C22C: + movs r0, 0 + bl sub_80119D4 + movs r0, 0x3 + b _0802C266 +_0802C236: + movs r0, 0x4 + bl sub_80119D4 + movs r0, 0x4 + b _0802C266 +_0802C240: + ldr r0, _0802C258 + ldr r0, [r0] + adds r0, 0x8 + movs r1, 0x1 + bl sub_80138B8 + lsls r0, 24 + cmp r0, 0 + bne _0802C25C + movs r0, 0 + b _0802C266 + .align 2, 0 +_0802C258: .4byte gUnknown_203B2E0 +_0802C25C: + bl sub_802C328 + bl sub_802C39C + movs r0, 0x1 +_0802C266: + pop {r1} + bx r1 + thumb_func_end sub_802C1E4 + + thumb_func_start sub_802C26C +sub_802C26C: + ldr r0, _0802C288 + ldr r1, [r0] + movs r0, 0x26 + ldrsh r2, [r1, r0] + movs r3, 0x24 + ldrsh r0, [r1, r3] + muls r0, r2 + movs r3, 0x20 + ldrsh r2, [r1, r3] + adds r0, r2 + adds r1, r0 + ldrb r0, [r1] + bx lr + .align 2, 0 +_0802C288: .4byte gUnknown_203B2E0 + thumb_func_end sub_802C26C + + thumb_func_start sub_802C28C +sub_802C28C: + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8004914 + ldr r5, _0802C2D0 + ldr r0, [r5] + adds r0, 0x44 + movs r1, 0 + movs r2, 0 + bl sub_800641C + bl sub_802C474 + adds r1, r0, 0 + ldr r0, [r5] + strh r1, [r0, 0x2A] + adds r0, 0x8 + bl sub_8013984 + bl sub_802C328 + bl sub_802C39C + cmp r4, 0 + beq _0802C2CA + ldr r0, [r5] + adds r0, 0x8 + bl AddMenuCursorSprite +_0802C2CA: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802C2D0: .4byte gUnknown_203B2E0 + thumb_func_end sub_802C28C + + thumb_func_start sub_802C2D4 +sub_802C2D4: + push {r4,r5,lr} + ldr r4, _0802C31C + ldr r2, [r4] + cmp r2, 0 + beq _0802C314 + ldr r1, _0802C320 + ldrh r0, [r2, 0x20] + strh r0, [r1] + ldr r0, [r2, 0x3C] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x44 + ldr r0, _0802C324 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x44 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0802C314: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802C31C: .4byte gUnknown_203B2E0 +_0802C320: .4byte gUnknown_203B2E4 +_0802C324: .4byte gUnknown_80DFC9C + thumb_func_end sub_802C2D4 + + thumb_func_start sub_802C328 +sub_802C328: + push {r4,lr} + ldr r4, _0802C398 + ldr r0, [r4] + ldrh r1, [r0, 0x28] + adds r0, 0xA4 + movs r2, 0 + strb r1, [r0] + ldr r0, [r4] + ldrh r1, [r0, 0x26] + adds r0, 0xA5 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0xA6 + movs r1, 0xC + strb r1, [r0] + ldr r0, [r4] + adds r0, 0xA7 + strb r2, [r0] + ldr r0, [r4] + movs r1, 0x22 + ldrsh r0, [r0, r1] + movs r1, 0x18 + bl sub_8009614 + adds r0, 0x2 + lsls r0, 16 + ldr r2, [r4] + ldr r3, [r2, 0x3C] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x52 + asrs r3, r0, 16 + lsrs r0, 16 + strh r0, [r1] + ldr r1, [r2, 0x3C] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r2, r0 + adds r3, 0x2 + adds r2, 0x54 + strh r3, [r2] + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x44 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802C398: .4byte gUnknown_203B2E0 + thumb_func_end sub_802C328 + + thumb_func_start sub_802C39C +sub_802C39C: + push {r4-r7,lr} + sub sp, 0x60 + ldr r7, _0802C3F8 + ldr r0, [r7] + ldr r0, [r0, 0x3C] + bl sub_8008C54 + ldr r0, [r7] + ldr r0, [r0, 0x3C] + bl sub_80073B8 + ldr r0, [r7] + movs r1, 0x26 + ldrsh r4, [r0, r1] + lsls r4, 3 + adds r5, r4, 0 + adds r5, 0xA + ldr r2, _0802C3FC + ldr r3, [r0, 0x3C] + movs r0, 0 + str r0, [sp] + adds r0, r5, 0 + movs r1, 0 + bl xxx_call_draw_string + adds r4, 0x4 + ldr r1, [r7] + adds r0, r1, 0 + adds r0, 0xA6 + ldrb r0, [r0] + lsls r0, 3 + adds r5, r4, r0 + movs r3, 0x26 + ldrsh r2, [r1, r3] + adds r2, 0x1 + movs r0, 0x7 + str r0, [sp] + ldr r0, [r1, 0x3C] + str r0, [sp, 0x4] + adds r0, r5, 0 + movs r1, 0 + movs r3, 0x2 + bl sub_8012BC4 + movs r6, 0 + b _0802C452 + .align 2, 0 +_0802C3F8: .4byte gUnknown_203B2E0 +_0802C3FC: .4byte gUnknown_80DFCCC +_0802C400: + ldr r1, [r7] + movs r3, 0x26 + ldrsh r2, [r1, r3] + movs r3, 0x24 + ldrsh r0, [r1, r3] + muls r0, r2 + adds r0, r6 + adds r1, r0 + ldrb r5, [r1] + adds r0, r5, 0 + bl sub_8096574 + adds r4, r0, 0 + ldr r0, [r7] + ldr r1, [r0, 0x3C] + str r1, [sp, 0x8] + adds r0, 0x8 + adds r1, r6, 0 + bl sub_8013800 + str r0, [sp, 0x50] + adds r0, r4, 0 + add r1, sp, 0x8 + bl sub_803B35C + adds r0, r5, 0 + bl sub_8096574 + bl sub_80968B0 + lsls r0, 24 + cmp r0, 0 + beq _0802C44A + mov r1, sp + adds r1, 0x4B + movs r0, 0x2 + strb r0, [r1] +_0802C44A: + add r0, sp, 0x8 + bl sub_803B6D4 + adds r6, 0x1 +_0802C452: + ldr r0, [r7] + movs r1, 0x22 + ldrsh r0, [r0, r1] + cmp r6, r0 + blt _0802C400 + ldr r0, _0802C470 + ldr r0, [r0] + ldr r0, [r0, 0x3C] + bl sub_80073E0 + add sp, 0x60 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0802C470: .4byte gUnknown_203B2E0 + thumb_func_end sub_802C39C + + thumb_func_start sub_802C474 +sub_802C474: + push {r4,r5,lr} + movs r5, 0 + movs r4, 0 +_0802C47A: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_809658C + lsls r0, 24 + cmp r0, 0 + bne _0802C492 + ldr r0, _0802C4A0 + ldr r0, [r0] + adds r0, r5 + strb r4, [r0] + adds r5, 0x1 +_0802C492: + adds r4, 0x1 + cmp r4, 0x7 + ble _0802C47A + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0802C4A0: .4byte gUnknown_203B2E0 + thumb_func_end sub_802C474 + + thumb_func_start sub_802C4A4 +sub_802C4A4: + push {r4,lr} + movs r4, 0 +_0802C4A8: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_809658C + lsls r0, 24 + cmp r0, 0 + bne _0802C4BA + movs r0, 0 + b _0802C4C2 +_0802C4BA: + adds r4, 0x1 + cmp r4, 0x7 + ble _0802C4A8 + movs r0, 0x1 +_0802C4C2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_802C4A4 + + thumb_func_start sub_802C4C8 +sub_802C4C8: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + adds r4, r1, 0 + mov r8, r2 + bl sub_802C83C + lsls r0, 24 + cmp r0, 0 + beq _0802C4E2 + movs r0, 0 + b _0802C580 +_0802C4E2: + ldr r5, _0802C58C + movs r0, 0xA8 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] + str r6, [r0, 0x3C] + lsls r1, r6, 1 + adds r1, r6 + lsls r1, 3 + adds r1, 0x44 + adds r1, r0, r1 + str r1, [r0, 0x40] + adds r0, 0x44 + bl sub_8006518 + ldr r1, [r5] + ldr r2, [r1, 0x3C] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r1, 0x44 + ldr r0, _0802C590 + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldr r2, [r5] + ldr r1, [r2, 0x40] + adds r0, r2, 0 + adds r0, 0xA4 + str r0, [r1, 0x14] + cmp r4, 0 + beq _0802C53A + ldr r1, [r2, 0x3C] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r1, r2, 0 + adds r1, 0x4C + adds r1, r0 + ldr r0, [r4] + str r0, [r1] +_0802C53A: + ldr r0, [r5] + ldr r0, [r0, 0x40] + mov r1, r8 + bl sub_8012D34 + bl sub_8004914 + ldr r0, [r5] + adds r0, 0x44 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r4, [r5] + adds r4, 0x8 + bl sub_802C80C + adds r1, r0, 0 + adds r0, r4, 0 + mov r2, r8 + adds r3, r6, 0 + bl sub_8013848 + ldr r0, [r5] + ldr r1, _0802C594 + ldrh r1, [r1] + strh r1, [r0, 0x20] + adds r0, 0x8 + bl sub_8013984 + bl sub_802C6DC + bl sub_802C750 + movs r0, 0x1 +_0802C580: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0802C58C: .4byte gUnknown_203B2E8 +_0802C590: .4byte gUnknown_80DFCFC +_0802C594: .4byte gUnknown_203B2EC + thumb_func_end sub_802C4C8 + + thumb_func_start sub_802C598 +sub_802C598: + push {lr} + lsls r0, 24 + cmp r0, 0 + bne _0802C5B4 + ldr r0, _0802C5B0 + ldr r0, [r0] + adds r0, 0x8 + bl sub_8013660 + movs r0, 0 + b _0802C61A + .align 2, 0 +_0802C5B0: .4byte gUnknown_203B2E8 +_0802C5B4: + ldr r0, _0802C5CC + ldr r0, [r0] + adds r0, 0x8 + bl GetKeyPress + cmp r0, 0x2 + beq _0802C5D6 + cmp r0, 0x2 + bgt _0802C5D0 + cmp r0, 0x1 + beq _0802C5E0 + b _0802C5F4 + .align 2, 0 +_0802C5CC: .4byte gUnknown_203B2E8 +_0802C5D0: + cmp r0, 0x4 + beq _0802C5EA + b _0802C5F4 +_0802C5D6: + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + b _0802C61A +_0802C5E0: + movs r0, 0 + bl sub_80119D4 + movs r0, 0x3 + b _0802C61A +_0802C5EA: + movs r0, 0x4 + bl sub_80119D4 + movs r0, 0x4 + b _0802C61A +_0802C5F4: + ldr r0, _0802C60C + ldr r0, [r0] + adds r0, 0x8 + movs r1, 0x1 + bl sub_80138B8 + lsls r0, 24 + cmp r0, 0 + bne _0802C610 + movs r0, 0 + b _0802C61A + .align 2, 0 +_0802C60C: .4byte gUnknown_203B2E8 +_0802C610: + bl sub_802C6DC + bl sub_802C750 + movs r0, 0x1 +_0802C61A: + pop {r1} + bx r1 + thumb_func_end sub_802C598 + + thumb_func_start sub_802C620 +sub_802C620: + ldr r0, _0802C63C + ldr r1, [r0] + movs r0, 0x26 + ldrsh r2, [r1, r0] + movs r3, 0x24 + ldrsh r0, [r1, r3] + muls r0, r2 + movs r3, 0x20 + ldrsh r2, [r1, r3] + adds r0, r2 + adds r1, r0 + ldrb r0, [r1] + bx lr + .align 2, 0 +_0802C63C: .4byte gUnknown_203B2E8 + thumb_func_end sub_802C620 + + thumb_func_start sub_802C640 +sub_802C640: + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8004914 + ldr r5, _0802C684 + ldr r0, [r5] + adds r0, 0x44 + movs r1, 0 + movs r2, 0 + bl sub_800641C + bl sub_802C80C + adds r1, r0, 0 + ldr r0, [r5] + strh r1, [r0, 0x2A] + adds r0, 0x8 + bl sub_8013984 + bl sub_802C6DC + bl sub_802C750 + cmp r4, 0 + beq _0802C67E + ldr r0, [r5] + adds r0, 0x8 + bl AddMenuCursorSprite +_0802C67E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802C684: .4byte gUnknown_203B2E8 + thumb_func_end sub_802C640 + + thumb_func_start sub_802C688 +sub_802C688: + push {r4,r5,lr} + ldr r4, _0802C6D0 + ldr r2, [r4] + cmp r2, 0 + beq _0802C6C8 + ldr r1, _0802C6D4 + ldrh r0, [r2, 0x20] + strh r0, [r1] + ldr r0, [r2, 0x3C] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x44 + ldr r0, _0802C6D8 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x44 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0802C6C8: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802C6D0: .4byte gUnknown_203B2E8 +_0802C6D4: .4byte gUnknown_203B2EC +_0802C6D8: .4byte gUnknown_80DFCE4 + thumb_func_end sub_802C688 + + thumb_func_start sub_802C6DC +sub_802C6DC: + push {r4,lr} + ldr r4, _0802C74C + ldr r0, [r4] + ldrh r1, [r0, 0x28] + adds r0, 0xA4 + movs r2, 0 + strb r1, [r0] + ldr r0, [r4] + ldrh r1, [r0, 0x26] + adds r0, 0xA5 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0xA6 + movs r1, 0xC + strb r1, [r0] + ldr r0, [r4] + adds r0, 0xA7 + strb r2, [r0] + ldr r0, [r4] + movs r1, 0x22 + ldrsh r0, [r0, r1] + movs r1, 0x18 + bl sub_8009614 + adds r0, 0x2 + lsls r0, 16 + ldr r2, [r4] + ldr r3, [r2, 0x3C] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x52 + asrs r3, r0, 16 + lsrs r0, 16 + strh r0, [r1] + ldr r1, [r2, 0x3C] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r2, r0 + adds r3, 0x2 + adds r2, 0x54 + strh r3, [r2] + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x44 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802C74C: .4byte gUnknown_203B2E8 + thumb_func_end sub_802C6DC + + thumb_func_start sub_802C750 +sub_802C750: + push {r4-r6,lr} + sub sp, 0x60 + ldr r6, _0802C7AC + ldr r0, [r6] + ldr r0, [r0, 0x3C] + bl sub_8008C54 + ldr r0, [r6] + ldr r0, [r0, 0x3C] + bl sub_80073B8 + ldr r0, [r6] + movs r1, 0x26 + ldrsh r4, [r0, r1] + lsls r4, 3 + adds r5, r4, 0 + adds r5, 0xA + ldr r2, _0802C7B0 + ldr r3, [r0, 0x3C] + movs r0, 0 + str r0, [sp] + adds r0, r5, 0 + movs r1, 0 + bl xxx_call_draw_string + adds r4, 0x4 + ldr r1, [r6] + adds r0, r1, 0 + adds r0, 0xA6 + ldrb r0, [r0] + lsls r0, 3 + adds r5, r4, r0 + movs r3, 0x26 + ldrsh r2, [r1, r3] + adds r2, 0x1 + movs r0, 0x7 + str r0, [sp] + ldr r0, [r1, 0x3C] + str r0, [sp, 0x4] + adds r0, r5, 0 + movs r1, 0 + movs r3, 0x2 + bl sub_8012BC4 + movs r5, 0 + b _0802C7EC + .align 2, 0 +_0802C7AC: .4byte gUnknown_203B2E8 +_0802C7B0: .4byte gUnknown_80DFD14 +_0802C7B4: + ldr r1, [r6] + movs r3, 0x26 + ldrsh r2, [r1, r3] + movs r3, 0x24 + ldrsh r0, [r1, r3] + muls r0, r2 + adds r0, r5 + adds r1, r0 + ldrb r0, [r1] + bl sub_8096AB4 + adds r4, r0, 0 + ldr r0, [r6] + ldr r1, [r0, 0x3C] + str r1, [sp, 0x8] + adds r0, 0x8 + adds r1, r5, 0 + bl sub_8013800 + str r0, [sp, 0x50] + adds r0, r4, 0 + add r1, sp, 0x8 + bl sub_803B35C + add r0, sp, 0x8 + bl sub_803B6D4 + adds r5, 0x1 +_0802C7EC: + ldr r0, [r6] + movs r1, 0x22 + ldrsh r0, [r0, r1] + cmp r5, r0 + blt _0802C7B4 + ldr r0, _0802C808 + ldr r0, [r0] + ldr r0, [r0, 0x3C] + bl sub_80073E0 + add sp, 0x60 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0802C808: .4byte gUnknown_203B2E8 + thumb_func_end sub_802C750 + + thumb_func_start sub_802C80C +sub_802C80C: + push {r4,r5,lr} + movs r5, 0 + movs r4, 0 +_0802C812: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8096ACC + lsls r0, 24 + cmp r0, 0 + bne _0802C82A + ldr r0, _0802C838 + ldr r0, [r0] + adds r0, r5 + strb r4, [r0] + adds r5, 0x1 +_0802C82A: + adds r4, 0x1 + cmp r4, 0x7 + ble _0802C812 + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0802C838: .4byte gUnknown_203B2E8 + thumb_func_end sub_802C80C + + thumb_func_start sub_802C83C +sub_802C83C: + push {r4,lr} + movs r4, 0 +_0802C840: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8096ACC + lsls r0, 24 + cmp r0, 0 + bne _0802C852 + movs r0, 0 + b _0802C85A +_0802C852: + adds r4, 0x1 + cmp r4, 0x7 + ble _0802C840 + movs r0, 0x1 +_0802C85A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_802C83C + + thumb_func_start sub_802C860 +sub_802C860: + push {r4-r6,lr} + adds r6, r0, 0 + bl sub_802C83C + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0802C890 + ldr r4, _0802C88C + movs r0, 0xFE + lsls r0, 1 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r4] + str r5, [r0, 0x68] + str r6, [r0] + movs r0, 0 + bl sub_802C910 + movs r0, 0x1 + b _0802C892 + .align 2, 0 +_0802C88C: .4byte gUnknown_203B2F0 +_0802C890: + movs r0, 0 +_0802C892: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_802C860 + + thumb_func_start sub_802C898 +sub_802C898: + push {lr} + ldr r0, _0802C8B0 + ldr r0, [r0] + ldr r0, [r0, 0x4] + cmp r0, 0x5 + bhi _0802C8E8 + lsls r0, 2 + ldr r1, _0802C8B4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802C8B0: .4byte gUnknown_203B2F0 +_0802C8B4: .4byte _0802C8B8 + .align 2, 0 +_0802C8B8: + .4byte _0802C8D0 + .4byte _0802C8D0 + .4byte _0802C8D6 + .4byte _0802C8DC + .4byte _0802C8E2 + .4byte _0802C8E8 +_0802C8D0: + bl sub_802CC00 + b _0802C8EC +_0802C8D6: + bl sub_802CC70 + b _0802C8EC +_0802C8DC: + bl sub_802CD38 + b _0802C8EC +_0802C8E2: + bl sub_802CDB8 + b _0802C8EC +_0802C8E8: + movs r0, 0x3 + b _0802C8EE +_0802C8EC: + movs r0, 0 +_0802C8EE: + pop {r1} + bx r1 + thumb_func_end sub_802C898 + + thumb_func_start sub_802C8F4 +sub_802C8F4: + push {r4,lr} + ldr r4, _0802C90C + ldr r0, [r4] + cmp r0, 0 + beq _0802C906 + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0802C906: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802C90C: .4byte gUnknown_203B2F0 + thumb_func_end sub_802C8F4 + + thumb_func_start sub_802C910 +sub_802C910: + push {lr} + ldr r1, _0802C924 + ldr r1, [r1] + str r0, [r1, 0x4] + bl sub_802C928 + bl sub_802C9D8 + pop {r0} + bx r0 + .align 2, 0 +_0802C924: .4byte gUnknown_203B2F0 + thumb_func_end sub_802C910 + + thumb_func_start sub_802C928 +sub_802C928: + push {r4-r7,lr} + ldr r4, _0802C94C + ldr r0, [r4] + movs r1, 0xCE + lsls r1, 1 + adds r0, r1 + bl sub_8006518 + ldr r1, [r4] + ldr r0, [r1, 0x4] + cmp r0, 0x2 + beq _0802C954 + cmp r0, 0x3 + beq _0802C980 + movs r2, 0 + ldr r3, _0802C950 + b _0802C998 + .align 2, 0 +_0802C94C: .4byte gUnknown_203B2F0 +_0802C950: .4byte gUnknown_80DFD28 +_0802C954: + bl sub_802CAA4 + ldr r2, [r4] + movs r0, 0xE6 + lsls r0, 1 + adds r2, r0 + ldr r1, _0802C97C + ldm r1!, {r3,r5,r6} + stm r2!, {r3,r5,r6} + ldm r1!, {r3,r5,r7} + stm r2!, {r3,r5,r7} + ldr r1, [r4] + adds r0, r1, r0 + movs r6, 0x86 + lsls r6, 1 + adds r1, r6 + bl sub_8012CAC + b _0802C9B8 + .align 2, 0 +_0802C97C: .4byte gUnknown_80DFD40 +_0802C980: + movs r7, 0xF2 + lsls r7, 1 + adds r1, r7 + ldr r0, _0802C994 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + b _0802C9B8 + .align 2, 0 +_0802C994: .4byte gUnknown_80DFD58 +_0802C998: + ldr r0, [r4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 3 + adds r0, r1 + movs r1, 0xCE + lsls r1, 1 + adds r0, r1 + adds r1, r3, 0 + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + adds r2, 0x1 + cmp r2, 0x3 + ble _0802C998 +_0802C9B8: + bl sub_8004914 + ldr r0, _0802C9D4 + ldr r0, [r0] + movs r1, 0xCE + lsls r1, 1 + adds r0, r1 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0802C9D4: .4byte gUnknown_203B2F0 + thumb_func_end sub_802C928 + + thumb_func_start sub_802C9D8 +sub_802C9D8: + push {r4,lr} + sub sp, 0x8 + ldr r1, _0802C9F4 + ldr r0, [r1] + ldr r0, [r0, 0x4] + adds r4, r1, 0 + cmp r0, 0x5 + bhi _0802CA9C + lsls r0, 2 + ldr r1, _0802C9F8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802C9F4: .4byte gUnknown_203B2F0 +_0802C9F8: .4byte _0802C9FC + .align 2, 0 +_0802C9FC: + .4byte _0802CA14 + .4byte _0802CA20 + .4byte _0802CA28 + .4byte _0802CA48 + .4byte _0802CA80 + .4byte _0802CA9C +_0802CA14: + movs r0, 0 + movs r1, 0 + movs r2, 0x4 + bl sub_802C4C8 + b _0802CA9C +_0802CA20: + movs r0, 0x1 + bl sub_802C640 + b _0802CA9C +_0802CA28: + bl sub_802C750 + ldr r0, _0802CA44 + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x6C + movs r3, 0x86 + lsls r3, 1 + adds r1, r2, r3 + ldr r2, [r2, 0x68] + str r2, [sp] + movs r2, 0x2 + b _0802CA6E + .align 2, 0 +_0802CA44: .4byte gUnknown_203B2F0 +_0802CA48: + bl sub_802CBAC + bl sub_802C750 + ldr r4, _0802CA7C + ldr r0, [r4] + adds r0, 0x6C + movs r1, 0 + bl sub_8012EA4 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0xBC + movs r2, 0xA6 + lsls r2, 1 + adds r1, r2 + movs r2, 0x6 + str r2, [sp] + movs r2, 0x3 +_0802CA6E: + str r2, [sp, 0x4] + movs r2, 0 + movs r3, 0 + bl sub_8012D60 + b _0802CA9C + .align 2, 0 +_0802CA7C: .4byte gUnknown_203B2F0 +_0802CA80: + ldr r0, [r4] + ldrb r0, [r0, 0xC] + bl sub_8096AB4 + ldr r1, [r4] + adds r1, 0x10 + bl sub_803B35C + ldr r0, [r4] + movs r1, 0x3 + str r1, [r0, 0x10] + adds r0, 0x10 + bl sub_802DE84 +_0802CA9C: + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_802C9D8 + + thumb_func_start sub_802CAA4 +sub_802CAA4: + push {r4-r7,lr} + movs r7, 0 + ldr r5, _0802CAC8 + ldr r0, [r5] + ldrb r0, [r0, 0xC] + bl sub_8096AB4 + adds r4, r0, 0 + ldr r2, [r5] + ldr r0, [r2] + cmp r0, 0 + bne _0802CB26 + ldrb r0, [r4] + cmp r0, 0x5 + beq _0802CACC + cmp r0, 0x6 + beq _0802CB10 + b _0802CB26 + .align 2, 0 +_0802CAC8: .4byte gUnknown_203B2F0 +_0802CACC: + movs r0, 0x86 + lsls r0, 1 + adds r1, r2, r0 + ldr r0, _0802CAFC + str r0, [r1] + adds r0, r4, 0 + bl sub_809693C + lsls r0, 24 + cmp r0, 0 + bne _0802CAEE + ldrb r0, [r4, 0x4] + bl sub_80A2824 + lsls r0, 24 + cmp r0, 0 + bne _0802CB00 +_0802CAEE: + ldr r0, [r5] + movs r1, 0x88 + lsls r1, 1 + adds r0, r1 + movs r1, 0x1 + negs r1, r1 + b _0802CB0A + .align 2, 0 +_0802CAFC: .4byte gUnknown_80DFD70 +_0802CB00: + ldr r0, [r5] + movs r1, 0x88 + lsls r1, 1 + adds r0, r1 + movs r1, 0x2 +_0802CB0A: + str r1, [r0] + adds r7, 0x1 + b _0802CB26 +_0802CB10: + movs r0, 0x86 + lsls r0, 1 + adds r1, r2, r0 + ldr r0, _0802CB9C + str r0, [r1] + movs r0, 0x88 + lsls r0, 1 + adds r1, r2, r0 + movs r0, 0x3 + str r0, [r1] + movs r7, 0x1 +_0802CB26: + ldr r4, _0802CBA0 + ldr r6, [r4] + lsls r1, r7, 3 + movs r0, 0x86 + lsls r0, 1 + adds r3, r6, r0 + adds r2, r3, r1 + ldr r0, _0802CBA4 + ldr r0, [r0] + str r0, [r2] + movs r0, 0x88 + lsls r0, 1 + adds r5, r6, r0 + adds r1, r5, r1 + movs r0, 0x4 + str r0, [r1] + adds r7, 0x1 + lsls r1, r7, 3 + adds r2, r3, r1 + ldr r0, _0802CBA8 + ldr r0, [r0] + str r0, [r2] + adds r1, r5, r1 + movs r0, 0x7 + str r0, [r1] + adds r7, 0x1 + lsls r1, r7, 3 + adds r3, r1 + movs r0, 0 + str r0, [r3] + adds r1, r5, r1 + movs r0, 0x1 + str r0, [r1] + movs r3, 0 + mov r12, r4 + cmp r3, r7 + bge _0802CB8C + adds r4, r6, 0 + adds r1, r5, 0 + movs r5, 0x1 + negs r5, r5 +_0802CB78: + ldr r2, [r1] + cmp r2, r5 + beq _0802CB84 + ldr r0, [r4, 0x68] + cmp r2, r0 + beq _0802CB94 +_0802CB84: + adds r1, 0x8 + adds r3, 0x1 + cmp r3, r7 + blt _0802CB78 +_0802CB8C: + mov r0, r12 + ldr r1, [r0] + movs r0, 0x7 + str r0, [r1, 0x68] +_0802CB94: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0802CB9C: .4byte gUnknown_80DFD7C +_0802CBA0: .4byte gUnknown_203B2F0 +_0802CBA4: .4byte gUnknown_80D494C +_0802CBA8: .4byte gUnknown_80D4970 + thumb_func_end sub_802CAA4 + + thumb_func_start sub_802CBAC +sub_802CBAC: + ldr r0, _0802CBF4 + ldr r0, [r0] + mov r12, r0 + movs r3, 0 + movs r1, 0xA6 + lsls r1, 1 + add r1, r12 + ldr r0, _0802CBF8 + ldr r0, [r0] + str r0, [r1] + movs r1, 0xA8 + lsls r1, 1 + add r1, r12 + movs r0, 0x5 + str r0, [r1] + movs r2, 0x1 + movs r1, 0xAA + lsls r1, 1 + add r1, r12 + ldr r0, _0802CBFC + ldr r0, [r0] + str r0, [r1] + movs r1, 0xAC + lsls r1, 1 + add r1, r12 + movs r0, 0x6 + str r0, [r1] + movs r0, 0xAE + lsls r0, 1 + add r0, r12 + str r3, [r0] + movs r0, 0xB0 + lsls r0, 1 + add r0, r12 + str r2, [r0] + bx lr + .align 2, 0 +_0802CBF4: .4byte gUnknown_203B2F0 +_0802CBF8: .4byte gUnknown_80D4920 +_0802CBFC: .4byte gUnknown_80D4928 + thumb_func_end sub_802CBAC + + thumb_func_start sub_802CC00 +sub_802CC00: + push {lr} + movs r0, 0x1 + bl sub_802C598 + cmp r0, 0x4 + bhi _0802CC6A + lsls r0, 2 + ldr r1, _0802CC18 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802CC18: .4byte _0802CC1C + .align 2, 0 +_0802CC1C: + .4byte _0802CC6A + .4byte _0802CC6A + .4byte _0802CC60 + .4byte _0802CC30 + .4byte _0802CC48 +_0802CC30: + bl sub_802C620 + ldr r1, _0802CC44 + ldr r1, [r1] + strb r0, [r1, 0xC] + movs r0, 0x2 + bl sub_802C910 + b _0802CC6A + .align 2, 0 +_0802CC44: .4byte gUnknown_203B2F0 +_0802CC48: + bl sub_802C620 + ldr r1, _0802CC5C + ldr r1, [r1] + strb r0, [r1, 0xC] + movs r0, 0x4 + bl sub_802C910 + b _0802CC6A + .align 2, 0 +_0802CC5C: .4byte gUnknown_203B2F0 +_0802CC60: + bl sub_802C688 + movs r0, 0x5 + bl sub_802C910 +_0802CC6A: + pop {r0} + bx r0 + thumb_func_end sub_802CC00 + + thumb_func_start sub_802CC70 +sub_802CC70: + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + bl sub_802C598 + ldr r4, _0802CCB4 + ldr r0, [r4] + adds r0, 0x6C + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _0802CCA0 + ldr r0, [r4] + adds r0, 0x6C + mov r1, sp + bl sub_8013114 + ldr r1, [sp] + cmp r1, 0x1 + beq _0802CCA0 + ldr r0, [r4] + str r1, [r0, 0x68] +_0802CCA0: + ldr r0, [sp] + subs r0, 0x1 + cmp r0, 0x6 + bhi _0802CD2E + lsls r0, 2 + ldr r1, _0802CCB8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802CCB4: .4byte gUnknown_203B2F0 +_0802CCB8: .4byte _0802CCBC + .align 2, 0 +_0802CCBC: + .4byte _0802CD28 + .4byte _0802CCD8 + .4byte _0802CCF4 + .4byte _0802CD18 + .4byte _0802CD2E + .4byte _0802CD2E + .4byte _0802CD20 +_0802CCD8: + ldr r0, _0802CCEC + bl sub_8011988 + ldr r0, _0802CCF0 + ldr r0, [r0] + ldrb r0, [r0, 0xC] + bl sub_8096AB4 + movs r1, 0x6 + b _0802CD06 + .align 2, 0 +_0802CCEC: .4byte 0x00000133 +_0802CCF0: .4byte gUnknown_203B2F0 +_0802CCF4: + ldr r0, _0802CD10 + bl sub_8011988 + ldr r0, _0802CD14 + ldr r0, [r0] + ldrb r0, [r0, 0xC] + bl sub_8096AB4 + movs r1, 0x5 +_0802CD06: + strb r1, [r0] + movs r0, 0x1 + bl sub_802C910 + b _0802CD2E + .align 2, 0 +_0802CD10: .4byte 0x00000133 +_0802CD14: .4byte gUnknown_203B2F0 +_0802CD18: + movs r0, 0x3 + bl sub_802C910 + b _0802CD2E +_0802CD20: + movs r0, 0x4 + bl sub_802C910 + b _0802CD2E +_0802CD28: + movs r0, 0x1 + bl sub_802C910 +_0802CD2E: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_802CC70 + + thumb_func_start sub_802CD38 +sub_802CD38: + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + bl sub_802C598 + ldr r4, _0802CD78 + ldr r0, [r4] + adds r0, 0x6C + bl sub_8012FD8 + ldr r0, [r4] + adds r0, 0xBC + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _0802CD66 + ldr r0, [r4] + adds r0, 0xBC + mov r1, sp + bl sub_8013114 +_0802CD66: + ldr r0, [sp] + cmp r0, 0x5 + beq _0802CD88 + cmp r0, 0x5 + bgt _0802CD7C + cmp r0, 0x1 + beq _0802CD80 + b _0802CDB0 + .align 2, 0 +_0802CD78: .4byte gUnknown_203B2F0 +_0802CD7C: + cmp r0, 0x6 + bne _0802CDB0 +_0802CD80: + movs r0, 0x1 + bl sub_802C910 + b _0802CDB0 +_0802CD88: + ldr r0, [r4] + ldrb r0, [r0, 0xC] + bl sub_8096C3C + bl sub_8096C80 + bl sub_802C83C + lsls r0, 24 + cmp r0, 0 + beq _0802CDAA + bl sub_802C688 + movs r0, 0x5 + bl sub_802C910 + b _0802CDB0 +_0802CDAA: + movs r0, 0x1 + bl sub_802C910 +_0802CDB0: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_802CD38 + + thumb_func_start sub_802CDB8 +sub_802CDB8: + push {lr} + bl sub_802DEE0 + cmp r0, 0x1 + bls _0802CDD0 + cmp r0, 0x3 + bhi _0802CDD0 + bl sub_802DF24 + movs r0, 0x1 + bl sub_802C910 +_0802CDD0: + pop {r0} + bx r0 + thumb_func_end sub_802CDB8 + + thumb_func_start sub_802CDD4 +sub_802CDD4: + push {r4-r6,lr} + adds r5, r0, 0 + ldr r4, _0802CE54 + ldr r0, [r4] + cmp r0, 0 + bne _0802CDEA + movs r0, 0xA0 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r4] +_0802CDEA: + ldr r0, [r4] + str r5, [r0, 0x34] + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 3 + adds r1, 0x3C + adds r1, r0, r1 + str r1, [r0, 0x38] + adds r0, 0x3C + bl sub_8006518 + ldr r1, [r4] + ldr r2, [r1, 0x34] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r1, 0x3C + ldr r0, _0802CE58 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldr r1, [r4] + ldr r0, [r1, 0x38] + adds r1, 0x9C + str r1, [r0, 0x14] + movs r1, 0x4 + bl sub_8012D34 + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x3C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + movs r1, 0x5 + movs r2, 0x4 + adds r3, r5, 0 + bl sub_8013848 + bl sub_802CF5C + bl sub_802CFD0 + movs r0, 0x1 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0802CE54: .4byte gUnknown_203B2F4 +_0802CE58: .4byte gUnknown_80DFDA4 + thumb_func_end sub_802CDD4 + + thumb_func_start sub_802CE5C +sub_802CE5C: + push {r4,lr} + lsls r0, 24 + cmp r0, 0 + bne _0802CE74 + ldr r0, _0802CE70 + ldr r0, [r0] + bl sub_8013660 + movs r0, 0 + b _0802CEB4 + .align 2, 0 +_0802CE70: .4byte gUnknown_203B2F4 +_0802CE74: + ldr r4, _0802CE90 + ldr r0, [r4] + bl GetKeyPress + cmp r0, 0x1 + beq _0802CE94 + cmp r0, 0x2 + bne _0802CE98 + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + b _0802CEB4 + .align 2, 0 +_0802CE90: .4byte gUnknown_203B2F4 +_0802CE94: + movs r0, 0x3 + b _0802CEB4 +_0802CE98: + ldr r0, [r4] + movs r1, 0x1 + bl sub_80138B8 + lsls r0, 24 + cmp r0, 0 + bne _0802CEAA + movs r0, 0 + b _0802CEB4 +_0802CEAA: + bl sub_802CF5C + bl sub_802CFD0 + movs r0, 0x1 +_0802CEB4: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_802CE5C + + thumb_func_start sub_802CEBC +sub_802CEBC: + ldr r0, _0802CED4 + ldr r1, [r0] + movs r0, 0x1E + ldrsh r2, [r1, r0] + movs r3, 0x1C + ldrsh r0, [r1, r3] + muls r0, r2 + ldrb r1, [r1, 0x18] + adds r0, r1 + lsls r0, 24 + lsrs r0, 24 + bx lr + .align 2, 0 +_0802CED4: .4byte gUnknown_203B2F4 + thumb_func_end sub_802CEBC + + thumb_func_start sub_802CED8 +sub_802CED8: + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8004914 + ldr r5, _0802CF10 + ldr r0, [r5] + adds r0, 0x3C + movs r1, 0 + movs r2, 0 + bl sub_800641C + ldr r0, [r5] + bl sub_8013984 + bl sub_802CF5C + bl sub_802CFD0 + cmp r4, 0 + beq _0802CF0A + ldr r0, [r5] + bl AddMenuCursorSprite +_0802CF0A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802CF10: .4byte gUnknown_203B2F4 + thumb_func_end sub_802CED8 + + thumb_func_start sub_802CF14 +sub_802CF14: + push {r4,r5,lr} + ldr r4, _0802CF54 + ldr r2, [r4] + cmp r2, 0 + beq _0802CF4E + ldr r0, [r2, 0x34] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x3C + ldr r0, _0802CF58 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x3C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0802CF4E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802CF54: .4byte gUnknown_203B2F4 +_0802CF58: .4byte gUnknown_80DFD8C + thumb_func_end sub_802CF14 + + thumb_func_start sub_802CF5C +sub_802CF5C: + push {r4,lr} + ldr r4, _0802CFCC + ldr r0, [r4] + ldrh r1, [r0, 0x20] + adds r0, 0x9C + movs r2, 0 + strb r1, [r0] + ldr r0, [r4] + ldrh r1, [r0, 0x1E] + adds r0, 0x9D + strb r1, [r0] + ldr r0, [r4] + adds r0, 0x9E + movs r1, 0xC + strb r1, [r0] + ldr r0, [r4] + adds r0, 0x9F + strb r2, [r0] + ldr r0, [r4] + movs r1, 0x1A + ldrsh r0, [r0, r1] + movs r1, 0x18 + bl sub_8009614 + adds r0, 0x2 + lsls r0, 16 + ldr r2, [r4] + ldr r3, [r2, 0x34] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x4A + asrs r3, r0, 16 + lsrs r0, 16 + strh r0, [r1] + ldr r1, [r2, 0x34] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r2, r0 + adds r3, 0x2 + adds r2, 0x4C + strh r3, [r2] + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x3C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802CFCC: .4byte gUnknown_203B2F4 + thumb_func_end sub_802CF5C + + thumb_func_start sub_802CFD0 +sub_802CFD0: + push {r4-r6,lr} + sub sp, 0x60 + ldr r6, _0802D02C + ldr r0, [r6] + ldr r0, [r0, 0x34] + bl sub_8008C54 + ldr r0, [r6] + ldr r0, [r0, 0x34] + bl sub_80073B8 + ldr r0, [r6] + movs r1, 0x1E + ldrsh r4, [r0, r1] + lsls r4, 3 + adds r5, r4, 0 + adds r5, 0xA + ldr r2, _0802D030 + ldr r3, [r0, 0x34] + movs r0, 0 + str r0, [sp] + adds r0, r5, 0 + movs r1, 0 + bl xxx_call_draw_string + adds r4, 0x4 + ldr r1, [r6] + adds r0, r1, 0 + adds r0, 0x9E + ldrb r0, [r0] + lsls r0, 3 + adds r5, r4, r0 + movs r0, 0x1E + ldrsh r2, [r1, r0] + adds r2, 0x1 + movs r0, 0x7 + str r0, [sp] + ldr r0, [r1, 0x34] + str r0, [sp, 0x4] + adds r0, r5, 0 + movs r1, 0 + movs r3, 0x2 + bl sub_8012BC4 + movs r5, 0 + b _0802D076 + .align 2, 0 +_0802D02C: .4byte gUnknown_203B2F4 +_0802D030: .4byte gUnknown_80DFDBC +_0802D034: + ldr r0, [r6] + movs r2, 0x1E + ldrsh r1, [r0, r2] + movs r2, 0x1C + ldrsh r0, [r0, r2] + muls r0, r1 + adds r0, r5 + lsls r0, 24 + lsrs r0, 24 + bl sub_803B344 + adds r4, r0, 0 + ldr r0, [r6] + ldr r1, [r0, 0x34] + str r1, [sp, 0x8] + adds r1, r5, 0 + bl sub_8013800 + str r0, [sp, 0x50] + adds r0, r4, 0 + add r1, sp, 0x8 + bl sub_803B35C + mov r1, sp + adds r1, 0x4B + movs r0, 0x1 + strb r0, [r1] + ldr r0, [r4, 0x14] + str r0, [sp, 0x54] + add r0, sp, 0x8 + bl sub_803B6D4 + adds r5, 0x1 +_0802D076: + ldr r0, [r6] + movs r1, 0x1A + ldrsh r0, [r0, r1] + cmp r5, r0 + blt _0802D034 + ldr r0, _0802D094 + ldr r0, [r0] + ldr r0, [r0, 0x34] + bl sub_80073E0 + add sp, 0x60 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0802D094: .4byte gUnknown_203B2F4 + thumb_func_end sub_802CFD0 + + thumb_func_start sub_802D098 +sub_802D098: + push {r4-r6,lr} + adds r4, r0, 0 + ldr r6, _0802D0DC + movs r0, 0x82 + lsls r0, 2 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r6] + movs r5, 0 + str r5, [r0, 0x6C] + str r5, [r0, 0x70] + str r5, [r0, 0x74] + str r4, [r0, 0xC] + strb r5, [r0, 0x8] + ldr r0, [r6] + adds r0, 0xA + bl sub_8099328 + ldr r1, [r6] + strb r0, [r1, 0x9] + bl sub_8011C1C + cmp r0, 0x2 + beq _0802D0CE + ldr r0, [r6] + strb r5, [r0, 0x9] +_0802D0CE: + movs r0, 0 + bl sub_802D1A0 + movs r0, 0x1 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0802D0DC: .4byte gUnknown_203B2F8 + thumb_func_end sub_802D098 + + thumb_func_start sub_802D0E0 +sub_802D0E0: + push {lr} + ldr r0, _0802D0F8 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0x10 + bhi _0802D16C + lsls r0, 2 + ldr r1, _0802D0FC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802D0F8: .4byte gUnknown_203B2F8 +_0802D0FC: .4byte _0802D100 + .align 2, 0 +_0802D100: + .4byte _0802D170 + .4byte _0802D144 + .4byte _0802D168 + .4byte _0802D16C + .4byte _0802D16C + .4byte _0802D16C + .4byte _0802D16C + .4byte _0802D16C + .4byte _0802D16C + .4byte _0802D162 + .4byte _0802D16C + .4byte _0802D14A + .4byte _0802D14A + .4byte _0802D150 + .4byte _0802D156 + .4byte _0802D15C + .4byte _0802D15C +_0802D144: + bl sub_802D7D0 + b _0802D170 +_0802D14A: + bl sub_802D8CC + b _0802D170 +_0802D150: + bl sub_802D940 + b _0802D170 +_0802D156: + bl sub_802D9F0 + b _0802D170 +_0802D15C: + bl sub_802DA60 + b _0802D170 +_0802D162: + bl sub_802D82C + b _0802D170 +_0802D168: + movs r0, 0x3 + b _0802D172 +_0802D16C: + bl sub_802DA84 +_0802D170: + movs r0, 0 +_0802D172: + pop {r1} + bx r1 + thumb_func_end sub_802D0E0 + + thumb_func_start sub_802D178 +sub_802D178: + ldr r0, _0802D180 + ldr r0, [r0] + ldrb r0, [r0, 0x8] + bx lr + .align 2, 0 +_0802D180: .4byte gUnknown_203B2F8 + thumb_func_end sub_802D178 + + thumb_func_start sub_802D184 +sub_802D184: + push {r4,lr} + ldr r4, _0802D19C + ldr r0, [r4] + cmp r0, 0 + beq _0802D196 + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0802D196: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802D19C: .4byte gUnknown_203B2F8 + thumb_func_end sub_802D184 + + thumb_func_start sub_802D1A0 +sub_802D1A0: + push {lr} + ldr r1, _0802D1B4 + ldr r1, [r1] + str r0, [r1] + bl sub_802D1B8 + bl sub_802D2A8 + pop {r0} + bx r0 + .align 2, 0 +_0802D1B4: .4byte gUnknown_203B2F8 + thumb_func_end sub_802D1A0 + + thumb_func_start sub_802D1B8 +sub_802D1B8: + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, _0802D1E0 + ldr r0, [r4] + movs r1, 0xD4 + lsls r1, 1 + adds r0, r1 + bl sub_8006518 + ldr r0, [r4] + ldr r0, [r0] + cmp r0, 0xD + beq _0802D1EA + cmp r0, 0xD + bgt _0802D1E4 + cmp r0, 0x2 + beq _0802D27E + b _0802D254 + .align 2, 0 +_0802D1E0: .4byte gUnknown_203B2F8 +_0802D1E4: + cmp r0, 0xE + beq _0802D21C + b _0802D254 +_0802D1EA: + bl sub_802D5A4 + ldr r2, [r4] + movs r0, 0xEC + lsls r0, 1 + adds r2, r0 + ldr r1, _0802D218 + ldm r1!, {r3,r5,r6} + stm r2!, {r3,r5,r6} + ldm r1!, {r3,r5,r7} + stm r2!, {r3,r5,r7} + ldr r1, [r4] + adds r0, r1, r0 + movs r6, 0x8C + lsls r6, 1 + adds r1, r6 + bl sub_8012CAC + ldr r0, [r4] + movs r7, 0xF2 + lsls r7, 1 + b _0802D246 + .align 2, 0 +_0802D218: .4byte gUnknown_80DFE04 +_0802D21C: + bl sub_802D63C + ldr r2, [r4] + movs r0, 0xF8 + lsls r0, 1 + adds r2, r0 + ldr r1, _0802D250 + ldm r1!, {r3,r5,r6} + stm r2!, {r3,r5,r6} + ldm r1!, {r3,r5,r7} + stm r2!, {r3,r5,r7} + ldr r1, [r4] + adds r0, r1, r0 + movs r6, 0xAC + lsls r6, 1 + adds r1, r6 + bl sub_8012CAC + ldr r0, [r4] + movs r7, 0xFE + lsls r7, 1 +_0802D246: + adds r0, r7 + movs r1, 0x6 + strh r1, [r0] + b _0802D27E + .align 2, 0 +_0802D250: .4byte gUnknown_80DFE1C +_0802D254: + ldr r0, _0802D2A0 + mov r12, r0 + movs r1, 0xD4 + lsls r1, 1 + mov r8, r1 + ldr r4, _0802D2A4 + movs r3, 0 + movs r2, 0x3 +_0802D264: + mov r5, r12 + ldr r1, [r5] + adds r1, r3 + add r1, r8 + adds r0, r4, 0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r3, 0x18 + subs r2, 0x1 + cmp r2, 0 + bge _0802D264 +_0802D27E: + bl sub_8004914 + ldr r0, _0802D2A0 + ldr r0, [r0] + movs r6, 0xD4 + lsls r6, 1 + adds r0, r6 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0802D2A0: .4byte gUnknown_203B2F8 +_0802D2A4: .4byte gUnknown_80DFDD4 + thumb_func_end sub_802D1B8 + + thumb_func_start sub_802D2A8 +sub_802D2A8: + push {r4,lr} + sub sp, 0x14 + ldr r1, _0802D2C4 + ldr r0, [r1] + ldr r0, [r0] + adds r4, r1, 0 + cmp r0, 0x10 + bls _0802D2BA + b _0802D59A +_0802D2BA: + lsls r0, 2 + ldr r1, _0802D2C8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802D2C4: .4byte gUnknown_203B2F8 +_0802D2C8: .4byte _0802D2CC + .align 2, 0 +_0802D2CC: + .4byte _0802D310 + .4byte _0802D398 + .4byte _0802D59A + .4byte _0802D3B4 + .4byte _0802D3C4 + .4byte _0802D3D4 + .4byte _0802D3E4 + .4byte _0802D3F4 + .4byte _0802D404 + .4byte _0802D498 + .4byte _0802D4C8 + .4byte _0802D4E4 + .4byte _0802D4F0 + .4byte _0802D4F8 + .4byte _0802D524 + .4byte _0802D558 + .4byte _0802D576 +_0802D310: + ldr r0, [r4] + ldr r0, [r0, 0xC] + bl sub_80968B0 + lsls r0, 24 + cmp r0, 0 + beq _0802D326 + movs r0, 0x3 + bl sub_802D1A0 + b _0802D59A +_0802D326: + ldr r0, [r4] + ldr r0, [r0, 0xC] + bl sub_8096F50 + lsls r0, 24 + cmp r0, 0 + beq _0802D33C + movs r0, 0x4 + bl sub_802D1A0 + b _0802D59A +_0802D33C: + ldr r1, [r4] + ldr r0, [r1, 0xC] + ldrb r0, [r0, 0x2] + cmp r0, 0x4 + bne _0802D36E + adds r0, r1, 0 + adds r0, 0x10 + bl sub_8096C08 + lsls r0, 24 + cmp r0, 0 + beq _0802D36E + bl sub_802DAA8 + lsls r0, 24 + cmp r0, 0 + beq _0802D366 + movs r0, 0x9 + bl sub_802D1A0 + b _0802D59A +_0802D366: + movs r0, 0x5 + bl sub_802D1A0 + b _0802D59A +_0802D36E: + bl sub_80969AC + cmp r0, 0x7 + ble _0802D390 + bl sub_802DADC + lsls r0, 24 + cmp r0, 0 + beq _0802D388 + movs r0, 0xA + bl sub_802D1A0 + b _0802D59A +_0802D388: + movs r0, 0x6 + bl sub_802D1A0 + b _0802D59A +_0802D390: + movs r0, 0x8 + bl sub_802D1A0 + b _0802D59A +_0802D398: + bl sub_802D73C + ldr r0, _0802D3AC + ldr r1, _0802D3B0 + ldr r3, [r1] + ldr r2, [r3, 0x70] + movs r1, 0xAC + lsls r1, 1 + adds r3, r1 + b _0802D4AA + .align 2, 0 +_0802D3AC: .4byte gUnknown_80DFE4C +_0802D3B0: .4byte gUnknown_203B2F8 +_0802D3B4: + ldr r1, [r4] + movs r0, 0x2 + str r0, [r1, 0x4] + ldr r0, _0802D3C0 + b _0802D4D0 + .align 2, 0 +_0802D3C0: .4byte gUnknown_80DFE9C +_0802D3C4: + ldr r1, [r4] + movs r0, 0x2 + str r0, [r1, 0x4] + ldr r0, _0802D3D0 + b _0802D4D0 + .align 2, 0 +_0802D3D0: .4byte gUnknown_80DFED0 +_0802D3D4: + ldr r1, [r4] + movs r0, 0x2 + str r0, [r1, 0x4] + ldr r0, _0802D3E0 + b _0802D4D0 + .align 2, 0 +_0802D3E0: .4byte gUnknown_80DFF2C +_0802D3E4: + ldr r1, [r4] + movs r0, 0x2 + str r0, [r1, 0x4] + ldr r0, _0802D3F0 + b _0802D4D0 + .align 2, 0 +_0802D3F0: .4byte gUnknown_80DFFA4 +_0802D3F4: + ldr r1, [r4] + movs r0, 0xC + str r0, [r1, 0x4] + ldr r0, _0802D400 + b _0802D4D0 + .align 2, 0 +_0802D400: .4byte gUnknown_80E0010 +_0802D404: + ldr r4, _0802D45C + ldr r1, [r4] + movs r0, 0x1 + strb r0, [r1, 0x8] + ldr r0, [r4] + ldr r0, [r0, 0xC] + bl sub_8096A78 + bl sub_8096C80 + bl sub_8096D24 + ldr r0, [r4] + ldr r0, [r0, 0xC] + ldrb r0, [r0, 0x2] + cmp r0, 0x4 + bne _0802D446 + bl sub_8096DD8 + ldr r1, [r4] + ldr r1, [r1, 0xC] + ldr r1, [r1, 0x14] + movs r2, 0x28 + bl MemoryCopy8 + bl sub_8096DE8 + ldr r1, [r4] + ldr r1, [r1, 0xC] + ldr r1, [r1, 0x18] + movs r2, 0x78 + bl MemoryCopy8 +_0802D446: + ldr r0, [r4] + ldr r0, [r0, 0xC] + ldrb r0, [r0, 0x4] + cmp r0, 0x2C + beq _0802D46E + cmp r0, 0x2C + bgt _0802D460 + cmp r0, 0x2B + beq _0802D46A + b _0802D484 + .align 2, 0 +_0802D45C: .4byte gUnknown_203B2F8 +_0802D460: + cmp r0, 0x2D + beq _0802D472 + cmp r0, 0x2E + beq _0802D47C + b _0802D484 +_0802D46A: + movs r0, 0x2A + b _0802D474 +_0802D46E: + movs r0, 0x2B + b _0802D474 +_0802D472: + movs r0, 0x2C +_0802D474: + movs r1, 0x1 + bl sub_8097418 + b _0802D484 +_0802D47C: + movs r0, 0x2D + movs r1, 0x1 + bl sub_8097418 +_0802D484: + ldr r0, _0802D490 + ldr r1, [r0] + movs r0, 0x2 + str r0, [r1, 0x4] + ldr r0, _0802D494 + b _0802D4D0 + .align 2, 0 +_0802D490: .4byte gUnknown_203B2F8 +_0802D494: .4byte gUnknown_80E0074 +_0802D498: + bl sub_802D690 + ldr r0, _0802D4C0 + ldr r1, _0802D4C4 + ldr r3, [r1] + ldr r2, [r3, 0x74] + movs r4, 0xAC + lsls r4, 1 + adds r3, r4 +_0802D4AA: + movs r4, 0 + str r4, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r4, [sp, 0x8] + str r4, [sp, 0xC] + str r4, [sp, 0x10] + movs r1, 0 + bl sub_8014248 + b _0802D59A + .align 2, 0 +_0802D4C0: .4byte gUnknown_80E0094 +_0802D4C4: .4byte gUnknown_203B2F8 +_0802D4C8: + ldr r1, [r4] + movs r0, 0xB + str r0, [r1, 0x4] + ldr r0, _0802D4DC +_0802D4D0: + ldr r3, _0802D4E0 + movs r1, 0 + movs r2, 0 + bl sub_80141B4 + b _0802D59A + .align 2, 0 +_0802D4DC: .4byte gUnknown_80E0108 +_0802D4E0: .4byte 0x00000101 +_0802D4E4: + movs r0, 0 + movs r1, 0 + movs r2, 0x4 + bl sub_802C4C8 + b _0802D59A +_0802D4F0: + movs r0, 0x1 + bl sub_802C640 + b _0802D59A +_0802D4F8: + bl sub_802C750 + ldr r0, _0802D520 + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x78 + movs r3, 0x8C + lsls r3, 1 + adds r1, r2, r3 + movs r4, 0xCC + lsls r4, 1 + adds r3, r2, r4 + ldr r2, [r2, 0x6C] + str r2, [sp] + movs r2, 0x2 + str r2, [sp, 0x4] + movs r2, 0 + bl sub_8012D60 + b _0802D59A + .align 2, 0 +_0802D520: .4byte gUnknown_203B2F8 +_0802D524: + bl sub_802C750 + ldr r4, _0802D554 + ldr r0, [r4] + adds r0, 0x78 + movs r1, 0 + bl sub_8012EA4 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0xC8 + movs r2, 0xAC + lsls r2, 1 + adds r1, r2 + movs r2, 0x4 + str r2, [sp] + movs r2, 0x3 + str r2, [sp, 0x4] + movs r2, 0 + movs r3, 0 + bl sub_8012D60 + b _0802D59A + .align 2, 0 +_0802D554: .4byte gUnknown_203B2F8 +_0802D558: + ldr r0, [r4] + ldrb r0, [r0, 0x10] + bl sub_8096AB4 + ldr r1, [r4] + adds r1, 0x14 + bl sub_803B35C + ldr r0, [r4] + movs r1, 0x3 + str r1, [r0, 0x14] + adds r0, 0x14 + bl sub_802DE84 + b _0802D59A +_0802D576: + ldr r1, [r4] + ldr r0, [r1, 0xC] + adds r1, 0x14 + bl sub_803B35C + ldr r0, [r4] + movs r1, 0x3 + str r1, [r0, 0x14] + adds r0, 0x58 + movs r1, 0 + strb r1, [r0] + ldr r0, [r4] + ldr r1, [r0, 0xC] + ldr r1, [r1, 0x18] + str r1, [r0, 0x64] + adds r0, 0x14 + bl sub_802DE84 +_0802D59A: + add sp, 0x14 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_802D2A8 + + thumb_func_start sub_802D5A4 +sub_802D5A4: + push {r4-r7,lr} + ldr r4, _0802D630 + ldr r0, [r4] + movs r5, 0xCC + lsls r5, 1 + adds r0, r5 + movs r1, 0 + movs r2, 0x10 + bl MemoryFill16 + ldr r0, [r4] + mov r12, r0 + movs r3, 0 + movs r1, 0x8C + lsls r1, 1 + add r1, r12 + ldr r0, _0802D634 + ldr r0, [r0] + str r0, [r1] + movs r1, 0x8E + lsls r1, 1 + add r1, r12 + movs r0, 0x2 + str r0, [r1] + movs r2, 0x1 + movs r1, 0x90 + lsls r1, 1 + add r1, r12 + ldr r0, _0802D638 + ldr r0, [r0] + str r0, [r1] + movs r1, 0x92 + lsls r1, 1 + add r1, r12 + movs r0, 0x5 + str r0, [r1] + movs r7, 0x2 + movs r0, 0x94 + lsls r0, 1 + add r0, r12 + str r3, [r0] + movs r0, 0x96 + lsls r0, 1 + add r0, r12 + str r2, [r0] + movs r6, 0 + movs r3, 0x8E + lsls r3, 1 + add r3, r12 + mov r0, r12 + adds r2, r0, r5 +_0802D60A: + ldrh r0, [r2] + cmp r0, 0 + bne _0802D61A + ldr r1, [r3] + mov r5, r12 + ldr r0, [r5, 0x6C] + cmp r1, r0 + beq _0802D62A +_0802D61A: + adds r3, 0x8 + adds r2, 0x2 + adds r6, 0x1 + cmp r6, r7 + blt _0802D60A + ldr r1, [r4] + movs r0, 0x2 + str r0, [r1, 0x6C] +_0802D62A: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0802D630: .4byte gUnknown_203B2F8 +_0802D634: .4byte gUnknown_80D494C +_0802D638: .4byte gUnknown_80D4970 + thumb_func_end sub_802D5A4 + + thumb_func_start sub_802D63C +sub_802D63C: + ldr r0, _0802D684 + ldr r0, [r0] + mov r12, r0 + movs r3, 0 + movs r1, 0xAC + lsls r1, 1 + add r1, r12 + ldr r0, _0802D688 + ldr r0, [r0] + str r0, [r1] + movs r1, 0xAE + lsls r1, 1 + add r1, r12 + movs r0, 0x3 + str r0, [r1] + movs r2, 0x1 + movs r1, 0xB0 + lsls r1, 1 + add r1, r12 + ldr r0, _0802D68C + ldr r0, [r0] + str r0, [r1] + movs r1, 0xB2 + lsls r1, 1 + add r1, r12 + movs r0, 0x4 + str r0, [r1] + movs r0, 0xB4 + lsls r0, 1 + add r0, r12 + str r3, [r0] + movs r0, 0xB6 + lsls r0, 1 + add r0, r12 + str r2, [r0] + bx lr + .align 2, 0 +_0802D684: .4byte gUnknown_203B2F8 +_0802D688: .4byte gUnknown_80D4920 +_0802D68C: .4byte gUnknown_80D4928 + thumb_func_end sub_802D63C + + thumb_func_start sub_802D690 +sub_802D690: + push {r4,r5,lr} + ldr r2, _0802D728 + ldr r0, [r2] + mov r12, r0 + movs r4, 0 + movs r1, 0xAC + lsls r1, 1 + add r1, r12 + ldr r0, _0802D72C + ldr r0, [r0] + str r0, [r1] + movs r1, 0xAE + lsls r1, 1 + add r1, r12 + movs r0, 0x3 + str r0, [r1] + movs r3, 0x1 + movs r1, 0xB0 + lsls r1, 1 + add r1, r12 + ldr r0, _0802D730 + ldr r0, [r0] + str r0, [r1] + movs r1, 0xB2 + lsls r1, 1 + add r1, r12 + movs r0, 0x4 + str r0, [r1] + movs r1, 0xB4 + lsls r1, 1 + add r1, r12 + ldr r0, _0802D734 + str r0, [r1] + movs r1, 0xB6 + lsls r1, 1 + add r1, r12 + movs r0, 0x6 + str r0, [r1] + movs r1, 0xB8 + lsls r1, 1 + add r1, r12 + ldr r0, _0802D738 + str r0, [r1] + movs r1, 0xBA + lsls r1, 1 + add r1, r12 + movs r0, 0x7 + str r0, [r1] + movs r5, 0x4 + movs r0, 0xBC + lsls r0, 1 + add r0, r12 + str r4, [r0] + movs r0, 0xBE + lsls r0, 1 + add r0, r12 + str r3, [r0] + movs r3, 0 + mov r0, r12 + ldr r4, [r0, 0x74] + movs r1, 0xAE + lsls r1, 1 + add r1, r12 +_0802D70E: + ldr r0, [r1] + cmp r0, r4 + beq _0802D722 + adds r1, 0x8 + adds r3, 0x1 + cmp r3, r5 + blt _0802D70E + ldr r1, [r2] + movs r0, 0x4 + str r0, [r1, 0x74] +_0802D722: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802D728: .4byte gUnknown_203B2F8 +_0802D72C: .4byte gUnknown_80D4920 +_0802D730: .4byte gUnknown_80D4928 +_0802D734: .4byte gUnknown_80E014C +_0802D738: .4byte gUnknown_80E0158 + thumb_func_end sub_802D690 + + thumb_func_start sub_802D73C +sub_802D73C: + push {r4,r5,lr} + ldr r3, _0802D7C0 + ldr r0, [r3] + mov r12, r0 + movs r4, 0 + movs r1, 0xAC + lsls r1, 1 + add r1, r12 + ldr r0, _0802D7C4 + ldr r0, [r0] + str r0, [r1] + movs r1, 0xAE + lsls r1, 1 + add r1, r12 + movs r0, 0x3 + str r0, [r1] + movs r2, 0x1 + movs r1, 0xB0 + lsls r1, 1 + add r1, r12 + ldr r0, _0802D7C8 + ldr r0, [r0] + str r0, [r1] + movs r1, 0xB2 + lsls r1, 1 + add r1, r12 + movs r0, 0x4 + str r0, [r1] + movs r1, 0xB4 + lsls r1, 1 + add r1, r12 + ldr r0, _0802D7CC + str r0, [r1] + movs r1, 0xB6 + lsls r1, 1 + add r1, r12 + movs r0, 0x6 + str r0, [r1] + movs r5, 0x3 + movs r0, 0xB8 + lsls r0, 1 + add r0, r12 + str r4, [r0] + movs r0, 0xBA + lsls r0, 1 + add r0, r12 + str r2, [r0] + movs r2, 0 + mov r0, r12 + ldr r4, [r0, 0x70] + movs r1, 0xAE + lsls r1, 1 + add r1, r12 +_0802D7A6: + ldr r0, [r1] + cmp r0, r4 + beq _0802D7BA + adds r1, 0x8 + adds r2, 0x1 + cmp r2, r5 + blt _0802D7A6 + ldr r1, [r3] + movs r0, 0x4 + str r0, [r1, 0x70] +_0802D7BA: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802D7C0: .4byte gUnknown_203B2F8 +_0802D7C4: .4byte gUnknown_80D4920 +_0802D7C8: .4byte gUnknown_80D4928 +_0802D7CC: .4byte gUnknown_80E014C + thumb_func_end sub_802D73C + + thumb_func_start sub_802D7D0 +sub_802D7D0: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802D826 + ldr r1, [sp] + cmp r1, 0x1 + beq _0802D7EA + ldr r0, _0802D800 + ldr r0, [r0] + str r1, [r0, 0x70] +_0802D7EA: + ldr r0, [sp] + cmp r0, 0x3 + beq _0802D804 + cmp r0, 0x3 + ble _0802D820 + cmp r0, 0x4 + beq _0802D820 + cmp r0, 0x6 + beq _0802D80C + b _0802D820 + .align 2, 0 +_0802D800: .4byte gUnknown_203B2F8 +_0802D804: + movs r0, 0x2 + bl sub_802D1A0 + b _0802D826 +_0802D80C: + ldr r0, _0802D81C + ldr r1, [r0] + movs r0, 0x1 + str r0, [r1, 0x4] + movs r0, 0x10 + bl sub_802D1A0 + b _0802D826 + .align 2, 0 +_0802D81C: .4byte gUnknown_203B2F8 +_0802D820: + movs r0, 0 + bl sub_802D1A0 +_0802D826: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_802D7D0 + + thumb_func_start sub_802D82C +sub_802D82C: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802D8C6 + ldr r1, [sp] + cmp r1, 0x1 + beq _0802D846 + ldr r0, _0802D858 + ldr r0, [r0] + str r1, [r0, 0x74] +_0802D846: + ldr r0, [sp] + subs r0, 0x1 + cmp r0, 0x6 + bhi _0802D8C0 + lsls r0, 2 + ldr r1, _0802D85C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802D858: .4byte gUnknown_203B2F8 +_0802D85C: .4byte _0802D860 + .align 2, 0 +_0802D860: + .4byte _0802D8C0 + .4byte _0802D8C0 + .4byte _0802D87C + .4byte _0802D8C0 + .4byte _0802D8C0 + .4byte _0802D898 + .4byte _0802D8AC +_0802D87C: + ldr r0, _0802D894 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + bl sub_8096C3C + bl sub_8096C80 + movs r0, 0x8 + bl sub_802D1A0 + b _0802D8C6 + .align 2, 0 +_0802D894: .4byte gUnknown_203B2F8 +_0802D898: + ldr r0, _0802D8A8 + ldr r1, [r0] + movs r0, 0x9 + str r0, [r1, 0x4] + movs r0, 0x10 + bl sub_802D1A0 + b _0802D8C6 + .align 2, 0 +_0802D8A8: .4byte gUnknown_203B2F8 +_0802D8AC: + ldr r0, _0802D8BC + ldr r1, [r0] + movs r0, 0x9 + str r0, [r1, 0x4] + movs r0, 0xF + bl sub_802D1A0 + b _0802D8C6 + .align 2, 0 +_0802D8BC: .4byte gUnknown_203B2F8 +_0802D8C0: + movs r0, 0x1 + bl sub_802D1A0 +_0802D8C6: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_802D82C + + thumb_func_start sub_802D8CC +sub_802D8CC: + push {lr} + movs r0, 0x1 + bl sub_802C598 + cmp r0, 0x4 + bhi _0802D93A + lsls r0, 2 + ldr r1, _0802D8E4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802D8E4: .4byte _0802D8E8 + .align 2, 0 +_0802D8E8: + .4byte _0802D93A + .4byte _0802D93A + .4byte _0802D930 + .4byte _0802D8FC + .4byte _0802D914 +_0802D8FC: + bl sub_802C620 + ldr r1, _0802D910 + ldr r1, [r1] + strb r0, [r1, 0x10] + movs r0, 0xD + bl sub_802D1A0 + b _0802D93A + .align 2, 0 +_0802D910: .4byte gUnknown_203B2F8 +_0802D914: + bl sub_802C620 + ldr r2, _0802D92C + ldr r1, [r2] + strb r0, [r1, 0x10] + ldr r1, [r2] + movs r0, 0xC + str r0, [r1, 0x4] + movs r0, 0xF + bl sub_802D1A0 + b _0802D93A + .align 2, 0 +_0802D92C: .4byte gUnknown_203B2F8 +_0802D930: + bl sub_802C688 + movs r0, 0x1 + bl sub_802D1A0 +_0802D93A: + pop {r0} + bx r0 + thumb_func_end sub_802D8CC + + thumb_func_start sub_802D940 +sub_802D940: + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + bl sub_802C598 + ldr r4, _0802D980 + ldr r0, [r4] + adds r0, 0x78 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _0802D970 + ldr r0, [r4] + adds r0, 0x78 + mov r1, sp + bl sub_8013114 + ldr r1, [sp] + cmp r1, 0x1 + beq _0802D970 + ldr r0, [r4] + str r1, [r0, 0x6C] +_0802D970: + ldr r0, [sp] + cmp r0, 0x2 + beq _0802D98A + cmp r0, 0x2 + bgt _0802D984 + cmp r0, 0x1 + beq _0802D9E0 + b _0802D9E6 + .align 2, 0 +_0802D980: .4byte gUnknown_203B2F8 +_0802D984: + cmp r0, 0x5 + beq _0802D9CC + b _0802D9E6 +_0802D98A: + ldr r0, _0802D9BC + ldr r3, [r0] + ldrb r0, [r3, 0x9] + cmp r0, 0 + beq _0802D9C4 + ldr r2, _0802D9C0 + ldrb r1, [r3, 0x10] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + adds r0, 0xF0 + ldr r1, [r2] + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x5 + bls _0802D9C4 + ldrb r0, [r3, 0xA] + ldrb r1, [r1, 0x4] + cmp r0, r1 + bne _0802D9C4 + movs r0, 0x7 + bl sub_802D1A0 + b _0802D9E6 + .align 2, 0 +_0802D9BC: .4byte gUnknown_203B2F8 +_0802D9C0: .4byte gUnknown_203B490 +_0802D9C4: + movs r0, 0xE + bl sub_802D1A0 + b _0802D9E6 +_0802D9CC: + ldr r0, _0802D9DC + ldr r1, [r0] + movs r0, 0xC + str r0, [r1, 0x4] + movs r0, 0xF + bl sub_802D1A0 + b _0802D9E6 + .align 2, 0 +_0802D9DC: .4byte gUnknown_203B2F8 +_0802D9E0: + movs r0, 0xC + bl sub_802D1A0 +_0802D9E6: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_802D940 + + thumb_func_start sub_802D9F0 +sub_802D9F0: + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + bl sub_802C598 + ldr r4, _0802DA30 + ldr r0, [r4] + adds r0, 0x78 + bl sub_8012FD8 + ldr r0, [r4] + adds r0, 0xC8 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _0802DA1E + ldr r0, [r4] + adds r0, 0xC8 + mov r1, sp + bl sub_8013114 +_0802DA1E: + ldr r0, [sp] + cmp r0, 0x3 + beq _0802DA40 + cmp r0, 0x3 + bgt _0802DA34 + cmp r0, 0x1 + beq _0802DA38 + b _0802DA56 + .align 2, 0 +_0802DA30: .4byte gUnknown_203B2F8 +_0802DA34: + cmp r0, 0x4 + bne _0802DA56 +_0802DA38: + movs r0, 0xC + bl sub_802D1A0 + b _0802DA56 +_0802DA40: + bl sub_802C688 + ldr r0, [r4] + ldrb r0, [r0, 0x10] + bl sub_8096C3C + bl sub_8096C80 + movs r0, 0x8 + bl sub_802D1A0 +_0802DA56: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_802D9F0 + + thumb_func_start sub_802DA60 +sub_802DA60: + push {lr} + bl sub_802DEE0 + cmp r0, 0x1 + bls _0802DA7C + cmp r0, 0x3 + bhi _0802DA7C + bl sub_802DF24 + ldr r0, _0802DA80 + ldr r0, [r0] + ldr r0, [r0, 0x4] + bl sub_802D1A0 +_0802DA7C: + pop {r0} + bx r0 + .align 2, 0 +_0802DA80: .4byte gUnknown_203B2F8 + thumb_func_end sub_802DA60 + + thumb_func_start sub_802DA84 +sub_802DA84: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802DA9C + ldr r0, _0802DAA4 + ldr r0, [r0] + ldr r0, [r0, 0x4] + bl sub_802D1A0 +_0802DA9C: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_0802DAA4: .4byte gUnknown_203B2F8 + thumb_func_end sub_802DA84 + + thumb_func_start sub_802DAA8 +sub_802DAA8: + push {r4,lr} + ldr r4, _0802DAD0 + ldr r0, [r4] + ldrb r0, [r0, 0x10] + bl sub_8096AB4 + adds r1, r0, 0 + ldr r4, [r4] + ldrb r0, [r4, 0x9] + cmp r0, 0 + beq _0802DAD4 + ldrb r0, [r1] + cmp r0, 0x5 + beq _0802DAD4 + ldrb r0, [r4, 0xA] + ldrb r1, [r1, 0x4] + cmp r0, r1 + bne _0802DAD4 + movs r0, 0 + b _0802DAD6 + .align 2, 0 +_0802DAD0: .4byte gUnknown_203B2F8 +_0802DAD4: + movs r0, 0x1 +_0802DAD6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_802DAA8 + + thumb_func_start sub_802DADC +sub_802DADC: + push {r4,lr} + ldr r3, _0802DAEC + ldr r0, [r3] + ldrb r0, [r0, 0x9] + cmp r0, 0 + bne _0802DAF0 +_0802DAE8: + movs r0, 0x1 + b _0802DB1C + .align 2, 0 +_0802DAEC: .4byte gUnknown_203B2F8 +_0802DAF0: + ldr r0, _0802DB24 + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0xF0 + movs r2, 0 +_0802DAFA: + ldrb r0, [r1] + cmp r0, 0 + beq _0802DAE8 + cmp r0, 0x5 + beq _0802DAE8 + cmp r0, 0x5 + bls _0802DB12 + ldr r0, [r3] + ldrb r0, [r0, 0xA] + ldrb r4, [r1, 0x4] + cmp r0, r4 + bne _0802DAE8 +_0802DB12: + adds r1, 0x14 + adds r2, 0x1 + cmp r2, 0x7 + ble _0802DAFA + movs r0, 0 +_0802DB1C: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0802DB24: .4byte gUnknown_203B490 + thumb_func_end sub_802DADC + + thumb_func_start sub_802DB28 +sub_802DB28: + push {r4-r6,lr} + sub sp, 0x8 + adds r2, r1, 0 + lsls r0, 24 + lsrs r6, r0, 24 + lsls r2, 24 + lsrs r2, 24 + mov r0, sp + adds r1, r6, 0 + bl sub_8096AF8 + mov r0, sp + ldrb r0, [r0] + cmp r0, 0 + bne _0802DB4A + movs r0, 0 + b _0802DBC6 +_0802DB4A: + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r4, _0802DBD0 + movs r0, 0xA8 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r4] + adds r0, 0x30 + movs r5, 0 + strb r6, [r0] + adds r0, r6, 0 + bl sub_8096AB4 + ldr r1, [r4] + str r0, [r1, 0x34] + bl sub_8096EEC + ldr r1, [r4] + ldr r0, [r1, 0x34] + adds r1, 0x8 + bl sub_803C21C + ldr r0, [r4] + ldr r0, [r0, 0x34] + movs r1, 0xC + ldrsh r0, [r0, r1] + bl sub_808DDD0 + ldr r1, [r4] + str r0, [r1, 0x38] + str r5, [r1, 0x3C] + adds r1, 0x44 + strb r5, [r1] + ldr r0, [r4] + adds r0, 0x45 + strb r5, [r0] + ldr r0, [r4] + adds r0, 0x46 + strb r5, [r0] + ldr r2, [r4] + adds r1, r2, 0 + adds r1, 0x40 + movs r0, 0x2 + strh r0, [r1] + adds r1, 0x2 + movs r0, 0x8 + strh r0, [r1] + ldr r0, [r2, 0x38] + cmp r0, 0 + beq _0802DBBE + ldr r0, [r0, 0x4] + str r0, [r2, 0x3C] +_0802DBBE: + movs r0, 0 + bl sub_802DC28 + movs r0, 0x1 +_0802DBC6: + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0802DBD0: .4byte gUnknown_203B2FC + thumb_func_end sub_802DB28 + + thumb_func_start sub_802DBD4 +sub_802DBD4: + push {lr} + ldr r0, _0802DBEC + ldr r0, [r0] + ldr r1, [r0] + cmp r1, 0x6 + beq _0802DBF0 + cmp r1, 0x7 + bne _0802DBF6 + ldr r0, [r0, 0x34] + strb r1, [r0] + movs r0, 0x3 + b _0802DBFC + .align 2, 0 +_0802DBEC: .4byte gUnknown_203B2FC +_0802DBF0: + bl sub_802DE44 + b _0802DBFA +_0802DBF6: + bl sub_802DE60 +_0802DBFA: + movs r0, 0 +_0802DBFC: + pop {r1} + bx r1 + thumb_func_end sub_802DBD4 + + thumb_func_start sub_802DC00 +sub_802DC00: + push {r4,lr} + ldr r4, _0802DC24 + ldr r0, [r4] + cmp r0, 0 + beq _0802DC1E + ldr r0, [r0, 0x38] + cmp r0, 0 + beq _0802DC14 + bl sub_800AA14 +_0802DC14: + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0802DC1E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802DC24: .4byte gUnknown_203B2FC + thumb_func_end sub_802DC00 + + thumb_func_start sub_802DC28 +sub_802DC28: + push {lr} + ldr r1, _0802DC3C + ldr r1, [r1] + str r0, [r1] + bl sub_802DC40 + bl sub_802DC9C + pop {r0} + bx r0 + .align 2, 0 +_0802DC3C: .4byte gUnknown_203B2FC + thumb_func_end sub_802DC28 + + thumb_func_start sub_802DC40 +sub_802DC40: + push {r4-r7,lr} + ldr r4, _0802DC94 + ldr r0, [r4] + adds r0, 0x48 + bl sub_8006518 + ldr r0, [r4] + ldr r0, [r0] + cmp r0, 0 + beq _0802DC58 + cmp r0, 0x7 + bne _0802DC7A +_0802DC58: + mov r12, r4 + ldr r4, _0802DC98 + movs r3, 0 + movs r2, 0x3 +_0802DC60: + mov r0, r12 + ldr r1, [r0] + adds r1, r3 + adds r1, 0x48 + adds r0, r4, 0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r3, 0x18 + subs r2, 0x1 + cmp r2, 0 + bge _0802DC60 +_0802DC7A: + bl sub_8004914 + ldr r0, _0802DC94 + ldr r0, [r0] + adds r0, 0x48 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0802DC94: .4byte gUnknown_203B2FC +_0802DC98: .4byte gUnknown_80E016C + thumb_func_end sub_802DC40 + + thumb_func_start sub_802DC9C +sub_802DC9C: + push {r4,r5,lr} + ldr r1, _0802DCB8 + ldr r0, [r1] + ldr r0, [r0] + adds r5, r1, 0 + cmp r0, 0x7 + bls _0802DCAC + b _0802DE3E +_0802DCAC: + lsls r0, 2 + ldr r1, _0802DCBC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802DCB8: .4byte gUnknown_203B2FC +_0802DCBC: .4byte _0802DCC0 + .align 2, 0 +_0802DCC0: + .4byte _0802DCE0 + .4byte _0802DDDC + .4byte _0802DDE4 + .4byte _0802DDEC + .4byte _0802DDFC + .4byte _0802DDF4 + .4byte _0802DE34 + .4byte _0802DE3E +_0802DCE0: + ldr r0, _0802DD60 + ldr r1, [r5] + ldr r1, [r1, 0x34] + movs r2, 0xC + ldrsh r1, [r1, r2] + bl sub_808D8E0 + ldr r4, _0802DD64 + ldr r0, [r5] + ldr r0, [r0, 0x34] + movs r2, 0xC + ldrsh r1, [r0, r2] + adds r0, r4, 0 + bl sub_808D8E0 + ldr r0, [r5] + ldr r0, [r0, 0x34] + movs r1, 0xC + ldrsh r0, [r0, r1] + bl sub_808D994 + adds r1, r0, 0 + ldr r2, _0802DD68 + adds r0, r4, r2 + bl strcpy + ldr r0, [r5] + ldr r0, [r0, 0x34] + movs r1, 0xE + ldrsh r0, [r0, r1] + bl sub_808D994 + adds r1, r0, 0 + ldr r2, _0802DD6C + adds r4, r2 + adds r0, r4, 0 + bl strcpy + ldr r0, [r5] + ldr r0, [r0, 0x34] + movs r1, 0xC + ldrsh r0, [r0, r1] + bl sub_8098214 + ldr r0, _0802DD70 + ldr r1, [r5] + ldr r1, [r1, 0x34] + ldrb r1, [r1, 0x10] + movs r2, 0 + bl sub_8090DC4 + ldr r1, [r5] + movs r0, 0x6 + str r0, [r1, 0x4] + ldr r0, [r1, 0x34] + ldrb r0, [r0, 0x1] + cmp r0, 0x4 + bhi _0802DDD4 + lsls r0, 2 + ldr r1, _0802DD74 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802DD60: .4byte gUnknown_202E5D8 +_0802DD64: .4byte gUnknown_202E1C8 +_0802DD68: .4byte 0xfffffdd0 +_0802DD6C: .4byte 0xfffffe20 +_0802DD70: .4byte gUnknown_202DE58 +_0802DD74: .4byte _0802DD78 + .align 2, 0 +_0802DD78: + .4byte _0802DDD4 + .4byte _0802DD9C + .4byte _0802DDB8 + .4byte _0802DD94 + .4byte _0802DD8C +_0802DD8C: + movs r0, 0x5 + bl sub_802DC28 + b _0802DE3E +_0802DD94: + movs r0, 0x4 + bl sub_802DC28 + b _0802DE3E +_0802DD9C: + movs r0, 0x2 + bl sub_802DC28 + ldr r0, _0802DDB4 + ldr r0, [r0] + ldr r0, [r0, 0x34] + movs r2, 0xE + ldrsh r0, [r0, r2] + bl sub_8098214 + b _0802DE3E + .align 2, 0 +_0802DDB4: .4byte gUnknown_203B2FC +_0802DDB8: + movs r0, 0x3 + bl sub_802DC28 + ldr r0, _0802DDD0 + ldr r0, [r0] + ldr r0, [r0, 0x34] + movs r1, 0xE + ldrsh r0, [r0, r1] + bl sub_8098214 + b _0802DE3E + .align 2, 0 +_0802DDD0: .4byte gUnknown_203B2FC +_0802DDD4: + movs r0, 0x1 + bl sub_802DC28 + b _0802DE3E +_0802DDDC: + ldr r0, _0802DDE0 + b _0802DE1C + .align 2, 0 +_0802DDE0: .4byte gUnknown_80E0184 +_0802DDE4: + ldr r0, _0802DDE8 + b _0802DE1C + .align 2, 0 +_0802DDE8: .4byte gUnknown_80E01A0 +_0802DDEC: + ldr r0, _0802DDF0 + b _0802DE1C + .align 2, 0 +_0802DDF0: .4byte gUnknown_80E01C4 +_0802DDF4: + ldr r0, _0802DDF8 + b _0802DE1C + .align 2, 0 +_0802DDF8: .4byte gUnknown_80E01F0 +_0802DDFC: + ldr r0, [r5] + ldr r0, [r0, 0x34] + ldrb r0, [r0, 0x10] + bl sub_8091130 + adds r1, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0802DE1A + adds r0, r1, 0 + bl sub_80911F8 + bl sub_80910B4 +_0802DE1A: + ldr r0, _0802DE2C +_0802DE1C: + ldr r2, [r5] + adds r2, 0x38 + ldr r3, _0802DE30 + movs r1, 0 + bl sub_80141B4 + b _0802DE3E + .align 2, 0 +_0802DE2C: .4byte gUnknown_80E0218 +_0802DE30: .4byte 0x0000010d +_0802DE34: + ldr r0, [r5] + adds r0, 0x8 + movs r1, 0x1 + bl sub_802F204 +_0802DE3E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_802DC9C + + thumb_func_start sub_802DE44 +sub_802DE44: + push {lr} + bl sub_802F298 + cmp r0, 0x1 + bls _0802DE5C + cmp r0, 0x3 + bhi _0802DE5C + bl sub_802F2C0 + movs r0, 0x7 + bl sub_802DC28 +_0802DE5C: + pop {r0} + bx r0 + thumb_func_end sub_802DE44 + + thumb_func_start sub_802DE60 +sub_802DE60: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802DE78 + ldr r0, _0802DE80 + ldr r0, [r0] + ldr r0, [r0, 0x4] + bl sub_802DC28 +_0802DE78: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_0802DE80: .4byte gUnknown_203B2FC + thumb_func_end sub_802DE60 + + thumb_func_start sub_802DE84 +sub_802DE84: + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, _0802DED8 + movs r0, 0x7C + movs r1, 0x8 + bl MemoryAlloc + str r0, [r4] + str r5, [r0, 0xC] + bl sub_801317C + ldr r0, [r4] + ldr r1, [r0, 0xC] + ldr r2, [r1] + str r2, [r0, 0x10] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 3 + adds r1, 0x18 + adds r1, r0, r1 + str r1, [r0, 0x14] + adds r0, 0x18 + bl sub_8006518 + ldr r1, [r4] + ldr r2, [r1, 0x10] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r1, 0x18 + ldr r0, _0802DEDC + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + bl sub_802DF14 + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0802DED8: .4byte gUnknown_203B300 +_0802DEDC: .4byte gUnknown_80E0264 + thumb_func_end sub_802DE84 + + thumb_func_start sub_802DEE0 +sub_802DEE0: + push {lr} + ldr r0, _0802DF00 + ldr r0, [r0] + ldr r1, [r0, 0x10] + bl sub_8012A64 + cmp r0, 0x1 + beq _0802DF04 + cmp r0, 0x2 + bne _0802DF0E + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + b _0802DF10 + .align 2, 0 +_0802DF00: .4byte gUnknown_203B300 +_0802DF04: + movs r0, 0 + bl sub_80119D4 + movs r0, 0x3 + b _0802DF10 +_0802DF0E: + movs r0, 0 +_0802DF10: + pop {r1} + bx r1 + thumb_func_end sub_802DEE0 + + thumb_func_start sub_802DF14 +sub_802DF14: + push {lr} + bl sub_802DF6C + bl sub_802DF88 + pop {r0} + bx r0 + thumb_func_end sub_802DF14 + + thumb_func_start sub_802DF24 +sub_802DF24: + push {r4,r5,lr} + ldr r4, _0802DF64 + ldr r2, [r4] + cmp r2, 0 + beq _0802DF5E + ldr r0, [r2, 0x10] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x18 + ldr r0, _0802DF68 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x18 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0802DF5E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802DF64: .4byte gUnknown_203B300 +_0802DF68: .4byte gUnknown_80E0248 + thumb_func_end sub_802DF24 + + thumb_func_start sub_802DF6C +sub_802DF6C: + push {lr} + bl sub_8004914 + ldr r0, _0802DF84 + ldr r0, [r0] + adds r0, 0x18 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r0} + bx r0 + .align 2, 0 +_0802DF84: .4byte gUnknown_203B300 + thumb_func_end sub_802DF6C + + thumb_func_start sub_802DF88 +sub_802DF88: + push {r4,lr} + ldr r4, _0802DFAC + ldr r0, [r4] + ldr r0, [r0, 0x10] + bl sub_80073B8 + ldr r0, [r4] + ldr r0, [r0, 0xC] + bl sub_803B98C + ldr r0, [r4] + ldr r0, [r0, 0x10] + bl sub_80073E0 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802DFAC: .4byte gUnknown_203B300 + thumb_func_end sub_802DF88 + + thumb_func_start sub_802DFB0 +sub_802DFB0: + push {r4,lr} + ldr r4, _0802DFD4 + movs r0, 0xB6 + lsls r0, 1 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r4] + movs r1, 0 + str r1, [r0, 0x64] + str r1, [r0, 0x68] + movs r0, 0 + bl sub_802E088 + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0802DFD4: .4byte gUnknown_203B304 + thumb_func_end sub_802DFB0 + + thumb_func_start sub_802DFD8 +sub_802DFD8: + push {lr} + ldr r0, _0802DFF0 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0xB + bhi _0802E060 + lsls r0, 2 + ldr r1, _0802DFF4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802DFF0: .4byte gUnknown_203B304 +_0802DFF4: .4byte _0802DFF8 + .align 2, 0 +_0802DFF8: + .4byte _0802E028 + .4byte _0802E030 + .4byte _0802E036 + .4byte _0802E060 + .4byte _0802E03C + .4byte _0802E03C + .4byte _0802E042 + .4byte _0802E048 + .4byte _0802E04E + .4byte _0802E054 + .4byte _0802E054 + .4byte _0802E05A +_0802E028: + movs r0, 0x1 + bl sub_802E088 + b _0802E064 +_0802E030: + bl sub_802E4B0 + b _0802E064 +_0802E036: + bl nullsub_133 + b _0802E064 +_0802E03C: + bl sub_802E578 + b _0802E064 +_0802E042: + bl sub_802E60C + b _0802E064 +_0802E048: + bl sub_802E73C + b _0802E064 +_0802E04E: + bl sub_802E758 + b _0802E064 +_0802E054: + bl sub_802E774 + b _0802E064 +_0802E05A: + bl sub_802E7D0 + b _0802E064 +_0802E060: + movs r0, 0x3 + b _0802E066 +_0802E064: + movs r0, 0 +_0802E066: + pop {r1} + bx r1 + thumb_func_end sub_802DFD8 + + thumb_func_start sub_802E06C +sub_802E06C: + push {r4,lr} + ldr r4, _0802E084 + ldr r0, [r4] + cmp r0, 0 + beq _0802E07E + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0802E07E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802E084: .4byte gUnknown_203B304 + thumb_func_end sub_802E06C + + thumb_func_start sub_802E088 +sub_802E088: + push {lr} + ldr r1, _0802E09C + ldr r1, [r1] + str r0, [r1] + bl sub_802E0A0 + bl sub_802E1AC + pop {r0} + bx r0 + .align 2, 0 +_0802E09C: .4byte gUnknown_203B304 + thumb_func_end sub_802E088 + + thumb_func_start sub_802E0A0 +sub_802E0A0: + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, _0802E0C8 + ldr r0, [r4] + movs r6, 0x86 + lsls r6, 1 + adds r0, r6 + bl sub_8006518 + ldr r0, [r4] + ldr r5, [r0] + cmp r5, 0x1 + beq _0802E0D0 + cmp r5, 0x6 + beq _0802E124 + movs r3, 0 + ldr r2, _0802E0CC + b _0802E168 + .align 2, 0 +_0802E0C8: .4byte gUnknown_203B304 +_0802E0CC: .4byte gUnknown_80E0284 +_0802E0D0: + mov r12, r6 + ldr r0, _0802E118 + mov r8, r0 + movs r2, 0 + movs r3, 0x3 +_0802E0DA: + ldr r1, [r4] + adds r1, r2 + add r1, r12 + mov r0, r8 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r2, 0x18 + subs r3, 0x1 + cmp r3, 0 + bge _0802E0DA + bl sub_802E2B4 + ldr r3, _0802E11C + ldr r2, [r3] + movs r0, 0x9E + lsls r0, 1 + adds r2, r0 + ldr r1, _0802E120 + ldm r1!, {r4-r6} + stm r2!, {r4-r6} + ldm r1!, {r4,r5,r7} + stm r2!, {r4,r5,r7} + ldr r1, [r3] + adds r0, r1, r0 + adds r1, 0xBC + bl sub_8012CAC + b _0802E188 + .align 2, 0 +_0802E118: .4byte gUnknown_80E0284 +_0802E11C: .4byte gUnknown_203B304 +_0802E120: .4byte gUnknown_80E029C +_0802E124: + bl sub_802E3B8 + ldr r2, [r4] + movs r0, 0x9E + lsls r0, 1 + adds r2, r0 + ldr r1, _0802E160 + ldm r1!, {r3,r6,r7} + stm r2!, {r3,r6,r7} + ldm r1!, {r3,r6,r7} + stm r2!, {r3,r6,r7} + ldr r1, [r4] + adds r0, r1, r0 + adds r1, 0xBC + bl sub_8012CAC + ldr r1, [r4] + movs r4, 0xA4 + lsls r4, 1 + adds r0, r1, r4 + strh r5, [r0] + movs r5, 0xAA + lsls r5, 1 + adds r1, r5 + ldr r0, _0802E164 + ldm r0!, {r2,r6,r7} + stm r1!, {r2,r6,r7} + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + b _0802E188 + .align 2, 0 +_0802E160: .4byte gUnknown_80E02B4 +_0802E164: .4byte gUnknown_80E02CC +_0802E168: + ldr r0, [r4] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 3 + adds r0, r1 + movs r6, 0x86 + lsls r6, 1 + adds r0, r6 + adds r1, r2, 0 + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + adds r3, 0x1 + cmp r3, 0x3 + ble _0802E168 +_0802E188: + bl sub_8004914 + ldr r0, _0802E1A8 + ldr r0, [r0] + movs r7, 0x86 + lsls r7, 1 + adds r0, r7 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0802E1A8: .4byte gUnknown_203B304 + thumb_func_end sub_802E0A0 + + thumb_func_start sub_802E1AC +sub_802E1AC: + push {r4,lr} + sub sp, 0x8 + ldr r1, _0802E1C8 + ldr r0, [r1] + ldr r0, [r0] + adds r4, r1, 0 + cmp r0, 0xB + bhi _0802E2AA + lsls r0, 2 + ldr r1, _0802E1CC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802E1C8: .4byte gUnknown_203B304 +_0802E1CC: .4byte _0802E1D0 + .align 2, 0 +_0802E1D0: + .4byte _0802E2AA + .4byte _0802E200 + .4byte _0802E2AA + .4byte _0802E2AA + .4byte _0802E21E + .4byte _0802E22A + .4byte _0802E232 + .4byte _0802E260 + .4byte _0802E286 + .4byte _0802E28E + .4byte _0802E29A + .4byte _0802E2A2 +_0802E200: + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0x6C + adds r1, r2, 0 + adds r1, 0xBC + adds r3, r2, 0 + adds r3, 0xFC + ldr r2, [r2, 0x64] + str r2, [sp] + movs r2, 0x2 + str r2, [sp, 0x4] + movs r2, 0 + bl sub_8012D60 + b _0802E2AA +_0802E21E: + movs r0, 0 + movs r1, 0 + movs r2, 0x4 + bl sub_802BD14 + b _0802E2AA +_0802E22A: + movs r0, 0x1 + bl sub_802BE94 + b _0802E2AA +_0802E232: + bl sub_802BFA0 + movs r0, 0x3 + bl sub_802E7F8 + ldr r0, _0802E25C + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x6C + adds r1, r2, 0 + adds r1, 0xBC + ldr r2, [r2, 0x68] + str r2, [sp] + movs r2, 0x2 + str r2, [sp, 0x4] + movs r2, 0 + movs r3, 0 + bl sub_8012D60 + b _0802E2AA + .align 2, 0 +_0802E25C: .4byte gUnknown_203B304 +_0802E260: + ldr r0, [r4] + ldrb r0, [r0, 0x8] + bl sub_8095FE8 + ldr r1, [r4] + adds r1, 0xC + bl sub_803B35C + ldr r0, [r4] + movs r1, 0x3 + str r1, [r0, 0xC] + adds r0, 0x50 + movs r1, 0 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0xC + bl sub_802DE84 + b _0802E2AA +_0802E286: + movs r0, 0 + bl sub_802C860 + b _0802E2AA +_0802E28E: + movs r0, 0 + movs r1, 0 + movs r2, 0x8 + bl sub_802B640 + b _0802E2AA +_0802E29A: + movs r0, 0x1 + bl sub_802B7D0 + b _0802E2AA +_0802E2A2: + ldr r0, [r4] + ldrb r0, [r0, 0x9] + bl sub_802B9FC +_0802E2AA: + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_802E1AC + + thumb_func_start sub_802E2B4 +sub_802E2B4: + push {r4-r7,lr} + ldr r4, _0802E380 + ldr r0, [r4] + adds r0, 0xFC + movs r1, 0 + movs r2, 0x10 + bl MemoryFill16 + ldr r1, [r4] + adds r2, r1, 0 + adds r2, 0xBC + ldr r0, _0802E384 + str r0, [r2] + adds r1, 0xC0 + movs r0, 0x2 + str r0, [r1] + bl sub_802C0E8 + lsls r0, 24 + cmp r0, 0 + beq _0802E2E6 + ldr r0, [r4] + adds r0, 0xFC + movs r1, 0x1 + strh r1, [r0] +_0802E2E6: + movs r5, 0x1 + ldr r1, [r4] + movs r6, 0x1 + adds r2, r1, 0 + adds r2, 0xC4 + ldr r0, _0802E388 + str r0, [r2] + adds r1, 0xC8 + movs r0, 0x3 + str r0, [r1] + bl sub_802C83C + lsls r0, 24 + cmp r0, 0 + beq _0802E30A + ldr r0, [r4] + adds r0, 0xFE + strh r5, [r0] +_0802E30A: + ldr r1, [r4] + adds r2, r1, 0 + adds r2, 0xCC + ldr r0, _0802E38C + str r0, [r2] + adds r1, 0xD0 + movs r0, 0x4 + str r0, [r1] + bl sub_802B9D8 + lsls r0, 24 + cmp r0, 0 + beq _0802E32E + ldr r0, [r4] + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + strh r6, [r0] +_0802E32E: + movs r5, 0x3 + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0xD4 + movs r1, 0 + str r1, [r0] + adds r0, 0x4 + str r6, [r0] + movs r3, 0 + adds r6, r4, 0 + mov r12, r2 + mov r4, r12 + adds r4, 0xFC + adds r2, 0xC0 +_0802E34A: + ldrh r0, [r4] + cmp r0, 0 + bne _0802E35A + ldr r1, [r2] + mov r7, r12 + ldr r0, [r7, 0x64] + cmp r1, r0 + beq _0802E3B2 +_0802E35A: + adds r4, 0x2 + adds r2, 0x8 + adds r3, 0x1 + cmp r3, r5 + blt _0802E34A + movs r3, 0 + cmp r3, r5 + bge _0802E3B2 + ldr r1, [r6] + adds r0, r1, 0 + adds r0, 0xFC + ldrh r0, [r0] + cmp r0, 0 + bne _0802E390 + adds r0, r1, 0 + adds r0, 0xC0 + ldr r0, [r0] + str r0, [r1, 0x64] + b _0802E3B2 + .align 2, 0 +_0802E380: .4byte gUnknown_203B304 +_0802E384: .4byte gUnknown_80E02E4 +_0802E388: .4byte gUnknown_80E02F0 +_0802E38C: .4byte gUnknown_80E02FC +_0802E390: + adds r3, 0x1 + cmp r3, r5 + bge _0802E3B2 + ldr r2, [r6] + lsls r0, r3, 1 + adds r1, r2, 0 + adds r1, 0xFC + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _0802E390 + lsls r0, r3, 3 + adds r1, r2, 0 + adds r1, 0xC0 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x64] +_0802E3B2: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_802E2B4 + + thumb_func_start sub_802E3B8 +sub_802E3B8: + push {r4-r7,lr} + movs r5, 0 + ldr r4, _0802E3F0 + ldr r0, [r4] + ldrb r0, [r0, 0x8] + bl sub_8095FE8 + adds r7, r0, 0 + ldrb r0, [r7] + cmp r0, 0x1 + bne _0802E3FC + ldr r2, [r4] + adds r1, r2, 0 + adds r1, 0xBC + ldr r0, _0802E3F4 + str r0, [r1] + adds r1, 0x4 + movs r0, 0x6 + str r0, [r1] + adds r1, 0x4 + ldr r0, _0802E3F8 + str r0, [r1] + adds r1, 0x4 + movs r0, 0x7 + str r0, [r1] + movs r5, 0x2 + b _0802E44A + .align 2, 0 +_0802E3F0: .4byte gUnknown_203B304 +_0802E3F4: .4byte gUnknown_80E0308 +_0802E3F8: .4byte gUnknown_80E0310 +_0802E3FC: + ldr r1, [r4] + adds r2, r1, 0 + adds r2, 0xBC + ldr r0, _0802E494 + ldr r0, [r0] + str r0, [r2] + adds r1, 0xC0 + movs r0, 0x5 + str r0, [r1] + adds r0, r7, 0 + bl sub_80968B0 + lsls r0, 24 + cmp r0, 0 + bne _0802E422 + bl sub_80969AC + cmp r0, 0x7 + ble _0802E42C +_0802E422: + ldr r0, [r4] + adds r0, 0xC0 + movs r1, 0x1 + negs r1, r1 + str r1, [r0] +_0802E42C: + adds r5, 0x1 + ldr r4, _0802E498 + ldr r2, [r4] + lsls r3, r5, 3 + adds r0, r2, 0 + adds r0, 0xBC + adds r0, r3 + ldr r1, _0802E49C + ldr r1, [r1] + str r1, [r0] + adds r2, 0xC0 + adds r2, r3 + movs r0, 0x8 + str r0, [r2] + adds r5, 0x1 +_0802E44A: + mov r12, r4 + mov r0, r12 + ldr r4, [r0] + lsls r2, r5, 3 + adds r0, r4, 0 + adds r0, 0xBC + adds r0, r2 + movs r1, 0 + str r1, [r0] + adds r1, r4, 0 + adds r1, 0xC0 + adds r2, r1, r2 + movs r0, 0x1 + str r0, [r2] + movs r3, 0 + cmp r3, r5 + bge _0802E486 + movs r6, 0x1 + negs r6, r6 + adds r2, r1, 0 +_0802E472: + ldr r1, [r2] + cmp r1, r6 + beq _0802E47E + ldr r0, [r4, 0x68] + cmp r1, r0 + beq _0802E4A8 +_0802E47E: + adds r2, 0x8 + adds r3, 0x1 + cmp r3, r5 + blt _0802E472 +_0802E486: + ldrb r0, [r7] + cmp r0, 0x1 + bne _0802E4A0 + mov r0, r12 + ldr r1, [r0] + movs r0, 0x7 + b _0802E4A6 + .align 2, 0 +_0802E494: .4byte gUnknown_80D4990 +_0802E498: .4byte gUnknown_203B304 +_0802E49C: .4byte gUnknown_80D4970 +_0802E4A0: + mov r0, r12 + ldr r1, [r0] + movs r0, 0x8 +_0802E4A6: + str r0, [r1, 0x68] +_0802E4A8: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_802E3B8 + + thumb_func_start sub_802E4B0 +sub_802E4B0: + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + ldr r4, _0802E4F0 + ldr r0, [r4] + adds r0, 0x6C + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _0802E4DC + ldr r0, [r4] + adds r0, 0x6C + mov r1, sp + bl sub_8013114 + ldr r1, [sp] + cmp r1, 0x1 + beq _0802E4DC + ldr r0, [r4] + str r1, [r0, 0x64] +_0802E4DC: + ldr r0, [sp] + subs r0, 0x1 + cmp r0, 0x7 + bhi _0802E56E + lsls r0, 2 + ldr r1, _0802E4F4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802E4F0: .4byte gUnknown_203B304 +_0802E4F4: .4byte _0802E4F8 + .align 2, 0 +_0802E4F8: + .4byte _0802E568 + .4byte _0802E518 + .4byte _0802E52A + .4byte _0802E53C + .4byte _0802E56E + .4byte _0802E56E + .4byte _0802E56E + .4byte _0802E560 +_0802E518: + bl sub_802C0E8 + lsls r0, 24 + cmp r0, 0 + bne _0802E54E + movs r0, 0x4 + bl sub_802E088 + b _0802E56E +_0802E52A: + bl sub_802C83C + lsls r0, 24 + cmp r0, 0 + bne _0802E54E + movs r0, 0x8 + bl sub_802E088 + b _0802E56E +_0802E53C: + bl sub_802B9D8 + lsls r0, 24 + cmp r0, 0 + bne _0802E54E + movs r0, 0x9 + bl sub_802E088 + b _0802E56E +_0802E54E: + ldr r0, _0802E55C + ldr r0, [r0] + adds r0, 0x6C + movs r1, 0x1 + bl sub_8012EA4 + b _0802E56E + .align 2, 0 +_0802E55C: .4byte gUnknown_203B304 +_0802E560: + movs r0, 0x2 + bl sub_802E088 + b _0802E56E +_0802E568: + movs r0, 0x3 + bl sub_802E088 +_0802E56E: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_802E4B0 + + thumb_func_start sub_802E578 +sub_802E578: + push {r4,lr} + movs r0, 0x1 + bl sub_802BDEC + cmp r0, 0x4 + bhi _0802E606 + lsls r0, 2 + ldr r1, _0802E590 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802E590: .4byte _0802E594 + .align 2, 0 +_0802E594: + .4byte _0802E606 + .4byte _0802E606 + .4byte _0802E5FC + .4byte _0802E5A8 + .4byte _0802E5C0 +_0802E5A8: + bl sub_802BE74 + ldr r1, _0802E5BC + ldr r1, [r1] + strb r0, [r1, 0x8] + movs r0, 0x6 + bl sub_802E088 + b _0802E606 + .align 2, 0 +_0802E5BC: .4byte gUnknown_203B304 +_0802E5C0: + bl sub_802BE74 + ldr r4, _0802E5F0 + ldr r1, [r4] + strb r0, [r1, 0x8] + ldr r0, [r4] + ldrb r0, [r0, 0x8] + bl sub_8095FE8 + adds r2, r0, 0 + ldrb r0, [r2] + cmp r0, 0x1 + bne _0802E5F4 + ldr r1, [r4] + ldrb r0, [r2, 0x5] + strb r0, [r1, 0x9] + ldr r1, [r4] + movs r0, 0x5 + str r0, [r1, 0x4] + movs r0, 0xB + bl sub_802E088 + b _0802E606 + .align 2, 0 +_0802E5F0: .4byte gUnknown_203B304 +_0802E5F4: + movs r0, 0x7 + bl sub_802E088 + b _0802E606 +_0802E5FC: + bl sub_802BEDC + movs r0, 0x1 + bl sub_802E088 +_0802E606: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_802E578 + + thumb_func_start sub_802E60C +sub_802E60C: + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + bl sub_802BDEC + ldr r4, _0802E650 + ldr r0, [r4] + adds r0, 0x6C + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _0802E63C + ldr r0, [r4] + adds r0, 0x6C + mov r1, sp + bl sub_8013114 + ldr r1, [sp] + cmp r1, 0x1 + beq _0802E63C + ldr r0, [r4] + str r1, [r0, 0x68] +_0802E63C: + ldr r0, [sp] + subs r0, 0x1 + cmp r0, 0x7 + bhi _0802E732 + lsls r0, 2 + ldr r1, _0802E654 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802E650: .4byte gUnknown_203B304 +_0802E654: .4byte _0802E658 + .align 2, 0 +_0802E658: + .4byte _0802E72C + .4byte _0802E732 + .4byte _0802E732 + .4byte _0802E732 + .4byte _0802E678 + .4byte _0802E6BC + .4byte _0802E704 + .4byte _0802E6B4 +_0802E678: + ldr r0, _0802E6AC + bl sub_8011988 + ldr r4, _0802E6B0 + ldr r0, [r4] + ldrb r0, [r0, 0x8] + bl sub_8095FE8 + bl sub_8096A78 + bl sub_8096C80 + bl sub_8096D24 + ldr r0, [r4] + ldrb r0, [r0, 0x8] + bl sub_8096040 + bl sub_8096078 + bl sub_802C0E8 + lsls r0, 24 + cmp r0, 0 + bne _0802E6E8 + b _0802E6FC + .align 2, 0 +_0802E6AC: .4byte 0x00000133 +_0802E6B0: .4byte gUnknown_203B304 +_0802E6B4: + movs r0, 0x7 + bl sub_802E088 + b _0802E732 +_0802E6BC: + ldr r0, _0802E6F4 + bl sub_8011988 + ldr r4, _0802E6F8 + ldr r0, [r4] + ldrb r0, [r0, 0x8] + bl sub_8095FE8 + ldrb r0, [r0, 0x5] + bl sub_8096DF8 + ldr r0, [r4] + ldrb r0, [r0, 0x8] + bl sub_8096040 + bl sub_8096078 + bl sub_802C0E8 + lsls r0, 24 + cmp r0, 0 + beq _0802E6FC +_0802E6E8: + bl sub_802BEDC + movs r0, 0x1 + bl sub_802E088 + b _0802E732 + .align 2, 0 +_0802E6F4: .4byte 0x00000133 +_0802E6F8: .4byte gUnknown_203B304 +_0802E6FC: + movs r0, 0x5 + bl sub_802E088 + b _0802E732 +_0802E704: + movs r0, 0 + bl sub_80119D4 + ldr r4, _0802E728 + ldr r0, [r4] + ldrb r0, [r0, 0x8] + bl sub_8095FE8 + ldr r1, [r4] + ldrb r0, [r0, 0x5] + strb r0, [r1, 0x9] + ldr r1, [r4] + movs r0, 0x5 + str r0, [r1, 0x4] + movs r0, 0xB + bl sub_802E088 + b _0802E732 + .align 2, 0 +_0802E728: .4byte gUnknown_203B304 +_0802E72C: + movs r0, 0x5 + bl sub_802E088 +_0802E732: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_802E60C + + thumb_func_start sub_802E73C +sub_802E73C: + push {lr} + bl sub_802DEE0 + cmp r0, 0x1 + bls _0802E754 + cmp r0, 0x3 + bhi _0802E754 + bl sub_802DF24 + movs r0, 0x5 + bl sub_802E088 +_0802E754: + pop {r0} + bx r0 + thumb_func_end sub_802E73C + + thumb_func_start sub_802E758 +sub_802E758: + push {lr} + bl sub_802C898 + cmp r0, 0x1 + bls _0802E770 + cmp r0, 0x3 + bhi _0802E770 + bl sub_802C8F4 + movs r0, 0x1 + bl sub_802E088 +_0802E770: + pop {r0} + bx r0 + thumb_func_end sub_802E758 + + thumb_func_start sub_802E774 +sub_802E774: + push {lr} + movs r0, 0x1 + bl sub_802B720 + cmp r0, 0x4 + bhi _0802E7CA + lsls r0, 2 + ldr r1, _0802E78C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802E78C: .4byte _0802E790 + .align 2, 0 +_0802E790: + .4byte _0802E7CA + .4byte _0802E7CA + .4byte _0802E7C0 + .4byte _0802E7A4 + .4byte _0802E7A4 +_0802E7A4: + bl sub_802B7A8 + ldr r2, _0802E7BC + ldr r1, [r2] + strb r0, [r1, 0x9] + ldr r1, [r2] + movs r0, 0xA + str r0, [r1, 0x4] + movs r0, 0xB + bl sub_802E088 + b _0802E7CA + .align 2, 0 +_0802E7BC: .4byte gUnknown_203B304 +_0802E7C0: + bl sub_802B81C + movs r0, 0x1 + bl sub_802E088 +_0802E7CA: + pop {r0} + bx r0 + thumb_func_end sub_802E774 + + thumb_func_start sub_802E7D0 +sub_802E7D0: + push {lr} + bl sub_802BA8C + cmp r0, 0x1 + bls _0802E7EC + cmp r0, 0x3 + bhi _0802E7EC + bl sub_802BACC + ldr r0, _0802E7F0 + ldr r0, [r0] + ldr r0, [r0, 0x4] + bl sub_802E088 +_0802E7EC: + pop {r0} + bx r0 + .align 2, 0 +_0802E7F0: .4byte gUnknown_203B304 + thumb_func_end sub_802E7D0 + + thumb_func_start nullsub_133 +nullsub_133: + bx lr + thumb_func_end nullsub_133 + + thumb_func_start sub_802E7F8 +sub_802E7F8: + push {r4-r6,lr} + sub sp, 0x8 + adds r4, r0, 0 + bl sub_8008C54 + adds r0, r4, 0 + bl sub_80073B8 + ldr r2, _0802E85C + movs r6, 0 + str r6, [sp] + movs r0, 0x3 + movs r1, 0 + adds r3, r4, 0 + bl xxx_call_draw_string + bl sub_80969AC + adds r2, r0, 0 + movs r5, 0x7 + str r5, [sp] + str r4, [sp, 0x4] + movs r0, 0x12 + movs r1, 0xD + movs r3, 0x2 + bl sub_8012BC4 + ldr r2, _0802E860 + str r6, [sp] + movs r0, 0x16 + movs r1, 0xD + adds r3, r4, 0 + bl xxx_call_draw_string + str r5, [sp] + str r4, [sp, 0x4] + movs r0, 0x23 + movs r1, 0xD + movs r2, 0x8 + movs r3, 0x2 + bl sub_8012BC4 + adds r0, r4, 0 + bl sub_80073E0 + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0802E85C: .4byte gUnknown_80E0318 +_0802E860: .4byte gUnknown_80E0324 + thumb_func_end sub_802E7F8 + + thumb_func_start sub_802E864 +sub_802E864: + push {r4,lr} + ldr r4, _0802E88C + movs r0, 0xB6 + lsls r0, 1 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r4] + movs r1, 0 + str r1, [r0, 0x64] + str r1, [r0, 0x68] + str r1, [r0, 0x4] + movs r0, 0 + bl sub_802E934 + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0802E88C: .4byte gUnknown_203B308 + thumb_func_end sub_802E864 + + thumb_func_start sub_802E890 +sub_802E890: + push {lr} + ldr r0, _0802E8A8 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0x8 + bhi _0802E900 + lsls r0, 2 + ldr r1, _0802E8AC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802E8A8: .4byte gUnknown_203B308 +_0802E8AC: .4byte _0802E8B0 + .align 2, 0 +_0802E8B0: + .4byte _0802E8D4 + .4byte _0802E8DC + .4byte _0802E8E2 + .4byte _0802E900 + .4byte _0802E8E8 + .4byte _0802E8E8 + .4byte _0802E8EE + .4byte _0802E8F4 + .4byte _0802E8FA +_0802E8D4: + movs r0, 0x1 + bl sub_802E934 + b _0802E904 +_0802E8DC: + bl sub_802ECB4 + b _0802E904 +_0802E8E2: + bl nullsub_134 + b _0802E904 +_0802E8E8: + bl sub_802ED4C + b _0802E904 +_0802E8EE: + bl sub_802EDBC + b _0802E904 +_0802E8F4: + bl sub_802EEA0 + b _0802E904 +_0802E8FA: + bl sub_802EEBC + b _0802E904 +_0802E900: + movs r0, 0x3 + b _0802E906 +_0802E904: + movs r0, 0 +_0802E906: + pop {r1} + bx r1 + thumb_func_end sub_802E890 + + thumb_func_start sub_802E90C +sub_802E90C: + ldr r0, _0802E914 + ldr r0, [r0] + ldr r0, [r0, 0x4] + bx lr + .align 2, 0 +_0802E914: .4byte gUnknown_203B308 + thumb_func_end sub_802E90C + + thumb_func_start sub_802E918 +sub_802E918: + push {r4,lr} + ldr r4, _0802E930 + ldr r0, [r4] + cmp r0, 0 + beq _0802E92A + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0802E92A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802E930: .4byte gUnknown_203B308 + thumb_func_end sub_802E918 + + thumb_func_start sub_802E934 +sub_802E934: + push {lr} + ldr r1, _0802E948 + ldr r1, [r1] + str r0, [r1] + bl sub_802E94C + bl sub_802EA58 + pop {r0} + bx r0 + .align 2, 0 +_0802E948: .4byte gUnknown_203B308 + thumb_func_end sub_802E934 + + thumb_func_start sub_802E94C +sub_802E94C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, _0802E974 + ldr r0, [r4] + movs r6, 0x86 + lsls r6, 1 + adds r0, r6 + bl sub_8006518 + ldr r0, [r4] + ldr r5, [r0] + cmp r5, 0x1 + beq _0802E97C + cmp r5, 0x6 + beq _0802E9D0 + movs r3, 0 + ldr r2, _0802E978 + b _0802EA14 + .align 2, 0 +_0802E974: .4byte gUnknown_203B308 +_0802E978: .4byte gUnknown_80E0330 +_0802E97C: + mov r12, r6 + ldr r0, _0802E9C4 + mov r8, r0 + movs r2, 0 + movs r3, 0x3 +_0802E986: + ldr r1, [r4] + adds r1, r2 + add r1, r12 + mov r0, r8 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r2, 0x18 + subs r3, 0x1 + cmp r3, 0 + bge _0802E986 + bl sub_802EB34 + ldr r3, _0802E9C8 + ldr r2, [r3] + movs r0, 0x9E + lsls r0, 1 + adds r2, r0 + ldr r1, _0802E9CC + ldm r1!, {r4-r6} + stm r2!, {r4-r6} + ldm r1!, {r4,r5,r7} + stm r2!, {r4,r5,r7} + ldr r1, [r3] + adds r0, r1, r0 + adds r1, 0xBC + bl sub_8012CAC + b _0802EA34 + .align 2, 0 +_0802E9C4: .4byte gUnknown_80E0330 +_0802E9C8: .4byte gUnknown_203B308 +_0802E9CC: .4byte gUnknown_80E0348 +_0802E9D0: + bl sub_802EC10 + ldr r2, [r4] + movs r0, 0x9E + lsls r0, 1 + adds r2, r0 + ldr r1, _0802EA0C + ldm r1!, {r3,r6,r7} + stm r2!, {r3,r6,r7} + ldm r1!, {r3,r6,r7} + stm r2!, {r3,r6,r7} + ldr r1, [r4] + adds r0, r1, r0 + adds r1, 0xBC + bl sub_8012CAC + ldr r1, [r4] + movs r4, 0xA4 + lsls r4, 1 + adds r0, r1, r4 + strh r5, [r0] + movs r5, 0xAA + lsls r5, 1 + adds r1, r5 + ldr r0, _0802EA10 + ldm r0!, {r2,r6,r7} + stm r1!, {r2,r6,r7} + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + b _0802EA34 + .align 2, 0 +_0802EA0C: .4byte gUnknown_80E0360 +_0802EA10: .4byte gUnknown_80E0378 +_0802EA14: + ldr r0, [r4] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 3 + adds r0, r1 + movs r6, 0x86 + lsls r6, 1 + adds r0, r6 + adds r1, r2, 0 + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + adds r3, 0x1 + cmp r3, 0x3 + ble _0802EA14 +_0802EA34: + bl sub_8004914 + ldr r0, _0802EA54 + ldr r0, [r0] + movs r7, 0x86 + lsls r7, 1 + adds r0, r7 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0802EA54: .4byte gUnknown_203B308 + thumb_func_end sub_802E94C + + thumb_func_start sub_802EA58 +sub_802EA58: + push {r4,lr} + sub sp, 0x8 + ldr r1, _0802EA74 + ldr r0, [r1] + ldr r0, [r0] + adds r4, r1, 0 + cmp r0, 0x8 + bhi _0802EB2C + lsls r0, 2 + ldr r1, _0802EA78 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802EA74: .4byte gUnknown_203B308 +_0802EA78: .4byte _0802EA7C + .align 2, 0 +_0802EA7C: + .4byte _0802EB2C + .4byte _0802EAA0 + .4byte _0802EB2C + .4byte _0802EB2C + .4byte _0802EABE + .4byte _0802EACA + .4byte _0802EAD2 + .4byte _0802EB00 + .4byte _0802EB26 +_0802EAA0: + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0x6C + adds r1, r2, 0 + adds r1, 0xBC + adds r3, r2, 0 + adds r3, 0xFC + ldr r2, [r2, 0x64] + str r2, [sp] + movs r2, 0x2 + str r2, [sp, 0x4] + movs r2, 0 + bl sub_8012D60 + b _0802EB2C +_0802EABE: + movs r0, 0 + movs r1, 0 + movs r2, 0x4 + bl sub_802C10C + b _0802EB2C +_0802EACA: + movs r0, 0x1 + bl sub_802C28C + b _0802EB2C +_0802EAD2: + bl sub_802C39C + movs r0, 0x3 + bl sub_802EEDC + ldr r0, _0802EAFC + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x6C + adds r1, r2, 0 + adds r1, 0xBC + ldr r2, [r2, 0x68] + str r2, [sp] + movs r2, 0x2 + str r2, [sp, 0x4] + movs r2, 0 + movs r3, 0 + bl sub_8012D60 + b _0802EB2C + .align 2, 0 +_0802EAFC: .4byte gUnknown_203B308 +_0802EB00: + ldr r0, [r4] + ldrb r0, [r0, 0x8] + bl sub_8096574 + ldr r1, [r4] + adds r1, 0xC + bl sub_803B35C + ldr r0, [r4] + movs r1, 0x3 + str r1, [r0, 0xC] + adds r0, 0x50 + movs r1, 0 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0xC + bl sub_802DE84 + b _0802EB2C +_0802EB26: + movs r0, 0 + bl sub_802C860 +_0802EB2C: + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_802EA58 + + thumb_func_start sub_802EB34 +sub_802EB34: + push {r4-r7,lr} + ldr r4, _0802EBDC + ldr r0, [r4] + adds r0, 0xFC + movs r1, 0 + movs r2, 0x10 + bl MemoryFill16 + ldr r1, [r4] + adds r2, r1, 0 + adds r2, 0xBC + ldr r0, _0802EBE0 + str r0, [r2] + adds r1, 0xC0 + movs r0, 0x2 + str r0, [r1] + bl sub_802C4A4 + lsls r0, 24 + cmp r0, 0 + beq _0802EB66 + ldr r0, [r4] + adds r0, 0xFC + movs r1, 0x1 + strh r1, [r0] +_0802EB66: + movs r5, 0x1 + ldr r1, [r4] + adds r2, r1, 0 + adds r2, 0xC4 + ldr r0, _0802EBE4 + str r0, [r2] + adds r1, 0xC8 + movs r0, 0x3 + str r0, [r1] + bl sub_802C83C + lsls r0, 24 + cmp r0, 0 + beq _0802EB88 + ldr r0, [r4] + adds r0, 0xFE + strh r5, [r0] +_0802EB88: + movs r5, 0x2 + ldr r2, [r4] + adds r1, r2, 0 + adds r1, 0xCC + movs r0, 0 + str r0, [r1] + adds r1, 0x4 + movs r0, 0x1 + str r0, [r1] + movs r3, 0 + adds r6, r4, 0 + mov r12, r2 + mov r4, r12 + adds r4, 0xFC + adds r2, 0xC0 +_0802EBA6: + ldrh r0, [r4] + cmp r0, 0 + bne _0802EBB6 + ldr r1, [r2] + mov r7, r12 + ldr r0, [r7, 0x64] + cmp r1, r0 + beq _0802EC0A +_0802EBB6: + adds r4, 0x2 + adds r2, 0x8 + adds r3, 0x1 + cmp r3, r5 + blt _0802EBA6 + movs r3, 0 + cmp r3, r5 + bge _0802EC0A + ldr r1, [r6] + adds r0, r1, 0 + adds r0, 0xFC + ldrh r0, [r0] + cmp r0, 0 + bne _0802EBE8 + adds r0, r1, 0 + adds r0, 0xC0 + ldr r0, [r0] + str r0, [r1, 0x64] + b _0802EC0A + .align 2, 0 +_0802EBDC: .4byte gUnknown_203B308 +_0802EBE0: .4byte gUnknown_80E0390 +_0802EBE4: .4byte gUnknown_80E03A0 +_0802EBE8: + adds r3, 0x1 + cmp r3, r5 + bge _0802EC0A + ldr r2, [r6] + lsls r0, r3, 1 + adds r1, r2, 0 + adds r1, 0xFC + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + bne _0802EBE8 + lsls r0, r3, 3 + adds r1, r2, 0 + adds r1, 0xC0 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0x64] +_0802EC0A: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_802EB34 + + thumb_func_start sub_802EC10 +sub_802EC10: + push {r4-r7,lr} + movs r6, 0 + ldr r4, _0802ECA8 + ldr r2, [r4] + adds r1, r2, 0 + adds r1, 0xBC + ldr r0, _0802ECAC + ldr r0, [r0] + str r0, [r1] + adds r1, 0x4 + movs r0, 0x4 + str r0, [r1] + ldrb r0, [r2, 0x8] + bl sub_8096574 + bl sub_80968B0 + lsls r0, 24 + cmp r0, 0 + bne _0802EC40 + bl sub_80969AC + cmp r0, 0x7 + ble _0802EC4A +_0802EC40: + ldr r0, [r4] + adds r0, 0xC0 + movs r1, 0x1 + negs r1, r1 + str r1, [r0] +_0802EC4A: + adds r6, 0x1 + ldr r4, _0802ECA8 + ldr r5, [r4] + lsls r1, r6, 3 + adds r2, r5, 0 + adds r2, 0xBC + adds r3, r2, r1 + ldr r0, _0802ECB0 + ldr r0, [r0] + str r0, [r3] + adds r3, r5, 0 + adds r3, 0xC0 + adds r1, r3, r1 + movs r0, 0x5 + str r0, [r1] + adds r6, 0x1 + lsls r1, r6, 3 + adds r2, r1 + movs r0, 0 + str r0, [r2] + adds r1, r3, r1 + movs r0, 0x1 + str r0, [r1] + movs r2, 0 + adds r7, r4, 0 + cmp r2, r6 + bge _0802EC9C + adds r4, r5, 0 + movs r5, 0x1 + negs r5, r5 + adds r1, r3, 0 +_0802EC88: + ldr r3, [r1] + cmp r3, r5 + beq _0802EC94 + ldr r0, [r4, 0x68] + cmp r3, r0 + beq _0802ECA2 +_0802EC94: + adds r1, 0x8 + adds r2, 0x1 + cmp r2, r6 + blt _0802EC88 +_0802EC9C: + ldr r1, [r7] + movs r0, 0x5 + str r0, [r1, 0x68] +_0802ECA2: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0802ECA8: .4byte gUnknown_203B308 +_0802ECAC: .4byte gUnknown_80D4990 +_0802ECB0: .4byte gUnknown_80D4970 + thumb_func_end sub_802EC10 + + thumb_func_start sub_802ECB4 +sub_802ECB4: + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + ldr r4, _0802ECF0 + ldr r0, [r4] + adds r0, 0x6C + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _0802ECE0 + ldr r0, [r4] + adds r0, 0x6C + mov r1, sp + bl sub_8013114 + ldr r1, [sp] + cmp r1, 0x1 + beq _0802ECE0 + ldr r0, [r4] + str r1, [r0, 0x64] +_0802ECE0: + ldr r0, [sp] + cmp r0, 0x2 + beq _0802ECFE + cmp r0, 0x2 + bgt _0802ECF4 + cmp r0, 0x1 + beq _0802ED3C + b _0802ED42 + .align 2, 0 +_0802ECF0: .4byte gUnknown_203B308 +_0802ECF4: + cmp r0, 0x3 + beq _0802ED10 + cmp r0, 0x5 + beq _0802ED34 + b _0802ED42 +_0802ECFE: + bl sub_802C4A4 + lsls r0, 24 + cmp r0, 0 + bne _0802ED22 + movs r0, 0x4 + bl sub_802E934 + b _0802ED42 +_0802ED10: + bl sub_802C83C + lsls r0, 24 + cmp r0, 0 + bne _0802ED22 + movs r0, 0x8 + bl sub_802E934 + b _0802ED42 +_0802ED22: + ldr r0, _0802ED30 + ldr r0, [r0] + adds r0, 0x6C + movs r1, 0x1 + bl sub_8012EA4 + b _0802ED42 + .align 2, 0 +_0802ED30: .4byte gUnknown_203B308 +_0802ED34: + movs r0, 0x2 + bl sub_802E934 + b _0802ED42 +_0802ED3C: + movs r0, 0x3 + bl sub_802E934 +_0802ED42: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_802ECB4 + + thumb_func_start sub_802ED4C +sub_802ED4C: + push {lr} + movs r0, 0x1 + bl sub_802C1E4 + cmp r0, 0x4 + bhi _0802EDB6 + lsls r0, 2 + ldr r1, _0802ED64 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802ED64: .4byte _0802ED68 + .align 2, 0 +_0802ED68: + .4byte _0802EDB6 + .4byte _0802EDB6 + .4byte _0802EDAC + .4byte _0802ED7C + .4byte _0802ED94 +_0802ED7C: + bl sub_802C26C + ldr r1, _0802ED90 + ldr r1, [r1] + strb r0, [r1, 0x8] + movs r0, 0x6 + bl sub_802E934 + b _0802EDB6 + .align 2, 0 +_0802ED90: .4byte gUnknown_203B308 +_0802ED94: + bl sub_802C26C + ldr r1, _0802EDA8 + ldr r1, [r1] + strb r0, [r1, 0x8] + movs r0, 0x7 + bl sub_802E934 + b _0802EDB6 + .align 2, 0 +_0802EDA8: .4byte gUnknown_203B308 +_0802EDAC: + bl sub_802C2D4 + movs r0, 0x1 + bl sub_802E934 +_0802EDB6: + pop {r0} + bx r0 + thumb_func_end sub_802ED4C + + thumb_func_start sub_802EDBC +sub_802EDBC: + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + bl sub_802C1E4 + ldr r4, _0802EDFC + ldr r0, [r4] + adds r0, 0x6C + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _0802EDEC + ldr r0, [r4] + adds r0, 0x6C + mov r1, sp + bl sub_8013114 + ldr r1, [sp] + cmp r1, 0x1 + beq _0802EDEC + ldr r0, [r4] + str r1, [r0, 0x68] +_0802EDEC: + ldr r0, [sp] + cmp r0, 0x4 + beq _0802EE06 + cmp r0, 0x4 + bgt _0802EE00 + cmp r0, 0x1 + beq _0802EE90 + b _0802EE96 + .align 2, 0 +_0802EDFC: .4byte gUnknown_203B308 +_0802EE00: + cmp r0, 0x5 + beq _0802EE88 + b _0802EE96 +_0802EE06: + ldr r0, _0802EE28 + bl sub_8011988 + ldr r4, _0802EE2C + ldr r0, [r4] + ldrb r0, [r0, 0x8] + bl sub_8096574 + ldrb r1, [r0] + cmp r1, 0x3 + beq _0802EE3C + cmp r1, 0x3 + bgt _0802EE30 + cmp r1, 0x2 + beq _0802EE36 + b _0802EE5E + .align 2, 0 +_0802EE28: .4byte 0x00000133 +_0802EE2C: .4byte gUnknown_203B308 +_0802EE30: + cmp r1, 0x4 + beq _0802EE42 + b _0802EE5E +_0802EE36: + ldr r0, [r4] + movs r1, 0x1 + b _0802EE46 +_0802EE3C: + ldr r0, [r4] + movs r1, 0x2 + b _0802EE46 +_0802EE42: + ldr r0, [r4] + movs r1, 0x3 +_0802EE46: + str r1, [r0, 0x4] + ldrb r0, [r0, 0x8] + bl sub_80965B8 + bl sub_80965F4 + bl sub_802C2D4 + movs r0, 0x3 + bl sub_802E934 + b _0802EE96 +_0802EE5E: + bl sub_8096A78 + bl sub_8096C80 + bl sub_8096D24 + bl sub_802C4A4 + lsls r0, 24 + cmp r0, 0 + beq _0802EE80 + bl sub_802C2D4 + movs r0, 0x1 + bl sub_802E934 + b _0802EE96 +_0802EE80: + movs r0, 0x5 + bl sub_802E934 + b _0802EE96 +_0802EE88: + movs r0, 0x7 + bl sub_802E934 + b _0802EE96 +_0802EE90: + movs r0, 0x5 + bl sub_802E934 +_0802EE96: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_802EDBC + + thumb_func_start sub_802EEA0 +sub_802EEA0: + push {lr} + bl sub_802DEE0 + cmp r0, 0x1 + bls _0802EEB8 + cmp r0, 0x3 + bhi _0802EEB8 + bl sub_802DF24 + movs r0, 0x5 + bl sub_802E934 +_0802EEB8: + pop {r0} + bx r0 + thumb_func_end sub_802EEA0 + + thumb_func_start sub_802EEBC +sub_802EEBC: + push {lr} + bl sub_802C898 + cmp r0, 0x1 + bls _0802EED4 + cmp r0, 0x3 + bhi _0802EED4 + bl sub_802C8F4 + movs r0, 0x1 + bl sub_802E934 +_0802EED4: + pop {r0} + bx r0 + thumb_func_end sub_802EEBC + + thumb_func_start nullsub_134 +nullsub_134: + bx lr + thumb_func_end nullsub_134 + + thumb_func_start sub_802EEDC +sub_802EEDC: + push {r4-r6,lr} + sub sp, 0x8 + adds r4, r0, 0 + bl sub_8008C54 + adds r0, r4, 0 + bl sub_80073B8 + ldr r2, _0802EF40 + movs r6, 0 + str r6, [sp] + movs r0, 0x3 + movs r1, 0 + adds r3, r4, 0 + bl xxx_call_draw_string + bl sub_80969AC + adds r2, r0, 0 + movs r5, 0x7 + str r5, [sp] + str r4, [sp, 0x4] + movs r0, 0x12 + movs r1, 0xD + movs r3, 0x2 + bl sub_8012BC4 + ldr r2, _0802EF44 + str r6, [sp] + movs r0, 0x16 + movs r1, 0xD + adds r3, r4, 0 + bl xxx_call_draw_string + str r5, [sp] + str r4, [sp, 0x4] + movs r0, 0x23 + movs r1, 0xD + movs r2, 0x8 + movs r3, 0x2 + bl sub_8012BC4 + adds r0, r4, 0 + bl sub_80073E0 + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0802EF40: .4byte gUnknown_80E03AC +_0802EF44: .4byte gUnknown_80E03B8 + thumb_func_end sub_802EEDC + + thumb_func_start sub_802EF48 +sub_802EF48: + push {r4,lr} + ldr r4, _0802EF68 + movs r0, 0xA8 + lsls r0, 1 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r4] + movs r0, 0 + bl sub_802EFEC + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0802EF68: .4byte gUnknown_203B30C + thumb_func_end sub_802EF48 + + thumb_func_start sub_802EF6C +sub_802EF6C: + push {lr} + ldr r0, _0802EF84 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0x5 + bhi _0802EFBA + lsls r0, 2 + ldr r1, _0802EF88 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802EF84: .4byte gUnknown_203B30C +_0802EF88: .4byte _0802EF8C + .align 2, 0 +_0802EF8C: + .4byte _0802EFA4 + .4byte _0802EFA4 + .4byte _0802EFAA + .4byte _0802EFB0 + .4byte _0802EFB6 + .4byte _0802EFBA +_0802EFA4: + bl sub_802F148 + b _0802EFBE +_0802EFAA: + bl sub_802F184 + b _0802EFBE +_0802EFB0: + bl sub_802F1E8 + b _0802EFBE +_0802EFB6: + movs r0, 0x3 + b _0802EFC0 +_0802EFBA: + movs r0, 0x2 + b _0802EFC0 +_0802EFBE: + movs r0, 0 +_0802EFC0: + pop {r1} + bx r1 + thumb_func_end sub_802EF6C + + thumb_func_start sub_802EFC4 +sub_802EFC4: + ldr r0, _0802EFCC + ldr r0, [r0] + ldrb r0, [r0, 0x4] + bx lr + .align 2, 0 +_0802EFCC: .4byte gUnknown_203B30C + thumb_func_end sub_802EFC4 + + thumb_func_start sub_802EFD0 +sub_802EFD0: + push {r4,lr} + ldr r4, _0802EFE8 + ldr r0, [r4] + cmp r0, 0 + beq _0802EFE2 + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0802EFE2: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802EFE8: .4byte gUnknown_203B30C + thumb_func_end sub_802EFD0 + + thumb_func_start sub_802EFEC +sub_802EFEC: + push {lr} + ldr r1, _0802F000 + ldr r1, [r1] + str r0, [r1] + bl sub_802F004 + bl sub_802F088 + pop {r0} + bx r0 + .align 2, 0 +_0802F000: .4byte gUnknown_203B30C + thumb_func_end sub_802EFEC + + thumb_func_start sub_802F004 +sub_802F004: + push {r4-r7,lr} + ldr r4, _0802F03C + ldr r0, [r4] + adds r0, 0xF0 + bl sub_8006518 + ldr r0, [r4] + ldr r0, [r0] + cmp r0, 0x2 + bne _0802F044 + bl sub_802F108 + ldr r2, [r4] + movs r0, 0x90 + lsls r0, 1 + adds r2, r0 + ldr r1, _0802F040 + ldm r1!, {r3,r5,r6} + stm r2!, {r3,r5,r6} + ldm r1!, {r3,r5,r7} + stm r2!, {r3,r5,r7} + ldr r1, [r4] + adds r0, r1, r0 + adds r1, 0xB0 + bl sub_8012CAC + b _0802F066 + .align 2, 0 +_0802F03C: .4byte gUnknown_203B30C +_0802F040: .4byte gUnknown_80E03F4 +_0802F044: + mov r12, r4 + ldr r4, _0802F080 + movs r2, 0 + movs r3, 0x3 +_0802F04C: + mov r6, r12 + ldr r1, [r6] + adds r1, r2 + adds r1, 0xF0 + adds r0, r4, 0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r2, 0x18 + subs r3, 0x1 + cmp r3, 0 + bge _0802F04C +_0802F066: + bl sub_8004914 + ldr r0, _0802F084 + ldr r0, [r0] + adds r0, 0xF0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0802F080: .4byte gUnknown_80E03C4 +_0802F084: .4byte gUnknown_203B30C + thumb_func_end sub_802F004 + + thumb_func_start sub_802F088 +sub_802F088: + push {r4-r6,lr} + sub sp, 0x8 + ldr r6, _0802F0A0 + ldr r0, [r6] + ldr r5, [r0] + cmp r5, 0x1 + beq _0802F0B6 + cmp r5, 0x1 + bgt _0802F0A4 + cmp r5, 0 + beq _0802F0AE + b _0802F100 + .align 2, 0 +_0802F0A0: .4byte gUnknown_203B30C +_0802F0A4: + cmp r5, 0x2 + beq _0802F0BE + cmp r5, 0x3 + beq _0802F0DA + b _0802F100 +_0802F0AE: + movs r0, 0 + bl sub_802CDD4 + b _0802F100 +_0802F0B6: + movs r0, 0x1 + bl sub_802CED8 + b _0802F100 +_0802F0BE: + bl sub_802CFD0 + ldr r1, [r6] + adds r0, r1, 0 + adds r0, 0x60 + adds r1, 0xB0 + movs r2, 0x3 + str r2, [sp] + str r5, [sp, 0x4] + movs r2, 0 + movs r3, 0 + bl sub_8012D60 + b _0802F100 +_0802F0DA: + ldrb r0, [r0, 0x4] + bl sub_803B344 + adds r4, r0, 0 + ldr r1, [r6] + adds r1, 0x8 + bl sub_803B35C + ldr r0, [r6] + str r5, [r0, 0x8] + adds r0, 0x4C + movs r1, 0 + strb r1, [r0] + ldr r0, [r6] + ldr r1, [r4, 0x18] + str r1, [r0, 0x58] + adds r0, 0x8 + bl sub_802DE84 +_0802F100: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_802F088 + + thumb_func_start sub_802F108 +sub_802F108: + ldr r0, _0802F13C + ldr r0, [r0] + mov r12, r0 + movs r3, 0 + mov r1, r12 + adds r1, 0xB0 + ldr r0, _0802F140 + str r0, [r1] + adds r1, 0x4 + movs r0, 0x2 + str r0, [r1] + movs r2, 0x1 + adds r1, 0x4 + ldr r0, _0802F144 + ldr r0, [r0] + str r0, [r1] + adds r1, 0x4 + movs r0, 0x3 + str r0, [r1] + mov r0, r12 + adds r0, 0xC0 + str r3, [r0] + adds r0, 0x4 + str r2, [r0] + bx lr + .align 2, 0 +_0802F13C: .4byte gUnknown_203B30C +_0802F140: .4byte gUnknown_80E040C +_0802F144: .4byte gUnknown_80D4970 + thumb_func_end sub_802F108 + + thumb_func_start sub_802F148 +sub_802F148: + push {lr} + movs r0, 0x1 + bl sub_802CE5C + cmp r0, 0x2 + beq _0802F174 + cmp r0, 0x2 + bcc _0802F17E + cmp r0, 0x3 + bne _0802F17E + bl sub_802CEBC + ldr r1, _0802F170 + ldr r1, [r1] + strb r0, [r1, 0x4] + movs r0, 0x2 + bl sub_802EFEC + b _0802F17E + .align 2, 0 +_0802F170: .4byte gUnknown_203B30C +_0802F174: + bl sub_802CF14 + movs r0, 0x5 + bl sub_802EFEC +_0802F17E: + pop {r0} + bx r0 + thumb_func_end sub_802F148 + + thumb_func_start sub_802F184 +sub_802F184: + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + bl sub_802CE5C + ldr r4, _0802F1BC + ldr r0, [r4] + adds r0, 0x60 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _0802F1AA + ldr r0, [r4] + adds r0, 0x60 + mov r1, sp + bl sub_8013114 +_0802F1AA: + ldr r0, [sp] + cmp r0, 0x2 + beq _0802F1C6 + cmp r0, 0x2 + bgt _0802F1C0 + cmp r0, 0x1 + beq _0802F1DA + b _0802F1E0 + .align 2, 0 +_0802F1BC: .4byte gUnknown_203B30C +_0802F1C0: + cmp r0, 0x3 + beq _0802F1D2 + b _0802F1E0 +_0802F1C6: + bl sub_802CF14 + movs r0, 0x4 + bl sub_802EFEC + b _0802F1E0 +_0802F1D2: + movs r0, 0x3 + bl sub_802EFEC + b _0802F1E0 +_0802F1DA: + movs r0, 0x1 + bl sub_802EFEC +_0802F1E0: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_802F184 + + thumb_func_start sub_802F1E8 +sub_802F1E8: + push {lr} + bl sub_802DEE0 + cmp r0, 0x1 + bls _0802F200 + cmp r0, 0x3 + bhi _0802F200 + bl sub_802DF24 + movs r0, 0x1 + bl sub_802EFEC +_0802F200: + pop {r0} + bx r0 + thumb_func_end sub_802F1E8 + + thumb_func_start sub_802F204 +sub_802F204: + push {r4-r6,lr} + adds r6, r0, 0 + lsls r4, r1, 24 + lsrs r4, 24 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r5, _0802F28C + movs r0, 0x84 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] + str r6, [r0, 0x10] + movs r6, 0 + str r6, [r0, 0xC] + strb r4, [r0, 0x8] + ldr r1, [r5] + ldr r0, _0802F290 + ldr r1, [r1, 0x10] + bl strcpy + ldr r4, _0802F294 + bl sub_808D33C + adds r1, r0, 0 + adds r0, r4, 0 + bl sub_808DA34 + ldr r0, [r5] + ldr r0, [r0, 0x10] + movs r1, 0x14 + ldrsh r0, [r0, r1] + bl sub_808DDD0 + ldr r1, [r5] + str r0, [r1, 0x14] + str r6, [r1, 0x18] + adds r1, 0x20 + strb r6, [r1] + ldr r0, [r5] + adds r0, 0x21 + strb r6, [r0] + ldr r0, [r5] + adds r0, 0x22 + strb r6, [r0] + ldr r5, [r5] + movs r0, 0x2 + strh r0, [r5, 0x1C] + movs r0, 0x8 + strh r0, [r5, 0x1E] + ldr r0, [r5, 0x14] + cmp r0, 0 + beq _0802F27C + ldr r0, [r0, 0x4] + str r0, [r5, 0x18] +_0802F27C: + movs r0, 0 + bl sub_802F2E8 + movs r0, 0x1 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0802F28C: .4byte gUnknown_203B310 +_0802F290: .4byte gUnknown_202E5D8 +_0802F294: .4byte gUnknown_202DF98 + thumb_func_end sub_802F204 + + thumb_func_start sub_802F298 +sub_802F298: + push {lr} + ldr r0, _0802F2AC + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0x5 + beq _0802F2B0 + cmp r0, 0x9 + bne _0802F2B6 + movs r0, 0x3 + b _0802F2BC + .align 2, 0 +_0802F2AC: .4byte gUnknown_203B310 +_0802F2B0: + bl sub_802F6FC + b _0802F2BA +_0802F2B6: + bl sub_802F718 +_0802F2BA: + movs r0, 0 +_0802F2BC: + pop {r1} + bx r1 + thumb_func_end sub_802F298 + + thumb_func_start sub_802F2C0 +sub_802F2C0: + push {r4,lr} + ldr r4, _0802F2E4 + ldr r0, [r4] + cmp r0, 0 + beq _0802F2DE + ldr r0, [r0, 0x14] + cmp r0, 0 + beq _0802F2D4 + bl sub_800AA14 +_0802F2D4: + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0802F2DE: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802F2E4: .4byte gUnknown_203B310 + thumb_func_end sub_802F2C0 + + thumb_func_start sub_802F2E8 +sub_802F2E8: + push {lr} + ldr r1, _0802F2FC + ldr r1, [r1] + str r0, [r1] + bl sub_802F300 + bl sub_802F358 + pop {r0} + bx r0 + .align 2, 0 +_0802F2FC: .4byte gUnknown_203B310 + thumb_func_end sub_802F2E8 + + thumb_func_start sub_802F300 +sub_802F300: + push {r4-r7,lr} + ldr r4, _0802F350 + ldr r1, [r4] + ldr r0, [r1] + cmp r0, 0 + bne _0802F348 + adds r0, r1, 0 + adds r0, 0x24 + bl sub_8006518 + mov r12, r4 + ldr r4, _0802F354 + movs r3, 0 + movs r2, 0x3 +_0802F31C: + mov r0, r12 + ldr r1, [r0] + adds r1, r3 + adds r1, 0x24 + adds r0, r4, 0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r3, 0x18 + subs r2, 0x1 + cmp r2, 0 + bge _0802F31C + bl sub_8004914 + ldr r0, _0802F350 + ldr r0, [r0] + adds r0, 0x24 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C +_0802F348: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0802F350: .4byte gUnknown_203B310 +_0802F354: .4byte gUnknown_80E041C + thumb_func_end sub_802F300 + + thumb_func_start sub_802F358 +sub_802F358: + push {r4-r6,lr} + sub sp, 0x10 + ldr r1, _0802F374 + ldr r0, [r1] + ldr r0, [r0] + adds r6, r1, 0 + cmp r0, 0x9 + bls _0802F36A + b _0802F6E4 +_0802F36A: + lsls r0, 2 + ldr r1, _0802F378 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802F374: .4byte gUnknown_203B310 +_0802F378: .4byte _0802F37C + .align 2, 0 +_0802F37C: + .4byte _0802F3A4 + .4byte _0802F3E8 + .4byte _0802F444 + .4byte _0802F494 + .4byte _0802F524 + .4byte _0802F5CC + .4byte _0802F614 + .4byte _0802F630 + .4byte _0802F6A4 + .4byte _0802F6E4 +_0802F3A4: + ldr r2, [r6] + ldr r0, [r2, 0x10] + ldr r1, [r0, 0x18] + cmp r1, 0 + bne _0802F3B6 + movs r0, 0x2 + bl sub_802F2E8 + b _0802F6E4 +_0802F3B6: + ldr r0, _0802F3D4 + str r1, [r0] + ldrb r0, [r2, 0x8] + cmp r0, 0 + beq _0802F3E0 + ldr r0, _0802F3D8 + adds r2, 0x14 + ldr r3, _0802F3DC + movs r1, 0 + bl sub_80141B4 + ldr r1, [r6] + movs r0, 0x1 + str r0, [r1, 0x4] + b _0802F6E4 + .align 2, 0 +_0802F3D4: .4byte gUnknown_202DE30 +_0802F3D8: .4byte gUnknown_80E0434 +_0802F3DC: .4byte 0x0000010d +_0802F3E0: + movs r0, 0x1 + bl sub_802F2E8 + b _0802F6E4 +_0802F3E8: + movs r0, 0xCB + bl sub_8011988 + ldr r0, _0802F414 + ldr r0, [r0] + ldr r0, [r0, 0x10] + ldr r0, [r0, 0x18] + bl sub_80913A0 + movs r0, 0 + bl sub_808D544 + cmp r0, 0x1 + bgt _0802F420 + ldr r0, _0802F418 + ldr r3, _0802F41C + movs r1, 0 + movs r2, 0 + bl sub_80141B4 + b _0802F42C + .align 2, 0 +_0802F414: .4byte gUnknown_203B310 +_0802F418: .4byte gUnknown_80E045C +_0802F41C: .4byte 0x00000101 +_0802F420: + ldr r0, _0802F438 + ldr r3, _0802F43C + movs r1, 0 + movs r2, 0 + bl sub_80141B4 +_0802F42C: + ldr r0, _0802F440 + ldr r1, [r0] + movs r0, 0x2 + str r0, [r1, 0x4] + b _0802F6E4 + .align 2, 0 +_0802F438: .4byte gUnknown_80E0484 +_0802F43C: .4byte 0x00000101 +_0802F440: .4byte gUnknown_203B310 +_0802F444: + ldr r0, [r6] + ldr r0, [r0, 0x10] + adds r1, r0, 0 + adds r1, 0x20 + ldrb r0, [r1] + cmp r0, 0 + bne _0802F45A + movs r0, 0x4 + bl sub_802F2E8 + b _0802F6E4 +_0802F45A: + ldr r0, _0802F480 + ldrb r1, [r1] + movs r2, 0 + bl sub_8092578 + ldr r2, [r6] + ldrb r0, [r2, 0x8] + cmp r0, 0 + beq _0802F48C + ldr r0, _0802F484 + adds r2, 0x14 + ldr r3, _0802F488 + movs r1, 0 + bl sub_80141B4 + ldr r1, [r6] + movs r0, 0x3 + str r0, [r1, 0x4] + b _0802F6E4 + .align 2, 0 +_0802F480: .4byte gUnknown_202E628 +_0802F484: .4byte gUnknown_80E04B4 +_0802F488: .4byte 0x0000010d +_0802F48C: + movs r0, 0x3 + bl sub_802F2E8 + b _0802F6E4 +_0802F494: + ldr r4, _0802F4B4 + ldr r0, [r4] + ldr r0, [r0, 0x10] + adds r0, 0x20 + ldrb r0, [r0] + bl sub_8092600 + lsls r0, 24 + cmp r0, 0 + beq _0802F4BC + movs r0, 0xFA + lsls r0, 2 + bl sub_80913A0 + ldr r0, _0802F4B8 + b _0802F4DA + .align 2, 0 +_0802F4B4: .4byte gUnknown_203B310 +_0802F4B8: .4byte gUnknown_80E04F4 +_0802F4BC: + movs r0, 0 + bl sub_808D544 + cmp r0, 0x1 + bgt _0802F4F0 + ldr r0, [r4] + ldr r0, [r0, 0x10] + adds r0, 0x20 + ldrb r0, [r0] + bl sub_80925EC + movs r0, 0xCE + bl sub_8011988 + ldr r0, _0802F4E8 +_0802F4DA: + ldr r3, _0802F4EC + movs r1, 0 + movs r2, 0 + bl sub_80141B4 + b _0802F50E + .align 2, 0 +_0802F4E8: .4byte gUnknown_80E05C0 +_0802F4EC: .4byte 0x00000101 +_0802F4F0: + ldr r0, [r4] + ldr r0, [r0, 0x10] + adds r0, 0x20 + ldrb r0, [r0] + bl sub_80925EC + movs r0, 0xCE + bl sub_8011988 + ldr r0, _0802F518 + ldr r3, _0802F51C + movs r1, 0 + movs r2, 0 + bl sub_80141B4 +_0802F50E: + ldr r0, _0802F520 + ldr r1, [r0] + movs r0, 0x4 + str r0, [r1, 0x4] + b _0802F6E4 + .align 2, 0 +_0802F518: .4byte gUnknown_80E05FC +_0802F51C: .4byte 0x00000101 +_0802F520: .4byte gUnknown_203B310 +_0802F524: + ldr r0, [r6] + ldr r0, [r0, 0x10] + ldrb r2, [r0, 0x1C] + cmp r2, 0 + beq _0802F628 + ldr r0, [r0, 0x18] + cmp r0, 0 + bne _0802F620 + lsls r2, 16 + ldr r1, _0802F564 + ldr r0, [sp, 0xC] + ands r0, r1 + orrs r0, r2 + str r0, [sp, 0xC] + lsrs r0, 16 + lsls r0, 24 + lsrs r0, 24 + bl sub_8090A60 + lsls r0, 24 + cmp r0, 0 + beq _0802F56C + ldr r0, [r6] + ldr r0, [r0, 0x10] + ldrb r1, [r0, 0x1F] + lsls r1, 8 + ldr r2, _0802F568 + ldr r0, [sp, 0xC] + ands r0, r2 + orrs r0, r1 + b _0802F572 + .align 2, 0 +_0802F564: .4byte 0xff00ffff +_0802F568: .4byte 0xffff00ff +_0802F56C: + ldr r1, _0802F5B4 + ldr r0, [sp, 0xC] + ands r0, r1 +_0802F572: + str r0, [sp, 0xC] + ldr r1, _0802F5B8 + ldr r0, [sp, 0xC] + ands r0, r1 + movs r2, 0x1 + orrs r0, r2 + str r0, [sp, 0xC] + movs r1, 0 + str r1, [sp] + mov r0, sp + strb r1, [r0, 0x4] + strb r2, [r0, 0x8] + ldr r0, _0802F5BC + add r1, sp, 0xC + mov r2, sp + bl sub_8090E14 + ldr r4, _0802F5C0 + ldr r2, [r4] + ldrb r0, [r2, 0x8] + cmp r0, 0 + beq _0802F620 + ldr r0, _0802F5C4 + adds r2, 0x14 + ldr r3, _0802F5C8 + movs r1, 0 + bl sub_80141B4 + ldr r1, [r4] + movs r0, 0x5 + str r0, [r1, 0x4] + b _0802F6E4 + .align 2, 0 +_0802F5B4: .4byte 0xffff00ff +_0802F5B8: .4byte 0xffffff00 +_0802F5BC: .4byte gUnknown_202DEA8 +_0802F5C0: .4byte gUnknown_203B310 +_0802F5C4: .4byte gUnknown_80E0640 +_0802F5C8: .4byte 0x0000010d +_0802F5CC: + ldr r0, [r6] + ldr r2, [r0, 0x10] + adds r1, r2, 0 + adds r1, 0x1C + ldr r3, [r0, 0xC] + adds r1, r3 + ldrb r0, [r1] + cmp r0, 0 + bne _0802F5E6 + movs r0, 0x6 + bl sub_802F2E8 + b _0802F6E4 +_0802F5E6: + cmp r3, 0 + bne _0802F5FC + ldr r0, [r2, 0x18] + cmp r0, 0 + bne _0802F5FC + ldrb r1, [r2, 0x1C] + ldrb r2, [r2, 0x1F] + movs r0, 0 + bl sub_801B60C + b _0802F6E4 +_0802F5FC: + ldr r1, [r6] + ldr r2, [r1, 0x10] + adds r0, r2, 0 + adds r0, 0x1C + ldr r1, [r1, 0xC] + adds r0, r1 + ldrb r1, [r0] + ldrb r2, [r2, 0x1F] + movs r0, 0x1 + bl sub_801B60C + b _0802F6E4 +_0802F614: + ldr r1, [r6] + ldr r0, [r1, 0xC] + adds r0, 0x1 + str r0, [r1, 0xC] + cmp r0, 0x2 + bgt _0802F628 +_0802F620: + movs r0, 0x5 + bl sub_802F2E8 + b _0802F6E4 +_0802F628: + movs r0, 0x7 + bl sub_802F2E8 + b _0802F6E4 +_0802F630: + adds r5, r6, 0 + ldr r0, [r5] + ldr r0, [r0, 0x10] + ldr r0, [r0, 0x24] + cmp r0, 0 + bne _0802F644 + movs r0, 0x9 + bl sub_802F2E8 + b _0802F6E4 +_0802F644: + bl sub_8092178 + ldr r1, [r5] + strb r0, [r1, 0x9] + ldr r0, [r5] + ldr r0, [r0, 0x10] + ldr r0, [r0, 0x24] + bl sub_8092158 + movs r0, 0xCB + bl sub_8011988 + ldr r4, [r5] + bl sub_8092178 + ldrb r1, [r4, 0x9] + lsls r0, 24 + lsrs r0, 24 + cmp r1, r0 + beq _0802F672 + ldr r1, [r5] + movs r0, 0x8 + b _0802F676 +_0802F672: + ldr r1, [r6] + movs r0, 0x9 +_0802F676: + str r0, [r1, 0x4] + ldr r1, _0802F694 + ldr r0, _0802F698 + ldr r0, [r0] + ldr r0, [r0, 0x10] + ldr r0, [r0, 0x24] + str r0, [r1] + ldr r0, _0802F69C + ldr r3, _0802F6A0 + movs r1, 0 + movs r2, 0 + bl sub_80141B4 + b _0802F6E4 + .align 2, 0 +_0802F694: .4byte gUnknown_202DE30 +_0802F698: .4byte gUnknown_203B310 +_0802F69C: .4byte gUnknown_80E0670 +_0802F6A0: .4byte 0x00000101 +_0802F6A4: + movs r0, 0xC9 + bl sub_8011988 + ldr r0, _0802F6EC + ldr r1, [r0] + movs r0, 0x9 + str r0, [r1, 0x4] + ldrb r0, [r1, 0x9] + bl sub_80921A8 + adds r1, r0, 0 + ldr r4, _0802F6F0 + adds r0, r4, 0 + bl strcpy + bl sub_8092178 + lsls r0, 24 + lsrs r0, 24 + bl sub_80921A8 + adds r1, r0, 0 + adds r4, 0x50 + adds r0, r4, 0 + bl strcpy + ldr r0, _0802F6F4 + ldr r3, _0802F6F8 + movs r1, 0 + movs r2, 0 + bl sub_80141B4 +_0802F6E4: + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0802F6EC: .4byte gUnknown_203B310 +_0802F6F0: .4byte gUnknown_202E038 +_0802F6F4: .4byte gUnknown_80E06A8 +_0802F6F8: .4byte 0x00000101 + thumb_func_end sub_802F358 + + thumb_func_start sub_802F6FC +sub_802F6FC: + push {lr} + bl sub_801B6AC + cmp r0, 0x1 + bls _0802F714 + cmp r0, 0x3 + bhi _0802F714 + bl sub_801B72C + movs r0, 0x6 + bl sub_802F2E8 +_0802F714: + pop {r0} + bx r0 + thumb_func_end sub_802F6FC + + thumb_func_start sub_802F718 +sub_802F718: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0802F730 + ldr r0, _0802F738 + ldr r0, [r0] + ldr r0, [r0, 0x4] + bl sub_802F2E8 +_0802F730: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_0802F738: .4byte gUnknown_203B310 + thumb_func_end sub_802F718 + + thumb_func_start sub_802F73C +sub_802F73C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + adds r7, r1, 0 + mov r8, r2 + lsls r3, 24 + lsrs r6, r3, 24 + bl sub_802FCF0 + lsls r0, 24 + cmp r0, 0 + beq _0802F75A + movs r0, 0 + b _0802F836 +_0802F75A: + ldr r4, _0802F7AC + ldr r0, [r4] + cmp r0, 0 + bne _0802F76E + movs r0, 0xAE + lsls r0, 1 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r4] +_0802F76E: + ldr r0, [r4] + adds r0, 0xB8 + strb r6, [r0] + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0xF0 + str r5, [r1] + adds r2, r0, 0 + adds r2, 0xF4 + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 3 + adds r1, 0xF8 + adds r1, r0, r1 + str r1, [r2] + adds r0, 0xF8 + bl sub_8006518 + cmp r6, 0 + beq _0802F7B4 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0xF0 + ldr r2, [r0] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r1, 0xF8 + ldr r0, _0802F7B0 + b _0802F7C8 + .align 2, 0 +_0802F7AC: .4byte gUnknown_203B314 +_0802F7B0: .4byte gUnknown_80E072C +_0802F7B4: + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0xF0 + ldr r2, [r0] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r1, 0xF8 + ldr r0, _0802F840 +_0802F7C8: + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r4, _0802F844 + ldr r2, [r4] + adds r0, r2, 0 + adds r0, 0xF4 + ldr r1, [r0] + movs r3, 0xAC + lsls r3, 1 + adds r0, r2, r3 + str r0, [r1, 0x14] + cmp r7, 0 + beq _0802F7FC + adds r0, r2, 0 + adds r0, 0xF0 + ldr r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + subs r3, 0x58 + adds r1, r2, r3 + adds r1, r0 + ldr r0, [r7] + str r0, [r1] +_0802F7FC: + ldr r0, [r4] + adds r0, 0xF4 + ldr r0, [r0] + mov r1, r8 + bl sub_8012D08 + bl sub_8004914 + ldr r0, [r4] + adds r0, 0xF8 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r4, [r4] + adds r4, 0xBC + bl sub_802FBF4 + adds r1, r0, 0 + adds r0, r4, 0 + mov r2, r8 + adds r3, r5, 0 + bl sub_8013818 + bl sub_802F9C0 + bl sub_802FA50 + movs r0, 0x1 +_0802F836: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0802F840: .4byte gUnknown_80E0714 +_0802F844: .4byte gUnknown_203B314 + thumb_func_end sub_802F73C + + thumb_func_start sub_802F848 +sub_802F848: + push {r4,r5,lr} + lsls r0, 16 + asrs r4, r0, 16 + movs r3, 0 + ldr r1, _0802F858 + ldr r0, [r1] + b _0802F884 + .align 2, 0 +_0802F858: .4byte gUnknown_203B314 +_0802F85C: + ldr r2, [r1] + lsls r0, r3, 1 + adds r0, r2, r0 + movs r5, 0 + ldrsh r0, [r0, r5] + cmp r0, r4 + bne _0802F880 + adds r0, r2, 0 + adds r0, 0xBC + adds r1, r3, 0 + bl sub_8013878 + bl sub_802F9C0 + bl sub_802FA50 + movs r0, 0x1 + b _0802F89A +_0802F880: + adds r3, 0x1 + adds r0, r2, 0 +_0802F884: + adds r0, 0xDE + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r3, r0 + blt _0802F85C + ldr r0, [r1] + adds r0, 0xBC + movs r1, 0 + bl sub_8013878 + movs r0, 0 +_0802F89A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_802F848 + + thumb_func_start sub_802F8A0 +sub_802F8A0: + push {r4,lr} + lsls r0, 24 + cmp r0, 0 + bne _0802F8BC + ldr r0, _0802F8B8 + ldr r0, [r0] + adds r0, 0xBC + bl sub_8013660 + movs r0, 0 + b _0802F904 + .align 2, 0 +_0802F8B8: .4byte gUnknown_203B314 +_0802F8BC: + ldr r4, _0802F8D8 + ldr r0, [r4] + adds r0, 0xBC + bl GetKeyPress + cmp r0, 0x1 + beq _0802F8DC + cmp r0, 0x2 + bne _0802F8E6 + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + b _0802F904 + .align 2, 0 +_0802F8D8: .4byte gUnknown_203B314 +_0802F8DC: + movs r0, 0 + bl sub_80119D4 + movs r0, 0x3 + b _0802F904 +_0802F8E6: + ldr r0, [r4] + adds r0, 0xBC + movs r1, 0x1 + bl sub_80138B8 + lsls r0, 24 + cmp r0, 0 + bne _0802F8FA + movs r0, 0 + b _0802F904 +_0802F8FA: + bl sub_802F9C0 + bl sub_802FA50 + movs r0, 0x1 +_0802F904: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_802F8A0 + + thumb_func_start sub_802F90C +sub_802F90C: + ldr r0, _0802F934 + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0xDA + movs r3, 0 + ldrsh r1, [r0, r3] + subs r0, 0x2 + movs r3, 0 + ldrsh r0, [r0, r3] + muls r0, r1 + adds r1, r2, 0 + adds r1, 0xD4 + movs r3, 0 + ldrsh r1, [r1, r3] + adds r0, r1 + lsls r0, 1 + adds r0, r2, r0 + movs r1, 0 + ldrsh r0, [r0, r1] + bx lr + .align 2, 0 +_0802F934: .4byte gUnknown_203B314 + thumb_func_end sub_802F90C + + thumb_func_start sub_802F938 +sub_802F938: + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_802FBF4 + adds r1, r0, 0 + ldr r5, _0802F970 + ldr r0, [r5] + adds r2, r0, 0 + adds r2, 0xDE + strh r1, [r2] + adds r0, 0xBC + bl sub_8013984 + bl sub_802F9C0 + bl sub_802FA50 + cmp r4, 0 + beq _0802F96A + ldr r0, [r5] + adds r0, 0xBC + bl AddMenuCursorSprite +_0802F96A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802F970: .4byte gUnknown_203B314 + thumb_func_end sub_802F938 + + thumb_func_start sub_802F974 +sub_802F974: + push {r4,r5,lr} + ldr r4, _0802F9B8 + ldr r2, [r4] + cmp r2, 0 + beq _0802F9B2 + adds r0, r2, 0 + adds r0, 0xF0 + ldr r0, [r0] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0xF8 + ldr r0, _0802F9BC + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + bl sub_8004914 + ldr r0, [r4] + adds r0, 0xF8 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0802F9B2: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802F9B8: .4byte gUnknown_203B314 +_0802F9BC: .4byte gUnknown_80E06FC + thumb_func_end sub_802F974 + + thumb_func_start sub_802F9C0 +sub_802F9C0: + push {r4,r5,lr} + ldr r4, _0802FA44 + ldr r0, [r4] + movs r1, 0xAC + lsls r1, 1 + adds r0, r1 + movs r2, 0 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r4] + ldr r3, _0802FA48 + adds r0, r3 + strb r2, [r0] + ldr r0, [r4] + adds r3, 0x1 + adds r1, r0, r3 + movs r0, 0x8 + strb r0, [r1] + ldr r0, [r4] + ldr r1, _0802FA4C + adds r0, r1 + strb r2, [r0] + ldr r0, [r4] + adds r0, 0xD6 + movs r2, 0 + ldrsh r0, [r0, r2] + movs r1, 0xC + bl sub_80095E4 + adds r0, 0x2 + lsls r0, 16 + ldr r3, [r4] + adds r5, r3, 0 + adds r5, 0xF0 + ldr r2, [r5] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 3 + adds r1, r3, r1 + movs r2, 0x83 + lsls r2, 1 + adds r1, r2 + asrs r2, r0, 16 + lsrs r0, 16 + strh r0, [r1] + ldr r1, [r5] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r3, r0 + adds r2, 0x2 + movs r0, 0x84 + lsls r0, 1 + adds r3, r0 + strh r2, [r3] + bl sub_8004914 + ldr r0, [r4] + adds r0, 0xF8 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0802FA44: .4byte gUnknown_203B314 +_0802FA48: .4byte 0x00000159 +_0802FA4C: .4byte 0x0000015b + thumb_func_end sub_802F9C0 + + thumb_func_start sub_802FA50 +sub_802FA50: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + ldr r4, _0802FB1C + ldr r0, [r4] + adds r0, 0xF0 + ldr r0, [r0] + bl sub_8008C54 + ldr r0, [r4] + adds r0, 0xF0 + ldr r0, [r0] + bl sub_80073B8 + ldr r2, _0802FB20 + ldr r0, [r4] + adds r0, 0xF0 + ldr r3, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0xA + movs r1, 0 + bl xxx_call_draw_string + ldr r3, [r4] + movs r1, 0xAD + lsls r1, 1 + adds r0, r3, r1 + ldrb r0, [r0] + lsls r0, 3 + adds r0, 0x4 + adds r1, r3, 0 + adds r1, 0xDA + movs r5, 0 + ldrsh r2, [r1, r5] + adds r2, 0x1 + movs r1, 0x7 + str r1, [sp] + adds r1, r3, 0 + adds r1, 0xF0 + ldr r1, [r1] + str r1, [sp, 0x4] + movs r1, 0 + movs r3, 0x2 + bl sub_8012BC4 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0xB8 + ldrb r0, [r0] + cmp r0, 0 + beq _0802FB78 + movs r6, 0 + adds r0, r1, 0 + adds r0, 0xD6 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r6, r0 + blt _0802FACA + b _0802FBD6 +_0802FACA: + mov r8, r4 +_0802FACC: + mov r2, r8 + ldr r0, [r2] + adds r0, 0xBC + adds r1, r6, 0 + bl sub_8013800 + adds r5, r0, 0 + mov r3, r8 + ldr r2, [r3] + adds r0, r2, 0 + adds r0, 0xDA + movs r3, 0 + ldrsh r1, [r0, r3] + subs r0, 0x2 + movs r3, 0 + ldrsh r0, [r0, r3] + muls r0, r1 + adds r1, r0, r6 + lsls r0, r1, 1 + adds r0, r2, r0 + movs r3, 0 + ldrsh r7, [r0, r3] + adds r0, r2, 0 + adds r0, 0x5C + adds r0, r1 + ldrb r4, [r0] + cmp r4, 0 + beq _0802FB28 + adds r0, r2, 0 + adds r0, 0xF0 + ldr r3, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0xA + adds r1, r5, 0 + ldr r2, _0802FB24 + bl xxx_call_draw_string + b _0802FB46 + .align 2, 0 +_0802FB1C: .4byte gUnknown_203B314 +_0802FB20: .4byte gUnknown_80E0744 +_0802FB24: .4byte gUnknown_80E0750 +_0802FB28: + adds r0, r2, 0 + adds r0, 0x8A + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0802FB46 + adds r0, r2, 0 + adds r0, 0xF0 + ldr r3, [r0] + str r4, [sp] + movs r0, 0xA + adds r1, r5, 0 + ldr r2, _0802FB74 + bl xxx_call_draw_string +_0802FB46: + adds r0, r7, 0 + bl sub_80974A0 + adds r2, r0, 0 + mov r1, r8 + ldr r0, [r1] + adds r0, 0xF0 + ldr r3, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0x18 + adds r1, r5, 0 + bl xxx_call_draw_string + adds r6, 0x1 + mov r2, r8 + ldr r0, [r2] + adds r0, 0xD6 + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r6, r0 + blt _0802FACC + b _0802FBD6 + .align 2, 0 +_0802FB74: .4byte gUnknown_80E0754 +_0802FB78: + movs r6, 0 + adds r0, r1, 0 + adds r0, 0xD6 + movs r5, 0 + ldrsh r0, [r0, r5] + cmp r6, r0 + bge _0802FBD6 + adds r5, r4, 0 +_0802FB88: + ldr r0, [r5] + adds r0, 0xBC + adds r1, r6, 0 + bl sub_8013800 + adds r4, r0, 0 + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0xDA + movs r3, 0 + ldrsh r2, [r0, r3] + subs r0, 0x2 + movs r3, 0 + ldrsh r0, [r0, r3] + muls r0, r2 + adds r0, r6 + lsls r0, 1 + adds r1, r0 + movs r2, 0 + ldrsh r0, [r1, r2] + bl sub_80974A0 + adds r2, r0, 0 + ldr r0, [r5] + adds r0, 0xF0 + ldr r3, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0x8 + adds r1, r4, 0 + bl xxx_call_draw_string + adds r6, 0x1 + ldr r0, [r5] + adds r0, 0xD6 + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r6, r0 + blt _0802FB88 +_0802FBD6: + ldr r0, _0802FBF0 + ldr r0, [r0] + adds r0, 0xF0 + ldr r0, [r0] + bl sub_80073E0 + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0802FBF0: .4byte gUnknown_203B314 + thumb_func_end sub_802FA50 + + thumb_func_start sub_802FBF4 +sub_802FBF4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + movs r0, 0 + mov r8, r0 + movs r1, 0 + str r1, [sp] +_0802FC08: + ldr r1, [sp] + lsls r0, r1, 16 + asrs r4, r0, 16 + mov r10, r4 + adds r0, r4, 0 + bl sub_80A27CC + lsls r0, 24 + cmp r0, 0 + beq _0802FCCE + cmp r4, 0x13 + beq _0802FCCE + cmp r4, 0x1D + beq _0802FCCE + ldr r7, _0802FC88 + ldr r1, [r7] + mov r0, r8 + lsls r6, r0, 1 + adds r0, r1, r6 + strh r4, [r0] + adds r1, 0x5C + add r1, r8 + movs r0, 0 + strb r0, [r1] + ldr r0, [r7] + adds r0, 0x8A + add r0, r8 + movs r1, 0 + strb r1, [r0] + ldr r0, [r7] + adds r0, 0xB8 + ldrb r0, [r0] + cmp r0, 0 + beq _0802FCCA + cmp r4, 0xD + beq _0802FCCA + adds r0, r4, 0 + bl sub_80A270C + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r5, 0 + cmp r4, 0x1E + bgt _0802FCA8 + adds r0, r4, 0 + bl sub_8097384 + lsls r0, 24 + cmp r0, 0 + bne _0802FCA6 + cmp r4, 0x6 + bne _0802FC8C + movs r0, 0x13 + bl sub_8097384 + lsls r0, 24 + cmp r0, 0 + beq _0802FCA8 + ldr r0, [r7] + adds r0, r6 + movs r1, 0x13 + b _0802FCA4 + .align 2, 0 +_0802FC88: .4byte gUnknown_203B314 +_0802FC8C: + mov r0, r10 + cmp r0, 0xA + bne _0802FCA8 + movs r0, 0x1D + bl sub_8097384 + lsls r0, 24 + cmp r0, 0 + beq _0802FCA8 + ldr r0, [r7] + adds r0, r6 + movs r1, 0x1D +_0802FCA4: + strh r1, [r0] +_0802FCA6: + movs r5, 0x1 +_0802FCA8: + ldr r4, _0802FCEC + ldr r0, [r4] + adds r0, 0x5C + add r0, r8 + strb r5, [r0] + cmp r5, 0 + bne _0802FCCA + mov r0, r9 + bl sub_80969D0 + cmp r0, 0 + ble _0802FCCA + ldr r0, [r4] + adds r0, 0x8A + add r0, r8 + movs r1, 0x1 + strb r1, [r0] +_0802FCCA: + movs r1, 0x1 + add r8, r1 +_0802FCCE: + ldr r0, [sp] + adds r0, 0x1 + str r0, [sp] + cmp r0, 0x2D + ble _0802FC08 + mov r0, r8 + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0802FCEC: .4byte gUnknown_203B314 + thumb_func_end sub_802FBF4 + + thumb_func_start sub_802FCF0 +sub_802FCF0: + push {r4,lr} + movs r4, 0 +_0802FCF4: + lsls r0, r4, 16 + asrs r0, 16 + bl sub_80A27CC + lsls r0, 24 + cmp r0, 0 + beq _0802FD06 + movs r0, 0 + b _0802FD0E +_0802FD06: + adds r4, 0x1 + cmp r4, 0x2D + ble _0802FCF4 + movs r0, 0x1 +_0802FD0E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_802FCF0 + + thumb_func_start sub_802FD14 +sub_802FD14: + push {r4-r6,lr} + adds r5, r0, 0 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r4, _0802FD48 + movs r0, 0xCC + movs r1, 0x8 + bl MemoryAlloc + str r0, [r4] + ldr r1, _0802FD4C + strh r1, [r0, 0x10] + str r5, [r0] + cmp r5, 0x7 + bhi _0802FDC0 + lsls r0, r5, 2 + ldr r1, _0802FD50 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802FD48: .4byte gUnknown_203B318 +_0802FD4C: .4byte 0x0000ffff +_0802FD50: .4byte _0802FD54 + .align 2, 0 +_0802FD54: + .4byte _0802FD74 + .4byte _0802FD84 + .4byte _0802FD94 + .4byte _0802FDA4 + .4byte _0802FDB4 + .4byte _0802FDB8 + .4byte _0802FDBC + .4byte _0802FDC0 +_0802FD74: + movs r6, 0 + ldr r1, _0802FD80 + ldr r0, [r1] + str r6, [r0, 0x4] + b _0802FDCC + .align 2, 0 +_0802FD80: .4byte gUnknown_203B318 +_0802FD84: + movs r6, 0x7 + ldr r2, _0802FD90 + ldr r1, [r2] + movs r0, 0 + b _0802FDC8 + .align 2, 0 +_0802FD90: .4byte gUnknown_203B318 +_0802FD94: + movs r6, 0x6 + ldr r2, _0802FDA0 + ldr r1, [r2] + movs r0, 0 + b _0802FDC8 + .align 2, 0 +_0802FDA0: .4byte gUnknown_203B318 +_0802FDA4: + movs r6, 0x8 + ldr r2, _0802FDB0 + ldr r1, [r2] + movs r0, 0 + b _0802FDC8 + .align 2, 0 +_0802FDB0: .4byte gUnknown_203B318 +_0802FDB4: + movs r6, 0 + b _0802FDC2 +_0802FDB8: + movs r6, 0x7 + b _0802FDC2 +_0802FDBC: + movs r6, 0x6 + b _0802FDC2 +_0802FDC0: + movs r6, 0x8 +_0802FDC2: + ldr r2, _0802FDD8 + ldr r1, [r2] + movs r0, 0x1 +_0802FDC8: + str r0, [r1, 0x4] + adds r1, r2, 0 +_0802FDCC: + ldr r1, [r1] + ldr r0, [r1, 0x4] + cmp r0, 0x1 + bne _0802FDDC + movs r0, 0 + b _0802FDE0 + .align 2, 0 +_0802FDD8: .4byte gUnknown_203B318 +_0802FDDC: + adds r0, r1, 0 + adds r0, 0x58 +_0802FDE0: + str r0, [r1, 0x68] + ldr r0, _0802FE48 + ldr r5, _0802FE4C + adds r1, r5, 0 + bl sub_808D8E0 + ldr r4, _0802FE50 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_808D8E0 + adds r0, r5, 0 + bl sub_808D994 + adds r1, r0, 0 + subs r4, 0x50 + adds r0, r4, 0 + bl strcpy + adds r0, r5, 0 + bl sub_808DDD0 + ldr r3, _0802FE54 + ldr r1, [r3] + str r0, [r1, 0x58] + ldr r0, [r0, 0x4] + str r0, [r1, 0x5C] + adds r1, 0x64 + movs r2, 0 + strb r2, [r1] + ldr r0, [r3] + adds r0, 0x65 + strb r2, [r0] + ldr r0, [r3] + adds r0, 0x66 + strb r2, [r0] + ldr r1, [r3] + adds r2, r1, 0 + adds r2, 0x60 + movs r0, 0x2 + strh r0, [r2] + adds r1, 0x62 + movs r0, 0x8 + strh r0, [r1] + adds r0, r6, 0 + bl sub_802FF04 + movs r0, 0x1 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0802FE48: .4byte gUnknown_202E5D8 +_0802FE4C: .4byte 0x00000141 +_0802FE50: .4byte gUnknown_202E1C8 +_0802FE54: .4byte gUnknown_203B318 + thumb_func_end sub_802FD14 + + thumb_func_start sub_802FE58 +sub_802FE58: + push {lr} + ldr r0, _0802FE70 + ldr r0, [r0] + ldr r0, [r0, 0x8] + cmp r0, 0xD + bhi _0802FEC6 + lsls r0, 2 + ldr r1, _0802FE74 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802FE70: .4byte gUnknown_203B318 +_0802FE74: .4byte _0802FE78 + .align 2, 0 +_0802FE78: + .4byte _0802FEB0 + .4byte _0802FEB0 + .4byte _0802FEC6 + .4byte _0802FEC6 + .4byte _0802FEB6 + .4byte _0802FEC6 + .4byte _0802FEC6 + .4byte _0802FEC6 + .4byte _0802FEC6 + .4byte _0802FEC6 + .4byte _0802FEC6 + .4byte _0802FEBC + .4byte _0802FEC6 + .4byte _0802FEC2 +_0802FEB0: + bl sub_8030208 + b _0802FECA +_0802FEB6: + bl sub_8030258 + b _0802FECA +_0802FEBC: + bl sub_80302A8 + b _0802FECA +_0802FEC2: + movs r0, 0x3 + b _0802FECC +_0802FEC6: + bl sub_80302C4 +_0802FECA: + movs r0, 0 +_0802FECC: + pop {r1} + bx r1 + thumb_func_end sub_802FE58 + + thumb_func_start sub_802FED0 +sub_802FED0: + ldr r0, _0802FEDC + ldr r0, [r0] + movs r1, 0x10 + ldrsh r0, [r0, r1] + bx lr + .align 2, 0 +_0802FEDC: .4byte gUnknown_203B318 + thumb_func_end sub_802FED0 + + thumb_func_start sub_802FEE0 +sub_802FEE0: + push {r4,lr} + ldr r4, _0802FF00 + ldr r0, [r4] + cmp r0, 0 + beq _0802FEFA + ldr r0, [r0, 0x58] + bl sub_800AA14 + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0802FEFA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0802FF00: .4byte gUnknown_203B318 + thumb_func_end sub_802FEE0 + + thumb_func_start sub_802FF04 +sub_802FF04: + push {lr} + ldr r1, _0802FF18 + ldr r1, [r1] + str r0, [r1, 0x8] + bl sub_802FF1C + bl sub_802FF88 + pop {r0} + bx r0 + .align 2, 0 +_0802FF18: .4byte gUnknown_203B318 + thumb_func_end sub_802FF04 + + thumb_func_start sub_802FF1C +sub_802FF1C: + push {r4-r7,lr} + ldr r4, _0802FF3C + ldr r0, [r4] + adds r0, 0x6C + bl sub_8006518 + ldr r0, [r4] + ldr r0, [r0, 0x8] + cmp r0, 0x4 + beq _0802FF44 + cmp r0, 0x4 + bgt _0802FF40 + cmp r0, 0 + beq _0802FF44 + b _0802FF68 + .align 2, 0 +_0802FF3C: .4byte gUnknown_203B318 +_0802FF40: + cmp r0, 0xD + bne _0802FF68 +_0802FF44: + ldr r0, _0802FF80 + mov r12, r0 + ldr r4, _0802FF84 + movs r3, 0 + movs r2, 0x3 +_0802FF4E: + mov r5, r12 + ldr r1, [r5] + adds r1, r3 + adds r1, 0x6C + adds r0, r4, 0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r3, 0x18 + subs r2, 0x1 + cmp r2, 0 + bge _0802FF4E +_0802FF68: + bl sub_8004914 + ldr r0, _0802FF80 + ldr r0, [r0] + adds r0, 0x6C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0802FF80: .4byte gUnknown_203B318 +_0802FF84: .4byte gUnknown_80E0760 + thumb_func_end sub_802FF1C + + thumb_func_start sub_802FF88 +sub_802FF88: + push {r4,r5,lr} + sub sp, 0x18 + ldr r1, _0802FFA4 + ldr r0, [r1] + ldr r0, [r0, 0x8] + adds r5, r1, 0 + cmp r0, 0xD + bls _0802FF9A + b _080301A0 +_0802FF9A: + lsls r0, 2 + ldr r1, _0802FFA8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0802FFA4: .4byte gUnknown_203B318 +_0802FFA8: .4byte _0802FFAC + .align 2, 0 +_0802FFAC: + .4byte _0802FFE4 + .4byte _08030000 + .4byte _08030038 + .4byte _08030050 + .4byte _08030068 + .4byte _08030074 + .4byte _080300DC + .4byte _080300C4 + .4byte _080300F4 + .4byte _0803010C + .4byte _08030148 + .4byte _08030174 + .4byte _08030180 + .4byte _080301A0 +_0802FFE4: + bl sub_80301B0 + ldr r2, _0802FFF8 + ldr r0, _0802FFFC + ldr r5, [r0] + ldr r1, [r5, 0x4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + b _0803000E + .align 2, 0 +_0802FFF8: .4byte gUnknown_80D9FC8 +_0802FFFC: .4byte gUnknown_203B318 +_08030000: + ldr r2, _08030034 + ldr r5, [r5] + ldr r1, [r5, 0x4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r2, 0x4 +_0803000E: + adds r0, r2 + ldr r0, [r0] + ldr r2, [r5, 0x14] + adds r3, r5, 0 + adds r3, 0x18 + movs r4, 0 + str r4, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r4, [sp, 0x8] + ldr r1, [r5, 0x68] + str r1, [sp, 0xC] + movs r1, 0xC + str r1, [sp, 0x10] + movs r1, 0 + bl sub_8014248 + b _080301A0 + .align 2, 0 +_08030034: .4byte gUnknown_80D9FC8 +_08030038: + ldr r3, [r5] + movs r0, 0xD + str r0, [r3, 0xC] + ldr r2, _0803004C + ldr r1, [r3, 0x4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r2, 0x8 + b _0803015A + .align 2, 0 +_0803004C: .4byte gUnknown_80D9FC8 +_08030050: + ldr r3, [r5] + movs r0, 0x4 + str r0, [r3, 0xC] + ldr r2, _08030064 + ldr r1, [r3, 0x4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r2, 0xC + b _0803015A + .align 2, 0 +_08030064: .4byte gUnknown_80D9FC8 +_08030068: + movs r0, 0x3 + movs r1, 0 + movs r2, 0xA + bl sub_80302E8 + b _080301A0 +_08030074: + ldr r1, [r5] + movs r0, 0xD + str r0, [r1, 0xC] + movs r2, 0x10 + ldrsh r0, [r1, r2] + bl sub_80A2740 + lsls r0, 24 + lsrs r0, 24 + ldr r2, _080300B4 + ldr r1, [sp, 0x14] + ands r1, r2 + orrs r1, r0 + ldr r0, _080300B8 + ands r1, r0 + movs r0, 0x80 + lsls r0, 1 + orrs r1, r0 + str r1, [sp, 0x14] + ldr r0, _080300BC + add r1, sp, 0x14 + bl sub_8090208 + ldr r2, _080300C0 + ldr r3, [r5] + ldr r1, [r3, 0x4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r2, 0x10 + b _0803015A + .align 2, 0 +_080300B4: .4byte 0xffffff00 +_080300B8: .4byte 0xffff00ff +_080300BC: .4byte gUnknown_202DF98 +_080300C0: .4byte gUnknown_80D9FC8 +_080300C4: + ldr r3, [r5] + movs r0, 0xD + str r0, [r3, 0xC] + ldr r2, _080300D8 + ldr r1, [r3, 0x4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r2, 0x18 + b _0803015A + .align 2, 0 +_080300D8: .4byte gUnknown_80D9FC8 +_080300DC: + ldr r3, [r5] + movs r0, 0xD + str r0, [r3, 0xC] + ldr r2, _080300F0 + ldr r1, [r3, 0x4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r2, 0x14 + b _0803015A + .align 2, 0 +_080300F0: .4byte gUnknown_80D9FC8 +_080300F4: + ldr r3, [r5] + movs r0, 0x9 + str r0, [r3, 0xC] + ldr r2, _08030108 + ldr r1, [r3, 0x4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r2, 0x1C + b _0803015A + .align 2, 0 +_08030108: .4byte gUnknown_80D9FC8 +_0803010C: + ldr r4, _08030138 + bl sub_808D33C + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0x6 + bl sub_808D9AC + ldr r0, _0803013C + ldr r1, [r0] + movs r0, 0xB + str r0, [r1, 0xC] + movs r0, 0xCB + bl sub_8011988 + ldr r0, _08030140 + ldr r3, _08030144 + movs r1, 0 + movs r2, 0 + bl sub_80141B4 + b _080301A0 + .align 2, 0 +_08030138: .4byte gUnknown_202E2B8 +_0803013C: .4byte gUnknown_203B318 +_08030140: .4byte gUnknown_80E0778 +_08030144: .4byte 0x00000101 +_08030148: + ldr r3, [r5] + movs r0, 0xD + str r0, [r3, 0xC] + ldr r2, _0803016C + ldr r1, [r3, 0x4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r2, 0x20 +_0803015A: + adds r0, r2 + ldr r0, [r0] + ldr r2, [r3, 0x68] + ldr r3, _08030170 + movs r1, 0 + bl sub_80141B4 + b _080301A0 + .align 2, 0 +_0803016C: .4byte gUnknown_80D9FC8 +_08030170: .4byte 0x0000010d +_08030174: + movs r0, 0x1 + movs r1, 0x49 + movs r2, 0x1 + bl sub_801B60C + b _080301A0 +_08030180: + ldr r3, [r5] + movs r0, 0x1 + str r0, [r3, 0xC] + ldr r2, _080301A8 + ldr r1, [r3, 0x4] + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + adds r2, 0x24 + adds r0, r2 + ldr r0, [r0] + ldr r2, [r3, 0x68] + ldr r3, _080301AC + movs r1, 0 + bl sub_80141B4 +_080301A0: + add sp, 0x18 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080301A8: .4byte gUnknown_80D9FC8 +_080301AC: .4byte 0x0000010d + thumb_func_end sub_802FF88 + + thumb_func_start sub_80301B0 +sub_80301B0: + push {r4,lr} + ldr r4, _080301F8 + ldr r1, [r4] + movs r2, 0x2 + str r2, [r1, 0x14] + ldr r0, _080301FC + str r0, [r1, 0x18] + str r2, [r1, 0x1C] + bl sub_80306A4 + lsls r0, 24 + cmp r0, 0 + beq _080301D6 + ldr r0, [r4] + movs r1, 0x1 + negs r1, r1 + str r1, [r0, 0x1C] + movs r1, 0x1 + str r1, [r0, 0x14] +_080301D6: + ldr r1, [r4] + movs r2, 0x1 + ldr r0, _08030200 + ldr r0, [r0] + str r0, [r1, 0x20] + movs r0, 0x3 + str r0, [r1, 0x24] + ldr r0, _08030204 + ldr r0, [r0] + str r0, [r1, 0x28] + str r2, [r1, 0x2C] + movs r0, 0 + str r0, [r1, 0x30] + str r2, [r1, 0x34] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080301F8: .4byte gUnknown_203B318 +_080301FC: .4byte gUnknown_80E07D8 +_08030200: .4byte gUnknown_80D4970 +_08030204: .4byte gUnknown_80D4934 + thumb_func_end sub_80301B0 + + thumb_func_start sub_8030208 +sub_8030208: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08030250 + ldr r0, _08030230 + ldr r1, [r0] + ldr r0, [sp] + str r0, [r1, 0x14] + ldr r0, [sp] + cmp r0, 0x2 + beq _0803023A + cmp r0, 0x2 + bgt _08030234 + cmp r0, 0x1 + beq _0803024A + b _08030250 + .align 2, 0 +_08030230: .4byte gUnknown_203B318 +_08030234: + cmp r0, 0x3 + beq _08030242 + b _08030250 +_0803023A: + movs r0, 0x3 + bl sub_802FF04 + b _08030250 +_08030242: + movs r0, 0xC + bl sub_802FF04 + b _08030250 +_0803024A: + movs r0, 0x2 + bl sub_802FF04 +_08030250: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8030208 + + thumb_func_start sub_8030258 +sub_8030258: + push {lr} + movs r0, 0x1 + bl sub_80303AC + cmp r0, 0x2 + beq _08030288 + cmp r0, 0x2 + bcc _0803029A + cmp r0, 0x3 + bne _0803029A + bl sub_8030418 + ldr r1, _08030284 + ldr r1, [r1] + strh r0, [r1, 0x10] + bl sub_8030480 + movs r0, 0x5 + bl sub_802FF04 + b _0803029A + .align 2, 0 +_08030284: .4byte gUnknown_203B318 +_08030288: + bl sub_8030480 + ldr r0, _080302A0 + ldr r1, [r0] + ldr r0, _080302A4 + strh r0, [r1, 0x10] + movs r0, 0x1 + bl sub_802FF04 +_0803029A: + pop {r0} + bx r0 + .align 2, 0 +_080302A0: .4byte gUnknown_203B318 +_080302A4: .4byte 0x0000ffff + thumb_func_end sub_8030258 + + thumb_func_start sub_80302A8 +sub_80302A8: + push {lr} + bl sub_801B6AC + cmp r0, 0x1 + bls _080302C0 + cmp r0, 0x3 + bhi _080302C0 + bl sub_801B72C + movs r0, 0xA + bl sub_802FF04 +_080302C0: + pop {r0} + bx r0 + thumb_func_end sub_80302A8 + + thumb_func_start sub_80302C4 +sub_80302C4: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080302DC + ldr r0, _080302E4 + ldr r0, [r0] + ldr r0, [r0, 0xC] + bl sub_802FF04 +_080302DC: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_080302E4: .4byte gUnknown_203B318 + thumb_func_end sub_80302C4 + + thumb_func_start sub_80302E8 +sub_80302E8: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + adds r6, r1, 0 + mov r8, r2 + bl sub_80306A4 + lsls r0, 24 + cmp r0, 0 + beq _08030302 + movs r0, 0 + b _0803039A +_08030302: + ldr r4, _080303A4 + ldr r0, [r4] + cmp r0, 0 + bne _08030314 + movs r0, 0xD0 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r4] +_08030314: + ldr r0, [r4] + str r5, [r0, 0x64] + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 3 + adds r1, 0x6C + adds r1, r0, r1 + str r1, [r0, 0x68] + adds r0, 0x6C + bl sub_8006518 + ldr r1, [r4] + ldr r2, [r1, 0x64] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r1, 0x6C + ldr r0, _080303A8 + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldr r2, [r4] + ldr r1, [r2, 0x68] + adds r0, r2, 0 + adds r0, 0xCC + str r0, [r1, 0x14] + cmp r6, 0 + beq _08030362 + ldr r1, [r2, 0x64] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r1, r2, 0 + adds r1, 0x74 + adds r1, r0 + ldr r0, [r6] + str r0, [r1] +_08030362: + ldr r0, [r4] + ldr r0, [r0, 0x68] + mov r1, r8 + bl sub_8012D08 + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x6C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r4, [r4] + adds r4, 0x30 + bl sub_8030668 + adds r1, r0, 0 + adds r0, r4, 0 + mov r2, r8 + adds r3, r5, 0 + bl sub_8013818 + bl sub_80304C8 + bl sub_803053C + movs r0, 0x1 +_0803039A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080303A4: .4byte gUnknown_203B31C +_080303A8: .4byte gUnknown_80E0804 + thumb_func_end sub_80302E8 + + thumb_func_start sub_80303AC +sub_80303AC: + push {r4,lr} + lsls r0, 24 + cmp r0, 0 + bne _080303C8 + ldr r0, _080303C4 + ldr r0, [r0] + adds r0, 0x30 + bl sub_8013660 + movs r0, 0 + b _08030410 + .align 2, 0 +_080303C4: .4byte gUnknown_203B31C +_080303C8: + ldr r4, _080303E4 + ldr r0, [r4] + adds r0, 0x30 + bl GetKeyPress + cmp r0, 0x1 + beq _080303E8 + cmp r0, 0x2 + bne _080303F2 + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + b _08030410 + .align 2, 0 +_080303E4: .4byte gUnknown_203B31C +_080303E8: + movs r0, 0 + bl sub_80119D4 + movs r0, 0x3 + b _08030410 +_080303F2: + ldr r0, [r4] + adds r0, 0x30 + movs r1, 0x1 + bl sub_80138B8 + lsls r0, 24 + cmp r0, 0 + bne _08030406 + movs r0, 0 + b _08030410 +_08030406: + bl sub_80304C8 + bl sub_803053C + movs r0, 0x1 +_08030410: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80303AC + + thumb_func_start sub_8030418 +sub_8030418: + ldr r0, _08030440 + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x4E + movs r3, 0 + ldrsh r1, [r0, r3] + subs r0, 0x2 + movs r3, 0 + ldrsh r0, [r0, r3] + muls r0, r1 + adds r1, r2, 0 + adds r1, 0x48 + movs r3, 0 + ldrsh r1, [r1, r3] + adds r0, r1 + lsls r0, 1 + adds r0, r2, r0 + movs r1, 0 + ldrsh r0, [r0, r1] + bx lr + .align 2, 0 +_08030440: .4byte gUnknown_203B31C + thumb_func_end sub_8030418 + + thumb_func_start sub_8030444 +sub_8030444: + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8030668 + adds r1, r0, 0 + ldr r5, _0803047C + ldr r0, [r5] + adds r2, r0, 0 + adds r2, 0x52 + strh r1, [r2] + adds r0, 0x30 + bl sub_8013984 + bl sub_80304C8 + bl sub_803053C + cmp r4, 0 + beq _08030476 + ldr r0, [r5] + adds r0, 0x30 + bl AddMenuCursorSprite +_08030476: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0803047C: .4byte gUnknown_203B31C + thumb_func_end sub_8030444 + + thumb_func_start sub_8030480 +sub_8030480: + push {r4,r5,lr} + ldr r4, _080304C0 + ldr r2, [r4] + cmp r2, 0 + beq _080304BA + ldr r0, [r2, 0x64] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x6C + ldr r0, _080304C4 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x6C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_080304BA: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080304C0: .4byte gUnknown_203B31C +_080304C4: .4byte gUnknown_80E07EC + thumb_func_end sub_8030480 + + thumb_func_start sub_80304C8 +sub_80304C8: + push {r4,lr} + ldr r4, _08030538 + ldr r0, [r4] + adds r0, 0xCC + movs r2, 0 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0xCD + strb r2, [r0] + ldr r0, [r4] + adds r0, 0xCE + movs r1, 0x8 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0xCF + strb r2, [r0] + ldr r0, [r4] + adds r0, 0x4A + movs r1, 0 + ldrsh r0, [r0, r1] + movs r1, 0xC + bl sub_80095E4 + adds r0, 0x2 + lsls r0, 16 + ldr r2, [r4] + ldr r3, [r2, 0x64] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x7A + asrs r3, r0, 16 + lsrs r0, 16 + strh r0, [r1] + ldr r1, [r2, 0x64] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r2, r0 + adds r3, 0x2 + adds r2, 0x7C + strh r3, [r2] + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x6C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08030538: .4byte gUnknown_203B31C + thumb_func_end sub_80304C8 + + thumb_func_start sub_803053C +sub_803053C: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x108 + ldr r4, _08030658 + ldr r0, [r4] + ldr r0, [r0, 0x64] + bl sub_8008C54 + ldr r0, [r4] + ldr r0, [r0, 0x64] + bl sub_80073B8 + ldr r2, _0803065C + ldr r0, [r4] + ldr r3, [r0, 0x64] + movs r0, 0 + str r0, [sp] + movs r0, 0xA + movs r1, 0 + bl xxx_call_draw_string + ldr r3, [r4] + adds r0, r3, 0 + adds r0, 0xCE + ldrb r0, [r0] + lsls r0, 3 + adds r0, 0x4 + adds r1, r3, 0 + adds r1, 0x4E + movs r5, 0 + ldrsh r2, [r1, r5] + adds r2, 0x1 + movs r1, 0x7 + str r1, [sp] + ldr r1, [r3, 0x64] + str r1, [sp, 0x4] + movs r1, 0 + movs r3, 0x2 + bl sub_8012BC4 + movs r0, 0 + mov r9, r0 + ldr r0, [r4] + adds r0, 0x4A + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r9, r0 + bge _0803063E + mov r8, r4 +_080305A2: + mov r3, r8 + ldr r1, [r3] + adds r0, r1, 0 + adds r0, 0x4E + movs r5, 0 + ldrsh r2, [r0, r5] + subs r0, 0x2 + movs r3, 0 + ldrsh r0, [r0, r3] + muls r0, r2 + add r0, r9 + lsls r0, 1 + adds r1, r0 + movs r5, 0 + ldrsh r4, [r1, r5] + adds r0, r4, 0 + bl sub_80A2740 + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r4, 0 + bl sub_80A2668 + adds r4, r0, 0 + lsls r4, 16 + asrs r4, 16 + mov r1, r8 + ldr r0, [r1] + adds r0, 0x30 + mov r1, r9 + bl sub_8013800 + adds r6, r0, 0 + movs r5, 0x7 + adds r0, r4, 0 + bl sub_809758C + lsls r0, 24 + cmp r0, 0 + beq _08030608 + mov r3, r8 + ldr r0, [r3] + ldr r3, [r0, 0x64] + movs r0, 0 + str r0, [sp] + movs r0, 0x8 + adds r1, r6, 0 + ldr r2, _08030660 + bl xxx_call_draw_string + movs r5, 0x4 +_08030608: + adds r0, r7, 0 + bl sub_809009C + adds r3, r0, 0 + add r0, sp, 0x8 + ldr r1, _08030664 + adds r2, r5, 0 + bl sub_800D158 + mov r5, r8 + ldr r0, [r5] + ldr r3, [r0, 0x64] + movs r0, 0 + str r0, [sp] + movs r0, 0x10 + adds r1, r6, 0 + add r2, sp, 0x8 + bl xxx_call_draw_string + movs r0, 0x1 + add r9, r0 + ldr r0, [r5] + adds r0, 0x4A + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r9, r0 + blt _080305A2 +_0803063E: + ldr r0, _08030658 + ldr r0, [r0] + ldr r0, [r0, 0x64] + bl sub_80073E0 + add sp, 0x108 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08030658: .4byte gUnknown_203B31C +_0803065C: .4byte gUnknown_80E081C +_08030660: .4byte gUnknown_80E0824 +_08030664: .4byte gUnknown_80E0828 + thumb_func_end sub_803053C + + thumb_func_start sub_8030668 +sub_8030668: + push {r4-r6,lr} + movs r6, 0 + movs r5, 0 +_0803066E: + lsls r0, r5, 16 + asrs r4, r0, 16 + adds r0, r4, 0 + bl sub_8097504 + lsls r0, 24 + cmp r0, 0 + beq _08030690 + adds r0, r4, 0 + bl sub_80A26CC + ldr r1, _080306A0 + ldr r1, [r1] + lsls r2, r6, 1 + adds r1, r2 + strh r0, [r1] + adds r6, 0x1 +_08030690: + adds r5, 0x1 + cmp r5, 0x16 + ble _0803066E + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080306A0: .4byte gUnknown_203B31C + thumb_func_end sub_8030668 + + thumb_func_start sub_80306A4 +sub_80306A4: + movs r0, 0 + bx lr + thumb_func_end sub_80306A4 + + thumb_func_start sub_80306A8 +sub_80306A8: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + adds r5, r1, 0 + adds r7, r2, 0 + mov r8, r3 + bl sub_8030C20 + lsls r0, 24 + cmp r0, 0 + beq _080306C4 + movs r0, 0 + b _08030756 +_080306C4: + ldr r6, _08030760 + movs r0, 0xC4 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r6] + str r4, [r0, 0x20] + str r5, [r0, 0x58] + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 3 + adds r1, 0x60 + adds r1, r0, r1 + str r1, [r0, 0x5C] + adds r0, 0x60 + bl sub_8006518 + ldr r1, [r6] + ldr r2, [r1, 0x58] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r1, 0x60 + ldr r0, _08030764 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r2, [r6] + ldr r1, [r2, 0x5C] + adds r0, r2, 0 + adds r0, 0xC0 + str r0, [r1, 0x14] + cmp r7, 0 + beq _0803071E + ldr r1, [r2, 0x58] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r1, r2, 0 + adds r1, 0x68 + adds r1, r0 + ldr r0, [r7] + str r0, [r1] +_0803071E: + ldr r0, [r6] + ldr r0, [r0, 0x5C] + mov r1, r8 + bl sub_8012D08 + bl sub_8004914 + ldr r0, [r6] + adds r0, 0x60 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r4, [r6] + adds r4, 0x24 + bl sub_8030A74 + adds r1, r0, 0 + adds r0, r4, 0 + mov r2, r8 + adds r3, r5, 0 + bl sub_8013818 + bl sub_80308A0 + bl sub_803092C + movs r0, 0x1 +_08030756: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08030760: .4byte gUnknown_203B320 +_08030764: .4byte gUnknown_80E0854 + thumb_func_end sub_80306A8 + + thumb_func_start sub_8030768 +sub_8030768: + push {lr} + lsls r0, 24 + cmp r0, 0 + bne _08030784 + ldr r0, _08030780 + ldr r0, [r0] + adds r0, 0x24 + bl sub_8013660 + movs r0, 0 + b _080307E6 + .align 2, 0 +_08030780: .4byte gUnknown_203B320 +_08030784: + ldr r0, _0803079C + ldr r0, [r0] + adds r0, 0x24 + bl GetKeyPress + cmp r0, 0x2 + beq _080307AE + cmp r0, 0x2 + bgt _080307A0 + cmp r0, 0x1 + beq _080307B8 + b _080307C2 + .align 2, 0 +_0803079C: .4byte gUnknown_203B320 +_080307A0: + cmp r0, 0x4 + bne _080307C2 + movs r0, 0x4 + bl sub_80119D4 + movs r0, 0x4 + b _080307E6 +_080307AE: + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + b _080307E6 +_080307B8: + movs r0, 0 + bl sub_80119D4 + movs r0, 0x3 + b _080307E6 +_080307C2: + ldr r0, _080307D8 + ldr r0, [r0] + adds r0, 0x24 + movs r1, 0x1 + bl sub_80138B8 + lsls r0, 24 + cmp r0, 0 + bne _080307DC + movs r0, 0 + b _080307E6 + .align 2, 0 +_080307D8: .4byte gUnknown_203B320 +_080307DC: + bl sub_80308A0 + bl sub_803092C + movs r0, 0x1 +_080307E6: + pop {r1} + bx r1 + thumb_func_end sub_8030768 + + thumb_func_start sub_80307EC +sub_80307EC: + ldr r0, _0803080C + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x42 + movs r3, 0 + ldrsh r1, [r0, r3] + subs r0, 0x2 + movs r3, 0 + ldrsh r0, [r0, r3] + muls r0, r1 + movs r3, 0x3C + ldrsh r1, [r2, r3] + adds r0, r1 + adds r2, r0 + ldrb r0, [r2] + bx lr + .align 2, 0 +_0803080C: .4byte gUnknown_203B320 + thumb_func_end sub_80307EC + + thumb_func_start sub_8030810 +sub_8030810: + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8030A74 + adds r1, r0, 0 + ldr r5, _08030848 + ldr r0, [r5] + adds r2, r0, 0 + adds r2, 0x46 + strh r1, [r2] + adds r0, 0x24 + bl sub_8013984 + bl sub_80308A0 + bl sub_803092C + cmp r4, 0 + beq _08030842 + ldr r0, [r5] + adds r0, 0x24 + bl AddMenuCursorSprite +_08030842: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08030848: .4byte gUnknown_203B320 + thumb_func_end sub_8030810 + + thumb_func_start sub_803084C +sub_803084C: + push {r4,r5,lr} + ldr r4, _0803088C + ldr r2, [r4] + cmp r2, 0 + beq _08030886 + ldr r0, [r2, 0x58] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x60 + ldr r0, _08030890 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x60 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_08030886: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0803088C: .4byte gUnknown_203B320 +_08030890: .4byte gUnknown_80E083C + thumb_func_end sub_803084C + + thumb_func_start sub_8030894 +sub_8030894: + ldr r0, _0803089C + ldr r0, [r0] + bx lr + .align 2, 0 +_0803089C: .4byte gUnknown_203B320 + thumb_func_end sub_8030894 + + thumb_func_start sub_80308A0 +sub_80308A0: + push {r4,lr} + ldr r4, _08030928 + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0x44 + ldrh r1, [r1] + adds r0, 0xC0 + movs r2, 0 + strb r1, [r0] + ldr r0, [r4] + adds r1, r0, 0 + adds r1, 0x42 + ldrh r1, [r1] + adds r0, 0xC1 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0xC2 + movs r1, 0xC + strb r1, [r0] + ldr r0, [r4] + adds r0, 0xC3 + strb r2, [r0] + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x60 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + movs r1, 0x3E + ldrsh r0, [r0, r1] + movs r1, 0xC + bl sub_80095E4 + adds r0, 0x2 + lsls r0, 16 + ldr r2, [r4] + ldr r3, [r2, 0x58] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x6E + asrs r3, r0, 16 + lsrs r0, 16 + strh r0, [r1] + ldr r1, [r2, 0x58] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r2, r0 + adds r3, 0x2 + adds r2, 0x70 + strh r3, [r2] + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x60 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08030928: .4byte gUnknown_203B320 + thumb_func_end sub_80308A0 + + thumb_func_start sub_803092C +sub_803092C: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x60 + ldr r7, _08030A24 + ldr r0, [r7] + ldr r0, [r0, 0x58] + bl sub_8008C54 + ldr r0, [r7] + ldr r0, [r0, 0x58] + bl sub_80073B8 + ldr r1, [r7] + adds r0, r1, 0 + adds r0, 0x42 + movs r2, 0 + ldrsh r4, [r0, r2] + lsls r4, 3 + adds r5, r4, 0 + adds r5, 0xA + ldr r2, _08030A28 + ldr r0, [r1, 0x20] + lsls r0, 2 + adds r0, r2 + ldr r2, [r0] + ldr r3, [r1, 0x58] + movs r0, 0 + str r0, [sp] + adds r0, r5, 0 + movs r1, 0 + bl xxx_call_draw_string + adds r4, 0x4 + ldr r3, [r7] + adds r0, r3, 0 + adds r0, 0xC2 + ldrb r0, [r0] + lsls r0, 3 + adds r5, r4, r0 + adds r0, r3, 0 + adds r0, 0x42 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r2, 0x1 + movs r0, 0x7 + str r0, [sp] + ldr r0, [r3, 0x58] + str r0, [sp, 0x4] + adds r0, r5, 0 + movs r1, 0 + movs r3, 0x1 + bl sub_8012BC4 + movs r6, 0 + ldr r0, [r7] + movs r2, 0x3E + ldrsh r0, [r0, r2] + cmp r6, r0 + bge _08030A56 + mov r9, r7 + mov r8, r6 + add r7, sp, 0x8 + mov r5, sp + adds r5, 0x4B +_080309B0: + mov r3, r9 + ldr r1, [r3] + adds r0, r1, 0 + adds r0, 0x42 + movs r3, 0 + ldrsh r2, [r0, r3] + subs r0, 0x2 + movs r3, 0 + ldrsh r0, [r0, r3] + muls r0, r2 + adds r0, r6 + adds r1, r0 + ldrb r0, [r1] + bl sub_8095228 + adds r4, r0, 0 + mov r1, r9 + ldr r0, [r1] + ldr r1, [r0, 0x58] + str r1, [sp, 0x8] + adds r0, 0x24 + adds r1, r6, 0 + bl sub_8013800 + str r0, [sp, 0x50] + add r1, sp, 0x48 + movs r0, 0x7 + strb r0, [r1] + mov r0, sp + adds r0, 0x4A + mov r2, r8 + strb r2, [r0] + add r0, sp, 0x4C + strb r2, [r0] + adds r0, r4, 0x4 + str r0, [sp, 0x10] + adds r0, 0x10 + str r0, [sp, 0x14] + ldrh r0, [r4, 0xC] + strh r0, [r7, 0x10] + ldrh r0, [r4, 0xC] + strh r0, [r7, 0x12] + strb r2, [r7, 0x14] + subs r1, 0x12 + movs r0, 0x5 + strb r0, [r1] + ldrb r0, [r4] + cmp r0, 0x4 + beq _08030A32 + cmp r0, 0x4 + bgt _08030A2C + cmp r0, 0x2 + bgt _08030A3E + cmp r0, 0x1 + blt _08030A3E + movs r0, 0x1 + strb r0, [r5] + b _08030A42 + .align 2, 0 +_08030A24: .4byte gUnknown_203B320 +_08030A28: .4byte gUnknown_80E086C +_08030A2C: + cmp r0, 0x5 + beq _08030A38 + b _08030A3E +_08030A32: + movs r0, 0x3 + strb r0, [r5] + b _08030A42 +_08030A38: + movs r0, 0x4 + strb r0, [r5] + b _08030A42 +_08030A3E: + mov r3, r8 + strb r3, [r5] +_08030A42: + add r0, sp, 0x8 + bl sub_803B6D4 + adds r6, 0x1 + mov r1, r9 + ldr r0, [r1] + movs r2, 0x3E + ldrsh r0, [r0, r2] + cmp r6, r0 + blt _080309B0 +_08030A56: + ldr r0, _08030A70 + ldr r0, [r0] + ldr r0, [r0, 0x58] + bl sub_80073E0 + add sp, 0x60 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08030A70: .4byte gUnknown_203B320 + thumb_func_end sub_803092C + + thumb_func_start sub_8030A74 +sub_8030A74: + push {r4,r5,lr} + movs r2, 0 + ldr r0, _08030A90 + ldr r0, [r0] + ldr r0, [r0, 0x20] + cmp r0, 0x7 + bls _08030A84 + b _08030C0E +_08030A84: + lsls r0, 2 + ldr r1, _08030A94 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08030A90: .4byte gUnknown_203B320 +_08030A94: .4byte _08030A98 + .align 2, 0 +_08030A98: + .4byte _08030AB8 + .4byte _08030B10 + .4byte _08030B3C + .4byte _08030B94 + .4byte _08030B68 + .4byte _08030BC0 + .4byte _08030AE4 + .4byte _08030BEC +_08030AB8: + movs r1, 0 + ldr r5, _08030ADC + ldr r4, _08030AE0 + movs r3, 0 +_08030AC0: + ldr r0, [r5] + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0 + beq _08030AD2 + ldr r0, [r4] + adds r0, r2 + strb r1, [r0] + adds r2, 0x1 +_08030AD2: + adds r3, 0x30 + adds r1, 0x1 + cmp r1, 0x1F + ble _08030AC0 + b _08030C0E + .align 2, 0 +_08030ADC: .4byte gUnknown_203B480 +_08030AE0: .4byte gUnknown_203B320 +_08030AE4: + movs r1, 0 + ldr r5, _08030B08 + ldr r4, _08030B0C + movs r3, 0 +_08030AEC: + ldr r0, [r5] + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0x6 + bne _08030AFE + ldr r0, [r4] + adds r0, r2 + strb r1, [r0] + adds r2, 0x1 +_08030AFE: + adds r3, 0x30 + adds r1, 0x1 + cmp r1, 0x1F + ble _08030AEC + b _08030C0E + .align 2, 0 +_08030B08: .4byte gUnknown_203B480 +_08030B0C: .4byte gUnknown_203B320 +_08030B10: + movs r1, 0 + ldr r5, _08030B34 + ldr r4, _08030B38 + movs r3, 0 +_08030B18: + ldr r0, [r5] + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08030B2A + ldr r0, [r4] + adds r0, r2 + strb r1, [r0] + adds r2, 0x1 +_08030B2A: + adds r3, 0x30 + adds r1, 0x1 + cmp r1, 0x1F + ble _08030B18 + b _08030C0E + .align 2, 0 +_08030B34: .4byte gUnknown_203B480 +_08030B38: .4byte gUnknown_203B320 +_08030B3C: + movs r1, 0 + ldr r5, _08030B60 + ldr r4, _08030B64 + movs r3, 0 +_08030B44: + ldr r0, [r5] + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0x2 + bne _08030B56 + ldr r0, [r4] + adds r0, r2 + strb r1, [r0] + adds r2, 0x1 +_08030B56: + adds r3, 0x30 + adds r1, 0x1 + cmp r1, 0x1F + ble _08030B44 + b _08030C0E + .align 2, 0 +_08030B60: .4byte gUnknown_203B480 +_08030B64: .4byte gUnknown_203B320 +_08030B68: + movs r1, 0 + ldr r5, _08030B8C + ldr r4, _08030B90 + movs r3, 0 +_08030B70: + ldr r0, [r5] + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0x4 + bne _08030B82 + ldr r0, [r4] + adds r0, r2 + strb r1, [r0] + adds r2, 0x1 +_08030B82: + adds r3, 0x30 + adds r1, 0x1 + cmp r1, 0x1F + ble _08030B70 + b _08030C0E + .align 2, 0 +_08030B8C: .4byte gUnknown_203B480 +_08030B90: .4byte gUnknown_203B320 +_08030B94: + movs r1, 0 + ldr r5, _08030BB8 + ldr r4, _08030BBC + movs r3, 0 +_08030B9C: + ldr r0, [r5] + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0x3 + bne _08030BAE + ldr r0, [r4] + adds r0, r2 + strb r1, [r0] + adds r2, 0x1 +_08030BAE: + adds r3, 0x30 + adds r1, 0x1 + cmp r1, 0x1F + ble _08030B9C + b _08030C0E + .align 2, 0 +_08030BB8: .4byte gUnknown_203B480 +_08030BBC: .4byte gUnknown_203B320 +_08030BC0: + movs r1, 0 + ldr r5, _08030BE4 + ldr r4, _08030BE8 + movs r3, 0 +_08030BC8: + ldr r0, [r5] + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0x5 + bne _08030BDA + ldr r0, [r4] + adds r0, r2 + strb r1, [r0] + adds r2, 0x1 +_08030BDA: + adds r3, 0x30 + adds r1, 0x1 + cmp r1, 0x1F + ble _08030BC8 + b _08030C0E + .align 2, 0 +_08030BE4: .4byte gUnknown_203B480 +_08030BE8: .4byte gUnknown_203B320 +_08030BEC: + movs r1, 0 + ldr r5, _08030C18 + ldr r4, _08030C1C + movs r3, 0 +_08030BF4: + ldr r0, [r5] + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0x7 + bne _08030C06 + ldr r0, [r4] + adds r0, r2 + strb r1, [r0] + adds r2, 0x1 +_08030C06: + adds r3, 0x30 + adds r1, 0x1 + cmp r1, 0x1F + ble _08030BF4 +_08030C0E: + adds r0, r2, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08030C18: .4byte gUnknown_203B480 +_08030C1C: .4byte gUnknown_203B320 + thumb_func_end sub_8030A74 + + thumb_func_start sub_8030C20 +sub_8030C20: + push {lr} + cmp r0, 0x7 + bls _08030C28 + b _08030D34 +_08030C28: + lsls r0, 2 + ldr r1, _08030C34 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08030C34: .4byte _08030C38 + .align 2, 0 +_08030C38: + .4byte _08030C58 + .4byte _08030C90 + .4byte _08030CAC + .4byte _08030CE4 + .4byte _08030CC8 + .4byte _08030D00 + .4byte _08030C74 + .4byte _08030D20 +_08030C58: + movs r1, 0 + ldr r0, _08030C70 + ldr r2, [r0] +_08030C5E: + ldrb r0, [r2] + cmp r0, 0 + bne _08030D1C + adds r2, 0x30 + adds r1, 0x1 + cmp r1, 0x1F + ble _08030C5E + b _08030D34 + .align 2, 0 +_08030C70: .4byte gUnknown_203B480 +_08030C74: + movs r1, 0 + ldr r0, _08030C8C + ldr r2, [r0] +_08030C7A: + ldrb r0, [r2] + cmp r0, 0x6 + beq _08030D1C + adds r2, 0x30 + adds r1, 0x1 + cmp r1, 0x1F + ble _08030C7A + b _08030D34 + .align 2, 0 +_08030C8C: .4byte gUnknown_203B480 +_08030C90: + movs r1, 0 + ldr r0, _08030CA8 + ldr r2, [r0] +_08030C96: + ldrb r0, [r2] + cmp r0, 0x1 + beq _08030D1C + adds r2, 0x30 + adds r1, 0x1 + cmp r1, 0x1F + ble _08030C96 + b _08030D34 + .align 2, 0 +_08030CA8: .4byte gUnknown_203B480 +_08030CAC: + movs r1, 0 + ldr r0, _08030CC4 + ldr r2, [r0] +_08030CB2: + ldrb r0, [r2] + cmp r0, 0x2 + beq _08030D1C + adds r2, 0x30 + adds r1, 0x1 + cmp r1, 0x1F + ble _08030CB2 + b _08030D34 + .align 2, 0 +_08030CC4: .4byte gUnknown_203B480 +_08030CC8: + movs r1, 0 + ldr r0, _08030CE0 + ldr r2, [r0] +_08030CCE: + ldrb r0, [r2] + cmp r0, 0x4 + beq _08030D1C + adds r2, 0x30 + adds r1, 0x1 + cmp r1, 0x1F + ble _08030CCE + b _08030D34 + .align 2, 0 +_08030CE0: .4byte gUnknown_203B480 +_08030CE4: + movs r1, 0 + ldr r0, _08030CFC + ldr r2, [r0] +_08030CEA: + ldrb r0, [r2] + cmp r0, 0x3 + beq _08030D1C + adds r2, 0x30 + adds r1, 0x1 + cmp r1, 0x1F + ble _08030CEA + b _08030D34 + .align 2, 0 +_08030CFC: .4byte gUnknown_203B480 +_08030D00: + movs r1, 0 + ldr r0, _08030D18 + ldr r2, [r0] +_08030D06: + ldrb r0, [r2] + cmp r0, 0x5 + beq _08030D1C + adds r2, 0x30 + adds r1, 0x1 + cmp r1, 0x1F + ble _08030D06 + b _08030D34 + .align 2, 0 +_08030D18: .4byte gUnknown_203B480 +_08030D1C: + movs r0, 0 + b _08030D36 +_08030D20: + movs r1, 0 + ldr r0, _08030D3C + ldr r2, [r0] +_08030D26: + ldrb r0, [r2] + cmp r0, 0x7 + beq _08030D1C + adds r2, 0x30 + adds r1, 0x1 + cmp r1, 0x1F + ble _08030D26 +_08030D34: + movs r0, 0x1 +_08030D36: + pop {r1} + bx r1 + .align 2, 0 +_08030D3C: .4byte gUnknown_203B480 + thumb_func_end sub_8030C20 + + thumb_func_start sub_8030D40 +sub_8030D40: + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r6, _08030D98 + movs r0, 0x78 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r6] + strb r4, [r0, 0xC] + ldr r0, [r6] + bl sub_801317C + ldr r0, [r6] + str r5, [r0, 0x10] + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 3 + adds r1, 0x18 + adds r1, r0, r1 + str r1, [r0, 0x14] + adds r0, 0x18 + bl sub_8006518 + ldr r1, [r6] + ldr r2, [r1, 0x10] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r1, 0x18 + ldr r0, _08030D9C + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + bl sub_8030DD4 + movs r0, 0x1 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08030D98: .4byte gUnknown_203B324 +_08030D9C: .4byte gUnknown_80E091C + thumb_func_end sub_8030D40 + + thumb_func_start sub_8030DA0 +sub_8030DA0: + push {lr} + ldr r0, _08030DC0 + ldr r0, [r0] + ldr r1, [r0, 0x10] + bl sub_8012A64 + cmp r0, 0x1 + beq _08030DC4 + cmp r0, 0x2 + bne _08030DCE + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + b _08030DD0 + .align 2, 0 +_08030DC0: .4byte gUnknown_203B324 +_08030DC4: + movs r0, 0 + bl sub_80119D4 + movs r0, 0x3 + b _08030DD0 +_08030DCE: + movs r0, 0 +_08030DD0: + pop {r1} + bx r1 + thumb_func_end sub_8030DA0 + + thumb_func_start sub_8030DD4 +sub_8030DD4: + push {lr} + bl sub_8030E2C + bl sub_8030E48 + pop {r0} + bx r0 + thumb_func_end sub_8030DD4 + + thumb_func_start sub_8030DE4 +sub_8030DE4: + push {r4,r5,lr} + ldr r4, _08030E24 + ldr r2, [r4] + cmp r2, 0 + beq _08030E1E + ldr r0, [r2, 0x10] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x18 + ldr r0, _08030E28 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x18 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_08030E1E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08030E24: .4byte gUnknown_203B324 +_08030E28: .4byte gUnknown_80E0900 + thumb_func_end sub_8030DE4 + + thumb_func_start sub_8030E2C +sub_8030E2C: + push {lr} + bl sub_8004914 + ldr r0, _08030E44 + ldr r0, [r0] + adds r0, 0x18 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r0} + bx r0 + .align 2, 0 +_08030E44: .4byte gUnknown_203B324 + thumb_func_end sub_8030E2C + + thumb_func_start sub_8030E48 +sub_8030E48: + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x15C + ldr r3, _08030EA8 + ldr r4, _08030EAC + ldr r2, [r4] + ldrb r1, [r2, 0xC] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 4 + ldr r1, [r3] + adds r5, r1, r0 + ldr r0, [r2, 0x10] + bl sub_80073B8 + ldr r0, [r4] + ldr r0, [r0, 0x10] + str r0, [sp, 0x4] + add r1, sp, 0x44 + movs r2, 0 + movs r0, 0x7 + strb r0, [r1] + mov r0, sp + adds r0, 0x46 + strb r2, [r0] + add r0, sp, 0x48 + strb r2, [r0] + adds r0, r5, 0x4 + str r0, [sp, 0xC] + adds r0, 0x10 + str r0, [sp, 0x10] + add r1, sp, 0x4 + ldrh r0, [r5, 0xC] + strh r0, [r1, 0x10] + ldrh r0, [r5, 0xC] + strh r0, [r1, 0x12] + adds r0, r1, 0 + strb r2, [r0, 0x14] + adds r2, r5, 0 + adds r2, 0x22 + ldrb r0, [r2] + cmp r0, 0 + bne _08030EB0 + adds r1, 0x2E + movs r0, 0x5 + strb r0, [r1] + b _08030EBE + .align 2, 0 +_08030EA8: .4byte gUnknown_203B480 +_08030EAC: .4byte gUnknown_203B324 +_08030EB0: + mov r1, sp + adds r1, 0x32 + movs r0, 0x2 + strb r0, [r1] + ldrb r1, [r2] + add r0, sp, 0x38 + strb r1, [r0] +_08030EBE: + ldrb r0, [r5] + cmp r0, 0x2 + beq _08030ED2 + cmp r0, 0x2 + ble _08030EE2 + cmp r0, 0x4 + beq _08030ED2 + cmp r0, 0x5 + beq _08030EDA + b _08030EE2 +_08030ED2: + mov r1, sp + adds r1, 0x45 + movs r0, 0xA + b _08030EE8 +_08030EDA: + mov r1, sp + adds r1, 0x45 + movs r0, 0xB + b _08030EE8 +_08030EE2: + mov r1, sp + adds r1, 0x45 + movs r0, 0x9 +_08030EE8: + strb r0, [r1] + add r0, sp, 0x4 + bl sub_803B98C + ldrh r0, [r5, 0x10] + ldr r1, _08030F48 + bl __umodsi3 + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + ldr r2, _08030F4C + ldr r5, _08030F50 + ldr r0, [r5] + ldr r3, [r0, 0x10] + movs r0, 0 + mov r8, r0 + str r0, [sp] + movs r0, 0xA + movs r1, 0x68 + bl xxx_call_draw_string + add r6, sp, 0x5C + ldr r1, _08030F54 + adds r0, r6, 0 + adds r2, r4, 0 + bl sub_800D158 + ldr r0, [r5] + ldr r3, [r0, 0x10] + mov r0, r8 + str r0, [sp] + movs r0, 0x44 + movs r1, 0x68 + adds r2, r6, 0 + bl xxx_call_draw_string + ldr r0, [r5] + ldr r0, [r0, 0x10] + bl sub_80073E0 + add sp, 0x15C + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08030F48: .4byte 0x00002710 +_08030F4C: .4byte gUnknown_80E0934 +_08030F50: .4byte gUnknown_203B324 +_08030F54: .4byte gUnknown_80E0938 + thumb_func_end sub_8030E48 + + thumb_func_start sub_8030F58 +sub_8030F58: + push {r4-r6,lr} + adds r6, r0, 0 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r5, _08030FF4 + ldr r0, [r5] + cmp r0, 0 + bne _08030F88 + movs r4, 0x8E + lsls r4, 1 + adds r0, r4, 0 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] + movs r1, 0 + adds r2, r4, 0 + bl MemoryFill8 +_08030F88: + ldr r0, [r5] + movs r1, 0x8C + lsls r1, 1 + adds r0, r1 + str r6, [r0] + movs r0, 0x98 + lsls r0, 1 + bl sub_808DDD0 + ldr r2, [r5] + movs r4, 0x84 + lsls r4, 1 + adds r1, r2, r4 + str r0, [r1] + movs r3, 0x86 + lsls r3, 1 + adds r1, r2, r3 + ldr r0, [r0, 0x4] + str r0, [r1] + movs r0, 0x8A + lsls r0, 1 + adds r2, r0 + movs r1, 0 + strb r1, [r2] + ldr r0, [r5] + ldr r2, _08030FF8 + adds r0, r2 + strb r1, [r0] + ldr r0, [r5] + adds r3, 0xA + adds r0, r3 + strb r1, [r0] + ldr r2, [r5] + movs r0, 0x88 + lsls r0, 1 + adds r1, r2, r0 + movs r0, 0x2 + strh r0, [r1] + subs r3, 0x4 + adds r1, r2, r3 + movs r0, 0x8 + strh r0, [r1] + adds r0, r6, 0 + bl sub_8030C20 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _08031038 + cmp r6, 0x2 + beq _08030FFC + cmp r6, 0x4 + beq _08031014 + b _08031022 + .align 2, 0 +_08030FF4: .4byte gUnknown_203B328 +_08030FF8: .4byte 0x00000115 +_08030FFC: + ldr r0, _0803100C + ldr r2, [r5] + adds r2, r4 + ldr r3, _08031010 + movs r1, 0 + bl sub_80141B4 + b _08031022 + .align 2, 0 +_0803100C: .4byte gUnknown_80E09D8 +_08031010: .4byte 0x00000101 +_08031014: + ldr r0, _0803102C + ldr r2, [r5] + adds r2, r4 + ldr r3, _08031030 + movs r1, 0 + bl sub_80141B4 +_08031022: + ldr r0, _08031034 + ldr r1, [r0] + movs r0, 0x5 + str r0, [r1] + b _08031048 + .align 2, 0 +_0803102C: .4byte gUnknown_80E0A0C +_08031030: .4byte 0x00000101 +_08031034: .4byte gUnknown_203B328 +_08031038: + ldr r0, [r5] + str r1, [r0] + adds r0, r6, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x8 + bl sub_80306A8 +_08031048: + movs r0, 0x1 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8030F58 + + thumb_func_start sub_8031050 +sub_8031050: + push {lr} + ldr r1, _08031068 + ldr r0, [r1] + ldr r0, [r0] + adds r2, r1, 0 + cmp r0, 0x6 + bhi _080310AC + lsls r0, 2 + ldr r1, _0803106C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08031068: .4byte gUnknown_203B328 +_0803106C: .4byte _08031070 + .align 2, 0 +_08031070: + .4byte _0803108C + .4byte _08031092 + .4byte _08031098 + .4byte _08031098 + .4byte _080310A2 + .4byte _080310A8 + .4byte _080310A8 +_0803108C: + bl sub_8031300 + b _080310AC +_08031092: + bl sub_803136C + b _080310AC +_08031098: + ldr r0, [r2] + ldr r0, [r0] + bl sub_80313D8 + b _080310AC +_080310A2: + bl sub_8031498 + b _080310AC +_080310A8: + movs r0, 0x3 + b _080310AE +_080310AC: + movs r0, 0 +_080310AE: + pop {r1} + bx r1 + thumb_func_end sub_8031050 + + thumb_func_start sub_80310B4 +sub_80310B4: + push {r4,lr} + bl sub_803084C + ldr r4, _080310E0 + ldr r0, [r4] + cmp r0, 0 + beq _080310D8 + movs r1, 0x84 + lsls r1, 1 + adds r0, r1 + ldr r0, [r0] + bl sub_800AA14 + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_080310D8: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080310E0: .4byte gUnknown_203B328 + thumb_func_end sub_80310B4 + + thumb_func_start sub_80310E4 +sub_80310E4: + push {lr} + ldr r1, _080310F8 + ldr r1, [r1] + str r0, [r1] + bl sub_80310FC + bl sub_8031258 + pop {r0} + bx r0 + .align 2, 0 +_080310F8: .4byte gUnknown_203B328 + thumb_func_end sub_80310E4 + + thumb_func_start sub_80310FC +sub_80310FC: + push {r4-r6,lr} + ldr r4, _0803111C + ldr r0, [r4] + adds r0, 0xA8 + bl sub_8006518 + ldr r0, [r4] + ldr r0, [r0] + cmp r0, 0x6 + bls _08031112 + b _0803122C +_08031112: + lsls r0, 2 + ldr r1, _08031120 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0803111C: .4byte gUnknown_203B328 +_08031120: .4byte _08031124 + .align 2, 0 +_08031124: + .4byte _08031140 + .4byte _08031178 + .4byte _080311C0 + .4byte _080311C0 + .4byte _080311E8 + .4byte _0803122C + .4byte _0803122C +_08031140: + ldr r3, _08031170 + ldr r1, [r3] + ldr r2, _08031174 + adds r1, 0xC0 + adds r0, r2, 0 + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldr r1, [r3] + adds r1, 0xD8 + adds r0, r2, 0 + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldr r0, [r3] + adds r0, 0xF0 + ldm r2!, {r1,r3,r4} + stm r0!, {r1,r3,r4} + ldm r2!, {r1,r5,r6} + stm r0!, {r1,r5,r6} + b _0803123A + .align 2, 0 +_08031170: .4byte gUnknown_203B328 +_08031174: .4byte gUnknown_80E0990 +_08031178: + ldr r3, _080311B0 + ldr r1, [r3] + adds r1, 0xC0 + ldr r0, _080311B4 + ldm r0!, {r2,r4,r5} + stm r1!, {r2,r4,r5} + ldm r0!, {r2,r4,r6} + stm r1!, {r2,r4,r6} + ldr r1, [r3] + ldr r2, _080311B8 + adds r1, 0xD8 + adds r0, r2, 0 + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldr r0, [r3] + adds r0, 0xF0 + ldm r2!, {r1,r5,r6} + stm r0!, {r1,r5,r6} + ldm r2!, {r4-r6} + stm r0!, {r4-r6} + ldr r0, [r3] + adds r0, 0xC0 + ldr r1, _080311BC + bl sub_8012CAC + b _0803123A + .align 2, 0 +_080311B0: .4byte gUnknown_203B328 +_080311B4: .4byte gUnknown_80E09A8 +_080311B8: .4byte gUnknown_80E0990 +_080311BC: .4byte gUnknown_80E0968 +_080311C0: + ldr r2, _080311DC + ldr r1, [r2] + adds r1, 0xD8 + ldr r0, _080311E0 + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldm r0!, {r3,r4,r6} + stm r1!, {r3,r4,r6} + ldr r0, [r2] + adds r0, 0xD8 + ldr r1, _080311E4 + bl sub_8012CAC + b _0803123A + .align 2, 0 +_080311DC: .4byte gUnknown_203B328 +_080311E0: .4byte gUnknown_80E09C0 +_080311E4: .4byte gUnknown_80E0948 +_080311E8: + ldr r3, _08031224 + ldr r1, [r3] + ldr r2, _08031228 + adds r1, 0xA8 + adds r0, r2, 0 + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldr r1, [r3] + adds r1, 0xC0 + adds r0, r2, 0 + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldr r1, [r3] + adds r1, 0xD8 + adds r0, r2, 0 + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldr r0, [r3] + adds r0, 0xF0 + ldm r2!, {r1,r5,r6} + stm r0!, {r1,r5,r6} + ldm r2!, {r3-r5} + stm r0!, {r3-r5} + b _0803123A + .align 2, 0 +_08031224: .4byte gUnknown_203B328 +_08031228: .4byte gUnknown_80E0990 +_0803122C: + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C +_0803123A: + bl sub_8004914 + ldr r0, _08031254 + ldr r0, [r0] + adds r0, 0xA8 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08031254: .4byte gUnknown_203B328 + thumb_func_end sub_80310FC + + thumb_func_start sub_8031258 +sub_8031258: + push {r4,lr} + sub sp, 0x8 + ldr r1, _08031274 + ldr r0, [r1] + ldr r0, [r0] + adds r2, r1, 0 + cmp r0, 0x6 + bhi _080312F6 + lsls r0, 2 + ldr r1, _08031278 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08031274: .4byte gUnknown_203B328 +_08031278: .4byte _0803127C + .align 2, 0 +_0803127C: + .4byte _08031298 + .4byte _080312A0 + .4byte _080312BC + .4byte _080312BC + .4byte _080312EC + .4byte _080312F6 + .4byte _080312F6 +_08031298: + movs r0, 0x1 + bl sub_8030810 + b _080312F6 +_080312A0: + bl sub_803092C + ldr r0, _080312B4 + ldr r0, [r0] + adds r0, 0x8 + ldr r1, _080312B8 + movs r2, 0x4 + str r2, [sp] + movs r2, 0x1 + b _080312D8 + .align 2, 0 +_080312B4: .4byte gUnknown_203B328 +_080312B8: .4byte gUnknown_80E0968 +_080312BC: + bl sub_803092C + ldr r4, _080312E4 + ldr r0, [r4] + adds r0, 0x8 + movs r1, 0 + bl sub_8012EA4 + ldr r0, [r4] + adds r0, 0x58 + ldr r1, _080312E8 + movs r2, 0x3 + str r2, [sp] + movs r2, 0x2 +_080312D8: + str r2, [sp, 0x4] + movs r2, 0 + movs r3, 0 + bl sub_8012D60 + b _080312F6 + .align 2, 0 +_080312E4: .4byte gUnknown_203B328 +_080312E8: .4byte gUnknown_80E0948 +_080312EC: + ldr r0, [r2] + ldrb r0, [r0, 0x4] + movs r1, 0x3 + bl sub_8030D40 +_080312F6: + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8031258 + + thumb_func_start sub_8031300 +sub_8031300: + push {lr} + movs r0, 0x1 + bl sub_8030768 + cmp r0, 0x4 + bhi _08031366 + lsls r0, 2 + ldr r1, _08031318 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08031318: .4byte _0803131C + .align 2, 0 +_0803131C: + .4byte _08031366 + .4byte _08031366 + .4byte _08031360 + .4byte _08031330 + .4byte _08031348 +_08031330: + bl sub_80307EC + ldr r1, _08031344 + ldr r1, [r1] + strb r0, [r1, 0x4] + movs r0, 0x1 + bl sub_80310E4 + b _08031366 + .align 2, 0 +_08031344: .4byte gUnknown_203B328 +_08031348: + bl sub_80307EC + ldr r1, _0803135C + ldr r1, [r1] + strb r0, [r1, 0x4] + movs r0, 0x4 + bl sub_80310E4 + b _08031366 + .align 2, 0 +_0803135C: .4byte gUnknown_203B328 +_08031360: + movs r0, 0x6 + bl sub_80310E4 +_08031366: + pop {r0} + bx r0 + thumb_func_end sub_8031300 + + thumb_func_start sub_803136C +sub_803136C: + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + bl sub_8030768 + ldr r4, _080313A4 + ldr r0, [r4] + adds r0, 0x8 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _08031392 + ldr r0, [r4] + adds r0, 0x8 + mov r1, sp + bl sub_8013114 +_08031392: + ldr r0, [sp] + cmp r0, 0x4 + beq _080313C2 + cmp r0, 0x4 + bgt _080313A8 + cmp r0, 0x1 + beq _080313B2 + b _080313D0 + .align 2, 0 +_080313A4: .4byte gUnknown_203B328 +_080313A8: + cmp r0, 0x5 + beq _080313CA + cmp r0, 0x6 + beq _080313BA + b _080313D0 +_080313B2: + movs r0, 0 + bl sub_80310E4 + b _080313D0 +_080313BA: + movs r0, 0x3 + bl sub_80310E4 + b _080313D0 +_080313C2: + movs r0, 0x2 + bl sub_80310E4 + b _080313D0 +_080313CA: + movs r0, 0x4 + bl sub_80310E4 +_080313D0: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_803136C + + thumb_func_start sub_80313D8 +sub_80313D8: + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r0, 0 + str r0, [sp] + bl sub_8030768 + ldr r4, _08031418 + ldr r0, [r4] + adds r0, 0x8 + bl sub_8012FD8 + ldr r0, [r4] + adds r0, 0x58 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _08031408 + ldr r0, [r4] + adds r0, 0x58 + mov r1, sp + bl sub_8013114 +_08031408: + ldr r0, [sp] + cmp r0, 0x2 + beq _08031428 + cmp r0, 0x2 + bgt _0803141C + cmp r0, 0x1 + beq _08031420 + b _0803148E + .align 2, 0 +_08031418: .4byte gUnknown_203B328 +_0803141C: + cmp r0, 0x3 + bne _0803148E +_08031420: + movs r0, 0 + bl sub_80310E4 + b _0803148E +_08031428: + cmp r5, 0x2 + beq _08031432 + cmp r5, 0x3 + beq _0803143C + b _0803145A +_08031432: + ldr r0, [r4] + ldrb r0, [r0, 0x4] + bl sub_8095240 + b _0803145A +_0803143C: + ldr r4, _08031480 + movs r3, 0 + movs r1, 0 + movs r2, 0x1F +_08031444: + ldr r0, [r4] + adds r0, r1 + strb r3, [r0] + ldr r0, [r4] + adds r0, r1 + adds r0, 0x22 + strb r3, [r0] + adds r1, 0x30 + subs r2, 0x1 + cmp r2, 0 + bge _08031444 +_0803145A: + ldr r0, _08031484 + ldr r0, [r0] + movs r1, 0x8C + lsls r1, 1 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0x2 + beq _0803146E + cmp r0, 0x4 + bne _0803148E +_0803146E: + bl sub_8030C20 + lsls r0, 24 + cmp r0, 0 + beq _08031488 + movs r0, 0x5 + bl sub_80310E4 + b _0803148E + .align 2, 0 +_08031480: .4byte gUnknown_203B480 +_08031484: .4byte gUnknown_203B328 +_08031488: + movs r0, 0 + bl sub_80310E4 +_0803148E: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80313D8 + + thumb_func_start sub_8031498 +sub_8031498: + push {lr} + bl sub_8030DA0 + cmp r0, 0x1 + bls _080314B0 + cmp r0, 0x3 + bhi _080314B0 + bl sub_8030DE4 + movs r0, 0 + bl sub_80310E4 +_080314B0: + pop {r0} + bx r0 + thumb_func_end sub_8031498 + + thumb_func_start sub_80314B4 +sub_80314B4: + push {r4-r6,lr} + lsls r0, 16 + asrs r5, r0, 16 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r6, _08031534 + movs r0, 0x18 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r6] + ldr r0, _08031538 + adds r1, r5, 0 + bl sub_808D8E0 + adds r0, r5, 0 + bl sub_808D994 + adds r1, r0, 0 + ldr r0, _0803153C + bl strcpy + ldr r0, [r6] + movs r4, 0 + str r4, [r0, 0x8] + str r4, [r0, 0xC] + cmp r5, 0 + beq _0803151E + adds r0, r5, 0 + bl sub_808DDD0 + ldr r1, [r6] + str r0, [r1, 0x8] + strb r4, [r1, 0x14] + ldr r0, [r6] + strb r4, [r0, 0x15] + ldr r0, [r6] + strb r4, [r0, 0x16] + ldr r1, [r6] + movs r0, 0x2 + strh r0, [r1, 0x10] + movs r0, 0x8 + strh r0, [r1, 0x12] + ldr r0, [r1, 0x8] + cmp r0, 0 + beq _0803151E + ldr r0, [r0, 0x4] + str r0, [r1, 0xC] +_0803151E: + ldr r0, _08031534 + ldr r1, [r0] + movs r0, 0 + str r0, [r1, 0x4] + movs r0, 0x1 + bl sub_80317C0 + movs r0, 0x1 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08031534: .4byte gUnknown_203B32C +_08031538: .4byte gUnknown_202E5D8 +_0803153C: .4byte gUnknown_202DF98 + thumb_func_end sub_80314B4 + + thumb_func_start sub_8031540 +sub_8031540: + push {lr} + ldr r0, _08031558 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0x9 + bhi _080315BA + lsls r0, 2 + ldr r1, _0803155C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08031558: .4byte gUnknown_203B32C +_0803155C: .4byte _08031560 + .align 2, 0 +_08031560: + .4byte _080315AC + .4byte _08031588 + .4byte _08031588 + .4byte _0803158E + .4byte _08031594 + .4byte _0803159A + .4byte _080315A0 + .4byte _080315A6 + .4byte _080315B0 + .4byte _080315B6 +_08031588: + bl sub_80317D8 + b _080315BA +_0803158E: + bl sub_8031848 + b _080315BA +_08031594: + bl sub_8031864 + b _080315BA +_0803159A: + bl sub_80318D0 + b _080315BA +_080315A0: + bl sub_80318EC + b _080315BA +_080315A6: + bl sub_803192C + b _080315BA +_080315AC: + movs r0, 0x3 + b _080315BC +_080315B0: + bl sub_8031948 + b _080315BA +_080315B6: + bl sub_8031988 +_080315BA: + movs r0, 0 +_080315BC: + pop {r1} + bx r1 + thumb_func_end sub_8031540 + + thumb_func_start sub_80315C0 +sub_80315C0: + push {r4,lr} + ldr r4, _080315E4 + ldr r0, [r4] + cmp r0, 0 + beq _080315DE + ldr r0, [r0, 0x8] + cmp r0, 0 + beq _080315D4 + bl sub_800AA14 +_080315D4: + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_080315DE: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080315E4: .4byte gUnknown_203B32C + thumb_func_end sub_80315C0 + + thumb_func_start nullsub_39 +nullsub_39: + bx lr + thumb_func_end nullsub_39 + + thumb_func_start sub_80315EC +sub_80315EC: + push {r4,r5,lr} + sub sp, 0x14 + movs r5, 0 + ldr r0, _08031618 + ldr r2, [r0] + ldr r1, [r2, 0x8] + adds r3, r0, 0 + cmp r1, 0 + beq _08031602 + adds r5, r2, 0 + adds r5, 0x8 +_08031602: + ldrb r0, [r2] + subs r0, 0x1 + cmp r0, 0x8 + bls _0803160C + b _080317B0 +_0803160C: + lsls r0, 2 + ldr r1, _0803161C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08031618: .4byte gUnknown_203B32C +_0803161C: .4byte _08031620 + .align 2, 0 +_08031620: + .4byte _08031700 + .4byte _08031714 + .4byte _08031728 + .4byte _08031758 + .4byte _08031780 + .4byte _08031694 + .4byte _080316A8 + .4byte _08031644 + .4byte _08031658 +_08031644: + ldr r0, _08031650 + ldr r1, [r3] + ldr r2, [r1, 0x4] + ldr r3, _08031654 + b _08031760 + .align 2, 0 +_08031650: .4byte gUnknown_80E0C4C +_08031654: .4byte gUnknown_80E0BD4 +_08031658: + ldr r0, [r3] + ldr r0, [r0, 0x4] + cmp r0, 0x10 + beq _0803167C + cmp r0, 0x10 + bgt _0803166A + cmp r0, 0xF + beq _08031674 + b _080317B0 +_0803166A: + cmp r0, 0x11 + beq _08031684 + cmp r0, 0x12 + beq _0803168C + b _080317B0 +_08031674: + ldr r0, _08031678 + b _08031790 + .align 2, 0 +_08031678: .4byte gUnknown_80E0C70 +_0803167C: + ldr r0, _08031680 + b _08031790 + .align 2, 0 +_08031680: .4byte gUnknown_80E0DD0 +_08031684: + ldr r0, _08031688 + b _08031790 + .align 2, 0 +_08031688: .4byte gUnknown_80E0ED8 +_0803168C: + ldr r0, _08031690 + b _08031790 + .align 2, 0 +_08031690: .4byte gUnknown_80E10C8 +_08031694: + ldr r0, _080316A0 + ldr r1, [r3] + ldr r2, [r1, 0x4] + ldr r3, _080316A4 + b _08031760 + .align 2, 0 +_080316A0: .4byte gUnknown_80E0C4C +_080316A4: .4byte gUnknown_80E0B3C +_080316A8: + ldr r0, [r3] + ldr r0, [r0, 0x4] + subs r0, 0xA + cmp r0, 0x4 + bls _080316B4 + b _080317B0 +_080316B4: + lsls r0, 2 + ldr r1, _080316C0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080316C0: .4byte _080316C4 + .align 2, 0 +_080316C4: + .4byte _080316D8 + .4byte _080316E0 + .4byte _080316F0 + .4byte _080316E8 + .4byte _080316F8 +_080316D8: + ldr r0, _080316DC + b _08031790 + .align 2, 0 +_080316DC: .4byte gUnknown_80E120C +_080316E0: + ldr r0, _080316E4 + b _08031790 + .align 2, 0 +_080316E4: .4byte gUnknown_80E136C +_080316E8: + ldr r0, _080316EC + b _08031790 + .align 2, 0 +_080316EC: .4byte gUnknown_80E1420 +_080316F0: + ldr r0, _080316F4 + b _08031790 + .align 2, 0 +_080316F4: .4byte gUnknown_80E157C +_080316F8: + ldr r0, _080316FC + b _08031790 + .align 2, 0 +_080316FC: .4byte gUnknown_80E169C +_08031700: + ldr r0, _0803170C + ldr r1, [r3] + ldr r2, [r1, 0x4] + ldr r3, _08031710 + b _08031760 + .align 2, 0 +_0803170C: .4byte gUnknown_80E17C8 +_08031710: .4byte gUnknown_80E0A48 +_08031714: + ldr r0, _08031720 + ldr r1, [r3] + ldr r2, [r1, 0x4] + ldr r3, _08031724 + b _08031760 + .align 2, 0 +_08031720: .4byte gUnknown_80E183C +_08031724: .4byte gUnknown_80E0A48 +_08031728: + ldr r0, [r3] + ldr r0, [r0, 0x4] + cmp r0, 0x1 + beq _08031748 + cmp r0, 0x1 + bgt _0803173A + cmp r0, 0 + beq _08031740 + b _080317B0 +_0803173A: + cmp r0, 0x2 + beq _08031750 + b _080317B0 +_08031740: + ldr r0, _08031744 + b _08031790 + .align 2, 0 +_08031744: .4byte gUnknown_80E1868 +_08031748: + ldr r0, _0803174C + b _08031790 + .align 2, 0 +_0803174C: .4byte gUnknown_80E1A30 +_08031750: + ldr r0, _08031754 + b _08031790 + .align 2, 0 +_08031754: .4byte gUnknown_80E1AD8 +_08031758: + ldr r0, _08031778 + ldr r1, [r3] + ldr r2, [r1, 0x4] + ldr r3, _0803177C +_08031760: + movs r4, 0 + str r4, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r4, [sp, 0x8] + str r5, [sp, 0xC] + movs r1, 0xC + str r1, [sp, 0x10] + movs r1, 0 + bl sub_8014248 + b _080317B0 + .align 2, 0 +_08031778: .4byte gUnknown_80E0C4C +_0803177C: .4byte gUnknown_80E0ABC +_08031780: + ldr r0, [r3] + ldr r0, [r0, 0x4] + cmp r0, 0x6 + beq _0803178E + cmp r0, 0x9 + beq _080317A4 + b _080317B0 +_0803178E: + ldr r0, _0803179C +_08031790: + ldr r3, _080317A0 + movs r1, 0 + adds r2, r5, 0 + bl sub_80141B4 + b _080317B0 + .align 2, 0 +_0803179C: .4byte gUnknown_80E1B88 +_080317A0: .4byte 0x0000010d +_080317A4: + ldr r0, _080317B8 + ldr r3, _080317BC + movs r1, 0 + adds r2, r5, 0 + bl sub_80141B4 +_080317B0: + add sp, 0x14 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080317B8: .4byte gUnknown_80E1D84 +_080317BC: .4byte 0x0000010d + thumb_func_end sub_80315EC + + thumb_func_start sub_80317C0 +sub_80317C0: + push {lr} + ldr r1, _080317D4 + ldr r1, [r1] + strb r0, [r1] + bl nullsub_39 + bl sub_80315EC + pop {r0} + bx r0 + .align 2, 0 +_080317D4: .4byte gUnknown_203B32C + thumb_func_end sub_80317C0 + + thumb_func_start sub_80317D8 +sub_80317D8: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0803183C + ldr r2, [sp] + cmp r2, 0x5 + bhi _0803183C + lsls r0, r2, 2 + ldr r1, _080317F8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080317F8: .4byte _080317FC + .align 2, 0 +_080317FC: + .4byte _08031830 + .4byte _08031830 + .4byte _08031830 + .4byte _0803181C + .4byte _08031814 + .4byte _08031814 +_08031814: + movs r0, 0 + bl sub_80317C0 + b _0803183C +_0803181C: + ldr r0, _0803182C + ldr r0, [r0] + str r2, [r0, 0x4] + movs r0, 0x4 + bl sub_80317C0 + b _0803183C + .align 2, 0 +_0803182C: .4byte gUnknown_203B32C +_08031830: + ldr r0, _08031844 + ldr r0, [r0] + str r2, [r0, 0x4] + movs r0, 0x3 + bl sub_80317C0 +_0803183C: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08031844: .4byte gUnknown_203B32C + thumb_func_end sub_80317D8 + + thumb_func_start sub_8031848 +sub_8031848: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0803185C + movs r0, 0x2 + bl sub_80317C0 +_0803185C: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8031848 + + thumb_func_start sub_8031864 +sub_8031864: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080318C4 + ldr r0, [sp] + subs r1, r0, 0x5 + adds r2, r0, 0 + cmp r1, 0x4 + bhi _080318C4 + lsls r0, r1, 2 + ldr r1, _08031888 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08031888: .4byte _0803188C + .align 2, 0 +_0803188C: + .4byte _080318A0 + .4byte _080318B8 + .4byte _080318A8 + .4byte _080318B0 + .4byte _080318B8 +_080318A0: + movs r0, 0x2 + bl sub_80317C0 + b _080318C4 +_080318A8: + movs r0, 0x6 + bl sub_80317C0 + b _080318C4 +_080318B0: + movs r0, 0x8 + bl sub_80317C0 + b _080318C4 +_080318B8: + ldr r0, _080318CC + ldr r0, [r0] + str r2, [r0, 0x4] + movs r0, 0x5 + bl sub_80317C0 +_080318C4: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_080318CC: .4byte gUnknown_203B32C + thumb_func_end sub_8031864 + + thumb_func_start sub_80318D0 +sub_80318D0: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080318E4 + movs r0, 0x4 + bl sub_80317C0 +_080318E4: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80318D0 + + thumb_func_start sub_80318EC +sub_80318EC: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08031920 + ldr r1, [sp] + cmp r1, 0x5 + bne _08031908 + movs r0, 0x4 + bl sub_80317C0 + b _08031920 +_08031908: + cmp r1, 0x5 + blt _08031920 + cmp r1, 0xE + bgt _08031920 + cmp r1, 0xA + blt _08031920 + ldr r0, _08031928 + ldr r0, [r0] + str r1, [r0, 0x4] + movs r0, 0x7 + bl sub_80317C0 +_08031920: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08031928: .4byte gUnknown_203B32C + thumb_func_end sub_80318EC + + thumb_func_start sub_803192C +sub_803192C: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08031940 + movs r0, 0x6 + bl sub_80317C0 +_08031940: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_803192C + + thumb_func_start sub_8031948 +sub_8031948: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0803197C + ldr r1, [sp] + cmp r1, 0x5 + bne _08031964 + movs r0, 0x4 + bl sub_80317C0 + b _0803197C +_08031964: + cmp r1, 0x5 + blt _0803197C + cmp r1, 0x12 + bgt _0803197C + cmp r1, 0xF + blt _0803197C + ldr r0, _08031984 + ldr r0, [r0] + str r1, [r0, 0x4] + movs r0, 0x9 + bl sub_80317C0 +_0803197C: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08031984: .4byte gUnknown_203B32C + thumb_func_end sub_8031948 + + thumb_func_start sub_8031988 +sub_8031988: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0803199C + movs r0, 0x8 + bl sub_80317C0 +_0803199C: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8031988 + + thumb_func_start sub_80319A4 +sub_80319A4: + push {r4-r6,lr} + mov r6, r8 + push {r6} + adds r4, r0, 0 + adds r5, r1, 0 + mov r8, r2 + lsls r4, 24 + lsrs r4, 24 + lsls r5, 24 + lsrs r5, 24 + ldr r6, _080319F4 + movs r0, 0x78 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r6] + strb r4, [r0, 0xC] + ldr r0, [r6] + strb r5, [r0, 0xD] + ldr r0, [r6] + bl sub_801317C + ldr r1, [r6] + mov r0, r8 + str r0, [r1, 0x10] + lsls r0, 1 + add r0, r8 + lsls r0, 3 + adds r0, 0x18 + adds r0, r1, r0 + str r0, [r1, 0x14] + bl sub_8031A2C + movs r0, 0x1 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080319F4: .4byte gUnknown_203B330 + thumb_func_end sub_80319A4 + + thumb_func_start sub_80319F8 +sub_80319F8: + push {lr} + ldr r0, _08031A18 + ldr r0, [r0] + ldr r1, [r0, 0x10] + bl sub_8012A64 + cmp r0, 0x1 + beq _08031A1C + cmp r0, 0x2 + bne _08031A26 + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + b _08031A28 + .align 2, 0 +_08031A18: .4byte gUnknown_203B330 +_08031A1C: + movs r0, 0 + bl sub_80119D4 + movs r0, 0x3 + b _08031A28 +_08031A26: + movs r0, 0 +_08031A28: + pop {r1} + bx r1 + thumb_func_end sub_80319F8 + + thumb_func_start sub_8031A2C +sub_8031A2C: + push {lr} + bl sub_8031A84 + bl sub_8031AE8 + pop {r0} + bx r0 + thumb_func_end sub_8031A2C + + thumb_func_start sub_8031A3C +sub_8031A3C: + push {r4,r5,lr} + ldr r4, _08031A7C + ldr r2, [r4] + cmp r2, 0 + beq _08031A76 + ldr r0, [r2, 0x10] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x18 + ldr r0, _08031A80 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x18 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_08031A76: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08031A7C: .4byte gUnknown_203B330 +_08031A80: .4byte gUnknown_80E1EFC + thumb_func_end sub_8031A3C + + thumb_func_start sub_8031A84 +sub_8031A84: + push {r4,r5,lr} + ldr r4, _08031AE0 + ldr r0, [r4] + adds r0, 0x18 + bl sub_8006518 + ldr r1, [r4] + ldr r2, [r1, 0x10] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r1, 0x18 + ldr r0, _08031AE4 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldr r1, [r4] + ldrb r0, [r1, 0xC] + cmp r0, 0x2 + bne _08031AC6 + ldrb r0, [r1, 0xD] + bl sub_80969D0 + adds r1, r0, 0 + cmp r1, 0 + bne _08031ABE + movs r1, 0x1 +_08031ABE: + ldr r0, [r4] + ldr r0, [r0, 0x14] + bl sub_8012D08 +_08031AC6: + bl sub_8004914 + ldr r0, _08031AE0 + ldr r0, [r0] + adds r0, 0x18 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08031AE0: .4byte gUnknown_203B330 +_08031AE4: .4byte gUnknown_80E1F18 + thumb_func_end sub_8031A84 + + thumb_func_start sub_8031AE8 +sub_8031AE8: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xDC + ldr r7, _08031B24 + ldr r0, [r7] + ldr r0, [r0, 0x10] + bl sub_80073B8 + ldr r2, _08031B28 + ldr r0, [r7] + ldr r3, [r0, 0x10] + movs r6, 0 + str r6, [sp] + movs r0, 0xA + movs r1, 0 + bl xxx_call_draw_string + ldr r1, [r7] + ldrb r0, [r1, 0xC] + cmp r0, 0x1 + beq _08031B2C + cmp r0, 0x1 + bgt _08031B1E + b _08031CD4 +_08031B1E: + cmp r0, 0x2 + beq _08031B94 + b _08031CD4 + .align 2, 0 +_08031B24: .4byte gUnknown_203B330 +_08031B28: .4byte gUnknown_80E1F30 +_08031B2C: + add r4, sp, 0x68 + adds r0, r4, 0 + bl sub_8099394 + ldrb r0, [r4] + bl sub_8095228 + adds r5, r0, 0 + ldr r0, [r7] + ldr r3, [r0, 0x10] + movs r0, 0xA + movs r1, 0x10 + movs r2, 0x3 + bl sub_803B6B0 + ldr r1, _08031B8C + ldrb r2, [r5, 0x5] + add r0, sp, 0x4 + bl sub_800D158 + ldr r0, [r7] + ldr r3, [r0, 0x10] + str r6, [sp] + movs r0, 0x15 + movs r1, 0x10 + add r2, sp, 0x4 + bl xxx_call_draw_string + ldr r4, _08031B90 + movs r1, 0xC + ldrsh r0, [r5, r1] + bl sub_808D994 + adds r2, r0, 0 + add r0, sp, 0x4 + adds r1, r4, 0 + bl sub_800D158 + ldr r0, [r7] + ldr r3, [r0, 0x10] + str r6, [sp] + movs r0, 0x28 + movs r1, 0x10 + add r2, sp, 0x4 + bl xxx_call_draw_string + b _08031D4E + .align 2, 0 +_08031B8C: .4byte gUnknown_80E1F3C +_08031B90: .4byte gUnknown_80E1F40 +_08031B94: + ldrb r0, [r1, 0xD] + bl sub_80969D0 + adds r1, r0, 0 + cmp r1, 0 + bne _08031BB0 + ldr r2, _08031BAC + ldr r0, [r7] + ldr r3, [r0, 0x10] + str r1, [sp] + b _08031D2C + .align 2, 0 +_08031BAC: .4byte gUnknown_80E1F54 +_08031BB0: + movs r6, 0x10 + movs r2, 0 + mov r10, r2 + mov r8, r2 + ldr r0, _08031C28 + mov r9, r0 + mov r1, sp + adds r1, 0x6C + str r1, [sp, 0xD8] +_08031BC2: + mov r2, r10 + lsls r0, r2, 24 + lsrs r0, 24 + bl sub_8096AB4 + adds r4, r0, 0 + ldr r1, [r7] + ldrb r0, [r4, 0x4] + ldrb r2, [r1, 0xD] + cmp r0, r2 + bne _08031CC2 + ldrb r0, [r4] + cmp r0, 0 + beq _08031CC2 + cmp r0, 0x5 + beq _08031CC2 + cmp r0, 0x7 + beq _08031CC2 + ldr r3, [r1, 0x10] + movs r0, 0xA + adds r1, r6, 0 + movs r2, 0x3 + bl sub_803B6B0 + ldrb r0, [r4, 0x1] + add r5, sp, 0x6C + cmp r0, 0x3 + beq _08031C16 + ldrb r2, [r4, 0x5] + ldr r0, [sp, 0xD8] + ldr r1, _08031C2C + bl sub_800D158 + ldr r0, [r7] + ldr r3, [r0, 0x10] + mov r0, r8 + str r0, [sp] + movs r0, 0x15 + adds r1, r6, 0 + ldr r2, [sp, 0xD8] + bl xxx_call_draw_string +_08031C16: + ldrb r0, [r4, 0x1] + cmp r0, 0x3 + beq _08031C58 + cmp r0, 0x3 + bgt _08031C30 + cmp r0, 0x2 + beq _08031C70 + b _08031C9C + .align 2, 0 +_08031C28: .4byte gUnknown_202DE58 +_08031C2C: .4byte gUnknown_80E1F3C +_08031C30: + cmp r0, 0x4 + bne _08031C9C + ldrb r1, [r4, 0x10] + mov r0, r9 + movs r2, 0 + bl sub_8090DC4 + adds r0, r5, 0 + ldr r1, _08031C54 + mov r2, r9 + bl sub_800D158 + ldr r0, [r7] + ldr r3, [r0, 0x10] + mov r1, r8 + str r1, [sp] + b _08031C8A + .align 2, 0 +_08031C54: .4byte gUnknown_80E1F60 +_08031C58: + ldrb r1, [r4, 0x10] + mov r0, r9 + movs r2, 0 + bl sub_8090DC4 + adds r0, r5, 0 + ldr r1, _08031C6C + mov r2, r9 + b _08031C7E + .align 2, 0 +_08031C6C: .4byte gUnknown_80E1F70 +_08031C70: + movs r1, 0xE + ldrsh r0, [r4, r1] + bl sub_808D994 + adds r2, r0, 0 + adds r0, r5, 0 + ldr r1, _08031C98 +_08031C7E: + bl sub_800D158 + ldr r0, [r7] + ldr r3, [r0, 0x10] + mov r2, r8 + str r2, [sp] +_08031C8A: + movs r0, 0x28 + adds r1, r6, 0 + adds r2, r5, 0 + bl xxx_call_draw_string + b _08031CC0 + .align 2, 0 +_08031C98: .4byte gUnknown_80E1F80 +_08031C9C: + movs r1, 0xE + ldrsh r0, [r4, r1] + bl sub_808D994 + adds r2, r0, 0 + adds r0, r5, 0 + ldr r1, _08031CD0 + bl sub_800D158 + ldr r0, [r7] + ldr r3, [r0, 0x10] + mov r2, r8 + str r2, [sp] + movs r0, 0x28 + adds r1, r6, 0 + adds r2, r5, 0 + bl xxx_call_draw_string +_08031CC0: + adds r6, 0xC +_08031CC2: + movs r0, 0x1 + add r10, r0 + mov r1, r10 + cmp r1, 0x7 + bgt _08031CCE + b _08031BC2 +_08031CCE: + b _08031D4E + .align 2, 0 +_08031CD0: .4byte gUnknown_80E1F40 +_08031CD4: + add r0, sp, 0xD0 + mov r4, sp + adds r4, 0xD2 + adds r1, r4, 0 + bl sub_80992E0 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + beq _08031D04 + movs r2, 0 + ldrsh r0, [r4, r2] + bl sub_80974C4 + adds r2, r0, 0 + ldr r0, _08031D00 + ldr r0, [r0] + ldr r3, [r0, 0x10] + movs r0, 0 + str r0, [sp] + b _08031D2C + .align 2, 0 +_08031D00: .4byte gUnknown_203B330 +_08031D04: + add r4, sp, 0xD4 + adds r0, r4, 0 + bl sub_8099360 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _08031D3C + ldrb r0, [r4] + bl sub_80A2688 + lsls r0, 16 + asrs r0, 16 + bl sub_80975DC + adds r2, r0, 0 + ldr r0, _08031D38 + ldr r0, [r0] + ldr r3, [r0, 0x10] + str r5, [sp] +_08031D2C: + movs r0, 0xA + movs r1, 0x10 + bl xxx_call_draw_string + b _08031D4E + .align 2, 0 +_08031D38: .4byte gUnknown_203B330 +_08031D3C: + ldr r2, _08031D68 + ldr r0, _08031D6C + ldr r0, [r0] + ldr r3, [r0, 0x10] + str r1, [sp] + movs r0, 0xA + movs r1, 0x10 + bl xxx_call_draw_string +_08031D4E: + ldr r0, _08031D6C + ldr r0, [r0] + ldr r0, [r0, 0x10] + bl sub_80073E0 + add sp, 0xDC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08031D68: .4byte gUnknown_80E1F94 +_08031D6C: .4byte gUnknown_203B330 + thumb_func_end sub_8031AE8 + + thumb_func_start sub_8031D70 +sub_8031D70: + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + ldr r5, _08031DC4 + movs r0, 0x7C + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] + stm r0!, {r6} + bl sub_801317C + ldr r0, [r5] + str r4, [r0, 0x10] + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 3 + adds r1, 0x18 + adds r1, r0, r1 + str r1, [r0, 0x14] + adds r0, 0x18 + bl sub_8006518 + ldr r1, [r5] + ldr r2, [r1, 0x10] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r1, 0x18 + ldr r0, _08031DC8 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + bl sub_8031E00 + movs r0, 0x1 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08031DC4: .4byte gUnknown_203B334 +_08031DC8: .4byte gUnknown_80E1FC4 + thumb_func_end sub_8031D70 + + thumb_func_start sub_8031DCC +sub_8031DCC: + push {lr} + ldr r0, _08031DEC + ldr r1, [r0] + adds r0, r1, 0x4 + ldr r1, [r1, 0x10] + bl sub_8012A64 + cmp r0, 0x1 + beq _08031DF0 + cmp r0, 0x2 + bne _08031DFA + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + b _08031DFC + .align 2, 0 +_08031DEC: .4byte gUnknown_203B334 +_08031DF0: + movs r0, 0 + bl sub_80119D4 + movs r0, 0x3 + b _08031DFC +_08031DFA: + movs r0, 0 +_08031DFC: + pop {r1} + bx r1 + thumb_func_end sub_8031DCC + + thumb_func_start sub_8031E00 +sub_8031E00: + push {lr} + bl sub_8031E58 + bl sub_8031E74 + pop {r0} + bx r0 + thumb_func_end sub_8031E00 + + thumb_func_start sub_8031E10 +sub_8031E10: + push {r4,r5,lr} + ldr r4, _08031E50 + ldr r2, [r4] + cmp r2, 0 + beq _08031E4A + ldr r0, [r2, 0x10] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x18 + ldr r0, _08031E54 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x18 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_08031E4A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08031E50: .4byte gUnknown_203B334 +_08031E54: .4byte gUnknown_80E1FA8 + thumb_func_end sub_8031E10 + + thumb_func_start sub_8031E58 +sub_8031E58: + push {lr} + bl sub_8004914 + ldr r0, _08031E70 + ldr r0, [r0] + adds r0, 0x18 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r0} + bx r0 + .align 2, 0 +_08031E70: .4byte gUnknown_203B334 + thumb_func_end sub_8031E58 + + thumb_func_start sub_8031E74 +sub_8031E74: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x3C + ldr r3, _08031EC0 + ldr r5, _08031EC4 + ldr r2, [r5] + ldr r1, [r2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 4 + ldr r4, [r3] + adds r4, r0 + ldr r0, [r2, 0x10] + bl sub_80073B8 + ldr r2, _08031EC8 + ldr r0, [r5] + ldr r3, [r0, 0x10] + movs r0, 0 + str r0, [sp] + movs r0, 0x14 + movs r1, 0 + bl xxx_call_draw_string + add r0, sp, 0x4 + adds r1, r4, 0 + bl sub_803D2C0 + movs r7, 0 + mov r8, r5 +_08031EB2: + cmp r7, 0x4 + ble _08031ED0 + cmp r7, 0xC + bgt _08031ECC + movs r6, 0x6 + movs r5, 0x16 + b _08031F00 + .align 2, 0 +_08031EC0: .4byte gUnknown_203B480 +_08031EC4: .4byte gUnknown_203B334 +_08031EC8: .4byte gUnknown_80E1FDC +_08031ECC: + cmp r7, 0x11 + bgt _08031ED6 +_08031ED0: + movs r6, 0x7 + movs r5, 0x15 + b _08031F00 +_08031ED6: + cmp r7, 0x16 + ble _08031EE8 + cmp r7, 0x1E + bgt _08031EE4 + movs r6, 0x6 + movs r5, 0x25 + b _08031F00 +_08031EE4: + cmp r7, 0x23 + bgt _08031EEE +_08031EE8: + movs r6, 0x7 + movs r5, 0x24 + b _08031F00 +_08031EEE: + cmp r7, 0x28 + ble _08031EFC + cmp r7, 0x30 + bgt _08031EFC + movs r6, 0x6 + movs r5, 0x34 + b _08031F00 +_08031EFC: + movs r6, 0x7 + movs r5, 0x33 +_08031F00: + adds r0, r7, 0 + movs r1, 0x12 + bl __modsi3 + movs r1, 0xB + adds r4, r0, 0 + muls r4, r1 + adds r4, 0x6 + mov r0, sp + adds r0, r7 + adds r0, 0x4 + ldrb r2, [r0] + mov r1, r8 + ldr r0, [r1] + ldr r0, [r0, 0x10] + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + adds r3, r6, 0 + bl sub_8012C60 + mov r1, r8 + ldr r0, [r1] + ldr r0, [r0, 0x10] + adds r2, r5, 0 + adds r2, 0xA + movs r1, 0x5 + str r1, [sp] + adds r1, r4, 0 + movs r3, 0xA + bl sub_80078A4 + adds r7, 0x1 + cmp r7, 0x35 + ble _08031EB2 + ldr r0, _08031F5C + ldr r0, [r0] + ldr r0, [r0, 0x10] + bl sub_80073E0 + add sp, 0x3C + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08031F5C: .4byte gUnknown_203B334 + thumb_func_end sub_8031E74 + + thumb_func_start sub_8031F60 +sub_8031F60: + push {r4-r6,lr} + adds r5, r0, 0 + ldr r4, _08031FD0 + movs r0, 0xA0 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r4] + str r5, [r0, 0x34] + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 3 + adds r1, 0x3C + adds r1, r0, r1 + str r1, [r0, 0x38] + adds r0, 0x3C + bl sub_8006518 + ldr r1, [r4] + ldr r2, [r1, 0x34] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r1, 0x3C + ldr r0, _08031FD4 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldr r0, [r4] + ldr r1, [r0, 0x38] + adds r0, 0x9C + str r0, [r1, 0x14] + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x3C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + movs r1, 0x20 + movs r2, 0x8 + adds r3, r5, 0 + bl sub_8013818 + bl sub_8032084 + bl sub_80320F8 + movs r0, 0x1 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08031FD0: .4byte gUnknown_203B338 +_08031FD4: .4byte gUnknown_80E2008 + thumb_func_end sub_8031F60 + + thumb_func_start sub_8031FD8 +sub_8031FD8: + push {r4,lr} + lsls r0, 24 + cmp r0, 0 + bne _08031FF0 + ldr r0, _08031FEC + ldr r0, [r0] + bl sub_8013660 + movs r0, 0 + b _08032034 + .align 2, 0 +_08031FEC: .4byte gUnknown_203B338 +_08031FF0: + ldr r4, _0803200C + ldr r0, [r4] + bl GetKeyPress + cmp r0, 0x1 + beq _08032010 + cmp r0, 0x2 + bne _0803201A + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + b _08032034 + .align 2, 0 +_0803200C: .4byte gUnknown_203B338 +_08032010: + movs r0, 0 + bl sub_80119D4 + movs r0, 0x3 + b _08032034 +_0803201A: + ldr r0, [r4] + bl sub_8013938 + lsls r0, 24 + cmp r0, 0 + bne _0803202A + movs r0, 0 + b _08032034 +_0803202A: + bl sub_8032084 + bl sub_80320F8 + movs r0, 0x1 +_08032034: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8031FD8 + + thumb_func_start sub_803203C +sub_803203C: + push {r4,r5,lr} + ldr r4, _0803207C + ldr r2, [r4] + cmp r2, 0 + beq _08032076 + ldr r0, [r2, 0x34] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x3C + ldr r0, _08032080 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x3C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_08032076: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0803207C: .4byte gUnknown_203B338 +_08032080: .4byte gUnknown_80E1FF0 + thumb_func_end sub_803203C + + thumb_func_start sub_8032084 +sub_8032084: + push {r4,lr} + ldr r4, _080320F4 + ldr r0, [r4] + ldrh r1, [r0, 0x20] + adds r0, 0x9C + movs r2, 0 + strb r1, [r0] + ldr r0, [r4] + ldrh r1, [r0, 0x1E] + adds r0, 0x9D + strb r1, [r0] + ldr r0, [r4] + adds r0, 0x9E + movs r1, 0xB + strb r1, [r0] + ldr r0, [r4] + adds r0, 0x9F + strb r2, [r0] + ldr r0, [r4] + movs r1, 0x1A + ldrsh r0, [r0, r1] + movs r1, 0xC + bl sub_80095E4 + adds r0, 0x2 + lsls r0, 16 + ldr r2, [r4] + ldr r3, [r2, 0x34] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x4A + asrs r3, r0, 16 + lsrs r0, 16 + strh r0, [r1] + ldr r1, [r2, 0x34] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r2, r0 + adds r3, 0x2 + adds r2, 0x4C + strh r3, [r2] + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x3C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080320F4: .4byte gUnknown_203B338 + thumb_func_end sub_8032084 + + thumb_func_start sub_80320F8 +sub_80320F8: + push {r4-r7,lr} + sub sp, 0x8 + ldr r5, _08032158 + ldr r0, [r5] + ldr r0, [r0, 0x34] + bl sub_8008C54 + ldr r0, [r5] + ldr r0, [r0, 0x34] + bl sub_80073B8 + ldr r0, [r5] + movs r1, 0x1E + ldrsh r4, [r0, r1] + lsls r4, 3 + adds r6, r4, 0 + adds r6, 0xA + ldr r2, _0803215C + ldr r3, [r0, 0x34] + movs r0, 0 + str r0, [sp] + adds r0, r6, 0 + movs r1, 0 + bl xxx_call_draw_string + adds r4, 0x4 + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0x9E + ldrb r0, [r0] + lsls r0, 3 + adds r6, r4, r0 + movs r0, 0x1E + ldrsh r2, [r1, r0] + adds r2, 0x1 + movs r0, 0x7 + str r0, [sp] + ldr r0, [r1, 0x34] + str r0, [sp, 0x4] + adds r0, r6, 0 + movs r1, 0 + movs r3, 0x1 + bl sub_8012BC4 + movs r7, 0 + ldr r0, [r5] + b _0803223A + .align 2, 0 +_08032158: .4byte gUnknown_203B338 +_0803215C: .4byte gUnknown_80E2020 +_08032160: + ldr r5, _08032194 + ldr r0, [r5] + movs r2, 0x1E + ldrsh r1, [r0, r2] + movs r2, 0x1C + ldrsh r0, [r0, r2] + muls r0, r1 + adds r0, r7 + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r6, 0 + bl sub_8097710 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _0803221C + subs r0, r6, 0x7 + cmp r0, 0x5 + bhi _080321EC + lsls r0, 2 + ldr r1, _08032198 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08032194: .4byte gUnknown_203B338 +_08032198: .4byte _0803219C + .align 2, 0 +_0803219C: + .4byte _080321BA + .4byte _080321C6 + .4byte _080321D4 + .4byte _080321E0 + .4byte _080321C0 + .4byte _080321B4 +_080321B4: + bl sub_80978B8 + b _080321E4 +_080321BA: + bl sub_8097880 + b _080321E4 +_080321C0: + bl sub_8097838 + b _080321E4 +_080321C6: + bl sub_80977B8 + ldr r1, _080321D0 + b _080321EA + .align 2, 0 +_080321D0: .4byte gUnknown_202DE30 +_080321D4: + bl sub_80977F8 + ldr r1, _080321DC + b _080321EA + .align 2, 0 +_080321DC: .4byte gUnknown_202DE30 +_080321E0: + bl sub_8097870 +_080321E4: + ldr r1, _08032214 + lsls r0, 16 + asrs r0, 16 +_080321EA: + str r0, [r1] +_080321EC: + ldr r4, _08032218 + ldr r0, [r4] + adds r1, r7, 0 + bl sub_8013800 + adds r5, r0, 0 + adds r0, r6, 0 + bl sub_8097738 + adds r2, r0, 0 + ldr r0, [r4] + ldr r3, [r0, 0x34] + movs r0, 0 + str r0, [sp] + movs r0, 0x8 + adds r1, r5, 0 + bl sub_8014FF0 + b _08032234 + .align 2, 0 +_08032214: .4byte gUnknown_202DE30 +_08032218: .4byte gUnknown_203B338 +_0803221C: + ldr r0, [r5] + adds r1, r7, 0 + bl sub_8013800 + adds r1, r0, 0 + ldr r2, _08032254 + ldr r0, [r5] + ldr r3, [r0, 0x34] + str r4, [sp] + movs r0, 0x8 + bl xxx_call_draw_string +_08032234: + adds r7, 0x1 + ldr r0, _08032258 + ldr r0, [r0] +_0803223A: + movs r1, 0x1A + ldrsh r0, [r0, r1] + cmp r7, r0 + blt _08032160 + ldr r0, _08032258 + ldr r0, [r0] + ldr r0, [r0, 0x34] + bl sub_80073E0 + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08032254: .4byte gUnknown_80E2030 +_08032258: .4byte gUnknown_203B338 + thumb_func_end sub_80320F8 + + thumb_func_start sub_803225C +sub_803225C: + push {r4,r5,lr} + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r5, _08032300 + movs r4, 0xAD + lsls r4, 3 + adds r0, r4, 0 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] + movs r1, 0 + adds r2, r4, 0 + bl MemoryFill8 + ldr r1, [r5] + movs r0, 0xA6 + lsls r0, 3 + adds r2, r1, r0 + movs r0, 0 + str r0, [r2] + movs r2, 0x86 + lsls r2, 2 + adds r1, r2 + movs r0, 0xFF + strb r0, [r1] + ldr r0, [r5] + movs r1, 0xA7 + lsls r1, 3 + adds r0, r1 + ldr r1, _08032304 + strh r1, [r0] + ldr r0, _08032308 + movs r4, 0x98 + lsls r4, 1 + adds r1, r4, 0 + bl sub_808D8E0 + adds r0, r4, 0 + bl sub_808D994 + adds r1, r0, 0 + ldr r0, _0803230C + bl strcpy + movs r1, 0 + movs r2, 0 + adds r4, r5, 0 +_080322C6: + ldr r0, [r5] + adds r0, 0x8 + adds r0, r1 + strb r2, [r0] + adds r1, 0x1 + cmp r1, 0x35 + ble _080322C6 + ldr r1, [r4] + movs r0, 0x7E + str r0, [r1, 0x4] + bl sub_8039880 + ldr r1, [r4] + ldr r2, _08032310 + adds r1, r2 + strb r0, [r1] + ldr r0, [r4] + adds r2, r0, r2 + ldrb r1, [r2] + ldr r2, _08032314 + adds r0, r2 + strb r1, [r0] + movs r0, 0 + bl sub_80338C4 + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08032300: .4byte gUnknown_203B33C +_08032304: .4byte 0x0000ffff +_08032308: .4byte gUnknown_202E5D8 +_0803230C: .4byte gUnknown_202DF98 +_08032310: .4byte 0x0000052c +_08032314: .4byte 0x0000052d + thumb_func_end sub_803225C + + thumb_func_start sub_8032318 +sub_8032318: + push {lr} + ldr r0, _08032330 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0x7D + bls _08032326 + b _080327DC +_08032326: + lsls r0, 2 + ldr r1, _08032334 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08032330: .4byte gUnknown_203B33C +_08032334: .4byte _08032338 + .align 2, 0 +_08032338: + .4byte _080326A6 + .4byte _080326A6 + .4byte _080326AC + .4byte _0803255A + .4byte _0803255A + .4byte _0803266C + .4byte _08032672 + .4byte _08032678 + .4byte _0803267E + .4byte _08032684 + .4byte _0803268A + .4byte _08032690 + .4byte _08032690 + .4byte _08032698 + .4byte _080326A0 + .4byte _080327CE + .4byte _080327CE + .4byte _0803262C + .4byte _08032634 + .4byte _0803263A + .4byte _08032640 + .4byte _08032646 + .4byte _0803264C + .4byte _08032652 + .4byte _08032764 + .4byte _08032658 + .4byte _08032660 + .4byte _08032666 + .4byte _08032612 + .4byte _08032626 + .4byte _0803261A + .4byte _08032620 + .4byte _0803260C + .4byte _080325CE + .4byte _080327CE + .4byte _080325C6 + .4byte _080325BA + .4byte _080325A0 + .4byte _080325A8 + .4byte _080325AE + .4byte _080325B4 + .4byte _080325C0 + .4byte _0803258C + .4byte _0803259A + .4byte _08032594 + .4byte _0803257E + .4byte _08032586 + .4byte _08032764 + .4byte _080327CE + .4byte _080325D4 + .4byte _080325DC + .4byte _080325E2 + .4byte _080325E8 + .4byte _080325EE + .4byte _080327DC + .4byte _080325FA + .4byte _080325F4 + .4byte _08032600 + .4byte _08032606 + .4byte _08032764 + .4byte _080327CE + .4byte _08032560 + .4byte _08032566 + .4byte _0803256C + .4byte _08032572 + .4byte _08032578 + .4byte _08032764 + .4byte _08032658 + .4byte _080327CE + .4byte _080327CE + .4byte _08032794 + .4byte _0803279C + .4byte _080327A2 + .4byte _080327A8 + .4byte _080327AE + .4byte _080327B4 + .4byte _080327BA + .4byte _080327C0 + .4byte _080327C0 + .4byte _080327C8 + .4byte _08032722 + .4byte _080327D6 + .4byte _0803278E + .4byte _08032780 + .4byte _08032788 + .4byte _0803277A + .4byte _08032774 + .4byte _0803276C + .4byte _08032752 + .4byte _08032764 + .4byte _080326BC + .4byte _080326C2 + .4byte _080326D6 + .4byte _080326CA + .4byte _080326D0 + .4byte _080326DC + .4byte _080326E2 + .4byte _080326E8 + .4byte _08032730 + .4byte _08032744 + .4byte _0803273E + .4byte _08032738 + .4byte _080326F4 + .4byte _080326FC + .4byte _080326EE + .4byte _0803274C + .4byte _080326B0 + .4byte _080326B6 + .4byte _08032764 + .4byte _08032722 + .4byte _0803272A + .4byte _08032744 + .4byte _0803271C + .4byte _08032716 + .4byte _08032708 + .4byte _08032710 + .4byte _08032702 + .4byte _08032758 + .4byte _0803275E + .4byte _08032764 + .4byte _08032530 + .4byte _08032536 + .4byte _0803253E + .4byte _08032544 + .4byte _0803254C + .4byte _08032552 +_08032530: + bl sub_8035300 + b _080327DC +_08032536: + movs r0, 0x78 + bl sub_8035404 + b _080327DC +_0803253E: + bl sub_8035374 + b _080327DC +_08032544: + movs r0, 0x7A + bl sub_8035404 + b _080327DC +_0803254C: + bl sub_80353BC + b _080327DC +_08032552: + movs r0, 0x7C + bl sub_8035404 + b _080327DC +_0803255A: + bl sub_8033A2C + b _080327DC +_08032560: + bl sub_803477C + b _080327DC +_08032566: + bl sub_80347AC + b _080327DC +_0803256C: + bl sub_80347C8 + b _080327DC +_08032572: + bl sub_80347E4 + b _080327DC +_08032578: + bl sub_8034804 + b _080327DC +_0803257E: + movs r0, 0x2E + bl sub_8035404 + b _080327DC +_08032586: + bl sub_80344C0 + b _080327DC +_0803258C: + movs r0, 0xD + bl sub_8035404 + b _080327DC +_08032594: + bl sub_8034478 + b _080327DC +_0803259A: + bl sub_80344A0 + b _080327DC +_080325A0: + movs r0, 0x26 + bl sub_8035404 + b _080327DC +_080325A8: + bl sub_803418C + b _080327DC +_080325AE: + bl sub_8034254 + b _080327DC +_080325B4: + bl sub_8034310 + b _080327DC +_080325BA: + bl sub_8034378 + b _080327DC +_080325C0: + bl sub_80343C4 + b _080327DC +_080325C6: + movs r0, 0x21 + bl sub_8035404 + b _080327DC +_080325CE: + bl sub_8034404 + b _080327DC +_080325D4: + movs r0, 0x32 + bl sub_8035404 + b _080327DC +_080325DC: + bl sub_8034500 + b _080327DC +_080325E2: + bl sub_8034590 + b _080327DC +_080325E8: + bl sub_803464C + b _080327DC +_080325EE: + bl sub_80346A8 + b _080327DC +_080325F4: + bl sub_80346D8 + b _080327DC +_080325FA: + bl sub_8034700 + b _080327DC +_08032600: + bl sub_8034720 + b _080327DC +_08032606: + bl sub_803473C + b _080327DC +_0803260C: + bl sub_8033FB4 + b _080327DC +_08032612: + movs r0, 0x1D + bl sub_8035404 + b _080327DC +_0803261A: + bl sub_8034074 + b _080327DC +_08032620: + bl sub_8034130 + b _080327DC +_08032626: + bl sub_8033FE4 + b _080327DC +_0803262C: + movs r0, 0x12 + bl sub_8035404 + b _080327DC +_08032634: + bl nullsub_42 + b _080327DC +_0803263A: + bl nullsub_43 + b _080327DC +_08032640: + bl nullsub_44 + b _080327DC +_08032646: + bl nullsub_45 + b _080327DC +_0803264C: + bl sub_8033D74 + b _080327DC +_08032652: + bl sub_8033D94 + b _080327DC +_08032658: + movs r0, 0x1A + bl sub_8035404 + b _080327DC +_08032660: + bl sub_8033DBC + b _080327DC +_08032666: + bl sub_8033F64 + b _080327DC +_0803266C: + bl sub_8033C54 + b _080327DC +_08032672: + bl nullsub_41 + b _080327DC +_08032678: + bl sub_8033CAC + b _080327DC +_0803267E: + bl sub_8033D48 + b _080327DC +_08032684: + bl sub_8035424 + b _080327DC +_0803268A: + bl nullsub_50 + b _080327DC +_08032690: + movs r0, 0x6 + bl sub_8035404 + b _080327DC +_08032698: + movs r0, 0x7 + bl sub_8035404 + b _080327DC +_080326A0: + bl sub_8033B8C + b _080327DC +_080326A6: + bl sub_80339C8 + b _080327DC +_080326AC: + movs r0, 0x3 + b _080327DE +_080326B0: + bl sub_80348C4 + b _080327DC +_080326B6: + bl sub_803482C + b _080327DC +_080326BC: + bl sub_80349B0 + b _080327DC +_080326C2: + movs r0, 0x5C + bl sub_8035404 + b _080327DC +_080326CA: + bl sub_8034A70 + b _080327DC +_080326D0: + bl sub_8034B2C + b _080327DC +_080326D6: + bl sub_80349E0 + b _080327DC +_080326DC: + bl sub_8034B88 + b _080327DC +_080326E2: + bl sub_8034C98 + b _080327DC +_080326E8: + bl sub_8034C38 + b _080327DC +_080326EE: + bl sub_8034D54 + b _080327DC +_080326F4: + movs r0, 0x67 + bl sub_8035404 + b _080327DC +_080326FC: + bl sub_8034970 + b _080327DC +_08032702: + bl sub_80351E0 + b _080327DC +_08032708: + movs r0, 0x73 + bl sub_8035404 + b _080327DC +_08032710: + bl sub_8034D74 + b _080327DC +_08032716: + bl sub_8034EF0 + b _080327DC +_0803271C: + bl sub_8034F38 + b _080327DC +_08032722: + movs r0, 0x6E + bl sub_8035404 + b _080327DC +_0803272A: + bl sub_80352A4 + b _080327DC +_08032730: + movs r0, 0x6A + bl sub_8035404 + b _080327DC +_08032738: + bl sub_8034EC8 + b _080327DC +_0803273E: + bl sub_8034F18 + b _080327DC +_08032744: + movs r0, 0x62 + bl sub_8035404 + b _080327DC +_0803274C: + bl sub_8034F58 + b _080327DC +_08032752: + bl sub_8034F88 + b _080327DC +_08032758: + bl sub_8035018 + b _080327DC +_0803275E: + bl sub_8035038 + b _080327DC +_08032764: + movs r0, 0x2 + bl sub_8035404 + b _080327DC +_0803276C: + movs r0, 0x5F + bl sub_8035404 + b _080327DC +_08032774: + bl sub_8035094 + b _080327DC +_0803277A: + bl sub_80350F4 + b _080327DC +_08032780: + movs r0, 0x54 + bl sub_8035404 + b _080327DC +_08032788: + bl sub_803517C + b _080327DC +_0803278E: + bl sub_8035210 + b _080327DC +_08032794: + movs r0, 0x47 + bl sub_8035404 + b _080327DC +_0803279C: + bl nullsub_46 + b _080327DC +_080327A2: + bl nullsub_47 + b _080327DC +_080327A8: + bl nullsub_48 + b _080327DC +_080327AE: + bl nullsub_49 + b _080327DC +_080327B4: + bl sub_8035430 + b _080327DC +_080327BA: + bl nullsub_51 + b _080327DC +_080327C0: + movs r0, 0x4F + bl sub_8035404 + b _080327DC +_080327C8: + bl sub_8034848 + b _080327DC +_080327CE: + movs r0, 0x1 + bl sub_8035404 + b _080327DC +_080327D6: + movs r0, 0x1 + bl sub_8035404 +_080327DC: + movs r0, 0 +_080327DE: + pop {r1} + bx r1 + thumb_func_end sub_8032318 + + thumb_func_start sub_80327E4 +sub_80327E4: + push {r4,lr} + ldr r4, _08032820 + ldr r0, [r4] + cmp r0, 0 + beq _0803281A + bl MemoryFree + movs r0, 0 + str r0, [r4] + bl sub_803084C + bl sub_8031E10 + bl sub_8023C60 + bl sub_80155F0 + bl sub_801CBB8 + bl sub_802F2C0 + bl sub_8030DE4 + bl sub_802453C + bl sub_801B450 +_0803281A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08032820: .4byte gUnknown_203B33C + thumb_func_end sub_80327E4 + + thumb_func_start nullsub_40 +nullsub_40: + bx lr + thumb_func_end nullsub_40 + + thumb_func_start sub_8032828 +sub_8032828: + push {r4-r6,lr} + sub sp, 0x68 + ldr r1, _08032848 + ldr r0, [r1] + ldr r0, [r0] + adds r6, r1, 0 + cmp r0, 0x7D + bls _0803283C + bl _080338B4 +_0803283C: + lsls r0, 2 + ldr r1, _0803284C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08032848: .4byte gUnknown_203B33C +_0803284C: .4byte _08032850 + .align 2, 0 +_08032850: + .4byte _08032A48 + .4byte _08032AD0 + .4byte _080338B4 + .4byte _08032B80 + .4byte _08032BC4 + .4byte _08032FD0 + .4byte _080338B4 + .4byte _08032FF0 + .4byte _080338B4 + .4byte _080338B4 + .4byte _08032FD8 + .4byte _08032FE0 + .4byte _08032FE8 + .4byte _0803356C + .4byte _08032C50 + .4byte _08033200 + .4byte _080331CC + .4byte _080331D4 + .4byte _080331DC + .4byte _080336B2 + .4byte _080338B4 + .4byte _080331F8 + .4byte _08033208 + .4byte _080338B4 + .4byte _08033234 + .4byte _0803323C + .4byte _08033244 + .4byte _080338B4 + .4byte _08032F8C + .4byte _08032F98 + .4byte _080336B2 + .4byte _080338B4 + .4byte _08032FB6 + .4byte _08032EB8 + .4byte _08032FC4 + .4byte _08032EAC + .4byte _08032F54 + .4byte _08032EE0 + .4byte _08032EEC + .4byte _08032F16 + .4byte _080338B4 + .4byte _08032F7C + .4byte _08032E60 + .4byte _08032E6C + .4byte _08032EA0 + .4byte _08032E48 + .4byte _0803341C + .4byte _08032E54 + .4byte _08032D84 + .4byte _08032D90 + .4byte _08032D9C + .4byte _080336B2 + .4byte _080338B4 + .4byte _08032DBC + .4byte _080338B4 + .4byte _08032DCC + .4byte _08032E00 + .4byte _08032E3C + .4byte _08032E0C + .4byte _08032E30 + .4byte _08032D04 + .4byte _08032D10 + .4byte _08032D2C + .4byte _08032D38 + .4byte _08032D44 + .4byte _080338B4 + .4byte _08032D78 + .4byte _08032D20 + .4byte _08033720 + .4byte _08033728 + .4byte _08033684 + .4byte _0803368C + .4byte _080336B2 + .4byte _080338B4 + .4byte _080336F8 + .4byte _080338B4 + .4byte _08032FD8 + .4byte _08032FE0 + .4byte _08032FE8 + .4byte _080338B4 + .4byte _08033468 + .4byte _08033730 + .4byte _08033738 + .4byte _0803366C + .4byte _08033674 + .4byte _08033644 + .4byte _0803361C + .4byte _08033614 + .4byte _080335F4 + .4byte _080335C0 + .4byte _0803324E + .4byte _0803325C + .4byte _0803368C + .4byte _08033264 + .4byte _080338B4 + .4byte _08033288 + .4byte _080332B8 + .4byte _080338B4 + .4byte _0803356C + .4byte _080335B0 + .4byte _08033584 + .4byte _080338B4 + .4byte _08033412 + .4byte _0803341C + .4byte _08033448 + .4byte _080335B8 + .4byte _080332F4 + .4byte _080338B4 + .4byte _08033460 + .4byte _08033470 + .4byte _0803349C + .4byte _08033450 + .4byte _08033458 + .4byte _080338B4 + .4byte _080333E4 + .4byte _080333EC + .4byte _080338B4 + .4byte _08033604 + .4byte _0803360C + .4byte _080338B4 + .4byte _0803384C + .4byte _0803387C + .4byte _080337D4 + .4byte _080337F0 + .4byte _08033770 + .4byte _0803378C +_08032A48: + movs r0, 0x1 + bl sub_8095324 + cmp r0, 0 + bne _08032A9C + movs r0, 0x5 + bl sub_8095324 + adds r4, r0, 0 + cmp r4, 0 + bne _08032A9C + ldr r0, _08032A7C + ldr r0, [r0] + ldr r1, _08032A80 + adds r0, r1 + ldrb r2, [r0] + cmp r2, 0 + beq _08032A8C + ldr r0, _08032A84 + ldr r3, _08032A88 + str r4, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r4, [sp, 0x8] + str r4, [sp, 0xC] + b _08032B66 + .align 2, 0 +_08032A7C: .4byte gUnknown_203B33C +_08032A80: .4byte 0x0000052c +_08032A84: .4byte gUnknown_80E25F4 +_08032A88: .4byte gUnknown_80E2108 +_08032A8C: + ldr r0, _08032A94 + ldr r3, _08032A98 + b _08032B5C + .align 2, 0 +_08032A94: .4byte gUnknown_80E25F4 +_08032A98: .4byte gUnknown_80E20B8 +_08032A9C: + ldr r0, _08032AC0 + ldr r0, [r0] + ldr r2, _08032AC4 + adds r0, r2 + ldrb r2, [r0] + cmp r2, 0 + beq _08032B58 + ldr r0, _08032AC8 + ldr r3, _08032ACC + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + str r2, [sp, 0xC] + bl _08033864 + .align 2, 0 +_08032AC0: .4byte gUnknown_203B33C +_08032AC4: .4byte 0x0000052c +_08032AC8: .4byte gUnknown_80E25F4 +_08032ACC: .4byte gUnknown_80E20E0 +_08032AD0: + movs r0, 0x1 + bl sub_8095324 + cmp r0, 0 + bne _08032B24 + movs r0, 0x5 + bl sub_8095324 + adds r4, r0, 0 + cmp r4, 0 + bne _08032B24 + ldr r0, _08032B04 + ldr r0, [r0] + ldr r3, _08032B08 + adds r0, r3 + ldrb r2, [r0] + cmp r2, 0 + beq _08032B14 + ldr r0, _08032B0C + ldr r3, _08032B10 + str r4, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r4, [sp, 0x8] + str r4, [sp, 0xC] + b _08032B66 + .align 2, 0 +_08032B04: .4byte gUnknown_203B33C +_08032B08: .4byte 0x0000052c +_08032B0C: .4byte gUnknown_80E25F4 +_08032B10: .4byte gUnknown_80E2108 +_08032B14: + ldr r0, _08032B1C + ldr r3, _08032B20 + b _08032B5C + .align 2, 0 +_08032B1C: .4byte gUnknown_80E25F4 +_08032B20: .4byte gUnknown_80E20B8 +_08032B24: + ldr r0, _08032B48 + ldr r0, [r0] + ldr r4, _08032B4C + adds r0, r4 + ldrb r2, [r0] + cmp r2, 0 + beq _08032B58 + ldr r0, _08032B50 + ldr r3, _08032B54 + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + str r2, [sp, 0xC] + bl _08033864 + .align 2, 0 +_08032B48: .4byte gUnknown_203B33C +_08032B4C: .4byte 0x0000052c +_08032B50: .4byte gUnknown_80E25F4 +_08032B54: .4byte gUnknown_80E20E0 +_08032B58: + ldr r0, _08032B78 + ldr r3, _08032B7C +_08032B5C: + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + str r2, [sp, 0xC] +_08032B66: + adds r1, 0xFD + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0 + bl sub_8014248 + bl _080338B4 + .align 2, 0 +_08032B78: .4byte gUnknown_80E25F4 +_08032B7C: .4byte gUnknown_80E2068 +_08032B80: + movs r0, 0x4 + bl sub_8095324 + adds r2, r0, 0 + cmp r2, 0 + beq _08032B9C + ldr r0, _08032B94 + ldr r3, _08032B98 + movs r2, 0 + b _08032BA0 + .align 2, 0 +_08032B94: .4byte gUnknown_80E25F4 +_08032B98: .4byte gUnknown_80E2130 +_08032B9C: + ldr r0, _08032BBC + ldr r3, _08032BC0 +_08032BA0: + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + str r2, [sp, 0xC] + adds r1, 0xFD + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0x3 + bl sub_8014248 + bl _080338B4 + .align 2, 0 +_08032BBC: .4byte gUnknown_80E25F4 +_08032BC0: .4byte gUnknown_80E2190 +_08032BC4: + movs r0, 0x1 + bl sub_8095324 + adds r4, r0, 0 + cmp r4, 0 + bne _08032C0C + movs r0, 0x5 + bl sub_8095324 + cmp r0, 0 + bne _08032BF4 + ldr r0, _08032BEC + ldr r3, _08032BF0 + str r4, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r4, [sp, 0x8] + str r4, [sp, 0xC] + b _08032C38 + .align 2, 0 +_08032BEC: .4byte gUnknown_80E25F4 +_08032BF0: .4byte gUnknown_80E2268 +_08032BF4: + ldr r0, _08032C04 + ldr r3, _08032C08 + str r4, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r4, [sp, 0x8] + str r4, [sp, 0xC] + b _08032C38 + .align 2, 0 +_08032C04: .4byte gUnknown_80E25F4 +_08032C08: .4byte gUnknown_80E2218 +_08032C0C: + movs r0, 0x5 + bl sub_8095324 + adds r2, r0, 0 + cmp r2, 0 + bne _08032C28 + ldr r0, _08032C20 + ldr r3, _08032C24 + b _08032C2E + .align 2, 0 +_08032C20: .4byte gUnknown_80E25F4 +_08032C24: .4byte gUnknown_80E2240 +_08032C28: + ldr r0, _08032C48 + ldr r3, _08032C4C + movs r2, 0 +_08032C2E: + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + str r2, [sp, 0xC] +_08032C38: + adds r1, 0xFD + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0x11 + bl sub_8014248 + bl _080338B4 + .align 2, 0 +_08032C48: .4byte gUnknown_80E25F4 +_08032C4C: .4byte gUnknown_80E21B8 +_08032C50: + ldr r0, [r6] + movs r5, 0xA5 + lsls r5, 3 + adds r0, r5 + ldr r0, [r0] + subs r0, 0x3 + cmp r0, 0x11 + bls _08032C64 + bl _080338B4 +_08032C64: + lsls r0, 2 + ldr r1, _08032C70 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08032C70: .4byte _08032C74 + .align 2, 0 +_08032C74: + .4byte _08032CC8 + .4byte _08032CD4 + .4byte _080338B4 + .4byte _080338B4 + .4byte _080338B4 + .4byte _080338B4 + .4byte _080338B4 + .4byte _080338B4 + .4byte _080338B4 + .4byte _080338B4 + .4byte _080338B4 + .4byte _080338B4 + .4byte _080338B4 + .4byte _080338B4 + .4byte _08032CBC + .4byte _08032CE0 + .4byte _08032CEC + .4byte _08032CF8 +_08032CBC: + ldr r0, _08032CC4 + bl _0803374A + .align 2, 0 +_08032CC4: .4byte gUnknown_80E2610 +_08032CC8: + ldr r0, _08032CD0 + bl _0803374A + .align 2, 0 +_08032CD0: .4byte gUnknown_80E2640 +_08032CD4: + ldr r0, _08032CDC + bl _0803374A + .align 2, 0 +_08032CDC: .4byte gUnknown_80E2680 +_08032CE0: + ldr r0, _08032CE8 + bl _0803374A + .align 2, 0 +_08032CE8: .4byte gUnknown_80E26B0 +_08032CEC: + ldr r0, _08032CF4 + bl _0803374A + .align 2, 0 +_08032CF4: .4byte gUnknown_80E26F0 +_08032CF8: + ldr r0, _08032D00 + bl _0803374A + .align 2, 0 +_08032D00: .4byte gUnknown_80E2728 +_08032D04: + ldr r0, _08032D0C + bl _0803388E + .align 2, 0 +_08032D0C: .4byte gUnknown_80E276C +_08032D10: + ldr r0, _08032D18 + ldr r3, _08032D1C + bl _080336FC + .align 2, 0 +_08032D18: .4byte gUnknown_80E27A4 +_08032D1C: .4byte gUnknown_80E2458 +_08032D20: + ldr r0, _08032D28 + bl _0803388E + .align 2, 0 +_08032D28: .4byte gUnknown_80E2814 +_08032D2C: + ldr r0, _08032D34 + bl _0803388E + .align 2, 0 +_08032D34: .4byte gUnknown_80E2840 +_08032D38: + ldr r0, _08032D40 + bl _0803388E + .align 2, 0 +_08032D40: .4byte gUnknown_80E2874 +_08032D44: + ldr r0, [r6] + ldr r1, _08032D60 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0xC + bne _08032D54 + bl _080338B4 +_08032D54: + cmp r0, 0xC + bhi _08032D64 + cmp r0, 0xB + beq _08032D6C + bl _080338B4 + .align 2, 0 +_08032D60: .4byte 0x00000524 +_08032D64: + cmp r0, 0xE + bls _08032D6C + bl _080338B4 +_08032D6C: + ldr r0, _08032D74 + bl _0803388E + .align 2, 0 +_08032D74: .4byte gUnknown_80E2898 +_08032D78: + ldr r0, _08032D80 + bl _0803388E + .align 2, 0 +_08032D80: .4byte gUnknown_80E28D8 +_08032D84: + ldr r0, _08032D8C + bl _0803388E + .align 2, 0 +_08032D8C: .4byte gUnknown_80E2904 +_08032D90: + ldr r0, _08032D98 + bl _0803388E + .align 2, 0 +_08032D98: .4byte gUnknown_80E296C +_08032D9C: + bl sub_8030894 + cmp r0, 0 + beq _08032DA8 + bl _080338B4 +_08032DA8: + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0x1 + bl _080336A6 +_08032DBC: + ldr r0, _08032DC4 + ldr r3, _08032DC8 + bl _080336FC + .align 2, 0 +_08032DC4: .4byte gUnknown_80E29A0 +_08032DC8: .4byte gUnknown_80E22B4 +_08032DCC: + ldr r0, [r6] + ldr r2, _08032DE8 + adds r0, r2 + ldr r0, [r0] + cmp r0, 0xC + bne _08032DDC + bl _080338B4 +_08032DDC: + cmp r0, 0xC + bhi _08032DEC + cmp r0, 0xB + beq _08032DF4 + bl _080338B4 + .align 2, 0 +_08032DE8: .4byte 0x00000524 +_08032DEC: + cmp r0, 0xE + bls _08032DF4 + bl _080338B4 +_08032DF4: + ldr r0, _08032DFC + bl _0803388E + .align 2, 0 +_08032DFC: .4byte gUnknown_80E29D0 +_08032E00: + ldr r0, _08032E08 + bl _0803388E + .align 2, 0 +_08032E08: .4byte gUnknown_80E2A0C +_08032E0C: + ldr r0, [r6] + movs r3, 0xEF + lsls r3, 2 + adds r0, r3 + bl sub_8006518 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r6] + movs r4, 0x86 + lsls r4, 2 + adds r0, r4 + b _0803343E +_08032E30: + ldr r0, _08032E38 + bl _0803388E + .align 2, 0 +_08032E38: .4byte gUnknown_80E2A1C +_08032E3C: + ldr r0, _08032E44 + bl _0803388E + .align 2, 0 +_08032E44: .4byte gUnknown_80E2A5C +_08032E48: + ldr r0, _08032E50 + bl _0803388E + .align 2, 0 +_08032E50: .4byte gUnknown_80E2A80 +_08032E54: + ldr r0, _08032E5C + bl _0803388E + .align 2, 0 +_08032E5C: .4byte gUnknown_80E2AA8 +_08032E60: + ldr r0, _08032E68 + bl _0803388E + .align 2, 0 +_08032E68: .4byte gUnknown_80E2AE4 +_08032E6C: + ldr r0, [r6] + ldr r2, _08032E88 + adds r0, r2 + ldr r0, [r0] + cmp r0, 0xC + bne _08032E7C + bl _080338B4 +_08032E7C: + cmp r0, 0xC + bhi _08032E8C + cmp r0, 0xB + beq _08032E94 + bl _080338B4 + .align 2, 0 +_08032E88: .4byte 0x00000524 +_08032E8C: + cmp r0, 0xE + bls _08032E94 + bl _080338B4 +_08032E94: + ldr r0, _08032E9C + bl _0803388E + .align 2, 0 +_08032E9C: .4byte gUnknown_80E2B54 +_08032EA0: + ldr r0, _08032EA8 + bl _0803388E + .align 2, 0 +_08032EA8: .4byte gUnknown_80E2A0C +_08032EAC: + ldr r0, _08032EB4 + bl _0803388E + .align 2, 0 +_08032EB4: .4byte gUnknown_80E2B90 +_08032EB8: + ldr r0, _08032ED8 + ldr r3, _08032EDC + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + str r2, [sp, 0xC] + adds r1, 0xFD + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0xF + bl sub_8014248 + bl _080338B4 + .align 2, 0 +_08032ED8: .4byte gUnknown_80E2BE0 +_08032EDC: .4byte gUnknown_80E23A8 +_08032EE0: + ldr r0, _08032EE8 + bl _0803388E + .align 2, 0 +_08032EE8: .4byte gUnknown_80E2C48 +_08032EEC: + bl sub_8023CE8 + cmp r0, 0 + beq _08032EF8 + bl sub_8023C60 +_08032EF8: + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0x3 + movs r1, 0 + movs r2, 0 + movs r3, 0x9 + bl sub_8023868 + bl _080338B4 +_08032F16: + ldr r0, [r6] + movs r4, 0xD7 + lsls r4, 2 + adds r0, r4 + bl sub_8006518 + ldr r1, [r6] + movs r5, 0x87 + lsls r5, 2 + adds r0, r1, r5 + adds r1, r4 + ldr r3, _08032F4C + ldr r2, _08032F50 + str r2, [sp] + movs r2, 0x1 + str r2, [sp, 0x4] + movs r2, 0 + str r2, [sp, 0x8] + str r2, [sp, 0xC] + movs r2, 0x3 + bl sub_8035C3C + bl sub_8023DA4 + bl _080336E2 + .align 2, 0 +_08032F4C: .4byte gUnknown_80E2334 +_08032F50: .4byte gUnknown_80E234C +_08032F54: + ldr r0, _08032F74 + ldr r3, _08032F78 + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + str r2, [sp, 0xC] + adds r1, 0xFD + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0x10 + bl sub_8014248 + bl _080338B4 + .align 2, 0 +_08032F74: .4byte gUnknown_80E2C94 +_08032F78: .4byte gUnknown_80E22F0 +_08032F7C: + ldr r0, _08032F84 + ldr r3, _08032F88 + bl _080336FC + .align 2, 0 +_08032F84: .4byte gUnknown_80E2CD4 +_08032F88: .4byte gUnknown_80E22D0 +_08032F8C: + ldr r0, _08032F94 + bl _0803388E + .align 2, 0 +_08032F94: .4byte gUnknown_80E2CE8 +_08032F98: + bl sub_8030894 + cmp r0, 0 + beq _08032FA4 + bl _080338B4 +_08032FA4: + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0x4 + b _080336A6 +_08032FB6: + ldr r0, _08032FBC + ldr r3, _08032FC0 + b _080336FC + .align 2, 0 +_08032FBC: .4byte gUnknown_80E2D30 +_08032FC0: .4byte gUnknown_80E22B4 +_08032FC4: + ldr r0, _08032FCC + bl _0803388E + .align 2, 0 +_08032FCC: .4byte gUnknown_80E2D60 +_08032FD0: + ldr r0, _08032FD4 + b _080336FA + .align 2, 0 +_08032FD4: .4byte gUnknown_80E2D7C +_08032FD8: + ldr r0, _08032FDC + b _080336FA + .align 2, 0 +_08032FDC: .4byte gUnknown_80E2E20 +_08032FE0: + ldr r0, _08032FE4 + b _08033574 + .align 2, 0 +_08032FE4: .4byte gUnknown_80E2E54 +_08032FE8: + ldr r0, _08032FEC + b _08033574 + .align 2, 0 +_08032FEC: .4byte gUnknown_80E2EB4 +_08032FF0: + ldr r1, [r6] + movs r0, 0 + str r0, [r1, 0x44] + bl sub_8011830 + ldr r0, [r6] + ldr r0, [r0, 0x40] + bl sub_8037B28 + adds r4, r0, 0 + ldr r0, [r6] + str r4, [r0, 0x44] + cmp r4, 0 + beq _0803300E + b _080333DE +_0803300E: + ldr r1, [r0, 0x40] + cmp r1, 0x3 + beq _08033028 + cmp r1, 0x3 + bhi _0803301E + cmp r1, 0x2 + beq _0803304A + b _0803313C +_0803301E: + cmp r1, 0x4 + beq _080330B4 + cmp r1, 0x5 + beq _0803308E + b _0803313C +_08033028: + adds r0, 0x48 + movs r1, 0 + movs r2, 0x30 + bl MemoryFill8 + ldr r0, [r6] + adds r0, 0x78 + movs r1, 0 + movs r2, 0x30 + bl MemoryFill8 + ldr r2, [r6] + ldr r0, [r2, 0x40] + adds r1, r2, 0 + adds r1, 0x48 + adds r2, 0x78 + b _08033134 +_0803304A: + adds r0, 0x48 + movs r1, 0 + movs r2, 0x30 + bl MemoryFill8 + ldr r0, [r6] + adds r0, 0x78 + movs r1, 0 + movs r2, 0x30 + bl MemoryFill8 + ldr r0, [r6] + movs r3, 0x86 + lsls r3, 2 + adds r0, r3 + ldrb r0, [r0] + bl sub_8095228 + ldr r1, [r6] + adds r1, 0x48 + ldm r0!, {r2,r4,r5} + stm r1!, {r2,r4,r5} + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldr r2, [r6] + ldr r0, [r2, 0x40] + adds r1, r2, 0 + adds r1, 0x48 + adds r2, 0x78 + b _08033134 +_0803308E: + adds r0, 0xA8 + movs r1, 0 + movs r2, 0x88 + bl MemoryFill8 + ldr r0, [r6] + movs r4, 0x98 + lsls r4, 1 + adds r0, r4 + movs r1, 0 + movs r2, 0x88 + bl MemoryFill8 + ldr r2, [r6] + ldr r0, [r2, 0x40] + adds r1, r2, 0 + adds r1, 0xA8 + adds r2, r4 + b _08033134 +_080330B4: + adds r0, 0xA8 + movs r1, 0 + movs r2, 0x88 + bl MemoryFill8 + ldr r0, [r6] + movs r5, 0x98 + lsls r5, 1 + adds r0, r5 + movs r1, 0 + movs r2, 0x88 + bl MemoryFill8 + ldr r1, [r6] + adds r0, r1, 0 + adds r0, 0xE0 + strh r4, [r0] + movs r2, 0xB4 + lsls r2, 1 + adds r0, r1, r2 + strh r4, [r0] + movs r3, 0x86 + lsls r3, 2 + adds r0, r1, r3 + ldrb r0, [r0] + bl sub_8095228 + ldr r1, [r6] + adds r1, 0xA8 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r2, [r6] + movs r4, 0xA7 + lsls r4, 3 + adds r3, r2, r4 + movs r0, 0 + ldrsh r1, [r3, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0803312A + adds r0, r2, 0 + adds r0, 0xD8 + ldr r1, _08033188 + ldr r1, [r1] + movs r2, 0 + ldrsh r3, [r3, r2] + movs r2, 0x58 + muls r2, r3 + adds r1, r2 + movs r2, 0x58 + bl memcpy +_0803312A: + ldr r2, [r6] + ldr r0, [r2, 0x40] + adds r1, r2, 0 + adds r1, 0xA8 + adds r2, r5 +_08033134: + bl sub_8037D64 + ldr r1, [r6] + str r0, [r1, 0x44] +_0803313C: + ldr r4, _0803318C + ldr r2, [r4] + ldr r0, [r2, 0x44] + cmp r0, 0 + beq _08033148 + b _080333DE +_08033148: + ldr r0, [r2, 0x40] + cmp r0, 0x2 + bcs _08033150 + b _080333DE +_08033150: + cmp r0, 0x3 + bls _08033190 + cmp r0, 0x5 + bls _0803315A + b _080333DE +_0803315A: + adds r1, r2, 0 + adds r1, 0xA8 + movs r3, 0x98 + lsls r3, 1 + adds r2, r3 + bl sub_80381F4 + ldr r1, [r4] + str r0, [r1, 0x44] + bl sub_800D588 + lsls r0, 24 + cmp r0, 0 + beq _080331C0 + ldr r0, [r4] + movs r4, 0x84 + lsls r4, 3 + adds r1, r0, r4 + movs r5, 0xA0 + lsls r5, 1 + adds r0, r5 + b _080333DA + .align 2, 0 +_08033188: .4byte gUnknown_203B45C +_0803318C: .4byte gUnknown_203B33C +_08033190: + adds r1, r2, 0 + adds r1, 0x48 + adds r2, 0x78 + bl sub_80381F4 + ldr r1, [r4] + str r0, [r1, 0x44] + bl sub_800D588 + lsls r0, 24 + cmp r0, 0 + beq _080331B4 + ldr r0, [r4] + movs r2, 0x84 + lsls r2, 3 + adds r1, r0, r2 + adds r0, 0x88 + b _080333DA +_080331B4: + ldr r0, [r4] + movs r3, 0x84 + lsls r3, 3 + adds r1, r0, r3 + ldr r0, [r0, 0x58] + b _080333DC +_080331C0: + ldr r0, [r4] + movs r4, 0x84 + lsls r4, 3 + adds r1, r0, r4 + adds r0, 0xB8 + b _080333DA +_080331CC: + ldr r0, _080331D0 + b _0803388E + .align 2, 0 +_080331D0: .4byte gUnknown_80E2F14 +_080331D4: + ldr r0, _080331D8 + b _0803388E + .align 2, 0 +_080331D8: .4byte gUnknown_80E2F44 +_080331DC: + bl sub_8030894 + cmp r0, 0 + beq _080331E6 + b _080338B4 +_080331E6: + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0x1 + b _080336A6 +_080331F8: + ldr r0, _080331FC + b _080336FA + .align 2, 0 +_080331FC: .4byte gUnknown_80E2F78 +_08033200: + ldr r0, _08033204 + b _0803388E + .align 2, 0 +_08033204: .4byte gUnknown_80E2FA0 +_08033208: + ldr r0, [r6] + ldr r5, _08033220 + adds r0, r5 + ldr r0, [r0] + cmp r0, 0xC + bne _08033216 + b _080338B4 +_08033216: + cmp r0, 0xC + bhi _08033224 + cmp r0, 0xB + beq _0803322A + b _080338B4 + .align 2, 0 +_08033220: .4byte 0x00000524 +_08033224: + cmp r0, 0xE + bls _0803322A + b _080338B4 +_0803322A: + ldr r0, _08033230 + b _0803388E + .align 2, 0 +_08033230: .4byte gUnknown_80E2FEC +_08033234: + ldr r0, _08033238 + b _0803388E + .align 2, 0 +_08033238: .4byte gUnknown_80E3030 +_0803323C: + ldr r0, _08033240 + b _0803388E + .align 2, 0 +_08033240: .4byte gUnknown_80E3078 +_08033244: + ldr r0, [r6] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + b _080333F4 +_0803324E: + ldr r0, _08033254 + ldr r3, _08033258 + b _080336FC + .align 2, 0 +_08033254: .4byte gUnknown_80E30A4 +_08033258: .4byte gUnknown_80E2458 +_0803325C: + ldr r0, _08033260 + b _0803388E + .align 2, 0 +_08033260: .4byte gUnknown_80E30D0 +_08033264: + ldr r0, [r6] + movs r4, 0xD7 + lsls r4, 2 + adds r0, r4 + bl sub_8006518 + ldr r1, [r6] + movs r5, 0x87 + lsls r5, 2 + adds r0, r1, r5 + adds r1, r4 + ldr r3, _08033280 + ldr r2, _08033284 + b _080336CC + .align 2, 0 +_08033280: .4byte gUnknown_80E231C +_08033284: .4byte gUnknown_80E2408 +_08033288: + bl sub_801D008 + cmp r0, 0 + beq _08033292 + b _080338B4 +_08033292: + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, _080332B4 + str r0, [sp, 0x64] + add r2, sp, 0x64 + movs r0, 0 + movs r1, 0x1 + movs r3, 0x9 + bl sub_801C8C4 + b _080338B4 + .align 2, 0 +_080332B4: .4byte 0x00020003 +_080332B8: + ldr r0, [r6] + movs r4, 0xD7 + lsls r4, 2 + adds r0, r4 + bl sub_8006518 + ldr r1, [r6] + movs r5, 0x87 + lsls r5, 2 + adds r0, r1, r5 + adds r1, r4 + ldr r3, _080332EC + ldr r2, _080332F0 + str r2, [sp] + movs r2, 0x1 + str r2, [sp, 0x4] + movs r2, 0 + str r2, [sp, 0x8] + str r2, [sp, 0xC] + movs r2, 0x3 + bl sub_8035C3C + bl sub_801CCD8 + b _080336E2 + .align 2, 0 +_080332EC: .4byte gUnknown_80E23F0 +_080332F0: .4byte gUnknown_80E2408 +_080332F4: + ldr r1, [r6] + movs r0, 0 + str r0, [r1, 0x44] + bl sub_8011830 + ldr r0, [r6] + ldr r0, [r0, 0x40] + bl sub_8037B28 + ldr r1, [r6] + str r0, [r1, 0x44] + cmp r0, 0 + bne _080333DE + ldr r0, [r1, 0x40] + cmp r0, 0x6 + beq _0803331A + cmp r0, 0x7 + beq _08033358 + b _08033388 +_0803331A: + movs r4, 0xDC + lsls r4, 1 + adds r0, r1, r4 + movs r1, 0 + movs r2, 0x30 + bl MemoryFill8 + ldr r0, [r6] + movs r2, 0x86 + lsls r2, 2 + adds r0, r2 + ldrb r0, [r0] + bl sub_8095228 + ldr r1, [r6] + adds r1, r4 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldr r2, [r6] + ldr r0, [r2, 0x40] + adds r4, r2, r4 + movs r3, 0xF4 + lsls r3, 1 + adds r2, r3 + b _0803337E +_08033358: + movs r4, 0xDC + lsls r4, 1 + adds r0, r1, r4 + movs r1, 0 + movs r2, 0x30 + bl MemoryFill8 + ldr r0, [r6] + movs r5, 0xF4 + lsls r5, 1 + adds r0, r5 + movs r1, 0 + movs r2, 0x30 + bl MemoryFill8 + ldr r2, [r6] + ldr r0, [r2, 0x40] + adds r4, r2, r4 + adds r2, r5 +_0803337E: + adds r1, r4, 0 + bl sub_8037D64 + ldr r1, [r6] + str r0, [r1, 0x44] +_08033388: + ldr r4, _080333C8 + ldr r2, [r4] + ldr r0, [r2, 0x44] + cmp r0, 0 + bne _080333DE + ldr r0, [r2, 0x40] + cmp r0, 0x7 + bhi _080333DE + cmp r0, 0x6 + bcc _080333DE + movs r5, 0xDC + lsls r5, 1 + adds r1, r2, r5 + movs r3, 0xF4 + lsls r3, 1 + adds r2, r3 + bl sub_80381F4 + ldr r1, [r4] + str r0, [r1, 0x44] + bl sub_800D588 + lsls r0, 24 + cmp r0, 0 + beq _080333CC + ldr r0, [r4] + movs r4, 0x84 + lsls r4, 3 + adds r1, r0, r4 + adds r5, 0x40 + adds r0, r5 + b _080333DA + .align 2, 0 +_080333C8: .4byte gUnknown_203B33C +_080333CC: + ldr r0, [r4] + movs r2, 0x84 + lsls r2, 3 + adds r1, r0, r2 + movs r3, 0xE4 + lsls r3, 1 + adds r0, r3 +_080333DA: + ldr r0, [r0] +_080333DC: + str r0, [r1] +_080333DE: + bl sub_8011854 + b _080338B4 +_080333E4: + ldr r0, _080333E8 + b _0803388E + .align 2, 0 +_080333E8: .4byte gUnknown_80E311C +_080333EC: + ldr r0, [r6] + movs r4, 0xEF + lsls r4, 2 + adds r0, r4 +_080333F4: + bl sub_8006518 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r1, [r6] + adds r1, 0x8 + movs r0, 0x4 + bl sub_80151C0 + b _080338B4 +_08033412: + ldr r0, _08033418 + b _0803388E + .align 2, 0 +_08033418: .4byte gUnknown_80E314C +_0803341C: + ldr r0, [r6] + movs r5, 0xEF + lsls r5, 2 + adds r0, r5 + bl sub_8006518 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r6] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 +_0803343E: + ldrb r0, [r0] + movs r1, 0 + bl sub_8031D70 + b _080338B4 +_08033448: + ldr r0, _0803344C + b _0803388E + .align 2, 0 +_0803344C: .4byte gUnknown_80E317C +_08033450: + ldr r0, _08033454 + b _0803388E + .align 2, 0 +_08033454: .4byte gUnknown_80E319C +_08033458: + ldr r0, _0803345C + b _0803388E + .align 2, 0 +_0803345C: .4byte gUnknown_80E317C +_08033460: + ldr r0, _08033464 + b _0803388E + .align 2, 0 +_08033464: .4byte gUnknown_80E31D8 +_08033468: + ldr r0, _0803346C + b _0803388E + .align 2, 0 +_0803346C: .4byte gUnknown_80E31FC +_08033470: + ldr r0, [r6] + ldr r2, _08033488 + adds r0, r2 + ldr r0, [r0] + cmp r0, 0xC + bne _0803347E + b _080338B4 +_0803347E: + cmp r0, 0xC + bhi _0803348C + cmp r0, 0xB + beq _08033492 + b _080338B4 + .align 2, 0 +_08033488: .4byte 0x00000524 +_0803348C: + cmp r0, 0xE + bls _08033492 + b _080338B4 +_08033492: + ldr r0, _08033498 + b _0803388E + .align 2, 0 +_08033498: .4byte gUnknown_80E3220 +_0803349C: + movs r0, 0x98 + lsls r0, 1 + bl sub_808D994 + adds r1, r0, 0 + ldr r4, _080334F8 + ldr r0, [r4] + ldr r3, _080334FC + adds r0, r3 + bl strcpy + ldr r1, [r4] + movs r5, 0xAA + lsls r5, 3 + adds r0, r1, r5 + movs r2, 0 + strh r2, [r0] + ldr r0, _08033500 + adds r1, r0 + movs r0, 0x2 + strb r0, [r1] + ldr r0, [r4] + ldr r3, _08033504 + adds r1, r0, r3 + str r2, [r1] + movs r5, 0x84 + lsls r5, 3 + adds r0, r5 + ldr r1, [r0] + movs r0, 0x6 + bl sub_809539C + lsls r0, 24 + lsrs r0, 24 + bl sub_8095228 + adds r2, r0, 0 + adds r0, 0x22 + ldrb r1, [r0] + cmp r1, 0 + beq _08033508 + ldr r0, [r4] + movs r3, 0xAB + lsls r3, 3 + adds r0, r3 + b _08033512 + .align 2, 0 +_080334F8: .4byte gUnknown_203B33C +_080334FC: .4byte 0x0000053c +_08033500: .4byte 0x00000552 +_08033504: .4byte 0x00000554 +_08033508: + ldr r0, [r4] + movs r4, 0xAB + lsls r4, 3 + adds r0, r4 + movs r1, 0 +_08033512: + strb r1, [r0] + ldr r4, _08033558 + ldr r0, [r4] + ldr r5, _0803355C + adds r0, r5 + movs r5, 0 + movs r1, 0x1 + strb r1, [r0] + adds r0, r2, 0x4 + movs r1, 0 + bl sub_803C200 + ldr r1, [r4] + movs r3, 0xAC + lsls r3, 3 + adds r2, r1, r3 + str r0, [r2] + ldr r0, _08033560 + adds r1, r0 + strb r5, [r1] + ldr r0, [r4] + ldr r1, _08033564 + adds r0, r1 + strb r5, [r0] + ldr r0, [r4] + ldr r2, _08033568 + adds r0, r2 + strb r5, [r0] + ldr r0, [r4] + subs r3, 0x24 + adds r0, r3 + movs r1, 0 + bl sub_802F204 + b _080338B4 + .align 2, 0 +_08033558: .4byte gUnknown_203B33C +_0803355C: .4byte 0x0000055b +_08033560: .4byte 0x00000559 +_08033564: .4byte 0x0000055a +_08033568: .4byte 0x0000055c +_0803356C: + movs r0, 0 + bl nullsub_23 + ldr r0, _08033580 +_08033574: + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_80141B4 + b _080338B4 + .align 2, 0 +_08033580: .4byte gUnknown_80E2DD0 +_08033584: + ldr r0, [r6] + ldr r4, _0803359C + adds r0, r4 + ldr r0, [r0] + cmp r0, 0xC + bne _08033592 + b _080338B4 +_08033592: + cmp r0, 0xC + bhi _080335A0 + cmp r0, 0xB + beq _080335A6 + b _080338B4 + .align 2, 0 +_0803359C: .4byte 0x00000524 +_080335A0: + cmp r0, 0xE + bls _080335A6 + b _080338B4 +_080335A6: + ldr r0, _080335AC + b _0803388E + .align 2, 0 +_080335AC: .4byte gUnknown_80E3248 +_080335B0: + ldr r0, _080335B4 + b _0803388E + .align 2, 0 +_080335B4: .4byte gUnknown_80E3288 +_080335B8: + ldr r0, _080335BC + b _080336FA + .align 2, 0 +_080335BC: .4byte gUnknown_80E2D7C +_080335C0: + bl sub_808D33C + adds r1, r0, 0 + adds r1, 0x4C + add r0, sp, 0x14 + movs r2, 0xA + bl sub_80922B4 + ldr r5, _080335E8 + ldr r0, [r5] + ldr r4, _080335EC + adds r0, r4 + ldr r1, _080335F0 + add r2, sp, 0x14 + bl sub_800D158 + ldr r0, [r5] + adds r0, r4 + b _0803388E + .align 2, 0 +_080335E8: .4byte gUnknown_203B33C +_080335EC: .4byte 0x00000424 +_080335F0: .4byte gUnknown_80E32C4 +_080335F4: + ldr r0, _080335FC + ldr r3, _08033600 + b _080336FC + .align 2, 0 +_080335FC: .4byte gUnknown_80E331C +_08033600: .4byte gUnknown_80E24D8 +_08033604: + ldr r0, _08033608 + b _0803388E + .align 2, 0 +_08033608: .4byte gUnknown_80E317C +_0803360C: + ldr r0, _08033610 + b _0803388E + .align 2, 0 +_08033610: .4byte gUnknown_80E2A0C +_08033614: + ldr r0, _08033618 + b _0803388E + .align 2, 0 +_08033618: .4byte gUnknown_80E3378 +_0803361C: + ldr r0, _0803363C + ldr r3, _08033640 + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + str r2, [sp, 0xC] + adds r1, 0xFD + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0x16 + bl sub_8014248 + b _080338B4 + .align 2, 0 +_0803363C: .4byte gUnknown_80E339C +_08033640: .4byte gUnknown_80E24B0 +_08033644: + ldr r0, _08033664 + ldr r3, _08033668 + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + str r2, [sp, 0xC] + adds r1, 0xFD + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0x15 + bl sub_8014248 + b _080338B4 + .align 2, 0 +_08033664: .4byte gUnknown_80E33D8 +_08033668: .4byte gUnknown_80E2470 +_0803366C: + ldr r0, _08033670 + b _0803388E + .align 2, 0 +_08033670: .4byte gUnknown_80E3430 +_08033674: + ldr r0, _0803367C + ldr r3, _08033680 + b _080336FC + .align 2, 0 +_0803367C: .4byte gUnknown_80E34B0 +_08033680: .4byte gUnknown_80E2440 +_08033684: + ldr r0, _08033688 + b _0803388E + .align 2, 0 +_08033688: .4byte gUnknown_80E34F0 +_0803368C: + bl sub_8030894 + cmp r0, 0 + beq _08033696 + b _080338B4 +_08033696: + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0x5 +_080336A6: + movs r1, 0 + movs r2, 0 + movs r3, 0x6 + bl sub_80306A8 + b _080338B4 +_080336B2: + ldr r0, [r6] + movs r4, 0xD7 + lsls r4, 2 + adds r0, r4 + bl sub_8006518 + ldr r1, [r6] + movs r5, 0x87 + lsls r5, 2 + adds r0, r1, r5 + adds r1, r4 + ldr r3, _080336F0 + ldr r2, _080336F4 +_080336CC: + str r2, [sp] + movs r2, 0x1 + str r2, [sp, 0x4] + movs r2, 0 + str r2, [sp, 0x8] + str r2, [sp, 0xC] + movs r2, 0x3 + bl sub_8035C3C + bl sub_803092C +_080336E2: + ldr r0, [r6] + adds r0, r5 + movs r1, 0x3 + movs r2, 0x1 + bl sub_8035CF4 + b _080338B4 + .align 2, 0 +_080336F0: .4byte gUnknown_80E231C +_080336F4: .4byte gUnknown_80E234C +_080336F8: + ldr r0, _08033718 +_080336FA: + ldr r3, _0803371C +_080336FC: + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + str r2, [sp, 0xC] + adds r1, 0xFD + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0x6 + bl sub_8014248 + b _080338B4 + .align 2, 0 +_08033718: .4byte gUnknown_80E352C +_0803371C: .4byte gUnknown_80E2290 +_08033720: + ldr r0, _08033724 + b _0803388E + .align 2, 0 +_08033724: .4byte gUnknown_80E355C +_08033728: + ldr r0, _0803372C + b _0803388E + .align 2, 0 +_0803372C: .4byte gUnknown_80E35AC +_08033730: + ldr r0, _08033734 + b _0803388E + .align 2, 0 +_08033734: .4byte gUnknown_80E35E8 +_08033738: + ldr r0, [r6] + ldr r0, [r0, 0x40] + cmp r0, 0x6 + bne _08033748 + ldr r0, _08033744 + b _0803374A + .align 2, 0 +_08033744: .4byte gUnknown_80E360C +_08033748: + ldr r0, _08033768 +_0803374A: + ldr r3, _0803376C + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + str r2, [sp, 0xC] + adds r1, 0xFD + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0xB + bl sub_8014248 + b _080338B4 + .align 2, 0 +_08033768: .4byte gUnknown_80E3644 +_0803376C: .4byte gUnknown_80E236C +_08033770: + ldr r0, _08033780 + ldr r1, [r6] + ldr r5, _08033784 + adds r1, r5 + ldr r2, [r1] + ldr r3, _08033788 + b _08033858 + .align 2, 0 +_08033780: .4byte gUnknown_80E367C +_08033784: .4byte 0x00000564 +_08033788: .4byte gUnknown_80E25B4 +_0803378C: + ldr r0, [r6] + ldr r1, _080337A4 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0x24 + beq _080337BC + cmp r0, 0x24 + bgt _080337A8 + cmp r0, 0x23 + beq _080337B2 + b _080338B4 + .align 2, 0 +_080337A4: .4byte 0x00000564 +_080337A8: + cmp r0, 0x25 + beq _080337C4 + cmp r0, 0x26 + beq _080337CC + b _080338B4 +_080337B2: + ldr r0, _080337B8 + b _0803388E + .align 2, 0 +_080337B8: .4byte gUnknown_80E3690 +_080337BC: + ldr r0, _080337C0 + b _0803388E + .align 2, 0 +_080337C0: .4byte gUnknown_80E3818 +_080337C4: + ldr r0, _080337C8 + b _0803388E + .align 2, 0 +_080337C8: .4byte gUnknown_80E3998 +_080337CC: + ldr r0, _080337D0 + b _0803388E + .align 2, 0 +_080337D0: .4byte gUnknown_80E3B1C +_080337D4: + ldr r0, _080337E4 + ldr r1, [r6] + ldr r2, _080337E8 + adds r1, r2 + ldr r2, [r1] + ldr r3, _080337EC + b _08033858 + .align 2, 0 +_080337E4: .4byte gUnknown_80E367C +_080337E8: .4byte 0x00000564 +_080337EC: .4byte gUnknown_80E2554 +_080337F0: + ldr r0, [r6] + ldr r3, _08033808 + adds r0, r3 + ldr r0, [r0] + subs r0, 0x1E + cmp r0, 0x4 + bhi _080338B4 + lsls r0, 2 + ldr r1, _0803380C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08033808: .4byte 0x00000564 +_0803380C: .4byte _08033810 + .align 2, 0 +_08033810: + .4byte _08033824 + .4byte _0803382C + .4byte _0803383C + .4byte _08033834 + .4byte _08033844 +_08033824: + ldr r0, _08033828 + b _0803388E + .align 2, 0 +_08033828: .4byte gUnknown_80E3BF8 +_0803382C: + ldr r0, _08033830 + b _0803388E + .align 2, 0 +_08033830: .4byte gUnknown_80E3DE4 +_08033834: + ldr r0, _08033838 + b _0803388E + .align 2, 0 +_08033838: .4byte gUnknown_80E3E98 +_0803383C: + ldr r0, _08033840 + b _0803388E + .align 2, 0 +_08033840: .4byte gUnknown_80E4014 +_08033844: + ldr r0, _08033848 + b _0803388E + .align 2, 0 +_08033848: .4byte gUnknown_80E4130 +_0803384C: + ldr r0, _08033870 + ldr r1, [r6] + ldr r4, _08033874 + adds r1, r4 + ldr r2, [r1] + ldr r3, _08033878 +_08033858: + movs r4, 0 + str r4, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r4, [sp, 0x8] + str r4, [sp, 0xC] +_08033864: + adds r1, 0xFD + str r1, [sp, 0x10] + movs r1, 0 + bl sub_8014248 + b _080338B4 + .align 2, 0 +_08033870: .4byte gUnknown_80E367C +_08033874: .4byte 0x00000564 +_08033878: .4byte gUnknown_80E24F8 +_0803387C: + ldr r0, [r6] + ldr r5, _0803389C + adds r0, r5 + ldr r0, [r0] + cmp r0, 0x1A + beq _080338A8 + cmp r0, 0x1D + bne _080338B4 + ldr r0, _080338A0 +_0803388E: + ldr r3, _080338A4 + movs r1, 0 + movs r2, 0 + bl sub_80141B4 + b _080338B4 + .align 2, 0 +_0803389C: .4byte 0x00000564 +_080338A0: .4byte gUnknown_80E41DC +_080338A4: .4byte 0x00000101 +_080338A8: + ldr r0, _080338BC + ldr r3, _080338C0 + movs r1, 0 + movs r2, 0 + bl sub_80141B4 +_080338B4: + add sp, 0x68 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080338BC: .4byte gUnknown_80E4314 +_080338C0: .4byte 0x00000101 + thumb_func_end sub_8032828 + + thumb_func_start sub_80338C4 +sub_80338C4: + push {lr} + ldr r1, _080338D8 + ldr r1, [r1] + str r0, [r1] + bl nullsub_40 + bl sub_8032828 + pop {r0} + bx r0 + .align 2, 0 +_080338D8: .4byte gUnknown_203B33C + thumb_func_end sub_80338C4 + + thumb_func_start sub_80338DC +sub_80338DC: + push {lr} + cmp r0, 0x10 + bls _080338E4 + b _080339BC +_080338E4: + lsls r0, 2 + ldr r1, _080338F0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080338F0: .4byte _080338F4 + .align 2, 0 +_080338F4: + .4byte _080339BC + .4byte _08033998 + .4byte _08033940 + .4byte _08033938 + .4byte _08033948 + .4byte _08033998 + .4byte _08033950 + .4byte _08033958 + .4byte _08033960 + .4byte _08033968 + .4byte _08033970 + .4byte _08033978 + .4byte _08033980 + .4byte _08033990 + .4byte _08033998 + .4byte _080339B0 + .4byte _08033988 +_08033938: + ldr r0, _0803393C + b _0803399A + .align 2, 0 +_0803393C: .4byte gUnknown_80E44A4 +_08033940: + ldr r0, _08033944 + b _0803399A + .align 2, 0 +_08033944: .4byte gUnknown_80E4500 +_08033948: + ldr r0, _0803394C + b _0803399A + .align 2, 0 +_0803394C: .4byte gUnknown_80E4550 +_08033950: + ldr r0, _08033954 + b _0803399A + .align 2, 0 +_08033954: .4byte gUnknown_80E45B4 +_08033958: + ldr r0, _0803395C + b _0803399A + .align 2, 0 +_0803395C: .4byte gUnknown_80E460C +_08033960: + ldr r0, _08033964 + b _0803399A + .align 2, 0 +_08033964: .4byte gUnknown_80E4650 +_08033968: + ldr r0, _0803396C + b _0803399A + .align 2, 0 +_0803396C: .4byte gUnknown_80E468C +_08033970: + ldr r0, _08033974 + b _0803399A + .align 2, 0 +_08033974: .4byte gUnknown_80E46C8 +_08033978: + ldr r0, _0803397C + b _0803399A + .align 2, 0 +_0803397C: .4byte gUnknown_80E4704 +_08033980: + ldr r0, _08033984 + b _0803399A + .align 2, 0 +_08033984: .4byte gUnknown_80E4744 +_08033988: + ldr r0, _0803398C + b _0803399A + .align 2, 0 +_0803398C: .4byte gUnknown_80E4788 +_08033990: + ldr r0, _08033994 + b _0803399A + .align 2, 0 +_08033994: .4byte gUnknown_80E47D8 +_08033998: + ldr r0, _080339A8 +_0803399A: + ldr r3, _080339AC + movs r1, 0 + movs r2, 0 + bl sub_80141B4 + b _080339BC + .align 2, 0 +_080339A8: .4byte gUnknown_80E4480 +_080339AC: .4byte 0x00000101 +_080339B0: + ldr r0, _080339C0 + ldr r3, _080339C4 + movs r1, 0 + movs r2, 0 + bl sub_80141B4 +_080339BC: + pop {r0} + bx r0 + .align 2, 0 +_080339C0: .4byte gUnknown_80E482C +_080339C4: .4byte 0x00000101 + thumb_func_end sub_80338DC + + thumb_func_start sub_80339C8 +sub_80339C8: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08033A24 + ldr r0, _080339F4 + ldr r0, [r0] + movs r1, 0xA7 + lsls r1, 3 + adds r0, r1 + ldr r1, _080339F8 + strh r1, [r0] + ldr r0, [sp] + cmp r0, 0x1 + beq _08033A0E + cmp r0, 0x1 + bgt _080339FC + cmp r0, 0 + beq _08033A06 + b _08033A24 + .align 2, 0 +_080339F4: .4byte gUnknown_203B33C +_080339F8: .4byte 0x0000ffff +_080339FC: + cmp r0, 0x8 + beq _08033A1E + cmp r0, 0x17 + beq _08033A16 + b _08033A24 +_08033A06: + movs r0, 0x3 + bl sub_80338C4 + b _08033A24 +_08033A0E: + movs r0, 0x4 + bl sub_80338C4 + b _08033A24 +_08033A16: + movs r0, 0x78 + bl sub_80338C4 + b _08033A24 +_08033A1E: + movs r0, 0x2 + bl sub_80338C4 +_08033A24: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80339C8 + + thumb_func_start sub_8033A2C +sub_8033A2C: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + beq _08033A3C + b _08033B86 +_08033A3C: + ldr r2, _08033A58 + ldr r1, [r2] + movs r0, 0x8 + str r0, [r1, 0x40] + ldr r0, [sp] + subs r0, 0x3 + cmp r0, 0x11 + bls _08033A4E + b _08033B86 +_08033A4E: + lsls r0, 2 + ldr r1, _08033A5C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08033A58: .4byte gUnknown_203B33C +_08033A5C: .4byte _08033A60 + .align 2, 0 +_08033A60: + .4byte _08033ACA + .4byte _08033AEC + .4byte _08033B86 + .4byte _08033B86 + .4byte _08033B86 + .4byte _08033B80 + .4byte _08033B86 + .4byte _08033B86 + .4byte _08033B86 + .4byte _08033B86 + .4byte _08033B86 + .4byte _08033B86 + .4byte _08033B86 + .4byte _08033B86 + .4byte _08033AA8 + .4byte _08033B14 + .4byte _08033B3E + .4byte _08033B68 +_08033AA8: + ldr r0, [r2] + movs r1, 0x2 + str r1, [r0, 0x40] + movs r1, 0xA5 + lsls r1, 3 + adds r0, r1 + movs r1, 0x11 + str r1, [r0] + movs r0, 0x1 + bl sub_8095324 + cmp r0, 0 + beq _08033B0C + movs r0, 0x31 + bl sub_80338C4 + b _08033B86 +_08033ACA: + ldr r0, [r2] + movs r1, 0x3 + str r1, [r0, 0x40] + movs r2, 0xA5 + lsls r2, 3 + adds r0, r2 + str r1, [r0] + bl sub_8095190 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _08033B36 + movs r0, 0xF + bl sub_80338C4 + b _08033B86 +_08033AEC: + ldr r0, [r2] + movs r1, 0x4 + str r1, [r0, 0x40] + movs r2, 0xA5 + lsls r2, 3 + adds r0, r2 + str r1, [r0] + movs r0, 0x4 + bl sub_8095324 + cmp r0, 0 + beq _08033B0C + movs r0, 0x1C + bl sub_80338C4 + b _08033B86 +_08033B0C: + movs r0, 0x22 + bl sub_80338C4 + b _08033B86 +_08033B14: + ldr r0, [r2] + movs r1, 0x5 + str r1, [r0, 0x40] + movs r1, 0xA5 + lsls r1, 3 + adds r0, r1 + movs r1, 0x12 + str r1, [r0] + movs r0, 0x5 + bl sub_8095324 + cmp r0, 0 + beq _08033B36 + movs r0, 0x3D + bl sub_80338C4 + b _08033B86 +_08033B36: + movs r0, 0xE + bl sub_80338C4 + b _08033B86 +_08033B3E: + ldr r0, [r2] + movs r1, 0x6 + str r1, [r0, 0x40] + movs r2, 0xA5 + lsls r2, 3 + adds r0, r2 + movs r1, 0x13 + str r1, [r0] + movs r0, 0x5 + bl sub_8095324 + cmp r0, 0 + bne _08033B60 + movs r0, 0x51 + bl sub_80338C4 + b _08033B86 +_08033B60: + movs r0, 0x5B + bl sub_80338C4 + b _08033B86 +_08033B68: + ldr r0, [r2] + movs r1, 0x7 + str r1, [r0, 0x40] + movs r1, 0xA5 + lsls r1, 3 + adds r0, r1 + movs r1, 0x14 + str r1, [r0] + movs r0, 0x52 + bl sub_80338C4 + b _08033B86 +_08033B80: + movs r0, 0x1 + bl sub_80338C4 +_08033B86: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8033A2C + + thumb_func_start sub_8033B8C +sub_8033B8C: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08033C4C + ldr r2, [sp] + cmp r2, 0xC + bgt _08033BAA + cmp r2, 0xB + bge _08033BB0 + cmp r2, 0x8 + beq _08033C46 + b _08033C4C +_08033BAA: + cmp r2, 0xD + beq _08033BF4 + b _08033C4C +_08033BB0: + ldr r0, _08033BD4 + ldr r0, [r0] + ldr r1, _08033BD8 + adds r2, r0, r1 + movs r1, 0xB + str r1, [r2] + movs r3, 0xA5 + lsls r3, 3 + adds r0, r3 + ldr r0, [r0] + cmp r0, 0x4 + beq _08033BEC + cmp r0, 0x4 + bhi _08033BDC + cmp r0, 0x3 + beq _08033BE4 + b _08033C4C + .align 2, 0 +_08033BD4: .4byte gUnknown_203B33C +_08033BD8: .4byte 0x00000524 +_08033BDC: + cmp r0, 0x12 + bhi _08033C4C + cmp r0, 0x11 + bcc _08033C4C +_08033BE4: + movs r0, 0x5 + bl sub_80338C4 + b _08033C4C +_08033BEC: + movs r0, 0x23 + bl sub_80338C4 + b _08033C4C +_08033BF4: + ldr r0, _08033C14 + ldr r0, [r0] + ldr r3, _08033C18 + adds r1, r0, r3 + str r2, [r1] + movs r1, 0xA5 + lsls r1, 3 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0x4 + beq _08033C3E + cmp r0, 0x4 + bhi _08033C1C + cmp r0, 0x3 + beq _08033C26 + b _08033C4C + .align 2, 0 +_08033C14: .4byte gUnknown_203B33C +_08033C18: .4byte 0x00000524 +_08033C1C: + cmp r0, 0x11 + beq _08033C2E + cmp r0, 0x12 + beq _08033C36 + b _08033C4C +_08033C26: + movs r0, 0x19 + bl sub_80338C4 + b _08033C4C +_08033C2E: + movs r0, 0x39 + bl sub_80338C4 + b _08033C4C +_08033C36: + movs r0, 0x43 + bl sub_80338C4 + b _08033C4C +_08033C3E: + movs r0, 0x2D + bl sub_80338C4 + b _08033C4C +_08033C46: + movs r0, 0x1 + bl sub_80338C4 +_08033C4C: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8033B8C + + thumb_func_start sub_8033C54 +sub_8033C54: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08033CA2 + ldr r0, [sp] + cmp r0, 0x6 + beq _08033C6E + cmp r0, 0x8 + beq _08033C9C + b _08033CA2 +_08033C6E: + ldr r0, _08033C88 + ldr r0, [r0] + movs r1, 0xA5 + lsls r1, 3 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0x4 + beq _08033C94 + cmp r0, 0x4 + bhi _08033C8C + cmp r0, 0x3 + beq _08033C94 + b _08033CA2 + .align 2, 0 +_08033C88: .4byte gUnknown_203B33C +_08033C8C: + cmp r0, 0x11 + beq _08033C94 + cmp r0, 0x12 + bne _08033CA2 +_08033C94: + movs r0, 0xD + bl sub_80338C4 + b _08033CA2 +_08033C9C: + movs r0, 0x1 + bl sub_80338C4 +_08033CA2: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8033C54 + + thumb_func_start nullsub_41 +nullsub_41: + bx lr + thumb_func_end nullsub_41 + + thumb_func_start sub_8033CAC +sub_8033CAC: + push {r4,lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08033D40 + ldr r4, _08033CDC + ldr r1, [r4] + ldr r0, [r1, 0x44] + cmp r0, 0 + bne _08033D36 + movs r2, 0xA5 + lsls r2, 3 + adds r0, r1, r2 + ldr r0, [r0] + cmp r0, 0x4 + beq _08033D2E + cmp r0, 0x4 + bhi _08033CE0 + cmp r0, 0x3 + beq _08033CEA + b _08033D40 + .align 2, 0 +_08033CDC: .4byte gUnknown_203B33C +_08033CE0: + cmp r0, 0x11 + beq _08033CF2 + cmp r0, 0x12 + beq _08033CFA + b _08033D40 +_08033CEA: + movs r0, 0x16 + bl sub_80338C4 + b _08033D40 +_08033CF2: + movs r0, 0x37 + bl sub_80338C4 + b _08033D40 +_08033CFA: + bl sub_800D588 + lsls r0, 24 + cmp r0, 0 + beq _08033D12 + ldr r0, [r4] + movs r1, 0xB4 + lsls r1, 1 + adds r0, r1 + movs r2, 0 + ldrsh r0, [r0, r2] + b _08033D1A +_08033D12: + ldr r0, [r4] + adds r0, 0xE0 + movs r1, 0 + ldrsh r0, [r0, r1] +_08033D1A: + cmp r0, 0 + beq _08033D26 + movs r0, 0x3F + bl sub_80338C4 + b _08033D40 +_08033D26: + movs r0, 0x40 + bl sub_80338C4 + b _08033D40 +_08033D2E: + movs r0, 0x2B + bl sub_80338C4 + b _08033D40 +_08033D36: + bl sub_80338DC + movs r0, 0x8 + bl sub_80338C4 +_08033D40: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8033CAC + + thumb_func_start sub_8033D48 +sub_8033D48: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08033D5C + movs r0, 0x1 + bl sub_80338C4 +_08033D5C: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8033D48 + + thumb_func_start nullsub_42 +nullsub_42: + bx lr + thumb_func_end nullsub_42 + + thumb_func_start nullsub_43 +nullsub_43: + bx lr + thumb_func_end nullsub_43 + + thumb_func_start nullsub_44 +nullsub_44: + bx lr + thumb_func_end nullsub_44 + + thumb_func_start nullsub_45 +nullsub_45: + bx lr + thumb_func_end nullsub_45 + + thumb_func_start sub_8033D74 +sub_8033D74: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08033D8E + movs r0, 0x17 + bl sub_80338C4 + movs r0, 0 + bl sub_8012574 +_08033D8E: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8033D74 + + thumb_func_start sub_8033D94 +sub_8033D94: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08033DB6 + bl sub_8012600 + lsls r0, 24 + cmp r0, 0 + bne _08033DB6 + bl sub_8012750 + movs r0, 0x18 + bl sub_80338C4 +_08033DB6: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8033D94 + + thumb_func_start sub_8033DBC +sub_8033DBC: + push {r4,lr} + sub sp, 0x44 + bl sub_80154F0 + adds r4, r0, 0 + add r0, sp, 0x14 + movs r1, 0 + movs r2, 0x30 + bl MemoryFill8 + cmp r4, 0x2 + bne _08033DD6 + b _08033F38 +_08033DD6: + cmp r4, 0x3 + beq _08033DDC + b _08033F58 +_08033DDC: + ldr r2, _08033DF4 + ldr r1, _08033DF8 + ldr r0, [r1] + movs r3, 0xA5 + lsls r3, 3 + adds r0, r3 + ldr r0, [r0] + cmp r0, 0x3 + beq _08033DFC + cmp r0, 0x12 + beq _08033E00 + b _08033E02 + .align 2, 0 +_08033DF4: .4byte 0x0000ffdc +_08033DF8: .4byte gUnknown_203B33C +_08033DFC: + movs r2, 0x1C + b _08033E02 +_08033E00: + movs r2, 0x1E +_08033E02: + ldr r1, [r1] + adds r1, 0x8 + adds r0, r2, 0 + add r2, sp, 0x14 + bl sub_8039068 + subs r0, 0x7 + cmp r0, 0x11 + bls _08033E16 + b _08033F2E +_08033E16: + lsls r0, 2 + ldr r1, _08033E20 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08033E20: .4byte _08033E24 + .align 2, 0 +_08033E24: + .4byte _08033EA0 + .4byte _08033F2E + .4byte _08033EE0 + .4byte _08033F2E + .4byte _08033F2E + .4byte _08033F2E + .4byte _08033F2E + .4byte _08033F2E + .4byte _08033F2E + .4byte _08033F2E + .4byte _08033E6C + .4byte _08033E98 + .4byte _08033ED8 + .4byte _08033F2E + .4byte _08033F2E + .4byte _08033EA8 + .4byte _08033EFC + .4byte _08033F2E +_08033E6C: + ldr r0, _08033E90 + ldr r3, _08033E94 + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + str r2, [sp, 0xC] + adds r1, 0xFD + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0x6 + bl sub_8014248 + movs r0, 0x1B + bl sub_80338C4 + b _08033F2E + .align 2, 0 +_08033E90: .4byte gUnknown_80E48A8 +_08033E94: .4byte gUnknown_80E2290 +_08033E98: + ldr r0, _08033E9C + b _08033EE2 + .align 2, 0 +_08033E9C: .4byte gUnknown_80E48E8 +_08033EA0: + ldr r0, _08033EA4 + b _08033EE2 + .align 2, 0 +_08033EA4: .4byte gUnknown_80E460C +_08033EA8: + ldr r0, [sp, 0x24] + bl sub_8095274 + add r1, sp, 0x14 + movs r0, 0x2 + strb r0, [r1] + adds r0, r1, 0 + bl sub_80951BC + ldr r0, _08033ED0 + ldr r3, _08033ED4 + movs r1, 0 + movs r2, 0 + bl sub_80141B4 + movs r0, 0x16 + bl sub_80338C4 + b _08033F2E + .align 2, 0 +_08033ED0: .4byte gUnknown_80E4928 +_08033ED4: .4byte 0x00000101 +_08033ED8: + ldr r0, _08033EDC + b _08033EE2 + .align 2, 0 +_08033EDC: .4byte gUnknown_80E4964 +_08033EE0: + ldr r0, _08033EF4 +_08033EE2: + ldr r3, _08033EF8 + movs r1, 0 + movs r2, 0 + bl sub_80141B4 + movs r0, 0x8 + bl sub_80338C4 + b _08033F2E + .align 2, 0 +_08033EF4: .4byte gUnknown_80E499C +_08033EF8: .4byte 0x00000101 +_08033EFC: + add r1, sp, 0x14 + movs r0, 0x5 + strb r0, [r1] + adds r0, r1, 0 + bl sub_80951FC + ldr r1, [sp, 0x24] + movs r0, 0x1 + bl sub_809539C + lsls r0, 24 + lsrs r0, 24 + bl sub_8095228 + movs r1, 0x7 + strb r1, [r0] + ldr r0, _08033F34 + ldr r0, [r0] + movs r1, 0 + movs r2, 0x5C + bl MemoryFill8 + movs r0, 0x40 + bl sub_80338C4 +_08033F2E: + bl sub_80155F0 + b _08033F58 + .align 2, 0 +_08033F34: .4byte gUnknown_203B484 +_08033F38: + bl sub_80155F0 + bl sub_8004914 + ldr r0, _08033F60 + ldr r0, [r0] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0x1 + bl sub_80338C4 +_08033F58: + add sp, 0x44 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08033F60: .4byte gUnknown_203B33C + thumb_func_end sub_8033DBC + + thumb_func_start sub_8033F64 +sub_8033F64: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08033FAE + ldr r0, [sp] + cmp r0, 0x6 + beq _08033F7E + cmp r0, 0x8 + beq _08033FA8 + b _08033FAE +_08033F7E: + ldr r0, _08033F94 + ldr r0, [r0] + movs r1, 0xA5 + lsls r1, 3 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0x3 + beq _08033F98 + cmp r0, 0x12 + beq _08033FA0 + b _08033FAE + .align 2, 0 +_08033F94: .4byte gUnknown_203B33C +_08033F98: + movs r0, 0x19 + bl sub_80338C4 + b _08033FAE +_08033FA0: + movs r0, 0x43 + bl sub_80338C4 + b _08033FAE +_08033FA8: + movs r0, 0x1 + bl sub_80338C4 +_08033FAE: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8033F64 + + thumb_func_start sub_8033FB4 +sub_8033FB4: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08033FDE + ldr r0, [sp] + cmp r0, 0x6 + bne _08033FD0 + movs r0, 0xE + bl sub_80338C4 + b _08033FDE +_08033FD0: + cmp r0, 0x6 + blt _08033FDE + cmp r0, 0x8 + bgt _08033FDE + movs r0, 0x1 + bl sub_80338C4 +_08033FDE: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8033FB4 + + thumb_func_start sub_8033FE4 +sub_8033FE4: + push {r4,r5,lr} + movs r0, 0x1 + bl sub_8030768 + cmp r0, 0x3 + beq _0803400C + cmp r0, 0x3 + bhi _08033FFA + cmp r0, 0x2 + beq _08034000 + b _0803406A +_08033FFA: + cmp r0, 0x4 + beq _08034028 + b _0803406A +_08034000: + bl sub_803084C + movs r0, 0x1 + bl sub_80338C4 + b _0803406A +_0803400C: + bl sub_80307EC + ldr r1, _08034024 + ldr r1, [r1] + movs r2, 0x86 + lsls r2, 2 + adds r1, r2 + strb r0, [r1] + movs r0, 0x1E + bl sub_80338C4 + b _0803406A + .align 2, 0 +_08034024: .4byte gUnknown_203B33C +_08034028: + ldr r4, _08034070 + ldr r1, [r4] + movs r0, 0x1D + str r0, [r1, 0x4] + bl sub_80307EC + ldr r1, [r4] + movs r5, 0x86 + lsls r5, 2 + adds r1, r5 + strb r0, [r1] + ldr r0, [r4] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + bl sub_8006518 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + adds r0, r5 + ldrb r0, [r0] + movs r1, 0 + bl sub_8030D40 + movs r0, 0x1F + bl sub_80338C4 +_0803406A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08034070: .4byte gUnknown_203B33C + thumb_func_end sub_8033FE4 + + thumb_func_start sub_8034074 +sub_8034074: + push {r4,lr} + sub sp, 0x4 + movs r0, 0x1 + negs r0, r0 + str r0, [sp] + movs r0, 0 + bl sub_8030768 + ldr r4, _080340B8 + ldr r0, [r4] + movs r1, 0xC3 + lsls r1, 2 + adds r0, r1 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _080340A6 + ldr r0, [r4] + movs r1, 0xC3 + lsls r1, 2 + adds r0, r1 + mov r1, sp + bl sub_8013114 +_080340A6: + ldr r0, [sp] + cmp r0, 0x8 + beq _08034108 + cmp r0, 0x8 + bgt _080340BC + cmp r0, 0x5 + beq _08034108 + b _08034124 + .align 2, 0 +_080340B8: .4byte gUnknown_203B33C +_080340BC: + cmp r0, 0x9 + beq _080340C6 + cmp r0, 0xA + beq _080340D2 + b _08034124 +_080340C6: + bl sub_803084C + movs r0, 0x20 + bl sub_80338C4 + b _08034124 +_080340D2: + ldr r0, [r4] + movs r1, 0x7E + str r1, [r0, 0x4] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + bl sub_8006518 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0 + bl sub_8030D40 + movs r0, 0x1F + bl sub_80338C4 + b _08034124 +_08034108: + ldr r0, _0803412C + ldr r0, [r0] + movs r1, 0xD7 + lsls r1, 2 + adds r0, r1 + movs r1, 0x2 + bl sub_8035CC0 + movs r0, 0x1 + bl sub_8030810 + movs r0, 0x1D + bl sub_80338C4 +_08034124: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0803412C: .4byte gUnknown_203B33C + thumb_func_end sub_8034074 + + thumb_func_start sub_8034130 +sub_8034130: + push {r4,lr} + bl sub_8030DA0 + cmp r0, 0x3 + bhi _08034184 + cmp r0, 0x2 + bcc _08034184 + bl sub_8030DE4 + bl sub_8004914 + ldr r4, _0803417C + ldr r0, [r4] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + bl sub_803092C + ldr r4, [r4] + ldr r0, [r4, 0x4] + cmp r0, 0x7E + bne _08034180 + movs r1, 0x87 + lsls r1, 2 + adds r0, r4, r1 + movs r1, 0x3 + movs r2, 0x1 + bl sub_8035CF4 + movs r0, 0x1E + bl sub_80338C4 + b _08034184 + .align 2, 0 +_0803417C: .4byte gUnknown_203B33C +_08034180: + bl sub_80338C4 +_08034184: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8034130 + + thumb_func_start sub_803418C +sub_803418C: + push {r4,r5,lr} + movs r0, 0x1 + bl sub_8023A94 + cmp r0, 0x3 + beq _080341D0 + cmp r0, 0x3 + bhi _080341A2 + cmp r0, 0x2 + beq _080341A8 + b _08034248 +_080341A2: + cmp r0, 0x4 + beq _08034204 + b _08034248 +_080341A8: + bl sub_8023C60 + movs r0, 0x1 + bl sub_80338C4 + bl sub_8035D1C + ldr r0, _080341C8 + ldr r0, [r0] + movs r1, 0xA7 + lsls r1, 3 + adds r0, r1 + ldr r1, _080341CC + strh r1, [r0] + b _08034248 + .align 2, 0 +_080341C8: .4byte gUnknown_203B33C +_080341CC: .4byte 0x0000ffff +_080341D0: + bl sub_8023B44 + ldr r1, _080341F4 + ldr r1, [r1] + movs r3, 0xA7 + lsls r3, 3 + adds r2, r1, r3 + strh r0, [r2] + ldr r0, _080341F8 + adds r1, r0 + ldr r0, [r1] + cmp r0, 0xE + bne _080341FC + movs r0, 0x9 + bl sub_80338C4 + b _08034248 + .align 2, 0 +_080341F4: .4byte gUnknown_203B33C +_080341F8: .4byte 0x00000524 +_080341FC: + movs r0, 0x27 + bl sub_80338C4 + b _08034248 +_08034204: + ldr r4, _08034250 + ldr r1, [r4] + movs r0, 0x26 + str r0, [r1, 0x4] + bl sub_8023B44 + adds r2, r0, 0 + ldr r0, [r4] + movs r5, 0xA7 + lsls r5, 3 + adds r1, r0, r5 + strh r2, [r1] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + bl sub_8006518 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + adds r0, r5 + movs r3, 0 + ldrsh r0, [r0, r3] + movs r1, 0 + bl sub_8024458 + movs r0, 0x28 + bl sub_80338C4 +_08034248: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08034250: .4byte gUnknown_203B33C + thumb_func_end sub_803418C + + thumb_func_start sub_8034254 +sub_8034254: + push {r4,lr} + sub sp, 0x4 + movs r0, 0x1 + negs r0, r0 + str r0, [sp] + movs r0, 0 + bl sub_8023A94 + ldr r4, _08034298 + ldr r0, [r4] + movs r1, 0xC3 + lsls r1, 2 + adds r0, r1 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _08034286 + ldr r0, [r4] + movs r1, 0xC3 + lsls r1, 2 + adds r0, r1 + mov r1, sp + bl sub_8013114 +_08034286: + ldr r0, [sp] + cmp r0, 0x8 + beq _080342EA + cmp r0, 0x8 + bgt _0803429C + cmp r0, 0x5 + beq _080342EA + b _08034304 + .align 2, 0 +_08034298: .4byte gUnknown_203B33C +_0803429C: + cmp r0, 0x9 + beq _080342A6 + cmp r0, 0xA + beq _080342B2 + b _08034304 +_080342A6: + bl sub_8023C60 + movs r0, 0x29 + bl sub_80338C4 + b _08034304 +_080342B2: + ldr r0, [r4] + movs r1, 0x7E + str r1, [r0, 0x4] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + bl sub_8006518 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + movs r1, 0xA7 + lsls r1, 3 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + movs r1, 0 + bl sub_8024458 + movs r0, 0x28 + bl sub_80338C4 + b _08034304 +_080342EA: + ldr r0, _0803430C + ldr r0, [r0] + movs r1, 0xD7 + lsls r1, 2 + adds r0, r1 + movs r1, 0x3 + bl sub_8035CC0 + bl sub_8023DA4 + movs r0, 0x26 + bl sub_80338C4 +_08034304: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0803430C: .4byte gUnknown_203B33C + thumb_func_end sub_8034254 + + thumb_func_start sub_8034310 +sub_8034310: + push {r4,lr} + bl sub_80244E4 + cmp r0, 0x1 + bne _08034320 + bl sub_802452C + b _08034370 +_08034320: + cmp r0, 0x1 + bcc _08034370 + cmp r0, 0x3 + bhi _08034370 + bl sub_802453C + bl sub_8004914 + ldr r4, _08034368 + ldr r0, [r4] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0x1 + bl sub_8023B7C + ldr r4, [r4] + ldr r0, [r4, 0x4] + cmp r0, 0x7E + bne _0803436C + movs r1, 0x87 + lsls r1, 2 + adds r0, r4, r1 + movs r1, 0x3 + movs r2, 0x1 + bl sub_8035CF4 + movs r0, 0x27 + bl sub_80338C4 + b _08034370 + .align 2, 0 +_08034368: .4byte gUnknown_203B33C +_0803436C: + bl sub_80338C4 +_08034370: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8034310 + + thumb_func_start sub_8034378 +sub_8034378: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080343BE + ldr r0, [sp] + cmp r0, 0x8 + beq _080343B8 + cmp r0, 0x10 + bne _080343BE + ldr r0, _080343A8 + ldr r0, [r0] + ldr r1, _080343AC + adds r0, r1 + ldr r0, [r0] + cmp r0, 0xE + bne _080343B0 + movs r0, 0x9 + bl sub_80338C4 + b _080343BE + .align 2, 0 +_080343A8: .4byte gUnknown_203B33C +_080343AC: .4byte 0x00000524 +_080343B0: + movs r0, 0x5 + bl sub_80338C4 + b _080343BE +_080343B8: + movs r0, 0x1 + bl sub_80338C4 +_080343BE: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8034378 + + thumb_func_start sub_80343C4 +sub_80343C4: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080343FE + ldr r0, [sp] + cmp r0, 0x7 + beq _080343F0 + cmp r0, 0x7 + bgt _080343E2 + cmp r0, 0x6 + beq _080343E8 + b _080343FE +_080343E2: + cmp r0, 0x8 + beq _080343F8 + b _080343FE +_080343E8: + movs r0, 0x5 + bl sub_80338C4 + b _080343FE +_080343F0: + movs r0, 0x25 + bl sub_80338C4 + b _080343FE +_080343F8: + movs r0, 0x1 + bl sub_80338C4 +_080343FE: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80343C4 + + thumb_func_start sub_8034404 +sub_8034404: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08034472 + ldr r0, [sp] + cmp r0, 0xF + beq _08034428 + cmp r0, 0xF + bgt _08034422 + cmp r0, 0x8 + beq _0803446C + b _08034472 +_08034422: + cmp r0, 0x10 + beq _08034444 + b _08034472 +_08034428: + movs r0, 0x3 + bl sub_8024108 + lsls r0, 24 + cmp r0, 0 + beq _0803443C + movs r0, 0x24 + bl sub_80338C4 + b _08034472 +_0803443C: + movs r0, 0x25 + bl sub_80338C4 + b _08034472 +_08034444: + ldr r0, _0803445C + ldr r0, [r0] + ldr r1, _08034460 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0xE + bne _08034464 + movs r0, 0x9 + bl sub_80338C4 + b _08034472 + .align 2, 0 +_0803445C: .4byte gUnknown_203B33C +_08034460: .4byte 0x00000524 +_08034464: + movs r0, 0x5 + bl sub_80338C4 + b _08034472 +_0803446C: + movs r0, 0x1 + bl sub_80338C4 +_08034472: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8034404 + + thumb_func_start sub_8034478 +sub_8034478: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0803449A + bl sub_8012600 + lsls r0, 24 + cmp r0, 0 + bne _0803449A + bl sub_8012750 + movs r0, 0x2 + bl sub_80338C4 +_0803449A: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8034478 + + thumb_func_start sub_80344A0 +sub_80344A0: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080344BA + movs r0, 0x2C + bl sub_80338C4 + movs r0, 0 + bl sub_8012574 +_080344BA: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80344A0 + + thumb_func_start sub_80344C0 +sub_80344C0: + push {lr} + bl sub_8031DCC + cmp r0, 0x1 + beq _080344F8 + cmp r0, 0x1 + bcc _080344FC + cmp r0, 0x3 + bhi _080344FC + bl sub_8031E10 + bl sub_8004914 + ldr r0, _080344F4 + ldr r0, [r0] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0x2F + bl sub_80338C4 + b _080344FC + .align 2, 0 +_080344F4: .4byte gUnknown_203B33C +_080344F8: + bl sub_8031E00 +_080344FC: + pop {r0} + bx r0 + thumb_func_end sub_80344C0 + + thumb_func_start sub_8034500 +sub_8034500: + push {r4,r5,lr} + movs r0, 0x1 + bl sub_8030768 + cmp r0, 0x3 + beq _08034528 + cmp r0, 0x3 + bhi _08034516 + cmp r0, 0x2 + beq _0803451C + b _08034586 +_08034516: + cmp r0, 0x4 + beq _08034544 + b _08034586 +_0803451C: + bl sub_803084C + movs r0, 0x1 + bl sub_80338C4 + b _08034586 +_08034528: + bl sub_80307EC + ldr r1, _08034540 + ldr r1, [r1] + movs r2, 0x86 + lsls r2, 2 + adds r1, r2 + strb r0, [r1] + movs r0, 0x33 + bl sub_80338C4 + b _08034586 + .align 2, 0 +_08034540: .4byte gUnknown_203B33C +_08034544: + ldr r4, _0803458C + ldr r1, [r4] + movs r0, 0x32 + str r0, [r1, 0x4] + bl sub_80307EC + ldr r1, [r4] + movs r5, 0x86 + lsls r5, 2 + adds r1, r5 + strb r0, [r1] + ldr r0, [r4] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + bl sub_8006518 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + adds r0, r5 + ldrb r0, [r0] + movs r1, 0 + bl sub_8030D40 + movs r0, 0x34 + bl sub_80338C4 +_08034586: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0803458C: .4byte gUnknown_203B33C + thumb_func_end sub_8034500 + + thumb_func_start sub_8034590 +sub_8034590: + push {r4,lr} + sub sp, 0x4 + movs r0, 0x1 + negs r0, r0 + str r0, [sp] + movs r0, 0 + bl sub_8030768 + ldr r4, _080345D4 + ldr r0, [r4] + movs r1, 0xC3 + lsls r1, 2 + adds r0, r1 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _080345C2 + ldr r0, [r4] + movs r1, 0xC3 + lsls r1, 2 + adds r0, r1 + mov r1, sp + bl sub_8013114 +_080345C2: + ldr r0, [sp] + cmp r0, 0x8 + beq _08034624 + cmp r0, 0x8 + bgt _080345D8 + cmp r0, 0x5 + beq _08034624 + b _08034640 + .align 2, 0 +_080345D4: .4byte gUnknown_203B33C +_080345D8: + cmp r0, 0x9 + beq _080345E2 + cmp r0, 0xA + beq _080345EE + b _08034640 +_080345E2: + bl sub_803084C + movs r0, 0x35 + bl sub_80338C4 + b _08034640 +_080345EE: + ldr r0, [r4] + movs r1, 0x7E + str r1, [r0, 0x4] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + bl sub_8006518 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0 + bl sub_8030D40 + movs r0, 0x34 + bl sub_80338C4 + b _08034640 +_08034624: + ldr r0, _08034648 + ldr r0, [r0] + movs r1, 0xD7 + lsls r1, 2 + adds r0, r1 + movs r1, 0x2 + bl sub_8035CC0 + movs r0, 0x1 + bl sub_8030810 + movs r0, 0x32 + bl sub_80338C4 +_08034640: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08034648: .4byte gUnknown_203B33C + thumb_func_end sub_8034590 + + thumb_func_start sub_803464C +sub_803464C: + push {r4,lr} + bl sub_8030DA0 + cmp r0, 0x3 + bhi _080346A0 + cmp r0, 0x2 + bcc _080346A0 + bl sub_8030DE4 + bl sub_8004914 + ldr r4, _08034698 + ldr r0, [r4] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + bl sub_803092C + ldr r4, [r4] + ldr r0, [r4, 0x4] + cmp r0, 0x7E + bne _0803469C + movs r1, 0x87 + lsls r1, 2 + adds r0, r4, r1 + movs r1, 0x3 + movs r2, 0x1 + bl sub_8035CF4 + movs r0, 0x33 + bl sub_80338C4 + b _080346A0 + .align 2, 0 +_08034698: .4byte gUnknown_203B33C +_0803469C: + bl sub_80338C4 +_080346A0: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_803464C + + thumb_func_start sub_80346A8 +sub_80346A8: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080346D2 + ldr r0, [sp] + cmp r0, 0x6 + bne _080346C4 + movs r0, 0xE + bl sub_80338C4 + b _080346D2 +_080346C4: + cmp r0, 0x6 + blt _080346D2 + cmp r0, 0x8 + bgt _080346D2 + movs r0, 0x1 + bl sub_80338C4 +_080346D2: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80346A8 + + thumb_func_start sub_80346D8 +sub_80346D8: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080346FA + bl sub_8012600 + lsls r0, 24 + cmp r0, 0 + bne _080346FA + bl sub_8012750 + movs r0, 0x2 + bl sub_80338C4 +_080346FA: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80346D8 + + thumb_func_start sub_8034700 +sub_8034700: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0803471A + movs r0, 0x38 + bl sub_80338C4 + movs r0, 0 + bl sub_8012574 +_0803471A: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8034700 + + thumb_func_start sub_8034720 +sub_8034720: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08034734 + movs r0, 0x3A + bl sub_80338C4 +_08034734: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8034720 + + thumb_func_start sub_803473C +sub_803473C: + push {lr} + bl sub_8031DCC + cmp r0, 0x1 + beq _08034774 + cmp r0, 0x1 + bcc _08034778 + cmp r0, 0x3 + bhi _08034778 + bl sub_8031E10 + bl sub_8004914 + ldr r0, _08034770 + ldr r0, [r0] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0x3B + bl sub_80338C4 + b _08034778 + .align 2, 0 +_08034770: .4byte gUnknown_203B33C +_08034774: + bl sub_8031E00 +_08034778: + pop {r0} + bx r0 + thumb_func_end sub_803473C + + thumb_func_start sub_803477C +sub_803477C: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080347A6 + ldr r0, [sp] + cmp r0, 0x6 + bne _08034798 + movs r0, 0xE + bl sub_80338C4 + b _080347A6 +_08034798: + cmp r0, 0x6 + blt _080347A6 + cmp r0, 0x8 + bgt _080347A6 + movs r0, 0x1 + bl sub_80338C4 +_080347A6: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_803477C + + thumb_func_start sub_80347AC +sub_80347AC: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080347C0 + movs r0, 0xD + bl sub_80338C4 +_080347C0: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80347AC + + thumb_func_start sub_80347C8 +sub_80347C8: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080347DC + movs r0, 0x40 + bl sub_80338C4 +_080347DC: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80347C8 + + thumb_func_start sub_80347E4 +sub_80347E4: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080347FE + movs r0, 0x41 + bl sub_80338C4 + movs r0, 0 + bl sub_8012574 +_080347FE: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80347E4 + + thumb_func_start sub_8034804 +sub_8034804: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08034826 + bl sub_8012600 + lsls r0, 24 + cmp r0, 0 + bne _08034826 + bl sub_8012750 + movs r0, 0x42 + bl sub_80338C4 +_08034826: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8034804 + + thumb_func_start sub_803482C +sub_803482C: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08034840 + movs r0, 0x1 + bl sub_80338C4 +_08034840: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_803482C + + thumb_func_start sub_8034848 +sub_8034848: + push {r4-r6,lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + adds r6, r0, 0 + cmp r6, 0 + bne _080348BA + ldr r4, _0803489C + ldr r0, [r4] + ldr r5, _080348A0 + adds r0, r5 + movs r1, 0 + movs r2, 0x4 + bl MemoryFill8 + ldr r0, [r4] + ldr r1, _080348A4 + adds r0, r1 + strb r6, [r0] + ldr r0, [r4] + subs r1, 0x1 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r4] + adds r0, r5 + strb r6, [r0] + ldr r4, [r4] + ldr r0, [r4, 0x44] + cmp r0, 0 + bne _080348B0 + ldr r4, [r4, 0x40] + cmp r4, 0x6 + beq _080348A8 + cmp r4, 0x7 + bne _080348BA + movs r0, 0x6D + bl sub_80338C4 + b _080348BA + .align 2, 0 +_0803489C: .4byte gUnknown_203B33C +_080348A0: .4byte 0x0000041c +_080348A4: .4byte 0x0000041e +_080348A8: + movs r0, 0x50 + bl sub_80338C4 + b _080348BA +_080348B0: + bl sub_80338DC + movs r0, 0x6B + bl sub_80338C4 +_080348BA: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8034848 + + thumb_func_start sub_80348C4 +sub_80348C4: + push {r4-r6,lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + adds r6, r0, 0 + cmp r6, 0 + bne _08034968 + ldr r4, _08034910 + ldr r0, [r4] + ldr r5, _08034914 + adds r0, r5 + movs r1, 0 + movs r2, 0x4 + bl MemoryFill8 + ldr r0, [r4] + ldr r1, _08034918 + adds r0, r1 + strb r6, [r0] + ldr r0, [r4] + subs r1, 0x1 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r4] + adds r0, r5 + strb r6, [r0] + ldr r0, [r4] + ldr r1, [r0, 0x44] + cmp r1, 0 + bne _0803495C + ldr r1, [r0, 0x40] + cmp r1, 0x6 + beq _0803491C + cmp r1, 0x7 + beq _08034954 + b _08034968 + .align 2, 0 +_08034910: .4byte gUnknown_203B33C +_08034914: .4byte 0x0000041c +_08034918: .4byte 0x0000041e +_0803491C: + ldr r1, _08034930 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0xC + beq _08034944 + cmp r0, 0xC + bhi _08034934 + cmp r0, 0xB + beq _08034938 + b _08034944 + .align 2, 0 +_08034930: .4byte 0x00000524 +_08034934: + cmp r0, 0xE + bhi _08034944 +_08034938: + ldr r0, _0803494C + ldr r3, _08034950 + movs r1, 0 + movs r2, 0 + bl sub_80141B4 +_08034944: + movs r0, 0x77 + bl sub_80338C4 + b _08034968 + .align 2, 0 +_0803494C: .4byte gUnknown_80E31FC +_08034950: .4byte 0x00000101 +_08034954: + movs r0, 0x6D + bl sub_80338C4 + b _08034968 +_0803495C: + adds r0, r1, 0 + bl sub_80338DC + movs r0, 0x6B + bl sub_80338C4 +_08034968: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80348C4 + + thumb_func_start sub_8034970 +sub_8034970: + push {lr} + bl sub_8031DCC + cmp r0, 0x1 + beq _080349A8 + cmp r0, 0x1 + bcc _080349AC + cmp r0, 0x3 + bhi _080349AC + bl sub_8031E10 + bl sub_8004914 + ldr r0, _080349A4 + ldr r0, [r0] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0x68 + bl sub_80338C4 + b _080349AC + .align 2, 0 +_080349A4: .4byte gUnknown_203B33C +_080349A8: + bl sub_8031E00 +_080349AC: + pop {r0} + bx r0 + thumb_func_end sub_8034970 + + thumb_func_start sub_80349B0 +sub_80349B0: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080349DA + ldr r0, [sp] + cmp r0, 0x6 + bne _080349CC + movs r0, 0x52 + bl sub_80338C4 + b _080349DA +_080349CC: + cmp r0, 0x6 + blt _080349DA + cmp r0, 0x8 + bgt _080349DA + movs r0, 0x1 + bl sub_80338C4 +_080349DA: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80349B0 + + thumb_func_start sub_80349E0 +sub_80349E0: + push {r4,r5,lr} + movs r0, 0x1 + bl sub_8030768 + cmp r0, 0x3 + beq _08034A08 + cmp r0, 0x3 + bhi _080349F6 + cmp r0, 0x2 + beq _080349FC + b _08034A66 +_080349F6: + cmp r0, 0x4 + beq _08034A24 + b _08034A66 +_080349FC: + bl sub_803084C + movs r0, 0x1 + bl sub_80338C4 + b _08034A66 +_08034A08: + bl sub_80307EC + ldr r1, _08034A20 + ldr r1, [r1] + movs r2, 0x86 + lsls r2, 2 + adds r1, r2 + strb r0, [r1] + movs r0, 0x5D + bl sub_80338C4 + b _08034A66 + .align 2, 0 +_08034A20: .4byte gUnknown_203B33C +_08034A24: + ldr r4, _08034A6C + ldr r1, [r4] + movs r0, 0x5C + str r0, [r1, 0x4] + bl sub_80307EC + ldr r1, [r4] + movs r5, 0x86 + lsls r5, 2 + adds r1, r5 + strb r0, [r1] + ldr r0, [r4] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + bl sub_8006518 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + adds r0, r5 + ldrb r0, [r0] + movs r1, 0 + bl sub_8030D40 + movs r0, 0x5E + bl sub_80338C4 +_08034A66: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08034A6C: .4byte gUnknown_203B33C + thumb_func_end sub_80349E0 + + thumb_func_start sub_8034A70 +sub_8034A70: + push {r4,lr} + sub sp, 0x4 + movs r0, 0x1 + negs r0, r0 + str r0, [sp] + movs r0, 0 + bl sub_8030768 + ldr r4, _08034AB4 + ldr r0, [r4] + movs r1, 0xC3 + lsls r1, 2 + adds r0, r1 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _08034AA2 + ldr r0, [r4] + movs r1, 0xC3 + lsls r1, 2 + adds r0, r1 + mov r1, sp + bl sub_8013114 +_08034AA2: + ldr r0, [sp] + cmp r0, 0x8 + beq _08034B04 + cmp r0, 0x8 + bgt _08034AB8 + cmp r0, 0x5 + beq _08034B04 + b _08034B20 + .align 2, 0 +_08034AB4: .4byte gUnknown_203B33C +_08034AB8: + cmp r0, 0x9 + beq _08034AC2 + cmp r0, 0xA + beq _08034ACE + b _08034B20 +_08034AC2: + bl sub_803084C + movs r0, 0x5A + bl sub_80338C4 + b _08034B20 +_08034ACE: + ldr r0, [r4] + movs r1, 0x7E + str r1, [r0, 0x4] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + bl sub_8006518 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0 + bl sub_8030D40 + movs r0, 0x5E + bl sub_80338C4 + b _08034B20 +_08034B04: + ldr r0, _08034B28 + ldr r0, [r0] + movs r1, 0xD7 + lsls r1, 2 + adds r0, r1 + movs r1, 0x2 + bl sub_8035CC0 + movs r0, 0x1 + bl sub_8030810 + movs r0, 0x5C + bl sub_80338C4 +_08034B20: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08034B28: .4byte gUnknown_203B33C + thumb_func_end sub_8034A70 + + thumb_func_start sub_8034B2C +sub_8034B2C: + push {r4,lr} + bl sub_8030DA0 + cmp r0, 0x3 + bhi _08034B80 + cmp r0, 0x2 + bcc _08034B80 + bl sub_8030DE4 + bl sub_8004914 + ldr r4, _08034B78 + ldr r0, [r4] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + bl sub_803092C + ldr r4, [r4] + ldr r0, [r4, 0x4] + cmp r0, 0x7E + bne _08034B7C + movs r1, 0x87 + lsls r1, 2 + adds r0, r4, r1 + movs r1, 0x3 + movs r2, 0x1 + bl sub_8035CF4 + movs r0, 0x5D + bl sub_80338C4 + b _08034B80 + .align 2, 0 +_08034B78: .4byte gUnknown_203B33C +_08034B7C: + bl sub_80338C4 +_08034B80: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8034B2C + + thumb_func_start sub_8034B88 +sub_8034B88: + push {r4-r6,lr} + ldr r4, _08034BBC + ldr r0, [r4] + ldr r5, _08034BC0 + adds r0, r5 + movs r2, 0 + strb r2, [r0] + ldr r0, [r4] + ldr r1, _08034BC4 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r4] + ldr r6, _08034BC8 + adds r0, r6 + strb r2, [r0] + movs r0, 0x1 + bl sub_801CA08 + cmp r0, 0x3 + beq _08034BDE + cmp r0, 0x3 + bhi _08034BCC + cmp r0, 0x2 + beq _08034BD2 + b _08034C30 + .align 2, 0 +_08034BBC: .4byte gUnknown_203B33C +_08034BC0: .4byte 0x0000041e +_08034BC4: .4byte 0x0000041d +_08034BC8: .4byte 0x0000041c +_08034BCC: + cmp r0, 0x4 + beq _08034BF8 + b _08034C30 +_08034BD2: + bl sub_801CBB8 + movs r0, 0x1 + bl sub_80338C4 + b _08034C30 +_08034BDE: + bl sub_801CB24 + ldr r1, [r4] + ldr r2, _08034BF4 + adds r1, r2 + strb r0, [r1] + movs r0, 0x60 + bl sub_80338C4 + b _08034C30 + .align 2, 0 +_08034BF4: .4byte 0x0000041e +_08034BF8: + ldr r1, [r4] + movs r0, 0x5F + str r0, [r1, 0x4] + bl sub_801CB24 + ldr r1, [r4] + adds r1, r5 + strb r0, [r1] + ldr r0, [r4] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + bl sub_8006518 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + adds r0, r6 + bl sub_801B3C0 + movs r0, 0x61 + bl sub_80338C4 +_08034C30: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8034B88 + + thumb_func_start sub_8034C38 +sub_8034C38: + push {r4,lr} + bl sub_801B410 + cmp r0, 0x1 + beq _08034C90 + cmp r0, 0x1 + bcc _08034C90 + cmp r0, 0x3 + bhi _08034C90 + bl sub_801B450 + bl sub_8004914 + ldr r4, _08034C88 + ldr r0, [r4] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0x1 + bl sub_801CB5C + ldr r4, [r4] + ldr r0, [r4, 0x4] + cmp r0, 0x7E + bne _08034C8C + movs r1, 0x87 + lsls r1, 2 + adds r0, r4, r1 + movs r1, 0x3 + movs r2, 0x1 + bl sub_8035CF4 + movs r0, 0x60 + bl sub_80338C4 + b _08034C90 + .align 2, 0 +_08034C88: .4byte gUnknown_203B33C +_08034C8C: + bl sub_80338C4 +_08034C90: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8034C38 + + thumb_func_start sub_8034C98 +sub_8034C98: + push {r4,lr} + sub sp, 0x4 + movs r0, 0x1 + negs r0, r0 + str r0, [sp] + movs r0, 0 + bl sub_801CA08 + ldr r4, _08034CDC + ldr r0, [r4] + movs r1, 0xC3 + lsls r1, 2 + adds r0, r1 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _08034CCA + ldr r0, [r4] + movs r1, 0xC3 + lsls r1, 2 + adds r0, r1 + mov r1, sp + bl sub_8013114 +_08034CCA: + ldr r0, [sp] + cmp r0, 0x8 + beq _08034D2C + cmp r0, 0x8 + bgt _08034CE0 + cmp r0, 0x5 + beq _08034D2C + b _08034D48 + .align 2, 0 +_08034CDC: .4byte gUnknown_203B33C +_08034CE0: + cmp r0, 0x9 + beq _08034CEA + cmp r0, 0xA + beq _08034CF6 + b _08034D48 +_08034CEA: + bl sub_801CBB8 + movs r0, 0x58 + bl sub_80338C4 + b _08034D48 +_08034CF6: + ldr r0, [r4] + movs r1, 0x7E + str r1, [r0, 0x4] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + bl sub_8006518 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + ldr r1, _08034D28 + adds r0, r1 + bl sub_801B3C0 + movs r0, 0x61 + bl sub_80338C4 + b _08034D48 + .align 2, 0 +_08034D28: .4byte 0x0000041c +_08034D2C: + ldr r0, _08034D50 + ldr r0, [r0] + movs r1, 0xD7 + lsls r1, 2 + adds r0, r1 + movs r1, 0x3 + bl sub_8035CC0 + movs r0, 0x1 + bl sub_801CB5C + movs r0, 0x5F + bl sub_80338C4 +_08034D48: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08034D50: .4byte gUnknown_203B33C + thumb_func_end sub_8034C98 + + thumb_func_start sub_8034D54 +sub_8034D54: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08034D6E + movs r0, 0x65 + bl sub_80338C4 + movs r0, 0 + bl sub_8012574 +_08034D6E: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8034D54 + + thumb_func_start sub_8034D74 +sub_8034D74: + push {r4,r5,lr} + sub sp, 0x44 + bl sub_80154F0 + adds r4, r0, 0 + add r0, sp, 0x14 + movs r1, 0 + movs r2, 0x30 + bl MemoryFill8 + cmp r4, 0x2 + bne _08034D8E + b _08034E9C +_08034D8E: + cmp r4, 0x3 + beq _08034D94 + b _08034EBC +_08034D94: + ldr r0, _08034DB4 + ldr r1, [r0] + adds r1, 0x8 + movs r0, 0x20 + add r2, sp, 0x14 + bl sub_8039068 + subs r0, 0x7 + cmp r0, 0x11 + bhi _08034E90 + lsls r0, 2 + ldr r1, _08034DB8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08034DB4: .4byte gUnknown_203B33C +_08034DB8: .4byte _08034DBC + .align 2, 0 +_08034DBC: + .4byte _08034E90 + .4byte _08034E90 + .4byte _08034E90 + .4byte _08034E90 + .4byte _08034E38 + .4byte _08034E90 + .4byte _08034E90 + .4byte _08034E90 + .4byte _08034E90 + .4byte _08034E90 + .4byte _08034E04 + .4byte _08034E90 + .4byte _08034E90 + .4byte _08034E30 + .4byte _08034E90 + .4byte _08034E90 + .4byte _08034E90 + .4byte _08034E54 +_08034E04: + ldr r0, _08034E28 + ldr r3, _08034E2C + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + str r2, [sp, 0xC] + adds r1, 0xFD + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0x6 + bl sub_8014248 + movs r0, 0x74 + bl sub_80338C4 + b _08034E90 + .align 2, 0 +_08034E28: .4byte gUnknown_80E48A8 +_08034E2C: .4byte gUnknown_80E2440 +_08034E30: + ldr r0, _08034E34 + b _08034E3A + .align 2, 0 +_08034E34: .4byte gUnknown_80E49C4 +_08034E38: + ldr r0, _08034E4C +_08034E3A: + ldr r3, _08034E50 + movs r1, 0 + movs r2, 0 + bl sub_80141B4 + movs r0, 0x6B + bl sub_80338C4 + b _08034E90 + .align 2, 0 +_08034E4C: .4byte gUnknown_80E4704 +_08034E50: .4byte 0x00000101 +_08034E54: + ldr r1, [sp, 0x24] + movs r0, 0x4 + bl sub_809539C + lsls r0, 24 + lsrs r0, 24 + bl sub_8095228 + adds r2, r0, 0 + add r1, sp, 0x14 + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + movs r1, 0x6 + strb r1, [r0] + ldr r0, _08034E98 + ldr r0, [r0] + movs r1, 0x84 + lsls r1, 3 + adds r0, r1 + ldr r1, [sp, 0x24] + str r1, [r0] + movs r0, 0x6D + bl sub_80338C4 +_08034E90: + bl sub_80155F0 + b _08034EBC + .align 2, 0 +_08034E98: .4byte gUnknown_203B33C +_08034E9C: + bl sub_80155F0 + bl sub_8004914 + ldr r0, _08034EC4 + ldr r0, [r0] + movs r3, 0xEF + lsls r3, 2 + adds r0, r3 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0x1 + bl sub_80338C4 +_08034EBC: + add sp, 0x44 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08034EC4: .4byte gUnknown_203B33C + thumb_func_end sub_8034D74 + + thumb_func_start sub_8034EC8 +sub_8034EC8: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08034EEA + bl sub_8012600 + lsls r0, 24 + cmp r0, 0 + bne _08034EEA + bl sub_8012750 + movs r0, 0x2 + bl sub_80338C4 +_08034EEA: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8034EC8 + + thumb_func_start sub_8034EF0 +sub_8034EF0: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08034F12 + bl sub_8012600 + lsls r0, 24 + cmp r0, 0 + bne _08034F12 + bl sub_8012750 + movs r0, 0x2 + bl sub_80338C4 +_08034F12: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8034EF0 + + thumb_func_start sub_8034F18 +sub_8034F18: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08034F32 + movs r0, 0x65 + bl sub_80338C4 + movs r0, 0 + bl sub_8012574 +_08034F32: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8034F18 + + thumb_func_start sub_8034F38 +sub_8034F38: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08034F52 + movs r0, 0x71 + bl sub_80338C4 + movs r0, 0 + bl sub_8012574 +_08034F52: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8034F38 + + thumb_func_start sub_8034F58 +sub_8034F58: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08034F80 + ldr r0, [sp] + cmp r0, 0x6 + beq _08034F72 + cmp r0, 0x8 + beq _08034F7A + b _08034F80 +_08034F72: + movs r0, 0x62 + bl sub_80338C4 + b _08034F80 +_08034F7A: + movs r0, 0x1 + bl sub_80338C4 +_08034F80: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8034F58 + + thumb_func_start sub_8034F88 +sub_8034F88: + push {r4,r5,lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0803500E + ldr r0, [sp] + cmp r0, 0x7 + beq _08035000 + cmp r0, 0x7 + bgt _08034FA6 + cmp r0, 0x6 + beq _08034FAC + b _0803500E +_08034FA6: + cmp r0, 0x8 + beq _08035008 + b _0803500E +_08034FAC: + ldr r4, _08034FF0 + ldr r0, [r4] + movs r1, 0x86 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + bl sub_8095228 + adds r2, r0, 0 + ldr r1, [r4] + ldr r3, _08034FF4 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + beq _08034FD2 + ldr r5, _08034FF8 + adds r0, r1, r5 + ldr r0, [r0] + str r0, [r2, 0x20] +_08034FD2: + ldr r0, _08034FFC + ldr r1, [r0] + ldr r0, [r4] + adds r0, r3 + ldrb r0, [r0] + lsls r0, 1 + adds r1, 0x50 + adds r1, r0 + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] + movs r0, 0x75 + bl sub_80338C4 + b _0803500E + .align 2, 0 +_08034FF0: .4byte gUnknown_203B33C +_08034FF4: .4byte 0x0000041e +_08034FF8: .4byte 0x0000041c +_08034FFC: .4byte gUnknown_203B460 +_08035000: + movs r0, 0x57 + bl sub_80338C4 + b _0803500E +_08035008: + movs r0, 0x1 + bl sub_80338C4 +_0803500E: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8034F88 + + thumb_func_start sub_8035018 +sub_8035018: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08035032 + movs r0, 0x76 + bl sub_80338C4 + movs r0, 0 + bl sub_8012574 +_08035032: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8035018 + + thumb_func_start sub_8035038 +sub_8035038: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0803508E + bl sub_8012600 + lsls r0, 24 + cmp r0, 0 + bne _0803508E + bl sub_8012750 + ldr r0, _0803506C + ldr r0, [r0] + ldr r1, _08035070 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0xD + beq _08035080 + cmp r0, 0xD + bls _08035074 + cmp r0, 0xE + beq _08035088 + b _0803508E + .align 2, 0 +_0803506C: .4byte gUnknown_203B33C +_08035070: .4byte 0x00000524 +_08035074: + cmp r0, 0xB + bcc _0803508E + movs r0, 0x69 + bl sub_80338C4 + b _0803508E +_08035080: + movs r0, 0x66 + bl sub_80338C4 + b _0803508E +_08035088: + movs r0, 0x4B + bl sub_80338C4 +_0803508E: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8035038 + + thumb_func_start sub_8035094 +sub_8035094: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080350EE + ldr r0, [sp] + cmp r0, 0x8 + beq _080350E8 + cmp r0, 0x16 + bne _080350EE + ldr r0, _080350C4 + ldr r0, [r0] + ldr r1, _080350C8 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0xD + beq _080350D8 + cmp r0, 0xD + bls _080350CC + cmp r0, 0xE + beq _080350E0 + b _080350EE + .align 2, 0 +_080350C4: .4byte gUnknown_203B33C +_080350C8: .4byte 0x00000524 +_080350CC: + cmp r0, 0xB + bcc _080350EE + movs r0, 0x69 + bl sub_80338C4 + b _080350EE +_080350D8: + movs r0, 0x66 + bl sub_80338C4 + b _080350EE +_080350E0: + movs r0, 0x4B + bl sub_80338C4 + b _080350EE +_080350E8: + movs r0, 0x1 + bl sub_80338C4 +_080350EE: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8035094 + + thumb_func_start sub_80350F4 +sub_80350F4: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08035176 + ldr r0, [sp] + cmp r0, 0x15 + beq _08035118 + cmp r0, 0x15 + bgt _08035112 + cmp r0, 0x8 + beq _08035170 + b _08035176 +_08035112: + cmp r0, 0x16 + beq _08035134 + b _08035176 +_08035118: + movs r0, 0 + bl sub_801CF14 + lsls r0, 24 + cmp r0, 0 + beq _0803512C + movs r0, 0x56 + bl sub_80338C4 + b _08035176 +_0803512C: + movs r0, 0x57 + bl sub_80338C4 + b _08035176 +_08035134: + ldr r0, _0803514C + ldr r0, [r0] + ldr r1, _08035150 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0xD + beq _08035160 + cmp r0, 0xD + bls _08035154 + cmp r0, 0xE + beq _08035168 + b _08035176 + .align 2, 0 +_0803514C: .4byte gUnknown_203B33C +_08035150: .4byte 0x00000524 +_08035154: + cmp r0, 0xB + bcc _08035176 + movs r0, 0x69 + bl sub_80338C4 + b _08035176 +_08035160: + movs r0, 0x66 + bl sub_80338C4 + b _08035176 +_08035168: + movs r0, 0x4B + bl sub_80338C4 + b _08035176 +_08035170: + movs r0, 0x1 + bl sub_80338C4 +_08035176: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80350F4 + + thumb_func_start sub_803517C +sub_803517C: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080351DA + ldr r0, [sp] + cmp r0, 0x6 + beq _08035196 + cmp r0, 0x8 + beq _080351D4 + b _080351DA +_08035196: + ldr r0, _080351B0 + ldr r0, [r0] + ldr r1, _080351B4 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0xD + beq _080351C4 + cmp r0, 0xD + bls _080351B8 + cmp r0, 0xE + beq _080351CC + b _080351DA + .align 2, 0 +_080351B0: .4byte gUnknown_203B33C +_080351B4: .4byte 0x00000524 +_080351B8: + cmp r0, 0xB + bcc _080351DA + movs r0, 0x69 + bl sub_80338C4 + b _080351DA +_080351C4: + movs r0, 0x66 + bl sub_80338C4 + b _080351DA +_080351CC: + movs r0, 0x4B + bl sub_80338C4 + b _080351DA +_080351D4: + movs r0, 0x1 + bl sub_80338C4 +_080351DA: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_803517C + + thumb_func_start sub_80351E0 +sub_80351E0: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08035208 + ldr r0, [sp] + cmp r0, 0x6 + beq _080351FA + cmp r0, 0x8 + beq _08035202 + b _08035208 +_080351FA: + movs r0, 0x72 + bl sub_80338C4 + b _08035208 +_08035202: + movs r0, 0x1 + bl sub_80338C4 +_08035208: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80351E0 + + thumb_func_start sub_8035210 +sub_8035210: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0803528C + ldr r0, _08035238 + ldr r2, [r0] + ldr r1, _0803523C + adds r0, r2, r1 + ldr r1, [sp] + str r1, [r0] + cmp r1, 0xD + bgt _0803528C + cmp r1, 0xB + bge _08035240 + cmp r1, 0x8 + beq _08035286 + b _0803528C + .align 2, 0 +_08035238: .4byte gUnknown_203B33C +_0803523C: .4byte 0x00000524 +_08035240: + movs r3, 0xA5 + lsls r3, 3 + adds r0, r2, r3 + ldr r0, [r0] + cmp r0, 0x13 + bne _08035272 + movs r0, 0x5 + bl sub_80953D4 + lsls r0, 24 + lsrs r0, 24 + bl sub_8095228 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0 + beq _0803526A + movs r0, 0x53 + bl sub_80338C4 + b _0803528C +_0803526A: + movs r0, 0x55 + bl sub_80338C4 + b _0803528C +_08035272: + cmp r1, 0xD + beq _0803527E + movs r0, 0x69 + bl sub_80338C4 + b _0803528C +_0803527E: + movs r0, 0x72 + bl sub_80338C4 + b _0803528C +_08035286: + movs r0, 0x1 + bl sub_80338C4 +_0803528C: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8035210 + + thumb_func_start nullsub_46 +nullsub_46: + bx lr + thumb_func_end nullsub_46 + + thumb_func_start nullsub_47 +nullsub_47: + bx lr + thumb_func_end nullsub_47 + + thumb_func_start nullsub_48 +nullsub_48: + bx lr + thumb_func_end nullsub_48 + + thumb_func_start nullsub_49 +nullsub_49: + bx lr + thumb_func_end nullsub_49 + + thumb_func_start sub_80352A4 +sub_80352A4: + push {r4,lr} + bl sub_802F298 + cmp r0, 0x3 + bne _080352EC + bl sub_802F2C0 + ldr r0, _080352F4 + movs r4, 0x98 + lsls r4, 1 + adds r1, r4, 0 + bl sub_808D8E0 + adds r0, r4, 0 + bl sub_808D994 + adds r1, r0, 0 + ldr r0, _080352F8 + bl strcpy + ldr r0, _080352FC + ldr r0, [r0] + movs r1, 0x84 + lsls r1, 3 + adds r0, r1 + ldr r1, [r0] + movs r0, 0x6 + bl sub_809539C + lsls r0, 24 + lsrs r0, 24 + bl sub_8095240 + movs r0, 0x70 + bl sub_80338C4 +_080352EC: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080352F4: .4byte gUnknown_202E5D8 +_080352F8: .4byte gUnknown_202DF98 +_080352FC: .4byte gUnknown_203B33C + thumb_func_end sub_80352A4 + + thumb_func_start sub_8035300 +sub_8035300: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08035364 + ldr r0, [sp] + adds r1, r0, 0 + subs r1, 0x19 + adds r2, r0, 0 + cmp r1, 0x4 + bhi _08035364 + lsls r0, r1, 2 + ldr r1, _08035324 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08035324: .4byte _08035328 + .align 2, 0 +_08035328: + .4byte _0803533C + .4byte _08035354 + .4byte _08035344 + .4byte _0803534C + .4byte _08035354 +_0803533C: + movs r0, 0x1 + bl sub_80338C4 + b _08035364 +_08035344: + movs r0, 0x7A + bl sub_80338C4 + b _08035364 +_0803534C: + movs r0, 0x7C + bl sub_80338C4 + b _08035364 +_08035354: + ldr r0, _0803536C + ldr r0, [r0] + ldr r1, _08035370 + adds r0, r1 + str r2, [r0] + movs r0, 0x79 + bl sub_80338C4 +_08035364: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_0803536C: .4byte gUnknown_203B33C +_08035370: .4byte 0x00000564 + thumb_func_end sub_8035300 + + thumb_func_start sub_8035374 +sub_8035374: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080353AC + ldr r1, [sp] + cmp r1, 0x19 + bne _08035390 + movs r0, 0x78 + bl sub_80338C4 + b _080353AC +_08035390: + cmp r1, 0x19 + blt _080353AC + cmp r1, 0x22 + bgt _080353AC + cmp r1, 0x1E + blt _080353AC + ldr r0, _080353B4 + ldr r0, [r0] + ldr r2, _080353B8 + adds r0, r2 + str r1, [r0] + movs r0, 0x7B + bl sub_80338C4 +_080353AC: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_080353B4: .4byte gUnknown_203B33C +_080353B8: .4byte 0x00000564 + thumb_func_end sub_8035374 + + thumb_func_start sub_80353BC +sub_80353BC: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080353F4 + ldr r1, [sp] + cmp r1, 0x19 + bne _080353D8 + movs r0, 0x78 + bl sub_80338C4 + b _080353F4 +_080353D8: + cmp r1, 0x19 + blt _080353F4 + cmp r1, 0x26 + bgt _080353F4 + cmp r1, 0x23 + blt _080353F4 + ldr r0, _080353FC + ldr r0, [r0] + ldr r2, _08035400 + adds r0, r2 + str r1, [r0] + movs r0, 0x7D + bl sub_80338C4 +_080353F4: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_080353FC: .4byte gUnknown_203B33C +_08035400: .4byte 0x00000564 + thumb_func_end sub_80353BC + + thumb_func_start sub_8035404 +sub_8035404: + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0803541A + adds r0, r4, 0 + bl sub_80338C4 +_0803541A: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8035404 + + thumb_func_start sub_8035424 +sub_8035424: + push {lr} + movs r0, 0x6 + bl sub_80338C4 + pop {r0} + bx r0 + thumb_func_end sub_8035424 + + thumb_func_start sub_8035430 +sub_8035430: + push {lr} + movs r0, 0x4F + bl sub_80338C4 + pop {r0} + bx r0 + thumb_func_end sub_8035430 + + thumb_func_start nullsub_50 +nullsub_50: + bx lr + thumb_func_end nullsub_50 + + thumb_func_start nullsub_51 +nullsub_51: + bx lr + thumb_func_end nullsub_51 + + thumb_func_start sub_8035444 +sub_8035444: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x84 + mov r8, r0 + adds r5, r1, 0 + ldr r4, _080354C0 + movs r0, 0x6C + movs r1, 0x8 + bl MemoryAlloc + str r0, [r4] + movs r1, 0 + str r1, [r0, 0x60] + str r5, [r0, 0x64] + mov r1, r8 + str r1, [r0, 0x68] + ldr r2, _080354C4 + mov r12, r2 + mov r9, r4 + movs r3, 0 + movs r2, 0x3 +_08035472: + ldr r1, [r4] + adds r1, r3 + mov r0, r12 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r3, 0x18 + subs r2, 0x1 + cmp r2, 0 + bge _08035472 + mov r0, r9 + ldr r1, [r0] + ldr r0, _080354C8 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + bl sub_8004914 + mov r1, r9 + ldr r0, [r1] + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0x2 + bl sub_8099690 + movs r0, 0 + bl sub_80073B8 + mov r2, r8 + lsls r0, r2, 2 + ldr r1, _080354CC + adds r0, r1 + ldr r1, [r0] + movs r5, 0 + b _08035542 + .align 2, 0 +_080354C0: .4byte gUnknown_203B340 +_080354C4: .4byte gUnknown_80E4A10 +_080354C8: .4byte gUnknown_80E4A28 +_080354CC: .4byte gUnknown_80E591C +_080354D0: + ldr r2, [r1, 0x8] + movs r3, 0x4 + ldrsh r0, [r1, r3] + cmp r0, 0 + blt _080354DE + adds r5, r0, 0 + b _080354E4 +_080354DE: + movs r6, 0x4 + ldrsh r0, [r1, r6] + subs r5, r0 +_080354E4: + movs r7, 0x2 + ldrsh r6, [r1, r7] + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0x1 + beq _080354FA + cmp r0, 0x2 + beq _08035514 + adds r4, r1, 0 + adds r4, 0xC + b _08035532 +_080354FA: + add r3, sp, 0x4 + ldrb r0, [r2] + adds r4, r1, 0 + adds r4, 0xC + cmp r0, 0 + beq _0803552C +_08035506: + strb r0, [r3] + adds r2, 0x1 + adds r3, 0x1 + ldrb r0, [r2] + cmp r0, 0 + bne _08035506 + b _0803552C +_08035514: + add r3, sp, 0x4 + ldrb r0, [r2] + adds r4, r1, 0 + adds r4, 0xC + cmp r0, 0 + beq _0803552C +_08035520: + strb r0, [r3] + adds r2, 0x1 + adds r3, 0x1 + ldrb r0, [r2] + cmp r0, 0 + bne _08035520 +_0803552C: + movs r0, 0 + strb r0, [r3] + add r2, sp, 0x4 +_08035532: + movs r0, 0 + str r0, [sp] + adds r0, r6, 0 + adds r1, r5, 0 + movs r3, 0 + bl xxx_call_draw_string + adds r1, r4, 0 +_08035542: + ldr r0, [r1, 0x8] + cmp r0, 0 + bne _080354D0 + movs r0, 0 + bl sub_80073E0 + movs r0, 0 + bl sub_80063CC + ldr r2, _08035570 + movs r0, 0x9 + movs r1, 0 + ldr r2, [r2] + bl sub_8099AFC + movs r0, 0x1 + add sp, 0x84 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08035570: .4byte gUnknown_80E4A40 + thumb_func_end sub_8035444 + + thumb_func_start sub_8035574 +sub_8035574: + push {r4,lr} + ldr r1, _0803558C + ldr r0, [r1] + ldr r0, [r0, 0x60] + adds r4, r1, 0 + cmp r0, 0x4 + bhi _08035654 + lsls r0, 2 + ldr r1, _08035590 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0803558C: .4byte gUnknown_203B340 +_08035590: .4byte _08035594 + .align 2, 0 +_08035594: + .4byte _080355A8 + .4byte _080355D0 + .4byte _080355E8 + .4byte _08035610 + .4byte _08035638 +_080355A8: + bl sub_8099B94 + lsls r0, 24 + cmp r0, 0 + bne _08035654 + ldr r0, _080355C8 + ldr r1, [r0] + movs r0, 0x1 + str r0, [r1, 0x60] + ldr r2, _080355CC + movs r0, 0x9 + movs r1, 0x1E + ldr r2, [r2] + bl sub_8099A5C + b _08035654 + .align 2, 0 +_080355C8: .4byte gUnknown_203B340 +_080355CC: .4byte gUnknown_80E4A40 +_080355D0: + bl sub_8099B94 + lsls r0, 24 + cmp r0, 0 + bne _08035654 + ldr r0, _080355E4 + ldr r1, [r0] + movs r0, 0x2 + str r0, [r1, 0x60] + b _08035654 + .align 2, 0 +_080355E4: .4byte gUnknown_203B340 +_080355E8: + ldr r1, [r4] + ldr r0, [r1, 0x64] + cmp r0, 0 + bgt _08035600 + movs r0, 0x3 + str r0, [r1, 0x60] + ldr r2, _0803560C + movs r0, 0x9 + movs r1, 0x1E + ldr r2, [r2] + bl sub_8099AFC +_08035600: + ldr r1, [r4] + ldr r0, [r1, 0x64] + subs r0, 0x1 + str r0, [r1, 0x64] + b _08035654 + .align 2, 0 +_0803560C: .4byte gUnknown_80E4A40 +_08035610: + bl sub_8099B94 + lsls r0, 24 + cmp r0, 0 + bne _08035654 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, _08035634 + ldr r1, [r0] + movs r0, 0x4 + str r0, [r1, 0x60] + b _08035654 + .align 2, 0 +_08035634: .4byte gUnknown_203B340 +_08035638: + movs r0, 0 + bl sub_8099690 + ldr r2, _08035650 + movs r0, 0x1 + movs r1, 0 + ldr r2, [r2] + bl sub_8099A5C + movs r0, 0x3 + b _08035656 + .align 2, 0 +_08035650: .4byte gUnknown_80E4A40 +_08035654: + movs r0, 0 +_08035656: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8035574 + + thumb_func_start sub_803565C +sub_803565C: + push {r4,lr} + ldr r4, _08035674 + ldr r0, [r4] + cmp r0, 0 + beq _0803566E + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0803566E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08035674: .4byte gUnknown_203B340 + thumb_func_end sub_803565C + + thumb_func_start sub_8035678 +sub_8035678: + push {r4,lr} + ldr r4, _0803569C + movs r0, 0x8 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r4] + movs r1, 0 + str r1, [r0] + str r1, [r0, 0x4] + movs r0, 0 + movs r1, 0x39 + bl sub_80015C0 + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0803569C: .4byte gUnknown_203B344 + thumb_func_end sub_8035678 + + thumb_func_start sub_80356A0 +sub_80356A0: + push {r4,lr} + ldr r0, _080356C4 + ldrh r4, [r0] + ldr r3, _080356C8 + ldr r2, _080356CC + ldr r1, [r2] + ldr r0, [r1, 0x4] + lsls r0, 1 + adds r0, r3 + ldrh r3, [r0] + ldr r0, [r1] + cmp r0, 0x4 + bhi _08035734 + lsls r0, 2 + ldr r1, _080356D0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080356C4: .4byte gUnknown_20255F0 +_080356C8: .4byte gUnknown_80E5990 +_080356CC: .4byte gUnknown_203B344 +_080356D0: .4byte _080356D4 + .align 2, 0 +_080356D4: + .4byte _08035728 + .4byte _080356E8 + .4byte _08035710 + .4byte _0803574C + .4byte _08035730 +_080356E8: + cmp r3, 0 + bne _080356F4 + ldr r1, [r2] + movs r0, 0x4 + str r0, [r1] + b _08035734 +_080356F4: + cmp r4, r3 + bne _08035700 + ldr r1, [r2] + movs r0, 0x2 + str r0, [r1] + b _08035734 +_08035700: + ands r3, r4 + cmp r3, r4 + bne _08035728 + ldr r1, [r2] + ldr r0, [r1, 0x4] + cmp r0, 0 + bne _08035734 + b _0803572A +_08035710: + cmp r4, 0 + bne _08035722 + ldr r1, [r2] + movs r0, 0x1 + str r0, [r1] + ldr r0, [r1, 0x4] + adds r0, 0x1 + str r0, [r1, 0x4] + b _08035734 +_08035722: + ands r3, r4 + cmp r3, r4 + beq _08035734 +_08035728: + ldr r1, [r2] +_0803572A: + movs r0, 0x3 + str r0, [r1] + b _08035734 +_08035730: + movs r0, 0x3 + b _0803574E +_08035734: + movs r0, 0 + movs r1, 0x39 + bl sub_8001658 + cmp r0, 0 + bne _08035744 + movs r0, 0 + b _0803574E +_08035744: + ldr r0, _08035754 + ldr r1, [r0] + movs r0, 0x3 + str r0, [r1] +_0803574C: + movs r0, 0x2 +_0803574E: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08035754: .4byte gUnknown_203B344 + thumb_func_end sub_80356A0 + + thumb_func_start sub_8035758 +sub_8035758: + push {r4,lr} + ldr r4, _08035770 + ldr r0, [r4] + cmp r0, 0 + beq _0803576A + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0803576A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08035770: .4byte gUnknown_203B344 + thumb_func_end sub_8035758 + + thumb_func_start InitMainMenu +InitMainMenu: + push {r4,r5,lr} + ldr r5, _080357C8 + ldr r0, [r5] + cmp r0, 0 + bne _08035790 + movs r0, 0x40 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] + movs r1, 0 + movs r2, 0x40 + bl MemoryFill8 +_08035790: + ldr r0, [r5] + ldr r1, _080357CC + str r1, [r0] + movs r2, 0x1 + str r2, [r0, 0x4] + str r2, [r0, 0x8] + adds r1, 0x23 + strh r1, [r0, 0x38] + movs r1, 0x1 + negs r1, r1 + str r1, [r0, 0x3C] + adds r0, 0x2E + movs r4, 0 + strb r4, [r0] + ldr r0, [r5] + adds r0, 0x2C + strb r2, [r0] + ldr r0, [r5] + adds r0, 0x2D + strb r4, [r0] + bl sub_8035DA0 + ldr r0, [r5] + adds r0, 0x3A + strb r4, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080357C8: .4byte gUnknown_203B348 +_080357CC: .4byte 0x0000ffdc + thumb_func_end InitMainMenu + + thumb_func_start sub_80357D0 +sub_80357D0: + push {r4,lr} + ldr r4, _080357E8 + ldr r0, [r4] + cmp r0, 0 + beq _080357E2 + bl MemoryFree + movs r0, 0 + str r0, [r4] +_080357E2: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080357E8: .4byte gUnknown_203B348 + thumb_func_end sub_80357D0 + + thumb_func_start SetUpMenu +SetUpMenu: + push {lr} + ldr r0, _08035810 + ldr r0, [r0] + ldr r1, [r0] + ldr r0, [r0, 0x4] + cmp r1, r0 + bne _080357FC + b _08035958 +_080357FC: + subs r0, 0x1 + cmp r0, 0x2D + bls _08035804 + b _08035950 +_08035804: + lsls r0, 2 + ldr r1, _08035814 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08035810: .4byte gUnknown_203B348 +_08035814: .4byte _08035818 + .align 2, 0 +_08035818: + .4byte _080358D0 + .4byte _08035950 + .4byte _08035950 + .4byte _08035950 + .4byte _08035950 + .4byte _080358E0 + .4byte _080358E0 + .4byte _080358E0 + .4byte _080358E0 + .4byte _08035934 + .4byte _0803590C + .4byte _080358F0 + .4byte _08035912 + .4byte _08035918 + .4byte _0803591E + .4byte _0803594C + .4byte _08035950 + .4byte _08035950 + .4byte _080358F6 + .4byte _080358F6 + .4byte _08035950 + .4byte _08035950 + .4byte _08035950 + .4byte _08035950 + .4byte _08035950 + .4byte _08035950 + .4byte _08035950 + .4byte _08035950 + .4byte _08035950 + .4byte _08035950 + .4byte _08035950 + .4byte _08035950 + .4byte _08035924 + .4byte _08035924 + .4byte _08035950 + .4byte _08035950 + .4byte _08035950 + .4byte _08035950 + .4byte _08035950 + .4byte _08035950 + .4byte _0803593A + .4byte _0803593A + .4byte _0803593A + .4byte _0803593A + .4byte _0803593A + .4byte _0803593A +_080358D0: + bl sub_8094C14 + movs r0, 0 + bl sub_8099690 + bl sub_8035E10 + b _08035950 +_080358E0: + ldr r0, _080358EC + ldr r0, [r0] + ldr r0, [r0, 0x4] + bl sub_8039254 + b _08035950 + .align 2, 0 +_080358EC: .4byte gUnknown_203B348 +_080358F0: + bl sub_8036400 + b _08035950 +_080358F6: + ldr r0, _08035908 + ldr r0, [r0] + ldr r0, [r0, 0x4] + bl sub_8035DB4 + bl sub_8036FDC + b _08035950 + .align 2, 0 +_08035908: .4byte gUnknown_203B348 +_0803590C: + bl sub_803225C + b _08035950 +_08035912: + bl sub_80398AC + b _08035950 +_08035918: + bl sub_803A1D8 + b _08035950 +_0803591E: + bl sub_803A1E4 + b _08035950 +_08035924: + ldr r0, _08035930 + ldr r0, [r0] + ldr r0, [r0, 0x4] + bl sub_8038900 + b _08035950 + .align 2, 0 +_08035930: .4byte gUnknown_203B348 +_08035934: + bl sub_80382A0 + b _08035950 +_0803593A: + ldr r0, _08035948 + ldr r0, [r0] + ldr r0, [r0, 0x4] + bl sub_803850C + b _08035950 + .align 2, 0 +_08035948: .4byte gUnknown_203B348 +_0803594C: + bl sub_803A200 +_08035950: + ldr r0, _0803595C + ldr r1, [r0] + ldr r0, [r1, 0x4] + str r0, [r1] +_08035958: + pop {r0} + bx r0 + .align 2, 0 +_0803595C: .4byte gUnknown_203B348 + thumb_func_end SetUpMenu + + thumb_func_start UpdateMenu +UpdateMenu: + push {lr} + ldr r2, _0803597C + ldr r0, _08035980 + ldr r0, [r0] + ldr r0, [r0, 0x4] + subs r0, 0x1 + cmp r0, 0x2D + bls _08035972 + b _08035AA6 +_08035972: + lsls r0, 2 + ldr r1, _08035984 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0803597C: .4byte 0x0000ffdc +_08035980: .4byte gUnknown_203B348 +_08035984: .4byte _08035988 + .align 2, 0 +_08035988: + .4byte _08035A40 + .4byte _08035AA6 + .4byte _08035AA6 + .4byte _08035AA6 + .4byte _08035AA6 + .4byte _08035A46 + .4byte _08035A46 + .4byte _08035A46 + .4byte _08035A46 + .4byte _08035A8E + .4byte _08035A52 + .4byte _08035A4C + .4byte _08035A58 + .4byte _08035A5E + .4byte _08035A70 + .4byte _08035AA0 + .4byte _08035AA6 + .4byte _08035AA6 + .4byte _08035AA6 + .4byte _08035AA6 + .4byte _08035AA6 + .4byte _08035AA6 + .4byte _08035AA6 + .4byte _08035AA6 + .4byte _08035AA6 + .4byte _08035AA6 + .4byte _08035AA6 + .4byte _08035AA6 + .4byte _08035AA6 + .4byte _08035AA6 + .4byte _08035AA6 + .4byte _08035AA6 + .4byte _08035A88 + .4byte _08035A88 + .4byte _08035AA6 + .4byte _08035A94 + .4byte _08035A94 + .4byte _08035A94 + .4byte _08035A94 + .4byte _08035A94 + .4byte _08035A9A + .4byte _08035A9A + .4byte _08035A9A + .4byte _08035A9A + .4byte _08035A9A + .4byte _08035A9A +_08035A40: + bl sub_8035EEC + b _08035AA4 +_08035A46: + bl sub_803941C + b _08035AA4 +_08035A4C: + bl sub_8036448 + b _08035A62 +_08035A52: + bl sub_8032318 + b _08035A62 +_08035A58: + bl sub_8039928 + b _08035A62 +_08035A5E: + bl sub_803A1DC +_08035A62: + movs r2, 0x1 + cmp r0, 0x3 + beq _08035AA6 + ldr r2, _08035A6C + b _08035AA6 + .align 2, 0 +_08035A6C: .4byte 0x0000ffdc +_08035A70: + bl sub_803A1E8 + movs r2, 0x5 + cmp r0, 0x3 + beq _08035AA6 + ldr r2, _08035A84 + cmp r0, 0x2 + bne _08035AA6 + movs r2, 0x1 + b _08035AA6 + .align 2, 0 +_08035A84: .4byte 0x0000ffdc +_08035A88: + bl sub_8038A90 + b _08035AA4 +_08035A8E: + bl sub_80382C0 + b _08035AA4 +_08035A94: + bl sub_80383D4 + b _08035AA4 +_08035A9A: + bl sub_8038630 + b _08035AA4 +_08035AA0: + bl sub_803A2A4 +_08035AA4: + adds r2, r0, 0 +_08035AA6: + ldr r0, _08035AB8 + cmp r2, r0 + beq _08035AB2 + ldr r0, _08035ABC + ldr r0, [r0] + str r2, [r0, 0x4] +_08035AB2: + adds r0, r2, 0 + pop {r1} + bx r1 + .align 2, 0 +_08035AB8: .4byte 0x0000ffdc +_08035ABC: .4byte gUnknown_203B348 + thumb_func_end UpdateMenu + + thumb_func_start CleanUpMenu +CleanUpMenu: + push {lr} + ldr r0, _08035AE4 + ldr r0, [r0] + ldr r1, [r0, 0x8] + ldr r0, [r0, 0x4] + cmp r1, r0 + bne _08035AD0 + b _08035BF8 +_08035AD0: + subs r0, r1, 0x1 + cmp r0, 0x2D + bls _08035AD8 + b _08035BF0 +_08035AD8: + lsls r0, 2 + ldr r1, _08035AE8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08035AE4: .4byte gUnknown_203B348 +_08035AE8: .4byte _08035AEC + .align 2, 0 +_08035AEC: + .4byte _08035BA4 + .4byte _08035BF0 + .4byte _08035BF0 + .4byte _08035BF0 + .4byte _08035BF0 + .4byte _08035BAA + .4byte _08035BAA + .4byte _08035BAA + .4byte _08035BAA + .4byte _08035BDA + .4byte _08035BBC + .4byte _08035BB0 + .4byte _08035BC2 + .4byte _08035BC8 + .4byte _08035BCE + .4byte _08035BEC + .4byte _08035BF0 + .4byte _08035BF0 + .4byte _08035BB6 + .4byte _08035BB6 + .4byte _08035BF0 + .4byte _08035BF0 + .4byte _08035BF0 + .4byte _08035BF0 + .4byte _08035BF0 + .4byte _08035BF0 + .4byte _08035BF0 + .4byte _08035BF0 + .4byte _08035BF0 + .4byte _08035BF0 + .4byte _08035BF0 + .4byte _08035BF0 + .4byte _08035BD4 + .4byte _08035BD4 + .4byte _08035BF0 + .4byte _08035BE0 + .4byte _08035BE0 + .4byte _08035BE0 + .4byte _08035BE0 + .4byte _08035BE0 + .4byte _08035BE6 + .4byte _08035BE6 + .4byte _08035BE6 + .4byte _08035BE6 + .4byte _08035BE6 + .4byte _08035BE6 +_08035BA4: + bl sub_8035EC0 + b _08035BF0 +_08035BAA: + bl sub_80393F0 + b _08035BF0 +_08035BB0: + bl sub_8036B04 + b _08035BF0 +_08035BB6: + bl sub_80370D4 + b _08035BF0 +_08035BBC: + bl sub_80327E4 + b _08035BF0 +_08035BC2: + bl sub_80399E4 + b _08035BF0 +_08035BC8: + bl nullsub_55 + b _08035BF0 +_08035BCE: + bl sub_803A1EC + b _08035BF0 +_08035BD4: + bl sub_8038A5C + b _08035BF0 +_08035BDA: + bl sub_80382AC + b _08035BF0 +_08035BE0: + bl sub_80383A8 + b _08035BF0 +_08035BE6: + bl sub_8038604 + b _08035BF0 +_08035BEC: + bl sub_803A278 +_08035BF0: + ldr r0, _08035BFC + ldr r1, [r0] + ldr r0, [r1, 0x4] + str r0, [r1, 0x8] +_08035BF8: + pop {r0} + bx r0 + .align 2, 0 +_08035BFC: .4byte gUnknown_203B348 + thumb_func_end CleanUpMenu + + thumb_func_start sub_8035C00 +sub_8035C00: + ldr r1, _08035C0C + ldr r1, [r1] + ldr r0, [r0] + str r0, [r1, 0x2C] + bx lr + .align 2, 0 +_08035C0C: .4byte gUnknown_203B348 + thumb_func_end sub_8035C00 + + thumb_func_start sub_8035C10 +sub_8035C10: + ldr r0, _08035C18 + ldr r0, [r0] + adds r0, 0x2C + bx lr + .align 2, 0 +_08035C18: .4byte gUnknown_203B348 + thumb_func_end sub_8035C10 + + thumb_func_start sub_8035C1C +sub_8035C1C: + ldr r2, _08035C38 + ldr r0, [r2] + adds r0, 0x2E + movs r3, 0 + strb r3, [r0] + ldr r0, [r2] + adds r0, 0x2C + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r2] + adds r0, 0x2D + strb r3, [r0] + bx lr + .align 2, 0 +_08035C38: .4byte gUnknown_203B348 + thumb_func_end sub_8035C1C + + thumb_func_start sub_8035C3C +sub_8035C3C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r6, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + ldr r0, [sp, 0x24] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 3 + adds r0, r4 + ldm r3!, {r1,r2,r7} + stm r0!, {r1,r2,r7} + ldm r3!, {r1,r2,r7} + stm r0!, {r1,r2,r7} + bl sub_8004914 + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + mov r0, r8 + cmp r0, 0 + beq _08035C90 + lsls r4, r5, 2 + adds r0, r4, r5 + lsls r0, 4 + adds r0, r6, r0 + ldr r1, [sp, 0x28] + str r1, [sp] + str r5, [sp, 0x4] + ldr r1, [sp, 0x20] + movs r2, 0 + movs r3, 0 + bl sub_8012D60 + b _08035CA8 +_08035C90: + lsls r4, r5, 2 + adds r0, r4, r5 + lsls r0, 4 + adds r0, r6, r0 + mov r1, r8 + str r1, [sp] + str r5, [sp, 0x4] + ldr r1, [sp, 0x20] + movs r2, 0 + movs r3, 0 + bl sub_8012E04 +_08035CA8: + adds r0, r4, r5 + lsls r0, 4 + adds r0, r6 + adds r0, 0x4C + movs r1, 0x1 + strb r1, [r0] + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8035C3C + + thumb_func_start sub_8035CC0 +sub_8035CC0: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + bl sub_8006518 + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 3 + adds r1, r5 + ldr r0, _08035CF0 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + bl sub_8004914 + adds r0, r5, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08035CF0: .4byte gUnknown_80E59A8 + thumb_func_end sub_8035CC0 + + thumb_func_start sub_8035CF4 +sub_8035CF4: + push {lr} + adds r3, r0, 0 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 4 + adds r0, r3 + adds r1, r0, 0 + adds r1, 0x4C + strb r2, [r1] + adds r2, r0, 0 + adds r2, 0x4D + movs r1, 0x1 + strb r1, [r2] + subs r1, 0x2 + str r1, [r0, 0x48] + bl sub_8012EBC + pop {r0} + bx r0 + thumb_func_end sub_8035CF4 + + thumb_func_start sub_8035D1C +sub_8035D1C: + ldr r0, _08035D28 + ldr r1, [r0] + ldr r0, _08035D2C + strh r0, [r1, 0x38] + bx lr + .align 2, 0 +_08035D28: .4byte gUnknown_203B348 +_08035D2C: .4byte 0x0000ffff + thumb_func_end sub_8035D1C + + thumb_func_start sub_8035D30 +sub_8035D30: + ldr r1, _08035D38 + ldr r1, [r1] + strh r0, [r1, 0x38] + bx lr + .align 2, 0 +_08035D38: .4byte gUnknown_203B348 + thumb_func_end sub_8035D30 + + thumb_func_start sub_8035D3C +sub_8035D3C: + ldr r0, _08035D48 + ldr r0, [r0] + movs r1, 0x38 + ldrsh r0, [r0, r1] + bx lr + .align 2, 0 +_08035D48: .4byte gUnknown_203B348 + thumb_func_end sub_8035D3C + + thumb_func_start sub_8035D4C +sub_8035D4C: + ldr r0, _08035D54 + ldr r0, [r0] + bx lr + .align 2, 0 +_08035D54: .4byte gUnknown_203B348 + thumb_func_end sub_8035D4C + + thumb_func_start sub_8035D58 +sub_8035D58: + ldr r0, _08035D64 + ldr r1, [r0] + movs r0, 0x1 + negs r0, r0 + str r0, [r1, 0x3C] + bx lr + .align 2, 0 +_08035D64: .4byte gUnknown_203B348 + thumb_func_end sub_8035D58 + + thumb_func_start sub_8035D68 +sub_8035D68: + ldr r1, _08035D70 + ldr r1, [r1] + str r0, [r1, 0x3C] + bx lr + .align 2, 0 +_08035D70: .4byte gUnknown_203B348 + thumb_func_end sub_8035D68 + + thumb_func_start sub_8035D74 +sub_8035D74: + ldr r0, _08035D7C + ldr r0, [r0] + ldr r0, [r0, 0x3C] + bx lr + .align 2, 0 +_08035D7C: .4byte gUnknown_203B348 + thumb_func_end sub_8035D74 + + thumb_func_start sub_8035D80 +sub_8035D80: + ldr r1, _08035D90 + ldr r2, [r1] + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r2, 0x30] + str r1, [r2, 0x34] + bx lr + .align 2, 0 +_08035D90: .4byte gUnknown_203B348 + thumb_func_end sub_8035D80 + + thumb_func_start sub_8035D94 +sub_8035D94: + ldr r0, _08035D9C + ldr r0, [r0] + adds r0, 0x30 + bx lr + .align 2, 0 +_08035D9C: .4byte gUnknown_203B348 + thumb_func_end sub_8035D94 + + thumb_func_start sub_8035DA0 +sub_8035DA0: + ldr r2, _08035DB0 + ldr r0, [r2] + adds r0, 0x30 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + str r1, [r0, 0x34] + bx lr + .align 2, 0 +_08035DB0: .4byte gUnknown_203B348 + thumb_func_end sub_8035DA0 + + thumb_func_start sub_8035DB4 +sub_8035DB4: + push {lr} + movs r1, 0x8 + subs r0, 0x13 + cmp r0, 0x7 + bhi _08035E0A + lsls r0, 2 + ldr r1, _08035DC8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08035DC8: .4byte _08035DCC + .align 2, 0 +_08035DCC: + .4byte _08035DEC + .4byte _08035DF0 + .4byte _08035DF4 + .4byte _08035DF8 + .4byte _08035DFC + .4byte _08035E00 + .4byte _08035E04 + .4byte _08035E08 +_08035DEC: + movs r1, 0 + b _08035E0A +_08035DF0: + movs r1, 0x1 + b _08035E0A +_08035DF4: + movs r1, 0x2 + b _08035E0A +_08035DF8: + movs r1, 0x3 + b _08035E0A +_08035DFC: + movs r1, 0x4 + b _08035E0A +_08035E00: + movs r1, 0x5 + b _08035E0A +_08035E04: + movs r1, 0x6 + b _08035E0A +_08035E08: + movs r1, 0x7 +_08035E0A: + adds r0, r1, 0 + pop {r1} + bx r1 + thumb_func_end sub_8035DB4 + + thumb_func_start sub_8035E10 +sub_8035E10: + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r5, _08035EB8 + ldr r0, [r5] + cmp r0, 0 + bne _08035E34 + movs r4, 0xD4 + lsls r4, 1 + adds r0, r4, 0 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] + movs r1, 0 + adds r2, r4, 0 + bl MemoryFill8 +_08035E34: + mov r12, r5 + movs r0, 0xA2 + lsls r0, 1 + mov r8, r0 + ldr r4, _08035EBC + movs r3, 0 + movs r2, 0x3 +_08035E42: + mov r5, r12 + ldr r1, [r5] + adds r1, r3 + add r1, r8 + adds r0, r4, 0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r3, 0x18 + subs r2, 0x1 + cmp r2, 0 + bge _08035E42 + bl sub_8004914 + ldr r4, _08035EB8 + ldr r0, [r4] + movs r6, 0xA2 + lsls r6, 1 + adds r0, r6 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + bl sub_803628C + ldr r0, [r4] + movs r7, 0xD2 + lsls r7, 1 + adds r0, r7 + movs r1, 0x1 + negs r1, r1 + str r1, [r0] + bl SetMainMenuType + lsls r0, 24 + cmp r0, 0 + beq _08035E9A + ldr r0, [r4] + adds r0, 0x4 + movs r1, 0x2 + movs r2, 0 + bl sub_8035CF4 +_08035E9A: + ldr r0, [r4] + adds r0, 0x4 + movs r1, 0 + movs r2, 0x1 + bl sub_8035CF4 + ldr r1, [r4] + movs r0, 0x1 + str r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08035EB8: .4byte gUnknown_203B34C +_08035EBC: .4byte gUnknown_80E59C8 + thumb_func_end sub_8035E10 + + thumb_func_start sub_8035EC0 +sub_8035EC0: + push {r4,lr} + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r4, _08035EE8 + ldr r0, [r4] + cmp r0, 0 + beq _08035EE0 + bl MemoryFree + movs r0, 0 + str r0, [r4] +_08035EE0: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08035EE8: .4byte gUnknown_203B34C + thumb_func_end sub_8035EC0 + + thumb_func_start sub_8035EEC +sub_8035EEC: + push {r4-r6,lr} + sub sp, 0x4 + ldr r6, _08035F64 + str r6, [sp] + ldr r4, _08035F68 + ldr r0, [r4] + ldr r5, [r0] + cmp r5, 0xC + beq _08035FB8 + cmp r5, 0xC + bls _08035F04 + b _0803601A +_08035F04: + cmp r5, 0x1 + beq _08035F0A + b _0803601A +_08035F0A: + adds r0, 0xA4 + bl sub_8012FD8 + ldr r0, [r4] + adds r0, 0x4 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _08035F28 + ldr r0, [r4] + adds r0, 0x4 + mov r1, sp + bl sub_8013114 +_08035F28: + bl SetMainMenuType + lsls r0, 24 + cmp r0, 0 + beq _08035F4A + ldr r0, [r4] + adds r0, 0x4 + movs r1, 0 + movs r2, 0x1 + bl sub_8035CF4 + ldr r0, [r4] + adds r0, 0x4 + movs r1, 0x2 + movs r2, 0 + bl sub_8035CF4 +_08035F4A: + ldr r1, [sp] + cmp r1, 0xC + beq _08035FA8 + cmp r1, 0xC + bhi _08035F6C + cmp r1, 0x3 + beq _08035FAC + cmp r1, 0x3 + bcc _0803601A + cmp r1, 0x6 + bcc _0803601A + b _08035FAC + .align 2, 0 +_08035F64: .4byte 0x0000ffdc +_08035F68: .4byte gUnknown_203B34C +_08035F6C: + cmp r1, r6 + beq _08035FF2 + cmp r1, r6 + bhi _08035F7A + cmp r1, 0x10 + bhi _0803601A + b _08035FAC +_08035F7A: + ldr r0, _08035FA4 + cmp r1, r0 + bne _0803601A + ldr r0, [r4] + str r5, [r0] + str r6, [sp] + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x4 + movs r1, 0 + movs r2, 0x1 + bl sub_8035CF4 + ldr r0, [r4] + adds r0, 0x4 + movs r1, 0x2 + movs r2, 0 + bl sub_8035CF4 + b _0803601A + .align 2, 0 +_08035FA4: .4byte 0x0000ffdd +_08035FA8: + bl sub_8035DA0 +_08035FAC: + ldr r1, _08035FB4 + ldr r0, [sp] + str r0, [r1] + b _0803601A + .align 2, 0 +_08035FB4: .4byte gUnknown_203B350 +_08035FB8: + adds r0, 0x54 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _08035FCE + ldr r0, [r4] + adds r0, 0x54 + mov r1, sp + bl sub_8013114 +_08035FCE: + ldr r1, [sp] + cmp r1, 0x12 + beq _08036008 + cmp r1, 0x12 + bhi _08035FDE + cmp r1, 0x11 + beq _08035FFC + b _0803601A +_08035FDE: + cmp r1, r6 + beq _08036018 + ldr r0, _08035FF8 + cmp r1, r0 + bne _0803601A + bl sub_803623C + ldr r1, [r4] + movs r0, 0x1 + str r0, [r1] +_08035FF2: + str r6, [sp] + b _0803601A + .align 2, 0 +_08035FF8: .4byte 0x0000ffdd +_08035FFC: + ldr r0, _08036004 + str r1, [r0] + str r5, [sp] + b _0803601A + .align 2, 0 +_08036004: .4byte gUnknown_203B354 +_08036008: + ldr r0, _08036014 + str r1, [r0] + movs r0, 0x14 + str r0, [sp] + b _0803601A + .align 2, 0 +_08036014: .4byte gUnknown_203B354 +_08036018: + str r1, [sp] +_0803601A: + ldr r0, [sp] + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8035EEC + + thumb_func_start SetMainMenuType +SetMainMenuType: + push {r4-r6,lr} + sub sp, 0x10 + ldr r6, _08036048 + ldr r2, [r6] + ldr r0, [r2, 0x8] + movs r3, 0x30 + ldrsh r1, [r2, r3] + lsls r1, 3 + adds r1, r0 + ldr r5, [r1, 0x4] + movs r0, 0xD2 + lsls r0, 1 + adds r1, r2, r0 + ldr r0, [r1] + cmp r0, r5 + bne _0803604C + movs r0, 0 + b _08036226 + .align 2, 0 +_08036048: .4byte gUnknown_203B34C +_0803604C: + str r5, [r1] + movs r4, 0xA2 + lsls r4, 1 + adds r0, r2, r4 + movs r1, 0x2 + bl sub_8035CC0 + ldr r0, [r6] + adds r0, r4 + movs r1, 0x3 + bl sub_8035CC0 + subs r0, r5, 0x3 + cmp r0, 0xD + bls _0803606C + b _08036224 +_0803606C: + lsls r0, 2 + ldr r1, _08036078 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08036078: .4byte _0803607C + .align 2, 0 +_0803607C: + .4byte _08036114 + .4byte _08036224 + .4byte _08036224 + .4byte _080360F4 + .4byte _08036134 + .4byte _08036154 + .4byte _08036224 + .4byte _08036174 + .4byte _08036194 + .4byte _080361B4 + .4byte _080360D4 + .4byte _080361D4 + .4byte _080360B4 + .4byte _08036204 +_080360B4: + ldr r0, _080360C8 + ldr r1, [r0] + adds r0, r1, 0x4 + movs r2, 0xA2 + lsls r2, 1 + adds r1, r2 + ldr r3, _080360CC + ldr r2, _080360D0 + b _080361E4 + .align 2, 0 +_080360C8: .4byte gUnknown_203B34C +_080360CC: .4byte gUnknown_80E5CB4 +_080360D0: .4byte gUnknown_80E6030 +_080360D4: + ldr r0, _080360E8 + ldr r1, [r0] + adds r0, r1, 0x4 + movs r3, 0xA2 + lsls r3, 1 + adds r1, r3 + ldr r3, _080360EC + ldr r2, _080360F0 + b _080361E4 + .align 2, 0 +_080360E8: .4byte gUnknown_203B34C +_080360EC: .4byte gUnknown_80E5CB4 +_080360F0: .4byte gUnknown_80E5F80 +_080360F4: + ldr r0, _08036108 + ldr r1, [r0] + adds r0, r1, 0x4 + movs r2, 0xA2 + lsls r2, 1 + adds r1, r2 + ldr r3, _0803610C + ldr r2, _08036110 + b _080361E4 + .align 2, 0 +_08036108: .4byte gUnknown_203B34C +_0803610C: .4byte gUnknown_80E5CB4 +_08036110: .4byte gUnknown_80E5F1C +_08036114: + ldr r0, _08036128 + ldr r1, [r0] + adds r0, r1, 0x4 + movs r3, 0xA2 + lsls r3, 1 + adds r1, r3 + ldr r3, _0803612C + ldr r2, _08036130 + b _080361E4 + .align 2, 0 +_08036128: .4byte gUnknown_203B34C +_0803612C: .4byte gUnknown_80E5CB4 +_08036130: .4byte gUnknown_80E5CCC +_08036134: + ldr r0, _08036148 + ldr r1, [r0] + adds r0, r1, 0x4 + movs r2, 0xA2 + lsls r2, 1 + adds r1, r2 + ldr r3, _0803614C + ldr r2, _08036150 + b _080361E4 + .align 2, 0 +_08036148: .4byte gUnknown_203B34C +_0803614C: .4byte gUnknown_80E5CB4 +_08036150: .4byte gUnknown_80E5DA0 +_08036154: + ldr r0, _08036168 + ldr r1, [r0] + adds r0, r1, 0x4 + movs r3, 0xA2 + lsls r3, 1 + adds r1, r3 + ldr r3, _0803616C + ldr r2, _08036170 + b _080361E4 + .align 2, 0 +_08036168: .4byte gUnknown_203B34C +_0803616C: .4byte gUnknown_80E5CB4 +_08036170: .4byte gUnknown_80E5DF0 +_08036174: + ldr r0, _08036188 + ldr r1, [r0] + adds r0, r1, 0x4 + movs r2, 0xA2 + lsls r2, 1 + adds r1, r2 + ldr r3, _0803618C + ldr r2, _08036190 + b _080361E4 + .align 2, 0 +_08036188: .4byte gUnknown_203B34C +_0803618C: .4byte gUnknown_80E5CB4 +_08036190: .4byte gUnknown_80E5D0C +_08036194: + ldr r0, _080361A8 + ldr r1, [r0] + adds r0, r1, 0x4 + movs r3, 0xA2 + lsls r3, 1 + adds r1, r3 + ldr r3, _080361AC + ldr r2, _080361B0 + b _080361E4 + .align 2, 0 +_080361A8: .4byte gUnknown_203B34C +_080361AC: .4byte gUnknown_80E5CB4 +_080361B0: .4byte gUnknown_80E5E5C +_080361B4: + ldr r0, _080361C8 + ldr r1, [r0] + adds r0, r1, 0x4 + movs r2, 0xA2 + lsls r2, 1 + adds r1, r2 + ldr r3, _080361CC + ldr r2, _080361D0 + b _080361E4 + .align 2, 0 +_080361C8: .4byte gUnknown_203B34C +_080361CC: .4byte gUnknown_80E5CB4 +_080361D0: .4byte gUnknown_80E5EBC +_080361D4: + ldr r0, _080361F8 + ldr r1, [r0] + adds r0, r1, 0x4 + movs r3, 0xA2 + lsls r3, 1 + adds r1, r3 + ldr r3, _080361FC + ldr r2, _08036200 +_080361E4: + str r2, [sp] + movs r2, 0 + str r2, [sp, 0x4] + str r2, [sp, 0x8] + str r2, [sp, 0xC] + movs r2, 0x2 + bl sub_8035C3C + b _08036224 + .align 2, 0 +_080361F8: .4byte gUnknown_203B34C +_080361FC: .4byte gUnknown_80E5CB4 +_08036200: .4byte gUnknown_80E5FCC +_08036204: + ldr r0, _08036230 + ldr r1, [r0] + adds r0, r1, 0x4 + movs r2, 0xA2 + lsls r2, 1 + adds r1, r2 + ldr r3, _08036234 + ldr r2, _08036238 + str r2, [sp] + movs r2, 0 + str r2, [sp, 0x4] + str r2, [sp, 0x8] + str r2, [sp, 0xC] + movs r2, 0x2 + bl sub_8035C3C +_08036224: + movs r0, 0x1 +_08036226: + add sp, 0x10 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08036230: .4byte gUnknown_203B34C +_08036234: .4byte gUnknown_80E5CB4 +_08036238: .4byte gUnknown_80E5D48 + thumb_func_end SetMainMenuType + + thumb_func_start sub_803623C +sub_803623C: + push {r4,lr} + ldr r4, _08036288 + ldr r0, [r4] + movs r1, 0xA2 + lsls r1, 1 + adds r0, r1 + movs r1, 0x1 + bl sub_8035CC0 + bl sub_803628C + ldr r0, [r4] + movs r1, 0xD2 + lsls r1, 1 + adds r0, r1 + movs r1, 0x1 + negs r1, r1 + str r1, [r0] + bl SetMainMenuType + lsls r0, 24 + cmp r0, 0 + beq _08036276 + ldr r0, [r4] + adds r0, 0x4 + movs r1, 0x2 + movs r2, 0 + bl sub_8035CF4 +_08036276: + ldr r0, [r4] + adds r0, 0x4 + movs r1, 0 + movs r2, 0x1 + bl sub_8035CF4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08036288: .4byte gUnknown_203B34C + thumb_func_end sub_803623C + + thumb_func_start sub_803628C +sub_803628C: + push {r4,lr} + sub sp, 0x10 + bl sub_8011C34 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0803629E + b _080363A4 +_0803629E: + movs r0, 0x1 + bl sub_8095324 + cmp r0, 0 + bne _08036344 + movs r0, 0x7 + bl sub_8095324 + cmp r0, 0 + beq _080362FC + bl sub_803D0D8 + lsls r0, 24 + cmp r0, 0 + beq _080362DC + ldr r0, _080362D0 + ldr r1, [r0] + adds r0, r1, 0x4 + movs r2, 0xA2 + lsls r2, 1 + adds r1, r2 + ldr r3, _080362D4 + ldr r2, _080362D8 + b _0803637C + .align 2, 0 +_080362D0: .4byte gUnknown_203B34C +_080362D4: .4byte gUnknown_80E5A78 +_080362D8: .4byte gUnknown_80E5C18 +_080362DC: + ldr r0, _080362F0 + ldr r1, [r0] + adds r0, r1, 0x4 + movs r2, 0xA2 + lsls r2, 1 + adds r1, r2 + ldr r3, _080362F4 + ldr r2, _080362F8 + b _0803637C + .align 2, 0 +_080362F0: .4byte gUnknown_203B34C +_080362F4: .4byte gUnknown_80E5BC4 +_080362F8: .4byte gUnknown_80E5BDC +_080362FC: + bl sub_803D0D8 + lsls r0, 24 + cmp r0, 0 + beq _08036324 + ldr r0, _08036318 + ldr r1, [r0] + adds r0, r1, 0x4 + movs r2, 0xA2 + lsls r2, 1 + adds r1, r2 + ldr r3, _0803631C + ldr r2, _08036320 + b _0803637C + .align 2, 0 +_08036318: .4byte gUnknown_203B34C +_0803631C: .4byte gUnknown_80E5A78 +_08036320: .4byte gUnknown_80E5AFC +_08036324: + ldr r0, _08036338 + ldr r1, [r0] + adds r0, r1, 0x4 + movs r2, 0xA2 + lsls r2, 1 + adds r1, r2 + ldr r3, _0803633C + ldr r2, _08036340 + b _0803637C + .align 2, 0 +_08036338: .4byte gUnknown_203B34C +_0803633C: .4byte gUnknown_80E5A60 +_08036340: .4byte gUnknown_80E5A90 +_08036344: + bl sub_803D0D8 + lsls r0, 24 + cmp r0, 0 + beq _0803636C + ldr r0, _08036360 + ldr r1, [r0] + adds r0, r1, 0x4 + movs r2, 0xA2 + lsls r2, 1 + adds r1, r2 + ldr r3, _08036364 + ldr r2, _08036368 + b _0803637C + .align 2, 0 +_08036360: .4byte gUnknown_203B34C +_08036364: .4byte gUnknown_80E5A78 +_08036368: .4byte gUnknown_80E5B8C +_0803636C: + ldr r0, _08036394 + ldr r1, [r0] + adds r0, r1, 0x4 + movs r2, 0xA2 + lsls r2, 1 + adds r1, r2 + ldr r3, _08036398 + ldr r2, _0803639C +_0803637C: + str r2, [sp] + movs r4, 0x1 + str r4, [sp, 0x4] + ldr r2, _080363A0 + ldr r2, [r2] + str r2, [sp, 0x8] + str r4, [sp, 0xC] + movs r2, 0 + bl sub_8035C3C + b _080363C8 + .align 2, 0 +_08036394: .4byte gUnknown_203B34C +_08036398: .4byte gUnknown_80E5B34 +_0803639C: .4byte gUnknown_80E5B4C +_080363A0: .4byte gUnknown_203B350 +_080363A4: + ldr r0, _080363D0 + ldr r1, [r0] + adds r0, r1, 0x4 + movs r2, 0xA2 + lsls r2, 1 + adds r1, r2 + ldr r3, _080363D4 + ldr r2, _080363D8 + str r2, [sp] + movs r4, 0x1 + str r4, [sp, 0x4] + ldr r2, _080363DC + ldr r2, [r2] + str r2, [sp, 0x8] + str r4, [sp, 0xC] + movs r2, 0 + bl sub_8035C3C +_080363C8: + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080363D0: .4byte gUnknown_203B34C +_080363D4: .4byte gUnknown_80E59E0 +_080363D8: .4byte gUnknown_80E59F8 +_080363DC: .4byte gUnknown_203B350 + thumb_func_end sub_803628C + + thumb_func_start sub_80363E0 +sub_80363E0: + push {lr} + ldr r0, _080363F4 + ldr r0, [r0] + cmp r0, 0 + beq _080363F8 + ldr r0, [r0] + cmp r0, 0xC + beq _080363F8 + movs r0, 0x1 + b _080363FA + .align 2, 0 +_080363F4: .4byte gUnknown_203B34C +_080363F8: + movs r0, 0 +_080363FA: + pop {r1} + bx r1 + thumb_func_end sub_80363E0 + + thumb_func_start sub_8036400 +sub_8036400: + push {r4,r5,lr} + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r5, _08036444 + movs r4, 0xE8 + lsls r4, 2 + adds r0, r4, 0 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] + movs r1, 0 + adds r2, r4, 0 + bl MemoryFill8 + bl sub_8035C1C + bl sub_8035DA0 + ldr r1, [r5] + movs r0, 0x13 + str r0, [r1, 0x4] + movs r0, 0 + bl sub_8036FC4 + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08036444: .4byte gUnknown_203B358 + thumb_func_end sub_8036400 + + thumb_func_start sub_8036448 +sub_8036448: + push {lr} + ldr r0, _08036460 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0x12 + bhi _08036524 + lsls r0, 2 + ldr r1, _08036464 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08036460: .4byte gUnknown_203B358 +_08036464: .4byte _08036468 + .align 2, 0 +_08036468: + .4byte _080364B4 + .4byte _080364BA + .4byte _080364C0 + .4byte _080364C6 + .4byte _080364D2 + .4byte _080364CC + .4byte _080364D8 + .4byte _080364DE + .4byte _080364E4 + .4byte _080364F0 + .4byte _080364F6 + .4byte _080364FC + .4byte _08036502 + .4byte _08036514 + .4byte _08036508 + .4byte _080364EA + .4byte _0803650E + .4byte _0803651A + .4byte _08036520 +_080364B4: + bl sub_803652C + b _08036524 +_080364BA: + bl sub_8036590 + b _08036524 +_080364C0: + bl sub_80365AC + b _08036524 +_080364C6: + bl sub_8036674 + b _08036524 +_080364CC: + bl sub_8036728 + b _08036524 +_080364D2: + bl sub_8036788 + b _08036524 +_080364D8: + bl sub_8036830 + b _08036524 +_080364DE: + bl sub_803689C + b _08036524 +_080364E4: + bl sub_80368D4 + b _08036524 +_080364EA: + bl sub_8036A7C + b _08036524 +_080364F0: + bl sub_8036934 + b _08036524 +_080364F6: + bl sub_8036950 + b _08036524 +_080364FC: + bl sub_8036AA4 + b _08036524 +_08036502: + bl sub_80369FC + b _08036524 +_08036508: + bl sub_8036A34 + b _08036524 +_0803650E: + bl sub_8036A54 + b _08036524 +_08036514: + bl sub_8036A18 + b _08036524 +_0803651A: + bl sub_8036ADC + b _08036524 +_08036520: + movs r0, 0x3 + b _08036526 +_08036524: + movs r0, 0 +_08036526: + pop {r1} + bx r1 + thumb_func_end sub_8036448 + + thumb_func_start sub_803652C +sub_803652C: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + adds r1, r0, 0 + cmp r1, 0 + bne _0803658A + ldr r2, [sp] + cmp r2, 0x1 + beq _08036556 + cmp r2, 0x1 + bgt _0803654C + cmp r2, 0 + beq _08036584 + b _0803658A +_0803654C: + cmp r2, 0x2 + beq _0803656C + cmp r2, 0x7 + beq _08036584 + b _0803658A +_08036556: + ldr r0, _08036568 + ldr r0, [r0] + str r1, [r0, 0x8] + str r2, [r0, 0x10] + movs r0, 0x1 + bl sub_8036FC4 + b _0803658A + .align 2, 0 +_08036568: .4byte gUnknown_203B358 +_0803656C: + ldr r0, _08036580 + ldr r1, [r0] + movs r0, 0x1 + str r0, [r1, 0x8] + str r2, [r1, 0x10] + movs r0, 0x7 + bl sub_8036FC4 + b _0803658A + .align 2, 0 +_08036580: .4byte gUnknown_203B358 +_08036584: + movs r0, 0x12 + bl sub_8036FC4 +_0803658A: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_803652C + + thumb_func_start sub_8036590 +sub_8036590: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080365A4 + movs r0, 0x2 + bl sub_8036FC4 +_080365A4: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8036590 + + thumb_func_start sub_80365AC +sub_80365AC: + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, _080365E8 + ldr r0, [r4] + ldr r7, _080365EC + adds r0, r7 + movs r1, 0 + strb r1, [r0] + ldr r0, [r4] + ldr r6, _080365F0 + adds r0, r6 + movs r5, 0x1 + strb r5, [r0] + ldr r0, [r4] + movs r2, 0x97 + lsls r2, 2 + mov r8, r2 + add r0, r8 + strb r1, [r0] + movs r0, 0x1 + bl sub_801CA08 + cmp r0, 0x3 + beq _08036606 + cmp r0, 0x3 + bhi _080365F4 + cmp r0, 0x2 + beq _080365FA + b _0803666A + .align 2, 0 +_080365E8: .4byte gUnknown_203B358 +_080365EC: .4byte 0x0000025e +_080365F0: .4byte 0x0000025d +_080365F4: + cmp r0, 0x4 + beq _0803662C + b _0803666A +_080365FA: + bl sub_801CBB8 + movs r0, 0 + bl sub_8036FC4 + b _0803666A +_08036606: + bl sub_801CB24 + ldr r1, [r4] + ldr r2, _08036624 + adds r1, r2 + strb r0, [r1] + ldr r0, [r4] + ldr r1, _08036628 + adds r0, r1 + strb r5, [r0] + movs r0, 0x3 + bl sub_8036FC4 + b _0803666A + .align 2, 0 +_08036624: .4byte 0x0000025e +_08036628: .4byte 0x0000025d +_0803662C: + ldr r1, [r4] + movs r0, 0x2 + str r0, [r1, 0x4] + bl sub_801CB24 + ldr r1, [r4] + adds r1, r7 + strb r0, [r1] + ldr r0, [r4] + adds r0, r6 + strb r5, [r0] + ldr r0, [r4] + movs r2, 0xF2 + lsls r2, 1 + adds r0, r2 + bl sub_8006518 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + add r0, r8 + bl sub_801B3C0 + movs r0, 0x5 + bl sub_8036FC4 +_0803666A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80365AC + + thumb_func_start sub_8036674 +sub_8036674: + push {r4,lr} + sub sp, 0x4 + movs r0, 0x1 + negs r0, r0 + str r0, [sp] + movs r0, 0 + bl sub_801CA08 + ldr r4, _080366B8 + ldr r0, [r4] + movs r1, 0x9A + lsls r1, 1 + adds r0, r1 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _080366A6 + ldr r0, [r4] + movs r1, 0x9A + lsls r1, 1 + adds r0, r1 + mov r1, sp + bl sub_8013114 +_080366A6: + ldr r0, [sp] + cmp r0, 0x3 + beq _080366C6 + cmp r0, 0x3 + bgt _080366BC + cmp r0, 0 + beq _08036700 + b _0803671A + .align 2, 0 +_080366B8: .4byte gUnknown_203B358 +_080366BC: + cmp r0, 0x4 + beq _080366CE + cmp r0, 0x7 + beq _08036700 + b _0803671A +_080366C6: + movs r0, 0x4 + bl sub_8036FC4 + b _0803671A +_080366CE: + ldr r0, [r4] + movs r1, 0x13 + str r1, [r0, 0x4] + movs r1, 0xF2 + lsls r1, 1 + adds r0, r1 + bl sub_8006518 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + movs r1, 0x97 + lsls r1, 2 + adds r0, r1 + bl sub_801B3C0 + movs r0, 0x5 + bl sub_8036FC4 + b _0803671A +_08036700: + ldr r0, _08036724 + ldr r0, [r0] + movs r1, 0xC2 + lsls r1, 1 + adds r0, r1 + movs r1, 0x3 + bl sub_8035CC0 + bl sub_801CCD8 + movs r0, 0x2 + bl sub_8036FC4 +_0803671A: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08036724: .4byte gUnknown_203B358 + thumb_func_end sub_8036674 + + thumb_func_start sub_8036728 +sub_8036728: + push {r4,lr} + bl sub_801B410 + cmp r0, 0x1 + beq _08036780 + cmp r0, 0x1 + bcc _08036780 + cmp r0, 0x3 + bhi _08036780 + bl sub_801B450 + bl sub_8004914 + ldr r4, _08036778 + ldr r0, [r4] + movs r1, 0xF2 + lsls r1, 1 + adds r0, r1 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0x1 + bl sub_801CB5C + ldr r4, [r4] + ldr r0, [r4, 0x4] + cmp r0, 0x13 + bne _0803677C + adds r0, r4, 0 + adds r0, 0x44 + movs r1, 0x3 + movs r2, 0x1 + bl sub_8035CF4 + movs r0, 0x3 + bl sub_8036FC4 + b _08036780 + .align 2, 0 +_08036778: .4byte gUnknown_203B358 +_0803677C: + bl sub_8036FC4 +_08036780: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8036728 + + thumb_func_start sub_8036788 +sub_8036788: + push {r4,lr} + ldr r4, _080367B8 + ldr r0, [r4] + movs r1, 0x9A + lsls r1, 1 + adds r0, r1 + bl sub_8012FD8 + movs r0, 0 + bl sub_801CA08 + ldr r0, [r4] + adds r0, 0x14 + bl sub_8013BBC + cmp r0, 0x1 + beq _080367BC + cmp r0, 0x1 + bcc _08036824 + cmp r0, 0x2 + beq _080367D2 + cmp r0, 0x3 + beq _080367F8 + b _08036824 + .align 2, 0 +_080367B8: .4byte gUnknown_203B358 +_080367BC: + bl sub_801CCD8 + ldr r0, [r4] + adds r0, 0x44 + movs r1, 0x3 + movs r2, 0 + bl sub_8035CF4 + bl sub_8036F30 + b _08036824 +_080367D2: + ldr r0, [r4] + movs r2, 0xC2 + lsls r2, 1 + adds r0, r2 + movs r1, 0x2 + bl sub_8035CC0 + bl sub_801CCD8 + ldr r0, [r4] + adds r0, 0x44 + movs r1, 0x3 + movs r2, 0x1 + bl sub_8035CF4 + movs r0, 0x3 + bl sub_8036FC4 + b _08036824 +_080367F8: + ldr r0, [r4] + ldr r1, [r0, 0x14] + ldr r2, _0803682C + adds r0, r2 + strb r1, [r0] + ldr r0, [r4] + adds r2, 0x1 + adds r1, r0, r2 + ldrb r1, [r1] + subs r2, 0xA + adds r0, r2 + strb r1, [r0] + ldr r0, [r4] + adds r2, 0x4 + adds r1, r0, r2 + ldr r0, [r0, 0x14] + str r0, [r1] + bl sub_801CBB8 + movs r0, 0x6 + bl sub_8036FC4 +_08036824: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0803682C: .4byte 0x0000025d + thumb_func_end sub_8036788 + + thumb_func_start sub_8036830 +sub_8036830: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08036896 + ldr r0, [sp] + cmp r0, 0x5 + beq _08036854 + cmp r0, 0x5 + bgt _0803684E + cmp r0, 0 + beq _08036890 + b _08036896 +_0803684E: + cmp r0, 0x6 + beq _08036890 + b _08036896 +_08036854: + bl sub_801CBB8 + ldr r0, _08036884 + ldr r2, [r0] + ldr r0, _08036888 + ldr r1, [r0] + ldr r3, _0803688C + adds r0, r1, r3 + ldrb r0, [r0] + lsls r0, 1 + adds r2, 0x50 + adds r2, r0 + ldrh r0, [r2] + ldr r1, [r1, 0x14] + subs r0, r1 + strh r0, [r2] + movs r0, 0xF + bl sub_8036FC4 + movs r0, 0 + bl sub_8012574 + b _08036896 + .align 2, 0 +_08036884: .4byte gUnknown_203B460 +_08036888: .4byte gUnknown_203B358 +_0803688C: .4byte 0x0000025e +_08036890: + movs r0, 0 + bl sub_8036FC4 +_08036896: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8036830 + + thumb_func_start sub_803689C +sub_803689C: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080368CE + ldr r0, [sp] + cmp r0, 0x5 + beq _080368C0 + cmp r0, 0x5 + bgt _080368BA + cmp r0, 0 + beq _080368C8 + b _080368CE +_080368BA: + cmp r0, 0x7 + beq _080368C8 + b _080368CE +_080368C0: + movs r0, 0x9 + bl sub_8036FC4 + b _080368CE +_080368C8: + movs r0, 0x12 + bl sub_8036FC4 +_080368CE: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_803689C + + thumb_func_start sub_80368D4 +sub_80368D4: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0803692A + ldr r0, [sp] + cmp r0, 0x5 + beq _080368F8 + cmp r0, 0x5 + bgt _080368F2 + cmp r0, 0 + beq _08036900 + b _0803692A +_080368F2: + cmp r0, 0x7 + beq _08036900 + b _0803692A +_080368F8: + movs r0, 0x9 + bl sub_8036FC4 + b _0803692A +_08036900: + ldr r0, _08036930 + ldr r1, [r0] + movs r2, 0x95 + lsls r2, 2 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _0803692A + adds r2, 0x4 + adds r0, r1, r2 + ldr r0, [r0] + cmp r0, 0 + beq _0803692A + bl sub_80369D0 + movs r0, 0x11 + bl sub_8036FC4 + movs r0, 0 + bl sub_8012574 +_0803692A: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08036930: .4byte gUnknown_203B358 + thumb_func_end sub_80368D4 + + thumb_func_start sub_8036934 +sub_8036934: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08036948 + movs r0, 0xA + bl sub_8036FC4 +_08036948: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8036934 + + thumb_func_start sub_8036950 +sub_8036950: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _080369C8 + ldr r0, _08036978 + ldr r2, [r0] + ldr r1, [r2, 0xC] + adds r3, r0, 0 + cmp r1, 0 + bne _0803698C + ldr r0, [r2, 0x8] + cmp r0, 0 + beq _0803697C + cmp r0, 0x1 + beq _08036984 + b _080369C8 + .align 2, 0 +_08036978: .4byte gUnknown_203B358 +_0803697C: + movs r0, 0xD + bl sub_8036FC4 + b _080369C8 +_08036984: + movs r0, 0xE + bl sub_8036FC4 + b _080369C8 +_0803698C: + ldr r0, [r2, 0x8] + cmp r0, 0 + bne _080369BA + movs r1, 0x95 + lsls r1, 2 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080369BA + adds r1, 0x4 + adds r0, r2, r1 + ldr r0, [r0] + cmp r0, 0 + beq _080369BA + bl sub_80369D0 + movs r0, 0xB + bl sub_8036FC4 + movs r0, 0 + bl sub_8012574 + b _080369C8 +_080369BA: + ldr r0, [r3] + ldr r0, [r0, 0xC] + bl sub_8036E18 + movs r0, 0xC + bl sub_8036FC4 +_080369C8: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8036950 + + thumb_func_start sub_80369D0 +sub_80369D0: + ldr r0, _080369F4 + ldr r2, [r0] + ldr r0, _080369F8 + ldr r1, [r0] + movs r3, 0x95 + lsls r3, 2 + adds r0, r1, r3 + ldrb r0, [r0] + lsls r0, 1 + adds r2, 0x50 + adds r2, r0 + ldrh r0, [r2] + adds r3, 0x4 + adds r1, r3 + ldr r1, [r1] + adds r0, r1 + strh r0, [r2] + bx lr + .align 2, 0 +_080369F4: .4byte gUnknown_203B460 +_080369F8: .4byte gUnknown_203B358 + thumb_func_end sub_80369D0 + + thumb_func_start sub_80369FC +sub_80369FC: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08036A10 + movs r0, 0 + bl sub_8036FC4 +_08036A10: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80369FC + + thumb_func_start sub_8036A18 +sub_8036A18: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08036A2C + movs r0, 0x12 + bl sub_8036FC4 +_08036A2C: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8036A18 + + thumb_func_start sub_8036A34 +sub_8036A34: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08036A4E + movs r0, 0x10 + bl sub_8036FC4 + movs r0, 0 + bl sub_8012574 +_08036A4E: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8036A34 + + thumb_func_start sub_8036A54 +sub_8036A54: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08036A76 + bl sub_8012600 + lsls r0, 24 + cmp r0, 0 + bne _08036A76 + bl sub_8012750 + movs r0, 0x12 + bl sub_8036FC4 +_08036A76: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8036A54 + + thumb_func_start sub_8036A7C +sub_8036A7C: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08036A9E + bl sub_8012600 + lsls r0, 24 + cmp r0, 0 + bne _08036A9E + bl sub_8012750 + movs r0, 0x8 + bl sub_8036FC4 +_08036A9E: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8036A7C + + thumb_func_start sub_8036AA4 +sub_8036AA4: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08036AD0 + bl sub_8012600 + lsls r0, 24 + cmp r0, 0 + bne _08036AD0 + bl sub_8012750 + ldr r0, _08036AD8 + ldr r0, [r0] + ldr r0, [r0, 0xC] + bl sub_8036E18 + movs r0, 0xC + bl sub_8036FC4 +_08036AD0: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_08036AD8: .4byte gUnknown_203B358 + thumb_func_end sub_8036AA4 + + thumb_func_start sub_8036ADC +sub_8036ADC: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08036AFE + bl sub_8012600 + lsls r0, 24 + cmp r0, 0 + bne _08036AFE + bl sub_8012750 + movs r0, 0x12 + bl sub_8036FC4 +_08036AFE: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8036ADC + + thumb_func_start sub_8036B04 +sub_8036B04: + push {r4,lr} + ldr r4, _08036B20 + ldr r0, [r4] + cmp r0, 0 + beq _08036B1A + bl MemoryFree + movs r0, 0 + str r0, [r4] + bl sub_801CBB8 +_08036B1A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08036B20: .4byte gUnknown_203B358 + thumb_func_end sub_8036B04 + + thumb_func_start nullsub_52 +nullsub_52: + bx lr + thumb_func_end nullsub_52 + + thumb_func_start sub_8036B28 +sub_8036B28: + push {r4,r5,lr} + sub sp, 0x18 + ldr r1, _08036B44 + ldr r0, [r1] + ldr r0, [r0] + adds r5, r1, 0 + cmp r0, 0x12 + bls _08036B3A + b _08036DFA +_08036B3A: + lsls r0, 2 + ldr r1, _08036B48 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08036B44: .4byte gUnknown_203B358 +_08036B48: .4byte _08036B4C + .align 2, 0 +_08036B4C: + .4byte _08036B98 + .4byte _08036BDC + .4byte _08036BE4 + .4byte _08036C14 + .4byte _08036C58 + .4byte _08036DFA + .4byte _08036C5E + .4byte _08036C90 + .4byte _08036C98 + .4byte _08036CC0 + .4byte _08036CD8 + .4byte _08036DFA + .4byte _08036DFA + .4byte _08036DD8 + .4byte _08036D70 + .4byte _08036DFA + .4byte _08036DFA + .4byte _08036DFA + .4byte _08036DFA +_08036B98: + movs r0, 0 + bl sub_801CF14 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + beq _08036BB8 + ldr r0, _08036BB0 + ldr r3, _08036BB4 + movs r2, 0 + b _08036BBC + .align 2, 0 +_08036BB0: .4byte gUnknown_80E61A4 +_08036BB4: .4byte gUnknown_80E60D4 +_08036BB8: + ldr r0, _08036BD4 + ldr r3, _08036BD8 +_08036BBC: + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + str r2, [sp, 0xC] + adds r1, 0xFD + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0x1 + bl sub_8014248 + b _08036DFA + .align 2, 0 +_08036BD4: .4byte gUnknown_80E61A4 +_08036BD8: .4byte gUnknown_80E60A0 +_08036BDC: + ldr r0, _08036BE0 + b _08036DBA + .align 2, 0 +_08036BE0: .4byte gUnknown_80E61C0 +_08036BE4: + bl sub_801D008 + cmp r0, 0 + beq _08036BEE + b _08036DFA +_08036BEE: + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, _08036C10 + str r0, [sp, 0x14] + movs r0, 0 + movs r1, 0x1 + add r2, sp, 0x14 + movs r3, 0x9 + bl sub_801C8C4 + b _08036DFA + .align 2, 0 +_08036C10: .4byte 0x00020003 +_08036C14: + ldr r0, [r5] + movs r4, 0xC2 + lsls r4, 1 + adds r0, r4 + bl sub_8006518 + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0x44 + adds r1, r4 + ldr r3, _08036C50 + ldr r2, _08036C54 + str r2, [sp] + movs r2, 0x1 + str r2, [sp, 0x4] + movs r2, 0 + str r2, [sp, 0x8] + str r2, [sp, 0xC] + movs r2, 0x3 + bl sub_8035C3C + bl sub_801CCD8 + ldr r0, [r5] + adds r0, 0x44 + movs r1, 0x3 + movs r2, 0x1 + bl sub_8035CF4 + b _08036DFA + .align 2, 0 +_08036C50: .4byte gUnknown_80E60EC +_08036C54: .4byte gUnknown_80E6104 +_08036C58: + bl sub_8036F74 + b _08036DFA +_08036C5E: + ldr r2, _08036C7C + ldr r1, [r5] + ldr r0, [r1, 0x14] + str r0, [r2] + ldr r0, _08036C80 + ldr r2, _08036C84 + adds r1, r2 + ldrb r1, [r1] + movs r2, 0 + bl sub_8090DC4 + ldr r0, _08036C88 + ldr r3, _08036C8C + b _08036C9C + .align 2, 0 +_08036C7C: .4byte gUnknown_202DE30 +_08036C80: .4byte gUnknown_202DE58 +_08036C84: .4byte 0x0000025e +_08036C88: .4byte gUnknown_80E61E4 +_08036C8C: .4byte gUnknown_80E6154 +_08036C90: + ldr r0, _08036C94 + b _08036C9A + .align 2, 0 +_08036C94: .4byte gUnknown_80E6214 +_08036C98: + ldr r0, _08036CB8 +_08036C9A: + ldr r3, _08036CBC +_08036C9C: + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + str r2, [sp, 0xC] + adds r1, 0xFD + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0x5 + bl sub_8014248 + b _08036DFA + .align 2, 0 +_08036CB8: .4byte gUnknown_80E6268 +_08036CBC: .4byte gUnknown_80E618C +_08036CC0: + movs r0, 0 + bl nullsub_23 + ldr r0, _08036CD4 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_80141B4 + b _08036DFA + .align 2, 0 +_08036CD4: .4byte gUnknown_80E62C4 +_08036CD8: + ldr r4, _08036D18 + ldr r1, [r4] + movs r0, 0 + str r0, [r1, 0xC] + movs r2, 0 + movs r3, 0 + movs r5, 0x91 + lsls r5, 2 + adds r0, r1, r5 + str r2, [r0] + str r3, [r0, 0x4] + movs r0, 0x93 + lsls r0, 2 + adds r1, r0 + str r2, [r1] + str r3, [r1, 0x4] + bl sub_8011830 + ldr r0, [r4] + ldr r0, [r0, 0x8] + bl sub_8037B28 + ldr r4, [r4] + str r0, [r4, 0xC] + cmp r0, 0 + bne _08036D44 + ldr r0, [r4, 0x8] + cmp r0, 0 + beq _08036D1C + cmp r0, 0x1 + beq _08036D2C + b _08036D44 + .align 2, 0 +_08036D18: .4byte gUnknown_203B358 +_08036D1C: + adds r2, r4, r5 + movs r1, 0x95 + lsls r1, 2 + adds r0, r4, r1 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r2] + str r1, [r2, 0x4] +_08036D2C: + ldr r4, _08036D6C + ldr r2, [r4] + ldr r0, [r2, 0x8] + movs r3, 0x91 + lsls r3, 2 + adds r1, r2, r3 + adds r3, 0x8 + adds r2, r3 + bl sub_8037D64 + ldr r1, [r4] + str r0, [r1, 0xC] +_08036D44: + ldr r4, _08036D6C + ldr r2, [r4] + ldr r0, [r2, 0xC] + cmp r0, 0 + bne _08036D66 + ldr r0, [r2, 0x8] + cmp r0, 0x1 + bhi _08036D66 + movs r3, 0x91 + lsls r3, 2 + adds r1, r2, r3 + adds r3, 0x8 + adds r2, r3 + bl sub_80381F4 + ldr r1, [r4] + str r0, [r1, 0xC] +_08036D66: + bl sub_8011854 + b _08036DFA + .align 2, 0 +_08036D6C: .4byte gUnknown_203B358 +_08036D70: + ldr r2, [r5] + movs r1, 0x94 + lsls r1, 2 + adds r0, r2, r1 + ldr r1, [r0] + cmp r1, 0 + bne _08036DA4 + ldr r1, _08036D9C + movs r3, 0x92 + lsls r3, 2 + adds r0, r2, r3 + ldr r0, [r0] + str r0, [r1] + ldr r0, _08036DA0 + subs r3, 0x4 + adds r1, r2, r3 + ldrb r1, [r1] + movs r2, 0 + bl sub_8090DC4 + b _08036DB8 + .align 2, 0 +_08036D9C: .4byte gUnknown_202DE30 +_08036DA0: .4byte gUnknown_202DE58 +_08036DA4: + ldr r0, _08036DC8 + str r1, [r0] + ldr r0, _08036DCC + movs r3, 0x93 + lsls r3, 2 + adds r1, r2, r3 + ldrb r1, [r1] + movs r2, 0 + bl sub_8090DC4 +_08036DB8: + ldr r0, _08036DD0 +_08036DBA: + ldr r3, _08036DD4 + movs r1, 0 + movs r2, 0 + bl sub_80141B4 + b _08036DFA + .align 2, 0 +_08036DC8: .4byte gUnknown_202DE30 +_08036DCC: .4byte gUnknown_202DE58 +_08036DD0: .4byte gUnknown_80E6314 +_08036DD4: .4byte 0x00000101 +_08036DD8: + ldr r2, _08036E04 + ldr r1, [r5] + ldr r0, [r1, 0x14] + str r0, [r2] + ldr r0, _08036E08 + ldr r2, _08036E0C + adds r1, r2 + ldrb r1, [r1] + movs r2, 0 + bl sub_8090DC4 + ldr r0, _08036E10 + ldr r3, _08036E14 + movs r1, 0 + movs r2, 0 + bl sub_80141B4 +_08036DFA: + add sp, 0x18 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08036E04: .4byte gUnknown_202DE30 +_08036E08: .4byte gUnknown_202DE58 +_08036E0C: .4byte 0x0000025e +_08036E10: .4byte gUnknown_80E6358 +_08036E14: .4byte 0x00000101 + thumb_func_end sub_8036B28 + + thumb_func_start sub_8036E18 +sub_8036E18: + push {lr} + cmp r0, 0xF + bhi _08036EB4 + lsls r0, 2 + ldr r1, _08036E28 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08036E28: .4byte _08036E2C + .align 2, 0 +_08036E2C: + .4byte _08036EC0 + .4byte _08036E6C + .4byte _08036E7C + .4byte _08036E74 + .4byte _08036E84 + .4byte _08036E8C + .4byte _08036EB4 + .4byte _08036EB4 + .4byte _08036EB4 + .4byte _08036EB4 + .4byte _08036EB4 + .4byte _08036EB4 + .4byte _08036EB4 + .4byte _08036EB4 + .4byte _08036E94 + .4byte _08036E9C +_08036E6C: + ldr r0, _08036E70 + b _08036E9E + .align 2, 0 +_08036E70: .4byte gUnknown_80E6378 +_08036E74: + ldr r0, _08036E78 + b _08036E9E + .align 2, 0 +_08036E78: .4byte gUnknown_80E639C +_08036E7C: + ldr r0, _08036E80 + b _08036E9E + .align 2, 0 +_08036E80: .4byte gUnknown_80E63F8 +_08036E84: + ldr r0, _08036E88 + b _08036E9E + .align 2, 0 +_08036E88: .4byte gUnknown_80E6448 +_08036E8C: + ldr r0, _08036E90 + b _08036E9E + .align 2, 0 +_08036E90: .4byte gUnknown_80E6378 +_08036E94: + ldr r0, _08036E98 + b _08036E9E + .align 2, 0 +_08036E98: .4byte gUnknown_80E6378 +_08036E9C: + ldr r0, _08036EAC +_08036E9E: + ldr r3, _08036EB0 + movs r1, 0 + movs r2, 0 + bl sub_80141B4 + b _08036EC0 + .align 2, 0 +_08036EAC: .4byte gUnknown_80E64AC +_08036EB0: .4byte 0x00000101 +_08036EB4: + ldr r0, _08036EC4 + ldr r3, _08036EC8 + movs r1, 0 + movs r2, 0 + bl sub_80141B4 +_08036EC0: + pop {r0} + bx r0 + .align 2, 0 +_08036EC4: .4byte gUnknown_80E6378 +_08036EC8: .4byte 0x00000101 + thumb_func_end sub_8036E18 + + thumb_func_start sub_8036ECC +sub_8036ECC: + push {r4-r6,lr} + adds r3, r0, 0 + ldr r6, _08036F28 + ldr r0, [r6] + movs r2, 0x3 + str r2, [r0, 0x24] + movs r2, 0x1 + str r2, [r0, 0x18] + str r2, [r0, 0x1C] + str r1, [r0, 0x20] + movs r1, 0x2C + str r1, [r0, 0x30] + movs r1, 0x12 + str r1, [r0, 0x34] + str r3, [r0, 0x28] + lsls r4, r3, 1 + adds r4, r3 + lsls r4, 3 + movs r5, 0xC2 + lsls r5, 1 + adds r1, r4, r5 + adds r1, r0, r1 + str r1, [r0, 0x2C] + adds r0, 0x14 + bl sub_8013AA0 + ldr r1, [r6] + adds r1, r4 + adds r1, r5 + ldr r0, _08036F2C + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + bl sub_8004914 + ldr r0, [r6] + adds r0, r5 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08036F28: .4byte gUnknown_203B358 +_08036F2C: .4byte gUnknown_80E6174 + thumb_func_end sub_8036ECC + + thumb_func_start sub_8036F30 +sub_8036F30: + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, _08036F6C + ldr r0, [r5] + ldr r4, [r0, 0x28] + adds r0, r4, 0 + bl sub_8008C54 + adds r0, r4, 0 + bl sub_80073B8 + ldr r2, _08036F70 + movs r0, 0 + str r0, [sp] + movs r0, 0x2 + movs r1, 0 + adds r3, r4, 0 + bl xxx_call_draw_string + ldr r0, [r5] + adds r0, 0x14 + bl sub_8013C68 + adds r0, r4, 0 + bl sub_80073E0 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08036F6C: .4byte gUnknown_203B358 +_08036F70: .4byte gUnknown_80E6528 + thumb_func_end sub_8036F30 + + thumb_func_start sub_8036F74 +sub_8036F74: + push {r4,lr} + ldr r4, _08036FB8 + ldr r0, [r4] + movs r1, 0xC2 + lsls r1, 1 + adds r0, r1 + bl sub_8006518 + ldr r0, _08036FBC + ldr r1, [r0] + ldr r0, [r4] + ldr r2, _08036FC0 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 1 + adds r1, 0x50 + adds r1, r0 + ldrh r1, [r1] + movs r0, 0x2 + bl sub_8036ECC + bl sub_801CCD8 + ldr r0, [r4] + adds r0, 0x44 + movs r1, 0x3 + movs r2, 0 + bl sub_8035CF4 + bl sub_8036F30 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08036FB8: .4byte gUnknown_203B358 +_08036FBC: .4byte gUnknown_203B460 +_08036FC0: .4byte 0x0000025e + thumb_func_end sub_8036F74 + + thumb_func_start sub_8036FC4 +sub_8036FC4: + push {lr} + ldr r1, _08036FD8 + ldr r1, [r1] + str r0, [r1] + bl nullsub_52 + bl sub_8036B28 + pop {r0} + bx r0 + .align 2, 0 +_08036FD8: .4byte gUnknown_203B358 + thumb_func_end sub_8036FC4 + + thumb_func_start sub_8036FDC +sub_8036FDC: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + adds r6, r0, 0 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0 + bl sub_8004D8C + ldr r5, _080370C0 + ldr r0, [r5] + cmp r0, 0 + bne _08037016 + ldr r4, _080370C4 + adds r0, r4, 0 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] + movs r1, 0 + adds r2, r4, 0 + bl MemoryFill8 +_08037016: + ldr r0, [r5] + str r6, [r0] + movs r1, 0 + str r1, [r0, 0x4] + str r1, [r0, 0x8] + movs r3, 0 + adds r7, r5, 0 + movs r6, 0xE0 + lsls r6, 1 + movs r4, 0 + movs r5, 0xDE + lsls r5, 1 +_0803702E: + ldr r0, [r7] + lsls r2, r3, 3 + adds r1, r0, r6 + adds r1, r2 + str r4, [r1] + adds r0, r2 + adds r0, r5 + strb r4, [r0] + adds r3, 0x1 + cmp r3, 0x1 + ble _0803702E + ldr r0, _080370C0 + mov r12, r0 + movs r5, 0xAE + lsls r5, 1 + mov r8, r5 + ldr r4, _080370C8 + movs r3, 0 + movs r2, 0x3 +_08037054: + mov r6, r12 + ldr r1, [r6] + adds r1, r3 + add r1, r8 + adds r0, r4, 0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r3, 0x18 + subs r2, 0x1 + cmp r2, 0 + bge _08037054 + movs r6, 0 + bl sub_8004914 + ldr r5, _080370C0 + ldr r0, [r5] + movs r4, 0xAE + lsls r4, 1 + adds r0, r4 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0x1C + adds r1, r4 + ldr r3, _080370CC + ldr r2, _080370D0 + str r2, [sp] + str r6, [sp, 0x4] + movs r2, 0x6 + str r2, [sp, 0x8] + str r6, [sp, 0xC] + movs r2, 0 + bl sub_8035C3C + ldr r0, [r5] + adds r0, 0x1C + movs r1, 0 + movs r2, 0x1 + bl sub_8035CF4 + bl sub_80376CC + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080370C0: .4byte gUnknown_203B35C +_080370C4: .4byte 0x00000504 +_080370C8: .4byte gUnknown_80E653C +_080370CC: .4byte gUnknown_80E6CD0 +_080370D0: .4byte gUnknown_80E6CE8 + thumb_func_end sub_8036FDC + + thumb_func_start sub_80370D4 +sub_80370D4: + push {r4,lr} + ldr r4, _080370EC + ldr r0, [r4] + cmp r0, 0 + beq _080370E6 + bl MemoryFree + movs r0, 0 + str r0, [r4] +_080370E6: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080370EC: .4byte gUnknown_203B35C + thumb_func_end sub_80370D4 + + thumb_func_start sub_80370F0 +sub_80370F0: + push {r4,r5,lr} + sub sp, 0x4 + movs r0, 0x4 + str r0, [sp] + ldr r5, _08037110 + ldr r4, _08037114 + ldr r1, [r4] + ldr r0, [r1, 0x8] + cmp r0, 0x1 + beq _08037148 + cmp r0, 0x1 + bcc _08037118 + cmp r0, 0x2 + beq _08037158 + b _080371A8 + .align 2, 0 +_08037110: .4byte 0x0000ffdc +_08037114: .4byte gUnknown_203B35C +_08037118: + adds r0, r1, 0 + adds r0, 0x1C + bl sub_80130A8 + lsls r0, 24 + cmp r0, 0 + bne _08037130 + ldr r0, [r4] + adds r0, 0x1C + mov r1, sp + bl sub_8013114 +_08037130: + ldr r0, [sp] + cmp r0, 0x4 + bne _0803713C + bl sub_8037748 + b _080371A8 +_0803713C: + ldr r1, [r4] + movs r0, 0x1 + str r0, [r1, 0x8] + bl sub_8037900 + b _080371A8 +_08037148: + bl sub_80376CC + ldr r1, [r4] + movs r0, 0x2 + str r0, [r1, 0x8] + bl sub_80371B8 + b _080371A8 +_08037158: + ldr r0, [r1] + cmp r0, 0x1 + bhi _08037172 + ldr r0, [r1, 0x4] + cmp r0, 0 + bne _08037172 + movs r0, 0 + bl sub_8037C10 + cmp r0, 0 + bne _08037172 + movs r0, 0x29 + b _080371AA +_08037172: + ldr r4, _080371B4 + ldr r0, [r4] + adds r0, 0x1C + bl sub_80130A8 + lsls r0, 24 + cmp r0, 0 + bne _0803718C + ldr r0, [r4] + adds r0, 0x1C + mov r1, sp + bl sub_8013114 +_0803718C: + ldr r0, [sp] + cmp r0, 0x4 + beq _080371A4 + movs r0, 0x3 + bl sub_80119D4 + bl sub_8037798 + adds r5, r0, 0 + ldr r1, [r4] + movs r0, 0x4 + str r0, [r1, 0x8] +_080371A4: + bl sub_8037748 +_080371A8: + adds r0, r5, 0 +_080371AA: + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080371B4: .4byte gUnknown_203B35C + thumb_func_end sub_80370F0 + + thumb_func_start sub_80371B8 +sub_80371B8: + push {r4-r7,lr} + sub sp, 0x10 + movs r6, 0 + movs r5, 0 + bl sub_8037400 + ldr r7, _0803721C + ldr r1, [r7] + ldr r0, [r1] + cmp r0, 0x1 + bhi _08037228 + ldr r0, [r1, 0x4] + cmp r0, 0 + bne _08037228 + movs r0, 0 + bl sub_8037C10 + cmp r0, 0 + bne _080371E0 + b _080373AC +_080371E0: + bl sub_80376CC + ldr r0, [r7] + movs r4, 0xAE + lsls r4, 1 + adds r0, r4 + movs r1, 0 + bl sub_8035CC0 + ldr r1, [r7] + adds r0, r1, 0 + adds r0, 0x1C + adds r1, r4 + ldr r3, _08037220 + ldr r2, _08037224 + str r2, [sp] + str r6, [sp, 0x4] + movs r2, 0x6 + str r2, [sp, 0x8] + str r6, [sp, 0xC] + movs r2, 0 + bl sub_8035C3C + ldr r0, [r7] + adds r0, 0x1C + movs r1, 0 + movs r2, 0x1 + bl sub_8035CF4 + b _080373AC + .align 2, 0 +_0803721C: .4byte gUnknown_203B35C +_08037220: .4byte gUnknown_80E6C50 +_08037224: .4byte gUnknown_80E6C68 +_08037228: + bl sub_80376CC + ldr r4, _08037250 + ldr r0, [r4] + movs r1, 0xAE + lsls r1, 1 + adds r0, r1 + movs r1, 0 + bl sub_8035CC0 + ldr r0, [r4] + ldr r0, [r0, 0x4] + cmp r0, 0xF + bls _08037246 + b _0803734C +_08037246: + lsls r0, 2 + ldr r1, _08037254 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08037250: .4byte gUnknown_203B35C +_08037254: .4byte _08037258 + .align 2, 0 +_08037258: + .4byte _08037298 + .4byte _080372D8 + .4byte _080372B8 + .4byte _080372A8 + .4byte _080372C8 + .4byte _080372D8 + .4byte _080372E8 + .4byte _080372F8 + .4byte _0803734C + .4byte _08037308 + .4byte _0803734C + .4byte _08037318 + .4byte _0803734C + .4byte _08037328 + .4byte _08037338 + .4byte _08037348 +_08037298: + ldr r6, _080372A0 + ldr r5, _080372A4 + b _0803734C + .align 2, 0 +_080372A0: .4byte gUnknown_80E66BC +_080372A4: .4byte gUnknown_80E66D4 +_080372A8: + ldr r6, _080372B0 + ldr r5, _080372B4 + b _0803734C + .align 2, 0 +_080372B0: .4byte gUnknown_80E6D54 +_080372B4: .4byte gUnknown_80E6D6C +_080372B8: + ldr r6, _080372C0 + ldr r5, _080372C4 + b _0803734C + .align 2, 0 +_080372C0: .4byte gUnknown_80E6DDC +_080372C4: .4byte gUnknown_80E6DF4 +_080372C8: + ldr r6, _080372D0 + ldr r5, _080372D4 + b _0803734C + .align 2, 0 +_080372D0: .4byte gUnknown_80E67D4 +_080372D4: .4byte gUnknown_80E67EC +_080372D8: + ldr r6, _080372E0 + ldr r5, _080372E4 + b _0803734C + .align 2, 0 +_080372E0: .4byte gUnknown_80E6748 +_080372E4: .4byte gUnknown_80E6760 +_080372E8: + ldr r6, _080372F0 + ldr r5, _080372F4 + b _0803734C + .align 2, 0 +_080372F0: .4byte gUnknown_80E689C +_080372F4: .4byte gUnknown_80E68B4 +_080372F8: + ldr r6, _08037300 + ldr r5, _08037304 + b _0803734C + .align 2, 0 +_08037300: .4byte gUnknown_80E6938 +_08037304: .4byte gUnknown_80E6950 +_08037308: + ldr r6, _08037310 + ldr r5, _08037314 + b _0803734C + .align 2, 0 +_08037310: .4byte gUnknown_80E69B0 +_08037314: .4byte gUnknown_80E69C8 +_08037318: + ldr r6, _08037320 + ldr r5, _08037324 + b _0803734C + .align 2, 0 +_08037320: .4byte gUnknown_80E6A10 +_08037324: .4byte gUnknown_80E6A28 +_08037328: + ldr r6, _08037330 + ldr r5, _08037334 + b _0803734C + .align 2, 0 +_08037330: .4byte gUnknown_80E6A74 +_08037334: .4byte gUnknown_80E6A8C +_08037338: + ldr r6, _08037340 + ldr r5, _08037344 + b _0803734C + .align 2, 0 +_08037340: .4byte gUnknown_80E6B78 +_08037344: .4byte gUnknown_80E6B90 +_08037348: + ldr r6, _080373B4 + ldr r5, _080373B8 +_0803734C: + ldr r4, _080373BC + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x1C + movs r2, 0xAE + lsls r2, 1 + adds r1, r2 + str r5, [sp] + movs r3, 0 + str r3, [sp, 0x4] + movs r2, 0x6 + str r2, [sp, 0x8] + str r3, [sp, 0xC] + movs r2, 0 + adds r3, r6, 0 + bl sub_8035C3C + ldr r0, [r4] + adds r0, 0x1C + movs r1, 0 + movs r2, 0x1 + bl sub_8035CF4 + ldr r4, [r4] + ldr r0, [r4, 0x4] + cmp r0, 0 + beq _080373AC + ldr r0, [r4] + cmp r0, 0 + bne _080373AC + bl sub_8035D94 + adds r2, r0, 0 + ldrb r0, [r2] + cmp r0, 0 + beq _080373AC + ldr r3, [r2, 0x4] + cmp r3, 0 + beq _080373AC + ldr r0, _080373C0 + ldr r1, [r0] + ldrb r0, [r2] + lsls r0, 1 + adds r1, 0x50 + adds r1, r0 + ldrh r0, [r1] + adds r0, r3 + strh r0, [r1] +_080373AC: + add sp, 0x10 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080373B4: .4byte gUnknown_80E6BF4 +_080373B8: .4byte gUnknown_80E6C0C +_080373BC: .4byte gUnknown_203B35C +_080373C0: .4byte gUnknown_203B460 + thumb_func_end sub_80371B8 + + thumb_func_start sub_80373C4 +sub_80373C4: + push {lr} + movs r0, 0 + movs r1, 0 + bl sub_8005838 + bl sub_80060EC + bl sub_800CB20 + bl sub_800485C + bl TransferBGPaletteBuffer + bl xxx_call_update_bg_vram + bl sub_8009908 + bl xxx_call_update_bg_sound_input + movs r0, 0 + bl sub_8004D8C + pop {r0} + bx r0 + thumb_func_end sub_80373C4 + + thumb_func_start sub_80373F4 +sub_80373F4: + ldr r0, _080373FC + ldr r0, [r0] + bx lr + .align 2, 0 +_080373FC: .4byte gUnknown_203B35C + thumb_func_end sub_80373F4 + + thumb_func_start sub_8037400 +sub_8037400: + push {r4-r6,lr} + movs r6, 0 + movs r5, 0 + bl sub_8037810 + bl sub_8011830 + ldr r4, _08037434 + ldr r0, [r4] + ldr r0, [r0] + bl sub_8037B28 + ldr r4, [r4] + str r0, [r4, 0x4] + cmp r0, 0 + beq _08037422 + b _080376BE +_08037422: + ldr r0, [r4] + cmp r0, 0xA + bls _0803742A + b _080375E8 +_0803742A: + lsls r0, 2 + ldr r1, _08037438 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08037434: .4byte gUnknown_203B35C +_08037438: .4byte _0803743C + .align 2, 0 +_0803743C: + .4byte _08037494 + .4byte _080374B8 + .4byte _08037534 + .4byte _0803751C + .4byte _0803756C + .4byte _080375D8 + .4byte _080374E4 + .4byte _080374D0 + .4byte _080375E8 + .4byte _08037480 + .4byte _08037468 +_08037468: + ldr r0, _0803747C + ldr r0, [r0] + movs r1, 0xE7 + lsls r1, 2 + adds r6, r0, r1 + movs r2, 0x8A + lsls r2, 3 + adds r5, r0, r2 + b _080375E8 + .align 2, 0 +_0803747C: .4byte gUnknown_203B35C +_08037480: + ldr r0, _08037490 + ldr r0, [r0] + movs r3, 0xE7 + lsls r3, 2 + adds r6, r0, r3 + movs r4, 0x8A + lsls r4, 3 + b _080375E6 + .align 2, 0 +_08037490: .4byte gUnknown_203B35C +_08037494: + bl sub_8035D94 + ldr r1, _080374B4 + ldr r3, [r1] + movs r5, 0xDE + lsls r5, 1 + adds r2, r3, r5 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r2] + str r1, [r2, 0x4] + adds r6, r2, 0 + movs r0, 0xE2 + lsls r0, 1 + adds r5, r3, r0 + b _080375E8 + .align 2, 0 +_080374B4: .4byte gUnknown_203B35C +_080374B8: + ldr r0, _080374CC + ldr r0, [r0] + movs r1, 0xDE + lsls r1, 1 + adds r6, r0, r1 + movs r2, 0xE2 + lsls r2, 1 + adds r5, r0, r2 + b _080375E8 + .align 2, 0 +_080374CC: .4byte gUnknown_203B35C +_080374D0: + ldr r0, _080374E0 + ldr r0, [r0] + movs r3, 0xE6 + lsls r3, 1 + adds r6, r0, r3 + movs r4, 0xFE + lsls r4, 1 + b _080375E6 + .align 2, 0 +_080374E0: .4byte gUnknown_203B35C +_080374E4: + bl sub_8035D74 + lsls r0, 24 + lsrs r0, 24 + bl sub_8095228 + ldr r3, _08037518 + ldr r1, [r3] + movs r2, 0xE6 + lsls r2, 1 + adds r1, r2 + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldr r0, [r3] + adds r6, r0, r2 + movs r1, 0xFE + lsls r1, 1 + adds r5, r0, r1 + b _080375E8 + .align 2, 0 +_08037518: .4byte gUnknown_203B35C +_0803751C: + ldr r0, _08037530 + ldr r0, [r0] + movs r2, 0x8B + lsls r2, 2 + adds r6, r0, r2 + movs r3, 0x97 + lsls r3, 2 + adds r5, r0, r3 + b _080375E8 + .align 2, 0 +_08037530: .4byte gUnknown_203B35C +_08037534: + bl sub_8035D74 + lsls r0, 24 + lsrs r0, 24 + bl sub_8095228 + ldr r3, _08037568 + ldr r1, [r3] + movs r2, 0x8B + lsls r2, 2 + adds r1, r2 + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldr r0, [r3] + adds r6, r0, r2 + movs r1, 0x97 + lsls r1, 2 + adds r5, r0, r1 + b _080375E8 + .align 2, 0 +_08037568: .4byte gUnknown_203B35C +_0803756C: + bl sub_8035D74 + lsls r0, 24 + lsrs r0, 24 + bl sub_8095228 + ldr r4, _080375CC + ldr r1, [r4] + movs r5, 0xA3 + lsls r5, 2 + adds r1, r5 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + bl sub_8035D3C + lsls r0, 16 + ldr r1, _080375D0 + cmp r0, r1 + beq _080375BE + bl sub_8035D3C + ldr r3, [r4] + movs r1, 0xAF + lsls r1, 2 + adds r3, r1 + ldr r1, _080375D4 + ldr r1, [r1] + lsls r0, 16 + asrs r0, 16 + movs r2, 0x58 + muls r0, r2 + adds r1, r0 + adds r0, r3, 0 + bl memcpy +_080375BE: + ldr r0, [r4] + adds r6, r0, r5 + movs r2, 0xC5 + lsls r2, 2 + adds r5, r0, r2 + b _080375E8 + .align 2, 0 +_080375CC: .4byte gUnknown_203B35C +_080375D0: .4byte 0xffff0000 +_080375D4: .4byte gUnknown_203B45C +_080375D8: + ldr r0, _08037610 + ldr r0, [r0] + movs r3, 0xA3 + lsls r3, 2 + adds r6, r0, r3 + movs r4, 0xC5 + lsls r4, 2 +_080375E6: + adds r5, r0, r4 +_080375E8: + ldr r4, _08037610 + ldr r0, [r4] + ldr r0, [r0] + adds r1, r6, 0 + adds r2, r5, 0 + bl sub_8037D64 + ldr r1, [r4] + str r0, [r1, 0x4] + cmp r0, 0 + bne _080376BE + ldr r0, [r1] + cmp r0, 0xA + bhi _080376AE + lsls r0, 2 + ldr r1, _08037614 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08037610: .4byte gUnknown_203B35C +_08037614: .4byte _08037618 + .align 2, 0 +_08037618: + .4byte _08037644 + .4byte _08037644 + .4byte _08037658 + .4byte _08037658 + .4byte _0803766C + .4byte _0803766C + .4byte _08037684 + .4byte _08037684 + .4byte _080376AE + .4byte _0803769C + .4byte _0803769C +_08037644: + ldr r0, _08037654 + ldr r2, [r0] + movs r5, 0xDE + lsls r5, 1 + adds r6, r2, r5 + movs r1, 0xE2 + lsls r1, 1 + b _0803767A + .align 2, 0 +_08037654: .4byte gUnknown_203B35C +_08037658: + ldr r0, _08037668 + ldr r2, [r0] + movs r3, 0x8B + lsls r3, 2 + adds r6, r2, r3 + movs r4, 0x97 + lsls r4, 2 + b _08037692 + .align 2, 0 +_08037668: .4byte gUnknown_203B35C +_0803766C: + ldr r0, _08037680 + ldr r2, [r0] + movs r5, 0xA3 + lsls r5, 2 + adds r6, r2, r5 + movs r1, 0xC5 + lsls r1, 2 +_0803767A: + adds r5, r2, r1 + adds r4, r0, 0 + b _080376AE + .align 2, 0 +_08037680: .4byte gUnknown_203B35C +_08037684: + ldr r0, _08037698 + ldr r2, [r0] + movs r3, 0xE6 + lsls r3, 1 + adds r6, r2, r3 + movs r4, 0xFE + lsls r4, 1 +_08037692: + adds r5, r2, r4 + adds r4, r0, 0 + b _080376AE + .align 2, 0 +_08037698: .4byte gUnknown_203B35C +_0803769C: + ldr r1, _080376C8 + ldr r0, [r1] + movs r5, 0xE7 + lsls r5, 2 + adds r6, r0, r5 + movs r2, 0x8A + lsls r2, 3 + adds r5, r0, r2 + adds r4, r1, 0 +_080376AE: + ldr r0, [r4] + ldr r0, [r0] + adds r1, r6, 0 + adds r2, r5, 0 + bl sub_80381F4 + ldr r1, [r4] + str r0, [r1, 0x4] +_080376BE: + bl sub_8011854 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080376C8: .4byte gUnknown_203B35C + thumb_func_end sub_8037400 + + thumb_func_start sub_80376CC +sub_80376CC: + push {r4,lr} + ldr r0, _08037728 + ldr r3, [r0] + ldrh r1, [r3, 0xC] + ldr r0, _0803772C + ands r0, r1 + ldr r1, _08037730 + ands r0, r1 + ldr r4, _08037734 + ands r0, r4 + ldr r1, _08037738 + ands r0, r1 + ldr r1, _0803773C + ands r0, r1 + movs r2, 0x80 + lsls r2, 7 + ldr r1, _08037740 + ands r0, r1 + orrs r0, r2 + strh r0, [r3, 0xC] + movs r2, 0xFC + lsls r2, 2 + ldrh r1, [r3, 0x10] + movs r0, 0xFC + lsls r0, 8 + ands r0, r1 + orrs r0, r2 + ands r0, r4 + movs r2, 0xF + movs r4, 0xF0 + lsls r4, 8 + ldr r1, _08037744 + ands r0, r1 + orrs r0, r4 + strh r0, [r3, 0x10] + movs r0, 0 + strh r0, [r3, 0xE] + movs r1, 0xC0 + lsls r1, 4 + ldrh r0, [r3, 0x12] + ands r2, r0 + orrs r2, r1 + strh r2, [r3, 0x12] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08037728: .4byte gUnknown_203B35C +_0803772C: .4byte 0x0000feff +_08037730: .4byte 0x0000fdff +_08037734: .4byte 0x0000f3ff +_08037738: .4byte 0x0000efff +_0803773C: .4byte 0x0000dfff +_08037740: .4byte 0x00003fff +_08037744: .4byte 0x00000fff + thumb_func_end sub_80376CC + + thumb_func_start sub_8037748 +sub_8037748: + push {r4,lr} + ldr r4, _08037794 + ldr r3, [r4] + ldrh r1, [r3, 0xE] + movs r0, 0xFE + lsls r0, 8 + ands r0, r1 + movs r1, 0x70 + orrs r0, r1 + strh r0, [r3, 0xE] + movs r2, 0xD0 + lsls r2, 3 + ldrh r1, [r3, 0x12] + movs r0, 0xF + ands r0, r1 + orrs r0, r2 + strh r0, [r3, 0x12] + ldr r0, [r3, 0x14] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08037782 + adds r0, r3, 0 + adds r0, 0xC + adds r1, 0xF8 + movs r2, 0 + movs r3, 0 + bl AddSprite +_08037782: + bl sub_80144C4 + ldr r1, [r4] + ldr r0, [r1, 0x14] + adds r0, 0x1 + str r0, [r1, 0x14] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08037794: .4byte gUnknown_203B35C + thumb_func_end sub_8037748 + + thumb_func_start sub_8037798 +sub_8037798: + push {lr} + ldr r2, _080377B4 + ldr r1, _080377B8 + ldr r0, [r1] + ldr r0, [r0] + adds r3, r1, 0 + cmp r0, 0xA + bhi _0803780A + lsls r0, 2 + ldr r1, _080377BC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080377B4: .4byte 0x0000ffdc +_080377B8: .4byte gUnknown_203B35C +_080377BC: .4byte _080377C0 + .align 2, 0 +_080377C0: + .4byte _080377EC + .4byte _080377EC + .4byte _080377F0 + .4byte _080377F0 + .4byte _080377F0 + .4byte _080377F0 + .4byte _080377F0 + .4byte _080377F0 + .4byte _0803780A + .4byte _080377FE + .4byte _080377FE +_080377EC: + movs r2, 0x1 + b _0803780A +_080377F0: + ldr r0, [r3] + ldr r0, [r0, 0x4] + movs r2, 0x1 + cmp r0, 0 + bne _0803780A + movs r2, 0x2A + b _0803780A +_080377FE: + ldr r0, [r3] + ldr r0, [r0, 0x4] + movs r2, 0xD + cmp r0, 0 + bne _0803780A + movs r2, 0x2B +_0803780A: + adds r0, r2, 0 + pop {r1} + bx r1 + thumb_func_end sub_8037798 + + thumb_func_start sub_8037810 +sub_8037810: + push {r4-r6,lr} + ldr r6, _080378FC + ldr r0, [r6] + movs r5, 0xDE + lsls r5, 1 + adds r0, r5 + movs r1, 0 + movs r2, 0x8 + bl MemoryFill8 + ldr r0, [r6] + movs r4, 0xE2 + lsls r4, 1 + adds r0, r4 + movs r1, 0 + movs r2, 0x8 + bl MemoryFill8 + ldr r0, [r6] + adds r5, r0, r5 + movs r1, 0 + movs r2, 0 + str r1, [r5] + str r2, [r5, 0x4] + adds r4, r0, r4 + str r1, [r4] + str r2, [r4, 0x4] + movs r2, 0xE6 + lsls r2, 1 + adds r0, r2 + movs r1, 0 + movs r2, 0x30 + bl MemoryFill8 + ldr r0, [r6] + movs r3, 0xFE + lsls r3, 1 + adds r0, r3 + movs r1, 0 + movs r2, 0x30 + bl MemoryFill8 + ldr r0, [r6] + movs r1, 0x8B + lsls r1, 2 + adds r0, r1 + movs r1, 0 + movs r2, 0x30 + bl MemoryFill8 + ldr r0, [r6] + movs r2, 0x97 + lsls r2, 2 + adds r0, r2 + movs r1, 0 + movs r2, 0x30 + bl MemoryFill8 + ldr r0, [r6] + movs r3, 0xA3 + lsls r3, 2 + adds r0, r3 + movs r1, 0 + movs r2, 0x30 + bl MemoryFill8 + ldr r0, [r6] + movs r1, 0xC5 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + movs r2, 0x30 + bl MemoryFill8 + ldr r0, [r6] + movs r2, 0xAF + lsls r2, 2 + adds r0, r2 + movs r1, 0 + movs r2, 0x58 + bl MemoryFill8 + ldr r0, [r6] + movs r3, 0xD1 + lsls r3, 2 + adds r0, r3 + movs r1, 0 + movs r2, 0x58 + bl MemoryFill8 + ldr r0, [r6] + movs r1, 0xE7 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + movs r2, 0xB4 + bl MemoryFill8 + ldr r0, [r6] + movs r2, 0x8A + lsls r2, 3 + adds r0, r2 + movs r1, 0 + movs r2, 0xB4 + bl MemoryFill8 + ldr r2, [r6] + movs r3, 0xB1 + lsls r3, 2 + adds r0, r2, r3 + movs r1, 0 + strh r1, [r0] + adds r3, 0x88 + adds r0, r2, r3 + strh r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080378FC: .4byte gUnknown_203B35C + thumb_func_end sub_8037810 + + thumb_func_start sub_8037900 +sub_8037900: + push {r4,lr} + sub sp, 0x10 + ldr r4, _08037928 + ldr r0, [r4] + movs r1, 0xAE + lsls r1, 1 + adds r0, r1 + movs r1, 0 + bl sub_8035CC0 + ldr r0, [r4] + ldr r0, [r0] + cmp r0, 0xA + bls _0803791E + b _08037A14 +_0803791E: + lsls r0, 2 + ldr r1, _0803792C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08037928: .4byte gUnknown_203B35C +_0803792C: .4byte _08037930 + .align 2, 0 +_08037930: + .4byte _0803795C + .4byte _0803795C + .4byte _0803797C + .4byte _0803797C + .4byte _0803799C + .4byte _0803799C + .4byte _080379BC + .4byte _080379BC + .4byte _08037A14 + .4byte _080379F0 + .4byte _080379F0 +_0803795C: + ldr r0, _08037970 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x1C + movs r2, 0xAE + lsls r2, 1 + adds r1, r2 + ldr r3, _08037974 + ldr r2, _08037978 + b _080379CE + .align 2, 0 +_08037970: .4byte gUnknown_203B35C +_08037974: .4byte gUnknown_80E6554 +_08037978: .4byte gUnknown_80E656C +_0803797C: + ldr r0, _08037990 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x1C + movs r2, 0xAE + lsls r2, 1 + adds r1, r2 + ldr r3, _08037994 + ldr r2, _08037998 + b _080379CE + .align 2, 0 +_08037990: .4byte gUnknown_203B35C +_08037994: .4byte gUnknown_80E6554 +_08037998: .4byte gUnknown_80E65D8 +_0803799C: + ldr r0, _080379B0 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x1C + movs r2, 0xAE + lsls r2, 1 + adds r1, r2 + ldr r3, _080379B4 + ldr r2, _080379B8 + b _080379CE + .align 2, 0 +_080379B0: .4byte gUnknown_203B35C +_080379B4: .4byte gUnknown_80E6554 +_080379B8: .4byte gUnknown_80E661C +_080379BC: + ldr r0, _080379E4 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x1C + movs r2, 0xAE + lsls r2, 1 + adds r1, r2 + ldr r3, _080379E8 + ldr r2, _080379EC +_080379CE: + str r2, [sp] + movs r4, 0 + str r4, [sp, 0x4] + movs r2, 0x6 + str r2, [sp, 0x8] + str r4, [sp, 0xC] + movs r2, 0 + bl sub_8035C3C + b _08037A14 + .align 2, 0 +_080379E4: .4byte gUnknown_203B35C +_080379E8: .4byte gUnknown_80E6554 +_080379EC: .4byte gUnknown_80E665C +_080379F0: + ldr r0, _08037A38 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x1C + movs r2, 0xAE + lsls r2, 1 + adds r1, r2 + ldr r3, _08037A3C + ldr r2, _08037A40 + str r2, [sp] + movs r4, 0 + str r4, [sp, 0x4] + movs r2, 0x6 + str r2, [sp, 0x8] + str r4, [sp, 0xC] + movs r2, 0 + bl sub_8035C3C +_08037A14: + ldr r4, _08037A38 + ldr r0, [r4] + adds r0, 0x1C + movs r1, 0 + movs r2, 0x1 + bl sub_8035CF4 + bl sub_80373C4 + ldr r0, [r4] + adds r0, 0x1C + bl sub_80130A8 + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08037A38: .4byte gUnknown_203B35C +_08037A3C: .4byte gUnknown_80E6554 +_08037A40: .4byte gUnknown_80E667C + thumb_func_end sub_8037900 + + thumb_func_start nullsub_202 +nullsub_202: + bx lr + thumb_func_end nullsub_202 + + thumb_func_start sub_8037A48 +sub_8037A48: + push {r4-r6,lr} + sub sp, 0x28 + movs r6, 0x1 + movs r0, 0 + mov r1, sp + movs r2, 0x14 + bl sub_800D670 + add r4, sp, 0x14 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x14 + bl sub_800D670 + ldr r1, _08037AAC + movs r3, 0x8 + adds r2, r1, 0 + adds r0, r2, 0x4 +_08037A6C: + str r3, [r0] + subs r0, 0x4 + cmp r0, r1 + bge _08037A6C + ldr r0, [sp, 0x10] + str r0, [r2] + ldr r0, [r4, 0x10] + str r0, [r2, 0x4] + ldr r5, _08037AB0 + mov r0, sp + adds r1, r5, 0 + bl strcmp + cmp r0, 0 + beq _08037A8C + movs r0, 0x1 +_08037A8C: + lsls r0, 24 + cmp r0, 0 + bne _08037AA6 + adds r0, r4, 0 + adds r1, r5, 0 + bl strcmp + cmp r0, 0 + beq _08037AA0 + movs r0, 0x1 +_08037AA0: + lsls r0, 24 + cmp r0, 0 + beq _08037AB4 +_08037AA6: + movs r0, 0 + b _08037B1E + .align 2, 0 +_08037AAC: .4byte gUnknown_202EC40 +_08037AB0: .4byte gUnknown_80E6E50 +_08037AB4: + ldr r1, [sp, 0x10] + cmp r1, 0 + bne _08037AC0 + ldr r0, [r4, 0x10] + cmp r0, 0x1 + beq _08037B1C +_08037AC0: + cmp r1, 0x1 + bne _08037ACA + ldr r0, [r4, 0x10] + cmp r0, 0 + beq _08037B1C +_08037ACA: + cmp r1, 0x2 + bne _08037AD4 + ldr r0, [r4, 0x10] + cmp r0, 0x3 + beq _08037B1C +_08037AD4: + cmp r1, 0x3 + bne _08037ADE + ldr r0, [r4, 0x10] + cmp r0, 0x2 + beq _08037B1C +_08037ADE: + cmp r1, 0x9 + bne _08037AE8 + ldr r0, [r4, 0x10] + cmp r0, 0xA + beq _08037B1C +_08037AE8: + cmp r1, 0xA + bne _08037AF2 + ldr r0, [r4, 0x10] + cmp r0, 0x9 + beq _08037B1C +_08037AF2: + cmp r1, 0x4 + bne _08037AFC + ldr r0, [r4, 0x10] + cmp r0, 0x5 + beq _08037B1C +_08037AFC: + cmp r1, 0x5 + bne _08037B06 + ldr r0, [r4, 0x10] + cmp r0, 0x4 + beq _08037B1C +_08037B06: + cmp r1, 0x6 + bne _08037B10 + ldr r0, [r4, 0x10] + cmp r0, 0x7 + beq _08037B1C +_08037B10: + cmp r1, 0x7 + bne _08037B1A + ldr r0, [r4, 0x10] + cmp r0, 0x6 + beq _08037B1C +_08037B1A: + movs r6, 0 +_08037B1C: + adds r0, r6, 0 +_08037B1E: + add sp, 0x28 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8037A48 + + thumb_func_start sub_8037B28 +sub_8037B28: + push {r4,r5,lr} + sub sp, 0x14 + adds r4, r0, 0 + movs r5, 0 + bl sub_800D414 + ldr r0, _08037B58 + str r5, [r0] + ldr r5, _08037B5C + mov r0, sp + movs r1, 0 + movs r2, 0x14 + bl MemoryFill8 + mov r0, sp + adds r1, r5, 0 + bl strcpy + str r4, [sp, 0x10] + mov r0, sp + movs r1, 0x14 + bl sub_800D59C + b _08037B7A + .align 2, 0 +_08037B58: .4byte gUnknown_202EC38 +_08037B5C: .4byte gUnknown_80E6E50 +_08037B60: + cmp r5, 0x3 + beq _08037BCC + cmp r5, 0x4 + beq _08037BD8 + cmp r5, 0x5 + beq _08037BF0 + ldr r2, _08037BC0 + ldr r1, [r2] + ldr r0, _08037BC4 + cmp r1, r0 + bgt _08037BE4 + adds r0, r1, 0x1 + str r0, [r2] +_08037B7A: + movs r4, 0 +_08037B7C: + bl sub_80373C4 + bl sub_8012AE8 + cmp r0, 0x3 + bgt _08037B8C + cmp r0, 0x2 + bge _08037BF0 +_08037B8C: + adds r4, 0x1 + cmp r4, 0 + ble _08037B7C + bl sub_800D33C + adds r5, r0, 0 + bl sub_800D570 + cmp r5, 0x2 + bne _08037B60 + bl sub_800D600 + lsls r0, 24 + cmp r0, 0 + beq _08037BFC + bl sub_8037A48 + lsls r0, 24 + cmp r0, 0 + bne _08037BC8 + movs r4, 0x4 + bl sub_800D520 + bl sub_800D510 + b _08037C06 + .align 2, 0 +_08037BC0: .4byte gUnknown_202EC38 +_08037BC4: .4byte 0x00000707 +_08037BC8: + movs r4, 0 + b _08037C06 +_08037BCC: + bl sub_800D520 + bl sub_800D510 + movs r0, 0x2 + b _08037C08 +_08037BD8: + bl sub_800D520 + bl sub_800D510 + movs r0, 0x3 + b _08037C08 +_08037BE4: + bl sub_800D520 + bl sub_800D510 + movs r0, 0xF + b _08037C08 +_08037BF0: + bl sub_800D520 + bl sub_800D510 + movs r0, 0x1 + b _08037C08 +_08037BFC: + movs r4, 0x5 + bl sub_800D520 + bl sub_800D510 +_08037C06: + adds r0, r4, 0 +_08037C08: + add sp, 0x14 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8037B28 + + thumb_func_start sub_8037C10 +sub_8037C10: + push {lr} + lsls r0, 24 + cmp r0, 0 + beq _08037C24 + bl sub_800D588 + lsls r0, 24 + cmp r0, 0 + bne _08037C38 + b _08037C2E +_08037C24: + bl sub_800D588 + lsls r0, 24 + cmp r0, 0 + beq _08037C38 +_08037C2E: + ldr r0, _08037C34 + ldr r0, [r0, 0x4] + b _08037C3C + .align 2, 0 +_08037C34: .4byte gUnknown_202EC40 +_08037C38: + ldr r0, _08037C40 + ldr r0, [r0] +_08037C3C: + pop {r1} + bx r1 + .align 2, 0 +_08037C40: .4byte gUnknown_202EC40 + thumb_func_end sub_8037C10 + + thumb_func_start sub_8037C44 +sub_8037C44: + push {r4-r6,lr} + adds r6, r0, 0 + adds r5, r1, 0 + movs r4, 0 +_08037C4C: + adds r0, r4, 0 + bl sub_800D68C + adds r4, 0x1 + cmp r4, 0x1 + ble _08037C4C + cmp r6, 0xA + bhi _08037CBE + lsls r0, r6, 2 + ldr r1, _08037C68 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08037C68: .4byte _08037C6C + .align 2, 0 +_08037C6C: + .4byte _08037C98 + .4byte _08037C98 + .4byte _08037CA2 + .4byte _08037CA2 + .4byte _08037CAC + .4byte _08037CAC + .4byte _08037CA2 + .4byte _08037CA2 + .4byte _08037CBE + .4byte _08037CB6 + .4byte _08037CB6 +_08037C98: + adds r0, r5, 0 + movs r1, 0x8 + bl sub_800D59C + b _08037CBE +_08037CA2: + adds r0, r5, 0 + movs r1, 0x30 + bl sub_800D59C + b _08037CBE +_08037CAC: + adds r0, r5, 0 + movs r1, 0x88 + bl sub_800D59C + b _08037CBE +_08037CB6: + adds r0, r5, 0 + movs r1, 0xB4 + bl sub_800D59C +_08037CBE: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8037C44 + + thumb_func_start sub_8037CC4 +sub_8037CC4: + push {r4,lr} + adds r3, r1, 0 + adds r4, r2, 0 + cmp r0, 0xA + bhi _08037D5E + lsls r0, 2 + ldr r1, _08037CD8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08037CD8: .4byte _08037CDC + .align 2, 0 +_08037CDC: + .4byte _08037D08 + .4byte _08037D08 + .4byte _08037D1E + .4byte _08037D1E + .4byte _08037D34 + .4byte _08037D34 + .4byte _08037D1E + .4byte _08037D1E + .4byte _08037D5E + .4byte _08037D4A + .4byte _08037D4A +_08037D08: + movs r0, 0 + adds r1, r3, 0 + movs r2, 0x8 + bl sub_800D670 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x8 + bl sub_800D670 + b _08037D5E +_08037D1E: + movs r0, 0 + adds r1, r3, 0 + movs r2, 0x30 + bl sub_800D670 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x30 + bl sub_800D670 + b _08037D5E +_08037D34: + movs r0, 0 + adds r1, r3, 0 + movs r2, 0x88 + bl sub_800D670 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0x88 + bl sub_800D670 + b _08037D5E +_08037D4A: + movs r0, 0 + adds r1, r3, 0 + movs r2, 0xB4 + bl sub_800D670 + movs r0, 0x1 + adds r1, r4, 0 + movs r2, 0xB4 + bl sub_800D670 +_08037D5E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8037CC4 + + thumb_func_start sub_8037D64 +sub_8037D64: + push {r4-r7,lr} + adds r5, r0, 0 + adds r6, r1, 0 + adds r7, r2, 0 + movs r4, 0 + ldr r0, _08037D80 + str r4, [r0] + bl sub_800D494 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_8037C44 + b _08037D96 + .align 2, 0 +_08037D80: .4byte gUnknown_202EC48 +_08037D84: + subs r0, r4, 0x3 + cmp r0, 0x2 + bls _08037DBC + ldr r1, _08037DB8 + ldr r0, [r1] + cmp r0, 0x63 + bgt _08037DC8 + adds r0, 0x1 + str r0, [r1] +_08037D96: + bl sub_80373C4 + bl sub_800D33C + adds r4, r0, 0 + bl sub_800D570 + cmp r4, 0x2 + bne _08037D84 + bl sub_800D600 + lsls r0, 24 + cmp r0, 0 + beq _08037DD4 + movs r4, 0 + b _08037DDE + .align 2, 0 +_08037DB8: .4byte gUnknown_202EC48 +_08037DBC: + bl sub_800D520 + bl sub_800D510 + movs r0, 0x1 + b _08037DEA +_08037DC8: + bl sub_800D520 + bl sub_800D510 + movs r0, 0xF + b _08037DEA +_08037DD4: + bl sub_800D520 + bl sub_800D510 + movs r4, 0x5 +_08037DDE: + adds r0, r5, 0 + adds r1, r6, 0 + adds r2, r7, 0 + bl sub_8037CC4 + adds r0, r4, 0 +_08037DEA: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8037D64 + + thumb_func_start sub_8037DF0 +sub_8037DF0: + push {r4,lr} + sub sp, 0x8 + movs r4, 0 + movs r0, 0 + mov r1, sp + movs r2, 0x4 + bl sub_800D670 + add r1, sp, 0x4 + movs r0, 0x1 + movs r2, 0x4 + bl sub_800D670 + ldr r0, [sp] + cmp r0, 0 + bne _08037E16 + ldr r0, [sp, 0x4] + cmp r0, 0 + beq _08037E2C +_08037E16: + bl sub_800D588 + lsls r0, 24 + cmp r0, 0 + bne _08037E24 + ldr r4, [sp, 0x4] + b _08037E26 +_08037E24: + ldr r4, [sp] +_08037E26: + cmp r4, 0 + bne _08037E2C + movs r4, 0xE +_08037E2C: + adds r0, r4, 0 + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8037DF0 + + thumb_func_start sub_8037E38 +sub_8037E38: + push {r4-r6,lr} + adds r6, r0, 0 + adds r5, r1, 0 + bl sub_800D588 + lsls r0, 24 + adds r4, r6, 0 + cmp r0, 0 + bne _08037E4C + adds r4, r5, 0 +_08037E4C: + bl sub_800D588 + lsls r0, 24 + adds r3, r5, 0 + cmp r0, 0 + bne _08037E5A + adds r3, r6, 0 +_08037E5A: + ldrb r0, [r4] + ldrb r1, [r3] + cmp r0, r1 + bne _08037E70 + ldr r0, _08037E6C + ldr r1, [r0] + ldrb r0, [r4] + b _08037E76 + .align 2, 0 +_08037E6C: .4byte gUnknown_203B460 +_08037E70: + ldr r0, _08037E8C + ldr r1, [r0] + ldrb r0, [r3] +_08037E76: + lsls r0, 1 + adds r1, 0x50 + adds r1, r0 + ldrh r2, [r1] + ldr r0, [r3, 0x4] + adds r2, r0 + strh r2, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08037E8C: .4byte gUnknown_203B460 + thumb_func_end sub_8037E38 + + thumb_func_start sub_8037E90 +sub_8037E90: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + bl sub_800D588 + lsls r0, 24 + cmp r0, 0 + bne _08037EA2 + adds r4, r5, 0 +_08037EA2: + movs r0, 0x2 + strb r0, [r4] + adds r0, r4, 0 + bl sub_80951BC + ldr r0, [r4, 0x10] + bl sub_8095274 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8037E90 + + thumb_func_start nullsub_53 +nullsub_53: + bx lr + thumb_func_end nullsub_53 + + thumb_func_start sub_8037EBC +sub_8037EBC: + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + bl sub_800D588 + lsls r0, 24 + adds r5, r4, 0 + cmp r0, 0 + bne _08037ED0 + adds r5, r6, 0 +_08037ED0: + ldr r1, [r5, 0x10] + movs r0, 0x1 + bl sub_809539C + lsls r0, 24 + lsrs r0, 24 + bl sub_8095228 + adds r4, r0, 0 + adds r1, r4, 0 + adds r0, r5, 0 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + movs r0, 0x5 + strb r0, [r4] + adds r0, r4, 0 + bl sub_80951FC + movs r0, 0x7 + strb r0, [r4] + movs r0, 0x38 + ldrsh r6, [r5, r0] + cmp r6, 0 + beq _08037F30 + ldr r4, _08037F2C + ldr r0, [r4] + ldr r1, [r5, 0x10] + stm r0!, {r1} + adds r1, r5, 0 + adds r1, 0x30 + movs r2, 0x58 + bl memcpy + ldr r1, [r4] + movs r0, 0x42 + strb r0, [r1, 0x8] + ldr r1, [r4] + movs r0, 0x1 + strb r0, [r1, 0x9] + b _08037F40 + .align 2, 0 +_08037F2C: .4byte gUnknown_203B484 +_08037F30: + ldr r4, _08037F48 + ldr r0, [r4] + movs r1, 0 + movs r2, 0x5C + bl MemoryFill8 + ldr r0, [r4] + strh r6, [r0, 0xC] +_08037F40: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08037F48: .4byte gUnknown_203B484 + thumb_func_end sub_8037EBC + + thumb_func_start sub_8037F4C +sub_8037F4C: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + bl sub_800D588 + lsls r0, 24 + cmp r0, 0 + bne _08037F5E + adds r4, r5, 0 +_08037F5E: + ldr r1, [r4, 0x10] + movs r0, 0x4 + bl sub_809539C + lsls r0, 24 + lsrs r0, 24 + bl sub_8095228 + adds r2, r0, 0 + adds r1, r4, 0 + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + movs r1, 0x6 + strb r1, [r0] + bl sub_8035D4C + cmp r0, 0 + beq _08037F96 + adds r1, r0, 0 + adds r1, 0x3A + movs r0, 0x1 + strb r0, [r1] +_08037F96: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8037F4C + + thumb_func_start sub_8037F9C +sub_8037F9C: + push {lr} + adds r3, r1, 0 + cmp r0, 0xA + bhi _08038010 + lsls r0, 2 + ldr r1, _08037FB0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08037FB0: .4byte _08037FB4 + .align 2, 0 +_08037FB4: + .4byte _08037FE0 + .4byte _08037FE0 + .4byte _08038010 + .4byte _08037FF4 + .4byte _08038010 + .4byte _08037FFE + .4byte _08038010 + .4byte _08037FEA + .4byte _08038010 + .4byte _08038010 + .4byte _08038008 +_08037FE0: + adds r0, r3, 0 + adds r1, r2, 0 + bl sub_8037E38 + b _08038010 +_08037FEA: + adds r0, r3, 0 + adds r1, r2, 0 + bl sub_8037F4C + b _08038010 +_08037FF4: + adds r0, r3, 0 + adds r1, r2, 0 + bl sub_8037E90 + b _08038010 +_08037FFE: + adds r0, r3, 0 + adds r1, r2, 0 + bl sub_8037EBC + b _08038010 +_08038008: + adds r0, r3, 0 + adds r1, r2, 0 + bl nullsub_53 +_08038010: + pop {r0} + bx r0 + thumb_func_end sub_8037F9C + + thumb_func_start sub_8038014 +sub_8038014: + push {r4-r6,lr} + adds r6, r0, 0 + adds r5, r1, 0 + bl sub_800D588 + lsls r0, 24 + adds r4, r6, 0 + cmp r0, 0 + bne _08038028 + adds r4, r5, 0 +_08038028: + bl sub_800D588 + lsls r0, 24 + adds r3, r5, 0 + cmp r0, 0 + bne _08038036 + adds r3, r6, 0 +_08038036: + ldrb r0, [r4] + ldrb r1, [r3] + cmp r0, r1 + bne _0803804C + ldr r0, _08038048 + ldr r1, [r0] + ldrb r0, [r4] + b _08038052 + .align 2, 0 +_08038048: .4byte gUnknown_203B460 +_0803804C: + ldr r0, _08038070 + ldr r1, [r0] + ldrb r0, [r3] +_08038052: + lsls r0, 1 + adds r1, 0x50 + adds r1, r0 + ldrh r2, [r1] + ldr r0, [r3, 0x4] + adds r2, r0 + ldr r0, _08038074 + movs r1, 0 + cmp r2, r0 + ble _08038068 + movs r1, 0x6 +_08038068: + adds r0, r1, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08038070: .4byte gUnknown_203B460 +_08038074: .4byte 0x000003e7 + thumb_func_end sub_8038014 + + thumb_func_start sub_8038078 +sub_8038078: + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r1, 0 + bl sub_800D588 + lsls r0, 24 + cmp r0, 0 + bne _0803808A + adds r4, r5, 0 +_0803808A: + ldr r6, [r4, 0x10] + ldr r0, _08038098 + ldr r0, [r0] + cmp r0, 0 + beq _0803809C + ldr r5, [r0, 0x50] + b _080380A2 + .align 2, 0 +_08038098: .4byte gUnknown_203B184 +_0803809C: + bl sub_8011C34 + adds r5, r0, 0 +_080380A2: + movs r0, 0x4 + adds r1, r6, 0 + bl sub_80952F0 + lsls r0, 24 + cmp r0, 0 + beq _080380BA + ldr r0, [r4, 0x28] + cmp r0, r5 + bne _080380BA + movs r0, 0 + b _080380BC +_080380BA: + movs r0, 0xB +_080380BC: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8038078 + + thumb_func_start sub_80380C4 +sub_80380C4: + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + bl sub_800D588 + lsls r0, 24 + adds r5, r4, 0 + cmp r0, 0 + bne _080380D8 + adds r5, r6, 0 +_080380D8: + ldr r4, [r5, 0x10] + movs r0, 0x2 + adds r1, r4, 0 + bl sub_80952F0 + lsls r0, 24 + cmp r0, 0 + bne _08038110 + movs r0, 0x4 + adds r1, r4, 0 + bl sub_80952F0 + lsls r0, 24 + cmp r0, 0 + bne _08038110 + movs r0, 0x6 + adds r1, r4, 0 + bl sub_80952F0 + lsls r0, 24 + cmp r0, 0 + bne _08038110 + ldr r0, [r5, 0x10] + bl sub_8095298 + lsls r0, 24 + cmp r0, 0 + beq _08038114 +_08038110: + movs r0, 0x7 + b _08038126 +_08038114: + bl sub_8095190 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _08038124 + movs r0, 0 + b _08038126 +_08038124: + movs r0, 0xD +_08038126: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80380C4 + + thumb_func_start sub_803812C +sub_803812C: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + bl sub_800D588 + lsls r0, 24 + cmp r0, 0 + bne _0803813E + adds r4, r5, 0 +_0803813E: + ldr r1, [r4, 0x10] + movs r0, 0x1 + bl sub_80952F0 + lsls r0, 24 + cmp r0, 0 + bne _08038150 + movs r0, 0x9 + b _08038152 +_08038150: + movs r0, 0 +_08038152: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_803812C + + thumb_func_start sub_8038158 +sub_8038158: + movs r0, 0 + bx lr + thumb_func_end sub_8038158 + + thumb_func_start sub_803815C +sub_803815C: + push {r4,lr} + adds r3, r1, 0 + movs r4, 0 + cmp r0, 0xA + bhi _080381D2 + lsls r0, 2 + ldr r1, _08038170 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08038170: .4byte _08038174 + .align 2, 0 +_08038174: + .4byte _080381A0 + .4byte _080381A0 + .4byte _080381D2 + .4byte _080381B4 + .4byte _080381D2 + .4byte _080381BE + .4byte _080381D2 + .4byte _080381AA + .4byte _080381D2 + .4byte _080381D2 + .4byte _080381C8 +_080381A0: + adds r0, r3, 0 + adds r1, r2, 0 + bl sub_8038014 + b _080381D0 +_080381AA: + adds r0, r3, 0 + adds r1, r2, 0 + bl sub_8038078 + b _080381D0 +_080381B4: + adds r0, r3, 0 + adds r1, r2, 0 + bl sub_80380C4 + b _080381D0 +_080381BE: + adds r0, r3, 0 + adds r1, r2, 0 + bl sub_803812C + b _080381D0 +_080381C8: + adds r0, r3, 0 + adds r1, r2, 0 + bl sub_8038158 +_080381D0: + adds r4, r0, 0 +_080381D2: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_803815C + + thumb_func_start sub_80381DC +sub_80381DC: + push {lr} + bl sub_8037F9C + pop {r0} + bx r0 + thumb_func_end sub_80381DC + + thumb_func_start sub_80381E8 +sub_80381E8: + push {lr} + bl sub_803815C + pop {r1} + bx r1 + thumb_func_end sub_80381E8 + + thumb_func_start sub_80381F4 +sub_80381F4: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + adds r7, r2, 0 + movs r4, 0 + bl sub_803815C + str r0, [sp] + ldr r0, _08038218 + str r4, [r0] + bl sub_800D494 + mov r0, sp + movs r1, 0x4 + bl sub_800D59C + b _0803822E + .align 2, 0 +_08038218: .4byte gUnknown_202EC4C +_0803821C: + subs r0, r4, 0x3 + cmp r0, 0x2 + bls _08038272 + ldr r1, _08038250 + ldr r0, [r1] + cmp r0, 0x63 + bgt _0803827E + adds r0, 0x1 + str r0, [r1] +_0803822E: + bl sub_80373C4 + bl sub_800D33C + adds r4, r0, 0 + bl sub_800D570 + cmp r4, 0x2 + bne _0803821C + bl sub_800D600 + lsls r0, 24 + cmp r0, 0 + beq _08038254 + bl sub_8037DF0 + b _0803825E + .align 2, 0 +_08038250: .4byte gUnknown_202EC4C +_08038254: + bl sub_800D520 + bl sub_800D510 + movs r0, 0x5 +_0803825E: + str r0, [sp] + ldr r0, [sp] + cmp r0, 0 + bne _0803828A + adds r0, r5, 0 + adds r1, r6, 0 + adds r2, r7, 0 + bl sub_8037F9C + b _08038292 +_08038272: + bl sub_800D520 + bl sub_800D510 + movs r0, 0x1 + b _08038298 +_0803827E: + bl sub_800D520 + bl sub_800D510 + movs r0, 0xF + b _08038298 +_0803828A: + bl sub_800D520 + bl sub_800D510 +_08038292: + bl sub_800D520 + ldr r0, [sp] +_08038298: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80381F4 + + thumb_func_start sub_80382A0 +sub_80382A0: + push {lr} + movs r0, 0 + bl sub_8031F60 + pop {r0} + bx r0 + thumb_func_end sub_80382A0 + + thumb_func_start sub_80382AC +sub_80382AC: + push {lr} + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r0} + bx r0 + thumb_func_end sub_80382AC + + thumb_func_start sub_80382C0 +sub_80382C0: + push {r4,lr} + ldr r4, _080382E0 + movs r0, 0x1 + bl sub_8031FD8 + cmp r0, 0x1 + bls _080382D8 + cmp r0, 0x3 + bhi _080382D8 + bl sub_803203C + movs r4, 0x1 +_080382D8: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080382E0: .4byte 0x0000ffdc + thumb_func_end sub_80382C0 + + thumb_func_start sub_80382E4 +sub_80382E4: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + mov r8, r0 + ldr r5, _08038398 + ldr r0, [r5] + cmp r0, 0 + bne _0803830E + movs r4, 0xDA + lsls r4, 1 + adds r0, r4, 0 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] + movs r1, 0 + adds r2, r4, 0 + bl MemoryFill8 +_0803830E: + mov r12, r5 + movs r0, 0xA4 + lsls r0, 1 + mov r9, r0 + ldr r4, _0803839C + movs r3, 0 + movs r2, 0x3 +_0803831C: + mov r5, r12 + ldr r1, [r5] + adds r1, r3 + add r1, r9 + adds r0, r4, 0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r3, 0x18 + subs r2, 0x1 + cmp r2, 0 + bge _0803831C + bl sub_8004914 + ldr r5, _08038398 + ldr r0, [r5] + movs r6, 0xA4 + lsls r6, 1 + adds r0, r6 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + mov r7, r8 + cmp r7, 0x25 + bne _08038370 + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0x8 + adds r1, r6 + ldr r3, _080383A0 + ldr r2, _080383A4 + str r2, [sp] + movs r4, 0 + str r4, [sp, 0x4] + movs r2, 0x4 + str r2, [sp, 0x8] + str r4, [sp, 0xC] + movs r2, 0 + bl sub_8035C3C +_08038370: + ldr r0, [r5] + adds r0, 0x8 + movs r1, 0 + movs r2, 0x1 + bl sub_8035CF4 + ldr r1, [r5] + mov r0, r8 + str r0, [r1] + movs r0, 0 + str r0, [r1, 0x4] + bl sub_8038440 + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08038398: .4byte gUnknown_203B360 +_0803839C: .4byte gUnknown_80E6E7C +_080383A0: .4byte gUnknown_80E6E94 +_080383A4: .4byte gUnknown_80E6EAC + thumb_func_end sub_80382E4 + + thumb_func_start sub_80383A8 +sub_80383A8: + push {r4,lr} + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r4, _080383D0 + ldr r0, [r4] + cmp r0, 0 + beq _080383C8 + bl MemoryFree + movs r0, 0 + str r0, [r4] +_080383C8: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080383D0: .4byte gUnknown_203B360 + thumb_func_end sub_80383A8 + + thumb_func_start sub_80383D4 +sub_80383D4: + push {r4-r6,lr} + sub sp, 0x4 + movs r0, 0x2 + str r0, [sp] + ldr r6, _08038410 + ldr r4, _08038414 + ldr r0, [r4] + ldr r5, [r0, 0x4] + cmp r5, 0 + bne _08038434 + adds r0, 0x8 + bl sub_80130A8 + lsls r0, 24 + cmp r0, 0 + bne _080383FE + ldr r0, [r4] + adds r0, 0x8 + mov r1, sp + bl sub_8013114 +_080383FE: + ldr r0, [sp] + cmp r0, 0x2 + beq _0803842C + cmp r0, 0x2 + bhi _08038418 + cmp r0, 0x1 + beq _0803841C + b _08038430 + .align 2, 0 +_08038410: .4byte 0x0000ffdc +_08038414: .4byte gUnknown_203B360 +_08038418: + cmp r0, 0x3 + bne _08038430 +_0803841C: + ldr r0, _08038428 + ldr r1, [r0] + movs r0, 0 + str r0, [r1, 0x4] + movs r6, 0x1 + b _08038430 + .align 2, 0 +_08038428: .4byte gUnknown_203B360 +_0803842C: + ldr r0, [r4] + str r5, [r0, 0x4] +_08038430: + bl sub_80384D0 +_08038434: + adds r0, r6, 0 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80383D4 + + thumb_func_start sub_8038440 +sub_8038440: + push {r4,r5,lr} + movs r5, 0 + ldr r0, _080384B0 + ldr r0, [r0] + mov r12, r0 + movs r3, 0xD4 + lsls r3, 1 + add r3, r12 + ldrh r1, [r3] + ldr r0, _080384B4 + ands r0, r1 + ldr r1, _080384B8 + ands r0, r1 + ldr r4, _080384BC + ands r0, r4 + ldr r1, _080384C0 + ands r0, r1 + ldr r1, _080384C4 + ands r0, r1 + movs r2, 0x80 + lsls r2, 7 + ldr r1, _080384C8 + ands r0, r1 + orrs r0, r2 + strh r0, [r3] + movs r2, 0xFC + lsls r2, 2 + ldrh r1, [r3, 0x4] + movs r0, 0xFC + lsls r0, 8 + ands r0, r1 + orrs r0, r2 + ands r0, r4 + movs r2, 0xF + movs r4, 0xF0 + lsls r4, 8 + ldr r1, _080384CC + ands r0, r1 + orrs r0, r4 + strh r0, [r3, 0x4] + movs r0, 0x70 + strh r0, [r3, 0x2] + movs r1, 0xE0 + lsls r1, 3 + ldrh r0, [r3, 0x6] + ands r2, r0 + orrs r2, r1 + strh r2, [r3, 0x6] + movs r0, 0xD8 + lsls r0, 1 + add r0, r12 + str r5, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080384B0: .4byte gUnknown_203B360 +_080384B4: .4byte 0x0000feff +_080384B8: .4byte 0x0000fdff +_080384BC: .4byte 0x0000f3ff +_080384C0: .4byte 0x0000efff +_080384C4: .4byte 0x0000dfff +_080384C8: .4byte 0x00003fff +_080384CC: .4byte 0x00000fff + thumb_func_end sub_8038440 + + thumb_func_start sub_80384D0 +sub_80384D0: + push {r4,r5,lr} + ldr r5, _08038508 + ldr r2, [r5] + movs r4, 0xD8 + lsls r4, 1 + adds r0, r2, r4 + ldr r0, [r0] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080384F6 + movs r1, 0xD4 + lsls r1, 1 + adds r0, r2, r1 + subs r1, 0xA8 + movs r2, 0 + movs r3, 0 + bl AddSprite +_080384F6: + ldr r1, [r5] + adds r1, r4 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08038508: .4byte gUnknown_203B360 + thumb_func_end sub_80384D0 + + thumb_func_start sub_803850C +sub_803850C: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + mov r8, r0 + ldr r5, _0803859C + ldr r0, [r5] + cmp r0, 0 + bne _08038536 + movs r4, 0xDA + lsls r4, 1 + adds r0, r4, 0 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] + movs r1, 0 + adds r2, r4, 0 + bl MemoryFill8 +_08038536: + mov r12, r5 + movs r0, 0xA4 + lsls r0, 1 + mov r9, r0 + ldr r4, _080385A0 + movs r3, 0 + movs r2, 0x3 +_08038544: + mov r5, r12 + ldr r1, [r5] + adds r1, r3 + add r1, r9 + adds r0, r4, 0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r3, 0x18 + subs r2, 0x1 + cmp r2, 0 + bge _08038544 + bl sub_8004914 + ldr r4, _0803859C + ldr r0, [r4] + movs r6, 0xA4 + lsls r6, 1 + adds r0, r6 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + mov r7, r8 + cmp r7, 0x2E + bne _080385AC + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x8 + adds r1, r6 + ldr r3, _080385A4 + ldr r2, _080385A8 + str r2, [sp] + movs r4, 0 + str r4, [sp, 0x4] + movs r2, 0x6 + str r2, [sp, 0x8] + str r4, [sp, 0xC] + movs r2, 0 + bl sub_8035C3C + b _080385CE + .align 2, 0 +_0803859C: .4byte gUnknown_203B364 +_080385A0: .4byte gUnknown_80E6F20 +_080385A4: .4byte gUnknown_80E6F38 +_080385A8: .4byte gUnknown_80E7090 +_080385AC: + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0x8 + movs r2, 0xA4 + lsls r2, 1 + adds r1, r2 + ldr r3, _080385F8 + ldr r2, _080385FC + str r2, [sp] + movs r4, 0 + str r4, [sp, 0x4] + movs r2, 0x6 + str r2, [sp, 0x8] + str r4, [sp, 0xC] + movs r2, 0 + bl sub_8035C3C +_080385CE: + ldr r4, _08038600 + ldr r0, [r4] + adds r0, 0x8 + movs r1, 0 + movs r2, 0x1 + bl sub_8035CF4 + ldr r1, [r4] + movs r0, 0 + str r0, [r1, 0x4] + mov r5, r8 + str r5, [r1] + bl sub_8038830 + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080385F8: .4byte gUnknown_80E6F38 +_080385FC: .4byte gUnknown_80E6F50 +_08038600: .4byte gUnknown_203B364 + thumb_func_end sub_803850C + + thumb_func_start sub_8038604 +sub_8038604: + push {r4,lr} + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r4, _0803862C + ldr r0, [r4] + cmp r0, 0 + beq _08038624 + bl MemoryFree + movs r0, 0 + str r0, [r4] +_08038624: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0803862C: .4byte gUnknown_203B364 + thumb_func_end sub_8038604 + + thumb_func_start sub_8038630 +sub_8038630: + push {r4-r6,lr} + sub sp, 0x18 + ldr r5, _080386A8 + movs r0, 0x3 + str r0, [sp, 0x14] + ldr r6, _080386AC + ldr r0, [r6] + ldr r4, [r0, 0x4] + cmp r4, 0x1 + bne _08038646 + b _08038798 +_08038646: + cmp r4, 0x1 + bcc _0803864C + b _08038824 +_0803864C: + adds r0, 0x8 + bl sub_8012FD8 + movs r5, 0 + str r5, [sp, 0x10] + bl sub_80140F8 + bl sub_8011C1C + adds r1, r0, 0 + add r0, sp, 0x10 + bl sub_801203C + adds r4, r0, 0 + bl sub_8014114 + cmp r4, 0 + beq _080386B8 + cmp r4, 0x1 + beq _08038738 + ldr r0, [r6] + movs r4, 0xA4 + lsls r4, 1 + adds r0, r4 + movs r1, 0 + bl sub_8035CC0 + ldr r1, [r6] + ldr r0, [r1] + cmp r0, 0x2E + bne _08038750 + adds r0, r1, 0 + adds r0, 0x8 + adds r1, r4 + ldr r3, _080386B0 + ldr r2, _080386B4 + str r2, [sp] + str r5, [sp, 0x4] + movs r2, 0x6 + str r2, [sp, 0x8] + str r5, [sp, 0xC] + movs r2, 0 + bl sub_8035C3C + b _0803876E + .align 2, 0 +_080386A8: .4byte 0x0000ffdc +_080386AC: .4byte gUnknown_203B364 +_080386B0: .4byte gUnknown_80E6F38 +_080386B4: .4byte gUnknown_80E7114 +_080386B8: + ldr r0, [r6] + movs r1, 0xA4 + lsls r1, 1 + adds r0, r1 + movs r1, 0 + bl sub_8035CC0 + ldr r1, [r6] + ldr r0, [r1] + cmp r0, 0x2E + bne _080386F8 + adds r0, r1, 0 + adds r0, 0x8 + movs r2, 0xA4 + lsls r2, 1 + adds r1, r2 + ldr r3, _080386F0 + ldr r2, _080386F4 + str r2, [sp] + str r5, [sp, 0x4] + movs r2, 0x6 + str r2, [sp, 0x8] + str r5, [sp, 0xC] + movs r2, 0 + bl sub_8035C3C + b _08038716 + .align 2, 0 +_080386F0: .4byte gUnknown_80E6F38 +_080386F4: .4byte gUnknown_80E70CC +_080386F8: + adds r0, r1, 0 + adds r0, 0x8 + movs r2, 0xA4 + lsls r2, 1 + adds r1, r2 + ldr r3, _08038728 + ldr r2, _0803872C + str r2, [sp] + str r5, [sp, 0x4] + movs r2, 0x6 + str r2, [sp, 0x8] + str r5, [sp, 0xC] + movs r2, 0 + bl sub_8035C3C +_08038716: + ldr r4, _08038730 + ldr r1, [r4] + ldr r0, [r1] + cmp r0, 0x2D + bne _08038734 + movs r0, 0x1 + str r0, [r1, 0x4] + movs r0, 0x13 + b _08038826 + .align 2, 0 +_08038728: .4byte gUnknown_80E6F38 +_0803872C: .4byte gUnknown_80E6FBC +_08038730: .4byte gUnknown_203B364 +_08038734: + adds r0, r1, 0 + b _08038772 +_08038738: + ldr r0, _0803874C + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_80141B4 + ldr r1, [r6] + movs r0, 0x5 + b _08038780 + .align 2, 0 +_0803874C: .4byte gUnknown_80E7178 +_08038750: + adds r0, r1, 0 + adds r0, 0x8 + movs r2, 0xA4 + lsls r2, 1 + adds r1, r2 + ldr r3, _08038788 + ldr r2, _0803878C + str r2, [sp] + str r5, [sp, 0x4] + movs r2, 0x6 + str r2, [sp, 0x8] + str r5, [sp, 0xC] + movs r2, 0 + bl sub_8035C3C +_0803876E: + ldr r4, _08038790 + ldr r0, [r4] +_08038772: + adds r0, 0x8 + movs r1, 0 + movs r2, 0x1 + bl sub_8035CF4 + ldr r1, [r4] + movs r0, 0x1 +_08038780: + str r0, [r1, 0x4] + ldr r5, _08038794 + b _08038824 + .align 2, 0 +_08038788: .4byte gUnknown_80E6F38 +_0803878C: .4byte gUnknown_80E701C +_08038790: .4byte gUnknown_203B364 +_08038794: .4byte 0x0000ffdc +_08038798: + adds r0, 0x8 + bl sub_80130A8 + lsls r0, 24 + cmp r0, 0 + bne _080387AE + ldr r0, [r6] + adds r0, 0x8 + add r1, sp, 0x14 + bl sub_8013114 +_080387AE: + ldr r0, [sp, 0x14] + cmp r0, 0x3 + beq _0803881C + cmp r0, 0x3 + bhi _080387BE + cmp r0, 0x2 + beq _080387C2 + b _08038820 +_080387BE: + cmp r0, 0x4 + bne _08038820 +_080387C2: + ldr r4, _080387D8 + ldr r1, [r4] + ldr r0, [r1] + cmp r0, 0x29 + beq _080387D0 + cmp r0, 0x2E + bne _080387DC +_080387D0: + movs r0, 0x1 + str r0, [r1, 0x4] + movs r5, 0x1 + b _08038820 + .align 2, 0 +_080387D8: .4byte gUnknown_203B364 +_080387DC: + cmp r0, 0x2D + bne _080387E8 + movs r0, 0x1 + str r0, [r1, 0x4] + movs r5, 0x13 + b _08038820 +_080387E8: + cmp r0, 0x2C + bne _080387F4 + movs r0, 0x1 + str r0, [r1, 0x4] + movs r5, 0x1F + b _08038820 +_080387F4: + bl sub_8035D4C + adds r0, 0x3A + ldrb r0, [r0] + cmp r0, 0 + beq _0803880A + ldr r1, [r4] + movs r0, 0x1 + str r0, [r1, 0x4] + movs r5, 0x35 + b _08038820 +_0803880A: + ldr r0, [r4] + movs r1, 0x1 + str r1, [r0, 0x4] + ldr r0, [r0] + movs r5, 0xB + cmp r0, 0x2B + bne _08038820 + movs r5, 0xD + b _08038820 +_0803881C: + ldr r0, [r6] + str r4, [r0, 0x4] +_08038820: + bl sub_80388C4 +_08038824: + adds r0, r5, 0 +_08038826: + add sp, 0x18 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8038630 + + thumb_func_start sub_8038830 +sub_8038830: + push {r4,r5,lr} + movs r5, 0 + ldr r0, _080388A4 + ldr r0, [r0] + mov r12, r0 + movs r3, 0xD4 + lsls r3, 1 + add r3, r12 + ldrh r1, [r3] + ldr r0, _080388A8 + ands r0, r1 + ldr r1, _080388AC + ands r0, r1 + ldr r4, _080388B0 + ands r0, r4 + ldr r1, _080388B4 + ands r0, r1 + ldr r1, _080388B8 + ands r0, r1 + movs r2, 0x80 + lsls r2, 7 + ldr r1, _080388BC + ands r0, r1 + orrs r0, r2 + strh r0, [r3] + movs r2, 0xFC + lsls r2, 2 + ldrh r1, [r3, 0x4] + movs r0, 0xFC + lsls r0, 8 + ands r0, r1 + orrs r0, r2 + ands r0, r4 + movs r2, 0xF + movs r4, 0xF0 + lsls r4, 8 + ldr r1, _080388C0 + ands r0, r1 + orrs r0, r4 + strh r0, [r3, 0x4] + movs r0, 0x70 + strh r0, [r3, 0x2] + movs r1, 0xD0 + lsls r1, 3 + ldrh r0, [r3, 0x6] + ands r2, r0 + orrs r2, r1 + strh r2, [r3, 0x6] + movs r0, 0xD8 + lsls r0, 1 + add r0, r12 + str r5, [r0] + movs r0, 0 + bl sub_8004D8C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080388A4: .4byte gUnknown_203B364 +_080388A8: .4byte 0x0000feff +_080388AC: .4byte 0x0000fdff +_080388B0: .4byte 0x0000f3ff +_080388B4: .4byte 0x0000efff +_080388B8: .4byte 0x0000dfff +_080388BC: .4byte 0x00003fff +_080388C0: .4byte 0x00000fff + thumb_func_end sub_8038830 + + thumb_func_start sub_80388C4 +sub_80388C4: + push {r4,r5,lr} + ldr r5, _080388FC + ldr r2, [r5] + movs r4, 0xD8 + lsls r4, 1 + adds r0, r2, r4 + ldr r0, [r0] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080388EA + movs r1, 0xD4 + lsls r1, 1 + adds r0, r2, r1 + subs r1, 0xA8 + movs r2, 0 + movs r3, 0 + bl AddSprite +_080388EA: + ldr r1, [r5] + adds r1, r4 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080388FC: .4byte gUnknown_203B364 + thumb_func_end sub_80388C4 + + thumb_func_start sub_8038900 +sub_8038900: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r6, r0, 0 + ldr r5, _080389B8 + ldr r0, [r5] + cmp r0, 0 + bne _0803892A + movs r4, 0x85 + lsls r4, 2 + adds r0, r4, 0 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] + movs r1, 0 + adds r2, r4, 0 + bl MemoryFill8 +_0803892A: + movs r0, 0x1B + negs r0, r0 + adds r0, r6 + mov r8, r0 + mov r12, r5 + movs r1, 0xA4 + lsls r1, 1 + mov r9, r1 + ldr r4, _080389BC + mov r10, r4 + movs r3, 0 + movs r2, 0x3 +_08038942: + mov r5, r12 + ldr r1, [r5] + adds r1, r3 + add r1, r9 + mov r0, r10 + ldm r0!, {r4,r5,r7} + stm r1!, {r4,r5,r7} + ldm r0!, {r4,r5,r7} + stm r1!, {r4,r5,r7} + adds r3, 0x18 + subs r2, 0x1 + cmp r2, 0 + bge _08038942 + bl sub_8004914 + ldr r4, _080389B8 + ldr r0, [r4] + movs r7, 0xA4 + lsls r7, 1 + adds r0, r7 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r2, _080389C0 + ldrb r0, [r2] + cmp r0, 0 + bne _08038986 + ldr r0, _080389C4 + ldr r1, [r0] + adds r7, r4, 0 + adds r5, r0, 0 + cmp r1, r6 + beq _080389A0 +_08038986: + adds r7, r4, 0 + adds r3, r2, 0 + ldr r5, _080389C4 + ldr r1, _080389C8 + movs r2, 0 + adds r0, r1, 0 + adds r0, 0x35 +_08038994: + strb r2, [r0] + subs r0, 0x1 + cmp r0, r1 + bge _08038994 + movs r0, 0 + strb r0, [r3] +_080389A0: + ldr r0, [r7] + str r6, [r0] + str r6, [r5] + mov r0, r8 + cmp r0, 0x7 + bhi _08038A36 + lsls r0, 2 + ldr r1, _080389CC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080389B8: .4byte gUnknown_203B370 +_080389BC: .4byte gUnknown_80E71E4 +_080389C0: .4byte gUnknown_203B368 +_080389C4: .4byte gUnknown_203B36C +_080389C8: .4byte gUnknown_202EC50 +_080389CC: .4byte _080389D0 + .align 2, 0 +_080389D0: + .4byte _080389F0 + .4byte _080389FC + .4byte _080389F0 + .4byte _080389FC + .4byte _080389F0 + .4byte _080389FC + .4byte _08038A0C + .4byte _08038A2E +_080389F0: + bl sub_8035D74 + movs r1, 0 + bl sub_8031D70 + b _08038A36 +_080389FC: + ldr r1, _08038A08 + movs r0, 0x4 + bl sub_80151C0 + b _08038A36 + .align 2, 0 +_08038A08: .4byte gUnknown_202EC50 +_08038A0C: + movs r0, 0x1F + bl sub_8095228 + adds r4, r0, 0 + movs r1, 0 + movs r2, 0x30 + bl MemoryFill8 + movs r1, 0 + movs r0, 0x2 + strb r0, [r4] + adds r4, 0x22 + strb r1, [r4] + movs r0, 0x1F + bl sub_8031D70 + b _08038A36 +_08038A2E: + ldr r1, _08038A54 + movs r0, 0x4 + bl sub_80151C0 +_08038A36: + adds r0, r6, 0 + bl sub_8039000 + ldr r1, _08038A58 + ldr r1, [r1] + str r0, [r1, 0x4] + bl sub_8039174 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08038A54: .4byte gUnknown_202EC50 +_08038A58: .4byte gUnknown_203B370 + thumb_func_end sub_8038900 + + thumb_func_start sub_8038A5C +sub_8038A5C: + push {r4,lr} + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r4, _08038A8C + ldr r0, [r4] + cmp r0, 0 + beq _08038A86 + bl sub_80155F0 + bl sub_8031E10 + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_08038A86: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08038A8C: .4byte gUnknown_203B370 + thumb_func_end sub_8038A5C + + thumb_func_start sub_8038A90 +sub_8038A90: + push {r4-r6,lr} + sub sp, 0x34 + movs r0, 0xB + str r0, [sp, 0x30] + ldr r5, _08038AB4 + ldr r1, _08038AB8 + ldr r0, [r1] + ldr r0, [r0, 0x4] + adds r6, r1, 0 + cmp r0, 0x9 + bls _08038AA8 + b _08038DB0 +_08038AA8: + lsls r0, 2 + ldr r1, _08038ABC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08038AB4: .4byte 0x0000ffdc +_08038AB8: .4byte gUnknown_203B370 +_08038ABC: .4byte _08038AC0 + .align 2, 0 +_08038AC0: + .4byte _08038AE8 + .4byte _08038AFC + .4byte _08038AE8 + .4byte _08038AFC + .4byte _08038AE8 + .4byte _08038AFC + .4byte _08038C78 + .4byte _08038C8C + .4byte _08038CC2 + .4byte _08038D38 +_08038AE8: + bl sub_8031DCC + ldr r5, _08038AF8 + cmp r0, 0 + bne _08038AF4 + b _08038DB0 +_08038AF4: + movs r5, 0xB + b _08038DB0 + .align 2, 0 +_08038AF8: .4byte 0x0000ffdc +_08038AFC: + bl sub_80154F0 + adds r4, r0, 0 + mov r0, sp + movs r1, 0 + movs r2, 0x30 + bl MemoryFill8 + cmp r4, 0x1 + bne _08038B12 + b _08038CBC +_08038B12: + cmp r4, 0x1 + bcs _08038B18 + b _08038CB0 +_08038B18: + cmp r4, 0x2 + beq _08038AF4 + cmp r4, 0x3 + beq _08038B22 + b _08038DB0 +_08038B22: + ldr r0, _08038B44 + ldr r0, [r0] + ldr r0, [r0] + ldr r1, _08038B48 + mov r2, sp + bl sub_8039068 + subs r0, 0x7 + cmp r0, 0x11 + bls _08038B38 + b _08038DB0 +_08038B38: + lsls r0, 2 + ldr r1, _08038B4C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08038B44: .4byte gUnknown_203B370 +_08038B48: .4byte gUnknown_202EC50 +_08038B4C: .4byte _08038B50 + .align 2, 0 +_08038B50: + .4byte _08038BA4 + .4byte _08038DB0 + .4byte _08038BD8 + .4byte _08038DB0 + .4byte _08038C28 + .4byte _08038DB0 + .4byte _08038B9C + .4byte _08038DB0 + .4byte _08038DB0 + .4byte _08038DB0 + .4byte _08038B98 + .4byte _08038BA0 + .4byte _08038BD4 + .4byte _08038C24 + .4byte _08038DB0 + .4byte _08038BA8 + .4byte _08038BDC + .4byte _08038C2C +_08038B98: + movs r0, 0x11 + b _08038CA4 +_08038B9C: + movs r0, 0xD + b _08038CA4 +_08038BA0: + movs r0, 0x12 + b _08038CA4 +_08038BA4: + movs r0, 0x7 + b _08038CA4 +_08038BA8: + ldr r0, [sp, 0x10] + bl sub_8095274 + bl sub_8038F98 + ldr r0, _08038BCC + ldr r1, [r0] + movs r0, 0x9 + str r0, [r1, 0x4] + ldr r5, _08038BD0 + mov r1, sp + movs r0, 0x2 + strb r0, [r1] + mov r0, sp + bl sub_80951BC + b _08038DB0 + .align 2, 0 +_08038BCC: .4byte gUnknown_203B370 +_08038BD0: .4byte 0x0000ffdc +_08038BD4: + movs r0, 0x13 + b _08038CA4 +_08038BD8: + movs r0, 0x9 + b _08038CA4 +_08038BDC: + bl sub_8038F98 + ldr r0, _08038C18 + ldr r1, [r0] + movs r0, 0x9 + str r0, [r1, 0x4] + ldr r5, _08038C1C + mov r1, sp + movs r0, 0x5 + strb r0, [r1] + mov r0, sp + bl sub_80951FC + ldr r1, [sp, 0x10] + movs r0, 0x1 + bl sub_809539C + lsls r0, 24 + lsrs r0, 24 + bl sub_8095228 + movs r1, 0x7 + strb r1, [r0] + ldr r0, _08038C20 + movs r1, 0 + movs r2, 0x5C + bl MemoryFill8 + b _08038DB0 + .align 2, 0 +_08038C18: .4byte gUnknown_203B370 +_08038C1C: .4byte 0x0000ffdc +_08038C20: .4byte gUnknown_203B484 +_08038C24: + movs r0, 0x14 + b _08038CA4 +_08038C28: + movs r0, 0xB + b _08038CA4 +_08038C2C: + bl sub_8038F98 + ldr r0, _08038C70 + ldr r1, [r0] + movs r0, 0x9 + str r0, [r1, 0x4] + ldr r5, _08038C74 + ldr r1, [sp, 0x10] + movs r0, 0x4 + bl sub_809539C + lsls r0, 24 + lsrs r0, 24 + bl sub_8095228 + adds r2, r0, 0 + mov r1, sp + ldm r1!, {r3,r4,r6} + stm r2!, {r3,r4,r6} + ldm r1!, {r3,r4,r6} + stm r2!, {r3,r4,r6} + ldm r1!, {r3,r4,r6} + stm r2!, {r3,r4,r6} + ldm r1!, {r3,r4,r6} + stm r2!, {r3,r4,r6} + movs r1, 0x6 + strb r1, [r0] + bl sub_8035D4C + adds r0, 0x3A + movs r1, 0x1 + strb r1, [r0] + b _08038DB0 + .align 2, 0 +_08038C70: .4byte gUnknown_203B370 +_08038C74: .4byte 0x0000ffdc +_08038C78: + bl sub_8031DCC + ldr r5, _08038C88 + cmp r0, 0 + bne _08038C84 + b _08038DB0 +_08038C84: + movs r5, 0xD + b _08038DB0 + .align 2, 0 +_08038C88: .4byte 0x0000ffdc +_08038C8C: + bl sub_80154F0 + cmp r0, 0x1 + beq _08038CBC + cmp r0, 0x1 + bcc _08038CB0 + cmp r0, 0x2 + beq _08038C84 + cmp r0, 0x3 + beq _08038CA2 + b _08038DB0 +_08038CA2: + movs r0, 0x15 +_08038CA4: + bl sub_8038DC0 + ldr r0, _08038CB4 + ldr r1, [r0] + movs r0, 0x8 + str r0, [r1, 0x4] +_08038CB0: + ldr r5, _08038CB8 + b _08038DB0 + .align 2, 0 +_08038CB4: .4byte gUnknown_203B370 +_08038CB8: .4byte 0x0000ffdc +_08038CBC: + bl sub_8031E00 + b _08038CB0 +_08038CC2: + ldr r0, [r6] + adds r0, 0x8 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _08038CDA + ldr r0, [r6] + adds r0, 0x8 + add r1, sp, 0x30 + bl sub_8013114 +_08038CDA: + ldr r0, [sp, 0x30] + cmp r0, 0xB + beq _08038D24 + cmp r0, 0xB + bhi _08038CEA + cmp r0, 0xA + beq _08038CEE + b _08038DB0 +_08038CEA: + cmp r0, 0xC + bne _08038DB0 +_08038CEE: + bl sub_8039174 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r1, _08038D1C + movs r0, 0x4 + bl sub_80151C0 + ldr r0, _08038D20 + ldr r1, [r0] + movs r0, 0x8 + str r0, [r1, 0x4] + ldr r0, [r1] + subs r0, 0x21 + movs r5, 0xB + cmp r0, 0x1 + bhi _08038DB0 + b _08038C84 + .align 2, 0 +_08038D1C: .4byte gUnknown_202EC50 +_08038D20: .4byte gUnknown_203B370 +_08038D24: + ldr r1, [r6] + movs r0, 0x8 + str r0, [r1, 0x4] + ldr r5, _08038D34 + bl sub_80391F8 + b _08038DB0 + .align 2, 0 +_08038D34: .4byte 0x0000ffdc +_08038D38: + adds r4, r6, 0 + ldr r0, [r4] + adds r0, 0x8 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _08038D52 + ldr r0, [r4] + adds r0, 0x8 + add r1, sp, 0x30 + bl sub_8013114 +_08038D52: + ldr r0, [sp, 0x30] + cmp r0, 0xB + beq _08038DA4 + cmp r0, 0xB + bhi _08038D62 + cmp r0, 0xA + beq _08038D66 + b _08038DB0 +_08038D62: + cmp r0, 0xC + bne _08038DB0 +_08038D66: + bl sub_8039174 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r1, _08038D9C + movs r0, 0x4 + bl sub_80151C0 + ldr r4, _08038DA0 + ldr r0, [r4] + ldr r0, [r0] + bl sub_8039000 + ldr r1, [r4] + str r0, [r1, 0x4] + ldr r0, [r1] + subs r0, 0x21 + movs r5, 0x2A + cmp r0, 0x1 + bhi _08038DB0 + movs r5, 0x2B + b _08038DB0 + .align 2, 0 +_08038D9C: .4byte gUnknown_202EC50 +_08038DA0: .4byte gUnknown_203B370 +_08038DA4: + ldr r1, [r6] + movs r0, 0x9 + str r0, [r1, 0x4] + ldr r5, _08038DBC + bl sub_80391F8 +_08038DB0: + adds r0, r5, 0 + add sp, 0x34 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08038DBC: .4byte 0x0000ffdc + thumb_func_end sub_8038A90 + + thumb_func_start sub_8038DC0 +sub_8038DC0: + push {r4,lr} + sub sp, 0x10 + adds r4, r0, 0 + ldr r0, _08038DF8 + ldr r0, [r0] + movs r1, 0xD4 + lsls r1, 1 + adds r0, r1 + bl sub_8006518 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + bl sub_80155F0 + subs r0, r4, 0x7 + cmp r0, 0xE + bls _08038DEE + b _08038F74 +_08038DEE: + lsls r0, 2 + ldr r1, _08038DFC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08038DF8: .4byte gUnknown_203B370 +_08038DFC: .4byte _08038E00 + .align 2, 0 +_08038E00: + .4byte _08038E7C + .4byte _08038F74 + .4byte _08038EDC + .4byte _08038F74 + .4byte _08038F1C + .4byte _08038F74 + .4byte _08038E9C + .4byte _08038F74 + .4byte _08038F74 + .4byte _08038F74 + .4byte _08038E3C + .4byte _08038E5C + .4byte _08038EBC + .4byte _08038EFC + .4byte _08038F50 +_08038E3C: + ldr r0, _08038E50 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x8 + movs r2, 0xA4 + lsls r2, 1 + adds r1, r2 + ldr r3, _08038E54 + ldr r2, _08038E58 + b _08038F2E + .align 2, 0 +_08038E50: .4byte gUnknown_203B370 +_08038E54: .4byte gUnknown_80E71FC +_08038E58: .4byte gUnknown_80E7214 +_08038E5C: + ldr r0, _08038E70 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x8 + movs r2, 0xA4 + lsls r2, 1 + adds r1, r2 + ldr r3, _08038E74 + ldr r2, _08038E78 + b _08038F2E + .align 2, 0 +_08038E70: .4byte gUnknown_203B370 +_08038E74: .4byte gUnknown_80E72EC +_08038E78: .4byte gUnknown_80E7304 +_08038E7C: + ldr r0, _08038E90 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x8 + movs r2, 0xA4 + lsls r2, 1 + adds r1, r2 + ldr r3, _08038E94 + ldr r2, _08038E98 + b _08038F2E + .align 2, 0 +_08038E90: .4byte gUnknown_203B370 +_08038E94: .4byte gUnknown_80E7344 +_08038E98: .4byte gUnknown_80E735C +_08038E9C: + ldr r0, _08038EB0 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x8 + movs r2, 0xA4 + lsls r2, 1 + adds r1, r2 + ldr r3, _08038EB4 + ldr r2, _08038EB8 + b _08038F2E + .align 2, 0 +_08038EB0: .4byte gUnknown_203B370 +_08038EB4: .4byte gUnknown_80E7588 +_08038EB8: .4byte gUnknown_80E75A0 +_08038EBC: + ldr r0, _08038ED0 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x8 + movs r2, 0xA4 + lsls r2, 1 + adds r1, r2 + ldr r3, _08038ED4 + ldr r2, _08038ED8 + b _08038F2E + .align 2, 0 +_08038ED0: .4byte gUnknown_203B370 +_08038ED4: .4byte gUnknown_80E73AC +_08038ED8: .4byte gUnknown_80E73C4 +_08038EDC: + ldr r0, _08038EF0 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x8 + movs r2, 0xA4 + lsls r2, 1 + adds r1, r2 + ldr r3, _08038EF4 + ldr r2, _08038EF8 + b _08038F2E + .align 2, 0 +_08038EF0: .4byte gUnknown_203B370 +_08038EF4: .4byte gUnknown_80E7408 +_08038EF8: .4byte gUnknown_80E7420 +_08038EFC: + ldr r0, _08038F10 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x8 + movs r2, 0xA4 + lsls r2, 1 + adds r1, r2 + ldr r3, _08038F14 + ldr r2, _08038F18 + b _08038F2E + .align 2, 0 +_08038F10: .4byte gUnknown_203B370 +_08038F14: .4byte gUnknown_80E7468 +_08038F18: .4byte gUnknown_80E7480 +_08038F1C: + ldr r0, _08038F44 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x8 + movs r2, 0xA4 + lsls r2, 1 + adds r1, r2 + ldr r3, _08038F48 + ldr r2, _08038F4C +_08038F2E: + str r2, [sp] + movs r4, 0 + str r4, [sp, 0x4] + movs r2, 0xD + str r2, [sp, 0x8] + str r4, [sp, 0xC] + movs r2, 0 + bl sub_8035C3C + b _08038F74 + .align 2, 0 +_08038F44: .4byte gUnknown_203B370 +_08038F48: .4byte gUnknown_80E74C8 +_08038F4C: .4byte gUnknown_80E74E0 +_08038F50: + ldr r0, _08038F8C + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0x8 + movs r2, 0xA4 + lsls r2, 1 + adds r1, r2 + ldr r3, _08038F90 + ldr r2, _08038F94 + str r2, [sp] + movs r4, 0 + str r4, [sp, 0x4] + movs r2, 0xD + str r2, [sp, 0x8] + str r4, [sp, 0xC] + movs r2, 0 + bl sub_8035C3C +_08038F74: + ldr r0, _08038F8C + ldr r0, [r0] + adds r0, 0x8 + movs r1, 0 + movs r2, 0x1 + bl sub_8035CF4 + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08038F8C: .4byte gUnknown_203B370 +_08038F90: .4byte gUnknown_80E752C +_08038F94: .4byte gUnknown_80E7544 + thumb_func_end sub_8038DC0 + + thumb_func_start sub_8038F98 +sub_8038F98: + push {r4,r5,lr} + sub sp, 0x10 + ldr r5, _08038FF4 + ldr r0, [r5] + movs r1, 0xD4 + lsls r1, 1 + adds r0, r1 + bl sub_8006518 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + bl sub_80155F0 + ldr r1, [r5] + adds r0, r1, 0 + adds r0, 0x8 + movs r2, 0xA4 + lsls r2, 1 + adds r1, r2 + ldr r3, _08038FF8 + ldr r2, _08038FFC + str r2, [sp] + movs r4, 0 + str r4, [sp, 0x4] + movs r2, 0xD + str r2, [sp, 0x8] + str r4, [sp, 0xC] + movs r2, 0 + bl sub_8035C3C + ldr r0, [r5] + adds r0, 0x8 + movs r1, 0 + movs r2, 0x1 + bl sub_8035CF4 + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08038FF4: .4byte gUnknown_203B370 +_08038FF8: .4byte gUnknown_80E7278 +_08038FFC: .4byte gUnknown_80E7290 + thumb_func_end sub_8038F98 + + thumb_func_start sub_8039000 +sub_8039000: + push {lr} + movs r1, 0xB + ldr r0, _0803901C + ldr r0, [r0] + ldr r0, [r0] + subs r0, 0x1B + cmp r0, 0x7 + bhi _08039062 + lsls r0, 2 + ldr r1, _08039020 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0803901C: .4byte gUnknown_203B370 +_08039020: .4byte _08039024 + .align 2, 0 +_08039024: + .4byte _08039044 + .4byte _08039054 + .4byte _0803904C + .4byte _0803905C + .4byte _08039048 + .4byte _08039058 + .4byte _08039050 + .4byte _08039060 +_08039044: + movs r1, 0 + b _08039062 +_08039048: + movs r1, 0x4 + b _08039062 +_0803904C: + movs r1, 0x2 + b _08039062 +_08039050: + movs r1, 0x6 + b _08039062 +_08039054: + movs r1, 0x1 + b _08039062 +_08039058: + movs r1, 0x5 + b _08039062 +_0803905C: + movs r1, 0x3 + b _08039062 +_08039060: + movs r1, 0x7 +_08039062: + adds r0, r1, 0 + pop {r1} + bx r1 + thumb_func_end sub_8039000 + + thumb_func_start sub_8039068 +sub_8039068: + push {r4-r6,lr} + adds r6, r0, 0 + adds r0, r1, 0 + adds r5, r2, 0 + adds r1, r5, 0 + bl sub_803D204 + lsls r0, 24 + cmp r0, 0 + beq _080390AC + ldrb r0, [r5] + cmp r0, 0x7 + bhi _080390AC + ldrb r4, [r5, 0x5] + ldrb r0, [r5, 0x4] + bl sub_8090298 + cmp r4, r0 + bge _080390AC + movs r0, 0xC + ldrsh r1, [r5, r0] + cmp r1, 0 + beq _080390AC + ldr r0, _080390B0 + cmp r1, r0 + bgt _080390AC + adds r0, r5, 0 + adds r0, 0x22 + ldrb r0, [r0] + bl sub_8092040 + lsls r0, 24 + cmp r0, 0 + beq _080390B4 +_080390AC: + movs r0, 0x11 + b _0803916E + .align 2, 0 +_080390B0: .4byte 0x000001a7 +_080390B4: + cmp r6, 0x1E + beq _08039120 + cmp r6, 0x1E + bhi _080390C2 + cmp r6, 0x1C + beq _080390C8 + b _0803916A +_080390C2: + cmp r6, 0x20 + beq _08039140 + b _0803916A +_080390C8: + ldrb r0, [r5] + cmp r0, 0x1 + beq _080390D2 + movs r0, 0x12 + b _0803916E +_080390D2: + ldr r1, [r5, 0x10] + movs r0, 0x2 + bl sub_80952F0 + lsls r0, 24 + cmp r0, 0 + bne _08039108 + ldr r1, [r5, 0x10] + movs r0, 0x4 + bl sub_80952F0 + lsls r0, 24 + cmp r0, 0 + bne _08039108 + ldr r1, [r5, 0x10] + movs r0, 0x6 + bl sub_80952F0 + lsls r0, 24 + cmp r0, 0 + bne _08039108 + ldr r0, [r5, 0x10] + bl sub_8095298 + lsls r0, 24 + cmp r0, 0 + beq _0803910C +_08039108: + movs r0, 0x7 + b _0803916E +_0803910C: + bl sub_8095190 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0803911C + movs r0, 0xD + b _0803916E +_0803911C: + movs r0, 0x16 + b _0803916E +_08039120: + ldrb r0, [r5] + cmp r0, 0x4 + beq _0803912A + movs r0, 0x13 + b _0803916E +_0803912A: + ldr r1, [r5, 0x10] + movs r0, 0x1 + bl sub_80952F0 + lsls r0, 24 + cmp r0, 0 + bne _0803913C + movs r0, 0x9 + b _0803916E +_0803913C: + movs r0, 0x17 + b _0803916E +_08039140: + ldrb r0, [r5] + cmp r0, 0x5 + beq _0803914A + movs r0, 0x14 + b _0803916E +_0803914A: + ldr r1, [r5, 0x10] + movs r0, 0x4 + bl sub_80952F0 + lsls r0, 24 + cmp r0, 0 + beq _08039162 + bl sub_8011C34 + ldr r1, [r5, 0x28] + cmp r1, r0 + beq _08039166 +_08039162: + movs r0, 0xB + b _0803916E +_08039166: + movs r0, 0x18 + b _0803916E +_0803916A: + movs r0, 0x1 + negs r0, r0 +_0803916E: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8039068 + + thumb_func_start sub_8039174 +sub_8039174: + push {r4,lr} + ldr r0, _080391D8 + ldr r3, [r0] + movs r0, 0x82 + lsls r0, 2 + adds r3, r0 + ldrh r1, [r3] + ldr r0, _080391DC + ands r0, r1 + ldr r1, _080391E0 + ands r0, r1 + ldr r4, _080391E4 + ands r0, r4 + ldr r1, _080391E8 + ands r0, r1 + ldr r1, _080391EC + ands r0, r1 + movs r2, 0x80 + lsls r2, 7 + ldr r1, _080391F0 + ands r0, r1 + orrs r0, r2 + strh r0, [r3] + movs r2, 0xFC + lsls r2, 2 + ldrh r1, [r3, 0x4] + movs r0, 0xFC + lsls r0, 8 + ands r0, r1 + orrs r0, r2 + ands r0, r4 + movs r2, 0xF + movs r4, 0xF0 + lsls r4, 8 + ldr r1, _080391F4 + ands r0, r1 + orrs r0, r4 + strh r0, [r3, 0x4] + movs r0, 0 + strh r0, [r3, 0x2] + movs r1, 0xC0 + lsls r1, 4 + ldrh r0, [r3, 0x6] + ands r2, r0 + orrs r2, r1 + strh r2, [r3, 0x6] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080391D8: .4byte gUnknown_203B370 +_080391DC: .4byte 0x0000feff +_080391E0: .4byte 0x0000fdff +_080391E4: .4byte 0x0000f3ff +_080391E8: .4byte 0x0000efff +_080391EC: .4byte 0x0000dfff +_080391F0: .4byte 0x00003fff +_080391F4: .4byte 0x00000fff + thumb_func_end sub_8039174 + + thumb_func_start sub_80391F8 +sub_80391F8: + push {r4-r6,lr} + ldr r6, _08039250 + ldr r2, [r6] + movs r0, 0x82 + lsls r0, 2 + adds r4, r2, r0 + ldrh r1, [r4, 0x2] + movs r0, 0xFE + lsls r0, 8 + ands r0, r1 + movs r1, 0x70 + orrs r0, r1 + strh r0, [r4, 0x2] + movs r3, 0xE0 + lsls r3, 3 + ldrh r1, [r4, 0x6] + movs r0, 0xF + ands r0, r1 + orrs r0, r3 + strh r0, [r4, 0x6] + movs r5, 0x84 + lsls r5, 2 + adds r2, r5 + ldr r0, [r2] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0803923C + adds r1, 0xF8 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0 + bl AddSprite +_0803923C: + bl sub_80144C4 + ldr r1, [r6] + adds r1, r5 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08039250: .4byte gUnknown_203B370 + thumb_func_end sub_80391F8 + + thumb_func_start sub_8039254 +sub_8039254: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + adds r6, r0, 0 + ldr r5, _080392EC + ldr r0, [r5] + cmp r0, 0 + bne _0803927C + movs r4, 0x9F + lsls r4, 2 + adds r0, r4, 0 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] + movs r1, 0 + adds r2, r4, 0 + bl MemoryFill8 +_0803927C: + ldr r0, [r5] + str r6, [r0] + mov r12, r5 + movs r0, 0xA2 + lsls r0, 1 + mov r8, r0 + ldr r4, _080392F0 + movs r3, 0 + movs r2, 0x3 +_0803928E: + mov r5, r12 + ldr r1, [r5] + adds r1, r3 + add r1, r8 + adds r0, r4, 0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r3, 0x18 + subs r2, 0x1 + cmp r2, 0 + bge _0803928E + bl sub_8004914 + ldr r6, _080392EC + ldr r0, [r6] + movs r5, 0xA2 + lsls r5, 1 + adds r0, r5 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r1, [r6] + adds r0, r1, 0x4 + adds r1, r5 + ldr r3, _080392F4 + ldr r2, _080392F8 + str r2, [sp] + movs r4, 0 + str r4, [sp, 0x4] + movs r7, 0x6 + str r7, [sp, 0x8] + str r4, [sp, 0xC] + movs r2, 0 + bl sub_8035C3C + ldr r1, [r6] + ldr r0, [r1] + cmp r0, 0x7 + beq _08039306 + cmp r0, 0x7 + bhi _080392FC + cmp r0, 0x6 + beq _08039338 + b _08039382 + .align 2, 0 +_080392EC: .4byte gUnknown_203B374 +_080392F0: .4byte gUnknown_80E75F8 +_080392F4: .4byte gUnknown_80E7610 +_080392F8: .4byte gUnknown_203B378 +_080392FC: + cmp r0, 0x8 + beq _0803934C + cmp r0, 0x9 + beq _0803936C + b _08039382 +_08039306: + bl sub_8039844 + lsls r0, 24 + cmp r0, 0 + beq _08039324 + ldr r1, [r6] + adds r0, r1, 0x4 + adds r1, r5 + ldr r3, _0803931C + ldr r2, _08039320 + b _08039354 + .align 2, 0 +_0803931C: .4byte gUnknown_80E762C +_08039320: .4byte gUnknown_80E7644 +_08039324: + ldr r1, [r6] + adds r0, r1, 0x4 + adds r1, r5 + ldr r3, _08039330 + ldr r2, _08039334 + b _08039354 + .align 2, 0 +_08039330: .4byte gUnknown_80E762C +_08039334: .4byte gUnknown_80E7684 +_08039338: + adds r0, r1, 0x4 + adds r1, r5 + ldr r3, _08039344 + ldr r2, _08039348 + b _08039354 + .align 2, 0 +_08039344: .4byte gUnknown_80E762C +_08039348: .4byte gUnknown_80E76B8 +_0803934C: + adds r0, r1, 0x4 + adds r1, r5 + ldr r3, _08039364 + ldr r2, _08039368 +_08039354: + str r2, [sp] + str r4, [sp, 0x4] + str r7, [sp, 0x8] + str r4, [sp, 0xC] + movs r2, 0x1 + bl sub_8035C3C + b _08039382 + .align 2, 0 +_08039364: .4byte gUnknown_80E762C +_08039368: .4byte gUnknown_80E76E8 +_0803936C: + adds r0, r1, 0x4 + adds r1, r5 + ldr r3, _080393DC + ldr r2, _080393E0 + str r2, [sp] + str r4, [sp, 0x4] + str r7, [sp, 0x8] + str r4, [sp, 0xC] + movs r2, 0x1 + bl sub_8035C3C +_08039382: + ldr r4, _080393E4 + ldr r1, [r4] + adds r0, r1, 0x4 + movs r6, 0xA2 + lsls r6, 1 + adds r1, r6 + ldr r3, _080393E8 + ldr r2, _080393EC + str r2, [sp] + movs r2, 0x1 + str r2, [sp, 0x4] + movs r2, 0x2 + str r2, [sp, 0x8] + movs r2, 0 + str r2, [sp, 0xC] + movs r2, 0x2 + bl sub_8035C3C + ldr r0, [r4] + adds r0, 0x4 + movs r1, 0 + movs r2, 0 + bl sub_8035CF4 + ldr r0, [r4] + adds r0, 0x4 + movs r1, 0x1 + movs r2, 0 + bl sub_8035CF4 + ldr r0, [r4] + adds r0, 0x4 + movs r1, 0x2 + movs r2, 0x1 + bl sub_8035CF4 + bl sub_80394A4 + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080393DC: .4byte gUnknown_80E762C +_080393E0: .4byte gUnknown_80E7730 +_080393E4: .4byte gUnknown_203B374 +_080393E8: .4byte gUnknown_80E7784 +_080393EC: .4byte gUnknown_80E779C + thumb_func_end sub_8039254 + + thumb_func_start sub_80393F0 +sub_80393F0: + push {r4,lr} + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r4, _08039418 + ldr r0, [r4] + cmp r0, 0 + beq _08039410 + bl MemoryFree + movs r0, 0 + str r0, [r4] +_08039410: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08039418: .4byte gUnknown_203B374 + thumb_func_end sub_80393F0 + + thumb_func_start sub_803941C +sub_803941C: + push {r4,r5,lr} + sub sp, 0x4 + ldr r5, _08039458 + movs r0, 0x4 + str r0, [sp] + ldr r4, _0803945C + ldr r0, [r4] + adds r0, 0x54 + bl sub_8012FD8 + ldr r0, [r4] + adds r0, 0xA4 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _08039448 + ldr r0, [r4] + adds r0, 0xA4 + mov r1, sp + bl sub_8013114 +_08039448: + ldr r0, [sp] + cmp r0, 0x3 + bhi _08039498 + cmp r0, 0x2 + bcs _08039460 + cmp r0, 0x1 + beq _08039464 + b _08039498 + .align 2, 0 +_08039458: .4byte 0x0000ffdc +_0803945C: .4byte gUnknown_203B374 +_08039460: + movs r5, 0x1 + b _08039498 +_08039464: + ldr r0, [r4] + ldr r0, [r0] + cmp r0, 0x7 + beq _08039480 + cmp r0, 0x7 + bhi _08039476 + cmp r0, 0x6 + beq _08039484 + b _08039498 +_08039476: + cmp r0, 0x8 + beq _0803948E + cmp r0, 0x9 + beq _08039492 + b _08039498 +_08039480: + movs r5, 0x2 + b _08039498 +_08039484: + movs r0, 0 + bl sub_8095240 + movs r5, 0x4 + b _08039498 +_0803948E: + movs r5, 0x9 + b _08039498 +_08039492: + bl sub_80122A8 + movs r5, 0x2E +_08039498: + adds r0, r5, 0 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_803941C + + thumb_func_start sub_80394A4 +sub_80394A4: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x150 + bl sub_8011FA8 + mov r8, r0 + movs r0, 0 + bl sub_8008C54 + movs r0, 0 + bl sub_80073B8 + ldr r2, _0803952C + movs r4, 0 + str r4, [sp] + movs r0, 0x8 + movs r1, 0 + movs r3, 0 + bl xxx_call_draw_string + ldr r2, _08039530 + str r4, [sp] + movs r0, 0x8 + movs r1, 0xC + movs r3, 0 + bl xxx_call_draw_string + ldr r2, _08039534 + str r4, [sp] + movs r0, 0x8 + movs r1, 0x18 + movs r3, 0 + bl xxx_call_draw_string + ldr r2, _08039538 + str r4, [sp] + movs r0, 0x8 + movs r1, 0x24 + movs r3, 0 + bl xxx_call_draw_string + ldr r2, _0803953C + str r4, [sp] + movs r0, 0x8 + movs r1, 0x30 + movs r3, 0 + bl xxx_call_draw_string + ldr r2, _08039540 + str r4, [sp] + movs r0, 0x8 + movs r1, 0x3C + movs r3, 0 + bl xxx_call_draw_string + movs r0, 0 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _08039544 + add r4, sp, 0x68 + adds r0, r4, 0 + bl sub_80920D8 + adds r2, r4, 0 + b _0803954E + .align 2, 0 +_0803952C: .4byte gUnknown_80E77BC +_08039530: .4byte gUnknown_80E77C4 +_08039534: .4byte gUnknown_80E77CC +_08039538: .4byte gUnknown_80E77D8 +_0803953C: .4byte gUnknown_80E77E4 +_08039540: .4byte gUnknown_80E77F0 +_08039544: + ldr r1, _08039588 + add r0, sp, 0x68 + bl strcpy + add r2, sp, 0x68 +_0803954E: + ldr r5, _0803958C + ldr r0, [r5] + movs r4, 0xD2 + lsls r4, 1 + adds r0, r4 + ldr r1, _08039590 + bl sub_800D158 + ldr r2, [r5] + adds r2, r4 + movs r0, 0 + str r0, [sp] + movs r0, 0x40 + movs r1, 0 + movs r3, 0 + bl xxx_call_draw_string + bl sub_808D33C + cmp r0, 0 + bne _08039598 + add r4, sp, 0x90 + ldr r1, _08039594 + adds r0, r4, 0 + movs r2, 0xA + bl sub_80922B4 + b _080395A6 + .align 2, 0 +_08039588: .4byte gUnknown_80E77F8 +_0803958C: .4byte gUnknown_203B374 +_08039590: .4byte gUnknown_80E7804 +_08039594: .4byte gUnknown_80E7808 +_08039598: + add r4, sp, 0x90 + adds r1, r0, 0 + adds r1, 0x4C + adds r0, r4, 0 + movs r2, 0xA + bl sub_80922B4 +_080395A6: + adds r2, r4, 0 + ldr r5, _080395F0 + ldr r0, [r5] + movs r4, 0xE4 + lsls r4, 1 + adds r0, r4 + ldr r6, _080395F4 + adds r1, r6, 0 + bl sub_800D158 + ldr r2, [r5] + adds r2, r4 + movs r0, 0 + str r0, [sp] + movs r0, 0x40 + movs r1, 0xC + movs r3, 0 + bl xxx_call_draw_string + movs r0, 0x1 + bl sub_8095324 + cmp r0, 0 + bne _080395E0 + movs r0, 0x7 + bl sub_8095324 + cmp r0, 0 + beq _08039606 +_080395E0: + ldr r0, _080395F8 + cmp r8, r0 + bne _080395FC + ldr r4, [r5] + movs r0, 0xF6 + lsls r0, 1 + adds r4, r0 + b _08039676 + .align 2, 0 +_080395F0: .4byte gUnknown_203B374 +_080395F4: .4byte gUnknown_80E7804 +_080395F8: .4byte 0x000f1207 +_080395FC: + ldr r0, [r5] + movs r1, 0xF6 + lsls r1, 1 + adds r0, r1 + b _08039690 +_08039606: + bl sub_8011C1C + cmp r0, 0x1 + beq _08039624 + cmp r0, 0x2 + beq _08039668 + ldr r0, [r5] + movs r2, 0xF6 + lsls r2, 1 + adds r0, r2 + ldr r1, _08039620 + b _08039692 + .align 2, 0 +_08039620: .4byte gUnknown_80E7824 +_08039624: + movs r0, 0 + movs r1, 0x18 + bl sub_8001658 + cmp r0, 0x7 + beq _08039658 + cmp r0, 0xB + beq _08039658 + bl sub_8098FB4 + adds r2, r0, 0 + add r0, sp, 0x4 + adds r1, r6, 0 + bl sub_800D158 + ldr r0, [r5] + movs r3, 0xF6 + lsls r3, 1 + adds r1, r0, r3 + adds r3, 0x24 + adds r2, r0, r3 + add r0, sp, 0x4 + movs r3, 0 + bl sub_8014BC4 + b _08039696 +_08039658: + ldr r0, _08039664 + ldr r0, [r0] + movs r1, 0xF6 + lsls r1, 1 + adds r0, r1 + b _08039690 + .align 2, 0 +_08039664: .4byte gUnknown_203B374 +_08039668: + ldr r0, _08039684 + cmp r8, r0 + bne _08039688 + ldr r4, [r5] + movs r2, 0xF6 + lsls r2, 1 + adds r4, r2 +_08039676: + bl sub_809769C + adds r1, r0, 0 + adds r0, r4, 0 + bl sub_8090228 + b _08039696 + .align 2, 0 +_08039684: .4byte 0x000f1207 +_08039688: + ldr r0, [r5] + movs r3, 0xF6 + lsls r3, 1 + adds r0, r3 +_08039690: + ldr r1, _0803974C +_08039692: + bl sub_800D158 +_08039696: + ldr r7, _08039750 + ldr r2, [r7] + movs r0, 0xF6 + lsls r0, 1 + adds r2, r0 + movs r6, 0 + str r6, [sp] + movs r0, 0x40 + movs r1, 0x18 + movs r3, 0 + bl xxx_call_draw_string + ldr r0, _08039754 + ldr r0, [r0] + add r1, sp, 0x144 + add r2, sp, 0x148 + add r3, sp, 0x14C + bl sub_8095014 + ldr r0, [r7] + movs r5, 0x84 + lsls r5, 2 + adds r0, r5 + ldr r1, _08039758 + add r2, sp, 0x144 + ldr r2, [r2] + add r3, sp, 0x148 + ldr r3, [r3] + add r4, sp, 0x14C + ldr r4, [r4] + str r4, [sp] + bl sub_800D158 + ldr r2, [r7] + adds r2, r5 + str r6, [sp] + movs r0, 0x40 + movs r1, 0x24 + movs r3, 0 + bl xxx_call_draw_string + bl sub_8097778 + adds r2, r0, 0 + ldr r0, [r7] + movs r4, 0x8D + lsls r4, 2 + adds r0, r4 + ldr r1, _0803975C + bl sub_800D158 + ldr r2, [r7] + adds r2, r4 + str r6, [sp] + movs r0, 0x40 + movs r1, 0x30 + movs r3, 0 + bl xxx_call_draw_string + ldr r0, _08039760 + cmp r8, r0 + bne _0803976C + ldr r0, _08039764 + ldr r6, [r0] + movs r1, 0xC + ldrsh r0, [r6, r1] + cmp r0, 0 + beq _0803976C + add r5, sp, 0x130 + adds r1, r0, 0 + adds r0, r5, 0 + bl sub_808D930 + add r4, sp, 0xE0 + adds r1, r6, 0 + adds r1, 0x50 + adds r0, r4, 0 + movs r2, 0xA + bl sub_80922B4 + ldr r0, [r7] + movs r3, 0x96 + lsls r3, 2 + adds r0, r3 + ldr r1, _08039768 + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_800D158 + b _0803977C + .align 2, 0 +_0803974C: .4byte gUnknown_80E780C +_08039750: .4byte gUnknown_203B374 +_08039754: .4byte gUnknown_203B47C +_08039758: .4byte gUnknown_80E7838 +_0803975C: .4byte gUnknown_80E7848 +_08039760: .4byte 0x000f1207 +_08039764: .4byte gUnknown_203B484 +_08039768: .4byte gUnknown_80E784C +_0803976C: + ldr r0, _080397AC + ldr r0, [r0] + movs r1, 0x96 + lsls r1, 2 + adds r0, r1 + ldr r1, _080397B0 + bl sub_800D158 +_0803977C: + ldr r0, _080397AC + ldr r2, [r0] + movs r3, 0x96 + lsls r3, 2 + adds r2, r3 + movs r0, 0 + str r0, [sp] + movs r0, 0x40 + movs r1, 0x3C + movs r3, 0 + bl xxx_call_draw_string + bl sub_80397B4 + movs r0, 0 + bl sub_80073E0 + add sp, 0x150 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080397AC: .4byte gUnknown_203B374 +_080397B0: .4byte gUnknown_80E7854 + thumb_func_end sub_80394A4 + + thumb_func_start sub_80397B4 +sub_80397B4: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + ldr r0, _08039834 + ldr r1, _08039838 + bl sub_800A9EC + adds r6, r0, 0 + movs r4, 0 +_080397C8: + adds r0, r4, 0 + adds r0, 0xB0 + ldr r1, [r6, 0x4] + lsls r2, r4, 2 + ldr r1, [r1, 0x4] + adds r1, r2 + bl SetBGPaletteBufferColorArray + adds r4, 0x1 + cmp r4, 0x3F + ble _080397C8 + movs r7, 0x8 + movs r0, 0x49 + mov r8, r0 + movs r4, 0 +_080397E6: + ldr r0, _0803983C + lsls r5, r4, 2 + adds r0, r5, r0 + ldr r0, [r0] + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _0803981C + movs r0, 0x10 + str r0, [sp] + ldr r0, [r6, 0x4] + lsls r1, r4, 7 + ldr r0, [r0] + adds r0, r1 + str r0, [sp, 0x4] + ldr r0, _08039840 + adds r0, r5, r0 + ldr r0, [r0] + str r0, [sp, 0x8] + movs r0, 0 + adds r1, r7, 0 + mov r2, r8 + movs r3, 0x10 + bl sub_8007E20 + adds r7, 0x10 +_0803981C: + adds r4, 0x1 + cmp r4, 0xB + ble _080397E6 + adds r0, r6, 0 + bl sub_800AA14 + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08039834: .4byte gUnknown_80E785C +_08039838: .4byte gUnknown_8380000 +_0803983C: .4byte gUnknown_203B3B8 +_08039840: .4byte gUnknown_203B388 + thumb_func_end sub_80397B4 + + thumb_func_start sub_8039844 +sub_8039844: + push {r4,r5,lr} + bl sub_8011FA8 + adds r5, r0, 0 + movs r4, 0 + movs r0, 0x1 + bl sub_8095324 + cmp r0, 0 + bne _0803986A + movs r0, 0x7 + bl sub_8095324 + cmp r0, 0 + bne _0803986A + bl sub_8011C1C + cmp r0, 0x2 + bne _08039872 +_0803986A: + ldr r0, _0803987C + cmp r5, r0 + bne _08039872 + movs r4, 0x1 +_08039872: + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0803987C: .4byte 0x000f1207 + thumb_func_end sub_8039844 + + thumb_func_start sub_8039880 +sub_8039880: + push {r4,lr} + movs r4, 0 + movs r0, 0x1 + bl sub_8095324 + cmp r0, 0 + bne _080398A0 + movs r0, 0x7 + bl sub_8095324 + cmp r0, 0 + bne _080398A0 + bl sub_8011C1C + cmp r0, 0x2 + bne _080398A2 +_080398A0: + movs r4, 0x1 +_080398A2: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8039880 + + thumb_func_start sub_80398AC +sub_80398AC: + push {r4,r5,lr} + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r5, _0803991C + ldr r4, _08039920 + adds r0, r4, 0 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] + movs r1, 0 + adds r2, r4, 0 + bl MemoryFill8 + movs r1, 0 + movs r2, 0 + adds r4, r5, 0 +_080398D8: + ldr r0, [r5] + adds r0, 0x1 + adds r0, r1 + strb r2, [r0] + adds r1, 0x1 + cmp r1, 0x35 + ble _080398D8 + ldr r1, [r4] + movs r3, 0x92 + lsls r3, 3 + adds r2, r1, r3 + movs r0, 0x3 + str r0, [r2] + ldr r0, _08039924 + adds r2, r1, r0 + movs r0, 0x2 + str r0, [r2] + movs r0, 0x93 + lsls r0, 3 + adds r1, r0 + movs r0, 0x1 + strb r0, [r1] + ldr r0, [r4] + adds r0, r3 + movs r1, 0x5 + str r1, [r0] + movs r0, 0x11 + bl sub_803A1C0 + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0803991C: .4byte gUnknown_203B3E8 +_08039920: .4byte 0x0000049c +_08039924: .4byte 0x00000494 + thumb_func_end sub_80398AC + + thumb_func_start sub_8039928 +sub_8039928: + push {lr} + ldr r0, _08039940 + ldr r0, [r0] + ldrb r0, [r0] + subs r0, 0x4 + cmp r0, 0xF + bhi _080399DE + lsls r0, 2 + ldr r1, _08039944 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08039940: .4byte gUnknown_203B3E8 +_08039944: .4byte _08039948 + .align 2, 0 +_08039948: + .4byte _08039988 + .4byte _0803998E + .4byte _0803999E + .4byte _080399AA + .4byte _08039992 + .4byte _080399A4 + .4byte _080399C8 + .4byte _080399DE + .4byte _08039998 + .4byte _080399B0 + .4byte _080399B6 + .4byte _080399BC + .4byte _080399C2 + .4byte _080399CE + .4byte _080399D4 + .4byte _080399DA +_08039988: + bl sub_8039A18 + b _080399DE +_0803998E: + movs r0, 0x3 + b _080399E0 +_08039992: + bl sub_8039AA8 + b _080399DE +_08039998: + bl sub_8039B14 + b _080399DE +_0803999E: + bl sub_8039B20 + b _080399DE +_080399A4: + bl sub_8039B58 + b _080399DE +_080399AA: + bl sub_8039D88 + b _080399DE +_080399B0: + bl sub_8039D28 + b _080399DE +_080399B6: + bl sub_8039D68 + b _080399DE +_080399BC: + bl sub_8039DA4 + b _080399DE +_080399C2: + bl sub_8039DCC + b _080399DE +_080399C8: + bl sub_8039B3C + b _080399DE +_080399CE: + bl sub_8039D0C + b _080399DE +_080399D4: + bl sub_8039C60 + b _080399DE +_080399DA: + bl sub_8039DE8 +_080399DE: + movs r0, 0 +_080399E0: + pop {r1} + bx r1 + thumb_func_end sub_8039928 + + thumb_func_start sub_80399E4 +sub_80399E4: + push {r4,lr} + ldr r4, _08039A14 + ldr r0, [r4] + cmp r0, 0 + beq _08039A0E + bl MemoryFree + movs r0, 0 + str r0, [r4] + bl sub_8030DE4 + bl sub_801B450 + bl sub_803084C + bl sub_801CBB8 + bl sub_80155F0 + bl sub_8031E10 +_08039A0E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08039A14: .4byte gUnknown_203B3E8 + thumb_func_end sub_80399E4 + + thumb_func_start sub_8039A18 +sub_8039A18: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08039AA2 + ldr r0, _08039A48 + ldr r1, [r0] + movs r2, 0x93 + lsls r2, 2 + adds r1, r2 + movs r2, 0xA + str r2, [r1] + ldr r1, [sp] + adds r2, r0, 0 + cmp r1, 0x8 + bhi _08039AA2 + lsls r0, r1, 2 + ldr r1, _08039A4C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08039A48: .4byte gUnknown_203B3E8 +_08039A4C: .4byte _08039A50 + .align 2, 0 +_08039A50: + .4byte _08039A9C + .4byte _08039AA2 + .4byte _08039AA2 + .4byte _08039A74 + .4byte _08039A74 + .4byte _08039A88 + .4byte _08039AA2 + .4byte _08039AA2 + .4byte _08039A9C +_08039A74: + ldr r0, [r2] + movs r1, 0x92 + lsls r1, 3 + adds r0, r1 + movs r1, 0x3 + str r1, [r0] + movs r0, 0x8 + bl sub_803A1C0 + b _08039AA2 +_08039A88: + ldr r0, [r2] + movs r2, 0x92 + lsls r2, 3 + adds r0, r2 + movs r1, 0x5 + str r1, [r0] + movs r0, 0x11 + bl sub_803A1C0 + b _08039AA2 +_08039A9C: + movs r0, 0x5 + bl sub_803A1C0 +_08039AA2: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8039A18 + + thumb_func_start sub_8039AA8 +sub_8039AA8: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08039B0E + ldr r0, [sp] + cmp r0, 0 + beq _08039AE8 + cmp r0, 0x6 + bne _08039B0E + ldr r0, _08039AD8 + ldr r0, [r0] + ldr r1, _08039ADC + adds r0, r1 + ldr r0, [r0] + cmp r0, 0x1 + bne _08039AE0 + movs r0, 0x2 + bl sub_803A1C0 + b _08039B0E + .align 2, 0 +_08039AD8: .4byte gUnknown_203B3E8 +_08039ADC: .4byte 0x00000494 +_08039AE0: + movs r0, 0xC + bl sub_803A1C0 + b _08039B0E +_08039AE8: + ldr r0, _08039B00 + ldr r0, [r0] + ldr r1, _08039B04 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0x1 + bne _08039B08 + movs r0, 0x1 + bl sub_803A1C0 + b _08039B0E + .align 2, 0 +_08039B00: .4byte gUnknown_203B3E8 +_08039B04: .4byte 0x00000494 +_08039B08: + movs r0, 0x4 + bl sub_803A1C0 +_08039B0E: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8039AA8 + + thumb_func_start sub_8039B14 +sub_8039B14: + push {lr} + movs r0, 0x6 + bl sub_803A1C0 + pop {r0} + bx r0 + thumb_func_end sub_8039B14 + + thumb_func_start sub_8039B20 +sub_8039B20: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08039B34 + movs r0, 0x9 + bl sub_803A1C0 +_08039B34: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8039B20 + + thumb_func_start sub_8039B3C +sub_8039B3C: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08039B50 + movs r0, 0x4 + bl sub_803A1C0 +_08039B50: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8039B3C + + thumb_func_start sub_8039B58 +sub_8039B58: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08039BA6 + ldr r0, _08039B88 + ldr r1, [r0] + movs r2, 0x94 + lsls r2, 2 + adds r0, r1, r2 + ldr r0, [r0] + cmp r0, 0 + bne _08039B9C + subs r2, 0x4 + adds r0, r1, r2 + ldr r0, [r0] + cmp r0, 0x9 + beq _08039B8C + cmp r0, 0xA + beq _08039B94 + b _08039BA6 + .align 2, 0 +_08039B88: .4byte gUnknown_203B3E8 +_08039B8C: + movs r0, 0x7 + bl sub_803A1C0 + b _08039BA6 +_08039B94: + movs r0, 0xD + bl sub_803A1C0 + b _08039BA6 +_08039B9C: + bl sub_8039BAC + movs r0, 0xA + bl sub_803A1C0 +_08039BA6: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8039B58 + + thumb_func_start sub_8039BAC +sub_8039BAC: + push {lr} + cmp r0, 0xF + bhi _08039C48 + lsls r0, 2 + ldr r1, _08039BBC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08039BBC: .4byte _08039BC0 + .align 2, 0 +_08039BC0: + .4byte _08039C54 + .4byte _08039C00 + .4byte _08039C10 + .4byte _08039C08 + .4byte _08039C18 + .4byte _08039C20 + .4byte _08039C48 + .4byte _08039C48 + .4byte _08039C48 + .4byte _08039C48 + .4byte _08039C48 + .4byte _08039C48 + .4byte _08039C48 + .4byte _08039C48 + .4byte _08039C28 + .4byte _08039C30 +_08039C00: + ldr r0, _08039C04 + b _08039C32 + .align 2, 0 +_08039C04: .4byte gUnknown_80E7914 +_08039C08: + ldr r0, _08039C0C + b _08039C32 + .align 2, 0 +_08039C0C: .4byte gUnknown_80E7938 +_08039C10: + ldr r0, _08039C14 + b _08039C32 + .align 2, 0 +_08039C14: .4byte gUnknown_80E7994 +_08039C18: + ldr r0, _08039C1C + b _08039C32 + .align 2, 0 +_08039C1C: .4byte gUnknown_80E79E4 +_08039C20: + ldr r0, _08039C24 + b _08039C32 + .align 2, 0 +_08039C24: .4byte gUnknown_80E7914 +_08039C28: + ldr r0, _08039C2C + b _08039C32 + .align 2, 0 +_08039C2C: .4byte gUnknown_80E7914 +_08039C30: + ldr r0, _08039C40 +_08039C32: + ldr r3, _08039C44 + movs r1, 0 + movs r2, 0 + bl sub_80141B4 + b _08039C54 + .align 2, 0 +_08039C40: .4byte gUnknown_80E7A48 +_08039C44: .4byte 0x00000101 +_08039C48: + ldr r0, _08039C58 + ldr r3, _08039C5C + movs r1, 0 + movs r2, 0 + bl sub_80141B4 +_08039C54: + pop {r0} + bx r0 + .align 2, 0 +_08039C58: .4byte gUnknown_80E7914 +_08039C5C: .4byte 0x00000101 + thumb_func_end sub_8039BAC + + thumb_func_start sub_8039C60 +sub_8039C60: + push {r4,r5,lr} + bl sub_80154F0 + adds r4, r0, 0 + ldr r5, _08039CBC + ldr r0, [r5] + adds r0, 0x38 + movs r1, 0 + movs r2, 0x30 + bl MemoryFill8 + cmp r4, 0x2 + beq _08039CE6 + cmp r4, 0x3 + bne _08039D04 + bl sub_80155F0 + bl sub_8004914 + ldr r0, [r5] + movs r1, 0xF6 + lsls r1, 1 + adds r0, r1 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r1, [r5] + adds r0, r1, 0x1 + adds r1, 0x38 + bl sub_803D358 + lsls r0, 24 + cmp r0, 0 + beq _08039CB4 + ldr r0, [r5] + adds r0, 0x38 + bl sub_80959C0 + lsls r0, 24 + cmp r0, 0 + bne _08039CC0 +_08039CB4: + movs r0, 0x13 + bl sub_803A1C0 + b _08039D04 + .align 2, 0 +_08039CBC: .4byte gUnknown_203B3E8 +_08039CC0: + ldr r0, [r5] + movs r2, 0xF0 + lsls r2, 2 + adds r1, r0, r2 + adds r0, 0x38 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r3,r4} + stm r1!, {r3,r4} + ldr r0, [r5] + movs r1, 0x93 + lsls r1, 3 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + movs r0, 0xD + bl sub_803A1C0 + b _08039D04 +_08039CE6: + bl sub_80155F0 + bl sub_8004914 + ldr r0, [r5] + movs r2, 0xF6 + lsls r2, 1 + adds r0, r2 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0x5 + bl sub_803A1C0 +_08039D04: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8039C60 + + thumb_func_start sub_8039D0C +sub_8039D0C: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08039D20 + movs r0, 0x12 + bl sub_803A1C0 +_08039D20: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8039D0C + + thumb_func_start sub_8039D28 +sub_8039D28: + push {r4,r5,lr} + bl sub_802D0E0 + cmp r0, 0x3 + bne _08039D62 + bl sub_802D178 + ldr r5, _08039D58 + ldr r1, [r5] + movs r4, 0x93 + lsls r4, 3 + adds r1, r4 + strb r0, [r1] + bl sub_802D184 + ldr r0, [r5] + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _08039D5C + movs r0, 0xE + bl sub_803A1C0 + b _08039D62 + .align 2, 0 +_08039D58: .4byte gUnknown_203B3E8 +_08039D5C: + movs r0, 0x10 + bl sub_803A1C0 +_08039D62: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8039D28 + + thumb_func_start sub_8039D68 +sub_8039D68: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08039D82 + movs r0, 0xF + bl sub_803A1C0 + movs r0, 0 + bl sub_8012574 +_08039D82: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8039D68 + + thumb_func_start sub_8039D88 +sub_8039D88: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08039D9C + movs r0, 0x8 + bl sub_803A1C0 +_08039D9C: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8039D88 + + thumb_func_start sub_8039DA4 +sub_8039DA4: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08039DC6 + bl sub_8012600 + lsls r0, 24 + cmp r0, 0 + bne _08039DC6 + bl sub_8012750 + movs r0, 0x10 + bl sub_803A1C0 +_08039DC6: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8039DA4 + + thumb_func_start sub_8039DCC +sub_8039DCC: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08039DE0 + movs r0, 0x5 + bl sub_803A1C0 +_08039DE0: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8039DCC + + thumb_func_start sub_8039DE8 +sub_8039DE8: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _08039E0E + ldr r0, [sp] + cmp r0, 0 + beq _08039E08 + cmp r0, 0x6 + bne _08039E0E + movs r0, 0x11 + bl sub_803A1C0 + b _08039E0E +_08039E08: + movs r0, 0x5 + bl sub_803A1C0 +_08039E0E: + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8039DE8 + + thumb_func_start nullsub_54 +nullsub_54: + bx lr + thumb_func_end nullsub_54 + + thumb_func_start sub_8039E18 +sub_8039E18: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + ldr r1, _08039E38 + ldr r0, [r1] + ldrb r0, [r0] + adds r6, r1, 0 + cmp r0, 0x13 + bls _08039E2E + b _0803A1AA +_08039E2E: + lsls r0, 2 + ldr r1, _08039E3C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08039E38: .4byte gUnknown_203B3E8 +_08039E3C: .4byte _08039E40 + .align 2, 0 +_08039E40: + .4byte _08039E90 + .4byte _08039EB8 + .4byte _0803A1AA + .4byte _08039EC8 + .4byte _08039EDC + .4byte _0803A1AA + .4byte _08039FF4 + .4byte _08039FA4 + .4byte _08039FCC + .4byte _0803A00C + .4byte _0803A1AA + .4byte _0803A1AA + .4byte _0803A1AA + .4byte _08039F04 + .4byte _08039F68 + .4byte _0803A1AA + .4byte _08039FAC + .4byte _0803A152 + .4byte _0803A168 + .4byte _0803A18E +_08039E90: + ldr r0, _08039EB0 + ldr r3, _08039EB4 + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + str r2, [sp, 0xC] + adds r1, 0xFD + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0x1 + bl sub_8014248 + b _0803A1AA + .align 2, 0 +_08039EB0: .4byte gUnknown_80E7AC4 +_08039EB4: .4byte gUnknown_80E786C +_08039EB8: + ldr r0, _08039EC0 + ldr r3, _08039EC4 + b _08039EE0 + .align 2, 0 +_08039EC0: .4byte gUnknown_80E7AE0 +_08039EC4: .4byte gUnknown_80E7894 +_08039EC8: + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + bl sub_802EF48 + b _0803A1AA +_08039EDC: + ldr r0, _08039EFC + ldr r3, _08039F00 +_08039EE0: + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + str r2, [sp, 0xC] + adds r1, 0xFD + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0x3 + bl sub_8014248 + b _0803A1AA + .align 2, 0 +_08039EFC: .4byte gUnknown_80E7B14 +_08039F00: .4byte gUnknown_80E78D8 +_08039F04: + ldr r0, [r6] + ldr r2, _08039F3C + adds r1, r0, r2 + movs r3, 0xF0 + lsls r3, 2 + adds r0, r3 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2,r4} + stm r1!, {r2,r4} + ldr r2, [r6] + ldr r3, _08039F40 + adds r0, r2, r3 + ldrb r0, [r0] + cmp r0, 0x4 + bne _08039F44 + movs r4, 0x91 + lsls r4, 3 + adds r1, r2, r4 + subs r3, 0xA2 + adds r0, r2, r3 + str r0, [r1] + adds r4, 0x4 + adds r1, r2, r4 + adds r3, 0x28 + adds r0, r2, r3 + str r0, [r1] + b _08039F54 + .align 2, 0 +_08039F3C: .4byte 0x00000474 +_08039F40: .4byte 0x00000476 +_08039F44: + movs r4, 0x91 + lsls r4, 3 + adds r0, r2, r4 + movs r1, 0 + str r1, [r0] + ldr r3, _08039F60 + adds r0, r2, r3 + str r1, [r0] +_08039F54: + ldr r0, [r6] + ldr r4, _08039F64 + adds r0, r4 + bl sub_802D098 + b _0803A1AA + .align 2, 0 +_08039F60: .4byte 0x0000048c +_08039F64: .4byte 0x00000474 +_08039F68: + ldr r1, [r6] + movs r2, 0x93 + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _08039F9C + movs r3, 0x92 + lsls r3, 3 + adds r0, r1, r3 + ldr r0, [r0] + cmp r0, 0x4 + bne _08039F84 + b _0803A1AA +_08039F84: + cmp r0, 0x4 + bgt _08039F8E + cmp r0, 0x3 + beq _08039F94 + b _0803A1AA +_08039F8E: + cmp r0, 0x5 + beq _08039F94 + b _0803A1AA +_08039F94: + ldr r0, _08039F98 + b _0803A154 + .align 2, 0 +_08039F98: .4byte gUnknown_80E7B48 +_08039F9C: + ldr r0, _08039FA0 + b _0803A154 + .align 2, 0 +_08039FA0: .4byte gUnknown_80E7B48 +_08039FA4: + ldr r0, _08039FA8 + b _0803A154 + .align 2, 0 +_08039FA8: .4byte gUnknown_80E7B68 +_08039FAC: + ldr r0, [r6] + movs r4, 0x93 + lsls r4, 3 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _08039FC4 + ldr r0, _08039FC0 + b _0803A154 + .align 2, 0 +_08039FC0: .4byte gUnknown_80E7B88 +_08039FC4: + ldr r0, _08039FC8 + b _0803A154 + .align 2, 0 +_08039FC8: .4byte gUnknown_80E7BC8 +_08039FCC: + ldr r0, _08039FEC + ldr r3, _08039FF0 + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + str r2, [sp, 0xC] + adds r1, 0xFD + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0x6 + bl sub_8014248 + b _0803A1AA + .align 2, 0 +_08039FEC: .4byte gUnknown_80E7BEC +_08039FF0: .4byte gUnknown_80E78F8 +_08039FF4: + movs r0, 0 + bl nullsub_23 + ldr r0, _0803A008 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_80141B4 + b _0803A1AA + .align 2, 0 +_0803A008: .4byte gUnknown_80E7C48 +_0803A00C: + ldr r0, [r6] + movs r1, 0x94 + lsls r1, 2 + mov r8, r1 + add r0, r8 + movs r1, 0 + str r1, [r0] + bl sub_8011830 + ldr r0, [r6] + movs r7, 0x93 + lsls r7, 2 + adds r0, r7 + ldr r0, [r0] + bl sub_8037B28 + ldr r2, [r6] + mov r3, r8 + adds r1, r2, r3 + str r0, [r1] + cmp r0, 0 + beq _0803A03A + b _0803A14C +_0803A03A: + adds r4, r7, 0 + adds r0, r2, r4 + ldr r0, [r0] + cmp r0, 0x9 + beq _0803A04A + cmp r0, 0xA + beq _0803A0AA + b _0803A0DE +_0803A04A: + movs r5, 0x95 + lsls r5, 2 + adds r0, r2, r5 + movs r1, 0 + movs r2, 0xB4 + bl MemoryFill8 + ldr r0, [r6] + movs r1, 0xEF + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + bl sub_803B344 + adds r4, r0, 0 + ldr r1, [r4, 0x14] + cmp r1, 0 + beq _0803A08C + ldr r0, [r6] + movs r2, 0x9A + lsls r2, 2 + adds r0, r2 + movs r2, 0x28 + bl MemoryCopy8 + ldr r0, [r6] + movs r3, 0xA4 + lsls r3, 2 + adds r0, r3 + ldr r1, [r4, 0x18] + movs r2, 0x78 + bl MemoryCopy8 +_0803A08C: + ldr r1, [r6] + adds r1, r5 + adds r0, r4, 0 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2,r4} + stm r1!, {r2,r4} + ldr r2, [r6] + adds r0, r2, r7 + ldr r0, [r0] + adds r1, r2, r5 + movs r3, 0xC2 + lsls r3, 2 + adds r2, r3 + b _0803A0D4 +_0803A0AA: + movs r4, 0x95 + lsls r4, 2 + adds r0, r2, r4 + movs r1, 0 + movs r2, 0xB4 + bl MemoryFill8 + ldr r0, [r6] + movs r5, 0xC2 + lsls r5, 2 + adds r0, r5 + movs r1, 0 + movs r2, 0xB4 + bl MemoryFill8 + ldr r2, [r6] + adds r0, r2, r7 + ldr r0, [r0] + adds r4, r2, r4 + adds r2, r5 + adds r1, r4, 0 +_0803A0D4: + bl sub_8037D64 + ldr r1, [r6] + add r1, r8 + str r0, [r1] +_0803A0DE: + ldr r4, _0803A134 + ldr r2, [r4] + movs r5, 0x94 + lsls r5, 2 + adds r0, r2, r5 + ldr r0, [r0] + cmp r0, 0 + bne _0803A14C + movs r1, 0x93 + lsls r1, 2 + adds r0, r2, r1 + ldr r0, [r0] + cmp r0, 0xA + bhi _0803A14C + cmp r0, 0x9 + bcc _0803A14C + movs r3, 0x95 + lsls r3, 2 + adds r1, r2, r3 + adds r3, 0xB4 + adds r2, r3 + bl sub_80381F4 + ldr r1, [r4] + adds r1, r5 + str r0, [r1] + bl sub_800D588 + lsls r0, 24 + cmp r0, 0 + beq _0803A138 + ldr r1, [r4] + movs r4, 0xF0 + lsls r4, 2 + adds r0, r1, r4 + movs r2, 0xC2 + lsls r2, 2 + adds r1, r2 + movs r2, 0xB4 + bl memcpy + b _0803A14C + .align 2, 0 +_0803A134: .4byte gUnknown_203B3E8 +_0803A138: + ldr r1, [r4] + movs r3, 0xF0 + lsls r3, 2 + adds r0, r1, r3 + movs r4, 0x95 + lsls r4, 2 + adds r1, r4 + movs r2, 0xB4 + bl memcpy +_0803A14C: + bl sub_8011854 + b _0803A1AA +_0803A152: + ldr r0, _0803A160 +_0803A154: + ldr r3, _0803A164 + movs r1, 0 + movs r2, 0 + bl sub_80141B4 + b _0803A1AA + .align 2, 0 +_0803A160: .4byte gUnknown_80E7C98 +_0803A164: .4byte 0x00000101 +_0803A168: + ldr r0, [r6] + movs r1, 0xF6 + lsls r1, 1 + adds r0, r1 + bl sub_8006518 + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r1, [r6] + adds r1, 0x1 + movs r0, 0x5 + bl sub_80151C0 + b _0803A1AA +_0803A18E: + ldr r0, _0803A1B8 + ldr r3, _0803A1BC + movs r2, 0 + str r2, [sp] + movs r1, 0x4 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + str r2, [sp, 0xC] + adds r1, 0xFD + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0x6 + bl sub_8014248 +_0803A1AA: + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0803A1B8: .4byte gUnknown_80E7CC4 +_0803A1BC: .4byte gUnknown_80E78F8 + thumb_func_end sub_8039E18 + + thumb_func_start sub_803A1C0 +sub_803A1C0: + push {lr} + ldr r1, _0803A1D4 + ldr r1, [r1] + strb r0, [r1] + bl nullsub_54 + bl sub_8039E18 + pop {r0} + bx r0 + .align 2, 0 +_0803A1D4: .4byte gUnknown_203B3E8 + thumb_func_end sub_803A1C0 + + thumb_func_start sub_803A1D8 +sub_803A1D8: + movs r0, 0x1 + bx lr + thumb_func_end sub_803A1D8 + + thumb_func_start sub_803A1DC +sub_803A1DC: + movs r0, 0 + bx lr + thumb_func_end sub_803A1DC + + thumb_func_start nullsub_55 +nullsub_55: + bx lr + thumb_func_end nullsub_55 + + thumb_func_start sub_803A1E4 +sub_803A1E4: + movs r0, 0x1 + bx lr + thumb_func_end sub_803A1E4 + + thumb_func_start sub_803A1E8 +sub_803A1E8: + movs r0, 0x2 + bx lr + thumb_func_end sub_803A1E8 + + thumb_func_start sub_803A1EC +sub_803A1EC: + push {lr} + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r0} + bx r0 + thumb_func_end sub_803A1EC + + thumb_func_start sub_803A200 +sub_803A200: + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r5, _0803A270 + ldr r0, [r5] + cmp r0, 0 + bne _0803A224 + movs r4, 0xD2 + lsls r4, 1 + adds r0, r4, 0 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r5] + movs r1, 0 + adds r2, r4, 0 + bl MemoryFill8 +_0803A224: + mov r12, r5 + movs r0, 0xA0 + lsls r0, 1 + mov r8, r0 + ldr r4, _0803A274 + movs r3, 0 + movs r2, 0x3 +_0803A232: + mov r5, r12 + ldr r1, [r5] + adds r1, r3 + add r1, r8 + adds r0, r4, 0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r3, 0x18 + subs r2, 0x1 + cmp r2, 0 + bge _0803A232 + bl sub_8004914 + ldr r0, _0803A270 + ldr r0, [r0] + movs r6, 0xA0 + lsls r6, 1 + adds r0, r6 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + bl sub_803A35C + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0803A270: .4byte gUnknown_203B3EC +_0803A274: .4byte gUnknown_80E7D40 + thumb_func_end sub_803A200 + + thumb_func_start sub_803A278 +sub_803A278: + push {r4,lr} + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r4, _0803A2A0 + ldr r0, [r4] + cmp r0, 0 + beq _0803A298 + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0803A298: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0803A2A0: .4byte gUnknown_203B3EC + thumb_func_end sub_803A278 + + thumb_func_start sub_803A2A4 +sub_803A2A4: + push {r4,r5,lr} + sub sp, 0x4 + ldr r4, _0803A2D4 + movs r0, 0xB + str r0, [sp] + ldr r5, _0803A2D8 + ldr r0, [r5] + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _0803A2C4 + ldr r0, [r5] + mov r1, sp + bl sub_8013114 +_0803A2C4: + ldr r0, [sp] + cmp r0, 0xB + bhi _0803A34E + lsls r0, 2 + ldr r1, _0803A2DC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0803A2D4: .4byte 0x0000ffdc +_0803A2D8: .4byte gUnknown_203B3EC +_0803A2DC: .4byte _0803A2E0 + .align 2, 0 +_0803A2E0: + .4byte _0803A310 + .4byte _0803A314 + .4byte _0803A318 + .4byte _0803A31C + .4byte _0803A320 + .4byte _0803A324 + .4byte _0803A328 + .4byte _0803A34E + .4byte _0803A34E + .4byte _0803A330 + .4byte _0803A344 + .4byte _0803A34C +_0803A310: + movs r4, 0x2F + b _0803A34E +_0803A314: + movs r4, 0x30 + b _0803A34E +_0803A318: + movs r4, 0x31 + b _0803A34E +_0803A31C: + movs r4, 0x32 + b _0803A34E +_0803A320: + movs r4, 0x33 + b _0803A34E +_0803A324: + movs r4, 0x34 + b _0803A34E +_0803A328: + bl sub_803A3BC + movs r4, 0x1 + b _0803A34E +_0803A330: + movs r4, 0 +_0803A332: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_80976F8 + adds r4, 0x1 + cmp r4, 0x1F + ble _0803A332 + movs r4, 0x1 + b _0803A34E +_0803A344: + bl sub_803A3A0 + movs r4, 0x1 + b _0803A34E +_0803A34C: + ldr r4, _0803A358 +_0803A34E: + adds r0, r4, 0 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0803A358: .4byte 0x0000ffdc + thumb_func_end sub_803A2A4 + + thumb_func_start sub_803A35C +sub_803A35C: + push {r4,lr} + sub sp, 0x10 + ldr r4, _0803A394 + ldr r0, [r4] + movs r2, 0xA0 + lsls r2, 1 + adds r1, r0, r2 + ldr r3, _0803A398 + ldr r2, _0803A39C + str r2, [sp] + movs r2, 0x1 + str r2, [sp, 0x4] + movs r2, 0xD + str r2, [sp, 0x8] + movs r2, 0 + str r2, [sp, 0xC] + bl sub_8035C3C + ldr r0, [r4] + movs r1, 0 + movs r2, 0x1 + bl sub_8035CF4 + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0803A394: .4byte gUnknown_203B3EC +_0803A398: .4byte gUnknown_80E7D58 +_0803A39C: .4byte gUnknown_80E7D70 + thumb_func_end sub_803A35C + + thumb_func_start sub_803A3A0 +sub_803A3A0: + push {lr} + ldr r0, _0803A3B8 + ldr r0, [r0] + movs r1, 0xA0 + lsls r1, 1 + adds r0, r1 + movs r1, 0 + bl sub_8035CC0 + pop {r0} + bx r0 + .align 2, 0 +_0803A3B8: .4byte gUnknown_203B3EC + thumb_func_end sub_803A3A0 + + thumb_func_start sub_803A3BC +sub_803A3BC: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x84 + movs r5, 0x1 + add r4, sp, 0x60 + add r6, sp, 0x68 + add r0, sp, 0x7C + mov r8, r0 + add r0, sp, 0x80 + mov r10, r0 +_0803A3D6: + lsls r0, r5, 24 + lsrs r0, 24 + bl sub_80925EC + adds r5, 0x1 + cmp r5, 0x39 + ble _0803A3D6 + movs r5, 0 + adds r7, r4, 0 +_0803A3E8: + movs r0, 0 + mov r9, r0 + ldr r0, _0803A454 + str r0, [sp, 0x7C] + adds r5, 0x1 + lsls r4, r5, 16 + asrs r4, 16 + adds r0, r7, 0 + movs r1, 0 + movs r2, 0x8 + bl memset + movs r0, 0x27 + strh r0, [r7] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_808D8BC + adds r0, r6, 0 + adds r1, r6, 0 + bl sub_80922F4 + movs r0, 0x40 + strb r0, [r6] + mov r0, r8 + str r0, [sp] + str r7, [sp, 0x4] + add r0, sp, 0x8 + adds r1, r4, 0 + adds r2, r6, 0 + movs r3, 0x43 + bl sub_808CFD0 + add r0, sp, 0x8 + bl sub_808D1DC + ldr r0, _0803A458 + cmp r5, r0 + ble _0803A3E8 + mov r0, r9 + str r0, [sp, 0x80] + mov r0, r10 + movs r1, 0x1 + bl sub_801203C + add sp, 0x84 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0803A454: .4byte 0x00001006 +_0803A458: .4byte 0x0000012b + thumb_func_end sub_803A3BC + + thumb_func_start sub_803A45C +sub_803A45C: + push {r4,lr} + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r4, _0803A488 + movs r0, 0x9C + lsls r0, 1 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r4] + movs r0, 0 + bl sub_803A504 + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0803A488: .4byte gUnknown_203B3F0 + thumb_func_end sub_803A45C + + thumb_func_start sub_803A48C +sub_803A48C: + push {lr} + ldr r0, _0803A4A4 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0x5 + bhi _0803A4E0 + lsls r0, 2 + ldr r1, _0803A4A8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0803A4A4: .4byte gUnknown_203B3F0 +_0803A4A8: .4byte _0803A4AC + .align 2, 0 +_0803A4AC: + .4byte _0803A4C4 + .4byte _0803A4C4 + .4byte _0803A4CA + .4byte _0803A4D0 + .4byte _0803A4D6 + .4byte _0803A4DC +_0803A4C4: + bl sub_803A740 + b _0803A4E0 +_0803A4CA: + bl sub_803A7B0 + b _0803A4E0 +_0803A4D0: + bl sub_803A810 + b _0803A4E0 +_0803A4D6: + bl sub_803A86C + b _0803A4E0 +_0803A4DC: + movs r0, 0x3 + b _0803A4E2 +_0803A4E0: + movs r0, 0 +_0803A4E2: + pop {r1} + bx r1 + thumb_func_end sub_803A48C + + thumb_func_start sub_803A4E8 +sub_803A4E8: + push {r4,lr} + ldr r4, _0803A500 + ldr r0, [r4] + cmp r0, 0 + beq _0803A4FA + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0803A4FA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0803A500: .4byte gUnknown_203B3F0 + thumb_func_end sub_803A4E8 + + thumb_func_start sub_803A504 +sub_803A504: + push {lr} + ldr r1, _0803A518 + ldr r1, [r1] + str r0, [r1] + bl sub_803A51C + bl sub_803A5A0 + pop {r0} + bx r0 + .align 2, 0 +_0803A518: .4byte gUnknown_203B3F0 + thumb_func_end sub_803A504 + + thumb_func_start sub_803A51C +sub_803A51C: + push {r4-r7,lr} + ldr r4, _0803A53C + ldr r0, [r4] + adds r0, 0xD8 + bl sub_8006518 + ldr r1, [r4] + ldr r0, [r1] + cmp r0, 0x2 + beq _0803A544 + cmp r0, 0x3 + bne _0803A55C + adds r1, 0xF0 + ldr r0, _0803A540 + b _0803A54C + .align 2, 0 +_0803A53C: .4byte gUnknown_203B3F0 +_0803A540: .4byte gUnknown_80E7E64 +_0803A544: + movs r0, 0x84 + lsls r0, 1 + adds r1, r0 + ldr r0, _0803A558 +_0803A54C: + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + b _0803A57E + .align 2, 0 +_0803A558: .4byte gUnknown_80E7E4C +_0803A55C: + mov r12, r4 + ldr r4, _0803A598 + movs r3, 0 + movs r2, 0x3 +_0803A564: + mov r0, r12 + ldr r1, [r0] + adds r1, r3 + adds r1, 0xD8 + adds r0, r4, 0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r3, 0x18 + subs r2, 0x1 + cmp r2, 0 + bge _0803A564 +_0803A57E: + bl sub_8004914 + ldr r0, _0803A59C + ldr r0, [r0] + adds r0, 0xD8 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0803A598: .4byte gUnknown_80E7E34 +_0803A59C: .4byte gUnknown_203B3F0 + thumb_func_end sub_803A51C + + thumb_func_start sub_803A5A0 +sub_803A5A0: + push {lr} + sub sp, 0xC + ldr r1, _0803A5BC + ldr r0, [r1] + ldr r0, [r0] + adds r2, r1, 0 + cmp r0, 0x5 + bhi _0803A68A + lsls r0, 2 + ldr r1, _0803A5C0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0803A5BC: .4byte gUnknown_203B3F0 +_0803A5C0: .4byte _0803A5C4 + .align 2, 0 +_0803A5C4: + .4byte _0803A5DC + .4byte _0803A5EA + .4byte _0803A5F2 + .4byte _0803A61C + .4byte _0803A678 + .4byte _0803A68A +_0803A5DC: + movs r0, 0x2 + movs r1, 0x3 + movs r2, 0 + movs r3, 0xA + bl sub_801C8C4 + b _0803A68A +_0803A5EA: + movs r0, 0x1 + bl sub_801CB5C + b _0803A68A +_0803A5F2: + bl sub_801CCD8 + bl sub_803A6F0 + ldr r0, _0803A618 + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x4C + adds r1, r2, 0 + adds r1, 0xC + ldr r2, [r2, 0x8] + str r2, [sp] + movs r2, 0x2 + str r2, [sp, 0x4] + movs r2, 0 + movs r3, 0 + bl sub_8012D60 + b _0803A68A + .align 2, 0 +_0803A618: .4byte gUnknown_203B3F0 +_0803A61C: + ldr r3, [r2] + adds r1, r3, 0 + adds r1, 0xAC + movs r0, 0x3 + str r0, [r1] + subs r1, 0x8 + movs r0, 0 + str r0, [r1] + adds r1, 0x4 + ldr r0, _0803A670 + str r0, [r1] + adds r2, r3, 0 + adds r2, 0xA0 + ldr r0, _0803A674 + ldr r1, [r0] + ldrb r0, [r3, 0x4] + lsls r0, 1 + adds r1, 0x50 + adds r1, r0 + ldrh r0, [r1] + str r0, [r2] + adds r1, r3, 0 + adds r1, 0xB0 + movs r0, 0x1 + str r0, [r1] + adds r1, 0x4 + adds r0, r3, 0 + adds r0, 0xF0 + str r0, [r1] + adds r1, 0x4 + movs r0, 0x2C + str r0, [r1] + adds r1, 0x4 + movs r0, 0x12 + str r0, [r1] + adds r0, r3, 0 + adds r0, 0x9C + bl sub_8013AA0 + bl sub_803A690 + b _0803A68A + .align 2, 0 +_0803A670: .4byte 0x000003e7 +_0803A674: .4byte gUnknown_203B460 +_0803A678: + ldr r0, [r2] + ldrb r1, [r0, 0x4] + add r0, sp, 0x8 + movs r2, 0 + bl sub_8090A8C + add r0, sp, 0x8 + bl sub_801B3C0 +_0803A68A: + add sp, 0xC + pop {r0} + bx r0 + thumb_func_end sub_803A5A0 + + thumb_func_start sub_803A690 +sub_803A690: + push {r4,lr} + sub sp, 0x4 + ldr r4, _0803A6E8 + ldr r0, [r4] + adds r0, 0xB0 + ldr r0, [r0] + bl sub_8008C54 + ldr r0, [r4] + adds r0, 0xB0 + ldr r0, [r0] + bl sub_80073B8 + ldr r2, _0803A6EC + ldr r0, [r4] + adds r0, 0xB0 + ldr r3, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0x4 + movs r1, 0 + bl xxx_call_draw_string + ldr r0, [r4] + adds r0, 0x9C + bl sub_8013C68 + ldr r0, [r4] + adds r0, 0xB0 + ldr r0, [r0] + bl sub_80073E0 + bl sub_801CCD8 + ldr r0, [r4] + adds r0, 0x4C + movs r1, 0 + bl sub_8012EA4 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0803A6E8: .4byte gUnknown_203B3F0 +_0803A6EC: .4byte gUnknown_80E7E7C + thumb_func_end sub_803A690 + + thumb_func_start sub_803A6F0 +sub_803A6F0: + push {r4,lr} + ldr r4, _0803A734 + ldr r1, [r4] + ldr r0, _0803A738 + str r0, [r1, 0xC] + movs r0, 0x2 + str r0, [r1, 0x10] + str r0, [r1, 0x8] + ldrb r0, [r1, 0x4] + bl sub_8091524 + lsls r0, 24 + cmp r0, 0 + bne _0803A718 + ldr r0, [r4] + movs r1, 0x1 + negs r1, r1 + str r1, [r0, 0x10] + movs r1, 0x3 + str r1, [r0, 0x8] +_0803A718: + ldr r1, [r4] + movs r2, 0x1 + ldr r0, _0803A73C + ldr r0, [r0] + str r0, [r1, 0x14] + movs r0, 0x3 + str r0, [r1, 0x18] + movs r0, 0 + str r0, [r1, 0x1C] + str r2, [r1, 0x20] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0803A734: .4byte gUnknown_203B3F0 +_0803A738: .4byte gUnknown_80E7E7C +_0803A73C: .4byte gUnknown_80D4970 + thumb_func_end sub_803A6F0 + + thumb_func_start sub_803A740 +sub_803A740: + push {lr} + movs r0, 0x1 + bl sub_801CA08 + cmp r0, 0x4 + bhi _0803A7AA + lsls r0, 2 + ldr r1, _0803A758 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0803A758: .4byte _0803A75C + .align 2, 0 +_0803A75C: + .4byte _0803A7AA + .4byte _0803A7AA + .4byte _0803A7A0 + .4byte _0803A770 + .4byte _0803A788 +_0803A770: + bl sub_801CB24 + ldr r1, _0803A784 + ldr r1, [r1] + strb r0, [r1, 0x4] + movs r0, 0x2 + bl sub_803A504 + b _0803A7AA + .align 2, 0 +_0803A784: .4byte gUnknown_203B3F0 +_0803A788: + bl sub_801CB24 + ldr r1, _0803A79C + ldr r1, [r1] + strb r0, [r1, 0x4] + movs r0, 0x4 + bl sub_803A504 + b _0803A7AA + .align 2, 0 +_0803A79C: .4byte gUnknown_203B3F0 +_0803A7A0: + bl sub_801CBB8 + movs r0, 0x5 + bl sub_803A504 +_0803A7AA: + pop {r0} + bx r0 + thumb_func_end sub_803A740 + + thumb_func_start sub_803A7B0 +sub_803A7B0: + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + bl sub_801CA08 + ldr r4, _0803A7E8 + ldr r0, [r4] + adds r0, 0x4C + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _0803A7D6 + ldr r0, [r4] + adds r0, 0x4C + mov r1, sp + bl sub_8013114 +_0803A7D6: + ldr r0, [sp] + cmp r0, 0x2 + beq _0803A7F2 + cmp r0, 0x2 + bgt _0803A7EC + cmp r0, 0x1 + beq _0803A802 + b _0803A808 + .align 2, 0 +_0803A7E8: .4byte gUnknown_203B3F0 +_0803A7EC: + cmp r0, 0x3 + beq _0803A7FA + b _0803A808 +_0803A7F2: + movs r0, 0x3 + bl sub_803A504 + b _0803A808 +_0803A7FA: + movs r0, 0x4 + bl sub_803A504 + b _0803A808 +_0803A802: + movs r0, 0x1 + bl sub_803A504 +_0803A808: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_803A7B0 + + thumb_func_start sub_803A810 +sub_803A810: + push {r4,lr} + movs r0, 0 + bl sub_801CA08 + ldr r4, _0803A838 + ldr r0, [r4] + adds r0, 0x4C + bl sub_8012FD8 + ldr r0, [r4] + adds r0, 0x9C + bl sub_8013BBC + cmp r0, 0x2 + beq _0803A854 + cmp r0, 0x2 + bhi _0803A83C + cmp r0, 0x1 + beq _0803A860 + b _0803A864 + .align 2, 0 +_0803A838: .4byte gUnknown_203B3F0 +_0803A83C: + cmp r0, 0x3 + bne _0803A864 + ldr r0, _0803A85C + ldr r2, [r0] + ldr r1, [r4] + ldrb r0, [r1, 0x4] + lsls r0, 1 + adds r2, 0x50 + adds r2, r0 + adds r1, 0x9C + ldr r0, [r1] + strh r0, [r2] +_0803A854: + movs r0, 0x1 + bl sub_803A504 + b _0803A864 + .align 2, 0 +_0803A85C: .4byte gUnknown_203B460 +_0803A860: + bl sub_803A690 +_0803A864: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_803A810 + + thumb_func_start sub_803A86C +sub_803A86C: + push {lr} + bl sub_801B410 + cmp r0, 0x1 + bls _0803A884 + cmp r0, 0x3 + bhi _0803A884 + bl sub_801B450 + movs r0, 0x1 + bl sub_803A504 +_0803A884: + pop {r0} + bx r0 + thumb_func_end sub_803A86C + + thumb_func_start sub_803A888 +sub_803A888: + push {r4,lr} + bl sub_8004914 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r4, _0803A8B4 + movs r0, 0xFC + movs r1, 0x8 + bl MemoryAlloc + str r0, [r4] + movs r0, 0 + bl sub_803A924 + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0803A8B4: .4byte gUnknown_203B3F4 + thumb_func_end sub_803A888 + + thumb_func_start sub_803A8B8 +sub_803A8B8: + push {lr} + ldr r0, _0803A8D0 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0x4 + bhi _0803A902 + lsls r0, 2 + ldr r1, _0803A8D4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0803A8D0: .4byte gUnknown_203B3F4 +_0803A8D4: .4byte _0803A8D8 + .align 2, 0 +_0803A8D8: + .4byte _0803A8EC + .4byte _0803A8EC + .4byte _0803A8F2 + .4byte _0803A8F8 + .4byte _0803A8FE +_0803A8EC: + bl sub_803AAC4 + b _0803A902 +_0803A8F2: + bl sub_803AB34 + b _0803A902 +_0803A8F8: + bl sub_803ABAC + b _0803A902 +_0803A8FE: + movs r0, 0x3 + b _0803A904 +_0803A902: + movs r0, 0 +_0803A904: + pop {r1} + bx r1 + thumb_func_end sub_803A8B8 + + thumb_func_start sub_803A908 +sub_803A908: + push {r4,lr} + ldr r4, _0803A920 + ldr r0, [r4] + cmp r0, 0 + beq _0803A91A + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0803A91A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0803A920: .4byte gUnknown_203B3F4 + thumb_func_end sub_803A908 + + thumb_func_start sub_803A924 +sub_803A924: + push {lr} + ldr r1, _0803A938 + ldr r1, [r1] + str r0, [r1] + bl sub_803A93C + bl sub_803A9AC + pop {r0} + bx r0 + .align 2, 0 +_0803A938: .4byte gUnknown_203B3F4 + thumb_func_end sub_803A924 + + thumb_func_start sub_803A93C +sub_803A93C: + push {r4-r7,lr} + ldr r4, _0803A960 + ldr r0, [r4] + adds r0, 0x9C + bl sub_8006518 + ldr r1, [r4] + ldr r0, [r1] + cmp r0, 0x2 + bne _0803A968 + adds r1, 0xCC + ldr r0, _0803A964 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + b _0803A98A + .align 2, 0 +_0803A960: .4byte gUnknown_203B3F4 +_0803A964: .4byte gUnknown_80E7EA4 +_0803A968: + mov r12, r4 + ldr r4, _0803A9A4 + movs r3, 0 + movs r2, 0x3 +_0803A970: + mov r0, r12 + ldr r1, [r0] + adds r1, r3 + adds r1, 0x9C + adds r0, r4, 0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + adds r3, 0x18 + subs r2, 0x1 + cmp r2, 0 + bge _0803A970 +_0803A98A: + bl sub_8004914 + ldr r0, _0803A9A8 + ldr r0, [r0] + adds r0, 0x9C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0803A9A4: .4byte gUnknown_80E7E8C +_0803A9A8: .4byte gUnknown_203B3F4 + thumb_func_end sub_803A93C + + thumb_func_start sub_803A9AC +sub_803A9AC: + push {lr} + sub sp, 0x8 + ldr r1, _0803A9C8 + ldr r0, [r1] + ldr r0, [r0] + adds r2, r1, 0 + cmp r0, 0x4 + bhi _0803AA2C + lsls r0, 2 + ldr r1, _0803A9CC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0803A9C8: .4byte gUnknown_203B3F4 +_0803A9CC: .4byte _0803A9D0 + .align 2, 0 +_0803A9D0: + .4byte _0803A9E4 + .4byte _0803A9EE + .4byte _0803A9F6 + .4byte _0803AA20 + .4byte _0803AA2C +_0803A9E4: + movs r0, 0 + movs r1, 0x3 + bl sub_80211AC + b _0803AA2C +_0803A9EE: + movs r0, 0x1 + bl sub_8021354 + b _0803AA2C +_0803A9F6: + bl sub_8021494 + bl sub_803AA34 + ldr r0, _0803AA1C + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x4C + adds r1, r2, 0 + adds r1, 0xC + ldr r2, [r2, 0x8] + str r2, [sp] + movs r2, 0x2 + str r2, [sp, 0x4] + movs r2, 0 + movs r3, 0 + bl sub_8012D60 + b _0803AA2C + .align 2, 0 +_0803AA1C: .4byte gUnknown_203B3F4 +_0803AA20: + ldr r0, [r2] + ldrb r0, [r0, 0x4] + movs r1, 0x1 + movs r2, 0 + bl sub_8021774 +_0803AA2C: + add sp, 0x8 + pop {r0} + bx r0 + thumb_func_end sub_803A9AC + + thumb_func_start sub_803AA34 +sub_803AA34: + push {r4,r5,lr} + movs r4, 0 + ldr r0, _0803AA64 + ldr r1, [r0] + ldr r2, _0803AA68 + ldr r3, [r2] + ldrb r0, [r3, 0x4] + adds r1, r0 + ldrb r0, [r1] + adds r5, r2, 0 + cmp r0, 0 + beq _0803AA7A + ldr r0, _0803AA6C + str r0, [r3, 0xC] + bl sub_803ABC8 + lsls r0, 24 + cmp r0, 0 + beq _0803AA70 + ldr r1, [r5] + movs r0, 0x3 + str r0, [r1, 0x10] + b _0803AA82 + .align 2, 0 +_0803AA64: .4byte gUnknown_203B468 +_0803AA68: .4byte gUnknown_203B3F4 +_0803AA6C: .4byte gUnknown_80E7EBC +_0803AA70: + ldr r1, [r5] + movs r0, 0x1 + negs r0, r0 + str r0, [r1, 0x10] + b _0803AA82 +_0803AA7A: + ldr r0, _0803AABC + str r0, [r3, 0xC] + movs r0, 0x2 + str r0, [r3, 0x10] +_0803AA82: + adds r4, 0x1 + ldr r5, [r5] + mov r12, r5 + lsls r1, r4, 3 + mov r3, r12 + adds r3, 0xC + adds r2, r3, r1 + ldr r0, _0803AAC0 + ldr r0, [r0] + str r0, [r2] + mov r2, r12 + adds r2, 0x10 + adds r1, r2, r1 + movs r0, 0x4 + str r0, [r1] + adds r4, 0x1 + lsls r1, r4, 3 + adds r3, r1 + movs r0, 0 + str r0, [r3] + adds r2, r1 + movs r0, 0x1 + str r0, [r2] + mov r1, r12 + ldr r0, [r1, 0x10] + str r0, [r1, 0x8] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0803AABC: .4byte gUnknown_80E7EC4 +_0803AAC0: .4byte gUnknown_80D4970 + thumb_func_end sub_803AA34 + + thumb_func_start sub_803AAC4 +sub_803AAC4: + push {lr} + movs r0, 0x1 + bl sub_8021274 + cmp r0, 0x4 + bhi _0803AB2E + lsls r0, 2 + ldr r1, _0803AADC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0803AADC: .4byte _0803AAE0 + .align 2, 0 +_0803AAE0: + .4byte _0803AB2E + .4byte _0803AB2E + .4byte _0803AB24 + .4byte _0803AAF4 + .4byte _0803AB0C +_0803AAF4: + bl sub_802132C + ldr r1, _0803AB08 + ldr r1, [r1] + strb r0, [r1, 0x4] + movs r0, 0x2 + bl sub_803A924 + b _0803AB2E + .align 2, 0 +_0803AB08: .4byte gUnknown_203B3F4 +_0803AB0C: + bl sub_802132C + ldr r1, _0803AB20 + ldr r1, [r1] + strb r0, [r1, 0x4] + movs r0, 0x3 + bl sub_803A924 + b _0803AB2E + .align 2, 0 +_0803AB20: .4byte gUnknown_203B3F4 +_0803AB24: + bl sub_80213A0 + movs r0, 0x4 + bl sub_803A924 +_0803AB2E: + pop {r0} + bx r0 + thumb_func_end sub_803AAC4 + + thumb_func_start sub_803AB34 +sub_803AB34: + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + bl sub_8021274 + ldr r4, _0803AB6C + ldr r0, [r4] + adds r0, 0x4C + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _0803AB5A + ldr r0, [r4] + adds r0, 0x4C + mov r1, sp + bl sub_8013114 +_0803AB5A: + ldr r0, [sp] + cmp r0, 0x2 + beq _0803AB7A + cmp r0, 0x2 + bgt _0803AB70 + cmp r0, 0x1 + beq _0803AB9E + b _0803ABA4 + .align 2, 0 +_0803AB6C: .4byte gUnknown_203B3F4 +_0803AB70: + cmp r0, 0x3 + beq _0803AB84 + cmp r0, 0x4 + beq _0803AB96 + b _0803ABA4 +_0803AB7A: + ldr r0, [r4] + ldrb r0, [r0, 0x4] + bl sub_80925EC + b _0803AB8E +_0803AB84: + ldr r0, [r4] + ldrb r0, [r0, 0x4] + movs r1, 0x1 + bl sub_809249C +_0803AB8E: + movs r0, 0x1 + bl sub_803A924 + b _0803ABA4 +_0803AB96: + movs r0, 0x3 + bl sub_803A924 + b _0803ABA4 +_0803AB9E: + movs r0, 0x1 + bl sub_803A924 +_0803ABA4: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_803AB34 + + thumb_func_start sub_803ABAC +sub_803ABAC: + push {lr} + bl sub_80217EC + cmp r0, 0x1 + bls _0803ABC4 + cmp r0, 0x3 + bhi _0803ABC4 + bl sub_8021830 + movs r0, 0x1 + bl sub_803A924 +_0803ABC4: + pop {r0} + bx r0 + thumb_func_end sub_803ABAC + + thumb_func_start sub_803ABC8 +sub_803ABC8: + push {r4-r6,lr} + movs r5, 0 + movs r6, 0x1 +_0803ABCE: + ldr r2, _0803AC08 + movs r0, 0x58 + adds r1, r5, 0 + muls r1, r0 + ldr r0, [r2] + adds r2, r0, r1 + ldrh r1, [r2] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _0803AC10 + lsrs r0, r1, 1 + ands r0, r6 + cmp r0, 0 + beq _0803AC10 + ldr r0, _0803AC0C + ldr r4, [r0] + movs r1, 0x8 + ldrsh r0, [r2, r1] + bl sub_808DBA8 + ldrb r1, [r4, 0x4] + lsls r0, 24 + lsrs r0, 24 + cmp r1, r0 + bne _0803AC10 + movs r0, 0 + b _0803AC1C + .align 2, 0 +_0803AC08: .4byte gUnknown_203B45C +_0803AC0C: .4byte gUnknown_203B3F4 +_0803AC10: + adds r5, 0x1 + movs r0, 0xCE + lsls r0, 1 + cmp r5, r0 + ble _0803ABCE + movs r0, 0x1 +_0803AC1C: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_803ABC8 + + thumb_func_start sub_803AC24 +sub_803AC24: + push {r4,lr} + ldr r4, _0803AC44 + movs r0, 0xA0 + lsls r0, 1 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r4] + movs r0, 0 + bl sub_803ACD0 + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0803AC44: .4byte gUnknown_203B3F8 + thumb_func_end sub_803AC24 + + thumb_func_start sub_803AC48 +sub_803AC48: + push {lr} + ldr r0, _0803AC60 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0x7 + bhi _0803ACA8 + lsls r0, 2 + ldr r1, _0803AC64 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0803AC60: .4byte gUnknown_203B3F8 +_0803AC64: .4byte _0803AC68 + .align 2, 0 +_0803AC68: + .4byte _0803AC88 + .4byte _0803AC90 + .4byte _0803AC90 + .4byte _0803AC96 + .4byte _0803ACA8 + .4byte _0803AC9C + .4byte _0803ACA2 + .4byte _0803ACA8 +_0803AC88: + movs r0, 0x1 + bl sub_803ACD0 + b _0803ACAC +_0803AC90: + bl sub_803AF38 + b _0803ACAC +_0803AC96: + bl sub_803AF88 + b _0803ACAC +_0803AC9C: + bl sub_803AFE8 + b _0803ACAC +_0803ACA2: + bl sub_803B034 + b _0803ACAC +_0803ACA8: + movs r0, 0x3 + b _0803ACAE +_0803ACAC: + movs r0, 0 +_0803ACAE: + pop {r1} + bx r1 + thumb_func_end sub_803AC48 + + thumb_func_start sub_803ACB4 +sub_803ACB4: + push {r4,lr} + ldr r4, _0803ACCC + ldr r0, [r4] + cmp r0, 0 + beq _0803ACC6 + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0803ACC6: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0803ACCC: .4byte gUnknown_203B3F8 + thumb_func_end sub_803ACB4 + + thumb_func_start sub_803ACD0 +sub_803ACD0: + push {lr} + ldr r1, _0803ACE4 + ldr r1, [r1] + str r0, [r1] + bl sub_803ACE8 + bl sub_803AD88 + pop {r0} + bx r0 + .align 2, 0 +_0803ACE4: .4byte gUnknown_203B3F8 + thumb_func_end sub_803ACD0 + + thumb_func_start sub_803ACE8 +sub_803ACE8: + push {r4-r7,lr} + ldr r4, _0803AD08 + ldr r0, [r4] + adds r0, 0xE0 + bl sub_8006518 + ldr r1, [r4] + ldr r0, [r1] + cmp r0, 0x3 + beq _0803AD10 + cmp r0, 0x5 + beq _0803AD38 + movs r2, 0 + ldr r3, _0803AD0C + b _0803AD50 + .align 2, 0 +_0803AD08: .4byte gUnknown_203B3F8 +_0803AD0C: .4byte gUnknown_80E7ED4 +_0803AD10: + bl sub_803AEB0 + ldr r2, [r4] + movs r0, 0x88 + lsls r0, 1 + adds r2, r0 + ldr r1, _0803AD34 + ldm r1!, {r3,r5,r6} + stm r2!, {r3,r5,r6} + ldm r1!, {r3,r5,r7} + stm r2!, {r3,r5,r7} + ldr r1, [r4] + adds r0, r1, r0 + adds r1, 0x90 + bl sub_8012CAC + b _0803AD6C + .align 2, 0 +_0803AD34: .4byte gUnknown_80E7EEC +_0803AD38: + movs r6, 0x94 + lsls r6, 1 + adds r1, r6 + ldr r0, _0803AD4C + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + b _0803AD6C + .align 2, 0 +_0803AD4C: .4byte gUnknown_80E7F04 +_0803AD50: + ldr r0, [r4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 3 + adds r0, r1 + adds r0, 0xE0 + adds r1, r3, 0 + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + adds r2, 0x1 + cmp r2, 0x3 + ble _0803AD50 +_0803AD6C: + bl sub_8004914 + ldr r0, _0803AD84 + ldr r0, [r0] + adds r0, 0xE0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0803AD84: .4byte gUnknown_203B3F8 + thumb_func_end sub_803ACE8 + + thumb_func_start sub_803AD88 +sub_803AD88: + push {lr} + sub sp, 0x8 + ldr r1, _0803ADA4 + ldr r0, [r1] + ldr r0, [r0] + adds r2, r1, 0 + cmp r0, 0x7 + bhi _0803AE50 + lsls r0, 2 + ldr r1, _0803ADA8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0803ADA4: .4byte gUnknown_203B3F8 +_0803ADA8: .4byte _0803ADAC + .align 2, 0 +_0803ADAC: + .4byte _0803AE50 + .4byte _0803ADCC + .4byte _0803ADDA + .4byte _0803ADE2 + .4byte _0803AE50 + .4byte _0803AE0C + .4byte _0803AE44 + .4byte _0803AE50 +_0803ADCC: + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + movs r3, 0xA + bl sub_8023868 + b _0803AE50 +_0803ADDA: + movs r0, 0x1 + bl sub_8023B7C + b _0803AE50 +_0803ADE2: + bl sub_8023DA4 + ldr r0, _0803AE08 + ldr r2, [r0] + adds r0, r2, 0 + adds r0, 0x10 + adds r1, r2, 0 + adds r1, 0x90 + adds r3, r2, 0 + adds r3, 0xD0 + ldr r2, [r2, 0xC] + str r2, [sp] + movs r2, 0x2 + str r2, [sp, 0x4] + movs r2, 0 + bl sub_8012D60 + b _0803AE50 + .align 2, 0 +_0803AE08: .4byte gUnknown_203B3F8 +_0803AE0C: + ldr r2, [r2] + movs r1, 0x3 + str r1, [r2, 0x70] + movs r0, 0x1 + str r0, [r2, 0x68] + movs r0, 0x64 + str r0, [r2, 0x6C] + ldr r0, [r2, 0x8] + ldrb r0, [r0, 0x3] + str r0, [r2, 0x64] + str r1, [r2, 0x74] + movs r1, 0x94 + lsls r1, 1 + adds r0, r2, r1 + str r0, [r2, 0x78] + movs r0, 0x2C + str r0, [r2, 0x7C] + adds r1, r2, 0 + adds r1, 0x80 + movs r0, 0x12 + str r0, [r1] + adds r0, r2, 0 + adds r0, 0x60 + bl sub_8013AA0 + bl sub_803AE58 + b _0803AE50 +_0803AE44: + ldr r0, [r2] + ldr r1, [r0, 0x8] + adds r1, 0x4C + movs r0, 0x2 + bl sub_801602C +_0803AE50: + add sp, 0x8 + pop {r0} + bx r0 + thumb_func_end sub_803AD88 + + thumb_func_start sub_803AE58 +sub_803AE58: + push {r4,lr} + sub sp, 0x4 + ldr r4, _0803AEA8 + ldr r0, [r4] + ldr r0, [r0, 0x74] + bl sub_8008C54 + ldr r0, [r4] + ldr r0, [r0, 0x74] + bl sub_80073B8 + ldr r2, _0803AEAC + ldr r0, [r4] + ldr r3, [r0, 0x74] + movs r0, 0 + str r0, [sp] + movs r0, 0x4 + movs r1, 0 + bl xxx_call_draw_string + ldr r0, [r4] + adds r0, 0x60 + bl sub_8013C68 + ldr r0, [r4] + ldr r0, [r0, 0x74] + bl sub_80073E0 + bl sub_8023DA4 + ldr r0, [r4] + adds r0, 0x10 + movs r1, 0 + bl sub_8012EA4 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0803AEA8: .4byte gUnknown_203B3F8 +_0803AEAC: .4byte gUnknown_80E7F1C + thumb_func_end sub_803AE58 + + thumb_func_start sub_803AEB0 +sub_803AEB0: + push {r4-r6,lr} + ldr r4, _0803AEFC + ldr r0, [r4] + adds r0, 0xD0 + movs r1, 0 + movs r2, 0x10 + bl MemoryFill16 + ldr r4, [r4] + movs r3, 0 + adds r1, r4, 0 + adds r1, 0x90 + ldr r0, _0803AF00 + str r0, [r1] + adds r5, r4, 0 + adds r5, 0x94 + movs r0, 0x4 + str r0, [r5] + movs r2, 0x1 + adds r1, 0x8 + ldr r0, _0803AF04 + str r0, [r1] + adds r1, 0x4 + movs r0, 0x5 + str r0, [r1] + movs r6, 0x2 + adds r0, r4, 0 + adds r0, 0xA0 + str r3, [r0] + adds r0, 0x4 + str r2, [r0] + adds r0, 0x2C + ldrh r0, [r0] + cmp r0, 0 + bne _0803AF08 + ldr r0, [r5] + str r0, [r4, 0xC] + b _0803AF2C + .align 2, 0 +_0803AEFC: .4byte gUnknown_203B3F8 +_0803AF00: .4byte gUnknown_80E7F24 +_0803AF04: .4byte gUnknown_80E7F2C +_0803AF08: + adds r3, 0x1 + cmp r3, r6 + bge _0803AF2C + ldr r0, _0803AF34 + ldr r2, [r0] + lsls r1, r3, 1 + adds r0, r2, 0 + adds r0, 0xD0 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + bne _0803AF08 + lsls r0, r3, 3 + adds r1, r2, 0 + adds r1, 0x94 + adds r1, r0 + ldr r0, [r1] + str r0, [r2, 0xC] +_0803AF2C: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0803AF34: .4byte gUnknown_203B3F8 + thumb_func_end sub_803AEB0 + + thumb_func_start sub_803AF38 +sub_803AF38: + push {lr} + movs r0, 0x1 + bl sub_8023A94 + cmp r0, 0x2 + beq _0803AF78 + cmp r0, 0x2 + bcc _0803AF82 + cmp r0, 0x3 + bne _0803AF82 + bl sub_8023B44 + ldr r1, _0803AF70 + ldr r1, [r1] + strh r0, [r1, 0x4] + ldr r3, _0803AF74 + movs r0, 0x4 + ldrsh r2, [r1, r0] + movs r0, 0x58 + muls r2, r0 + ldr r0, [r3] + adds r0, r2 + str r0, [r1, 0x8] + movs r0, 0x3 + bl sub_803ACD0 + b _0803AF82 + .align 2, 0 +_0803AF70: .4byte gUnknown_203B3F8 +_0803AF74: .4byte gUnknown_203B45C +_0803AF78: + bl sub_8023C60 + movs r0, 0x7 + bl sub_803ACD0 +_0803AF82: + pop {r0} + bx r0 + thumb_func_end sub_803AF38 + + thumb_func_start sub_803AF88 +sub_803AF88: + push {r4,lr} + sub sp, 0x4 + movs r0, 0 + str r0, [sp] + bl sub_8023A94 + ldr r4, _0803AFC0 + ldr r0, [r4] + adds r0, 0x10 + bl sub_8012FD8 + lsls r0, 24 + cmp r0, 0 + bne _0803AFAE + ldr r0, [r4] + adds r0, 0x10 + mov r1, sp + bl sub_8013114 +_0803AFAE: + ldr r0, [sp] + cmp r0, 0x4 + beq _0803AFCA + cmp r0, 0x4 + bgt _0803AFC4 + cmp r0, 0x1 + beq _0803AFDA + b _0803AFE0 + .align 2, 0 +_0803AFC0: .4byte gUnknown_203B3F8 +_0803AFC4: + cmp r0, 0x5 + beq _0803AFD2 + b _0803AFE0 +_0803AFCA: + movs r0, 0x5 + bl sub_803ACD0 + b _0803AFE0 +_0803AFD2: + movs r0, 0x6 + bl sub_803ACD0 + b _0803AFE0 +_0803AFDA: + movs r0, 0x2 + bl sub_803ACD0 +_0803AFE0: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_803AF88 + + thumb_func_start sub_803AFE8 +sub_803AFE8: + push {r4,lr} + movs r0, 0 + bl sub_8023A94 + ldr r4, _0803B010 + ldr r0, [r4] + adds r0, 0x10 + bl sub_8012FD8 + ldr r0, [r4] + adds r0, 0x60 + bl sub_8013BBC + cmp r0, 0x2 + beq _0803B020 + cmp r0, 0x2 + bhi _0803B014 + cmp r0, 0x1 + beq _0803B028 + b _0803B02C + .align 2, 0 +_0803B010: .4byte gUnknown_203B3F8 +_0803B014: + cmp r0, 0x3 + bne _0803B02C + ldr r0, [r4] + ldr r1, [r0, 0x8] + ldr r0, [r0, 0x60] + strb r0, [r1, 0x3] +_0803B020: + movs r0, 0x2 + bl sub_803ACD0 + b _0803B02C +_0803B028: + bl sub_803AE58 +_0803B02C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_803AFE8 + + thumb_func_start sub_803B034 +sub_803B034: + push {lr} + bl sub_8016080 + cmp r0, 0x3 + bhi _0803B04C + cmp r0, 0x2 + bcc _0803B04C + bl sub_80160D8 + movs r0, 0x2 + bl sub_803ACD0 +_0803B04C: + pop {r0} + bx r0 + thumb_func_end sub_803B034 + + thumb_func_start sub_803B050 +sub_803B050: + push {r4-r7,lr} + ldr r4, _0803B0F4 + movs r0, 0xF4 + lsls r0, 2 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r4] + movs r1, 0x3 + str r1, [r0, 0x34] + adds r1, r0, 0 + adds r1, 0x84 + str r1, [r0, 0x38] + adds r0, 0x3C + bl sub_8006518 + ldr r1, [r4] + ldr r2, [r1, 0x34] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r1, 0x3C + ldr r0, _0803B0F8 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldr r0, [r4] + ldr r1, [r0, 0x38] + adds r0, 0x9C + str r0, [r1, 0x14] + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x3C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r2, 0 + movs r3, 0 + movs r7, 0xCB + lsls r7, 1 + movs r6, 0x80 + lsls r6, 9 + movs r5, 0 +_0803B0AE: + ldr r0, _0803B0FC + adds r0, r5, r0 + movs r1, 0x2 + ldrsh r0, [r0, r1] + ldr r4, _0803B0F4 + cmp r0, 0xA + bne _0803B0C8 + ldr r0, [r4] + lsls r1, r2, 1 + adds r0, 0xA0 + adds r0, r1 + strh r3, [r0] + adds r2, 0x1 +_0803B0C8: + adds r0, r6, 0 + movs r3, 0x80 + lsls r3, 9 + adds r6, r3 + adds r5, 0xC + asrs r3, r0, 16 + cmp r3, r7 + ble _0803B0AE + ldr r0, [r4] + ldr r3, [r0, 0x34] + adds r1, r2, 0 + movs r2, 0xA + bl sub_8013818 + bl sub_803B204 + bl sub_803B284 + movs r0, 0x1 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0803B0F4: .4byte gUnknown_203B3FC +_0803B0F8: .4byte gUnknown_80E7F54 +_0803B0FC: .4byte gUnknown_812F1F8 + thumb_func_end sub_803B050 + + thumb_func_start sub_803B100 +sub_803B100: + push {lr} + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + ldr r0, _0803B11C + ldr r0, [r0] + bl sub_8013878 + bl sub_803B204 + bl sub_803B284 + pop {r0} + bx r0 + .align 2, 0 +_0803B11C: .4byte gUnknown_203B3FC + thumb_func_end sub_803B100 + + thumb_func_start sub_803B120 +sub_803B120: + push {r4,lr} + ldr r4, _0803B13C + ldr r0, [r4] + bl GetKeyPress + cmp r0, 0x1 + beq _0803B140 + cmp r0, 0x2 + bne _0803B144 + movs r0, 0x1 + bl sub_80119D4 + movs r0, 0x2 + b _0803B160 + .align 2, 0 +_0803B13C: .4byte gUnknown_203B3FC +_0803B140: + movs r0, 0x3 + b _0803B160 +_0803B144: + ldr r0, [r4] + movs r1, 0x1 + bl sub_80138B8 + lsls r0, 24 + cmp r0, 0 + bne _0803B156 + movs r0, 0 + b _0803B160 +_0803B156: + bl sub_803B204 + bl sub_803B284 + movs r0, 0x1 +_0803B160: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_803B120 + + thumb_func_start sub_803B168 +sub_803B168: + ldr r0, _0803B188 + ldr r0, [r0] + movs r1, 0x1E + ldrsh r2, [r0, r1] + movs r3, 0x1C + ldrsh r1, [r0, r3] + muls r1, r2 + movs r3, 0x18 + ldrsh r2, [r0, r3] + adds r1, r2 + lsls r1, 1 + adds r0, 0xA0 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + bx lr + .align 2, 0 +_0803B188: .4byte gUnknown_203B3FC + thumb_func_end sub_803B168 + + thumb_func_start sub_803B18C +sub_803B18C: + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, _0803B1B8 + ldr r0, [r5] + movs r1, 0xE5 + strh r1, [r0, 0x22] + bl sub_8013984 + bl sub_803B204 + bl sub_803B284 + cmp r4, 0 + beq _0803B1B2 + ldr r0, [r5] + bl AddMenuCursorSprite +_0803B1B2: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0803B1B8: .4byte gUnknown_203B3FC + thumb_func_end sub_803B18C + + thumb_func_start sub_803B1BC +sub_803B1BC: + push {r4,r5,lr} + ldr r4, _0803B1FC + ldr r2, [r4] + cmp r2, 0 + beq _0803B1F6 + ldr r0, [r2, 0x34] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x3C + ldr r0, _0803B200 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x3C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0803B1F6: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0803B1FC: .4byte gUnknown_203B3FC +_0803B200: .4byte gUnknown_80E7F3C + thumb_func_end sub_803B1BC + + thumb_func_start sub_803B204 +sub_803B204: + push {r4,lr} + ldr r4, _0803B280 + ldr r0, [r4] + adds r0, 0x9C + movs r2, 0 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0x9D + strb r2, [r0] + ldr r0, [r4] + adds r0, 0x9E + movs r1, 0x8 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0x9F + strb r2, [r0] + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x3C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r4] + movs r1, 0x1A + ldrsh r0, [r0, r1] + movs r1, 0xC + bl sub_80095E4 + adds r0, 0x2 + lsls r0, 16 + ldr r2, [r4] + ldr r3, [r2, 0x34] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x4A + asrs r3, r0, 16 + lsrs r0, 16 + strh r0, [r1] + ldr r1, [r2, 0x34] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r2, r0 + adds r3, 0x2 + adds r2, 0x4C + strh r3, [r2] + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x3C + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0803B280: .4byte gUnknown_203B3FC + thumb_func_end sub_803B204 + + thumb_func_start sub_803B284 +sub_803B284: + push {r4-r6,lr} + sub sp, 0x8 + ldr r6, _0803B338 + ldr r0, [r6] + ldr r0, [r0, 0x34] + bl sub_8008C54 + ldr r0, [r6] + ldr r0, [r0, 0x34] + bl sub_80073B8 + ldr r2, _0803B33C + ldr r0, [r6] + ldr r3, [r0, 0x34] + movs r0, 0 + str r0, [sp] + movs r0, 0xA + movs r1, 0 + bl xxx_call_draw_string + ldr r1, [r6] + adds r0, r1, 0 + adds r0, 0x9E + ldrb r4, [r0] + lsls r4, 3 + subs r4, 0x2 + movs r0, 0x1E + ldrsh r2, [r1, r0] + adds r2, 0x1 + movs r0, 0x7 + str r0, [sp] + ldr r0, [r1, 0x34] + str r0, [sp, 0x4] + adds r0, r4, 0 + movs r1, 0 + movs r3, 0x2 + bl sub_8012BC4 + movs r5, 0 + ldr r0, [r6] + movs r1, 0x1A + ldrsh r0, [r0, r1] + cmp r5, r0 + bge _0803B324 +_0803B2DC: + ldr r0, [r6] + movs r3, 0x1E + ldrsh r2, [r0, r3] + movs r3, 0x1C + ldrsh r1, [r0, r3] + muls r2, r1 + adds r2, r5 + lsls r2, 1 + adds r1, r0, 0 + adds r1, 0xA0 + adds r1, r2 + movs r2, 0 + ldrsh r1, [r1, r2] + lsls r4, r1, 1 + adds r4, r1 + lsls r4, 2 + ldr r1, _0803B340 + adds r4, r1 + adds r1, r5, 0 + bl sub_8013800 + adds r1, r0, 0 + ldr r2, [r4, 0x4] + ldr r0, [r6] + ldr r3, [r0, 0x34] + movs r0, 0 + str r0, [sp] + movs r0, 0x8 + bl xxx_call_draw_string + adds r5, 0x1 + ldr r0, [r6] + movs r3, 0x1A + ldrsh r0, [r0, r3] + cmp r5, r0 + blt _0803B2DC +_0803B324: + ldr r0, _0803B338 + ldr r0, [r0] + ldr r0, [r0, 0x34] + bl sub_80073E0 + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0803B338: .4byte gUnknown_203B3FC +_0803B33C: .4byte gUnknown_80E7F6C +_0803B340: .4byte gUnknown_812F1F8 + thumb_func_end sub_803B284 + + thumb_func_start sub_803B344 +sub_803B344: + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r1, _0803B358 + adds r0, r1 + bx lr + .align 2, 0 +_0803B358: .4byte gUnknown_80E7F94 + thumb_func_end sub_803B344 + + thumb_func_start sub_803B35C +sub_803B35C: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r1, 0x18 + bl sub_803C21C + ldrb r0, [r5, 0x2] + subs r0, 0x1 + cmp r0, 0x8 + bls _0803B372 + b _0803B4FA +_0803B372: + lsls r0, 2 + ldr r1, _0803B37C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0803B37C: .4byte _0803B380 + .align 2, 0 +_0803B380: + .4byte _0803B3A4 + .4byte _0803B3BE + .4byte _0803B3D8 + .4byte _0803B3F2 + .4byte _0803B414 + .4byte _0803B442 + .4byte _0803B470 + .4byte _0803B49E + .4byte _0803B4CC +_0803B3A4: + adds r0, r4, 0 + adds r0, 0x40 + movs r1, 0 + strb r1, [r0] + adds r0, 0x1 + strb r1, [r0] + adds r1, r4, 0 + adds r1, 0x42 + movs r0, 0x6 + strb r0, [r1] + subs r1, 0x14 + movs r0, 0x5 + b _0803B576 +_0803B3BE: + adds r0, r4, 0 + adds r0, 0x40 + movs r1, 0x1 + strb r1, [r0] + adds r0, 0x1 + strb r1, [r0] + adds r1, r4, 0 + adds r1, 0x42 + movs r0, 0x6 + strb r0, [r1] + subs r1, 0x14 + movs r0, 0x5 + b _0803B576 +_0803B3D8: + adds r0, r4, 0 + adds r0, 0x40 + movs r1, 0x2 + strb r1, [r0] + adds r0, 0x1 + strb r1, [r0] + adds r1, r4, 0 + adds r1, 0x42 + movs r0, 0x6 + strb r0, [r1] + subs r1, 0x14 + movs r0, 0x5 + b _0803B576 +_0803B3F2: + adds r0, r4, 0 + adds r0, 0x40 + movs r1, 0x3 + strb r1, [r0] + adds r0, 0x1 + strb r1, [r0] + adds r1, r4, 0 + adds r1, 0x42 + movs r0, 0x6 + strb r0, [r1] + bl sub_8096DD8 + str r0, [r4, 0x4C] + bl sub_8096DE8 + str r0, [r4, 0x50] + b _0803B578 +_0803B414: + ldrb r0, [r5, 0x1] + cmp r0, 0x3 + bne _0803B42A + adds r0, r4, 0 + adds r0, 0x40 + movs r1, 0xB + strb r1, [r0] + adds r1, r4, 0 + adds r1, 0x42 + movs r0, 0x1 + b _0803B438 +_0803B42A: + adds r0, r4, 0 + adds r0, 0x40 + movs r1, 0xC + strb r1, [r0] + adds r1, r4, 0 + adds r1, 0x42 + movs r0, 0x2 +_0803B438: + strb r0, [r1] + adds r1, r4, 0 + adds r1, 0x41 + movs r0, 0x4 + b _0803B576 +_0803B442: + ldrb r0, [r5, 0x1] + cmp r0, 0x3 + bne _0803B458 + adds r0, r4, 0 + adds r0, 0x40 + movs r1, 0xB + strb r1, [r0] + adds r1, r4, 0 + adds r1, 0x42 + movs r0, 0x1 + b _0803B466 +_0803B458: + adds r0, r4, 0 + adds r0, 0x40 + movs r1, 0xC + strb r1, [r0] + adds r1, r4, 0 + adds r1, 0x42 + movs r0, 0x2 +_0803B466: + strb r0, [r1] + adds r1, r4, 0 + adds r1, 0x41 + movs r0, 0x5 + b _0803B576 +_0803B470: + adds r0, r5, 0 + bl sub_803B600 + str r0, [r4, 0x4] + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0803B488 + adds r1, r4, 0 + adds r1, 0x40 + movs r0, 0x9 + b _0803B48E +_0803B488: + adds r1, r4, 0 + adds r1, 0x40 + movs r0, 0x4 +_0803B48E: + strb r0, [r1] + adds r1, r4, 0 + adds r1, 0x41 + movs r0, 0x6 + strb r0, [r1] + adds r1, 0x1 + movs r0, 0x4 + b _0803B576 +_0803B49E: + adds r0, r5, 0 + bl sub_803B628 + str r0, [r4, 0x4] + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0803B4B6 + adds r1, r4, 0 + adds r1, 0x40 + movs r0, 0x9 + b _0803B4BC +_0803B4B6: + adds r1, r4, 0 + adds r1, 0x40 + movs r0, 0x5 +_0803B4BC: + strb r0, [r1] + adds r1, r4, 0 + adds r1, 0x41 + movs r0, 0x7 + strb r0, [r1] + adds r1, 0x1 + movs r0, 0x4 + b _0803B576 +_0803B4CC: + adds r0, r5, 0 + bl sub_803B66C + str r0, [r4, 0x4] + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _0803B4E4 + adds r1, r4, 0 + adds r1, 0x40 + movs r0, 0xA + b _0803B4EA +_0803B4E4: + adds r1, r4, 0 + adds r1, 0x40 + movs r0, 0x6 +_0803B4EA: + strb r0, [r1] + adds r1, r4, 0 + adds r1, 0x41 + movs r0, 0x8 + strb r0, [r1] + adds r1, 0x1 + movs r0, 0x5 + b _0803B576 +_0803B4FA: + ldrb r0, [r5, 0x1] + cmp r0, 0x2 + beq _0803B528 + cmp r0, 0x2 + bgt _0803B50A + cmp r0, 0x1 + beq _0803B514 + b _0803B564 +_0803B50A: + cmp r0, 0x3 + beq _0803B53C + cmp r0, 0x4 + beq _0803B550 + b _0803B564 +_0803B514: + adds r1, r4, 0 + adds r1, 0x40 + movs r0, 0x9 + strb r0, [r1] + adds r1, 0x1 + movs r0, 0xD + strb r0, [r1] + adds r1, 0x1 + movs r0, 0x4 + b _0803B576 +_0803B528: + adds r1, r4, 0 + adds r1, 0x40 + movs r0, 0xA + strb r0, [r1] + adds r1, 0x1 + movs r0, 0xE + strb r0, [r1] + adds r1, 0x1 + movs r0, 0x5 + b _0803B576 +_0803B53C: + adds r1, r4, 0 + adds r1, 0x40 + movs r0, 0xB + strb r0, [r1] + adds r1, 0x1 + movs r0, 0xF + strb r0, [r1] + adds r1, 0x1 + movs r0, 0x1 + b _0803B576 +_0803B550: + adds r1, r4, 0 + adds r1, 0x40 + movs r0, 0xC + strb r0, [r1] + adds r1, 0x1 + movs r0, 0x10 + strb r0, [r1] + adds r1, 0x1 + movs r0, 0x2 + b _0803B576 +_0803B564: + adds r1, r4, 0 + adds r1, 0x40 + movs r0, 0x8 + strb r0, [r1] + adds r1, 0x1 + movs r0, 0xC + strb r0, [r1] + adds r1, 0x1 + movs r0, 0x3 +_0803B576: + strb r0, [r1] +_0803B578: + adds r0, r5, 0x4 + str r0, [r4, 0x8] + movs r0, 0 + str r0, [r4, 0xC] + ldrh r0, [r5, 0xC] + movs r1, 0 + strh r0, [r4, 0x10] + ldrh r0, [r5, 0xE] + strh r0, [r4, 0x12] + ldrb r0, [r5, 0x10] + strb r0, [r4, 0x14] + ldrb r0, [r5] + subs r0, 0x2 + cmp r0, 0x7 + bhi _0803B5EC + lsls r0, 2 + ldr r1, _0803B5A0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0803B5A0: .4byte _0803B5A4 + .align 2, 0 +_0803B5A4: + .4byte _0803B5C4 + .4byte _0803B5C4 + .4byte _0803B5C4 + .4byte _0803B5C4 + .4byte _0803B5DC + .4byte _0803B5CC + .4byte _0803B5DC + .4byte _0803B5DC +_0803B5C4: + adds r0, r4, 0 + adds r0, 0x43 + movs r1, 0x1 + b _0803B5F0 +_0803B5CC: + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0 + strb r0, [r1] + adds r1, 0x1 + movs r0, 0x3 + strb r0, [r1] + b _0803B5F6 +_0803B5DC: + adds r1, r4, 0 + adds r1, 0x43 + movs r0, 0x3 + strb r0, [r1] + adds r1, 0x1 + movs r0, 0x2 + strb r0, [r1] + b _0803B5F6 +_0803B5EC: + adds r0, r4, 0 + adds r0, 0x43 +_0803B5F0: + strb r1, [r0] + adds r0, 0x1 + strb r1, [r0] +_0803B5F6: + str r5, [r4, 0x54] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_803B35C + + thumb_func_start sub_803B600 +sub_803B600: + push {lr} + ldr r2, _0803B614 + movs r1, 0 + ldr r3, [r0, 0xC] +_0803B608: + ldr r0, [r2] + cmp r0, r3 + bne _0803B618 + adds r0, r1, 0 + b _0803B624 + .align 2, 0 +_0803B614: .4byte gUnknown_80E9920 +_0803B618: + adds r2, 0x8 + adds r1, 0x1 + cmp r1, 0x14 + ble _0803B608 + movs r0, 0x1 + negs r0, r0 +_0803B624: + pop {r1} + bx r1 + thumb_func_end sub_803B600 + + thumb_func_start sub_803B628 +sub_803B628: + push {r4,r5,lr} + adds r4, r0, 0 + ldr r2, _0803B654 + movs r3, 0 +_0803B630: + ldr r1, [r2] + ldr r0, [r4, 0xC] + cmp r1, r0 + beq _0803B650 + movs r0, 0x2 + ldrsh r1, [r2, r0] + movs r5, 0xC + ldrsh r0, [r4, r5] + cmp r1, r0 + bne _0803B658 + movs r0, 0 + ldrsh r1, [r2, r0] + movs r5, 0xE + ldrsh r0, [r4, r5] + cmp r1, r0 + bne _0803B658 +_0803B650: + adds r0, r3, 0 + b _0803B664 + .align 2, 0 +_0803B654: .4byte gUnknown_80E9F8C +_0803B658: + adds r2, 0xC + adds r3, 0x1 + cmp r3, 0x2C + ble _0803B630 + movs r0, 0x1 + negs r0, r0 +_0803B664: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_803B628 + + thumb_func_start sub_803B66C +sub_803B66C: + push {r4,r5,lr} + adds r4, r0, 0 + ldr r2, _0803B698 + movs r3, 0 +_0803B674: + ldr r1, [r2] + ldr r0, [r4, 0xC] + cmp r1, r0 + beq _0803B694 + movs r0, 0x2 + ldrsh r1, [r2, r0] + movs r5, 0xC + ldrsh r0, [r4, r5] + cmp r1, r0 + bne _0803B69C + movs r0, 0 + ldrsh r1, [r2, r0] + movs r5, 0xE + ldrsh r0, [r4, r5] + cmp r1, r0 + bne _0803B69C +_0803B694: + adds r0, r3, 0 + b _0803B6A8 + .align 2, 0 +_0803B698: .4byte gUnknown_80E8168 +_0803B69C: + adds r2, 0x4 + adds r3, 0x1 + cmp r3, 0x5 + ble _0803B674 + movs r0, 0x1 + negs r0, r0 +_0803B6A8: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_803B66C + + thumb_func_start sub_803B6B0 +sub_803B6B0: + push {r4,lr} + sub sp, 0x4 + lsls r2, 24 + ldr r4, _0803B6D0 + lsrs r2, 22 + adds r2, r4 + ldr r2, [r2] + movs r4, 0 + str r4, [sp] + bl xxx_call_draw_string + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0803B6D0: .4byte gUnknown_80E8B94 + thumb_func_end sub_803B6B0 + + thumb_func_start sub_803B6D4 +sub_803B6D4: + push {r4-r7,lr} + sub sp, 0x144 + adds r7, r0, 0 + ldr r1, [r7, 0x48] + adds r0, 0x43 + ldrb r2, [r0] + ldr r3, [r7] + movs r0, 0xA + bl sub_803B6B0 + adds r0, r7, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0xC + bls _0803B6F4 + b _0803B86C +_0803B6F4: + lsls r0, 2 + ldr r1, _0803B700 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0803B700: .4byte _0803B704 + .align 2, 0 +_0803B704: + .4byte _0803B73E + .4byte _0803B748 + .4byte _0803B754 + .4byte _0803B738 + .4byte _0803B7A4 + .4byte _0803B7B0 + .4byte _0803B7C8 + .4byte _0803B760 + .4byte _0803B86C + .4byte _0803B818 + .4byte _0803B7E0 + .4byte _0803B788 + .4byte _0803B76A +_0803B738: + ldr r1, [r7, 0x48] + ldr r2, [r7, 0x4C] + b _0803B7CC +_0803B73E: + ldr r1, [r7, 0x48] + ldr r2, _0803B744 + b _0803B7CC + .align 2, 0 +_0803B744: .4byte gUnknown_80E87DC +_0803B748: + ldr r1, [r7, 0x48] + ldr r2, _0803B750 + b _0803B7CC + .align 2, 0 +_0803B750: .4byte gUnknown_80E87F4 +_0803B754: + ldr r1, [r7, 0x48] + ldr r2, _0803B75C + b _0803B7CC + .align 2, 0 +_0803B75C: .4byte gUnknown_80E8818 +_0803B760: + ldr r1, [r7, 0x8] + add r0, sp, 0x4 + bl sub_8090208 + b _0803B850 +_0803B76A: + ldr r4, _0803B780 + ldrb r1, [r7, 0x14] + adds r0, r4, 0 + movs r2, 0 + bl sub_8090DC4 + ldr r1, _0803B784 + add r0, sp, 0x4 + adds r2, r4, 0 + b _0803B84C + .align 2, 0 +_0803B780: .4byte gUnknown_202DE58 +_0803B784: .4byte gUnknown_80E8830 +_0803B788: + ldr r4, _0803B79C + ldrb r1, [r7, 0x14] + adds r0, r4, 0 + movs r2, 0 + bl sub_8090DC4 + ldr r1, _0803B7A0 + add r0, sp, 0x4 + adds r2, r4, 0 + b _0803B84C + .align 2, 0 +_0803B79C: .4byte gUnknown_202DE58 +_0803B7A0: .4byte gUnknown_80E8848 +_0803B7A4: + ldr r1, [r7, 0x48] + ldr r2, _0803B7AC + b _0803B7CC + .align 2, 0 +_0803B7AC: .4byte gUnknown_80E885C +_0803B7B0: + ldr r1, [r7, 0x48] + ldr r3, _0803B7C4 + ldr r2, [r7, 0x4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r3, 0x4 + adds r0, r3 + ldr r2, [r0] + b _0803B7CC + .align 2, 0 +_0803B7C4: .4byte gUnknown_80E9F8C +_0803B7C8: + ldr r1, [r7, 0x48] + ldr r2, _0803B7DC +_0803B7CC: + ldr r3, [r7] + movs r0, 0 + str r0, [sp] + movs r0, 0x15 + bl xxx_call_draw_string + b _0803B8B4 + .align 2, 0 +_0803B7DC: .4byte gUnknown_80E886C +_0803B7E0: + ldr r0, [r7, 0x8] + ldr r4, [r0, 0x4] + ldrb r0, [r0] + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + movs r1, 0x12 + ldrsh r0, [r7, r1] + bl sub_808D994 + adds r1, r0, 0 + ldr r5, _0803B810 + adds r0, r5, 0 + bl strcpy + ldr r1, _0803B814 + movs r0, 0x3 + ands r4, r0 + lsls r4, 2 + adds r4, r1 + ldr r1, [r4] + add r0, sp, 0x4 + adds r2, r5, 0 + b _0803B84C + .align 2, 0 +_0803B810: .4byte gUnknown_202DF98 +_0803B814: .4byte gUnknown_80EAE5C +_0803B818: + ldr r0, [r7, 0x8] + ldr r4, [r0, 0x4] + ldrb r0, [r0] + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + movs r1, 0x12 + ldrsh r0, [r7, r1] + bl sub_808D994 + adds r1, r0, 0 + ldr r6, _0803B864 + adds r0, r6, 0 + bl strcpy + ldr r5, _0803B868 + adds r0, r4, 0 + movs r1, 0xA + bl __umodsi3 + lsls r0, 24 + lsrs r0, 22 + adds r0, r5 + ldr r1, [r0] + add r0, sp, 0x4 + adds r2, r6, 0 +_0803B84C: + bl sub_800D158 +_0803B850: + ldr r1, [r7, 0x48] + ldr r3, [r7] + movs r0, 0 + str r0, [sp] + movs r0, 0x15 + add r2, sp, 0x4 + bl xxx_call_draw_string + b _0803B8B4 + .align 2, 0 +_0803B864: .4byte gUnknown_202DF98 +_0803B868: .4byte gUnknown_80E910C +_0803B86C: + ldr r0, [r7, 0x8] + ldr r4, [r0, 0x4] + ldrb r0, [r0] + adds r4, r0 + lsls r4, 24 + lsrs r4, 24 + movs r1, 0x12 + ldrsh r0, [r7, r1] + bl sub_808D994 + adds r1, r0, 0 + ldr r6, _0803B8E8 + adds r0, r6, 0 + bl strcpy + ldr r5, _0803B8EC + adds r0, r4, 0 + movs r1, 0xF + bl __umodsi3 + lsls r0, 24 + lsrs r0, 22 + adds r0, r5 + ldr r1, [r0] + add r0, sp, 0x4 + adds r2, r6, 0 + bl sub_800D158 + ldr r1, [r7, 0x48] + ldr r3, [r7] + movs r0, 0 + str r0, [sp] + movs r0, 0x15 + add r2, sp, 0x4 + bl xxx_call_draw_string +_0803B8B4: + adds r0, r7, 0 + adds r0, 0x40 + ldrb r1, [r0] + adds r6, r0, 0 + cmp r1, 0x7 + bne _0803B916 + ldr r5, [r7, 0xC] + cmp r5, 0 + bne _0803B8F0 + bl sub_8016028 + movs r4, 0xB2 + subs r4, r0 + movs r1, 0x10 + ldrsh r0, [r7, r1] + bl sub_808D994 + adds r2, r0, 0 + ldr r1, [r7, 0x48] + ldr r3, [r7] + str r5, [sp] + adds r0, r4, 0 + bl xxx_call_draw_string + b _0803B956 + .align 2, 0 +_0803B8E8: .4byte gUnknown_202DF98 +_0803B8EC: .4byte gUnknown_80E8C98 +_0803B8F0: + add r4, sp, 0xCC + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0xA + bl sub_80922B4 + bl sub_8016028 + adds r1, r0, 0 + movs r0, 0xB2 + subs r0, r1 + ldr r1, [r7, 0x48] + ldr r3, [r7] + movs r2, 0 + str r2, [sp] + adds r2, r4, 0 + bl xxx_call_draw_string + b _0803B956 +_0803B916: + adds r0, r7, 0 + adds r0, 0x42 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0803B93C + add r4, sp, 0xE0 + ldr r1, [r7, 0x8] + adds r0, r4, 0 + bl sub_8090228 + ldr r1, _0803B938 + add r0, sp, 0x4 + adds r2, r4, 0 + bl sub_800D158 + b _0803B944 + .align 2, 0 +_0803B938: .4byte gUnknown_80E8884 +_0803B93C: + ldr r1, [r7, 0x8] + add r0, sp, 0x4 + bl sub_8090228 +_0803B944: + ldr r1, [r7, 0x48] + adds r1, 0xC + ldr r3, [r7] + movs r0, 0 + str r0, [sp] + movs r0, 0x1D + add r2, sp, 0x4 + bl xxx_call_draw_string +_0803B956: + ldrb r0, [r6] + cmp r0, 0x7 + bne _0803B962 + ldr r0, [r7, 0x8] + movs r1, 0 + b _0803B968 +_0803B962: + ldr r0, [r7, 0x8] + ldr r1, [r7, 0x54] + ldrb r1, [r1, 0x1] +_0803B968: + bl sub_803C1D0 + lsls r0, 24 + lsrs r0, 24 + bl sub_803C1F0 + adds r2, r0, 0 + ldr r1, [r7, 0x48] + ldr r3, [r7] + movs r0, 0 + str r0, [sp] + movs r0, 0xB4 + bl xxx_call_draw_string + add sp, 0x144 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_803B6D4 + + thumb_func_start sub_803B98C +sub_803B98C: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x1FC + adds r7, r0, 0 + movs r0, 0 + mov r9, r0 + ldr r2, _0803B9E0 + ldr r3, [r7] + str r0, [sp] + movs r0, 0xA + movs r1, 0 + bl xxx_call_draw_string + ldr r1, _0803B9E4 + adds r0, r7, 0 + adds r0, 0x44 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r2, [r0] + ldr r3, [r7] + mov r1, r9 + str r1, [sp] + movs r0, 0x6C + movs r1, 0 + bl xxx_call_draw_string + movs r0, 0x10 + mov r9, r0 + adds r0, r7, 0 + adds r0, 0x41 + ldrb r0, [r0] + cmp r0, 0x10 + bls _0803B9D6 + b _0803BCC0 +_0803B9D6: + lsls r0, 2 + ldr r1, _0803B9E8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0803B9E0: .4byte gUnknown_80E888C +_0803B9E4: .4byte gUnknown_80E8BCC +_0803B9E8: .4byte _0803B9EC + .align 2, 0 +_0803B9EC: + .4byte _0803BA34 + .4byte _0803BA3C + .4byte _0803BA44 + .4byte _0803BA30 + .4byte _0803BA4C + .4byte _0803BA6C + .4byte _0803BA8C + .4byte _0803BAA0 + .4byte _0803BBF0 + .4byte _0803BAE8 + .4byte _0803BAF0 + .4byte _0803BAF8 + .4byte _0803BCC0 + .4byte _0803BC58 + .4byte _0803BB74 + .4byte _0803BB10 + .4byte _0803BB10 +_0803BA30: + ldr r2, [r7, 0x50] + b _0803BAFA +_0803BA34: + ldr r2, _0803BA38 + b _0803BAFA + .align 2, 0 +_0803BA38: .4byte gUnknown_80E88A0 +_0803BA3C: + ldr r2, _0803BA40 + b _0803BAFA + .align 2, 0 +_0803BA40: .4byte gUnknown_80E88C8 +_0803BA44: + ldr r2, _0803BA48 + b _0803BAFA + .align 2, 0 +_0803BA48: .4byte gUnknown_80E8920 +_0803BA4C: + ldr r4, _0803BA64 + ldrb r1, [r7, 0x14] + adds r0, r4, 0 + movs r2, 0 + bl sub_8090DC4 + ldr r1, _0803BA68 + add r0, sp, 0x4 + adds r2, r4, 0 + bl sub_800D158 + b _0803BACC + .align 2, 0 +_0803BA64: .4byte gUnknown_202DE58 +_0803BA68: .4byte gUnknown_80E8968 +_0803BA6C: + ldr r4, _0803BA84 + ldrb r1, [r7, 0x14] + adds r0, r4, 0 + movs r2, 0 + bl sub_8090DC4 + ldr r1, _0803BA88 + add r0, sp, 0x4 + adds r2, r4, 0 + bl sub_800D158 + b _0803BACC + .align 2, 0 +_0803BA84: .4byte gUnknown_202DE58 +_0803BA88: .4byte gUnknown_80E89B0 +_0803BA8C: + ldr r1, _0803BA9C + ldr r0, [r7, 0x4] + lsls r0, 3 + adds r1, 0x4 + adds r0, r1 + ldr r2, [r0] + b _0803BAFA + .align 2, 0 +_0803BA9C: .4byte gUnknown_80E9920 +_0803BAA0: + movs r1, 0x12 + ldrsh r0, [r7, r1] + bl sub_808D994 + adds r1, r0, 0 + ldr r4, _0803BAE0 + adds r0, r4, 0 + bl strcpy + ldr r2, _0803BAE4 + ldr r1, [r7, 0x4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r2, 0x8 + adds r0, r2 + ldr r1, [r0] + add r0, sp, 0x4 + adds r2, r4, 0 + adds r3, r4, 0 + bl sub_800D158 +_0803BACC: + ldr r3, [r7] + movs r0, 0 + str r0, [sp] + movs r0, 0xA + mov r1, r9 + add r2, sp, 0x4 + bl xxx_call_draw_string + b _0803BD42 + .align 2, 0 +_0803BAE0: .4byte gUnknown_202DF98 +_0803BAE4: .4byte gUnknown_80E9F8C +_0803BAE8: + ldr r2, _0803BAEC + b _0803BAFA + .align 2, 0 +_0803BAEC: .4byte gUnknown_80E89FC +_0803BAF0: + ldr r2, _0803BAF4 + b _0803BAFA + .align 2, 0 +_0803BAF4: .4byte gUnknown_80E8A40 +_0803BAF8: + ldr r2, _0803BB0C +_0803BAFA: + ldr r3, [r7] + movs r0, 0 + str r0, [sp] + movs r0, 0xA + mov r1, r9 + bl xxx_call_draw_string + b _0803BD42 + .align 2, 0 +_0803BB0C: .4byte gUnknown_80E8A7C +_0803BB10: + ldr r0, [r7, 0x8] + ldr r5, [r0, 0x4] + ldrb r4, [r0] + adds r4, r5, r4 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r0, 0x1] + adds r5, r0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, _0803BB68 + mov r8, r0 + ldrb r1, [r7, 0x14] + movs r2, 0 + bl sub_8090DC4 + ldr r6, _0803BB6C + adds r0, r4, 0 + movs r1, 0x16 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 22 + adds r0, r6 + ldr r1, [r0] + add r0, sp, 0x4 + mov r2, r8 + bl sub_800D158 + ldr r3, [r7] + movs r6, 0 + str r6, [sp] + movs r0, 0xA + mov r1, r9 + add r2, sp, 0x4 + bl xxx_call_draw_string + movs r1, 0xC + add r9, r1 + ldr r4, _0803BB70 + adds r0, r5, 0 + movs r1, 0x16 + b _0803BD1A + .align 2, 0 +_0803BB68: .4byte gUnknown_202DE58 +_0803BB6C: .4byte gUnknown_80EB3F8 +_0803BB70: .4byte gUnknown_80EB72C +_0803BB74: + ldr r0, [r7, 0x8] + ldr r5, [r0, 0x4] + ldrb r4, [r0] + adds r4, r5, r4 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r0, 0x1] + adds r5, r0 + lsls r5, 24 + lsrs r5, 24 + movs r1, 0x12 + ldrsh r0, [r7, r1] + bl sub_808D994 + adds r1, r0, 0 + ldr r0, _0803BBE4 + mov r8, r0 + bl strcpy + ldr r6, _0803BBE8 + adds r0, r4, 0 + movs r1, 0x14 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 22 + adds r0, r6 + ldr r1, [r0] + add r0, sp, 0x4 + mov r2, r8 + bl sub_800D158 + ldr r3, [r7] + movs r4, 0 + str r4, [sp] + movs r0, 0xA + mov r1, r9 + add r2, sp, 0x4 + bl xxx_call_draw_string + movs r1, 0xC + add r9, r1 + ldr r1, _0803BBEC + movs r0, 0x3 + ands r5, r0 + lsls r5, 2 + adds r5, r1 + ldr r1, [r5] + add r0, sp, 0x4 + mov r2, r8 + bl sub_800D158 + ldr r3, [r7] + str r4, [sp] + b _0803BD32 + .align 2, 0 +_0803BBE4: .4byte gUnknown_202DF98 +_0803BBE8: .4byte gUnknown_80EAEB8 +_0803BBEC: .4byte gUnknown_80EB198 +_0803BBF0: + ldr r0, [r7, 0x8] + ldr r5, [r0, 0x4] + ldrb r4, [r0] + adds r4, r5, r4 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r0, 0x1] + adds r5, r0 + lsls r5, 24 + lsrs r5, 24 + movs r1, 0x12 + ldrsh r0, [r7, r1] + bl sub_808D994 + adds r1, r0, 0 + ldr r0, _0803BC4C + mov r8, r0 + bl strcpy + ldr r6, _0803BC50 + adds r0, r4, 0 + movs r1, 0x6 + bl __umodsi3 + lsls r0, 24 + lsrs r0, 22 + adds r0, r6 + ldr r1, [r0] + add r0, sp, 0x4 + mov r2, r8 + bl sub_800D158 + ldr r3, [r7] + movs r6, 0 + str r6, [sp] + movs r0, 0xA + mov r1, r9 + add r2, sp, 0x4 + bl xxx_call_draw_string + movs r1, 0xC + add r9, r1 + ldr r4, _0803BC54 + adds r0, r5, 0 + movs r1, 0x6 + b _0803BD1A + .align 2, 0 +_0803BC4C: .4byte gUnknown_202DF98 +_0803BC50: .4byte gUnknown_80EB220 +_0803BC54: .4byte gUnknown_80EB2F0 +_0803BC58: + ldr r0, [r7, 0x8] + ldr r5, [r0, 0x4] + ldrb r4, [r0] + adds r4, r5, r4 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r0, 0x1] + adds r5, r0 + lsls r5, 24 + lsrs r5, 24 + movs r1, 0x12 + ldrsh r0, [r7, r1] + bl sub_808D994 + adds r1, r0, 0 + ldr r0, _0803BCB4 + mov r8, r0 + bl strcpy + ldr r6, _0803BCB8 + adds r0, r4, 0 + movs r1, 0x2D + bl __umodsi3 + lsls r0, 24 + lsrs r0, 22 + adds r0, r6 + ldr r1, [r0] + add r0, sp, 0x4 + mov r2, r8 + bl sub_800D158 + ldr r3, [r7] + movs r6, 0 + str r6, [sp] + movs r0, 0xA + mov r1, r9 + add r2, sp, 0x4 + bl xxx_call_draw_string + movs r1, 0xC + add r9, r1 + ldr r4, _0803BCBC + adds r0, r5, 0 + movs r1, 0xA + b _0803BD1A + .align 2, 0 +_0803BCB4: .4byte gUnknown_202DF98 +_0803BCB8: .4byte gUnknown_80E91D4 +_0803BCBC: .4byte gUnknown_80E9820 +_0803BCC0: + ldr r0, [r7, 0x8] + ldr r5, [r0, 0x4] + ldrb r4, [r0] + adds r4, r5, r4 + lsls r4, 24 + lsrs r4, 24 + ldrb r0, [r0, 0x1] + adds r5, r0 + lsls r5, 24 + lsrs r5, 24 + movs r1, 0x10 + ldrsh r0, [r7, r1] + bl sub_808D994 + adds r1, r0, 0 + ldr r0, _0803BD78 + mov r8, r0 + bl strcpy + ldr r6, _0803BD7C + adds r0, r4, 0 + movs r1, 0xD + bl __umodsi3 + lsls r0, 24 + lsrs r0, 22 + adds r0, r6 + ldr r1, [r0] + add r0, sp, 0x4 + mov r2, r8 + bl sub_800D158 + ldr r3, [r7] + movs r6, 0 + str r6, [sp] + movs r0, 0xA + mov r1, r9 + add r2, sp, 0x4 + bl xxx_call_draw_string + movs r1, 0xC + add r9, r1 + ldr r4, _0803BD80 + adds r0, r5, 0 + movs r1, 0xD +_0803BD1A: + bl __umodsi3 + lsls r0, 24 + lsrs r0, 22 + adds r0, r4 + ldr r1, [r0] + add r0, sp, 0x4 + mov r2, r8 + bl sub_800D158 + ldr r3, [r7] + str r6, [sp] +_0803BD32: + movs r0, 0xA + mov r1, r9 + add r2, sp, 0x4 + bl xxx_call_draw_string + movs r0, 0xC + negs r0, r0 + add r9, r0 +_0803BD42: + movs r1, 0x1C + add r9, r1 + ldr r2, _0803BD84 + ldr r3, [r7] + movs r0, 0 + mov r8, r0 + str r0, [sp] + movs r0, 0xA + mov r1, r9 + bl xxx_call_draw_string + ldr r1, [r7, 0xC] + cmp r1, 0 + bne _0803BD88 + movs r1, 0x10 + ldrsh r0, [r7, r1] + bl sub_808D994 + adds r2, r0, 0 + ldr r3, [r7] + mov r0, r8 + str r0, [sp] + movs r0, 0x44 + mov r1, r9 + bl xxx_call_draw_string + b _0803BDBC + .align 2, 0 +_0803BD78: .4byte gUnknown_202DF98 +_0803BD7C: .4byte gUnknown_80E8DE4 +_0803BD80: .4byte gUnknown_80E8FB0 +_0803BD84: .4byte gUnknown_80E8AC8 +_0803BD88: + add r6, sp, 0x158 + adds r0, r6, 0 + movs r2, 0xA + bl sub_80922B4 + add r4, sp, 0x16C + movs r0, 0x10 + ldrsh r1, [r7, r0] + adds r0, r4, 0 + bl sub_808D930 + add r5, sp, 0x130 + ldr r1, _0803BDE8 + adds r0, r5, 0 + adds r2, r6, 0 + adds r3, r4, 0 + bl sub_800D158 + ldr r3, [r7] + mov r1, r8 + str r1, [sp] + movs r0, 0x44 + mov r1, r9 + adds r2, r5, 0 + bl xxx_call_draw_string +_0803BDBC: + movs r0, 0xC + add r9, r0 + ldr r2, _0803BDEC + ldr r3, [r7] + movs r0, 0 + str r0, [sp] + movs r0, 0xA + mov r1, r9 + bl xxx_call_draw_string + adds r0, r7, 0 + adds r0, 0x42 + ldrb r1, [r0] + adds r5, r0, 0 + cmp r1, 0x6 + bhi _0803BEB8 + lsls r0, r1, 2 + ldr r1, _0803BDF0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0803BDE8: .4byte gUnknown_80E8AD0 +_0803BDEC: .4byte gUnknown_80E8AE0 +_0803BDF0: .4byte _0803BDF4 + .align 2, 0 +_0803BDF4: + .4byte _0803BE10 + .4byte _0803BE30 + .4byte _0803BE18 + .4byte _0803BE48 + .4byte _0803BE80 + .4byte _0803BE60 + .4byte _0803BEB8 +_0803BE10: + ldr r2, _0803BE14 + b _0803BE4A + .align 2, 0 +_0803BE14: .4byte gUnknown_80E8AEC +_0803BE18: + ldr r4, _0803BE28 + ldrb r1, [r7, 0x14] + adds r0, r4, 0 + movs r2, 0 + bl sub_8090DC4 + ldr r1, _0803BE2C + b _0803BE94 + .align 2, 0 +_0803BE28: .4byte gUnknown_202DE58 +_0803BE2C: .4byte gUnknown_80E8AFC +_0803BE30: + ldr r4, _0803BE40 + ldrb r1, [r7, 0x14] + adds r0, r4, 0 + movs r2, 0 + bl sub_8090DC4 + ldr r1, _0803BE44 + b _0803BE94 + .align 2, 0 +_0803BE40: .4byte gUnknown_202DE58 +_0803BE44: .4byte gUnknown_80E8B10 +_0803BE48: + ldr r2, _0803BE5C +_0803BE4A: + ldr r3, [r7] + movs r0, 0 + str r0, [sp] + movs r0, 0x44 + mov r1, r9 + bl xxx_call_draw_string + b _0803BEC8 + .align 2, 0 +_0803BE5C: .4byte gUnknown_80E8B20 +_0803BE60: + movs r1, 0x12 + ldrsh r0, [r7, r1] + bl sub_808D994 + adds r1, r0, 0 + ldr r4, _0803BE78 + adds r0, r4, 0 + bl strcpy + ldr r1, _0803BE7C + b _0803BE94 + .align 2, 0 +_0803BE78: .4byte gUnknown_202DF98 +_0803BE7C: .4byte gUnknown_80E8B2C +_0803BE80: + movs r1, 0x12 + ldrsh r0, [r7, r1] + bl sub_808D994 + adds r1, r0, 0 + ldr r4, _0803BEB0 + adds r0, r4, 0 + bl strcpy + ldr r1, _0803BEB4 +_0803BE94: + add r0, sp, 0x4 + adds r2, r4, 0 + bl sub_800D158 + ldr r3, [r7] + movs r0, 0 + str r0, [sp] + movs r0, 0x44 + mov r1, r9 + add r2, sp, 0x4 + bl xxx_call_draw_string + b _0803BEC8 + .align 2, 0 +_0803BEB0: .4byte gUnknown_202DF98 +_0803BEB4: .4byte gUnknown_80E8B40 +_0803BEB8: + ldr r2, _0803BEF8 + ldr r3, [r7] + movs r0, 0 + str r0, [sp] + movs r0, 0x44 + mov r1, r9 + bl xxx_call_draw_string +_0803BEC8: + movs r0, 0xC + add r9, r0 + ldr r2, _0803BEFC + ldr r3, [r7] + movs r0, 0 + str r0, [sp] + movs r0, 0xA + mov r1, r9 + bl xxx_call_draw_string + ldrb r0, [r5] + cmp r0, 0x1 + bne _0803BF04 + add r4, sp, 0x180 + ldr r1, [r7, 0x8] + adds r0, r4, 0 + bl sub_8090228 + ldr r1, _0803BF00 + add r0, sp, 0x4 + adds r2, r4, 0 + bl sub_800D158 + b _0803BF0C + .align 2, 0 +_0803BEF8: .4byte gUnknown_80E8B50 +_0803BEFC: .4byte gUnknown_80E8B60 +_0803BF00: .4byte gUnknown_80E8884 +_0803BF04: + ldr r1, [r7, 0x8] + add r0, sp, 0x4 + bl sub_8090228 +_0803BF0C: + ldr r3, [r7] + movs r0, 0 + str r0, [sp] + movs r0, 0x44 + mov r1, r9 + add r2, sp, 0x4 + bl xxx_call_draw_string + ldrb r0, [r5] + cmp r0, 0 + bne _0803BF28 + ldr r0, [r7, 0x8] + movs r1, 0 + b _0803BF2E +_0803BF28: + ldr r0, [r7, 0x8] + ldr r1, [r7, 0x54] + ldrb r1, [r1, 0x1] +_0803BF2E: + bl sub_803C1D0 + lsls r0, 24 + lsrs r4, r0, 24 + movs r1, 0xC + add r9, r1 + ldr r2, _0803BF88 + ldr r3, [r7] + movs r6, 0 + str r6, [sp] + movs r0, 0xA + mov r1, r9 + bl xxx_call_draw_string + adds r0, r4, 0 + bl sub_803C1F0 + adds r2, r0, 0 + ldr r3, [r7] + str r6, [sp] + movs r0, 0x44 + mov r1, r9 + bl xxx_call_draw_string + movs r0, 0xC + add r9, r0 + ldr r2, _0803BF8C + ldr r3, [r7] + str r6, [sp] + movs r0, 0xA + mov r1, r9 + bl xxx_call_draw_string + adds r0, r7, 0 + adds r0, 0x2E + ldrb r2, [r0] + adds r5, r0, 0 + cmp r2, 0x4 + bhi _0803C02C + lsls r0, r2, 2 + ldr r1, _0803BF90 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0803BF88: .4byte gUnknown_80E8B68 +_0803BF8C: .4byte gUnknown_80E8B74 +_0803BF90: .4byte _0803BF94 + .align 2, 0 +_0803BF94: + .4byte _0803BFA8 + .4byte _0803BFBC + .4byte _0803BFD0 + .4byte _0803BFD0 + .4byte _0803C00C +_0803BFA8: + ldr r1, _0803BFB8 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + ldr r2, [r7, 0x30] + add r0, sp, 0x4 + b _0803BFEE + .align 2, 0 +_0803BFB8: .4byte gUnknown_80E8C48 +_0803BFBC: + ldr r1, _0803BFCC + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + ldr r2, [r7, 0x30] + add r0, sp, 0x4 + b _0803BFEE + .align 2, 0 +_0803BFCC: .4byte gUnknown_80E8C48 +_0803BFD0: + ldr r4, _0803C004 + adds r0, r7, 0 + adds r0, 0x34 + ldrb r1, [r0] + adds r0, r4, 0 + movs r2, 0 + bl sub_8090DC4 + ldr r1, _0803C008 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + add r0, sp, 0x4 + adds r2, r4, 0 +_0803BFEE: + bl sub_800D158 + ldr r3, [r7] + movs r0, 0 + str r0, [sp] + movs r0, 0x44 + mov r1, r9 + add r2, sp, 0x4 + bl xxx_call_draw_string + b _0803C040 + .align 2, 0 +_0803C004: .4byte gUnknown_202DE58 +_0803C008: .4byte gUnknown_80E8C48 +_0803C00C: + ldr r1, _0803C028 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r1 + ldr r2, [r0] + ldr r3, [r7] + movs r0, 0 + str r0, [sp] + movs r0, 0x44 + mov r1, r9 + bl xxx_call_draw_string + b _0803C040 + .align 2, 0 +_0803C028: .4byte gUnknown_80E8C48 +_0803C02C: + ldr r1, _0803C0D4 + lsls r0, r2, 2 + adds r0, r1 + ldr r2, [r0] + ldr r3, [r7] + str r6, [sp] + movs r0, 0x44 + mov r1, r9 + bl xxx_call_draw_string +_0803C040: + movs r1, 0xC + add r9, r1 + adds r0, r7, 0 + adds r0, 0x41 + ldrb r1, [r0] + adds r0, r1, 0 + subs r0, 0x9 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bls _0803C0C6 + cmp r1, 0x3 + beq _0803C0C6 + ldr r0, [r7, 0x54] + ldrb r0, [r0] + cmp r0, 0x5 + bne _0803C0C6 + ldr r2, _0803C0D8 + ldr r3, [r7] + movs r0, 0 + str r0, [sp] + movs r0, 0xA + mov r1, r9 + bl xxx_call_draw_string + add r0, sp, 0x1E4 + ldr r1, [r7, 0x54] + bl sub_803D414 + movs r4, 0 +_0803C07C: + cmp r4, 0xC + bne _0803C084 + movs r0, 0xC + add r9, r0 +_0803C084: + movs r5, 0x7 + cmp r4, 0x3 + ble _0803C09C + movs r5, 0x6 + cmp r4, 0x7 + ble _0803C09C + movs r5, 0x7 + cmp r4, 0xF + ble _0803C09C + cmp r4, 0x13 + bgt _0803C09C + movs r5, 0x6 +_0803C09C: + adds r0, r4, 0 + movs r1, 0xC + bl __modsi3 + adds r1, r0, 0 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 1 + adds r0, 0x54 + add r1, sp, 0x1E4 + adds r1, r4 + ldrb r2, [r1] + ldr r1, [r7] + str r1, [sp] + mov r1, r9 + adds r3, r5, 0 + bl sub_8012C60 + adds r4, 0x1 + cmp r4, 0x17 + ble _0803C07C +_0803C0C6: + add sp, 0x1FC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0803C0D4: .4byte gUnknown_80E8C48 +_0803C0D8: .4byte gUnknown_80E8B7C + thumb_func_end sub_803B98C + + thumb_func_start sub_803C0DC +sub_803C0DC: + push {lr} + lsls r0, 16 + asrs r0, 16 + bl sub_808E770 + lsls r0, 16 + asrs r2, r0, 16 + ldr r1, _0803C0F0 + b _0803C102 + .align 2, 0 +_0803C0F0: .4byte gUnknown_80E80E0 +_0803C0F4: + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, r2 + bne _0803C100 + movs r0, 0 + b _0803C10C +_0803C100: + adds r1, 0x2 +_0803C102: + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0 + bne _0803C0F4 + movs r0, 0x1 +_0803C10C: + pop {r1} + bx r1 + thumb_func_end sub_803C0DC + + thumb_func_start sub_803C110 +sub_803C110: + push {r4,lr} + lsls r0, 16 + asrs r4, r0, 16 + adds r0, r4, 0 + bl sub_8098134 + lsls r0, 24 + cmp r0, 0 + beq _0803C180 + adds r0, r4, 0 + bl sub_808E770 + lsls r0, 16 + asrs r0, 16 + cmp r4, r0 + bne _0803C180 + adds r0, r4, 0 + bl sub_803C0DC + lsls r0, 24 + cmp r0, 0 + beq _0803C180 + movs r0, 0x6 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + bne _0803C188 + ldr r1, _0803C184 + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _0803C168 + adds r2, r1, 0 +_0803C154: + movs r3, 0 + ldrsh r0, [r2, r3] + cmp r0, r4 + beq _0803C180 + adds r1, 0x2 + adds r2, 0x2 + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0 + bne _0803C154 +_0803C168: + bl sub_808D33C + movs r1, 0x8 + ldrsh r0, [r0, r1] + cmp r0, r4 + beq _0803C180 + bl sub_808D378 + movs r2, 0x8 + ldrsh r0, [r0, r2] + cmp r0, r4 + bne _0803C188 +_0803C180: + movs r0, 0 + b _0803C18A + .align 2, 0 +_0803C184: .4byte gUnknown_80E8126 +_0803C188: + movs r0, 0x1 +_0803C18A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_803C110 + + thumb_func_start sub_803C190 +sub_803C190: + lsls r0, 24 + ldr r1, _0803C19C + lsrs r0, 21 + adds r0, r1 + ldr r0, [r0] + bx lr + .align 2, 0 +_0803C19C: .4byte gUnknown_80EBA18 + thumb_func_end sub_803C190 + + thumb_func_start sub_803C1A0 +sub_803C1A0: + lsls r0, 24 + ldr r1, _0803C1B0 + lsrs r0, 21 + adds r1, 0x4 + adds r0, r1 + ldr r0, [r0] + bx lr + .align 2, 0 +_0803C1B0: .4byte gUnknown_80EBA18 + thumb_func_end sub_803C1A0 + + thumb_func_start sub_803C1B4 +sub_803C1B4: + push {r4,lr} + lsls r4, r1, 24 + lsrs r4, 24 + bl sub_80908D8 + cmp r4, 0x2 + bne _0803C1C4 + adds r0, 0x2 +_0803C1C4: + cmp r0, 0xF + ble _0803C1CA + movs r0, 0xF +_0803C1CA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_803C1B4 + + thumb_func_start sub_803C1D0 +sub_803C1D0: + push {lr} + lsls r1, 24 + lsrs r1, 24 + bl sub_803C1B4 + adds r1, r0, 0 + lsrs r0, r1, 31 + adds r0, r1, r0 + asrs r1, r0, 1 + lsls r0, r1, 24 + lsrs r0, 24 + cmp r0, 0x6 + bls _0803C1EC + movs r0, 0x6 +_0803C1EC: + pop {r1} + bx r1 + thumb_func_end sub_803C1D0 + + thumb_func_start sub_803C1F0 +sub_803C1F0: + lsls r0, 24 + ldr r1, _0803C1FC + lsrs r0, 22 + adds r0, r1 + ldr r0, [r0] + bx lr + .align 2, 0 +_0803C1FC: .4byte gUnknown_80E8BF8 + thumb_func_end sub_803C1F0 + + thumb_func_start sub_803C200 +sub_803C200: + push {lr} + lsls r1, 24 + lsrs r1, 24 + bl sub_803C1B4 + ldr r1, _0803C218 + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + pop {r1} + bx r1 + .align 2, 0 +_0803C218: .4byte gUnknown_80E80A0 + thumb_func_end sub_803C200 + + thumb_func_start sub_803C21C +sub_803C21C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + adds r4, r1, 0 + adds r0, r6, 0x4 + ldrb r1, [r6, 0x1] + bl sub_803C1D0 + lsls r0, 24 + lsrs r2, r0, 24 + movs r0, 0 + str r0, [r4, 0x18] + movs r3, 0 + movs r1, 0x2 + adds r0, r4, 0 + adds r0, 0x1E +_0803C23E: + strb r3, [r0] + subs r0, 0x1 + subs r1, 0x1 + cmp r1, 0 + bge _0803C23E + adds r0, r4, 0 + adds r0, 0x20 + movs r1, 0 + strb r1, [r0] + movs r1, 0xA + strb r1, [r4, 0x1F] + ldrb r1, [r6, 0x11] + adds r3, r0, 0 + cmp r1, 0x9 + bhi _0803C354 + lsls r0, r1, 2 + ldr r1, _0803C268 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0803C268: .4byte _0803C26C + .align 2, 0 +_0803C26C: + .4byte _0803C294 + .4byte _0803C2A2 + .4byte _0803C2B4 + .4byte _0803C2BE + .4byte _0803C354 + .4byte _0803C2E0 + .4byte _0803C2EE + .4byte _0803C300 + .4byte _0803C30A + .4byte _0803C34A +_0803C294: + movs r0, 0 + strb r0, [r4, 0x16] + adds r1, r2, 0x1 + movs r0, 0x64 + muls r0, r1 + str r0, [r4, 0x18] + b _0803C358 +_0803C2A2: + movs r0, 0x1 + strb r0, [r4, 0x16] + adds r1, r2, 0x1 + movs r0, 0x64 + muls r0, r1 + str r0, [r4, 0x18] + ldrb r0, [r6, 0x12] + strb r0, [r4, 0x1C] + b _0803C358 +_0803C2B4: + movs r0, 0x2 + strb r0, [r4, 0x16] + ldrb r0, [r6, 0x12] + strb r0, [r4, 0x1C] + b _0803C358 +_0803C2BE: + movs r0, 0x3 + strb r0, [r4, 0x16] + ldrb r0, [r6, 0x12] + strb r0, [r4, 0x1C] + adds r5, r6, 0x4 + adds r7, r4, 0 + adds r7, 0x1D +_0803C2CC: + ldrb r1, [r6, 0x1] + adds r0, r5, 0 + adds r2, r7, 0 + bl sub_803C37C + ldrb r0, [r4, 0x1C] + ldrb r1, [r4, 0x1D] + cmp r0, r1 + beq _0803C2CC + b _0803C35A +_0803C2E0: + movs r0, 0 + strb r0, [r4, 0x16] + adds r1, r2, 0x1 + movs r0, 0xC8 + muls r0, r1 + str r0, [r4, 0x18] + b _0803C358 +_0803C2EE: + movs r0, 0x1 + strb r0, [r4, 0x16] + adds r1, r2, 0x1 + movs r0, 0xC8 + muls r0, r1 + str r0, [r4, 0x18] + ldrb r0, [r6, 0x12] + strb r0, [r4, 0x1C] + b _0803C358 +_0803C300: + movs r0, 0x2 + strb r0, [r4, 0x16] + ldrb r0, [r6, 0x12] + strb r0, [r4, 0x1C] + b _0803C358 +_0803C30A: + movs r0, 0x3 + strb r0, [r4, 0x16] + ldrb r0, [r6, 0x12] + strb r0, [r4, 0x1C] + adds r5, r6, 0x4 + adds r7, r4, 0 + adds r7, 0x1D + movs r0, 0x1E + adds r0, r4 + mov r8, r0 +_0803C31E: + ldrb r1, [r6, 0x1] + adds r0, r5, 0 + adds r2, r7, 0 + bl sub_803C37C + ldrb r0, [r4, 0x1C] + ldrb r1, [r4, 0x1D] + cmp r0, r1 + beq _0803C31E +_0803C330: + ldrb r1, [r6, 0x1] + adds r0, r5, 0 + mov r2, r8 + bl sub_803C37C + ldrb r0, [r4, 0x1C] + ldrb r1, [r4, 0x1E] + cmp r0, r1 + beq _0803C330 + ldrb r0, [r4, 0x1D] + cmp r0, r1 + beq _0803C330 + b _0803C35A +_0803C34A: + movs r0, 0x4 + strb r0, [r4, 0x16] + ldrb r0, [r6, 0x13] + strb r0, [r3] + b _0803C358 +_0803C354: + movs r0, 0x5 + strb r0, [r4, 0x16] +_0803C358: + adds r5, r6, 0x4 +_0803C35A: + movs r0, 0xC + ldrsh r1, [r6, r0] + adds r0, r4, 0 + bl sub_808D8E0 + ldrh r0, [r6, 0xC] + strh r0, [r4, 0x14] + ldrb r1, [r6, 0x1] + adds r0, r5, 0 + bl sub_803C200 + str r0, [r4, 0x24] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_803C21C + + thumb_func_start sub_803C37C +sub_803C37C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + mov r8, r2 + lsls r1, 24 + lsrs r1, 24 + bl sub_803C1B4 + adds r7, r0, 0 + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_8090910 +_0803C398: + movs r5, 0 + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_8090910 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0xEA + bne _0803C3BA + movs r0, 0 + movs r1, 0x47 + movs r2, 0x1 + bl sub_8001784 + negs r1, r0 + orrs r1, r0 + lsrs r5, r1, 31 +_0803C3BA: + cmp r4, 0xEB + bne _0803C3CE + movs r0, 0 + movs r1, 0x47 + movs r2, 0 + bl sub_8001784 + cmp r0, 0 + beq _0803C3CE + movs r5, 0x1 +_0803C3CE: + cmp r5, 0 + bne _0803C398 + mov r0, r8 + strb r4, [r0] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_803C37C + + thumb_func_start sub_803C3E0 +sub_803C3E0: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x54 + adds r7, r0, 0 + movs r6, 0 + ldr r5, _0803C42C + movs r4, 0 + mov r8, sp +_0803C3F2: + movs r1, 0 + ldrsh r0, [r5, r1] + bl sub_803C110 + lsls r0, 24 + cmp r0, 0 + beq _0803C41A + movs r1, 0x2 + ldrsh r0, [r5, r1] + bl sub_803C110 + lsls r0, 24 + cmp r0, 0 + beq _0803C41A + mov r0, r8 + adds r0, 0x4 + mov r8, r0 + subs r0, 0x4 + stm r0!, {r4} + adds r6, 0x1 +_0803C41A: + adds r5, 0x8 + adds r4, 0x1 + cmp r4, 0x14 + ble _0803C3F2 + ldr r5, _0803C42C + cmp r6, 0 + bne _0803C430 + movs r0, 0 + b _0803C44E + .align 2, 0 +_0803C42C: .4byte gUnknown_80E9920 +_0803C430: + adds r0, r6, 0 + bl RandomCapped + lsls r0, 2 + add r0, sp + ldr r4, [r0] + lsls r0, r4, 3 + adds r5, r0, r5 + ldrh r0, [r5] + strh r0, [r7, 0xC] + ldrh r0, [r5, 0x2] + strh r0, [r7, 0xE] + movs r0, 0x7 + strb r0, [r7, 0x2] + movs r0, 0x1 +_0803C44E: + add sp, 0x54 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_803C3E0 + + thumb_func_start sub_803C45C +sub_803C45C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xB4 + adds r7, r0, 0 + movs r6, 0 + ldr r5, _0803C4CC + movs r4, 0 + mov r8, sp +_0803C46E: + movs r1, 0 + ldrsh r0, [r5, r1] + bl sub_803C110 + lsls r0, 24 + cmp r0, 0 + beq _0803C496 + movs r1, 0x2 + ldrsh r0, [r5, r1] + bl sub_803C110 + lsls r0, 24 + cmp r0, 0 + beq _0803C496 + mov r0, r8 + adds r0, 0x4 + mov r8, r0 + subs r0, 0x4 + stm r0!, {r4} + adds r6, 0x1 +_0803C496: + adds r5, 0xC + adds r4, 0x1 + cmp r4, 0x2C + ble _0803C46E + ldr r5, _0803C4CC + cmp r6, 0 + beq _0803C4E0 + adds r0, r6, 0 + bl RandomCapped + lsls r0, 2 + add r0, sp + ldr r4, [r0] + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r5, r0, r5 + bl Random + movs r1, 0x10 + ands r1, r0 + cmp r1, 0 + beq _0803C4D0 + ldrh r0, [r5] + strh r0, [r7, 0xC] + ldrh r0, [r5, 0x2] + b _0803C4D6 + .align 2, 0 +_0803C4CC: .4byte gUnknown_80E9F8C +_0803C4D0: + ldrh r0, [r5, 0x2] + strh r0, [r7, 0xC] + ldrh r0, [r5] +_0803C4D6: + strh r0, [r7, 0xE] + movs r0, 0x8 + strb r0, [r7, 0x2] + movs r0, 0x1 + b _0803C4E2 +_0803C4E0: + movs r0, 0 +_0803C4E2: + add sp, 0xB4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_803C45C + + thumb_func_start sub_803C4F0 +sub_803C4F0: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x18 + adds r7, r0, 0 + movs r6, 0 + ldr r5, _0803C55C + movs r4, 0 + mov r8, sp +_0803C502: + movs r1, 0 + ldrsh r0, [r5, r1] + bl sub_803C110 + lsls r0, 24 + cmp r0, 0 + beq _0803C52A + movs r1, 0x2 + ldrsh r0, [r5, r1] + bl sub_803C110 + lsls r0, 24 + cmp r0, 0 + beq _0803C52A + mov r0, r8 + adds r0, 0x4 + mov r8, r0 + subs r0, 0x4 + stm r0!, {r4} + adds r6, 0x1 +_0803C52A: + adds r5, 0x4 + adds r4, 0x1 + cmp r4, 0x5 + ble _0803C502 + ldr r5, _0803C55C + cmp r6, 0 + beq _0803C570 + adds r0, r6, 0 + bl RandomCapped + lsls r0, 2 + add r0, sp + ldr r4, [r0] + lsls r0, r4, 2 + adds r5, r0, r5 + bl Random + movs r1, 0x10 + ands r1, r0 + cmp r1, 0 + beq _0803C560 + ldrh r0, [r5] + strh r0, [r7, 0xC] + ldrh r0, [r5, 0x2] + b _0803C566 + .align 2, 0 +_0803C55C: .4byte gUnknown_80E8168 +_0803C560: + ldrh r0, [r5, 0x2] + strh r0, [r7, 0xC] + ldrh r0, [r5] +_0803C566: + strh r0, [r7, 0xE] + movs r0, 0x9 + strb r0, [r7, 0x2] + movs r0, 0x1 + b _0803C572 +_0803C570: + movs r0, 0 +_0803C572: + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_803C4F0 + + thumb_func_start sub_803C580 +sub_803C580: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x54 + adds r6, r0, 0 + movs r7, 0 + ldr r5, _0803C5D8 + movs r0, 0x6 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _0803C5D2 + movs r4, 0 + mov r8, sp +_0803C59E: + movs r1, 0 + ldrsh r0, [r5, r1] + bl sub_803C110 + lsls r0, 24 + cmp r0, 0 + beq _0803C5C6 + ldrb r0, [r6, 0x4] + ldrb r1, [r5, 0x2] + bl sub_8091E60 + lsls r0, 24 + cmp r0, 0 + beq _0803C5C6 + mov r0, r8 + adds r0, 0x4 + mov r8, r0 + subs r0, 0x4 + stm r0!, {r4} + adds r7, 0x1 +_0803C5C6: + adds r5, 0x4 + adds r4, 0x1 + cmp r4, 0x14 + ble _0803C59E + cmp r7, 0 + bne _0803C5DC +_0803C5D2: + movs r0, 0 + b _0803C600 + .align 2, 0 +_0803C5D8: .4byte gUnknown_80E8180 +_0803C5DC: + adds r0, r7, 0 + bl RandomCapped + lsls r0, 2 + add r0, sp + ldr r4, [r0] + lsls r1, r4, 2 + ldr r0, _0803C60C + adds r5, r1, r0 + ldrh r0, [r5] + strh r0, [r6, 0xC] + ldrh r0, [r5] + strh r0, [r6, 0xE] + ldrb r0, [r5, 0x2] + strb r0, [r6, 0x10] + movs r0, 0x5 + strb r0, [r6, 0x2] + movs r0, 0x1 +_0803C600: + add sp, 0x54 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0803C60C: .4byte gUnknown_80E8180 + thumb_func_end sub_803C580 + + thumb_func_start sub_803C610 +sub_803C610: + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, _0803C660 + add sp, r4 + adds r6, r0, 0 + movs r7, 0 + ldr r4, _0803C664 + movs r5, 0 + mov r8, sp +_0803C624: + movs r1, 0 + ldrsh r0, [r4, r1] + bl sub_803C110 + lsls r0, 24 + cmp r0, 0 + beq _0803C64C + ldrb r0, [r6, 0x4] + ldrb r1, [r4, 0x2] + bl sub_8091E60 + lsls r0, 24 + cmp r0, 0 + beq _0803C64C + mov r0, r8 + adds r0, 0x4 + mov r8, r0 + subs r0, 0x4 + stm r0!, {r5} + adds r7, 0x1 +_0803C64C: + adds r4, 0x4 + adds r5, 0x1 + ldr r0, _0803C668 + cmp r5, r0 + ble _0803C624 + cmp r7, 0 + bne _0803C66C + movs r0, 0 + b _0803C690 + .align 2, 0 +_0803C660: .4byte 0xfffff9f8 +_0803C664: .4byte gUnknown_80E81D4 +_0803C668: .4byte 0x00000181 +_0803C66C: + adds r0, r7, 0 + bl RandomCapped + lsls r0, 2 + add r0, sp + ldr r5, [r0] + lsls r1, r5, 2 + ldr r0, _0803C6A0 + adds r4, r1, r0 + ldrh r0, [r4] + strh r0, [r6, 0xC] + ldrh r0, [r4] + strh r0, [r6, 0xE] + ldrb r0, [r4, 0x2] + strb r0, [r6, 0x10] + movs r0, 0x6 + strb r0, [r6, 0x2] + movs r0, 0x1 +_0803C690: + movs r3, 0xC1 + lsls r3, 3 + add sp, r3 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0803C6A0: .4byte gUnknown_80E81D4 + thumb_func_end sub_803C610 + + thumb_func_start sub_803C6A4 +sub_803C6A4: + push {r4,lr} + ldr r4, _0803C6CC + movs r0, 0xC0 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r4] + adds r0, 0xB4 + bl sub_801317C + bl sub_803C6D0 + movs r0, 0x1 + bl sub_8099690 + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0803C6CC: .4byte gUnknown_203B400 + thumb_func_end sub_803C6A4 + + thumb_func_start sub_803C6D0 +sub_803C6D0: + push {r4,r5,lr} + ldr r4, _0803C72C + ldr r0, [r4] + adds r0, 0x4 + bl sub_8001024 + ldr r1, [r4] + movs r0, 0 + str r0, [r1] + str r0, [r1, 0x34] + str r0, [r1, 0x38] + movs r2, 0 + movs r5, 0 + adds r3, r4, 0 +_0803C6EC: + ldr r0, [r4] + lsls r1, r2, 2 + adds r0, 0x44 + adds r0, r1 + str r5, [r0] + adds r2, 0x1 + cmp r2, 0xC + ble _0803C6EC + ldr r1, [r3] + movs r0, 0 + str r0, [r1, 0x3C] + movs r2, 0 + adds r4, r3, 0 + movs r1, 0 +_0803C708: + ldr r0, [r4] + adds r0, 0x78 + adds r0, r2 + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x36 + ble _0803C708 + ldr r0, [r3] + adds r0, 0x40 + movs r1, 0 + strb r1, [r0] + ldr r0, [r3] + adds r0, 0xB0 + str r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0803C72C: .4byte gUnknown_203B400 + thumb_func_end sub_803C6D0 + + thumb_func_start sub_803C730 +sub_803C730: + push {r4,r5,lr} + ldr r0, _0803C750 + ldr r1, [r0] + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r0, [r1, 0x34] + cmp r0, 0xF + bls _0803C744 + b _0803C848 +_0803C744: + lsls r0, 2 + ldr r1, _0803C754 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0803C750: .4byte gUnknown_203B400 +_0803C754: .4byte _0803C758 + .align 2, 0 +_0803C758: + .4byte _0803C798 + .4byte _0803C79E + .4byte _0803C7A4 + .4byte _0803C7AA + .4byte _0803C7B0 + .4byte _0803C7B6 + .4byte _0803C7BC + .4byte _0803C7C2 + .4byte _0803C7C8 + .4byte _0803C7CE + .4byte _0803C7D4 + .4byte _0803C7DA + .4byte _0803C7E0 + .4byte _0803C7E6 + .4byte _0803C7EC + .4byte _0803C7F2 +_0803C798: + bl sub_803C870 + b _0803C848 +_0803C79E: + bl sub_803C908 + b _0803C848 +_0803C7A4: + bl sub_803C920 + b _0803C848 +_0803C7AA: + bl sub_803C98C + b _0803C848 +_0803C7B0: + bl sub_803C9D8 + b _0803C848 +_0803C7B6: + bl sub_803CA54 + b _0803C848 +_0803C7BC: + bl sub_803CA8C + b _0803C848 +_0803C7C2: + bl sub_803CAAC + b _0803C848 +_0803C7C8: + bl sub_803CAD4 + b _0803C848 +_0803C7CE: + bl sub_803CAF4 + b _0803C848 +_0803C7D4: + bl sub_803CB14 + b _0803C848 +_0803C7DA: + bl sub_803CB5C + b _0803C848 +_0803C7E0: + bl sub_803CB7C + b _0803C848 +_0803C7E6: + bl sub_803CBB0 + b _0803C848 +_0803C7EC: + bl sub_803CBE4 + b _0803C848 +_0803C7F2: + bl Random + ldr r4, _0803C844 + ldr r1, [r4] + ldr r1, [r1] + adds r5, r0, 0 + muls r5, r1 + bl Random + bl sub_8094D28 + movs r1, 0 + ldr r0, [r4] + adds r2, r0, 0 + adds r2, 0x44 +_0803C810: + ldm r2!, {r0} + adds r0, r1 + adds r0, 0x3 + muls r5, r0 + adds r1, 0x1 + cmp r1, 0xC + ble _0803C810 + bl sub_8094E4C + adds r5, r0 + movs r0, 0x1 + negs r0, r0 + cmp r5, r0 + bne _0803C838 + adds r4, r5, 0 +_0803C82E: + bl sub_8094E4C + adds r5, r0 + cmp r5, r4 + beq _0803C82E +_0803C838: + adds r0, r5, 0 + bl sub_8011C40 + movs r0, 0x3 + b _0803C84A + .align 2, 0 +_0803C844: .4byte gUnknown_203B400 +_0803C848: + movs r0, 0 +_0803C84A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_803C730 + + thumb_func_start sub_803C850 +sub_803C850: + push {r4,lr} + ldr r4, _0803C86C + ldr r0, [r4] + adds r0, 0x4 + bl sub_8001044 + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0803C86C: .4byte gUnknown_203B400 + thumb_func_end sub_803C850 + + thumb_func_start sub_803C870 +sub_803C870: + push {r4-r6,lr} + sub sp, 0x14 + ldr r5, _0803C8A4 + ldr r1, [r5] + ldr r0, [r1, 0x38] + adds r0, 0x1 + str r0, [r1, 0x38] + cmp r0, 0x8 + ble _0803C8B4 + ldr r0, _0803C8A8 + ldr r3, _0803C8AC + movs r1, 0 + str r1, [sp] + movs r4, 0x3 + str r4, [sp, 0x4] + str r1, [sp, 0x8] + str r1, [sp, 0xC] + ldr r1, _0803C8B0 + str r1, [sp, 0x10] + movs r1, 0 + movs r2, 0 + bl sub_8014248 + ldr r0, [r5] + str r4, [r0, 0x34] + b _0803C8F8 + .align 2, 0 +_0803C8A4: .4byte gUnknown_203B400 +_0803C8A8: .4byte gUnknown_80F273C +_0803C8AC: .4byte gUnknown_80F275C +_0803C8B0: .4byte 0x00000101 +_0803C8B4: + adds r4, r5, 0 +_0803C8B6: + movs r0, 0x37 + bl RandomCapped + ldr r1, [r4] + str r0, [r1, 0x3C] + adds r1, 0x78 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x1 + beq _0803C8B6 + ldr r2, _0803C900 + ldr r1, _0803C904 + ldr r0, [r1] + ldr r0, [r0, 0x3C] + adds r0, r2 + ldrb r4, [r0] + movs r3, 0 + adds r6, r1, 0 + movs r5, 0x1 +_0803C8DC: + adds r0, r3, r2 + ldrb r0, [r0] + cmp r0, r4 + bne _0803C8EC + ldr r0, [r1] + adds r0, 0x78 + adds r0, r3 + strb r5, [r0] +_0803C8EC: + adds r3, 0x1 + cmp r3, 0x36 + ble _0803C8DC + ldr r1, [r6] + movs r0, 0x1 + str r0, [r1, 0x34] +_0803C8F8: + add sp, 0x14 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0803C900: .4byte gUnknown_80F2704 +_0803C904: .4byte gUnknown_203B400 + thumb_func_end sub_803C870 + + thumb_func_start sub_803C908 +sub_803C908: + push {lr} + bl sub_803CC04 + ldr r0, _0803C91C + ldr r1, [r0] + movs r0, 0x2 + str r0, [r1, 0x34] + pop {r0} + bx r0 + .align 2, 0 +_0803C91C: .4byte gUnknown_203B400 + thumb_func_end sub_803C908 + + thumb_func_start sub_803C920 +sub_803C920: + push {r4-r6,lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0803C97C + ldr r3, [sp] + cmp r3, 0x63 + bne _0803C944 + ldr r0, _0803C940 + ldr r1, [r0] + movs r0, 0x37 + str r0, [r1, 0x3C] + movs r0, 0x1 + b _0803C97A + .align 2, 0 +_0803C940: .4byte gUnknown_203B400 +_0803C944: + ldr r1, _0803C984 + ldr r2, _0803C988 + ldr r0, [r2] + ldr r0, [r0, 0x3C] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ldr r4, [r0, 0x8] + lsls r0, r3, 4 + adds r4, r0 + movs r3, 0 + adds r6, r2, 0 + adds r5, r6, 0 +_0803C95E: + ldr r1, [r5] + lsls r0, r3, 2 + adds r1, 0x44 + adds r1, r0 + adds r0, r4, r3 + ldrb r2, [r0] + ldr r0, [r1] + adds r0, r2 + str r0, [r1] + adds r3, 0x1 + cmp r3, 0xC + ble _0803C95E + ldr r1, [r6] + movs r0, 0 +_0803C97A: + str r0, [r1, 0x34] +_0803C97C: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0803C984: .4byte gUnknown_80F2624 +_0803C988: .4byte gUnknown_203B400 + thumb_func_end sub_803C920 + + thumb_func_start sub_803C98C +sub_803C98C: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0803C9CA + ldr r1, [sp] + cmp r1, 0 + bne _0803C9AC + ldr r0, _0803C9A8 + ldr r0, [r0] + adds r0, 0xB0 + b _0803C9B4 + .align 2, 0 +_0803C9A8: .4byte gUnknown_203B400 +_0803C9AC: + ldr r0, _0803C9D0 + ldr r0, [r0] + adds r0, 0xB0 + movs r1, 0x1 +_0803C9B4: + str r1, [r0] + ldr r0, _0803C9D4 + ldr r0, [r0] + strb r1, [r0, 0xB] + movs r0, 0 + bl sub_8099690 + ldr r0, _0803C9D0 + ldr r1, [r0] + movs r0, 0x4 + str r0, [r1, 0x34] +_0803C9CA: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_0803C9D0: .4byte gUnknown_203B400 +_0803C9D4: .4byte gUnknown_203B46C + thumb_func_end sub_803C98C + + thumb_func_start sub_803C9D8 +sub_803C9D8: + push {r4-r7,lr} + movs r0, 0xD + bl RandomCapped + ldr r2, _0803CA4C + ldr r1, [r2] + adds r1, 0x40 + strb r0, [r1] + ldr r0, [r2] + adds r0, 0x40 + ldrb r3, [r0] + adds r7, r2, 0 + movs r5, 0xB +_0803C9F2: + adds r3, 0x1 + cmp r3, 0xC + ble _0803C9FA + movs r3, 0 +_0803C9FA: + ldr r0, [r7] + lsls r2, r3, 2 + adds r1, r0, 0 + adds r1, 0x44 + adds r2, r1, r2 + adds r4, r0, 0 + adds r4, 0x40 + ldrb r0, [r4] + lsls r0, 2 + adds r1, r0 + ldr r2, [r2] + ldr r0, [r1] + ldr r6, _0803CA4C + cmp r2, r0 + ble _0803CA1A + strb r3, [r4] +_0803CA1A: + subs r5, 0x1 + cmp r5, 0 + bge _0803C9F2 + ldr r3, [r6] + ldr r2, _0803CA50 + adds r0, r3, 0 + adds r0, 0xB0 + ldr r1, [r0] + lsls r1, 1 + subs r0, 0x70 + ldrb r0, [r0] + lsls r0, 2 + adds r1, r0 + adds r1, r2 + ldrh r0, [r1] + strh r0, [r3, 0x8] + bl sub_803CC40 + ldr r1, [r6] + movs r0, 0x5 + str r0, [r1, 0x34] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0803CA4C: .4byte gUnknown_203B400 +_0803CA50: .4byte gUnknown_80F278E + thumb_func_end sub_803C9D8 + + thumb_func_start sub_803CA54 +sub_803CA54: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0803CA7A + ldr r0, _0803CA80 + ldr r3, _0803CA84 + movs r1, 0 + movs r2, 0 + bl sub_80141B4 + bl sub_803CC80 + ldr r0, _0803CA88 + ldr r1, [r0] + movs r0, 0x6 + str r0, [r1, 0x34] +_0803CA7A: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_0803CA80: .4byte gUnknown_80F27C4 +_0803CA84: .4byte 0x00000101 +_0803CA88: .4byte gUnknown_203B400 + thumb_func_end sub_803CA54 + + thumb_func_start sub_803CA8C +sub_803CA8C: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0803CAA2 + ldr r0, _0803CAA8 + ldr r1, [r0] + movs r0, 0x7 + str r0, [r1, 0x34] +_0803CAA2: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_0803CAA8: .4byte gUnknown_203B400 + thumb_func_end sub_803CA8C + + thumb_func_start sub_803CAAC +sub_803CAAC: + push {lr} + ldr r0, _0803CAC8 + ldr r3, _0803CACC + movs r1, 0 + movs r2, 0 + bl sub_80141B4 + ldr r0, _0803CAD0 + ldr r1, [r0] + movs r0, 0x8 + str r0, [r1, 0x34] + pop {r0} + bx r0 + .align 2, 0 +_0803CAC8: .4byte gUnknown_80F27DC +_0803CACC: .4byte 0x00000301 +_0803CAD0: .4byte gUnknown_203B400 + thumb_func_end sub_803CAAC + + thumb_func_start sub_803CAD4 +sub_803CAD4: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0803CAEA + ldr r0, _0803CAF0 + ldr r1, [r0] + movs r0, 0x9 + str r0, [r1, 0x34] +_0803CAEA: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_0803CAF0: .4byte gUnknown_203B400 + thumb_func_end sub_803CAD4 + + thumb_func_start sub_803CAF4 +sub_803CAF4: + push {r4,lr} + ldr r4, _0803CB10 + ldr r0, [r4] + movs r1, 0x8 + ldrsh r0, [r0, r1] + bl sub_803CD08 + ldr r1, [r4] + movs r0, 0xA + str r0, [r1, 0x34] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0803CB10: .4byte gUnknown_203B400 + thumb_func_end sub_803CAF4 + + thumb_func_start sub_803CB14 +sub_803CB14: + push {r4,r5,lr} + bl sub_803CDC0 + lsls r0, 16 + lsrs r5, r0, 16 + ldr r0, _0803CB4C + cmp r5, r0 + beq _0803CB46 + subs r0, 0x1 + cmp r5, r0 + beq _0803CB46 + bl sub_803CE6C + ldr r4, _0803CB50 + ldr r0, [r4] + strh r5, [r0, 0xA] + ldr r0, _0803CB54 + ldr r3, _0803CB58 + movs r1, 0 + movs r2, 0 + bl sub_80141B4 + ldr r1, [r4] + movs r0, 0xB + str r0, [r1, 0x34] +_0803CB46: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0803CB4C: .4byte 0x0000ffff +_0803CB50: .4byte gUnknown_203B400 +_0803CB54: .4byte gUnknown_80F286C +_0803CB58: .4byte 0x00000301 + thumb_func_end sub_803CB14 + + thumb_func_start sub_803CB5C +sub_803CB5C: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0803CB72 + ldr r0, _0803CB78 + ldr r1, [r0] + movs r0, 0xC + str r0, [r1, 0x34] +_0803CB72: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_0803CB78: .4byte gUnknown_203B400 + thumb_func_end sub_803CB5C + + thumb_func_start sub_803CB7C +sub_803CB7C: + push {r4,r5,lr} + ldr r4, _0803CBAC + ldr r0, [r4] + adds r5, r0, 0 + adds r5, 0x20 + movs r1, 0xA + ldrsh r0, [r0, r1] + bl sub_808D994 + adds r1, r0, 0 + adds r0, r5, 0 + bl sub_80922F4 + ldr r1, [r4] + adds r1, 0x20 + movs r0, 0x3 + bl sub_801602C + ldr r1, [r4] + movs r0, 0xD + str r0, [r1, 0x34] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0803CBAC: .4byte gUnknown_203B400 + thumb_func_end sub_803CB7C + + thumb_func_start sub_803CBB0 +sub_803CBB0: + push {lr} + bl sub_8016080 + cmp r0, 0 + beq _0803CBD2 + bl sub_80160D8 + ldr r0, _0803CBD8 + ldr r3, _0803CBDC + movs r1, 0 + movs r2, 0 + bl sub_80141B4 + ldr r0, _0803CBE0 + ldr r1, [r0] + movs r0, 0xE + str r0, [r1, 0x34] +_0803CBD2: + pop {r0} + bx r0 + .align 2, 0 +_0803CBD8: .4byte gUnknown_80F2898 +_0803CBDC: .4byte 0x00000301 +_0803CBE0: .4byte gUnknown_203B400 + thumb_func_end sub_803CBB0 + + thumb_func_start sub_803CBE4 +sub_803CBE4: + push {lr} + sub sp, 0x4 + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0803CBFA + ldr r0, _0803CC00 + ldr r1, [r0] + movs r0, 0xF + str r0, [r1, 0x34] +_0803CBFA: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_0803CC00: .4byte gUnknown_203B400 + thumb_func_end sub_803CBE4 + + thumb_func_start sub_803CC04 +sub_803CC04: + push {lr} + sub sp, 0x14 + ldr r1, _0803CC38 + ldr r0, _0803CC3C + ldr r0, [r0] + ldr r0, [r0, 0x3C] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + ldr r0, [r1] + ldr r3, [r1, 0x4] + movs r2, 0 + str r2, [sp] + movs r1, 0x3 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + str r2, [sp, 0xC] + adds r1, 0xFE + str r1, [sp, 0x10] + movs r1, 0 + bl sub_8014248 + add sp, 0x14 + pop {r0} + bx r0 + .align 2, 0 +_0803CC38: .4byte gUnknown_80F2624 +_0803CC3C: .4byte gUnknown_203B400 + thumb_func_end sub_803CC04 + + thumb_func_start sub_803CC40 +sub_803CC40: + push {r4,lr} + ldr r0, _0803CC70 + ldr r4, _0803CC74 + ldr r1, [r4] + movs r2, 0x8 + ldrsh r1, [r1, r2] + bl sub_808D8BC + ldr r1, _0803CC78 + ldr r0, [r4] + adds r0, 0x40 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + ldr r3, _0803CC7C + movs r1, 0 + movs r2, 0 + bl sub_80141B4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0803CC70: .4byte gUnknown_202DF98 +_0803CC74: .4byte gUnknown_203B400 +_0803CC78: .4byte gUnknown_80F28F4 +_0803CC7C: .4byte 0x00000101 + thumb_func_end sub_803CC40 + + thumb_func_start sub_803CC80 +sub_803CC80: + push {r4-r7,lr} + sub sp, 0x60 + ldr r0, _0803CD00 + ldr r0, [r0] + movs r1, 0x8 + ldrsh r4, [r0, r1] + mov r0, sp + bl sub_8006518 + add r1, sp, 0x18 + ldr r0, _0803CD04 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + bl sub_8004914 + mov r0, sp + movs r1, 0x1 + movs r2, 0 + bl sub_800641C + movs r0, 0x1 + bl sub_8008C54 + movs r0, 0x1 + bl sub_80073B8 + adds r0, r4, 0 + bl sub_808DDD0 + adds r5, r0, 0 + ldr r0, [r5, 0x4] + ldr r6, [r0, 0xC] + movs r4, 0 + movs r7, 0x8 +_0803CCC8: + adds r0, r4, 0 + adds r0, 0xE0 + ldr r1, [r5, 0x4] + adds r1, r7 + lsls r2, r4, 2 + ldr r1, [r1] + adds r1, r2 + bl SetBGPaletteBufferColorArray + adds r4, 0x1 + cmp r4, 0xF + ble _0803CCC8 + movs r0, 0x1 + adds r1, r6, 0 + movs r2, 0xE + bl sub_800836C + adds r0, r5, 0 + bl sub_800AA14 + movs r0, 0x1 + bl sub_80073E0 + add sp, 0x60 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0803CD00: .4byte gUnknown_203B400 +_0803CD04: .4byte gUnknown_80F4244 + thumb_func_end sub_803CC80 + + thumb_func_start sub_803CD08 +sub_803CD08: + push {r4-r7,lr} + adds r4, r0, 0 + lsls r4, 16 + asrs r4, 16 + bl sub_803CEAC + ldr r5, _0803CDB0 + ldr r0, [r5] + movs r3, 0 + movs r1, 0 + strh r4, [r0] + str r1, [r0, 0x4C] + adds r1, r0, 0 + adds r1, 0x54 + str r1, [r0, 0x50] + ldr r0, _0803CDB4 + ldm r0!, {r2,r4,r6} + stm r1!, {r2,r4,r6} + ldm r0!, {r2,r4,r7} + stm r1!, {r2,r4,r7} + ldr r1, [r5] + adds r1, 0x6C + ldr r0, _0803CDB8 + ldm r0!, {r2,r6,r7} + stm r1!, {r2,r6,r7} + ldm r0!, {r4,r6,r7} + stm r1!, {r4,r6,r7} + ldr r1, [r5] + ldr r2, _0803CDBC + adds r1, 0x84 + adds r0, r2, 0 + ldm r0!, {r4,r6,r7} + stm r1!, {r4,r6,r7} + ldm r0!, {r4,r6,r7} + stm r1!, {r4,r6,r7} + ldr r0, [r5] + adds r0, 0x9C + ldm r2!, {r1,r4,r6} + stm r0!, {r1,r4,r6} + ldm r2!, {r1,r4,r7} + stm r0!, {r1,r4,r7} + ldr r0, [r5] + ldr r1, [r0, 0x50] + adds r0, 0xB4 + str r0, [r1, 0x14] + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r5] + adds r0, 0xB5 + strb r3, [r0] + ldr r0, [r5] + adds r0, 0xB6 + movs r1, 0x6 + strb r1, [r0] + ldr r0, [r5] + adds r0, 0xB7 + strb r3, [r0] + bl sub_8004914 + ldr r0, [r5] + adds r0, 0x54 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r4, [r5] + adds r4, 0x18 + bl sub_803D030 + adds r1, r0, 0 + ldr r0, [r5] + ldr r3, [r0, 0x4C] + adds r0, r4, 0 + movs r2, 0xA + bl sub_8013818 + bl sub_803CEF0 + bl sub_803CFC0 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0803CDB0: .4byte gUnknown_203B404 +_0803CDB4: .4byte gUnknown_80F4290 +_0803CDB8: .4byte gUnknown_80F42A8 +_0803CDBC: .4byte gUnknown_80F4278 + thumb_func_end sub_803CD08 + + thumb_func_start sub_803CDC0 +sub_803CDC0: + push {r4,r5,lr} + ldr r4, _0803CDF0 + ldr r1, [r4] + movs r0, 0x30 + ldrsh r5, [r1, r0] + movs r0, 0 + strb r0, [r1, 0x16] + ldr r0, [r4] + adds r0, 0x18 + bl GetKeyPress + cmp r0, 0x1 + bne _0803CDF4 + movs r0, 0 + bl sub_80119D4 + ldr r0, [r4] + movs r2, 0x30 + ldrsh r1, [r0, r2] + lsls r1, 1 + adds r0, 0x2 + adds r0, r1 + ldrh r0, [r0] + b _0803CE2A + .align 2, 0 +_0803CDF0: .4byte gUnknown_203B404 +_0803CDF4: + ldr r0, [r4] + adds r0, 0x18 + movs r1, 0x1 + bl sub_80138B8 + lsls r0, 24 + cmp r0, 0 + beq _0803CE08 + bl sub_803CEF0 +_0803CE08: + ldr r0, [r4] + movs r1, 0x30 + ldrsh r0, [r0, r1] + cmp r5, r0 + beq _0803CE16 + bl sub_803CFC0 +_0803CE16: + ldr r0, [r4] + ldrb r0, [r0, 0x16] + cmp r0, 0 + bne _0803CE28 + ldr r0, _0803CE24 + b _0803CE2A + .align 2, 0 +_0803CE24: .4byte 0x0000ffff +_0803CE28: + ldr r0, _0803CE30 +_0803CE2A: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0803CE30: .4byte 0x0000fffe + thumb_func_end sub_803CDC0 + + thumb_func_start sub_803CE34 +sub_803CE34: + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_803D030 + adds r1, r0, 0 + ldr r5, _0803CE68 + ldr r0, [r5] + strh r1, [r0, 0x3A] + adds r0, 0x18 + bl sub_8013984 + bl sub_803CEF0 + bl sub_803CFC0 + cmp r4, 0 + beq _0803CE62 + ldr r0, [r5] + adds r0, 0x18 + bl AddMenuCursorSprite +_0803CE62: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0803CE68: .4byte gUnknown_203B404 + thumb_func_end sub_803CE34 + + thumb_func_start sub_803CE6C +sub_803CE6C: + push {r4,r5,lr} + ldr r4, _0803CEA4 + ldr r1, [r4] + ldr r2, [r1, 0x4C] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r1, 0x54 + ldr r0, _0803CEA8 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + bl sub_8004914 + ldr r0, [r4] + adds r0, 0x54 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + bl sub_803CECC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0803CEA4: .4byte gUnknown_203B404 +_0803CEA8: .4byte gUnknown_80F4278 + thumb_func_end sub_803CE6C + + thumb_func_start sub_803CEAC +sub_803CEAC: + push {r4,lr} + ldr r4, _0803CEC4 + movs r0, 0xB8 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r4] + bl nullsub_135 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0803CEC4: .4byte gUnknown_203B404 + thumb_func_end sub_803CEAC + + thumb_func_start nullsub_135 +nullsub_135: + bx lr + thumb_func_end nullsub_135 + + thumb_func_start sub_803CECC +sub_803CECC: + push {r4,lr} + ldr r4, _0803CEEC + ldr r0, [r4] + cmp r0, 0 + beq _0803CEE4 + bl nullsub_135 + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_0803CEE4: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0803CEEC: .4byte gUnknown_203B404 + thumb_func_end sub_803CECC + + thumb_func_start sub_803CEF0 +sub_803CEF0: + push {r4-r6,lr} + sub sp, 0x4 + ldr r6, _0803CF60 + ldr r0, [r6] + movs r1, 0x32 + ldrsh r0, [r0, r1] + movs r1, 0xC + bl sub_80095E4 + adds r0, 0x2 + lsls r0, 16 + ldr r2, [r6] + ldr r3, [r2, 0x4C] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 3 + adds r1, r2, r1 + adds r1, 0x62 + movs r4, 0 + asrs r3, r0, 16 + lsrs r0, 16 + strh r0, [r1] + ldr r1, [r2, 0x4C] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r2, r0 + adds r3, 0x2 + adds r2, 0x64 + strh r3, [r2] + bl sub_8004914 + ldr r0, [r6] + adds r0, 0x54 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r6] + ldr r0, [r0, 0x4C] + bl sub_8008C54 + ldr r0, [r6] + ldr r0, [r0, 0x4C] + bl sub_80073B8 + ldr r2, _0803CF64 + ldr r0, [r6] + ldr r3, [r0, 0x4C] + str r4, [sp] + movs r0, 0xC + movs r1, 0 + bl xxx_call_draw_string + movs r5, 0 + b _0803CF98 + .align 2, 0 +_0803CF60: .4byte gUnknown_203B404 +_0803CF64: .4byte gUnknown_80F42C0 +_0803CF68: + ldr r0, [r6] + adds r0, 0x18 + adds r1, r5, 0 + bl sub_8013800 + adds r4, r0, 0 + ldr r0, [r6] + lsls r1, r5, 1 + adds r0, 0x2 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + bl sub_808D994 + adds r2, r0, 0 + ldr r0, [r6] + ldr r3, [r0, 0x4C] + movs r0, 0 + str r0, [sp] + movs r0, 0x8 + adds r1, r4, 0 + bl xxx_call_draw_string + adds r5, 0x1 +_0803CF98: + ldr r0, [r6] + movs r1, 0x32 + ldrsh r0, [r0, r1] + cmp r5, r0 + blt _0803CF68 + ldr r4, _0803CFBC + ldr r0, [r4] + ldr r0, [r0, 0x4C] + bl sub_80073E0 + ldr r1, [r4] + movs r0, 0x1 + strb r0, [r1, 0x16] + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0803CFBC: .4byte gUnknown_203B404 + thumb_func_end sub_803CEF0 + + thumb_func_start sub_803CFC0 +sub_803CFC0: + push {r4-r7,lr} + ldr r0, _0803D02C + ldr r0, [r0] + movs r2, 0x30 + ldrsh r1, [r0, r2] + lsls r1, 1 + adds r0, 0x2 + adds r0, r1 + movs r1, 0 + ldrsh r4, [r0, r1] + movs r0, 0x1 + bl sub_8008C54 + movs r0, 0x1 + bl sub_80073B8 + adds r0, r4, 0 + bl sub_808DDD0 + adds r5, r0, 0 + ldr r0, [r5, 0x4] + ldr r6, [r0, 0x4] + movs r4, 0 + movs r7, 0 +_0803CFF0: + adds r0, r4, 0 + adds r0, 0xE0 + ldr r1, [r5, 0x4] + adds r1, r7 + lsls r2, r4, 2 + ldr r1, [r1] + adds r1, r2 + bl SetBGPaletteBufferColorArray + adds r4, 0x1 + cmp r4, 0xF + ble _0803CFF0 + movs r0, 0x1 + adds r1, r6, 0 + movs r2, 0xE + bl sub_800836C + adds r0, r5, 0 + bl sub_800AA14 + movs r0, 0x1 + bl sub_80073E0 + ldr r0, _0803D02C + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x16] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0803D02C: .4byte gUnknown_203B404 + thumb_func_end sub_803CFC0 + + thumb_func_start sub_803D030 +sub_803D030: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + movs r0, 0 + mov r8, r0 + ldr r4, _0803D0D0 + ldr r0, [r4] + movs r1, 0 + ldrsh r0, [r0, r1] + movs r1, 0 + bl sub_808DC68 + mov r1, sp + strb r0, [r1] + ldr r0, [r4] + movs r2, 0 + ldrsh r0, [r0, r2] + movs r1, 0x1 + bl sub_808DC68 + mov r1, sp + strb r0, [r1, 0x1] + movs r7, 0 + add r6, sp, 0x4 + mov r5, sp +_0803D064: + ldr r0, _0803D0D4 + lsls r1, r7, 1 + adds r1, r0 + movs r0, 0 + ldrsh r4, [r1, r0] + adds r0, r4, 0 + movs r1, 0 + bl sub_808DC68 + strb r0, [r6] + adds r0, r4, 0 + movs r1, 0x1 + bl sub_808DC68 + adds r2, r0, 0 + strb r2, [r6, 0x1] + ldrb r1, [r6] + cmp r1, 0 + beq _0803D096 + ldrb r0, [r5] + cmp r1, r0 + beq _0803D0BC + ldrb r0, [r5, 0x1] + cmp r1, r0 + beq _0803D0BC +_0803D096: + lsls r0, r2, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _0803D0AA + ldrb r2, [r5] + cmp r1, r2 + beq _0803D0BC + ldrb r0, [r5, 0x1] + cmp r1, r0 + beq _0803D0BC +_0803D0AA: + ldr r0, _0803D0D0 + ldr r0, [r0] + mov r2, r8 + lsls r1, r2, 1 + adds r0, 0x2 + adds r0, r1 + strh r4, [r0] + movs r0, 0x1 + add r8, r0 +_0803D0BC: + adds r7, 0x1 + cmp r7, 0x9 + ble _0803D064 + mov r0, r8 + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0803D0D0: .4byte gUnknown_203B404 +_0803D0D4: .4byte gUnknown_80F4264 + thumb_func_end sub_803D030 + + thumb_func_start sub_803D0D8 +sub_803D0D8: + ldr r0, _0803D0E0 + ldrb r0, [r0] + bx lr + .align 2, 0 +_0803D0E0: .4byte gUnknown_203B408 + thumb_func_end sub_803D0D8 + + thumb_func_start sub_803D0E4 +sub_803D0E4: + ldr r1, _0803D0EC + strb r0, [r1] + bx lr + .align 2, 0 +_0803D0EC: .4byte gUnknown_203B408 + thumb_func_end sub_803D0E4 + + thumb_func_start sub_803D0F0 +sub_803D0F0: + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0803D0FC + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_0803D0FC: .4byte gUnknown_80F42F0 + thumb_func_end sub_803D0F0 + + thumb_func_start sub_803D100 +sub_803D100: + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0803D10C + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_0803D10C: .4byte gUnknown_80F42D0 + thumb_func_end sub_803D100 + + thumb_func_start sub_803D110 +sub_803D110: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x6C + adds r6, r0, 0 + mov r9, r1 + adds r5, r2, 0 + add r7, sp, 0x48 + adds r2, r7, 0 + movs r1, 0 + mov r0, sp + adds r0, 0x69 +_0803D12A: + strb r1, [r0] + subs r0, 0x1 + cmp r0, r2 + bge _0803D12A + movs r4, 0 + cmp r4, r5 + bge _0803D158 +_0803D138: + ldrb r0, [r6] + bl sub_803D0F0 + add r1, sp, 0x10 + adds r1, r4 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xFF + bne _0803D150 + movs r0, 0 + b _0803D19A +_0803D150: + adds r6, 0x1 + adds r4, 0x1 + cmp r4, r5 + blt _0803D138 +_0803D158: + lsls r0, r5, 2 + adds r0, r5 + adds r2, r0, 0x5 + cmp r2, 0 + bge _0803D164 + adds r2, 0x7 +_0803D164: + asrs r2, 3 + mov r8, r2 + mov r0, sp + adds r1, r7, 0 + bl sub_809486C + movs r4, 0 + cmp r4, r5 + bge _0803D188 + add r6, sp, 0x10 +_0803D178: + adds r1, r6, r4 + mov r0, sp + movs r2, 0x5 + bl sub_809488C + adds r4, 0x1 + cmp r4, r5 + blt _0803D178 +_0803D188: + mov r0, sp + bl nullsub_102 + mov r0, r9 + adds r1, r7, 0 + mov r2, r8 + bl MemoryCopy8 + movs r0, 0x1 +_0803D19A: + add sp, 0x6C + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_803D110 + + thumb_func_start sub_803D1A8 +sub_803D1A8: + push {r4-r7,lr} + sub sp, 0x48 + adds r7, r0, 0 + adds r5, r2, 0 + lsls r0, r5, 2 + adds r0, r5 + adds r2, r0, 0x5 + cmp r2, 0 + bge _0803D1BC + adds r2, 0x7 +_0803D1BC: + asrs r2, 3 + mov r0, sp + bl sub_809485C + movs r4, 0 + cmp r4, r5 + bge _0803D1DC + add r6, sp, 0x10 +_0803D1CC: + adds r1, r6, r4 + mov r0, sp + movs r2, 0x5 + bl sub_8094924 + adds r4, 0x1 + cmp r4, r5 + blt _0803D1CC +_0803D1DC: + mov r0, sp + bl nullsub_102 + movs r4, 0 + cmp r4, r5 + bge _0803D1FC + add r6, sp, 0x10 +_0803D1EA: + adds r0, r6, r4 + ldrb r0, [r0] + bl sub_803D100 + strb r0, [r7] + adds r7, 0x1 + adds r4, 0x1 + cmp r4, r5 + blt _0803D1EA +_0803D1FC: + add sp, 0x48 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_803D1A8 + + thumb_func_start sub_803D204 +sub_803D204: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xA4 + adds r2, r0, 0 + mov r9, r1 + movs r6, 0 + add r4, sp, 0x5C + adds r0, r4, 0 + adds r1, r2, 0 + movs r2, 0x36 + bl MemoryCopy8 + movs r2, 0 + mov r8, r4 + add r5, sp, 0x24 + ldr r4, _0803D2A8 + mov r12, r4 + mov r10, r5 +_0803D22E: + movs r1, 0 + mov r3, r12 + adds r0, r2, r3 + adds r3, r2, 0x1 + ldrb r0, [r0] + cmp r1, r0 + beq _0803D24A + adds r0, r2, r4 +_0803D23E: + adds r1, 0x1 + cmp r1, 0x35 + bgt _0803D24A + ldrb r7, [r0] + cmp r1, r7 + bne _0803D23E +_0803D24A: + mov r7, r10 + adds r0, r7, r2 + add r1, r8 + ldrb r1, [r1] + strb r1, [r0] + adds r2, r3, 0 + cmp r2, 0x35 + ble _0803D22E + adds r0, r5, 0 + mov r1, sp + movs r2, 0x36 + bl sub_803D110 + lsls r0, 24 + cmp r0, 0 + beq _0803D2AC + movs r2, 0x1 +_0803D26C: + mov r1, sp + adds r0, r1, r2 + ldrb r0, [r0] + adds r0, r2 + adds r0, r6, r0 + lsls r0, 24 + lsrs r6, r0, 24 + adds r2, 0x1 + cmp r2, 0x21 + ble _0803D26C + mov r0, sp + ldrb r0, [r0] + cmp r0, r6 + bne _0803D2AC + add r4, sp, 0x94 + adds r1, 0x1 + adds r0, r4, 0 + movs r2, 0x21 + bl sub_809485C + adds r0, r4, 0 + mov r1, r9 + bl sub_8095774 + adds r0, r4, 0 + bl nullsub_102 + movs r0, 0x1 + b _0803D2AE + .align 2, 0 +_0803D2A8: .4byte gUnknown_80F43F0 +_0803D2AC: + movs r0, 0 +_0803D2AE: + add sp, 0xA4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_803D204 + + thumb_func_start sub_803D2C0 +sub_803D2C0: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xA4 + mov r9, r0 + adds r6, r1, 0 + movs r5, 0 + add r4, sp, 0x94 + mov r1, sp + adds r1, 0x1 + add r7, sp, 0x24 + add r0, sp, 0x5C + mov r8, r0 + movs r2, 0 + mov r0, sp + adds r0, 0x21 +_0803D2E2: + strb r2, [r0] + subs r0, 0x1 + cmp r0, sp + bge _0803D2E2 + adds r0, r4, 0 + movs r2, 0x21 + bl sub_809486C + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_8095824 + adds r0, r4, 0 + bl nullsub_102 + movs r2, 0x1 +_0803D302: + mov r1, sp + adds r0, r1, r2 + ldrb r0, [r0] + adds r0, r2 + adds r0, r5, r0 + lsls r0, 24 + lsrs r5, r0, 24 + adds r2, 0x1 + cmp r2, 0x21 + ble _0803D302 + mov r0, sp + strb r5, [r0] + adds r0, r7, 0 + movs r2, 0x36 + bl sub_803D1A8 + movs r2, 0 + mov r4, r8 + ldr r5, _0803D354 + adds r3, r7, 0 +_0803D32A: + adds r0, r2, r5 + ldrb r1, [r0] + adds r1, r4, r1 + adds r0, r3, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r2, 0x1 + cmp r2, 0x35 + ble _0803D32A + mov r0, r9 + mov r1, r8 + movs r2, 0x36 + bl MemoryCopy8 + add sp, 0xA4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0803D354: .4byte gUnknown_80F43F0 + thumb_func_end sub_803D2C0 + + thumb_func_start sub_803D358 +sub_803D358: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x50 + adds r2, r0, 0 + mov r9, r1 + movs r6, 0 + add r4, sp, 0x28 + adds r0, r4, 0 + adds r1, r2, 0 + movs r2, 0x18 + bl MemoryCopy8 + movs r2, 0 + mov r8, r4 + add r5, sp, 0x10 + ldr r4, _0803D3FC + mov r12, r4 + mov r10, r5 +_0803D382: + movs r1, 0 + mov r3, r12 + adds r0, r2, r3 + adds r3, r2, 0x1 + ldrb r0, [r0] + cmp r1, r0 + beq _0803D39E + adds r0, r2, r4 +_0803D392: + adds r1, 0x1 + cmp r1, 0x17 + bgt _0803D39E + ldrb r7, [r0] + cmp r1, r7 + bne _0803D392 +_0803D39E: + mov r7, r10 + adds r0, r7, r2 + add r1, r8 + ldrb r1, [r1] + strb r1, [r0] + adds r2, r3, 0 + cmp r2, 0x17 + ble _0803D382 + adds r0, r5, 0 + mov r1, sp + movs r2, 0x18 + bl sub_803D110 + lsls r0, 24 + cmp r0, 0 + beq _0803D400 + movs r2, 0x1 +_0803D3C0: + mov r1, sp + adds r0, r1, r2 + ldrb r0, [r0] + adds r0, r2 + adds r0, r6, r0 + lsls r0, 24 + lsrs r6, r0, 24 + adds r2, 0x1 + cmp r2, 0xE + ble _0803D3C0 + mov r0, sp + ldrb r0, [r0] + cmp r0, r6 + bne _0803D400 + add r4, sp, 0x40 + adds r1, 0x1 + adds r0, r4, 0 + movs r2, 0xC + bl sub_809485C + adds r0, r4, 0 + mov r1, r9 + bl sub_80971EC + adds r0, r4, 0 + bl nullsub_102 + movs r0, 0x1 + b _0803D402 + .align 2, 0 +_0803D3FC: .4byte gUnknown_80F4426 +_0803D400: + movs r0, 0 +_0803D402: + add sp, 0x50 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_803D358 + + thumb_func_start sub_803D414 +sub_803D414: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x50 + mov r9, r0 + adds r6, r1, 0 + movs r5, 0 + add r4, sp, 0x40 + mov r1, sp + adds r1, 0x1 + add r7, sp, 0x10 + add r0, sp, 0x28 + mov r8, r0 + movs r2, 0 + mov r0, sp + adds r0, 0xE +_0803D436: + strb r2, [r0] + subs r0, 0x1 + cmp r0, sp + bge _0803D436 + adds r0, r4, 0 + movs r2, 0xC + bl sub_809486C + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_8097270 + adds r0, r4, 0 + bl nullsub_102 + movs r2, 0x1 +_0803D456: + mov r1, sp + adds r0, r1, r2 + ldrb r0, [r0] + adds r0, r2 + adds r0, r5, r0 + lsls r0, 24 + lsrs r5, r0, 24 + adds r2, 0x1 + cmp r2, 0xE + ble _0803D456 + mov r0, sp + strb r5, [r0] + adds r0, r7, 0 + movs r2, 0x18 + bl sub_803D1A8 + movs r2, 0 + mov r4, r8 + ldr r5, _0803D4A8 + adds r3, r7, 0 +_0803D47E: + adds r0, r2, r5 + ldrb r1, [r0] + adds r1, r4, r1 + adds r0, r3, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r2, 0x1 + cmp r2, 0x17 + ble _0803D47E + mov r0, r9 + mov r1, r8 + movs r2, 0x18 + bl MemoryCopy8 + add sp, 0x50 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0803D4A8: .4byte gUnknown_80F4426 + thumb_func_end sub_803D414 + + thumb_func_start sub_803D4AC +sub_803D4AC: + ldr r2, _0803D4C4 + ldr r0, [r2] + ldr r1, _0803D4C8 + adds r0, r1 + movs r1, 0x63 + strb r1, [r0] + ldr r0, [r2] + ldr r1, _0803D4CC + adds r0, r1 + movs r1, 0xFF + strb r1, [r0] + bx lr + .align 2, 0 +_0803D4C4: .4byte gUnknown_203B418 +_0803D4C8: .4byte 0x0001c570 +_0803D4CC: .4byte 0x0001c571 + thumb_func_end sub_803D4AC + + thumb_func_start sub_803D4D0 +sub_803D4D0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1FC + ldr r6, _0803D654 + ldr r1, [r6] + movs r4, 0xC9 + lsls r4, 3 + adds r0, r1, r4 + ldr r2, _0803D658 + adds r1, r2 + bl sub_80901D8 + ldr r0, [r6] + ldr r3, _0803D65C + adds r2, r0, r3 + adds r1, r0, r4 + ldrh r0, [r2] + ldrh r4, [r1] + cmp r0, r4 + bne _0803D500 + b _0803D6E0 +_0803D500: + ldr r0, [r1] + str r0, [r2] + ldr r0, _0803D660 + ldr r1, _0803D664 + bl sub_800A9EC + mov r9, r0 + ldr r3, [r0, 0x4] + ldr r2, [r6] + ldr r7, _0803D65C + adds r0, r2, r7 + ldrb r1, [r0] + ldr r0, [r3] + lsls r1, 2 + adds r1, r0 + ldr r3, _0803D668 + adds r0, r2, r3 + ldrb r0, [r0] + lsls r0, 4 + ldr r1, [r1] + adds r1, r0 + mov r8, r1 + ldr r4, _0803D658 + adds r2, r4 + ldrb r0, [r2] + bl sub_8090298 + ldr r1, [r6] + ldr r7, _0803D66C + adds r1, r7 + strb r0, [r1] + ldr r0, [r6] + adds r0, r4 + ldrb r0, [r0] + bl sub_80902C8 + ldr r1, [r6] + strh r0, [r1, 0x14] + mov r2, r9 + ldr r0, [r2, 0x4] + mov r3, r8 + movs r4, 0 + ldrsh r2, [r3, r4] + ldr r3, [r0, 0x4] + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + ldr r7, _0803D670 + adds r1, r7 + adds r0, r3 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldr r0, [r0] + str r0, [r1] + movs r5, 0 + mov r10, r6 + ldr r4, _0803D674 +_0803D576: + mov r6, r10 + ldr r2, [r6] + lsls r3, r5, 1 + adds r2, r4 + adds r2, r3 + mov r7, r9 + ldr r1, [r7, 0x4] + mov r6, r8 + movs r7, 0x4 + ldrsh r0, [r6, r7] + ldr r1, [r1, 0x10] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + adds r3, r0 + ldrh r0, [r3] + strh r0, [r2] + adds r5, 0x1 + cmp r5, 0x13 + ble _0803D576 + movs r5, 0 + adds r6, 0x6 + str r6, [sp, 0x1F8] + ldr r6, _0803D678 + mov r10, r6 +_0803D5A8: + ldr r1, _0803D654 + ldr r0, [r1] + lsls r3, r5, 3 + mov r2, r10 + adds r4, r0, r2 + adds r4, r3 + mov r12, r4 + mov r4, r9 + ldr r2, [r4, 0x4] + mov r7, r8 + movs r4, 0x2 + ldrsh r1, [r7, r4] + ldr r2, [r2, 0xC] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + adds r3, r1 + ldr r1, [r3] + ldr r2, [r3, 0x4] + mov r7, r12 + str r1, [r7] + str r2, [r7, 0x4] + adds r0, r6 + bl sub_808E9B8 + lsls r0, 16 + cmp r0, 0 + beq _0803D5E8 + adds r6, 0x8 + adds r5, 0x1 + cmp r5, 0x1E + ble _0803D5A8 +_0803D5E8: + cmp r5, 0x1F + bgt _0803D606 + ldr r6, _0803D654 + lsls r0, r5, 3 + ldr r1, _0803D678 + adds r4, r0, r1 +_0803D5F4: + ldr r0, [r6] + adds r0, r4 + movs r1, 0 + bl sub_808E9C4 + adds r4, 0x8 + adds r5, 0x1 + cmp r5, 0x1F + ble _0803D5F4 +_0803D606: + movs r5, 0 + ldr r2, _0803D67C + mov r10, r2 +_0803D60C: + mov r3, r9 + ldr r1, [r3, 0x4] + lsls r0, r5, 1 + ldr r4, [sp, 0x1F8] + adds r0, r4, r0 + movs r6, 0 + ldrsh r0, [r0, r6] + ldr r1, [r1, 0x8] + lsls r0, 2 + adds r0, r1 + movs r4, 0 + adds r7, r5, 0x1 + mov r8, r7 + lsls r1, r5, 6 + mov r12, r1 + ldr r3, [r0] + mov r2, sp +_0803D62E: + ldrh r0, [r3] + cmp r0, r10 + bls _0803D684 + ldrh r0, [r3] + ldr r6, _0803D680 + adds r1, r0, r6 + cmp r1, 0 + beq _0803D68A + movs r6, 0 + lsls r0, r4, 1 + add r0, sp +_0803D644: + strh r6, [r0] + adds r0, 0x2 + adds r2, 0x2 + adds r4, 0x1 + subs r1, 0x1 + cmp r1, 0 + bne _0803D644 + b _0803D68A + .align 2, 0 +_0803D654: .4byte gUnknown_203B418 +_0803D658: .4byte 0x00000644 +_0803D65C: .4byte 0x0001c570 +_0803D660: .4byte gUnknown_80F4D8C +_0803D664: .4byte gUnknown_83B0000 +_0803D668: .4byte 0x0001c571 +_0803D66C: .4byte 0x0001cec8 +_0803D670: .4byte 0x0001c574 +_0803D674: .4byte 0x0001cd70 +_0803D678: .4byte 0x0001cd98 +_0803D67C: .4byte 0x0000752f +_0803D680: .4byte 0xffff8ad0 +_0803D684: + strh r0, [r2] + adds r2, 0x2 + adds r4, 0x1 +_0803D68A: + adds r3, 0x2 + cmp r4, 0xFB + ble _0803D62E + ldr r7, _0803D6F0 + mov r1, r12 + subs r0, r1, r5 + movs r4, 0xB + mov r3, sp + lsls r2, r0, 3 + ldr r6, _0803D6F4 +_0803D69E: + ldr r0, [r7] + adds r0, r6 + adds r0, r2 + ldrh r1, [r3] + strh r1, [r0] + adds r3, 0x2 + adds r2, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _0803D69E + ldr r6, _0803D6F0 + mov r2, r12 + subs r0, r2, r5 + lsls r3, r0, 3 + add r2, sp, 0x18 + ldr r5, _0803D6F8 + movs r4, 0xEF +_0803D6C0: + ldr r0, [r6] + adds r0, r5 + adds r0, r3 + ldrh r1, [r2] + strh r1, [r0] + adds r2, 0x2 + adds r3, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _0803D6C0 + mov r5, r8 + cmp r5, 0x3 + ble _0803D60C + mov r0, r9 + bl sub_800AA14 +_0803D6E0: + add sp, 0x1FC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0803D6F0: .4byte gUnknown_203B418 +_0803D6F4: .4byte 0x0001c590 +_0803D6F8: .4byte 0x0001c5a8 + thumb_func_end sub_803D4D0 + + thumb_func_start sub_803D6FC +sub_803D6FC: + push {r4,lr} + ldr r0, _0803D720 + bl sub_8084100 + adds r3, r0, 0 + movs r2, 0 + ldr r0, _0803D724 + ldr r0, [r0] + ldr r4, _0803D728 + adds r1, r0, r4 +_0803D710: + ldrh r0, [r1] + cmp r0, 0 + beq _0803D72C + cmp r0, r3 + blt _0803D72C + lsls r0, r2, 24 + lsrs r0, 24 + b _0803D736 + .align 2, 0 +_0803D720: .4byte 0x00002710 +_0803D724: .4byte gUnknown_203B418 +_0803D728: .4byte 0x0001cd70 +_0803D72C: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, 0x13 + ble _0803D710 + movs r0, 0x10 +_0803D736: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_803D6FC + + thumb_func_start sub_803D73C +sub_803D73C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r4, r0, 0 + ldr r0, _0803D784 + bl sub_8084100 + adds r7, r0, 0 + movs r0, 0xC + mov r8, r0 + movs r6, 0 + ldr r0, _0803D788 + ldr r2, [r0] + lsls r1, r4, 6 + subs r0, r1, r4 + adds r5, r1, 0 + lsls r0, 3 + ldr r1, _0803D78C + adds r2, r1 + adds r1, r0, r2 +_0803D766: + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _0803D772 + cmp r0, r7 + bge _0803D790 +_0803D772: + adds r1, 0x2 + adds r6, 0x1 + cmp r6, 0xB + ble _0803D766 +_0803D77A: + mov r0, r8 + cmp r0, 0xC + bne _0803D79C + b _0803D7EC + .align 2, 0 +_0803D784: .4byte 0x00002710 +_0803D788: .4byte gUnknown_203B418 +_0803D78C: .4byte 0x0001c590 +_0803D790: + lsls r0, r6, 24 + lsrs r0, 24 + mov r8, r0 + b _0803D77A +_0803D798: + adds r0, r5, 0 + b _0803D7EE +_0803D79C: + ldr r0, _0803D7FC + bl sub_8084100 + adds r7, r0, 0 + movs r6, 0 + ldr r2, _0803D800 + subs r0, r5, r4 + ldr r1, _0803D804 + lsls r4, r0, 3 +_0803D7AE: + ldr r0, [r2] + adds r0, r1 + adds r0, r4 + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r0, 0 + beq _0803D7E4 + lsls r0, r6, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + str r1, [sp] + str r2, [sp, 0x4] + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, [sp] + ldr r2, [sp, 0x4] + cmp r0, r8 + bne _0803D7E4 + ldr r0, [r2] + adds r0, r1 + adds r0, r4 + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r0, r7 + bge _0803D798 +_0803D7E4: + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0xEF + ble _0803D7AE +_0803D7EC: + movs r0, 0x69 +_0803D7EE: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0803D7FC: .4byte 0x00002710 +_0803D800: .4byte gUnknown_203B418 +_0803D804: .4byte 0x0001c5a8 + thumb_func_end sub_803D73C + + thumb_func_start sub_803D808 +sub_803D808: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r7, r1, 0 + movs r6, 0 + ldr r2, _0803D820 + lsls r1, r7, 3 + adds r1, r0 + mov r8, r1 + b _0803D840 + .align 2, 0 +_0803D820: .4byte 0x0001cd98 +_0803D824: + ldr r0, [r5] + ldr r1, _0803D868 + adds r0, r1 + adds r0, r4 + ldr r1, [r0, 0x4] + ldr r0, [r0] + mov r3, r8 + adds r3, 0x8 + mov r8, r3 + subs r3, 0x8 + stm r3!, {r0,r1} + adds r7, 0x1 + adds r2, 0x8 + adds r6, 0x1 +_0803D840: + cmp r6, 0x1F + bgt _0803D85A + ldr r5, _0803D86C + lsls r4, r6, 3 + ldr r0, [r5] + adds r0, r2 + str r2, [sp] + bl sub_808E9B8 + lsls r0, 16 + ldr r2, [sp] + cmp r0, 0 + bne _0803D824 +_0803D85A: + adds r0, r7, 0 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0803D868: .4byte 0x0001cd98 +_0803D86C: .4byte gUnknown_203B418 + thumb_func_end sub_803D808 + + thumb_func_start sub_803D870 +sub_803D870: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r6, r1, 0 + movs r5, 0 + lsls r1, r6, 3 + adds r1, r0 + mov r9, r1 + b _0803D8B8 +_0803D884: + bl sub_808DACC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _0803D8B6 + ldr r1, [r7] + adds r0, r1, r4 + ldr r2, _0803D8E4 + adds r0, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + beq _0803D8B6 + mov r2, r8 + adds r0, r1, r2 + adds r0, r4 + ldr r1, [r0, 0x4] + ldr r0, [r0] + mov r2, r9 + adds r2, 0x8 + mov r9, r2 + subs r2, 0x8 + stm r2!, {r0,r1} + adds r6, 0x1 +_0803D8B6: + adds r5, 0x1 +_0803D8B8: + cmp r5, 0x1F + bgt _0803D8D6 + ldr r7, _0803D8E8 + lsls r4, r5, 3 + ldr r0, _0803D8EC + mov r8, r0 + adds r1, r4, r0 + ldr r0, [r7] + adds r0, r1 + bl sub_808E9B8 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bne _0803D884 +_0803D8D6: + adds r0, r6, 0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0803D8E4: .4byte 0x0001cd9a +_0803D8E8: .4byte gUnknown_203B418 +_0803D8EC: .4byte 0x0001cd98 + thumb_func_end sub_803D870 + + thumb_func_start sub_803D8F0 +sub_803D8F0: + push {r4,lr} + ldr r4, _0803D920 + ldr r0, [r4] + ldr r2, _0803D924 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0 + bne _0803D918 + movs r0, 0x1 + strb r0, [r1] + ldr r0, [r4] + ldr r1, _0803D928 + adds r0, r1 + movs r1, 0 + bl sub_803D808 + ldr r1, [r4] + ldr r2, _0803D92C + adds r1, r2 + str r0, [r1] +_0803D918: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0803D920: .4byte gUnknown_203B418 +_0803D924: .4byte 0x000037ec +_0803D928: .4byte 0x0000343c +_0803D92C: .4byte 0x000037e4 + thumb_func_end sub_803D8F0 + + thumb_func_start sub_803D930 +sub_803D930: + push {r4-r7,lr} + lsls r0, 16 + asrs r6, r0, 16 + movs r5, 0 + ldr r7, _0803D940 + ldr r4, _0803D944 + b _0803D954 + .align 2, 0 +_0803D940: .4byte gUnknown_203B418 +_0803D944: .4byte 0x0001cd98 +_0803D948: + cmp r0, r6 + bne _0803D950 + movs r0, 0x1 + b _0803D96A +_0803D950: + adds r4, 0x8 + adds r5, 0x1 +_0803D954: + cmp r5, 0x1F + bgt _0803D968 + ldr r0, [r7] + adds r0, r4 + bl sub_808E9B8 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bne _0803D948 +_0803D968: + movs r0, 0 +_0803D96A: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_803D930 + + thumb_func_start sub_803D970 +sub_803D970: + push {r4-r7,lr} + adds r5, r0, 0 + ldr r0, _0803D9EC + bl sub_8084100 + adds r6, r0, 0 + movs r3, 0 + ldr r1, _0803D9F0 + ldr r0, [r1] + ldr r2, _0803D9F4 + adds r0, r2 + ldr r0, [r0] + cmp r3, r0 + bge _0803D9BA + ldr r4, _0803D9F8 +_0803D98E: + ldr r2, [r1] + lsls r1, r5, 1 + lsls r0, r3, 3 + adds r1, r0 + ldr r7, _0803D9FC + adds r0, r2, r7 + adds r1, r0, r1 + movs r7, 0 + ldrsh r0, [r1, r7] + cmp r0, 0 + beq _0803D9A8 + cmp r0, r6 + bge _0803D9E0 +_0803D9A8: + adds r4, 0x8 + adds r3, 0x1 + ldr r1, _0803D9F0 + ldr r0, [r1] + ldr r2, _0803D9F4 + adds r0, r2 + ldr r0, [r0] + cmp r3, r0 + blt _0803D98E +_0803D9BA: + movs r3, 0 + ldr r0, _0803D9F0 + ldr r1, [r0] + ldr r7, _0803D9F4 + adds r1, r7 + ldr r1, [r1] + adds r6, r0, 0 + cmp r3, r1 + bge _0803DA10 + ldr r4, _0803D9F8 + lsls r1, r5, 1 +_0803D9D0: + ldr r2, [r6] + ldr r5, _0803D9FC + adds r0, r2, r5 + adds r0, r1 + movs r7, 0 + ldrsh r0, [r0, r7] + cmp r0, 0 + beq _0803DA00 +_0803D9E0: + adds r0, r2, r4 + bl sub_808E9B8 + lsls r0, 16 + asrs r0, 16 + b _0803DA14 + .align 2, 0 +_0803D9EC: .4byte 0x00002710 +_0803D9F0: .4byte gUnknown_203B418 +_0803D9F4: .4byte 0x000037e4 +_0803D9F8: .4byte 0x0000343c +_0803D9FC: .4byte 0x0000343e +_0803DA00: + adds r4, 0x8 + adds r1, 0x8 + adds r3, 0x1 + ldr r5, _0803DA1C + adds r0, r2, r5 + ldr r0, [r0] + cmp r3, r0 + blt _0803D9D0 +_0803DA10: + movs r0, 0xBE + lsls r0, 1 +_0803DA14: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0803DA1C: .4byte 0x000037e4 + thumb_func_end sub_803D970 + + thumb_func_start sub_803DA20 +sub_803DA20: + push {r4-r7,lr} + lsls r0, 16 + asrs r7, r0, 16 + movs r5, 0 + ldr r1, _0803DA54 + ldr r0, [r1] + ldr r2, _0803DA58 + adds r0, r2 + ldr r0, [r0] + cmp r5, r0 + bge _0803DA70 + adds r6, r1, 0 + ldr r4, _0803DA5C +_0803DA3A: + ldr r0, [r6] + adds r0, r4 + bl sub_808E9B8 + lsls r0, 16 + asrs r0, 16 + cmp r0, r7 + bne _0803DA60 + ldr r0, [r6] + adds r0, r4 + bl sub_808E9E4 + b _0803DA72 + .align 2, 0 +_0803DA54: .4byte gUnknown_203B418 +_0803DA58: .4byte 0x000037e4 +_0803DA5C: .4byte 0x0000343c +_0803DA60: + adds r4, 0x8 + adds r5, 0x1 + ldr r0, [r6] + ldr r1, _0803DA78 + adds r0, r1 + ldr r0, [r0] + cmp r5, r0 + blt _0803DA3A +_0803DA70: + movs r0, 0x1 +_0803DA72: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0803DA78: .4byte 0x000037e4 + thumb_func_end sub_803DA20 + + thumb_func_start sub_803DA7C +sub_803DA7C: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x68 + ldr r0, _0803DB84 + ldr r4, _0803DB88 + adds r1, r4, 0 + bl sub_800A9EC + ldr r5, _0803DB8C + str r0, [r5] + ldr r0, _0803DB90 + adds r1, r4, 0 + bl sub_800A9EC + ldr r1, _0803DB94 + str r0, [r1] + ldr r1, _0803DB98 + ldr r0, [r0, 0x4] + ldr r0, [r0, 0x4] + str r0, [r1] + movs r4, 0 +_0803DAAA: + adds r0, r4, 0 + adds r0, 0xE0 + ldr r1, [r5] + lsls r2, r4, 2 + ldr r1, [r1, 0x4] + adds r1, r2 + bl SetBGPaletteBufferColorArray + adds r4, 0x1 + cmp r4, 0xF + ble _0803DAAA + ldr r0, _0803DB9C + movs r1, 0xE0 + lsls r1, 5 + bl CpuClear + bl sub_80848EC + lsls r0, 24 + cmp r0, 0 + bne _0803DAD6 + b _0803DBEA +_0803DAD6: + ldr r0, _0803DBA0 + ldr r0, [r0] + ldr r1, _0803DBA4 + adds r2, r0, r1 + movs r3, 0x14 + ldrsh r1, [r0, r3] + ldrb r2, [r2] + adds r2, r1 + mov r8, r2 + ldr r1, _0803DBA8 + adds r0, r1 + ldrb r0, [r0] + bl sub_80900AC + mov r9, r0 + movs r5, 0xA + movs r0, 0 +_0803DAF8: + movs r4, 0 + adds r6, r0, 0x4 + adds r7, r0, 0x1 +_0803DAFE: + adds r4, 0x1 + ldr r3, _0803DBAC + adds r0, r3, 0 + adds r2, r5, 0 + orrs r2, r0 + lsls r2, 16 + lsrs r2, 16 + adds r0, r4, 0 + adds r1, r6, 0 + movs r3, 0 + bl sub_8008DC8 + adds r5, 0x1 + cmp r4, 0x1B + ble _0803DAFE + adds r0, r7, 0 + cmp r0, 0x7 + ble _0803DAF8 + mov r0, r9 + bl sub_803DE7C + movs r1, 0xE0 + subs r1, r0 + lsrs r0, r1, 31 + adds r1, r0 + asrs r1, 1 + mov r0, r9 + movs r2, 0 + bl sub_803DC14 + adds r7, r0, 0 + ldr r0, _0803DBA0 + ldr r0, [r0] + ldr r1, _0803DBA8 + adds r0, r1 + ldrb r0, [r0] + bl sub_80900C0 + lsls r0, 24 + ldr r6, _0803DBB0 + cmp r0, 0 + beq _0803DB54 + ldr r6, _0803DBB4 +_0803DB54: + mov r3, r8 + cmp r3, 0x9 + ble _0803DBBC + ldr r5, _0803DBB8 + mov r0, r8 + movs r1, 0xA + bl __divsi3 + adds r4, r0, 0 + adds r4, 0x30 + mov r0, r8 + movs r1, 0xA + bl __modsi3 + adds r0, 0x30 + str r0, [sp] + add r0, sp, 0x4 + adds r1, r5, 0 + adds r2, r6, 0 + adds r3, r4, 0 + bl sub_800D158 + b _0803DBCA + .align 2, 0 +_0803DB84: .4byte gUnknown_80F60F8 +_0803DB88: .4byte gUnknown_83B0000 +_0803DB8C: .4byte gUnknown_202EC88 +_0803DB90: .4byte gUnknown_80F6100 +_0803DB94: .4byte gUnknown_202EC8C +_0803DB98: .4byte gUnknown_202EC90 +_0803DB9C: .4byte 0x06000140 +_0803DBA0: .4byte gUnknown_203B418 +_0803DBA4: .4byte 0x00000645 +_0803DBA8: .4byte 0x00000644 +_0803DBAC: .4byte 0xffffe000 +_0803DBB0: .4byte gUnknown_80F610C +_0803DBB4: .4byte gUnknown_80F6108 +_0803DBB8: .4byte gUnknown_80F6110 +_0803DBBC: + ldr r1, _0803DC08 + mov r3, r8 + adds r3, 0x30 + add r0, sp, 0x4 + adds r2, r6, 0 + bl sub_800D158 +_0803DBCA: + add r0, sp, 0x4 + bl sub_803DE7C + movs r1, 0xE0 + subs r1, r0 + lsrs r0, r1, 31 + adds r1, r0 + asrs r1, 1 + adds r2, r7, 0 + adds r2, 0x20 + add r0, sp, 0x4 + bl sub_803DC14 + ldr r1, _0803DC0C + movs r0, 0x1 + strb r0, [r1] +_0803DBEA: + ldr r0, _0803DC10 + ldr r0, [r0] + bl sub_800AA14 + movs r0, 0x2 + bl sub_803E46C + add sp, 0x68 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0803DC08: .4byte gUnknown_80F6118 +_0803DC0C: .4byte gUnknown_20274A5 +_0803DC10: .4byte gUnknown_202EC8C + thumb_func_end sub_803DA7C + + thumb_func_start sub_803DC14 +sub_803DC14: + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + b _0803DC5C +_0803DC1E: + ldrb r1, [r4] + adds r4, 0x1 + cmp r1, 0x2F + bne _0803DC2C + movs r5, 0 + adds r6, 0x18 + b _0803DC5C +_0803DC2C: + cmp r1, 0x23 + bne _0803DC34 + adds r5, 0x8 + b _0803DC5C +_0803DC34: + cmp r1, 0x20 + bne _0803DC3C + adds r5, 0xC + b _0803DC5C +_0803DC3C: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0803DC50 + ldrb r0, [r4] + cmp r0, 0 + beq _0803DC50 + lsls r1, 8 + orrs r1, r0 + adds r4, 0x1 +_0803DC50: + adds r0, r1, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_803DC6C + adds r5, r0 +_0803DC5C: + ldrb r0, [r4] + cmp r0, 0 + bne _0803DC1E + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_803DC14 + + thumb_func_start sub_803DC6C +sub_803DC6C: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x120 + adds r7, r1, 0 + adds r5, r2, 0 + bl sub_803DEC8 + adds r4, r0, 0 + ldr r0, [r4] + mov r1, sp + bl sub_803DD30 + ldrb r4, [r4, 0x6] + mov r9, r4 + mov r6, sp + adds r0, r5, 0 + cmp r5, 0 + bge _0803DC96 + adds r0, r5, 0x7 +_0803DC96: + asrs r0, 3 + lsls r3, r0, 3 + subs r0, r3, r0 + lsls r0, 2 + adds r1, r7, 0 + cmp r7, 0 + bge _0803DCA6 + adds r1, r7, 0x7 +_0803DCA6: + asrs r1, 3 + adds r0, r1 + lsls r0, 5 + ldr r4, _0803DD28 + adds r2, r0, r4 + subs r0, r5, r3 + lsls r0, 2 + adds r2, r0 + lsls r1, 3 + subs r1, r7, r1 + lsls r1, 4 + ldr r0, _0803DD2C + adds r4, r1, r0 + movs r0, 0 +_0803DCC2: + adds r3, r2, 0 + adds r7, r3, 0x4 + adds r5, 0x1 + mov r12, r5 + adds r0, 0x1 + mov r8, r0 + movs r5, 0x2 +_0803DCD0: + ldr r2, [r6] + cmp r2, 0 + beq _0803DCF6 + ldr r1, [r4] + ands r1, r2 + ldr r0, [r4, 0x8] + lsls r1, r0 + ldr r0, [r3] + orrs r0, r1 + str r0, [r3] + adds r3, 0x20 + ldr r0, [r4, 0x4] + ands r2, r0 + ldr r0, [r4, 0xC] + lsrs r2, r0 + ldr r0, [r3] + orrs r0, r2 + str r0, [r3] + subs r3, 0x20 +_0803DCF6: + adds r6, 0x4 + adds r3, 0x20 + subs r5, 0x1 + cmp r5, 0 + bge _0803DCD0 + adds r2, r7, 0 + mov r5, r12 + movs r0, 0x7 + ands r0, r5 + cmp r0, 0 + bne _0803DD12 + movs r0, 0xD8 + lsls r0, 2 + adds r2, r7, r0 +_0803DD12: + mov r0, r8 + cmp r0, 0x17 + ble _0803DCC2 + mov r0, r9 + add sp, 0x120 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0803DD28: .4byte 0x06000140 +_0803DD2C: .4byte gUnknown_80F6120 + thumb_func_end sub_803DC6C + + thumb_func_start sub_803DD30 +sub_803DD30: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, _0803DDBC + add sp, r4 + adds r4, r0, 0 + mov r10, r1 + movs r3, 0 + movs r5, 0 + ldr r0, _0803DDC0 + mov r8, r0 + movs r6, 0xF + movs r7, 0xF + mov r2, sp +_0803DD50: + ldrb r0, [r4] + lsrs r1, r0, 4 + ands r1, r6 + strb r1, [r2] + adds r1, r7, 0 + ands r1, r0 + strb r1, [r2, 0x1] + adds r4, 0x1 + adds r2, 0x2 + adds r5, 0x2 + cmp r5, r8 + ble _0803DD50 + ldr r1, _0803DDC0 + cmp r3, r1 + bgt _0803DDF8 + movs r0, 0x90 + lsls r0, 2 + mov r2, sp + adds r2, r0 + mov r12, r2 + mov r8, r1 + mov r2, sp + mov r9, r0 +_0803DD7E: + ldrb r1, [r2] + adds r2, 0x1 + movs r6, 0x7 + ands r6, r1 + movs r0, 0x8 + ands r1, r0 + cmp r1, 0 + beq _0803DDC4 + ldrb r1, [r2] + adds r2, 0x1 + movs r4, 0 + cmp r4, r6 + bge _0803DDF4 + mov r5, r12 + adds r0, r5, r3 + strb r1, [r0] + adds r3, 0x1 + cmp r3, r8 + bgt _0803DDF8 + mov r5, sp + add r5, r9 + ldr r7, _0803DDC0 +_0803DDAA: + adds r4, 0x1 + cmp r4, r6 + bge _0803DDF4 + adds r0, r5, r3 + strb r1, [r0] + adds r3, 0x1 + cmp r3, r7 + ble _0803DDAA + b _0803DDF4 + .align 2, 0 +_0803DDBC: .4byte 0xfffffb80 +_0803DDC0: .4byte 0x0000023f +_0803DDC4: + movs r4, 0 + cmp r4, r6 + bge _0803DDF4 + ldrb r1, [r2] + adds r2, 0x1 + mov r5, r12 + adds r0, r5, r3 + strb r1, [r0] + adds r3, 0x1 + cmp r3, r8 + bgt _0803DDF8 + mov r5, sp + add r5, r9 + ldr r7, _0803DE78 +_0803DDE0: + adds r4, 0x1 + cmp r4, r6 + bge _0803DDF4 + ldrb r1, [r2] + adds r2, 0x1 + adds r0, r5, r3 + strb r1, [r0] + adds r3, 0x1 + cmp r3, r7 + ble _0803DDE0 +_0803DDF4: + cmp r3, r8 + ble _0803DD7E +_0803DDF8: + movs r5, 0 + ldr r4, _0803DE78 + add r3, sp, 0x240 +_0803DDFE: + ldrb r2, [r3, 0x7] + lsls r2, 28 + ldrb r0, [r3, 0x6] + lsls r0, 24 + movs r1, 0xF0 + lsls r1, 20 + ands r0, r1 + orrs r2, r0 + ldrb r0, [r3, 0x5] + lsls r0, 20 + movs r1, 0xF0 + lsls r1, 16 + ands r0, r1 + orrs r2, r0 + ldrb r0, [r3, 0x4] + lsls r0, 16 + movs r1, 0xF0 + lsls r1, 12 + ands r0, r1 + orrs r2, r0 + ldrb r0, [r3, 0x3] + lsls r0, 12 + movs r1, 0xF0 + lsls r1, 8 + ands r0, r1 + orrs r2, r0 + ldrb r0, [r3, 0x2] + lsls r0, 8 + movs r1, 0xF0 + lsls r1, 4 + ands r0, r1 + orrs r2, r0 + ldrb r0, [r3, 0x1] + lsls r0, 4 + movs r1, 0xF0 + ands r0, r1 + orrs r2, r0 + ldrb r1, [r3] + movs r0, 0xF + ands r0, r1 + orrs r2, r0 + mov r0, r10 + adds r0, 0x4 + mov r10, r0 + subs r0, 0x4 + stm r0!, {r2} + adds r3, 0x8 + adds r5, 0x8 + cmp r5, r4 + ble _0803DDFE + movs r3, 0x90 + lsls r3, 3 + add sp, r3 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0803DE78: .4byte 0x0000023f + thumb_func_end sub_803DD30 + + thumb_func_start sub_803DE7C +sub_803DE7C: + push {r4,r5,lr} + adds r4, r0, 0 + movs r5, 0 + b _0803DEBA +_0803DE84: + ldrb r1, [r4] + adds r4, 0x1 + cmp r1, 0x23 + bne _0803DE90 + adds r5, 0x8 + b _0803DEBA +_0803DE90: + cmp r1, 0x20 + bne _0803DE98 + adds r5, 0xC + b _0803DEBA +_0803DE98: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0803DEAC + ldrb r0, [r4] + cmp r0, 0 + beq _0803DEAC + lsls r1, 8 + orrs r1, r0 + adds r4, 0x1 +_0803DEAC: + adds r0, r1, 0 + bl sub_803DEC8 + cmp r0, 0 + beq _0803DEBA + ldrb r0, [r0, 0x6] + adds r5, r0 +_0803DEBA: + ldrb r0, [r4] + cmp r0, 0 + bne _0803DE84 + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_803DE7C + + thumb_func_start sub_803DEC8 +sub_803DEC8: + push {r4,r5,lr} + adds r3, r0, 0 + ldr r0, _0803DEFC + ldr r0, [r0] + ldr r0, [r0, 0x4] + ldr r5, [r0] + ldr r0, _0803DF00 + adds r1, r3, r0 + ldr r0, _0803DF04 + cmp r1, r0 + bhi _0803DF08 + movs r2, 0xFF + ands r2, r3 + movs r1, 0xFF + lsls r1, 8 + ands r1, r3 + asrs r1, 8 + subs r2, 0x20 + subs r1, 0xF8 + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 5 + adds r0, r2 + lsls r0, 3 + adds r1, r5, r0 + b _0803DF56 + .align 2, 0 +_0803DEFC: .4byte gUnknown_202EC8C +_0803DF00: .4byte 0xffff0800 +_0803DF04: .4byte 0x000007fe +_0803DF08: + movs r4, 0 + ldr r0, _0803DF1C + ldr r0, [r0] + subs r2, r0, 0x1 + cmp r4, r2 + bge _0803DF48 + lsrs r0, r2, 31 + adds r0, r2, r0 + b _0803DF3A + .align 2, 0 +_0803DF1C: .4byte gUnknown_202EC90 +_0803DF20: + lsls r0, r1, 3 + adds r0, r5 + ldrh r0, [r0, 0x4] + cmp r0, r3 + bge _0803DF2E + adds r4, r1, 0x1 + b _0803DF30 +_0803DF2E: + adds r2, r1, 0 +_0803DF30: + cmp r4, r2 + bge _0803DF48 + adds r0, r4, r2 + lsrs r1, r0, 31 + adds r0, r1 +_0803DF3A: + asrs r1, r0, 1 + lsls r0, r1, 3 + adds r0, r5 + ldrh r0, [r0, 0x4] + cmp r0, r3 + bne _0803DF20 + adds r4, r1, 0 +_0803DF48: + lsls r0, r4, 3 + adds r1, r5, r0 + ldrh r0, [r1, 0x4] + cmp r0, r3 + beq _0803DF56 + adds r1, r5, 0 + adds r1, 0x8 +_0803DF56: + adds r0, r1, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_803DEC8 + + thumb_func_start sub_803DF60 +sub_803DF60: + push {r4-r7,lr} + ldr r0, _0803DFF8 + ldr r1, _0803DFFC + bl sub_800A9EC + adds r7, r0, 0 + ldr r0, [r7, 0x4] + ldr r5, [r0] + ldm r5!, {r4} + ldr r6, _0803E000 + cmp r4, 0 + beq _0803DF8C +_0803DF78: + adds r0, r6, 0 + adds r1, r5, 0 + movs r2, 0x20 + bl CpuCopy + adds r6, 0x20 + adds r5, 0x20 + subs r4, 0x1 + cmp r4, 0 + bne _0803DF78 +_0803DF8C: + adds r0, r7, 0 + bl sub_800AA14 + ldr r0, _0803E004 + ldr r1, _0803DFFC + bl sub_800A9EC + adds r7, r0, 0 + ldr r5, [r7, 0x4] + ldm r5!, {r4} + ldr r6, _0803E008 + cmp r4, 0 + beq _0803DFBA +_0803DFA6: + adds r0, r6, 0 + adds r1, r5, 0 + movs r2, 0x20 + bl CpuCopy + adds r6, 0x20 + adds r5, 0x20 + subs r4, 0x1 + cmp r4, 0 + bne _0803DFA6 +_0803DFBA: + adds r0, r7, 0 + bl sub_800AA14 + ldr r0, _0803E00C + ldr r4, _0803DFFC + adds r1, r4, 0 + bl sub_800A9EC + ldr r1, _0803E010 + str r0, [r1] + ldr r0, _0803E014 + adds r1, r4, 0 + bl sub_800A9EC + ldr r1, _0803E018 + str r0, [r1] + ldr r0, _0803E01C + adds r1, r4, 0 + bl sub_800A9EC + ldr r1, _0803E020 + str r0, [r1] + ldr r0, _0803E024 + adds r1, r4, 0 + bl sub_800A9EC + ldr r1, _0803E028 + str r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0803DFF8: .4byte gUnknown_80F61A8 +_0803DFFC: .4byte gUnknown_83B0000 +_0803E000: .4byte 0x06013400 +_0803E004: .4byte gUnknown_80F61B0 +_0803E008: .4byte 0x06014000 +_0803E00C: .4byte gUnknown_80F61B8 +_0803E010: .4byte gUnknown_202EC94 +_0803E014: .4byte gUnknown_80F61C4 +_0803E018: .4byte gUnknown_202EC98 +_0803E01C: .4byte gUnknown_80F61CC +_0803E020: .4byte gUnknown_202EC9C +_0803E024: .4byte gUnknown_80F61D4 +_0803E028: .4byte gUnknown_202ECA0 + thumb_func_end sub_803DF60 + + thumb_func_start sub_803E02C +sub_803E02C: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + bl sub_803E13C + mov r1, sp + ldr r0, _0803E118 + ldm r0!, {r2,r3} + stm r1!, {r2,r3} + ldr r1, _0803E11C + mov r0, sp + bl sub_800A9EC + adds r7, r0, 0 + ldr r0, [r7, 0x4] + ldr r5, [r0] + ldm r5!, {r4} + ldr r6, _0803E120 + cmp r4, 0 + beq _0803E06C +_0803E058: + adds r0, r6, 0 + adds r1, r5, 0 + movs r2, 0x20 + bl CpuCopy + adds r6, 0x20 + adds r5, 0x20 + subs r4, 0x1 + cmp r4, 0 + bne _0803E058 +_0803E06C: + ldr r0, _0803E124 + ldr r1, [r7, 0x4] + ldr r1, [r1, 0x4] + movs r2, 0x80 + bl CpuCopy + adds r0, r7, 0 + bl sub_800AA14 + movs r6, 0x80 + lsls r6, 2 + movs r4, 0 + ldr r0, _0803E128 + mov r9, r0 + ldr r1, _0803E12C + mov r12, r1 + movs r7, 0 + ldr r2, _0803E130 + mov r8, r2 +_0803E092: + mov r3, r12 + ldrh r0, [r3] + lsls r5, r0, 12 + adds r2, r7, 0 + movs r3, 0x8 +_0803E09C: + mov r0, r9 + ldr r1, [r0] + add r1, r8 + adds r1, r2 + adds r0, r5, 0 + orrs r0, r6 + strh r0, [r1] + adds r6, 0x1 + adds r2, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _0803E09C + movs r1, 0x2 + add r12, r1 + adds r7, 0x12 + adds r4, 0x1 + cmp r4, 0x1C + ble _0803E092 + movs r4, 0 + ldr r5, _0803E128 + ldr r3, _0803E134 + movs r2, 0xC0 + lsls r2, 8 +_0803E0CA: + ldr r0, [r5] + lsls r1, r4, 1 + adds r0, r3 + adds r0, r1 + strh r2, [r0] + adds r4, 0x1 + cmp r4, 0x8 + ble _0803E0CA + movs r4, 0 + ldr r2, _0803E128 + movs r6, 0xBE + lsls r6, 1 + ldr r5, _0803E138 + movs r3, 0xBF + lsls r3, 1 +_0803E0E8: + ldr r0, [r2] + lsls r1, r4, 2 + adds r0, r1 + adds r0, r6 + strb r4, [r0] + ldr r0, [r2] + adds r0, r1 + adds r0, r5 + strb r4, [r0] + ldr r0, [r2] + adds r0, r1 + adds r0, r3 + strb r4, [r0] + adds r4, 0x1 + cmp r4, 0xFF + ble _0803E0E8 + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0803E118: .4byte gUnknown_80F61DC +_0803E11C: .4byte gUnknown_83B0000 +_0803E120: .4byte 0x0600c000 +_0803E124: .4byte gUnknown_202ECA4 +_0803E128: .4byte gUnknown_203B418 +_0803E12C: .4byte gUnknown_80F5F70 +_0803E130: .4byte 0x00012a18 +_0803E134: .4byte 0x00013554 +_0803E138: .4byte 0x0000017d + thumb_func_end sub_803E02C + + thumb_func_start sub_803E13C +sub_803E13C: + push {r4,r5,lr} + bl sub_8094C14 + ldr r0, _0803E170 + ldr r0, [r0] + ldrb r0, [r0, 0xB] + ldr r5, _0803E174 + cmp r0, 0 + beq _0803E154 + movs r0, 0x80 + lsls r0, 1 + adds r5, r0 +_0803E154: + movs r4, 0 +_0803E156: + adds r0, r4, 0 + adds r0, 0xF0 + adds r1, r5, 0 + bl SetBGPaletteBufferColorArray + adds r5, 0x4 + adds r4, 0x1 + cmp r4, 0xF + ble _0803E156 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0803E170: .4byte gUnknown_203B46C +_0803E174: .4byte gUnknown_202D038 + thumb_func_end sub_803E13C + + thumb_func_start sub_803E178 +sub_803E178: + push {r4,lr} + bl sub_8043D10 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0803E1E0 + ldr r0, _0803E1AC + ldr r2, [r0] + ldr r3, _0803E1B0 + adds r1, r2, r3 + ldrb r1, [r1] + adds r3, r0, 0 + cmp r1, 0x15 + bne _0803E1BC + ldr r1, _0803E1B4 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0803E1BC + ldr r3, _0803E1B8 + adds r1, r2, r3 + movs r0, 0x1C + strh r0, [r1] + b _0803E204 + .align 2, 0 +_0803E1AC: .4byte gUnknown_203B418 +_0803E1B0: .4byte 0x00000644 +_0803E1B4: .4byte 0x000037fe +_0803E1B8: .4byte 0x00003a12 +_0803E1BC: + ldr r4, [r3] + ldr r1, _0803E1D8 + adds r0, r4, r1 + ldrb r0, [r0] + bl sub_80900C0 + lsls r0, 24 + movs r1, 0x16 + cmp r0, 0 + beq _0803E1D2 + movs r1, 0x17 +_0803E1D2: + ldr r2, _0803E1DC + adds r0, r4, r2 + b _0803E202 + .align 2, 0 +_0803E1D8: .4byte 0x00000644 +_0803E1DC: .4byte 0x00003a12 +_0803E1E0: + cmp r0, 0x1 + bne _0803E1F8 + ldr r0, _0803E1F0 + ldr r0, [r0] + ldr r3, _0803E1F4 + adds r0, r3 + movs r1, 0x6 + b _0803E202 + .align 2, 0 +_0803E1F0: .4byte gUnknown_203B418 +_0803E1F4: .4byte 0x00003a12 +_0803E1F8: + ldr r0, _0803E20C + ldr r0, [r0] + ldr r1, _0803E210 + adds r0, r1 + movs r1, 0x18 +_0803E202: + strh r1, [r0] +_0803E204: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0803E20C: .4byte gUnknown_203B418 +_0803E210: .4byte 0x00003a12 + thumb_func_end sub_803E178 + + thumb_func_start sub_803E214 +sub_803E214: + push {lr} + ldr r0, _0803E23C + ldr r0, [r0] + bl sub_800AA14 + ldr r0, _0803E240 + ldr r0, [r0] + bl sub_800AA14 + ldr r0, _0803E244 + ldr r0, [r0] + bl sub_800AA14 + ldr r0, _0803E248 + ldr r0, [r0] + bl sub_800AA14 + pop {r0} + bx r0 + .align 2, 0 +_0803E23C: .4byte gUnknown_202EC94 +_0803E240: .4byte gUnknown_202EC98 +_0803E244: .4byte gUnknown_202EC9C +_0803E248: .4byte gUnknown_202ECA0 + thumb_func_end sub_803E214 + + thumb_func_start nullsub_56 +nullsub_56: + bx lr + thumb_func_end nullsub_56 + + thumb_func_start sub_803E250 +sub_803E250: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + ldr r1, _0803E3FC + ldr r0, _0803E400 + str r0, [r1] + ldr r0, _0803E404 + movs r1, 0 + str r1, [r0] + ldr r0, _0803E408 + strb r1, [r0] + ldr r0, _0803E40C + strh r1, [r0] + ldr r5, _0803E410 + ldrh r0, [r5, 0x6] + movs r3, 0xF + adds r2, r3, 0 + ands r2, r0 + ldrh r4, [r5] + ldr r1, _0803E414 + adds r0, r1, 0 + ands r0, r4 + ldr r4, _0803E418 + ands r0, r4 + ldr r6, _0803E41C + ands r0, r6 + ldr r7, _0803E420 + ands r0, r7 + ldr r4, _0803E424 + mov r12, r4 + ands r0, r4 + ldr r4, _0803E428 + ands r0, r4 + strh r0, [r5] + movs r0, 0x80 + lsls r0, 7 + strh r0, [r5, 0x2] + movs r0, 0 + strh r0, [r5, 0x4] + ldr r0, _0803E42C + mov r10, r0 + ands r2, r0 + subs r0, 0x1 + mov r9, r0 + ands r2, r0 + subs r0, 0x2 + mov r8, r0 + ands r2, r0 + strh r2, [r5, 0x6] + ldr r2, _0803E430 + ldrh r0, [r2, 0x6] + ands r3, r0 + ldrh r0, [r2] + ands r1, r0 + ldr r0, _0803E418 + ands r1, r0 + ands r1, r6 + ands r1, r7 + mov r7, r12 + ands r1, r7 + ands r1, r4 + strh r1, [r2] + movs r0, 0 + strh r0, [r2, 0x2] + movs r0, 0xB8 + lsls r0, 7 + strh r0, [r2, 0x4] + mov r0, r10 + ands r3, r0 + mov r1, r9 + ands r3, r1 + mov r7, r8 + ands r3, r7 + strh r3, [r2, 0x6] + movs r0, 0 + mov r8, r0 +_0803E2EE: + movs r1, 0 + mov r9, r1 + mov r2, r8 + lsls r0, r2, 3 + lsls r2, 1 + mov r12, r2 + mov r3, r8 + adds r3, 0x1 + str r3, [sp] + mov r10, r1 + add r0, r8 + lsls r5, r0, 3 + ldr r4, _0803E434 + adds r4, r5, r4 + str r4, [sp, 0x4] + ldr r7, _0803E438 + adds r6, r5, r7 + ldr r0, _0803E43C + adds r3, r5, r0 + ldr r1, _0803E440 + adds r4, r5, r1 +_0803E318: + mov r7, r10 + adds r2, r5, r7 + ldrh r1, [r3] + ldr r0, _0803E414 + ands r0, r1 + ldr r1, _0803E418 + ands r0, r1 + ldr r1, _0803E41C + ands r0, r1 + ldr r1, _0803E420 + ands r0, r1 + ldr r1, _0803E424 + ands r0, r1 + strh r0, [r3] + ldr r1, [r4] + movs r7, 0x3 + ands r1, r7 + lsls r1, 14 + ldr r7, _0803E428 + ands r0, r7 + orrs r0, r1 + strh r0, [r3] + ldrh r1, [r3, 0x2] + ldr r0, _0803E444 + ands r0, r1 + strh r0, [r3, 0x2] + ldr r1, _0803E440 + adds r1, 0x4 + adds r2, r1 + ldr r1, [r2] + movs r2, 0x3 + ands r1, r2 + lsls r1, 14 + ands r0, r7 + orrs r0, r1 + strh r0, [r3, 0x2] + ldr r1, [r6] + ldr r0, _0803E448 + ands r1, r0 + ldrh r2, [r3, 0x4] + movs r0, 0xFC + lsls r0, 8 + ands r0, r2 + orrs r0, r1 + ldr r7, _0803E41C + ands r0, r7 + movs r1, 0xC0 + lsls r1, 4 + orrs r0, r1 + movs r2, 0 + orrs r0, r2 + ldr r1, _0803E44C + ands r0, r1 + strh r0, [r3, 0x4] + ldrh r1, [r3, 0x6] + ldr r0, _0803E42C + ands r0, r1 + ldr r1, _0803E450 + ands r0, r1 + strh r0, [r3, 0x6] + mov r7, r9 + lsls r1, r7, 2 + mov r0, r12 + add r0, r8 + lsls r0, 3 + adds r1, r0 + ldr r0, _0803E454 + adds r1, r0, r1 + ldr r0, [r1] + ldr r1, [sp, 0x4] + str r0, [r1] + adds r1, 0xC + str r1, [sp, 0x4] + adds r6, 0xC + adds r3, 0xC + adds r4, 0xC + movs r2, 0xC + add r10, r2 + movs r7, 0x1 + add r9, r7 + mov r0, r9 + cmp r0, 0x5 + ble _0803E318 + ldr r1, [sp] + mov r8, r1 + cmp r1, 0x1 + ble _0803E2EE + movs r2, 0 + ldr r3, _0803E458 + ldr r0, [r3] + ldr r4, _0803E45C + adds r0, r4 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r3] + ldr r7, _0803E460 + adds r0, r7 + strb r1, [r0] + ldr r0, _0803E464 + str r2, [r0] + movs r0, 0xF8 + ldr r1, _0803E468 + movs r3, 0 + bl SetBGPaletteBufferColorRGB + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0803E3FC: .4byte gUnknown_202EDD0 +_0803E400: .4byte 0x000003e7 +_0803E404: .4byte gUnknown_202EDD4 +_0803E408: .4byte gUnknown_203B40D +_0803E40C: .4byte gUnknown_202EDE8 +_0803E410: .4byte gUnknown_202EDC0 +_0803E414: .4byte 0x0000feff +_0803E418: .4byte 0x0000fdff +_0803E41C: .4byte 0x0000f3ff +_0803E420: .4byte 0x0000efff +_0803E424: .4byte 0x0000dfff +_0803E428: .4byte 0x00003fff +_0803E42C: .4byte 0x0000fffe +_0803E430: .4byte gUnknown_202EDB8 +_0803E434: .4byte gUnknown_202ED30 +_0803E438: .4byte gUnknown_80F6224 +_0803E43C: .4byte gUnknown_202ED28 +_0803E440: .4byte gUnknown_80F621C +_0803E444: .4byte 0x0000c1ff +_0803E448: .4byte 0x000003ff +_0803E44C: .4byte 0x00000fff +_0803E450: .4byte 0x0000fffd +_0803E454: .4byte gUnknown_80F61EC +_0803E458: .4byte gUnknown_203B418 +_0803E45C: .4byte 0x00018217 +_0803E460: .4byte 0x00018218 +_0803E464: .4byte gUnknown_202EDC8 +_0803E468: .4byte gUnknown_202D058 + thumb_func_end sub_803E250 + + thumb_func_start sub_803E46C +sub_803E46C: + push {lr} + adds r1, r0, 0 + ldr r0, _0803E480 + ldrb r0, [r0] + cmp r0, 0 + beq _0803E484 + adds r0, r1, 0 + bl sub_803E490 + b _0803E48A + .align 2, 0 +_0803E480: .4byte gUnknown_203B40C +_0803E484: + adds r0, r1, 0 + bl sub_803E668 +_0803E48A: + pop {r0} + bx r0 + thumb_func_end sub_803E46C + + thumb_func_start sub_803E490 +sub_803E490: + push {r4,r5,lr} + sub sp, 0x8 + ldr r1, _0803E4D8 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + bl sub_80524F0 + bl sub_8085F78 + movs r0, 0x1 + bl sub_803F580 + ldr r2, _0803E4DC + ldr r1, [r2] + ldr r3, _0803E4E0 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + beq _0803E4EC + ldr r4, _0803E4E4 + adds r1, r4 + movs r0, 0x2 + strb r0, [r1] + ldr r1, [r2] + ldr r2, _0803E4E8 + adds r0, r1, r2 + movs r3, 0 + ldrsh r0, [r0, r3] + subs r4, 0x16 + adds r1, r4 + movs r2, 0 + ldrsh r1, [r1, r2] + bl sub_800CCA0 + b _0803E4FC + .align 2, 0 +_0803E4D8: .4byte gUnknown_202EDD4 +_0803E4DC: .4byte gUnknown_203B418 +_0803E4E0: .4byte 0x0001821a +_0803E4E4: .4byte 0x00018208 +_0803E4E8: .4byte 0x000181f0 +_0803E4EC: + ldr r3, _0803E628 + adds r1, r3 + movs r0, 0x3 + strb r0, [r1] + movs r0, 0 + movs r1, 0 + bl sub_800CCA0 +_0803E4FC: + ldr r4, _0803E62C + ldr r2, [r4] + ldr r5, _0803E630 + adds r0, r2, r5 + movs r1, 0 + ldrsh r0, [r0, r1] + ldr r3, _0803E634 + adds r1, r2, r3 + movs r3, 0 + ldrsh r1, [r1, r3] + ldr r3, _0803E638 + adds r2, r3 + ldr r2, [r2] + subs r1, r2 + bl sub_800CCAC + bl sub_806CC10 + bl sub_804522C + bl sub_803F9CC + ldr r0, [r4] + adds r0, r5 + bl sub_800F7D0 + ldr r1, [r4] + ldrh r2, [r1, 0x12] + movs r3, 0x12 + ldrsh r0, [r1, r3] + cmp r0, 0x63 + bgt _0803E540 + adds r0, r2, 0x1 + strh r0, [r1, 0x12] +_0803E540: + ldr r0, [r4] + adds r0, r5 + bl sub_800E90C + bl sub_8042E5C + ldr r0, _0803E63C + ldr r0, [r0] + cmp r0, 0 + beq _0803E562 + cmp r0, 0x3 + beq _0803E562 + ldr r0, _0803E640 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r0, 0x6 + bne _0803E566 +_0803E562: + bl sub_8040894 +_0803E566: + bl sub_803ECE0 + bl sub_803EDF0 + ldr r0, _0803E62C + ldr r3, [r0] + ldr r4, _0803E644 + adds r0, r3, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _0803E5A2 + ldr r1, _0803E648 + adds r0, r3, r1 + ldr r0, [r0] + cmp r0, 0x3 + beq _0803E5A2 + ldr r0, _0803E64C + ldrb r0, [r0] + ldr r1, _0803E650 + ldr r2, _0803E654 + ldr r2, [r2] + str r2, [sp] + movs r4, 0xBE + lsls r4, 1 + adds r2, r3, r4 + str r2, [sp, 0x4] + movs r2, 0xA0 + movs r3, 0x20 + bl sub_8004AF0 +_0803E5A2: + ldr r0, _0803E640 + ldr r0, [r0] + ldrb r0, [r0, 0xA] + bl nullsub_8 + bl sub_8005180 + bl nullsub_12 + bl sub_80060EC + ldr r1, _0803E658 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r0, _0803E65C + ldr r0, [r0] + bl sub_8094FB4 + bl sub_800CB20 + bl sub_800485C + bl CopySpritesToOam + bl nullsub_13 + bl sub_8005304 + bl nullsub_14 + bl TransferBGPaletteBuffer + bl sub_8009908 + bl xxx_call_update_bg_vram + bl sub_8040788 + bl xxx_call_update_bg_sound_input + ldr r0, _0803E62C + ldr r0, [r0] + ldr r1, _0803E660 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + bl sub_8083F58 + bl sub_8011860 + bl sub_8040B60 + movs r0, 0 + bl sub_8004D8C + movs r0, 0 + bl nullsub_10 + ldr r1, _0803E664 + ldr r0, [r1] + subs r0, 0x1 + str r0, [r1] + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0803E628: .4byte 0x00018208 +_0803E62C: .4byte gUnknown_203B418 +_0803E630: .4byte 0x000181f0 +_0803E634: .4byte 0x000181f2 +_0803E638: .4byte 0x000181fc +_0803E63C: .4byte gUnknown_202EDD0 +_0803E640: .4byte gUnknown_203B46C +_0803E644: .4byte 0x00018215 +_0803E648: .4byte 0x0001c06c +_0803E64C: .4byte gUnknown_203B40D +_0803E650: .4byte gUnknown_202EE8C +_0803E654: .4byte gUnknown_202EDC8 +_0803E658: .4byte gUnknown_202EDCC +_0803E65C: .4byte gUnknown_203B47C +_0803E660: .4byte 0x00018213 +_0803E664: .4byte gUnknown_202EDD4 + thumb_func_end sub_803E490 + + thumb_func_start sub_803E668 +sub_803E668: + push {r4,lr} + ldr r4, _0803E6F0 + ldr r0, [r4] + adds r0, 0x1 + str r0, [r4] + ldr r0, _0803E6F4 + ldr r0, [r0] + ldrb r0, [r0, 0xA] + bl nullsub_8 + bl sub_8005180 + bl nullsub_12 + movs r0, 0 + movs r1, 0 + bl sub_8005838 + bl sub_80060EC + ldr r1, _0803E6F8 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r0, _0803E6FC + ldr r0, [r0] + bl sub_8094FB4 + bl sub_800CB20 + bl sub_800485C + bl CopySpritesToOam + bl nullsub_13 + bl sub_8005304 + bl nullsub_14 + bl TransferBGPaletteBuffer + bl sub_8009908 + bl xxx_call_update_bg_vram + bl xxx_call_update_bg_sound_input + ldr r0, _0803E700 + ldr r0, [r0] + ldr r1, _0803E704 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + bl sub_8011860 + movs r0, 0 + bl sub_8004D8C + movs r0, 0 + bl nullsub_10 + ldr r0, [r4] + subs r0, 0x1 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0803E6F0: .4byte gUnknown_202EDD4 +_0803E6F4: .4byte gUnknown_203B46C +_0803E6F8: .4byte gUnknown_202EDCC +_0803E6FC: .4byte gUnknown_203B47C +_0803E700: .4byte gUnknown_203B418 +_0803E704: .4byte 0x00018213 + thumb_func_end sub_803E668 + + thumb_func_start sub_803E708 +sub_803E708: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + cmp r4, 0 + beq _0803E71E +_0803E712: + adds r0, r5, 0 + bl sub_803E46C + subs r4, 0x1 + cmp r4, 0 + bne _0803E712 +_0803E71E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_803E708 + + thumb_func_start sub_803E724 +sub_803E724: + push {r4-r6,lr} + adds r4, r0, 0 + ldr r5, _0803E744 + movs r6, 0xF0 +_0803E72C: + adds r0, r4, 0 + bl sub_803E46C + ldrh r1, [r5] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _0803E72C + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0803E744: .4byte gUnknown_20255F0 + thumb_func_end sub_803E724 + + thumb_func_start sub_803E748 +sub_803E748: + push {r4,r5,lr} + movs r5, 0x1F + ldr r1, _0803E7B8 + movs r0, 0x1 + strb r0, [r1] + ldr r1, _0803E7BC + movs r0, 0 + str r0, [r1] + movs r0, 0x1 + movs r1, 0x1F + bl sub_803E874 + movs r4, 0 +_0803E762: + cmp r4, 0x1F + bgt _0803E780 + subs r5, 0x2 + cmp r5, 0 + bgt _0803E780 + movs r5, 0 + movs r0, 0x1 + movs r1, 0 + bl sub_803EAF0 + ldr r0, _0803E7C0 + ldr r0, [r0] + ldr r1, _0803E7C4 + adds r0, r1 + strb r5, [r0] +_0803E780: + cmp r4, 0xB + ble _0803E790 + ldr r1, _0803E7BC + ldr r0, [r1] + cmp r0, 0x1E + bgt _0803E790 + adds r0, 0x1 + str r0, [r1] +_0803E790: + movs r0, 0x1 + adds r1, r5, 0 + bl sub_803E874 + movs r0, 0x5 + bl sub_803E46C + adds r4, 0x1 + cmp r4, 0x2B + ble _0803E762 + ldr r1, _0803E7B8 + movs r0, 0 + strb r0, [r1] + ldr r1, _0803E7BC + movs r0, 0x1F + str r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0803E7B8: .4byte gUnknown_203B40D +_0803E7BC: .4byte gUnknown_202EDC8 +_0803E7C0: .4byte gUnknown_203B418 +_0803E7C4: .4byte 0x00018217 + thumb_func_end sub_803E748 + + thumb_func_start sub_803E7C8 +sub_803E7C8: + push {r4,r5,lr} + movs r4, 0x1F + ldr r1, _0803E820 + movs r0, 0x1 + strb r0, [r1] + ldr r1, _0803E824 + movs r0, 0 + str r0, [r1] + movs r0, 0x5 + bl sub_803E46C + movs r5, 0 +_0803E7E0: + movs r0, 0x1 + adds r1, r4, 0 + bl sub_803E874 + cmp r5, 0x1F + bgt _0803E806 + subs r4, 0x2 + cmp r4, 0 + bgt _0803E806 + movs r4, 0 + movs r0, 0x1 + movs r1, 0 + bl sub_803EAF0 + ldr r0, _0803E828 + ldr r0, [r0] + ldr r1, _0803E82C + adds r0, r1 + strb r4, [r0] +_0803E806: + movs r0, 0x5 + bl sub_803E46C + adds r5, 0x1 + cmp r5, 0x2B + ble _0803E7E0 + ldr r1, _0803E820 + movs r0, 0 + strb r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0803E820: .4byte gUnknown_203B40D +_0803E824: .4byte gUnknown_202EDC8 +_0803E828: .4byte gUnknown_203B418 +_0803E82C: .4byte 0x00018217 + thumb_func_end sub_803E7C8 + + thumb_func_start sub_803E830 +sub_803E830: + push {r4,r5,lr} + ldr r1, _0803E86C + movs r0, 0x1 + strb r0, [r1] + ldr r5, _0803E870 + movs r4, 0x1F +_0803E83C: + movs r0, 0 + movs r1, 0 + bl sub_803E874 + movs r0, 0x5 + bl sub_803E46C + ldr r0, [r5] + cmp r0, 0 + ble _0803E854 + subs r0, 0x1 + str r0, [r5] +_0803E854: + subs r4, 0x1 + cmp r4, 0 + bge _0803E83C + ldr r0, _0803E870 + movs r1, 0 + str r1, [r0] + ldr r0, _0803E86C + strb r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0803E86C: .4byte gUnknown_203B40D +_0803E870: .4byte gUnknown_202EDC8 + thumb_func_end sub_803E830 + + thumb_func_start sub_803E874 +sub_803E874: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + mov r9, r1 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r0, _0803E9A4 + ldr r0, [r0] + ldr r5, [r0, 0x4] + ldr r1, _0803E9A8 + ldr r0, _0803E9AC + ldr r2, [r0] + ldr r0, _0803E9B0 + ldr r3, [r0] + movs r0, 0xBE + lsls r0, 1 + adds r3, r0 + movs r0, 0 + bl SetBGPaletteBufferColorRGB + adds r5, 0x4 + movs r6, 0x1 + movs r4, 0x9F +_0803E8AA: + ldr r1, _0803E9AC + mov r8, r1 + ldr r2, [r1] + ldr r7, _0803E9B0 + ldr r3, [r7] + movs r0, 0xBE + lsls r0, 1 + adds r3, r0 + adds r0, r6, 0 + adds r1, r5, 0 + bl SetBGPaletteBufferColorRGB + adds r5, 0x4 + adds r6, 0x1 + subs r4, 0x1 + cmp r4, 0 + bne _0803E8AA + ldr r3, [r7] + ldr r1, _0803E9B4 + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0803E8E2 + ldr r2, _0803E9B8 + adds r0, r3, r2 + ldr r0, [r0] + cmp r0, 0x3 + bne _0803E8FC +_0803E8E2: + ldr r1, _0803E9BC + mov r2, r8 + ldr r0, [r2] + str r0, [sp] + movs r2, 0xBE + lsls r2, 1 + adds r0, r3, r2 + str r0, [sp, 0x4] + movs r0, 0x1 + movs r2, 0xA0 + movs r3, 0x20 + bl sub_8004AF0 +_0803E8FC: + adds r6, 0x20 + ldr r5, _0803E9C0 + movs r4, 0x20 +_0803E902: + ldr r0, _0803E9AC + ldr r2, [r0] + ldr r0, _0803E9B0 + ldr r3, [r0] + movs r0, 0xBE + lsls r0, 1 + adds r3, r0 + adds r0, r6, 0 + adds r1, r5, 0 + bl SetBGPaletteBufferColorRGB + adds r5, 0x4 + adds r6, 0x1 + subs r4, 0x1 + cmp r4, 0 + bne _0803E902 + mov r1, r10 + cmp r1, 0 + beq _0803E948 + movs r6, 0xE0 + ldr r0, _0803E9C4 + ldr r0, [r0] + ldr r5, [r0, 0x4] + movs r4, 0x10 +_0803E932: + adds r0, r6, 0 + adds r1, r5, 0 + mov r2, r9 + movs r3, 0 + bl SetBGPaletteBufferColorRGB + adds r5, 0x4 + adds r6, 0x1 + subs r4, 0x1 + cmp r4, 0 + bne _0803E932 +_0803E948: + ldr r1, _0803E9C8 + ldr r4, _0803E9AC + ldr r2, [r4] + movs r0, 0xF8 + movs r3, 0 + bl SetBGPaletteBufferColorRGB + ldr r0, _0803E9B0 + ldr r0, [r0] + ldr r2, _0803E9CC + adds r0, r2 + ldr r0, [r0] + ldr r5, [r0, 0x4] + movs r6, 0x80 + lsls r6, 1 + adds r7, r4, 0 + movs r4, 0xD0 +_0803E96A: + ldr r2, [r7] + ldr r0, _0803E9B0 + ldr r3, [r0] + movs r0, 0xBE + lsls r0, 1 + adds r3, r0 + adds r0, r6, 0 + adds r1, r5, 0 + bl SetBGPaletteBufferColorRGB + ldr r2, [r7] + adds r0, r6, 0 + adds r1, r5, 0 + movs r3, 0 + bl nullsub_4 + adds r5, 0x4 + adds r6, 0x1 + subs r4, 0x1 + cmp r4, 0 + bne _0803E96A + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0803E9A4: .4byte gUnknown_202EE88 +_0803E9A8: .4byte gUnknown_80F62AC +_0803E9AC: .4byte gUnknown_202EDC8 +_0803E9B0: .4byte gUnknown_203B418 +_0803E9B4: .4byte 0x00018215 +_0803E9B8: .4byte 0x0001c06c +_0803E9BC: .4byte gUnknown_202EE8C +_0803E9C0: .4byte gUnknown_202ECA4 +_0803E9C4: .4byte gUnknown_202EC88 +_0803E9C8: .4byte gUnknown_202D058 +_0803E9CC: .4byte 0x000181e4 + thumb_func_end sub_803E874 + + thumb_func_start sub_803E9D0 +sub_803E9D0: + push {r4-r7,lr} + ldr r0, _0803EA04 + ldr r0, [r0] + ldr r1, _0803EA08 + adds r0, r1 + ldr r0, [r0] + ldr r4, [r0, 0x4] + movs r6, 0x80 + lsls r6, 1 + ldr r7, _0803EA0C + movs r5, 0xD0 +_0803E9E6: + ldr r2, [r7] + adds r0, r6, 0 + adds r1, r4, 0 + movs r3, 0 + bl nullsub_4 + adds r4, 0x4 + adds r6, 0x1 + subs r5, 0x1 + cmp r5, 0 + bne _0803E9E6 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0803EA04: .4byte gUnknown_203B418 +_0803EA08: .4byte 0x000181e4 +_0803EA0C: .4byte gUnknown_202EDC8 + thumb_func_end sub_803E9D0 + + thumb_func_start sub_803EA10 +sub_803EA10: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + ldr r0, _0803EACC + ldr r0, [r0] + ldr r4, [r0, 0x4] + ldr r1, _0803EAD0 + ldr r0, _0803EAD4 + ldr r2, [r0] + ldr r0, _0803EAD8 + ldr r3, [r0] + movs r0, 0xBE + lsls r0, 1 + adds r3, r0 + movs r0, 0 + bl SetBGPaletteBufferColorRGB + adds r4, 0x4 + movs r6, 0x1 + movs r5, 0x9F +_0803EA3A: + ldr r1, _0803EAD4 + mov r8, r1 + ldr r2, [r1] + ldr r7, _0803EAD8 + ldr r3, [r7] + movs r0, 0xBE + lsls r0, 1 + adds r3, r0 + adds r0, r6, 0 + adds r1, r4, 0 + bl SetBGPaletteBufferColorRGB + adds r4, 0x4 + adds r6, 0x1 + subs r5, 0x1 + cmp r5, 0 + bne _0803EA3A + ldr r3, [r7] + ldr r1, _0803EADC + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0803EA72 + ldr r2, _0803EAE0 + adds r0, r3, r2 + ldr r0, [r0] + cmp r0, 0x3 + bne _0803EA8C +_0803EA72: + ldr r1, _0803EAE4 + mov r2, r8 + ldr r0, [r2] + str r0, [sp] + movs r2, 0xBE + lsls r2, 1 + adds r0, r3, r2 + str r0, [sp, 0x4] + movs r0, 0x1 + movs r2, 0xA0 + movs r3, 0x20 + bl sub_8004AF0 +_0803EA8C: + adds r6, 0x20 + ldr r4, _0803EAE8 + movs r5, 0x20 +_0803EA92: + ldr r7, _0803EAD4 + ldr r2, [r7] + ldr r0, _0803EAD8 + ldr r3, [r0] + movs r0, 0xBE + lsls r0, 1 + adds r3, r0 + adds r0, r6, 0 + adds r1, r4, 0 + bl SetBGPaletteBufferColorRGB + adds r4, 0x4 + adds r6, 0x1 + subs r5, 0x1 + cmp r5, 0 + bne _0803EA92 + ldr r1, _0803EAEC + ldr r2, [r7] + movs r0, 0xF8 + movs r3, 0 + bl SetBGPaletteBufferColorRGB + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0803EACC: .4byte gUnknown_202EE88 +_0803EAD0: .4byte gUnknown_80F62AC +_0803EAD4: .4byte gUnknown_202EDC8 +_0803EAD8: .4byte gUnknown_203B418 +_0803EADC: .4byte 0x00018215 +_0803EAE0: .4byte 0x0001c06c +_0803EAE4: .4byte gUnknown_202EE8C +_0803EAE8: .4byte gUnknown_202ECA4 +_0803EAEC: .4byte gUnknown_202D058 + thumb_func_end sub_803EA10 + + thumb_func_start sub_803EAF0 +sub_803EAF0: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, _0803EB20 + ldr r0, [r0] + cmp r4, r0 + bne _0803EB00 + b _0803EC88 +_0803EB00: + cmp r4, 0x5 + bne _0803EB06 + b _0803EC1C +_0803EB06: + cmp r4, 0x5 + bhi _0803EB2E + cmp r4, 0x2 + bne _0803EB10 + b _0803EBFC +_0803EB10: + cmp r4, 0x2 + bhi _0803EB24 + cmp r4, 0 + beq _0803EB70 + cmp r4, 0x1 + beq _0803EB50 + b _0803EC84 + .align 2, 0 +_0803EB20: .4byte gUnknown_202EDD0 +_0803EB24: + cmp r4, 0x3 + beq _0803EB98 + cmp r4, 0x4 + beq _0803EBFC + b _0803EC84 +_0803EB2E: + cmp r4, 0x8 + bne _0803EB34 + b _0803EC34 +_0803EB34: + cmp r4, 0x8 + bhi _0803EB42 + cmp r4, 0x6 + beq _0803EBBC + cmp r4, 0x7 + beq _0803EBDC + b _0803EC84 +_0803EB42: + cmp r4, 0xA + bne _0803EB48 + b _0803EC80 +_0803EB48: + cmp r4, 0xA + bcs _0803EB4E + b _0803EC54 +_0803EB4E: + b _0803EC84 +_0803EB50: + ldr r0, _0803EB6C + ldrb r0, [r0] + cmp r0, 0 + beq _0803EB5E + movs r0, 0 + bl sub_8052210 +_0803EB5E: + bl sub_8004914 + bl sub_803EC94 + movs r0, 0 + movs r1, 0x1 + b _0803EC6E + .align 2, 0 +_0803EB6C: .4byte gUnknown_203B40C +_0803EB70: + bl sub_803EC94 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, _0803EB94 + ldrb r0, [r0] + cmp r0, 0 + bne _0803EB88 + b _0803EC84 +_0803EB88: + bl sub_8040A84 + movs r0, 0 + bl sub_8040ABC + b _0803EC84 + .align 2, 0 +_0803EB94: .4byte gUnknown_203B40C +_0803EB98: + ldr r0, _0803EBB4 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, _0803EBB8 + ldrb r0, [r0] + cmp r0, 0 + beq _0803EC84 + movs r0, 0x1 + bl sub_8040ABC + b _0803EC84 + .align 2, 0 +_0803EBB4: .4byte gUnknown_80F62B0 +_0803EBB8: .4byte gUnknown_203B40C +_0803EBBC: + ldr r0, _0803EBD4 + ldrb r0, [r0] + cmp r0, 0 + beq _0803EBCA + movs r0, 0 + bl sub_8052210 +_0803EBCA: + bl sub_8004914 + ldr r0, _0803EBD8 + movs r1, 0x1 + b _0803EC6E + .align 2, 0 +_0803EBD4: .4byte gUnknown_203B40C +_0803EBD8: .4byte gUnknown_80F6310 +_0803EBDC: + ldr r0, _0803EBF4 + ldrb r0, [r0] + cmp r0, 0 + beq _0803EBEA + movs r0, 0 + bl sub_8052210 +_0803EBEA: + bl sub_8004914 + ldr r0, _0803EBF8 + movs r1, 0x1 + b _0803EC6E + .align 2, 0 +_0803EBF4: .4byte gUnknown_203B40C +_0803EBF8: .4byte gUnknown_80F6370 +_0803EBFC: + ldr r0, _0803EC18 + ldrb r0, [r0] + cmp r0, 0 + beq _0803EC0A + movs r0, 0 + bl sub_8052210 +_0803EC0A: + bl sub_8004914 + bl sub_803EC94 + movs r0, 0 + movs r1, 0x1 + b _0803EC6E + .align 2, 0 +_0803EC18: .4byte gUnknown_203B40C +_0803EC1C: + ldr r0, _0803EC30 + ldrb r0, [r0] + cmp r0, 0 + beq _0803EC2A + movs r0, 0 + bl sub_8052210 +_0803EC2A: + movs r0, 0 + movs r1, 0x1 + b _0803EC6E + .align 2, 0 +_0803EC30: .4byte gUnknown_203B40C +_0803EC34: + ldr r0, _0803EC50 + ldrb r0, [r0] + cmp r0, 0 + beq _0803EC46 + bl sub_8083D44 + movs r0, 0 + bl sub_8052210 +_0803EC46: + movs r0, 0x2 + adds r1, r5, 0 + bl sub_801602C + b _0803EC84 + .align 2, 0 +_0803EC50: .4byte gUnknown_203B40C +_0803EC54: + ldr r0, _0803EC78 + ldrb r0, [r0] + cmp r0, 0 + beq _0803EC66 + movs r0, 0 + bl sub_8052210 + bl sub_8083D44 +_0803EC66: + bl sub_8004914 + ldr r0, _0803EC7C + movs r1, 0 +_0803EC6E: + movs r2, 0x1 + bl sub_800641C + b _0803EC84 + .align 2, 0 +_0803EC78: .4byte gUnknown_203B40C +_0803EC7C: .4byte gUnknown_80F63D0 +_0803EC80: + bl sub_8083D44 +_0803EC84: + ldr r0, _0803EC90 + str r4, [r0] +_0803EC88: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0803EC90: .4byte gUnknown_202EDD0 + thumb_func_end sub_803EAF0 + + thumb_func_start sub_803EC94 +sub_803EC94: + push {lr} + ldr r0, _0803ECB0 + movs r1, 0 + strh r1, [r0, 0x1E] + strh r1, [r0, 0x20] + strh r1, [r0, 0xC] + strh r1, [r0, 0xE] + strh r1, [r0, 0x14] + adds r0, 0x28 + bl sub_801317C + pop {r0} + bx r0 + .align 2, 0 +_0803ECB0: .4byte gUnknown_202EE10 + thumb_func_end sub_803EC94 + + thumb_func_start sub_803ECB4 +sub_803ECB4: + push {r4,r5,lr} + adds r5, r0, 0 + lsls r4, r1, 24 + lsrs r4, 24 + ldr r1, _0803ECDC + movs r0, 0xA + str r0, [r1] + movs r0, 0 + bl sub_8052210 + bl sub_8004914 + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl sub_800641C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0803ECDC: .4byte gUnknown_202EDD0 + thumb_func_end sub_803ECB4 + + thumb_func_start sub_803ECE0 +sub_803ECE0: + push {lr} + ldr r1, _0803ED24 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + cmp r0, 0 + bge _0803ECF2 + movs r0, 0 + str r0, [r1] +_0803ECF2: + ldr r0, [r1] + cmp r0, 0xB + ble _0803ECFC + movs r0, 0 + str r0, [r1] +_0803ECFC: + ldr r0, _0803ED28 + ldr r2, [r0] + ldr r0, [r1] + cmp r0, 0 + bge _0803ED08 + adds r0, 0x3 +_0803ED08: + asrs r1, r0, 2 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 6 + ldr r1, [r2, 0x4] + adds r1, r0 + movs r2, 0x90 + lsls r2, 2 + ldr r0, _0803ED2C + bl sub_80098BC + pop {r0} + bx r0 + .align 2, 0 +_0803ED24: .4byte gUnknown_202EDD8 +_0803ED28: .4byte gUnknown_202EC94 +_0803ED2C: .4byte 0x06014400 + thumb_func_end sub_803ECE0 + + thumb_func_start sub_803ED30 +sub_803ED30: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r5, r0, 0 + adds r7, r1, 0 + mov r9, r3 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + cmp r5, 0 + beq _0803EDDA + ldr r0, _0803EDAC + ldr r0, [r0] + ldr r1, _0803EDB0 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0803EDDA + movs r4, 0 + ldr r1, _0803EDB4 + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _0803ED78 + adds r6, r1, 0 +_0803ED64: + movs r0, 0x29 + bl sub_803E46C + adds r4, 0x1 + cmp r4, 0x13 + bgt _0803ED78 + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0803ED64 +_0803ED78: + adds r0, r5, 0 + mov r1, r8 + bl sub_803EF90 + ldr r3, _0803EDB4 + movs r2, 0 + movs r1, 0x3C + strh r1, [r3] + str r7, [r3, 0x4] + ldrh r1, [r7, 0x26] + str r1, [r3, 0x8] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 8 + negs r1, r1 + str r1, [r3, 0xC] + str r2, [r3, 0x10] + mov r2, r9 + cmp r2, 0 + bge _0803EDC8 + ldr r0, _0803EDB8 + cmp r5, r0 + bge _0803EDBC + movs r0, 0x6 + b _0803EDCA + .align 2, 0 +_0803EDAC: .4byte gUnknown_203B418 +_0803EDB0: .4byte 0x0001820a +_0803EDB4: .4byte gUnknown_202EDE8 +_0803EDB8: .4byte 0xfffffc19 +_0803EDBC: + cmp r5, 0 + blt _0803EDC4 + movs r0, 0xA + b _0803EDCA +_0803EDC4: + movs r0, 0x3 + b _0803EDCA +_0803EDC8: + mov r0, r9 +_0803EDCA: + strh r0, [r3, 0x2] + ldr r0, _0803EDE8 + ldr r1, _0803EDEC + ldr r1, [r1] + adds r1, 0x18 + movs r2, 0x80 + bl sub_80098BC +_0803EDDA: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0803EDE8: .4byte 0x060142c0 +_0803EDEC: .4byte gUnknown_203B418 + thumb_func_end sub_803ED30 + + thumb_func_start sub_803EDF0 +sub_803EDF0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r6, _0803EE18 + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0803EE06 + b _0803EF42 +_0803EE06: + ldr r0, [r6, 0x4] + bl sub_80450E0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0803EE1C + strh r0, [r6] + b _0803EF42 + .align 2, 0 +_0803EE18: .4byte gUnknown_202EDE8 +_0803EE1C: + ldr r1, [r6, 0x4] + ldr r0, [r6, 0x8] + ldrh r2, [r1, 0x26] + cmp r0, r2 + beq _0803EE2C + movs r0, 0 + strh r0, [r6] + b _0803EF42 +_0803EE2C: + ldrh r0, [r6] + subs r0, 0x1 + strh r0, [r6] + ldr r4, [r6, 0x10] + adds r3, r4, 0 + subs r3, 0x2E + str r3, [r6, 0x10] + ldr r2, [r1, 0x70] + movs r5, 0xB8 + lsls r5, 1 + adds r0, r2, r5 + movs r1, 0 + ldrsh r0, [r0, r1] + ldr r1, [r6, 0xC] + cmp r1, 0 + bge _0803EE4E + adds r1, 0xFF +_0803EE4E: + asrs r1, 8 + adds r1, r0, r1 + ldr r0, _0803EF50 + ldr r0, [r0] + mov r12, r0 + ldr r0, _0803EF54 + add r0, r12 + movs r5, 0 + ldrsh r0, [r0, r5] + subs r7, r1, r0 + movs r1, 0xB9 + lsls r1, 1 + adds r0, r2, r1 + movs r2, 0 + ldrsh r0, [r0, r2] + adds r1, r3, 0 + cmp r1, 0 + bge _0803EE76 + adds r1, r4, 0 + adds r1, 0xD1 +_0803EE76: + asrs r1, 8 + adds r1, r0, r1 + ldr r0, _0803EF58 + add r0, r12 + movs r3, 0 + ldrsh r0, [r0, r3] + adds r0, 0x18 + subs r2, r1, r0 + movs r0, 0x20 + negs r0, r0 + cmp r7, r0 + blt _0803EF42 + adds r0, 0x18 + cmp r2, r0 + blt _0803EF42 + cmp r7, 0xEF + bgt _0803EF42 + cmp r2, 0x9F + bgt _0803EF42 + ldr r1, _0803EF5C + ands r1, r2 + lsls r1, 4 + ldr r0, _0803EF60 + ldrh r2, [r0, 0x6] + movs r4, 0xF + mov r8, r4 + mov r3, r8 + ands r3, r2 + orrs r3, r1 + strh r3, [r0, 0x6] + ldrh r2, [r0] + ldr r1, _0803EF64 + ands r1, r2 + ldr r2, _0803EF68 + ands r1, r2 + movs r5, 0x3 + mov r9, r5 + ldr r2, _0803EF6C + mov r10, r2 + ands r1, r2 + ldr r2, _0803EF70 + ands r1, r2 + ldr r2, _0803EF74 + ands r1, r2 + movs r5, 0x80 + lsls r5, 7 + ldr r4, _0803EF78 + ands r1, r4 + orrs r1, r5 + strh r1, [r0] + ldr r1, _0803EF7C + ands r7, r1 + ldrh r2, [r0, 0x2] + movs r1, 0xFE + lsls r1, 8 + ands r1, r2 + orrs r1, r7 + ldr r2, _0803EF80 + ands r1, r2 + ands r1, r4 + orrs r1, r5 + strh r1, [r0, 0x2] + ldr r4, _0803EF84 + ldrh r2, [r0, 0x4] + movs r1, 0xFC + lsls r1, 8 + ands r1, r2 + orrs r1, r4 + movs r2, 0 + orrs r1, r2 + strh r1, [r0, 0x4] + ldr r2, _0803EF88 + add r2, r12 + ldrb r2, [r2] + mov r4, r9 + ands r2, r4 + lsls r2, 10 + mov r5, r10 + ands r1, r5 + orrs r1, r2 + movs r4, 0x2 + ldrsh r2, [r6, r4] + mov r5, r8 + ands r2, r5 + lsls r2, 12 + ldr r4, _0803EF5C + ands r1, r4 + orrs r1, r2 + strh r1, [r0, 0x4] + ldr r1, _0803EF8C + ands r3, r1 + subs r1, 0x1 + ands r3, r1 + subs r1, 0x2 + ands r3, r1 + strh r3, [r0, 0x6] + movs r1, 0x80 + lsls r1, 1 + movs r2, 0 + movs r3, 0 + bl AddSprite +_0803EF42: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0803EF50: .4byte gUnknown_203B418 +_0803EF54: .4byte 0x000181f0 +_0803EF58: .4byte 0x000181f2 +_0803EF5C: .4byte 0x00000fff +_0803EF60: .4byte gUnknown_202EDDC +_0803EF64: .4byte 0x0000feff +_0803EF68: .4byte 0x0000fdff +_0803EF6C: .4byte 0x0000f3ff +_0803EF70: .4byte 0x0000efff +_0803EF74: .4byte 0x0000dfff +_0803EF78: .4byte 0x00003fff +_0803EF7C: .4byte 0x000001ff +_0803EF80: .4byte 0x0000c1ff +_0803EF84: .4byte 0x00000216 +_0803EF88: .4byte 0x00018208 +_0803EF8C: .4byte 0x0000fffe + thumb_func_end sub_803EDF0 + + thumb_func_start sub_803EF90 +sub_803EF90: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x58 + str r0, [sp, 0x48] + lsls r1, 24 + lsrs r5, r1, 24 + ldr r0, _0803F060 + ldr r0, [r0] + adds r0, 0x18 + mov r8, r0 + ldr r0, _0803F064 + ldr r1, [r0] + ldr r0, [r1, 0x4] + movs r2, 0x92 + lsls r2, 1 + adds r0, r2 + str r0, [sp, 0x24] + ldr r0, [r1, 0x4] + movs r3, 0x82 + lsls r3, 1 + adds r0, r3 + str r0, [sp, 0x28] + ldr r0, [r1, 0x4] + adds r0, 0xE4 + str r0, [sp, 0x2C] + ldr r0, [r1, 0x4] + adds r0, 0xC4 + str r0, [sp, 0x30] + ldr r0, [r1, 0x4] + adds r0, 0xA4 + str r0, [sp, 0x34] + ldr r0, [r1, 0x4] + adds r0, 0x84 + str r0, [sp, 0x38] + ldr r0, [r1, 0x4] + adds r0, 0x64 + str r0, [sp, 0x3C] + ldr r0, [r1, 0x4] + adds r0, 0x44 + str r0, [sp, 0x40] + ldr r0, [r1, 0x4] + adds r0, 0x24 + str r0, [sp, 0x44] + add r4, sp, 0x24 + mov r0, sp + adds r1, r4, 0 + movs r2, 0x24 + bl memcpy + movs r1, 0 + movs r6, 0x3 + mov r0, r8 +_0803EFFE: + stm r0!, {r1} + stm r0!, {r1} + stm r0!, {r1} + stm r0!, {r1} + stm r0!, {r1} + stm r0!, {r1} + stm r0!, {r1} + stm r0!, {r1} + subs r6, 0x1 + cmp r6, 0 + bge _0803EFFE + ldr r0, _0803F068 + ldr r1, [sp, 0x48] + cmp r1, r0 + bne _0803F0A6 + adds r0, r4, 0 + ldr r1, _0803F06C + ldm r1!, {r2,r3,r5} + stm r0!, {r2,r3,r5} + ldr r1, [r1] + str r1, [r0] + movs r5, 0 + movs r2, 0 + mov r12, r4 + movs r0, 0x20 + mov r10, r0 +_0803F032: + mov r3, r8 + ldr r0, _0803F064 + ldr r1, [r0] + lsls r0, r2, 2 + add r0, r12 + ldr r0, [r0] + lsls r0, 5 + adds r0, 0x4 + ldr r1, [r1, 0x4] + adds r4, r1, r0 + movs r1, 0x18 + adds r1, r5 + mov r9, r1 + adds r2, 0x1 + str r2, [sp, 0x54] + mov r2, r10 + subs r7, r2, r5 + movs r6, 0x7 +_0803F056: + cmp r5, 0 + bne _0803F070 + movs r1, 0 + ldr r2, [r4] + b _0803F07A + .align 2, 0 +_0803F060: .4byte gUnknown_203B418 +_0803F064: .4byte gUnknown_202EC9C +_0803F068: .4byte 0x0000270f +_0803F06C: .4byte gUnknown_80F6478 +_0803F070: + ldr r0, [r4] + adds r1, r0, 0 + lsrs r1, r7 + adds r2, r0, 0 + lsls r2, r5 +_0803F07A: + adds r4, 0x4 + ldr r0, [r3] + orrs r0, r2 + str r0, [r3] + ldr r0, [r3, 0x20] + orrs r0, r1 + str r0, [r3, 0x20] + adds r3, 0x4 + subs r6, 0x1 + cmp r6, 0 + bge _0803F056 + mov r5, r9 + cmp r5, 0x1F + ble _0803F09C + subs r5, 0x20 + movs r3, 0x20 + add r8, r3 +_0803F09C: + ldr r2, [sp, 0x54] + cmp r2, 0x3 + ble _0803F032 + movs r0, 0x4 + b _0803F26A +_0803F0A6: + ldr r0, _0803F0D8 + ldr r1, [sp, 0x48] + cmp r1, r0 + ble _0803F0B0 + str r0, [sp, 0x48] +_0803F0B0: + ldr r0, _0803F0DC + ldr r2, [sp, 0x48] + cmp r2, r0 + bge _0803F0BA + str r0, [sp, 0x48] +_0803F0BA: + ldr r1, _0803F0E0 + ldr r0, [r1] + ldr r0, [r0, 0x4] + movs r3, 0xC2 + lsls r3, 1 + adds r2, r0, r3 + cmp r5, 0 + beq _0803F0F4 + ldr r5, [sp, 0x48] + cmp r5, 0 + ble _0803F0E4 + movs r1, 0xA2 + lsls r1, 1 + adds r2, r0, r1 + b _0803F0F4 + .align 2, 0 +_0803F0D8: .4byte 0x000003e7 +_0803F0DC: .4byte 0xfffffc19 +_0803F0E0: .4byte gUnknown_202EC9C +_0803F0E4: + ldr r3, [sp, 0x48] + cmp r3, 0 + bge _0803F0F4 + movs r5, 0xB2 + lsls r5, 1 + adds r2, r0, r5 + negs r3, r3 + str r3, [sp, 0x48] +_0803F0F4: + ldm r2!, {r0} + mov r1, r8 + str r0, [r1] + ldm r2!, {r0} + str r0, [r1, 0x4] + ldm r2!, {r0} + str r0, [r1, 0x8] + ldm r2!, {r0} + str r0, [r1, 0xC] + ldm r2!, {r0} + str r0, [r1, 0x10] + ldm r2!, {r0} + str r0, [r1, 0x14] + ldm r2!, {r0} + str r0, [r1, 0x18] + ldr r0, [r2] + str r0, [r1, 0x1C] + movs r5, 0x18 + movs r2, 0x1 + str r2, [sp, 0x4C] + movs r3, 0 + str r3, [sp, 0x50] + movs r2, 0 +_0803F122: + movs r0, 0 + mov r10, r0 + adds r1, r2, 0x1 + str r1, [sp, 0x54] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + mov r1, sp + ldr r2, _0803F15C + adds r7, r0, r2 +_0803F136: + ldr r0, [r7] + ldr r3, [sp, 0x48] + cmp r0, r3 + bgt _0803F1A2 + ldr r4, [r1] + mov r2, r8 + movs r0, 0x18 + adds r0, r5 + mov r9, r0 + movs r1, 0x20 + subs r1, r5 + mov r12, r1 + movs r6, 0x7 +_0803F150: + cmp r5, 0 + bne _0803F160 + movs r3, 0 + ldr r1, [r4] + b _0803F16C + .align 2, 0 +_0803F15C: .4byte gUnknown_80F6430 +_0803F160: + ldr r0, [r4] + adds r3, r0, 0 + mov r1, r12 + lsrs r3, r1 + adds r1, r0, 0 + lsls r1, r5 +_0803F16C: + adds r4, 0x4 + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] + ldr r0, [r2, 0x20] + orrs r0, r3 + str r0, [r2, 0x20] + adds r2, 0x4 + movs r3, 0x1 + str r3, [sp, 0x50] + subs r6, 0x1 + cmp r6, 0 + bge _0803F150 + mov r5, r9 + cmp r5, 0x1F + ble _0803F192 + subs r5, 0x20 + movs r0, 0x20 + add r8, r0 +_0803F192: + ldr r0, [r7] + ldr r1, [sp, 0x48] + subs r1, r0 + str r1, [sp, 0x48] + ldr r2, [sp, 0x4C] + adds r2, 0x1 + str r2, [sp, 0x4C] + b _0803F1B0 +_0803F1A2: + adds r1, 0x4 + adds r7, 0x4 + movs r3, 0x1 + add r10, r3 + mov r0, r10 + cmp r0, 0x8 + ble _0803F136 +_0803F1B0: + mov r1, r10 + cmp r1, 0x9 + bne _0803F212 + ldr r2, [sp, 0x50] + cmp r2, 0 + beq _0803F212 + ldr r3, _0803F1DC + ldr r0, [r3] + ldr r0, [r0, 0x4] + adds r4, r0, 0x4 + mov r2, r8 + movs r0, 0x18 + adds r0, r5 + mov r9, r0 + movs r1, 0x20 + subs r7, r1, r5 + movs r6, 0x7 +_0803F1D2: + cmp r5, 0 + bne _0803F1E0 + movs r3, 0 + ldr r1, [r4] + b _0803F1EA + .align 2, 0 +_0803F1DC: .4byte gUnknown_202EC9C +_0803F1E0: + ldr r0, [r4] + adds r3, r0, 0 + lsrs r3, r7 + adds r1, r0, 0 + lsls r1, r5 +_0803F1EA: + adds r4, 0x4 + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] + ldr r0, [r2, 0x20] + orrs r0, r3 + str r0, [r2, 0x20] + adds r2, 0x4 + subs r6, 0x1 + cmp r6, 0 + bge _0803F1D2 + mov r5, r9 + cmp r5, 0x1F + ble _0803F20C + subs r5, 0x20 + movs r2, 0x20 + add r8, r2 +_0803F20C: + ldr r3, [sp, 0x4C] + adds r3, 0x1 + str r3, [sp, 0x4C] +_0803F212: + ldr r2, [sp, 0x54] + cmp r2, 0x1 + ble _0803F122 + ldr r0, _0803F240 + ldr r1, [r0] + ldr r2, [sp, 0x48] + lsls r0, r2, 5 + adds r0, 0x4 + ldr r1, [r1, 0x4] + adds r1, r0 + mov r3, r8 + ldr r0, [sp, 0x4C] + adds r0, 0x1 + mov r8, r0 + movs r0, 0x20 + subs r7, r0, r5 + movs r6, 0x7 +_0803F234: + cmp r5, 0 + bne _0803F244 + movs r4, 0 + ldr r2, [r1] + b _0803F24E + .align 2, 0 +_0803F240: .4byte gUnknown_202EC9C +_0803F244: + ldr r0, [r1] + adds r4, r0, 0 + lsrs r4, r7 + adds r2, r0, 0 + lsls r2, r5 +_0803F24E: + adds r1, 0x4 + ldr r0, [r3] + orrs r0, r2 + str r0, [r3] + ldr r0, [r3, 0x20] + orrs r0, r4 + str r0, [r3, 0x20] + adds r3, 0x4 + subs r6, 0x1 + cmp r6, 0 + bge _0803F234 + mov r1, r8 + str r1, [sp, 0x4C] + adds r0, r1, 0 +_0803F26A: + add sp, 0x58 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_803EF90 + + thumb_func_start sub_803F27C +sub_803F27C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + adds r7, r0, 0 + ldr r0, _0803F360 + mov r8, r0 + ldr r4, [r0] + ldr r2, _0803F364 + adds r1, r4, r2 + movs r2, 0 + movs r3, 0 + strh r3, [r1, 0x8] + strh r3, [r1, 0xA] + strh r3, [r1] + strh r3, [r1, 0x2] + strh r3, [r1, 0xC] + strh r3, [r1, 0xE] + strh r3, [r1, 0x4] + strh r3, [r1, 0x6] + str r3, [r1, 0x14] + ldr r5, _0803F368 + adds r0, r4, r5 + strb r2, [r0] + ldr r6, _0803F36C + adds r0, r4, r6 + movs r5, 0x1 + strb r5, [r0] + adds r6, 0x1 + adds r0, r4, r6 + strb r5, [r0] + adds r6, 0x1 + adds r0, r4, r6 + strb r2, [r0] + str r3, [r1, 0x18] + str r3, [r1, 0x1C] + cmp r7, 0 + bne _0803F2FA + subs r6, 0xF + adds r0, r4, r6 + strb r2, [r0] + adds r6, 0x6 + adds r0, r4, r6 + strb r2, [r0] + subs r6, 0x1 + adds r0, r4, r6 + strb r2, [r0] + subs r6, 0x2 + adds r0, r4, r6 + strb r2, [r0] + adds r6, 0x4 + adds r0, r4, r6 + strb r2, [r0] + subs r6, 0x3 + adds r0, r4, r6 + strb r2, [r0] + subs r6, 0x3 + adds r0, r4, r6 + strb r2, [r0] + adds r6, 0x1 + adds r0, r4, r6 + strb r2, [r0] +_0803F2FA: + str r3, [r1, 0x10] + ldr r1, _0803F370 + adds r0, r4, r1 + movs r6, 0x3 + strb r6, [r0] + adds r1, 0x12 + adds r0, r4, r1 + strb r2, [r0] + subs r1, 0x8 + adds r0, r4, r1 + strb r2, [r0] + adds r1, 0x9 + adds r0, r4, r1 + strb r2, [r0] + adds r1, 0x1 + adds r0, r4, r1 + strb r2, [r0] + subs r1, 0x8 + adds r0, r4, r1 + strb r2, [r0] + ldr r2, _0803F374 + adds r0, r4, r2 + strb r5, [r0] + bl sub_803F38C + ldr r1, _0803F378 + ldr r0, _0803F37C + str r0, [r1] + cmp r7, 0 + bne _0803F354 + mov r1, r8 + ldr r0, [r1] + ldr r2, _0803F380 + adds r0, r2 + ldrb r1, [r0] + adds r0, r6, 0 + ands r0, r1 + ldr r6, _0803F384 + adds r1, r4, r6 + strb r0, [r1] + cmp r0, 0 + bne _0803F354 + ldr r1, _0803F388 + adds r0, r4, r1 + strb r5, [r0] +_0803F354: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0803F360: .4byte gUnknown_203B418 +_0803F364: .4byte 0x000181e8 +_0803F368: .4byte 0x00018216 +_0803F36C: .4byte 0x00018217 +_0803F370: .4byte 0x00018208 +_0803F374: .4byte 0x00018215 +_0803F378: .4byte gUnknown_202EDFC +_0803F37C: .4byte 0x0000ffff +_0803F380: .4byte 0x0001c58a +_0803F384: .4byte 0x00018209 +_0803F388: .4byte 0x0001820c + thumb_func_end sub_803F27C + + thumb_func_start sub_803F38C +sub_803F38C: + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r0, _0803F410 + ldr r1, [r0] + ldr r0, _0803F414 + adds r2, r1, r0 + ldr r0, _0803F418 + strh r0, [r2, 0x3A] + movs r0, 0x1 + negs r0, r0 + strh r0, [r2, 0x3C] + strh r0, [r2, 0x3E] + ldr r0, _0803F41C + adds r1, r0 + movs r0, 0x1 + negs r0, r0 + strh r0, [r1] + strh r0, [r2, 0x36] + strh r0, [r2, 0x38] + ldr r0, _0803F420 + ldr r0, [r0] + ldrb r0, [r0, 0xB] + negs r4, r0 + orrs r4, r0 + asrs r4, 31 + movs r0, 0x80 + lsls r0, 1 + ands r4, r0 + ldr r5, _0803F424 + adds r0, r4, r5 + mov r8, r0 + movs r0, 0xFD + mov r1, r8 + bl SetBGPaletteBufferColorArray + adds r6, r5, 0x4 + adds r6, r4, r6 + movs r0, 0xFE + adds r1, r6, 0 + bl SetBGPaletteBufferColorArray + adds r5, 0x8 + adds r4, r5 + movs r0, 0xFF + adds r1, r4, 0 + bl SetBGPaletteBufferColorArray + movs r0, 0xFD + mov r1, r8 + bl nullsub_5 + movs r0, 0xFE + adds r1, r6, 0 + bl nullsub_5 + movs r0, 0xFF + adds r1, r4, 0 + bl nullsub_5 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0803F410: .4byte gUnknown_203B418 +_0803F414: .4byte 0x000181e8 +_0803F418: .4byte 0x0000ffff +_0803F41C: .4byte 0x00018228 +_0803F420: .4byte gUnknown_203B46C +_0803F424: .4byte gUnknown_202D06C + thumb_func_end sub_803F38C + + thumb_func_start sub_803F428 +sub_803F428: + push {r4-r6,lr} + adds r4, r0, 0 + ldr r0, _0803F484 + ldr r3, [r0] + ldr r0, _0803F488 + adds r2, r3, r0 + ldr r5, [r2, 0x10] + movs r6, 0 + ldrsh r1, [r2, r6] + movs r6, 0 + ldrsh r0, [r4, r6] + subs r1, r0 + cmp r1, 0 + bge _0803F446 + negs r1, r1 +_0803F446: + cmp r1, 0x6 + bgt _0803F498 + movs r0, 0x2 + ldrsh r1, [r2, r0] + movs r6, 0x2 + ldrsh r0, [r4, r6] + subs r1, r0 + cmp r1, 0 + bge _0803F45A + negs r1, r1 +_0803F45A: + cmp r1, 0x5 + bgt _0803F498 + ldr r1, _0803F48C + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0803F494 + ldr r6, _0803F490 + adds r0, r3, r6 + ldrb r0, [r0] + cmp r0, 0 + bne _0803F494 + cmp r5, 0 + beq _0803F494 + adds r0, r2, 0 + adds r1, r4, 0 + bl sub_8083294 + lsls r0, 24 + lsrs r0, 24 + b _0803F49A + .align 2, 0 +_0803F484: .4byte gUnknown_203B418 +_0803F488: .4byte 0x000181e8 +_0803F48C: .4byte 0x0001820b +_0803F490: .4byte 0x0001820c +_0803F494: + movs r0, 0x1 + b _0803F49A +_0803F498: + movs r0, 0 +_0803F49A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_803F428 + + thumb_func_start sub_803F4A0 +sub_803F4A0: + push {lr} + adds r2, r0, 0 + ldr r0, _0803F4B8 + ldr r1, [r0] + ldr r3, _0803F4BC + adds r0, r1, r3 + str r2, [r0, 0x10] + cmp r2, 0 + bne _0803F4C0 + adds r3, 0x2E + b _0803F4CA + .align 2, 0 +_0803F4B8: .4byte gUnknown_203B418 +_0803F4BC: .4byte 0x000181e8 +_0803F4C0: + ldr r0, [r2, 0x70] + ldrb r2, [r0, 0x7] + cmp r2, 0 + bne _0803F4D4 + ldr r3, _0803F4D0 +_0803F4CA: + adds r0, r1, r3 + strb r2, [r0] + b _0803F4DC + .align 2, 0 +_0803F4D0: .4byte 0x00018216 +_0803F4D4: + ldr r0, _0803F4FC + adds r1, r0 + movs r0, 0x1 + strb r0, [r1] +_0803F4DC: + movs r0, 0 + bl sub_803F580 + bl sub_803F38C + ldr r0, _0803F500 + ldr r0, [r0] + ldr r1, _0803F504 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0803F4F8 + bl sub_806CD90 +_0803F4F8: + pop {r0} + bx r0 + .align 2, 0 +_0803F4FC: .4byte 0x00018216 +_0803F500: .4byte gUnknown_203B418 +_0803F504: .4byte 0x0001356c + thumb_func_end sub_803F4A0 + + thumb_func_start sub_803F508 +sub_803F508: + push {r4,r5,lr} + adds r3, r0, 0 + ldr r0, _0803F520 + ldr r1, [r0] + ldr r0, _0803F524 + adds r4, r1, r0 + cmp r3, 0 + bne _0803F52C + ldr r2, _0803F528 + adds r0, r1, r2 + strb r3, [r0] + b _0803F548 + .align 2, 0 +_0803F520: .4byte gUnknown_203B418 +_0803F524: .4byte 0x000181e8 +_0803F528: .4byte 0x00018216 +_0803F52C: + ldr r0, [r3, 0x70] + ldrb r2, [r0, 0x7] + cmp r2, 0 + bne _0803F540 + ldr r5, _0803F53C + adds r0, r1, r5 + strb r2, [r0] + b _0803F548 + .align 2, 0 +_0803F53C: .4byte 0x00018216 +_0803F540: + ldr r0, _0803F574 + adds r1, r0 + movs r0, 0x1 + strb r0, [r1] +_0803F548: + str r3, [r4, 0x10] + movs r0, 0 + bl sub_803F580 + bl sub_803F38C + ldr r0, _0803F578 + ldr r0, [r0] + ldr r1, _0803F57C + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0803F566 + bl sub_806CD90 +_0803F566: + bl sub_8049ED4 + bl sub_8040A84 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0803F574: .4byte 0x00018216 +_0803F578: .4byte gUnknown_203B418 +_0803F57C: .4byte 0x0001356c + thumb_func_end sub_803F508 + + thumb_func_start sub_803F580 +sub_803F580: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + ldr r0, _0803F600 + ldr r4, [r0] + ldr r0, _0803F604 + adds r5, r4, r0 + ldr r6, [r5, 0x10] + cmp r6, 0 + bne _0803F59E + b _0803F7A0 +_0803F59E: + adds r0, r6, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _0803F5AC + b _0803F7A0 +_0803F5AC: + ldr r7, [r6, 0x70] + ldr r0, [r5, 0x8] + str r0, [r5, 0xC] + ldr r0, [r5] + str r0, [r5, 0x4] + ldrh r0, [r6, 0x4] + strh r0, [r5] + ldrh r0, [r6, 0x6] + strh r0, [r5, 0x2] + ldr r0, [r6, 0xC] + cmp r0, 0 + bge _0803F5C6 + adds r0, 0xFF +_0803F5C6: + asrs r0, 8 + subs r0, 0x78 + strh r0, [r5, 0x8] + ldr r0, [r6, 0x10] + cmp r0, 0 + bge _0803F5D4 + adds r0, 0xFF +_0803F5D4: + asrs r0, 8 + subs r0, 0x60 + strh r0, [r5, 0xA] + adds r0, r6, 0 + movs r1, 0x11 + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _0803F610 + ldrb r0, [r7, 0x7] + cmp r0, 0 + beq _0803F610 + ldr r1, _0803F608 + adds r0, r4, r1 + movs r1, 0x1 + strb r1, [r0] + ldr r2, _0803F60C + adds r0, r4, r2 + strb r1, [r0] + b _0803F626 + .align 2, 0 +_0803F600: .4byte gUnknown_203B418 +_0803F604: .4byte 0x000181e8 +_0803F608: .4byte 0x0001820d +_0803F60C: .4byte 0x0001820e +_0803F610: + adds r0, r7, 0 + adds r0, 0xF0 + ldrb r0, [r0] + adds r1, r5, 0 + adds r1, 0x25 + strb r0, [r1] + adds r0, r7, 0 + adds r0, 0xF1 + ldrb r0, [r0] + adds r1, 0x1 + strb r0, [r1] +_0803F626: + adds r0, r7, 0 + adds r0, 0xF2 + ldrb r0, [r0] + adds r1, r5, 0 + adds r1, 0x29 + strb r0, [r1] + subs r1, 0x7 + ldrb r0, [r1] + mov r8, r0 + adds r0, r5, 0 + adds r0, 0x2C + ldrb r2, [r0] + adds r4, r1, 0 + cmp r2, 0 + bne _0803F670 + adds r0, r7, 0 + adds r0, 0xE8 + ldrb r1, [r0] + adds r7, r0, 0 + cmp r1, 0x1 + bne _0803F656 + strb r1, [r4] + movs r1, 0xE + b _0803F65A +_0803F656: + strb r2, [r4] + movs r1, 0 +_0803F65A: + ldr r2, _0803F66C + ldr r0, [r2] + cmp r0, r1 + beq _0803F678 + str r1, [r2] + adds r0, r1, 0 + bl SetBGOBJEnableFlags + b _0803F678 + .align 2, 0 +_0803F66C: .4byte gUnknown_202EDFC +_0803F670: + ldr r1, _0803F698 + ldr r0, _0803F69C + str r0, [r1] + adds r7, 0xE8 +_0803F678: + ldrb r4, [r4] + cmp r8, r4 + beq _0803F684 + movs r0, 0 + bl sub_8041888 +_0803F684: + adds r0, r5, 0 + adds r0, 0x28 + ldrb r1, [r0] + mov r8, r1 + ldrb r1, [r7] + adds r2, r0, 0 + cmp r1, 0x2 + bne _0803F6A0 + movs r0, 0x1 + b _0803F6A2 + .align 2, 0 +_0803F698: .4byte gUnknown_202EDFC +_0803F69C: .4byte 0x0000ffff +_0803F6A0: + movs r0, 0 +_0803F6A2: + strb r0, [r2] + ldrb r2, [r2] + cmp r8, r2 + beq _0803F6B4 + bl sub_806CC70 + movs r0, 0 + bl sub_8041888 +_0803F6B4: + adds r4, r5, 0 + adds r4, 0x27 + ldrb r2, [r4] + mov r8, r2 + adds r0, r6, 0 + bl sub_8071884 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _0803F6CC + movs r0, 0x1 +_0803F6CC: + strb r0, [r4] + ldrb r4, [r4] + cmp r8, r4 + beq _0803F6E2 + bl sub_8049ED4 + bl sub_8040A84 + movs r0, 0 + bl sub_8041888 +_0803F6E2: + mov r0, r9 + cmp r0, 0 + beq _0803F76A + adds r0, r5, 0 + adds r0, 0x2B + ldrb r1, [r0] + adds r4, r0, 0 + cmp r1, 0 + bne _0803F76A + movs r2, 0xC + ldrsh r1, [r5, r2] + movs r2, 0x8 + ldrsh r0, [r5, r2] + subs r1, r0 + cmp r1, 0 + bge _0803F704 + negs r1, r1 +_0803F704: + cmp r1, 0x7 + bgt _0803F71C + movs r0, 0xE + ldrsh r1, [r5, r0] + movs r2, 0xA + ldrsh r0, [r5, r2] + subs r1, r0 + cmp r1, 0 + bge _0803F718 + negs r1, r1 +_0803F718: + cmp r1, 0x7 + ble _0803F726 +_0803F71C: + bl sub_8049ED4 + movs r0, 0x1 + strb r0, [r4] + b _0803F76A +_0803F726: + movs r0, 0xC + ldrsh r1, [r5, r0] + movs r2, 0x8 + ldrsh r0, [r5, r2] + cmp r1, r0 + bge _0803F73C + movs r0, 0xF0 + movs r1, 0 + bl sub_804A1F0 + b _0803F748 +_0803F73C: + cmp r1, r0 + ble _0803F748 + movs r0, 0 + movs r1, 0 + bl sub_804A1F0 +_0803F748: + movs r0, 0xE + ldrsh r1, [r5, r0] + movs r2, 0xA + ldrsh r0, [r5, r2] + cmp r1, r0 + bge _0803F75E + movs r0, 0 + movs r1, 0xA0 + bl sub_804A49C + b _0803F76A +_0803F75E: + cmp r1, r0 + ble _0803F76A + movs r0, 0 + movs r1, 0 + bl sub_804A49C +_0803F76A: + ldr r1, [r5] + ldr r0, [r5, 0x4] + cmp r1, r0 + beq _0803F7A0 + movs r5, 0 +_0803F774: + ldr r0, _0803F7B4 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _0803F7B8 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0803F79A + movs r1, 0x4 + ldrsh r0, [r4, r1] + movs r2, 0x6 + ldrsh r1, [r4, r2] + bl sub_80402AC +_0803F79A: + adds r5, 0x1 + cmp r5, 0x13 + ble _0803F774 +_0803F7A0: + bl sub_80400D4 + bl sub_803F7BC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0803F7B4: .4byte gUnknown_203B418 +_0803F7B8: .4byte 0x000135cc + thumb_func_end sub_803F580 + + thumb_func_start sub_803F7BC +sub_803F7BC: + push {r4-r6,lr} + sub sp, 0x10 + ldr r6, _0803F800 + ldr r4, [r6] + ldr r0, _0803F804 + adds r5, r4, r0 + movs r1, 0 + ldrsh r0, [r5, r1] + movs r2, 0x2 + ldrsh r1, [r5, r2] + bl sub_804954C + ldrb r1, [r0, 0x9] + ldr r2, _0803F808 + adds r0, r4, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _0803F7F4 + adds r2, 0x1 + adds r0, r4, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _0803F7F4 + adds r2, 0xB + adds r0, r4, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _0803F80C +_0803F7F4: + movs r0, 0 + movs r1, 0 + bl sub_8005838 + b _0803F86A + .align 2, 0 +_0803F800: .4byte gUnknown_203B418 +_0803F804: .4byte 0x000181e8 +_0803F808: .4byte 0x0001820b +_0803F80C: + cmp r1, 0xFF + bne _0803F82C + ldr r1, _0803F828 + adds r0, r4, r1 + ldrb r0, [r0] + movs r1, 0x2 + cmp r0, 0x2 + bne _0803F81E + movs r1, 0x1 +_0803F81E: + movs r0, 0 + bl sub_8005838 + b _0803F86A + .align 2, 0 +_0803F828: .4byte 0x00018209 +_0803F82C: + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r2, _0803F874 + adds r0, r2 + ldr r2, [r6] + adds r2, r0 + movs r0, 0x8 + ldrsh r1, [r5, r0] + ldr r0, [r2, 0xC] + subs r0, r1 + str r0, [sp] + movs r0, 0xA + ldrsh r1, [r5, r0] + ldr r0, [r2, 0x10] + subs r0, r1 + str r0, [sp, 0x4] + movs r0, 0x8 + ldrsh r1, [r5, r0] + ldr r0, [r2, 0x14] + subs r0, r1 + str r0, [sp, 0x8] + movs r0, 0xA + ldrsh r1, [r5, r0] + ldr r0, [r2, 0x18] + subs r0, r1 + str r0, [sp, 0xC] + mov r0, sp + movs r1, 0x3 + bl sub_8005838 +_0803F86A: + add sp, 0x10 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0803F874: .4byte 0x000104c4 + thumb_func_end sub_803F7BC + + thumb_func_start sub_803F878 +sub_803F878: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r2, r0, 0 + adds r6, r1, 0 + ldr r0, _0803F92C + ldr r7, [r0] + ldr r0, _0803F930 + adds r5, r7, r0 + ldr r0, [r5, 0x8] + str r0, [r5, 0xC] + ldr r0, [r5] + str r0, [r5, 0x4] + adds r0, r2, 0 + cmp r2, 0 + bge _0803F89A + adds r0, 0xFF +_0803F89A: + asrs r0, 8 + subs r0, 0x78 + movs r1, 0 + mov r8, r1 + strh r0, [r5, 0x8] + adds r0, r6, 0 + cmp r6, 0 + bge _0803F8AC + adds r0, 0xFF +_0803F8AC: + asrs r0, 8 + subs r0, 0x60 + strh r0, [r5, 0xA] + movs r4, 0xC0 + lsls r4, 5 + adds r0, r2, 0 + adds r1, r4, 0 + bl __divsi3 + strh r0, [r5] + adds r0, r6, 0 + adds r1, r4, 0 + bl __divsi3 + strh r0, [r5, 0x2] + ldr r2, _0803F934 + adds r0, r7, r2 + mov r1, r8 + strb r1, [r0] + adds r2, 0x1 + adds r0, r7, r2 + strb r1, [r0] + ldr r1, _0803F938 + adds r0, r7, r1 + mov r2, r8 + strb r2, [r0] + adds r1, 0x5 + adds r0, r7, r1 + strb r2, [r0] + ldr r1, _0803F93C + ldr r0, [r1] + cmp r0, 0 + beq _0803F8F6 + movs r0, 0 + str r0, [r1] + bl SetBGOBJEnableFlags +_0803F8F6: + movs r2, 0xC + ldrsh r1, [r5, r2] + movs r2, 0x8 + ldrsh r0, [r5, r2] + subs r1, r0 + cmp r1, 0 + bge _0803F906 + negs r1, r1 +_0803F906: + cmp r1, 0x7 + bgt _0803F91E + movs r0, 0xE + ldrsh r1, [r5, r0] + movs r2, 0xA + ldrsh r0, [r5, r2] + subs r1, r0 + cmp r1, 0 + bge _0803F91A + negs r1, r1 +_0803F91A: + cmp r1, 0x7 + ble _0803F940 +_0803F91E: + bl sub_8049ED4 + adds r1, r5, 0 + adds r1, 0x2B + movs r0, 0x1 + strb r0, [r1] + b _0803F984 + .align 2, 0 +_0803F92C: .4byte gUnknown_203B418 +_0803F930: .4byte 0x000181e8 +_0803F934: .4byte 0x0001820d +_0803F938: .4byte 0x00018211 +_0803F93C: .4byte gUnknown_202EDFC +_0803F940: + movs r0, 0xC + ldrsh r1, [r5, r0] + movs r2, 0x8 + ldrsh r0, [r5, r2] + cmp r1, r0 + bge _0803F956 + movs r0, 0xF0 + movs r1, 0 + bl sub_804A1F0 + b _0803F962 +_0803F956: + cmp r1, r0 + ble _0803F962 + movs r0, 0 + movs r1, 0 + bl sub_804A1F0 +_0803F962: + movs r0, 0xE + ldrsh r1, [r5, r0] + movs r2, 0xA + ldrsh r0, [r5, r2] + cmp r1, r0 + bge _0803F978 + movs r0, 0 + movs r1, 0xA0 + bl sub_804A49C + b _0803F984 +_0803F978: + cmp r1, r0 + ble _0803F984 + movs r0, 0 + movs r1, 0 + bl sub_804A49C +_0803F984: + bl sub_803F7BC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_803F878 + + thumb_func_start sub_803F994 +sub_803F994: + ldr r0, _0803F9A8 + ldr r0, [r0] + ldr r1, _0803F9AC + adds r0, r1 + movs r1, 0x8 + ldrsh r0, [r0, r1] + adds r0, 0x78 + lsls r0, 8 + bx lr + .align 2, 0 +_0803F9A8: .4byte gUnknown_203B418 +_0803F9AC: .4byte 0x000181e8 + thumb_func_end sub_803F994 + + thumb_func_start sub_803F9B0 +sub_803F9B0: + ldr r0, _0803F9C4 + ldr r0, [r0] + ldr r1, _0803F9C8 + adds r0, r1 + movs r1, 0xA + ldrsh r0, [r0, r1] + adds r0, 0x60 + lsls r0, 8 + bx lr + .align 2, 0 +_0803F9C4: .4byte gUnknown_203B418 +_0803F9C8: .4byte 0x000181e8 + thumb_func_end sub_803F9B0 + + thumb_func_start sub_803F9CC +sub_803F9CC: + push {r4,r5,lr} + ldr r0, _0803FA24 + ldr r1, [r0] + ldr r2, _0803FA28 + adds r0, r1, r2 + ldr r4, [r0] + movs r5, 0 + ldr r2, _0803FA2C + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _0803FA0C + ldr r2, _0803FA30 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _0803FA0C + bl sub_800EC74 + lsls r0, 24 + cmp r0, 0 + bne _0803FA0C + cmp r4, 0 + beq _0803FA08 + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0x1 + bne _0803FA08 + movs r5, 0x1 +_0803FA08: + cmp r5, 0 + bne _0803FA38 +_0803FA0C: + ldr r0, _0803FA34 + movs r2, 0 + adds r0, 0x2 + movs r1, 0x1C +_0803FA14: + strh r2, [r0] + adds r0, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _0803FA14 + bl sub_803F38C + b _0803FA3C + .align 2, 0 +_0803FA24: .4byte gUnknown_203B418 +_0803FA28: .4byte 0x000181f8 +_0803FA2C: .4byte 0x0001356c +_0803FA30: .4byte 0x00018218 +_0803FA34: .4byte gUnknown_202B038 +_0803FA38: + bl sub_803FB74 +_0803FA3C: + ldr r1, _0803FA48 + movs r0, 0x1 + strb r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0803FA48: .4byte gUnknown_20274A5 + thumb_func_end sub_803F9CC + + thumb_func_start sub_803FA4C +sub_803FA4C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + adds r4, r0, 0 + mov r8, r1 + lsls r2, 24 + lsrs r2, 24 + mov r12, r2 + ldr r0, _0803FB4C + ldr r3, [r0] + ldr r0, _0803FB50 + adds r0, r3, r0 + str r0, [sp, 0x24] + ldr r7, _0803FB54 + mov r1, sp + ldr r0, _0803FB58 + ldm r0!, {r2,r5,r6} + stm r1!, {r2,r5,r6} + ldm r0!, {r2,r5,r6} + stm r1!, {r2,r5,r6} + ldm r0!, {r2,r5,r6} + stm r1!, {r2,r5,r6} + ldr r0, _0803FB5C + mov r10, r0 + ldr r1, _0803FB60 + mov r9, r1 + ldr r2, [sp, 0x24] + movs r5, 0x3E + ldrsh r0, [r2, r5] + cmp r4, r0 + bne _0803FA9C + ldr r6, _0803FB64 + adds r0, r3, r6 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r8, r0 + beq _0803FB3A +_0803FA9C: + mov r2, r12 + cmp r2, 0 + bne _0803FAA6 + ldr r5, _0803FB68 + mov r9, r5 +_0803FAA6: + ldr r6, [sp, 0x24] + strh r4, [r6, 0x3E] + ldr r1, _0803FB64 + adds r0, r3, r1 + mov r2, r8 + strh r2, [r0] + mov r5, r8 + cmp r5, 0x5F + ble _0803FAC8 + movs r5, 0x60 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 5 + mov r1, r8 + bl __divsi3 + adds r4, r0, 0 +_0803FAC8: + movs r3, 0 + mov r8, r3 + movs r6, 0x58 + mov r12, r6 +_0803FAD0: + ldr r6, _0803FB6C + adds r2, r4, 0 + adds r0, r5, 0 + cmp r4, 0x7 + ble _0803FADC + movs r2, 0x8 +_0803FADC: + cmp r5, 0x7 + ble _0803FAE2 + movs r0, 0x8 +_0803FAE2: + lsls r0, 2 + mov r3, sp + adds r1, r3, r0 + lsls r0, r2, 2 + add r0, sp + ldr r2, [r0] + ldr r3, [r1] + adds r1, r3, 0 + bics r1, r2 + mov r0, r10 + ands r1, r0 + mov r0, r9 + ands r0, r2 + orrs r0, r1 + ands r6, r3 + mov r1, r8 + stm r7!, {r1} + stm r7!, {r6} + stm r7!, {r0} + stm r7!, {r0} + stm r7!, {r0} + stm r7!, {r0} + stm r7!, {r6} + stm r7!, {r1} + subs r4, 0x8 + subs r5, 0x8 + cmp r4, 0 + bge _0803FB1C + movs r4, 0 +_0803FB1C: + cmp r5, 0 + bge _0803FB22 + movs r5, 0 +_0803FB22: + movs r2, 0x8 + negs r2, r2 + add r12, r2 + mov r3, r12 + cmp r3, 0 + bge _0803FAD0 + ldr r0, _0803FB70 + movs r2, 0xC0 + lsls r2, 1 + ldr r1, _0803FB54 + bl sub_80098BC +_0803FB3A: + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0803FB4C: .4byte gUnknown_203B418 +_0803FB50: .4byte 0x000181e8 +_0803FB54: .4byte gUnknown_3001018 +_0803FB58: .4byte gUnknown_80F6490 +_0803FB5C: .4byte 0x22222222 +_0803FB60: .4byte 0x44444444 +_0803FB64: .4byte 0x00018228 +_0803FB68: .4byte 0x55555555 +_0803FB6C: .4byte 0x77777777 +_0803FB70: .4byte 0x06005980 + thumb_func_end sub_803FA4C + + thumb_func_start sub_803FB74 +sub_803FB74: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + ldr r0, _0803FBE8 + ldr r0, [r0] + ldr r1, _0803FBEC + adds r7, r0, r1 + movs r4, 0 + movs r2, 0 + str r2, [sp] + ldr r0, [r7, 0x10] + ldr r0, [r0, 0x70] + movs r1, 0xE + ldrsh r3, [r0, r1] + mov r9, r3 + movs r3, 0x10 + ldrsh r2, [r0, r3] + mov r8, r2 + ldrb r1, [r0, 0x9] + mov r10, r1 + movs r2, 0xE + ldrsh r1, [r0, r2] + cmp r1, 0 + ble _0803FBBA + mov r0, r8 + cmp r0, 0 + bge _0803FBB2 + adds r0, 0x3 +_0803FBB2: + asrs r0, 2 + cmp r1, r0 + bgt _0803FBBA + movs r4, 0x1 +_0803FBBA: + ldr r0, [r7, 0x10] + ldr r0, [r0, 0x70] + movs r3, 0x9E + lsls r3, 1 + adds r0, r3 + ldr r0, [r0] + bl sub_8094450 + cmp r0, 0 + bne _0803FBD2 + movs r0, 0x1 + str r0, [sp] +_0803FBD2: + cmp r4, 0 + beq _0803FBF4 + ldr r0, _0803FBF0 + ldr r0, [r0] + movs r1, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0803FBF4 + movs r5, 0x20 + movs r6, 0x20 + b _0803FBF8 + .align 2, 0 +_0803FBE8: .4byte gUnknown_203B418 +_0803FBEC: .4byte 0x000181e8 +_0803FBF0: .4byte gUnknown_202EDCC +_0803FBF4: + movs r5, 0 + movs r6, 0 +_0803FBF8: + ldr r1, [sp] + cmp r1, 0 + beq _0803FC0E + ldr r0, _0803FC20 + ldr r0, [r0] + movs r1, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0803FC0E + movs r5, 0x30 + movs r6, 0x30 +_0803FC0E: + cmp r5, 0 + bne _0803FC30 + adds r0, r7, 0 + adds r0, 0x2A + ldrb r0, [r0] + cmp r0, 0 + beq _0803FC24 + movs r5, 0x60 + b _0803FC30 + .align 2, 0 +_0803FC20: .4byte gUnknown_202EDCC +_0803FC24: + ldr r0, _0803FCE4 + ldr r0, [r0] + ldrb r0, [r0, 0xB] + cmp r0, 0 + beq _0803FC30 + movs r5, 0x40 +_0803FC30: + cmp r6, 0 + bne _0803FC40 + ldr r0, _0803FCE4 + ldr r0, [r0] + ldrb r0, [r0, 0xB] + cmp r0, 0 + beq _0803FC40 + movs r6, 0x40 +_0803FC40: + movs r2, 0x36 + ldrsh r0, [r7, r2] + cmp r0, r5 + beq _0803FC78 + strh r5, [r7, 0x36] + lsls r5, 2 + ldr r4, _0803FCE8 + adds r1, r5, r4 + movs r0, 0xFC + bl SetBGPaletteBufferColorArray + adds r1, r4, 0x4 + adds r1, r5, r1 + movs r0, 0xFD + bl SetBGPaletteBufferColorArray + adds r1, r4, 0 + adds r1, 0x8 + adds r1, r5, r1 + movs r0, 0xFE + bl SetBGPaletteBufferColorArray + adds r4, 0xC + adds r5, r4 + movs r0, 0xFF + adds r1, r5, 0 + bl SetBGPaletteBufferColorArray +_0803FC78: + movs r3, 0x38 + ldrsh r0, [r7, r3] + cmp r0, r6 + beq _0803FCB0 + strh r6, [r7, 0x38] + lsls r5, r6, 2 + ldr r4, _0803FCE8 + adds r1, r5, r4 + movs r0, 0xFC + bl nullsub_5 + adds r1, r4, 0x4 + adds r1, r5, r1 + movs r0, 0xFD + bl nullsub_5 + adds r1, r4, 0 + adds r1, 0x8 + adds r1, r5, r1 + movs r0, 0xFE + bl nullsub_5 + adds r4, 0xC + adds r5, r4 + movs r0, 0xFF + adds r1, r5, 0 + bl nullsub_5 +_0803FCB0: + ldr r5, _0803FCEC + ldr r0, _0803FCF0 + ldr r2, [r0] + ldr r0, _0803FCF4 + adds r1, r2, r0 + movs r3, 0x14 + ldrsh r0, [r2, r3] + ldrb r1, [r1] + adds r6, r0, r1 + movs r1, 0x3A + ldrsh r0, [r7, r1] + adds r4, r7, 0 + adds r4, 0x2E + cmp r0, r6 + beq _0803FD3E + strh r6, [r7, 0x3A] + ldr r3, _0803FCF8 + adds r0, r2, r3 + ldrb r0, [r0] + bl sub_80900C0 + lsls r0, 24 + cmp r0, 0 + beq _0803FCFC + movs r0, 0 + b _0803FD00 + .align 2, 0 +_0803FCE4: .4byte gUnknown_203B46C +_0803FCE8: .4byte gUnknown_202D068 +_0803FCEC: .4byte gUnknown_202B038 +_0803FCF0: .4byte gUnknown_203B418 +_0803FCF4: .4byte 0x00000645 +_0803FCF8: .4byte 0x00000644 +_0803FCFC: + ldr r1, _0803FD20 + adds r0, r1, 0 +_0803FD00: + strh r0, [r5, 0x2] + cmp r6, 0x9 + bgt _0803FD28 + adds r1, r5, 0x4 + adds r4, r7, 0 + adds r4, 0x2E + ldrb r2, [r4] + adds r0, r6, 0 + movs r3, 0x1 + bl sub_803FE30 + ldr r2, _0803FD24 + adds r0, r2, 0 + strh r0, [r5, 0x6] + b _0803FD3E + .align 2, 0 +_0803FD20: .4byte 0x0000f2be +_0803FD24: .4byte 0x0000f2b8 +_0803FD28: + adds r1, r5, 0x4 + adds r4, r7, 0 + adds r4, 0x2E + ldrb r2, [r4] + adds r0, r6, 0 + movs r3, 0 + bl sub_803FE30 + ldr r3, _0803FE10 + adds r0, r3, 0 + strh r0, [r5, 0x8] +_0803FD3E: + movs r1, 0x3C + ldrsh r0, [r7, r1] + cmp r0, r10 + beq _0803FD64 + mov r2, r10 + strh r2, [r7, 0x3C] + ldr r3, _0803FE14 + adds r0, r3, 0 + strh r0, [r5, 0xA] + ldr r1, _0803FE18 + adds r0, r1, 0 + strh r0, [r5, 0xC] + adds r1, r5, 0 + adds r1, 0xE + ldrb r2, [r4] + mov r0, r10 + movs r3, 0 + bl sub_803FE30 +_0803FD64: + movs r2, 0x3E + ldrsh r0, [r7, r2] + cmp r0, r9 + beq _0803FD84 + ldr r3, _0803FE1C + adds r0, r3, 0 + strh r0, [r5, 0x12] + ldr r1, _0803FE20 + adds r0, r1, 0 + strh r0, [r5, 0x14] + adds r1, r5, 0 + adds r1, 0x16 + ldrb r2, [r4] + mov r0, r9 + bl sub_803FF18 +_0803FD84: + adds r6, r7, 0 + adds r6, 0x40 + movs r2, 0 + ldrsh r0, [r6, r2] + cmp r0, r8 + beq _0803FDA2 + ldr r3, _0803FE24 + adds r0, r3, 0 + strh r0, [r5, 0x1C] + adds r1, r5, 0 + adds r1, 0x1E + ldrb r2, [r4] + mov r0, r8 + bl sub_803FF18 +_0803FDA2: + ldrb r2, [r4] + mov r0, r9 + mov r1, r8 + bl sub_803FA4C + mov r0, r8 + strh r0, [r6] + mov r1, r9 + strh r1, [r7, 0x3E] + mov r0, r8 + cmp r0, 0 + bge _0803FDBC + adds r0, 0x7 +_0803FDBC: + asrs r1, r0, 3 + adds r4, r7, 0 + adds r4, 0x42 + strh r1, [r4] + movs r0, 0x7 + mov r2, r8 + ands r2, r0 + cmp r2, 0 + beq _0803FDD2 + adds r0, r1, 0x1 + strh r0, [r4] +_0803FDD2: + movs r3, 0 + ldrsh r0, [r4, r3] + cmp r0, 0xB + ble _0803FDDE + movs r0, 0xC + strh r0, [r4] +_0803FDDE: + movs r1, 0 + ldr r0, _0803FE28 + movs r2, 0xB3 + lsls r2, 2 + adds r4, r2, 0 + ldr r2, _0803FE2C + adds r3, r2, 0 + adds r2, r0, 0 + adds r2, 0x24 +_0803FDF0: + adds r0, r1, r4 + orrs r0, r3 + strh r0, [r2] + adds r2, 0x2 + adds r1, 0x1 + cmp r1, 0xB + ble _0803FDF0 + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0803FE10: .4byte 0x0000f2b8 +_0803FE14: .4byte 0x0000f2b9 +_0803FE18: .4byte 0x0000f2ba +_0803FE1C: .4byte 0x0000f2bb +_0803FE20: .4byte 0x0000f2bc +_0803FE24: .4byte 0x0000f2bd +_0803FE28: .4byte gUnknown_202B038 +_0803FE2C: .4byte 0xfffff000 + thumb_func_end sub_803FB74 + + thumb_func_start sub_803FE30 +sub_803FE30: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + adds r4, r1, 0 + lsls r2, 24 + lsrs r2, 24 + adds r1, r2, 0 + lsls r3, 24 + lsrs r3, 24 + mov r12, r3 + movs r0, 0 + cmp r2, 0 + bne _0803FE4E + movs r0, 0x37 +_0803FE4E: + cmp r5, 0x64 + ble _0803FE70 + cmp r2, 0 + beq _0803FE60 + ldr r1, _0803FE5C + adds r0, r1, 0 + b _0803FE64 + .align 2, 0 +_0803FE5C: .4byte 0x0000f291 +_0803FE60: + ldr r2, _0803FE6C + adds r0, r2, 0 +_0803FE64: + strh r0, [r4] + strh r0, [r4, 0x2] + b _0803FF00 + .align 2, 0 +_0803FE6C: .4byte 0x0000f2c8 +_0803FE70: + cmp r5, 0x64 + bne _0803FEBC + ldr r1, _0803FE84 + adds r0, r1, 0 + strh r0, [r4] + ldr r2, _0803FE88 + adds r0, r2, 0 + strh r0, [r4, 0x2] + b _0803FF00 + .align 2, 0 +_0803FE84: .4byte 0x0000f294 +_0803FE88: .4byte 0x0000f295 +_0803FE8C: + ldr r1, _0803FEB4 + lsls r0, r6, 3 + adds r0, r6 + adds r0, r2 + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r4] + subs r0, r5, r3 + adds r0, r7 + movs r1, 0x96 + lsls r1, 2 + adds r0, r1 + ldr r2, _0803FEB8 + adds r1, r2, 0 + orrs r0, r1 + mov r1, r8 + strh r0, [r1] + b _0803FF00 + .align 2, 0 +_0803FEB4: .4byte gUnknown_80F64D8 +_0803FEB8: .4byte 0xfffff000 +_0803FEBC: + adds r2, r4, 0x2 + mov r8, r2 + adds r7, r0, 0 + adds r7, 0x30 + cmp r5, 0x9 + ble _0803FEE2 + movs r6, 0 + cmp r1, 0 + bne _0803FED0 + movs r6, 0x1 +_0803FED0: + movs r2, 0 + ldr r0, _0803FF0C +_0803FED4: + ldr r3, [r0] + cmp r3, r5 + ble _0803FE8C + adds r0, 0x4 + adds r2, 0x1 + cmp r2, 0x8 + ble _0803FED4 +_0803FEE2: + mov r0, r12 + cmp r0, 0 + bne _0803FEF0 + ldr r1, _0803FF10 + adds r0, r1, 0 + strh r0, [r4] + adds r4, 0x2 +_0803FEF0: + adds r0, r5, r7 + movs r2, 0x96 + lsls r2, 2 + adds r0, r2 + ldr r2, _0803FF14 + adds r1, r2, 0 + orrs r0, r1 + strh r0, [r4] +_0803FF00: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0803FF0C: .4byte gUnknown_80F64B4 +_0803FF10: .4byte 0x0000f278 +_0803FF14: .4byte 0xfffff000 + thumb_func_end sub_803FE30 + + thumb_func_start sub_803FF18 +sub_803FF18: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + adds r3, r1, 0 + lsls r2, 24 + lsrs r2, 24 + movs r6, 0 + cmp r2, 0 + bne _0803FF2E + movs r6, 0x1 +_0803FF2E: + movs r1, 0 + cmp r2, 0 + bne _0803FF36 + movs r1, 0x37 +_0803FF36: + ldr r0, _0803FF54 + cmp r5, r0 + ble _0803FF7C + ldr r0, _0803FF58 + lsls r1, r6, 3 + adds r1, r6 + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + strh r0, [r3] + adds r3, 0x2 + strh r0, [r3] + strh r0, [r3, 0x2] + b _0804001A + .align 2, 0 +_0803FF54: .4byte 0x000003e7 +_0803FF58: .4byte gUnknown_80F6544 +_0803FF5C: + ldr r1, _0803FF78 + lsls r0, r6, 3 + adds r0, r6 + adds r0, r4 + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r3] + adds r3, 0x2 + subs r5, r2 + mov r1, r8 + lsls r0, r1, 24 + lsrs r7, r0, 24 + b _0803FF98 + .align 2, 0 +_0803FF78: .4byte gUnknown_80F6544 +_0803FF7C: + movs r7, 0x20 + movs r4, 0 + adds r1, 0x30 + mov r8, r1 + ldr r2, _0803FFC0 + mov r12, r2 + ldr r0, _0803FFC4 +_0803FF8A: + ldr r2, [r0] + cmp r2, r5 + ble _0803FF5C + adds r0, 0x4 + adds r4, 0x1 + cmp r4, 0x8 + ble _0803FF8A +_0803FF98: + cmp r4, 0x9 + bne _0803FFAC + movs r1, 0x96 + lsls r1, 2 + adds r0, r7, r1 + ldr r2, _0803FFC8 + adds r1, r2, 0 + orrs r0, r1 + strh r0, [r3] + adds r3, 0x2 +_0803FFAC: + movs r4, 0 + mov r0, r12 + ldr r2, [r0] + cmp r2, r5 + bgt _0803FFD0 + ldr r0, _0803FFCC + lsls r1, r6, 3 + adds r1, r6 + b _0803FFE8 + .align 2, 0 +_0803FFC0: .4byte gUnknown_80F6520 +_0803FFC4: .4byte gUnknown_80F64FC +_0803FFC8: .4byte 0xfffff000 +_0803FFCC: .4byte gUnknown_80F6544 +_0803FFD0: + adds r4, 0x1 + cmp r4, 0x8 + bgt _0803FFF4 + lsls r0, r4, 2 + add r0, r12 + ldr r2, [r0] + cmp r2, r5 + bgt _0803FFD0 + ldr r0, _08040024 + lsls r1, r6, 3 + adds r1, r6 + adds r1, r4 +_0803FFE8: + lsls r1, 1 + adds r1, r0 + ldrh r0, [r1] + strh r0, [r3] + adds r3, 0x2 + subs r5, r2 +_0803FFF4: + cmp r4, 0x9 + bne _08040008 + movs r1, 0x96 + lsls r1, 2 + adds r0, r7, r1 + ldr r2, _08040028 + adds r1, r2, 0 + orrs r0, r1 + strh r0, [r3] + adds r3, 0x2 +_08040008: + mov r1, r8 + adds r0, r5, r1 + movs r2, 0x96 + lsls r2, 2 + adds r0, r2 + ldr r2, _08040028 + adds r1, r2, 0 + orrs r0, r1 + strh r0, [r3] +_0804001A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08040024: .4byte gUnknown_80F6544 +_08040028: .4byte 0xfffff000 + thumb_func_end sub_803FF18 + + thumb_func_start sub_804002C +sub_804002C: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r8, r0 + ldr r0, _08040088 + ldr r0, [r0] + ldr r1, _0804008C + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + movs r5, 0 + movs r7, 0x1 +_08040046: + movs r4, 0 + adds r6, r5, 0x1 +_0804004A: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8049590 + ldrh r1, [r0, 0x4] + orrs r1, r7 + strh r1, [r0, 0x4] + adds r4, 0x1 + cmp r4, 0x37 + ble _0804004A + adds r5, r6, 0 + cmp r5, 0x1F + ble _08040046 + movs r0, 0 + bl sub_803F580 + bl sub_8049ED4 + bl sub_8040A84 + ldr r0, _08040090 + ldr r1, [r0] + mov r0, r8 + bl sub_80522A8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08040088: .4byte gUnknown_203B418 +_0804008C: .4byte 0x0001820b +_08040090: .4byte gUnknown_80FD040 + thumb_func_end sub_804002C + + thumb_func_start sub_8040094 +sub_8040094: + push {lr} + ldr r1, _080400C8 + ldr r1, [r1] + ldr r2, _080400CC + adds r1, r2 + strb r0, [r1] + bl sub_803F7BC + bl sub_80060EC + ldr r0, _080400D0 + ldr r0, [r0] + bl sub_8094FB4 + bl sub_800CB20 + bl sub_800485C + bl xxx_call_update_bg_sound_input + bl sub_8083F58 + bl sub_8011860 + pop {r0} + bx r0 + .align 2, 0 +_080400C8: .4byte gUnknown_203B418 +_080400CC: .4byte 0x00018217 +_080400D0: .4byte gUnknown_203B47C + thumb_func_end sub_8040094 + + thumb_func_start sub_80400D4 +sub_80400D4: + push {r4,lr} + ldr r0, _08040114 + ldr r4, [r0] + movs r0, 0xC1 + lsls r0, 9 + adds r3, r4, r0 + ldr r0, [r3] + cmp r0, 0 + beq _0804010C + cmp r0, 0x1E + ble _080400EC + movs r0, 0x1F +_080400EC: + ldr r1, _08040118 + adds r2, r4, r1 + ldr r1, _0804011C + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [r2] + ldr r0, [r3] + subs r0, 0x1 + str r0, [r3] + cmp r0, 0 + bne _0804010C + ldr r1, _08040120 + adds r0, r4, r1 + ldr r0, [r0] + str r0, [r3] +_0804010C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08040114: .4byte gUnknown_203B418 +_08040118: .4byte 0x000181fc +_0804011C: .4byte gUnknown_80F6568 +_08040120: .4byte 0x00018204 + thumb_func_end sub_80400D4 + + thumb_func_start sub_8040124 +sub_8040124: + ldr r1, _0804012C + movs r0, 0 + strb r0, [r1] + bx lr + .align 2, 0 +_0804012C: .4byte gUnknown_202EE01 + thumb_func_end sub_8040124 + + thumb_func_start sub_8040130 +sub_8040130: + push {lr} + ldr r0, _08040144 + ldr r1, _08040148 + bl sub_800A9EC + ldr r1, _0804014C + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_08040144: .4byte gUnknown_80F6604 +_08040148: .4byte gUnknown_83B0000 +_0804014C: .4byte gUnknown_202EE04 + thumb_func_end sub_8040130 + + thumb_func_start sub_8040150 +sub_8040150: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r0, 0 + ldr r2, _080401EC +_08040164: + movs r4, 0 + lsls r1, r0, 3 + adds r3, r0, 0x1 + mov r8, r3 + subs r1, r0 + lsls r0, r1, 7 + ldr r3, _080401F0 + adds r6, r0, r3 + lsls r5, r1, 2 +_08040176: + ldr r0, [r2] + adds r0, r6 + lsls r1, r4, 5 + adds r0, r1 + movs r1, 0x20 + str r2, [sp] + bl CpuClear + ldr r2, [sp] + ldr r0, [r2] + adds r1, r4, r5 + ldr r3, _080401F4 + adds r0, r3 + adds r0, r1 + movs r7, 0 + strb r7, [r0] + adds r4, 0x1 + cmp r4, 0x1B + ble _08040176 + mov r0, r8 + cmp r0, 0xF + ble _08040164 + mov r0, r9 + cmp r0, 0 + bne _080401B0 + ldr r1, _080401F8 + movs r0, 0x64 + strh r0, [r1] + strh r0, [r1, 0x2] +_080401B0: + ldr r3, _080401EC + ldr r0, [r3] + ldr r2, _080401FC + adds r1, r0, r2 + str r7, [r1] + ldr r1, _08040200 + adds r0, r1 + movs r2, 0x1 + strb r2, [r0] + ldr r0, [r3] + ldr r3, _08040204 + adds r0, r3 + strb r7, [r0] + ldr r0, _08040208 + strb r2, [r0] + ldr r1, _0804020C + ldr r0, _08040210 + str r0, [r1] + ldr r0, _08040214 + strb r2, [r0] + bl sub_8040238 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080401EC: .4byte gUnknown_203B418 +_080401F0: .4byte 0x0001822c +_080401F4: .4byte 0x0001ba2c +_080401F8: .4byte gUnknown_203B410 +_080401FC: .4byte 0x0001bdcc +_08040200: .4byte 0x0001bdd0 +_08040204: .4byte 0x0001bdd2 +_08040208: .4byte gUnknown_202EE00 +_0804020C: .4byte gUnknown_202EE08 +_08040210: .4byte 0x06001700 +_08040214: .4byte gUnknown_202EE01 + thumb_func_end sub_8040150 + + thumb_func_start sub_8040218 +sub_8040218: + push {lr} + ldr r0, _08040230 + ldr r0, [r0] + cmp r0, 0 + beq _08040226 + bl sub_800AA14 +_08040226: + bl sub_8040124 + pop {r0} + bx r0 + .align 2, 0 +_08040230: .4byte gUnknown_202EE04 + thumb_func_end sub_8040218 + + thumb_func_start nullsub_203 +nullsub_203: + bx lr + thumb_func_end nullsub_203 + + thumb_func_start sub_8040238 +sub_8040238: + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r1, _0804026C + ldr r0, [r1] + cmp r0, 0 + beq _080402A0 + ldr r0, _08040270 + ldrb r0, [r0] + cmp r0, 0 + beq _080402A0 + movs r6, 0 + ldr r0, _08040274 + mov r8, r0 + adds r7, r1, 0 +_08040256: + cmp r6, 0xE + bne _08040278 + movs r0, 0xEE + mov r1, r8 + bl SetBGPaletteBufferColorArray + movs r0, 0xEE + mov r1, r8 + bl nullsub_5 + b _0804029A + .align 2, 0 +_0804026C: .4byte gUnknown_202EE04 +_08040270: .4byte gUnknown_202EE01 +_08040274: .4byte gUnknown_202D03C +_08040278: + adds r5, r6, 0 + adds r5, 0xE0 + ldr r0, [r7] + ldr r0, [r0, 0x4] + lsls r4, r6, 2 + ldr r1, [r0, 0x4] + adds r1, r4 + adds r0, r5, 0 + bl SetBGPaletteBufferColorArray + ldr r0, [r7] + ldr r0, [r0, 0x4] + ldr r1, [r0, 0x4] + adds r1, r4 + adds r0, r5, 0 + bl nullsub_5 +_0804029A: + adds r6, 0x1 + cmp r6, 0xF + ble _08040256 +_080402A0: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8040238 + + thumb_func_start sub_80402AC +sub_80402AC: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + mov r8, r0 + str r1, [sp] + ldr r4, _0804034C + ldr r0, [r4] + str r0, [sp, 0x4] + movs r1, 0x1 + mov r10, r1 + ldr r0, _08040350 + ldr r0, [r0] + cmp r0, 0 + bne _080402D0 + b _08040776 +_080402D0: + ldr r0, _08040354 + ldrb r0, [r0] + cmp r0, 0 + bne _080402DA + b _08040776 +_080402DA: + bl sub_800EC74 + lsls r0, 24 + cmp r0, 0 + beq _080402E6 + b _08040776 +_080402E6: + mov r2, r8 + cmp r2, 0 + bge _080402EE + b _08040776 +_080402EE: + ldr r3, [sp] + cmp r3, 0x1 + bgt _080402F6 + b _08040776 +_080402F6: + cmp r2, 0x37 + ble _080402FC + b _08040776 +_080402FC: + cmp r3, 0x1E + ble _08040302 + b _08040776 +_08040302: + mov r0, r8 + adds r1, r3, 0 + bl sub_804954C + mov r9, r0 + ldrh r0, [r0] + movs r5, 0x3 + ands r5, r0 + str r5, [sp, 0x8] + ldr r0, [r4] + ldr r7, _08040358 + adds r1, r0, r7 + ldrb r1, [r1] + str r1, [sp, 0xC] + ldr r2, _0804035C + adds r1, r0, r2 + ldrb r5, [r1] + ldr r3, _08040360 + adds r1, r0, r3 + ldrb r1, [r1] + str r1, [sp, 0x14] + subs r7, 0x2 + adds r1, r0, r7 + ldrb r1, [r1] + str r1, [sp, 0x10] + ldr r1, _08040364 + adds r0, r1 + ldrb r0, [r0] + cmp r5, 0 + beq _08040368 + mov r2, r9 + ldrb r0, [r2, 0x4] + mov r7, r10 + ands r7, r0 + movs r3, 0 + str r3, [sp, 0x18] + b _0804039C + .align 2, 0 +_0804034C: .4byte gUnknown_203B418 +_08040350: .4byte gUnknown_202EE04 +_08040354: .4byte gUnknown_202EE01 +_08040358: .4byte 0x00018210 +_0804035C: .4byte 0x0001820a +_08040360: .4byte 0x0001820f +_08040364: .4byte 0x0001820b +_08040368: + cmp r0, 0 + beq _08040370 + movs r7, 0x1 + b _08040378 +_08040370: + mov r7, r9 + ldrb r0, [r7, 0x4] + mov r7, r10 + ands r7, r0 +_08040378: + bl sub_8043D10 + lsls r0, 24 + cmp r0, 0 + bne _08040398 + ldr r0, _08040390 + ldr r0, [r0] + ldr r1, _08040394 + adds r0, r1 + ldrb r0, [r0] + str r0, [sp, 0x18] + b _0804039C + .align 2, 0 +_08040390: .4byte gUnknown_203B418 +_08040394: .4byte 0x00018211 +_08040398: + movs r2, 0 + str r2, [sp, 0x18] +_0804039C: + bl sub_8094C48 + lsls r0, 24 + cmp r0, 0 + bne _080403A8 + b _08040632 +_080403A8: + ldr r0, _080403FC + ldr r0, [r0] + ldr r3, _08040400 + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0 + beq _080403B8 + b _08040632 +_080403B8: + movs r6, 0 + cmp r5, 0 + bne _0804045E + mov r0, r9 + ldr r4, [r0, 0x10] + cmp r4, 0 + beq _0804045E + adds r0, r4, 0 + bl sub_80450F8 + adds r1, r0, 0 + ldr r0, _08040404 + ldrb r0, [r0] + cmp r0, 0 + beq _0804045E + cmp r1, 0x1 + bne _0804045E + adds r0, r4, 0 + bl sub_8045804 + lsls r0, 24 + cmp r0, 0 + beq _0804045E + ldr r1, [r4, 0x70] + adds r0, r1, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x4A + beq _080403F6 + cmp r0, 0x47 + bne _08040408 +_080403F6: + movs r0, 0x1 + b _0804040A + .align 2, 0 +_080403FC: .4byte gUnknown_203B418 +_08040400: .4byte 0x0001356c +_08040404: .4byte gUnknown_202EE00 +_08040408: + movs r0, 0 +_0804040A: + cmp r0, 0 + bne _08040458 + adds r0, r1, 0 + adds r0, 0xA4 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08040458 + cmp r0, 0x4 + beq _08040458 + ldrb r0, [r1, 0x6] + cmp r0, 0 + beq _08040426 + movs r6, 0x2 + b _0804045A +_08040426: + ldrb r0, [r1, 0x7] + cmp r0, 0 + beq _08040458 + ldr r0, _0804044C + mov r1, r8 + strh r1, [r0] + mov r2, sp + ldrh r2, [r2] + strh r2, [r0, 0x2] + ldr r0, _08040450 + ldr r0, [r0] + ldr r3, _08040454 + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0 + beq _0804045A + movs r6, 0x8 + b _0804045A + .align 2, 0 +_0804044C: .4byte gUnknown_203B410 +_08040450: .4byte gUnknown_203B418 +_08040454: .4byte 0x00018214 +_08040458: + movs r6, 0xA +_0804045A: + movs r0, 0 + mov r10, r0 +_0804045E: + mov r1, r10 + cmp r1, 0 + beq _0804054E + cmp r5, 0 + bne _08040548 + mov r2, r9 + ldr r4, [r2, 0x14] + cmp r4, 0 + beq _08040500 + adds r0, r4, 0 + bl sub_80450F8 + adds r5, r0, 0 + cmp r7, 0 + bne _0804049E + movs r6, 0 + cmp r5, 0x3 + bne _0804054E + ldr r3, [sp, 0x10] + cmp r3, 0 + bne _08040494 + mov r5, r9 + ldrh r1, [r5, 0x4] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0804054E +_08040494: + ldr r0, [sp, 0x8] + cmp r0, 0 + beq _0804054E + movs r6, 0x3 + b _0804054E +_0804049E: + cmp r5, 0x2 + bne _080404C4 + adds r0, r4, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0 + bne _080404B2 + ldr r1, [sp, 0x14] + cmp r1, 0 + beq _080404C4 +_080404B2: + adds r0, r4, 0 + bl sub_8045104 + ldr r1, _080404FC + ldrb r0, [r0] + adds r0, r1 + ldrb r6, [r0] + movs r2, 0 + mov r10, r2 +_080404C4: + mov r3, r10 + cmp r3, 0 + beq _0804054E + cmp r5, 0x3 + bne _080404EC + ldr r5, [sp, 0x10] + cmp r5, 0 + bne _080404E0 + mov r0, r9 + ldrh r1, [r0, 0x4] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080404EC +_080404E0: + ldr r1, [sp, 0x8] + cmp r1, 0 + beq _080404EC + movs r6, 0x3 + movs r2, 0 + mov r10, r2 +_080404EC: + mov r3, r10 + cmp r3, 0 + beq _0804054E + ldr r5, [sp, 0x8] + cmp r5, 0x1 + beq _08040548 + movs r6, 0 + b _0804054E + .align 2, 0 +_080404FC: .4byte gUnknown_80F65F0 +_08040500: + cmp r7, 0 + bne _08040528 + ldr r0, [sp, 0x18] + cmp r0, 0 + beq _08040548 + mov r2, r9 + ldrh r1, [r2] + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + cmp r0, 0 + beq _08040548 + bl sub_8043D10 + lsls r0, 24 + movs r6, 0x5 + cmp r0, 0 + bne _0804054E + movs r6, 0x6 + b _0804054E +_08040528: + mov r3, r9 + ldrh r1, [r3] + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + cmp r0, 0 + beq _08040548 + bl sub_8043D10 + lsls r0, 24 + movs r6, 0x5 + cmp r0, 0 + bne _08040544 + movs r6, 0x6 +_08040544: + movs r5, 0 + mov r10, r5 +_08040548: + mov r0, r10 + cmp r0, 0 + bne _0804055A +_0804054E: + ldr r1, [sp, 0xC] + cmp r1, 0 + beq _0804055A + cmp r6, 0 + beq _0804055E + movs r6, 0xB +_0804055A: + cmp r6, 0 + bne _08040606 +_0804055E: + cmp r7, 0 + beq _08040568 + ldr r2, [sp, 0x8] + cmp r2, 0x1 + beq _0804056C +_08040568: + movs r6, 0x1 + b _08040606 +_0804056C: + movs r4, 0xF + ldr r3, [sp] + cmp r3, 0x1E + bgt _0804058A + adds r1, r3, 0 + adds r1, 0x1 + mov r0, r8 + bl sub_804954C + ldrh r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + bne _0804058A + movs r4, 0xE +_0804058A: + ldr r5, [sp] + cmp r5, 0 + ble _080405AA + adds r1, r5, 0 + subs r1, 0x1 + mov r0, r8 + bl sub_804954C + ldrh r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + bne _080405AA + movs r0, 0x5 + negs r0, r0 + ands r4, r0 +_080405AA: + mov r7, r8 + cmp r7, 0x36 + bgt _080405CA + mov r0, r8 + adds r0, 0x1 + ldr r1, [sp] + bl sub_804954C + ldrh r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + bne _080405CA + movs r0, 0x3 + negs r0, r0 + ands r4, r0 +_080405CA: + mov r0, r8 + cmp r0, 0 + ble _080405E8 + subs r0, 0x1 + ldr r1, [sp] + bl sub_804954C + ldrh r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + bne _080405E8 + movs r0, 0x9 + negs r0, r0 + ands r4, r0 +_080405E8: + lsls r0, r4, 16 + asrs r6, r0, 16 + mov r2, r9 + ldrh r1, [r2, 0x4] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080405FE + adds r0, r6, 0 + adds r0, 0x10 + b _08040602 +_080405FE: + adds r0, r6, 0 + adds r0, 0x20 +_08040602: + lsls r0, 16 + asrs r6, r0, 16 +_08040606: + ldr r0, _08040618 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r0, 0x6 + bne _0804061C + adds r0, r6, 0 + adds r0, 0x80 + b _0804062C + .align 2, 0 +_08040618: .4byte gUnknown_203B46C +_0804061C: + bl sub_8094C68 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0804063A + adds r0, r6, 0 + adds r0, 0x40 +_0804062C: + lsls r0, 16 + asrs r6, r0, 16 + b _0804063A +_08040632: + movs r6, 0x1 + ldr r1, _0804074C + movs r0, 0x64 + strh r0, [r1] +_0804063A: + mov r3, r8 + lsrs r0, r3, 31 + add r0, r8 + asrs r0, 1 + mov r9, r0 + ldr r0, [sp] + subs r0, 0x2 + lsrs r1, r0, 31 + adds r1, r0, r1 + asrs r1, 1 + mov r5, r9 + lsls r3, r5, 1 + mov r7, r8 + subs r3, r7, r3 + lsls r2, r1, 1 + subs r0, r2 + lsls r0, 1 + adds r3, r0 + lsls r0, r1, 3 + subs r5, r0, r1 + lsls r0, r5, 7 + ldr r1, _08040750 + adds r0, r1 + ldr r2, [sp, 0x4] + adds r0, r2, r0 + mov r7, r9 + lsls r1, r7, 5 + adds r4, r0, r1 + ldr r0, _08040754 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r0, r6, 2 + adds r0, r3 + ldr r1, [r1] + lsls r0, 2 + adds r0, r1 + ldr r2, [r0] + ldr r0, [r4] + ldr r1, [r2] + ands r0, r1 + ldr r1, [r2, 0x4] + orrs r0, r1 + str r0, [r4] + ldr r0, [r4, 0x4] + ldr r1, [r2, 0x8] + ands r0, r1 + ldr r1, [r2, 0xC] + orrs r0, r1 + str r0, [r4, 0x4] + ldr r0, [r4, 0x8] + ldr r1, [r2, 0x10] + ands r0, r1 + ldr r1, [r2, 0x14] + orrs r0, r1 + str r0, [r4, 0x8] + ldr r0, [r4, 0xC] + ldr r1, [r2, 0x18] + ands r0, r1 + ldr r1, [r2, 0x1C] + orrs r0, r1 + str r0, [r4, 0xC] + ldr r0, [r4, 0x10] + ldr r1, [r2, 0x20] + ands r0, r1 + ldr r1, [r2, 0x24] + orrs r0, r1 + str r0, [r4, 0x10] + ldr r0, [r4, 0x14] + ldr r1, [r2, 0x28] + ands r0, r1 + ldr r1, [r2, 0x2C] + orrs r0, r1 + str r0, [r4, 0x14] + ldr r0, [r4, 0x18] + ldr r1, [r2, 0x30] + ands r0, r1 + ldr r1, [r2, 0x34] + orrs r0, r1 + str r0, [r4, 0x18] + ldr r0, [r4, 0x1C] + ldr r1, [r2, 0x38] + ands r0, r1 + ldr r1, [r2, 0x3C] + orrs r0, r1 + str r0, [r4, 0x1C] + ldr r0, [sp, 0x4] + ldr r1, _08040758 + adds r2, r0, r1 + ldrb r0, [r2] + cmp r0, 0 + bne _08040776 + lsls r5, 2 + mov r10, r5 + mov r3, r9 + add r3, r10 + ldr r5, _0804075C + mov r8, r5 + ldr r0, [sp, 0x4] + add r0, r8 + adds r1, r0, r3 + ldrb r0, [r1] + cmp r0, 0 + bne _08040776 + movs r0, 0x1 + strb r0, [r1] + ldr r7, [sp, 0x4] + ldr r1, _08040760 + adds r6, r7, r1 + ldr r5, [r6] + cmp r5, 0x27 + bgt _08040774 + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 2 + ldr r0, _08040764 + adds r2, r7, r0 + adds r2, r1 + ldr r0, _08040768 + lsls r3, 5 + ldr r0, [r0] + adds r0, r3 + str r0, [r2] + ldr r2, _0804076C + adds r0, r7, r2 + adds r0, r1 + str r4, [r0] + ldr r3, _08040770 + adds r2, r7, r3 + adds r2, r1 + mov r0, r10 + add r0, r8 + adds r0, r7, r0 + add r0, r9 + str r0, [r2] + adds r0, r5, 0x1 + str r0, [r6] + b _08040776 + .align 2, 0 +_0804074C: .4byte gUnknown_203B410 +_08040750: .4byte 0x0001822c +_08040754: .4byte gUnknown_202EE04 +_08040758: .4byte 0x0001bdd1 +_0804075C: .4byte 0x0001ba2c +_08040760: .4byte 0x0001bdcc +_08040764: .4byte 0x0001bbec +_08040768: .4byte gUnknown_202EE08 +_0804076C: .4byte 0x0001bbf0 +_08040770: .4byte 0x0001bbf4 +_08040774: + strb r0, [r2] +_08040776: + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80402AC + + thumb_func_start sub_8040788 +sub_8040788: + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, _08040814 + ldr r0, [r0] + mov r8, r0 + cmp r0, 0 + beq _08040870 + ldr r0, _08040818 + add r0, r8 + ldrb r0, [r0] + cmp r0, 0 + beq _08040870 + bl sub_800EC74 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _08040870 + ldr r1, _0804081C + add r1, r8 + ldrb r0, [r1] + cmp r0, 0 + bne _0804082C + movs r6, 0 + ldr r1, _08040820 + add r1, r8 + ldr r0, [r1] + cmp r6, r0 + bge _08040868 + adds r5, r1, 0 + movs r4, 0 +_080407C8: + ldr r1, _08040824 + adds r0, r4, r1 + mov r1, r8 + adds r3, r1, r0 + ldr r1, [r3, 0x4] + ldr r2, [r3] + ldr r0, _08040828 + ldr r0, [r0] + cmp r0, 0 + beq _080407E0 + cmp r0, 0x3 + bne _08040800 +_080407E0: + ldm r1!, {r0} + stm r2!, {r0} + ldm r1!, {r0} + stm r2!, {r0} + ldm r1!, {r0} + stm r2!, {r0} + ldm r1!, {r0} + stm r2!, {r0} + ldm r1!, {r0} + stm r2!, {r0} + ldm r1!, {r0} + stm r2!, {r0} + ldm r1!, {r0} + stm r2!, {r0} + ldr r0, [r1] + str r0, [r2] +_08040800: + ldr r0, [r3, 0x8] + movs r1, 0 + strb r1, [r0] + adds r4, 0xC + adds r6, 0x1 + ldr r0, [r5] + cmp r6, r0 + blt _080407C8 + b _08040868 + .align 2, 0 +_08040814: .4byte gUnknown_203B418 +_08040818: .4byte 0x0001bdd0 +_0804081C: .4byte 0x0001bdd1 +_08040820: .4byte 0x0001bdcc +_08040824: .4byte 0x0001bbec +_08040828: .4byte gUnknown_202EDD0 +_0804082C: + strb r2, [r1] + ldr r0, _0804087C + ldr r5, [r0] + ldr r4, _08040880 + add r4, r8 + movs r6, 0 + movs r7, 0x80 + lsls r7, 1 +_0804083C: + ldr r0, _08040884 + ldr r0, [r0] + cmp r0, 0 + beq _08040848 + cmp r0, 0x3 + bne _08040854 +_08040848: + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x80 + lsls r2, 1 + bl CpuCopy +_08040854: + adds r5, r7 + adds r4, r7 + adds r6, 0x8 + ldr r0, _08040888 + cmp r6, r0 + ble _0804083C + ldr r1, _0804088C + add r1, r8 + movs r0, 0x1 + strb r0, [r1] +_08040868: + ldr r1, _08040890 + add r1, r8 + movs r0, 0 + str r0, [r1] +_08040870: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804087C: .4byte gUnknown_202EE08 +_08040880: .4byte 0x0001822c +_08040884: .4byte gUnknown_202EDD0 +_08040888: .4byte 0x000001bf +_0804088C: .4byte 0x0001bdd2 +_08040890: .4byte 0x0001bdcc + thumb_func_end sub_8040788 + + thumb_func_start sub_8040894 +sub_8040894: + push {r4-r7,lr} + sub sp, 0x8 + ldr r0, _080409F4 + ldr r1, [r0] + ldr r2, _080409F8 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080408A8 + b _08040A6A +_080408A8: + adds r2, 0x5 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080408B4 + b _08040A6A +_080408B4: + ldr r7, _080409FC + movs r1, 0 + ldrsh r0, [r7, r1] + cmp r0, 0x63 + ble _080408C0 + b _08040A6A +_080408C0: + ldr r0, _08040A00 + ldrb r1, [r0] + adds r1, 0x1 + strb r1, [r0] + movs r0, 0x8 + ands r1, r0 + cmp r1, 0 + beq _080408D2 + b _08040A6A +_080408D2: + movs r0, 0 + movs r1, 0 + str r0, [sp] + str r1, [sp, 0x4] + mov r0, sp + ldrh r0, [r0] + ldr r1, _08040A04 + ands r1, r0 + ldr r3, _08040A08 + ldr r0, [sp] + ands r0, r3 + orrs r0, r1 + str r0, [sp] + mov r1, sp + ldrh r1, [r1] + adds r2, r3, 0 + ands r2, r0 + orrs r2, r1 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r0, _08040A0C + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r5, _08040A10 + adds r0, r5, 0 + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r0, _08040A14 + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r0, _08040A18 + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r4, _08040A1C + adds r0, r4, 0 + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + ands r3, r1 + orrs r3, r0 + str r3, [sp] + mov r3, sp + ldrh r0, [r3, 0x2] + ldr r6, _08040A20 + ands r6, r0 + ands r6, r4 + strh r6, [r3, 0x2] + ldr r2, _08040A24 + ldrh r1, [r3, 0x4] + movs r0, 0xFC + lsls r0, 8 + ands r0, r1 + orrs r0, r2 + ands r0, r5 + movs r5, 0xF + lsls r1, r5, 12 + ldr r4, _08040A28 + ands r0, r4 + orrs r0, r1 + strh r0, [r3, 0x4] + ldrh r0, [r3, 0x6] + ldr r2, _08040A2C + ands r2, r0 + ldr r0, _08040A30 + ands r2, r0 + strh r2, [r3, 0x6] + ldr r0, _08040A34 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r0, 0x6 + bne _08040A3C + movs r1, 0 + ldrsh r0, [r7, r1] + lsls r0, 2 + adds r0, 0x10 + ldr r1, _08040A38 + ands r0, r1 + strh r0, [r3, 0x2] + movs r1, 0x2 + ldrsh r0, [r7, r1] + adds r0, 0x1 + lsls r0, 2 + ands r0, r4 + lsls r0, 4 + adds r1, r2, 0 + ands r1, r5 + orrs r1, r0 + strh r1, [r3, 0x6] + movs r1, 0x80 + lsls r1, 1 + mov r0, sp + movs r2, 0 + movs r3, 0 + bl nullsub_11 + b _08040A6A + .align 2, 0 +_080409F4: .4byte gUnknown_203B418 +_080409F8: .4byte 0x00018214 +_080409FC: .4byte gUnknown_203B410 +_08040A00: .4byte gUnknown_202EE02 +_08040A04: .4byte 0x0000feff +_08040A08: .4byte 0xffff0000 +_08040A0C: .4byte 0x0000fdff +_08040A10: .4byte 0x0000f3ff +_08040A14: .4byte 0x0000efff +_08040A18: .4byte 0x0000dfff +_08040A1C: .4byte 0x00003fff +_08040A20: .4byte 0x0000c1ff +_08040A24: .4byte 0x00000215 +_08040A28: .4byte 0x00000fff +_08040A2C: .4byte 0x0000fffe +_08040A30: .4byte 0x0000fffd +_08040A34: .4byte gUnknown_203B46C +_08040A38: .4byte 0x000001ff +_08040A3C: + movs r1, 0 + ldrsh r0, [r7, r1] + lsls r0, 2 + adds r0, 0x8 + ldr r1, _08040A74 + ands r0, r1 + strh r0, [r3, 0x2] + movs r1, 0x2 + ldrsh r0, [r7, r1] + lsls r0, 2 + ands r0, r4 + lsls r0, 4 + adds r1, r2, 0 + ands r1, r5 + orrs r1, r0 + strh r1, [r3, 0x6] + movs r1, 0x80 + lsls r1, 1 + mov r0, sp + movs r2, 0 + movs r3, 0 + bl AddSprite +_08040A6A: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08040A74: .4byte 0x000001ff + thumb_func_end sub_8040894 + + thumb_func_start sub_8040A78 +sub_8040A78: + ldr r1, _08040A80 + movs r0, 0 + strb r0, [r1] + bx lr + .align 2, 0 +_08040A80: .4byte gUnknown_202EE02 + thumb_func_end sub_8040A78 + + thumb_func_start sub_8040A84 +sub_8040A84: + push {r4-r6,lr} + ldr r0, _08040AB4 + ldr r0, [r0] + ldr r1, _08040AB8 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + movs r5, 0 +_08040A94: + movs r4, 0 + adds r6, r5, 0x1 +_08040A98: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80402AC + adds r4, 0x1 + cmp r4, 0x37 + ble _08040A98 + adds r5, r6, 0 + cmp r5, 0x1F + ble _08040A94 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08040AB4: .4byte gUnknown_203B418 +_08040AB8: .4byte 0x0001bdd1 + thumb_func_end sub_8040A84 + + thumb_func_start sub_8040ABC +sub_8040ABC: + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r1, r0, 24 + ldr r0, _08040AD8 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r0, 0x6 + bne _08040ADC + movs r7, 0xF + movs r0, 0 + b _08040AEC + .align 2, 0 +_08040AD8: .4byte gUnknown_203B46C +_08040ADC: + cmp r1, 0 + beq _08040AE8 + movs r7, 0xE + movs r4, 0 + mov r8, r4 + b _08040AEE +_08040AE8: + movs r7, 0x10 + movs r0, 0x3 +_08040AEC: + mov r8, r0 +_08040AEE: + ldr r6, _08040B58 + movs r2, 0x1 + movs r1, 0 + cmp r1, r7 + bge _08040B22 + ldr r4, _08040B5C + mov r12, r4 +_08040AFC: + lsls r0, r2, 6 + mov r4, r12 + adds r3, r0, r4 + adds r4, r2, 0x1 + adds r5, r1, 0x1 + movs r2, 0x1B +_08040B08: + adds r1, r6, 0 + adds r0, r1, 0x1 + lsls r0, 16 + lsrs r6, r0, 16 + strh r1, [r3] + adds r3, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _08040B08 + adds r2, r4, 0 + adds r1, r5, 0 + cmp r1, r7 + blt _08040AFC +_08040B22: + movs r1, 0 + cmp r1, r8 + bge _08040B4C + ldr r6, _08040B5C + movs r0, 0xE0 + lsls r0, 8 + adds r3, r0, 0 +_08040B30: + lsls r0, r2, 6 + adds r0, r6 + adds r4, r2, 0x1 + adds r5, r1, 0x1 + movs r2, 0x1B +_08040B3A: + strh r3, [r0] + adds r0, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _08040B3A + adds r2, r4, 0 + adds r1, r5, 0 + cmp r1, r8 + blt _08040B30 +_08040B4C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08040B58: .4byte 0x0000e0b8 +_08040B5C: .4byte gUnknown_202B03A + thumb_func_end sub_8040ABC + + thumb_func_start sub_8040B60 +sub_8040B60: + push {r4,r5,lr} + ldr r0, _08040BA4 + ldr r3, [r0] + ldr r1, _08040BA8 + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08040B9E + movs r1, 0 + ldr r2, _08040BAC + adds r5, r3, r2 + movs r4, 0 +_08040B78: + lsls r0, r1, 3 + adds r2, r1, 0x1 + subs r0, r1 + movs r1, 0x37 + lsls r0, 2 + adds r0, r5 + adds r0, 0x37 +_08040B86: + strb r4, [r0] + subs r0, 0x1 + subs r1, 0x1 + cmp r1, 0 + bge _08040B86 + adds r1, r2, 0 + cmp r1, 0x1F + ble _08040B78 + movs r1, 0 + ldr r2, _08040BA8 + adds r0, r3, r2 + strb r1, [r0] +_08040B9E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08040BA4: .4byte gUnknown_203B418 +_08040BA8: .4byte 0x0001bdd2 +_08040BAC: .4byte 0x0001ba2c + thumb_func_end sub_8040B60 + + thumb_func_start sub_8040BB0 +sub_8040BB0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r6, r0, 0 + adds r7, r1, 0 + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + bl sub_804143C + mov r8, r0 + ldrh r4, [r7, 0x2] + adds r0, r6, 0 + bl sub_807E580 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + mov r2, r8 + bl sub_804141C + lsls r0, 24 + lsrs r5, r0, 24 + mov r9, r5 + ldrh r4, [r7, 0x2] + adds r0, r6, 0 + bl sub_807E580 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + mov r2, r8 + bl sub_80412E0 + lsls r0, 16 + lsrs r0, 16 + bl sub_800ECB8 + movs r1, 0 + ldrsh r4, [r0, r1] + adds r0, r6, 0 + bl sub_8042768 + lsls r0, 24 + cmp r0, 0 + beq _08040C28 + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_80414C0 + lsls r0, 24 + cmp r0, 0 + bne _08040C28 + mov r0, r10 + cmp r0, 0 + bne _08040C2C +_08040C28: + adds r0, r5, 0 + b _08040C3C +_08040C2C: + cmp r4, 0 + beq _08040C3A + adds r0, r6, 0 + adds r1, r7, 0 + mov r2, r8 + bl sub_8040C4C +_08040C3A: + mov r0, r9 +_08040C3C: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8040BB0 + + thumb_func_start sub_8040C4C +sub_8040C4C: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + adds r7, r0, 0 + adds r4, r1, 0 + adds r6, r2, 0 + ldrh r5, [r4, 0x2] + bl sub_807E580 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + adds r2, r6, 0 + bl sub_80412E0 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + ldr r6, [r7, 0x70] + ldrh r0, [r4, 0x2] + bl sub_800EC94 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r0, 0x4 + ldrsh r5, [r6, r0] + ldrh r4, [r4, 0x2] + adds r0, r7, 0 + bl sub_807E580 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + movs r2, 0x1 + bl sub_80412E0 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r5, 0 + bl sub_800E710 + adds r2, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r2, r0 + beq _08040CC4 + add r0, sp, 0x8 + adds r1, r7, 0 + adds r1, 0x28 + lsls r2, 24 + lsrs r2, 24 + bl sub_800569C + b _08040CC8 +_08040CC4: + movs r0, 0 + str r0, [sp, 0x8] +_08040CC8: + mov r0, sp + mov r1, r9 + strh r1, [r0] + mov r1, sp + ldrh r0, [r6, 0x4] + strh r0, [r1, 0x2] + ldr r0, [r7, 0xC] + cmp r0, 0 + bge _08040CDC + adds r0, 0xFF +_08040CDC: + asrs r0, 8 + strh r0, [r1, 0x4] + mov r1, sp + ldr r0, [r7, 0x10] + cmp r0, 0 + bge _08040CEA + adds r0, 0xFF +_08040CEA: + asrs r0, 8 + strh r0, [r1, 0x6] + adds r0, r6, 0 + adds r0, 0x46 + ldrb r0, [r0] + str r0, [sp, 0xC] + movs r0, 0 + str r0, [sp, 0x10] + mov r0, sp + bl sub_8041500 + mov r0, r9 + bl sub_800EEC8 + bl sub_800EF64 + movs r0, 0x58 + bl sub_803E46C + mov r0, sp + bl sub_800EA84 + adds r4, r0, 0 + adds r1, r7, 0 + movs r2, 0x5 + bl sub_8042DD4 + ldr r0, _08040D28 + ldrb r5, [r0] + ldr r6, _08040D2C + b _08040D78 + .align 2, 0 +_08040D28: .4byte gUnknown_203B40D +_08040D2C: .4byte 0x00001010 +_08040D30: + ldr r0, _08040D58 + movs r1, 0x1 + strb r1, [r0] + ldr r1, _08040D5C + ldrh r2, [r1] + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, r6 + beq _08040D48 + ldr r3, _08040D60 + adds r0, r2, r3 + strh r0, [r1] +_08040D48: + ldr r1, _08040D64 + ldr r0, [r1] + cmp r0, 0x4 + ble _08040D68 + subs r0, 0x4 + str r0, [r1] + b _08040D6E + .align 2, 0 +_08040D58: .4byte gUnknown_203B40D +_08040D5C: .4byte gUnknown_2026E4E +_08040D60: .4byte 0x00000101 +_08040D64: .4byte gUnknown_202EDC8 +_08040D68: + movs r0, 0 + str r0, [r1] + mov r8, r0 +_08040D6E: + bl sub_803EA10 + movs r0, 0x26 + bl sub_803E46C +_08040D78: + adds r0, r4, 0 + bl sub_800E9A8 + lsls r0, 24 + cmp r0, 0 + beq _08040D8A + mov r0, r8 + cmp r0, 0 + bne _08040D30 +_08040D8A: + ldr r0, _08040D9C + strb r5, [r0] + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08040D9C: .4byte gUnknown_203B40D + thumb_func_end sub_8040C4C + + thumb_func_start sub_8040DA0 +sub_8040DA0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + adds r7, r0, 0 + mov r8, r1 + bl sub_804143C + mov r9, r0 + movs r0, 0 + str r0, [sp, 0x14] + ldr r1, [r7, 0x70] + mov r10, r1 + movs r0, 0x4 + ldrsh r5, [r1, r0] + mov r1, r8 + ldrh r4, [r1, 0x2] + adds r0, r7, 0 + bl sub_807E580 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + mov r2, r9 + bl sub_80412E0 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r5, 0 + bl sub_800EA44 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x18] + mov r0, sp + adds r1, r7, 0 + mov r2, r8 + mov r3, r9 + bl sub_8041038 + mov r0, sp + movs r1, 0x1 + bl sub_800E838 + lsls r0, 24 + cmp r0, 0 + bne _08040E0E + mov r1, r8 + ldrh r0, [r1, 0x2] + cmp r0, 0x52 + bne _08040E24 +_08040E0E: + ldr r0, _08040E1C + ldr r0, [r0] + ldr r1, _08040E20 + adds r0, r1 + ldr r6, [r0] + b _08040E26 + .align 2, 0 +_08040E1C: .4byte gUnknown_203B418 +_08040E20: .4byte 0x000181f8 +_08040E24: + adds r6, r7, 0 +_08040E26: + adds r0, r6, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08040E34 + adds r6, r7, 0 +_08040E34: + mov r1, sp + ldr r0, [r6, 0xC] + cmp r0, 0 + bge _08040E3E + adds r0, 0xFF +_08040E3E: + asrs r0, 8 + strh r0, [r1, 0x4] + mov r1, sp + ldr r0, [r6, 0x10] + cmp r0, 0 + bge _08040E4C + adds r0, 0xFF +_08040E4C: + asrs r0, 8 + strh r0, [r1, 0x6] + adds r0, r6, 0 + bl sub_8042768 + lsls r0, 24 + cmp r0, 0 + bne _08040E5E + b _08041026 +_08040E5E: + adds r0, r7, 0 + mov r1, r8 + bl sub_80414C0 + lsls r0, 24 + cmp r0, 0 + beq _08040E6E + b _08041026 +_08040E6E: + mov r0, r8 + ldrh r1, [r0, 0x2] + movs r0, 0x94 + lsls r0, 1 + cmp r1, r0 + bne _08040ED0 + movs r0, 0x7 + bl sub_8084100 + ldr r1, _08040EB8 + str r0, [r1] + ldr r1, _08040EBC + ldr r2, [r1] + ldr r1, _08040EC0 + adds r4, r2, r1 + subs r1, 0x4 + adds r2, r1 + ldr r3, _08040EC4 + lsls r1, r0, 2 + adds r1, r3 + ldr r1, [r1] + str r1, [r2] + str r1, [r4] + ldr r1, _08040EC8 + adds r0, 0x4 + str r0, [r1] + ldr r0, _08040ECC + ldr r1, [r0] + adds r0, r6, 0 + bl sub_80522A8 + movs r1, 0xD2 + lsls r1, 1 + adds r0, r6, 0 + bl sub_80421C0 + b _08040EF0 + .align 2, 0 +_08040EB8: .4byte gUnknown_202F224 +_08040EBC: .4byte gUnknown_203B418 +_08040EC0: .4byte 0x00018204 +_08040EC4: .4byte gUnknown_8106A8C +_08040EC8: .4byte gUnknown_202DE30 +_08040ECC: .4byte gUnknown_8100224 +_08040ED0: + cmp r1, 0x76 + bne _08040EF0 + ldr r0, _08040F70 + ldr r0, [r0] + ldr r1, _08040F74 + adds r2, r0, r1 + subs r1, 0x4 + adds r0, r1 + movs r1, 0xC + str r1, [r0] + str r1, [r2] + movs r1, 0xD2 + lsls r1, 1 + adds r0, r6, 0 + bl sub_80421C0 +_08040EF0: + mov r0, r10 + movs r1, 0x4 + ldrsh r5, [r0, r1] + mov r0, r8 + ldrh r4, [r0, 0x2] + adds r0, r7, 0 + bl sub_807E580 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + mov r2, r9 + bl sub_80412E0 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r5, 0 + bl sub_800E790 + adds r1, r0, 0 + ldr r0, _08040F78 + cmp r1, r0 + beq _08040F2A + lsls r0, r1, 16 + lsrs r0, 16 + bl sub_8083E38 +_08040F2A: + ldr r1, [sp, 0x18] + cmp r1, 0x63 + bne _08040F7C + adds r0, r6, 0 + bl sub_8042768 + lsls r0, 24 + cmp r0, 0 + beq _08041026 + mov r0, r10 + adds r0, 0x46 + ldrb r4, [r0] + mov r0, sp + adds r1, r7, 0 + mov r2, r8 + mov r3, r9 + bl sub_8041108 + movs r6, 0x7 + movs r5, 0x7 +_08040F52: + subs r4, 0x1 + ands r4, r6 + adds r0, r7, 0 + movs r1, 0 + adds r2, r4, 0 + bl sub_806CDD4 + movs r0, 0x2 + movs r1, 0x15 + bl sub_803E708 + subs r5, 0x1 + cmp r5, 0 + bge _08040F52 + b _08041026 + .align 2, 0 +_08040F70: .4byte gUnknown_203B418 +_08040F74: .4byte 0x00018204 +_08040F78: .4byte 0x000003e5 +_08040F7C: + ldr r0, [sp, 0x18] + cmp r0, 0x62 + bne _08040FC2 + adds r0, r6, 0 + bl sub_8042768 + lsls r0, 24 + cmp r0, 0 + beq _08041026 + mov r0, r10 + adds r0, 0x46 + ldrb r4, [r0] + mov r0, sp + adds r1, r7, 0 + mov r2, r8 + mov r3, r9 + bl sub_8041108 + movs r6, 0x7 + movs r5, 0x8 +_08040FA4: + ands r4, r6 + adds r0, r7, 0 + movs r1, 0 + adds r2, r4, 0 + bl sub_806CDD4 + movs r0, 0x2 + movs r1, 0x15 + bl sub_803E708 + adds r4, 0x1 + subs r5, 0x1 + cmp r5, 0 + bge _08040FA4 + b _08041026 +_08040FC2: + mov r0, r10 + adds r0, 0x46 + ldrb r2, [r0] + adds r0, r7, 0 + ldr r1, [sp, 0x18] + bl sub_806CDD4 + adds r0, r7, 0 + adds r0, 0x21 + movs r1, 0 + strb r1, [r0] + movs r5, 0 + adds r6, r0, 0 + b _08040FE6 +_08040FDE: + ldrb r0, [r6] + cmp r0, 0 + bne _08041022 + adds r5, 0x1 +_08040FE6: + cmp r5, 0x77 + bgt _08041022 + movs r0, 0x59 + bl sub_803E46C + ldr r4, [r7, 0x40] + ldr r1, [sp, 0x18] + cmp r1, 0x9 + bne _08040FFC + movs r0, 0x2 + orrs r4, r0 +_08040FFC: + movs r0, 0x2 + ands r0, r4 + cmp r0, 0 + beq _0804101A + ldr r0, [sp, 0x14] + cmp r0, 0 + bne _0804101A + mov r0, sp + adds r1, r7, 0 + mov r2, r8 + mov r3, r9 + bl sub_8041108 + movs r1, 0x1 + str r1, [sp, 0x14] +_0804101A: + movs r0, 0x1 + ands r4, r0 + cmp r4, 0 + beq _08040FDE +_08041022: + movs r0, 0 + strb r0, [r6] +_08041026: + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8040DA0 + + thumb_func_start sub_8041038 +sub_8041038: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r6, r0, 0 + adds r7, r1, 0 + mov r8, r2 + mov r10, r3 + ldr r0, [r7, 0x70] + mov r9, r0 + ldrh r4, [r2, 0x2] + adds r0, r7, 0 + bl sub_807E580 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + mov r2, r10 + bl sub_80412E0 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp] + bl sub_800ECB8 + movs r1, 0x2 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _080410F4 + mov r0, r9 + movs r1, 0x4 + ldrsh r5, [r0, r1] + mov r0, r8 + ldrh r4, [r0, 0x2] + adds r0, r7, 0 + bl sub_807E580 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + mov r2, r10 + bl sub_80412E0 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r5, 0 + bl sub_800E710 + adds r2, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r2, r0 + beq _080410BE + adds r0, r6, 0 + adds r0, 0x8 + adds r1, r7, 0 + adds r1, 0x28 + lsls r2, 24 + lsrs r2, 24 + bl sub_800569C + b _080410C2 +_080410BE: + movs r0, 0 + str r0, [r6, 0x8] +_080410C2: + mov r1, sp + ldrh r1, [r1] + strh r1, [r6] + mov r1, r9 + ldrh r0, [r1, 0x4] + strh r0, [r6, 0x2] + ldr r0, [r7, 0xC] + cmp r0, 0 + bge _080410D6 + adds r0, 0xFF +_080410D6: + asrs r0, 8 + strh r0, [r6, 0x4] + ldr r0, [r7, 0x10] + cmp r0, 0 + bge _080410E2 + adds r0, 0xFF +_080410E2: + asrs r0, 8 + strh r0, [r6, 0x6] + mov r0, r9 + adds r0, 0x46 + ldrb r0, [r0] + str r0, [r6, 0xC] + movs r0, 0 + str r0, [r6, 0x10] + b _080410F6 +_080410F4: + strh r0, [r6] +_080410F6: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8041038 + + thumb_func_start sub_8041108 +sub_8041108: + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + adds r5, r3, 0 + ldrh r4, [r2, 0x2] + adds r0, r7, 0 + bl sub_807E580 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + adds r2, r5, 0 + bl sub_80412E0 + lsls r0, 16 + lsrs r4, r0, 16 + adds r0, r4, 0 + bl sub_800ECB8 + movs r2, 0x2 + ldrsh r1, [r0, r2] + ldrh r0, [r6] + cmp r0, 0 + beq _08041162 + cmp r1, 0 + beq _08041162 + adds r0, r6, 0 + bl sub_8041500 + adds r0, r4, 0 + bl sub_800EEF8 + bl sub_800EF64 + movs r0, 0x5A + bl sub_803E46C + adds r0, r6, 0 + bl sub_800E52C + adds r1, r7, 0 + movs r2, 0x1 + bl sub_8042DD4 +_08041162: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8041108 + + thumb_func_start sub_8041168 +sub_8041168: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + mov r8, r0 + adds r6, r1, 0 + adds r7, r2, 0 + mov r9, r3 + adds r1, r7, 0 + bl sub_804143C + adds r5, r0, 0 + cmp r5, 0 + beq _0804118A + movs r5, 0x1 +_0804118A: + ldrh r4, [r7, 0x2] + mov r0, r8 + bl sub_807E580 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + adds r2, r5, 0 + bl sub_80412E0 + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + bl sub_800ECB8 + movs r1, 0x4 + ldrsh r5, [r0, r1] + movs r2, 0 + str r2, [sp, 0x14] + adds r0, r6, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080411CA + ldr r0, [r6, 0x70] + str r0, [sp, 0x14] + adds r0, r6, 0 + bl sub_8042768 + b _080411D0 +_080411CA: + mov r0, r9 + bl sub_803F428 +_080411D0: + lsls r0, 24 + cmp r0, 0 + beq _080412CE + mov r0, r8 + adds r1, r7, 0 + bl sub_80414C0 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _080412CE + cmp r5, 0 + beq _080412CE + adds r0, r5, 0 + bl sub_800ECA4 + ldr r5, [r0, 0x1C] + movs r0, 0x1 + negs r0, r0 + cmp r5, r0 + beq _08041216 + adds r0, r6, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08041216 + add r0, sp, 0x8 + adds r1, r6, 0 + adds r1, 0x28 + lsls r2, r5, 24 + lsrs r2, 24 + bl sub_800569C + b _08041218 +_08041216: + str r4, [sp, 0x8] +_08041218: + mov r0, sp + mov r1, r10 + strh r1, [r0] + ldr r2, [sp, 0x14] + cmp r2, 0 + beq _08041248 + mov r1, sp + ldrh r0, [r2, 0x4] + strh r0, [r1, 0x2] + ldr r0, [r6, 0xC] + cmp r0, 0 + bge _08041232 + adds r0, 0xFF +_08041232: + asrs r0, 8 + strh r0, [r1, 0x4] + mov r1, sp + ldr r0, [r6, 0x10] + cmp r0, 0 + bge _08041240 + adds r0, 0xFF +_08041240: + asrs r0, 8 + strh r0, [r1, 0x6] + movs r0, 0 + b _0804128C +_08041248: + mov r1, sp + movs r0, 0x1 + strh r0, [r1, 0x2] + mov r0, r9 + movs r2, 0 + ldrsh r1, [r0, r2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 11 + mov r1, sp + movs r2, 0xC0 + lsls r2, 4 + adds r0, r2 + cmp r0, 0 + bge _08041268 + adds r0, 0xFF +_08041268: + asrs r0, 8 + strh r0, [r1, 0x4] + mov r0, r9 + movs r2, 0x2 + ldrsh r1, [r0, r2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 11 + mov r1, sp + movs r2, 0x80 + lsls r2, 5 + adds r0, r2 + cmp r0, 0 + bge _08041286 + adds r0, 0xFF +_08041286: + asrs r0, 8 + strh r0, [r1, 0x6] + ldr r0, [sp, 0x14] +_0804128C: + str r0, [sp, 0xC] + movs r0, 0 + str r0, [sp, 0x10] + mov r0, sp + bl sub_8041500 + mov r0, r10 + bl sub_800EEE0 + bl sub_800EF64 + mov r0, sp + bl sub_800EBC8 + adds r4, r0, 0 + movs r0, 0x5B + bl sub_803E46C + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0x6 + bl sub_8042DD4 + b _080412C2 +_080412BC: + movs r0, 0x28 + bl sub_803E46C +_080412C2: + adds r0, r4, 0 + bl sub_800E9A8 + lsls r0, 24 + cmp r0, 0 + bne _080412BC +_080412CE: + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8041168 + + thumb_func_start sub_80412E0 +sub_80412E0: + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 24 + lsrs r0, r1, 24 + adds r3, r4, 0 + cmp r3, 0x1F + bne _08041344 + cmp r0, 0x7 + bls _080412F6 + b _080413F6 +_080412F6: + lsls r0, 2 + ldr r1, _08041300 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08041300: .4byte _08041304 + .align 2, 0 +_08041304: + .4byte _080413F4 + .4byte _08041324 + .4byte _0804132A + .4byte _080413F4 + .4byte _08041334 + .4byte _0804133A + .4byte _080413F4 + .4byte _0804133A +_08041324: + movs r3, 0xCF + lsls r3, 1 + b _080413F6 +_0804132A: + ldr r3, _08041330 + b _080413F6 + .align 2, 0 +_08041330: .4byte 0x000001a1 +_08041334: + movs r3, 0xD0 + lsls r3, 1 + b _080413F6 +_0804133A: + ldr r3, _08041340 + b _080413F6 + .align 2, 0 +_08041340: .4byte 0x0000019f +_08041344: + cmp r2, 0 + beq _080413F6 + cmp r3, 0x97 + beq _080413B4 + cmp r3, 0x97 + bgt _0804136C + cmp r3, 0x3C + beq _0804139C + cmp r3, 0x3C + bgt _08041362 + cmp r3, 0x8 + beq _08041396 + cmp r3, 0x19 + beq _080413E4 + b _080413F4 +_08041362: + cmp r3, 0x4B + beq _080413A4 + cmp r3, 0x64 + beq _080413AA + b _080413F4 +_0804136C: + cmp r3, 0xCD + beq _080413CA + cmp r3, 0xCD + bgt _0804137E + cmp r3, 0x99 + beq _080413BA + cmp r3, 0x9C + beq _080413C4 + b _080413F4 +_0804137E: + cmp r3, 0xED + beq _080413DA + cmp r3, 0xED + bgt _0804138C + cmp r3, 0xE3 + beq _080413EA + b _080413F4 +_0804138C: + movs r0, 0xAE + lsls r0, 1 + cmp r3, r0 + beq _080413D4 + b _080413F4 +_08041396: + movs r3, 0xD1 + lsls r3, 1 + b _080413F6 +_0804139C: + ldr r3, _080413A0 + b _080413F6 + .align 2, 0 +_080413A0: .4byte 0x000001a3 +_080413A4: + movs r3, 0xD2 + lsls r3, 1 + b _080413F6 +_080413AA: + ldr r3, _080413B0 + b _080413F6 + .align 2, 0 +_080413B0: .4byte 0x000001a5 +_080413B4: + movs r3, 0xD3 + lsls r3, 1 + b _080413F6 +_080413BA: + ldr r3, _080413C0 + b _080413F6 + .align 2, 0 +_080413C0: .4byte 0x000001a7 +_080413C4: + movs r3, 0xD4 + lsls r3, 1 + b _080413F6 +_080413CA: + ldr r3, _080413D0 + b _080413F6 + .align 2, 0 +_080413D0: .4byte 0x000001a9 +_080413D4: + movs r3, 0xD5 + lsls r3, 1 + b _080413F6 +_080413DA: + ldr r3, _080413E0 + b _080413F6 + .align 2, 0 +_080413E0: .4byte 0x000001ab +_080413E4: + movs r3, 0xD6 + lsls r3, 1 + b _080413F6 +_080413EA: + ldr r3, _080413F0 + b _080413F6 + .align 2, 0 +_080413F0: .4byte 0x000001ad +_080413F4: + adds r3, r4, 0 +_080413F6: + adds r0, r3, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80412E0 + + thumb_func_start sub_8041400 +sub_8041400: + push {lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 24 + lsrs r1, 24 + bl sub_80412E0 + lsls r0, 16 + lsrs r0, 16 + bl sub_800ED20 + pop {r1} + bx r1 + thumb_func_end sub_8041400 + + thumb_func_start sub_804141C +sub_804141C: + push {lr} + lsls r0, 16 + lsrs r0, 16 + lsls r1, 24 + lsrs r1, 24 + bl sub_80412E0 + lsls r0, 16 + lsrs r0, 16 + bl sub_800EC84 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_804141C + + thumb_func_start sub_804143C +sub_804143C: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrh r0, [r5, 0x2] + cmp r0, 0xED + bne _08041476 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080414A4 + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0x1 + bne _080414A4 + ldr r1, [r4, 0x70] + adds r0, r1, 0 + adds r0, 0x5C + ldrb r0, [r0] + cmp r0, 0xE + beq _080414A0 + adds r0, r1, 0 + adds r0, 0x5D + ldrb r0, [r0] + cmp r0, 0xE + beq _080414A0 + b _0804148A +_08041476: + cmp r0, 0x19 + beq _0804147E + cmp r0, 0xE3 + bne _0804148E +_0804147E: + adds r0, r4, 0 + bl sub_8070B28 + lsls r0, 24 + cmp r0, 0 + beq _080414A0 +_0804148A: + movs r0, 0 + b _080414B8 +_0804148E: + cmp r0, 0x97 + bne _080414A4 + adds r0, r4, 0 + bl sub_807E580 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080414A4 +_080414A0: + movs r0, 0x1 + b _080414B8 +_080414A4: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80570AC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 +_080414B8: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_804143C + + thumb_func_start sub_80414C0 +sub_80414C0: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldrh r0, [r4, 0x2] + cmp r0, 0x9C + bne _080414DC + adds r0, r5, 0 + bl sub_8045128 + bl sub_804AF20 + lsls r0, 24 + cmp r0, 0 + bne _080414F2 +_080414DC: + ldrh r0, [r4, 0x2] + cmp r0, 0x8 + bne _080414F6 + adds r0, r5, 0 + bl sub_8045128 + ldrh r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + beq _080414F6 +_080414F2: + movs r0, 0x1 + b _080414F8 +_080414F6: + movs r0, 0 +_080414F8: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80414C0 + + thumb_func_start sub_8041500 +sub_8041500: + push {lr} + bl sub_800E7D0 + lsls r0, 24 + cmp r0, 0 + beq _08041518 + movs r0, 0x5C + bl sub_803E46C + movs r0, 0x5D + bl sub_8052740 +_08041518: + pop {r0} + bx r0 + thumb_func_end sub_8041500 + + thumb_func_start sub_804151C +sub_804151C: + push {r4-r6,lr} + sub sp, 0x8 + adds r6, r0, 0 + adds r5, r1, 0 + lsls r4, r2, 24 + lsrs r4, 24 + adds r0, r5, 0 + bl sub_800DC9C + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + movs r0, 0x2 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_8041550 + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_804151C + + thumb_func_start sub_8041550 +sub_8041550: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x30 + adds r7, r0, 0 + mov r10, r1 + ldr r0, [sp, 0x54] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x2C] + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r7, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0804159C + ldr r0, [r7, 0x70] + mov r8, r0 + adds r0, r7, 0 + bl sub_8042768 + lsls r0, 24 + cmp r0, 0 + beq _0804159C + cmp r6, 0 + bne _080415A2 + mov r0, r8 + adds r0, 0xFF + ldrb r0, [r0] + cmp r0, 0x2 + bne _080415A2 +_0804159C: + movs r0, 0x1 + negs r0, r0 + b _08041692 +_080415A2: + ldr r1, [sp, 0x50] + cmp r1, 0 + beq _080415B4 + movs r0, 0 + cmp r1, 0x2 + bne _080415B0 + movs r0, 0x1 +_080415B0: + bl sub_804178C +_080415B4: + add r6, sp, 0x28 + adds r1, r7, 0 + adds r1, 0x28 + adds r0, r6, 0 + mov r2, r9 + bl sub_800569C + movs r2, 0 + ldrsh r0, [r6, r2] + cmp r0, 0x63 + beq _080415F2 + ldrh r0, [r6, 0x2] + cmp r0, 0x63 + beq _080415F2 + movs r1, 0 + ldrsh r0, [r6, r1] + lsls r0, 8 + ldr r1, [r7, 0xC] + adds r4, r1, r0 + movs r2, 0x2 + ldrsh r0, [r6, r2] + lsls r0, 8 + ldr r2, [r7, 0x10] + adds r0, r2, r0 + movs r1, 0xBA + lsls r1, 1 + add r1, r8 + ldr r1, [r1] + subs r5, r0, r1 + adds r1, r2, 0 + b _08041600 +_080415F2: + ldr r4, [r7, 0xC] + movs r0, 0xBA + lsls r0, 1 + add r0, r8 + ldr r1, [r7, 0x10] + ldr r0, [r0] + subs r5, r1, r0 +_08041600: + cmp r1, 0 + bge _08041606 + adds r1, 0xFF +_08041606: + asrs r1, 8 + ldr r0, _0804166C + ldr r0, [r0] + ldr r2, _08041670 + adds r0, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + subs r1, r0 + lsrs r0, r1, 31 + adds r0, r1, r0 + asrs r1, r0, 1 + adds r1, 0x1 + mov r0, r10 + str r0, [sp] + movs r3, 0 + str r3, [sp, 0x4] + movs r6, 0x1 + negs r6, r6 + str r6, [sp, 0x8] + mov r2, sp + adds r0, r4, 0 + cmp r4, 0 + bge _08041636 + adds r0, 0xFF +_08041636: + asrs r0, 8 + strh r0, [r2, 0xC] + mov r2, sp + adds r0, r5, 0 + cmp r0, 0 + bge _08041644 + adds r0, 0xFF +_08041644: + asrs r0, 8 + strh r0, [r2, 0xE] + str r6, [sp, 0x14] + mov r0, sp + strh r3, [r0, 0x10] + strh r3, [r0, 0x12] + str r1, [sp, 0x18] + add r0, sp, 0x1C + bl sub_8004E8C + mov r0, sp + movs r1, 0 + bl sub_8041764 + adds r4, r0, 0 + ldr r1, [sp, 0x2C] + cmp r1, 0 + beq _08041690 + movs r5, 0 + b _0804167C + .align 2, 0 +_0804166C: .4byte gUnknown_203B418 +_08041670: .4byte 0x000181f2 +_08041674: + movs r0, 0x42 + bl sub_803E46C + adds r5, 0x1 +_0804167C: + cmp r5, 0x63 + bgt _0804168C + adds r0, r4, 0 + bl sub_800E9A8 + lsls r0, 24 + cmp r0, 0 + bne _08041674 +_0804168C: + movs r4, 0x1 + negs r4, r4 +_08041690: + adds r0, r4, 0 +_08041692: + add sp, 0x30 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8041550 + + thumb_func_start sub_80416A4 +sub_80416A4: + push {r4,lr} + sub sp, 0x8 + lsls r2, 24 + lsrs r2, 24 + movs r3, 0 + ldrsh r4, [r0, r3] + lsls r3, r4, 1 + adds r3, r4 + lsls r3, 11 + movs r4, 0xC0 + lsls r4, 4 + adds r3, r4 + str r3, [sp] + movs r4, 0x2 + ldrsh r3, [r0, r4] + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 11 + movs r3, 0x80 + lsls r3, 5 + adds r0, r3 + str r0, [sp, 0x4] + mov r0, sp + bl sub_80416E0 + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80416A4 + + thumb_func_start sub_80416E0 +sub_80416E0: + push {r4,r5,lr} + sub sp, 0x28 + adds r3, r0, 0 + lsls r2, 24 + lsrs r5, r2, 24 + str r1, [sp] + movs r2, 0 + str r2, [sp, 0x4] + movs r4, 0x1 + negs r4, r4 + str r4, [sp, 0x8] + mov r1, sp + ldr r0, [r3] + cmp r0, 0 + bge _08041700 + adds r0, 0xFF +_08041700: + asrs r0, 8 + strh r0, [r1, 0xC] + mov r1, sp + ldr r0, [r3, 0x4] + cmp r0, 0 + bge _0804170E + adds r0, 0xFF +_0804170E: + asrs r0, 8 + strh r0, [r1, 0xE] + str r4, [sp, 0x14] + mov r0, sp + strh r2, [r0, 0x10] + strh r2, [r0, 0x12] + ldr r0, _08041738 + str r0, [sp, 0x18] + add r0, sp, 0x1C + bl sub_8004E8C + mov r0, sp + movs r1, 0 + bl sub_8041764 + adds r4, r0, 0 + cmp r5, 0 + beq _08041758 + movs r5, 0 + b _08041744 + .align 2, 0 +_08041738: .4byte 0x0000ffff +_0804173C: + movs r0, 0x42 + bl sub_803E46C + adds r5, 0x1 +_08041744: + cmp r5, 0x63 + bgt _08041754 + adds r0, r4, 0 + bl sub_800E9A8 + lsls r0, 24 + cmp r0, 0 + bne _0804173C +_08041754: + movs r4, 0x1 + negs r4, r4 +_08041758: + adds r0, r4, 0 + add sp, 0x28 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80416E0 + + thumb_func_start sub_8041764 +sub_8041764: + push {r4,r5,lr} + adds r5, r0, 0 + lsls r4, r1, 24 + lsrs r4, 24 + ldr r0, [r5] + bl sub_800EE5C + bl sub_800EF64 + cmp r4, 0 + beq _08041780 + movs r0, 0x42 + bl sub_803E46C +_08041780: + adds r0, r5, 0 + bl sub_800E890 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8041764 + + thumb_func_start sub_804178C +sub_804178C: + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r0, _080417B0 + ldr r0, [r0] + ldr r1, _080417B4 + adds r0, r1 + str r4, [r0] + adds r0, r5, 0 + bl sub_800E9FC + lsls r0, 24 + cmp r0, 0 + beq _080417E0 + ldr r6, _080417B8 + b _080417C4 + .align 2, 0 +_080417B0: .4byte gUnknown_203B418 +_080417B4: .4byte 0x00018204 +_080417B8: .4byte 0x000003e7 +_080417BC: + movs r0, 0x4A + bl sub_803E46C + adds r4, 0x1 +_080417C4: + cmp r4, r6 + bgt _080417D4 + adds r0, r5, 0 + bl sub_800E9FC + lsls r0, 24 + cmp r0, 0 + bne _080417BC +_080417D4: + movs r0, 0x4A + bl sub_803E46C + movs r0, 0x4A + bl sub_803E46C +_080417E0: + movs r0, 0xFA + lsls r0, 2 + cmp r4, r0 + beq _080417EC + cmp r5, 0 + beq _080417F0 +_080417EC: + bl sub_800DBBC +_080417F0: + ldr r2, _08041824 + ldr r0, [r2] + cmp r0, 0x1E + bgt _08041860 + ldr r1, _08041828 + ldrb r7, [r1] + movs r0, 0x1 + strb r0, [r1] + movs r4, 0 + adds r5, r2, 0 + ldr r6, _0804182C +_08041806: + ldr r0, [r5] + cmp r0, 0x1E + bgt _08041838 + adds r0, 0x4 + str r0, [r5] + ldr r1, _08041830 + ldrh r2, [r1] + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, r6 + beq _0804183C + ldr r3, _08041834 + adds r0, r2, r3 + strh r0, [r1] + b _0804183C + .align 2, 0 +_08041824: .4byte gUnknown_202EDC8 +_08041828: .4byte gUnknown_203B40D +_0804182C: .4byte 0x00000808 +_08041830: .4byte gUnknown_2026E4E +_08041834: .4byte 0xfffffeff +_08041838: + movs r0, 0x1F + str r0, [r5] +_0804183C: + bl sub_803EA10 + movs r0, 0x4A + bl sub_803E46C + ldr r0, [r5] + cmp r0, 0x1F + beq _08041854 + adds r4, 0x1 + ldr r0, _0804186C + cmp r4, r0 + ble _08041806 +_08041854: + ldr r0, _08041870 + ldr r2, _08041874 + adds r1, r2, 0 + strh r1, [r0] + ldr r0, _08041878 + strb r7, [r0] +_08041860: + bl sub_8042E98 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804186C: .4byte 0x000003e7 +_08041870: .4byte gUnknown_2026E4E +_08041874: .4byte 0x00000808 +_08041878: .4byte gUnknown_203B40D + thumb_func_end sub_804178C + + thumb_func_start sub_804187C +sub_804187C: + ldr r0, [r0, 0x70] + movs r1, 0x80 + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + bx lr + thumb_func_end sub_804187C + + thumb_func_start sub_8041888 +sub_8041888: + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 +_08041890: + ldr r0, _080418CC + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _080418D0 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080418C0 + ldr r1, [r4, 0x70] + cmp r6, 0 + beq _080418BA + movs r0, 0xA6 + lsls r0, 1 + adds r1, r0 + movs r0, 0x1 + strb r0, [r1] +_080418BA: + adds r0, r4, 0 + bl sub_80418D4 +_080418C0: + adds r5, 0x1 + cmp r5, 0x13 + ble _08041890 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080418CC: .4byte gUnknown_203B418 +_080418D0: .4byte 0x000135cc + thumb_func_end sub_8041888 + + thumb_func_start sub_80418D4 +sub_80418D4: + push {r4,lr} + adds r4, r0, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _080418E4 + b _08041A8C +_080418E4: + ldr r2, [r4, 0x70] + movs r3, 0 + movs r1, 0x1 + movs r4, 0x2 + ldrsh r0, [r2, r4] + cmp r0, 0xB9 + bne _08041902 + adds r0, r2, 0 + adds r0, 0xA9 + ldrb r0, [r0] + movs r1, 0x7F + eors r0, r1 + negs r1, r0 + orrs r1, r0 + lsrs r1, 31 +_08041902: + cmp r1, 0 + beq _08041914 + ldr r1, _08041A94 + adds r0, r2, 0 + adds r0, 0xA8 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r3, [r0] +_08041914: + ldr r1, _08041A98 + adds r0, r2, 0 + adds r0, 0xAC + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + orrs r3, r0 + ldr r1, _08041A9C + adds r0, r2, 0 + adds r0, 0xB0 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + orrs r3, r0 + ldr r1, _08041AA0 + adds r0, r2, 0 + adds r0, 0xBC + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + orrs r3, r0 + ldr r1, _08041AA4 + adds r0, r2, 0 + adds r0, 0xC0 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + orrs r3, r0 + ldr r1, _08041AA8 + adds r0, r2, 0 + adds r0, 0xC4 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + orrs r3, r0 + ldr r1, _08041AAC + adds r0, r2, 0 + adds r0, 0xC8 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + orrs r3, r0 + ldr r1, _08041AB0 + adds r0, r2, 0 + adds r0, 0xD0 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + orrs r3, r0 + ldr r1, _08041AB4 + adds r0, r2, 0 + adds r0, 0xDC + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + orrs r3, r0 + ldr r1, _08041AB8 + adds r0, r2, 0 + adds r0, 0xE0 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + orrs r3, r0 + ldr r1, _08041ABC + adds r0, r2, 0 + adds r0, 0xE4 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + orrs r3, r0 + ldr r1, _08041AC0 + adds r0, r2, 0 + adds r0, 0xE8 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + orrs r3, r0 + ldr r1, _08041AC4 + adds r0, r2, 0 + adds r0, 0xEC + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + orrs r3, r0 + adds r0, r2, 0 + adds r0, 0xF4 + ldrb r0, [r0] + cmp r0, 0 + beq _080419E4 + movs r0, 0x80 + lsls r0, 17 + orrs r3, r0 +_080419E4: + adds r0, r2, 0 + adds r0, 0xF5 + ldrb r0, [r0] + cmp r0, 0 + beq _080419F4 + movs r0, 0x80 + lsls r0, 18 + orrs r3, r0 +_080419F4: + ldrb r0, [r2, 0x6] + cmp r0, 0 + bne _08041A14 + movs r0, 0x10 + ldrsh r1, [r2, r0] + cmp r1, 0 + bge _08041A04 + adds r1, 0x3 +_08041A04: + asrs r1, 2 + movs r4, 0xE + ldrsh r0, [r2, r4] + cmp r1, r0 + ble _08041A14 + movs r0, 0x80 + lsls r0, 6 + orrs r3, r0 +_08041A14: + ldr r0, _08041AC8 + ldr r0, [r0] + ldr r1, _08041ACC + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08041A36 + adds r0, r2, 0 + adds r0, 0x60 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08041A36 + movs r0, 0x80 + lsls r0, 6 + orrs r3, r0 +_08041A36: + ldr r0, [r2, 0x2C] + cmp r0, 0xFF + ble _08041A7E + ldr r0, [r2, 0x30] + cmp r0, 0xFF + ble _08041A7E + ldr r0, [r2, 0x34] + cmp r0, 0xFF + ble _08041A7E + ldr r0, [r2, 0x38] + cmp r0, 0xFF + ble _08041A7E + movs r4, 0x1C + ldrsh r0, [r2, r4] + cmp r0, 0x9 + ble _08041A7E + movs r1, 0x1E + ldrsh r0, [r2, r1] + cmp r0, 0x9 + ble _08041A7E + movs r4, 0x20 + ldrsh r0, [r2, r4] + cmp r0, 0x9 + ble _08041A7E + movs r1, 0x22 + ldrsh r0, [r2, r1] + cmp r0, 0x9 + ble _08041A7E + movs r4, 0x24 + ldrsh r0, [r2, r4] + cmp r0, 0x9 + ble _08041A7E + movs r1, 0x26 + ldrsh r0, [r2, r1] + cmp r0, 0x9 + bgt _08041A84 +_08041A7E: + movs r0, 0x80 + lsls r0, 20 + orrs r3, r0 +_08041A84: + movs r4, 0x80 + lsls r4, 2 + adds r0, r2, r4 + str r3, [r0] +_08041A8C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08041A94: .4byte gUnknown_80F669C +_08041A98: .4byte gUnknown_80F66B4 +_08041A9C: .4byte gUnknown_80F66C8 +_08041AA0: .4byte gUnknown_80F66E8 +_08041AA4: .4byte gUnknown_80F6708 +_08041AA8: .4byte gUnknown_80F673C +_08041AAC: .4byte gUnknown_80F6778 +_08041AB0: .4byte gUnknown_80F6788 +_08041AB4: .4byte gUnknown_80F6794 +_08041AB8: .4byte gUnknown_80F67A8 +_08041ABC: .4byte gUnknown_80F67B4 +_08041AC0: .4byte gUnknown_80F67C4 +_08041AC4: .4byte gUnknown_80F67D4 +_08041AC8: .4byte gUnknown_203B418 +_08041ACC: .4byte 0x00000676 + thumb_func_end sub_80418D4 + + thumb_func_start sub_8041AD0 +sub_8041AD0: + push {lr} + movs r1, 0xA2 + lsls r1, 1 + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_8041AD0 + + thumb_func_start sub_8041AE0 +sub_8041AE0: + push {lr} + ldr r1, _08041AF0 + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + .align 2, 0 +_08041AF0: .4byte 0x00000143 + thumb_func_end sub_8041AE0 + + thumb_func_start sub_8041AF4 +sub_8041AF4: + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x25 + movs r2, 0x1 + bl sub_804151C + ldr r1, _08041B10 + adds r0, r4, 0 + bl sub_80421C0 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08041B10: .4byte 0x00000197 + thumb_func_end sub_8041AF4 + + thumb_func_start nullsub_57 +nullsub_57: + bx lr + thumb_func_end nullsub_57 + + thumb_func_start sub_8041B18 +sub_8041B18: + push {lr} + ldr r1, _08041B28 + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + .align 2, 0 +_08041B28: .4byte 0x00000141 + thumb_func_end sub_8041B18 + + thumb_func_start nullsub_58 +nullsub_58: + bx lr + thumb_func_end nullsub_58 + + thumb_func_start nullsub_59 +nullsub_59: + bx lr + thumb_func_end nullsub_59 + + thumb_func_start sub_8041B34 +sub_8041B34: + push {lr} + movs r1, 0x7 + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_8041B34 + + thumb_func_start nullsub_60 +nullsub_60: + bx lr + thumb_func_end nullsub_60 + + thumb_func_start sub_8041B48 +sub_8041B48: + push {lr} + movs r1, 0x4 + movs r2, 0 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_8041B48 + + thumb_func_start nullsub_61 +nullsub_61: + bx lr + thumb_func_end nullsub_61 + + thumb_func_start sub_8041B5C +sub_8041B5C: + push {lr} + ldr r1, _08041B6C + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + .align 2, 0 +_08041B6C: .4byte 0x00000171 + thumb_func_end sub_8041B5C + + thumb_func_start nullsub_62 +nullsub_62: + bx lr + thumb_func_end nullsub_62 + + thumb_func_start sub_8041B74 +sub_8041B74: + push {lr} + ldr r1, _08041B84 + movs r2, 0 + bl sub_804151C + pop {r0} + bx r0 + .align 2, 0 +_08041B84: .4byte 0x00000171 + thumb_func_end sub_8041B74 + + thumb_func_start nullsub_63 +nullsub_63: + bx lr + thumb_func_end nullsub_63 + + thumb_func_start nullsub_64 +nullsub_64: + bx lr + thumb_func_end nullsub_64 + + thumb_func_start sub_8041B90 +sub_8041B90: + push {lr} + movs r1, 0xD6 + lsls r1, 1 + movs r2, 0 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_8041B90 + + thumb_func_start nullsub_65 +nullsub_65: + bx lr + thumb_func_end nullsub_65 + + thumb_func_start nullsub_66 +nullsub_66: + bx lr + thumb_func_end nullsub_66 + + thumb_func_start sub_8041BA8 +sub_8041BA8: + push {lr} + movs r1, 0x4 + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_8041BA8 + + thumb_func_start nullsub_67 +nullsub_67: + bx lr + thumb_func_end nullsub_67 + + thumb_func_start sub_8041BBC +sub_8041BBC: + push {lr} + movs r1, 0xD4 + lsls r1, 1 + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_8041BBC + + thumb_func_start nullsub_68 +nullsub_68: + bx lr + thumb_func_end nullsub_68 + + thumb_func_start sub_8041BD0 +sub_8041BD0: + push {lr} + lsls r1, 24 + cmp r1, 0 + beq _08041BDE + ldr r1, _08041BE4 + bl sub_80421C0 +_08041BDE: + pop {r0} + bx r0 + .align 2, 0 +_08041BE4: .4byte 0x000001a5 + thumb_func_end sub_8041BD0 + + thumb_func_start sub_8041BE8 +sub_8041BE8: + push {lr} + movs r1, 0xCB + lsls r1, 1 + bl sub_80421C0 + pop {r0} + bx r0 + thumb_func_end sub_8041BE8 + + thumb_func_start sub_8041BF8 +sub_8041BF8: + push {lr} + movs r1, 0xA + movs r2, 0x8 + bl sub_806CDD4 + pop {r0} + bx r0 + thumb_func_end sub_8041BF8 + + thumb_func_start sub_8041C08 +sub_8041C08: + push {lr} + ldr r1, _08041C18 + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + .align 2, 0 +_08041C18: .4byte 0x000001a7 + thumb_func_end sub_8041C08 + + thumb_func_start sub_8041C1C +sub_8041C1C: + push {lr} + ldr r1, _08041C2C + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + .align 2, 0 +_08041C2C: .4byte 0x000001a7 + thumb_func_end sub_8041C1C + + thumb_func_start nullsub_69 +nullsub_69: + bx lr + thumb_func_end nullsub_69 + + thumb_func_start sub_8041C34 +sub_8041C34: + push {lr} + movs r1, 0x4C + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_8041C34 + + thumb_func_start nullsub_70 +nullsub_70: + bx lr + thumb_func_end nullsub_70 + + thumb_func_start nullsub_71 +nullsub_71: + bx lr + thumb_func_end nullsub_71 + + thumb_func_start sub_8041C4C +sub_8041C4C: + push {lr} + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_8041C4C + + thumb_func_start sub_8041C58 +sub_8041C58: + push {lr} + ldr r1, _08041C68 + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + .align 2, 0 +_08041C68: .4byte 0x000001a9 + thumb_func_end sub_8041C58 + + thumb_func_start sub_8041C6C +sub_8041C6C: + push {lr} + movs r1, 0x9D + lsls r1, 1 + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_8041C6C + + thumb_func_start sub_8041C7C +sub_8041C7C: + push {lr} + movs r1, 0x9D + lsls r1, 1 + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_8041C7C + + thumb_func_start nullsub_72 +nullsub_72: + bx lr + thumb_func_end nullsub_72 + + thumb_func_start nullsub_73 +nullsub_73: + bx lr + thumb_func_end nullsub_73 + + thumb_func_start sub_8041C94 +sub_8041C94: + push {lr} + ldr r1, _08041CA4 + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + .align 2, 0 +_08041CA4: .4byte 0x00000171 + thumb_func_end sub_8041C94 + + thumb_func_start sub_8041CA8 +sub_8041CA8: + push {lr} + movs r1, 0x7 + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_8041CA8 + + thumb_func_start sub_8041CB8 +sub_8041CB8: + push {lr} + ldr r1, _08041CC8 + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + .align 2, 0 +_08041CC8: .4byte 0x0000018b + thumb_func_end sub_8041CB8 + + thumb_func_start sub_8041CCC +sub_8041CCC: + push {lr} + movs r1, 0xC5 + lsls r1, 1 + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_8041CCC + + thumb_func_start sub_8041CDC +sub_8041CDC: + push {lr} + movs r1, 0x5 + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_8041CDC + + thumb_func_start sub_8041CEC +sub_8041CEC: + push {lr} + ldr r1, _08041CF8 + bl sub_80421C0 + pop {r0} + bx r0 + .align 2, 0 +_08041CF8: .4byte 0x0000019d + thumb_func_end sub_8041CEC + + thumb_func_start nullsub_74 +nullsub_74: + bx lr + thumb_func_end nullsub_74 + + thumb_func_start sub_8041D00 +sub_8041D00: + push {r4,lr} + adds r4, r0, 0 + adds r0, r1, 0 + movs r1, 0x2F + movs r2, 0x1 + bl sub_804151C + adds r0, r4, 0 + movs r1, 0x30 + movs r2, 0x1 + bl sub_804151C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8041D00 + + thumb_func_start nullsub_75 +nullsub_75: + bx lr + thumb_func_end nullsub_75 + + thumb_func_start nullsub_76 +nullsub_76: + bx lr + thumb_func_end nullsub_76 + + thumb_func_start nullsub_77 +nullsub_77: + bx lr + thumb_func_end nullsub_77 + + thumb_func_start nullsub_78 +nullsub_78: + bx lr + thumb_func_end nullsub_78 + + thumb_func_start nullsub_79 +nullsub_79: + bx lr + thumb_func_end nullsub_79 + + thumb_func_start nullsub_80 +nullsub_80: + bx lr + thumb_func_end nullsub_80 + + thumb_func_start sub_8041D38 +sub_8041D38: + push {lr} + movs r1, 0x21 + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_8041D38 + + thumb_func_start sub_8041D48 +sub_8041D48: + push {lr} + ldr r1, _08041D54 + bl sub_80421C0 + pop {r0} + bx r0 + .align 2, 0 +_08041D54: .4byte 0x00000191 + thumb_func_end sub_8041D48 + + thumb_func_start nullsub_81 +nullsub_81: + bx lr + thumb_func_end nullsub_81 + + thumb_func_start sub_8041D5C +sub_8041D5C: + push {r4,lr} + adds r4, r0, 0 + bl sub_8042768 + lsls r0, 24 + cmp r0, 0 + beq _08041D7E + ldr r0, [r4, 0x70] + movs r1, 0x89 + lsls r1, 1 + adds r0, r1 + ldrb r0, [r0] + adds r1, r4, 0 + movs r2, 0x1 + movs r3, 0xB + bl sub_803ED30 +_08041D7E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8041D5C + + thumb_func_start sub_8041D84 +sub_8041D84: + push {lr} + ldr r1, _08041D90 + bl sub_80421C0 + pop {r0} + bx r0 + .align 2, 0 +_08041D90: .4byte 0x0000019f + thumb_func_end sub_8041D84 + + thumb_func_start nullsub_82 +nullsub_82: + bx lr + thumb_func_end nullsub_82 + + thumb_func_start nullsub_83 +nullsub_83: + bx lr + thumb_func_end nullsub_83 + + thumb_func_start sub_8041D9C +sub_8041D9C: + push {lr} + ldr r1, _08041DAC + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + .align 2, 0 +_08041DAC: .4byte 0x00000131 + thumb_func_end sub_8041D9C + + thumb_func_start sub_8041DB0 +sub_8041DB0: + push {lr} + movs r1, 0x30 + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_8041DB0 + + thumb_func_start nullsub_84 +nullsub_84: + bx lr + thumb_func_end nullsub_84 + + thumb_func_start nullsub_85 +nullsub_85: + bx lr + thumb_func_end nullsub_85 + + thumb_func_start nullsub_204 +nullsub_204: + bx lr + thumb_func_end nullsub_204 + + thumb_func_start nullsub_86 +nullsub_86: + bx lr + thumb_func_end nullsub_86 + + thumb_func_start nullsub_87 +nullsub_87: + bx lr + thumb_func_end nullsub_87 + + thumb_func_start nullsub_88 +nullsub_88: + bx lr + thumb_func_end nullsub_88 + + thumb_func_start sub_8041DD8 +sub_8041DD8: + push {r4,r5,lr} + adds r4, r0, 0 + lsls r1, 16 + asrs r5, r1, 16 + movs r1, 0xE + bl sub_8071858 + lsls r0, 24 + cmp r0, 0 + beq _08041DF8 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_804151C + b _08041E02 +_08041DF8: + adds r0, r4, 0 + movs r1, 0xE + movs r2, 0x1 + bl sub_804151C +_08041E02: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8041DD8 + + thumb_func_start nullsub_89 +nullsub_89: + bx lr + thumb_func_end nullsub_89 + + thumb_func_start sub_8041E0C +sub_8041E0C: + push {lr} + movs r1, 0x41 + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_8041E0C + + thumb_func_start sub_8041E1C +sub_8041E1C: + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x8F + lsls r1, 1 + movs r2, 0x1 + bl sub_804151C + movs r1, 0xCE + lsls r1, 1 + adds r0, r4, 0 + bl sub_80421C0 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8041E1C + + thumb_func_start sub_8041E3C +sub_8041E3C: + push {lr} + movs r1, 0xD7 + lsls r1, 1 + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_8041E3C + + thumb_func_start sub_8041E4C +sub_8041E4C: + push {lr} + ldr r1, _08041E5C + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + .align 2, 0 +_08041E5C: .4byte 0x000001b1 + thumb_func_end sub_8041E4C + + thumb_func_start sub_8041E60 +sub_8041E60: + push {lr} + ldr r1, _08041E70 + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + .align 2, 0 +_08041E70: .4byte 0x000001a9 + thumb_func_end sub_8041E60 + + thumb_func_start sub_8041E74 +sub_8041E74: + push {lr} + movs r1, 0xC9 + lsls r1, 1 + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_8041E74 + + thumb_func_start sub_8041E84 +sub_8041E84: + push {lr} + movs r1, 0xC7 + lsls r1, 1 + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_8041E84 + + thumb_func_start sub_8041E94 +sub_8041E94: + push {lr} + movs r1, 0xC8 + lsls r1, 1 + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_8041E94 + + thumb_func_start sub_8041EA4 +sub_8041EA4: + push {lr} + movs r1, 0x15 + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_8041EA4 + + thumb_func_start sub_8041EB4 +sub_8041EB4: + push {lr} + ldr r1, _08041EC4 + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + .align 2, 0 +_08041EC4: .4byte 0x00000171 + thumb_func_end sub_8041EB4 + + thumb_func_start sub_8041EC8 +sub_8041EC8: + push {lr} + ldr r1, _08041ED4 + bl sub_80421C0 + pop {r0} + bx r0 + .align 2, 0 +_08041ED4: .4byte 0x00000197 + thumb_func_end sub_8041EC8 + + thumb_func_start sub_8041ED8 +sub_8041ED8: + push {lr} + ldr r1, _08041EE4 + bl sub_80421C0 + pop {r0} + bx r0 + .align 2, 0 +_08041EE4: .4byte 0x00000197 + thumb_func_end sub_8041ED8 + + thumb_func_start sub_8041EE8 +sub_8041EE8: + push {lr} + movs r1, 0x15 + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_8041EE8 + + thumb_func_start sub_8041EF8 +sub_8041EF8: + push {lr} + movs r1, 0xF + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_8041EF8 + + thumb_func_start sub_8041F08 +sub_8041F08: + push {lr} + sub sp, 0x8 + movs r1, 0x2 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + movs r1, 0x15 + movs r2, 0x1 + movs r3, 0x3 + bl sub_8041550 + add sp, 0x8 + pop {r0} + bx r0 + thumb_func_end sub_8041F08 + + thumb_func_start nullsub_90 +nullsub_90: + bx lr + thumb_func_end nullsub_90 + + thumb_func_start sub_8041F28 +sub_8041F28: + push {lr} + cmp r1, 0 + bne _08041F3A + movs r1, 0xCA + lsls r1, 1 + movs r2, 0x1 + bl sub_804151C + b _08041F42 +_08041F3A: + ldr r1, _08041F48 + movs r2, 0x1 + bl sub_804151C +_08041F42: + pop {r0} + bx r0 + .align 2, 0 +_08041F48: .4byte 0x00000193 + thumb_func_end sub_8041F28 + + thumb_func_start sub_8041F4C +sub_8041F4C: + push {lr} + cmp r1, 0 + bne _08041F60 + ldr r1, _08041F5C + movs r2, 0x1 + bl sub_804151C + b _08041F68 + .align 2, 0 +_08041F5C: .4byte 0x0000018f +_08041F60: + ldr r1, _08041F6C + movs r2, 0x1 + bl sub_804151C +_08041F68: + pop {r0} + bx r0 + .align 2, 0 +_08041F6C: .4byte 0x00000191 + thumb_func_end sub_8041F4C + + thumb_func_start sub_8041F70 +sub_8041F70: + push {lr} + cmp r1, 0 + bne _08041F84 + ldr r1, _08041F80 + movs r2, 0x1 + bl sub_804151C + b _08041F8E + .align 2, 0 +_08041F80: .4byte 0x000001a9 +_08041F84: + movs r1, 0xC9 + lsls r1, 1 + movs r2, 0x1 + bl sub_804151C +_08041F8E: + pop {r0} + bx r0 + thumb_func_end sub_8041F70 + + thumb_func_start sub_8041F94 +sub_8041F94: + push {lr} + cmp r1, 0 + bne _08041FA6 + movs r1, 0xC7 + lsls r1, 1 + movs r2, 0x1 + bl sub_804151C + b _08041FB0 +_08041FA6: + movs r1, 0xC8 + lsls r1, 1 + movs r2, 0x1 + bl sub_804151C +_08041FB0: + pop {r0} + bx r0 + thumb_func_end sub_8041F94 + + thumb_func_start sub_8041FB4 +sub_8041FB4: + push {lr} + cmp r1, 0 + bne _08041FC8 + ldr r1, _08041FC4 + movs r2, 0x1 + bl sub_804151C + b _08041FD2 + .align 2, 0 +_08041FC4: .4byte 0x000001a9 +_08041FC8: + movs r1, 0xC9 + lsls r1, 1 + movs r2, 0x1 + bl sub_804151C +_08041FD2: + pop {r0} + bx r0 + thumb_func_end sub_8041FB4 + + thumb_func_start sub_8041FD8 +sub_8041FD8: + push {lr} + cmp r1, 0 + bne _08041FEA + movs r1, 0xCA + lsls r1, 1 + movs r2, 0x1 + bl sub_804151C + b _08041FF2 +_08041FEA: + ldr r1, _08041FF8 + movs r2, 0x1 + bl sub_804151C +_08041FF2: + pop {r0} + bx r0 + .align 2, 0 +_08041FF8: .4byte 0x00000193 + thumb_func_end sub_8041FD8 + + thumb_func_start sub_8041FFC +sub_8041FFC: + push {lr} + cmp r1, 0 + bne _0804200E + movs r1, 0xC7 + lsls r1, 1 + movs r2, 0x1 + bl sub_804151C + b _08042018 +_0804200E: + movs r1, 0xC8 + lsls r1, 1 + movs r2, 0x1 + bl sub_804151C +_08042018: + pop {r0} + bx r0 + thumb_func_end sub_8041FFC + + thumb_func_start sub_804201C +sub_804201C: + push {lr} + cmp r1, 0 + bne _08042030 + ldr r1, _0804202C + movs r2, 0x1 + bl sub_804151C + b _08042038 + .align 2, 0 +_0804202C: .4byte 0x0000018f +_08042030: + ldr r1, _0804203C + movs r2, 0x1 + bl sub_804151C +_08042038: + pop {r0} + bx r0 + .align 2, 0 +_0804203C: .4byte 0x00000191 + thumb_func_end sub_804201C + + thumb_func_start sub_8042040 +sub_8042040: + push {lr} + cmp r1, 0 + bne _08042052 + movs r1, 0xC6 + lsls r1, 1 + movs r2, 0x1 + bl sub_804151C + b _0804205A +_08042052: + movs r1, 0xD + movs r2, 0x1 + bl sub_804151C +_0804205A: + pop {r0} + bx r0 + thumb_func_end sub_8042040 + + thumb_func_start sub_8042060 +sub_8042060: + push {lr} + cmp r1, 0 + bne _08042074 + ldr r1, _08042070 + movs r2, 0x1 + bl sub_804151C + b _0804207C + .align 2, 0 +_08042070: .4byte 0x0000018d +_08042074: + movs r1, 0xE + movs r2, 0x1 + bl sub_804151C +_0804207C: + pop {r0} + bx r0 + thumb_func_end sub_8042060 + + thumb_func_start sub_8042080 +sub_8042080: + push {lr} + cmp r1, 0 + bne _08042092 + movs r1, 0xC6 + lsls r1, 1 + movs r2, 0x1 + bl sub_804151C + b _0804209A +_08042092: + movs r1, 0xD + movs r2, 0x1 + bl sub_804151C +_0804209A: + pop {r0} + bx r0 + thumb_func_end sub_8042080 + + thumb_func_start sub_80420A0 +sub_80420A0: + push {lr} + ldr r1, _080420B0 + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + .align 2, 0 +_080420B0: .4byte 0x00000143 + thumb_func_end sub_80420A0 + + thumb_func_start nullsub_91 +nullsub_91: + bx lr + thumb_func_end nullsub_91 + + thumb_func_start sub_80420B8 +sub_80420B8: + push {lr} + movs r1, 0x19 + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_80420B8 + + thumb_func_start sub_80420C8 +sub_80420C8: + push {lr} + sub sp, 0x8 + movs r1, 0x2 + str r1, [sp] + movs r1, 0 + str r1, [sp, 0x4] + movs r1, 0x15 + movs r2, 0x1 + movs r3, 0x3 + bl sub_8041550 + add sp, 0x8 + pop {r0} + bx r0 + thumb_func_end sub_80420C8 + + thumb_func_start nullsub_92 +nullsub_92: + bx lr + thumb_func_end nullsub_92 + + thumb_func_start sub_80420E8 +sub_80420E8: + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r1, [r1, 0x8] + ldr r0, _0804211C + ldr r0, [r0] + ldr r2, _08042120 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _08042106 + adds r0, r1, 0 + bl sub_806F62C + adds r1, r0, 0 +_08042106: + cmp r1, 0x1 + beq _08042124 + cmp r1, 0x1 + bcc _08042116 + cmp r1, 0x2 + beq _08042128 + cmp r1, 0x3 + beq _0804212C +_08042116: + movs r1, 0x8 + b _0804212E + .align 2, 0 +_0804211C: .4byte gUnknown_203B418 +_08042120: .4byte 0x0000016d +_08042124: + movs r1, 0x9 + b _0804212E +_08042128: + movs r1, 0xA + b _0804212E +_0804212C: + movs r1, 0xB +_0804212E: + movs r0, 0 + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0x3 + bl sub_8041550 + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80420E8 + + thumb_func_start sub_8042148 +sub_8042148: + push {r4,lr} + adds r4, r0, 0 + ldr r1, _08042164 + bl sub_80421C0 + movs r1, 0x9F + lsls r1, 1 + adds r0, r4, 0 + movs r2, 0x1 + bl sub_804151C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08042164: .4byte 0x000001a7 + thumb_func_end sub_8042148 + + thumb_func_start nullsub_93 +nullsub_93: + bx lr + thumb_func_end nullsub_93 + + thumb_func_start sub_804216C +sub_804216C: + push {lr} + adds r0, r1, 0 + cmp r2, 0x1 + bne _0804217E + movs r1, 0xF8 + movs r2, 0x1 + bl sub_804151C + b _08042186 +_0804217E: + movs r1, 0xF9 + movs r2, 0x1 + bl sub_804151C +_08042186: + pop {r0} + bx r0 + thumb_func_end sub_804216C + + thumb_func_start sub_804218C +sub_804218C: + push {lr} + adds r0, r1, 0 + movs r1, 0x2A + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_804218C + + thumb_func_start sub_804219C +sub_804219C: + push {lr} + movs r1, 0x90 + movs r2, 0x1 + bl sub_80416E0 + pop {r0} + bx r0 + thumb_func_end sub_804219C + + thumb_func_start sub_80421AC +sub_80421AC: + push {lr} + adds r0, r1, 0 + ldr r1, _080421BC + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + .align 2, 0 +_080421BC: .4byte 0x00000167 + thumb_func_end sub_80421AC + + thumb_func_start sub_80421C0 +sub_80421C0: + push {r4,lr} + adds r2, r0, 0 + lsls r1, 16 + lsrs r0, r1, 16 + adds r4, r0, 0 + cmp r2, 0 + bne _080421D4 + bl sub_8083E38 + b _080421E6 +_080421D4: + adds r0, r2, 0 + bl sub_8042768 + lsls r0, 24 + cmp r0, 0 + beq _080421E6 + adds r0, r4, 0 + bl sub_8083E38 +_080421E6: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80421C0 + + thumb_func_start sub_80421EC +sub_80421EC: + push {r4,lr} + lsls r1, 16 + lsrs r4, r1, 16 + bl sub_803F428 + lsls r0, 24 + cmp r0, 0 + beq _08042202 + adds r0, r4, 0 + bl sub_8083E38 +_08042202: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80421EC + + thumb_func_start sub_8042208 +sub_8042208: + push {lr} + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0 + bne _0804221C + movs r0, 0xA9 + lsls r0, 1 + bl sub_8083E38 + b _08042234 +_0804221C: + cmp r1, 0x1 + bne _0804222C + ldr r0, _08042228 + bl sub_8083E38 + b _08042234 + .align 2, 0 +_08042228: .4byte 0x00000151 +_0804222C: + movs r0, 0xA8 + lsls r0, 1 + bl sub_8083E38 +_08042234: + pop {r0} + bx r0 + thumb_func_end sub_8042208 + + thumb_func_start sub_8042238 +sub_8042238: + push {lr} + ldr r0, [r1, 0x70] + ldrb r0, [r0, 0x6] + cmp r0, 0 + beq _08042250 + ldr r0, _0804224C + bl sub_8083E38 + b _08042258 + .align 2, 0 +_0804224C: .4byte 0x00000157 +_08042250: + movs r0, 0xAB + lsls r0, 1 + bl sub_8083E38 +_08042258: + pop {r0} + bx r0 + thumb_func_end sub_8042238 + + thumb_func_start sub_804225C +sub_804225C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + mov r8, r0 + adds r5, r1, 0 + lsls r2, 24 + lsrs r4, r2, 24 + adds r7, r4, 0 + cmp r4, 0x11 + bne _08042274 + b _08042384 +_08042274: + adds r0, r5, 0 + bl sub_803F428 + lsls r0, 24 + cmp r0, 0 + bne _08042282 + b _08042384 +_08042282: + adds r0, r4, 0 + bl sub_800EF28 + bl sub_800EF64 + movs r0, 0x4 + movs r1, 0x42 + bl sub_803E708 + movs r0, 0 + ldrsh r1, [r5, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 11 + movs r1, 0xC0 + lsls r1, 4 + adds r0, r1 + cmp r0, 0 + bge _080422AA + adds r0, 0xFF +_080422AA: + lsls r0, 8 + lsrs r0, 16 + ldr r1, _080422FC + ldr r2, [sp] + ands r2, r1 + orrs r2, r0 + str r2, [sp] + movs r0, 0x2 + ldrsh r1, [r5, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 11 + movs r1, 0x80 + lsls r1, 5 + adds r0, r1 + cmp r0, 0 + bge _080422CE + adds r0, 0xFF +_080422CE: + lsls r0, 8 + lsrs r0, 16 + lsls r0, 16 + ldr r1, _08042300 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + adds r0, r4, 0 + mov r1, sp + bl sub_800E448 + adds r6, r0, 0 + cmp r4, 0x4 + bne _08042308 + ldr r1, _08042304 + movs r0, 0 + bl sub_80421C0 + movs r0, 0x28 + movs r1, 0x33 + bl sub_803E708 + b _08042360 + .align 2, 0 +_080422FC: .4byte 0xffff0000 +_08042300: .4byte 0x0000ffff +_08042304: .4byte 0x00000193 +_08042308: + cmp r7, 0x8 + bne _08042358 + mov r0, r8 + ldr r7, [r0, 0x70] + adds r0, r7, 0 + adds r0, 0x46 + ldrb r4, [r0] + movs r5, 0 + b _0804231C +_0804231A: + adds r5, 0x2 +_0804231C: + ldr r0, _08042354 + cmp r5, r0 + bgt _08042346 + subs r4, 0x1 + movs r0, 0x7 + ands r4, r0 + mov r0, r8 + movs r1, 0 + adds r2, r4, 0 + bl sub_806CDD4 + movs r0, 0x2 + movs r1, 0x33 + bl sub_803E708 + adds r0, r6, 0 + bl sub_800E9A8 + lsls r0, 24 + cmp r0, 0 + bne _0804231A +_08042346: + movs r0, 0x7 + ands r4, r0 + adds r0, r7, 0 + adds r0, 0x46 + strb r4, [r0] + b _08042360 + .align 2, 0 +_08042354: .4byte 0x000003e7 +_08042358: + movs r0, 0x28 + movs r1, 0x33 + bl sub_803E708 +_08042360: + movs r5, 0 + ldr r4, _08042368 + b _0804236E + .align 2, 0 +_08042368: .4byte 0x000003e7 +_0804236C: + adds r5, 0x1 +_0804236E: + cmp r5, r4 + bgt _08042384 + movs r0, 0x42 + bl sub_803E46C + adds r0, r6, 0 + bl sub_800E9A8 + lsls r0, 24 + cmp r0, 0 + bne _0804236C +_08042384: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_804225C + + thumb_func_start sub_8042390 +sub_8042390: + push {r4-r6,lr} + sub sp, 0x18 + adds r5, r0, 0 + adds r4, r1, 0 + bl sub_8042768 + lsls r0, 24 + cmp r0, 0 + beq _08042454 + ldrb r1, [r4] + movs r0, 0x8 + ands r0, r1 + movs r6, 0 + cmp r0, 0 + bne _080423B0 + ldrb r6, [r4, 0x2] +_080423B0: + adds r0, r6, 0 + movs r1, 0 + bl sub_800EF40 + bl sub_800EF64 + movs r0, 0x4 + movs r1, 0x42 + bl sub_803E708 + ldr r0, [r5, 0xC] + cmp r0, 0 + bge _080423CC + adds r0, 0xFF +_080423CC: + lsls r0, 8 + lsrs r0, 16 + ldr r1, _08042428 + ldr r2, [sp, 0x14] + ands r2, r1 + orrs r2, r0 + str r2, [sp, 0x14] + ldr r0, [r5, 0x10] + cmp r0, 0 + bge _080423E2 + adds r0, 0xFF +_080423E2: + lsls r0, 8 + lsrs r0, 16 + lsls r0, 16 + ldr r4, _0804242C + ands r4, r2 + orrs r4, r0 + str r4, [sp, 0x14] + asrs r4, 16 + ldr r0, _08042430 + ldr r0, [r0] + ldr r1, _08042434 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + subs r4, r0 + lsrs r0, r4, 31 + adds r4, r0 + asrs r4, 1 + adds r4, 0x1 + adds r1, r5, 0 + adds r1, 0x28 + add r0, sp, 0x4 + bl sub_8005700 + add r1, sp, 0x14 + str r4, [sp] + adds r0, r6, 0 + add r2, sp, 0x4 + movs r3, 0 + bl sub_800E49C + adds r5, r0, 0 + movs r4, 0 + ldr r6, _08042438 + b _0804243E + .align 2, 0 +_08042428: .4byte 0xffff0000 +_0804242C: .4byte 0x0000ffff +_08042430: .4byte gUnknown_203B418 +_08042434: .4byte 0x000181f2 +_08042438: .4byte 0x000003e7 +_0804243C: + adds r4, 0x1 +_0804243E: + cmp r4, r6 + bgt _08042454 + movs r0, 0x42 + bl sub_803E46C + adds r0, r5, 0 + bl sub_800E9A8 + lsls r0, 24 + cmp r0, 0 + bne _0804243C +_08042454: + add sp, 0x18 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8042390 + + thumb_func_start sub_804245C +sub_804245C: + push {r4-r6,lr} + sub sp, 0x18 + adds r5, r0, 0 + adds r4, r1, 0 + bl sub_8042768 + lsls r0, 24 + cmp r0, 0 + beq _08042518 + ldrb r1, [r4] + movs r0, 0x8 + ands r0, r1 + movs r6, 0 + cmp r0, 0 + bne _0804247C + ldrb r6, [r4, 0x2] +_0804247C: + bl sub_800EF64 + movs r0, 0x4 + movs r1, 0x42 + bl sub_803E708 + ldr r0, [r5, 0xC] + cmp r0, 0 + bge _08042490 + adds r0, 0xFF +_08042490: + lsls r0, 8 + lsrs r0, 16 + ldr r1, _080424EC + ldr r2, [sp, 0x14] + ands r2, r1 + orrs r2, r0 + str r2, [sp, 0x14] + ldr r0, [r5, 0x10] + cmp r0, 0 + bge _080424A6 + adds r0, 0xFF +_080424A6: + lsls r0, 8 + lsrs r0, 16 + lsls r0, 16 + ldr r4, _080424F0 + ands r4, r2 + orrs r4, r0 + str r4, [sp, 0x14] + asrs r4, 16 + ldr r0, _080424F4 + ldr r0, [r0] + ldr r1, _080424F8 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + subs r4, r0 + lsrs r0, r4, 31 + adds r4, r0 + asrs r4, 1 + adds r4, 0x1 + adds r1, r5, 0 + adds r1, 0x28 + add r0, sp, 0x4 + bl sub_8005700 + add r1, sp, 0x14 + str r4, [sp] + adds r0, r6, 0 + add r2, sp, 0x4 + movs r3, 0x1 + bl sub_800E49C + adds r5, r0, 0 + movs r4, 0 + ldr r6, _080424FC + b _08042502 + .align 2, 0 +_080424EC: .4byte 0xffff0000 +_080424F0: .4byte 0x0000ffff +_080424F4: .4byte gUnknown_203B418 +_080424F8: .4byte 0x000181f2 +_080424FC: .4byte 0x000003e7 +_08042500: + adds r4, 0x1 +_08042502: + cmp r4, r6 + bgt _08042518 + movs r0, 0x42 + bl sub_803E46C + adds r0, r5, 0 + bl sub_800E9A8 + lsls r0, 24 + cmp r0, 0 + bne _08042500 +_08042518: + add sp, 0x18 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_804245C + + thumb_func_start sub_8042520 +sub_8042520: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x3C + adds r4, r0, 0 + bl sub_8045888 + lsls r0, 24 + cmp r0, 0 + bne _0804253A + b _08042664 +_0804253A: + ldr r0, [r4, 0x70] + adds r0, 0x46 + ldrb r5, [r0] + ldr r0, [r4, 0xC] + cmp r0, 0 + bge _08042548 + adds r0, 0xFF +_08042548: + lsls r0, 8 + lsrs r0, 16 + ldr r1, _0804264C + ldr r2, [sp, 0x2C] + ands r2, r1 + orrs r2, r0 + str r2, [sp, 0x2C] + ldr r0, [r4, 0x10] + cmp r0, 0 + bge _0804255E + adds r0, 0xFF +_0804255E: + lsls r0, 8 + lsrs r0, 16 + lsls r0, 16 + ldr r1, _08042650 + ands r1, r2 + orrs r1, r0 + str r1, [sp, 0x2C] + asrs r1, 16 + ldr r0, _08042654 + ldr r0, [r0] + ldr r2, _08042658 + adds r0, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + subs r1, r0 + lsrs r0, r1, 31 + adds r1, r0 + asrs r7, r1, 1 + ldr r0, _0804265C + str r0, [sp, 0x4] + movs r2, 0 + str r2, [sp, 0x8] + str r5, [sp, 0xC] + add r1, sp, 0x4 + add r4, sp, 0x2C + ldrh r0, [r4] + strh r0, [r1, 0xC] + ldr r0, [sp, 0x2C] + asrs r0, 16 + strh r0, [r1, 0xE] + adds r0, r1, 0 + strh r2, [r0, 0x10] + strh r2, [r0, 0x12] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x18] + str r7, [sp, 0x1C] + add r0, sp, 0x20 + bl sub_8004E8C + add r0, sp, 0x4 + movs r1, 0 + bl sub_8041764 + adds r6, r0, 0 + mov r10, r4 + lsls r1, r5, 2 + mov r0, sp + adds r0, 0x30 + str r0, [sp, 0x38] + ldr r0, _08042660 + adds r5, r1, r0 + movs r1, 0x5 + mov r8, r1 + mov r9, r10 +_080425CC: + movs r0, 0 + str r0, [sp] + adds r0, r6, 0 + adds r1, r4, 0 + movs r2, 0 + adds r3, r7, 0 + bl sub_800E8AC + movs r0, 0x42 + bl sub_803E46C + movs r2, 0 + ldrsh r0, [r5, r2] + lsls r0, 2 + mov r1, r9 + ldrh r1, [r1] + adds r0, r1 + mov r2, r9 + strh r0, [r2] + movs r0, 0x2 + ldrsh r1, [r5, r0] + lsls r1, 2 + ldrh r0, [r4, 0x2] + adds r0, r1 + strh r0, [r4, 0x2] + movs r2, 0x2 + ldrsh r1, [r4, r2] + ldr r0, _08042654 + ldr r0, [r0] + ldr r2, _08042658 + adds r0, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + subs r1, r0 + lsrs r0, r1, 31 + adds r1, r0 + asrs r7, r1, 1 + movs r0, 0x1 + negs r0, r0 + add r8, r0 + mov r1, r8 + cmp r1, 0 + bge _080425CC + bl sub_800DBBC + mov r2, r10 + movs r1, 0 + ldrsh r0, [r2, r1] + lsls r0, 8 + str r0, [sp, 0x30] + add r0, sp, 0x2C + movs r2, 0x2 + ldrsh r0, [r0, r2] + lsls r0, 8 + ldr r1, [sp, 0x38] + str r0, [r1, 0x4] + movs r1, 0xD0 + lsls r1, 1 + ldr r0, [sp, 0x38] + movs r2, 0x1 + bl sub_80416E0 + adds r6, r0, 0 + b _08042668 + .align 2, 0 +_0804264C: .4byte 0xffff0000 +_08042650: .4byte 0x0000ffff +_08042654: .4byte gUnknown_203B418 +_08042658: .4byte 0x000181f2 +_0804265C: .4byte 0x00000165 +_08042660: .4byte gUnknown_80F4448 +_08042664: + movs r6, 0x1 + negs r6, r6 +_08042668: + adds r0, r6, 0 + add sp, 0x3C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8042520 + + thumb_func_start sub_804267C +sub_804267C: + push {r4,lr} + ldr r4, _080426B8 + bl sub_8043D10 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _08042694 + cmp r0, 0 + blt _08042694 + cmp r0, 0x2 + ble _080426AC +_08042694: + ldr r0, _080426BC + ldr r0, [r0] + ldr r1, _080426C0 + adds r0, r1 + ldrb r0, [r0] + bl sub_80900C0 + lsls r0, 24 + ldr r4, _080426C4 + cmp r0, 0 + beq _080426AC + subs r4, 0x1 +_080426AC: + adds r0, r4, 0 + bl sub_8083E38 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080426B8: .4byte 0x000003e5 +_080426BC: .4byte gUnknown_203B418 +_080426C0: .4byte 0x00000644 +_080426C4: .4byte 0x00000155 + thumb_func_end sub_804267C + + thumb_func_start sub_80426C8 +sub_80426C8: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + cmp r4, 0x3 + bne _080426D8 + movs r0, 0 + bl sub_8083E88 +_080426D8: + cmp r5, 0x4 + beq _080426F0 + ldr r0, _080426EC + lsls r1, r4, 1 + adds r1, r0 + ldrh r0, [r1] + bl sub_8083E38 + b _080426FC + .align 2, 0 +_080426EC: .4byte gUnknown_80F67DC +_080426F0: + ldr r0, _08042708 + lsls r1, r4, 1 + adds r1, r0 + ldrh r0, [r1] + bl sub_8083E38 +_080426FC: + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x80 + bl sub_8042B34 + b _08042712 + .align 2, 0 +_08042708: .4byte gUnknown_80F67E4 +_0804270C: + movs r0, 0x46 + bl sub_803E46C +_08042712: + bl sub_8042CC0 + lsls r0, 24 + cmp r0, 0 + bne _0804270C + bl sub_8042D7C + bl sub_8040238 + movs r0, 0x1 + bl sub_8052210 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80426C8 + + thumb_func_start sub_8042730 +sub_8042730: + push {r4,r5,lr} + adds r4, r0, 0 + movs r1, 0x8 + movs r2, 0x8 + bl sub_806CDD4 + movs r5, 0 + b _08042742 +_08042740: + adds r5, 0x1 +_08042742: + cmp r5, 0x63 + bgt _08042760 + movs r0, 0x51 + bl sub_803E46C + ldr r0, [r4, 0x40] + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _08042760 + adds r0, r4, 0 + adds r0, 0x6B + ldrb r0, [r0] + cmp r0, 0x8 + beq _08042740 +_08042760: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8042730 + + thumb_func_start sub_8042768 +sub_8042768: + push {lr} + adds r1, r0, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0 + bne _08042778 +_08042774: + movs r0, 0 + b _080427A6 +_08042778: + ldr r0, _08042794 + ldr r2, [r0] + ldr r3, _08042798 + adds r0, r2, r3 + ldrb r0, [r0] + cmp r0, 0 + beq _0804279C + subs r3, 0x12 + adds r0, r2, r3 + ldr r0, [r0] + cmp r0, r1 + bne _08042774 + movs r0, 0x1 + b _080427A6 + .align 2, 0 +_08042794: .4byte gUnknown_203B418 +_08042798: .4byte 0x0001820a +_0804279C: + adds r0, r1, 0 + bl sub_8045888 + lsls r0, 24 + lsrs r0, 24 +_080427A6: + pop {r1} + bx r1 + thumb_func_end sub_8042768 + + thumb_func_start sub_80427AC +sub_80427AC: + push {r4-r6,lr} + movs r6, 0 +_080427B0: + ldr r0, _08042808 + ldr r0, [r0] + lsls r1, r6, 2 + ldr r2, _0804280C + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080427FA + ldr r5, [r4, 0x70] + adds r1, r5, 0 + adds r1, 0xF3 + ldrb r0, [r1] + cmp r0, 0 + beq _080427FA + movs r0, 0 + strb r0, [r1] + adds r0, r4, 0 + bl sub_80429A0 + ldrb r0, [r5, 0x6] + cmp r0, 0 + bne _080427FA + ldr r0, _08042810 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08042814 + ldr r1, [r0] + adds r0, r4, 0 + bl sub_805239C +_080427FA: + adds r6, 0x1 + cmp r6, 0x13 + ble _080427B0 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08042808: .4byte gUnknown_203B418 +_0804280C: .4byte 0x000135cc +_08042810: .4byte gUnknown_202DF98 +_08042814: .4byte gUnknown_8100270 + thumb_func_end sub_80427AC + + thumb_func_start sub_8042818 +sub_8042818: + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + ldr r0, _08042874 + ldr r0, [r0] + ldr r1, _08042878 + adds r0, r1 + ldr r4, [r0] + cmp r4, 0 + bne _08042836 + bl sub_8083600 + adds r4, r0, 0 +_08042836: + ldr r1, _0804287C + lsls r0, r5, 1 + adds r2, r0, r1 + ldrh r1, [r2] + ldr r0, _08042880 + cmp r1, r0 + beq _0804284A + adds r0, r4, 0 + bl sub_80421C0 +_0804284A: + ldr r0, _08042884 + lsls r1, r5, 2 + adds r0, r1, r0 + ldr r5, [r0] + adds r6, r1, 0 + cmp r5, 0 + blt _08042896 + cmp r7, 0 + beq _08042888 + bl sub_80441BC + lsls r0, 24 + cmp r0, 0 + bne _08042888 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0 + bl sub_804151C + b _08042896 + .align 2, 0 +_08042874: .4byte gUnknown_203B418 +_08042878: .4byte 0x000181f8 +_0804287C: .4byte gUnknown_80F682C +_08042880: .4byte 0x000003e5 +_08042884: .4byte gUnknown_80F67EC +_08042888: + ldr r0, _0804289C + adds r0, r6, r0 + ldr r1, [r0] + adds r0, r4, 0 + movs r2, 0 + bl sub_804151C +_08042896: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804289C: .4byte gUnknown_80F680C + thumb_func_end sub_8042818 + + thumb_func_start sub_80428A0 +sub_80428A0: + push {lr} + movs r1, 0x29 + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_80428A0 + + thumb_func_start sub_80428B0 +sub_80428B0: + push {lr} + ldr r1, _080428C0 + movs r2, 0 + bl sub_804151C + pop {r0} + bx r0 + .align 2, 0 +_080428C0: .4byte 0x000001a9 + thumb_func_end sub_80428B0 + + thumb_func_start sub_80428C4 +sub_80428C4: + push {lr} + ldr r1, _080428D4 + movs r2, 0 + bl sub_804151C + pop {r0} + bx r0 + .align 2, 0 +_080428D4: .4byte 0x000001a9 + thumb_func_end sub_80428C4 + + thumb_func_start sub_80428D8 +sub_80428D8: + push {lr} + ldr r1, _080428E8 + movs r2, 0 + bl sub_804151C + pop {r0} + bx r0 + .align 2, 0 +_080428E8: .4byte 0x000001a9 + thumb_func_end sub_80428D8 + + thumb_func_start sub_80428EC +sub_80428EC: + push {lr} + ldr r1, _080428FC + movs r2, 0 + bl sub_804151C + pop {r0} + bx r0 + .align 2, 0 +_080428FC: .4byte 0x000001a9 + thumb_func_end sub_80428EC + + thumb_func_start sub_8042900 +sub_8042900: + push {lr} + movs r1, 0xD4 + lsls r1, 1 + movs r2, 0 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_8042900 + + thumb_func_start sub_8042910 +sub_8042910: + push {lr} + movs r1, 0x29 + movs r2, 0 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_8042910 + + thumb_func_start sub_8042920 +sub_8042920: + push {lr} + movs r1, 0x48 + movs r2, 0 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_8042920 + + thumb_func_start sub_8042930 +sub_8042930: + push {lr} + movs r1, 0xD3 + lsls r1, 1 + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_8042930 + + thumb_func_start sub_8042940 +sub_8042940: + push {lr} + movs r1, 0xC7 + lsls r1, 1 + movs r2, 0 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_8042940 + + thumb_func_start sub_8042950 +sub_8042950: + push {lr} + movs r1, 0xD8 + lsls r1, 1 + movs r2, 0x1 + bl sub_804151C + movs r0, 0xA + movs r1, 0x42 + bl sub_803E708 + pop {r0} + bx r0 + thumb_func_end sub_8042950 + + thumb_func_start sub_8042968 +sub_8042968: + push {lr} + movs r1, 0xD4 + lsls r1, 1 + movs r2, 0 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_8042968 + + thumb_func_start sub_8042978 +sub_8042978: + push {lr} + ldr r1, _08042988 + movs r2, 0 + bl sub_804151C + pop {r0} + bx r0 + .align 2, 0 +_08042988: .4byte 0x000001a9 + thumb_func_end sub_8042978 + + thumb_func_start sub_804298C +sub_804298C: + push {lr} + ldr r1, _0804299C + movs r2, 0 + bl sub_804151C + pop {r0} + bx r0 + .align 2, 0 +_0804299C: .4byte 0x000001a9 + thumb_func_end sub_804298C + + thumb_func_start sub_80429A0 +sub_80429A0: + push {lr} + ldr r1, _080429B0 + movs r2, 0 + bl sub_804151C + pop {r0} + bx r0 + .align 2, 0 +_080429B0: .4byte 0x00000199 + thumb_func_end sub_80429A0 + + thumb_func_start sub_80429B4 +sub_80429B4: + push {lr} + ldr r1, _080429C4 + movs r2, 0 + bl sub_804151C + pop {r0} + bx r0 + .align 2, 0 +_080429C4: .4byte 0x000001ab + thumb_func_end sub_80429B4 + + thumb_func_start sub_80429C8 +sub_80429C8: + push {lr} + movs r1, 0x4 + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_80429C8 + + thumb_func_start sub_80429D8 +sub_80429D8: + push {lr} + movs r1, 0x8F + lsls r1, 1 + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_80429D8 + + thumb_func_start sub_80429E8 +sub_80429E8: + push {lr} + ldr r1, _080429F8 + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + .align 2, 0 +_080429F8: .4byte 0x0000011d + thumb_func_end sub_80429E8 + + thumb_func_start sub_80429FC +sub_80429FC: + push {lr} + movs r1, 0xCF + lsls r1, 1 + movs r2, 0x1 + bl sub_80416A4 + movs r0, 0 + movs r1, 0xD4 + bl sub_80421C0 + pop {r0} + bx r0 + thumb_func_end sub_80429FC + + thumb_func_start sub_8042A14 +sub_8042A14: + push {lr} + movs r1, 0x36 + movs r2, 0x1 + bl sub_80416A4 + pop {r0} + bx r0 + thumb_func_end sub_8042A14 + + thumb_func_start sub_8042A24 +sub_8042A24: + push {lr} + movs r1, 0x15 + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_8042A24 + + thumb_func_start sub_8042A34 +sub_8042A34: + push {lr} + movs r1, 0x9F + lsls r1, 1 + movs r2, 0 + bl sub_80416A4 + pop {r0} + bx r0 + thumb_func_end sub_8042A34 + + thumb_func_start sub_8042A44 +sub_8042A44: + push {lr} + movs r1, 0xDA + lsls r1, 1 + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_8042A44 + + thumb_func_start sub_8042A54 +sub_8042A54: + push {lr} + movs r1, 0x37 + movs r2, 0x1 + bl sub_80416A4 + pop {r0} + bx r0 + thumb_func_end sub_8042A54 + + thumb_func_start sub_8042A64 +sub_8042A64: + push {lr} + movs r1, 0x29 + movs r2, 0x1 + bl sub_80416A4 + pop {r0} + bx r0 + thumb_func_end sub_8042A64 + + thumb_func_start sub_8042A74 +sub_8042A74: + push {lr} + movs r1, 0x18 + movs r2, 0x1 + bl sub_804151C + pop {r0} + bx r0 + thumb_func_end sub_8042A74 + + thumb_func_start sub_8042A84 +sub_8042A84: + push {r4-r7,lr} + adds r4, r1, 0 + adds r7, r2, 0 + lsls r0, 16 + asrs r5, r0, 16 + movs r6, 0x80 + lsls r6, 2 + adds r0, r4, 0 + bl sub_8042768 + lsls r0, 24 + cmp r0, 0 + beq _08042AF8 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0 + bl sub_804151C + adds r0, r7, 0 + movs r1, 0x42 + bl sub_803E708 + adds r5, r4, 0 + adds r5, 0x20 +_08042AB4: + ldr r1, [r4, 0x1C] + ldr r0, _08042B00 + cmp r1, r0 + bgt _08042AF0 + movs r0, 0x42 + bl sub_803E46C + ldr r1, [r4, 0x1C] + adds r1, r6 + str r1, [r4, 0x1C] + movs r0, 0x80 + lsls r0, 1 + adds r6, r0 + ldr r0, [r4, 0x10] + subs r0, r1 + cmp r0, 0 + bge _08042AD8 + adds r0, 0xFF +_08042AD8: + asrs r1, r0, 8 + ldr r0, _08042B04 + ldr r0, [r0] + ldr r2, _08042B08 + adds r0, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + subs r1, r0 + movs r0, 0x8 + negs r0, r0 + cmp r1, r0 + bge _08042AB4 +_08042AF0: + movs r0, 0 + strb r0, [r5] + bl sub_804178C +_08042AF8: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08042B00: .4byte 0x0000c7ff +_08042B04: .4byte gUnknown_203B418 +_08042B08: .4byte 0x000181f2 + thumb_func_end sub_8042A84 + + thumb_func_start sub_8042B0C +sub_8042B0C: + push {lr} + adds r1, r0, 0 + movs r0, 0x9F + lsls r0, 1 + movs r2, 0x5 + bl sub_8042A84 + pop {r0} + bx r0 + thumb_func_end sub_8042B0C + + thumb_func_start sub_8042B20 +sub_8042B20: + push {lr} + adds r1, r0, 0 + movs r0, 0xDE + lsls r0, 1 + movs r2, 0xE + bl sub_8042A84 + pop {r0} + bx r0 + thumb_func_end sub_8042B20 + + thumb_func_start sub_8042B34 +sub_8042B34: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + adds r5, r0, 0 + adds r4, r1, 0 + adds r6, r2, 0 + movs r0, 0 + mov r8, r0 + bl sub_8085480 + mov r10, r0 + ldr r7, _08042CB0 + movs r0, 0xCC + movs r1, 0x7 + bl MemoryAlloc + str r0, [r7] + str r5, [r0] + adds r4, 0x1 + lsls r4, 2 + str r4, [r0, 0x8] + ldr r4, _08042CB4 + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 3 + adds r0, r4 + movs r1, 0 + ldrsh r0, [r0, r1] + bl sub_800EE5C + bl sub_800EF64 + movs r0, 0x46 + bl sub_803E46C + ldr r0, [r7] + str r6, [r0, 0x4] + movs r5, 0 + ldr r0, [r0, 0x8] + cmp r5, r0 + blt _08042B8E + b _08042C9E +_08042B8E: + mov r9, sp +_08042B90: + mov r2, r8 + lsls r6, r2, 3 + ldr r0, [r7] + ldr r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, r6, r0 + ldr r3, _08042CB4 + adds r0, r3 + movs r1, 0 + ldrsh r0, [r0, r1] + str r0, [sp] + str r5, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + mov r2, r10 + ldr r0, [r2, 0xC] + cmp r0, 0 + bge _08042BBA + adds r0, 0xFF +_08042BBA: + asrs r0, 8 + mov r3, r9 + strh r0, [r3, 0xC] + mov r1, sp + mov r2, r10 + ldr r0, [r2, 0x10] + cmp r0, 0 + bge _08042BCC + adds r0, 0xFF +_08042BCC: + asrs r0, 8 + strh r0, [r1, 0xE] + movs r0, 0x2 + bl RandomCapped + ldr r1, [r7] + lsls r4, r5, 2 + adds r3, r1, 0 + adds r3, 0x4C + adds r3, r4 + ldr r2, [r1] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 3 + adds r1, r6, r1 + ldr r2, _08042CB4 + adds r2, 0x4 + adds r1, r2 + ldr r1, [r1] + lsls r1, 1 + adds r1, r0 + str r1, [r3] + movs r0, 0xF0 + bl RandomCapped + ldr r1, [r7] + adds r1, r4 + adds r0, 0x98 + adds r1, 0x8C + strh r0, [r1] + lsls r0, r5, 1 + adds r0, 0x8 + bl RandomCapped + ldr r1, [r7] + adds r2, r1, r4 + adds r3, r0, 0 + adds r3, 0x18 + adds r1, r5, 0 + cmp r5, 0 + bge _08042C20 + adds r1, r5, 0x3 +_08042C20: + asrs r1, 2 + lsls r1, 2 + subs r1, r5, r1 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 3 + subs r0, r3, r0 + adds r1, r2, 0 + adds r1, 0x8E + strh r0, [r1] + adds r0, r2, 0 + adds r0, 0x8C + ldrh r0, [r0] + mov r3, r9 + strh r0, [r3, 0x10] + ldrh r0, [r1] + strh r0, [r3, 0x12] + movs r0, 0x4 + str r0, [sp, 0x14] + ldr r0, _08042CB8 + str r0, [sp, 0x18] + add r1, sp, 0x1C + ldr r0, _08042CBC + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + mov r0, sp + bl sub_800E890 + ldr r2, [r7] + adds r1, r2, 0 + adds r1, 0xC + adds r1, r4 + str r0, [r1] + movs r6, 0x1 + add r8, r6 + mov r0, r8 + cmp r0, 0x2 + bgt _08042C82 + ldr r0, [r2] + lsls r1, r0, 1 + adds r1, r0 + add r1, r8 + lsls r1, 3 + ldr r2, _08042CB4 + adds r1, r2 + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0 + bne _08042C86 +_08042C82: + movs r6, 0 + mov r8, r6 +_08042C86: + ldr r0, [sp] + bl sub_800ECA4 + ldr r0, [r0, 0x4] + bl sub_800F15C + adds r5, 0x1 + ldr r0, [r7] + ldr r0, [r0, 0x8] + cmp r5, r0 + bge _08042C9E + b _08042B90 +_08042C9E: + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08042CB0: .4byte gUnknown_203B414 +_08042CB4: .4byte gUnknown_80F6624 +_08042CB8: .4byte 0x0000ffff +_08042CBC: .4byte gUnknown_80F683C + thumb_func_end sub_8042B34 + + thumb_func_start sub_8042CC0 +sub_8042CC0: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + movs r7, 0 + ldr r2, _08042D20 + ldr r1, [r2] + ldr r0, [r1, 0x4] + cmp r0, 0 + beq _08042CDC + movs r7, 0x1 + subs r0, 0x1 + str r0, [r1, 0x4] +_08042CDC: + movs r5, 0 + ldr r0, [r2] + ldr r0, [r0, 0x8] + cmp r5, r0 + bge _08042D56 + adds r6, r2, 0 + movs r0, 0x98 + negs r0, r0 + mov r9, r0 + movs r4, 0 + ldr r1, _08042D24 + mov r8, r1 +_08042CF4: + ldr r3, [r6] + adds r0, r3, r4 + adds r2, r0, 0 + adds r2, 0x8C + adds r0, r3, 0 + adds r0, 0x4C + adds r0, r4 + ldr r1, [r0] + ldrh r0, [r2] + subs r0, r1 + strh r0, [r2] + lsls r0, 16 + asrs r0, 16 + cmp r0, r9 + bgt _08042D2E + ldr r0, [r3, 0x4] + cmp r0, 0 + ble _08042D28 + movs r0, 0x98 + strh r0, [r2] + b _08042D30 + .align 2, 0 +_08042D20: .4byte gUnknown_203B414 +_08042D24: .4byte 0x0000ff68 +_08042D28: + mov r0, r8 + strh r0, [r2] + b _08042D30 +_08042D2E: + movs r7, 0x1 +_08042D30: + ldr r2, [r6] + adds r0, r2, 0 + adds r0, 0xC + adds r0, r4 + ldr r0, [r0] + adds r1, r4, 0 + adds r1, 0x8C + adds r2, r1 + movs r1, 0 + str r1, [sp] + movs r3, 0 + bl sub_800E8AC + adds r4, 0x4 + adds r5, 0x1 + ldr r0, [r6] + ldr r0, [r0, 0x8] + cmp r5, r0 + blt _08042CF4 +_08042D56: + ldr r0, _08042D74 + ldr r0, [r0] + ldr r1, _08042D78 + adds r0, r1 + bl sub_800E90C + adds r0, r7, 0 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08042D74: .4byte gUnknown_203B418 +_08042D78: .4byte 0x000181f0 + thumb_func_end sub_8042CC0 + + thumb_func_start sub_8042D7C +sub_8042D7C: + push {r4-r6,lr} + ldr r1, _08042DD0 + ldr r0, [r1] + cmp r0, 0 + beq _08042DCA + movs r5, 0 + ldr r0, [r0, 0x8] + cmp r5, r0 + bge _08042DBA + adds r6, r1, 0 +_08042D90: + ldr r0, [r6] + lsls r4, r5, 2 + adds r0, 0xC + adds r0, r4 + ldr r0, [r0] + bl sub_800E9A8 + lsls r0, 24 + cmp r0, 0 + beq _08042DB0 + ldr r0, [r6] + adds r0, 0xC + adds r0, r4 + ldr r0, [r0] + bl sub_800DC14 +_08042DB0: + adds r5, 0x1 + ldr r0, [r6] + ldr r0, [r0, 0x8] + cmp r5, r0 + blt _08042D90 +_08042DBA: + bl sub_800DBBC + ldr r4, _08042DD0 + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_08042DCA: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08042DD0: .4byte gUnknown_203B414 + thumb_func_end sub_8042D7C + + thumb_func_start sub_8042DD4 +sub_8042DD4: + push {r4-r7,lr} + adds r5, r0, 0 + adds r6, r1, 0 + adds r7, r2, 0 + movs r2, 0 + ldr r0, _08042E04 + mov r12, r0 + ldr r3, _08042E08 +_08042DE4: + mov r1, r12 + ldr r0, [r1] + adds r4, r0, r3 + ldr r1, [r4] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _08042E0C + str r5, [r4] + str r6, [r4, 0xC] + str r7, [r4, 0x4] + adds r0, r5, 0 + bl sub_800E6D8 + str r0, [r4, 0x8] + b _08042E14 + .align 2, 0 +_08042E04: .4byte gUnknown_203B418 +_08042E08: .4byte 0x000005c4 +_08042E0C: + adds r3, 0x10 + adds r2, 0x1 + cmp r2, 0x2 + ble _08042DE4 +_08042E14: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8042DD4 + + thumb_func_start sub_8042E1C +sub_8042E1C: + push {r4-r6,lr} + movs r5, 0 + ldr r6, _08042E44 + ldr r4, _08042E48 +_08042E24: + ldr r0, [r6] + adds r0, r4 + ldr r1, [r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08042E4C + adds r0, r1, 0 + bl sub_800E9A8 + lsls r0, 24 + cmp r0, 0 + beq _08042E4C + movs r0, 0x1 + b _08042E56 + .align 2, 0 +_08042E44: .4byte gUnknown_203B418 +_08042E48: .4byte 0x000005c4 +_08042E4C: + adds r4, 0x10 + adds r5, 0x1 + cmp r5, 0x2 + ble _08042E24 + movs r0, 0 +_08042E56: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8042E1C + + thumb_func_start sub_8042E5C +sub_8042E5C: + push {r4-r7,lr} + ldr r7, _08042E90 + ldr r6, _08042E94 + movs r5, 0x2 +_08042E64: + ldr r0, [r7] + adds r4, r0, r6 + ldr r0, [r4] + cmp r0, 0 + blt _08042E82 + bl sub_800E9A8 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _08042E82 + movs r0, 0x1 + negs r0, r0 + str r0, [r4] + str r1, [r4, 0xC] +_08042E82: + adds r6, 0x10 + subs r5, 0x1 + cmp r5, 0 + bge _08042E64 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08042E90: .4byte gUnknown_203B418 +_08042E94: .4byte 0x000005c4 + thumb_func_end sub_8042E5C + + thumb_func_start sub_8042E98 +sub_8042E98: + push {r4,r5,lr} + ldr r5, _08042EC0 + movs r4, 0x1 + negs r4, r4 + movs r3, 0 + ldr r2, _08042EC4 + movs r1, 0x2 +_08042EA6: + ldr r0, [r5] + adds r0, r2 + str r4, [r0] + str r3, [r0, 0x4] + str r3, [r0, 0xC] + adds r2, 0x10 + subs r1, 0x1 + cmp r1, 0 + bge _08042EA6 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08042EC0: .4byte gUnknown_203B418 +_08042EC4: .4byte 0x000005c4 + thumb_func_end sub_8042E98 + + thumb_func_start sub_8042EC8 +sub_8042EC8: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + adds r6, r0, 0 + mov r8, r1 + movs r7, 0 +_08042ED6: + ldr r1, _08042F5C + lsls r0, r7, 4 + ldr r2, _08042F60 + adds r0, r2 + ldr r1, [r1] + adds r4, r1, r0 + ldr r0, [r4] + cmp r0, 0 + blt _08042F4A + ldr r0, [r4, 0xC] + cmp r0, r6 + bne _08042F4A + ldr r0, [r6, 0xC] + cmp r0, 0 + bge _08042EF6 + adds r0, 0xFF +_08042EF6: + lsls r0, 8 + lsrs r0, 16 + ldr r1, _08042F64 + ldr r2, [sp, 0x8] + ands r2, r1 + orrs r2, r0 + str r2, [sp, 0x8] + ldr r1, [r6, 0x10] + cmp r1, 0 + bge _08042F0C + adds r1, 0xFF +_08042F0C: + lsls r1, 8 + lsrs r1, 16 + lsls r1, 16 + ldr r0, _08042F68 + ands r2, r0 + orrs r2, r1 + str r2, [sp, 0x8] + movs r0, 0 + str r0, [sp, 0x4] + ldr r5, [r6, 0x70] + ldr r2, [r4, 0x8] + subs r0, 0x1 + cmp r2, r0 + beq _08042F36 + lsls r2, 24 + lsrs r2, 24 + add r0, sp, 0x4 + adds r1, r6, 0 + adds r1, 0x28 + bl sub_800569C +_08042F36: + ldr r0, [r4] + adds r1, r5, 0 + adds r1, 0x46 + ldrb r1, [r1] + str r1, [sp] + add r1, sp, 0x8 + add r2, sp, 0x4 + mov r3, r8 + bl sub_800EB24 +_08042F4A: + adds r7, 0x1 + cmp r7, 0x2 + ble _08042ED6 + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08042F5C: .4byte gUnknown_203B418 +_08042F60: .4byte 0x000005c4 +_08042F64: .4byte 0xffff0000 +_08042F68: .4byte 0x0000ffff + thumb_func_end sub_8042EC8 + + thumb_func_start sub_8042F6C +sub_8042F6C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + mov r8, r0 + ldr r1, _0804310C + movs r0, 0 + strb r0, [r1] + mov r0, r8 + ldrb r6, [r0, 0x8] + ldrb r1, [r0, 0x11] + mov r9, r1 + ldrb r2, [r0, 0x10] + mov r10, r2 + ldr r0, _08043110 + mov r3, r8 + ldr r1, [r3, 0x74] + str r1, [r0] + ldr r2, _08043114 + ldr r0, [r3, 0x78] + str r0, [r2] + cmp r6, 0 + bne _08042FA0 + strb r6, [r1] +_08042FA0: + ldr r2, [r2] + movs r1, 0 + ldr r4, _08043118 + ldr r5, _0804311C + mov r0, sp + adds r0, 0x4 + str r0, [sp, 0x8] + mov r3, r8 + adds r3, 0x7C + str r3, [sp, 0xC] + movs r3, 0 +_08042FB6: + adds r0, r2, r1 + strb r3, [r0] + adds r1, 0x1 + cmp r1, r4 + bls _08042FB6 + movs r7, 0 + movs r0, 0x64 + strh r0, [r5] + cmp r6, 0 + bne _0804300C + ldr r4, _08043114 + ldr r0, [r4] + mov r5, r8 + ldrb r1, [r5, 0xF] + movs r2, 0xCF + lsls r2, 3 + adds r0, r2 + strb r1, [r0] + ldr r2, [r4] + ldr r3, _08043120 + adds r2, r3 + ldr r0, [r5, 0x14] + ldr r1, [r5, 0x18] + str r0, [r2] + str r1, [r2, 0x4] + ldrb r0, [r5, 0x4] + bl sub_80900D0 + ldr r1, [r4] + ldr r5, _08043124 + adds r2, r1, r5 + strh r0, [r2] + ldr r0, _08043128 + adds r1, r0 + strb r7, [r1] + mov r1, r8 + ldrb r0, [r1, 0x4] + bl sub_8090134 + ldr r1, [r4] + ldr r2, _0804312C + adds r1, r2 + strb r0, [r1] +_0804300C: + ldr r4, _08043114 + ldr r0, [r4] + movs r3, 0xD3 + lsls r3, 3 + adds r0, r3 + strb r7, [r0] + ldr r0, [r4] + ldr r5, _08043130 + adds r0, r5 + strb r7, [r0] + ldr r0, [r4] + mov r2, r8 + ldrb r1, [r2, 0x9] + subs r3, 0x3C + adds r0, r3 + strb r1, [r0] + ldr r0, [r4] + ldrb r1, [r2, 0xC] + subs r5, 0x3F + adds r0, r5 + strb r1, [r0] + ldr r0, [r4] + ldrb r1, [r2, 0xA] + movs r2, 0xCB + lsls r2, 3 + adds r0, r2 + strb r1, [r0] + ldr r0, [r4] + mov r3, r8 + ldrb r1, [r3, 0xB] + subs r5, 0x1 + adds r0, r5 + strb r1, [r0] + ldr r0, [r4] + ldrb r1, [r3, 0xD] + adds r2, 0x3 + adds r0, r2 + strb r1, [r0] + ldr r0, [r4] + ldrb r1, [r3, 0xE] + ldr r3, _08043134 + adds r0, r3 + strb r1, [r0] + bl sub_8083F34 + bl sub_803D4AC + bl sub_804513C + bl sub_8043CD8 + bl sub_80495E4 + bl sub_803E250 + bl sub_8040130 + bl sub_8040124 + movs r0, 0x1 + bl sub_803F27C + ldr r1, _08043138 + ldr r5, _0804313C + adds r0, r5, 0 + strh r0, [r1] + movs r0, 0x1 + movs r1, 0x14 + bl sub_80095CC + movs r0, 0 + bl sub_800DAC0 + movs r0, 0x1 + bl xxx_update_some_bg_tiles + bl sub_803DF60 + bl sub_803E02C + bl sub_8042E98 + ldr r0, _08043140 + strb r7, [r0] + cmp r6, 0 + beq _080430C8 + ldr r0, _08043110 + ldr r0, [r0] + movs r1, 0x90 + lsls r1, 7 + bl sub_8081BF4 + bl sub_8049840 +_080430C8: + mov r0, r9 + cmp r0, 0 + beq _080430D2 + bl sub_8043D60 +_080430D2: + cmp r6, 0 + beq _080430D8 + b _080431DC +_080430D8: + ldr r0, [r4] + ldr r1, _08043144 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r4] + ldr r2, _08043148 + adds r0, r2 + strb r1, [r0] + ldr r2, [r4] + movs r3, 0xCF + lsls r3, 3 + adds r0, r2, r3 + ldrb r3, [r0] + cmp r3, 0x1 + bne _08043154 + mov r5, r8 + ldrb r1, [r5, 0x14] + ldr r5, _0804314C + adds r0, r2, r5 + strb r1, [r0] + ldr r0, [r4] + ldr r1, _08043150 + adds r0, r1 + strb r3, [r0] + b _0804315E + .align 2, 0 +_0804310C: .4byte gUnknown_203B40C +_08043110: .4byte gUnknown_203B41C +_08043114: .4byte gUnknown_203B418 +_08043118: .4byte 0x0001cedb +_0804311C: .4byte gUnknown_203B410 +_08043120: .4byte 0x0000064c +_08043124: .4byte 0x00000666 +_08043128: .4byte 0x0000067a +_0804312C: .4byte 0x0000067b +_08043130: .4byte 0x00000699 +_08043134: .4byte 0x0000065d +_08043138: .4byte gUnknown_2026E4E +_0804313C: .4byte 0x00000808 +_08043140: .4byte gUnknown_202F32C +_08043144: .4byte 0x0001820b +_08043148: .4byte 0x0001820c +_0804314C: .4byte 0x00000644 +_08043150: .4byte 0x00000645 +_08043154: + ldr r3, _0804318C + adds r1, r2, r3 + mov r5, r8 + ldr r0, [r5, 0x4] + str r0, [r1] +_0804315E: + ldr r4, _08043190 + ldr r0, [r4] + ldr r1, _08043194 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + bl sub_8044124 + cmp r6, 0 + bne _080431DC + ldr r1, [r4] + movs r2, 0xCF + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0804319C + ldr r3, _08043198 + adds r1, r3 + mov r5, r8 + ldr r0, [r5, 0x18] + str r0, [r1] + b _080431AC + .align 2, 0 +_0804318C: .4byte 0x00000644 +_08043190: .4byte gUnknown_203B418 +_08043194: .4byte 0x00000674 +_08043198: .4byte 0x0000067c +_0804319C: + bl Random + ldr r2, [r4] + ldr r1, _08043208 + adds r2, r1 + ldr r1, _0804320C + ands r1, r0 + str r1, [r2] +_080431AC: + ldr r4, _08043210 + ldr r0, [r4] + ldr r2, _08043208 + adds r0, r2 + ldr r0, [r0] + bl sub_808408C + cmp r6, 0 + bne _080431DC + bl sub_80980A4 + lsls r0, 24 + cmp r0, 0 + bne _080431D8 + ldr r0, [r4] + ldr r3, _08043214 + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _080431D8 + bl sub_8043FD0 +_080431D8: + bl sub_806890C +_080431DC: + mov r5, r9 + cmp r5, 0 + beq _08043230 + ldr r1, _08043218 + ldr r0, _08043210 + ldr r0, [r0] + ldr r2, _0804321C + adds r0, r2 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + str r0, [r1] + cmp r0, 0 + beq _08043224 + ldr r0, _08043220 + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 + b _08043230 + .align 2, 0 +_08043208: .4byte 0x0000067c +_0804320C: .4byte 0x00ffffff +_08043210: .4byte gUnknown_203B418 +_08043214: .4byte 0x00000644 +_08043218: .4byte gUnknown_202DE30 +_0804321C: .4byte 0x0000067b +_08043220: .4byte gUnknown_80FEC48 +_08043224: + ldr r0, _080432B4 + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 +_08043230: + mov r3, r10 + cmp r3, 0 + beq _0804326A + mov r1, r8 + adds r1, 0x44 + movs r0, 0 + strb r0, [r1] + ldr r0, _080432B8 + ldr r0, [r0] + ldr r5, _080432BC + adds r0, r5 + ldrb r0, [r0] + bl sub_8090104 + lsls r0, 24 + mov r4, r8 + adds r4, 0x1C + cmp r0, 0 + beq _0804325C + adds r0, r4, 0 + bl sub_808D0D8 +_0804325C: + adds r0, r4, 0 + bl sub_8068A84 + cmp r6, 0 + beq _0804326A + bl sub_806B404 +_0804326A: + bl sub_8068614 + cmp r6, 0 + bne _080432F4 + ldr r0, _080432B8 + ldr r0, [r0] + movs r1, 0xCF + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080432F4 + mov r0, sp + bl sub_8099394 + lsls r0, 24 + cmp r0, 0 + beq _080432F4 + mov r0, sp + ldrb r0, [r0] + bl sub_8095228 + adds r2, r0, 0 + adds r2, 0x2C + movs r0, 0 + ldrsb r0, [r2, r0] + cmp r0, 0 + beq _080432E8 + ldr r1, _080432C0 + str r0, [r1] + ldr r0, _080432C4 + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 + b _080432F4 + .align 2, 0 +_080432B4: .4byte gUnknown_80FEC7C +_080432B8: .4byte gUnknown_203B418 +_080432BC: .4byte 0x00000644 +_080432C0: .4byte gUnknown_202DE30 +_080432C4: .4byte gUnknown_81002B8 +_080432C8: + ldr r4, _080432CC + b _080432D2 + .align 2, 0 +_080432CC: .4byte 0x00000226 +_080432D0: + ldr r4, _080432E4 +_080432D2: + bl sub_8083600 + adds r2, r0, 0 + adds r0, r4, 0 + movs r1, 0 + bl sub_8083AB0 + bl _08043AF4 + .align 2, 0 +_080432E4: .4byte 0x00000227 +_080432E8: + ldr r0, _080434B8 + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 +_080432F4: + movs r2, 0 + mov r10, r2 + movs r3, 0 + mov r9, r3 +_080432FC: + bl sub_8098080 + bl nullsub_16 + bl sub_80521D0 + bl sub_80531A8 + bl sub_800F690 + cmp r6, 0 + bne _08043318 + bl sub_804513C +_08043318: + ldr r0, _080434BC + movs r5, 0 + str r5, [r0] + ldr r4, _080434C0 + ldr r0, [r4] + strb r5, [r0] + cmp r6, 0 + bne _08043346 + bl sub_80840A4 + ldr r1, [r4] + movs r3, 0xD0 + lsls r3, 3 + adds r2, r1, r3 + str r0, [r2] + movs r0, 0xCD + lsls r0, 3 + adds r1, r0 + movs r0, 0xA + strh r0, [r1] + ldr r0, [r2] + bl sub_80840D8 +_08043346: + ldr r0, [r4] + ldr r1, _080434C4 + adds r0, r1 + strb r5, [r0] + cmp r6, 0 + bne _08043390 + ldr r0, [r4] + ldr r2, _080434C8 + adds r0, r2 + strb r6, [r0] + movs r0, 0x4 + bl sub_8084100 + ldr r1, [r4] + ldr r3, _080434CC + adds r1, r3 + strb r6, [r1] + ldr r1, [r4] + ldr r2, _080434D0 + adds r1, r2 + strb r6, [r1] + ldr r2, [r4] + ldr r1, _080434D4 + lsls r0, 1 + adds r0, r1 + ldrh r1, [r0] + adds r3, 0x3 + adds r0, r2, r3 + strh r1, [r0] + ldr r0, _080434D8 + adds r2, r0 + mov r1, r10 + strb r1, [r2] + ldr r0, [r4] + ldr r2, _080434DC + adds r0, r2 + strb r1, [r0] +_08043390: + bl sub_803D4D0 + ldr r0, [r4] + strb r5, [r0, 0x1] + ldr r0, [r4] + strb r5, [r0, 0x10] + ldr r0, [r4] + strb r5, [r0, 0x2] + ldr r0, [r4] + strb r5, [r0, 0x4] + ldr r0, [r4] + strb r5, [r0, 0x11] + ldr r0, [r4] + strb r5, [r0, 0x8] + ldr r0, [r4] + strb r5, [r0, 0x3] + ldr r0, [r4] + strb r5, [r0, 0x6] + ldr r0, [r4] + strb r5, [r0, 0xF] + ldr r2, [r4] + movs r3, 0xB8 + lsls r3, 3 + adds r1, r2, r3 + movs r0, 0x1 + negs r0, r0 + str r0, [r1] + strb r5, [r2, 0x7] + ldr r0, [r4] + strb r5, [r0, 0x9] + ldr r0, [r4] + strb r5, [r0, 0xA] + ldr r0, [r4] + movs r1, 0x1 + strb r1, [r0, 0xB] + ldr r0, [r4] + strb r1, [r0, 0xD] + ldr r0, [r4] + strb r5, [r0, 0xE] + ldr r0, [r4] + ldr r2, _080434E0 + adds r0, r2 + strb r5, [r0] + cmp r6, 0 + bne _080434A6 + ldr r0, [r4] + adds r3, 0xB9 + adds r0, r3 + strb r6, [r0] + ldr r1, [r4] + ldr r5, _080434E4 + adds r0, r1, r5 + str r6, [r0] + movs r2, 0xD2 + lsls r2, 3 + adds r0, r1, r2 + str r6, [r0] + adds r3, 0x1B + adds r0, r1, r3 + str r6, [r0] + subs r5, 0x2C + adds r0, r1, r5 + strh r6, [r0] + subs r2, 0x2E + adds r0, r1, r2 + strh r6, [r0] + subs r3, 0x26 + adds r1, r3 + mov r5, r10 + strb r5, [r1] + ldr r0, [r4] + ldr r1, _080434E8 + adds r0, r1 + strb r5, [r0] + ldr r0, [r4] + adds r2, 0xE + adds r0, r2 + strb r5, [r0] + ldr r0, [r4] + adds r3, 0x8 + adds r0, r3 + strb r5, [r0] + ldr r0, [r4] + ldr r5, _080434EC + adds r0, r5 + mov r1, r10 + strb r1, [r0] + ldr r0, [r4] + adds r2, 0x2 + adds r0, r2 + strb r1, [r0] + ldr r1, [r4] + subs r3, 0xC + adds r2, r1, r3 + ldr r0, _080434F0 + strh r0, [r2] + adds r5, 0x17 + adds r0, r1, r5 + strh r6, [r0] + ldr r0, _080434F4 + adds r1, r0 + mov r2, r10 + strb r2, [r1] + ldr r1, [r4] + adds r3, 0x1A + adds r0, r1, r3 + movs r2, 0x63 + strh r2, [r0] + subs r5, 0x2 + adds r0, r1, r5 + strh r2, [r0] + ldr r0, _080434F8 + adds r1, r0 + mov r2, r10 + strb r2, [r1] + ldr r1, [r4] + ldr r3, _080434FC + adds r0, r1, r3 + ldrb r2, [r0] + ldr r5, _08043500 + adds r0, r1, r5 + strh r2, [r0] + ldr r2, _08043504 + adds r0, r1, r2 + ldrb r2, [r0] + ldr r3, _08043508 + adds r0, r1, r3 + strh r2, [r0] + ldr r5, _0804350C + adds r0, r1, r5 + ldrb r0, [r0] + ldr r2, _08043510 + adds r1, r2 + strh r0, [r1] + movs r0, 0 + bl sub_807E5E4 + bl sub_80842F0 +_080434A6: + bl sub_803D8F0 + bl sub_8068658 + cmp r6, 0 + bne _08043514 + bl sub_80687AC + b _0804351C + .align 2, 0 +_080434B8: .4byte gUnknown_81002D8 +_080434BC: .4byte gUnknown_203B450 +_080434C0: .4byte gUnknown_203B418 +_080434C4: .4byte 0x000037ec +_080434C8: .4byte 0x000037fc +_080434CC: .4byte 0x000037fd +_080434D0: .4byte 0x000037fe +_080434D4: .4byte gUnknown_80F6850 +_080434D8: .4byte 0x000037ff +_080434DC: .4byte 0x00000675 +_080434E0: .4byte 0x0001c05e +_080434E4: .4byte 0x0000068c +_080434E8: .4byte 0x0000066f +_080434EC: .4byte 0x00000671 +_080434F0: .4byte 0x000003e7 +_080434F4: .4byte 0x0000068a +_080434F8: .4byte 0x0000e264 +_080434FC: .4byte 0x0001c576 +_08043500: .4byte 0x00003a0e +_08043504: .4byte 0x0001c577 +_08043508: .4byte 0x00003a10 +_0804350C: .4byte 0x0001c586 +_08043510: .4byte 0x00003a14 +_08043514: + bl sub_8068768 + bl sub_8082B40 +_0804351C: + bl sub_806C42C + bl sub_806AD3C + cmp r6, 0 + bne _08043544 + ldr r1, _080435B4 + ldr r3, _080435B8 + ldr r0, [r3] + ldr r5, _080435BC + adds r0, r5 + movs r2, 0 + ldrsh r0, [r0, r2] + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] + bl sub_8083E88 + bl sub_80847D4 +_08043544: + bl sub_8049840 + bl sub_803E178 + ldr r0, _080435C0 + mov r3, r9 + str r3, [r0] + bl sub_8040124 + movs r0, 0x4 + movs r1, 0 + bl sub_803EAF0 + movs r0, 0 + bl sub_8052210 + adds r0, r6, 0 + bl sub_803F27C + bl sub_803DA7C + cmp r6, 0 + bne _08043594 + bl sub_804AFAC + ldr r5, _080435B8 + ldr r0, [r5] + ldr r1, _080435C4 + adds r0, r1 + ldrb r0, [r0] + bl sub_80900D0 + ldr r2, [r5] + ldr r3, _080435C8 + adds r1, r2, r3 + strh r0, [r1] + ldr r5, _080435CC + adds r2, r5 + mov r0, r10 + strb r0, [r2] +_08043594: + bl sub_804AAD4 + bl sub_8049B8C + bl sub_804966C + cmp r6, 0 + bne _080435D0 + bl sub_806B168 + bl sub_806C3C0 + bl sub_806B6C4 + b _080435D4 + .align 2, 0 +_080435B4: .4byte gUnknown_80F5668 +_080435B8: .4byte gUnknown_203B418 +_080435BC: .4byte 0x00003a10 +_080435C0: .4byte gUnknown_202EDC8 +_080435C4: .4byte 0x00000644 +_080435C8: .4byte 0x00000666 +_080435CC: .4byte 0x0000067a +_080435D0: + bl sub_806B678 +_080435D4: + ldr r4, _0804362C + ldr r1, [r4] + ldr r2, _08043630 + adds r0, r1, r2 + mov r3, r9 + str r3, [r0] + ldr r5, _08043634 + adds r0, r1, r5 + str r3, [r0] + adds r2, 0x4 + adds r0, r1, r2 + str r3, [r0] + ldr r3, _08043638 + adds r0, r1, r3 + mov r5, r9 + str r5, [r0] + adds r2, 0x4 + adds r0, r1, r2 + str r5, [r0] + adds r3, 0x4 + adds r1, r3 + str r5, [r1] + cmp r6, 0 + bne _08043644 + bl sub_807FA18 + bl sub_8045CB0 + ldr r1, [r4] + ldr r5, _0804363C + adds r2, r1, r5 + ldr r3, _08043640 + adds r0, r1, r3 + ldr r0, [r0] + str r0, [r2] + subs r5, 0x4 + adds r1, r5 + str r6, [r1] + bl sub_8051E3C + bl sub_804AAAC + b _08043648 + .align 2, 0 +_0804362C: .4byte gUnknown_203B418 +_08043630: .4byte 0x00017b2c +_08043634: .4byte 0x00017b38 +_08043638: .4byte 0x00017b3c +_0804363C: .4byte 0x00000694 +_08043640: .4byte 0x0000068c +_08043644: + bl sub_806A338 +_08043648: + bl sub_8068F80 + bl sub_8049884 + bl sub_8049ED4 + cmp r6, 0 + bne _08043664 + movs r0, 0x1 + movs r1, 0 + movs r2, 0 + bl sub_806A914 + b _0804366C +_08043664: + bl sub_806CF60 + bl sub_806A974 +_0804366C: + movs r0, 0x1 + bl sub_8041888 + cmp r6, 0 + bne _0804367E + bl sub_80848F0 + bl sub_8097890 +_0804367E: + ldr r0, _080436A0 + movs r1, 0x1 + strb r1, [r0] + cmp r6, 0 + beq _08043690 + bl sub_807E88C + bl sub_806AB2C +_08043690: + ldr r2, _080436A4 + ldr r0, [r2] + ldrb r0, [r0, 0x7] + cmp r0, 0 + bne _080436A8 + bl sub_803E748 + b _080436AC + .align 2, 0 +_080436A0: .4byte gUnknown_203B40C +_080436A4: .4byte gUnknown_203B418 +_080436A8: + bl sub_803E7C8 +_080436AC: + movs r0, 0 + bl sub_8040094 + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + adds r0, r6, 0 + bl sub_8040150 + bl sub_8040A84 + ldr r4, _08043730 + ldr r1, [r4] + adds r0, r1, 0 + adds r0, 0xB8 + mov r3, r9 + str r3, [r0] + ldr r5, _08043734 + adds r1, r5 + strb r3, [r1] + ldr r0, [r4] + ldr r1, _08043738 + adds r0, r1 + mov r2, r9 + strb r2, [r0] + ldr r1, [r4] + movs r5, 0 + movs r0, 0x63 + strh r0, [r1, 0x12] + movs r3, 0x1 + strb r3, [r1] + cmp r6, 0 + bne _08043706 + bl sub_8052DD0 + ldr r1, [r4] + ldrb r0, [r1, 0x9] + cmp r0, 0 + beq _08043706 + strb r5, [r1, 0x9] + bl sub_8083D68 + bl sub_8052F80 +_08043706: + ldr r0, _0804373C + mov r5, r9 + str r5, [r0] + ldr r4, _08043730 + ldr r0, [r4] + strb r5, [r0, 0x5] + cmp r6, 0 + bne _08043778 + bl sub_8084B64 + ldr r1, [r4] + ldrb r0, [r1, 0x4] + cmp r0, 0 + bne _08043728 + ldrb r0, [r1, 0x2] + cmp r0, 0 + beq _08043740 +_08043728: + movs r0, 0x1 + strb r0, [r1, 0x5] + b _0804374C + .align 2, 0 +_08043730: .4byte gUnknown_203B418 +_08043734: .4byte 0x0000066c +_08043738: .4byte 0x0000066d +_0804373C: .4byte gUnknown_203B450 +_08043740: + bl sub_8083600 + bl sub_803F4A0 + bl sub_8040A84 +_0804374C: + cmp r6, 0 + bne _08043778 + ldr r1, _08043774 + ldr r0, [r1] + ldrb r0, [r0, 0x5] + cmp r0, 0 + bne _0804377C + bl sub_807E5AC + movs r0, 0 + bl sub_807E580 + lsls r0, 24 + cmp r0, 0 + beq _0804377C + movs r0, 0x1 + bl sub_807E7FC + b _0804377C + .align 2, 0 +_08043774: .4byte gUnknown_203B418 +_08043778: + bl sub_8069E8C +_0804377C: + cmp r6, 0 + beq _08043784 + movs r6, 0 + b _080437A2 +_08043784: + bl sub_80427AC + bl sub_8083600 + ldr r2, _08043960 + ldr r1, [r2] + ldr r3, _08043964 + adds r1, r3 + ldrb r1, [r1] + bl sub_8075900 + movs r0, 0x1 + movs r1, 0 + bl sub_807EAA0 +_080437A2: + bl nullsub_16 + ldr r2, _08043960 + ldr r0, [r2] + ldrb r1, [r0, 0x5] + cmp r1, 0 + bne _080437DA + movs r4, 0x1 + ldr r5, _08043968 + adds r0, r5 + strb r1, [r0] + ldr r0, [r2] + ldr r3, _0804396C + adds r0, r3 + strb r1, [r0] + ldr r0, [r2] + ldr r5, _08043970 + adds r0, r5 + strb r4, [r0] +_080437C8: + adds r0, r4, 0 + bl sub_804423C + movs r4, 0 + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _080437C8 +_080437DA: + bl sub_8083600 + adds r4, r0, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080437F0 + adds r0, r4, 0 + bl sub_8071DA4 +_080437F0: + ldr r5, _08043960 + ldr r0, [r5] + ldr r4, _08043968 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08043822 + movs r0, 0x1 + bl sub_8043ED0 + lsls r0, 24 + cmp r0, 0 + beq _08043812 + ldr r0, [r5] + adds r0, r4 + movs r1, 0x1 + strb r1, [r0] +_08043812: + ldr r1, [r5] + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08043822 + ldrb r0, [r1, 0x11] + cmp r0, 0 + beq _08043830 +_08043822: + ldr r2, _08043960 + ldr r0, [r2] + ldrb r0, [r0, 0x6] + cmp r0, 0 + bne _08043830 + bl sub_806AA70 +_08043830: + bl sub_8083600 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0804384A + movs r0, 0x4F + bl sub_80526D0 + movs r0, 0x4F + bl sub_8052740 +_0804384A: + bl sub_8040124 + movs r0, 0x1 + movs r1, 0 + bl sub_803EAF0 + ldr r3, _08043960 + ldr r0, [r3] + ldr r5, _08043970 + adds r0, r5 + mov r1, r9 + strb r1, [r0] + ldr r0, [r3] + ldr r2, _0804396C + adds r0, r2 + movs r3, 0x1 + strb r3, [r0] + ldr r5, _08043960 + ldr r1, [r5] + ldrb r0, [r1, 0x3] + cmp r0, 0 + bne _08043896 + ldrb r0, [r1, 0x6] + cmp r0, 0 + bne _08043896 + ldr r2, _08043974 + adds r0, r1, r2 + ldrh r0, [r0] + cmp r0, 0x72 + bne _08043896 + ldr r3, _08043978 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0x1B + bne _08043896 + movs r0, 0x3C + bl sub_8083ED8 +_08043896: + movs r0, 0x4 + movs r1, 0x4F + bl sub_803E708 + ldr r5, _08043960 + ldr r0, [r5] + ldrb r0, [r0, 0x7] + cmp r0, 0 + bne _080438AC + bl sub_803E830 +_080438AC: + movs r0, 0 + bl SetBGOBJEnableFlags + ldr r1, _0804397C + ldr r0, [sp, 0x4] + ands r0, r1 + movs r1, 0x60 + orrs r0, r1 + ldr r1, _08043980 + ands r0, r1 + movs r1, 0x80 + lsls r1, 8 + orrs r0, r1 + ldr r1, _08043984 + ands r0, r1 + movs r1, 0xF8 + lsls r1, 16 + orrs r0, r1 + str r0, [sp, 0x4] + ldr r0, _08043988 + ldr r2, [r0] + movs r0, 0xFD + ldr r1, [sp, 0x8] + movs r3, 0 + bl SetBGPaletteBufferColorRGB + movs r0, 0x1 + bl sub_8040094 + ldr r0, [r5] + ldr r1, _0804396C + adds r0, r1 + movs r7, 0 + movs r2, 0x1 + strb r2, [r0] + ldr r1, [r5] + ldrb r0, [r1, 0x10] + subs r0, 0x2 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _08043926 + ldrb r0, [r1, 0x6] + cmp r0, 0 + beq _08043926 + bl sub_8083600 + adds r4, r0, 0 + ldr r0, _0804398C + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 + ldr r0, [r5] + strb r7, [r0, 0x6] + ldr r0, _08043990 + adds r1, r4, 0 + adds r2, r4, 0 + bl sub_8083AB0 +_08043926: + bl sub_80688CC + bl sub_8049820 + ldr r0, _08043994 + ldr r0, [r0] + bl sub_800AA14 + bl sub_800F740 + ldr r0, _08043998 + mov r3, r10 + strb r3, [r0] + ldr r4, _08043960 + ldr r1, [r4] + ldrb r0, [r1, 0x3] + cmp r0, 0 + beq _0804394C + b _08043BFC +_0804394C: + ldrb r0, [r1, 0x6] + cmp r0, 0 + beq _080439A0 + ldr r0, _0804399C + ldr r0, [r0] + movs r1, 0x90 + lsls r1, 7 + bl sub_8080B30 + b _080439A6 + .align 2, 0 +_08043960: .4byte gUnknown_203B418 +_08043964: .4byte 0x00003a08 +_08043968: .4byte 0x00000654 +_0804396C: .4byte 0x00018218 +_08043970: .4byte 0x00018219 +_08043974: .4byte 0x0001ceda +_08043978: .4byte 0x00000644 +_0804397C: .4byte 0xffffff00 +_08043980: .4byte 0xffff00ff +_08043984: .4byte 0xff00ffff +_08043988: .4byte gUnknown_202EDC8 +_0804398C: .4byte gUnknown_81006A4 +_08043990: .4byte 0x00000222 +_08043994: .4byte gUnknown_202EC88 +_08043998: .4byte gUnknown_203B40C +_0804399C: .4byte gUnknown_203B41C +_080439A0: + movs r0, 0x2 + bl sub_8046F84 +_080439A6: + bl sub_806C1D8 + ldr r4, _080439CC + ldr r1, [r4] + ldr r5, _080439D0 + adds r0, r1, r5 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080439D4 + adds r5, 0x1A + adds r0, r1, r5 + ldrb r0, [r0] + cmp r0, 0 + bne _080439C4 + b _08043AF4 +_080439C4: + bl sub_804700C + b _08043AF4 + .align 2, 0 +_080439CC: .4byte gUnknown_203B418 +_080439D0: .4byte 0x00000654 +_080439D4: + ldrb r0, [r1, 0x11] + cmp r0, 0x1 + bne _080439DC + b _080432C8 +_080439DC: + cmp r0, 0x2 + bne _08043A00 + bl sub_8083600 + adds r2, r0, 0 + ldr r0, _080439F8 + movs r1, 0 + bl sub_8083AB0 + ldr r0, [r4] + ldr r1, _080439FC + adds r0, r1 + b _08043A62 + .align 2, 0 +_080439F8: .4byte 0x00000229 +_080439FC: .4byte 0x0000066e +_08043A00: + cmp r0, 0x3 + bne _08043A24 + bl sub_8083600 + adds r2, r0, 0 + ldr r0, _08043A1C + movs r1, 0 + bl sub_8083AB0 + ldr r0, [r4] + ldr r2, _08043A20 + adds r0, r2 + b _08043A62 + .align 2, 0 +_08043A1C: .4byte 0x0000022a +_08043A20: .4byte 0x0000066e +_08043A24: + cmp r0, 0x4 + bne _08043A2A + b _080432D0 +_08043A2A: + movs r3, 0xCF + lsls r3, 3 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08043A74 + bl sub_8043D10 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08043A74 + ldr r0, [r4] + adds r0, r5 + ldrb r0, [r0] + cmp r0, 0x2 + bne _08043A74 + bl sub_8083600 + adds r2, r0, 0 + movs r0, 0x8A + lsls r0, 2 + movs r1, 0 + bl sub_8083AB0 + ldr r0, [r4] + ldr r5, _08043A70 + adds r0, r5 +_08043A62: + ldrb r0, [r0] + cmp r0, 0 + beq _08043AF4 + bl sub_8097810 + b _08043AF4 + .align 2, 0 +_08043A70: .4byte 0x0000066e +_08043A74: + ldr r4, _08043ACC + ldr r0, [r4] + ldr r1, _08043AD0 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08043A86 + bl sub_8097810 +_08043A86: + ldr r1, [r4] + ldr r3, _08043AD4 + adds r2, r1, r3 + ldrb r0, [r2] + adds r0, 0x1 + ldr r5, _08043AD8 + adds r1, r5 + ldrb r1, [r1] + cmp r0, r1 + bge _08043AE4 + strb r0, [r2] + ldr r0, [r4] + ldr r1, _08043ADC + adds r0, r1 + ldrh r1, [r0] + ldr r0, _08043AE0 + cmp r1, r0 + beq _08043AAC + b _080432FC +_08043AAC: + movs r0, 0x1F + bl sub_8098100 + lsls r0, 24 + cmp r0, 0 + beq _08043ABA + b _080432FC +_08043ABA: + movs r0, 0x1F + bl sub_8097FA8 + bl sub_8086130 + bl sub_8097FF8 + b _080432FC + .align 2, 0 +_08043ACC: .4byte gUnknown_203B418 +_08043AD0: .4byte 0x0000066e +_08043AD4: .4byte 0x00000645 +_08043AD8: .4byte 0x0001cec8 +_08043ADC: .4byte 0x00000644 +_08043AE0: .4byte 0x0000060b +_08043AE4: + ldr r4, _08043B80 + bl sub_8083600 + adds r2, r0, 0 + adds r0, r4, 0 + movs r1, 0 + bl sub_8083AB0 +_08043AF4: + ldr r1, _08043B84 + movs r0, 0 + strb r0, [r1] + mov r4, r8 + adds r4, 0x7E + movs r0, 0 + strb r0, [r4] + bl sub_8097FF8 + movs r0, 0x1 + movs r1, 0x14 + bl sub_80095CC + bl sub_803E13C + movs r0, 0x4 + bl sub_800CDA8 + ldr r0, _08043B88 + ldr r1, [r0] + ldrb r0, [r1, 0x6] + cmp r0, 0 + bne _08043B38 + movs r2, 0xCF + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + bl sub_8083C88 + lsls r0, 24 + cmp r0, 0 + beq _08043B38 + bl sub_80841EC +_08043B38: + bl sub_8083C24 + lsls r0, 24 + cmp r0, 0 + beq _08043BA4 + ldr r5, _08043B88 + ldr r0, [r5] + ldrb r0, [r0, 0x6] + cmp r0, 0 + beq _08043B98 + ldr r0, _08043B8C + ldr r3, [sp, 0xC] + strh r0, [r3] + mov r4, r8 + adds r4, 0x84 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x8 + bl memset + mov r3, r8 + adds r3, 0x80 + ldr r1, [r5] + ldr r5, _08043B90 + adds r2, r1, r5 + ldr r0, [r2] + str r0, [r3] + ldr r0, [r2] + str r0, [r4] + mov r2, r8 + adds r2, 0x88 + ldr r0, _08043B94 + adds r1, r0 + ldr r0, [r1] + str r0, [r2] + b _08043C32 + .align 2, 0 +_08043B80: .4byte 0x00000227 +_08043B84: .4byte gUnknown_203B40C +_08043B88: .4byte gUnknown_203B418 +_08043B8C: .4byte 0x0000fffe +_08043B90: .4byte 0x00000644 +_08043B94: .4byte 0x0000067c +_08043B98: + ldr r0, _08043BA0 + ldr r1, [sp, 0xC] + strh r0, [r1] + b _08043C32 + .align 2, 0 +_08043BA0: .4byte 0x0000ffff +_08043BA4: + bl sub_8083C50 + lsls r0, 24 + cmp r0, 0 + beq _08043C28 + ldr r0, _08043BC8 + ldr r0, [r0] + movs r2, 0xCF + lsls r2, 3 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08043BCC + movs r0, 0x4 + ldr r3, [sp, 0xC] + strh r0, [r3] + b _08043BE6 + .align 2, 0 +_08043BC8: .4byte gUnknown_203B418 +_08043BCC: + cmp r0, 0 + bne _08043BDC + movs r0, 0x1 + ldr r5, [sp, 0xC] + strh r0, [r5] + bl sub_8084424 + b _08043BE6 +_08043BDC: + movs r0, 0x1 + ldr r1, [sp, 0xC] + strh r0, [r1] + bl sub_8084424 +_08043BE6: + ldr r0, _08043BF4 + ldr r0, [r0] + ldr r2, _08043BF8 + adds r0, r2 + ldrb r0, [r0] + strb r0, [r4] + b _08043C32 + .align 2, 0 +_08043BF4: .4byte gUnknown_203B418 +_08043BF8: .4byte 0x00000674 +_08043BFC: + ldr r0, _08043C20 + ldr r0, [r0] + movs r1, 0x90 + lsls r1, 7 + bl sub_8080B30 + movs r0, 0x3 + ldr r3, [sp, 0xC] + strh r0, [r3] + mov r1, r8 + adds r1, 0x80 + ldr r0, [r4] + ldr r5, _08043C24 + adds r0, r5 + ldr r0, [r0] + str r0, [r1] + b _08043C32 + .align 2, 0 +_08043C20: .4byte gUnknown_203B41C +_08043C24: .4byte 0x00000644 +_08043C28: + movs r0, 0x2 + ldr r1, [sp, 0xC] + strh r0, [r1] + bl sub_8084424 +_08043C32: + bl sub_806863C + bl sub_803E214 + bl nullsub_56 + bl sub_8040218 + ldr r2, [sp, 0xC] + movs r3, 0 + ldrsh r0, [r2, r3] + cmp r0, 0x1 + beq _08043C54 + cmp r0, 0x4 + beq _08043C54 + cmp r0, 0x2 + bne _08043C58 +_08043C54: + bl sub_8047104 +_08043C58: + ldr r5, [sp, 0xC] + movs r0, 0 + ldrsh r1, [r5, r0] + cmp r1, 0x1 + beq _08043C8A + movs r0, 0x2 + negs r0, r0 + cmp r1, r0 + beq _08043C78 + cmp r1, 0x4 + beq _08043C78 + adds r0, 0x1 + cmp r1, r0 + beq _08043C78 + cmp r1, 0x2 + bne _08043CAC +_08043C78: + ldr r2, [sp, 0xC] + movs r3, 0 + ldrsh r1, [r2, r3] + cmp r1, 0x1 + beq _08043C8A + cmp r1, 0x4 + beq _08043C8A + cmp r1, 0x2 + bne _08043C92 +_08043C8A: + movs r0, 0x1 + bl sub_8068BDC + b _08043CAC +_08043C92: + movs r0, 0x2 + negs r0, r0 + cmp r1, r0 + bne _08043CA2 + movs r0, 0 + bl sub_8068BDC + b _08043CAC +_08043CA2: + bl sub_8068F28 + movs r0, 0 + bl sub_8068BDC +_08043CAC: + bl sub_800DB7C + ldr r0, _08043CD0 + movs r1, 0 + str r1, [r0] + ldr r0, _08043CD4 + str r1, [r0] + bl nullsub_16 + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08043CD0: .4byte gUnknown_203B418 +_08043CD4: .4byte gUnknown_203B41C + thumb_func_end sub_8042F6C + + thumb_func_start sub_8043CD8 +sub_8043CD8: + push {lr} + bl sub_8009804 + pop {r0} + bx r0 + thumb_func_end sub_8043CD8 + + thumb_func_start sub_8043CE4 +sub_8043CE4: + push {lr} + adds r1, r0, 0 + ldr r0, _08043CF4 + ldrb r0, [r0] + cmp r0, 0 + beq _08043CF8 + movs r0, 0x1 + b _08043D08 + .align 2, 0 +_08043CF4: .4byte gUnknown_202F1A8 +_08043CF8: + movs r2, 0 + ldr r0, _08043D0C + adds r0, r1, r0 + ldrb r0, [r0] + cmp r0, 0x2 + bne _08043D06 + movs r2, 0x1 +_08043D06: + adds r0, r2, 0 +_08043D08: + pop {r1} + bx r1 + .align 2, 0 +_08043D0C: .4byte gUnknown_810ACC0 + thumb_func_end sub_8043CE4 + + thumb_func_start sub_8043D10 +sub_8043D10: + push {lr} + ldr r0, _08043D38 + ldr r1, [r0] + movs r2, 0xCF + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08043D3C + subs r2, 0x2B + adds r0, r1, r2 + subs r2, 0x8 + adds r1, r2 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bne _08043D3C + movs r0, 0x2 + b _08043D4C + .align 2, 0 +_08043D38: .4byte gUnknown_203B418 +_08043D3C: + bl sub_80441BC + lsls r0, 24 + cmp r0, 0 + bne _08043D4A + movs r0, 0 + b _08043D4C +_08043D4A: + movs r0, 0x1 +_08043D4C: + pop {r1} + bx r1 + thumb_func_end sub_8043D10 + + thumb_func_start sub_8043D50 +sub_8043D50: + ldr r2, _08043D5C + str r2, [r1] + movs r1, 0x90 + lsls r1, 7 + str r1, [r0] + bx lr + .align 2, 0 +_08043D5C: .4byte 0x0001cedc + thumb_func_end sub_8043D50 + + thumb_func_start sub_8043D60 +sub_8043D60: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r5, 0 +_08043D6A: + ldr r0, _08043DA4 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _08043DA8 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08043DCE + ldr r2, [r4, 0x70] + movs r1, 0x1 + ldrb r0, [r2, 0x8] + eors r0, r1 + negs r1, r0 + orrs r1, r0 + lsrs r1, 31 + adds r0, r2, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x4A + beq _08043DA0 + cmp r0, 0x47 + bne _08043DAC +_08043DA0: + movs r0, 0x1 + b _08043DAE + .align 2, 0 +_08043DA4: .4byte gUnknown_203B418 +_08043DA8: .4byte 0x0001358c +_08043DAC: + movs r0, 0 +_08043DAE: + cmp r0, 0 + beq _08043DB4 + movs r1, 0 +_08043DB4: + adds r0, r2, 0 + adds r0, 0xA4 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08043DC0 + movs r1, 0 +_08043DC0: + cmp r1, 0 + beq _08043DCE + adds r0, r4, 0 + ldr r1, _08043EC0 + adds r2, r4, 0 + bl sub_8068FE0 +_08043DCE: + adds r5, 0x1 + cmp r5, 0xF + ble _08043D6A + movs r5, 0 + ldr r0, _08043EC4 + mov r9, r0 + mov r8, r5 +_08043DDC: + mov r1, r9 + ldr r0, [r1] + lsls r1, r5, 2 + ldr r2, _08043EC8 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + adds r7, r5, 0x1 + cmp r0, 0 + beq _08043E62 + adds r0, r4, 0 + adds r0, 0x22 + mov r1, r8 + strb r1, [r0] + adds r1, r4, 0 + adds r1, 0x20 + movs r0, 0x1 + strb r0, [r1] + ldr r4, [r4, 0x70] + ldrh r0, [r4, 0x10] + strh r0, [r4, 0xE] + movs r2, 0x9E + lsls r2, 1 + adds r1, r4, r2 + adds r2, 0x4 + adds r0, r4, r2 + ldr r0, [r0] + str r0, [r1] + mov r1, r9 + ldr r0, [r1] + ldr r2, _08043ECC + adds r0, r2 + mov r1, r8 + strb r1, [r0] + adds r0, r4, 0 + movs r1, 0 + bl sub_806BFC0 + ldrh r0, [r4, 0x2] + strh r0, [r4, 0x4] + adds r0, r4, 0 + adds r0, 0xFD + mov r2, r8 + strb r2, [r0] + movs r0, 0x8C + lsls r0, 1 + adds r5, r4, r0 + adds r4, r5, 0 + movs r6, 0x3 +_08043E46: + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08043E58 + adds r0, r5, 0 + bl sub_8092BF4 + strb r0, [r4, 0x4] +_08043E58: + adds r4, 0x8 + adds r5, 0x8 + subs r6, 0x1 + cmp r6, 0 + bge _08043E46 +_08043E62: + adds r5, r7, 0 + cmp r5, 0x3 + ble _08043DDC + movs r6, 0 +_08043E6A: + movs r5, 0 + adds r7, r6, 0x1 +_08043E6E: + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_8049590 + ldr r4, [r0, 0x14] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08043EA0 + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0x2 + bne _08043EA0 + adds r0, r4, 0 + bl sub_8045104 + adds r1, r0, 0 + ldrb r0, [r1] + cmp r0, 0x1B + bne _08043EA0 + movs r0, 0x5 + strb r0, [r1] +_08043EA0: + adds r5, 0x1 + cmp r5, 0x37 + ble _08043E6E + adds r6, r7, 0 + cmp r6, 0x1F + ble _08043E6A + movs r0, 0x2 + bl sub_8046F84 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08043EC0: .4byte 0x00000207 +_08043EC4: .4byte gUnknown_203B418 +_08043EC8: .4byte 0x0001357c +_08043ECC: .4byte 0x00000676 + thumb_func_end sub_8043D60 + + thumb_func_start sub_8043ED0 +sub_8043ED0: + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r7, 0 + cmp r5, 0 + bne _08043EEA + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _08043EEA + movs r0, 0 + b _08043FB8 +_08043EEA: + ldr r6, _08043F2C + ldr r0, [r6] + ldrb r0, [r0, 0x10] + cmp r0, 0x1 + bne _08043F40 + bl sub_8083600 + adds r4, r0, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08043FB6 + cmp r5, 0 + bne _08043F20 + ldr r0, _08043F30 + ldr r1, [r6] + ldr r2, _08043F34 + adds r1, r2 + bl strcpy + ldr r0, _08043F38 + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 +_08043F20: + adds r0, r4, 0 + bl sub_8042B0C + ldr r1, _08043F3C + b _08043FAC + .align 2, 0 +_08043F2C: .4byte gUnknown_203B418 +_08043F30: .4byte gUnknown_202DF98 +_08043F34: .4byte 0x000005f4 +_08043F38: .4byte gUnknown_80F89B4 +_08043F3C: .4byte 0x0000021f +_08043F40: + cmp r0, 0x2 + bne _08043F74 + bl sub_8083600 + adds r4, r0, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08043FB6 + cmp r5, 0 + bne _08043FA4 + ldr r0, _08043F68 + ldr r1, [r6] + ldr r2, _08043F6C + adds r1, r2 + bl strcpy + ldr r0, _08043F70 + b _08043F9A + .align 2, 0 +_08043F68: .4byte gUnknown_202DF98 +_08043F6C: .4byte 0x000005f4 +_08043F70: .4byte gUnknown_80F89D4 +_08043F74: + cmp r0, 0x3 + bne _08043FB6 + bl sub_8083600 + adds r4, r0, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08043FB6 + cmp r5, 0 + bne _08043FA4 + ldr r0, _08043FC0 + ldr r1, [r6] + ldr r2, _08043FC4 + adds r1, r2 + bl strcpy + ldr r0, _08043FC8 +_08043F9A: + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 +_08043FA4: + adds r0, r4, 0 + bl sub_8042B0C + ldr r1, _08043FCC +_08043FAC: + adds r0, r4, 0 + adds r2, r4, 0 + bl sub_8068FE0 + movs r7, 0x1 +_08043FB6: + adds r0, r7, 0 +_08043FB8: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08043FC0: .4byte gUnknown_202DF98 +_08043FC4: .4byte 0x000005f4 +_08043FC8: .4byte gUnknown_80F89D8 +_08043FCC: .4byte 0x00000222 + thumb_func_end sub_8043ED0 + + thumb_func_start sub_8043FD0 +sub_8043FD0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x44 + movs r0, 0x2 + mov r9, r0 + movs r1, 0x1 + mov r10, r1 + movs r0, 0xFF + mov r8, r0 +_08043FE8: + movs r3, 0 + mov r1, r9 + adds r1, 0x1 + str r1, [sp, 0x3C] +_08043FF0: + ldr r2, _080440E4 + movs r0, 0x58 + adds r1, r3, 0 + muls r1, r0 + ldr r0, [r2] + adds r4, r0, r1 + ldrh r1, [r4] + mov r0, r10 + ands r0, r1 + adds r3, 0x1 + str r3, [sp, 0x40] + cmp r0, 0 + beq _080440FE + lsrs r0, r1, 1 + mov r1, r10 + ands r0, r1 + cmp r0, 0 + beq _080440FE + add r5, sp, 0x20 + movs r0, 0x8 + ldrsh r1, [r4, r0] + adds r0, r5, 0 + mov r2, r9 + bl sub_808E010 + mov r1, r9 + strb r1, [r4, 0x3] + ldr r0, [sp, 0x20] + str r0, [r4, 0x1C] + ldrh r0, [r5, 0x4] + ldrh r1, [r4, 0x16] + adds r0, r1 + movs r2, 0 + strh r0, [r4, 0x16] + lsls r0, 16 + ldr r1, _080440E8 + cmp r0, r1 + ble _08044040 + ldr r0, _080440EC + strh r0, [r4, 0x16] +_08044040: + ldrb r0, [r4, 0x18] + str r0, [sp, 0x2C] + ldrb r0, [r4, 0x19] + str r0, [sp, 0x30] + ldrb r0, [r4, 0x1A] + str r0, [sp, 0x34] + ldrb r0, [r4, 0x1B] + str r0, [sp, 0x38] + ldrb r1, [r5, 0x6] + ldr r0, [sp, 0x2C] + adds r0, r1 + str r0, [sp, 0x2C] + ldrb r1, [r5, 0x7] + ldr r0, [sp, 0x30] + adds r0, r1 + str r0, [sp, 0x30] + ldrb r1, [r5, 0x8] + ldr r0, [sp, 0x34] + adds r0, r1 + str r0, [sp, 0x34] + ldrb r1, [r5, 0x9] + ldr r0, [sp, 0x38] + adds r0, r1 + str r0, [sp, 0x38] + ldr r0, [sp, 0x2C] + cmp r0, 0xFE + ble _0804407A + mov r0, r8 + str r0, [sp, 0x2C] +_0804407A: + ldr r0, [sp, 0x30] + cmp r0, 0xFE + ble _08044084 + mov r1, r8 + str r1, [sp, 0x30] +_08044084: + ldr r0, [sp, 0x34] + cmp r0, 0xFE + ble _0804408E + mov r0, r8 + str r0, [sp, 0x34] +_0804408E: + ldr r0, [sp, 0x38] + cmp r0, 0xFE + ble _08044098 + mov r1, r8 + str r1, [sp, 0x38] +_08044098: + ldr r0, [sp, 0x2C] + strb r0, [r4, 0x18] + ldr r0, [sp, 0x30] + strb r0, [r4, 0x19] + ldr r0, [sp, 0x34] + strb r0, [r4, 0x1A] + ldr r0, [sp, 0x38] + strb r0, [r4, 0x1B] + movs r0, 0x8 + ldrsh r1, [r4, r0] + ldrb r2, [r4, 0x3] + mov r0, sp + ldr r3, _080440EC + bl sub_808E0AC + adds r6, r0, 0 + cmp r6, 0 + beq _080440FE + movs r0, 0 + cmp r0, r6 + bge _080440FE +_080440C2: + movs r3, 0 + adds r7, r0, 0x1 + lsls r0, 1 + mov r1, sp + adds r5, r1, r0 + adds r2, r4, 0 + adds r2, 0x2C +_080440D0: + ldrb r1, [r2] + mov r0, r10 + ands r0, r1 + cmp r0, 0 + bne _080440F0 + ldrh r1, [r5] + adds r0, r2, 0 + bl sub_8092AD4 + b _080440F8 + .align 2, 0 +_080440E4: .4byte gUnknown_203B45C +_080440E8: .4byte 0x03e60000 +_080440EC: .4byte 0x000003e7 +_080440F0: + adds r2, 0x8 + adds r3, 0x1 + cmp r3, 0x3 + ble _080440D0 +_080440F8: + adds r0, r7, 0 + cmp r0, r6 + blt _080440C2 +_080440FE: + ldr r3, [sp, 0x40] + movs r0, 0xCE + lsls r0, 1 + cmp r3, r0 + bgt _0804410A + b _08043FF0 +_0804410A: + ldr r0, [sp, 0x3C] + mov r9, r0 + cmp r0, 0x5 + bgt _08044114 + b _08043FE8 +_08044114: + add sp, 0x44 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8043FD0 + + thumb_func_start sub_8044124 +sub_8044124: + push {r4,r5,lr} + ldr r0, _080441AC + ldr r0, [r0] + ldr r1, _080441B0 + adds r0, r1 + ldrb r0, [r0] + bl sub_8090114 + cmp r0, 0 + bne _08044182 + movs r3, 0 + ldr r4, _080441B4 + movs r2, 0 +_0804413E: + lsls r1, r3, 2 + ldr r0, [r4] + adds r1, r0 + strb r2, [r1, 0x2] + strb r2, [r1, 0x1] + strb r2, [r1] + adds r3, 0x1 + cmp r3, 0x13 + ble _0804413E + movs r3, 0 + ldr r5, _080441B8 + movs r4, 0x1 +_08044156: + movs r0, 0x58 + adds r1, r3, 0 + muls r1, r0 + ldr r0, [r5] + adds r1, r0, r1 + ldrh r2, [r1] + adds r0, r4, 0 + ands r0, r2 + cmp r0, 0 + beq _08044178 + lsrs r0, r2, 1 + ands r0, r4 + cmp r0, 0 + beq _08044178 + adds r1, 0x28 + movs r0, 0 + strb r0, [r1] +_08044178: + adds r3, 0x1 + movs r0, 0xCE + lsls r0, 1 + cmp r3, r0 + ble _08044156 +_08044182: + ldr r0, _080441AC + ldr r0, [r0] + ldr r2, _080441B0 + adds r0, r2 + ldrb r0, [r0] + bl sub_8090124 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _080441A4 + ldr r0, _080441B4 + ldr r0, [r0] + movs r2, 0x98 + lsls r2, 2 + adds r0, r2 + str r1, [r0] +_080441A4: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080441AC: .4byte gUnknown_203B418 +_080441B0: .4byte 0x00000644 +_080441B4: .4byte gUnknown_203B460 +_080441B8: .4byte gUnknown_203B45C + thumb_func_end sub_8044124 + + thumb_func_start sub_80441BC +sub_80441BC: + push {lr} + ldr r0, _080441D8 + ldr r0, [r0] + ldr r1, _080441DC + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _080441E0 + cmp r0, 0x31 + bgt _080441E0 + movs r0, 0x1 + b _080441E2 + .align 2, 0 +_080441D8: .4byte gUnknown_203B418 +_080441DC: .4byte 0x00003a14 +_080441E0: + movs r0, 0 +_080441E2: + pop {r1} + bx r1 + thumb_func_end sub_80441BC + + thumb_func_start sub_80441E8 +sub_80441E8: + push {lr} + ldr r0, _08044200 + ldr r0, [r0] + ldr r1, _08044204 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x3F + bgt _08044208 + movs r0, 0 + b _0804420A + .align 2, 0 +_08044200: .4byte gUnknown_203B418 +_08044204: .4byte 0x00003a0e +_08044208: + movs r0, 0x1 +_0804420A: + pop {r1} + bx r1 + thumb_func_end sub_80441E8 + + thumb_func_start sub_8044210 +sub_8044210: + push {lr} + ldr r0, _0804422C + ldr r0, [r0] + ldr r1, _08044230 + adds r0, r1 + ldrb r0, [r0] + subs r0, 0x4B + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x16 + bls _08044234 + movs r0, 0 + b _08044236 + .align 2, 0 +_0804422C: .4byte gUnknown_203B418 +_08044230: .4byte 0x00000644 +_08044234: + movs r0, 0x1 +_08044236: + pop {r1} + bx r1 + thumb_func_end sub_8044210 + + thumb_func_start sub_804423C +sub_804423C: + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _080442C6 + bl sub_8044994 + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _080442C6 + adds r0, r4, 0 + bl sub_80442D0 + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _080442C6 + cmp r4, 0 + beq _08044280 + bl sub_807E378 + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _080442C6 +_08044280: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _080442C6 + bl sub_8044574 + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _080442C6 + bl sub_8044820 + bl sub_8044B28 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _080442C6 + bl sub_8044AB4 + ldr r0, _080442CC + ldr r0, [r0] + movs r2, 0xCC + lsls r2, 3 + adds r1, r0, r2 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x18 + bne _080442C6 + strh r4, [r1] +_080442C6: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080442CC: .4byte gUnknown_203B418 + thumb_func_end sub_804423C + + thumb_func_start sub_80442D0 +sub_80442D0: + push {r4-r7,lr} + lsls r0, 24 + lsrs r7, r0, 24 + bl sub_8083600 + adds r5, r0, 0 + cmp r5, 0 + beq _0804431A + bl sub_8069E8C + adds r0, r5, 0 + bl sub_8070774 + ldr r3, _08044320 + ldr r1, _08044324 + ldr r1, [r1] + movs r2, 0xCC + lsls r2, 3 + adds r1, r2 + movs r2, 0 + ldrsh r1, [r1, r2] + lsls r1, 1 + movs r2, 0x32 + muls r0, r2 + adds r1, r0 + adds r1, r3 + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _0804431A + ldr r0, [r5, 0x70] + movs r1, 0xA4 + lsls r1, 1 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08044328 +_0804431A: + movs r0, 0 + b _0804444E + .align 2, 0 +_08044320: .4byte gUnknown_80F6860 +_08044324: .4byte gUnknown_203B418 +_08044328: + bl sub_8083600 + adds r5, r0, 0 + cmp r5, 0 + beq _0804431A + movs r0, 0 + bl sub_807520C + lsls r0, 24 + cmp r0, 0 + bne _0804435C + ldr r0, _08044388 + ldr r1, [r0] + ldr r2, _0804438C + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _08044356 + ldr r3, _08044390 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + beq _0804435C +_08044356: + movs r0, 0xC + bl sub_803E46C +_0804435C: + ldr r0, [r5, 0x70] + adds r0, 0xF8 + movs r1, 0 + strb r1, [r0] + bl sub_8044B28 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _0804431A + ldr r0, _08044388 + ldr r1, [r0] + adds r0, r1, 0 + adds r0, 0xB8 + str r5, [r0] + adds r1, 0xBC + str r2, [r1] + cmp r7, 0 + beq _08044394 + movs r7, 0 + b _0804439A + .align 2, 0 +_08044388: .4byte gUnknown_203B418 +_0804438C: .4byte 0x0000066c +_08044390: .4byte 0x00000673 +_08044394: + adds r0, r5, 0 + bl sub_8074B54 +_0804439A: + bl sub_8044B28 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0804431A + adds r0, r5, 0 + bl sub_8071DA4 + ldr r6, _08044434 + ldr r1, [r6] + movs r0, 0x1 + strb r0, [r1, 0xF] + bl sub_805D8C8 + ldr r0, [r6] + strb r4, [r0, 0xF] + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _0804444C + adds r0, r5, 0 + bl sub_8072CF4 + bl sub_8086AC0 + movs r0, 0 + bl sub_8043ED0 + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _0804444C + ldr r2, [r5, 0x70] + ldrh r1, [r2] + movs r3, 0x80 + lsls r3, 8 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _08044400 + subs r3, 0x1 + adds r0, r3, 0 + ands r0, r1 + movs r3, 0x80 + lsls r3, 7 + adds r1, r3, 0 + orrs r0, r1 + strh r0, [r2] +_08044400: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _0804444C + bl sub_8044454 + bl sub_8044B28 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0804444C + ldr r2, [r6] + adds r0, r2, 0 + adds r0, 0xBC + ldr r1, [r0] + cmp r1, 0 + beq _08044438 + bl sub_805F02C + ldr r0, [r6] + adds r0, 0xBC + str r4, [r0] + movs r7, 0x1 + b _08044328 + .align 2, 0 +_08044434: .4byte gUnknown_203B418 +_08044438: + ldr r0, [r5, 0x70] + adds r0, 0xF8 + ldrb r0, [r0] + cmp r0, 0 + beq _0804444C + movs r3, 0xCC + lsls r3, 3 + adds r0, r2, r3 + strh r1, [r0] + b _08044328 +_0804444C: + movs r0, 0x1 +_0804444E: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80442D0 + + thumb_func_start sub_8044454 +sub_8044454: + push {r4-r6,lr} + ldr r0, _080444E8 + ldr r1, [r0] + ldrb r0, [r1, 0xE] + cmp r0, 0 + beq _080444E2 + movs r0, 0 + strb r0, [r1, 0xE] + movs r6, 0 +_08044466: + ldr r0, _080444E8 + ldr r0, [r0] + lsls r1, r6, 2 + ldr r2, _080444EC + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080444DC + ldr r5, [r4, 0x70] + ldrh r0, [r5] + movs r2, 0x80 + lsls r2, 8 + adds r1, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _080444DC + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _080444E2 + adds r0, r4, 0 + bl sub_8074B54 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080444DC + adds r0, r4, 0 + bl sub_8071DA4 + adds r0, r4, 0 + movs r1, 0 + bl sub_8075990 + adds r0, r4, 0 + bl sub_8072CF4 + bl sub_8086AC0 + movs r0, 0 + bl sub_8043ED0 + ldrh r0, [r5] + ldr r2, _080444F0 + adds r1, r2, 0 + ands r0, r1 + movs r2, 0x80 + lsls r2, 7 + adds r1, r2, 0 + orrs r0, r1 + strh r0, [r5] +_080444DC: + adds r6, 0x1 + cmp r6, 0x13 + ble _08044466 +_080444E2: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080444E8: .4byte gUnknown_203B418 +_080444EC: .4byte 0x000135cc +_080444F0: .4byte 0x00007fff + thumb_func_end sub_8044454 + + thumb_func_start sub_80444F4 +sub_80444F4: + push {r4-r6,lr} + adds r6, r0, 0 + bl sub_8083600 + cmp r6, r0 + bne _08044566 + ldr r0, _0804456C + ldr r1, [r0] + ldrb r0, [r1, 0xE] + cmp r0, 0 + beq _08044566 + movs r0, 0 + strb r0, [r1, 0xE] + movs r5, 0 +_08044510: + ldr r0, _0804456C + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _08044570 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08044560 + cmp r6, r4 + beq _08044560 + ldr r0, [r4, 0x70] + ldrh r0, [r0] + movs r2, 0x80 + lsls r2, 8 + adds r1, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _08044560 + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _08044566 + adds r0, r4, 0 + movs r1, 0 + bl sub_8075990 + adds r0, r4, 0 + bl sub_8072CF4 + bl sub_8086AC0 + movs r0, 0 + bl sub_8043ED0 +_08044560: + adds r5, 0x1 + cmp r5, 0x13 + ble _08044510 +_08044566: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0804456C: .4byte gUnknown_203B418 +_08044570: .4byte 0x000135cc + thumb_func_end sub_80444F4 + + thumb_func_start sub_8044574 +sub_8044574: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x44 + bl sub_8083600 + mov r10, r0 + movs r7, 0 + mov r0, sp + adds r0, 0x4 + str r0, [sp, 0x40] + ldr r1, _08044634 + mov r9, r1 +_08044592: + mov r2, r9 + ldr r0, [r2] + lsls r1, r7, 2 + ldr r3, _08044638 + adds r0, r3 + adds r0, r1 + ldr r5, [r0] + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080446A4 + ldr r6, [r5, 0x70] + mov r8, r6 + ldrb r0, [r6, 0x7] + cmp r0, 0 + bne _080446A4 + bl sub_8044B28 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _080446AC + mov r1, r9 + ldr r0, [r1] + adds r0, 0xB8 + str r5, [r0] + bl sub_8069E8C + movs r2, 0xA2 + lsls r2, 1 + adds r0, r6, r2 + strb r4, [r0] + adds r0, r5, 0 + bl sub_8070774 + mov r3, r9 + ldr r1, [r3] + movs r2, 0xCC + lsls r2, 3 + adds r1, r2 + movs r3, 0 + ldrsh r1, [r1, r3] + lsls r1, 1 + movs r2, 0x32 + muls r0, r2 + adds r1, r0 + ldr r0, _0804463C + adds r1, r0 + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _080446A4 + movs r3, 0xA4 + lsls r3, 1 + adds r0, r6, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _080446A4 + ldrh r1, [r6] + movs r2, 0x80 + lsls r2, 8 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _080446A4 + movs r3, 0x80 + lsls r3, 7 + adds r0, r3, 0 + ands r0, r1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + beq _08044644 + ldr r2, _08044640 + adds r0, r2, 0 + ands r0, r1 + strh r0, [r6] + b _080446A4 + .align 2, 0 +_08044634: .4byte gUnknown_203B418 +_08044638: .4byte 0x0001357c +_0804463C: .4byte gUnknown_80F6860 +_08044640: .4byte 0x0000bfff +_08044644: + ldr r1, _08044668 + add r1, r8 + strb r0, [r1] + adds r0, r5, 0 + bl sub_8074B54 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080446A4 + adds r0, r5, 0 + bl sub_8071DA4 + movs r4, 0 + b _0804466E + .align 2, 0 +_08044668: .4byte 0x00000145 +_0804466C: + adds r4, 0x1 +_0804466E: + cmp r4, 0x2 + bgt _080446A4 + adds r0, r5, 0 + movs r1, 0 + bl sub_8075990 + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _080446A4 + adds r0, r5, 0 + bl sub_8072CF4 + lsls r0, 24 + cmp r0, 0 + beq _080446A4 + bl sub_8086AC0 + movs r0, 0 + bl sub_8043ED0 + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _0804466C +_080446A4: + adds r7, 0x1 + cmp r7, 0x3 + bgt _080446AC + b _08044592 +_080446AC: + movs r0, 0 + mov r8, r0 +_080446B0: + adds r0, 0x1 + mov r9, r0 + add r2, sp, 0x8 + ldr r1, [sp, 0x40] + mov r0, sp + movs r7, 0x2 +_080446BC: + mov r3, r8 + str r3, [r0] + str r2, [r1] + adds r2, 0x8 + adds r1, 0x8 + adds r0, 0x8 + subs r7, 0x1 + cmp r7, 0 + bge _080446BC + str r3, [sp, 0x18] + str r3, [sp, 0x1C] + movs r7, 0 +_080446D4: + ldr r0, _08044710 + ldr r0, [r0] + lsls r1, r7, 2 + ldr r2, _08044714 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08044760 + ldr r1, [r4, 0x70] + movs r3, 0xA2 + lsls r3, 1 + adds r2, r1, r3 + ldrb r0, [r2] + cmp r0, 0 + beq _08044760 + ldrb r0, [r1, 0x7] + cmp r0, 0 + beq _08044718 + adds r3, 0x1 + adds r0, r1, r3 + mov r1, r8 + strb r1, [r0] + strb r1, [r2] + b _08044760 + .align 2, 0 +_08044710: .4byte gUnknown_203B418 +_08044714: .4byte 0x0001357c +_08044718: + mov r2, r10 + movs r3, 0x4 + ldrsh r1, [r2, r3] + movs r2, 0x4 + ldrsh r0, [r4, r2] + subs r2, r1, r0 + cmp r2, 0 + bge _0804472A + negs r2, r2 +_0804472A: + mov r3, r10 + movs r0, 0x6 + ldrsh r1, [r3, r0] + movs r3, 0x6 + ldrsh r0, [r4, r3] + subs r1, r0 + cmp r1, 0 + bge _0804473C + negs r1, r1 +_0804473C: + cmp r1, r2 + bge _08044742 + adds r1, r2, 0 +_08044742: + cmp r1, 0x2 + ble _08044748 + movs r1, 0x2 +_08044748: + add r3, sp, 0x20 + lsls r0, r7, 3 + adds r3, r0 + str r4, [r3] + add r2, sp, 0x24 + adds r2, r0 + lsls r1, 3 + ldr r0, [sp, 0x40] + adds r1, r0, r1 + ldr r0, [r1] + str r0, [r2] + str r3, [r1] +_08044760: + adds r7, 0x1 + cmp r7, 0x3 + ble _080446D4 + mov r5, sp + movs r6, 0 +_0804476A: + ldr r4, [r5] + cmp r4, 0 + beq _080447A0 + ldr r1, [r4, 0x70] + ldr r3, _08044814 + adds r2, r1, r3 + movs r0, 0x1 + strb r0, [r2] + movs r2, 0xA2 + lsls r2, 1 + adds r0, r1, r2 + strb r6, [r0] + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8075990 + adds r0, r4, 0 + bl sub_8072CF4 + bl sub_8086AC0 + movs r0, 0 + bl sub_8043ED0 + adds r0, r4, 0 + bl sub_80450E0 +_080447A0: + ldr r5, [r5, 0x4] + cmp r5, 0 + bne _0804476A + mov r0, r9 + cmp r0, 0x2 + ble _080446B0 + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _08044802 + movs r7, 0 +_080447B8: + ldr r0, _08044818 + ldr r0, [r0] + lsls r1, r7, 2 + ldr r3, _0804481C + adds r0, r3 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080447FC + ldr r0, [r4, 0x70] + movs r1, 0xA2 + lsls r1, 1 + adds r5, r0, r1 + ldrb r0, [r5] + cmp r0, 0 + beq _080447FC + adds r0, r4, 0 + bl sub_8074094 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080447FC + adds r0, r4, 0 + bl sub_8071DA4 + movs r0, 0 + strb r0, [r5] +_080447FC: + adds r7, 0x1 + cmp r7, 0x3 + ble _080447B8 +_08044802: + add sp, 0x44 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08044814: .4byte 0x00000145 +_08044818: .4byte gUnknown_203B418 +_0804481C: .4byte 0x0001357c + thumb_func_end sub_8044574 + + thumb_func_start sub_8044820 +sub_8044820: + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r7, 0 + ldr r0, _08044830 + mov r8, r0 + b _080448FC + .align 2, 0 +_08044830: .4byte gUnknown_80F6860 +_08044834: + ldr r4, [r5, 0x70] + ldr r0, [r6] + adds r0, 0xB8 + str r5, [r0] + bl sub_8069E8C + ldrh r2, [r4] + movs r1, 0x80 + lsls r1, 8 + adds r0, r1, 0 + ands r0, r2 + cmp r0, 0 + bne _080448FA + movs r1, 0x80 + lsls r1, 7 + adds r0, r1, 0 + ands r0, r2 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _0804486C + ldr r1, _08044868 + adds r0, r1, 0 + ands r0, r2 + strh r0, [r4] + b _080448FA + .align 2, 0 +_08044868: .4byte 0x0000bfff +_0804486C: + movs r2, 0xA2 + lsls r2, 1 + adds r0, r4, r2 + strb r1, [r0] + adds r0, r5, 0 + bl sub_8070774 + ldr r1, [r6] + movs r2, 0xCC + lsls r2, 3 + adds r1, r2 + movs r2, 0 + ldrsh r1, [r1, r2] + lsls r1, 1 + movs r2, 0x32 + muls r0, r2 + adds r1, r0 + add r1, r8 + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _080448FA + movs r1, 0xA4 + lsls r1, 1 + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080448FA + ldrh r1, [r4] + ldr r2, _08044984 + adds r0, r2, 0 + ands r1, r0 + movs r0, 0 + strh r1, [r4] + ldr r2, _08044988 + adds r1, r4, r2 + strb r0, [r1] + adds r0, r5, 0 + bl sub_8074B54 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080448FA + adds r0, r5, 0 + bl sub_8071DA4 + adds r0, r5, 0 + movs r1, 0 + bl sub_8075990 + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _08044924 + adds r0, r5, 0 + bl sub_8072CF4 + bl sub_8086AC0 + movs r0, 0 + bl sub_8043ED0 + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _08044924 +_080448FA: + adds r7, 0x1 +_080448FC: + cmp r7, 0xF + bgt _08044924 + ldr r6, _0804498C + ldr r0, [r6] + lsls r1, r7, 2 + ldr r2, _08044990 + adds r0, r2 + adds r0, r1 + ldr r5, [r0] + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080448FA + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _08044834 +_08044924: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _0804497A + movs r7, 0 +_08044930: + ldr r0, _0804498C + ldr r0, [r0] + lsls r1, r7, 2 + ldr r2, _08044990 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08044974 + ldr r0, [r4, 0x70] + movs r1, 0xA2 + lsls r1, 1 + adds r5, r0, r1 + ldrb r0, [r5] + cmp r0, 0 + beq _08044974 + adds r0, r4, 0 + bl sub_8074094 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08044974 + adds r0, r4, 0 + bl sub_8071DA4 + movs r0, 0 + strb r0, [r5] +_08044974: + adds r7, 0x1 + cmp r7, 0xF + ble _08044930 +_0804497A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08044984: .4byte 0x00003fff +_08044988: .4byte 0x00000145 +_0804498C: .4byte gUnknown_203B418 +_08044990: .4byte 0x0001358c + thumb_func_end sub_8044820 + + thumb_func_start sub_8044994 +sub_8044994: + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r1, _08044A94 + ldr r4, _08044A98 + ldr r0, [r4] + movs r2, 0xCC + lsls r2, 3 + adds r0, r2 + movs r3, 0 + ldrsh r0, [r0, r3] + lsls r0, 1 + adds r1, 0x32 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08044A8A + bl sub_8071B48 + ldr r0, [r4] + ldr r2, _08044A9C + adds r0, r2 + movs r2, 0 + strb r2, [r0] + ldr r0, [r4] + ldr r3, _08044AA0 + adds r0, r3 + strb r2, [r0] + ldr r0, [r4] + ldr r1, _08044AA4 + adds r0, r1 + strb r2, [r0] + ldr r0, [r4] + adds r3, 0x2 + adds r0, r3 + strb r2, [r0] + ldr r0, [r4] + ldr r3, _08044AA8 + adds r1, r0, r3 + str r2, [r1] + ldr r1, _08044AAC + adds r0, r1 + movs r1, 0x2 + str r1, [r0] + mov r8, r2 + adds r7, r4, 0 +_080449F2: + ldr r0, [r7] + mov r2, r8 + lsls r1, r2, 2 + ldr r3, _08044AB0 + adds r0, r3 + adds r0, r1 + ldr r5, [r0] + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08044A7A + ldr r0, [r5, 0x70] + adds r4, r0, 0 + movs r0, 0xA4 + lsls r0, 1 + adds r1, r4, r0 + movs r0, 0 + strb r0, [r1] + ldrb r0, [r4, 0x6] + movs r6, 0x1 + cmp r0, 0 + beq _08044A24 + movs r6, 0 +_08044A24: + adds r0, r5, 0 + movs r1, 0x32 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _08044A46 + ldr r1, [r7] + ldr r2, _08044AA8 + adds r0, r1, r2 + str r5, [r0] + ldr r3, _08044AAC + adds r1, r3 + adds r0, r4, 0 + adds r0, 0x98 + ldr r0, [r0] + str r0, [r1] +_08044A46: + adds r0, r5, 0 + movs r1, 0x3F + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _08044A60 + ldr r0, [r7] + ldr r1, _08044AA4 + adds r0, r1 + adds r0, r6 + movs r1, 0x1 + strb r1, [r0] +_08044A60: + adds r0, r5, 0 + movs r1, 0x38 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _08044A7A + ldr r0, [r7] + ldr r2, _08044A9C + adds r0, r2 + adds r0, r6 + movs r1, 0x1 + strb r1, [r0] +_08044A7A: + movs r3, 0x1 + add r8, r3 + mov r0, r8 + cmp r0, 0x13 + ble _080449F2 + movs r0, 0 + bl sub_8043ED0 +_08044A8A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08044A94: .4byte gUnknown_80F6860 +_08044A98: .4byte gUnknown_203B418 +_08044A9C: .4byte 0x000037f8 +_08044AA0: .4byte 0x000037f9 +_08044AA4: .4byte 0x000037fa +_08044AA8: .4byte 0x00017b2c +_08044AAC: .4byte 0x00017b38 +_08044AB0: .4byte 0x000135cc + thumb_func_end sub_8044994 + + thumb_func_start sub_8044AB4 +sub_8044AB4: + push {r4,lr} + ldr r1, _08044ADC + ldr r0, _08044AE0 + ldr r0, [r0] + movs r2, 0xCC + lsls r2, 3 + adds r0, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + adds r0, 0x1 + lsls r0, 1 + adds r1, 0x32 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _08044B1A + movs r4, 0 + b _08044AE6 + .align 2, 0 +_08044ADC: .4byte gUnknown_80F6860 +_08044AE0: .4byte gUnknown_203B418 +_08044AE4: + adds r4, 0x1 +_08044AE6: + cmp r4, 0x13 + bgt _08044B08 + ldr r0, _08044B20 + ldr r0, [r0] + lsls r1, r4, 2 + ldr r2, _08044B24 + adds r0, r2 + adds r0, r1 + ldr r0, [r0] + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08044AE4 + movs r0, 0 + bl sub_807520C +_08044B08: + movs r0, 0x1 + movs r1, 0 + bl sub_807EAA0 + bl sub_8086AC0 + movs r0, 0 + bl sub_8043ED0 +_08044B1A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08044B20: .4byte gUnknown_203B418 +_08044B24: .4byte 0x000135cc + thumb_func_end sub_8044AB4 + + thumb_func_start sub_8044B28 +sub_8044B28: + push {r4,lr} + ldr r4, _08044B48 + ldr r0, [r4] + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _08044B76 + bl sub_8083600 + cmp r0, 0 + bne _08044B50 + ldr r0, [r4] + ldr r1, _08044B4C + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + b _08044B76 + .align 2, 0 +_08044B48: .4byte gUnknown_203B418 +_08044B4C: .4byte 0x00000654 +_08044B50: + ldr r0, [r4] + ldrb r2, [r0, 0x2] + cmp r2, 0x1 + bne _08044B68 + ldr r2, _08044B64 + adds r1, r0, r2 + movs r0, 0x2 + strb r0, [r1] + b _08044B76 + .align 2, 0 +_08044B64: .4byte 0x00000654 +_08044B68: + cmp r2, 0x2 + beq _08044B70 + movs r0, 0 + b _08044B78 +_08044B70: + ldr r1, _08044B80 + adds r0, r1 + strb r2, [r0] +_08044B76: + movs r0, 0x1 +_08044B78: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08044B80: .4byte 0x00000654 + thumb_func_end sub_8044B28 + + thumb_func_start sub_8044B84 +sub_8044B84: + push {lr} + ldr r0, _08044B9C + ldr r0, [r0] + ldrb r0, [r0, 0x10] + cmp r0, 0 + bne _08044BA0 + bl sub_8044B28 + lsls r0, 24 + lsrs r0, 24 + b _08044BA2 + .align 2, 0 +_08044B9C: .4byte gUnknown_203B418 +_08044BA0: + movs r0, 0x1 +_08044BA2: + pop {r1} + bx r1 + thumb_func_end sub_8044B84 + + thumb_func_start sub_8044BA8 +sub_8044BA8: + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 24 + lsrs r5, r1, 24 + cmp r4, 0x26 + bne _08044BCC + bl sub_8043D10 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08044BCC + ldr r0, _08044BC8 + b _08044C02 + .align 2, 0 +_08044BC8: .4byte gUnknown_80F91EC +_08044BCC: + ldr r1, _08044BEC + lsls r0, r4, 3 + adds r4, r0, r1 + ldr r0, [r4] + ldr r1, _08044BF0 + bl strcmp + cmp r0, 0 + beq _08044BE0 + movs r0, 0x1 +_08044BE0: + lsls r0, 24 + cmp r0, 0 + beq _08044BF4 + ldr r0, [r4] + b _08044C04 + .align 2, 0 +_08044BEC: .4byte gUnknown_80F7C50 +_08044BF0: .4byte gUnknown_80F697C +_08044BF4: + ldr r4, _08044C0C + adds r0, r5, 0 + bl sub_8090D6C + lsls r0, 3 + adds r4, 0x4 + adds r0, r4 +_08044C02: + ldr r0, [r0] +_08044C04: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08044C0C: .4byte gUnknown_80F7B14 + thumb_func_end sub_8044BA8 + + thumb_func_start sub_8044C10 +sub_8044C10: + push {r4,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_8083654 + adds r2, r0, 0 + adds r1, r2, 0 + adds r1, 0x44 + movs r3, 0 + movs r0, 0 + strh r0, [r1] + cmp r4, 0 + beq _08044C44 + adds r0, r2, 0 + adds r0, 0x48 + strb r3, [r0] + adds r0, 0x8 + strb r3, [r0] + adds r1, 0x14 + ldr r0, _08044C4C + strh r0, [r1] + adds r1, 0x2 + movs r0, 0x1 + negs r0, r0 + strh r0, [r1] +_08044C44: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08044C4C: .4byte 0x0000ffff + thumb_func_end sub_8044C10 + + thumb_func_start sub_8044C50 +sub_8044C50: + push {r4,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + bl sub_8083654 + adds r2, r0, 0 + adds r0, 0x44 + movs r1, 0 + strh r4, [r0] + adds r0, 0x4 + strb r1, [r0] + adds r0, 0x8 + strb r1, [r0] + adds r1, r2, 0 + adds r1, 0x58 + ldr r0, _08044C84 + strh r0, [r1] + adds r1, 0x2 + movs r0, 0x1 + negs r0, r0 + strh r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08044C84: .4byte 0x0000ffff + thumb_func_end sub_8044C50 + + thumb_func_start sub_8044C88 +sub_8044C88: + movs r2, 0 + movs r1, 0 + strh r1, [r0] + strb r2, [r0, 0x4] + strb r2, [r0, 0xC] + bx lr + thumb_func_end sub_8044C88 + + thumb_func_start sub_8044C94 +sub_8044C94: + movs r2, 0 + strh r1, [r0] + strb r2, [r0, 0x4] + strb r2, [r0, 0xC] + bx lr + thumb_func_end sub_8044C94 + + thumb_func_start sub_8044CA0 +sub_8044CA0: + push {r4,lr} + adds r4, r0, 0 + lsls r0, r1, 16 + asrs r0, 16 + bl sub_808DB48 + lsls r0, 24 + cmp r0, 0 + beq _08044CB6 + movs r0, 0x2 + b _08044CB8 +_08044CB6: + movs r0, 0x1 +_08044CB8: + strh r0, [r4] + movs r0, 0 + strb r0, [r4, 0x4] + strb r0, [r4, 0xC] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8044CA0 + + thumb_func_start sub_8044CC8 +sub_8044CC8: + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + ldrb r1, [r2] + subs r0, r1, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x13 + bhi _08044CEC + ldr r0, _08044CE8 + ldrb r1, [r2] + lsls r1, 2 + subs r1, 0x4 + ldr r0, [r0] + adds r0, r1 + b _08044D34 + .align 2, 0 +_08044CE8: .4byte gUnknown_203B460 +_08044CEC: + adds r0, r1, 0 + cmp r0, 0x80 + bne _08044D06 + movs r1, 0x4 + ldrsh r0, [r2, r1] + movs r3, 0x6 + ldrsh r1, [r2, r3] + bl sub_804954C + ldr r0, [r0, 0x14] + bl sub_8045108 + b _08044D34 +_08044D06: + cmp r0, 0x81 + bne _08044D0E + ldr r0, [r3, 0x70] + b _08044D32 +_08044D0E: + adds r0, r1, 0 + adds r0, 0x70 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _08044D1E + movs r0, 0 + b _08044D34 +_08044D1E: + ldr r0, _08044D38 + ldr r1, [r0] + ldrb r0, [r2] + subs r0, 0x90 + lsls r0, 2 + ldr r2, _08044D3C + adds r1, r2 + adds r1, r0 + ldr r0, [r1] + ldr r0, [r0, 0x70] +_08044D32: + adds r0, 0x60 +_08044D34: + pop {r1} + bx r1 + .align 2, 0 +_08044D38: .4byte gUnknown_203B418 +_08044D3C: .4byte 0x0001357c + thumb_func_end sub_8044CC8 + + thumb_func_start sub_8044D40 +sub_8044D40: + push {lr} + lsls r1, 3 + adds r1, 0x4 + adds r2, r0, r1 + ldrb r1, [r2] + subs r0, r1, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x13 + bhi _08044D74 + ldr r1, _08044D70 + ldrb r0, [r2] + lsls r0, 2 + subs r0, 0x4 + ldr r1, [r1] + adds r1, r0 + movs r0, 0 + strb r0, [r1, 0x2] + strb r0, [r1, 0x1] + strb r0, [r1] + bl sub_80910B4 + b _08044D88 + .align 2, 0 +_08044D70: .4byte gUnknown_203B460 +_08044D74: + lsls r0, r1, 24 + lsrs r0, 24 + cmp r0, 0x80 + beq _08044D80 + movs r0, 0 + b _08044D8A +_08044D80: + adds r0, r2, 0x4 + movs r1, 0x1 + bl sub_80461C8 +_08044D88: + movs r0, 0x1 +_08044D8A: + pop {r1} + bx r1 + thumb_func_end sub_8044D40 + + thumb_func_start sub_8044D90 +sub_8044D90: + push {lr} + ldr r3, [r0, 0x70] + lsls r1, 3 + adds r1, 0x48 + adds r3, r1 + adds r1, r3, 0 + bl sub_8044CC8 + pop {r1} + bx r1 + thumb_func_end sub_8044D90 + + thumb_func_start sub_8044DA4 +sub_8044DA4: + ldr r0, [r0, 0x70] + ldr r2, _08044DC0 + ldr r2, [r2] + lsls r1, 3 + adds r0, r1 + adds r0, 0x48 + ldrb r0, [r0] + lsls r0, 2 + ldr r1, _08044DC4 + adds r2, r1 + adds r2, r0 + ldr r0, [r2] + bx lr + .align 2, 0 +_08044DC0: .4byte gUnknown_203B418 +_08044DC4: .4byte 0x0001357c + thumb_func_end sub_8044DA4 + + thumb_func_start sub_8044DC8 +sub_8044DC8: + push {r4,lr} + adds r1, r0, 0 + ldrb r0, [r1, 0x2] + cmp r0, 0xE9 + beq _08044DE8 + ldr r4, _08044DE4 + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 23 + adds r0, r4 + ldrh r0, [r0] + b _08044DEA + .align 2, 0 +_08044DE4: .4byte gUnknown_80F6964 +_08044DE8: + movs r0, 0x35 +_08044DEA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8044DC8 + + thumb_func_start sub_8044DF0 +sub_8044DF0: + push {r4,lr} + ldr r4, [r0, 0x70] + bl sub_8044D90 + adds r1, r0, 0 + adds r0, r4, 0 + adds r0, 0x48 + ldrb r0, [r0] + cmp r0, 0x80 + bne _08044E10 + adds r0, r4, 0 + adds r0, 0x4C + movs r1, 0x1 + bl sub_80461C8 + b _08044E1C +_08044E10: + movs r0, 0 + strb r0, [r1, 0x2] + strb r0, [r1, 0x1] + strb r0, [r1] + bl sub_80910B4 +_08044E1C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8044DF0 + + thumb_func_start sub_8044E24 +sub_8044E24: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r0, 0 + adds r6, r1, 0 + adds r7, r2, 0 + bl sub_8044D90 + adds r5, r0, 0 + ldr r0, [r4, 0x70] + mov r8, r0 + ldrb r0, [r5, 0x2] + bl sub_80915A0 + lsls r0, 24 + cmp r0, 0 + bne _08044EBA + ldrb r0, [r5, 0x2] + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bne _08044EB0 + lsls r1, r6, 3 + mov r2, r8 + adds r0, r2, r1 + adds r0, 0x48 + ldrb r0, [r0] + cmp r0, 0x80 + bne _08044EA4 + ldr r0, [r5] + str r0, [sp] + adds r4, r1, r2 + adds r4, 0x4C + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80461C8 + ldrb r1, [r5, 0x2] + subs r1, 0x7D + lsls r1, 24 + lsrs r1, 16 + ldr r2, _08044E9C + ldr r0, [sp] + ands r0, r2 + orrs r0, r1 + ldr r1, _08044EA0 + ands r0, r1 + movs r1, 0xF8 + lsls r1, 15 + orrs r0, r1 + str r0, [sp] + adds r0, r4, 0 + mov r1, sp + movs r2, 0x1 + bl sub_80460F8 + b _08044EBA + .align 2, 0 +_08044E9C: .4byte 0xffff00ff +_08044EA0: .4byte 0xff00ffff +_08044EA4: + ldrb r0, [r5, 0x2] + subs r0, 0x7D + strb r0, [r5, 0x1] + movs r0, 0x7C + strb r0, [r5, 0x2] + b _08044EBA +_08044EB0: + adds r0, r4, 0 + adds r1, r6, 0 + adds r2, r7, 0 + bl sub_8044DF0 +_08044EBA: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8044E24 + + thumb_func_start sub_8044EC8 +sub_8044EC8: + push {r4,r5,lr} + adds r5, r0, 0 + ldr r1, _08044EE8 + lsls r0, r5, 2 + adds r0, r1 + ldrh r4, [r0] + cmp r4, 0x26 + bne _08044EF0 + bl sub_8043D10 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08044EF0 + ldr r0, _08044EEC + b _08044F2C + .align 2, 0 +_08044EE8: .4byte gUnknown_202EE44 +_08044EEC: .4byte gUnknown_80F91EC +_08044EF0: + ldr r1, _08044F10 + lsls r0, r4, 3 + adds r4, r0, r1 + ldr r0, [r4] + ldr r1, _08044F14 + bl strcmp + cmp r0, 0 + beq _08044F04 + movs r0, 0x1 +_08044F04: + lsls r0, 24 + cmp r0, 0 + beq _08044F18 + ldr r0, [r4] + b _08044F2E + .align 2, 0 +_08044F10: .4byte gUnknown_80F7C50 +_08044F14: .4byte gUnknown_80F697C +_08044F18: + ldr r4, _08044F34 + ldr r1, _08044F38 + lsls r0, r5, 2 + adds r0, r1 + ldrb r0, [r0, 0x2] + bl sub_8090D6C + lsls r0, 3 + adds r4, 0x4 + adds r0, r4 +_08044F2C: + ldr r0, [r0] +_08044F2E: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08044F34: .4byte gUnknown_80F7B14 +_08044F38: .4byte gUnknown_202EE44 + thumb_func_end sub_8044EC8 + + thumb_func_start sub_8044F3C +sub_8044F3C: + push {lr} + adds r1, r0, 0 + cmp r1, 0 + blt _08044F54 + ldr r0, _08044F50 + lsls r1, 2 + adds r1, r0 + ldrb r0, [r1, 0x3] + b _08044F56 + .align 2, 0 +_08044F50: .4byte gUnknown_202EE44 +_08044F54: + movs r0, 0 +_08044F56: + pop {r1} + bx r1 + thumb_func_end sub_8044F3C + + thumb_func_start sub_8044F5C +sub_8044F5C: + push {r4-r7,lr} + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 24 + lsrs r7, r1, 24 + ldr r0, _08044FAC + ldr r2, [r0] + adds r6, r0, 0 + cmp r2, 0x9 + bgt _08044FA4 + movs r3, 0 + ldr r5, _08044FB0 + cmp r3, r2 + bge _08044F8A + adds r1, r2, 0 + adds r2, r5, 0 +_08044F7C: + ldrh r0, [r2] + cmp r0, r4 + beq _08044FA4 + adds r2, 0x4 + adds r3, 0x1 + cmp r3, r1 + blt _08044F7C +_08044F8A: + ldr r0, [r6] + lsls r0, 2 + adds r0, r5 + strh r4, [r0] + strb r7, [r0, 0x2] + ldr r0, [r6] + lsls r0, 2 + adds r0, r5 + movs r1, 0x1 + strb r1, [r0, 0x3] + ldr r0, [r6] + adds r0, 0x1 + str r0, [r6] +_08044FA4: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08044FAC: .4byte gUnknown_202EE6C +_08044FB0: .4byte gUnknown_202EE44 + thumb_func_end sub_8044F5C + + thumb_func_start sub_8044FB4 +sub_8044FB4: + push {r4,lr} + lsls r0, 16 + lsrs r4, r0, 16 + movs r1, 0 + ldr r0, _08044FD4 + ldr r0, [r0] + cmp r1, r0 + bge _08044FE4 + adds r3, r0, 0 + ldr r2, _08044FD8 +_08044FC8: + ldrh r0, [r2] + cmp r0, r4 + bne _08044FDC + adds r0, r1, 0 + b _08044FE8 + .align 2, 0 +_08044FD4: .4byte gUnknown_202EE6C +_08044FD8: .4byte gUnknown_202EE44 +_08044FDC: + adds r2, 0x4 + adds r1, 0x1 + cmp r1, r3 + blt _08044FC8 +_08044FE4: + movs r0, 0x1 + negs r0, r0 +_08044FE8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8044FB4 + + thumb_func_start sub_8044FF0 +sub_8044FF0: + push {r4,r5,lr} + lsls r0, 16 + lsrs r3, r0, 16 + movs r2, 0 + ldr r1, _08045010 + ldr r0, [r1] + cmp r2, r0 + bge _08045022 + movs r5, 0 + adds r4, r1, 0 + ldr r1, _08045014 +_08045006: + ldrh r0, [r1] + cmp r0, r3 + bne _08045018 + strb r5, [r1, 0x3] + b _08045022 + .align 2, 0 +_08045010: .4byte gUnknown_202EE6C +_08045014: .4byte gUnknown_202EE44 +_08045018: + adds r1, 0x4 + adds r2, 0x1 + ldr r0, [r4] + cmp r2, r0 + blt _08045006 +_08045022: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8044FF0 + + thumb_func_start sub_8045028 +sub_8045028: + push {r4,lr} + adds r2, r0, 0 + lsls r1, 24 + ldr r0, [r2, 0x70] + adds r4, r0, 0 + adds r4, 0x44 + cmp r1, 0 + beq _08045044 + adds r0, r2, 0 + bl sub_8045888 + lsls r0, 24 + cmp r0, 0 + beq _0804505A +_08045044: + ldrh r0, [r4] + cmp r0, 0 + beq _0804505A + cmp r0, 0x2 + beq _0804505A + cmp r0, 0x1 + beq _0804505A + cmp r0, 0x5 + beq _0804505A + movs r0, 0 + b _0804505C +_0804505A: + movs r0, 0x1 +_0804505C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8045028 + + thumb_func_start sub_8045064 +sub_8045064: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r1, 0 + ldr r0, _080450D4 + mov r8, r0 + ldr r0, [r0] + cmp r1, r0 + bge _080450C8 + mov r7, r8 + ldr r2, _080450D8 + mov r9, r2 + ldr r0, _080450DC + mov r12, r0 +_08045082: + adds r4, r1, 0x1 + ldr r0, [r7] + adds r5, r4, 0 + cmp r5, r0 + bge _080450BE + lsls r0, r1, 2 + mov r1, r12 + adds r3, r0, r1 + mov r6, r9 + lsls r0, r5, 2 + adds r2, r0, r1 +_08045098: + ldrh r1, [r3] + lsls r1, 3 + adds r1, r6 + ldrh r0, [r2] + lsls r0, 3 + adds r0, r6 + ldr r1, [r1] + ldr r0, [r0] + cmp r1, r0 + ble _080450B4 + ldr r1, [r3] + ldr r0, [r2] + str r0, [r3] + str r1, [r2] +_080450B4: + adds r2, 0x4 + adds r4, 0x1 + ldr r0, [r7] + cmp r4, r0 + blt _08045098 +_080450BE: + adds r1, r5, 0 + mov r2, r8 + ldr r0, [r2] + cmp r1, r0 + blt _08045082 +_080450C8: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080450D4: .4byte gUnknown_202EE6C +_080450D8: .4byte gUnknown_80F7C54 +_080450DC: .4byte gUnknown_202EE44 + thumb_func_end sub_8045064 + + thumb_func_start sub_80450E0 +sub_80450E0: + push {lr} + cmp r0, 0 + bne _080450EA + movs r0, 0 + b _080450F2 +_080450EA: + ldr r0, [r0] + cmp r0, 0 + beq _080450F2 + movs r0, 0x1 +_080450F2: + pop {r1} + bx r1 + thumb_func_end sub_80450E0 + + thumb_func_start sub_80450F8 +sub_80450F8: + ldr r0, [r0] + bx lr + thumb_func_end sub_80450F8 + + thumb_func_start sub_80450FC +sub_80450FC: + adds r0, 0x25 + ldrb r0, [r0] + bx lr + thumb_func_end sub_80450FC + + thumb_func_start sub_8045104 +sub_8045104: + ldr r0, [r0, 0x70] + bx lr + thumb_func_end sub_8045104 + + thumb_func_start sub_8045108 +sub_8045108: + ldr r0, [r0, 0x70] + bx lr + thumb_func_end sub_8045108 + + thumb_func_start sub_804510C +sub_804510C: + ldr r0, [r0, 0x70] + bx lr + thumb_func_end sub_804510C + + thumb_func_start sub_8045110 +sub_8045110: + ldr r0, [r0, 0x70] + bx lr + thumb_func_end sub_8045110 + + thumb_func_start sub_8045114 +sub_8045114: + push {lr} + movs r1, 0x4 + ldrsh r2, [r0, r1] + movs r3, 0x6 + ldrsh r1, [r0, r3] + adds r0, r2, 0 + bl sub_804954C + pop {r1} + bx r1 + thumb_func_end sub_8045114 + + thumb_func_start sub_8045128 +sub_8045128: + push {lr} + movs r1, 0x4 + ldrsh r2, [r0, r1] + movs r3, 0x6 + ldrsh r1, [r0, r3] + adds r0, r2, 0 + bl sub_8049590 + pop {r1} + bx r1 + thumb_func_end sub_8045128 + + thumb_func_start sub_804513C +sub_804513C: + push {r4-r7,lr} + movs r3, 0 + ldr r7, _080451FC + ldr r6, _08045200 + ldr r4, _08045204 + movs r5, 0 +_08045148: + ldr r0, [r7] + lsls r2, r3, 2 + adds r1, r0, r6 + adds r1, r2 + adds r0, r4 + str r0, [r1] + str r5, [r0] + adds r4, 0x74 + adds r3, 0x1 + cmp r3, 0x3 + ble _08045148 + ldr r1, _08045208 + movs r2, 0 + adds r0, r1, 0x5 +_08045164: + strb r2, [r0] + subs r0, 0x1 + cmp r0, r1 + bge _08045164 + movs r3, 0 + ldr r7, _080451FC + ldr r6, _0804520C + ldr r4, _08045210 + movs r5, 0 +_08045176: + ldr r0, [r7] + lsls r2, r3, 2 + adds r1, r0, r6 + adds r1, r2 + adds r0, r4 + str r0, [r1] + str r5, [r0] + adds r4, 0x74 + adds r3, 0x1 + cmp r3, 0xF + ble _08045176 + ldr r1, _08045214 + movs r2, 0 + adds r0, r1, 0 + adds r0, 0xF +_08045194: + strb r2, [r0] + subs r0, 0x1 + cmp r0, r1 + bge _08045194 + movs r3, 0 + ldr r5, _080451FC + ldr r4, _08045218 + movs r2, 0 +_080451A4: + ldr r0, [r5] + lsls r1, r3, 2 + adds r0, r4 + adds r0, r1 + str r2, [r0] + adds r3, 0x1 + cmp r3, 0x13 + ble _080451A4 + movs r3, 0 + ldr r7, _080451FC + ldr r6, _0804521C + ldr r4, _08045220 + movs r5, 0 +_080451BE: + ldr r0, [r7] + lsls r2, r3, 2 + adds r1, r0, r6 + adds r1, r2 + adds r0, r4 + str r0, [r1] + str r5, [r0] + adds r4, 0x74 + adds r3, 0x1 + cmp r3, 0x3F + ble _080451BE + movs r3, 0 + ldr r7, _080451FC + ldr r6, _08045224 + ldr r4, _08045228 + movs r5, 0 +_080451DE: + ldr r0, [r7] + lsls r2, r3, 2 + adds r1, r0, r6 + adds r1, r2 + adds r0, r4 + str r0, [r1] + str r5, [r0] + adds r4, 0x74 + adds r3, 0x1 + cmp r3, 0x3F + ble _080451DE + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080451FC: .4byte gUnknown_203B418 +_08045200: .4byte 0x0001357c +_08045204: .4byte 0x0001381c +_08045208: .4byte gUnknown_202EE70 +_0804520C: .4byte 0x0001358c +_08045210: .4byte 0x000139ec +_08045214: .4byte gUnknown_202EE76 +_08045218: .4byte 0x000135cc +_0804521C: .4byte 0x0001361c +_08045220: .4byte 0x0001412c +_08045224: .4byte 0x0001371c +_08045228: .4byte 0x00015e2c + thumb_func_end sub_804513C + + thumb_func_start sub_804522C +sub_804522C: + push {r4-r7,lr} + sub sp, 0x4 + ldr r2, _08045274 + ldr r0, [r2] + ldr r3, _08045278 + adds r1, r0, r3 + ldrb r7, [r1] + ldr r1, _0804527C + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080452AA + movs r6, 0 + adds r7, r2, 0 +_08045248: + ldr r0, [r7] + lsls r1, r6, 2 + ldr r2, _08045280 + adds r0, r2 + adds r0, r1 + ldr r5, [r0] + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080452A2 + ldr r0, [r7] + ldr r3, _08045284 + adds r0, r3 + ldr r0, [r0] + cmp r5, r0 + bne _08045288 + adds r0, r5, 0 + bl sub_806C51C + b _080452A2 + .align 2, 0 +_08045274: .4byte gUnknown_203B418 +_08045278: .4byte 0x00018210 +_0804527C: .4byte 0x0001820a +_08045280: .4byte 0x000135cc +_08045284: .4byte 0x000181f8 +_08045288: + ldr r4, [r5, 0x70] + adds r0, r5, 0 + bl sub_804187C + adds r2, r0, 0 + adds r0, r4, 0 + adds r0, 0x98 + ldr r0, [r0] + movs r3, 0x4 + ldrsh r1, [r4, r3] + movs r3, 0 + bl sub_800F75C +_080452A2: + adds r6, 0x1 + cmp r6, 0x13 + ble _08045248 + b _0804533E +_080452AA: + movs r6, 0 +_080452AC: + ldr r0, _08045348 + ldr r0, [r0] + lsls r1, r6, 2 + ldr r2, _0804534C + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080452CC + adds r0, r4, 0 + bl sub_806C51C +_080452CC: + adds r6, 0x1 + cmp r6, 0x3 + ble _080452AC + movs r6, 0 +_080452D4: + ldr r5, _08045348 + ldr r0, [r5] + lsls r1, r6, 2 + ldr r3, _08045350 + adds r0, r3 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080452F4 + adds r0, r4, 0 + bl sub_806C51C +_080452F4: + adds r6, 0x1 + cmp r6, 0xF + ble _080452D4 + movs r6, 0 + ldr r0, [r5] + ldr r1, _08045354 + adds r0, r1 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r6, r0 + bge _08045336 + adds r4, r5, 0 +_0804530C: + ldr r0, [r4] + lsls r1, r6, 2 + ldr r3, _08045358 + adds r0, r3 + adds r0, r1 + ldr r0, [r0] + movs r1, 0 + str r1, [sp] + adds r1, r7, 0 + movs r2, 0x1 + movs r3, 0xFF + bl sub_80462AC + adds r6, 0x1 + ldr r0, [r4] + ldr r1, _08045354 + adds r0, r1 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r6, r0 + blt _0804530C +_08045336: + cmp r7, 0 + beq _0804533E + bl sub_807FA9C +_0804533E: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08045348: .4byte gUnknown_203B418 +_0804534C: .4byte 0x0001357c +_08045350: .4byte 0x0001358c +_08045354: .4byte 0x00003904 +_08045358: .4byte 0x0001361c + thumb_func_end sub_804522C + + thumb_func_start sub_804535C +sub_804535C: + push {lr} + adds r2, r0, 0 + cmp r1, 0 + beq _0804536C + ldr r0, [r1] + str r0, [r2, 0xC] + ldr r0, [r1, 0x4] + b _0804538E +_0804536C: + movs r0, 0x4 + ldrsh r1, [r2, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 11 + movs r1, 0xC0 + lsls r1, 4 + adds r0, r1 + str r0, [r2, 0xC] + movs r0, 0x6 + ldrsh r1, [r2, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 11 + movs r1, 0x80 + lsls r1, 5 + adds r0, r1 +_0804538E: + str r0, [r2, 0x10] + pop {r0} + bx r0 + thumb_func_end sub_804535C + + thumb_func_start sub_8045394 +sub_8045394: + str r1, [r0, 0xC] + str r2, [r0, 0x10] + bx lr + thumb_func_end sub_8045394 + + thumb_func_start sub_804539C +sub_804539C: + ldr r3, [r0, 0xC] + adds r3, r1 + str r3, [r0, 0xC] + ldr r1, [r0, 0x10] + adds r1, r2 + str r1, [r0, 0x10] + bx lr + thumb_func_end sub_804539C + + thumb_func_start sub_80453AC +sub_80453AC: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r0, 16 + asrs r0, 16 + mov r8, r0 + movs r0, 0x1 + negs r0, r0 + mov r9, r0 + mov r0, r8 + bl sub_808DACC + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + movs r0, 0x6 + subs r3, r0, r6 + ldr r4, _080453D8 + b _080453DE + .align 2, 0 +_080453D8: .4byte gUnknown_202EE70 +_080453DC: + adds r5, 0x1 +_080453DE: + cmp r5, r3 + bgt _08045400 + movs r2, 0 + cmp r2, r6 + bge _080453FA + adds r1, r5, r4 + b _080453F4 +_080453EC: + adds r1, 0x1 + adds r2, 0x1 + cmp r2, r6 + bge _080453FA +_080453F4: + ldrb r0, [r1] + cmp r0, 0 + beq _080453EC +_080453FA: + cmp r2, r6 + bne _080453DC + mov r9, r5 +_08045400: + movs r0, 0x1 + negs r0, r0 + cmp r9, r0 + beq _080454FC + movs r5, 0 + ldr r7, _080454DC +_0804540C: + ldr r1, _080454E0 + ldr r0, [r1] + lsls r1, r5, 2 + ldr r2, _080454E4 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + cmp r0, 0 + bne _080454F0 + movs r0, 0x1 + str r0, [r4] + adds r0, r4, 0 + adds r0, 0x24 + strb r5, [r0] + ldr r1, _080454E0 + ldr r0, [r1] + adds r0, r7 + str r0, [r4, 0x70] + mov r2, r8 + strh r2, [r0, 0x2] + movs r0, 0 + mov r1, r8 + bl sub_8069F54 + ldr r1, [r4, 0x70] + strh r0, [r1, 0x4] + ldr r0, [r4, 0x70] + movs r5, 0 + strb r5, [r0, 0x6] + movs r0, 0 + mov r1, r8 + bl sub_8069F54 + lsls r0, 16 + asrs r0, 16 + bl sub_80687D0 + str r0, [r4, 0x64] + mov r1, r9 + lsls r0, r1, 4 + adds r0, 0x40 + adds r1, r4, 0 + adds r1, 0x68 + strh r0, [r1] + adds r1, 0x2 + movs r0, 0x7 + strb r0, [r1] + adds r0, r4, 0 + adds r0, 0x6C + movs r2, 0 + strb r2, [r0] + adds r1, 0x1 + movs r0, 0xFF + strb r0, [r1] + adds r0, r4, 0 + adds r0, 0x6D + movs r5, 0x1 + strb r5, [r0] + adds r0, 0x2 + strb r5, [r0] + mov r0, r10 + str r0, [r4, 0x1C] + bl sub_8045ACC + ldr r0, [r4, 0x70] + ldr r1, _080454E8 + adds r0, r1 + mov r2, r9 + strb r2, [r0] + ldr r0, [r4, 0x70] + movs r5, 0xB4 + lsls r5, 1 + adds r0, r5 + strb r6, [r0] + cmp r6, 0 + beq _080454C6 + ldr r3, _080454EC + movs r2, 0x1 + adds r1, r6, 0 +_080454B6: + mov r5, r9 + adds r0, r5, r3 + strb r2, [r0] + movs r0, 0x1 + add r9, r0 + subs r1, 0x1 + cmp r1, 0 + bne _080454B6 +_080454C6: + ldr r1, _080454E0 + ldr r0, [r1] + movs r2, 0xCD + lsls r2, 3 + adds r0, r2 + ldrh r2, [r0] + adds r1, r2, 0x1 + strh r1, [r0] + strh r2, [r4, 0x26] + adds r0, r4, 0 + b _080454FE + .align 2, 0 +_080454DC: .4byte 0x0000069c +_080454E0: .4byte gUnknown_203B418 +_080454E4: .4byte 0x0001357c +_080454E8: .4byte 0x00000167 +_080454EC: .4byte gUnknown_202EE70 +_080454F0: + movs r0, 0x82 + lsls r0, 2 + adds r7, r0 + adds r5, 0x1 + cmp r5, 0x3 + ble _0804540C +_080454FC: + movs r0, 0 +_080454FE: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80453AC + + thumb_func_start sub_804550C +sub_804550C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + lsls r0, 16 + asrs r0, 16 + mov r8, r0 + movs r0, 0x1 + negs r0, r0 + mov r9, r0 + mov r0, r8 + bl sub_808DACC + lsls r0, 24 + lsrs r7, r0, 24 + movs r5, 0 + movs r0, 0x10 + subs r3, r0, r7 + ldr r4, _08045538 + b _0804553E + .align 2, 0 +_08045538: .4byte gUnknown_202EE76 +_0804553C: + adds r5, 0x1 +_0804553E: + cmp r5, r3 + bgt _08045560 + movs r2, 0 + cmp r2, r7 + bge _0804555A + adds r1, r5, r4 + b _08045554 +_0804554C: + adds r1, 0x1 + adds r2, 0x1 + cmp r2, r7 + bge _0804555A +_08045554: + ldrb r0, [r1] + cmp r0, 0 + beq _0804554C +_0804555A: + cmp r2, r7 + bne _0804553C + mov r9, r5 +_08045560: + movs r0, 0x1 + negs r0, r0 + cmp r9, r0 + bne _0804556A + b _08045670 +_0804556A: + movs r5, 0 + movs r1, 0x1 + mov r10, r1 + ldr r2, _08045650 + mov r3, r9 + lsls r0, r3, 4 + adds r0, 0xA0 + str r0, [sp] +_0804557A: + ldr r1, _08045654 + ldr r0, [r1] + lsls r1, r5, 2 + ldr r3, _08045658 + adds r0, r3 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + str r2, [sp, 0x4] + bl sub_80450E0 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r2, [sp, 0x4] + cmp r6, 0 + bne _08045664 + mov r0, r10 + str r0, [r4] + adds r0, r4, 0 + adds r0, 0x24 + strb r5, [r0] + subs r0, 0x2 + strb r6, [r0] + ldr r1, _08045654 + ldr r0, [r1] + adds r0, r2 + str r0, [r4, 0x70] + mov r2, r8 + strh r2, [r0, 0x2] + movs r0, 0 + mov r1, r8 + bl sub_8069F54 + ldr r1, [r4, 0x70] + strh r0, [r1, 0x4] + ldr r0, [r4, 0x70] + mov r3, r10 + strb r3, [r0, 0x6] + movs r0, 0 + mov r1, r8 + bl sub_8069F54 + lsls r0, 16 + asrs r0, 16 + bl sub_80687D0 + str r0, [r4, 0x64] + adds r0, r4, 0 + adds r0, 0x68 + mov r5, sp + ldrh r5, [r5] + strh r5, [r0] + adds r1, r4, 0 + adds r1, 0x6A + movs r0, 0x7 + strb r0, [r1] + adds r0, r4, 0 + adds r0, 0x6C + movs r1, 0 + strb r1, [r0] + adds r1, r4, 0 + adds r1, 0x6B + movs r0, 0xFF + strb r0, [r1] + adds r0, r4, 0 + adds r0, 0x6D + mov r2, r10 + strb r2, [r0] + adds r0, 0x2 + strb r2, [r0] + str r6, [r4, 0x1C] + ldr r0, [r4, 0x70] + ldr r3, _0804565C + adds r0, r3 + mov r5, r9 + strb r5, [r0] + ldr r0, [r4, 0x70] + movs r1, 0xB4 + lsls r1, 1 + adds r0, r1 + strb r7, [r0] + cmp r7, 0 + beq _08045636 + ldr r3, _08045660 + movs r2, 0x1 + adds r1, r7, 0 +_08045626: + mov r5, r9 + adds r0, r5, r3 + strb r2, [r0] + movs r0, 0x1 + add r9, r0 + subs r1, 0x1 + cmp r1, 0 + bne _08045626 +_08045636: + bl sub_8045ACC + ldr r1, _08045654 + ldr r0, [r1] + movs r2, 0xCD + lsls r2, 3 + adds r0, r2 + ldrh r2, [r0] + adds r1, r2, 0x1 + strh r1, [r0] + strh r2, [r4, 0x26] + adds r0, r4, 0 + b _08045672 + .align 2, 0 +_08045650: .4byte 0x00000ebc +_08045654: .4byte gUnknown_203B418 +_08045658: .4byte 0x0001358c +_0804565C: .4byte 0x00000167 +_08045660: .4byte gUnknown_202EE76 +_08045664: + movs r3, 0x82 + lsls r3, 2 + adds r2, r3 + adds r5, 0x1 + cmp r5, 0xF + ble _0804557A +_08045670: + movs r0, 0 +_08045672: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_804550C + + thumb_func_start sub_8045684 +sub_8045684: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r10, r1 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + movs r5, 0 + ldr r7, _080456E4 + ldr r6, _080456E8 +_080456A2: + ldr r0, [r7] + lsls r1, r5, 2 + ldr r2, _080456EC + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _080456F0 + movs r0, 0x2 + str r0, [r4] + ldr r0, [r7] + adds r0, r6 + str r0, [r4, 0x70] + mov r2, r8 + strb r2, [r0] + ldr r0, [r4, 0x70] + mov r2, r9 + strb r2, [r0, 0x1] + str r1, [r4, 0x1C] + adds r0, r4, 0 + adds r0, 0x22 + strb r1, [r0] + mov r2, r10 + ldr r0, [r2] + str r0, [r4, 0x4] + strh r1, [r4, 0x26] + adds r0, r4, 0 + b _080456FA + .align 2, 0 +_080456E4: .4byte gUnknown_203B418 +_080456E8: .4byte 0x00003908 +_080456EC: .4byte 0x0001371c +_080456F0: + adds r6, 0x4 + adds r5, 0x1 + cmp r5, 0x3F + ble _080456A2 + movs r0, 0 +_080456FA: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8045684 + + thumb_func_start sub_8045708 +sub_8045708: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r8, r0 + ldr r1, _08045744 + ldr r0, _08045748 + ldr r0, [r0] + ldr r2, _0804574C + adds r0, r2 + movs r3, 0 + ldrsh r0, [r0, r3] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0804579C + mov r1, r8 + movs r2, 0 + ldrsh r0, [r1, r2] + movs r3, 0x2 + ldrsh r1, [r1, r3] + bl sub_8049590 + ldrh r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + bne _0804579C + b _080457C4 + .align 2, 0 +_08045744: .4byte gUnknown_810ACC0 +_08045748: .4byte gUnknown_203B418 +_0804574C: .4byte 0x00003a0e +_08045750: + movs r0, 0x3 + str r0, [r4] + ldr r0, _08045798 + adds r1, r6, r0 + mov r2, r9 + ldr r0, [r2] + adds r0, r1 + str r0, [r4, 0x70] + mov r3, r8 + ldr r0, [r3] + str r0, [r4, 0x4] + movs r1, 0 + ldrsh r0, [r3, r1] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, 0x4 + lsls r1, 8 + movs r2, 0x2 + ldrsh r0, [r3, r2] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 3 + adds r2, 0x4 + lsls r2, 8 + adds r0, r4, 0 + bl sub_8045394 + movs r0, 0 + strh r7, [r4, 0x26] + adds r1, r4, 0 + adds r1, 0x22 + strb r0, [r1] + str r7, [r4, 0x1C] + adds r0, r4, 0 + b _080457C6 + .align 2, 0 +_08045798: .4byte 0x00003804 +_0804579C: + movs r5, 0 + ldr r3, _080457D4 + mov r9, r3 +_080457A2: + mov r1, r9 + ldr r0, [r1] + lsls r6, r5, 2 + ldr r2, _080457D8 + adds r0, r2 + adds r0, r6 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0 + beq _08045750 + adds r5, 0x1 + cmp r5, 0x3F + ble _080457A2 +_080457C4: + movs r0, 0 +_080457C6: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080457D4: .4byte gUnknown_203B418 +_080457D8: .4byte 0x0001361c + thumb_func_end sub_8045708 + + thumb_func_start sub_80457DC +sub_80457DC: + push {r4-r6,lr} + adds r4, r0, 0 + movs r0, 0x5 + str r0, [r4] + movs r6, 0 + movs r5, 0 + strh r5, [r4, 0x4] + strh r5, [r4, 0x6] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl sub_8045394 + strh r5, [r4, 0x26] + adds r4, 0x22 + strb r6, [r4] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80457DC + + thumb_func_start sub_8045804 +sub_8045804: + push {r4-r6,lr} + adds r4, r0, 0 + bl sub_80450F8 + cmp r0, 0x1 + beq _0804581C + cmp r0, 0x1 + bcc _08045880 + cmp r0, 0x5 + beq _08045880 +_08045818: + movs r0, 0x1 + b _08045882 +_0804581C: + adds r0, r4, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0 + beq _08045880 + ldr r0, _08045874 + ldr r1, [r0] + ldr r0, _08045878 + adds r2, r1, r0 + ldr r5, [r2, 0x10] + ldr r3, [r4, 0x70] + ldrb r0, [r3, 0x6] + cmp r0, 0 + beq _08045818 + ldr r6, _0804587C + adds r0, r1, r6 + ldrb r0, [r0] + cmp r0, 0 + bne _0804584C + adds r0, r3, 0 + adds r0, 0xE4 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08045880 +_0804584C: + adds r0, r2, 0 + adds r0, 0x23 + ldrb r0, [r0] + cmp r0, 0 + bne _08045818 + adds r0, r2, 0 + adds r0, 0x25 + ldrb r0, [r0] + cmp r0, 0 + bne _08045818 + cmp r5, 0 + beq _08045880 + adds r1, r4, 0x4 + adds r0, r2, 0 + bl sub_8083294 + lsls r0, 24 + lsrs r0, 24 + b _08045882 + .align 2, 0 +_08045874: .4byte gUnknown_203B418 +_08045878: .4byte 0x000181e8 +_0804587C: .4byte 0x0001820f +_08045880: + movs r0, 0 +_08045882: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8045804 + + thumb_func_start sub_8045888 +sub_8045888: + push {r4,r5,lr} + adds r4, r0, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0 + beq _08045988 + ldr r1, [r4, 0xC] + cmp r1, 0 + bge _0804589C + adds r1, 0xFF +_0804589C: + asrs r1, 8 + ldr r0, _080458F0 + ldr r2, [r0] + ldr r3, _080458F4 + adds r0, r2, r3 + movs r5, 0 + ldrsh r0, [r0, r5] + subs r3, r1, r0 + ldr r0, [r4, 0x10] + cmp r0, 0 + bge _080458B4 + adds r0, 0xFF +_080458B4: + asrs r0, 8 + ldr r5, _080458F8 + adds r1, r2, r5 + movs r5, 0 + ldrsh r1, [r1, r5] + subs r1, r0, r1 + movs r0, 0x20 + negs r0, r0 + cmp r3, r0 + blt _08045988 + cmp r1, r0 + blt _08045988 + movs r0, 0x88 + lsls r0, 1 + cmp r3, r0 + bgt _08045988 + cmp r1, 0xC0 + bgt _08045988 + ldr r0, _080458FC + adds r5, r2, r0 + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0x5 + bhi _08045984 + lsls r0, 2 + ldr r1, _08045900 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080458F0: .4byte gUnknown_203B418 +_080458F4: .4byte 0x000181f0 +_080458F8: .4byte 0x000181f2 +_080458FC: .4byte 0x000181e8 +_08045900: .4byte _08045904 + .align 2, 0 +_08045904: + .4byte _08045988 + .4byte _08045934 + .4byte _08045964 + .4byte _0804591C + .4byte _08045984 + .4byte _08045988 +_0804591C: + adds r0, r5, 0 + adds r0, 0x26 +_08045920: + ldrb r0, [r0] + cmp r0, 0 + bne _08045984 + adds r0, r4, 0x4 + bl sub_803F428 + lsls r0, 24 +_0804592E: + cmp r0, 0 + bne _08045984 + b _08045988 +_08045934: + ldr r1, [r4, 0x70] + ldrb r0, [r1, 0x6] + cmp r0, 0 + beq _08045984 + ldr r0, _0804595C + ldr r0, [r0] + ldr r2, _08045960 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _08045954 + adds r0, r1, 0 + adds r0, 0xE4 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08045988 +_08045954: + adds r0, r5, 0 + adds r0, 0x25 + b _08045920 + .align 2, 0 +_0804595C: .4byte gUnknown_203B418 +_08045960: .4byte 0x0001820f +_08045964: + ldr r0, _0804597C + ldr r0, [r0] + ldr r3, _08045980 + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _08045984 + adds r0, r4, 0 + adds r0, 0x20 + ldrb r0, [r0] + b _0804592E + .align 2, 0 +_0804597C: .4byte gUnknown_203B418 +_08045980: .4byte 0x0001820f +_08045984: + movs r0, 0x1 + b _0804598A +_08045988: + movs r0, 0 +_0804598A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8045888 + + thumb_func_start sub_8045990 +sub_8045990: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080459E8 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080459E8 + adds r0, r4, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0 + beq _080459E8 + ldr r0, [r4] + cmp r0, 0x1 + bne _080459EC + ldr r0, [r5] + cmp r0, 0x1 + bne _080459DE + adds r0, r5, 0 + bl sub_8071884 + lsls r0, 24 + cmp r0, 0 + bne _080459D8 + ldr r0, [r4, 0x70] + adds r0, 0xE4 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080459E8 +_080459D8: + ldr r0, [r5, 0x70] + adds r0, 0xE8 + b _080459E2 +_080459DE: + ldr r0, [r4, 0x70] + adds r0, 0xE4 +_080459E2: + ldrb r0, [r0] + cmp r0, 0x1 + bne _080459EC +_080459E8: + movs r0, 0 + b _080459F8 +_080459EC: + adds r0, r5, 0x4 + adds r1, r4, 0x4 + bl sub_8083294 + lsls r0, 24 + lsrs r0, 24 +_080459F8: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8045990 + + thumb_func_start sub_8045A00 +sub_8045A00: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08045A58 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08045A58 + adds r0, r4, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0 + beq _08045A58 + ldr r0, [r4] + cmp r0, 0x1 + bne _08045A5C + ldr r0, [r5] + cmp r0, 0x1 + bne _08045A4E + adds r0, r5, 0 + bl sub_8071884 + lsls r0, 24 + cmp r0, 0 + bne _08045A48 + ldr r0, [r4, 0x70] + adds r0, 0xE4 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08045A58 +_08045A48: + ldr r0, [r5, 0x70] + adds r0, 0xE8 + b _08045A52 +_08045A4E: + ldr r0, [r4, 0x70] + adds r0, 0xE4 +_08045A52: + ldrb r0, [r0] + cmp r0, 0x1 + bne _08045A5C +_08045A58: + movs r0, 0 + b _08045A68 +_08045A5C: + adds r0, r5, 0x4 + adds r1, r4, 0x4 + bl sub_808333C + lsls r0, 24 + lsrs r0, 24 +_08045A68: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8045A00 + + thumb_func_start sub_8045A70 +sub_8045A70: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08045AA4 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08045AA4 + adds r0, r4, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0 + beq _08045AA4 + adds r0, r5, 0x4 + adds r1, r4, 0x4 + bl sub_8083294 + lsls r0, 24 + lsrs r0, 24 + b _08045AA6 +_08045AA4: + movs r0, 0 +_08045AA6: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8045A70 + + thumb_func_start sub_8045AAC +sub_8045AAC: + push {lr} + adds r0, 0x4 + bl sub_8083294 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_8045AAC + + thumb_func_start sub_8045ABC +sub_8045ABC: + push {lr} + adds r0, 0x4 + bl sub_808333C + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_8045ABC + + thumb_func_start sub_8045ACC +sub_8045ACC: + push {r4-r7,lr} + movs r6, 0 + movs r5, 0 + ldr r7, _08045B50 +_08045AD4: + ldr r0, [r7] + lsls r1, r5, 2 + ldr r2, _08045B54 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08045AFA + ldr r0, [r7] + lsls r1, r6, 2 + ldr r2, _08045B58 + adds r0, r2 + adds r0, r1 + str r4, [r0] + adds r6, 0x1 +_08045AFA: + adds r5, 0x1 + cmp r5, 0x3 + ble _08045AD4 + movs r5, 0 + ldr r7, _08045B50 +_08045B04: + ldr r0, [r7] + lsls r1, r5, 2 + ldr r2, _08045B5C + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08045B2A + ldr r0, [r7] + lsls r1, r6, 2 + ldr r2, _08045B58 + adds r0, r2 + adds r0, r1 + str r4, [r0] + adds r6, 0x1 +_08045B2A: + adds r5, 0x1 + cmp r5, 0xF + ble _08045B04 + cmp r6, 0x13 + bgt _08045B4A + ldr r4, _08045B50 + ldr r3, _08045B58 + movs r2, 0 +_08045B3A: + ldr r0, [r4] + lsls r1, r6, 2 + adds r0, r3 + adds r0, r1 + str r2, [r0] + adds r6, 0x1 + cmp r6, 0x13 + ble _08045B3A +_08045B4A: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08045B50: .4byte gUnknown_203B418 +_08045B54: .4byte 0x0001357c +_08045B58: .4byte 0x000135cc +_08045B5C: .4byte 0x0001358c + thumb_func_end sub_8045ACC + + thumb_func_start sub_8045B60 +sub_8045B60: + push {r4,lr} + adds r3, r0, 0 + movs r2, 0 + ldr r0, _08045B78 + ldr r0, [r0] + ldr r4, _08045B7C + adds r1, r0, r4 +_08045B6E: + ldr r0, [r1] + cmp r3, r0 + bne _08045B80 + adds r0, r2, 0 + b _08045B8C + .align 2, 0 +_08045B78: .4byte gUnknown_203B418 +_08045B7C: .4byte 0x0001357c +_08045B80: + adds r1, 0x4 + adds r2, 0x1 + cmp r2, 0x3 + ble _08045B6E + movs r0, 0x1 + negs r0, r0 +_08045B8C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8045B60 + + thumb_func_start sub_8045B94 +sub_8045B94: + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r6, r2, 0 + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0x2 + beq _08045BD2 + cmp r0, 0x2 + bhi _08045BB0 + cmp r0, 0x1 + beq _08045BB6 + b _08045BE2 +_08045BB0: + cmp r0, 0x3 + beq _08045BC2 + b _08045BE2 +_08045BB6: + ldr r1, [r4, 0x70] + adds r0, r5, 0 + adds r2, r6, 0 + bl sub_80708B4 + b _08045BEC +_08045BC2: + adds r0, r4, 0 + bl sub_8045110 + adds r1, r0, 0 + adds r0, r5, 0 + bl sub_8045BF8 + b _08045BEC +_08045BD2: + adds r0, r4, 0 + bl sub_804510C + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_807FE84 + b _08045BEC +_08045BE2: + ldr r0, _08045BF4 + ldr r1, [r0] + adds r0, r5, 0 + bl strcpy +_08045BEC: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08045BF4: .4byte gUnknown_80FE6F4 + thumb_func_end sub_8045B94 + + thumb_func_start sub_8045BF8 +sub_8045BF8: + push {lr} + ldr r2, _08045C04 + bl sub_8090E14 + pop {r0} + bx r0 + .align 2, 0 +_08045C04: .4byte gUnknown_80F699C + thumb_func_end sub_8045BF8 + + thumb_func_start sub_8045C08 +sub_8045C08: + push {lr} + ldr r2, _08045C14 + bl sub_8090E14 + pop {r0} + bx r0 + .align 2, 0 +_08045C14: .4byte gUnknown_80F69A8 + thumb_func_end sub_8045C08 + + thumb_func_start sub_8045C18 +sub_8045C18: + push {lr} + ldr r2, _08045C24 + bl sub_8090E14 + pop {r0} + bx r0 + .align 2, 0 +_08045C24: .4byte gUnknown_80F6990 + thumb_func_end sub_8045C18 + + thumb_func_start sub_8045C28 +sub_8045C28: + push {r4-r7,lr} + adds r5, r0, 0 + adds r6, r2, 0 + lsls r1, 24 + lsrs r4, r1, 24 + adds r1, r4, 0 + movs r2, 0 + bl sub_8090A8C + movs r7, 0 + adds r0, r4, 0 + bl sub_8091544 + lsls r0, 24 + cmp r0, 0 + beq _08045C72 + cmp r6, 0 + bne _08045C6C + movs r0, 0x64 + bl sub_8084100 + ldr r1, _08045C64 + ldr r1, [r1] + ldr r2, _08045C68 + adds r1, r2 + ldrb r1, [r1] + cmp r0, r1 + bge _08045C72 + b _08045C76 + .align 2, 0 +_08045C64: .4byte gUnknown_203B418 +_08045C68: .4byte 0x0001c57e +_08045C6C: + cmp r6, 0x1 + bne _08045C72 + movs r7, 0x1 +_08045C72: + cmp r7, 0 + beq _08045C7E +_08045C76: + ldrb r1, [r5] + movs r0, 0x8 + orrs r0, r1 + strb r0, [r5] +_08045C7E: + adds r0, r4, 0 + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6 + bne _08045CA2 + ldr r0, _08045CA8 + ldr r0, [r0] + ldr r1, _08045CAC + adds r0, r1 + ldrb r0, [r0] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 3 + adds r0, r5, 0 + bl sub_8046CE4 +_08045CA2: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08045CA8: .4byte gUnknown_203B418 +_08045CAC: .4byte 0x0001c58b + thumb_func_end sub_8045C28 + + thumb_func_start sub_8045CB0 +sub_8045CB0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + movs r0, 0x38 + bl sub_8084100 + adds r5, r0, 0 + movs r0, 0x20 + bl sub_8084100 + adds r6, r0, 0 + ldr r0, _08045D34 + ldr r0, [r0] + ldr r1, _08045D38 + adds r0, r1 + movs r1, 0 + strh r1, [r0] + movs r0, 0 +_08045CDA: + adds r6, 0x1 + cmp r6, 0x20 + bne _08045CE2 + movs r6, 0 +_08045CE2: + adds r0, 0x1 + mov r10, r0 + movs r3, 0x2 + mov r9, r3 + movs r0, 0x37 + mov r8, r0 +_08045CEE: + adds r5, 0x1 + cmp r5, 0x38 + bne _08045CF6 + movs r5, 0 +_08045CF6: + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_804954C + adds r2, r0, 0 + ldrh r0, [r2] + movs r3, 0x80 + lsls r3, 2 + adds r1, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _08045D92 + ldrh r1, [r2, 0x4] + mov r0, r9 + ands r0, r1 + cmp r0, 0 + beq _08045D92 + movs r7, 0 + lsls r0, r5, 16 + lsls r1, r6, 16 + lsrs r0, 16 + orrs r0, r1 + str r0, [sp, 0x4] + ldrh r1, [r2] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08045D3C + movs r7, 0x1 + movs r0, 0x1 + b _08045D58 + .align 2, 0 +_08045D34: .4byte gUnknown_203B418 +_08045D38: .4byte 0x00003904 +_08045D3C: + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _08045D48 + movs r0, 0x3 + b _08045D58 +_08045D48: + movs r0, 0x40 + ands r0, r1 + lsls r0, 16 + lsrs r0, 16 + negs r0, r0 + asrs r0, 31 + mov r1, r9 + ands r0, r1 +_08045D58: + bl sub_803D73C + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + bl sub_80914E4 + lsls r0, 24 + cmp r0, 0 + bne _08045D6E + movs r7, 0 +_08045D6E: + mov r0, sp + adds r1, r4, 0 + movs r2, 0 + bl sub_8045C28 + cmp r7, 0 + beq _08045D88 + mov r0, sp + ldrb r1, [r0] + mov r0, r9 + orrs r0, r1 + mov r1, sp + strb r0, [r1] +_08045D88: + add r0, sp, 0x4 + mov r1, sp + movs r2, 0x1 + bl sub_80460F8 +_08045D92: + movs r3, 0x1 + negs r3, r3 + add r8, r3 + mov r0, r8 + cmp r0, 0 + bge _08045CEE + mov r0, r10 + cmp r0, 0x1F + ble _08045CDA + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8045CB0 + + thumb_func_start sub_8045DB4 +sub_8045DB4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xB8 + mov r10, r0 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0xA8] + bl sub_8083600 + adds r7, r0, 0 + ldr r0, [r7, 0x70] + str r0, [sp, 0xAC] + mov r1, r10 + movs r2, 0 + ldrsh r0, [r1, r2] + movs r3, 0x2 + ldrsh r1, [r1, r3] + bl sub_804954C + ldr r4, [r0, 0x14] + cmp r4, 0 + bne _08045DE8 + b _080460E0 +_08045DE8: + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0x3 + beq _08045DF4 + b _080460E0 +_08045DF4: + adds r0, r4, 0 + bl sub_8045108 + adds r5, r0, 0 + ldr r0, [sp, 0xAC] + adds r0, 0x48 + ldrb r0, [r0] + cmp r0, 0 + bne _08045E08 + b _0804602E +_08045E08: + adds r0, r7, 0 + movs r1, 0x1 + bl sub_8071518 + lsls r0, 24 + cmp r0, 0 + beq _08045E40 + ldr r0, [sp, 0xA8] + cmp r0, 0 + bne _08045E1E + b _080460E0 +_08045E1E: + ldr r0, _08045E34 + adds r1, r5, 0 + bl sub_8045BF8 + ldr r0, _08045E38 + adds r1, r7, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08045E3C + b _08046048 + .align 2, 0 +_08045E34: .4byte gUnknown_202DE58 +_08045E38: .4byte gUnknown_202DF98 +_08045E3C: .4byte gUnknown_80F8F88 +_08045E40: + ldrb r0, [r5, 0x2] + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6 + bne _08045E7C + movs r0, 0xA6 + lsls r0, 1 + bl sub_8083E38 + adds r0, r5, 0 + bl sub_80915D4 + bl sub_80913A0 + ldr r0, _08045E74 + adds r1, r5, 0 + bl sub_8045BF8 + mov r0, r10 + movs r1, 0x1 + bl sub_80461C8 + ldr r0, _08045E78 + b _08045FD0 + .align 2, 0 +_08045E74: .4byte gUnknown_202DE58 +_08045E78: .4byte gUnknown_80F8FFC +_08045E7C: + ldr r0, _08045EA8 + ldr r0, [r0] + ldr r1, _08045EAC + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08045EB4 + movs r4, 0 + ldr r0, _08045EB0 + mov r2, sp + ldr r0, [r0] + add r1, sp, 0x54 +_08045E94: + stm r1!, {r0} + stm r2!, {r4} + adds r0, 0x4 + adds r4, 0x1 + cmp r4, 0x13 + ble _08045E94 + movs r2, 0x14 + mov r8, r2 + b _08045EC4 + .align 2, 0 +_08045EA8: .4byte gUnknown_203B418 +_08045EAC: .4byte 0x0000065b +_08045EB0: .4byte gUnknown_203B460 +_08045EB4: + ldr r0, [sp, 0xAC] + adds r0, 0x60 + str r0, [sp, 0x54] + movs r0, 0x1 + negs r0, r0 + str r0, [sp] + movs r3, 0x1 + mov r8, r3 +_08045EC4: + ldrb r0, [r5, 0x2] + add r6, sp, 0xB0 + strb r0, [r6] + cmp r0, 0x8 + bls _08045ED0 + b _08046000 +_08045ED0: + ldrb r1, [r5] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08045EDC + b _08046000 +_08045EDC: + movs r1, 0x1 + negs r1, r1 + mov r12, r1 + mov r2, r12 + str r2, [sp, 0xB4] + movs r4, 0 + cmp r4, r8 + bge _08045F2C + ldr r3, _08045FDC + mov r9, r3 + add r3, sp, 0x54 +_08045EF2: + ldr r2, [r3] + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08045F24 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08045F24 + ldr r1, [r5] + mov r6, r9 + ands r1, r6 + ldr r0, [r2] + ands r0, r6 + cmp r1, r0 + bne _08045F24 + ldrb r0, [r2, 0x1] + cmp r0, 0x63 + beq _08045F24 + ldr r1, [sp, 0xB4] + cmp r1, r0 + bge _08045F24 + str r0, [sp, 0xB4] + mov r12, r4 +_08045F24: + adds r3, 0x4 + adds r4, 0x1 + cmp r4, r8 + blt _08045EF2 +_08045F2C: + movs r0, 0x1 + negs r0, r0 + cmp r12, r0 + bne _08045F80 + mov r2, r12 + str r2, [sp, 0xB4] + movs r4, 0 + cmp r4, r8 + bge _08045F78 + add r3, sp, 0xB0 + ldrb r3, [r3] + mov r9, r3 + add r3, sp, 0x54 +_08045F46: + ldr r2, [r3] + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08045F70 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08045F70 + ldrb r6, [r2, 0x2] + cmp r9, r6 + bne _08045F70 + ldrb r0, [r2, 0x1] + cmp r0, 0x63 + beq _08045F70 + ldr r1, [sp, 0xB4] + cmp r1, r0 + bge _08045F70 + str r0, [sp, 0xB4] + mov r12, r4 +_08045F70: + adds r3, 0x4 + adds r4, 0x1 + cmp r4, r8 + blt _08045F46 +_08045F78: + movs r0, 0x1 + negs r0, r0 + cmp r12, r0 + beq _08046000 +_08045F80: + add r0, sp, 0x54 + mov r2, r12 + lsls r4, r2, 2 + adds r3, r0, r4 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r5, 0x1] + adds r1, r0 + cmp r1, 0x62 + ble _08045F96 + movs r1, 0x63 +_08045F96: + strb r1, [r2, 0x1] + ldrb r1, [r5] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08045FAC + ldr r0, [r3] + ldrb r1, [r0] + movs r2, 0x8 + orrs r1, r2 + strb r1, [r0] +_08045FAC: + ldr r0, _08045FE0 + adds r1, r5, 0 + bl sub_8045BF8 + mov r0, r10 + movs r1, 0x1 + bl sub_80461C8 + movs r0, 0xA5 + lsls r0, 1 + bl sub_8083E38 + mov r3, sp + adds r0, r3, r4 + ldr r0, [r0] + cmp r0, 0 + bge _08045FE8 + ldr r0, _08045FE4 +_08045FD0: + ldr r1, [r0] + adds r0, r7, 0 + bl sub_80522A8 + b _08045FF2 + .align 2, 0 +_08045FDC: .4byte 0x00ff0008 +_08045FE0: .4byte gUnknown_202DE58 +_08045FE4: .4byte gUnknown_80F8FC4 +_08045FE8: + ldr r0, _08045FFC + ldr r1, [r0] + adds r0, r7, 0 + bl sub_80522A8 +_08045FF2: + ldrb r0, [r5, 0x2] + bl sub_8052EC0 + b _080460E0 + .align 2, 0 +_08045FFC: .4byte gUnknown_80F8FF8 +_08046000: + movs r4, 0 + cmp r4, r8 + bge _0804602A + ldr r0, [sp, 0x54] + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0804602A + movs r3, 0x1 + add r2, sp, 0x54 +_08046016: + adds r2, 0x4 + adds r4, 0x1 + cmp r4, r8 + bge _0804602A + ldr r0, [r2] + ldrb r1, [r0] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _08046016 +_0804602A: + cmp r4, r8 + bne _08046060 +_0804602E: + ldr r6, [sp, 0xA8] + cmp r6, 0 + beq _080460E0 + ldr r0, _08046054 + adds r1, r5, 0 + bl sub_8045BF8 + ldr r0, _08046058 + adds r1, r7, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _0804605C +_08046048: + ldr r1, [r0] + adds r0, r7, 0 + bl sub_80522A8 + b _080460E0 + .align 2, 0 +_08046054: .4byte gUnknown_202DE58 +_08046058: .4byte gUnknown_202DF98 +_0804605C: .4byte gUnknown_80F8F54 +_08046060: + movs r0, 0xA5 + lsls r0, 1 + bl sub_8083E38 + lsls r0, r4, 2 + add r0, sp + ldr r0, [r0] + cmp r0, 0 + bge _08046094 + ldr r0, [r5] + ldr r1, [sp, 0xAC] + str r0, [r1, 0x60] + ldr r0, _0804608C + adds r1, r5, 0 + bl sub_8045BF8 + mov r0, r10 + movs r1, 0x1 + bl sub_80461C8 + ldr r0, _08046090 + b _080460AC + .align 2, 0 +_0804608C: .4byte gUnknown_202DE58 +_08046090: .4byte gUnknown_80F8FC4 +_08046094: + adds r0, r5, 0 + bl sub_8091290 + lsls r0, 24 + cmp r0, 0 + beq _080460C0 + ldr r0, _080460B8 + adds r1, r7, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _080460BC +_080460AC: + ldr r1, [r0] + adds r0, r7, 0 + bl sub_80522A8 + b _080460DA + .align 2, 0 +_080460B8: .4byte gUnknown_202DF98 +_080460BC: .4byte gUnknown_80F8FAC +_080460C0: + ldr r0, _080460F0 + adds r1, r5, 0 + bl sub_8045BF8 + mov r0, r10 + movs r1, 0x1 + bl sub_80461C8 + ldr r0, _080460F4 + ldr r1, [r0] + adds r0, r7, 0 + bl sub_80522A8 +_080460DA: + ldrb r0, [r5, 0x2] + bl sub_8052EC0 +_080460E0: + add sp, 0xB8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080460F0: .4byte gUnknown_202DE58 +_080460F4: .4byte gUnknown_80F8FF8 + thumb_func_end sub_8045DB4 + + thumb_func_start sub_80460F8 +sub_80460F8: + push {r4-r7,lr} + adds r5, r0, 0 + adds r6, r1, 0 + lsls r2, 24 + lsrs r7, r2, 24 + bl sub_8045708 + adds r4, r0, 0 + cmp r4, 0 + bne _08046110 + movs r0, 0 + b _080461B6 +_08046110: + ldr r1, [r4, 0x70] + ldr r0, [r6] + str r0, [r1] + ldr r2, [r4, 0x70] + ldrb r1, [r2] + movs r0, 0xEF + ands r0, r1 + strb r0, [r2] + adds r1, r4, 0 + adds r1, 0x20 + movs r0, 0x1 + strb r0, [r1] + movs r1, 0 + ldrsh r0, [r5, r1] + movs r2, 0x2 + ldrsh r1, [r5, r2] + bl sub_8049590 + str r4, [r0, 0x14] + ldrh r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08046186 + ldrb r0, [r6, 0x2] + bl sub_80914E4 + lsls r0, 24 + cmp r0, 0 + beq _08046186 + ldrb r1, [r6] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08046170 + cmp r7, 0 + beq _08046186 + adds r0, r6, 0 + bl sub_8090C7C + ldr r1, _08046168 + ldr r2, [r1] + ldr r1, _0804616C + b _0804617E + .align 2, 0 +_08046168: .4byte gUnknown_203B418 +_0804616C: .4byte 0x0000068c +_08046170: + adds r0, r6, 0 + bl sub_8090CCC + ldr r1, _080461BC + ldr r2, [r1] + movs r1, 0xD2 + lsls r1, 3 +_0804617E: + adds r2, r1 + ldr r1, [r2] + adds r1, r0 + str r1, [r2] +_08046186: + movs r6, 0 + movs r4, 0 +_0804618A: + ldr r5, _080461BC + ldr r0, [r5] + lsls r1, r4, 2 + ldr r2, _080461C0 + adds r0, r2 + adds r0, r1 + ldr r0, [r0] + bl sub_80450E0 + lsls r0, 24 + adds r1, r4, 0x1 + cmp r0, 0 + beq _080461A6 + adds r6, r1, 0 +_080461A6: + adds r4, r1, 0 + cmp r4, 0x3F + ble _0804618A + ldr r0, [r5] + ldr r1, _080461C4 + adds r0, r1 + strh r6, [r0] + movs r0, 0x1 +_080461B6: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080461BC: .4byte gUnknown_203B418 +_080461C0: .4byte 0x0001361c +_080461C4: .4byte 0x00003904 + thumb_func_end sub_80460F8 + + thumb_func_start sub_80461C8 +sub_80461C8: + push {r4-r7,lr} + adds r2, r0, 0 + lsls r1, 24 + lsrs r7, r1, 24 + movs r1, 0 + ldrsh r0, [r2, r1] + movs r3, 0x2 + ldrsh r1, [r2, r3] + bl sub_8049590 + adds r6, r0, 0 + ldr r5, [r6, 0x14] + cmp r5, 0 + beq _080461EE + adds r0, r5, 0 + bl sub_80450F8 + cmp r0, 0x3 + beq _080461F2 +_080461EE: + movs r0, 0 + b _08046284 +_080461F2: + adds r0, r5, 0 + bl sub_8045108 + adds r4, r0, 0 + ldrh r1, [r6] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0804624E + ldrb r0, [r4, 0x2] + bl sub_80914E4 + lsls r0, 24 + cmp r0, 0 + beq _0804624E + ldrb r1, [r4] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08046238 + cmp r7, 0 + beq _0804624E + adds r0, r4, 0 + bl sub_8090C7C + ldr r1, _08046230 + ldr r2, [r1] + ldr r1, _08046234 + adds r2, r1 + b _08046248 + .align 2, 0 +_08046230: .4byte gUnknown_203B418 +_08046234: .4byte 0x0000068c +_08046238: + adds r0, r4, 0 + bl sub_8090CCC + ldr r1, _0804628C + ldr r2, [r1] + movs r3, 0xD2 + lsls r3, 3 + adds r2, r3 +_08046248: + ldr r1, [r2] + subs r1, r0 + str r1, [r2] +_0804624E: + movs r0, 0 + str r0, [r6, 0x14] + str r0, [r5] + movs r6, 0 + movs r4, 0 +_08046258: + ldr r5, _0804628C + ldr r0, [r5] + lsls r1, r4, 2 + ldr r2, _08046290 + adds r0, r2 + adds r0, r1 + ldr r0, [r0] + bl sub_80450E0 + lsls r0, 24 + adds r1, r4, 0x1 + cmp r0, 0 + beq _08046274 + adds r6, r1, 0 +_08046274: + adds r4, r1, 0 + cmp r4, 0x3F + ble _08046258 + ldr r0, [r5] + ldr r3, _08046294 + adds r0, r3 + strh r6, [r0] + movs r0, 0x1 +_08046284: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0804628C: .4byte gUnknown_203B418 +_08046290: .4byte 0x0001361c +_08046294: .4byte 0x00003904 + thumb_func_end sub_80461C8 + + thumb_func_start sub_8046298 +sub_8046298: + ldrb r0, [r0, 0x2] + ldr r1, _080462A8 + ldr r1, [r1] + lsls r0, 5 + adds r0, r1 + ldrb r0, [r0, 0xD] + bx lr + .align 2, 0 +_080462A8: .4byte gUnknown_20389A4 + thumb_func_end sub_8046298 + + thumb_func_start sub_80462AC +sub_80462AC: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r4, r0, 0 + ldr r0, [sp, 0x28] + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + lsls r2, 24 + lsrs r5, r2, 24 + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _080462E4 + b _08046498 +_080462E4: + cmp r5, 0 + beq _08046316 + movs r1, 0x4 + ldrsh r0, [r4, r1] + movs r2, 0x6 + ldrsh r1, [r4, r2] + bl sub_804954C + ldrh r0, [r0] + movs r1, 0x3 + ands r1, r0 + cmp r1, 0 + bne _08046300 + b _08046498 +_08046300: + cmp r1, 0x2 + bne _08046308 + movs r3, 0x1 + str r3, [sp, 0x4] +_08046308: + adds r0, r4, 0 + bl sub_8045888 + lsls r0, 24 + cmp r0, 0 + bne _08046316 + b _08046498 +_08046316: + ldr r1, [r4, 0xC] + cmp r1, 0 + bge _0804631E + adds r1, 0xFF +_0804631E: + asrs r1, 8 + ldr r0, _080463A4 + ldr r2, [r0] + ldr r5, _080463A8 + adds r0, r2, r5 + movs r3, 0 + ldrsh r0, [r0, r3] + subs r6, r1, r0 + ldr r3, [r4, 0x10] + ldr r0, [r4, 0x1C] + subs r1, r3, r0 + cmp r1, 0 + bge _0804633A + adds r1, 0xFF +_0804633A: + asrs r1, 8 + ldr r5, _080463AC + adds r0, r2, r5 + movs r5, 0 + ldrsh r2, [r0, r5] + subs r1, r2 + mov r8, r1 + adds r0, r3, 0 + cmp r0, 0 + bge _08046350 + adds r0, 0xFF +_08046350: + asrs r0, 8 + subs r0, r2 + adds r7, r0, 0 + adds r7, 0x8 + lsrs r0, r7, 31 + adds r0, r7, r0 + asrs r7, r0, 1 + movs r0, 0x20 + negs r0, r0 + cmp r6, r0 + bge _08046368 + b _08046498 +_08046368: + cmp r8, r0 + bge _0804636E + b _08046498 +_0804636E: + movs r0, 0x88 + lsls r0, 1 + cmp r6, r0 + ble _08046378 + b _08046498 +_08046378: + mov r0, r8 + cmp r0, 0xC0 + ble _08046380 + b _08046498 +_08046380: + ldr r5, _080463B0 + ldrh r1, [r5, 0x2] + ldr r0, _080463B4 + ands r0, r1 + strh r0, [r5, 0x2] + mov r1, r10 + cmp r1, 0 + beq _080463BC + movs r2, 0x17 + mov r10, r2 + movs r2, 0xA0 + lsls r2, 8 + ldrh r1, [r5, 0x4] + ldr r0, _080463B8 + ands r0, r1 + orrs r0, r2 + strh r0, [r5, 0x4] + b _08046408 + .align 2, 0 +_080463A4: .4byte gUnknown_203B418 +_080463A8: .4byte 0x000181f0 +_080463AC: .4byte 0x000181f2 +_080463B0: .4byte gUnknown_202EDC0 +_080463B4: .4byte 0x0000c1ff +_080463B8: .4byte 0x00000fff +_080463BC: + ldr r0, [r4, 0x70] + bl sub_8046298 + mov r10, r0 + mov r3, r9 + cmp r3, 0xFF + beq _080463EE + cmp r0, 0 + bne _080463EE + ldr r0, _08046478 + add r0, r9 + ldrb r0, [r0] + mov r10, r0 + ldr r0, _0804647C + add r0, r9 + ldrb r1, [r0] + lsls r1, 3 + movs r0, 0x1F + ands r1, r0 + lsls r1, 9 + ldrh r2, [r5, 0x2] + ldr r0, _08046480 + ands r0, r2 + orrs r0, r1 + strh r0, [r5, 0x2] +_080463EE: + ldr r0, [r4, 0x70] + ldrb r0, [r0, 0x2] + bl sub_8090D58 + movs r1, 0xF + ands r0, r1 + lsls r0, 12 + ldr r3, _08046484 + ldrh r2, [r3, 0x4] + ldr r1, _08046488 + ands r1, r2 + orrs r1, r0 + strh r1, [r3, 0x4] +_08046408: + ldr r1, _08046488 + mov r5, r8 + ands r1, r5 + lsls r1, 4 + ldr r4, _08046484 + ldrh r2, [r4, 0x6] + movs r0, 0xF + ands r0, r2 + orrs r0, r1 + strh r0, [r4, 0x6] + ldr r0, _0804648C + ands r6, r0 + ldrh r1, [r4, 0x2] + movs r0, 0xFE + lsls r0, 8 + ands r0, r1 + orrs r0, r6 + strh r0, [r4, 0x2] + ldr r0, [sp, 0x4] + lsls r3, r0, 10 + ldrh r2, [r4] + ldr r1, _08046490 + adds r0, r1, 0 + ands r0, r2 + orrs r0, r3 + strh r0, [r4] + movs r2, 0xC0 + lsls r2, 4 + ldrh r0, [r4, 0x4] + ands r1, r0 + orrs r1, r2 + mov r2, r10 + lsls r0, r2, 2 + movs r3, 0xD0 + lsls r3, 1 + adds r0, r3 + ldr r2, _08046494 + ands r0, r2 + movs r2, 0xFC + lsls r2, 8 + ands r1, r2 + orrs r1, r0 + strh r1, [r4, 0x4] + ldr r5, [sp] + cmp r5, 0 + bne _08046466 + movs r7, 0x1 +_08046466: + adds r0, r4, 0 + adds r1, r7, 0 + movs r2, 0 + movs r3, 0 + bl AddSprite + movs r0, 0x1 + b _0804649A + .align 2, 0 +_08046478: .4byte gUnknown_203B420 +_0804647C: .4byte gUnknown_203B428 +_08046480: .4byte 0x0000c1ff +_08046484: .4byte gUnknown_202EDC0 +_08046488: .4byte 0x00000fff +_0804648C: .4byte 0x000001ff +_08046490: .4byte 0x0000f3ff +_08046494: .4byte 0x000003ff +_08046498: + movs r0, 0 +_0804649A: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80462AC + + thumb_func_start sub_80464AC +sub_80464AC: + push {r4,lr} + ldr r4, _080464C4 + ldrb r0, [r0, 0x2] + bl sub_8090D6C + lsls r0, 3 + adds r0, r4 + ldr r0, [r0] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080464C4: .4byte gUnknown_80F7B14 + thumb_func_end sub_80464AC + + thumb_func_start sub_80464C8 +sub_80464C8: + push {r4-r6,lr} + sub sp, 0x78 + adds r6, r0, 0 + adds r3, r1, 0 + adds r5, r2, 0 + movs r0, 0x3 + str r0, [sp, 0x4] + add r0, sp, 0x28 + movs r4, 0 + strb r4, [r0] + add r1, sp, 0x24 + movs r0, 0x1 + strb r0, [r1] + mov r0, sp + adds r0, 0x26 + strb r4, [r0] + str r5, [sp, 0x74] + ldr r0, [r3] + str r0, [sp, 0x8] + movs r1, 0 + ldrsh r0, [r3, r1] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, 0x4 + lsls r1, 8 + movs r2, 0x2 + ldrsh r0, [r3, r2] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 3 + adds r2, 0x4 + lsls r2, 8 + add r0, sp, 0x4 + bl sub_8045394 + add r0, sp, 0x4 + strh r4, [r0, 0x26] + str r4, [sp] + adds r0, r6, 0 + add r1, sp, 0x4 + adds r2, r5, 0 + movs r3, 0x1 + bl sub_804652C + add sp, 0x78 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80464C8 + + thumb_func_start sub_804652C +sub_804652C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + mov r10, r0 + adds r5, r1, 0 + mov r9, r2 + lsls r3, 24 + lsrs r6, r3, 24 + movs r1, 0x4 + ldrsh r0, [r5, r1] + movs r2, 0x6 + ldrsh r1, [r5, r2] + bl sub_804954C + adds r4, r0, 0 + ldr r0, [r4, 0x14] + movs r3, 0 + str r3, [sp, 0xC] + cmp r0, 0 + beq _0804658C + bl sub_80450F8 + cmp r0, 0x2 + bne _0804658C + adds r4, r5, 0x4 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8046734 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_807FE44 + ldr r0, _080465A4 + ldr r1, [r0] + mov r0, r10 + bl sub_80522A8 + mov r0, r9 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0804658C + b _0804671E +_0804658C: + ldrh r1, [r5, 0x6] + lsls r1, 16 + ldrh r0, [r5, 0x4] + orrs r0, r1 + str r0, [sp] + mov r8, r0 + movs r7, 0x1 + cmp r6, 0 + beq _08046632 + movs r7, 0 + b _08046632 + .align 2, 0 +_080465A4: .4byte gUnknown_80FED30 +_080465A8: + lsls r3, r7, 2 + adds r3, r0 + ldrh r0, [r3] + ldrh r1, [r5, 0x4] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + ldr r1, _08046628 + ldr r2, [sp] + ands r2, r1 + orrs r2, r0 + str r2, [sp] + ldrh r0, [r3, 0x2] + ldrh r3, [r5, 0x6] + adds r0, r3 + lsls r0, 16 + ldr r1, _0804662C + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + movs r2, 0 + ldrsh r0, [r0, r2] + asrs r1, 16 + bl sub_804954C + adds r4, r0, 0 + ldrh r1, [r4] + movs r6, 0x3 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _08046630 + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + cmp r0, 0 + bne _08046630 + ldr r0, [r4, 0x14] + cmp r0, 0 + bne _08046630 + adds r0, r5, 0 + mov r1, sp + bl sub_8046734 + ldr r3, [sp] + mov r8, r3 + ldrh r1, [r4] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0x3 + beq _08046620 + mov r0, sp + mov r1, r9 + movs r2, 0x1 + bl sub_80460F8 + lsls r0, 24 + cmp r0, 0 + beq _08046644 +_08046620: + movs r0, 0x1 + str r0, [sp, 0xC] + b _08046644 + .align 2, 0 +_08046628: .4byte 0xffff0000 +_0804662C: .4byte 0x0000ffff +_08046630: + adds r7, 0x1 +_08046632: + ldr r0, _08046688 + lsls r1, r7, 2 + adds r1, r0 + movs r2, 0 + ldrsh r1, [r1, r2] + cmp r1, 0x63 + bne _080465A8 + movs r3, 0 + str r3, [sp, 0xC] +_08046644: + ldr r0, _0804668C + mov r1, r9 + bl sub_8045BF8 + ldr r0, [sp, 0xC] + cmp r0, 0 + beq _080466C8 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + mov r4, sp + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl sub_80402AC + mov r0, sp + movs r3, 0 + ldrsh r0, [r0, r3] + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl sub_804954C + ldrh r0, [r0] + movs r1, 0x3 + ands r1, r0 + adds r0, r1, 0 + cmp r1, 0x1 + beq _0804669A + cmp r1, 0x1 + bgt _08046690 + cmp r1, 0 + beq _080466AC + b _0804671E + .align 2, 0 +_08046688: .4byte gUnknown_80F4468 +_0804668C: .4byte gUnknown_202DE58 +_08046690: + cmp r0, 0x2 + beq _080466A4 + cmp r0, 0x3 + beq _080466B4 + b _0804671E +_0804669A: + ldr r0, _080466A0 + b _080466B6 + .align 2, 0 +_080466A0: .4byte gUnknown_80F93E8 +_080466A4: + ldr r0, _080466A8 + b _080466B6 + .align 2, 0 +_080466A8: .4byte gUnknown_80F9408 +_080466AC: + ldr r0, _080466B0 + b _080466B6 + .align 2, 0 +_080466B0: .4byte gUnknown_80F9424 +_080466B4: + ldr r0, _080466C4 +_080466B6: + ldr r2, [r0] + mov r0, r10 + mov r1, sp + bl sub_8052364 + b _0804671E + .align 2, 0 +_080466C4: .4byte gUnknown_80F949C +_080466C8: + mov r3, r8 + lsls r1, r3, 16 + asrs r1, 16 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 11 + movs r1, 0xC0 + lsls r1, 4 + adds r0, r1 + str r0, [sp, 0x4] + asrs r1, r3, 16 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 11 + movs r2, 0xC0 + lsls r2, 4 + adds r0, r2 + add r2, sp, 0x4 + str r0, [r2, 0x4] + ldr r3, [sp, 0x30] + cmp r3, 0 + beq _0804670C + movs r1, 0 + ldrsh r0, [r3, r1] + lsls r0, 8 + ldr r1, [sp, 0x4] + adds r0, r1 + str r0, [sp, 0x4] + movs r1, 0x2 + ldrsh r0, [r3, r1] + lsls r0, 8 + ldr r1, [r2, 0x4] + adds r0, r1 + str r0, [r2, 0x4] +_0804670C: + adds r0, r2, 0 + bl sub_804219C + ldr r0, _08046730 + ldr r2, [r0] + mov r0, r10 + mov r1, sp + bl sub_8052364 +_0804671E: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08046730: .4byte gUnknown_80F943C + thumb_func_end sub_804652C + + thumb_func_start sub_8046734 +sub_8046734: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + mov r8, r0 + ldr r0, _08046858 + ldr r0, [r0] + ldr r2, _0804685C + adds r0, r2 + ldrb r0, [r0] + str r0, [sp, 0xC] + movs r0, 0 + ldrsh r2, [r1, r0] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r0, 0x4 + lsls r4, r0, 8 + movs r2, 0x2 + ldrsh r1, [r1, r2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, 0x4 + lsls r5, r0, 8 + mov r1, r8 + ldr r0, [r1, 0xC] + subs r0, r4 + cmp r0, 0 + bge _08046776 + negs r0, r0 +_08046776: + mov r2, r8 + ldr r2, [r2, 0x10] + mov r9, r2 + cmp r0, 0xB + bgt _0804678C + subs r0, r2, r5 + cmp r0, 0 + bge _08046788 + negs r0, r0 +_08046788: + cmp r0, 0xB + ble _08046822 +_0804678C: + movs r0, 0 + mov r10, r0 + movs r1, 0 + str r1, [sp, 0x10] + mov r2, r8 + ldr r0, [r2, 0xC] + str r0, [sp, 0x4] + mov r1, r9 + str r1, [sp, 0x8] + subs r0, r4, r0 + movs r1, 0x18 + bl __divsi3 + adds r6, r0, 0 + mov r2, r9 + subs r0, r5, r2 + movs r1, 0x18 + bl __divsi3 + adds r7, r0, 0 + movs r0, 0 + mov r9, r0 + mov r1, sp + adds r1, 0x4 + str r1, [sp, 0x14] +_080467BE: + ldr r0, [sp, 0x4] + adds r0, r6 + str r0, [sp, 0x4] + ldr r2, [sp, 0x14] + ldr r0, [r2, 0x4] + adds r0, r7 + str r0, [r2, 0x4] + ldr r0, [sp, 0x10] + bl sub_8009C7C + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + mov r0, r8 + str r1, [r0, 0x1C] + add r1, sp, 0x4 + bl sub_804535C + mov r1, r10 + lsls r3, r1, 24 + lsrs r3, 24 + movs r0, 0 + str r0, [sp] + mov r0, r8 + ldr r1, [sp, 0xC] + movs r2, 0 + bl sub_80462AC + movs r0, 0x13 + bl sub_803E46C + ldr r2, [sp, 0x10] + adds r2, 0x55 + str r2, [sp, 0x10] + movs r0, 0x3 + mov r1, r9 + ands r0, r1 + cmp r0, 0 + bne _08046810 + movs r2, 0x1 + add r10, r2 +_08046810: + movs r0, 0x7 + mov r1, r10 + ands r1, r0 + mov r10, r1 + movs r2, 0x1 + add r9, r2 + mov r0, r9 + cmp r0, 0x17 + ble _080467BE +_08046822: + mov r0, r8 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_8045394 + movs r0, 0 + mov r1, r8 + str r0, [r1, 0x1C] + str r0, [sp] + mov r0, r8 + ldr r1, [sp, 0xC] + movs r2, 0x1 + movs r3, 0xFF + bl sub_80462AC + movs r0, 0x13 + bl sub_803E46C + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08046858: .4byte gUnknown_203B418 +_0804685C: .4byte 0x00018210 + thumb_func_end sub_8046734 + + thumb_func_start sub_8046860 +sub_8046860: + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r1, 0 + adds r5, r2, 0 + str r3, [sp] + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_804687C + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8046860 + + thumb_func_start sub_804687C +sub_804687C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, _08046970 + add sp, r4 + ldr r5, _08046974 + add r5, sp + str r0, [r5] + movs r0, 0xA5 + lsls r0, 3 + add r0, sp + str r1, [r0] + mov r8, r2 + ldr r1, _08046978 + add r1, sp + str r3, [r1] + movs r1, 0 + movs r7, 0x1D + ldr r0, _0804697C + add r0, sp +_080468A8: + strb r1, [r0] + subs r0, 0x1 + subs r7, 0x1 + cmp r7, 0 + bge _080468A8 + movs r7, 0 + movs r2, 0xAD + lsls r2, 3 + add r2, sp + ldr r2, [r2] + cmp r7, r2 + blt _080468C2 + b _080469DE +_080468C2: + ldr r3, _08046980 + mov r9, r3 + ldr r5, _08046984 + movs r0, 0 + ldrsh r5, [r5, r0] + ldr r0, _08046988 + add r0, sp + str r5, [r0] +_080468D2: + mov r1, r8 + ldrh r0, [r1] + ldr r1, _0804698C + ands r4, r1 + orrs r4, r0 + mov r2, r8 + ldrh r0, [r2, 0x2] + lsls r0, 16 + mov r3, r9 + ands r4, r3 + orrs r4, r0 + movs r5, 0 + adds r0, r7, 0x1 + mov r10, r0 + ldr r1, _08046984 + ldr r2, _08046988 + add r2, sp + ldr r2, [r2] + cmp r2, 0x63 + beq _080469B0 + ldr r3, _08046990 + add r3, sp + ldr r0, _08046994 + add r0, sp + str r3, [r0] +_08046904: + ldr r0, _08046998 + add r0, sp + adds r6, r0, r5 + ldrb r0, [r6] + cmp r0, 0 + bne _0804699C + lsls r2, r5, 2 + adds r2, r1 + ldrh r0, [r2] + mov r1, r8 + ldrh r1, [r1] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + ldr r1, _0804698C + ands r4, r1 + orrs r4, r0 + ldrh r0, [r2, 0x2] + mov r2, r8 + ldrh r2, [r2, 0x2] + adds r0, r2 + lsls r0, 16 + mov r3, r9 + ands r4, r3 + orrs r4, r0 + lsls r0, r4, 16 + asrs r0, 16 + asrs r1, r4, 16 + bl sub_804954C + adds r2, r0, 0 + ldrh r1, [r2] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _0804699C + movs r3, 0x80 + lsls r3, 2 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _0804699C + ldr r0, [r2, 0x14] + cmp r0, 0 + bne _0804699C + lsls r0, r7, 2 + ldr r5, _08046994 + add r5, sp + ldr r5, [r5] + adds r0, r5, r0 + str r4, [r0] + movs r0, 0x1 + strb r0, [r6] + b _080469CE + .align 2, 0 +_08046970: .4byte 0xfffffab8 +_08046974: .4byte 0x00000524 +_08046978: .4byte 0x0000052c +_0804697C: .4byte 0x00000521 +_08046980: .4byte 0x0000ffff +_08046984: .4byte gUnknown_80F4468 +_08046988: .4byte 0x00000534 +_0804698C: .4byte 0xffff0000 +_08046990: .4byte 0x0000048c +_08046994: .4byte 0x00000544 +_08046998: .4byte 0x00000504 +_0804699C: + adds r5, 0x1 + cmp r5, 0x1D + bgt _080469B0 + lsls r0, r5, 2 + ldr r1, _08046A18 + adds r0, r1 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0x63 + bne _08046904 +_080469B0: + movs r3, 0 + cmp r3, 0 + bne _080469CE + ldr r1, _08046A1C + add r1, sp + lsls r0, r7, 2 + adds r1, r0 + ldrh r2, [r1] + mov r0, r9 + orrs r0, r2 + strh r0, [r1] + ldrh r2, [r1, 0x2] + mov r0, r9 + orrs r0, r2 + strh r0, [r1, 0x2] +_080469CE: + mov r7, r10 + movs r5, 0xAD + lsls r5, 3 + add r5, sp + ldr r5, [r5] + cmp r7, r5 + bge _080469DE + b _080468D2 +_080469DE: + movs r1, 0 + mov r9, r1 + movs r7, 0 + movs r0, 0xAD + lsls r0, 3 + add r0, sp + ldr r0, [r0] + cmp r7, r0 + blt _080469F2 + b _08046B0A +_080469F2: + movs r2, 0 + mov r8, r2 +_080469F6: + ldr r0, _08046A1C + add r0, sp + lsls r2, r7, 2 + adds r3, r0, r2 + movs r4, 0 + ldrsh r0, [r3, r4] + cmp r0, 0 + bge _08046A20 + movs r0, 0x74 + muls r0, r7 + add r0, sp + adds r0, 0x4 + mov r5, r8 + str r5, [r0] + movs r0, 0x1 + mov r9, r0 + b _08046AFA + .align 2, 0 +_08046A18: .4byte gUnknown_80F4468 +_08046A1C: .4byte 0x0000048c +_08046A20: + movs r0, 0x74 + adds r6, r7, 0 + muls r6, r0 + mov r4, sp + adds r4, r6 + adds r4, 0x4 + movs r0, 0x3 + str r0, [r4] + adds r0, r4, 0 + adds r0, 0x24 + mov r1, r8 + strb r1, [r0] + adds r1, r4, 0 + adds r1, 0x20 + movs r0, 0x1 + strb r0, [r1] + adds r0, r4, 0 + adds r0, 0x22 + mov r5, r8 + strb r5, [r0] + add r0, sp, 0x74 + adds r0, r6 + ldr r1, _08046B2C + add r1, sp + ldr r1, [r1] + adds r2, r1, r2 + str r2, [r0] + add r0, sp, 0x8 + adds r0, r6 + ldr r1, [r3] + str r1, [r0] + movs r2, 0xA5 + lsls r2, 3 + add r2, sp + ldr r2, [r2] + movs r5, 0 + ldrsh r0, [r2, r5] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, 0x4 + lsls r1, 8 + movs r5, 0x2 + ldrsh r0, [r2, r5] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 3 + adds r2, 0x4 + lsls r2, 8 + adds r0, r4, 0 + movs r5, 0xA8 + lsls r5, 3 + add r5, sp + str r3, [r5] + bl sub_8045394 + mov r0, r8 + strh r0, [r4, 0x26] + ldr r4, _08046B30 + add r4, sp + lsls r5, r7, 3 + adds r4, r5 + movs r1, 0xA8 + lsls r1, 3 + add r1, sp + ldr r3, [r1] + movs r2, 0 + ldrsh r1, [r3, r2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, 0x4 + lsls r0, 8 + add r1, sp, 0x10 + adds r1, r6 + ldr r1, [r1] + subs r0, r1 + movs r1, 0x18 + movs r2, 0xA8 + lsls r2, 3 + add r2, sp + str r3, [r2] + bl __divsi3 + str r0, [r4] + movs r4, 0x97 + lsls r4, 3 + add r4, sp + adds r4, r5 + movs r5, 0xA8 + lsls r5, 3 + add r5, sp + ldr r3, [r5] + movs r0, 0x2 + ldrsh r1, [r3, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, 0x4 + lsls r0, 8 + add r1, sp, 0x14 + adds r1, r6 + ldr r1, [r1] + subs r0, r1 + movs r1, 0x18 + bl __divsi3 + str r0, [r4] + movs r1, 0x1 +_08046AFA: + adds r7, 0x1 + movs r2, 0xAD + lsls r2, 3 + add r2, sp + ldr r2, [r2] + cmp r7, r2 + bge _08046B0A + b _080469F6 +_08046B0A: + cmp r1, 0 + bne _08046B54 + movs r3, 0xAD + lsls r3, 3 + add r3, sp + ldr r3, [r3] + cmp r3, 0x1 + ble _08046B3C + ldr r0, _08046B34 + ldr r1, [r0] + ldr r4, _08046B38 + add r4, sp + ldr r0, [r4] + bl sub_80522A8 + b _08046C7C + .align 2, 0 +_08046B2C: .4byte 0x0000052c +_08046B30: .4byte 0x000004b4 +_08046B34: .4byte gUnknown_80F945C +_08046B38: .4byte 0x00000524 +_08046B3C: + ldr r0, _08046B4C + ldr r1, [r0] + ldr r5, _08046B50 + add r5, sp + ldr r0, [r5] + bl sub_80522A8 + b _08046C7C + .align 2, 0 +_08046B4C: .4byte gUnknown_80F943C +_08046B50: .4byte 0x00000524 +_08046B54: + mov r0, r9 + cmp r0, 0 + beq _08046B68 + ldr r0, _08046C90 + ldr r1, [r0] + ldr r2, _08046C94 + add r2, sp + ldr r0, [r2] + bl sub_80522A8 +_08046B68: + movs r3, 0 + mov r9, r3 + ldr r0, _08046C98 + ldr r0, [r0] + ldr r4, _08046C9C + adds r0, r4 + ldrb r0, [r0] + movs r5, 0xA6 + lsls r5, 3 + add r5, sp + str r0, [r5] + mov r10, r3 + movs r6, 0 +_08046B82: + movs r7, 0 + mov r0, r10 + adds r0, 0x55 + movs r1, 0xA7 + lsls r1, 3 + add r1, sp + str r0, [r1] + adds r2, r6, 0x1 + ldr r3, _08046CA0 + add r3, sp + str r2, [r3] + movs r4, 0xAD + lsls r4, 3 + add r4, sp + ldr r4, [r4] + cmp r7, r4 + bge _08046C14 + mov r5, r9 + lsls r5, 24 + mov r8, r5 +_08046BAA: + movs r0, 0x74 + adds r5, r7, 0 + muls r5, r0 + mov r4, sp + adds r4, r5 + adds r4, 0x4 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08046C06 + ldr r0, _08046CA4 + add r0, sp + lsls r2, r7, 3 + adds r0, r2 + ldr r1, [r0] + movs r0, 0x97 + lsls r0, 3 + add r0, sp + adds r0, r2 + ldr r2, [r0] + adds r0, r4, 0 + bl sub_804539C + mov r0, r10 + bl sub_8009C7C + add r2, sp, 0x20 + adds r2, r5 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + str r1, [r2] + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0xA6 + lsls r2, 3 + add r2, sp + ldr r1, [r2] + movs r2, 0x1 + mov r4, r8 + lsrs r3, r4, 24 + bl sub_80462AC +_08046C06: + adds r7, 0x1 + movs r5, 0xAD + lsls r5, 3 + add r5, sp + ldr r5, [r5] + cmp r7, r5 + blt _08046BAA +_08046C14: + movs r0, 0x13 + bl sub_803E46C + movs r0, 0xA7 + lsls r0, 3 + add r0, sp + ldr r0, [r0] + mov r10, r0 + movs r0, 0x3 + ands r0, r6 + cmp r0, 0 + bne _08046C30 + movs r1, 0x1 + add r9, r1 +_08046C30: + movs r0, 0x7 + mov r2, r9 + ands r2, r0 + mov r9, r2 + ldr r3, _08046CA0 + add r3, sp + ldr r6, [r3] + cmp r6, 0x17 + ble _08046B82 + movs r4, 0xAD + lsls r4, 3 + add r4, sp + ldr r4, [r4] + cmp r4, 0 + ble _08046C7C + ldr r0, _08046CA8 + add r0, sp + ldr r5, [r0] + ldr r4, _08046CAC + add r4, sp + movs r1, 0xAD + lsls r1, 3 + add r1, sp + ldr r7, [r1] +_08046C60: + movs r2, 0 + ldrsh r0, [r4, r2] + cmp r0, 0 + blt _08046C72 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_80460F8 +_08046C72: + adds r5, 0x4 + adds r4, 0x4 + subs r7, 0x1 + cmp r7, 0 + bne _08046C60 +_08046C7C: + movs r3, 0xA9 + lsls r3, 3 + add sp, r3 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08046C90: .4byte gUnknown_80F947C +_08046C94: .4byte 0x00000524 +_08046C98: .4byte gUnknown_203B418 +_08046C9C: .4byte 0x00018210 +_08046CA0: .4byte 0x0000053c +_08046CA4: .4byte 0x000004b4 +_08046CA8: .4byte 0x0000052c +_08046CAC: .4byte 0x0000048c + thumb_func_end sub_804687C + + thumb_func_start sub_8046CB0 +sub_8046CB0: + push {lr} + lsls r1, 24 + lsrs r1, 24 + ldr r0, [r0, 0x70] + adds r3, r0, 0 + adds r0, 0x60 + ldrb r2, [r0] + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _08046CDC + movs r0, 0x8 + ands r0, r2 + cmp r0, 0 + bne _08046CDC + adds r0, r3, 0 + adds r0, 0x62 + ldrb r0, [r0] + cmp r0, r1 + bne _08046CDC + movs r0, 0x1 + b _08046CDE +_08046CDC: + movs r0, 0 +_08046CDE: + pop {r1} + bx r1 + thumb_func_end sub_8046CB0 + + thumb_func_start sub_8046CE4 +sub_8046CE4: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x64 + bl sub_8084100 + adds r1, r0, 0 + movs r2, 0 + ldr r3, _08046D04 +_08046CF6: + lsls r0, r1, 2 + adds r0, r3 + ldr r0, [r0] + cmp r0, r5 + bgt _08046D08 + strb r1, [r4, 0x1] + b _08046D18 + .align 2, 0 +_08046D04: .4byte gUnknown_810A3F0 +_08046D08: + lsrs r0, r1, 31 + adds r0, r1, r0 + asrs r1, r0, 1 + adds r2, 0x1 + cmp r2, 0xC7 + ble _08046CF6 + movs r0, 0x1 + strb r0, [r4, 0x1] +_08046D18: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8046CE4 + + thumb_func_start sub_8046D20 +sub_8046D20: + push {r4,r5,lr} + ldr r4, _08046D5C + ldr r0, [r4] + ldrb r5, [r0, 0x8] + bl sub_8046D70 + ldr r1, [r4] + strb r0, [r1, 0x8] + ldr r0, [r4] + ldrb r0, [r0, 0x8] + cmp r0, 0x1 + bne _08046D64 + cmp r5, 0 + bne _08046D64 + ldr r0, _08046D60 + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_8052B8C + adds r1, r0, 0 + cmp r1, 0x1 + bne _08046D64 + ldr r0, [r4] + strb r1, [r0, 0x4] + ldr r1, [r4] + movs r0, 0x2 + strb r0, [r1, 0x11] + b _08046D68 + .align 2, 0 +_08046D5C: .4byte gUnknown_203B418 +_08046D60: .4byte gUnknown_80FA408 +_08046D64: + bl sub_8046D8C +_08046D68: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8046D20 + + thumb_func_start sub_8046D70 +sub_8046D70: + push {lr} + ldr r0, _08046D84 + ldr r0, [r0] + ldr r1, _08046D88 + adds r0, r1 + ldrb r0, [r0] + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_08046D84: .4byte gUnknown_203B418 +_08046D88: .4byte 0x0000068a + thumb_func_end sub_8046D70 + + thumb_func_start sub_8046D8C +sub_8046D8C: + push {r4-r7,lr} + sub sp, 0xC + movs r6, 0 + ldr r5, _08046EDC + movs r4, 0 +_08046D96: + movs r7, 0 + movs r0, 0x1 + negs r0, r0 + str r0, [sp] + str r0, [sp, 0x4] + str r0, [sp, 0x8] + movs r3, 0 + ldr r2, [r5] +_08046DA6: + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08046DC8 + ldrb r0, [r2, 0x2] + cmp r0, 0x79 + bne _08046DB8 + str r3, [sp] +_08046DB8: + ldrb r0, [r2, 0x2] + cmp r0, 0x77 + bne _08046DC0 + str r3, [sp, 0x4] +_08046DC0: + ldrb r0, [r2, 0x2] + cmp r0, 0x78 + bne _08046DC8 + str r3, [sp, 0x8] +_08046DC8: + adds r2, 0x4 + adds r3, 0x1 + cmp r3, 0x13 + ble _08046DA6 + ldr r1, [sp] + cmp r1, 0 + blt _08046E1E + ldr r0, [sp, 0x4] + cmp r0, 0 + blt _08046E1E + ldr r0, [sp, 0x8] + cmp r0, 0 + blt _08046E1E + movs r7, 0x1 + movs r6, 0x1 + lsls r1, 2 + ldr r0, [r5] + adds r1, r0 + strb r4, [r1, 0x2] + strb r4, [r1, 0x1] + strb r4, [r1] + ldr r0, [sp, 0x4] + lsls r0, 2 + ldr r1, [r5] + adds r0, r1 + strb r4, [r0, 0x2] + strb r4, [r0, 0x1] + strb r4, [r0] + ldr r0, [sp, 0x8] + lsls r0, 2 + ldr r1, [r5] + adds r0, r1 + strb r4, [r0, 0x2] + strb r4, [r0, 0x1] + strb r4, [r0] + ldr r1, [sp] + lsls r1, 2 + ldr r0, [r5] + adds r0, r1 + movs r1, 0x7A + movs r2, 0 + bl sub_8090A8C +_08046E1E: + cmp r7, 0 + bne _08046D96 + bl sub_80910B4 + cmp r6, 0 + beq _08046ED4 + bl sub_8083600 + adds r4, r0, 0 + ldr r0, _08046EE0 + bl sub_80855E4 + ldr r6, _08046EE4 + ldr r0, [r6] + ldr r5, _08046EE8 + adds r0, r5 + movs r1, 0x1 + strb r1, [r0] + ldr r0, _08046EEC + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 + movs r0, 0x3C + movs r1, 0x41 + bl sub_803E708 + ldr r0, _08046EF0 + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 + adds r0, r4, 0 + movs r1, 0x4 + movs r2, 0xA + movs r3, 0 + bl sub_80869E4 + adds r0, r4, 0 + adds r0, 0xC + movs r1, 0x86 + lsls r1, 1 + movs r2, 0 + bl sub_80416E0 + adds r0, r4, 0 + movs r1, 0xD7 + bl sub_80421C0 + movs r0, 0x3C + movs r1, 0x41 + bl sub_803E708 + ldr r0, _08046EF4 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08046EF8 + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 + movs r0, 0xA + movs r1, 0x41 + bl sub_803E708 + movs r0, 0xD4 + bl sub_8083E38 + ldr r0, _08046EFC + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 + movs r0, 0xA + movs r1, 0x41 + bl sub_803E708 + movs r0, 0x1 + bl sub_804178C + ldr r0, [r6] + adds r0, r5 + strb r7, [r0] + bl sub_8040A84 +_08046ED4: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08046EDC: .4byte gUnknown_203B460 +_08046EE0: .4byte sub_80861A8 +_08046EE4: .4byte gUnknown_203B418 +_08046EE8: .4byte 0x0001356c +_08046EEC: .4byte gUnknown_810531C +_08046EF0: .4byte gUnknown_8105360 +_08046EF4: .4byte gUnknown_202DF98 +_08046EF8: .4byte gUnknown_81053A8 +_08046EFC: .4byte gUnknown_8105434 + thumb_func_end sub_8046D8C + + thumb_func_start sub_8046F00 +sub_8046F00: + push {r4-r7,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0x2] + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bne _08046F7C + ldrb r0, [r4, 0x2] + bl sub_80913CC + lsls r0, 16 + lsrs r7, r0, 16 + ldrb r0, [r4, 0x2] + bl sub_80915A0 + lsls r0, 24 + cmp r0, 0 + bne _08046F6E + movs r6, 0 +_08046F2A: + ldr r0, _08046F74 + ldr r0, [r0] + lsls r1, r6, 2 + ldr r2, _08046F78 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08046F68 + ldr r0, [r4, 0x70] + movs r2, 0x2 + ldrsh r1, [r0, r2] + adds r0, r7, 0 + bl sub_808E190 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + movs r1, 0 + bl sub_8070B6C + lsls r0, 24 + cmp r0, 0 + beq _08046F64 + movs r5, 0 +_08046F64: + cmp r5, 0 + bne _08046F7C +_08046F68: + adds r6, 0x1 + cmp r6, 0x3 + ble _08046F2A +_08046F6E: + movs r0, 0 + b _08046F7E + .align 2, 0 +_08046F74: .4byte gUnknown_203B418 +_08046F78: .4byte 0x0001357c +_08046F7C: + movs r0, 0x1 +_08046F7E: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8046F00 + + thumb_func_start sub_8046F84 +sub_8046F84: + push {r4-r7,lr} + adds r7, r0, 0 + movs r5, 0 + ldr r4, _08047000 + movs r6, 0x1 + movs r3, 0 +_08046F90: + lsls r1, r5, 2 + ldr r0, [r4] + adds r2, r0, r1 + ldrb r1, [r2] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _08046FAE + ldrb r0, [r2] + ands r0, r7 + cmp r0, 0 + beq _08046FAE + strb r3, [r2, 0x2] + strb r3, [r2, 0x1] + strb r3, [r2] +_08046FAE: + adds r5, 0x1 + cmp r5, 0x13 + ble _08046F90 + bl sub_80910B4 + movs r5, 0 + movs r6, 0 +_08046FBC: + ldr r0, _08047004 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _08047008 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08046FF4 + ldr r0, [r4, 0x70] + adds r2, r0, 0 + adds r2, 0x60 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08046FF4 + ldrb r0, [r2] + ands r0, r7 + cmp r0, 0 + beq _08046FF4 + strb r6, [r2, 0x2] + strb r6, [r2, 0x1] + strb r6, [r2] +_08046FF4: + adds r5, 0x1 + cmp r5, 0x3 + ble _08046FBC + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08047000: .4byte gUnknown_203B460 +_08047004: .4byte gUnknown_203B418 +_08047008: .4byte 0x0001357c + thumb_func_end sub_8046F84 + + thumb_func_start sub_804700C +sub_804700C: + push {r4,r5,lr} + movs r5, 0 + ldr r4, _08047078 +_08047012: + lsls r1, r5, 2 + ldr r0, [r4] + adds r2, r0, r1 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0804702C + adds r0, r2, 0 + movs r1, 0x46 + movs r2, 0 + bl sub_8090A8C +_0804702C: + adds r5, 0x1 + cmp r5, 0x13 + ble _08047012 + bl sub_80910B4 + movs r5, 0 +_08047038: + ldr r0, _0804707C + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _08047080 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0804706C + ldr r0, [r4, 0x70] + adds r2, r0, 0 + adds r2, 0x60 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0804706C + adds r0, r2, 0 + movs r1, 0x46 + movs r2, 0 + bl sub_8090A8C +_0804706C: + adds r5, 0x1 + cmp r5, 0x3 + ble _08047038 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08047078: .4byte gUnknown_203B460 +_0804707C: .4byte gUnknown_203B418 +_08047080: .4byte 0x0001357c + thumb_func_end sub_804700C + + thumb_func_start sub_8047084 +sub_8047084: + push {r4-r6,lr} + adds r6, r0, 0 + movs r5, 0 + ldr r0, _080470E8 + ldr r2, [r0] + movs r3, 0x1 +_08047090: + ldrb r1, [r2] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _080470A2 + ldrb r0, [r2] + ands r0, r6 + cmp r0, 0 + bne _080470E2 +_080470A2: + adds r2, 0x4 + adds r5, 0x1 + cmp r5, 0x13 + ble _08047090 + bl sub_80910B4 + movs r5, 0 +_080470B0: + ldr r0, _080470EC + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _080470F0 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080470F4 + ldr r0, [r4, 0x70] + adds r2, r0, 0 + adds r2, 0x60 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080470F4 + ldrb r0, [r2] + ands r0, r6 + cmp r0, 0 + beq _080470F4 +_080470E2: + movs r0, 0x1 + b _080470FC + .align 2, 0 +_080470E8: .4byte gUnknown_203B460 +_080470EC: .4byte gUnknown_203B418 +_080470F0: .4byte 0x0001357c +_080470F4: + adds r5, 0x1 + cmp r5, 0x3 + ble _080470B0 + movs r0, 0 +_080470FC: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8047084 + + thumb_func_start sub_8047104 +sub_8047104: + push {r4-r6,lr} + movs r6, 0 + movs r5, 0 +_0804710A: + ldr r0, _08047154 + lsls r1, r6, 2 + ldr r0, [r0] + adds r4, r0, r1 + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08047142 + ldrb r0, [r4, 0x2] + cmp r0, 0x69 + bne _08047132 + adds r0, r4, 0 + bl sub_80915D4 + bl sub_80913A0 + strb r5, [r4, 0x2] + strb r5, [r4, 0x1] + strb r5, [r4] +_08047132: + ldrb r1, [r4] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08047142 + strb r5, [r4, 0x2] + strb r5, [r4, 0x1] + strb r5, [r4] +_08047142: + adds r6, 0x1 + cmp r6, 0x13 + ble _0804710A + bl sub_80910B4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08047154: .4byte gUnknown_203B460 + thumb_func_end sub_8047104 + + thumb_func_start sub_8047158 +sub_8047158: + push {r4-r6,lr} + movs r3, 0 + ldr r5, _0804718C + movs r6, 0x1 + movs r4, 0x4 +_08047162: + lsls r1, r3, 2 + ldr r0, [r5] + adds r2, r0, r1 + ldrb r1, [r2] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _08047180 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _08047180 + movs r0, 0xFB + ands r0, r1 + strb r0, [r2] +_08047180: + adds r3, 0x1 + cmp r3, 0x13 + ble _08047162 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0804718C: .4byte gUnknown_203B460 + thumb_func_end sub_8047158 + + thumb_func_start sub_8047190 +sub_8047190: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, _080472E8 + add sp, r4 + mov r9, r0 + str r1, [sp, 0x214] + ldr r6, _080472EC + ldr r1, [r6] + ldr r4, _080472F0 + adds r0, r1, r4 + ldrb r0, [r0] + str r0, [sp, 0x220] + mov r8, r3 + adds r7, r1, 0 + adds r7, 0xC0 + movs r0, 0x3 + str r0, [r7] + adds r0, r1, 0 + adds r0, 0xE4 + movs r4, 0 + strb r4, [r0] + subs r0, 0x4 + movs r5, 0x1 + strb r5, [r0] + adds r0, 0x2 + strb r4, [r0] + ldr r0, [sp, 0x214] + str r0, [r7, 0x70] + str r4, [r7, 0x1C] + ldr r0, [r2] + str r0, [r7, 0x4] + movs r1, 0 + ldrsh r0, [r2, r1] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, 0x4 + lsls r1, 8 + movs r3, 0x2 + ldrsh r0, [r2, r3] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 11 + adds r0, r7, 0 + bl sub_8045394 + strh r4, [r7, 0x26] + str r4, [sp, 0x224] + mov r0, r9 + bl sub_80450F8 + cmp r0, 0x1 + bne _08047214 + mov r0, r9 + movs r1, 0x2A + bl sub_8046CB0 + lsls r0, 24 + lsrs r0, 24 + negs r1, r0 + orrs r1, r0 + lsrs r1, 31 + str r1, [sp, 0x224] +_08047214: + ldr r0, [sp, 0x260] + movs r1, 0x2 + ldrsh r0, [r0, r1] + str r0, [sp, 0x218] + movs r2, 0 + str r2, [sp, 0x21C] + ldr r0, [r6] + ldr r3, _080472F4 + adds r0, r3 + strb r5, [r0] +_08047228: + ldr r4, [r7, 0x4] + mov r10, r4 + ldr r1, [sp, 0x260] + ldrb r0, [r1, 0x1] + cmp r0, 0 + beq _080472AE + ldrb r0, [r1] + cmp r0, 0 + bne _080472AE + movs r2, 0x4 + ldrsh r0, [r7, r2] + ldr r2, _080472F8 + mov r3, r8 + lsls r4, r3, 2 + adds r2, r4, r2 + movs r3, 0 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r3, 0x6 + ldrsh r1, [r7, r3] + movs r3, 0x2 + ldrsh r2, [r2, r3] + adds r1, r2 + bl sub_804954C + adds r5, r0, 0 + ldrh r1, [r5] + movs r0, 0x3 + ands r0, r1 + str r4, [sp, 0x230] + cmp r0, 0 + bne _080472AE + movs r6, 0 + ldr r1, _080472FC + mov r4, r10 + lsls r0, r4, 16 + asrs r0, 16 + str r0, [sp, 0x23C] + ldr r0, [sp, 0x230] + adds r5, r0, r1 + asrs r2, r4, 16 +_0804727A: + ldrb r4, [r5] + cmp r4, 0x7 + bgt _080472A6 + ldr r0, _080472F8 + lsls r1, r4, 2 + adds r1, r0 + movs r3, 0 + ldrsh r0, [r1, r3] + ldr r3, [sp, 0x23C] + adds r0, r3 + movs r3, 0x2 + ldrsh r1, [r1, r3] + adds r1, r2 + str r2, [sp, 0x234] + bl sub_804954C + ldrh r1, [r0] + movs r0, 0x3 + ands r0, r1 + ldr r2, [sp, 0x234] + cmp r0, 0 + bne _08047300 +_080472A6: + adds r5, 0x1 + adds r6, 0x1 + cmp r6, 0x3 + ble _0804727A +_080472AE: + ldr r0, _080472F8 + mov r4, r8 + lsls r2, r4, 2 + adds r3, r2, r0 + ldrh r1, [r3] + ldrh r0, [r7, 0x4] + adds r1, r0 + strh r1, [r7, 0x4] + ldrh r0, [r3, 0x2] + ldrh r4, [r7, 0x6] + adds r0, r4 + strh r0, [r7, 0x6] + lsls r1, 16 + asrs r1, 16 + str r2, [sp, 0x230] + cmp r1, 0 + blt _080472E0 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + blt _080472E0 + cmp r1, 0x37 + bgt _080472E0 + cmp r0, 0x1F + ble _08047304 +_080472E0: + movs r0, 0x2 + mov r10, r0 + b _0804744C + .align 2, 0 +_080472E8: .4byte 0xfffffdc0 +_080472EC: .4byte gUnknown_203B418 +_080472F0: .4byte 0x00018210 +_080472F4: .4byte 0x0001c05e +_080472F8: .4byte gUnknown_80F4448 +_080472FC: .4byte gUnknown_80F4D64 +_08047300: + mov r8, r4 + b _080472AE +_08047304: + movs r1, 0 + ldrsh r0, [r3, r1] + lsls r0, 10 + str r0, [sp, 0x228] + movs r2, 0x2 + ldrsh r0, [r3, r2] + lsls r0, 10 + str r0, [sp, 0x22C] + mov r3, r8 + lsls r6, r3, 24 + movs r5, 0x5 +_0804731A: + movs r4, 0 + adds r0, r7, 0 + ldr r1, [sp, 0x228] + ldr r2, [sp, 0x22C] + bl sub_804539C + bl sub_804AF74 + lsls r0, 24 + movs r2, 0 + cmp r0, 0 + beq _08047334 + movs r2, 0x3 +_08047334: + ldr r0, [r7, 0xC] + cmp r0, 0 + bge _0804733C + adds r0, 0xFF +_0804733C: + asrs r0, 8 + adds r0, 0x8 + ldr r1, [r7, 0x10] + cmp r1, 0 + bge _08047348 + adds r1, 0xFF +_08047348: + asrs r1, 8 + adds r1, 0x10 + bl sub_8083568 + lsls r0, 24 + cmp r0, 0 + beq _08047358 + movs r4, 0x1 +_08047358: + movs r0, 0x1 + str r0, [sp] + adds r0, r7, 0 + ldr r1, [sp, 0x220] + movs r2, 0 + lsrs r3, r6, 24 + bl sub_80462AC + lsls r0, 24 + cmp r0, 0 + beq _08047370 + movs r4, 0x1 +_08047370: + cmp r4, 0 + beq _0804737A + movs r0, 0x12 + bl sub_803E46C +_0804737A: + subs r5, 0x1 + cmp r5, 0 + bge _0804731A + movs r4, 0x4 + ldrsh r0, [r7, r4] + movs r2, 0x6 + ldrsh r1, [r7, r2] + bl sub_804954C + adds r5, r0, 0 + ldrh r1, [r5] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _080473A2 + ldr r3, [sp, 0x260] + ldrb r0, [r3] + cmp r0, 0 + bne _080473A2 + b _0804757A +_080473A2: + ldr r1, [r5, 0x10] + cmp r1, 0 + beq _08047436 + movs r4, 0 + ldr r2, [sp, 0x260] + ldrb r0, [r2] + cmp r0, 0 + bne _080473CE + adds r0, r1, 0 + bl sub_80450F8 + cmp r0, 0x1 + bne _080473CE + ldr r0, [r5, 0x10] + movs r1, 0x26 + bl sub_8046CB0 + lsls r0, 24 + lsrs r0, 24 + negs r1, r0 + orrs r1, r0 + lsrs r4, r1, 31 +_080473CE: + cmp r4, 0 + beq _080473E0 + movs r3, 0x4 + add r8, r3 + movs r0, 0x7 + mov r4, r8 + ands r4, r0 + mov r8, r4 + b _08047436 +_080473E0: + movs r6, 0x1 + ldr r0, [r5, 0x10] + bl sub_80450F8 + cmp r0, 0x1 + bne _08047406 + add r4, sp, 0x208 + adds r0, r4, 0 + ldr r1, _080474B8 + bl sub_8092A88 + ldr r0, [r5, 0x10] + adds r1, r4, 0 + bl sub_80571F0 + lsls r0, 24 + cmp r0, 0 + beq _08047406 + movs r6, 0 +_08047406: + cmp r6, 0 + beq _08047436 + ldr r0, [sp, 0x21C] + cmp r0, 0x3F + bgt _0804742C + lsls r0, 3 + mov r4, sp + adds r4, r0 + adds r4, 0x8 + ldr r0, [r5, 0x10] + str r0, [r4] + ldr r1, [r5, 0x10] + mov r0, r9 + bl sub_8047930 + strb r0, [r4, 0x4] + ldr r1, [sp, 0x21C] + adds r1, 0x1 + str r1, [sp, 0x21C] +_0804742C: + ldr r2, [sp, 0x260] + ldrb r0, [r2] + cmp r0, 0 + bne _08047436 + b _08047574 +_08047436: + ldr r3, [sp, 0x218] + subs r3, 0x1 + str r3, [sp, 0x218] + cmp r3, 0 + ble _08047442 + b _08047228 +_08047442: + movs r4, 0x1 + mov r10, r4 + mov r0, r8 + lsls r0, 2 + str r0, [sp, 0x230] +_0804744C: + ldr r0, _080474BC + ldr r0, [r0] + ldr r1, _080474C0 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r2, [sp, 0x21C] + cmp r2, 0 + ble _0804752C + add r5, sp, 0x8 + adds r6, r2, 0 +_08047462: + ldr r4, [r5] + ldrb r0, [r5, 0x4] + cmp r0, 0 + beq _080474D0 + ldr r0, _080474C4 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _080474C8 + ldr r1, [sp, 0x214] + bl sub_8045C08 + ldr r0, _080474CC + ldr r2, [r0] + mov r0, r9 + adds r1, r4, 0 + bl sub_80522F4 + mov r0, r9 + adds r1, r4, 0 + bl sub_807A96C + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0 + ldr r3, [sp, 0x224] + cmp r3, 0 + bne _080474A4 + ldr r3, [sp, 0x260] + ldrb r0, [r3] + cmp r0, 0 + beq _080474A6 +_080474A4: + movs r1, 0x1 +_080474A6: + str r4, [sp] + ldr r4, [sp, 0x214] + str r4, [sp, 0x4] + movs r0, 0x1 + mov r3, r9 + bl sub_80479B8 + b _08047524 + .align 2, 0 +_080474B8: .4byte 0x00000195 +_080474BC: .4byte gUnknown_203B418 +_080474C0: .4byte 0x0001c05e +_080474C4: .4byte gUnknown_202DF98 +_080474C8: .4byte gUnknown_202DE58 +_080474CC: .4byte gUnknown_80F94C4 +_080474D0: + ldr r1, [sp, 0x260] + ldrb r0, [r1] + cmp r0, 0 + bne _080474E2 + ldr r2, [sp, 0x21C] + cmp r2, 0x1 + bne _080474E2 + movs r3, 0x1 + mov r10, r3 +_080474E2: + ldr r0, _0804750C + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08047510 + ldr r1, [sp, 0x214] + bl sub_8045BF8 + ldr r1, [sp, 0x260] + ldrb r0, [r1] + cmp r0, 0 + beq _08047518 + ldr r0, _08047514 + ldr r2, [r0] + mov r0, r9 + adds r1, r4, 0 + bl sub_80522F4 + b _08047524 + .align 2, 0 +_0804750C: .4byte gUnknown_202DF98 +_08047510: .4byte gUnknown_202DE58 +_08047514: .4byte gUnknown_80F94D8 +_08047518: + ldr r0, _08047564 + ldr r2, [r0] + mov r0, r9 + adds r1, r4, 0 + bl sub_80522F4 +_08047524: + adds r5, 0x8 + subs r6, 0x1 + cmp r6, 0 + bne _08047462 +_0804752C: + ldr r2, _08047568 + ldr r3, [sp, 0x230] + adds r2, r3, r2 + movs r4, 0 + ldrsh r1, [r2, r4] + lsls r1, 19 + lsrs r1, 16 + ldr r4, _0804756C + add r3, sp, 0x210 + ldr r0, [r3] + ands r0, r4 + orrs r0, r1 + str r0, [r3] + movs r4, 0x2 + ldrsh r1, [r2, r4] + lsls r1, 19 + ldr r2, _08047570 + ands r0, r2 + orrs r0, r1 + str r0, [r3] + mov r0, r10 + cmp r0, 0x1 + beq _08047584 + cmp r0, 0x1 + bcc _080475A8 + cmp r0, 0x2 + beq _08047596 + b _080475A8 + .align 2, 0 +_08047564: .4byte gUnknown_80F94F0 +_08047568: .4byte gUnknown_80F4448 +_0804756C: .4byte 0xffff0000 +_08047570: .4byte 0x0000ffff +_08047574: + movs r1, 0 + mov r10, r1 + b _0804744C +_0804757A: + mov r2, r10 + str r2, [r7, 0x4] + movs r3, 0x1 + mov r10, r3 + b _0804744C +_08047584: + add r0, sp, 0x210 + str r0, [sp] + mov r0, r9 + adds r1, r7, 0 + ldr r2, [sp, 0x214] + movs r3, 0x1 + bl sub_804652C + b _080475A8 +_08047596: + ldr r0, _080475BC + ldr r1, [sp, 0x214] + bl sub_8045C08 + ldr r0, _080475C0 + ldr r1, [r0] + mov r0, r9 + bl sub_80522A8 +_080475A8: + movs r3, 0x90 + lsls r3, 2 + add sp, r3 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080475BC: .4byte gUnknown_202DE58 +_080475C0: .4byte gUnknown_80F9530 + thumb_func_end sub_8047190 + + thumb_func_start sub_80475C4 +sub_80475C4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x44 + str r0, [sp, 0x10] + str r1, [sp, 0x14] + adds r7, r2, 0 + str r3, [sp, 0x18] + ldr r0, _08047848 + mov r8, r0 + ldr r2, [r0] + ldr r1, _0804784C + adds r0, r2, r1 + ldrb r0, [r0] + str r0, [sp, 0x24] + movs r4, 0 + movs r5, 0 + adds r3, r2, 0 + adds r3, 0xC0 + str r3, [sp, 0x1C] + movs r0, 0x3 + str r0, [r3] + adds r0, r2, 0 + adds r0, 0xE4 + strb r4, [r0] + adds r1, r2, 0 + adds r1, 0xE0 + movs r0, 0x1 + strb r0, [r1] + adds r0, r2, 0 + adds r0, 0xE2 + strb r4, [r0] + ldr r0, [sp, 0x14] + str r0, [r3, 0x70] + str r5, [r3, 0x1C] + ldr r0, [r7] + str r0, [r3, 0x4] + movs r1, 0 + ldrsh r0, [r7, r1] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, 0x4 + lsls r1, 8 + movs r2, 0x2 + ldrsh r0, [r7, r2] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 3 + adds r2, 0x4 + lsls r2, 8 + ldr r0, [sp, 0x1C] + bl sub_8045394 + ldr r3, [sp, 0x1C] + strh r4, [r3, 0x26] + movs r0, 0x1 + str r0, [sp, 0x20] + movs r1, 0 + str r1, [sp, 0x28] + ldr r0, [sp, 0x10] + bl sub_80450F8 + cmp r0, 0x1 + bne _0804765E + ldr r0, [sp, 0x10] + movs r1, 0x2A + bl sub_8046CB0 + lsls r0, 24 + lsrs r0, 24 + negs r1, r0 + orrs r1, r0 + lsrs r1, 31 + str r1, [sp, 0x28] +_0804765E: + adds r0, r7, 0 + bl sub_803F428 + lsls r0, 24 + lsrs r0, 24 + negs r1, r0 + orrs r1, r0 + lsrs r4, r1, 31 + ldr r0, [sp, 0x18] + bl sub_803F428 + lsls r0, 24 + cmp r0, 0 + beq _0804767C + movs r4, 0x1 +_0804767C: + mov r2, r8 + ldr r0, [r2] + ldr r3, _08047850 + adds r0, r3 + add r1, sp, 0x20 + ldrb r1, [r1] + strb r1, [r0] + cmp r4, 0 + bne _08047690 + b _080477D0 +_08047690: + ldr r2, [sp, 0x1C] + movs r3, 0x4 + ldrsh r0, [r2, r3] + ldr r1, [sp, 0x18] + movs r2, 0 + ldrsh r1, [r1, r2] + mov r9, r1 + subs r1, r0, r1 + cmp r1, 0 + bge _080476A6 + negs r1, r1 +_080476A6: + ldr r3, [sp, 0x1C] + movs r2, 0x6 + ldrsh r0, [r3, r2] + ldr r3, [sp, 0x18] + movs r2, 0x2 + ldrsh r3, [r3, r2] + mov r10, r3 + subs r0, r3 + cmp r0, 0 + bge _080476BC + negs r0, r0 +_080476BC: + adds r1, r0 + lsls r0, r1, 1 + adds r0, r1 + lsls r4, r0, 2 + adds r3, r4, 0 + adds r3, 0xC + str r3, [sp, 0x30] + cmp r3, 0x3F + ble _080476D2 + movs r0, 0x40 + str r0, [sp, 0x30] +_080476D2: + movs r1, 0 + str r1, [sp, 0x3C] + movs r0, 0x80 + lsls r0, 12 + adds r1, r4, 0 + bl __divsi3 + str r0, [sp, 0x40] + movs r2, 0 + ldrsh r1, [r7, r2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 11 + mov r8, r0 + movs r3, 0x2 + ldrsh r1, [r7, r3] + lsls r0, r1, 1 + adds r0, r1 + lsls r7, r0, 11 + mov r1, r9 + lsls r0, r1, 1 + add r0, r9 + lsls r0, 11 + mov r2, r8 + subs r0, r2 + adds r1, r4, 0 + bl __divsi3 + str r0, [sp, 0x34] + mov r3, r10 + lsls r0, r3, 1 + add r0, r10 + lsls r0, 11 + subs r0, r7 + adds r1, r4, 0 + bl __divsi3 + str r0, [sp, 0x38] + subs r0, r4, 0x3 + cmp r0, 0 + ble _080477D0 + str r0, [sp, 0x2C] +_08047726: + movs r0, 0 + mov r10, r0 + ldr r0, [sp, 0x3C] + cmp r0, 0 + bge _08047732 + adds r0, 0xFF +_08047732: + asrs r0, 8 + bl sub_8009C7C + ldr r2, [sp, 0x30] + adds r1, r0, 0 + muls r1, r2 + movs r0, 0x80 + lsls r0, 3 + mov r2, r8 + adds r3, r2, r0 + adds r2, r7, r0 + ldr r0, [sp, 0x1C] + str r1, [r0, 0x1C] + mov r0, r8 + cmp r0, 0 + bge _08047754 + adds r0, 0xFF +_08047754: + asrs r0, 8 + adds r0, 0x8 + mov r9, r0 + adds r0, r7, 0 + cmp r7, 0 + bge _08047762 + adds r0, 0xFF +_08047762: + asrs r0, 8 + adds r4, r0, 0 + adds r4, 0x10 + ldr r1, [sp, 0x3C] + ldr r0, [sp, 0x40] + adds r1, r0 + str r1, [sp, 0x3C] + ldr r0, [sp, 0x1C] + adds r1, r3, 0 + bl sub_8045394 + bl sub_804AF74 + lsls r0, 24 + movs r2, 0 + cmp r0, 0 + beq _08047786 + movs r2, 0x3 +_08047786: + mov r0, r9 + adds r1, r4, 0 + bl sub_8083568 + lsls r0, 24 + cmp r0, 0 + beq _08047798 + movs r1, 0x1 + mov r10, r1 +_08047798: + movs r0, 0x1 + str r0, [sp] + ldr r0, [sp, 0x1C] + ldr r1, [sp, 0x24] + movs r2, 0 + movs r3, 0xFF + bl sub_80462AC + lsls r0, 24 + cmp r0, 0 + beq _080477B2 + movs r2, 0x1 + mov r10, r2 +_080477B2: + mov r3, r10 + cmp r3, 0 + beq _080477BE + movs r0, 0x17 + bl sub_803E46C +_080477BE: + ldr r0, [sp, 0x34] + add r8, r0 + ldr r1, [sp, 0x38] + adds r7, r1 + ldr r2, [sp, 0x2C] + subs r2, 0x1 + str r2, [sp, 0x2C] + cmp r2, 0 + bne _08047726 +_080477D0: + ldr r3, [sp, 0x18] + ldr r0, [r3] + ldr r1, [sp, 0x1C] + str r0, [r1, 0x4] + ldr r0, _08047848 + ldr r0, [r0] + ldr r2, _08047850 + adds r0, r2 + movs r1, 0 + strb r1, [r0] + movs r1, 0 + ldrsh r0, [r3, r1] + movs r2, 0x2 + ldrsh r1, [r3, r2] + bl sub_804954C + adds r4, r0, 0 + ldr r0, [r4, 0x10] + cmp r0, 0 + bne _080477FA + b _08047904 +_080477FA: + movs r3, 0x1 + mov r8, r3 + movs r7, 0 + bl sub_80450F8 + cmp r0, 0x1 + bne _08047834 + ldr r0, [r4, 0x10] + movs r1, 0x26 + bl sub_8046CB0 + lsls r0, 24 + lsrs r0, 24 + negs r1, r0 + orrs r1, r0 + lsrs r7, r1, 31 + ldr r1, _08047854 + add r0, sp, 0x8 + bl sub_8092A88 + ldr r0, [r4, 0x10] + add r1, sp, 0x8 + bl sub_80571F0 + lsls r0, 24 + cmp r0, 0 + beq _08047834 + movs r0, 0 + mov r8, r0 +_08047834: + mov r1, r8 + cmp r1, 0 + beq _08047904 + ldr r1, [r4, 0x10] + adds r5, r1, 0 + cmp r7, 0 + beq _0804785C + ldr r0, _08047858 + ands r6, r0 + b _0804786E + .align 2, 0 +_08047848: .4byte gUnknown_203B418 +_0804784C: .4byte 0x00018210 +_08047850: .4byte 0x0001c05e +_08047854: .4byte 0x00000195 +_08047858: .4byte 0xffffff00 +_0804785C: + ldr r0, [sp, 0x10] + bl sub_8047930 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080478CC + ands r1, r6 + adds r6, r1, 0 + orrs r6, r0 +_0804786E: + ldr r0, _080478D0 + ldr r1, [sp, 0x14] + bl sub_8045C08 + ldr r0, _080478D4 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + lsls r0, r6, 24 + cmp r0, 0 + beq _080478DC + adds r0, r5, 0 + movs r1, 0x8 + bl sub_806CE94 + ldr r0, _080478D8 + ldr r2, [r0] + ldr r0, [sp, 0x10] + adds r1, r5, 0 + bl sub_80522F4 + ldr r0, [sp, 0x10] + adds r1, r5, 0 + bl sub_807A96C + lsls r0, 24 + lsrs r2, r0, 24 + movs r1, 0 + ldr r3, [sp, 0x28] + cmp r3, 0 + bne _080478B6 + ldr r0, [sp, 0x64] + ldrb r0, [r0] + cmp r0, 0 + beq _080478B8 +_080478B6: + movs r1, 0x1 +_080478B8: + str r5, [sp] + ldr r0, [sp, 0x14] + str r0, [sp, 0x4] + movs r0, 0x1 + ldr r3, [sp, 0x10] + bl sub_80479B8 + movs r1, 0 + str r1, [sp, 0x20] + b _08047904 + .align 2, 0 +_080478CC: .4byte 0xffffff00 +_080478D0: .4byte gUnknown_202DE58 +_080478D4: .4byte gUnknown_202DF98 +_080478D8: .4byte gUnknown_80F94C4 +_080478DC: + cmp r7, 0 + beq _080478F4 + ldr r0, _080478F0 + ldr r2, [r0] + ldr r0, [sp, 0x10] + adds r1, r5, 0 + bl sub_80522F4 + b _08047900 + .align 2, 0 +_080478F0: .4byte gUnknown_80F9510 +_080478F4: + ldr r0, _0804792C + ldr r2, [r0] + ldr r0, [sp, 0x10] + adds r1, r5, 0 + bl sub_80522F4 +_08047900: + movs r2, 0x1 + str r2, [sp, 0x20] +_08047904: + ldr r3, [sp, 0x20] + cmp r3, 0x1 + bne _0804791A + movs r0, 0 + str r0, [sp] + ldr r0, [sp, 0x10] + ldr r1, [sp, 0x1C] + ldr r2, [sp, 0x14] + movs r3, 0 + bl sub_804652C +_0804791A: + add sp, 0x44 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804792C: .4byte gUnknown_80F94F0 + thumb_func_end sub_80475C4 + + thumb_func_start sub_8047930 +sub_8047930: + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r1, [r5, 0x70] + ldrb r0, [r1, 0x8] + cmp r0, 0x1 + beq _0804794C + adds r0, r1, 0 + adds r0, 0xA4 + ldrb r0, [r0] + cmp r0, 0x4 + beq _0804794C + cmp r0, 0x1 + bne _08047950 +_0804794C: + movs r0, 0 + b _080479B0 +_08047950: + movs r0, 0x64 + bl sub_8084100 + ldr r1, _08047980 + movs r2, 0 + ldrsh r1, [r1, r2] + movs r6, 0 + cmp r0, r1 + bge _08047964 + movs r6, 0x1 +_08047964: + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0x1 + bne _08047994 + adds r0, r4, 0 + movs r1, 0x28 + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _08047984 + movs r6, 0 + b _08047994 + .align 2, 0 +_08047980: .4byte gUnknown_80F4FA2 +_08047984: + adds r0, r4, 0 + movs r1, 0x2A + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _08047994 + movs r6, 0x1 +_08047994: + adds r0, r5, 0 + bl sub_80450F8 + cmp r0, 0x1 + bne _080479AE + adds r0, r5, 0 + movs r1, 0x25 + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _080479AE + movs r6, 0 +_080479AE: + adds r0, r6, 0 +_080479B0: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8047930 + + thumb_func_start sub_80479B8 +sub_80479B8: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + adds r4, r3, 0 + ldr r5, [sp, 0x3C] + ldr r7, [sp, 0x40] + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + cmp r6, 0 + beq _08047AD0 + cmp r1, 0 + bne _08047ABC + movs r0, 0 + mov r8, r0 + ldr r1, [r5, 0x70] + mov r9, r1 + ldrb r0, [r1, 0x6] + cmp r0, 0 + beq _08047A20 + ldrb r0, [r7, 0x2] + bl sub_8090BD0 + lsls r0, 24 + cmp r0, 0 + beq _08047A3C + ldrb r0, [r7, 0x2] + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _08047A3C + ldrb r0, [r7, 0x2] + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + movs r1, 0x1 + eors r0, r1 + negs r1, r0 + orrs r1, r0 + lsrs r1, 31 + mov r8, r1 + b _08047A3C +_08047A20: + ldrb r0, [r7, 0x2] + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _08047A3C + adds r0, r5, 0 + movs r1, 0x2 + bl sub_80718D8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 +_08047A3C: + adds r0, r5, 0 + bl sub_8070C60 + lsls r0, 24 + cmp r0, 0 + beq _08047A4C + movs r0, 0 + mov r8, r0 +_08047A4C: + mov r1, r8 + cmp r1, 0 + beq _08047ABC + mov r0, r9 + adds r0, 0x60 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08047ABC + mov r1, r9 + ldrb r0, [r1, 0x8] + cmp r0, 0x1 + bne _08047A76 + adds r1, r5, 0x4 + adds r0, r4, 0 + adds r2, r7, 0 + bl sub_80464C8 + bl _080482BA +_08047A76: + ldr r0, _08047AAC + bl sub_8083E38 + ldr r0, _08047AB0 + adds r1, r7, 0 + bl sub_8045BF8 + ldr r0, _08047AB4 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08047AB8 + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80522F4 + ldr r0, [r7] + mov r1, r9 + str r0, [r1, 0x60] + adds r0, r5, 0 + bl sub_806A6E8 + bl _080482BA + .align 2, 0 +_08047AAC: .4byte 0x0000014d +_08047AB0: .4byte gUnknown_202DE58 +_08047AB4: .4byte gUnknown_202DF98 +_08047AB8: .4byte gUnknown_80FDBB8 +_08047ABC: + cmp r6, 0 + beq _08047AD0 + adds r0, r5, 0 + adds r1, r7, 0 + bl sub_8042390 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_806F450 +_08047AD0: + ldrb r1, [r7] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08047B2C + ldr r0, _08047B1C + adds r1, r7, 0 + bl sub_8045BF8 + ldr r0, _08047B20 + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80522F4 + cmp r6, 0 + beq _08047B30 + ldr r0, _08047B24 + movs r1, 0 + ldrsh r2, [r0, r1] + add r0, sp, 0x18 + str r0, [sp] + movs r1, 0 + str r1, [sp, 0x4] + ldr r0, _08047B28 + str r0, [sp, 0x8] + str r1, [sp, 0xC] + str r1, [sp, 0x10] + str r1, [sp, 0x14] + adds r0, r4, 0 + adds r1, r5, 0 + movs r3, 0x1 + bl sub_806F370 + adds r0, r4, 0 + bl sub_8071DA4 + b _080482BA + .align 2, 0 +_08047B1C: .4byte gUnknown_202DE58 +_08047B20: .4byte gUnknown_80FE3E8 +_08047B24: .4byte gUnknown_80F4FAE +_08047B28: .4byte 0x00000217 +_08047B2C: + cmp r6, 0 + bne _08047B38 +_08047B30: + adds r0, r5, 0 + adds r1, r7, 0 + bl sub_804245C +_08047B38: + ldrb r0, [r7, 0x2] + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08047B56 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x5 + movs r3, 0 + bl sub_8078B5C +_08047B56: + ldrb r0, [r7, 0x2] + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + beq _08047B72 + ldrb r0, [r7, 0x2] + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xA + bne _08047B9C +_08047B72: + cmp r6, 0 + beq _08047B88 + ldr r0, _08047B84 + movs r1, 0 + ldrsh r2, [r0, r1] + mov r0, sp + adds r0, 0x19 + b _08048284 + .align 2, 0 +_08047B84: .4byte gUnknown_80F4FAC +_08047B88: + ldr r0, _08047B98 + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80522F4 + b _080482B4 + .align 2, 0 +_08047B98: .4byte gUnknown_80FE458 +_08047B9C: + ldrb r0, [r7, 0x2] + subs r0, 0x1 + cmp r0, 0xE8 + bls _08047BA6 + b _08048276 +_08047BA6: + lsls r0, 2 + ldr r1, _08047BB0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08047BB0: .4byte _08047BB4 + .align 2, 0 +_08047BB4: + .4byte _08047F58 + .4byte _08047F70 + .4byte _08047F88 + .4byte _08047FA0 + .4byte _08047FB8 + .4byte _08047FD0 + .4byte _08047FF0 + .4byte _08047FE8 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048004 + .4byte _0804825E + .4byte _08048010 + .4byte _0804801A + .4byte _0804804C + .4byte _08048276 + .4byte _0804802E + .4byte _0804809C + .4byte _08048038 + .4byte _08048024 + .4byte _080480BA + .4byte _080480C4 + .4byte _08048042 + .4byte _0804806A + .4byte _08048060 + .4byte _08048056 + .4byte _0804807E + .4byte _080480B0 + .4byte _08048074 + .4byte _080480D8 + .4byte _080480CE + .4byte _08048092 + .4byte _08048088 + .4byte _080480A6 + .4byte _080480E4 + .4byte _080480EE + .4byte _080480F8 + .4byte _08048102 + .4byte _0804810C + .4byte _08048212 + .4byte _08048122 + .4byte _0804813C + .4byte _0804812A + .4byte _08048146 + .4byte _08048152 + .4byte _0804815E + .4byte _0804816A + .4byte _08048176 + .4byte _08048182 + .4byte _0804818E + .4byte _0804819A + .4byte _080481A6 + .4byte _080481B2 + .4byte _080481BE + .4byte _080481CA + .4byte _080481D6 + .4byte _080481E2 + .4byte _080481EE + .4byte _080481FA + .4byte _08048206 + .4byte _08048212 + .4byte _08048220 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _0804823A + .4byte _08048252 + .4byte _08048246 + .4byte _0804826A + .4byte _0804822E + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048276 + .4byte _08048116 +_08047F58: + ldr r0, _08047F6C + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r4, 0 + adds r1, r5, 0 + movs r3, 0x1 + bl sub_80482FC + b _080482B4 + .align 2, 0 +_08047F6C: .4byte gUnknown_80F503A +_08047F70: + ldr r0, _08047F84 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r4, 0 + adds r1, r5, 0 + movs r3, 0x2 + bl sub_80482FC + b _080482B4 + .align 2, 0 +_08047F84: .4byte gUnknown_80F503C +_08047F88: + ldr r0, _08047F9C + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r4, 0 + adds r1, r5, 0 + movs r3, 0x3 + bl sub_80482FC + b _080482B4 + .align 2, 0 +_08047F9C: .4byte gUnknown_80F503E +_08047FA0: + ldr r0, _08047FB4 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r4, 0 + adds r1, r5, 0 + movs r3, 0x4 + bl sub_80482FC + b _080482B4 + .align 2, 0 +_08047FB4: .4byte gUnknown_80F5040 +_08047FB8: + ldr r0, _08047FCC + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r4, 0 + adds r1, r5, 0 + movs r3, 0x5 + bl sub_80482FC + b _080482B4 + .align 2, 0 +_08047FCC: .4byte gUnknown_80F5042 +_08047FD0: + ldr r0, _08047FE4 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r4, 0 + adds r1, r5, 0 + movs r3, 0x6 + bl sub_80482FC + b _080482B4 + .align 2, 0 +_08047FE4: .4byte gUnknown_80F5044 +_08047FE8: + ldr r0, _08047FEC + b _08047FF2 + .align 2, 0 +_08047FEC: .4byte gUnknown_80F5048 +_08047FF0: + ldr r0, _08048000 +_08047FF2: + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8048340 + b _080482B4 + .align 2, 0 +_08048000: .4byte gUnknown_80F5046 +_08048004: + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, r10 + bl sub_8048364 + b _080482B4 +_08048010: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8048374 + b _080482B4 +_0804801A: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_804839C + b _080482B4 +_08048024: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80483D4 + b _080482B4 +_0804802E: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80483F4 + b _080482B4 +_08048038: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8048400 + b _080482B4 +_08048042: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_804840C + b _080482B4 +_0804804C: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_804841C + b _080482B4 +_08048056: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_804849C + b _080482B4 +_08048060: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8048428 + b _080482B4 +_0804806A: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8048450 + b _080482B4 +_08048074: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8048480 + b _080482B4 +_0804807E: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80482D4 + b _080482B4 +_08048088: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8048490 + b _080482B4 +_08048092: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80484A8 + b _080482B4 +_0804809C: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80484DC + b _080482B4 +_080480A6: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80484BC + b _080482B4 +_080480B0: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80484C8 + b _080482B4 +_080480BA: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80484E8 + b _080482B4 +_080480C4: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8048524 + b _080482B4 +_080480CE: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80485B0 + b _080482B4 +_080480D8: + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_804869C + b _080482B4 +_080480E4: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80483C4 + b _080482B4 +_080480EE: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_804891C + b _080482B4 +_080480F8: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8048928 + b _080482B4 +_08048102: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8048934 + b _080482B4 +_0804810C: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8048940 + b _080482B4 +_08048116: + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl nullsub_94 + b _080482B4 +_08048122: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x64 + b _08048130 +_0804812A: + ldr r2, _08048138 + adds r0, r4, 0 + adds r1, r5, 0 +_08048130: + movs r3, 0xA + bl sub_80487CC + b _080482B4 + .align 2, 0 +_08048138: .4byte 0x000003e7 +_0804813C: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8048E04 + b _080482B4 +_08048146: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_80487E0 + b _080482B4 +_08048152: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x2 + bl sub_80487E0 + b _080482B4 +_0804815E: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x3 + bl sub_80487E0 + b _080482B4 +_0804816A: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x4 + bl sub_80487E0 + b _080482B4 +_08048176: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x5 + bl sub_80487E0 + b _080482B4 +_08048182: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x6 + bl sub_80487E0 + b _080482B4 +_0804818E: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x7 + bl sub_80487E0 + b _080482B4 +_0804819A: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x8 + bl sub_80487E0 + b _080482B4 +_080481A6: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x9 + bl sub_80487E0 + b _080482B4 +_080481B2: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0xA + bl sub_80487E0 + b _080482B4 +_080481BE: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0xB + bl sub_80487E0 + b _080482B4 +_080481CA: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0xC + bl sub_80487E0 + b _080482B4 +_080481D6: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0xD + bl sub_80487E0 + b _080482B4 +_080481E2: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0xE + bl sub_80487E0 + b _080482B4 +_080481EE: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0xF + bl sub_80487E0 + b _080482B4 +_080481FA: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x10 + bl sub_80487E0 + b _080482B4 +_08048206: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x11 + bl sub_80487E0 + b _080482B4 +_08048212: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x32 + movs r3, 0x5 + bl sub_80487CC + b _080482B4 +_08048220: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0xA + movs r3, 0 + bl sub_80487CC + b _080482B4 +_0804822E: + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_8048DB8 + b _080482B4 +_0804823A: + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_8048EB0 + b _080482B4 +_08048246: + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_8048EC4 + b _080482B4 +_08048252: + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_8048ED8 + b _080482B4 +_0804825E: + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_8048EEC + b _080482B4 +_0804826A: + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_8048F00 + b _080482B4 +_08048276: + cmp r6, 0 + beq _080482A8 + ldr r0, _080482A0 + movs r1, 0 + ldrsh r2, [r0, r1] + mov r0, sp + adds r0, 0x1A +_08048284: + str r0, [sp] + movs r1, 0 + str r1, [sp, 0x4] + ldr r0, _080482A4 + str r0, [sp, 0x8] + str r1, [sp, 0xC] + str r1, [sp, 0x10] + str r1, [sp, 0x14] + adds r0, r4, 0 + adds r1, r5, 0 + movs r3, 0x1 + bl sub_806F370 + b _080482B4 + .align 2, 0 +_080482A0: .4byte gUnknown_80F4FAC +_080482A4: .4byte 0x00000217 +_080482A8: + ldr r0, _080482CC + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80522F4 +_080482B4: + adds r0, r4, 0 + bl sub_8071DA4 +_080482BA: + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080482CC: .4byte gUnknown_80FE458 + thumb_func_end sub_80479B8 + + thumb_func_start nullsub_205 +nullsub_205: + bx lr + thumb_func_end nullsub_205 + + thumb_func_start sub_80482D4 +sub_80482D4: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldr r1, _080482F8 + adds r0, r4, 0 + movs r2, 0x1 + bl sub_808417C + adds r2, r0, 0 + adds r0, r5, 0 + adds r1, r4, 0 + movs r3, 0x1 + bl sub_8075C58 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080482F8: .4byte gUnknown_80F4E74 + thumb_func_end sub_80482D4 + + thumb_func_start sub_80482FC +sub_80482FC: + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0xC + mov r8, r0 + mov r9, r1 + adds r6, r2, 0 + lsls r4, r3, 24 + lsrs r4, 24 + add r5, sp, 0x4 + ldr r1, _0804833C + adds r0, r5, 0 + bl sub_8092A88 + strb r6, [r5, 0x4] + movs r3, 0x80 + lsls r3, 1 + str r4, [sp] + mov r0, r8 + mov r1, r9 + add r2, sp, 0x4 + bl sub_8055640 + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0804833C: .4byte 0x00000195 + thumb_func_end sub_80482FC + + thumb_func_start sub_8048340 +sub_8048340: + push {r4,lr} + sub sp, 0x18 + movs r4, 0 + str r4, [sp] + str r4, [sp, 0x4] + movs r3, 0x84 + lsls r3, 2 + str r3, [sp, 0x8] + str r4, [sp, 0xC] + str r4, [sp, 0x10] + str r4, [sp, 0x14] + movs r3, 0x1 + bl sub_806F370 + add sp, 0x18 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8048340 + + thumb_func_start sub_8048364 +sub_8048364: + push {lr} + lsls r3, r2, 24 + lsrs r3, 24 + movs r2, 0x1 + bl sub_8079F20 + pop {r0} + bx r0 + thumb_func_end sub_8048364 + + thumb_func_start sub_8048374 +sub_8048374: + push {r4,lr} + sub sp, 0x4 + ldr r2, _08048394 + movs r3, 0 + ldrsh r2, [r2, r3] + ldr r3, _08048398 + movs r4, 0 + ldrsh r3, [r3, r4] + movs r4, 0x1 + str r4, [sp] + bl sub_8077C44 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08048394: .4byte gUnknown_80F4FB6 +_08048398: .4byte gUnknown_80F4FB8 + thumb_func_end sub_8048374 + + thumb_func_start sub_804839C +sub_804839C: + push {r4,lr} + sub sp, 0x4 + ldr r2, _080483BC + movs r3, 0 + ldrsh r2, [r2, r3] + ldr r3, _080483C0 + movs r4, 0 + ldrsh r3, [r3, r4] + movs r4, 0x1 + str r4, [sp] + bl sub_8077C44 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080483BC: .4byte gUnknown_80F4FBA +_080483C0: .4byte gUnknown_80F4FBC + thumb_func_end sub_804839C + + thumb_func_start sub_80483C4 +sub_80483C4: + push {lr} + ldr r2, _080483D0 + bl sub_80792F8 + pop {r0} + bx r0 + .align 2, 0 +_080483D0: .4byte 0x000003e7 + thumb_func_end sub_80483C4 + + thumb_func_start sub_80483D4 +sub_80483D4: + push {r4,lr} + sub sp, 0x4 + ldr r2, _080483F0 + movs r4, 0 + ldrsh r3, [r2, r4] + movs r2, 0x1 + str r2, [sp] + movs r2, 0 + bl sub_8077C44 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080483F0: .4byte gUnknown_80F4FBE + thumb_func_end sub_80483D4 + + thumb_func_start sub_80483F4 +sub_80483F4: + push {lr} + bl sub_8079140 + pop {r0} + bx r0 + thumb_func_end sub_80483F4 + + thumb_func_start sub_8048400 +sub_8048400: + push {lr} + bl sub_80791D8 + pop {r0} + bx r0 + thumb_func_end sub_8048400 + + thumb_func_start sub_804840C +sub_804840C: + push {lr} + movs r2, 0 + movs r3, 0x1 + bl sub_8077910 + pop {r0} + bx r0 + thumb_func_end sub_804840C + + thumb_func_start sub_804841C +sub_804841C: + push {lr} + bl sub_8079270 + pop {r0} + bx r0 + thumb_func_end sub_804841C + + thumb_func_start sub_8048428 +sub_8048428: + push {lr} + adds r3, r0, 0 + ldr r0, [r1, 0x70] + adds r0, 0xAC + ldrb r0, [r0] + cmp r0, 0x4 + bne _0804843E + adds r0, r3, 0 + bl sub_807A290 + b _08048448 +_0804843E: + ldr r0, _0804844C + ldr r2, [r0] + adds r0, r3, 0 + bl sub_80522F4 +_08048448: + pop {r0} + bx r0 + .align 2, 0 +_0804844C: .4byte gUnknown_80F89F4 + thumb_func_end sub_8048428 + + thumb_func_start sub_8048450 +sub_8048450: + push {lr} + adds r3, r0, 0 + ldr r0, [r1, 0x70] + adds r0, 0xAC + ldrb r0, [r0] + subs r0, 0x2 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _0804846C + adds r0, r3, 0 + bl sub_807A290 + b _08048476 +_0804846C: + ldr r0, _0804847C + ldr r2, [r0] + adds r0, r3, 0 + bl sub_80522F4 +_08048476: + pop {r0} + bx r0 + .align 2, 0 +_0804847C: .4byte gUnknown_80F89F4 + thumb_func_end sub_8048450 + + thumb_func_start sub_8048480 +sub_8048480: + push {lr} + movs r2, 0 + movs r3, 0 + bl sub_807D148 + pop {r0} + bx r0 + thumb_func_end sub_8048480 + + thumb_func_start sub_8048490 +sub_8048490: + push {lr} + bl sub_8075FCC + pop {r0} + bx r0 + thumb_func_end sub_8048490 + + thumb_func_start sub_804849C +sub_804849C: + push {lr} + movs r2, 0x1 + bl sub_8077AE4 + pop {r0} + bx r0 + thumb_func_end sub_804849C + + thumb_func_start sub_80484A8 +sub_80484A8: + push {lr} + sub sp, 0x4 + movs r2, 0x1 + str r2, [sp] + movs r3, 0x1 + bl sub_8072008 + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80484A8 + + thumb_func_start sub_80484BC +sub_80484BC: + push {lr} + bl sub_8076D10 + pop {r0} + bx r0 + thumb_func_end sub_80484BC + + thumb_func_start sub_80484C8 +sub_80484C8: + push {lr} + ldr r2, _080484D8 + ldr r2, [r2] + bl sub_80522F4 + pop {r0} + bx r0 + .align 2, 0 +_080484D8: .4byte gUnknown_80F89F4 + thumb_func_end sub_80484C8 + + thumb_func_start sub_80484DC +sub_80484DC: + push {lr} + movs r2, 0x1 + bl sub_807232C + pop {r0} + bx r0 + thumb_func_end sub_80484DC + + thumb_func_start sub_80484E8 +sub_80484E8: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldr r0, [r4, 0x70] + adds r0, 0xAC + ldrb r0, [r0] + cmp r0, 0x1 + bne _08048500 + adds r0, r5, 0 + bl sub_807A290 + b _08048516 +_08048500: + ldr r0, _0804851C + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08048520 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08048516: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0804851C: .4byte gUnknown_202DF98 +_08048520: .4byte gUnknown_80FB580 + thumb_func_end sub_80484E8 + + thumb_func_start sub_8048524 +sub_8048524: + push {r4-r6,lr} + sub sp, 0x4 + adds r6, r0, 0 + adds r4, r1, 0 + ldr r0, [r4, 0x70] + adds r5, r0, 0 + ldrb r0, [r5, 0x7] + cmp r0, 0 + beq _08048542 + adds r0, r6, 0 + movs r2, 0 + movs r3, 0x5 + bl sub_8078A58 + b _080485A4 +_08048542: + ldr r0, _08048560 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r4, 0 + movs r1, 0x12 + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _08048568 + ldr r0, _08048564 + b _08048586 + .align 2, 0 +_08048560: .4byte gUnknown_202DF98 +_08048564: .4byte gUnknown_8100298 +_08048568: + movs r0, 0x9E + lsls r0, 1 + adds r5, r0 + ldr r0, [r5] + bl sub_8094450 + cmp r0, 0 + beq _08048598 + mov r0, sp + movs r1, 0 + bl sub_80943A0 + ldr r0, [sp] + str r0, [r5] + ldr r0, _08048594 +_08048586: + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _080485A4 + .align 2, 0 +_08048594: .4byte gUnknown_80F9740 +_08048598: + ldr r0, _080485AC + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_080485A4: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080485AC: .4byte gUnknown_80F9760 + thumb_func_end sub_8048524 + + thumb_func_start sub_80485B0 +sub_80485B0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r9, r0 + mov r8, r1 + movs r0, 0 + str r0, [sp] + movs r2, 0x1 + mov r10, r2 + ldr r4, [r1, 0x70] + movs r0, 0x64 + bl sub_8084100 + ldr r1, _0804865C + movs r2, 0 + ldrsh r1, [r1, r2] + cmp r0, r1 + bge _080485DE + movs r0, 0x3 + mov r10, r0 +_080485DE: + ldrb r0, [r4, 0x7] + cmp r0, 0 + beq _0804867C + movs r2, 0x8C + lsls r2, 1 + adds r4, r2 + adds r5, r4, 0 + movs r7, 0x3 +_080485EE: + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0804862C + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0804862C + adds r0, r5, 0 + bl sub_8092BC0 + cmp r0, 0 + beq _0804862C + ldrb r6, [r4, 0x5] + adds r0, r5, 0 + bl sub_8092C0C + adds r1, r0, 0 + ldrb r0, [r4, 0x5] + add r0, r10 + strb r0, [r4, 0x5] + ldrb r0, [r4, 0x5] + cmp r0, r1 + blt _08048622 + strb r1, [r4, 0x5] +_08048622: + ldrb r0, [r4, 0x5] + cmp r6, r0 + beq _0804862C + movs r2, 0x1 + str r2, [sp] +_0804862C: + adds r4, 0x8 + adds r5, 0x8 + subs r7, 0x1 + cmp r7, 0 + bge _080485EE + ldr r0, [sp] + cmp r0, 0 + beq _08048668 + ldr r0, _08048660 + ldr r2, [r0] + mov r0, r9 + mov r1, r8 + bl sub_80522F4 + mov r2, r10 + cmp r2, 0x1 + beq _08048688 + movs r0, 0xA + movs r1, 0x40 + bl sub_803E708 + ldr r0, _08048664 + b _0804866A + .align 2, 0 +_0804865C: .4byte gUnknown_80F4F46 +_08048660: .4byte gUnknown_80FE454 +_08048664: .4byte gUnknown_80FE434 +_08048668: + ldr r0, _08048678 +_0804866A: + ldr r2, [r0] + mov r0, r9 + mov r1, r8 + bl sub_80522F4 + b _08048688 + .align 2, 0 +_08048678: .4byte gUnknown_80FE40C +_0804867C: + ldr r0, _08048698 + ldr r2, [r0] + mov r0, r9 + mov r1, r8 + bl sub_80522F4 +_08048688: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08048698: .4byte gUnknown_80FE40C + thumb_func_end sub_80485B0 + + thumb_func_start sub_804869C +sub_804869C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x1C + adds r4, r0, 0 + adds r7, r1, 0 + lsls r2, 24 + cmp r2, 0 + beq _08048724 + ldr r5, [r7, 0x70] + ldr r0, _080486D4 + ldr r0, [r0] + ldr r1, _080486D8 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080486E4 + ldr r0, _080486DC + movs r1, 0 + ldrsh r6, [r0, r1] + ldr r0, _080486E0 + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r7, 0 + bl sub_80522F4 + b _080486EA + .align 2, 0 +_080486D4: .4byte gUnknown_203B418 +_080486D8: .4byte 0x00000675 +_080486DC: .4byte gUnknown_80F4FA8 +_080486E0: .4byte gUnknown_80FEAE8 +_080486E4: + ldr r0, _0804871C + movs r1, 0 + ldrsh r6, [r0, r1] +_080486EA: + adds r0, r5, 0 + adds r0, 0xB0 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080486FC + adds r0, r4, 0 + adds r1, r7, 0 + bl sub_807A324 +_080486FC: + add r0, sp, 0x18 + str r0, [sp] + movs r1, 0 + str r1, [sp, 0x4] + ldr r0, _08048720 + str r0, [sp, 0x8] + str r1, [sp, 0xC] + str r1, [sp, 0x10] + str r1, [sp, 0x14] + adds r0, r4, 0 + adds r1, r7, 0 + adds r2, r6, 0 + movs r3, 0x1 + bl sub_806F370 + b _080487B6 + .align 2, 0 +_0804871C: .4byte gUnknown_80F4FA4 +_08048720: .4byte 0x00000216 +_08048724: + adds r0, r4, 0 + bl sub_8042520 + adds r0, r4, 0 + bl sub_80696FC + adds r5, r0, 0 + cmp r5, 0 + bne _08048748 + ldr r0, _08048744 + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r7, 0 + bl sub_80522F4 + b _080487B6 + .align 2, 0 +_08048744: .4byte gUnknown_80FDBA0 +_08048748: + ldr r1, [r5, 0x70] + mov r8, r1 + ldr r0, _08048770 + ldr r0, [r0] + ldr r1, _08048774 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08048780 + ldr r0, _08048778 + movs r1, 0 + ldrsh r6, [r0, r1] + ldr r0, _0804877C + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r7, 0 + bl sub_80522F4 + b _08048786 + .align 2, 0 +_08048770: .4byte gUnknown_203B418 +_08048774: .4byte 0x00000675 +_08048778: .4byte gUnknown_80F4FAA +_0804877C: .4byte gUnknown_80FEAE8 +_08048780: + ldr r0, _080487C4 + movs r1, 0 + ldrsh r6, [r0, r1] +_08048786: + mov r0, r8 + adds r0, 0xB0 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08048798 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_807A324 +_08048798: + add r0, sp, 0x18 + str r0, [sp] + movs r1, 0 + str r1, [sp, 0x4] + ldr r0, _080487C8 + str r0, [sp, 0x8] + str r1, [sp, 0xC] + str r1, [sp, 0x10] + str r1, [sp, 0x14] + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + movs r3, 0x1 + bl sub_806F370 +_080487B6: + add sp, 0x1C + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080487C4: .4byte gUnknown_80F4FA6 +_080487C8: .4byte 0x00000216 + thumb_func_end sub_804869C + + thumb_func_start sub_80487CC +sub_80487CC: + push {r4,lr} + sub sp, 0x4 + movs r4, 0x1 + str r4, [sp] + bl sub_8078B5C + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80487CC + + thumb_func_start sub_80487E0 +sub_80487E0: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + mov r9, r0 + mov r8, r1 + lsls r3, r2, 24 + ldr r5, [r1, 0x70] + ldr r4, _08048858 + lsrs r3, 23 + adds r0, r5, 0 + adds r0, 0x5C + ldrb r0, [r0] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r3, r1 + adds r0, r1, r4 + movs r2, 0 + ldrsh r6, [r0, r2] + adds r0, r5, 0 + adds r0, 0x5D + ldrb r2, [r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + adds r3, r0 + adds r4, r3, r4 + movs r2, 0 + ldrsh r0, [r4, r2] + adds r6, r0 + ldr r0, _0804885C + adds r1, r0 + movs r4, 0 + ldrsh r2, [r1, r4] + adds r3, r0 + movs r1, 0 + ldrsh r0, [r3, r1] + adds r2, r0 + movs r0, 0x1 + str r0, [sp] + mov r0, r9 + mov r1, r8 + movs r3, 0 + bl sub_8078B5C + ldrb r0, [r5, 0x6] + cmp r0, 0 + bne _08048906 + adds r0, r5, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x4A + beq _08048852 + cmp r0, 0x47 + bne _08048860 +_08048852: + movs r0, 0x1 + b _08048862 + .align 2, 0 +_08048858: .4byte gUnknown_810A580 +_0804885C: .4byte gUnknown_810A808 +_08048860: + movs r0, 0 +_08048862: + cmp r0, 0 + bne _08048906 + movs r2, 0xC + ldrsh r7, [r5, r2] + ldrh r0, [r5, 0xC] + adds r0, r6 + strh r0, [r5, 0xC] + adds r2, r7, r6 + lsls r0, 16 + cmp r0, 0 + bgt _0804887C + movs r0, 0x1 + strh r0, [r5, 0xC] +_0804887C: + movs r4, 0xC + ldrsh r0, [r5, r4] + ldr r1, _080488A0 + cmp r0, r1 + ble _08048888 + strh r1, [r5, 0xC] +_08048888: + movs r1, 0xC + ldrsh r0, [r5, r1] + cmp r7, r0 + bne _080488A8 + ldr r0, _080488A4 + ldr r2, [r0] + mov r0, r9 + mov r1, r8 + bl sub_80522F4 + b _08048906 + .align 2, 0 +_080488A0: .4byte 0x000003e7 +_080488A4: .4byte gUnknown_80FD644 +_080488A8: + subs r0, r2, r7 + movs r2, 0 + cmp r0, 0x8 + bgt _080488BE + movs r2, 0x1 + cmp r0, 0x4 + bgt _080488BE + movs r2, 0x3 + cmp r0, 0x2 + ble _080488BE + movs r2, 0x2 +_080488BE: + movs r4, 0xC + ldrsh r0, [r5, r4] + subs r0, r7 + movs r4, 0 + cmp r0, 0x8 + bgt _080488D8 + movs r4, 0x1 + cmp r0, 0x4 + bgt _080488D8 + movs r4, 0x3 + cmp r0, 0x2 + ble _080488D8 + movs r4, 0x2 +_080488D8: + ldr r1, _08048914 + lsls r0, r2, 2 + adds r0, r1 + ldr r2, [r0] + mov r0, r9 + mov r1, r8 + bl sub_80522F4 + ldr r1, _08048918 + lsls r0, r4, 2 + adds r0, r1 + ldr r2, [r0] + mov r0, r9 + mov r1, r8 + bl sub_80522F4 + mov r0, r8 + bl sub_807191C + adds r0, r5, 0 + adds r1, r7, 0 + bl sub_806A7E8 +_08048906: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08048914: .4byte gUnknown_80FD648 +_08048918: .4byte gUnknown_80FD6E8 + thumb_func_end sub_80487E0 + + thumb_func_start sub_804891C +sub_804891C: + push {lr} + movs r2, 0x3 + bl sub_80793B0 + pop {r0} + bx r0 + thumb_func_end sub_804891C + + thumb_func_start sub_8048928 +sub_8048928: + push {lr} + movs r2, 0x3 + bl sub_8079420 + pop {r0} + bx r0 + thumb_func_end sub_8048928 + + thumb_func_start sub_8048934 +sub_8048934: + push {lr} + movs r2, 0x3 + bl sub_8079490 + pop {r0} + bx r0 + thumb_func_end sub_8048934 + + thumb_func_start sub_8048940 +sub_8048940: + push {lr} + movs r2, 0x3 + bl sub_8079500 + pop {r0} + bx r0 + thumb_func_end sub_8048940 + + thumb_func_start nullsub_94 +nullsub_94: + bx lr + thumb_func_end nullsub_94 + + thumb_func_start sub_8048950 +sub_8048950: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r10, r0 + mov r8, r1 + ldrb r0, [r1, 0x2] + bl sub_80913CC + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + mov r0, r8 + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08048988 + ldr r0, _08048984 +_08048978: + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 + b _08048A58 + .align 2, 0 +_08048984: .4byte gUnknown_80FE3E8 +_08048988: + mov r1, r8 + ldrb r0, [r1, 0x2] + bl sub_80915A0 + lsls r0, 24 + cmp r0, 0 + beq _080489A0 + ldr r0, _0804899C + b _08048978 + .align 2, 0 +_0804899C: .4byte gUnknown_81006CC +_080489A0: + movs r7, 0 +_080489A2: + ldr r0, _080489FC + ldr r0, [r0] + lsls r1, r7, 2 + ldr r2, _08048A00 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08048A12 + ldr r6, [r4, 0x70] + movs r0, 0x2 + ldrsh r1, [r6, r0] + mov r0, r9 + bl sub_808E190 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + movs r1, 0 + bl sub_8070B6C + lsls r0, 24 + cmp r0, 0 + beq _080489DC + movs r5, 0 +_080489DC: + adds r0, r6, 0 + adds r0, 0xA4 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080489E8 + movs r5, 0 +_080489E8: + adds r0, r6, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x4A + beq _080489F6 + cmp r0, 0x47 + bne _08048A04 +_080489F6: + movs r0, 0x1 + b _08048A06 + .align 2, 0 +_080489FC: .4byte gUnknown_203B418 +_08048A00: .4byte 0x0001357c +_08048A04: + movs r0, 0 +_08048A06: + cmp r0, 0 + beq _08048A0C + movs r5, 0 +_08048A0C: + ldr r1, _08048A50 + adds r0, r6, r1 + strb r5, [r0] +_08048A12: + adds r7, 0x1 + cmp r7, 0x3 + ble _080489A2 + movs r0, 0 + movs r1, 0x1 + bl sub_8062978 + adds r4, r0, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08048A58 + mov r0, r10 + mov r1, r8 + bl sub_804245C + adds r0, r4, 0 + mov r1, r9 + bl sub_8072938 + lsls r0, 24 + cmp r0, 0 + beq _08048A58 + ldr r2, _08048A54 + mov r0, r10 + movs r1, 0 + bl sub_8044E24 + movs r0, 0x1 + b _08048A5A + .align 2, 0 +_08048A50: .4byte 0x00000157 +_08048A54: .4byte 0x00000141 +_08048A58: + movs r0, 0 +_08048A5A: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8048950 + + thumb_func_start sub_8048A68 +sub_8048A68: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r9, r0 + mov r8, r1 + ldrb r1, [r1] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08048A90 + ldr r0, _08048A8C +_08048A80: + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 + b _08048B8C + .align 2, 0 +_08048A8C: .4byte gUnknown_80FE3E8 +_08048A90: + ldr r0, _08048AA4 + ldr r0, [r0] + ldr r1, _08048AA8 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _08048AB0 + ldr r0, _08048AAC + b _08048A80 + .align 2, 0 +_08048AA4: .4byte gUnknown_203B418 +_08048AA8: .4byte 0x0000065c +_08048AAC: .4byte gUnknown_80F9BD8 +_08048AB0: + movs r7, 0 +_08048AB2: + ldr r0, _08048B24 + ldr r0, [r0] + lsls r1, r7, 2 + ldr r2, _08048B28 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08048B4A + ldr r5, [r4, 0x70] + movs r6, 0x1 + ldrb r0, [r5, 0xA] + cmp r0, 0x3 + bhi _08048AF4 + ldr r2, _08048B2C + ldrb r1, [r5, 0xA] + movs r0, 0x64 + muls r1, r0 + ldr r0, _08048B30 + adds r1, r0 + ldr r0, [r2] + adds r0, r1 + movs r1, 0xA + ldrsh r0, [r0, r1] + bl sub_806A538 + lsls r0, 24 + cmp r0, 0 + beq _08048AF6 +_08048AF4: + movs r6, 0 +_08048AF6: + adds r0, r4, 0 + movs r1, 0 + bl sub_8070B6C + lsls r0, 24 + cmp r0, 0 + beq _08048B06 + movs r6, 0 +_08048B06: + adds r0, r5, 0 + adds r0, 0xA4 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08048B12 + movs r6, 0 +_08048B12: + adds r0, r5, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x4A + beq _08048B20 + cmp r0, 0x47 + bne _08048B34 +_08048B20: + movs r0, 0x1 + b _08048B36 + .align 2, 0 +_08048B24: .4byte gUnknown_203B418 +_08048B28: .4byte 0x0001357c +_08048B2C: .4byte gUnknown_203B45C +_08048B30: .4byte 0x00008df8 +_08048B34: + movs r0, 0 +_08048B36: + cmp r0, 0 + beq _08048B3C + movs r6, 0 +_08048B3C: + ldrb r0, [r5, 0x7] + cmp r0, 0 + beq _08048B44 + movs r6, 0 +_08048B44: + ldr r2, _08048B84 + adds r0, r5, r2 + strb r6, [r0] +_08048B4A: + adds r7, 0x1 + cmp r7, 0x3 + ble _08048AB2 + movs r0, 0 + movs r1, 0x1 + bl sub_8062978 + adds r4, r0, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08048B8C + mov r0, r9 + mov r1, r8 + bl sub_804245C + ldr r0, _08048B88 + ldr r0, [r0] + adds r0, 0xBC + str r4, [r0] + movs r2, 0xA1 + lsls r2, 1 + mov r0, r9 + movs r1, 0 + bl sub_8044E24 + movs r0, 0x1 + b _08048B8E + .align 2, 0 +_08048B84: .4byte 0x00000157 +_08048B88: .4byte gUnknown_203B418 +_08048B8C: + movs r0, 0 +_08048B8E: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8048A68 + + thumb_func_start sub_8048B9C +sub_8048B9C: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x20 + mov r9, r0 + movs r0, 0 + mov r8, r0 + mov r2, r9 + ldr r0, [r2, 0x70] + adds r6, r0, 0 + adds r6, 0x44 + ldrb r1, [r1] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08048BD4 + ldr r0, _08048BD0 + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 + movs r0, 0 + b _08048D40 + .align 2, 0 +_08048BD0: .4byte gUnknown_80FE3E8 +_08048BD4: + movs r2, 0 +_08048BD6: + ldr r0, _08048C28 + ldr r0, [r0] + lsls r1, r2, 2 + ldr r3, _08048C2C + adds r0, r3 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + str r2, [sp, 0x1C] + bl sub_80450E0 + lsls r0, 24 + ldr r2, [sp, 0x1C] + cmp r0, 0 + beq _08048C3E + ldr r5, [r4, 0x70] + movs r7, 0x1 + adds r0, r4, 0 + movs r1, 0 + bl sub_8070B6C + lsls r0, 24 + ldr r2, [sp, 0x1C] + cmp r0, 0 + beq _08048C0A + movs r7, 0 +_08048C0A: + adds r0, r5, 0 + adds r0, 0xA4 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08048C16 + movs r7, 0 +_08048C16: + adds r0, r5, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x4A + beq _08048C24 + cmp r0, 0x47 + bne _08048C30 +_08048C24: + movs r0, 0x1 + b _08048C32 + .align 2, 0 +_08048C28: .4byte gUnknown_203B418 +_08048C2C: .4byte 0x0001357c +_08048C30: + movs r0, 0 +_08048C32: + cmp r0, 0 + beq _08048C38 + movs r7, 0 +_08048C38: + ldr r4, _08048C5C + adds r0, r5, r4 + strb r7, [r0] +_08048C3E: + adds r2, 0x1 + cmp r2, 0x3 + ble _08048BD6 + movs r0, 0 + movs r1, 0x1 + bl sub_8062978 + adds r4, r0, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08048C60 + movs r0, 0 + b _08048D40 + .align 2, 0 +_08048C5C: .4byte 0x00000157 +_08048C60: + add r1, sp, 0x4 + adds r0, r6, 0 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + b _08048CE2 +_08048C6E: + ldrh r0, [r6] + cmp r0, 0x1D + bne _08048C7C + adds r0, r6, 0 + bl sub_80637E8 + b _08048CE2 +_08048C7C: + cmp r0, 0x20 + bne _08048C9A + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + adds r0, r6, 0 + bl sub_8063BB4 + movs r0, 0x1 + bl sub_8044C10 + movs r5, 0x1 + mov r8, r5 + b _08048CE2 +_08048C9A: + cmp r0, 0x21 + bne _08048CB6 + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + adds r0, r6, 0 + movs r1, 0 + bl sub_8063CF0 + movs r0, 0x1 + bl sub_8044C10 + b _08048CE2 +_08048CB6: + cmp r0, 0x1E + beq _08048CBE + cmp r0, 0x33 + bne _08048CD0 +_08048CBE: + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + adds r0, r6, 0 + movs r1, 0 + bl sub_8063A70 + b _08048CE2 +_08048CD0: + cmp r0, 0x1F + bne _08048CE2 + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + adds r0, r6, 0 + bl sub_8063B54 +_08048CE2: + adds r0, r6, 0 + bl sub_8044C88 + movs r0, 0x1 + str r0, [sp] + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0 + movs r3, 0 + bl sub_8062F90 + lsls r0, 24 + cmp r0, 0 + beq _08048C6E + mov r0, r8 + cmp r0, 0 + beq _08048D38 + ldr r0, _08048D34 + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_8052B8C + cmp r0, 0x1 + bne _08048C6E + adds r1, r6, 0 + add r0, sp, 0x4 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + mov r0, r9 + movs r1, 0 + movs r2, 0x6E + bl sub_8044DF0 + adds r0, r6, 0 + movs r1, 0x2C + bl sub_8044C94 + b _08048D3E + .align 2, 0 +_08048D34: .4byte gUnknown_80FECA0 +_08048D38: + movs r0, 0x1 + bl sub_8044C10 +_08048D3E: + mov r0, r8 +_08048D40: + add sp, 0x20 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8048B9C + + thumb_func_start sub_8048D50 +sub_8048D50: + push {r4,lr} + adds r4, r0, 0 + adds r2, r1, 0 + ldr r3, [r4, 0x70] + ldrb r1, [r2] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08048D78 + ldr r0, _08048D70 + adds r1, r2, 0 + bl sub_8045BF8 + ldr r0, _08048D74 + b _08048D9A + .align 2, 0 +_08048D70: .4byte gUnknown_202DE58 +_08048D74: .4byte gUnknown_80FE3E8 +_08048D78: + adds r0, r3, 0 + adds r0, 0xEC + ldrb r0, [r0] + cmp r0, 0x1 + bne _08048DB0 + ldrb r0, [r2, 0x2] + bl sub_8091570 + lsls r0, 24 + cmp r0, 0 + beq _08048DB0 + ldr r0, _08048DA8 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08048DAC +_08048D9A: + ldr r1, [r0] + adds r0, r4, 0 + bl sub_80522A8 + movs r0, 0 + b _08048DB2 + .align 2, 0 +_08048DA8: .4byte gUnknown_202DF98 +_08048DAC: .4byte gUnknown_80FDCA4 +_08048DB0: + movs r0, 0x1 +_08048DB2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8048D50 + + thumb_func_start sub_8048DB8 +sub_8048DB8: + push {r4,lr} + sub sp, 0x1C + adds r3, r0, 0 + adds r4, r1, 0 + lsls r2, 24 + cmp r2, 0 + beq _08048DF4 + ldr r0, _08048DEC + movs r1, 0 + ldrsh r2, [r0, r1] + add r0, sp, 0x18 + str r0, [sp] + movs r1, 0 + str r1, [sp, 0x4] + ldr r0, _08048DF0 + str r0, [sp, 0x8] + str r1, [sp, 0xC] + str r1, [sp, 0x10] + str r1, [sp, 0x14] + adds r0, r3, 0 + adds r1, r4, 0 + movs r3, 0x1 + bl sub_806F370 + b _08048DFA + .align 2, 0 +_08048DEC: .4byte gUnknown_80F4FAC +_08048DF0: .4byte 0x00000217 +_08048DF4: + adds r0, r3, 0 + bl sub_8051E7C +_08048DFA: + add sp, 0x1C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8048DB8 + + thumb_func_start sub_8048E04 +sub_8048E04: + push {r4-r6,lr} + sub sp, 0x8 + adds r5, r0, 0 + adds r6, r1, 0 + movs r0, 0x1 + str r0, [sp] + adds r0, r5, 0 + movs r2, 0x1E + movs r3, 0 + bl sub_8078B5C + movs r0, 0x5 + bl sub_8084100 + cmp r0, 0x4 + bhi _08048E9E + lsls r0, 2 + ldr r1, _08048E30 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08048E30: .4byte _08048E34 + .align 2, 0 +_08048E34: + .4byte _08048E48 + .4byte _08048E54 + .4byte _08048E5E + .4byte _08048E6C + .4byte _08048E78 +_08048E48: + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0x1 + bl sub_80763F8 + b _08048E9E +_08048E54: + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_80769CC + b _08048E9E +_08048E5E: + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0x1 + bl sub_8076210 + b _08048E9E +_08048E6C: + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0x1 + bl sub_8077780 + b _08048E9E +_08048E78: + ldr r0, _08048EA8 + ldr r2, [r0] + movs r4, 0x1 + str r4, [sp] + str r4, [sp, 0x4] + adds r0, r5, 0 + adds r1, r6, 0 + movs r3, 0x3 + bl sub_8076E20 + ldr r0, _08048EAC + ldr r2, [r0] + str r4, [sp] + str r4, [sp, 0x4] + adds r0, r5, 0 + adds r1, r6, 0 + movs r3, 0x3 + bl sub_8076E20 +_08048E9E: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08048EA8: .4byte gUnknown_8106A4C +_08048EAC: .4byte gUnknown_8106A50 + thumb_func_end sub_8048E04 + + thumb_func_start sub_8048EB0 +sub_8048EB0: + push {lr} + ldr r1, _08048EC0 + ldr r1, [r1] + bl sub_80522A8 + pop {r0} + bx r0 + .align 2, 0 +_08048EC0: .4byte gUnknown_81003E0 + thumb_func_end sub_8048EB0 + + thumb_func_start sub_8048EC4 +sub_8048EC4: + push {lr} + ldr r1, _08048ED4 + ldr r1, [r1] + bl sub_80522A8 + pop {r0} + bx r0 + .align 2, 0 +_08048ED4: .4byte gUnknown_8100404 + thumb_func_end sub_8048EC4 + + thumb_func_start sub_8048ED8 +sub_8048ED8: + push {lr} + ldr r1, _08048EE8 + ldr r1, [r1] + bl sub_80522A8 + pop {r0} + bx r0 + .align 2, 0 +_08048EE8: .4byte gUnknown_8100428 + thumb_func_end sub_8048ED8 + + thumb_func_start sub_8048EEC +sub_8048EEC: + push {lr} + ldr r1, _08048EFC + ldr r1, [r1] + bl sub_80522A8 + pop {r0} + bx r0 + .align 2, 0 +_08048EFC: .4byte gUnknown_810044C + thumb_func_end sub_8048EEC + + thumb_func_start sub_8048F00 +sub_8048F00: + push {r4,lr} + adds r4, r0, 0 + movs r1, 0xD6 + bl sub_80421C0 + ldr r0, _08048F24 + ldr r1, [r0] + adds r0, r4, 0 + bl sub_80522A8 + movs r0, 0x3C + movs r1, 0x46 + bl sub_803E708 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08048F24: .4byte gUnknown_8100494 + thumb_func_end sub_8048F00 + + thumb_func_start sub_8048F28 +sub_8048F28: + push {r4-r7,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldr r3, [r4, 0x70] + movs r6, 0 + movs r0, 0x1 + adds r5, r2, 0 + ands r5, r0 + lsrs r2, 1 + movs r0, 0x1 + ands r2, r0 + ldrb r0, [r1, 0x2] + subs r0, 0x1 + cmp r0, 0xCC + bls _08048F48 + b _080494E0 +_08048F48: + lsls r0, 2 + ldr r1, _08048F54 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08048F54: .4byte _08048F58 + .align 2, 0 +_08048F58: + .4byte _0804928C + .4byte _0804928C + .4byte _0804928C + .4byte _0804928C + .4byte _0804928C + .4byte _0804928C + .4byte _0804928C + .4byte _0804928C + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _08049408 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _08049296 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080492B0 + .4byte _080492B0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _08049320 + .4byte _080494E0 + .4byte _080492B8 + .4byte _080492B8 + .4byte _0804935E + .4byte _080494E0 + .4byte _080493E0 + .4byte _0804948E + .4byte _08049394 + .4byte _08049344 + .4byte _0804946E + .4byte _0804947A + .4byte _08049378 + .4byte _080493CE + .4byte _080493AC + .4byte _080493B8 + .4byte _08049436 + .4byte _080494E0 + .4byte _080493F6 + .4byte _080494B2 + .4byte _0804946A + .4byte _08049462 + .4byte _08049454 + .4byte _08049498 + .4byte _080492DC + .4byte _0804932C + .4byte _08049338 + .4byte _0804933C + .4byte _08049340 + .4byte _080494C2 + .4byte _080494C2 + .4byte _080494D6 + .4byte _080494C2 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494E0 + .4byte _080494DA +_0804928C: + cmp r5, 0 + bne _08049292 + b _080494E2 +_08049292: + movs r6, 0x46 + b _080494E2 +_08049296: + cmp r5, 0 + bne _0804929C + b _080494E0 +_0804929C: + movs r1, 0x9E + lsls r1, 1 + adds r0, r3, r1 + ldr r0, [r0] + bl sub_8094450 + cmp r0, 0 + ble _080492AE + b _0804948A +_080492AE: + b _080494E0 +_080492B0: + cmp r5, 0 + beq _080492B6 + b _0804948A +_080492B6: + b _080494E0 +_080492B8: + movs r2, 0xE + ldrsh r1, [r3, r2] + movs r2, 0x10 + ldrsh r0, [r3, r2] + cmp r1, r0 + blt _080492C6 + b _080494E2 +_080492C6: + cmp r0, 0 + bge _080492CC + adds r0, 0x3 +_080492CC: + asrs r0, 2 + cmp r1, r0 + ble _080492D4 + b _080494E2 +_080492D4: + cmp r5, 0 + bne _080492DA + b _08049420 +_080492DA: + b _08049432 +_080492DC: + movs r6, 0 + movs r0, 0x8C + lsls r0, 1 + adds r5, r3, r0 + adds r7, r5, 0 + movs r2, 0x3 +_080492E8: + ldrb r1, [r5] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0804930C + ldrb r0, [r5, 0x4] + cmp r0, 0 + bne _080492FA + adds r6, 0x1E +_080492FA: + ldrb r4, [r5, 0x4] + adds r0, r7, 0 + str r2, [sp] + bl sub_8092BF4 + ldr r2, [sp] + cmp r4, r0 + beq _0804930C + adds r6, 0x6 +_0804930C: + adds r5, 0x8 + adds r7, 0x8 + subs r2, 0x1 + cmp r2, 0 + bge _080492E8 + cmp r6, 0x62 + bgt _0804931C + b _080494E2 +_0804931C: + movs r6, 0x63 + b _080494E2 +_08049320: + adds r0, r4, 0 + bl sub_8070A58 + lsls r0, 24 + movs r6, 0 + b _080494BC +_0804932C: + ldrb r0, [r3, 0x14] +_0804932E: + movs r6, 0x64 + cmp r0, 0xF9 + bhi _08049336 + b _080494E2 +_08049336: + b _080494E0 +_08049338: + ldrb r0, [r3, 0x15] + b _0804932E +_0804933C: + ldrb r0, [r3, 0x16] + b _0804932E +_08049340: + ldrb r0, [r3, 0x17] + b _0804932E +_08049344: + cmp r5, 0 + beq _0804934A + b _080494E0 +_0804934A: + adds r0, r4, 0 + bl sub_80494EC + lsls r0, 24 + movs r6, 0x64 + cmp r0, 0 + bne _0804935A + b _080494E2 +_0804935A: + movs r6, 0xA + b _080494E2 +_0804935E: + adds r0, r4, 0 + bl sub_8071884 + lsls r0, 24 + cmp r0, 0 + beq _0804936C + b _080494A2 +_0804936C: + adds r0, r4, 0 + bl sub_80494EC + lsls r0, 24 + movs r6, 0x5 + b _080494BC +_08049378: + ldr r0, [r4, 0x70] + movs r1, 0x82 + lsls r1, 1 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0x3 + ble _08049388 + b _080494A2 +_08049388: + adds r0, r4, 0 + bl sub_80494EC + lsls r0, 24 + movs r6, 0x5 + b _080494BC +_08049394: + adds r0, r3, 0 + adds r0, 0xE8 + ldrb r0, [r0] + cmp r0, 0x2 + bne _080493A0 + b _080494A2 +_080493A0: + adds r0, r4, 0 + bl sub_80494EC + lsls r0, 24 + movs r6, 0x5 + b _080494BC +_080493AC: + adds r0, r3, 0 + adds r0, 0xAC + ldrb r0, [r0] + cmp r0, 0x4 + bne _080494A2 + b _080494B2 +_080493B8: + adds r0, r3, 0 + adds r0, 0xBC + ldrb r0, [r0] + cmp r0, 0x2 + beq _080494A2 + adds r0, r4, 0 + bl sub_80494EC + lsls r0, 24 + movs r6, 0xF + b _080494BC +_080493CE: + adds r0, r3, 0 + adds r0, 0xAC + ldrb r0, [r0] + subs r0, 0x2 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _080494A2 + b _08049420 +_080493E0: + adds r0, r3, 0 + adds r0, 0xE8 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080494A2 + adds r0, r4, 0 + bl sub_80494EC + lsls r0, 24 + movs r6, 0x5 + b _080494BC +_080493F6: + cmp r2, 0 + bne _0804940C + adds r0, r4, 0 + bl sub_80494EC + lsls r0, 24 + movs r6, 0x5 + cmp r0, 0 + beq _080494E2 +_08049408: + movs r6, 0x28 + b _080494E2 +_0804940C: + movs r2, 0xE + ldrsh r1, [r3, r2] + movs r2, 0x10 + ldrsh r0, [r3, r2] + cmp r1, r0 + bge _080494E2 + cmp r1, 0x13 + bgt _080494E2 + cmp r5, 0 + bne _08049432 +_08049420: + adds r0, r4, 0 + bl sub_80494EC + lsls r0, 24 + movs r6, 0x32 + cmp r0, 0 + beq _080494E2 + movs r6, 0x64 + b _080494E2 +_08049432: + movs r6, 0x32 + b _080494E2 +_08049436: + adds r0, r3, 0 + adds r0, 0xA8 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080494A2 + cmp r0, 0x5 + beq _080494A2 + cmp r0, 0x3 + beq _080494A2 + adds r0, r4, 0 + bl sub_80494EC + lsls r0, 24 + movs r6, 0x5 + b _080494BC +_08049454: + adds r0, r3, 0 + adds r0, 0xA8 + ldrb r0, [r0] + cmp r0, 0x2 + beq _080494A2 + movs r6, 0x5 + b _080494E2 +_08049462: + ldrb r0, [r3, 0x9] + movs r6, 0 + cmp r0, 0x62 + bhi _080494E2 +_0804946A: + movs r6, 0x50 + b _080494E2 +_0804946E: + adds r0, r3, 0 + adds r0, 0xAC + ldrb r0, [r0] + cmp r0, 0x1 + beq _0804948A + b _080494E0 +_0804947A: + movs r1, 0x9E + lsls r1, 1 + adds r0, r3, r1 + ldr r0, [r0] + bl sub_8094450 + cmp r0, 0 + ble _080494E0 +_0804948A: + movs r0, 0x32 + b _080494E4 +_0804948E: + ldrb r0, [r3, 0x9] + movs r6, 0 + cmp r0, 0x1 + bls _080494E2 + b _0804946A +_08049498: + adds r0, r3, 0 + adds r0, 0xB0 + ldrb r0, [r0] + cmp r0, 0x6 + bne _080494A6 +_080494A2: + movs r0, 0 + b _080494E4 +_080494A6: + adds r0, r4, 0 + bl sub_80494EC + lsls r0, 24 + movs r6, 0x5 + b _080494BC +_080494B2: + adds r0, r4, 0 + bl sub_80494EC + lsls r0, 24 + movs r6, 0x1E +_080494BC: + cmp r0, 0 + beq _080494E2 + b _0804946A +_080494C2: + movs r2, 0x9E + lsls r2, 1 + adds r0, r3, r2 + ldr r0, [r0] + bl sub_8094450 + cmp r0, 0x9 + bgt _080494E0 + movs r0, 0x64 + b _080494E4 +_080494D6: + movs r6, 0x1E + b _080494E2 +_080494DA: + movs r6, 0x14 + cmp r5, 0 + beq _080494E2 +_080494E0: + movs r6, 0 +_080494E2: + adds r0, r6, 0 +_080494E4: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8048F28 + + thumb_func_start sub_80494EC +sub_80494EC: + push {r4-r6,lr} + adds r5, r0, 0 + movs r6, 0 +_080494F2: + movs r1, 0x4 + ldrsh r0, [r5, r1] + ldr r1, _08049538 + lsls r2, r6, 2 + adds r2, r1 + movs r3, 0 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r3, 0x6 + ldrsh r1, [r5, r3] + movs r3, 0x2 + ldrsh r2, [r2, r3] + adds r1, r2 + bl sub_804954C + ldr r4, [r0, 0x10] + cmp r4, 0 + beq _0804953C + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0 + beq _0804953C + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_8071598 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0804953C + movs r0, 0x1 + b _08049544 + .align 2, 0 +_08049538: .4byte gUnknown_80F4448 +_0804953C: + adds r6, 0x1 + cmp r6, 0x7 + ble _080494F2 + movs r0, 0 +_08049544: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80494EC + + thumb_func_start sub_804954C +sub_804954C: + push {lr} + adds r2, r0, 0 + adds r3, r1, 0 + cmp r2, 0 + blt _08049584 + cmp r3, 0 + blt _08049584 + cmp r2, 0x37 + bgt _08049584 + cmp r3, 0x1F + bgt _08049584 + ldr r0, _0804957C + ldr r1, [r0] + lsls r2, 2 + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 5 + adds r2, r0 + ldr r0, _08049580 + adds r1, r0 + adds r1, r2 + ldr r0, [r1] + b _08049588 + .align 2, 0 +_0804957C: .4byte gUnknown_203B418 +_08049580: .4byte 0x0000e8c0 +_08049584: + ldr r0, _0804958C + ldr r0, [r0] +_08049588: + pop {r1} + bx r1 + .align 2, 0 +_0804958C: .4byte gUnknown_203B430 + thumb_func_end sub_804954C + + thumb_func_start sub_8049590 +sub_8049590: + push {r4,r5,lr} + adds r2, r0, 0 + adds r3, r1, 0 + cmp r2, 0 + blt _080495A6 + cmp r3, 0 + blt _080495A6 + cmp r2, 0x37 + bgt _080495A6 + cmp r3, 0x1F + ble _080495C0 +_080495A6: + ldr r0, _080495B8 + ldr r1, _080495BC + adds r2, r0, 0 + ldr r1, [r1] + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + ldm r1!, {r3-r5} + stm r2!, {r3-r5} + b _080495D6 + .align 2, 0 +_080495B8: .4byte gUnknown_202F190 +_080495BC: .4byte gUnknown_203B430 +_080495C0: + ldr r0, _080495DC + ldr r1, [r0] + lsls r2, 2 + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 5 + adds r2, r0 + ldr r0, _080495E0 + adds r1, r0 + adds r1, r2 + ldr r0, [r1] +_080495D6: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080495DC: .4byte gUnknown_203B418 +_080495E0: .4byte 0x0000e8c0 + thumb_func_end sub_8049590 + + thumb_func_start sub_80495E4 +sub_80495E4: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r2, 0 + ldr r0, _08049658 + mov r9, r0 + mov r12, r9 + ldr r7, _0804965C + ldr r1, _08049660 + mov r8, r1 +_080495FA: + lsls r1, r2, 3 + lsls r0, r2, 2 + adds r6, r2, 0x1 + subs r1, r2 + adds r0, r2 + lsls r0, 2 + adds r0, r2 + lsls r0, 6 + movs r4, 0 + lsls r2, r1, 5 + mov r3, r8 + adds r5, r0, r3 + movs r3, 0x37 +_08049614: + mov r1, r12 + ldr r0, [r1] + adds r1, r0, r7 + adds r1, r2 + adds r0, r5 + adds r0, r4 + str r0, [r1] + adds r4, 0x18 + adds r2, 0x4 + subs r3, 0x1 + cmp r3, 0 + bge _08049614 + adds r2, r6, 0 + cmp r2, 0x1F + ble _080495FA + movs r2, 0 + mov r3, r9 + ldr r1, [r3] + ldr r4, _08049664 + adds r0, r1, r4 + movs r3, 0 + strh r2, [r0] + adds r4, 0x2 + adds r0, r1, r4 + strh r2, [r0] + ldr r0, _08049668 + adds r1, r0 + strb r3, [r1] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08049658: .4byte gUnknown_203B418 +_0804965C: .4byte 0x0000e8c0 +_08049660: .4byte 0x00003a18 +_08049664: .4byte 0x00003a0e +_08049668: .4byte 0x00013570 + thumb_func_end sub_80495E4 + + thumb_func_start sub_804966C +sub_804966C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + ldr r1, _08049734 + ldr r0, _08049738 + mov r8, r0 + ldr r6, _0804973C + ldr r0, [r6] + ldr r5, _08049740 + adds r0, r5 + movs r2, 0 + ldrsh r0, [r0, r2] + add r0, r8 + ldrb r2, [r0] + mov r0, sp + bl sprintf + ldr r7, _08049744 + mov r0, sp + adds r1, r7, 0 + bl sub_800A9EC + adds r4, r0, 0 + ldr r0, _08049748 + movs r1, 0 + adds r2, r4, 0 + bl sub_800AE28 + adds r0, r4, 0 + bl sub_800AA14 + ldr r1, _0804974C + ldr r0, [r6] + adds r0, r5 + movs r3, 0 + ldrsh r2, [r0, r3] + mov r0, sp + bl sprintf + mov r0, sp + adds r1, r7, 0 + bl sub_800A9EC + ldr r1, _08049750 + str r0, [r1] + ldr r1, _08049754 + ldr r0, [r6] + adds r0, r5 + movs r4, 0 + ldrsh r0, [r0, r4] + add r0, r8 + ldrb r2, [r0] + mov r0, sp + bl sprintf + mov r0, sp + adds r1, r7, 0 + bl sub_800A9EC + adds r4, r0, 0 + ldr r0, [r6] + ldr r1, _08049758 + adds r0, r1 + ldr r1, _0804975C + adds r2, r4, 0 + bl sub_800AAA8 + adds r0, r4, 0 + bl sub_800AA14 + ldr r0, [r6] + adds r2, r0, r5 + movs r3, 0 + ldrsh r0, [r2, r3] + cmp r0, 0x3F + bgt _08049768 + ldr r1, _08049760 + add r0, r8 + ldrb r2, [r0] + mov r0, sp + bl sprintf + mov r0, sp + adds r1, r7, 0 + bl sub_800A9EC + adds r4, r0, 0 + ldr r0, [r6] + ldr r1, _08049764 + adds r0, r1 + movs r1, 0x93 + lsls r1, 4 + adds r2, r4, 0 + bl sub_800AAA8 + adds r0, r4, 0 + bl sub_800AA14 + b _08049794 + .align 2, 0 +_08049734: .4byte gUnknown_80F6A04 +_08049738: .4byte gUnknown_8108EC0 +_0804973C: .4byte gUnknown_203B418 +_08049740: .4byte 0x00003a0e +_08049744: .4byte gUnknown_83B0000 +_08049748: .4byte 0x06008000 +_0804974C: .4byte gUnknown_80F6A10 +_08049750: .4byte gUnknown_202EE88 +_08049754: .4byte gUnknown_80F6A1C +_08049758: .4byte 0x00011884 +_0804975C: .4byte 0x00001194 +_08049760: .4byte gUnknown_80F6A28 +_08049764: .4byte 0x00012c24 +_08049768: + ldr r1, _080497E8 + movs r3, 0 + ldrsh r2, [r2, r3] + mov r0, sp + bl sprintf + mov r0, sp + adds r1, r7, 0 + bl sub_800A9EC + adds r4, r0, 0 + ldr r0, [r6] + ldr r1, _080497EC + adds r0, r1 + movs r1, 0x90 + lsls r1, 2 + adds r2, r4, 0 + bl sub_800AAA8 + adds r0, r4, 0 + bl sub_800AA14 +_08049794: + ldr r1, _080497F0 + ldr r5, _080497F4 + ldr r0, [r5] + ldr r4, _080497F8 + adds r0, r4 + movs r3, 0 + ldrsh r2, [r0, r3] + mov r0, sp + bl sprintf + ldr r1, _080497FC + mov r0, sp + bl sub_800A9EC + adds r1, r0, 0 + ldr r0, _08049800 + str r1, [r0] + ldr r0, _08049804 + movs r2, 0x20 + bl sub_8004AA4 + ldr r2, _08049808 + movs r6, 0 + strb r6, [r2] + movs r3, 0x1 + strb r3, [r2, 0x1] + movs r0, 0x2 + strb r0, [r2, 0x2] + movs r0, 0x3 + strb r0, [r2, 0x3] + ldr r1, _0804980C + ldr r0, [r5] + adds r0, r4 + movs r4, 0 + ldrsh r0, [r0, r4] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08049810 + strb r3, [r2, 0x4] + strb r6, [r2, 0x5] + b _08049814 + .align 2, 0 +_080497E8: .4byte gUnknown_80F6A34 +_080497EC: .4byte 0x00012c24 +_080497F0: .4byte gUnknown_80F6A40 +_080497F4: .4byte gUnknown_203B418 +_080497F8: .4byte 0x00003a0e +_080497FC: .4byte gUnknown_83B0000 +_08049800: .4byte gUnknown_202F18C +_08049804: .4byte gUnknown_202EE8C +_08049808: .4byte gUnknown_202F314 +_0804980C: .4byte gUnknown_810ACC0 +_08049810: + strb r6, [r2, 0x4] + strb r3, [r2, 0x5] +_08049814: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_804966C + + thumb_func_start sub_8049820 +sub_8049820: + push {lr} + ldr r0, _08049838 + ldr r0, [r0] + bl sub_800AA14 + ldr r0, _0804983C + ldr r0, [r0] + bl sub_800AA14 + pop {r0} + bx r0 + .align 2, 0 +_08049838: .4byte gUnknown_202F18C +_0804983C: .4byte gUnknown_202EE88 + thumb_func_end sub_8049820 + + thumb_func_start sub_8049840 +sub_8049840: + push {lr} + ldr r0, _08049860 + ldr r0, [r0] + ldr r1, _08049864 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + bl sub_8043CE4 + lsls r0, 24 + cmp r0, 0 + beq _08049870 + ldr r1, _08049868 + ldr r0, _0804986C + b _08049874 + .align 2, 0 +_08049860: .4byte gUnknown_203B418 +_08049864: .4byte 0x00003a0e +_08049868: .4byte gUnknown_203B430 +_0804986C: .4byte gUnknown_80F69EC +_08049870: + ldr r1, _0804987C + ldr r0, _08049880 +_08049874: + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_0804987C: .4byte gUnknown_203B430 +_08049880: .4byte gUnknown_80F69D4 + thumb_func_end sub_8049840 + + thumb_func_start sub_8049884 +sub_8049884: + push {r4-r6,lr} + movs r5, 0 +_08049888: + movs r4, 0 + adds r6, r5, 0x1 +_0804988C: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80498A8 + adds r4, 0x1 + cmp r4, 0x37 + ble _0804988C + adds r5, r6, 0 + cmp r5, 0x1F + ble _08049888 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8049884 + + thumb_func_start sub_80498A8 +sub_80498A8: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + mov r10, r0 + mov r9, r1 + cmp r0, 0 + bge _080498BE + b _08049B72 +_080498BE: + cmp r1, 0 + bge _080498C4 + b _08049B72 +_080498C4: + cmp r0, 0x37 + ble _080498CA + b _08049B72 +_080498CA: + cmp r1, 0x1F + ble _080498D0 + b _08049B72 +_080498D0: + movs r7, 0 + bl sub_804954C + ldrh r0, [r0] + movs r1, 0x3 + mov r8, r1 + mov r6, r8 + ands r6, r0 + str r6, [sp, 0x20] + ldr r4, _08049914 + ldr r0, [r4] + ldr r3, _08049918 + adds r0, r3 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x3F + ble _08049928 + mov r3, r10 + cmp r3, 0x17 + bgt _0804991C + mov r0, r9 + cmp r0, 0x17 + bgt _0804991C + mov r0, r10 + mov r1, r9 + bl sub_8049590 + ldr r2, [r4] + mov r3, r9 + lsls r1, r3, 1 + add r1, r9 + lsls r1, 3 + add r1, r10 + b _08049B68 + .align 2, 0 +_08049914: .4byte gUnknown_203B418 +_08049918: .4byte 0x00003a0e +_0804991C: + mov r0, r10 + mov r1, r9 + bl sub_8049590 + movs r1, 0 + b _08049B70 +_08049928: + mov r0, r9 + adds r0, 0x1 + str r0, [sp, 0x24] + mov r0, r10 + ldr r1, [sp, 0x24] + bl sub_804954C + ldrh r1, [r0] + mov r0, r8 + ands r0, r1 + str r0, [sp] + mov r4, r10 + adds r4, 0x1 + adds r0, r4, 0 + ldr r1, [sp, 0x24] + bl sub_804954C + ldrh r1, [r0] + mov r0, r8 + ands r0, r1 + str r0, [sp, 0x4] + adds r0, r4, 0 + mov r1, r9 + bl sub_804954C + ldrh r1, [r0] + mov r0, r8 + ands r0, r1 + str r0, [sp, 0x8] + mov r5, r9 + subs r5, 0x1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_804954C + ldrh r1, [r0] + mov r0, r8 + ands r0, r1 + str r0, [sp, 0xC] + mov r0, r10 + adds r1, r5, 0 + bl sub_804954C + ldrh r1, [r0] + mov r0, r8 + ands r0, r1 + str r0, [sp, 0x10] + subs r4, 0x2 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_804954C + ldrh r1, [r0] + mov r0, r8 + ands r0, r1 + str r0, [sp, 0x14] + adds r0, r4, 0 + mov r1, r9 + bl sub_804954C + ldrh r1, [r0] + mov r0, r8 + ands r0, r1 + str r0, [sp, 0x18] + adds r0, r4, 0 + ldr r1, [sp, 0x24] + bl sub_804954C + ldrh r0, [r0] + mov r1, r8 + ands r1, r0 + str r1, [sp, 0x1C] + cmp r6, 0x1 + bne _08049A1E + movs r7, 0xFF + ldr r0, [sp] + cmp r0, 0 + bne _080499C6 + movs r7, 0xFE +_080499C6: + ldr r0, [sp, 0x4] + cmp r0, 0 + bne _080499D2 + movs r0, 0x3 + negs r0, r0 + ands r7, r0 +_080499D2: + ldr r0, [sp, 0x8] + cmp r0, 0 + bne _080499DE + movs r0, 0x5 + negs r0, r0 + ands r7, r0 +_080499DE: + ldr r0, [sp, 0xC] + cmp r0, 0 + bne _080499EA + movs r0, 0x9 + negs r0, r0 + ands r7, r0 +_080499EA: + ldr r0, [sp, 0x10] + cmp r0, 0 + bne _080499F6 + movs r0, 0x11 + negs r0, r0 + ands r7, r0 +_080499F6: + ldr r0, [sp, 0x14] + cmp r0, 0 + bne _08049A02 + movs r0, 0x21 + negs r0, r0 + ands r7, r0 +_08049A02: + ldr r0, [sp, 0x18] + cmp r0, 0 + bne _08049A0E + movs r0, 0x41 + negs r0, r0 + ands r7, r0 +_08049A0E: + cmp r1, 0 + bne _08049A18 + movs r0, 0x81 + negs r0, r0 + ands r7, r0 +_08049A18: + movs r0, 0x80 + lsls r0, 2 + b _08049B3A +_08049A1E: + cmp r6, 0x2 + bne _08049A84 + movs r7, 0xFF + ldr r0, [sp] + cmp r0, 0x2 + beq _08049A2C + movs r7, 0xFE +_08049A2C: + ldr r0, [sp, 0x4] + cmp r0, 0x2 + beq _08049A38 + movs r0, 0x3 + negs r0, r0 + ands r7, r0 +_08049A38: + ldr r0, [sp, 0x8] + cmp r0, 0x2 + beq _08049A44 + movs r0, 0x5 + negs r0, r0 + ands r7, r0 +_08049A44: + ldr r0, [sp, 0xC] + cmp r0, 0x2 + beq _08049A50 + movs r0, 0x9 + negs r0, r0 + ands r7, r0 +_08049A50: + ldr r0, [sp, 0x10] + cmp r0, 0x2 + beq _08049A5C + movs r0, 0x11 + negs r0, r0 + ands r7, r0 +_08049A5C: + ldr r0, [sp, 0x14] + cmp r0, 0x2 + beq _08049A68 + movs r0, 0x21 + negs r0, r0 + ands r7, r0 +_08049A68: + ldr r0, [sp, 0x18] + cmp r0, 0x2 + beq _08049A74 + movs r0, 0x41 + negs r0, r0 + ands r7, r0 +_08049A74: + cmp r1, 0x2 + beq _08049A7E + movs r0, 0x81 + negs r0, r0 + ands r7, r0 +_08049A7E: + movs r0, 0x80 + lsls r0, 1 + b _08049B3A +_08049A84: + ldr r1, [sp, 0x20] + cmp r1, 0x3 + bne _08049AEE + movs r7, 0xFF + ldr r0, [sp] + cmp r0, 0x3 + beq _08049A94 + movs r7, 0xFE +_08049A94: + ldr r0, [sp, 0x4] + cmp r0, 0x3 + beq _08049AA0 + movs r0, 0x3 + negs r0, r0 + ands r7, r0 +_08049AA0: + ldr r0, [sp, 0x8] + cmp r0, 0x3 + beq _08049AAC + movs r0, 0x5 + negs r0, r0 + ands r7, r0 +_08049AAC: + ldr r0, [sp, 0xC] + cmp r0, 0x3 + beq _08049AB8 + movs r0, 0x9 + negs r0, r0 + ands r7, r0 +_08049AB8: + ldr r0, [sp, 0x10] + cmp r0, 0x3 + beq _08049AC4 + movs r0, 0x11 + negs r0, r0 + ands r7, r0 +_08049AC4: + ldr r0, [sp, 0x14] + cmp r0, 0x3 + beq _08049AD0 + movs r0, 0x21 + negs r0, r0 + ands r7, r0 +_08049AD0: + ldr r0, [sp, 0x18] + cmp r0, 0x3 + beq _08049ADC + movs r0, 0x41 + negs r0, r0 + ands r7, r0 +_08049ADC: + ldr r0, [sp, 0x1C] + cmp r0, 0x3 + beq _08049AE8 + movs r0, 0x81 + negs r0, r0 + ands r7, r0 +_08049AE8: + movs r0, 0x80 + lsls r0, 1 + b _08049B3A +_08049AEE: + ldr r0, [sp] + cmp r0, 0 + bne _08049AF6 + movs r7, 0x1 +_08049AF6: + ldr r0, [sp, 0x4] + cmp r0, 0 + bne _08049B00 + movs r0, 0x2 + orrs r7, r0 +_08049B00: + ldr r0, [sp, 0x8] + cmp r0, 0 + bne _08049B0A + movs r0, 0x4 + orrs r7, r0 +_08049B0A: + ldr r0, [sp, 0xC] + cmp r0, 0 + bne _08049B14 + movs r0, 0x8 + orrs r7, r0 +_08049B14: + ldr r0, [sp, 0x10] + cmp r0, 0 + bne _08049B1E + movs r0, 0x10 + orrs r7, r0 +_08049B1E: + ldr r0, [sp, 0x14] + cmp r0, 0 + bne _08049B28 + movs r0, 0x20 + orrs r7, r0 +_08049B28: + ldr r0, [sp, 0x18] + cmp r0, 0 + bne _08049B32 + movs r0, 0x40 + orrs r7, r0 +_08049B32: + ldr r0, [sp, 0x1C] + cmp r0, 0 + bne _08049B3C + movs r0, 0x80 +_08049B3A: + orrs r7, r0 +_08049B3C: + movs r0, 0x4 + bl RandomCapped + adds r4, r0, 0 + cmp r4, 0x3 + bne _08049B4A + movs r4, 0 +_08049B4A: + bl sub_80441BC + lsls r0, 24 + cmp r0, 0 + beq _08049B56 + movs r4, 0 +_08049B56: + mov r0, r10 + mov r1, r9 + bl sub_8049590 + ldr r1, _08049B84 + ldr r2, [r1] + lsls r1, r7, 1 + adds r1, r7 + adds r1, r4, r1 +_08049B68: + ldr r3, _08049B88 + adds r2, r3 + adds r2, r1 + ldrb r1, [r2] +_08049B70: + strb r1, [r0, 0x8] +_08049B72: + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08049B84: .4byte gUnknown_203B418 +_08049B88: .4byte 0x00012c24 + thumb_func_end sub_80498A8 + + thumb_func_start sub_8049B8C +sub_8049B8C: + push {r4-r6,lr} + movs r5, 0 +_08049B90: + movs r4, 0 + adds r6, r5, 0x1 +_08049B94: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8049BB0 + adds r4, 0x1 + cmp r4, 0x37 + ble _08049B94 + adds r5, r6, 0 + cmp r5, 0x1F + ble _08049B90 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8049B8C + + thumb_func_start sub_8049BB0 +sub_8049BB0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x44 + mov r10, r0 + str r1, [sp, 0x40] + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + adds r0, r1, 0 + adds r0, 0x1 + mov r9, r0 + mov r0, r10 + mov r1, r9 + bl sub_804954C + ldrh r1, [r0] + movs r4, 0x3 + adds r0, r4, 0 + ands r0, r1 + add r6, sp, 0x18 + str r0, [sp, 0x18] + mov r5, r10 + adds r5, 0x1 + adds r0, r5, 0 + mov r1, r9 + bl sub_804954C + ldrh r1, [r0] + adds r0, r4, 0 + ands r0, r1 + str r0, [r6, 0x4] + adds r0, r5, 0 + ldr r1, [sp, 0x40] + bl sub_804954C + ldrh r1, [r0] + adds r0, r4, 0 + ands r0, r1 + str r0, [r6, 0x8] + ldr r0, [sp, 0x40] + subs r0, 0x1 + mov r8, r0 + adds r0, r5, 0 + mov r1, r8 + bl sub_804954C + ldrh r1, [r0] + adds r0, r4, 0 + ands r0, r1 + str r0, [r6, 0xC] + mov r0, r10 + mov r1, r8 + bl sub_804954C + ldrh r1, [r0] + adds r0, r4, 0 + ands r0, r1 + str r0, [r6, 0x10] + subs r5, 0x2 + adds r0, r5, 0 + mov r1, r8 + bl sub_804954C + ldrh r1, [r0] + adds r0, r4, 0 + ands r0, r1 + str r0, [r6, 0x14] + adds r0, r5, 0 + ldr r1, [sp, 0x40] + bl sub_804954C + ldrh r1, [r0] + adds r0, r4, 0 + ands r0, r1 + str r0, [r6, 0x18] + adds r0, r5, 0 + mov r1, r9 + bl sub_804954C + ldrh r0, [r0] + ands r4, r0 + str r4, [r6, 0x1C] + ldr r1, [sp, 0x18] + cmp r1, 0x1 + bne _08049C6A + ldr r0, [sp] + orrs r0, r1 + str r0, [sp] +_08049C6A: + ldr r0, [r6, 0x8] + cmp r0, 0x1 + bne _08049C78 + ldr r0, [sp] + movs r1, 0x4 + orrs r0, r1 + str r0, [sp] +_08049C78: + ldr r0, [r6, 0x10] + cmp r0, 0x1 + bne _08049C86 + ldr r0, [sp] + movs r1, 0x10 + orrs r0, r1 + str r0, [sp] +_08049C86: + ldr r0, [r6, 0x18] + cmp r0, 0x1 + bne _08049C94 + ldr r0, [sp] + movs r1, 0x40 + orrs r0, r1 + str r0, [sp] +_08049C94: + ldr r2, [sp, 0x18] + cmp r2, 0 + beq _08049CAE + ldr r0, [r6, 0x4] + cmp r0, 0x1 + bne _08049CAE + ldr r0, [r6, 0x8] + cmp r0, 0 + beq _08049CC8 + ldr r0, [sp] + movs r1, 0x2 + orrs r0, r1 + str r0, [sp] +_08049CAE: + ldr r0, [r6, 0x8] + cmp r0, 0 + beq _08049CC8 + ldr r0, [r6, 0xC] + cmp r0, 0x1 + bne _08049CC8 + ldr r0, [r6, 0x10] + cmp r0, 0 + beq _08049CE2 + ldr r0, [sp] + movs r1, 0x8 + orrs r0, r1 + str r0, [sp] +_08049CC8: + ldr r0, [r6, 0x10] + cmp r0, 0 + beq _08049CE2 + ldr r0, [r6, 0x14] + cmp r0, 0x1 + bne _08049CE2 + ldr r0, [r6, 0x18] + cmp r0, 0 + beq _08049CFA + ldr r0, [sp] + movs r1, 0x20 + orrs r0, r1 + str r0, [sp] +_08049CE2: + ldr r0, [r6, 0x18] + cmp r0, 0 + beq _08049CFA + ldr r0, [r6, 0x1C] + cmp r0, 0x1 + bne _08049CFA + cmp r2, 0 + beq _08049CFA + ldr r0, [sp] + movs r1, 0x80 + orrs r0, r1 + str r0, [sp] +_08049CFA: + add r4, sp, 0x38 + movs r7, 0x1 + adds r2, r4, 0 + adds r1, r6, 0 + movs r5, 0 + movs r3, 0x7 +_08049D06: + ldr r0, [r1] + subs r0, 0x1 + cmp r0, 0x1 + bhi _08049D12 + strb r7, [r2] + b _08049D14 +_08049D12: + strb r5, [r2] +_08049D14: + adds r2, 0x1 + adds r1, 0x4 + subs r3, 0x1 + cmp r3, 0 + bge _08049D06 + ldrb r0, [r4] + cmp r0, 0 + beq _08049D2C + ldr r0, [sp, 0x4] + movs r1, 0x1 + orrs r0, r1 + str r0, [sp, 0x4] +_08049D2C: + ldrb r0, [r4, 0x2] + cmp r0, 0 + beq _08049D3A + ldr r0, [sp, 0x4] + movs r1, 0x4 + orrs r0, r1 + str r0, [sp, 0x4] +_08049D3A: + ldrb r0, [r4, 0x4] + cmp r0, 0 + beq _08049D48 + ldr r0, [sp, 0x4] + movs r1, 0x10 + orrs r0, r1 + str r0, [sp, 0x4] +_08049D48: + ldrb r0, [r4, 0x6] + cmp r0, 0 + beq _08049D56 + ldr r0, [sp, 0x4] + movs r1, 0x40 + orrs r0, r1 + str r0, [sp, 0x4] +_08049D56: + ldr r2, [sp, 0x18] + cmp r2, 0 + beq _08049D70 + ldrb r0, [r4, 0x1] + cmp r0, 0 + beq _08049D70 + ldr r0, [r6, 0x8] + cmp r0, 0 + beq _08049D8A + ldr r0, [sp, 0x4] + movs r1, 0x2 + orrs r0, r1 + str r0, [sp, 0x4] +_08049D70: + ldr r0, [r6, 0x8] + cmp r0, 0 + beq _08049D8A + ldrb r0, [r4, 0x3] + cmp r0, 0 + beq _08049D8A + ldr r0, [r6, 0x10] + cmp r0, 0 + beq _08049DA4 + ldr r0, [sp, 0x4] + movs r1, 0x8 + orrs r0, r1 + str r0, [sp, 0x4] +_08049D8A: + ldr r0, [r6, 0x10] + cmp r0, 0 + beq _08049DA4 + ldrb r0, [r4, 0x5] + cmp r0, 0 + beq _08049DA4 + ldr r0, [r6, 0x18] + cmp r0, 0 + beq _08049DBC + ldr r0, [sp, 0x4] + movs r1, 0x20 + orrs r0, r1 + str r0, [sp, 0x4] +_08049DA4: + ldr r0, [r6, 0x18] + cmp r0, 0 + beq _08049DBC + ldrb r0, [r4, 0x7] + cmp r0, 0 + beq _08049DBC + cmp r2, 0 + beq _08049DC8 + ldr r0, [sp, 0x4] + movs r1, 0x80 + orrs r0, r1 + str r0, [sp, 0x4] +_08049DBC: + cmp r2, 0 + beq _08049DC8 + ldr r0, [sp, 0x8] + movs r1, 0x1 + orrs r0, r1 + str r0, [sp, 0x8] +_08049DC8: + ldr r0, [r6, 0x8] + cmp r0, 0 + beq _08049DD6 + ldr r0, [sp, 0x8] + movs r1, 0x4 + orrs r0, r1 + str r0, [sp, 0x8] +_08049DD6: + ldr r0, [r6, 0x10] + cmp r0, 0 + beq _08049DE4 + ldr r0, [sp, 0x8] + movs r1, 0x10 + orrs r0, r1 + str r0, [sp, 0x8] +_08049DE4: + ldr r0, [r6, 0x18] + cmp r0, 0 + beq _08049DF2 + ldr r0, [sp, 0x8] + movs r1, 0x40 + orrs r0, r1 + str r0, [sp, 0x8] +_08049DF2: + cmp r2, 0 + beq _08049E0A + ldr r0, [r6, 0x4] + cmp r0, 0 + beq _08049E0A + ldr r0, [r6, 0x8] + cmp r0, 0 + beq _08049E24 + ldr r0, [sp, 0x8] + movs r1, 0x2 + orrs r0, r1 + str r0, [sp, 0x8] +_08049E0A: + ldr r0, [r6, 0x8] + cmp r0, 0 + beq _08049E24 + ldr r0, [r6, 0xC] + cmp r0, 0 + beq _08049E24 + ldr r0, [r6, 0x10] + cmp r0, 0 + beq _08049E3E + ldr r0, [sp, 0x8] + movs r1, 0x8 + orrs r0, r1 + str r0, [sp, 0x8] +_08049E24: + ldr r0, [r6, 0x10] + cmp r0, 0 + beq _08049E3E + ldr r0, [r6, 0x14] + cmp r0, 0 + beq _08049E3E + ldr r0, [r6, 0x18] + cmp r0, 0 + beq _08049E56 + ldr r0, [sp, 0x8] + movs r1, 0x20 + orrs r0, r1 + str r0, [sp, 0x8] +_08049E3E: + ldr r0, [r6, 0x18] + cmp r0, 0 + beq _08049E56 + ldr r0, [r6, 0x1C] + cmp r0, 0 + beq _08049E56 + cmp r2, 0 + beq _08049E56 + ldr r0, [sp, 0x8] + movs r1, 0x80 + orrs r0, r1 + str r0, [sp, 0x8] +_08049E56: + movs r0, 0xFF + str r0, [sp, 0xC] + mov r0, r10 + cmp r0, 0x1 + bgt _08049E64 + movs r0, 0x1F + str r0, [sp, 0xC] +_08049E64: + ldr r0, [sp, 0x40] + cmp r0, 0x1 + bgt _08049E74 + ldr r0, [sp, 0xC] + movs r1, 0x39 + negs r1, r1 + ands r0, r1 + str r0, [sp, 0xC] +_08049E74: + mov r0, r10 + cmp r0, 0x35 + ble _08049E84 + ldr r0, [sp, 0xC] + movs r1, 0xF + negs r1, r1 + ands r0, r1 + str r0, [sp, 0xC] +_08049E84: + ldr r0, [sp, 0x40] + cmp r0, 0x1D + ble _08049E94 + ldr r0, [sp, 0xC] + movs r1, 0x84 + negs r1, r1 + ands r0, r1 + str r0, [sp, 0xC] +_08049E94: + mov r0, r10 + ldr r1, [sp, 0x40] + bl sub_8049590 + ldr r1, [sp] + strb r1, [r0, 0xA] + mov r0, r10 + ldr r1, [sp, 0x40] + bl sub_8049590 + ldr r1, [sp, 0x4] + strb r1, [r0, 0xB] + mov r0, r10 + ldr r1, [sp, 0x40] + bl sub_8049590 + ldr r1, [sp, 0x8] + strb r1, [r0, 0xC] + mov r0, r10 + ldr r1, [sp, 0x40] + bl sub_8049590 + ldr r1, [sp, 0xC] + strb r1, [r0, 0xD] + add sp, 0x44 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8049BB0 + + thumb_func_start sub_8049ED4 +sub_8049ED4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x38 + ldr r0, _08049F78 + ldr r6, [r0] + ldr r1, _08049F7C + adds r0, r6, r1 + ldrb r0, [r0] + str r0, [sp] + ldr r2, _08049F80 + adds r0, r6, r2 + ldrb r0, [r0] + str r0, [sp, 0x4] + ldr r4, _08049F84 + adds r0, r6, r4 + ldrh r0, [r0] + lsls r0, 16 + asrs r3, r0, 19 + ldr r1, _08049F88 + adds r0, r3, 0 + adds r0, 0x1E + lsls r0, 1 + adds r1, r0, r1 + movs r4, 0 + ldrsh r2, [r1, r4] + mov r10, r2 + ldr r1, _08049F8C + adds r0, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + str r1, [sp, 0x10] + movs r4, 0 + str r4, [sp, 0x8] +_08049F1C: + ldr r1, _08049F90 + adds r0, r6, r1 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 19 + subs r2, r0, 0x1 + mov r9, r2 + movs r1, 0x1F + ands r3, r1 + ldr r1, _08049F88 + adds r0, 0x1D + lsls r0, 1 + adds r1, r0, r1 + movs r2, 0 + ldrsh r4, [r1, r2] + mov r8, r4 + ldr r1, _08049F8C + adds r0, r1 + movs r1, 0 + ldrsh r4, [r0, r1] + str r4, [sp, 0x14] + mov r2, r8 + lsls r0, r2, 1 + add r0, r8 + mov r4, r10 + adds r7, r4, r0 + ldr r0, [sp, 0x10] + ldr r1, [sp, 0x14] + str r3, [sp, 0x34] + bl sub_804954C + adds r5, r0, 0 + ldrh r2, [r5] + movs r1, 0x80 + lsls r1, 5 + adds r0, r1, 0 + ands r0, r2 + ldr r3, [sp, 0x34] + cmp r0, 0 + beq _08049F98 + lsls r0, r7, 1 + ldr r2, _08049F94 + adds r0, r2 + adds r2, r6, r0 + b _0804A06A + .align 2, 0 +_08049F78: .4byte gUnknown_203B418 +_08049F7C: .4byte 0x00018210 +_08049F80: .4byte 0x0001820f +_08049F84: .4byte 0x000181f0 +_08049F88: .4byte gUnknown_80F6A4A +_08049F8C: .4byte gUnknown_80F6C06 +_08049F90: .4byte 0x000181f2 +_08049F94: .4byte 0x00012bec +_08049F98: + movs r0, 0x20 + ands r0, r2 + cmp r0, 0 + beq _08049FAC + lsls r0, r7, 1 + ldr r4, _08049FA8 + b _08049FD2 + .align 2, 0 +_08049FA8: .4byte 0x00012bda +_08049FAC: + ldr r0, [sp] + cmp r0, 0 + beq _08049FC4 + ldrb r0, [r5, 0x8] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 1 + ldr r2, _08049FC0 + adds r1, r2 + b _0804A064 + .align 2, 0 +_08049FC0: .4byte 0x00011884 +_08049FC4: + ldrh r1, [r5, 0x4] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08049FDC + lsls r0, r7, 1 + ldr r4, _08049FD8 +_08049FD2: + adds r0, r4 + adds r2, r6, r0 + b _0804A06A + .align 2, 0 +_08049FD8: .4byte 0x00012bfe +_08049FDC: + ldr r4, [r5, 0x14] + cmp r4, 0 + beq _0804A028 + adds r0, r4, 0 + str r3, [sp, 0x34] + bl sub_80450F8 + ldr r3, [sp, 0x34] + cmp r0, 0x2 + bne _0804A014 + adds r0, r4, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0 + bne _0804A000 + ldr r0, [sp, 0x4] + cmp r0, 0 + beq _0804A014 +_0804A000: + ldr r0, [r4, 0x70] + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 1 + ldr r1, _0804A010 + adds r0, r1 + b _0804A046 + .align 2, 0 +_0804A010: .4byte 0x00012a18 +_0804A014: + ldrb r0, [r5, 0x8] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 1 + ldr r2, _0804A024 + adds r1, r2 + b _0804A064 + .align 2, 0 +_0804A024: .4byte 0x00011884 +_0804A028: + movs r4, 0x80 + lsls r4, 2 + adds r0, r4, 0 + ands r0, r2 + cmp r0, 0 + beq _0804A058 + ldr r1, _0804A050 + adds r0, r6, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 1 + ldr r4, _0804A054 + adds r0, r4 +_0804A046: + adds r0, r6, r0 + lsls r1, r7, 1 + adds r2, r0, r1 + b _0804A06A + .align 2, 0 +_0804A050: .4byte 0x00003a12 +_0804A054: .4byte 0x00012a18 +_0804A058: + ldrb r0, [r5, 0x8] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 1 + ldr r0, _0804A0E8 + adds r1, r0 +_0804A064: + adds r1, r6, r1 + lsls r0, r7, 1 + adds r2, r1, r0 +_0804A06A: + lsls r1, r3, 1 + str r1, [sp, 0x30] + adds r3, 0x1 + str r3, [sp, 0x2C] + mov r4, r10 + adds r4, 0x1 + str r4, [sp, 0x28] + ldr r0, [sp, 0x8] + adds r0, 0x1 + str r0, [sp, 0x24] + mov r1, r10 + lsls r3, r1, 1 + ldr r4, _0804A0EC + adds r4, r3, r4 + str r4, [sp, 0x18] + ldr r0, _0804A0F0 + adds r0, r3, r0 + str r0, [sp, 0x1C] + ldr r1, _0804A0F4 + adds r1, r3, r1 + str r1, [sp, 0x20] + movs r4, 0x16 + str r4, [sp, 0xC] +_0804A098: + movs r0, 0x1F + mov r1, r9 + ands r1, r0 + mov r9, r1 + lsls r0, r1, 6 + ldr r4, [sp, 0x30] + adds r0, r4, r0 + ldr r1, _0804A0F8 + adds r0, r1 + ldrh r1, [r2] + strh r1, [r0] + adds r2, 0x6 + movs r4, 0x1 + add r9, r4 + add r8, r4 + mov r0, r8 + cmp r0, 0x3 + bne _0804A1AC + movs r1, 0 + mov r8, r1 + ldr r2, [sp, 0x14] + adds r2, 0x1 + str r2, [sp, 0x14] + mov r7, r10 + ldr r0, [sp, 0x10] + adds r1, r2, 0 + str r3, [sp, 0x34] + bl sub_804954C + adds r5, r0, 0 + ldrh r2, [r5] + movs r0, 0x20 + ands r0, r2 + ldr r3, [sp, 0x34] + cmp r0, 0 + beq _0804A0FC + ldr r4, [sp, 0x18] + adds r2, r6, r4 + b _0804A1AC + .align 2, 0 +_0804A0E8: .4byte 0x00011884 +_0804A0EC: .4byte 0x00012bda +_0804A0F0: .4byte 0x00012bec +_0804A0F4: .4byte 0x00012bfe +_0804A0F8: .4byte gUnknown_202C838 +_0804A0FC: + movs r1, 0x80 + lsls r1, 5 + adds r0, r1, 0 + ands r0, r2 + cmp r0, 0 + beq _0804A10E + ldr r4, [sp, 0x1C] + adds r2, r6, r4 + b _0804A1AC +_0804A10E: + ldr r0, [sp] + cmp r0, 0 + bne _0804A19C + ldrh r1, [r5, 0x4] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0804A124 + ldr r4, [sp, 0x20] + adds r2, r6, r4 + b _0804A1AC +_0804A124: + ldr r4, [r5, 0x14] + cmp r4, 0 + beq _0804A174 + adds r0, r4, 0 + str r3, [sp, 0x34] + bl sub_80450F8 + ldr r3, [sp, 0x34] + cmp r0, 0x2 + bne _0804A15C + adds r0, r4, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0 + bne _0804A148 + ldr r0, [sp, 0x4] + cmp r0, 0 + beq _0804A15C +_0804A148: + ldr r0, [r4, 0x70] + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 1 + ldr r1, _0804A158 + b _0804A1A6 + .align 2, 0 +_0804A158: .4byte 0x00012a18 +_0804A15C: + ldrb r0, [r5, 0x8] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 1 + ldr r2, _0804A170 + adds r1, r2 + adds r1, r6, r1 + lsls r0, r7, 1 + adds r2, r1, r0 + b _0804A1AC + .align 2, 0 +_0804A170: .4byte 0x00011884 +_0804A174: + movs r4, 0x80 + lsls r4, 2 + adds r0, r4, 0 + ands r0, r2 + cmp r0, 0 + beq _0804A19C + ldr r1, _0804A194 + adds r0, r6, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 1 + ldr r4, _0804A198 + adds r0, r4 + b _0804A1A8 + .align 2, 0 +_0804A194: .4byte 0x00003a12 +_0804A198: .4byte 0x00012a18 +_0804A19C: + ldrb r1, [r5, 0x8] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 1 + ldr r1, _0804A1EC +_0804A1A6: + adds r0, r1 +_0804A1A8: + adds r0, r6, r0 + adds r2, r0, r3 +_0804A1AC: + ldr r4, [sp, 0xC] + subs r4, 0x1 + str r4, [sp, 0xC] + cmp r4, 0 + blt _0804A1B8 + b _0804A098 +_0804A1B8: + ldr r3, [sp, 0x2C] + ldr r0, [sp, 0x28] + mov r10, r0 + cmp r0, 0x3 + bne _0804A1CC + movs r1, 0 + mov r10, r1 + ldr r2, [sp, 0x10] + adds r2, 0x1 + str r2, [sp, 0x10] +_0804A1CC: + ldr r4, [sp, 0x24] + str r4, [sp, 0x8] + cmp r4, 0x1E + bgt _0804A1D6 + b _08049F1C +_0804A1D6: + movs r0, 0x3 + bl sub_80098F8 + add sp, 0x38 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804A1EC: .4byte 0x00011884 + thumb_func_end sub_8049ED4 + + thumb_func_start sub_804A1F0 +sub_804A1F0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + ldr r2, _0804A284 + ldr r7, [r2] + ldr r3, _0804A288 + adds r2, r7, r3 + ldrb r2, [r2] + str r2, [sp] + ldr r4, _0804A28C + adds r2, r7, r4 + ldrb r2, [r2] + str r2, [sp, 0x4] + ldr r5, _0804A290 + adds r2, r7, r5 + movs r3, 0 + ldrsh r2, [r2, r3] + adds r2, r0 + subs r4, 0x1D + adds r0, r7, r4 + movs r5, 0 + ldrsh r0, [r0, r5] + adds r0, r1 + asrs r0, 3 + asrs r2, 3 + str r2, [sp, 0x14] + subs r1, r0, 0x1 + mov r9, r1 + ldr r3, _0804A294 + adds r1, r2, 0 + adds r1, 0x1E + lsls r1, 1 + adds r2, r1, r3 + movs r5, 0 + ldrsh r4, [r2, r5] + str r4, [sp, 0x10] + ldr r2, _0804A298 + adds r1, r2 + movs r5, 0 + ldrsh r4, [r1, r5] + str r4, [sp, 0xC] + adds r0, 0x1D + lsls r0, 1 + adds r3, r0, r3 + movs r4, 0 + ldrsh r1, [r3, r4] + mov r8, r1 + adds r0, r2 + movs r1, 0 + ldrsh r5, [r0, r1] + mov r10, r5 + mov r2, r8 + lsls r0, r2, 1 + add r0, r8 + ldr r3, [sp, 0x10] + adds r6, r3, r0 + ldr r0, [sp, 0xC] + mov r1, r10 + bl sub_804954C + adds r5, r0, 0 + ldrh r1, [r5] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0804A2A0 + lsls r0, r6, 1 + ldr r4, _0804A29C + adds r0, r4 + adds r2, r7, r0 + b _0804A356 + .align 2, 0 +_0804A284: .4byte gUnknown_203B418 +_0804A288: .4byte 0x00018210 +_0804A28C: .4byte 0x0001820f +_0804A290: .4byte 0x000181f0 +_0804A294: .4byte gUnknown_80F6A4A +_0804A298: .4byte gUnknown_80F6C06 +_0804A29C: .4byte 0x00012bda +_0804A2A0: + movs r0, 0x80 + lsls r0, 5 + ands r0, r1 + cmp r0, 0 + beq _0804A2B8 + lsls r0, r6, 1 + ldr r5, _0804A2B4 + adds r0, r5 + adds r2, r7, r0 + b _0804A356 + .align 2, 0 +_0804A2B4: .4byte 0x00012bec +_0804A2B8: + ldr r0, [sp] + cmp r0, 0 + beq _0804A2D0 + ldrb r0, [r5, 0x8] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 1 + ldr r2, _0804A2CC + adds r1, r2 + b _0804A350 + .align 2, 0 +_0804A2CC: .4byte 0x00011884 +_0804A2D0: + ldr r4, [r5, 0x14] + cmp r4, 0 + beq _0804A318 + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0x2 + bne _0804A304 + adds r0, r4, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0 + bne _0804A2F0 + ldr r3, [sp, 0x4] + cmp r3, 0 + beq _0804A304 +_0804A2F0: + ldr r0, [r4, 0x70] + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 1 + ldr r4, _0804A300 + adds r0, r4 + b _0804A334 + .align 2, 0 +_0804A300: .4byte 0x00012a18 +_0804A304: + ldrb r0, [r5, 0x8] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 1 + ldr r5, _0804A314 + adds r1, r5 + b _0804A350 + .align 2, 0 +_0804A314: .4byte 0x00011884 +_0804A318: + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + cmp r0, 0 + beq _0804A344 + ldr r1, _0804A33C + adds r0, r7, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 1 + ldr r3, _0804A340 + adds r0, r3 +_0804A334: + adds r0, r7, r0 + lsls r1, r6, 1 + adds r2, r0, r1 + b _0804A356 + .align 2, 0 +_0804A33C: .4byte 0x00003a12 +_0804A340: .4byte 0x00012a18 +_0804A344: + ldrb r0, [r5, 0x8] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 1 + ldr r4, _0804A3AC + adds r1, r4 +_0804A350: + adds r1, r7, r1 + lsls r0, r6, 1 + adds r2, r1, r0 +_0804A356: + movs r5, 0x16 + str r5, [sp, 0x8] +_0804A35A: + movs r0, 0x1F + ldr r1, [sp, 0x14] + ands r1, r0 + str r1, [sp, 0x14] + mov r3, r9 + ands r3, r0 + mov r9, r3 + lsls r1, 1 + lsls r0, r3, 6 + adds r1, r0 + ldr r4, _0804A3B0 + adds r1, r4 + ldrh r0, [r2] + strh r0, [r1] + adds r2, 0x6 + movs r5, 0x1 + add r9, r5 + add r8, r5 + mov r0, r8 + cmp r0, 0x3 + beq _0804A386 + b _0804A476 +_0804A386: + movs r1, 0 + mov r8, r1 + add r10, r5 + ldr r6, [sp, 0x10] + ldr r0, [sp, 0xC] + mov r1, r10 + bl sub_804954C + adds r5, r0, 0 + ldrh r1, [r5] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0804A3B8 + lsls r0, r6, 1 + ldr r2, _0804A3B4 + adds r0, r2 + adds r2, r7, r0 + b _0804A476 + .align 2, 0 +_0804A3AC: .4byte 0x00011884 +_0804A3B0: .4byte gUnknown_202C838 +_0804A3B4: .4byte 0x00012bda +_0804A3B8: + movs r3, 0x80 + lsls r3, 5 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _0804A3D4 + lsls r0, r6, 1 + ldr r4, _0804A3D0 + adds r0, r4 + adds r2, r7, r0 + b _0804A476 + .align 2, 0 +_0804A3D0: .4byte 0x00012bec +_0804A3D4: + ldr r0, [sp] + cmp r0, 0 + beq _0804A3EC + ldrb r0, [r5, 0x8] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 1 + ldr r2, _0804A3E8 + adds r1, r2 + b _0804A470 + .align 2, 0 +_0804A3E8: .4byte 0x00011884 +_0804A3EC: + ldr r4, [r5, 0x14] + cmp r4, 0 + beq _0804A434 + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0x2 + bne _0804A420 + adds r0, r4, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0 + bne _0804A40C + ldr r3, [sp, 0x4] + cmp r3, 0 + beq _0804A420 +_0804A40C: + ldr r0, [r4, 0x70] + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 1 + ldr r4, _0804A41C + adds r0, r4 + b _0804A452 + .align 2, 0 +_0804A41C: .4byte 0x00012a18 +_0804A420: + ldrb r0, [r5, 0x8] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 1 + ldr r5, _0804A430 + adds r1, r5 + b _0804A470 + .align 2, 0 +_0804A430: .4byte 0x00011884 +_0804A434: + movs r2, 0x80 + lsls r2, 2 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _0804A464 + ldr r3, _0804A45C + adds r0, r7, r3 + movs r4, 0 + ldrsh r1, [r0, r4] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 1 + ldr r5, _0804A460 + adds r0, r5 +_0804A452: + adds r0, r7, r0 + lsls r1, r6, 1 + adds r2, r0, r1 + b _0804A476 + .align 2, 0 +_0804A45C: .4byte 0x00003a12 +_0804A460: .4byte 0x00012a18 +_0804A464: + ldrb r0, [r5, 0x8] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 1 + ldr r0, _0804A498 + adds r1, r0 +_0804A470: + adds r1, r7, r1 + lsls r0, r6, 1 + adds r2, r1, r0 +_0804A476: + ldr r1, [sp, 0x8] + subs r1, 0x1 + str r1, [sp, 0x8] + cmp r1, 0 + blt _0804A482 + b _0804A35A +_0804A482: + movs r0, 0x3 + bl sub_80098F8 + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804A498: .4byte 0x00011884 + thumb_func_end sub_804A1F0 + + thumb_func_start sub_804A49C +sub_804A49C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + ldr r2, _0804A52C + ldr r7, [r2] + ldr r3, _0804A530 + adds r2, r7, r3 + ldrb r2, [r2] + str r2, [sp] + ldr r4, _0804A534 + adds r2, r7, r4 + ldrb r2, [r2] + str r2, [sp, 0x4] + subs r3, 0x20 + adds r2, r7, r3 + movs r4, 0 + ldrsh r2, [r2, r4] + adds r2, r0 + adds r3, 0x2 + adds r0, r7, r3 + movs r4, 0 + ldrsh r0, [r0, r4] + adds r0, r1 + asrs r2, 3 + mov r8, r2 + asrs r0, 3 + str r0, [sp, 0x14] + ldr r2, _0804A538 + mov r0, r8 + adds r0, 0x1E + lsls r0, 1 + adds r1, r0, r2 + movs r4, 0 + ldrsh r3, [r1, r4] + mov r9, r3 + ldr r1, _0804A53C + adds r0, r1 + movs r4, 0 + ldrsh r3, [r0, r4] + mov r10, r3 + ldr r0, [sp, 0x14] + adds r0, 0x1E + lsls r0, 1 + adds r2, r0, r2 + movs r4, 0 + ldrsh r3, [r2, r4] + str r3, [sp, 0x10] + adds r0, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + str r1, [sp, 0xC] + lsls r0, r3, 1 + adds r0, r3 + mov r3, r9 + adds r6, r3, r0 + mov r0, r10 + bl sub_804954C + adds r5, r0, 0 + ldrh r1, [r5] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0804A544 + lsls r0, r6, 1 + ldr r4, _0804A540 + adds r0, r4 + adds r2, r7, r0 + b _0804A5DA + .align 2, 0 +_0804A52C: .4byte gUnknown_203B418 +_0804A530: .4byte 0x00018210 +_0804A534: .4byte 0x0001820f +_0804A538: .4byte gUnknown_80F6A4A +_0804A53C: .4byte gUnknown_80F6C06 +_0804A540: .4byte 0x00012bda +_0804A544: + movs r0, 0x80 + lsls r0, 5 + ands r0, r1 + cmp r0, 0 + beq _0804A55C + lsls r0, r6, 1 + ldr r1, _0804A558 + adds r0, r1 + adds r2, r7, r0 + b _0804A5DA + .align 2, 0 +_0804A558: .4byte 0x00012bec +_0804A55C: + ldr r2, [sp] + cmp r2, 0 + beq _0804A574 + ldrb r0, [r5, 0x8] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 1 + ldr r3, _0804A570 + adds r1, r3 + b _0804A5D4 + .align 2, 0 +_0804A570: .4byte 0x00011884 +_0804A574: + ldr r4, [r5, 0x14] + cmp r4, 0 + beq _0804A59A + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0x2 + bne _0804A5C8 + adds r0, r4, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0 + bne _0804A594 + ldr r0, [sp, 0x4] + cmp r0, 0 + beq _0804A5C8 +_0804A594: + ldr r0, [r4, 0x70] + ldrb r1, [r0] + b _0804A5AC +_0804A59A: + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + cmp r0, 0 + beq _0804A5C8 + ldr r3, _0804A5C0 + adds r0, r7, r3 + movs r4, 0 + ldrsh r1, [r0, r4] +_0804A5AC: + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 1 + ldr r1, _0804A5C4 + adds r0, r1 + adds r0, r7, r0 + lsls r1, r6, 1 + adds r2, r0, r1 + b _0804A5DA + .align 2, 0 +_0804A5C0: .4byte 0x00003a12 +_0804A5C4: .4byte 0x00012a18 +_0804A5C8: + ldrb r0, [r5, 0x8] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 1 + ldr r2, _0804A638 + adds r1, r2 +_0804A5D4: + adds r1, r7, r1 + lsls r0, r6, 1 + adds r2, r1, r0 +_0804A5DA: + movs r3, 0x1E + str r3, [sp, 0x8] +_0804A5DE: + movs r0, 0x1F + mov r4, r8 + ands r4, r0 + mov r8, r4 + ldr r1, [sp, 0x14] + ands r1, r0 + str r1, [sp, 0x14] + lsls r1, r4, 1 + ldr r3, [sp, 0x14] + lsls r0, r3, 6 + adds r1, r0 + ldr r4, _0804A63C + adds r1, r4 + ldrh r0, [r2] + strh r0, [r1] + adds r2, 0x2 + movs r0, 0x1 + add r8, r0 + add r9, r0 + mov r1, r9 + cmp r1, 0x3 + beq _0804A60C + b _0804A702 +_0804A60C: + movs r2, 0 + mov r9, r2 + add r10, r0 + ldr r3, [sp, 0x10] + lsls r0, r3, 1 + adds r6, r0, r3 + mov r0, r10 + ldr r1, [sp, 0xC] + bl sub_804954C + adds r5, r0, 0 + ldrh r1, [r5] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0804A644 + lsls r0, r6, 1 + ldr r4, _0804A640 + adds r0, r4 + adds r2, r7, r0 + b _0804A702 + .align 2, 0 +_0804A638: .4byte 0x00011884 +_0804A63C: .4byte gUnknown_202C838 +_0804A640: .4byte 0x00012bda +_0804A644: + movs r2, 0x80 + lsls r2, 5 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _0804A660 + lsls r0, r6, 1 + ldr r3, _0804A65C + adds r0, r3 + adds r2, r7, r0 + b _0804A702 + .align 2, 0 +_0804A65C: .4byte 0x00012bec +_0804A660: + ldr r4, [sp] + cmp r4, 0 + beq _0804A678 + ldrb r0, [r5, 0x8] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 1 + ldr r0, _0804A674 + adds r1, r0 + b _0804A6FC + .align 2, 0 +_0804A674: .4byte 0x00011884 +_0804A678: + ldr r4, [r5, 0x14] + cmp r4, 0 + beq _0804A6C0 + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0x2 + bne _0804A6AC + adds r0, r4, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0 + bne _0804A698 + ldr r1, [sp, 0x4] + cmp r1, 0 + beq _0804A6AC +_0804A698: + ldr r0, [r4, 0x70] + ldrb r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 1 + ldr r2, _0804A6A8 + adds r0, r2 + b _0804A6DE + .align 2, 0 +_0804A6A8: .4byte 0x00012a18 +_0804A6AC: + ldrb r0, [r5, 0x8] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 1 + ldr r3, _0804A6BC + adds r1, r3 + b _0804A6FC + .align 2, 0 +_0804A6BC: .4byte 0x00011884 +_0804A6C0: + movs r4, 0x80 + lsls r4, 2 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _0804A6F0 + ldr r1, _0804A6E8 + adds r0, r7, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 1 + ldr r3, _0804A6EC + adds r0, r3 +_0804A6DE: + adds r0, r7, r0 + lsls r1, r6, 1 + adds r2, r0, r1 + b _0804A702 + .align 2, 0 +_0804A6E8: .4byte 0x00003a12 +_0804A6EC: .4byte 0x00012a18 +_0804A6F0: + ldrb r0, [r5, 0x8] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 1 + ldr r4, _0804A724 + adds r1, r4 +_0804A6FC: + adds r1, r7, r1 + lsls r0, r6, 1 + adds r2, r1, r0 +_0804A702: + ldr r0, [sp, 0x8] + subs r0, 0x1 + str r0, [sp, 0x8] + cmp r0, 0 + blt _0804A70E + b _0804A5DE +_0804A70E: + movs r0, 0x3 + bl sub_80098F8 + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804A724: .4byte 0x00011884 + thumb_func_end sub_804A49C + + thumb_func_start sub_804A728 +sub_804A728: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x40 + str r0, [sp, 0x1C] + adds r5, r1, 0 + adds r4, r3, 0 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x20] + lsls r4, 24 + lsrs r4, 24 + ldr r6, _0804A814 + ldr r0, [r6] + mov r8, r0 + bl sub_8083600 + str r0, [sp, 0x24] + ldr r0, _0804A818 + add r0, r8 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 19 + str r0, [sp, 0x30] + adds r1, r0, 0 + ldr r0, [r6] + ldr r2, _0804A81C + adds r0, r2 + strb r4, [r0] + ldr r3, [sp, 0x1C] + movs r4, 0 + ldrsh r7, [r3, r4] + movs r0, 0x2 + ldrsh r6, [r3, r0] + ldr r0, _0804A820 + lsls r5, 2 + adds r5, r0 + movs r2, 0 + ldrsh r4, [r5, r2] + movs r0, 0x2 + ldrsh r3, [r5, r0] + mov r0, sp + movs r2, 0x5 +_0804A782: + strh r7, [r0] + strh r6, [r0, 0x2] + adds r7, r4 + adds r6, r3 + adds r0, 0x4 + subs r2, 0x1 + cmp r2, 0 + bge _0804A782 + ldr r0, _0804A824 + adds r1, 0x1E + lsls r1, 1 + adds r0, r1, r0 + movs r3, 0 + ldrsh r2, [r0, r3] + str r2, [sp, 0x28] + ldr r0, _0804A828 + adds r1, r0 + movs r0, 0 + ldrsh r4, [r1, r0] + mov r10, r4 + movs r7, 0 +_0804A7AC: + ldr r0, _0804A82C + add r0, r8 + ldrh r0, [r0] + lsls r0, 16 + asrs r0, 19 + str r0, [sp, 0x34] + ldr r0, _0804A824 + ldr r1, [sp, 0x34] + adds r1, 0x1E + lsls r1, 1 + adds r0, r1, r0 + movs r3, 0 + ldrsh r2, [r0, r3] + str r2, [sp, 0x2C] + ldr r0, _0804A828 + adds r1, r0 + movs r0, 0 + ldrsh r4, [r1, r0] + mov r9, r4 + lsls r0, r2, 1 + adds r0, r2 + ldr r1, [sp, 0x28] + adds r5, r1, r0 + mov r2, r10 + lsls r0, r2, 16 + lsls r1, r4, 16 + lsrs r0, 16 + orrs r0, r1 + str r0, [sp, 0x18] + ldr r3, [sp, 0x20] + cmp r3, 0 + beq _0804A850 + ldr r4, [sp, 0x1C] + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r10, r0 + bne _0804A834 + movs r2, 0x2 + ldrsh r0, [r4, r2] + cmp r9, r0 + bne _0804A834 + lsls r0, r5, 1 + ldr r3, _0804A830 + adds r0, r3 + mov r4, r8 + adds r2, r4, r0 + ldr r0, [sp, 0x28] + adds r0, 0x1 + str r0, [sp, 0x3C] + adds r1, r7, 0x1 + str r1, [sp, 0x38] + b _0804A8FC + .align 2, 0 +_0804A814: .4byte gUnknown_203B418 +_0804A818: .4byte 0x000181f0 +_0804A81C: .4byte 0x0001821a +_0804A820: .4byte gUnknown_80F4448 +_0804A824: .4byte gUnknown_80F6A4A +_0804A828: .4byte gUnknown_80F6C06 +_0804A82C: .4byte 0x000181f2 +_0804A830: .4byte 0x00012b92 +_0804A834: + lsls r0, r5, 1 + ldr r2, _0804A84C + adds r0, r2 + mov r3, r8 + adds r2, r3, r0 + ldr r4, [sp, 0x28] + adds r4, 0x1 + str r4, [sp, 0x3C] + adds r0, r7, 0x1 + str r0, [sp, 0x38] + b _0804A8FC + .align 2, 0 +_0804A84C: .4byte 0x00013554 +_0804A850: + add r4, sp, 0x18 + ldr r0, [sp, 0x24] + adds r1, r4, 0 + bl sub_807049C + lsls r0, 24 + cmp r0, 0 + bne _0804A8E8 + ldr r0, [sp, 0x24] + adds r1, r4, 0 + bl sub_8045AAC + lsls r0, 24 + cmp r0, 0 + beq _0804A8E8 + movs r2, 0 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + lsls r3, r5, 1 + ldr r4, [sp, 0x28] + adds r4, 0x1 + str r4, [sp, 0x3C] + adds r1, r7, 0x1 + str r1, [sp, 0x38] + cmp r0, r10 + bne _0804A890 + mov r0, sp + movs r4, 0x2 + ldrsh r0, [r0, r4] + cmp r0, r9 + beq _0804A8AC +_0804A890: + adds r2, 0x1 + cmp r2, 0x5 + bgt _0804A8AC + lsls r0, r2, 2 + mov r4, sp + adds r1, r4, r0 + movs r4, 0 + ldrsh r0, [r1, r4] + cmp r0, r10 + bne _0804A890 + movs r4, 0x2 + ldrsh r0, [r1, r4] + cmp r0, r9 + bne _0804A890 +_0804A8AC: + cmp r2, 0x6 + bne _0804A8D8 + ldr r0, _0804A8C0 + ldr r0, [r0] + ldrb r0, [r0, 0x3] + cmp r0, 0 + beq _0804A8C8 + ldr r1, _0804A8C4 + adds r0, r3, r1 + b _0804A8DC + .align 2, 0 +_0804A8C0: .4byte gUnknown_203B46C +_0804A8C4: .4byte 0x00012b80 +_0804A8C8: + ldr r4, _0804A8D4 + adds r0, r3, r4 + mov r1, r8 + adds r2, r1, r0 + b _0804A8FC + .align 2, 0 +_0804A8D4: .4byte 0x00013554 +_0804A8D8: + ldr r2, _0804A8E4 + adds r0, r3, r2 +_0804A8DC: + mov r3, r8 + adds r2, r3, r0 + b _0804A8FC + .align 2, 0 +_0804A8E4: .4byte 0x00012b92 +_0804A8E8: + lsls r0, r5, 1 + ldr r4, _0804A968 + adds r0, r4 + mov r1, r8 + adds r2, r1, r0 + ldr r3, [sp, 0x28] + adds r3, 0x1 + str r3, [sp, 0x3C] + adds r4, r7, 0x1 + str r4, [sp, 0x38] +_0804A8FC: + movs r6, 0 +_0804A8FE: + movs r0, 0x1F + ldr r1, [sp, 0x30] + ands r1, r0 + str r1, [sp, 0x30] + ldr r3, [sp, 0x34] + ands r3, r0 + lsls r0, r1, 1 + lsls r1, r3, 6 + adds r0, r1 + ldr r4, _0804A96C + adds r0, r4 + ldrh r1, [r2] + strh r1, [r0] + adds r2, 0x6 + adds r3, 0x1 + str r3, [sp, 0x34] + ldr r0, [sp, 0x2C] + adds r0, 0x1 + str r0, [sp, 0x2C] + adds r7, r6, 0x1 + cmp r0, 0x3 + beq _0804A92C + b _0804AA20 +_0804A92C: + movs r1, 0 + str r1, [sp, 0x2C] + movs r2, 0x1 + add r9, r2 + ldr r5, [sp, 0x28] + add r4, sp, 0x18 + mov r3, r10 + strh r3, [r4] + adds r0, r4, 0 + mov r1, r9 + strh r1, [r0, 0x2] + ldr r2, [sp, 0x20] + cmp r2, 0 + beq _0804A984 + ldr r3, [sp, 0x1C] + movs r4, 0 + ldrsh r0, [r3, r4] + cmp r10, r0 + bne _0804A974 + movs r1, 0x2 + ldrsh r0, [r3, r1] + cmp r9, r0 + bne _0804A974 + ldr r2, [sp, 0x28] + lsls r0, r2, 1 + ldr r3, _0804A970 + adds r0, r3 + mov r4, r8 + adds r2, r4, r0 + b _0804AA20 + .align 2, 0 +_0804A968: .4byte 0x00013554 +_0804A96C: .4byte gUnknown_202C038 +_0804A970: .4byte 0x00012b92 +_0804A974: + lsls r0, r5, 1 + ldr r1, _0804A980 + adds r0, r1 + mov r3, r8 + adds r2, r3, r0 + b _0804AA1E + .align 2, 0 +_0804A980: .4byte 0x00013554 +_0804A984: + ldr r0, [sp, 0x24] + adds r1, r4, 0 + bl sub_807049C + lsls r0, 24 + cmp r0, 0 + bne _0804AA14 + ldr r0, [sp, 0x24] + adds r1, r4, 0 + bl sub_8045AAC + lsls r0, 24 + cmp r0, 0 + beq _0804AA14 + movs r2, 0 + mov r0, sp + movs r4, 0 + ldrsh r0, [r0, r4] + ldr r1, [sp, 0x28] + lsls r3, r1, 1 + cmp r0, r10 + bne _0804A9BA + mov r0, sp + movs r4, 0x2 + ldrsh r0, [r0, r4] + cmp r0, r9 + beq _0804A9D6 +_0804A9BA: + adds r2, 0x1 + cmp r2, 0x5 + bgt _0804A9D6 + lsls r0, r2, 2 + mov r4, sp + adds r1, r4, r0 + movs r4, 0 + ldrsh r0, [r1, r4] + cmp r0, r10 + bne _0804A9BA + movs r4, 0x2 + ldrsh r0, [r1, r4] + cmp r0, r9 + bne _0804A9BA +_0804A9D6: + cmp r2, 0x6 + bne _0804AA04 + ldr r0, _0804A9EC + ldr r0, [r0] + ldrb r0, [r0, 0x3] + cmp r0, 0 + beq _0804A9F4 + ldr r1, _0804A9F0 + adds r0, r3, r1 + b _0804AA08 + .align 2, 0 +_0804A9EC: .4byte gUnknown_203B46C +_0804A9F0: .4byte 0x00012b80 +_0804A9F4: + ldr r4, _0804AA00 + adds r0, r3, r4 + mov r1, r8 + adds r2, r1, r0 + b _0804AA20 + .align 2, 0 +_0804AA00: .4byte 0x00013554 +_0804AA04: + ldr r2, _0804AA10 + adds r0, r3, r2 +_0804AA08: + mov r3, r8 + adds r2, r3, r0 + b _0804AA20 + .align 2, 0 +_0804AA10: .4byte 0x00012b92 +_0804AA14: + lsls r0, r5, 1 + ldr r4, _0804AA5C + adds r0, r4 + mov r1, r8 + adds r2, r1, r0 +_0804AA1E: + adds r7, r6, 0x1 +_0804AA20: + adds r6, r7, 0 + cmp r6, 0x14 + bgt _0804AA28 + b _0804A8FE +_0804AA28: + ldr r2, [sp, 0x30] + adds r2, 0x1 + str r2, [sp, 0x30] + ldr r3, [sp, 0x3C] + str r3, [sp, 0x28] + cmp r3, 0x3 + bne _0804AA3E + movs r4, 0 + str r4, [sp, 0x28] + movs r0, 0x1 + add r10, r0 +_0804AA3E: + ldr r7, [sp, 0x38] + cmp r7, 0x1E + bgt _0804AA46 + b _0804A7AC +_0804AA46: + movs r0, 0x2 + bl sub_80098F8 + add sp, 0x40 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804AA5C: .4byte 0x00013554 + thumb_func_end sub_804A728 + + thumb_func_start sub_804AA60 +sub_804AA60: + push {r4,lr} + movs r1, 0 + ldr r0, _0804AAA0 + movs r3, 0 + movs r2, 0x80 + lsls r2, 5 + adds r4, r0, r2 +_0804AA6E: + lsls r0, r1, 6 + adds r2, r1, 0x1 + movs r1, 0x1F + adds r0, r4 + adds r0, 0x3E +_0804AA78: + strh r3, [r0] + subs r0, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _0804AA78 + adds r1, r2, 0 + cmp r1, 0x1F + ble _0804AA6E + movs r4, 0 + movs r0, 0x2 + bl sub_80098F8 + ldr r0, _0804AAA4 + ldr r0, [r0] + ldr r1, _0804AAA8 + adds r0, r1 + strb r4, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0804AAA0: .4byte gUnknown_202B038 +_0804AAA4: .4byte gUnknown_203B418 +_0804AAA8: .4byte 0x0001821a + thumb_func_end sub_804AA60 + + thumb_func_start sub_804AAAC +sub_804AAAC: + push {r4-r7,lr} + movs r5, 0 + movs r7, 0 +_0804AAB2: + movs r4, 0 + adds r6, r5, 0x1 +_0804AAB6: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8049590 + strh r7, [r0, 0x4] + adds r4, 0x1 + cmp r4, 0x37 + ble _0804AAB6 + adds r5, r6, 0 + cmp r5, 0x1F + ble _0804AAB2 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_804AAAC + + thumb_func_start sub_804AAD4 +sub_804AAD4: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r4, _0804AC04 + movs r0, 0 + mov r8, r0 + ldr r6, _0804AC08 + ldr r5, _0804AC0C + movs r2, 0 + movs r3, 0x1F +_0804AAEA: + ldr r0, [r4] + adds r0, r2 + ldr r1, _0804AC10 + adds r0, r1 + mov r7, r8 + strb r7, [r0] + ldr r0, [r4] + adds r0, r2 + adds r1, 0x1 + adds r0, r1 + strb r7, [r0] + ldr r0, [r4] + adds r0, r2 + ldr r7, _0804AC14 + adds r1, r0, r7 + strh r6, [r1] + adds r7, 0x2 + adds r1, r0, r7 + strh r6, [r1] + adds r7, 0x2 + adds r1, r0, r7 + strh r5, [r1] + ldr r1, _0804AC18 + adds r0, r1 + strh r5, [r0] + adds r2, 0x1C + subs r3, 0x1 + cmp r3, 0 + bge _0804AAEA + movs r4, 0 + mov r9, r4 + movs r6, 0 + ldr r7, _0804AC04 + mov r8, r7 +_0804AB2E: + movs r4, 0 + adds r5, r6, 0x1 +_0804AB32: + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_804954C + ldrb r2, [r0, 0x9] + adds r3, r4, 0x1 + cmp r2, 0xFF + beq _0804AB84 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + ldr r1, _0804AC10 + adds r0, r1 + mov r7, r8 + ldr r1, [r7] + adds r1, r0 + movs r0, 0x1 + strb r0, [r1] + movs r7, 0x2 + ldrsh r0, [r1, r7] + cmp r0, r4 + ble _0804AB60 + strh r4, [r1, 0x2] +_0804AB60: + movs r4, 0x4 + ldrsh r0, [r1, r4] + cmp r0, r6 + ble _0804AB6A + strh r6, [r1, 0x4] +_0804AB6A: + movs r7, 0x6 + ldrsh r0, [r1, r7] + cmp r0, r3 + bge _0804AB74 + strh r3, [r1, 0x6] +_0804AB74: + movs r4, 0x8 + ldrsh r0, [r1, r4] + cmp r0, r5 + bge _0804AB7E + strh r5, [r1, 0x8] +_0804AB7E: + cmp r9, r2 + bge _0804AB84 + mov r9, r2 +_0804AB84: + adds r4, r3, 0 + cmp r4, 0x37 + ble _0804AB32 + adds r6, r5, 0 + cmp r6, 0x1F + ble _0804AB2E + ldr r7, _0804AC04 + mov r8, r7 + mov r5, r9 + adds r5, 0x1 + mov r6, r8 + movs r4, 0 + movs r3, 0x1F +_0804AB9E: + ldr r1, _0804AC10 + adds r0, r4, r1 + ldr r1, [r6] + adds r2, r1, r0 + ldrb r0, [r2] + cmp r0, 0 + beq _0804ABE4 + movs r7, 0x2 + ldrsh r1, [r2, r7] + subs r1, 0x1 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + str r0, [r2, 0xC] + movs r0, 0x4 + ldrsh r1, [r2, r0] + subs r1, 0x1 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + str r0, [r2, 0x10] + movs r7, 0x6 + ldrsh r1, [r2, r7] + adds r1, 0x1 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + str r0, [r2, 0x14] + movs r0, 0x8 + ldrsh r1, [r2, r0] + adds r1, 0x1 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + str r0, [r2, 0x18] +_0804ABE4: + adds r4, 0x1C + subs r3, 0x1 + cmp r3, 0 + bge _0804AB9E + mov r1, r8 + ldr r0, [r1] + ldr r4, _0804AC1C + adds r0, r4 + strb r5, [r0] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804AC04: .4byte gUnknown_203B418 +_0804AC08: .4byte 0x0000270f +_0804AC0C: .4byte 0x0000d8f1 +_0804AC10: .4byte 0x000104c4 +_0804AC14: .4byte 0x000104c6 +_0804AC18: .4byte 0x000104cc +_0804AC1C: .4byte 0x000104c0 + thumb_func_end sub_804AAD4 + + thumb_func_start sub_804AC20 +sub_804AC20: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r4, r0, 0 + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl sub_804954C + ldrb r1, [r0, 0x9] + ldr r0, _0804AC6C + ldr r3, [r0] + ldr r5, _0804AC70 + adds r0, r3, r5 + ldrb r2, [r0] + adds r5, 0x1 + adds r0, r3, r5 + ldrb r0, [r0] + cmp r0, 0 + bne _0804ACD4 + cmp r2, 0 + bne _0804AC52 + movs r2, 0x2 +_0804AC52: + cmp r1, 0xFF + bne _0804AC74 + movs r0, 0 + ldrsh r1, [r4, r0] + subs r3, r1, r2 + mov r9, r3 + movs r5, 0x2 + ldrsh r0, [r4, r5] + subs r3, r0, r2 + adds r6, r1, r2 + adds r0, r2 + mov r8, r0 + b _0804ACA2 + .align 2, 0 +_0804AC6C: .4byte gUnknown_203B418 +_0804AC70: .4byte 0x00018209 +_0804AC74: + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r1, _0804ACE0 + adds r0, r1 + adds r2, r3, r0 + ldrb r0, [r2, 0x1] + cmp r0, 0 + bne _0804ACD4 + movs r0, 0x1 + strb r0, [r2, 0x1] + movs r3, 0x2 + ldrsh r0, [r2, r3] + subs r0, 0x1 + mov r9, r0 + movs r5, 0x4 + ldrsh r0, [r2, r5] + subs r3, r0, 0x1 + movs r0, 0x6 + ldrsh r6, [r2, r0] + movs r5, 0x8 + ldrsh r1, [r2, r5] + mov r8, r1 +_0804ACA2: + adds r5, r3, 0 + cmp r5, r8 + bgt _0804ACD4 +_0804ACA8: + mov r4, r9 + adds r7, r5, 0x1 + cmp r4, r6 + bgt _0804ACCE +_0804ACB0: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8049590 + ldrh r2, [r0, 0x4] + movs r1, 0x3 + orrs r1, r2 + strh r1, [r0, 0x4] + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80402AC + adds r4, 0x1 + cmp r4, r6 + ble _0804ACB0 +_0804ACCE: + adds r5, r7, 0 + cmp r5, r8 + ble _0804ACA8 +_0804ACD4: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804ACE0: .4byte 0x000104c4 + thumb_func_end sub_804AC20 + + thumb_func_start sub_804ACE4 +sub_804ACE4: + push {lr} + movs r1, 0 + ldrsh r2, [r0, r1] + movs r3, 0x2 + ldrsh r1, [r0, r3] + adds r0, r2, 0 + bl sub_804954C + ldr r0, [r0, 0x14] + cmp r0, 0 + beq _0804AD06 + bl sub_80450F8 + cmp r0, 0x3 + bne _0804AD06 + movs r0, 0x1 + b _0804AD08 +_0804AD06: + movs r0, 0 +_0804AD08: + pop {r1} + bx r1 + thumb_func_end sub_804ACE4 + + thumb_func_start sub_804AD0C +sub_804AD0C: + push {lr} + movs r1, 0 + ldrsh r2, [r0, r1] + movs r3, 0x2 + ldrsh r1, [r0, r3] + adds r0, r2, 0 + bl sub_804954C + ldr r1, [r0, 0x10] + cmp r1, 0 + beq _0804AD2C + ldr r0, [r1] + cmp r0, 0x1 + bne _0804AD2C + adds r0, r1, 0 + b _0804AD2E +_0804AD2C: + movs r0, 0 +_0804AD2E: + pop {r1} + bx r1 + thumb_func_end sub_804AD0C + + thumb_func_start sub_804AD34 +sub_804AD34: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + movs r0, 0 + mov r8, r0 + movs r1, 0 + ldrsh r0, [r6, r1] + movs r2, 0x2 + ldrsh r1, [r6, r2] + bl sub_8049590 + adds r2, r0, 0 + ldrh r1, [r2] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _0804ADB6 + movs r0, 0x88 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + bne _0804ADB6 + movs r0, 0x1 + mov r8, r0 + ldr r0, _0804ADFC + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strh r0, [r2] + movs r5, 0x1 + negs r5, r5 +_0804AD74: + movs r4, 0x1 + negs r4, r4 + adds r7, r5, 0x1 +_0804AD7A: + movs r1, 0 + ldrsh r0, [r6, r1] + adds r0, r4, r0 + movs r2, 0x2 + ldrsh r1, [r6, r2] + adds r1, r5, r1 + bl sub_80498A8 + movs r1, 0 + ldrsh r0, [r6, r1] + adds r0, r4, r0 + movs r2, 0x2 + ldrsh r1, [r6, r2] + adds r1, r5, r1 + bl sub_8049BB0 + movs r1, 0 + ldrsh r0, [r6, r1] + adds r0, r4, r0 + movs r2, 0x2 + ldrsh r1, [r6, r2] + adds r1, r5, r1 + bl sub_80402AC + adds r4, 0x1 + cmp r4, 0x1 + ble _0804AD7A + adds r5, r7, 0 + cmp r5, 0x1 + ble _0804AD74 +_0804ADB6: + mov r0, r8 + cmp r0, 0 + beq _0804ADEE + movs r5, 0 +_0804ADBE: + ldr r0, _0804AE00 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _0804AE04 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0804ADDE + adds r0, r4, 0 + bl sub_806CF98 +_0804ADDE: + adds r5, 0x1 + cmp r5, 0x13 + ble _0804ADBE + bl sub_8049ED4 + adds r0, r6, 0 + bl sub_8042A14 +_0804ADEE: + mov r0, r8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0804ADFC: .4byte 0x0000fffc +_0804AE00: .4byte gUnknown_203B418 +_0804AE04: .4byte 0x000135cc + thumb_func_end sub_804AD34 + + thumb_func_start sub_804AE08 +sub_804AE08: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + movs r0, 0 + mov r8, r0 + movs r1, 0 + ldrsh r0, [r7, r1] + movs r2, 0x2 + ldrsh r1, [r7, r2] + bl sub_8049590 + adds r2, r0, 0 + ldrh r1, [r2] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _0804AE72 + movs r0, 0x88 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + bne _0804AE72 + movs r0, 0x1 + mov r8, r0 + ldr r0, _0804AE80 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strh r0, [r2] + ldrh r1, [r2, 0x4] + movs r0, 0x10 + orrs r0, r1 + strh r0, [r2, 0x4] + movs r5, 0x1 + negs r5, r5 +_0804AE50: + movs r4, 0x1 + negs r4, r4 + adds r6, r5, 0x1 +_0804AE56: + movs r1, 0 + ldrsh r0, [r7, r1] + adds r0, r4, r0 + movs r2, 0x2 + ldrsh r1, [r7, r2] + adds r1, r5, r1 + bl sub_8049BB0 + adds r4, 0x1 + cmp r4, 0x1 + ble _0804AE56 + adds r5, r6, 0 + cmp r5, 0x1 + ble _0804AE50 +_0804AE72: + mov r0, r8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0804AE80: .4byte 0x0000fffc + thumb_func_end sub_804AE08 + + thumb_func_start sub_804AE84 +sub_804AE84: + push {r4-r7,lr} + adds r5, r0, 0 + movs r1, 0 + ldrsh r0, [r5, r1] + movs r2, 0x2 + ldrsh r1, [r5, r2] + bl sub_8049590 + adds r2, r0, 0 + ldrh r1, [r2, 0x4] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0804AF0E + ldr r0, _0804AF14 + ands r0, r1 + strh r0, [r2, 0x4] + movs r6, 0x1 + negs r6, r6 +_0804AEAA: + movs r4, 0x1 + negs r4, r4 + adds r7, r6, 0x1 +_0804AEB0: + movs r1, 0 + ldrsh r0, [r5, r1] + adds r0, r4, r0 + movs r2, 0x2 + ldrsh r1, [r5, r2] + adds r1, r6, r1 + bl sub_80498A8 + movs r1, 0 + ldrsh r0, [r5, r1] + adds r0, r4, r0 + movs r2, 0x2 + ldrsh r1, [r5, r2] + adds r1, r6, r1 + bl sub_80402AC + adds r4, 0x1 + cmp r4, 0x1 + ble _0804AEB0 + adds r6, r7, 0 + cmp r6, 0x1 + ble _0804AEAA + movs r6, 0 +_0804AEDE: + ldr r0, _0804AF18 + ldr r0, [r0] + lsls r1, r6, 2 + ldr r2, _0804AF1C + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0804AEFE + adds r0, r4, 0 + bl sub_806CF98 +_0804AEFE: + adds r6, 0x1 + cmp r6, 0x13 + ble _0804AEDE + bl sub_8049ED4 + adds r0, r5, 0 + bl sub_8042A14 +_0804AF0E: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804AF14: .4byte 0x0000ffef +_0804AF18: .4byte gUnknown_203B418 +_0804AF1C: .4byte 0x000135cc + thumb_func_end sub_804AE84 + + thumb_func_start sub_804AF20 +sub_804AF20: + push {r4,r5,lr} + adds r4, r0, 0 + movs r5, 0 + bl sub_804AF74 + lsls r0, 24 + cmp r0, 0 + beq _0804AF3C + ldrh r1, [r4] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _0804AF5E + b _0804AF5C +_0804AF3C: + ldrh r1, [r4] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + bne _0804AF5C + ldr r1, _0804AF68 + ldr r0, _0804AF6C + ldr r0, [r0] + ldr r2, _0804AF70 + adds r0, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0804AF5E +_0804AF5C: + movs r5, 0x1 +_0804AF5E: + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0804AF68: .4byte gUnknown_810ACC0 +_0804AF6C: .4byte gUnknown_203B418 +_0804AF70: .4byte 0x00003a0e + thumb_func_end sub_804AF20 + + thumb_func_start sub_804AF74 +sub_804AF74: + push {lr} + ldr r0, _0804AF9C + ldr r0, [r0] + ldr r1, _0804AFA0 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _0804AF96 + cmp r0, 0x31 + beq _0804AF96 + cmp r0, 0x20 + beq _0804AF96 + cmp r0, 0x21 + beq _0804AF96 + cmp r0, 0x36 + bne _0804AFA4 +_0804AF96: + movs r0, 0x1 + b _0804AFA6 + .align 2, 0 +_0804AF9C: .4byte gUnknown_203B418 +_0804AFA0: .4byte 0x00003a0e +_0804AFA4: + movs r0, 0 +_0804AFA6: + pop {r1} + bx r1 + thumb_func_end sub_804AF74 + + thumb_func_start sub_804AFAC +sub_804AFAC: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x44 + movs r0, 0 + mov r10, r0 + ldr r4, _0804B0E8 + ldr r0, [r4] + ldr r1, _0804B0EC + adds r1, r0 + mov r8, r1 + ldr r0, _0804B0F0 + ldr r1, _0804B0F4 + bl sub_800A9EC + ldr r2, [r4] + ldr r3, _0804B0F8 + adds r1, r2, r3 + str r0, [r1] + ldr r0, _0804B0FC + mov r6, r10 + strb r6, [r0] + ldr r0, _0804B100 + strb r6, [r0] + ldr r0, _0804B104 + strb r6, [r0] + ldr r5, _0804B108 + movs r3, 0 + ldr r1, _0804B10C + ldr r0, _0804B110 + adds r2, r0 + movs r6, 0 + ldrsh r0, [r2, r6] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x2 + bne _0804AFFC + movs r3, 0x1 +_0804AFFC: + strb r3, [r5] + ldr r1, _0804B114 + movs r0, 0xFF + strb r0, [r1] + ldr r0, _0804B118 + mov r1, r10 + strb r1, [r0] + ldr r1, _0804B11C + mov r2, r8 + ldrb r0, [r2, 0x7] + strh r0, [r1] + ldr r1, _0804B120 + ldrb r0, [r2, 0x8] + strh r0, [r1] + ldr r1, _0804B124 + movs r0, 0x1 + strb r0, [r1] + ldr r1, _0804B128 + movs r0, 0x1 + negs r0, r0 + str r0, [r1] + str r0, [r1, 0x8] + str r0, [r1, 0x4] + str r0, [r1, 0xC] + bl sub_804FD30 + ldr r3, [r4] + mov r6, r8 + ldrb r2, [r6, 0x6] + ldr r1, _0804B12C + adds r0, r3, r1 + movs r1, 0 + strh r2, [r0] + ldr r2, _0804B130 + adds r0, r3, r2 + strb r1, [r0] + ldr r0, [r4] + ldr r3, _0804B134 + adds r0, r3 + strb r1, [r0] + ldr r1, _0804B138 + mov r6, r8 + ldrb r0, [r6, 0xC] + str r0, [r1] + movs r0, 0 + str r0, [sp, 0x40] +_0804B058: + ldr r0, _0804B0E8 + ldr r2, [r0] + ldr r3, _0804B13C + adds r1, r2, r3 + ldr r0, _0804B140 + strh r0, [r1] + ldr r6, _0804B144 + adds r1, r2, r6 + movs r0, 0x1 + negs r0, r0 + strh r0, [r1] + ldr r0, _0804B148 + adds r1, r2, r0 + movs r0, 0x1 + negs r0, r0 + strh r0, [r1] + ldr r1, _0804B14C + adds r2, r1 + strh r0, [r2] + movs r2, 0 + mov r9, r2 +_0804B082: + ldr r4, _0804B0E8 + ldr r0, [r4] + ldr r3, _0804B150 + adds r0, r3 + movs r5, 0 + movs r1, 0 + mov r6, r9 + strh r6, [r0] + mov r0, r9 + cmp r0, 0 + ble _0804B09C + ldr r0, _0804B138 + str r1, [r0] +_0804B09C: + ldr r0, _0804B154 + strb r5, [r0] + ldr r1, _0804B158 + ldr r0, _0804B140 + strh r0, [r1] + movs r0, 0x1 + negs r0, r0 + strh r0, [r1, 0x2] + bl sub_804FD30 + ldr r1, [r4] + ldr r3, _0804B13C + adds r2, r1, r3 + movs r0, 0x1 + negs r0, r0 + strh r0, [r2] + ldr r6, _0804B144 + adds r2, r1, r6 + strh r0, [r2] + ldr r0, _0804B15C + adds r1, r0 + strb r5, [r1] + ldr r0, [r4] + ldr r2, _0804B160 + adds r1, r0, r2 + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _0804B164 + mov r1, r8 + bl sub_804C70C + lsls r0, 24 + cmp r0, 0 + beq _0804B0E4 + b _0804B376 +_0804B0E4: + b _0804B2F6 + .align 2, 0 +_0804B0E8: .4byte gUnknown_203B418 +_0804B0EC: .4byte 0x0001c574 +_0804B0F0: .4byte gUnknown_80F6DCC +_0804B0F4: .4byte gUnknown_83B0000 +_0804B0F8: .4byte 0x00013568 +_0804B0FC: .4byte gUnknown_202F1AA +_0804B100: .4byte gUnknown_202F1AB +_0804B104: .4byte gUnknown_202F1AC +_0804B108: .4byte gUnknown_202F1A8 +_0804B10C: .4byte gUnknown_810ACC0 +_0804B110: .4byte 0x00003a0e +_0804B114: .4byte gUnknown_202F1B4 +_0804B118: .4byte gUnknown_202F1AE +_0804B11C: .4byte gUnknown_202F1B0 +_0804B120: .4byte gUnknown_202F1B2 +_0804B124: .4byte gUnknown_202F1AD +_0804B128: .4byte gUnknown_202F1B8 +_0804B12C: .4byte 0x00000664 +_0804B130: .4byte 0x00003a09 +_0804B134: .4byte 0x00003a0a +_0804B138: .4byte gUnknown_202F1C8 +_0804B13C: .4byte 0x0000e218 +_0804B140: .4byte 0x0000ffff +_0804B144: .4byte 0x0000e21a +_0804B148: .4byte 0x0000e21c +_0804B14C: .4byte 0x0000e21e +_0804B150: .4byte 0x00003a16 +_0804B154: .4byte gUnknown_202F1A9 +_0804B158: .4byte gUnknown_202F1D8 +_0804B15C: .4byte 0x00003a08 +_0804B160: .4byte 0x00003a14 +_0804B164: + mov r0, r8 + ldrb r7, [r0] + movs r6, 0x20 +_0804B16A: + cmp r7, 0x8 + beq _0804B17E + movs r0, 0x2 + movs r1, 0x9 + bl sub_808411C + adds r5, r0, 0 + movs r0, 0x2 + movs r1, 0x8 + b _0804B18C +_0804B17E: + movs r0, 0x2 + movs r1, 0x5 + bl sub_808411C + adds r5, r0, 0 + movs r0, 0x2 + movs r1, 0x4 +_0804B18C: + bl sub_808411C + adds r4, r0, 0 + cmp r5, 0x6 + bgt _0804B19A + cmp r4, 0x4 + ble _0804B1A4 +_0804B19A: + subs r6, 0x1 + cmp r6, 0 + bne _0804B16A + movs r5, 0x4 + movs r4, 0x4 +_0804B1A4: + movs r0, 0x38 + adds r1, r5, 0 + bl __divsi3 + cmp r0, 0x7 + bgt _0804B1B2 + movs r5, 0x1 +_0804B1B2: + movs r0, 0x20 + adds r1, r4, 0 + bl __divsi3 + cmp r0, 0x7 + bgt _0804B1C0 + movs r4, 0x1 +_0804B1C0: + ldr r2, _0804B1EC + ldr r0, [r2] + ldr r1, _0804B1F0 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + ldr r2, _0804B1F4 + adds r0, r2 + movs r1, 0xFF + strb r1, [r0] + ldr r0, _0804B1F8 + str r7, [r0] + movs r0, 0xF + ands r0, r7 + cmp r0, 0xB + bhi _0804B274 + lsls r0, 2 + ldr r1, _0804B1FC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0804B1EC: .4byte gUnknown_203B418 +_0804B1F0: .4byte 0x00003a08 +_0804B1F4: .4byte 0x00003a0c +_0804B1F8: .4byte gUnknown_202F1D0 +_0804B1FC: .4byte _0804B200 + .align 2, 0 +_0804B200: + .4byte _0804B274 + .4byte _0804B230 + .4byte _0804B280 + .4byte _0804B298 + .4byte _0804B2A4 + .4byte _0804B2B0 + .4byte _0804B2CC + .4byte _0804B2D8 + .4byte _0804B274 + .4byte _0804B2E0 + .4byte _0804B2E8 + .4byte _0804B250 +_0804B230: + movs r0, 0x2 + bl sub_8084100 + adds r4, r0, 0x2 + ldr r1, _0804B24C + movs r0, 0x1 + strb r0, [r1] + movs r0, 0x4 + adds r1, r4, 0 + mov r2, r8 + bl sub_804B634 + b _0804B2AA + .align 2, 0 +_0804B24C: .4byte gUnknown_202F1AE +_0804B250: + movs r0, 0x2 + bl sub_8084100 + adds r4, r0, 0x2 + ldr r1, _0804B270 + movs r0, 0x2 + strb r0, [r1] + movs r0, 0x4 + adds r1, r4, 0 + mov r2, r8 + bl sub_804B634 + movs r6, 0x1 + mov r10, r6 + b _0804B2F6 + .align 2, 0 +_0804B270: .4byte gUnknown_202F1AE +_0804B274: + adds r0, r5, 0 + adds r1, r4, 0 + mov r2, r8 + bl sub_804B634 + b _0804B2D2 +_0804B280: + bl sub_804C918 + ldr r0, _0804B290 + ldr r0, [r0] + ldr r1, _0804B294 + adds r0, r1 + b _0804B2BC + .align 2, 0 +_0804B290: .4byte gUnknown_203B418 +_0804B294: .4byte 0x00003a08 +_0804B298: + mov r0, r8 + bl sub_804B72C + movs r2, 0x1 + mov r10, r2 + b _0804B2F6 +_0804B2A4: + mov r0, r8 + bl sub_804BC80 +_0804B2AA: + movs r3, 0x1 + mov r10, r3 + b _0804B2F6 +_0804B2B0: + bl sub_804C9D0 + ldr r0, _0804B2C4 + ldr r0, [r0] + ldr r6, _0804B2C8 + adds r0, r6 +_0804B2BC: + movs r1, 0x1 + strb r1, [r0] + b _0804B2F6 + .align 2, 0 +_0804B2C4: .4byte gUnknown_203B418 +_0804B2C8: .4byte 0x00003a08 +_0804B2CC: + mov r0, r8 + bl sub_804C0A8 +_0804B2D2: + movs r0, 0x1 + mov r10, r0 + b _0804B2F6 +_0804B2D8: + mov r0, r8 + bl sub_804C190 + b _0804B2F6 +_0804B2E0: + mov r0, r8 + bl sub_804C2F4 + b _0804B2F6 +_0804B2E8: + adds r0, r5, 0 + adds r1, r4, 0 + mov r2, r8 + bl sub_804C53C + movs r1, 0x1 + mov r10, r1 +_0804B2F6: + bl sub_80518F0 + bl sub_804FCCC + ldr r0, _0804B4B4 + ldrb r0, [r0] + cmp r0, 0 + bne _0804B36A + movs r7, 0 + movs r1, 0 + mov r0, sp + adds r0, 0x3F +_0804B30E: + strb r1, [r0] + subs r0, 0x1 + cmp r0, sp + bge _0804B30E + movs r5, 0 +_0804B318: + movs r4, 0 + adds r6, r5, 0x1 +_0804B31C: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_804954C + adds r1, r0, 0 + ldrh r0, [r1] + movs r2, 0x3 + ands r2, r0 + cmp r2, 0x1 + bne _0804B340 + ldrb r0, [r1, 0x9] + cmp r0, 0xF0 + bhi _0804B340 + adds r7, 0x1 + cmp r0, 0x3F + bhi _0804B340 + add r0, sp + strb r2, [r0] +_0804B340: + adds r4, 0x1 + cmp r4, 0x1F + ble _0804B31C + adds r5, r6, 0 + cmp r5, 0x37 + ble _0804B318 + movs r1, 0 + movs r4, 0 +_0804B350: + mov r2, sp + adds r0, r2, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _0804B35C + adds r1, 0x1 +_0804B35C: + adds r4, 0x1 + cmp r4, 0x3F + ble _0804B350 + cmp r7, 0x1D + ble _0804B36A + cmp r1, 0x1 + bgt _0804B376 +_0804B36A: + movs r3, 0x1 + add r9, r3 + mov r6, r9 + cmp r6, 0x9 + bgt _0804B376 + b _0804B082 +_0804B376: + mov r0, r9 + cmp r0, 0xA + bne _0804B398 + ldr r1, _0804B4B8 + ldr r0, _0804B4BC + strh r0, [r1] + movs r0, 0x1 + negs r0, r0 + strh r0, [r1, 0x2] + bl sub_804C918 + ldr r0, _0804B4C0 + ldr r0, [r0] + ldr r1, _0804B4C4 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] +_0804B398: + bl sub_804E9DC + mov r2, r10 + cmp r2, 0 + beq _0804B3AA + movs r0, 0x1 + mov r1, r8 + bl sub_80506F0 +_0804B3AA: + movs r0, 0x64 + bl sub_8084100 + movs r4, 0 + mov r3, r8 + ldrb r3, [r3, 0x19] + cmp r0, r3 + bge _0804B3BC + movs r4, 0x1 +_0804B3BC: + mov r0, r8 + adds r1, r4, 0 + bl sub_804FF08 + mov r0, r8 + adds r1, r4, 0 + bl sub_8050438 + bl sub_804FBE8 + ldr r5, _0804B4C0 + ldr r1, [r5] + ldr r6, _0804B4C8 + adds r0, r1, r6 + movs r2, 0 + ldrsh r0, [r0, r2] + movs r4, 0x1 + negs r4, r4 + cmp r0, r4 + beq _0804B42A + ldr r3, _0804B4CC + adds r0, r1, r3 + movs r6, 0 + ldrsh r0, [r0, r6] + cmp r0, r4 + beq _0804B42A + bl sub_8043D10 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0804B436 + ldr r1, [r5] + ldr r0, _0804B4D0 + adds r2, r1, r0 + movs r3, 0 + ldrsh r0, [r2, r3] + cmp r0, r4 + beq _0804B42A + ldr r6, _0804B4D4 + adds r1, r6 + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, r4 + beq _0804B42A + movs r6, 0 + ldrsh r0, [r2, r6] + movs r2, 0 + ldrsh r1, [r1, r2] + movs r2, 0 + bl sub_8050C30 + lsls r0, 24 + cmp r0, 0 + bne _0804B436 +_0804B42A: + ldr r3, [sp, 0x40] + adds r3, 0x1 + str r3, [sp, 0x40] + cmp r3, 0x9 + bgt _0804B436 + b _0804B058 +_0804B436: + ldr r6, [sp, 0x40] + cmp r6, 0xA + bne _0804B474 + ldr r1, _0804B4B8 + ldr r0, _0804B4BC + strh r0, [r1] + movs r0, 0x1 + negs r0, r0 + strh r0, [r1, 0x2] + bl sub_804FD30 + bl sub_804C918 + ldr r0, _0804B4C0 + ldr r0, [r0] + ldr r1, _0804B4C4 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + bl sub_804E9DC + mov r0, r8 + movs r1, 0 + bl sub_804FF08 + mov r0, r8 + movs r1, 0 + bl sub_8050438 + bl sub_804FBE8 +_0804B474: + ldr r1, _0804B4B8 + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0 + blt _0804B498 + movs r3, 0x2 + ldrsh r0, [r1, r3] + cmp r0, 0 + blt _0804B498 + movs r6, 0 + ldrsh r0, [r1, r6] + movs r2, 0x2 + ldrsh r1, [r1, r2] + movs r2, 0xBE + lsls r2, 1 + movs r3, 0 + bl sub_806C330 +_0804B498: + ldr r0, _0804B4D8 + ldr r0, [r0] + cmp r0, 0 + blt _0804B4E0 + mov r0, r8 + bl sub_8051654 + ldr r0, _0804B4C0 + ldr r0, [r0] + ldr r3, _0804B4DC + adds r0, r3 + movs r1, 0x1 + b _0804B4EA + .align 2, 0 +_0804B4B4: .4byte gUnknown_202F1A9 +_0804B4B8: .4byte gUnknown_202F1D8 +_0804B4BC: .4byte 0x0000ffff +_0804B4C0: .4byte gUnknown_203B418 +_0804B4C4: .4byte 0x00003a08 +_0804B4C8: .4byte 0x0000e218 +_0804B4CC: .4byte 0x0000e21a +_0804B4D0: .4byte 0x0000e21c +_0804B4D4: .4byte 0x0000e21e +_0804B4D8: .4byte gUnknown_202F1B8 +_0804B4DC: .4byte 0x00003a0a +_0804B4E0: + ldr r0, _0804B524 + ldr r0, [r0] + ldr r6, _0804B528 + adds r0, r6 + movs r1, 0 +_0804B4EA: + strb r1, [r0] + movs r0, 0 + movs r1, 0 + movs r2, 0x38 + movs r3, 0x20 + bl sub_804B534 + ldr r0, _0804B52C + ldrb r0, [r0] + cmp r0, 0 + beq _0804B504 + bl sub_804FC74 +_0804B504: + ldr r0, _0804B524 + ldr r0, [r0] + ldr r1, _0804B530 + adds r0, r1 + ldr r0, [r0] + bl sub_800AA14 + add sp, 0x44 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804B524: .4byte gUnknown_203B418 +_0804B528: .4byte 0x00003a0a +_0804B52C: .4byte gUnknown_202F1A8 +_0804B530: .4byte 0x00013568 + thumb_func_end sub_804AFAC + + thumb_func_start sub_804B534 +sub_804B534: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + str r1, [sp] + str r2, [sp, 0x4] + mov r10, r3 + adds r5, r0, 0 + cmp r5, r2 + bge _0804B620 +_0804B54C: + ldr r4, [sp] + adds r0, r5, 0x1 + mov r9, r0 + cmp r4, r10 + bge _0804B618 + movs r6, 0x3 + mov r8, r6 +_0804B55A: + movs r3, 0 + adds r0, r5, 0 + adds r1, r4, 0 + str r3, [sp, 0xC] + bl sub_8049590 + adds r2, r0, 0 + ldrh r0, [r2] + ldr r6, _0804B630 + adds r1, r6, 0 + ands r1, r0 + strh r1, [r2] + ldrb r0, [r2, 0x9] + adds r6, r4, 0x1 + ldr r3, [sp, 0xC] + cmp r0, 0xFF + bne _0804B612 + movs r7, 0x3 + adds r0, r1, 0 + ands r0, r7 + cmp r0, 0x1 + bne _0804B612 + cmp r5, 0 + ble _0804B5A4 + subs r0, r5, 0x1 + adds r1, r4, 0 + str r2, [sp, 0x8] + bl sub_804954C + ldrh r1, [r0] + adds r0, r7, 0 + ands r0, r1 + ldr r2, [sp, 0x8] + ldr r3, [sp, 0xC] + cmp r0, 0x1 + bne _0804B5A4 + movs r3, 0x1 +_0804B5A4: + cmp r4, 0 + ble _0804B5C4 + subs r1, r4, 0x1 + adds r0, r5, 0 + str r2, [sp, 0x8] + str r3, [sp, 0xC] + bl sub_804954C + ldrh r1, [r0] + mov r0, r8 + ands r0, r1 + ldr r2, [sp, 0x8] + ldr r3, [sp, 0xC] + cmp r0, 0x1 + bne _0804B5C4 + adds r3, 0x1 +_0804B5C4: + cmp r5, 0x35 + bgt _0804B5E4 + mov r0, r9 + adds r1, r4, 0 + str r2, [sp, 0x8] + str r3, [sp, 0xC] + bl sub_804954C + ldrh r1, [r0] + mov r0, r8 + ands r0, r1 + ldr r2, [sp, 0x8] + ldr r3, [sp, 0xC] + cmp r0, 0x1 + bne _0804B5E4 + adds r3, 0x1 +_0804B5E4: + adds r6, r4, 0x1 + cmp r5, 0x1D + bgt _0804B606 + adds r0, r5, 0 + adds r1, r6, 0 + str r2, [sp, 0x8] + str r3, [sp, 0xC] + bl sub_804954C + ldrh r1, [r0] + mov r0, r8 + ands r0, r1 + ldr r2, [sp, 0x8] + ldr r3, [sp, 0xC] + cmp r0, 0x1 + bne _0804B606 + adds r3, 0x1 +_0804B606: + cmp r3, 0x2 + ble _0804B612 + ldrh r1, [r2] + movs r0, 0x8 + orrs r0, r1 + strh r0, [r2] +_0804B612: + adds r4, r6, 0 + cmp r4, r10 + blt _0804B55A +_0804B618: + mov r5, r9 + ldr r0, [sp, 0x4] + cmp r5, r0 + blt _0804B54C +_0804B620: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804B630: .4byte 0x0000fffb + thumb_func_end sub_804B534 + + thumb_func_start sub_804B634 +sub_804B634: + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + ldr r4, _0804B718 + add sp, r4 + adds r4, r0, 0 + adds r5, r1, 0 + mov r9, r2 + ldr r0, _0804B71C + add r0, sp + mov r8, r0 + ldr r6, _0804B720 + add r6, sp + adds r1, r6, 0 + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_804D024 + add r0, sp, 0x8 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_804D084 + mov r1, r9 + movs r3, 0x1 + ldrsb r3, [r1, r3] + add r0, sp, 0x8 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_804D154 + str r6, [sp] + mov r1, r9 + ldrb r0, [r1, 0xD] + str r0, [sp, 0x4] + add r0, sp, 0x8 + adds r1, r4, 0 + adds r2, r5, 0 + mov r3, r8 + bl sub_804D2D0 + add r0, sp, 0x8 + adds r1, r4, 0 + adds r2, r5, 0 + mov r3, r9 + bl sub_804D5B0 + str r6, [sp] + movs r0, 0 + str r0, [sp, 0x4] + add r0, sp, 0x8 + adds r1, r4, 0 + adds r2, r5, 0 + mov r3, r8 + bl sub_804D8C8 + str r6, [sp] + add r0, sp, 0x8 + adds r1, r4, 0 + adds r2, r5, 0 + mov r3, r8 + bl sub_804E590 + mov r0, r9 + ldrb r3, [r0, 0x9] + add r0, sp, 0x8 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_804F0D0 + ldr r0, _0804B724 + movs r1, 0 + ldrsh r3, [r0, r1] + add r0, sp, 0x8 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_804EBC8 + ldr r0, _0804B728 + movs r1, 0 + ldrsh r3, [r0, r1] + add r0, sp, 0x8 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_804EEE4 + mov r0, r9 + ldrb r3, [r0, 0x13] + add r0, sp, 0x8 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_804CBEC + add r0, sp, 0x8 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_804E03C + add r0, sp, 0x8 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_804D534 + movs r3, 0xE5 + lsls r3, 5 + add sp, r3 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0804B718: .4byte 0xffffe360 +_0804B71C: .4byte 0x00001c28 +_0804B720: .4byte 0x00001c64 +_0804B724: .4byte gUnknown_202F1B0 +_0804B728: .4byte gUnknown_202F1B2 + thumb_func_end sub_804B634 + + thumb_func_start sub_804B72C +sub_804B72C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, _0804B9AC + add sp, r4 + movs r1, 0xE5 + lsls r1, 5 + add r1, sp + str r0, [r1] + movs r5, 0 + movs r6, 0x1 + ldr r1, _0804B9B0 + add r1, sp + str r5, [r1] + movs r0, 0x5 + str r0, [r1, 0x4] + movs r0, 0x1C + str r0, [r1, 0xC] + movs r0, 0x33 + str r0, [r1, 0x14] + movs r0, 0x38 + str r0, [r1, 0x18] + movs r2, 0x10 + str r2, [r1, 0x8] + movs r0, 0x27 + str r0, [r1, 0x10] + ldr r1, _0804B9B4 + add r1, sp + movs r0, 0x2 + str r0, [r1] + movs r0, 0x7 + str r0, [r1, 0x4] + str r2, [r1, 0x8] + movs r0, 0x19 + str r0, [r1, 0xC] + movs r0, 0x1E + str r0, [r1, 0x10] + add r0, sp, 0x8 + movs r1, 0x6 + movs r2, 0x4 + bl sub_804D084 + mov r2, sp + adds r2, 0x3B + ldr r3, _0804B9B8 + add r3, sp + str r2, [r3] + mov r4, sp + adds r4, 0x3C + ldr r0, _0804B9BC + add r0, sp + str r4, [r0] + mov r1, sp + adds r1, 0x5B + ldr r2, _0804B9C0 + add r2, sp + str r1, [r2] + mov r3, sp + adds r3, 0x5C + movs r4, 0xE6 + lsls r4, 5 + add r4, sp + str r3, [r4] + mov r0, sp + adds r0, 0x7B + ldr r1, _0804B9C4 + add r1, sp + str r0, [r1] + mov r2, sp + adds r2, 0x7E + ldr r3, _0804B9C8 + add r3, sp + str r2, [r3] + add r1, sp, 0x68 + add r0, sp, 0x8 + movs r2, 0xF0 + lsls r2, 1 + movs r4, 0x6 +_0804B7CC: + strb r5, [r0, 0xA] + strb r5, [r1, 0xA] + adds r1, r2 + adds r0, r2 + subs r4, 0x1 + cmp r4, 0 + bne _0804B7CC + movs r2, 0x6 + subs r2, 0x1 + movs r4, 0x4 + cmp r4, 0 + beq _0804B80C + lsls r0, r2, 4 + subs r0, r2 + lsls r0, 5 + add r0, sp + adds r0, 0x8 + add r1, sp, 0x8 + ldr r3, _0804B9CC + add r3, sp + str r4, [r3] +_0804B7F6: + strb r5, [r1, 0xA] + strb r5, [r0, 0xA] + adds r0, 0x20 + adds r1, 0x20 + ldr r3, _0804B9CC + add r3, sp + ldr r4, [r3] + subs r4, 0x1 + str r4, [r3] + cmp r4, 0 + bne _0804B7F6 +_0804B80C: + movs r4, 0x1 + cmp r4, r2 + bge _0804B848 + movs r1, 0x3 +_0804B814: + adds r5, r4, 0x1 + mov r8, r5 + cmp r1, 0x1 + ble _0804B842 + lsls r0, r4, 4 + subs r0, r4 + lsls r0, 5 + add r0, sp + adds r0, 0x8 + adds r0, 0x20 + subs r3, r1, 0x1 + ldr r4, _0804B9CC + add r4, sp + str r3, [r4] +_0804B830: + strb r6, [r0, 0xA] + adds r0, 0x20 + ldr r3, _0804B9CC + add r3, sp + ldr r5, [r3] + subs r5, 0x1 + str r5, [r3] + cmp r5, 0 + bne _0804B830 +_0804B842: + mov r4, r8 + cmp r4, r2 + blt _0804B814 +_0804B848: + movs r4, 0 + ldr r5, _0804B9D0 + add r5, sp + str r4, [r5] + ldr r0, _0804B9CC + add r0, sp + str r4, [r0] + cmp r4, 0x4 + blt _0804B85C + b _0804BA8C +_0804B85C: + movs r4, 0 + ldr r2, _0804B9CC + add r2, sp + ldr r1, [r2] + adds r1, 0x1 + ldr r2, _0804B9D4 + add r2, sp + str r1, [r2] + cmp r4, 0x6 + blt _0804B872 + b _0804BA7A +_0804B872: + ldr r3, _0804B9B0 + add r3, sp + ldr r5, _0804B9D8 + add r5, sp + str r3, [r5] + ldr r0, _0804B9B4 + add r0, sp + ldr r1, _0804B9DC + add r1, sp + str r0, [r1] + ldr r2, _0804B9CC + add r2, sp + ldr r2, [r2] + lsls r0, r2, 2 + ldr r3, [r1] + adds r0, r3, r0 + ldr r3, _0804B9E0 + add r3, sp + str r0, [r3] +_0804B898: + lsls r0, r4, 4 + subs r0, r4 + ldr r5, _0804B9CC + add r5, sp + ldr r5, [r5] + adds r0, r5 + lsls r0, 5 + mov r7, sp + adds r7, r0 + adds r7, 0x8 + ldrb r0, [r7, 0xA] + cmp r0, 0 + bne _0804B8B4 + b _0804B9F4 +_0804B8B4: + lsls r0, r4, 2 + ldr r1, _0804B9D8 + add r1, sp + ldr r1, [r1] + adds r0, r1, r0 + ldr r1, [r0] + adds r2, r1, 0x2 + mov r10, r2 + ldr r3, _0804B9E0 + add r3, sp + ldr r3, [r3] + ldr r2, [r3] + adds r5, r2, 0x2 + ldr r0, _0804B9E4 + add r0, sp + str r5, [r0] + adds r4, 0x1 + mov r9, r4 + lsls r0, r4, 2 + ldr r3, _0804B9D8 + add r3, sp + ldr r3, [r3] + adds r0, r3, r0 + ldr r4, [r0] + subs r4, r1 + subs r4, 0x3 + ldr r5, _0804B9D4 + add r5, sp + ldr r5, [r5] + lsls r0, r5, 2 + ldr r1, _0804B9DC + add r1, sp + ldr r1, [r1] + adds r0, r1, r0 + ldr r5, [r0] + subs r5, r2 + subs r5, 0x3 + movs r0, 0x5 + adds r1, r4, 0 + bl sub_808411C + mov r8, r0 + movs r0, 0x4 + adds r1, r5, 0 + bl sub_808411C + adds r6, r0, 0 + mov r2, r8 + subs r4, r2 + adds r0, r4, 0 + bl sub_8084100 + adds r4, r0, 0 + add r4, r10 + subs r5, r6 + adds r0, r5, 0 + bl sub_8084100 + ldr r5, _0804B9E4 + add r5, sp + ldr r3, [r5] + adds r3, r0 + mov r10, r3 + mov r0, r8 + adds r3, r4, r0 + add r6, r10 + strh r4, [r7] + strh r3, [r7, 0x4] + mov r1, r10 + strh r1, [r7, 0x2] + strh r6, [r7, 0x6] + mov r8, r9 + ldr r5, _0804B9D0 + add r5, sp + ldr r2, [r5] + adds r2, 0x1 + ldr r5, _0804B9E8 + add r5, sp + str r2, [r5] + cmp r4, r3 + bge _0804B99E +_0804B956: + mov r5, r10 + adds r7, r4, 0x1 + cmp r5, r6 + bge _0804B998 + ldr r0, _0804B9EC + mov r9, r0 +_0804B962: + adds r0, r4, 0 + adds r1, r5, 0 + ldr r2, _0804B9F0 + add r2, sp + str r3, [r2] + bl sub_8049590 + ldrh r1, [r0] + mov r2, r9 + ands r1, r2 + movs r2, 0x1 + orrs r1, r2 + strh r1, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8049590 + ldr r1, _0804B9D0 + add r1, sp + ldrb r1, [r1] + strb r1, [r0, 0x9] + adds r5, 0x1 + ldr r2, _0804B9F0 + add r2, sp + ldr r3, [r2] + cmp r5, r6 + blt _0804B962 +_0804B998: + adds r4, r7, 0 + cmp r4, r3 + blt _0804B956 +_0804B99E: + ldr r3, _0804B9E8 + add r3, sp + ldr r3, [r3] + ldr r4, _0804B9D0 + add r4, sp + str r3, [r4] + b _0804BA72 + .align 2, 0 +_0804B9AC: .4byte 0xffffe320 +_0804B9B0: .4byte 0x00001c28 +_0804B9B4: .4byte 0x00001c64 +_0804B9B8: .4byte 0x00001cd4 +_0804B9BC: .4byte 0x00001cd8 +_0804B9C0: .4byte 0x00001cbc +_0804B9C4: .4byte 0x00001cc4 +_0804B9C8: .4byte 0x00001cc8 +_0804B9CC: .4byte 0x00001ca4 +_0804B9D0: .4byte 0x00001ca8 +_0804B9D4: .4byte 0x00001ccc +_0804B9D8: .4byte 0x00001cac +_0804B9DC: .4byte 0x00001cb4 +_0804B9E0: .4byte 0x00001cb8 +_0804B9E4: .4byte 0x00001cb0 +_0804B9E8: .4byte 0x00001cd0 +_0804B9EC: .4byte 0x0000fffc +_0804B9F0: .4byte 0x00001cdc +_0804B9F4: + lsls r0, r4, 2 + ldr r5, _0804BBE8 + add r5, sp + ldr r5, [r5] + adds r0, r5, r0 + ldr r2, [r0] + adds r0, r2, 0x1 + ldr r1, _0804BBEC + add r1, sp + ldr r1, [r1] + ldr r3, [r1] + adds r6, r3, 0x1 + adds r4, 0x1 + mov r8, r4 + lsls r1, r4, 2 + adds r1, r5, r1 + ldr r1, [r1] + subs r1, r2 + subs r1, 0x3 + ldr r5, _0804BBF0 + add r5, sp + ldr r5, [r5] + lsls r2, r5, 2 + ldr r4, _0804BBF4 + add r4, sp + ldr r4, [r4] + adds r2, r4, r2 + ldr r4, [r2] + subs r4, r3 + subs r4, 0x3 + adds r1, r0, r1 + bl sub_808411C + adds r5, r0, 0 + adds r4, r6, r4 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_808411C + adds r4, r0, 0 + strh r5, [r7] + adds r0, r5, 0x1 + strh r0, [r7, 0x4] + strh r4, [r7, 0x2] + adds r0, r4, 0x1 + strh r0, [r7, 0x6] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8049590 + ldrh r1, [r0] + ldr r3, _0804BBF8 + adds r2, r3, 0 + ands r1, r2 + movs r2, 0x1 + orrs r1, r2 + strh r1, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8049590 + movs r1, 0xFF + strb r1, [r0, 0x9] +_0804BA72: + mov r4, r8 + cmp r4, 0x6 + bge _0804BA7A + b _0804B898 +_0804BA7A: + ldr r4, _0804BBF0 + add r4, sp + ldr r4, [r4] + ldr r5, _0804BBFC + add r5, sp + str r4, [r5] + cmp r4, 0x4 + bge _0804BA8C + b _0804B85C +_0804BA8C: + add r1, sp, 0x8 + movs r6, 0 + movs r0, 0x1 + strb r0, [r1, 0x16] + ldr r1, _0804BC00 + add r1, sp + strb r0, [r1] + movs r1, 0xFF + lsls r1, 1 + add r1, sp + strb r0, [r1] + ldr r1, _0804BC04 + add r1, sp + strb r0, [r1] + ldr r1, _0804BC08 + add r1, sp + strb r0, [r1] + ldr r1, _0804BC0C + add r1, sp + strb r0, [r1] + ldr r1, _0804BC10 + add r1, sp + strb r0, [r1] + ldr r1, _0804BC14 + add r1, sp + strb r0, [r1] + ldr r1, _0804BC18 + add r1, sp + strb r0, [r1] + ldr r1, _0804BC1C + add r1, sp + strb r0, [r1] + add r1, sp, 0x8 + strb r0, [r1, 0x14] + ldr r5, _0804BC20 + add r5, sp + ldr r5, [r5] + strb r0, [r5] + ldr r1, _0804BC24 + add r1, sp + ldr r1, [r1] + strb r0, [r1] + ldr r2, _0804BC28 + add r2, sp + ldr r2, [r2] + strb r0, [r2] + movs r3, 0xE6 + lsls r3, 5 + add r3, sp + ldr r3, [r3] + strb r0, [r3] + ldr r4, _0804BC2C + add r4, sp + ldr r4, [r4] + strb r0, [r4] + ldr r5, _0804BC30 + add r5, sp + ldr r5, [r5] + strb r0, [r5] + ldr r1, _0804BC34 + add r1, sp + strb r0, [r1] + ldr r1, _0804BC38 + add r1, sp + strb r0, [r1] + ldr r1, _0804BC3C + add r1, sp + strb r0, [r1] + ldr r1, _0804BC40 + add r1, sp + strb r0, [r1] + ldr r1, _0804BC44 + add r1, sp + strb r0, [r1] + ldr r1, _0804BC48 + add r1, sp + strb r0, [r1] + ldr r1, _0804BC4C + add r1, sp + strb r0, [r1] + ldr r1, _0804BC50 + add r1, sp + strb r0, [r1] + ldr r1, _0804BC54 + add r1, sp + strb r0, [r1] + ldr r1, _0804BC58 + add r1, sp + strb r0, [r1] + ldr r1, _0804BC5C + add r1, sp + strb r0, [r1] + ldr r1, _0804BC60 + add r1, sp + strb r0, [r1] + ldr r1, _0804BC64 + add r1, sp + strb r0, [r1] + ldr r1, _0804BC68 + add r1, sp + strb r0, [r1] + ldr r1, _0804BC6C + add r1, sp + strb r0, [r1] + add r0, sp, 0x8 + movs r1, 0x6 + movs r2, 0x4 + movs r4, 0xE5 + lsls r4, 5 + add r4, sp + ldr r3, [r4] + bl sub_804D5B0 + ldr r5, _0804BC70 + add r5, sp + ldr r4, _0804BC74 + add r4, sp + str r4, [sp] + str r6, [sp, 0x4] + add r0, sp, 0x8 + movs r1, 0x6 + movs r2, 0x4 + adds r3, r5, 0 + bl sub_804D8C8 + str r4, [sp] + add r0, sp, 0x8 + movs r1, 0x6 + movs r2, 0x4 + adds r3, r5, 0 + bl sub_804E590 + ldr r0, _0804BC78 + movs r5, 0 + ldrsh r3, [r0, r5] + add r0, sp, 0x8 + movs r1, 0x6 + movs r2, 0x4 + bl sub_804EBC8 + ldr r0, _0804BC7C + movs r1, 0 + ldrsh r3, [r0, r1] + add r0, sp, 0x8 + movs r1, 0x6 + movs r2, 0x4 + bl sub_804EEE4 + movs r2, 0xE5 + lsls r2, 5 + add r2, sp + ldr r2, [r2] + ldrb r3, [r2, 0x13] + add r0, sp, 0x8 + movs r1, 0x6 + movs r2, 0x4 + bl sub_804CBEC + add r0, sp, 0x8 + movs r1, 0x6 + movs r2, 0x4 + bl sub_804E03C + movs r3, 0xE7 + lsls r3, 5 + add sp, r3 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804BBE8: .4byte 0x00001cac +_0804BBEC: .4byte 0x00001cb8 +_0804BBF0: .4byte 0x00001ccc +_0804BBF4: .4byte 0x00001cb4 +_0804BBF8: .4byte 0x0000fffc +_0804BBFC: .4byte 0x00001ca4 +_0804BC00: .4byte 0x000001fd +_0804BC04: .4byte 0x000003dd +_0804BC08: .4byte 0x000003de +_0804BC0C: .4byte 0x000005bd +_0804BC10: .4byte 0x000005be +_0804BC14: .4byte 0x0000079d +_0804BC18: .4byte 0x0000079e +_0804BC1C: .4byte 0x0000097d +_0804BC20: .4byte 0x00001cd4 +_0804BC24: .4byte 0x00001cd8 +_0804BC28: .4byte 0x00001cbc +_0804BC2C: .4byte 0x00001cc4 +_0804BC30: .4byte 0x00001cc8 +_0804BC34: .4byte 0x0000025d +_0804BC38: .4byte 0x0000025e +_0804BC3C: .4byte 0x0000043d +_0804BC40: .4byte 0x0000043e +_0804BC44: .4byte 0x0000061d +_0804BC48: .4byte 0x0000061e +_0804BC4C: .4byte 0x000007fd +_0804BC50: .4byte 0x000007fe +_0804BC54: .4byte 0x000009dd +_0804BC58: .4byte 0x0000097c +_0804BC5C: .4byte 0x0000099b +_0804BC60: .4byte 0x0000099c +_0804BC64: .4byte 0x000009bb +_0804BC68: .4byte 0x000009bc +_0804BC6C: .4byte 0x000009db +_0804BC70: .4byte 0x00001c28 +_0804BC74: .4byte 0x00001c64 +_0804BC78: .4byte gUnknown_202F1B0 +_0804BC7C: .4byte gUnknown_202F1B2 + thumb_func_end sub_804B72C + + thumb_func_start sub_804BC80 +sub_804BC80: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, _0804BED0 + add sp, r4 + movs r1, 0xE5 + lsls r1, 5 + add r1, sp + str r0, [r1] + movs r4, 0x1 + movs r5, 0 + ldr r1, _0804BED4 + add r1, sp + str r5, [r1] + movs r0, 0xB + str r0, [r1, 0x4] + movs r0, 0x16 + str r0, [r1, 0x8] + movs r0, 0x21 + str r0, [r1, 0xC] + movs r0, 0x2C + str r0, [r1, 0x10] + movs r0, 0x38 + str r0, [r1, 0x14] + ldr r1, _0804BED8 + add r1, sp + str r4, [r1] + movs r0, 0x9 + str r0, [r1, 0x4] + movs r0, 0x10 + str r0, [r1, 0x8] + movs r0, 0x17 + str r0, [r1, 0xC] + movs r0, 0x1F + str r0, [r1, 0x10] + add r0, sp, 0x8 + movs r1, 0x5 + movs r2, 0x4 + bl sub_804D084 + add r6, sp, 0x70 + add r1, sp, 0x68 + add r0, sp, 0x8 + movs r3, 0xF0 + lsls r3, 1 + movs r2, 0x5 +_0804BCE0: + strb r4, [r0, 0xA] + strb r4, [r1, 0xA] + adds r1, r3 + adds r0, r3 + subs r2, 0x1 + cmp r2, 0 + bne _0804BCE0 + movs r3, 0x5 + subs r3, 0x1 + movs r2, 0x4 + cmp r2, 0 + beq _0804BD1A + lsls r0, r3, 4 + subs r0, r3 + lsls r0, 5 + add r0, sp + adds r0, 0x8 + add r1, sp, 0x8 + mov r10, r2 +_0804BD06: + strb r4, [r1, 0xA] + strb r4, [r0, 0xA] + adds r0, 0x20 + adds r1, 0x20 + movs r2, 0x1 + negs r2, r2 + add r10, r2 + mov r2, r10 + cmp r2, 0 + bne _0804BD06 +_0804BD1A: + movs r2, 0x1 + cmp r2, r3 + bge _0804BD58 + movs r1, 0x3 +_0804BD22: + adds r4, r2, 0x1 + ldr r0, _0804BEDC + add r0, sp + str r4, [r0] + cmp r1, 0x1 + ble _0804BD4E + lsls r0, r2, 4 + subs r0, r2 + lsls r0, 5 + add r0, sp + adds r0, 0x8 + adds r0, 0x20 + subs r2, r1, 0x1 + mov r10, r2 +_0804BD3E: + strb r5, [r0, 0xA] + adds r0, 0x20 + movs r4, 0x1 + negs r4, r4 + add r10, r4 + mov r2, r10 + cmp r2, 0 + bne _0804BD3E +_0804BD4E: + ldr r4, _0804BEDC + add r4, sp + ldr r2, [r4] + cmp r2, r3 + blt _0804BD22 +_0804BD58: + add r0, sp, 0x8 + movs r1, 0x1 + strb r1, [r0, 0x8] + movs r0, 0xF2 + lsls r0, 3 + add r0, sp + strb r1, [r0] + strb r1, [r6] + movs r0, 0xFE + lsls r0, 3 + add r0, sp + strb r1, [r0] + movs r5, 0 + ldr r6, _0804BEE0 + add r6, sp + str r5, [r6] + mov r10, r5 + cmp r5, 0x4 + blt _0804BD80 + b _0804BFAC +_0804BD80: + movs r0, 0x4 + movs r1, 0xE6 + lsls r1, 5 + add r1, sp + str r0, [r1] +_0804BD8A: + movs r2, 0 + cmp r2, 0x5 + blt _0804BD92 + b _0804BF94 +_0804BD92: + ldr r3, _0804BED4 + add r3, sp + ldr r4, _0804BEE4 + add r4, sp + str r3, [r4] + ldr r5, _0804BED8 + add r5, sp + ldr r6, _0804BEE8 + add r6, sp + str r5, [r6] + mov r1, r10 + lsls r0, r1, 2 + adds r0, r5, r0 + ldr r3, _0804BEEC + add r3, sp + str r0, [r3] +_0804BDB2: + lsls r0, r2, 4 + subs r0, r2 + add r0, r10 + lsls r0, 5 + mov r7, sp + adds r7, r0 + adds r7, 0x8 + ldrb r0, [r7, 0x8] + adds r4, r2, 0x1 + ldr r5, _0804BEDC + add r5, sp + str r4, [r5] + cmp r0, 0 + beq _0804BDD0 + b _0804BF88 +_0804BDD0: + ldrb r0, [r7, 0xA] + cmp r0, 0 + bne _0804BDD8 + b _0804BF00 +_0804BDD8: + lsls r0, r2, 2 + ldr r6, _0804BEE4 + add r6, sp + ldr r6, [r6] + adds r0, r6, r0 + ldr r1, [r0] + adds r0, r1, 0x2 + mov r9, r0 + ldr r3, _0804BEEC + add r3, sp + ldr r3, [r3] + ldr r2, [r3] + adds r4, r2, 0x2 + ldr r5, _0804BEF0 + add r5, sp + str r4, [r5] + ldr r6, _0804BEDC + add r6, sp + ldr r6, [r6] + lsls r0, r6, 2 + ldr r3, _0804BEE4 + add r3, sp + ldr r3, [r3] + adds r0, r3, r0 + ldr r4, [r0] + subs r4, r1 + subs r4, 0x3 + ldr r5, _0804BEE8 + add r5, sp + ldr r5, [r5] + movs r6, 0xE6 + lsls r6, 5 + add r6, sp + ldr r6, [r6] + adds r0, r5, r6 + ldr r5, [r0] + subs r5, r2 + subs r5, 0x3 + movs r0, 0x5 + adds r1, r4, 0 + bl sub_808411C + mov r8, r0 + movs r0, 0x4 + adds r1, r5, 0 + bl sub_808411C + adds r6, r0, 0 + mov r0, r8 + subs r4, r0 + adds r0, r4, 0 + bl sub_8084100 + adds r4, r0, 0 + add r4, r9 + subs r5, r6 + adds r0, r5, 0 + bl sub_8084100 + ldr r2, _0804BEF0 + add r2, sp + ldr r1, [r2] + adds r1, r0 + mov r9, r1 + mov r5, r8 + adds r3, r4, r5 + add r6, r9 + strh r4, [r7] + strh r3, [r7, 0x4] + strh r1, [r7, 0x2] + strh r6, [r7, 0x6] + ldr r1, _0804BEE0 + add r1, sp + ldr r0, [r1] + adds r0, 0x1 + ldr r1, _0804BEF4 + add r1, sp + str r0, [r1] + cmp r4, r3 + bge _0804BEC0 +_0804BE78: + mov r5, r9 + adds r7, r4, 0x1 + cmp r5, r6 + bge _0804BEBA + ldr r2, _0804BEF8 + mov r8, r2 +_0804BE84: + adds r0, r4, 0 + adds r1, r5, 0 + ldr r2, _0804BEFC + add r2, sp + str r3, [r2] + bl sub_8049590 + ldrh r1, [r0] + mov r2, r8 + ands r1, r2 + movs r2, 0x1 + orrs r1, r2 + strh r1, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8049590 + ldr r1, _0804BEE0 + add r1, sp + ldrb r1, [r1] + strb r1, [r0, 0x9] + adds r5, 0x1 + ldr r2, _0804BEFC + add r2, sp + ldr r3, [r2] + cmp r5, r6 + blt _0804BE84 +_0804BEBA: + adds r4, r7, 0 + cmp r4, r3 + blt _0804BE78 +_0804BEC0: + ldr r3, _0804BEF4 + add r3, sp + ldr r3, [r3] + ldr r4, _0804BEE0 + add r4, sp + str r3, [r4] + b _0804BF88 + .align 2, 0 +_0804BED0: .4byte 0xffffe338 +_0804BED4: .4byte 0x00001c28 +_0804BED8: .4byte 0x00001c64 +_0804BEDC: .4byte 0x00001cb8 +_0804BEE0: .4byte 0x00001ca4 +_0804BEE4: .4byte 0x00001ca8 +_0804BEE8: .4byte 0x00001cb0 +_0804BEEC: .4byte 0x00001cb4 +_0804BEF0: .4byte 0x00001cac +_0804BEF4: .4byte 0x00001cbc +_0804BEF8: .4byte 0x0000fffc +_0804BEFC: .4byte 0x00001cc4 +_0804BF00: + lsls r0, r2, 2 + ldr r4, _0804C080 + add r4, sp + ldr r4, [r4] + adds r0, r4, r0 + ldr r2, [r0] + adds r0, r2, 0x1 + ldr r5, _0804C084 + add r5, sp + ldr r5, [r5] + ldr r3, [r5] + adds r6, r3, 0x1 + mov r8, r6 + ldr r4, _0804C088 + add r4, sp + ldr r4, [r4] + lsls r1, r4, 2 + ldr r5, _0804C080 + add r5, sp + ldr r5, [r5] + adds r1, r5, r1 + ldr r1, [r1] + subs r1, r2 + subs r1, 0x3 + ldr r6, _0804C08C + add r6, sp + ldr r6, [r6] + movs r4, 0xE6 + lsls r4, 5 + add r4, sp + ldr r4, [r4] + adds r2, r6, r4 + ldr r4, [r2] + subs r4, r3 + subs r4, 0x3 + adds r1, r0, r1 + bl sub_808411C + adds r5, r0, 0 + add r4, r8 + mov r0, r8 + adds r1, r4, 0 + bl sub_808411C + adds r4, r0, 0 + strh r5, [r7] + adds r0, r5, 0x1 + strh r0, [r7, 0x4] + strh r4, [r7, 0x2] + adds r0, r4, 0x1 + strh r0, [r7, 0x6] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8049590 + ldrh r1, [r0] + ldr r6, _0804C090 + adds r2, r6, 0 + ands r1, r2 + movs r2, 0x1 + orrs r1, r2 + strh r1, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8049590 + movs r1, 0xFF + strb r1, [r0, 0x9] +_0804BF88: + ldr r0, _0804C088 + add r0, sp + ldr r2, [r0] + cmp r2, 0x5 + bge _0804BF94 + b _0804BDB2 +_0804BF94: + movs r2, 0xE6 + lsls r2, 5 + add r2, sp + ldr r1, [r2] + adds r1, 0x4 + str r1, [r2] + movs r3, 0x1 + add r10, r3 + mov r4, r10 + cmp r4, 0x4 + bge _0804BFAC + b _0804BD8A +_0804BFAC: + movs r2, 0x1 + movs r1, 0x1 + movs r3, 0xF + add r4, sp, 0x1C +_0804BFB4: + movs r5, 0 + mov r10, r5 + lsls r0, r3, 5 + adds r0, r4 +_0804BFBC: + strb r1, [r0] + strb r1, [r0, 0x1F] + adds r0, 0x20 + movs r6, 0x1 + add r10, r6 + mov r5, r10 + cmp r5, 0x2 + ble _0804BFBC + movs r0, 0xF0 + lsls r0, 1 + adds r3, 0xF + adds r2, 0x1 + cmp r2, 0x3 + ble _0804BFB4 + mov r10, r6 + movs r5, 0x1 + adds r4, r0, 0 + mov r6, sp + adds r6, r4 + adds r6, 0x8 +_0804BFE4: + movs r2, 0 + mov r1, r10 + lsls r0, r1, 5 + mov r3, r10 + adds r3, 0x1 + adds r1, r0, r6 + add r0, sp + adds r0, 0x8 +_0804BFF4: + strb r5, [r0, 0x16] + strb r5, [r1, 0x15] + adds r1, r4 + adds r0, r4 + adds r2, 0x1 + cmp r2, 0x3 + ble _0804BFF4 + mov r10, r3 + cmp r3, 0x2 + ble _0804BFE4 + ldr r5, _0804C094 + add r5, sp + ldr r4, _0804C098 + add r4, sp + str r4, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + add r0, sp, 0x8 + movs r1, 0x5 + movs r2, 0x4 + adds r3, r5, 0 + bl sub_804D8C8 + str r4, [sp] + add r0, sp, 0x8 + movs r1, 0x5 + movs r2, 0x4 + adds r3, r5, 0 + bl sub_804E590 + ldr r0, _0804C09C + movs r2, 0 + ldrsh r3, [r0, r2] + add r0, sp, 0x8 + movs r1, 0x5 + movs r2, 0x4 + bl sub_804EBC8 + ldr r0, _0804C0A0 + movs r4, 0 + ldrsh r3, [r0, r4] + add r0, sp, 0x8 + movs r1, 0x5 + movs r2, 0x4 + bl sub_804EEE4 + movs r5, 0xE5 + lsls r5, 5 + add r5, sp + ldr r5, [r5] + ldrb r3, [r5, 0x13] + add r0, sp, 0x8 + movs r1, 0x5 + movs r2, 0x4 + bl sub_804CBEC + add r0, sp, 0x8 + movs r1, 0x5 + movs r2, 0x4 + bl sub_804E03C + ldr r3, _0804C0A4 + add sp, r3 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804C080: .4byte 0x00001ca8 +_0804C084: .4byte 0x00001cb4 +_0804C088: .4byte 0x00001cb8 +_0804C08C: .4byte 0x00001cb0 +_0804C090: .4byte 0x0000fffc +_0804C094: .4byte 0x00001c28 +_0804C098: .4byte 0x00001c64 +_0804C09C: .4byte gUnknown_202F1B0 +_0804C0A0: .4byte gUnknown_202F1B2 +_0804C0A4: .4byte 0x00001cc8 + thumb_func_end sub_804BC80 + + thumb_func_start sub_804C0A8 +sub_804C0A8: + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r4, _0804C17C + add sp, r4 + adds r6, r0, 0 + ldr r4, _0804C180 + add r4, sp + movs r0, 0 + str r0, [r4] + movs r0, 0xB + str r0, [r4, 0x4] + movs r0, 0x16 + str r0, [r4, 0x8] + movs r0, 0x21 + str r0, [r4, 0xC] + movs r0, 0x2C + str r0, [r4, 0x10] + movs r0, 0x38 + str r0, [r4, 0x14] + ldr r5, _0804C184 + add r5, sp + movs r0, 0x4 + str r0, [r5] + movs r0, 0xF + str r0, [r5, 0x4] + movs r0, 0x1 + mov r8, r0 + add r0, sp, 0x8 + movs r1, 0x5 + movs r2, 0x1 + bl sub_804D084 + movs r3, 0x1 + ldrsb r3, [r6, r3] + add r0, sp, 0x8 + movs r1, 0x5 + movs r2, 0x1 + bl sub_804D154 + str r5, [sp] + ldrb r0, [r6, 0xD] + str r0, [sp, 0x4] + add r0, sp, 0x8 + movs r1, 0x5 + movs r2, 0x1 + adds r3, r4, 0 + bl sub_804D2D0 + add r0, sp, 0x8 + movs r1, 0x5 + movs r2, 0x1 + adds r3, r6, 0 + bl sub_804D5B0 + str r5, [sp] + mov r1, r8 + str r1, [sp, 0x4] + add r0, sp, 0x8 + movs r1, 0x5 + movs r2, 0x1 + adds r3, r4, 0 + bl sub_804D8C8 + str r5, [sp] + add r0, sp, 0x8 + movs r1, 0x5 + movs r2, 0x1 + adds r3, r4, 0 + bl sub_804E590 + ldr r0, _0804C188 + movs r1, 0 + ldrsh r3, [r0, r1] + add r0, sp, 0x8 + movs r1, 0x5 + movs r2, 0x1 + bl sub_804EBC8 + ldr r0, _0804C18C + movs r1, 0 + ldrsh r3, [r0, r1] + add r0, sp, 0x8 + movs r1, 0x5 + movs r2, 0x1 + bl sub_804EEE4 + ldrb r3, [r6, 0x13] + add r0, sp, 0x8 + movs r1, 0x5 + movs r2, 0x1 + bl sub_804CBEC + add r0, sp, 0x8 + movs r1, 0x5 + movs r2, 0x1 + bl sub_804E03C + movs r3, 0xE5 + lsls r3, 5 + add sp, r3 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0804C17C: .4byte 0xffffe360 +_0804C180: .4byte 0x00001c28 +_0804C184: .4byte 0x00001c64 +_0804C188: .4byte gUnknown_202F1B0 +_0804C18C: .4byte gUnknown_202F1B2 + thumb_func_end sub_804C0A8 + + thumb_func_start sub_804C190 +sub_804C190: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, _0804C2CC + add sp, r4 + mov r10, r0 + ldr r1, _0804C2D0 + add r1, sp + movs r2, 0xB + str r2, [r1] + movs r0, 0x16 + str r0, [r1, 0x4] + movs r0, 0x21 + str r0, [r1, 0x8] + movs r0, 0x2C + str r0, [r1, 0xC] + ldr r1, _0804C2D4 + add r1, sp + movs r0, 0x2 + str r0, [r1] + str r2, [r1, 0x4] + movs r0, 0x14 + str r0, [r1, 0x8] + movs r0, 0x1E + str r0, [r1, 0xC] + movs r0, 0x3 + mov r8, r0 + movs r7, 0x3 + add r0, sp, 0x8 + movs r1, 0x3 + movs r2, 0x3 + bl sub_804D084 + movs r1, 0 + add r5, sp, 0x50 + movs r0, 0x3E + add r0, sp + mov r9, r0 + mov r0, r10 + ldrb r0, [r0, 0xD] + mov r12, r0 +_0804C1E6: + adds r3, r1, 0x1 + cmp r7, 0 + beq _0804C204 + lsls r0, r1, 4 + subs r0, r1 + movs r2, 0x1 + lsls r0, 5 + add r0, sp + adds r0, 0x8 + adds r1, r7, 0 +_0804C1FA: + strb r2, [r0, 0xA] + adds r0, 0x20 + subs r1, 0x1 + cmp r1, 0 + bne _0804C1FA +_0804C204: + adds r1, r3, 0 + cmp r1, r8 + blt _0804C1E6 + add r0, sp, 0x8 + movs r4, 0x1 + strb r4, [r0, 0x8] + add r0, sp, 0x3D0 + strb r4, [r0] + strb r4, [r5] + movs r0, 0x82 + lsls r0, 3 + add r0, sp + strb r4, [r0] + ldr r6, _0804C2D0 + add r6, sp + ldr r5, _0804C2D4 + add r5, sp + str r5, [sp] + mov r1, r12 + str r1, [sp, 0x4] + add r0, sp, 0x8 + mov r1, r8 + adds r2, r7, 0 + adds r3, r6, 0 + bl sub_804D2D0 + mov r0, r9 + strb r4, [r0] + ldr r0, _0804C2D8 + add r0, sp + strb r4, [r0] + ldr r0, _0804C2DC + add r0, sp + strb r4, [r0] + ldr r0, _0804C2E0 + add r0, sp + strb r4, [r0] + add r0, sp, 0x1FC + strb r4, [r0] + ldr r0, _0804C2E4 + add r0, sp + strb r4, [r0] + add r0, sp, 0x21C + strb r4, [r0] + ldr r0, _0804C2E8 + add r0, sp + strb r4, [r0] + str r5, [sp] + str r4, [sp, 0x4] + add r0, sp, 0x8 + mov r1, r8 + adds r2, r7, 0 + adds r3, r6, 0 + bl sub_804D8C8 + str r5, [sp] + add r0, sp, 0x8 + mov r1, r8 + adds r2, r7, 0 + adds r3, r6, 0 + bl sub_804E590 + ldr r0, _0804C2EC + movs r1, 0 + ldrsh r3, [r0, r1] + add r0, sp, 0x8 + mov r1, r8 + adds r2, r7, 0 + bl sub_804EBC8 + ldr r0, _0804C2F0 + movs r1, 0 + ldrsh r3, [r0, r1] + add r0, sp, 0x8 + mov r1, r8 + adds r2, r7, 0 + bl sub_804EEE4 + mov r0, r10 + ldrb r3, [r0, 0x13] + add r0, sp, 0x8 + mov r1, r8 + adds r2, r7, 0 + bl sub_804CBEC + add r0, sp, 0x8 + mov r1, r8 + adds r2, r7, 0 + bl sub_804E03C + movs r3, 0xE5 + lsls r3, 5 + add sp, r3 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804C2CC: .4byte 0xffffe360 +_0804C2D0: .4byte 0x00001c28 +_0804C2D4: .4byte 0x00001c64 +_0804C2D8: .4byte 0x0000021d +_0804C2DC: .4byte 0x0000021e +_0804C2E0: .4byte 0x000003fd +_0804C2E4: .4byte 0x0000021b +_0804C2E8: .4byte 0x0000023b +_0804C2EC: .4byte gUnknown_202F1B0 +_0804C2F0: .4byte gUnknown_202F1B2 + thumb_func_end sub_804C190 + + thumb_func_start sub_804C2F4 +sub_804C2F4: + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, _0804C420 + add sp, r4 + mov r8, r0 + ldr r1, _0804C424 + add r1, sp + movs r0, 0x5 + str r0, [r1] + movs r0, 0xF + str r0, [r1, 0x4] + movs r0, 0x23 + str r0, [r1, 0x8] + movs r0, 0x32 + str r0, [r1, 0xC] + ldr r1, _0804C428 + add r1, sp + movs r0, 0x2 + str r0, [r1] + movs r0, 0xB + str r0, [r1, 0x4] + movs r0, 0x14 + str r0, [r1, 0x8] + movs r0, 0x1E + str r0, [r1, 0xC] + movs r7, 0x3 + movs r6, 0x3 + add r0, sp, 0x8 + movs r1, 0x3 + movs r2, 0x3 + bl sub_804D084 + movs r1, 0 + mov r0, r8 + ldrb r4, [r0, 0xD] +_0804C33C: + adds r3, r1, 0x1 + cmp r6, 0 + beq _0804C35A + lsls r0, r1, 4 + subs r0, r1 + movs r2, 0x1 + lsls r0, 5 + add r0, sp + adds r0, 0x8 + adds r1, r6, 0 +_0804C350: + strb r2, [r0, 0xA] + adds r0, 0x20 + subs r1, 0x1 + cmp r1, 0 + bne _0804C350 +_0804C35A: + adds r1, r3, 0 + cmp r1, r7 + blt _0804C33C + ldr r3, _0804C424 + add r3, sp + ldr r0, _0804C428 + add r0, sp + str r0, [sp] + str r4, [sp, 0x4] + add r0, sp, 0x8 + adds r1, r7, 0 + adds r2, r6, 0 + bl sub_804D2D0 + movs r4, 0x1 + ldr r3, _0804C42C + add r3, sp + ldr r0, _0804C430 + add r0, sp + add r2, sp, 0x8 + movs r1, 0x2 +_0804C384: + strb r4, [r2, 0x16] + strb r4, [r0] + strb r4, [r0, 0x1] + strb r4, [r3] + adds r3, 0x20 + adds r0, 0x20 + adds r2, 0x20 + subs r1, 0x1 + cmp r1, 0 + bge _0804C384 + ldr r5, _0804C424 + add r5, sp + ldr r4, _0804C428 + add r4, sp + str r4, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + add r0, sp, 0x8 + adds r1, r7, 0 + adds r2, r6, 0 + adds r3, r5, 0 + bl sub_804D8C8 + movs r0, 0x1 + movs r1, 0 + movs r2, 0x1 + add r3, sp, 0x8 + bl sub_804C43C + movs r0, 0x1 + movs r1, 0 + movs r2, 0x2 + add r3, sp, 0x8 + bl sub_804C43C + str r4, [sp] + add r0, sp, 0x8 + adds r1, r7, 0 + adds r2, r6, 0 + adds r3, r5, 0 + bl sub_804E590 + ldr r0, _0804C434 + movs r1, 0 + ldrsh r3, [r0, r1] + add r0, sp, 0x8 + adds r1, r7, 0 + adds r2, r6, 0 + bl sub_804EBC8 + ldr r0, _0804C438 + movs r1, 0 + ldrsh r3, [r0, r1] + add r0, sp, 0x8 + adds r1, r7, 0 + adds r2, r6, 0 + bl sub_804EEE4 + mov r0, r8 + ldrb r3, [r0, 0x13] + add r0, sp, 0x8 + adds r1, r7, 0 + adds r2, r6, 0 + bl sub_804CBEC + add r0, sp, 0x8 + adds r1, r7, 0 + adds r2, r6, 0 + bl sub_804E03C + movs r3, 0xE5 + lsls r3, 5 + add sp, r3 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804C420: .4byte 0xffffe360 +_0804C424: .4byte 0x00001c28 +_0804C428: .4byte 0x00001c64 +_0804C42C: .4byte 0x000003dd +_0804C430: .4byte 0x000001fd +_0804C434: .4byte gUnknown_202F1B0 +_0804C438: .4byte gUnknown_202F1B2 + thumb_func_end sub_804C2F4 + + thumb_func_start sub_804C43C +sub_804C43C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + str r0, [sp] + str r3, [sp, 0x4] + lsls r7, r1, 5 + lsls r0, 4 + str r0, [sp, 0xC] + ldr r3, [sp] + subs r0, r3 + lsls r0, 5 + ldr r4, [sp, 0x4] + adds r0, r4 + adds r3, r7, r0 + adds r6, r1, r2 + lsls r1, r6, 5 + adds r2, r1, r0 + movs r5, 0 + ldrsh r1, [r2, r5] + adds r4, r1, 0 + ldrh r0, [r3] + mov r8, r0 + movs r5, 0 + ldrsh r0, [r3, r5] + cmp r1, r0 + ble _0804C478 + mov r4, r8 +_0804C478: + lsls r0, r4, 16 + asrs r0, 16 + str r0, [sp, 0x8] + movs r1, 0x2 + ldrsh r0, [r3, r1] + mov r10, r0 + movs r4, 0x4 + ldrsh r1, [r2, r4] + adds r4, r1, 0 + ldrh r5, [r3, 0x4] + mov r8, r5 + movs r5, 0x4 + ldrsh r0, [r3, r5] + cmp r1, r0 + bge _0804C498 + mov r4, r8 +_0804C498: + lsls r0, r4, 16 + asrs r0, 16 + str r0, [sp, 0x10] + movs r1, 0x6 + ldrsh r0, [r2, r1] + mov r8, r0 + movs r2, 0 + ldrsh r0, [r3, r2] + mov r1, r10 + bl sub_804954C + ldrb r0, [r0, 0x9] + mov r9, r0 + ldr r5, [sp, 0x8] + str r7, [sp, 0x1C] + ldr r3, [sp, 0xC] + str r3, [sp, 0x18] + str r6, [sp, 0x14] + ldr r4, [sp, 0x10] + cmp r5, r4 + bge _0804C4F2 +_0804C4C2: + mov r4, r10 + adds r6, r5, 0x1 + cmp r10, r8 + bge _0804C4EA + ldr r0, _0804C538 + adds r7, r0, 0 +_0804C4CE: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8049590 + ldrh r1, [r0] + ands r1, r7 + movs r2, 0x1 + orrs r1, r2 + strh r1, [r0] + mov r1, r9 + strb r1, [r0, 0x9] + adds r4, 0x1 + cmp r4, r8 + blt _0804C4CE +_0804C4EA: + adds r5, r6, 0 + ldr r2, [sp, 0x10] + cmp r5, r2 + blt _0804C4C2 +_0804C4F2: + ldr r3, [sp, 0x18] + ldr r4, [sp] + subs r1, r3, r4 + lsls r1, 5 + ldr r5, [sp, 0x4] + adds r1, r5 + ldr r0, [sp, 0x1C] + adds r2, r0, r1 + movs r3, 0 + mov r4, sp + ldrh r4, [r4, 0x8] + strh r4, [r2] + mov r5, sp + ldrh r5, [r5, 0x10] + strh r5, [r2, 0x4] + mov r0, r10 + strh r0, [r2, 0x2] + mov r4, r8 + strh r4, [r2, 0x6] + ldr r5, [sp, 0x14] + lsls r0, r5, 5 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0, 0x12] + strb r1, [r2, 0x12] + strb r3, [r0, 0xB] + strb r1, [r0, 0x11] + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804C538: .4byte 0x0000fffc + thumb_func_end sub_804C43C + + thumb_func_start sub_804C53C +sub_804C53C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, _0804C6F8 + add sp, r4 + mov r10, r2 + adds r7, r0, 0 + adds r6, r1, 0 + ldr r0, _0804C6FC + add r0, sp + ldr r1, _0804C700 + add r1, sp + adds r2, r7, 0 + adds r3, r6, 0 + bl sub_804D024 + add r0, sp, 0x8 + adds r1, r7, 0 + adds r2, r6, 0 + bl sub_804D084 + movs r2, 0 + cmp r2, r7 + bge _0804C594 +_0804C570: + adds r3, r2, 0x1 + cmp r6, 0 + ble _0804C58E + lsls r0, r2, 4 + subs r0, r2 + movs r2, 0x1 + lsls r0, 5 + add r0, sp + adds r0, 0x8 + adds r1, r6, 0 +_0804C584: + strb r2, [r0, 0xA] + adds r0, 0x20 + subs r1, 0x1 + cmp r1, 0 + bne _0804C584 +_0804C58E: + adds r2, r3, 0 + cmp r2, r7 + blt _0804C570 +_0804C594: + movs r2, 0x1 + subs r0, r7, 0x1 + mov r8, r0 + subs r1, r6, 0x1 + mov r9, r1 + mov r0, r10 + ldrb r0, [r0, 0xD] + mov r12, r0 + cmp r2, r8 + bge _0804C5D2 + mov r4, r9 + mov r5, r8 +_0804C5AC: + adds r3, r2, 0x1 + cmp r4, 0x1 + ble _0804C5CC + lsls r0, r2, 4 + subs r0, r2 + movs r2, 0x1 + lsls r0, 5 + add r0, sp + adds r0, 0x8 + adds r0, 0x20 + subs r1, r4, 0x1 +_0804C5C2: + strb r2, [r0, 0x8] + adds r0, 0x20 + subs r1, 0x1 + cmp r1, 0 + bne _0804C5C2 +_0804C5CC: + adds r2, r3, 0 + cmp r2, r5 + blt _0804C5AC +_0804C5D2: + ldr r3, _0804C6FC + add r3, sp + ldr r0, _0804C700 + add r0, sp + str r0, [sp] + mov r1, r12 + str r1, [sp, 0x4] + add r0, sp, 0x8 + adds r1, r7, 0 + adds r2, r6, 0 + bl sub_804D2D0 + movs r2, 0 + cmp r2, r8 + bge _0804C636 + movs r4, 0x1 + mov r0, r9 + lsls r5, r0, 5 + subs r1, r7, 0x2 + mov r12, r1 +_0804C5FA: + cmp r2, 0 + beq _0804C614 + lsls r0, r2, 4 + subs r0, r2 + lsls r0, 5 + mov r1, sp + adds r1, r0 + adds r1, 0x8 + strb r4, [r1, 0x16] + adds r0, r5, r0 + add r0, sp + adds r0, 0x8 + strb r4, [r0, 0x16] +_0804C614: + adds r3, r2, 0x1 + cmp r2, r12 + bge _0804C630 + lsls r0, r3, 4 + subs r0, r3 + lsls r0, 5 + mov r1, sp + adds r1, r0 + adds r1, 0x8 + strb r4, [r1, 0x15] + adds r0, r5, r0 + add r0, sp + adds r0, 0x8 + strb r4, [r0, 0x15] +_0804C630: + adds r2, r3, 0 + cmp r2, r8 + blt _0804C5FA +_0804C636: + movs r1, 0 + cmp r1, r9 + bge _0804C66A + movs r3, 0x1 + mov r2, r8 + lsls r0, r2, 4 + subs r0, r2 + lsls r0, 5 + add r0, sp + adds r0, 0x8 + add r2, sp, 0x8 + subs r5, r6, 0x2 + mov r4, r9 +_0804C650: + cmp r1, 0 + beq _0804C658 + strb r3, [r2, 0x13] + strb r3, [r0, 0x13] +_0804C658: + cmp r1, r5 + bge _0804C660 + strb r3, [r2, 0x14] + strb r3, [r0, 0x14] +_0804C660: + adds r0, 0x20 + adds r2, 0x20 + adds r1, 0x1 + cmp r1, r4 + blt _0804C650 +_0804C66A: + ldr r5, _0804C6FC + add r5, sp + ldr r4, _0804C700 + add r4, sp + str r4, [sp] + movs r0, 0 + str r0, [sp, 0x4] + add r0, sp, 0x8 + adds r1, r7, 0 + adds r2, r6, 0 + adds r3, r5, 0 + bl sub_804D8C8 + str r4, [sp] + add r0, sp, 0x8 + adds r1, r7, 0 + adds r2, r6, 0 + adds r3, r5, 0 + bl sub_804E590 + mov r0, r10 + ldrb r3, [r0, 0x9] + add r0, sp, 0x8 + adds r1, r7, 0 + adds r2, r6, 0 + bl sub_804F0D0 + ldr r0, _0804C704 + movs r1, 0 + ldrsh r3, [r0, r1] + add r0, sp, 0x8 + adds r1, r7, 0 + adds r2, r6, 0 + bl sub_804EBC8 + ldr r0, _0804C708 + movs r2, 0 + ldrsh r3, [r0, r2] + add r0, sp, 0x8 + adds r1, r7, 0 + adds r2, r6, 0 + bl sub_804EEE4 + mov r0, r10 + ldrb r3, [r0, 0x13] + add r0, sp, 0x8 + adds r1, r7, 0 + adds r2, r6, 0 + bl sub_804CBEC + add r0, sp, 0x8 + adds r1, r7, 0 + adds r2, r6, 0 + bl sub_804E03C + add r0, sp, 0x8 + adds r1, r7, 0 + adds r2, r6, 0 + bl sub_804D534 + movs r3, 0xE5 + lsls r3, 5 + add sp, r3 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804C6F8: .4byte 0xffffe360 +_0804C6FC: .4byte 0x00001c28 +_0804C700: .4byte 0x00001c64 +_0804C704: .4byte gUnknown_202F1B0 +_0804C708: .4byte gUnknown_202F1B2 + thumb_func_end sub_804C53C + + thumb_func_start sub_804C70C +sub_804C70C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r7, r0, 0 + mov r8, r1 + ldr r0, _0804C73C + ldr r0, [r0] + ldr r1, _0804C740 + adds r0, r1 + ldr r0, [r0] + ldr r1, [r0, 0x4] + lsls r0, r7, 2 + adds r0, r1 + ldr r0, [r0] + ldrb r5, [r0] + ldrb r6, [r0, 0x1] + cmp r5, 0 + beq _0804C736 + cmp r6, 0 + bne _0804C744 +_0804C736: + bl sub_804C918 + b _0804C782 + .align 2, 0 +_0804C73C: .4byte gUnknown_203B418 +_0804C740: .4byte 0x00013568 +_0804C744: + cmp r7, 0x31 + bgt _0804C752 + adds r0, r7, 0 + bl sub_8051288 + movs r0, 0x1 + b _0804C784 +_0804C752: + adds r1, r5, 0x4 + movs r0, 0x38 + bl __divsi3 + adds r4, r0, 0 + cmp r4, 0x1 + bgt _0804C762 + movs r4, 0x1 +_0804C762: + adds r1, r6, 0x4 + movs r0, 0x20 + bl __divsi3 + adds r1, r0, 0 + cmp r1, 0x1 + bgt _0804C772 + movs r1, 0x1 +_0804C772: + str r7, [sp] + mov r0, r8 + str r0, [sp, 0x4] + adds r0, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_804C790 +_0804C782: + movs r0, 0 +_0804C784: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_804C70C + + thumb_func_start sub_804C790 +sub_804C790: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, _0804C81C + add sp, r4 + adds r5, r0, 0 + adds r4, r1, 0 + ldr r0, _0804C820 + add r0, sp + str r2, [r0] + ldr r1, _0804C824 + add r1, sp + str r3, [r1] + movs r2, 0 + mov r10, r2 + mov r8, r2 + ldr r0, _0804C828 + add r0, sp + ldr r1, _0804C82C + add r1, sp + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_804D024 + add r0, sp, 0x10 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_804D084 + ldr r0, _0804C830 + add r0, sp + ldr r0, [r0] + movs r3, 0x1 + ldrsb r3, [r0, r3] + add r0, sp, 0x10 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_804D154 + mov r6, r8 + cmp r8, r5 + bge _0804C818 +_0804C7E8: + movs r1, 0 + mov r8, r1 + adds r2, r6, 0x1 + cmp r8, r4 + bge _0804C812 + lsls r0, r6, 4 + subs r0, r6 + movs r1, 0x1 + lsls r0, 5 + add r0, sp + adds r0, 0x10 + mov r8, r4 +_0804C800: + strb r1, [r0, 0x1B] + adds r0, 0x20 + movs r3, 0x1 + negs r3, r3 + add r8, r3 + mov r3, r8 + cmp r3, 0 + bne _0804C800 + mov r8, r4 +_0804C812: + adds r6, r2, 0 + cmp r6, r5 + blt _0804C7E8 +_0804C818: + movs r7, 0 + b _0804C836 + .align 2, 0 +_0804C81C: .4byte 0xffffe350 +_0804C820: .4byte 0x00001ca8 +_0804C824: .4byte 0x00001cac +_0804C828: .4byte 0x00001c30 +_0804C82C: .4byte 0x00001c6c +_0804C830: .4byte 0x00001cd4 +_0804C834: + adds r7, 0x1 +_0804C836: + cmp r7, 0x3F + bgt _0804C864 + adds r0, r5, 0 + bl sub_8084100 + adds r6, r0, 0 + adds r0, r4, 0 + bl sub_8084100 + mov r8, r0 + mov r0, r8 + muls r0, r5 + adds r0, r6 + mov r10, r0 + lsls r0, r6, 4 + subs r0, r6 + add r0, r8 + lsls r0, 5 + add r0, sp + adds r0, 0x10 + ldrb r0, [r0, 0xA] + cmp r0, 0 + beq _0804C834 +_0804C864: + ldr r0, _0804C8FC + add r0, sp + mov r9, r0 + ldr r7, _0804C900 + add r7, sp + str r7, [sp] + mov r1, r10 + str r1, [sp, 0x4] + ldr r2, _0804C904 + add r2, sp + ldr r2, [r2] + str r2, [sp, 0x8] + ldr r3, _0804C908 + add r3, sp + ldr r3, [r3] + str r3, [sp, 0xC] + add r0, sp, 0x10 + adds r1, r5, 0 + adds r2, r4, 0 + mov r3, r9 + bl sub_8050F90 + cmp r5, 0x1 + bne _0804C898 + cmp r4, 0x1 + beq _0804C8D0 +_0804C898: + mov r0, r8 + str r0, [sp] + ldr r1, _0804C90C + add r1, sp + ldr r1, [r1] + str r1, [sp, 0x4] + add r0, sp, 0x10 + adds r1, r5, 0 + adds r2, r4, 0 + adds r3, r6, 0 + bl sub_804D5F0 + str r7, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + add r0, sp, 0x10 + adds r1, r5, 0 + adds r2, r4, 0 + mov r3, r9 + bl sub_804D8C8 + str r7, [sp] + add r0, sp, 0x10 + adds r1, r5, 0 + adds r2, r4, 0 + mov r3, r9 + bl sub_804E590 +_0804C8D0: + lsls r0, r6, 4 + subs r0, r6 + lsls r0, 5 + add r0, sp + adds r0, 0x10 + mov r2, r8 + lsls r1, r2, 5 + adds r0, r1 + ldr r3, _0804C910 + add r3, sp + ldr r1, [r3] + bl sub_8051438 + ldr r3, _0804C914 + add sp, r3 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804C8FC: .4byte 0x00001c30 +_0804C900: .4byte 0x00001c6c +_0804C904: .4byte 0x00001ca8 +_0804C908: .4byte 0x00001cac +_0804C90C: .4byte 0x00001cd4 +_0804C910: .4byte 0x00001cd0 +_0804C914: .4byte 0x00001cb0 + thumb_func_end sub_804C790 + + thumb_func_start sub_804C918 +sub_804C918: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r4, _0804C9C4 + add sp, r4 + mov r0, sp + movs r1, 0x1 + movs r2, 0x1 + bl sub_804D084 + mov r0, sp + movs r3, 0 + movs r2, 0x2 + strh r2, [r0] + mov r1, sp + movs r0, 0x36 + strh r0, [r1, 0x4] + mov r0, sp + strh r2, [r0, 0x2] + movs r0, 0x1E + strh r0, [r1, 0x6] + mov r0, sp + movs r1, 0x1 + strb r1, [r0, 0xA] + strb r1, [r0, 0xB] + strb r3, [r0, 0x8] + movs r1, 0 + ldrsh r5, [r0, r1] + movs r2, 0x4 + ldrsh r0, [r0, r2] + cmp r5, r0 + bge _0804C9A6 + mov r6, sp +_0804C95C: + movs r0, 0x2 + ldrsh r4, [r6, r0] + movs r1, 0x6 + ldrsh r0, [r6, r1] + adds r7, r5, 0x1 + cmp r4, r0 + bge _0804C99C + movs r2, 0 + mov r9, r2 + ldr r0, _0804C9C8 + mov r8, r0 +_0804C972: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8049590 + ldrh r1, [r0] + mov r2, r8 + ands r1, r2 + movs r2, 0x1 + orrs r1, r2 + strh r1, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8049590 + mov r1, r9 + strb r1, [r0, 0x9] + adds r4, 0x1 + movs r2, 0x6 + ldrsh r0, [r6, r2] + cmp r4, r0 + blt _0804C972 +_0804C99C: + adds r5, r7, 0 + movs r1, 0x4 + ldrsh r0, [r6, r1] + cmp r5, r0 + blt _0804C95C +_0804C9A6: + ldr r3, _0804C9CC + mov r0, sp + movs r1, 0x1 + movs r2, 0x1 + bl sub_804EEE4 + movs r3, 0xE1 + lsls r3, 5 + add sp, r3 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804C9C4: .4byte 0xffffe3e0 +_0804C9C8: .4byte 0x0000fffc +_0804C9CC: .4byte 0x000003e7 + thumb_func_end sub_804C918 + + thumb_func_start sub_804C9D0 +sub_804C9D0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, _0804CBB4 + add sp, r4 + movs r0, 0 + movs r1, 0xE5 + lsls r1, 5 + add r1, sp + str r0, [r1] + ldr r1, _0804CBB8 + add r1, sp + movs r2, 0x2 + str r2, [r1] + movs r0, 0x1C + str r0, [r1, 0x4] + movs r0, 0x36 + str r0, [r1, 0x8] + ldr r1, _0804CBBC + add r1, sp + str r2, [r1] + movs r0, 0x1E + str r0, [r1, 0x4] + add r0, sp, 0x8 + movs r1, 0x2 + movs r2, 0x1 + bl sub_804D084 + movs r0, 0 + ldr r2, _0804CBB8 + add r2, sp + ldr r3, _0804CBC0 + add r3, sp + str r2, [r3] + ldr r4, _0804CBBC + add r4, sp + ldr r1, _0804CBC4 + add r1, sp + str r4, [r1] +_0804CA22: + movs r7, 0 + lsls r2, r0, 2 + ldr r3, _0804CBC8 + add r3, sp + str r2, [r3] + adds r4, r0, 0x1 + ldr r1, _0804CBCC + add r1, sp + str r4, [r1] + lsls r0, 5 + ldr r2, _0804CBD0 + add r2, sp + str r0, [r2] +_0804CA3C: + lsls r0, r7, 2 + ldr r3, _0804CBC0 + add r3, sp + ldr r3, [r3] + adds r0, r3, r0 + ldr r1, [r0] + adds r4, r1, 0x1 + mov r10, r4 + ldr r2, _0804CBC4 + add r2, sp + ldr r2, [r2] + ldr r3, _0804CBC8 + add r3, sp + ldr r3, [r3] + adds r0, r2, r3 + ldr r2, [r0] + adds r4, r2, 0x1 + ldr r0, _0804CBD4 + add r0, sp + str r4, [r0] + adds r3, r7, 0x1 + mov r9, r3 + lsls r0, r3, 2 + ldr r4, _0804CBC0 + add r4, sp + ldr r4, [r4] + adds r0, r4, r0 + ldr r4, [r0] + subs r4, r1 + subs r4, 0x3 + ldr r1, _0804CBCC + add r1, sp + ldr r1, [r1] + lsls r0, r1, 2 + ldr r3, _0804CBC4 + add r3, sp + ldr r3, [r3] + adds r0, r3, r0 + ldr r5, [r0] + subs r5, r2 + subs r5, 0x3 + movs r0, 0xA + adds r1, r4, 0 + bl sub_808411C + mov r8, r0 + movs r0, 0x10 + adds r1, r5, 0 + bl sub_808411C + adds r6, r0, 0 + mov r0, r8 + subs r4, r0 + adds r0, r4, 0 + bl sub_8084100 + adds r4, r0, 0 + add r4, r10 + subs r5, r6 + adds r0, r5, 0 + bl sub_8084100 + ldr r2, _0804CBD4 + add r2, sp + ldr r1, [r2] + adds r1, r0 + mov r10, r1 + mov r0, r8 + adds r3, r4, r0 + add r6, r10 + lsls r0, r7, 4 + subs r0, r7 + lsls r0, 5 + ldr r1, _0804CBD0 + add r1, sp + ldr r1, [r1] + adds r0, r1, r0 + add r0, sp + adds r0, 0x8 + movs r1, 0x1 + strb r1, [r0, 0xA] + strh r4, [r0] + strh r3, [r0, 0x4] + mov r2, r10 + strh r2, [r0, 0x2] + strh r6, [r0, 0x6] + mov r0, r9 + ldr r1, _0804CBD8 + add r1, sp + str r0, [r1] + movs r0, 0xE5 + lsls r0, 5 + add r0, sp + ldr r2, [r0] + adds r2, 0x1 + mov r9, r2 + cmp r4, r3 + bge _0804CB4E +_0804CB00: + mov r5, r10 + adds r7, r4, 0x1 + cmp r5, r6 + bge _0804CB48 + ldr r1, _0804CBDC + mov r8, r1 +_0804CB0C: + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0xE6 + lsls r2, 5 + add r2, sp + str r3, [r2] + bl sub_8049590 + ldrh r1, [r0] + mov r2, r8 + ands r1, r2 + movs r2, 0x1 + orrs r1, r2 + strh r1, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8049590 + movs r1, 0xE5 + lsls r1, 5 + add r1, sp + ldrb r1, [r1] + strb r1, [r0, 0x9] + adds r5, 0x1 + movs r2, 0xE6 + lsls r2, 5 + add r2, sp + ldr r3, [r2] + cmp r5, r6 + blt _0804CB0C +_0804CB48: + adds r4, r7, 0 + cmp r4, r3 + blt _0804CB00 +_0804CB4E: + mov r3, r9 + movs r4, 0xE5 + lsls r4, 5 + add r4, sp + str r3, [r4] + ldr r0, _0804CBD8 + add r0, sp + ldr r7, [r0] + cmp r7, 0x1 + bgt _0804CB64 + b _0804CA3C +_0804CB64: + ldr r1, _0804CBCC + add r1, sp + ldr r0, [r1] + cmp r0, 0 + bgt _0804CB70 + b _0804CA22 +_0804CB70: + add r0, sp, 0x8 + movs r2, 0 + movs r1, 0x1 + strb r1, [r0, 0x16] + ldr r0, _0804CBE0 + add r0, sp + strb r1, [r0] + ldr r3, _0804CBB8 + add r3, sp + ldr r0, _0804CBBC + add r0, sp + str r0, [sp] + str r2, [sp, 0x4] + add r0, sp, 0x8 + movs r1, 0x2 + movs r2, 0x1 + bl sub_804D8C8 + ldr r3, _0804CBE4 + add r0, sp, 0x8 + movs r1, 0x2 + movs r2, 0x1 + bl sub_804EEE4 + ldr r3, _0804CBE8 + add sp, r3 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804CBB4: .4byte 0xffffe33c +_0804CBB8: .4byte 0x00001c28 +_0804CBBC: .4byte 0x00001c64 +_0804CBC0: .4byte 0x00001ca4 +_0804CBC4: .4byte 0x00001cac +_0804CBC8: .4byte 0x00001cb0 +_0804CBCC: .4byte 0x00001cbc +_0804CBD0: .4byte 0x00001cb4 +_0804CBD4: .4byte 0x00001ca8 +_0804CBD8: .4byte 0x00001cb8 +_0804CBDC: .4byte 0x0000fffc +_0804CBE0: .4byte 0x000001fd +_0804CBE4: .4byte 0x000003e7 +_0804CBE8: .4byte 0x00001cc4 + thumb_func_end sub_804C9D0 + + thumb_func_start sub_804CBEC +sub_804CBEC: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + str r0, [sp] + str r1, [sp, 0x4] + str r2, [sp, 0x8] + str r3, [sp, 0xC] + cmp r3, 0 + bne _0804CC06 + b _0804D006 +_0804CC06: + movs r5, 0 + cmp r5, r3 + blt _0804CC0E + b _0804D006 +_0804CC0E: + ldr r0, [sp, 0x4] + bl sub_8084100 + mov r9, r0 + ldr r0, [sp, 0x8] + bl sub_8084100 + mov r10, r0 + lsls r0, 5 + mov r2, r9 + lsls r1, r2, 4 + subs r1, r2 + lsls r1, 5 + ldr r3, [sp] + adds r1, r3 + adds r4, r0, r1 + ldrb r0, [r4, 0xA] + adds r5, 0x1 + str r5, [sp, 0x18] + cmp r0, 0 + bne _0804CC3A + b _0804CFFC +_0804CC3A: + ldrb r0, [r4, 0xB] + cmp r0, 0 + bne _0804CC42 + b _0804CFFC +_0804CC42: + ldrb r0, [r4, 0x8] + cmp r0, 0 + beq _0804CC4A + b _0804CFFC +_0804CC4A: + ldrb r0, [r4, 0x10] + cmp r0, 0 + beq _0804CC52 + b _0804CFFC +_0804CC52: + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0x4 + ldrsh r1, [r4, r2] + bl sub_808411C + adds r7, r0, 0 + movs r3, 0x2 + ldrsh r0, [r4, r3] + movs r2, 0x6 + ldrsh r1, [r4, r2] + bl sub_808411C + adds r6, r0, 0 + movs r0, 0x4 + bl sub_8084100 + lsls r0, 1 + mov r8, r0 + ldr r1, [sp, 0x8] + subs r1, 0x1 + movs r3, 0x2 + str r3, [sp, 0x10] + ldr r0, [sp, 0x4] + subs r0, 0x1 +_0804CC84: + mov r2, r8 + cmp r2, 0 + bne _0804CC92 + cmp r10, r1 + blt _0804CC92 + movs r3, 0x2 + mov r8, r3 +_0804CC92: + mov r2, r8 + cmp r2, 0x2 + bne _0804CCA0 + cmp r9, r0 + blt _0804CCA0 + movs r3, 0x4 + mov r8, r3 +_0804CCA0: + mov r2, r8 + cmp r2, 0x4 + bne _0804CCB0 + mov r3, r10 + cmp r3, 0 + bgt _0804CCB0 + movs r2, 0x6 + mov r8, r2 +_0804CCB0: + mov r3, r8 + cmp r3, 0x6 + bne _0804CCC0 + mov r2, r9 + cmp r2, 0 + bgt _0804CCC0 + movs r3, 0 + mov r8, r3 +_0804CCC0: + ldr r2, [sp, 0x10] + subs r2, 0x1 + str r2, [sp, 0x10] + cmp r2, 0 + bge _0804CC84 + adds r0, r7, 0 + adds r1, r6, 0 + bl sub_804954C + ldrb r5, [r0, 0x9] + ldr r1, _0804CCE0 + mov r3, r8 + lsls r0, r3, 2 + adds r4, r0, r1 + b _0804CCF0 + .align 2, 0 +_0804CCE0: .4byte gUnknown_80F4448 +_0804CCE4: + movs r1, 0 + ldrsh r0, [r4, r1] + adds r7, r0 + movs r2, 0x2 + ldrsh r0, [r4, r2] + adds r6, r0 +_0804CCF0: + adds r0, r7, 0 + adds r1, r6, 0 + bl sub_804954C + ldrb r0, [r0, 0x9] + cmp r5, r0 + beq _0804CCE4 + ldr r1, _0804CD08 + mov r3, r8 + lsls r0, r3, 2 + adds r4, r0, r1 + b _0804CD18 + .align 2, 0 +_0804CD08: .4byte gUnknown_80F4448 +_0804CD0C: + movs r1, 0 + ldrsh r0, [r4, r1] + adds r7, r0 + movs r2, 0x2 + ldrsh r0, [r4, r2] + adds r6, r0 +_0804CD18: + adds r0, r7, 0 + adds r1, r6, 0 + bl sub_804954C + ldrh r1, [r0] + movs r5, 0x3 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0x1 + beq _0804CD0C + adds r0, r7, 0 + adds r1, r6, 0 + bl sub_804954C + ldrh r1, [r0] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0x2 + bne _0804CD40 + b _0804CFFC +_0804CD40: + movs r3, 0 + subs r2, r7, 0x2 + adds r4, r7, 0x2 + b _0804CD4A +_0804CD48: + adds r2, 0x1 +_0804CD4A: + cmp r2, r4 + bgt _0804CD6C + subs r0, r6, 0x2 + adds r1, r6, 0x2 + b _0804CD56 +_0804CD54: + adds r0, 0x1 +_0804CD56: + cmp r0, r1 + bgt _0804CD68 + cmp r2, 0x37 + bhi _0804CD66 + cmp r0, 0 + blt _0804CD66 + cmp r0, 0x1F + ble _0804CD54 +_0804CD66: + movs r3, 0x1 +_0804CD68: + cmp r3, 0 + beq _0804CD48 +_0804CD6C: + cmp r3, 0 + beq _0804CD72 + b _0804CFFC +_0804CD72: + ldr r2, _0804CDD4 + mov r1, r8 + adds r1, 0x2 + movs r4, 0x6 + ands r1, r4 + lsls r1, 2 + adds r1, r2 + movs r3, 0 + ldrsh r0, [r1, r3] + movs r3, 0x2 + ldrsh r1, [r1, r3] + adds r0, r7, r0 + adds r1, r6, r1 + str r2, [sp, 0x1C] + bl sub_804954C + ldrh r1, [r0] + movs r5, 0x3 + adds r0, r5, 0 + ands r0, r1 + ldr r2, [sp, 0x1C] + cmp r0, 0x1 + bne _0804CDA2 + b _0804CFFC +_0804CDA2: + mov r1, r8 + subs r1, 0x2 + ands r1, r4 + lsls r1, 2 + adds r1, r2 + movs r2, 0 + ldrsh r0, [r1, r2] + movs r3, 0x2 + ldrsh r1, [r1, r3] + adds r0, r7, r0 + adds r1, r6, r1 + bl sub_804954C + ldrh r1, [r0] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0x1 + bne _0804CDC8 + b _0804CFFC +_0804CDC8: + movs r0, 0x3 + bl sub_8084100 + adds r0, 0x3 + str r0, [sp, 0x10] + b _0804CFD4 + .align 2, 0 +_0804CDD4: .4byte gUnknown_80F4448 +_0804CDD8: + adds r0, r7, 0 + adds r1, r6, 0 + bl sub_804954C + ldrh r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0804CDEC + b _0804CFFC +_0804CDEC: + movs r0, 0x1 + str r0, [sp, 0x14] + adds r4, r7, 0x1 + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_804954C + ldrh r1, [r0] + mov r0, r10 + ands r0, r1 + mov r9, r4 + cmp r0, 0x1 + bne _0804CE32 + adds r5, r6, 0x1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_804954C + ldrh r0, [r0] + mov r4, r10 + ands r4, r0 + cmp r4, 0x1 + bne _0804CE32 + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_804954C + ldrh r0, [r0] + mov r1, r10 + ands r0, r1 + eors r0, r4 + negs r1, r0 + orrs r1, r0 + lsrs r1, 31 + str r1, [sp, 0x14] +_0804CE32: + mov r0, r9 + adds r1, r6, 0 + bl sub_804954C + ldrh r1, [r0] + movs r5, 0x3 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0x1 + bne _0804CE70 + subs r4, r6, 0x1 + mov r0, r9 + adds r1, r4, 0 + bl sub_804954C + ldrh r1, [r0] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0x1 + bne _0804CE70 + adds r0, r7, 0 + adds r1, r4, 0 + bl sub_804954C + ldrh r1, [r0] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0x1 + bne _0804CE70 + movs r2, 0 + str r2, [sp, 0x14] +_0804CE70: + subs r4, r7, 0x1 + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_804954C + ldrh r1, [r0] + movs r2, 0x3 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0x1 + bne _0804CEB6 + adds r5, r6, 0x1 + adds r0, r4, 0 + adds r1, r5, 0 + str r2, [sp, 0x1C] + bl sub_804954C + ldrh r1, [r0] + ldr r2, [sp, 0x1C] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0x1 + bne _0804CEB6 + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_804954C + ldrh r1, [r0] + ldr r2, [sp, 0x1C] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0x1 + bne _0804CEB6 + movs r3, 0 + str r3, [sp, 0x14] +_0804CEB6: + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_804954C + ldrh r1, [r0] + movs r2, 0x3 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0x1 + bne _0804CEFA + subs r5, r6, 0x1 + adds r0, r4, 0 + adds r1, r5, 0 + str r2, [sp, 0x1C] + bl sub_804954C + ldrh r1, [r0] + ldr r2, [sp, 0x1C] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0x1 + bne _0804CEFA + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_804954C + ldrh r1, [r0] + ldr r2, [sp, 0x1C] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0x1 + bne _0804CEFA + movs r0, 0 + str r0, [sp, 0x14] +_0804CEFA: + ldr r1, [sp, 0x14] + cmp r1, 0 + beq _0804CF16 + adds r0, r7, 0 + adds r1, r6, 0 + bl sub_8049590 + ldrh r1, [r0] + ldr r3, _0804D018 + adds r2, r3, 0 + ands r1, r2 + movs r2, 0x1 + orrs r1, r2 + strh r1, [r0] +_0804CF16: + ldr r2, _0804D01C + movs r0, 0x2 + add r0, r8 + mov r9, r0 + movs r1, 0x6 + mov r10, r1 + mov r1, r9 + mov r3, r10 + ands r1, r3 + lsls r1, 2 + adds r1, r2 + movs r3, 0 + ldrsh r0, [r1, r3] + movs r3, 0x2 + ldrsh r1, [r1, r3] + adds r0, r7, r0 + adds r1, r6, r1 + str r2, [sp, 0x1C] + bl sub_804954C + ldrh r1, [r0] + movs r5, 0x3 + adds r0, r5, 0 + ands r0, r1 + ldr r2, [sp, 0x1C] + cmp r0, 0x1 + beq _0804CFFC + mov r4, r8 + subs r4, 0x2 + adds r1, r4, 0 + mov r0, r10 + ands r1, r0 + lsls r1, 2 + adds r1, r2 + movs r2, 0 + ldrsh r0, [r1, r2] + movs r3, 0x2 + ldrsh r1, [r1, r3] + adds r0, r7, r0 + adds r1, r6, r1 + bl sub_804954C + ldrh r1, [r0] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0x1 + beq _0804CFFC + ldr r0, [sp, 0x10] + subs r0, 0x1 + str r0, [sp, 0x10] + cmp r0, 0 + bne _0804CFC0 + movs r0, 0x3 + bl sub_8084100 + adds r0, 0x3 + str r0, [sp, 0x10] + movs r0, 0x64 + bl sub_8084100 + mov r8, r4 + cmp r0, 0x31 + bgt _0804CF96 + mov r8, r9 +_0804CF96: + mov r1, r8 + mov r2, r10 + ands r1, r2 + mov r8, r1 + cmp r7, 0x1F + ble _0804CFAE + ldr r0, _0804D020 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0804CFAE + cmp r1, 0x2 + beq _0804CFFC +_0804CFAE: + cmp r7, 0x2F + ble _0804CFC0 + ldr r0, _0804D020 + ldrb r0, [r0] + cmp r0, 0x2 + bne _0804CFC0 + mov r3, r8 + cmp r3, 0x2 + beq _0804CFFC +_0804CFC0: + ldr r0, _0804D01C + mov r2, r8 + lsls r1, r2, 2 + adds r1, r0 + movs r3, 0 + ldrsh r0, [r1, r3] + adds r7, r0 + movs r2, 0x2 + ldrsh r0, [r1, r2] + adds r6, r0 +_0804CFD4: + cmp r7, 0x1 + ble _0804CFFC + cmp r6, 0x1 + ble _0804CFFC + cmp r7, 0x36 + bgt _0804CFFC + cmp r6, 0x1E + bgt _0804CFFC + adds r0, r7, 0 + adds r1, r6, 0 + bl sub_804954C + ldrh r1, [r0] + movs r3, 0x3 + mov r10, r3 + mov r0, r10 + ands r0, r1 + cmp r0, 0x1 + beq _0804CFFC + b _0804CDD8 +_0804CFFC: + ldr r5, [sp, 0x18] + ldr r0, [sp, 0xC] + cmp r5, r0 + bge _0804D006 + b _0804CC0E +_0804D006: + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804D018: .4byte 0x0000fffc +_0804D01C: .4byte gUnknown_80F4448 +_0804D020: .4byte gUnknown_202F1AE + thumb_func_end sub_804CBEC + + thumb_func_start sub_804D024 +sub_804D024: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + mov r8, r1 + adds r5, r2, 0 + adds r6, r3, 0 + movs r4, 0 + cmp r4, r5 + bge _0804D04E + movs r0, 0x38 + adds r1, r5, 0 + bl __divsi3 + adds r2, r7, 0 + adds r1, r5, 0 +_0804D044: + stm r2!, {r4} + adds r4, r0 + subs r1, 0x1 + cmp r1, 0 + bne _0804D044 +_0804D04E: + lsls r0, r5, 2 + adds r0, r7 + str r4, [r0] + movs r4, 0 + lsls r5, r6, 2 + cmp r4, r6 + bge _0804D072 + movs r0, 0x20 + adds r1, r6, 0 + bl __divsi3 + mov r2, r8 + adds r1, r6, 0 +_0804D068: + stm r2!, {r4} + adds r4, r0 + subs r1, 0x1 + cmp r1, 0 + bne _0804D068 +_0804D072: + mov r1, r8 + adds r0, r5, r1 + str r4, [r0] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_804D024 + + thumb_func_start sub_804D084 +sub_804D084: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + mov r8, r0 + adds r5, r1, 0 + mov r9, r2 + movs r2, 0 + cmp r2, r5 + bge _0804D144 + lsrs r0, r5, 31 + adds r0, r5, r0 + asrs r0, 1 + str r0, [sp] + movs r3, 0 +_0804D0A6: + adds r0, r2, 0x1 + mov r10, r0 + mov r4, r9 + cmp r4, 0 + ble _0804D13E + ldr r6, _0804D0D8 + ldrb r6, [r6] + str r6, [sp, 0x4] + lsls r0, r2, 4 + subs r0, r2 + lsls r0, 5 + mov r4, r8 + adds r1, r0, r4 + movs r7, 0 + movs r6, 0x1 + mov r12, r6 + mov r4, r9 +_0804D0C8: + ldr r0, [sp, 0x4] + cmp r0, 0x1 + bne _0804D0DC + ldr r6, [sp] + cmp r2, r6 + blt _0804D0DC + strb r0, [r1, 0x8] + b _0804D102 + .align 2, 0 +_0804D0D8: .4byte gUnknown_202F1AE +_0804D0DC: + ldr r6, _0804D0FC + ldrb r0, [r6] + cmp r0, 0x2 + bne _0804D100 + lsls r0, r5, 1 + adds r0, r5 + cmp r0, 0 + bge _0804D0EE + adds r0, 0x3 +_0804D0EE: + asrs r0, 2 + cmp r2, r0 + blt _0804D100 + mov r0, r12 + strb r0, [r1, 0x8] + b _0804D102 + .align 2, 0 +_0804D0FC: .4byte gUnknown_202F1AE +_0804D100: + strb r3, [r1, 0x8] +_0804D102: + lsls r0, r2, 4 + subs r0, r2 + lsls r0, 5 + add r0, r8 + adds r0, r7, r0 + mov r6, r12 + strb r6, [r0, 0xA] + strb r3, [r0, 0xB] + strb r3, [r0, 0xF] + strb r3, [r0, 0xE] + strb r3, [r0, 0xC] + strb r3, [r0, 0x16] + strb r3, [r0, 0x15] + strb r3, [r0, 0x14] + strb r3, [r0, 0x13] + strb r3, [r0, 0x1A] + strb r3, [r0, 0x19] + strb r3, [r0, 0x18] + strb r3, [r0, 0x17] + strb r3, [r0, 0x9] + strb r3, [r0, 0x11] + strb r3, [r0, 0x10] + strb r3, [r0, 0x12] + strb r3, [r0, 0x1C] + strb r3, [r0, 0x1D] + adds r1, 0x20 + adds r7, 0x20 + subs r4, 0x1 + cmp r4, 0 + bne _0804D0C8 +_0804D13E: + mov r2, r10 + cmp r2, r5 + blt _0804D0A6 +_0804D144: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_804D084 + + thumb_func_start sub_804D154 +sub_804D154: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x114 + str r0, [sp, 0x100] + mov r9, r1 + mov r8, r2 + adds r4, r3, 0 + movs r0, 0x3 + bl sub_8084100 + adds r3, r0, 0 + cmp r4, 0 + bge _0804D17E + negs r4, r4 + b _0804D180 +_0804D178: + movs r0, 0x1 + strb r0, [r4, 0xA] + b _0804D2B6 +_0804D17E: + adds r4, r3 +_0804D180: + movs r3, 0 + mov r0, r8 + mov r2, r9 + muls r2, r0 + cmp r3, r4 + bge _0804D19A + movs r1, 0x1 +_0804D18E: + mov r5, sp + adds r0, r5, r3 + strb r1, [r0] + adds r3, 0x1 + cmp r3, r4 + blt _0804D18E +_0804D19A: + cmp r3, 0xFF + bgt _0804D1AC + movs r1, 0 +_0804D1A0: + mov r6, sp + adds r0, r6, r3 + strb r1, [r0] + adds r3, 0x1 + cmp r3, 0xFF + ble _0804D1A0 +_0804D1AC: + adds r5, r2, 0 + movs r6, 0x3F +_0804D1B0: + adds r0, r5, 0 + bl sub_8084100 + adds r4, r0, 0 + adds r0, r5, 0 + bl sub_8084100 + mov r1, sp + adds r2, r1, r4 + ldrb r3, [r2] + adds r1, r0 + ldrb r0, [r1] + strb r0, [r2] + strb r3, [r1] + subs r6, 0x1 + cmp r6, 0 + bge _0804D1B0 + movs r3, 0 + ldr r0, _0804D24C + str r3, [r0] + movs r7, 0 + mov r12, r0 + cmp r7, r9 + bge _0804D262 +_0804D1E0: + movs r5, 0 + adds r4, r7, 0x1 + str r4, [sp, 0x104] + cmp r5, r8 + bge _0804D25C + lsls r2, r7, 4 + subs r2, r7 + lsls r2, 5 + ldr r6, [sp, 0x100] + adds r0, r2, r6 + mov r1, r9 + movs r4, 0x1 + ands r1, r4 + str r1, [sp, 0x110] + mov r1, r9 + subs r1, 0x1 + adds r0, 0x20 + mov r10, r0 + adds r0, r6, 0 + adds r0, 0x8 + adds r2, r0 + lsrs r0, r1, 31 + adds r1, r0 + asrs r1, 1 +_0804D210: + ldrb r4, [r2] + cmp r4, 0 + bne _0804D254 + mov r6, r12 + ldr r0, [r6] + cmp r0, 0x1F + ble _0804D220 + strb r4, [r2, 0x2] +_0804D220: + mov r6, sp + adds r0, r6, r3 + ldrb r0, [r0] + cmp r0, 0 + beq _0804D250 + movs r0, 0x1 + strb r0, [r2, 0x2] + mov r6, r12 + ldr r0, [r6] + adds r0, 0x1 + str r0, [r6] + ldr r0, [sp, 0x110] + cmp r0, 0 + beq _0804D252 + cmp r7, r1 + bne _0804D252 + cmp r5, 0x1 + bne _0804D252 + mov r6, r10 + strb r4, [r6, 0xA] + b _0804D252 + .align 2, 0 +_0804D24C: .4byte gUnknown_202F1CC +_0804D250: + strb r0, [r2, 0x2] +_0804D252: + adds r3, 0x1 +_0804D254: + adds r2, 0x20 + adds r5, 0x1 + cmp r5, r8 + blt _0804D210 +_0804D25C: + ldr r7, [sp, 0x104] + cmp r7, r9 + blt _0804D1E0 +_0804D262: + mov r1, r12 + ldr r0, [r1] + cmp r0, 0x1 + bgt _0804D2BC + movs r1, 0 + movs r2, 0 +_0804D26E: + movs r7, 0 + cmp r2, r9 + bge _0804D2AC + movs r6, 0 +_0804D276: + movs r5, 0 + cmp r5, r8 + bge _0804D2A4 + lsls r0, r6, 5 + ldr r3, [sp, 0x100] + adds r4, r0, r3 +_0804D282: + ldrb r0, [r4, 0x8] + cmp r0, 0 + bne _0804D29C + movs r0, 0x64 + str r1, [sp, 0x108] + str r2, [sp, 0x10C] + bl sub_8084100 + ldr r1, [sp, 0x108] + ldr r2, [sp, 0x10C] + cmp r0, 0x3B + bgt _0804D29C + b _0804D178 +_0804D29C: + adds r4, 0x20 + adds r5, 0x1 + cmp r5, r8 + blt _0804D282 +_0804D2A4: + adds r6, 0xF + adds r7, 0x1 + cmp r7, r9 + blt _0804D276 +_0804D2AC: + cmp r2, 0 + bne _0804D2B6 + adds r1, 0x1 + cmp r1, 0xC7 + ble _0804D26E +_0804D2B6: + ldr r1, _0804D2CC + movs r0, 0 + strb r0, [r1] +_0804D2BC: + add sp, 0x114 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804D2CC: .4byte gUnknown_202F1AD + thumb_func_end sub_804D154 + + thumb_func_start sub_804D2D0 +sub_804D2D0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x38 + str r0, [sp] + str r1, [sp, 0x4] + str r2, [sp, 0x8] + str r3, [sp, 0xC] + movs r0, 0 + str r0, [sp, 0x10] + movs r1, 0 + str r1, [sp, 0x14] + cmp r1, r2 + blt _0804D2F2 + b _0804D520 +_0804D2F2: + movs r2, 0 + mov r10, r2 + ldr r3, [sp, 0x14] + adds r3, 0x1 + str r3, [sp, 0x28] + ldr r4, [sp, 0x4] + cmp r10, r4 + blt _0804D304 + b _0804D514 +_0804D304: + ldr r5, [sp, 0x14] + lsls r5, 5 + str r5, [sp, 0x1C] +_0804D30A: + mov r1, r10 + lsls r0, r1, 2 + ldr r2, [sp, 0xC] + adds r0, r2 + ldr r3, [r0] + adds r4, r3, 0x2 + mov r9, r4 + ldr r5, [sp, 0x14] + lsls r1, r5, 2 + ldr r2, [sp, 0x58] + adds r1, r2 + ldr r2, [r1] + adds r4, r2, 0x2 + str r4, [sp, 0x18] + ldr r0, [r0, 0x4] + subs r0, r3 + subs r4, r0, 0x4 + ldr r0, [r1, 0x4] + subs r0, r2 + subs r0, 0x3 + mov r8, r0 + mov r5, r10 + lsls r1, r5, 4 + subs r0, r1, r5 + lsls r0, 5 + ldr r2, [sp] + adds r0, r2 + ldr r3, [sp, 0x1C] + adds r7, r3, r0 + ldrb r0, [r7, 0x8] + str r1, [sp, 0x2C] + adds r5, 0x1 + str r5, [sp, 0x24] + cmp r0, 0 + beq _0804D352 + b _0804D508 +_0804D352: + ldrb r0, [r7, 0xA] + cmp r0, 0 + bne _0804D35A + b _0804D48C +_0804D35A: + movs r0, 0x5 + adds r1, r4, 0 + bl sub_808411C + adds r6, r0, 0 + movs r0, 0x4 + mov r1, r8 + bl sub_808411C + adds r5, r0, 0 + movs r1, 0x1 + adds r0, r6, 0 + orrs r0, r1 + cmp r0, r4 + bge _0804D37A + adds r6, r0, 0 +_0804D37A: + adds r0, r5, 0 + orrs r0, r1 + cmp r0, r8 + bge _0804D384 + adds r5, r0, 0 +_0804D384: + lsls r0, r5, 1 + adds r0, r5 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + cmp r6, r0 + ble _0804D394 + adds r6, r0, 0 +_0804D394: + lsls r0, r6, 1 + adds r0, r6 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + cmp r5, r0 + ble _0804D3A4 + adds r5, r0, 0 +_0804D3A4: + subs r0, r4, r6 + bl sub_8084100 + adds r4, r0, 0 + add r4, r9 + mov r1, r8 + subs r0, r1, r5 + bl sub_8084100 + ldr r2, [sp, 0x18] + adds r0, r2 + mov r8, r0 + adds r3, r4, r6 + adds r6, r0, r5 + strh r4, [r7] + strh r3, [r7, 0x4] + mov r5, r8 + strh r5, [r7, 0x2] + strh r6, [r7, 0x6] + ldr r0, [sp, 0x10] + adds r0, 0x1 + str r0, [sp, 0x20] + cmp r4, r3 + bge _0804D412 +_0804D3D4: + mov r5, r8 + adds r7, r4, 0x1 + cmp r5, r6 + bge _0804D40C + ldr r1, _0804D484 + mov r9, r1 +_0804D3E0: + adds r0, r4, 0 + adds r1, r5, 0 + str r3, [sp, 0x34] + bl sub_8049590 + ldrh r1, [r0] + mov r2, r9 + ands r1, r2 + movs r2, 0x1 + orrs r1, r2 + strh r1, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8049590 + mov r1, sp + ldrb r1, [r1, 0x10] + strb r1, [r0, 0x9] + adds r5, 0x1 + ldr r3, [sp, 0x34] + cmp r5, r6 + blt _0804D3E0 +_0804D40C: + adds r4, r7, 0 + cmp r4, r3 + blt _0804D3D4 +_0804D412: + movs r5, 0x1 + movs r0, 0x64 + bl sub_8084100 + movs r1, 0 + cmp r0, 0x4F + bgt _0804D422 + movs r1, 0x1 +_0804D422: + adds r4, r1, 0 + ldr r0, _0804D488 + ldr r0, [r0] + cmp r0, 0 + bne _0804D42E + movs r4, 0 +_0804D42E: + movs r0, 0x4 + ldr r2, [sp, 0x5C] + ands r0, r2 + cmp r0, 0 + bne _0804D43A + movs r5, 0 +_0804D43A: + cmp r5, 0 + beq _0804D466 + cmp r4, 0 + beq _0804D44E + movs r0, 0x64 + bl sub_8084100 + cmp r0, 0x31 + ble _0804D466 + movs r4, 0 +_0804D44E: + cmp r5, 0 + beq _0804D466 + ldr r3, [sp, 0x2C] + mov r5, r10 + subs r0, r3, r5 + lsls r0, 5 + ldr r1, [sp] + adds r0, r1 + ldr r2, [sp, 0x1C] + adds r0, r2, r0 + movs r1, 0x1 + strb r1, [r0, 0x1C] +_0804D466: + cmp r4, 0 + beq _0804D47E + ldr r3, [sp, 0x2C] + mov r4, r10 + subs r0, r3, r4 + lsls r0, 5 + ldr r5, [sp] + adds r0, r5 + ldr r1, [sp, 0x1C] + adds r0, r1, r0 + movs r1, 0x1 + strb r1, [r0, 0x1D] +_0804D47E: + ldr r2, [sp, 0x20] + str r2, [sp, 0x10] + b _0804D508 + .align 2, 0 +_0804D484: .4byte 0x0000fffc +_0804D488: .4byte gUnknown_202F1C8 +_0804D48C: + movs r1, 0x2 + movs r3, 0x4 + movs r6, 0x2 + movs r2, 0x4 + mov r5, r10 + cmp r5, 0 + bne _0804D49C + movs r1, 0x1 +_0804D49C: + ldr r0, [sp, 0x14] + cmp r0, 0 + bne _0804D4A4 + movs r6, 0x1 +_0804D4A4: + ldr r0, [sp, 0x4] + subs r0, 0x1 + cmp r10, r0 + bne _0804D4AE + movs r3, 0x2 +_0804D4AE: + ldr r0, [sp, 0x8] + subs r0, 0x1 + ldr r5, [sp, 0x14] + cmp r5, r0 + bne _0804D4BA + movs r2, 0x2 +_0804D4BA: + mov r5, r9 + adds r0, r5, r1 + adds r1, r5, r4 + subs r1, r3 + str r2, [sp, 0x30] + bl sub_808411C + adds r5, r0, 0 + ldr r1, [sp, 0x18] + adds r0, r1, r6 + add r1, r8 + ldr r2, [sp, 0x30] + subs r1, r2 + bl sub_808411C + adds r4, r0, 0 + strh r5, [r7] + adds r0, r5, 0x1 + strh r0, [r7, 0x4] + strh r4, [r7, 0x2] + adds r0, r4, 0x1 + strh r0, [r7, 0x6] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8049590 + ldrh r1, [r0] + ldr r3, _0804D530 + adds r2, r3, 0 + ands r1, r2 + movs r2, 0x1 + orrs r1, r2 + strh r1, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8049590 + movs r1, 0xFE + strb r1, [r0, 0x9] +_0804D508: + ldr r4, [sp, 0x24] + mov r10, r4 + ldr r5, [sp, 0x4] + cmp r10, r5 + bge _0804D514 + b _0804D30A +_0804D514: + ldr r0, [sp, 0x28] + str r0, [sp, 0x14] + ldr r1, [sp, 0x8] + cmp r0, r1 + bge _0804D520 + b _0804D2F2 +_0804D520: + add sp, 0x38 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804D530: .4byte 0x0000fffc + thumb_func_end sub_804D2D0 + + thumb_func_start sub_804D534 +sub_804D534: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + adds r3, r0, 0 + adds r7, r1, 0 + mov r9, r2 + movs r1, 0 + cmp r1, r9 + bge _0804D5A0 +_0804D54A: + adds r0, r1, 0x1 + mov r8, r0 + cmp r7, 0 + ble _0804D59A + lsls r1, 5 + adds r0, r1, 0 + adds r0, 0x8 + adds r4, r3, r0 + adds r5, r3, r1 + adds r6, r7, 0 +_0804D55E: + ldrb r0, [r4] + cmp r0, 0 + bne _0804D58C + ldrb r0, [r4, 0x6] + cmp r0, 0 + bne _0804D58C + ldrb r0, [r4, 0xA] + cmp r0, 0 + bne _0804D58C + ldrb r0, [r4, 0x2] + cmp r0, 0 + beq _0804D58C + ldrb r0, [r4, 0x14] + cmp r0, 0 + bne _0804D58C + ldrb r0, [r4, 0x15] + cmp r0, 0 + beq _0804D58C + adds r0, r5, 0 + str r3, [sp] + bl sub_804F694 + ldr r3, [sp] +_0804D58C: + movs r0, 0xF0 + lsls r0, 1 + adds r4, r0 + adds r5, r0 + subs r6, 0x1 + cmp r6, 0 + bne _0804D55E +_0804D59A: + mov r1, r8 + cmp r1, r9 + blt _0804D54A +_0804D5A0: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_804D534 + + thumb_func_start sub_804D5B0 +sub_804D5B0: + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x8 + mov r9, r0 + adds r4, r1, 0 + adds r5, r2, 0 + adds r6, r3, 0 + adds r0, r4, 0 + bl sub_8084100 + mov r8, r0 + adds r0, r5, 0 + bl sub_8084100 + str r0, [sp] + str r6, [sp, 0x4] + mov r0, r9 + adds r1, r4, 0 + adds r2, r5, 0 + mov r3, r8 + bl sub_804D5F0 + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_804D5B0 + + thumb_func_start sub_804D5F0 +sub_804D5F0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + str r0, [sp] + str r1, [sp, 0x4] + str r2, [sp, 0x8] + adds r7, r3, 0 + ldr r6, [sp, 0x40] + ldr r0, [sp, 0x44] + ldrb r0, [r0, 0x5] + str r0, [sp, 0xC] + movs r0, 0x4 + bl sub_8084100 + adds r5, r0, 0 + movs r1, 0 + mov r10, r1 + ldr r2, [sp, 0xC] + cmp r10, r2 + blt _0804D620 + b _0804D726 +_0804D620: + lsls r4, r6, 5 + mov r9, r4 + lsls r0, r7, 4 + subs r0, r7 + lsls r0, 5 + ldr r1, [sp] + adds r0, r1 + mov r8, r0 +_0804D630: + movs r0, 0x8 + bl sub_8084100 + adds r4, r0, 0 + movs r0, 0x4 + bl sub_8084100 + cmp r4, 0x3 + bgt _0804D644 + adds r5, r0, 0 +_0804D644: + mov r4, r10 + adds r4, 0x1 +_0804D648: + movs r1, 0 + movs r0, 0x3 + ands r0, r5 + cmp r0, 0x1 + beq _0804D670 + cmp r0, 0x1 + bgt _0804D65C + cmp r0, 0 + beq _0804D666 + b _0804D686 +_0804D65C: + cmp r0, 0x2 + beq _0804D676 + cmp r0, 0x3 + beq _0804D67C + b _0804D686 +_0804D666: + ldr r0, [sp, 0x4] + subs r0, 0x1 + cmp r7, r0 + blt _0804D68A + b _0804D684 +_0804D670: + cmp r6, 0 + bgt _0804D68A + b _0804D684 +_0804D676: + cmp r7, 0 + bgt _0804D68A + b _0804D684 +_0804D67C: + ldr r0, [sp, 0x8] + subs r0, 0x1 + cmp r6, r0 + blt _0804D68A +_0804D684: + adds r5, 0x1 +_0804D686: + cmp r1, 0 + beq _0804D648 +_0804D68A: + movs r1, 0x3 + ands r1, r5 + cmp r1, 0x1 + beq _0804D6C6 + cmp r1, 0x1 + bgt _0804D69C + cmp r1, 0 + beq _0804D6A6 + b _0804D71E +_0804D69C: + cmp r1, 0x2 + beq _0804D6E2 + cmp r1, 0x3 + beq _0804D704 + b _0804D71E +_0804D6A6: + mov r1, r9 + add r1, r8 + movs r0, 0xF0 + lsls r0, 1 + adds r2, r1, r0 + ldrb r0, [r2, 0x8] + cmp r0, 0 + bne _0804D71E + movs r0, 0x1 + strb r0, [r1, 0x16] + strb r0, [r2, 0x15] + movs r1, 0xF0 + lsls r1, 1 + add r8, r1 + adds r7, 0x1 + b _0804D71E +_0804D6C6: + mov r2, r9 + add r2, r8 + adds r3, r2, 0 + subs r3, 0x20 + ldrb r0, [r3, 0x8] + cmp r0, 0 + bne _0804D71E + strb r1, [r2, 0x13] + strb r1, [r3, 0x14] + movs r2, 0x20 + negs r2, r2 + add r9, r2 + subs r6, 0x1 + b _0804D71E +_0804D6E2: + mov r1, r9 + add r1, r8 + ldr r0, _0804D700 + adds r2, r1, r0 + ldrb r0, [r2, 0x8] + cmp r0, 0 + bne _0804D71E + movs r0, 0x1 + strb r0, [r1, 0x15] + strb r0, [r2, 0x16] + ldr r1, _0804D700 + add r8, r1 + subs r7, 0x1 + b _0804D71E + .align 2, 0 +_0804D700: .4byte 0xfffffe20 +_0804D704: + mov r1, r9 + add r1, r8 + adds r2, r1, 0 + adds r2, 0x20 + ldrb r0, [r2, 0x8] + cmp r0, 0 + bne _0804D71E + movs r0, 0x1 + strb r0, [r1, 0x14] + strb r0, [r2, 0x13] + movs r1, 0x20 + add r9, r1 + adds r6, 0x1 +_0804D71E: + mov r10, r4 + ldr r2, [sp, 0xC] + cmp r10, r2 + blt _0804D630 +_0804D726: + ldr r4, [sp, 0x44] + ldrb r0, [r4, 0xB] + cmp r0, 0 + beq _0804D730 + b _0804D8B8 +_0804D730: + movs r0, 0 + mov r9, r0 + movs r7, 0 + ldr r1, [sp, 0x4] + cmp r9, r1 + blt _0804D73E + b _0804D8B0 +_0804D73E: + movs r2, 0x1 + mov r8, r2 +_0804D742: + movs r6, 0 + adds r4, r7, 0x1 + str r4, [sp, 0x14] + ldr r0, [sp, 0x8] + cmp r6, r0 + blt _0804D750 + b _0804D8A6 +_0804D750: + lsls r1, r7, 4 + str r1, [sp, 0x10] + subs r0, r1, r7 + lsls r0, 5 + ldr r2, [sp] + adds r3, r0, r2 +_0804D75C: + lsls r0, r6, 5 + adds r2, r0, r3 + ldrb r1, [r2, 0x8] + adds r4, r0, 0 + adds r0, r6, 0x1 + str r0, [sp, 0x18] + cmp r1, 0 + beq _0804D76E + b _0804D89C +_0804D76E: + ldrb r0, [r2, 0xA] + cmp r0, 0 + beq _0804D776 + b _0804D89C +_0804D776: + ldrb r0, [r2, 0x13] + negs r1, r0 + orrs r1, r0 + lsrs r1, 31 + ldrb r0, [r2, 0x14] + cmp r0, 0 + beq _0804D786 + adds r1, 0x1 +_0804D786: + ldrb r0, [r2, 0x15] + cmp r0, 0 + beq _0804D78E + adds r1, 0x1 +_0804D78E: + ldrb r0, [r2, 0x16] + cmp r0, 0 + beq _0804D796 + adds r1, 0x1 +_0804D796: + cmp r1, 0x1 + beq _0804D79C + b _0804D89C +_0804D79C: + movs r0, 0x4 + str r3, [sp, 0x1C] + bl sub_8084100 + adds r5, r0, 0 + movs r2, 0 + mov r10, r2 + ldr r1, [sp, 0x10] + subs r0, r1, r7 + lsls r0, 5 + ldr r1, [sp] + adds r0, r1 + adds r1, r4, r0 + ldr r3, [sp, 0x1C] +_0804D7B8: + movs r0, 0x3 + ands r0, r5 + cmp r0, 0x1 + beq _0804D7E0 + cmp r0, 0x1 + bgt _0804D7CA + cmp r0, 0 + beq _0804D7D4 + b _0804D800 +_0804D7CA: + cmp r0, 0x2 + beq _0804D7E8 + cmp r0, 0x3 + beq _0804D7F0 + b _0804D800 +_0804D7D4: + ldr r0, [sp, 0x4] + subs r0, 0x1 + cmp r7, r0 + bge _0804D7FE + ldrb r0, [r1, 0x16] + b _0804D7FA +_0804D7E0: + cmp r6, 0 + ble _0804D7FE + ldrb r0, [r1, 0x13] + b _0804D7FA +_0804D7E8: + cmp r7, 0 + ble _0804D7FE + ldrb r0, [r1, 0x15] + b _0804D7FA +_0804D7F0: + ldr r0, [sp, 0x8] + subs r0, 0x1 + cmp r6, r0 + bge _0804D7FE + ldrb r0, [r1, 0x14] +_0804D7FA: + cmp r0, 0 + beq _0804D80E +_0804D7FE: + adds r5, 0x1 +_0804D800: + mov r0, r10 + cmp r0, 0 + bne _0804D80E + adds r2, 0x1 + cmp r2, 0x7 + ble _0804D7B8 + b _0804D89C +_0804D80E: + movs r2, 0x3 + ands r2, r5 + cmp r2, 0x1 + beq _0804D844 + cmp r2, 0x1 + bgt _0804D820 + cmp r2, 0 + beq _0804D82A + b _0804D89C +_0804D820: + cmp r2, 0x2 + beq _0804D85C + cmp r2, 0x3 + beq _0804D880 + b _0804D89C +_0804D82A: + adds r1, r4, r3 + movs r4, 0xF0 + lsls r4, 1 + adds r2, r1, r4 + ldrb r0, [r2, 0x8] + cmp r0, 0 + bne _0804D89C + mov r0, r8 + strb r0, [r1, 0x16] + strb r0, [r2, 0x15] + movs r1, 0x1 + mov r9, r1 + b _0804D89C +_0804D844: + adds r1, r4, r3 + movs r4, 0xF0 + lsls r4, 1 + adds r0, r1, r4 + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _0804D89C + strb r2, [r1, 0x13] + adds r0, r1, 0 + subs r0, 0x20 + strb r2, [r0, 0x14] + b _0804D898 +_0804D85C: + adds r1, r4, r3 + movs r2, 0xF0 + lsls r2, 1 + adds r0, r1, r2 + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _0804D89C + mov r4, r8 + strb r4, [r1, 0x15] + ldr r2, _0804D87C + adds r0, r1, r2 + strb r4, [r0, 0x16] + movs r4, 0x1 + mov r9, r4 + b _0804D89C + .align 2, 0 +_0804D87C: .4byte 0xfffffe20 +_0804D880: + adds r1, r4, r3 + movs r2, 0xF0 + lsls r2, 1 + adds r0, r1, r2 + ldrb r0, [r0, 0x8] + cmp r0, 0 + bne _0804D89C + mov r4, r8 + strb r4, [r1, 0x14] + adds r0, r1, 0 + adds r0, 0x20 + strb r4, [r0, 0x13] +_0804D898: + movs r0, 0x1 + mov r9, r0 +_0804D89C: + ldr r6, [sp, 0x18] + ldr r1, [sp, 0x8] + cmp r6, r1 + bge _0804D8A6 + b _0804D75C +_0804D8A6: + ldr r7, [sp, 0x14] + ldr r2, [sp, 0x4] + cmp r7, r2 + bge _0804D8B0 + b _0804D742 +_0804D8B0: + mov r4, r9 + cmp r4, 0 + beq _0804D8B8 + b _0804D730 +_0804D8B8: + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_804D5F0 + + thumb_func_start sub_804D8C8 +sub_804D8C8: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x58 + str r0, [sp, 0xC] + str r1, [sp, 0x10] + str r2, [sp, 0x14] + str r3, [sp, 0x18] + ldr r0, [sp, 0x7C] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x1C] + movs r0, 0 + str r0, [sp, 0x20] + cmp r0, r1 + bge _0804D968 +_0804D8EC: + movs r1, 0 + mov r10, r1 + ldr r2, [sp, 0x20] + adds r2, 0x1 + str r2, [sp, 0x38] + ldr r3, [sp, 0x14] + cmp r10, r3 + bge _0804D95E + ldr r4, [sp, 0x20] + lsls r1, r4, 4 + subs r1, r4 + movs r3, 0 + lsls r1, 5 + ldr r0, [sp, 0xC] + adds r0, 0x8 + adds r1, r0 +_0804D90C: + ldrb r2, [r1] + cmp r2, 0 + beq _0804D91C + strb r3, [r1, 0xF] + strb r3, [r1, 0x10] + strb r3, [r1, 0x11] + strb r3, [r1, 0x12] + b _0804D952 +_0804D91C: + ldr r5, [sp, 0x20] + cmp r5, 0 + bgt _0804D924 + strb r2, [r1, 0xD] +_0804D924: + mov r6, r10 + cmp r6, 0 + bgt _0804D92C + strb r2, [r1, 0xB] +_0804D92C: + ldr r0, [sp, 0x10] + subs r0, 0x1 + ldr r7, [sp, 0x20] + cmp r7, r0 + blt _0804D938 + strb r2, [r1, 0xE] +_0804D938: + ldr r0, [sp, 0x14] + subs r0, 0x1 + cmp r10, r0 + blt _0804D942 + strb r2, [r1, 0xC] +_0804D942: + ldrb r0, [r1, 0xB] + strb r0, [r1, 0xF] + ldrb r0, [r1, 0xC] + strb r0, [r1, 0x10] + ldrb r0, [r1, 0xD] + strb r0, [r1, 0x11] + ldrb r0, [r1, 0xE] + strb r0, [r1, 0x12] +_0804D952: + adds r1, 0x20 + movs r0, 0x1 + add r10, r0 + ldr r2, [sp, 0x14] + cmp r10, r2 + blt _0804D90C +_0804D95E: + ldr r3, [sp, 0x38] + str r3, [sp, 0x20] + ldr r4, [sp, 0x10] + cmp r3, r4 + blt _0804D8EC +_0804D968: + movs r5, 0 + str r5, [sp, 0x20] + ldr r6, [sp, 0x10] + cmp r5, r6 + blt _0804D974 + b _0804DBC6 +_0804D974: + movs r7, 0 + mov r10, r7 + ldr r0, [sp, 0x20] + adds r0, 0x1 + str r0, [sp, 0x38] + ldr r1, [sp, 0x14] + cmp r10, r1 + blt _0804D986 + b _0804DBBA +_0804D986: + ldr r2, [sp, 0x20] + lsls r2, 4 + str r2, [sp, 0x40] + ldr r3, [sp, 0x20] + subs r1, r2, r3 + lsls r1, 5 + movs r4, 0 + str r4, [sp, 0x48] + ldr r5, [sp, 0xC] + movs r6, 0xF0 + lsls r6, 1 + adds r0, r5, r6 + adds r0, r1 + mov r8, r0 + adds r5, r1, r5 + ldr r7, [sp, 0xC] + ldr r2, _0804DA0C + adds r0, r7, r2 + adds r7, r1, r0 + ldr r3, [sp, 0x78] + str r3, [sp, 0x4C] + ldr r0, [sp, 0xC] + adds r0, 0x20 + adds r0, r1, r0 + str r0, [sp, 0x50] + ldr r0, [sp, 0xC] + subs r0, 0x20 + adds r6, r1, r0 + ldr r4, [sp, 0x20] + lsls r0, r4, 2 + ldr r1, [sp, 0x18] + adds r0, r1 + str r0, [sp, 0x24] +_0804D9C8: + ldr r2, [sp, 0x20] + lsls r0, r2, 4 + subs r0, r2 + lsls r0, 5 + ldr r3, [sp, 0xC] + adds r0, r3 + ldr r1, [sp, 0x48] + adds r4, r1, r0 + ldrb r0, [r4, 0x8] + cmp r0, 0 + beq _0804D9E0 + b _0804DB92 +_0804D9E0: + ldrb r0, [r4, 0xA] + cmp r0, 0 + beq _0804DA10 + movs r2, 0 + ldrsh r0, [r4, r2] + adds r0, 0x1 + movs r3, 0x4 + ldrsh r1, [r4, r3] + subs r1, 0x1 + bl sub_808411C + mov r9, r0 + movs r1, 0x2 + ldrsh r0, [r4, r1] + adds r0, 0x1 + movs r2, 0x6 + ldrsh r1, [r4, r2] + subs r1, 0x1 + bl sub_808411C + adds r4, r0, 0 + b _0804DA1A + .align 2, 0 +_0804DA0C: .4byte 0xfffffe20 +_0804DA10: + movs r0, 0 + ldrsh r3, [r4, r0] + mov r9, r3 + movs r1, 0x2 + ldrsh r4, [r4, r1] +_0804DA1A: + ldrb r0, [r5, 0x17] + cmp r0, 0 + beq _0804DA74 + ldrb r0, [r6, 0x8] + cmp r0, 0 + bne _0804DA68 + ldrb r0, [r6, 0xA] + cmp r0, 0 + beq _0804DA40 + movs r2, 0 + ldrsh r0, [r6, r2] + adds r0, 0x1 + movs r3, 0x4 + ldrsh r1, [r6, r3] + subs r1, 0x1 + bl sub_808411C + adds r2, r0, 0 + b _0804DA44 +_0804DA40: + movs r0, 0 + ldrsh r2, [r6, r0] +_0804DA44: + movs r3, 0x2 + ldrsh r1, [r5, r3] + movs r0, 0x6 + ldrsh r3, [r6, r0] + subs r3, 0x1 + mov r12, r3 + movs r3, 0x1 + str r3, [sp] + ldr r3, [sp, 0x24] + ldr r0, [r3] + str r0, [sp, 0x4] + ldr r3, [sp, 0x4C] + ldr r0, [r3] + str r0, [sp, 0x8] + mov r0, r9 + mov r3, r12 + bl sub_804E328 +_0804DA68: + movs r0, 0 + strb r0, [r5, 0x17] + strb r0, [r6, 0x18] + movs r1, 0x1 + strb r1, [r5, 0xB] + strb r1, [r6, 0xB] +_0804DA74: + ldrb r0, [r5, 0x18] + cmp r0, 0 + beq _0804DAD4 + ldr r2, [sp, 0x50] + ldrb r0, [r2, 0x8] + cmp r0, 0 + bne _0804DAC6 + ldrb r0, [r2, 0xA] + cmp r0, 0 + beq _0804DA9C + movs r3, 0x20 + ldrsh r0, [r5, r3] + adds r0, 0x1 + movs r2, 0x24 + ldrsh r1, [r5, r2] + subs r1, 0x1 + bl sub_808411C + adds r2, r0, 0 + b _0804DAA0 +_0804DA9C: + movs r3, 0x20 + ldrsh r2, [r5, r3] +_0804DAA0: + movs r0, 0x6 + ldrsh r1, [r5, r0] + subs r1, 0x1 + movs r0, 0x22 + ldrsh r3, [r5, r0] + mov r12, r3 + movs r3, 0x1 + str r3, [sp] + ldr r3, [sp, 0x24] + ldr r0, [r3] + str r0, [sp, 0x4] + ldr r3, [sp, 0x4C] + ldr r0, [r3, 0x4] + subs r0, 0x1 + str r0, [sp, 0x8] + mov r0, r9 + mov r3, r12 + bl sub_804E328 +_0804DAC6: + movs r0, 0 + strb r0, [r5, 0x18] + ldr r1, [sp, 0x50] + strb r0, [r1, 0x17] + movs r2, 0x1 + strb r2, [r5, 0xB] + strb r2, [r1, 0xB] +_0804DAD4: + ldrb r0, [r5, 0x19] + cmp r0, 0 + beq _0804DB2E + ldrb r0, [r7, 0x8] + cmp r0, 0 + bne _0804DB22 + ldrb r0, [r7, 0xA] + cmp r0, 0 + beq _0804DAFA + movs r3, 0x2 + ldrsh r0, [r7, r3] + adds r0, 0x1 + movs r2, 0x6 + ldrsh r1, [r7, r2] + subs r1, 0x1 + bl sub_808411C + adds r3, r0, 0 + b _0804DAFE +_0804DAFA: + movs r0, 0x2 + ldrsh r3, [r7, r0] +_0804DAFE: + movs r1, 0 + ldrsh r0, [r5, r1] + movs r1, 0 + ldrsh r2, [r7, r1] + subs r2, 0x1 + mov r9, r2 + movs r2, 0 + str r2, [sp] + ldr r2, [sp, 0x24] + ldr r1, [r2] + str r1, [sp, 0x4] + ldr r2, [sp, 0x4C] + ldr r1, [r2] + str r1, [sp, 0x8] + adds r1, r4, 0 + mov r2, r9 + bl sub_804E328 +_0804DB22: + movs r3, 0 + strb r3, [r5, 0x19] + strb r3, [r7, 0x1A] + movs r0, 0x1 + strb r0, [r5, 0xB] + strb r0, [r7, 0xB] +_0804DB2E: + ldrb r0, [r5, 0x1A] + cmp r0, 0 + beq _0804DB92 + mov r1, r8 + ldrb r0, [r1, 0x8] + cmp r0, 0 + bne _0804DB84 + ldrb r0, [r1, 0xA] + cmp r0, 0 + beq _0804DB56 + movs r2, 0x2 + ldrsh r0, [r1, r2] + adds r0, 0x1 + movs r3, 0x6 + ldrsh r1, [r1, r3] + subs r1, 0x1 + bl sub_808411C + adds r3, r0, 0 + b _0804DB5C +_0804DB56: + mov r0, r8 + movs r1, 0x2 + ldrsh r3, [r0, r1] +_0804DB5C: + movs r2, 0x4 + ldrsh r0, [r5, r2] + subs r0, 0x1 + mov r1, r8 + movs r2, 0 + ldrsh r1, [r1, r2] + mov r9, r1 + movs r1, 0 + str r1, [sp] + ldr r2, [sp, 0x24] + ldr r1, [r2, 0x4] + subs r1, 0x1 + str r1, [sp, 0x4] + ldr r2, [sp, 0x4C] + ldr r1, [r2] + str r1, [sp, 0x8] + adds r1, r4, 0 + mov r2, r9 + bl sub_804E328 +_0804DB84: + movs r3, 0 + strb r3, [r5, 0x1A] + mov r4, r8 + strb r3, [r4, 0x19] + movs r0, 0x1 + strb r0, [r5, 0xB] + strb r0, [r4, 0xB] +_0804DB92: + ldr r1, [sp, 0x48] + adds r1, 0x20 + str r1, [sp, 0x48] + movs r2, 0x20 + add r8, r2 + adds r5, 0x20 + adds r7, 0x20 + ldr r3, [sp, 0x4C] + adds r3, 0x4 + str r3, [sp, 0x4C] + ldr r4, [sp, 0x50] + adds r4, 0x20 + str r4, [sp, 0x50] + adds r6, 0x20 + movs r0, 0x1 + add r10, r0 + ldr r1, [sp, 0x14] + cmp r10, r1 + bge _0804DBBA + b _0804D9C8 +_0804DBBA: + ldr r2, [sp, 0x38] + str r2, [sp, 0x20] + ldr r3, [sp, 0x10] + cmp r2, r3 + bge _0804DBC6 + b _0804D974 +_0804DBC6: + ldr r4, [sp, 0x1C] + cmp r4, 0 + beq _0804DBCE + b _0804E026 +_0804DBCE: + movs r5, 0 + str r5, [sp, 0x20] + ldr r6, [sp, 0x10] + cmp r5, r6 + blt _0804DBDA + b _0804E026 +_0804DBDA: + movs r7, 0 + mov r10, r7 + ldr r0, [sp, 0x20] + adds r0, 0x1 + str r0, [sp, 0x38] + ldr r1, [sp, 0x14] + cmp r10, r1 + blt _0804DBEC + b _0804E018 +_0804DBEC: + movs r0, 0x64 + bl sub_8084100 + mov r2, r10 + adds r2, 0x1 + str r2, [sp, 0x3C] + cmp r0, 0x4 + ble _0804DBFE + b _0804E00C +_0804DBFE: + mov r3, r10 + lsls r1, r3, 5 + ldr r4, [sp, 0x20] + lsls r2, r4, 4 + subs r0, r2, r4 + lsls r0, 5 + ldr r5, [sp, 0xC] + adds r0, r5 + adds r4, r1, r0 + ldrb r0, [r4, 0x8] + str r1, [sp, 0x44] + str r2, [sp, 0x40] + cmp r0, 0 + beq _0804DC1C + b _0804E00C +_0804DC1C: + ldrb r0, [r4, 0xB] + cmp r0, 0 + bne _0804DC24 + b _0804E00C +_0804DC24: + ldrb r0, [r4, 0x12] + cmp r0, 0 + beq _0804DC2C + b _0804E00C +_0804DC2C: + ldrb r0, [r4, 0x9] + cmp r0, 0 + beq _0804DC34 + b _0804E00C +_0804DC34: + ldrb r0, [r4, 0xA] + cmp r0, 0 + bne _0804DC3C + b _0804E00C +_0804DC3C: + movs r0, 0x4 + bl sub_8084100 + cmp r0, 0x1 + bne _0804DC48 + b _0804DD50 +_0804DC48: + cmp r0, 0x1 + bgt _0804DC52 + cmp r0, 0 + beq _0804DC60 + b _0804E00C +_0804DC52: + cmp r0, 0x2 + bne _0804DC58 + b _0804DE3C +_0804DC58: + cmp r0, 0x3 + bne _0804DC5E + b _0804DF30 +_0804DC5E: + b _0804E00C +_0804DC60: + ldr r6, [sp, 0x20] + cmp r6, 0 + bgt _0804DC68 + b _0804E00C +_0804DC68: + ldr r7, _0804DD48 + adds r2, r4, r7 + ldrb r0, [r2, 0xB] + cmp r0, 0 + bne _0804DC74 + b _0804E00C +_0804DC74: + ldrb r0, [r2, 0x8] + cmp r0, 0 + beq _0804DC7C + b _0804E00C +_0804DC7C: + ldrb r0, [r2, 0xA] + cmp r0, 0 + bne _0804DC84 + b _0804E00C +_0804DC84: + ldrb r0, [r2, 0x9] + cmp r0, 0 + beq _0804DC8C + b _0804E00C +_0804DC8C: + ldrb r0, [r2, 0x12] + cmp r0, 0 + beq _0804DC94 + b _0804E00C +_0804DC94: + movs r1, 0 + ldrsh r0, [r2, r1] + str r0, [sp, 0x28] + ldrh r3, [r4, 0x2] + movs r5, 0x2 + ldrsh r1, [r4, r5] + ldrh r5, [r2, 0x2] + movs r6, 0x2 + ldrsh r0, [r2, r6] + cmp r1, r0 + ble _0804DCAC + adds r3, r5, 0 +_0804DCAC: + lsls r0, r3, 16 + asrs r0, 16 + mov r9, r0 + movs r0, 0x4 + ldrsh r7, [r4, r0] + mov r10, r7 + ldrh r3, [r4, 0x6] + movs r5, 0x6 + ldrsh r1, [r4, r5] + ldrh r5, [r2, 0x6] + movs r6, 0x6 + ldrsh r0, [r2, r6] + cmp r1, r0 + bge _0804DCCA + adds r3, r5, 0 +_0804DCCA: + lsls r0, r3, 16 + asrs r7, r0, 16 + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl sub_804954C + ldrb r0, [r0, 0x9] + mov r8, r0 + ldr r5, [sp, 0x28] + cmp r5, r10 + bge _0804DD16 +_0804DCE4: + mov r4, r9 + adds r6, r5, 0x1 + cmp r9, r7 + bge _0804DD10 + ldr r0, _0804DD4C + adds r3, r0, 0 +_0804DCF0: + adds r0, r5, 0 + adds r1, r4, 0 + str r3, [sp, 0x54] + bl sub_8049590 + ldrh r1, [r0] + ldr r3, [sp, 0x54] + ands r1, r3 + movs r2, 0x1 + orrs r1, r2 + strh r1, [r0] + mov r1, r8 + strb r1, [r0, 0x9] + adds r4, 0x1 + cmp r4, r7 + blt _0804DCF0 +_0804DD10: + adds r5, r6, 0 + cmp r5, r10 + blt _0804DCE4 +_0804DD16: + ldr r2, [sp, 0x40] + ldr r3, [sp, 0x20] + subs r0, r2, r3 + lsls r0, 5 + ldr r4, [sp, 0xC] + adds r0, r4 + ldr r5, [sp, 0x44] + adds r0, r5, r0 + ldr r6, _0804DD48 + adds r3, r0, r6 + mov r1, sp + ldrh r1, [r1, 0x28] + strh r1, [r3] + mov r2, r10 + strh r2, [r3, 0x4] + mov r4, r9 + strh r4, [r3, 0x2] + strh r7, [r3, 0x6] + movs r5, 0x1 + strb r5, [r0, 0x12] + strb r5, [r3, 0x12] + movs r6, 0 + strb r6, [r0, 0xB] + strb r5, [r0, 0x11] + b _0804E00C + .align 2, 0 +_0804DD48: .4byte 0xfffffe20 +_0804DD4C: .4byte 0x0000fffc +_0804DD50: + mov r7, r10 + cmp r7, 0 + bgt _0804DD58 + b _0804E00C +_0804DD58: + adds r2, r4, 0 + subs r2, 0x20 + ldrb r0, [r2, 0xB] + cmp r0, 0 + bne _0804DD64 + b _0804E00C +_0804DD64: + ldrb r0, [r2, 0x8] + cmp r0, 0 + beq _0804DD6C + b _0804E00C +_0804DD6C: + ldrb r0, [r2, 0xA] + cmp r0, 0 + bne _0804DD74 + b _0804E00C +_0804DD74: + ldrb r0, [r2, 0x9] + cmp r0, 0 + beq _0804DD7C + b _0804E00C +_0804DD7C: + ldrb r0, [r2, 0x12] + cmp r0, 0 + beq _0804DD84 + b _0804E00C +_0804DD84: + ldrh r3, [r4] + movs r0, 0 + ldrsh r1, [r4, r0] + ldrh r5, [r2] + movs r6, 0 + ldrsh r0, [r2, r6] + cmp r1, r0 + ble _0804DD96 + adds r3, r5, 0 +_0804DD96: + lsls r0, r3, 16 + asrs r0, 16 + str r0, [sp, 0x2C] + movs r0, 0x2 + ldrsh r7, [r2, r0] + mov r10, r7 + ldrh r3, [r4, 0x4] + movs r5, 0x4 + ldrsh r1, [r4, r5] + ldrh r5, [r2, 0x4] + movs r6, 0x4 + ldrsh r0, [r2, r6] + cmp r1, r0 + bge _0804DDB4 + adds r3, r5, 0 +_0804DDB4: + lsls r0, r3, 16 + asrs r0, 16 + mov r8, r0 + movs r0, 0x6 + ldrsh r7, [r4, r0] + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl sub_804954C + ldrb r0, [r0, 0x9] + mov r9, r0 + ldr r5, [sp, 0x2C] + cmp r5, r8 + bge _0804DE06 +_0804DDD4: + mov r4, r10 + adds r6, r5, 0x1 + cmp r10, r7 + bge _0804DE00 + ldr r0, _0804DE38 + adds r3, r0, 0 +_0804DDE0: + adds r0, r5, 0 + adds r1, r4, 0 + str r3, [sp, 0x54] + bl sub_8049590 + ldrh r1, [r0] + ldr r3, [sp, 0x54] + ands r1, r3 + movs r2, 0x1 + orrs r1, r2 + strh r1, [r0] + mov r1, r9 + strb r1, [r0, 0x9] + adds r4, 0x1 + cmp r4, r7 + blt _0804DDE0 +_0804DE00: + adds r5, r6, 0 + cmp r5, r8 + blt _0804DDD4 +_0804DE06: + ldr r2, [sp, 0x40] + ldr r3, [sp, 0x20] + subs r0, r2, r3 + lsls r0, 5 + ldr r4, [sp, 0xC] + adds r0, r4 + ldr r5, [sp, 0x44] + adds r0, r5, r0 + adds r3, r0, 0 + subs r3, 0x20 + mov r6, sp + ldrh r6, [r6, 0x2C] + strh r6, [r3] + mov r1, r8 + strh r1, [r3, 0x4] + mov r2, r10 + strh r2, [r3, 0x2] + strh r7, [r3, 0x6] + movs r4, 0x1 + strb r4, [r0, 0x12] + strb r4, [r3, 0x12] + movs r5, 0 + strb r5, [r0, 0xB] + strb r4, [r0, 0x11] + b _0804E00C + .align 2, 0 +_0804DE38: .4byte 0x0000fffc +_0804DE3C: + ldr r0, [sp, 0x10] + subs r0, 0x2 + ldr r6, [sp, 0x20] + cmp r6, r0 + ble _0804DE48 + b _0804E00C +_0804DE48: + movs r7, 0xF0 + lsls r7, 1 + adds r2, r4, r7 + ldrb r0, [r2, 0xB] + cmp r0, 0 + bne _0804DE56 + b _0804E00C +_0804DE56: + ldrb r0, [r2, 0x8] + cmp r0, 0 + beq _0804DE5E + b _0804E00C +_0804DE5E: + ldrb r0, [r2, 0xA] + cmp r0, 0 + bne _0804DE66 + b _0804E00C +_0804DE66: + ldrb r0, [r2, 0x9] + cmp r0, 0 + beq _0804DE6E + b _0804E00C +_0804DE6E: + ldrb r0, [r2, 0x12] + cmp r0, 0 + beq _0804DE76 + b _0804E00C +_0804DE76: + movs r1, 0 + ldrsh r0, [r4, r1] + str r0, [sp, 0x30] + ldrh r3, [r2, 0x2] + movs r5, 0x2 + ldrsh r1, [r2, r5] + ldrh r5, [r4, 0x2] + movs r6, 0x2 + ldrsh r0, [r4, r6] + cmp r1, r0 + ble _0804DE8E + adds r3, r5, 0 +_0804DE8E: + lsls r0, r3, 16 + asrs r0, 16 + mov r9, r0 + movs r0, 0x4 + ldrsh r7, [r2, r0] + mov r10, r7 + ldrh r3, [r2, 0x6] + movs r5, 0x6 + ldrsh r1, [r2, r5] + ldrh r2, [r4, 0x6] + movs r6, 0x6 + ldrsh r0, [r4, r6] + cmp r1, r0 + bge _0804DEAC + adds r3, r2, 0 +_0804DEAC: + lsls r0, r3, 16 + asrs r7, r0, 16 + movs r0, 0x2 + ldrsh r1, [r4, r0] + ldr r0, [sp, 0x30] + bl sub_804954C + ldrb r0, [r0, 0x9] + mov r8, r0 + ldr r5, [sp, 0x30] + cmp r5, r10 + bge _0804DEF6 +_0804DEC4: + mov r4, r9 + adds r6, r5, 0x1 + cmp r9, r7 + bge _0804DEF0 + ldr r1, _0804DF2C + adds r3, r1, 0 +_0804DED0: + adds r0, r5, 0 + adds r1, r4, 0 + str r3, [sp, 0x54] + bl sub_8049590 + ldrh r1, [r0] + ldr r3, [sp, 0x54] + ands r1, r3 + movs r2, 0x1 + orrs r1, r2 + strh r1, [r0] + mov r2, r8 + strb r2, [r0, 0x9] + adds r4, 0x1 + cmp r4, r7 + blt _0804DED0 +_0804DEF0: + adds r5, r6, 0 + cmp r5, r10 + blt _0804DEC4 +_0804DEF6: + ldr r3, [sp, 0x40] + ldr r4, [sp, 0x20] + subs r0, r3, r4 + lsls r0, 5 + ldr r5, [sp, 0xC] + adds r0, r5 + ldr r6, [sp, 0x44] + adds r0, r6, r0 + mov r1, sp + ldrh r1, [r1, 0x30] + strh r1, [r0] + mov r2, r10 + strh r2, [r0, 0x4] + mov r3, r9 + strh r3, [r0, 0x2] + strh r7, [r0, 0x6] + movs r4, 0xF0 + lsls r4, 1 + adds r1, r0, r4 + movs r5, 0x1 + strb r5, [r1, 0x12] + strb r5, [r0, 0x12] + movs r6, 0 + strb r6, [r1, 0xB] + strb r5, [r1, 0x11] + b _0804E00C + .align 2, 0 +_0804DF2C: .4byte 0x0000fffc +_0804DF30: + ldr r0, [sp, 0x14] + subs r0, 0x2 + cmp r10, r0 + bgt _0804E00C + adds r3, r4, 0 + adds r3, 0x20 + ldrb r0, [r3, 0xB] + cmp r0, 0 + beq _0804E00C + ldrb r0, [r3, 0x8] + cmp r0, 0 + bne _0804E00C + ldrb r0, [r3, 0xA] + cmp r0, 0 + beq _0804E00C + ldrb r0, [r3, 0x9] + cmp r0, 0 + bne _0804E00C + ldrb r0, [r3, 0x12] + cmp r0, 0 + bne _0804E00C + ldrh r2, [r4, 0x20] + movs r7, 0x20 + ldrsh r1, [r4, r7] + ldrh r5, [r4] + movs r6, 0 + ldrsh r0, [r4, r6] + cmp r1, r0 + ble _0804DF6C + adds r2, r5, 0 +_0804DF6C: + lsls r0, r2, 16 + asrs r0, 16 + str r0, [sp, 0x34] + movs r7, 0x2 + ldrsh r6, [r4, r7] + ldrh r2, [r3, 0x4] + movs r0, 0x4 + ldrsh r1, [r3, r0] + ldrh r5, [r4, 0x4] + movs r7, 0x4 + ldrsh r0, [r4, r7] + cmp r1, r0 + bge _0804DF88 + adds r2, r5, 0 +_0804DF88: + lsls r0, r2, 16 + asrs r0, 16 + mov r8, r0 + movs r0, 0x6 + ldrsh r3, [r3, r0] + movs r1, 0 + ldrsh r0, [r4, r1] + adds r1, r6, 0 + str r3, [sp, 0x54] + bl sub_804954C + ldrb r0, [r0, 0x9] + mov r10, r0 + ldr r5, [sp, 0x34] + ldr r3, [sp, 0x54] + cmp r5, r8 + bge _0804DFDE +_0804DFAA: + adds r4, r6, 0 + adds r7, r5, 0x1 + cmp r6, r3 + bge _0804DFD8 + ldr r2, _0804E038 + mov r9, r2 +_0804DFB6: + adds r0, r5, 0 + adds r1, r4, 0 + str r3, [sp, 0x54] + bl sub_8049590 + ldrh r1, [r0] + mov r2, r9 + ands r1, r2 + movs r2, 0x1 + orrs r1, r2 + strh r1, [r0] + mov r1, r10 + strb r1, [r0, 0x9] + adds r4, 0x1 + ldr r3, [sp, 0x54] + cmp r4, r3 + blt _0804DFB6 +_0804DFD8: + adds r5, r7, 0 + cmp r5, r8 + blt _0804DFAA +_0804DFDE: + ldr r2, [sp, 0x40] + ldr r4, [sp, 0x20] + subs r0, r2, r4 + lsls r0, 5 + ldr r5, [sp, 0xC] + adds r0, r5 + ldr r7, [sp, 0x44] + adds r0, r7, r0 + mov r1, sp + ldrh r1, [r1, 0x34] + strh r1, [r0] + mov r2, r8 + strh r2, [r0, 0x4] + strh r6, [r0, 0x2] + strh r3, [r0, 0x6] + adds r1, r0, 0 + adds r1, 0x20 + movs r3, 0x1 + strb r3, [r1, 0x12] + strb r3, [r0, 0x12] + movs r4, 0 + strb r4, [r1, 0xB] + strb r3, [r1, 0x11] +_0804E00C: + ldr r5, [sp, 0x3C] + mov r10, r5 + ldr r6, [sp, 0x14] + cmp r10, r6 + bge _0804E018 + b _0804DBEC +_0804E018: + ldr r7, [sp, 0x38] + str r7, [sp, 0x20] + adds r0, r7, 0 + ldr r1, [sp, 0x10] + cmp r0, r1 + bge _0804E026 + b _0804DBDA +_0804E026: + add sp, 0x58 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804E038: .4byte 0x0000fffc + thumb_func_end sub_804D8C8 + + thumb_func_start sub_804E03C +sub_804E03C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x44 + str r0, [sp] + str r1, [sp, 0x4] + str r2, [sp, 0x8] + movs r0, 0 + str r0, [sp, 0xC] + cmp r0, r1 + blt _0804E058 + b _0804E318 +_0804E058: + movs r2, 0 + ldr r1, [sp, 0xC] + adds r1, 0x1 + str r1, [sp, 0x28] + ldr r3, [sp, 0x8] + cmp r2, r3 + blt _0804E068 + b _0804E30C +_0804E068: + ldr r4, [sp, 0xC] + lsls r4, 4 + str r4, [sp, 0x14] + ldr r6, [sp, 0xC] + subs r0, r4, r6 + lsls r0, 5 + ldr r1, [sp] + adds r0, r1 + str r0, [sp, 0x18] +_0804E07A: + lsls r0, r2, 5 + ldr r3, [sp, 0x18] + adds r4, r0, r3 + ldrb r1, [r4, 0x8] + str r0, [sp, 0x34] + adds r2, 0x1 + str r2, [sp, 0x2C] + cmp r1, 0 + beq _0804E08E + b _0804E302 +_0804E08E: + ldrb r0, [r4, 0x11] + cmp r0, 0 + beq _0804E096 + b _0804E302 +_0804E096: + ldrb r0, [r4, 0x12] + cmp r0, 0 + beq _0804E09E + b _0804E302 +_0804E09E: + ldrb r0, [r4, 0xB] + cmp r0, 0 + bne _0804E0A6 + b _0804E302 +_0804E0A6: + ldrb r0, [r4, 0xA] + cmp r0, 0 + bne _0804E0AE + b _0804E302 +_0804E0AE: + ldrb r0, [r4, 0x9] + cmp r0, 0 + beq _0804E0B6 + b _0804E302 +_0804E0B6: + ldrb r0, [r4, 0x10] + cmp r0, 0 + beq _0804E0BE + b _0804E302 +_0804E0BE: + ldrb r0, [r4, 0x1C] + cmp r0, 0 + bne _0804E0C6 + b _0804E302 +_0804E0C6: + movs r0, 0x64 + bl sub_8084100 + cmp r0, 0x3B + bgt _0804E0D2 + b _0804E302 +_0804E0D2: + movs r6, 0x4 + ldrsh r2, [r4, r6] + movs r1, 0 + ldrsh r0, [r4, r1] + subs r2, r0 + movs r3, 0x6 + ldrsh r0, [r4, r3] + movs r6, 0x2 + ldrsh r1, [r4, r6] + subs r0, r1 + adds r2, r0 + str r2, [sp, 0x10] + adds r0, r2, 0 + cmp r2, 0 + bge _0804E0F2 + adds r0, 0x3 +_0804E0F2: + asrs r0, 2 + str r0, [sp, 0x10] + cmp r0, 0 + bne _0804E0FE + movs r0, 0x1 + str r0, [sp, 0x10] +_0804E0FE: + movs r1, 0 + ldr r2, [sp, 0x10] + cmp r1, r2 + blt _0804E108 + b _0804E302 +_0804E108: + ldr r3, [sp, 0x14] + ldr r4, [sp, 0xC] + subs r0, r3, r4 + lsls r0, 5 + ldr r6, [sp] + adds r0, r6 + ldr r2, [sp, 0x34] + adds r0, r2, r0 + str r0, [sp, 0x20] +_0804E11A: + movs r4, 0 + adds r1, 0x1 + str r1, [sp, 0x30] +_0804E120: + movs r0, 0x4 + bl sub_8084100 + str r0, [sp, 0x1C] + cmp r0, 0x1 + beq _0804E14A + cmp r0, 0x1 + ble _0804E138 + cmp r0, 0x2 + beq _0804E168 + cmp r0, 0x3 + beq _0804E182 +_0804E138: + ldr r3, [sp, 0x20] + movs r6, 0 + ldrsh r7, [r3, r6] + movs r1, 0x2 + ldrsh r0, [r3, r1] + mov r8, r0 + cmp r4, 0 + bne _0804E19C + b _0804E15C +_0804E14A: + ldr r2, [sp, 0x20] + movs r3, 0x4 + ldrsh r0, [r2, r3] + subs r7, r0, 0x1 + movs r0, 0x2 + ldrsh r6, [r2, r0] + mov r8, r6 + cmp r4, 0 + beq _0804E162 +_0804E15C: + movs r3, 0 + movs r2, 0x1 + b _0804E1A0 +_0804E162: + movs r3, 0x1 + negs r3, r3 + b _0804E19E +_0804E168: + ldr r1, [sp, 0x20] + movs r2, 0x4 + ldrsh r0, [r1, r2] + subs r7, r0, 0x1 + movs r3, 0x6 + ldrsh r0, [r1, r3] + subs r0, 0x1 + mov r8, r0 + cmp r4, 0 + beq _0804E194 + movs r3, 0x1 + negs r3, r3 + b _0804E19E +_0804E182: + ldr r6, [sp, 0x20] + movs r0, 0 + ldrsh r7, [r6, r0] + movs r1, 0x6 + ldrsh r0, [r6, r1] + subs r0, 0x1 + mov r8, r0 + cmp r4, 0 + beq _0804E19C +_0804E194: + movs r3, 0 + movs r2, 0x1 + negs r2, r2 + b _0804E1A0 +_0804E19C: + movs r3, 0x1 +_0804E19E: + movs r2, 0 +_0804E1A0: + movs r6, 0 + mov r9, r6 + ldr r5, [sp, 0x34] + ldr r0, [sp, 0x14] + str r0, [sp, 0x40] + ldr r6, [sp, 0x18] + adds r1, r5, r6 + movs r6, 0 + ldrsh r0, [r1, r6] + mov r10, r0 + adds r4, 0x1 + str r4, [sp, 0x24] + cmp r7, r10 + bge _0804E1BE + b _0804E2F0 +_0804E1BE: + movs r4, 0x4 + ldrsh r0, [r1, r4] + cmp r7, r0 + blt _0804E1C8 + b _0804E2F0 +_0804E1C8: + ldr r6, [sp, 0x40] + ldr r1, [sp, 0xC] + subs r0, r6, r1 + lsls r0, 5 + ldr r4, [sp] + adds r0, r4 + adds r4, r5, r0 + movs r6, 0x2 + ldrsh r0, [r4, r6] + cmp r8, r0 + bge _0804E1E0 + b _0804E2F0 +_0804E1E0: + movs r1, 0x6 + ldrsh r0, [r4, r1] + cmp r8, r0 + blt _0804E1EA + b _0804E2F0 +_0804E1EA: + adds r0, r7, 0 + mov r1, r8 + str r2, [sp, 0x38] + str r3, [sp, 0x3C] + bl sub_804954C + ldrh r1, [r0] + movs r0, 0x3 + ands r0, r1 + ldr r2, [sp, 0x38] + ldr r3, [sp, 0x3C] + cmp r0, 0x1 + bne _0804E2D0 + movs r6, 0 +_0804E206: + ldr r1, _0804E228 + lsls r0, r6, 2 + adds r0, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + adds r1, r7 + mov r10, r1 + movs r3, 0x2 + ldrsh r0, [r0, r3] + add r0, r8 + mov r9, r0 + movs r3, 0 + movs r5, 0x1 + negs r5, r5 +_0804E222: + movs r4, 0x1 + negs r4, r4 + b _0804E22E + .align 2, 0 +_0804E228: .4byte gUnknown_80F4448 +_0804E22C: + adds r4, 0x1 +_0804E22E: + cmp r4, 0x1 + bgt _0804E25A + mov r1, r10 + adds r0, r1, r4 + mov r2, r9 + adds r1, r2, r5 + str r3, [sp, 0x3C] + bl sub_804954C + adds r2, r0, 0 + ldrh r1, [r2] + movs r0, 0x3 + ands r0, r1 + ldr r3, [sp, 0x3C] + cmp r0, 0x1 + bne _0804E22C + ldrb r0, [r2, 0x9] + cmp r0, 0xFF + bne _0804E256 + movs r3, 0x1 +_0804E256: + cmp r3, 0 + beq _0804E22C +_0804E25A: + cmp r3, 0 + bne _0804E26A + adds r5, 0x1 + cmp r5, 0x1 + ble _0804E222 + adds r6, 0x1 + cmp r6, 0x7 + ble _0804E206 +_0804E26A: + cmp r6, 0x8 + bne _0804E2F0 + movs r6, 0 + ldr r3, [sp, 0x1C] + lsls r1, r3, 3 + ldr r0, _0804E2C4 + adds r4, r1, r0 +_0804E278: + ldr r0, _0804E2C8 + lsls r1, r6, 2 + adds r1, r0 + movs r2, 0 + ldrsh r0, [r1, r2] + movs r3, 0x2 + ldrsh r1, [r1, r3] + adds r0, r7, r0 + add r1, r8 + bl sub_804954C + ldrh r1, [r0] + movs r0, 0x3 + ands r0, r1 + movs r1, 0 + cmp r0, 0x1 + bne _0804E29C + movs r1, 0x1 +_0804E29C: + ldrb r0, [r4] + cmp r0, r1 + bne _0804E2AA + adds r4, 0x2 + adds r6, 0x2 + cmp r6, 0x7 + ble _0804E278 +_0804E2AA: + cmp r6, 0x8 + bne _0804E2F0 + adds r0, r7, 0 + mov r1, r8 + bl sub_8049590 + ldrh r2, [r0] + ldr r4, _0804E2CC + adds r1, r4, 0 + ands r2, r1 + strh r2, [r0] + b _0804E2F0 + .align 2, 0 +_0804E2C4: .4byte gUnknown_80F6DD5 +_0804E2C8: .4byte gUnknown_80F4448 +_0804E2CC: .4byte 0x0000fffc +_0804E2D0: + adds r7, r3 + add r8, r2 + movs r6, 0x1 + add r9, r6 + mov r0, r9 + cmp r0, 0x9 + bgt _0804E2F0 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r7, r0 + blt _0804E2F0 + movs r6, 0x4 + ldrsh r0, [r4, r6] + cmp r7, r0 + bge _0804E2F0 + b _0804E1C8 +_0804E2F0: + ldr r4, [sp, 0x24] + cmp r4, 0x1 + bgt _0804E2F8 + b _0804E120 +_0804E2F8: + ldr r1, [sp, 0x30] + ldr r0, [sp, 0x10] + cmp r1, r0 + bge _0804E302 + b _0804E11A +_0804E302: + ldr r2, [sp, 0x2C] + ldr r1, [sp, 0x8] + cmp r2, r1 + bge _0804E30C + b _0804E07A +_0804E30C: + ldr r2, [sp, 0x28] + str r2, [sp, 0xC] + ldr r3, [sp, 0x4] + cmp r2, r3 + bge _0804E318 + b _0804E058 +_0804E318: + add sp, 0x44 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_804E03C + + thumb_func_start sub_804E328 +sub_804E328: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r5, r0, 0 + adds r4, r1, 0 + str r2, [sp] + str r3, [sp, 0x4] + ldr r0, [sp, 0x28] + lsls r0, 24 + mov r10, r5 + mov r9, r4 + ldr r1, [sp, 0x2C] + mov r8, r1 + ldr r7, [sp, 0x30] + cmp r0, 0 + bne _0804E350 + b _0804E470 +_0804E350: + movs r6, 0 +_0804E352: + cmp r4, r7 + beq _0804E3A8 + adds r0, r6, 0 + adds r6, 0x1 + cmp r0, 0x37 + ble _0804E360 + b _0804E57E +_0804E360: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_804954C + ldrh r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + beq _0804E390 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8049590 + ldrh r2, [r0] + ldr r3, _0804E38C + adds r1, r3, 0 + ands r2, r1 + movs r1, 0x1 + orrs r2, r1 + strh r2, [r0] + b _0804E39C + .align 2, 0 +_0804E38C: .4byte 0x0000fffc +_0804E390: + cmp r5, r10 + beq _0804E396 + b _0804E57E +_0804E396: + cmp r4, r9 + beq _0804E39C + b _0804E57E +_0804E39C: + cmp r4, r7 + bge _0804E3A4 + adds r4, 0x1 + b _0804E352 +_0804E3A4: + subs r4, 0x1 + b _0804E352 +_0804E3A8: + movs r6, 0 + ldr r0, [sp] + cmp r5, r0 + beq _0804E40A + movs r7, 0 +_0804E3B2: + adds r0, r6, 0 + adds r6, 0x1 + cmp r0, 0x37 + ble _0804E3BC + b _0804E57E +_0804E3BC: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_804954C + ldrh r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + beq _0804E3EC + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8049590 + ldrh r2, [r0] + ldr r3, _0804E3E8 + adds r1, r3, 0 + ands r2, r1 + movs r1, 0x1 + orrs r2, r1 + strh r2, [r0] + b _0804E3F8 + .align 2, 0 +_0804E3E8: .4byte 0x0000fffc +_0804E3EC: + cmp r5, r10 + beq _0804E3F2 + b _0804E57E +_0804E3F2: + cmp r4, r9 + beq _0804E3F8 + b _0804E57E +_0804E3F8: + ldr r0, [sp] + cmp r5, r0 + bge _0804E402 + adds r5, 0x1 + b _0804E404 +_0804E402: + subs r5, 0x1 +_0804E404: + ldr r1, [sp] + cmp r5, r1 + bne _0804E3B2 +_0804E40A: + movs r6, 0 + ldr r3, [sp, 0x4] + cmp r4, r3 + bne _0804E414 + b _0804E57E +_0804E414: + movs r7, 0 +_0804E416: + adds r0, r6, 0 + adds r6, 0x1 + cmp r0, 0x37 + ble _0804E420 + b _0804E57E +_0804E420: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_804954C + ldrh r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + beq _0804E450 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8049590 + ldrh r2, [r0] + ldr r3, _0804E44C + adds r1, r3, 0 + ands r2, r1 + movs r1, 0x1 + orrs r2, r1 + strh r2, [r0] + b _0804E45C + .align 2, 0 +_0804E44C: .4byte 0x0000fffc +_0804E450: + cmp r5, r10 + beq _0804E456 + b _0804E57E +_0804E456: + cmp r4, r9 + beq _0804E45C + b _0804E57E +_0804E45C: + ldr r0, [sp, 0x4] + cmp r4, r0 + bge _0804E466 + adds r4, 0x1 + b _0804E468 +_0804E466: + subs r4, 0x1 +_0804E468: + ldr r1, [sp, 0x4] + cmp r4, r1 + bne _0804E416 + b _0804E57E +_0804E470: + movs r6, 0 + cmp r5, r8 + beq _0804E4C6 + movs r7, 0 +_0804E478: + adds r0, r6, 0 + adds r6, 0x1 + cmp r0, 0x37 + ble _0804E482 + b _0804E57E +_0804E482: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_804954C + ldrh r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + beq _0804E4B0 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8049590 + ldrh r2, [r0] + ldr r3, _0804E4AC + adds r1, r3, 0 + ands r2, r1 + movs r1, 0x1 + orrs r2, r1 + strh r2, [r0] + b _0804E4B8 + .align 2, 0 +_0804E4AC: .4byte 0x0000fffc +_0804E4B0: + cmp r5, r10 + bne _0804E57E + cmp r4, r9 + bne _0804E57E +_0804E4B8: + cmp r5, r8 + bge _0804E4C0 + adds r5, 0x1 + b _0804E4C2 +_0804E4C0: + subs r5, 0x1 +_0804E4C2: + cmp r5, r8 + bne _0804E478 +_0804E4C6: + movs r6, 0 + ldr r0, [sp, 0x4] + cmp r4, r0 + beq _0804E522 + movs r7, 0 +_0804E4D0: + adds r0, r6, 0 + adds r6, 0x1 + cmp r0, 0x37 + bgt _0804E57E + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_804954C + ldrh r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + beq _0804E508 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8049590 + ldrh r2, [r0] + ldr r3, _0804E504 + adds r1, r3, 0 + ands r2, r1 + movs r1, 0x1 + orrs r2, r1 + strh r2, [r0] + b _0804E510 + .align 2, 0 +_0804E504: .4byte 0x0000fffc +_0804E508: + cmp r5, r10 + bne _0804E57E + cmp r4, r9 + bne _0804E57E +_0804E510: + ldr r0, [sp, 0x4] + cmp r4, r0 + bge _0804E51A + adds r4, 0x1 + b _0804E51C +_0804E51A: + subs r4, 0x1 +_0804E51C: + ldr r1, [sp, 0x4] + cmp r4, r1 + bne _0804E4D0 +_0804E522: + movs r6, 0 + ldr r3, [sp] + cmp r5, r3 + beq _0804E57E + movs r7, 0 +_0804E52C: + adds r0, r6, 0 + adds r6, 0x1 + cmp r0, 0x37 + bgt _0804E57E + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_804954C + ldrh r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + beq _0804E564 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8049590 + ldrh r2, [r0] + ldr r3, _0804E560 + adds r1, r3, 0 + ands r2, r1 + movs r1, 0x1 + orrs r2, r1 + strh r2, [r0] + b _0804E56C + .align 2, 0 +_0804E560: .4byte 0x0000fffc +_0804E564: + cmp r5, r10 + bne _0804E57E + cmp r4, r9 + bne _0804E57E +_0804E56C: + ldr r0, [sp] + cmp r5, r0 + bge _0804E576 + adds r5, 0x1 + b _0804E578 +_0804E576: + subs r5, 0x1 +_0804E578: + ldr r1, [sp] + cmp r5, r1 + bne _0804E52C +_0804E57E: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_804E328 + + thumb_func_start sub_804E590 +sub_804E590: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x40 + str r0, [sp, 0xC] + str r1, [sp, 0x10] + str r2, [sp, 0x14] + str r3, [sp, 0x18] + movs r0, 0 + str r0, [sp, 0x1C] + cmp r0, r1 + blt _0804E5AE + b _0804E8AA +_0804E5AE: + movs r1, 0x1 + mov r10, r1 +_0804E5B2: + movs r2, 0 + str r2, [sp, 0x20] + ldr r3, [sp, 0x1C] + adds r3, 0x1 + str r3, [sp, 0x2C] + ldr r4, [sp, 0x14] + cmp r2, r4 + blt _0804E5C4 + b _0804E89E +_0804E5C4: + ldr r5, [sp, 0x1C] + lsls r5, 4 + ldr r6, [sp, 0x1C] + subs r1, r5, r6 + lsls r1, 5 + ldr r2, [sp, 0xC] + movs r3, 0xF0 + lsls r3, 1 + adds r0, r2, r3 + adds r0, r1 + mov r8, r0 + adds r6, r1, r2 + ldr r4, _0804E6A4 + adds r0, r2, r4 + adds r7, r1, r0 + adds r0, r2, 0 + adds r0, 0x20 + adds r0, r1 + mov r9, r0 + ldr r5, [sp, 0x60] + str r5, [sp, 0x34] + adds r0, r2, 0 + subs r0, 0x20 + adds r1, r0 + str r1, [sp, 0x38] + movs r0, 0 + str r0, [sp, 0x3C] + ldr r1, [sp, 0x1C] + lsls r0, r1, 2 + ldr r2, [sp, 0x18] + adds r0, r2 + str r0, [sp, 0x28] +_0804E604: + ldr r3, [sp, 0x1C] + lsls r0, r3, 4 + subs r0, r3 + lsls r0, 5 + ldr r4, [sp, 0xC] + adds r0, r4 + ldr r5, [sp, 0x3C] + adds r4, r5, r0 + ldrb r0, [r4, 0x8] + cmp r0, 0 + beq _0804E61C + b _0804E874 +_0804E61C: + ldrb r0, [r4, 0x11] + cmp r0, 0 + beq _0804E624 + b _0804E874 +_0804E624: + ldrb r0, [r4, 0xB] + cmp r0, 0 + beq _0804E62C + b _0804E874 +_0804E62C: + ldrb r0, [r4, 0xA] + cmp r0, 0 + bne _0804E634 + b _0804E848 +_0804E634: + ldrb r0, [r4, 0x9] + cmp r0, 0 + beq _0804E63C + b _0804E848 +_0804E63C: + movs r1, 0 + ldrsh r0, [r4, r1] + adds r0, 0x1 + movs r2, 0x4 + ldrsh r1, [r4, r2] + subs r1, 0x1 + bl sub_808411C + str r0, [sp, 0x24] + movs r3, 0x2 + ldrsh r0, [r4, r3] + adds r0, 0x1 + movs r5, 0x6 + ldrsh r1, [r4, r5] + subs r1, 0x1 + bl sub_808411C + adds r5, r0, 0 + ldr r0, [sp, 0x20] + cmp r0, 0 + ble _0804E6DC + subs r4, 0x20 + ldrb r0, [r4, 0x8] + cmp r0, 0 + bne _0804E6DC + ldrb r0, [r4, 0x12] + cmp r0, 0 + bne _0804E6DC + ldrb r0, [r4, 0xB] + cmp r0, 0 + beq _0804E6DC + ldrb r0, [r4, 0xA] + cmp r0, 0 + beq _0804E6A8 + movs r1, 0 + ldrsh r0, [r4, r1] + adds r0, 0x1 + movs r2, 0x4 + ldrsh r1, [r4, r2] + subs r1, 0x1 + bl sub_808411C + adds r5, r0, 0 + movs r3, 0x2 + ldrsh r0, [r4, r3] + adds r0, 0x1 + movs r2, 0x6 + ldrsh r1, [r4, r2] + subs r1, 0x1 + bl sub_808411C + b _0804E6AC + .align 2, 0 +_0804E6A4: .4byte 0xfffffe20 +_0804E6A8: + movs r3, 0 + ldrsh r5, [r4, r3] +_0804E6AC: + movs r4, 0x2 + ldrsh r1, [r6, r4] + ldr r0, [sp, 0x38] + movs r2, 0x6 + ldrsh r3, [r0, r2] + subs r3, 0x1 + mov r4, r10 + str r4, [sp] + ldr r2, [sp, 0x28] + ldr r0, [r2] + str r0, [sp, 0x4] + ldr r4, [sp, 0x34] + ldr r0, [r4] + str r0, [sp, 0x8] + ldr r0, [sp, 0x24] + adds r2, r5, 0 + bl sub_804E328 + mov r5, r10 + strb r5, [r6, 0xB] + strb r5, [r6, 0x13] + ldr r0, [sp, 0x38] + strb r5, [r0, 0x14] + b _0804E874 +_0804E6DC: + ldr r0, [sp, 0x14] + subs r0, 0x1 + ldr r1, [sp, 0x20] + cmp r1, r0 + bge _0804E758 + mov r2, r9 + ldrb r0, [r2, 0x8] + cmp r0, 0 + bne _0804E758 + ldrb r0, [r2, 0x12] + cmp r0, 0 + bne _0804E758 + ldrb r0, [r2, 0xB] + cmp r0, 0 + beq _0804E758 + ldrb r0, [r2, 0xA] + cmp r0, 0 + beq _0804E724 + movs r3, 0x20 + ldrsh r0, [r6, r3] + adds r0, 0x1 + movs r4, 0x24 + ldrsh r1, [r6, r4] + subs r1, 0x1 + bl sub_808411C + adds r5, r0, 0 + movs r1, 0x22 + ldrsh r0, [r6, r1] + adds r0, 0x1 + movs r2, 0x26 + ldrsh r1, [r6, r2] + subs r1, 0x1 + bl sub_808411C + b _0804E728 +_0804E724: + movs r3, 0x20 + ldrsh r5, [r6, r3] +_0804E728: + movs r4, 0x6 + ldrsh r1, [r6, r4] + subs r1, 0x1 + movs r0, 0x22 + ldrsh r3, [r6, r0] + mov r2, r10 + str r2, [sp] + ldr r4, [sp, 0x28] + ldr r0, [r4] + str r0, [sp, 0x4] + ldr r2, [sp, 0x34] + ldr r0, [r2, 0x4] + subs r0, 0x1 + str r0, [sp, 0x8] + ldr r0, [sp, 0x24] + adds r2, r5, 0 + bl sub_804E328 + mov r3, r10 + strb r3, [r6, 0xB] + strb r3, [r6, 0x14] + mov r4, r9 + strb r3, [r4, 0x13] + b _0804E874 +_0804E758: + ldr r0, [sp, 0x1C] + cmp r0, 0 + ble _0804E7C8 + ldrb r0, [r7, 0x8] + cmp r0, 0 + bne _0804E7C8 + ldrb r0, [r7, 0x12] + cmp r0, 0 + bne _0804E7C8 + ldrb r0, [r7, 0xB] + cmp r0, 0 + beq _0804E7C8 + ldrb r0, [r7, 0xA] + cmp r0, 0 + beq _0804E79A + movs r1, 0 + ldrsh r0, [r7, r1] + adds r0, 0x1 + movs r2, 0x4 + ldrsh r1, [r7, r2] + subs r1, 0x1 + bl sub_808411C + movs r3, 0x2 + ldrsh r0, [r7, r3] + adds r0, 0x1 + movs r4, 0x6 + ldrsh r1, [r7, r4] + subs r1, 0x1 + bl sub_808411C + adds r3, r0, 0 + b _0804E79E +_0804E79A: + movs r0, 0x2 + ldrsh r3, [r7, r0] +_0804E79E: + movs r1, 0 + ldrsh r0, [r6, r1] + movs r4, 0 + ldrsh r2, [r7, r4] + subs r2, 0x1 + movs r1, 0 + str r1, [sp] + ldr r4, [sp, 0x28] + ldr r1, [r4] + str r1, [sp, 0x4] + ldr r4, [sp, 0x34] + ldr r1, [r4] + str r1, [sp, 0x8] + adds r1, r5, 0 + bl sub_804E328 + mov r5, r10 + strb r5, [r6, 0xB] + strb r5, [r6, 0x15] + strb r5, [r7, 0x16] + b _0804E874 +_0804E7C8: + ldr r0, [sp, 0x10] + subs r0, 0x1 + ldr r1, [sp, 0x1C] + cmp r1, r0 + bge _0804E874 + mov r2, r8 + ldrb r0, [r2, 0x8] + cmp r0, 0 + bne _0804E874 + ldrb r0, [r2, 0x12] + cmp r0, 0 + bne _0804E874 + ldrb r0, [r2, 0xB] + cmp r0, 0 + beq _0804E874 + ldrb r0, [r2, 0xA] + cmp r0, 0 + beq _0804E812 + movs r3, 0 + ldrsh r0, [r2, r3] + adds r0, 0x1 + movs r4, 0x4 + ldrsh r1, [r2, r4] + subs r1, 0x1 + bl sub_808411C + mov r1, r8 + movs r2, 0x2 + ldrsh r0, [r1, r2] + adds r0, 0x1 + movs r3, 0x6 + ldrsh r1, [r1, r3] + subs r1, 0x1 + bl sub_808411C + adds r3, r0, 0 + b _0804E818 +_0804E812: + mov r4, r8 + movs r0, 0x2 + ldrsh r3, [r4, r0] +_0804E818: + movs r1, 0x4 + ldrsh r0, [r6, r1] + subs r0, 0x1 + mov r4, r8 + movs r1, 0 + ldrsh r2, [r4, r1] + movs r1, 0 + str r1, [sp] + ldr r4, [sp, 0x28] + ldr r1, [r4, 0x4] + subs r1, 0x1 + str r1, [sp, 0x4] + ldr r4, [sp, 0x34] + ldr r1, [r4] + str r1, [sp, 0x8] + adds r1, r5, 0 + bl sub_804E328 + mov r5, r10 + strb r5, [r6, 0xB] + strb r5, [r6, 0x16] + mov r0, r8 + strb r5, [r0, 0x15] + b _0804E874 +_0804E848: + movs r1, 0 + ldrsh r0, [r6, r1] + movs r2, 0x2 + ldrsh r1, [r6, r2] + bl sub_8049590 + ldrh r1, [r0] + ldr r3, _0804E99C + adds r2, r3, 0 + ands r1, r2 + strh r1, [r0] + ldrh r1, [r0, 0x4] + ldr r4, _0804E9A0 + adds r2, r4, 0 + ands r1, r2 + ldr r5, _0804E9A4 + adds r2, r5, 0 + ands r1, r2 + subs r3, 0x1 + adds r2, r3, 0 + ands r1, r2 + strh r1, [r0, 0x4] +_0804E874: + movs r4, 0x20 + add r8, r4 + adds r6, 0x20 + adds r7, 0x20 + add r9, r4 + ldr r5, [sp, 0x34] + adds r5, 0x4 + str r5, [sp, 0x34] + ldr r0, [sp, 0x38] + adds r0, 0x20 + str r0, [sp, 0x38] + ldr r1, [sp, 0x3C] + adds r1, 0x20 + str r1, [sp, 0x3C] + ldr r2, [sp, 0x20] + adds r2, 0x1 + str r2, [sp, 0x20] + ldr r3, [sp, 0x14] + cmp r2, r3 + bge _0804E89E + b _0804E604 +_0804E89E: + ldr r4, [sp, 0x2C] + str r4, [sp, 0x1C] + ldr r5, [sp, 0x10] + cmp r4, r5 + bge _0804E8AA + b _0804E5B2 +_0804E8AA: + movs r6, 0 + str r6, [sp, 0x1C] + ldr r0, [sp, 0x10] + cmp r6, r0 + bge _0804E98A +_0804E8B4: + movs r1, 0 + str r1, [sp, 0x20] + ldr r2, [sp, 0x1C] + adds r2, 0x1 + str r2, [sp, 0x2C] + ldr r3, [sp, 0x14] + cmp r1, r3 + bge _0804E980 + ldr r4, [sp, 0x1C] + lsls r4, 4 + mov r9, r4 +_0804E8CA: + ldr r5, [sp, 0x20] + lsls r2, r5, 5 + ldr r6, [sp, 0x1C] + lsls r3, r6, 4 + subs r0, r3, r6 + lsls r0, 5 + ldr r1, [sp, 0xC] + adds r4, r0, r1 + adds r1, r2, r4 + ldrb r0, [r1, 0x8] + mov r8, r2 + adds r5, 0x1 + str r5, [sp, 0x30] + cmp r0, 0 + bne _0804E976 + ldrb r0, [r1, 0x11] + cmp r0, 0 + bne _0804E976 + ldrb r0, [r1, 0xB] + cmp r0, 0 + bne _0804E976 + ldrb r0, [r1, 0xF] + cmp r0, 0 + bne _0804E976 + movs r6, 0 + ldrsh r5, [r1, r6] + movs r6, 0x4 + ldrsh r0, [r1, r6] + cmp r5, r0 + bge _0804E976 + mov r10, r4 +_0804E908: + ldr r1, [sp, 0x1C] + subs r0, r3, r1 + lsls r0, 5 + ldr r3, [sp, 0xC] + adds r0, r3 + adds r0, r2, r0 + movs r6, 0x2 + ldrsh r4, [r0, r6] + movs r1, 0x6 + ldrsh r0, [r0, r1] + adds r7, r5, 0x1 + cmp r4, r0 + bge _0804E95C + mov r6, r8 + add r6, r10 +_0804E926: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8049590 + ldrh r2, [r0] + ldr r3, _0804E99C + adds r1, r3, 0 + ands r2, r1 + strh r2, [r0] + ldrh r2, [r0, 0x4] + adds r3, 0x1 + adds r1, r3, 0 + ands r2, r1 + adds r3, 0x1 + adds r1, r3, 0 + ands r2, r1 + subs r3, 0x3 + adds r1, r3, 0 + ands r2, r1 + strh r2, [r0, 0x4] + movs r1, 0xFF + strb r1, [r0, 0x9] + adds r4, 0x1 + movs r1, 0x6 + ldrsh r0, [r6, r1] + cmp r4, r0 + blt _0804E926 +_0804E95C: + adds r5, r7, 0 + mov r2, r8 + mov r3, r9 + ldr r4, [sp, 0x1C] + subs r0, r3, r4 + lsls r0, 5 + ldr r6, [sp, 0xC] + adds r0, r6 + adds r0, r2, r0 + movs r1, 0x4 + ldrsh r0, [r0, r1] + cmp r5, r0 + blt _0804E908 +_0804E976: + ldr r2, [sp, 0x30] + str r2, [sp, 0x20] + ldr r3, [sp, 0x14] + cmp r2, r3 + blt _0804E8CA +_0804E980: + ldr r4, [sp, 0x2C] + str r4, [sp, 0x1C] + ldr r5, [sp, 0x10] + cmp r4, r5 + blt _0804E8B4 +_0804E98A: + add sp, 0x40 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804E99C: .4byte 0x0000fffc +_0804E9A0: .4byte 0x0000fffe +_0804E9A4: .4byte 0x0000fffd + thumb_func_end sub_804E590 + + thumb_func_start sub_804E9A8 +sub_804E9A8: + push {r4,r5,lr} + adds r4, r0, 0 + lsls r1, 24 + lsls r2, 24 + lsrs r2, 24 + ldrh r0, [r4] + ldr r5, _0804E9D8 + adds r3, r5, 0 + ands r3, r0 + strh r3, [r4] + cmp r1, 0 + beq _0804E9D0 + ldrb r0, [r4, 0x9] + cmp r0, r2 + bne _0804E9D0 + adds r0, r3, 0 + ands r0, r5 + movs r1, 0x2 + orrs r0, r1 + strh r0, [r4] +_0804E9D0: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0804E9D8: .4byte 0x0000fffc + thumb_func_end sub_804E9A8 + + thumb_func_start sub_804E9DC +sub_804E9DC: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r5, 0 + movs r0, 0x3 + mov r8, r0 + movs r7, 0x8 + ldr r3, _0804EAF0 + mov r9, r3 +_0804E9F2: + movs r4, 0 + adds r6, r5, 0x1 + mov r10, r6 +_0804E9F8: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_804954C + ldrh r1, [r0] + mov r0, r8 + ands r0, r1 + adds r6, r4, 0x1 + cmp r0, 0x1 + beq _0804EA0E + b _0804EB0E +_0804EA0E: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_804954C + ldrb r0, [r0, 0x9] + cmp r0, 0xFF + bne _0804EAF4 + cmp r5, 0 + ble _0804EA4E + subs r0, r5, 0x1 + adds r1, r4, 0 + bl sub_8049590 + adds r2, r0, 0 + ldrb r0, [r2, 0x9] + cmp r0, 0xFF + beq _0804EA4E + ldrh r0, [r2] + adds r1, r0, 0 + orrs r1, r7 + movs r3, 0 + strh r1, [r2] + adds r0, r1, 0 + mov r6, r8 + ands r0, r6 + cmp r0, 0x2 + bne _0804EA4E + mov r0, r9 + ands r1, r0 + movs r0, 0x1 + orrs r1, r0 + strh r1, [r2] +_0804EA4E: + cmp r4, 0 + ble _0804EA82 + subs r1, r4, 0x1 + adds r0, r5, 0 + bl sub_8049590 + adds r2, r0, 0 + ldrb r0, [r2, 0x9] + cmp r0, 0xFF + beq _0804EA82 + ldrh r0, [r2] + adds r1, r0, 0 + orrs r1, r7 + movs r3, 0 + orrs r1, r7 + strh r1, [r2] + adds r0, r1, 0 + mov r6, r8 + ands r0, r6 + cmp r0, 0x2 + bne _0804EA82 + mov r0, r9 + ands r1, r0 + movs r0, 0x1 + orrs r1, r0 + strh r1, [r2] +_0804EA82: + adds r6, r4, 0x1 + cmp r4, 0x1E + bgt _0804EABA + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_8049590 + adds r2, r0, 0 + ldrb r0, [r2, 0x9] + cmp r0, 0xFF + beq _0804EABA + ldrh r0, [r2] + adds r1, r0, 0 + orrs r1, r7 + movs r3, 0 + mov r12, r3 + orrs r1, r7 + strh r1, [r2] + adds r0, r1, 0 + mov r3, r8 + ands r0, r3 + cmp r0, 0x2 + bne _0804EABA + mov r0, r9 + ands r1, r0 + movs r0, 0x1 + orrs r1, r0 + strh r1, [r2] +_0804EABA: + cmp r5, 0x36 + bgt _0804EB0E + mov r0, r10 + adds r1, r4, 0 + bl sub_8049590 + adds r2, r0, 0 + ldrb r0, [r2, 0x9] + cmp r0, 0xFF + beq _0804EB0E + ldrh r0, [r2] + adds r1, r0, 0 + orrs r1, r7 + movs r3, 0 + orrs r1, r7 + strh r1, [r2] + adds r0, r1, 0 + mov r4, r8 + ands r0, r4 + cmp r0, 0x2 + bne _0804EB0E + mov r0, r9 + ands r1, r0 + movs r0, 0x1 + orrs r1, r0 + strh r1, [r2] + b _0804EB0E + .align 2, 0 +_0804EAF0: .4byte 0x0000fffc +_0804EAF4: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_804954C + ldrb r0, [r0, 0x9] + cmp r0, 0xFE + bne _0804EB0E + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8049590 + movs r1, 0xFF + strb r1, [r0, 0x9] +_0804EB0E: + adds r4, r6, 0 + cmp r4, 0x1F + bgt _0804EB16 + b _0804E9F8 +_0804EB16: + mov r5, r10 + cmp r5, 0x37 + bgt _0804EB1E + b _0804E9F2 +_0804EB1E: + bl sub_804EB30 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_804E9DC + + thumb_func_start sub_804EB30 +sub_804EB30: + push {r4-r7,lr} + ldr r0, _0804EBB4 + ldr r6, [r0] + movs r2, 0 + movs r1, 0x1F + ldr r3, _0804EBB8 + adds r0, r6, r3 +_0804EB3E: + strh r2, [r0] + subs r0, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _0804EB3E + movs r5, 0 +_0804EB4A: + movs r4, 0 + adds r7, r5, 0x1 +_0804EB4E: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_804954C + ldrh r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0804EBA2 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_804954C + ldrb r3, [r0, 0x9] + cmp r3, 0x1F + bhi _0804EBA2 + lsls r0, r3, 1 + ldr r2, _0804EBBC + adds r1, r6, r2 + adds r2, r1, r0 + movs r1, 0 + ldrsh r0, [r2, r1] + cmp r0, 0x1F + bgt _0804EBA2 + lsls r0, 2 + lsls r1, r3, 7 + adds r0, r1 + adds r0, r6, r0 + ldr r3, _0804EBC0 + adds r0, r3 + strh r5, [r0] + movs r3, 0 + ldrsh r0, [r2, r3] + lsls r0, 2 + adds r0, r1 + adds r0, r6, r0 + ldr r1, _0804EBC4 + adds r0, r1 + strh r4, [r0] + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] +_0804EBA2: + adds r4, 0x1 + cmp r4, 0x1F + ble _0804EB4E + adds r5, r7, 0 + cmp r5, 0x37 + ble _0804EB4A + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804EBB4: .4byte gUnknown_203B418 +_0804EBB8: .4byte 0x00010882 +_0804EBBC: .4byte 0x00010844 +_0804EBC0: .4byte 0x00010884 +_0804EBC4: .4byte 0x00010886 + thumb_func_end sub_804EB30 + + thumb_func_start sub_804EBC8 +sub_804EBC8: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x58 + str r0, [sp, 0x40] + str r1, [sp, 0x44] + mov r10, r2 + adds r4, r3, 0 + ldr r0, _0804EE90 + ldr r0, [r0] + mov r8, r0 + ldr r1, _0804EE94 + ldr r0, _0804EE98 + strh r0, [r1] + movs r0, 0x1 + negs r0, r0 + strh r0, [r1, 0x2] + ldr r0, _0804EE9C + ldrb r0, [r0] + cmp r0, 0 + beq _0804EBF8 + b _0804EED4 +_0804EBF8: + bl sub_8043D10 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _0804EC06 + b _0804EED4 +_0804EC06: + cmp r4, 0 + bne _0804EC0C + b _0804EED4 +_0804EC0C: + movs r0, 0x64 + bl sub_8084100 + cmp r4, r0 + bgt _0804EC18 + b _0804EED4 +_0804EC18: + movs r5, 0 + add r7, sp, 0x20 + adds r1, r7, 0 + mov r0, sp +_0804EC20: + strh r5, [r0] + strh r5, [r1] + adds r1, 0x2 + adds r0, 0x2 + adds r5, 0x1 + cmp r5, 0xE + ble _0804EC20 + movs r5, 0xC7 +_0804EC30: + movs r0, 0xF + bl sub_8084100 + adds r4, r0, 0 + movs r0, 0xF + bl sub_8084100 + lsls r4, 1 + mov r1, sp + adds r2, r1, r4 + movs r4, 0 + ldrsh r3, [r2, r4] + lsls r0, 1 + adds r1, r0 + ldrh r0, [r1] + strh r0, [r2] + strh r3, [r1] + subs r5, 0x1 + cmp r5, 0 + bge _0804EC30 + adds r6, r7, 0 + movs r5, 0xC7 +_0804EC5C: + movs r0, 0xF + bl sub_8084100 + adds r4, r0, 0 + movs r0, 0xF + bl sub_8084100 + lsls r4, 1 + adds r4, r6, r4 + movs r1, 0 + ldrsh r2, [r4, r1] + lsls r0, 1 + adds r0, r6, r0 + ldrh r1, [r0] + strh r1, [r4] + strh r2, [r0] + subs r5, 0x1 + cmp r5, 0 + bge _0804EC5C + movs r5, 0 +_0804EC84: + lsls r0, r5, 1 + add r0, sp + movs r3, 0 + ldrsh r2, [r0, r3] + mov r9, r2 + ldr r4, [sp, 0x44] + cmp r9, r4 + blt _0804EC96 + b _0804EECC +_0804EC96: + movs r4, 0 +_0804EC98: + lsls r0, r4, 1 + adds r0, r7, r0 + movs r2, 0 + ldrsh r1, [r0, r2] + cmp r1, r10 + blt _0804ECA6 + b _0804EEC4 +_0804ECA6: + lsls r1, 5 + mov r3, r9 + lsls r2, r3, 4 + subs r0, r2, r3 + lsls r0, 5 + ldr r3, [sp, 0x40] + adds r0, r3 + adds r3, r1, r0 + ldrb r0, [r3, 0x8] + str r1, [sp, 0x4C] + str r2, [sp, 0x48] + cmp r0, 0 + beq _0804ECC2 + b _0804EEC4 +_0804ECC2: + ldrb r0, [r3, 0x11] + cmp r0, 0 + beq _0804ECCA + b _0804EEC4 +_0804ECCA: + ldrb r0, [r3, 0x12] + cmp r0, 0 + beq _0804ECD2 + b _0804EEC4 +_0804ECD2: + ldrb r0, [r3, 0xB] + cmp r0, 0 + bne _0804ECDA + b _0804EEC4 +_0804ECDA: + ldrb r0, [r3, 0xA] + cmp r0, 0 + bne _0804ECE2 + b _0804EEC4 +_0804ECE2: + ldrb r0, [r3, 0x9] + cmp r0, 0 + beq _0804ECEA + b _0804EEC4 +_0804ECEA: + ldrb r0, [r3, 0x10] + cmp r0, 0 + beq _0804ECF2 + b _0804EEC4 +_0804ECF2: + ldrb r0, [r3, 0x1D] + cmp r0, 0 + beq _0804ECFA + b _0804EEC4 +_0804ECFA: + movs r0, 0x4 + ldrsh r1, [r3, r0] + movs r2, 0 + ldrsh r0, [r3, r2] + subs r1, r0 + cmp r1, 0 + bge _0804ED0A + negs r1, r1 +_0804ED0A: + cmp r1, 0x4 + bgt _0804ED10 + b _0804EEC4 +_0804ED10: + movs r0, 0x6 + ldrsh r1, [r3, r0] + movs r2, 0x2 + ldrsh r0, [r3, r2] + subs r1, r0 + cmp r1, 0 + bge _0804ED20 + negs r1, r1 +_0804ED20: + cmp r1, 0x3 + bgt _0804ED26 + b _0804EEC4 +_0804ED26: + ldr r1, _0804EEA0 + movs r0, 0x1 + strb r0, [r1] + movs r0, 0x1 + strb r0, [r3, 0xC] + ldr r2, _0804EEA4 + movs r4, 0 + ldrsh r0, [r3, r4] + adds r0, 0x1 + str r0, [r2] + movs r7, 0x4 + ldrsh r0, [r3, r7] + subs r0, 0x1 + str r0, [r2, 0x8] + movs r0, 0x2 + ldrsh r1, [r3, r0] + adds r1, 0x1 + str r1, [r2, 0x4] + movs r4, 0x6 + ldrsh r3, [r3, r4] + subs r0, r3, 0x1 + str r0, [r2, 0xC] + subs r0, r1 + mov r10, r2 + cmp r0, 0x2 + bgt _0804ED5C + str r3, [r2, 0xC] +_0804ED5C: + ldr r0, _0804EEA8 + add r0, r8 + ldr r1, _0804EEAC + str r1, [r0] + ldr r0, _0804EEB0 + add r0, r8 + str r1, [r0] + ldr r0, _0804EEB4 + add r0, r8 + ldr r1, _0804EEB8 + str r1, [r0] + ldr r0, _0804EEBC + add r0, r8 + str r1, [r0] + mov r7, r10 + ldr r5, [r7] + ldr r0, [r7, 0x8] + cmp r5, r0 + bge _0804EDFA + mov r3, r10 +_0804ED84: + ldr r4, [r3, 0x4] + ldr r0, [r3, 0xC] + adds r1, r5, 0x1 + str r1, [sp, 0x54] + cmp r4, r0 + bge _0804EDF0 + ldr r6, _0804EEA8 + add r6, r8 + ldr r2, _0804EEA4 + mov r10, r2 +_0804ED98: + adds r0, r5, 0 + adds r1, r4, 0 + str r3, [sp, 0x50] + bl sub_8049590 + ldrh r2, [r0] + movs r1, 0x20 + orrs r1, r2 + strh r1, [r0] + ldrh r2, [r0, 0x4] + ldr r7, _0804EEC0 + adds r1, r7, 0 + ands r2, r1 + adds r7, 0x7 + adds r1, r7, 0 + ands r2, r1 + strh r2, [r0, 0x4] + ldr r0, [r6] + ldr r3, [sp, 0x50] + cmp r0, r5 + ble _0804EDC4 + str r5, [r6] +_0804EDC4: + ldr r1, _0804EEB0 + add r1, r8 + ldr r0, [r1] + cmp r0, r4 + ble _0804EDD0 + str r4, [r1] +_0804EDD0: + ldr r1, _0804EEB4 + add r1, r8 + ldr r0, [r1] + cmp r0, r5 + bge _0804EDDC + str r5, [r1] +_0804EDDC: + ldr r1, _0804EEBC + add r1, r8 + ldr r0, [r1] + cmp r0, r4 + bge _0804EDE8 + str r4, [r1] +_0804EDE8: + adds r4, 0x1 + ldr r0, [r3, 0xC] + cmp r4, r0 + blt _0804ED98 +_0804EDF0: + ldr r5, [sp, 0x54] + mov r1, r10 + ldr r0, [r1, 0x8] + cmp r5, r0 + blt _0804ED84 +_0804EDFA: + ldr r3, [sp, 0x4C] + ldr r2, [sp, 0x48] + mov r4, r9 + subs r0, r2, r4 + lsls r0, 5 + ldr r7, [sp, 0x40] + adds r1, r0, r7 + adds r0, r3, r1 + movs r4, 0 + ldrsh r5, [r0, r4] + movs r7, 0x4 + ldrsh r0, [r0, r7] + cmp r5, r0 + bge _0804EE6C + mov r8, r1 +_0804EE18: + mov r1, r9 + subs r0, r2, r1 + lsls r0, 5 + ldr r2, [sp, 0x40] + adds r0, r2 + adds r0, r3, r0 + movs r3, 0x2 + ldrsh r4, [r0, r3] + movs r7, 0x6 + ldrsh r0, [r0, r7] + adds r1, r5, 0x1 + str r1, [sp, 0x54] + cmp r4, r0 + bge _0804EE52 + ldr r6, [sp, 0x4C] + add r6, r8 +_0804EE38: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8049590 + ldrh r2, [r0, 0x4] + movs r1, 0x10 + orrs r1, r2 + strh r1, [r0, 0x4] + adds r4, 0x1 + movs r2, 0x6 + ldrsh r0, [r6, r2] + cmp r4, r0 + blt _0804EE38 +_0804EE52: + ldr r5, [sp, 0x54] + ldr r3, [sp, 0x4C] + ldr r2, [sp, 0x48] + mov r4, r9 + subs r0, r2, r4 + lsls r0, 5 + ldr r7, [sp, 0x40] + adds r0, r7 + adds r0, r3, r0 + movs r1, 0x4 + ldrsh r0, [r0, r1] + cmp r5, r0 + blt _0804EE18 +_0804EE6C: + ldr r2, _0804EEA4 + ldr r0, [r2] + ldr r1, [r2, 0x8] + adds r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r5, r0, 1 + ldr r0, [r2, 0x4] + ldr r1, [r2, 0xC] + adds r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r4, r0, 1 + ldr r0, _0804EE94 + strh r5, [r0] + strh r4, [r0, 0x2] + b _0804EED4 + .align 2, 0 +_0804EE90: .4byte gUnknown_203B418 +_0804EE94: .4byte gUnknown_202F1D8 +_0804EE98: .4byte 0x0000ffff +_0804EE9C: .4byte gUnknown_202F1AB +_0804EEA0: .4byte gUnknown_202F1AA +_0804EEA4: .4byte gUnknown_202F1B8 +_0804EEA8: .4byte 0x0000e240 +_0804EEAC: .4byte 0x0000270f +_0804EEB0: .4byte 0x0000e244 +_0804EEB4: .4byte 0x0000e248 +_0804EEB8: .4byte 0xffffd8f1 +_0804EEBC: .4byte 0x0000e24c +_0804EEC0: .4byte 0x0000fff7 +_0804EEC4: + adds r4, 0x1 + cmp r4, 0xE + bgt _0804EECC + b _0804EC98 +_0804EECC: + adds r5, 0x1 + cmp r5, 0xE + bgt _0804EED4 + b _0804EC84 +_0804EED4: + add sp, 0x58 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_804EBC8 + + thumb_func_start sub_804EEE4 +sub_804EEE4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x108 + str r0, [sp, 0x100] + mov r8, r1 + adds r7, r2, 0 + adds r4, r3, 0 + ldr r5, _0804F094 + ldr r0, [r5] + str r0, [sp, 0x104] + cmp r4, 0 + bne _0804EF04 + b _0804F0C0 +_0804EF04: + movs r0, 0x64 + bl sub_8084100 + cmp r4, r0 + bgt _0804EF10 + b _0804F0C0 +_0804EF10: + ldr r0, _0804F098 + ldrb r0, [r0] + cmp r0, 0 + beq _0804EF1A + b _0804F0C0 +_0804EF1A: + ldr r0, [r5] + movs r1, 0xD1 + lsls r1, 3 + adds r0, r1 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + beq _0804EF2C + b _0804F0C0 +_0804EF2C: + bl sub_8043D10 + lsls r0, 24 + cmp r0, 0 + beq _0804EF38 + b _0804F0C0 +_0804EF38: + movs r6, 0 + movs r1, 0 + cmp r1, r8 + bge _0804EF94 +_0804EF40: + adds r2, r1, 0x1 + cmp r7, 0 + ble _0804EF8E + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 5 + ldr r1, [sp, 0x100] + adds r1, 0x8 + adds r1, r0, r1 + adds r3, r7, 0 +_0804EF54: + ldrb r0, [r1] + cmp r0, 0 + bne _0804EF86 + ldrb r0, [r1, 0x9] + cmp r0, 0 + bne _0804EF86 + ldrb r0, [r1, 0x3] + cmp r0, 0 + beq _0804EF86 + ldrb r0, [r1, 0x2] + cmp r0, 0 + beq _0804EF86 + ldrb r0, [r1, 0x4] + cmp r0, 0 + bne _0804EF86 + ldrb r0, [r1, 0x7] + cmp r0, 0 + bne _0804EF86 + ldrb r0, [r1, 0x8] + cmp r0, 0 + bne _0804EF86 + ldrb r0, [r1, 0x1] + cmp r0, 0 + bne _0804EF86 + adds r6, 0x1 +_0804EF86: + adds r1, 0x20 + subs r3, 0x1 + cmp r3, 0 + bne _0804EF54 +_0804EF8E: + adds r1, r2, 0 + cmp r1, r8 + blt _0804EF40 +_0804EF94: + cmp r6, 0 + bne _0804EF9A + b _0804F0C0 +_0804EF9A: + movs r1, 0 + mov r0, sp + adds r0, 0xFF +_0804EFA0: + strb r1, [r0] + subs r0, 0x1 + cmp r0, sp + bge _0804EFA0 + mov r1, sp + movs r0, 0x1 + strb r0, [r1] + movs r5, 0x3F +_0804EFB0: + adds r0, r6, 0 + bl sub_8084100 + adds r4, r0, 0 + adds r0, r6, 0 + bl sub_8084100 + mov r3, sp + adds r2, r3, r4 + ldrb r3, [r2] + mov r4, sp + adds r1, r4, r0 + ldrb r0, [r1] + strb r0, [r2] + strb r3, [r1] + subs r5, 0x1 + cmp r5, 0 + bge _0804EFB0 + movs r5, 0 + movs r1, 0 + cmp r1, r8 + bge _0804F0C0 + ldr r6, [sp, 0x100] + mov r9, r6 + movs r4, 0 +_0804EFE2: + movs r3, 0 + cmp r3, r7 + bge _0804F0B2 + mov r10, r3 + lsls r0, r4, 5 + ldr r6, [sp, 0x100] + adds r2, r0, r6 +_0804EFF0: + ldrb r0, [r2, 0x8] + cmp r0, 0 + bne _0804F0A6 + ldrb r0, [r2, 0x11] + cmp r0, 0 + bne _0804F0A6 + ldrb r0, [r2, 0xB] + cmp r0, 0 + beq _0804F0A6 + ldrb r0, [r2, 0xA] + cmp r0, 0 + beq _0804F0A6 + ldrb r0, [r2, 0xC] + cmp r0, 0 + bne _0804F0A6 + ldrb r0, [r2, 0xF] + cmp r0, 0 + bne _0804F0A6 + ldrb r0, [r2, 0x10] + cmp r0, 0 + bne _0804F0A6 + ldrb r0, [r2, 0x9] + cmp r0, 0 + bne _0804F0A6 + mov r6, sp + adds r0, r6, r5 + ldrb r0, [r0] + cmp r0, 0 + beq _0804F0A4 + ldr r1, _0804F09C + movs r0, 0x1 + strb r0, [r1] + movs r0, 0x1 + strb r0, [r2, 0xE] + movs r0, 0 + ldrsh r5, [r2, r0] + movs r1, 0x4 + ldrsh r0, [r2, r1] + cmp r5, r0 + bge _0804F0C0 + mov r2, r10 + add r2, r9 + mov r8, r2 +_0804F046: + mov r1, r10 + add r1, r9 + movs r3, 0x2 + ldrsh r4, [r1, r3] + movs r6, 0x6 + ldrsh r0, [r1, r6] + adds r7, r5, 0x1 + cmp r4, r0 + bge _0804F086 + adds r6, r1, 0 +_0804F05A: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8049590 + ldrh r2, [r0] + movs r1, 0x40 + orrs r1, r2 + strh r1, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_804954C + ldrb r1, [r0, 0x9] + ldr r2, [sp, 0x104] + ldr r3, _0804F0A0 + adds r0, r2, r3 + strb r1, [r0] + adds r4, 0x1 + movs r1, 0x6 + ldrsh r0, [r6, r1] + cmp r4, r0 + blt _0804F05A +_0804F086: + adds r5, r7, 0 + mov r2, r8 + movs r3, 0x4 + ldrsh r0, [r2, r3] + cmp r5, r0 + blt _0804F046 + b _0804F0C0 + .align 2, 0 +_0804F094: .4byte gUnknown_203B418 +_0804F098: .4byte gUnknown_202F1AA +_0804F09C: .4byte gUnknown_202F1AB +_0804F0A0: .4byte 0x00003a0c +_0804F0A4: + adds r5, 0x1 +_0804F0A6: + movs r6, 0x20 + add r10, r6 + adds r2, 0x20 + adds r3, 0x1 + cmp r3, r7 + blt _0804EFF0 +_0804F0B2: + movs r0, 0xF0 + lsls r0, 1 + add r9, r0 + adds r4, 0xF + adds r1, 0x1 + cmp r1, r8 + blt _0804EFE2 +_0804F0C0: + add sp, 0x108 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_804EEE4 + + thumb_func_start sub_804F0D0 +sub_804F0D0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x104 + str r0, [sp, 0x100] + mov r10, r1 + mov r9, r2 + adds r4, r3, 0 + ldr r0, _0804F244 + ldr r5, [r0] + cmp r4, 0 + bne _0804F0EE + b _0804F266 +_0804F0EE: + movs r0, 0x64 + bl sub_8084100 + cmp r4, r0 + bgt _0804F0FA + b _0804F266 +_0804F0FA: + ldr r1, _0804F248 + adds r0, r5, r1 + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r0, 0 + blt _0804F108 + b _0804F266 +_0804F108: + movs r5, 0 + movs r6, 0 + cmp r6, r10 + bge _0804F184 +_0804F110: + adds r7, r6, 0x1 + mov r4, r9 + cmp r4, 0 + ble _0804F17E + lsls r0, r6, 4 + subs r0, r6 + lsls r0, 5 + ldr r6, [sp, 0x100] + adds r2, r0, r6 +_0804F122: + ldrb r0, [r2, 0x8] + cmp r0, 0 + bne _0804F176 + ldrb r0, [r2, 0x11] + cmp r0, 0 + bne _0804F176 + ldrb r0, [r2, 0xB] + cmp r0, 0 + beq _0804F176 + ldrb r0, [r2, 0xA] + cmp r0, 0 + beq _0804F176 + ldrb r0, [r2, 0xC] + cmp r0, 0 + bne _0804F176 + ldrb r0, [r2, 0xF] + cmp r0, 0 + bne _0804F176 + ldrb r0, [r2, 0xE] + cmp r0, 0 + bne _0804F176 + ldrb r0, [r2, 0x9] + cmp r0, 0 + bne _0804F176 + movs r1, 0x4 + ldrsh r0, [r2, r1] + movs r3, 0 + ldrsh r1, [r2, r3] + subs r0, r1 + movs r3, 0x1 + ands r0, r3 + cmp r0, 0 + beq _0804F176 + movs r6, 0x6 + ldrsh r0, [r2, r6] + movs r6, 0x2 + ldrsh r1, [r2, r6] + subs r0, r1 + ands r0, r3 + cmp r0, 0 + beq _0804F176 + adds r5, 0x1 +_0804F176: + adds r2, 0x20 + subs r4, 0x1 + cmp r4, 0 + bne _0804F122 +_0804F17E: + adds r6, r7, 0 + cmp r6, r10 + blt _0804F110 +_0804F184: + cmp r5, 0 + beq _0804F266 + movs r1, 0 + mov r0, sp + adds r0, 0xFF +_0804F18E: + strb r1, [r0] + subs r0, 0x1 + cmp r0, sp + bge _0804F18E + mov r1, sp + movs r0, 0x1 + strb r0, [r1] + movs r7, 0x3F + mov r8, r7 +_0804F1A0: + adds r0, r5, 0 + bl sub_8084100 + adds r4, r0, 0 + adds r0, r5, 0 + bl sub_8084100 + mov r1, sp + adds r2, r1, r4 + ldrb r3, [r2] + adds r1, r0 + ldrb r0, [r1] + strb r0, [r2] + strb r3, [r1] + movs r3, 0x1 + negs r3, r3 + add r8, r3 + mov r4, r8 + cmp r4, 0 + bge _0804F1A0 + movs r6, 0 + mov r8, r6 + cmp r6, r10 + bge _0804F266 + ldr r7, [sp, 0x100] + mov r12, r7 +_0804F1D4: + movs r4, 0 + cmp r4, r9 + bge _0804F25A + mov r2, r12 + mov r5, r12 +_0804F1DE: + ldrb r0, [r2, 0x8] + cmp r0, 0 + bne _0804F250 + ldrb r0, [r2, 0x11] + cmp r0, 0 + bne _0804F250 + ldrb r0, [r2, 0xB] + cmp r0, 0 + beq _0804F250 + ldrb r0, [r2, 0xA] + cmp r0, 0 + beq _0804F250 + ldrb r0, [r2, 0xC] + cmp r0, 0 + bne _0804F250 + ldrb r0, [r2, 0xF] + cmp r0, 0 + bne _0804F250 + ldrb r0, [r2, 0xE] + cmp r0, 0 + bne _0804F250 + ldrb r0, [r2, 0x9] + cmp r0, 0 + bne _0804F250 + movs r1, 0x4 + ldrsh r0, [r2, r1] + movs r3, 0 + ldrsh r1, [r2, r3] + subs r0, r1 + movs r3, 0x1 + ands r0, r3 + cmp r0, 0 + beq _0804F250 + movs r7, 0x6 + ldrsh r0, [r2, r7] + movs r7, 0x2 + ldrsh r1, [r2, r7] + subs r0, r1 + ands r0, r3 + cmp r0, 0 + beq _0804F250 + mov r0, sp + add r0, r8 + ldrb r0, [r0] + cmp r0, 0 + beq _0804F24C + adds r0, r5, 0 + movs r1, 0 + bl sub_804F278 + b _0804F266 + .align 2, 0 +_0804F244: .4byte gUnknown_203B418 +_0804F248: .4byte 0x00003a16 +_0804F24C: + movs r0, 0x1 + add r8, r0 +_0804F250: + adds r2, 0x20 + adds r5, 0x20 + adds r4, 0x1 + cmp r4, r9 + blt _0804F1DE +_0804F25A: + movs r1, 0xF0 + lsls r1, 1 + add r12, r1 + adds r6, 0x1 + cmp r6, r10 + blt _0804F1D4 +_0804F266: + add sp, 0x104 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_804F0D0 + + thumb_func_start sub_804F278 +sub_804F278: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + adds r4, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + ldr r1, _0804F2B0 + movs r0, 0x1 + strb r0, [r1] + movs r0, 0x1 + strb r0, [r4, 0x10] + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl sub_804954C + ldrb r0, [r0, 0x9] + mov r9, r0 + movs r5, 0 + ldrsh r0, [r4, r5] + adds r6, r0, 0x1 + b _0804F2F0 + .align 2, 0 +_0804F2B0: .4byte gUnknown_202F1AC +_0804F2B4: + movs r2, 0x2 + ldrsh r1, [r4, r2] + subs r1, 0x1 + adds r0, r6, 0 + bl sub_804954C + ldrh r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + beq _0804F2EE + movs r5, 0x2 + ldrsh r3, [r4, r5] + subs r1, r3, 0x1 + movs r0, 0 + ldrsh r2, [r4, r0] + movs r5, 0x4 + ldrsh r0, [r4, r5] + str r0, [sp] + movs r5, 0x6 + ldrsh r0, [r4, r5] + str r0, [sp, 0x4] + mov r0, r8 + str r0, [sp, 0x8] + mov r5, r9 + str r5, [sp, 0xC] + adds r0, r6, 0 + bl sub_804F494 +_0804F2EE: + adds r6, 0x2 +_0804F2F0: + movs r1, 0x4 + ldrsh r0, [r4, r1] + subs r0, 0x1 + cmp r6, r0 + blt _0804F2B4 + movs r2, 0x2 + ldrsh r0, [r4, r2] + adds r5, r0, 0x1 + movs r6, 0x6 + ldrsh r0, [r4, r6] + b _0804F342 +_0804F306: + movs r1, 0x4 + ldrsh r0, [r4, r1] + adds r1, r5, 0 + bl sub_804954C + ldrh r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + beq _0804F33C + movs r2, 0x4 + ldrsh r0, [r4, r2] + movs r6, 0 + ldrsh r2, [r4, r6] + movs r1, 0x2 + ldrsh r3, [r4, r1] + str r0, [sp] + movs r6, 0x6 + ldrsh r1, [r4, r6] + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + mov r6, r9 + str r6, [sp, 0xC] + adds r1, r5, 0 + bl sub_804F494 +_0804F33C: + adds r5, 0x2 + movs r1, 0x6 + ldrsh r0, [r4, r1] +_0804F342: + subs r0, 0x1 + cmp r5, r0 + blt _0804F306 + movs r2, 0 + ldrsh r0, [r4, r2] + adds r6, r0, 0x1 + movs r5, 0x4 + ldrsh r0, [r4, r5] + b _0804F392 +_0804F354: + movs r0, 0x6 + ldrsh r1, [r4, r0] + adds r0, r6, 0 + bl sub_804954C + ldrh r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + beq _0804F38C + movs r2, 0x6 + ldrsh r1, [r4, r2] + movs r5, 0 + ldrsh r2, [r4, r5] + movs r0, 0x2 + ldrsh r3, [r4, r0] + movs r5, 0x4 + ldrsh r0, [r4, r5] + str r0, [sp] + adds r0, r1, 0 + str r0, [sp, 0x4] + mov r0, r8 + str r0, [sp, 0x8] + mov r5, r9 + str r5, [sp, 0xC] + adds r0, r6, 0 + bl sub_804F494 +_0804F38C: + adds r6, 0x2 + movs r1, 0x4 + ldrsh r0, [r4, r1] +_0804F392: + subs r0, 0x1 + cmp r6, r0 + blt _0804F354 + movs r2, 0x2 + ldrsh r0, [r4, r2] + adds r5, r0, 0x1 + movs r6, 0x6 + ldrsh r0, [r4, r6] + b _0804F3E4 +_0804F3A4: + movs r1, 0 + ldrsh r0, [r4, r1] + subs r0, 0x1 + adds r1, r5, 0 + bl sub_804954C + ldrh r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + beq _0804F3DE + movs r6, 0 + ldrsh r2, [r4, r6] + subs r0, r2, 0x1 + movs r1, 0x2 + ldrsh r3, [r4, r1] + movs r6, 0x4 + ldrsh r1, [r4, r6] + str r1, [sp] + movs r6, 0x6 + ldrsh r1, [r4, r6] + str r1, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] + mov r6, r9 + str r6, [sp, 0xC] + adds r1, r5, 0 + bl sub_804F494 +_0804F3DE: + adds r5, 0x2 + movs r1, 0x6 + ldrsh r0, [r4, r1] +_0804F3E4: + subs r0, 0x1 + cmp r5, r0 + blt _0804F3A4 + movs r2, 0 + ldrsh r0, [r4, r2] + adds r6, r0, 0x3 + b _0804F478 +_0804F3F2: + movs r1, 0x2 + ldrsh r0, [r4, r1] + adds r5, r0, 0x3 + movs r2, 0x6 + ldrsh r0, [r4, r2] + subs r0, 0x3 + adds r1, r6, 0x2 + mov r10, r1 + cmp r5, r0 + bge _0804F476 + ldr r2, _0804F434 + adds r7, r2, 0 +_0804F40A: + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_804954C + ldrh r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + bne _0804F46A + mov r0, r8 + cmp r0, 0 + beq _0804F438 + subs r0, r6, 0x1 + adds r1, r5, 0 + bl sub_8049590 + ldrh r1, [r0] + ands r1, r7 + movs r2, 0x2 + orrs r1, r2 + b _0804F444 + .align 2, 0 +_0804F434: .4byte 0x0000fffc +_0804F438: + subs r0, r6, 0x1 + adds r1, r5, 0 + bl sub_8049590 + ldrh r1, [r0] + ands r1, r7 +_0804F444: + strh r1, [r0] + movs r1, 0 + ldrsh r2, [r4, r1] + movs r0, 0x2 + ldrsh r3, [r4, r0] + movs r1, 0x4 + ldrsh r0, [r4, r1] + str r0, [sp] + movs r1, 0x6 + ldrsh r0, [r4, r1] + str r0, [sp, 0x4] + mov r0, r8 + str r0, [sp, 0x8] + mov r1, r9 + str r1, [sp, 0xC] + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_804F494 +_0804F46A: + adds r5, 0x2 + movs r2, 0x6 + ldrsh r0, [r4, r2] + subs r0, 0x3 + cmp r5, r0 + blt _0804F40A +_0804F476: + mov r6, r10 +_0804F478: + movs r5, 0x4 + ldrsh r0, [r4, r5] + subs r0, 0x3 + cmp r6, r0 + blt _0804F3F2 + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_804F278 + + thumb_func_start sub_804F494 +sub_804F494: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r5, r0, 0 + adds r4, r1, 0 + str r2, [sp] + str r3, [sp, 0x4] + ldr r0, [sp, 0x30] + ldr r1, [sp, 0x34] + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r1, 24 + mov r8, r1 + movs r0, 0x3 + mov r10, r0 +_0804F4BA: + movs r0, 0x4 + bl sub_8084100 + adds r6, r0, 0 + movs r7, 0 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8049590 + mov r1, r9 + mov r3, r8 + lsrs r2, r3, 24 + bl sub_804E9A8 +_0804F4D6: + adds r0, r6, 0 + mov r1, r10 + ands r0, r1 + cmp r0, 0x1 + beq _0804F4F6 + cmp r0, 0x1 + bgt _0804F4EA + cmp r0, 0 + beq _0804F4F0 + b _0804F506 +_0804F4EA: + cmp r0, 0x2 + beq _0804F4FE + b _0804F506 +_0804F4F0: + movs r0, 0x2 + movs r1, 0 + b _0804F50A +_0804F4F6: + movs r0, 0 + movs r1, 0x2 + negs r1, r1 + b _0804F50A +_0804F4FE: + movs r0, 0x2 + negs r0, r0 + movs r1, 0 + b _0804F50A +_0804F506: + movs r0, 0 + movs r1, 0x2 +_0804F50A: + adds r0, r5, r0 + ldr r2, [sp] + cmp r2, r0 + bgt _0804F534 + ldr r3, [sp, 0x28] + cmp r3, r0 + ble _0804F534 + adds r1, r4, r1 + ldr r2, [sp, 0x4] + cmp r2, r1 + bgt _0804F534 + ldr r3, [sp, 0x2C] + cmp r3, r1 + ble _0804F534 + bl sub_804954C + ldrh r1, [r0] + mov r0, r10 + ands r0, r1 + cmp r0, 0x1 + beq _0804F53E +_0804F534: + adds r6, 0x1 + adds r7, 0x1 + cmp r7, 0x3 + bgt _0804F5B2 + b _0804F4D6 +_0804F53E: + mov r0, r10 + ands r0, r6 + cmp r0, 0x1 + beq _0804F570 + cmp r0, 0x1 + bgt _0804F550 + cmp r0, 0 + beq _0804F55A + b _0804F4BA +_0804F550: + cmp r0, 0x2 + beq _0804F586 + cmp r0, 0x3 + beq _0804F59C + b _0804F4BA +_0804F55A: + adds r0, r5, 0x1 + adds r1, r4, 0 + bl sub_8049590 + mov r1, r9 + mov r3, r8 + lsrs r2, r3, 24 + bl sub_804E9A8 + adds r5, 0x2 + b _0804F4BA +_0804F570: + subs r1, r4, 0x1 + adds r0, r5, 0 + bl sub_8049590 + mov r1, r9 + mov r3, r8 + lsrs r2, r3, 24 + bl sub_804E9A8 + subs r4, 0x2 + b _0804F4BA +_0804F586: + subs r0, r5, 0x1 + adds r1, r4, 0 + bl sub_8049590 + mov r1, r9 + mov r3, r8 + lsrs r2, r3, 24 + bl sub_804E9A8 + subs r5, 0x2 + b _0804F4BA +_0804F59C: + adds r1, r4, 0x1 + adds r0, r5, 0 + bl sub_8049590 + mov r1, r9 + mov r3, r8 + lsrs r2, r3, 24 + bl sub_804E9A8 + adds r4, 0x2 + b _0804F4BA +_0804F5B2: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_804F494 + + thumb_func_start sub_804F5C4 +sub_804F5C4: + ldrh r3, [r0] + ldr r2, _0804F5D4 + ands r2, r3 + movs r3, 0x2 + orrs r2, r3 + orrs r2, r1 + strh r2, [r0] + bx lr + .align 2, 0 +_0804F5D4: .4byte 0x0000fffc + thumb_func_end sub_804F5C4 + + thumb_func_start sub_804F5D8 +sub_804F5D8: + push {r4-r7,lr} + adds r5, r0, 0 + movs r0, 0 + ldrsh r6, [r5, r0] + b _0804F60C +_0804F5E2: + movs r0, 0x2 + ldrsh r4, [r5, r0] + movs r1, 0x6 + ldrsh r0, [r5, r1] + adds r7, r6, 0x1 + cmp r4, r0 + bge _0804F60A +_0804F5F0: + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_8049590 + ldrh r2, [r0, 0x4] + movs r1, 0x20 + orrs r1, r2 + strh r1, [r0, 0x4] + adds r4, 0x1 + movs r1, 0x6 + ldrsh r0, [r5, r1] + cmp r4, r0 + blt _0804F5F0 +_0804F60A: + adds r6, r7, 0 +_0804F60C: + movs r1, 0x4 + ldrsh r0, [r5, r1] + cmp r6, r0 + blt _0804F5E2 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_804F5D8 + + thumb_func_start sub_804F61C +sub_804F61C: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r9, r0 + mov r8, r1 + movs r7, 0x1 + negs r7, r7 + b _0804F67A +_0804F62E: + movs r5, 0x1 + negs r5, r5 + b _0804F666 +_0804F634: + cmp r7, 0 + beq _0804F63C + cmp r5, 0 + bne _0804F660 +_0804F63C: + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_804954C + ldrh r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + bne _0804F660 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_804954C + ldrb r0, [r0, 0x9] + cmp r0, 0xFF + bne _0804F660 + movs r0, 0x1 + b _0804F686 +_0804F660: + adds r5, 0x1 + cmp r5, 0x1 + bgt _0804F672 +_0804F666: + mov r0, r8 + adds r4, r0, r5 + cmp r4, 0 + blt _0804F660 + cmp r4, 0x1F + ble _0804F634 +_0804F672: + adds r7, 0x1 + cmp r7, 0x1 + bgt _0804F684 + mov r0, r9 +_0804F67A: + adds r6, r0, r7 + cmp r6, 0 + blt _0804F672 + cmp r6, 0x37 + ble _0804F62E +_0804F684: + movs r0, 0 +_0804F686: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_804F61C + + thumb_func_start sub_804F694 +sub_804F694: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r7, r0, 0 + movs r0, 0x6 + bl sub_8084100 + subs r0, 0x1 + cmp r0, 0x4 + bls _0804F6B0 + b _0804FBD6 +_0804F6B0: + lsls r0, 2 + ldr r1, _0804F6BC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0804F6BC: .4byte _0804F6C0 + .align 2, 0 +_0804F6C0: + .4byte _0804FB24 + .4byte _0804FA98 + .4byte _0804F9DC + .4byte _0804F826 + .4byte _0804F6D4 +_0804F6D4: + ldr r1, _0804F70C + ldr r0, [r1] + cmp r0, 0 + bne _0804F6DE + b _0804FBD6 +_0804F6DE: + subs r0, 0x1 + str r0, [r1] + adds r0, r7, 0 + bl sub_804F5D8 + movs r0, 0x2 + bl sub_8084100 + cmp r0, 0 + beq _0804F78E + movs r5, 0 + movs r1, 0 + ldrsh r0, [r7, r1] + movs r2, 0x4 + ldrsh r1, [r7, r2] + adds r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + mov r8, r0 + movs r3, 0x2 + ldrsh r4, [r7, r3] + b _0804F712 + .align 2, 0 +_0804F70C: .4byte gUnknown_202F1C8 +_0804F710: + adds r4, 0x1 +_0804F712: + movs r1, 0x6 + ldrsh r0, [r7, r1] + cmp r4, r0 + bge _0804F72A + mov r0, r8 + adds r1, r4, 0 + bl sub_804F61C + lsls r0, 24 + cmp r0, 0 + beq _0804F710 + movs r5, 0x1 +_0804F72A: + cmp r5, 0 + beq _0804F730 + b _0804FBD6 +_0804F730: + movs r2, 0x2 + ldrsh r4, [r7, r2] + movs r3, 0x6 + ldrsh r0, [r7, r3] + cmp r4, r0 + bge _0804F754 +_0804F73C: + mov r0, r8 + adds r1, r4, 0 + bl sub_8049590 + movs r1, 0 + bl sub_804F5C4 + adds r4, 0x1 + movs r5, 0x6 + ldrsh r0, [r7, r5] + cmp r4, r0 + blt _0804F73C +_0804F754: + movs r0, 0 + ldrsh r5, [r7, r0] + cmp r5, r8 + blt _0804F75E + b _0804FBD2 +_0804F75E: + movs r1, 0x2 + ldrsh r4, [r7, r1] + movs r2, 0x6 + ldrsh r0, [r7, r2] + adds r6, r5, 0x1 + cmp r4, r0 + bge _0804F786 +_0804F76C: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8049590 + ldrh r2, [r0] + movs r1, 0x80 + orrs r1, r2 + strh r1, [r0] + adds r4, 0x1 + movs r3, 0x6 + ldrsh r0, [r7, r3] + cmp r4, r0 + blt _0804F76C +_0804F786: + adds r5, r6, 0 + cmp r5, r8 + blt _0804F75E + b _0804FBD2 +_0804F78E: + movs r5, 0 + movs r4, 0x2 + ldrsh r0, [r7, r4] + movs r2, 0x6 + ldrsh r1, [r7, r2] + adds r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + mov r8, r0 + movs r3, 0 + ldrsh r4, [r7, r3] + b _0804F7AA +_0804F7A8: + adds r4, 0x1 +_0804F7AA: + movs r1, 0x4 + ldrsh r0, [r7, r1] + cmp r4, r0 + bge _0804F7C2 + adds r0, r4, 0 + mov r1, r8 + bl sub_804F61C + lsls r0, 24 + cmp r0, 0 + beq _0804F7A8 + movs r5, 0x1 +_0804F7C2: + cmp r5, 0 + beq _0804F7C8 + b _0804FBD6 +_0804F7C8: + movs r2, 0 + ldrsh r4, [r7, r2] + movs r3, 0x4 + ldrsh r0, [r7, r3] + cmp r4, r0 + bge _0804F7EC +_0804F7D4: + adds r0, r4, 0 + mov r1, r8 + bl sub_8049590 + movs r1, 0 + bl sub_804F5C4 + adds r4, 0x1 + movs r5, 0x4 + ldrsh r0, [r7, r5] + cmp r4, r0 + blt _0804F7D4 +_0804F7EC: + movs r0, 0x2 + ldrsh r5, [r7, r0] + cmp r5, r8 + blt _0804F7F6 + b _0804FBD2 +_0804F7F6: + movs r1, 0 + ldrsh r4, [r7, r1] + movs r2, 0x4 + ldrsh r0, [r7, r2] + adds r6, r5, 0x1 + cmp r4, r0 + bge _0804F81E +_0804F804: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8049590 + ldrh r2, [r0] + movs r1, 0x80 + orrs r1, r2 + strh r1, [r0] + adds r4, 0x1 + movs r3, 0x4 + ldrsh r0, [r7, r3] + cmp r4, r0 + blt _0804F804 +_0804F81E: + adds r5, r6, 0 + cmp r5, r8 + blt _0804F7F6 + b _0804FBD2 +_0804F826: + movs r4, 0x4 + ldrsh r3, [r7, r4] + movs r5, 0 + ldrsh r1, [r7, r5] + subs r0, r3, r1 + cmp r0, 0x5 + bgt _0804F836 + b _0804FBD6 +_0804F836: + movs r0, 0x6 + ldrsh r4, [r7, r0] + movs r5, 0x2 + ldrsh r2, [r7, r5] + subs r0, r4, r2 + cmp r0, 0x5 + bgt _0804F846 + b _0804FBD6 +_0804F846: + adds r0, r1, r3 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + str r0, [sp] + adds r0, r2, r4 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + str r0, [sp, 0x4] + ldr r1, _0804F9D8 + ldr r0, [r1] + cmp r0, 0 + bne _0804F864 + b _0804FBD6 +_0804F864: + subs r0, 0x1 + str r0, [r1] + adds r0, r7, 0 + bl sub_804F5D8 + ldr r5, [sp] + subs r5, 0x2 + ldr r0, [sp, 0x4] + subs r0, 0x2 + mov r10, r0 + adds r0, r5, 0 + mov r1, r10 + bl sub_8049590 + movs r1, 0x4 + bl sub_804F5C4 + ldr r1, [sp] + subs r1, 0x1 + mov r9, r1 + mov r0, r9 + mov r1, r10 + bl sub_8049590 + movs r1, 0x4 + bl sub_804F5C4 + ldr r0, [sp] + mov r1, r10 + bl sub_8049590 + movs r1, 0x4 + bl sub_804F5C4 + ldr r2, [sp] + adds r2, 0x1 + mov r8, r2 + mov r0, r8 + mov r1, r10 + bl sub_8049590 + movs r1, 0x4 + bl sub_804F5C4 + ldr r6, [sp, 0x4] + subs r6, 0x1 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_8049590 + movs r1, 0x4 + bl sub_804F5C4 + adds r0, r5, 0 + ldr r1, [sp, 0x4] + bl sub_8049590 + movs r1, 0x4 + bl sub_804F5C4 + ldr r4, [sp, 0x4] + adds r4, 0x1 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8049590 + movs r1, 0x4 + bl sub_804F5C4 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8049590 + movs r1, 0x4 + bl sub_804F5C4 + mov r0, r9 + adds r1, r4, 0 + bl sub_8049590 + movs r1, 0x4 + bl sub_804F5C4 + ldr r0, [sp] + adds r1, r4, 0 + bl sub_8049590 + movs r1, 0x4 + bl sub_804F5C4 + mov r0, r8 + mov r1, r10 + bl sub_8049590 + movs r1, 0x4 + bl sub_804F5C4 + mov r0, r8 + adds r1, r6, 0 + bl sub_8049590 + movs r1, 0x4 + bl sub_804F5C4 + mov r0, r8 + ldr r1, [sp, 0x4] + bl sub_8049590 + movs r1, 0x4 + bl sub_804F5C4 + mov r0, r8 + adds r1, r4, 0 + bl sub_8049590 + movs r1, 0x4 + bl sub_804F5C4 + mov r0, r9 + adds r1, r6, 0 + bl sub_8049590 + ldrh r2, [r0, 0x4] + movs r1, 0x4 + orrs r1, r2 + strh r1, [r0, 0x4] + mov r0, r9 + adds r1, r6, 0 + bl sub_8049590 + ldrh r1, [r0, 0x4] + movs r2, 0x40 + orrs r1, r2 + strh r1, [r0, 0x4] + ldr r0, [sp] + adds r1, r6, 0 + bl sub_8049590 + ldrh r1, [r0, 0x4] + movs r4, 0x2 + orrs r1, r4 + strh r1, [r0, 0x4] + mov r0, r9 + ldr r1, [sp, 0x4] + bl sub_8049590 + ldrh r1, [r0, 0x4] + orrs r1, r4 + strh r1, [r0, 0x4] + ldr r0, [sp] + ldr r1, [sp, 0x4] + bl sub_8049590 + ldrh r1, [r0, 0x4] + orrs r1, r4 + strh r1, [r0, 0x4] + mov r0, r9 + adds r1, r6, 0 + bl sub_8049590 + ldrh r1, [r0, 0x4] + movs r4, 0x10 + orrs r1, r4 + strh r1, [r0, 0x4] + ldr r0, [sp] + adds r1, r6, 0 + bl sub_8049590 + ldrh r1, [r0, 0x4] + orrs r1, r4 + strh r1, [r0, 0x4] + mov r0, r9 + ldr r1, [sp, 0x4] + bl sub_8049590 + ldrh r1, [r0, 0x4] + orrs r1, r4 + strh r1, [r0, 0x4] + ldr r0, [sp] + ldr r1, [sp, 0x4] + bl sub_8049590 + ldrh r1, [r0, 0x4] + orrs r4, r1 + strh r4, [r0, 0x4] + b _0804FBD2 + .align 2, 0 +_0804F9D8: .4byte gUnknown_202F1C8 +_0804F9DC: + movs r4, 0x4 + ldrsh r3, [r7, r4] + movs r5, 0 + ldrsh r2, [r7, r5] + subs r0, r3, r2 + cmp r0, 0x4 + bgt _0804F9EC + b _0804FBD6 +_0804F9EC: + movs r1, 0x6 + ldrsh r0, [r7, r1] + movs r4, 0x2 + ldrsh r1, [r7, r4] + subs r0, r1 + cmp r0, 0x4 + bgt _0804F9FC + b _0804FBD6 +_0804F9FC: + adds r0, r2, 0x2 + subs r1, r3, 0x3 + bl sub_808411C + adds r4, r0, 0 + movs r5, 0x2 + ldrsh r0, [r7, r5] + adds r0, 0x2 + movs r2, 0x6 + ldrsh r1, [r7, r2] + subs r1, 0x3 + bl sub_808411C + mov r10, r0 + movs r3, 0 + ldrsh r0, [r7, r3] + adds r0, 0x2 + movs r5, 0x4 + ldrsh r1, [r7, r5] + subs r1, 0x3 + bl sub_808411C + mov r9, r0 + movs r1, 0x2 + ldrsh r0, [r7, r1] + adds r0, 0x2 + movs r2, 0x6 + ldrsh r1, [r7, r2] + subs r1, 0x3 + bl sub_808411C + adds r6, r0, 0 + ldr r1, _0804FA94 + ldr r0, [r1] + cmp r0, 0 + bne _0804FA46 + b _0804FBD6 +_0804FA46: + subs r0, 0x1 + str r0, [r1] + adds r0, r7, 0 + bl sub_804F5D8 + cmp r4, r9 + ble _0804FA5A + adds r0, r4, 0 + mov r4, r9 + mov r9, r0 +_0804FA5A: + cmp r10, r6 + ble _0804FA64 + mov r0, r10 + mov r10, r6 + adds r6, r0, 0 +_0804FA64: + adds r5, r4, 0 + cmp r5, r9 + ble _0804FA6C + b _0804FBD2 +_0804FA6C: + mov r4, r10 + adds r3, r5, 0x1 + mov r8, r3 + cmp r4, r6 + bgt _0804FA8A +_0804FA76: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8049590 + movs r1, 0 + bl sub_804F5C4 + adds r4, 0x1 + cmp r4, r6 + ble _0804FA76 +_0804FA8A: + mov r5, r8 + cmp r5, r9 + ble _0804FA6C + b _0804FBD2 + .align 2, 0 +_0804FA94: .4byte gUnknown_202F1C8 +_0804FA98: + movs r4, 0x4 + ldrsh r0, [r7, r4] + movs r5, 0 + ldrsh r1, [r7, r5] + subs r0, r1 + movs r2, 0x1 + ands r0, r2 + cmp r0, 0 + bne _0804FAAC + b _0804FBD6 +_0804FAAC: + movs r1, 0x6 + ldrsh r0, [r7, r1] + movs r3, 0x2 + ldrsh r1, [r7, r3] + subs r0, r1 + ands r0, r2 + cmp r0, 0 + bne _0804FABE + b _0804FBD6 +_0804FABE: + ldr r1, _0804FB20 + ldr r0, [r1] + cmp r0, 0 + bne _0804FAC8 + b _0804FBD6 +_0804FAC8: + subs r0, 0x1 + str r0, [r1] + adds r0, r7, 0 + bl sub_804F5D8 + movs r6, 0x3F +_0804FAD4: + movs r4, 0x4 + ldrsh r0, [r7, r4] + movs r5, 0 + ldrsh r1, [r7, r5] + subs r0, r1 + bl sub_8084100 + adds r4, r0, 0 + movs r1, 0x6 + ldrsh r0, [r7, r1] + movs r2, 0x2 + ldrsh r1, [r7, r2] + subs r0, r1 + bl sub_8084100 + adds r2, r0, 0 + adds r0, r4, r2 + movs r5, 0x1 + ands r0, r5 + cmp r0, 0 + beq _0804FB14 + movs r3, 0 + ldrsh r0, [r7, r3] + adds r0, r4 + movs r4, 0x2 + ldrsh r1, [r7, r4] + adds r1, r2 + bl sub_8049590 + movs r1, 0 + bl sub_804F5C4 +_0804FB14: + subs r6, 0x1 + cmp r6, 0 + bge _0804FAD4 + strb r5, [r7, 0x9] + b _0804FBD6 + .align 2, 0 +_0804FB20: .4byte gUnknown_202F1C8 +_0804FB24: + ldr r1, _0804FBC0 + ldr r0, [r1] + cmp r0, 0 + beq _0804FBD6 + subs r0, 0x1 + str r0, [r1] + movs r5, 0x4 + ldrsh r3, [r7, r5] + movs r0, 0 + ldrsh r2, [r7, r0] + subs r6, r3, r2 + movs r4, 0x1 + adds r0, r6, 0 + ands r0, r4 + cmp r0, 0 + beq _0804FB54 + movs r1, 0x6 + ldrsh r0, [r7, r1] + movs r5, 0x2 + ldrsh r1, [r7, r5] + subs r0, r1 + ands r0, r4 + cmp r0, 0 + bne _0804FBC4 +_0804FB54: + adds r0, r2, r3 + lsrs r1, r0, 31 + adds r0, r1 + asrs r5, r0, 1 + movs r0, 0x2 + ldrsh r3, [r7, r0] + movs r1, 0x6 + ldrsh r2, [r7, r1] + adds r0, r3, r2 + lsrs r1, r0, 31 + adds r0, r1 + asrs r4, r0, 1 + cmp r6, 0x4 + ble _0804FBAE + subs r0, r2, r3 + cmp r0, 0x4 + ble _0804FBAE + adds r0, r5, 0x1 + adds r1, r4, 0 + bl sub_8049590 + movs r1, 0 + bl sub_804F5C4 + adds r1, r4, 0x1 + adds r0, r5, 0 + bl sub_8049590 + movs r1, 0 + bl sub_804F5C4 + subs r0, r5, 0x1 + adds r1, r4, 0 + bl sub_8049590 + movs r1, 0 + bl sub_804F5C4 + subs r1, r4, 0x1 + adds r0, r5, 0 + bl sub_8049590 + movs r1, 0 + bl sub_804F5C4 +_0804FBAE: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8049590 + movs r1, 0 + bl sub_804F5C4 + b _0804FBD2 + .align 2, 0 +_0804FBC0: .4byte gUnknown_202F1C8 +_0804FBC4: + adds r0, r7, 0 + bl sub_804F5D8 + adds r0, r7, 0 + movs r1, 0x1 + bl sub_804F278 +_0804FBD2: + movs r0, 0x1 + strb r0, [r7, 0x9] +_0804FBD6: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_804F694 + + thumb_func_start sub_804FBE8 +sub_804FBE8: + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r6, 0 + ldr r0, _0804FC6C + adds r5, r0, 0 +_0804FBF4: + movs r4, 0 + adds r3, r6, 0x1 + mov r8, r3 +_0804FBFA: + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_8049590 + adds r2, r0, 0 + ldrh r1, [r2] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + beq _0804FC2A + movs r7, 0x88 + lsls r7, 1 + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _0804FC24 + ldrh r0, [r2, 0x4] + ldr r3, _0804FC70 + adds r1, r3, 0 + ands r0, r1 + strh r0, [r2, 0x4] +_0804FC24: + ldrh r0, [r2, 0x4] + ands r0, r5 + strh r0, [r2, 0x4] +_0804FC2A: + ldrh r3, [r2, 0x4] + movs r0, 0x1 + ands r0, r3 + cmp r0, 0 + beq _0804FC46 + ldrh r0, [r2] + movs r7, 0x80 + lsls r7, 2 + adds r1, r7, 0 + orrs r1, r0 + strh r1, [r2] + adds r0, r3, 0 + ands r0, r5 + strh r0, [r2, 0x4] +_0804FC46: + ldrh r1, [r2, 0x4] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0804FC56 + adds r0, r1, 0 + ands r0, r5 + strh r0, [r2, 0x4] +_0804FC56: + adds r4, 0x1 + cmp r4, 0x1F + ble _0804FBFA + mov r6, r8 + cmp r6, 0x37 + ble _0804FBF4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804FC6C: .4byte 0x0000fffb +_0804FC70: .4byte 0x0000fffd + thumb_func_end sub_804FBE8 + + thumb_func_start sub_804FC74 +sub_804FC74: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r5, 0 + movs r0, 0x3 + mov r8, r0 + ldr r0, _0804FCC8 + adds r7, r0, 0 +_0804FC86: + movs r4, 0 + adds r6, r5, 0x1 +_0804FC8A: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_804954C + ldrh r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + bne _0804FCAE + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8049590 + ldrh r1, [r0] + ands r1, r7 + mov r2, r8 + orrs r1, r2 + strh r1, [r0] +_0804FCAE: + adds r4, 0x1 + cmp r4, 0x1F + ble _0804FC8A + adds r5, r6, 0 + cmp r5, 0x37 + ble _0804FC86 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804FCC8: .4byte 0x0000fffc + thumb_func_end sub_804FC74 + + thumb_func_start sub_804FCCC +sub_804FCCC: + push {r4-r7,lr} + movs r5, 0 + ldr r0, _0804FD0C + adds r7, r0, 0 +_0804FCD4: + movs r4, 0 + adds r6, r5, 0x1 +_0804FCD8: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_804954C + ldrh r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0804FCF8 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8049590 + ldrh r1, [r0] + ands r1, r7 + strh r1, [r0] +_0804FCF8: + adds r4, 0x1 + cmp r4, 0x1F + ble _0804FCD8 + adds r5, r6, 0 + cmp r5, 0x37 + ble _0804FCD4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804FD0C: .4byte 0x0000fffc + thumb_func_end sub_804FCCC + + thumb_func_start sub_804FD10 +sub_804FD10: + movs r2, 0 + movs r3, 0 + strh r3, [r0] + strh r3, [r0, 0x4] + movs r1, 0xFF + strb r1, [r0, 0x9] + strb r2, [r0, 0x8] + strb r2, [r0, 0xA] + strb r2, [r0, 0xB] + strb r2, [r0, 0xC] + strb r2, [r0, 0xD] + strb r2, [r0, 0xE] + str r3, [r0, 0x10] + str r3, [r0, 0x14] + bx lr + thumb_func_end sub_804FD10 + + thumb_func_start sub_804FD30 +sub_804FD30: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + movs r6, 0 +_0804FD3A: + movs r7, 0 + adds r4, r6, 0x1 +_0804FD3E: + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_8049590 + bl sub_804FD10 + subs r3, r7, 0x1 + cmp r6, 0 + blt _0804FD5C + cmp r3, 0 + blt _0804FD5C + cmp r6, 0x37 + bgt _0804FD5C + cmp r3, 0x1F + ble _0804FD60 +_0804FD5C: + movs r0, 0x1 + b _0804FD62 +_0804FD60: + movs r0, 0 +_0804FD62: + cmp r0, 0 + bne _0804FE24 + cmp r4, 0 + blt _0804FD76 + cmp r3, 0 + blt _0804FD76 + cmp r4, 0x37 + bgt _0804FD76 + cmp r3, 0x1F + ble _0804FD7A +_0804FD76: + movs r0, 0x1 + b _0804FD7C +_0804FD7A: + movs r0, 0 +_0804FD7C: + cmp r0, 0 + bne _0804FE24 + cmp r4, 0 + blt _0804FD90 + cmp r3, 0 + blt _0804FD90 + cmp r4, 0x37 + bgt _0804FD90 + cmp r3, 0x1F + ble _0804FD94 +_0804FD90: + movs r0, 0x1 + b _0804FD96 +_0804FD94: + movs r0, 0 +_0804FD96: + cmp r0, 0 + bne _0804FE24 + adds r2, r7, 0x1 + cmp r4, 0 + blt _0804FDAC + cmp r2, 0 + blt _0804FDAC + cmp r4, 0x37 + bgt _0804FDAC + cmp r2, 0x1F + ble _0804FDB0 +_0804FDAC: + movs r0, 0x1 + b _0804FDB2 +_0804FDB0: + movs r0, 0 +_0804FDB2: + cmp r0, 0 + bne _0804FE24 + cmp r6, 0 + blt _0804FDC6 + cmp r2, 0 + blt _0804FDC6 + cmp r6, 0x37 + bgt _0804FDC6 + cmp r2, 0x1F + ble _0804FDCA +_0804FDC6: + movs r0, 0x1 + b _0804FDCC +_0804FDCA: + movs r0, 0 +_0804FDCC: + cmp r0, 0 + bne _0804FE24 + adds r0, r2, 0 + subs r1, r6, 0x1 + cmp r1, 0 + blt _0804FDE4 + cmp r0, 0 + blt _0804FDE4 + cmp r1, 0x37 + bgt _0804FDE4 + cmp r2, 0x1F + ble _0804FDE8 +_0804FDE4: + movs r0, 0x1 + b _0804FDEA +_0804FDE8: + movs r0, 0 +_0804FDEA: + cmp r0, 0 + bne _0804FE24 + cmp r1, 0 + blt _0804FDFE + cmp r7, 0 + blt _0804FDFE + cmp r1, 0x37 + bgt _0804FDFE + cmp r7, 0x1F + ble _0804FE02 +_0804FDFE: + movs r0, 0x1 + b _0804FE04 +_0804FE02: + movs r0, 0 +_0804FE04: + cmp r0, 0 + bne _0804FE24 + adds r0, r3, 0 + cmp r1, 0 + blt _0804FE1A + cmp r0, 0 + blt _0804FE1A + cmp r1, 0x37 + bgt _0804FE1A + cmp r3, 0x1F + ble _0804FE1E +_0804FE1A: + movs r0, 0x1 + b _0804FE20 +_0804FE1E: + movs r0, 0 +_0804FE20: + cmp r0, 0 + beq _0804FE34 +_0804FE24: + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_8049590 + ldrh r2, [r0] + movs r1, 0x10 + orrs r1, r2 + strh r1, [r0] +_0804FE34: + adds r7, 0x1 + cmp r7, 0x1F + ble _0804FD3E + adds r6, 0x1 + cmp r6, 0x37 + bgt _0804FE42 + b _0804FD3A +_0804FE42: + ldr r3, _0804FEB4 + ldr r1, [r3] + ldr r0, _0804FEB8 + adds r2, r1, r0 + ldr r0, _0804FEBC + strh r0, [r2] + ldr r2, _0804FEC0 + adds r1, r2 + movs r0, 0x1 + negs r0, r0 + strh r0, [r1] + movs r6, 0 + mov r8, r3 + ldr r1, _0804FEC4 +_0804FE5E: + adds r5, r1, 0 + movs r4, 0 + movs r7, 0x7 +_0804FE64: + mov r2, r8 + ldr r0, [r2] + adds r0, r5 + adds r0, r4 + str r1, [sp] + bl sub_804FD10 + adds r4, 0x18 + subs r7, 0x1 + ldr r1, [sp] + cmp r7, 0 + bge _0804FE64 + adds r1, 0xC0 + adds r6, 0x1 + cmp r6, 0x7 + ble _0804FE5E + ldr r0, _0804FEB4 + ldr r1, [r0] + ldr r2, _0804FEC8 + adds r1, r2 + movs r2, 0 + strh r2, [r1] + movs r6, 0 + adds r4, r0, 0 + ldr r3, _0804FECC +_0804FE96: + ldr r0, [r4] + lsls r1, r6, 2 + adds r0, r3 + adds r0, r1 + ldr r0, [r0] + str r2, [r0] + adds r6, 0x1 + cmp r6, 0x3F + ble _0804FE96 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0804FEB4: .4byte gUnknown_203B418 +_0804FEB8: .4byte 0x0000e21c +_0804FEBC: .4byte 0x0000ffff +_0804FEC0: .4byte 0x0000e21e +_0804FEC4: .4byte 0x0000e27c +_0804FEC8: .4byte 0x00003904 +_0804FECC: .4byte 0x0001371c + thumb_func_end sub_804FD30 + + thumb_func_start sub_804FED0 +sub_804FED0: + push {r4-r7,lr} + adds r7, r0, 0 + adds r5, r1, 0 + movs r6, 0 + b _0804FEFA +_0804FEDA: + adds r0, r5, 0 + bl sub_8084100 + adds r4, r0, 0 + adds r0, r5, 0 + bl sub_8084100 + lsls r4, 2 + adds r4, r7 + ldr r2, [r4] + lsls r0, 2 + adds r0, r7 + ldr r1, [r0] + str r1, [r4] + str r2, [r0] + adds r6, 0x1 +_0804FEFA: + lsls r0, r5, 1 + cmp r6, r0 + blt _0804FEDA + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_804FED0 + + thumb_func_start sub_804FF08 +sub_804FF08: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, _08050234 + add sp, r4 + mov r10, r0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0xE0 + lsls r0, 5 + add r0, sp + str r1, [r0] + ldr r0, _08050238 + ldr r0, [r0] + mov r9, r0 + ldr r0, _0805023C + add r0, r9 + movs r1, 0 + ldrsh r0, [r0, r1] + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _0804FF46 + ldr r0, _08050240 + add r0, r9 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, r1 + bne _08050038 +_0804FF46: + movs r0, 0 + mov r8, r0 + movs r6, 0 +_0804FF4C: + movs r5, 0 + mov r1, r8 + lsls r0, r1, 2 + mov r2, sp + adds r4, r0, r2 +_0804FF56: + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_804954C + adds r1, r0, 0 + ldrh r2, [r1] + movs r0, 0x3 + ands r0, r2 + cmp r0, 0x1 + bne _0804FFAA + ldrb r0, [r1, 0x9] + cmp r0, 0xFF + beq _0804FFAA + movs r0, 0x20 + ands r0, r2 + cmp r0, 0 + bne _0804FFAA + ldrh r1, [r1, 0x4] + movs r3, 0x8 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _0804FFAA + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _0804FFAA + adds r0, r3, 0 + ands r0, r2 + cmp r0, 0 + bne _0804FFAA + movs r1, 0x80 + lsls r1, 1 + adds r0, r1, 0 + ands r0, r2 + cmp r0, 0 + bne _0804FFAA + strb r6, [r4] + strb r5, [r4, 0x1] + adds r4, 0x4 + movs r2, 0x1 + add r8, r2 +_0804FFAA: + adds r5, 0x1 + cmp r5, 0x1F + ble _0804FF56 + adds r6, 0x1 + cmp r6, 0x37 + ble _0804FF4C + mov r0, r8 + cmp r0, 0 + beq _08050038 + bl sub_8084100 + lsls r0, 2 + mov r1, sp + adds r4, r1, r0 + ldrb r0, [r4] + ldrb r1, [r4, 0x1] + bl sub_8049590 + adds r5, r0, 0 + ldrh r1, [r5, 0x4] + movs r0, 0x1 + orrs r0, r1 + ldr r1, _08050244 + ands r0, r1 + strh r0, [r5, 0x4] + ldr r1, _08050248 + ldrb r0, [r5, 0x9] + strb r0, [r1] + ldrb r1, [r4] + ldr r0, _0805023C + add r0, r9 + strh r1, [r0] + ldrb r1, [r4, 0x1] + ldr r0, _08050240 + add r0, r9 + strh r1, [r0] + bl sub_8043D10 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08050038 + ldrb r4, [r5, 0x9] + movs r6, 0 +_08050002: + movs r5, 0 +_08050004: + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_8049590 + adds r1, r0, 0 + ldrh r2, [r1] + movs r0, 0x3 + ands r0, r2 + cmp r0, 0x1 + bne _0805002C + ldrb r0, [r1, 0x9] + cmp r0, r4 + bne _0805002C + movs r0, 0x40 + orrs r0, r2 + strh r0, [r1] + ldrb r1, [r1, 0x9] + ldr r0, _0805024C + add r0, r9 + strb r1, [r0] +_0805002C: + adds r5, 0x1 + cmp r5, 0x1F + ble _08050004 + adds r6, 0x1 + cmp r6, 0x37 + ble _08050002 +_08050038: + movs r2, 0 + mov r8, r2 + movs r6, 0 +_0805003E: + movs r5, 0 + adds r7, r6, 0x1 + mov r1, r8 + lsls r0, r1, 2 + mov r2, sp + adds r4, r0, r2 +_0805004A: + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_804954C + adds r1, r0, 0 + ldrh r2, [r1] + movs r0, 0x3 + ands r0, r2 + cmp r0, 0x1 + bne _08050092 + ldrb r0, [r1, 0x9] + cmp r0, 0xFF + beq _08050092 + movs r0, 0x20 + ands r0, r2 + cmp r0, 0 + bne _08050092 + movs r0, 0x40 + ands r0, r2 + cmp r0, 0 + bne _08050092 + movs r0, 0x8 + ands r0, r2 + cmp r0, 0 + bne _08050092 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1, 0 + ands r0, r2 + cmp r0, 0 + bne _08050092 + strb r6, [r4] + strb r5, [r4, 0x1] + adds r4, 0x4 + movs r2, 0x1 + add r8, r2 +_08050092: + adds r5, 0x1 + cmp r5, 0x1F + ble _0805004A + adds r6, r7, 0 + cmp r6, 0x37 + ble _0805003E + mov r0, r8 + cmp r0, 0 + beq _080500FA + mov r1, r10 + ldrb r4, [r1, 0xF] + cmp r4, 0 + beq _080500FA + subs r0, r4, 0x2 + adds r1, r4, 0x2 + bl sub_808411C + adds r4, r0, 0 + cmp r4, 0 + bgt _080500BC + movs r4, 0x1 +_080500BC: + mov r0, sp + mov r1, r8 + bl sub_804FED0 + mov r0, r8 + bl sub_8084100 + adds r5, r0, 0 + cmp r4, 0 + ble _080500FA + adds r6, r4, 0 + lsls r0, r5, 2 + mov r2, sp + adds r4, r0, r2 +_080500D8: + ldrb r0, [r4] + ldrb r1, [r4, 0x1] + bl sub_8049590 + ldrh r2, [r0, 0x4] + movs r1, 0x2 + orrs r1, r2 + strh r1, [r0, 0x4] + adds r4, 0x4 + adds r5, 0x1 + cmp r5, r8 + bne _080500F4 + mov r4, sp + movs r5, 0 +_080500F4: + subs r6, 0x1 + cmp r6, 0 + bne _080500D8 +_080500FA: + movs r0, 0 + mov r8, r0 + movs r6, 0 +_08050100: + movs r5, 0 + adds r7, r6, 0x1 + mov r1, r8 + lsls r0, r1, 2 + mov r2, sp + adds r4, r0, r2 +_0805010C: + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_804954C + ldrh r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _08050128 + strb r6, [r4] + strb r5, [r4, 0x1] + adds r4, 0x4 + movs r0, 0x1 + add r8, r0 +_08050128: + adds r5, 0x1 + cmp r5, 0x1F + ble _0805010C + adds r6, r7, 0 + cmp r6, 0x37 + ble _08050100 + mov r1, r8 + cmp r1, 0 + beq _0805018E + mov r2, r10 + ldrb r4, [r2, 0x14] + cmp r4, 0 + beq _0805018E + subs r0, r4, 0x2 + adds r1, r4, 0x2 + bl sub_808411C + adds r4, r0, 0 + cmp r4, 0 + ble _0805018E + mov r0, sp + mov r1, r8 + bl sub_804FED0 + mov r0, r8 + bl sub_8084100 + adds r5, r0, 0 + cmp r4, 0 + ble _0805018E + adds r6, r4, 0 + lsls r0, r5, 2 + mov r1, sp + adds r4, r0, r1 +_0805016C: + ldrb r0, [r4] + ldrb r1, [r4, 0x1] + bl sub_8049590 + ldrh r2, [r0, 0x4] + movs r1, 0x2 + orrs r1, r2 + strh r1, [r0, 0x4] + adds r4, 0x4 + adds r5, 0x1 + cmp r5, r8 + bne _08050188 + mov r4, sp + movs r5, 0 +_08050188: + subs r6, 0x1 + cmp r6, 0 + bne _0805016C +_0805018E: + movs r2, 0 + mov r8, r2 + movs r0, 0xE0 + lsls r0, 5 + add r0, sp + ldr r0, [r0] + cmp r0, 0 + bne _080501E4 + movs r6, 0 +_080501A0: + movs r5, 0 + adds r7, r6, 0x1 + mov r1, r8 + lsls r0, r1, 2 + mov r2, sp + adds r4, r0, r2 +_080501AC: + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_804954C + ldrh r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _080501D8 + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080501D8 + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _080501D8 + strb r6, [r4] + strb r5, [r4, 0x1] + adds r4, 0x4 + movs r0, 0x1 + add r8, r0 +_080501D8: + adds r5, 0x1 + cmp r5, 0x1F + ble _080501AC + adds r6, r7, 0 + cmp r6, 0x37 + ble _080501A0 +_080501E4: + mov r1, r8 + cmp r1, 0 + beq _08050294 + lsrs r4, r1, 31 + add r4, r8 + asrs r4, 1 + lsls r0, r1, 3 + movs r1, 0xA + bl __divsi3 + adds r1, r0, 0 + adds r0, r4, 0 + bl sub_808411C + adds r4, r0, 0 + cmp r4, 0x5 + bgt _08050208 + movs r4, 0x6 +_08050208: + ldr r0, _08050250 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r4, r0 + blt _08050214 + adds r4, r0, 0 +_08050214: + mov r0, sp + mov r1, r8 + bl sub_804FED0 + mov r0, r8 + bl sub_8084100 + adds r5, r0, 0 + cmp r4, 0 + ble _08050294 + adds r6, r4, 0 + lsls r0, r5, 2 + mov r1, sp + adds r7, r0, r1 +_08050230: + ldrb r0, [r7] + b _08050254 + .align 2, 0 +_08050234: .4byte 0xffffe3fc +_08050238: .4byte gUnknown_203B418 +_0805023C: .4byte 0x0000e21c +_08050240: .4byte 0x0000e21e +_08050244: .4byte 0x0000fffd +_08050248: .4byte gUnknown_202F1B4 +_0805024C: .4byte 0x00003a0c +_08050250: .4byte gUnknown_80F4DA0 +_08050254: + ldrb r1, [r7, 0x1] + bl sub_8049590 + adds r4, r0, 0 + movs r0, 0x2 + bl sub_8084100 + cmp r0, 0 + beq _0805026C + ldrh r0, [r4, 0x4] + movs r1, 0x2 + b _0805027E +_0805026C: + ldr r0, _08050424 + ldr r0, [r0] + ldr r2, _08050428 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _08050282 + ldrh r0, [r4, 0x4] + movs r1, 0x4 +_0805027E: + orrs r0, r1 + strh r0, [r4, 0x4] +_08050282: + adds r7, 0x4 + adds r5, 0x1 + cmp r5, r8 + bne _0805028E + mov r7, sp + movs r5, 0 +_0805028E: + subs r6, 0x1 + cmp r6, 0 + bne _08050230 +_08050294: + movs r0, 0 + mov r8, r0 + movs r6, 0 +_0805029A: + movs r5, 0 + adds r7, r6, 0x1 + mov r1, r8 + lsls r0, r1, 2 + mov r2, sp + adds r4, r0, r2 +_080502A6: + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_804954C + adds r1, r0, 0 + ldrh r2, [r1] + movs r0, 0x3 + ands r0, r2 + cmp r0, 0x1 + bne _080502F0 + ldrb r0, [r1, 0x9] + cmp r0, 0xFF + beq _080502F0 + movs r0, 0x20 + ands r0, r2 + cmp r0, 0 + bne _080502F0 + ldrh r1, [r1, 0x4] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080502F0 + movs r0, 0x8 + ands r0, r2 + cmp r0, 0 + bne _080502F0 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1, 0 + ands r0, r2 + cmp r0, 0 + bne _080502F0 + strb r6, [r4] + strb r5, [r4, 0x1] + adds r4, 0x4 + movs r2, 0x1 + add r8, r2 +_080502F0: + adds r5, 0x1 + cmp r5, 0x1F + ble _080502A6 + adds r6, r7, 0 + cmp r6, 0x37 + ble _0805029A + mov r0, r8 + cmp r0, 0 + beq _08050356 + mov r2, r10 + ldrb r1, [r2, 0x10] + lsrs r0, r1, 1 + bl sub_808411C + adds r4, r0, 0 + cmp r4, 0 + ble _08050356 + cmp r4, 0x37 + ble _08050318 + movs r4, 0x38 +_08050318: + mov r0, sp + mov r1, r8 + bl sub_804FED0 + mov r0, r8 + bl sub_8084100 + adds r5, r0, 0 + cmp r4, 0 + ble _08050356 + adds r6, r4, 0 + lsls r0, r5, 2 + mov r1, sp + adds r4, r0, r1 +_08050334: + ldrb r0, [r4] + ldrb r1, [r4, 0x1] + bl sub_8049590 + ldrh r2, [r0, 0x4] + movs r1, 0x4 + orrs r1, r2 + strh r1, [r0, 0x4] + adds r4, 0x4 + adds r5, 0x1 + cmp r5, r8 + bne _08050350 + mov r4, sp + movs r5, 0 +_08050350: + subs r6, 0x1 + cmp r6, 0 + bne _08050334 +_08050356: + ldr r0, _0805042C + add r0, r9 + movs r2, 0 + ldrsh r0, [r0, r2] + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _08050372 + ldr r0, _08050430 + add r0, r9 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, r1 + bne _08050410 +_08050372: + movs r0, 0 + mov r8, r0 + movs r6, 0 +_08050378: + movs r5, 0 + adds r7, r6, 0x1 + mov r1, r8 + lsls r0, r1, 2 + mov r2, sp + adds r4, r0, r2 +_08050384: + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_804954C + adds r2, r0, 0 + ldrh r1, [r2] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + bne _080503E2 + ldrb r0, [r2, 0x9] + cmp r0, 0xFF + beq _080503E2 + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _080503E2 + movs r3, 0x8 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _080503E2 + movs r0, 0x80 + lsls r0, 1 + mov r10, r0 + mov r0, r10 + ands r0, r1 + cmp r0, 0 + bne _080503E2 + ldrh r1, [r2, 0x4] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080503E2 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _080503E2 + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _080503E2 + strb r6, [r4] + strb r5, [r4, 0x1] + adds r4, 0x4 + movs r1, 0x1 + add r8, r1 +_080503E2: + adds r5, 0x1 + cmp r5, 0x1F + ble _08050384 + adds r6, r7, 0 + cmp r6, 0x37 + ble _08050378 + mov r2, r8 + cmp r2, 0 + beq _08050410 + mov r0, r8 + bl sub_8084100 + lsls r0, 2 + mov r1, sp + adds r2, r1, r0 + ldrb r1, [r2] + ldr r0, _0805042C + add r0, r9 + strh r1, [r0] + ldrb r1, [r2, 0x1] + ldr r0, _08050430 + add r0, r9 + strh r1, [r0] +_08050410: + ldr r3, _08050434 + add sp, r3 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08050424: .4byte gUnknown_203B418 +_08050428: .4byte 0x0000065c +_0805042C: .4byte 0x0000e218 +_08050430: .4byte 0x0000e21a +_08050434: .4byte 0x00001c04 + thumb_func_end sub_804FF08 + + thumb_func_start sub_8050438 +sub_8050438: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, _08050470 + add sp, r4 + lsls r1, 24 + lsrs r1, 24 + movs r2, 0xE0 + lsls r2, 5 + add r2, sp + str r1, [r2] + ldr r1, _08050474 + ldr r1, [r1] + mov r10, r1 + ldrb r1, [r0, 0x6] + cmp r1, 0 + ble _08050478 + lsrs r0, r1, 1 + bl sub_808411C + adds r7, r0, 0 + cmp r7, 0 + bgt _0805047A + movs r7, 0x1 + b _0805047A + .align 2, 0 +_08050470: .4byte 0xffffe3f8 +_08050474: .4byte gUnknown_203B418 +_08050478: + adds r7, r1, 0 +_0805047A: + movs r0, 0 + mov r8, r0 + movs r6, 0 +_08050480: + movs r5, 0 + adds r1, r6, 0x1 + mov r9, r1 + mov r2, r8 + lsls r0, r2, 2 + mov r1, sp + adds r4, r0, r1 +_0805048E: + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_804954C + adds r1, r0, 0 + ldrh r3, [r1] + movs r2, 0x3 + ands r2, r3 + cmp r2, 0x1 + bne _080504F6 + ldrb r0, [r1, 0x9] + cmp r0, 0xFF + beq _080504F6 + movs r0, 0x20 + ands r0, r3 + cmp r0, 0 + bne _080504F6 + ldrh r1, [r1, 0x4] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080504F6 + ands r2, r1 + cmp r2, 0 + bne _080504F6 + movs r0, 0x8 + ands r0, r3 + cmp r0, 0 + bne _080504F6 + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + ands r0, r3 + cmp r0, 0 + bne _080504F6 + ldr r0, _080506A0 + add r0, r10 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r6, r0 + bne _080504EC + ldr r0, _080506A4 + add r0, r10 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r5, r0 + beq _080504F6 +_080504EC: + strb r6, [r4] + strb r5, [r4, 0x1] + adds r4, 0x4 + movs r0, 0x1 + add r8, r0 +_080504F6: + adds r5, 0x1 + cmp r5, 0x1F + ble _0805048E + mov r6, r9 + cmp r6, 0x37 + ble _08050480 + mov r1, r8 + cmp r1, 0 + beq _0805055E + ldr r0, _080506A8 + ldr r0, [r0] + movs r2, 0xD1 + lsls r2, 3 + adds r0, r2 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _0805051C + adds r7, 0x1 +_0805051C: + cmp r7, 0 + beq _0805055E + mov r0, sp + mov r1, r8 + bl sub_804FED0 + mov r0, r8 + bl sub_8084100 + adds r5, r0, 0 + cmp r7, 0 + ble _0805055E + adds r6, r7, 0 + lsls r0, r5, 2 + mov r2, sp + adds r4, r0, r2 +_0805053C: + ldrb r0, [r4] + ldrb r1, [r4, 0x1] + bl sub_8049590 + ldrh r2, [r0, 0x4] + movs r1, 0x8 + orrs r1, r2 + strh r1, [r0, 0x4] + adds r4, 0x4 + adds r5, 0x1 + cmp r5, r8 + bne _08050558 + mov r4, sp + movs r5, 0 +_08050558: + subs r6, 0x1 + cmp r6, 0 + bne _0805053C +_0805055E: + ldr r0, _080506AC + add r0, r10 + ldrb r0, [r0] + cmp r0, 0 + bne _0805056A + b _0805068C +_0805056A: + ldr r0, _080506B0 + movs r2, 0 + ldrsh r1, [r0, r2] + ldr r2, _080506B4 + add r2, sp + str r1, [r2] + movs r0, 0 + mov r8, r0 + movs r1, 0xE0 + lsls r1, 5 + add r1, sp + ldr r1, [r1] + cmp r1, 0 + beq _0805058A + movs r0, 0x3 + str r0, [r2] +_0805058A: + ldr r1, _080506B4 + add r1, sp + ldr r1, [r1] + lsls r0, r1, 1 + adds r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + ldr r1, _080506B4 + add r1, sp + str r0, [r1] + movs r6, 0 +_080505A2: + movs r5, 0 + adds r2, r6, 0x1 + mov r9, r2 + mov r1, r8 + lsls r0, r1, 2 + mov r2, sp + adds r4, r0, r2 +_080505B0: + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_804954C + adds r1, r0, 0 + ldrh r2, [r1] + movs r0, 0x3 + ands r0, r2 + cmp r0, 0x1 + bne _08050608 + ldrb r0, [r1, 0x9] + cmp r0, 0xFF + beq _08050608 + movs r0, 0x20 + ands r0, r2 + cmp r0, 0 + bne _08050608 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1, 0 + ands r0, r2 + cmp r0, 0 + bne _08050608 + movs r0, 0x40 + ands r0, r2 + cmp r0, 0 + beq _08050608 + ldr r0, _080506A0 + add r0, r10 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r6, r0 + bne _080505FE + ldr r0, _080506A4 + add r0, r10 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r5, r0 + beq _08050608 +_080505FE: + strb r6, [r4] + strb r5, [r4, 0x1] + adds r4, 0x4 + movs r2, 0x1 + add r8, r2 +_08050608: + adds r5, 0x1 + cmp r5, 0x1F + ble _080505B0 + mov r6, r9 + cmp r6, 0x37 + ble _080505A2 + mov r0, r8 + cmp r0, 0 + beq _0805068C + lsls r4, r0, 3 + subs r0, r4, r0 + movs r1, 0xA + bl __divsi3 + adds r5, r0, 0 + adds r0, r4, 0 + movs r1, 0xA + bl __divsi3 + adds r1, r0, 0 + adds r0, r5, 0 + bl sub_808411C + adds r7, r0, 0 + cmp r7, 0 + bne _0805063E + movs r7, 0x1 +_0805063E: + ldr r1, _080506B4 + add r1, sp + ldr r1, [r1] + cmp r7, r1 + blt _0805064E + ldr r2, _080506B4 + add r2, sp + ldr r7, [r2] +_0805064E: + mov r0, sp + mov r1, r8 + bl sub_804FED0 + mov r0, r8 + bl sub_8084100 + adds r5, r0, 0 + cmp r7, 0 + ble _0805068C + adds r6, r7, 0 + lsls r0, r5, 2 + mov r1, sp + adds r4, r0, r1 +_0805066A: + ldrb r0, [r4] + ldrb r1, [r4, 0x1] + bl sub_8049590 + ldrh r2, [r0, 0x4] + movs r1, 0x8 + orrs r1, r2 + strh r1, [r0, 0x4] + adds r4, 0x4 + adds r5, 0x1 + cmp r5, r8 + bne _08050686 + mov r4, sp + movs r5, 0 +_08050686: + subs r6, 0x1 + cmp r6, 0 + bne _0805066A +_0805068C: + ldr r3, _080506B8 + add sp, r3 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080506A0: .4byte 0x0000e218 +_080506A4: .4byte 0x0000e21a +_080506A8: .4byte gUnknown_203B418 +_080506AC: .4byte 0x00003a08 +_080506B0: .4byte gUnknown_80F4DA4 +_080506B4: .4byte 0x00001c04 +_080506B8: .4byte 0x00001c08 + thumb_func_end sub_8050438 + + thumb_func_start sub_80506BC +sub_80506BC: + push {lr} + adds r3, r0, 0 + movs r2, 0x1 + ldrh r1, [r3] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _080506CE + movs r2, 0 +_080506CE: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080506D8 + movs r2, 0 +_080506D8: + cmp r2, 0 + beq _080506E6 + ldr r0, _080506EC + ands r0, r1 + movs r1, 0x2 + orrs r0, r1 + strh r0, [r3] +_080506E6: + pop {r0} + bx r0 + .align 2, 0 +_080506EC: .4byte 0x0000fffc + thumb_func_end sub_80506BC + + thumb_func_start sub_80506F0 +sub_80506F0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xA4 + str r1, [sp, 0x64] + ldrb r1, [r1, 0xD] + ands r1, r0 + cmp r1, 0 + bne _08050708 + b _08050C20 +_08050708: + ldr r4, _08050738 + movs r0, 0x8 + bl sub_8084100 + lsls r0, 2 + adds r0, r4 + ldr r4, [r0] + cmp r4, 0 + bne _0805071C + b _08050A7C +_0805071C: + movs r0, 0x64 + bl sub_8084100 + cmp r0, 0x31 + bgt _0805073C + movs r0, 0x1 + str r0, [sp, 0x74] + movs r1, 0x1F + mov r10, r1 + movs r2, 0x1 + negs r2, r2 + str r2, [sp, 0x70] + b _08050746 + .align 2, 0 +_08050738: .4byte gUnknown_80F6DF8 +_0805073C: + movs r0, 0 + str r0, [sp, 0x74] + mov r10, r0 + movs r1, 0x1 + str r1, [sp, 0x70] +_08050746: + movs r0, 0x32 + bl sub_8084100 + adds r0, 0xA + str r0, [sp, 0x78] + movs r0, 0x2 + movs r1, 0x36 + bl sub_808411C + mov r9, r0 + movs r2, 0 + str r2, [sp, 0x6C] + subs r4, 0x1 + str r4, [sp, 0x98] +_08050762: + movs r0, 0x6 + bl sub_8084100 + adds r0, 0x2 + str r0, [sp, 0x68] + cmp r0, 0 + bne _08050772 + b _08050A38 +_08050772: + mov r0, r9 + cmp r0, 0x37 + bhi _080507B8 + mov r1, r10 + bl sub_804954C + ldrh r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + bne _0805078A + b _08050A74 +_0805078A: + mov r1, r9 + cmp r1, 0 + blt _080507A2 + mov r2, r10 + cmp r2, 0 + blt _080507A2 + mov r0, r9 + cmp r0, 0x37 + bgt _080507A2 + mov r1, r10 + cmp r1, 0x1F + ble _080507A6 +_080507A2: + movs r0, 0x1 + b _080507A8 +_080507A6: + movs r0, 0 +_080507A8: + cmp r0, 0 + bne _080507B8 + mov r0, r9 + mov r1, r10 + bl sub_8049590 + bl sub_80506BC +_080507B8: + ldr r2, [sp, 0x68] + subs r2, 0x1 + str r2, [sp, 0x68] + ldr r0, [sp, 0x6C] + add r9, r0 + ldr r1, [sp, 0x70] + add r10, r1 + mov r2, r10 + cmp r2, 0x1F + bls _080507CE + b _08050A38 +_080507CE: + ldr r0, [sp, 0x78] + subs r0, 0x1 + str r0, [sp, 0x78] + cmp r0, 0 + beq _080507DA + b _08050A30 +_080507DA: + movs r1, 0x3F + str r1, [sp, 0x7C] +_080507DE: + movs r0, 0x7 + bl sub_8084100 + subs r0, 0x3 + str r0, [sp, 0x84] + movs r0, 0x7 + bl sub_8084100 + subs r1, r0, 0x3 + ldr r6, [sp, 0x84] + add r6, r9 + subs r0, r6, 0x2 + cmp r0, 0x33 + bhi _080508DA + mov r2, r10 + adds r5, r1, r2 + cmp r5, 0x1 + ble _080508DA + cmp r5, 0x1D + bgt _080508DA + adds r4, r6, 0x1 + adds r0, r5, 0x1 + mov r8, r0 + adds r0, r4, 0 + mov r1, r8 + bl sub_804954C + ldrh r1, [r0] + movs r2, 0x3 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0x2 + beq _080508B2 + adds r0, r4, 0 + adds r1, r5, 0 + str r2, [sp, 0x9C] + bl sub_804954C + ldrh r1, [r0] + ldr r2, [sp, 0x9C] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0x2 + beq _080508B2 + subs r7, r5, 0x1 + adds r0, r4, 0 + adds r1, r7, 0 + bl sub_804954C + ldrh r1, [r0] + ldr r2, [sp, 0x9C] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0x2 + beq _080508B2 + adds r0, r6, 0 + mov r1, r8 + bl sub_804954C + ldrh r1, [r0] + ldr r2, [sp, 0x9C] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0x2 + beq _080508B2 + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_804954C + ldrh r1, [r0] + ldr r2, [sp, 0x9C] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0x2 + beq _080508B2 + subs r4, r6, 0x1 + adds r0, r4, 0 + mov r1, r8 + bl sub_804954C + ldrh r1, [r0] + ldr r2, [sp, 0x9C] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0x2 + beq _080508B2 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_804954C + ldrh r1, [r0] + ldr r2, [sp, 0x9C] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0x2 + beq _080508B2 + adds r0, r4, 0 + adds r1, r7, 0 + bl sub_804954C + ldrh r1, [r0] + ldr r2, [sp, 0x9C] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0x2 + bne _080508DA +_080508B2: + ldr r0, [sp, 0x84] + add r0, r9 + cmp r0, 0 + blt _080508C6 + cmp r5, 0 + blt _080508C6 + cmp r0, 0x37 + bgt _080508C6 + cmp r5, 0x1F + ble _080508CA +_080508C6: + movs r1, 0x1 + b _080508CC +_080508CA: + movs r1, 0 +_080508CC: + cmp r1, 0 + bne _080508DA + adds r1, r5, 0 + bl sub_8049590 + bl sub_80506BC +_080508DA: + ldr r1, [sp, 0x7C] + subs r1, 0x1 + str r1, [sp, 0x7C] + cmp r1, 0 + blt _080508E6 + b _080507DE +_080508E6: + movs r0, 0x3 + negs r0, r0 +_080508EA: + movs r2, 0x3 + negs r2, r2 + str r2, [sp, 0x80] + mov r1, r9 + adds r1, r0, r1 + str r1, [sp, 0x90] + adds r0, 0x1 + str r0, [sp, 0x8C] + adds r7, r1, 0 + mov r5, r10 + subs r5, 0x3 +_08050900: + movs r6, 0 + subs r0, r7, 0x2 + cmp r0, 0x33 + bls _0805090A + b _08050A1A +_0805090A: + str r5, [sp, 0x88] + str r5, [sp, 0x94] + cmp r5, 0x1 + bgt _08050914 + b _08050A1A +_08050914: + cmp r5, 0x1D + ble _0805091A + b _08050A1A +_0805091A: + adds r4, r7, 0x1 + adds r3, r5, 0x1 + adds r0, r4, 0 + adds r1, r3, 0 + str r3, [sp, 0xA0] + bl sub_804954C + ldrh r1, [r0] + movs r2, 0x3 + mov r8, r2 + mov r0, r8 + ands r0, r1 + ldr r3, [sp, 0xA0] + cmp r0, 0x2 + bne _0805093A + movs r6, 0x1 +_0805093A: + adds r0, r4, 0 + adds r1, r5, 0 + str r3, [sp, 0xA0] + bl sub_804954C + ldrh r1, [r0] + mov r0, r8 + ands r0, r1 + ldr r3, [sp, 0xA0] + cmp r0, 0x2 + bne _08050952 + adds r6, 0x1 +_08050952: + subs r2, r5, 0x1 + adds r0, r4, 0 + adds r1, r2, 0 + str r2, [sp, 0x9C] + str r3, [sp, 0xA0] + bl sub_804954C + ldrh r1, [r0] + mov r0, r8 + ands r0, r1 + ldr r2, [sp, 0x9C] + ldr r3, [sp, 0xA0] + cmp r0, 0x2 + bne _08050970 + adds r6, 0x1 +_08050970: + adds r0, r7, 0 + adds r1, r3, 0 + str r2, [sp, 0x9C] + str r3, [sp, 0xA0] + bl sub_804954C + ldrh r1, [r0] + mov r0, r8 + ands r0, r1 + ldr r2, [sp, 0x9C] + ldr r3, [sp, 0xA0] + cmp r0, 0x2 + bne _0805098C + adds r6, 0x1 +_0805098C: + adds r0, r7, 0 + adds r1, r2, 0 + str r2, [sp, 0x9C] + str r3, [sp, 0xA0] + bl sub_804954C + ldrh r1, [r0] + mov r0, r8 + ands r0, r1 + ldr r2, [sp, 0x9C] + ldr r3, [sp, 0xA0] + cmp r0, 0x2 + bne _080509A8 + adds r6, 0x1 +_080509A8: + subs r4, r7, 0x1 + adds r0, r4, 0 + adds r1, r3, 0 + str r2, [sp, 0x9C] + bl sub_804954C + ldrh r1, [r0] + mov r0, r8 + ands r0, r1 + ldr r2, [sp, 0x9C] + cmp r0, 0x2 + bne _080509C2 + adds r6, 0x1 +_080509C2: + adds r0, r4, 0 + adds r1, r5, 0 + str r2, [sp, 0x9C] + bl sub_804954C + ldrh r1, [r0] + mov r0, r8 + ands r0, r1 + ldr r2, [sp, 0x9C] + cmp r0, 0x2 + bne _080509DA + adds r6, 0x1 +_080509DA: + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_804954C + ldrh r1, [r0] + mov r0, r8 + ands r0, r1 + cmp r0, 0x2 + bne _080509EE + adds r6, 0x1 +_080509EE: + cmp r6, 0x3 + ble _08050A1A + cmp r7, 0 + blt _08050A04 + cmp r5, 0 + blt _08050A04 + cmp r7, 0x37 + bgt _08050A04 + ldr r0, [sp, 0x88] + cmp r0, 0x1F + ble _08050A08 +_08050A04: + movs r0, 0x1 + b _08050A0A +_08050A08: + movs r0, 0 +_08050A0A: + cmp r0, 0 + bne _08050A1A + ldr r0, [sp, 0x90] + ldr r1, [sp, 0x94] + bl sub_8049590 + bl sub_80506BC +_08050A1A: + adds r5, 0x1 + ldr r1, [sp, 0x80] + adds r1, 0x1 + str r1, [sp, 0x80] + cmp r1, 0x3 + bgt _08050A28 + b _08050900 +_08050A28: + ldr r0, [sp, 0x8C] + cmp r0, 0x3 + bgt _08050A30 + b _080508EA +_08050A30: + ldr r2, [sp, 0x68] + cmp r2, 0 + beq _08050A38 + b _08050772 +_08050A38: + ldr r0, [sp, 0x6C] + cmp r0, 0 + beq _08050A54 + movs r1, 0x1 + str r1, [sp, 0x70] + ldr r2, [sp, 0x74] + cmp r2, 0 + beq _08050A4E + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x70] +_08050A4E: + movs r1, 0 + str r1, [sp, 0x6C] + b _08050A6C +_08050A54: + movs r0, 0x64 + bl sub_8084100 + movs r2, 0x1 + str r2, [sp, 0x6C] + cmp r0, 0x31 + bgt _08050A68 + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x6C] +_08050A68: + movs r1, 0 + str r1, [sp, 0x70] +_08050A6C: + mov r2, r10 + cmp r2, 0x1F + bhi _08050A74 + b _08050762 +_08050A74: + ldr r4, [sp, 0x98] + cmp r4, 0 + beq _08050A7C + b _0805071C +_08050A7C: + movs r0, 0 + ldr r1, [sp, 0x64] + ldrb r1, [r1, 0x15] + cmp r0, r1 + blt _08050A88 + b _08050BAE +_08050A88: + movs r2, 0 + mov r8, r2 + mov r9, r2 + movs r5, 0 + adds r0, 0x1 + mov r10, r0 + b _08050A98 +_08050A96: + adds r5, 0x1 +_08050A98: + cmp r5, 0xC7 + bgt _08050AC2 + movs r0, 0 + movs r1, 0x38 + bl sub_808411C + mov r9, r0 + movs r0, 0 + movs r1, 0x20 + bl sub_808411C + mov r8, r0 + mov r0, r9 + subs r0, 0x1 + cmp r0, 0x35 + bhi _08050A96 + mov r0, r8 + cmp r0, 0 + ble _08050A96 + cmp r0, 0x1E + bgt _08050A96 +_08050AC2: + cmp r5, 0xC8 + beq _08050BA2 + movs r7, 0 + movs r3, 0x1 + movs r1, 0 +_08050ACC: + movs r2, 0 + lsls r0, r7, 2 + adds r4, r7, 0x1 + adds r0, r7 + lsls r0, 1 + add r0, sp +_08050AD8: + cmp r7, 0 + beq _08050AE8 + cmp r7, 0x9 + beq _08050AE8 + cmp r2, 0 + beq _08050AE8 + cmp r2, 0x9 + bne _08050AEC +_08050AE8: + strb r3, [r0] + b _08050AEE +_08050AEC: + strb r1, [r0] +_08050AEE: + adds r0, 0x1 + adds r2, 0x1 + cmp r2, 0x9 + ble _08050AD8 + adds r7, r4, 0 + cmp r7, 0x9 + ble _08050ACC + movs r5, 0x4F +_08050AFE: + movs r0, 0x8 + bl sub_8084100 + adds r4, r0, 0 + adds r7, r4, 0x1 + movs r0, 0x8 + bl sub_8084100 + adds r2, r0, 0x1 + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 1 + adds r0, r2, r0 + add r0, sp + ldrb r0, [r0] + cmp r0, 0 + bne _08050B50 + adds r1, r7, 0x1 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 1 + adds r0, r2, r0 + add r0, sp + ldrb r0, [r0] + cmp r0, 0 + bne _08050B50 + lsls r0, r7, 2 + adds r0, r7 + lsls r1, r0, 1 + subs r0, r1, 0x1 + adds r0, r2, r0 + add r0, sp + ldrb r0, [r0] + cmp r0, 0 + bne _08050B50 + adds r0, r1, 0x1 + adds r0, r2, r0 + add r0, sp + ldrb r0, [r0] + cmp r0, 0 + beq _08050B60 +_08050B50: + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 1 + adds r0, r2, r0 + mov r2, sp + adds r1, r2, r0 + movs r0, 0x1 + strb r0, [r1] +_08050B60: + subs r5, 0x1 + cmp r5, 0 + bge _08050AFE + movs r7, 0 +_08050B68: + lsls r0, r7, 2 + adds r4, r7, 0x1 + adds r0, r7 + lsls r0, 1 + mov r6, r8 + subs r6, 0x5 + mov r1, sp + adds r5, r0, r1 + add r7, r9 + movs r2, 0x9 +_08050B7C: + ldrb r0, [r5] + cmp r0, 0 + bne _08050B92 + subs r0, r7, 0x5 + adds r1, r6, 0 + str r2, [sp, 0x9C] + bl sub_8049590 + bl sub_80506BC + ldr r2, [sp, 0x9C] +_08050B92: + adds r6, 0x1 + adds r5, 0x1 + subs r2, 0x1 + cmp r2, 0 + bge _08050B7C + adds r7, r4, 0 + cmp r7, 0x9 + ble _08050B68 +_08050BA2: + mov r0, r10 + ldr r2, [sp, 0x64] + ldrb r2, [r2, 0x15] + cmp r0, r2 + bge _08050BAE + b _08050A88 +_08050BAE: + movs r0, 0 + mov r9, r0 + movs r6, 0x1 + ldr r1, _08050BF4 + adds r5, r1, 0 +_08050BB8: + movs r2, 0 + mov r10, r2 + mov r4, r9 + adds r4, 0x1 +_08050BC0: + mov r0, r9 + mov r1, r10 + bl sub_8049590 + adds r2, r0, 0 + ldrh r3, [r2] + movs r0, 0x3 + ands r0, r3 + cmp r0, 0x2 + bne _08050C10 + movs r1, 0xB0 + lsls r1, 1 + adds r0, r1, 0 + ands r0, r3 + cmp r0, 0 + bne _08050BEA + ldrh r1, [r2, 0x4] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _08050BF8 +_08050BEA: + adds r0, r3, 0 + ands r0, r5 + orrs r0, r6 + b _08050C0E + .align 2, 0 +_08050BF4: .4byte 0x0000fffc +_08050BF8: + mov r0, r9 + subs r0, 0x2 + cmp r0, 0x34 + bhi _08050C0A + mov r0, r10 + cmp r0, 0x1 + ble _08050C0A + cmp r0, 0x1E + ble _08050C10 +_08050C0A: + ldrh r0, [r2] + ands r0, r5 +_08050C0E: + strh r0, [r2] +_08050C10: + movs r1, 0x1 + add r10, r1 + mov r2, r10 + cmp r2, 0x1F + ble _08050BC0 + mov r9, r4 + cmp r4, 0x37 + ble _08050BB8 +_08050C20: + add sp, 0xA4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80506F0 + + thumb_func_start sub_8050C30 +sub_8050C30: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, _08050F3C + add sp, r4 + mov r8, r0 + mov r9, r1 + lsls r2, 24 + lsrs r2, 24 + movs r0, 0xE0 + lsls r0, 3 + add r0, sp + str r2, [r0] + movs r7, 0 + mov r1, r8 + lsls r1, 5 + movs r2, 0xE2 + lsls r2, 3 + add r2, sp + str r1, [r2] +_08050C5C: + movs r6, 0 + lsls r2, r7, 5 + adds r3, r7, 0x1 + mov r10, r3 + mov r5, sp + adds r4, r2, r5 +_08050C68: + adds r0, r7, 0 + adds r1, r6, 0 + bl sub_8049590 + adds r2, r0, 0 + ldrh r0, [r2] + movs r3, 0x3 + ands r3, r0 + movs r0, 0 + strb r0, [r4] + movs r0, 0xE0 + lsls r0, 3 + add r0, sp + ldr r0, [r0] + cmp r0, 0 + beq _08050C92 + ldrh r0, [r2] + ldr r5, _08050F40 + adds r1, r5, 0 + ands r0, r1 + strh r0, [r2] +_08050C92: + cmp r3, 0x1 + beq _08050CA8 + ldrh r1, [r2] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _08050CA8 + ldrb r0, [r4] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r4] +_08050CA8: + cmp r3, 0x2 + bne _08050CBE + ldrh r1, [r2] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _08050CBE + ldrb r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4] +_08050CBE: + adds r4, 0x1 + adds r6, 0x1 + cmp r6, 0x1F + ble _08050C68 + mov r7, r10 + cmp r7, 0x37 + ble _08050C5C + movs r1, 0xE2 + lsls r1, 3 + add r1, sp + ldr r0, [r1] + add r0, r9 + mov r3, sp + adds r2, r3, r0 + ldrb r1, [r2] + movs r0, 0x50 + orrs r0, r1 + strb r0, [r2] + ldr r0, _08050F44 + ldr r1, [r0] + ldr r5, _08050F48 + adds r0, r1, r5 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, r8 + beq _08050CF4 + b _08050F36 +_08050CF4: + ldr r3, _08050F4C + adds r0, r1, r3 + movs r5, 0 + ldrsh r0, [r0, r5] + cmp r0, r9 + beq _08050D02 + b _08050F36 +_08050D02: + ldr r1, _08050F50 + movs r0, 0 + str r0, [r1] + movs r0, 0x40 + mov r9, r0 +_08050D0C: + movs r1, 0 + ldr r2, _08050F54 + add r2, sp + str r1, [r2] + ldr r3, _08050F50 + ldr r0, [r3] + adds r0, 0x1 + str r0, [r3] + movs r7, 0 +_08050D1E: + movs r6, 0 + lsls r2, r7, 5 + adds r5, r7, 0x1 + mov r10, r5 + subs r0, r7, 0x1 + movs r1, 0xE1 + lsls r1, 3 + add r1, sp + str r0, [r1] + lsls r0, 5 + mov r1, sp + subs r1, 0x1 + adds r5, r2, r1 + add r0, sp + mov r8, r0 + mov r2, r10 + ldr r3, _08050F58 + add r3, sp + str r2, [r3] + lsls r0, r2, 5 + add r0, sp + mov r12, r0 +_08050D4A: + ldrb r1, [r5, 0x1] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08050D56 + b _08050EDA +_08050D56: + movs r3, 0x40 + mov r0, r9 + ands r0, r1 + cmp r0, 0 + bne _08050D62 + b _08050EDA +_08050D62: + ldr r2, _08050F54 + add r2, sp + ldr r0, [r2] + adds r0, 0x1 + str r0, [r2] + movs r0, 0xBF + ands r0, r1 + movs r2, 0 + movs r1, 0x80 + orrs r0, r1 + strb r0, [r5, 0x1] + cmp r7, 0 + ble _08050D90 + mov r0, r8 + ldrb r1, [r0] + movs r0, 0x83 + ands r0, r1 + cmp r0, 0 + bne _08050D90 + adds r0, r1, 0 + orrs r0, r3 + mov r1, r8 + strb r0, [r1] +_08050D90: + cmp r6, 0 + ble _08050DA4 + ldrb r1, [r5] + movs r0, 0x83 + ands r0, r1 + cmp r0, 0 + bne _08050DA4 + mov r0, r9 + orrs r0, r1 + strb r0, [r5] +_08050DA4: + cmp r7, 0x36 + bgt _08050DBA + mov r2, r12 + ldrb r1, [r2] + movs r0, 0x83 + ands r0, r1 + cmp r0, 0 + bne _08050DBA + mov r0, r9 + orrs r0, r1 + strb r0, [r2] +_08050DBA: + cmp r6, 0x1E + bgt _08050DCE + ldrb r1, [r5, 0x2] + movs r0, 0x83 + ands r0, r1 + cmp r0, 0 + bne _08050DCE + mov r0, r9 + orrs r0, r1 + strb r0, [r5, 0x2] +_08050DCE: + cmp r7, 0 + ble _08050E12 + cmp r6, 0 + ble _08050E12 + movs r3, 0xE1 + lsls r3, 3 + add r3, sp + ldr r3, [r3] + lsls r1, r3, 5 + subs r0, r1, 0x1 + adds r0, r6, r0 + mov r2, sp + adds r4, r2, r0 + ldrb r3, [r4] + movs r0, 0x87 + ands r0, r3 + cmp r0, 0 + bne _08050E12 + adds r0, r6, r1 + add r0, sp + ldrb r1, [r0] + movs r2, 0x1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _08050E12 + ldrb r1, [r5] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _08050E12 + mov r0, r9 + orrs r0, r3 + strb r0, [r4] +_08050E12: + cmp r7, 0x36 + bgt _08050E54 + cmp r6, 0 + ble _08050E54 + ldr r3, _08050F58 + add r3, sp + ldr r3, [r3] + lsls r1, r3, 5 + subs r0, r1, 0x1 + adds r0, r6, r0 + mov r2, sp + adds r4, r2, r0 + ldrb r3, [r4] + movs r0, 0x87 + ands r0, r3 + cmp r0, 0 + bne _08050E54 + adds r0, r6, r1 + add r0, sp + ldrb r1, [r0] + movs r2, 0x1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _08050E54 + ldrb r1, [r5] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _08050E54 + mov r0, r9 + orrs r0, r3 + strb r0, [r4] +_08050E54: + cmp r7, 0 + ble _08050E98 + cmp r6, 0x1E + bgt _08050E98 + movs r3, 0xE1 + lsls r3, 3 + add r3, sp + ldr r3, [r3] + lsls r1, r3, 5 + adds r0, r1, 0x1 + adds r0, r6, r0 + mov r2, sp + adds r4, r2, r0 + ldrb r3, [r4] + movs r0, 0x87 + ands r0, r3 + cmp r0, 0 + bne _08050E98 + adds r0, r6, r1 + add r0, sp + ldrb r1, [r0] + movs r2, 0x1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _08050E98 + ldrb r1, [r5, 0x2] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _08050E98 + mov r0, r9 + orrs r0, r3 + strb r0, [r4] +_08050E98: + cmp r7, 0x36 + bgt _08050EDA + cmp r6, 0x1E + bgt _08050EDA + ldr r3, _08050F58 + add r3, sp + ldr r3, [r3] + lsls r1, r3, 5 + adds r0, r1, 0x1 + adds r0, r6, r0 + mov r2, sp + adds r4, r2, r0 + ldrb r3, [r4] + movs r0, 0x87 + ands r0, r3 + cmp r0, 0 + bne _08050EDA + adds r0, r6, r1 + add r0, sp + ldrb r1, [r0] + movs r2, 0x1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _08050EDA + ldrb r1, [r5, 0x2] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _08050EDA + mov r0, r9 + orrs r0, r3 + strb r0, [r4] +_08050EDA: + adds r5, 0x1 + movs r3, 0x1 + add r8, r3 + add r12, r3 + adds r6, 0x1 + cmp r6, 0x1F + bgt _08050EEA + b _08050D4A +_08050EEA: + mov r7, r10 + cmp r7, 0x37 + bgt _08050EF2 + b _08050D1E +_08050EF2: + ldr r5, _08050F54 + add r5, sp + ldr r5, [r5] + cmp r5, 0 + beq _08050EFE + b _08050D0C +_08050EFE: + movs r7, 0 +_08050F00: + movs r6, 0 + lsls r2, r7, 5 + mov r0, sp + adds r4, r2, r0 +_08050F08: + adds r0, r7, 0 + adds r1, r6, 0 + bl sub_8049590 + adds r2, r0, 0 + ldrb r1, [r4] + movs r0, 0x87 + ands r0, r1 + cmp r0, 0 + bne _08050F68 + movs r1, 0xE0 + lsls r1, 3 + add r1, sp + ldr r1, [r1] + cmp r1, 0 + bne _08050F5C + ldrh r0, [r2] + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _08050F68 +_08050F36: + movs r0, 0 + b _08050F78 + .align 2, 0 +_08050F3C: .4byte 0xfffff8ec +_08050F40: .4byte 0x00007fff +_08050F44: .4byte gUnknown_203B418 +_08050F48: .4byte 0x0000e21c +_08050F4C: .4byte 0x0000e21e +_08050F50: .4byte gUnknown_202F1D4 +_08050F54: .4byte 0x00000704 +_08050F58: .4byte 0x0000070c +_08050F5C: + ldrh r1, [r2] + movs r3, 0x80 + lsls r3, 8 + adds r0, r3, 0 + orrs r0, r1 + strh r0, [r2] +_08050F68: + adds r4, 0x1 + adds r6, 0x1 + cmp r6, 0x1F + ble _08050F08 + adds r7, 0x1 + cmp r7, 0x37 + ble _08050F00 + movs r0, 0x1 +_08050F78: + ldr r3, _08050F8C + add sp, r3 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08050F8C: .4byte 0x00000714 + thumb_func_end sub_8050C30 + + thumb_func_start sub_8050F90 +sub_8050F90: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x3C + str r0, [sp] + str r1, [sp, 0x4] + str r2, [sp, 0x8] + str r3, [sp, 0xC] + movs r0, 0 + str r0, [sp, 0x10] + movs r1, 0 + str r1, [sp, 0x14] + movs r2, 0 + b _080511D0 +_08050FB0: + movs r4, 0 + str r4, [sp, 0x18] + ldr r5, [sp, 0x1C] + adds r5, 0x1 + str r5, [sp, 0x28] + ldr r6, [sp, 0x4] + cmp r4, r6 + blt _08050FC2 + b _080511CE +_08050FC2: + ldr r1, [sp, 0x18] + lsls r0, r1, 2 + ldr r2, [sp, 0xC] + adds r0, r2 + ldr r3, [r0] + adds r4, r3, 0x2 + mov r9, r4 + ldr r5, [sp, 0x1C] + lsls r1, r5, 2 + ldr r6, [sp, 0x5C] + adds r1, r6 + ldr r2, [r1] + adds r4, r2, 0x2 + mov r10, r4 + ldr r0, [r0, 0x4] + subs r0, r3 + subs r4, r0, 0x4 + ldr r0, [r1, 0x4] + subs r0, r2 + subs r7, r0, 0x4 + movs r3, 0x5 + movs r5, 0x5 + ldr r6, [sp, 0x4] + cmp r6, 0x2 + bgt _08050FF8 + movs r3, 0xA + movs r4, 0xE +_08050FF8: + ldr r0, [sp, 0x8] + cmp r0, 0x1 + bne _08051002 + movs r5, 0x10 + movs r7, 0x18 +_08051002: + ldr r2, [sp, 0x1C] + lsls r1, r2, 5 + ldr r6, [sp, 0x18] + lsls r2, r6, 4 + subs r0, r2, r6 + lsls r0, 5 + ldr r6, [sp] + adds r0, r6 + adds r6, r1, r0 + ldrb r0, [r6, 0xA] + str r1, [sp, 0x30] + str r2, [sp, 0x2C] + cmp r0, 0 + bne _08051020 + b _08051130 +_08051020: + ldr r0, [sp, 0x14] + ldr r1, [sp, 0x60] + cmp r0, r1 + beq _0805108C + adds r0, r3, 0 + adds r1, r4, 0 + bl sub_808411C + adds r6, r0, 0 + adds r0, r5, 0 + adds r1, r7, 0 + bl sub_808411C + adds r5, r0, 0 + movs r1, 0x1 + adds r0, r6, 0 + orrs r0, r1 + cmp r0, r4 + bge _08051048 + adds r6, r0, 0 +_08051048: + adds r0, r5, 0 + orrs r0, r1 + cmp r0, r7 + bge _08051052 + adds r5, r0, 0 +_08051052: + lsls r0, r5, 1 + adds r0, r5 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + cmp r6, r0 + ble _08051062 + adds r6, r0, 0 +_08051062: + lsls r0, r6, 1 + adds r0, r6 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + cmp r5, r0 + ble _08051072 + adds r5, r0, 0 +_08051072: + subs r0, r4, r6 + bl sub_8084100 + mov r2, r9 + adds r4, r0, r2 + subs r0, r7, r5 + bl sub_8084100 + mov r3, r10 + adds r7, r0, r3 + adds r3, r4, r6 + adds r6, r7, r5 + b _08051098 +_0805108C: + mov r4, r9 + mov r7, r10 + ldr r5, [sp, 0x64] + adds r3, r4, r5 + ldr r0, [sp, 0x68] + adds r6, r7, r0 +_08051098: + ldr r1, [sp, 0x2C] + ldr r2, [sp, 0x18] + subs r0, r1, r2 + lsls r0, 5 + ldr r5, [sp] + adds r0, r5 + ldr r1, [sp, 0x30] + adds r0, r1, r0 + strh r4, [r0] + strh r3, [r0, 0x4] + strh r7, [r0, 0x2] + strh r6, [r0, 0x6] + adds r5, r4, 0 + ldr r2, [sp, 0x10] + adds r2, 0x1 + str r2, [sp, 0x20] + ldr r4, [sp, 0x14] + adds r4, 0x1 + str r4, [sp, 0x24] + ldr r0, [sp, 0x18] + adds r0, 0x1 + mov r10, r0 + cmp r5, r3 + bge _08051108 +_080510C8: + adds r4, r7, 0 + adds r1, r5, 0x1 + mov r8, r1 + cmp r4, r6 + bge _08051102 + ldr r2, _0805112C + mov r9, r2 +_080510D6: + adds r0, r5, 0 + adds r1, r4, 0 + str r3, [sp, 0x38] + bl sub_8049590 + ldrh r1, [r0] + mov r2, r9 + ands r1, r2 + movs r2, 0x1 + orrs r1, r2 + strh r1, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8049590 + mov r1, sp + ldrb r1, [r1, 0x10] + strb r1, [r0, 0x9] + adds r4, 0x1 + ldr r3, [sp, 0x38] + cmp r4, r6 + blt _080510D6 +_08051102: + mov r5, r8 + cmp r5, r3 + blt _080510C8 +_08051108: + ldr r2, [sp, 0x14] + ldr r3, [sp, 0x60] + cmp r2, r3 + beq _08051124 + ldr r4, [sp, 0x2C] + ldr r5, [sp, 0x18] + subs r0, r4, r5 + lsls r0, 5 + ldr r6, [sp] + adds r0, r6 + ldr r1, [sp, 0x30] + adds r0, r1, r0 + movs r1, 0x1 + strb r1, [r0, 0x1D] +_08051124: + ldr r2, [sp, 0x20] + str r2, [sp, 0x10] + b _080511BE + .align 2, 0 +_0805112C: .4byte 0x0000fffc +_08051130: + movs r1, 0x2 + movs r3, 0x4 + movs r2, 0x2 + mov r8, r3 + ldr r5, [sp, 0x18] + cmp r5, 0 + bne _08051140 + movs r1, 0x1 +_08051140: + ldr r0, [sp, 0x1C] + cmp r0, 0 + bne _08051148 + movs r2, 0x1 +_08051148: + ldr r0, [sp, 0x4] + subs r0, 0x1 + ldr r5, [sp, 0x18] + cmp r5, r0 + bne _08051154 + movs r3, 0x2 +_08051154: + ldr r0, [sp, 0x8] + subs r0, 0x1 + ldr r5, [sp, 0x1C] + cmp r5, r0 + bne _08051162 + movs r0, 0x2 + mov r8, r0 +_08051162: + mov r5, r9 + adds r0, r5, r1 + adds r1, r5, r4 + subs r1, r3 + str r2, [sp, 0x34] + bl sub_808411C + adds r5, r0, 0 + ldr r2, [sp, 0x34] + mov r1, r10 + adds r0, r1, r2 + adds r1, r7 + mov r2, r8 + subs r1, r2 + bl sub_808411C + adds r4, r0, 0 + strh r5, [r6] + adds r0, r5, 0x1 + strh r0, [r6, 0x4] + strh r4, [r6, 0x2] + adds r0, r4, 0x1 + strh r0, [r6, 0x6] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8049590 + ldrh r1, [r0] + ldr r3, _080511EC + adds r2, r3, 0 + ands r1, r2 + movs r2, 0x1 + orrs r1, r2 + strh r1, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8049590 + movs r1, 0xFF + strb r1, [r0, 0x9] + ldr r4, [sp, 0x14] + adds r4, 0x1 + str r4, [sp, 0x24] + ldr r5, [sp, 0x18] + adds r5, 0x1 + mov r10, r5 +_080511BE: + ldr r6, [sp, 0x24] + str r6, [sp, 0x14] + mov r0, r10 + str r0, [sp, 0x18] + ldr r1, [sp, 0x4] + cmp r0, r1 + bge _080511CE + b _08050FC2 +_080511CE: + ldr r2, [sp, 0x28] +_080511D0: + str r2, [sp, 0x1C] + ldr r3, [sp, 0x8] + cmp r2, r3 + bge _080511DA + b _08050FB0 +_080511DA: + add sp, 0x3C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080511EC: .4byte 0x0000fffc + thumb_func_end sub_8050F90 + + thumb_func_start sub_80511F0 +sub_80511F0: + push {r4-r6,lr} + ldr r6, _08051204 + ldrb r0, [r6] + cmp r0, 0 + beq _0805120C + subs r0, 0x1 + strb r0, [r6] + ldr r0, _08051208 + ldrb r0, [r0] + b _08051244 + .align 2, 0 +_08051204: .4byte gUnknown_202F1E1 +_08051208: .4byte gUnknown_202F1E0 +_0805120C: + ldr r1, _0805122C + ldr r5, _08051230 + ldr r2, [r5] + ldrb r3, [r2] + strb r3, [r1] + adds r4, r2, 0x1 + str r4, [r5] + lsls r0, r3, 24 + lsrs r0, 24 + cmp r0, 0xE + bne _08051234 + ldrb r0, [r2, 0x1] + strb r0, [r1] + adds r0, r4, 0x1 + str r0, [r5] + b _08051242 + .align 2, 0 +_0805122C: .4byte gUnknown_202F1E0 +_08051230: .4byte gUnknown_202F1DC +_08051234: + movs r0, 0xF + ands r0, r3 + strb r0, [r6] + movs r0, 0xF0 + ands r0, r3 + lsrs r0, 4 + strb r0, [r1] +_08051242: + ldrb r0, [r1] +_08051244: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80511F0 + + thumb_func_start sub_805124C +sub_805124C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + ldr r5, [sp, 0x1C] + lsls r1, 24 + lsrs r1, 24 + lsls r5, 24 + lsrs r5, 24 + ldrh r6, [r0] + movs r7, 0x80 + lsls r7, 1 + adds r4, r7, 0 + movs r7, 0 + mov r8, r7 + orrs r4, r6 + strh r4, [r0] + mov r4, r8 + strb r4, [r0, 0xE] + str r5, [sp] + bl sub_8051A74 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_805124C + + thumb_func_start sub_8051288 +sub_8051288: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + str r0, [sp, 0x4] + ldr r0, _08051374 + ldr r7, [r0] + ldr r0, _08051378 + adds r3, r7, r0 + ldr r0, [r3] + ldr r0, [r0, 0x4] + ldr r2, [sp, 0x4] + lsls r1, r2, 2 + adds r0, r1, r0 + ldr r0, [r0] + ldrb r2, [r0] + mov r10, r2 + ldrb r0, [r0, 0x1] + mov r9, r0 + ldr r2, _0805137C + adds r0, r7, r2 + movs r4, 0 + mov r2, r10 + strh r2, [r0] + ldr r2, _08051380 + adds r0, r7, r2 + mov r2, r9 + strh r2, [r0] + ldr r2, _08051384 + ldr r0, [r3] + ldr r0, [r0, 0x4] + adds r1, r0 + ldr r0, [r1] + adds r0, 0x3 + str r0, [r2] + ldr r0, _08051388 + strb r4, [r0] + movs r6, 0x5 + mov r0, r9 + adds r0, 0x5 + cmp r6, r0 + bge _0805132E + movs r1, 0x5 + add r1, r10 + mov r8, r1 + str r0, [sp, 0x8] +_080512E8: + movs r5, 0x5 + cmp r5, r8 + bge _08051326 +_080512EE: + bl sub_80511F0 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_8049590 + movs r1, 0x1 + str r1, [sp] + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_805124C + lsls r0, 24 + cmp r0, 0 + beq _08051320 + ldr r2, _0805138C + adds r0, r7, r2 + strh r5, [r0] + ldr r1, _08051390 + adds r0, r7, r1 + strh r6, [r0] +_08051320: + adds r5, 0x1 + cmp r5, r8 + blt _080512EE +_08051326: + adds r6, 0x1 + ldr r2, [sp, 0x8] + cmp r6, r2 + blt _080512E8 +_0805132E: + movs r6, 0 + ldr r0, _08051394 + adds r7, r0, 0 +_08051334: + movs r5, 0 + adds r4, r6, 0x1 +_08051338: + cmp r5, 0x4 + ble _08051350 + mov r0, r10 + adds r0, 0x5 + cmp r5, r0 + bge _08051350 + cmp r6, 0x4 + ble _08051350 + mov r0, r9 + adds r0, 0x5 + cmp r6, r0 + blt _080513A0 +_08051350: + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_8049590 + adds r2, r0, 0 + ldrh r1, [r2] + movs r0, 0x10 + movs r3, 0 + orrs r1, r0 + strh r1, [r2] + ldr r0, _08051398 + ldrb r0, [r0] + cmp r0, 0 + beq _0805139C + ands r1, r7 + movs r0, 0x3 + orrs r1, r0 + b _0805139E + .align 2, 0 +_08051374: .4byte gUnknown_203B418 +_08051378: .4byte 0x00013568 +_0805137C: .4byte 0x0000e260 +_08051380: .4byte 0x0000e262 +_08051384: .4byte gUnknown_202F1DC +_08051388: .4byte gUnknown_202F1E1 +_0805138C: .4byte 0x0000e21c +_08051390: .4byte 0x0000e21e +_08051394: .4byte 0x0000fffc +_08051398: .4byte gUnknown_202F1A8 +_0805139C: + ands r1, r7 +_0805139E: + strh r1, [r2] +_080513A0: + adds r5, 0x1 + cmp r5, 0x37 + ble _08051338 + adds r6, r4, 0 + cmp r6, 0x1F + ble _08051334 + ldr r1, [sp, 0x4] + cmp r1, 0x4 + bne _080513DA + movs r6, 0x5 + ldr r2, _0805142C + adds r7, r2, 0 +_080513B8: + movs r5, 0x2 + adds r4, r6, 0x1 +_080513BC: + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_8049590 + ldrh r2, [r0] + movs r1, 0x10 + orrs r1, r2 + ands r1, r7 + strh r1, [r0] + adds r5, 0x1 + cmp r5, 0x4 + ble _080513BC + adds r6, r4, 0 + cmp r6, 0x10 + ble _080513B8 +_080513DA: + ldr r0, _08051430 + ldr r0, [r0] + ldr r1, _08051434 + adds r0, r1 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0x3F + ble _08051416 + movs r6, 0 +_080513EC: + movs r5, 0 + adds r4, r6, 0x1 +_080513F0: + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_8049590 + adds r2, r0, 0 + ldrh r1, [r2] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _0805140A + movs r0, 0x10 + orrs r0, r1 + strh r0, [r2] +_0805140A: + adds r5, 0x1 + cmp r5, 0x37 + ble _080513F0 + adds r6, r4, 0 + cmp r6, 0x1F + ble _080513EC +_08051416: + bl sub_804E9DC + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0805142C: .4byte 0x0000fffc +_08051430: .4byte gUnknown_203B418 +_08051434: .4byte 0x00003a0e + thumb_func_end sub_8051288 + + thumb_func_start sub_8051438 +sub_8051438: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + mov r9, r0 + ldr r0, _080515AC + ldr r0, [r0] + str r0, [sp, 0x4] + ldr r2, _080515B0 + ldr r4, _080515B4 + adds r3, r0, r4 + ldr r0, [r3] + ldr r0, [r0, 0x4] + lsls r1, 2 + adds r0, r1, r0 + ldr r0, [r0] + adds r0, 0x3 + str r0, [r2] + ldr r2, _080515B8 + movs r0, 0 + strb r0, [r2] + ldr r0, [r3] + ldr r0, [r0, 0x4] + adds r1, r0 + ldr r0, [r1] + ldrb r1, [r0, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0805147A + b _080515D8 +_0805147A: + ldr r5, [sp, 0x4] + ldr r0, _080515BC + adds r1, r5, r0 + mov r2, r9 + movs r3, 0 + ldrsh r0, [r2, r3] + str r0, [r1] + ldr r4, _080515C0 + adds r1, r5, r4 + movs r5, 0x2 + ldrsh r0, [r2, r5] + str r0, [r1] + ldr r0, [sp, 0x4] + ldr r2, _080515C4 + adds r1, r0, r2 + mov r3, r9 + movs r4, 0x4 + ldrsh r0, [r3, r4] + str r0, [r1] + ldr r5, [sp, 0x4] + ldr r0, _080515C8 + adds r1, r5, r0 + movs r2, 0x6 + ldrsh r0, [r3, r2] + str r0, [r1] + movs r3, 0 + str r3, [sp, 0x8] + mov r4, r9 + movs r5, 0x2 + ldrsh r4, [r4, r5] + mov r8, r4 + mov r1, r9 + movs r2, 0x6 + ldrsh r0, [r1, r2] + cmp r8, r0 + blt _080514C4 + b _08051640 +_080514C4: + mov r3, r9 + movs r4, 0 + ldrsh r7, [r3, r4] + movs r5, 0x4 + ldrsh r0, [r3, r5] + ldr r1, [sp, 0x8] + adds r1, 0x1 + str r1, [sp, 0x10] + mov r2, r8 + adds r2, 0x1 + str r2, [sp, 0xC] + cmp r7, r0 + bge _08051598 + ldr r4, _080515CC + ldr r3, [sp, 0x4] + adds r4, r3, r4 + str r4, [sp, 0x14] + movs r5, 0 + str r5, [sp, 0x18] + ldr r0, [sp, 0x8] + mov r10, r0 +_080514EE: + bl sub_80511F0 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r7, 0 + mov r1, r8 + bl sub_8049590 + adds r6, r0, 0 + ldr r1, [sp, 0x4] + ldr r2, _080515D0 + adds r0, r1, r2 + add r0, r10 + strb r5, [r0] + ldr r3, [sp, 0x8] + lsls r4, r3, 1 + adds r4, r3 + lsls r4, 3 + ldr r1, [sp, 0x14] + adds r0, r1, r4 + movs r2, 0 + str r2, [sp] + adds r1, r5, 0 + adds r2, r7, 0 + mov r3, r8 + bl sub_805124C + ldrb r1, [r6, 0x9] + ldr r3, [sp, 0x18] + adds r4, r3 + ldr r5, [sp, 0x4] + adds r4, r5, r4 + adds r0, r6, 0 + ldr r2, _080515CC + adds r4, r2 + ldm r4!, {r2,r3,r5} + stm r0!, {r2,r3,r5} + ldm r4!, {r2,r3,r5} + stm r0!, {r2,r3,r5} + mov r3, r9 + movs r4, 0 + ldrsh r0, [r3, r4] + adds r0, 0x2 + cmp r7, r0 + blt _08051572 + movs r5, 0x4 + ldrsh r0, [r3, r5] + subs r0, 0x2 + cmp r7, r0 + bge _08051572 + movs r2, 0x2 + ldrsh r0, [r3, r2] + adds r0, 0x2 + cmp r8, r0 + blt _08051572 + movs r4, 0x6 + ldrsh r0, [r3, r4] + subs r0, 0x2 + cmp r8, r0 + bge _08051572 + movs r0, 0x88 + lsls r0, 1 + strh r0, [r6] + movs r0, 0xE + strb r0, [r6, 0xE] +_08051572: + strb r1, [r6, 0x9] + ldr r5, [sp, 0x4] + ldr r2, _080515D4 + adds r0, r5, r2 + strb r1, [r0] + ldr r3, [sp, 0x14] + adds r3, 0xC0 + str r3, [sp, 0x14] + ldr r4, [sp, 0x18] + adds r4, 0xC0 + str r4, [sp, 0x18] + movs r5, 0x8 + add r10, r5 + adds r7, 0x1 + mov r1, r9 + movs r2, 0x4 + ldrsh r0, [r1, r2] + cmp r7, r0 + blt _080514EE +_08051598: + ldr r3, [sp, 0x10] + str r3, [sp, 0x8] + ldr r4, [sp, 0xC] + mov r8, r4 + mov r5, r9 + movs r1, 0x6 + ldrsh r0, [r5, r1] + cmp r8, r0 + blt _080514C4 + b _08051640 + .align 2, 0 +_080515AC: .4byte gUnknown_203B418 +_080515B0: .4byte gUnknown_202F1DC +_080515B4: .4byte 0x00013568 +_080515B8: .4byte gUnknown_202F1E1 +_080515BC: .4byte 0x0000e250 +_080515C0: .4byte 0x0000e254 +_080515C4: .4byte 0x0000e258 +_080515C8: .4byte 0x0000e25c +_080515CC: .4byte 0x0000e27c +_080515D0: .4byte 0x0000e87c +_080515D4: .4byte 0x0000e8bc +_080515D8: + mov r2, r9 + movs r3, 0x2 + ldrsh r2, [r2, r3] + mov r8, r2 + b _08051636 +_080515E2: + mov r0, r9 + movs r1, 0 + ldrsh r7, [r0, r1] + movs r2, 0x4 + ldrsh r0, [r0, r2] + mov r3, r8 + adds r3, 0x1 + str r3, [sp, 0xC] + cmp r7, r0 + bge _08051632 +_080515F6: + bl sub_80511F0 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r7, 0 + mov r1, r8 + bl sub_8049590 + adds r5, r0, 0 + ldrb r6, [r5, 0x9] + movs r0, 0x1 + str r0, [sp] + adds r0, r5, 0 + adds r1, r4, 0 + adds r2, r7, 0 + mov r3, r8 + bl sub_805124C + strb r6, [r5, 0x9] + ldr r4, [sp, 0x4] + ldr r5, _08051650 + adds r0, r4, r5 + strb r6, [r0] + adds r7, 0x1 + mov r1, r9 + movs r2, 0x4 + ldrsh r0, [r1, r2] + cmp r7, r0 + blt _080515F6 +_08051632: + ldr r3, [sp, 0xC] + mov r8, r3 +_08051636: + mov r4, r9 + movs r5, 0x6 + ldrsh r0, [r4, r5] + cmp r8, r0 + blt _080515E2 +_08051640: + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08051650: .4byte 0x0000e8bc + thumb_func_end sub_8051438 + + thumb_func_start sub_8051654 +sub_8051654: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + str r0, [sp] + ldr r4, _080516EC + ldr r1, [r4, 0x8] + ldr r0, [r4] + subs r1, r0 + subs r1, 0x2 + movs r0, 0x3 + bl sub_808411C + mov r8, r0 + cmp r0, 0x2 + bgt _0805167C + movs r0, 0x3 + mov r8, r0 +_0805167C: + ldr r1, [r4, 0xC] + ldr r0, [r4, 0x4] + subs r1, r0 + subs r1, 0x2 + movs r0, 0x3 + bl sub_808411C + mov r9, r0 + cmp r0, 0x2 + bgt _08051694 + movs r1, 0x3 + mov r9, r1 +_08051694: + movs r0, 0x2 + movs r1, 0x4 + bl sub_808411C + mov r10, r0 + movs r5, 0 + cmp r5, r10 + bge _08051734 + ldr r0, [r4, 0x8] + ldr r1, [r4] + subs r0, r1 + cmp r0, r8 + ble _08051734 + adds r6, r4, 0 +_080516B0: + movs r0, 0x64 + bl sub_8084100 + cmp r0, 0x31 + bgt _080516F4 + ldr r4, [r6, 0x4] + ldr r0, [r6, 0xC] + adds r7, r5, 0x1 + cmp r4, r0 + bge _080516E4 + ldr r5, _080516EC + ldr r0, _080516F0 + adds r2, r0, 0 +_080516CA: + ldr r0, [r5] + adds r1, r4, 0 + str r2, [sp, 0xC] + bl sub_8049590 + ldrh r1, [r0] + ldr r2, [sp, 0xC] + ands r1, r2 + strh r1, [r0] + adds r4, 0x1 + ldr r0, [r5, 0xC] + cmp r4, r0 + blt _080516CA +_080516E4: + ldr r0, [r6] + adds r0, 0x1 + str r0, [r6] + b _08051724 + .align 2, 0 +_080516EC: .4byte gUnknown_202F1B8 +_080516F0: .4byte 0x0000ffdf +_080516F4: + ldr r0, [r6, 0x8] + subs r0, 0x1 + str r0, [r6, 0x8] + ldr r4, [r6, 0x4] + ldr r0, [r6, 0xC] + adds r7, r5, 0x1 + cmp r4, r0 + bge _08051724 + ldr r5, _08051784 + ldr r1, _08051788 + adds r2, r1, 0 +_0805170A: + ldr r0, [r5, 0x8] + adds r1, r4, 0 + str r2, [sp, 0xC] + bl sub_8049590 + ldrh r1, [r0] + ldr r2, [sp, 0xC] + ands r1, r2 + strh r1, [r0] + adds r4, 0x1 + ldr r0, [r5, 0xC] + cmp r4, r0 + blt _0805170A +_08051724: + adds r5, r7, 0 + cmp r5, r10 + bge _08051734 + ldr r0, [r6, 0x8] + ldr r1, [r6] + subs r0, r1 + cmp r0, r8 + bgt _080516B0 +_08051734: + movs r5, 0 + ldr r3, _08051784 + cmp r5, r10 + bge _080517CE + ldr r0, [r3, 0xC] + ldr r1, [r3, 0x4] + subs r0, r1 + cmp r0, r9 + ble _080517CE + adds r6, r3, 0 +_08051748: + movs r0, 0x64 + bl sub_8084100 + cmp r0, 0x31 + bgt _0805178C + ldr r4, [r6] + ldr r0, [r6, 0x8] + adds r7, r5, 0x1 + cmp r4, r0 + bge _0805177C + ldr r5, _08051784 + ldr r0, _08051788 + adds r2, r0, 0 +_08051762: + ldr r1, [r5, 0x4] + adds r0, r4, 0 + str r2, [sp, 0xC] + bl sub_8049590 + ldrh r1, [r0] + ldr r2, [sp, 0xC] + ands r1, r2 + strh r1, [r0] + adds r4, 0x1 + ldr r0, [r5, 0x8] + cmp r4, r0 + blt _08051762 +_0805177C: + ldr r0, [r6, 0x4] + adds r0, 0x1 + str r0, [r6, 0x4] + b _080517BC + .align 2, 0 +_08051784: .4byte gUnknown_202F1B8 +_08051788: .4byte 0x0000ffdf +_0805178C: + ldr r0, [r6, 0xC] + subs r0, 0x1 + str r0, [r6, 0xC] + ldr r4, [r6] + ldr r0, [r6, 0x8] + adds r7, r5, 0x1 + cmp r4, r0 + bge _080517BC + ldr r5, _080518E4 + ldr r1, _080518E8 + adds r2, r1, 0 +_080517A2: + ldr r1, [r5, 0xC] + adds r0, r4, 0 + str r2, [sp, 0xC] + bl sub_8049590 + ldrh r1, [r0] + ldr r2, [sp, 0xC] + ands r1, r2 + strh r1, [r0] + adds r4, 0x1 + ldr r0, [r5, 0x8] + cmp r4, r0 + blt _080517A2 +_080517BC: + adds r5, r7, 0 + ldr r3, _080518E4 + cmp r5, r10 + bge _080517CE + ldr r1, [r6, 0xC] + ldr r0, [r6, 0x4] + subs r1, r0 + cmp r1, r9 + bgt _08051748 +_080517CE: + ldr r7, [r3] + ldr r0, [r3, 0x8] + cmp r7, r0 + bge _08051824 + adds r4, r3, 0 + mov r9, r3 +_080517DA: + ldr r5, [r4, 0x4] + ldr r0, [r4, 0xC] + adds r1, r7, 0x1 + mov r8, r1 + cmp r5, r0 + bge _0805181A + ldr r3, _080518E4 + ldr r0, _080518E8 + adds r6, r0, 0 +_080517EC: + adds r0, r7, 0 + adds r1, r5, 0 + str r3, [sp, 0x10] + bl sub_8049590 + adds r2, r0, 0 + ldrh r1, [r2] + movs r0, 0x20 + ands r0, r1 + ldr r3, [sp, 0x10] + cmp r0, 0 + beq _08051812 + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08051812 + adds r0, r1, 0 + ands r0, r6 + strh r0, [r2] +_08051812: + adds r5, 0x1 + ldr r0, [r4, 0xC] + cmp r5, r0 + blt _080517EC +_0805181A: + mov r7, r8 + mov r1, r9 + ldr r0, [r1, 0x8] + cmp r7, r0 + blt _080517DA +_08051824: + ldr r0, [r3] + ldr r1, [r3, 0x8] + adds r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r2, r0, 1 + ldr r0, [r3, 0x4] + ldr r1, [r3, 0xC] + adds r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + subs r0, 0x1 + mov r10, r0 + movs r0, 0 + mov r9, r0 + subs r7, r2, 0x1 + adds r0, r2, 0x2 + cmp r7, r0 + bge _080518D2 + adds r2, r0, 0 + str r2, [sp, 0x4] +_08051850: + mov r5, r10 + adds r0, r5, 0x3 + adds r1, r7, 0x1 + mov r8, r1 + mov r1, r9 + adds r1, 0x1 + str r1, [sp, 0x8] + cmp r5, r0 + bge _080518C6 + movs r3, 0 +_08051864: + adds r0, r7, 0 + adds r1, r5, 0 + str r3, [sp, 0x10] + bl sub_8049590 + adds r6, r0, 0 + ldrh r1, [r6] + movs r0, 0x20 + ands r0, r1 + ldr r3, [sp, 0x10] + cmp r0, 0 + beq _080518BA + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _080518BA + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _080518BA + mov r0, r9 + lsls r2, r0, 1 + adds r2, r3 + ldr r0, [sp] + ldrb r1, [r0, 0x18] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 1 + adds r2, r0 + ldr r1, _080518EC + adds r2, r1 + movs r0, 0 + ldrsh r4, [r2, r0] + movs r0, 0x64 + bl sub_8084100 + ldr r3, [sp, 0x10] + cmp r4, r0 + ble _080518BA + ldrh r1, [r6, 0x4] + movs r0, 0x2 + orrs r0, r1 + strh r0, [r6, 0x4] +_080518BA: + adds r5, 0x1 + adds r3, 0x6 + mov r0, r10 + adds r0, 0x3 + cmp r5, r0 + blt _08051864 +_080518C6: + mov r7, r8 + ldr r1, [sp, 0x8] + mov r9, r1 + ldr r0, [sp, 0x4] + cmp r7, r0 + blt _08051850 +_080518D2: + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080518E4: .4byte gUnknown_202F1B8 +_080518E8: .4byte 0x0000ffdf +_080518EC: .4byte gUnknown_80F57D4 + thumb_func_end sub_8051654 + + thumb_func_start sub_80518F0 +sub_80518F0: + push {r4-r7,lr} + movs r5, 0 + movs r6, 0x10 + movs r7, 0 +_080518F8: + adds r0, r5, 0 + movs r1, 0x1 + bl sub_8049590 + adds r4, r0, 0 + bl sub_804FD10 + cmp r5, 0 + beq _0805190E + cmp r5, 0x37 + bne _08051914 +_0805190E: + ldrh r0, [r4] + orrs r0, r6 + strh r0, [r4] +_08051914: + adds r0, r5, 0 + movs r1, 0x1E + bl sub_8049590 + adds r4, r0, 0 + bl sub_804FD10 + cmp r5, 0 + beq _0805192A + cmp r5, 0x37 + bne _08051930 +_0805192A: + ldrh r0, [r4] + orrs r0, r6 + strh r0, [r4] +_08051930: + adds r5, 0x1 + cmp r5, 0x37 + ble _080518F8 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80518F0 + + thumb_func_start sub_805193C +sub_805193C: + push {r4-r6,lr} + sub sp, 0x8 + adds r6, r3, 0 + ldr r4, [sp, 0x18] + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 16 + lsls r2, 16 + lsrs r1, 16 + orrs r1, r2 + str r1, [sp, 0x4] + adds r0, r5, 0 + bl sub_805210C + lsls r0, 24 + cmp r0, 0 + beq _0805196A + mov r0, sp + movs r1, 0x76 + movs r2, 0 + bl sub_8090A8C + b _08051974 +_0805196A: + mov r0, sp + adds r1, r5, 0 + movs r2, 0 + bl sub_8090A8C +_08051974: + mov r0, sp + ldrb r0, [r0] + orrs r4, r0 + mov r0, sp + strb r4, [r0] + cmp r6, 0 + beq _08051984 + strb r6, [r0, 0x1] +_08051984: + add r0, sp, 0x4 + mov r1, sp + movs r2, 0x1 + bl sub_80460F8 + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_805193C + + thumb_func_start sub_8051998 +sub_8051998: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + mov r8, r1 + mov r9, r2 + lsls r0, 16 + asrs r0, 16 + adds r1, r0, 0 + lsls r3, 24 + lsrs r6, r3, 24 + adds r7, r6, 0 + ldr r0, _080519E4 + cmp r1, r0 + bne _080519E8 + mov r1, sp + movs r5, 0 + movs r4, 0 + movs r0, 0x3C + strh r0, [r1] + bl sub_803DA20 + mov r1, sp + strh r0, [r1, 0x8] + mov r0, sp + strb r6, [r0, 0x2] + str r4, [sp, 0x4] + strb r5, [r0, 0x10] + mov r1, r8 + strh r1, [r0, 0xC] + mov r1, r9 + strh r1, [r0, 0xE] + movs r1, 0x1 + bl sub_806B7F8 + b _08051A14 + .align 2, 0 +_080519E4: .4byte 0x000001a5 +_080519E8: + cmp r1, 0 + beq _08051A14 + mov r0, sp + movs r5, 0 + movs r4, 0 + strh r1, [r0] + adds r0, r1, 0 + bl sub_803DA20 + mov r1, sp + strh r0, [r1, 0x8] + mov r0, sp + strb r7, [r0, 0x2] + str r4, [sp, 0x4] + strb r5, [r0, 0x10] + mov r1, r8 + strh r1, [r0, 0xC] + mov r1, r9 + strh r1, [r0, 0xE] + movs r1, 0x1 + bl sub_806B7F8 +_08051A14: + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8051998 + + thumb_func_start sub_8051A24 +sub_8051A24: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r6, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + lsls r6, 24 + lsrs r6, 24 + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8049590 + adds r7, r0, 0 + lsls r4, 16 + lsls r5, 16 + lsrs r4, 16 + orrs r4, r5 + str r4, [sp] + adds r0, r6, 0 + mov r1, sp + movs r2, 0 + bl sub_8045684 + cmp r0, 0 + beq _08051A66 + str r0, [r7, 0x14] + adds r0, 0x20 + mov r1, r8 + strb r1, [r0] +_08051A66: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8051A24 + + thumb_func_start sub_8051A74 +sub_8051A74: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + adds r4, r0, 0 + adds r6, r2, 0 + adds r7, r3, 0 + ldr r0, [sp, 0x20] + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + cmp r1, 0xF + bls _08051AA2 + ldrh r0, [r4] + ldr r1, _08051AB4 + ands r1, r0 + movs r0, 0x1 + orrs r1, r0 + strh r1, [r4] +_08051AA2: + mov r0, r8 + cmp r0, 0x45 + bls _08051AAA + b _08051D68 +_08051AAA: + lsls r0, 2 + ldr r1, _08051AB8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08051AB4: .4byte 0x0000fffc +_08051AB8: .4byte _08051ABC + .align 2, 0 +_08051ABC: + .4byte _08051BF0 + .4byte _08051C0C + .4byte _08051D50 + .4byte _08051E1A + .4byte _08051C20 + .4byte _08051C54 + .4byte _08051C64 + .4byte _08051C74 + .4byte _08051C94 + .4byte _08051D00 + .4byte _08051C7E + .4byte _08051D10 + .4byte _08051D24 + .4byte _08051D50 + .4byte _08051D50 + .4byte _08051E1A + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051D68 + .4byte _08051C94 + .4byte _08051CD4 + .4byte _08051BD4 +_08051BD4: + ldr r0, _08051BFC + ldr r0, [r0] + ldr r2, _08051C00 + adds r1, r0, r2 + strh r6, [r1] + ldr r3, _08051C04 + adds r0, r3 + strh r7, [r0] + movs r0, 0xB + adds r1, r6, 0 + adds r2, r7, 0 + movs r3, 0 + bl sub_8051A24 +_08051BF0: + ldrh r1, [r4] + ldr r0, _08051C08 + ands r0, r1 + movs r1, 0x1 + movs r2, 0 + b _08051D42 + .align 2, 0 +_08051BFC: .4byte gUnknown_203B418 +_08051C00: .4byte 0x00000684 +_08051C04: .4byte 0x00000686 +_08051C08: .4byte 0x0000fffc +_08051C0C: + ldrh r1, [r4] + ldr r0, _08051C18 + ands r0, r1 + ldr r1, _08051C1C + ands r0, r1 + b _08051D5A + .align 2, 0 +_08051C18: .4byte 0x0000fffc +_08051C1C: .4byte 0x0000feff +_08051C20: + ldrh r1, [r4] + ldr r0, _08051C44 + ands r0, r1 + movs r1, 0x1 + movs r2, 0 + orrs r0, r1 + strh r0, [r4] + ldr r0, _08051C48 + ldr r0, [r0] + ldr r3, _08051C4C + adds r1, r0, r3 + strh r6, [r1] + ldr r1, _08051C50 + adds r0, r1 + strh r7, [r0] + strb r2, [r4, 0x9] + b _08051E1A + .align 2, 0 +_08051C44: .4byte 0x0000fffc +_08051C48: .4byte gUnknown_203B418 +_08051C4C: .4byte 0x0000e218 +_08051C50: .4byte 0x0000e21a +_08051C54: + ldrh r1, [r4] + ldr r0, _08051C60 + ands r0, r1 + movs r2, 0 + movs r1, 0x2 + b _08051D42 + .align 2, 0 +_08051C60: .4byte 0x0000fffc +_08051C64: + ldrh r1, [r4] + ldr r0, _08051C70 + ands r0, r1 + movs r1, 0x3 + b _08051D58 + .align 2, 0 +_08051C70: .4byte 0x0000fffc +_08051C74: + ldr r1, _08051C8C + movs r0, 0x1 + strb r0, [r1] + bl sub_8049840 +_08051C7E: + ldrh r1, [r4] + ldr r0, _08051C90 + ands r0, r1 + movs r1, 0x3 + orrs r0, r1 + b _08051D56 + .align 2, 0 +_08051C8C: .4byte gUnknown_202F1A8 +_08051C90: .4byte 0x0000fffc +_08051C94: + ldrh r1, [r4] + ldr r0, _08051CC0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strh r0, [r4] + ldrh r0, [r4, 0x4] + movs r2, 0 + orrs r0, r1 + ldr r1, _08051CC4 + ands r0, r1 + strh r0, [r4, 0x4] + strb r2, [r4, 0x9] + ldr r0, _08051CC8 + ldr r0, [r0] + ldr r2, _08051CCC + adds r1, r0, r2 + strh r6, [r1] + ldr r3, _08051CD0 + adds r0, r3 + strh r7, [r0] + b _08051E1A + .align 2, 0 +_08051CC0: .4byte 0x0000fffc +_08051CC4: .4byte 0x0000fffd +_08051CC8: .4byte gUnknown_203B418 +_08051CCC: .4byte 0x0000e21c +_08051CD0: .4byte 0x0000e21e +_08051CD4: + ldrh r1, [r4] + movs r2, 0x80 + lsls r2, 4 + adds r0, r2, 0 + orrs r0, r1 + ldr r1, _08051CF8 + ands r0, r1 + movs r1, 0x1 + movs r2, 0 + orrs r0, r1 + strh r0, [r4] + ldrh r1, [r4, 0x4] + ldr r0, _08051CFC + ands r0, r1 + strh r0, [r4, 0x4] + strb r2, [r4, 0x9] + b _08051E1A + .align 2, 0 +_08051CF8: .4byte 0x0000fffc +_08051CFC: .4byte 0x0000fffd +_08051D00: + ldrh r1, [r4] + ldr r0, _08051D0C + ands r0, r1 + movs r1, 0x1 + b _08051D58 + .align 2, 0 +_08051D0C: .4byte 0x0000fffc +_08051D10: + ldrh r1, [r4] + ldr r0, _08051D20 + ands r0, r1 + movs r1, 0x1 + movs r2, 0 + orrs r0, r1 + b _08051D3C + .align 2, 0 +_08051D20: .4byte 0x0000fffc +_08051D24: + ldrh r1, [r4] + ldr r0, _08051D4C + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + movs r2, 0x80 + lsls r2, 5 + adds r1, r2, 0 + orrs r0, r1 + movs r1, 0x10 + orrs r0, r1 + movs r2, 0 +_08051D3C: + movs r3, 0x80 + lsls r3, 4 + adds r1, r3, 0 +_08051D42: + orrs r0, r1 + strh r0, [r4] + strb r2, [r4, 0x9] + b _08051E1A + .align 2, 0 +_08051D4C: .4byte 0x0000fffc +_08051D50: + ldrh r1, [r4] + ldr r0, _08051D64 + ands r0, r1 +_08051D56: + movs r1, 0x10 +_08051D58: + orrs r0, r1 +_08051D5A: + strh r0, [r4] + movs r0, 0xFF + strb r0, [r4, 0x9] + b _08051E1A + .align 2, 0 +_08051D64: .4byte 0x0000fffc +_08051D68: + mov r0, r8 + subs r0, 0x10 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0xCB + bhi _08051E1A + mov r1, r8 + lsls r0, r1, 4 + ldr r1, _08051DA0 + adds r5, r0, r1 + ldrb r0, [r5, 0xC] + strb r0, [r4, 0x9] + ldrb r1, [r5] + cmp r1, 0 + beq _08051DB8 + mov r2, r9 + cmp r2, 0 + beq _08051DA4 + ldrb r0, [r5] + movs r1, 0x2 + ldrsh r3, [r5, r1] + ldr r1, [r5, 0x4] + str r1, [sp] + adds r1, r6, 0 + adds r2, r7, 0 + bl sub_805193C + b _08051DDC + .align 2, 0 +_08051DA0: .4byte gUnknown_80F6D20 +_08051DA4: + ldr r0, _08051DB0 + ldr r0, [r0] + ldr r2, _08051DB4 + adds r0, r2 + strb r1, [r0] + b _08051DDC + .align 2, 0 +_08051DB0: .4byte gUnknown_203B418 +_08051DB4: .4byte 0x0000068b +_08051DB8: + ldr r2, [r5, 0x4] + cmp r2, 0 + beq _08051DDC + ldr r0, _08051E2C + ldr r1, [r0] + subs r0, r2, 0x1 + lsls r0, 2 + adds r0, r1, r0 + ldr r3, _08051E30 + adds r0, r3 + strh r6, [r0] + ldr r0, [r5, 0x4] + subs r0, 0x1 + lsls r0, 2 + adds r1, r0 + ldr r0, _08051E34 + adds r1, r0 + strh r7, [r1] +_08051DDC: + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _08051DF2 + ldrb r3, [r5, 0xA] + mov r1, r8 + str r1, [sp] + adds r1, r6, 0 + adds r2, r7, 0 + bl sub_8051998 +_08051DF2: + ldrb r0, [r5, 0xB] + cmp r0, 0x14 + beq _08051E08 + mov r2, r9 + cmp r2, 0 + beq _08051E08 + ldrb r3, [r5, 0xD] + adds r1, r6, 0 + adds r2, r7, 0 + bl sub_8051A24 +_08051E08: + ldrb r0, [r5, 0xE] + cmp r0, 0 + beq _08051E1A + ldrh r0, [r4] + ldr r1, _08051E38 + ands r1, r0 + movs r0, 0x2 + orrs r1, r0 + strh r1, [r4] +_08051E1A: + movs r0, 0 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08051E2C: .4byte gUnknown_203B418 +_08051E30: .4byte 0x0000e220 +_08051E34: .4byte 0x0000e222 +_08051E38: .4byte 0x0000fffc + thumb_func_end sub_8051A74 + + thumb_func_start sub_8051E3C +sub_8051E3C: + push {r4-r6,lr} + sub sp, 0x4 + movs r5, 0 +_08051E42: + movs r4, 0 + adds r6, r5, 0x1 +_08051E46: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8049590 + adds r2, r0, 0 + ldrb r0, [r2, 0xE] + cmp r0, 0xF + bls _08051E66 + adds r1, r0, 0 + movs r0, 0 + str r0, [sp] + adds r0, r2, 0 + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_8051A74 +_08051E66: + adds r4, 0x1 + cmp r4, 0x37 + ble _08051E46 + adds r5, r6, 0 + cmp r5, 0x1F + ble _08051E42 + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8051E3C + + thumb_func_start sub_8051E7C +sub_8051E7C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + mov r9, r0 + movs r1, 0x4 + ldrsh r0, [r0, r1] + mov r2, r9 + movs r3, 0x6 + ldrsh r1, [r2, r3] + subs r1, 0x1 + bl sub_8049590 + str r0, [sp, 0x8] + ldrh r1, [r0] + movs r0, 0x80 + lsls r0, 5 + ands r0, r1 + cmp r0, 0 + bne _08051EB8 + ldr r0, _08051EB4 + ldr r1, [r0] + mov r0, r9 + bl sub_80522A8 + b _080520F6 + .align 2, 0 +_08051EB4: .4byte gUnknown_80FDDF0 +_08051EB8: + ldr r0, _08051EF0 + ldr r0, [r0] + ldr r1, _08051EF4 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08051EC8 + b _080520EC +_08051EC8: + mov r2, r9 + ldrh r1, [r2, 0x6] + subs r1, 0x1 + lsls r1, 16 + ldrh r0, [r2, 0x4] + orrs r0, r1 + str r0, [sp, 0x4] + mov r0, r9 + bl sub_80450FC + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0xC] + mov r3, r9 + movs r1, 0x6 + ldrsh r0, [r3, r1] + adds r6, r0, 0 + subs r6, 0x15 + b _08051FE0 + .align 2, 0 +_08051EF0: .4byte gUnknown_203B418 +_08051EF4: .4byte 0x00003a09 +_08051EF8: + mov r2, r9 + movs r3, 0x4 + ldrsh r0, [r2, r3] + adds r5, r0, 0 + subs r5, 0x14 + adds r0, 0x14 + adds r1, r6, 0x1 + str r1, [sp, 0x10] + cmp r5, r0 + bgt _08051FD8 + ldr r2, _080520C0 + mov r10, r2 +_08051F10: + mov r0, r10 + ldr r3, [r0] + ldr r1, _080520C4 + adds r0, r3, r1 + ldr r1, [r0] + subs r2, r5, r1 + mov r8, r2 + ldr r2, _080520C8 + adds r0, r3, r2 + ldr r2, [r0] + subs r7, r6, r2 + mov r0, r8 + cmp r0, 0 + blt _08051FCA + cmp r7, 0 + blt _08051FCA + cmp r0, 0x7 + bgt _08051FCA + cmp r7, 0x7 + bgt _08051FCA + adds r0, r1, 0x1 + cmp r5, r0 + blt _08051FCA + adds r0, r2, 0x1 + cmp r6, r0 + blt _08051FCA + ldr r1, _080520CC + adds r0, r3, r1 + ldr r0, [r0] + subs r0, 0x1 + cmp r5, r0 + bge _08051FCA + ldr r2, _080520D0 + adds r0, r3, r2 + ldr r0, [r0] + subs r0, 0x1 + cmp r6, r0 + bge _08051FCA + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_8049590 + adds r4, r0, 0 + ldrh r0, [r4] + movs r3, 0x80 + lsls r3, 1 + adds r1, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _08051F9A + mov r0, r10 + ldr r2, [r0] + lsls r1, r7, 1 + adds r1, r7 + lsls r1, 3 + mov r3, r8 + lsls r0, r3, 1 + add r0, r8 + lsls r0, 6 + adds r1, r0 + adds r2, r1 + ldr r1, _080520D4 + adds r0, r2, r1 + ldrh r0, [r0] + strh r0, [r4] + ldr r3, _080520D8 + adds r2, r3 + ldrh r0, [r2] + strh r0, [r4, 0x4] +_08051F9A: + mov r1, r10 + ldr r0, [r1] + mov r2, r8 + lsls r1, r2, 3 + adds r1, r7, r1 + ldr r3, _080520DC + adds r0, r3 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + str r0, [sp] + adds r0, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_8051A74 + ldrh r1, [r4, 0x4] + movs r0, 0x3 + orrs r0, r1 + strh r0, [r4, 0x4] + ldr r0, [sp, 0xC] + cmp r0, 0xFF + beq _08051FCA + strb r0, [r4, 0x9] +_08051FCA: + adds r5, 0x1 + mov r2, r9 + movs r3, 0x4 + ldrsh r0, [r2, r3] + adds r0, 0x14 + cmp r5, r0 + ble _08051F10 +_08051FD8: + ldr r6, [sp, 0x10] + mov r1, r9 + movs r2, 0x6 + ldrsh r0, [r1, r2] +_08051FE0: + adds r0, 0x13 + cmp r6, r0 + ble _08051EF8 + mov r3, r9 + movs r1, 0x6 + ldrsh r0, [r3, r1] + adds r6, r0, 0 + subs r6, 0x15 + adds r0, 0x13 + ldr r7, _080520C0 + cmp r6, r0 + bgt _0805207A +_08051FF8: + mov r2, r9 + movs r3, 0x4 + ldrsh r0, [r2, r3] + adds r5, r0, 0 + subs r5, 0x14 + adds r0, 0x14 + adds r1, r6, 0x1 + str r1, [sp, 0x10] + cmp r5, r0 + bgt _0805206C + ldr r7, _080520C0 +_0805200E: + ldr r0, _080520C0 + ldr r4, [r0] + ldr r2, _080520C4 + adds r0, r4, r2 + ldr r2, [r0] + subs r1, r5, r2 + ldr r3, _080520C8 + adds r0, r4, r3 + ldr r3, [r0] + subs r0, r6, r3 + cmp r1, 0 + blt _0805205E + cmp r0, 0 + blt _0805205E + cmp r1, 0x7 + bgt _0805205E + cmp r0, 0x7 + bgt _0805205E + adds r0, r2, 0x1 + cmp r5, r0 + blt _0805205E + adds r0, r3, 0x1 + cmp r6, r0 + blt _0805205E + ldr r1, _080520CC + adds r0, r4, r1 + ldr r0, [r0] + subs r0, 0x1 + cmp r5, r0 + bge _0805205E + ldr r2, _080520D0 + adds r0, r4, r2 + ldr r0, [r0] + subs r0, 0x1 + cmp r6, r0 + bge _0805205E + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_80498A8 +_0805205E: + adds r5, 0x1 + mov r3, r9 + movs r1, 0x4 + ldrsh r0, [r3, r1] + adds r0, 0x14 + cmp r5, r0 + ble _0805200E +_0805206C: + ldr r6, [sp, 0x10] + mov r2, r9 + movs r3, 0x6 + ldrsh r0, [r2, r3] + adds r0, 0x13 + cmp r6, r0 + ble _08051FF8 +_0805207A: + ldr r0, [r7] + ldr r1, _080520E0 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + ldr r2, [sp, 0x8] + ldrh r1, [r2] + ldr r0, _080520E4 + ands r0, r1 + strh r0, [r2] + mov r3, r9 + movs r1, 0x4 + ldrsh r0, [r3, r1] + movs r2, 0x6 + ldrsh r1, [r3, r2] + subs r1, 0x1 + bl sub_80498A8 + bl sub_8049B8C + bl sub_8049ED4 + add r0, sp, 0x4 + bl sub_80429FC + ldr r0, _080520E8 + ldr r1, [r0] + mov r0, r9 + bl sub_80522A8 + movs r0, 0x14 + movs r1, 0x3C + bl sub_803E708 + b _080520F6 + .align 2, 0 +_080520C0: .4byte gUnknown_203B418 +_080520C4: .4byte 0x0000e250 +_080520C8: .4byte 0x0000e254 +_080520CC: .4byte 0x0000e258 +_080520D0: .4byte 0x0000e25c +_080520D4: .4byte 0x0000e27c +_080520D8: .4byte 0x0000e280 +_080520DC: .4byte 0x0000e87c +_080520E0: .4byte 0x00003a09 +_080520E4: .4byte 0x0000efef +_080520E8: .4byte gUnknown_80FDDD0 +_080520EC: + ldr r0, _08052108 + ldr r1, [r0] + mov r0, r9 + bl sub_80522A8 +_080520F6: + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08052108: .4byte gUnknown_80FDDF0 + thumb_func_end sub_8051E7C + + thumb_func_start sub_805210C +sub_805210C: + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r3, 0 + ldr r7, _080521B4 + movs r4, 0x1 + ldr r2, [r7] +_0805211A: + ldrb r1, [r2] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _0805212A + ldrb r0, [r2, 0x2] + cmp r0, r5 + beq _080521C8 +_0805212A: + adds r2, 0x4 + adds r3, 0x1 + cmp r3, 0x13 + ble _0805211A + movs r3, 0 + ldr r0, _080521B8 + ldr r4, [r0] + movs r6, 0x1 +_0805213A: + movs r0, 0x64 + adds r2, r3, 0 + muls r2, r0 + adds r0, r2, r4 + ldr r1, _080521BC + adds r0, r1 + ldrb r1, [r0] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _0805216C + adds r0, r2, r4 + ldr r1, _080521C0 + adds r0, r1 + ldrb r1, [r0] + adds r0, r6, 0 + ands r0, r1 + adds r1, r2, r4 + cmp r0, 0 + beq _0805216C + ldr r2, _080521C4 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, r5 + beq _080521C8 +_0805216C: + adds r3, 0x1 + cmp r3, 0x3 + ble _0805213A + movs r3, 0 + ldr r0, _080521B8 + ldr r4, [r0] +_08052178: + movs r0, 0x58 + muls r0, r3 + adds r2, r0, r4 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08052196 + adds r0, r2, 0 + adds r0, 0x28 + ldrb r0, [r0] + cmp r0, 0 + beq _08052196 + cmp r0, r5 + beq _080521C8 +_08052196: + adds r3, 0x1 + movs r0, 0xCE + lsls r0, 1 + cmp r3, r0 + ble _08052178 + ldr r0, [r7] + lsls r1, r5, 1 + adds r0, 0x50 + adds r0, r1 + ldrh r0, [r0] + cmp r0, 0 + bne _080521C8 + movs r0, 0 + b _080521CA + .align 2, 0 +_080521B4: .4byte gUnknown_203B460 +_080521B8: .4byte gUnknown_203B45C +_080521BC: .4byte 0x00008df8 +_080521C0: .4byte 0x00008e38 +_080521C4: .4byte 0x00008e3a +_080521C8: + movs r0, 0x1 +_080521CA: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_805210C + + thumb_func_start sub_80521D0 +sub_80521D0: + push {r4-r6,lr} + movs r1, 0 + ldr r5, _08052200 + ldr r6, _08052204 + ldr r4, _08052208 + ldr r3, _0805220C + movs r2, 0 +_080521DE: + ldr r0, [r4] + adds r0, r3 + adds r0, r1 + strb r2, [r0] + adds r1, 0x1 + cmp r1, 0x9 + ble _080521DE + movs r0, 0 + str r0, [r5] + movs r0, 0x1 + strb r0, [r6] + movs r0, 0 + bl sub_8052210 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08052200: .4byte gUnknown_202F1E8 +_08052204: .4byte gUnknown_203B434 +_08052208: .4byte gUnknown_203B418 +_0805220C: .4byte 0x0001c054 + thumb_func_end sub_80521D0 + + thumb_func_start sub_8052210 +sub_8052210: + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r4, 0 + ldr r5, _08052280 +_0805221A: + lsls r0, r4, 6 + ldr r1, [r5] + adds r0, r1 + ldr r1, _08052284 + adds r0, r1 + ldr r1, _08052288 + bl strcpy + adds r4, 0x1 + cmp r4, 0x9 + ble _0805221A + ldr r1, _08052280 + ldr r0, [r1] + ldr r2, _0805228C + adds r0, r2 + movs r3, 0 + strb r3, [r0] + ldr r0, [r1] + adds r2, 0x1 + adds r1, r0, r2 + strh r3, [r1] + adds r2, 0x2 + adds r1, r0, r2 + strh r3, [r1] + adds r2, 0x2 + adds r1, r0, r2 + strh r3, [r1] + ldr r1, _08052290 + adds r2, r0, r1 + movs r1, 0x4 + strh r1, [r2] + ldr r2, _08052294 + adds r0, r2 + str r3, [r0] + cmp r6, 0 + beq _08052278 + ldr r0, _08052298 + ldr r0, [r0] + cmp r0, 0x3 + bne _08052278 + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + movs r0, 0xB + bl sub_803E46C +_08052278: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08052280: .4byte gUnknown_203B418 +_08052284: .4byte 0x0001bdd4 +_08052288: .4byte gUnknown_80F7AE8 +_0805228C: .4byte 0x0001c05f +_08052290: .4byte 0x0001c066 +_08052294: .4byte 0x0001c06c +_08052298: .4byte gUnknown_202EDD0 + thumb_func_end sub_8052210 + + thumb_func_start sub_805229C +sub_805229C: + push {lr} + movs r0, 0x50 + bl sub_80526D0 + pop {r0} + bx r0 + thumb_func_end sub_805229C + + thumb_func_start sub_80522A8 +sub_80522A8: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_8045888 + lsls r0, 24 + cmp r0, 0 + beq _080522C2 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_80523A8 +_080522C2: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80522A8 + + thumb_func_start sub_80522C8 +sub_80522C8: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_8045888 + lsls r0, 24 + cmp r0, 0 + beq _080522E2 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0 + bl sub_80523A8 +_080522E2: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80522C8 + + thumb_func_start sub_80522E8 +sub_80522E8: + push {lr} + movs r2, 0 + bl sub_80523A8 + pop {r0} + bx r0 + thumb_func_end sub_80522E8 + + thumb_func_start sub_80522F4 +sub_80522F4: + push {r4-r7,lr} + adds r6, r0, 0 + adds r4, r1, 0 + adds r7, r2, 0 + bl sub_8045888 + lsls r0, 24 + lsrs r0, 24 + negs r1, r0 + orrs r1, r0 + lsrs r5, r1, 31 + adds r0, r4, 0 + bl sub_8052DC0 + lsls r0, 24 + cmp r0, 0 + beq _08052318 + movs r5, 0x1 +_08052318: + cmp r5, 0 + beq _08052326 + adds r0, r6, 0 + adds r1, r7, 0 + movs r2, 0x1 + bl sub_80523A8 +_08052326: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80522F4 + + thumb_func_start sub_805232C +sub_805232C: + push {r4-r7,lr} + adds r6, r0, 0 + adds r4, r1, 0 + adds r7, r2, 0 + bl sub_8045888 + lsls r0, 24 + lsrs r0, 24 + negs r1, r0 + orrs r1, r0 + lsrs r5, r1, 31 + adds r0, r4, 0 + bl sub_8052DC0 + lsls r0, 24 + cmp r0, 0 + beq _08052350 + movs r5, 0x1 +_08052350: + cmp r5, 0 + beq _0805235E + adds r0, r6, 0 + adds r1, r7, 0 + movs r2, 0 + bl sub_80523A8 +_0805235E: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_805232C + + thumb_func_start sub_8052364 +sub_8052364: + push {r4-r7,lr} + adds r6, r0, 0 + adds r4, r1, 0 + adds r7, r2, 0 + bl sub_8045888 + lsls r0, 24 + lsrs r0, 24 + negs r1, r0 + orrs r1, r0 + lsrs r5, r1, 31 + adds r0, r4, 0 + bl sub_803F428 + lsls r0, 24 + cmp r0, 0 + beq _08052388 + movs r5, 0x1 +_08052388: + cmp r5, 0 + beq _08052396 + adds r0, r6, 0 + adds r1, r7, 0 + movs r2, 0x1 + bl sub_80523A8 +_08052396: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8052364 + + thumb_func_start sub_805239C +sub_805239C: + push {lr} + movs r2, 0x1 + bl sub_80523A8 + pop {r0} + bx r0 + thumb_func_end sub_805239C + + thumb_func_start sub_80523A8 +sub_80523A8: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x40 + adds r3, r0, 0 + adds r4, r1, 0 + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + ldr r0, _080523D0 + ldr r1, [r0] + adds r2, r0, 0 + cmp r1, r3 + beq _080523D8 + movs r7, 0x1 + ldr r1, _080523D4 + b _080523DE + .align 2, 0 +_080523D0: .4byte gUnknown_202F1E8 +_080523D4: .4byte gUnknown_203B434 +_080523D8: + ldr r0, _080523F0 + ldrb r7, [r0] + adds r1, r0, 0 +_080523DE: + movs r0, 0x1 + mov r8, r0 + str r3, [r2] + movs r0, 0 + strb r0, [r1] + movs r1, 0 + mov r9, r1 + b _080523FA + .align 2, 0 +_080523F0: .4byte gUnknown_203B434 +_080523F4: + movs r0, 0 + bl sub_803E46C +_080523FA: + ldr r6, _0805249C + ldr r2, [r6] + ldr r3, _080524A0 + adds r0, r2, r3 + movs r3, 0 + ldrsh r1, [r0, r3] + adds r1, 0x1 + cmp r1, 0xA + bne _0805240E + movs r1, 0 +_0805240E: + ldr r3, _080524A4 + adds r0, r2, r3 + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r1, r0 + beq _080523F4 + ldrb r0, [r4] + cmp r0, 0 + beq _080524B0 + ldr r5, _080524A0 + adds r0, r2, r5 + movs r3, 0 + ldrsh r1, [r0, r3] + ldr r3, _080524A8 + adds r0, r2, r3 + adds r0, r1 + strb r7, [r0] + adds r0, r4, 0 + mov r1, sp + mov r2, sp + adds r2, 0x3E + movs r3, 0x80 + bl sub_8014BC4 + adds r4, r0, 0 + ldrb r0, [r4] + cmp r0, 0xD + bne _08052448 + adds r4, 0x1 +_08052448: + ldrb r0, [r4] + cmp r0, 0xA + bne _08052450 + adds r4, 0x1 +_08052450: + mov r0, sp + adds r1, r7, 0 + mov r2, r8 + bl sub_8053210 + movs r7, 0 + movs r0, 0 + mov r8, r0 + mov r1, r10 + cmp r1, 0 + beq _080523FA + movs r2, 0x1 + mov r9, r2 + ldr r1, [r6] + adds r0, r1, r5 + movs r3, 0 + ldrsh r0, [r0, r3] + lsls r0, 6 + adds r0, r1 + ldr r1, _080524AC + adds r0, r1 + mov r1, sp + movs r2, 0x40 + bl strncpy + ldr r0, [r6] + adds r1, r0, r5 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bne _080523FA + mov r2, r8 + strh r2, [r1] + b _080523FA + .align 2, 0 +_0805249C: .4byte gUnknown_203B418 +_080524A0: .4byte 0x0001c060 +_080524A4: .4byte 0x0001c062 +_080524A8: .4byte 0x0001c054 +_080524AC: .4byte 0x0001bdd4 +_080524B0: + mov r3, r9 + cmp r3, 0 + beq _080524D4 + ldr r0, _080524E4 + ldr r2, [r0] + ldr r3, _080524E8 + adds r1, r2, r3 + movs r0, 0xF0 + strh r0, [r1] + ldr r0, _080524EC + adds r2, r0 + ldr r0, [r2] + cmp r0, 0 + bne _080524D0 + movs r0, 0x1 + str r0, [r2] +_080524D0: + bl sub_805E804 +_080524D4: + add sp, 0x40 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080524E4: .4byte gUnknown_203B418 +_080524E8: .4byte 0x0001c064 +_080524EC: .4byte 0x0001c06c + thumb_func_end sub_80523A8 + + thumb_func_start sub_80524F0 +sub_80524F0: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x3C + ldr r0, _0805251C + ldr r0, [r0] + ldr r1, _08052520 + adds r7, r0, r1 + ldr r2, _08052524 + adds r5, r0, r2 + ldr r1, [r5] + cmp r1, 0x1 + beq _08052528 + cmp r1, 0x1 + bcs _08052510 + b _0805267C +_08052510: + cmp r1, 0x2 + beq _0805253C + cmp r1, 0x3 + bne _0805251A + b _0805265C +_0805251A: + b _0805267C + .align 2, 0 +_0805251C: .4byte gUnknown_203B418 +_08052520: .4byte 0x0001bdd4 +_08052524: .4byte 0x0001c06c +_08052528: + bl sub_800EC74 + lsls r0, 24 + cmp r0, 0 + beq _08052534 + b _0805267C +_08052534: + movs r0, 0x3 + movs r1, 0 + bl sub_803EAF0 +_0805253C: + ldr r3, _08052560 + adds r0, r7, r3 + movs r1, 0 + ldrsh r4, [r0, r1] + movs r2, 0xA3 + lsls r2, 2 + adds r0, r7, r2 + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r4, r0 + bne _08052564 + movs r0, 0xA6 + lsls r0, 2 + adds r1, r7, r0 + movs r0, 0 + str r0, [r1] + b _0805267C + .align 2, 0 +_08052560: .4byte 0x0000028e +_08052564: + lsls r0, r4, 6 + adds r5, r7, r0 + add r1, sp, 0x4 + movs r0, 0x4 + strh r0, [r1] + ldr r2, _080525B0 + adds r6, r7, r2 + ldrh r0, [r6] + strh r0, [r1, 0x2] + movs r3, 0x7 + mov r8, r3 + str r3, [sp, 0x14] + movs r0, 0 + bl sub_80073B8 + movs r1, 0xA0 + lsls r1, 2 + adds r0, r7, r1 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _080525AA + movs r2, 0 + ldrsh r0, [r6, r2] + cmp r0, 0x7 + ble _080525AA + adds r2, r0, 0 + subs r2, 0x1 + mov r0, r8 + str r0, [sp] + movs r0, 0 + movs r1, 0 + movs r3, 0xE0 + bl sub_80078A4 +_080525AA: + adds r6, r4, 0x1 + b _080525F2 + .align 2, 0 +_080525B0: .4byte 0x00000292 +_080525B4: + add r1, sp, 0x38 + adds r0, r5, 0 + bl xxx_get_next_char_from_string + adds r5, r0, 0 + ldr r4, [sp, 0x38] + cmp r4, 0x60 + bne _080525D0 + add r1, sp, 0x4 + adds r0, r1, 0 + ldrh r0, [r0] + adds r0, 0x6 + strh r0, [r1] + b _080525F2 +_080525D0: + add r0, sp, 0x4 + movs r1, 0 + ldrsh r0, [r0, r1] + add r1, sp, 0x4 + movs r2, 0x2 + ldrsh r1, [r1, r2] + ldr r3, [sp, 0x14] + movs r2, 0 + str r2, [sp] + adds r2, r4, 0 + bl sub_800743C + add r2, sp, 0x4 + adds r1, r2, 0 + ldrh r1, [r1] + adds r1, r0 + strh r1, [r2] +_080525F2: + adds r0, r5, 0 + add r1, sp, 0x4 + bl sub_8009190 + adds r5, r0, 0 + ldrb r0, [r5] + cmp r0, 0 + beq _0805260A + cmp r0, 0xD + beq _0805260A + cmp r0, 0xA + bne _080525B4 +_0805260A: + movs r0, 0 + bl sub_80073E0 + movs r3, 0xA4 + lsls r3, 2 + adds r1, r7, r3 + movs r0, 0xF0 + strh r0, [r1] + adds r4, r6, 0 + cmp r4, 0xA + bne _08052622 + movs r4, 0 +_08052622: + ldr r1, _08052654 + adds r0, r7, r1 + strh r4, [r0] + ldr r2, _08052658 + adds r1, r7, r2 + ldrh r0, [r1] + adds r0, 0xB + strh r0, [r1] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2F + ble _0805267C + movs r0, 0x25 + strh r0, [r1] + movs r3, 0xA5 + lsls r3, 2 + adds r1, r7, r3 + movs r0, 0 + strh r0, [r1] + movs r0, 0xA6 + lsls r0, 2 + adds r1, r7, r0 + movs r0, 0x3 + str r0, [r1] + b _0805267C + .align 2, 0 +_08052654: .4byte 0x0000028e +_08052658: .4byte 0x00000292 +_0805265C: + ldr r1, _080526C4 + adds r4, r0, r1 + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + ldr r0, _080526C8 + ldr r1, [r0] + movs r0, 0 + bl _call_via_r1 + movs r2, 0 + ldrsh r0, [r4, r2] + cmp r0, 0xA + ble _0805267C + movs r0, 0x2 + str r0, [r5] +_0805267C: + ldr r3, _080526CC + adds r0, r7, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _080526B8 + movs r0, 0xA4 + lsls r0, 2 + adds r1, r7, r0 + ldrh r2, [r1] + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _080526B8 + subs r0, r2, 0x1 + strh r0, [r1] + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0 + bne _080526B8 + movs r2, 0xA6 + lsls r2, 2 + adds r0, r7, r2 + str r1, [r0] + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + movs r0, 0 + bl sub_8052210 +_080526B8: + add sp, 0x3C + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080526C4: .4byte 0x0001c068 +_080526C8: .4byte gUnknown_203B08C +_080526CC: .4byte 0x0000028a + thumb_func_end sub_80524F0 + + thumb_func_start sub_80526D0 +sub_80526D0: + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, _0805272C + ldr r1, [r0] + ldr r0, _08052730 + adds r4, r1, r0 + ldr r2, _08052734 + adds r0, r1, r2 + ldr r0, [r0] + cmp r0, 0 + bne _080526FA + ldr r3, _08052738 + adds r0, r1, r3 + subs r2, 0xA + adds r1, r2 + movs r3, 0 + ldrsh r2, [r0, r3] + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r2, r0 + beq _08052724 +_080526FA: + adds r0, r5, 0 + bl sub_803E46C + movs r1, 0xA6 + lsls r1, 2 + adds r0, r4, r1 + ldr r0, [r0] + cmp r0, 0 + bne _080526FA + ldr r0, _0805272C + ldr r0, [r0] + ldr r2, _08052738 + adds r1, r0, r2 + ldr r3, _0805273C + adds r0, r3 + movs r2, 0 + ldrsh r1, [r1, r2] + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r1, r0 + bne _080526FA +_08052724: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0805272C: .4byte gUnknown_203B418 +_08052730: .4byte 0x0001bdd4 +_08052734: .4byte 0x0001c06c +_08052738: .4byte 0x0001c060 +_0805273C: .4byte 0x0001c062 + thumb_func_end sub_80526D0 + + thumb_func_start sub_8052740 +sub_8052740: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + ldr r0, _080527B0 + ldr r4, [r0] + ldr r0, _080527B4 + adds r7, r4, r0 + adds r0, r5, 0 + bl sub_80526D0 + movs r6, 0 + ldr r1, _080527B8 + adds r4, r1 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0xB3 + ble _080527A4 + ldr r2, _080527BC + ldrh r1, [r2] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x3 + beq _080527A4 + adds r4, r2, 0 + ldr r0, _080527C0 + mov r8, r0 +_08052776: + ldrh r0, [r4, 0x2] + mov r1, r8 + ands r0, r1 + cmp r0, 0 + bne _080527A4 + adds r0, r5, 0 + bl sub_803E46C + adds r6, 0x1 + cmp r6, 0xEF + bgt _080527A4 + movs r1, 0xA4 + lsls r1, 2 + adds r0, r7, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0xB3 + ble _080527A4 + ldrh r1, [r4] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x3 + bne _08052776 +_080527A4: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080527B0: .4byte gUnknown_203B418 +_080527B4: .4byte 0x0001bdd4 +_080527B8: .4byte 0x0001c064 +_080527BC: .4byte gUnknown_20255F0 +_080527C0: .4byte 0x0000030f + thumb_func_end sub_8052740 + + thumb_func_start sub_80527C4 +sub_80527C4: + push {r4-r7,lr} + sub sp, 0x28 + adds r4, r0, 0 + adds r7, r1, 0 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r0, _08052858 + ldrb r0, [r0] + cmp r0, 0 + beq _080527DE + movs r0, 0xA + bl sub_8052740 +_080527DE: + movs r0, 0x2 + movs r1, 0 + bl sub_803EAF0 + movs r0, 0 + bl sub_8052210 + movs r5, 0 + str r5, [sp, 0x14] + str r5, [sp, 0x18] + ldr r0, _0805285C + ldr r1, [r0] + ldr r2, _08052860 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _08052844 + adds r2, 0x6 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _08052844 + cmp r4, 0 + beq _08052844 + movs r1, 0 + ldrsh r0, [r4, r1] + ldrb r1, [r4, 0x2] + bl sub_808DE10 + lsls r0, 24 + cmp r0, 0 + beq _08052844 + movs r2, 0 + ldrsh r0, [r4, r2] + bl sub_808DDD0 + str r0, [sp, 0x14] + ldr r0, [r0, 0x4] + str r0, [sp, 0x18] + add r1, sp, 0x14 + movs r2, 0 + movs r0, 0x2 + strh r0, [r1, 0x8] + movs r0, 0x9 + strh r0, [r1, 0xA] + ldrb r0, [r4, 0x2] + strb r0, [r1, 0xC] + adds r0, r1, 0 + strb r2, [r0, 0xD] + strb r2, [r0, 0xE] + adds r5, r0, 0 +_08052844: + movs r1, 0 + str r1, [sp] + movs r0, 0x3 + str r0, [sp, 0x4] + str r1, [sp, 0x8] + str r5, [sp, 0xC] + cmp r6, 0 + beq _08052868 + ldr r0, _08052864 + b _0805286C + .align 2, 0 +_08052858: .4byte gUnknown_203B40C +_0805285C: .4byte gUnknown_203B418 +_08052860: .4byte 0x0001820a +_08052864: .4byte 0x00000701 +_08052868: + movs r0, 0x80 + lsls r0, 3 +_0805286C: + str r0, [sp, 0x10] + adds r0, r7, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_8014248 + ldr r0, _080528D0 + ldr r0, [r0] + ldr r1, _080528D4 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + add r4, sp, 0x24 +_08052888: + bl sub_80144C4 + movs r0, 0x9 + bl sub_803E46C + adds r0, r4, 0 + bl sub_80144A4 + adds r1, r0, 0 + cmp r1, 0 + bne _08052888 + ldr r0, _080528D0 + ldr r0, [r0] + ldr r2, _080528D4 + adds r0, r2 + strb r1, [r0] + ldr r0, [sp, 0x14] + cmp r0, 0 + beq _080528B2 + bl sub_800AA14 +_080528B2: + cmp r6, 0 + beq _080528E4 + bl sub_805E804 + bl sub_8040238 + ldr r0, _080528D8 + ldrb r0, [r0] + cmp r0, 0 + beq _080528DC + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + b _080528E4 + .align 2, 0 +_080528D0: .4byte gUnknown_203B418 +_080528D4: .4byte 0x0001c05f +_080528D8: .4byte gUnknown_202EE01 +_080528DC: + movs r0, 0x1 + movs r1, 0 + bl sub_803EAF0 +_080528E4: + movs r0, 0x8 + movs r1, 0x9 + bl sub_803E708 + add sp, 0x28 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80527C4 + + thumb_func_start sub_80528F4 +sub_80528F4: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522E8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80528F4 + + thumb_func_start sub_8052910 +sub_8052910: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + adds r6, r0, 0 + bl sub_8085480 + adds r4, r0, 0 + bl sub_808548C + adds r5, r0, 0 + movs r0, 0 + mov r9, r0 + cmp r4, 0 + beq _0805295C + ldr r4, [r4, 0x70] + ldr r2, _08052950 + ldrb r1, [r4, 0xA] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08052954 + adds r0, r1 + ldr r1, [r2] + adds r1, r0 + ldr r0, _08052958 + bl sub_808DA0C + movs r2, 0x4 + ldrsh r7, [r4, r2] + b _08052966 + .align 2, 0 +_08052950: .4byte gUnknown_203B45C +_08052954: .4byte 0x00008df8 +_08052958: .4byte gUnknown_202DF98 +_0805295C: + movs r7, 0 + ldr r0, _08052988 + ldr r1, _0805298C + bl strcpy +_08052966: + cmp r5, 0 + beq _0805299C + ldr r4, [r5, 0x70] + ldr r2, _08052990 + ldrb r1, [r4, 0xA] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08052994 + adds r0, r1 + ldr r1, [r2] + adds r1, r0 + ldr r0, _08052998 + bl sub_808DA0C + movs r2, 0x4 + ldrsh r4, [r4, r2] + b _080529A6 + .align 2, 0 +_08052988: .4byte gUnknown_202DF98 +_0805298C: .4byte gUnknown_80F7AF8 +_08052990: .4byte gUnknown_203B45C +_08052994: .4byte 0x00008df8 +_08052998: .4byte gUnknown_202DFE8 +_0805299C: + movs r4, 0 + ldr r0, _080529C0 + ldr r1, _080529C4 + bl strcpy +_080529A6: + movs r0, 0x4 + ldrsh r1, [r6, r0] + movs r0, 0xD5 + lsls r0, 1 + cmp r1, r0 + beq _080529F0 + cmp r1, r0 + bgt _080529C8 + subs r0, 0x1 + cmp r1, r0 + beq _080529D4 + b _08052A1C + .align 2, 0 +_080529C0: .4byte gUnknown_202DFE8 +_080529C4: .4byte gUnknown_80F7AF8 +_080529C8: + ldr r0, _080529D0 + cmp r1, r0 + beq _08052A08 + b _08052A1C + .align 2, 0 +_080529D0: .4byte 0x000001ab +_080529D4: + adds r4, r7, 0 + ldr r0, _080529E4 + ldr r1, _080529E8 + ldr r2, _080529EC + bl sub_800D158 + b _08052A28 + .align 2, 0 +_080529E4: .4byte gUnknown_202E5D8 +_080529E8: .4byte gUnknown_80F7AFC +_080529EC: .4byte gUnknown_202DF98 +_080529F0: + ldr r0, _080529FC + ldr r1, _08052A00 + ldr r2, _08052A04 + bl sub_800D158 + b _08052A28 + .align 2, 0 +_080529FC: .4byte gUnknown_202E5D8 +_08052A00: .4byte gUnknown_80F7AFC +_08052A04: .4byte gUnknown_202DFE8 +_08052A08: + movs r4, 0 + ldr r0, _08052A14 + ldr r1, _08052A18 + bl strcpy + b _08052A28 + .align 2, 0 +_08052A14: .4byte gUnknown_202E5D8 +_08052A18: .4byte gUnknown_80F7B04 +_08052A1C: + movs r1, 0x4 + ldrsh r4, [r6, r1] + ldr r0, _08052A48 + adds r1, r4, 0 + bl sub_808D8E0 +_08052A28: + ldrh r0, [r6] + subs r0, 0x2 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _08052A3C + ldr r0, _08052A48 + ldr r1, _08052A4C + bl strcpy +_08052A3C: + movs r2, 0x6 + ldrsh r0, [r6, r2] + ldr r2, _08052A50 + add r7, sp, 0x10 + b _08052A8E + .align 2, 0 +_08052A48: .4byte gUnknown_202E5D8 +_08052A4C: .4byte gUnknown_80F7B04 +_08052A50: .4byte gUnknown_203B418 +_08052A54: + movs r0, 0x6 + ldrsh r1, [r6, r0] + cmp r1, 0x1 + bne _08052A78 + cmp r4, 0x1 + beq _08052A9E + cmp r4, 0x9B + beq _08052A9E + ldr r0, _08052B08 + cmp r4, r0 + beq _08052A9E + cmp r4, 0x19 + beq _08052A9E + cmp r4, 0x4 + beq _08052A9E + subs r0, 0x6 + cmp r4, r0 + beq _08052A9E +_08052A78: + movs r0, 0x8C + lsls r0, 1 + cmp r1, r0 + bne _08052A88 + cmp r4, r1 + beq _08052A9E + cmp r4, 0x98 + beq _08052A9E +_08052A88: + adds r6, 0xC + movs r1, 0x6 + ldrsh r0, [r6, r1] +_08052A8E: + cmp r0, 0 + beq _08052A9E + cmp r0, 0x7 + bne _08052A54 + cmp r4, 0x7 + beq _08052A9E + cmp r4, 0x9E + bne _08052A54 +_08052A9E: + ldr r1, [r2] + ldr r2, _08052B0C + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _08052B14 + adds r2, 0x6 + adds r0, r1, r2 + ldrb r0, [r0] + mov r8, r0 + cmp r0, 0 + bne _08052B14 + ldrh r0, [r6] + cmp r0, 0x4 + beq _08052B14 + ldrb r0, [r6, 0x2] + cmp r0, 0x80 + beq _08052B14 + cmp r4, 0 + beq _08052B14 + ldrb r0, [r6, 0x3] + bl sub_808CDB0 + adds r5, r0, 0 + mov r9, sp + adds r0, r4, 0 + bl sub_808DDD0 + str r0, [sp] + cmp r0, 0 + beq _08052B10 + ldr r0, [r0, 0x4] + str r0, [sp, 0x4] + mov r1, r8 + mov r0, r9 + strb r1, [r0, 0xE] + ldrb r0, [r6, 0x2] + mov r2, r9 + strb r0, [r2, 0xC] + ldrb r0, [r5, 0x4] + strb r0, [r2, 0xD] + ldrh r0, [r5] + strh r0, [r2, 0x8] + ldrh r0, [r5, 0x2] + strh r0, [r2, 0xA] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bgt _08052B14 + movs r0, 0x2 + strh r0, [r2, 0xA] + b _08052B14 + .align 2, 0 +_08052B08: .4byte 0x0000011b +_08052B0C: .4byte 0x0001820a +_08052B10: + movs r0, 0 + mov r9, r0 +_08052B14: + movs r0, 0xA + bl sub_8052740 + movs r0, 0x2 + movs r1, 0 + bl sub_803EAF0 + movs r0, 0 + bl sub_8052210 + ldr r0, [r6, 0x8] + ldr r2, _08052B88 + ldrh r1, [r6] + lsls r1, 1 + adds r1, r2 + ldrh r3, [r1] + movs r1, 0 + mov r2, r9 + bl sub_80141B4 +_08052B3C: + bl sub_80144C4 + movs r0, 0x9 + bl sub_803E46C + adds r0, r7, 0 + bl sub_80144A4 + cmp r0, 0 + bne _08052B3C + mov r1, r9 + cmp r1, 0 + beq _08052B5C + ldr r0, [r1] + bl sub_800AA14 +_08052B5C: + ldrh r0, [r6] + cmp r0, 0x1 + beq _08052B72 + cmp r0, 0x3 + beq _08052B72 + bl sub_8040238 + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 +_08052B72: + movs r0, 0x8 + movs r1, 0x9 + bl sub_803E708 + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08052B88: .4byte gUnknown_80F7AEA + thumb_func_end sub_8052910 + + thumb_func_start sub_8052B8C +sub_8052B8C: + push {r4-r7,lr} + sub sp, 0x14 + adds r4, r0, 0 + adds r6, r1, 0 + adds r7, r2, 0 + movs r0, 0xA + bl sub_8052740 + movs r0, 0x2 + movs r1, 0 + bl sub_803EAF0 + movs r0, 0 + bl sub_8052210 + movs r5, 0 + str r5, [sp] + str r5, [sp, 0x4] + ldr r0, _08052C14 + ldr r1, [r0] + ldr r2, _08052C18 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _08052C02 + adds r2, 0x6 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _08052C02 + cmp r4, 0 + beq _08052C02 + movs r1, 0 + ldrsh r0, [r4, r1] + ldrb r1, [r4, 0x2] + bl sub_808DE10 + lsls r0, 24 + cmp r0, 0 + beq _08052C02 + movs r2, 0 + ldrsh r0, [r4, r2] + bl sub_808DDD0 + str r0, [sp] + ldr r0, [r0, 0x4] + str r0, [sp, 0x4] + mov r1, sp + movs r2, 0 + movs r0, 0x2 + strh r0, [r1, 0x8] + movs r0, 0x9 + strh r0, [r1, 0xA] + ldrb r0, [r4, 0x2] + strb r0, [r1, 0xC] + mov r0, sp + strb r2, [r0, 0xD] + strb r2, [r0, 0xE] + mov r5, sp +_08052C02: + cmp r7, 0x1 + bne _08052C1C + movs r2, 0xC0 + lsls r2, 2 + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80141E0 + b _08052C28 + .align 2, 0 +_08052C14: .4byte gUnknown_203B418 +_08052C18: .4byte 0x0001820a +_08052C1C: + movs r2, 0xC0 + lsls r2, 2 + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_8014214 +_08052C28: + add r4, sp, 0x10 +_08052C2A: + bl sub_80144C4 + movs r0, 0x9 + bl sub_803E46C + adds r0, r4, 0 + bl sub_80144A4 + cmp r0, 0 + bne _08052C2A + ldr r0, [sp] + cmp r0, 0 + beq _08052C48 + bl sub_800AA14 +_08052C48: + bl sub_8040238 + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + ldr r0, [sp, 0x10] + cmp r0, 0x1 + beq _08052C5E + movs r0, 0 + b _08052C60 +_08052C5E: + movs r0, 0x1 +_08052C60: + add sp, 0x14 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8052B8C + + thumb_func_start sub_8052C68 +sub_8052C68: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x28 + adds r4, r0, 0 + adds r7, r1, 0 + mov r8, r2 + lsls r3, 16 + lsrs r6, r3, 16 + movs r0, 0xA + bl sub_8052740 + movs r0, 0x2 + movs r1, 0 + bl sub_803EAF0 + movs r0, 0 + bl sub_8052210 + movs r5, 0 + str r5, [sp, 0x14] + str r5, [sp, 0x18] + ldr r0, _08052D3C + ldr r1, [r0] + ldr r2, _08052D40 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _08052CE6 + adds r2, 0x6 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _08052CE6 + cmp r4, 0 + beq _08052CE6 + movs r1, 0 + ldrsh r0, [r4, r1] + ldrb r1, [r4, 0x2] + bl sub_808DE10 + lsls r0, 24 + cmp r0, 0 + beq _08052CE6 + movs r2, 0 + ldrsh r0, [r4, r2] + bl sub_808DDD0 + str r0, [sp, 0x14] + ldr r0, [r0, 0x4] + str r0, [sp, 0x18] + add r1, sp, 0x14 + movs r2, 0 + movs r0, 0x2 + strh r0, [r1, 0x8] + movs r0, 0x9 + strh r0, [r1, 0xA] + ldrb r0, [r4, 0x2] + strb r0, [r1, 0xC] + adds r0, r1, 0 + strb r2, [r0, 0xD] + strb r2, [r0, 0xE] + adds r5, r0, 0 +_08052CE6: + movs r2, 0x1 + negs r2, r2 + movs r1, 0 + str r1, [sp] + movs r0, 0x3 + str r0, [sp, 0x4] + str r1, [sp, 0x8] + str r5, [sp, 0xC] + str r6, [sp, 0x10] + adds r0, r7, 0 + mov r3, r8 + bl sub_8014248 + add r4, sp, 0x24 +_08052D02: + bl sub_80144C4 + movs r0, 0x9 + bl sub_803E46C + adds r0, r4, 0 + bl sub_80144A4 + cmp r0, 0 + bne _08052D02 + ldr r0, [sp, 0x14] + cmp r0, 0 + beq _08052D20 + bl sub_800AA14 +_08052D20: + bl sub_8040238 + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + ldr r0, [sp, 0x24] + add sp, 0x28 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08052D3C: .4byte gUnknown_203B418 +_08052D40: .4byte 0x0001820a + thumb_func_end sub_8052C68 + + thumb_func_start sub_8052D44 +sub_8052D44: + push {r4-r7,lr} + adds r7, r0, 0 + adds r4, r1, 0 + adds r6, r2, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + beq _08052D70 + ldr r0, _08052D6C + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, [r4, 0x70] + ldrh r0, [r0, 0x4] + strh r0, [r7] + b _08052D7A + .align 2, 0 +_08052D6C: .4byte gUnknown_202DF98 +_08052D70: + ldr r0, _08052D9C + ldr r1, _08052DA0 + bl strcpy + strh r5, [r7] +_08052D7A: + adds r0, r6, 0 + bl sub_80450E0 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _08052DA8 + ldr r0, _08052DA4 + adds r1, r6, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, [r6, 0x70] + ldrh r0, [r0, 0x4] + strh r0, [r7, 0x2] + b _08052DB2 + .align 2, 0 +_08052D9C: .4byte gUnknown_202DF98 +_08052DA0: .4byte gUnknown_80F7AF8 +_08052DA4: .4byte gUnknown_202DFE8 +_08052DA8: + ldr r0, _08052DB8 + ldr r1, _08052DBC + bl strcpy + strh r4, [r7, 0x2] +_08052DB2: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08052DB8: .4byte gUnknown_202DFE8 +_08052DBC: .4byte gUnknown_80F7AF8 + thumb_func_end sub_8052D44 + + thumb_func_start sub_8052DC0 +sub_8052DC0: + push {lr} + bl sub_8045888 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_8052DC0 + + thumb_func_start sub_8052DD0 +sub_8052DD0: + push {r4-r6,lr} + bl sub_8083600 + adds r5, r0, 0 + ldr r6, _08052E68 + ldr r4, [r6] + adds r0, r4, 0 + bl sub_80981A0 + lsls r0, 24 + cmp r0, 0 + beq _08052E46 + ldr r6, _08052E6C + ldr r4, [r6] + adds r0, r4, 0 + bl sub_80981A0 + lsls r0, 24 + cmp r0, 0 + beq _08052E46 + ldr r6, _08052E70 + ldr r4, [r6] + adds r0, r4, 0 + bl sub_80981A0 + lsls r0, 24 + cmp r0, 0 + beq _08052E46 + ldr r0, _08052E74 + ldr r0, [r0] + ldr r1, _08052E78 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08052EB6 + ldr r6, _08052E7C + ldr r4, [r6] + adds r0, r4, 0 + bl sub_80981A0 + lsls r0, 24 + cmp r0, 0 + beq _08052E46 + ldr r6, _08052E80 + ldr r4, [r6] + adds r0, r4, 0 + bl sub_80981A0 + lsls r0, 24 + cmp r0, 0 + beq _08052E46 + ldr r6, _08052E84 + ldr r4, [r6] + adds r0, r4, 0 + bl sub_80981A0 + lsls r0, 24 + cmp r0, 0 + bne _08052E88 +_08052E46: + adds r0, r4, 0 + bl sub_8098170 + bl sub_8083E28 + ldr r4, [r6, 0x4] + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_80527C4 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522E8 + b _08052EB6 + .align 2, 0 +_08052E68: .4byte gUnknown_80FF020 +_08052E6C: .4byte gUnknown_80FF080 +_08052E70: .4byte gUnknown_80FF0D8 +_08052E74: .4byte gUnknown_203B418 +_08052E78: .4byte 0x00000644 +_08052E7C: .4byte gUnknown_80FF13C +_08052E80: .4byte gUnknown_80FF1B4 +_08052E84: .4byte gUnknown_80FF22C +_08052E88: + ldr r6, _08052EBC + ldr r4, [r6] + adds r0, r4, 0 + bl sub_80981A0 + lsls r0, 24 + cmp r0, 0 + bne _08052EB6 + adds r0, r4, 0 + bl sub_8098170 + bl sub_8083E28 + ldr r4, [r6, 0x4] + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_80527C4 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522E8 +_08052EB6: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08052EBC: .4byte gUnknown_80FF290 + thumb_func_end sub_8052DD0 + + thumb_func_start sub_8052EC0 +sub_8052EC0: + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r5, r4, 0 + adds r0, r4, 0 + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _08052EE0 + ldr r5, _08052EDC + b _08052F22 + .align 2, 0 +_08052EDC: .4byte gUnknown_80FF310 +_08052EE0: + cmp r4, 0x37 + bne _08052EEC + ldr r5, _08052EE8 + b _08052F22 + .align 2, 0 +_08052EE8: .4byte gUnknown_80FF394 +_08052EEC: + cmp r4, 0x43 + bne _08052EF8 + ldr r5, _08052EF4 + b _08052F22 + .align 2, 0 +_08052EF4: .4byte gUnknown_80FF3E8 +_08052EF8: + cmp r4, 0x48 + bne _08052F04 + ldr r5, _08052F00 + b _08052F22 + .align 2, 0 +_08052F00: .4byte gUnknown_80FF440 +_08052F04: + cmp r4, 0x7 + bne _08052F10 + ldr r5, _08052F0C + b _08052F22 + .align 2, 0 +_08052F0C: .4byte gUnknown_80FF4A0 +_08052F10: + cmp r4, 0x42 + bne _08052F1C + ldr r5, _08052F18 + b _08052F22 + .align 2, 0 +_08052F18: .4byte gUnknown_80FF518 +_08052F1C: + cmp r4, 0x45 + bne _08052F4C + ldr r5, _08052F48 +_08052F22: + ldr r4, [r5] + adds r0, r4, 0 + bl sub_80981A0 + lsls r0, 24 + cmp r0, 0 + bne _08052F74 + adds r0, r4, 0 + bl sub_8098170 + bl sub_8083E28 + ldr r1, [r5, 0x4] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 + b _08052F74 + .align 2, 0 +_08052F48: .4byte gUnknown_80FF57C +_08052F4C: + cmp r5, 0x69 + bne _08052F74 + ldr r5, _08052F7C + ldr r4, [r5] + adds r0, r4, 0 + bl sub_80981A0 + lsls r0, 24 + cmp r0, 0 + bne _08052F74 + adds r0, r4, 0 + bl sub_8098170 + bl sub_8083E28 + ldr r1, [r5, 0x4] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 +_08052F74: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08052F7C: .4byte gUnknown_80FF5E8 + thumb_func_end sub_8052EC0 + + thumb_func_start sub_8052F80 +sub_8052F80: + push {lr} + ldr r0, _08052F9C + ldr r0, [r0] + ldrb r0, [r0, 0xA] + cmp r0, 0 + beq _08052FA4 + ldr r0, _08052FA0 + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 + b _08052FB0 + .align 2, 0 +_08052F9C: .4byte gUnknown_203B418 +_08052FA0: .4byte gUnknown_80FF6F8 +_08052FA4: + ldr r0, _08052FB4 + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 +_08052FB0: + pop {r0} + bx r0 + .align 2, 0 +_08052FB4: .4byte gUnknown_80FF6A4 + thumb_func_end sub_8052F80 + + thumb_func_start sub_8052FB8 +sub_8052FB8: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + adds r3, r0, 0 + movs r0, 0 + mov r8, r0 + ldr r0, _08053030 + movs r2, 0 + adds r0, 0x2 + movs r1, 0x1C +_08052FD2: + strh r2, [r0] + adds r0, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _08052FD2 + movs r0, 0 + str r0, [sp] + movs r1, 0x2 + str r1, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + movs r0, 0x30 + str r0, [sp, 0x10] + adds r0, r3, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_8014248 + movs r1, 0 + mov r9, r1 + ldr r7, _08053034 + ldr r2, _08053038 + mov r10, r2 +_08053002: + mov r3, r8 + cmp r3, 0x3D + bgt _08053040 + movs r4, 0x1 + add r8, r4 + movs r5, 0 + mov r1, r8 + lsrs r0, r1, 31 + adds r6, r1, r0 + ldr r4, _0805303C +_08053016: + adds r0, r5, 0 + adds r0, 0xF0 + adds r1, r4, 0 + asrs r2, r6, 1 + movs r3, 0 + bl SetBGPaletteBufferColorRGB + adds r4, 0x4 + adds r5, 0x1 + cmp r5, 0x7 + ble _08053016 + b _080530CA + .align 2, 0 +_08053030: .4byte gUnknown_202B038 +_08053034: .4byte gUnknown_202F1F0 +_08053038: .4byte 0x0000f3ff +_0805303C: .4byte gUnknown_202D038 +_08053040: + movs r2, 0x1 + add r9, r2 + movs r0, 0x8 + mov r3, r9 + ands r0, r3 + cmp r0, 0 + beq _080530BE + ldrh r0, [r7] + ldr r4, _080530D8 + adds r1, r4, 0 + ands r0, r1 + ldr r2, _080530DC + adds r1, r2, 0 + ands r0, r1 + mov r3, r10 + ands r0, r3 + ldr r4, _080530E0 + adds r1, r4, 0 + ands r0, r1 + ldr r2, _080530E4 + adds r1, r2, 0 + ands r0, r1 + ldr r3, _080530E8 + ands r0, r3 + movs r4, 0x80 + lsls r4, 7 + orrs r0, r4 + strh r0, [r7] + movs r2, 0xFC + lsls r2, 2 + ldrh r0, [r7, 0x4] + movs r3, 0xFC + lsls r3, 8 + adds r1, r3, 0 + ands r0, r1 + orrs r0, r2 + movs r4, 0 + orrs r0, r4 + mov r1, r10 + ands r0, r1 + movs r2, 0xF + movs r3, 0xF0 + lsls r3, 8 + ldr r4, _080530EC + adds r1, r4, 0 + ands r0, r1 + orrs r0, r3 + strh r0, [r7, 0x4] + movs r1, 0xF0 + lsls r1, 3 + ldrh r0, [r7, 0x6] + ands r2, r0 + orrs r2, r1 + strh r2, [r7, 0x6] + movs r0, 0x70 + strh r0, [r7, 0x2] + adds r0, r7, 0 + movs r1, 0x80 + lsls r1, 1 + movs r2, 0 + movs r3, 0 + bl AddSprite +_080530BE: + ldr r0, _080530F0 + ldrh r1, [r0, 0x2] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _080530F4 +_080530CA: + bl sub_80144C4 + movs r0, 0x9 + bl sub_803E46C + b _08053002 + .align 2, 0 +_080530D8: .4byte 0x0000feff +_080530DC: .4byte 0x0000fdff +_080530E0: .4byte 0x0000efff +_080530E4: .4byte 0x0000dfff +_080530E8: .4byte 0x00003fff +_080530EC: .4byte 0x00000fff +_080530F0: .4byte gUnknown_20255F0 +_080530F4: + mov r0, r8 + cmp r0, 0 + blt _08053134 + ldr r1, _08053178 + mov r9, r1 +_080530FE: + movs r5, 0 + mov r7, r8 + subs r7, 0x1 + mov r2, r8 + lsrs r0, r2, 31 + adds r6, r2, r0 + mov r4, r9 +_0805310C: + adds r0, r5, 0 + adds r0, 0xF0 + adds r1, r4, 0 + asrs r2, r6, 1 + movs r3, 0 + bl SetBGPaletteBufferColorRGB + adds r4, 0x4 + adds r5, 0x1 + cmp r5, 0x7 + ble _0805310C + bl sub_80144C4 + movs r0, 0x9 + bl sub_803E46C + mov r8, r7 + mov r3, r8 + cmp r3, 0 + bge _080530FE +_08053134: + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0x9 + bl sub_803E46C + bl sub_8040238 + movs r5, 0 + ldr r4, _08053178 +_0805314C: + adds r0, r5, 0 + adds r0, 0xF0 + adds r1, r4, 0 + bl SetBGPaletteBufferColorArray + adds r4, 0x4 + adds r5, 0x1 + cmp r5, 0x7 + ble _0805314C + movs r0, 0x8 + movs r1, 0x9 + bl sub_803E708 + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08053178: .4byte gUnknown_202D038 + thumb_func_end sub_8052FB8 + + thumb_func_start sub_805317C +sub_805317C: + push {lr} + ldr r0, _08053198 + ldr r1, [r0] + movs r2, 0xCF + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0805319C + subs r2, 0x34 + adds r0, r1, r2 + ldrb r0, [r0] + b _0805319E + .align 2, 0 +_08053198: .4byte gUnknown_203B418 +_0805319C: + movs r0, 0x3F +_0805319E: + bl sub_809009C + pop {r1} + bx r1 + thumb_func_end sub_805317C + + thumb_func_start sub_80531A8 +sub_80531A8: + push {r4-r6,lr} + ldr r2, _080531F0 + ldr r1, [r2] + movs r0, 0 + strh r0, [r1, 0x16] + movs r0, 0x1 + strb r0, [r1, 0xB] + movs r4, 0 + movs r3, 0 + ldr r5, _080531F4 +_080531BC: + ldr r0, [r2] + lsls r1, r4, 6 + adds r0, r1 + adds r0, r5 + strb r3, [r0] + ldr r0, [r2] + adds r0, r1 + ldr r6, _080531F8 + adds r0, r6 + strb r3, [r0] + ldr r0, [r2] + adds r0, r1 + adds r6, 0x1 + adds r0, r6 + strb r3, [r0] + ldr r0, [r2] + adds r0, r1 + ldr r1, _080531FC + adds r0, r1 + strb r3, [r0] + adds r4, 0x1 + cmp r4, 0x13 + ble _080531BC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080531F0: .4byte gUnknown_203B418 +_080531F4: .4byte 0x0001c073 +_080531F8: .4byte 0x0001c070 +_080531FC: .4byte 0x0001c072 + thumb_func_end sub_80531A8 + + thumb_func_start sub_8053200 +sub_8053200: + ldr r0, _0805320C + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0xB] + bx lr + .align 2, 0 +_0805320C: .4byte gUnknown_203B418 + thumb_func_end sub_8053200 + + thumb_func_start sub_8053210 +sub_8053210: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + ldr r0, _08053264 + mov r12, r0 + ldr r3, [r0] + movs r0, 0x16 + ldrsh r4, [r3, r0] + lsls r4, 6 + ldr r5, _08053268 + adds r0, r4, r5 + adds r0, r3, r0 + adds r7, r0, 0x3 + adds r0, 0x3E + mov r8, r0 + adds r3, r4 + adds r3, r5 + movs r0, 0x1 + strb r0, [r3] + mov r4, r12 + ldr r3, [r4] + movs r4, 0x16 + ldrsh r0, [r3, r4] + lsls r0, 6 + adds r3, r0 + ldr r0, _0805326C + adds r3, r0 + strb r1, [r3] + mov r3, r12 + ldr r1, [r3] + movs r4, 0x16 + ldrsh r0, [r1, r4] + lsls r0, 6 + adds r1, r0 + ldr r0, _08053270 + adds r1, r0 + strb r2, [r1] + ldrb r2, [r6] + adds r0, r2, 0 + mov r1, r12 + b _08053282 + .align 2, 0 +_08053264: .4byte gUnknown_203B418 +_08053268: .4byte 0x0001c070 +_0805326C: .4byte 0x0001c071 +_08053270: .4byte 0x0001c072 +_08053274: + cmp r7, r8 + bcs _0805327C + strb r2, [r7] + adds r7, 0x1 +_0805327C: + adds r6, 0x1 + ldrb r2, [r6] + adds r0, r2, 0 +_08053282: + cmp r0, 0 + beq _0805328A + cmp r0, 0xD + bne _08053274 +_0805328A: + movs r0, 0 + strb r0, [r7] + ldr r2, [r1] + ldrh r0, [r2, 0x16] + adds r0, 0x1 + strh r0, [r2, 0x16] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x13 + ble _080532A2 + movs r0, 0 + strh r0, [r2, 0x16] +_080532A2: + ldr r1, [r1] + movs r0, 0x1 + strb r0, [r1, 0xB] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8053210 + + thumb_func_start sub_80532B4 +sub_80532B4: + push {r4-r6,lr} + sub sp, 0xC + mov r0, sp + bl sub_801317C + movs r0, 0x9 + movs r1, 0 + bl sub_803EAF0 +_080532C6: + movs r0, 0xD + bl sub_803E46C + movs r0, 0 + bl sub_8008D8C + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _080532C6 + ldr r0, _08053374 + str r1, [r0] + ldr r4, _08053378 + strb r1, [r4] + bl sub_80533A4 + adds r6, r4, 0 +_080532E8: + movs r5, 0 + strb r5, [r6] + mov r0, sp + movs r1, 0 + bl nullsub_34 + movs r0, 0 + ldr r1, _0805337C + bl sub_8014140 + adds r4, r0, 0 + bl sub_8053430 + lsls r0, 24 + lsrs r0, 24 + negs r1, r0 + orrs r1, r0 + lsrs r5, r1, 31 + adds r0, r4, 0 + bl sub_8053540 + lsls r0, 24 + cmp r0, 0 + beq _0805331A + movs r5, 0x1 +_0805331A: + cmp r5, 0 + bne _08053324 + movs r0, 0xD + bl sub_803E46C +_08053324: + ldrb r1, [r6] + movs r5, 0x1 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _0805333A + movs r0, 0x1 + movs r1, 0x8 + negs r1, r1 + bl sub_805363C +_0805333A: + ldrb r1, [r6] + movs r4, 0x2 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _0805334E + movs r0, 0 + movs r1, 0x72 + bl sub_805363C +_0805334E: + bl sub_80048C8 + lsls r0, 24 + cmp r0, 0 + bne _080532E8 + ldr r0, _08053380 + ldrh r1, [r0, 0x2] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + bne _0805336C + mov r0, sp + ldrb r0, [r0, 0x2] + cmp r0, 0 + beq _08053384 +_0805336C: + bl sub_8083D30 + b _08053390 + .align 2, 0 +_08053374: .4byte gUnknown_202F1F8 +_08053378: .4byte gUnknown_202F1FC +_0805337C: .4byte gUnknown_8106990 +_08053380: .4byte gUnknown_20255F0 +_08053384: + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _080532E8 + bl sub_8083D08 +_08053390: + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + movs r0, 0x1 + add sp, 0xC + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80532B4 + + thumb_func_start sub_80533A4 +sub_80533A4: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + ldr r5, _08053428 + ldr r0, [r5] + movs r1, 0x16 + ldrsh r4, [r0, r1] + movs r6, 0x10 + subs r4, 0x8 + cmp r4, 0 + bge _080533BE + adds r4, 0x14 +_080533BE: + movs r0, 0 + bl sub_80073B8 + mov r8, r5 + movs r7, 0x7 +_080533C8: + lsls r0, r4, 6 + ldr r2, _0805342C + adds r0, r2 + mov r2, r8 + ldr r1, [r2] + adds r5, r1, r0 + ldrb r0, [r5] + cmp r0, 0 + beq _08053402 + ldrb r0, [r5, 0x1] + cmp r0, 0 + beq _080533F0 + movs r0, 0x7 + str r0, [sp] + movs r0, 0 + movs r1, 0 + adds r2, r6, 0 + movs r3, 0xE0 + bl sub_80078A4 +_080533F0: + adds r1, r6, 0x3 + adds r2, r5, 0x3 + movs r0, 0xD + str r0, [sp] + movs r0, 0x8 + movs r3, 0 + bl xxx_call_draw_string + adds r6, 0xE +_08053402: + adds r4, 0x1 + cmp r4, 0x13 + ble _0805340A + movs r4, 0 +_0805340A: + subs r7, 0x1 + cmp r7, 0 + bge _080533C8 + movs r0, 0 + bl sub_80073E0 + movs r0, 0 + bl sub_8007334 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08053428: .4byte gUnknown_203B418 +_0805342C: .4byte 0x0001c070 + thumb_func_end sub_80533A4 + + thumb_func_start sub_8053430 +sub_8053430: + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + ldr r3, _08053454 + ldr r0, [r3] + movs r2, 0x16 + ldrsh r1, [r0, r2] + ldr r2, _08053458 + ldr r0, [r2] + adds r1, r0 + movs r6, 0x2 + subs r1, 0x9 + cmp r1, 0 + bge _0805345E +_0805344C: + adds r1, 0x14 + cmp r1, 0 + blt _0805344C + b _0805345E + .align 2, 0 +_08053454: .4byte gUnknown_203B418 +_08053458: .4byte gUnknown_202F1F8 +_0805345C: + subs r1, 0x14 +_0805345E: + cmp r1, 0x13 + bgt _0805345C + ldr r0, [r3] + lsls r1, 6 + adds r0, r1 + ldr r3, _0805349C + adds r0, r3 + ldrb r0, [r0] + adds r4, r1, 0 + cmp r0, 0 + beq _08053498 + ldr r1, [r2] + movs r0, 0xC + negs r0, r0 + cmp r1, r0 + ble _08053498 + ldr r2, _080534A0 + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r0, _080534A4 + ldrh r1, [r0, 0x4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _080534A8 + cmp r5, 0x1 + beq _080534A8 +_08053498: + movs r0, 0 + b _08053528 + .align 2, 0 +_0805349C: .4byte 0x0001c070 +_080534A0: .4byte gUnknown_202F1FC +_080534A4: .4byte gUnknown_20255F0 +_080534A8: + movs r0, 0 + bl sub_8083CE0 + movs r0, 0 + bl sub_80073B8 + ldr r0, _08053530 + ldr r2, _08053534 + adds r1, r4, r2 + ldr r0, [r0] + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0 + beq _080534FA + movs r0, 0x10 + str r0, [sp] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0xD0 + bl sub_80087EC + ldrb r0, [r4, 0x1] + cmp r0, 0 + beq _080534EA + movs r0, 0x7 + str r0, [sp] + movs r0, 0 + movs r1, 0 + adds r2, r6, 0 + movs r3, 0xE0 + bl sub_80078A4 +_080534EA: + adds r1, r6, 0x3 + adds r2, r4, 0x3 + movs r0, 0xD + str r0, [sp] + movs r0, 0x8 + movs r3, 0 + bl xxx_call_draw_string +_080534FA: + movs r0, 0 + bl sub_80073E0 + movs r0, 0xD + bl sub_803E46C + ldr r5, _08053538 + movs r4, 0x6 +_0805350A: + ldr r1, [r5] + movs r0, 0 + bl _call_via_r1 + movs r0, 0xD + bl sub_803E46C + subs r4, 0x1 + cmp r4, 0 + bge _0805350A + ldr r1, _0805353C + ldr r0, [r1] + subs r0, 0x1 + str r0, [r1] + movs r0, 0x1 +_08053528: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08053530: .4byte gUnknown_203B418 +_08053534: .4byte 0x0001c070 +_08053538: .4byte gUnknown_203B084 +_0805353C: .4byte gUnknown_202F1F8 + thumb_func_end sub_8053430 + + thumb_func_start sub_8053540 +sub_8053540: + push {r4,r5,lr} + sub sp, 0x4 + adds r3, r0, 0 + ldr r0, _08053564 + ldr r0, [r0] + movs r1, 0x16 + ldrsh r2, [r0, r1] + ldr r1, _08053568 + ldr r0, [r1] + adds r4, r2, r0 + movs r5, 0x80 + cmp r4, 0 + bge _0805356E +_0805355A: + adds r4, 0x14 + cmp r4, 0 + blt _0805355A + b _0805356E + .align 2, 0 +_08053564: .4byte gUnknown_203B418 +_08053568: .4byte gUnknown_202F1F8 +_0805356C: + subs r4, 0x14 +_0805356E: + cmp r4, 0x13 + bgt _0805356C + ldr r0, [r1] + cmp r0, 0 + bge _08053592 + ldr r2, _08053598 + ldrb r0, [r2] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2] + ldr r0, _0805359C + ldrh r1, [r0, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _080535A0 + cmp r3, 0x2 + beq _080535A0 +_08053592: + movs r0, 0 + b _08053622 + .align 2, 0 +_08053598: .4byte gUnknown_202F1FC +_0805359C: .4byte gUnknown_20255F0 +_080535A0: + movs r0, 0 + bl sub_8083CE0 + movs r0, 0 + bl sub_80073B8 + ldr r1, _0805362C + lsls r0, r4, 6 + ldr r2, _08053630 + adds r0, r2 + ldr r1, [r1] + adds r4, r1, r0 + ldrb r0, [r4] + cmp r0, 0 + beq _080535F4 + movs r0, 0x10 + str r0, [sp] + movs r0, 0 + movs r1, 0 + adds r2, r5, 0 + movs r3, 0x68 + bl sub_80087EC + ldrb r0, [r4, 0x1] + cmp r0, 0 + beq _080535E4 + movs r0, 0x7 + str r0, [sp] + movs r0, 0 + movs r1, 0 + adds r2, r5, 0 + movs r3, 0xE0 + bl sub_80078A4 +_080535E4: + adds r1, r5, 0x3 + adds r2, r4, 0x3 + movs r0, 0xD + str r0, [sp] + movs r0, 0x8 + movs r3, 0 + bl xxx_call_draw_string +_080535F4: + movs r0, 0 + bl sub_80073E0 + movs r0, 0xD + bl sub_803E46C + ldr r5, _08053634 + movs r4, 0x6 +_08053604: + ldr r1, [r5] + movs r0, 0 + bl _call_via_r1 + movs r0, 0xD + bl sub_803E46C + subs r4, 0x1 + cmp r4, 0 + bge _08053604 + ldr r1, _08053638 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + movs r0, 0x1 +_08053622: + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0805362C: .4byte gUnknown_203B418 +_08053630: .4byte 0x0001c070 +_08053634: .4byte gUnknown_203B080 +_08053638: .4byte gUnknown_202F1F8 + thumb_func_end sub_8053540 + + thumb_func_start sub_805363C +sub_805363C: + push {r4-r7,lr} + mov r12, r1 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r7, _080536D0 + ldr r0, _080536D4 + ldr r0, [r0] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + bne _080536C8 + ldr r0, _080536D8 + ldrh r1, [r0] + ldr r3, _080536DC + ands r3, r1 + ldr r1, _080536E0 + ands r3, r1 + ldr r1, _080536E4 + ands r3, r1 + ldr r1, _080536E8 + ands r3, r1 + ldr r1, _080536EC + ands r3, r1 + negs r1, r2 + orrs r1, r2 + asrs r1, 31 + movs r2, 0x80 + lsls r2, 6 + ands r2, r1 + ldrh r1, [r0, 0x2] + ldr r4, _080536F0 + ands r4, r1 + orrs r4, r2 + movs r5, 0xF + ldr r2, _080536F4 + movs r6, 0x2 + ldrsh r1, [r7, r6] + lsls r1, 3 + add r1, r12 + ands r1, r2 + lsls r1, 4 + ldrh r2, [r0, 0x6] + ands r5, r2 + orrs r5, r1 + strh r5, [r0, 0x6] + movs r2, 0 + ldrsh r1, [r7, r2] + lsls r1, 3 + adds r1, 0x5C + ldr r2, _080536F8 + ands r1, r2 + movs r2, 0xFE + lsls r2, 8 + ands r4, r2 + orrs r4, r1 + movs r2, 0x80 + lsls r2, 7 + ldr r1, _080536FC + ands r3, r1 + orrs r3, r2 + strh r3, [r0] + ands r4, r1 + strh r4, [r0, 0x2] + ldr r1, _08053700 + strh r1, [r0, 0x4] + movs r1, 0x7F + movs r2, 0 + movs r3, 0 + bl AddSprite +_080536C8: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080536D0: .4byte gUnknown_2027370 +_080536D4: .4byte gUnknown_202EDCC +_080536D8: .4byte gUnknown_202F200 +_080536DC: .4byte 0x0000feff +_080536E0: .4byte 0x0000fdff +_080536E4: .4byte 0x0000f3ff +_080536E8: .4byte 0x0000efff +_080536EC: .4byte 0x0000dfff +_080536F0: .4byte 0x0000c1ff +_080536F4: .4byte 0x00000fff +_080536F8: .4byte 0x000001ff +_080536FC: .4byte 0x00003fff +_08053700: .4byte 0x0000f3f0 + thumb_func_end sub_805363C + + thumb_func_start sub_8053704 +sub_8053704: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x48 + str r0, [sp, 0x10] + adds r7, r1, 0 + mov r8, r2 + mov r9, r3 + movs r0, 0 + str r0, [sp, 0x14] + ldrh r1, [r2, 0x2] + str r1, [sp, 0x18] + bl _08055570 +_08053724: + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08053734 + bl _0805556A +_08053734: + str r7, [sp, 0x1C] + ldr r2, [r5, 0x70] + str r2, [sp, 0x24] + movs r3, 0xAD + lsls r3, 1 + adds r0, r2, r3 + add r1, sp, 0x20 + ldrb r1, [r1] + strb r1, [r0] + ldr r0, [sp, 0x18] + bl sub_8092CD8 + lsls r0, 24 + cmp r0, 0 + beq _080537B4 + ldr r6, _080537A4 + ldr r0, [r6] + ldr r2, _080537A8 + adds r0, r2 + ldr r4, [r0] + cmp r4, 0 + beq _080537B4 + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0x1 + beq _0805376C + b _08053A1C +_0805376C: + cmp r4, r7 + bne _08053772 + b _08053A1C +_08053772: + ldr r1, [r4, 0x70] + adds r1, 0x98 + ldr r0, [r6] + ldr r3, _080537AC + adds r0, r3 + ldr r1, [r1] + ldr r0, [r0] + cmp r1, r0 + beq _08053786 + b _08053A1C +_08053786: + ldr r0, [sp, 0x24] + adds r0, 0xFF + ldrb r0, [r0] + cmp r0, 0 + beq _08053792 + b _08053A1C +_08053792: + ldr r0, _080537B0 + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 + adds r5, r4, 0 + b _08053A1C + .align 2, 0 +_080537A4: .4byte gUnknown_203B418 +_080537A8: .4byte 0x00017b30 +_080537AC: .4byte 0x00017b3c +_080537B0: .4byte gUnknown_80FCD28 +_080537B4: + adds r0, r7, 0 + mov r1, r8 + bl sub_8071A1C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bne _08053854 + ldr r2, _08053844 + ldr r0, [r2] + ldr r1, _08053848 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + beq _08053854 + adds r4, r0, 0 + str r2, [sp, 0x44] + bl sub_80450F8 + ldr r2, [sp, 0x44] + cmp r0, 0x1 + beq _080537E2 + b _08053A1C +_080537E2: + ldr r6, [r4, 0x70] + adds r1, r6, 0 + adds r1, 0x98 + ldr r0, [r2] + ldr r2, _0805384C + adds r0, r2 + ldr r1, [r1] + ldr r0, [r0] + cmp r1, r0 + beq _080537F8 + b _08053A1C +_080537F8: + adds r0, r4, 0 + adds r1, r7, 0 + movs r2, 0x1 + movs r3, 0 + bl sub_8071598 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0805380E + b _08053A1C +_0805380E: + ldr r0, [sp, 0x24] + adds r0, 0xFF + ldrb r0, [r0] + cmp r0, 0 + bne _08053822 + adds r0, r6, 0 + adds r0, 0xFF + ldrb r0, [r0] + cmp r0, 0 + beq _08053828 +_08053822: + cmp r5, r4 + beq _08053828 + b _08053A1C +_08053828: + adds r0, r4, 0 + bl sub_8042930 + ldr r0, _08053850 + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 + adds r5, r4, 0 + movs r3, 0x1 + str r3, [sp, 0x2C] + b _08053A1C + .align 2, 0 +_08053844: .4byte gUnknown_203B418 +_08053848: .4byte 0x00017b2c +_0805384C: .4byte 0x00017b38 +_08053850: .4byte gUnknown_80FCD0C +_08053854: + adds r0, r5, 0 + movs r1, 0x2C + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + bne _08053864 + b _08053A1C +_08053864: + adds r0, r5, 0 + movs r1, 0 + bl sub_8070D04 + lsls r0, 24 + cmp r0, 0 + beq _08053874 + b _08053A1C +_08053874: + adds r0, r7, 0 + mov r1, r8 + movs r2, 0 + bl sub_807CD64 + movs r1, 0xF0 + ands r1, r0 + cmp r1, 0 + beq _08053888 + b _08053A1C +_08053888: + ldr r1, [sp, 0x24] + movs r2, 0x9E + lsls r2, 1 + adds r0, r1, r2 + ldr r0, [r0] + bl sub_8094450 + ldr r1, _080538C4 + movs r3, 0 + ldrsh r1, [r1, r3] + cmp r0, r1 + bge _080538A2 + b _08053A1C +_080538A2: + ldr r0, [sp, 0x24] + adds r0, 0xFF + ldrb r0, [r0] + cmp r0, 0 + beq _080538AE + b _08053A1C +_080538AE: + ldr r0, [sp, 0x24] + adds r0, 0x46 + ldrb r4, [r0] + mov r10, r4 + bl sub_80441BC + lsls r0, 24 + cmp r0, 0 + beq _080538CC + ldr r0, _080538C8 + b _080539FA + .align 2, 0 +_080538C4: .4byte gUnknown_80F5006 +_080538C8: .4byte gUnknown_80FDD88 +_080538CC: + movs r0, 0 + str r0, [sp, 0x34] + movs r2, 0x9E + lsls r2, 1 + ldr r1, [sp, 0x24] + adds r2, r1, r2 + str r2, [sp, 0x3C] +_080538DA: + movs r3, 0x1 + add r10, r3 + movs r0, 0x7 + mov r1, r10 + ands r1, r0 + mov r10, r1 + movs r2, 0x4 + ldrsh r0, [r5, r2] + ldr r1, _080539B4 + mov r3, r10 + lsls r2, r3, 2 + adds r2, r1 + movs r3, 0 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r3, 0x6 + ldrsh r1, [r5, r3] + movs r3, 0x2 + ldrsh r2, [r2, r3] + adds r1, r2 + bl sub_804954C + ldr r0, [r0, 0x10] + str r0, [sp, 0x38] + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080539DC + ldr r0, [sp, 0x38] + bl sub_80450F8 + cmp r0, 0x1 + bne _080539DC + adds r0, r5, 0 + bl sub_8045888 + lsls r0, 24 + mov r1, sp + adds r1, 0xC + str r1, [sp, 0x40] + cmp r0, 0 + beq _0805397C + movs r6, 0x17 +_08053932: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_806CE68 + movs r0, 0x2 + movs r1, 0x43 + bl sub_803E708 + adds r4, 0x1 + movs r2, 0x7 + ands r4, r2 + subs r6, 0x1 + cmp r6, 0 + bge _08053932 + cmp r4, r10 + beq _0805396C + movs r6, 0x7 +_08053954: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_806CE68 + movs r0, 0x2 + movs r1, 0x43 + bl sub_803E708 + adds r4, 0x1 + ands r4, r6 + cmp r4, r10 + bne _08053954 +_0805396C: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_806CE68 + movs r0, 0x2 + movs r1, 0x43 + bl sub_803E708 +_0805397C: + ldr r3, [sp, 0x3C] + ldr r4, [r3] + ldr r0, _080539B8 + movs r2, 0 + ldrsh r1, [r0, r2] + add r0, sp, 0x8 + bl sub_80943A0 + ldr r2, [sp, 0x8] + ldr r0, [sp, 0x40] + adds r1, r4, 0 + bl sub_80942C0 + ldr r0, [sp, 0xC] + ldr r3, [sp, 0x3C] + str r0, [r3] + mov r0, r8 + ldrh r1, [r0, 0x2] + ldr r0, _080539BC + cmp r1, r0 + bne _080539C4 + ldr r0, _080539C0 + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 + b _080539D0 + .align 2, 0 +_080539B4: .4byte gUnknown_80F4448 +_080539B8: .4byte gUnknown_80F5006 +_080539BC: .4byte 0x00000163 +_080539C0: .4byte gUnknown_80FDDA8 +_080539C4: + ldr r0, _080539D8 + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 +_080539D0: + str r5, [sp, 0x20] + ldr r5, [sp, 0x38] + b _080539E8 + .align 2, 0 +_080539D8: .4byte gUnknown_80FDD20 +_080539DC: + ldr r1, [sp, 0x34] + adds r1, 0x1 + str r1, [sp, 0x34] + cmp r1, 0x7 + bgt _080539E8 + b _080538DA +_080539E8: + ldr r2, [sp, 0x34] + cmp r2, 0x8 + bne _08053A1C + mov r3, r8 + ldrh r1, [r3, 0x2] + ldr r0, _08053A08 + cmp r1, r0 + bne _08053A10 + ldr r0, _08053A0C +_080539FA: + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 + b _08053A1C + .align 2, 0 +_08053A08: .4byte 0x00000163 +_08053A0C: .4byte gUnknown_80FDDAC +_08053A10: + ldr r0, _08053AD8 + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 +_08053A1C: + ldr r1, _08053ADC + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r1, _08053AE0 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r0, [r5, 0x70] + str r0, [sp, 0x24] + movs r6, 0xAD + lsls r6, 1 + adds r1, r0, r6 + movs r0, 0 + strb r0, [r1] + ldr r1, [sp, 0x24] + ldrb r0, [r1, 0x6] + cmp r0, 0 + beq _08053A4C + movs r2, 0xB6 + lsls r2, 1 + adds r1, r2 + ldr r0, [r7, 0x4] + str r0, [r1] +_08053A4C: + adds r0, r5, 0 + bl sub_806A1E8 + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_807A96C + movs r4, 0 + adds r0, r7, 0 + mov r1, r8 + bl sub_80570AC + lsls r0, 24 + cmp r0, 0 + bne _08053A7E + mov r3, r8 + ldrh r1, [r3, 0x2] + adds r0, r7, 0 + bl sub_805755C + lsls r0, 24 + lsrs r0, 24 + negs r1, r0 + orrs r1, r0 + lsrs r4, r1, 31 +_08053A7E: + ldr r0, [sp, 0x2C] + cmp r0, 0 + beq _08053A86 + b _08053BAE +_08053A86: + ldr r0, [sp, 0x24] + adds r0, 0xC4 + ldrb r0, [r0] + cmp r0, 0x5 + bne _08053AE8 + ldr r0, [sp, 0x18] + bl sub_8092CC0 + lsls r0, 24 + cmp r0, 0 + beq _08053B5C + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_8055988 + lsls r0, 24 + cmp r0, 0 + beq _08053B5C + ldr r0, _08053AE4 + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 + adds r0, r5, 0 + bl sub_8041B48 + adds r0, r5, 0 + adds r1, r7, 0 + bl sub_80559DC + adds r5, r7, 0 + ldr r1, [r7, 0x70] + str r1, [sp, 0x24] + adds r0, r1, r6 + add r2, sp, 0x2C + ldrb r2, [r2] + strb r2, [r0] + movs r3, 0x1 + str r3, [sp, 0x30] + b _08053B5C + .align 2, 0 +_08053AD8: .4byte gUnknown_80FDD48 +_08053ADC: .4byte gUnknown_202F208 +_08053AE0: .4byte gUnknown_202F20C +_08053AE4: .4byte gUnknown_80FC52C +_08053AE8: + cmp r0, 0xB + bne _08053B5C + adds r0, r7, 0 + mov r1, r8 + movs r2, 0 + bl sub_807CD64 + lsls r0, 16 + asrs r1, r0, 16 + ldr r0, _08053C88 + ldr r2, [sp, 0x18] + cmp r2, r0 + beq _08053B5C + adds r0, 0x32 + cmp r2, r0 + beq _08053B5C + cmp r4, 0 + bne _08053B5C + movs r0, 0xF + ands r0, r1 + cmp r0, 0 + beq _08053B20 + cmp r0, 0x4 + beq _08053B20 + cmp r0, 0x5 + beq _08053B20 + cmp r0, 0x2 + bne _08053B5C +_08053B20: + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_8055988 + lsls r0, 24 + cmp r0, 0 + beq _08053B5C + ldr r0, _08053C8C + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 + adds r0, r5, 0 + bl sub_8041BA8 + adds r0, r5, 0 + adds r1, r7, 0 + bl sub_80559DC + adds r5, r7, 0 + ldr r3, [r7, 0x70] + str r3, [sp, 0x24] + movs r0, 0xAD + lsls r0, 1 + adds r1, r3, r0 + movs r0, 0 + strb r0, [r1] + movs r1, 0x1 + str r1, [sp, 0x30] +_08053B5C: + ldr r2, [sp, 0x2C] + cmp r2, 0 + bne _08053BAE + ldr r0, [sp, 0x24] + adds r0, 0xC4 + ldrb r0, [r0] + cmp r0, 0x7 + bne _08053BAE + adds r0, r7, 0 + mov r1, r8 + movs r2, 0 + bl sub_807CD64 + lsls r0, 16 + movs r1, 0xF0 + lsls r1, 12 + ands r1, r0 + asrs r1, 16 + cmp r1, 0 + beq _08053B90 + cmp r1, 0x4 + beq _08053B90 + cmp r1, 0x5 + beq _08053B90 + cmp r1, 0x2 + bne _08053BAE +_08053B90: + cmp r4, 0 + bne _08053BAE + ldr r0, _08053C90 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08053C94 + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 + movs r3, 0 + str r3, [sp, 0x28] +_08053BAE: + adds r0, r5, 0 + mov r1, r8 + bl sub_80571F0 + lsls r0, 24 + cmp r0, 0 + beq _08053BC0 + movs r0, 0 + str r0, [sp, 0x28] +_08053BC0: + ldr r1, [sp, 0x28] + cmp r1, 0 + beq _08053C4A + adds r0, r5, 0 + movs r1, 0x3C + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _08053BFA + mov r0, r8 + bl sub_8092D08 + lsls r0, 24 + cmp r0, 0 + beq _08053BFA + ldr r0, _08053C90 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08053C98 + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 + movs r2, 0 + str r2, [sp, 0x28] +_08053BFA: + ldr r3, [sp, 0x28] + cmp r3, 0 + beq _08053C4A + movs r0, 0 + ldr r1, [sp, 0x30] + cmp r1, 0 + bne _08053C0A + movs r0, 0x1 +_08053C0A: + adds r2, r0, 0 + mov r3, r8 + ldrh r1, [r3, 0x2] + cmp r1, 0x68 + beq _08053C20 + ldr r0, _08053C9C + cmp r1, r0 + beq _08053C20 + subs r0, 0x4 + cmp r1, r0 + bne _08053C22 +_08053C20: + movs r2, 0 +_08053C22: + str r2, [sp] + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + movs r3, 0 + bl sub_8056B34 + lsls r0, 24 + cmp r0, 0 + bne _08053C3A + movs r0, 0 + str r0, [sp, 0x28] +_08053C3A: + ldr r1, [sp, 0x28] + cmp r1, 0 + beq _08053C4A + ldr r2, [sp, 0x2C] + cmp r2, 0 + beq _08053C4A + movs r3, 0 + str r3, [sp, 0x28] +_08053C4A: + adds r0, r5, 0 + bl sub_8045888 + lsls r0, 24 + cmp r0, 0 + beq _08053C6A + movs r0, 0x4 + movs r1, 0x4A + bl sub_803E708 + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + movs r3, 0 + bl sub_8041168 +_08053C6A: + ldr r0, [sp, 0x28] + cmp r0, 0 + beq _08053C72 + b _08053D72 +_08053C72: + ldr r0, [r7, 0x70] + ldrb r0, [r0, 0x7] + cmp r0, 0 + beq _08053CA0 + movs r1, 0xAB + lsls r1, 1 + adds r0, r7, 0 + bl sub_80421C0 + b _08053CA8 + .align 2, 0 +_08053C88: .4byte 0x00000163 +_08053C8C: .4byte gUnknown_80FC558 +_08053C90: .4byte gUnknown_202DFE8 +_08053C94: .4byte gUnknown_80FC574 +_08053C98: .4byte gUnknown_8100524 +_08053C9C: .4byte 0x00000131 +_08053CA0: + ldr r1, _08053CC4 + adds r0, r7, 0 + bl sub_80421C0 +_08053CA8: + ldr r0, _08053CC8 + ldr r1, [r5, 0x70] + movs r2, 0 + bl sub_80708B4 + cmp r7, r5 + bne _08053CD0 + ldr r0, _08053CCC + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r7, 0 + bl sub_80522F4 + b _08053D10 + .align 2, 0 +_08053CC4: .4byte 0x00000157 +_08053CC8: .4byte gUnknown_202DFE8 +_08053CCC: .4byte gUnknown_80F9380 +_08053CD0: + adds r0, r7, 0 + adds r1, r5, 0 + movs r2, 0x1 + movs r3, 0 + bl sub_8071598 + lsls r0, 24 + cmp r0, 0 + bne _08053CEC + ldr r0, _08053CE8 + b _08053CF4 + .align 2, 0 +_08053CE8: .4byte gUnknown_80F9384 +_08053CEC: + ldr r1, [sp, 0x2C] + cmp r1, 0 + beq _08053D04 + ldr r0, _08053D00 +_08053CF4: + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 + b _08053D10 + .align 2, 0 +_08053D00: .4byte gUnknown_80F93A4 +_08053D04: + ldr r0, _08053D48 + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 +_08053D10: + adds r0, r5, 0 + bl sub_8045888 + lsls r0, 24 + cmp r0, 0 + beq _08053D2A + ldr r0, _08053D4C + movs r3, 0x1 + negs r3, r3 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_803ED30 +_08053D2A: + ldr r2, [sp, 0x18] + cmp r2, 0xCC + beq _08053D50 + cmp r2, 0xCE + bne _08053D60 + movs r0, 0x1 + str r0, [sp] + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059FC8 + b _08053D60 + .align 2, 0 +_08053D48: .4byte gUnknown_80F9364 +_08053D4C: .4byte 0x0000270f +_08053D50: + movs r0, 0x1 + str r0, [sp] + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059E54 +_08053D60: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _08053D6E + bl _080555A2 +_08053D6E: + bl _08055568 +_08053D72: + ldr r0, [sp, 0x24] + adds r0, 0xFB + ldrb r3, [r0] + mov r10, r3 + ldr r2, [sp, 0x24] + ldrb r1, [r2, 0x6] + adds r6, r0, 0 + cmp r1, 0 + beq _08053DA8 + mov r3, r8 + ldrh r1, [r3, 0x2] + ldr r0, _08053E88 + cmp r1, r0 + beq _08053D9E + mov r0, r9 + cmp r0, 0 + bne _08053D9E + mov r1, r10 + cmp r1, 0 + bne _08053D9E + movs r0, 0x1 + strb r0, [r6] +_08053D9E: + ldr r2, [sp, 0x68] + cmp r2, 0x1 + bne _08053DA8 + movs r0, 0x2 + strb r0, [r6] +_08053DA8: + ldr r3, [sp, 0x24] + movs r0, 0xB2 + lsls r0, 1 + adds r4, r3, r0 + ldrb r0, [r4] + cmp r0, 0xFF + bne _08053DCE + adds r0, r5, 0 + movs r1, 0xE3 + bl sub_80717A4 + lsls r0, 24 + cmp r0, 0 + beq _08053DCE + adds r0, r5, 0x4 + adds r1, r7, 0x4 + bl sub_80983D8 + strb r0, [r4] +_08053DCE: + ldr r1, [sp, 0x24] + ldr r2, _08053E8C + adds r4, r1, r2 + ldrb r0, [r4] + cmp r0, 0xFF + bne _08053DF2 + adds r0, r5, 0 + movs r1, 0x19 + bl sub_80717A4 + lsls r0, 24 + cmp r0, 0 + beq _08053DF2 + adds r0, r5, 0x4 + adds r1, r7, 0x4 + bl sub_80983D8 + strb r0, [r4] +_08053DF2: + adds r0, r5, 0 + movs r1, 0x39 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _08053E4A + adds r0, r7, 0 + adds r1, r5, 0 + movs r2, 0x1 + movs r3, 0 + bl sub_8071598 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08053E4A + mov r3, r8 + ldrh r1, [r3, 0x2] + ldr r0, _08053E88 + cmp r1, r0 + beq _08053E4A + subs r0, 0x3 + cmp r1, r0 + beq _08053E4A + mov r0, r9 + cmp r0, 0 + bne _08053E4A + ldrb r0, [r3, 0x4] + cmp r0, 0 + beq _08053E4A + ldrb r1, [r3, 0x1] + movs r4, 0x10 + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _08053E42 + adds r0, r7, 0 + bl sub_8042950 +_08053E42: + mov r1, r8 + ldrb r0, [r1, 0x1] + orrs r0, r4 + strb r0, [r1, 0x1] +_08053E4A: + adds r0, r7, 0 + mov r1, r8 + movs r2, 0 + bl sub_807CD64 + movs r1, 0xF + ands r1, r0 + cmp r1, 0 + bne _08053E64 + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_806F450 +_08053E64: + ldr r2, [sp, 0x24] + movs r3, 0xAC + lsls r3, 1 + adds r0, r2, r3 + movs r1, 0x1 + strb r1, [r0] + movs r0, 0xCE + lsls r0, 1 + ldr r1, [sp, 0x18] + cmp r1, r0 + bls _08053E7E + bl _080554C0 +_08053E7E: + lsls r0, r1, 2 + ldr r1, _08053E90 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08053E88: .4byte 0x00000163 +_08053E8C: .4byte 0x00000165 +_08053E90: .4byte _08053E94 + .align 2, 0 +_08053E94: + .4byte _08054520 + .4byte _08054DB8 + .4byte _08054C18 + .4byte _08054888 + .4byte _08054878 + .4byte _08054D80 + .4byte _08054D8E + .4byte _08054FB0 + .4byte _08054FE8 + .4byte _08054508 + .4byte _08054FF6 + .4byte _08055270 + .4byte _08055190 + .4byte _080548C8 + .4byte _080552B6 + .4byte _08054E1A + .4byte _0805527E + .4byte _080551F2 + .4byte _08054508 + .4byte _080549C8 + .4byte _08054EEC + .4byte _08054968 + .4byte _08054EDE + .4byte _0805528C + .4byte _08054B18 + .4byte _08055422 + .4byte _08054E1A + .4byte _08054AB8 + .4byte _08054508 + .4byte _0805529A + .4byte _080547A8 + .4byte _08055200 + .4byte _0805460A + .4byte _08054948 + .4byte _08054878 + .4byte _0805519E + .4byte _080545AE + .4byte _0805514A + .4byte _08054CD4 + .4byte _08054508 + .4byte _08055396 + .4byte _08054EB4 + .4byte _08054A68 + .4byte _08054C28 + .4byte _08054A58 + .4byte _08054E8A + .4byte _080547A8 + .4byte _08054DD4 + .4byte _080553DC + .4byte _0805504A + .4byte _080554A0 + .4byte _08054CD4 + .4byte _0805455E + .4byte _0805456E + .4byte _080552D2 + .4byte _080549B8 + .4byte _08055004 + .4byte _0805453E + .4byte _08054F94 + .4byte _08054818 + .4byte _08054D56 + .4byte _08054CE2 + .4byte _080547B8 + .4byte _08054788 + .4byte _08054868 + .4byte _08054868 + .4byte _08054F16 + .4byte _08055112 + .4byte _080545AE + .4byte _080545FA + .4byte _08054F94 + .4byte _080546D8 + .4byte _08054F86 + .4byte _08054928 + .4byte _0805459E + .4byte _08054D64 + .4byte _08054AD8 + .4byte _080550DA + .4byte _08054E52 + .4byte _08054878 + .4byte _08054AD8 + .4byte _080545AE + .4byte _080546E8 + .4byte _08054ED0 + .4byte _08054878 + .4byte _080550CC + .4byte _0805462A + .4byte _080545AE + .4byte _08054E28 + .4byte _0805462A + .4byte _080545AE + .4byte _08054B78 + .4byte _08055120 + .4byte _080546E8 + .4byte _08054C48 + .4byte _08054CC6 + .4byte _080551D6 + .4byte _08054928 + .4byte _08054FA2 + .4byte _08054A38 + .4byte _08054B58 + .4byte _0805457E + .4byte _08055090 + .4byte _080547E8 + .4byte _08055238 + .4byte _08054C18 + .4byte _08054A88 + .4byte _080546F8 + .4byte _08054DF0 + .4byte _0805464A + .4byte _08054A78 + .4byte _08054878 + .4byte _08054B98 + .4byte _0805512E + .4byte _080546F8 + .4byte _08055414 + .4byte _08054AF8 + .4byte _08054C78 + .4byte _0805452E + .4byte _0805536C + .4byte _08054768 + .4byte _080550DA + .4byte _08054DC6 + .4byte _080550E8 + .4byte _08054858 + .4byte _080545FA + .4byte _08054508 + .4byte _080547B8 + .4byte _08055104 + .4byte _08054898 + .4byte _08054BF8 + .4byte _080545CA + .4byte _08054508 + .4byte _08054778 + .4byte _08054BE8 + .4byte _08054B08 + .4byte _08054508 + .4byte _080553B2 + .4byte _08055388 + .4byte _08054798 + .4byte _08054AE8 + .4byte _08054BD8 + .4byte _08054EA6 + .4byte _080545FA + .4byte _08054768 + .4byte _08054508 + .4byte _08054EA6 + .4byte _08054738 + .4byte _080549F8 + .4byte _08054748 + .4byte _080545DA + .4byte _08054B48 + .4byte _08054838 + .4byte _08054FBE + .4byte _08054508 + .4byte _080550F6 + .4byte _08054FDA + .4byte _0805456E + .4byte _08054508 + .4byte _08054A48 + .4byte _08055166 + .4byte _08054508 + .4byte _080546C8 + .4byte _08054508 + .4byte _08054B38 + .4byte _08054C38 + .4byte _08054508 + .4byte _08054508 + .4byte _08054508 + .4byte _08054988 + .4byte _08054AC8 + .4byte _080548C8 + .4byte _080550BE + .4byte _08054C58 + .4byte _08054508 + .4byte _08054508 + .4byte _08054508 + .4byte _080548B8 + .4byte _08054508 + .4byte _08054508 + .4byte _08054508 + .4byte _080549D8 + .4byte _08054508 + .4byte _080553C0 + .4byte _08055468 + .4byte _08055246 + .4byte _08054A28 + .4byte _08054F5C + .4byte _08054758 + .4byte _08054508 + .4byte _08054508 + .4byte _080548C8 + .4byte _080548E8 + .4byte _08054908 + .4byte _080548A8 + .4byte _080549B8 + .4byte _080548D8 + .4byte _08054EC2 + .4byte _08054BA8 + .4byte _080548D8 + .4byte _0805463A + .4byte _08054508 + .4byte _08054A28 + .4byte _08054AF8 + .4byte _0805509E + .4byte _08054FCC + .4byte _08054D28 + .4byte _080547D8 + .4byte _08054508 + .4byte _08054C98 + .4byte _08054B28 + .4byte _08054508 + .4byte _08054DAA + .4byte _08054E98 + .4byte _08054CB8 + .4byte _08054A08 + .4byte _08054AC8 + .4byte _08054A98 + .4byte _08054C78 + .4byte _0805461A + .4byte _080553A4 + .4byte _08054788 + .4byte _08054508 + .4byte _0805520E + .4byte _08054DC6 + .4byte _08054E7C + .4byte _08054828 + .4byte _08054D0C + .4byte _0805521C + .4byte _08055066 + .4byte _0805456E + .4byte _08054878 + .4byte _08054C68 + .4byte _08054DE2 + .4byte _080546F8 + .4byte _08054768 + .4byte _08055182 + .4byte _08054D1A + .4byte _0805458E + .4byte _0805458E + .4byte _08054508 + .4byte _08054508 + .4byte _0805458E + .4byte _08054918 + .4byte _0805469C + .4byte _08055174 + .4byte _08054938 + .4byte _080545DA + .4byte _08054508 + .4byte _08055012 + .4byte _08054508 + .4byte _080545AE + .4byte _08054F24 + .4byte _08054B78 + .4byte _080552E0 + .4byte _080546D8 + .4byte _08055074 + .4byte _08055254 + .4byte _08054A28 + .4byte _08054C08 + .4byte _08054508 + .4byte _08054778 + .4byte _0805456E + .4byte _0805535E + .4byte _080547C8 + .4byte _080549A8 + .4byte _08055326 + .4byte _08054AA8 + .4byte _08054958 + .4byte _0805530A + .4byte _0805457E + .4byte _08054788 + .4byte _08054D3A + .4byte _08054EA6 + .4byte _080548C8 + .4byte _08054728 + .4byte _080547F8 + .4byte _08054BB8 + .4byte _0805513C + .4byte _0805463A + .4byte _0805463A + .4byte _080548F8 + .4byte _080552A8 + .4byte _080546B8 + .4byte _08054958 + .4byte _08054508 + .4byte _080553F8 + .4byte _08054CB8 + .4byte _08054978 + .4byte _08054778 + .4byte _08054508 + .4byte _080545FA + .4byte _0805456E + .4byte _080551C8 + .4byte _08054B88 + .4byte _08054E0C + .4byte _08054E60 + .4byte _08054508 + .4byte _08054D72 + .4byte _08054928 + .4byte _08054508 + .4byte _080550B0 + .4byte _08054A18 + .4byte _08054788 + .4byte _08055090 + .4byte _080550B0 + .4byte _08054508 + .4byte _08054DAA + .4byte _08054508 + .4byte _08054708 + .4byte _080547C8 + .4byte _08054508 + .4byte _08054508 + .4byte _080551E4 + .4byte _08054EFA + .4byte _080552D2 + .4byte _080551BA + .4byte _08055074 + .4byte _08054C38 + .4byte _080549E8 + .4byte _08054AD8 + .4byte _08054508 + .4byte _08054508 + .4byte _08054508 + .4byte _08054D48 + .4byte _08054680 + .4byte _08054808 + .4byte _08055492 + .4byte _08055406 + .4byte _08054DFE + .4byte _0805544C + .4byte _08054F32 + .4byte _08054664 + .4byte _080549B8 + .4byte _080553EA + .4byte _08054718 + .4byte _080545AE + .4byte _08055430 + .4byte _08054BC8 + .4byte _08054E1A + .4byte _08054CE2 + .4byte _08054848 + .4byte _08054768 + .4byte _08054998 + .4byte _0805457E + .4byte _0805457E + .4byte _08054508 + .4byte _08054508 + .4byte _08054E6E + .4byte _08054FA2 + .4byte _08054508 + .4byte _08054A88 + .4byte _0805454E + .4byte _08054508 + .4byte _08054AF8 + .4byte _08054512 + .4byte _080554C0 + .4byte _08054CF0 + .4byte _080554C0 + .4byte _080554C0 + .4byte _08054508 + .4byte _0805529A + .4byte _08054508 + .4byte _08055158 + .4byte _08054CA8 + .4byte _08055318 + .4byte _08054508 + .4byte _08054F24 + .4byte _08054958 + .4byte _08054F5C + .4byte _080552EE + .4byte _08054B68 + .4byte _08054CC6 + .4byte _08054F40 + .4byte _08055058 + .4byte _080552FC + .4byte _08055476 + .4byte _08055484 + .4byte _080553CE + .4byte _08055326 + .4byte _08055090 + .4byte _08054E44 + .4byte _080548C8 + .4byte _08054F08 + .4byte _0805543E + .4byte _08055350 + .4byte _08054C88 + .4byte _08054E36 + .4byte _08054F6A + .4byte _08055020 + .4byte _08055334 + .4byte _080551AC + .4byte _080545EA + .4byte _0805545A + .4byte _08054D9C + .4byte _08055342 + .4byte _08055082 + .4byte _080554AE + .4byte _08055262 + .4byte _0805522A + .4byte _08054F4E + .4byte _08054CFE + .4byte _080554C0 + .4byte _0805537A + .4byte _080554C0 + .4byte _080554C0 + .4byte _080554A0 + .4byte _080552C4 + .4byte _080554C0 + .4byte _08054F78 + .4byte _0805502E + .4byte _080554C0 + .4byte _0805503C +_08054508: + movs r3, 0x80 + lsls r3, 1 + mov r2, r9 + str r2, [sp] + b _080545B6 +_08054512: + mov r3, r9 + str r3, [sp] + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + movs r3, 0x80 + b _080545BC +_08054520: + mov r0, r9 + str r0, [sp] + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + movs r3, 0 + b _080545BC +_0805452E: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8058F04 + bl _080554BA +_0805453E: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8058270 + bl _080554BA +_0805454E: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805B968 + bl _080554BA +_0805455E: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805816C + bl _080554BA +_0805456E: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_80581D0 + bl _080554BA +_0805457E: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8058B3C + bl _080554BA +_0805458E: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805A568 + bl _080554BA +_0805459E: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8057E1C + bl _080554BA +_080545AE: + movs r3, 0x80 + lsls r3, 1 + mov r1, r9 + str r1, [sp] +_080545B6: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 +_080545BC: + bl sub_8055640 + negs r1, r0 + orrs r1, r0 + lsrs r4, r1, 31 + bl _080554C2 +_080545CA: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_80590D4 + bl _080554BA +_080545DA: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_80595EC + bl _080554BA +_080545EA: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805C138 + bl _080554BA +_080545FA: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805B17C + bl _080554BA +_0805460A: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8057D20 + bl _080554BA +_0805461A: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805A2E8 + bl _080554BA +_0805462A: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805889C + bl _080554BA +_0805463A: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059E0C + bl _080554BA +_0805464A: + ldr r0, _08054660 + ldr r3, [r0] + mov r2, r9 + str r2, [sp] + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + bl sub_8058C98 + bl _080554BA + .align 2, 0 +_08054660: .4byte gUnknown_8106A50 +_08054664: + ldr r0, _0805467C + ldr r3, [r0] + mov r0, r9 + str r0, [sp] + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + bl sub_8058C98 + bl _080554BA + .align 2, 0 +_0805467C: .4byte gUnknown_8106A4C +_08054680: + ldr r0, _08054698 + ldr r3, [r0] + mov r1, r9 + str r1, [sp] + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + bl sub_805B3FC + bl _080554BA + .align 2, 0 +_08054698: .4byte gUnknown_8106A4C +_0805469C: + ldr r0, _080546B4 + ldr r3, [r0] + mov r2, r9 + str r2, [sp] + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + bl sub_805A5E8 + bl _080554BA + .align 2, 0 +_080546B4: .4byte gUnknown_8106A4C +_080546B8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805B074 + bl _080554BA +_080546C8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059928 + bl _080554BA +_080546D8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8058580 + bl _080554BA +_080546E8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8058930 + bl _080554BA +_080546F8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8058C00 + bl _080554BA +_08054708: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805B324 + bl _080554BA +_08054718: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805B910 + bl _080554BA +_08054728: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805AE74 + bl _080554BA +_08054738: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059540 + bl _080554BA +_08054748: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_80595A0 + bl _080554BA +_08054758: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059D00 + bl _080554BA +_08054768: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8058FBC + bl _080554BA +_08054778: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059190 + bl _080554BA +_08054788: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8058430 + bl _080554BA +_08054798: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059424 + bl _080554BA +_080547A8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8057C88 + bl _080554BA +_080547B8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_80583D8 + bl _080554BA +_080547C8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805AC90 + bl _080554BA +_080547D8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805A0A8 + bl _080554BA +_080547E8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8058B84 + bl _080554BA +_080547F8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805AECC + bl _080554BA +_08054808: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805B454 + bl _080554BA +_08054818: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_80582C4 + bl _080554BA +_08054828: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805A408 + bl _080554BA +_08054838: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059714 + bl _080554BA +_08054848: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805B808 + bl _080554BA +_08054858: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059050 + bl _080554BA +_08054868: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8058478 + bl _080554BA +_08054878: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_80576F8 + bl _080554BA +_08054888: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_80576D0 + bl _080554BA +_08054898: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059080 + bl _080554BA +_080548A8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059D98 + bl _080554BA +_080548B8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059AF8 + bl _080554BA +_080548C8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059AA8 + bl _080554BA +_080548D8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059DA4 + bl _080554BA +_080548E8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059D48 + bl _080554BA +_080548F8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805B028 + bl _080554BA +_08054908: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059D58 + bl _080554BA +_08054918: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805A588 + bl _080554BA +_08054928: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8058638 + bl _080554BA +_08054938: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805A688 + bl _080554BA +_08054948: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8057D7C + bl _080554BA +_08054958: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805B0BC + bl _080554BA +_08054968: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8057A0C + bl _080554BA +_08054978: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805B164 + bl _080554BA +_08054988: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059A18 + bl _080554BA +_08054998: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805B884 + bl _080554BA +_080549A8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805ACD8 + bl _080554BA +_080549B8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_80582D4 + bl _080554BA +_080549C8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8057954 + bl _080554BA +_080549D8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059B94 + bl _080554BA +_080549E8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805B3B4 + bl _080554BA +_080549F8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059588 + bl _080554BA +_08054A08: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805A2B0 + bl _080554BA +_08054A18: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805B2FC + bl _080554BA +_08054A28: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059CD8 + bl _080554BA +_08054A38: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8058A7C + bl _080554BA +_08054A48: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_80598CC + bl _080554BA +_08054A58: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8057F7C + bl _080554BA +_08054A68: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8057ED0 + bl _080554BA +_08054A78: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8058CEC + bl _080554BA +_08054A88: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8058BF0 + bl _080554BA +_08054A98: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805A2C8 + bl _080554BA +_08054AA8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805AD34 + bl _080554BA +_08054AB8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8057C68 + bl _080554BA +_08054AC8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059A2C + bl _080554BA +_08054AD8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_80586DC + bl _080554BA +_08054AE8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805946C + bl _080554BA +_08054AF8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8058E5C + bl _080554BA +_08054B08: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_80591E4 + bl _080554BA +_08054B18: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8057BC4 + bl _080554BA +_08054B28: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805A210 + bl _080554BA +_08054B38: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059988 + bl _080554BA +_08054B48: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805968C + bl _080554BA +_08054B58: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8058AAC + bl _080554BA +_08054B68: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805BE90 + bl _080554BA +_08054B78: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_80588B8 + bl _080554BA +_08054B88: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805B214 + bl _080554BA +_08054B98: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8058D38 + bl _080554BA +_08054BA8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059DC4 + bl _080554BA +_08054BB8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805AF30 + bl _080554BA +_08054BC8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805B7FC + bl _080554BA +_08054BD8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_80594E0 + bl _080554BA +_08054BE8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_80591D8 + bl _080554BA +_08054BF8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_80590C8 + bl _080554BA +_08054C08: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805AB48 + bl _080554BA +_08054C18: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805768C + bl _080554BA +_08054C28: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8057F24 + bl _080554BA +_08054C38: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_80599EC + bl _080554BA +_08054C48: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_80589D4 + bl _080554BA +_08054C58: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059AC4 + bl _080554BA +_08054C68: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805A4D4 + bl _080554BA +_08054C78: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8058EE0 + bl _080554BA +_08054C88: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805BD70 + bl _080554BA +_08054C98: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805A120 + bl _080554BA +_08054CA8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805BA50 + bl _080554BA +_08054CB8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805A2A0 + b _080554BA +_08054CC6: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8058A08 + b _080554BA +_08054CD4: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805815C + b _080554BA +_08054CE2: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805834C + b _080554BA +_08054CF0: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805836C + b _080554BA +_08054CFE: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805C3DC + b _080554BA +_08054D0C: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805A450 + b _080554BA +_08054D1A: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805A55C + b _080554BA +_08054D28: + movs r0, 0 + str r0, [sp] + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059FC8 + b _080554BA +_08054D3A: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805AE3C + b _080554BA +_08054D48: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805B3E0 + b _080554BA +_08054D56: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_80582EC + b _080554BA +_08054D64: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805867C + b _080554BA +_08054D72: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805B2E4 + b _080554BA +_08054D80: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8057720 + b _080554BA +_08054D8E: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8057748 + b _080554BA +_08054D9C: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805C1BC + b _080554BA +_08054DAA: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805A23C + b _080554BA +_08054DB8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8057634 + b _080554BA +_08054DC6: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805A3DC + b _080554BA +_08054DD4: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8057FF4 + b _080554BA +_08054DE2: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805A4FC + b _080554BA +_08054DF0: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8058C48 + b _080554BA +_08054DFE: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805B5F4 + b _080554BA +_08054E0C: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805B220 + b _080554BA +_08054E1A: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_80578EC + b _080554BA +_08054E28: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_80588A8 + b _080554BA +_08054E36: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805BD7C + b _080554BA +_08054E44: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805BC70 + b _080554BA +_08054E52: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_80587E8 + b _080554BA +_08054E60: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805B264 + b _080554BA +_08054E6E: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805B8B0 + b _080554BA +_08054E7C: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805A3FC + b _080554BA +_08054E8A: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8057FCC + b _080554BA +_08054E98: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805A258 + b _080554BA +_08054EA6: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059528 + b _080554BA +_08054EB4: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8057E6C + b _080554BA +_08054EC2: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059DB4 + b _080554BA +_08054ED0: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8058838 + b _080554BA +_08054EDE: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8057A98 + b _080554BA +_08054EEC: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8057974 + b _080554BA +_08054EFA: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805B388 + b _080554BA +_08054F08: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805BC98 + b _080554BA +_08054F16: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_80584C0 + b _080554BA +_08054F24: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805BB74 + b _080554BA +_08054F32: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805B668 + b _080554BA +_08054F40: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805BEA0 + b _080554BA +_08054F4E: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805C2AC + b _080554BA +_08054F5C: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059CF0 + b _080554BA +_08054F6A: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805BF34 + b _080554BA +_08054F78: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805C474 + b _080554BA +_08054F86: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_80585CC + b _080554BA +_08054F94: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_80582AC + b _080554BA +_08054FA2: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8058A54 + b _080554BA +_08054FB0: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805777C + b _080554BA +_08054FBE: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059790 + b _080554BA +_08054FCC: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059F38 + b _080554BA +_08054FDA: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805983C + b _080554BA +_08054FE8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8057788 + b _080554BA +_08054FF6: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8057824 + b _080554BA +_08055004: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805825C + b _080554BA +_08055012: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805A6C8 + b _080554BA +_08055020: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805BF40 + b _080554BA +_0805502E: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805C480 + b _080554BA +_0805503C: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805C48C + b _080554BA +_0805504A: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805810C + b _080554BA +_08055058: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805BEAC + b _080554BA +_08055066: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805A4C0 + b _080554BA +_08055074: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805AAD0 + b _080554BA +_08055082: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805C1F8 + b _080554BA +_08055090: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805B314 + b _080554BA +_0805509E: + movs r0, 0 + str r0, [sp] + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059E54 + b _080554BA +_080550B0: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805B2F0 + b _080554BA +_080550BE: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059AB8 + b _080554BA +_080550CC: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8058858 + b _080554BA +_080550DA: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8058770 + b _080554BA +_080550E8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059004 + b _080554BA +_080550F6: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_80597F0 + b _080554BA +_08055104: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059060 + b _080554BA +_08055112: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8058548 + b _080554BA +_08055120: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_80588F4 + b _080554BA +_0805512E: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8058D44 + b _080554BA +_0805513C: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805AFA4 + b _080554BA +_0805514A: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8057E28 + b _080554BA +_08055158: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805BA44 + b _080554BA +_08055166: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805991C + b _080554BA +_08055174: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805A640 + b _080554BA +_08055182: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805A508 + b _080554BA +_08055190: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805785C + b _080554BA +_0805519E: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8057D9C + b _080554BA +_080551AC: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805C128 + b _080554BA +_080551BA: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805B3A8 + b _080554BA +_080551C8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805B208 + b _080554BA +_080551D6: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8058A18 + b _080554BA +_080551E4: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805B37C + b _080554BA +_080551F2: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8057948 + b _080554BA +_08055200: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8057CD0 + b _080554BA +_0805520E: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805A394 + b _080554BA +_0805521C: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805A464 + b _080554BA +_0805522A: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805C2A0 + b _080554BA +_08055238: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8058BE0 + b _080554BA +_08055246: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059C8C + b _080554BA +_08055254: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805AAE0 + b _080554BA +_08055262: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805C288 + b _080554BA +_08055270: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805783C + b _080554BA +_0805527E: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_80578FC + b _080554BA +_0805528C: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8057BB4 + b _080554BA +_0805529A: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805B9E8 + b _080554BA +_080552A8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805B038 + b _080554BA +_080552B6: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_80578A4 + b _080554BA +_080552C4: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805C468 + b _080554BA +_080552D2: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8058234 + b _080554BA +_080552E0: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805A85C + b _080554BA +_080552EE: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805BD88 + b _080554BA +_080552FC: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805BB98 + b _080554BA +_0805530A: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805AD54 + b _080554BA +_08055318: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805BB64 + b _080554BA +_08055326: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805AD04 + b _080554BA +_08055334: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805C080 + b _080554BA +_08055342: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805C1E4 + b _080554BA +_08055350: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805BED4 + b _080554BA +_0805535E: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805AB54 + b _080554BA +_0805536C: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8058F58 + b _080554BA +_0805537A: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805C3F8 + b _080554BA +_08055388: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059340 + b _080554BA +_08055396: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8057E50 + b _080554BA +_080553A4: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805A31C + b _080554BA +_080553B2: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059290 + b _080554BA +_080553C0: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059BAC + b _080554BA +_080553CE: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805BBA8 + b _080554BA +_080553DC: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805805C + b _080554BA +_080553EA: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805B734 + b _080554BA +_080553F8: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805B0D0 + b _080554BA +_08055406: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805B53C + b _080554BA +_08055414: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8058DBC + b _080554BA +_08055422: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8057BEC + b _080554BA +_08055430: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805B740 + b _080554BA +_0805543E: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805BD64 + b _080554BA +_0805544C: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805B618 + b _080554BA +_0805545A: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805C1B0 + b _080554BA +_08055468: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_8059C80 + b _080554BA +_08055476: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805BEB8 + b _080554BA +_08055484: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805BEC8 + b _080554BA +_08055492: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805B464 + b _080554BA +_080554A0: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805C45C + b _080554BA +_080554AE: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + mov r3, r9 + bl sub_805C208 +_080554BA: + lsls r0, 24 + lsrs r4, r0, 24 + b _080554C2 +_080554C0: + movs r4, 0 +_080554C2: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _080555A2 + ldr r0, [sp, 0x20] + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080554E6 + ldr r3, [sp, 0x20] + ldr r0, [r3, 0x70] + adds r0, 0x46 + ldrb r1, [r0] + adds r0, r3, 0 + bl sub_806CE68 +_080554E6: + cmp r4, 0 + bne _08055510 + adds r0, r7, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08055530 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08055530 + ldr r1, [sp, 0x24] + ldrb r0, [r1, 0x6] + cmp r0, 0 + beq _08055530 + mov r2, r10 + strb r2, [r6] + b _08055530 +_08055510: + mov r0, r8 + bl sub_8057088 + lsls r0, 24 + cmp r0, 0 + beq _08055530 + adds r0, r7, 0 + movs r1, 0 + bl sub_8057308 + lsls r0, 24 + cmp r0, 0 + beq _08055530 + ldr r1, _08055614 + movs r0, 0x1 + strb r0, [r1] +_08055530: + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08055548 + ldr r3, [sp, 0x24] + movs r0, 0xAC + lsls r0, 1 + adds r1, r3, r0 + movs r0, 0x1 + strb r0, [r1] +_08055548: + ldr r1, [sp, 0x18] + cmp r1, 0x89 + beq _08055568 + adds r0, r7, 0 + bl sub_8055DDC + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + bl sub_8069F9C + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + bl sub_806A120 +_08055568: + ldr r7, [sp, 0x1C] +_0805556A: + ldr r2, [sp, 0x14] + adds r2, 0x1 + str r2, [sp, 0x14] +_08055570: + ldr r3, [sp, 0x14] + cmp r3, 0x3F + bgt _080555A2 + movs r0, 0 + str r0, [sp, 0x20] + lsls r0, r3, 2 + ldr r1, [sp, 0x10] + adds r0, r1 + ldr r5, [r0] + movs r2, 0x1 + str r2, [sp, 0x28] + movs r3, 0 + str r3, [sp, 0x2C] + movs r0, 0 + str r0, [sp, 0x30] + cmp r5, 0 + beq _080555A2 + adds r0, r7, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080555A2 + bl _08053724 +_080555A2: + bl sub_8044B28 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _08055604 + adds r0, r7, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080555D6 + ldr r0, [r7, 0x70] + movs r2, 0xAA + lsls r2, 1 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0 + beq _080555D6 + strb r4, [r1] + adds r0, r7, 0 + adds r1, r7, 0 + movs r2, 0 + movs r3, 0 + bl sub_807D148 +_080555D6: + adds r0, r7, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08055604 + ldr r0, [r7, 0x70] + ldr r3, _08055618 + adds r1, r0, r3 + ldrb r0, [r1] + cmp r0, 0 + beq _08055604 + movs r0, 0 + strb r0, [r1] + ldr r1, _0805561C + ldr r2, [r1] + str r0, [sp] + str r0, [sp, 0x4] + adds r0, r7, 0 + adds r1, r7, 0 + movs r3, 0x2 + bl sub_8076E20 +_08055604: + add sp, 0x48 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08055614: .4byte gUnknown_202F222 +_08055618: .4byte 0x00000155 +_0805561C: .4byte gUnknown_8106A50 + thumb_func_end sub_8053704 + + thumb_func_start sub_8055620 +sub_8055620: + push {r4,lr} + sub sp, 0x4 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _08055636 + movs r0, 0x1 +_08055636: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8055620 + + thumb_func_start sub_8055640 +sub_8055640: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + adds r6, r0, 0 + mov r10, r1 + adds r5, r2, 0 + mov r9, r3 + ldr r7, [sp, 0x44] + adds r1, r5, 0 + bl sub_8071A1C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_8071A44 + mov r8, r0 + adds r0, r5, 0 + bl sub_8092C24 + str r0, [sp] + add r0, sp, 0x14 + str r0, [sp, 0x4] + mov r0, r9 + str r0, [sp, 0x8] + ldrh r0, [r5, 0x2] + str r0, [sp, 0xC] + movs r0, 0x1 + str r0, [sp, 0x10] + adds r0, r6, 0 + mov r1, r10 + adds r2, r4, 0 + mov r3, r8 + bl sub_806EAF4 + adds r0, r5, 0 + adds r1, r7, 0 + bl sub_8057600 + lsls r0, 16 + asrs r0, 16 + str r0, [sp] + adds r0, r6, 0 + mov r1, r10 + adds r2, r5, 0 + add r3, sp, 0x14 + bl sub_8055728 + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8055640 + + thumb_func_start sub_80556BC +sub_80556BC: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x24 + adds r6, r0, 0 + mov r9, r1 + adds r4, r2, 0 + adds r5, r3, 0 + ldr r7, [sp, 0x40] + lsls r4, 24 + lsrs r4, 24 + adds r1, r5, 0 + bl sub_8071A44 + mov r8, r0 + adds r0, r5, 0 + bl sub_8092C24 + str r0, [sp] + add r0, sp, 0x14 + str r0, [sp, 0x4] + str r7, [sp, 0x8] + ldrh r0, [r5, 0x2] + str r0, [sp, 0xC] + movs r0, 0x1 + str r0, [sp, 0x10] + adds r0, r6, 0 + mov r1, r9 + adds r2, r4, 0 + mov r3, r8 + bl sub_806EAF4 + adds r0, r5, 0 + ldr r1, [sp, 0x44] + bl sub_8057600 + lsls r0, 16 + asrs r0, 16 + str r0, [sp] + adds r0, r6, 0 + mov r1, r9 + adds r2, r5, 0 + add r3, sp, 0x14 + bl sub_8055728 + add sp, 0x24 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80556BC + + thumb_func_start sub_8055728 +sub_8055728: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + adds r6, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + mov r8, r3 + ldr r0, [sp, 0x30] + lsls r0, 16 + asrs r0, 16 + mov r9, r0 + movs r7, 0x1 + str r7, [sp] + adds r0, r6, 0 + movs r3, 0x1 + bl sub_8056B34 + lsls r0, 24 + cmp r0, 0 + beq _080557C0 + movs r0, 0 + mov r10, r0 + ldrh r1, [r5, 0x2] + movs r0, 0x9D + lsls r0, 1 + cmp r1, r0 + bne _08055768 + movs r1, 0x1 + mov r10, r1 +_08055768: + adds r0, r4, 0 + movs r1, 0x2E + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _08055790 + ldr r0, _080557AC + ldr r1, [r0] + ldr r0, _080557B0 + adds r2, r1, r0 + ldr r0, _080557B4 + strh r0, [r2] + ldr r2, _080557B8 + adds r0, r1, r2 + str r4, [r0] + ldr r0, _080557BC + adds r1, r0 + ldrh r0, [r4, 0x26] + str r0, [r1] +_08055790: + str r7, [sp] + mov r1, r9 + str r1, [sp, 0x4] + str r7, [sp, 0x8] + movs r0, 0 + str r0, [sp, 0xC] + adds r0, r6, 0 + adds r1, r4, 0 + mov r2, r8 + mov r3, r10 + bl sub_806D010 + b _08055826 + .align 2, 0 +_080557AC: .4byte gUnknown_203B418 +_080557B0: .4byte 0x00000662 +_080557B4: .4byte 0x000003e7 +_080557B8: .4byte 0x00017b34 +_080557BC: .4byte 0x00017b40 +_080557C0: + ldr r0, _08055808 + ldr r1, [r4, 0x70] + movs r2, 0 + bl sub_80708B4 + adds r0, r6, 0 + bl sub_8045888 + lsls r0, 24 + cmp r0, 0 + beq _08055814 + adds r0, r4, 0 + bl sub_8045888 + lsls r0, 24 + cmp r0, 0 + beq _08055814 + ldr r0, _0805580C + movs r3, 0x1 + negs r3, r3 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_803ED30 + ldr r0, _08055810 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_805232C + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_8042238 + b _08055820 + .align 2, 0 +_08055808: .4byte gUnknown_202DFE8 +_0805580C: .4byte 0x0000270f +_08055810: .4byte gUnknown_80F9688 +_08055814: + ldr r0, _08055834 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08055820: + movs r0, 0x1 + mov r2, r8 + strb r0, [r2, 0xF] +_08055826: + mov r1, r8 + ldrb r0, [r1, 0xF] + cmp r0, 0 + beq _08055838 + movs r0, 0 + b _08055854 + .align 2, 0 +_08055834: .4byte gUnknown_80F9688 +_08055838: + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08055850 + ldr r0, [r4, 0x70] + movs r2, 0xAD + lsls r2, 1 + adds r1, r0, r2 + movs r0, 0x1 + strb r0, [r1] +_08055850: + mov r1, r8 + ldr r0, [r1] +_08055854: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8055728 + + thumb_func_start sub_8055864 +sub_8055864: + push {r4-r7,lr} + sub sp, 0x20 + adds r4, r0, 0 + adds r7, r1, 0 + adds r5, r2, 0 + adds r6, r3, 0 + adds r1, r5, 0 + bl sub_8071A1C + adds r2, r0, 0 + lsls r2, 24 + lsrs r2, 24 + add r0, sp, 0x10 + str r0, [sp] + adds r0, r4, 0 + adds r1, r7, 0 + adds r3, r6, 0 + bl sub_806F2BC + adds r0, r5, 0 + ldr r1, [sp, 0x34] + bl sub_8057600 + lsls r0, 16 + asrs r0, 16 + movs r5, 0x1 + str r5, [sp] + str r0, [sp, 0x4] + str r5, [sp, 0x8] + movs r0, 0 + str r0, [sp, 0xC] + adds r0, r4, 0 + adds r1, r7, 0 + add r2, sp, 0x10 + movs r3, 0 + bl sub_806D010 + add r0, sp, 0x10 + ldrb r0, [r0, 0xF] + cmp r0, 0 + beq _080558BA + movs r0, 0 + b _080558D2 +_080558BA: + adds r0, r7, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080558D0 + ldr r0, [r7, 0x70] + movs r1, 0xAD + lsls r1, 1 + adds r0, r1 + strb r5, [r0] +_080558D0: + ldr r0, [sp, 0x10] +_080558D2: + add sp, 0x20 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8055864 + + thumb_func_start sub_80558DC +sub_80558DC: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + movs r4, 0x1 + movs r2, 0 + mov r9, r2 + ldr r1, [r1, 0x70] + mov r10, r1 + bl sub_8092B00 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x1 + beq _08055902 + cmp r1, 0x7 + bne _08055906 +_08055902: + movs r5, 0x1 + mov r9, r5 +_08055906: + ldr r6, _08055944 + mov r8, r6 + mov r3, r10 + adds r3, 0x5C + ldr r7, _08055948 + mov r12, r7 + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + str r0, [sp, 0x10] + adds r2, r3, 0 +_0805591C: + mov r0, sp + mov r1, r8 + ldm r1!, {r5-r7} + stm r0!, {r5-r7} + ldr r1, [r1] + str r1, [r0] + mov r0, r9 + cmp r0, 0 + beq _0805594C + ldrb r0, [r2] + cmp r0, 0xE + bne _0805594C + mov r0, r10 + adds r0, 0xF5 + ldrb r0, [r0] + cmp r0, 0 + bne _0805594C + movs r0, 0 + b _0805595A + .align 2, 0 +_08055944: .4byte gUnknown_81069BC +_08055948: .4byte gUnknown_80F522C +_0805594C: + ldrb r0, [r2] + lsls r0, 1 + ldr r1, [sp, 0x10] + adds r0, r1 + add r0, r12 + movs r5, 0 + ldrsh r0, [r0, r5] +_0805595A: + lsls r0, 2 + add r0, sp + ldr r0, [r0] + muls r4, r0 + cmp r4, 0 + beq _0805596E + adds r2, 0x1 + adds r0, r3, 0x1 + cmp r2, r0 + ble _0805591C +_0805596E: + adds r0, r4, 0 + cmp r0, 0 + beq _08055976 + movs r0, 0x1 +_08055976: + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80558DC + + thumb_func_start sub_8055988 +sub_8055988: + push {r4,lr} + adds r2, r0, 0 + adds r4, r1, 0 + cmp r2, r4 + beq _080559D4 + movs r0, 0x4 + ldrsh r1, [r2, r0] + movs r3, 0x4 + ldrsh r0, [r4, r3] + subs r1, r0 + cmp r1, 0 + bge _080559A2 + negs r1, r1 +_080559A2: + cmp r1, 0x1 + bgt _080559D4 + movs r0, 0x6 + ldrsh r1, [r2, r0] + movs r3, 0x6 + ldrsh r0, [r4, r3] + subs r1, r0 + cmp r1, 0 + bge _080559B6 + negs r1, r1 +_080559B6: + cmp r1, 0x1 + bgt _080559D4 + adds r0, r4, 0x4 + adds r1, r2, 0x4 + bl sub_80983D8 + adds r1, r0, 0 + adds r0, r4, 0 + bl sub_8071138 + lsls r0, 24 + cmp r0, 0 + beq _080559D4 + movs r0, 0x1 + b _080559D6 +_080559D4: + movs r0, 0 +_080559D6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8055988 + + thumb_func_start sub_80559DC +sub_80559DC: + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, [r5, 0x70] + adds r0, r5, 0x4 + adds r1, 0x4 + bl sub_80983D8 + adds r1, r0, 0 + movs r2, 0x7 + ands r0, r2 + adds r4, 0x46 + strb r0, [r4] + adds r0, r5, 0 + bl sub_806CE68 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80559DC + + thumb_func_start sub_8055A00 +sub_8055A00: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x34 + adds r5, r0, 0 + mov r9, r1 + str r2, [sp, 0x20] + str r3, [sp, 0x24] + ldr r0, [r5, 0x70] + mov r10, r0 + mov r7, r9 + cmp r7, 0x3 + ble _08055A22 + movs r0, 0 + b _08055DB4 +_08055A22: + movs r0, 0xBC + lsls r0, 1 + add r0, r10 + movs r1, 0 + movs r2, 0 + strh r2, [r0] + ldr r0, _08055A4C + add r0, r10 + strb r1, [r0] + mov r0, r10 + adds r0, 0xBC + ldrb r0, [r0] + cmp r0, 0x1 + bne _08055A58 + ldr r0, _08055A50 + adds r1, r5, 0 + bl sub_8045B94 + ldr r0, _08055A54 + b _08055A8A + .align 2, 0 +_08055A4C: .4byte 0x00000159 +_08055A50: .4byte gUnknown_202DF98 +_08055A54: .4byte gUnknown_80FC714 +_08055A58: + cmp r0, 0x7 + bne _08055A74 + ldr r0, _08055A6C + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08055A70 + b _08055A8A + .align 2, 0 +_08055A6C: .4byte gUnknown_202DF98 +_08055A70: .4byte gUnknown_80FC718 +_08055A74: + mov r0, r10 + adds r0, 0xAC + ldrb r0, [r0] + cmp r0, 0x4 + bne _08055AA0 + ldr r0, _08055A98 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08055A9C +_08055A8A: + ldr r1, [r0] + adds r0, r5, 0 + bl sub_80522A8 + movs r0, 0 + b _08055DB4 + .align 2, 0 +_08055A98: .4byte gUnknown_202DF98 +_08055A9C: .4byte gUnknown_80FC6A8 +_08055AA0: + ldr r0, _08055B24 + strb r1, [r0] + ldr r0, _08055B28 + str r2, [r0] + ldr r0, _08055B2C + strb r1, [r0] + adds r0, r7, 0x1 + movs r2, 0 + movs r6, 0x3 + movs r1, 0xC0 + lsls r1, 1 + add r1, r10 +_08055AB8: + strh r2, [r1] + subs r1, 0x2 + subs r6, 0x1 + cmp r6, 0 + bge _08055AB8 + movs r6, 0 + movs r3, 0x1 + adds r7, r0, 0 + cmp r7, 0x3 + bgt _08055B06 + lsls r2, r7, 3 + mov r1, r10 + adds r0, r1, r2 + movs r4, 0x8C + lsls r4, 1 + adds r0, r4 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08055B06 + movs r0, 0x2 + mov r8, r0 + adds r0, r2, r4 + mov r1, r10 + adds r2, r0, r1 +_08055AEC: + adds r6, 0x1 + cmp r6, 0x3 + bgt _08055B06 + adds r3, 0x1 + adds r2, 0x8 + adds r7, 0x1 + cmp r7, 0x3 + bgt _08055B06 + ldrb r1, [r2] + mov r0, r8 + ands r0, r1 + cmp r0, 0 + bne _08055AEC +_08055B06: + movs r0, 0 + str r0, [sp, 0x28] + cmp r3, 0x1 + ble _08055B12 + movs r1, 0x1 + str r1, [sp, 0x28] +_08055B12: + mov r7, r9 + lsls r0, r7, 3 + movs r1, 0x8C + lsls r1, 1 + adds r0, r1 + add r0, r10 + mov r8, r0 + b _08055CB4 + .align 2, 0 +_08055B24: .4byte gUnknown_202F222 +_08055B28: .4byte gUnknown_202F208 +_08055B2C: .4byte gUnknown_202F221 +_08055B30: + mov r1, r8 + ldrh r0, [r1, 0x2] + cmp r0, 0x19 + beq _08055B3C + cmp r0, 0xE3 + bne _08055B4E +_08055B3C: + adds r0, r5, 0 + bl sub_8070B28 + lsls r0, 24 + cmp r0, 0 + bne _08055B5E + adds r0, r5, 0 + movs r1, 0x1 + b _08055B52 +_08055B4E: + adds r0, r5, 0 + movs r1, 0 +_08055B52: + bl sub_8070D04 + lsls r0, 24 + cmp r0, 0 + beq _08055B5E + b _08055CCE +_08055B5E: + ldr r0, _08055B9C + ldrb r0, [r0] + cmp r0, 0 + beq _08055B68 + b _08055CCE +_08055B68: + ldrb r1, [r6] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08055B74 + b _08055C82 +_08055B74: + movs r2, 0x1 + movs r0, 0 + str r0, [sp, 0x2C] + adds r0, r5, 0 + adds r1, r6, 0 + str r2, [sp, 0x30] + bl sub_80570AC + lsls r0, 24 + lsrs r4, r0, 24 + ldrb r0, [r6, 0x4] + ldr r2, [sp, 0x30] + cmp r0, 0 + beq _08055BA0 + cmp r4, 0 + bne _08055BBA + movs r1, 0x1 + str r1, [sp, 0x2C] + b _08055BBA + .align 2, 0 +_08055B9C: .4byte gUnknown_202F221 +_08055BA0: + cmp r4, 0 + bne _08055BBA + ldr r0, _08055C08 + adds r1, r6, 0 + movs r2, 0 + bl sub_80928C0 + ldr r0, _08055C0C + ldr r1, [r0] + adds r0, r5, 0 + bl sub_80522A8 + movs r2, 0 +_08055BBA: + cmp r2, 0 + beq _08055C82 + ldr r0, _08055C10 + ldr r0, [r0] + mov r9, r0 + ldr r0, _08055C14 + add r0, r10 + strb r4, [r0] + ldrh r0, [r6, 0x2] + cmp r0, 0xE5 + bne _08055C20 + ldr r0, [r6] + ldr r1, [r6, 0x4] + str r0, [sp, 0x8] + str r1, [sp, 0xC] + adds r0, r5, 0 + bl sub_8057144 + lsls r0, 16 + ldr r2, _08055C18 + ldr r1, [sp, 0x8] + ands r1, r2 + orrs r1, r0 + str r1, [sp, 0x8] + ldr r0, _08055C08 + add r1, sp, 0x8 + movs r2, 0 + bl sub_80928C0 + ldr r0, _08055C1C + ldr r1, [r0] + adds r0, r5, 0 + bl sub_80522A8 + ldr r0, [sp, 0x28] + str r0, [sp] + add r1, sp, 0x8 + str r1, [sp, 0x4] + b _08055C26 + .align 2, 0 +_08055C08: .4byte gUnknown_202DE58 +_08055C0C: .4byte gUnknown_80F93C8 +_08055C10: .4byte gUnknown_202F208 +_08055C14: .4byte 0x00000159 +_08055C18: .4byte 0x0000ffff +_08055C1C: .4byte gUnknown_80FD2DC +_08055C20: + ldr r0, [sp, 0x28] + str r0, [sp] + str r6, [sp, 0x4] +_08055C26: + adds r0, r5, 0 + ldr r1, [sp, 0x20] + ldr r2, [sp, 0x24] + ldr r3, [sp, 0x54] + bl sub_8055FA0 + lsls r0, 24 + lsrs r0, 24 + ldr r1, [sp, 0x2C] + cmp r1, 0 + beq _08055C56 + cmp r0, 0 + beq _08055C56 + ldrb r1, [r6, 0x1] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08055C50 + movs r0, 0xFB + ands r0, r1 + b _08055C54 +_08055C50: + movs r0, 0x8 + orrs r0, r1 +_08055C54: + strb r0, [r6, 0x1] +_08055C56: + ldr r0, _08055C70 + ldr r0, [r0] + cmp r9, r0 + bne _08055C82 + ldr r0, [sp, 0x24] + cmp r0, 0 + bne _08055C78 + ldr r0, _08055C74 + ldr r1, [r0] + adds r0, r5, 0 + bl sub_80522A8 + b _08055C82 + .align 2, 0 +_08055C70: .4byte gUnknown_202F208 +_08055C74: .4byte gUnknown_80FC690 +_08055C78: + ldr r0, _08055DC4 + ldr r1, [r0] + adds r0, r5, 0 + bl sub_80522A8 +_08055C82: + movs r0, 0x1 + bl sub_804178C + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08055CCE + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _08055CCE + movs r1, 0x8 + add r8, r1 + adds r7, 0x1 + cmp r7, 0x3 + bgt _08055CCE + mov r0, r8 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08055CCE +_08055CB4: + mov r6, r8 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08055CCE + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _08055CCE + b _08055B30 +_08055CCE: + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08055D54 + movs r6, 0 +_08055CDC: + lsls r0, r6, 1 + movs r1, 0xBD + lsls r1, 1 + add r1, r10 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0 + beq _08055D4E + add r4, sp, 0x10 + adds r1, r0, 0 + adds r0, r4, 0 + bl sub_8092AA8 + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08055D48 + ldrh r0, [r4, 0x2] + cmp r0, 0xE5 + bne _08055D36 + ldr r0, [sp, 0x10] + ldr r1, [sp, 0x14] + str r0, [sp, 0x18] + str r1, [sp, 0x1C] + adds r0, r5, 0 + bl sub_8057144 + lsls r0, 16 + ldr r2, _08055DC8 + ldr r1, [sp, 0x18] + ands r1, r2 + orrs r1, r0 + str r1, [sp, 0x18] + add r4, sp, 0x18 + ldr r0, _08055DCC + adds r1, r4, 0 + movs r2, 0 + bl sub_80928C0 + ldr r0, _08055DD0 + ldr r1, [r0] + adds r0, r5, 0 + bl sub_80522A8 +_08055D36: + ldr r1, [sp, 0x28] + str r1, [sp] + str r4, [sp, 0x4] + adds r0, r5, 0 + movs r1, 0 + ldr r2, [sp, 0x24] + ldr r3, [sp, 0x54] + bl sub_8055FA0 +_08055D48: + movs r0, 0x1 + bl sub_804178C +_08055D4E: + adds r6, 0x1 + cmp r6, 0x3 + ble _08055CDC +_08055D54: + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08055DB2 + adds r0, r5, 0 + bl sub_8071DA4 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08055DB2 + ldr r1, _08055DD4 + ldrb r0, [r1] + cmp r0, 0 + beq _08055DB2 + movs r0, 0 + strb r0, [r1] + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08055DB2 + ldr r4, [r5, 0x70] + ldr r1, _08055DD8 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_808417C + adds r3, r0, 0 + movs r0, 0 + str r0, [sp] + adds r0, r5, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_8076090 + adds r4, 0xFB + ldrb r0, [r4] + cmp r0, 0 + bne _08055DB2 + movs r0, 0x1 + strb r0, [r4] +_08055DB2: + movs r0, 0x1 +_08055DB4: + add sp, 0x34 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08055DC4: .4byte gUnknown_80FC6A4 +_08055DC8: .4byte 0x0000ffff +_08055DCC: .4byte gUnknown_202DE58 +_08055DD0: .4byte gUnknown_80FD2DC +_08055DD4: .4byte gUnknown_202F222 +_08055DD8: .4byte gUnknown_80F4E70 + thumb_func_end sub_8055A00 + + thumb_func_start sub_8055DDC +sub_8055DDC: + push {r4-r7,lr} + adds r4, r0, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08055DEC + b _08055F62 +_08055DEC: + ldr r6, [r4, 0x70] + movs r7, 0xBC + lsls r7, 1 + adds r5, r6, r7 + ldrh r1, [r5] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08055E10 + ldr r0, _08055F68 + ldr r1, [r0] + adds r0, r4, 0 + bl sub_80522A8 + adds r0, r4, 0 + adds r1, r4, 0 + bl sub_80769CC +_08055E10: + ldrh r1, [r5] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08055E2C + ldr r0, _08055F6C + ldr r1, [r0] + adds r0, r4, 0 + bl sub_80522A8 + adds r0, r4, 0 + adds r1, r4, 0 + bl sub_80769CC +_08055E2C: + ldrh r1, [r5] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08055E48 + ldr r0, _08055F70 + ldr r1, [r0] + adds r0, r4, 0 + bl sub_80522A8 + adds r0, r4, 0 + adds r1, r4, 0 + bl sub_80769CC +_08055E48: + ldrh r1, [r5] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08055E66 + ldr r0, _08055F74 + ldr r1, [r0] + adds r0, r4, 0 + bl sub_80522A8 + adds r0, r4, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_8077780 +_08055E66: + ldrh r1, [r5] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08055E84 + ldr r0, _08055F78 + ldr r1, [r0] + adds r0, r4, 0 + bl sub_80522A8 + adds r0, r4, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_8077780 +_08055E84: + ldrh r1, [r5] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08055EA2 + ldr r0, _08055F7C + ldr r1, [r0] + adds r0, r4, 0 + bl sub_80522A8 + adds r0, r4, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_80763F8 +_08055EA2: + ldrh r1, [r5] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08055EC0 + ldr r0, _08055F80 + ldr r1, [r0] + adds r0, r4, 0 + bl sub_80522A8 + adds r0, r4, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_80763F8 +_08055EC0: + ldrh r1, [r5] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08055EEA + ldr r0, _08055F84 + ldr r1, [r0] + adds r0, r4, 0 + bl sub_80522A8 + ldr r1, _08055F88 + adds r0, r4, 0 + movs r2, 0x1 + bl sub_808417C + adds r2, r0, 0 + adds r0, r4, 0 + adds r1, r4, 0 + movs r3, 0x1 + bl sub_8075C58 +_08055EEA: + ldrh r1, [r5] + movs r0, 0x80 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _08055F0C + ldr r0, _08055F8C + ldr r1, [r0] + adds r0, r4, 0 + bl sub_80522A8 + adds r0, r4, 0 + adds r1, r4, 0 + movs r2, 0x1 + movs r3, 0x1 + bl sub_8076210 +_08055F0C: + ldrh r1, [r5] + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + cmp r0, 0 + beq _08055F2C + ldr r0, _08055F90 + ldr r1, [r0] + adds r0, r4, 0 + bl sub_80522A8 + adds r0, r4, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_807614C +_08055F2C: + adds r5, r6, r7 + ldrh r1, [r5] + movs r0, 0x80 + lsls r0, 3 + ands r0, r1 + cmp r0, 0 + beq _08055F5E + ldr r0, _08055F94 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08055F98 + ldr r1, [r0] + adds r0, r4, 0 + bl sub_80522A8 + adds r0, r4, 0 + bl sub_80428A0 + ldr r0, _08055F9C + ldrh r1, [r0] + adds r0, r6, 0 + adds r0, 0xFA + strb r1, [r0] +_08055F5E: + movs r0, 0 + strh r0, [r5] +_08055F62: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08055F68: .4byte gUnknown_80FEEA4 +_08055F6C: .4byte gUnknown_80FEEC8 +_08055F70: .4byte gUnknown_80FEEEC +_08055F74: .4byte gUnknown_80FEF0C +_08055F78: .4byte gUnknown_80FEF30 +_08055F7C: .4byte gUnknown_80FEF4C +_08055F80: .4byte gUnknown_80FEF50 +_08055F84: .4byte gUnknown_80FEF54 +_08055F88: .4byte gUnknown_80F4E74 +_08055F8C: .4byte gUnknown_80FEF74 +_08055F90: .4byte gUnknown_80FEF98 +_08055F94: .4byte gUnknown_202DF98 +_08055F98: .4byte gUnknown_80FEFD0 +_08055F9C: .4byte gUnknown_80F5004 + thumb_func_end sub_8055DDC + + thumb_func_start sub_8055FA0 +sub_8055FA0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x130 + adds r5, r0, 0 + adds r6, r1, 0 + mov r10, r2 + str r3, [sp, 0x120] + ldr r7, [sp, 0x154] + movs r0, 0 + mov r8, r0 + str r0, [sp, 0xC] + movs r0, 0x1 + bl sub_804178C + ldrh r1, [r7, 0x2] + movs r0, 0xA5 + lsls r0, 1 + cmp r1, r0 + bne _08056010 + movs r0, 0x69 + bl sub_8084100 + ldr r1, _08056004 + str r0, [r1] + add r4, sp, 0x110 + ldr r1, _08056008 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0] + adds r0, r4, 0 + bl sub_8092A88 + ldrb r1, [r7] + add r0, sp, 0x110 + strb r1, [r0] + ldrb r0, [r7, 0x1] + strb r0, [r4, 0x1] + ldr r0, _0805600C + ldr r2, [r0] + mov r1, r10 + str r1, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + mov r0, r8 + str r0, [sp, 0x8] + b _08056056 + .align 2, 0 +_08056004: .4byte gUnknown_202F228 +_08056008: .4byte gUnknown_80F59C8 +_0805600C: .4byte gUnknown_80FECBC +_08056010: + cmp r1, 0x77 + bne _08056068 + ldr r0, _08056108 + ldr r0, [r0] + ldr r1, _0805610C + adds r0, r1 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + bge _08056026 + movs r0, 0 +_08056026: + cmp r0, 0x4A + ble _0805602C + movs r0, 0x4A +_0805602C: + add r4, sp, 0x118 + ldr r1, _08056110 + lsls r0, 3 + adds r0, r1 + ldrh r1, [r0] + adds r0, r4, 0 + bl sub_8092A88 + ldrb r1, [r7] + add r0, sp, 0x118 + strb r1, [r0] + ldrb r0, [r7, 0x1] + strb r0, [r4, 0x1] + ldr r0, _08056114 + ldr r2, [r0] + mov r0, r10 + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x4] + mov r1, r8 + str r1, [sp, 0x8] +_08056056: + adds r0, r5, 0 + adds r1, r7, 0 + add r3, sp, 0xC + bl sub_8056468 + movs r0, 0x1 + bl sub_804178C + adds r7, r4, 0 +_08056068: + movs r2, 0 + str r2, [sp, 0x128] + adds r0, r5, 0 + adds r1, r7, 0 + movs r2, 0x1 + bl sub_807CD64 + movs r4, 0xF0 + adds r1, r4, 0 + ands r1, r0 + cmp r1, 0x50 + bne _08056084 + movs r0, 0xA + str r0, [sp, 0x128] +_08056084: + adds r0, r5, 0 + adds r1, r7, 0 + movs r2, 0x1 + bl sub_807CD64 + adds r1, r4, 0 + ands r1, r0 + cmp r1, 0x80 + bne _080560CC + movs r1, 0x1 + str r1, [sp, 0x128] + ldrh r0, [r7, 0x2] + cmp r0, 0x97 + bne _080560AE + adds r0, r5, 0 + bl sub_807E580 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080560CC +_080560AE: + ldrh r0, [r7, 0x2] + bl sub_809422C + lsls r0, 24 + cmp r0, 0 + beq _080560CC + adds r0, r5, 0 + adds r1, r7, 0 + bl sub_80570AC + lsls r0, 24 + cmp r0, 0 + bne _080560CC + movs r2, 0 + str r2, [sp, 0x128] +_080560CC: + ldr r0, _08056118 + ldr r1, [r5, 0x70] + movs r2, 0 + bl sub_80708B4 + ldr r0, _0805611C + adds r1, r7, 0 + movs r2, 0 + bl sub_80928C0 + adds r0, r5, 0 + adds r1, r7, 0 + bl sub_80570AC + lsls r0, 24 + cmp r0, 0 + beq _08056124 + ldr r0, _08056120 + ldr r0, [r0] + mov r8, r0 + ldr r0, [r5, 0x70] + adds r0, 0xFF + movs r1, 0 + strb r1, [r0] + adds r0, r5, 0 + adds r1, r7, 0 + movs r2, 0x1 + bl sub_805744C + b _08056142 + .align 2, 0 +_08056108: .4byte gUnknown_203B418 +_0805610C: .4byte 0x00003a0e +_08056110: .4byte gUnknown_80F5D10 +_08056114: .4byte gUnknown_80FECE0 +_08056118: .4byte gUnknown_202DF98 +_0805611C: .4byte gUnknown_202DE58 +_08056120: .4byte gUnknown_80FC72C +_08056124: + mov r0, r10 + cmp r0, 0 + bne _08056132 + ldrh r0, [r7, 0x2] + bl sub_8092CA8 + b _08056136 +_08056132: + ldr r0, _08056194 + ldr r0, [r0] +_08056136: + mov r8, r0 + adds r0, r5, 0 + adds r1, r7, 0 + movs r2, 0x1 + bl sub_80573CC +_08056142: + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _08056156 + cmp r6, 0 + beq _08056156 + adds r0, r5, 0 + adds r1, r7, 0 + bl sub_806ACE8 +_08056156: + ldr r0, [r5, 0x70] + adds r0, 0xEC + ldrb r0, [r0] + cmp r0, 0x1 + bne _080561A0 + ldrh r0, [r7, 0x2] + bl sub_8092CF0 + lsls r0, 24 + cmp r0, 0 + beq _080561A0 + ldr r0, _08056198 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r5, 0 + mov r1, r8 + bl sub_80522A8 + movs r0, 0xA + movs r1, 0x3F + bl sub_803E708 + ldr r0, _0805619C +_08056188: + ldr r1, [r0] + adds r0, r5, 0 + bl sub_80522A8 +_08056190: + movs r0, 0 + b _08056446 + .align 2, 0 +_08056194: .4byte gUnknown_80F9158 +_08056198: .4byte gUnknown_202DF98 +_0805619C: .4byte gUnknown_80FC710 +_080561A0: + cmp r4, 0 + bne _08056214 + ldr r0, _080561D4 + ldr r1, [r5, 0x70] + movs r2, 0 + bl sub_80708B4 + mov r1, r10 + cmp r1, 0 + bne _080561E0 + ldr r0, _080561D8 + adds r1, r7, 0 + movs r2, 0 + bl sub_80928C0 + adds r0, r5, 0 + mov r1, r8 + bl sub_80522A8 + movs r0, 0xA + movs r1, 0x3F + bl sub_803E708 + ldr r0, _080561DC + b _08056188 + .align 2, 0 +_080561D4: .4byte gUnknown_202DF98 +_080561D8: .4byte gUnknown_202DE58 +_080561DC: .4byte gUnknown_80FC6D0 +_080561E0: + ldr r0, _0805620C + mov r2, r10 + lsls r1, r2, 24 + lsrs r1, 24 + movs r2, 0 + bl sub_8090DC4 + adds r0, r5, 0 + mov r1, r8 + bl sub_80522A8 + movs r0, 0xA + movs r1, 0x3F + bl sub_803E708 + ldr r0, _08056210 + ldr r1, [r0] + adds r0, r5, 0 + bl sub_80522A8 + b _08056190 + .align 2, 0 +_0805620C: .4byte gUnknown_202DE58 +_08056210: .4byte gUnknown_80FC6FC +_08056214: + ldr r0, _0805625C + movs r1, 0 + str r1, [r0] + ldr r0, _08056260 + str r1, [r0] + ldr r0, _08056264 + str r1, [r0] + ldr r0, _08056268 + strb r1, [r0] + ldr r0, _0805626C + strb r1, [r0] + ldr r0, _08056270 + strb r1, [r0] + ldr r0, _08056274 + str r1, [r0] + ldr r0, _08056278 + strb r1, [r0] + ldr r0, [sp, 0x150] + cmp r0, 0 + beq _0805624C + ldr r0, [r5, 0x70] + ldr r2, _0805627C + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0x3 + bhi _0805624C + adds r0, 0x1 + strb r0, [r1] +_0805624C: + adds r0, r7, 0 + bl sub_8057070 + str r0, [sp, 0x124] + movs r0, 0 + mov r9, r0 + b _080563E4 + .align 2, 0 +_0805625C: .4byte gUnknown_202F214 +_08056260: .4byte gUnknown_202F20C +_08056264: .4byte gUnknown_202F210 +_08056268: .4byte gUnknown_202F218 +_0805626C: .4byte gUnknown_202F219 +_08056270: .4byte gUnknown_202F21A +_08056274: .4byte gUnknown_202F21C +_08056278: .4byte gUnknown_202F220 +_0805627C: .4byte 0x00000153 +_08056280: + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _0805628E + b _08056444 +_0805628E: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _0805629A + b _08056444 +_0805629A: + ldr r4, [r5, 0x70] + ldr r0, [sp, 0x120] + cmp r0, 0 + bne _080562AC + ldrh r0, [r7, 0x2] + cmp r0, 0x19 + beq _080562AC + cmp r0, 0xE3 + bne _080562BE +_080562AC: + adds r0, r5, 0 + bl sub_8070B28 + lsls r0, 24 + cmp r0, 0 + bne _080562CE + adds r0, r5, 0 + movs r1, 0x1 + b _080562C2 +_080562BE: + adds r0, r5, 0 + movs r1, 0 +_080562C2: + bl sub_8070D04 + lsls r0, 24 + cmp r0, 0 + beq _080562CE + b _08056400 +_080562CE: + movs r1, 0xA5 + lsls r1, 1 + adds r0, r4, r1 + movs r6, 0 + strb r6, [r0] + ldrh r0, [r7, 0x2] + cmp r0, 0x9 + bne _080562F4 + ldr r4, [r5, 0x70] + movs r0, 0x8 + bl sub_8084100 + adds r4, 0x46 + strb r0, [r4] + adds r0, r5, 0 + bl sub_8069DCC + movs r2, 0 + str r2, [sp, 0x12C] +_080562F4: + ldr r0, _080563A0 + str r6, [r0] + str r6, [sp, 0xC] + ldr r0, [sp, 0x128] + cmp r0, 0x1 + bhi _08056324 + add r0, sp, 0xC + adds r1, r5, 0 + adds r2, r7, 0 + bl sub_8056CE8 + add r0, sp, 0xC + adds r1, r5, 0 + bl sub_80574C4 + mov r1, r9 + cmp r1, 0 + beq _08056324 + ldr r2, [sp, 0x12C] + cmp r2, 0 + beq _08056324 + ldr r0, [sp, 0xC] + cmp r0, 0 + beq _08056400 +_08056324: + mov r0, r10 + str r0, [sp] + movs r0, 0 + mov r1, r9 + cmp r1, 0 + bne _08056332 + movs r0, 0x1 +_08056332: + str r0, [sp, 0x4] + ldr r2, [sp, 0x128] + str r2, [sp, 0x8] + adds r0, r5, 0 + adds r1, r7, 0 + mov r2, r8 + add r3, sp, 0xC + bl sub_8056468 + lsls r0, 24 + lsrs r4, r0, 24 + movs r0, 0 + mov r8, r0 + ldr r0, _080563A0 + ldr r0, [r0] + cmp r0, 0 + beq _08056358 + bl sub_806A1E8 +_08056358: + ldr r1, [r5, 0x70] + adds r0, r1, 0 + adds r0, 0xBC + ldrb r0, [r0] + cmp r0, 0x2 + beq _0805637C + cmp r0, 0x4 + beq _0805637C + movs r2, 0xB6 + lsls r2, 1 + adds r0, r1, r2 + mov r2, r8 + strh r2, [r0] + movs r2, 0xB7 + lsls r2, 1 + adds r0, r1, r2 + mov r1, r8 + strh r1, [r0] +_0805637C: + ldr r1, _080563A4 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + ldr r2, [sp, 0x128] + cmp r2, 0 + beq _080563A8 + mov r0, r10 + str r0, [sp] + ldr r1, [sp, 0x150] + str r1, [sp, 0x4] + adds r0, r5, 0 + adds r1, r7, 0 + adds r3, r4, 0 + bl sub_80566F8 + b _080563B8 + .align 2, 0 +_080563A0: .4byte gUnknown_203B438 +_080563A4: .4byte gUnknown_202F214 +_080563A8: + ldr r2, [sp, 0x150] + str r2, [sp] + add r0, sp, 0xC + adds r1, r5, 0 + adds r2, r7, 0 + mov r3, r10 + bl sub_8053704 +_080563B8: + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08056400 + adds r0, r5, 0 + bl sub_806CF18 + ldr r0, [r5, 0x70] + movs r2, 0xA5 + lsls r2, 1 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0 + bne _080563E0 + strb r0, [r1] + adds r0, r5, 0 + bl sub_8079764 +_080563E0: + movs r0, 0x1 + add r9, r0 +_080563E4: + ldr r1, [sp, 0x124] + cmp r9, r1 + bge _08056400 + movs r2, 0x1 + str r2, [sp, 0x12C] + ldr r0, _08056458 + ldrb r0, [r0] + cmp r0, 0 + bne _08056400 + ldr r0, _0805645C + ldrb r0, [r0] + cmp r0, 0 + bne _08056400 + b _08056280 +_08056400: + ldr r0, _08056460 + ldrb r0, [r0] + cmp r0, 0 + beq _08056418 + adds r0, r5, 0 + adds r1, r5, 0 + bl sub_807A324 + adds r0, r5, 0 + adds r1, r5, 0 + bl sub_807A6C8 +_08056418: + ldr r0, _08056464 + ldrb r0, [r0] + cmp r0, 0 + beq _08056444 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08056444 + ldr r4, [r5, 0x70] + adds r0, r5, 0 + adds r1, r5, 0 + movs r2, 0 + bl sub_8077AE4 + adds r4, 0xFB + ldrb r0, [r4] + cmp r0, 0 + bne _08056444 + movs r0, 0x1 + strb r0, [r4] +_08056444: + movs r0, 0x1 +_08056446: + add sp, 0x130 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08056458: .4byte gUnknown_202F220 +_0805645C: .4byte gUnknown_202F221 +_08056460: .4byte gUnknown_202F21A +_08056464: .4byte gUnknown_202F219 + thumb_func_end sub_8055FA0 + + thumb_func_start sub_8056468 +sub_8056468: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r6, r0, 0 + mov r8, r1 + mov r9, r2 + adds r4, r3, 0 + ldr r0, [sp, 0x28] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0 + mov r10, r0 + adds r0, r6, 0 + bl sub_8045888 + lsls r0, 24 + lsrs r0, 24 + negs r1, r0 + orrs r1, r0 + lsrs r7, r1, 31 + mov r2, r9 + cmp r2, 0 + beq _08056518 + movs r5, 0 + b _080564A6 +_080564A2: + adds r4, 0x4 + adds r5, 0x1 +_080564A6: + cmp r5, 0x40 + bgt _080564BC + ldr r0, [r4] + cmp r0, 0 + beq _080564BC + bl sub_8045888 + lsls r0, 24 + cmp r0, 0 + beq _080564A2 + movs r7, 0x1 +_080564BC: + cmp r7, 0 + beq _080564F2 + ldr r0, _080564DC + ldr r1, [r6, 0x70] + movs r2, 0 + bl sub_80708B4 + ldr r0, [sp, 0x24] + cmp r0, 0 + bne _080564E4 + ldr r0, _080564E0 + mov r1, r8 + movs r2, 0 + bl sub_80928C0 + b _080564F2 + .align 2, 0 +_080564DC: .4byte gUnknown_202DF98 +_080564E0: .4byte gUnknown_202DE58 +_080564E4: + ldr r0, _08056508 + ldr r2, [sp, 0x24] + lsls r1, r2, 24 + lsrs r1, 24 + movs r2, 0 + bl sub_8090DC4 +_080564F2: + mov r0, r8 + ldrh r1, [r0, 0x2] + ldr r0, _0805650C + cmp r1, r0 + beq _08056510 + adds r0, r6, 0 + mov r1, r9 + bl sub_805239C + b _08056518 + .align 2, 0 +_08056508: .4byte gUnknown_202DE58 +_0805650C: .4byte 0x00000163 +_08056510: + adds r0, r6, 0 + mov r1, r9 + bl sub_80522E8 +_08056518: + cmp r7, 0 + beq _08056544 + ldr r2, [sp] + cmp r2, 0 + beq _0805652A + adds r0, r6, 0 + mov r1, r8 + movs r2, 0x1 + b _08056530 +_0805652A: + adds r0, r6, 0 + mov r1, r8 + movs r2, 0 +_08056530: + bl sub_8040BB0 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + adds r0, r6, 0 + mov r1, r8 + bl sub_8040DA0 + b _08056550 +_08056544: + ldr r0, [r6, 0x70] + adds r0, 0x46 + ldrb r1, [r0] + adds r0, r6, 0 + bl sub_806CE68 +_08056550: + mov r0, r10 + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8056468 + + thumb_func_start sub_8056564 +sub_8056564: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x18 + adds r6, r0, 0 + adds r5, r1, 0 + adds r7, r2, 0 + adds r4, r3, 0 + ldr r0, [r6, 0x70] + mov r8, r0 + ldr r0, _08056680 + ldr r0, [r0] + ldr r1, _08056684 + adds r0, r1 + ldrb r0, [r0] + mov r9, r0 + cmp r0, 0 + beq _0805658C + b _080566E4 +_0805658C: + mov r2, r8 + movs r1, 0x4 + ldrsh r0, [r2, r1] + bl sub_808DACC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _080565A4 + cmp r4, 0x1 + bne _080565A4 + b _080566E4 +_080565A4: + ldrh r4, [r7, 0x2] + adds r0, r6, 0 + bl sub_807E580 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + movs r2, 0x1 + bl sub_80412E0 + lsls r0, 16 + lsrs r0, 16 + bl sub_800ECB8 + movs r2, 0x6 + ldrsh r4, [r0, r2] + movs r1, 0 + ldrsh r0, [r5, r1] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 11 + movs r0, 0x2 + ldrsh r2, [r5, r0] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 11 + movs r2, 0x80 + lsls r2, 5 + adds r3, r0, r2 + movs r2, 0xC0 + lsls r2, 4 + adds r0, r1, r2 + cmp r0, 0 + bge _080565EC + adds r0, 0xFF +_080565EC: + lsls r0, 8 + lsrs r0, 16 + ldr r1, _08056688 + ldr r2, [sp, 0x14] + ands r2, r1 + orrs r2, r0 + str r2, [sp, 0x14] + adds r0, r3, 0 + cmp r0, 0 + bge _08056602 + adds r0, 0xFF +_08056602: + lsls r0, 8 + lsrs r0, 16 + lsls r0, 16 + ldr r1, _0805668C + ands r2, r1 + orrs r2, r0 + str r2, [sp, 0x14] + cmp r4, 0 + beq _080566E4 + ldrh r4, [r7, 0x2] + adds r0, r6, 0 + bl sub_807E580 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + movs r2, 0x1 + bl sub_80412E0 + lsls r0, 16 + lsrs r0, 16 + bl sub_800EF10 + bl sub_800EF64 + movs r0, 0x5E + bl sub_803E46C + mov r0, r8 + movs r1, 0x4 + ldrsh r5, [r0, r1] + ldrh r4, [r7, 0x2] + adds r0, r6, 0 + bl sub_807E580 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + movs r2, 0x1 + bl sub_80412E0 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r5, 0 + bl sub_800E710 + adds r2, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r2, r0 + beq _08056690 + add r0, sp, 0x8 + adds r1, r6, 0 + adds r1, 0x28 + lsls r2, 24 + lsrs r2, 24 + bl sub_800569C + b _08056694 + .align 2, 0 +_08056680: .4byte gUnknown_203B418 +_08056684: .4byte 0x0001820a +_08056688: .4byte 0xffff0000 +_0805668C: .4byte 0x0000ffff +_08056690: + mov r2, r9 + str r2, [sp, 0x8] +_08056694: + ldrh r4, [r7, 0x2] + adds r0, r6, 0 + bl sub_807E580 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + movs r2, 0x1 + bl sub_80412E0 + mov r1, sp + strh r0, [r1] + mov r2, r8 + ldrh r0, [r2, 0x4] + strh r0, [r1, 0x2] + ldr r0, [r6, 0xC] + cmp r0, 0 + bge _080566BC + adds r0, 0xFF +_080566BC: + asrs r0, 8 + strh r0, [r1, 0x4] + mov r1, sp + ldr r0, [r6, 0x10] + cmp r0, 0 + bge _080566CA + adds r0, 0xFF +_080566CA: + asrs r0, 8 + strh r0, [r1, 0x6] + mov r0, r8 + adds r0, 0x46 + ldrb r0, [r0] + str r0, [sp, 0xC] + movs r0, 0 + str r0, [sp, 0x10] + add r1, sp, 0x14 + mov r0, sp + bl sub_800E308 + b _080566E8 +_080566E4: + movs r0, 0x1 + negs r0, r0 +_080566E8: + add sp, 0x18 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8056564 + + thumb_func_start sub_80566F8 +sub_80566F8: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x54 + mov r10, r0 + str r1, [sp, 0x1C] + str r2, [sp, 0x20] + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x24] + movs r0, 0 + str r0, [sp, 0x34] + movs r7, 0 + mov r1, r10 + ldr r6, [r1, 0x70] + ldr r2, [sp, 0x1C] + ldrh r0, [r2, 0x2] + bl sub_800ED20 + movs r1, 0x2 + str r1, [sp, 0x44] + cmp r0, 0x1 + beq _08056736 + movs r2, 0x6 + str r2, [sp, 0x44] + cmp r0, 0x2 + bne _08056736 + movs r0, 0x3 + str r0, [sp, 0x44] +_08056736: + mov r1, r10 + ldrh r0, [r1, 0x6] + lsls r0, 16 + ldrh r3, [r1, 0x4] + orrs r3, r0 + str r3, [sp, 0xC] + ldr r1, _08056814 + adds r2, r6, 0 + adds r2, 0x46 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + movs r1, 0 + ldrsh r6, [r0, r1] + str r6, [sp, 0x28] + movs r1, 0x2 + ldrsh r6, [r0, r1] + str r6, [sp, 0x2C] + movs r6, 0 + str r6, [sp, 0x30] + mov r8, r2 + ldr r0, [sp, 0x20] + cmp r6, r0 + bge _080567EC + add r0, sp, 0xC + movs r2, 0 + ldrsh r1, [r0, r2] + cmp r1, 0 + blt _080567EC + asrs r0, r3, 16 + cmp r0, 0 + blt _080567EC + cmp r1, 0x37 + bgt _080567EC + cmp r0, 0x1F + bgt _080567EC + add r6, sp, 0xC +_08056780: + ldrh r0, [r6] + ldr r1, [sp, 0x28] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + ldr r2, _08056818 + ands r2, r3 + orrs r2, r0 + asrs r0, r2, 16 + ldr r1, [sp, 0x2C] + adds r0, r1 + lsls r0, 16 + ldr r1, _0805681C + ands r1, r2 + orrs r1, r0 + str r1, [sp, 0xC] + adds r7, 0x1 + movs r2, 0 + ldrsh r0, [r6, r2] + asrs r1, 16 + bl sub_804954C + adds r2, r0, 0 + ldrh r1, [r2] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _080567EC + ldr r0, [r2, 0x10] + cmp r0, 0 + beq _080567C6 + bl sub_80450F8 + cmp r0, 0x1 + beq _080567EC +_080567C6: + ldr r0, [sp, 0x30] + adds r0, 0x1 + str r0, [sp, 0x30] + ldr r1, [sp, 0x20] + cmp r0, r1 + bge _080567EC + movs r0, 0 + ldrsh r2, [r6, r0] + cmp r2, 0 + blt _080567EC + ldr r0, [sp, 0xC] + asrs r1, r0, 16 + adds r3, r0, 0 + cmp r1, 0 + blt _080567EC + cmp r2, 0x37 + bgt _080567EC + cmp r1, 0x1F + ble _08056780 +_080567EC: + ldr r2, [sp, 0x1C] + ldrh r1, [r2, 0x2] + mov r0, r10 + bl sub_805755C + lsls r0, 24 + cmp r0, 0 + beq _08056820 + mov r0, r10 + ldr r1, [sp, 0x1C] + bl sub_80570AC + lsls r0, 24 + cmp r0, 0 + bne _08056820 + movs r6, 0x1 + negs r6, r6 + str r6, [sp, 0x40] + b _0805682E + .align 2, 0 +_08056814: .4byte gUnknown_80F4448 +_08056818: .4byte 0xffff0000 +_0805681C: .4byte 0x0000ffff +_08056820: + mov r0, r10 + add r1, sp, 0xC + ldr r2, [sp, 0x1C] + ldr r3, [sp, 0x20] + bl sub_8056564 + str r0, [sp, 0x40] +_0805682E: + mov r0, r10 + ldrh r1, [r0, 0x4] + add r0, sp, 0xC + strh r1, [r0] + mov r2, r10 + ldrh r1, [r2, 0x6] + strh r1, [r0, 0x2] + ldr r1, _08056874 + mov r6, r8 + ldrb r0, [r6] + lsls r0, 2 + adds r0, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + str r1, [sp, 0x28] + movs r1, 0x2 + ldrsh r6, [r0, r1] + str r6, [sp, 0x2C] + movs r0, 0x18 + ldr r1, [sp, 0x44] + bl __divsi3 + adds r1, r7, 0 + muls r1, r0 + ldr r2, [sp, 0x20] + cmp r2, 0x1 + ble _08056878 + adds r6, r1, 0 + adds r6, 0x8 + str r6, [sp, 0x38] + cmp r6, 0x3F + ble _0805687C + movs r0, 0x40 + str r0, [sp, 0x38] + b _0805687C + .align 2, 0 +_08056874: .4byte gUnknown_80F4448 +_08056878: + movs r2, 0x20 + str r2, [sp, 0x38] +_0805687C: + movs r6, 0 + mov r9, r6 + movs r0, 0x80 + lsls r0, 12 + bl __divsi3 + str r0, [sp, 0x48] + ldr r1, _0805696C + mov r2, r8 + ldrb r0, [r2] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [sp, 0x3C] + ldr r0, _08056970 + ldr r0, [r0] + ldr r6, _08056974 + adds r0, r6 + movs r1, 0x1 + strb r1, [r0] + movs r0, 0 + str r0, [sp, 0x30] + ldr r1, [sp, 0x20] + cmp r0, r1 + blt _080568B0 + b _08056AB6 +_080568B0: + add r0, sp, 0xC + movs r2, 0 + ldrsh r1, [r0, r2] + cmp r1, 0 + bge _080568BC + b _08056AB6 +_080568BC: + ldrh r0, [r0, 0x2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _080568C8 + b _08056AB6 +_080568C8: + cmp r1, 0x37 + ble _080568CE + b _08056AB6 +_080568CE: + cmp r0, 0x1F + ble _080568D4 + b _08056AB6 +_080568D4: + add r7, sp, 0xC +_080568D6: + ldr r6, [sp, 0xC] + ldrh r0, [r7] + ldr r1, [sp, 0x28] + adds r0, r1 + strh r0, [r7] + ldrh r0, [r7, 0x2] + ldr r2, [sp, 0x2C] + adds r0, r2 + strh r0, [r7, 0x2] + add r0, sp, 0xC + bl sub_803F428 + lsls r0, 24 + cmp r0, 0 + bne _080568F6 + b _08056A00 +_080568F6: + ldr r0, _08056970 + ldr r0, [r0] + ldr r1, _08056978 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08056906 + b _08056A00 +_08056906: + lsls r1, r6, 16 + asrs r1, 16 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 11 + movs r2, 0xC0 + lsls r2, 4 + adds r4, r0, r2 + asrs r1, r6, 16 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 11 + movs r6, 0x80 + lsls r6, 5 + adds r5, r0, r6 + ldr r1, [sp, 0x28] + lsls r0, r1, 8 + ldr r6, [sp, 0x44] + adds r2, r6, 0 + muls r2, r0 + str r2, [sp, 0x4C] + ldr r1, [sp, 0x2C] + lsls r0, r1, 8 + adds r2, r6, 0 + muls r2, r0 + str r2, [sp, 0x50] + movs r6, 0 + movs r0, 0x18 + ldr r1, [sp, 0x44] + bl __divsi3 + mov r8, r0 + cmp r6, r8 + bge _08056A0E +_0805694A: + ldr r0, [sp, 0x40] + cmp r0, 0 + blt _080569D4 + ldr r1, [sp, 0x24] + cmp r1, 0 + beq _0805697C + mov r0, r9 + cmp r0, 0 + bge _0805695E + adds r0, 0xFF +_0805695E: + asrs r0, 8 + bl sub_8009C7C + ldr r2, [sp, 0x38] + adds r3, r0, 0 + muls r3, r2 + b _0805697E + .align 2, 0 +_0805696C: .4byte gUnknown_81069D4 +_08056970: .4byte gUnknown_203B418 +_08056974: .4byte 0x0001c05e +_08056978: .4byte 0x0001820a +_0805697C: + movs r3, 0 +_0805697E: + adds r0, r4, 0 + cmp r4, 0 + bge _08056986 + adds r0, 0xFF +_08056986: + lsls r0, 8 + lsrs r0, 16 + ldr r1, _080569F0 + ldr r2, [sp, 0x10] + ands r2, r1 + orrs r2, r0 + str r2, [sp, 0x10] + subs r0, r5, r3 + cmp r0, 0 + bge _0805699C + adds r0, 0xFF +_0805699C: + lsls r0, 8 + lsrs r0, 16 + lsls r0, 16 + ldr r1, _080569F4 + ands r2, r1 + orrs r2, r0 + str r2, [sp, 0x10] + adds r2, r5, 0 + cmp r2, 0 + bge _080569B2 + adds r2, 0xFF +_080569B2: + asrs r2, 8 + ldr r0, _080569F8 + ldr r0, [r0] + ldr r1, _080569FC + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + subs r2, r0 + lsrs r0, r2, 31 + adds r2, r0 + asrs r2, 1 + ldr r0, [sp, 0x3C] + adds r2, r0 + ldr r0, [sp, 0x40] + add r1, sp, 0x10 + bl sub_800E3AC +_080569D4: + movs r0, 0x30 + bl sub_803E46C + ldr r1, [sp, 0x4C] + adds r4, r1 + ldr r2, [sp, 0x50] + adds r5, r2 + ldr r0, [sp, 0x48] + add r9, r0 + adds r6, 0x1 + cmp r6, r8 + blt _0805694A + b _08056A0E + .align 2, 0 +_080569F0: .4byte 0xffff0000 +_080569F4: .4byte 0x0000ffff +_080569F8: .4byte gUnknown_203B418 +_080569FC: .4byte 0x000181f2 +_08056A00: + movs r0, 0x18 + ldr r1, [sp, 0x44] + bl __divsi3 + ldr r1, [sp, 0x48] + muls r0, r1 + add r9, r0 +_08056A0E: + movs r2, 0 + ldrsh r0, [r7, r2] + movs r6, 0x2 + ldrsh r1, [r7, r6] + bl sub_804954C + adds r6, r0, 0 + ldrh r1, [r6] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _08056AB6 + ldr r0, [r6, 0x10] + cmp r0, 0 + beq _08056A8E + bl sub_80450F8 + cmp r0, 0x1 + bne _08056A8E + ldr r0, [r6, 0x10] + ldr r1, [sp, 0x1C] + bl sub_80571F0 + lsls r0, 24 + cmp r0, 0 + bne _08056A8E + ldr r0, [sp, 0x34] + cmp r0, 0 + bgt _08056AB6 + movs r4, 0 + mov r2, r10 + ldr r1, [r2, 0x70] + adds r0, r1, 0 + adds r0, 0xBC + ldrb r2, [r0] + cmp r2, 0x2 + beq _08056A64 + adds r0, 0x2C + ldrb r0, [r0] + cmp r0, 0x1 + beq _08056A64 + cmp r2, 0x4 + bne _08056A66 +_08056A64: + movs r4, 0x1 +_08056A66: + mov r0, r10 + ldr r1, [sp, 0x1C] + movs r2, 0 + bl sub_807CD64 + adds r2, r0, 0 + lsls r2, 16 + asrs r2, 16 + ldr r0, [r6, 0x10] + str r0, [sp] + ldr r6, [sp, 0x1C] + str r6, [sp, 0x4] + str r4, [sp, 0x8] + ldr r0, [sp, 0x34] + add r1, sp, 0x14 + mov r3, r10 + bl sub_8056F80 + str r0, [sp, 0x34] + b _08056AB6 +_08056A8E: + ldr r0, [sp, 0x30] + adds r0, 0x1 + str r0, [sp, 0x30] + ldr r1, [sp, 0x20] + cmp r0, r1 + bge _08056AB6 + movs r2, 0 + ldrsh r1, [r7, r2] + cmp r1, 0 + blt _08056AB6 + ldrh r0, [r7, 0x2] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + blt _08056AB6 + cmp r1, 0x37 + bgt _08056AB6 + cmp r0, 0x1F + bgt _08056AB6 + b _080568D6 +_08056AB6: + ldr r6, [sp, 0x40] + cmp r6, 0 + blt _08056AC2 + adds r0, r6, 0 + bl sub_800DC14 +_08056AC2: + movs r0, 0x1 + bl sub_804178C + ldr r0, _08056AF4 + ldr r0, [r0] + ldr r1, _08056AF8 + adds r0, r1 + movs r2, 0 + strb r2, [r0] + ldr r6, [sp, 0x34] + cmp r6, 0 + ble _08056AFC + lsls r1, r6, 2 + add r0, sp, 0x14 + adds r1, r0 + str r2, [r1] + ldr r1, [sp, 0x78] + str r1, [sp] + mov r1, r10 + ldr r2, [sp, 0x1C] + ldr r3, [sp, 0x74] + bl sub_8053704 + b _08056B22 + .align 2, 0 +_08056AF4: .4byte gUnknown_203B418 +_08056AF8: .4byte 0x0001c05e +_08056AFC: + ldr r0, [sp, 0x20] + cmp r0, 0x1 + bne _08056B22 + add r0, sp, 0xC + bl sub_803F428 + lsls r0, 24 + cmp r0, 0 + beq _08056B22 + movs r0, 0x1 + movs r1, 0x4A + bl sub_803E708 + mov r0, r10 + movs r1, 0 + ldr r2, [sp, 0x1C] + add r3, sp, 0xC + bl sub_8041168 +_08056B22: + add sp, 0x54 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80566F8 + + thumb_func_start sub_8056B34 +sub_8056B34: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r7, r0, 0 + adds r6, r1, 0 + mov r8, r2 + adds r1, r3, 0 + ldr r4, [sp, 0x24] + lsls r4, 24 + lsrs r4, 24 + mov r0, r8 + bl sub_8092BD8 + adds r5, r0, 0 + movs r0, 0x64 + bl sub_8084100 + str r0, [sp] + ldr r0, [r7, 0x70] + mov r9, r0 + ldr r1, [r6, 0x70] + mov r10, r1 + cmp r4, 0 + beq _08056B70 + cmp r7, r6 + bne _08056B70 + b _08056CD4 +_08056B70: + mov r0, r8 + ldrh r1, [r0, 0x2] + ldr r0, _08056CC4 + cmp r1, r0 + bne _08056B8A + adds r0, r7, 0 + movs r1, 0x4 + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _08056B8A + b _08056CD4 +_08056B8A: + mov r0, r9 + adds r0, 0xDC + ldrb r0, [r0] + cmp r0, 0x1 + bne _08056B96 + b _08056CD4 +_08056B96: + cmp r0, 0x2 + bne _08056B9C + b _08056CBE +_08056B9C: + cmp r5, 0x64 + ble _08056BA2 + b _08056CD4 +_08056BA2: + adds r0, r6, 0 + movs r1, 0x23 + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _08056BB6 + ldr r0, _08056CC8 + ldr r0, [r0] + subs r5, r0 +_08056BB6: + adds r0, r6, 0 + movs r1, 0x5 + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _08056BCA + ldr r0, _08056CCC + ldr r0, [r0] + subs r5, r0 +_08056BCA: + mov r1, r9 + movs r0, 0x24 + ldrsh r4, [r1, r0] + adds r0, r7, 0 + movs r1, 0x33 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _08056BE0 + adds r4, 0x2 +_08056BE0: + mov r1, r8 + ldrh r0, [r1, 0x2] + cmp r0, 0x40 + bne _08056BFC + adds r0, r7, 0 + bl sub_807E580 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + beq _08056CD4 + cmp r0, 0x1 + bne _08056BFC + subs r4, 0x2 +_08056BFC: + cmp r4, 0 + bge _08056C02 + movs r4, 0 +_08056C02: + cmp r4, 0x14 + ble _08056C08 + movs r4, 0x14 +_08056C08: + ldr r1, _08056CD0 + lsls r0, r4, 2 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + bge _08056C16 + movs r0, 0 +_08056C16: + movs r1, 0xC8 + lsls r1, 7 + cmp r0, r1 + ble _08056C20 + adds r0, r1, 0 +_08056C20: + muls r5, r0 + adds r0, r5, 0 + cmp r5, 0 + bge _08056C2A + adds r0, 0xFF +_08056C2A: + asrs r5, r0, 8 + mov r0, r10 + movs r1, 0x26 + ldrsh r4, [r0, r1] + adds r0, 0xF5 + ldrb r0, [r0] + cmp r0, 0 + beq _08056C3C + movs r4, 0xA +_08056C3C: + adds r0, r6, 0 + bl sub_807E580 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08056C5A + adds r0, r6, 0 + movs r1, 0x1D + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _08056C5A + adds r4, 0x2 +_08056C5A: + adds r0, r7, 0 + movs r1, 0x30 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _08056C86 + mov r0, r8 + bl sub_8092B00 + lsls r0, 24 + lsrs r0, 24 + bl sub_8092354 + movs r1, 0 + lsls r0, 24 + cmp r0, 0 + bne _08056C80 + movs r1, 0x1 +_08056C80: + cmp r1, 0 + bne _08056C86 + adds r4, 0x2 +_08056C86: + cmp r4, 0 + bge _08056C8C + movs r4, 0 +_08056C8C: + cmp r4, 0x14 + ble _08056C92 + movs r4, 0x14 +_08056C92: + ldr r0, _08056CD0 + lsls r1, r4, 2 + adds r0, 0x54 + adds r1, r0 + ldr r0, [r1] + cmp r0, 0 + bge _08056CA2 + movs r0, 0 +_08056CA2: + movs r1, 0xC8 + lsls r1, 7 + cmp r0, r1 + ble _08056CAC + adds r0, r1, 0 +_08056CAC: + muls r5, r0 + adds r0, r5, 0 + cmp r5, 0 + bge _08056CB6 + adds r0, 0xFF +_08056CB6: + asrs r5, r0, 8 + ldr r0, [sp] + cmp r0, r5 + blt _08056CD4 +_08056CBE: + movs r0, 0 + b _08056CD6 + .align 2, 0 +_08056CC4: .4byte 0x00000163 +_08056CC8: .4byte gUnknown_80F519C +_08056CCC: .4byte gUnknown_80F51A0 +_08056CD0: .4byte gUnknown_80F50F4 +_08056CD4: + movs r0, 0x1 +_08056CD6: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8056B34 + + thumb_func_start sub_8056CE8 +sub_8056CE8: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + str r0, [sp, 0x10] + adds r5, r1, 0 + mov r8, r2 + movs r0, 0 + mov r9, r0 + movs r3, 0 + ldr r1, [r5, 0x70] + adds r0, r1, 0 + adds r0, 0xBC + ldrb r2, [r0] + cmp r2, 0x2 + beq _08056D18 + adds r0, 0x2C + ldrb r0, [r0] + cmp r0, 0x1 + beq _08056D18 + cmp r2, 0x4 + bne _08056D1A +_08056D18: + movs r3, 0x1 +_08056D1A: + mov r10, r3 + movs r1, 0 + ldr r0, [r5, 0x70] + adds r0, 0xBC + ldrb r0, [r0] + cmp r0, 0x2 + beq _08056D2C + cmp r0, 0x4 + bne _08056D2E +_08056D2C: + movs r1, 0x1 +_08056D2E: + str r1, [sp, 0x14] + adds r0, r5, 0 + movs r1, 0x7 + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _08056D44 + movs r1, 0 + str r1, [sp, 0x14] + mov r10, r1 +_08056D44: + adds r0, r5, 0 + mov r1, r8 + movs r2, 0 + bl sub_807CD64 + lsls r0, 16 + asrs r7, r0, 16 + movs r0, 0xF + ands r0, r7 + cmp r0, 0x4 + bne _08056D86 + adds r0, r5, 0 + mov r1, r8 + bl sub_80570AC + lsls r0, 24 + lsrs r4, r0, 24 + mov r2, r8 + ldrh r0, [r2, 0x2] + cmp r0, 0x97 + bne _08056D7E + adds r0, r5, 0 + bl sub_807E580 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08056D7E + movs r4, 0x1 +_08056D7E: + movs r7, 0x73 + cmp r4, 0 + beq _08056D86 + movs r7, 0 +_08056D86: + movs r1, 0xF0 + ands r1, r7 + cmp r1, 0 + bne _08056DA6 + adds r0, r5, 0 + bl sub_80696A8 + cmp r0, 0 + bne _08056D9A + b _08056F64 +_08056D9A: + str r0, [sp] + mov r0, r8 + str r0, [sp, 0x4] + mov r1, r10 + str r1, [sp, 0x8] + b _08056F56 +_08056DA6: + cmp r1, 0x10 + beq _08056DAE + cmp r1, 0x20 + bne _08056E34 +_08056DAE: + ldr r0, [r5, 0x70] + cmp r1, 0x20 + bne _08056DBC + adds r0, 0x46 + ldrb r4, [r0] + movs r0, 0x8 + b _08056DCA +_08056DBC: + adds r0, 0x46 + ldrb r0, [r0] + subs r4, r0, 0x1 + movs r0, 0x3 + cmp r0, 0 + bne _08056DCA + b _08056F64 +_08056DCA: + adds r6, r0, 0 +_08056DCC: + movs r0, 0x7 + ands r4, r0 + ldr r0, _08056E28 + lsls r3, r4, 2 + adds r3, r0 + ldrh r0, [r3] + ldrh r2, [r5, 0x4] + adds r0, r2 + lsls r0, 16 + lsrs r0, 16 + ldr r2, _08056E2C + ldr r1, [sp, 0xC] + ands r1, r2 + orrs r1, r0 + str r1, [sp, 0xC] + ldrh r2, [r3, 0x2] + ldrh r0, [r5, 0x6] + adds r2, r0 + lsls r2, 16 + ldr r0, _08056E30 + ands r1, r0 + orrs r1, r2 + str r1, [sp, 0xC] + add r0, sp, 0xC + bl sub_804AD0C + cmp r0, 0 + beq _08056E1C + str r0, [sp] + mov r1, r8 + str r1, [sp, 0x4] + mov r2, r10 + str r2, [sp, 0x8] + mov r0, r9 + ldr r1, [sp, 0x10] + adds r2, r7, 0 + adds r3, r5, 0 + bl sub_8056F80 + mov r9, r0 +_08056E1C: + subs r6, 0x1 + adds r4, 0x1 + cmp r6, 0 + bne _08056DCC + b _08056F64 + .align 2, 0 +_08056E28: .4byte gUnknown_80F4448 +_08056E2C: .4byte 0xffff0000 +_08056E30: .4byte 0x0000ffff +_08056E34: + cmp r1, 0x30 + bne _08056E9C + movs r6, 0 +_08056E3A: + ldr r0, _08056E74 + ldr r0, [r0] + lsls r1, r6, 2 + ldr r2, _08056E78 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08056E94 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8045A70 + lsls r0, 24 + cmp r0, 0 + beq _08056E94 + cmp r4, r5 + bne _08056E7C + str r5, [sp] + mov r0, r8 + str r0, [sp, 0x4] + ldr r1, [sp, 0x14] + str r1, [sp, 0x8] + b _08056E86 + .align 2, 0 +_08056E74: .4byte gUnknown_203B418 +_08056E78: .4byte 0x000135cc +_08056E7C: + str r4, [sp] + mov r2, r8 + str r2, [sp, 0x4] + mov r0, r10 + str r0, [sp, 0x8] +_08056E86: + mov r0, r9 + ldr r1, [sp, 0x10] + adds r2, r7, 0 + adds r3, r5, 0 + bl sub_8056F80 + mov r9, r0 +_08056E94: + adds r6, 0x1 + cmp r6, 0x13 + ble _08056E3A + b _08056F64 +_08056E9C: + cmp r1, 0x40 + bne _08056EEA + movs r4, 0 + adds r0, r5, 0 + bl sub_80696FC + cmp r0, 0 + beq _08056ED0 + mov r4, r9 + str r0, [sp] + mov r1, r8 + str r1, [sp, 0x4] + mov r2, r10 + str r2, [sp, 0x8] + adds r0, r4, 0 + ldr r1, [sp, 0x10] + adds r2, r7, 0 + adds r3, r5, 0 + bl sub_8056F80 + mov r9, r0 + mov r1, r9 + eors r1, r4 + negs r0, r1 + orrs r0, r1 + lsrs r4, r0, 31 +_08056ED0: + cmp r4, 0 + bne _08056F64 + adds r0, r5, 0 + bl sub_806977C + cmp r0, 0 + beq _08056F64 + str r0, [sp] + mov r0, r8 + str r0, [sp, 0x4] + mov r1, r10 + str r1, [sp, 0x8] + b _08056F56 +_08056EEA: + cmp r1, 0x50 + beq _08056F64 + cmp r1, 0x80 + bne _08056F00 + adds r0, r5, 0 + bl sub_80696FC + cmp r0, 0 + beq _08056F64 + str r0, [sp] + b _08056F4E +_08056F00: + cmp r1, 0x60 + bne _08056F48 + movs r6, 0 +_08056F06: + ldr r0, _08056F40 + ldr r0, [r0] + lsls r1, r6, 2 + ldr r2, _08056F44 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08056F38 + str r4, [sp] + mov r0, r8 + str r0, [sp, 0x4] + mov r1, r10 + str r1, [sp, 0x8] + mov r0, r9 + ldr r1, [sp, 0x10] + adds r2, r7, 0 + adds r3, r5, 0 + bl sub_8056F80 + mov r9, r0 +_08056F38: + adds r6, 0x1 + cmp r6, 0x13 + ble _08056F06 + b _08056F64 + .align 2, 0 +_08056F40: .4byte gUnknown_203B418 +_08056F44: .4byte 0x000135cc +_08056F48: + cmp r1, 0x70 + bne _08056F64 + str r5, [sp] +_08056F4E: + mov r2, r8 + str r2, [sp, 0x4] + mov r0, r10 + str r0, [sp, 0x8] +_08056F56: + mov r0, r9 + ldr r1, [sp, 0x10] + adds r2, r7, 0 + adds r3, r5, 0 + bl sub_8056F80 + mov r9, r0 +_08056F64: + mov r1, r9 + lsls r0, r1, 2 + ldr r2, [sp, 0x10] + adds r0, r2 + movs r1, 0 + str r1, [r0] + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8056CE8 + + thumb_func_start sub_8056F80 +sub_8056F80: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + mov r8, r1 + adds r4, r3, 0 + ldr r7, [sp, 0x18] + ldr r0, [sp, 0x20] + lsls r2, 16 + asrs r2, 16 + lsls r0, 24 + lsrs r0, 24 + mov r12, r0 + movs r6, 0 + ldr r1, [r7, 0x70] + ldr r3, [sp, 0x1C] + ldrh r0, [r3, 0x2] + cmp r0, 0xFC + bne _08056FAA + cmp r4, r7 + beq _08057060 +_08056FAA: + ldrb r0, [r1, 0x8] + cmp r0, 0x1 + beq _08057060 + adds r0, r1, 0 + adds r0, 0xA4 + ldrb r0, [r0] + cmp r0, 0x4 + beq _08057060 + cmp r0, 0x1 + beq _08057060 + mov r0, r12 + cmp r0, 0 + bne _0805702C + movs r0, 0xF + ands r0, r2 + cmp r0, 0 + beq _08056FD0 + cmp r0, 0x4 + bne _08056FE6 +_08056FD0: + adds r0, r4, 0 + adds r1, r7, 0 + movs r2, 0x1 + movs r3, 0 + bl sub_8071598 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0805702E + b _0805702C +_08056FE6: + cmp r0, 0x1 + bne _08056FFE + adds r0, r4, 0 + adds r1, r7, 0 + movs r2, 0x1 + movs r3, 0 + bl sub_8071598 + lsls r0, 24 + cmp r0, 0 + bne _0805702E + b _0805702C +_08056FFE: + cmp r0, 0x2 + beq _0805702C + cmp r0, 0x5 + bne _0805700C + cmp r4, r7 + beq _0805702E + b _0805702C +_0805700C: + cmp r0, 0x6 + bne _08057028 + adds r0, r4, 0 + adds r1, r7, 0 + movs r2, 0x1 + movs r3, 0 + bl sub_8071598 + lsls r0, 24 + cmp r0, 0 + bne _0805702E + cmp r4, r7 + beq _0805702E + b _0805702C +_08057028: + cmp r0, 0x3 + bne _0805702E +_0805702C: + movs r6, 0x1 +_0805702E: + adds r0, r7, 0 + ldr r1, [sp, 0x1C] + bl sub_80571F0 + lsls r0, 24 + cmp r0, 0 + beq _0805703E + movs r6, 0 +_0805703E: + cmp r6, 0 + beq _08057060 + cmp r5, 0x3F + bgt _08057060 + lsls r0, r5, 2 + add r0, r8 + str r7, [r0] + ldr r0, [r7, 0x70] + ldrb r0, [r0, 0x6] + cmp r0, 0 + bne _0805705E + ldr r1, _0805706C + ldr r0, [r1] + cmp r0, 0 + bne _0805705E + str r7, [r1] +_0805705E: + adds r5, 0x1 +_08057060: + adds r0, r5, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805706C: .4byte gUnknown_203B438 + thumb_func_end sub_8056F80 + + thumb_func_start sub_8057070 +sub_8057070: + push {lr} + bl sub_8092BA8 + cmp r0, 0 + bne _08057082 + movs r0, 0x2 + movs r1, 0x6 + bl sub_808411C +_08057082: + pop {r1} + bx r1 + thumb_func_end sub_8057070 + + thumb_func_start sub_8057088 +sub_8057088: + push {lr} + ldrh r1, [r0, 0x2] + cmp r1, 0xEE + beq _080570A4 + cmp r1, 0xEF + beq _080570A4 + cmp r1, 0xF2 + beq _080570A4 + movs r0, 0x88 + lsls r0, 1 + cmp r1, r0 + beq _080570A4 + movs r0, 0 + b _080570A6 +_080570A4: + movs r0, 0x1 +_080570A6: + pop {r1} + bx r1 + thumb_func_end sub_8057088 + + thumb_func_start sub_80570AC +sub_80570AC: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _080570C2 + b _080570E8 +_080570BE: + movs r0, 0x1 + b _080570EA +_080570C2: + ldr r0, [r4, 0x70] + movs r3, 0 + ldr r2, _080570F0 + adds r4, r0, 0 + adds r4, 0xC0 +_080570CC: + ldrh r1, [r2] + cmp r1, 0 + beq _080570E8 + ldrh r0, [r5, 0x2] + cmp r0, r1 + bne _080570E0 + ldrb r0, [r4] + ldrb r1, [r2, 0x2] + cmp r0, r1 + beq _080570BE +_080570E0: + adds r2, 0x4 + adds r3, 0x1 + cmp r3, 0x63 + ble _080570CC +_080570E8: + movs r0, 0 +_080570EA: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080570F0: .4byte gUnknown_81069F4 + thumb_func_end sub_80570AC + + thumb_func_start sub_80570F4 +sub_80570F4: + push {r4-r7,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r7, r1, 24 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0805713C + ldr r3, [r4, 0x70] + movs r4, 0 + adds r6, r3, 0 + adds r6, 0xC0 + ldr r2, _08057138 +_08057110: + ldrb r1, [r2] + cmp r1, 0 + beq _0805713C + ldrb r0, [r6] + adds r5, r3, 0 + adds r5, 0xC0 + cmp r0, r1 + beq _08057132 + adds r2, 0x4 + adds r4, 0x1 + cmp r4, 0x63 + ble _08057110 + cmp r7, 0 + beq _0805713C + ldrb r0, [r5] + cmp r0, 0xB + bne _0805713C +_08057132: + movs r0, 0x1 + b _0805713E + .align 2, 0 +_08057138: .4byte gUnknown_8106A1C +_0805713C: + movs r0, 0 +_0805713E: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80570F4 + + thumb_func_start sub_8057144 +sub_8057144: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x144 + mov r9, r0 + movs r7, 0 + movs r5, 0 +_08057154: + ldr r0, _080571D4 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _080571D8 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + adds r5, 0x1 + mov r8, r5 + cmp r0, 0 + beq _080571B8 + ldr r0, [r4, 0x70] + movs r1, 0x8C + lsls r1, 1 + adds r5, r0, r1 + adds r4, r5, 0 + lsls r0, r7, 2 + mov r1, sp + adds r2, r0, r1 + movs r6, 0x3 +_08057184: + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080571AE + ldrh r1, [r4, 0x2] + mov r0, r9 + str r2, [sp, 0x140] + bl sub_805755C + lsls r0, 24 + ldr r2, [sp, 0x140] + cmp r0, 0 + bne _080571AE + ldrh r0, [r4, 0x2] + cmp r0, 0x8A + beq _080571AE + cmp r7, 0x4F + bgt _080571AE + stm r2!, {r5} + adds r7, 0x1 +_080571AE: + adds r4, 0x8 + adds r5, 0x8 + subs r6, 0x1 + cmp r6, 0 + bge _08057184 +_080571B8: + mov r5, r8 + cmp r5, 0x13 + ble _08057154 + cmp r7, 0 + beq _080571DC + adds r0, r7, 0 + bl sub_8084100 + lsls r0, 2 + add r0, sp + ldr r0, [r0] + ldrh r0, [r0, 0x2] + b _080571DE + .align 2, 0 +_080571D4: .4byte gUnknown_203B418 +_080571D8: .4byte 0x000135cc +_080571DC: + ldr r0, _080571EC +_080571DE: + add sp, 0x144 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080571EC: .4byte 0x00000163 + thumb_func_end sub_8057144 + + thumb_func_start sub_80571F0 +sub_80571F0: + push {lr} + ldr r0, [r0, 0x70] + adds r2, r0, 0 + adds r2, 0xFF + ldrb r2, [r2] + cmp r2, 0x1 + bne _08057212 + ldrh r1, [r1, 0x2] + cmp r1, 0x88 + beq _08057274 + cmp r1, 0xA2 + beq _08057274 + cmp r1, 0x39 + beq _08057274 + cmp r1, 0x40 + beq _08057274 + b _08057264 +_08057212: + cmp r2, 0x2 + bne _08057274 + adds r0, 0xC0 + ldrb r0, [r0] + cmp r0, 0x9 + bne _0805722A + ldrh r1, [r1, 0x2] + cmp r1, 0x20 + beq _08057274 + cmp r1, 0xDB + bne _08057264 + b _08057274 +_0805722A: + cmp r0, 0xA + bne _08057264 + ldrh r1, [r1, 0x2] + cmp r1, 0x76 + beq _08057274 + movs r0, 0x94 + lsls r0, 1 + cmp r1, r0 + beq _08057274 + cmp r1, 0x77 + bne _08057264 + ldr r0, _08057268 + ldr r0, [r0] + ldr r1, _0805726C + adds r0, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + cmp r1, 0 + bge _08057252 + movs r1, 0 +_08057252: + cmp r1, 0x4A + ble _08057258 + movs r1, 0x4A +_08057258: + ldr r0, _08057270 + lsls r1, 3 + adds r1, r0 + ldrh r0, [r1] + cmp r0, 0x76 + beq _08057274 +_08057264: + movs r0, 0x1 + b _08057276 + .align 2, 0 +_08057268: .4byte gUnknown_203B418 +_0805726C: .4byte 0x00003a0e +_08057270: .4byte gUnknown_80F5D10 +_08057274: + movs r0, 0 +_08057276: + pop {r1} + bx r1 + thumb_func_end sub_80571F0 + + thumb_func_start sub_805727C +sub_805727C: + push {r4-r6,lr} + adds r6, r0, 0 + adds r5, r1, 0 + adds r4, r2, 0 + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _080572FC + adds r0, r6, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080572FC + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080572FC + ldr r1, [r5, 0x70] + movs r2, 0xAC + lsls r2, 1 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080572FC + movs r2, 0xE + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _080572FC + cmp r4, 0 + beq _080572DE + adds r0, r6, 0 + movs r1, 0x26 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _080572D2 + lsls r0, r4, 1 + b _080572D4 +_080572D2: + adds r0, r4, 0 +_080572D4: + bl sub_8084160 + lsls r0, 24 + lsrs r4, r0, 24 + b _080572E0 +_080572DE: + movs r4, 0x1 +_080572E0: + cmp r4, 0 + beq _08057300 + cmp r6, r5 + beq _08057300 + adds r0, r5, 0 + movs r1, 0x4C + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _08057300 + adds r0, r5, 0 + bl sub_80429C8 +_080572FC: + movs r0, 0 + b _08057302 +_08057300: + adds r0, r4, 0 +_08057302: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_805727C + + thumb_func_start sub_8057308 +sub_8057308: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _0805731C + movs r0, 0 + b _08057340 +_0805731C: + cmp r4, 0 + bne _08057324 + movs r0, 0x1 + b _08057340 +_08057324: + adds r0, r5, 0 + movs r1, 0x26 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + bne _08057336 + adds r0, r4, 0 + b _08057338 +_08057336: + lsls r0, r4, 1 +_08057338: + bl sub_8084160 + lsls r0, 24 + lsrs r0, 24 +_08057340: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8057308 + + thumb_func_start sub_8057348 +sub_8057348: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + ldr r6, [r7, 0x70] + lsls r1, 3 + movs r0, 0x8C + lsls r0, 1 + adds r1, r0 + adds r4, r6, r1 + ldrb r1, [r4] + movs r2, 0x1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _080573BE + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080573BE + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _080573BE + ldrb r1, [r4, 0x1] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _0805738E + b _080573BE +_0805738A: + movs r0, 0x1 + b _080573C0 +_0805738E: + movs r5, 0 + b _08057394 +_08057392: + adds r5, 0x1 +_08057394: + cmp r5, 0x3 + bgt _080573BE + adds r0, r7, 0 + adds r1, r4, 0 + mov r2, r8 + bl sub_80573CC + lsls r0, 24 + cmp r0, 0 + bne _0805738A + adds r4, 0x8 + movs r1, 0x9C + lsls r1, 1 + adds r0, r6, r1 + cmp r4, r0 + bcs _080573BE + ldrb r1, [r4] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08057392 +_080573BE: + movs r0, 0 +_080573C0: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8057348 + + thumb_func_start sub_80573CC +sub_80573CC: + push {r4-r6,lr} + adds r4, r1, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r6, [r0, 0x70] + ldrh r1, [r4, 0x2] + ldr r0, _08057430 + cmp r1, r0 + beq _08057442 + ldrb r1, [r4] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _0805743E + ldrb r1, [r4, 0x1] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0805743E + cmp r2, 0 + beq _08057442 + ldrb r0, [r4, 0x4] + cmp r0, 0 + beq _0805743E + adds r0, r6, 0 + adds r0, 0xBC + ldrb r1, [r0] + adds r5, r0, 0 + cmp r1, 0x5 + bne _08057414 + adds r0, r4, 0 + bl sub_8092C54 + lsls r0, 24 + cmp r0, 0 + beq _0805743E +_08057414: + ldrb r0, [r5] + cmp r0, 0x6 + bne _08057442 + ldrh r1, [r4, 0x2] + movs r0, 0xB0 + lsls r0, 1 + cmp r1, r0 + bne _08057434 + movs r1, 0x9C + lsls r1, 1 + adds r0, r6, r1 + ldrb r1, [r0] + b _08057436 + .align 2, 0 +_08057430: .4byte 0x00000163 +_08057434: + ldrb r1, [r4] +_08057436: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _08057442 +_0805743E: + movs r0, 0 + b _08057444 +_08057442: + movs r0, 0x1 +_08057444: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80573CC + + thumb_func_start sub_805744C +sub_805744C: + push {r4-r6,lr} + adds r4, r1, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r6, [r0, 0x70] + ldrh r1, [r4, 0x2] + ldr r0, _080574A8 + cmp r1, r0 + beq _080574BA + ldrb r1, [r4] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _080574B6 + ldrb r1, [r4, 0x1] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080574B6 + cmp r2, 0 + beq _080574BA + adds r0, r6, 0 + adds r0, 0xBC + ldrb r1, [r0] + adds r5, r0, 0 + cmp r1, 0x5 + bne _0805748E + adds r0, r4, 0 + bl sub_8092C54 + lsls r0, 24 + cmp r0, 0 + beq _080574B6 +_0805748E: + ldrb r0, [r5] + cmp r0, 0x6 + bne _080574BA + ldrh r1, [r4, 0x2] + movs r0, 0xB0 + lsls r0, 1 + cmp r1, r0 + bne _080574AC + movs r1, 0x9C + lsls r1, 1 + adds r0, r6, r1 + ldrb r1, [r0] + b _080574AE + .align 2, 0 +_080574A8: .4byte 0x00000163 +_080574AC: + ldrb r1, [r4] +_080574AE: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _080574BA +_080574B6: + movs r0, 0 + b _080574BC +_080574BA: + movs r0, 0x1 +_080574BC: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_805744C + + thumb_func_start sub_80574C4 +sub_80574C4: + push {r4-r6,lr} + sub sp, 0x104 + adds r4, r0, 0 + adds r5, r1, 0 + movs r3, 0 + movs r2, 0 + ldr r0, [r4] + cmp r0, 0 + beq _08057502 + cmp r0, r5 + beq _080574EA +_080574DA: + lsls r0, r3, 2 + mov r6, sp + adds r1, r6, r0 + lsls r0, r2, 2 + adds r0, r4 + ldr r0, [r0] + str r0, [r1] + adds r3, 0x1 +_080574EA: + adds r2, 0x1 + cmp r2, 0x40 + bgt _08057502 + lsls r0, r2, 2 + adds r0, r4 + ldr r0, [r0] + cmp r0, 0 + beq _08057502 + cmp r0, r5 + beq _080574EA + cmp r3, 0x3F + ble _080574DA +_08057502: + movs r2, 0 + ldr r0, [r4] + b _08057524 +_08057508: + lsls r0, r3, 2 + mov r6, sp + adds r1, r6, r0 + lsls r0, r2, 2 + adds r0, r4 + ldr r0, [r0] + str r0, [r1] + adds r3, 0x1 +_08057518: + adds r2, 0x1 + cmp r2, 0x40 + bgt _08057530 + lsls r0, r2, 2 + adds r0, r4 + ldr r0, [r0] +_08057524: + cmp r0, 0 + beq _08057530 + cmp r0, r5 + bne _08057518 + cmp r3, 0x3F + ble _08057508 +_08057530: + cmp r3, 0x40 + bgt _08057542 + movs r1, 0 + lsls r0, r3, 2 + add r0, sp +_0805753A: + stm r0!, {r1} + adds r3, 0x1 + cmp r3, 0x40 + ble _0805753A +_08057542: + mov r3, sp + adds r1, r4, 0 + movs r2, 0x40 +_08057548: + ldm r3!, {r0} + stm r1!, {r0} + subs r2, 0x1 + cmp r2, 0 + bge _08057548 + add sp, 0x104 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80574C4 + + thumb_func_start sub_805755C +sub_805755C: + push {r4,lr} + lsls r1, 16 + lsrs r4, r1, 16 + cmp r4, 0x97 + bne _08057576 + bl sub_807E580 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08057576 + movs r0, 0 + b _08057580 +_08057576: + adds r0, r4, 0 + bl sub_809422C + lsls r0, 24 + lsrs r0, 24 +_08057580: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_805755C + + thumb_func_start sub_8057588 +sub_8057588: + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r6, r1, 24 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080575F8 + ldr r5, [r4, 0x70] + movs r3, 0 +_0805759E: + lsls r0, r3, 3 + movs r1, 0x8C + lsls r1, 1 + adds r0, r1 + adds r2, r5, r0 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + adds r4, r3, 0x1 + cmp r0, 0 + beq _080575F2 + movs r3, 0x1 + ldrb r1, [r2, 0x1] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080575C8 + movs r0, 0xEF + ands r0, r1 + strb r0, [r2, 0x1] + movs r3, 0x2 +_080575C8: + ldrb r1, [r2, 0x1] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080575F2 + movs r0, 0xF7 + ands r0, r1 + strb r0, [r2, 0x1] + cmp r6, 0 + beq _080575F2 + cmp r3, 0 + beq _080575F2 + adds r1, r3, 0 +_080575E2: + ldrb r0, [r2, 0x4] + cmp r0, 0 + beq _080575EC + subs r0, 0x1 + strb r0, [r2, 0x4] +_080575EC: + subs r1, 0x1 + cmp r1, 0 + bne _080575E2 +_080575F2: + adds r3, r4, 0 + cmp r3, 0x3 + ble _0805759E +_080575F8: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8057588 + + thumb_func_start sub_8057600 +sub_8057600: + push {r4,lr} + ldrh r4, [r0, 0x2] + adds r0, r1, 0 + bl sub_8057620 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_8094828 + lsls r0, 16 + asrs r0, 16 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8057600 + + thumb_func_start sub_8057620 +sub_8057620: + push {lr} + cmp r0, 0 + beq _0805762C + lsls r0, 24 + lsrs r0, 24 + b _0805762E +_0805762C: + movs r0, 0 +_0805762E: + pop {r1} + bx r1 + thumb_func_end sub_8057620 + + thumb_func_start sub_8057634 +sub_8057634: + push {r4-r7,lr} + sub sp, 0x8 + adds r5, r0, 0 + adds r6, r1, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _08057678 + movs r7, 0x1 + ldr r0, _08057684 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _08057678 + ldr r0, _08057688 + ldr r2, [r0] + str r7, [sp] + movs r0, 0 + str r0, [sp, 0x4] + adds r0, r5, 0 + adds r1, r6, 0 + movs r3, 0x1 + bl sub_8076F80 +_08057678: + adds r0, r7, 0 + add sp, 0x8 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08057684: .4byte gUnknown_80F4DB4 +_08057688: .4byte gUnknown_8106A4C + thumb_func_end sub_8057634 + + thumb_func_start sub_805768C +sub_805768C: + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r3, 0 + movs r6, 0 + ldr r4, _080576B8 + ldr r3, [r4] + adds r3, 0x1 + str r3, [r4] + ldr r4, _080576BC + lsls r3, 2 + adds r3, r4 + ldr r3, [r3] + str r5, [sp] + bl sub_8055640 + cmp r0, 0 + bne _080576C4 + ldr r1, _080576C0 + movs r0, 0x1 + strb r0, [r1] + b _080576C6 + .align 2, 0 +_080576B8: .4byte gUnknown_202F21C +_080576BC: .4byte gUnknown_8106A54 +_080576C0: .4byte gUnknown_202F220 +_080576C4: + movs r6, 0x1 +_080576C6: + adds r0, r6, 0 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_805768C + + thumb_func_start sub_80576D0 +sub_80576D0: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldr r1, _080576F4 + adds r0, r4, 0 + movs r2, 0x1 + bl sub_808417C + adds r2, r0, 0 + adds r2, 0x1 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8075F34 + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080576F4: .4byte gUnknown_80F4F28 + thumb_func_end sub_80576D0 + + thumb_func_start sub_80576F8 +sub_80576F8: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldr r1, _0805771C + adds r0, r4, 0 + movs r2, 0x1 + bl sub_808417C + adds r2, r0, 0 + adds r0, r5, 0 + adds r1, r4, 0 + movs r3, 0x1 + bl sub_8075C58 + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0805771C: .4byte gUnknown_80F4E74 + thumb_func_end sub_80576F8 + + thumb_func_start sub_8057720 +sub_8057720: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldr r1, _08057744 + adds r0, r4, 0 + movs r2, 0x1 + bl sub_808417C + adds r2, r0, 0 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8075DBC + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08057744: .4byte gUnknown_80F4E78 + thumb_func_end sub_8057720 + + thumb_func_start sub_8057748 +sub_8057748: + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + ldr r4, _08057778 + bl sub_807E580 + lsls r0, 24 + lsrs r0, 23 + adds r0, r4 + movs r1, 0 + ldrsh r2, [r0, r1] + movs r0, 0x1 + str r0, [sp] + adds r0, r5, 0 + adds r1, r6, 0 + movs r3, 0 + bl sub_8077C44 + movs r0, 0x1 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08057778: .4byte gUnknown_80F502A + thumb_func_end sub_8057748 + + thumb_func_start sub_805777C +sub_805777C: + push {lr} + bl sub_8079DB8 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805777C + + thumb_func_start sub_8057788 +sub_8057788: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + adds r4, r0, 0 + adds r7, r1, 0 + adds r6, r2, 0 + mov r8, r3 + movs r0, 0 + mov r9, r0 + adds r0, r4, 0 + bl sub_8045128 + adds r5, r0, 0 + bl sub_804AF20 + lsls r0, 24 + cmp r0, 0 + beq _080577BA + ldrh r1, [r5] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + beq _080577CC +_080577BA: + ldr r0, _080577C8 + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r7, 0 + bl sub_80522F4 + b _0805780E + .align 2, 0 +_080577C8: .4byte gUnknown_80FD14C +_080577CC: + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_80570AC + lsls r0, 24 + cmp r0, 0 + beq _080577F8 + ldr r0, _080577F4 + ldr r3, [r0] + mov r0, r8 + str r0, [sp] + adds r0, r4, 0 + adds r1, r7, 0 + adds r2, r6, 0 + bl sub_8055640 + adds r0, r4, 0 + bl sub_8079764 + b _0805780A + .align 2, 0 +_080577F4: .4byte gUnknown_80F4F68 +_080577F8: + ldr r0, _08057820 + ldr r0, [r0] + str r0, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + movs r2, 0xA + adds r3, r6, 0 + bl sub_8079618 +_0805780A: + movs r0, 0x1 + mov r9, r0 +_0805780E: + mov r0, r9 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08057820: .4byte gUnknown_80FAD4C + thumb_func_end sub_8057788 + + thumb_func_start sub_8057824 +sub_8057824: + push {lr} + ldr r2, _08057838 + ldr r2, [r2] + movs r3, 0x1 + bl sub_80775DC + movs r0, 0x1 + pop {r1} + bx r1 + .align 2, 0 +_08057838: .4byte gUnknown_8106A50 + thumb_func_end sub_8057824 + + thumb_func_start sub_805783C +sub_805783C: + push {lr} + sub sp, 0x4 + ldr r2, _08057858 + ldr r2, [r2] + movs r3, 0x1 + str r3, [sp] + movs r3, 0x80 + bl sub_80772C0 + movs r0, 0x1 + add sp, 0x4 + pop {r1} + bx r1 + .align 2, 0 +_08057858: .4byte gUnknown_8106A4C + thumb_func_end sub_805783C + + thumb_func_start sub_805785C +sub_805785C: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, _08057894 + ldr r0, [r0] + ldr r1, _08057898 + ldrh r1, [r1] + ldr r2, _0805789C + adds r0, r2 + strb r1, [r0] + movs r0, 0x1 + movs r1, 0 + bl sub_807EAA0 + lsls r0, 24 + cmp r0, 0 + bne _0805788A + ldr r0, _080578A0 + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80522F4 +_0805788A: + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08057894: .4byte gUnknown_203B418 +_08057898: .4byte gUnknown_80F4F42 +_0805789C: .4byte 0x0000e26b +_080578A0: .4byte gUnknown_80FCF74 + thumb_func_end sub_805785C + + thumb_func_start sub_80578A4 +sub_80578A4: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, _080578DC + ldr r0, [r0] + ldr r1, _080578E0 + ldrh r1, [r1] + ldr r2, _080578E4 + adds r0, r2 + strb r1, [r0] + movs r0, 0x1 + movs r1, 0 + bl sub_807EAA0 + lsls r0, 24 + cmp r0, 0 + bne _080578D2 + ldr r0, _080578E8 + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80522F4 +_080578D2: + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080578DC: .4byte gUnknown_203B418 +_080578E0: .4byte gUnknown_80F4F42 +_080578E4: .4byte 0x0000e26c +_080578E8: .4byte gUnknown_80FCF80 + thumb_func_end sub_80578A4 + + thumb_func_start sub_80578EC +sub_80578EC: + push {lr} + movs r2, 0x1 + movs r3, 0 + bl sub_8079F20 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_80578EC + + thumb_func_start sub_80578FC +sub_80578FC: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _08057938 + movs r7, 0x1 + ldr r0, _08057944 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _08057938 + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0 + bl sub_80779F0 +_08057938: + adds r0, r7, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08057944: .4byte gUnknown_80F4DB6 + thumb_func_end sub_80578FC + + thumb_func_start sub_8057948 +sub_8057948: + push {lr} + bl sub_8078968 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_8057948 + + thumb_func_start sub_8057954 +sub_8057954: + push {lr} + sub sp, 0x4 + adds r3, r2, 0 + ldr r2, _08057970 + ldr r2, [r2] + str r2, [sp] + movs r2, 0xC + bl sub_8079618 + movs r0, 0x1 + add sp, 0x4 + pop {r1} + bx r1 + .align 2, 0 +_08057970: .4byte gUnknown_80FAC88 + thumb_func_end sub_8057954 + + thumb_func_start sub_8057974 +sub_8057974: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + mov r10, r0 + adds r5, r1, 0 + adds r7, r2, 0 + mov r9, r3 + ldr r0, [r5, 0x70] + movs r1, 0xE + ldrsh r0, [r0, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + mov r8, r0 + movs r6, 0 + add r0, sp, 0x18 + strb r6, [r0] + mov r0, r8 + cmp r0, 0 + beq _080579E8 + adds r0, r7, 0 + bl sub_8092B00 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r7, 0 + mov r1, r9 + bl sub_8057600 + lsls r0, 16 + asrs r0, 16 + add r1, sp, 0x18 + str r1, [sp] + str r4, [sp, 0x4] + str r0, [sp, 0x8] + str r6, [sp, 0xC] + movs r0, 0x1 + str r0, [sp, 0x10] + str r6, [sp, 0x14] + mov r0, r10 + adds r1, r5, 0 + mov r2, r8 + movs r3, 0x1 + bl sub_806F370 + add r1, sp, 0x18 + movs r2, 0 + adds r0, r1, 0 + ldrb r0, [r0] + cmp r0, 0 + bne _080579E4 + movs r2, 0x1 +_080579E4: + strb r2, [r1] + b _080579F4 +_080579E8: + ldr r0, _08057A08 + ldr r2, [r0] + mov r0, r10 + adds r1, r5, 0 + bl sub_80522F4 +_080579F4: + add r0, sp, 0x18 + ldrb r0, [r0] + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08057A08: .4byte gUnknown_80FD018 + thumb_func_end sub_8057974 + + thumb_func_start sub_8057A0C +sub_8057A0C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + adds r6, r1, 0 + ldr r2, [r5, 0x70] + mov r8, r2 + ldr r0, [r6, 0x70] + adds r3, r0, 0 + movs r1, 0xE + ldrsh r0, [r2, r1] + movs r4, 0xE + ldrsh r1, [r3, r4] + adds r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + strh r0, [r2, 0xE] + strh r0, [r3, 0xE] + movs r7, 0xE + ldrsh r1, [r2, r7] + ldrh r4, [r2, 0x10] + movs r7, 0x10 + ldrsh r0, [r2, r7] + cmp r1, r0 + ble _08057A42 + strh r4, [r2, 0xE] +_08057A42: + movs r0, 0xE + ldrsh r1, [r3, r0] + ldrh r2, [r3, 0x10] + movs r4, 0x10 + ldrsh r0, [r3, r4] + cmp r1, r0 + ble _08057A52 + strh r2, [r3, 0xE] +_08057A52: + ldr r4, _08057A90 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + adds r4, 0x50 + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_8045B94 + mov r1, r8 + adds r1, 0xFB + ldrb r0, [r1] + cmp r0, 0 + bne _08057A78 + movs r0, 0x1 + strb r0, [r1] +_08057A78: + ldr r0, _08057A94 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_80522F4 + movs r0, 0x1 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08057A90: .4byte gUnknown_202DF98 +_08057A94: .4byte gUnknown_80FC7EC + thumb_func_end sub_8057A0C + + thumb_func_start sub_8057A98 +sub_8057A98: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + mov r10, r0 + mov r8, r1 + ldr r0, [r1, 0x70] + str r0, [sp, 0x8] + movs r1, 0 + str r1, [sp, 0xC] + movs r1, 0x8C + lsls r1, 1 + adds r4, r0, r1 + adds r5, r4, 0 + movs r0, 0x10 + mov r9, r0 + movs r7, 0x3 +_08057ABE: + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08057B12 + movs r6, 0x20 + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _08057B04 + mov r0, r9 + ands r0, r1 + cmp r0, 0 + beq _08057B12 + ldr r0, _08057AFC + adds r1, r5, 0 + movs r2, 0 + bl sub_80928C0 + ldr r0, _08057B00 + ldr r2, [r0] + mov r0, r10 + mov r1, r8 + bl sub_80522F4 + ldrb r0, [r4] + orrs r0, r6 + strb r0, [r4] + movs r1, 0x1 + str r1, [sp, 0xC] + b _08057B12 + .align 2, 0 +_08057AFC: .4byte gUnknown_202DE58 +_08057B00: .4byte gUnknown_80FCFBC +_08057B04: + mov r0, r9 + ands r0, r1 + cmp r0, 0 + bne _08057B12 + movs r0, 0xDF + ands r0, r1 + strb r0, [r4] +_08057B12: + adds r4, 0x8 + adds r5, 0x8 + subs r7, 0x1 + cmp r7, 0 + bge _08057ABE + ldr r0, [sp, 0x8] + movs r1, 0x9C + lsls r1, 1 + adds r4, r0, r1 + ldrb r1, [r4] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _08057B6C + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08057B7A + movs r1, 0xB0 + lsls r1, 1 + mov r0, sp + bl sub_8092A88 + ldrb r1, [r4] + movs r0, 0x20 + orrs r0, r1 + strb r0, [r4] + movs r0, 0x1 + str r0, [sp, 0xC] + ldr r0, _08057B64 + mov r1, sp + movs r2, 0 + bl sub_80928C0 + ldr r0, _08057B68 + ldr r2, [r0] + mov r0, r10 + mov r1, r8 + bl sub_80522F4 + b _08057B7A + .align 2, 0 +_08057B64: .4byte gUnknown_202DE58 +_08057B68: .4byte gUnknown_80FCFBC +_08057B6C: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _08057B7A + movs r0, 0xDF + ands r0, r1 + strb r0, [r4] +_08057B7A: + ldr r1, [sp, 0xC] + cmp r1, 0 + beq _08057B90 + ldr r1, [sp, 0x8] + adds r1, 0xC0 + ldrb r0, [r1] + cmp r0, 0x1 + bne _08057B9C + movs r0, 0 + strb r0, [r1] + b _08057B9C +_08057B90: + ldr r0, _08057BB0 + ldr r2, [r0] + mov r0, r10 + mov r1, r8 + bl sub_80522F4 +_08057B9C: + ldr r0, [sp, 0xC] + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08057BB0: .4byte gUnknown_80FCFE4 + thumb_func_end sub_8057A98 + + thumb_func_start sub_8057BB4 +sub_8057BB4: + push {lr} + movs r2, 0x1 + movs r3, 0x1 + bl sub_80779F0 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_8057BB4 + + thumb_func_start sub_8057BC4 +sub_8057BC4: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + bl sub_8077AE4 + ldr r0, _08057BE8 + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + movs r3, 0x2 + bl sub_8077084 + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08057BE8: .4byte gUnknown_8106A4C + thumb_func_end sub_8057BC4 + + thumb_func_start sub_8057BEC +sub_8057BEC: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + adds r7, r2, 0 + adds r6, r3, 0 + movs r0, 0 + mov r8, r0 + adds r0, r4, 0 + bl sub_8070B28 + lsls r0, 24 + cmp r0, 0 + beq _08057C48 + movs r3, 0x80 + lsls r3, 1 + str r6, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r7, 0 + bl sub_8055640 + cmp r0, 0 + beq _08057C54 + movs r1, 0x1 + mov r8, r1 + ldr r0, _08057C44 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _08057C54 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0 + bl sub_80776C0 + b _08057C54 + .align 2, 0 +_08057C44: .4byte gUnknown_80F4E0A +_08057C48: + ldr r0, _08057C64 + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80522F4 +_08057C54: + mov r0, r8 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08057C64: .4byte gUnknown_80FC734 + thumb_func_end sub_8057BEC + + thumb_func_start sub_8057C68 +sub_8057C68: + push {lr} + sub sp, 0x4 + ldr r2, _08057C84 + ldr r2, [r2] + movs r3, 0x1 + str r3, [sp] + movs r3, 0x40 + bl sub_8077434 + movs r0, 0x1 + add sp, 0x4 + pop {r1} + bx r1 + .align 2, 0 +_08057C84: .4byte gUnknown_8106A4C + thumb_func_end sub_8057C68 + + thumb_func_start sub_8057C88 +sub_8057C88: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _08057CC2 + movs r7, 0x1 + ldr r0, _08057CCC + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _08057CC2 + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_80776C0 +_08057CC2: + adds r0, r7, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08057CCC: .4byte gUnknown_80F4DF6 + thumb_func_end sub_8057C88 + + thumb_func_start sub_8057CD0 +sub_8057CD0: + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x8 + adds r4, r0, 0 + adds r6, r1, 0 + mov r8, r2 + adds r5, r3, 0 + bl sub_807E580 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08057D18 + adds r1, r0, r1 + ldrb r2, [r1] + ldr r1, _08057D1C + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [sp] + str r5, [sp, 0x4] + adds r0, r4, 0 + adds r1, r6, 0 + mov r3, r8 + bl sub_80556BC + cmp r0, 0 + beq _08057D0A + movs r0, 0x1 +_08057D0A: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08057D18: .4byte gUnknown_80F51E4 +_08057D1C: .4byte gUnknown_80F51EC + thumb_func_end sub_8057CD0 + + thumb_func_start sub_8057D20 +sub_8057D20: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r4, r1, 0 + movs r7, 0 + ldr r0, [r4, 0x70] + adds r0, 0xC0 + ldrb r0, [r0] + movs r6, 0x80 + lsls r6, 1 + cmp r0, 0x9 + bne _08057D3C + movs r6, 0x80 + lsls r6, 2 +_08057D3C: + str r3, [sp] + adds r0, r5, 0 + adds r1, r4, 0 + adds r3, r6, 0 + bl sub_8055640 + cmp r0, 0 + beq _08057D6E + movs r7, 0x1 + ldr r0, _08057D78 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _08057D6E + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x3B + movs r3, 0 + bl sub_80768DC +_08057D6E: + adds r0, r7, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08057D78: .4byte gUnknown_80F4E08 + thumb_func_end sub_8057D20 + + thumb_func_start sub_8057D7C +sub_8057D7C: + push {lr} + sub sp, 0x8 + ldr r2, _08057D98 + ldr r2, [r2] + movs r3, 0x1 + str r3, [sp] + str r3, [sp, 0x4] + movs r3, 0x2 + bl sub_8076F80 + movs r0, 0x1 + add sp, 0x8 + pop {r1} + bx r1 + .align 2, 0 +_08057D98: .4byte gUnknown_8106A50 + thumb_func_end sub_8057D7C + + thumb_func_start sub_8057D9C +sub_8057D9C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + adds r4, r1, 0 + ldr r0, [r4, 0x70] + movs r5, 0 + ldr r1, _08057DF8 + mov r8, r1 + movs r1, 0x8C + lsls r1, 1 + adds r2, r0, r1 + movs r0, 0x1 + mov r12, r0 + movs r7, 0x10 + movs r3, 0x3 +_08057DBC: + ldrb r1, [r2] + mov r0, r12 + ands r0, r1 + cmp r0, 0 + beq _08057DD4 + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _08057DD4 + movs r0, 0 + strb r0, [r2, 0x4] + movs r5, 0x1 +_08057DD4: + adds r2, 0x8 + subs r3, 0x1 + cmp r3, 0 + bge _08057DBC + mov r0, r8 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + cmp r5, 0 + beq _08057E00 + ldr r0, _08057DFC + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08057E0C + .align 2, 0 +_08057DF8: .4byte gUnknown_202DFE8 +_08057DFC: .4byte gUnknown_80FD350 +_08057E00: + ldr r0, _08057E18 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08057E0C: + adds r0, r5, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08057E18: .4byte gUnknown_80FD370 + thumb_func_end sub_8057D9C + + thumb_func_start sub_8057E1C +sub_8057E1C: + push {lr} + bl sub_8078348 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_8057E1C + + thumb_func_start sub_8057E28 +sub_8057E28: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldr r1, _08057E4C + adds r0, r4, 0 + movs r2, 0x1 + bl sub_808417C + adds r2, r0, 0 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_807824C + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08057E4C: .4byte gUnknown_80F4EDC + thumb_func_end sub_8057E28 + + thumb_func_start sub_8057E50 +sub_8057E50: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_807A9D8 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8079CA0 + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8057E50 + + thumb_func_start sub_8057E6C +sub_8057E6C: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + adds r7, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + adds r4, r3, 0 + movs r0, 0 + mov r8, r0 + ldr r1, [r7, 0x70] + mov r9, r1 + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_807A9D8 + movs r3, 0x80 + lsls r3, 1 + str r4, [sp] + adds r0, r7, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_8055640 + cmp r0, 0 + beq _08057EBC + movs r0, 0x1 + mov r8, r0 + adds r0, r7, 0 + movs r1, 0 + bl sub_8057308 + lsls r0, 24 + cmp r0, 0 + beq _08057EBC + ldr r0, _08057ECC + add r0, r9 + mov r1, r8 + strb r1, [r0] +_08057EBC: + mov r0, r8 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08057ECC: .4byte 0x00000155 + thumb_func_end sub_8057E6C + + thumb_func_start sub_8057ED0 +sub_8057ED0: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _08057F12 + movs r7, 0x1 + ldr r0, _08057F1C + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _08057F12 + ldr r0, _08057F20 + ldr r2, [r0] + movs r0, 0 + str r0, [sp] + adds r0, r5, 0 + adds r1, r6, 0 + movs r3, 0x80 + bl sub_80772C0 +_08057F12: + adds r0, r7, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08057F1C: .4byte gUnknown_80F4E04 +_08057F20: .4byte gUnknown_8106A4C + thumb_func_end sub_8057ED0 + + thumb_func_start sub_8057F24 +sub_8057F24: + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + adds r6, r0, 0 + mov r8, r1 + ldr r5, [r6, 0x70] + movs r0, 0x1 + mov r9, r0 + movs r4, 0x1 + strh r4, [r5, 0xE] + ldr r0, _08057F74 + ldr r2, [r0] + str r4, [sp] + adds r0, r6, 0 + movs r3, 0x40 + bl sub_80772C0 + ldr r0, _08057F78 + ldr r2, [r0] + str r4, [sp] + adds r0, r6, 0 + mov r1, r8 + movs r3, 0x40 + bl sub_80772C0 + movs r0, 0xAA + lsls r0, 1 + adds r5, r0 + mov r0, r9 + strb r0, [r5] + movs r0, 0x1 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08057F74: .4byte gUnknown_8106A4C +_08057F78: .4byte gUnknown_8106A50 + thumb_func_end sub_8057F24 + + thumb_func_start sub_8057F7C +sub_8057F7C: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _08057FBA + movs r7, 0x1 + ldr r0, _08057FC4 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _08057FBA + ldr r0, _08057FC8 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r6, 0 + movs r3, 0 + bl sub_80775DC +_08057FBA: + adds r0, r7, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08057FC4: .4byte gUnknown_80F4E02 +_08057FC8: .4byte gUnknown_8106A4C + thumb_func_end sub_8057F7C + + thumb_func_start sub_8057FCC +sub_8057FCC: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + bl sub_8077AE4 + ldr r0, _08057FF0 + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + movs r3, 0x1 + bl sub_8077084 + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08057FF0: .4byte gUnknown_8106A50 + thumb_func_end sub_8057FCC + + thumb_func_start sub_8057FF4 +sub_8057FF4: + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_807723C + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + beq _08058048 + ldr r0, [r4, 0x70] + movs r2, 0xA9 + lsls r2, 1 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0 + bne _08058054 + movs r0, 0x1 + strb r0, [r1] + ldr r0, _0805802C + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + cmp r6, 0x1 + bne _08058034 + ldr r0, _08058030 + b _08058036 + .align 2, 0 +_0805802C: .4byte gUnknown_202DFE8 +_08058030: .4byte gUnknown_80FAE00 +_08058034: + ldr r0, _08058044 +_08058036: + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08058054 + .align 2, 0 +_08058044: .4byte gUnknown_80FADD8 +_08058048: + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_8076210 +_08058054: + movs r0, 0x1 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8057FF4 + + thumb_func_start sub_805805C +sub_805805C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + mov r10, r0 + mov r9, r1 + adds r5, r2, 0 + mov r8, r3 + ldr r1, [r0, 0x70] + movs r6, 0x1 + movs r2, 0 + ldr r4, _08058098 + movs r3, 0 + ldrsh r0, [r4, r3] + cmp r0, 0 + blt _080580B0 + movs r7, 0xC + ldrsh r3, [r1, r7] + adds r1, r4, 0 + ldr r4, _0805809C +_08058088: + movs r7, 0 + ldrsh r0, [r1, r7] + cmp r3, r0 + bge _080580A0 + movs r0, 0x2 + ldrsh r6, [r1, r0] + b _080580B0 + .align 2, 0 +_08058098: .4byte gUnknown_80F55BC +_0805809C: .4byte 0x000003e6 +_080580A0: + adds r1, 0x4 + adds r2, 0x1 + cmp r2, r4 + bgt _080580B0 + movs r7, 0 + ldrsh r0, [r1, r7] + cmp r0, 0 + bge _08058088 +_080580B0: + adds r0, r5, 0 + bl sub_8092B00 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + mov r1, r8 + bl sub_8057600 + lsls r0, 16 + asrs r0, 16 + add r1, sp, 0x18 + str r1, [sp] + str r4, [sp, 0x4] + str r0, [sp, 0x8] + movs r1, 0 + str r1, [sp, 0xC] + movs r0, 0x1 + str r0, [sp, 0x10] + str r1, [sp, 0x14] + mov r0, r10 + mov r1, r9 + adds r2, r6, 0 + movs r3, 0x1 + bl sub_806F370 + add r1, sp, 0x18 + movs r2, 0 + adds r0, r1, 0 + ldrb r0, [r0] + cmp r0, 0 + bne _080580F4 + movs r2, 0x1 +_080580F4: + strb r2, [r1] + add r0, sp, 0x18 + ldrb r0, [r0] + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_805805C + + thumb_func_start sub_805810C +sub_805810C: + push {r4-r7,lr} + adds r6, r0, 0 + adds r5, r1, 0 + movs r7, 0 + ldr r4, [r5, 0x70] + ldr r0, _08058134 + movs r2, 0 + bl sub_8045B94 + adds r4, 0xF4 + ldrb r0, [r4] + cmp r0, 0 + beq _0805813C + ldr r0, _08058138 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80522F4 + b _0805814E + .align 2, 0 +_08058134: .4byte gUnknown_202DFE8 +_08058138: .4byte gUnknown_80FD2B4 +_0805813C: + movs r0, 0x1 + strb r0, [r4] + movs r7, 0x1 + ldr r0, _08058158 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80522F4 +_0805814E: + adds r0, r7, 0 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08058158: .4byte gUnknown_80FD294 + thumb_func_end sub_805810C + + thumb_func_start sub_805815C +sub_805815C: + push {lr} + movs r2, 0x4 + bl sub_80797A0 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805815C + + thumb_func_start sub_805816C +sub_805816C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r6, r0, 0 + adds r7, r1, 0 + adds r5, r2, 0 + adds r4, r3, 0 + movs r0, 0 + mov r8, r0 + adds r0, r6, 0 + bl sub_807A9D8 + movs r3, 0x80 + lsls r3, 1 + str r4, [sp] + adds r0, r6, 0 + adds r1, r7, 0 + adds r2, r5, 0 + bl sub_8055640 + cmp r0, 0 + beq _080581BE + movs r1, 0x1 + mov r8, r1 + ldr r0, _080581CC + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _080581BE + adds r0, r6, 0 + adds r1, r7, 0 + movs r2, 0 + movs r3, 0 + bl sub_8076210 +_080581BE: + mov r0, r8 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080581CC: .4byte gUnknown_80F4DB8 + thumb_func_end sub_805816C + + thumb_func_start sub_80581D0 +sub_80581D0: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r6, r0, 0 + adds r7, r1, 0 + adds r5, r2, 0 + adds r4, r3, 0 + movs r0, 0 + mov r8, r0 + adds r0, r6, 0 + bl sub_807A9D8 + movs r3, 0x80 + lsls r3, 1 + str r4, [sp] + adds r0, r6, 0 + adds r1, r7, 0 + adds r2, r5, 0 + bl sub_8055640 + cmp r0, 0 + beq _08058222 + movs r1, 0x1 + mov r8, r1 + ldr r0, _08058230 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _08058222 + adds r0, r6, 0 + adds r1, r7, 0 + movs r2, 0 + movs r3, 0 + bl sub_8076210 +_08058222: + mov r0, r8 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08058230: .4byte gUnknown_80F4DBA + thumb_func_end sub_80581D0 + + thumb_func_start sub_8058234 +sub_8058234: + push {r4,lr} + adds r3, r0, 0 + adds r4, r1, 0 + ldrh r1, [r2, 0x2] + ldr r0, _08058258 + movs r2, 0x51 + cmp r1, r0 + bne _08058246 + movs r2, 0x7A +_08058246: + adds r0, r3, 0 + adds r1, r4, 0 + bl sub_8078FDC + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08058258: .4byte 0x0000013b + thumb_func_end sub_8058234 + + thumb_func_start sub_805825C +sub_805825C: + push {lr} + ldr r2, _0805826C + ldr r2, [r2] + bl sub_8077540 + movs r0, 0x1 + pop {r1} + bx r1 + .align 2, 0 +_0805826C: .4byte gUnknown_8106A50 + thumb_func_end sub_805825C + + thumb_func_start sub_8058270 +sub_8058270: + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r2, 0 + adds r2, r3, 0 + movs r3, 0x1 + ldr r0, [r1, 0x70] + adds r0, 0xC0 + ldrb r0, [r0] + subs r0, 0x7 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _0805828E + movs r3, 0x2 +_0805828E: + lsls r3, 8 + str r2, [sp] + adds r0, r4, 0 + adds r2, r5, 0 + bl sub_8055640 + adds r1, r0, 0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8058270 + + thumb_func_start sub_80582AC +sub_80582AC: + push {lr} + ldr r2, _080582C0 + ldr r2, [r2] + movs r3, 0x1 + bl sub_8077160 + movs r0, 0x1 + pop {r1} + bx r1 + .align 2, 0 +_080582C0: .4byte gUnknown_8106A4C + thumb_func_end sub_80582AC + + thumb_func_start sub_80582C4 +sub_80582C4: + push {lr} + movs r2, 0x1 + bl sub_8077780 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_80582C4 + + thumb_func_start sub_80582D4 +sub_80582D4: + push {lr} + ldr r2, _080582E8 + ldr r2, [r2] + movs r3, 0x1 + bl sub_8077084 + movs r0, 0x1 + pop {r1} + bx r1 + .align 2, 0 +_080582E8: .4byte gUnknown_8106A4C + thumb_func_end sub_80582D4 + + thumb_func_start sub_80582EC +sub_80582EC: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r7, r1, 0 + adds r4, r2, 0 + adds r6, r3, 0 + adds r1, r4, 0 + bl sub_80570AC + lsls r0, 24 + cmp r0, 0 + beq _08058328 + ldr r0, _08058324 + ldr r3, [r0] + str r6, [sp] + adds r0, r5, 0 + adds r1, r7, 0 + adds r2, r4, 0 + bl sub_8055640 + negs r1, r0 + orrs r1, r0 + lsrs r4, r1, 31 + adds r0, r5, 0 + bl sub_8079764 + b _0805833C + .align 2, 0 +_08058324: .4byte gUnknown_80F4F50 +_08058328: + ldr r0, _08058348 + ldr r0, [r0] + str r0, [sp] + adds r0, r5, 0 + adds r1, r5, 0 + movs r2, 0x4 + adds r3, r4, 0 + bl sub_8079618 + movs r4, 0x1 +_0805833C: + adds r0, r4, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08058348: .4byte gUnknown_80FAC54 + thumb_func_end sub_80582EC + + thumb_func_start sub_805834C +sub_805834C: + push {lr} + sub sp, 0x4 + adds r3, r2, 0 + ldr r2, _08058368 + ldr r2, [r2] + str r2, [sp] + movs r2, 0x1 + bl sub_8079618 + movs r0, 0x1 + add sp, 0x4 + pop {r1} + bx r1 + .align 2, 0 +_08058368: .4byte gUnknown_80FAC74 + thumb_func_end sub_805834C + + thumb_func_start sub_805836C +sub_805836C: + push {r4-r7,lr} + sub sp, 0x1C + adds r6, r0, 0 + adds r7, r1, 0 + movs r5, 0 + add r0, sp, 0x18 + strb r5, [r0] + ldr r0, [r6, 0x70] + adds r0, 0xA0 + ldr r0, [r0] + lsls r4, r0, 1 + ldr r0, _080583D0 + cmp r4, r0 + ble _0805838A + adds r4, r0, 0 +_0805838A: + adds r0, r2, 0 + bl sub_8092B00 + lsls r0, 24 + lsrs r0, 24 + add r1, sp, 0x18 + str r1, [sp] + str r0, [sp, 0x4] + ldr r0, _080583D4 + str r0, [sp, 0x8] + str r5, [sp, 0xC] + movs r0, 0x1 + str r0, [sp, 0x10] + str r5, [sp, 0x14] + adds r0, r6, 0 + adds r1, r7, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_806F370 + add r1, sp, 0x18 + movs r2, 0 + adds r0, r1, 0 + ldrb r0, [r0] + cmp r0, 0 + bne _080583C0 + movs r2, 0x1 +_080583C0: + strb r2, [r1] + add r0, sp, 0x18 + ldrb r0, [r0] + add sp, 0x1C + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080583D0: .4byte 0x000003e7 +_080583D4: .4byte 0x000001ff + thumb_func_end sub_805836C + + thumb_func_start sub_80583D8 +sub_80583D8: + push {r4-r7,lr} + sub sp, 0x8 + adds r5, r0, 0 + adds r6, r1, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _0805841C + movs r7, 0x1 + ldr r0, _08058428 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _0805841C + ldr r0, _0805842C + ldr r2, [r0] + str r7, [sp] + movs r0, 0 + str r0, [sp, 0x4] + adds r0, r5, 0 + adds r1, r6, 0 + movs r3, 0x1 + bl sub_8076F80 +_0805841C: + adds r0, r7, 0 + add sp, 0x8 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08058428: .4byte gUnknown_80F4DC2 +_0805842C: .4byte gUnknown_8106A50 + thumb_func_end sub_80583D8 + + thumb_func_start sub_8058430 +sub_8058430: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _0805846A + movs r7, 0x1 + ldr r0, _08058474 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _0805846A + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_80776C0 +_0805846A: + adds r0, r7, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08058474: .4byte gUnknown_80F4DEE + thumb_func_end sub_8058430 + + thumb_func_start sub_8058478 +sub_8058478: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _080584B2 + movs r7, 0x1 + ldr r0, _080584BC + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _080584B2 + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_8077780 +_080584B2: + adds r0, r7, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080584BC: .4byte gUnknown_80F4DE6 + thumb_func_end sub_8058478 + + thumb_func_start sub_80584C0 +sub_80584C0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + mov r9, r0 + mov r10, r1 + adds r6, r2, 0 + mov r8, r3 + movs r7, 0 + add r0, sp, 0x18 + strb r7, [r0] + mov r0, r9 + ldr r2, [r0, 0x70] + ldr r0, [r1, 0x70] + movs r3, 0xE + ldrsh r1, [r0, r3] + movs r3, 0xE + ldrsh r0, [r2, r3] + subs r5, r1, r0 + cmp r5, 0 + bge _080584F0 + movs r5, 0 +_080584F0: + adds r0, r6, 0 + bl sub_8092B00 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + mov r1, r8 + bl sub_8057600 + lsls r0, 16 + asrs r0, 16 + add r1, sp, 0x18 + str r1, [sp] + str r4, [sp, 0x4] + str r0, [sp, 0x8] + str r7, [sp, 0xC] + movs r0, 0x1 + str r0, [sp, 0x10] + str r7, [sp, 0x14] + mov r0, r9 + mov r1, r10 + adds r2, r5, 0 + movs r3, 0 + bl sub_806F370 + add r1, sp, 0x18 + movs r2, 0 + adds r0, r1, 0 + ldrb r0, [r0] + cmp r0, 0 + bne _08058532 + movs r2, 0x1 +_08058532: + strb r2, [r1] + add r0, sp, 0x18 + ldrb r0, [r0] + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80584C0 + + thumb_func_start sub_8058548 +sub_8058548: + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + movs r5, 0x80 + lsls r5, 1 + ldr r0, [r4, 0x70] + adds r0, 0xAC + ldrb r0, [r0] + cmp r0, 0 + beq _08058560 + ldr r0, _0805857C + ldr r5, [r0] +_08058560: + str r3, [sp] + adds r0, r4, 0 + adds r3, r5, 0 + bl sub_8055640 + adds r1, r0, 0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0805857C: .4byte gUnknown_80F4F6C + thumb_func_end sub_8058548 + + thumb_func_start sub_8058580 +sub_8058580: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _080585BC + movs r7, 0x1 + ldr r0, _080585C8 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _080585BC + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0 + bl sub_80779F0 +_080585BC: + adds r0, r7, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080585C8: .4byte gUnknown_80F4DD4 + thumb_func_end sub_8058580 + + thumb_func_start sub_80585CC +sub_80585CC: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r5, r0, 0 + adds r4, r1, 0 + mov r8, r2 + adds r7, r3, 0 + movs r6, 0 + ldr r0, [r4, 0x70] + adds r0, 0xC4 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080585EC + cmp r0, 0x3 + bne _08058602 +_080585EC: + ldr r0, _08058620 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_807A4C8 + movs r6, 0x1 +_08058602: + movs r3, 0x80 + lsls r3, 1 + str r7, [sp] + adds r0, r5, 0 + adds r1, r4, 0 + mov r2, r8 + bl sub_8055640 + cmp r0, 0 + beq _08058624 + movs r0, 0x1 + orrs r0, r6 + lsls r0, 24 + b _08058626 + .align 2, 0 +_08058620: .4byte gUnknown_80FD104 +_08058624: + lsls r0, r6, 24 +_08058626: + lsrs r0, 24 + adds r6, r0, 0 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80585CC + + thumb_func_start sub_8058638 +sub_8058638: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _08058670 + movs r7, 0x1 + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _08058670 + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0 + bl sub_80779F0 +_08058670: + adds r0, r7, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8058638 + + thumb_func_start sub_805867C +sub_805867C: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r7, r1, 0 + adds r4, r2, 0 + adds r6, r3, 0 + adds r1, r4, 0 + bl sub_80570AC + lsls r0, 24 + cmp r0, 0 + beq _080586B8 + ldr r0, _080586B4 + ldr r3, [r0] + str r6, [sp] + adds r0, r5, 0 + adds r1, r7, 0 + adds r2, r4, 0 + bl sub_8055640 + negs r1, r0 + orrs r1, r0 + lsrs r4, r1, 31 + adds r0, r5, 0 + bl sub_8079764 + b _080586CC + .align 2, 0 +_080586B4: .4byte gUnknown_80F4F54 +_080586B8: + ldr r0, _080586D8 + ldr r0, [r0] + str r0, [sp] + adds r0, r5, 0 + adds r1, r5, 0 + movs r2, 0x5 + adds r3, r4, 0 + bl sub_8079618 + movs r4, 0x1 +_080586CC: + adds r0, r4, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080586D8: .4byte gUnknown_80FACA4 + thumb_func_end sub_805867C + + thumb_func_start sub_80586DC +sub_80586DC: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r7, r0, 0 + adds r4, r1, 0 + adds r6, r2, 0 + adds r5, r3, 0 + adds r0, r4, 0 + movs r1, 0x3A + bl sub_8071824 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r3, 0x80 + lsls r3, 1 + str r5, [sp] + adds r0, r7, 0 + adds r1, r4, 0 + adds r2, r6, 0 + bl sub_8055640 + adds r4, r0, 0 + negs r0, r4 + orrs r0, r4 + lsrs r5, r0, 31 + cmp r5, 0 + beq _08058762 + adds r0, r7, 0 + movs r1, 0 + bl sub_8057308 + lsls r0, 24 + cmp r0, 0 + beq _08058762 + lsrs r0, r4, 31 + adds r0, r4, r0 + asrs r2, r0, 1 + ldr r0, [r7, 0x70] + movs r5, 0x1 + cmp r2, 0 + bgt _08058734 + movs r2, 0x1 +_08058734: + adds r1, r0, 0 + adds r1, 0xFB + ldrb r0, [r1] + cmp r0, 0 + bne _08058740 + strb r5, [r1] +_08058740: + mov r0, r8 + cmp r0, 0 + beq _08058756 + movs r3, 0xFD + lsls r3, 1 + adds r0, r7, 0 + adds r1, r2, 0 + movs r2, 0xD + bl sub_806F324 + b _08058762 +_08058756: + str r5, [sp] + adds r0, r7, 0 + adds r1, r7, 0 + movs r3, 0 + bl sub_8077C44 +_08058762: + adds r0, r5, 0 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80586DC + + thumb_func_start sub_8058770 +sub_8058770: + push {r4-r7,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r6, r1, 0 + mov r12, r2 + adds r5, r3, 0 + ldr r2, [r4, 0x70] + movs r0, 0x10 + ldrsh r3, [r2, r0] + adds r0, r3, 0 + cmp r3, 0 + bge _0805878A + adds r0, r3, 0x3 +_0805878A: + movs r7, 0xE + ldrsh r1, [r2, r7] + asrs r0, 2 + cmp r1, r0 + bgt _08058798 + movs r3, 0 + b _080587BE +_08058798: + movs r0, 0xE + ldrsh r1, [r2, r0] + lsrs r0, r3, 31 + adds r0, r3, r0 + asrs r0, 1 + cmp r1, r0 + bgt _080587AA + movs r3, 0x1 + b _080587BE +_080587AA: + lsls r0, r3, 1 + adds r0, r3 + cmp r0, 0 + bge _080587B4 + adds r0, 0x3 +_080587B4: + asrs r0, 2 + movs r3, 0x3 + cmp r1, r0 + bgt _080587BE + movs r3, 0x2 +_080587BE: + ldr r1, _080587E4 + lsls r0, r3, 2 + adds r0, r1 + ldr r3, [r0] + str r5, [sp] + adds r0, r4, 0 + adds r1, r6, 0 + mov r2, r12 + bl sub_8055640 + adds r1, r0, 0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080587E4: .4byte gUnknown_80F51A4 + thumb_func_end sub_8058770 + + thumb_func_start sub_80587E8 +sub_80587E8: + push {r4-r6,lr} + sub sp, 0x4 + adds r6, r0, 0 + adds r5, r1, 0 + adds r1, r3, 0 + ldr r0, [r5, 0x70] + adds r0, 0xAC + ldrb r0, [r0] + cmp r0, 0x4 + bne _0805881A + movs r3, 0x80 + lsls r3, 2 + str r1, [sp] + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_8055640 + negs r1, r0 + orrs r1, r0 + lsrs r4, r1, 31 + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_807A290 + b _0805882E +_0805881A: + movs r3, 0x80 + lsls r3, 1 + str r1, [sp] + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_8055640 + negs r1, r0 + orrs r1, r0 + lsrs r4, r1, 31 +_0805882E: + adds r0, r4, 0 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80587E8 + + thumb_func_start sub_8058838 +sub_8058838: + push {lr} + sub sp, 0x8 + ldr r2, _08058854 + ldr r2, [r2] + movs r3, 0x1 + str r3, [sp] + str r3, [sp, 0x4] + movs r3, 0x3 + bl sub_8076F80 + movs r0, 0x1 + add sp, 0x8 + pop {r1} + bx r1 + .align 2, 0 +_08058854: .4byte gUnknown_8106A50 + thumb_func_end sub_8058838 + + thumb_func_start sub_8058858 +sub_8058858: + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x8 + adds r6, r0, 0 + mov r8, r1 + ldr r0, _08058898 + ldr r5, [r0] + movs r4, 0x1 + str r4, [sp] + str r4, [sp, 0x4] + adds r0, r6, 0 + adds r2, r5, 0 + movs r3, 0x1 + bl sub_8076E20 + str r4, [sp] + str r4, [sp, 0x4] + adds r0, r6, 0 + mov r1, r8 + adds r2, r5, 0 + movs r3, 0x1 + bl sub_8076F80 + movs r0, 0x1 + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08058898: .4byte gUnknown_8106A4C + thumb_func_end sub_8058858 + + thumb_func_start sub_805889C +sub_805889C: + push {lr} + bl sub_80769CC + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805889C + + thumb_func_start sub_80588A8 +sub_80588A8: + push {lr} + movs r2, 0x1 + bl sub_8079E34 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_80588A8 + + thumb_func_start sub_80588B8 +sub_80588B8: + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r6, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _080588E4 + movs r6, 0x1 + adds r0, r5, 0 + movs r1, 0 + bl sub_8057308 + lsls r0, 24 + cmp r0, 0 + beq _080588E4 + ldr r0, _080588F0 + strb r6, [r0] +_080588E4: + adds r0, r6, 0 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080588F0: .4byte gUnknown_202F219 + thumb_func_end sub_80588B8 + + thumb_func_start sub_80588F4 +sub_80588F4: + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + adds r6, r0, 0 + adds r5, r1, 0 + mov r8, r2 + adds r4, r3, 0 + ldr r0, [r5, 0x70] + movs r1, 0x4 + ldrsh r0, [r0, r1] + bl sub_808DB78 + adds r3, r0, 0 + str r4, [sp] + adds r0, r6, 0 + adds r1, r5, 0 + mov r2, r8 + bl sub_8055640 + adds r1, r0, 0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80588F4 + + thumb_func_start sub_8058930 +sub_8058930: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r7, r0, 0 + movs r0, 0 + mov r8, r0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r0, r7, 0 + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _080589B8 + movs r2, 0x1 + mov r8, r2 + ldr r0, _080589C8 + movs r2, 0 + ldrsh r1, [r0, r2] + adds r0, r7, 0 + bl sub_8057308 + lsls r0, 24 + cmp r0, 0 + beq _080589B8 + ldr r6, [r7, 0x70] + adds r0, r7, 0 + adds r1, r7, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_8077910 + ldr r0, _080589CC + ldr r5, [r0] + adds r0, r7, 0 + adds r1, r7, 0 + adds r2, r5, 0 + movs r3, 0x1 + bl sub_8077084 + ldr r0, _080589D0 + ldr r4, [r0] + adds r0, r7, 0 + adds r1, r7, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8077084 + adds r0, r7, 0 + adds r1, r7, 0 + adds r2, r5, 0 + movs r3, 0x1 + bl sub_8077160 + adds r0, r7, 0 + adds r1, r7, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8077160 + adds r6, 0xFB + ldrb r0, [r6] + cmp r0, 0 + bne _080589B8 + mov r0, r8 + strb r0, [r6] +_080589B8: + mov r0, r8 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080589C8: .4byte gUnknown_80F4DD6 +_080589CC: .4byte gUnknown_8106A4C +_080589D0: .4byte gUnknown_8106A50 + thumb_func_end sub_8058930 + + thumb_func_start sub_80589D4 +sub_80589D4: + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + ldr r4, _08058A04 + bl sub_807E580 + lsls r0, 24 + lsrs r0, 23 + adds r0, r4 + movs r1, 0 + ldrsh r2, [r0, r1] + movs r0, 0x1 + str r0, [sp] + adds r0, r5, 0 + adds r1, r6, 0 + movs r3, 0 + bl sub_8077C44 + movs r0, 0x1 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08058A04: .4byte gUnknown_80F500A + thumb_func_end sub_80589D4 + + thumb_func_start sub_8058A08 +sub_8058A08: + push {lr} + movs r2, 0 + movs r3, 0x1 + bl sub_8077910 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_8058A08 + + thumb_func_start sub_8058A18 +sub_8058A18: + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r6, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _08058A44 + movs r6, 0x1 + adds r0, r5, 0 + movs r1, 0 + bl sub_8057308 + lsls r0, 24 + cmp r0, 0 + beq _08058A44 + ldr r0, _08058A50 + strb r6, [r0] +_08058A44: + adds r0, r6, 0 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08058A50: .4byte gUnknown_202F21A + thumb_func_end sub_8058A18 + + thumb_func_start sub_8058A54 +sub_8058A54: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldr r1, _08058A78 + adds r0, r4, 0 + movs r2, 0 + bl sub_808417C + adds r2, r0, 0 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80781DC + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08058A78: .4byte gUnknown_80F4EB8 + thumb_func_end sub_8058A54 + + thumb_func_start sub_8058A7C +sub_8058A7C: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, _08058AA4 + ldr r2, [r0] + adds r0, r4, 0 + movs r3, 0x1 + bl sub_8077160 + ldr r0, _08058AA8 + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + movs r3, 0x1 + bl sub_8077160 + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08058AA4: .4byte gUnknown_8106A4C +_08058AA8: .4byte gUnknown_8106A50 + thumb_func_end sub_8058A7C + + thumb_func_start sub_8058AAC +sub_8058AAC: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r0, 0 + adds r6, r1, 0 + adds r5, r2, 0 + adds r7, r3, 0 + movs r0, 0 + mov r8, r0 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80570AC + lsls r0, 24 + cmp r0, 0 + beq _08058B14 + ldr r0, _08058B0C + ldr r3, [r0] + str r7, [sp] + adds r0, r4, 0 + adds r1, r6, 0 + adds r2, r5, 0 + bl sub_8055640 + cmp r0, 0 + beq _08058B04 + movs r1, 0x1 + mov r8, r1 + ldr r0, _08058B10 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _08058B04 + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_80776C0 +_08058B04: + adds r0, r4, 0 + bl sub_8079764 + b _08058B2A + .align 2, 0 +_08058B0C: .4byte gUnknown_80F4F4C +_08058B10: .4byte gUnknown_80F4DF4 +_08058B14: + ldr r0, _08058B38 + ldr r0, [r0] + str r0, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + movs r2, 0x3 + adds r3, r5, 0 + bl sub_8079618 + movs r0, 0x1 + mov r8, r0 +_08058B2A: + mov r0, r8 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08058B38: .4byte gUnknown_80FACC4 + thumb_func_end sub_8058AAC + + thumb_func_start sub_8058B3C +sub_8058B3C: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _08058B76 + movs r7, 0x1 + ldr r0, _08058B80 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _08058B76 + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_80767B0 +_08058B76: + adds r0, r7, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08058B80: .4byte gUnknown_80F4DBC + thumb_func_end sub_8058B3C + + thumb_func_start sub_8058B84 +sub_8058B84: + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r6, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _08058BCC + movs r6, 0x1 + ldr r0, _08058BD8 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r5, 0 + adds r1, r5, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _08058BCC + ldr r4, [r5, 0x70] + ldr r0, _08058BDC + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r5, 0 + movs r3, 0x1 + bl sub_8077084 + adds r4, 0xFB + ldrb r0, [r4] + cmp r0, 0 + bne _08058BCC + strb r6, [r4] +_08058BCC: + adds r0, r6, 0 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08058BD8: .4byte gUnknown_80F4DD0 +_08058BDC: .4byte gUnknown_8106A4C + thumb_func_end sub_8058B84 + + thumb_func_start sub_8058BE0 +sub_8058BE0: + push {lr} + adds r1, r0, 0 + bl sub_8079C24 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_8058BE0 + + thumb_func_start sub_8058BF0 +sub_8058BF0: + push {lr} + movs r2, 0x1 + movs r3, 0x1 + bl sub_80779F0 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_8058BF0 + + thumb_func_start sub_8058C00 +sub_8058C00: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _08058C3A + movs r7, 0x1 + ldr r0, _08058C44 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _08058C3A + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_8077AE4 +_08058C3A: + adds r0, r7, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08058C44: .4byte gUnknown_80F4DF8 + thumb_func_end sub_8058C00 + + thumb_func_start sub_8058C48 +sub_8058C48: + push {r4-r7,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r6, r1, 0 + adds r7, r2, 0 + adds r5, r3, 0 + movs r1, 0xC0 + lsls r1, 1 + movs r0, 0x80 + bl sub_808411C + adds r3, r0, 0 + ldr r0, [r4, 0x70] + ldrb r0, [r0, 0x9] + muls r0, r3 + cmp r0, 0 + bge _08058C6C + adds r0, 0xFF +_08058C6C: + asrs r3, r0, 8 + cmp r3, 0 + bge _08058C74 + movs r3, 0x1 +_08058C74: + cmp r3, 0xC7 + ble _08058C7A + movs r3, 0xC7 +_08058C7A: + str r5, [sp] + adds r0, r4, 0 + adds r1, r6, 0 + adds r2, r7, 0 + bl sub_8055864 + adds r1, r0, 0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8058C48 + + thumb_func_start sub_8058C98 +sub_8058C98: + push {r4-r7,lr} + sub sp, 0x8 + adds r4, r0, 0 + adds r5, r1, 0 + adds r7, r3, 0 + ldr r0, [sp, 0x1C] + movs r6, 0 + movs r3, 0x80 + lsls r3, 1 + str r0, [sp] + adds r0, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _08058CDE + movs r6, 0x1 + ldr r0, _08058CE8 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _08058CDE + str r6, [sp] + movs r0, 0 + str r0, [sp, 0x4] + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r7, 0 + movs r3, 0x1 + bl sub_8076F80 +_08058CDE: + adds r0, r6, 0 + add sp, 0x8 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08058CE8: .4byte gUnknown_80F4DC0 + thumb_func_end sub_8058C98 + + thumb_func_start sub_8058CEC +sub_8058CEC: + push {r4-r6,lr} + sub sp, 0x8 + adds r5, r0, 0 + movs r6, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _08058D28 + movs r6, 0x1 + adds r0, r5, 0 + movs r1, 0 + bl sub_8057308 + lsls r0, 24 + cmp r0, 0 + beq _08058D28 + ldr r0, _08058D34 + ldr r2, [r0] + movs r0, 0 + str r0, [sp] + str r0, [sp, 0x4] + adds r0, r5, 0 + adds r1, r5, 0 + movs r3, 0x2 + bl sub_8076E20 +_08058D28: + adds r0, r6, 0 + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08058D34: .4byte gUnknown_8106A50 + thumb_func_end sub_8058CEC + + thumb_func_start sub_8058D38 +sub_8058D38: + push {lr} + bl sub_8075FCC + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_8058D38 + + thumb_func_start sub_8058D44 +sub_8058D44: + push {r4-r7,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r6, r1, 0 + mov r12, r2 + adds r5, r3, 0 + ldr r2, [r4, 0x70] + movs r0, 0x10 + ldrsh r3, [r2, r0] + adds r0, r3, 0 + cmp r3, 0 + bge _08058D5E + adds r0, r3, 0x3 +_08058D5E: + movs r7, 0xE + ldrsh r1, [r2, r7] + asrs r0, 2 + cmp r1, r0 + bgt _08058D6C + movs r3, 0 + b _08058D92 +_08058D6C: + movs r0, 0xE + ldrsh r1, [r2, r0] + lsrs r0, r3, 31 + adds r0, r3, r0 + asrs r0, 1 + cmp r1, r0 + bgt _08058D7E + movs r3, 0x1 + b _08058D92 +_08058D7E: + lsls r0, r3, 1 + adds r0, r3 + cmp r0, 0 + bge _08058D88 + adds r0, 0x3 +_08058D88: + asrs r0, 2 + movs r3, 0x3 + cmp r1, r0 + bgt _08058D92 + movs r3, 0x2 +_08058D92: + ldr r1, _08058DB8 + lsls r0, r3, 2 + adds r0, r1 + ldr r3, [r0] + str r5, [sp] + adds r0, r4, 0 + adds r1, r6, 0 + mov r2, r12 + bl sub_8055640 + adds r1, r0, 0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08058DB8: .4byte gUnknown_80F51B4 + thumb_func_end sub_8058D44 + + thumb_func_start sub_8058DBC +sub_8058DBC: + push {r4-r7,lr} + adds r7, r0, 0 + adds r6, r1, 0 + ldr r5, [r7, 0x70] + ldr r4, [r6, 0x70] + adds r0, r6, 0 + bl nullsub_92 + movs r3, 0 +_08058DCE: + lsls r2, r3, 1 + adds r1, r5, 0 + adds r1, 0x1C + adds r1, r2 + adds r0, r4, 0 + adds r0, 0x1C + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + adds r1, r5, 0 + adds r1, 0x20 + adds r1, r2 + adds r0, r4, 0 + adds r0, 0x20 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + adds r1, r5, 0 + adds r1, 0x24 + adds r1, r2 + adds r0, r4, 0 + adds r0, 0x24 + adds r0, r2 + ldrh r0, [r0] + strh r0, [r1] + lsls r2, r3, 2 + adds r1, r5, 0 + adds r1, 0x2C + adds r1, r2 + adds r0, r4, 0 + adds r0, 0x2C + adds r0, r2 + ldr r0, [r0] + str r0, [r1] + adds r1, r5, 0 + adds r1, 0x34 + adds r1, r2 + adds r0, r4, 0 + adds r0, 0x34 + adds r0, r2 + ldr r0, [r0] + str r0, [r1] + adds r3, 0x1 + cmp r3, 0x1 + ble _08058DCE + ldr r0, _08058E54 + adds r1, r6, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08058E58 + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r6, 0 + bl sub_80522F4 + adds r1, r5, 0 + adds r1, 0xFB + ldrb r0, [r1] + cmp r0, 0 + bne _08058E4C + movs r0, 0x1 + strb r0, [r1] +_08058E4C: + movs r0, 0x1 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08058E54: .4byte gUnknown_202DF98 +_08058E58: .4byte gUnknown_80FBD58 + thumb_func_end sub_8058DBC + + thumb_func_start sub_8058E5C +sub_8058E5C: + push {r4-r7,lr} + sub sp, 0x18 + adds r5, r0, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _08058ED0 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08058ED0 + ldr r0, [r5, 0x70] + movs r1, 0x10 + ldrsh r2, [r0, r1] + cmp r2, 0 + bge _08058E8C + adds r2, 0x7 +_08058E8C: + asrs r6, r2, 3 + cmp r6, 0 + bne _08058E94 + movs r6, 0x1 +_08058E94: + movs r7, 0x1 + adds r0, r5, 0 + movs r1, 0x7 + bl sub_8071824 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _08058ED0 + adds r0, r5, 0 + movs r1, 0 + bl sub_8057308 + lsls r0, 24 + cmp r0, 0 + beq _08058ED0 + str r4, [sp] + str r4, [sp, 0x4] + ldr r0, _08058EDC + str r0, [sp, 0x8] + movs r0, 0x14 + str r0, [sp, 0xC] + str r7, [sp, 0x10] + str r4, [sp, 0x14] + adds r0, r5, 0 + adds r1, r5, 0 + adds r2, r6, 0 + movs r3, 0 + bl sub_806F370 +_08058ED0: + adds r0, r7, 0 + add sp, 0x18 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08058EDC: .4byte 0x000001fd + thumb_func_end sub_8058E5C + + thumb_func_start sub_8058EE0 +sub_8058EE0: + push {lr} + sub sp, 0x4 + ldr r2, [r1, 0x70] + movs r3, 0x10 + ldrsh r2, [r2, r3] + lsrs r3, r2, 31 + adds r2, r3 + asrs r2, 1 + movs r3, 0x1 + str r3, [sp] + movs r3, 0 + bl sub_8077C44 + movs r0, 0x1 + add sp, 0x4 + pop {r1} + bx r1 + thumb_func_end sub_8058EE0 + + thumb_func_start sub_8058F04 +sub_8058F04: + push {r4-r7,lr} + sub sp, 0x4 + adds r7, r0, 0 + adds r4, r1, 0 + mov r12, r2 + adds r5, r3, 0 + ldr r3, [r4, 0x70] + movs r6, 0x1 + ldr r0, _08058F50 + ldr r1, [r0] + movs r0, 0xC1 + lsls r0, 9 + adds r2, r1, r0 + movs r0, 0xC + str r0, [r2] + ldr r0, _08058F54 + adds r1, r0 + movs r0, 0 + str r0, [r1] + adds r3, 0xC0 + ldrb r0, [r3] + cmp r0, 0xA + bne _08058F34 + movs r6, 0x2 +_08058F34: + lsls r3, r6, 8 + str r5, [sp] + adds r0, r7, 0 + adds r1, r4, 0 + mov r2, r12 + bl sub_8055640 + cmp r0, 0 + beq _08058F48 + movs r0, 0x1 +_08058F48: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08058F50: .4byte gUnknown_203B418 +_08058F54: .4byte 0x00018204 + thumb_func_end sub_8058F04 + + thumb_func_start sub_8058F58 +sub_8058F58: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r6, r0, 0 + adds r7, r1, 0 + mov r8, r3 + ldr r0, _08058FB0 + ldr r0, [r0] + ldr r1, _08058FB4 + adds r0, r1 + movs r1, 0 + ldrsh r5, [r0, r1] + cmp r5, 0 + bge _08058F78 + movs r5, 0 +_08058F78: + cmp r5, 0x4A + ble _08058F7E + movs r5, 0x4A +_08058F7E: + ldr r4, _08058FB8 + lsls r5, 3 + adds r0, r5, r4 + ldrh r1, [r0] + mov r0, sp + bl sub_8092A88 + adds r4, 0x4 + adds r5, r4 + ldr r4, [r5] + adds r0, r6, 0 + adds r1, r7, 0 + mov r2, sp + mov r3, r8 + bl _call_via_r4 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08058FB0: .4byte gUnknown_203B418 +_08058FB4: .4byte 0x00003a0e +_08058FB8: .4byte gUnknown_80F5D10 + thumb_func_end sub_8058F58 + + thumb_func_start sub_8058FBC +sub_8058FBC: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _08058FF6 + movs r7, 0x1 + ldr r0, _08059000 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _08058FF6 + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_8077780 +_08058FF6: + adds r0, r7, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08059000: .4byte gUnknown_80F4DE4 + thumb_func_end sub_8058FBC + + thumb_func_start sub_8059004 +sub_8059004: + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x8 + mov r9, r0 + mov r8, r1 + adds r5, r2, 0 + adds r6, r3, 0 + adds r0, r5, 0 + bl sub_8092B00 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_8057600 + lsls r0, 16 + asrs r0, 16 + mov r2, r8 + adds r2, 0x4 + str r4, [sp] + str r0, [sp, 0x4] + mov r0, r9 + mov r1, r8 + movs r3, 0x1 + bl sub_807DF38 + movs r0, 0x1 + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8059004 + + thumb_func_start sub_8059050 +sub_8059050: + push {lr} + movs r2, 0x1 + bl sub_8077780 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_8059050 + + thumb_func_start sub_8059060 +sub_8059060: + push {lr} + sub sp, 0x4 + adds r3, r2, 0 + ldr r2, _0805907C + ldr r2, [r2] + str r2, [sp] + movs r2, 0xB + bl sub_8079618 + movs r0, 0x1 + add sp, 0x4 + pop {r1} + bx r1 + .align 2, 0 +_0805907C: .4byte gUnknown_80FAD6C + thumb_func_end sub_8059060 + + thumb_func_start sub_8059080 +sub_8059080: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _080590BA + movs r7, 0x1 + ldr r0, _080590C4 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _080590BA + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_8077780 +_080590BA: + adds r0, r7, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080590C4: .4byte gUnknown_80F4DE8 + thumb_func_end sub_8059080 + + thumb_func_start sub_80590C8 +sub_80590C8: + push {lr} + bl sub_80798B0 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_80590C8 + + thumb_func_start sub_80590D4 +sub_80590D4: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x1C + mov r8, r0 + adds r6, r1, 0 + adds r5, r2, 0 + adds r7, r3, 0 + movs r0, 0 + mov r9, r0 + add r0, sp, 0x18 + mov r1, r9 + strb r1, [r0] + adds r0, r5, 0 + bl sub_8092B00 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + bl sub_806F4A4 + lsls r0, 24 + lsrs r0, 24 + negs r1, r0 + orrs r1, r0 + lsrs r4, r1, 31 + adds r0, r6, 0 + movs r1, 0x37 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0805911C + movs r4, 0 +_0805911C: + cmp r4, 0 + bne _08059134 + ldr r0, _08059130 + ldr r2, [r0] + mov r0, r8 + adds r1, r6, 0 + bl sub_80522F4 + b _0805917A + .align 2, 0 +_08059130: .4byte gUnknown_80FEB88 +_08059134: + adds r0, r5, 0 + bl sub_8092B00 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + adds r1, r7, 0 + bl sub_8057600 + lsls r0, 16 + asrs r0, 16 + ldr r2, _0805918C + add r1, sp, 0x18 + str r1, [sp] + str r4, [sp, 0x4] + str r0, [sp, 0x8] + mov r0, r9 + str r0, [sp, 0xC] + movs r0, 0x1 + str r0, [sp, 0x10] + str r0, [sp, 0x14] + mov r0, r8 + adds r1, r6, 0 + movs r3, 0x1 + bl sub_806F370 + add r1, sp, 0x18 + movs r2, 0 + adds r0, r1, 0 + ldrb r0, [r0] + cmp r0, 0 + bne _08059178 + movs r2, 0x1 +_08059178: + strb r2, [r1] +_0805917A: + add r0, sp, 0x18 + ldrb r0, [r0] + add sp, 0x1C + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805918C: .4byte 0x0000270f + thumb_func_end sub_80590D4 + + thumb_func_start sub_8059190 +sub_8059190: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _080591CA + movs r7, 0x1 + ldr r0, _080591D4 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _080591CA + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_80776C0 +_080591CA: + adds r0, r7, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080591D4: .4byte gUnknown_80F4DEA + thumb_func_end sub_8059190 + + thumb_func_start sub_80591D8 +sub_80591D8: + push {lr} + bl sub_8079834 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_80591D8 + + thumb_func_start sub_80591E4 +sub_80591E4: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + adds r7, r0, 0 + adds r4, r1, 0 + adds r6, r2, 0 + adds r5, r3, 0 + movs r0, 0 + mov r8, r0 + adds r0, r4, 0 + movs r1, 0x3A + bl sub_8071824 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + movs r3, 0x80 + lsls r3, 1 + str r5, [sp] + adds r0, r7, 0 + adds r1, r4, 0 + adds r2, r6, 0 + bl sub_8055640 + adds r1, r0, 0 + cmp r1, 0 + beq _0805927E + lsrs r0, r1, 31 + adds r0, r1, r0 + asrs r4, r0, 1 + cmp r4, 0 + bgt _0805922A + movs r4, 0x1 +_0805922A: + adds r0, r7, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0805927E + ldr r0, [r7, 0x70] + movs r1, 0x1 + mov r8, r1 + adds r1, r0, 0 + adds r1, 0xFB + ldrb r0, [r1] + cmp r0, 0 + bne _0805924A + mov r0, r8 + strb r0, [r1] +_0805924A: + adds r0, r7, 0 + movs r1, 0 + bl sub_8057308 + lsls r0, 24 + cmp r0, 0 + beq _0805927E + mov r1, r9 + cmp r1, 0 + beq _0805926E + movs r3, 0xFD + lsls r3, 1 + adds r0, r7, 0 + adds r1, r4, 0 + movs r2, 0xD + bl sub_806F324 + b _0805927E +_0805926E: + mov r0, r8 + str r0, [sp] + adds r0, r7, 0 + adds r1, r7, 0 + adds r2, r4, 0 + movs r3, 0 + bl sub_8077C44 +_0805927E: + mov r0, r8 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80591E4 + + thumb_func_start sub_8059290 +sub_8059290: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + adds r6, r1, 0 + ldr r7, [r4, 0x70] + ldr r5, [r6, 0x70] + adds r0, r6, 0 + movs r1, 0x35 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + bne _080592BA + adds r0, r4, 0 + movs r1, 0x35 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _080592D0 +_080592BA: + ldr r0, _080592CC + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_80522F4 + movs r0, 0 + b _0805932E + .align 2, 0 +_080592CC: .4byte gUnknown_80FC8C0 +_080592D0: + movs r0, 0x5E + adds r0, r5 + mov r12, r0 + ldrb r3, [r0] + mov r8, r3 + adds r1, r5, 0 + adds r1, 0x5F + ldrb r2, [r1] + adds r5, r7, 0 + adds r5, 0x5E + ldrb r0, [r5] + mov r3, r12 + strb r0, [r3] + movs r0, 0x5F + adds r0, r7 + mov r12, r0 + ldrb r0, [r0] + strb r0, [r1] + mov r3, r8 + strb r3, [r5] + mov r0, r12 + strb r2, [r0] + ldr r0, _08059338 + ldr r0, [r0] + movs r5, 0x1 + strb r5, [r0, 0xC] + ldr r0, _0805933C + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_80522F4 + adds r1, r7, 0 + adds r1, 0xFB + ldrb r0, [r1] + cmp r0, 0 + bne _0805931C + strb r5, [r1] +_0805931C: + adds r0, r4, 0 + adds r1, r4, 0 + bl sub_806ABAC + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_806ABAC + movs r0, 0x1 +_0805932E: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08059338: .4byte gUnknown_203B418 +_0805933C: .4byte gUnknown_80FC888 + thumb_func_end sub_8059290 + + thumb_func_start sub_8059340 +sub_8059340: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r6, r0, 0 + adds r7, r1, 0 + adds r5, r2, 0 + movs r0, 0 + mov r10, r0 + ldr r1, [r6, 0x70] + str r1, [sp] + ldr r0, [r7, 0x70] + movs r2, 0 + mov r12, r2 + movs r4, 0 + movs r1, 0x8C + lsls r1, 1 + adds r3, r0, r1 + adds r1, r0, 0 + movs r2, 0x1 + mov r9, r2 + movs r0, 0x10 + mov r8, r0 +_08059372: + ldrb r2, [r3] + mov r0, r9 + ands r0, r2 + cmp r0, 0 + beq _08059384 + mov r0, r8 + ands r0, r2 + cmp r0, 0 + bne _080593A8 +_08059384: + adds r3, 0x8 + adds r1, 0x8 + adds r4, 0x1 + cmp r4, 0x3 + ble _08059372 + movs r0, 0 + cmp r0, 0 + bne _080593B2 + ldr r0, _080593A4 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_80522F4 + movs r0, 0 + b _0805940A + .align 2, 0 +_080593A4: .4byte gUnknown_80FE3BC +_080593A8: + movs r2, 0x8D + lsls r2, 1 + adds r0, r1, r2 + ldrh r0, [r0] + mov r12, r0 +_080593B2: + mov r0, r12 + cmp r0, 0 + bne _080593CC + ldr r0, _080593C8 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_80522F4 + b _08059408 + .align 2, 0 +_080593C8: .4byte gUnknown_80FE3BC +_080593CC: + adds r0, r5, 0 + mov r1, r12 + bl sub_8092A88 + ldr r0, _0805941C + adds r1, r5, 0 + movs r2, 0 + bl sub_80928C0 + ldrb r1, [r5, 0x1] + movs r0, 0x4 + orrs r0, r1 + movs r1, 0x20 + orrs r0, r1 + strb r0, [r5, 0x1] + ldr r0, _08059420 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_80522F4 + ldr r1, [sp] + adds r1, 0xFB + ldrb r0, [r1] + cmp r0, 0 + bne _08059404 + movs r0, 0x1 + strb r0, [r1] +_08059404: + movs r1, 0x1 + mov r10, r1 +_08059408: + mov r0, r10 +_0805940A: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805941C: .4byte gUnknown_202DE58 +_08059420: .4byte gUnknown_80FE38C + thumb_func_end sub_8059340 + + thumb_func_start sub_8059424 +sub_8059424: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _0805945E + movs r7, 0x1 + ldr r0, _08059468 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _0805945E + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_80776C0 +_0805945E: + adds r0, r7, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08059468: .4byte gUnknown_80F4DF0 + thumb_func_end sub_8059424 + + thumb_func_start sub_805946C +sub_805946C: + push {r4-r6,lr} + sub sp, 0x18 + adds r5, r0, 0 + movs r6, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _080594D2 + movs r6, 0x1 + adds r0, r5, 0 + movs r1, 0x7 + bl sub_8071824 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _080594D2 + adds r0, r5, 0 + movs r1, 0 + bl sub_8057308 + lsls r0, 24 + cmp r0, 0 + beq _080594D2 + ldr r0, [r5, 0x70] + movs r1, 0x10 + ldrsh r2, [r0, r1] + cmp r2, 0 + bge _080594B0 + adds r2, 0x7 +_080594B0: + asrs r2, 3 + cmp r2, 0 + bne _080594B8 + movs r2, 0x1 +_080594B8: + str r4, [sp] + str r4, [sp, 0x4] + ldr r0, _080594DC + str r0, [sp, 0x8] + movs r0, 0x14 + str r0, [sp, 0xC] + str r6, [sp, 0x10] + str r4, [sp, 0x14] + adds r0, r5, 0 + adds r1, r5, 0 + movs r3, 0 + bl sub_806F370 +_080594D2: + adds r0, r6, 0 + add sp, 0x18 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080594DC: .4byte 0x000001fd + thumb_func_end sub_805946C + + thumb_func_start sub_80594E0 +sub_80594E0: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, _08059518 + ldr r0, [r0] + ldr r1, _0805951C + ldrh r1, [r1] + ldr r2, _08059520 + adds r0, r2 + strb r1, [r0] + movs r0, 0x1 + movs r1, 0 + bl sub_807EAA0 + lsls r0, 24 + cmp r0, 0 + bne _0805950E + ldr r0, _08059524 + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80522F4 +_0805950E: + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08059518: .4byte gUnknown_203B418 +_0805951C: .4byte gUnknown_80F4F42 +_08059520: .4byte 0x0000e269 +_08059524: .4byte gUnknown_80FCF78 + thumb_func_end sub_80594E0 + + thumb_func_start sub_8059528 +sub_8059528: + push {lr} + ldr r2, _0805953C + ldr r2, [r2] + movs r3, 0x1 + bl sub_80775DC + movs r0, 0x1 + pop {r1} + bx r1 + .align 2, 0 +_0805953C: .4byte gUnknown_8106A4C + thumb_func_end sub_8059528 + + thumb_func_start sub_8059540 +sub_8059540: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _0805957A + movs r7, 0x1 + ldr r0, _08059584 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _0805957A + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_80763F8 +_0805957A: + adds r0, r7, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08059584: .4byte gUnknown_80F4DC4 + thumb_func_end sub_8059540 + + thumb_func_start sub_8059588 +sub_8059588: + push {lr} + ldr r2, _0805959C + ldr r2, [r2] + movs r3, 0x1 + bl sub_8077084 + movs r0, 0x1 + pop {r1} + bx r1 + .align 2, 0 +_0805959C: .4byte gUnknown_8106A50 + thumb_func_end sub_8059588 + + thumb_func_start sub_80595A0 +sub_80595A0: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _080595DC + movs r7, 0x1 + ldr r0, _080595E8 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _080595DC + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0 + bl sub_8076210 +_080595DC: + adds r0, r7, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080595E8: .4byte gUnknown_80F4DE0 + thumb_func_end sub_80595A0 + + thumb_func_start sub_80595EC +sub_80595EC: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x1C + mov r9, r0 + adds r6, r1, 0 + adds r5, r2, 0 + mov r8, r3 + movs r7, 0 + add r0, sp, 0x18 + strb r7, [r0] + adds r0, r5, 0 + bl sub_8092B00 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + bl sub_806F4A4 + lsls r0, 24 + cmp r0, 0 + bne _08059630 + ldr r0, _0805962C + ldr r2, [r0] + mov r0, r9 + adds r1, r6, 0 + bl sub_80522F4 + movs r0, 0 + b _08059678 + .align 2, 0 +_0805962C: .4byte gUnknown_80FEB8C +_08059630: + adds r0, r5, 0 + bl sub_8092B00 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + mov r1, r8 + bl sub_8057600 + lsls r0, 16 + asrs r0, 16 + ldr r2, _08059688 + add r1, sp, 0x18 + str r1, [sp] + str r4, [sp, 0x4] + str r0, [sp, 0x8] + str r7, [sp, 0xC] + movs r0, 0x1 + str r0, [sp, 0x10] + str r7, [sp, 0x14] + mov r0, r9 + adds r1, r6, 0 + movs r3, 0x1 + bl sub_806F370 + add r1, sp, 0x18 + movs r2, 0 + adds r0, r1, 0 + ldrb r0, [r0] + cmp r0, 0 + bne _08059672 + movs r2, 0x1 +_08059672: + strb r2, [r1] + add r0, sp, 0x18 + ldrb r0, [r0] +_08059678: + add sp, 0x1C + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08059688: .4byte 0x0000270f + thumb_func_end sub_80595EC + + thumb_func_start sub_805968C +sub_805968C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r5, r0, 0 + mov r8, r1 + adds r6, r2, 0 + adds r7, r3, 0 + bl sub_807E580 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + beq _080596B6 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_80570AC + lsls r0, 24 + cmp r0, 0 + beq _080596EC +_080596B6: + ldr r0, _080596E8 + ldr r3, [r0] + cmp r4, 0x2 + beq _080596C6 + cmp r4, 0x4 + beq _080596C6 + cmp r4, 0x5 + bne _080596CC +_080596C6: + lsrs r0, r3, 31 + adds r0, r3, r0 + asrs r3, r0, 1 +_080596CC: + str r7, [sp] + adds r0, r5, 0 + mov r1, r8 + adds r2, r6, 0 + bl sub_8055640 + negs r1, r0 + orrs r1, r0 + lsrs r4, r1, 31 + adds r0, r5, 0 + bl sub_8079764 + b _08059700 + .align 2, 0 +_080596E8: .4byte gUnknown_80F4F48 +_080596EC: + ldr r0, _08059710 + ldr r0, [r0] + str r0, [sp] + adds r0, r5, 0 + adds r1, r5, 0 + movs r2, 0x2 + adds r3, r6, 0 + bl sub_8079618 + movs r4, 0x1 +_08059700: + adds r0, r4, 0 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08059710: .4byte gUnknown_80FACE4 + thumb_func_end sub_805968C + + thumb_func_start sub_8059714 +sub_8059714: + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0x1C + mov r9, r0 + mov r10, r1 + adds r6, r2, 0 + mov r8, r3 + movs r5, 0 + add r0, sp, 0x18 + strb r5, [r0] + adds r0, r6, 0 + bl sub_8092B00 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + mov r1, r8 + bl sub_8057600 + lsls r0, 16 + asrs r0, 16 + ldr r1, _0805978C + movs r3, 0 + ldrsh r2, [r1, r3] + add r1, sp, 0x18 + str r1, [sp] + str r4, [sp, 0x4] + str r0, [sp, 0x8] + str r5, [sp, 0xC] + movs r0, 0x1 + str r0, [sp, 0x10] + str r5, [sp, 0x14] + mov r0, r9 + mov r1, r10 + movs r3, 0x1 + bl sub_806F370 + add r1, sp, 0x18 + movs r2, 0 + adds r0, r1, 0 + ldrb r0, [r0] + cmp r0, 0 + bne _08059774 + movs r2, 0x1 +_08059774: + strb r2, [r1] + add r0, sp, 0x18 + ldrb r0, [r0] + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0805978C: .4byte gUnknown_80F4F7C + thumb_func_end sub_8059714 + + thumb_func_start sub_8059790 +sub_8059790: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r7, r1, 0 + adds r4, r2, 0 + adds r6, r3, 0 + adds r1, r4, 0 + bl sub_80570AC + lsls r0, 24 + cmp r0, 0 + beq _080597CC + ldr r0, _080597C8 + ldr r3, [r0] + str r6, [sp] + adds r0, r5, 0 + adds r1, r7, 0 + adds r2, r4, 0 + bl sub_8055640 + negs r1, r0 + orrs r1, r0 + lsrs r4, r1, 31 + adds r0, r5, 0 + bl sub_8079764 + b _080597E0 + .align 2, 0 +_080597C8: .4byte gUnknown_80F4F5C +_080597CC: + ldr r0, _080597EC + ldr r0, [r0] + str r0, [sp] + adds r0, r5, 0 + adds r1, r5, 0 + movs r2, 0x7 + adds r3, r4, 0 + bl sub_8079618 + movs r4, 0x1 +_080597E0: + adds r0, r4, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080597EC: .4byte gUnknown_80FACFC + thumb_func_end sub_8059790 + + thumb_func_start sub_80597F0 +sub_80597F0: + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x8 + mov r9, r0 + mov r8, r1 + adds r5, r2, 0 + adds r6, r3, 0 + adds r0, r5, 0 + bl sub_8092B00 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_8057600 + lsls r0, 16 + asrs r0, 16 + mov r2, r8 + adds r2, 0x4 + str r4, [sp] + str r0, [sp, 0x4] + mov r0, r9 + mov r1, r8 + movs r3, 0x2 + bl sub_807DF38 + movs r0, 0x1 + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80597F0 + + thumb_func_start sub_805983C +sub_805983C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r0, 0 + adds r7, r1, 0 + adds r5, r2, 0 + mov r8, r3 + movs r6, 0 + bl sub_8045128 + bl sub_804AF20 + lsls r0, 24 + cmp r0, 0 + beq _08059870 + ldr r0, _0805986C + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r7, 0 + bl sub_80522F4 + b _080598B8 + .align 2, 0 +_0805986C: .4byte gUnknown_80FD128 +_08059870: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80570AC + lsls r0, 24 + cmp r0, 0 + beq _080598A4 + ldr r0, _080598A0 + ldr r3, [r0] + mov r0, r8 + str r0, [sp] + adds r0, r4, 0 + adds r1, r7, 0 + adds r2, r5, 0 + bl sub_8055640 + negs r1, r0 + orrs r1, r0 + lsrs r6, r1, 31 + adds r0, r4, 0 + bl sub_8079764 + b _080598B8 + .align 2, 0 +_080598A0: .4byte gUnknown_80F4F64 +_080598A4: + ldr r0, _080598C8 + ldr r0, [r0] + str r0, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + movs r2, 0x9 + adds r3, r5, 0 + bl sub_8079618 + movs r6, 0x1 +_080598B8: + adds r0, r6, 0 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080598C8: .4byte gUnknown_80FAD2C + thumb_func_end sub_805983C + + thumb_func_start sub_80598CC +sub_80598CC: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _0805990A + movs r7, 0x1 + ldr r0, _08059914 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _0805990A + ldr r0, _08059918 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r6, 0 + movs r3, 0 + bl sub_80775DC +_0805990A: + adds r0, r7, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08059914: .4byte gUnknown_80F4E00 +_08059918: .4byte gUnknown_8106A4C + thumb_func_end sub_80598CC + + thumb_func_start sub_805991C +sub_805991C: + push {lr} + bl sub_80787E4 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805991C + + thumb_func_start sub_8059928 +sub_8059928: + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r4, r1, 0 + adds r1, r3, 0 + movs r3, 0x1 + movs r6, 0 + ldr r0, [r4, 0x70] + adds r0, 0xC0 + ldrb r0, [r0] + subs r0, 0x7 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _08059948 + movs r3, 0x2 +_08059948: + lsls r3, 8 + str r1, [sp] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _08059978 + movs r6, 0x1 + ldr r0, _08059984 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _08059978 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_80776C0 +_08059978: + adds r0, r6, 0 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08059984: .4byte gUnknown_80F4DEC + thumb_func_end sub_8059928 + + thumb_func_start sub_8059988 +sub_8059988: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _080599A8 + movs r7, 0x1 + ldr r0, _080599E0 + strb r7, [r0] +_080599A8: + ldr r0, _080599E0 + ldrb r0, [r0] + cmp r0, 0 + beq _080599D6 + ldr r0, _080599E4 + ldr r0, [r0] + cmp r0, 0x2 + bne _080599D6 + ldr r0, _080599E8 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _080599D6 + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_80763F8 +_080599D6: + adds r0, r7, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080599E0: .4byte gUnknown_202F218 +_080599E4: .4byte gUnknown_202F214 +_080599E8: .4byte gUnknown_80F4DC8 + thumb_func_end sub_8059988 + + thumb_func_start sub_80599EC +sub_80599EC: + push {r4,lr} + sub sp, 0x4 + adds r3, r0, 0 + ldr r0, [r1, 0x70] + movs r4, 0x10 + ldrsh r2, [r0, r4] + cmp r2, 0 + bge _080599FE + adds r2, 0x3 +_080599FE: + asrs r2, 2 + movs r0, 0x1 + str r0, [sp] + adds r0, r3, 0 + movs r3, 0 + bl sub_8077C44 + movs r0, 0x1 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80599EC + + thumb_func_start sub_8059A18 +sub_8059A18: + push {lr} + ldr r2, _08059A28 + ldr r2, [r2] + bl sub_8077540 + movs r0, 0x1 + pop {r1} + bx r1 + .align 2, 0 +_08059A28: .4byte gUnknown_8106A50 + thumb_func_end sub_8059A18 + + thumb_func_start sub_8059A2C +sub_8059A2C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + mov r9, r0 + adds r7, r1, 0 + adds r6, r2, 0 + mov r8, r3 + movs r5, 0 + add r0, sp, 0x18 + strb r5, [r0] + mov r1, r9 + ldr r0, [r1, 0x70] + ldrb r0, [r0, 0x9] + mov r10, r0 + adds r0, r6, 0 + bl sub_8092B00 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + mov r1, r8 + bl sub_8057600 + lsls r0, 16 + asrs r0, 16 + add r1, sp, 0x18 + str r1, [sp] + str r4, [sp, 0x4] + str r0, [sp, 0x8] + str r5, [sp, 0xC] + movs r0, 0x1 + str r0, [sp, 0x10] + str r5, [sp, 0x14] + mov r0, r9 + adds r1, r7, 0 + mov r2, r10 + movs r3, 0x1 + bl sub_806F370 + add r1, sp, 0x18 + movs r2, 0 + adds r0, r1, 0 + ldrb r0, [r0] + cmp r0, 0 + bne _08059A90 + movs r2, 0x1 +_08059A90: + strb r2, [r1] + add r0, sp, 0x18 + ldrb r0, [r0] + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8059A2C + + thumb_func_start sub_8059AA8 +sub_8059AA8: + push {lr} + movs r2, 0x1 + bl sub_8077AE4 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_8059AA8 + + thumb_func_start sub_8059AB8 +sub_8059AB8: + push {lr} + bl sub_8078758 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_8059AB8 + + thumb_func_start sub_8059AC4 +sub_8059AC4: + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + ldr r4, _08059AF4 + bl sub_807E580 + lsls r0, 24 + lsrs r0, 23 + adds r0, r4 + movs r1, 0 + ldrsh r2, [r0, r1] + movs r0, 0x1 + str r0, [sp] + adds r0, r5, 0 + adds r1, r6, 0 + movs r3, 0 + bl sub_8077C44 + movs r0, 0x1 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08059AF4: .4byte gUnknown_80F501A + thumb_func_end sub_8059AC4 + + thumb_func_start sub_8059AF8 +sub_8059AF8: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x1C + mov r9, r0 + adds r6, r1, 0 + adds r5, r2, 0 + mov r8, r3 + movs r7, 0 + add r0, sp, 0x18 + strb r7, [r0] + adds r0, r5, 0 + bl sub_8092B00 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + bl sub_806F4A4 + lsls r0, 24 + cmp r0, 0 + bne _08059B3C + ldr r0, _08059B38 + ldr r2, [r0] + mov r0, r9 + adds r1, r6, 0 + bl sub_80522F4 + movs r0, 0 + b _08059B82 + .align 2, 0 +_08059B38: .4byte gUnknown_80FEB90 +_08059B3C: + adds r0, r5, 0 + bl sub_8092B00 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + mov r1, r8 + bl sub_8057600 + lsls r0, 16 + asrs r0, 16 + ldr r2, _08059B90 + add r1, sp, 0x18 + str r1, [sp] + str r4, [sp, 0x4] + str r0, [sp, 0x8] + str r7, [sp, 0xC] + str r7, [sp, 0x10] + str r7, [sp, 0x14] + mov r0, r9 + adds r1, r6, 0 + movs r3, 0x1 + bl sub_806F370 + add r1, sp, 0x18 + movs r2, 0 + adds r0, r1, 0 + ldrb r0, [r0] + cmp r0, 0 + bne _08059B7C + movs r2, 0x1 +_08059B7C: + strb r2, [r1] + add r0, sp, 0x18 + ldrb r0, [r0] +_08059B82: + add sp, 0x1C + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08059B90: .4byte 0x0000270f + thumb_func_end sub_8059AF8 + + thumb_func_start sub_8059B94 +sub_8059B94: + push {lr} + ldr r2, _08059BA8 + ldr r2, [r2] + movs r3, 0x2 + bl sub_8077084 + movs r0, 0x1 + pop {r1} + bx r1 + .align 2, 0 +_08059BA8: .4byte gUnknown_8106A4C + thumb_func_end sub_8059B94 + + thumb_func_start sub_8059BAC +sub_8059BAC: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + mov r10, r0 + adds r5, r1, 0 + movs r0, 0 + mov r8, r0 + ldr r7, [r5, 0x70] + adds r0, r5, 0 + movs r1, 0x25 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _08059BD8 + ldr r0, _08059BD4 + b _08059C5E + .align 2, 0 +_08059BD4: .4byte gUnknown_81006F8 +_08059BD8: + movs r1, 0x8C + lsls r1, 1 + adds r4, r7, r1 + mov r9, sp + movs r6, 0x3 +_08059BE2: + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08059C08 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8071A1C + lsls r0, 24 + cmp r0, 0 + beq _08059C08 + mov r0, r9 + adds r0, 0x4 + mov r9, r0 + subs r0, 0x4 + stm r0!, {r4} + movs r1, 0x1 + add r8, r1 +_08059C08: + adds r4, 0x8 + subs r6, 0x1 + cmp r6, 0 + bge _08059BE2 + mov r0, r8 + cmp r0, 0 + beq _08059C5C + bl sub_8084100 + lsls r0, 2 + mov r1, sp + adds r4, r1, r0 + ldr r1, [r4] + adds r0, r5, 0 + bl sub_8071A1C + adds r1, r7, 0 + adds r1, 0x5C + movs r2, 0 + strb r0, [r1] + adds r0, r7, 0 + adds r0, 0x5D + strb r2, [r0] + adds r1, 0x9A + movs r0, 0x1 + strb r0, [r1] + ldr r0, _08059C54 + ldr r1, [r4] + bl sub_80928C0 + ldr r0, _08059C58 + ldr r2, [r0] + mov r0, r10 + adds r1, r5, 0 + bl sub_80522F4 + movs r0, 0x1 + b _08059C6A + .align 2, 0 +_08059C54: .4byte gUnknown_202DE58 +_08059C58: .4byte gUnknown_80FE330 +_08059C5C: + ldr r0, _08059C7C +_08059C5E: + ldr r2, [r0] + mov r0, r10 + adds r1, r5, 0 + bl sub_80522F4 + movs r0, 0 +_08059C6A: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08059C7C: .4byte gUnknown_80FE36C + thumb_func_end sub_8059BAC + + thumb_func_start sub_8059C80 +sub_8059C80: + push {lr} + bl sub_8079D1C + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_8059C80 + + thumb_func_start sub_8059C8C +sub_8059C8C: + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r6, 0 + cmp r5, r4 + bne _08059CA8 + ldr r0, _08059CA4 + ldr r2, [r0] + adds r0, r4, 0 + bl sub_80522F4 + b _08059CC6 + .align 2, 0 +_08059CA4: .4byte gUnknown_80FEB60 +_08059CA8: + ldr r0, _08059CD0 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + movs r3, 0x1 + bl sub_8077084 + ldr r0, _08059CD4 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + movs r3, 0x1 + bl sub_8077084 + movs r6, 0x1 +_08059CC6: + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08059CD0: .4byte gUnknown_8106A4C +_08059CD4: .4byte gUnknown_8106A50 + thumb_func_end sub_8059C8C + + thumb_func_start sub_8059CD8 +sub_8059CD8: + push {lr} + ldr r2, _08059CEC + ldr r2, [r2] + movs r3, 0x2 + bl sub_8077160 + movs r0, 0x1 + pop {r1} + bx r1 + .align 2, 0 +_08059CEC: .4byte gUnknown_8106A4C + thumb_func_end sub_8059CD8 + + thumb_func_start sub_8059CF0 +sub_8059CF0: + push {lr} + movs r2, 0 + movs r3, 0 + bl sub_807D148 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_8059CF0 + + thumb_func_start sub_8059D00 +sub_8059D00: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _08059D3A + movs r7, 0x1 + ldr r0, _08059D44 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _08059D3A + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_8077780 +_08059D3A: + adds r0, r7, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08059D44: .4byte gUnknown_80F4DE2 + thumb_func_end sub_8059D00 + + thumb_func_start sub_8059D48 +sub_8059D48: + push {lr} + movs r2, 0x1 + bl sub_8077780 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_8059D48 + + thumb_func_start sub_8059D58 +sub_8059D58: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _08059D8E + movs r7, 0x1 + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _08059D8E + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_8077780 +_08059D8E: + adds r0, r7, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8059D58 + + thumb_func_start sub_8059D98 +sub_8059D98: + push {lr} + bl sub_80769CC + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_8059D98 + + thumb_func_start sub_8059DA4 +sub_8059DA4: + push {lr} + movs r2, 0x1 + bl sub_80763F8 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_8059DA4 + + thumb_func_start sub_8059DB4 +sub_8059DB4: + push {lr} + movs r2, 0x1 + bl sub_80765E0 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_8059DB4 + + thumb_func_start sub_8059DC4 +sub_8059DC4: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _08059DFE + movs r7, 0x1 + ldr r0, _08059E08 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _08059DFE + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_80765E0 +_08059DFE: + adds r0, r7, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08059E08: .4byte gUnknown_80F4DCA + thumb_func_end sub_8059DC4 + + thumb_func_start sub_8059E0C +sub_8059E0C: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _08059E46 + movs r7, 0x1 + ldr r0, _08059E50 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _08059E46 + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_80763F8 +_08059E46: + adds r0, r7, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08059E50: .4byte gUnknown_80F4DBE + thumb_func_end sub_8059E0C + + thumb_func_start sub_8059E54 +sub_8059E54: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x2C + adds r6, r0, 0 + mov r8, r1 + adds r7, r2, 0 + adds r1, r3, 0 + ldr r0, [sp, 0x48] + lsls r0, 24 + movs r2, 0 + mov r9, r2 + cmp r0, 0 + bne _08059E8A + movs r3, 0x80 + lsls r3, 1 + str r1, [sp] + adds r0, r6, 0 + mov r1, r8 + adds r2, r7, 0 + bl sub_8055640 + negs r1, r0 + orrs r1, r0 + lsrs r1, 31 + mov r9, r1 +_08059E8A: + mov r0, r9 + cmp r0, 0 + bne _08059F1A + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_8071A1C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_8071A44 + adds r5, r0, 0 + adds r0, r7, 0 + bl sub_8092C24 + str r0, [sp] + add r2, sp, 0x18 + str r2, [sp, 0x4] + movs r0, 0x80 + lsls r0, 1 + str r0, [sp, 0x8] + ldrh r0, [r7, 0x2] + str r0, [sp, 0xC] + mov r0, r9 + str r0, [sp, 0x10] + adds r0, r6, 0 + mov r1, r8 + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_806EAF4 + ldr r0, _08059F2C + ldr r1, [r6, 0x70] + movs r2, 0 + bl sub_80708B4 + ldr r0, _08059F30 + ldr r2, [r0] + adds r0, r6, 0 + mov r1, r8 + bl sub_80522F4 + ldr r0, [sp, 0x18] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + str r0, [sp, 0x18] + cmp r0, 0 + bne _08059EF6 + movs r0, 0x1 + str r0, [sp, 0x18] +_08059EF6: + ldr r2, [sp, 0x18] + add r0, sp, 0x28 + str r0, [sp] + mov r0, r9 + str r0, [sp, 0x4] + ldr r0, _08059F34 + str r0, [sp, 0x8] + movs r0, 0x13 + str r0, [sp, 0xC] + movs r0, 0x1 + str r0, [sp, 0x10] + mov r0, r9 + str r0, [sp, 0x14] + adds r0, r6, 0 + adds r1, r6, 0 + movs r3, 0 + bl sub_806F370 +_08059F1A: + mov r0, r9 + add sp, 0x2C + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08059F2C: .4byte gUnknown_202DF98 +_08059F30: .4byte gUnknown_80FC7C8 +_08059F34: .4byte 0x000001f7 + thumb_func_end sub_8059E54 + + thumb_func_start sub_8059F38 +sub_8059F38: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r0, 0 + adds r6, r1, 0 + adds r5, r2, 0 + adds r7, r3, 0 + movs r0, 0 + mov r8, r0 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80570AC + lsls r0, 24 + cmp r0, 0 + beq _08059FA0 + ldr r0, _08059F98 + ldr r3, [r0] + str r7, [sp] + adds r0, r4, 0 + adds r1, r6, 0 + adds r2, r5, 0 + bl sub_8055640 + cmp r0, 0 + beq _08059F90 + movs r1, 0x1 + mov r8, r1 + ldr r0, _08059F9C + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _08059F90 + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_8077780 +_08059F90: + adds r0, r4, 0 + bl sub_8079764 + b _08059FB6 + .align 2, 0 +_08059F98: .4byte gUnknown_80F4F60 +_08059F9C: .4byte gUnknown_80F4DCC +_08059FA0: + ldr r0, _08059FC4 + ldr r0, [r0] + str r0, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + movs r2, 0x8 + adds r3, r5, 0 + bl sub_8079618 + movs r0, 0x1 + mov r8, r0 +_08059FB6: + mov r0, r8 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08059FC4: .4byte gUnknown_80FAD10 + thumb_func_end sub_8059F38 + + thumb_func_start sub_8059FC8 +sub_8059FC8: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x2C + adds r6, r0, 0 + mov r8, r1 + adds r7, r2, 0 + adds r1, r3, 0 + ldr r0, [sp, 0x48] + lsls r0, 24 + movs r2, 0 + mov r9, r2 + cmp r0, 0 + bne _08059FFE + movs r3, 0x80 + lsls r3, 2 + str r1, [sp] + adds r0, r6, 0 + mov r1, r8 + adds r2, r7, 0 + bl sub_8055640 + negs r1, r0 + orrs r1, r0 + lsrs r1, 31 + mov r9, r1 +_08059FFE: + mov r0, r9 + cmp r0, 0 + bne _0805A090 + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_8071A1C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_8071A44 + adds r5, r0, 0 + adds r0, r7, 0 + bl sub_8092C24 + str r0, [sp] + add r2, sp, 0x18 + str r2, [sp, 0x4] + movs r0, 0x80 + lsls r0, 2 + str r0, [sp, 0x8] + ldrh r0, [r7, 0x2] + str r0, [sp, 0xC] + mov r0, r9 + str r0, [sp, 0x10] + adds r0, r6, 0 + mov r1, r8 + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_806EAF4 + ldr r0, _0805A0A0 + ldr r1, [r6, 0x70] + movs r2, 0 + bl sub_80708B4 + ldr r0, _0805A0A4 + ldr r2, [r0] + adds r0, r6, 0 + mov r1, r8 + bl sub_80522F4 + ldr r0, [sp, 0x18] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + str r0, [sp, 0x18] + cmp r0, 0 + bne _0805A06A + movs r0, 0x1 + str r0, [sp, 0x18] +_0805A06A: + ldr r2, [sp, 0x18] + add r0, sp, 0x28 + str r0, [sp] + mov r0, r9 + str r0, [sp, 0x4] + movs r0, 0xFC + lsls r0, 1 + str r0, [sp, 0x8] + movs r0, 0x13 + str r0, [sp, 0xC] + movs r0, 0x1 + str r0, [sp, 0x10] + mov r0, r9 + str r0, [sp, 0x14] + adds r0, r6, 0 + adds r1, r6, 0 + movs r3, 0 + bl sub_806F370 +_0805A090: + mov r0, r9 + add sp, 0x2C + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805A0A0: .4byte gUnknown_202DF98 +_0805A0A4: .4byte gUnknown_80FC7C8 + thumb_func_end sub_8059FC8 + + thumb_func_start sub_805A0A8 +sub_805A0A8: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _0805A114 + movs r7, 0x1 + ldr r0, _0805A0F8 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _0805A114 + movs r0, 0x3 + bl sub_8084100 + cmp r0, 0x1 + beq _0805A0FC + cmp r0, 0x1 + ble _0805A0EA + cmp r0, 0x2 + beq _0805A10A +_0805A0EA: + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_8077780 + b _0805A114 + .align 2, 0 +_0805A0F8: .4byte gUnknown_80F4DFC +_0805A0FC: + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0 + bl sub_8076210 + b _0805A114 +_0805A10A: + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_80767B0 +_0805A114: + adds r0, r7, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_805A0A8 + + thumb_func_start sub_805A120 +sub_805A120: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r6, r0, 0 + adds r5, r1, 0 + movs r0, 0 + mov r10, r0 + ldr r1, [r6, 0x70] + mov r9, r1 + mov r7, r9 + ldr r2, [r5, 0x70] + mov r8, r2 + mov r0, r8 + str r0, [sp] + ldr r4, _0805A16C + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_8045B94 + adds r4, 0x50 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r5, 0 + movs r1, 0x2C + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0805A174 + ldr r0, _0805A170 + b _0805A1B8 + .align 2, 0 +_0805A16C: .4byte gUnknown_202DF98 +_0805A170: .4byte gUnknown_80FCCE4 +_0805A174: + adds r0, r5, 0 + movs r1, 0x24 + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _0805A18C + ldr r0, _0805A188 + b _0805A1B8 + .align 2, 0 +_0805A188: .4byte gUnknown_80FD578 +_0805A18C: + mov r0, r9 + adds r0, 0x60 + mov r2, r8 + adds r2, 0x60 + ldrb r1, [r0] + movs r4, 0x1 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + bne _0805A1A2 + mov r10, r4 +_0805A1A2: + ldrb r1, [r2] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + bne _0805A1B0 + movs r1, 0x1 + mov r10, r1 +_0805A1B0: + mov r2, r10 + cmp r2, 0 + beq _0805A1CC + ldr r0, _0805A1C8 +_0805A1B8: + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80522F4 + movs r0, 0 + b _0805A1FC + .align 2, 0 +_0805A1C8: .4byte gUnknown_80FC7AC +_0805A1CC: + ldr r0, [r7, 0x60] + ldr r2, [sp] + ldr r1, [r2, 0x60] + str r1, [r7, 0x60] + str r0, [r2, 0x60] + adds r0, r6, 0 + bl sub_806A6E8 + adds r0, r5, 0 + bl sub_806A6E8 + adds r1, r7, 0 + adds r1, 0xFB + ldrb r0, [r1] + cmp r0, 0 + bne _0805A1EE + strb r4, [r1] +_0805A1EE: + ldr r0, _0805A20C + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80522F4 + movs r0, 0x1 +_0805A1FC: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805A20C: .4byte gUnknown_80FC790 + thumb_func_end sub_805A120 + + thumb_func_start sub_805A210 +sub_805A210: + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r3, 0 + ldr r4, _0805A238 + ldr r3, [r4] + adds r3, 0x1 + str r3, [r4] + lsls r3, 8 + str r5, [sp] + bl sub_8055640 + adds r1, r0, 0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0805A238: .4byte gUnknown_202F210 + thumb_func_end sub_805A210 + + thumb_func_start sub_805A23C +sub_805A23C: + push {lr} + ldrh r0, [r2, 0x2] + cmp r0, 0xD4 + bne _0805A24C + movs r0, 0 + bl sub_807EA30 + b _0805A252 +_0805A24C: + movs r0, 0x1 + bl sub_807EA30 +_0805A252: + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805A23C + + thumb_func_start sub_805A258 +sub_805A258: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _0805A292 + movs r7, 0x1 + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _0805A292 + ldr r0, _0805A29C + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r6, 0 + movs r3, 0 + bl sub_80775DC +_0805A292: + adds r0, r7, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805A29C: .4byte gUnknown_8106A4C + thumb_func_end sub_805A258 + + thumb_func_start sub_805A2A0 +sub_805A2A0: + push {lr} + bl sub_805BA50 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_805A2A0 + + thumb_func_start sub_805A2B0 +sub_805A2B0: + push {lr} + ldr r2, _0805A2C4 + ldr r2, [r2] + movs r3, 0x2 + bl sub_8077160 + movs r0, 0x1 + pop {r1} + bx r1 + .align 2, 0 +_0805A2C4: .4byte gUnknown_8106A50 + thumb_func_end sub_805A2B0 + + thumb_func_start sub_805A2C8 +sub_805A2C8: + push {lr} + sub sp, 0x8 + ldr r2, _0805A2E4 + ldr r2, [r2] + movs r3, 0x1 + str r3, [sp] + str r3, [sp, 0x4] + bl sub_8076E20 + movs r0, 0x1 + add sp, 0x8 + pop {r1} + bx r1 + .align 2, 0 +_0805A2E4: .4byte gUnknown_8106A4C + thumb_func_end sub_805A2C8 + + thumb_func_start sub_805A2E8 +sub_805A2E8: + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r6, 0 + ldr r0, [r1, 0x70] + adds r0, 0xC0 + ldrb r0, [r0] + movs r4, 0x80 + lsls r4, 1 + cmp r0, 0x9 + bne _0805A302 + movs r4, 0x80 + lsls r4, 2 +_0805A302: + str r3, [sp] + adds r0, r5, 0 + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _0805A312 + movs r6, 0x1 +_0805A312: + adds r0, r6, 0 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_805A2E8 + + thumb_func_start sub_805A31C +sub_805A31C: + push {r4-r7,lr} + adds r5, r0, 0 + adds r6, r1, 0 + ldr r4, [r5, 0x70] + ldr r7, [r6, 0x70] + adds r0, r6, 0 + movs r1, 0x35 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0805A348 + ldr r0, _0805A344 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_80522F4 + movs r0, 0 + b _0805A386 + .align 2, 0 +_0805A344: .4byte gUnknown_80FC854 +_0805A348: + adds r0, r7, 0 + adds r0, 0x5E + ldrb r0, [r0] + adds r1, r4, 0 + adds r1, 0x5E + strb r0, [r1] + adds r0, r7, 0 + adds r0, 0x5F + ldrb r0, [r0] + adds r1, 0x1 + strb r0, [r1] + ldr r0, _0805A38C + ldr r0, [r0] + movs r2, 0x1 + strb r2, [r0, 0xC] + adds r1, 0x9C + ldrb r0, [r1] + cmp r0, 0 + bne _0805A370 + strb r2, [r1] +_0805A370: + ldr r0, _0805A390 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_80522F4 + adds r0, r5, 0 + adds r1, r5, 0 + bl sub_806ABAC + movs r0, 0x1 +_0805A386: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805A38C: .4byte gUnknown_203B418 +_0805A390: .4byte gUnknown_80FC81C + thumb_func_end sub_805A31C + + thumb_func_start sub_805A394 +sub_805A394: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, _0805A3CC + ldr r0, [r0] + ldr r1, _0805A3D0 + ldrh r1, [r1] + ldr r2, _0805A3D4 + adds r0, r2 + strb r1, [r0] + movs r0, 0x1 + movs r1, 0 + bl sub_807EAA0 + lsls r0, 24 + cmp r0, 0 + bne _0805A3C2 + ldr r0, _0805A3D8 + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80522F4 +_0805A3C2: + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0805A3CC: .4byte gUnknown_203B418 +_0805A3D0: .4byte gUnknown_80F4F42 +_0805A3D4: .4byte 0x0000e268 +_0805A3D8: .4byte gUnknown_80FCF7C + thumb_func_end sub_805A394 + + thumb_func_start sub_805A3DC +sub_805A3DC: + push {lr} + sub sp, 0x8 + ldr r2, _0805A3F8 + ldr r2, [r2] + movs r3, 0x1 + str r3, [sp] + str r3, [sp, 0x4] + bl sub_8076F80 + movs r0, 0x1 + add sp, 0x8 + pop {r1} + bx r1 + .align 2, 0 +_0805A3F8: .4byte gUnknown_8106A4C + thumb_func_end sub_805A3DC + + thumb_func_start sub_805A3FC +sub_805A3FC: + push {lr} + bl sub_807992C + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805A3FC + + thumb_func_start sub_805A408 +sub_805A408: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _0805A442 + movs r7, 0x1 + ldr r0, _0805A44C + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _0805A442 + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_80776C0 +_0805A442: + adds r0, r7, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805A44C: .4byte gUnknown_80F4DF2 + thumb_func_end sub_805A408 + + thumb_func_start sub_805A450 +sub_805A450: + push {lr} + ldr r2, _0805A460 + ldr r2, [r2] + bl sub_80522F4 + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0805A460: .4byte gUnknown_80FC730 + thumb_func_end sub_805A450 + + thumb_func_start sub_805A464 +sub_805A464: + push {r4-r7,lr} + sub sp, 0xC + adds r5, r0, 0 + adds r6, r1, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _0805A4B4 + movs r7, 0x1 + adds r0, r5, 0 + movs r1, 0 + bl sub_8057308 + lsls r0, 24 + cmp r0, 0 + beq _0805A4B4 + adds r0, r6, 0 + bl sub_80450E0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0805A4B4 + str r0, [sp, 0x8] + add r0, sp, 0x4 + movs r1, 0x69 + movs r2, 0x2 + bl sub_8045C28 + add r3, sp, 0x8 + adds r0, r5, 0 + adds r1, r6, 0 + add r2, sp, 0x4 + bl sub_805A7D4 +_0805A4B4: + adds r0, r7, 0 + add sp, 0xC + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_805A464 + + thumb_func_start sub_805A4C0 +sub_805A4C0: + push {lr} + ldr r2, _0805A4D0 + ldr r2, [r2] + bl sub_80522F4 + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0805A4D0: .4byte gUnknown_80FC74C + thumb_func_end sub_805A4C0 + + thumb_func_start sub_805A4D4 +sub_805A4D4: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldr r1, _0805A4F8 + adds r0, r4, 0 + movs r2, 0 + bl sub_808417C + adds r2, r0, 0 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8075E74 + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0805A4F8: .4byte gUnknown_80F4E94 + thumb_func_end sub_805A4D4 + + thumb_func_start sub_805A4FC +sub_805A4FC: + push {lr} + bl sub_8076AA4 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805A4FC + + thumb_func_start sub_805A508 +sub_805A508: + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r3, r1, 0 + ldr r0, [r3, 0x70] + movs r1, 0x89 + lsls r1, 1 + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0 + beq _0805A540 + ldr r1, _0805A53C + lsls r0, 2 + adds r0, r1 + ldr r2, [r0] + movs r0, 0x1 + str r0, [sp] + adds r0, r5, 0 + adds r1, r3, 0 + movs r3, 0 + bl sub_8077C44 + movs r0, 0 + strb r0, [r4] + b _0805A54C + .align 2, 0 +_0805A53C: .4byte gUnknown_80F51D4 +_0805A540: + ldr r0, _0805A558 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r3, 0 + bl sub_80522F4 +_0805A54C: + movs r0, 0x1 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0805A558: .4byte gUnknown_80FC770 + thumb_func_end sub_805A508 + + thumb_func_start sub_805A55C +sub_805A55C: + push {lr} + bl sub_8078594 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805A55C + + thumb_func_start sub_805A568 +sub_805A568: + push {r4,lr} + sub sp, 0x4 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + adds r1, r0, 0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_805A568 + + thumb_func_start sub_805A588 +sub_805A588: + push {r4-r7,lr} + sub sp, 0x8 + adds r6, r0, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _0805A5D8 + movs r7, 0x1 + adds r0, r6, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _0805A5D8 + ldr r0, _0805A5E4 + ldr r5, [r0] + movs r4, 0 + str r4, [sp] + str r4, [sp, 0x4] + adds r0, r6, 0 + adds r1, r6, 0 + adds r2, r5, 0 + movs r3, 0x1 + bl sub_8076E20 + str r4, [sp] + str r4, [sp, 0x4] + adds r0, r6, 0 + adds r1, r6, 0 + adds r2, r5, 0 + movs r3, 0x1 + bl sub_8076F80 +_0805A5D8: + adds r0, r7, 0 + add sp, 0x8 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805A5E4: .4byte gUnknown_8106A4C + thumb_func_end sub_805A588 + + thumb_func_start sub_805A5E8 +sub_805A5E8: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r7, r3, 0 + ldr r0, [sp, 0x18] + movs r6, 0 + movs r3, 0x80 + lsls r3, 1 + str r0, [sp] + adds r0, r5, 0 + bl sub_8055640 + cmp r0, 0 + beq _0805A632 + movs r6, 0x1 + ldr r0, _0805A63C + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r5, 0 + adds r1, r5, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _0805A632 + ldr r4, [r5, 0x70] + adds r0, r5, 0 + adds r1, r5, 0 + adds r2, r7, 0 + movs r3, 0x1 + bl sub_8077160 + adds r4, 0xFB + ldrb r0, [r4] + cmp r0, 0 + bne _0805A632 + strb r6, [r4] +_0805A632: + adds r0, r6, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805A63C: .4byte gUnknown_80F4DD2 + thumb_func_end sub_805A5E8 + + thumb_func_start sub_805A640 +sub_805A640: + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + adds r1, r3, 0 + ldr r0, [r5, 0x70] + movs r3, 0x89 + lsls r3, 1 + adds r4, r0, r3 + ldrb r0, [r4] + cmp r0, 0 + beq _0805A66C + adds r3, r0, 0 + lsls r3, 8 + str r1, [sp] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_8055640 + movs r0, 0 + strb r0, [r4] + b _0805A678 +_0805A66C: + ldr r0, _0805A684 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_80522F4 +_0805A678: + movs r0, 0x1 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0805A684: .4byte gUnknown_80FCA3C + thumb_func_end sub_805A640 + + thumb_func_start sub_805A688 +sub_805A688: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _0805A6BE + movs r7, 0x1 + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _0805A6BE + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_8077AE4 +_0805A6BE: + adds r0, r7, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_805A688 + + thumb_func_start sub_805A6C8 +sub_805A6C8: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + adds r6, r0, 0 + adds r5, r1, 0 + ldr r0, [r6, 0x70] + mov r9, r0 + ldr r7, [r5, 0x70] + mov r8, r7 + ldr r4, _0805A708 + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_8045B94 + adds r4, 0x50 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r5, 0 + movs r1, 0x2C + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0805A710 + ldr r0, _0805A70C + b _0805A73A + .align 2, 0 +_0805A708: .4byte gUnknown_202DF98 +_0805A70C: .4byte gUnknown_80FCCE8 +_0805A710: + adds r0, r5, 0 + movs r1, 0x24 + bl sub_8046CB0 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + beq _0805A728 + ldr r0, _0805A724 + b _0805A73A + .align 2, 0 +_0805A724: .4byte gUnknown_80FD57C +_0805A728: + ldr r0, [r7, 0x60] + str r0, [sp] + mov r0, sp + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0805A74C + ldr r0, _0805A748 +_0805A73A: + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80522F4 + movs r0, 0 + b _0805A7B4 + .align 2, 0 +_0805A748: .4byte gUnknown_80FD18C +_0805A74C: + mov r0, r8 + adds r0, 0x60 + strb r2, [r0, 0x2] + strb r2, [r0, 0x1] + strb r2, [r0] + ldr r0, _0805A7C4 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80522F4 + ldr r4, _0805A7C8 + mov r3, r9 + adds r3, 0x46 + ldrb r0, [r3] + lsls r0, 2 + adds r0, r4 + ldrh r2, [r0] + ldr r0, _0805A7CC + ldr r1, [sp, 0x4] + ands r1, r0 + orrs r1, r2 + str r1, [sp, 0x4] + ldrb r0, [r3] + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x2] + lsls r0, 16 + ldr r2, _0805A7D0 + ands r1, r2 + orrs r1, r0 + str r1, [sp, 0x4] + add r3, sp, 0x4 + adds r0, r6, 0 + adds r1, r5, 0 + mov r2, sp + bl sub_805A7D4 + adds r1, r5, 0x4 + adds r0, r5, 0 + bl sub_80706A4 + lsls r0, 24 + cmp r0, 0 + beq _0805A7B2 + adds r0, r6, 0 + adds r1, r5, 0 + movs r2, 0 + movs r3, 0 + bl sub_807D148 +_0805A7B2: + movs r0, 0x1 +_0805A7B4: + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805A7C4: .4byte gUnknown_80FD170 +_0805A7C8: .4byte gUnknown_80F4448 +_0805A7CC: .4byte 0xffff0000 +_0805A7D0: .4byte 0x0000ffff + thumb_func_end sub_805A6C8 + + thumb_func_start sub_805A7D4 +sub_805A7D4: + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x78 + mov r8, r0 + adds r4, r1, 0 + adds r6, r2, 0 + movs r0, 0x3 + str r0, [sp, 0x4] + add r0, sp, 0x28 + movs r5, 0 + strb r5, [r0] + add r1, sp, 0x24 + movs r0, 0x1 + strb r0, [r1] + mov r0, sp + adds r0, 0x26 + strb r5, [r0] + str r6, [sp, 0x74] + add r1, sp, 0x4 + ldrh r0, [r3] + ldrh r2, [r4, 0x4] + adds r0, r2 + strh r0, [r1, 0x4] + ldrh r0, [r3, 0x2] + ldrh r2, [r4, 0x6] + adds r0, r2 + strh r0, [r1, 0x6] + movs r1, 0x4 + ldrsh r0, [r4, r1] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, 0x4 + lsls r1, 8 + movs r2, 0x6 + ldrsh r0, [r4, r2] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 3 + adds r2, 0x4 + lsls r2, 8 + add r0, sp, 0x4 + bl sub_8045394 + add r0, sp, 0x4 + strh r5, [r0, 0x26] + ldr r0, _0805A858 + add r1, sp, 0x4 + movs r2, 0 + bl sub_8045B94 + str r5, [sp] + mov r0, r8 + add r1, sp, 0x4 + adds r2, r6, 0 + movs r3, 0x1 + bl sub_804652C + add sp, 0x78 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0805A858: .4byte gUnknown_202DE58 + thumb_func_end sub_805A7D4 + + thumb_func_start sub_805A85C +sub_805A85C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x30 + mov r8, r0 + adds r6, r1, 0 + mov r10, r2 + str r3, [sp, 0x24] + ldr r0, [r6, 0x4] + str r0, [sp, 0x18] + adds r0, r6, 0 + movs r1, 0xA + movs r2, 0x8 + bl sub_806CDD4 + movs r5, 0 +_0805A880: + movs r0, 0x3 + bl sub_8084100 + adds r4, r0, 0 + movs r0, 0x3 + bl sub_8084100 + adds r2, r0, 0 + subs r4, 0x1 + subs r2, 0x1 + cmp r4, 0 + bne _0805A89C + cmp r2, 0 + beq _0805A8BC +_0805A89C: + ldrh r0, [r6, 0x4] + adds r0, r4 + lsls r0, 16 + ldrh r1, [r6, 0x6] + adds r1, r2 + lsls r1, 16 + lsrs r0, 16 + orrs r0, r1 + str r0, [sp, 0x18] + adds r0, r6, 0 + add r1, sp, 0x18 + bl sub_80705F0 + lsls r0, 24 + cmp r0, 0 + beq _0805A8C2 +_0805A8BC: + adds r5, 0x1 + cmp r5, 0x27 + ble _0805A880 +_0805A8C2: + cmp r5, 0x28 + bne _0805A8DC + ldr r0, _0805A8D8 + ldr r2, [r0] + mov r0, r8 + adds r1, r6, 0 + bl sub_80522F4 + movs r0, 0 + b _0805AAB8 + .align 2, 0 +_0805A8D8: .4byte gUnknown_80FEBDC +_0805A8DC: + add r0, sp, 0x18 + movs r2, 0 + ldrsh r1, [r0, r2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 11 + movs r3, 0xC0 + lsls r3, 4 + adds r0, r3 + ldr r1, [r6, 0xC] + subs r0, r1 + movs r1, 0xC + bl __divsi3 + str r0, [sp, 0x28] + add r0, sp, 0x18 + movs r2, 0x2 + ldrsh r1, [r0, r2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 11 + movs r3, 0x80 + lsls r3, 5 + adds r0, r3 + ldr r1, [r6, 0x10] + subs r0, r1 + movs r1, 0xC + bl __divsi3 + str r0, [sp, 0x2C] + adds r4, r6, 0x4 + adds r0, r4, 0 + bl sub_803F428 + lsls r0, 24 + mov r9, r4 + cmp r0, 0 + bne _0805A934 + add r0, sp, 0x18 + bl sub_803F428 + lsls r0, 24 + cmp r0, 0 + beq _0805A94C +_0805A934: + movs r5, 0xB +_0805A936: + adds r0, r6, 0 + ldr r1, [sp, 0x28] + ldr r2, [sp, 0x2C] + bl sub_804539C + movs r0, 0x2C + bl sub_803E46C + subs r5, 0x1 + cmp r5, 0 + bge _0805A936 +_0805A94C: + add r0, sp, 0x18 + movs r1, 0 + ldrsh r0, [r0, r1] + add r4, sp, 0x18 + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl sub_8049590 + ldr r5, [r0, 0x10] + cmp r5, 0 + beq _0805AA4C + adds r0, r5, 0 + bl sub_80450F8 + adds r7, r0, 0 + cmp r7, 0x1 + bne _0805A9FE + add r4, sp, 0x1C + ldr r1, _0805AA44 + adds r0, r4, 0 + bl sub_8092A88 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80571F0 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0805A9B0 + mov r0, r10 + ldr r1, [sp, 0x24] + bl sub_8057600 + lsls r0, 16 + asrs r0, 16 + ldr r1, _0805AA48 + movs r3, 0 + ldrsh r2, [r1, r3] + str r4, [sp] + str r4, [sp, 0x4] + str r0, [sp, 0x8] + str r4, [sp, 0xC] + str r7, [sp, 0x10] + str r4, [sp, 0x14] + mov r0, r8 + adds r1, r5, 0 + movs r3, 0 + bl sub_806F370 +_0805A9B0: + bl sub_8044B28 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0805AAB6 + mov r0, r8 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0805AAB6 + ldr r0, _0805AA48 + movs r1, 0 + ldrsh r2, [r0, r1] + str r4, [sp] + str r4, [sp, 0x4] + movs r0, 0xFF + lsls r0, 1 + str r0, [sp, 0x8] + str r4, [sp, 0xC] + str r4, [sp, 0x10] + str r4, [sp, 0x14] + mov r0, r8 + mov r1, r8 + movs r3, 0 + bl sub_806F370 + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _0805AAB6 + mov r0, r8 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0805AAB6 +_0805A9FE: + adds r0, r6, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0805AAB6 + mov r0, r9 + bl sub_803F428 + lsls r0, 24 + cmp r0, 0 + bne _0805AA22 + add r0, sp, 0x18 + bl sub_803F428 + lsls r0, 24 + cmp r0, 0 + beq _0805AA5E +_0805AA22: + ldr r2, [sp, 0x28] + negs r7, r2 + ldr r3, [sp, 0x2C] + negs r4, r3 + movs r5, 0xB +_0805AA2C: + adds r0, r6, 0 + adds r1, r7, 0 + adds r2, r4, 0 + bl sub_804539C + movs r0, 0x2C + bl sub_803E46C + subs r5, 0x1 + cmp r5, 0 + bge _0805AA2C + b _0805AA5E + .align 2, 0 +_0805AA44: .4byte 0x00000163 +_0805AA48: .4byte gUnknown_80F4F82 +_0805AA4C: + add r0, sp, 0x18 + movs r2, 0 + ldrsh r1, [r0, r2] + movs r3, 0x2 + ldrsh r2, [r4, r3] + adds r0, r6, 0 + movs r3, 0 + bl sub_80694C0 +_0805AA5E: + adds r0, r6, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0805AAB6 + adds r0, r6, 0 + movs r1, 0 + bl sub_804535C + mov r1, r9 + adds r0, r6, 0 + bl sub_80706A4 + lsls r0, 24 + cmp r0, 0 + beq _0805AA8C + mov r0, r8 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0 + bl sub_807D148 +_0805AA8C: + ldr r0, [r6, 0x70] + ldrb r0, [r0, 0x7] + cmp r0, 0 + beq _0805AAA0 + mov r0, r9 + bl sub_804AC20 + movs r0, 0 + bl sub_807EC28 +_0805AAA0: + adds r0, r6, 0 + bl sub_806A5B8 + ldr r0, _0805AAC8 + ldr r0, [r0] + ldr r1, _0805AACC + adds r0, r1 + ldrb r1, [r0] + adds r0, r6, 0 + bl sub_8075900 +_0805AAB6: + movs r0, 0x1 +_0805AAB8: + add sp, 0x30 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805AAC8: .4byte gUnknown_203B418 +_0805AACC: .4byte 0x00003a08 + thumb_func_end sub_805A85C + + thumb_func_start sub_805AAD0 +sub_805AAD0: + push {lr} + adds r1, r0, 0 + bl sub_80782CC + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805AAD0 + + thumb_func_start sub_805AAE0 +sub_805AAE0: + push {r4-r7,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r6, r1, 0 + ldr r0, [r4, 0x70] + movs r7, 0 + movs r1, 0x9E + lsls r1, 1 + adds r5, r0, r1 + ldr r0, [r5] + bl sub_8094450 + cmp r0, 0x1 + ble _0805AB20 + ldr r0, _0805AB1C + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r6, 0 + movs r3, 0x63 + bl sub_8077084 + mov r0, sp + movs r1, 0x1 + bl sub_80943A0 + ldr r0, [sp] + str r0, [r5] + movs r7, 0x1 + b _0805AB36 + .align 2, 0 +_0805AB1C: .4byte gUnknown_8106A4C +_0805AB20: + ldr r0, _0805AB40 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _0805AB44 + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_80522F4 +_0805AB36: + adds r0, r7, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805AB40: .4byte gUnknown_202DF98 +_0805AB44: .4byte gUnknown_80FC5CC + thumb_func_end sub_805AAE0 + + thumb_func_start sub_805AB48 +sub_805AB48: + push {lr} + bl sub_8079A24 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805AB48 + + thumb_func_start sub_805AB54 +sub_805AB54: + push {r4-r7,lr} + sub sp, 0x8 + adds r5, r0, 0 + adds r6, r1, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + bne _0805AB70 + b _0805AC86 +_0805AB70: + movs r7, 0x1 + ldr r0, _0805ABA8 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + bne _0805AB88 + b _0805AC86 +_0805AB88: + ldr r1, _0805ABAC + ldr r0, _0805ABB0 + ldr r0, [r0] + ldr r2, _0805ABB4 + adds r0, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x8 + bhi _0805AC7C + lsls r0, 2 + ldr r1, _0805ABB8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0805ABA8: .4byte gUnknown_80F4E06 +_0805ABAC: .4byte gUnknown_80F5978 +_0805ABB0: .4byte gUnknown_203B418 +_0805ABB4: .4byte 0x00003a0e +_0805ABB8: .4byte _0805ABBC + .align 2, 0 +_0805ABBC: + .4byte _0805ABE0 + .4byte _0805ABEC + .4byte _0805AC08 + .4byte _0805AC16 + .4byte _0805AC34 + .4byte _0805AC50 + .4byte _0805AC64 + .4byte _0805AC70 + .4byte _0805AC7C +_0805ABE0: + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_80763F8 + b _0805AC86 +_0805ABEC: + ldr r1, _0805AC04 + adds r0, r6, 0 + movs r2, 0x1 + bl sub_808417C + adds r2, r0, 0 + adds r0, r5, 0 + adds r1, r6, 0 + movs r3, 0 + bl sub_8075C58 + b _0805AC86 + .align 2, 0 +_0805AC04: .4byte gUnknown_80F4E74 +_0805AC08: + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0 + bl sub_80779F0 + b _0805AC86 +_0805AC16: + ldr r0, _0805AC30 + ldr r2, [r0] + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + adds r0, r5, 0 + adds r1, r6, 0 + movs r3, 0x1 + bl sub_8076E20 + b _0805AC86 + .align 2, 0 +_0805AC30: .4byte gUnknown_8106A4C +_0805AC34: + ldr r0, _0805AC4C + ldr r2, [r0] + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + adds r0, r5, 0 + adds r1, r6, 0 + movs r3, 0x1 + bl sub_8076F80 + b _0805AC86 + .align 2, 0 +_0805AC4C: .4byte gUnknown_8106A4C +_0805AC50: + ldr r0, _0805AC60 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r6, 0 + movs r3, 0 + bl sub_80775DC + b _0805AC86 + .align 2, 0 +_0805AC60: .4byte gUnknown_8106A4C +_0805AC64: + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_8077AE4 + b _0805AC86 +_0805AC70: + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_80776C0 + b _0805AC86 +_0805AC7C: + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_8077780 +_0805AC86: + adds r0, r7, 0 + add sp, 0x8 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_805AB54 + + thumb_func_start sub_805AC90 +sub_805AC90: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _0805ACCA + movs r7, 0x1 + ldr r0, _0805ACD4 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _0805ACCA + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_8077AE4 +_0805ACCA: + adds r0, r7, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805ACD4: .4byte gUnknown_80F4DFA + thumb_func_end sub_805AC90 + + thumb_func_start sub_805ACD8 +sub_805ACD8: + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + ldr r0, _0805AD00 + ldr r4, [r0] + adds r0, r5, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8077084 + adds r0, r5, 0 + adds r1, r6, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8077160 + movs r0, 0x1 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0805AD00: .4byte gUnknown_8106A4C + thumb_func_end sub_805ACD8 + + thumb_func_start sub_805AD04 +sub_805AD04: + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r4, r1, 0 + ldr r1, _0805AD30 + adds r0, r4, 0 + movs r2, 0x1 + bl sub_808417C + adds r3, r0, 0 + movs r0, 0x1 + str r0, [sp] + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_8076090 + movs r0, 0x1 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0805AD30: .4byte gUnknown_80F4EE0 + thumb_func_end sub_805AD04 + + thumb_func_start sub_805AD34 +sub_805AD34: + push {lr} + sub sp, 0x8 + ldr r2, _0805AD50 + ldr r2, [r2] + movs r3, 0x1 + str r3, [sp] + str r3, [sp, 0x4] + movs r3, 0x2 + bl sub_8076E20 + movs r0, 0x1 + add sp, 0x8 + pop {r1} + bx r1 + .align 2, 0 +_0805AD50: .4byte gUnknown_8106A4C + thumb_func_end sub_805AD34 + + thumb_func_start sub_805AD54 +sub_805AD54: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r5, r0, 0 + mov r9, r1 + movs r0, 0 + mov r10, r0 + ldr r1, [r5, 0x70] + mov r8, r1 + ldrb r0, [r1, 0x6] + cmp r0, 0 + beq _0805AD88 + ldr r0, _0805AD80 + ldr r0, [r0] + ldr r1, _0805AD84 + adds r7, r0, r1 + movs r0, 0x10 + b _0805AD92 + .align 2, 0 +_0805AD80: .4byte gUnknown_203B418 +_0805AD84: .4byte 0x0001358c +_0805AD88: + ldr r0, _0805AD98 + ldr r0, [r0] + ldr r1, _0805AD9C + adds r7, r0, r1 + movs r0, 0x4 +_0805AD92: + str r0, [sp] + movs r6, 0 + b _0805AE0E + .align 2, 0 +_0805AD98: .4byte gUnknown_203B418 +_0805AD9C: .4byte 0x0001357c +_0805ADA0: + lsls r0, r6, 2 + adds r0, r7 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0805AE0C + cmp r5, r4 + beq _0805AE0C + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl sub_8071598 + lsls r0, 24 + cmp r0, 0 + bne _0805AE0C + ldr r1, [r4, 0x70] + adds r0, r1, 0 + adds r0, 0xA4 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0805AE0C + adds r0, r1, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x4A + beq _0805ADE2 + cmp r0, 0x47 + bne _0805ADE6 +_0805ADE2: + movs r0, 0x1 + b _0805ADE8 +_0805ADE6: + movs r0, 0 +_0805ADE8: + cmp r0, 0 + bne _0805AE0C + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x2 + mov r3, r9 + adds r3, 0x4 + bl sub_807D148 + movs r0, 0x1 + mov r10, r0 + mov r1, r8 + adds r1, 0xFB + ldrb r0, [r1] + cmp r0, 0 + bne _0805AE0C + mov r0, r10 + strb r0, [r1] +_0805AE0C: + adds r6, 0x1 +_0805AE0E: + ldr r1, [sp] + cmp r6, r1 + blt _0805ADA0 + mov r0, r10 + cmp r0, 0 + bne _0805AE26 + ldr r0, _0805AE38 + ldr r2, [r0] + adds r0, r5, 0 + mov r1, r9 + bl sub_80522F4 +_0805AE26: + mov r0, r10 + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805AE38: .4byte gUnknown_81004EC + thumb_func_end sub_805AD54 + + thumb_func_start sub_805AE3C +sub_805AE3C: + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + mov r8, r2 + adds r4, r3, 0 + bl sub_807A9D8 + movs r3, 0x80 + lsls r3, 2 + str r4, [sp] + adds r0, r5, 0 + adds r1, r6, 0 + mov r2, r8 + bl sub_8055640 + adds r1, r0, 0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_805AE3C + + thumb_func_start sub_805AE74 +sub_805AE74: + push {r4-r7,lr} + sub sp, 0x8 + adds r5, r0, 0 + adds r6, r1, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _0805AEB8 + movs r7, 0x1 + ldr r0, _0805AEC4 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _0805AEB8 + ldr r0, _0805AEC8 + ldr r2, [r0] + str r7, [sp] + movs r0, 0 + str r0, [sp, 0x4] + adds r0, r5, 0 + adds r1, r6, 0 + movs r3, 0x1 + bl sub_8076F80 +_0805AEB8: + adds r0, r7, 0 + add sp, 0x8 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805AEC4: .4byte gUnknown_80F4DDA +_0805AEC8: .4byte gUnknown_8106A4C + thumb_func_end sub_805AE74 + + thumb_func_start sub_805AECC +sub_805AECC: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r6, r0, 0 + adds r7, r1, 0 + adds r5, r2, 0 + adds r4, r3, 0 + movs r0, 0 + mov r8, r0 + adds r0, r6, 0 + bl sub_807A9D8 + movs r3, 0x80 + lsls r3, 1 + str r4, [sp] + adds r0, r6, 0 + adds r1, r7, 0 + adds r2, r5, 0 + bl sub_8055640 + cmp r0, 0 + beq _0805AF1E + movs r1, 0x1 + mov r8, r1 + ldr r0, _0805AF2C + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _0805AF1E + adds r0, r6, 0 + adds r1, r7, 0 + movs r2, 0 + movs r3, 0 + bl sub_8076210 +_0805AF1E: + mov r0, r8 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805AF2C: .4byte gUnknown_80F4DFE + thumb_func_end sub_805AECC + + thumb_func_start sub_805AF30 +sub_805AF30: + push {r4-r7,lr} + sub sp, 0x4 + adds r7, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + adds r4, r3, 0 + movs r0, 0x64 + bl sub_8084100 + adds r1, r0, 0 + cmp r0, 0x9 + bgt _0805AF54 + str r4, [sp] + adds r0, r7, 0 + adds r1, r5, 0 + adds r2, r6, 0 + movs r3, 0x78 + b _0805AF92 +_0805AF54: + cmp r0, 0x1D + bgt _0805AF78 + ldr r0, [r5, 0x70] + movs r1, 0x10 + ldrsh r2, [r0, r1] + cmp r2, 0 + bge _0805AF64 + adds r2, 0x3 +_0805AF64: + asrs r2, 2 + movs r0, 0x1 + str r0, [sp] + adds r0, r7, 0 + adds r1, r5, 0 + movs r3, 0 + bl sub_8077C44 + movs r0, 0x1 + b _0805AF9C +_0805AF78: + cmp r1, 0x3B + bgt _0805AF88 + str r4, [sp] + adds r0, r7, 0 + adds r1, r5, 0 + adds r2, r6, 0 + movs r3, 0x50 + b _0805AF92 +_0805AF88: + str r4, [sp] + adds r0, r7, 0 + adds r1, r5, 0 + adds r2, r6, 0 + movs r3, 0x28 +_0805AF92: + bl sub_8055864 + negs r1, r0 + orrs r1, r0 + lsrs r0, r1, 31 +_0805AF9C: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_805AF30 + + thumb_func_start sub_805AFA4 +sub_805AFA4: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + mov r8, r2 + adds r6, r3, 0 + bl sub_807A9D8 + ldr r3, [r4, 0x70] + movs r0, 0x10 + ldrsh r2, [r3, r0] + adds r0, r2, 0 + cmp r2, 0 + bge _0805AFC6 + adds r0, r2, 0x3 +_0805AFC6: + movs r7, 0xE + ldrsh r1, [r3, r7] + asrs r0, 2 + cmp r1, r0 + bgt _0805AFD4 + movs r2, 0 + b _0805AFFA +_0805AFD4: + movs r0, 0xE + ldrsh r1, [r3, r0] + lsrs r0, r2, 31 + adds r0, r2, r0 + asrs r0, 1 + cmp r1, r0 + bgt _0805AFE6 + movs r2, 0x1 + b _0805AFFA +_0805AFE6: + lsls r0, r2, 1 + adds r0, r2 + cmp r0, 0 + bge _0805AFF0 + adds r0, 0x3 +_0805AFF0: + asrs r0, 2 + movs r2, 0x3 + cmp r1, r0 + bgt _0805AFFA + movs r2, 0x2 +_0805AFFA: + ldr r1, _0805B024 + lsls r0, r2, 2 + adds r0, r1 + ldr r3, [r0] + str r6, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, r8 + bl sub_8055640 + adds r1, r0, 0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805B024: .4byte gUnknown_80F51C4 + thumb_func_end sub_805AFA4 + + thumb_func_start sub_805B028 +sub_805B028: + push {lr} + movs r2, 0x1 + bl sub_8077780 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805B028 + + thumb_func_start sub_805B038 +sub_805B038: + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + adds r4, r2, 0 + bl sub_80441BC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0805B05A + strb r0, [r4, 0x4] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_8078E18 + movs r0, 0x1 + b _0805B068 +_0805B05A: + ldr r0, _0805B070 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_80522F4 + movs r0, 0 +_0805B068: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0805B070: .4byte gUnknown_80FEFF4 + thumb_func_end sub_805B038 + + thumb_func_start sub_805B074 +sub_805B074: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _0805B0AE + movs r7, 0x1 + ldr r0, _0805B0B8 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _0805B0AE + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_80763F8 +_0805B0AE: + adds r0, r7, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805B0B8: .4byte gUnknown_80F4DC6 + thumb_func_end sub_805B074 + + thumb_func_start sub_805B0BC +sub_805B0BC: + push {lr} + ldr r2, [r0, 0x70] + adds r2, 0x46 + ldrb r2, [r2] + bl sub_807CD9C + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805B0BC + + thumb_func_start sub_805B0D0 +sub_805B0D0: + push {r4-r7,lr} + adds r7, r0, 0 + adds r5, r1, 0 + ldr r4, [r5, 0x70] + ldr r1, _0805B134 + ldr r0, _0805B138 + ldr r0, [r0] + ldr r2, _0805B13C + adds r0, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + adds r0, r1 + ldrb r6, [r0] + adds r0, r5, 0 + movs r1, 0x25 + bl sub_8071824 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0805B14C + adds r0, r4, 0 + adds r0, 0x5C + strb r6, [r0] + adds r0, 0x1 + strb r1, [r0] + adds r1, r4, 0 + adds r1, 0xF6 + movs r0, 0x1 + strb r0, [r1] + ldr r0, _0805B140 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r6, 0 + bl sub_8092334 + adds r1, r0, 0 + ldr r0, _0805B144 + bl strcpy + ldr r0, _0805B148 + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 + movs r0, 0x1 + b _0805B15A + .align 2, 0 +_0805B134: .4byte gUnknown_80F561C +_0805B138: .4byte gUnknown_203B418 +_0805B13C: .4byte 0x00003a0e +_0805B140: .4byte gUnknown_202DFE8 +_0805B144: .4byte gUnknown_202DE58 +_0805B148: .4byte gUnknown_80FEB08 +_0805B14C: + ldr r0, _0805B160 + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 + movs r0, 0 +_0805B15A: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805B160: .4byte gUnknown_81006F8 + thumb_func_end sub_805B0D0 + + thumb_func_start sub_805B164 +sub_805B164: + push {lr} + ldr r2, _0805B178 + ldr r2, [r2] + movs r3, 0x2 + bl sub_8077084 + movs r0, 0x1 + pop {r1} + bx r1 + .align 2, 0 +_0805B178: .4byte gUnknown_8106A50 + thumb_func_end sub_805B164 + + thumb_func_start sub_805B17C +sub_805B17C: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + adds r7, r2, 0 + mov r8, r3 + movs r0, 0 + mov r9, r0 + ldrh r1, [r7, 0x2] + ldr r0, _0805B1A8 + cmp r1, r0 + bne _0805B1AC + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_807A9D8 + movs r6, 0x9E + lsls r6, 1 + b _0805B1BA + .align 2, 0 +_0805B1A8: .4byte 0x00000123 +_0805B1AC: + movs r6, 0x75 + cmp r1, 0x45 + beq _0805B1BA + movs r6, 0xF1 + cmp r1, 0x7D + bne _0805B1BA + movs r6, 0x7E +_0805B1BA: + movs r3, 0x80 + lsls r3, 1 + mov r1, r8 + str r1, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r7, 0 + bl sub_8055640 + cmp r0, 0 + beq _0805B1F4 + movs r0, 0x1 + mov r9, r0 + ldr r0, _0805B204 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _0805B1F4 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + movs r3, 0 + bl sub_80768DC +_0805B1F4: + mov r0, r9 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805B204: .4byte gUnknown_80F4E08 + thumb_func_end sub_805B17C + + thumb_func_start sub_805B208 +sub_805B208: + push {lr} + bl sub_80788E8 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805B208 + + thumb_func_start sub_805B214 +sub_805B214: + push {lr} + bl sub_8076B48 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805B214 + + thumb_func_start sub_805B220 +sub_805B220: + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r6, 0 + ldr r0, [r4, 0x70] + ldrb r0, [r0, 0x6] + movs r2, 0x1 + cmp r0, 0 + beq _0805B234 + movs r2, 0x2 +_0805B234: + adds r0, r4, 0x4 + movs r1, 0x13 + bl sub_807FCD4 + lsls r0, 24 + cmp r0, 0 + beq _0805B246 + movs r6, 0x1 + b _0805B252 +_0805B246: + ldr r0, _0805B260 + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80522F4 +_0805B252: + bl sub_8049ED4 + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0805B260: .4byte gUnknown_80FC5A8 + thumb_func_end sub_805B220 + + thumb_func_start sub_805B264 +sub_805B264: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + mov r8, r0 + adds r7, r1, 0 + mov r9, r2 + mov r12, r3 + ldr r4, [r7, 0x70] + ldr r0, _0805B2D0 + ldr r3, [r0] + movs r6, 0 + ldr r0, _0805B2D4 + ldr r1, [r0] + movs r0, 0xC1 + lsls r0, 9 + adds r5, r1, r0 + ldr r2, _0805B2D8 + lsls r0, r3, 2 + adds r0, r2 + ldr r0, [r0] + str r0, [r5] + ldr r0, _0805B2DC + adds r1, r0 + str r6, [r1] + ldr r0, _0805B2E0 + lsls r3, 1 + adds r3, r0 + movs r0, 0 + ldrsh r3, [r3, r0] + adds r4, 0xC0 + ldrb r0, [r4] + cmp r0, 0xA + bne _0805B2AC + lsls r3, 1 +_0805B2AC: + mov r0, r12 + str r0, [sp] + mov r0, r8 + adds r1, r7, 0 + mov r2, r9 + bl sub_8055864 + negs r1, r0 + orrs r1, r0 + lsrs r6, r1, 31 + adds r0, r6, 0 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805B2D0: .4byte gUnknown_202F224 +_0805B2D4: .4byte gUnknown_203B418 +_0805B2D8: .4byte gUnknown_8106A8C +_0805B2DC: .4byte 0x00018204 +_0805B2E0: .4byte gUnknown_80F4F94 + thumb_func_end sub_805B264 + + thumb_func_start sub_805B2E4 +sub_805B2E4: + push {lr} + bl sub_80799A8 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805B2E4 + + thumb_func_start sub_805B2F0 +sub_805B2F0: + push {lr} + bl sub_8079B1C + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805B2F0 + + thumb_func_start sub_805B2FC +sub_805B2FC: + push {lr} + ldr r2, _0805B310 + ldr r2, [r2] + movs r3, 0x1 + bl sub_8077160 + movs r0, 0x1 + pop {r1} + bx r1 + .align 2, 0 +_0805B310: .4byte gUnknown_8106A4C + thumb_func_end sub_805B2FC + + thumb_func_start sub_805B314 +sub_805B314: + push {lr} + movs r2, 0x1 + bl sub_80783C4 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805B314 + + thumb_func_start sub_805B324 +sub_805B324: + push {r4-r7,lr} + sub sp, 0x8 + adds r5, r0, 0 + adds r6, r1, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _0805B368 + movs r7, 0x1 + ldr r0, _0805B374 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _0805B368 + ldr r0, _0805B378 + ldr r2, [r0] + str r7, [sp] + movs r0, 0 + str r0, [sp, 0x4] + adds r0, r5, 0 + adds r1, r6, 0 + movs r3, 0x1 + bl sub_8076E20 +_0805B368: + adds r0, r7, 0 + add sp, 0x8 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805B374: .4byte gUnknown_80F4DD8 +_0805B378: .4byte gUnknown_8106A50 + thumb_func_end sub_805B324 + + thumb_func_start sub_805B37C +sub_805B37C: + push {lr} + bl sub_80780E4 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805B37C + + thumb_func_start sub_805B388 +sub_805B388: + push {r4,lr} + sub sp, 0x4 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _0805B39E + movs r0, 0x1 +_0805B39E: + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_805B388 + + thumb_func_start sub_805B3A8 +sub_805B3A8: + push {lr} + bl sub_8079BA8 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805B3A8 + + thumb_func_start sub_805B3B4 +sub_805B3B4: + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + ldr r0, _0805B3DC + ldr r4, [r0] + adds r0, r5, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8077084 + adds r0, r5, 0 + adds r1, r6, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8077160 + movs r0, 0x1 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0805B3DC: .4byte gUnknown_8106A50 + thumb_func_end sub_805B3B4 + + thumb_func_start sub_805B3E0 +sub_805B3E0: + push {r4,lr} + sub sp, 0x4 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + movs r0, 0x1 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_805B3E0 + + thumb_func_start sub_805B3FC +sub_805B3FC: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r7, r3, 0 + ldr r0, [sp, 0x18] + movs r6, 0 + movs r3, 0x80 + lsls r3, 1 + str r0, [sp] + adds r0, r5, 0 + bl sub_8055640 + cmp r0, 0 + beq _0805B446 + movs r6, 0x1 + ldr r0, _0805B450 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r5, 0 + adds r1, r5, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _0805B446 + ldr r4, [r5, 0x70] + adds r0, r5, 0 + adds r1, r5, 0 + adds r2, r7, 0 + movs r3, 0x1 + bl sub_8077084 + adds r4, 0xFB + ldrb r0, [r4] + cmp r0, 0 + bne _0805B446 + strb r6, [r4] +_0805B446: + adds r0, r6, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805B450: .4byte gUnknown_80F4DCE + thumb_func_end sub_805B3FC + + thumb_func_start sub_805B454 +sub_805B454: + push {lr} + movs r2, 0x1 + bl sub_807614C + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805B454 + + thumb_func_start sub_805B464 +sub_805B464: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r6, r0, 0 + mov r9, r1 + movs r0, 0 + str r0, [sp] + ldr r1, [r6, 0x70] + mov r8, r1 + mov r1, r9 + ldr r0, [r1, 0x70] + movs r5, 0 + ldr r1, _0805B50C + mov r10, r1 + subs r1, 0x2F + adds r4, r0, r1 + movs r7, 0x3 +_0805B48C: + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0805B4D4 + ldrh r1, [r4, 0x2] + adds r0, r6, 0 + bl sub_805755C + lsls r0, 24 + cmp r0, 0 + bne _0805B4D4 + ldrh r2, [r4, 0x2] + adds r0, r2, 0 + cmp r0, r10 + beq _0805B4D4 + cmp r0, 0xE5 + beq _0805B4D4 + cmp r0, 0x8A + beq _0805B4D4 + cmp r0, 0x28 + beq _0805B4D4 + cmp r0, 0x11 + beq _0805B4D4 + ldrb r1, [r4] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0805B4D4 + lsls r1, r5, 1 + movs r0, 0xBD + lsls r0, 1 + add r0, r8 + adds r0, r1 + strh r2, [r0] + adds r5, 0x1 +_0805B4D4: + adds r4, 0x8 + subs r7, 0x1 + cmp r7, 0 + bge _0805B48C + ldr r0, _0805B510 + adds r1, r6, 0 + movs r2, 0 + bl sub_8045B94 + cmp r5, 0 + beq _0805B518 + mov r1, r8 + adds r1, 0xFB + ldrb r0, [r1] + cmp r0, 0 + bne _0805B4F8 + movs r0, 0x1 + strb r0, [r1] +_0805B4F8: + ldr r0, _0805B514 + ldr r2, [r0] + adds r0, r6, 0 + mov r1, r9 + bl sub_80522F4 + movs r0, 0x1 + str r0, [sp] + b _0805B524 + .align 2, 0 +_0805B50C: .4byte 0x00000147 +_0805B510: .4byte gUnknown_202DF98 +_0805B514: .4byte gUnknown_80FDCE4 +_0805B518: + ldr r0, _0805B538 + ldr r2, [r0] + adds r0, r6, 0 + mov r1, r9 + bl sub_80522F4 +_0805B524: + ldr r0, [sp] + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805B538: .4byte gUnknown_80FDD00 + thumb_func_end sub_805B464 + + thumb_func_start sub_805B53C +sub_805B53C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + mov r10, r0 + mov r9, r1 + adds r6, r2, 0 + mov r8, r3 + movs r0, 0 + add r1, sp, 0x18 + strb r0, [r1] + mov r0, r10 + ldr r1, [r0, 0x70] + movs r5, 0x1 + movs r2, 0 + ldr r4, _0805B580 + movs r3, 0 + ldrsh r0, [r4, r3] + cmp r0, 0 + blt _0805B598 + movs r7, 0xC + ldrsh r3, [r1, r7] + adds r1, r4, 0 + ldr r4, _0805B584 +_0805B570: + movs r7, 0 + ldrsh r0, [r1, r7] + cmp r3, r0 + bge _0805B588 + movs r0, 0x2 + ldrsh r5, [r1, r0] + b _0805B598 + .align 2, 0 +_0805B580: .4byte gUnknown_80F55EC +_0805B584: .4byte 0x000003e6 +_0805B588: + adds r1, 0x4 + adds r2, 0x1 + cmp r2, r4 + bgt _0805B598 + movs r7, 0 + ldrsh r0, [r1, r7] + cmp r0, 0 + bge _0805B570 +_0805B598: + adds r0, r6, 0 + bl sub_8092B00 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + mov r1, r8 + bl sub_8057600 + lsls r0, 16 + asrs r0, 16 + add r1, sp, 0x18 + str r1, [sp] + str r4, [sp, 0x4] + str r0, [sp, 0x8] + movs r1, 0 + str r1, [sp, 0xC] + movs r0, 0x1 + str r0, [sp, 0x10] + str r1, [sp, 0x14] + mov r0, r10 + mov r1, r9 + adds r2, r5, 0 + movs r3, 0x1 + bl sub_806F370 + add r1, sp, 0x18 + movs r2, 0 + adds r0, r1, 0 + ldrb r0, [r0] + cmp r0, 0 + bne _0805B5DC + movs r2, 0x1 +_0805B5DC: + strb r2, [r1] + add r0, sp, 0x18 + ldrb r0, [r0] + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_805B53C + + thumb_func_start sub_805B5F4 +sub_805B5F4: + push {r4,lr} + adds r4, r0, 0 + movs r2, 0x1 + bl sub_8077F40 + ldr r0, [r4, 0x70] + adds r1, r0, 0 + adds r1, 0xFB + ldrb r0, [r1] + cmp r0, 0 + bne _0805B60E + movs r0, 0x1 + strb r0, [r1] +_0805B60E: + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_805B5F4 + + thumb_func_start sub_805B618 +sub_805B618: + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x8 + adds r6, r0, 0 + mov r8, r1 + mov r9, r3 + ldr r0, _0805B660 + ldr r4, [r0] + ldr r5, _0805B664 + lsls r4, 3 + adds r0, r4, r5 + ldrh r1, [r0] + mov r0, sp + bl sub_8092A88 + adds r5, 0x4 + adds r4, r5 + ldr r4, [r4] + adds r0, r6, 0 + mov r1, r8 + mov r2, sp + mov r3, r9 + bl _call_via_r4 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0805B660: .4byte gUnknown_202F228 +_0805B664: .4byte gUnknown_80F59C8 + thumb_func_end sub_805B618 + + thumb_func_start sub_805B668 +sub_805B668: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + adds r5, r0, 0 + adds r4, r1, 0 + adds r7, r2, 0 + adds r6, r3, 0 + movs r0, 0 + mov r8, r0 + adds r0, r4, 0 + movs r1, 0x3A + bl sub_8071824 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + adds r0, r4, 0 + bl sub_8070B28 + lsls r0, 24 + cmp r0, 0 + beq _0805B712 + movs r3, 0x80 + lsls r3, 1 + str r6, [sp] + adds r0, r5, 0 + adds r1, r4, 0 + adds r2, r7, 0 + bl sub_8055640 + adds r1, r0, 0 + cmp r1, 0 + beq _0805B71E + movs r0, 0x1 + mov r8, r0 + lsrs r0, r1, 31 + adds r0, r1, r0 + asrs r4, r0, 1 + cmp r4, 0 + bgt _0805B6BE + movs r4, 0x1 +_0805B6BE: + adds r0, r5, 0 + movs r1, 0 + bl sub_8057308 + lsls r0, 24 + cmp r0, 0 + beq _0805B71E + ldr r0, [r5, 0x70] + adds r1, r0, 0 + adds r1, 0xFB + ldrb r0, [r1] + cmp r0, 0 + bne _0805B6DC + mov r0, r8 + strb r0, [r1] +_0805B6DC: + adds r0, r5, 0 + movs r1, 0 + bl sub_8057308 + lsls r0, 24 + cmp r0, 0 + beq _0805B71E + mov r0, r9 + cmp r0, 0 + beq _0805B700 + movs r3, 0xFD + lsls r3, 1 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0xD + bl sub_806F324 + b _0805B71E +_0805B700: + mov r0, r8 + str r0, [sp] + adds r0, r5, 0 + adds r1, r5, 0 + adds r2, r4, 0 + movs r3, 0 + bl sub_8077C44 + b _0805B71E +_0805B712: + ldr r0, _0805B730 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 +_0805B71E: + mov r0, r8 + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805B730: .4byte gUnknown_810024C + thumb_func_end sub_805B668 + + thumb_func_start sub_805B734 +sub_805B734: + push {lr} + bl sub_8078678 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805B734 + + thumb_func_start sub_805B740 +sub_805B740: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r9, r0 + adds r6, r1, 0 + ldr r5, [r6, 0x70] + movs r7, 0 + ldrb r0, [r5, 0x6] + cmp r0, 0 + bne _0805B7C2 + movs r4, 0 + movs r0, 0x60 + adds r0, r5 + mov r8, r0 +_0805B75E: + lsls r1, r4, 2 + ldr r0, _0805B7D4 + ldr r0, [r0] + adds r2, r1, r0 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0805B790 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0805B790 + ldrb r0, [r2, 0x2] + cmp r0, 0x7C + bne _0805B790 + ldrb r1, [r2, 0x1] + adds r1, 0x7D + lsls r1, 24 + lsrs r1, 24 + adds r0, r2, 0 + movs r2, 0 + bl sub_8090A8C + movs r7, 0x1 +_0805B790: + adds r4, 0x1 + cmp r4, 0x13 + ble _0805B75E + mov r0, r8 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0805B7C2 + adds r0, r5, 0 + adds r0, 0x62 + ldrb r0, [r0] + cmp r0, 0x7C + bne _0805B7C2 + adds r0, r5, 0 + adds r0, 0x61 + ldrb r1, [r0] + adds r1, 0x7D + lsls r1, 24 + lsrs r1, 24 + mov r0, r8 + movs r2, 0 + bl sub_8090A8C + movs r7, 0x1 +_0805B7C2: + cmp r7, 0 + beq _0805B7DC + ldr r0, _0805B7D8 + ldr r2, [r0] + mov r0, r9 + adds r1, r6, 0 + bl sub_80522F4 + b _0805B7E8 + .align 2, 0 +_0805B7D4: .4byte gUnknown_203B460 +_0805B7D8: .4byte gUnknown_80FDC9C +_0805B7DC: + ldr r0, _0805B7F8 + ldr r2, [r0] + mov r0, r9 + adds r1, r6, 0 + bl sub_80522F4 +_0805B7E8: + adds r0, r7, 0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805B7F8: .4byte gUnknown_80FDCA0 + thumb_func_end sub_805B740 + + thumb_func_start sub_805B7FC +sub_805B7FC: + push {lr} + bl sub_8079AA0 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805B7FC + + thumb_func_start sub_805B808 +sub_805B808: + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0x1C + mov r9, r0 + mov r10, r1 + adds r6, r2, 0 + mov r8, r3 + movs r5, 0 + add r0, sp, 0x18 + strb r5, [r0] + adds r0, r6, 0 + bl sub_8092B00 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + mov r1, r8 + bl sub_8057600 + lsls r0, 16 + asrs r0, 16 + ldr r1, _0805B880 + movs r3, 0 + ldrsh r2, [r1, r3] + add r1, sp, 0x18 + str r1, [sp] + str r4, [sp, 0x4] + str r0, [sp, 0x8] + str r5, [sp, 0xC] + movs r0, 0x1 + str r0, [sp, 0x10] + str r5, [sp, 0x14] + mov r0, r9 + mov r1, r10 + movs r3, 0x1 + bl sub_806F370 + add r1, sp, 0x18 + movs r2, 0 + adds r0, r1, 0 + ldrb r0, [r0] + cmp r0, 0 + bne _0805B868 + movs r2, 0x1 +_0805B868: + strb r2, [r1] + add r0, sp, 0x18 + ldrb r0, [r0] + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0805B880: .4byte gUnknown_80F4F7E + thumb_func_end sub_805B808 + + thumb_func_start sub_805B884 +sub_805B884: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldr r0, _0805B8AC + ldr r2, [r0] + adds r0, r4, 0 + movs r3, 0x1 + bl sub_8077084 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_8077910 + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0805B8AC: .4byte gUnknown_8106A4C + thumb_func_end sub_805B884 + + thumb_func_start sub_805B8B0 +sub_805B8B0: + push {r4-r7,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r7, r1, 0 + adds r4, r2, 0 + adds r6, r3, 0 + adds r1, r4, 0 + bl sub_80570AC + lsls r0, 24 + cmp r0, 0 + beq _0805B8EC + ldr r0, _0805B8E8 + ldr r3, [r0] + str r6, [sp] + adds r0, r5, 0 + adds r1, r7, 0 + adds r2, r4, 0 + bl sub_8055640 + negs r1, r0 + orrs r1, r0 + lsrs r4, r1, 31 + adds r0, r5, 0 + bl sub_8079764 + b _0805B900 + .align 2, 0 +_0805B8E8: .4byte gUnknown_80F4F58 +_0805B8EC: + ldr r0, _0805B90C + ldr r0, [r0] + str r0, [sp] + adds r0, r5, 0 + adds r1, r7, 0 + movs r2, 0x6 + adds r3, r4, 0 + bl sub_8079618 + movs r4, 0x1 +_0805B900: + adds r0, r4, 0 + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805B90C: .4byte gUnknown_80FAFF0 + thumb_func_end sub_805B8B0 + + thumb_func_start sub_805B910 +sub_805B910: + push {r4-r7,lr} + sub sp, 0x8 + adds r5, r0, 0 + adds r6, r1, 0 + movs r7, 0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _0805B954 + movs r7, 0x1 + ldr r0, _0805B960 + movs r1, 0 + ldrsh r2, [r0, r1] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _0805B954 + ldr r0, _0805B964 + ldr r2, [r0] + str r7, [sp] + movs r0, 0 + str r0, [sp, 0x4] + adds r0, r5, 0 + adds r1, r6, 0 + movs r3, 0x1 + bl sub_8076F80 +_0805B954: + adds r0, r7, 0 + add sp, 0x8 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805B960: .4byte gUnknown_80F4DDC +_0805B964: .4byte gUnknown_8106A50 + thumb_func_end sub_805B910 + + thumb_func_start sub_805B968 +sub_805B968: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x18 + adds r5, r0, 0 + adds r6, r2, 0 + adds r7, r3, 0 + movs r0, 0 + mov r8, r0 + movs r3, 0x80 + lsls r3, 1 + str r7, [sp] + adds r0, r5, 0 + bl sub_8055640 + cmp r0, 0 + beq _0805B9D8 + movs r1, 0x1 + mov r8, r1 + adds r0, r5, 0 + movs r1, 0 + bl sub_8057308 + lsls r0, 24 + cmp r0, 0 + beq _0805B9D8 + ldr r0, [r5, 0x70] + movs r1, 0x10 + ldrsh r2, [r0, r1] + cmp r2, 0 + bge _0805B9A8 + adds r2, 0x3 +_0805B9A8: + asrs r4, r2, 2 + cmp r4, 0 + bgt _0805B9B0 + movs r4, 0x1 +_0805B9B0: + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_8057600 + lsls r0, 16 + asrs r0, 16 + movs r1, 0 + str r1, [sp] + str r1, [sp, 0x4] + str r0, [sp, 0x8] + str r1, [sp, 0xC] + mov r0, r8 + str r0, [sp, 0x10] + str r1, [sp, 0x14] + adds r0, r5, 0 + adds r1, r5, 0 + adds r2, r4, 0 + movs r3, 0 + bl sub_806F370 +_0805B9D8: + mov r0, r8 + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_805B968 + + thumb_func_start sub_805B9E8 +sub_805B9E8: + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r4, r1, 0 + movs r6, 0 + mov r0, sp + bl sub_8069D18 + lsls r0, 24 + cmp r0, 0 + beq _0805BA08 + ldr r0, _0805BA04 + b _0805BA18 + .align 2, 0 +_0805BA04: .4byte gUnknown_80FD430 +_0805BA08: + mov r0, sp + bl sub_804AD34 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + beq _0805BA28 + ldr r0, _0805BA24 +_0805BA18: + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _0805BA34 + .align 2, 0 +_0805BA24: .4byte gUnknown_80FD3F0 +_0805BA28: + ldr r0, _0805BA40 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 +_0805BA34: + adds r0, r6, 0 + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0805BA40: .4byte gUnknown_80FD40C + thumb_func_end sub_805B9E8 + + thumb_func_start sub_805BA44 +sub_805BA44: + push {lr} + bl sub_807D3CC + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805BA44 + + thumb_func_start sub_805BA50 +sub_805BA50: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r6, r0, 0 + adds r5, r1, 0 + movs r0, 0 + mov r9, r0 + movs r4, 0x80 + lsls r4, 1 + str r3, [sp] + adds r0, r6, 0 + adds r3, r4, 0 + bl sub_8055640 + cmp r0, 0 + beq _0805BB4C + movs r1, 0x1 + mov r9, r1 + adds r0, r6, 0 + adds r1, r5, 0 + movs r2, 0 + bl sub_805727C + lsls r0, 24 + cmp r0, 0 + beq _0805BB4C + ldr r0, [r6, 0x70] + mov r8, r0 + mov r10, r8 + ldr r7, [r5, 0x70] + str r7, [sp, 0x4] + ldr r4, _0805BAC0 + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_8045B94 + adds r4, 0x50 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r5, 0 + movs r1, 0x2C + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0805BAC4 + movs r0, 0x1 + b _0805BB4E + .align 2, 0 +_0805BAC0: .4byte gUnknown_202DF98 +_0805BAC4: + adds r0, r5, 0 + movs r1, 0x24 + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _0805BADC + ldr r0, _0805BAD8 + b _0805BB04 + .align 2, 0 +_0805BAD8: .4byte gUnknown_80FD574 +_0805BADC: + mov r0, r8 + adds r0, 0x60 + adds r3, r7, 0 + adds r3, 0x60 + ldrb r0, [r0] + mov r2, r9 + ands r2, r0 + cmp r2, 0 + beq _0805BAF8 + ldr r0, _0805BAF4 + b _0805BB04 + .align 2, 0 +_0805BAF4: .4byte gUnknown_80FC654 +_0805BAF8: + ldrb r1, [r3] + mov r0, r9 + ands r0, r1 + cmp r0, 0 + bne _0805BB18 + ldr r0, _0805BB14 +_0805BB04: + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80522F4 + movs r0, 0x1 + b _0805BB4E + .align 2, 0 +_0805BB14: .4byte gUnknown_80FC678 +_0805BB18: + ldr r1, [sp, 0x4] + ldr r0, [r1, 0x60] + mov r1, r10 + str r0, [r1, 0x60] + strb r2, [r3, 0x2] + strb r2, [r3, 0x1] + strb r2, [r3] + adds r0, r6, 0 + bl sub_806A6E8 + adds r0, r5, 0 + bl sub_806A6E8 + mov r1, r10 + adds r1, 0xFB + ldrb r0, [r1] + cmp r0, 0 + bne _0805BB40 + mov r0, r9 + strb r0, [r1] +_0805BB40: + ldr r0, _0805BB60 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80522F4 +_0805BB4C: + mov r0, r9 +_0805BB4E: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805BB60: .4byte gUnknown_80FC614 + thumb_func_end sub_805BA50 + + thumb_func_start sub_805BB64 +sub_805BB64: + push {lr} + movs r2, 0xA + bl sub_80797A0 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805BB64 + + thumb_func_start sub_805BB74 +sub_805BB74: + push {lr} + adds r3, r0, 0 + ldr r0, [r3, 0x70] + adds r2, r0, 0 + adds r2, 0xFB + ldrb r0, [r2] + cmp r0, 0 + bne _0805BB88 + movs r0, 0x1 + strb r0, [r2] +_0805BB88: + adds r0, r3, 0 + movs r2, 0x1 + bl sub_807E254 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805BB74 + + thumb_func_start sub_805BB98 +sub_805BB98: + push {lr} + movs r2, 0x1 + movs r3, 0 + bl sub_807D148 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805BB98 + + thumb_func_start sub_805BBA8 +sub_805BBA8: + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r0 + adds r6, r1, 0 + ldr r0, [r6, 0x70] + movs r7, 0 + ldrb r0, [r0, 0x6] + cmp r0, 0 + bne _0805BC30 + movs r5, 0 + ldr r3, _0805BC44 +_0805BBC0: + lsls r1, r5, 2 + ldr r0, [r3] + adds r1, r0 + ldrb r2, [r1] + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _0805BBE8 + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + bne _0805BBE8 + movs r0, 0x8 + ands r0, r2 + cmp r0, 0 + beq _0805BBE8 + movs r0, 0xF7 + ands r0, r2 + strb r0, [r1] + movs r7, 0x1 +_0805BBE8: + adds r5, 0x1 + cmp r5, 0x13 + ble _0805BBC0 + movs r5, 0 +_0805BBF0: + ldr r0, _0805BC48 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _0805BC4C + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0805BC2A + ldr r0, [r4, 0x70] + adds r2, r0, 0 + adds r2, 0x60 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0805BC2A + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0805BC2A + movs r0, 0xF7 + ands r0, r1 + strb r0, [r2] + movs r7, 0x1 +_0805BC2A: + adds r5, 0x1 + cmp r5, 0x3 + ble _0805BBF0 +_0805BC30: + cmp r7, 0 + beq _0805BC54 + ldr r0, _0805BC50 + ldr r2, [r0] + mov r0, r8 + adds r1, r6, 0 + bl sub_80522F4 + b _0805BC60 + .align 2, 0 +_0805BC44: .4byte gUnknown_203B460 +_0805BC48: .4byte gUnknown_203B418 +_0805BC4C: .4byte 0x0001357c +_0805BC50: .4byte gUnknown_80FC8F0 +_0805BC54: + ldr r0, _0805BC6C + ldr r2, [r0] + mov r0, r8 + adds r1, r6, 0 + bl sub_80522F4 +_0805BC60: + adds r0, r7, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805BC6C: .4byte gUnknown_80FC920 + thumb_func_end sub_805BBA8 + + thumb_func_start sub_805BC70 +sub_805BC70: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldr r1, _0805BC94 + adds r0, r4, 0 + movs r2, 0x1 + bl sub_808417C + adds r2, r0, 0 + adds r0, r5, 0 + adds r1, r4, 0 + movs r3, 0x1 + bl sub_8075C58 + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0805BC94: .4byte gUnknown_80F4E74 + thumb_func_end sub_805BC70 + + thumb_func_start sub_805BC98 +sub_805BC98: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + adds r6, r0, 0 + mov r8, r1 + mov r10, r2 + str r3, [sp, 0x1C] + movs r5, 0 + add r0, sp, 0x18 + strb r5, [r0] + mov r7, sp + adds r7, 0x19 + strb r5, [r7] + ldr r0, [r6, 0x70] + mov r9, r0 + ldr r0, [r1, 0x70] + movs r1, 0xE + ldrsh r0, [r0, r1] + subs r4, r0, 0x1 + cmp r4, 0 + bge _0805BCCA + movs r4, 0 +_0805BCCA: + mov r0, r10 + ldr r1, [sp, 0x1C] + bl sub_8057600 + lsls r0, 16 + asrs r0, 16 + add r2, sp, 0x18 + str r2, [sp] + str r5, [sp, 0x4] + str r0, [sp, 0x8] + str r5, [sp, 0xC] + str r5, [sp, 0x10] + str r5, [sp, 0x14] + adds r0, r6, 0 + mov r1, r8 + adds r2, r4, 0 + movs r3, 0 + bl sub_806F370 + mov r1, r9 + movs r2, 0xE + ldrsh r0, [r1, r2] + lsrs r1, r0, 31 + adds r0, r1 + asrs r4, r0, 1 + cmp r4, 0 + bge _0805BD02 + movs r4, 0 +_0805BD02: + mov r0, r10 + ldr r1, [sp, 0x1C] + bl sub_8057600 + lsls r0, 16 + asrs r0, 16 + str r7, [sp] + str r5, [sp, 0x4] + str r0, [sp, 0x8] + str r5, [sp, 0xC] + str r5, [sp, 0x10] + str r5, [sp, 0x14] + adds r0, r6, 0 + adds r1, r6, 0 + adds r2, r4, 0 + movs r3, 0 + bl sub_806F370 + add r1, sp, 0x18 + movs r2, 0 + adds r0, r1, 0 + ldrb r0, [r0] + cmp r0, 0 + bne _0805BD34 + movs r2, 0x1 +_0805BD34: + strb r2, [r1] + movs r1, 0 + ldrb r0, [r7] + cmp r0, 0 + bne _0805BD40 + movs r1, 0x1 +_0805BD40: + strb r1, [r7] + movs r2, 0 + add r0, sp, 0x18 + ldrb r0, [r0] + cmp r0, 0 + bne _0805BD50 + cmp r1, 0 + beq _0805BD52 +_0805BD50: + movs r2, 0x1 +_0805BD52: + adds r0, r2, 0 + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_805BC98 + + thumb_func_start sub_805BD64 +sub_805BD64: + push {lr} + bl sub_8078D8C + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805BD64 + + thumb_func_start sub_805BD70 +sub_805BD70: + push {lr} + bl sub_8077DDC + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805BD70 + + thumb_func_start sub_805BD7C +sub_805BD7C: + push {lr} + bl sub_8077ED0 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805BD7C + + thumb_func_start sub_805BD88 +sub_805BD88: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r10, r0 + adds r7, r1, 0 + movs r0, 0 + str r0, [sp] + ldr r1, [r7, 0x70] + ldrb r0, [r1, 0x6] + cmp r0, 0 + beq _0805BE60 + mov r9, r1 + movs r2, 0x2 + ldrsh r5, [r1, r2] + mov r8, r5 + ldr r0, _0805BDD0 + adds r1, r7, 0 + movs r2, 0 + bl sub_8045B94 + mov r0, r9 + adds r0, 0xA4 + ldrb r0, [r0] + cmp r0, 0 + beq _0805BDD8 + ldr r0, _0805BDD4 + ldr r2, [r0] + mov r0, r10 + adds r1, r7, 0 + bl sub_80522F4 + movs r0, 0 + b _0805BE78 + .align 2, 0 +_0805BDD0: .4byte gUnknown_202DF98 +_0805BDD4: .4byte gUnknown_80FD450 +_0805BDD8: + movs r6, 0 + b _0805BDDE +_0805BDDC: + adds r6, 0x1 +_0805BDDE: + cmp r6, 0x1D + bgt _0805BE14 + movs r0, 0 + bl sub_803D970 + lsls r0, 16 + asrs r5, r0, 16 + adds r0, r5, 0 + movs r1, 0 + bl sub_806AA0C + lsls r0, 24 + cmp r0, 0 + beq _0805BDDC + cmp r8, r5 + beq _0805BDDC + mov r0, r8 + bl sub_808DACC + adds r4, r0, 0 + adds r0, r5, 0 + bl sub_808DACC + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _0805BDDC +_0805BE14: + cmp r6, 0x1E + beq _0805BE22 + mov r1, r9 + movs r2, 0x2 + ldrsh r0, [r1, r2] + cmp r0, r5 + bne _0805BE34 +_0805BE22: + ldr r0, _0805BE30 + ldr r2, [r0] + mov r0, r10 + adds r1, r7, 0 + bl sub_80522F4 + b _0805BE76 + .align 2, 0 +_0805BE30: .4byte gUnknown_80FD450 +_0805BE34: + ldr r0, _0805BE58 + adds r1, r5, 0 + bl sub_808D908 + ldr r0, _0805BE5C + ldr r2, [r0] + mov r0, r10 + adds r1, r7, 0 + bl sub_80522F4 + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_806BB6C + movs r0, 0x1 + str r0, [sp] + b _0805BE76 + .align 2, 0 +_0805BE58: .4byte gUnknown_202DFE8 +_0805BE5C: .4byte gUnknown_80FD434 +_0805BE60: + ldr r0, _0805BE88 + adds r1, r7, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _0805BE8C + ldr r2, [r0] + mov r0, r10 + adds r1, r7, 0 + bl sub_80522F4 +_0805BE76: + ldr r0, [sp] +_0805BE78: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805BE88: .4byte gUnknown_202DF98 +_0805BE8C: .4byte gUnknown_80FD450 + thumb_func_end sub_805BD88 + + thumb_func_start sub_805BE90 +sub_805BE90: + push {lr} + movs r2, 0x1 + movs r3, 0x1 + bl sub_80779F0 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805BE90 + + thumb_func_start sub_805BEA0 +sub_805BEA0: + push {lr} + bl sub_804002C + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805BEA0 + + thumb_func_start sub_805BEAC +sub_805BEAC: + push {lr} + bl sub_8076D10 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805BEAC + + thumb_func_start sub_805BEB8 +sub_805BEB8: + push {lr} + movs r2, 0x8 + bl sub_807DA14 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805BEB8 + + thumb_func_start sub_805BEC8 +sub_805BEC8: + push {lr} + bl sub_807D510 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805BEC8 + + thumb_func_start sub_805BED4 +sub_805BED4: + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + ldr r0, _0805BF00 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldr r5, _0805BF04 + ldr r0, [r5] + ldr r1, _0805BF08 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0805BF10 + ldr r0, _0805BF0C + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_80522F4 + b _0805BF26 + .align 2, 0 +_0805BF00: .4byte gUnknown_202DF98 +_0805BF04: .4byte gUnknown_203B418 +_0805BF08: .4byte 0x0000066e +_0805BF0C: .4byte gUnknown_80FD4DC +_0805BF10: + ldr r0, _0805BF30 + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_80522F4 + ldr r0, [r5] + movs r1, 0x1 + strb r1, [r0, 0x4] + ldr r0, [r5] + strb r1, [r0, 0x11] +_0805BF26: + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0805BF30: .4byte gUnknown_80FD4C4 + thumb_func_end sub_805BED4 + + thumb_func_start sub_805BF34 +sub_805BF34: + push {lr} + bl sub_807DB74 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805BF34 + + thumb_func_start sub_805BF40 +sub_805BF40: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + str r0, [sp, 0x4] + str r1, [sp, 0x8] + movs r0, 0 + str r0, [sp, 0x10] + adds r0, r1, 0 + bl sub_8045128 + adds r4, r0, 0 + bl sub_80441BC + lsls r0, 24 + cmp r0, 0 + beq _0805BF78 + ldr r0, _0805BF74 + ldr r1, [r0] + ldr r0, [sp, 0x4] + bl sub_80522A8 + movs r0, 0 + b _0805C06A + .align 2, 0 +_0805BF74: .4byte gUnknown_80FD1EC +_0805BF78: + ldrb r0, [r4, 0x9] + cmp r0, 0xFF + bne _0805BFAC + ldr r2, [sp, 0x8] + movs r3, 0x4 + ldrsh r1, [r2, r3] + ldr r0, _0805BFA4 + ldr r0, [r0] + ldr r4, _0805BFA8 + adds r0, r4 + ldrb r0, [r0] + subs r2, r1, r0 + ldr r3, [sp, 0x8] + movs r4, 0x6 + ldrsh r1, [r3, r4] + subs r1, r0 + str r1, [sp, 0xC] + adds r1, r2, r0 + mov r10, r1 + ldr r3, [sp, 0xC] + adds r7, r3, r0 + b _0805BFDA + .align 2, 0 +_0805BFA4: .4byte gUnknown_203B418 +_0805BFA8: .4byte 0x00018209 +_0805BFAC: + ldr r2, _0805C050 + ldrb r1, [r4, 0x9] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r4, _0805C054 + adds r0, r4 + ldr r1, [r2] + adds r1, r0 + movs r2, 0x2 + ldrsh r0, [r1, r2] + subs r2, r0, 0x1 + movs r3, 0x4 + ldrsh r0, [r1, r3] + subs r0, 0x1 + str r0, [sp, 0xC] + movs r4, 0x6 + ldrsh r0, [r1, r4] + adds r0, 0x1 + mov r10, r0 + movs r3, 0x8 + ldrsh r0, [r1, r3] + adds r7, r0, 0x1 +_0805BFDA: + adds r6, r2, 0 + cmp r6, r10 + bgt _0805C034 +_0805BFE0: + ldr r5, [sp, 0xC] + adds r4, r6, 0x1 + mov r9, r4 + cmp r5, r7 + bgt _0805C02E + lsls r0, r6, 16 + lsrs r0, 16 + mov r8, r0 +_0805BFF0: + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_8049590 + ldr r4, [r0, 0x14] + cmp r4, 0 + beq _0805C028 + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0x2 + bne _0805C028 + adds r0, r4, 0 + bl sub_8045104 + ldrb r0, [r0] + cmp r0, 0x11 + beq _0805C028 + lsls r0, r5, 16 + mov r1, r8 + orrs r0, r1 + str r0, [sp] + mov r0, sp + movs r1, 0 + bl sub_807FE04 + movs r2, 0x1 + str r2, [sp, 0x10] +_0805C028: + adds r5, 0x1 + cmp r5, r7 + ble _0805BFF0 +_0805C02E: + mov r6, r9 + cmp r6, r10 + ble _0805BFE0 +_0805C034: + ldr r3, [sp, 0x10] + cmp r3, 0 + beq _0805C05C + ldr r0, _0805C058 + ldr r2, [r0] + ldr r0, [sp, 0x4] + ldr r1, [sp, 0x8] + bl sub_80522F4 + bl sub_8040A84 + bl sub_8049ED4 + b _0805C068 + .align 2, 0 +_0805C050: .4byte gUnknown_203B418 +_0805C054: .4byte 0x000104c4 +_0805C058: .4byte gUnknown_80FD1B0 +_0805C05C: + ldr r0, _0805C07C + ldr r2, [r0] + ldr r0, [sp, 0x4] + ldr r1, [sp, 0x8] + bl sub_80522F4 +_0805C068: + ldr r0, [sp, 0x10] +_0805C06A: + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805C07C: .4byte gUnknown_80FD1CC + thumb_func_end sub_805BF40 + + thumb_func_start sub_805C080 +sub_805C080: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r5, r0, 0 + mov r9, r1 + movs r0, 0 + mov r8, r0 + ldr r0, [r5, 0x70] + ldrb r0, [r0, 0x6] + cmp r0, 0 + beq _0805C0AC + ldr r0, _0805C0A4 + ldr r0, [r0] + ldr r1, _0805C0A8 + adds r0, r1 + movs r1, 0x10 + b _0805C0BA + .align 2, 0 +_0805C0A4: .4byte gUnknown_203B418 +_0805C0A8: .4byte 0x0001358c +_0805C0AC: + ldr r0, _0805C11C + ldr r0, [r0] + ldr r1, _0805C120 + adds r0, r1 + movs r1, 0x4 + cmp r1, 0 + beq _0805C0FA +_0805C0BA: + adds r6, r0, 0 + adds r7, r1, 0 +_0805C0BE: + ldr r4, [r6] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0805C0F2 + cmp r5, r4 + beq _0805C0F2 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + movs r3, 0 + bl sub_8071598 + lsls r0, 24 + cmp r0, 0 + bne _0805C0F2 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x2 + adds r3, r5, 0x4 + bl sub_807D148 + movs r0, 0x1 + mov r8, r0 +_0805C0F2: + adds r6, 0x4 + subs r7, 0x1 + cmp r7, 0 + bne _0805C0BE +_0805C0FA: + mov r1, r8 + cmp r1, 0 + bne _0805C10C + ldr r0, _0805C124 + ldr r2, [r0] + adds r0, r5, 0 + mov r1, r9 + bl sub_80522F4 +_0805C10C: + mov r0, r8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805C11C: .4byte gUnknown_203B418 +_0805C120: .4byte 0x0001357c +_0805C124: .4byte gUnknown_81004F0 + thumb_func_end sub_805C080 + + thumb_func_start sub_805C128 +sub_805C128: + push {lr} + adds r1, r0, 0 + bl sub_807885C + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805C128 + + thumb_func_start sub_805C138 +sub_805C138: + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0x1C + mov r9, r0 + mov r10, r1 + adds r6, r2, 0 + mov r8, r3 + movs r5, 0 + add r0, sp, 0x18 + strb r5, [r0] + adds r0, r6, 0 + bl sub_8092B00 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + mov r1, r8 + bl sub_8057600 + lsls r0, 16 + asrs r0, 16 + ldr r2, _0805C1AC + add r1, sp, 0x18 + str r1, [sp] + str r4, [sp, 0x4] + str r0, [sp, 0x8] + str r5, [sp, 0xC] + movs r0, 0x1 + str r0, [sp, 0x10] + str r5, [sp, 0x14] + mov r0, r9 + mov r1, r10 + movs r3, 0x1 + bl sub_806F370 + add r1, sp, 0x18 + movs r2, 0 + adds r0, r1, 0 + ldrb r0, [r0] + cmp r0, 0 + bne _0805C194 + movs r2, 0x1 +_0805C194: + strb r2, [r1] + add r0, sp, 0x18 + ldrb r0, [r0] + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0805C1AC: .4byte 0x0000270f + thumb_func_end sub_805C138 + + thumb_func_start sub_805C1B0 +sub_805C1B0: + push {lr} + bl sub_80790C8 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805C1B0 + + thumb_func_start sub_805C1BC +sub_805C1BC: + push {r4,r5,lr} + sub sp, 0x4 + ldr r4, _0805C1E0 + movs r5, 0 + ldrsh r4, [r4, r5] + str r3, [sp] + adds r3, r4, 0 + bl sub_8055864 + adds r1, r0, 0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0805C1E0: .4byte gUnknown_80F4F80 + thumb_func_end sub_805C1BC + + thumb_func_start sub_805C1E4 +sub_805C1E4: + push {lr} + ldr r2, _0805C1F4 + ldr r2, [r2] + bl sub_80522F4 + movs r0, 0 + pop {r1} + bx r1 + .align 2, 0 +_0805C1F4: .4byte gUnknown_80FD454 + thumb_func_end sub_805C1E4 + + thumb_func_start sub_805C1F8 +sub_805C1F8: + push {lr} + movs r2, 0x1 + bl sub_8077BB4 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805C1F8 + + thumb_func_start sub_805C208 +sub_805C208: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + adds r7, r0, 0 + mov r9, r1 + adds r6, r2, 0 + mov r8, r3 + movs r5, 0 + add r0, sp, 0x18 + strb r5, [r0] + ldr r0, [r1, 0x70] + movs r1, 0x4 + ldrsh r0, [r0, r1] + bl sub_808DB90 + mov r10, r0 + adds r0, r6, 0 + bl sub_8092B00 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r6, 0 + mov r1, r8 + bl sub_8057600 + lsls r0, 16 + asrs r0, 16 + add r1, sp, 0x18 + str r1, [sp] + str r4, [sp, 0x4] + str r0, [sp, 0x8] + str r5, [sp, 0xC] + movs r0, 0x1 + str r0, [sp, 0x10] + str r5, [sp, 0x14] + adds r0, r7, 0 + mov r1, r9 + mov r2, r10 + movs r3, 0x1 + bl sub_806F370 + add r1, sp, 0x18 + movs r2, 0 + adds r0, r1, 0 + ldrb r0, [r0] + cmp r0, 0 + bne _0805C270 + movs r2, 0x1 +_0805C270: + strb r2, [r1] + add r0, sp, 0x18 + ldrb r0, [r0] + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_805C208 + + thumb_func_start sub_805C288 +sub_805C288: + push {lr} + ldr r2, _0805C29C + movs r3, 0 + ldrsh r2, [r2, r3] + movs r3, 0 + bl sub_8078A58 + movs r0, 0x1 + pop {r1} + bx r1 + .align 2, 0 +_0805C29C: .4byte gUnknown_80F4FC6 + thumb_func_end sub_805C288 + + thumb_func_start sub_805C2A0 +sub_805C2A0: + push {lr} + bl sub_807DC68 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805C2A0 + + thumb_func_start sub_805C2AC +sub_805C2AC: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + mov r8, r0 + adds r7, r1, 0 + movs r0, 0 + mov r9, r0 + ldr r5, [r7, 0x70] + bl sub_80441BC + lsls r0, 24 + cmp r0, 0 + beq _0805C2DC + ldr r0, _0805C2D8 + ldr r1, [r0] + mov r0, r8 + bl sub_80522A8 + movs r0, 0 + b _0805C3CA + .align 2, 0 +_0805C2D8: .4byte gUnknown_80FD0B8 +_0805C2DC: + ldr r4, _0805C3A0 + adds r3, r5, 0 + adds r3, 0x46 + ldrb r0, [r3] + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0] + ldrh r1, [r7, 0x4] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + ldr r2, _0805C3A4 + ldr r1, [sp] + ands r1, r2 + orrs r1, r0 + str r1, [sp] + ldrb r0, [r3] + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x2] + ldrh r2, [r7, 0x6] + adds r0, r2 + lsls r0, 16 + ldr r2, _0805C3A8 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r4, sp + mov r0, sp + bl sub_8042A54 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl sub_8049590 + adds r2, r0, 0 + ldrh r1, [r2] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + bne _0805C36C + ldr r0, _0805C3AC + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strh r0, [r2] + movs r5, 0x1 + negs r5, r5 + mov r6, sp +_0805C344: + movs r4, 0x1 + negs r4, r4 +_0805C348: + movs r1, 0 + ldrsh r0, [r6, r1] + adds r0, r4 + movs r2, 0x2 + ldrsh r1, [r6, r2] + adds r1, r5 + bl sub_80498A8 + adds r4, 0x1 + cmp r4, 0x1 + ble _0805C348 + adds r5, 0x1 + cmp r5, 0x1 + ble _0805C344 + movs r0, 0x1 + mov r9, r0 + bl sub_806CF60 +_0805C36C: + movs r5, 0 +_0805C36E: + movs r4, 0 + adds r6, r5, 0x1 +_0805C372: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8049BB0 + adds r4, 0x1 + cmp r4, 0x37 + ble _0805C372 + adds r5, r6, 0 + cmp r5, 0x1F + ble _0805C36E + mov r1, r9 + cmp r1, 0 + beq _0805C3B4 + mov r0, sp + bl sub_8042A64 + ldr r0, _0805C3B0 + ldr r2, [r0] + mov r0, r8 + adds r1, r7, 0 + bl sub_80522F4 + b _0805C3C0 + .align 2, 0 +_0805C3A0: .4byte gUnknown_80F4448 +_0805C3A4: .4byte 0xffff0000 +_0805C3A8: .4byte 0x0000ffff +_0805C3AC: .4byte 0x0000fffc +_0805C3B0: .4byte gUnknown_80FD0B4 +_0805C3B4: + ldr r0, _0805C3D8 + ldr r2, [r0] + mov r0, r8 + adds r1, r7, 0 + bl sub_80522F4 +_0805C3C0: + bl sub_8040A84 + bl sub_8049ED4 + mov r0, r9 +_0805C3CA: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805C3D8: .4byte gUnknown_80FD0B8 + thumb_func_end sub_805C2AC + + thumb_func_start sub_805C3DC +sub_805C3DC: + push {lr} + ldr r0, [r1, 0x70] + ldrb r0, [r0, 0x6] + movs r2, 0x1 + cmp r0, 0 + beq _0805C3EA + movs r2, 0x2 +_0805C3EA: + adds r0, r1, 0x4 + movs r1, 0x14 + bl sub_807FC3C + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805C3DC + + thumb_func_start sub_805C3F8 +sub_805C3F8: + push {r4,r5,lr} + sub sp, 0x8 + adds r5, r0, 0 + adds r4, r1, 0 + ldr r0, [r4, 0x4] + str r0, [sp, 0x4] + ldr r0, [r4, 0x70] + adds r0, 0xA4 + ldrb r1, [r0] + cmp r1, 0 + bne _0805C442 + adds r0, r4, 0 + adds r0, 0x20 + strb r1, [r0] + movs r0, 0 + bl sub_803D73C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, sp + movs r2, 0 + bl sub_8045C28 + add r1, sp, 0x4 + adds r0, r5, 0 + mov r2, sp + bl sub_80464C8 + movs r1, 0x86 + lsls r1, 2 + adds r0, r4, 0 + adds r2, r5, 0 + bl sub_8068FE0 + movs r0, 0x1 + b _0805C450 +_0805C442: + ldr r0, _0805C458 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 + movs r0, 0 +_0805C450: + add sp, 0x8 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0805C458: .4byte gUnknown_80FF678 + thumb_func_end sub_805C3F8 + + thumb_func_start sub_805C45C +sub_805C45C: + push {lr} + bl sub_807F43C + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805C45C + + thumb_func_start sub_805C468 +sub_805C468: + push {lr} + bl sub_8078F50 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805C468 + + thumb_func_start sub_805C474 +sub_805C474: + push {lr} + bl sub_8077E4C + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805C474 + + thumb_func_start sub_805C480 +sub_805C480: + push {lr} + bl sub_8079570 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805C480 + + thumb_func_start sub_805C48C +sub_805C48C: + push {lr} + bl sub_80795C4 + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_805C48C + + thumb_func_start sub_805C498 +sub_805C498: + push {r4-r6,lr} + adds r5, r0, 0 + ldr r2, [r5, 0x70] + ldrh r0, [r1, 0x2] + subs r1, r0, 0x7 + ldr r0, _0805C4B8 + cmp r1, r0 + bls _0805C4AC + bl _0805CEA8 +_0805C4AC: + lsls r0, r1, 2 + ldr r1, _0805C4BC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0805C4B8: .4byte 0x0000018f +_0805C4BC: .4byte _0805C4C0 + .align 2, 0 +_0805C4C0: + .4byte _0805CDE8 + .4byte _0805CCE4 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CC70 + .4byte _0805CEA8 + .4byte _0805CB00 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CB0C + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CB12 + .4byte _0805CEA8 + .4byte _0805CB18 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CDE8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CD48 + .4byte _0805CEA8 + .4byte _0805CB12 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CB1E + .4byte _0805CD8A + .4byte _0805CEA8 + .4byte _0805CB40 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CB46 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CB40 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CCA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CB4C + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CB56 + .4byte _0805CB5C + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CD50 + .4byte _0805CEA8 + .4byte _0805CB62 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CB72 + .4byte _0805CEA8 + .4byte _0805CB80 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CC94 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CC7C + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CD90 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CCD8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CD64 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CB94 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CD96 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CDF4 + .4byte _0805CE00 + .4byte _0805CB40 + .4byte _0805CDE8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CB1E + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CB40 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CD20 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CDD2 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CC88 + .4byte _0805CEA8 + .4byte _0805CD9C + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CCC2 + .4byte _0805CB9A + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CBBA + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CBD0 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CBDA + .4byte _0805CB24 + .4byte _0805CB40 + .4byte _0805CB8E + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CBE0 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CDE8 + .4byte _0805CDE8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CDB0 + .4byte _0805CEA8 + .4byte _0805CDE8 + .4byte _0805CEA8 + .4byte _0805CBF0 + .4byte _0805CEA8 + .4byte _0805CC18 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CDBC + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CC54 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CC62 + .4byte _0805CB40 + .4byte _0805CEA8 + .4byte _0805CD50 + .4byte _0805CC62 + .4byte _0805CEA8 + .4byte _0805CD34 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CC1E + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CC24 + .4byte _0805CBDA + .4byte _0805CEA8 + .4byte _0805CDCA + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CB1E + .4byte _0805CDDC + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CC32 + .4byte _0805CEA8 + .4byte _0805CB46 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CC38 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CB56 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CCB6 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CDE8 + .4byte _0805CDE8 + .4byte _0805CDE8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CDE8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CD74 + .4byte _0805CEA8 + .4byte _0805CD50 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CD06 + .4byte _0805CEA8 + .4byte _0805CC9A + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CEA8 + .4byte _0805CDE8 +_0805CB00: + adds r0, r5, 0 + bl sub_807E580 + lsls r0, 24 + lsrs r0, 24 + b _0805CC5A +_0805CB0C: + adds r0, r2, 0 + adds r0, 0xC0 + b _0805CDF8 +_0805CB12: + adds r0, r2, 0 + adds r0, 0xC4 + b _0805CCAC +_0805CB18: + adds r0, r2, 0 + adds r0, 0xC4 + b _0805CB76 +_0805CB1E: + movs r1, 0x1C + ldrsh r0, [r2, r1] + b _0805CDD6 +_0805CB24: + movs r3, 0x1C + ldrsh r0, [r2, r3] + cmp r0, 0x13 + bgt _0805CB6E + movs r1, 0x9E + lsls r1, 1 + adds r0, r2, r1 + ldr r0, [r0] + bl sub_8094450 + cmp r0, 0 + ble _0805CB3E + b _0805CEA8 +_0805CB3E: + b _0805CB6E +_0805CB40: + movs r3, 0x20 + ldrsh r0, [r2, r3] + b _0805CDD6 +_0805CB46: + adds r0, r2, 0 + adds r0, 0xC0 + b _0805CC9E +_0805CB4C: + ldr r0, [r5, 0x70] + movs r2, 0x82 + lsls r2, 1 + adds r0, r2 + b _0805CC4A +_0805CB56: + adds r0, r2, 0 + adds r0, 0xDC + b _0805CC9E +_0805CB5C: + movs r3, 0x20 + ldrsh r0, [r2, r3] + b _0805CDCE +_0805CB62: + adds r0, r2, 0 + adds r0, 0xC4 + ldrb r0, [r0] + cmp r0, 0x9 + beq _0805CB6E + b _0805CEA8 +_0805CB6E: + movs r0, 0 + b _0805CEAA +_0805CB72: + adds r0, r2, 0 + adds r0, 0xC0 +_0805CB76: + ldrb r0, [r0] + cmp r0, 0xB + beq _0805CB7E + b _0805CEA8 +_0805CB7E: + b _0805CB6E +_0805CB80: + adds r0, r2, 0 + adds r0, 0xC4 + ldrb r0, [r0] + cmp r0, 0xE + beq _0805CB8C + b _0805CEA8 +_0805CB8C: + b _0805CB6E +_0805CB8E: + adds r0, r2, 0 + adds r0, 0xC4 + b _0805CDE0 +_0805CB94: + movs r3, 0x26 + ldrsh r0, [r2, r3] + b _0805CDD6 +_0805CB9A: + adds r0, r2, 0 + adds r0, 0xB0 + ldrb r0, [r0] + cmp r0, 0x5 + beq _0805CB6E + movs r1, 0x10 + ldrsh r0, [r2, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + movs r3, 0xE + ldrsh r1, [r2, r3] + cmp r0, r1 + blt _0805CBB8 + b _0805CEA8 +_0805CBB8: + b _0805CB6E +_0805CBBA: + movs r0, 0x10 + ldrsh r1, [r2, r0] + movs r3, 0xE + ldrsh r0, [r2, r3] + cmp r1, r0 + ble _0805CB6E + movs r1, 0x89 + lsls r1, 1 + adds r0, r2, r1 + ldrb r0, [r0] + b _0805CDC4 +_0805CBD0: + movs r3, 0x89 + lsls r3, 1 + adds r0, r2, r3 + ldrb r0, [r0] + b _0805CDC4 +_0805CBDA: + adds r0, r2, 0 + adds r0, 0xDC + b _0805CDE0 +_0805CBE0: + movs r1, 0x1C + ldrsh r0, [r2, r1] + cmp r0, 0x13 + bgt _0805CBEA + b _0805CEA8 +_0805CBEA: + movs r3, 0x20 + ldrsh r0, [r2, r3] + b _0805CDD6 +_0805CBF0: + ldr r1, _0805CC0C + ldr r0, _0805CC10 + ldr r0, [r0] + ldr r2, _0805CC14 + adds r0, r2 + movs r3, 0 + ldrsh r0, [r0, r3] + adds r0, r1 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_8071858 + b _0805CDEC + .align 2, 0 +_0805CC0C: .4byte gUnknown_80F561C +_0805CC10: .4byte gUnknown_203B418 +_0805CC14: .4byte 0x00003a0e +_0805CC18: + movs r1, 0x1E + ldrsh r0, [r2, r1] + b _0805CDD6 +_0805CC1E: + adds r0, r2, 0 + adds r0, 0xD0 + b _0805CDB4 +_0805CC24: + adds r0, r2, 0 + adds r0, 0xC4 + ldrb r0, [r0] + cmp r0, 0x8 + beq _0805CC30 + b _0805CEA8 +_0805CC30: + b _0805CB6E +_0805CC32: + adds r0, r2, 0 + adds r0, 0xC4 + b _0805CC9E +_0805CC38: + movs r3, 0x1C + ldrsh r0, [r2, r3] + cmp r0, 0x13 + bgt _0805CC42 + b _0805CEA8 +_0805CC42: + ldr r0, [r5, 0x70] + movs r1, 0x82 + lsls r1, 1 + adds r0, r1 +_0805CC4A: + ldr r0, [r0] + cmp r0, 0x3 + bgt _0805CC52 + b _0805CEA8 +_0805CC52: + b _0805CB6E +_0805CC54: + adds r0, r2, 0 + adds r0, 0xC4 + ldrb r0, [r0] +_0805CC5A: + cmp r0, 0x5 + beq _0805CC60 + b _0805CEA8 +_0805CC60: + b _0805CB6E +_0805CC62: + adds r0, r2, 0 + adds r0, 0xC4 + ldrb r0, [r0] + cmp r0, 0x7 + beq _0805CC6E + b _0805CEA8 +_0805CC6E: + b _0805CB6E +_0805CC70: + adds r0, r5, 0 + bl sub_807E580 + lsls r0, 24 + lsrs r0, 24 + b _0805CCAE +_0805CC7C: + adds r0, r5, 0 + bl sub_807E580 + lsls r0, 24 + lsrs r0, 24 + b _0805CDB6 +_0805CC88: + adds r0, r5, 0 + bl sub_807E580 + lsls r0, 24 + lsrs r0, 24 + b _0805CCA0 +_0805CC94: + adds r0, r2, 0 + adds r0, 0xC4 + b _0805CDB4 +_0805CC9A: + adds r0, r2, 0 + adds r0, 0xE4 +_0805CC9E: + ldrb r0, [r0] +_0805CCA0: + cmp r0, 0x1 + beq _0805CCA6 + b _0805CEA8 +_0805CCA6: + b _0805CB6E +_0805CCA8: + adds r0, r2, 0 + adds r0, 0xDC +_0805CCAC: + ldrb r0, [r0] +_0805CCAE: + cmp r0, 0x4 + beq _0805CCB4 + b _0805CEA8 +_0805CCB4: + b _0805CB6E +_0805CCB6: + adds r0, r2, 0 + adds r0, 0x60 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + b _0805CDEE +_0805CCC2: + adds r0, r5, 0 + bl sub_8070B48 + lsls r0, 24 + cmp r0, 0 + beq _0805CCD0 + b _0805CEA8 +_0805CCD0: + adds r0, r5, 0 + bl sub_8070A58 + b _0805CDC2 +_0805CCD8: + adds r0, r5, 0 + bl sub_8045128 + bl sub_804AF20 + b _0805CDEC +_0805CCE4: + adds r0, r5, 0 + bl sub_8045128 + adds r4, r0, 0 + bl sub_804AF20 + lsls r0, 24 + cmp r0, 0 + bne _0805CCF8 + b _0805CB6E +_0805CCF8: + ldrh r1, [r4] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + bne _0805CD04 + b _0805CEA8 +_0805CD04: + b _0805CB6E +_0805CD06: + adds r0, r5, 0 + bl sub_8045128 + ldr r0, [r0, 0x14] + cmp r0, 0 + bne _0805CD14 + b _0805CB6E +_0805CD14: + bl sub_80450F8 + cmp r0, 0x2 + bne _0805CD1E + b _0805CEA8 +_0805CD1E: + b _0805CB6E +_0805CD20: + ldr r0, _0805CD2C + ldr r0, [r0] + ldr r2, _0805CD30 + adds r0, r2 + ldrb r0, [r0] + b _0805CDEE + .align 2, 0 +_0805CD2C: .4byte gUnknown_203B418 +_0805CD30: .4byte 0x0000e277 +_0805CD34: + ldr r0, _0805CD40 + ldr r0, [r0] + ldr r3, _0805CD44 + adds r0, r3 + ldrb r0, [r0] + b _0805CDEE + .align 2, 0 +_0805CD40: .4byte gUnknown_203B418 +_0805CD44: .4byte 0x0000e278 +_0805CD48: + adds r0, r2, 0 + adds r0, 0xF4 + ldrb r0, [r0] + b _0805CDEE +_0805CD50: + ldr r0, _0805CD5C + ldr r0, [r0] + ldr r1, _0805CD60 + adds r0, r1 + ldrb r0, [r0] + b _0805CDEE + .align 2, 0 +_0805CD5C: .4byte gUnknown_203B418 +_0805CD60: .4byte 0x000037fc +_0805CD64: + movs r3, 0x89 + lsls r3, 1 + adds r0, r2, r3 + ldrb r0, [r0] + cmp r0, 0x2 + bhi _0805CD72 + b _0805CEA8 +_0805CD72: + b _0805CB6E +_0805CD74: + adds r0, r2, 0 + adds r0, 0x60 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0805CD84 + b _0805CEA8 +_0805CD84: + movs r0, 0x8 + ands r0, r1 + b _0805CDC4 +_0805CD8A: + movs r1, 0x26 + ldrsh r0, [r2, r1] + b _0805CDD6 +_0805CD90: + movs r3, 0x1E + ldrsh r0, [r2, r3] + b _0805CDD6 +_0805CD96: + movs r1, 0x1C + ldrsh r0, [r2, r1] + b _0805CDD6 +_0805CD9C: + ldrb r0, [r2, 0x6] + cmp r0, 0 + beq _0805CDA4 + b _0805CB6E +_0805CDA4: + adds r0, r2, 0 + adds r0, 0xC4 + ldrb r0, [r0] + cmp r0, 0x6 + bne _0805CEA8 + b _0805CB6E +_0805CDB0: + adds r0, r2, 0 + adds r0, 0xE4 +_0805CDB4: + ldrb r0, [r0] +_0805CDB6: + cmp r0, 0x2 + bne _0805CEA8 + b _0805CB6E +_0805CDBC: + adds r0, r5, 0x4 + bl sub_807FC80 +_0805CDC2: + lsls r0, 24 +_0805CDC4: + cmp r0, 0 + bne _0805CEA8 + b _0805CB6E +_0805CDCA: + movs r3, 0x1E + ldrsh r0, [r2, r3] +_0805CDCE: + cmp r0, 0x13 + ble _0805CEA8 +_0805CDD2: + movs r1, 0x22 + ldrsh r0, [r2, r1] +_0805CDD6: + cmp r0, 0x13 + ble _0805CEA8 + b _0805CB6E +_0805CDDC: + adds r0, r2, 0 + adds r0, 0xC8 +_0805CDE0: + ldrb r0, [r0] + cmp r0, 0x3 + bne _0805CEA8 + b _0805CB6E +_0805CDE8: + bl sub_80441BC +_0805CDEC: + lsls r0, 24 +_0805CDEE: + cmp r0, 0 + beq _0805CEA8 + b _0805CB6E +_0805CDF4: + adds r0, r2, 0 + adds r0, 0xC4 +_0805CDF8: + ldrb r0, [r0] + cmp r0, 0xC + bne _0805CEA8 + b _0805CB6E +_0805CE00: + ldrb r0, [r2, 0x6] + cmp r0, 0 + beq _0805CE5C + movs r6, 0 +_0805CE08: + ldr r0, _0805CE54 + ldr r0, [r0] + lsls r1, r6, 2 + ldr r2, _0805CE58 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0805CE46 + cmp r4, r5 + beq _0805CE46 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8045990 + lsls r0, 24 + cmp r0, 0 + beq _0805CE46 + ldr r1, [r4, 0x70] + movs r3, 0x1C + ldrsh r0, [r1, r3] + cmp r0, 0x13 + bgt _0805CE46 + movs r2, 0x1E + ldrsh r0, [r1, r2] + cmp r0, 0x13 + ble _0805CE4C +_0805CE46: + adds r6, 0x1 + cmp r6, 0xF + ble _0805CE08 +_0805CE4C: + cmp r6, 0x10 + bne _0805CEA8 + b _0805CB6E + .align 2, 0 +_0805CE54: .4byte gUnknown_203B418 +_0805CE58: .4byte 0x0001358c +_0805CE5C: + movs r6, 0 +_0805CE5E: + ldr r0, _0805CEB0 + ldr r0, [r0] + lsls r1, r6, 2 + ldr r3, _0805CEB4 + adds r0, r3 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0805CE9C + cmp r4, r5 + beq _0805CE9C + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8045990 + lsls r0, 24 + cmp r0, 0 + beq _0805CE9C + ldr r1, [r4, 0x70] + movs r2, 0x1C + ldrsh r0, [r1, r2] + cmp r0, 0x13 + bgt _0805CE9C + movs r3, 0x1E + ldrsh r0, [r1, r3] + cmp r0, 0x13 + ble _0805CEA2 +_0805CE9C: + adds r6, 0x1 + cmp r6, 0x3 + ble _0805CE5E +_0805CEA2: + cmp r6, 0x4 + bne _0805CEA8 + b _0805CB6E +_0805CEA8: + movs r0, 0x1 +_0805CEAA: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0805CEB0: .4byte gUnknown_203B418 +_0805CEB4: .4byte 0x0001357c + thumb_func_end sub_805C498 + + thumb_func_start sub_805CEB8 +sub_805CEB8: + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r0 + adds r6, r1, 0 + adds r7, r2, 0 + ldr r5, [r0, 0x70] + ldr r4, [r6, 0x70] + adds r0, r4, 0 + adds r0, 0xB0 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0805CEE0 + adds r0, r7, 0 + bl sub_8092C3C + lsls r0, 24 + cmp r0, 0 + beq _0805CEE0 + b _0805D540 +_0805CEE0: + ldrh r0, [r7, 0x2] + subs r2, r0, 0x3 + ldr r0, _0805CEF8 + cmp r2, r0 + bls _0805CEEE + bl _0805D802 +_0805CEEE: + lsls r0, r2, 2 + ldr r1, _0805CEFC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0805CEF8: .4byte 0x0000017b +_0805CEFC: .4byte _0805CF00 + .align 2, 0 +_0805CF00: + .4byte _0805D4FA + .4byte _0805D4F0 + .4byte _0805D50E + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D516 + .4byte _0805D51C + .4byte _0805D802 + .4byte _0805D7F6 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D520 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D52C + .4byte _0805D532 + .4byte _0805D544 + .4byte _0805D55A + .4byte _0805D7F6 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D566 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D56A + .4byte _0805D4F0 + .4byte _0805D570 + .4byte _0805D802 + .4byte _0805D57E + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D584 + .4byte _0805D802 + .4byte _0805D7F6 + .4byte _0805D802 + .4byte _0805D596 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D59C + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D5C8 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D5D0 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D4F0 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D5E2 + .4byte _0805D4F0 + .4byte _0805D5E8 + .4byte _0805D5F8 + .4byte _0805D802 + .4byte _0805D5FE + .4byte _0805D5F8 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D55A + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D4F0 + .4byte _0805D662 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D668 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D5DC + .4byte _0805D802 + .4byte _0805D5C8 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D7AC + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D704 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D704 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D7F6 + .4byte _0805D70A + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D7F6 + .4byte _0805D5C8 + .4byte _0805D802 + .4byte _0805D5F8 + .4byte _0805D802 + .4byte _0805D7E4 + .4byte _0805D7DC + .4byte _0805D802 + .4byte _0805D7E4 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D716 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D740 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D74A + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D5DC + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D4F0 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D75C + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D734 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D782 + .4byte _0805D740 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D704 + .4byte _0805D7F6 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D5C8 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D7A0 + .4byte _0805D7CA + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D78A + .4byte _0805D59C + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D7BE + .4byte _0805D7AC + .4byte _0805D802 + .4byte _0805D794 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D55A + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D782 + .4byte _0805D802 + .4byte _0805D802 + .4byte _0805D7F6 +_0805D4F0: + adds r0, r6, 0 + bl sub_8070B28 + lsls r0, 24 + b _0805D7A6 +_0805D4FA: + adds r0, r4, 0 + adds r0, 0xA8 + ldrb r0, [r0] + cmp r0, 0x4 + beq _0805D540 + adds r0, r6, 0 + bl sub_8070B28 + lsls r0, 24 + b _0805D7A6 +_0805D50E: + adds r0, r4, 0 + adds r0, 0xA8 + ldrb r0, [r0] + b _0805D7F0 +_0805D516: + movs r1, 0x26 + ldrsh r0, [r4, r1] + b _0805D744 +_0805D51C: + ldr r0, [r4, 0x2C] + b _0805D58E +_0805D520: + adds r0, r4, 0 + adds r0, 0xBC + ldrb r0, [r0] + cmp r0, 0x6 + beq _0805D540 + b _0805D7AC +_0805D52C: + movs r3, 0xE + ldrsh r0, [r4, r3] + b _0805D78E +_0805D532: + movs r7, 0xE + ldrsh r1, [r4, r7] + movs r2, 0xE + ldrsh r0, [r5, r2] + cmp r1, r0 + ble _0805D540 + b _0805D802 +_0805D540: + movs r0, 0 + b _0805D804 +_0805D544: + movs r3, 0x8C + lsls r3, 1 + adds r4, r3 + adds r0, r4, 0 + bl sub_805D810 + lsls r0, 24 + cmp r0, 0 + bne _0805D540 + adds r0, r4, 0 + b _0805D7B2 +_0805D55A: + ldr r0, [r6, 0x70] + movs r7, 0x82 + lsls r7, 1 + adds r0, r7 + ldr r0, [r0] + b _0805D744 +_0805D566: + ldr r0, [r4, 0x34] + b _0805D58E +_0805D56A: + movs r1, 0x22 + ldrsh r0, [r4, r1] + b _0805D744 +_0805D570: + movs r2, 0x8C + lsls r2, 1 + adds r0, r4, r2 + bl sub_805D850 + lsls r0, 24 + b _0805D7A6 +_0805D57E: + adds r0, r4, 0 + adds r0, 0xDC + b _0805D7FA +_0805D584: + ldr r0, [r4, 0x2C] + cmp r0, 0x3E + ble _0805D58C + b _0805D802 +_0805D58C: + ldr r0, [r4, 0x30] +_0805D58E: + cmp r0, 0x3E + ble _0805D594 + b _0805D802 +_0805D594: + b _0805D540 +_0805D596: + adds r0, r4, 0 + adds r0, 0xAC + b _0805D798 +_0805D59C: + adds r0, r4, 0 + adds r0, 0x5C + ldrb r0, [r0] + cmp r0, 0xE + beq _0805D5B0 + adds r0, r4, 0 + adds r0, 0x5D + ldrb r0, [r0] + cmp r0, 0xE + bne _0805D5BC +_0805D5B0: + adds r0, r4, 0 + adds r0, 0xF5 + ldrb r0, [r0] + cmp r0, 0 + bne _0805D5BC + b _0805D802 +_0805D5BC: + movs r3, 0x26 + ldrsh r0, [r4, r3] + cmp r0, 0xA + ble _0805D5C6 + b _0805D802 +_0805D5C6: + b _0805D540 +_0805D5C8: + adds r0, r4, 0 + adds r0, 0xAC + ldrb r0, [r0] + b _0805D7D6 +_0805D5D0: + movs r7, 0xE + ldrsh r0, [r4, r7] + movs r2, 0xE + ldrsh r1, [r5, r2] + subs r0, r1 + b _0805D744 +_0805D5DC: + movs r3, 0x20 + ldrsh r0, [r4, r3] + b _0805D744 +_0805D5E2: + movs r7, 0x22 + ldrsh r0, [r4, r7] + b _0805D744 +_0805D5E8: + movs r1, 0x1C + ldrsh r0, [r4, r1] + cmp r0, 0 + ble _0805D5F2 + b _0805D802 +_0805D5F2: + movs r2, 0x20 + ldrsh r0, [r4, r2] + b _0805D744 +_0805D5F8: + adds r0, r4, 0 + adds r0, 0xB0 + b _0805D7FA +_0805D5FE: + movs r6, 0 + adds r2, r4, 0 + adds r2, 0x1C + movs r3, 0x1C + ldrsh r0, [r4, r3] + cmp r0, 0x9 + ble _0805D6FC + adds r1, r4, 0 + adds r1, 0x20 + movs r7, 0x20 + ldrsh r0, [r4, r7] + cmp r0, 0x9 + ble _0805D6FC + adds r3, r1, 0 + movs r5, 0 +_0805D61C: + adds r0, r4, 0 + adds r0, 0x24 + adds r0, r5 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x9 + ble _0805D6FC + lsls r1, r6, 2 + adds r0, r4, 0 + adds r0, 0x2C + adds r0, r1 + ldr r0, [r0] + cmp r0, 0xFF + ble _0805D6FC + adds r0, r4, 0 + adds r0, 0x34 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0xFF + ble _0805D6FC + adds r3, 0x2 + adds r2, 0x2 + adds r5, 0x2 + adds r6, 0x1 + cmp r6, 0x1 + bgt _0805D6FC + movs r7, 0 + ldrsh r0, [r2, r7] + cmp r0, 0x9 + ble _0805D6FC + movs r1, 0 + ldrsh r0, [r3, r1] + cmp r0, 0x9 + bgt _0805D61C + b _0805D6FC +_0805D662: + adds r0, r4, 0 + adds r0, 0xA8 + b _0805D7FA +_0805D668: + movs r6, 0 + adds r3, r5, 0 + adds r3, 0x1C + adds r2, r4, 0 + adds r2, 0x1C + movs r7, 0x1C + ldrsh r1, [r5, r7] + movs r7, 0x1C + ldrsh r0, [r4, r7] + cmp r1, r0 + blt _0805D6FC + mov r12, r2 + mov r8, r3 + movs r3, 0 +_0805D684: + adds r1, r5, 0 + adds r1, 0x20 + adds r1, r3 + adds r0, r4, 0 + adds r0, 0x20 + adds r0, r3 + movs r2, 0 + ldrsh r1, [r1, r2] + movs r7, 0 + ldrsh r0, [r0, r7] + cmp r1, r0 + blt _0805D6FC + adds r1, r5, 0 + adds r1, 0x24 + adds r1, r3 + adds r0, r4, 0 + adds r0, 0x24 + adds r0, r3 + movs r2, 0 + ldrsh r1, [r1, r2] + movs r7, 0 + ldrsh r0, [r0, r7] + cmp r1, r0 + blt _0805D6FC + lsls r2, r6, 2 + adds r1, r5, 0 + adds r1, 0x2C + adds r1, r2 + adds r0, r4, 0 + adds r0, 0x2C + adds r0, r2 + ldr r1, [r1] + ldr r0, [r0] + cmp r1, r0 + blt _0805D6FC + adds r1, r5, 0 + adds r1, 0x34 + adds r1, r2 + adds r0, r4, 0 + adds r0, 0x34 + adds r0, r2 + ldr r1, [r1] + ldr r0, [r0] + cmp r1, r0 + blt _0805D6FC + movs r0, 0x2 + add r12, r0 + add r8, r0 + adds r3, 0x2 + adds r6, 0x1 + cmp r6, 0x1 + bgt _0805D6FC + mov r2, r8 + movs r7, 0 + ldrsh r1, [r2, r7] + mov r2, r12 + movs r7, 0 + ldrsh r0, [r2, r7] + cmp r1, r0 + bge _0805D684 +_0805D6FC: + cmp r6, 0x2 + beq _0805D702 + b _0805D802 +_0805D702: + b _0805D540 +_0805D704: + movs r1, 0x24 + ldrsh r0, [r4, r1] + b _0805D744 +_0805D70A: + adds r0, r4, 0 + adds r0, 0xBC + ldrb r0, [r0] + cmp r0, 0x5 + bne _0805D802 + b _0805D540 +_0805D716: + adds r0, r5, 0 + adds r0, 0x60 + ldrb r1, [r0] + movs r2, 0x1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _0805D728 + b _0805D540 +_0805D728: + adds r0, r4, 0 + adds r0, 0x60 + ldrb r1, [r0] + adds r0, r2, 0 + ands r0, r1 + b _0805D7B8 +_0805D734: + adds r0, r4, 0 + adds r0, 0x60 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + b _0805D7B8 +_0805D740: + movs r2, 0x1C + ldrsh r0, [r4, r2] +_0805D744: + cmp r0, 0 + bgt _0805D802 + b _0805D540 +_0805D74A: + adds r0, r5, 0 + adds r0, 0x5E + adds r1, r4, 0 + adds r1, 0x5E + ldrh r0, [r0] + ldrh r1, [r1] + cmp r0, r1 + bne _0805D802 + b _0805D540 +_0805D75C: + mov r0, r8 + movs r1, 0xE + bl sub_8071858 + lsls r0, 24 + cmp r0, 0 + beq _0805D770 + adds r0, r4, 0 + adds r0, 0xC8 + b _0805D798 +_0805D770: + movs r3, 0x1C + ldrsh r0, [r5, r3] + cmp r0, 0x13 + ble _0805D802 + movs r7, 0x20 + ldrsh r0, [r5, r7] + cmp r0, 0x13 + ble _0805D802 + b _0805D540 +_0805D782: + adds r0, r4, 0 + adds r0, 0xBC + ldrb r0, [r0] + b _0805D7F0 +_0805D78A: + movs r1, 0xE + ldrsh r0, [r4, r1] +_0805D78E: + cmp r0, 0x1 + bgt _0805D802 + b _0805D540 +_0805D794: + adds r0, r4, 0 + adds r0, 0xD0 +_0805D798: + ldrb r0, [r0] + cmp r0, 0x1 + bne _0805D802 + b _0805D540 +_0805D7A0: + adds r0, r4, 0 + adds r0, 0xFD + ldrb r0, [r0] +_0805D7A6: + cmp r0, 0 + beq _0805D802 + b _0805D540 +_0805D7AC: + movs r2, 0x8C + lsls r2, 1 + adds r0, r4, r2 +_0805D7B2: + bl sub_805D888 + lsls r0, 24 +_0805D7B8: + cmp r0, 0 + bne _0805D802 + b _0805D540 +_0805D7BE: + adds r0, r4, 0 + adds r0, 0xBC + ldrb r0, [r0] + cmp r0, 0x7 + bne _0805D802 + b _0805D540 +_0805D7CA: + adds r0, r4, 0 + adds r0, 0xB0 + ldrb r0, [r0] + cmp r0, 0x3 + bne _0805D7D6 + b _0805D540 +_0805D7D6: + cmp r0, 0x4 + bne _0805D802 + b _0805D540 +_0805D7DC: + adds r0, r4, 0 + adds r0, 0xAC + ldrb r0, [r0] + b _0805D7F0 +_0805D7E4: + adds r0, r4, 0 + adds r0, 0xAC + ldrb r0, [r0] + cmp r0, 0x2 + bne _0805D7F0 + b _0805D540 +_0805D7F0: + cmp r0, 0x3 + bne _0805D802 + b _0805D540 +_0805D7F6: + adds r0, r4, 0 + adds r0, 0xBC +_0805D7FA: + ldrb r0, [r0] + cmp r0, 0x2 + bne _0805D802 + b _0805D540 +_0805D802: + movs r0, 0x1 +_0805D804: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_805CEB8 + + thumb_func_start sub_805D810 +sub_805D810: + push {r4-r6,lr} + adds r4, r0, 0 + movs r3, 0 + movs r6, 0x1 + movs r5, 0x20 + adds r2, r4, 0 +_0805D81C: + ldrb r1, [r2] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _0805D82E + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _0805D848 +_0805D82E: + adds r2, 0x8 + adds r3, 0x1 + cmp r3, 0x3 + ble _0805D81C + adds r0, r4, 0 + adds r0, 0x20 + ldrb r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _0805D848 + movs r0, 0 + b _0805D84A +_0805D848: + movs r0, 0x1 +_0805D84A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_805D810 + + thumb_func_start sub_805D850 +sub_805D850: + push {r4,r5,lr} + movs r3, 0 + movs r5, 0x1 + adds r2, r0, 0 + movs r4, 0x10 +_0805D85A: + ldrb r1, [r2] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _0805D876 + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _0805D876 + ldrb r0, [r2, 0x4] + cmp r0, 0 + bne _0805D876 + movs r0, 0x1 + b _0805D880 +_0805D876: + adds r2, 0x8 + adds r3, 0x1 + cmp r3, 0x3 + ble _0805D85A + movs r0, 0 +_0805D880: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_805D850 + + thumb_func_start sub_805D888 +sub_805D888: + push {r4-r6,lr} + adds r4, r0, 0 + movs r3, 0 + movs r6, 0x1 + movs r5, 0x10 + adds r2, r4, 0 +_0805D894: + ldrb r1, [r2] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _0805D8A6 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _0805D8C0 +_0805D8A6: + adds r2, 0x8 + adds r3, 0x1 + cmp r3, 0x3 + ble _0805D894 + adds r0, r4, 0 + adds r0, 0x20 + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _0805D8C0 + movs r0, 0 + b _0805D8C2 +_0805D8C0: + movs r0, 0x1 +_0805D8C2: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_805D888 + + thumb_func_start sub_805D8C8 +sub_805D8C8: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + ldr r4, _0805D90C + ldr r1, [r4] + ldr r0, _0805D910 + adds r0, r1, r0 + str r0, [sp, 0x10] + movs r2, 0x3 + str r2, [sp, 0xC] + movs r5, 0 + movs r0, 0 + strh r0, [r1, 0x12] + bl sub_8083600 + movs r1, 0x1 + bl sub_806A2BC + bl sub_8083600 + bl sub_80701A4 + lsls r0, 24 + cmp r0, 0 + beq _0805D928 + movs r0, 0x3C + movs r1, 0x10 + bl sub_803E708 + bl _0805E2B0 + .align 2, 0 +_0805D90C: .4byte gUnknown_203B418 +_0805D910: .4byte 0x000181e8 +_0805D914: + mov r1, r8 + adds r1, 0x44 + movs r2, 0 + movs r0, 0x2 + strh r0, [r1] + mov r0, r8 + adds r0, 0x48 + strb r2, [r0] + bl _0805E2B0 +_0805D928: + ldr r0, [r4] + ldr r3, _0805D9D4 + adds r0, r3 + strb r5, [r0] + bl sub_8040A78 + ldr r1, [r4] + ldrb r0, [r1, 0x1] + cmp r0, 0 + beq _0805D976 + strb r5, [r1, 0x1] + bl sub_8083600 + movs r1, 0x1 + bl sub_8071518 + lsls r0, 24 + cmp r0, 0 + bne _0805D976 + movs r0, 0x1 + bl sub_8044C10 + bl sub_805E804 + bl sub_8083600 + bl sub_80647F0 + bl sub_80048D0 + bl sub_8004914 + bl sub_805F1AC + lsls r0, 16 + cmp r0, 0 + beq _0805D976 + bl _0805E2B0 +_0805D976: + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x1 + bl sub_806A914 +_0805D980: + bl sub_8083600 + mov r10, r0 + ldr r5, [r0, 0x70] + mov r8, r5 + movs r1, 0x2 + ldrsh r0, [r5, r1] + bl sub_80978C8 + ldr r2, _0805D9D8 + ldr r0, [r2] + ldr r3, _0805D9DC + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0 + beq _0805D9AE + bl sub_805E874 + lsls r0, 24 + cmp r0, 0 + bne _0805D914 + bl sub_805E804 +_0805D9AE: + ldr r0, _0805D9E0 + movs r1, 0 + strb r1, [r0] + ldr r0, _0805D9E4 + strb r1, [r0] + ldr r5, _0805D9D8 + ldr r0, [r5] + movs r1, 0xB8 + lsls r1, 3 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + bge _0805D9CA + b _0805DAE8 +_0805D9CA: + ldr r0, _0805D9E8 + ands r6, r0 + movs r2, 0x1 + orrs r6, r2 + b _0805DAEC + .align 2, 0 +_0805D9D4: .4byte 0x00000673 +_0805D9D8: .4byte gUnknown_203B418 +_0805D9DC: .4byte 0x0000066c +_0805D9E0: .4byte gUnknown_202F22D +_0805D9E4: .4byte gUnknown_202F22C +_0805D9E8: .4byte 0xffffff00 +_0805D9EC: + movs r0, 0x1 + bl sub_8044C50 + ldr r3, _0805DA00 + ldr r0, [r3] + ldr r5, _0805DA04 + adds r0, r5 + strb r4, [r0] + b _0805E1AE + .align 2, 0 +_0805DA00: .4byte gUnknown_203B418 +_0805DA04: .4byte 0x00000673 +_0805DA08: + ldr r0, _0805DA14 + ldr r1, [r0] + mov r0, r10 + bl sub_80522A8 + b _0805DBDA + .align 2, 0 +_0805DA14: .4byte gUnknown_80FD4B0 +_0805DA18: + ldr r0, _0805DA1C + b _0805DCBC + .align 2, 0 +_0805DA1C: .4byte gUnknown_80F8A28 +_0805DA20: + ldr r0, [sp, 0x1C] + movs r1, 0x17 + bl sub_8044C94 + b _0805E1AE +_0805DA2A: + ldr r0, _0805DA38 + ands r6, r0 + movs r3, 0x1 + orrs r6, r3 + ldr r0, _0805DA3C + ands r6, r0 + b _0805DAD6 + .align 2, 0 +_0805DA38: .4byte 0xffffff00 +_0805DA3C: .4byte 0xffff00ff +_0805DA40: + ldr r5, _0805DA58 + ldr r0, [r5] + movs r2, 0xB8 + lsls r2, 3 + adds r0, r2 + str r1, [r0] + ldr r0, _0805DA5C + ands r6, r0 + movs r3, 0x1 + orrs r6, r3 + b _0805DAA8 + .align 2, 0 +_0805DA58: .4byte gUnknown_203B418 +_0805DA5C: .4byte 0xffffff00 +_0805DA60: + ldr r5, _0805DA78 + ldr r0, [r5] + movs r1, 0xB8 + lsls r1, 3 + adds r0, r1 + movs r2, 0x1 + str r2, [r0] + ldr r0, _0805DA7C + ands r6, r0 + orrs r6, r2 + b _0805DAA8 + .align 2, 0 +_0805DA78: .4byte gUnknown_203B418 +_0805DA7C: .4byte 0xffffff00 +_0805DA80: + ldr r3, _0805DA98 + ldr r0, [r3] + movs r5, 0xB8 + lsls r5, 3 + adds r0, r5 + str r2, [r0] + ldr r0, _0805DA9C + ands r6, r0 + movs r0, 0x1 + orrs r6, r0 + b _0805DAA8 + .align 2, 0 +_0805DA98: .4byte gUnknown_203B418 +_0805DA9C: .4byte 0xffffff00 +_0805DAA0: + ldr r0, _0805DAB8 + ands r6, r0 + movs r1, 0x1 + orrs r6, r1 +_0805DAA8: + ldr r0, _0805DABC + ands r6, r0 + ldr r0, _0805DAC0 + ands r6, r0 + movs r0, 0x80 + lsls r0, 9 + orrs r6, r0 + b _0805E1AE + .align 2, 0 +_0805DAB8: .4byte 0xffffff00 +_0805DABC: .4byte 0xffff00ff +_0805DAC0: .4byte 0xff00ffff +_0805DAC4: + ldr r0, _0805DADC + ands r6, r0 + movs r2, 0x1 + orrs r6, r2 + ldr r0, _0805DAE0 + ands r6, r0 + movs r0, 0x80 + lsls r0, 1 + orrs r6, r0 +_0805DAD6: + ldr r0, _0805DAE4 + ands r6, r0 + b _0805E1AE + .align 2, 0 +_0805DADC: .4byte 0xffffff00 +_0805DAE0: .4byte 0xffff00ff +_0805DAE4: .4byte 0xff00ffff +_0805DAE8: + ldr r0, _0805DB3C + ands r6, r0 +_0805DAEC: + ldr r0, _0805DB40 + ands r6, r0 + ldr r0, _0805DB44 + ands r6, r0 + movs r3, 0 + str r3, [sp, 0x8] + movs r0, 0 + bl sub_8044C50 + ldr r0, _0805DB48 + mov r5, sp + ldrb r5, [r5, 0x8] + strb r5, [r0] + ldr r0, _0805DB4C + mov r1, sp + ldrb r1, [r1, 0x8] + strb r1, [r0] + lsls r0, r6, 24 + mov r2, r8 + adds r2, 0x44 + str r2, [sp, 0x1C] + str r0, [sp, 0x14] + ldr r3, [sp, 0x10] + adds r3, 0x32 + str r3, [sp, 0x18] + cmp r0, 0 + beq _0805DB24 + b _0805E1AE +_0805DB24: + ldr r0, _0805DB50 + ldrh r1, [r0] + adds r1, 0x1 + strh r1, [r0] + ldr r5, [sp, 0x18] + ldrb r0, [r5] + cmp r0, 0 + beq _0805DB54 + movs r0, 0 + str r0, [sp, 0x8] + b _0805DB5A + .align 2, 0 +_0805DB3C: .4byte 0xffffff00 +_0805DB40: .4byte 0xffff00ff +_0805DB44: .4byte 0xff00ffff +_0805DB48: .4byte gUnknown_202F230 +_0805DB4C: .4byte gUnknown_202F231 +_0805DB50: .4byte gUnknown_202F22E +_0805DB54: + ldr r1, [sp, 0x8] + adds r1, 0x1 + str r1, [sp, 0x8] +_0805DB5A: + ldr r2, [sp, 0xC] + cmp r2, 0 + beq _0805DB6E + subs r2, 0x1 + str r2, [sp, 0xC] + cmp r2, 0 + bne _0805DB6E + movs r0, 0 + bl sub_8075680 +_0805DB6E: + mov r0, r10 + bl sub_805E2C4 + movs r7, 0 + movs r1, 0 + add r0, sp, 0x4 +_0805DB7A: + strb r1, [r0] + subs r0, 0x1 + cmp r0, sp + bge _0805DB7A + ldr r0, _0805DBEC + ldrh r1, [r0] + movs r4, 0x1 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0805DBAA + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0805DBAA + movs r0, 0x9E + lsls r0, 1 + add r0, r8 + ldr r0, [r0] + bl sub_8094450 + cmp r0, 0 + beq _0805DBAA + b _0805D9EC +_0805DBAA: + movs r3, 0 + mov r9, r3 + ldr r4, _0805DBEC + ldrh r1, [r4, 0x2] + movs r5, 0x1 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0805DBBE + b _0805DD02 +_0805DBBE: + ldrh r1, [r4] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0805DBF8 + movs r0, 0x9E + lsls r0, 1 + add r0, r8 + ldr r0, [r0] + bl sub_8094450 + cmp r0, 0 + bne _0805DBDA + b _0805DD02 +_0805DBDA: + movs r0, 0x1 + bl sub_8044C50 + ldr r1, _0805DBF0 + ldr r0, [r1] + ldr r2, _0805DBF4 + adds r0, r2 + strb r5, [r0] + b _0805E1AE + .align 2, 0 +_0805DBEC: .4byte gUnknown_20255F0 +_0805DBF0: .4byte gUnknown_203B418 +_0805DBF4: .4byte 0x00000673 +_0805DBF8: + mov r0, r10 + movs r1, 0x1 + bl sub_8071518 + lsls r0, 24 + cmp r0, 0 + beq _0805DC08 + b _0805DA08 +_0805DC08: + ldrh r0, [r4] + movs r3, 0x80 + lsls r3, 2 + adds r1, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _0805DCE8 + movs r4, 0 + movs r2, 0x8C + lsls r2, 1 + add r2, r8 + movs r3, 0x8 +_0805DC20: + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0805DC32 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _0805DC3A +_0805DC32: + adds r2, 0x8 + adds r4, 0x1 + cmp r4, 0x3 + ble _0805DC20 +_0805DC3A: + cmp r4, 0x4 + bne _0805DC40 + b _0805DA18 +_0805DC40: + movs r3, 0 + movs r5, 0x8C + lsls r5, 1 + movs r7, 0x1 + mov r2, r8 +_0805DC4A: + lsls r0, r3, 3 + add r0, r8 + adds r0, r5 + ldrb r1, [r0] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _0805DC66 + movs r1, 0x8E + lsls r1, 1 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0805DC6E +_0805DC66: + adds r2, 0x8 + adds r3, 0x1 + cmp r3, 0x3 + ble _0805DC4A +_0805DC6E: + cmp r3, 0x4 + bne _0805DC74 + b _0805DA20 +_0805DC74: + movs r7, 0 + adds r3, r4, 0 + cmp r4, 0x3 + bgt _0805DCB6 + lsls r0, r4, 3 + adds r2, r0, 0 + add r2, r8 + mov r12, r2 + movs r5, 0x8E + lsls r5, 1 + adds r0, r5 + mov r1, r8 + adds r2, r0, r1 + movs r5, 0x2 +_0805DC90: + ldrb r0, [r2] + cmp r0, 0 + bne _0805DCCC + movs r0, 0x8 + add r12, r0 + adds r2, 0x8 + adds r3, 0x1 + cmp r3, 0x3 + bgt _0805DCB6 + cmp r3, r4 + beq _0805DC90 + movs r0, 0x8C + lsls r0, 1 + add r0, r12 + ldrb r1, [r0] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _0805DC90 +_0805DCB6: + cmp r7, 0 + bne _0805DCCC + ldr r0, _0805DCC8 +_0805DCBC: + ldr r1, [r0] + mov r0, r10 + bl sub_80522A8 + b _0805E1AE + .align 2, 0 +_0805DCC8: .4byte gUnknown_80F8A4C +_0805DCCC: + ldr r0, [sp, 0x1C] + movs r1, 0x14 + bl sub_8044C94 + mov r0, r10 + bl sub_8045B60 + mov r1, r8 + adds r1, 0x48 + strb r0, [r1] + mov r0, r8 + adds r0, 0x50 + strb r4, [r0] + b _0805E1AE +_0805DCE8: + mov r0, r10 + mov r1, r8 + bl sub_805EF60 + lsls r0, 24 + cmp r0, 0 + beq _0805DCF8 + b _0805E1AE +_0805DCF8: + ldr r0, [sp, 0x1C] + movs r1, 0x32 + bl sub_8044C94 + b _0805E1AE +_0805DD02: + ldr r3, _0805DDC8 + ldrh r1, [r3, 0x6] + movs r2, 0x2 + adds r0, r2, 0 + ands r0, r1 + lsls r0, 16 + lsrs r1, r0, 16 + cmp r1, 0 + beq _0805DD16 + b _0805DA2A +_0805DD16: + mov r0, sp + ldrb r0, [r0, 0x1] + cmp r0, 0 + beq _0805DD20 + b _0805DA40 +_0805DD20: + mov r0, sp + ldrb r0, [r0, 0x2] + cmp r0, 0 + beq _0805DD2A + b _0805DA60 +_0805DD2A: + mov r0, sp + ldrb r0, [r0, 0x3] + cmp r0, 0 + beq _0805DD34 + b _0805DA80 +_0805DD34: + mov r0, sp + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _0805DD3E + b _0805DAA0 +_0805DD3E: + ldr r0, _0805DDCC + ldr r1, [sp, 0x8] + cmp r1, r0 + ble _0805DD48 + b _0805DAC4 +_0805DD48: + ldr r0, _0805DDD0 + ldr r0, [r0] + ldrb r4, [r0, 0x9] + cmp r4, 0 + bne _0805DD7E + ldrh r1, [r3, 0x2] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _0805DD66 + cmp r7, 0 + bne _0805DD7E + movs r2, 0 + cmp r2, 0 + beq _0805DD7E +_0805DD66: + ldr r3, [sp, 0x18] + ldrb r0, [r3] + cmp r0, 0 + beq _0805DD7E + bl sub_804AA60 + ldr r0, _0805DDD4 + strb r4, [r0] + bl sub_80048D0 + bl sub_8004914 +_0805DD7E: + ldr r2, _0805DDC8 + ldrh r0, [r2] + movs r5, 0x80 + lsls r5, 2 + adds r1, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _0805DDA4 + ldrh r1, [r2, 0x2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0805DDA4 + bl sub_80532B4 + bl sub_80048D0 + bl sub_8004914 +_0805DDA4: + movs r4, 0 + ldr r0, _0805DDC8 + ldrh r0, [r0] + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _0805DDFA + ldr r1, _0805DDD8 + ldrb r0, [r1] + cmp r0, 0 + bne _0805DDC2 + ldr r0, _0805DDDC + strh r4, [r0] +_0805DDC2: + movs r3, 0x1 + strb r3, [r1] + b _0805DDFE + .align 2, 0 +_0805DDC8: .4byte gUnknown_20255F0 +_0805DDCC: .4byte 0x00000707 +_0805DDD0: .4byte gUnknown_203B46C +_0805DDD4: .4byte gUnknown_202F22D +_0805DDD8: .4byte gUnknown_202F22C +_0805DDDC: .4byte gUnknown_202F22E +_0805DDE0: + movs r0, 0xB + bl sub_8044C50 + adds r2, r4, 0x1 + mov r0, r8 + adds r0, 0x48 + movs r1, 0 + strb r2, [r0] + adds r0, 0x4 + strh r1, [r0] + adds r0, 0x2 + strh r1, [r0] + b _0805DE92 +_0805DDFA: + ldr r0, _0805DEF8 + strb r4, [r0] +_0805DDFE: + movs r3, 0 + ldr r0, _0805DEFC + ldr r0, [r0] + ldrb r0, [r0, 0x9] + cmp r0, 0 + bne _0805DE2C + ldr r2, _0805DF00 + ldrh r0, [r2, 0x6] + movs r5, 0x80 + lsls r5, 1 + adds r1, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _0805DE2A + mov r0, r9 + cmp r0, 0 + bne _0805DE2A + ldrh r1, [r2, 0x2] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0805DE2C +_0805DE2A: + movs r3, 0x1 +_0805DE2C: + cmp r3, 0 + beq _0805DE54 + mov r0, r10 + bl sub_805E738 + ldr r0, _0805DF04 + movs r1, 0x1 + strb r1, [r0] + mov r0, r8 + adds r0, 0x46 + ldrb r0, [r0] + ldr r1, [sp, 0x10] + adds r1, 0x33 + strb r0, [r1] + ldr r1, [sp, 0x10] + adds r1, 0x34 + movs r0, 0xFF + strb r0, [r1] + bl sub_80048D0 +_0805DE54: + ldr r0, _0805DF00 + ldr r1, [r0] + ldr r0, _0805DF08 + ands r1, r0 + cmp r1, r0 + bne _0805DE62 + movs r4, 0x1 +_0805DE62: + mov r0, sp + ldrb r0, [r0] + cmp r0, 0 + beq _0805DE6C + movs r4, 0x1 +_0805DE6C: + cmp r4, 0 + beq _0805DE9C + movs r4, 0 + ldr r0, _0805DF0C + ldr r2, [r0] + movs r3, 0x10 +_0805DE78: + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0805DE8A + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _0805DDE0 +_0805DE8A: + adds r2, 0x4 + adds r4, 0x1 + cmp r4, 0x13 + ble _0805DE78 +_0805DE92: + ldr r2, [sp, 0x1C] + ldrh r0, [r2] + cmp r0, 0 + beq _0805DE9C + b _0805E1AE +_0805DE9C: + ldr r5, _0805DF10 + ldr r3, [r5] + ldr r1, _0805DF14 + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0805DF82 + ldr r0, _0805DEFC + ldr r2, [r0] + ldrb r0, [r2, 0x4] + cmp r0, 0x6 + beq _0805DF82 + ldr r0, _0805DF00 + ldrh r1, [r0, 0x2] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0805DF82 + ldrb r4, [r2, 0x4] + ldr r0, _0805DF18 + movs r2, 0x1 + strb r2, [r0] + ldr r5, _0805DF1C + adds r0, r3, r5 + strb r2, [r0] + bl sub_8094C48 + lsls r0, 24 + cmp r0, 0 + bne _0805DEDC + bl sub_8094C88 +_0805DEDC: + movs r0, 0x1 + bl sub_8052210 + bl sub_8040A84 + movs r0, 0x1E + bl SetBGOBJEnableFlags + movs r0, 0xA + movs r1, 0x2F + bl sub_803E708 + b _0805DF3A + .align 2, 0 +_0805DEF8: .4byte gUnknown_202F22C +_0805DEFC: .4byte gUnknown_203B46C +_0805DF00: .4byte gUnknown_20255F0 +_0805DF04: .4byte gUnknown_202F22D +_0805DF08: .4byte 0x01000200 +_0805DF0C: .4byte gUnknown_203B460 +_0805DF10: .4byte gUnknown_203B418 +_0805DF14: .4byte 0x0001820a +_0805DF18: .4byte gUnknown_202EE00 +_0805DF1C: .4byte 0x00018214 +_0805DF20: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0805DF3A + ldr r2, _0805DFA0 + movs r1, 0 + ldrb r0, [r2] + cmp r0, 0 + bne _0805DF34 + movs r1, 0x1 +_0805DF34: + strb r1, [r2] + bl sub_8040A84 +_0805DF3A: + movs r0, 0x2F + bl sub_803E46C + ldr r0, _0805DFA4 + ldrh r1, [r0, 0x2] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _0805DF54 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0805DF20 +_0805DF54: + ldr r1, _0805DFA8 + ldr r0, [r1] + ldr r2, _0805DFAC + adds r0, r2 + movs r1, 0 + strb r1, [r0] + ldr r0, _0805DFB0 + ldr r0, [r0] + strb r4, [r0, 0x4] + ldr r0, _0805DFA0 + movs r3, 0x1 + strb r3, [r0] + bl sub_8040A84 + movs r0, 0 + bl SetBGOBJEnableFlags + movs r0, 0x2F + bl sub_803E46C + movs r0, 0x2F + bl sub_803E46C +_0805DF82: + ldr r5, _0805DFA8 + ldr r0, [r5] + ldr r1, _0805DFB4 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0805DFBC + ldr r0, _0805DFB8 + ldrb r0, [r0] + cmp r0, 0 + bne _0805DFBC + ldr r0, _0805DFA4 + ldrh r2, [r0, 0x2] + adds r1, r2, 0 + b _0805DFCC + .align 2, 0 +_0805DFA0: .4byte gUnknown_202EE00 +_0805DFA4: .4byte gUnknown_20255F0 +_0805DFA8: .4byte gUnknown_203B418 +_0805DFAC: .4byte 0x00018214 +_0805DFB0: .4byte gUnknown_203B46C +_0805DFB4: .4byte 0x0000066d +_0805DFB8: .4byte gUnknown_202F22C +_0805DFBC: + ldr r3, _0805E05C + ldrh r1, [r3] + ldr r2, [sp, 0x18] + ldrb r0, [r2] + adds r2, r1, 0 + cmp r0, 0 + beq _0805DFCC + ldrh r2, [r3, 0x2] +_0805DFCC: + movs r0, 0xF0 + ands r1, r0 + ands r2, r0 + movs r5, 0x1 + negs r5, r5 + cmp r1, 0x50 + bne _0805DFDC + movs r5, 0x3 +_0805DFDC: + cmp r1, 0x60 + bne _0805DFE2 + movs r5, 0x5 +_0805DFE2: + cmp r1, 0x90 + bne _0805DFE8 + movs r5, 0x1 +_0805DFE8: + cmp r1, 0xA0 + bne _0805DFEE + movs r5, 0x7 +_0805DFEE: + cmp r2, 0x40 + bne _0805DFF4 + movs r5, 0x4 +_0805DFF4: + cmp r2, 0x80 + bne _0805DFFA + movs r5, 0 +_0805DFFA: + cmp r2, 0x10 + bne _0805E000 + movs r5, 0x2 +_0805E000: + cmp r2, 0x20 + bne _0805E006 + movs r5, 0x6 +_0805E006: + cmp r5, 0 + bge _0805E00C + b _0805E1A0 +_0805E00C: + ldr r0, _0805E060 + ldrb r0, [r0] + cmp r0, 0 + beq _0805E020 + adds r0, r5, 0 + movs r3, 0x1 + ands r0, r3 + cmp r0, 0 + bne _0805E020 + b _0805E1A0 +_0805E020: + mov r2, r8 + adds r2, 0x46 + ldrb r1, [r2] + eors r1, r5 + negs r0, r1 + orrs r0, r1 + lsrs r7, r0, 31 + movs r1, 0x7 + adds r0, r5, 0 + ands r0, r1 + strb r0, [r2] + ldr r0, _0805E064 + ldrb r0, [r0] + cmp r0, 0 + beq _0805E068 + ldr r0, [sp, 0x10] + adds r0, 0x33 + strb r5, [r0] + mov r0, r10 + bl sub_806CEBC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, r10 + adds r2, r5, 0 + bl sub_806CDD4 + b _0805E1A0 + .align 2, 0 +_0805E05C: .4byte gUnknown_20255F0 +_0805E060: .4byte gUnknown_202F22C +_0805E064: .4byte gUnknown_202F22D +_0805E068: + movs r4, 0 + movs r3, 0 + mov r0, r10 + movs r1, 0x1 + str r3, [sp, 0x20] + bl sub_805EC4C + lsls r0, 24 + ldr r3, [sp, 0x20] + cmp r0, 0 + beq _0805E080 + b _0805E1AE +_0805E080: + mov r0, r8 + adds r0, 0xB0 + ldrb r0, [r0] + cmp r0, 0x2 + bne _0805E094 + ldr r0, _0805E090 + b _0805E0BE + .align 2, 0 +_0805E090: .4byte gUnknown_80F8A84 +_0805E094: + cmp r0, 0x7 + bne _0805E0A0 + ldr r0, _0805E09C + b _0805E0BE + .align 2, 0 +_0805E09C: .4byte gUnknown_80F8A6C +_0805E0A0: + cmp r0, 0x5 + bne _0805E0AC + ldr r0, _0805E0A8 + b _0805E0BE + .align 2, 0 +_0805E0A8: .4byte gUnknown_80F8AB0 +_0805E0AC: + cmp r0, 0x3 + bne _0805E0B8 + ldr r0, _0805E0B4 + b _0805E0BE + .align 2, 0 +_0805E0B4: .4byte gUnknown_80F8ADC +_0805E0B8: + cmp r0, 0x4 + bne _0805E0C2 + ldr r0, _0805E128 +_0805E0BE: + ldr r3, [r0] + movs r4, 0x1 +_0805E0C2: + mov r0, r10 + adds r1, r5, 0 + str r3, [sp, 0x20] + bl sub_8070D6C + lsls r0, 24 + ldr r3, [sp, 0x20] + cmp r0, 0 + bne _0805E0D8 + movs r0, 0x2 + orrs r4, r0 +_0805E0D8: + cmp r7, 0 + beq _0805E0F4 + mov r0, r10 + str r3, [sp, 0x20] + bl sub_806CEBC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, r10 + adds r2, r5, 0 + bl sub_806CDD4 + ldr r3, [sp, 0x20] +_0805E0F4: + movs r7, 0x2 + adds r0, r4, 0 + ands r0, r7 + cmp r0, 0 + bne _0805E192 + movs r5, 0x1 + mov r9, r5 + ands r5, r4 + cmp r5, 0 + beq _0805E134 + cmp r3, 0 + beq _0805E114 + mov r0, r10 + adds r1, r3, 0 + bl sub_80522A8 +_0805E114: + movs r0, 0x1 + bl sub_8044C50 + ldr r1, _0805E12C + ldr r0, [r1] + ldr r2, _0805E130 + adds r0, r2 + mov r3, r9 + strb r3, [r0] + b _0805E1AE + .align 2, 0 +_0805E128: .4byte gUnknown_80F8B0C +_0805E12C: .4byte gUnknown_203B418 +_0805E130: .4byte 0x00000673 +_0805E134: + movs r0, 0x2 + bl sub_8044C50 + ldr r0, _0805E17C + ldrh r1, [r0] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + bne _0805E14C + movs r0, 0 + cmp r0, 0 + beq _0805E188 +_0805E14C: + movs r0, 0x9E + lsls r0, 1 + add r0, r8 + ldr r0, [r0] + bl sub_8094450 + cmp r0, 0 + beq _0805E188 + mov r1, r10 + ldr r0, [r1, 0x70] + adds r0, 0xBC + ldrb r0, [r0] + cmp r0, 0x2 + beq _0805E174 + ldr r2, _0805E180 + ldr r0, [r2] + ldr r3, _0805E184 + adds r0, r3 + mov r1, r9 + strb r1, [r0] +_0805E174: + mov r0, r8 + adds r0, 0x48 + strb r5, [r0] + b _0805E1AE + .align 2, 0 +_0805E17C: .4byte gUnknown_20255F0 +_0805E180: .4byte gUnknown_203B418 +_0805E184: .4byte 0x0000066c +_0805E188: + mov r0, r8 + adds r0, 0x48 + movs r2, 0x1 + strb r2, [r0] + b _0805E1AE +_0805E192: + movs r3, 0x1 + ands r4, r3 + cmp r4, 0 + beq _0805E1A0 + movs r0, 0x23 + bl sub_803E724 +_0805E1A0: + movs r0, 0xF + bl sub_803E46C + ldr r5, [sp, 0x14] + cmp r5, 0 + bne _0805E1AE + b _0805DB24 +_0805E1AE: + ldr r1, [sp, 0x18] + ldrb r0, [r1] + cmp r0, 0 + beq _0805E1BA + bl sub_804AA60 +_0805E1BA: + ldr r4, [sp, 0x1C] + ldrh r0, [r4] + cmp r0, 0x2D + beq _0805E1C6 + cmp r0, 0x13 + bne _0805E1E0 +_0805E1C6: + mov r0, r10 + bl sub_8067510 + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _0805E2B0 + movs r0, 0 + bl sub_8044C50 + bl _0805D980 +_0805E1E0: + lsls r0, r6, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0805E222 + ldr r2, _0805E210 + ldr r0, [r2] + ldr r3, _0805E214 + adds r0, r3 + strb r1, [r0] + ldrh r0, [r4] + cmp r0, 0 + beq _0805E218 + mov r0, r10 + movs r1, 0 + bl sub_8045028 + lsls r0, 24 + cmp r0, 0 + bne _0805E2B0 + movs r0, 0xF + bl sub_803E46C + b _0805E2B0 + .align 2, 0 +_0805E210: .4byte gUnknown_203B418 +_0805E214: .4byte 0x0000066d +_0805E218: + movs r0, 0xF + bl sub_803E46C + bl _0805D980 +_0805E222: + movs r0, 0xF + bl sub_803E46C + bl sub_8047158 + movs r2, 0 + lsrs r0, r6, 8 + lsls r0, 24 + cmp r0, 0 + bne _0805E238 + movs r2, 0x1 +_0805E238: + lsrs r1, r6, 16 + lsls r1, 24 + lsrs r1, 24 + adds r0, r2, 0 + bl sub_805F1BC + bl sub_80048D0 + bl sub_8004914 + ldr r1, _0805E294 + movs r0, 0 + strb r0, [r1] + movs r0, 0 + ldr r5, [sp, 0x18] + strb r0, [r5] + bl sub_804AA60 + bl sub_8044B28 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0805E2B0 + ldrh r0, [r4] + cmp r0, 0 + beq _0805E29C + cmp r0, 0x2B + bne _0805E27E + ldr r2, _0805E298 + ldr r0, [r2] + movs r3, 0x1 + strb r3, [r0, 0x4] + ldr r0, [r2] + strb r3, [r0, 0x3] +_0805E27E: + ldr r5, [sp, 0x1C] + ldrh r0, [r5] + cmp r0, 0x2E + bne _0805E2B0 + ldr r2, _0805E298 + ldr r0, [r2] + movs r3, 0x1 + strb r3, [r0, 0x4] + ldr r0, [r2] + strb r1, [r0, 0x3] + b _0805E2B0 + .align 2, 0 +_0805E294: .4byte gUnknown_202F22D +_0805E298: .4byte gUnknown_203B418 +_0805E29C: + movs r0, 0xF + bl sub_803E46C + ldr r5, _0805E2C0 + ldr r0, [r5] + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _0805E2B0 + bl _0805D980 +_0805E2B0: + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0805E2C0: .4byte gUnknown_203B418 + thumb_func_end sub_805D8C8 + + thumb_func_start sub_805E2C4 +sub_805E2C4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + str r0, [sp, 0x10] + ldr r0, _0805E47C + ldr r1, [r0] + ldr r0, _0805E480 + adds r0, r1, r0 + str r0, [sp, 0x14] + ldr r0, _0805E484 + ldrb r0, [r0] + cmp r0, 0 + bne _0805E2E6 + b _0805E4C4 +_0805E2E6: + movs r1, 0 + str r1, [sp, 0x18] + mov r7, sp + ldr r2, _0805E488 + mov r10, r2 +_0805E2F0: + ldrh r0, [r7] + ldr r3, _0805E48C + adds r1, r3, 0 + ands r1, r0 + ldr r0, [sp] + mov r4, r10 + ands r0, r4 + orrs r0, r1 + str r0, [sp] + ldrh r1, [r7] + mov r2, r10 + ands r2, r0 + orrs r2, r1 + str r2, [sp] + ldrh r0, [r7] + ldr r5, _0805E490 + adds r1, r5, 0 + ands r1, r0 + mov r0, r10 + ands r0, r2 + orrs r0, r1 + str r0, [sp] + ldrh r2, [r7] + mov r1, r10 + ands r1, r0 + orrs r1, r2 + str r1, [sp] + ldrh r2, [r7] + ldr r0, _0805E494 + ands r0, r2 + mov r3, r10 + ands r3, r1 + orrs r3, r0 + str r3, [sp] + ldrh r1, [r7] + movs r0, 0x80 + lsls r0, 3 + orrs r0, r1 + movs r6, 0 + orrs r0, r6 + mov r2, r10 + ands r2, r3 + orrs r2, r0 + str r2, [sp] + ldrh r0, [r7] + ldr r3, _0805E498 + adds r1, r3, 0 + ands r1, r0 + mov r0, r10 + ands r0, r2 + orrs r0, r1 + str r0, [sp] + ldrh r1, [r7] + mov r2, r10 + ands r2, r0 + orrs r2, r1 + str r2, [sp] + ldrh r0, [r7] + ldr r4, _0805E49C + adds r1, r4, 0 + ands r1, r0 + mov r0, r10 + ands r0, r2 + orrs r0, r1 + str r0, [sp] + ldrh r1, [r7] + mov r2, r10 + ands r2, r0 + orrs r2, r1 + str r2, [sp] + ldrh r1, [r7] + ldr r0, _0805E4A0 + ands r0, r1 + mov r1, r10 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + ldrh r2, [r7] + mov r0, r10 + ands r0, r1 + orrs r0, r2 + str r0, [sp] + ldr r1, _0805E4A4 + ldr r5, [sp, 0x18] + lsls r0, r5, 3 + adds r0, r1 + mov r12, r0 + ldrb r1, [r0, 0x4] + negs r0, r1 + orrs r0, r1 + asrs r1, r0, 31 + movs r0, 0x8 + ands r1, r0 + mov r6, r12 + ldrb r0, [r6, 0x5] + cmp r0, 0 + beq _0805E3B4 + adds r1, 0x10 +_0805E3B4: + movs r0, 0x1F + ands r1, r0 + lsls r1, 9 + ldrh r3, [r7, 0x2] + ldr r2, _0805E4A8 + adds r0, r2, 0 + ands r3, r0 + orrs r3, r1 + ldr r4, _0805E4A0 + ands r3, r4 + strh r3, [r7, 0x2] + ldr r2, _0805E4AC + ldrh r0, [r7, 0x4] + movs r5, 0xFC + lsls r5, 8 + adds r1, r5, 0 + ands r0, r1 + orrs r0, r2 + movs r6, 0 + orrs r0, r6 + movs r1, 0x80 + lsls r1, 4 + ldr r2, _0805E494 + ands r0, r2 + orrs r0, r1 + orrs r0, r6 + ldr r4, _0805E4B0 + mov r9, r4 + ands r0, r4 + strh r0, [r7, 0x4] + ldrh r4, [r7, 0x6] + ldr r5, _0805E4B4 + adds r0, r5, 0 + ands r4, r0 + ldr r6, _0805E4B8 + adds r0, r6, 0 + ands r4, r0 + strh r4, [r7, 0x6] + mov r0, r12 + movs r1, 0 + ldrsh r5, [r0, r1] + lsls r2, r5, 2 + adds r2, r5 + lsls r2, 1 + ldr r6, _0805E4BC + mov r8, r6 + movs r1, 0 + ldrsh r0, [r6, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + movs r6, 0x7 + ands r0, r6 + muls r0, r5 + adds r0, r2 + adds r0, 0x74 + ldr r1, _0805E4C0 + ands r0, r1 + movs r2, 0xFE + lsls r2, 8 + adds r1, r2, 0 + ands r3, r1 + orrs r3, r0 + strh r3, [r7, 0x2] + mov r5, r12 + movs r0, 0x2 + ldrsh r3, [r5, r0] + lsls r2, r3, 2 + adds r2, r3 + lsls r2, 1 + mov r1, r8 + movs r5, 0 + ldrsh r0, [r1, r5] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + ands r0, r6 + muls r0, r3 + adds r0, r2 + adds r0, 0x52 + mov r6, r9 + ands r0, r6 + lsls r0, 4 + movs r1, 0xF + ands r4, r1 + orrs r4, r0 + strh r4, [r7, 0x6] + mov r0, sp + adds r1, 0xF1 + movs r2, 0 + movs r3, 0 + bl AddSprite + ldr r2, [sp, 0x18] + adds r2, 0x1 + str r2, [sp, 0x18] + cmp r2, 0x3 + bgt _0805E47A + b _0805E2F0 +_0805E47A: + b _0805E6AC + .align 2, 0 +_0805E47C: .4byte gUnknown_203B418 +_0805E480: .4byte 0x000181e8 +_0805E484: .4byte gUnknown_202F22C +_0805E488: .4byte 0xffff0000 +_0805E48C: .4byte 0x0000feff +_0805E490: .4byte 0x0000fdff +_0805E494: .4byte 0x0000f3ff +_0805E498: .4byte 0x0000efff +_0805E49C: .4byte 0x0000dfff +_0805E4A0: .4byte 0x00003fff +_0805E4A4: .4byte gUnknown_8106AC8 +_0805E4A8: .4byte 0x0000c1ff +_0805E4AC: .4byte 0x00000213 +_0805E4B0: .4byte 0x00000fff +_0805E4B4: .4byte 0x0000fffe +_0805E4B8: .4byte 0x0000fffd +_0805E4BC: .4byte gUnknown_202F22E +_0805E4C0: .4byte 0x000001ff +_0805E4C4: + ldr r3, _0805E6E4 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _0805E4D0 + b _0805E6AC +_0805E4D0: + ldr r4, _0805E6E8 + adds r0, r1, r4 + ldrb r0, [r0] + str r0, [sp, 0x1C] + cmp r0, 0x7 + bls _0805E4DE + b _0805E6AC +_0805E4DE: + ldr r0, _0805E6EC + ldrb r0, [r0] + movs r7, 0x1 + cmp r0, 0 + beq _0805E4F2 + ldr r0, _0805E6F0 + ldrb r0, [r0] + cmp r0, 0 + beq _0805E4F2 + movs r7, 0x3 +_0805E4F2: + ldr r5, _0805E6F4 + mov r12, r5 + ldr r6, [sp, 0x1C] + lsls r5, r6, 1 + adds r3, r5, r6 + lsls r3, 2 + add r3, r12 + movs r0, 0 + ldrsh r4, [r3, r0] + lsls r1, r4, 2 + adds r1, r4 + lsls r1, 1 + ldr r0, _0805E6F8 + movs r6, 0 + ldrsh r2, [r0, r6] + lsrs r0, r2, 31 + adds r2, r0 + asrs r2, 1 + movs r0, 0x7 + ands r2, r0 + adds r0, r4, 0 + muls r0, r2 + adds r0, r1 + adds r0, 0x74 + str r0, [sp, 0x20] + movs r1, 0x2 + ldrsh r0, [r3, r1] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 1 + muls r0, r2 + adds r0, r1 + adds r0, 0x52 + mov r10, r0 + str r5, [sp, 0x24] + cmp r7, 0 + bne _0805E53E + b _0805E6AC +_0805E53E: + add r6, sp, 0x8 + ldr r2, _0805E6FC + mov r8, r2 + mov r9, r7 +_0805E546: + ldrh r0, [r6] + ldr r3, _0805E700 + adds r1, r3, 0 + ands r1, r0 + ldr r0, [sp, 0x8] + mov r4, r8 + ands r0, r4 + orrs r0, r1 + str r0, [sp, 0x8] + ldrh r1, [r6] + mov r2, r8 + ands r2, r0 + orrs r2, r1 + str r2, [sp, 0x8] + ldrh r0, [r6] + ldr r5, _0805E704 + adds r1, r5, 0 + ands r1, r0 + mov r0, r8 + ands r0, r2 + orrs r0, r1 + str r0, [sp, 0x8] + ldrh r2, [r6] + mov r1, r8 + ands r1, r0 + orrs r1, r2 + str r1, [sp, 0x8] + ldrh r2, [r6] + ldr r0, _0805E708 + ands r0, r2 + mov r3, r8 + ands r3, r1 + orrs r3, r0 + str r3, [sp, 0x8] + ldrh r1, [r6] + movs r0, 0x80 + lsls r0, 3 + orrs r0, r1 + movs r1, 0 + orrs r0, r1 + mov r2, r8 + ands r2, r3 + orrs r2, r0 + str r2, [sp, 0x8] + ldrh r0, [r6] + ldr r3, _0805E70C + adds r1, r3, 0 + ands r1, r0 + mov r0, r8 + ands r0, r2 + orrs r0, r1 + str r0, [sp, 0x8] + ldrh r1, [r6] + mov r2, r8 + ands r2, r0 + orrs r2, r1 + str r2, [sp, 0x8] + ldrh r0, [r6] + ldr r4, _0805E710 + adds r1, r4, 0 + ands r1, r0 + mov r0, r8 + ands r0, r2 + orrs r0, r1 + str r0, [sp, 0x8] + ldrh r1, [r6] + mov r2, r8 + ands r2, r0 + orrs r2, r1 + str r2, [sp, 0x8] + ldrh r1, [r6] + ldr r0, _0805E714 + ands r0, r1 + mov r1, r8 + ands r1, r2 + orrs r1, r0 + str r1, [sp, 0x8] + ldrh r2, [r6] + mov r0, r8 + ands r0, r1 + orrs r0, r2 + str r0, [sp, 0x8] + ldr r5, [sp, 0x24] + ldr r1, [sp, 0x1C] + adds r0, r5, r1 + lsls r2, r0, 2 + ldr r3, _0805E6F4 + adds r7, r2, r3 + ldrb r1, [r7, 0x8] + negs r0, r1 + orrs r0, r1 + asrs r1, r0, 31 + movs r0, 0x8 + ands r1, r0 + ldrb r0, [r7, 0x9] + cmp r0, 0 + beq _0805E60A + adds r1, 0x10 +_0805E60A: + movs r0, 0x1F + ands r1, r0 + lsls r1, 9 + ldrh r3, [r6, 0x2] + ldr r4, _0805E718 + adds r0, r4, 0 + ands r3, r0 + orrs r3, r1 + ldr r5, _0805E714 + ands r3, r5 + strh r3, [r6, 0x2] + ldr r1, _0805E71C + adds r0, r2, r1 + ldr r2, [r0] + ldr r0, _0805E720 + ands r2, r0 + ldrh r0, [r6, 0x4] + movs r4, 0xFC + lsls r4, 8 + adds r1, r4, 0 + ands r0, r1 + orrs r0, r2 + movs r1, 0x80 + lsls r1, 4 + ldr r5, _0805E708 + ands r0, r5 + orrs r0, r1 + movs r1, 0 + orrs r0, r1 + movs r2, 0xF + mov r12, r2 + ldr r4, _0805E724 + ands r0, r4 + strh r0, [r6, 0x4] + ldrh r1, [r6, 0x6] + ldr r5, _0805E728 + adds r0, r5, 0 + ands r1, r0 + ldr r2, _0805E72C + adds r0, r2, 0 + ands r1, r0 + ldr r0, _0805E730 + ldr r5, [sp, 0x20] + ands r0, r5 + movs r5, 0xFE + lsls r5, 8 + adds r2, r5, 0 + ands r3, r2 + orrs r3, r0 + strh r3, [r6, 0x2] + mov r0, r10 + ands r0, r4 + lsls r0, 4 + mov r2, r12 + ands r1, r2 + orrs r1, r0 + strh r1, [r6, 0x6] + adds r0, r6, 0 + movs r1, 0x80 + lsls r1, 1 + movs r2, 0 + movs r3, 0 + bl AddSprite + movs r3, 0 + ldrsh r0, [r7, r3] + lsls r0, 2 + ldr r4, [sp, 0x20] + adds r4, r0 + str r4, [sp, 0x20] + movs r5, 0x2 + ldrsh r0, [r7, r5] + lsls r0, 2 + add r10, r0 + movs r0, 0x1 + negs r0, r0 + add r9, r0 + mov r1, r9 + cmp r1, 0 + beq _0805E6AC + b _0805E546 +_0805E6AC: + ldr r4, _0805E734 + ldrb r0, [r4] + cmp r0, 0 + beq _0805E6D4 + ldr r2, [sp, 0x14] + adds r2, 0x34 + ldr r3, [sp, 0x14] + adds r3, 0x33 + ldrb r1, [r3] + ldrb r0, [r2] + cmp r0, r1 + beq _0805E6D4 + strb r1, [r2] + ldr r0, [sp, 0x10] + adds r0, 0x4 + ldrb r1, [r3] + ldrb r3, [r4] + movs r2, 0 + bl sub_804A728 +_0805E6D4: + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0805E6E4: .4byte 0x0001821a +_0805E6E8: .4byte 0x0001821b +_0805E6EC: .4byte gUnknown_202F231 +_0805E6F0: .4byte gUnknown_202F230 +_0805E6F4: .4byte gUnknown_8106AE8 +_0805E6F8: .4byte gUnknown_202F22E +_0805E6FC: .4byte 0xffff0000 +_0805E700: .4byte 0x0000feff +_0805E704: .4byte 0x0000fdff +_0805E708: .4byte 0x0000f3ff +_0805E70C: .4byte 0x0000efff +_0805E710: .4byte 0x0000dfff +_0805E714: .4byte 0x00003fff +_0805E718: .4byte 0x0000c1ff +_0805E71C: .4byte gUnknown_8106AEC +_0805E720: .4byte 0x000003ff +_0805E724: .4byte 0x00000fff +_0805E728: .4byte 0x0000fffe +_0805E72C: .4byte 0x0000fffd +_0805E730: .4byte 0x000001ff +_0805E734: .4byte gUnknown_202F22D + thumb_func_end sub_805E2C4 + + thumb_func_start sub_805E738 +sub_805E738: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r6, r0, 0 + ldr r1, [r6, 0x70] + adds r0, r1, 0 + adds r0, 0xE8 + ldrb r0, [r0] + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _0805E7F6 + movs r0, 0 + mov r8, r0 + adds r1, 0x46 + mov r10, r1 +_0805E75E: + movs r1, 0 + mov r9, r1 + mov r3, r10 + ldrb r5, [r3] + adds r5, 0x1 + movs r7, 0x1 +_0805E76A: + movs r0, 0x7 + ands r5, r0 + movs r1, 0x4 + ldrsh r0, [r6, r1] + ldr r1, _0805E7E8 + lsls r2, r5, 2 + adds r2, r1 + movs r3, 0 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r3, 0x6 + ldrsh r1, [r6, r3] + movs r3, 0x2 + ldrsh r2, [r2, r3] + adds r1, r2 + bl sub_804954C + adds r4, r0, 0 + ldr r0, [r4, 0x10] + cmp r0, 0 + beq _0805E7B8 + bl sub_80450F8 + cmp r0, 0x1 + bne _0805E7B8 + ldr r1, [r4, 0x10] + ldr r4, [r1, 0x70] + adds r0, r6, 0 + bl sub_8045990 + lsls r0, 24 + cmp r0, 0 + beq _0805E7B8 + mov r0, r8 + cmp r0, 0 + bne _0805E7C6 + ldrb r0, [r4, 0x6] + cmp r0, 0 + bne _0805E7C6 +_0805E7B8: + adds r7, 0x1 + adds r5, 0x1 + cmp r7, 0x7 + ble _0805E76A + mov r1, r9 + cmp r1, 0 + beq _0805E7EC +_0805E7C6: + ldr r1, [r6, 0x70] + movs r2, 0x7 + adds r0, r5, 0 + ands r0, r2 + adds r1, 0x46 + strb r0, [r1] + adds r0, r6, 0 + bl sub_806CEBC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + adds r2, r5, 0 + bl sub_806CDD4 + b _0805E7F6 + .align 2, 0 +_0805E7E8: .4byte gUnknown_80F4448 +_0805E7EC: + movs r3, 0x1 + add r8, r3 + mov r0, r8 + cmp r0, 0 + ble _0805E75E +_0805E7F6: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_805E738 + + thumb_func_start sub_805E804 +sub_805E804: + push {r4,r5,lr} + ldr r2, _0805E864 + ldr r1, [r2] + ldr r5, _0805E868 + adds r3, r1, r5 + ldr r4, _0805E86C + adds r1, r4 + ldrb r0, [r3] + ldrb r1, [r1] + orrs r0, r1 + movs r1, 0 + strb r0, [r3] + ldr r0, [r2] + adds r0, r4 + strb r1, [r0] + ldr r0, [r2] + adds r0, r5 + ldrb r0, [r0] + cmp r0, 0 + beq _0805E85C + ldr r0, _0805E870 + ldrh r1, [r0] + movs r2, 0x80 + lsls r2, 1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _0805E85C + adds r4, r2, 0 +_0805E83E: + movs r0, 0x54 + bl sub_803E46C + ldr r0, _0805E864 + ldr r0, [r0] + ldr r1, _0805E868 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0805E85C + ldr r0, _0805E870 + ldrh r0, [r0] + ands r0, r4 + cmp r0, 0 + bne _0805E83E +_0805E85C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0805E864: .4byte gUnknown_203B418 +_0805E868: .4byte 0x0000066d +_0805E86C: .4byte 0x0000066c +_0805E870: .4byte gUnknown_20255F0 + thumb_func_end sub_805E804 + + thumb_func_start sub_805E874 +sub_805E874: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + ldr r0, _0805E90C + ldr r4, [r0] + bl sub_8083600 + mov r9, r0 + ldr r0, [r0, 0x70] + adds r0, 0x46 + ldrb r0, [r0] + str r0, [sp, 0x18] + mov r0, r9 + movs r1, 0x4 + ldrsh r0, [r0, r1] + mov r10, r0 + mov r2, r9 + movs r3, 0x6 + ldrsh r2, [r2, r3] + str r2, [sp, 0x1C] + adds r1, r2, 0 + bl sub_804954C + adds r5, r0, 0 + ldr r1, _0805E910 + ldr r2, [sp, 0x18] + lsls r0, r2, 2 + adds r0, r1 + movs r3, 0 + ldrsh r1, [r0, r3] + mov r2, r10 + adds r7, r2, r1 + movs r3, 0x2 + ldrsh r0, [r0, r3] + ldr r1, [sp, 0x1C] + adds r6, r1, r0 + ldr r2, _0805E914 + adds r4, r2 + ldrb r0, [r4] + cmp r0, 0 + beq _0805E906 + ldr r0, [r5, 0x14] + cmp r0, 0 + bne _0805E906 + mov r0, r9 + mov r1, r10 + ldr r2, [sp, 0x1C] + bl sub_805EC2C + lsls r0, 24 + cmp r0, 0 + bne _0805E906 + mov r0, r9 + ldr r1, [sp, 0x18] + bl sub_8070F14 + lsls r0, 24 + cmp r0, 0 + beq _0805E906 + ldrb r3, [r5, 0x9] + str r3, [sp, 0x20] + cmp r3, 0xFF + bne _0805E918 + adds r0, r7, 0 + adds r1, r6, 0 + bl sub_804954C + ldrb r0, [r0, 0x9] + cmp r0, 0xFF + beq _0805E922 +_0805E906: + movs r0, 0 + b _0805EC1A + .align 2, 0 +_0805E90C: .4byte gUnknown_203B418 +_0805E910: .4byte gUnknown_80F4448 +_0805E914: .4byte 0x0000066c +_0805E918: + ldrh r1, [r5] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _0805E906 +_0805E922: + movs r4, 0x1 + negs r4, r4 + ldr r7, _0805EA54 + movs r5, 0x80 + lsls r5, 2 + adds r6, r5, 0 +_0805E92E: + ldr r0, [sp, 0x18] + adds r1, r0, r4 + movs r5, 0x7 + ands r1, r5 + lsls r1, 2 + adds r1, r7 + movs r2, 0 + ldrsh r0, [r1, r2] + add r0, r10 + movs r3, 0x2 + ldrsh r1, [r1, r3] + ldr r2, [sp, 0x1C] + adds r1, r2, r1 + bl sub_804954C + adds r1, r0, 0 + ldr r0, [r1, 0x10] + cmp r0, 0 + bne _0805E906 + ldrh r0, [r1] + ands r0, r6 + cmp r0, 0 + bne _0805E906 + adds r4, 0x1 + cmp r4, 0x1 + ble _0805E92E + ldr r4, _0805EA54 + ldr r3, [sp, 0x18] + adds r3, 0x3 + ands r3, r5 + lsls r3, 2 + adds r3, r4 + movs r1, 0 + ldrsh r0, [r3, r1] + add r0, r10 + str r0, [sp] + ldr r2, [sp, 0x18] + adds r2, 0x4 + ands r2, r5 + lsls r2, 2 + adds r2, r4 + movs r1, 0 + ldrsh r0, [r2, r1] + add r0, r10 + str r0, [sp, 0x4] + ldr r1, [sp, 0x18] + adds r1, 0x5 + ands r1, r5 + lsls r1, 2 + adds r1, r4 + movs r4, 0 + ldrsh r0, [r1, r4] + add r0, r10 + str r0, [sp, 0x8] + add r4, sp, 0xC + movs r5, 0x2 + ldrsh r0, [r3, r5] + ldr r3, [sp, 0x1C] + adds r0, r3, r0 + str r0, [sp, 0xC] + movs r5, 0x2 + ldrsh r0, [r2, r5] + adds r0, r3, r0 + str r0, [r4, 0x4] + movs r2, 0x2 + ldrsh r0, [r1, r2] + adds r0, r3, r0 + str r0, [r4, 0x8] + movs r3, 0x1 + negs r3, r3 + mov r8, r3 +_0805E9BC: + movs r4, 0x1 + negs r4, r4 + mov r7, r10 + add r7, r8 + ldr r6, [sp, 0x1C] + subs r6, 0x1 +_0805E9C8: + adds r0, r7, 0 + adds r1, r6, 0 + bl sub_804954C + adds r5, r0, 0 + ldr r0, [r5, 0x14] + cmp r0, 0 + beq _0805EA14 + movs r2, 0 + ldr r0, [sp] + cmp r7, r0 + bne _0805E9E6 + ldr r0, [sp, 0xC] + cmp r6, r0 + beq _0805EA04 +_0805E9E6: + adds r2, 0x1 + cmp r2, 0x2 + bgt _0805EA04 + lsls r1, r2, 2 + mov r3, sp + adds r0, r3, r1 + ldr r0, [r0] + cmp r7, r0 + bne _0805E9E6 + mov r0, sp + adds r0, r1 + adds r0, 0xC + ldr r0, [r0] + cmp r6, r0 + bne _0805E9E6 +_0805EA04: + cmp r2, 0x3 + bne _0805EA14 + ldr r0, [r5, 0x14] + bl sub_80450F8 + cmp r0, 0x3 + bne _0805EA14 + b _0805E906 +_0805EA14: + movs r0, 0x1 + ldr r1, [sp, 0x18] + ands r0, r1 + cmp r0, 0 + beq _0805EA60 + ldr r0, [r5, 0x14] + cmp r0, 0 + beq _0805EA94 + bl sub_80450F8 + cmp r0, 0x2 + bne _0805EA94 + ldr r0, [r5, 0x14] + bl sub_80450F8 + cmp r0, 0x2 + bne _0805EA94 + ldr r0, [r5, 0x14] + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0 + beq _0805EA42 + b _0805E906 +_0805EA42: + ldr r0, _0805EA58 + ldr r0, [r0] + ldr r2, _0805EA5C + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _0805EA94 + b _0805E906 + .align 2, 0 +_0805EA54: .4byte gUnknown_80F4448 +_0805EA58: .4byte gUnknown_203B418 +_0805EA5C: .4byte 0x0001820f +_0805EA60: + mov r3, r8 + cmp r3, 0 + beq _0805EA6A + cmp r4, 0 + bne _0805EA94 +_0805EA6A: + ldr r0, [r5, 0x14] + cmp r0, 0 + beq _0805EA94 + bl sub_80450F8 + cmp r0, 0x2 + bne _0805EA94 + ldr r0, [r5, 0x14] + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0 + beq _0805EA84 + b _0805E906 +_0805EA84: + ldr r0, _0805EAA0 + ldr r0, [r0] + ldr r1, _0805EAA4 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0805EA94 + b _0805E906 +_0805EA94: + mov r2, r8 + cmp r2, 0 + beq _0805EAA8 + cmp r4, 0 + bne _0805EAD6 + b _0805EAAC + .align 2, 0 +_0805EAA0: .4byte gUnknown_203B418 +_0805EAA4: .4byte 0x0001820f +_0805EAA8: + cmp r4, 0 + beq _0805EAD6 +_0805EAAC: + ldr r0, [sp, 0x4] + cmp r0, r7 + bne _0805EAB8 + ldr r0, [sp, 0x10] + cmp r0, r6 + beq _0805EAD6 +_0805EAB8: + mov r0, r9 + adds r1, r7, 0 + adds r2, r6, 0 + bl sub_805EC2C + lsls r0, 24 + cmp r0, 0 + bne _0805EAD6 + ldr r3, [sp, 0x20] + cmp r3, 0xFF + beq _0805EAD6 + ldrb r5, [r5, 0x9] + cmp r3, r5 + beq _0805EAD6 + b _0805E906 +_0805EAD6: + adds r6, 0x1 + adds r4, 0x1 + cmp r4, 0x1 + bgt _0805EAE0 + b _0805E9C8 +_0805EAE0: + movs r4, 0x1 + add r8, r4 + mov r5, r8 + cmp r5, 0x1 + bgt _0805EAEC + b _0805E9BC +_0805EAEC: + movs r0, 0x1 + ldr r1, [sp, 0x18] + ands r0, r1 + cmp r0, 0 + beq _0805EAF8 + b _0805EC18 +_0805EAF8: + cmp r1, 0 + beq _0805EB00 + cmp r1, 0x4 + bne _0805EB8C +_0805EB00: + mov r4, r10 + subs r4, 0x1 + ldr r6, [sp, 0x1C] + subs r6, 0x1 + mov r0, r9 + adds r1, r4, 0 + adds r2, r6, 0 + bl sub_805EC2C + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + mov r0, r9 + adds r1, r4, 0 + ldr r2, [sp, 0x1C] + bl sub_805EC2C + lsls r0, 24 + lsrs r7, r0, 24 + ldr r5, [sp, 0x1C] + adds r5, 0x1 + mov r0, r9 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_805EC2C + lsls r0, 24 + lsrs r0, 24 + adds r2, r6, 0 + cmp r7, 0 + bne _0805EB4C + mov r3, r8 + cmp r3, 0 + beq _0805EB46 + b _0805E906 +_0805EB46: + cmp r7, r0 + beq _0805EB4C + b _0805E906 +_0805EB4C: + mov r4, r10 + adds r4, 0x1 + mov r0, r9 + adds r1, r4, 0 + bl sub_805EC2C + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + mov r0, r9 + adds r1, r4, 0 + ldr r2, [sp, 0x1C] + bl sub_805EC2C + lsls r0, 24 + lsrs r7, r0, 24 + mov r0, r9 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_805EC2C + lsls r0, 24 + lsrs r0, 24 + cmp r7, 0 + bne _0805EC18 + mov r4, r8 + cmp r4, 0 + beq _0805EB86 + b _0805E906 +_0805EB86: + cmp r7, r0 + beq _0805EC18 + b _0805E906 +_0805EB8C: + mov r6, r10 + subs r6, 0x1 + ldr r4, [sp, 0x1C] + subs r4, 0x1 + mov r0, r9 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_805EC2C + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + mov r0, r9 + mov r1, r10 + adds r2, r4, 0 + bl sub_805EC2C + lsls r0, 24 + lsrs r7, r0, 24 + mov r5, r10 + adds r5, 0x1 + mov r0, r9 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_805EC2C + lsls r0, 24 + lsrs r0, 24 + adds r1, r6, 0 + cmp r7, 0 + bne _0805EBD8 + mov r2, r8 + cmp r2, 0 + beq _0805EBD2 + b _0805E906 +_0805EBD2: + cmp r7, r0 + beq _0805EBD8 + b _0805E906 +_0805EBD8: + ldr r4, [sp, 0x1C] + adds r4, 0x1 + mov r0, r9 + adds r2, r4, 0 + bl sub_805EC2C + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + mov r0, r9 + mov r1, r10 + adds r2, r4, 0 + bl sub_805EC2C + lsls r0, 24 + lsrs r7, r0, 24 + mov r0, r9 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_805EC2C + lsls r0, 24 + lsrs r0, 24 + cmp r7, 0 + bne _0805EC18 + mov r3, r8 + cmp r3, 0 + beq _0805EC12 + b _0805E906 +_0805EC12: + cmp r7, r0 + beq _0805EC18 + b _0805E906 +_0805EC18: + movs r0, 0x1 +_0805EC1A: + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_805E874 + + thumb_func_start sub_805EC2C +sub_805EC2C: + push {lr} + sub sp, 0x4 + lsls r1, 16 + lsls r2, 16 + lsrs r1, 16 + orrs r1, r2 + str r1, [sp] + mov r1, sp + bl sub_8070564 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r1} + bx r1 + thumb_func_end sub_805EC2C + + thumb_func_start sub_805EC4C +sub_805EC4C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r5, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + ldr r7, [r5, 0x70] + ldr r1, _0805ECC8 + adds r0, r7, 0 + adds r0, 0x46 + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0] + ldrh r3, [r5, 0x4] + adds r1, r3 + lsls r1, 16 + ldrh r0, [r0, 0x2] + ldrh r3, [r5, 0x6] + adds r0, r3 + lsls r0, 16 + lsrs r2, r1, 16 + orrs r2, r0 + lsls r0, r2, 16 + asrs r0, 16 + asrs r1, r2, 16 + bl sub_804954C + ldr r0, [r0, 0x10] + mov r8, r0 + cmp r0, 0 + bne _0805EC94 + b _0805ED96 +_0805EC94: + mov r0, r8 + bl sub_80450F8 + cmp r0, 0x1 + bne _0805ED96 + mov r0, r8 + ldr r6, [r0, 0x70] + ldrb r0, [r6, 0x6] + cmp r0, 0 + beq _0805ECDC + ldrb r0, [r6, 0x8] + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _0805ECDC + adds r0, r6, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x4A + beq _0805ECC2 + cmp r0, 0x47 + bne _0805ECCC +_0805ECC2: + movs r0, 0x1 + b _0805ECCE + .align 2, 0 +_0805ECC8: .4byte gUnknown_80F4448 +_0805ECCC: + movs r0, 0 +_0805ECCE: + cmp r0, 0 + bne _0805ECDC + adds r0, r6, 0 + adds r0, 0xA4 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0805ED96 +_0805ECDC: + adds r0, r7, 0 + adds r0, 0xB0 + ldrb r0, [r0] + cmp r0, 0x2 + beq _0805ED96 + cmp r0, 0x1 + beq _0805ED96 + cmp r0, 0x7 + beq _0805ED96 + cmp r0, 0x5 + beq _0805ED96 + cmp r0, 0x3 + beq _0805ED96 + cmp r0, 0x4 + beq _0805ED96 + adds r0, r6, 0 + adds r0, 0xB0 + ldrb r0, [r0] + cmp r0, 0x2 + beq _0805ED96 + cmp r0, 0x1 + beq _0805ED96 + cmp r0, 0x7 + beq _0805ED96 + cmp r0, 0x5 + beq _0805ED96 + cmp r0, 0x3 + beq _0805ED96 + cmp r0, 0x4 + beq _0805ED96 + adds r0, r7, 0 + adds r0, 0xBC + ldrb r0, [r0] + cmp r0, 0x2 + beq _0805ED96 + adds r0, r6, 0 + adds r0, 0xBC + ldrb r0, [r0] + cmp r0, 0x2 + beq _0805ED96 + adds r0, r6, 0 + adds r0, 0xA8 + ldrb r0, [r0] + cmp r0, 0 + beq _0805ED3E + cmp r0, 0x2 + beq _0805ED3E + cmp r0, 0x4 + bne _0805ED96 +_0805ED3E: + adds r0, r7, 0 + adds r0, 0xA8 + ldrb r0, [r0] + cmp r0, 0 + beq _0805ED50 + cmp r0, 0x2 + beq _0805ED50 + cmp r0, 0x4 + bne _0805ED96 +_0805ED50: + mov r0, r8 + movs r1, 0 + bl sub_80570F4 + lsls r0, 24 + cmp r0, 0 + bne _0805ED96 + adds r4, r7, 0 + adds r4, 0x46 + ldrb r1, [r4] + adds r0, r5, 0 + bl sub_8070F80 + lsls r0, 24 + mov r9, r4 + cmp r0, 0 + beq _0805ED96 + mov r1, r10 + cmp r1, 0 + beq _0805EDA0 + adds r1, r5, 0x4 + mov r0, r8 + bl sub_807049C + lsls r0, 24 + cmp r0, 0 + beq _0805EDA0 + ldr r0, _0805ED9C + ldr r1, [r0] + movs r0, 0 + movs r2, 0 + bl sub_8052B8C + cmp r0, 0 + bne _0805EDA0 +_0805ED96: + movs r0, 0 + b _0805EE1E + .align 2, 0 +_0805ED9C: .4byte gUnknown_8100208 +_0805EDA0: + adds r0, r7, 0 + adds r0, 0x44 + movs r1, 0x2 + bl sub_8044C94 + ldr r0, _0805EDC0 + ldrh r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0805EDC4 + adds r1, r7, 0 + adds r1, 0x48 + movs r0, 0 + b _0805EDCA + .align 2, 0 +_0805EDC0: .4byte gUnknown_20255F0 +_0805EDC4: + adds r1, r7, 0 + adds r1, 0x48 + movs r0, 0x1 +_0805EDCA: + strb r0, [r1] + ldrh r0, [r7] + movs r2, 0x80 + lsls r2, 8 + adds r5, r2, 0 + movs r4, 0 + orrs r0, r5 + strh r0, [r7] + adds r0, r6, 0 + adds r0, 0x44 + movs r1, 0x2 + bl sub_8044C94 + adds r0, r6, 0 + adds r0, 0x48 + strb r4, [r0] + mov r3, r9 + ldrb r0, [r3] + adds r0, 0x4 + movs r1, 0x7 + ands r0, r1 + adds r1, r6, 0 + adds r1, 0x46 + strb r0, [r1] + ldrh r0, [r6] + orrs r0, r5 + strh r0, [r6] + mov r0, r8 + ldrh r1, [r0, 0x4] + movs r2, 0xB6 + lsls r2, 1 + adds r0, r6, r2 + strh r1, [r0] + mov r3, r8 + ldrh r0, [r3, 0x6] + adds r2, 0x2 + adds r1, r6, r2 + strh r0, [r1] + ldr r0, _0805EE2C + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0xE] +_0805EE1E: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0805EE2C: .4byte gUnknown_203B418 + thumb_func_end sub_805EC4C + + thumb_func_start sub_805EE30 +sub_805EE30: + push {r4-r7,lr} + mov r7, r8 + push {r7} + bl sub_8083600 + adds r5, r0, 0 + cmp r5, 0 + bne _0805EE42 + b _0805EF52 +_0805EE42: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _0805EE4E + b _0805EF52 +_0805EE4E: + adds r0, r5, 0 + bl sub_8045128 + adds r4, r0, 0 + adds r0, r5, 0 + movs r1, 0xD + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _0805EE82 + ldr r0, [r5, 0x70] + adds r0, 0xE4 + ldrb r0, [r0] + cmp r0, 0x3 + beq _0805EE82 + adds r0, r5, 0 + movs r1, 0x9 + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + bne _0805EE82 + adds r0, r5, 0x4 + bl sub_804AE84 +_0805EE82: + ldrh r1, [r4] + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + cmp r0, 0 + beq _0805EE96 + ldr r0, _0805EEB0 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x1] +_0805EE96: + ldr r4, [r4, 0x14] + cmp r4, 0 + beq _0805EF52 + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0x5 + bhi _0805EF52 + lsls r0, 2 + ldr r1, _0805EEB4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0805EEB0: .4byte gUnknown_203B418 +_0805EEB4: .4byte _0805EEB8 + .align 2, 0 +_0805EEB8: + .4byte _0805EF52 + .4byte _0805EF52 + .4byte _0805EED0 + .4byte _0805EF2A + .4byte _0805EF52 + .4byte _0805EF52 +_0805EED0: + adds r0, r4, 0 + bl sub_8045104 + adds r6, r0, 0 + movs r0, 0 + mov r8, r0 + movs r7, 0 + adds r0, r5, 0 + movs r1, 0x13 + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _0805EF00 + adds r1, r4, 0 + adds r1, 0x20 + ldrb r0, [r1] + cmp r0, 0 + bne _0805EF00 + movs r0, 0x1 + strb r0, [r1] + bl sub_8049ED4 + movs r7, 0x1 +_0805EF00: + ldrb r0, [r6, 0x1] + cmp r0, 0 + beq _0805EF18 + cmp r0, 0x1 + beq _0805EF52 + cmp r0, 0x2 + bne _0805EF12 + movs r1, 0x1 + mov r8, r1 +_0805EF12: + mov r0, r8 + cmp r0, 0 + beq _0805EF52 +_0805EF18: + cmp r7, 0 + bne _0805EF52 + adds r1, r5, 0x4 + adds r0, r5, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_807FE9C + b _0805EF52 +_0805EF2A: + adds r0, r4, 0 + bl sub_8045108 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0805EF44 + adds r0, r5, 0x4 + movs r1, 0x1 + bl sub_8045DB4 + b _0805EF52 +_0805EF44: + ldr r0, _0805EF5C + ldr r0, [r0] + movs r1, 0xB8 + lsls r1, 3 + adds r0, r1 + movs r1, 0x4 + str r1, [r0] +_0805EF52: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0805EF5C: .4byte gUnknown_203B418 + thumb_func_end sub_805EE30 + + thumb_func_start sub_805EF60 +sub_805EF60: + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + bl sub_80696A8 + adds r4, r0, 0 + cmp r4, 0 + beq _0805EF9E + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0x1 + bne _0805EF9E + adds r0, r5, 0 + bl sub_8070BC0 + lsls r0, 24 + cmp r0, 0 + beq _0805EF9E + ldr r1, [r4, 0x70] + ldrb r0, [r1, 0x6] + cmp r0, 0 + beq _0805EFA2 + adds r0, r1, 0 + adds r0, 0xA4 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0805EFA2 + ldrb r0, [r1, 0x8] + cmp r0, 0x1 + beq _0805EFA2 +_0805EF9E: + movs r0, 0 + b _0805EFAE +_0805EFA2: + adds r0, r6, 0 + adds r0, 0x44 + movs r1, 0x13 + bl sub_8044C94 + movs r0, 0x1 +_0805EFAE: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_805EF60 + + thumb_func_start sub_805EFB4 +sub_805EFB4: + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r0 + lsls r1, 24 + lsrs r7, r1, 24 + bl sub_8083654 + adds r6, r0, 0 + cmp r7, 0 + beq _0805EFE2 + adds r0, 0xBC + ldrb r0, [r0] + cmp r0, 0x4 + bne _0805EFE2 + adds r0, r6, 0 + adds r0, 0x46 + ldrb r1, [r0] + adds r1, 0x4 + movs r2, 0x7 + ands r1, r2 + strb r1, [r0] + b _0805F020 +_0805EFE2: + adds r0, r6, 0 + adds r0, 0xBC + ldrb r0, [r0] + cmp r0, 0x2 + bne _0805F020 + movs r0, 0x8 + bl sub_8084100 + adds r4, r0, 0 + movs r5, 0 +_0805EFF6: + cmp r7, 0 + bne _0805F008 + mov r0, r8 + adds r1, r4, 0 + bl sub_8070D6C + lsls r0, 24 + cmp r0, 0 + beq _0805F014 +_0805F008: + movs r0, 0x7 + ands r4, r0 + adds r0, r6, 0 + adds r0, 0x46 + strb r4, [r0] + b _0805F020 +_0805F014: + adds r4, 0x1 + movs r0, 0x7 + ands r4, r0 + adds r5, 0x1 + cmp r5, 0x7 + ble _0805EFF6 +_0805F020: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_805EFB4 + + thumb_func_start sub_805F02C +sub_805F02C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + ldr r5, _0805F058 + ldr r0, [r5] + adds r0, 0xBC + ldr r7, [r0] + bl sub_8083600 + mov r9, r0 + ldr r0, [r7, 0x70] + mov r8, r0 + mov r1, r9 + ldr r4, [r1, 0x70] + ldrb r0, [r0, 0x7] + cmp r0, 0 + beq _0805F060 + ldr r0, _0805F05C + b _0805F08E + .align 2, 0 +_0805F058: .4byte gUnknown_203B418 +_0805F05C: .4byte gUnknown_80F9BD8 +_0805F060: + movs r0, 0x2 + bl sub_8047084 + lsls r0, 24 + cmp r0, 0 + bne _0805F076 + bl sub_807EF48 + lsls r0, 24 + cmp r0, 0 + beq _0805F080 +_0805F076: + ldr r0, _0805F07C + b _0805F08E + .align 2, 0 +_0805F07C: .4byte gUnknown_80F9C08 +_0805F080: + ldr r2, [r5] + ldr r3, _0805F098 + adds r0, r2, r3 + ldrb r1, [r0] + cmp r1, 0 + beq _0805F0A0 + ldr r0, _0805F09C +_0805F08E: + ldr r1, [r0] + adds r0, r7, 0 + bl sub_805239C + b _0805F184 + .align 2, 0 +_0805F098: .4byte 0x0000066e +_0805F09C: .4byte gUnknown_80F9C2C +_0805F0A0: + ldr r5, _0805F114 + adds r0, r2, r5 + strb r1, [r0] + movs r0, 0x1 + mov r2, r8 + strb r0, [r2, 0x7] + strb r1, [r4, 0x7] + movs r6, 0 + movs r3, 0x44 + add r3, r8 + mov r10, r3 + adds r5, r4, 0 + adds r5, 0x44 + str r5, [sp] + adds r2, 0x64 + str r2, [sp, 0x4] + adds r4, 0x64 + str r4, [sp, 0x8] + ldr r3, _0805F118 + movs r2, 0x1 +_0805F0C8: + movs r0, 0x64 + muls r0, r6 + ldr r1, _0805F11C + adds r0, r1 + ldr r1, [r3] + adds r4, r1, r0 + movs r5, 0 + ldrb r1, [r4] + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _0805F12A + movs r1, 0xA + ldrsh r0, [r4, r1] + str r2, [sp, 0xC] + str r3, [sp, 0x10] + bl sub_806A538 + lsls r0, 24 + ldr r2, [sp, 0xC] + ldr r3, [sp, 0x10] + cmp r0, 0 + bne _0805F102 + movs r5, 0xA + ldrsh r1, [r4, r5] + movs r0, 0x58 + muls r1, r0 + ldr r0, [r3] + adds r5, r0, r1 +_0805F102: + mov r0, r8 + ldrb r0, [r0, 0xA] + cmp r6, r0 + bne _0805F120 + strb r2, [r4, 0x2] + cmp r5, 0 + beq _0805F12A + strb r2, [r5, 0x2] + b _0805F12A + .align 2, 0 +_0805F114: .4byte 0x00000679 +_0805F118: .4byte gUnknown_203B45C +_0805F11C: .4byte 0x00008df8 +_0805F120: + movs r0, 0 + strb r0, [r4, 0x2] + cmp r5, 0 + beq _0805F12A + strb r0, [r5, 0x2] +_0805F12A: + adds r6, 0x1 + cmp r6, 0x3 + ble _0805F0C8 + ldr r0, _0805F194 + movs r4, 0 + str r4, [r0] + mov r1, r10 + ldr r0, [sp] + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + adds r0, r7, 0 + bl sub_803F508 + mov r0, r9 + bl sub_8041AD0 + bl sub_8083600 + bl sub_8041AE0 + ldr r0, _0805F198 + adds r1, r7, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _0805F19C + ldr r1, [r0] + adds r0, r7, 0 + bl sub_80522A8 + movs r0, 0 + bl sub_807EC28 + ldr r0, [sp, 0x4] + strb r4, [r0] + ldr r1, [sp, 0x8] + strb r4, [r1] + mov r0, r9 + bl sub_806A6E8 + adds r0, r7, 0 + bl sub_806A6E8 +_0805F184: + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0805F194: .4byte gUnknown_203B450 +_0805F198: .4byte gUnknown_202DF98 +_0805F19C: .4byte gUnknown_80F9BB0 + thumb_func_end sub_805F02C + + thumb_func_start sub_805F1A0 +sub_805F1A0: + push {lr} + bl sub_8083654 + adds r0, 0x44 + pop {r1} + bx r1 + thumb_func_end sub_805F1A0 + + thumb_func_start sub_805F1AC +sub_805F1AC: + push {lr} + bl sub_8083654 + adds r0, 0x44 + ldrh r0, [r0] + pop {r1} + bx r1 + thumb_func_end sub_805F1AC + + thumb_func_start sub_805F1BC +sub_805F1BC: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + lsls r0, 24 + lsls r1, 24 + lsrs r2, r1, 24 + lsrs r0, 24 + str r0, [sp, 0xC] + ldr r0, _0805F208 + ldr r1, [r0] + movs r0, 0xB8 + lsls r0, 3 + adds r1, r0 + ldr r3, [r1] + mov r10, r3 + movs r0, 0 + str r0, [sp, 0x10] + mvns r0, r3 + lsrs r0, 31 + str r0, [sp, 0x14] + movs r0, 0x1 + negs r0, r0 + str r0, [r1] + cmp r3, 0 + blt _0805F1F8 + mov r1, r10 + str r1, [sp, 0x10] +_0805F1F8: + cmp r2, 0 + beq _0805F23C + ldr r0, _0805F20C + movs r1, 0x80 + lsls r1, 1 + bl sub_800C074 + b _0805F240 + .align 2, 0 +_0805F208: .4byte gUnknown_203B418 +_0805F20C: .4byte 0x00000137 +_0805F210: + bl sub_8083600 + movs r1, 0x1 + bl sub_806675C + b _0805F226 +_0805F21C: + bl sub_8083600 + movs r1, 0x1 + bl sub_806684C +_0805F226: + movs r0, 0x1 + bl sub_8044C10 + movs r0, 0x50 + movs r1, 0x4D + bl sub_803E708 + movs r0, 0 + bl sub_8052210 + b _0805F92A +_0805F23C: + bl sub_8083D44 +_0805F240: + mov r2, r10 + cmp r2, 0 + bge _0805F2FA + movs r0, 0x1 + bl sub_8044C10 + ldr r0, _0805F388 + movs r1, 0x1 + negs r1, r1 + str r1, [r0] + ldr r0, [sp, 0xC] + bl sub_805F94C + bl sub_8083600 + movs r1, 0 + bl sub_806A2BC + ldr r4, _0805F38C + ldr r5, _0805F390 + adds r6, r4, 0 + adds r6, 0x2A +_0805F26C: + adds r0, r4, 0 + bl AddMenuCursorSprite + movs r0, 0x1D + bl sub_803E46C + ldrh r1, [r5, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0805F290 + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80136E0 +_0805F290: + ldrh r1, [r5, 0x4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0805F2A8 + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8013744 +_0805F2A8: + ldrh r1, [r5, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0805F2BC + adds r0, r4, 0 + adds r0, 0x29 + ldrb r0, [r0] + cmp r0, 0 + beq _0805F2D0 +_0805F2BC: + ldr r0, _0805F394 + movs r3, 0x18 + ldrsh r1, [r4, r3] + adds r1, 0x1 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0x7 + beq _0805F3A8 + bl sub_8083D30 +_0805F2D0: + ldrh r1, [r5, 0x2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0805F2E0 + ldrb r0, [r6] + cmp r0, 0 + beq _0805F26C +_0805F2E0: + bl sub_8083D30 + movs r0, 0x1 + negs r0, r0 +_0805F2E8: + str r0, [sp, 0x10] + ldr r0, _0805F38C + bl AddMenuCursorSprite + movs r0, 0x1D + bl sub_803E46C + movs r1, 0x1 + str r1, [sp, 0xC] +_0805F2FA: + ldr r2, [sp, 0x10] + mov r10, r2 + cmp r2, 0x1 + beq _0805F304 + b _0805F428 +_0805F304: + movs r0, 0x1 + bl sub_8044C10 + ldr r1, _0805F398 + ldr r0, [sp, 0x4] + ands r0, r1 + ldr r1, _0805F39C + ands r0, r1 + movs r1, 0x80 + lsls r1, 1 + orrs r0, r1 + ldr r1, _0805F3A0 + ands r0, r1 + ldr r1, _0805F3A4 + ands r0, r1 + str r0, [sp, 0x4] + bl sub_8083600 + add r1, sp, 0x4 + bl sub_805FD74 + lsls r0, 24 + cmp r0, 0 + beq _0805F33A + movs r3, 0x1 + negs r3, r3 + mov r10, r3 +_0805F33A: + add r0, sp, 0x4 + bl sub_805FD3C + lsls r0, 24 + cmp r0, 0 + beq _0805F35C + bl sub_8083600 + add r1, sp, 0x4 + bl sub_805FD74 + lsls r0, 24 + cmp r0, 0 + beq _0805F35C + movs r0, 0x1 + bl sub_8044C10 +_0805F35C: + bl sub_805F1AC + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xC + bne _0805F3B2 + bl sub_8083600 + movs r1, 0 + movs r2, 0xC + bl sub_8044D90 + ldrb r2, [r0] + movs r1, 0x4 + orrs r1, r2 + strb r1, [r0] + bl sub_805F1A0 + bl sub_8060D24 + b _0805F412 + .align 2, 0 +_0805F388: .4byte gUnknown_202F260 +_0805F38C: .4byte gUnknown_202EE10 +_0805F390: .4byte gUnknown_20255F0 +_0805F394: .4byte gUnknown_202749A +_0805F398: .4byte 0xffffff00 +_0805F39C: .4byte 0xffff00ff +_0805F3A0: .4byte 0xff00ffff +_0805F3A4: .4byte 0x00ffffff +_0805F3A8: + bl sub_8083D08 + movs r1, 0x18 + ldrsh r0, [r4, r1] + b _0805F2E8 +_0805F3B2: + cmp r0, 0x35 + bne _0805F3D0 + bl sub_8083600 + movs r1, 0 + movs r2, 0xD + bl sub_8044D90 + adds r4, r0, 0 + bl sub_8083600 + adds r1, r4, 0 + bl sub_8048A68 + b _0805F40A +_0805F3D0: + cmp r0, 0x10 + bne _0805F3EE + bl sub_8083600 + movs r1, 0 + movs r2, 0xE + bl sub_8044D90 + adds r4, r0, 0 + bl sub_8083600 + adds r1, r4, 0 + bl sub_8048950 + b _0805F40A +_0805F3EE: + cmp r0, 0x2C + bne _0805F41A + bl sub_8083600 + movs r1, 0 + movs r2, 0xF + bl sub_8044D90 + adds r4, r0, 0 + bl sub_8083600 + adds r1, r4, 0 + bl sub_8048B9C +_0805F40A: + lsls r0, 24 + cmp r0, 0 + beq _0805F412 + b _0805F72C +_0805F412: + movs r0, 0x1 + bl sub_8044C10 + b _0805F72C +_0805F41A: + cmp r0, 0x3C + bne _0805F420 + b _0805F210 +_0805F420: + cmp r0, 0x3D + bne _0805F426 + b _0805F21C +_0805F426: + b _0805F72C +_0805F428: + ldr r2, [sp, 0x10] + cmp r2, 0x2 + beq _0805F430 + b _0805F52E +_0805F430: + movs r0, 0x1 + bl sub_8044C10 + bl sub_8083600 + bl sub_8060E38 + lsls r0, 24 + cmp r0, 0 + beq _0805F44A + movs r3, 0x1 + negs r3, r3 + mov r10, r3 +_0805F44A: + bl sub_805F1AC + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1B + bne _0805F45E + bl sub_805F1A0 + movs r1, 0 + b _0805F4B2 +_0805F45E: + bl sub_805F1AC + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1C + bne _0805F474 + bl sub_805F1A0 + bl sub_806752C + b _0805F4B6 +_0805F474: + bl sub_805F1AC + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x34 + bne _0805F48A + bl sub_805F1A0 + bl sub_8067768 + b _0805F4B6 +_0805F48A: + bl sub_805F1AC + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1A + bne _0805F4A0 + bl sub_805F1A0 + bl sub_80615E8 + b _0805F4B6 +_0805F4A0: + bl sub_805F1AC + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x30 + bne _0805F4BE + bl sub_805F1A0 + movs r1, 0x1 +_0805F4B2: + bl sub_8061A38 +_0805F4B6: + movs r0, 0x1 + bl sub_8044C10 + b _0805F72C +_0805F4BE: + bl sub_805F1AC + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x19 + beq _0805F4CC + b _0805F72C +_0805F4CC: + bl sub_805F1A0 + bl sub_8062D8C + movs r6, 0 + movs r4, 0 +_0805F4D8: + ldr r0, _0805F518 + ldr r0, [r0] + lsls r1, r4, 2 + ldr r2, _0805F51C + adds r0, r2 + adds r0, r1 + ldr r5, [r0] + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0805F526 + bl sub_805F1A0 + ldrb r0, [r0, 0x4] + cmp r4, r0 + bne _0805F524 + ldr r0, _0805F520 + str r6, [r0] + bl sub_805F1AC + lsls r0, 16 + cmp r0, 0 + bne _0805F50C + b _0805F72C +_0805F50C: + adds r0, r5, 0 + movs r1, 0 + bl sub_806A2BC + b _0805F72C + .align 2, 0 +_0805F518: .4byte gUnknown_203B418 +_0805F51C: .4byte 0x0001357c +_0805F520: .4byte gUnknown_202F260 +_0805F524: + adds r6, 0x1 +_0805F526: + adds r4, 0x1 + cmp r4, 0x3 + ble _0805F4D8 + b _0805F72C +_0805F52E: + ldr r3, [sp, 0x10] + cmp r3, 0 + beq _0805F536 + b _0805F73A +_0805F536: + movs r7, 0 + movs r0, 0x1 + bl sub_8044C10 + movs r5, 0 + b _0805F544 +_0805F542: + adds r5, 0x1 +_0805F544: + cmp r5, 0x3 + bgt _0805F56C + ldr r0, _0805F600 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _0805F604 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0805F542 + ldr r0, [r4, 0x70] + ldrb r0, [r0, 0x7] + cmp r0, 0 + beq _0805F542 + adds r7, r5, 0 +_0805F56C: + movs r0, 0 + bl sub_8044C10 +_0805F572: + movs r6, 0 + mov r9, r6 + mov r8, r6 + movs r5, 0 +_0805F57A: + ldr r0, _0805F600 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r3, _0805F604 + adds r0, r3 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_8071A8C + lsls r0, 24 + cmp r0, 0 + beq _0805F5A0 + cmp r5, r7 + bne _0805F59C + mov r9, r8 + adds r6, r4, 0 +_0805F59C: + movs r0, 0x1 + add r8, r0 +_0805F5A0: + adds r5, 0x1 + cmp r5, 0x3 + ble _0805F57A + cmp r6, 0 + bne _0805F5B0 + bl sub_8083600 + adds r6, r0, 0 +_0805F5B0: + adds r0, r6, 0 + movs r1, 0 + bl sub_806A2BC + adds r0, r6, 0x4 + movs r1, 0 + movs r2, 0x1 + movs r3, 0x1 + bl sub_804A728 + bl sub_8083654 + adds r0, 0x48 + strb r7, [r0] + movs r0, 0 + bl sub_8044C10 + mov r1, r8 + str r1, [sp] + adds r0, r6, 0 + movs r1, 0 + movs r2, 0x1 + mov r3, r9 + bl sub_8062F90 + lsls r0, 24 + cmp r0, 0 + beq _0805F5EE + movs r2, 0x1 + negs r2, r2 + mov r10, r2 +_0805F5EE: + bl sub_805F1AC + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x6 + bne _0805F63C + adds r4, r7, 0 + movs r5, 0 + b _0805F60A + .align 2, 0 +_0805F600: .4byte gUnknown_203B418 +_0805F604: .4byte 0x0001357c +_0805F608: + adds r5, 0x1 +_0805F60A: + cmp r5, 0x3 + bgt _0805F676 + adds r7, 0x1 + cmp r7, 0x3 + ble _0805F616 + movs r7, 0 +_0805F616: + ldr r0, _0805F634 + ldr r0, [r0] + lsls r1, r7, 2 + ldr r3, _0805F638 + adds r0, r3 + adds r0, r1 + ldr r6, [r0] + adds r0, r6, 0 + bl sub_8071A8C + lsls r0, 24 + cmp r0, 0 + beq _0805F608 + b _0805F676 + .align 2, 0 +_0805F634: .4byte gUnknown_203B418 +_0805F638: .4byte 0x0001357c +_0805F63C: + bl sub_805F1AC + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x7 + bne _0805F694 + adds r4, r7, 0 + movs r5, 0 + b _0805F650 +_0805F64E: + adds r5, 0x1 +_0805F650: + cmp r5, 0x3 + bgt _0805F676 + subs r7, 0x1 + cmp r7, 0 + bge _0805F65C + movs r7, 0x3 +_0805F65C: + ldr r0, _0805F68C + ldr r0, [r0] + lsls r1, r7, 2 + ldr r2, _0805F690 + adds r0, r2 + adds r0, r1 + ldr r6, [r0] + adds r0, r6, 0 + bl sub_8071A8C + lsls r0, 24 + cmp r0, 0 + beq _0805F64E +_0805F676: + bl sub_8083654 + adds r0, 0x48 + strb r7, [r0] + cmp r4, r7 + bne _0805F684 + b _0805F572 +_0805F684: + movs r0, 0 + bl sub_8083CE0 + b _0805F572 + .align 2, 0 +_0805F68C: .4byte gUnknown_203B418 +_0805F690: .4byte 0x0001357c +_0805F694: + bl sub_805F1AC + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1D + bne _0805F6AA + bl sub_805F1A0 + bl sub_80637E8 + b _0805F56C +_0805F6AA: + bl sub_805F1AC + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1E + beq _0805F6C2 + bl sub_805F1AC + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x33 + bne _0805F6CE +_0805F6C2: + bl sub_805F1A0 + movs r1, 0 + bl sub_8063A70 + b _0805F56C +_0805F6CE: + bl sub_805F1AC + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1F + bne _0805F6E4 + bl sub_805F1A0 + bl sub_8063B54 + b _0805F56C +_0805F6E4: + bl sub_805F1AC + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x20 + bne _0805F6FA + bl sub_805F1A0 + bl sub_8063BB4 + b _0805F56C +_0805F6FA: + bl sub_805F1AC + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x21 + bne _0805F712 + bl sub_805F1A0 + movs r1, 0 + bl sub_8063CF0 + b _0805F56C +_0805F712: + bl sub_8083600 + movs r1, 0 + bl sub_806A2BC + bl sub_8083600 + adds r0, 0x4 + movs r1, 0 + movs r2, 0x1 + movs r3, 0x1 + bl sub_804A728 +_0805F72C: + bl sub_805F1AC + lsls r0, 16 + cmp r0, 0 + beq _0805F738 + b _0805F92A +_0805F738: + b _0805F904 +_0805F73A: + ldr r3, [sp, 0x10] + cmp r3, 0x4 + beq _0805F742 + b _0805F8E0 +_0805F742: + bl sub_8083600 + movs r1, 0x4 + ldrsh r2, [r0, r1] + movs r3, 0x6 + ldrsh r1, [r0, r3] + adds r0, r2, 0 + bl sub_804954C + ldr r4, [r0, 0x14] + cmp r4, 0 + bne _0805F75C + b _0805F88C +_0805F75C: + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0x3 + beq _0805F768 + b _0805F872 +_0805F768: + movs r0, 0x1 + bl sub_8044C10 + ldr r1, _0805F7F0 + ldr r0, [sp, 0x8] + ands r0, r1 + ldr r1, _0805F7F4 + ands r0, r1 + movs r1, 0x80 + lsls r1, 1 + orrs r0, r1 + ldr r1, _0805F7F8 + ands r0, r1 + movs r1, 0x80 + lsls r1, 9 + orrs r0, r1 + ldr r1, _0805F7FC + ands r0, r1 + adds r1, 0x1 + orrs r0, r1 + str r0, [sp, 0x8] + bl sub_8083600 + add r4, sp, 0x8 + adds r1, r4, 0 + bl sub_805FD74 + lsls r0, 24 + adds r0, r4, 0 + bl sub_805FD3C + lsls r0, 24 + cmp r0, 0 + beq _0805F7C2 + bl sub_8083600 + adds r1, r4, 0 + bl sub_805FD74 + lsls r0, 24 + cmp r0, 0 + beq _0805F7C2 + movs r0, 0x1 + bl sub_8044C10 +_0805F7C2: + bl sub_805F1AC + lsls r0, 16 + lsrs r0, 16 + adds r1, r0, 0 + cmp r0, 0xC + bne _0805F800 + bl sub_8083600 + movs r1, 0 + movs r2, 0x10 + bl sub_8044D90 + ldrb r2, [r0] + movs r1, 0x4 + orrs r1, r2 + strb r1, [r0] + bl sub_805F1A0 + bl sub_8060D24 + b _0805F840 + .align 2, 0 +_0805F7F0: .4byte 0xffffff00 +_0805F7F4: .4byte 0xffff00ff +_0805F7F8: .4byte 0xff00ffff +_0805F7FC: .4byte 0x00ffffff +_0805F800: + cmp r0, 0x35 + bne _0805F81E + bl sub_8083600 + movs r1, 0 + movs r2, 0x11 + bl sub_8044D90 + adds r4, r0, 0 + bl sub_8083600 + adds r1, r4, 0 + bl sub_8048A68 + b _0805F83A +_0805F81E: + cmp r0, 0x10 + bne _0805F848 + bl sub_8083600 + movs r1, 0 + movs r2, 0x12 + bl sub_8044D90 + adds r4, r0, 0 + bl sub_8083600 + adds r1, r4, 0 + bl sub_8048950 +_0805F83A: + lsls r0, 24 + cmp r0, 0 + bne _0805F8A8 +_0805F840: + movs r0, 0x1 + bl sub_8044C10 + b _0805F8A8 +_0805F848: + cmp r1, 0x2C + bne _0805F8A8 + bl sub_8083600 + movs r1, 0 + movs r2, 0x13 + bl sub_8044D90 + adds r4, r0, 0 + bl sub_8083600 + adds r1, r4, 0 + bl sub_8048B9C + lsls r0, 24 + cmp r0, 0 + bne _0805F8A8 + movs r0, 0x1 + bl sub_8044C10 + b _0805F8A8 +_0805F872: + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0x2 + bne _0805F8CE + movs r0, 0x1 + bl sub_8044C10 + bl sub_8083600 + bl sub_80643AC + b _0805F8A8 +_0805F88C: + ldrh r0, [r0] + movs r2, 0x80 + lsls r2, 2 + adds r1, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _0805F8B4 + movs r0, 0x1 + bl sub_8044C10 + bl sub_8083600 + bl sub_80647F0 +_0805F8A8: + bl sub_805F1AC + lsls r0, 16 + cmp r0, 0 + bne _0805F92A + b _0805F8CE +_0805F8B4: + bl sub_8083600 + adds r1, r0, 0 + ldr r0, _0805F8D8 + movs r2, 0 + bl sub_8045B94 + ldr r0, _0805F8DC + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 +_0805F8CE: + movs r3, 0x1 + negs r3, r3 + mov r10, r3 + b _0805F904 + .align 2, 0 +_0805F8D8: .4byte gUnknown_202DF98 +_0805F8DC: .4byte gUnknown_80FDE18 +_0805F8E0: + ldr r0, [sp, 0x10] + cmp r0, 0x3 + bne _0805F904 + bl sub_8064BE0 + ldr r0, _0805F91C + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _0805F92A + bl sub_805F1AC + lsls r0, 16 + cmp r0, 0 + bne _0805F92A + movs r1, 0x1 + negs r1, r1 + mov r10, r1 +_0805F904: + ldr r2, [sp, 0x10] + cmp r2, 0 + blt _0805F92A + ldr r3, [sp, 0x14] + cmp r3, 0 + bne _0805F920 + bl sub_80048D0 + bl sub_8004914 + b _0805F240 + .align 2, 0 +_0805F91C: .4byte gUnknown_203B418 +_0805F920: + bl sub_8083600 + movs r1, 0 + bl sub_806A2BC +_0805F92A: + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + bl sub_80048D0 + bl sub_8004914 + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_805F1BC + + thumb_func_start sub_805F94C +sub_805F94C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r5, r0, 24 + ldr r4, _0805F994 + movs r0, 0 + strh r0, [r4, 0x18] + movs r1, 0x5 + strh r1, [r4, 0x1A] + strh r1, [r4, 0x1C] + strh r0, [r4, 0x1E] + strh r0, [r4, 0x4] + movs r1, 0x2 + strh r1, [r4, 0x6] + strh r0, [r4, 0xC] + strh r0, [r4, 0xE] + str r0, [r4] + strh r0, [r4, 0x14] + adds r0, r4, 0 + adds r0, 0x28 + bl sub_801317C + adds r0, r4, 0 + movs r1, 0x38 + bl sub_80137B0 + cmp r5, 0 + beq _0805F998 + movs r0, 0x7 + movs r1, 0 + bl sub_803EAF0 + b _0805F9A0 + .align 2, 0 +_0805F994: .4byte gUnknown_202EE10 +_0805F998: + movs r0, 0x6 + movs r1, 0 + bl sub_803EAF0 +_0805F9A0: + movs r0, 0 + bl sub_80073B8 + bl sub_8083600 + movs r1, 0x1 + bl sub_8071518 + lsls r0, 24 + cmp r0, 0 + beq _0805F9CC + ldr r0, _0805F9C8 + movs r2, 0x2 + strb r2, [r0, 0x1] + strb r2, [r0, 0x2] + strb r2, [r0, 0x3] + movs r1, 0x7 + strb r1, [r0, 0x4] + strb r2, [r0, 0x5] + b _0805F9DA + .align 2, 0 +_0805F9C8: .4byte gUnknown_202749A +_0805F9CC: + ldr r1, _0805FBA0 + movs r0, 0x7 + strb r0, [r1, 0x1] + strb r0, [r1, 0x2] + strb r0, [r1, 0x3] + strb r0, [r1, 0x4] + strb r0, [r1, 0x5] +_0805F9DA: + ldr r4, _0805FBA4 + adds r0, r4, 0 + movs r1, 0 + bl sub_8013800 + adds r1, r0, 0 + ldr r0, _0805FBA8 + ldr r2, [r0] + movs r6, 0 + str r6, [sp] + movs r0, 0x8 + movs r3, 0 + bl xxx_call_draw_string + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8013800 + adds r1, r0, 0 + ldr r0, _0805FBAC + ldr r2, [r0] + str r6, [sp] + movs r0, 0x8 + movs r3, 0 + bl xxx_call_draw_string + adds r0, r4, 0 + movs r1, 0x2 + bl sub_8013800 + adds r1, r0, 0 + ldr r0, _0805FBB0 + ldr r2, [r0] + str r6, [sp] + movs r0, 0x8 + movs r3, 0 + bl xxx_call_draw_string + adds r0, r4, 0 + movs r1, 0x3 + bl sub_8013800 + adds r1, r0, 0 + ldr r0, _0805FBB4 + ldr r2, [r0] + str r6, [sp] + movs r0, 0x8 + movs r3, 0 + bl xxx_call_draw_string + adds r0, r4, 0 + movs r1, 0x4 + bl sub_8013800 + adds r1, r0, 0 + ldr r0, _0805FBB8 + ldr r2, [r0] + str r6, [sp] + movs r0, 0x8 + movs r3, 0 + bl xxx_call_draw_string + movs r0, 0 + bl sub_80073E0 + cmp r5, 0 + bne _0805FA62 + b _0805FB92 +_0805FA62: + bl sub_8083600 + ldr r7, [r0, 0x70] + bl sub_805317C + adds r5, r0, 0 + bl sub_8008ED0 + movs r4, 0x88 + subs r4, r0 + lsrs r0, r4, 31 + adds r4, r0 + asrs r4, 1 + movs r0, 0x1 + bl sub_80073B8 + str r6, [sp] + adds r0, r4, 0 + movs r1, 0x2 + adds r2, r5, 0 + movs r3, 0x1 + bl xxx_call_draw_string + movs r0, 0x1 + bl sub_80073E0 + movs r0, 0x2 + bl sub_80073B8 + ldr r0, _0805FBBC + ldr r0, [r0] + add r2, sp, 0x8 + add r3, sp, 0xC + add r1, sp, 0x4 + bl sub_8095014 + movs r1, 0x9E + lsls r1, 1 + adds r0, r7, r1 + ldr r0, [r0] + bl sub_8094450 + ldr r4, _0805FBC0 + str r0, [r4] + movs r2, 0xA0 + lsls r2, 1 + adds r0, r7, r2 + ldr r0, [r0] + bl sub_8094450 + str r0, [r4, 0x4] + ldr r0, _0805FBC4 + ldr r2, [r0] + str r6, [sp] + movs r0, 0x73 + movs r1, 0 + movs r3, 0x2 + bl sub_8014FF0 + ldr r0, _0805FBC8 + ldr r0, [r0] + movs r1, 0x98 + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [r4] + ldr r0, _0805FBCC + ldr r2, [r0] + str r6, [sp] + movs r0, 0x73 + movs r1, 0xC + movs r3, 0x2 + bl sub_8014FF0 + ldr r5, _0805FBD0 + movs r0, 0 + bl sub_807E580 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl sub_807EA18 + ldr r0, _0805FBD4 + ldr r2, [r0] + str r6, [sp] + movs r0, 0x73 + movs r1, 0x18 + movs r3, 0x2 + bl sub_8014FF0 + ldr r0, [sp, 0x4] + str r0, [r4] + ldr r0, [sp, 0x8] + str r0, [r4, 0x4] + ldr r0, [sp, 0xC] + str r0, [r4, 0x8] + ldr r0, _0805FBD8 + ldr r2, [r0] + str r6, [sp] + movs r0, 0x73 + movs r1, 0x24 + movs r3, 0x2 + bl sub_8014FF0 + movs r7, 0 + mov r8, r4 +_0805FB3A: + ldr r0, _0805FBDC + ldr r0, [r0] + lsls r1, r6, 2 + ldr r2, _0805FBE0 + adds r0, r2 + adds r0, r1 + ldr r5, [r0] + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0805FB86 + ldr r4, [r5, 0x70] + ldr r0, _0805FBD0 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + movs r1, 0xE + ldrsh r0, [r4, r1] + mov r2, r8 + str r0, [r2] + movs r1, 0x10 + ldrsh r0, [r4, r1] + str r0, [r2, 0x4] + ldr r0, _0805FBE4 + ldr r2, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0x4 + adds r1, r7, 0 + movs r3, 0x2 + bl sub_8014FF0 + adds r7, 0xC + cmp r7, 0x2F + bgt _0805FB8C +_0805FB86: + adds r6, 0x1 + cmp r6, 0x3 + ble _0805FB3A +_0805FB8C: + movs r0, 0x2 + bl sub_80073E0 +_0805FB92: + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0805FBA0: .4byte gUnknown_202749A +_0805FBA4: .4byte gUnknown_202EE10 +_0805FBA8: .4byte gUnknown_80FE988 +_0805FBAC: .4byte gUnknown_80FE998 +_0805FBB0: .4byte gUnknown_80FE9A8 +_0805FBB4: .4byte gUnknown_80FE9B8 +_0805FBB8: .4byte gUnknown_80FE9C8 +_0805FBBC: .4byte gUnknown_203B47C +_0805FBC0: .4byte gUnknown_202DE30 +_0805FBC4: .4byte gUnknown_80F9174 +_0805FBC8: .4byte gUnknown_203B460 +_0805FBCC: .4byte gUnknown_80F9190 +_0805FBD0: .4byte gUnknown_202DF98 +_0805FBD4: .4byte gUnknown_80F91A8 +_0805FBD8: .4byte gUnknown_80F91C8 +_0805FBDC: .4byte gUnknown_203B418 +_0805FBE0: .4byte 0x0001357c +_0805FBE4: .4byte gUnknown_80F91E0 + thumb_func_end sub_805F94C + + thumb_func_start sub_805FBE8 +sub_805FBE8: + push {r4,r5,lr} + adds r5, r0, 0 + movs r0, 0x8 + adds r1, r5, 0 + bl sub_803EAF0 +_0805FBF4: + movs r0, 0xE + bl sub_803E46C + bl sub_80144C4 + bl sub_8016080 + adds r4, r0, 0 + cmp r4, 0 + beq _0805FBF4 + bl sub_80160D8 + movs r0, 0xE + bl sub_803E46C + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + cmp r4, 0x3 + bne _0805FC28 + ldrb r0, [r5] + cmp r0, 0 + beq _0805FC28 + movs r0, 0x1 + b _0805FC2A +_0805FC28: + movs r0, 0 +_0805FC2A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_805FBE8 + + thumb_func_start sub_805FC30 +sub_805FC30: + push {r4-r6,lr} + sub sp, 0x78 + adds r4, r0, 0 + adds r6, r1, 0 + add r5, sp, 0x4 + adds r0, r5, 0 + movs r1, 0 + movs r2, 0x60 + bl memset + movs r3, 0x3 + str r3, [sp, 0x8] + str r3, [sp, 0x20] + movs r2, 0 + movs r0, 0x16 + strh r0, [r5, 0x20] + movs r1, 0x4 + strh r1, [r5, 0x22] + movs r0, 0x6 + strh r0, [r5, 0x24] + strh r1, [r5, 0x26] + strh r1, [r5, 0x28] + str r3, [sp, 0x38] + str r3, [sp, 0x50] + add r0, sp, 0x4 + ldm r4!, {r1,r3,r5} + stm r0!, {r1,r3,r5} + ldm r4!, {r1,r3,r5} + stm r0!, {r1,r3,r5} + add r1, sp, 0x4 + movs r0, 0x80 + strb r0, [r1] + ldr r4, _0805FD30 + strh r2, [r4, 0x18] + ldr r5, _0805FD34 + ldr r0, [r5] + strh r0, [r4, 0x1C] + strh r0, [r4, 0x1A] + strh r2, [r4, 0x1E] + strh r2, [r4, 0x20] + strh r2, [r4, 0x4] + strh r2, [r4, 0x6] + movs r0, 0x1 + str r0, [r4] + strh r2, [r4, 0xC] + strh r2, [r4, 0xE] + ldr r0, [r4, 0x8] + str r0, [r4, 0x14] + adds r0, r4, 0 + adds r0, 0x28 + bl sub_801317C + add r0, sp, 0x4 + strh r6, [r0, 0x20] + adds r1, r0, 0 + movs r0, 0x1C + subs r0, r6 + strh r0, [r1, 0x24] + movs r1, 0x1C + ldrsh r0, [r4, r1] + movs r1, 0 + bl sub_80095E4 + add r2, sp, 0x4 + adds r1, r2, 0 + strh r0, [r1, 0x28] + strh r0, [r2, 0x26] + adds r0, r1, 0 + movs r1, 0 + bl sub_803ECB4 + add r0, sp, 0x4 + movs r2, 0x26 + ldrsh r1, [r0, r2] + lsls r1, 3 + adds r0, r4, 0 + bl sub_80137B0 + movs r0, 0x1 + bl sub_80073B8 + movs r6, 0 + ldr r0, [r5] + cmp r6, r0 + bge _0805FD20 + add r5, sp, 0x64 +_0805FCDC: + adds r0, r6, 0 + bl sub_8044F3C + lsls r0, 24 + movs r4, 0x2 + cmp r0, 0 + beq _0805FCEC + movs r4, 0x7 +_0805FCEC: + adds r0, r6, 0 + bl sub_8044EC8 + adds r3, r0, 0 + adds r0, r5, 0 + ldr r1, _0805FD38 + adds r2, r4, 0 + bl sub_800D158 + ldr r0, _0805FD30 + adds r1, r6, 0 + bl sub_8013800 + adds r1, r0, 0 + movs r0, 0 + str r0, [sp] + movs r0, 0x8 + adds r2, r5, 0 + movs r3, 0x1 + bl xxx_call_draw_string + adds r6, 0x1 + ldr r0, _0805FD34 + ldr r0, [r0] + cmp r6, r0 + blt _0805FCDC +_0805FD20: + movs r0, 0x1 + bl sub_80073E0 + add sp, 0x78 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0805FD30: .4byte gUnknown_202EE10 +_0805FD34: .4byte gUnknown_202EE6C +_0805FD38: .4byte gUnknown_8106B50 + thumb_func_end sub_805FC30 + + thumb_func_start sub_805FD3C +sub_805FD3C: + push {r4,lr} + adds r4, r0, 0 + bl sub_805F1AC + lsls r0, 16 + lsrs r0, 16 + adds r2, r0, 0 + movs r1, 0 + strb r1, [r4] + strb r1, [r4, 0x1] + strb r1, [r4, 0x2] + strb r1, [r4, 0x3] + cmp r2, 0xA + bne _0805FD5E + movs r0, 0x1 + strb r0, [r4] + strb r0, [r4, 0x3] +_0805FD5E: + cmp r2, 0x3E + bne _0805FD6A + movs r0, 0x1 + strb r0, [r4] + strb r1, [r4, 0x1] + strb r0, [r4, 0x3] +_0805FD6A: + ldrb r0, [r4] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_805FD3C + + thumb_func_start sub_805FD74 +sub_805FD74: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xE4 + mov r10, r0 + adds r7, r1, 0 + movs r0, 0 + mov r9, r0 + movs r1, 0x1 + str r1, [sp, 0xD0] + movs r2, 0 + str r2, [sp, 0xD4] + movs r5, 0 + str r5, [sp, 0xD8] + str r0, [sp, 0xDC] + mov r1, r10 + ldr r1, [r1, 0x70] + str r1, [sp, 0xE0] + add r4, sp, 0x68 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x60 + bl memset + movs r0, 0x6 + str r0, [sp, 0x6C] + add r0, sp, 0x70 + movs r6, 0 + movs r1, 0x2 + strh r1, [r0] + strh r1, [r0, 0x2] + add r1, sp, 0x74 + movs r0, 0x12 + strh r0, [r1] + mov r0, sp + adds r0, 0x76 + movs r1, 0x10 + strh r1, [r0] + add r0, sp, 0x78 + strh r1, [r0] + add r5, sp, 0xC8 + str r5, [sp, 0x7C] + movs r1, 0x3 + str r1, [sp, 0x84] + add r0, sp, 0x98 + str r1, [r0, 0x4] + add r0, sp, 0xB0 + str r1, [r0, 0x4] + add r0, sp, 0x8 + adds r1, r4, 0 + movs r2, 0x60 + bl memcpy + ldr r0, _0805FE40 + strb r6, [r0] + mov r2, r9 + strh r2, [r0, 0x4] + strh r2, [r0, 0x6] + cmp r7, 0 + beq _0805FE18 + ldrb r1, [r7] + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + str r0, [sp, 0xD8] + ldrb r1, [r7, 0x1] + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + str r0, [sp, 0xD0] + ldrb r1, [r7, 0x2] + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + str r0, [sp, 0xD4] + ldrb r1, [r7, 0x3] + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + str r0, [sp, 0xDC] +_0805FE18: + ldr r0, _0805FE44 + mov r5, r10 + str r5, [sp] + ldr r1, [sp, 0xD4] + ldr r2, [sp, 0xD0] + ldr r3, [sp, 0xDC] + bl sub_8060D64 + ldr r1, _0805FE48 + str r0, [r1] + cmp r0, 0 + bne _0805FEA6 + ldr r0, _0805FE4C + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 + movs r0, 0x1 + b _080603BE + .align 2, 0 +_0805FE40: .4byte gUnknown_202F238 +_0805FE44: .4byte gUnknown_202F248 +_0805FE48: .4byte gUnknown_202F258 +_0805FE4C: .4byte gUnknown_80F8B24 +_0805FE50: + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + movs r0, 0x1 + mov r9, r0 + b _0806039C +_0805FE5E: + ldr r0, [sp, 0xE0] + adds r0, 0x44 + movs r1, 0xC + bl sub_8044C94 + ldr r0, _0805FE78 + ldr r1, [r0, 0x4] + ldr r0, [r0] + ldr r2, [sp, 0xE0] + str r0, [r2, 0x48] + str r1, [r2, 0x4C] + b _0805FE88 + .align 2, 0 +_0805FE78: .4byte gUnknown_202F238 +_0805FE7C: + ldr r0, _0805FE98 + ldr r1, [r0, 0x4] + ldr r0, [r0] + ldr r2, [sp, 0xE0] + str r0, [r2, 0x50] + str r1, [r2, 0x54] +_0805FE88: + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + movs r5, 0 + mov r9, r5 + b _0806039C + .align 2, 0 +_0805FE98: .4byte gUnknown_202F238 +_0805FE9C: + ldr r1, [r1] + ldr r0, [sp, 0xE0] + adds r0, 0x50 + strb r1, [r0] + b _0806033C +_0805FEA6: + movs r1, 0 + mov r8, r1 + ldr r0, _0805FFA8 + mov r2, r9 + str r2, [r0] +_0805FEB0: + movs r5, 0 + mov r9, r5 + movs r4, 0 + ldr r6, _0805FFAC +_0805FEB8: + lsls r1, r4, 2 + ldr r0, [r6] + adds r2, r0, r1 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0805FEEC + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0805FEEC + movs r0, 0xFB + ands r0, r1 + strb r0, [r2] + adds r0, r4, 0 + movs r1, 0xA + bl __divsi3 + mov r8, r0 + adds r0, r4, 0 + movs r1, 0xA + bl __modsi3 + ldr r1, _0805FFA8 + str r0, [r1] +_0805FEEC: + adds r4, 0x1 + cmp r4, 0x13 + ble _0805FEB8 + movs r6, 0 +_0805FEF4: + ldr r0, _0805FFB0 + ldr r0, [r0] + lsls r1, r6, 2 + ldr r2, _0805FFB4 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + adds r5, r6, 0x1 + mov r12, r5 + cmp r0, 0 + beq _0805FF66 + ldr r0, [r4, 0x70] + adds r2, r0, 0 + adds r2, 0x60 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0805FF66 + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0805FF66 + movs r0, 0xFB + ands r0, r1 + strb r0, [r2] + movs r4, 0 + ldr r0, _0805FFB8 + ldr r1, [r0] + adds r5, r0, 0 + ldr r7, _0805FFA8 + cmp r4, r1 + bge _0805FF62 + ldr r0, _0805FFBC + movs r2, 0 + ldrsh r1, [r0, r2] + adds r3, r0, 0 + adds r2, r6, 0x4 + cmp r1, r2 + beq _0805FF60 +_0805FF4C: + adds r4, 0x1 + ldr r0, [r5] + cmp r4, r0 + bge _0805FF62 + lsls r0, r4, 1 + adds r0, r3 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, r2 + bne _0805FF4C +_0805FF60: + mov r8, r4 +_0805FF62: + movs r0, 0 + str r0, [r7] +_0805FF66: + mov r6, r12 + cmp r6, 0x3 + ble _0805FEF4 + add r2, sp, 0x8 + str r2, [sp] + add r5, sp, 0xC8 + str r5, [sp, 0x4] + mov r0, r8 + mov r1, r10 + ldr r2, [sp, 0xD8] + ldr r3, [sp, 0xD4] + bl sub_80603D8 + ldr r1, _0805FFBC + ldr r0, _0805FFC0 + movs r2, 0x1E + ldrsh r0, [r0, r2] + lsls r0, 1 + adds r0, r1 + movs r5, 0 + ldrsh r2, [r0, r5] + cmp r2, 0x3 + ble _0805FFE6 + ldr r0, _0805FFB0 + ldr r1, [r0] + subs r0, r2, 0x4 + lsls r0, 2 + ldr r2, _0805FFB4 + adds r1, r2 + adds r1, r0 + ldr r4, [r1] + b _0805FFE8 + .align 2, 0 +_0805FFA8: .4byte gUnknown_202F240 +_0805FFAC: .4byte gUnknown_203B460 +_0805FFB0: .4byte gUnknown_203B418 +_0805FFB4: .4byte 0x0001357c +_0805FFB8: .4byte gUnknown_202F258 +_0805FFBC: .4byte gUnknown_202F248 +_0805FFC0: .4byte gUnknown_202EE10 +_0805FFC4: + bl sub_8083D44 + mov r0, r10 + adds r0, 0x4 + bl sub_8060890 + movs r5, 0x3 + mov r9, r5 + b _08060200 +_0805FFD6: + bl sub_8083D08 + ldr r0, [sp, 0xE0] + adds r0, 0x44 + bl sub_8060CE8 + movs r0, 0 + b _080602F0 +_0805FFE6: + mov r4, r10 +_0805FFE8: + adds r0, r4, 0 + movs r1, 0 + bl sub_806A2BC + adds r0, r4, 0x4 + movs r1, 0 + movs r2, 0x1 + movs r3, 0x1 + bl sub_804A728 + ldr r6, _08060050 + adds r7, r6, 0 + adds r7, 0x2B +_08060002: + adds r0, r6, 0 + bl AddMenuCursorSprite + movs r0, 0x14 + bl sub_803E46C + ldr r1, [sp, 0xD4] + cmp r1, 0 + beq _08060016 + b _080601F4 +_08060016: + ldr r4, _08060054 + ldr r0, [r4] + cmp r0, 0x1 + ble _0806008C + ldr r0, _08060058 + ldrh r1, [r0, 0x2] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _08060034 + adds r0, r6, 0 + adds r0, 0x2C + ldrb r0, [r0] + cmp r0, 0 + beq _0806005C +_08060034: + movs r0, 0 + bl sub_8083CE0 + movs r2, 0x1 + negs r2, r2 + add r8, r2 + mov r5, r8 + cmp r5, 0 + bge _0806007E + ldr r0, [r4] + subs r0, 0x1 + mov r8, r0 + b _0806007E + .align 2, 0 +_08060050: .4byte gUnknown_202EE10 +_08060054: .4byte gUnknown_202F258 +_08060058: .4byte gUnknown_20255F0 +_0806005C: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _0806006A + ldrb r0, [r7] + cmp r0, 0 + beq _0806008C +_0806006A: + movs r0, 0 + bl sub_8083CE0 + movs r2, 0x1 + add r8, r2 + ldr r0, [r4] + cmp r8, r0 + bne _0806007E + movs r5, 0 + mov r8, r5 +_0806007E: + ldr r0, [sp, 0xD4] + ldr r1, _08060088 + str r0, [r1] + b _08060200 + .align 2, 0 +_08060088: .4byte gUnknown_202F240 +_0806008C: + ldr r0, _08060134 + ldrh r1, [r0, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080600B2 + mov r0, r8 + bl sub_8060860 + lsls r0, 24 + cmp r0, 0 + beq _080600B2 + movs r0, 0x1 + bl sub_8083CE0 + ldr r0, _08060138 + movs r1, 0x1 + bl sub_80136E0 +_080600B2: + ldr r0, _08060134 + ldrh r1, [r0, 0x4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080600D8 + mov r0, r8 + bl sub_8060860 + lsls r0, 24 + cmp r0, 0 + beq _080600D8 + movs r0, 0x1 + bl sub_8083CE0 + ldr r0, _08060138 + movs r1, 0x1 + bl sub_8013744 +_080600D8: + ldr r0, _08060134 + ldrh r2, [r0, 0x2] + movs r1, 0x4 + ands r1, r2 + adds r2, r0, 0 + cmp r1, 0 + beq _080601A0 + ldr r4, _0806013C + mov r5, r8 + lsls r0, r5, 1 + adds r0, r4 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x1 + bgt _080601A0 + movs r7, 0x1 + movs r0, 0x99 + lsls r0, 1 + bl sub_8083E38 + bl sub_8047158 + bl sub_80912C8 + movs r0, 0 + ldr r2, _08060140 + str r0, [r2] + mov r5, r10 + str r5, [sp] + add r0, sp, 0x68 + ldr r1, [sp, 0xD4] + ldr r2, [sp, 0xD0] + ldr r3, [sp, 0xDC] + bl sub_8060D64 + adds r3, r0, 0 + ldr r0, _08060144 + ldr r0, [r0] + cmp r0, r3 + bne _08060164 + movs r6, 0 + cmp r6, r3 + bge _0806015E + add r2, sp, 0x68 + b _08060152 + .align 2, 0 +_08060134: .4byte gUnknown_20255F0 +_08060138: .4byte gUnknown_202EE10 +_0806013C: .4byte gUnknown_202F248 +_08060140: .4byte gUnknown_202F240 +_08060144: .4byte gUnknown_202F258 +_08060148: + adds r4, 0x2 + adds r2, 0x2 + adds r6, 0x1 + cmp r6, r3 + bge _0806015E +_08060152: + movs r0, 0 + ldrsh r1, [r2, r0] + movs r5, 0 + ldrsh r0, [r4, r5] + cmp r1, r0 + beq _08060148 +_0806015E: + cmp r6, r3 + bne _08060164 + movs r7, 0 +_08060164: + cmp r7, 0 + beq _08060200 + movs r0, 0 + mov r8, r0 + ldr r1, _08060194 + str r0, [r1] + ldr r0, _08060198 + str r3, [r0] + movs r6, 0 + adds r5, r0, 0 + cmp r6, r3 + bge _08060200 + adds r3, r5, 0 + add r1, sp, 0x68 + ldr r2, _0806019C +_08060182: + ldrh r0, [r1] + strh r0, [r2] + adds r1, 0x2 + adds r2, 0x2 + adds r6, 0x1 + ldr r0, [r3] + cmp r6, r0 + blt _08060182 + b _08060200 + .align 2, 0 +_08060194: .4byte gUnknown_202F240 +_08060198: .4byte gUnknown_202F258 +_0806019C: .4byte gUnknown_202F248 +_080601A0: + ldrh r1, [r2, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080601B6 + ldr r2, _080601C8 + adds r0, r2, 0 + adds r0, 0x29 + ldrb r0, [r0] + cmp r0, 0 + beq _080601CC +_080601B6: + bl sub_8083D08 + mov r0, r10 + adds r0, 0x4 + bl sub_8060890 + movs r2, 0x1 + mov r9, r2 + b _08060200 + .align 2, 0 +_080601C8: .4byte gUnknown_202EE10 +_080601CC: + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080601D6 + b _0805FFC4 +_080601D6: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080601EA + adds r0, r2, 0 + adds r0, 0x2A + ldrb r0, [r0] + cmp r0, 0 + bne _080601EA + b _08060002 +_080601EA: + bl sub_8083D30 + movs r5, 0x2 + mov r9, r5 + b _08060200 +_080601F4: + mov r0, r10 + adds r0, 0x4 + bl sub_8060890 + movs r0, 0x1 + mov r9, r0 +_08060200: + ldr r4, _0806034C + adds r0, r4, 0 + bl AddMenuCursorSprite + movs r0, 0x14 + bl sub_803E46C + ldr r1, _08060350 + movs r2, 0x1E + ldrsh r0, [r4, r2] + lsls r0, 1 + adds r0, r1 + movs r5, 0 + ldrsh r0, [r0, r5] + cmp r0, 0x1 + bgt _08060232 + ldr r0, _08060354 + ldr r0, [r0] + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08060232 + movs r0, 0x2 + mov r9, r0 +_08060232: + mov r1, r9 + cmp r1, 0x2 + bne _0806023A + b _0805FE50 +_0806023A: + cmp r1, 0 + bne _08060240 + b _0805FEB0 +_08060240: + cmp r1, 0x3 + bne _08060246 + b _0805FE5E +_08060246: + ldr r4, _0806034C + movs r2, 0x18 + ldrsh r0, [r4, r2] + ldr r5, _08060358 + str r0, [r5] + ldr r0, [sp, 0xD8] + cmp r0, 0 + beq _08060258 + b _0805FE7C +_08060258: + mov r0, r10 + bl sub_8060900 + movs r2, 0x1E + ldrsh r1, [r4, r2] + add r0, sp, 0xC8 + bl sub_8060800 + add r0, sp, 0x8 + movs r1, 0x16 + bl sub_805FC30 + ldr r6, _0806035C + adds r7, r4, 0 + adds r7, 0x2A +_08060276: + adds r0, r4, 0 + bl AddMenuCursorSprite + movs r0, 0x14 + bl sub_803E46C + ldrh r1, [r6, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0806029A + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80136E0 +_0806029A: + ldrh r1, [r6, 0x4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080602B2 + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8013744 +_080602B2: + ldrh r1, [r6, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080602C6 + adds r0, r4, 0 + adds r0, 0x29 + ldrb r0, [r0] + cmp r0, 0 + beq _080602DA +_080602C6: + movs r5, 0x18 + ldrsh r0, [r4, r5] + bl sub_8044F3C + lsls r0, 24 + cmp r0, 0 + beq _080602D6 + b _0805FFD6 +_080602D6: + bl sub_8083D30 +_080602DA: + ldrh r1, [r6, 0x2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080602EA + ldrb r0, [r7] + cmp r0, 0 + beq _08060276 +_080602EA: + bl sub_8083D30 + movs r0, 0x1 +_080602F0: + mov r9, r0 + ldr r0, _0806034C + bl AddMenuCursorSprite + movs r0, 0x14 + bl sub_803E46C + ldr r0, _08060360 + ldr r0, [r0] + ldr r1, _08060364 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + mov r2, r9 + cmp r2, 0x1 + bne _08060318 + ldr r5, [sp, 0xD4] + cmp r5, 0 + bne _08060318 + b _0805FEB0 +_08060318: + ldr r0, [sp, 0xE0] + adds r0, 0x44 + ldrh r1, [r0] + adds r0, r1, 0 + subs r0, 0x37 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bls _08060330 + adds r0, r1, 0 + cmp r0, 0x3E + bne _0806036C +_08060330: + ldr r0, _08060368 + ldrb r0, [r0] + subs r0, 0x90 + ldr r1, [sp, 0xE0] + adds r1, 0x48 + strb r0, [r1] +_0806033C: + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + movs r0, 0 + mov r9, r0 + b _0806039C + .align 2, 0 +_0806034C: .4byte gUnknown_202EE10 +_08060350: .4byte gUnknown_202F248 +_08060354: .4byte gUnknown_203B460 +_08060358: .4byte gUnknown_202F240 +_0806035C: .4byte gUnknown_20255F0 +_08060360: .4byte gUnknown_203B418 +_08060364: .4byte 0x00018212 +_08060368: .4byte gUnknown_202F238 +_0806036C: + cmp r0, 0x36 + bne _08060390 + add r0, sp, 0xCC + movs r1, 0x2 + bl sub_8062978 + add r1, sp, 0xCC + cmp r0, 0 + beq _08060380 + b _0805FE9C +_08060380: + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + movs r0, 0x1 + bl sub_8044C10 + b _0805FEB0 +_08060390: + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + movs r1, 0 + mov r9, r1 +_0806039C: + ldr r0, _080603D0 + ldr r0, [r0] + ldr r2, _080603D4 + adds r0, r2 + movs r1, 0 + strb r1, [r0] + movs r0, 0x2 + movs r1, 0x61 + bl sub_803E708 + bl sub_804AA60 + movs r0, 0x2 + movs r1, 0x61 + bl sub_803E708 + mov r0, r9 +_080603BE: + add sp, 0xE4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080603D0: .4byte gUnknown_203B418 +_080603D4: .4byte 0x00018212 + thumb_func_end sub_805FD74 + + thumb_func_start sub_80603D8 +sub_80603D8: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x78 + adds r7, r0, 0 + mov r9, r1 + ldr r6, [sp, 0x98] + ldr r0, [sp, 0x9C] + mov r8, r0 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x6C] + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x70] + add r1, sp, 0x4 + ldr r0, _08060478 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + mov r0, r9 + ldr r0, [r0, 0x70] + str r0, [sp, 0x74] + mov r0, r8 + adds r1, r7, 0 + bl sub_8060800 + mov r10, r0 + ldr r5, _0806047C + ldr r0, _08060480 + ldr r0, [r0] + movs r4, 0 + movs r1, 0 + strh r0, [r5, 0x18] + strh r1, [r5, 0x1A] + strh r7, [r5, 0x1E] + ldr r0, _08060484 + ldr r0, [r0] + strh r0, [r5, 0x20] + strh r1, [r5, 0x4] + str r1, [r5] + strh r1, [r5, 0x14] + adds r0, r5, 0 + adds r0, 0x28 + bl sub_801317C + ldr r3, _08060488 + ldr r0, [r3] + ldr r2, _0806048C + adds r0, r2 + strb r4, [r0] + ldr r1, _08060490 + lsls r0, r7, 1 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x2 + beq _08060494 + cmp r0, 0x2 + bgt _080604AA + cmp r0, 0 + blt _080604AA + movs r1, 0x10 + strh r1, [r6, 0x10] + strh r1, [r6, 0xE] + movs r0, 0xC + mov r4, r8 + strb r0, [r4, 0x2] + strh r1, [r5, 0x6] + movs r0, 0xA + strh r0, [r5, 0x1C] + ldr r0, [r3] + adds r0, r2 + movs r1, 0x1 + strb r1, [r0] + b _080604C0 + .align 2, 0 +_08060478: .4byte gUnknown_8106B6C +_0806047C: .4byte gUnknown_202EE10 +_08060480: .4byte gUnknown_202F240 +_08060484: .4byte gUnknown_202F258 +_08060488: .4byte gUnknown_203B418 +_0806048C: .4byte 0x00018212 +_08060490: .4byte gUnknown_202F248 +_08060494: + movs r0, 0x4 + strh r0, [r6, 0x10] + strh r0, [r6, 0xE] + movs r0, 0x6 + mov r1, r8 + strb r0, [r1, 0x2] + movs r0, 0x12 + strh r0, [r5, 0x6] + movs r0, 0x1 + strh r0, [r5, 0x1C] + b _080604C0 +_080604AA: + movs r0, 0x4 + strh r0, [r6, 0x10] + strh r0, [r6, 0xE] + movs r0, 0xC + mov r2, r8 + strb r0, [r2, 0x2] + ldr r1, _080604DC + movs r0, 0x12 + strh r0, [r1, 0x6] + movs r0, 0x1 + strh r0, [r1, 0x1C] +_080604C0: + ldr r3, [sp, 0x6C] + cmp r3, 0 + beq _080604E0 + ldr r1, _080604DC + ldrh r0, [r1, 0xC] + adds r0, 0x40 + strh r0, [r1, 0xC] + movs r0, 0xA + strh r0, [r6, 0x8] + adds r1, r6, 0 + adds r1, 0x18 + add r0, sp, 0x4 + b _080604EC + .align 2, 0 +_080604DC: .4byte gUnknown_202EE10 +_080604E0: + movs r0, 0x2 + strh r0, [r6, 0x8] + adds r1, r6, 0 + adds r1, 0x18 + adds r0, r6, 0 + adds r0, 0x48 +_080604EC: + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + adds r0, r6, 0 + movs r1, 0x1 + bl sub_803ECB4 + ldr r1, _0806054C + ldr r5, _08060550 + movs r4, 0 + ldrsh r0, [r1, r4] + adds r0, 0x10 + lsls r0, 3 + movs r2, 0 + mov r8, r2 + strh r0, [r5, 0xC] + movs r3, 0x2 + ldrsh r0, [r1, r3] + adds r0, 0x1 + lsls r0, 3 + subs r0, 0x2 + strh r0, [r5, 0xE] + adds r0, r5, 0 + movs r1, 0x70 + bl sub_80137B0 + movs r0, 0 + bl sub_80073B8 + mov r4, r10 + subs r0, r7, r4 + lsls r0, 3 + adds r6, r0, 0 + adds r6, 0xC + ldr r0, _08060554 + lsls r1, r7, 1 + adds r0, r1, r0 + movs r2, 0 + ldrsh r0, [r0, r2] + adds r2, r1, 0 + cmp r0, 0x1 + beq _080605CC + cmp r0, 0x1 + bgt _08060558 + cmp r0, 0 + beq _08060564 + b _08060718 + .align 2, 0 +_0806054C: .4byte gUnknown_2027370 +_08060550: .4byte gUnknown_202EE10 +_08060554: .4byte gUnknown_202F248 +_08060558: + cmp r0, 0x2 + beq _0806063C + cmp r0, 0x3 + bne _08060562 + b _080606B0 +_08060562: + b _08060718 +_08060564: + ldr r0, _080605C0 + ldr r2, [r0] + mov r3, r8 + str r3, [sp] + adds r0, r6, 0 + movs r1, 0 + movs r3, 0 + bl sub_8014FF0 + movs r4, 0 + adds r6, r5, 0 + movs r7, 0 + add r5, sp, 0x1C +_0806057E: + lsls r1, r4, 2 + ldr r0, _080605C4 + ldr r0, [r0] + adds r2, r1, r0 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08060592 + b _08060794 +_08060592: + ldrh r0, [r6, 0x1A] + adds r0, 0x1 + strh r0, [r6, 0x1A] + adds r0, r5, 0 + adds r1, r2, 0 + ldr r2, _080605C8 + bl sub_8090E14 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_8013800 + adds r1, r0, 0 + str r7, [sp] + movs r0, 0x8 + adds r2, r5, 0 + movs r3, 0 + bl sub_8014FF0 + adds r4, 0x1 + cmp r4, 0x9 + ble _0806057E + b _08060794 + .align 2, 0 +_080605C0: .4byte gUnknown_80FE90C +_080605C4: .4byte gUnknown_203B460 +_080605C8: .4byte gUnknown_8106B60 +_080605CC: + ldr r0, _08060630 + ldr r2, [r0] + mov r4, r8 + str r4, [sp] + adds r0, r6, 0 + movs r1, 0 + movs r3, 0 + bl sub_8014FF0 + movs r4, 0 + adds r6, r5, 0 + movs r7, 0 + add r5, sp, 0x1C +_080605E6: + lsls r3, r4, 2 + ldr r0, _08060634 + ldr r2, [r0] + adds r0, r3, r2 + adds r0, 0x28 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080605FC + b _08060794 +_080605FC: + ldrh r0, [r6, 0x1A] + adds r0, 0x1 + strh r0, [r6, 0x1A] + adds r1, r3, 0 + adds r1, 0x28 + adds r1, r2, r1 + adds r0, r5, 0 + ldr r2, _08060638 + bl sub_8090E14 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_8013800 + adds r1, r0, 0 + str r7, [sp] + movs r0, 0x8 + adds r2, r5, 0 + movs r3, 0 + bl sub_8014FF0 + adds r4, 0x1 + cmp r4, 0x9 + ble _080605E6 + b _08060794 + .align 2, 0 +_08060630: .4byte gUnknown_80FE920 +_08060634: .4byte gUnknown_203B460 +_08060638: .4byte gUnknown_8106B60 +_0806063C: + mov r1, r9 + movs r2, 0x4 + ldrsh r0, [r1, r2] + movs r3, 0x6 + ldrsh r1, [r1, r3] + bl sub_804954C + ldr r0, [r0, 0x14] + bl sub_8045108 + adds r7, r0, 0 + ldr r0, _080606A8 + ldr r2, [r0] + mov r4, r8 + str r4, [sp] + adds r0, r6, 0 + movs r1, 0 + movs r3, 0 + bl sub_8014FF0 + ldrb r1, [r7] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08060698 + ldrh r0, [r5, 0x1A] + adds r0, 0x1 + strh r0, [r5, 0x1A] + add r4, sp, 0x1C + ldr r2, _080606AC + adds r0, r4, 0 + adds r1, r7, 0 + bl sub_8090E14 + adds r0, r5, 0 + movs r1, 0 + bl sub_8013800 + adds r1, r0, 0 + mov r0, r8 + str r0, [sp] + movs r0, 0x8 + adds r2, r4, 0 + movs r3, 0 + bl sub_8014FF0 +_08060698: + ldr r1, [sp, 0x70] + cmp r1, 0 + beq _08060794 + mov r2, r8 + strh r2, [r5, 0xA] + strh r2, [r5, 0x8] + b _08060794 + .align 2, 0 +_080606A8: .4byte gUnknown_80FE92C +_080606AC: .4byte gUnknown_8106B60 +_080606B0: + mov r3, r9 + ldr r0, [r3, 0x70] + adds r7, r0, 0 + adds r7, 0x60 + ldr r0, _0806070C + ldr r1, [sp, 0x74] + movs r2, 0 + bl sub_80708B4 + ldr r0, _08060710 + ldr r2, [r0] + mov r4, r8 + str r4, [sp] + adds r0, r6, 0 + movs r1, 0 + movs r3, 0 + bl sub_8014FF0 + ldrb r1, [r7] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08060794 + ldrh r0, [r5, 0x1A] + adds r0, 0x1 + strh r0, [r5, 0x1A] + add r4, sp, 0x1C + ldr r2, _08060714 + adds r0, r4, 0 + adds r1, r7, 0 + bl sub_8090E14 + adds r0, r5, 0 + movs r1, 0 + bl sub_8013800 + adds r1, r0, 0 + mov r0, r8 + str r0, [sp] + movs r0, 0x8 + adds r2, r4, 0 + movs r3, 0 + bl sub_8014FF0 + b _08060794 + .align 2, 0 +_0806070C: .4byte gUnknown_202DF98 +_08060710: .4byte gUnknown_80FE940 +_08060714: .4byte gUnknown_8106B60 +_08060718: + ldr r0, _080607E0 + ldr r1, [r0] + ldr r0, _080607E4 + adds r0, r2, r0 + movs r2, 0 + ldrsh r0, [r0, r2] + subs r0, 0x4 + lsls r0, 2 + ldr r3, _080607E8 + adds r1, r3 + adds r1, r0 + ldr r4, [r1] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08060794 + ldr r1, [r4, 0x70] + adds r7, r1, 0 + adds r7, 0x60 + ldr r0, _080607EC + movs r2, 0 + bl sub_80708B4 + ldr r0, _080607F0 + ldr r2, [r0] + movs r4, 0 + mov r8, r4 + str r4, [sp] + adds r0, r6, 0 + movs r1, 0 + movs r3, 0 + bl sub_8014FF0 + ldrb r1, [r7] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08060794 + ldr r4, _080607F4 + ldrh r0, [r4, 0x1A] + adds r0, 0x1 + strh r0, [r4, 0x1A] + add r5, sp, 0x1C + ldr r2, _080607F8 + adds r0, r5, 0 + adds r1, r7, 0 + bl sub_8090E14 + adds r0, r4, 0 + movs r1, 0 + bl sub_8013800 + adds r1, r0, 0 + mov r0, r8 + str r0, [sp] + movs r0, 0x8 + adds r2, r5, 0 + movs r3, 0 + bl sub_8014FF0 +_08060794: + ldr r2, _080607F4 + movs r3, 0x18 + ldrsh r1, [r2, r3] + movs r4, 0x1A + ldrsh r0, [r2, r4] + cmp r1, r0 + blt _080607A6 + movs r0, 0 + strh r0, [r2, 0x18] +_080607A6: + movs r0, 0 + bl sub_80073E0 + ldr r0, [sp, 0x6C] + cmp r0, 0 + beq _080607D0 + movs r0, 0x1 + bl sub_80073B8 + ldr r0, _080607FC + ldr r2, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0x4 + movs r1, 0x2 + movs r3, 0x1 + bl sub_8014FF0 + movs r0, 0x1 + bl sub_80073E0 +_080607D0: + add sp, 0x78 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080607E0: .4byte gUnknown_203B418 +_080607E4: .4byte gUnknown_202F248 +_080607E8: .4byte 0x0001357c +_080607EC: .4byte gUnknown_202DF98 +_080607F0: .4byte gUnknown_80FE940 +_080607F4: .4byte gUnknown_202EE10 +_080607F8: .4byte gUnknown_8106B60 +_080607FC: .4byte gUnknown_80FE94C + thumb_func_end sub_80603D8 + + thumb_func_start sub_8060800 +sub_8060800: + push {r4-r7,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r1, 0 + ldr r0, _0806083C + ldr r2, [r0] + mov r12, r0 + ldr r6, _08060840 + cmp r1, r2 + bge _08060828 + adds r3, r6, 0 +_08060816: + movs r7, 0 + ldrsh r0, [r3, r7] + cmp r0, 0x1 + bgt _08060820 + adds r1, 0x1 +_08060820: + adds r3, 0x2 + subs r2, 0x1 + cmp r2, 0 + bne _08060816 +_08060828: + lsls r0, r4, 1 + adds r0, r6 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0x1 + bgt _08060844 + adds r3, r4, 0 + adds r2, r1, 0 + movs r1, 0 + b _0806084C + .align 2, 0 +_0806083C: .4byte gUnknown_202F258 +_08060840: .4byte gUnknown_202F248 +_08060844: + subs r3, r4, r1 + mov r7, r12 + ldr r0, [r7] + subs r2, r0, r1 +_0806084C: + cmp r5, 0 + beq _08060858 + movs r0, 0 + strb r2, [r5] + strb r3, [r5, 0x1] + strb r0, [r5, 0x3] +_08060858: + adds r0, r1, 0 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8060800 + + thumb_func_start sub_8060860 +sub_8060860: + push {lr} + adds r1, r0, 0 + ldr r0, _08060880 + movs r2, 0x1A + ldrsh r0, [r0, r2] + cmp r0, 0x1 + ble _0806087C + ldr r0, _08060884 + lsls r1, 1 + adds r1, r0 + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0x1 + ble _08060888 +_0806087C: + movs r0, 0 + b _0806088A + .align 2, 0 +_08060880: .4byte gUnknown_202EE10 +_08060884: .4byte gUnknown_202F248 +_08060888: + movs r0, 0x1 +_0806088A: + pop {r1} + bx r1 + thumb_func_end sub_8060860 + + thumb_func_start sub_8060890 +sub_8060890: + push {r4,lr} + adds r3, r0, 0 + ldr r1, _080608B4 + ldr r2, _080608B8 + movs r4, 0x1E + ldrsh r0, [r2, r4] + lsls r0, 1 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x1 + beq _080608D0 + cmp r0, 0x1 + bgt _080608BC + cmp r0, 0 + beq _080608C2 + b _080608E8 + .align 2, 0 +_080608B4: .4byte gUnknown_202F248 +_080608B8: .4byte gUnknown_202EE10 +_080608BC: + cmp r0, 0x2 + beq _080608DC + b _080608E8 +_080608C2: + ldr r1, _080608CC + ldrb r0, [r2, 0x18] + adds r0, 0x1 + b _080608EC + .align 2, 0 +_080608CC: .4byte gUnknown_202F238 +_080608D0: + ldr r1, _080608D8 + ldrb r0, [r2, 0x18] + adds r0, 0xB + b _080608EC + .align 2, 0 +_080608D8: .4byte gUnknown_202F238 +_080608DC: + ldr r1, _080608E4 + movs r0, 0x80 + b _080608EC + .align 2, 0 +_080608E4: .4byte gUnknown_202F238 +_080608E8: + ldr r1, _080608FC + subs r0, 0x74 +_080608EC: + strb r0, [r1] + ldrh r0, [r3] + strh r0, [r1, 0x4] + ldrh r0, [r3, 0x2] + strh r0, [r1, 0x6] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080608FC: .4byte gUnknown_202F238 + thumb_func_end sub_8060890 + + thumb_func_start sub_8060900 +sub_8060900: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r9, r0 + ldr r4, _08060964 + adds r1, r4, 0 + movs r2, 0xA + bl sub_8044CC8 + adds r7, r0, 0 + mov r0, r9 + ldr r0, [r0, 0x70] + mov r10, r0 + ldr r1, _08060968 + movs r0, 0 + str r0, [r1] + ldrb r0, [r4] + cmp r0, 0x8F + bls _0806092C + b _08060BD0 +_0806092C: + cmp r0, 0x80 + bne _080609B0 + ldrb r1, [r7, 0x2] + movs r0, 0x9 + bl sub_8044F5C + ldrb r0, [r7, 0x2] + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6 + beq _08060992 + movs r2, 0 + ldr r0, _0806096C + ldr r0, [r0] + ldr r1, _08060970 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08060978 + ldr r0, _08060974 + ldr r0, [r0] + adds r0, 0x4C + ldrb r0, [r0] + movs r2, 0x1 + ands r2, r0 + b _08060988 + .align 2, 0 +_08060964: .4byte gUnknown_202F238 +_08060968: .4byte gUnknown_202EE6C +_0806096C: .4byte gUnknown_203B418 +_08060970: .4byte 0x0000065b +_08060974: .4byte gUnknown_203B460 +_08060978: + mov r0, r10 + adds r0, 0x60 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08060988 + movs r2, 0x1 +_08060988: + cmp r2, 0 + beq _08060992 + movs r0, 0x9 + bl sub_8044FF0 +_08060992: + ldr r0, _08060A20 + ldrb r0, [r0] + cmp r0, 0x80 + bne _080609B0 + ldr r0, _08060A24 + ldr r0, [r0] + ldr r2, _08060A28 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080609B0 + ldrb r1, [r7, 0x2] + movs r0, 0xA + bl sub_8044F5C +_080609B0: + adds r0, r7, 0 + bl sub_8044DC8 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _080609E8 + ldrb r1, [r7, 0x2] + adds r0, r4, 0 + bl sub_8044F5C + ldrb r1, [r7] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080609D6 + adds r0, r4, 0 + bl sub_8044FF0 +_080609D6: + adds r0, r7, 0 + bl sub_8046F00 + lsls r0, 24 + cmp r0, 0 + bne _080609E8 + adds r0, r4, 0 + bl sub_8044FF0 +_080609E8: + ldr r0, _08060A20 + ldrb r0, [r0] + cmp r0, 0x14 + bhi _08060A6C + ldrb r0, [r7, 0x2] + bl sub_8090BD0 + lsls r0, 24 + cmp r0, 0 + beq _08060A0A + ldrb r0, [r7, 0x2] + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08060A6C +_08060A0A: + ldrb r1, [r7] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08060A3A + ldrb r1, [r7, 0x2] + movs r0, 0x3D + bl sub_8044F5C + b _08060A42 + .align 2, 0 +_08060A20: .4byte gUnknown_202F238 +_08060A24: .4byte gUnknown_203B418 +_08060A28: .4byte 0x0000065b +_08060A2C: + movs r0, 0x3C + bl sub_8044FF0 + movs r0, 0x3D + bl sub_8044FF0 + b _08060A6C +_08060A3A: + ldrb r1, [r7, 0x2] + movs r0, 0x3C + bl sub_8044F5C +_08060A42: + movs r3, 0 + ldr r0, _08060AD4 + ldr r2, [r0] + movs r4, 0x1 +_08060A4A: + ldrb r1, [r2] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _08060A64 + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08060A64 + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _08060A2C +_08060A64: + adds r2, 0x4 + adds r3, 0x1 + cmp r3, 0x13 + ble _08060A4A +_08060A6C: + ldr r0, _08060AD8 + ldrb r0, [r0] + cmp r0, 0x81 + beq _08060AE8 + cmp r0, 0x80 + beq _08060B3C + movs r3, 0 + mov r8, r3 + ldrb r1, [r7, 0x2] + movs r0, 0x36 + bl sub_8044F5C + movs r6, 0 +_08060A86: + ldr r0, _08060ADC + ldr r0, [r0] + lsls r1, r6, 2 + ldr r2, _08060AE0 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08060ABE + ldr r0, [r4, 0x70] + ldr r3, _08060AE4 + adds r5, r0, r3 + movs r0, 0 + strb r0, [r5] + adds r0, r4, 0 + bl sub_8070C60 + lsls r0, 24 + cmp r0, 0 + bne _08060ABE + movs r0, 0x1 + mov r8, r0 + mov r1, r8 + strb r1, [r5] +_08060ABE: + adds r6, 0x1 + cmp r6, 0x3 + ble _08060A86 + mov r2, r8 + cmp r2, 0 + bne _08060B3C + movs r0, 0x36 + bl sub_8044FF0 + b _08060B3C + .align 2, 0 +_08060AD4: .4byte gUnknown_203B460 +_08060AD8: .4byte gUnknown_202F238 +_08060ADC: .4byte gUnknown_203B418 +_08060AE0: .4byte 0x0001357c +_08060AE4: .4byte 0x00000157 +_08060AE8: + ldr r0, _08060B10 + ldr r0, [r0] + ldr r3, _08060B14 + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0 + beq _08060B3C + ldr r0, _08060B18 + ldr r0, [r0] + adds r0, 0x4C + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08060B1C + ldrb r1, [r7, 0x2] + movs r0, 0x3E + bl sub_8044F5C + b _08060B24 + .align 2, 0 +_08060B10: .4byte gUnknown_203B418 +_08060B14: .4byte 0x0000065b +_08060B18: .4byte gUnknown_203B460 +_08060B1C: + ldrb r1, [r7, 0x2] + movs r0, 0x37 + bl sub_8044F5C +_08060B24: + mov r0, r9 + bl sub_8070C60 + lsls r0, 24 + cmp r0, 0 + beq _08060B3C + movs r0, 0x37 + bl sub_8044FF0 + movs r0, 0x3E + bl sub_8044FF0 +_08060B3C: + ldr r0, _08060B64 + ldrb r0, [r0] + cmp r0, 0x14 + bhi _08060B78 + mov r1, r9 + movs r2, 0x4 + ldrsh r0, [r1, r2] + movs r3, 0x6 + ldrsh r1, [r1, r3] + bl sub_804954C + ldr r0, [r0, 0x14] + cmp r0, 0 + bne _08060B68 + ldrb r1, [r7, 0x2] + movs r0, 0x8 + bl sub_8044F5C + b _08060B78 + .align 2, 0 +_08060B64: .4byte gUnknown_202F238 +_08060B68: + bl sub_80450F8 + cmp r0, 0x3 + bne _08060B78 + ldrb r1, [r7, 0x2] + movs r0, 0x3A + bl sub_8044F5C +_08060B78: + ldrb r0, [r7, 0x2] + bl sub_8090BD0 + lsls r0, 24 + cmp r0, 0 + bne _08060B8E + ldrb r1, [r7, 0x2] + movs r0, 0x27 + bl sub_8044F5C + b _08060BAE +_08060B8E: + ldrb r0, [r7, 0x2] + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08060BA6 + ldrb r1, [r7, 0x2] + movs r0, 0x41 + bl sub_8044F5C + b _08060BAE +_08060BA6: + ldrb r1, [r7, 0x2] + movs r0, 0xB + bl sub_8044F5C +_08060BAE: + mov r0, r10 + bl sub_8071A70 + lsls r0, 24 + cmp r0, 0 + beq _08060BBC + b _08060CCC +_08060BBC: + movs r0, 0x27 + bl sub_8044FF0 + movs r0, 0x41 + bl sub_8044FF0 + movs r0, 0xB + bl sub_8044FF0 + b _08060CCC +_08060BD0: + ldrb r1, [r4] + subs r1, 0x90 + ldr r0, _08060C50 + mov r9, r0 + ldr r0, [r0] + lsls r1, 2 + ldr r2, _08060C54 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08060CCC + ldr r3, [r4, 0x70] + mov r8, r3 + movs r5, 0 + adds r0, r4, 0 + bl sub_8070C60 + lsls r0, 24 + lsrs r0, 24 + negs r1, r0 + orrs r1, r0 + lsrs r6, r1, 31 + ldr r0, _08060C58 + ldr r0, [r0] + adds r0, 0x4C + ldrb r0, [r0] + movs r4, 0x1 + ands r4, r0 + ldrb r0, [r7, 0x2] + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bne _08060C22 + movs r5, 0x1 +_08060C22: + ldrb r0, [r7, 0x2] + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x9 + bne _08060C32 + movs r5, 0x1 +_08060C32: + mov r1, r9 + ldr r0, [r1] + ldr r2, _08060C5C + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _08060C78 + cmp r4, 0 + beq _08060C60 + ldrb r1, [r7, 0x2] + movs r0, 0x3E + bl sub_8044F5C + b _08060C68 + .align 2, 0 +_08060C50: .4byte gUnknown_203B418 +_08060C54: .4byte 0x0001357c +_08060C58: .4byte gUnknown_203B460 +_08060C5C: .4byte 0x0000065b +_08060C60: + ldrb r1, [r7, 0x2] + movs r0, 0x37 + bl sub_8044F5C +_08060C68: + cmp r6, 0 + beq _08060C78 + movs r0, 0x37 + bl sub_8044FF0 + movs r0, 0x3E + bl sub_8044FF0 +_08060C78: + mov r3, r8 + ldrb r0, [r3, 0x7] + cmp r0, 0 + beq _08060CBA + adds r0, r7, 0 + bl sub_8044DC8 + lsls r0, 16 + lsrs r4, r0, 16 + cmp r4, 0 + beq _08060CCC + ldrb r1, [r7, 0x2] + adds r0, r4, 0 + bl sub_8044F5C + ldrb r1, [r7] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08060CA6 + adds r0, r4, 0 + bl sub_8044FF0 +_08060CA6: + adds r0, r7, 0 + bl sub_8046F00 + lsls r0, 24 + cmp r0, 0 + bne _08060CCC + adds r0, r4, 0 + bl sub_8044FF0 + b _08060CCC +_08060CBA: + ldrb r1, [r7, 0x2] + movs r0, 0x38 + bl sub_8044F5C + cmp r5, 0 + beq _08060CCC + movs r0, 0x38 + bl sub_8044FF0 +_08060CCC: + ldrb r1, [r7, 0x2] + movs r0, 0xC + bl sub_8044F5C + bl sub_8045064 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8060900 + + thumb_func_start sub_8060CE8 +sub_8060CE8: + push {r4,lr} + adds r4, r0, 0 + ldr r1, _08060D18 + ldr r0, _08060D1C + movs r2, 0x18 + ldrsh r0, [r0, r2] + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0] + adds r0, r4, 0 + bl sub_8044C94 + ldr r0, _08060D20 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r4, 0x4] + str r1, [r4, 0x8] + movs r0, 0 + strb r0, [r4, 0xC] + strh r0, [r4, 0x10] + strh r0, [r4, 0x12] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08060D18: .4byte gUnknown_202EE44 +_08060D1C: .4byte gUnknown_202EE10 +_08060D20: .4byte gUnknown_202F238 + thumb_func_end sub_8060CE8 + + thumb_func_start sub_8060D24 +sub_8060D24: + push {r4,lr} + bl sub_8083600 + movs r1, 0 + movs r2, 0xB + bl sub_8044D90 + adds r4, r0, 0 + movs r0, 0 + movs r1, 0 + bl sub_803ECB4 + adds r0, r4, 0 + bl sub_801B3C0 +_08060D42: + movs r0, 0x16 + bl sub_803E46C + bl sub_801B410 + cmp r0, 0 + beq _08060D42 + bl sub_801B450 + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8060D24 + + thumb_func_start sub_8060D64 +sub_8060D64: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + movs r7, 0 + ldr r0, _08060E28 + ldr r0, [r0] + ldr r1, _08060E2C + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08060DB8 + cmp r6, 0 + bne _08060DB8 + ldr r5, _08060E30 + ldr r0, [r5] + ldrb r1, [r0] + movs r3, 0x1 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _08060DA2 + strh r7, [r4] + movs r7, 0x1 +_08060DA2: + ldr r0, [r5] + adds r0, 0x28 + ldrb r1, [r0] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _08060DB8 + lsls r0, r7, 1 + adds r0, r4 + strh r3, [r0] + adds r7, 0x1 +_08060DB8: + cmp r2, 0 + beq _08060DD4 + ldr r0, [sp, 0x18] + adds r0, 0x4 + bl sub_804ACE4 + lsls r0, 24 + cmp r0, 0 + beq _08060DD4 + lsls r0, r7, 1 + adds r0, r4 + movs r1, 0x2 + strh r1, [r0] + adds r7, 0x1 +_08060DD4: + cmp r6, 0 + bne _08060E1A + mov r2, r8 + cmp r2, 0 + bne _08060E1A + movs r5, 0 + lsls r0, r7, 1 + adds r6, r0, r4 +_08060DE4: + ldr r0, _08060E28 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _08060E34 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08060E14 + ldr r0, [r4, 0x70] + adds r0, 0x60 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08060E14 + adds r0, r5, 0x4 + strh r0, [r6] + adds r6, 0x2 + adds r7, 0x1 +_08060E14: + adds r5, 0x1 + cmp r5, 0x3 + ble _08060DE4 +_08060E1A: + adds r0, r7, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08060E28: .4byte gUnknown_203B418 +_08060E2C: .4byte 0x0000065b +_08060E30: .4byte gUnknown_203B460 +_08060E34: .4byte 0x0001357c + thumb_func_end sub_8060D64 + + thumb_func_start sub_8060E38 +sub_8060E38: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x7C + str r0, [sp, 0x78] + add r4, sp, 0x18 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x60 + bl memset + movs r0, 0x6 + str r0, [r4, 0x4] + movs r0, 0x2 + strh r0, [r4, 0x8] + strh r0, [r4, 0xA] + movs r0, 0xE + strh r0, [r4, 0xC] + movs r0, 0x10 + strh r0, [r4, 0xE] + strh r0, [r4, 0x10] + ldr r0, _08061018 + str r0, [r4, 0x14] + movs r0, 0x3 + str r0, [r4, 0x1C] + str r0, [r4, 0x34] + str r0, [r4, 0x4C] + movs r5, 0 + mov r9, r4 + add r0, sp, 0x4 + mov r8, r0 +_08060E7A: + ldr r6, _0806101C + ldr r0, [r6] + lsls r1, r5, 2 + ldr r2, _08061020 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08060E9E + ldr r0, [r4, 0x70] + ldr r2, _08061024 + adds r1, r0, r2 + movs r0, 0x1 + strb r0, [r1] +_08060E9E: + adds r5, 0x1 + cmp r5, 0x3 + ble _08060E7A + ldr r0, [r6] + ldr r1, _08061028 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _08060EBC + movs r0, 0x3 + mov r2, r9 + str r0, [r2, 0x4] + ldrh r0, [r2, 0xA] + adds r0, 0x1 + strh r0, [r2, 0xA] +_08060EBC: + ldr r6, _0806102C +_08060EBE: + movs r7, 0 + mov r0, sp + mov r1, r9 + movs r2, 0x1 + bl sub_8061130 + movs r0, 0 + mov r10, r0 +_08060ECE: + movs r1, 0x18 + ldrsh r0, [r6, r1] + lsls r0, 2 + add r0, r8 + ldr r1, [r0] + cmp r1, 0 + blt _08060F00 + ldr r0, _0806101C + ldr r0, [r0] + lsls r1, 2 + ldr r2, _08061020 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + movs r1, 0 + bl sub_806A2BC + adds r4, 0x4 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x1 + movs r3, 0x1 + bl sub_804A728 +_08060F00: + adds r0, r6, 0 + bl AddMenuCursorSprite + movs r0, 0x1B + bl sub_803E46C + ldr r4, _08061030 + ldrh r1, [r4, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08060F26 + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r6, 0 + movs r1, 0x1 + bl sub_80136E0 +_08060F26: + ldrh r1, [r4, 0x4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08060F3E + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r6, 0 + movs r1, 0x1 + bl sub_8013744 +_08060F3E: + ldrh r1, [r4, 0x2] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08060F5A + movs r1, 0x18 + ldrsh r0, [r6, r1] + add r1, sp, 0x14 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0 + bne _08061046 + bl sub_8083D30 +_08060F5A: + ldrh r1, [r4, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08060F6C + ldr r2, _08061034 + ldrb r0, [r2] + cmp r0, 0 + beq _08060F7E +_08060F6C: + movs r1, 0x18 + ldrsh r0, [r6, r1] + add r1, sp, 0x14 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0 + bne _08061040 + bl sub_8083D30 +_08060F7E: + ldr r0, _08061030 + ldrh r1, [r0, 0x2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08060F92 + ldr r2, _08061038 + ldrb r0, [r2] + cmp r0, 0 + beq _08060ECE +_08060F92: + bl sub_8083D30 + movs r7, 0x1 +_08060F98: + ldr r5, _0806102C + movs r1, 0x18 + ldrsh r0, [r5, r1] + lsls r0, 2 + add r0, r8 + ldr r1, [r0] + cmp r1, 0 + blt _08060FCC + ldr r0, _0806101C + ldr r0, [r0] + lsls r1, 2 + ldr r2, _08061020 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + movs r1, 0 + bl sub_806A2BC + adds r4, 0x4 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x1 + movs r3, 0x1 + bl sub_804A728 +_08060FCC: + adds r0, r5, 0 + bl AddMenuCursorSprite + movs r0, 0x1B + bl sub_803E46C + bl sub_804AA60 + cmp r7, 0 + beq _08060FE2 + b _0806110C +_08060FE2: + movs r1, 0x18 + ldrsh r0, [r5, r1] + str r0, [sp] + ldr r1, _0806103C + movs r2, 0x18 + ldrsh r0, [r5, r2] + str r0, [r1] + mov r0, sp + bl sub_806145C + mov r0, r10 + cmp r0, 0 + beq _08061064 + ldr r1, [sp, 0x78] + ldr r4, [r1, 0x70] + adds r0, r4, 0 + adds r0, 0x44 + movs r1, 0x1B + bl sub_8044C94 + ldr r0, [sp] + lsls r0, 2 + add r0, r8 + ldr r0, [r0] + adds r4, 0x48 + strb r0, [r4] + b _08061116 + .align 2, 0 +_08061018: .4byte gUnknown_202F270 +_0806101C: .4byte gUnknown_203B418 +_08061020: .4byte 0x0001357c +_08061024: .4byte 0x00000157 +_08061028: .4byte 0x0000065b +_0806102C: .4byte gUnknown_202EE10 +_08061030: .4byte gUnknown_20255F0 +_08061034: .4byte gUnknown_202EE39 +_08061038: .4byte gUnknown_202EE3A +_0806103C: .4byte gUnknown_202F260 +_08061040: + bl sub_8083D08 + b _08060F98 +_08061046: + bl sub_8083D44 + movs r2, 0x1 + mov r10, r2 + b _08060F98 +_08061050: + ldr r1, [sp, 0x78] + ldr r0, [r1, 0x70] + adds r0, 0x44 + mov r1, sp + bl sub_80615B4 + bl sub_8083D08 + movs r4, 0 + b _080610EA +_08061064: + mov r0, r9 + movs r1, 0x12 + bl sub_805FC30 + adds r4, r5, 0 + ldr r5, _08061100 + adds r7, r4, 0 + adds r7, 0x2A +_08061074: + adds r0, r4, 0 + bl AddMenuCursorSprite + movs r0, 0x1B + bl sub_803E46C + ldrh r1, [r5, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08061098 + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80136E0 +_08061098: + ldrh r1, [r5, 0x4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080610B0 + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8013744 +_080610B0: + ldrh r1, [r5, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080610C2 + ldr r2, _08061104 + ldrb r0, [r2] + cmp r0, 0 + beq _080610D4 +_080610C2: + movs r1, 0x18 + ldrsh r0, [r4, r1] + bl sub_8044F3C + lsls r0, 24 + cmp r0, 0 + bne _08061050 + bl sub_8083D30 +_080610D4: + ldrh r1, [r5, 0x2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080610E4 + ldrb r0, [r7] + cmp r0, 0 + beq _08061074 +_080610E4: + bl sub_8083D30 + movs r4, 0x1 +_080610EA: + ldr r0, _08061108 + bl AddMenuCursorSprite + movs r0, 0x1B + bl sub_803E46C + cmp r4, 0x1 + bne _080610FC + b _08060EBE +_080610FC: + movs r7, 0 + b _08061116 + .align 2, 0 +_08061100: .4byte gUnknown_20255F0 +_08061104: .4byte gUnknown_202EE39 +_08061108: .4byte gUnknown_202EE10 +_0806110C: + bl sub_8083600 + movs r1, 0 + bl sub_806A2BC +_08061116: + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + adds r0, r7, 0 + add sp, 0x7C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8060E38 + + thumb_func_start sub_8061130 +sub_8061130: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + mov r9, r0 + mov r8, r1 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x8] + movs r7, 0 + movs r1, 0 + mov r2, r8 + ldr r0, [r2, 0x4] + cmp r0, 0x6 + bne _08061154 + movs r1, 0x1 +_08061154: + mov r10, r1 + bl sub_8083600 + adds r1, r0, 0 + add r0, sp, 0x4 + bl sub_8069D18 + movs r6, 0 +_08061164: + ldr r0, _08061318 + ldr r0, [r0] + lsls r1, r6, 2 + ldr r3, _0806131C + adds r0, r3 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080611AC + lsls r1, r7, 2 + mov r0, r9 + adds r0, 0x4 + adds r0, r1 + str r6, [r0] + ldr r0, [r4, 0x70] + mov r1, r9 + adds r1, 0x14 + adds r1, r7 + ldr r5, _08061320 + adds r0, r5 + ldrb r0, [r0] + strb r0, [r1] + ldr r1, [sp, 0x4] + ldr r0, [r4, 0x4] + cmp r1, r0 + bne _080611AA + ldr r1, _08061324 + ldr r0, [r1] + cmp r0, 0 + bge _080611AA + str r7, [r1] +_080611AA: + adds r7, 0x1 +_080611AC: + adds r6, 0x1 + cmp r6, 0x3 + ble _08061164 + ldr r0, _08061324 + ldr r1, [r0] + adds r5, r0, 0 + cmp r1, r7 + blt _080611C0 + subs r0, r7, 0x1 + str r0, [r5] +_080611C0: + ldr r0, [r5] + cmp r0, 0 + bge _080611CA + movs r0, 0 + str r0, [r5] +_080611CA: + adds r6, r7, 0 + mov r0, r10 + negs r3, r0 + cmp r7, 0x3 + bgt _080611F4 + movs r1, 0x1 + negs r1, r1 + mov r12, r1 + mov r2, r9 + adds r2, 0x14 + movs r4, 0 + lsls r0, r7, 2 + adds r1, r0, 0x4 + add r1, r9 +_080611E6: + mov r0, r12 + stm r1!, {r0} + adds r0, r2, r6 + strb r4, [r0] + adds r6, 0x1 + cmp r6, 0x3 + ble _080611E6 +_080611F4: + ldr r1, _08061328 + movs r4, 0 + movs r0, 0x1 + strb r0, [r1] + strb r4, [r1, 0x1] + strb r4, [r1, 0x3] + ldr r0, _0806132C + ldr r1, [r5] + strh r1, [r0, 0x18] + strh r7, [r0, 0x1A] + strh r7, [r0, 0x1C] + strh r4, [r0, 0x1E] + strh r4, [r0, 0x20] + strh r4, [r0, 0x4] + mov r1, r10 + orrs r3, r1 + asrs r1, r3, 31 + movs r2, 0x10 + ands r1, r2 + strh r1, [r0, 0x6] + strh r4, [r0, 0xC] + strh r4, [r0, 0xE] + strh r4, [r0, 0x14] + str r4, [r0] + adds r0, 0x28 + bl sub_801317C + adds r0, r7, 0 + movs r1, 0 + bl sub_80095E4 + mov r2, r10 + cmp r2, 0 + beq _0806123A + adds r0, 0x2 +_0806123A: + mov r3, r8 + strh r0, [r3, 0x10] + strh r0, [r3, 0xE] + movs r0, 0x8 + ldr r5, _08061328 + strb r0, [r5, 0x2] + ldr r0, [sp, 0x8] + cmp r0, 0 + beq _0806125C + mov r1, r8 + adds r1, 0x18 + mov r0, r8 + adds r0, 0x48 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} +_0806125C: + mov r0, r8 + movs r1, 0x1 + bl sub_803ECB4 + ldr r0, _0806132C + movs r1, 0 + bl sub_80137B0 + movs r0, 0 + bl sub_80073B8 + mov r0, r10 + cmp r0, 0 + beq _08061286 + ldr r2, _08061330 + str r4, [sp] + movs r0, 0xC + movs r1, 0 + movs r3, 0 + bl sub_8014FF0 +_08061286: + movs r6, 0 + cmp r6, r7 + blt _0806128E + b _08061440 +_0806128E: + lsls r1, r6, 2 + mov r0, r9 + adds r0, 0x4 + adds r0, r1 + ldr r1, [r0] + cmp r1, 0 + bge _0806129E + b _08061438 +_0806129E: + ldr r0, _08061318 + ldr r0, [r0] + lsls r1, 2 + ldr r2, _0806131C + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _080612BA + b _08061438 +_080612BA: + ldr r5, [r4, 0x70] + mov r0, r9 + adds r0, 0x14 + adds r0, r6 + ldrb r0, [r0] + movs r2, 0x2 + cmp r0, 0 + beq _080612CC + movs r2, 0x6 +_080612CC: + ldr r4, _08061334 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8070968 + ldr r0, _08061338 + ldr r1, [r0] + ldrb r2, [r5, 0xA] + movs r0, 0x64 + muls r0, r2 + adds r1, r0 + ldr r3, _0806133C + adds r1, r3 + movs r2, 0 + ldrsh r0, [r1, r2] + bl sub_806A538 + lsls r0, 24 + cmp r0, 0 + beq _08061388 + movs r3, 0x10 + ldrsh r2, [r5, r3] + adds r1, r2, 0 + cmp r2, 0 + bge _08061300 + adds r1, r2, 0x3 +_08061300: + movs r3, 0xE + ldrsh r0, [r5, r3] + asrs r1, 2 + cmp r0, r1 + bgt _08061344 + adds r0, r4, 0 + adds r0, 0x50 + ldr r1, _08061340 + bl strcpy + b _080613EE + .align 2, 0 +_08061318: .4byte gUnknown_203B418 +_0806131C: .4byte 0x0001357c +_08061320: .4byte 0x00000157 +_08061324: .4byte gUnknown_202F260 +_08061328: .4byte gUnknown_202F270 +_0806132C: .4byte gUnknown_202EE10 +_08061330: .4byte gUnknown_8106BB0 +_08061334: .4byte gUnknown_202DF98 +_08061338: .4byte gUnknown_203B45C +_0806133C: .4byte 0x00008e02 +_08061340: .4byte gUnknown_8106BB4 +_08061344: + movs r0, 0xE + ldrsh r3, [r5, r0] + lsls r0, r1, 1 + cmp r3, r0 + bgt _08061360 + adds r0, r4, 0 + adds r0, 0x50 + ldr r1, _0806135C + bl strcpy + b _080613EE + .align 2, 0 +_0806135C: .4byte gUnknown_8106BB8 +_08061360: + adds r0, r1 + cmp r3, r0 + bgt _08061378 + adds r0, r4, 0 + adds r0, 0x50 + ldr r1, _08061374 + bl strcpy + b _080613EE + .align 2, 0 +_08061374: .4byte gUnknown_8106BBC +_08061378: + adds r0, r4, 0 + adds r0, 0x50 + ldr r1, _08061384 + bl strcpy + b _080613EE + .align 2, 0 +_08061384: .4byte gUnknown_8106BC0 +_08061388: + movs r1, 0x10 + ldrsh r2, [r5, r1] + adds r1, r2, 0 + cmp r2, 0 + bge _08061394 + adds r1, r2, 0x3 +_08061394: + movs r3, 0xE + ldrsh r0, [r5, r3] + asrs r1, 2 + cmp r0, r1 + bgt _080613B0 + adds r0, r4, 0 + adds r0, 0x50 + ldr r1, _080613AC + bl strcpy + b _080613EE + .align 2, 0 +_080613AC: .4byte gUnknown_8106BC4 +_080613B0: + movs r0, 0xE + ldrsh r3, [r5, r0] + lsls r0, r1, 1 + cmp r3, r0 + bgt _080613CC + adds r0, r4, 0 + adds r0, 0x50 + ldr r1, _080613C8 + bl strcpy + b _080613EE + .align 2, 0 +_080613C8: .4byte gUnknown_8106BC8 +_080613CC: + adds r0, r1 + cmp r3, r0 + bgt _080613E4 + adds r0, r4, 0 + adds r0, 0x50 + ldr r1, _080613E0 + bl strcpy + b _080613EE + .align 2, 0 +_080613E0: .4byte gUnknown_8106BCC +_080613E4: + adds r0, r4, 0 + adds r0, 0x50 + ldr r1, _0806141C + bl strcpy +_080613EE: + ldr r0, _08061420 + movs r2, 0xE + ldrsh r1, [r5, r2] + str r1, [r0] + movs r3, 0x10 + ldrsh r1, [r5, r3] + str r1, [r0, 0x4] + ldr r0, _08061424 + adds r1, r6, 0 + bl sub_8013800 + adds r1, r0, 0 + ldrb r0, [r5, 0x7] + cmp r0, 0 + beq _0806142C + movs r0, 0 + str r0, [sp] + movs r0, 0x9 + ldr r2, _08061428 + movs r3, 0 + bl sub_8014FF0 + b _08061438 + .align 2, 0 +_0806141C: .4byte gUnknown_8106BD0 +_08061420: .4byte gUnknown_202DE30 +_08061424: .4byte gUnknown_202EE10 +_08061428: .4byte gUnknown_8106BD4 +_0806142C: + str r0, [sp] + movs r0, 0x9 + ldr r2, _08061458 + movs r3, 0 + bl sub_8014FF0 +_08061438: + adds r6, 0x1 + cmp r6, r7 + bge _08061440 + b _0806128E +_08061440: + movs r0, 0 + bl sub_80073E0 + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08061458: .4byte gUnknown_8106BE0 + thumb_func_end sub_8061130 + + thumb_func_start sub_806145C +sub_806145C: + push {r4-r6,lr} + ldr r2, _08061560 + movs r1, 0 + str r1, [r2] + ldr r5, _08061564 + ldr r2, [r5] + ldr r1, _08061568 + movs r3, 0x18 + ldrsh r1, [r1, r3] + lsls r1, 2 + adds r0, 0x4 + adds r0, r1 + ldr r0, [r0] + lsls r0, 2 + ldr r1, _0806156C + adds r2, r1 + adds r2, r0 + ldr r6, [r2] + ldr r4, [r6, 0x70] + movs r0, 0x1B + movs r1, 0 + bl sub_8044F5C + movs r0, 0x19 + movs r1, 0 + bl sub_8044F5C + ldrb r0, [r4, 0x7] + cmp r0, 0 + bne _080614C8 + ldr r2, [r5] + ldr r3, _08061570 + adds r0, r2, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _080614C0 + adds r0, r4, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x41 + bne _080614B8 + ldr r1, _08061574 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080614C0 +_080614B8: + movs r0, 0x34 + movs r1, 0 + bl sub_8044F5C +_080614C0: + movs r0, 0x1C + movs r1, 0 + bl sub_8044F5C +_080614C8: + movs r0, 0x30 + movs r1, 0 + bl sub_8044F5C + ldrb r0, [r4, 0x7] + cmp r0, 0 + bne _0806154C + movs r0, 0x1A + movs r1, 0 + bl sub_8044F5C + ldrb r0, [r4, 0x7] + cmp r0, 0 + bne _0806154C + ldr r0, _08061564 + ldr r1, [r0] + ldr r2, _08061574 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _0806154C + ldr r3, _08061578 + adds r0, r1, r3 + ldrb r0, [r0] + bl sub_8090158 + lsls r0, 24 + cmp r0, 0 + beq _0806154C + movs r0, 0x3B + movs r1, 0 + bl sub_8044F5C + movs r5, 0x1 + ldrb r0, [r4, 0xA] + cmp r0, 0x3 + bhi _08061530 + ldr r2, _0806157C + ldrb r1, [r4, 0xA] + movs r0, 0x64 + muls r1, r0 + ldr r0, _08061580 + adds r1, r0 + ldr r0, [r2] + adds r0, r1 + movs r1, 0xA + ldrsh r0, [r0, r1] + bl sub_806A538 + lsls r0, 24 + cmp r0, 0 + beq _08061532 +_08061530: + movs r5, 0 +_08061532: + adds r0, r6, 0 + movs r1, 0 + bl sub_8070B6C + lsls r0, 24 + cmp r0, 0 + beq _08061542 + movs r5, 0 +_08061542: + cmp r5, 0 + bne _0806154C + movs r0, 0x3B + bl sub_8044FF0 +_0806154C: + adds r0, r4, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x4A + beq _0806155A + cmp r0, 0x47 + bne _08061584 +_0806155A: + movs r0, 0x1 + b _08061586 + .align 2, 0 +_08061560: .4byte gUnknown_202EE6C +_08061564: .4byte gUnknown_203B418 +_08061568: .4byte gUnknown_202EE10 +_0806156C: .4byte 0x0001357c +_08061570: .4byte 0x0000065d +_08061574: .4byte 0x0000065c +_08061578: .4byte 0x00000644 +_0806157C: .4byte gUnknown_203B45C +_08061580: .4byte 0x00008df8 +_08061584: + movs r0, 0 +_08061586: + cmp r0, 0 + beq _080615A8 + movs r0, 0x19 + bl sub_8044FF0 + movs r0, 0x3B + bl sub_8044FF0 + movs r0, 0x1A + bl sub_8044FF0 + movs r0, 0x30 + bl sub_8044FF0 + movs r0, 0x34 + bl sub_8044FF0 +_080615A8: + bl sub_8045064 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_806145C + + thumb_func_start sub_80615B4 +sub_80615B4: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldr r1, _080615E0 + ldr r0, _080615E4 + movs r2, 0x18 + ldrsh r0, [r0, r2] + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0] + adds r0, r5, 0 + bl sub_8044C94 + ldm r4!, {r0} + lsls r0, 2 + adds r4, r0 + ldr r0, [r4] + strb r0, [r5, 0x4] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080615E0: .4byte gUnknown_202EE44 +_080615E4: .4byte gUnknown_202EE10 + thumb_func_end sub_80615B4 + + thumb_func_start sub_80615E8 +sub_80615E8: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x7C + adds r5, r0, 0 + mov r4, sp + mov r0, sp + movs r1, 0 + movs r2, 0x60 + bl memset + movs r0, 0x6 + str r0, [sp, 0x4] + movs r1, 0x2 + strh r1, [r4, 0x8] + strh r1, [r4, 0xA] + movs r2, 0x12 + strh r2, [r4, 0xC] + movs r0, 0xE + strh r0, [r4, 0xE] + strh r2, [r4, 0x10] + strh r1, [r4, 0x12] + ldr r0, _08061720 + str r0, [sp, 0x14] + movs r0, 0x3 + str r0, [sp, 0x1C] + str r0, [sp, 0x34] + str r0, [sp, 0x4C] + ldr r0, _08061724 + ldr r1, [r0] + ldrb r0, [r5, 0x4] + lsls r0, 2 + ldr r2, _08061728 + adds r1, r2 + adds r1, r0 + ldr r1, [r1] + str r1, [sp, 0x74] + ldr r0, [r1, 0x70] + mov r8, r0 + movs r1, 0 + str r1, [sp, 0x70] + movs r2, 0 + str r2, [sp, 0x6C] + add r0, sp, 0x60 + mov r10, r0 +_08061646: + movs r1, 0x1 + str r1, [sp, 0x78] + movs r7, 0 + ldr r0, _08061720 + strb r1, [r0] + strb r7, [r0, 0x1] + movs r1, 0xA + strb r1, [r0, 0x2] + strb r7, [r0, 0x3] + mov r0, sp + movs r1, 0x1 + bl sub_803ECB4 + ldr r0, [sp, 0x6C] + mov r1, r10 + mov r2, r8 + movs r3, 0 + bl sub_806195C + movs r2, 0 + mov r1, r10 + ldrb r0, [r1] + cmp r0, 0xB + beq _08061684 +_08061676: + adds r2, 0x1 + cmp r2, 0x7 + bgt _08061684 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0xB + bne _08061676 +_08061684: + ldr r4, _0806172C + movs r1, 0 + strh r2, [r4, 0x1A] + movs r0, 0x8 + strh r0, [r4, 0x1C] + strh r1, [r4, 0x1E] + strh r1, [r4, 0x20] + strh r1, [r4, 0x4] + movs r0, 0x10 + strh r0, [r4, 0x6] + strh r1, [r4, 0xC] + strh r1, [r4, 0xE] + strh r1, [r4, 0x14] + str r1, [r4] + adds r0, r4, 0 + adds r0, 0x28 + bl sub_801317C + adds r0, r4, 0 + movs r1, 0 + bl sub_80137B0 + add r2, sp, 0x70 + ldrh r2, [r2] + strh r2, [r4, 0x18] + mov r9, r4 + mov r6, r10 +_080616BA: + mov r0, r9 + bl AddMenuCursorSprite + ldrb r0, [r6, 0x8] + cmp r0, 0xB + beq _080616CA + bl sub_80623B0 +_080616CA: + ldr r0, [sp, 0x6C] + cmp r0, 0 + beq _080616D4 + bl sub_8062230 +_080616D4: + movs r0, 0x3D + bl sub_803E46C + ldr r0, _08061730 + ldrh r1, [r0, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08061740 + movs r0, 0x1 + bl sub_8083CE0 + mov r1, r9 + movs r2, 0x18 + ldrsh r0, [r1, r2] + cmp r0, 0x7 + bne _08061738 + ldrb r0, [r6, 0x8] + cmp r0, 0xB + beq _0806171A + ldr r5, [sp, 0x6C] + adds r5, 0x1 + ldr r6, _08061734 + movs r4, 0x5 +_08061704: + ldr r1, [r6] + movs r0, 0 + bl _call_via_r1 + movs r0, 0x3D + bl sub_803E46C + subs r4, 0x1 + cmp r4, 0 + bge _08061704 + str r5, [sp, 0x6C] +_0806171A: + movs r0, 0x7 + str r0, [sp, 0x70] + b _08061926 + .align 2, 0 +_08061720: .4byte gUnknown_202F270 +_08061724: .4byte gUnknown_203B418 +_08061728: .4byte 0x0001357c +_0806172C: .4byte gUnknown_202EE10 +_08061730: .4byte gUnknown_20255F0 +_08061734: .4byte gUnknown_203B080 +_08061738: + mov r0, r9 + movs r1, 0 + bl sub_80136E0 +_08061740: + ldr r0, _08061788 + ldrh r1, [r0, 0x4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0806179C + movs r0, 0x1 + bl sub_8083CE0 + ldr r1, _0806178C + movs r2, 0x18 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _08061794 + ldr r0, [sp, 0x6C] + cmp r0, 0 + beq _08061780 + adds r5, r0, 0 + subs r5, 0x1 + ldr r6, _08061790 + movs r4, 0x5 +_0806176A: + ldr r1, [r6] + movs r0, 0 + bl _call_via_r1 + movs r0, 0x3D + bl sub_803E46C + subs r4, 0x1 + cmp r4, 0 + bge _0806176A + str r5, [sp, 0x6C] +_08061780: + movs r1, 0 + str r1, [sp, 0x70] + b _08061926 + .align 2, 0 +_08061788: .4byte gUnknown_20255F0 +_0806178C: .4byte gUnknown_202EE10 +_08061790: .4byte gUnknown_203B084 +_08061794: + adds r0, r1, 0 + movs r1, 0 + bl sub_8013744 +_0806179C: + ldr r4, _080617C8 + ldrh r1, [r4, 0x2] + movs r0, 0x8 + ands r0, r1 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r5, 0 + beq _080617DE + mov r2, r9 + movs r1, 0x18 + ldrsh r0, [r2, r1] + mov r2, r10 + adds r1, r2, r0 + ldrb r4, [r1] + str r0, [sp, 0x70] + bl sub_8083D44 + adds r0, r4, 0 + bl sub_8062748 +_080617C4: + movs r7, 0 + b _08061926 + .align 2, 0 +_080617C8: .4byte gUnknown_20255F0 +_080617CC: + bl sub_8083D08 + mov r0, r9 + movs r1, 0x18 + ldrsh r4, [r0, r1] + cmp r4, 0 + beq _080617DC + b _08061900 +_080617DC: + b _080618C4 +_080617DE: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080617F4 + ldr r2, _080618BC + adds r0, r2, 0 + adds r0, 0x29 + ldrb r0, [r0] + cmp r0, 0 + bne _080617F4 + b _0806190C +_080617F4: + mov r2, r9 + movs r0, 0x18 + ldrsh r1, [r2, r0] + mov r2, r10 + adds r0, r2, r1 + ldrb r7, [r0] + str r1, [sp, 0x70] + bl sub_8062D68 + bl sub_8083D08 + ldr r0, _080618C0 + str r5, [r0] + movs r0, 0x2F + movs r1, 0 + bl sub_8044F5C + movs r0, 0xC + movs r1, 0 + bl sub_8044F5C + ldr r0, [sp, 0x74] + movs r1, 0x1 + bl sub_8070B6C + lsls r0, 24 + cmp r0, 0 + beq _08061832 + movs r0, 0x2F + bl sub_8044FF0 +_08061832: + mov r0, sp + movs r1, 0x16 + bl sub_805FC30 + ldr r5, _080618BC + adds r6, r4, 0 + adds r4, r5, 0 + adds r4, 0x2A +_08061842: + adds r0, r5, 0 + bl AddMenuCursorSprite + movs r0, 0x3D + bl sub_803E46C + ldrh r1, [r6, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08061866 + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80136E0 +_08061866: + ldrh r1, [r6, 0x4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0806187E + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_8013744 +_0806187E: + ldrh r1, [r6, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08061892 + adds r0, r5, 0 + adds r0, 0x29 + ldrb r0, [r0] + cmp r0, 0 + beq _080618A4 +_08061892: + movs r1, 0x18 + ldrsh r0, [r5, r1] + bl sub_8044F3C + lsls r0, 24 + cmp r0, 0 + bne _080617CC + bl sub_8083D30 +_080618A4: + ldrh r1, [r6, 0x2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080618B4 + ldrb r0, [r4] + cmp r0, 0 + beq _08061842 +_080618B4: + bl sub_8083D30 + b _080617C4 + .align 2, 0 +_080618BC: .4byte gUnknown_202EE10 +_080618C0: .4byte gUnknown_202EE6C +_080618C4: + ldr r0, _080618FC + bl sub_8083E38 + mov r0, r8 + adds r0, 0x94 + strb r7, [r0] + mov r1, r8 + adds r1, 0x78 + movs r0, 0x6 + strb r0, [r1] + mov r0, r8 + adds r0, 0x80 + str r4, [r0] + adds r0, 0x4 + str r4, [r0] + subs r0, 0x8 + strh r4, [r0] + mov r2, r8 + ldrb r0, [r2, 0x7] + cmp r0, 0 + beq _080618F0 + b _080617C4 +_080618F0: + ldr r0, [sp, 0x74] + movs r1, 0x1 + bl sub_807ADB8 + b _080617C4 + .align 2, 0 +_080618FC: .4byte 0x00000133 +_08061900: + adds r0, r7, 0 + bl sub_8062748 + movs r0, 0 + str r0, [sp, 0x78] + b _080617C4 +_0806190C: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08061920 + adds r0, r2, 0 + adds r0, 0x2A + ldrb r0, [r0] + cmp r0, 0 + bne _08061920 + b _080616BA +_08061920: + bl sub_8083D30 + movs r7, 0x1 +_08061926: + ldr r1, [sp, 0x78] + cmp r1, 0 + beq _08061932 + ldr r0, _08061958 + bl AddMenuCursorSprite +_08061932: + movs r0, 0x3D + bl sub_803E46C + cmp r7, 0 + bne _0806193E + b _08061646 +_0806193E: + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + add sp, 0x7C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08061958: .4byte gUnknown_202EE10 + thumb_func_end sub_80615E8 + + thumb_func_start sub_806195C +sub_806195C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + adds r5, r0, 0 + mov r9, r1 + str r2, [sp, 0x10] + adds r7, r3, 0 + subs r5, 0x1 + adds r0, r7, 0 + bl sub_80073B8 + ldr r0, _080619B4 + ldr r2, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0x10 + movs r1, 0 + adds r3, r7, 0 + bl xxx_call_draw_string + movs r0, 0x14 + mov r8, r0 + movs r1, 0xB + mov r0, r9 + adds r0, 0x8 +_08061994: + strb r1, [r0] + subs r0, 0x1 + cmp r0, r9 + bge _08061994 + bl sub_8083654 + ldrb r1, [r0, 0x9] + add r0, sp, 0x4 + bl sub_808EB0C + movs r6, 0x1 + negs r6, r6 + movs r1, 0 + mov r10, r1 + b _080619FC + .align 2, 0 +_080619B4: .4byte gUnknown_80FE954 +_080619B8: + ldr r0, _080619DC + adds r1, r4, 0 + bl sub_808EAC0 + ldr r0, [sp, 0x10] + adds r0, 0x94 + ldrb r0, [r0] + cmp r0, r4 + bne _080619E4 + mov r0, r10 + str r0, [sp] + movs r0, 0x10 + mov r1, r8 + ldr r2, _080619E0 + adds r3, r7, 0 + bl sub_8014FF0 + b _080619F4 + .align 2, 0 +_080619DC: .4byte gUnknown_202DF98 +_080619E0: .4byte gUnknown_8106BEC +_080619E4: + mov r1, r10 + str r1, [sp] + movs r0, 0x10 + mov r1, r8 + ldr r2, _08061A34 + adds r3, r7, 0 + bl sub_8014FF0 +_080619F4: + adds r6, 0x1 + movs r0, 0xC + add r8, r0 + adds r5, 0x1 +_080619FC: + cmp r6, 0x9 + bgt _08061A1E + cmp r5, 0 + blt _080619F4 + cmp r5, 0xB + bgt _080619F4 + mov r0, sp + adds r0, r5 + adds r0, 0x4 + ldrb r4, [r0] + cmp r6, 0x8 + bhi _08061A1A + mov r1, r9 + adds r0, r1, r6 + strb r4, [r0] +_08061A1A: + cmp r4, 0xB + bne _080619B8 +_08061A1E: + adds r0, r7, 0 + bl sub_80073E0 + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08061A34: .4byte gUnknown_8106BF4 + thumb_func_end sub_806195C + + thumb_func_start sub_8061A38 +sub_8061A38: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x130 + adds r5, r0, 0 + lsls r1, 24 + lsrs r6, r1, 24 + add r4, sp, 0xB0 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x60 + bl memset + movs r0, 0x6 + str r0, [r4, 0x4] + movs r1, 0x2 + strh r1, [r4, 0x8] + strh r1, [r4, 0xA] + movs r2, 0x12 + strh r2, [r4, 0xC] + movs r0, 0xE + strh r0, [r4, 0xE] + strh r2, [r4, 0x10] + strh r1, [r4, 0x12] + ldr r0, _08061AA4 + str r0, [r4, 0x14] + movs r0, 0x3 + str r0, [r4, 0x1C] + str r0, [r4, 0x34] + str r0, [r4, 0x4C] + movs r0, 0 + str r0, [sp, 0x114] + mov r8, r0 + ldr r0, _08061AA8 + ldr r1, [r0] + ldrb r0, [r5, 0x4] + lsls r0, 2 + ldr r2, _08061AAC + adds r1, r2 + adds r1, r0 + ldr r1, [r1] + str r1, [sp, 0x110] + ldr r0, [r1, 0x70] + str r0, [sp, 0x11C] + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x4A + beq _08061AA0 + cmp r0, 0x47 + bne _08061AB0 +_08061AA0: + movs r0, 0x1 + b _08061AB2 + .align 2, 0 +_08061AA4: .4byte gUnknown_202F270 +_08061AA8: .4byte gUnknown_203B418 +_08061AAC: .4byte 0x0001357c +_08061AB0: + movs r0, 0 +_08061AB2: + adds r1, r0, 0 + cmp r1, 0 + beq _08061ACE + movs r0, 0x1 + str r0, [sp, 0x4] + movs r0, 0 + str r0, [sp, 0x8] + str r0, [sp, 0xC] + str r0, [sp, 0x10] + str r0, [sp, 0x14] + str r0, [sp, 0x18] + movs r1, 0x1 + str r1, [sp, 0x118] + b _08061AFE +_08061ACE: + cmp r6, 0 + beq _08061AE6 + movs r0, 0x4 + str r0, [sp, 0x4] + str r1, [sp, 0x8] + str r1, [sp, 0xC] + str r1, [sp, 0x10] + str r1, [sp, 0x14] + str r1, [sp, 0x18] + movs r2, 0x1 + str r2, [sp, 0x118] + b _08061AFE +_08061AE6: + movs r0, 0x2 + str r0, [sp, 0x4] + movs r0, 0x1 + str r0, [sp, 0x8] + movs r0, 0x3 + str r0, [sp, 0xC] + movs r0, 0x5 + str r0, [sp, 0x10] + str r6, [sp, 0x14] + str r6, [sp, 0x18] + movs r0, 0x4 + str r0, [sp, 0x118] +_08061AFE: + add r2, sp, 0x5C + movs r0, 0 + strh r0, [r2] + mov r1, sp + adds r1, 0x72 + strh r0, [r1] + ldr r3, _08061BB4 + strh r0, [r3, 0x18] + subs r1, 0x56 + str r1, [sp, 0x12C] + add r2, sp, 0x80 + mov r9, r2 + adds r7, r3, 0 +_08061B18: + movs r0, 0 + mov r10, r0 + movs r1, 0 + str r1, [sp, 0x120] + movs r2, 0 + str r2, [sp, 0x124] + movs r0, 0x1 + str r0, [sp, 0x128] + ldr r4, _08061BB8 + ldr r1, _08061BBC + add r2, sp, 0x118 + ldrb r2, [r2] + strb r2, [r1] + add r0, sp, 0x114 + ldrb r0, [r0] + strb r0, [r1, 0x1] + movs r0, 0xA + strb r0, [r1, 0x2] + mov r2, r10 + strb r2, [r1, 0x3] + add r0, sp, 0xB0 + movs r1, 0x1 + bl sub_803ECB4 + ldr r0, [sp, 0x12C] + ldr r1, [sp, 0x110] + bl sub_8069844 + ldr r1, [sp, 0x114] + lsls r0, r1, 2 + mov r5, sp + adds r5, r0 + adds r5, 0x4 + ldr r0, [r5] + mov r2, r10 + str r2, [sp] + ldr r2, [sp, 0x12C] + add r3, sp, 0x80 + bl sub_808F844 + add r0, sp, 0x114 + ldrh r0, [r0] + strh r0, [r7, 0x1E] + add r1, sp, 0x118 + ldrh r1, [r1] + strh r1, [r7, 0x20] + movs r2, 0 + ldrsh r0, [r4, r2] + adds r0, 0xF + lsls r0, 3 + strh r0, [r7, 0xC] + movs r1, 0x2 + ldrsh r0, [r4, r1] + adds r0, 0x1 + lsls r0, 3 + subs r0, 0x2 + strh r0, [r7, 0xE] + mov r2, r10 + strh r2, [r7, 0x14] + strh r2, [r7, 0x4] + movs r0, 0x10 + strh r0, [r7, 0x6] + mov r0, r10 + str r0, [r7] + adds r0, r7, 0 + adds r0, 0x28 + bl sub_801317C + mov r1, r10 + strh r1, [r7, 0x18] + strh r1, [r7, 0x1A] + strh r1, [r7, 0x1C] + ldr r5, [r5] + cmp r5, 0x1 + bne _08061C10 + movs r2, 0 + add r1, sp, 0x8C + b _08061BC8 + .align 2, 0 +_08061BB4: .4byte gUnknown_202EE10 +_08061BB8: .4byte gUnknown_2027370 +_08061BBC: .4byte gUnknown_202F270 +_08061BC0: + adds r1, 0x4 + adds r2, 0x1 + cmp r2, 0x7 + bgt _08061BCE +_08061BC8: + ldr r0, [r1] + cmp r0, 0 + bne _08061BC0 +_08061BCE: + cmp r2, 0 + beq _08061C44 + movs r0, 0x1 + str r0, [sp, 0x124] + strh r2, [r7, 0x1A] + b _08061C38 +_08061BDA: + movs r0, 0x18 + ldrsh r2, [r7, r0] + lsls r1, r2, 2 + add r0, sp, 0x8C + adds r0, r1 + ldr r4, [r0] + mov r8, r2 + bl sub_8083D44 + adds r0, r4, 0 + bl sub_806285C + movs r1, 0 + str r1, [sp, 0x128] + b _080621E4 +_08061BF8: + movs r2, 0x18 + ldrsh r0, [r7, r2] + mov r2, r9 + adds r1, r2, r0 + ldrb r4, [r1] + mov r8, r0 + bl sub_8083D44 + adds r0, r4, 0 + bl sub_806262C + b _08062082 +_08061C10: + cmp r5, 0x4 + bne _08061C48 + movs r1, 0 + add r2, sp, 0x80 + ldrb r0, [r2] + cmp r0, 0 + beq _08061C2E + mov r2, r9 +_08061C20: + adds r1, 0x1 + cmp r1, 0x7 + bgt _08061C2E + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _08061C20 +_08061C2E: + cmp r1, 0 + beq _08061C44 + movs r0, 0x1 + str r0, [sp, 0x120] + strh r1, [r7, 0x1A] +_08061C38: + movs r0, 0x8 + strh r0, [r7, 0x1C] + adds r0, r7, 0 + movs r1, 0 + bl sub_80137B0 +_08061C44: + mov r1, r8 + strh r1, [r7, 0x18] +_08061C48: + ldr r0, _08061CF8 + bl AddMenuCursorSprite + movs r0, 0 + ldr r1, _08061CFC + bl sub_8014140 + adds r4, r0, 0 + movs r5, 0 + movs r6, 0 + ldr r2, [sp, 0x120] + cmp r2, 0 + beq _08061C80 + mov r1, r9 + ldrb r0, [r1, 0x8] + cmp r0, 0 + beq _08061C70 + movs r5, 0x1 + bl sub_80623B0 +_08061C70: + add r1, sp, 0x5C + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _08061C80 + movs r6, 0x1 + bl sub_8062230 +_08061C80: + ldr r2, [sp, 0x124] + cmp r2, 0 + beq _08061CA6 + mov r1, r9 + ldr r0, [r1, 0x2C] + cmp r0, 0 + beq _08061C94 + movs r5, 0x1 + bl sub_80623B0 +_08061C94: + movs r1, 0x72 + add r1, sp + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _08061CA6 + movs r6, 0x1 + bl sub_8062230 +_08061CA6: + movs r0, 0x1C + bl sub_803E46C + ldr r0, _08061D00 + ldrb r0, [r0] + cmp r0, 0x1 + bls _08061D4E + bl sub_80048C8 + lsls r0, 24 + cmp r0, 0 + bne _08061D4E + ldr r0, _08061D04 + ldrh r1, [r0, 0x2] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _08061CD6 + ldr r2, _08061CF8 + adds r0, r2, 0 + adds r0, 0x2B + ldrb r0, [r0] + cmp r0, 0 + beq _08061D08 +_08061CD6: + movs r0, 0 + bl sub_8083CE0 + ldr r2, [sp, 0x114] + adds r2, 0x1 + str r2, [sp, 0x114] + lsls r0, r2, 2 + add r0, sp + adds r0, 0x4 + ldr r0, [r0] + cmp r0, 0 + beq _08061CF0 + b _080621E6 +_08061CF0: + movs r0, 0 + str r0, [sp, 0x114] + b _080621E6 + .align 2, 0 +_08061CF8: .4byte gUnknown_202EE10 +_08061CFC: .4byte gUnknown_8106B8C +_08061D00: .4byte gUnknown_202F270 +_08061D04: .4byte gUnknown_20255F0 +_08061D08: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _08061D1A + adds r0, r2, 0 + adds r0, 0x2C + ldrb r0, [r0] + cmp r0, 0 + beq _08061D4E +_08061D1A: + movs r0, 0 + bl sub_8083CE0 + ldr r1, [sp, 0x114] + subs r1, 0x1 + str r1, [sp, 0x114] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08061D30 + b _080621E6 +_08061D30: + movs r2, 0x5 + str r2, [sp, 0x114] + ldr r0, [sp, 0x18] + cmp r0, 0 + beq _08061D3C + b _080621E6 +_08061D3C: + add r1, sp, 0x18 +_08061D3E: + subs r1, 0x4 + ldr r0, [sp, 0x114] + subs r0, 0x1 + str r0, [sp, 0x114] + ldr r0, [r1] + cmp r0, 0 + beq _08061D3E + b _080621E6 +_08061D4E: + ldr r1, [sp, 0x124] + cmp r1, 0 + bne _08061D56 + b _08061E8A +_08061D56: + cmp r4, 0x2 + bne _08061D98 + cmp r5, 0 + beq _08061D98 + movs r0, 0 + bl sub_8083CE0 + mov r2, r9 + ldr r0, [r2, 0x2C] + cmp r0, 0 + beq _08061D8E + ldr r5, _08061D94 + movs r4, 0x5 +_08061D70: + ldr r1, [r5] + movs r0, 0 + bl _call_via_r1 + movs r0, 0x1C + bl sub_803E46C + subs r4, 0x1 + cmp r4, 0 + bge _08061D70 + movs r1, 0x72 + add r1, sp + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] +_08061D8E: + movs r2, 0x7 + mov r8, r2 + b _080621E6 + .align 2, 0 +_08061D94: .4byte gUnknown_203B080 +_08061D98: + ldr r0, _08061DDC + ldrh r1, [r0, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08061DF0 + movs r0, 0 + bl sub_8083CE0 + ldr r1, _08061DE0 + movs r2, 0x18 + ldrsh r0, [r1, r2] + cmp r0, 0x7 + bne _08061DE8 + mov r1, r9 + ldr r0, [r1, 0x2C] + cmp r0, 0 + bne _08061DBE + b _08061F04 +_08061DBE: + ldr r5, _08061DE4 + movs r4, 0x5 +_08061DC2: + ldr r1, [r5] + movs r0, 0 + bl _call_via_r1 + movs r0, 0x1C + bl sub_803E46C + subs r4, 0x1 + cmp r4, 0 + bge _08061DC2 + movs r2, 0x72 + add r2, sp + b _08061EFE + .align 2, 0 +_08061DDC: .4byte gUnknown_20255F0 +_08061DE0: .4byte gUnknown_202EE10 +_08061DE4: .4byte gUnknown_203B080 +_08061DE8: + adds r0, r1, 0 + movs r1, 0 + bl sub_80136E0 +_08061DF0: + cmp r4, 0x1 + bne _08061E28 + cmp r6, 0 + beq _08061E28 + movs r2, 0x72 + add r2, sp + movs r1, 0 + ldrsh r0, [r2, r1] + cmp r0, 0 + bne _08061E06 + b _08061F96 +_08061E06: + ldr r5, _08061E24 + movs r4, 0x5 +_08061E0A: + ldr r1, [r5] + movs r0, 0 + bl _call_via_r1 + movs r0, 0x1C + bl sub_803E46C + subs r4, 0x1 + cmp r4, 0 + bge _08061E0A + movs r1, 0x72 + add r1, sp + b _08061F90 + .align 2, 0 +_08061E24: .4byte gUnknown_203B084 +_08061E28: + ldr r0, _08061E74 + ldrh r1, [r0, 0x4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08061E36 + b _08061FB0 +_08061E36: + movs r0, 0x1 + bl sub_8083CE0 + ldr r1, _08061E78 + movs r2, 0x18 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _08061E80 + movs r2, 0x72 + add r2, sp + movs r1, 0 + ldrsh r0, [r2, r1] + cmp r0, 0 + bne _08061E54 + b _08061F96 +_08061E54: + ldr r5, _08061E7C + movs r4, 0x5 +_08061E58: + ldr r1, [r5] + movs r0, 0 + bl _call_via_r1 + movs r0, 0x1C + bl sub_803E46C + subs r4, 0x1 + cmp r4, 0 + bge _08061E58 + movs r1, 0x72 + add r1, sp + b _08061F90 + .align 2, 0 +_08061E74: .4byte gUnknown_20255F0 +_08061E78: .4byte gUnknown_202EE10 +_08061E7C: .4byte gUnknown_203B084 +_08061E80: + adds r0, r1, 0 + movs r1, 0 + bl sub_8013744 + b _08061FB0 +_08061E8A: + ldr r0, [sp, 0x120] + cmp r0, 0 + bne _08061E92 + b _08061FB0 +_08061E92: + cmp r4, 0x2 + bne _08061EC0 + cmp r5, 0 + beq _08061EC0 + mov r1, r9 + ldrb r0, [r1, 0x8] + cmp r0, 0 + beq _08061F04 + ldr r5, _08061EBC + movs r4, 0x5 +_08061EA6: + ldr r1, [r5] + movs r0, 0 + bl _call_via_r1 + movs r0, 0x1C + bl sub_803E46C + subs r4, 0x1 + cmp r4, 0 + bge _08061EA6 + b _08061EFC + .align 2, 0 +_08061EBC: .4byte gUnknown_203B080 +_08061EC0: + ldr r0, _08061F0C + ldrh r1, [r0, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08061F20 + movs r0, 0x1 + bl sub_8083CE0 + ldr r1, _08061F10 + movs r2, 0x18 + ldrsh r0, [r1, r2] + cmp r0, 0x7 + bne _08061F18 + mov r1, r9 + ldrb r0, [r1, 0x8] + cmp r0, 0 + beq _08061F04 + ldr r5, _08061F14 + movs r4, 0x5 +_08061EE8: + ldr r1, [r5] + movs r0, 0 + bl _call_via_r1 + movs r0, 0x1C + bl sub_803E46C + subs r4, 0x1 + cmp r4, 0 + bge _08061EE8 +_08061EFC: + add r2, sp, 0x5C +_08061EFE: + ldrh r0, [r2] + adds r0, 0x1 + strh r0, [r2] +_08061F04: + movs r0, 0x7 + mov r8, r0 + b _080621E6 + .align 2, 0 +_08061F0C: .4byte gUnknown_20255F0 +_08061F10: .4byte gUnknown_202EE10 +_08061F14: .4byte gUnknown_203B080 +_08061F18: + adds r0, r1, 0 + movs r1, 0 + bl sub_80136E0 +_08061F20: + cmp r4, 0x1 + bne _08061F50 + cmp r6, 0 + beq _08061F50 + add r2, sp, 0x5C + movs r1, 0 + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _08061F96 + ldr r5, _08061F4C + movs r4, 0x5 +_08061F36: + ldr r1, [r5] + movs r0, 0 + bl _call_via_r1 + movs r0, 0x1C + bl sub_803E46C + subs r4, 0x1 + cmp r4, 0 + bge _08061F36 + b _08061F8E + .align 2, 0 +_08061F4C: .4byte gUnknown_203B084 +_08061F50: + ldr r0, _08061F9C + ldrh r1, [r0, 0x4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08061FB0 + movs r0, 0x1 + bl sub_8083CE0 + ldr r1, _08061FA0 + movs r2, 0x18 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _08061FA8 + add r2, sp, 0x5C + movs r1, 0 + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _08061F96 + ldr r5, _08061FA4 + movs r4, 0x5 +_08061F7A: + ldr r1, [r5] + movs r0, 0 + bl _call_via_r1 + movs r0, 0x1C + bl sub_803E46C + subs r4, 0x1 + cmp r4, 0 + bge _08061F7A +_08061F8E: + add r1, sp, 0x5C +_08061F90: + ldrh r0, [r1] + subs r0, 0x1 + strh r0, [r1] +_08061F96: + movs r2, 0 + mov r8, r2 + b _080621E6 + .align 2, 0 +_08061F9C: .4byte gUnknown_20255F0 +_08061FA0: .4byte gUnknown_202EE10 +_08061FA4: .4byte gUnknown_203B084 +_08061FA8: + adds r0, r1, 0 + movs r1, 0 + bl sub_8013744 +_08061FB0: + bl sub_80048C8 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _08061FBE + b _08061C48 +_08061FBE: + ldr r5, _0806208C + ldrh r1, [r5, 0x2] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08061FDA + ldr r0, [sp, 0x124] + cmp r0, 0 + beq _08061FD2 + b _08061BDA +_08061FD2: + ldr r2, [sp, 0x120] + cmp r2, 0 + beq _08061FDA + b _08061BF8 +_08061FDA: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08061FF0 + ldr r2, _08062090 + adds r0, r2, 0 + adds r0, 0x29 + ldrb r0, [r0] + cmp r0, 0 + bne _08061FF0 + b _080621CA +_08061FF0: + ldr r0, [sp, 0x124] + cmp r0, 0 + beq _080620BC + movs r1, 0x18 + ldrsh r2, [r7, r1] + lsls r1, r2, 2 + add r0, sp, 0x8C + adds r0, r1 + ldr r6, [r0] + mov r8, r2 + bl sub_8062D68 + ldr r0, _08062094 + str r4, [r0] + bl sub_8083D08 + movs r0, 0xC + movs r1, 0 + bl sub_8044F5C + add r0, sp, 0xB0 + movs r1, 0x16 + bl sub_805FC30 + ldr r4, _08062090 + movs r2, 0x2A + adds r2, r4 + mov r10, r2 +_08062028: + adds r0, r4, 0 + bl AddMenuCursorSprite + movs r0, 0x1C + bl sub_803E46C + ldrh r1, [r5, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0806204C + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80136E0 +_0806204C: + ldrh r1, [r5, 0x4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08062064 + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8013744 +_08062064: + ldrh r1, [r5, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08062078 + adds r0, r4, 0 + adds r0, 0x29 + ldrb r0, [r0] + cmp r0, 0 + beq _08062098 +_08062078: + bl sub_8083D08 + adds r0, r6, 0 + bl sub_806285C +_08062082: + movs r0, 0 + str r0, [sp, 0x128] + mov r10, r0 + b _080621E6 + .align 2, 0 +_0806208C: .4byte gUnknown_20255F0 +_08062090: .4byte gUnknown_202EE10 +_08062094: .4byte gUnknown_202EE6C +_08062098: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080620A8 + mov r1, r10 + ldrb r0, [r1] + cmp r0, 0 + beq _08062028 +_080620A8: + bl sub_8083D30 + b _080621BA +_080620AE: + bl sub_8083D08 + movs r1, 0x18 + ldrsh r0, [r7, r1] + cmp r0, 0 + bne _080621B0 + b _08062198 +_080620BC: + ldr r2, [sp, 0x120] + cmp r2, 0 + bne _080620C4 + b _080621C0 +_080620C4: + movs r0, 0x18 + ldrsh r1, [r7, r0] + mov r2, r9 + adds r0, r2, r1 + ldrb r6, [r0] + mov r8, r1 + bl sub_8062D68 + ldr r0, _08062190 + ldr r1, [sp, 0x124] + str r1, [r0] + bl sub_8083D08 + movs r0, 0x28 + movs r1, 0 + bl sub_8044F5C + movs r0, 0xC + movs r1, 0 + bl sub_8044F5C + ldr r0, [sp, 0x110] + movs r1, 0x1 + bl sub_8070B6C + lsls r0, 24 + cmp r0, 0 + beq _08062102 + movs r0, 0x28 + bl sub_8044FF0 +_08062102: + add r0, sp, 0xB0 + movs r1, 0x16 + bl sub_805FC30 + ldr r4, _08062194 + movs r2, 0x2A + adds r2, r4 + mov r10, r2 +_08062112: + adds r0, r4, 0 + bl AddMenuCursorSprite + movs r0, 0x1C + bl sub_803E46C + ldrh r1, [r5, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08062136 + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80136E0 +_08062136: + ldrh r1, [r5, 0x4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0806214E + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8013744 +_0806214E: + ldrh r1, [r5, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08062162 + adds r0, r4, 0 + adds r0, 0x29 + ldrb r0, [r0] + cmp r0, 0 + beq _08062174 +_08062162: + movs r1, 0x18 + ldrsh r0, [r4, r1] + bl sub_8044F3C + lsls r0, 24 + cmp r0, 0 + bne _080620AE + bl sub_8083D30 +_08062174: + ldrh r1, [r5, 0x2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08062186 + mov r2, r10 + ldrb r0, [r2] + cmp r0, 0 + beq _08062112 +_08062186: + bl sub_8083D30 + movs r0, 0 + mov r10, r0 + b _080621E6 + .align 2, 0 +_08062190: .4byte gUnknown_202EE6C +_08062194: .4byte gUnknown_202EE10 +_08062198: + ldr r0, _080621AC + bl sub_8083E38 + ldr r0, [sp, 0x11C] + adds r0, 0x8C + adds r1, r6, 0 + bl sub_808EBF4 + b _080621BA + .align 2, 0 +_080621AC: .4byte 0x00000133 +_080621B0: + adds r0, r6, 0 + bl sub_806262C + movs r1, 0 + str r1, [sp, 0x128] +_080621BA: + movs r2, 0 + mov r10, r2 + b _080621E6 +_080621C0: + bl sub_8083D08 + movs r0, 0x1 + mov r10, r0 + b _080621E6 +_080621CA: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080621DE + adds r0, r2, 0 + adds r0, 0x2A + ldrb r0, [r0] + cmp r0, 0 + bne _080621DE + b _08061C48 +_080621DE: + bl sub_8083D30 + movs r1, 0x1 +_080621E4: + mov r10, r1 +_080621E6: + ldr r2, [sp, 0x128] + cmp r2, 0 + beq _08062204 + ldr r0, [sp, 0x120] + cmp r0, 0 + bne _080621F8 + ldr r1, [sp, 0x124] + cmp r1, 0 + beq _080621FE +_080621F8: + ldr r0, _0806222C + bl AddMenuCursorSprite +_080621FE: + movs r0, 0x1C + bl sub_803E46C +_08062204: + mov r2, r10 + cmp r2, 0 + bne _0806220C + b _08061B18 +_0806220C: + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + ldr r0, [sp, 0x110] + bl sub_807191C + add sp, 0x130 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0806222C: .4byte gUnknown_202EE10 + thumb_func_end sub_8061A38 + + thumb_func_start sub_8062230 +sub_8062230: + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x8 + ldr r0, _08062380 + ldr r0, [r0] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + bne _08062248 + b _08062372 +_08062248: + ldr r0, _08062384 + mov r9, r0 + movs r0, 0 + movs r1, 0 + str r0, [sp] + str r1, [sp, 0x4] + mov r0, sp + ldrh r0, [r0] + ldr r1, _08062388 + ands r1, r0 + ldr r3, _0806238C + ldr r0, [sp] + ands r0, r3 + orrs r0, r1 + str r0, [sp] + mov r1, sp + ldrh r1, [r1] + adds r2, r3, 0 + ands r2, r0 + orrs r2, r1 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r0, _08062390 + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r6, _08062394 + mov r8, r6 + mov r0, r8 + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r0, _08062398 + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r0, _0806239C + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + movs r4, 0x80 + lsls r4, 7 + mov r0, sp + ldrh r1, [r0] + ldr r6, _080623A0 + adds r0, r6, 0 + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + orrs r4, r0 + ands r3, r1 + orrs r3, r4 + str r3, [sp] + movs r1, 0x80 + lsls r1, 6 + mov r5, sp + ldrh r0, [r5, 0x2] + ldr r2, _080623A4 + ands r2, r0 + orrs r2, r1 + ands r2, r6 + movs r3, 0xFC + lsls r3, 2 + ldrh r1, [r5, 0x4] + movs r0, 0xFC + lsls r0, 8 + ands r0, r1 + orrs r0, r3 + mov r1, r8 + ands r0, r1 + movs r3, 0xF + movs r1, 0xF0 + lsls r1, 8 + ldr r4, _080623A8 + ands r0, r4 + orrs r0, r1 + strh r0, [r5, 0x4] + mov r6, r9 + movs r1, 0x2 + ldrsh r0, [r6, r1] + lsls r0, 3 + adds r0, 0x8 + ands r0, r4 + lsls r0, 4 + ldrh r1, [r5, 0x6] + ands r3, r1 + orrs r3, r0 + strh r3, [r5, 0x6] + movs r3, 0 + ldrsh r0, [r6, r3] + lsls r0, 3 + adds r0, 0x40 + ldr r1, _080623AC + ands r0, r1 + movs r1, 0xFE + lsls r1, 8 + ands r2, r1 + orrs r2, r0 + strh r2, [r5, 0x2] + movs r1, 0x80 + lsls r1, 1 + mov r0, sp + movs r2, 0 + movs r3, 0 + bl AddSprite +_08062372: + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08062380: .4byte gUnknown_202EDCC +_08062384: .4byte gUnknown_2027370 +_08062388: .4byte 0x0000feff +_0806238C: .4byte 0xffff0000 +_08062390: .4byte 0x0000fdff +_08062394: .4byte 0x0000f3ff +_08062398: .4byte 0x0000efff +_0806239C: .4byte 0x0000dfff +_080623A0: .4byte 0x00003fff +_080623A4: .4byte 0x0000c1ff +_080623A8: .4byte 0x00000fff +_080623AC: .4byte 0x000001ff + thumb_func_end sub_8062230 + + thumb_func_start sub_80623B0 +sub_80623B0: + push {r4-r6,lr} + sub sp, 0x8 + ldr r0, _080624D4 + ldr r0, [r0] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + bne _080623C2 + b _080624CA +_080623C2: + ldr r6, _080624D8 + movs r0, 0 + movs r1, 0 + str r0, [sp] + str r1, [sp, 0x4] + mov r0, sp + ldrh r0, [r0] + ldr r1, _080624DC + ands r1, r0 + ldr r3, _080624E0 + ldr r0, [sp] + ands r0, r3 + orrs r0, r1 + str r0, [sp] + mov r1, sp + ldrh r1, [r1] + adds r2, r3, 0 + ands r2, r0 + orrs r2, r1 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r0, _080624E4 + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r5, _080624E8 + adds r0, r5, 0 + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r0, _080624EC + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r0, _080624F0 + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + movs r4, 0x80 + lsls r4, 7 + mov r0, sp + ldrh r1, [r0] + ldr r0, _080624F4 + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + orrs r4, r0 + ands r3, r1 + orrs r3, r4 + str r3, [sp] + mov r3, sp + movs r2, 0xFC + lsls r2, 2 + ldrh r1, [r3, 0x4] + movs r0, 0xFC + lsls r0, 8 + ands r0, r1 + orrs r0, r2 + ands r0, r5 + movs r2, 0xF + movs r1, 0xF0 + lsls r1, 8 + ldr r4, _080624F8 + ands r0, r4 + orrs r0, r1 + strh r0, [r3, 0x4] + movs r1, 0x2 + ldrsh r0, [r6, r1] + lsls r0, 3 + adds r0, 0x70 + ands r0, r4 + lsls r0, 4 + ldrh r1, [r3, 0x6] + ands r2, r1 + orrs r2, r0 + strh r2, [r3, 0x6] + movs r1, 0 + ldrsh r0, [r6, r1] + lsls r0, 3 + adds r0, 0x40 + ldr r1, _080624FC + ands r0, r1 + strh r0, [r3, 0x2] + subs r1, 0xFF + mov r0, sp + movs r2, 0 + movs r3, 0 + bl AddSprite +_080624CA: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080624D4: .4byte gUnknown_202EDCC +_080624D8: .4byte gUnknown_2027370 +_080624DC: .4byte 0x0000feff +_080624E0: .4byte 0xffff0000 +_080624E4: .4byte 0x0000fdff +_080624E8: .4byte 0x0000f3ff +_080624EC: .4byte 0x0000efff +_080624F0: .4byte 0x0000dfff +_080624F4: .4byte 0x00003fff +_080624F8: .4byte 0x00000fff +_080624FC: .4byte 0x000001ff + thumb_func_end sub_80623B0 + + thumb_func_start sub_8062500 +sub_8062500: + push {r4,r5,lr} + ldr r0, _0806257C + ldr r0, [r0] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08062574 + ldr r5, _08062580 + ldr r0, _08062584 + ldrh r2, [r0] + ldr r1, _08062588 + ands r1, r2 + ldr r2, _0806258C + ands r1, r2 + ldr r4, _08062590 + ands r1, r4 + ldr r2, _08062594 + ands r1, r2 + ldr r2, _08062598 + ands r1, r2 + movs r3, 0x80 + lsls r3, 7 + ldr r2, _0806259C + ands r1, r2 + orrs r1, r3 + strh r1, [r0] + movs r3, 0xFC + lsls r3, 2 + ldrh r2, [r0, 0x4] + movs r1, 0xFC + lsls r1, 8 + ands r1, r2 + orrs r1, r3 + ands r1, r4 + movs r3, 0xF + movs r2, 0xF0 + lsls r2, 8 + ldr r4, _080625A0 + ands r1, r4 + orrs r1, r2 + strh r1, [r0, 0x4] + movs r2, 0x2 + ldrsh r1, [r5, r2] + lsls r1, 3 + adds r1, 0x60 + ands r1, r4 + lsls r1, 4 + ldrh r2, [r0, 0x6] + ands r3, r2 + orrs r3, r1 + strh r3, [r0, 0x6] + movs r1, 0x70 + strh r1, [r0, 0x2] + adds r1, 0x90 + movs r2, 0 + movs r3, 0 + bl AddSprite +_08062574: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0806257C: .4byte gUnknown_202EDCC +_08062580: .4byte gUnknown_2027370 +_08062584: .4byte gUnknown_202F268 +_08062588: .4byte 0x0000feff +_0806258C: .4byte 0x0000fdff +_08062590: .4byte 0x0000f3ff +_08062594: .4byte 0x0000efff +_08062598: .4byte 0x0000dfff +_0806259C: .4byte 0x00003fff +_080625A0: .4byte 0x00000fff + thumb_func_end sub_8062500 + + thumb_func_start sub_80625A4 +sub_80625A4: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + adds r7, r0, 0 + mov r9, r1 + mov r0, sp + bl sub_801317C + movs r4, 0 + cmp r4, r7 + bge _0806261A + subs r0, r7, 0x1 + mov r8, r0 + mov r5, sp +_080625C4: + lsls r0, r4, 2 + add r0, r9 + ldr r0, [r0] + mov r1, sp + bl sub_80639E4 + adds r6, r4, 0x1 + b _080625E8 +_080625D4: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080625E2 + ldrb r0, [r5, 0x2] + cmp r0, 0 + beq _080625E8 +_080625E2: + bl sub_8083D30 + b _08062614 +_080625E8: + cmp r4, r8 + bge _080625F0 + bl sub_8062500 +_080625F0: + mov r0, sp + movs r1, 0 + bl nullsub_34 + movs r0, 0x16 + bl sub_803E46C + ldr r0, _08062628 + ldrh r1, [r0, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08062610 + ldrb r0, [r5, 0x1] + cmp r0, 0 + beq _080625D4 +_08062610: + bl sub_8083D08 +_08062614: + adds r4, r6, 0 + cmp r4, r7 + blt _080625C4 +_0806261A: + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08062628: .4byte gUnknown_20255F0 + thumb_func_end sub_80625A4 + + thumb_func_start sub_806262C +sub_806262C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x88 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + mov r0, sp + adds r0, 0x70 + str r0, [sp, 0x84] + add r0, sp, 0x10 + mov r8, r0 + movs r0, 0 + mov r9, r0 + add r7, sp, 0x4 + add r6, sp, 0x80 +_08062650: + add r0, sp, 0x4 + bl sub_801317C + mov r0, r8 + bl sub_80140B4 + mov r0, r8 + str r6, [r0, 0x14] + movs r1, 0x1 + add r0, sp, 0x80 + strb r1, [r0] + mov r0, r9 + strb r0, [r6, 0x1] + movs r0, 0x10 + strb r0, [r6, 0x2] + mov r0, r9 + strb r0, [r6, 0x3] + mov r0, r8 + bl sub_803ECB4 + movs r0, 0 + bl sub_80073B8 + mov r0, r10 + bl sub_808EAB0 + adds r1, r0, 0 + ldr r0, _080626CC + bl strcpy + ldr r0, _080626D0 + ldr r2, [r0] + mov r0, r9 + str r0, [sp] + movs r0, 0x10 + movs r1, 0 + movs r3, 0 + bl sub_8014FF0 + mov r0, r10 + bl sub_808EADC + adds r2, r0, 0 + mov r0, r9 + str r0, [sp] + movs r0, 0x8 + movs r1, 0x10 + movs r3, 0 + bl sub_8014FF0 + movs r0, 0 + bl sub_80073E0 + mov r0, r10 + bl sub_808EADC + ldr r1, [sp, 0x84] + bl sub_8097DF0 + adds r5, r0, 0 + b _080626EA + .align 2, 0 +_080626CC: .4byte gUnknown_202DE58 +_080626D0: .4byte gUnknown_80FE95C +_080626D4: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080626E2 + ldrb r0, [r7, 0x2] + cmp r0, 0 + beq _080626EA +_080626E2: + movs r4, 0x1 + bl sub_8083D30 + b _08062718 +_080626EA: + cmp r5, 0 + beq _080626F2 + bl sub_8062500 +_080626F2: + add r0, sp, 0x4 + movs r1, 0 + bl nullsub_34 + movs r0, 0x16 + bl sub_803E46C + ldr r0, _0806272C + ldrh r1, [r0, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08062712 + ldrb r0, [r7, 0x1] + cmp r0, 0 + beq _080626D4 +_08062712: + movs r4, 0 + bl sub_8083D08 +_08062718: + cmp r4, 0 + bne _08062730 + cmp r5, 0 + beq _08062730 + adds r0, r5, 0 + ldr r1, [sp, 0x84] + bl sub_80625A4 + b _08062650 + .align 2, 0 +_0806272C: .4byte gUnknown_20255F0 +_08062730: + movs r0, 0x4 + movs r1, 0x3E + bl sub_803E708 + add sp, 0x88 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_806262C + + thumb_func_start sub_8062748 +sub_8062748: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x88 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + mov r0, sp + adds r0, 0x70 + str r0, [sp, 0x84] + add r0, sp, 0x10 + mov r8, r0 + movs r0, 0 + mov r9, r0 + add r7, sp, 0x4 + add r6, sp, 0x80 +_0806276C: + add r0, sp, 0x4 + bl sub_801317C + mov r0, r8 + bl sub_80140B4 + mov r0, r8 + str r6, [r0, 0x14] + movs r1, 0x1 + add r0, sp, 0x80 + strb r1, [r0] + mov r0, r9 + strb r0, [r6, 0x1] + movs r0, 0x10 + strb r0, [r6, 0x2] + mov r0, r9 + strb r0, [r6, 0x3] + mov r0, r8 + bl sub_803ECB4 + movs r0, 0 + bl sub_80073B8 + ldr r0, _080627E0 + mov r1, r10 + bl sub_808EAC0 + ldr r0, _080627E4 + ldr r2, [r0] + mov r0, r9 + str r0, [sp] + movs r0, 0x10 + movs r1, 0 + movs r3, 0 + bl sub_8014FF0 + mov r0, r10 + bl sub_808EAEC + adds r2, r0, 0 + mov r0, r9 + str r0, [sp] + movs r0, 0x8 + movs r1, 0x10 + movs r3, 0 + bl sub_8014FF0 + movs r0, 0 + bl sub_80073E0 + mov r0, r10 + bl sub_808EAEC + ldr r1, [sp, 0x84] + bl sub_8097DF0 + adds r5, r0, 0 + b _080627FE + .align 2, 0 +_080627E0: .4byte gUnknown_202DE58 +_080627E4: .4byte gUnknown_80FE960 +_080627E8: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080627F6 + ldrb r0, [r7, 0x2] + cmp r0, 0 + beq _080627FE +_080627F6: + movs r4, 0x1 + bl sub_8083D30 + b _0806282C +_080627FE: + cmp r5, 0 + beq _08062806 + bl sub_8062500 +_08062806: + add r0, sp, 0x4 + movs r1, 0 + bl nullsub_34 + movs r0, 0x3E + bl sub_803E46C + ldr r0, _08062840 + ldrh r1, [r0, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08062826 + ldrb r0, [r7, 0x1] + cmp r0, 0 + beq _080627E8 +_08062826: + movs r4, 0 + bl sub_8083D08 +_0806282C: + cmp r4, 0 + bne _08062844 + cmp r5, 0 + beq _08062844 + adds r0, r5, 0 + ldr r1, [sp, 0x84] + bl sub_80625A4 + b _0806276C + .align 2, 0 +_08062840: .4byte gUnknown_20255F0 +_08062844: + movs r0, 0x4 + movs r1, 0x3E + bl sub_803E708 + add sp, 0x88 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8062748 + + thumb_func_start sub_806285C +sub_806285C: + push {r4-r6,lr} + mov r6, r10 + mov r5, r9 + mov r4, r8 + push {r4-r6} + sub sp, 0xD4 + mov r10, r0 + add r0, sp, 0x10 + mov r8, r0 + add r5, sp, 0x70 + adds r0, r5, 0 + movs r1, 0 + movs r2, 0x60 + bl memset + movs r0, 0x6 + str r0, [sp, 0x74] + add r1, sp, 0x78 + movs r6, 0 + movs r0, 0 + mov r9, r0 + movs r0, 0x2 + strh r0, [r1] + strh r0, [r1, 0x2] + add r1, sp, 0x7C + movs r0, 0x1A + strh r0, [r1] + mov r0, sp + adds r0, 0x7E + movs r1, 0xC + strh r1, [r0] + add r0, sp, 0x80 + strh r1, [r0] + add r0, sp, 0x84 + add r4, sp, 0xD0 + str r4, [r0] + add r0, sp, 0x88 + movs r1, 0x3 + str r1, [r0, 0x4] + add r0, sp, 0xA0 + str r1, [r0, 0x4] + add r0, sp, 0xB8 + str r1, [r0, 0x4] + mov r0, r8 + adds r1, r5, 0 + movs r2, 0x60 + bl memcpy + add r0, sp, 0x4 + bl sub_801317C + movs r0, 0x1 + strb r0, [r4] + strb r6, [r4, 0x1] + movs r0, 0x10 + strb r0, [r4, 0x2] + strb r6, [r4, 0x3] + mov r0, r8 + movs r1, 0x1 + bl sub_803ECB4 + movs r0, 0 + bl sub_80073B8 + mov r0, r10 + bl sub_808E4FC + adds r1, r0, 0 + ldr r0, _0806291C + bl strcpy + ldr r0, _08062920 + ldr r2, [r0] + mov r0, r9 + str r0, [sp] + movs r0, 0x10 + movs r1, 0 + movs r3, 0 + bl sub_8014FF0 + mov r0, r10 + bl sub_808E51C + adds r2, r0, 0 + mov r0, r9 + str r0, [sp] + movs r0, 0x8 + movs r1, 0x10 + movs r3, 0 + bl sub_8014FF0 + movs r0, 0 + bl sub_80073E0 + add r4, sp, 0x4 + b _08062938 + .align 2, 0 +_0806291C: .4byte gUnknown_202DE58 +_08062920: .4byte gUnknown_80FE964 +_08062924: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08062932 + ldrb r0, [r4, 0x2] + cmp r0, 0 + beq _08062938 +_08062932: + bl sub_8083D30 + b _0806295C +_08062938: + add r0, sp, 0x4 + movs r1, 0 + bl nullsub_34 + movs r0, 0x16 + bl sub_803E46C + ldr r0, _08062974 + ldrh r1, [r0, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08062958 + ldrb r0, [r4, 0x1] + cmp r0, 0 + beq _08062924 +_08062958: + bl sub_8083D08 +_0806295C: + movs r0, 0x4 + movs r1, 0x3E + bl sub_803E708 + add sp, 0xD4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08062974: .4byte gUnknown_20255F0 + thumb_func_end sub_806285C + + thumb_func_start sub_8062978 +sub_8062978: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x80 + mov r8, r0 + adds r6, r1, 0 + add r4, sp, 0x1C + ldr r1, _080629AC + adds r0, r4, 0 + movs r2, 0x60 + bl memcpy + movs r0, 0 + str r0, [sp, 0x7C] + mov r1, r8 + cmp r1, 0 + beq _080629A2 + subs r0, 0x1 + str r0, [r1] +_080629A2: + cmp r6, 0x1 + bne _080629BA + add r1, sp, 0x4C + ldr r0, _080629B0 + b _080629C2 + .align 2, 0 +_080629AC: .4byte gUnknown_8106C30 +_080629B0: .4byte gUnknown_8106C00 +_080629B4: + bl sub_8083D08 + b _08062AF4 +_080629BA: + cmp r6, 0x2 + bne _080629CA + add r1, sp, 0x4C + ldr r0, _08062A38 +_080629C2: + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} +_080629CA: + add r0, sp, 0x4 + adds r1, r4, 0 + movs r2, 0 + bl sub_8061130 + movs r0, 0x1 + bl sub_80073B8 + ldr r0, _08062A3C + ldr r2, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0x4 + movs r1, 0x3 + movs r3, 0x1 + bl xxx_call_draw_string + movs r0, 0x1 + bl sub_80073E0 + ldr r0, _08062A40 + mov r9, r0 + add r7, sp, 0x8 + ldr r1, _08062A44 + mov r10, r1 +_080629FC: + mov r2, r10 + movs r3, 0x18 + ldrsh r0, [r2, r3] + lsls r0, 2 + adds r0, r7, r0 + ldr r5, [r0] + cmp r5, 0 + blt _08062A70 + ldr r0, _08062A48 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _08062A4C + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08062A5A + cmp r9, r5 + beq _08062A5A + cmp r6, 0x1 + bne _08062A50 + adds r0, r4, 0 + bl sub_8062B74 + b _08062A5A + .align 2, 0 +_08062A38: .4byte gUnknown_8106C18 +_08062A3C: .4byte gUnknown_80FE950 +_08062A40: .4byte 0xfffffc27 +_08062A44: .4byte gUnknown_202EE10 +_08062A48: .4byte gUnknown_203B418 +_08062A4C: .4byte 0x0001357c +_08062A50: + cmp r6, 0x2 + bne _08062A5A + adds r0, r4, 0 + bl sub_8062CA8 +_08062A5A: + mov r9, r5 + adds r0, r4, 0 + movs r1, 0 + bl sub_806A2BC + adds r0, r4, 0x4 + movs r1, 0 + movs r2, 0x1 + movs r3, 0x1 + bl sub_804A728 +_08062A70: + ldr r5, _08062B40 + adds r0, r5, 0 + bl AddMenuCursorSprite + movs r0, 0x1B + bl sub_803E46C + ldr r4, _08062B44 + ldrh r1, [r4, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08062A98 + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80136E0 +_08062A98: + ldrh r1, [r4, 0x4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08062AB0 + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_8013744 +_08062AB0: + ldrh r1, [r4, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08062AC4 + adds r0, r5, 0 + adds r0, 0x29 + ldrb r0, [r0] + cmp r0, 0 + beq _08062AD8 +_08062AC4: + movs r3, 0x18 + ldrsh r0, [r5, r3] + add r1, sp, 0x18 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _08062AD4 + b _080629B4 +_08062AD4: + bl sub_8083D30 +_08062AD8: + ldr r0, _08062B44 + ldrh r1, [r0, 0x2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08062AEC + ldr r5, _08062B48 + ldrb r0, [r5] + cmp r0, 0 + beq _080629FC +_08062AEC: + bl sub_8083D30 + movs r0, 0x1 + str r0, [sp, 0x7C] +_08062AF4: + ldr r4, _08062B40 + adds r0, r4, 0 + bl AddMenuCursorSprite + movs r0, 0x1B + bl sub_803E46C + bl sub_804AA60 + bl sub_8083600 + movs r1, 0 + bl sub_806A2BC + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + movs r0, 0x4 + movs r1, 0x3E + bl sub_803E708 + ldr r1, [sp, 0x7C] + cmp r1, 0 + bne _08062B3C + movs r2, 0x18 + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r7, r0 + ldr r5, [r0] + mov r3, r8 + cmp r3, 0 + beq _08062B38 + str r5, [r3] +_08062B38: + cmp r5, 0 + bge _08062B4C +_08062B3C: + movs r0, 0 + b _08062B5A + .align 2, 0 +_08062B40: .4byte gUnknown_202EE10 +_08062B44: .4byte gUnknown_20255F0 +_08062B48: .4byte gUnknown_202EE3A +_08062B4C: + ldr r0, _08062B6C + ldr r0, [r0] + lsls r1, r5, 2 + ldr r5, _08062B70 + adds r0, r5 + adds r0, r1 + ldr r0, [r0] +_08062B5A: + add sp, 0x80 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08062B6C: .4byte gUnknown_203B418 +_08062B70: .4byte 0x0001357c + thumb_func_end sub_8062978 + + thumb_func_start sub_8062B74 +sub_8062B74: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + mov r10, r0 + ldr r0, [r0, 0x70] + mov r9, r0 + movs r0, 0x2 + bl sub_8008C54 + movs r0, 0x2 + bl sub_80073B8 + ldr r0, _08062BD0 + mov r1, r10 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08062BD4 + ldr r2, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0xC + movs r1, 0 + movs r3, 0x2 + bl sub_8014FF0 + movs r1, 0x10 + mov r8, r1 + mov r0, r9 + adds r0, 0xA4 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08062BDE + mov r0, r9 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x4A + beq _08062BCA + cmp r0, 0x47 + bne _08062BD8 +_08062BCA: + movs r0, 0x1 + b _08062BDA + .align 2, 0 +_08062BD0: .4byte gUnknown_202DF98 +_08062BD4: .4byte gUnknown_80FE978 +_08062BD8: + movs r0, 0 +_08062BDA: + cmp r0, 0 + beq _08062BF4 +_08062BDE: + ldr r2, _08062BF0 + movs r0, 0 + str r0, [sp] + movs r0, 0xC + mov r1, r8 + movs r3, 0x2 + bl sub_8014FF0 + b _08062C8A + .align 2, 0 +_08062BF0: .4byte gUnknown_8106C90 +_08062BF4: + movs r7, 0 + movs r4, 0x8C + lsls r4, 1 + add r4, r9 + adds r5, r4, 0 +_08062BFE: + add r0, sp, 0x4 + movs r1, 0 + movs r2, 0xC + bl memset + movs r0, 0x6A + str r0, [sp, 0x8] + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08062C80 + mov r1, r9 + ldrb r0, [r1, 0x7] + cmp r0, 0 + beq _08062C22 + movs r0, 0x2 + b _08062C24 +_08062C22: + movs r0, 0x4 +_08062C24: + str r0, [sp, 0x4] + mov r0, r10 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_80573CC + add r1, sp, 0x4 + movs r2, 0 + lsls r0, 24 + cmp r0, 0 + bne _08062C3C + movs r2, 0x1 +_08062C3C: + strb r2, [r1, 0x8] + ldr r0, _08062CA0 + adds r1, r5, 0 + add r2, sp, 0x4 + bl sub_80928C0 + ldrb r1, [r4] + movs r0, 0x2 + ands r0, r1 + movs r6, 0xD + cmp r0, 0 + bne _08062C6C + movs r6, 0x8 + cmp r7, 0 + beq _08062C6C + mov r2, r8 + subs r2, 0x2 + movs r0, 0x7 + str r0, [sp] + movs r0, 0x2 + movs r1, 0xC + movs r3, 0x78 + bl sub_80078A4 +_08062C6C: + movs r0, 0 + str r0, [sp] + adds r0, r6, 0 + mov r1, r8 + ldr r2, _08062CA4 + movs r3, 0x2 + bl sub_8014FF0 + movs r0, 0xC + add r8, r0 +_08062C80: + adds r4, 0x8 + adds r5, 0x8 + adds r7, 0x1 + cmp r7, 0x3 + ble _08062BFE +_08062C8A: + movs r0, 0x2 + bl sub_80073E0 + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08062CA0: .4byte gUnknown_202DE58 +_08062CA4: .4byte gUnknown_8106C98 + thumb_func_end sub_8062B74 + + thumb_func_start sub_8062CA8 +sub_8062CA8: + push {r4-r7,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldr r5, [r4, 0x70] + movs r0, 0x2 + bl sub_8008C54 + movs r0, 0x2 + bl sub_80073B8 + ldr r0, _08062CF8 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08062CFC + ldr r2, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0xC + movs r1, 0 + movs r3, 0x2 + bl sub_8014FF0 + movs r7, 0x8 + movs r6, 0x12 + adds r0, r5, 0 + adds r0, 0xA4 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08062D08 + adds r0, r5, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x4A + beq _08062CF4 + cmp r0, 0x47 + bne _08062D00 +_08062CF4: + movs r0, 0x1 + b _08062D02 + .align 2, 0 +_08062CF8: .4byte gUnknown_202DF98 +_08062CFC: .4byte gUnknown_80FE940 +_08062D00: + movs r0, 0 +_08062D02: + adds r4, r0, 0 + cmp r4, 0 + beq _08062D18 +_08062D08: + ldr r2, _08062D14 + movs r0, 0 + str r0, [sp] + movs r0, 0x8 + b _08062D2C + .align 2, 0 +_08062D14: .4byte gUnknown_8106C90 +_08062D18: + adds r2, r5, 0 + adds r2, 0x60 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08062D3C + ldr r2, _08062D38 + str r4, [sp] + adds r0, r7, 0 +_08062D2C: + adds r1, r6, 0 + movs r3, 0x2 + bl sub_8014FF0 + b _08062D52 + .align 2, 0 +_08062D38: .4byte gUnknown_8106C9C +_08062D3C: + ldr r0, _08062D60 + adds r1, r2, 0 + bl sub_8045C18 + ldr r2, _08062D64 + str r4, [sp] + adds r0, r7, 0 + adds r1, r6, 0 + movs r3, 0x2 + bl sub_8014FF0 +_08062D52: + movs r0, 0x2 + bl sub_80073E0 + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08062D60: .4byte gUnknown_202DE58 +_08062D64: .4byte gUnknown_8106C98 + thumb_func_end sub_8062CA8 + + thumb_func_start sub_8062D68 +sub_8062D68: + push {lr} + ldr r0, _08062D84 + movs r1, 0 + strh r1, [r0, 0x1E] + strh r1, [r0, 0x20] + strh r1, [r0, 0xC] + strh r1, [r0, 0xE] + strh r1, [r0, 0x14] + adds r0, 0x28 + bl sub_801317C + pop {r0} + bx r0 + .align 2, 0 +_08062D84: .4byte gUnknown_202EE10 + thumb_func_end sub_8062D68 + + thumb_func_start sub_8062D88 +sub_8062D88: + movs r0, 0x1 + bx lr + thumb_func_end sub_8062D88 + + thumb_func_start sub_8062D8C +sub_8062D8C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + mov r10, r0 + ldrb r5, [r0, 0x4] + ldr r0, _08062E24 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _08062E28 + adds r0, r2 + adds r0, r1 + ldr r0, [r0] + str r0, [sp, 0x4] + adds r7, r0, 0 +_08062DAE: + movs r0, 0 + mov r9, r0 + movs r6, 0 + movs r4, 0 + adds r2, r7, 0x4 + mov r8, r2 +_08062DBA: + ldr r0, _08062E24 + ldr r0, [r0] + lsls r1, r4, 2 + ldr r2, _08062E28 + adds r0, r2 + adds r0, r1 + ldr r0, [r0] + bl sub_8071A8C + lsls r0, 24 + cmp r0, 0 + beq _08062DDA + cmp r4, r5 + bne _08062DD8 + mov r9, r6 +_08062DD8: + adds r6, 0x1 +_08062DDA: + adds r4, 0x1 + cmp r4, 0x3 + ble _08062DBA + adds r0, r7, 0 + movs r1, 0 + bl sub_806A2BC + mov r0, r8 + movs r1, 0 + movs r2, 0x1 + movs r3, 0x1 + bl sub_804A728 + movs r0, 0x1 + bl sub_8044C10 + str r6, [sp] + adds r0, r7, 0 + movs r1, 0 + movs r2, 0x1 + mov r3, r9 + bl sub_8062F90 + lsls r0, 24 + cmp r0, 0 + beq _08062E10 + b _08062F80 +_08062E10: + bl sub_805F1AC + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x6 + bne _08062E6C + adds r6, r5, 0 + movs r4, 0 + b _08062E2E + .align 2, 0 +_08062E24: .4byte gUnknown_203B418 +_08062E28: .4byte 0x0001357c +_08062E2C: + adds r4, 0x1 +_08062E2E: + cmp r4, 0x3 + bgt _08062E54 + adds r5, 0x1 + cmp r5, 0x3 + ble _08062E3A + movs r5, 0 +_08062E3A: + ldr r0, _08062E64 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _08062E68 + adds r0, r2 + adds r0, r1 + ldr r7, [r0] + adds r0, r7, 0 + bl sub_8071A8C + lsls r0, 24 + cmp r0, 0 + beq _08062E2C +_08062E54: + mov r0, r10 + strb r5, [r0, 0x4] + cmp r6, r5 + beq _08062F32 + movs r0, 0 + bl sub_8083CE0 + b _08062F32 + .align 2, 0 +_08062E64: .4byte gUnknown_203B418 +_08062E68: .4byte 0x0001357c +_08062E6C: + bl sub_805F1AC + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x7 + bne _08062EC0 + adds r6, r5, 0 + movs r4, 0 + b _08062E80 +_08062E7E: + adds r4, 0x1 +_08062E80: + cmp r4, 0x3 + bgt _08062EA6 + subs r5, 0x1 + cmp r5, 0 + bge _08062E8C + movs r5, 0x3 +_08062E8C: + ldr r0, _08062EB8 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _08062EBC + adds r0, r2 + adds r0, r1 + ldr r7, [r0] + adds r0, r7, 0 + bl sub_8071A8C + lsls r0, 24 + cmp r0, 0 + beq _08062E7E +_08062EA6: + mov r0, r10 + strb r5, [r0, 0x4] + cmp r6, r5 + beq _08062F32 + movs r0, 0 + bl sub_8083CE0 + b _08062F32 + .align 2, 0 +_08062EB8: .4byte gUnknown_203B418 +_08062EBC: .4byte 0x0001357c +_08062EC0: + bl sub_805F1AC + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1D + bne _08062ED6 + bl sub_805F1A0 + bl sub_80637E8 + b _08062F32 +_08062ED6: + bl sub_805F1AC + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1E + bne _08062EF6 + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + bl sub_805F1A0 + movs r1, 0x1 + bl sub_8063A70 + b _08062F32 +_08062EF6: + bl sub_805F1AC + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x33 + bne _08062F16 + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + bl sub_805F1A0 + movs r1, 0 + bl sub_8063A70 + b _08062F32 +_08062F16: + bl sub_805F1AC + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1F + bne _08062F3A + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + bl sub_805F1A0 + bl sub_8063B54 +_08062F32: + movs r0, 0x1 + bl sub_8044C10 + b _08062F5E +_08062F3A: + bl sub_805F1AC + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x21 + bne _08062F5E + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + bl sub_805F1A0 + movs r1, 0x1 + bl sub_8063CF0 + movs r0, 0x1 + bl sub_8044C10 +_08062F5E: + bl sub_805F1AC + lsls r0, 16 + cmp r0, 0 + bne _08062F6A + b _08062DAE +_08062F6A: + ldr r0, [sp, 0x4] + movs r1, 0 + bl sub_806A2BC + ldr r0, [sp, 0x4] + adds r0, 0x4 + movs r1, 0 + movs r2, 0x1 + movs r3, 0x1 + bl sub_804A728 +_08062F80: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8062D8C + + thumb_func_start sub_8062F90 +sub_8062F90: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xE8 + mov r8, r0 + str r3, [sp, 0xDC] + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0xD4] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0xD8] + ldr r0, [r0, 0x70] + mov r9, r0 + bl sub_8083600 + ldr r0, [r0, 0x70] + str r0, [sp, 0xE4] + add r4, sp, 0x70 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x60 + bl memset + movs r0, 0x6 + str r0, [sp, 0x74] + add r0, sp, 0x78 + movs r6, 0 + movs r1, 0x2 + strh r1, [r0] + strh r1, [r0, 0x2] + add r1, sp, 0x7C + movs r0, 0x12 + strh r0, [r1] + mov r0, sp + adds r0, 0x7E + movs r1, 0x10 + strh r1, [r0] + add r0, sp, 0x80 + strh r1, [r0] + add r5, sp, 0xD0 + str r5, [sp, 0x84] + movs r1, 0x3 + str r1, [sp, 0x8C] + add r0, sp, 0xA0 + str r1, [r0, 0x4] + add r0, sp, 0xB8 + str r1, [r0, 0x4] + add r0, sp, 0x10 + adds r1, r4, 0 + movs r2, 0x60 + bl memcpy + ldr r0, _080630A4 + str r6, [r0] + movs r3, 0 + ldr r7, [sp, 0xE4] + adds r7, 0x44 +_08063008: + lsls r0, r3, 3 + movs r1, 0x8C + lsls r1, 1 + adds r0, r1 + mov r1, r9 + adds r2, r1, r0 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08063032 + ldrb r1, [r2, 0x1] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08063032 + movs r0, 0xFD + ands r0, r1 + strb r0, [r2, 0x1] + ldr r0, _080630A4 + str r3, [r0] +_08063032: + adds r3, 0x1 + cmp r3, 0x3 + ble _08063008 +_08063038: + movs r5, 0 + movs r2, 0 + str r2, [sp, 0xE0] + mov r10, r2 + add r0, sp, 0xD0 + str r0, [sp] + add r1, sp, 0x70 + str r1, [sp, 0x4] + ldr r2, [sp, 0xDC] + str r2, [sp, 0x8] + ldr r0, [sp, 0x108] + str r0, [sp, 0xC] + mov r0, r8 + mov r1, r9 + ldr r2, [sp, 0xD4] + add r3, sp, 0x10 + bl sub_80633E4 +_0806305C: + ldr r0, _080630A8 + add r1, sp, 0x70 + bl AddMenuCursorSprite_ + movs r0, 0x1E + bl sub_803E46C + ldr r2, _080630AC + ldrh r1, [r2, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080630DE + ldrh r0, [r2] + lsrs r0, 8 + movs r1, 0x1 + ands r0, r1 + ldr r1, _080630A8 + movs r2, 0x18 + ldrsh r6, [r1, r2] + cmp r0, 0 + beq _080630BA + movs r0, 0x8C + lsls r0, 1 + add r0, r9 + adds r1, r6, 0 + bl sub_8092F80 + ldr r1, _080630A4 + str r0, [r1] + cmp r6, r0 + beq _080630B0 + movs r0, 0 + bl sub_8083CE0 + b _080630B4 + .align 2, 0 +_080630A4: .4byte gUnknown_202F2D8 +_080630A8: .4byte gUnknown_202EE10 +_080630AC: .4byte gUnknown_20255F0 +_080630B0: + bl sub_8083D30 +_080630B4: + movs r0, 0x1 + mov r10, r0 + b _080631F4 +_080630BA: + movs r0, 0x8C + lsls r0, 1 + add r0, r9 + adds r1, r6, 0 + bl sub_8092D80 + adds r1, r0, 0 + ldr r0, _08063118 + bl sub_8013780 + ldr r1, _08063118 + movs r2, 0x18 + ldrsh r0, [r1, r2] + cmp r6, r0 + beq _080630DE + movs r0, 0 + bl sub_8083CE0 +_080630DE: + ldr r2, _0806311C + ldrh r1, [r2, 0x4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08063150 + ldrh r0, [r2] + lsrs r0, 8 + movs r1, 0x1 + ands r0, r1 + ldr r4, _08063118 + movs r1, 0x18 + ldrsh r6, [r4, r1] + cmp r0, 0 + beq _0806312E + movs r0, 0x8C + lsls r0, 1 + add r0, r9 + adds r1, r6, 0 + bl sub_8093130 + ldr r1, _08063120 + str r0, [r1] + cmp r6, r0 + beq _08063124 + movs r0, 0 + bl sub_8083CE0 + b _08063128 + .align 2, 0 +_08063118: .4byte gUnknown_202EE10 +_0806311C: .4byte gUnknown_20255F0 +_08063120: .4byte gUnknown_202F2D8 +_08063124: + bl sub_8083D30 +_08063128: + movs r2, 0x1 + mov r10, r2 + b _080631F4 +_0806312E: + movs r0, 0x8C + lsls r0, 1 + add r0, r9 + adds r1, r6, 0 + bl sub_8092DB8 + adds r1, r0, 0 + adds r0, r4, 0 + bl sub_8013780 + movs r1, 0x18 + ldrsh r0, [r4, r1] + cmp r6, r0 + beq _08063150 + movs r0, 0 + bl sub_8083CE0 +_08063150: + ldr r4, _08063174 + ldrh r1, [r4, 0x4] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _08063168 + ldr r6, _08063178 + adds r0, r6, 0 + adds r0, 0x2B + ldrb r0, [r0] + cmp r0, 0 + beq _0806317C +_08063168: + adds r0, r7, 0 + movs r1, 0x6 + bl sub_8044C94 + b _080631F4 + .align 2, 0 +_08063174: .4byte gUnknown_20255F0 +_08063178: .4byte gUnknown_202EE10 +_0806317C: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _0806318E + adds r0, r6, 0 + adds r0, 0x2C + ldrb r0, [r0] + cmp r0, 0 + beq _08063198 +_0806318E: + adds r0, r7, 0 + movs r1, 0x7 + bl sub_8044C94 + b _080631F4 +_08063198: + bl sub_8062D88 + ldrh r1, [r4, 0x2] + ands r0, r1 + cmp r0, 0 + bne _080631AE + adds r0, r6, 0 + adds r0, 0x29 + ldrb r0, [r0] + cmp r0, 0 + beq _080631C8 +_080631AE: + ldr r2, [sp, 0xD4] + cmp r2, 0 + beq _080631C2 + ldrh r0, [r4] + lsrs r0, 8 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080631C2 + movs r5, 0x3 +_080631C2: + bl sub_8083D08 + b _080631F4 +_080631C8: + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _0806321C + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _08063214 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080631EC + adds r0, r6, 0 + adds r0, 0x2A + ldrb r0, [r0] + cmp r0, 0 + bne _080631EC + b _0806305C +_080631EC: + bl sub_8083D30 + movs r0, 0x1 + str r0, [sp, 0xE0] +_080631F4: + ldr r4, _08063210 + adds r0, r4, 0 + bl AddMenuCursorSprite + movs r0, 0x1E + bl sub_803E46C + ldrh r0, [r7] + subs r0, 0x6 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _08063224 + b _080633CC + .align 2, 0 +_08063210: .4byte gUnknown_202EE10 +_08063214: + movs r5, 0x2 + bl sub_8083D44 + b _080631F4 +_0806321C: + movs r5, 0x1 + bl sub_8083D44 + b _080631F4 +_08063224: + mov r1, r10 + cmp r1, 0 + beq _0806322C + b _08063038 +_0806322C: + ldr r2, [sp, 0xE0] + cmp r2, 0 + beq _08063234 + b _080633B6 +_08063234: + ldr r6, _08063270 + movs r1, 0x18 + ldrsh r0, [r4, r1] + str r0, [r6] + cmp r5, 0x1 + bne _08063274 + adds r0, r7, 0 + movs r1, 0x1D + bl sub_8044C94 + mov r0, r8 + adds r0, 0x24 + ldrb r1, [r0] + ldr r0, [sp, 0xE4] + adds r0, 0x48 + strb r1, [r0] + ldr r1, [r6] + ldr r0, [sp, 0xE4] + adds r0, 0x50 + strb r1, [r0] + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + movs r0, 0x8 + movs r1, 0x1B + bl sub_803E708 + b _080633B6 + .align 2, 0 +_08063270: .4byte gUnknown_202F2D8 +_08063274: + mov r0, r8 + ldr r1, [sp, 0xD4] + ldr r2, [sp, 0xD8] + bl sub_8063698 + cmp r5, 0x3 + bne _08063298 + movs r0, 0x20 + bl sub_8044FB4 + adds r6, r0, 0 + bl sub_8044F3C + lsls r0, 24 + cmp r0, 0 + bne _080632CC + movs r0, 0x21 + b _080632BC +_08063298: + cmp r5, 0x2 + bne _080632DE + mov r2, r9 + ldrb r0, [r2, 0x7] + cmp r0, 0 + beq _080632BA + movs r0, 0x1E + bl sub_8044FB4 + adds r6, r0, 0 + bl sub_8044F3C + lsls r0, 24 + cmp r0, 0 + bne _080632CC + movs r0, 0x33 + b _080632BC +_080632BA: + movs r0, 0x1F +_080632BC: + bl sub_8044FB4 + adds r6, r0, 0 + bl sub_8044F3C + lsls r0, 24 + cmp r0, 0 + beq _080632DE +_080632CC: + mov r0, r8 + bl sub_8045B60 + adds r2, r0, 0 + adds r0, r7, 0 + adds r1, r6, 0 + bl sub_80637BC + b _080633B6 +_080632DE: + movs r0, 0x2 + bl sub_8009524 + add r0, sp, 0x10 + movs r1, 0x16 + bl sub_805FC30 + ldr r6, _0806337C + ldr r5, _08063380 + movs r0, 0x2A + adds r0, r6 + mov r10, r0 + adds r4, r7, 0 +_080632F8: + adds r0, r6, 0 + bl AddMenuCursorSprite + movs r0, 0x1B + bl sub_803E46C + ldrh r1, [r5, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0806331C + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r6, 0 + movs r1, 0x1 + bl sub_80136E0 +_0806331C: + ldrh r1, [r5, 0x4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08063334 + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r6, 0 + movs r1, 0x1 + bl sub_8013744 +_08063334: + bl sub_8062D88 + ldrh r1, [r5, 0x2] + ands r1, r0 + cmp r1, 0 + bne _0806334A + adds r0, r6, 0 + adds r0, 0x29 + ldrb r0, [r0] + cmp r0, 0 + beq _08063388 +_0806334A: + movs r1, 0x18 + ldrsh r0, [r6, r1] + bl sub_8044F3C + lsls r0, 24 + cmp r0, 0 + beq _08063384 + mov r0, r8 + bl sub_8045B60 + adds r1, r0, 0 + adds r0, r4, 0 + bl sub_80637A4 + ldrh r0, [r4] + subs r0, 0x14 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bls _08063376 + bl sub_8083D08 +_08063376: + movs r6, 0 + b _080633A0 + .align 2, 0 +_0806337C: .4byte gUnknown_202EE10 +_08063380: .4byte gUnknown_20255F0 +_08063384: + bl sub_8083D30 +_08063388: + ldrh r1, [r5, 0x2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0806339A + mov r2, r10 + ldrb r0, [r2] + cmp r0, 0 + beq _080632F8 +_0806339A: + bl sub_8083D30 + movs r6, 0x1 +_080633A0: + ldr r0, _080633E0 + bl AddMenuCursorSprite + movs r0, 0x1B + bl sub_803E46C + cmp r6, 0x1 + bne _080633B2 + b _08063038 +_080633B2: + movs r0, 0 + str r0, [sp, 0xE0] +_080633B6: + movs r0, 0x1 + cmp r0, 0 + beq _080633CC + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + movs r0, 0x8 + movs r1, 0x1E + bl sub_803E708 +_080633CC: + ldr r0, [sp, 0xE0] + add sp, 0xE8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080633E0: .4byte gUnknown_202EE10 + thumb_func_end sub_8062F90 + + thumb_func_start sub_80633E4 +sub_80633E4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + str r0, [sp, 0x20] + adds r7, r1, 0 + adds r4, r3, 0 + ldr r0, [sp, 0x44] + mov r8, r0 + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + add r1, sp, 0x8 + ldr r0, _08063508 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + movs r0, 0 + add r5, sp, 0x50 + ldrb r6, [r5] + mov r5, r8 + strb r6, [r5] + add r6, sp, 0x4C + ldrb r6, [r6] + strb r6, [r5, 0x1] + strb r0, [r5, 0x3] + movs r6, 0 + ldr r5, _0806350C + ldr r0, _08063510 + mov r9, r0 + movs r1, 0x1 + mov r12, r1 + movs r3, 0x8C + lsls r3, 1 + adds r2, r7, r3 + movs r3, 0x3 +_08063432: + ldrb r1, [r2] + mov r0, r12 + ands r0, r1 + cmp r0, 0 + beq _0806343E + adds r6, 0x1 +_0806343E: + adds r2, 0x8 + subs r3, 0x1 + cmp r3, 0 + bge _08063432 + movs r3, 0x4 + mov r1, r9 + ldr r0, [r1] + movs r1, 0 + strh r0, [r5, 0x18] + strh r6, [r5, 0x1A] + strh r3, [r5, 0x1C] + add r2, sp, 0x4C + ldrh r2, [r2] + strh r2, [r5, 0x1E] + add r3, sp, 0x50 + ldrh r3, [r3] + strh r3, [r5, 0x20] + strh r1, [r5, 0x4] + movs r0, 0x10 + strh r0, [r5, 0x6] + strh r1, [r5, 0x14] + str r1, [r5] + adds r0, r5, 0 + adds r0, 0x28 + bl sub_801317C + movs r0, 0x4 + movs r1, 0xC + bl sub_80095E4 + adds r0, 0x2 + strh r0, [r4, 0x10] + strh r0, [r4, 0xE] + movs r0, 0xD + mov r6, r8 + strb r0, [r6, 0x2] + movs r0, 0x2 + strh r0, [r4, 0x8] + adds r1, r4, 0 + adds r1, 0x18 + adds r0, r4, 0 + adds r0, 0x48 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + adds r1, r4, 0 + adds r1, 0x30 + add r0, sp, 0x8 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + adds r0, r4, 0 + movs r1, 0x1 + bl sub_803ECB4 + adds r0, r5, 0 + movs r1, 0 + bl sub_80137B0 + ldr r1, _08063514 + movs r2, 0 + ldrsh r0, [r1, r2] + adds r0, 0x10 + lsls r0, 3 + strh r0, [r5, 0xC] + movs r3, 0x2 + ldrsh r0, [r1, r3] + adds r0, 0x1 + lsls r0, 3 + subs r0, 0x2 + strh r0, [r5, 0xE] + ldr r0, _08063518 + adds r1, r7, 0 + movs r2, 0 + bl sub_80708B4 + movs r3, 0 + movs r5, 0x1 +_080634DE: + lsls r1, r3, 3 + movs r4, 0x8C + lsls r4, 1 + adds r1, r4 + adds r1, r7, r1 + ldr r6, [sp, 0x48] + adds r4, r6, r3 + movs r0, 0 + strb r0, [r4] + ldrb r1, [r1] + adds r2, r5, 0 + ands r2, r1 + cmp r2, 0 + bne _0806351C + ldr r1, _0806350C + movs r4, 0x18 + ldrsh r0, [r1, r4] + cmp r0, r3 + bne _08063526 + strh r2, [r1, 0x18] + b _08063526 + .align 2, 0 +_08063508: .4byte gUnknown_8106CAC +_0806350C: .4byte gUnknown_202EE10 +_08063510: .4byte gUnknown_202F2D8 +_08063514: .4byte gUnknown_2027370 +_08063518: .4byte gUnknown_202DF98 +_0806351C: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08063526 + strb r5, [r4] +_08063526: + adds r3, 0x1 + cmp r3, 0x3 + ble _080634DE + movs r5, 0x8C + lsls r5, 1 + adds r2, r7, r5 + mov r6, r10 + str r6, [sp] + ldr r0, [sp, 0x4C] + str r0, [sp, 0x4] + movs r0, 0x4 + ldr r1, [sp, 0x20] + movs r3, 0 + bl sub_8063578 + movs r0, 0x2 + bl sub_80073B8 + ldr r0, _08063574 + ldr r2, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0x4 + movs r1, 0 + movs r3, 0x2 + bl sub_8014FF0 + movs r0, 0x2 + bl sub_80073E0 + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08063574: .4byte gUnknown_80FDFE8 + thumb_func_end sub_80633E4 + + thumb_func_start sub_8063578 +sub_8063578: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + str r0, [sp, 0x10] + str r1, [sp, 0x14] + adds r5, r2, 0 + mov r8, r3 + ldr r0, [sp, 0x40] + ldr r4, [sp, 0x44] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x18] + ldr r0, [r1, 0x70] + str r0, [sp, 0x1C] + mov r0, r8 + bl sub_80073B8 + ldr r0, _080635FC + ldr r1, [sp, 0x14] + movs r2, 0 + bl sub_8045B94 + lsls r4, 3 + adds r4, 0xA + ldr r0, _08063600 + ldr r2, [r0] + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r1, 0 + mov r3, r8 + bl sub_8014FF0 + movs r1, 0 + mov r9, r1 + ldr r0, [sp, 0x10] + cmp r9, r0 + bge _08063676 + add r1, sp, 0x4 + mov r10, r1 + adds r7, r5, 0 +_080635D0: + movs r0, 0 + str r0, [sp, 0x4] + movs r0, 0x6A + str r0, [sp, 0x8] + movs r0, 0 + mov r1, r10 + strb r0, [r1, 0x8] + mov r1, sp + ldrb r0, [r1, 0x18] + mov r1, r10 + strb r0, [r1, 0x9] + ldrb r1, [r7] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08063668 + ldr r1, [sp, 0x1C] + ldrb r0, [r1, 0x7] + cmp r0, 0 + beq _08063604 + movs r0, 0x2 + b _08063606 + .align 2, 0 +_080635FC: .4byte gUnknown_202DF98 +_08063600: .4byte gUnknown_80FE978 +_08063604: + movs r0, 0x4 +_08063606: + str r0, [sp, 0x4] + ldr r0, [sp, 0x14] + adds r1, r5, 0 + movs r2, 0x1 + bl sub_80573CC + add r1, sp, 0x4 + movs r2, 0 + lsls r0, 24 + cmp r0, 0 + bne _0806361E + movs r2, 0x1 +_0806361E: + strb r2, [r1, 0x8] + ldr r0, _0806368C + adds r1, r5, 0 + add r2, sp, 0x4 + bl sub_80928C0 + ldr r0, _08063690 + mov r1, r9 + bl sub_8013800 + adds r4, r0, 0 + ldrb r1, [r7] + movs r0, 0x2 + ands r0, r1 + movs r6, 0xD + cmp r0, 0 + bne _08063658 + movs r6, 0x8 + mov r0, r9 + cmp r0, 0 + beq _08063658 + subs r2, r4, 0x2 + movs r0, 0x7 + str r0, [sp] + mov r0, r8 + movs r1, 0xC + movs r3, 0x78 + bl sub_80078A4 +_08063658: + movs r1, 0 + str r1, [sp] + adds r0, r6, 0 + adds r1, r4, 0 + ldr r2, _08063694 + mov r3, r8 + bl sub_8014FF0 +_08063668: + adds r7, 0x8 + adds r5, 0x8 + movs r0, 0x1 + add r9, r0 + ldr r1, [sp, 0x10] + cmp r9, r1 + blt _080635D0 +_08063676: + mov r0, r8 + bl sub_80073E0 + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0806368C: .4byte gUnknown_202DE58 +_08063690: .4byte gUnknown_202EE10 +_08063694: .4byte gUnknown_8106CC4 + thumb_func_end sub_8063578 + + thumb_func_start sub_8063698 +sub_8063698: + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r0 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r7, r2, 24 + ldr r4, [r0, 0x70] + ldr r0, _080636E8 + ldr r0, [r0] + lsls r0, 3 + movs r1, 0x8C + lsls r1, 1 + adds r0, r1 + adds r5, r4, r0 + ldr r1, _080636EC + movs r0, 0 + str r0, [r1] + ldrb r0, [r4, 0x7] + cmp r0, 0 + beq _080636FA + cmp r7, 0 + beq _080636D0 + movs r0, 0x14 + movs r1, 0 + bl sub_8044F5C +_080636D0: + ldrb r1, [r5] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08063702 + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080636F0 + movs r0, 0x33 + b _080636F2 + .align 2, 0 +_080636E8: .4byte gUnknown_202F2D8 +_080636EC: .4byte gUnknown_202EE6C +_080636F0: + movs r0, 0x1E +_080636F2: + movs r1, 0 + bl sub_8044F5C + b _08063702 +_080636FA: + movs r0, 0x1F + movs r1, 0 + bl sub_8044F5C +_08063702: + cmp r6, 0 + beq _08063716 + movs r0, 0x20 + movs r1, 0 + bl sub_8044F5C + movs r0, 0x21 + movs r1, 0 + bl sub_8044F5C +_08063716: + movs r0, 0x1D + movs r1, 0 + bl sub_8044F5C + cmp r6, 0 + bne _0806372A + movs r0, 0x20 + bl sub_8044FF0 + b _08063754 +_0806372A: + ldr r5, _080637A0 + ldr r1, [r5] + adds r0, r4, 0 + bl sub_8063C88 + lsls r0, 24 + cmp r0, 0 + bne _08063740 + movs r0, 0x20 + bl sub_8044FF0 +_08063740: + ldr r1, [r5] + adds r0, r4, 0 + bl sub_8063DD4 + lsls r0, 24 + cmp r0, 0 + bne _08063754 + movs r0, 0x21 + bl sub_8044FF0 +_08063754: + ldr r5, _080637A0 + ldr r1, [r5] + adds r0, r4, 0 + bl sub_8063DD4 + lsls r0, 24 + cmp r0, 0 + bne _0806376A + movs r0, 0x21 + bl sub_8044FF0 +_0806376A: + cmp r7, 0 + beq _08063792 + movs r0, 0 + ldr r1, [r5] + cmp r1, 0x3 + bgt _08063788 + mov r0, r8 + movs r2, 0x1 + bl sub_8057348 + lsls r0, 24 + lsrs r0, 24 + negs r1, r0 + orrs r1, r0 + lsrs r0, r1, 31 +_08063788: + cmp r0, 0 + bne _08063792 + movs r0, 0x14 + bl sub_8044FF0 +_08063792: + bl sub_8045064 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080637A0: .4byte gUnknown_202F2D8 + thumb_func_end sub_8063698 + + thumb_func_start sub_80637A4 +sub_80637A4: + push {lr} + adds r2, r1, 0 + ldr r1, _080637B8 + movs r3, 0x18 + ldrsh r1, [r1, r3] + bl sub_80637BC + pop {r0} + bx r0 + .align 2, 0 +_080637B8: .4byte gUnknown_202EE10 + thumb_func_end sub_80637A4 + + thumb_func_start sub_80637BC +sub_80637BC: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r2, 0 + ldr r0, _080637E0 + lsls r1, 2 + adds r1, r0 + ldrh r1, [r1] + adds r0, r4, 0 + bl sub_8044C94 + strb r5, [r4, 0x4] + ldr r0, _080637E4 + ldr r0, [r0] + strb r0, [r4, 0xC] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080637E0: .4byte gUnknown_202EE44 +_080637E4: .4byte gUnknown_202F2D8 + thumb_func_end sub_80637BC + + thumb_func_start sub_80637E8 +sub_80637E8: + push {lr} + adds r3, r0, 0 + ldr r0, _08063828 + ldr r1, [r0] + ldrb r0, [r3, 0x4] + lsls r0, 2 + ldr r2, _0806382C + adds r1, r2 + adds r1, r0 + ldr r0, [r1] + ldr r0, [r0, 0x70] + ldrb r1, [r3, 0xC] + lsls r1, 3 + adds r1, r0, r1 + ldr r2, _08063830 + adds r2, r1 + mov r12, r2 + ldrb r2, [r2] + movs r1, 0x2 + orrs r1, r2 + mov r2, r12 + strb r1, [r2] + movs r1, 0x8C + lsls r1, 1 + adds r0, r1 + ldrb r1, [r3, 0xC] + movs r2, 0x4 + bl sub_8063834 + pop {r0} + bx r0 + .align 2, 0 +_08063828: .4byte gUnknown_203B418 +_0806382C: .4byte 0x0001357c +_08063830: .4byte 0x00000119 + thumb_func_end sub_80637E8 + + thumb_func_start sub_8063834 +sub_8063834: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x7C + str r0, [sp, 0x74] + str r1, [sp, 0x78] + adds r4, r2, 0 + mov r0, sp + bl sub_80140B4 + add r0, sp, 0x70 + str r0, [sp, 0x14] + movs r1, 0x1 + mov r9, r1 + ldr r3, [sp, 0x78] + adds r3, 0x1 + add r2, sp, 0x60 + mov r10, r2 + cmp r3, r4 + bge _08063894 + lsls r0, r3, 3 + ldr r1, [sp, 0x74] + adds r2, r0, r1 + ldrb r1, [r2] + mov r0, r9 + ands r0, r1 + cmp r0, 0 + beq _08063894 + movs r6, 0x2 + movs r5, 0x1 +_08063874: + ldrb r1, [r2] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _08063894 + movs r0, 0x1 + add r9, r0 + adds r2, 0x8 + adds r3, 0x1 + cmp r3, r4 + bge _08063894 + ldrb r1, [r2] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _08063874 +_08063894: + movs r4, 0 + ldr r6, _0806393C +_08063898: + movs r7, 0 + mov r1, r9 + add r2, sp, 0x70 + strb r1, [r2] + adds r1, r2, 0 + strb r4, [r1, 0x1] + movs r0, 0xC + strb r0, [r1, 0x2] + strb r7, [r1, 0x3] + strh r4, [r6, 0x1E] + mov r0, r9 + strh r0, [r6, 0x20] + ldr r1, _08063940 + movs r2, 0 + ldrsh r0, [r1, r2] + adds r0, 0x17 + lsls r0, 3 + strh r0, [r6, 0xC] + movs r2, 0x2 + ldrsh r0, [r1, r2] + adds r0, 0x1 + lsls r0, 3 + subs r0, 0x2 + strh r0, [r6, 0xE] + strh r7, [r6, 0x14] + strh r7, [r6, 0x4] + movs r0, 0x10 + strh r0, [r6, 0x6] + str r7, [r6] + adds r0, r6, 0 + adds r0, 0x28 + bl sub_801317C + strh r7, [r6, 0x18] + strh r7, [r6, 0x1A] + strh r7, [r6, 0x1C] + mov r0, sp + movs r1, 0x1 + bl sub_803ECB4 + ldr r0, [sp, 0x78] + adds r1, r0, r4 + lsls r1, 3 + ldr r2, [sp, 0x74] + adds r1, r2, r1 + adds r0, r4, 0 + movs r2, 0 + mov r3, r10 + bl sub_8093DE8 + mov r8, r0 +_080638FE: + mov r0, r8 + cmp r0, 0 + beq _08063908 + bl sub_8062500 +_08063908: + ldr r5, _08063944 + adds r0, r5, 0 + movs r1, 0 + bl nullsub_34 + movs r0, 0x1C + bl sub_803E46C + bl sub_8062D88 + ldr r1, _08063948 + ldrh r1, [r1, 0x2] + ands r0, r1 + cmp r0, 0 + bne _0806392C + ldrb r0, [r5, 0x1] + cmp r0, 0 + beq _0806394C +_0806392C: + bl sub_8083D08 + movs r7, 0x1 + mov r1, r8 + cmp r1, 0 + beq _080639AE + movs r7, 0x2 + b _080639AE + .align 2, 0 +_0806393C: .4byte gUnknown_202EE10 +_08063940: .4byte gUnknown_2027370 +_08063944: .4byte gUnknown_202EE38 +_08063948: .4byte gUnknown_20255F0 +_0806394C: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0806395A + ldrb r0, [r5, 0x2] + cmp r0, 0 + beq _08063962 +_0806395A: + bl sub_8083D30 + movs r7, 0x1 + b _080639AE +_08063962: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _08063970 + ldrb r0, [r5, 0x4] + cmp r0, 0 + beq _08063986 +_08063970: + adds r0, r4, 0 + cmp r4, 0 + bne _08063978 + mov r4, r9 +_08063978: + subs r4, 0x1 + cmp r0, r4 + beq _080639AE + movs r0, 0 + bl sub_8083CE0 + b _080639AE +_08063986: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _08063994 + ldrb r0, [r5, 0x3] + cmp r0, 0 + beq _080638FE +_08063994: + adds r1, r4, 0 + mov r0, r9 + subs r0, 0x1 + cmp r4, r0 + bne _080639A2 + movs r4, 0 + b _080639A4 +_080639A2: + adds r4, 0x1 +_080639A4: + cmp r1, r4 + beq _080639AE + movs r0, 0 + bl sub_8083CE0 +_080639AE: + cmp r7, 0x1 + beq _080639CA + cmp r7, 0 + bne _080639B8 + b _08063898 +_080639B8: + mov r2, r8 + cmp r2, 0 + bne _080639C0 + b _08063898 +_080639C0: + mov r0, r8 + mov r1, r10 + bl sub_80625A4 + b _08063898 +_080639CA: + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + add sp, 0x7C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8063834 + + thumb_func_start sub_80639E4 +sub_80639E4: + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r6, r1, 0 + ldr r4, _08063A5C + adds r0, r4, 0 + bl sub_80140B4 + ldr r0, _08063A60 + str r0, [r4, 0x14] + adds r0, r4, 0 + movs r1, 0x1 + bl sub_803ECB4 + movs r0, 0 + bl sub_80073B8 + ldr r0, _08063A64 + ldr r1, [r5] + bl strcpy + ldr r2, _08063A68 + movs r4, 0 + str r4, [sp] + movs r0, 0x10 + movs r1, 0 + movs r3, 0 + bl sub_8014FF0 + ldr r2, [r5, 0x4] + str r4, [sp] + movs r0, 0x4 + movs r1, 0x10 + movs r3, 0 + bl sub_8014FF0 + movs r0, 0 + bl sub_80073E0 + ldr r0, _08063A6C + strh r4, [r0, 0x1E] + strh r4, [r0, 0x20] + strh r4, [r0, 0xC] + strh r4, [r0, 0xE] + strh r4, [r0, 0x14] + strh r4, [r0, 0x4] + movs r1, 0x10 + strh r1, [r0, 0x6] + str r4, [r0] + strh r4, [r0, 0x18] + strh r4, [r0, 0x1A] + strh r4, [r0, 0x1C] + adds r0, r6, 0 + bl sub_801317C + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08063A5C: .4byte gUnknown_202F278 +_08063A60: .4byte gUnknown_8106CC8 +_08063A64: .4byte gUnknown_202DF98 +_08063A68: .4byte gUnknown_8106CCC +_08063A6C: .4byte gUnknown_202EE10 + thumb_func_end sub_80639E4 + + thumb_func_start sub_8063A70 +sub_8063A70: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + ldr r1, _08063B1C + ldr r2, [r1] + ldrb r1, [r0, 0x4] + lsls r1, 2 + ldr r3, _08063B20 + adds r2, r3 + adds r2, r1 + ldr r6, [r2] + ldr r5, [r6, 0x70] + ldrb r0, [r0, 0xC] + lsls r0, 3 + movs r2, 0x8C + lsls r2, 1 + adds r0, r2 + adds r4, r5, r0 + ldrb r1, [r4] + movs r0, 0x8 + ands r0, r1 + lsls r0, 24 + lsrs r0, 24 + negs r0, r0 + lsrs r0, 31 + mov r8, r0 + ldr r0, _08063B24 + mov r9, r0 + movs r1, 0x1 + mov r12, r1 + adds r2, r5, r2 + movs r7, 0xF7 + movs r3, 0x3 +_08063ABC: + ldrb r1, [r2] + mov r0, r12 + ands r0, r1 + cmp r0, 0 + beq _08063ACC + adds r0, r7, 0 + ands r0, r1 + strb r0, [r2] +_08063ACC: + adds r2, 0x8 + subs r3, 0x1 + cmp r3, 0 + bge _08063ABC + mov r0, r9 + adds r1, r4, 0 + movs r2, 0 + bl sub_80928C0 + mov r3, r8 + cmp r3, 0 + bne _08063AEC + ldrb r1, [r4] + movs r0, 0x8 + orrs r0, r1 + strb r0, [r4] +_08063AEC: + movs r1, 0x8C + lsls r1, 1 + adds r0, r5, r1 + bl sub_80936D8 + ldrb r1, [r4, 0x1] + movs r0, 0x2 + orrs r0, r1 + strb r0, [r4, 0x1] + ldr r0, _08063B28 + bl sub_8083E38 + mov r3, r10 + cmp r3, 0 + beq _08063B42 + mov r0, r8 + cmp r0, 0 + bne _08063B30 + ldr r0, _08063B2C + ldr r1, [r0] + adds r0, r6, 0 + bl sub_80522A8 + b _08063B3A + .align 2, 0 +_08063B1C: .4byte gUnknown_203B418 +_08063B20: .4byte 0x0001357c +_08063B24: .4byte gUnknown_202DE58 +_08063B28: .4byte 0x00000133 +_08063B2C: .4byte gUnknown_80F8B40 +_08063B30: + ldr r0, _08063B50 + ldr r1, [r0] + adds r0, r6, 0 + bl sub_80522A8 +_08063B3A: + movs r0, 0x78 + movs r1, 0x1F + bl sub_803E708 +_08063B42: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08063B50: .4byte gUnknown_80F8B64 + thumb_func_end sub_8063A70 + + thumb_func_start sub_8063B54 +sub_8063B54: + push {r4-r6,lr} + ldr r1, _08063BA4 + ldr r2, [r1] + ldrb r1, [r0, 0x4] + lsls r1, 2 + ldr r3, _08063BA8 + adds r2, r3 + adds r2, r1 + ldr r1, [r2] + ldr r5, [r1, 0x70] + ldrb r4, [r0, 0xC] + lsls r4, 3 + movs r6, 0x8C + lsls r6, 1 + adds r4, r6 + adds r4, r5, r4 + ldr r0, _08063BAC + adds r1, r4, 0 + movs r2, 0 + bl sub_80928C0 + ldrb r0, [r4] + movs r1, 0x4 + eors r0, r1 + strb r0, [r4] + adds r5, r6 + adds r0, r5, 0 + bl sub_80936D8 + ldrb r1, [r4, 0x1] + movs r0, 0x2 + orrs r0, r1 + strb r0, [r4, 0x1] + ldr r0, _08063BB0 + bl sub_8083E38 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08063BA4: .4byte gUnknown_203B418 +_08063BA8: .4byte 0x0001357c +_08063BAC: .4byte gUnknown_202DE58 +_08063BB0: .4byte 0x00000133 + thumb_func_end sub_8063B54 + + thumb_func_start sub_8063BB4 +sub_8063BB4: + push {r4-r7,lr} + ldr r1, _08063C70 + ldr r2, [r1] + ldrb r1, [r0, 0x4] + lsls r1, 2 + ldr r3, _08063C74 + adds r2, r3 + adds r2, r1 + ldr r1, [r2] + ldr r6, [r1, 0x70] + ldrb r5, [r0, 0xC] + ldr r0, _08063C78 + lsls r4, r5, 3 + movs r7, 0x8C + lsls r7, 1 + adds r1, r4, r7 + adds r1, r6, r1 + movs r2, 0 + bl sub_80928C0 + adds r4, r6, r4 + ldr r0, _08063C7C + adds r2, r4, r0 + ldrb r1, [r2] + movs r0, 0x2 + orrs r0, r1 + strb r0, [r2] + movs r3, 0 + adds r5, 0x1 + cmp r5, 0x3 + bgt _08063C2C + lsls r2, r5, 3 + adds r0, r2, r6 + adds r1, r7, 0 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08063C2C + adds r0, r2, r7 + adds r2, r0, r6 + movs r4, 0x2 +_08063C0A: + ldrb r1, [r2] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _08063C2C + adds r3, 0x1 + cmp r3, 0x3 + bgt _08063C2C + adds r2, 0x8 + adds r5, 0x1 + cmp r5, 0x3 + bgt _08063C2C + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08063C0A +_08063C2C: + lsls r0, r5, 3 + adds r0, r6 + movs r4, 0x8C + lsls r4, 1 + adds r0, r4 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08063C42 + movs r5, 0x4 +_08063C42: + cmp r5, 0x3 + bgt _08063C5C + lsls r1, r5, 3 + adds r1, r4 + adds r1, r6, r1 + ldrb r2, [r1] + movs r0, 0x2 + orrs r0, r2 + strb r0, [r1] + ldr r0, _08063C80 + movs r2, 0 + bl sub_80928C0 +_08063C5C: + adds r0, r6, r4 + bl sub_80936D8 + ldr r0, _08063C84 + bl sub_8083E38 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08063C70: .4byte gUnknown_203B418 +_08063C74: .4byte 0x0001357c +_08063C78: .4byte gUnknown_202DE58 +_08063C7C: .4byte 0x00000119 +_08063C80: .4byte gUnknown_202DEA8 +_08063C84: .4byte 0x00000133 + thumb_func_end sub_8063BB4 + + thumb_func_start sub_8063C88 +sub_8063C88: + push {r4-r7,lr} + adds r4, r0, 0 + movs r7, 0 + adds r5, r1, 0 + lsls r0, r5, 3 + adds r0, r4, r0 + movs r1, 0x8D + lsls r1, 1 + adds r0, r1 + ldrh r0, [r0] + bl sub_809422C + lsls r0, 24 + cmp r0, 0 + beq _08063CAE +_08063CA6: + movs r0, 0 + b _08063CEA +_08063CAA: + movs r7, 0x1 + b _08063CE8 +_08063CAE: + adds r5, 0x1 + movs r6, 0 + lsls r0, r5, 3 + movs r1, 0x8C + lsls r1, 1 + adds r0, r1 + adds r4, r0, r4 +_08063CBC: + ldrh r0, [r4, 0x2] + bl sub_809422C + lsls r0, 24 + cmp r0, 0 + bne _08063CA6 + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08063CE8 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08063CAA + adds r4, 0x8 + adds r5, 0x1 + cmp r5, 0x3 + bgt _08063CE8 + adds r6, 0x1 + cmp r6, 0x3 + ble _08063CBC +_08063CE8: + adds r0, r7, 0 +_08063CEA: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8063C88 + + thumb_func_start sub_8063CF0 +sub_8063CF0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + lsls r1, 24 + lsrs r1, 24 + mov r10, r1 + ldr r1, _08063D98 + ldr r2, [r1] + ldrb r1, [r0, 0x4] + lsls r1, 2 + ldr r3, _08063D9C + adds r2, r3 + adds r2, r1 + ldr r7, [r2] + ldr r6, [r7, 0x70] + ldrb r5, [r0, 0xC] + movs r0, 0 + mov r8, r0 + ldr r0, _08063DA0 + lsls r4, r5, 3 + movs r1, 0x8C + lsls r1, 1 + mov r9, r1 + adds r1, r4, r1 + adds r1, r6, r1 + movs r2, 0 + bl sub_80928C0 + adds r4, r6, r4 + ldr r3, _08063DA4 + adds r2, r4, r3 + ldrb r1, [r2] + movs r0, 0x2 + orrs r0, r1 + strb r0, [r2] + adds r5, 0x1 + movs r3, 0 + cmp r5, 0x3 + bgt _08063D70 + movs r0, 0x2 + mov r12, r0 + lsls r0, r5, 3 + add r0, r9 + adds r2, r0, r6 + movs r4, 0xFD +_08063D4E: + ldrb r1, [r2] + mov r0, r12 + ands r0, r1 + cmp r0, 0 + beq _08063D70 + adds r0, r4, 0 + ands r0, r1 + strb r0, [r2] + movs r1, 0x1 + mov r8, r1 + adds r2, 0x8 + adds r5, 0x1 + adds r3, 0x1 + cmp r3, 0x3 + bgt _08063D70 + cmp r5, 0x3 + ble _08063D4E +_08063D70: + movs r2, 0x8C + lsls r2, 1 + adds r0, r6, r2 + bl sub_80936D8 + ldr r0, _08063DA8 + bl sub_8083E38 + mov r3, r10 + cmp r3, 0 + beq _08063DC2 + mov r0, r8 + cmp r0, 0 + beq _08063DB0 + ldr r0, _08063DAC + ldr r1, [r0] + adds r0, r7, 0 + bl sub_80522A8 + b _08063DBA + .align 2, 0 +_08063D98: .4byte gUnknown_203B418 +_08063D9C: .4byte 0x0001357c +_08063DA0: .4byte gUnknown_202DE58 +_08063DA4: .4byte 0x00000119 +_08063DA8: .4byte 0x00000133 +_08063DAC: .4byte gUnknown_80F8B88 +_08063DB0: + ldr r0, _08063DD0 + ldr r1, [r0] + adds r0, r7, 0 + bl sub_80522A8 +_08063DBA: + movs r0, 0x78 + movs r1, 0x1F + bl sub_803E708 +_08063DC2: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08063DD0: .4byte gUnknown_80F8BB4 + thumb_func_end sub_8063CF0 + + thumb_func_start sub_8063DD4 +sub_8063DD4: + push {r4-r7,lr} + adds r3, r0, 0 + adds r2, r1, 0 + movs r5, 0 + adds r2, 0x1 + movs r4, 0 + cmp r2, 0x3 + bgt _08063E20 + lsls r0, r2, 3 + movs r6, 0x8C + lsls r6, 1 + adds r0, r6 + adds r0, r3, r0 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08063E20 + movs r5, 0x1 + adds r2, 0x1 + movs r7, 0x2 + lsls r0, r2, 3 + adds r0, r6 + adds r3, r0, r3 +_08063E04: + adds r4, 0x1 + cmp r4, 0x3 + bgt _08063E20 + cmp r2, 0x3 + bgt _08063E20 + ldrb r1, [r3] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _08063E20 + movs r5, 0x1 + adds r3, 0x8 + adds r2, 0x1 + b _08063E04 +_08063E20: + cmp r5, 0 + bne _08063E28 + movs r0, 0 + b _08063E2A +_08063E28: + movs r0, 0x1 +_08063E2A: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8063DD4 + + thumb_func_start sub_8063E30 +sub_8063E30: + push {r4-r7,lr} + adds r5, r0, 0 + adds r1, 0x1 + movs r4, 0 + cmp r1, 0x7 + bgt _08063E62 + movs r7, 0x2 + movs r6, 0xFD + lsls r0, r1, 3 + adds r3, r0, r5 +_08063E44: + ldrb r2, [r3] + adds r0, r7, 0 + ands r0, r2 + cmp r0, 0 + beq _08063E62 + adds r0, r6, 0 + ands r0, r2 + strb r0, [r3] + adds r3, 0x8 + adds r1, 0x1 + adds r4, 0x1 + cmp r4, 0x7 + bgt _08063E62 + cmp r1, 0x7 + ble _08063E44 +_08063E62: + adds r0, r5, 0 + bl sub_80936F4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8063E30 + + thumb_func_start sub_8063E70 +sub_8063E70: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xD0 + str r0, [sp, 0xC4] + adds r7, r1, 0 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0xC8] + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0xCC] + add r4, sp, 0x60 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x60 + bl memset + movs r0, 0x6 + str r0, [sp, 0x64] + add r0, sp, 0x68 + movs r6, 0 + movs r1, 0x2 + strh r1, [r0] + strh r1, [r0, 0x2] + add r1, sp, 0x6C + movs r0, 0x12 + strh r0, [r1] + mov r0, sp + adds r0, 0x6E + movs r1, 0x10 + strh r1, [r0] + add r0, sp, 0x70 + strh r1, [r0] + add r5, sp, 0xC0 + str r5, [sp, 0x74] + movs r1, 0x3 + str r1, [sp, 0x7C] + add r0, sp, 0x90 + str r1, [r0, 0x4] + add r0, sp, 0xA8 + str r1, [r0, 0x4] + mov r0, sp + adds r1, r4, 0 + movs r2, 0x60 + bl memcpy + ldr r0, _08063F80 + str r6, [r0] + ldr r1, _08063F84 + mov r8, r1 + mov r9, r0 + ldr r2, _08063F88 + mov r10, r2 +_08063EE0: + ldr r0, [sp, 0xC4] + adds r1, r7, 0 + mov r2, sp + add r3, sp, 0xC0 + bl sub_8064228 +_08063EEC: + mov r0, r8 + bl AddMenuCursorSprite + movs r0, 0x1E + bl sub_803E46C + mov r0, r10 + ldrh r1, [r0, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08063F2A + mov r1, r8 + movs r2, 0x18 + ldrsh r4, [r1, r2] + adds r0, r7, 0 + adds r1, r4, 0 + bl sub_8092E1C + adds r1, r0, 0 + mov r0, r8 + bl sub_8013780 + mov r1, r8 + movs r2, 0x18 + ldrsh r0, [r1, r2] + cmp r4, r0 + beq _08063F2A + movs r0, 0 + bl sub_8083CE0 +_08063F2A: + mov r0, r10 + ldrh r1, [r0, 0x4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08063F5C + mov r1, r8 + movs r2, 0x18 + ldrsh r4, [r1, r2] + adds r0, r7, 0 + adds r1, r4, 0 + bl sub_8092E8C + adds r1, r0, 0 + mov r0, r8 + bl sub_8013780 + mov r1, r8 + movs r2, 0x18 + ldrsh r0, [r1, r2] + cmp r4, r0 + beq _08063F5C + movs r0, 0 + bl sub_8083CE0 +_08063F5C: + bl sub_8062D88 + mov r2, r10 + ldrh r1, [r2, 0x2] + ands r0, r1 + cmp r0, 0 + bne _08063F76 + ldr r2, _08063F84 + adds r0, r2, 0 + adds r0, 0x29 + ldrb r0, [r0] + cmp r0, 0 + beq _08063F8C +_08063F76: + bl sub_8083D08 + movs r4, 0 + b _08063FB2 + .align 2, 0 +_08063F80: .4byte gUnknown_202F2D8 +_08063F84: .4byte gUnknown_202EE10 +_08063F88: .4byte gUnknown_20255F0 +_08063F8C: + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _08063FD4 + ldr r0, [sp, 0xCC] + cmp r0, 0 + beq _08063EEC + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08063FAC + adds r0, r2, 0 + adds r0, 0x2A + ldrb r0, [r0] + cmp r0, 0 + beq _08063EEC +_08063FAC: + bl sub_8083D30 + movs r4, 0x1 +_08063FB2: + ldr r5, _08063FD0 + adds r0, r5, 0 + bl AddMenuCursorSprite + movs r0, 0x1E + bl sub_803E46C + cmp r4, 0x1 + bne _08063FDC + movs r0, 0x1 + negs r0, r0 + mov r1, r9 + str r0, [r1] + b _080640FA + .align 2, 0 +_08063FD0: .4byte gUnknown_202EE10 +_08063FD4: + bl sub_8083D44 + movs r4, 0x2 + b _08063FB2 +_08063FDC: + ldr r6, _08064004 + movs r2, 0x18 + ldrsh r0, [r5, r2] + str r0, [r6] + cmp r4, 0x2 + bne _08064008 + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + movs r0, 0x8 + movs r1, 0x1B + bl sub_803E708 + ldr r1, [r6] + adds r0, r7, 0 + movs r2, 0x4 + bl sub_8063834 + b _08063EE0 + .align 2, 0 +_08064004: .4byte gUnknown_202F2D8 +_08064008: + adds r0, r7, 0 + bl sub_8064310 + mov r0, sp + movs r1, 0x16 + bl sub_805FC30 + adds r4, r5, 0 + ldr r6, _0806408C + adds r5, 0x2A +_0806401C: + adds r0, r4, 0 + bl AddMenuCursorSprite + movs r0, 0x1B + bl sub_803E46C + ldrh r1, [r6, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08064040 + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80136E0 +_08064040: + ldrh r1, [r6, 0x4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08064058 + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8013744 +_08064058: + bl sub_8062D88 + ldrh r1, [r6, 0x2] + ands r1, r0 + cmp r1, 0 + bne _0806406E + adds r0, r4, 0 + adds r0, 0x29 + ldrb r0, [r0] + cmp r0, 0 + beq _0806409C +_0806406E: + movs r1, 0x18 + ldrsh r0, [r4, r1] + bl sub_8044F3C + lsls r0, 24 + cmp r0, 0 + beq _08064098 + movs r2, 0x18 + ldrsh r0, [r4, r2] + cmp r0, 0x2 + bne _08064090 + bl sub_8083D08 + b _08064094 + .align 2, 0 +_0806408C: .4byte gUnknown_20255F0 +_08064090: + bl sub_8083D1C +_08064094: + movs r4, 0 + b _080640B2 +_08064098: + bl sub_8083D30 +_0806409C: + ldrh r1, [r6, 0x2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080640AC + ldrb r0, [r5] + cmp r0, 0 + beq _0806401C +_080640AC: + bl sub_8083D30 + movs r4, 0x1 +_080640B2: + ldr r6, _080640E4 + adds r0, r6, 0 + bl AddMenuCursorSprite + movs r0, 0x1B + bl sub_803E46C + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + cmp r4, 0x1 + bne _080640CE + b _08063EE0 +_080640CE: + movs r1, 0x18 + ldrsh r0, [r6, r1] + cmp r0, 0x1 + bne _080640E8 + mov r2, r9 + ldr r1, [r2] + adds r0, r7, 0 + bl sub_8063E30 + b _08063EE0 + .align 2, 0 +_080640E4: .4byte gUnknown_202EE10 +_080640E8: + cmp r0, 0x2 + bne _080640FA + mov r0, r9 + ldr r1, [r0] + adds r0, r7, 0 + movs r2, 0x8 + bl sub_8063834 + b _08063EE0 +_080640FA: + ldr r1, _08064140 + ldr r2, [r1] + cmp r2, 0 + bge _08064104 + b _08064214 +_08064104: + ldr r0, [sp, 0xC8] + cmp r0, 0 + beq _08064160 + movs r4, 0 + lsls r0, r2, 3 + adds r1, r7, r0 + adds r0, r2, 0x1 + cmp r0, 0x7 + bgt _08064130 + lsls r0, 3 + adds r0, r7 + ldrb r2, [r0] + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _08064130 + movs r0, 0x2 + ands r0, r2 + lsls r0, 24 + lsrs r0, 24 + negs r0, r0 + lsrs r4, r0, 31 +_08064130: + ldr r0, _08064144 + movs r2, 0 + bl sub_80928C0 + cmp r4, 0 + beq _0806414C + ldr r0, _08064148 + b _0806414E + .align 2, 0 +_08064140: .4byte gUnknown_202F2D8 +_08064144: .4byte gUnknown_202DE58 +_08064148: .4byte gUnknown_80FDF00 +_0806414C: + ldr r0, _0806415C +_0806414E: + ldr r1, [r0] + movs r0, 0 + movs r2, 0 + bl sub_8052B8C + adds r3, r0, 0 + b _08064162 + .align 2, 0 +_0806415C: .4byte gUnknown_80FDF70 +_08064160: + movs r3, 0x1 +_08064162: + cmp r3, 0x1 + beq _08064168 + b _08063EE0 +_08064168: + mov r1, r9 + ldr r0, [r1] + lsls r0, 3 + adds r0, r7 + movs r1, 0 + strb r1, [r0] + mov r2, r9 + ldr r0, [r2] + adds r2, r0, 0x1 + cmp r2, 0x7 + bgt _080641BC + lsls r0, r2, 3 + adds r4, r7, r0 + ldrb r1, [r4] + ands r3, r1 + cmp r3, 0 + beq _080641BC + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080641BC + movs r0, 0 + mov r12, r0 + movs r6, 0x1 + adds r3, r4, 0 + movs r5, 0x2 +_0806419C: + mov r1, r12 + strb r1, [r4] + adds r3, 0x8 + adds r2, 0x1 + cmp r2, 0x7 + bgt _080641BC + adds r4, r3, 0 + ldrb r1, [r3] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _080641BC + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _0806419C +_080641BC: + movs r4, 0 + movs r6, 0x1 + adds r3, r7, 0 + add r5, sp, 0x60 + movs r2, 0x7 +_080641C6: + ldrb r1, [r3] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _080641D8 + ldr r0, [r3] + ldr r1, [r3, 0x4] + stm r5!, {r0,r1} + adds r4, 0x1 +_080641D8: + adds r3, 0x8 + subs r2, 0x1 + cmp r2, 0 + bge _080641C6 + cmp r4, 0x7 + bgt _080641F4 + movs r1, 0 +_080641E6: + lsls r0, r4, 3 + add r0, sp + adds r0, 0x60 + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x7 + ble _080641E6 +_080641F4: + add r4, sp, 0x60 + adds r3, r7, 0 + movs r2, 0x7 +_080641FA: + ldm r4!, {r0,r1} + stm r3!, {r0,r1} + subs r2, 0x1 + cmp r2, 0 + bge _080641FA + ldr r2, _08064210 + ldr r0, [r2] + cmp r0, 0 + blt _08064214 + movs r0, 0x1 + b _08064216 + .align 2, 0 +_08064210: .4byte gUnknown_202F2D8 +_08064214: + movs r0, 0 +_08064216: + add sp, 0xD0 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8063E70 + + thumb_func_start sub_8064228 +sub_8064228: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + mov r9, r0 + mov r10, r1 + adds r5, r2, 0 + adds r7, r3, 0 + movs r1, 0 + movs r0, 0x1 + strb r0, [r7] + strb r1, [r7, 0x1] + strb r1, [r7, 0x3] + mov r8, r1 + ldr r6, _08064304 + ldr r0, _08064308 + mov r12, r0 + movs r4, 0x1 + mov r2, r10 + movs r3, 0x7 +_08064254: + ldrb r1, [r2] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _08064262 + movs r1, 0x1 + add r8, r1 +_08064262: + adds r2, 0x8 + subs r3, 0x1 + cmp r3, 0 + bge _08064254 + mov r2, r12 + ldr r0, [r2] + movs r4, 0 + strh r0, [r6, 0x18] + mov r3, r8 + strh r3, [r6, 0x1A] + strh r3, [r6, 0x1C] + strh r4, [r6, 0x1E] + strh r4, [r6, 0x20] + strh r4, [r6, 0x4] + movs r0, 0x10 + strh r0, [r6, 0x6] + strh r4, [r6, 0xC] + strh r4, [r6, 0xE] + strh r4, [r6, 0x14] + str r4, [r6] + adds r0, r6, 0 + adds r0, 0x28 + bl sub_801317C + mov r0, r8 + movs r1, 0xC + bl sub_80095E4 + adds r0, 0x2 + strh r0, [r5, 0x10] + strh r0, [r5, 0xE] + movs r0, 0xE + strb r0, [r7, 0x2] + movs r0, 0x2 + strh r0, [r5, 0x8] + adds r1, r5, 0 + adds r1, 0x18 + adds r0, r5, 0 + adds r0, 0x48 + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + adds r1, r5, 0 + adds r1, 0x30 + adds r0, r5, 0 + adds r0, 0x48 + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + adds r0, r5, 0 + movs r1, 0x1 + bl sub_803ECB4 + adds r0, r6, 0 + movs r1, 0 + bl sub_80137B0 + ldr r0, _0806430C + mov r7, r9 + ldr r1, [r7, 0x70] + movs r2, 0 + bl sub_80708B4 + str r4, [sp] + str r4, [sp, 0x4] + mov r0, r8 + mov r1, r9 + mov r2, r10 + movs r3, 0 + bl sub_8063578 + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08064304: .4byte gUnknown_202EE10 +_08064308: .4byte gUnknown_202F2D8 +_0806430C: .4byte gUnknown_202DF98 + thumb_func_end sub_8064228 + + thumb_func_start sub_8064310 +sub_8064310: + push {r4,lr} + adds r4, r0, 0 + ldr r1, _08064350 + movs r0, 0 + str r0, [r1] + movs r0, 0x22 + movs r1, 0 + bl sub_8044F5C + movs r0, 0x21 + movs r1, 0 + bl sub_8044F5C + ldr r0, _08064354 + ldr r1, [r0] + adds r0, r4, 0 + bl sub_8064358 + lsls r0, 24 + cmp r0, 0 + bne _08064340 + movs r0, 0x21 + bl sub_8044FF0 +_08064340: + movs r0, 0x1D + movs r1, 0 + bl sub_8044F5C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08064350: .4byte gUnknown_202EE6C +_08064354: .4byte gUnknown_202F2D8 + thumb_func_end sub_8064310 + + thumb_func_start sub_8064358 +sub_8064358: + push {r4-r6,lr} + adds r3, r0, 0 + adds r2, r1, 0 + movs r5, 0 + adds r2, 0x1 + movs r4, 0 + cmp r2, 0x7 + bgt _0806439C + lsls r0, r2, 3 + adds r0, r3, r0 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0806439C + movs r5, 0x1 + adds r2, 0x1 + movs r6, 0x2 + lsls r0, r2, 3 + adds r3, r0, r3 +_08064380: + adds r4, 0x1 + cmp r4, 0x7 + bgt _0806439C + cmp r2, 0x7 + bgt _0806439C + ldrb r1, [r3] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _0806439C + movs r5, 0x1 + adds r3, 0x8 + adds r2, 0x1 + b _08064380 +_0806439C: + cmp r5, 0 + bne _080643A4 + movs r0, 0 + b _080643A6 +_080643A4: + movs r0, 0x1 +_080643A6: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8064358 + + thumb_func_start sub_80643AC +sub_80643AC: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xE4 + adds r7, r0, 0 + add r0, sp, 0x68 + mov r9, r0 + mov r1, sp + adds r1, 0x6C + str r1, [sp, 0xD0] + mov r2, sp + adds r2, 0x6E + str r2, [sp, 0xD4] + mov r0, sp + adds r0, 0x70 + str r0, [sp, 0xD8] + adds r1, 0xC + str r1, [sp, 0xDC] + adds r2, 0x22 + str r2, [sp, 0xE0] + adds r0, 0x38 + str r0, [sp, 0xC8] + subs r1, 0x18 + str r1, [sp, 0xC4] + add r2, sp, 0xC0 + mov r10, r2 + ldr r5, _080644C8 + adds r0, r7, 0x4 + str r0, [sp, 0xCC] + ldr r1, _080644CC + mov r8, r1 + movs r6, 0 +_080643F0: + movs r4, 0 + ldr r0, [sp, 0xC4] + movs r1, 0 + movs r2, 0x60 + bl memset + movs r0, 0x6 + str r0, [sp, 0x64] + movs r0, 0x2 + mov r2, r9 + strh r0, [r2] + strh r0, [r2, 0x2] + movs r0, 0x12 + ldr r1, [sp, 0xD0] + strh r0, [r1] + movs r0, 0x4 + ldr r2, [sp, 0xD4] + strh r0, [r2] + movs r0, 0x10 + ldr r1, [sp, 0xD8] + strh r0, [r1] + mov r2, r10 + str r2, [sp, 0x74] + movs r0, 0x3 + ldr r1, [sp, 0xDC] + str r0, [r1, 0x4] + ldr r2, [sp, 0xE0] + str r0, [r2, 0x4] + ldr r1, [sp, 0xC8] + str r0, [r1, 0x4] + mov r0, sp + ldr r1, [sp, 0xC4] + movs r2, 0x60 + bl memcpy + bl sub_8083D44 + adds r0, r7, 0x4 + mov r1, sp + mov r2, r10 + bl sub_806455C + movs r0, 0x2D + bl sub_803E46C + adds r0, r7, 0 + bl sub_80645D4 + strh r4, [r5, 0x8] + strh r4, [r5, 0xA] + mov r0, sp + movs r1, 0x16 + bl sub_805FC30 +_0806445C: + adds r0, r5, 0 + bl AddMenuCursorSprite + movs r0, 0x2D + bl sub_803E46C + mov r2, r8 + ldrh r1, [r2, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08064482 + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80136E0 +_08064482: + mov r0, r8 + ldrh r1, [r0, 0x4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0806449C + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_8013744 +_0806449C: + mov r2, r8 + ldrh r1, [r2, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080644B2 + adds r0, r5, 0 + adds r0, 0x29 + ldrb r0, [r0] + cmp r0, 0 + beq _08064510 +_080644B2: + movs r1, 0x18 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + bne _080644D0 + bl sub_8083D08 + ldr r0, [sp, 0xCC] + bl sub_80645F8 + movs r4, 0x2 + b _0806452A + .align 2, 0 +_080644C8: .4byte gUnknown_202EE10 +_080644CC: .4byte gUnknown_20255F0 +_080644D0: + movs r2, 0x18 + ldrsh r0, [r5, r2] + bl sub_8044F3C + lsls r0, 24 + cmp r0, 0 + beq _0806450C + ldr r4, [r7, 0x70] + adds r4, 0x44 + ldr r1, _08064508 + movs r2, 0x18 + ldrsh r0, [r5, r2] + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0] + adds r0, r4, 0 + bl sub_8044C94 + bl sub_8083D08 + strb r6, [r4, 0x4] + strh r6, [r4, 0x8] + strh r6, [r4, 0xA] + strb r6, [r4, 0xC] + strh r6, [r4, 0x10] + strh r6, [r4, 0x12] + movs r4, 0 + b _0806452A + .align 2, 0 +_08064508: .4byte gUnknown_202EE44 +_0806450C: + bl sub_8083D30 +_08064510: + mov r0, r8 + ldrh r1, [r0, 0x2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08064524 + ldr r1, _08064554 + ldrb r0, [r1] + cmp r0, 0 + beq _0806445C +_08064524: + bl sub_8083D30 + movs r4, 0x1 +_0806452A: + ldr r0, _08064558 + bl AddMenuCursorSprite + movs r0, 0x2D + bl sub_803E46C + cmp r4, 0x2 + bne _0806453C + b _080643F0 +_0806453C: + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + add sp, 0xE4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08064554: .4byte gUnknown_202EE3A +_08064558: .4byte gUnknown_202EE10 + thumb_func_end sub_80643AC + + thumb_func_start sub_806455C +sub_806455C: + push {r4,r5,lr} + sub sp, 0x54 + adds r4, r0, 0 + adds r0, r1, 0 + movs r5, 0 + movs r1, 0x1 + strb r1, [r2] + strb r5, [r2, 0x1] + movs r1, 0xC + strb r1, [r2, 0x2] + strb r5, [r2, 0x3] + movs r1, 0x1 + bl sub_803ECB4 + movs r0, 0 + bl sub_80073B8 + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl sub_804954C + adds r4, r0, 0 + ldr r0, _080645D0 + ldr r2, [r0] + str r5, [sp] + movs r0, 0xC + movs r1, 0 + movs r3, 0 + bl xxx_call_draw_string + ldr r0, [r4, 0x14] + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080645C0 + ldr r1, [r4, 0x14] + add r0, sp, 0x4 + movs r2, 0 + bl sub_8045B94 + str r5, [sp] + movs r0, 0x8 + movs r1, 0x12 + add r2, sp, 0x4 + movs r3, 0 + bl xxx_call_draw_string +_080645C0: + movs r0, 0 + bl sub_80073E0 + add sp, 0x54 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080645D0: .4byte gUnknown_80FE708 + thumb_func_end sub_806455C + + thumb_func_start sub_80645D4 +sub_80645D4: + push {lr} + ldr r1, _080645F4 + movs r0, 0 + str r0, [r1] + movs r0, 0x25 + movs r1, 0 + bl sub_8044F5C + movs r0, 0xC + movs r1, 0 + bl sub_8044F5C + bl sub_8045064 + pop {r0} + bx r0 + .align 2, 0 +_080645F4: .4byte gUnknown_202EE6C + thumb_func_end sub_80645D4 + + thumb_func_start sub_80645F8 +sub_80645F8: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x110 + str r0, [sp, 0xE4] + mov r0, sp + adds r0, 0x84 + str r0, [sp, 0xF4] + mov r1, sp + adds r1, 0x88 + str r1, [sp, 0xF8] + mov r2, sp + adds r2, 0x8C + str r2, [sp, 0xFC] + mov r3, sp + adds r3, 0x8E + str r3, [sp, 0x100] + adds r0, 0xC + str r0, [sp, 0x104] + adds r1, 0xC + str r1, [sp, 0x108] + adds r2, 0xC + str r2, [sp, 0x10C] + adds r3, 0x22 + str r3, [sp, 0xEC] + adds r0, 0x38 + str r0, [sp, 0xF0] + add r6, sp, 0x14 + subs r1, 0x74 + str r1, [sp, 0xE8] + add r2, sp, 0x80 + mov r10, r2 + add r3, sp, 0xE0 + mov r9, r3 +_08064640: + movs r7, 0 + mov r0, r10 + movs r1, 0 + movs r2, 0x60 + bl memset + movs r0, 0x6 + ldr r1, [sp, 0xF4] + str r0, [r1] + movs r0, 0x2 + ldr r2, [sp, 0xF8] + strh r0, [r2] + strh r0, [r2, 0x2] + movs r0, 0x1A + ldr r3, [sp, 0xFC] + strh r0, [r3] + movs r0, 0xC + ldr r1, [sp, 0x100] + strh r0, [r1] + ldr r2, [sp, 0x104] + strh r0, [r2] + mov r3, r9 + ldr r0, [sp, 0x108] + str r3, [r0] + movs r0, 0x3 + ldr r1, [sp, 0x10C] + str r0, [r1, 0x4] + ldr r2, [sp, 0xEC] + str r0, [r2, 0x4] + ldr r3, [sp, 0xF0] + str r0, [r3, 0x4] + ldr r0, [sp, 0xE8] + mov r1, r10 + movs r2, 0x60 + bl memcpy + adds r0, r6, 0 + bl sub_801317C + movs r1, 0x1 + add r0, sp, 0xE0 + strb r1, [r0] + movs r1, 0 + mov r0, r9 + strb r1, [r0, 0x1] + movs r0, 0x10 + mov r2, r9 + strb r0, [r2, 0x2] + strb r1, [r2, 0x3] + ldr r3, [sp, 0xE4] + movs r1, 0 + ldrsh r0, [r3, r1] + movs r2, 0x2 + ldrsh r1, [r3, r2] + bl sub_804954C + ldr r4, [r0, 0x14] + cmp r4, 0 + bne _080646B8 + b _080647D8 +_080646B8: + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0x2 + beq _080646C4 + b _080647D8 +_080646C4: + ldr r0, [sp, 0xE8] + movs r1, 0 + bl sub_803ECB4 + adds r0, r4, 0 + bl sub_8045104 + adds r4, r0, 0 + ldrb r1, [r4] + mov r0, r10 + bl sub_807FE84 + movs r0, 0 + bl sub_80073B8 + str r7, [sp] + movs r0, 0x10 + movs r1, 0 + mov r2, r10 + movs r3, 0 + bl xxx_call_draw_string + ldr r5, _08064720 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r5 + ldr r2, [r0] + str r7, [sp] + movs r0, 0x8 + movs r1, 0x18 + movs r3, 0 + bl xxx_call_draw_string + movs r0, 0 + bl sub_80073E0 + ldrb r0, [r4] + lsls r0, 2 + adds r0, r5 + ldr r0, [r0] + add r1, sp, 0x4 + bl sub_8097DF0 + adds r5, r0, 0 + b _08064738 + .align 2, 0 +_08064720: .4byte gUnknown_80F8130 +_08064724: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08064732 + ldrb r0, [r6, 0x2] + cmp r0, 0 + beq _08064738 +_08064732: + bl sub_8083D30 + b _080647D8 +_08064738: + cmp r5, 0 + beq _08064740 + bl sub_8062500 +_08064740: + adds r0, r6, 0 + movs r1, 0 + bl nullsub_34 + movs r0, 0x16 + bl sub_803E46C + ldr r0, _08064788 + ldrh r1, [r0, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08064760 + ldrb r0, [r6, 0x1] + cmp r0, 0 + beq _08064724 +_08064760: + bl sub_8083D08 + cmp r5, 0 + beq _080647D8 + movs r4, 0 + cmp r4, r5 + blt _08064770 + b _08064640 +_08064770: + subs r3, r5, 0x1 + mov r8, r3 +_08064774: + lsls r0, r4, 2 + add r0, sp + adds r0, 0x4 + ldr r0, [r0] + adds r1, r6, 0 + bl sub_80639E4 + adds r7, r4, 0x1 + b _080647A0 + .align 2, 0 +_08064788: .4byte gUnknown_20255F0 +_0806478C: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0806479A + ldrb r0, [r6, 0x2] + cmp r0, 0 + beq _080647A0 +_0806479A: + bl sub_8083D30 + b _080647CC +_080647A0: + cmp r4, r8 + bge _080647A8 + bl sub_8062500 +_080647A8: + adds r0, r6, 0 + movs r1, 0 + bl nullsub_34 + movs r0, 0x16 + bl sub_803E46C + ldr r0, _080647D4 + ldrh r1, [r0, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080647C8 + ldrb r0, [r6, 0x1] + cmp r0, 0 + beq _0806478C +_080647C8: + bl sub_8083D08 +_080647CC: + adds r4, r7, 0 + cmp r4, r5 + blt _08064774 + b _08064640 + .align 2, 0 +_080647D4: .4byte gUnknown_20255F0 +_080647D8: + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + add sp, 0x110 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80645F8 + + thumb_func_start sub_80647F0 +sub_80647F0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xE4 + adds r7, r0, 0 + add r0, sp, 0x68 + mov r9, r0 + mov r1, sp + adds r1, 0x6C + str r1, [sp, 0xD0] + mov r2, sp + adds r2, 0x6E + str r2, [sp, 0xD4] + mov r0, sp + adds r0, 0x70 + str r0, [sp, 0xD8] + adds r1, 0xC + str r1, [sp, 0xDC] + adds r2, 0x22 + str r2, [sp, 0xE0] + adds r0, 0x38 + str r0, [sp, 0xC8] + subs r1, 0x18 + str r1, [sp, 0xC4] + add r2, sp, 0xC0 + mov r10, r2 + ldr r5, _0806490C + adds r0, r7, 0x4 + str r0, [sp, 0xCC] + ldr r1, _08064910 + mov r8, r1 + movs r6, 0 +_08064834: + movs r4, 0 + ldr r0, [sp, 0xC4] + movs r1, 0 + movs r2, 0x60 + bl memset + movs r0, 0x6 + str r0, [sp, 0x64] + movs r0, 0x2 + mov r2, r9 + strh r0, [r2] + strh r0, [r2, 0x2] + movs r0, 0x12 + ldr r1, [sp, 0xD0] + strh r0, [r1] + movs r0, 0x4 + ldr r2, [sp, 0xD4] + strh r0, [r2] + movs r0, 0x10 + ldr r1, [sp, 0xD8] + strh r0, [r1] + mov r2, r10 + str r2, [sp, 0x74] + movs r0, 0x3 + ldr r1, [sp, 0xDC] + str r0, [r1, 0x4] + ldr r2, [sp, 0xE0] + str r0, [r2, 0x4] + ldr r1, [sp, 0xC8] + str r0, [r1, 0x4] + mov r0, sp + ldr r1, [sp, 0xC4] + movs r2, 0x60 + bl memcpy + bl sub_8083D44 + adds r0, r7, 0x4 + mov r1, sp + mov r2, r10 + bl sub_80649A0 + movs r0, 0x2E + bl sub_803E46C + adds r0, r7, 0 + bl sub_8064A18 + strh r4, [r5, 0x8] + strh r4, [r5, 0xA] + mov r0, sp + movs r1, 0x16 + bl sub_805FC30 +_080648A0: + adds r0, r5, 0 + bl AddMenuCursorSprite + movs r0, 0x2E + bl sub_803E46C + mov r2, r8 + ldrh r1, [r2, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _080648C6 + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80136E0 +_080648C6: + mov r0, r8 + ldrh r1, [r0, 0x4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080648E0 + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_8013744 +_080648E0: + mov r2, r8 + ldrh r1, [r2, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080648F6 + adds r0, r5, 0 + adds r0, 0x29 + ldrb r0, [r0] + cmp r0, 0 + beq _08064954 +_080648F6: + movs r1, 0x18 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + bne _08064914 + bl sub_8083D08 + ldr r0, [sp, 0xCC] + bl sub_8064A3C + movs r4, 0x2 + b _0806496E + .align 2, 0 +_0806490C: .4byte gUnknown_202EE10 +_08064910: .4byte gUnknown_20255F0 +_08064914: + movs r2, 0x18 + ldrsh r0, [r5, r2] + bl sub_8044F3C + lsls r0, 24 + cmp r0, 0 + beq _08064950 + ldr r4, [r7, 0x70] + adds r4, 0x44 + ldr r1, _0806494C + movs r2, 0x18 + ldrsh r0, [r5, r2] + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0] + adds r0, r4, 0 + bl sub_8044C94 + bl sub_8083D08 + strb r6, [r4, 0x4] + strh r6, [r4, 0x8] + strh r6, [r4, 0xA] + strb r6, [r4, 0xC] + strh r6, [r4, 0x10] + strh r6, [r4, 0x12] + movs r4, 0 + b _0806496E + .align 2, 0 +_0806494C: .4byte gUnknown_202EE44 +_08064950: + bl sub_8083D30 +_08064954: + mov r0, r8 + ldrh r1, [r0, 0x2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08064968 + ldr r1, _08064998 + ldrb r0, [r1] + cmp r0, 0 + beq _080648A0 +_08064968: + bl sub_8083D30 + movs r4, 0x1 +_0806496E: + ldr r0, _0806499C + bl AddMenuCursorSprite + movs r0, 0x2E + bl sub_803E46C + cmp r4, 0x2 + bne _08064980 + b _08064834 +_08064980: + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + add sp, 0xE4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08064998: .4byte gUnknown_202EE3A +_0806499C: .4byte gUnknown_202EE10 + thumb_func_end sub_80647F0 + + thumb_func_start sub_80649A0 +sub_80649A0: + push {r4,r5,lr} + sub sp, 0x4 + adds r0, r1, 0 + movs r3, 0 + movs r1, 0x1 + strb r1, [r2] + strb r3, [r2, 0x1] + movs r1, 0xB + strb r1, [r2, 0x2] + strb r3, [r2, 0x3] + movs r1, 0x1 + bl sub_803ECB4 + movs r0, 0 + bl sub_80073B8 + bl sub_8043D10 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _080649E4 + cmp r0, 0x1 + ble _080649D4 + cmp r0, 0x2 + beq _080649DC +_080649D4: + ldr r0, _080649D8 + b _080649E6 + .align 2, 0 +_080649D8: .4byte gUnknown_80FE70C +_080649DC: + ldr r0, _080649E0 + b _080649E6 + .align 2, 0 +_080649E0: .4byte gUnknown_80FE720 +_080649E4: + ldr r0, _08064A14 +_080649E6: + ldr r5, [r0] + movs r4, 0 + str r4, [sp] + movs r0, 0xC + movs r1, 0 + adds r2, r5, 0 + movs r3, 0 + bl xxx_call_draw_string + str r4, [sp] + movs r0, 0x8 + movs r1, 0x12 + adds r2, r5, 0 + movs r3, 0 + bl xxx_call_draw_string + movs r0, 0 + bl sub_80073E0 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08064A14: .4byte gUnknown_80FE724 + thumb_func_end sub_80649A0 + + thumb_func_start sub_8064A18 +sub_8064A18: + push {lr} + ldr r1, _08064A38 + movs r0, 0 + str r0, [r1] + movs r0, 0x26 + movs r1, 0 + bl sub_8044F5C + movs r0, 0xC + movs r1, 0 + bl sub_8044F5C + bl sub_8045064 + pop {r0} + bx r0 + .align 2, 0 +_08064A38: .4byte gUnknown_202EE6C + thumb_func_end sub_8064A18 + + thumb_func_start sub_8064A3C +sub_8064A3C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xE8 + mov r0, sp + adds r0, 0x20 + str r0, [sp, 0xE4] + add r1, sp, 0x80 + mov r10, r1 + add r0, sp, 0xE0 + mov r9, r0 + add r5, sp, 0x14 +_08064A58: + mov r0, r10 + movs r1, 0 + movs r2, 0x60 + bl memset + add r1, sp, 0x84 + movs r0, 0x6 + str r0, [r1] + add r0, sp, 0x88 + movs r1, 0x2 + strh r1, [r0] + strh r1, [r0, 0x2] + add r1, sp, 0x8C + movs r0, 0x1A + strh r0, [r1] + mov r0, sp + adds r0, 0x8E + movs r1, 0xC + strh r1, [r0] + add r0, sp, 0x90 + strh r1, [r0] + add r0, sp, 0x94 + mov r1, r9 + str r1, [r0] + add r0, sp, 0x98 + movs r1, 0x3 + str r1, [r0, 0x4] + add r0, sp, 0xB0 + str r1, [r0, 0x4] + add r0, sp, 0xC8 + str r1, [r0, 0x4] + ldr r0, [sp, 0xE4] + mov r1, r10 + movs r2, 0x60 + bl memcpy + add r0, sp, 0x14 + bl sub_801317C + movs r0, 0x1 + mov r1, r9 + strb r0, [r1] + movs r0, 0 + strb r0, [r1, 0x1] + movs r0, 0x10 + strb r0, [r1, 0x2] + movs r0, 0 + strb r0, [r1, 0x3] + ldr r0, [sp, 0xE4] + movs r1, 0 + bl sub_803ECB4 + bl sub_8043D10 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + bl sub_80073B8 + ldr r0, _08064B0C + lsls r4, 2 + adds r0, r4, r0 + ldr r2, [r0] + movs r1, 0 + str r1, [sp] + movs r0, 0x10 + movs r3, 0 + bl xxx_call_draw_string + ldr r0, _08064B10 + adds r4, r0 + ldr r4, [r4] + movs r0, 0 + str r0, [sp] + movs r0, 0x8 + movs r1, 0x18 + adds r2, r4, 0 + movs r3, 0 + bl xxx_call_draw_string + movs r0, 0 + bl sub_80073E0 + adds r0, r4, 0 + add r1, sp, 0x4 + bl sub_8097DF0 + adds r6, r0, 0 + b _08064B28 + .align 2, 0 +_08064B0C: .4byte gUnknown_80F8104 +_08064B10: .4byte gUnknown_80F7F70 +_08064B14: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08064B22 + ldrb r0, [r5, 0x2] + cmp r0, 0 + beq _08064B28 +_08064B22: + bl sub_8083D30 + b _08064BC8 +_08064B28: + cmp r6, 0 + beq _08064B30 + bl sub_8062500 +_08064B30: + adds r0, r5, 0 + movs r1, 0 + bl nullsub_34 + movs r0, 0x16 + bl sub_803E46C + ldr r0, _08064B78 + ldrh r1, [r0, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08064B50 + ldrb r0, [r5, 0x1] + cmp r0, 0 + beq _08064B14 +_08064B50: + bl sub_8083D08 + cmp r6, 0 + beq _08064BC8 + movs r4, 0 + cmp r4, r6 + blt _08064B60 + b _08064A58 +_08064B60: + subs r1, r6, 0x1 + mov r8, r1 +_08064B64: + lsls r0, r4, 2 + add r0, sp + adds r0, 0x4 + ldr r0, [r0] + adds r1, r5, 0 + bl sub_80639E4 + adds r7, r4, 0x1 + b _08064B90 + .align 2, 0 +_08064B78: .4byte gUnknown_20255F0 +_08064B7C: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08064B8A + ldrb r0, [r5, 0x2] + cmp r0, 0 + beq _08064B90 +_08064B8A: + bl sub_8083D30 + b _08064BBC +_08064B90: + cmp r4, r8 + bge _08064B98 + bl sub_8062500 +_08064B98: + adds r0, r5, 0 + movs r1, 0 + bl nullsub_34 + movs r0, 0x16 + bl sub_803E46C + ldr r0, _08064BC4 + ldrh r1, [r0, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08064BB8 + ldrb r0, [r5, 0x1] + cmp r0, 0 + beq _08064B7C +_08064BB8: + bl sub_8083D08 +_08064BBC: + adds r4, r7, 0 + cmp r4, r6 + blt _08064B64 + b _08064A58 + .align 2, 0 +_08064BC4: .4byte gUnknown_20255F0 +_08064BC8: + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + add sp, 0xE8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8064A3C + + thumb_func_start sub_8064BE0 +sub_8064BE0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, _08064C94 + ldr r0, [r0] + movs r1, 0xCB + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0x4 + mov r9, r1 + cmp r0, 0 + beq _08064C02 + movs r0, 0x5 + mov r9, r0 +_08064C02: + ldr r1, _08064C98 + movs r0, 0 + str r0, [r1] + mov r10, r0 + ldr r6, _08064C9C + ldr r7, _08064CA0 + movs r1, 0x2A + adds r1, r6 + mov r8, r1 +_08064C14: + movs r5, 0 + bl sub_8065250 +_08064C1A: + adds r0, r6, 0 + bl AddMenuCursorSprite + movs r0, 0x24 + bl sub_803E46C + ldrh r1, [r7, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08064C3E + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r6, 0 + movs r1, 0x1 + bl sub_80136E0 +_08064C3E: + ldrh r1, [r7, 0x4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08064C56 + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r6, 0 + movs r1, 0x1 + bl sub_8013744 +_08064C56: + ldrh r1, [r7, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08064C6A + adds r0, r6, 0 + adds r0, 0x29 + ldrb r0, [r0] + cmp r0, 0 + beq _08064CAA +_08064C6A: + movs r1, 0x18 + ldrsh r0, [r6, r1] + cmp r0, 0x4 + bne _08064C8C + ldr r0, _08064C94 + ldr r0, [r0] + movs r1, 0xCB + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08064CA4 + bl sub_80441BC + lsls r0, 24 + cmp r0, 0 + bne _08064CA4 +_08064C8C: + bl sub_8083D08 + b _08064CC0 + .align 2, 0 +_08064C94: .4byte gUnknown_203B418 +_08064C98: .4byte gUnknown_202F2E0 +_08064C9C: .4byte gUnknown_202EE10 +_08064CA0: .4byte gUnknown_20255F0 +_08064CA4: + bl sub_8083D30 + b _08064CC0 +_08064CAA: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08064CBA + mov r1, r8 + ldrb r0, [r1] + cmp r0, 0 + beq _08064C1A +_08064CBA: + bl sub_8083D30 + movs r5, 0x1 +_08064CC0: + ldr r4, _08064D68 + adds r0, r4, 0 + bl AddMenuCursorSprite + movs r0, 0x24 + bl sub_803E46C + mov r0, r10 + cmp r0, 0 + bne _08064C14 + cmp r5, 0 + bne _08064D4C + ldr r5, _08064D6C + movs r1, 0x18 + ldrsh r0, [r4, r1] + str r0, [r5] + cmp r0, 0 + bne _08064CE8 + bl sub_8064D74 +_08064CE8: + ldr r0, [r5] + cmp r0, 0x1 + bne _08064CF2 + bl sub_80650C0 +_08064CF2: + ldr r0, [r5] + cmp r0, 0x2 + bne _08064CFC + bl sub_80532B4 +_08064CFC: + ldr r0, [r5] + cmp r0, 0x3 + bne _08064D06 + bl sub_806519C +_08064D06: + ldr r0, _08064D70 + ldr r0, [r0] + movs r1, 0xCB + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08064D2A + bl sub_80441BC + lsls r0, 24 + cmp r0, 0 + bne _08064D2A + ldr r0, [r5] + cmp r0, 0x4 + bne _08064D2A + bl sub_8065FB4 +_08064D2A: + ldr r0, _08064D6C + ldr r0, [r0] + cmp r0, r9 + bne _08064D36 + bl sub_8065BF4 +_08064D36: + ldr r0, _08064D70 + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _08064D4C + bl sub_805F1AC + lsls r0, 16 + cmp r0, 0 + bne _08064D4C + b _08064C14 +_08064D4C: + bl sub_8040A84 + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08064D68: .4byte gUnknown_202EE10 +_08064D6C: .4byte gUnknown_202F2E0 +_08064D70: .4byte gUnknown_203B418 + thumb_func_end sub_8064BE0 + + thumb_func_start sub_8064D74 +sub_8064D74: + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r6, _08064DE0 + ldr r7, _08064DE4 + movs r0, 0x2A + adds r0, r6 + mov r8, r0 +_08064D84: + movs r5, 0 + bl sub_8065574 +_08064D8A: + adds r0, r6, 0 + bl AddMenuCursorSprite + movs r0, 0x24 + bl sub_803E46C + ldrh r1, [r7, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08064DAE + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r6, 0 + movs r1, 0x1 + bl sub_80136E0 +_08064DAE: + ldrh r1, [r7, 0x4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08064DC6 + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r6, 0 + movs r1, 0x1 + bl sub_8013744 +_08064DC6: + ldrh r1, [r7, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08064DDA + adds r0, r6, 0 + adds r0, 0x29 + ldrb r0, [r0] + cmp r0, 0 + beq _08064DE8 +_08064DDA: + bl sub_8083D08 + b _08064DFE + .align 2, 0 +_08064DE0: .4byte gUnknown_202EE10 +_08064DE4: .4byte gUnknown_20255F0 +_08064DE8: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08064DF8 + mov r1, r8 + ldrb r0, [r1] + cmp r0, 0 + beq _08064D8A +_08064DF8: + bl sub_8083D30 + movs r5, 0x1 +_08064DFE: + ldr r4, _08064E2C + adds r0, r4, 0 + bl AddMenuCursorSprite + movs r0, 0x24 + bl sub_803E46C + cmp r5, 0 + bne _08064E56 + ldr r0, _08064E30 + ldr r1, _08064E34 + ldr r0, [r0] + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldr r0, [r0] + str r0, [r1] + movs r1, 0x18 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08064E38 + bl sub_8064E68 + b _08064E40 + .align 2, 0 +_08064E2C: .4byte gUnknown_202EE10 +_08064E30: .4byte gUnknown_203B46C +_08064E34: .4byte gUnknown_202F2E8 +_08064E38: + cmp r0, 0x1 + bne _08064E4C + bl sub_8064F50 +_08064E40: + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + bl sub_8065040 + b _08064D84 +_08064E4C: + cmp r0, 0x2 + bne _08064D84 + bl sub_806509C + b _08064D84 +_08064E56: + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8064D74 + + thumb_func_start sub_8064E68 +sub_8064E68: + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r7, 0 + ldr r0, _08064EDC + strh r7, [r0, 0x18] + adds r4, r0, 0 + ldr r6, _08064EE0 + movs r0, 0x2A + adds r0, r4 + mov r8, r0 +_08064E7E: + movs r7, 0 + movs r5, 0 + bl sub_80656C0 +_08064E86: + adds r0, r4, 0 + bl AddMenuCursorSprite + movs r0, 0x24 + bl sub_803E46C + ldrh r1, [r6, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08064EAA + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80136E0 +_08064EAA: + ldrh r1, [r6, 0x4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08064EC2 + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8013744 +_08064EC2: + ldrh r1, [r6, 0x4] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08064EE4 + movs r0, 0 + bl sub_8083CE0 + movs r1, 0x18 + ldrsh r0, [r4, r1] + bl sub_8065A8C + b _08064F2E + .align 2, 0 +_08064EDC: .4byte gUnknown_202EE10 +_08064EE0: .4byte gUnknown_20255F0 +_08064EE4: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08064EFC + movs r0, 0 + bl sub_8083CE0 + movs r2, 0x18 + ldrsh r0, [r4, r2] + bl sub_8065B3C + b _08064F2E +_08064EFC: + ldrh r1, [r6, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08064F0E + mov r2, r8 + ldrb r0, [r2] + cmp r0, 0 + beq _08064F14 +_08064F0E: + bl sub_8083D08 + b _08064F30 +_08064F14: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08064F24 + bl sub_8083D30 + movs r7, 0x1 + b _08064F30 +_08064F24: + bl sub_8065BEC + lsls r0, 24 + cmp r0, 0 + beq _08064E86 +_08064F2E: + movs r5, 0x1 +_08064F30: + ldr r0, _08064F4C + bl AddMenuCursorSprite + movs r0, 0x24 + bl sub_803E46C + cmp r5, 0 + bne _08064E7E + adds r0, r7, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08064F4C: .4byte gUnknown_202EE10 + thumb_func_end sub_8064E68 + + thumb_func_start sub_8064F50 +sub_8064F50: + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r7, 0 + ldr r0, _08064FC8 + strh r7, [r0, 0x18] + adds r4, r0, 0 + ldr r6, _08064FCC + movs r0, 0x2A + adds r0, r4 + mov r8, r0 +_08064F66: + movs r7, 0 + movs r5, 0 + bl sub_8065948 +_08064F6E: + adds r0, r4, 0 + bl AddMenuCursorSprite + movs r0, 0x24 + bl sub_803E46C + ldrh r1, [r6, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08064F92 + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80136E0 +_08064F92: + ldrh r1, [r6, 0x4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08064FAA + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8013744 +_08064FAA: + ldrh r1, [r6, 0x4] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08064FD0 + movs r0, 0 + bl sub_8083CE0 + movs r1, 0x18 + ldrsh r0, [r4, r1] + adds r0, 0x5 + bl sub_8065A8C + b _0806501C + .align 2, 0 +_08064FC8: .4byte gUnknown_202EE10 +_08064FCC: .4byte gUnknown_20255F0 +_08064FD0: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08064FEA + movs r0, 0 + bl sub_8083CE0 + movs r2, 0x18 + ldrsh r0, [r4, r2] + adds r0, 0x5 + bl sub_8065B3C + b _0806501C +_08064FEA: + ldrh r1, [r6, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08064FFC + mov r2, r8 + ldrb r0, [r2] + cmp r0, 0 + beq _08065002 +_08064FFC: + bl sub_8083D08 + b _0806501E +_08065002: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08065012 + bl sub_8083D30 + movs r7, 0x1 + b _0806501E +_08065012: + bl sub_8065BF0 + lsls r0, 24 + cmp r0, 0 + beq _08064F6E +_0806501C: + movs r5, 0x1 +_0806501E: + ldr r0, _0806503C + bl AddMenuCursorSprite + movs r0, 0x24 + bl sub_803E46C + cmp r5, 0 + bne _08064F66 + adds r0, r7, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0806503C: .4byte gUnknown_202EE10 + thumb_func_end sub_8064F50 + + thumb_func_start sub_8065040 +sub_8065040: + push {r4,lr} + lsls r0, 24 + movs r4, 0 + cmp r0, 0 + beq _0806505C + ldr r0, _08065058 + bl sub_80949DC + lsls r0, 24 + cmp r0, 0 + bne _0806505E + b _08065062 + .align 2, 0 +_08065058: .4byte gUnknown_202F2E8 +_0806505C: + movs r4, 0x1 +_0806505E: + cmp r4, 0 + beq _08065088 +_08065062: + ldr r0, _08065090 + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_8052B8C + cmp r0, 0x1 + bne _08065088 + ldr r0, _08065094 + ldr r1, [r0] + ldr r0, _08065098 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r0, [r0] + str r0, [r1] + bl sub_803E13C + bl sub_8040238 +_08065088: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08065090: .4byte gUnknown_80FEBF8 +_08065094: .4byte gUnknown_203B46C +_08065098: .4byte gUnknown_202F2E8 + thumb_func_end sub_8065040 + + thumb_func_start sub_806509C +sub_806509C: + push {lr} + ldr r0, _080650BC + ldr r1, [r0] + movs r0, 0 + movs r2, 0 + bl sub_8052B8C + cmp r0, 0x1 + bne _080650B8 + movs r0, 0 + bl sub_8094998 + bl sub_803E13C +_080650B8: + pop {r0} + bx r0 + .align 2, 0 +_080650BC: .4byte gUnknown_80FEC28 + thumb_func_end sub_806509C + + thumb_func_start sub_80650C0 +sub_80650C0: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r0, 0 + mov r9, r0 + ldr r5, _08065134 + ldr r6, _08065138 + movs r1, 0x2A + adds r1, r5 + mov r8, r1 +_080650D6: + movs r7, 0 + bl sub_806544C +_080650DC: + adds r0, r5, 0 + bl AddMenuCursorSprite + movs r0, 0x24 + bl sub_803E46C + ldrh r1, [r6, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08065100 + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80136E0 +_08065100: + ldrh r1, [r6, 0x4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08065118 + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_8013744 +_08065118: + ldrh r1, [r6, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0806512C + adds r0, r5, 0 + adds r0, 0x29 + ldrb r0, [r0] + cmp r0, 0 + beq _0806513C +_0806512C: + bl sub_8083D08 + b _08065152 + .align 2, 0 +_08065134: .4byte gUnknown_202EE10 +_08065138: .4byte gUnknown_20255F0 +_0806513C: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0806514C + mov r1, r8 + ldrb r0, [r1] + cmp r0, 0 + beq _080650DC +_0806514C: + bl sub_8083D30 + movs r7, 0x1 +_08065152: + ldr r4, _08065178 + adds r0, r4, 0 + bl AddMenuCursorSprite + movs r0, 0x24 + bl sub_803E46C + mov r0, r9 + cmp r0, 0 + bne _080650D6 + cmp r7, 0 + bne _0806518E + movs r1, 0x18 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _0806517C + bl sub_80651D0 + b _08065184 + .align 2, 0 +_08065178: .4byte gUnknown_202EE10 +_0806517C: + cmp r0, 0x1 + bne _08065184 + bl sub_80651FC +_08065184: + bl sub_805F1AC + lsls r0, 16 + cmp r0, 0 + beq _080650D6 +_0806518E: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80650C0 + + thumb_func_start sub_806519C +sub_806519C: + push {lr} + ldr r0, _080651CC + ldr r1, [r0] + movs r2, 0xCF + lsls r2, 3 + adds r0, r1, r2 + ldrb r0, [r0] + subs r2, 0x34 + adds r1, r2 + ldrb r1, [r1] + movs r2, 0 + bl sub_80319A4 +_080651B6: + movs r0, 0x47 + bl sub_803E46C + bl sub_80319F8 + cmp r0, 0 + beq _080651B6 + bl sub_8031A3C + pop {r0} + bx r0 + .align 2, 0 +_080651CC: .4byte gUnknown_203B418 + thumb_func_end sub_806519C + + thumb_func_start sub_80651D0 +sub_80651D0: + push {lr} + ldr r0, _080651F0 + ldr r1, [r0] + movs r0, 0 + movs r2, 0 + bl sub_8052B8C + cmp r0, 0x1 + bne _080651F4 + bl sub_805F1A0 + movs r1, 0x2B + bl sub_8044C94 + movs r0, 0 + b _080651F6 + .align 2, 0 +_080651F0: .4byte gUnknown_80FDE6C +_080651F4: + movs r0, 0x1 +_080651F6: + pop {r1} + bx r1 + thumb_func_end sub_80651D0 + + thumb_func_start sub_80651FC +sub_80651FC: + push {r4,r5,lr} + ldr r0, _08065238 + ldr r1, [r0] + movs r0, 0 + movs r2, 0 + bl sub_8052B8C + adds r5, r0, 0 + cmp r5, 0x1 + bne _08065248 + bl sub_805F1A0 + movs r1, 0x2E + bl sub_8044C94 + ldr r4, _0806523C + bl sub_8083600 + adds r2, r0, 0 + adds r0, r4, 0 + movs r1, 0 + bl sub_8083AB0 + ldr r0, _08065240 + ldr r0, [r0] + ldr r1, _08065244 + adds r0, r1 + strb r5, [r0] + movs r0, 0 + b _0806524A + .align 2, 0 +_08065238: .4byte gUnknown_80FDEB8 +_0806523C: .4byte 0x0000021b +_08065240: .4byte gUnknown_203B418 +_08065244: .4byte 0x00000654 +_08065248: + movs r0, 0x1 +_0806524A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80651FC + + thumb_func_start sub_8065250 +sub_8065250: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC8 + add r5, sp, 0x64 + adds r0, r5, 0 + movs r1, 0 + movs r2, 0x60 + bl memset + movs r0, 0x6 + str r0, [sp, 0x68] + add r0, sp, 0x6C + movs r4, 0 + movs r7, 0 + movs r1, 0x2 + mov r9, r1 + mov r1, r9 + strh r1, [r0] + strh r1, [r0, 0x2] + add r0, sp, 0x70 + movs r1, 0x12 + mov r10, r1 + mov r1, r10 + strh r1, [r0] + adds r0, 0x2 + movs r1, 0x10 + mov r8, r1 + mov r1, r8 + strh r1, [r0] + add r0, sp, 0x74 + strh r1, [r0] + add r6, sp, 0xC4 + str r6, [sp, 0x78] + movs r1, 0x3 + str r1, [sp, 0x80] + add r0, sp, 0x94 + str r1, [r0, 0x4] + add r0, sp, 0xAC + str r1, [r0, 0x4] + add r0, sp, 0x4 + adds r1, r5, 0 + movs r2, 0x60 + bl memcpy + movs r0, 0x1 + strb r0, [r6] + strb r4, [r6, 0x1] + strb r4, [r6, 0x3] + ldr r4, _080653D0 + ldr r0, _080653D4 + ldr r0, [r0] + strh r0, [r4, 0x18] + ldr r1, _080653D8 + ldr r0, [r1] + movs r1, 0xCB + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + movs r5, 0x5 + cmp r0, 0 + beq _080652D2 + movs r5, 0x6 +_080652D2: + strh r5, [r4, 0x1A] + strh r5, [r4, 0x1C] + strh r7, [r4, 0x1E] + strh r7, [r4, 0x20] + strh r7, [r4, 0x4] + mov r0, r8 + strh r0, [r4, 0x6] + strh r7, [r4, 0xC] + strh r7, [r4, 0xE] + strh r7, [r4, 0x14] + str r7, [r4] + adds r0, r4, 0 + adds r0, 0x28 + bl sub_801317C + add r0, sp, 0x4 + mov r1, r10 + strh r1, [r0, 0xC] + adds r0, r5, 0 + movs r1, 0xC + bl sub_80095E4 + add r2, sp, 0x4 + adds r1, r2, 0 + adds r0, 0x2 + strh r0, [r1, 0x10] + strh r0, [r2, 0xE] + movs r0, 0xA + strb r0, [r6, 0x2] + adds r0, r1, 0 + mov r1, r9 + strh r1, [r0, 0x8] + movs r1, 0x1 + bl sub_803ECB4 + adds r0, r4, 0 + movs r1, 0 + bl sub_80137B0 + movs r0, 0 + bl sub_80073B8 + movs r5, 0 + ldr r0, _080653DC + ldr r2, [r0] + str r5, [sp] + movs r0, 0x10 + movs r1, 0 + movs r3, 0 + bl sub_8014FF0 + adds r0, r4, 0 + movs r1, 0 + bl sub_8013800 + adds r1, r0, 0 + ldr r0, _080653E0 + ldr r2, [r0] + str r7, [sp] + movs r0, 0x8 + movs r3, 0 + bl sub_8014FF0 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8013800 + adds r1, r0, 0 + ldr r0, _080653E4 + ldr r2, [r0] + str r7, [sp] + movs r0, 0x8 + movs r3, 0 + bl sub_8014FF0 + adds r0, r4, 0 + movs r1, 0x2 + bl sub_8013800 + adds r1, r0, 0 + ldr r0, _080653E8 + ldr r2, [r0] + str r7, [sp] + movs r0, 0x8 + movs r3, 0 + bl sub_8014FF0 + movs r5, 0x4 + adds r0, r4, 0 + movs r1, 0x3 + bl sub_8013800 + adds r1, r0, 0 + ldr r0, _080653EC + ldr r2, [r0] + str r7, [sp] + movs r0, 0x8 + movs r3, 0 + bl sub_8014FF0 + ldr r1, _080653D8 + ldr r0, [r1] + movs r1, 0xCB + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0806540E + bl sub_80441BC + lsls r0, 24 + cmp r0, 0 + bne _080653F4 + movs r5, 0x5 + adds r0, r4, 0 + movs r1, 0x4 + bl sub_8013800 + adds r1, r0, 0 + ldr r0, _080653F0 + ldr r2, [r0] + str r7, [sp] + movs r0, 0x8 + movs r3, 0 + bl sub_8014FF0 + b _0806540E + .align 2, 0 +_080653D0: .4byte gUnknown_202EE10 +_080653D4: .4byte gUnknown_202F2E0 +_080653D8: .4byte gUnknown_203B418 +_080653DC: .4byte gUnknown_80FE8F8 +_080653E0: .4byte gUnknown_80FE9CC +_080653E4: .4byte gUnknown_80FE9E8 +_080653E8: .4byte gUnknown_80FE9F8 +_080653EC: .4byte gUnknown_80FEA10 +_080653F0: .4byte gUnknown_80FEA28 +_080653F4: + movs r5, 0x5 + adds r0, r4, 0 + movs r1, 0x4 + bl sub_8013800 + adds r1, r0, 0 + ldr r0, _08065440 + ldr r2, [r0] + str r7, [sp] + movs r0, 0x8 + movs r3, 0 + bl sub_8014FF0 +_0806540E: + ldr r0, _08065444 + adds r1, r5, 0 + bl sub_8013800 + adds r1, r0, 0 + ldr r0, _08065448 + ldr r2, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0x8 + movs r3, 0 + bl sub_8014FF0 + movs r0, 0 + bl sub_80073E0 + add sp, 0xC8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08065440: .4byte gUnknown_80FEA44 +_08065444: .4byte gUnknown_202EE10 +_08065448: .4byte gUnknown_80FEA50 + thumb_func_end sub_8065250 + + thumb_func_start sub_806544C +sub_806544C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC8 + add r0, sp, 0x64 + mov r10, r0 + movs r1, 0 + movs r2, 0x60 + bl memset + movs r0, 0x6 + str r0, [sp, 0x68] + add r0, sp, 0x6C + movs r4, 0 + movs r5, 0 + movs r1, 0x2 + mov r9, r1 + mov r2, r9 + strh r2, [r0] + strh r2, [r0, 0x2] + add r0, sp, 0x70 + movs r7, 0x12 + strh r7, [r0] + adds r0, 0x2 + movs r6, 0x10 + strh r6, [r0] + add r0, sp, 0x74 + strh r6, [r0] + add r0, sp, 0xC4 + mov r8, r0 + str r0, [sp, 0x78] + movs r1, 0x3 + str r1, [sp, 0x80] + add r0, sp, 0x94 + str r1, [r0, 0x4] + add r0, sp, 0xAC + str r1, [r0, 0x4] + add r0, sp, 0x4 + mov r1, r10 + movs r2, 0x60 + bl memcpy + movs r0, 0x1 + mov r1, r8 + strb r0, [r1] + strb r4, [r1, 0x1] + strb r4, [r1, 0x3] + ldr r4, _08065568 + strh r5, [r4, 0x18] + mov r2, r9 + strh r2, [r4, 0x1A] + strh r2, [r4, 0x1C] + strh r5, [r4, 0x1E] + strh r5, [r4, 0x20] + strh r5, [r4, 0x4] + strh r6, [r4, 0x6] + strh r5, [r4, 0xC] + strh r5, [r4, 0xE] + strh r5, [r4, 0x14] + str r5, [r4] + adds r0, r4, 0 + adds r0, 0x28 + bl sub_801317C + add r0, sp, 0x4 + strh r7, [r0, 0xC] + movs r0, 0x2 + movs r1, 0xC + bl sub_80095E4 + add r2, sp, 0x4 + adds r1, r2, 0 + adds r0, 0x2 + strh r0, [r1, 0x10] + strh r0, [r2, 0xE] + movs r0, 0xA + mov r1, r8 + strb r0, [r1, 0x2] + adds r0, r2, 0 + mov r2, r9 + strh r2, [r0, 0x8] + movs r1, 0x1 + bl sub_803ECB4 + adds r0, r4, 0 + movs r1, 0 + bl sub_80137B0 + movs r0, 0 + bl sub_80073B8 + ldr r0, _0806556C + ldr r2, [r0] + str r5, [sp] + movs r0, 0x10 + movs r1, 0 + movs r3, 0 + bl sub_8014FF0 + adds r0, r4, 0 + movs r1, 0 + bl sub_8013800 + adds r1, r0, 0 + ldr r6, _08065570 + movs r2, 0xAC + lsls r2, 1 + adds r0, r6, r2 + ldr r2, [r0] + str r5, [sp] + movs r0, 0x8 + movs r3, 0 + bl sub_8014FF0 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8013800 + adds r1, r0, 0 + movs r2, 0xB8 + lsls r2, 1 + adds r0, r6, r2 + ldr r2, [r0] + str r5, [sp] + movs r0, 0x8 + movs r3, 0 + bl sub_8014FF0 + movs r0, 0 + bl sub_80073E0 + add sp, 0xC8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08065568: .4byte gUnknown_202EE10 +_0806556C: .4byte gUnknown_80FE8F4 +_08065570: .4byte gUnknown_80F7C50 + thumb_func_end sub_806544C + + thumb_func_start sub_8065574 +sub_8065574: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xD4 + add r0, sp, 0x10 + mov r10, r0 + add r7, sp, 0x70 + adds r0, r7, 0 + movs r1, 0 + movs r2, 0x60 + bl memset + movs r0, 0x6 + str r0, [sp, 0x74] + add r0, sp, 0x78 + movs r4, 0 + movs r6, 0 + movs r1, 0x2 + strh r1, [r0] + strh r1, [r0, 0x2] + add r0, sp, 0x7C + movs r1, 0xC + strh r1, [r0] + adds r0, 0x2 + movs r1, 0x10 + mov r9, r1 + mov r1, r9 + strh r1, [r0] + add r0, sp, 0x80 + strh r1, [r0] + add r0, sp, 0x84 + add r1, sp, 0xD0 + mov r8, r1 + str r1, [r0] + add r0, sp, 0x88 + movs r5, 0x3 + str r5, [r0, 0x4] + add r0, sp, 0xA0 + str r5, [r0, 0x4] + add r0, sp, 0xB8 + str r5, [r0, 0x4] + mov r0, r10 + adds r1, r7, 0 + movs r2, 0x60 + bl memcpy + movs r0, 0x1 + mov r1, r8 + strb r0, [r1] + strb r4, [r1, 0x1] + strb r4, [r1, 0x3] + ldr r4, _080656AC + strh r6, [r4, 0x18] + strh r5, [r4, 0x1A] + strh r5, [r4, 0x1C] + strh r6, [r4, 0x1E] + strh r6, [r4, 0x20] + strh r6, [r4, 0x4] + mov r0, r9 + strh r0, [r4, 0x6] + strh r6, [r4, 0xC] + strh r6, [r4, 0xE] + strh r6, [r4, 0x14] + str r6, [r4] + adds r0, r4, 0 + adds r0, 0x28 + bl sub_801317C + movs r0, 0xC + mov r1, r10 + strh r0, [r1, 0xC] + movs r0, 0x3 + movs r1, 0xC + bl sub_80095E4 + adds r0, 0x2 + mov r1, r10 + strh r0, [r1, 0x10] + strh r0, [r1, 0xE] + movs r0, 0xA + mov r1, r8 + strb r0, [r1, 0x2] + movs r1, 0x2 + mov r0, r10 + strh r1, [r0, 0x8] + movs r1, 0x1 + bl sub_803ECB4 + adds r0, r4, 0 + movs r1, 0 + bl sub_80137B0 + adds r0, r4, 0 + movs r1, 0 + bl sub_8013800 + str r0, [sp, 0x4] + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8013800 + str r0, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x2 + bl sub_8013800 + str r0, [sp, 0xC] + movs r0, 0 + bl sub_80073B8 + ldr r0, _080656B0 + ldr r2, [r0] + str r6, [sp] + movs r0, 0x10 + movs r1, 0 + movs r3, 0 + bl sub_8014FF0 + ldr r1, [sp, 0x4] + ldr r0, _080656B4 + ldr r2, [r0] + str r6, [sp] + movs r0, 0x8 + movs r3, 0 + bl sub_8014FF0 + ldr r1, [sp, 0x8] + ldr r0, _080656B8 + ldr r2, [r0] + str r6, [sp] + movs r0, 0x8 + movs r3, 0 + bl sub_8014FF0 + ldr r1, [sp, 0xC] + ldr r0, _080656BC + ldr r2, [r0] + str r6, [sp] + movs r0, 0x8 + movs r3, 0 + bl sub_8014FF0 + movs r0, 0 + bl sub_80073E0 + add sp, 0xD4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080656AC: .4byte gUnknown_202EE10 +_080656B0: .4byte gUnknown_80FE8F0 +_080656B4: .4byte gUnknown_80FE730 +_080656B8: .4byte gUnknown_80FE73C +_080656BC: .4byte gUnknown_80FE748 + thumb_func_end sub_8065574 + + thumb_func_start sub_80656C0 +sub_80656C0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xDC + add r0, sp, 0x18 + mov r9, r0 + add r7, sp, 0x78 + adds r0, r7, 0 + movs r1, 0 + movs r2, 0x60 + bl memset + movs r0, 0x6 + str r0, [sp, 0x7C] + add r0, sp, 0x80 + movs r5, 0 + movs r1, 0x2 + mov r10, r1 + mov r2, r10 + strh r2, [r0] + strh r2, [r0, 0x2] + add r1, sp, 0x84 + movs r0, 0x12 + strh r0, [r1] + mov r0, sp + adds r0, 0x86 + movs r3, 0x10 + mov r8, r3 + mov r4, r8 + strh r4, [r0] + add r0, sp, 0x88 + strh r4, [r0] + add r0, sp, 0x8C + add r6, sp, 0xD8 + str r6, [r0] + add r0, sp, 0x90 + movs r1, 0x3 + str r1, [r0, 0x4] + add r0, sp, 0xA8 + str r1, [r0, 0x4] + add r0, sp, 0xC0 + str r1, [r0, 0x4] + mov r0, r9 + adds r1, r7, 0 + movs r2, 0x60 + bl memcpy + adds r1, r7, 0 + ldr r0, _0806583C + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + movs r0, 0x1 + strb r0, [r6] + movs r0, 0 + strb r0, [r6, 0x1] + strb r0, [r6, 0x3] + ldr r4, _08065840 + movs r0, 0x5 + strh r0, [r4, 0x1A] + strh r0, [r4, 0x1C] + strh r5, [r4, 0x1E] + strh r5, [r4, 0x20] + strh r5, [r4, 0x4] + mov r1, r8 + strh r1, [r4, 0x6] + strh r5, [r4, 0xC] + strh r5, [r4, 0xE] + strh r5, [r4, 0x14] + str r5, [r4] + adds r0, r4, 0 + adds r0, 0x28 + bl sub_801317C + movs r0, 0x18 + mov r2, r9 + strh r0, [r2, 0xC] + movs r0, 0x5 + movs r1, 0xC + bl sub_80095E4 + adds r0, 0x2 + mov r3, r9 + strh r0, [r3, 0x10] + strh r0, [r3, 0xE] + movs r0, 0xA + strb r0, [r6, 0x2] + mov r0, r10 + strh r0, [r3, 0x8] + mov r0, r9 + movs r1, 0x1 + bl sub_803ECB4 + adds r0, r4, 0 + movs r1, 0 + bl sub_80137B0 + adds r0, r4, 0 + movs r1, 0 + bl sub_8013800 + str r0, [sp, 0x4] + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8013800 + str r0, [sp, 0x8] + adds r0, r4, 0 + movs r1, 0x2 + bl sub_8013800 + str r0, [sp, 0xC] + adds r0, r4, 0 + movs r1, 0x3 + bl sub_8013800 + str r0, [sp, 0x10] + adds r0, r4, 0 + movs r1, 0x4 + bl sub_8013800 + str r0, [sp, 0x14] + movs r0, 0 + bl sub_80073B8 + ldr r0, _08065844 + ldr r2, [r0] + str r5, [sp] + movs r0, 0x10 + movs r1, 0 + movs r3, 0 + bl sub_8014FF0 + ldr r1, [sp, 0x4] + ldr r0, _08065848 + ldr r2, [r0] + str r5, [sp] + movs r0, 0x8 + movs r3, 0 + bl sub_8014FF0 + ldr r1, [sp, 0x8] + ldr r0, _0806584C + ldr r2, [r0] + str r5, [sp] + movs r0, 0x8 + movs r3, 0 + bl sub_8014FF0 + ldr r1, [sp, 0xC] + ldr r0, _08065850 + ldr r2, [r0] + str r5, [sp] + movs r0, 0x8 + movs r3, 0 + bl sub_8014FF0 + ldr r1, [sp, 0x10] + ldr r0, _08065854 + ldr r2, [r0] + str r5, [sp] + movs r0, 0x8 + movs r3, 0 + bl sub_8014FF0 + ldr r1, [sp, 0x14] + ldr r0, _08065858 + ldr r2, [r0] + str r5, [sp] + movs r0, 0x8 + movs r3, 0 + bl sub_8014FF0 + ldr r0, _0806585C + ldrb r0, [r0] + adds r4, r7, 0 + cmp r0, 0 + beq _08065860 + ldr r2, [sp, 0x4] + adds r2, 0xA + movs r0, 0x7 + str r0, [sp] + movs r0, 0 + movs r1, 0x88 + movs r3, 0x15 + bl sub_80078A4 + b _08065872 + .align 2, 0 +_0806583C: .4byte gUnknown_8106CE8 +_08065840: .4byte gUnknown_202EE10 +_08065844: .4byte gUnknown_80FE730 +_08065848: .4byte gUnknown_80FE764 +_0806584C: .4byte gUnknown_80FE788 +_08065850: .4byte gUnknown_80FE7A8 +_08065854: .4byte gUnknown_80FE7C0 +_08065858: .4byte gUnknown_80FE7E4 +_0806585C: .4byte gUnknown_202F2E8 +_08065860: + ldr r2, [sp, 0x4] + adds r2, 0xA + movs r0, 0x7 + str r0, [sp] + movs r0, 0 + movs r1, 0x50 + movs r3, 0x16 + bl sub_80078A4 +_08065872: + ldr r0, _08065890 + ldrb r0, [r0, 0x1] + cmp r0, 0 + beq _08065894 + ldr r2, [sp, 0x8] + adds r2, 0xA + movs r0, 0x7 + str r0, [sp] + movs r0, 0 + movs r1, 0x88 + movs r3, 0x16 + bl sub_80078A4 + b _080658A6 + .align 2, 0 +_08065890: .4byte gUnknown_202F2E8 +_08065894: + ldr r2, [sp, 0x8] + adds r2, 0xA + movs r0, 0x7 + str r0, [sp] + movs r0, 0 + movs r1, 0x50 + movs r3, 0x12 + bl sub_80078A4 +_080658A6: + ldr r0, _080658C4 + ldrb r0, [r0, 0x2] + cmp r0, 0 + beq _080658C8 + ldr r2, [sp, 0xC] + adds r2, 0xA + movs r0, 0x7 + str r0, [sp] + movs r0, 0 + movs r1, 0x88 + movs r3, 0x10 + bl sub_80078A4 + b _080658DA + .align 2, 0 +_080658C4: .4byte gUnknown_202F2E8 +_080658C8: + ldr r2, [sp, 0xC] + adds r2, 0xA + movs r0, 0x7 + str r0, [sp] + movs r0, 0 + movs r1, 0x50 + movs r3, 0xC + bl sub_80078A4 +_080658DA: + ldr r0, _080658F8 + ldrb r0, [r0, 0x3] + cmp r0, 0 + beq _080658FC + ldr r2, [sp, 0x10] + adds r2, 0xA + movs r0, 0x7 + str r0, [sp] + movs r0, 0 + movs r1, 0x88 + movs r3, 0xC + bl sub_80078A4 + b _0806590E + .align 2, 0 +_080658F8: .4byte gUnknown_202F2E8 +_080658FC: + ldr r2, [sp, 0x10] + adds r2, 0xA + movs r0, 0x7 + str r0, [sp] + movs r0, 0 + movs r1, 0x50 + movs r3, 0x10 + bl sub_80078A4 +_0806590E: + ldr r0, _08065944 + ldrb r1, [r0, 0x4] + lsls r0, r1, 2 + adds r1, r0, r1 + lsls r1, 3 + adds r1, 0x50 + ldr r2, [sp, 0x14] + adds r2, 0xA + adds r0, r4, r0 + ldr r3, [r0] + movs r0, 0x7 + str r0, [sp] + movs r0, 0 + bl sub_80078A4 + movs r0, 0 + bl sub_80073E0 + add sp, 0xDC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08065944: .4byte gUnknown_202F2E8 + thumb_func_end sub_80656C0 + + thumb_func_start sub_8065948 +sub_8065948: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xCC + add r0, sp, 0x64 + mov r10, r0 + movs r1, 0 + movs r2, 0x60 + bl memset + movs r0, 0x6 + str r0, [sp, 0x68] + add r0, sp, 0x6C + movs r4, 0 + movs r5, 0 + movs r1, 0x2 + mov r9, r1 + mov r2, r9 + strh r2, [r0] + strh r2, [r0, 0x2] + add r1, sp, 0x70 + movs r0, 0x12 + strh r0, [r1] + mov r0, sp + adds r0, 0x72 + movs r6, 0x10 + strh r6, [r0] + add r0, sp, 0x74 + strh r6, [r0] + add r3, sp, 0xC4 + mov r8, r3 + str r3, [sp, 0x78] + movs r1, 0x3 + str r1, [sp, 0x80] + add r0, sp, 0x94 + str r1, [r0, 0x4] + add r0, sp, 0xAC + str r1, [r0, 0x4] + add r0, sp, 0x4 + mov r1, r10 + movs r2, 0x60 + bl memcpy + mov r1, r10 + ldr r0, _08065A78 + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + movs r0, 0x1 + mov r7, r8 + strb r0, [r7] + strb r4, [r7, 0x1] + strb r4, [r7, 0x3] + ldr r4, _08065A7C + strh r0, [r4, 0x1A] + strh r0, [r4, 0x1C] + strh r5, [r4, 0x1E] + strh r5, [r4, 0x20] + strh r5, [r4, 0x4] + strh r6, [r4, 0x6] + strh r5, [r4, 0xC] + strh r5, [r4, 0xE] + strh r5, [r4, 0x14] + str r5, [r4] + adds r0, r4, 0 + adds r0, 0x28 + bl sub_801317C + add r1, sp, 0x4 + movs r0, 0x18 + strh r0, [r1, 0xC] + movs r0, 0x1 + movs r1, 0xC + bl sub_80095E4 + add r2, sp, 0x4 + adds r1, r2, 0 + adds r0, 0x2 + strh r0, [r1, 0x10] + strh r0, [r2, 0xE] + movs r0, 0xA + strb r0, [r7, 0x2] + adds r0, r1, 0 + mov r1, r9 + strh r1, [r0, 0x8] + movs r1, 0x1 + bl sub_803ECB4 + adds r0, r4, 0 + movs r1, 0 + bl sub_80137B0 + movs r4, 0 + mov r7, r10 + add r6, sp, 0xC8 + adds r5, r6, 0 +_08065A0A: + ldr r0, _08065A7C + adds r1, r4, 0 + bl sub_8013800 + stm r5!, {r0} + adds r4, 0x1 + cmp r4, 0 + ble _08065A0A + movs r0, 0 + bl sub_80073B8 + ldr r0, _08065A80 + ldr r2, [r0] + movs r4, 0 + str r4, [sp] + movs r0, 0x10 + movs r1, 0 + movs r3, 0 + bl sub_8014FF0 + ldr r1, [r6] + ldr r0, _08065A84 + ldr r2, [r0] + str r4, [sp] + movs r0, 0x8 + movs r3, 0 + bl sub_8014FF0 + ldr r0, _08065A88 + ldrb r1, [r0, 0x8] + lsls r3, r1, 2 + adds r1, r3, r1 + lsls r1, 3 + adds r1, 0x50 + add r0, sp, 0xC8 + ldr r2, [r0] + adds r2, 0xA + adds r3, r7, r3 + ldr r3, [r3] + movs r0, 0x7 + str r0, [sp] + movs r0, 0 + bl sub_80078A4 + movs r0, 0 + bl sub_80073E0 + add sp, 0xCC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08065A78: .4byte gUnknown_8106CF4 +_08065A7C: .4byte gUnknown_202EE10 +_08065A80: .4byte gUnknown_80FE73C +_08065A84: .4byte gUnknown_80FE808 +_08065A88: .4byte gUnknown_202F2E8 + thumb_func_end sub_8065948 + + thumb_func_start sub_8065A8C +sub_8065A8C: + push {lr} + cmp r0, 0x5 + bhi _08065B38 + lsls r0, 2 + ldr r1, _08065A9C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08065A9C: .4byte _08065AA0 + .align 2, 0 +_08065AA0: + .4byte _08065AB8 + .4byte _08065ACC + .4byte _08065AE0 + .4byte _08065AF4 + .4byte _08065B08 + .4byte _08065B22 +_08065AB8: + ldr r2, _08065AC8 + movs r1, 0 + ldrb r0, [r2] + cmp r0, 0 + bne _08065AC4 + movs r1, 0x1 +_08065AC4: + strb r1, [r2] + b _08065B38 + .align 2, 0 +_08065AC8: .4byte gUnknown_202F2E8 +_08065ACC: + ldr r2, _08065ADC + movs r1, 0 + ldrb r0, [r2, 0x1] + cmp r0, 0 + bne _08065AD8 + movs r1, 0x1 +_08065AD8: + strb r1, [r2, 0x1] + b _08065B38 + .align 2, 0 +_08065ADC: .4byte gUnknown_202F2E8 +_08065AE0: + ldr r2, _08065AF0 + movs r1, 0 + ldrb r0, [r2, 0x2] + cmp r0, 0 + bne _08065AEC + movs r1, 0x1 +_08065AEC: + strb r1, [r2, 0x2] + b _08065B38 + .align 2, 0 +_08065AF0: .4byte gUnknown_202F2E8 +_08065AF4: + ldr r2, _08065B04 + movs r1, 0 + ldrb r0, [r2, 0x3] + cmp r0, 0 + bne _08065B00 + movs r1, 0x1 +_08065B00: + strb r1, [r2, 0x3] + b _08065B38 + .align 2, 0 +_08065B04: .4byte gUnknown_202F2E8 +_08065B08: + ldr r1, _08065B18 + ldrb r0, [r1, 0x4] + cmp r0, 0 + bne _08065B1C + movs r0, 0x2 + strb r0, [r1, 0x4] + b _08065B38 + .align 2, 0 +_08065B18: .4byte gUnknown_202F2E8 +_08065B1C: + subs r0, 0x1 + strb r0, [r1, 0x4] + b _08065B38 +_08065B22: + ldr r1, _08065B30 + ldrb r0, [r1, 0x8] + cmp r0, 0 + bne _08065B34 + movs r0, 0x2 + b _08065B36 + .align 2, 0 +_08065B30: .4byte gUnknown_202F2E8 +_08065B34: + subs r0, 0x1 +_08065B36: + strb r0, [r1, 0x8] +_08065B38: + pop {r0} + bx r0 + thumb_func_end sub_8065A8C + + thumb_func_start sub_8065B3C +sub_8065B3C: + push {lr} + cmp r0, 0x5 + bhi _08065BE8 + lsls r0, 2 + ldr r1, _08065B4C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08065B4C: .4byte _08065B50 + .align 2, 0 +_08065B50: + .4byte _08065B68 + .4byte _08065B7C + .4byte _08065B90 + .4byte _08065BA4 + .4byte _08065BB8 + .4byte _08065BD2 +_08065B68: + ldr r2, _08065B78 + movs r1, 0 + ldrb r0, [r2] + cmp r0, 0 + bne _08065B74 + movs r1, 0x1 +_08065B74: + strb r1, [r2] + b _08065BE8 + .align 2, 0 +_08065B78: .4byte gUnknown_202F2E8 +_08065B7C: + ldr r2, _08065B8C + movs r1, 0 + ldrb r0, [r2, 0x1] + cmp r0, 0 + bne _08065B88 + movs r1, 0x1 +_08065B88: + strb r1, [r2, 0x1] + b _08065BE8 + .align 2, 0 +_08065B8C: .4byte gUnknown_202F2E8 +_08065B90: + ldr r2, _08065BA0 + movs r1, 0 + ldrb r0, [r2, 0x2] + cmp r0, 0 + bne _08065B9C + movs r1, 0x1 +_08065B9C: + strb r1, [r2, 0x2] + b _08065BE8 + .align 2, 0 +_08065BA0: .4byte gUnknown_202F2E8 +_08065BA4: + ldr r2, _08065BB4 + movs r1, 0 + ldrb r0, [r2, 0x3] + cmp r0, 0 + bne _08065BB0 + movs r1, 0x1 +_08065BB0: + strb r1, [r2, 0x3] + b _08065BE8 + .align 2, 0 +_08065BB4: .4byte gUnknown_202F2E8 +_08065BB8: + ldr r1, _08065BC8 + ldrb r0, [r1, 0x4] + cmp r0, 0x2 + bne _08065BCC + movs r0, 0 + strb r0, [r1, 0x4] + b _08065BE8 + .align 2, 0 +_08065BC8: .4byte gUnknown_202F2E8 +_08065BCC: + adds r0, 0x1 + strb r0, [r1, 0x4] + b _08065BE8 +_08065BD2: + ldr r1, _08065BE0 + ldrb r0, [r1, 0x8] + cmp r0, 0x2 + bne _08065BE4 + movs r0, 0 + b _08065BE6 + .align 2, 0 +_08065BE0: .4byte gUnknown_202F2E8 +_08065BE4: + adds r0, 0x1 +_08065BE6: + strb r0, [r1, 0x8] +_08065BE8: + pop {r0} + bx r0 + thumb_func_end sub_8065B3C + + thumb_func_start sub_8065BEC +sub_8065BEC: + movs r0, 0 + bx lr + thumb_func_end sub_8065BEC + + thumb_func_start sub_8065BF0 +sub_8065BF0: + movs r0, 0 + bx lr + thumb_func_end sub_8065BF0 + + thumb_func_start sub_8065BF4 +sub_8065BF4: + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r5, _08065C60 + ldr r6, _08065C64 + movs r0, 0x2A + adds r0, r5 + mov r8, r0 +_08065C04: + movs r7, 0 + bl sub_8065CAC +_08065C0A: + adds r0, r5, 0 + bl AddMenuCursorSprite + movs r0, 0x24 + bl sub_803E46C + ldrh r1, [r6, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08065C2E + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80136E0 +_08065C2E: + ldrh r1, [r6, 0x4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08065C46 + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_8013744 +_08065C46: + ldrh r1, [r6, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08065C5A + adds r0, r5, 0 + adds r0, 0x29 + ldrb r0, [r0] + cmp r0, 0 + beq _08065C68 +_08065C5A: + bl sub_8083D08 + b _08065C7E + .align 2, 0 +_08065C60: .4byte gUnknown_202EE10 +_08065C64: .4byte gUnknown_20255F0 +_08065C68: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08065C78 + mov r1, r8 + ldrb r0, [r1] + cmp r0, 0 + beq _08065C0A +_08065C78: + bl sub_8083D30 + movs r7, 0x1 +_08065C7E: + ldr r4, _08065C9C + adds r0, r4, 0 + bl AddMenuCursorSprite + movs r0, 0x24 + bl sub_803E46C + cmp r7, 0 + bne _08065CA0 + movs r1, 0x18 + ldrsh r0, [r4, r1] + bl sub_8065DBC + b _08065C04 + .align 2, 0 +_08065C9C: .4byte gUnknown_202EE10 +_08065CA0: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8065BF4 + + thumb_func_start sub_8065CAC +sub_8065CAC: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC8 + add r0, sp, 0x64 + mov r10, r0 + movs r1, 0 + movs r2, 0x60 + bl memset + movs r0, 0x6 + str r0, [sp, 0x68] + add r0, sp, 0x6C + movs r4, 0 + movs r5, 0 + movs r1, 0x2 + mov r9, r1 + mov r1, r9 + strh r1, [r0] + strh r1, [r0, 0x2] + add r0, sp, 0x70 + movs r7, 0xC + strh r7, [r0] + adds r0, 0x2 + movs r6, 0x10 + strh r6, [r0] + add r0, sp, 0x74 + strh r6, [r0] + add r0, sp, 0xC4 + mov r8, r0 + str r0, [sp, 0x78] + movs r1, 0x3 + str r1, [sp, 0x80] + add r0, sp, 0x94 + str r1, [r0, 0x4] + add r0, sp, 0xAC + str r1, [r0, 0x4] + add r0, sp, 0x4 + mov r1, r10 + movs r2, 0x60 + bl memcpy + movs r0, 0x1 + mov r1, r8 + strb r0, [r1] + strb r4, [r1, 0x1] + strb r4, [r1, 0x3] + ldr r4, _08065DB0 + strh r5, [r4, 0x18] + movs r0, 0x7 + strh r0, [r4, 0x1A] + strh r0, [r4, 0x1C] + strh r5, [r4, 0x1E] + strh r5, [r4, 0x20] + strh r5, [r4, 0x4] + strh r6, [r4, 0x6] + strh r5, [r4, 0xC] + strh r5, [r4, 0xE] + strh r5, [r4, 0x14] + str r5, [r4] + adds r0, r4, 0 + adds r0, 0x28 + bl sub_801317C + add r0, sp, 0x4 + strh r7, [r0, 0xC] + movs r0, 0x7 + movs r1, 0xC + bl sub_80095E4 + add r2, sp, 0x4 + adds r1, r2, 0 + adds r0, 0x2 + strh r0, [r1, 0x10] + strh r0, [r2, 0xE] + movs r0, 0xA + mov r1, r8 + strb r0, [r1, 0x2] + adds r0, r2, 0 + mov r1, r9 + strh r1, [r0, 0x8] + movs r1, 0x1 + bl sub_803ECB4 + adds r0, r4, 0 + movs r1, 0 + bl sub_80137B0 + movs r0, 0 + bl sub_80073B8 + ldr r0, _08065DB4 + ldr r2, [r0] + str r5, [sp] + movs r0, 0x10 + movs r1, 0 + movs r3, 0 + bl sub_8014FF0 + movs r4, 0 + ldr r5, _08065DB8 +_08065D7A: + ldr r0, _08065DB0 + adds r1, r4, 0 + bl sub_8013800 + adds r1, r0, 0 + ldm r5!, {r2} + movs r0, 0 + str r0, [sp] + movs r0, 0x8 + movs r3, 0 + bl sub_8014FF0 + adds r4, 0x1 + cmp r4, 0x6 + ble _08065D7A + movs r0, 0 + bl sub_80073E0 + add sp, 0xC8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08065DB0: .4byte gUnknown_202EE10 +_08065DB4: .4byte gUnknown_80FF770 +_08065DB8: .4byte gUnknown_80FF774 + thumb_func_end sub_8065CAC + + thumb_func_start sub_8065DBC +sub_8065DBC: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xEC + adds r6, r0, 0 + ldr r0, _08065F28 + ldr r0, [r0] + ldrb r1, [r0, 0x9] + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + str r0, [sp, 0xC8] + mov r0, sp + adds r0, 0x6C + str r0, [sp, 0xD4] + mov r1, sp + adds r1, 0x70 + str r1, [sp, 0xD8] + mov r2, sp + adds r2, 0x72 + str r2, [sp, 0xDC] + adds r0, 0x8 + str r0, [sp, 0xE0] + adds r1, 0xC + str r1, [sp, 0xE4] + adds r2, 0x22 + str r2, [sp, 0xE8] + adds r0, 0x38 + str r0, [sp, 0xD0] + subs r1, 0x18 + str r1, [sp, 0xCC] + movs r2, 0x10 + mov r10, r2 + ldr r5, _08065F2C + add r0, sp, 0xC4 + mov r9, r0 + add r1, sp, 0x4 + mov r8, r1 +_08065E0C: + movs r7, 0 + ldr r0, [sp, 0xCC] + movs r1, 0 + movs r2, 0x60 + bl memset + movs r0, 0x6 + str r0, [sp, 0x68] + movs r0, 0x2 + ldr r2, [sp, 0xD4] + strh r0, [r2] + strh r0, [r2, 0x2] + movs r0, 0xC + ldr r1, [sp, 0xD8] + strh r0, [r1] + mov r0, r10 + ldr r2, [sp, 0xDC] + strh r0, [r2] + ldr r1, [sp, 0xE0] + strh r0, [r1] + mov r2, r9 + str r2, [sp, 0x78] + movs r0, 0x3 + ldr r1, [sp, 0xE4] + str r0, [r1, 0x4] + ldr r2, [sp, 0xE8] + str r0, [r2, 0x4] + ldr r1, [sp, 0xD0] + str r0, [r1, 0x4] + add r0, sp, 0x4 + ldr r1, [sp, 0xCC] + movs r2, 0x60 + bl memcpy + movs r1, 0x7 + add r0, sp, 0xC4 + strb r1, [r0] + mov r2, r9 + strb r6, [r2, 0x1] + movs r0, 0 + strb r0, [r2, 0x3] + strh r6, [r5, 0x1E] + strh r1, [r5, 0x20] + strh r7, [r5, 0x1A] + strh r7, [r5, 0x18] + strh r7, [r5, 0x1C] + strh r7, [r5, 0x4] + mov r1, r10 + strh r1, [r5, 0x6] + strh r7, [r5, 0x14] + str r7, [r5] + adds r0, r5, 0 + adds r0, 0x28 + bl sub_801317C + movs r0, 0x18 + mov r2, r8 + strh r0, [r2, 0xC] + movs r0, 0x8 + movs r1, 0xC + bl sub_80095E4 + adds r0, 0x2 + mov r1, r8 + strh r0, [r1, 0x10] + strh r0, [r1, 0xE] + movs r0, 0xA + mov r2, r9 + strb r0, [r2, 0x2] + movs r0, 0x2 + strh r0, [r1, 0x8] + add r0, sp, 0x4 + movs r1, 0x1 + bl sub_803ECB4 + ldr r1, _08065F30 + movs r2, 0 + ldrsh r0, [r1, r2] + adds r0, 0x13 + lsls r0, 3 + strh r0, [r5, 0xC] + movs r2, 0x2 + ldrsh r0, [r1, r2] + adds r0, 0x1 + lsls r0, 3 + subs r0, 0x2 + strh r0, [r5, 0xE] + movs r0, 0 + bl sub_80073B8 + lsls r0, r6, 3 + adds r0, 0x10 + ldr r1, _08065F34 + lsls r4, r6, 2 + adds r1, r4, r1 + ldr r2, [r1] + str r7, [sp] + movs r1, 0 + movs r3, 0 + bl sub_8014FF0 + ldr r1, _08065F38 + ldr r2, [sp, 0xC8] + lsls r0, r2, 5 + adds r4, r0 + adds r4, r1 + ldr r2, [r4] + str r7, [sp] + movs r0, 0x8 + movs r1, 0x10 + movs r3, 0 + bl sub_8014FF0 + movs r0, 0 + bl sub_80073E0 +_08065EF4: + adds r0, r5, 0 + bl AddMenuCursorSprite + movs r0, 0x24 + bl sub_803E46C + ldr r0, _08065F3C + ldrh r1, [r0, 0x2] + mov r0, r10 + ands r0, r1 + cmp r0, 0 + bne _08065F16 + adds r0, r5, 0 + adds r0, 0x2B + ldrb r0, [r0] + cmp r0, 0 + beq _08065F40 +_08065F16: + movs r0, 0 + bl sub_8083CE0 + adds r6, 0x1 + cmp r6, 0x7 + bne _08065F64 + movs r6, 0 + b _08065F64 + .align 2, 0 +_08065F28: .4byte gUnknown_203B46C +_08065F2C: .4byte gUnknown_202EE10 +_08065F30: .4byte gUnknown_2027370 +_08065F34: .4byte gUnknown_80FF774 +_08065F38: .4byte gUnknown_80FF7EC +_08065F3C: .4byte gUnknown_20255F0 +_08065F40: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _08065F52 + adds r0, r5, 0 + adds r0, 0x2C + ldrb r0, [r0] + cmp r0, 0 + beq _08065F68 +_08065F52: + movs r0, 0 + bl sub_8083CE0 + subs r6, 0x1 + movs r0, 0x1 + negs r0, r0 + cmp r6, r0 + bne _08065F64 + movs r6, 0x6 +_08065F64: + movs r7, 0x1 + b _08065F94 +_08065F68: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08065F7A + adds r0, r5, 0 + adds r0, 0x29 + ldrb r0, [r0] + cmp r0, 0 + beq _08065F80 +_08065F7A: + bl sub_8083D08 + b _08065F94 +_08065F80: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08065F90 + ldr r1, _08065FB0 + ldrb r0, [r1] + cmp r0, 0 + beq _08065EF4 +_08065F90: + bl sub_8083D30 +_08065F94: + movs r0, 0x24 + bl sub_803E46C + cmp r7, 0 + beq _08065FA0 + b _08065E0C +_08065FA0: + add sp, 0xEC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08065FB0: .4byte gUnknown_202EE3A + thumb_func_end sub_8065DBC + + thumb_func_start sub_8065FB4 +sub_8065FB4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, _08065FE0 + add sp, r4 + movs r0, 0 + mov r10, r0 + ldr r4, _08065FE4 + ldr r0, [r4] + ldr r1, _08065FE8 + adds r0, r1 + ldrb r0, [r0] + bl sub_8090148 + lsls r0, 24 + cmp r0, 0 + bne _08065FF0 + ldr r0, _08065FEC + b _08065FFE + .align 2, 0 +_08065FE0: .4byte 0xfffff608 +_08065FE4: .4byte gUnknown_203B418 +_08065FE8: .4byte 0x00000644 +_08065FEC: .4byte gUnknown_80FA5F4 +_08065FF0: + ldr r0, [r4] + ldr r2, _0806600C + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _08066014 + ldr r0, _08066010 +_08065FFE: + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 + b _08066194 + .align 2, 0 +_0806600C: .4byte 0x0000065d +_08066010: .4byte gUnknown_80FA61C +_08066014: + mov r0, sp + bl sub_80664FC + ldr r6, _08066130 +_0806601C: + movs r0, 0 + mov r8, r0 + mov r1, r10 + lsls r0, r1, 2 + add r0, r10 + lsls r0, 6 + subs r0, r1 + lsls r0, 2 + add r0, sp + mov r9, r0 + ldr r0, _08066134 + strb r1, [r0, 0x1] + ldr r0, _08066138 + movs r1, 0x1 + bl sub_803ECB4 + mov r2, r8 + strh r2, [r6, 0x1A] + strh r2, [r6, 0x18] + strh r2, [r6, 0x1C] + mov r0, r10 + strh r0, [r6, 0x1E] + movs r0, 0x2 + strh r0, [r6, 0x20] + strh r2, [r6, 0x4] + movs r0, 0x10 + strh r0, [r6, 0x6] + strh r2, [r6, 0x14] + mov r1, r8 + str r1, [r6] + adds r0, r6, 0 + adds r0, 0x28 + bl sub_801317C + ldr r0, _0806613C + mov r2, r8 + str r2, [r0] + movs r1, 0 + ldr r0, _08066140 + strb r1, [r0] + mov r0, r9 + mov r1, r10 + bl sub_80661AC + ldr r1, _08066144 + movs r2, 0 + ldrsh r0, [r1, r2] + adds r0, 0x10 + lsls r0, 3 + strh r0, [r6, 0xC] + movs r2, 0x2 + ldrsh r0, [r1, r2] + adds r0, 0x1 + lsls r0, 3 + subs r0, 0x2 + strh r0, [r6, 0xE] +_0806608C: + movs r5, 0 + ldr r0, _08066140 + strb r5, [r0] + movs r0, 0 + ldr r1, _08066148 + bl sub_8014140 + adds r4, r0, 0 + mov r0, r9 + adds r1, r4, 0 + bl sub_8066288 + lsls r0, 24 + lsrs r0, 24 + negs r1, r0 + orrs r1, r0 + lsrs r5, r1, 31 + mov r0, r9 + adds r1, r4, 0 + bl sub_8066358 + lsls r0, 24 + cmp r0, 0 + beq _080660BE + movs r5, 0x1 +_080660BE: + cmp r5, 0 + bne _080660CE + ldr r0, _08066130 + bl AddMenuCursorSprite + movs r0, 0x45 + bl sub_803E46C +_080660CE: + ldr r2, _08066140 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080660E2 + movs r0, 0x1 + movs r1, 0x8 + bl sub_8066434 +_080660E2: + ldr r0, _08066140 + ldrb r1, [r0] + movs r7, 0x2 + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _080660F8 + movs r0, 0 + movs r1, 0x70 + bl sub_8066434 +_080660F8: + ldr r5, _0806614C + ldrh r1, [r5, 0x2] + movs r0, 0x30 + ands r0, r1 + cmp r0, 0 + bne _0806611A + ldr r4, _08066130 + adds r0, r4, 0 + adds r0, 0x2C + ldrb r0, [r0] + cmp r0, 0 + bne _0806611A + adds r0, r4, 0 + adds r0, 0x2B + ldrb r0, [r0] + cmp r0, 0 + beq _08066150 +_0806611A: + movs r0, 0 + bl sub_8083CE0 + movs r0, 0 + mov r1, r10 + cmp r1, 0 + bne _0806612A + movs r0, 0x1 +_0806612A: + mov r10, r0 + b _08066184 + .align 2, 0 +_08066130: .4byte gUnknown_202EE10 +_08066134: .4byte gUnknown_203B43C +_08066138: .4byte gUnknown_8106D08 +_0806613C: .4byte gUnknown_202F2F8 +_08066140: .4byte gUnknown_202F2FC +_08066144: .4byte gUnknown_2027370 +_08066148: .4byte gUnknown_8106D68 +_0806614C: .4byte gUnknown_20255F0 +_08066150: + bl sub_80048C8 + lsls r0, 24 + cmp r0, 0 + bne _0806608C + ldrh r1, [r5, 0x2] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + bne _0806616E + adds r0, r4, 0 + adds r0, 0x2A + ldrb r0, [r0] + cmp r0, 0 + beq _08066174 +_0806616E: + bl sub_8083D30 + b _0806618C +_08066174: + movs r0, 0xC + ands r0, r1 + cmp r0, 0 + beq _0806608C + bl sub_8083D08 + movs r2, 0x1 + mov r8, r2 +_08066184: + mov r0, r8 + cmp r0, 0 + bne _0806618C + b _0806601C +_0806618C: + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 +_08066194: + ldr r3, _080661A8 + add sp, r3 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080661A8: .4byte 0x000009f8 + thumb_func_end sub_8065FB4 + + thumb_func_start sub_80661AC +sub_80661AC: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x44 + adds r6, r0, 0 + adds r5, r1, 0 + ldr r0, _080661DC + ldr r4, [r0] + movs r0, 0x20 + mov r8, r0 + movs r0, 0 + bl sub_80073B8 + cmp r5, 0 + bne _080661E4 + ldr r0, _080661E0 + ldr r2, [r0] + str r5, [sp] + movs r0, 0xC + movs r1, 0 + movs r3, 0 + bl xxx_call_draw_string + b _080661F6 + .align 2, 0 +_080661DC: .4byte gUnknown_202F2F8 +_080661E0: .4byte gUnknown_80FEA68 +_080661E4: + ldr r0, _08066254 + ldr r2, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0x14 + movs r1, 0 + movs r3, 0 + bl xxx_call_draw_string +_080661F6: + movs r1, 0x9F + lsls r1, 3 + adds r0, r6, r1 + ldr r1, [r0] + cmp r1, 0 + beq _08066260 + movs r7, 0x7 + lsls r0, r4, 1 + adds r5, r0, r6 +_08066208: + cmp r4, 0 + blt _08066244 + movs r1, 0x9F + lsls r1, 3 + adds r0, r6, r1 + ldr r0, [r0] + cmp r4, r0 + bge _08066244 + movs r1, 0xD4 + lsls r1, 2 + adds r0, r6, r1 + adds r0, r4 + ldrb r2, [r0] + add r0, sp, 0x4 + ldr r1, _08066258 + bl sub_800D158 + movs r0, 0 + ldrsh r1, [r5, r0] + ldr r0, _0806625C + bl sub_808D930 + movs r0, 0 + str r0, [sp] + movs r0, 0x8 + mov r1, r8 + add r2, sp, 0x4 + movs r3, 0 + bl sub_8014FF0 +_08066244: + subs r7, 0x1 + adds r5, 0x2 + adds r4, 0x1 + movs r1, 0xC + add r8, r1 + cmp r7, 0 + bge _08066208 + b _08066270 + .align 2, 0 +_08066254: .4byte gUnknown_80FEA80 +_08066258: .4byte gUnknown_8106D8C +_0806625C: .4byte gUnknown_202DF98 +_08066260: + ldr r0, _08066284 + ldr r2, [r0] + str r1, [sp] + movs r0, 0x8 + mov r1, r8 + movs r3, 0 + bl xxx_call_draw_string +_08066270: + movs r0, 0 + bl sub_80073E0 + add sp, 0x44 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08066284: .4byte gUnknown_80FEA8C + thumb_func_end sub_80661AC + + thumb_func_start sub_8066288 +sub_8066288: + push {r4,r5,lr} + sub sp, 0x44 + adds r5, r0, 0 + adds r3, r1, 0 + ldr r0, _080662B8 + ldr r4, [r0] + cmp r4, 0 + beq _080662B4 + subs r4, 0x1 + ldr r2, _080662BC + ldrb r0, [r2] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r2] + ldr r0, _080662C0 + ldrh r1, [r0, 0x4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _080662C4 + cmp r3, 0x1 + beq _080662C4 +_080662B4: + movs r0, 0 + b _0806633E + .align 2, 0 +_080662B8: .4byte gUnknown_202F2F8 +_080662BC: .4byte gUnknown_202F2FC +_080662C0: .4byte gUnknown_20255F0 +_080662C4: + movs r0, 0 + bl sub_8083CE0 + movs r0, 0 + bl sub_80073B8 + movs r0, 0x10 + str r0, [sp] + movs r0, 0 + movs r1, 0 + movs r2, 0x10 + movs r3, 0x90 + bl sub_80087EC + ldr r1, _08066348 + movs r2, 0xD4 + lsls r2, 2 + adds r0, r5, r2 + adds r0, r4 + ldrb r2, [r0] + add r0, sp, 0x4 + bl sub_800D158 + ldr r0, _0806634C + lsls r1, r4, 1 + adds r1, r5, r1 + movs r2, 0 + ldrsh r1, [r1, r2] + bl sub_808D930 + movs r0, 0 + str r0, [sp] + movs r0, 0x8 + movs r1, 0x14 + add r2, sp, 0x4 + movs r3, 0 + bl sub_8014FF0 + movs r0, 0 + bl sub_80073E0 + movs r0, 0x45 + bl sub_803E46C + ldr r5, _08066350 + movs r4, 0x5 +_08066320: + ldr r1, [r5] + movs r0, 0 + bl _call_via_r1 + movs r0, 0x45 + bl sub_803E46C + subs r4, 0x1 + cmp r4, 0 + bge _08066320 + ldr r1, _08066354 + ldr r0, [r1] + subs r0, 0x1 + str r0, [r1] + movs r0, 0x1 +_0806633E: + add sp, 0x44 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08066348: .4byte gUnknown_8106D8C +_0806634C: .4byte gUnknown_202DF98 +_08066350: .4byte gUnknown_203B084 +_08066354: .4byte gUnknown_202F2F8 + thumb_func_end sub_8066288 + + thumb_func_start sub_8066358 +sub_8066358: + push {r4-r6,lr} + sub sp, 0x44 + adds r5, r0, 0 + adds r3, r1, 0 + ldr r0, _08066394 + ldr r0, [r0] + adds r4, r0, 0 + adds r4, 0x8 + movs r6, 0x80 + movs r1, 0x9F + lsls r1, 3 + adds r0, r5, r1 + ldr r0, [r0] + cmp r0, r4 + ble _08066390 + ldr r2, _08066398 + ldrb r0, [r2] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r2] + ldr r0, _0806639C + ldrh r1, [r0, 0x4] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _080663A0 + cmp r3, 0x2 + beq _080663A0 +_08066390: + movs r0, 0 + b _0806641A + .align 2, 0 +_08066394: .4byte gUnknown_202F2F8 +_08066398: .4byte gUnknown_202F2FC +_0806639C: .4byte gUnknown_20255F0 +_080663A0: + movs r0, 0 + bl sub_8083CE0 + movs r0, 0 + bl sub_80073B8 + movs r0, 0x10 + str r0, [sp] + movs r0, 0 + movs r1, 0 + adds r2, r6, 0 + movs r3, 0x48 + bl sub_80087EC + ldr r1, _08066424 + movs r2, 0xD4 + lsls r2, 2 + adds r0, r5, r2 + adds r0, r4 + ldrb r2, [r0] + add r0, sp, 0x4 + bl sub_800D158 + ldr r0, _08066428 + lsls r1, r4, 1 + adds r1, r5, r1 + movs r2, 0 + ldrsh r1, [r1, r2] + bl sub_808D930 + movs r0, 0 + str r0, [sp] + movs r0, 0x8 + adds r1, r6, 0 + add r2, sp, 0x4 + movs r3, 0 + bl sub_8014FF0 + movs r0, 0 + bl sub_80073E0 + movs r0, 0xD + bl sub_803E46C + ldr r5, _0806642C + movs r4, 0x5 +_080663FC: + ldr r1, [r5] + movs r0, 0 + bl _call_via_r1 + movs r0, 0xD + bl sub_803E46C + subs r4, 0x1 + cmp r4, 0 + bge _080663FC + ldr r1, _08066430 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + movs r0, 0x1 +_0806641A: + add sp, 0x44 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08066424: .4byte gUnknown_8106D8C +_08066428: .4byte gUnknown_202DF98 +_0806642C: .4byte gUnknown_203B080 +_08066430: .4byte gUnknown_202F2F8 + thumb_func_end sub_8066358 + + thumb_func_start sub_8066434 +sub_8066434: + push {r4-r7,lr} + mov r12, r1 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r7, _080664C8 + ldr r0, _080664CC + ldr r0, [r0] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + bne _080664C0 + ldr r0, _080664D0 + ldrh r1, [r0] + ldr r3, _080664D4 + ands r3, r1 + ldr r1, _080664D8 + ands r3, r1 + ldr r1, _080664DC + ands r3, r1 + ldr r1, _080664E0 + ands r3, r1 + ldr r1, _080664E4 + ands r3, r1 + negs r1, r2 + orrs r1, r2 + asrs r1, 31 + movs r2, 0x80 + lsls r2, 6 + ands r2, r1 + ldrh r1, [r0, 0x2] + ldr r4, _080664E8 + ands r4, r1 + orrs r4, r2 + movs r5, 0xF + ldr r2, _080664EC + movs r6, 0x2 + ldrsh r1, [r7, r6] + lsls r1, 3 + add r1, r12 + ands r1, r2 + lsls r1, 4 + ldrh r2, [r0, 0x6] + ands r5, r2 + orrs r5, r1 + strh r5, [r0, 0x6] + movs r2, 0 + ldrsh r1, [r7, r2] + lsls r1, 3 + adds r1, 0x40 + ldr r2, _080664F0 + ands r1, r2 + movs r2, 0xFE + lsls r2, 8 + ands r4, r2 + orrs r4, r1 + movs r2, 0x80 + lsls r2, 7 + ldr r1, _080664F4 + ands r3, r1 + orrs r3, r2 + strh r3, [r0] + ands r4, r1 + strh r4, [r0, 0x2] + ldr r1, _080664F8 + strh r1, [r0, 0x4] + movs r1, 0x7F + movs r2, 0 + movs r3, 0 + bl AddSprite +_080664C0: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080664C8: .4byte gUnknown_2027370 +_080664CC: .4byte gUnknown_202EDCC +_080664D0: .4byte gUnknown_202F300 +_080664D4: .4byte 0x0000feff +_080664D8: .4byte 0x0000fdff +_080664DC: .4byte 0x0000f3ff +_080664E0: .4byte 0x0000efff +_080664E4: .4byte 0x0000dfff +_080664E8: .4byte 0x0000c1ff +_080664EC: .4byte 0x00000fff +_080664F0: .4byte 0x000001ff +_080664F4: .4byte 0x00003fff +_080664F8: .4byte 0x0000f3f0 + thumb_func_end sub_8066434 + + thumb_func_start sub_80664FC +sub_80664FC: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C0 + str r0, [sp, 0x1A8] + movs r7, 0 + ldr r2, _08066604 + ldr r3, _08066608 + movs r1, 0 +_08066512: + mov r4, sp + adds r0, r4, r7 + strb r1, [r0] + adds r7, 0x1 + cmp r7, r2 + ble _08066512 + movs r4, 0 + adds r1, r3, 0 + ldr r0, [r3] + ldr r7, _0806660C + adds r0, r7 + ldr r0, [r0] + cmp r4, r0 + bge _08066578 + ldr r6, _08066610 +_08066530: + movs r5, 0x1 + ldr r2, [r1] + lsls r0, r4, 3 + adds r0, r2, r0 + ldr r7, _08066614 + adds r1, r0, r7 + movs r7, 0 + ldrsh r1, [r1, r7] + movs r7, 0xD1 + lsls r7, 6 + adds r0, r7 + movs r7, 0 + ldrsh r0, [r0, r7] + cmp r1, 0 + bne _08066554 + cmp r0, 0 + beq _08066566 + movs r5, 0x2 +_08066554: + adds r0, r2, r6 + str r3, [sp, 0x1BC] + bl sub_808E9B8 + lsls r0, 16 + asrs r0, 16 + add r0, sp + strb r5, [r0] + ldr r3, [sp, 0x1BC] +_08066566: + adds r6, 0x8 + adds r4, 0x1 + ldr r1, _08066608 + ldr r0, [r1] + ldr r2, _0806660C + adds r0, r2 + ldr r0, [r0] + cmp r4, r0 + blt _08066530 +_08066578: + ldr r0, [r3] + ldr r4, _08066618 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _0806658A + add r1, sp, 0x17C + movs r0, 0x1 + strb r0, [r1] +_0806658A: + movs r0, 0x5 +_0806658C: + subs r0, 0x1 + cmp r0, 0 + bge _0806658C + movs r7, 0 +_08066594: + movs r0, 0 + mov r8, r0 + movs r1, 0x1 + adds r2, r7, 0x1 + str r2, [sp, 0x1AC] + lsls r4, r7, 2 + str r4, [sp, 0x1B0] +_080665A2: + lsls r0, r1, 16 + asrs r6, r0, 16 + movs r0, 0x7 + mov r10, r0 + movs r2, 0 + mov r9, r2 + mov r4, sp + adds r0, r4, r6 + ldrb r0, [r0] + adds r1, 0x1 + str r1, [sp, 0x1B4] + cmp r0, 0 + bne _080665BE + b _08066704 +_080665BE: + cmp r7, 0 + bne _08066620 + adds r0, r6, 0 + bl sub_806F9BC + lsls r0, 24 + cmp r0, 0 + bne _080665D0 + b _08066704 +_080665D0: + adds r0, r6, 0 + bl sub_80981DC + lsls r0, 24 + cmp r0, 0 + bne _080665DE + b _08066704 +_080665DE: + adds r0, r6, 0 + bl sub_808DCC0 + lsls r0, 16 + ldr r1, _0806661C + cmp r0, r1 + bne _080665EE + b _08066704 +_080665EE: + cmp r6, 0x97 + bne _0806669E + movs r0, 0x7A + bl sub_80860A8 + lsls r0, 24 + cmp r0, 0 + bne _08066600 + b _08066704 +_08066600: + b _0806669E + .align 2, 0 +_08066604: .4byte 0x000001a7 +_08066608: .4byte gUnknown_203B418 +_0806660C: .4byte 0x000037e4 +_08066610: .4byte 0x0000343c +_08066614: .4byte 0x0000343e +_08066618: .4byte 0x0000066e +_0806661C: .4byte 0xfc190000 +_08066620: + movs r5, 0 + ldr r0, _080666CC + ldr r2, [r0] + movs r4, 0x1 + movs r3, 0xCE + lsls r3, 1 +_0806662C: + ldrb r1, [r2] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _0806663E + movs r1, 0x8 + ldrsh r0, [r2, r1] + cmp r0, r6 + beq _08066646 +_0806663E: + adds r2, 0x58 + adds r5, 0x1 + cmp r5, r3 + ble _0806662C +_08066646: + ldr r0, _080666D0 + cmp r5, r0 + beq _08066650 + movs r2, 0x1 + mov r9, r2 +_08066650: + mov r4, r9 + cmp r4, 0 + bne _0806669E + movs r5, 0 + ldr r2, _080666CC +_0806665A: + movs r0, 0x64 + adds r1, r5, 0 + muls r1, r0 + ldr r0, _080666D4 + adds r1, r0 + ldr r0, [r2] + adds r4, r0, r1 + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0806668C + movs r1, 0xA + ldrsh r0, [r4, r1] + str r2, [sp, 0x1B8] + bl sub_806A564 + lsls r0, 24 + ldr r2, [sp, 0x1B8] + cmp r0, 0 + bne _0806668C + movs r1, 0xE + ldrsh r0, [r4, r1] + cmp r0, r6 + beq _08066692 +_0806668C: + adds r5, 0x1 + cmp r5, 0x3 + ble _0806665A +_08066692: + cmp r5, 0x4 + beq _0806669E + movs r2, 0x1 + mov r9, r2 + movs r4, 0x6 + mov r10, r4 +_0806669E: + cmp r7, 0 + bne _080666D8 + mov r1, sp + adds r0, r1, r6 + ldrb r0, [r0] + cmp r0, 0x2 + bne _080666B0 + movs r2, 0x2 + mov r10, r2 +_080666B0: + mov r4, r8 + lsls r0, r4, 1 + ldr r1, [sp, 0x1A8] + adds r0, r1, r0 + strh r6, [r0] + movs r2, 0xD4 + lsls r2, 2 + adds r0, r1, r2 + add r0, r8 + mov r4, r10 + strb r4, [r0] + movs r0, 0x1 + add r8, r0 + b _08066704 + .align 2, 0 +_080666CC: .4byte gUnknown_203B45C +_080666D0: .4byte 0x0000019d +_080666D4: .4byte 0x00008df8 +_080666D8: + mov r1, r9 + cmp r1, 0 + beq _08066704 + ldr r2, [sp, 0x1B0] + adds r0, r2, r7 + lsls r0, 6 + subs r0, r7 + lsls r0, 2 + ldr r4, [sp, 0x1A8] + adds r0, r4 + mov r2, r8 + lsls r1, r2, 1 + adds r1, r0, r1 + strh r6, [r1] + movs r4, 0xD4 + lsls r4, 2 + adds r0, r4 + add r0, r8 + mov r1, r10 + strb r1, [r0] + movs r2, 0x1 + add r8, r2 +_08066704: + ldr r1, [sp, 0x1B4] + ldr r0, _08066740 + cmp r1, r0 + bgt _0806670E + b _080665A2 +_0806670E: + ldr r4, [sp, 0x1B0] + adds r0, r4, r7 + lsls r0, 6 + subs r0, r7 + lsls r0, 2 + ldr r7, [sp, 0x1A8] + adds r0, r7 + movs r1, 0x9F + lsls r1, 3 + adds r0, r1 + mov r2, r8 + str r2, [r0] + ldr r7, [sp, 0x1AC] + cmp r7, 0x1 + bgt _0806672E + b _08066594 +_0806672E: + add sp, 0x1C0 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08066740: .4byte 0x000001a3 + thumb_func_end sub_80664FC + + thumb_func_start sub_8066744 +sub_8066744: + push {lr} + ldr r1, [r0, 0x70] + adds r1, 0x48 + movs r2, 0x1 + strb r2, [r1] + adds r0, 0x4 + movs r1, 0 + bl sub_8045DB4 + pop {r0} + bx r0 + thumb_func_end sub_8066744 + + thumb_func_start sub_806675C +sub_806675C: + push {r4-r7,lr} + adds r5, r0, 0 + lsls r1, 24 + lsrs r7, r1, 24 + movs r1, 0 + movs r2, 0xFE + bl sub_8044D90 + adds r4, r0, 0 + movs r3, 0 + ldr r6, _080667C0 +_08066772: + lsls r1, r3, 2 + ldr r0, [r6] + adds r1, r0, r1 + ldrb r2, [r1] + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _08066798 + movs r0, 0x10 + ands r0, r2 + cmp r0, 0 + beq _08066798 + movs r0, 0x8 + ands r0, r2 + cmp r0, 0 + bne _080667EC + movs r0, 0xEF + ands r0, r2 + strb r0, [r1] +_08066798: + adds r3, 0x1 + cmp r3, 0x13 + ble _08066772 + ldr r0, _080667C4 + adds r1, r4, 0 + bl sub_8045BF8 + ldr r0, _080667C8 + bl sub_8083E38 + cmp r7, 0 + beq _08066812 + ldrb r1, [r4] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080667D0 + ldr r0, _080667CC + b _080667DE + .align 2, 0 +_080667C0: .4byte gUnknown_203B460 +_080667C4: .4byte gUnknown_202DE58 +_080667C8: .4byte 0x00000133 +_080667CC: .4byte gUnknown_80F8D04 +_080667D0: + ldrb r0, [r4, 0x2] + bl sub_8090BD0 + lsls r0, 24 + cmp r0, 0 + bne _08066808 + ldr r0, _080667E8 +_080667DE: + ldr r1, [r0] + adds r0, r5, 0 + bl sub_80522A8 + b _08066812 + .align 2, 0 +_080667E8: .4byte gUnknown_80F8CE4 +_080667EC: + ldr r0, _08066800 + bl sub_8045BF8 + ldr r0, _08066804 + ldr r1, [r0] + adds r0, r5, 0 + bl sub_80522A8 + b _08066838 + .align 2, 0 +_08066800: .4byte gUnknown_202DE58 +_08066804: .4byte gUnknown_80F8C7C +_08066808: + ldr r0, _08066840 + ldr r1, [r0] + adds r0, r5, 0 + bl sub_80522A8 +_08066812: + ldrb r0, [r4] + movs r1, 0x10 + orrs r1, r0 + strb r1, [r4] + movs r0, 0x8 + ands r1, r0 + cmp r1, 0 + beq _08066838 + cmp r7, 0 + beq _08066838 + ldr r0, _08066844 + adds r1, r4, 0 + bl sub_8045BF8 + ldr r0, _08066848 + ldr r1, [r0] + adds r0, r5, 0 + bl sub_80522A8 +_08066838: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08066840: .4byte gUnknown_80F8CE8 +_08066844: .4byte gUnknown_202DE58 +_08066848: .4byte gUnknown_80F8BE0 + thumb_func_end sub_806675C + + thumb_func_start sub_806684C +sub_806684C: + push {r4-r6,lr} + adds r5, r0, 0 + lsls r1, 24 + lsrs r6, r1, 24 + movs r4, 0 +_08066856: + ldr r0, _0806688C + lsls r1, r4, 2 + ldr r0, [r0] + adds r1, r0, r1 + ldrb r2, [r1] + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _080668B8 + movs r0, 0x10 + ands r0, r2 + cmp r0, 0 + beq _080668B8 + movs r0, 0x8 + ands r0, r2 + cmp r0, 0 + beq _08066898 + ldr r0, _08066890 + bl sub_8045BF8 + ldr r0, _08066894 + ldr r1, [r0] + adds r0, r5, 0 + bl sub_80522A8 + b _080668BE + .align 2, 0 +_0806688C: .4byte gUnknown_203B460 +_08066890: .4byte gUnknown_202DE58 +_08066894: .4byte gUnknown_80F8C7C +_08066898: + movs r0, 0xEF + ands r0, r2 + strb r0, [r1] + ldr r0, _080668C4 + bl sub_8045BF8 + ldr r0, _080668C8 + bl sub_8083E38 + cmp r6, 0 + beq _080668B8 + ldr r0, _080668CC + ldr r1, [r0] + adds r0, r5, 0 + bl sub_80522A8 +_080668B8: + adds r4, 0x1 + cmp r4, 0x13 + ble _08066856 +_080668BE: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080668C4: .4byte gUnknown_202DE58 +_080668C8: .4byte 0x00000133 +_080668CC: .4byte gUnknown_80F8D20 + thumb_func_end sub_806684C + + thumb_func_start sub_80668D0 +sub_80668D0: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + adds r6, r0, 0 + movs r1, 0x1 + bl sub_8044DA4 + mov r8, r0 + ldr r4, [r6, 0x70] + ldr r7, [r0, 0x70] + adds r0, r6, 0 + movs r1, 0 + movs r2, 0x2 + bl sub_8044D90 + adds r5, r0, 0 + adds r4, 0x48 + ldrb r0, [r4] + movs r1, 0 + mov r9, r1 + cmp r0, 0x80 + bne _08066904 + movs r2, 0x1 + mov r9, r2 +_08066904: + mov r0, r9 + cmp r0, 0 + bne _08066928 + ldrb r1, [r5] + movs r0, 0x18 + ands r0, r1 + cmp r0, 0x18 + bne _08066928 + ldr r0, _08066920 + adds r1, r5, 0 + bl sub_8045BF8 + ldr r0, _08066924 + b _08066950 + .align 2, 0 +_08066920: .4byte gUnknown_202DEA8 +_08066924: .4byte gUnknown_80F8C44 +_08066928: + ldr r0, _0806695C + mov r1, r8 + movs r2, 0 + bl sub_8045B94 + adds r1, r7, 0 + adds r1, 0x60 + ldrb r2, [r1] + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _08066A04 + movs r0, 0x8 + ands r0, r2 + cmp r0, 0 + beq _08066968 + ldr r0, _08066960 + bl sub_8045BF8 + ldr r0, _08066964 +_08066950: + ldr r1, [r0] + adds r0, r6, 0 + bl sub_80522A8 + b _08066A96 + .align 2, 0 +_0806695C: .4byte gUnknown_202DFE8 +_08066960: .4byte gUnknown_202DEA8 +_08066964: .4byte gUnknown_80F8C40 +_08066968: + ldr r1, [r7, 0x60] + str r1, [sp] + ldr r2, [r5] + str r2, [sp, 0x4] + movs r4, 0xEF + mov r0, sp + ldrb r0, [r0] + ands r0, r4 + ldr r3, _080669A8 + ands r1, r3 + orrs r1, r0 + str r1, [sp] + add r5, sp, 0x4 + ldrb r0, [r5] + ands r0, r4 + ands r2, r3 + orrs r2, r0 + str r2, [sp, 0x4] + adds r0, r6, 0 + movs r1, 0 + movs r2, 0x64 + bl sub_8044DF0 + mov r1, r9 + cmp r1, 0 + beq _080669AC + adds r0, r6, 0x4 + mov r1, sp + movs r2, 0x1 + bl sub_80460F8 + b _080669B2 + .align 2, 0 +_080669A8: .4byte 0xffffff00 +_080669AC: + mov r0, sp + bl sub_8091290 +_080669B2: + ldr r0, [sp, 0x4] + str r0, [r7, 0x60] + ldr r4, _080669F4 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8045BF8 + adds r4, 0x50 + adds r0, r4, 0 + mov r1, sp + bl sub_8045BF8 + ldr r0, _080669F8 + bl sub_8083E38 + ldr r0, _080669FC + ldr r1, [r0] + adds r0, r6, 0 + bl sub_80522A8 + add r0, sp, 0x4 + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08066A52 + ldr r0, _08066A00 + ldr r1, [r0] + adds r0, r6, 0 + bl sub_80522A8 + b _08066A52 + .align 2, 0 +_080669F4: .4byte gUnknown_202DE58 +_080669F8: .4byte 0x0000014d +_080669FC: .4byte gUnknown_80F8CA8 +_08066A00: .4byte gUnknown_80F8BE0 +_08066A04: + ldr r2, [r5] + str r2, [sp, 0x8] + movs r1, 0xEF + add r4, sp, 0x8 + ldrb r0, [r4] + ands r0, r1 + ldr r1, _08066AA4 + ands r2, r1 + orrs r2, r0 + str r2, [sp, 0x8] + adds r0, r6, 0 + movs r1, 0 + movs r2, 0x65 + bl sub_8044DF0 + ldr r0, [sp, 0x8] + str r0, [r7, 0x60] + ldr r0, _08066AA8 + adds r1, r4, 0 + bl sub_8045BF8 + ldr r0, _08066AAC + bl sub_8083E38 + ldr r0, _08066AB0 + ldr r1, [r0] + adds r0, r6, 0 + bl sub_80522A8 + ldrb r1, [r4] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08066A52 + ldr r0, _08066AB4 + ldr r1, [r0] + adds r0, r6, 0 + bl sub_80522A8 +_08066A52: + mov r0, r8 + bl sub_806A6E8 + mov r1, r8 + adds r1, 0x4 + mov r0, r8 + bl sub_80706A4 + lsls r0, 24 + cmp r0, 0 + beq _08066A74 + adds r0, r6, 0 + mov r1, r8 + movs r2, 0 + movs r3, 0 + bl sub_807D148 +_08066A74: + ldrb r0, [r7, 0x7] + cmp r0, 0 + bne _08066A86 + ldrh r1, [r7] + movs r2, 0x80 + lsls r2, 7 + adds r0, r2, 0 + orrs r0, r1 + strh r0, [r7] +_08066A86: + ldr r0, _08066AB8 + ldr r0, [r0] + ldr r1, _08066ABC + adds r0, r1 + ldrb r1, [r0] + adds r0, r6, 0 + bl sub_807AB38 +_08066A96: + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08066AA4: .4byte 0xffffff00 +_08066AA8: .4byte gUnknown_202DE58 +_08066AAC: .4byte 0x0000014d +_08066AB0: .4byte gUnknown_80F8D44 +_08066AB4: .4byte gUnknown_80F8BE0 +_08066AB8: .4byte gUnknown_203B418 +_08066ABC: .4byte 0x00003a08 + thumb_func_end sub_80668D0 + + thumb_func_start sub_8066AC0 +sub_8066AC0: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r7, r0, 0 + movs r1, 0 + bl sub_8044DA4 + adds r6, r0, 0 + ldr r2, [r6, 0x70] + mov r8, r2 + adds r5, r2, 0 + adds r5, 0x60 + ldr r0, _08066AF0 + ldr r0, [r0] + adds r0, 0x4C + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08066AF8 + ldr r0, _08066AF4 + b _08066B10 + .align 2, 0 +_08066AF0: .4byte gUnknown_203B460 +_08066AF4: .4byte gUnknown_80F8D60 +_08066AF8: + ldrb r1, [r5] + movs r0, 0x8 + ands r0, r1 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _08066B24 + ldr r0, _08066B1C + adds r1, r5, 0 + bl sub_8045BF8 + ldr r0, _08066B20 +_08066B10: + ldr r1, [r0] + adds r0, r7, 0 + bl sub_80522A8 + b _08066BAC + .align 2, 0 +_08066B1C: .4byte gUnknown_202DE58 +_08066B20: .4byte gUnknown_80F8BE0 +_08066B24: + ldr r2, [r2, 0x60] + str r2, [sp] + movs r1, 0xEF + mov r0, sp + ldrb r0, [r0] + ands r0, r1 + ldr r1, _08066BB8 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + ldr r0, _08066BBC + mov r1, sp + bl sub_8045BF8 + ldr r0, _08066BC0 + adds r1, r6, 0 + movs r2, 0 + bl sub_8045B94 + strb r4, [r5, 0x2] + strb r4, [r5, 0x1] + strb r4, [r5] + mov r0, sp + bl sub_8091290 + ldr r0, _08066BC4 + bl sub_8083E38 + ldr r0, _08066BC8 + ldr r1, [r0] + adds r0, r7, 0 + bl sub_80522A8 + adds r0, r6, 0 + bl sub_806A6E8 + adds r1, r6, 0x4 + adds r0, r6, 0 + bl sub_80706A4 + lsls r0, 24 + cmp r0, 0 + beq _08066B86 + adds r0, r7, 0 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0 + bl sub_807D148 +_08066B86: + mov r1, r8 + ldrb r0, [r1, 0x7] + cmp r0, 0 + bne _08066B9C + ldrh r1, [r1] + movs r2, 0x80 + lsls r2, 7 + adds r0, r2, 0 + orrs r0, r1 + mov r1, r8 + strh r0, [r1] +_08066B9C: + ldr r0, _08066BCC + ldr r0, [r0] + ldr r2, _08066BD0 + adds r0, r2 + ldrb r1, [r0] + adds r0, r7, 0 + bl sub_807AB38 +_08066BAC: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08066BB8: .4byte 0xffffff00 +_08066BBC: .4byte gUnknown_202DE58 +_08066BC0: .4byte gUnknown_202DF98 +_08066BC4: .4byte 0x0000014d +_08066BC8: .4byte gUnknown_80F8D7C +_08066BCC: .4byte gUnknown_203B418 +_08066BD0: .4byte 0x00003a08 + thumb_func_end sub_8066AC0 + + thumb_func_start sub_8066BD4 +sub_8066BD4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r7, r0, 0 + movs r1, 0 + bl sub_8044DA4 + mov r9, r0 + ldr r0, [r0, 0x70] + mov r8, r0 + mov r10, r8 + mov r6, r8 + adds r6, 0x60 + ldr r2, _08066C10 + adds r0, r7, 0 + movs r1, 0x1 + bl sub_8044D90 + adds r5, r0, 0 + ldrb r2, [r6] + movs r0, 0x8 + ands r0, r2 + cmp r0, 0 + beq _08066C18 + ldr r0, _08066C14 + adds r1, r6, 0 + b _08066C26 + .align 2, 0 +_08066C10: .4byte 0x00001565 +_08066C14: .4byte gUnknown_202DE58 +_08066C18: + ldrb r1, [r5] + movs r0, 0x18 + ands r0, r1 + cmp r0, 0x18 + bne _08066C40 + ldr r0, _08066C38 + adds r1, r5, 0 +_08066C26: + bl sub_8045BF8 + ldr r0, _08066C3C + ldr r1, [r0] + adds r0, r7, 0 + bl sub_80522A8 + b _08066CC8 + .align 2, 0 +_08066C38: .4byte gUnknown_202DE58 +_08066C3C: .4byte gUnknown_80F8BE0 +_08066C40: + movs r1, 0xEF + adds r0, r1, 0 + ands r0, r2 + strb r0, [r6] + ldrb r0, [r5] + ands r1, r0 + strb r1, [r5] + ldr r4, _08066CD8 + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_8045BF8 + adds r4, 0x50 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8045BF8 + ldr r0, _08066CDC + mov r1, r9 + movs r2, 0 + bl sub_8045B94 + mov r2, r8 + ldr r1, [r2, 0x60] + ldr r0, [r5] + str r0, [r2, 0x60] + str r1, [r5] + ldr r0, _08066CE0 + bl sub_8083E38 + ldr r0, _08066CE4 + ldr r1, [r0] + adds r0, r7, 0 + bl sub_80522A8 + mov r1, r9 + adds r1, 0x4 + mov r0, r9 + bl sub_80706A4 + lsls r0, 24 + cmp r0, 0 + beq _08066CA2 + adds r0, r7, 0 + mov r1, r9 + movs r2, 0 + movs r3, 0 + bl sub_807D148 +_08066CA2: + mov r1, r10 + ldrb r0, [r1, 0x7] + cmp r0, 0 + bne _08066CB8 + ldrh r1, [r1] + movs r2, 0x80 + lsls r2, 7 + adds r0, r2, 0 + orrs r0, r1 + mov r1, r10 + strh r0, [r1] +_08066CB8: + ldr r0, _08066CE8 + ldr r0, [r0] + ldr r2, _08066CEC + adds r0, r2 + ldrb r1, [r0] + adds r0, r7, 0 + bl sub_807AB38 +_08066CC8: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08066CD8: .4byte gUnknown_202DE58 +_08066CDC: .4byte gUnknown_202DFE8 +_08066CE0: .4byte 0x0000014d +_08066CE4: .4byte gUnknown_80F8DB4 +_08066CE8: .4byte gUnknown_203B418 +_08066CEC: .4byte 0x00003a08 + thumb_func_end sub_8066BD4 + + thumb_func_start sub_8066CF0 +sub_8066CF0: + push {lr} + movs r1, 0 + bl sub_8044DA4 + ldr r0, [r0, 0x70] + adds r0, 0xFC + movs r1, 0x1 + strb r1, [r0] + pop {r0} + bx r0 + thumb_func_end sub_8066CF0 + + thumb_func_start sub_8066D04 +sub_8066D04: + push {r4-r6,lr} + adds r4, r0, 0 + ldr r6, [r4, 0x70] + movs r1, 0 + movs r2, 0x4 + bl sub_8044D90 + adds r5, r0, 0 + ldr r0, _08066D2C + adds r1, r5, 0 + bl sub_8045BF8 + adds r0, r6, 0 + adds r0, 0x48 + ldrb r0, [r0] + cmp r0, 0x80 + bne _08066D34 + ldr r0, _08066D30 + b _08066DB2 + .align 2, 0 +_08066D2C: .4byte gUnknown_202DE58 +_08066D30: .4byte gUnknown_80F8DE0 +_08066D34: + cmp r0, 0x14 + bhi _08066D4C + ldrb r1, [r5] + movs r0, 0x18 + ands r0, r1 + cmp r0, 0x18 + bne _08066D4C + ldr r0, _08066D48 + b _08066DB2 + .align 2, 0 +_08066D48: .4byte gUnknown_80F8BE0 +_08066D4C: + adds r0, r6, 0 + adds r0, 0x48 + ldrb r0, [r0] + cmp r0, 0x81 + bne _08066D68 + ldrb r1, [r5] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08066D68 + ldr r0, _08066D64 + b _08066DB2 + .align 2, 0 +_08066D64: .4byte gUnknown_80F8BE0 +_08066D68: + movs r1, 0x4 + ldrsh r0, [r4, r1] + movs r2, 0x6 + ldrsh r1, [r4, r2] + bl sub_804954C + adds r2, r0, 0 + ldrh r1, [r2] + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + cmp r0, 0 + bne _08066DB0 + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + bne _08066DB0 + ldr r6, [r2, 0x14] + cmp r6, 0 + bne _08066DB0 + ldrb r1, [r5] + movs r0, 0xEF + ands r0, r1 + strb r0, [r5] + ldr r0, _08066DBC + adds r1, r5, 0 + bl sub_8045BF8 + adds r0, r4, 0x4 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_80460F8 + lsls r0, 24 + cmp r0, 0 + bne _08066DC4 +_08066DB0: + ldr r0, _08066DC0 +_08066DB2: + ldr r1, [r0] + adds r0, r4, 0 + bl sub_80522A8 + b _08066DF8 + .align 2, 0 +_08066DBC: .4byte gUnknown_202DE58 +_08066DC0: .4byte gUnknown_80F8E04 +_08066DC4: + strb r6, [r5, 0x2] + strb r6, [r5, 0x1] + strb r6, [r5] + bl sub_80910B4 + ldr r0, _08066E00 + bl sub_8083E38 + ldr r0, _08066E04 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08066E08 + ldr r1, [r0] + adds r0, r4, 0 + bl sub_80522A8 + ldr r0, _08066E0C + ldr r0, [r0] + ldr r1, _08066E10 + adds r0, r1 + ldrb r1, [r0] + adds r0, r4, 0 + bl sub_807AB38 +_08066DF8: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08066E00: .4byte 0x0000014d +_08066E04: .4byte gUnknown_202DF98 +_08066E08: .4byte gUnknown_80F8E28 +_08066E0C: .4byte gUnknown_203B418 +_08066E10: .4byte 0x00003a08 + thumb_func_end sub_8066D04 + + thumb_func_start sub_8066E14 +sub_8066E14: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + mov r9, r0 + ldr r0, [r0, 0x70] + mov r10, r0 + mov r0, r9 + movs r1, 0 + movs r2, 0x5 + bl sub_8044D90 + adds r6, r0, 0 + mov r0, r9 + movs r1, 0x1 + movs r2, 0x6 + bl sub_8044D90 + adds r2, r0, 0 + adds r7, r2, 0 + mov r0, r10 + adds r0, 0x48 + ldrb r0, [r0] + cmp r0, 0x80 + beq _08066E54 + ldr r0, _08066E50 + b _08066F1E + .align 2, 0 +_08066E50: .4byte gUnknown_80F8E2C +_08066E54: + mov r0, r10 + adds r0, 0x50 + ldrb r1, [r0] + str r0, [sp, 0x8] + cmp r1, 0x14 + bhi _08066E80 + ldrb r1, [r2] + movs r0, 0x18 + ands r0, r1 + cmp r0, 0x18 + bne _08066E80 + ldr r0, _08066E78 + adds r1, r2, 0 + bl sub_8045BF8 + ldr r0, _08066E7C + b _08066F1E + .align 2, 0 +_08066E78: .4byte gUnknown_202DE58 +_08066E7C: .4byte gUnknown_80F8BE0 +_08066E80: + ldr r1, [sp, 0x8] + ldrb r0, [r1] + cmp r0, 0x81 + bne _08066EA8 + adds r2, r7, 0 + ldrb r1, [r2] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08066EA8 + ldr r0, _08066EA0 + adds r1, r2, 0 + bl sub_8045BF8 + ldr r0, _08066EA4 + b _08066F1E + .align 2, 0 +_08066EA0: .4byte gUnknown_202DEA8 +_08066EA4: .4byte gUnknown_80F8C48 +_08066EA8: + mov r2, r9 + movs r3, 0x4 + ldrsh r0, [r2, r3] + movs r3, 0x6 + ldrsh r1, [r2, r3] + bl sub_804954C + ldr r0, [r0, 0x14] + cmp r0, 0 + beq _08066ECC + bl sub_80450F8 + cmp r0, 0x3 + beq _08066ECC + ldr r0, _08066EC8 + b _08066F1E + .align 2, 0 +_08066EC8: .4byte gUnknown_80F8E54 +_08066ECC: + adds r0, r6, 0 + ldr r5, [r0] + str r5, [sp] + adds r4, r7, 0 + ldr r6, [r4] + mov r8, sp + str r6, [sp, 0x4] + movs r3, 0xEF + mov r0, sp + ldrb r2, [r0] + ands r2, r3 + ldr r1, _08066F28 + adds r0, r1, 0 + ands r0, r5 + orrs r0, r2 + str r0, [sp] + mov r2, r8 + ldrb r0, [r2, 0x4] + ands r0, r3 + ands r1, r6 + orrs r1, r0 + str r1, [sp, 0x4] + mov r5, r10 + adds r5, 0x4C + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80461C8 + movs r0, 0 + strb r0, [r4, 0x2] + strb r0, [r4, 0x1] + strb r0, [r4] + add r1, sp, 0x4 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_80460F8 + lsls r0, 24 + cmp r0, 0 + bne _08066F30 + ldr r0, _08066F2C +_08066F1E: + ldr r1, [r0] + mov r0, r9 + bl sub_80522A8 + b _08066F7E + .align 2, 0 +_08066F28: .4byte 0xffffff00 +_08066F2C: .4byte gUnknown_80F8E78 +_08066F30: + ldr r3, [sp, 0x8] + ldrb r0, [r3] + cmp r0, 0x81 + bne _08066F40 + ldr r0, [sp] + mov r1, r10 + str r0, [r1, 0x60] + b _08066F46 +_08066F40: + mov r0, sp + bl sub_8091290 +_08066F46: + bl sub_80910B4 + ldr r4, _08066F90 + add r1, sp, 0x4 + adds r0, r4, 0 + bl sub_8045BF8 + adds r4, 0x50 + adds r0, r4, 0 + mov r1, sp + bl sub_8045BF8 + ldr r0, _08066F94 + bl sub_8083E38 + ldr r0, _08066F98 + ldr r1, [r0] + mov r0, r9 + bl sub_80522A8 + ldr r0, _08066F9C + ldr r0, [r0] + ldr r2, _08066FA0 + adds r0, r2 + ldrb r1, [r0] + mov r0, r9 + bl sub_807AB38 +_08066F7E: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08066F90: .4byte gUnknown_202DE58 +_08066F94: .4byte 0x0000014d +_08066F98: .4byte gUnknown_80F8EAC +_08066F9C: .4byte gUnknown_203B418 +_08066FA0: .4byte 0x00003a08 + thumb_func_end sub_8066E14 + + thumb_func_start sub_8066FA4 +sub_8066FA4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + adds r7, r0, 0 + ldr r0, [r7, 0x70] + mov r9, r0 + movs r1, 0x4 + ldrsh r0, [r7, r1] + movs r2, 0x6 + ldrsh r1, [r7, r2] + bl sub_804954C + mov r10, r0 + adds r0, r7, 0 + movs r1, 0 + movs r2, 0x7 + bl sub_8044D90 + adds r4, r0, 0 + adds r5, r4, 0 + ldr r0, _08067000 + mov r8, r0 + adds r1, r4, 0 + bl sub_8045BF8 + mov r0, r9 + adds r0, 0x48 + ldrb r0, [r0] + cmp r0, 0x14 + bhi _08067008 + ldrb r1, [r4] + movs r0, 0x18 + ands r0, r1 + cmp r0, 0x18 + bne _08067008 + mov r0, r8 + adds r0, 0x50 + adds r1, r4, 0 + bl sub_8045BF8 + ldr r0, _08067004 + b _0806709E + .align 2, 0 +_08067000: .4byte gUnknown_202DE58 +_08067004: .4byte gUnknown_80F8C48 +_08067008: + mov r0, r9 + adds r0, 0x48 + ldrb r1, [r0] + str r0, [sp, 0x8] + cmp r1, 0x81 + bne _08067028 + adds r0, r5, 0 + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08067028 + ldr r0, _08067024 + b _0806709E + .align 2, 0 +_08067024: .4byte gUnknown_80F8C44 +_08067028: + mov r1, r10 + ldr r0, [r1, 0x14] + cmp r0, 0 + beq _08067040 + bl sub_80450F8 + cmp r0, 0x3 + beq _08067040 + ldr r0, _0806703C + b _0806709E + .align 2, 0 +_0806703C: .4byte gUnknown_80F8E54 +_08067040: + mov r2, r10 + ldr r0, [r2, 0x14] + bl sub_8045108 + adds r4, r0, 0 + ldr r0, _080670A8 + adds r1, r4, 0 + bl sub_8045BF8 + ldr r6, [r5] + str r6, [sp] + ldr r4, [r4] + mov r8, sp + str r4, [sp, 0x4] + movs r3, 0xEF + mov r0, sp + ldrb r2, [r0] + ands r2, r3 + ldr r1, _080670AC + adds r0, r1, 0 + ands r0, r6 + orrs r0, r2 + str r0, [sp] + mov r2, r8 + ldrb r0, [r2, 0x4] + ands r0, r3 + ands r1, r4 + orrs r1, r0 + str r1, [sp, 0x4] + adds r4, r7, 0x4 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80461C8 + movs r0, 0 + strb r0, [r5, 0x2] + strb r0, [r5, 0x1] + strb r0, [r5] + adds r0, r4, 0 + mov r1, sp + movs r2, 0x1 + bl sub_80460F8 + lsls r0, 24 + cmp r0, 0 + bne _080670B4 + ldr r0, _080670B0 +_0806709E: + ldr r1, [r0] + adds r0, r7, 0 + bl sub_80522A8 + b _080670EE + .align 2, 0 +_080670A8: .4byte gUnknown_202DEA8 +_080670AC: .4byte 0xffffff00 +_080670B0: .4byte gUnknown_80F8E78 +_080670B4: + ldr r1, [sp, 0x8] + ldrb r0, [r1] + cmp r0, 0x81 + bne _080670C4 + ldr r0, [sp, 0x4] + mov r2, r9 + str r0, [r2, 0x60] + b _080670CA +_080670C4: + add r0, sp, 0x4 + bl sub_8091290 +_080670CA: + bl sub_80910B4 + ldr r0, _08067100 + bl sub_8083E38 + ldr r0, _08067104 + ldr r1, [r0] + adds r0, r7, 0 + bl sub_80522A8 + ldr r0, _08067108 + ldr r0, [r0] + ldr r1, _0806710C + adds r0, r1 + ldrb r1, [r0] + adds r0, r7, 0 + bl sub_807AB38 +_080670EE: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08067100: .4byte 0x0000014d +_08067104: .4byte gUnknown_80F8EAC +_08067108: .4byte gUnknown_203B418 +_0806710C: .4byte 0x00003a08 + thumb_func_end sub_8066FA4 + + thumb_func_start sub_8067110 +sub_8067110: + push {r4-r6,lr} + sub sp, 0xC + adds r5, r0, 0 + ldr r4, [r5, 0x70] + movs r1, 0 + movs r2, 0x8 + bl sub_8044D90 + adds r6, r0, 0 + ldr r0, _08067190 + adds r1, r6, 0 + bl sub_8045BF8 + ldr r0, _08067194 + adds r1, r4, 0 + movs r2, 0 + bl sub_80708B4 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_8048D50 + lsls r0, 24 + cmp r0, 0 + beq _08067188 + adds r0, r6, 0 + bl sub_80464AC + adds r1, r0, 0 + adds r0, r5, 0 + bl sub_80522A8 + ldr r0, [r6] + str r0, [sp, 0x8] + adds r0, r5, 0 + movs r1, 0 + movs r2, 0x66 + bl sub_8044DF0 + movs r0, 0x1E + movs r1, 0x11 + bl sub_803E708 + str r5, [sp] + add r0, sp, 0x8 + str r0, [sp, 0x4] + movs r0, 0 + movs r1, 0 + movs r2, 0 + adds r3, r5, 0 + bl sub_80479B8 + ldr r0, _08067198 + ldr r0, [r0] + ldr r1, _0806719C + adds r0, r1 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_807AB38 +_08067188: + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08067190: .4byte gUnknown_202DE58 +_08067194: .4byte gUnknown_202DF98 +_08067198: .4byte gUnknown_203B418 +_0806719C: .4byte 0x00003a08 + thumb_func_end sub_8067110 + + thumb_func_start sub_80671A0 +sub_80671A0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + adds r6, r0, 0 + ldr r0, [r6, 0x70] + mov r8, r0 + adds r0, r6, 0 + movs r1, 0 + movs r2, 0x9 + bl sub_8044D90 + adds r4, r0, 0 + mov r0, r8 + adds r0, 0x48 + ldrb r0, [r0] + cmp r0, 0x81 + bne _080671E8 + ldrb r1, [r4] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080671E8 + ldr r0, _080671E0 + adds r1, r4, 0 + bl sub_8045BF8 + ldr r0, _080671E4 + b _08067230 + .align 2, 0 +_080671E0: .4byte gUnknown_202DE58 +_080671E4: .4byte gUnknown_80F8BE0 +_080671E8: + ldrb r0, [r4, 0x2] + bl sub_8090BD0 + lsls r0, 24 + cmp r0, 0 + beq _08067202 + ldrb r0, [r4, 0x2] + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08067220 +_08067202: + ldrb r1, [r4] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08067220 + ldr r0, _08067218 + adds r1, r4, 0 + bl sub_8045BF8 + ldr r0, _0806721C + b _08067230 + .align 2, 0 +_08067218: .4byte gUnknown_202DE58 +_0806721C: .4byte gUnknown_80F8BE0 +_08067220: + adds r0, r6, 0 + movs r1, 0x1 + bl sub_8071518 + lsls r0, 24 + cmp r0, 0 + beq _08067248 + ldr r0, _08067244 +_08067230: + ldr r1, [r0] + adds r0, r6, 0 + bl sub_80522A8 + movs r0, 0x14 + movs r1, 0x4C + bl sub_803E708 + b _080674F8 + .align 2, 0 +_08067244: .4byte gUnknown_80FF76C +_08067248: + ldr r2, [r4] + str r2, [sp, 0x4] + movs r1, 0xEF + add r0, sp, 0x4 + ldrb r0, [r0] + ands r0, r1 + ldr r1, _080672C0 + ands r2, r1 + orrs r2, r0 + str r2, [sp, 0x4] + mov r0, r8 + adds r0, 0x48 + ldrb r1, [r0] + adds r5, r0, 0 + cmp r1, 0x80 + bne _08067272 + movs r4, 0 + adds r0, 0x4 + movs r1, 0x1 + bl sub_80461C8 +_08067272: + movs r7, 0x1 + ldr r0, [sp, 0x4] + lsrs r0, 16 + lsls r0, 24 + lsrs r0, 24 + bl sub_8090BD0 + lsls r0, 24 + cmp r0, 0 + beq _0806729A + ldr r0, [sp, 0x4] + lsrs r0, 16 + lsls r0, 24 + lsrs r0, 24 + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080672A8 +_0806729A: + ldr r0, [sp, 0x4] + lsrs r0, 8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _080672A8 + movs r7, 0 +_080672A8: + cmp r7, 0 + beq _080672C4 + ldrb r0, [r5] + cmp r0, 0x80 + beq _080672F6 + movs r0, 0 + strb r0, [r4, 0x2] + strb r0, [r4, 0x1] + strb r0, [r4] + bl sub_80910B4 + b _080672F6 + .align 2, 0 +_080672C0: .4byte 0xffffff00 +_080672C4: + ldrb r0, [r5] + cmp r0, 0x80 + bne _080672F0 + ldr r2, [sp, 0x4] + lsrs r0, r2, 8 + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 16 + ldr r1, _080672EC + ands r2, r1 + orrs r2, r0 + str r2, [sp, 0x4] + mov r0, r8 + adds r0, 0x4C + add r1, sp, 0x4 + movs r2, 0x1 + bl sub_80460F8 + b _080672F6 + .align 2, 0 +_080672EC: .4byte 0xffff00ff +_080672F0: + ldrb r0, [r4, 0x1] + subs r0, 0x1 + strb r0, [r4, 0x1] +_080672F6: + adds r0, r6, 0 + movs r1, 0x29 + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _08067310 + movs r0, 0x8 + bl sub_8084100 + mov r1, r8 + adds r1, 0x46 + strb r0, [r1] +_08067310: + adds r0, r6, 0 + bl sub_8045888 + lsls r0, 24 + movs r1, 0xE0 + add r1, r8 + mov r10, r1 + adds r1, r6, 0x4 + str r1, [sp, 0x10] + add r1, sp, 0xC + mov r9, r1 + cmp r0, 0 + beq _08067364 + mov r0, r8 + adds r0, 0x46 + ldrb r4, [r0] + movs r1, 0xB2 + lsls r1, 1 + adds r0, r6, 0 + bl sub_80421C0 + movs r7, 0x7 + movs r5, 0x7 +_0806733E: + subs r4, 0x1 + ands r4, r7 + adds r0, r6, 0 + movs r1, 0 + adds r2, r4, 0 + bl sub_806CDD4 + movs r0, 0x2 + movs r1, 0x15 + bl sub_803E708 + subs r5, 0x1 + cmp r5, 0 + bge _0806733E + movs r1, 0xB3 + lsls r1, 1 + add r1, r8 + movs r0, 0x4 + strb r0, [r1] +_08067364: + add r4, sp, 0x4 + ldrb r0, [r4, 0x2] + bl sub_8090BD0 + lsls r0, 24 + cmp r0, 0 + beq _08067380 + ldrb r0, [r4, 0x2] + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08067384 +_08067380: + movs r0, 0x1 + strb r0, [r4, 0x1] +_08067384: + ldr r0, _080673B0 + add r4, sp, 0x4 + adds r1, r4, 0 + bl sub_8045C08 + ldr r0, _080673B4 + mov r1, r8 + movs r2, 0 + bl sub_80708B4 + ldrb r0, [r4, 0x2] + bl sub_8090BD0 + lsls r0, 24 + cmp r0, 0 + bne _080673BC + ldr r0, _080673B8 + ldr r1, [r0] + adds r0, r6, 0 + bl sub_80522A8 + b _080673C6 + .align 2, 0 +_080673B0: .4byte gUnknown_202DE58 +_080673B4: .4byte gUnknown_202DF98 +_080673B8: .4byte gUnknown_80F8EC8 +_080673BC: + ldr r0, _080673F8 + ldr r1, [r0] + adds r0, r6, 0 + bl sub_80522A8 +_080673C6: + add r0, sp, 0x4 + ldrb r0, [r0, 0x2] + bl sub_8090BD0 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r6, 0 + bl sub_8042208 + adds r0, r6, 0 + movs r1, 0x27 + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _08067400 + ldr r0, _080673FC + ldr r1, [sp, 0xC] + ands r1, r0 + movs r0, 0x80 + lsls r0, 1 + orrs r1, r0 + str r1, [sp, 0xC] + b _08067408 + .align 2, 0 +_080673F8: .4byte gUnknown_80F8EC4 +_080673FC: .4byte 0xffff00ff +_08067400: + ldr r1, _0806741C + ldr r0, [sp, 0xC] + ands r0, r1 + str r0, [sp, 0xC] +_08067408: + mov r1, r10 + ldrb r0, [r1] + cmp r0, 0x1 + beq _08067440 + cmp r0, 0x1 + bgt _08067420 + cmp r0, 0 + beq _08067426 + b _08067462 + .align 2, 0 +_0806741C: .4byte 0xffff00ff +_08067420: + cmp r0, 0x2 + beq _0806744C + b _08067462 +_08067426: + ldr r1, _08067438 + ldr r0, [sp, 0xC] + ands r0, r1 + ldr r1, _0806743C + ands r0, r1 + movs r1, 0xA0 + lsls r1, 12 + b _0806745E + .align 2, 0 +_08067438: .4byte 0xffffff00 +_0806743C: .4byte 0x0000ffff +_08067440: + ldr r1, _08067448 + ldr r0, [sp, 0xC] + ands r0, r1 + b _08067456 + .align 2, 0 +_08067448: .4byte 0xffffff00 +_0806744C: + ldr r1, _080674B4 + ldr r0, [sp, 0xC] + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 +_08067456: + ldr r1, _080674B8 + ands r0, r1 + movs r1, 0xC6 + lsls r1, 15 +_0806745E: + orrs r0, r1 + str r0, [sp, 0xC] +_08067462: + adds r0, r6, 0 + movs r1, 0xF + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _08067486 + ldr r1, _080674B4 + ldr r0, [sp, 0xC] + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + ldr r1, _080674B8 + ands r0, r1 + movs r1, 0xC6 + lsls r1, 15 + orrs r0, r1 + str r0, [sp, 0xC] +_08067486: + add r0, sp, 0x4 + ldrb r0, [r0, 0x2] + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080674BC + add r4, sp, 0x8 + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_8083904 + mov r0, r9 + str r0, [sp] + adds r0, r6, 0 + add r1, sp, 0x4 + ldr r2, [sp, 0x10] + adds r3, r4, 0 + bl sub_80475C4 + b _080674D0 + .align 2, 0 +_080674B4: .4byte 0xffffff00 +_080674B8: .4byte 0x0000ffff +_080674BC: + mov r0, r8 + adds r0, 0x46 + ldrb r3, [r0] + mov r1, r9 + str r1, [sp] + adds r0, r6, 0 + add r1, sp, 0x4 + ldr r2, [sp, 0x10] + bl sub_8047190 +_080674D0: + adds r0, r6, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080674F8 + mov r0, r8 + adds r0, 0x46 + ldrb r1, [r0] + adds r0, r6, 0 + bl sub_806CE68 + ldr r0, _08067508 + ldr r0, [r0] + ldr r1, _0806750C + adds r0, r1 + ldrb r1, [r0] + adds r0, r6, 0 + bl sub_807AB38 +_080674F8: + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08067508: .4byte gUnknown_203B418 +_0806750C: .4byte 0x00003a08 + thumb_func_end sub_80671A0 + + thumb_func_start sub_8067510 +sub_8067510: + push {r4,lr} + adds r4, r0, 0 + bl sub_806773C + adds r1, r0, 0 + movs r2, 0x1 + negs r2, r2 + adds r0, r4, 0 + bl sub_8067558 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8067510 + + thumb_func_start sub_806752C +sub_806752C: + push {r4,lr} + ldr r1, _08067550 + ldr r1, [r1] + ldrb r0, [r0, 0x4] + lsls r0, 2 + ldr r2, _08067554 + adds r1, r2 + adds r1, r0 + ldr r4, [r1] + bl sub_8083600 + adds r1, r4, 0 + movs r2, 0 + bl sub_8067558 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08067550: .4byte gUnknown_203B418 +_08067554: .4byte 0x0001357c + thumb_func_end sub_806752C + + thumb_func_start sub_8067558 +sub_8067558: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x12C + adds r6, r0, 0 + adds r5, r1, 0 + mov r9, r2 + ldr r0, [r6, 0x70] + mov r8, r0 + cmp r5, 0 + bne _0806757C + ldr r0, _08067578 + ldr r1, [r0] + movs r0, 0 + b _08067716 + .align 2, 0 +_08067578: .4byte gUnknown_80F8EE4 +_0806757C: + adds r0, r6, 0 + bl sub_8070BC0 + lsls r0, 24 + cmp r0, 0 + bne _08067594 + ldr r0, _08067590 + ldr r1, [r0] + movs r0, 0 + b _08067716 + .align 2, 0 +_08067590: .4byte gUnknown_80F8EE4 +_08067594: + adds r0, r6, 0 + adds r1, r5, 0 + movs r2, 0x1 + movs r3, 0 + bl sub_8071598 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080675AA + b _0806771E +_080675AA: + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0 + bl sub_8071598 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080675C0 + b _0806771E +_080675C0: + ldr r7, [r5, 0x70] + ldr r4, _08067608 + adds r0, r4, 0 + adds r1, r7, 0 + movs r2, 0 + bl sub_80708B4 + adds r4, 0x50 + adds r0, r4, 0 + mov r1, r8 + movs r2, 0x7 + bl sub_80708B4 + bl sub_8084778 + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_807A96C + adds r0, r5, 0 + bl sub_8070BC0 + lsls r0, 24 + cmp r0, 0 + beq _08067600 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_8070B6C + lsls r0, 24 + cmp r0, 0 + beq _08067610 +_08067600: + ldr r0, _0806760C + ldr r1, [r0] + movs r0, 0 + b _08067716 + .align 2, 0 +_08067608: .4byte gUnknown_202DF98 +_0806760C: .4byte gUnknown_80FE008 +_08067610: + adds r0, r6, 0x4 + adds r1, r5, 0x4 + bl sub_80983D8 + adds r1, r0, 0 + adds r0, r6, 0 + bl sub_806CEFC + mov r1, r9 + cmp r1, 0 + blt _0806762E + adds r0, r5, 0 + bl sub_806CEFC + b _0806763C +_0806762E: + mov r0, r8 + adds r0, 0x46 + ldrb r1, [r0] + adds r1, 0x4 + adds r0, r5, 0 + bl sub_806CEFC +_0806763C: + ldrb r0, [r7, 0x8] + cmp r0, 0x1 + bne _08067648 + bl sub_807EF84 + b _0806772A +_08067648: + adds r0, r7, 0 + adds r0, 0xA4 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08067694 + ldr r0, _08067668 + ldr r1, [r0] + ldr r2, _0806766C + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _08067674 + ldr r0, _08067670 + ldr r1, [r0] + movs r0, 0 + b _08067716 + .align 2, 0 +_08067668: .4byte gUnknown_203B418 +_0806766C: .4byte 0x0000066e +_08067670: .4byte gUnknown_80FF674 +_08067674: + ldr r3, _08067688 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + beq _0806768C + adds r0, r5, 0 + bl sub_80845E0 + b _0806772A + .align 2, 0 +_08067688: .4byte 0x00000677 +_0806768C: + adds r0, r5, 0 + bl sub_8084448 + b _0806772A +_08067694: + movs r0, 0x4 + ldrsh r5, [r7, r0] + movs r6, 0 + adds r0, r7, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x4A + bne _080676AA + movs r5, 0xD2 + lsls r5, 1 + b _080676CC +_080676AA: + cmp r0, 0x47 + bne _080676B8 + ldr r5, _080676B4 + b _080676CC + .align 2, 0 +_080676B4: .4byte 0x000001a5 +_080676B8: + cmp r0, 0x41 + bne _080676CC + ldr r0, _080676E8 + ldr r0, [r0] + ldr r1, _080676EC + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080676CC + movs r6, 0x1 +_080676CC: + movs r3, 0x10 + ldrsh r2, [r7, r3] + adds r0, r2, 0 + cmp r2, 0 + bge _080676D8 + adds r0, r2, 0x3 +_080676D8: + movs r3, 0xE + ldrsh r1, [r7, r3] + asrs r0, 2 + cmp r1, r0 + bgt _080676F0 + movs r2, 0x2 + b _08067708 + .align 2, 0 +_080676E8: .4byte gUnknown_203B418 +_080676EC: .4byte 0x0000065c +_080676F0: + movs r0, 0xE + ldrsh r4, [r7, r0] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 1 + movs r1, 0xA + bl __divsi3 + movs r2, 0 + cmp r4, r0 + bgt _08067708 + movs r2, 0x1 +_08067708: + mov r0, sp + adds r1, r5, 0 + adds r3, r6, 0 + bl sub_806A3D4 + movs r0, 0 + mov r1, sp +_08067716: + movs r2, 0x1 + bl sub_80527C4 + b _0806772A +_0806771E: + ldr r0, _08067738 + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 +_0806772A: + add sp, 0x12C + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08067738: .4byte gUnknown_80F8EE4 + thumb_func_end sub_8067558 + + thumb_func_start sub_806773C +sub_806773C: + push {r4,r5,lr} + adds r5, r0, 0 + bl sub_80696A8 + adds r4, r0, 0 + cmp r4, 0 + beq _08067760 + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0x1 + bne _08067760 + ldr r0, [r5, 0x70] + ldrb r0, [r0, 0x6] + cmp r0, 0 + bne _08067760 + adds r0, r4, 0 + b _08067762 +_08067760: + movs r0, 0 +_08067762: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_806773C + + thumb_func_start sub_8067768 +sub_8067768: + push {r4,lr} + ldr r1, _0806778C + ldr r1, [r1] + ldrb r0, [r0, 0x4] + lsls r0, 2 + ldr r2, _08067790 + adds r1, r2 + adds r1, r0 + ldr r4, [r1] + bl sub_8083600 + adds r1, r4, 0 + movs r2, 0 + bl sub_8067794 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0806778C: .4byte gUnknown_203B418 +_08067790: .4byte 0x0001357c + thumb_func_end sub_8067768 + + thumb_func_start sub_8067794 +sub_8067794: + push {r4-r7,lr} + sub sp, 0x40 + adds r7, r1, 0 + ldr r4, [r7, 0x70] + cmp r7, 0 + bne _080677B4 + ldr r0, _080677B0 + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 + b _0806786C + .align 2, 0 +_080677B0: .4byte gUnknown_80F8F08 +_080677B4: + ldr r0, _080677F0 + adds r1, r7, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _080677F4 + ldr r5, [r0] + ldr r0, _080677F8 + ldr r6, [r0] + ldrb r2, [r4, 0xA] + cmp r2, 0 + blt _08067834 + ldr r1, _080677FC + movs r0, 0x64 + muls r0, r2 + ldr r2, _08067800 + adds r0, r2 + ldr r1, [r1] + adds r4, r1, r0 + movs r1, 0xA + ldrsh r0, [r4, r1] + bl sub_806A564 + lsls r0, 24 + cmp r0, 0 + beq _0806780C + ldr r0, _08067804 + ldr r5, [r0] + ldr r0, _08067808 + b _08067832 + .align 2, 0 +_080677F0: .4byte gUnknown_202DF98 +_080677F4: .4byte gUnknown_80F9094 +_080677F8: .4byte gUnknown_80F913C +_080677FC: .4byte gUnknown_203B45C +_08067800: .4byte 0x00008df8 +_08067804: .4byte gUnknown_80F9114 +_08067808: .4byte gUnknown_80F9154 +_0806780C: + movs r2, 0xA + ldrsh r0, [r4, r2] + bl sub_806A58C + lsls r0, 24 + cmp r0, 0 + beq _08067834 + bl sub_8044210 + lsls r0, 24 + cmp r0, 0 + beq _0806782C + ldr r0, _08067828 + b _0806782E + .align 2, 0 +_08067828: .4byte gUnknown_80F90DC +_0806782C: + ldr r0, _08067874 +_0806782E: + ldr r5, [r0] + ldr r0, _08067878 +_08067832: + ldr r6, [r0] +_08067834: + movs r0, 0 + adds r1, r5, 0 + movs r2, 0 + bl sub_8052B8C + cmp r0, 0x1 + bne _0806786C + ldr r4, _0806787C + mov r0, sp + adds r1, r4, 0 + movs r2, 0x40 + bl strncpy + ldr r1, _08067880 + adds r0, r7, 0 + movs r2, 0 + bl sub_8068FE0 + adds r0, r4, 0 + mov r1, sp + movs r2, 0x40 + bl strncpy + movs r0, 0 + adds r1, r6, 0 + movs r2, 0x1 + bl sub_80527C4 +_0806786C: + add sp, 0x40 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08067874: .4byte gUnknown_80F90C8 +_08067878: .4byte gUnknown_80F9150 +_0806787C: .4byte gUnknown_202DF98 +_08067880: .4byte 0x0000021d + thumb_func_end sub_8067794 + + thumb_func_start sub_8067884 +sub_8067884: + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r6, 0 + b _0806789A +_0806788E: + ldr r1, _08067900 + adds r0, r4, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080678C6 + adds r6, 0x1 +_0806789A: + adds r0, r5, 0 + movs r1, 0x1 + bl sub_8070828 + cmp r6, r0 + bge _080678C6 + ldr r4, [r5, 0x70] + adds r0, r4, 0 + adds r0, 0x50 + ldrb r1, [r0] + movs r0, 0 + str r0, [sp] + adds r0, r5, 0 + movs r2, 0x1 + movs r3, 0 + bl sub_8055A00 + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _0806788E +_080678C6: + adds r0, r5, 0 + movs r1, 0x1 + bl sub_8057588 + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _080678F6 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080678F0 + ldr r0, [r5, 0x70] + adds r0, 0x50 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_806A9B4 +_080678F0: + adds r0, r5, 0 + bl sub_806A1B0 +_080678F6: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08067900: .4byte 0x00000159 + thumb_func_end sub_8067884 + + thumb_func_start sub_8067904 +sub_8067904: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + adds r5, r0, 0 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + ldr r6, [r5, 0x70] + ldr r1, _08067940 + movs r0, 0 + str r0, [r1] + add r0, sp, 0x8 + mov r1, r9 + bl sub_8092A88 + adds r0, r6, 0 + adds r0, 0xBC + ldrb r0, [r0] + cmp r0, 0x1 + bne _0806794C + ldr r0, _08067944 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08067948 + b _08067962 + .align 2, 0 +_08067940: .4byte gUnknown_202F208 +_08067944: .4byte gUnknown_202DF98 +_08067948: .4byte gUnknown_80F8F20 +_0806794C: + adds r0, r6, 0 + adds r0, 0xAC + ldrb r0, [r0] + cmp r0, 0x4 + bne _08067974 + ldr r0, _0806796C + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08067970 +_08067962: + ldr r1, [r0] + adds r0, r5, 0 + bl sub_80522A8 + b _08067A56 + .align 2, 0 +_0806796C: .4byte gUnknown_202DF98 +_08067970: .4byte gUnknown_80F8F38 +_08067974: + movs r0, 0xB0 + lsls r0, 1 + movs r1, 0 + mov r10, r1 + cmp r9, r0 + bne _08067984 + movs r2, 0x1 + mov r10, r2 +_08067984: + movs r0, 0 + mov r8, r0 + movs r7, 0 + add r4, sp, 0x8 + b _080679D2 +_0806798E: + movs r1, 0xBC + lsls r1, 1 + adds r0, r6, r1 + strh r7, [r0] + ldrb r0, [r4] + movs r1, 0x8 + orrs r0, r1 + orrs r0, r7 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4] + movs r0, 0xA + strb r0, [r4, 0x4] + str r7, [sp] + str r4, [sp, 0x4] + adds r0, r5, 0 + mov r1, r10 + movs r2, 0 + movs r3, 0 + bl sub_8055FA0 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080679DE + ldr r2, _08067A68 + adds r0, r6, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080679DE + movs r0, 0x1 + add r8, r0 +_080679D2: + adds r0, r5, 0 + movs r1, 0x1 + bl sub_8070828 + cmp r8, r0 + blt _0806798E +_080679DE: + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08067A56 + movs r0, 0xB0 + lsls r0, 1 + cmp r9, r0 + bne _08067A04 + ldr r0, _08067A6C + ldr r0, [r0] + cmp r0, 0 + bne _08067A04 + ldr r0, _08067A70 + ldr r1, [r0] + adds r0, r5, 0 + bl sub_80522A8 +_08067A04: + ldrb r0, [r6, 0x7] + cmp r0, 0 + beq _08067A50 + movs r0, 0xB0 + lsls r0, 1 + cmp r9, r0 + beq _08067A50 + ldr r4, _08067A74 + adds r3, r6, 0 + adds r3, 0x46 + ldrb r0, [r3] + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0] + ldrh r1, [r5, 0x4] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + ldr r2, _08067A78 + ldr r1, [sp, 0x10] + ands r1, r2 + orrs r1, r0 + str r1, [sp, 0x10] + ldrb r0, [r3] + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x2] + ldrh r2, [r5, 0x6] + adds r0, r2 + lsls r0, 16 + ldr r2, _08067A7C + ands r1, r2 + orrs r1, r0 + str r1, [sp, 0x10] + add r0, sp, 0x10 + movs r1, 0x1 + bl sub_807FE44 +_08067A50: + adds r0, r5, 0 + bl sub_8071DA4 +_08067A56: + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08067A68: .4byte 0x00000159 +_08067A6C: .4byte gUnknown_202F208 +_08067A70: .4byte gUnknown_80FC690 +_08067A74: .4byte gUnknown_80F4448 +_08067A78: .4byte 0xffff0000 +_08067A7C: .4byte 0x0000ffff + thumb_func_end sub_8067904 + + thumb_func_start sub_8067A80 +sub_8067A80: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x6C + str r1, [sp, 0x68] + mov r8, r2 + mov r9, r3 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x64] + ldr r1, _08067AC8 + add r0, sp, 0x4 + movs r2, 0x60 + bl memcpy + ldr r1, _08067ACC + movs r0, 0 + str r0, [r1] + mov r10, r0 + cmp r10, r8 + blt _08067AB0 + b _08067ED8 +_08067AB0: + ldr r5, _08067AD0 + mov r4, r9 + mov r3, r8 +_08067AB6: + ldm r4!, {r2} + ldrh r1, [r2] + adds r0, r5, 0 + ands r0, r1 + strh r0, [r2] + subs r3, 0x1 + cmp r3, 0 + bne _08067AB6 + b _08067ED8 + .align 2, 0 +_08067AC8: .4byte gUnknown_8106DC8 +_08067ACC: .4byte gUnknown_202F30C +_08067AD0: .4byte 0x00007fff +_08067AD4: + movs r7, 0 + ldr r1, _08067B98 + movs r0, 0x1 + strb r0, [r1] + strb r7, [r1, 0x1] + movs r0, 0xE + strb r0, [r1, 0x2] + strb r7, [r1, 0x3] + add r0, sp, 0x4 + movs r1, 0x1 + bl sub_803ECB4 + ldr r5, _08067B9C + ldr r2, [r5] + ldr r0, [sp, 0x68] + str r0, [sp] + ldr r0, [sp, 0x64] + mov r1, r9 + mov r3, r8 + bl sub_8067F00 + ldr r4, _08067BA0 + mov r0, r8 + cmp r0, 0x8 + ble _08067B08 + movs r0, 0x8 +_08067B08: + strh r0, [r4, 0x1A] + mov r1, r10 + strh r1, [r4, 0x18] + movs r0, 0x8 + strh r0, [r4, 0x1C] + strh r7, [r4, 0x1E] + strh r7, [r4, 0x20] + strh r7, [r4, 0x4] + movs r0, 0x12 + strh r0, [r4, 0x6] + strh r7, [r4, 0xC] + strh r7, [r4, 0xE] + strh r7, [r4, 0x14] + str r7, [r4] + adds r0, r4, 0 + adds r0, 0x28 + bl sub_801317C + adds r0, r4, 0 + movs r1, 0 + bl sub_80137B0 + adds r6, r5, 0 +_08067B36: + ldr r0, _08067BA0 + bl AddMenuCursorSprite + movs r5, 0 + movs r7, 0 + ldr r0, [r6] + mov r2, r8 + subs r0, r2, r0 + cmp r0, 0x8 + ble _08067B50 + movs r5, 0x1 + bl sub_80684C4 +_08067B50: + ldr r0, [r6] + cmp r0, 0 + beq _08067B5C + movs r7, 0x1 + bl sub_8068344 +_08067B5C: + movs r0, 0 + ldr r1, _08067BA4 + bl sub_8014140 + adds r4, r0, 0 + movs r0, 0x37 + bl sub_803E46C + cmp r4, 0x2 + bne _08067BAC + cmp r5, 0 + beq _08067BAC + ldr r0, [r6] + mov r3, r8 + subs r0, r3, r0 + cmp r0, 0x8 + ble _08067BF0 + ldr r5, _08067BA8 + movs r4, 0x5 +_08067B82: + ldr r1, [r5] + movs r0, 0 + bl _call_via_r1 + movs r0, 0x37 + bl sub_803E46C + subs r4, 0x1 + cmp r4, 0 + bge _08067B82 + b _08067BEA + .align 2, 0 +_08067B98: .4byte gUnknown_202F308 +_08067B9C: .4byte gUnknown_202F30C +_08067BA0: .4byte gUnknown_202EE10 +_08067BA4: .4byte gUnknown_8106DA4 +_08067BA8: .4byte gUnknown_203B080 +_08067BAC: + ldr r0, _08067BF8 + ldrh r1, [r0, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08067C0C + movs r0, 0x1 + bl sub_8083CE0 + ldr r1, _08067BFC + movs r2, 0x18 + ldrsh r0, [r1, r2] + cmp r0, 0x7 + bne _08067C04 + ldr r0, [r6] + mov r3, r8 + subs r0, r3, r0 + cmp r0, 0x8 + ble _08067BF0 + ldr r5, _08067C00 + movs r4, 0x5 +_08067BD6: + ldr r1, [r5] + movs r0, 0 + bl _call_via_r1 + movs r0, 0x37 + bl sub_803E46C + subs r4, 0x1 + cmp r4, 0 + bge _08067BD6 +_08067BEA: + ldr r0, [r6] + adds r0, 0x1 + str r0, [r6] +_08067BF0: + movs r7, 0 + movs r0, 0x7 + mov r10, r0 + b _08067CF6 + .align 2, 0 +_08067BF8: .4byte gUnknown_20255F0 +_08067BFC: .4byte gUnknown_202EE10 +_08067C00: .4byte gUnknown_203B080 +_08067C04: + adds r0, r1, 0 + movs r1, 0 + bl sub_80136E0 +_08067C0C: + cmp r4, 0x1 + bne _08067C44 + cmp r7, 0 + beq _08067C44 + ldr r0, [r6] + cmp r0, 0 + beq _08067C38 + ldr r5, _08067C40 + movs r4, 0x5 +_08067C1E: + ldr r1, [r5] + movs r0, 0 + bl _call_via_r1 + movs r0, 0x37 + bl sub_803E46C + subs r4, 0x1 + cmp r4, 0 + bge _08067C1E + ldr r0, [r6] + subs r0, 0x1 + str r0, [r6] +_08067C38: + movs r7, 0 + movs r1, 0 + mov r10, r1 + b _08067CF6 + .align 2, 0 +_08067C40: .4byte gUnknown_203B084 +_08067C44: + ldr r0, _08067C8C + ldrh r1, [r0, 0x4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08067CA0 + movs r0, 0x1 + bl sub_8083CE0 + ldr r1, _08067C90 + movs r2, 0x18 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _08067C98 + ldr r0, [r6] + cmp r0, 0 + beq _08067C84 + ldr r5, _08067C94 + movs r4, 0x5 +_08067C6A: + ldr r1, [r5] + movs r0, 0 + bl _call_via_r1 + movs r0, 0x37 + bl sub_803E46C + subs r4, 0x1 + cmp r4, 0 + bge _08067C6A + ldr r0, [r6] + subs r0, 0x1 + str r0, [r6] +_08067C84: + movs r7, 0 + movs r3, 0 + mov r10, r3 + b _08067CF6 + .align 2, 0 +_08067C8C: .4byte gUnknown_20255F0 +_08067C90: .4byte gUnknown_202EE10 +_08067C94: .4byte gUnknown_203B084 +_08067C98: + adds r0, r1, 0 + movs r1, 0 + bl sub_8013744 +_08067CA0: + bl sub_80048C8 + lsls r0, 24 + cmp r0, 0 + beq _08067CAC + b _08067B36 +_08067CAC: + ldr r0, _08067CD4 + ldrh r1, [r0, 0x2] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _08067D40 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08067CCC + ldr r2, _08067CD8 + adds r0, r2, 0 + adds r0, 0x29 + ldrb r0, [r0] + cmp r0, 0 + beq _08067CDC +_08067CCC: + bl sub_8083D08 + movs r7, 0x1 + b _08067CF6 + .align 2, 0 +_08067CD4: .4byte gUnknown_20255F0 +_08067CD8: .4byte gUnknown_202EE10 +_08067CDC: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08067CF0 + adds r0, r2, 0 + adds r0, 0x2A + ldrb r0, [r0] + cmp r0, 0 + bne _08067CF0 + b _08067B36 +_08067CF0: + bl sub_8083D30 + movs r7, 0x2 +_08067CF6: + ldr r4, _08067D34 + adds r0, r4, 0 + bl AddMenuCursorSprite + movs r0, 0x37 + bl sub_803E46C + cmp r7, 0 + bne _08067D0A + b _08067AD4 +_08067D0A: + cmp r7, 0x2 + bne _08067D48 + movs r1, 0x18 + ldrsh r0, [r4, r1] + mov r10, r0 + ldr r0, _08067D38 + ldr r0, [r0] + ldr r2, [sp, 0x68] + cmp r0, r2 + bge _08067D20 + b _08067AD4 +_08067D20: + ldr r0, _08067D3C + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_8052B8C + cmp r0, 0x1 + bne _08067D32 + b _08067ED8 +_08067D32: + b _08067AD4 + .align 2, 0 +_08067D34: .4byte gUnknown_202EE10 +_08067D38: .4byte gUnknown_202F310 +_08067D3C: .4byte gUnknown_80FDFB8 +_08067D40: + bl sub_8083D1C + movs r7, 0x3 + b _08067CF6 +_08067D48: + cmp r7, 0x3 + bne _08067D64 + movs r0, 0x18 + ldrsh r3, [r4, r0] + mov r10, r3 + ldr r0, _08067D60 + ldr r0, [r0] + add r0, r10 + lsls r0, 2 + add r0, r9 + b _08067ED0 + .align 2, 0 +_08067D60: .4byte gUnknown_202F30C +_08067D64: + movs r2, 0x18 + ldrsh r1, [r4, r2] + mov r10, r1 + ldr r0, _08067DAC + ldr r0, [r0] + adds r4, r0, r1 + ldr r1, _08067DB0 + movs r0, 0 + str r0, [r1] + movs r0, 0x29 + movs r1, 0 + bl sub_8044F5C + movs r0, 0x2A + movs r1, 0 + bl sub_8044F5C + movs r0, 0x40 + movs r1, 0 + bl sub_8044F5C + lsls r0, r4, 2 + add r0, r9 + ldr r0, [r0] + ldrh r0, [r0] + movs r3, 0x80 + lsls r3, 8 + adds r1, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _08067DBC + movs r0, 0x29 + bl sub_8044FF0 + b _08067DC2 + .align 2, 0 +_08067DAC: .4byte gUnknown_202F30C +_08067DB0: .4byte gUnknown_202EE6C +_08067DB4: + bl sub_8083D08 + movs r7, 0x1 + b _08067E6E +_08067DBC: + movs r0, 0x2A + bl sub_8044FF0 +_08067DC2: + lsls r0, r4, 2 + mov r2, r9 + adds r1, r0, r2 + ldr r2, [r1] + ldrb r1, [r2, 0x2] + adds r6, r0, 0 + cmp r1, 0 + bne _08067DDC + ldrb r1, [r2, 0x4] + cmp r1, 0x40 + beq _08067DDC + cmp r1, 0x41 + bne _08067DE2 +_08067DDC: + movs r0, 0x29 + bl sub_8044FF0 +_08067DE2: + bl sub_8045064 + add r0, sp, 0x4 + movs r1, 0x15 + bl sub_805FC30 + ldr r4, _08067EA0 + ldr r5, _08067EA4 + adds r7, r4, 0 + adds r7, 0x2A +_08067DF6: + adds r0, r4, 0 + bl AddMenuCursorSprite + movs r0, 0x37 + bl sub_803E46C + ldrh r1, [r5, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08067E1A + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80136E0 +_08067E1A: + ldrh r1, [r5, 0x4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08067E32 + movs r0, 0x1 + bl sub_8083CE0 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8013744 +_08067E32: + ldrh r1, [r5, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08067E46 + adds r0, r4, 0 + adds r0, 0x29 + ldrb r0, [r0] + cmp r0, 0 + beq _08067E58 +_08067E46: + movs r3, 0x18 + ldrsh r0, [r4, r3] + bl sub_8044F3C + lsls r0, 24 + cmp r0, 0 + bne _08067DB4 + bl sub_8083D30 +_08067E58: + ldrh r1, [r5, 0x2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08067E68 + ldrb r0, [r7] + cmp r0, 0 + beq _08067DF6 +_08067E68: + bl sub_8083D30 + movs r7, 0 +_08067E6E: + ldr r4, _08067EA0 + adds r0, r4, 0 + bl AddMenuCursorSprite + movs r0, 0x37 + bl sub_803E46C + cmp r7, 0 + bne _08067E82 + b _08067AD4 +_08067E82: + movs r1, 0x18 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08067EA8 + mov r2, r9 + adds r0, r6, r2 + ldr r1, [r0] + ldrh r2, [r1] + movs r3, 0x80 + lsls r3, 8 + adds r0, r3, 0 + orrs r0, r2 + strh r0, [r1] + b _08067EBC + .align 2, 0 +_08067EA0: .4byte gUnknown_202EE10 +_08067EA4: .4byte gUnknown_20255F0 +_08067EA8: + cmp r0, 0x1 + bne _08067ECC + mov r1, r9 + adds r0, r6, r1 + ldr r2, [r0] + ldrh r0, [r2] + ldr r3, _08067EC8 + adds r1, r3, 0 + ands r0, r1 + strh r0, [r2] +_08067EBC: + mov r0, r8 + mov r1, r9 + bl sub_8068310 + b _08067AD4 + .align 2, 0 +_08067EC8: .4byte 0x00007fff +_08067ECC: + mov r1, r9 + adds r0, r6, r1 +_08067ED0: + ldr r0, [r0] + bl sub_806806C + b _08067AD4 +_08067ED8: + mov r0, r8 + mov r1, r9 + bl sub_8068310 + ldr r0, _08067EFC + ldr r0, [r0] + ldr r2, [sp, 0x68] + cmp r0, r2 + bge _08067EEC + b _08067AD4 +_08067EEC: + add sp, 0x6C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08067EFC: .4byte gUnknown_202F310 + thumb_func_end sub_8067A80 + + thumb_func_start sub_8067F00 +sub_8067F00: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r4, r0, 0 + mov r9, r1 + str r3, [sp, 0x4] + lsls r4, 24 + lsrs r4, 24 + subs r7, r2, 0x1 + movs r0, 0x16 + mov r8, r0 + movs r0, 0 + bl sub_80073B8 + ldr r0, _08067F44 + adds r1, r4, 0 + movs r2, 0 + bl sub_8092578 + ldr r2, _08067F48 + movs r0, 0 + str r0, [sp] + movs r0, 0xC + movs r1, 0 + movs r3, 0 + bl sub_8014FF0 + movs r1, 0 + mov r10, r1 + b _08067FF6 + .align 2, 0 +_08067F44: .4byte gUnknown_202DF98 +_08067F48: .4byte gUnknown_8106E28 +_08067F4C: + ldr r4, _08067F8C + lsls r6, r7, 2 + mov r0, r9 + adds r5, r6, r0 + ldr r1, [r5] + adds r0, r4, 0 + movs r2, 0 + bl sub_808D9AC + adds r4, 0x50 + ldr r0, [r5] + movs r2, 0x8 + ldrsh r1, [r0, r2] + adds r0, r4, 0 + bl sub_808D930 + ldr r1, _08067F90 + adds r0, r7, 0x1 + str r0, [r1] + ldr r0, [r5] + ldrh r1, [r0] + movs r0, 0x80 + lsls r0, 8 + ands r0, r1 + cmp r0, 0 + beq _08067F9C + ldr r0, _08067F94 + ldr r1, _08067F98 + bl strcpy + b _08067FA4 + .align 2, 0 +_08067F8C: .4byte gUnknown_202DF98 +_08067F90: .4byte gUnknown_202DE30 +_08067F94: .4byte gUnknown_202DE58 +_08067F98: .4byte gUnknown_8106E2C +_08067F9C: + ldr r0, _08067FCC + ldr r1, _08067FD0 + bl strcpy +_08067FA4: + mov r1, r9 + adds r0, r6, r1 + ldr r0, [r0] + ldrh r1, [r0] + movs r0, 0x80 + lsls r0, 7 + ands r0, r1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + beq _08067FD8 + ldr r2, _08067FD4 + movs r0, 0 + str r0, [sp] + movs r0, 0x7 + mov r1, r8 + movs r3, 0 + bl sub_8014FF0 + b _08067FE6 + .align 2, 0 +_08067FCC: .4byte gUnknown_202DE58 +_08067FD0: .4byte gUnknown_8106E30 +_08067FD4: .4byte gUnknown_8106E34 +_08067FD8: + ldr r2, _08068028 + str r0, [sp] + movs r0, 0x7 + mov r1, r8 + movs r3, 0 + bl sub_8014FF0 +_08067FE6: + movs r2, 0x1 + add r10, r2 + movs r0, 0xC + add r8, r0 + adds r7, 0x1 + mov r1, r10 + cmp r1, 0x9 + bgt _08068000 +_08067FF6: + cmp r7, 0 + blt _08067FE6 + ldr r2, [sp, 0x4] + cmp r7, r2 + blt _08067F4C +_08068000: + movs r0, 0 + bl sub_80073E0 + movs r0, 0x1 + bl sub_80073B8 + ldr r0, _0806802C + ldr r0, [r0] + ldr r1, [sp, 0x28] + cmp r0, r1 + blt _08068034 + ldr r2, _08068030 + movs r0, 0 + str r0, [sp] + movs r0, 0x8 + movs r1, 0x2 + movs r3, 0x1 + bl sub_8014FF0 + b _0806804C + .align 2, 0 +_08068028: .4byte gUnknown_8106E48 +_0806802C: .4byte gUnknown_202F310 +_08068030: .4byte gUnknown_8106E5C +_08068034: + ldr r1, _08068064 + ldr r2, [sp, 0x28] + subs r0, r2, r0 + str r0, [r1] + ldr r2, _08068068 + movs r0, 0 + str r0, [sp] + movs r0, 0x8 + movs r1, 0x2 + movs r3, 0x1 + bl sub_8014FF0 +_0806804C: + movs r0, 0x1 + bl sub_80073E0 + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08068064: .4byte gUnknown_202DE30 +_08068068: .4byte gUnknown_8106E6C + thumb_func_end sub_8067F00 + + thumb_func_start sub_806806C +sub_806806C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x110 + str r0, [sp, 0x108] + add r4, sp, 0x98 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x60 + bl memset + movs r0, 0x6 + str r0, [r4, 0x4] + movs r1, 0x2 + strh r1, [r4, 0x8] + strh r1, [r4, 0xA] + movs r2, 0x12 + strh r2, [r4, 0xC] + movs r0, 0xE + strh r0, [r4, 0xE] + strh r2, [r4, 0x10] + strh r1, [r4, 0x12] + ldr r0, _080681B4 + str r0, [r4, 0x14] + movs r0, 0x3 + str r0, [r4, 0x1C] + str r0, [r4, 0x34] + str r0, [r4, 0x4C] + movs r7, 0 + add r1, sp, 0x44 + strh r7, [r1] + mov r0, sp + adds r0, 0x5A + strh r7, [r0] + ldr r0, _080681B8 + strh r7, [r0, 0x18] + mov r9, r1 + adds r1, 0xB4 + str r1, [sp, 0x10C] + add r2, sp, 0x68 + mov r10, r2 + adds r6, r0, 0 +_080680C4: + movs r3, 0 + mov r8, r3 + add r1, sp, 0xF8 + ldr r0, _080681BC + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r0, [r0] + str r0, [r1] + ldr r1, _080681B4 + movs r2, 0x4 + strb r2, [r1] + strb r7, [r1, 0x1] + movs r0, 0xA + strb r0, [r1, 0x2] + mov r4, r8 + strb r4, [r1, 0x3] + strh r7, [r6, 0x1E] + strh r2, [r6, 0x20] + mov r0, r8 + strh r0, [r6, 0x1A] + strh r0, [r6, 0x18] + strh r0, [r6, 0x1C] + strh r0, [r6, 0x4] + movs r0, 0x10 + strh r0, [r6, 0x6] + mov r1, r8 + strh r1, [r6, 0x14] + mov r2, r8 + str r2, [r6] + adds r0, r6, 0 + adds r0, 0x28 + bl sub_801317C + add r0, sp, 0x98 + movs r1, 0x1 + bl sub_803ECB4 + ldr r0, _080681C0 + ldr r0, [r0] + ldr r3, _080681C4 + adds r0, r3 + ldrb r2, [r0] + add r0, sp, 0x4 + ldr r1, [sp, 0x108] + bl sub_808FF20 + lsls r4, r7, 2 + mov r0, sp + adds r0, r4 + adds r0, 0xF8 + ldr r0, [r0] + mov r1, r8 + str r1, [sp] + adds r1, r7, 0 + add r2, sp, 0x4 + mov r3, r10 + bl sub_808F844 + ldr r1, _080681C8 + movs r2, 0 + ldrsh r0, [r1, r2] + adds r0, 0xF + lsls r0, 3 + strh r0, [r6, 0xC] + movs r3, 0x2 + ldrsh r0, [r1, r3] + adds r0, 0x1 + lsls r0, 3 + subs r0, 0x2 + strh r0, [r6, 0xE] +_08068150: + ldr r0, _080681B8 + bl AddMenuCursorSprite + ldr r1, [sp, 0x10C] + adds r0, r1, r4 + ldr r0, [r0] + cmp r0, 0x4 + bne _0806817A + mov r2, r10 + ldrb r0, [r2, 0x8] + cmp r0, 0 + beq _0806816C + bl sub_80684C4 +_0806816C: + mov r3, r9 + movs r1, 0 + ldrsh r0, [r3, r1] + cmp r0, 0 + beq _0806817A + bl sub_8068344 +_0806817A: + movs r0, 0 + ldr r1, _080681CC + bl sub_8014140 + adds r5, r0, 0 + movs r0, 0x1C + bl sub_803E46C + ldr r3, _080681D0 + ldrh r1, [r3, 0x2] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _080681A2 + ldr r2, _080681B8 + adds r0, r2, 0 + adds r0, 0x2B + ldrb r0, [r0] + cmp r0, 0 + beq _080681D4 +_080681A2: + movs r0, 0 + bl sub_8083CE0 + adds r7, 0x1 + cmp r7, 0x4 + beq _080681B0 + b _080682E8 +_080681B0: + movs r7, 0 + b _080682E8 + .align 2, 0 +_080681B4: .4byte gUnknown_202F308 +_080681B8: .4byte gUnknown_202EE10 +_080681BC: .4byte gUnknown_8106E80 +_080681C0: .4byte gUnknown_203B418 +_080681C4: .4byte 0x0000065a +_080681C8: .4byte gUnknown_2027370 +_080681CC: .4byte gUnknown_8106DA4 +_080681D0: .4byte gUnknown_20255F0 +_080681D4: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _080681E6 + adds r0, r2, 0 + adds r0, 0x2C + ldrb r0, [r0] + cmp r0, 0 + beq _080681FA +_080681E6: + movs r0, 0 + bl sub_8083CE0 + subs r7, 0x1 + movs r0, 0x1 + negs r0, r0 + cmp r7, r0 + bne _080682E8 + movs r7, 0x3 + b _080682E8 +_080681FA: + ldr r2, [sp, 0x10C] + adds r0, r2, r4 + ldr r0, [r0] + cmp r0, 0x4 + bne _08068294 + ldrh r1, [r3, 0x4] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + bne _08068212 + cmp r5, 0x2 + bne _08068248 +_08068212: + mov r3, r10 + ldrb r0, [r3, 0x8] + cmp r0, 0 + beq _08068248 + movs r0, 0 + bl sub_8083CE0 + ldr r5, _08068244 + movs r4, 0x5 +_08068224: + ldr r1, [r5] + movs r0, 0 + bl _call_via_r1 + movs r0, 0x1C + bl sub_803E46C + subs r4, 0x1 + cmp r4, 0 + bge _08068224 + mov r4, r9 + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _080682E8 + .align 2, 0 +_08068244: .4byte gUnknown_203B080 +_08068248: + ldr r0, _0806828C + ldrh r1, [r0, 0x4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + bne _08068258 + cmp r5, 0x1 + bne _08068294 +_08068258: + mov r1, r9 + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _08068294 + movs r0, 0 + bl sub_8083CE0 + ldr r5, _08068290 + movs r4, 0x5 +_0806826C: + ldr r1, [r5] + movs r0, 0 + bl _call_via_r1 + movs r0, 0x1C + bl sub_803E46C + subs r4, 0x1 + cmp r4, 0 + bge _0806826C + mov r3, r9 + ldrh r0, [r3] + subs r0, 0x1 + strh r0, [r3] + b _080682E8 + .align 2, 0 +_0806828C: .4byte gUnknown_20255F0 +_08068290: .4byte gUnknown_203B084 +_08068294: + bl sub_80048C8 + lsls r0, 24 + cmp r0, 0 + beq _080682A0 + b _08068150 +_080682A0: + ldr r0, _080682C4 + ldrh r1, [r0, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080682B8 + ldr r2, _080682C8 + adds r0, r2, 0 + adds r0, 0x29 + ldrb r0, [r0] + cmp r0, 0 + beq _080682CC +_080682B8: + bl sub_8083D08 + movs r4, 0x1 + mov r8, r4 + b _080682E8 + .align 2, 0 +_080682C4: .4byte gUnknown_20255F0 +_080682C8: .4byte gUnknown_202EE10 +_080682CC: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080682E0 + adds r0, r2, 0 + adds r0, 0x2A + ldrb r0, [r0] + cmp r0, 0 + bne _080682E0 + b _08068150 +_080682E0: + bl sub_8083D30 + movs r0, 0x1 + mov r8, r0 +_080682E8: + movs r0, 0x37 + bl sub_803E46C + mov r1, r8 + cmp r1, 0 + bne _080682F6 + b _080680C4 +_080682F6: + movs r0, 0 + movs r1, 0 + bl sub_803EAF0 + add sp, 0x110 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_806806C + + thumb_func_start sub_8068310 +sub_8068310: + push {r4-r6,lr} + movs r4, 0 + ldr r6, _08068340 + cmp r4, r0 + bge _08068338 + movs r5, 0x80 + lsls r5, 8 + adds r3, r1, 0 + adds r2, r0, 0 +_08068322: + ldr r0, [r3] + ldrh r1, [r0] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _08068330 + adds r4, 0x1 +_08068330: + adds r3, 0x4 + subs r2, 0x1 + cmp r2, 0 + bne _08068322 +_08068338: + str r4, [r6] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08068340: .4byte gUnknown_202F310 + thumb_func_end sub_8068310 + + thumb_func_start sub_8068344 +sub_8068344: + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x8 + ldr r0, _08068494 + ldr r0, [r0] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + bne _0806835C + b _08068486 +_0806835C: + ldr r0, _08068498 + mov r9, r0 + movs r0, 0 + movs r1, 0 + str r0, [sp] + str r1, [sp, 0x4] + mov r0, sp + ldrh r0, [r0] + ldr r1, _0806849C + ands r1, r0 + ldr r3, _080684A0 + ldr r0, [sp] + ands r0, r3 + orrs r0, r1 + str r0, [sp] + mov r1, sp + ldrh r1, [r1] + adds r2, r3, 0 + ands r2, r0 + orrs r2, r1 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r0, _080684A4 + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r6, _080684A8 + mov r8, r6 + mov r0, r8 + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r0, _080684AC + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r0, _080684B0 + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + movs r4, 0x80 + lsls r4, 7 + mov r0, sp + ldrh r1, [r0] + ldr r6, _080684B4 + adds r0, r6, 0 + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + orrs r4, r0 + ands r3, r1 + orrs r3, r4 + str r3, [sp] + movs r1, 0x80 + lsls r1, 6 + mov r5, sp + ldrh r0, [r5, 0x2] + ldr r2, _080684B8 + ands r2, r0 + orrs r2, r1 + ands r2, r6 + movs r3, 0xFC + lsls r3, 2 + ldrh r1, [r5, 0x4] + movs r0, 0xFC + lsls r0, 8 + ands r0, r1 + orrs r0, r3 + mov r1, r8 + ands r0, r1 + movs r3, 0xF + movs r1, 0xF0 + lsls r1, 8 + ldr r4, _080684BC + ands r0, r4 + orrs r0, r1 + strh r0, [r5, 0x4] + mov r6, r9 + movs r1, 0x2 + ldrsh r0, [r6, r1] + lsls r0, 3 + adds r0, 0x8 + ands r0, r4 + lsls r0, 4 + ldrh r1, [r5, 0x6] + ands r3, r1 + orrs r3, r0 + strh r3, [r5, 0x6] + movs r3, 0 + ldrsh r0, [r6, r3] + lsls r0, 3 + adds r0, 0x40 + ldr r1, _080684C0 + ands r0, r1 + movs r1, 0xFE + lsls r1, 8 + ands r2, r1 + orrs r2, r0 + strh r2, [r5, 0x2] + movs r1, 0x80 + lsls r1, 1 + mov r0, sp + movs r2, 0 + movs r3, 0 + bl AddSprite +_08068486: + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08068494: .4byte gUnknown_202EDCC +_08068498: .4byte gUnknown_2027370 +_0806849C: .4byte 0x0000feff +_080684A0: .4byte 0xffff0000 +_080684A4: .4byte 0x0000fdff +_080684A8: .4byte 0x0000f3ff +_080684AC: .4byte 0x0000efff +_080684B0: .4byte 0x0000dfff +_080684B4: .4byte 0x00003fff +_080684B8: .4byte 0x0000c1ff +_080684BC: .4byte 0x00000fff +_080684C0: .4byte 0x000001ff + thumb_func_end sub_8068344 + + thumb_func_start sub_80684C4 +sub_80684C4: + push {r4-r6,lr} + sub sp, 0x8 + ldr r0, _080685E8 + ldr r0, [r0] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + bne _080684D6 + b _080685DE +_080684D6: + ldr r6, _080685EC + movs r0, 0 + movs r1, 0 + str r0, [sp] + str r1, [sp, 0x4] + mov r0, sp + ldrh r0, [r0] + ldr r1, _080685F0 + ands r1, r0 + ldr r3, _080685F4 + ldr r0, [sp] + ands r0, r3 + orrs r0, r1 + str r0, [sp] + mov r1, sp + ldrh r1, [r1] + adds r2, r3, 0 + ands r2, r0 + orrs r2, r1 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r0, _080685F8 + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r5, _080685FC + adds r0, r5, 0 + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r0, _08068600 + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + mov r0, sp + ldrh r1, [r0] + ldr r0, _08068604 + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + adds r2, r3, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + movs r4, 0x80 + lsls r4, 7 + mov r0, sp + ldrh r1, [r0] + ldr r0, _08068608 + ands r0, r1 + adds r1, r3, 0 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + ldrh r0, [r0] + orrs r4, r0 + ands r3, r1 + orrs r3, r4 + str r3, [sp] + mov r3, sp + movs r2, 0xFC + lsls r2, 2 + ldrh r1, [r3, 0x4] + movs r0, 0xFC + lsls r0, 8 + ands r0, r1 + orrs r0, r2 + ands r0, r5 + movs r2, 0xF + movs r1, 0xF0 + lsls r1, 8 + ldr r4, _0806860C + ands r0, r4 + orrs r0, r1 + strh r0, [r3, 0x4] + movs r1, 0x2 + ldrsh r0, [r6, r1] + lsls r0, 3 + adds r0, 0x70 + ands r0, r4 + lsls r0, 4 + ldrh r1, [r3, 0x6] + ands r2, r1 + orrs r2, r0 + strh r2, [r3, 0x6] + movs r1, 0 + ldrsh r0, [r6, r1] + lsls r0, 3 + adds r0, 0x40 + ldr r1, _08068610 + ands r0, r1 + strh r0, [r3, 0x2] + subs r1, 0xFF + mov r0, sp + movs r2, 0 + movs r3, 0 + bl AddSprite +_080685DE: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080685E8: .4byte gUnknown_202EDCC +_080685EC: .4byte gUnknown_2027370 +_080685F0: .4byte 0x0000feff +_080685F4: .4byte 0xffff0000 +_080685F8: .4byte 0x0000fdff +_080685FC: .4byte 0x0000f3ff +_08068600: .4byte 0x0000efff +_08068604: .4byte 0x0000dfff +_08068608: .4byte 0x00003fff +_0806860C: .4byte 0x00000fff +_08068610: .4byte 0x000001ff + thumb_func_end sub_80684C4 + + thumb_func_start sub_8068614 +sub_8068614: + push {lr} + ldr r0, _0806862C + ldr r1, _08068630 + bl sub_800A9EC + ldr r1, _08068634 + ldr r1, [r1] + ldr r2, _08068638 + adds r1, r2 + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_0806862C: .4byte gUnknown_8106E98 +_08068630: .4byte gUnknown_8510000 +_08068634: .4byte gUnknown_203B418 +_08068638: .4byte 0x000181e4 + thumb_func_end sub_8068614 + + thumb_func_start sub_806863C +sub_806863C: + push {lr} + ldr r0, _08068650 + ldr r0, [r0] + ldr r1, _08068654 + adds r0, r1 + ldr r0, [r0] + bl sub_800AA14 + pop {r0} + bx r0 + .align 2, 0 +_08068650: .4byte gUnknown_203B418 +_08068654: .4byte 0x000181e4 + thumb_func_end sub_806863C + + thumb_func_start sub_8068658 +sub_8068658: + push {r4-r6,lr} + movs r4, 0 + ldr r6, _08068740 + ldr r5, _08068744 + ldr r3, _08068748 + movs r2, 0 +_08068664: + ldr r0, [r5] + lsls r1, r4, 2 + adds r0, r3 + adds r0, r1 + str r2, [r0] + adds r4, 0x1 + cmp r4, r6 + ble _08068664 + ldr r0, _0806874C + movs r1, 0x1 + bl sub_8068838 + movs r4, 0 + ldr r1, _08068744 + ldr r0, [r1] + ldr r2, _08068750 + adds r0, r2 + ldr r0, [r0] + cmp r4, r0 + bge _080686B2 + adds r6, r1, 0 + ldr r5, _08068754 +_08068690: + ldr r0, [r6] + adds r0, r5 + bl sub_808E9B8 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + bl sub_8068838 + adds r5, 0x8 + adds r4, 0x1 + ldr r0, [r6] + ldr r1, _08068750 + adds r0, r1 + ldr r0, [r0] + cmp r4, r0 + blt _08068690 +_080686B2: + ldr r0, _08068744 + ldr r0, [r0] + movs r2, 0xD1 + lsls r2, 3 + adds r1, r0, r2 + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _080686CA + movs r1, 0x1 + bl sub_8068838 +_080686CA: + movs r4, 0 + ldr r6, _08068758 + movs r5, 0x1 +_080686D0: + movs r0, 0x64 + muls r0, r4 + ldr r1, _0806875C + adds r0, r1 + ldr r1, [r6] + adds r1, r0 + ldrh r2, [r1] + adds r0, r5, 0 + ands r0, r2 + cmp r0, 0 + beq _080686F8 + lsrs r0, r2, 1 + ands r0, r5 + cmp r0, 0 + beq _080686F8 + movs r2, 0xE + ldrsh r0, [r1, r2] + movs r1, 0 + bl sub_8068838 +_080686F8: + adds r4, 0x1 + cmp r4, 0x3 + ble _080686D0 + ldr r0, _08068744 + ldr r0, [r0] + ldr r1, _08068760 + adds r0, r1 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0x31 + bne _08068738 + movs r4, 0 + ldr r5, _08068758 +_08068712: + movs r0, 0x58 + muls r0, r4 + ldr r1, _08068764 + adds r0, r1 + ldr r1, [r5] + adds r2, r1, r0 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08068732 + movs r1, 0x8 + ldrsh r0, [r2, r1] + movs r1, 0x1 + bl sub_8068838 +_08068732: + adds r4, 0x1 + cmp r4, 0x3 + ble _08068712 +_08068738: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08068740: .4byte 0x000001a7 +_08068744: .4byte gUnknown_203B418 +_08068748: .4byte 0x00017b44 +_0806874C: .4byte 0x000001a5 +_08068750: .4byte 0x000037e4 +_08068754: .4byte 0x0000343c +_08068758: .4byte gUnknown_203B45C +_0806875C: .4byte 0x00008df8 +_08068760: .4byte 0x00003a14 +_08068764: .4byte 0x00008f88 + thumb_func_end sub_8068658 + + thumb_func_start sub_8068768 +sub_8068768: + push {r4,r5,lr} + movs r5, 0 +_0806876C: + ldr r0, _080687A4 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _080687A8 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + cmp r4, 0 + beq _08068796 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08068796 + ldr r0, [r4, 0x70] + movs r1, 0x4 + ldrsh r0, [r0, r1] + movs r1, 0 + bl sub_8068838 +_08068796: + adds r5, 0x1 + cmp r5, 0x13 + ble _0806876C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080687A4: .4byte gUnknown_203B418 +_080687A8: .4byte 0x000135cc + thumb_func_end sub_8068768 + + thumb_func_start sub_80687AC +sub_80687AC: + ldr r0, _080687C4 + ldr r1, [r0] + ldr r0, _080687C8 + adds r2, r1, r0 + movs r0, 0x80 + lsls r0, 3 + str r0, [r2] + ldr r0, _080687CC + adds r1, r0 + movs r0, 0xA + str r0, [r1] + bx lr + .align 2, 0 +_080687C4: .4byte gUnknown_203B418 +_080687C8: .4byte 0x000037f0 +_080687CC: .4byte 0x000037f4 + thumb_func_end sub_80687AC + + thumb_func_start sub_80687D0 +sub_80687D0: + lsls r0, 16 + ldr r1, _080687E4 + ldr r1, [r1] + asrs r0, 14 + ldr r2, _080687E8 + adds r1, r2 + adds r1, r0 + ldr r0, [r1] + bx lr + .align 2, 0 +_080687E4: .4byte gUnknown_203B418 +_080687E8: .4byte 0x00017b44 + thumb_func_end sub_80687D0 + + thumb_func_start sub_80687EC +sub_80687EC: + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 16 + asrs r2, r0, 16 + ldr r5, _08068828 + ldr r0, [r5] + lsls r4, r2, 2 + ldr r1, _0806882C + adds r0, r1 + adds r0, r4 + ldr r0, [r0] + cmp r0, 0 + bne _08068820 + ldr r1, _08068830 + mov r0, sp + bl sprintf + ldr r1, _08068834 + mov r0, sp + bl sub_800A9EC + ldr r1, [r5] + ldr r2, _0806882C + adds r1, r2 + adds r1, r4 + str r0, [r1] +_08068820: + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08068828: .4byte gUnknown_203B418 +_0806882C: .4byte 0x00017b44 +_08068830: .4byte gUnknown_8106EA0 +_08068834: .4byte gUnknown_8510000 + thumb_func_end sub_80687EC + + thumb_func_start sub_8068838 +sub_8068838: + push {r4,lr} + lsls r0, 16 + asrs r4, r0, 16 + lsls r1, 24 + cmp r1, 0 + bne _08068864 + movs r0, 0xCF + lsls r0, 1 + cmp r4, r0 + beq _0806885E + adds r0, 0x3 + cmp r4, r0 + beq _0806885E + adds r0, 0x1 + cmp r4, r0 + beq _0806885E + adds r0, 0x1 + cmp r4, r0 + bne _08068864 +_0806885E: + bl sub_80688B0 + b _0806887A +_08068864: + adds r0, r4, 0 + bl sub_80687EC + ldr r1, _08068880 + adds r0, r4, r1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x3 + bhi _0806887A + bl sub_8068884 +_0806887A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08068880: .4byte 0xfffffe88 + thumb_func_end sub_8068838 + + thumb_func_start sub_8068884 +sub_8068884: + push {lr} + movs r0, 0xBC + lsls r0, 1 + bl sub_80687EC + ldr r0, _080688A8 + bl sub_80687EC + movs r0, 0xBD + lsls r0, 1 + bl sub_80687EC + ldr r0, _080688AC + bl sub_80687EC + pop {r0} + bx r0 + .align 2, 0 +_080688A8: .4byte 0x00000179 +_080688AC: .4byte 0x0000017b + thumb_func_end sub_8068884 + + thumb_func_start sub_80688B0 +sub_80688B0: + push {lr} + ldr r0, _080688C8 + ldr r0, [r0] + movs r1, 0xE0 + lsls r1, 6 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + bl sub_80687EC + pop {r0} + bx r0 + .align 2, 0 +_080688C8: .4byte gUnknown_203B418 + thumb_func_end sub_80688B0 + + thumb_func_start sub_80688CC +sub_80688CC: + push {r4-r6,lr} + movs r5, 0 + ldr r6, _08068900 +_080688D2: + ldr r0, [r6] + lsls r4, r5, 2 + ldr r1, _08068904 + adds r0, r1 + adds r0, r4 + ldr r0, [r0] + cmp r0, 0 + beq _080688F2 + bl sub_800AA14 + ldr r0, [r6] + ldr r1, _08068904 + adds r0, r1 + adds r0, r4 + movs r1, 0 + str r1, [r0] +_080688F2: + adds r5, 0x1 + ldr r0, _08068908 + cmp r5, r0 + ble _080688D2 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08068900: .4byte gUnknown_203B418 +_08068904: .4byte 0x00017b44 +_08068908: .4byte 0x000001a7 + thumb_func_end sub_80688CC + + thumb_func_start sub_806890C +sub_806890C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x64 + movs r0, 0 + mov r8, r0 + mov r10, r0 + ldr r6, _08068A60 + add r5, sp, 0x8 +_08068922: + movs r0, 0x58 + mov r1, r10 + muls r1, r0 + adds r0, r1, 0 + ldr r2, [r6] + adds r7, r2, r0 + ldrh r1, [r7] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08068A1C + lsrs r0, r1, 1 + movs r3, 0x1 + ands r0, r3 + cmp r0, 0 + beq _08068A1C + movs r0, 0x64 + mov r4, r8 + muls r4, r0 + ldr r0, _08068A64 + adds r0, r4 + mov r9, r0 + adds r0, r2, r0 + mov r1, r10 + bl sub_808DE30 + ldr r0, _08068A68 + ldr r0, [r0] + ldr r1, _08068A6C + adds r0, r1 + ldrb r0, [r0] + bl sub_8090104 + lsls r0, 24 + cmp r0, 0 + beq _08068A06 + movs r0, 0x80 + lsls r0, 1 + str r0, [sp, 0x60] + movs r2, 0x8 + ldrsh r1, [r7, r2] + add r0, sp, 0x60 + str r0, [sp] + movs r3, 0 + str r3, [sp, 0x4] + add r0, sp, 0x8 + movs r2, 0 + bl sub_808CFD0 + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r5, 0x3] + ldr r2, _08068A70 + adds r0, r2 + strb r1, [r0] + ldr r1, [r6] + adds r1, r4 + ldrh r2, [r5, 0x14] + movs r3, 0x8E + lsls r3, 8 + adds r0, r1, r3 + strh r2, [r0] + ldrh r2, [r5, 0x16] + adds r3, 0x8 + adds r0, r1, r3 + strh r2, [r0] + ldrh r2, [r5, 0x16] + adds r3, 0x2 + adds r0, r1, r3 + strh r2, [r0] + ldrb r0, [r5, 0x18] + ldr r2, _08068A74 + adds r1, r2 + strb r0, [r1] + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r5, 0x19] + adds r3, 0x3 + adds r0, r3 + strb r1, [r0] + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r5, 0x1A] + adds r2, 0x2 + adds r0, r2 + strb r1, [r0] + ldr r0, [r6] + adds r0, r4 + ldrb r1, [r5, 0x1B] + adds r3, 0x2 + adds r0, r3 + strb r1, [r0] + ldr r2, [r6] + ldr r1, _08068A78 + adds r0, r2, r1 + adds r0, r4 + ldr r1, [sp, 0x24] + str r1, [r0] + adds r2, r4 + adds r3, 0x35 + adds r1, r2, r3 + ldr r0, [sp, 0x28] + str r0, [r1] + add r0, sp, 0x2C + ldrb r0, [r0] + ldr r1, _08068A7C + adds r2, r1 + strb r0, [r2] + ldr r0, [r6] + add r0, r9 + adds r0, 0x1C + add r1, sp, 0x34 + bl sub_8093F50 +_08068A06: + ldr r0, [r6] + adds r0, r4 + ldr r2, _08068A80 + adds r0, r2 + mov r3, r8 + strh r3, [r0] + movs r0, 0x1 + add r8, r0 + mov r1, r8 + cmp r1, 0x4 + beq _08068A2A +_08068A1C: + movs r2, 0x1 + add r10, r2 + movs r0, 0xCE + lsls r0, 1 + cmp r10, r0 + bgt _08068A2A + b _08068922 +_08068A2A: + mov r3, r8 + cmp r3, 0x3 + bgt _08068A50 + ldr r4, _08068A60 + ldr r3, _08068A64 + movs r2, 0 + movs r0, 0x64 + mov r1, r8 + muls r1, r0 +_08068A3C: + ldr r0, [r4] + adds r0, r1 + adds r0, r3 + strh r2, [r0] + adds r1, 0x64 + movs r0, 0x1 + add r8, r0 + mov r0, r8 + cmp r0, 0x3 + ble _08068A3C +_08068A50: + add sp, 0x64 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08068A60: .4byte gUnknown_203B45C +_08068A64: .4byte 0x00008df8 +_08068A68: .4byte gUnknown_203B418 +_08068A6C: .4byte 0x00000644 +_08068A70: .4byte 0x00008dfb +_08068A74: .4byte 0x00008e0c +_08068A78: .4byte 0x00008e10 +_08068A7C: .4byte 0x00008e48 +_08068A80: .4byte 0x00008e04 + thumb_func_end sub_806890C + + thumb_func_start sub_8068A84 +sub_8068A84: + push {r4-r7,lr} + adds r6, r0, 0 + movs r4, 0 + movs r5, 0 + ldr r7, _08068AE0 +_08068A8E: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08068AE4 + adds r0, r1 + ldr r1, [r7] + adds r2, r1, r0 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08068AB2 + movs r1, 0xE + ldrsh r0, [r2, r1] + bl sub_808DACC + lsls r0, 24 + lsrs r0, 24 + adds r4, r0 +_08068AB2: + adds r5, 0x1 + cmp r5, 0x3 + ble _08068A8E + movs r1, 0x8 + ldrsh r0, [r6, r1] + bl sub_808DACC + lsls r0, 24 + lsrs r0, 24 + adds r4, r0 + cmp r4, 0x6 + ble _08068B04 + ldr r0, _08068AE8 + adds r1, r6, 0 + movs r2, 0 + bl sub_808D9AC + ldrb r0, [r6, 0x4] + cmp r0, 0x4A + bne _08068AF0 + ldr r0, _08068AEC + b _08068BB2 + .align 2, 0 +_08068AE0: .4byte gUnknown_203B45C +_08068AE4: .4byte 0x00008df8 +_08068AE8: .4byte gUnknown_202DF98 +_08068AEC: .4byte gUnknown_80FE0F4 +_08068AF0: + cmp r0, 0x47 + bne _08068AFC + ldr r0, _08068AF8 + b _08068BB2 + .align 2, 0 +_08068AF8: .4byte gUnknown_80FE0F8 +_08068AFC: + ldr r0, _08068B00 + b _08068BB2 + .align 2, 0 +_08068B00: .4byte gUnknown_80FE0AC +_08068B04: + movs r5, 0 + ldr r2, _08068B6C +_08068B08: + movs r0, 0x64 + muls r0, r5 + ldr r1, _08068B70 + adds r0, r1 + ldr r1, [r2] + adds r4, r1, r0 + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08068B80 + adds r0, r4, 0 + adds r1, r6, 0 + ldr r2, _08068B74 + bl sub_808DE50 + ldrh r0, [r4] + movs r1, 0x1 + movs r2, 0 + orrs r1, r0 + strh r1, [r4] + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0x19 + bgt _08068B3E + movs r0, 0x1A + strh r0, [r4, 0x8] +_08068B3E: + ldrh r0, [r4] + movs r1, 0x2 + orrs r0, r1 + strh r0, [r4] + strh r5, [r4, 0xC] + adds r0, r4, 0 + adds r0, 0x40 + strb r2, [r0, 0x2] + strb r2, [r0, 0x1] + strb r2, [r0] + ldr r0, _08068B78 + adds r1, r6, 0 + movs r2, 0x6 + bl sub_808D9AC + ldrb r0, [r6, 0x4] + cmp r0, 0x4A + beq _08068BB0 + cmp r0, 0x47 + beq _08068BD0 + ldr r0, _08068B7C + b _08068BB2 + .align 2, 0 +_08068B6C: .4byte gUnknown_203B45C +_08068B70: .4byte 0x00008df8 +_08068B74: .4byte 0x000055aa +_08068B78: .4byte gUnknown_202DF98 +_08068B7C: .4byte gUnknown_80FE134 +_08068B80: + adds r5, 0x1 + cmp r5, 0x3 + ble _08068B08 + ldr r0, _08068B9C + adds r1, r6, 0 + movs r2, 0x6 + bl sub_808D9AC + ldrb r0, [r6, 0x4] + cmp r0, 0x4A + bne _08068BA4 + ldr r0, _08068BA0 + b _08068BB2 + .align 2, 0 +_08068B9C: .4byte gUnknown_202DF98 +_08068BA0: .4byte gUnknown_80FE0F4 +_08068BA4: + cmp r0, 0x47 + bne _08068BC4 + ldr r0, _08068BAC + b _08068BB2 + .align 2, 0 +_08068BAC: .4byte gUnknown_80FE0F8 +_08068BB0: + ldr r0, _08068BC0 +_08068BB2: + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 + b _08068BD0 + .align 2, 0 +_08068BC0: .4byte gUnknown_80FE168 +_08068BC4: + ldr r0, _08068BD8 + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 +_08068BD0: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08068BD8: .4byte gUnknown_80FE0AC + thumb_func_end sub_8068A84 + + thumb_func_start sub_8068BDC +sub_8068BDC: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, _08068CC4 + add sp, r4 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x220] + movs r1, 0 + mov r0, sp + adds r0, 0x39 +_08068BF6: + strb r1, [r0] + subs r0, 0x1 + cmp r0, sp + bge _08068BF6 + movs r6, 0 + ldr r0, _08068CC8 + mov r8, r0 + movs r7, 0x1 +_08068C06: + movs r0, 0x64 + muls r0, r6 + ldr r1, _08068CCC + adds r0, r1 + mov r2, r8 + ldr r1, [r2] + adds r4, r1, r0 + ldrb r1, [r4] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _08068C50 + movs r3, 0xA + ldrsh r0, [r4, r3] + bl sub_806A564 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _08068C50 + adds r4, 0x40 + ldrb r1, [r4] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _08068C50 + ldrb r0, [r4, 0x2] + cmp r0, 0x69 + bne _08068C50 + adds r0, r4, 0 + bl sub_80915D4 + bl sub_80913A0 + strb r5, [r4, 0x2] + strb r5, [r4, 0x1] + strb r5, [r4] +_08068C50: + adds r6, 0x1 + cmp r6, 0x3 + ble _08068C06 + movs r6, 0 + movs r5, 0x1 +_08068C5A: + ldr r1, _08068CC8 + movs r0, 0x64 + muls r0, r6 + ldr r2, _08068CCC + adds r0, r2 + ldr r1, [r1] + adds r4, r1, r0 + ldrb r1, [r4] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _08068CFE + movs r3, 0xA + ldrsh r0, [r4, r3] + bl sub_806A564 + lsls r0, 24 + cmp r0, 0 + bne _08068CFE + ldr r1, _08068CD0 + adds r0, r1, 0 + ldrh r2, [r4, 0xE] + adds r0, r2 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bhi _08068C96 + movs r0, 0xBC + lsls r0, 1 + strh r0, [r4, 0xE] +_08068C96: + movs r3, 0xA + ldrsh r0, [r4, r3] + bl sub_806A58C + lsls r0, 24 + cmp r0, 0 + beq _08068CE8 + ldr r0, _08068CD4 + ldr r0, [r0] + ldr r1, _08068CD8 + adds r0, r1 + ldrb r0, [r0] + bl sub_8090104 + lsls r0, 24 + cmp r0, 0 + beq _08068CDC + movs r2, 0xA + ldrsh r0, [r4, r2] + adds r1, r4, 0 + bl sub_808DFDC + b _08068CFE + .align 2, 0 +_08068CC4: .4byte 0xfffffdd8 +_08068CC8: .4byte gUnknown_203B45C +_08068CCC: .4byte 0x00008df8 +_08068CD0: .4byte 0xfffffe87 +_08068CD4: .4byte gUnknown_203B418 +_08068CD8: .4byte 0x00000644 +_08068CDC: + movs r3, 0xA + ldrsh r0, [r4, r3] + adds r1, r4, 0 + bl sub_808DF2C + b _08068CFE +_08068CE8: + ldr r0, [sp, 0x220] + cmp r0, 0 + beq _08068CFE + movs r1, 0xE + ldrsh r0, [r4, r1] + bl sub_808DBA8 + lsls r0, 24 + lsrs r0, 24 + add r0, sp + strb r5, [r0] +_08068CFE: + adds r6, 0x1 + cmp r6, 0x3 + ble _08068C5A + movs r1, 0 +_08068D06: + lsls r0, r1, 24 + lsrs r0, 24 + mov r8, r0 + mov r0, sp + add r0, r8 + ldrb r0, [r0] + adds r1, 0x1 + str r1, [sp, 0x224] + cmp r0, 0 + bne _08068D1C + b _08068F08 +_08068D1C: + mov r0, r8 + add r1, sp, 0x1F0 + movs r2, 0x1 + movs r3, 0x1 + bl sub_8092404 + mov r0, r8 + add r1, sp, 0x214 + movs r2, 0 + movs r3, 0 + bl sub_8092638 + movs r7, 0 + add r1, sp, 0x1F0 + ldrh r0, [r1] + ldr r2, _08068E10 + cmp r0, r2 + beq _08068D60 + ldr r0, _08068E14 + ldr r3, [r0] + adds r5, r2, 0 + add r2, sp, 0x3C + movs r4, 0x58 +_08068D4A: + ldrh r0, [r1] + muls r0, r4 + adds r0, r3, r0 + stm r2!, {r0} + adds r1, 0x2 + adds r7, 0x1 + cmp r7, 0x14 + bgt _08068D60 + ldrh r0, [r1] + cmp r0, r5 + bne _08068D4A +_08068D60: + movs r6, 0 + ldr r2, _08068E14 + mov r10, r2 + movs r3, 0 + mov r9, r3 +_08068D6A: + movs r0, 0x64 + muls r0, r6 + ldr r1, _08068E18 + adds r0, r1 + mov r2, r10 + ldr r1, [r2] + adds r5, r1, r0 + ldrb r1, [r5] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08068DD6 + movs r3, 0xA + ldrsh r0, [r5, r3] + bl sub_806A5A4 + lsls r0, 24 + cmp r0, 0 + beq _08068DD6 + movs r1, 0xE + ldrsh r0, [r5, r1] + bl sub_808DBA8 + lsls r0, 24 + lsrs r0, 24 + cmp r0, r8 + bne _08068DD6 + ldr r2, [sp, 0x220] + cmp r2, 0 + beq _08068DD6 + add r4, sp, 0x3C + lsls r0, r7, 2 + adds r4, r0 + add r0, sp, 0x90 + movs r1, 0x58 + muls r1, r6 + adds r0, r1 + str r0, [r4] + adds r1, r5, 0 + bl sub_808DF44 + ldr r2, [r4] + ldrh r0, [r2] + movs r3, 0x80 + lsls r3, 7 + adds r1, r3, 0 + orrs r0, r1 + strh r0, [r2] + ldr r0, [r4] + mov r1, r9 + strb r1, [r0, 0xC] + ldr r0, [r4] + strb r1, [r0, 0x10] + adds r7, 0x1 +_08068DD6: + adds r6, 0x1 + cmp r6, 0x3 + ble _08068D6A + add r0, sp, 0x214 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r7, r0 + bgt _08068E1C + cmp r7, 0 + bgt _08068DEC + b _08068F08 +_08068DEC: + add r5, sp, 0x3C + movs r3, 0x80 + lsls r3, 7 + adds r6, r3, 0 + adds r4, r7, 0 +_08068DF6: + ldr r1, [r5] + ldrh r0, [r1] + ands r0, r6 + cmp r0, 0 + beq _08068E06 + adds r0, r1, 0 + bl sub_808D1DC +_08068E06: + adds r5, 0x4 + subs r4, 0x1 + cmp r4, 0 + bne _08068DF6 + b _08068F08 + .align 2, 0 +_08068E10: .4byte 0x0000ffff +_08068E14: .4byte gUnknown_203B45C +_08068E18: .4byte 0x00008df8 +_08068E1C: + ldr r0, _08068E78 + mov r1, r8 + movs r2, 0 + bl sub_8092578 + ldr r0, _08068E7C + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 + add r4, sp, 0x3C +_08068E34: + add r0, sp, 0x214 + movs r2, 0 + ldrsh r1, [r0, r2] + subs r1, r7, r1 + mov r0, r8 + adds r2, r7, 0 + adds r3, r4, 0 + bl sub_8067A80 + movs r6, 0 + cmp r6, r7 + bge _08068E8E + movs r5, 0x80 + lsls r5, 8 + adds r3, r4, 0 +_08068E52: + ldr r2, [r3] + ldrh r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08068E86 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _08068E86 + ldrb r0, [r2, 0x4] + subs r0, 0x44 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _08068E80 + movs r0, 0x1 + b _08068E82 + .align 2, 0 +_08068E78: .4byte gUnknown_202DE58 +_08068E7C: .4byte gUnknown_80FE1A4 +_08068E80: + movs r0, 0 +_08068E82: + cmp r0, 0 + bne _08068E8E +_08068E86: + adds r3, 0x4 + adds r6, 0x1 + cmp r6, r7 + blt _08068E52 +_08068E8E: + cmp r6, r7 + beq _08068EA2 + ldr r0, _08068F24 + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_8052B8C + cmp r0, 0x1 + bne _08068E34 +_08068EA2: + cmp r7, 0 + ble _08068ED4 + movs r3, 0x80 + lsls r3, 8 + mov r9, r3 + adds r3, r4, 0 + movs r0, 0x1 + mov r8, r0 + movs r5, 0 + adds r6, r7, 0 +_08068EB6: + ldr r2, [r3] + ldrh r1, [r2] + mov r0, r8 + ands r0, r1 + cmp r0, 0 + beq _08068ECC + mov r0, r9 + ands r0, r1 + cmp r0, 0 + beq _08068ECC + strh r5, [r2] +_08068ECC: + adds r3, 0x4 + subs r6, 0x1 + cmp r6, 0 + bne _08068EB6 +_08068ED4: + cmp r7, 0 + ble _08068F08 + movs r1, 0x80 + lsls r1, 7 + adds r5, r1, 0 + adds r6, r7, 0 +_08068EE0: + ldr r2, [r4] + ldrh r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08068F00 + adds r0, r1, 0 + ands r0, r5 + cmp r0, 0 + beq _08068F00 + adds r0, r2, 0 + bl sub_808D1DC + ldr r1, [r4] + movs r0, 0 + strh r0, [r1] +_08068F00: + adds r4, 0x4 + subs r6, 0x1 + cmp r6, 0 + bne _08068EE0 +_08068F08: + ldr r1, [sp, 0x224] + cmp r1, 0x39 + bgt _08068F10 + b _08068D06 +_08068F10: + movs r3, 0x8A + lsls r3, 2 + add sp, r3 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08068F24: .4byte gUnknown_80FE20C + thumb_func_end sub_8068BDC + + thumb_func_start sub_8068F28 +sub_8068F28: + push {r4-r7,lr} + movs r6, 0 + ldr r7, _08068F5C +_08068F2E: + movs r0, 0x64 + muls r0, r6 + ldr r1, _08068F60 + adds r0, r1 + ldr r1, [r7] + adds r4, r1, r0 + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08068F74 + movs r1, 0xA + ldrsh r0, [r4, r1] + bl sub_806A564 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + beq _08068F64 + movs r0, 0 + strh r0, [r4] + b _08068F74 + .align 2, 0 +_08068F5C: .4byte gUnknown_203B45C +_08068F60: .4byte 0x00008df8 +_08068F64: + movs r1, 0xA + ldrsh r0, [r4, r1] + bl sub_806A538 + lsls r0, 24 + cmp r0, 0 + beq _08068F74 + strh r5, [r4] +_08068F74: + adds r6, 0x1 + cmp r6, 0x3 + ble _08068F2E + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8068F28 + + thumb_func_start sub_8068F80 +sub_8068F80: + push {r4,r5,lr} + bl sub_8083600 + adds r5, r0, 0 + ldr r0, _08068FD4 + ldr r4, [r0] + ldr r1, _08068FD8 + adds r0, r4, r1 + movs r1, 0 + strb r1, [r0] + ldr r2, _08068FDC + adds r0, r4, r2 + strb r1, [r0] + adds r2, 0x6 + adds r0, r4, r2 + strb r1, [r0] + adds r0, r4, 0 + adds r0, 0xC0 + str r1, [r0] + cmp r5, 0 + beq _08068FCC + adds r0, r5, 0 + bl sub_8045128 + ldrh r0, [r0] + lsrs r0, 5 + movs r1, 0x1 + ands r0, r1 + movs r2, 0xD3 + lsls r2, 3 + adds r1, r4, r2 + strb r0, [r1] + adds r2, 0x1 + adds r1, r4, r2 + strb r0, [r1] + adds r0, r5, 0x4 + bl sub_804AC20 +_08068FCC: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08068FD4: .4byte gUnknown_203B418 +_08068FD8: .4byte 0x0000066c +_08068FDC: .4byte 0x0000066d + thumb_func_end sub_8068F80 + + thumb_func_start sub_8068FE0 +sub_8068FE0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x84 + mov r8, r0 + str r2, [sp, 0x74] + lsls r1, 16 + asrs r1, 16 + mov r9, r1 + ldr r7, [r0, 0x70] + bl sub_8045128 + adds r4, r0, 0 + ldr r0, [sp, 0x74] + cmp r0, 0 + bne _0806900E + mov r0, sp + bl sub_80457DC + mov r1, sp + str r1, [sp, 0x74] +_0806900E: + ldr r0, [r4, 0x10] + cmp r0, r8 + bne _08069018 + movs r0, 0 + str r0, [r4, 0x10] +_08069018: + mov r2, r8 + movs r3, 0x4 + ldrsh r0, [r2, r3] + movs r3, 0x6 + ldrsh r1, [r2, r3] + bl sub_80402AC + movs r5, 0 + adds r6, r7, 0 + adds r6, 0xC8 + movs r0, 0xB0 + adds r0, r7 + mov r10, r0 + mov r1, r8 + adds r1, 0x22 + str r1, [sp, 0x80] + mov r2, r8 + adds r2, 0x20 + str r2, [sp, 0x7C] + adds r3, r7, 0 + adds r3, 0x40 + str r3, [sp, 0x78] +_08069044: + ldr r0, _080690E4 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _080690E8 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + cmp r4, 0 + beq _08069072 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08069072 + ldr r0, [r4, 0x70] + adds r1, r0, 0 + adds r1, 0x80 + ldr r0, [r1] + cmp r0, r8 + bne _08069072 + movs r0, 0 + str r0, [r1] +_08069072: + adds r5, 0x1 + cmp r5, 0x13 + ble _08069044 + ldrb r0, [r6] + cmp r0, 0x2 + bne _0806908A + ldr r0, _080690E4 + ldr r0, [r0] + ldr r3, _080690EC + adds r0, r3 + movs r1, 0 + strb r1, [r0] +_0806908A: + mov r1, r10 + ldrb r0, [r1] + subs r0, 0x3 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _080690A2 + adds r0, r7, 0 + adds r0, 0x9C + ldr r0, [r0] + bl sub_8076CB4 +_080690A2: + mov r0, r8 + bl sub_8078084 + movs r0, 0 + ldr r2, [sp, 0x80] + strb r0, [r2] + ldr r3, [sp, 0x7C] + strb r0, [r3] + ldr r1, _080690F0 + str r0, [r1] + ldr r1, [sp, 0x78] + ldrb r0, [r1] + cmp r0, 0x41 + bne _080690FC + ldr r3, _080690E4 + ldr r2, [r3] + ldr r1, _080690F4 + adds r0, r2, r1 + ldrb r1, [r0] + cmp r1, 0 + bne _080690FC + movs r0, 0x1 + strb r0, [r2, 0x10] + strh r1, [r7, 0xE] + ldr r0, [r3] + ldr r2, _080690F8 + adds r0, r2 + mov r1, r8 + movs r2, 0 + bl sub_8045B94 + b _08069484 + .align 2, 0 +_080690E4: .4byte gUnknown_203B418 +_080690E8: .4byte 0x000135cc +_080690EC: .4byte 0x000037fc +_080690F0: .4byte gUnknown_203B450 +_080690F4: .4byte 0x0000065c +_080690F8: .4byte 0x000005f4 +_080690FC: + ldrb r0, [r7, 0x7] + cmp r0, 0 + bne _08069104 + b _0806928E +_08069104: + movs r0, 0x3C + movs r1, 0x49 + bl sub_803E708 + bl sub_80532B4 + ldr r5, _08069198 + ldr r2, [r5] + ldrb r0, [r2, 0x6] + cmp r0, 0 + bne _080691C8 + ldr r3, _0806919C + adds r0, r2, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _080691E0 + movs r0, 0x87 + lsls r0, 2 + cmp r9, r0 + beq _080691E0 + adds r0, 0x6 + cmp r9, r0 + beq _080691E0 + subs r0, 0x4 + cmp r9, r0 + beq _080691E0 + ldr r1, _080691A0 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080691E0 + ldr r6, _080691A4 + adds r0, r2, r6 + movs r1, 0 + ldrsb r1, [r0, r1] + cmp r1, 0 + blt _080691E0 + adds r3, 0xA + adds r0, r2, r3 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080691E0 + cmp r1, 0 + ble _080691B4 + ldr r0, _080691A8 + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_8052B8C + adds r4, r0, 0 + cmp r4, 0x1 + bne _080691E0 + ldr r0, _080691AC + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 + ldr r0, [r5] + strb r4, [r0, 0x4] + ldr r0, [r5] + strb r4, [r0, 0x6] + ldr r0, [r5] + ldr r1, _080691B0 + adds r0, r1 + strb r4, [r0] + ldr r1, [r5] + adds r1, r6 + ldrb r0, [r1] + subs r0, 0x1 + strb r0, [r1] + b _08069484 + .align 2, 0 +_08069198: .4byte gUnknown_203B418 +_0806919C: .4byte 0x0000066e +_080691A0: .4byte 0x00003a0d +_080691A4: .4byte 0x0000067b +_080691A8: .4byte gUnknown_80FE268 +_080691AC: .4byte gUnknown_80FE28C +_080691B0: .4byte 0x00000654 +_080691B4: + ldr r0, _080691C4 + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 + b _080691E0 + .align 2, 0 +_080691C4: .4byte gUnknown_80FE2D0 +_080691C8: + movs r1, 0x1 + strb r1, [r2, 0x4] + ldr r0, [r5] + strb r1, [r0, 0x6] + ldr r0, [r5] + ldr r2, _080691DC + adds r0, r2 + strb r1, [r0] + b _08069484 + .align 2, 0 +_080691DC: .4byte 0x00000654 +_080691E0: + mov r0, r9 + ldr r1, [sp, 0x74] + mov r2, r8 + bl sub_8083AB0 + ldr r0, _080691F8 + cmp r9, r0 + bne _0806928E + movs r6, 0 + movs r5, 0 + b _080691FE + .align 2, 0 +_080691F8: .4byte 0x0000021f +_080691FC: + adds r5, 0x1 +_080691FE: + cmp r5, 0x3 + bgt _08069228 + ldr r0, _080692C4 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r3, _080692C8 + adds r0, r3 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080691FC + ldr r6, [r4, 0x70] + adds r0, r6, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x41 + bne _080691FC +_08069228: + cmp r6, 0 + beq _0806928E + ldr r5, _080692CC + ldrb r0, [r6, 0xA] + movs r1, 0x64 + muls r1, r0 + ldr r2, _080692D0 + adds r1, r2 + ldr r2, [r5] + adds r4, r2, r1 + adds r1, r6, 0 + bl sub_806C264 + movs r3, 0xA + ldrsh r0, [r4, r3] + bl sub_806A58C + lsls r0, 24 + cmp r0, 0 + beq _0806928A + ldr r0, _080692C4 + ldr r0, [r0] + ldr r1, _080692D4 + adds r0, r1 + ldrb r0, [r0] + bl sub_8090104 + lsls r0, 24 + cmp r0, 0 + bne _0806926E + movs r2, 0xA + ldrsh r0, [r4, r2] + adds r1, r4, 0 + bl sub_808DF2C +_0806926E: + bl sub_8044210 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _0806928A + movs r3, 0xA + ldrsh r1, [r4, r3] + movs r0, 0x58 + muls r0, r1 + ldr r1, [r5] + adds r0, r1 + adds r0, 0x28 + strb r2, [r0] +_0806928A: + movs r0, 0 + strh r0, [r4] +_0806928E: + ldrb r0, [r7, 0x6] + cmp r0, 0 + beq _080692DC + movs r5, 0 + movs r1, 0xB4 + lsls r1, 1 + adds r0, r7, r1 + movs r2, 0x98 + adds r2, r7 + mov r10, r2 + ldrb r3, [r0] + cmp r5, r3 + bge _0806930A + ldr r4, _080692D8 + subs r1, 0x1 + adds r2, r7, r1 + movs r3, 0 + adds r1, r0, 0 +_080692B2: + ldrb r0, [r2] + adds r0, r5 + adds r0, r4 + strb r3, [r0] + adds r5, 0x1 + ldrb r0, [r1] + cmp r5, r0 + blt _080692B2 + b _0806930A + .align 2, 0 +_080692C4: .4byte gUnknown_203B418 +_080692C8: .4byte 0x0001357c +_080692CC: .4byte gUnknown_203B45C +_080692D0: .4byte 0x00008df8 +_080692D4: .4byte 0x00000644 +_080692D8: .4byte gUnknown_202EE76 +_080692DC: + movs r5, 0 + movs r1, 0xB4 + lsls r1, 1 + adds r0, r7, r1 + movs r2, 0x98 + adds r2, r7 + mov r10, r2 + ldrb r3, [r0] + cmp r5, r3 + bge _0806930A + ldr r4, _0806932C + subs r1, 0x1 + adds r2, r7, r1 + movs r3, 0 + adds r1, r0, 0 +_080692FA: + ldrb r0, [r2] + adds r0, r5 + adds r0, r4 + strb r3, [r0] + adds r5, 0x1 + ldrb r0, [r1] + cmp r5, r0 + blt _080692FA +_0806930A: + ldr r1, [sp, 0x78] + ldrb r0, [r1] + cmp r0, 0x4A + bne _08069338 + ldr r2, _08069330 + ldr r1, [r2] + movs r0, 0x2 + strb r0, [r1, 0x10] + ldr r0, [r2] + ldr r2, _08069334 + adds r0, r2 + mov r1, r8 + movs r2, 0 + bl sub_8045B94 + b _08069352 + .align 2, 0 +_0806932C: .4byte gUnknown_202EE70 +_08069330: .4byte gUnknown_203B418 +_08069334: .4byte 0x000005f4 +_08069338: + cmp r0, 0x47 + bne _08069352 + ldr r2, _08069494 + ldr r1, [r2] + movs r0, 0x3 + strb r0, [r1, 0x10] + ldr r0, [r2] + ldr r3, _08069498 + adds r0, r3 + mov r1, r8 + movs r2, 0 + bl sub_8045B94 +_08069352: + bl sub_8083600 + cmp r0, 0 + beq _080693C6 + movs r0, 0x87 + lsls r0, 2 + cmp r9, r0 + beq _080693C6 + ldrb r0, [r7, 0x7] + cmp r0, 0 + bne _080693C6 + ldr r4, _08069494 + ldr r0, [r4] + ldrb r0, [r0, 0x10] + cmp r0, 0 + bne _080693C6 + adds r0, r7, 0 + adds r0, 0xA4 + ldrb r1, [r0] + movs r2, 0 + movs r0, 0xFA + lsls r0, 1 + cmp r9, r0 + bne _08069384 + movs r2, 0x1 +_08069384: + mov r0, r8 + bl sub_8084E00 + ldr r1, _0806949C + adds r0, r1, 0 + ldrh r2, [r7, 0x4] + adds r0, r2 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bhi _080693C6 + bl sub_80441BC + lsls r0, 24 + cmp r0, 0 + bne _080693C6 + ldrb r0, [r7, 0x6] + cmp r0, 0 + beq _080693CC + ldr r0, [r4] + ldr r3, _080694A0 + adds r0, r3 + movs r1, 0x1 + strb r1, [r0] + ldr r0, _080694A4 + ldr r1, [r0] + mov r0, r8 + bl sub_805239C + bl sub_803E178 + bl sub_8049ED4 +_080693C6: + ldrb r0, [r7, 0x6] + cmp r0, 0 + bne _08069466 +_080693CC: + ldr r6, _080694A8 + ldrb r0, [r7, 0xA] + movs r1, 0x64 + muls r1, r0 + ldr r2, _080694AC + adds r1, r2 + ldr r2, [r6] + adds r4, r2, r1 + adds r1, r7, 0 + bl sub_806C264 + movs r3, 0xA + ldrsh r0, [r4, r3] + bl sub_806A58C + lsls r0, 24 + cmp r0, 0 + beq _08069462 + ldr r5, _08069494 + ldr r0, [r5] + ldr r1, _080694B0 + adds r0, r1 + ldrb r0, [r0] + bl sub_8090104 + lsls r0, 24 + cmp r0, 0 + bne _0806940E + movs r2, 0xA + ldrsh r0, [r4, r2] + adds r1, r4, 0 + bl sub_808DF2C +_0806940E: + bl sub_8044210 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _0806942A + movs r3, 0xA + ldrsh r1, [r4, r3] + movs r0, 0x58 + muls r0, r1 + ldr r1, [r6] + adds r0, r1 + adds r0, 0x28 + strb r2, [r0] +_0806942A: + ldrb r1, [r7, 0x7] + negs r0, r1 + orrs r0, r1 + lsrs r1, r0, 31 + ldr r0, [r5] + ldr r2, _080694B4 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _08069448 + ldr r3, [sp, 0x78] + ldrb r0, [r3] + cmp r0, 0x41 + bne _08069448 + movs r1, 0x1 +_08069448: + cmp r1, 0 + bne _08069462 + movs r0, 0xA + ldrsh r1, [r4, r0] + movs r0, 0x58 + muls r1, r0 + ldr r0, _080694A8 + ldr r0, [r0] + adds r1, r0 + ldrh r2, [r1] + ldr r0, _080694B8 + ands r0, r2 + strh r0, [r1] +_08069462: + movs r0, 0 + strh r0, [r4] +_08069466: + mov r1, r10 + ldr r0, [r1] + bl sub_800F934 + ldr r0, _080694BC + movs r2, 0 + str r2, [r0] + ldr r0, _08069494 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0xC] + mov r3, r8 + str r2, [r3] + bl sub_8045ACC +_08069484: + add sp, 0x84 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08069494: .4byte gUnknown_203B418 +_08069498: .4byte 0x000005f4 +_0806949C: .4byte 0xfffffe5f +_080694A0: .4byte 0x000037fe +_080694A4: .4byte gUnknown_80FA580 +_080694A8: .4byte gUnknown_203B45C +_080694AC: .4byte 0x00008df8 +_080694B0: .4byte 0x00000644 +_080694B4: .4byte 0x0000065c +_080694B8: .4byte 0x0000fffd +_080694BC: .4byte gUnknown_203B450 + thumb_func_end sub_8068FE0 + + thumb_func_start sub_80694C0 +sub_80694C0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r4, r0, 0 + adds r7, r1, 0 + mov r8, r2 + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + adds r0, r7, 0 + mov r1, r8 + bl sub_8049590 + mov r10, r0 + ldr r5, [r4, 0x70] + adds r6, r5, 0 + adds r6, 0xB0 + ldrb r0, [r6] + subs r0, 0x3 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _080694FC + adds r0, r5, 0 + adds r0, 0x9C + ldr r0, [r0] + bl sub_8076CB4 +_080694FC: + ldrb r0, [r6] + cmp r0, 0x7 + beq _0806950A + cmp r0, 0x5 + beq _0806950A + cmp r0, 0x2 + bne _08069512 +_0806950A: + adds r0, r4, 0 + adds r1, r4, 0 + bl sub_807A324 +_08069512: + movs r0, 0x4 + ldrsh r2, [r4, r0] + cmp r7, r2 + bne _08069522 + movs r1, 0x6 + ldrsh r0, [r4, r1] + cmp r8, r0 + beq _080695DE +_08069522: + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0 + blt _08069552 + movs r1, 0x6 + ldrsh r0, [r4, r1] + cmp r0, 0 + blt _08069552 + adds r1, r0, 0 + adds r0, r2, 0 + bl sub_8049590 + adds r1, r0, 0 + ldr r0, [r1, 0x10] + cmp r0, r4 + bne _08069546 + movs r0, 0 + str r0, [r1, 0x10] +_08069546: + movs r1, 0x4 + ldrsh r0, [r4, r1] + movs r2, 0x6 + ldrsh r1, [r4, r2] + bl sub_80402AC +_08069552: + ldrh r0, [r4, 0x4] + strh r0, [r4, 0x8] + ldrh r0, [r4, 0x6] + strh r0, [r4, 0xA] + strh r7, [r4, 0x4] + mov r0, r8 + strh r0, [r4, 0x6] + ldrb r0, [r5, 0x7] + cmp r0, 0 + beq _0806956E + ldr r0, _0806959C + strh r7, [r0] + mov r1, r8 + strh r1, [r0, 0x2] +_0806956E: + mov r2, r10 + str r4, [r2, 0x10] + ldrb r0, [r5, 0x7] + cmp r0, 0 + beq _08069588 + ldr r0, _080695A0 + strh r7, [r0] + mov r1, r8 + strh r1, [r0, 0x2] + ldr r0, _080695A4 + ldr r1, [r0] + movs r0, 0 + strb r0, [r1, 0x1] +_08069588: + adds r0, r7, 0 + mov r1, r8 + bl sub_80402AC + mov r2, r9 + cmp r2, 0 + beq _080695A8 + cmp r2, 0x1 + beq _080695C4 + b _080695CE + .align 2, 0 +_0806959C: .4byte gUnknown_203B410 +_080695A0: .4byte gUnknown_202EE0C +_080695A4: .4byte gUnknown_203B418 +_080695A8: + ldr r0, [r5, 0x70] + str r0, [r5, 0x74] + ldr r0, [r5, 0x6C] + str r0, [r5, 0x70] + ldr r0, [r5, 0x68] + str r0, [r5, 0x6C] + adds r0, r5, 0 + adds r0, 0xE4 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080695CE + ldr r0, [r4, 0x8] + str r0, [r5, 0x68] + b _080695CE +_080695C4: + ldr r0, [r4, 0x4] + str r0, [r5, 0x68] + str r0, [r5, 0x6C] + str r0, [r5, 0x70] + str r0, [r5, 0x74] +_080695CE: + mov r1, r10 + ldrb r0, [r1, 0x9] + adds r1, r4, 0 + adds r1, 0x25 + strb r0, [r1] + adds r0, r4, 0 + bl sub_806CF98 +_080695DE: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80694C0 + + thumb_func_start sub_80695EC +sub_80695EC: + push {r4-r7,lr} + adds r4, r0, 0 + adds r6, r1, 0 + adds r7, r2, 0 + ldr r1, [r4, 0x70] + adds r5, r1, 0 + adds r0, r1, 0 + adds r0, 0xB0 + ldrb r0, [r0] + subs r0, 0x3 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _08069612 + adds r0, r1, 0 + adds r0, 0x9C + ldr r0, [r0] + bl sub_8076CB4 +_08069612: + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r6, r0 + bne _08069622 + movs r1, 0x6 + ldrsh r0, [r4, r1] + cmp r7, r0 + beq _08069658 +_08069622: + ldrh r0, [r4, 0x4] + strh r0, [r4, 0x8] + ldrh r0, [r4, 0x6] + strh r0, [r4, 0xA] + strh r6, [r4, 0x4] + strh r7, [r4, 0x6] + ldr r0, [r5, 0x70] + str r0, [r5, 0x74] + ldr r0, [r5, 0x6C] + str r0, [r5, 0x70] + ldr r0, [r5, 0x68] + str r0, [r5, 0x6C] + adds r0, r5, 0 + adds r0, 0xE4 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08069648 + ldr r0, [r4, 0x8] + str r0, [r5, 0x68] +_08069648: + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_804954C + ldrb r1, [r0, 0x9] + adds r0, r4, 0 + adds r0, 0x25 + strb r1, [r0] +_08069658: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80695EC + + thumb_func_start sub_8069660 +sub_8069660: + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, [r4, 0x70] + adds r5, r0, 0 + adds r5, 0x46 + ldrb r1, [r5] + adds r0, r4, 0 + bl sub_8070F80 + lsls r0, 24 + cmp r0, 0 + bne _0806967C + movs r0, 0 + b _0806969E +_0806967C: + movs r1, 0x4 + ldrsh r0, [r4, r1] + ldr r1, _080696A4 + ldrb r2, [r5] + lsls r2, 2 + adds r2, r1 + movs r3, 0 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r3, 0x6 + ldrsh r1, [r4, r3] + movs r3, 0x2 + ldrsh r2, [r2, r3] + adds r1, r2 + bl sub_804954C + ldr r0, [r0, 0x10] +_0806969E: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080696A4: .4byte gUnknown_80F4448 + thumb_func_end sub_8069660 + + thumb_func_start sub_80696A8 +sub_80696A8: + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, [r4, 0x70] + adds r5, r0, 0 + adds r5, 0x46 + ldrb r1, [r5] + adds r0, r4, 0 + bl sub_8071138 + lsls r0, 24 + cmp r0, 0 + beq _080696F4 + movs r1, 0x4 + ldrsh r0, [r4, r1] + ldr r1, _080696F0 + ldrb r2, [r5] + lsls r2, 2 + adds r2, r1 + movs r3, 0 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r3, 0x6 + ldrsh r1, [r4, r3] + movs r3, 0x2 + ldrsh r2, [r2, r3] + adds r1, r2 + bl sub_804954C + ldr r1, [r0, 0x10] + cmp r1, 0 + beq _080696F4 + ldr r0, [r1] + cmp r0, 0x1 + bne _080696F4 + adds r0, r1, 0 + b _080696F6 + .align 2, 0 +_080696F0: .4byte gUnknown_80F4448 +_080696F4: + movs r0, 0 +_080696F6: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80696A8 + + thumb_func_start sub_80696FC +sub_80696FC: + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldr r3, [r4, 0x70] + ldr r5, _08069764 + adds r3, 0x46 + ldrb r0, [r3] + lsls r0, 2 + adds r0, r5 + ldrh r0, [r0] + ldrh r1, [r4, 0x4] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + ldr r1, _08069768 + ldr r2, [sp] + ands r2, r1 + orrs r2, r0 + str r2, [sp] + ldrb r0, [r3] + lsls r0, 2 + adds r0, r5 + ldrh r0, [r0, 0x2] + ldrh r1, [r4, 0x6] + adds r0, r1 + lsls r0, 16 + ldr r1, _0806976C + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + movs r2, 0 + ldrsh r0, [r0, r2] + asrs r1, 16 + bl sub_804954C + adds r5, r0, 0 + adds r0, r4, 0 + mov r1, sp + bl sub_80705F0 + lsls r0, 24 + cmp r0, 0 + bne _08069770 + ldr r1, [r5, 0x10] + cmp r1, 0 + beq _08069770 + ldr r0, [r1] + cmp r0, 0x1 + bne _08069770 + adds r0, r1, 0 + b _08069772 + .align 2, 0 +_08069764: .4byte gUnknown_80F4448 +_08069768: .4byte 0xffff0000 +_0806976C: .4byte 0x0000ffff +_08069770: + movs r0, 0 +_08069772: + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80696FC + + thumb_func_start sub_806977C +sub_806977C: + push {r4-r7,lr} + sub sp, 0x4 + adds r4, r0, 0 + ldr r0, [r4, 0x70] + ldr r7, _0806982C + adds r5, r0, 0 + adds r5, 0x46 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r7 + ldrh r0, [r0] + ldrh r1, [r4, 0x4] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + ldr r1, _08069830 + ldr r2, [sp] + ands r2, r1 + orrs r2, r0 + str r2, [sp] + ldrb r0, [r5] + lsls r0, 2 + adds r0, r7 + ldrh r0, [r0, 0x2] + ldrh r1, [r4, 0x6] + adds r0, r1 + lsls r0, 16 + ldr r1, _08069834 + ands r1, r2 + orrs r1, r0 + str r1, [sp] + mov r0, sp + movs r2, 0 + ldrsh r0, [r0, r2] + asrs r1, 16 + bl sub_804954C + mov r6, sp + adds r0, r4, 0 + mov r1, sp + bl sub_80705F0 + lsls r0, 24 + cmp r0, 0 + bne _08069838 + ldrb r0, [r5] + lsls r0, 2 + adds r0, r7 + movs r1, 0 + ldrsh r0, [r0, r1] + lsls r0, 1 + ldrh r2, [r4, 0x4] + adds r0, r2 + mov r1, sp + strh r0, [r1] + ldrb r0, [r5] + lsls r0, 2 + adds r0, r7 + movs r1, 0x2 + ldrsh r0, [r0, r1] + lsls r0, 1 + ldrh r2, [r4, 0x6] + adds r0, r2 + strh r0, [r6, 0x2] + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + movs r2, 0x2 + ldrsh r1, [r6, r2] + bl sub_804954C + adds r5, r0, 0 + adds r0, r4, 0 + mov r1, sp + bl sub_80705F0 + lsls r0, 24 + cmp r0, 0 + bne _08069838 + ldr r1, [r5, 0x10] + cmp r1, 0 + beq _08069838 + ldr r0, [r1] + cmp r0, 0x1 + bne _08069838 + adds r0, r1, 0 + b _0806983A + .align 2, 0 +_0806982C: .4byte gUnknown_80F4448 +_08069830: .4byte 0xffff0000 +_08069834: .4byte 0x0000ffff +_08069838: + movs r0, 0 +_0806983A: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_806977C + + thumb_func_start sub_8069844 +sub_8069844: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + mov r8, r1 + ldr r5, [r1, 0x70] + adds r0, r6, 0x2 + adds r1, r5, 0 + movs r2, 0 + bl sub_80708B4 + ldrh r0, [r5, 0x2] + strh r0, [r6] + movs r1, 0xE + ldrsh r0, [r5, r1] + str r0, [r6, 0x24] + movs r2, 0x10 + ldrsh r0, [r5, r2] + str r0, [r6, 0x28] + ldrb r0, [r5, 0x9] + str r0, [r6, 0x2C] + ldr r0, [r5, 0x18] + str r0, [r6, 0x30] + movs r2, 0 +_08069874: + adds r1, r6, 0 + adds r1, 0x34 + adds r1, r2 + adds r0, r5, 0 + adds r0, 0x14 + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r1, r6, 0 + adds r1, 0x36 + adds r1, r2 + adds r0, r5, 0 + adds r0, 0x16 + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r1, r6, 0 + adds r1, 0x16 + adds r1, r2 + adds r0, r5, 0 + adds r0, 0x5C + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r1, r6, 0 + adds r1, 0x18 + adds r1, r2 + adds r0, r5, 0 + adds r0, 0x5E + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r2, 0x1 + cmp r2, 0x1 + ble _08069874 + ldrb r2, [r5, 0x7] + adds r1, r6, 0 + adds r1, 0x38 + movs r0, 0 + strb r2, [r1] + adds r2, r6, 0 + adds r2, 0x39 + strb r0, [r2] + adds r3, r6, 0 + adds r3, 0x3A + strb r0, [r3] + adds r4, r6, 0 + adds r4, 0x3B + strb r0, [r4] + movs r7, 0x3C + adds r7, r6 + mov r12, r7 + strb r0, [r7] + adds r0, r5, 0 + adds r0, 0x60 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0806995C + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _0806995C + adds r1, r5, 0 + adds r1, 0x62 + ldrb r0, [r1] + cmp r0, 0x13 + bne _08069908 + ldr r0, _080699A4 + ldrb r0, [r0] + ldrb r7, [r2] + adds r0, r7 + strb r0, [r2] +_08069908: + ldrb r0, [r1] + cmp r0, 0x2B + bne _08069918 + ldr r0, _080699A8 + ldrb r0, [r0] + ldrb r7, [r2] + adds r0, r7 + strb r0, [r2] +_08069918: + ldrb r0, [r1] + cmp r0, 0x21 + bne _08069928 + ldr r0, _080699AC + ldrb r0, [r0] + ldrb r2, [r3] + adds r0, r2 + strb r0, [r3] +_08069928: + ldrb r0, [r1] + cmp r0, 0x2B + bne _08069938 + ldr r0, _080699A8 + ldrb r0, [r0] + ldrb r7, [r3] + adds r0, r7 + strb r0, [r3] +_08069938: + ldrb r0, [r1] + cmp r0, 0x1E + bne _08069948 + ldr r0, _080699B0 + ldrb r0, [r0] + ldrb r2, [r4] + adds r0, r2 + strb r0, [r4] +_08069948: + ldrb r0, [r1] + cmp r0, 0x22 + bne _0806995C + ldr r0, _080699B4 + ldrb r0, [r0] + mov r7, r12 + ldrb r7, [r7] + adds r0, r7 + mov r1, r12 + strb r0, [r1] +_0806995C: + adds r0, r5, 0 + adds r0, 0x94 + ldrb r1, [r0] + adds r0, r6, 0 + adds r0, 0x54 + strb r1, [r0] + ldr r0, [r5, 0x60] + str r0, [r6, 0x20] + ldrh r0, [r5, 0xC] + movs r1, 0 + strh r0, [r6, 0x3E] + ldr r0, [r5, 0x40] + str r0, [r6, 0x1C] + adds r0, r6, 0 + adds r0, 0x44 + strb r1, [r0] + adds r0, 0x4 + strb r1, [r0] + adds r0, r5, 0 + adds r0, 0x8C + ldr r0, [r0] + str r0, [r6, 0x50] + ldr r0, _080699B8 + ldr r0, [r0] + ldr r2, _080699BC + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _080699C0 + adds r0, r5, 0 + bl sub_806A4DC + adds r1, r6, 0 + adds r1, 0x4C + b _080699C6 + .align 2, 0 +_080699A4: .4byte gUnknown_810AC60 +_080699A8: .4byte gUnknown_810AC68 +_080699AC: .4byte gUnknown_810AC62 +_080699B0: .4byte gUnknown_810AC64 +_080699B4: .4byte gUnknown_810AC66 +_080699B8: .4byte gUnknown_203B418 +_080699BC: .4byte 0x0000065a +_080699C0: + adds r1, r6, 0 + adds r1, 0x4C + movs r0, 0x3 +_080699C6: + strb r0, [r1] + movs r4, 0 + movs r7, 0x10 + ldrsh r0, [r5, r7] + cmp r0, 0 + bge _080699D4 + adds r0, 0x3 +_080699D4: + movs r2, 0xE + ldrsh r1, [r5, r2] + asrs r0, 2 + cmp r1, r0 + bgt _080699E8 + adds r1, r6, 0 + adds r1, 0x58 + movs r0, 0x6 + strb r0, [r1] + movs r4, 0x1 +_080699E8: + ldr r0, _08069A24 + ldr r0, [r0] + ldr r7, _08069A28 + adds r0, r7 + ldrb r0, [r0] + cmp r0, 0 + beq _08069A02 + adds r0, r6, 0 + adds r0, 0x58 + adds r0, r4 + movs r1, 0xB + strb r1, [r0] + adds r4, 0x1 +_08069A02: + movs r1, 0x9E + lsls r1, 1 + adds r0, r5, r1 + ldr r0, [r0] + bl sub_8094450 + cmp r0, 0 + bne _08069A38 + ldrb r0, [r5, 0x7] + cmp r0, 0 + beq _08069A2C + adds r0, r6, 0 + adds r0, 0x58 + adds r0, r4 + movs r1, 0x13 + b _08069A34 + .align 2, 0 +_08069A24: .4byte gUnknown_203B418 +_08069A28: .4byte 0x00000676 +_08069A2C: + adds r0, r6, 0 + adds r0, 0x58 + adds r0, r4 + movs r1, 0x3B +_08069A34: + strb r1, [r0] + adds r4, 0x1 +_08069A38: + mov r2, r8 + ldr r0, [r2, 0x70] + movs r7, 0x82 + lsls r7, 1 + adds r2, r0, r7 + ldr r0, [r2] + cmp r0, 0x1 + ble _08069A54 + adds r0, r6, 0 + adds r0, 0x58 + adds r0, r4 + movs r1, 0x1B + strb r1, [r0] + adds r4, 0x1 +_08069A54: + ldr r0, [r2] + cmp r0, 0 + bgt _08069A66 + adds r0, r6, 0 + adds r0, 0x58 + adds r0, r4 + movs r1, 0x28 + strb r1, [r0] + adds r4, 0x1 +_08069A66: + ldr r0, [r5, 0x2C] + cmp r0, 0xFF + ble _08069AAE + ldr r0, [r5, 0x30] + cmp r0, 0xFF + ble _08069AAE + ldr r0, [r5, 0x34] + cmp r0, 0xFF + ble _08069AAE + ldr r0, [r5, 0x38] + cmp r0, 0xFF + ble _08069AAE + movs r1, 0x1C + ldrsh r0, [r5, r1] + cmp r0, 0x9 + ble _08069AAE + movs r2, 0x1E + ldrsh r0, [r5, r2] + cmp r0, 0x9 + ble _08069AAE + movs r7, 0x20 + ldrsh r0, [r5, r7] + cmp r0, 0x9 + ble _08069AAE + movs r1, 0x22 + ldrsh r0, [r5, r1] + cmp r0, 0x9 + ble _08069AAE + movs r2, 0x24 + ldrsh r0, [r5, r2] + cmp r0, 0x9 + ble _08069AAE + movs r7, 0x26 + ldrsh r0, [r5, r7] + cmp r0, 0x9 + bgt _08069ABA +_08069AAE: + adds r0, r6, 0 + adds r0, 0x58 + adds r0, r4 + movs r1, 0x37 + strb r1, [r0] + adds r4, 0x1 +_08069ABA: + adds r0, r5, 0 + adds r0, 0xA8 + ldrb r1, [r0] + cmp r1, 0 + beq _08069AD2 + cmp r4, 0xB + bgt _08069AD2 + adds r0, r6, 0 + adds r0, 0x58 + adds r0, r4 + strb r1, [r0] + adds r4, 0x1 +_08069AD2: + adds r0, r5, 0 + adds r0, 0xAC + ldrb r1, [r0] + cmp r1, 0 + beq _08069AEC + cmp r4, 0xB + bgt _08069AEC + adds r0, r6, 0 + adds r0, 0x58 + adds r0, r4 + adds r1, 0x6 + strb r1, [r0] + adds r4, 0x1 +_08069AEC: + adds r0, r5, 0 + adds r0, 0xB0 + ldrb r1, [r0] + cmp r1, 0 + beq _08069B06 + cmp r4, 0xB + bgt _08069B06 + adds r0, r6, 0 + adds r0, 0x58 + adds r0, r4 + adds r1, 0xB + strb r1, [r0] + adds r4, 0x1 +_08069B06: + adds r0, r5, 0 + adds r0, 0xBC + ldrb r1, [r0] + cmp r1, 0 + beq _08069B20 + cmp r4, 0xB + bgt _08069B20 + adds r0, r6, 0 + adds r0, 0x58 + adds r0, r4 + adds r1, 0x13 + strb r1, [r0] + adds r4, 0x1 +_08069B20: + adds r0, r5, 0 + adds r0, 0xC0 + ldrb r1, [r0] + cmp r1, 0 + beq _08069B3A + cmp r4, 0xB + bgt _08069B3A + adds r0, r6, 0 + adds r0, 0x58 + adds r0, r4 + adds r1, 0x1B + strb r1, [r0] + adds r4, 0x1 +_08069B3A: + adds r0, r5, 0 + adds r0, 0xC4 + ldrb r1, [r0] + cmp r1, 0 + beq _08069B54 + cmp r4, 0xB + bgt _08069B54 + adds r0, r6, 0 + adds r0, 0x58 + adds r0, r4 + adds r1, 0x28 + strb r1, [r0] + adds r4, 0x1 +_08069B54: + adds r0, r5, 0 + adds r0, 0xC8 + ldrb r1, [r0] + cmp r1, 0 + beq _08069B6E + cmp r4, 0xB + bgt _08069B6E + adds r0, r6, 0 + adds r0, 0x58 + adds r0, r4 + adds r1, 0x37 + strb r1, [r0] + adds r4, 0x1 +_08069B6E: + adds r0, r5, 0 + adds r0, 0xD0 + ldrb r1, [r0] + cmp r1, 0 + beq _08069B88 + cmp r4, 0xB + bgt _08069B88 + adds r0, r6, 0 + adds r0, 0x58 + adds r0, r4 + adds r1, 0x3B + strb r1, [r0] + adds r4, 0x1 +_08069B88: + adds r0, r5, 0 + adds r0, 0xDC + ldrb r1, [r0] + cmp r1, 0 + beq _08069BA2 + cmp r4, 0xB + bgt _08069BA2 + adds r0, r6, 0 + adds r0, 0x58 + adds r0, r4 + adds r1, 0x3E + strb r1, [r0] + adds r4, 0x1 +_08069BA2: + adds r0, r5, 0 + adds r0, 0xE0 + ldrb r1, [r0] + cmp r1, 0 + beq _08069BBC + cmp r4, 0xB + bgt _08069BBC + adds r0, r6, 0 + adds r0, 0x58 + adds r0, r4 + adds r1, 0x43 + strb r1, [r0] + adds r4, 0x1 +_08069BBC: + adds r0, r5, 0 + adds r0, 0xE4 + ldrb r1, [r0] + cmp r1, 0 + beq _08069BD6 + cmp r4, 0xB + bgt _08069BD6 + adds r0, r6, 0 + adds r0, 0x58 + adds r0, r4 + adds r1, 0x46 + strb r1, [r0] + adds r4, 0x1 +_08069BD6: + adds r0, r5, 0 + adds r0, 0xE8 + ldrb r1, [r0] + cmp r1, 0 + beq _08069BF0 + cmp r4, 0xB + bgt _08069BF0 + adds r0, r6, 0 + adds r0, 0x58 + adds r0, r4 + adds r1, 0x4A + strb r1, [r0] + adds r4, 0x1 +_08069BF0: + adds r0, r5, 0 + adds r0, 0xEC + ldrb r1, [r0] + cmp r1, 0 + beq _08069C0A + cmp r4, 0xB + bgt _08069C0A + adds r0, r6, 0 + adds r0, 0x58 + adds r0, r4 + adds r1, 0x4E + strb r1, [r0] + adds r4, 0x1 +_08069C0A: + movs r1, 0x89 + lsls r1, 1 + adds r0, r5, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08069C26 + cmp r4, 0xB + bgt _08069C26 + adds r0, r6, 0 + adds r0, 0x58 + adds r0, r4 + movs r1, 0x50 + strb r1, [r0] + adds r4, 0x1 +_08069C26: + adds r0, r5, 0 + adds r0, 0xF0 + ldrb r0, [r0] + cmp r0, 0 + beq _08069C40 + cmp r4, 0xB + bgt _08069C40 + adds r0, r6, 0 + adds r0, 0x58 + adds r0, r4 + movs r1, 0x51 + strb r1, [r0] + adds r4, 0x1 +_08069C40: + adds r0, r5, 0 + adds r0, 0xF1 + ldrb r0, [r0] + cmp r0, 0 + beq _08069C5A + cmp r4, 0xB + bgt _08069C5A + adds r0, r6, 0 + adds r0, 0x58 + adds r0, r4 + movs r1, 0x52 + strb r1, [r0] + adds r4, 0x1 +_08069C5A: + adds r0, r5, 0 + adds r0, 0xF4 + ldrb r0, [r0] + cmp r0, 0 + beq _08069C74 + cmp r4, 0xB + bgt _08069C74 + adds r0, r6, 0 + adds r0, 0x58 + adds r0, r4 + movs r1, 0x53 + strb r1, [r0] + adds r4, 0x1 +_08069C74: + adds r0, r5, 0 + adds r0, 0xF5 + ldrb r0, [r0] + cmp r0, 0 + beq _08069C8E + cmp r4, 0xB + bgt _08069C8E + adds r0, r6, 0 + adds r0, 0x58 + adds r0, r4 + movs r1, 0x54 + strb r1, [r0] + adds r4, 0x1 +_08069C8E: + mov r0, r8 + bl sub_8071494 + lsls r0, 24 + cmp r0, 0 + beq _08069CAA + cmp r4, 0xB + bgt _08069CAA + adds r0, r6, 0 + adds r0, 0x58 + adds r0, r4 + movs r1, 0x55 + strb r1, [r0] + adds r4, 0x1 +_08069CAA: + adds r0, r5, 0 + adds r0, 0xFD + ldrb r0, [r0] + cmp r0, 0 + beq _08069CC4 + cmp r4, 0xB + bgt _08069CC4 + adds r0, r6, 0 + adds r0, 0x58 + adds r0, r4 + movs r1, 0x56 + strb r1, [r0] + adds r4, 0x1 +_08069CC4: + mov r0, r8 + movs r1, 0 + bl sub_8070828 + cmp r0, 0x1 + ble _08069CE0 + cmp r4, 0xB + bgt _08069CE0 + adds r0, r6, 0 + adds r0, 0x58 + adds r0, r4 + movs r1, 0x57 + strb r1, [r0] + adds r4, 0x1 +_08069CE0: + adds r0, r5, 0 + adds r0, 0xF2 + ldrb r0, [r0] + cmp r0, 0 + beq _08069CFA + cmp r4, 0xB + bgt _08069D0E + adds r0, r6, 0 + adds r0, 0x58 + adds r0, r4 + movs r1, 0x58 + strb r1, [r0] + adds r4, 0x1 +_08069CFA: + cmp r4, 0xB + bgt _08069D0E + adds r1, r6, 0 + adds r1, 0x58 + movs r2, 0 +_08069D04: + adds r0, r1, r4 + strb r2, [r0] + adds r4, 0x1 + cmp r4, 0xB + ble _08069D04 +_08069D0E: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8069844 + + thumb_func_start sub_8069D18 +sub_8069D18: + push {r4,r5,lr} + ldr r3, [r1, 0x70] + ldr r4, _08069D48 + adds r3, 0x46 + ldrb r2, [r3] + lsls r2, 2 + adds r2, r4 + ldrh r2, [r2] + ldrh r5, [r1, 0x4] + adds r2, r5 + strh r2, [r0] + ldrb r2, [r3] + lsls r2, 2 + adds r2, r4 + ldrh r2, [r2, 0x2] + ldrh r1, [r1, 0x6] + adds r2, r1 + strh r2, [r0, 0x2] + ldrb r1, [r3] + movs r0, 0x1 + ands r0, r1 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08069D48: .4byte gUnknown_80F4448 + thumb_func_end sub_8069D18 + + thumb_func_start sub_8069D4C +sub_8069D4C: + push {r4-r6,lr} + sub sp, 0xC + adds r5, r0, 0 + ldr r4, [r1, 0x70] + ldrh r0, [r4, 0x2] + strh r0, [r5] + ldr r0, [r1, 0x4] + str r0, [r5, 0x4] + adds r0, r4, 0 + adds r0, 0xF7 + ldrb r0, [r0] + cmp r0, 0 + beq _08069D6A + ldrh r0, [r4, 0x12] + b _08069D6C +_08069D6A: + ldrh r0, [r4, 0x10] +_08069D6C: + strh r0, [r5, 0x8] + ldrb r0, [r4, 0x9] + strh r0, [r5, 0xE] + movs r0, 0x2 + ldrsh r1, [r4, r0] + ldrb r2, [r4, 0x9] + mov r0, sp + bl sub_808E010 + ldr r0, [sp] + str r0, [r5, 0x10] + ldrb r0, [r4, 0x14] + strb r0, [r5, 0xA] + ldrb r0, [r4, 0x15] + strb r0, [r5, 0xB] + ldrb r0, [r4, 0x16] + strb r0, [r5, 0xC] + ldrb r0, [r4, 0x17] + strb r0, [r5, 0xD] + ldr r0, [r4, 0x60] + str r0, [r5, 0x1C] + adds r1, r5, 0 + adds r1, 0x20 + movs r2, 0x8C + lsls r2, 1 + adds r0, r4, r2 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + movs r3, 0x9E + lsls r3, 1 + adds r0, r4, r3 + ldr r0, [r0] + str r0, [r5, 0x14] + movs r6, 0xA0 + lsls r6, 1 + adds r0, r4, r6 + ldr r0, [r0] + str r0, [r5, 0x18] + ldr r0, [r4, 0x3C] + str r0, [r5, 0x44] + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8069D4C + + thumb_func_start sub_8069DCC +sub_8069DCC: + push {r4,lr} + ldr r1, [r0, 0x70] + mov r12, r1 + ldr r3, _08069E08 + mov r4, r12 + adds r4, 0x46 + ldrb r1, [r4] + lsls r1, 2 + adds r1, r3 + ldrh r1, [r1] + ldrh r2, [r0, 0x4] + adds r1, r2 + movs r2, 0xB6 + lsls r2, 1 + add r2, r12 + strh r1, [r2] + ldrb r1, [r4] + lsls r1, 2 + adds r1, r3 + ldrh r1, [r1, 0x2] + ldrh r0, [r0, 0x6] + adds r1, r0 + movs r0, 0xB7 + lsls r0, 1 + add r0, r12 + strh r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08069E08: .4byte gUnknown_80F4448 + thumb_func_end sub_8069DCC + + thumb_func_start sub_8069E0C +sub_8069E0C: + push {r4-r7,lr} + adds r4, r0, 0 + ldr r5, [r4, 0x70] + movs r1, 0x25 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _08069E44 + adds r0, r4, 0 + bl sub_807E580 + ldr r1, _08069E40 + lsls r0, 24 + lsrs r0, 22 + adds r0, r1 + ldrb r1, [r0] + adds r0, r5, 0 + adds r0, 0x5C + movs r2, 0 + strb r1, [r0] + adds r0, 0x1 + strb r2, [r0] + adds r6, r5, 0 + adds r6, 0x5E + b _08069E62 + .align 2, 0 +_08069E40: .4byte gUnknown_80F520C +_08069E44: + movs r4, 0 + adds r7, r5, 0 + adds r7, 0x5C + adds r6, r5, 0 + adds r6, 0x5E +_08069E4E: + movs r1, 0x2 + ldrsh r0, [r5, r1] + adds r1, r4, 0 + bl sub_808DC68 + adds r1, r7, r4 + strb r0, [r1] + adds r4, 0x1 + cmp r4, 0x1 + ble _08069E4E +_08069E62: + movs r4, 0 +_08069E64: + movs r1, 0x2 + ldrsh r0, [r5, r1] + adds r1, r4, 0 + bl sub_808DC84 + adds r1, r6, r4 + strb r0, [r1] + adds r4, 0x1 + cmp r4, 0x1 + ble _08069E64 + ldr r0, _08069E88 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0xC] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08069E88: .4byte gUnknown_203B418 + thumb_func_end sub_8069E0C + + thumb_func_start sub_8069E8C +sub_8069E8C: + push {r4-r7,lr} + ldr r3, _08069ED8 + ldr r2, [r3] + ldrb r0, [r2, 0xC] + cmp r0, 0 + beq _08069F44 + movs r1, 0 + strb r1, [r2, 0xC] + ldr r0, [r3] + ldr r2, _08069EDC + adds r0, r2 + strb r1, [r0] + movs r7, 0 + adds r5, r3, 0 + movs r6, 0x1 +_08069EAA: + ldr r0, [r5] + lsls r1, r7, 2 + ldr r2, _08069EE0 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08069F3E + adds r0, r4, 0 + movs r1, 0x4 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _08069EE8 + ldr r0, [r5] + ldr r1, _08069EE4 + b _08069F16 + .align 2, 0 +_08069ED8: .4byte gUnknown_203B418 +_08069EDC: .4byte 0x0000e279 +_08069EE0: .4byte 0x000135cc +_08069EE4: .4byte 0x0000e273 +_08069EE8: + adds r0, r4, 0 + movs r1, 0x1C + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _08069F04 + ldr r0, [r5] + ldr r2, _08069F00 + adds r0, r2 + b _08069F18 + .align 2, 0 +_08069F00: .4byte 0x0000e271 +_08069F04: + adds r0, r4, 0 + movs r1, 0x31 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _08069F1A + ldr r0, [r5] + ldr r1, _08069F4C +_08069F16: + adds r0, r1 +_08069F18: + strb r6, [r0] +_08069F1A: + adds r0, r4, 0 + movs r1, 0x8 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + bne _08069F36 + adds r0, r4, 0 + movs r1, 0x2D + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _08069F3E +_08069F36: + ldr r0, [r5] + ldr r2, _08069F50 + adds r0, r2 + strb r6, [r0] +_08069F3E: + adds r7, 0x1 + cmp r7, 0x13 + ble _08069EAA +_08069F44: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08069F4C: .4byte 0x0000e270 +_08069F50: .4byte 0x0000e279 + thumb_func_end sub_8069E8C + + thumb_func_start sub_8069F54 +sub_8069F54: + push {r4,r5,lr} + adds r5, r0, 0 + lsls r1, 16 + asrs r0, r1, 16 + ldr r2, _08069F88 + adds r1, r2 + lsrs r1, 16 + cmp r1, 0x3 + bhi _08069F94 + adds r0, r5, 0 + movs r1, 0x25 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _08069F90 + ldr r4, _08069F8C + adds r0, r5, 0 + bl sub_807E580 + lsls r0, 24 + lsrs r0, 22 + adds r0, r4 + movs r1, 0x2 + ldrsh r0, [r0, r1] + b _08069F94 + .align 2, 0 +_08069F88: .4byte 0xfe880000 +_08069F8C: .4byte gUnknown_80F520C +_08069F90: + movs r0, 0xBC + lsls r0, 1 +_08069F94: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8069F54 + + thumb_func_start sub_8069F9C +sub_8069F9C: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + mov r8, r0 + adds r6, r1, 0 + mov r9, r2 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08069FB8 + b _0806A0FA +_08069FB8: + adds r0, r6, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08069FC6 + b _0806A0FA +_08069FC6: + cmp r8, r6 + bne _08069FCC + b _0806A0FA +_08069FCC: + mov r0, r8 + ldr r2, [r0, 0x70] + adds r3, r2, 0 + ldr r7, [r6, 0x70] + movs r4, 0x1 + negs r4, r4 + adds r0, r7, 0 + adds r0, 0x5E + ldrb r0, [r0] + cmp r0, 0x28 + bne _08069FE4 + movs r4, 0 +_08069FE4: + adds r0, r7, 0 + adds r0, 0x5F + ldrb r0, [r0] + cmp r0, 0x28 + bne _08069FF0 + movs r4, 0x1 +_08069FF0: + cmp r4, 0 + blt _0806A068 + movs r1, 0 + adds r0, r2, 0 + adds r0, 0x5E + ldrb r2, [r0] + cmp r2, 0 + beq _0806A006 + mov r0, sp + strb r2, [r0] + movs r1, 0x1 +_0806A006: + adds r0, r3, 0 + adds r0, 0x5F + ldrb r2, [r0] + cmp r2, 0 + beq _0806A018 + mov r3, sp + adds r0, r3, r1 + strb r2, [r0] + adds r1, 0x1 +_0806A018: + cmp r1, 0 + beq _0806A068 + cmp r1, 0x1 + bne _0806A024 + movs r1, 0 + b _0806A030 +_0806A024: + adds r0, r1, 0 + bl sub_8084100 + adds r1, r0, 0 + cmp r1, 0 + blt _0806A068 +_0806A030: + adds r0, r7, 0 + adds r0, 0x5E + adds r0, r4 + add r1, sp + ldrb r1, [r1] + strb r1, [r0] + ldr r0, _0806A108 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0xC] + ldr r0, _0806A10C + adds r1, r6, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _0806A110 + ldr r2, [r0] + mov r0, r8 + adds r1, r6, 0 + bl sub_80522F4 + adds r0, r6, 0 + bl sub_8042900 + mov r0, r8 + adds r1, r6, 0 + bl sub_806ABAC +_0806A068: + movs r0, 0xAD + lsls r0, 1 + adds r1, r7, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _0806A0FA + movs r0, 0 + strb r0, [r1] + adds r0, r6, 0 + movs r1, 0x3B + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806A0FA + mov r0, r8 + mov r1, r9 + bl sub_8071A1C + lsls r0, 24 + lsrs r5, r0, 24 + mov r1, r9 + ldrh r0, [r1, 0x2] + cmp r0, 0x1F + bne _0806A0AA + mov r0, r8 + bl sub_807E580 + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0806A114 + adds r0, r1 + ldrb r5, [r0] +_0806A0AA: + cmp r5, 0 + beq _0806A0FA + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_8071858 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0806A0FA + adds r4, r7, 0 + adds r4, 0x5C + strb r5, [r4] + adds r1, r7, 0 + adds r1, 0x5D + strb r0, [r1] + adds r1, 0x99 + movs r0, 0x1 + strb r0, [r1] + ldr r0, _0806A10C + adds r1, r6, 0 + movs r2, 0 + bl sub_8045B94 + ldrb r0, [r4] + bl sub_8092334 + adds r1, r0, 0 + ldr r0, _0806A118 + bl strcpy + ldr r0, _0806A11C + ldr r2, [r0] + mov r0, r8 + adds r1, r6, 0 + bl sub_80522F4 + adds r0, r6, 0 + bl sub_8042968 +_0806A0FA: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0806A108: .4byte gUnknown_203B418 +_0806A10C: .4byte gUnknown_202DF98 +_0806A110: .4byte gUnknown_80FCC7C +_0806A114: .4byte gUnknown_80F51E4 +_0806A118: .4byte gUnknown_202DE58 +_0806A11C: .4byte gUnknown_80FCCAC + thumb_func_end sub_8069F9C + + thumb_func_start sub_806A120 +sub_806A120: + push {r4-r7,lr} + adds r7, r0, 0 + adds r6, r1, 0 + adds r4, r2, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0806A19C + adds r0, r6, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0806A19C + cmp r7, r6 + beq _0806A19C + ldr r5, [r6, 0x70] + adds r0, r5, 0 + adds r0, 0xC4 + ldrb r0, [r0] + cmp r0, 0xC + bne _0806A19C + adds r0, r7, 0 + adds r1, r4, 0 + bl sub_8071A1C + lsls r0, 24 + lsrs r0, 24 + bl sub_8092364 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _0806A19C + adds r0, r5, 0 + adds r0, 0x5C + movs r1, 0 + strb r4, [r0] + adds r0, 0x1 + strb r1, [r0] + adds r0, r6, 0 + bl sub_8041BBC + ldr r0, _0806A1A4 + adds r1, r6, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r4, 0 + bl sub_8092334 + adds r1, r0, 0 + ldr r0, _0806A1A8 + bl strcpy + ldr r0, _0806A1AC + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r6, 0 + bl sub_80522F4 +_0806A19C: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0806A1A4: .4byte gUnknown_202DF98 +_0806A1A8: .4byte gUnknown_202DE58 +_0806A1AC: .4byte gUnknown_80FDCC8 + thumb_func_end sub_806A120 + + thumb_func_start sub_806A1B0 +sub_806A1B0: + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0806A1DE + adds r0, r4, 0 + movs r1, 0x2A + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806A1DE + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_8076090 +_0806A1DE: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_806A1B0 + + thumb_func_start sub_806A1E8 +sub_806A1E8: + push {r4,r5,lr} + adds r4, r0, 0 + movs r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0806A234 + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0x1 + bne _0806A210 + ldr r0, [r4, 0x70] + movs r1, 0 + ldrb r0, [r0, 0x6] + cmp r0, 0 + bne _0806A20E + movs r1, 0x1 +_0806A20E: + adds r5, r1, 0 +_0806A210: + ldr r0, _0806A23C + ldr r0, [r0] + ldrb r0, [r0, 0x1] + cmp r0, 0 + bne _0806A21C + movs r5, 0 +_0806A21C: + cmp r5, 0 + beq _0806A234 + adds r0, r4, 0 + bl sub_8045888 + lsls r0, 24 + cmp r0, 0 + bne _0806A234 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_806A2BC +_0806A234: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0806A23C: .4byte gUnknown_203B46C + thumb_func_end sub_806A1E8 + + thumb_func_start sub_806A240 +sub_806A240: + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r6, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0806A2B4 + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0x1 + bne _0806A26A + ldr r0, [r4, 0x70] + movs r1, 0 + ldrb r0, [r0, 0x6] + cmp r0, 0 + bne _0806A268 + movs r1, 0x1 +_0806A268: + adds r6, r1, 0 +_0806A26A: + cmp r6, 0 + beq _0806A284 + adds r0, r4, 0 + bl sub_8045888 + lsls r0, 24 + cmp r0, 0 + bne _0806A284 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_806A2BC + b _0806A2B4 +_0806A284: + adds r0, r5, 0 + bl sub_80450F8 + cmp r0, 0x1 + bne _0806A29C + ldr r0, [r5, 0x70] + movs r1, 0 + ldrb r0, [r0, 0x6] + cmp r0, 0 + bne _0806A29A + movs r1, 0x1 +_0806A29A: + adds r6, r1, 0 +_0806A29C: + cmp r6, 0 + beq _0806A2B4 + adds r0, r5, 0 + bl sub_8045888 + lsls r0, 24 + cmp r0, 0 + bne _0806A2B4 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_806A2BC +_0806A2B4: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_806A240 + + thumb_func_start sub_806A2BC +sub_806A2BC: + push {r4-r7,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r6, r1, 24 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0806A328 + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0x1 + bne _0806A328 + ldr r5, _0806A2F4 + ldr r0, [r5] + ldr r1, _0806A2F8 + adds r0, r1 + ldr r0, [r0] + cmp r0, r4 + beq _0806A328 + adds r7, r4, 0x4 + cmp r6, 0 + beq _0806A30C + movs r0, 0x1 + bl sub_804178C + b _0806A302 + .align 2, 0 +_0806A2F4: .4byte gUnknown_203B418 +_0806A2F8: .4byte 0x000181f8 +_0806A2FC: + movs r0, 0x34 + bl sub_803E46C +_0806A302: + ldr r0, [r5] + movs r1, 0x12 + ldrsh r0, [r0, r1] + cmp r0, 0x3B + ble _0806A2FC +_0806A30C: + movs r0, 0x4 + movs r1, 0x44 + bl sub_803E708 + adds r0, r4, 0 + bl sub_803F508 + adds r0, r7, 0 + bl sub_804AC20 + ldr r0, _0806A330 + ldr r1, [r0] + movs r0, 0 + strh r0, [r1, 0x12] +_0806A328: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0806A330: .4byte gUnknown_203B418 + thumb_func_end sub_806A2BC + + thumb_func_start nullsub_95 +nullsub_95: + bx lr + thumb_func_end nullsub_95 + + thumb_func_start sub_806A338 +sub_806A338: + push {r4-r6,lr} + movs r5, 0 + ldr r6, _0806A378 +_0806A33E: + ldr r0, [r6] + lsls r1, r5, 2 + ldr r2, _0806A37C + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0806A384 + ldr r0, [r4, 0x70] + adds r0, 0xC8 + ldrb r0, [r0] + cmp r0, 0x3 + bne _0806A384 + ldr r1, [r6] + ldr r2, _0806A380 + adds r0, r1, r2 + str r4, [r0] + ldr r0, [r4, 0x70] + adds r2, 0xC + adds r1, r2 + adds r0, 0x98 + ldr r0, [r0] + str r0, [r1] + b _0806A38A + .align 2, 0 +_0806A378: .4byte gUnknown_203B418 +_0806A37C: .4byte 0x000135cc +_0806A380: .4byte 0x00017b30 +_0806A384: + adds r5, 0x1 + cmp r5, 0x13 + ble _0806A33E +_0806A38A: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_806A338 + + thumb_func_start sub_806A390 +sub_806A390: + push {r4-r7,lr} + ldr r0, [r0, 0x70] + movs r7, 0 + movs r1, 0x8C + lsls r1, 1 + adds r4, r0, r1 + adds r5, r4, 0 + movs r6, 0x3 +_0806A3A0: + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0806A3C2 + ldrb r1, [r4, 0x1] + movs r0, 0xF7 + ands r0, r1 + movs r1, 0xEF + ands r0, r1 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r4, 0x1] + adds r0, r5, 0 + bl sub_8092BF4 + strb r0, [r4, 0x4] +_0806A3C2: + adds r4, 0x8 + adds r5, 0x8 + subs r6, 0x1 + cmp r6, 0 + bge _0806A3A0 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_806A390 + + thumb_func_start sub_806A3D4 +sub_806A3D4: + push {r4-r7,lr} + sub sp, 0xC + adds r7, r0, 0 + adds r6, r2, 0 + lsls r1, 16 + asrs r5, r1, 16 + lsls r3, 24 + cmp r3, 0 + beq _0806A404 + ldr r4, _0806A400 + adds r0, r5, 0 + movs r1, 0xA + bl __divsi3 + adds r2, r0, 0 + lsls r2, 16 + asrs r2, 16 + mov r0, sp + adds r1, r4, 0 + bl sprintf + b _0806A41C + .align 2, 0 +_0806A400: .4byte gUnknown_8106EA8 +_0806A404: + ldr r4, _0806A450 + adds r0, r5, 0 + movs r1, 0xA + bl __divsi3 + adds r2, r0, 0 + lsls r2, 16 + asrs r2, 16 + mov r0, sp + adds r1, r4, 0 + bl sprintf +_0806A41C: + ldr r1, _0806A454 + mov r0, sp + bl sub_800A9EC + adds r4, r0, 0 + adds r0, r5, 0 + movs r1, 0xA + bl __modsi3 + lsls r0, 16 + ldr r1, [r4, 0x4] + asrs r0, 12 + adds r0, r1 + lsls r1, r6, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r7, 0 + bl strcpy + adds r0, r4, 0 + bl sub_800AA14 + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0806A450: .4byte gUnknown_8106EB0 +_0806A454: .4byte gUnknown_83B0000 + thumb_func_end sub_806A3D4 + + thumb_func_start sub_806A458 +sub_806A458: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r6, r0, 0 + movs r0, 0 + mov r9, r0 + ldr r0, [r6, 0x70] + ldrb r0, [r0, 0x6] + mov r10, r0 + adds r0, r6, 0 + bl sub_80696A8 + cmp r0, 0 + bne _0806A47C + movs r0, 0 + b _0806A4CC +_0806A47C: + movs r7, 0x1 + negs r7, r7 +_0806A480: + movs r5, 0x1 + negs r5, r5 + adds r1, r7, 0x1 + mov r8, r1 +_0806A488: + movs r2, 0x4 + ldrsh r0, [r6, r2] + adds r0, r5 + movs r2, 0x6 + ldrsh r1, [r6, r2] + adds r1, r7 + bl sub_8049590 + adds r4, r0, 0 + ldr r0, [r4, 0x10] + cmp r0, 0 + beq _0806A4B6 + bl sub_80450F8 + cmp r0, 0x1 + bne _0806A4B6 + ldr r0, [r4, 0x10] + ldr r0, [r0, 0x70] + ldrb r0, [r0, 0x6] + cmp r0, r10 + beq _0806A4B6 + movs r0, 0x1 + add r9, r0 +_0806A4B6: + adds r5, 0x1 + cmp r5, 0x1 + ble _0806A488 + mov r7, r8 + cmp r7, 0x1 + ble _0806A480 + movs r0, 0 + mov r1, r9 + cmp r1, 0x1 + ble _0806A4CC + movs r0, 0x1 +_0806A4CC: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_806A458 + + thumb_func_start sub_806A4DC +sub_806A4DC: + push {r4,lr} + sub sp, 0x64 + adds r4, r0, 0 + ldr r1, _0806A530 + ldr r0, [sp, 0x60] + ands r0, r1 + ldr r1, _0806A534 + ands r0, r1 + movs r1, 0x80 + lsls r1, 1 + orrs r0, r1 + str r0, [sp, 0x60] + movs r0, 0x2 + ldrsh r1, [r4, r0] + add r0, sp, 0x60 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + add r0, sp, 0x8 + movs r2, 0 + movs r3, 0 + bl sub_808CFD0 + add r1, sp, 0x8 + ldrh r0, [r4, 0x2] + strh r0, [r1, 0x8] + ldrb r0, [r4, 0x9] + strb r0, [r1, 0x3] + ldrh r0, [r4, 0xC] + strh r0, [r1, 0x14] + ldrb r0, [r4, 0x14] + strb r0, [r1, 0x18] + ldrb r0, [r4, 0x16] + strb r0, [r1, 0x1A] + adds r0, r1, 0 + bl sub_808F700 + add sp, 0x64 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0806A530: .4byte 0xffffff00 +_0806A534: .4byte 0xffff00ff + thumb_func_end sub_806A4DC + + thumb_func_start sub_806A538 +sub_806A538: + push {lr} + lsls r0, 16 + asrs r1, r0, 16 + adds r2, r1, 0 + ldr r0, _0806A554 + cmp r1, r0 + beq _0806A550 + ldr r0, _0806A558 + cmp r1, r0 + beq _0806A550 + cmp r2, 0 + bge _0806A55C +_0806A550: + movs r0, 0x1 + b _0806A55E + .align 2, 0 +_0806A554: .4byte 0x000055aa +_0806A558: .4byte 0x00005aa5 +_0806A55C: + movs r0, 0 +_0806A55E: + pop {r1} + bx r1 + thumb_func_end sub_806A538 + + thumb_func_start sub_806A564 +sub_806A564: + push {lr} + lsls r0, 16 + asrs r1, r0, 16 + ldr r0, _0806A57C + cmp r1, r0 + beq _0806A584 + ldr r0, _0806A580 + cmp r1, r0 + beq _0806A584 + movs r0, 0 + b _0806A586 + .align 2, 0 +_0806A57C: .4byte 0x000055aa +_0806A580: .4byte 0x00005aa5 +_0806A584: + movs r0, 0x1 +_0806A586: + pop {r1} + bx r1 + thumb_func_end sub_806A564 + + thumb_func_start sub_806A58C +sub_806A58C: + push {lr} + lsls r0, 16 + movs r1, 0xCE + lsls r1, 17 + cmp r0, r1 + bls _0806A59C + movs r0, 0 + b _0806A59E +_0806A59C: + movs r0, 0x1 +_0806A59E: + pop {r1} + bx r1 + thumb_func_end sub_806A58C + + thumb_func_start sub_806A5A4 +sub_806A5A4: + push {lr} + lsls r0, 16 + cmp r0, 0 + blt _0806A5B0 + movs r0, 0 + b _0806A5B2 +_0806A5B0: + movs r0, 0x1 +_0806A5B2: + pop {r1} + bx r1 + thumb_func_end sub_806A5A4 + + thumb_func_start sub_806A5B8 +sub_806A5B8: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r6, r0, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _0806A5CE + b _0806A6D2 +_0806A5CE: + adds r0, r6, 0 + bl sub_8045128 + ldrh r0, [r0] + movs r1, 0x3 + ands r1, r0 + cmp r1, 0x2 + bne _0806A664 + ldr r4, [r6, 0x70] + ldr r1, _0806A640 + ldr r0, _0806A644 + ldr r0, [r0] + ldr r2, _0806A648 + adds r0, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0806A650 + adds r0, r4, 0 + adds r0, 0xB0 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0806A608 + adds r0, r6, 0 + adds r1, r6, 0 + bl sub_807A324 +_0806A608: + movs r1, 0x2 + ldrsh r0, [r4, r1] + bl sub_808DB14 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + beq _0806A6D2 + movs r2, 0x2 + ldrsh r1, [r4, r2] + ldr r0, _0806A64C + cmp r1, r0 + beq _0806A6D2 + cmp r1, 0x92 + beq _0806A6D2 + adds r0, r4, 0 + adds r0, 0xAC + ldrb r0, [r0] + cmp r0, 0x1 + beq _0806A6D2 + adds r0, r6, 0 + adds r1, r6, 0 + movs r2, 0x1 + movs r3, 0 + bl sub_8076210 + b _0806A6D2 + .align 2, 0 +_0806A640: .4byte gUnknown_810ACC0 +_0806A644: .4byte gUnknown_203B418 +_0806A648: .4byte 0x00003a0e +_0806A64C: .4byte 0x00000113 +_0806A650: + adds r0, r4, 0 + adds r0, 0xAC + ldrb r0, [r0] + cmp r0, 0x1 + bne _0806A6D2 + adds r0, r6, 0 + adds r1, r6, 0 + bl sub_807A290 + b _0806A6D2 +_0806A664: + cmp r1, 0 + bne _0806A6D2 + ldr r7, [r6, 0x70] + ldrb r0, [r7, 0x7] + cmp r0, 0 + beq _0806A6D2 + movs r0, 0x9E + lsls r0, 1 + adds r4, r7, r0 + ldr r5, [r4] + mov r0, sp + adds r1, r5, 0 + movs r2, 0x5 + bl sub_80942C0 + ldr r0, [sp] + str r0, [r4] + movs r1, 0 + mov r8, r1 + adds r0, r5, 0 + bl sub_8094450 + cmp r0, 0x13 + ble _0806A6A4 + ldr r0, [r4] + bl sub_8094450 + cmp r0, 0x13 + bgt _0806A6A4 + ldr r0, _0806A6E0 + ldr r0, [r0] + mov r8, r0 +_0806A6A4: + adds r0, r5, 0 + bl sub_8094450 + cmp r0, 0x9 + ble _0806A6C4 + movs r2, 0x9E + lsls r2, 1 + adds r0, r7, r2 + ldr r0, [r0] + bl sub_8094450 + cmp r0, 0x9 + bgt _0806A6C4 + ldr r0, _0806A6E4 + ldr r0, [r0] + mov r8, r0 +_0806A6C4: + mov r0, r8 + cmp r0, 0 + beq _0806A6D2 + adds r0, r6, 0 + mov r1, r8 + bl sub_80522A8 +_0806A6D2: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0806A6E0: .4byte gUnknown_80FD594 +_0806A6E4: .4byte gUnknown_80FD5B8 + thumb_func_end sub_806A5B8 + + thumb_func_start sub_806A6E8 +sub_806A6E8: + push {r4-r7,lr} + sub sp, 0xC + adds r7, r0, 0 + ldr r6, [r7, 0x70] + adds r0, r6, 0 + adds r0, 0x64 + adds r1, r6, 0 + adds r1, 0x62 + ldrb r2, [r0] + ldrb r1, [r1] + cmp r2, r1 + beq _0806A77A + ldrb r0, [r6, 0x7] + cmp r0, 0 + bne _0806A764 + cmp r1, 0xA + beq _0806A70E + cmp r1, 0x2B + bne _0806A72E +_0806A70E: + movs r0, 0x9E + lsls r0, 1 + adds r5, r6, r0 + ldr r4, [r5] + mov r0, sp + movs r1, 0xA + bl sub_80943A0 + ldr r2, [sp] + add r0, sp, 0x4 + adds r1, r4, 0 + bl sub_80942C0 + ldr r0, [sp, 0x4] + str r0, [r5] + b _0806A744 +_0806A72E: + cmp r1, 0x1B + bne _0806A744 + add r0, sp, 0x8 + movs r1, 0 + bl sub_80943A0 + movs r0, 0x9E + lsls r0, 1 + adds r1, r6, r0 + ldr r0, [sp, 0x8] + str r0, [r1] +_0806A744: + ldr r0, _0806A75C + ldr r0, [r0] + ldr r1, _0806A760 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0806A776 + adds r0, r7, 0 + bl sub_80418D4 + b _0806A776 + .align 2, 0 +_0806A75C: .4byte gUnknown_203B418 +_0806A760: .4byte 0x00000676 +_0806A764: + cmp r1, 0x11 + beq _0806A76C + cmp r2, 0x11 + bne _0806A776 +_0806A76C: + movs r0, 0x1 + bl sub_803F580 + bl sub_8040A84 +_0806A776: + bl sub_807AA30 +_0806A77A: + adds r0, r6, 0 + adds r0, 0x60 + ldrb r0, [r0] + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0806A792 + adds r0, r6, 0 + adds r0, 0x62 + ldrb r1, [r0] + adds r0, 0x2 + b _0806A796 +_0806A792: + adds r0, r6, 0 + adds r0, 0x64 +_0806A796: + strb r1, [r0] + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_806A6E8 + + thumb_func_start sub_806A7A0 +sub_806A7A0: + push {r4,r5,lr} + movs r5, 0 +_0806A7A4: + ldr r0, _0806A7E0 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _0806A7E4 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0806A7D2 + ldr r2, [r4, 0x70] + movs r1, 0xC + ldrsh r0, [r2, r1] + cmp r0, 0x1 + ble _0806A7D2 + adds r1, r0, 0 + subs r1, 0x1 + adds r0, r2, 0 + bl sub_806A7E8 +_0806A7D2: + adds r5, 0x1 + cmp r5, 0x3 + ble _0806A7A4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0806A7E0: .4byte gUnknown_203B418 +_0806A7E4: .4byte 0x0001357c + thumb_func_end sub_806A7A0 + + thumb_func_start sub_806A7E8 +sub_806A7E8: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x30 + adds r5, r0, 0 + mov r0, sp + bl sub_808EBA8 + mov r9, r0 + add r4, sp, 0x18 + movs r0, 0xC + ldrsh r1, [r5, r0] + adds r0, r4, 0 + bl sub_808EBA8 + adds r6, r0, 0 + ldr r0, _0806A828 + adds r1, r5, 0 + movs r2, 0 + bl sub_80708B4 + movs r2, 0x1 + mov r8, r4 +_0806A818: + movs r3, 0 + movs r5, 0 + movs r1, 0 + adds r4, r2, 0x1 + cmp r3, r9 + bge _0806A83E + mov r0, sp + b _0806A836 + .align 2, 0 +_0806A828: .4byte gUnknown_202DF98 +_0806A82C: + adds r1, 0x1 + cmp r1, r9 + bge _0806A83E + mov r7, sp + adds r0, r7, r1 +_0806A836: + ldrb r0, [r0] + cmp r0, r2 + bne _0806A82C + movs r3, 0x1 +_0806A83E: + movs r1, 0 + cmp r1, r6 + bge _0806A85C + mov r7, r8 + ldrb r0, [r7] + b _0806A856 +_0806A84A: + adds r1, 0x1 + cmp r1, r6 + bge _0806A85C + mov r7, r8 + adds r0, r7, r1 + ldrb r0, [r0] +_0806A856: + cmp r0, r2 + bne _0806A84A + movs r5, 0x1 +_0806A85C: + cmp r3, r5 + beq _0806A87A + lsls r0, r2, 24 + lsrs r0, 24 + bl sub_808EAB0 + adds r1, r0, 0 + ldr r0, _0806A890 + bl strcpy + ldr r0, _0806A894 + ldr r1, [r0] + movs r0, 0 + bl sub_805239C +_0806A87A: + adds r2, r4, 0 + cmp r2, 0x17 + ble _0806A818 + add sp, 0x30 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0806A890: .4byte gUnknown_202DE58 +_0806A894: .4byte gUnknown_80FEAC4 + thumb_func_end sub_806A7E8 + + thumb_func_start sub_806A898 +sub_806A898: + push {r4-r7,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r1, r2, 24 + ldr r5, [r4, 0x70] + ldrb r0, [r5, 0x7] + cmp r0, 0 + beq _0806A8C2 + ldrh r1, [r4, 0x4] + movs r2, 0xB6 + lsls r2, 1 + adds r0, r5, r2 + strh r1, [r0] + ldrh r0, [r4, 0x6] + adds r0, 0x1 + adds r2, 0x2 + adds r1, r5, r2 + strh r0, [r1] + b _0806A8C8 +_0806A8C2: + adds r0, r4, 0 + bl sub_807ADB8 +_0806A8C8: + movs r0, 0xB6 + lsls r0, 1 + adds r6, r5, r0 + ldr r0, [r6] + cmp r0, 0 + beq _0806A90E + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8070B6C + lsls r0, 24 + cmp r0, 0 + beq _0806A8EE + adds r0, r4, 0 + bl sub_8070CD0 + lsls r0, 24 + cmp r0, 0 + bne _0806A90E +_0806A8EE: + adds r0, r4, 0x4 + adds r1, r6, 0 + bl sub_80983D8 + adds r2, r0, 0 + movs r1, 0x7 + ands r0, r1 + adds r1, r5, 0 + adds r1, 0x46 + strb r0, [r1] + cmp r7, 0 + beq _0806A90E + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_806CE68 +_0806A90E: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_806A898 + + thumb_func_start sub_806A914 +sub_806A914: + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + lsls r1, 24 + lsrs r7, r1, 24 + lsls r2, 24 + lsrs r6, r2, 24 + movs r5, 0 +_0806A92A: + ldr r0, _0806A96C + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _0806A970 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0806A95C + ldr r0, [r4, 0x70] + cmp r7, 0 + beq _0806A952 + adds r0, 0xA4 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0806A95C +_0806A952: + adds r0, r4, 0 + mov r1, r8 + adds r2, r6, 0 + bl sub_806A898 +_0806A95C: + adds r5, 0x1 + cmp r5, 0x13 + ble _0806A92A + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0806A96C: .4byte gUnknown_203B418 +_0806A970: .4byte 0x000135cc + thumb_func_end sub_806A914 + + thumb_func_start sub_806A974 +sub_806A974: + push {r4,r5,lr} + movs r5, 0 +_0806A978: + ldr r0, _0806A9AC + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _0806A9B0 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0806A99E + ldr r0, [r4, 0x70] + adds r0, 0x46 + ldrb r1, [r0] + adds r0, r4, 0 + bl sub_806CE68 +_0806A99E: + adds r5, 0x1 + cmp r5, 0x13 + ble _0806A978 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0806A9AC: .4byte gUnknown_203B418 +_0806A9B0: .4byte 0x000135cc + thumb_func_end sub_806A974 + + thumb_func_start sub_806A9B4 +sub_806A9B4: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0806AA02 + ldr r0, [r4, 0x70] + movs r1, 0x8C + lsls r1, 1 + adds r0, r1 + adds r1, r5, 0 + bl sub_80935B8 + cmp r0, 0 + bne _0806A9E0 + ldr r0, _0806A9DC + b _0806A9E6 + .align 2, 0 +_0806A9DC: .4byte gUnknown_81002FC +_0806A9E0: + cmp r0, 0x1 + bne _0806A9F4 + ldr r0, _0806A9F0 +_0806A9E6: + ldr r1, [r0] + adds r0, r4, 0 + bl sub_80522A8 + b _0806AA02 + .align 2, 0 +_0806A9F0: .4byte gUnknown_810035C +_0806A9F4: + cmp r0, 0x2 + bne _0806AA02 + ldr r0, _0806AA08 + ldr r1, [r0] + adds r0, r4, 0 + bl sub_80522A8 +_0806AA02: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0806AA08: .4byte gUnknown_81003BC + thumb_func_end sub_806A9B4 + + thumb_func_start sub_806AA0C +sub_806AA0C: + push {r4,r5,lr} + lsls r0, 16 + asrs r4, r0, 16 + lsls r1, 24 + lsrs r5, r1, 24 + adds r0, r4, 0 + bl sub_80981DC + lsls r0, 24 + cmp r0, 0 + beq _0806AA56 + ldr r0, _0806AA5C + ldr r0, [r0] + ldr r1, _0806AA60 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0806AA40 + adds r0, r4, 0 + bl sub_808E770 + lsls r0, 16 + movs r1, 0xCF + lsls r1, 17 + cmp r0, r1 + beq _0806AA56 +_0806AA40: + cmp r4, 0x97 + bne _0806AA68 + ldr r0, _0806AA5C + ldr r0, [r0] + ldr r1, _0806AA64 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0806AA56 + cmp r5, 0 + bne _0806AA68 +_0806AA56: + movs r0, 0 + b _0806AA6A + .align 2, 0 +_0806AA5C: .4byte gUnknown_203B418 +_0806AA60: .4byte 0x000037fd +_0806AA64: .4byte 0x000037ff +_0806AA68: + movs r0, 0x1 +_0806AA6A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_806AA0C + + thumb_func_start sub_806AA70 +sub_806AA70: + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r7, 0 + ldr r0, _0806AAB4 + mov r8, r0 +_0806AA7C: + mov r1, r8 + ldr r0, [r1] + lsls r1, r7, 2 + ldr r2, _0806AAB8 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0806AB12 + ldr r0, [r4, 0x70] + ldrb r2, [r0, 0xA] + ldrb r0, [r0, 0x7] + cmp r0, 0 + beq _0806AAC4 + mov r1, r8 + ldr r0, [r1] + ldrb r0, [r0, 0x11] + cmp r0, 0x1 + bne _0806AABC + adds r0, r4, 0 + bl sub_8042B20 + b _0806AB0A + .align 2, 0 +_0806AAB4: .4byte gUnknown_203B418 +_0806AAB8: .4byte 0x0001357c +_0806AABC: + adds r0, r4, 0 + bl sub_8042B0C + b _0806AB0A +_0806AAC4: + cmp r2, 0 + blt _0806AB12 + movs r6, 0 + ldr r1, _0806AB24 + movs r0, 0x64 + muls r0, r2 + ldr r2, _0806AB28 + adds r0, r2 + ldr r1, [r1] + adds r5, r1, r0 + mov r1, r8 + ldr r0, [r1] + ldrb r0, [r0, 0x11] + cmp r0, 0 + bne _0806AB04 + movs r2, 0xA + ldrsh r0, [r5, r2] + bl sub_806A564 + lsls r0, 24 + cmp r0, 0 + bne _0806AB04 + movs r1, 0xA + ldrsh r0, [r5, r1] + bl sub_806A58C + lsls r0, 24 + cmp r0, 0 + beq _0806AB00 + movs r6, 0x1 +_0806AB00: + cmp r6, 0 + beq _0806AB12 +_0806AB04: + adds r0, r4, 0 + bl sub_8042B0C +_0806AB0A: + adds r1, r4, 0 + adds r1, 0x20 + movs r0, 0 + strb r0, [r1] +_0806AB12: + adds r7, 0x1 + cmp r7, 0x3 + ble _0806AA7C + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0806AB24: .4byte gUnknown_203B45C +_0806AB28: .4byte 0x00008df8 + thumb_func_end sub_806AA70 + + thumb_func_start sub_806AB2C +sub_806AB2C: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r4, 0 + ldr r0, _0806ABA4 + mov r9, r0 +_0806AB3A: + mov r1, r9 + ldr r0, [r1] + lsls r1, r4, 2 + ldr r2, _0806ABA8 + adds r0, r2 + adds r0, r1 + ldr r7, [r0] + adds r0, r7, 0 + bl sub_80450E0 + lsls r0, 24 + adds r4, 0x1 + mov r8, r4 + cmp r0, 0 + beq _0806AB92 + ldr r5, [r7, 0x70] + movs r6, 0 +_0806AB5C: + mov r1, r9 + ldr r0, [r1] + lsls r1, r6, 2 + ldr r2, _0806ABA8 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0806AB8C + cmp r7, r4 + beq _0806AB8C + adds r0, r5, 0 + adds r0, 0x7C + ldrh r0, [r0] + ldrh r1, [r4, 0x26] + cmp r0, r1 + bne _0806AB8C + adds r0, r5, 0 + adds r0, 0x80 + str r4, [r0] +_0806AB8C: + adds r6, 0x1 + cmp r6, 0x13 + ble _0806AB5C +_0806AB92: + mov r4, r8 + cmp r4, 0x13 + ble _0806AB3A + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0806ABA4: .4byte gUnknown_203B418 +_0806ABA8: .4byte 0x000135cc + thumb_func_end sub_806AB2C + + thumb_func_start sub_806ABAC +sub_806ABAC: + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + ldr r5, [r4, 0x70] + adds r0, r4, 0 + movs r1, 0x16 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806ABD4 + adds r0, r5, 0 + adds r0, 0xAC + ldrb r0, [r0] + cmp r0, 0x4 + bne _0806ABD4 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_807A290 +_0806ABD4: + adds r0, r4, 0 + movs r1, 0x40 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806ABF4 + adds r0, r5, 0 + adds r0, 0xBC + ldrb r0, [r0] + cmp r0, 0x2 + bne _0806ABF4 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_807A400 +_0806ABF4: + adds r0, r4, 0 + movs r1, 0x42 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806AC14 + adds r0, r5, 0 + adds r0, 0xAC + ldrb r0, [r0] + cmp r0, 0x1 + bne _0806AC14 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_807A290 +_0806AC14: + adds r0, r4, 0 + movs r1, 0x29 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806AC34 + adds r0, r5, 0 + adds r0, 0xBC + ldrb r0, [r0] + cmp r0, 0x7 + bne _0806AC34 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_807A400 +_0806AC34: + adds r0, r4, 0 + movs r1, 0x36 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + bne _0806AC50 + adds r0, r4, 0 + movs r1, 0x49 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806AC72 +_0806AC50: + adds r0, r4, 0 + bl sub_8070B28 + lsls r0, 24 + cmp r0, 0 + bne _0806AC66 + adds r0, r5, 0 + adds r0, 0xA8 + ldrb r0, [r0] + cmp r0, 0x4 + bne _0806AC72 +_0806AC66: + adds r0, r6, 0 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_807A124 +_0806AC72: + adds r0, r4, 0 + movs r1, 0x41 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806AC92 + adds r0, r5, 0 + adds r0, 0xB0 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0806AC92 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_807A324 +_0806AC92: + adds r0, r4, 0 + movs r1, 0x45 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806ACB8 + adds r0, r5, 0 + adds r0, 0xAC + ldrb r0, [r0] + subs r0, 0x2 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _0806ACB8 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_807A290 +_0806ACB8: + adds r0, r4, 0 + movs r1, 0x25 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806ACE0 + adds r1, r5, 0 + adds r1, 0xF6 + movs r0, 0 + strb r0, [r1] + adds r0, r5, 0 + adds r0, 0xC4 + ldrb r0, [r0] + cmp r0, 0xC + bne _0806ACE0 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_807A4C8 +_0806ACE0: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_806ABAC + + thumb_func_start sub_806ACE8 +sub_806ACE8: + push {r4,r5,lr} + adds r4, r1, 0 + ldr r0, [r0, 0x70] + mov r12, r0 + movs r5, 0xEF + movs r2, 0x8C + lsls r2, 1 + add r2, r12 + movs r3, 0x3 +_0806ACFA: + ldrb r1, [r2] + adds r0, r5, 0 + ands r0, r1 + strb r0, [r2] + adds r2, 0x8 + subs r3, 0x1 + cmp r3, 0 + bge _0806ACFA + movs r2, 0x9C + lsls r2, 1 + add r2, r12 + ldrb r0, [r2] + movs r3, 0xEF + ands r3, r0 + movs r5, 0 + strb r3, [r2] + ldrh r1, [r4, 0x2] + movs r0, 0xB0 + lsls r0, 1 + cmp r1, r0 + bne _0806AD2E + movs r1, 0x10 + adds r0, r3, 0 + orrs r0, r1 + strb r0, [r2] + b _0806AD36 +_0806AD2E: + ldrb r0, [r4] + movs r1, 0x10 + orrs r0, r1 + strb r0, [r4] +_0806AD36: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_806ACE8 + + thumb_func_start sub_806AD3C +sub_806AD3C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, _0806AE1C + add sp, r4 + ldr r0, _0806AE20 + ldr r0, [r0] + ldr r1, _0806AE24 + adds r4, r0, r1 + mov r0, sp + movs r1, 0 + bl sub_803D808 + str r0, [sp, 0x200] + movs r7, 0 + cmp r7, r0 + bge _0806ADEC + mov r6, sp + adds r7, r0, 0 +_0806AD66: + adds r0, r6, 0 + bl sub_808E9B8 + strh r0, [r4] + adds r0, r6, 0 + bl sub_808E9E4 + strh r0, [r4, 0x2] + adds r0, r4, 0x4 + movs r2, 0 + ldrsh r1, [r4, r2] + movs r3, 0x2 + ldrsh r2, [r4, r3] + bl sub_8072AC8 + ldrh r0, [r4, 0x4] + cmp r0, 0 + bne _0806AD90 + movs r0, 0xB8 + lsls r0, 1 + strh r0, [r4, 0x4] +_0806AD90: + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl sub_806C444 + strh r0, [r4, 0xC] + movs r5, 0 + movs r3, 0xE + adds r3, r4 + mov r9, r3 + movs r0, 0x10 + adds r0, r4 + mov r8, r0 + movs r1, 0x14 + adds r1, r4 + mov r10, r1 +_0806ADB2: + movs r2, 0 + ldrsh r0, [r4, r2] + movs r3, 0x2 + ldrsh r1, [r4, r3] + adds r2, r5, 0 + bl sub_806C488 + mov r2, r9 + adds r1, r2, r5 + strb r0, [r1] + movs r3, 0 + ldrsh r0, [r4, r3] + movs r2, 0x2 + ldrsh r1, [r4, r2] + adds r2, r5, 0 + bl sub_806C4D4 + mov r3, r8 + adds r1, r3, r5 + strb r0, [r1] + adds r5, 0x1 + cmp r5, 0x1 + ble _0806ADB2 + mov r4, r10 + adds r6, 0x8 + subs r7, 0x1 + cmp r7, 0 + bne _0806AD66 + ldr r7, [sp, 0x200] +_0806ADEC: + cmp r7, 0x3F + bgt _0806ADFC + movs r0, 0 +_0806ADF2: + strh r0, [r4] + adds r4, 0x14 + adds r7, 0x1 + cmp r7, 0x3F + ble _0806ADF2 +_0806ADFC: + movs r7, 0 + ldr r4, _0806AE28 + ldr r3, _0806AE20 + ldr r2, _0806AE2C + movs r1, 0 +_0806AE06: + ldr r0, [r3] + adds r0, r2 + adds r0, r7 + strb r1, [r0] + adds r7, 0x1 + cmp r7, r4 + ble _0806AE06 + movs r0, 0x1 + mov r10, r0 + movs r7, 0 + b _0806AE94 + .align 2, 0 +_0806AE1C: .4byte 0xfffffdfc +_0806AE20: .4byte gUnknown_203B418 +_0806AE24: .4byte 0x00002f3c +_0806AE28: .4byte 0x000001a7 +_0806AE2C: .4byte 0x0000363c +_0806AE30: + movs r2, 0x1 + negs r2, r2 + mov r8, r2 + mov r9, r8 + ldr r3, [sp, 0x200] + cmp r3, 0 + ble _0806AE7A + mov r5, sp + adds r6, r3, 0 +_0806AE42: + adds r0, r5, 0 + bl sub_808E9B8 + lsls r0, 16 + asrs r4, r0, 16 + ldr r1, _0806AECC + ldr r0, [r1] + ldr r2, _0806AED0 + adds r0, r2 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _0806AE72 + adds r0, r5, 0 + bl sub_808E9E4 + adds r1, r0, 0 + adds r0, r4, 0 + bl sub_808DD18 + cmp r9, r0 + bge _0806AE72 + mov r9, r0 + mov r8, r4 +_0806AE72: + adds r5, 0x8 + subs r6, 0x1 + cmp r6, 0 + bne _0806AE42 +_0806AE7A: + mov r3, r8 + cmp r3, 0 + blt _0806AE9A + ldr r1, _0806AECC + ldr r0, [r1] + ldr r2, _0806AED0 + adds r0, r2 + add r0, r8 + mov r3, r10 + strb r3, [r0] + movs r0, 0x2 + add r10, r0 + adds r7, 0x1 +_0806AE94: + ldr r1, [sp, 0x200] + cmp r7, r1 + blt _0806AE30 +_0806AE9A: + movs r7, 0 + ldr r5, _0806AECC + ldr r4, _0806AED0 + movs r3, 0x1 + ldr r2, _0806AED4 +_0806AEA4: + ldr r0, [r5] + adds r0, r4 + adds r1, r0, r7 + ldrb r0, [r1] + cmp r0, 0 + bne _0806AEB2 + strb r3, [r1] +_0806AEB2: + adds r7, 0x1 + cmp r7, r2 + ble _0806AEA4 + movs r3, 0x81 + lsls r3, 2 + add sp, r3 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0806AECC: .4byte gUnknown_203B418 +_0806AED0: .4byte 0x0000363c +_0806AED4: .4byte 0x000001a7 + thumb_func_end sub_806AD3C + + thumb_func_start sub_806AED8 +sub_806AED8: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + mov r10, r0 + str r1, [sp, 0x8] + str r2, [sp, 0xC] + str r3, [sp, 0x10] + ldr r0, [sp, 0x38] + ldr r1, [sp, 0x3C] + mov r8, r1 + lsls r0, 16 + asrs r7, r0, 16 + ldr r1, _0806AF04 + ldr r0, [r1] + ldr r4, _0806AF08 + adds r6, r0, r4 + movs r3, 0 + b _0806AF7A + .align 2, 0 +_0806AF04: .4byte gUnknown_203B418 +_0806AF08: .4byte 0x00002f3c +_0806AF0C: + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, r7 + bne _0806AF6E + movs r2, 0x2 + ldrsh r0, [r6, r2] + cmp r0, r8 + bne _0806AF6E + movs r5, 0xE + adds r5, r6 + mov r8, r5 + movs r0, 0x10 + adds r0, r6 + mov r9, r0 + mov r1, r10 + adds r1, 0x20 + str r1, [sp, 0x14] + adds r5, r6, 0x4 + mov r4, r10 + movs r7, 0x3 +_0806AF34: + ldrh r1, [r5] + adds r0, r4, 0 + bl sub_8092AA8 + adds r5, 0x2 + adds r4, 0x8 + subs r7, 0x1 + cmp r7, 0 + bge _0806AF34 + ldrh r0, [r6, 0xC] + ldr r2, [sp, 0x8] + strh r0, [r2] + movs r5, 0 + mov r3, r8 + mov r2, r9 +_0806AF52: + ldr r0, [sp, 0xC] + adds r1, r0, r5 + adds r0, r3, r5 + ldrb r0, [r0] + strb r0, [r1] + ldr r0, [sp, 0x10] + adds r1, r0, r5 + adds r0, r2, r5 + ldrb r0, [r0] + strb r0, [r1] + adds r5, 0x1 + cmp r5, 0x1 + ble _0806AF52 + b _0806B084 +_0806AF6E: + adds r4, 0x14 + adds r3, 0x1 + cmp r3, 0x3F + bgt _0806AF84 + ldr r0, [r1] + adds r6, r0, r4 +_0806AF7A: + ldrh r2, [r6] + movs r5, 0 + ldrsh r0, [r6, r5] + cmp r0, 0 + bne _0806AF0C +_0806AF84: + cmp r3, 0x40 + bne _0806AFE6 + mov r0, sp + adds r1, r7, 0 + mov r2, r8 + bl sub_8072AC8 + mov r0, r10 + adds r0, 0x20 + str r0, [sp, 0x14] + mov r5, sp + mov r4, r10 + movs r6, 0x3 +_0806AF9E: + ldrh r1, [r5] + adds r0, r4, 0 + bl sub_8092AA8 + adds r5, 0x2 + adds r4, 0x8 + subs r6, 0x1 + cmp r6, 0 + bge _0806AF9E + adds r0, r7, 0 + mov r1, r8 + bl sub_806C444 + ldr r1, [sp, 0x8] + strh r0, [r1] + movs r5, 0 +_0806AFBE: + adds r0, r7, 0 + mov r1, r8 + adds r2, r5, 0 + bl sub_806C488 + ldr r2, [sp, 0xC] + adds r1, r2, r5 + strb r0, [r1] + adds r0, r7, 0 + mov r1, r8 + adds r2, r5, 0 + bl sub_806C4D4 + ldr r2, [sp, 0x10] + adds r1, r2, r5 + strb r0, [r1] + adds r5, 0x1 + cmp r5, 0x1 + ble _0806AFBE + b _0806B084 +_0806AFE6: + strh r7, [r6] + mov r5, r8 + strh r5, [r6, 0x2] + adds r4, r6, 0x4 + adds r0, r4, 0 + adds r1, r7, 0 + mov r2, r8 + bl sub_8072AC8 + movs r1, 0 + ldrsh r0, [r6, r1] + movs r2, 0x2 + ldrsh r1, [r6, r2] + bl sub_806C444 + strh r0, [r6, 0xC] + movs r5, 0 + movs r0, 0xE + adds r0, r6 + mov r8, r0 + movs r1, 0x10 + adds r1, r6 + mov r9, r1 + mov r2, r10 + adds r2, 0x20 + str r2, [sp, 0x14] +_0806B01A: + movs r1, 0 + ldrsh r0, [r6, r1] + movs r2, 0x2 + ldrsh r1, [r6, r2] + adds r2, r5, 0 + bl sub_806C488 + mov r2, r8 + adds r1, r2, r5 + strb r0, [r1] + movs r1, 0 + ldrsh r0, [r6, r1] + movs r2, 0x2 + ldrsh r1, [r6, r2] + adds r2, r5, 0 + bl sub_806C4D4 + mov r2, r9 + adds r1, r2, r5 + strb r0, [r1] + adds r5, 0x1 + cmp r5, 0x1 + ble _0806B01A + mov r5, r10 + movs r7, 0x3 +_0806B04C: + ldrh r1, [r4] + adds r0, r5, 0 + bl sub_8092AA8 + adds r4, 0x2 + adds r5, 0x8 + subs r7, 0x1 + cmp r7, 0 + bge _0806B04C + ldrh r0, [r6, 0xC] + ldr r5, [sp, 0x8] + strh r0, [r5] + movs r5, 0 + mov r3, r8 + mov r2, r9 +_0806B06A: + ldr r0, [sp, 0xC] + adds r1, r0, r5 + adds r0, r3, r5 + ldrb r0, [r0] + strb r0, [r1] + ldr r0, [sp, 0x10] + adds r1, r0, r5 + adds r0, r2, r5 + ldrb r0, [r0] + strb r0, [r1] + adds r5, 0x1 + cmp r5, 0x1 + ble _0806B06A +_0806B084: + movs r0, 0 + ldr r1, [sp, 0x14] + strb r0, [r1] + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_806AED8 + + thumb_func_start sub_806B09C +sub_806B09C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r8, r0 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + movs r7, 0 + movs r2, 0 + mov r6, r8 + adds r6, 0x2 + mov r9, r8 +_0806B0BA: + movs r0, 0x64 + muls r0, r2 + ldr r1, _0806B0E4 + adds r0, r1 + ldr r3, _0806B0E8 + ldr r1, [r3] + adds r5, r1, r0 + ldrh r1, [r5] + movs r0, 0x1 + ands r0, r1 + adds r2, 0x1 + mov r10, r2 + cmp r0, 0 + beq _0806B124 + lsrs r0, r1, 1 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0806B124 + movs r4, 0 + b _0806B0EE + .align 2, 0 +_0806B0E4: .4byte 0x00008df8 +_0806B0E8: .4byte gUnknown_203B45C +_0806B0EC: + adds r4, 0x1 +_0806B0EE: + cmp r4, r7 + bge _0806B106 + lsls r0, r4, 3 + add r0, r8 + bl sub_808E9B8 + lsls r0, 16 + asrs r0, 16 + movs r2, 0xE + ldrsh r1, [r5, r2] + cmp r0, r1 + bne _0806B0EC +_0806B106: + cmp r4, r7 + bne _0806B124 + movs r3, 0xE + ldrsh r2, [r5, r3] + mov r0, r9 + movs r1, 0 + bl sub_808E9D8 + movs r0, 0 + strh r0, [r6] + strh r0, [r6, 0x2] + adds r6, 0x8 + movs r0, 0x8 + add r9, r0 + adds r7, 0x1 +_0806B124: + mov r2, r10 + cmp r2, 0x3 + ble _0806B0BA + mov r0, r8 + adds r1, r7, 0 + bl sub_803D808 + adds r7, r0, 0 + ldr r1, [sp] + cmp r1, 0 + beq _0806B150 + lsls r4, r7, 3 + add r4, r8 + ldr r2, _0806B164 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_808E9D8 + movs r0, 0 + strh r0, [r4, 0x2] + strh r0, [r4, 0x4] + adds r7, 0x1 +_0806B150: + adds r0, r7, 0 + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0806B164: .4byte 0x000001a5 + thumb_func_end sub_806B09C + + thumb_func_start sub_806B168 +sub_806B168: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x3C + ldr r0, _0806B324 + ldr r1, [r0] + ldr r2, _0806B328 + adds r0, r1, r2 + movs r3, 0 + ldrsh r0, [r0, r3] + ldr r4, _0806B32C + adds r1, r4 + movs r2, 0 + ldrsh r1, [r1, r2] + bl sub_804954C + ldrb r0, [r0, 0x9] + str r0, [sp, 0x2C] + movs r3, 0 + mov r4, sp + adds r4, 0x1C + str r4, [sp, 0x30] + ldr r2, _0806B330 + ldr r1, _0806B334 +_0806B19C: + ldr r0, [r2] + adds r0, r1 + strh r3, [r0, 0xC] + adds r1, 0x64 + adds r3, 0x1 + cmp r3, 0x3 + ble _0806B19C + movs r4, 0 + movs r3, 0 + ldr r0, _0806B324 + mov r8, r0 + ldr r0, _0806B330 + ldr r7, [r0] + movs r5, 0x1 + add r6, sp, 0xC +_0806B1BA: + movs r0, 0x64 + muls r0, r3 + ldr r1, _0806B334 + adds r0, r1 + adds r2, r7, r0 + ldrh r1, [r2] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _0806B1DA + lsrs r0, r1, 1 + ands r0, r5 + cmp r0, 0 + beq _0806B1DA + stm r6!, {r2} + adds r4, 0x1 +_0806B1DA: + adds r3, 0x1 + cmp r3, 0x3 + ble _0806B1BA + cmp r4, 0x3 + bgt _0806B1F4 + movs r1, 0 + lsls r0, r4, 2 + add r0, sp + adds r0, 0xC +_0806B1EC: + stm r0!, {r1} + adds r4, 0x1 + cmp r4, 0x3 + ble _0806B1EC +_0806B1F4: + movs r4, 0 + movs r6, 0 + add r2, sp, 0xC + ldr r5, [sp, 0x30] + movs r3, 0x3 +_0806B1FE: + ldr r1, [r2] + cmp r1, 0 + beq _0806B210 + ldrb r0, [r1, 0x2] + cmp r0, 0 + beq _0806B210 + str r6, [r2] + stm r5!, {r1} + adds r4, 0x1 +_0806B210: + adds r2, 0x4 + subs r3, 0x1 + cmp r3, 0 + bge _0806B1FE + mov r2, r8 + ldr r0, [r2] + ldr r3, _0806B338 + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _0806B24C + movs r6, 0 + add r2, sp, 0xC + lsls r0, r4, 2 + ldr r1, [sp, 0x30] + adds r5, r0, r1 + movs r3, 0x3 +_0806B232: + ldr r1, [r2] + cmp r1, 0 + beq _0806B244 + ldrb r0, [r1, 0x4] + cmp r0, 0x41 + bne _0806B244 + str r6, [r2] + stm r5!, {r1} + adds r4, 0x1 +_0806B244: + adds r2, 0x4 + subs r3, 0x1 + cmp r3, 0 + bge _0806B232 +_0806B24C: + movs r5, 0 + add r2, sp, 0xC + lsls r0, r4, 2 + ldr r3, [sp, 0x30] + adds r0, r3 + movs r3, 0x3 +_0806B258: + ldr r1, [r2] + cmp r1, 0 + beq _0806B264 + str r5, [r2] + stm r0!, {r1} + adds r4, 0x1 +_0806B264: + adds r2, 0x4 + subs r3, 0x1 + cmp r3, 0 + bge _0806B258 + cmp r4, 0x3 + bgt _0806B280 + movs r1, 0 + lsls r0, r4, 2 + ldr r2, [sp, 0x30] + adds r0, r2 +_0806B278: + stm r0!, {r1} + adds r4, 0x1 + cmp r4, 0x3 + ble _0806B278 +_0806B280: + movs r3, 0 +_0806B282: + lsls r0, r3, 2 + ldr r4, [sp, 0x30] + adds r0, r4, r0 + ldr r0, [r0] + mov r8, r0 + adds r0, r3, 0x1 + str r0, [sp, 0x34] + mov r1, r8 + cmp r1, 0 + bne _0806B298 + b _0806B3E8 +_0806B298: + movs r2, 0xE + ldrsh r1, [r1, r2] + ldr r0, _0806B33C + cmp r1, r0 + beq _0806B2AE + adds r0, 0x2 + cmp r1, r0 + beq _0806B2AE + subs r0, 0x1 + cmp r1, r0 + bne _0806B2B6 +_0806B2AE: + movs r0, 0xBC + lsls r0, 1 + mov r4, r8 + strh r0, [r4, 0xE] +_0806B2B6: + ldr r0, _0806B340 + ldr r2, [r0] + movs r1, 0 + ldrsh r0, [r0, r1] + adds r3, 0x1 + str r3, [sp, 0x34] + ldr r3, _0806B340 + cmp r0, 0x63 + beq _0806B350 + ldr r4, _0806B324 + mov r9, r4 + ldr r0, _0806B328 + mov r10, r0 + adds r5, r3, 0 +_0806B2D2: + lsls r0, r2, 16 + asrs r7, r0, 16 + mov r4, r9 + ldr r1, [r4] + mov r4, r10 + adds r0, r1, r4 + movs r4, 0 + ldrsh r0, [r0, r4] + adds r0, r7, r0 + asrs r6, r2, 16 + ldr r2, _0806B32C + adds r1, r2 + movs r4, 0 + ldrsh r1, [r1, r4] + adds r1, r6, r1 + str r3, [sp, 0x38] + bl sub_804954C + adds r1, r0, 0 + ldrb r0, [r1, 0x9] + ldr r3, [sp, 0x38] + ldr r2, [sp, 0x2C] + cmp r0, r2 + bne _0806B344 + mov r4, r8 + movs r2, 0xE + ldrsh r0, [r4, r2] + bl sub_807034C + lsls r0, 24 + lsrs r4, r0, 24 + ldr r3, [sp, 0x38] + cmp r4, 0 + bne _0806B344 + mov r3, r8 + movs r1, 0xE + ldrsh r0, [r3, r1] + mov r3, r9 + ldr r2, [r3] + mov r3, r10 + b _0806B3A8 + .align 2, 0 +_0806B324: .4byte gUnknown_203B418 +_0806B328: .4byte 0x0000e218 +_0806B32C: .4byte 0x0000e21a +_0806B330: .4byte gUnknown_203B45C +_0806B334: .4byte 0x00008df8 +_0806B338: .4byte 0x0000065c +_0806B33C: .4byte 0x00000179 +_0806B340: .4byte gUnknown_80F4598 +_0806B344: + adds r5, 0x4 + ldr r2, [r5] + movs r4, 0 + ldrsh r0, [r5, r4] + cmp r0, 0x63 + bne _0806B2D2 +_0806B350: + movs r0, 0 + cmp r0, 0 + bne _0806B3E8 + ldr r2, [r3] + movs r1, 0 + ldrsh r0, [r3, r1] + cmp r0, 0x63 + beq _0806B3E8 + ldr r3, _0806B3CC + mov r9, r3 + ldr r5, _0806B3D0 +_0806B366: + lsls r0, r2, 16 + asrs r7, r0, 16 + mov r4, r9 + ldr r1, [r4] + ldr r3, _0806B3D4 + adds r0, r1, r3 + movs r4, 0 + ldrsh r0, [r0, r4] + adds r0, r7, r0 + asrs r6, r2, 16 + ldr r2, _0806B3D8 + adds r1, r2 + movs r3, 0 + ldrsh r1, [r1, r3] + adds r1, r6, r1 + bl sub_804954C + adds r1, r0, 0 + mov r4, r8 + movs r2, 0xE + ldrsh r0, [r4, r2] + bl sub_807034C + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0806B3DC + mov r3, r8 + movs r1, 0xE + ldrsh r0, [r3, r1] + mov r3, r9 + ldr r2, [r3] + ldr r3, _0806B3D4 +_0806B3A8: + adds r1, r2, r3 + movs r3, 0 + ldrsh r1, [r1, r3] + adds r1, r7, r1 + ldr r3, _0806B3D8 + adds r2, r3 + movs r3, 0 + ldrsh r2, [r2, r3] + adds r2, r6, r2 + str r4, [sp] + movs r3, 0x1 + str r3, [sp, 0x4] + str r4, [sp, 0x8] + mov r3, r8 + bl sub_806B8CC + b _0806B3E8 + .align 2, 0 +_0806B3CC: .4byte gUnknown_203B418 +_0806B3D0: .4byte gUnknown_80F4598 +_0806B3D4: .4byte 0x0000e218 +_0806B3D8: .4byte 0x0000e21a +_0806B3DC: + adds r5, 0x4 + ldr r2, [r5] + movs r4, 0 + ldrsh r0, [r5, r4] + cmp r0, 0x63 + bne _0806B366 +_0806B3E8: + ldr r3, [sp, 0x34] + cmp r3, 0x3 + bgt _0806B3F0 + b _0806B282 +_0806B3F0: + bl sub_806B678 + add sp, 0x3C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_806B168 + + thumb_func_start sub_806B404 +sub_806B404: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x30 + movs r5, 0 + movs r2, 0 + ldr r0, _0806B480 + mov r9, r0 + ldr r0, _0806B484 + ldr r7, [r0] + movs r6, 0x1 + ldr r1, _0806B488 + mov r8, r1 +_0806B422: + movs r0, 0x64 + muls r0, r2 + ldr r3, _0806B48C + adds r0, r3 + adds r3, r7, r0 + ldrh r1, [r3] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _0806B446 + lsrs r0, r1, 1 + ands r0, r6 + cmp r0, 0 + beq _0806B446 + movs r1, 0xA + ldrsh r0, [r3, r1] + cmp r0, r8 + beq _0806B490 +_0806B446: + adds r2, 0x1 + cmp r2, 0x3 + ble _0806B422 +_0806B44C: + cmp r5, 0x3 + bgt _0806B460 + movs r1, 0 + lsls r0, r5, 2 + add r0, sp + adds r0, 0xC +_0806B458: + stm r0!, {r1} + adds r5, 0x1 + cmp r5, 0x3 + ble _0806B458 +_0806B460: + movs r0, 0 + mov r2, r9 + str r0, [r2] + bl sub_8083600 + adds r5, r0, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0806B49C + ldrh r0, [r5, 0x6] + lsls r0, 16 + ldrh r4, [r5, 0x4] + b _0806B4AE + .align 2, 0 +_0806B480: .4byte gUnknown_203B450 +_0806B484: .4byte gUnknown_203B45C +_0806B488: .4byte 0x000055aa +_0806B48C: .4byte 0x00008df8 +_0806B490: + lsls r0, r5, 2 + add r0, sp + adds r0, 0xC + str r3, [r0] + adds r5, 0x1 + b _0806B44C +_0806B49C: + ldr r0, _0806B560 + ldr r0, [r0] + ldr r3, _0806B564 + adds r1, r0, r3 + ldr r2, _0806B568 + adds r0, r2 + ldrh r0, [r0] + lsls r0, 16 + ldrh r4, [r1] +_0806B4AE: + orrs r4, r0 + lsls r5, r4, 16 + asrs r0, r5, 16 + asrs r4, 16 + adds r1, r4, 0 + bl sub_804954C + ldrb r0, [r0, 0x9] + str r0, [sp, 0x20] + movs r2, 0 + str r5, [sp, 0x24] + mov r10, r4 +_0806B4C6: + lsls r0, r2, 2 + add r0, sp + adds r0, 0xC + ldr r6, [r0] + adds r2, 0x1 + str r2, [sp, 0x28] + cmp r6, 0 + bne _0806B4D8 + b _0806B65E +_0806B4D8: + ldrh r1, [r6] + movs r2, 0x1 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _0806B4E6 + b _0806B65E +_0806B4E6: + lsrs r0, r1, 1 + ands r0, r2 + cmp r0, 0 + bne _0806B4F0 + b _0806B65E +_0806B4F0: + movs r3, 0xA + ldrsh r1, [r6, r3] + ldr r0, _0806B56C + cmp r1, r0 + beq _0806B4FC + b _0806B65E +_0806B4FC: + ldr r0, _0806B570 + strh r0, [r6, 0xA] + movs r7, 0 + ldr r2, _0806B574 + ldr r0, [r2] + str r0, [sp, 0x1C] + add r0, sp, 0x1C + movs r3, 0 + ldrsh r1, [r0, r3] + mov r9, r2 + adds r2, r0, 0 + cmp r1, 0x63 + beq _0806B58C + ldr r0, [sp, 0x24] + asrs r0, 16 + mov r8, r0 +_0806B51C: + movs r1, 0 + ldrsh r0, [r2, r1] + add r0, r8 + ldr r1, [sp, 0x1C] + asrs r1, 16 + mov r5, r10 + adds r1, r5 + str r2, [sp, 0x2C] + bl sub_804954C + adds r1, r0, 0 + ldrb r0, [r1, 0x9] + ldr r2, [sp, 0x2C] + ldr r3, [sp, 0x20] + cmp r0, r3 + bne _0806B578 + movs r3, 0xE + ldrsh r0, [r6, r3] + bl sub_807034C + lsls r0, 24 + lsrs r4, r0, 24 + ldr r2, [sp, 0x2C] + cmp r4, 0 + bne _0806B578 + movs r1, 0xE + ldrsh r0, [r6, r1] + movs r3, 0 + ldrsh r1, [r2, r3] + add r1, r8 + ldr r2, [sp, 0x1C] + asrs r2, 16 + adds r2, r5 + b _0806B642 + .align 2, 0 +_0806B560: .4byte gUnknown_203B418 +_0806B564: .4byte 0x0000e218 +_0806B568: .4byte 0x0000e21a +_0806B56C: .4byte 0x000055aa +_0806B570: .4byte 0x00005aa5 +_0806B574: .4byte gUnknown_80F4598 +_0806B578: + adds r7, 0x1 + ldr r1, _0806B5E4 + lsls r0, r7, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [sp, 0x1C] + movs r1, 0 + ldrsh r0, [r2, r1] + cmp r0, 0x63 + bne _0806B51C +_0806B58C: + movs r3, 0 + cmp r3, 0 + bne _0806B65E + movs r7, 0 + mov r1, r9 + ldr r0, [r1] + str r0, [sp, 0x1C] + movs r3, 0 + ldrsh r0, [r2, r3] + cmp r0, 0x63 + beq _0806B5FC + ldr r0, [sp, 0x24] + asrs r0, 16 + mov r8, r0 +_0806B5A8: + movs r1, 0 + ldrsh r0, [r2, r1] + add r0, r8 + ldr r1, [sp, 0x1C] + asrs r1, 16 + mov r5, r10 + adds r1, r5 + str r2, [sp, 0x2C] + bl sub_804954C + adds r1, r0, 0 + movs r3, 0xE + ldrsh r0, [r6, r3] + bl sub_807034C + lsls r0, 24 + lsrs r4, r0, 24 + ldr r2, [sp, 0x2C] + cmp r4, 0 + bne _0806B5E8 + movs r1, 0xE + ldrsh r0, [r6, r1] + movs r3, 0 + ldrsh r1, [r2, r3] + add r1, r8 + ldr r2, [sp, 0x1C] + asrs r2, 16 + adds r2, r5 + b _0806B642 + .align 2, 0 +_0806B5E4: .4byte gUnknown_80F4598 +_0806B5E8: + adds r7, 0x1 + ldr r1, _0806B654 + lsls r0, r7, 2 + adds r0, r1 + ldr r0, [r0] + str r0, [sp, 0x1C] + movs r1, 0 + ldrsh r0, [r2, r1] + cmp r0, 0x63 + bne _0806B5A8 +_0806B5FC: + movs r3, 0 + cmp r3, 0 + bne _0806B65E + movs r7, 0 + adds r5, r2, 0 +_0806B606: + adds r0, r5, 0 + str r2, [sp, 0x2C] + bl sub_8083660 + lsls r0, 24 + ldr r2, [sp, 0x2C] + cmp r0, 0 + beq _0806B658 + movs r1, 0 + ldrsh r0, [r2, r1] + movs r3, 0x2 + ldrsh r1, [r5, r3] + bl sub_804954C + adds r1, r0, 0 + movs r3, 0xE + ldrsh r0, [r6, r3] + bl sub_807034C + lsls r0, 24 + lsrs r4, r0, 24 + ldr r2, [sp, 0x2C] + cmp r4, 0 + bne _0806B658 + movs r1, 0xE + ldrsh r0, [r6, r1] + movs r3, 0 + ldrsh r1, [r2, r3] + movs r3, 0x2 + ldrsh r2, [r5, r3] +_0806B642: + str r4, [sp] + movs r3, 0x1 + str r3, [sp, 0x4] + str r4, [sp, 0x8] + adds r3, r6, 0 + bl sub_806B8CC + b _0806B65E + .align 2, 0 +_0806B654: .4byte gUnknown_80F4598 +_0806B658: + adds r7, 0x1 + cmp r7, 0x63 + ble _0806B606 +_0806B65E: + ldr r2, [sp, 0x28] + cmp r2, 0x3 + bgt _0806B666 + b _0806B4C6 +_0806B666: + add sp, 0x30 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_806B404 + + thumb_func_start sub_806B678 +sub_806B678: + push {r4,r5,lr} + movs r5, 0 +_0806B67C: + ldr r0, _0806B6AC + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _0806B6B0 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0806B6B8 + ldr r0, [r4, 0x70] + ldrb r0, [r0, 0x7] + cmp r0, 0 + beq _0806B6B8 + adds r0, r4, 0 + bl sub_803F4A0 + ldr r1, _0806B6B4 + ldr r0, [r4, 0x4] + str r0, [r1] + b _0806B6BE + .align 2, 0 +_0806B6AC: .4byte gUnknown_203B418 +_0806B6B0: .4byte 0x0001357c +_0806B6B4: .4byte gUnknown_202EE0C +_0806B6B8: + adds r5, 0x1 + cmp r5, 0x3 + ble _0806B67C +_0806B6BE: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_806B678 + + thumb_func_start sub_806B6C4 +sub_806B6C4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + ldr r4, _0806B708 + ldr r0, [r4] + movs r1, 0xD1 + lsls r1, 3 + adds r0, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + mov r8, r0 + movs r0, 0x7A + bl sub_80860A8 + lsls r0, 24 + cmp r0, 0 + beq _0806B710 + movs r0, 0x97 + bl sub_808E734 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0806B710 + ldr r0, [r4] + ldr r2, _0806B70C + adds r0, r2 + b _0806B71A + .align 2, 0 +_0806B708: .4byte gUnknown_203B418 +_0806B70C: .4byte 0x000037ff +_0806B710: + ldr r0, _0806B77C + ldr r0, [r0] + ldr r1, _0806B780 + adds r0, r1 + movs r1, 0x1 +_0806B71A: + strb r1, [r0] + movs r0, 0x38 + bl sub_8084100 + adds r5, r0, 0 + movs r0, 0x20 + bl sub_8084100 + adds r7, r0, 0 + movs r0, 0 +_0806B72E: + adds r7, 0x1 + cmp r7, 0x20 + bne _0806B736 + movs r7, 0 +_0806B736: + adds r0, 0x1 + mov r10, r0 + mov r4, sp + movs r2, 0x37 + mov r9, r2 +_0806B740: + adds r5, 0x1 + cmp r5, 0x38 + bne _0806B748 + movs r5, 0 +_0806B748: + adds r0, r5, 0 + adds r1, r7, 0 + bl sub_804954C + ldrh r1, [r0, 0x4] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0806B7C2 + movs r6, 0 + mov r0, r8 + cmp r0, 0 + beq _0806B784 + ldr r0, _0806B77C + ldr r0, [r0] + movs r1, 0xD1 + lsls r1, 3 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r4] + movs r1, 0x1 + movs r0, 0x1 + strh r0, [r4, 0x8] + strb r1, [r4, 0x2] + movs r6, 0x1 + b _0806B794 + .align 2, 0 +_0806B77C: .4byte gUnknown_203B418 +_0806B780: .4byte 0x000037ff +_0806B784: + movs r0, 0 + bl sub_803D970 + movs r1, 0 + strh r0, [r4] + mov r2, r8 + strh r2, [r4, 0x8] + strb r1, [r4, 0x2] +_0806B794: + movs r0, 0 + str r0, [sp, 0x4] + strb r0, [r4, 0x10] + strh r5, [r4, 0xC] + strh r7, [r4, 0xE] + cmp r6, 0 + bne _0806B7B2 + movs r1, 0 + ldrsh r0, [r4, r1] + movs r1, 0x1 + bl sub_806AA0C + lsls r0, 24 + cmp r0, 0 + beq _0806B7C2 +_0806B7B2: + mov r0, sp + movs r1, 0 + bl sub_806B7F8 + cmp r0, 0 + beq _0806B7C2 + movs r2, 0 + mov r8, r2 +_0806B7C2: + movs r0, 0x1 + negs r0, r0 + add r9, r0 + mov r1, r9 + cmp r1, 0 + bge _0806B740 + mov r0, r10 + cmp r0, 0x1F + ble _0806B72E + mov r2, r8 + cmp r2, 0 + beq _0806B7E2 + ldr r0, _0806B7F4 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0xA] +_0806B7E2: + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0806B7F4: .4byte gUnknown_203B418 + thumb_func_end sub_806B6C4 + + thumb_func_start sub_806B7F8 +sub_806B7F8: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + adds r6, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + movs r1, 0xC + ldrsh r0, [r6, r1] + movs r2, 0xE + ldrsh r1, [r6, r2] + bl sub_804954C + adds r1, r0, 0 + movs r3, 0 + ldrsh r0, [r6, r3] + bl sub_807034C + lsls r0, 24 + cmp r0, 0 + bne _0806B834 + movs r4, 0 + ldrsh r0, [r6, r4] + bl sub_804550C + adds r7, r0, 0 + cmp r7, 0 + bne _0806B838 +_0806B834: + movs r0, 0 + b _0806B8B8 +_0806B838: + ldr r3, _0806B8C8 + movs r0, 0 + adds r1, r7, 0 + adds r2, r6, 0 + bl sub_806BC68 + ldr r5, [r7, 0x70] + movs r0, 0x1 + strb r0, [r5, 0x6] + movs r1, 0x8C + lsls r1, 1 + adds r0, r5, r1 + adds r1, r5, 0 + adds r1, 0x10 + adds r2, r5, 0 + adds r2, 0x14 + movs r3, 0x16 + adds r3, r5 + mov r9, r3 + movs r3, 0x2 + ldrsh r4, [r5, r3] + str r4, [sp] + ldrb r4, [r5, 0x9] + str r4, [sp, 0x4] + mov r3, r9 + bl sub_806AED8 + ldrh r0, [r5, 0x10] + strh r0, [r5, 0xE] + movs r4, 0x8A + lsls r4, 1 + adds r1, r5, r4 + ldr r0, [r6, 0x4] + str r0, [r1] + ldrb r0, [r6, 0x2] + cmp r0, 0 + bne _0806B8B6 + mov r0, r8 + cmp r0, 0 + bne _0806B8B6 + ldrb r0, [r6, 0x10] + cmp r0, 0 + bne _0806B8B6 + movs r0, 0x64 + bl sub_8084100 + adds r4, r0, 0 + movs r1, 0 + ldrsh r0, [r6, r1] + bl sub_808DB60 + lsls r0, 24 + lsrs r0, 24 + cmp r0, r4 + ble _0806B8B6 + adds r0, r7, 0 + movs r1, 0x7F + bl sub_8075BF4 + adds r0, r7, 0 + movs r1, 0x8 + bl sub_806CE68 +_0806B8B6: + adds r0, r7, 0 +_0806B8B8: + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0806B8C8: .4byte gUnknown_202EE0C + thumb_func_end sub_806B7F8 + + thumb_func_start sub_806B8CC +sub_806B8CC: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + mov r9, r1 + mov r10, r2 + adds r5, r3, 0 + ldr r1, [sp, 0x50] + ldr r2, [sp, 0x54] + lsls r0, 16 + asrs r4, r0, 16 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x18] + ldrb r1, [r5, 0x2] + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + mov r8, r0 + ldr r0, [sp, 0x4C] + cmp r0, 0 + beq _0806B906 + movs r0, 0 + ldr r1, [sp, 0x4C] + str r0, [r1] +_0806B906: + adds r0, r4, 0 + bl sub_808E770 + lsls r0, 16 + asrs r1, r0, 16 + movs r0, 0xCF + lsls r0, 1 + cmp r1, r0 + bne _0806B932 + cmp r6, 0 + beq _0806B930 + ldr r0, _0806B92C + ldr r0, [r0] + movs r2, 0xE0 + lsls r2, 6 + adds r0, r2 + movs r3, 0 + ldrsh r4, [r0, r3] + b _0806B932 + .align 2, 0 +_0806B92C: .4byte gUnknown_203B418 +_0806B930: + adds r4, r1, 0 +_0806B932: + mov r0, r9 + mov r1, r10 + bl sub_804954C + adds r1, r0, 0 + adds r0, r4, 0 + bl sub_807034C + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _0806B956 + adds r0, r4, 0 + bl sub_80453AC + str r0, [sp, 0x1C] + cmp r0, 0 + bne _0806B95A +_0806B956: + movs r0, 0 + b _0806BB3C +_0806B95A: + mov r0, sp + movs r7, 0 + mov r1, r9 + strh r1, [r0, 0xC] + mov r2, r10 + strh r2, [r0, 0xE] + strh r4, [r0] + mov r1, sp + ldrb r0, [r5, 0x3] + strh r0, [r1, 0x8] + mov r0, sp + strb r7, [r0, 0x2] + str r6, [sp, 0x4] + strb r7, [r0, 0x10] + ldr r4, _0806BB4C + ldr r3, _0806BB50 + ldrb r0, [r3] + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0] + add r0, r9 + lsls r0, 16 + lsrs r0, 16 + ldr r2, _0806BB54 + ldr r1, [sp, 0x14] + ands r1, r2 + orrs r1, r0 + str r1, [sp, 0x14] + ldrb r0, [r3] + lsls r0, 2 + adds r0, r4 + ldrh r0, [r0, 0x2] + add r0, r10 + lsls r0, 16 + ldr r2, _0806BB58 + ands r1, r2 + orrs r1, r0 + str r1, [sp, 0x14] + ldr r3, _0806BB5C + mov r0, r8 + cmp r0, 0 + beq _0806B9B0 + add r3, sp, 0x14 +_0806B9B0: + movs r0, 0x1 + ldr r1, [sp, 0x1C] + mov r2, sp + bl sub_806BC68 + ldr r1, [sp, 0x1C] + ldr r4, [r1, 0x70] + strb r7, [r4, 0x6] + strb r7, [r4, 0x8] + mov r2, r8 + strb r2, [r4, 0x7] + adds r0, r4, 0 + adds r0, 0xF9 + mov r3, sp + ldrb r3, [r3, 0x18] + strb r3, [r0] + ldr r0, _0806BB60 + str r6, [r0] + mov r6, r8 + cmp r6, 0 + beq _0806B9E4 + ldr r0, _0806BB5C + mov r7, r9 + strh r7, [r0] + mov r1, r10 + strh r1, [r0, 0x2] +_0806B9E4: + ldrh r0, [r5, 0x10] + strh r0, [r4, 0xE] + ldrh r0, [r5, 0x12] + strh r0, [r4, 0x10] + ldr r0, [r5, 0x18] + str r0, [r4, 0x18] + movs r3, 0 + movs r2, 0x1C + adds r2, r5 + mov r8, r2 + movs r6, 0x50 + adds r6, r5 + mov r10, r6 + movs r7, 0x94 + adds r7, r4 + mov r9, r7 + adds r0, r4, 0 + adds r0, 0x8C + str r0, [sp, 0x20] + adds r1, r4, 0 + adds r1, 0xF3 + str r1, [sp, 0x24] + adds r2, r4, 0 + adds r2, 0x64 + str r2, [sp, 0x28] + movs r6, 0x14 + adds r6, r4 + mov r12, r6 + adds r7, r5, 0 + adds r7, 0x14 + adds r6, r4, 0 + adds r6, 0x16 + adds r2, r5, 0 + adds r2, 0x16 +_0806BA28: + mov r0, r12 + adds r1, r0, r3 + adds r0, r7, r3 + ldrb r0, [r0] + strb r0, [r1] + adds r1, r6, r3 + adds r0, r2, r3 + ldrb r0, [r0] + strb r0, [r1] + adds r3, 0x1 + cmp r3, 0x1 + ble _0806BA28 + movs r1, 0x8C + lsls r1, 1 + adds r2, r4, r1 + adds r1, r2, 0 + mov r0, r8 + ldm r0!, {r3,r6,r7} + stm r1!, {r3,r6,r7} + ldm r0!, {r3,r6,r7} + stm r1!, {r3,r6,r7} + ldm r0!, {r3,r6,r7} + stm r1!, {r3,r6,r7} + movs r0, 0x1 + mov r8, r0 + movs r7, 0xEF + movs r6, 0xDF + movs r3, 0x3 +_0806BA60: + ldrb r1, [r2] + mov r0, r8 + ands r0, r1 + cmp r0, 0 + beq _0806BA72 + adds r0, r7, 0 + ands r0, r1 + ands r0, r6 + strb r0, [r2] +_0806BA72: + adds r2, 0x8 + subs r3, 0x1 + cmp r3, 0 + bge _0806BA60 + movs r1, 0x9C + lsls r1, 1 + adds r2, r4, r1 + ldrb r1, [r2] + movs r0, 0xEF + ands r0, r1 + movs r1, 0xDF + ands r0, r1 + strb r0, [r2] + ldrb r0, [r5, 0x3] + strb r0, [r4, 0x9] + ldrh r0, [r5, 0x8] + movs r2, 0 + strh r0, [r4, 0xC] + mov r3, r10 + ldrb r0, [r3] + mov r6, r9 + strb r0, [r6] + ldr r0, [r5, 0x4C] + ldr r7, [sp, 0x20] + str r0, [r7] + ldr r0, [r5, 0x54] + str r0, [r4, 0x3C] + ldr r0, [r5, 0x4] + str r0, [r4, 0x40] + movs r0, 0x9E + lsls r0, 1 + adds r1, r4, r0 + ldr r0, [r5, 0x44] + str r0, [r1] + movs r3, 0xA0 + lsls r3, 1 + adds r1, r4, r3 + ldr r0, [r5, 0x48] + str r0, [r1] + ldrh r0, [r5, 0xC] + strb r0, [r4, 0xA] + ldr r0, [r5, 0x40] + str r0, [r4, 0x60] + ldr r0, [sp, 0x24] + strb r2, [r0] + ldr r6, [sp, 0x28] + strb r2, [r6] + ldr r7, _0806BB64 + ldr r0, [r7] + ldr r1, _0806BB68 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0806BB24 + bl sub_80441BC + lsls r0, 24 + cmp r0, 0 + bne _0806BB24 + adds r0, r4, 0 + adds r0, 0x5E + ldrb r0, [r0] + cmp r0, 0x47 + beq _0806BAFC + adds r0, r4, 0 + adds r0, 0x5F + ldrb r0, [r0] + cmp r0, 0x47 + bne _0806BB24 +_0806BAFC: + adds r4, 0x60 + ldrb r1, [r4] + movs r5, 0x1 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _0806BB24 + movs r0, 0 + bl sub_803D73C + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x69 + beq _0806BB24 + adds r0, r4, 0 + movs r2, 0 + bl sub_8090A8C + ldr r2, [sp, 0x24] + strb r5, [r2] +_0806BB24: + ldr r0, [sp, 0x1C] + bl sub_806A6E8 + ldr r0, [sp, 0x1C] + bl sub_807191C + ldr r3, [sp, 0x4C] + cmp r3, 0 + beq _0806BB3A + ldr r6, [sp, 0x1C] + str r6, [r3] +_0806BB3A: + movs r0, 0x1 +_0806BB3C: + add sp, 0x2C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0806BB4C: .4byte gUnknown_80F4448 +_0806BB50: .4byte gUnknown_202F32C +_0806BB54: .4byte 0xffff0000 +_0806BB58: .4byte 0x0000ffff +_0806BB5C: .4byte gUnknown_202EE0C +_0806BB60: .4byte gUnknown_203B450 +_0806BB64: .4byte gUnknown_203B418 +_0806BB68: .4byte 0x00000644 + thumb_func_end sub_806B8CC + + thumb_func_start sub_806BB6C +sub_806BB6C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + adds r7, r0, 0 + lsls r4, r1, 16 + asrs r4, 16 + ldr r0, [r7, 0x70] + mov r9, r0 + mov r8, r9 + adds r0, 0x98 + ldr r0, [r0] + bl sub_800F934 + add r0, sp, 0x8 + movs r1, 0 + mov r10, r1 + movs r6, 0 + lsls r5, r4, 16 + lsrs r5, 16 + strh r5, [r0] + strh r6, [r0, 0x8] + mov r2, r10 + strb r2, [r0, 0x2] + ldr r0, [r7, 0x4] + str r0, [sp, 0x14] + str r6, [sp, 0xC] + movs r0, 0 + adds r1, r4, 0 + bl sub_8069F54 + lsls r0, 16 + adds r1, r7, 0 + adds r1, 0x22 + mov r2, r10 + strb r2, [r1] + ldr r1, [r7, 0x70] + asrs r2, r0, 16 + lsrs r0, 16 + strh r0, [r1, 0x4] + ldr r0, [r7, 0x70] + strh r5, [r0, 0x2] + adds r0, r2, 0 + bl sub_80687D0 + str r0, [r7, 0x64] + adds r1, r7, 0 + adds r1, 0x6A + movs r0, 0x7 + strb r0, [r1] + adds r0, r7, 0 + adds r0, 0x6C + mov r5, r10 + strb r5, [r0] + adds r1, 0x1 + movs r0, 0xFF + strb r0, [r1] + adds r1, 0x2 + movs r0, 0x1 + strb r0, [r1] + adds r1, 0x2 + strb r0, [r1] + str r6, [r7, 0x1C] + mov r0, r9 + adds r0, 0xB0 + ldrb r0, [r0] + subs r0, 0x3 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _0806BC08 + mov r0, r9 + adds r0, 0x9C + ldr r0, [r0] + bl sub_8076CB4 +_0806BC08: + movs r1, 0 + mov r6, r9 + ldrb r0, [r6, 0x6] + cmp r0, 0 + bne _0806BC14 + movs r1, 0x1 +_0806BC14: + adds r0, r1, 0 + adds r1, r7, 0 + add r2, sp, 0x8 + movs r3, 0 + bl sub_806BC68 + movs r0, 0x8C + lsls r0, 1 + add r0, r8 + mov r1, r8 + adds r1, 0x10 + mov r2, r8 + adds r2, 0x14 + mov r3, r8 + adds r3, 0x16 + mov r5, r8 + movs r6, 0x2 + ldrsh r4, [r5, r6] + str r4, [sp] + ldrb r4, [r5, 0x9] + str r4, [sp, 0x4] + bl sub_806AED8 + ldrh r0, [r5, 0x10] + strh r0, [r5, 0xE] + mov r0, r10 + strb r0, [r5, 0x8] + adds r0, r7, 0 + bl sub_80429E8 + adds r0, r7, 0 + bl sub_80418D4 + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_806BB6C + + thumb_func_start sub_806BC68 +sub_806BC68: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + adds r4, r0, 0 + mov r8, r1 + adds r7, r2, 0 + mov r10, r3 + lsls r4, 24 + lsrs r4, 24 + ldr r1, _0806BD0C + ldr r0, [r1] + movs r5, 0 + movs r2, 0x1 + mov r9, r2 + mov r3, r9 + strb r3, [r0, 0xC] + mov r0, r8 + ldr r6, [r0, 0x70] + adds r0, r6, 0 + movs r1, 0x1 + bl sub_806BFC0 + ldrb r1, [r7, 0x2] + adds r0, r6, 0 + adds r0, 0xA4 + strb r1, [r0] + mov r0, r8 + adds r0, 0x20 + mov r1, r9 + strb r1, [r0] + adds r0, 0x2 + strb r5, [r0] + ldr r0, _0806BD10 + mov r2, r8 + strh r0, [r2, 0x8] + movs r0, 0x1 + negs r0, r0 + strh r0, [r2, 0xA] + ldr r0, _0806BD14 + strh r0, [r2, 0x4] + strh r0, [r2, 0x6] + movs r3, 0xC + ldrsh r1, [r7, r3] + movs r0, 0xE + ldrsh r2, [r7, r0] + mov r0, r8 + movs r3, 0x1 + bl sub_80694C0 + mov r0, r8 + movs r1, 0 + bl sub_804535C + cmp r4, 0 + bne _0806BD5E + movs r2, 0 + ldrsh r1, [r7, r2] + movs r0, 0xBE + lsls r0, 1 + cmp r1, r0 + bne _0806BD20 + ldr r3, _0806BD0C + ldr r1, [r3] + ldr r4, _0806BD18 + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _0806BD20 + ldr r2, _0806BD1C + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _0806BD20 + ldrb r0, [r7, 0x2] + cmp r0, 0 + bne _0806BD20 + mov r3, r9 + strb r3, [r6, 0x8] + b _0806BD24 + .align 2, 0 +_0806BD0C: .4byte gUnknown_203B418 +_0806BD10: .4byte 0x0000ffff +_0806BD14: .4byte 0x0000fffe +_0806BD18: .4byte 0x0000066e +_0806BD1C: .4byte 0x00003a0a +_0806BD20: + movs r0, 0 + strb r0, [r6, 0x8] +_0806BD24: + movs r4, 0x2 + ldrsh r0, [r6, r4] + bl sub_808E770 + lsls r0, 16 + movs r1, 0xCF + lsls r1, 17 + cmp r0, r1 + bne _0806BD42 + ldr r0, _0806BD94 + ldr r0, [r0] + ldr r1, _0806BD98 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] +_0806BD42: + movs r2, 0x2 + ldrsh r0, [r6, r2] + bl sub_808E770 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x97 + bne _0806BD5E + ldr r0, _0806BD94 + ldr r0, [r0] + ldr r3, _0806BD9C + adds r0, r3 + movs r1, 0x1 + strb r1, [r0] +_0806BD5E: + adds r2, r6, 0 + adds r2, 0x98 + ldr r0, _0806BD94 + ldr r1, [r0] + ldr r4, _0806BDA0 + adds r1, r4 + ldr r0, [r1] + str r0, [r2] + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + adds r1, r6, 0 + adds r1, 0x9C + movs r0, 0 + str r0, [r1] + ldrh r1, [r7, 0x8] + movs r3, 0x8 + ldrsh r0, [r7, r3] + mov r9, r2 + cmp r0, 0 + bne _0806BDA4 + movs r4, 0 + ldrsh r0, [r7, r4] + bl sub_803DA20 + strb r0, [r6, 0x9] + b _0806BDA6 + .align 2, 0 +_0806BD94: .4byte gUnknown_203B418 +_0806BD98: .4byte 0x000037fd +_0806BD9C: .4byte 0x000037ff +_0806BDA0: .4byte 0x000037f0 +_0806BDA4: + strb r1, [r6, 0x9] +_0806BDA6: + movs r0, 0x8A + lsls r0, 1 + adds r1, r6, r0 + ldr r0, [r7, 0x4] + str r0, [r1] + movs r4, 0x1 + strh r4, [r6, 0xC] + adds r0, r6, 0 + adds r0, 0x8C + movs r1, 0 + bl sub_808EC94 + adds r0, r6, 0 + adds r0, 0x3C + bl sub_808E6F4 + strh r4, [r6, 0x10] + strh r4, [r6, 0xE] + mov r0, sp + movs r1, 0x64 + bl sub_80943A0 + movs r2, 0x9E + lsls r2, 1 + adds r1, r6, r2 + ldr r0, [sp] + str r0, [r1] + add r0, sp, 0x4 + movs r1, 0x64 + bl sub_80943A0 + movs r3, 0xA0 + lsls r3, 1 + adds r1, r6, r3 + ldr r0, [sp, 0x4] + str r0, [r1] + mov r4, r10 + cmp r4, 0 + beq _0806BE00 + movs r0, 0xB6 + lsls r0, 1 + adds r1, r6, r0 + ldr r0, [r4] + str r0, [r1] + b _0806BE12 +_0806BE00: + movs r1, 0xB6 + lsls r1, 1 + adds r0, r6, r1 + mov r2, r10 + strh r2, [r0] + movs r3, 0xB7 + lsls r3, 1 + adds r0, r6, r3 + strh r2, [r0] +_0806BE12: + movs r7, 0 + movs r4, 0 + strh r4, [r6] + movs r1, 0xA2 + lsls r1, 1 + adds r0, r6, r1 + strb r7, [r0] + ldr r2, _0806BFB4 + adds r0, r6, r2 + strb r7, [r0] + movs r3, 0xFA + lsls r3, 1 + adds r0, r6, r3 + strh r4, [r0] + adds r1, 0xB2 + adds r0, r6, r1 + strh r4, [r0] + adds r0, r6, 0 + adds r0, 0x78 + strb r7, [r0] + adds r1, r6, 0 + adds r1, 0x88 + mov r2, r8 + ldr r0, [r2, 0x4] + str r0, [r1] + adds r0, r6, 0 + adds r0, 0x80 + str r4, [r0] + adds r0, 0x4 + str r4, [r0] + subs r0, 0x8 + strh r4, [r0] + adds r0, 0x83 + strb r7, [r0] + subs r3, 0x80 + adds r0, r6, r3 + str r4, [r0] + movs r1, 0x80 + lsls r1, 1 + adds r0, r6, r1 + strb r7, [r0] + adds r0, r6, 0 + movs r1, 0x1 + bl sub_806BFC0 + adds r0, r6, 0 + adds r0, 0x60 + strb r7, [r0, 0x2] + strb r7, [r0, 0x1] + strb r7, [r0] + adds r0, 0x4 + strb r7, [r0] + movs r2, 0x80 + lsls r2, 2 + adds r0, r6, r2 + str r4, [r0] + movs r3, 0xB2 + lsls r3, 1 + adds r1, r6, r3 + movs r0, 0xFF + strb r0, [r1] + adds r0, 0x66 + adds r1, r6, r0 + movs r0, 0x1 + negs r0, r0 + strb r0, [r1] + movs r1, 0xFE + lsls r1, 1 + adds r0, r6, r1 + str r4, [r0] + subs r2, 0xB9 + adds r0, r6, r2 + strb r7, [r0] + subs r3, 0x1E + adds r0, r6, r3 + strb r7, [r0] + subs r1, 0x96 + adds r0, r6, r1 + strb r7, [r0] + adds r2, 0xB1 + adds r0, r6, r2 + strh r4, [r0] + adds r3, 0xB4 + adds r0, r6, r3 + strh r4, [r0] + subs r1, 0x1E + adds r0, r6, r1 + strb r7, [r0] + subs r2, 0xAF + adds r0, r6, r2 + strb r7, [r0] + subs r3, 0x82 + adds r0, r6, r3 + strh r4, [r0] + adds r0, r6, 0 + adds r0, 0xFA + strb r7, [r0] + adds r0, 0x2 + strb r7, [r0] + adds r1, 0x3 + adds r0, r6, r1 + strb r7, [r0] + adds r2, 0x3 + adds r0, r6, r2 + movs r5, 0x1 + strb r5, [r0] + subs r3, 0x2A + adds r0, r6, r3 + strh r4, [r0] + adds r1, 0x5 + adds r0, r6, r1 + strh r4, [r0] + adds r2, 0x6 + adds r0, r6, r2 + strb r7, [r0] + adds r3, 0x5 + adds r0, r6, r3 + strb r7, [r0] + movs r4, 0xAA + lsls r4, 1 + adds r0, r6, r4 + strb r7, [r0] + adds r1, 0x5 + adds r0, r6, r1 + strb r7, [r0] + adds r2, 0x17 + adds r0, r6, r2 + strb r7, [r0] + adds r0, r6, 0 + adds r0, 0xFD + strb r7, [r0] + adds r1, r6, 0 + adds r1, 0xFE + movs r0, 0x63 + strb r0, [r1] + adds r3, 0x5 + adds r0, r6, r3 + strb r7, [r0] + adds r4, 0x5 + adds r0, r6, r4 + strb r7, [r0] + movs r1, 0xAD + lsls r1, 1 + adds r0, r6, r1 + strb r7, [r0] + mov r0, r8 + bl sub_8070774 + movs r2, 0xAB + lsls r2, 1 + adds r1, r6, r2 + strb r5, [r1] + movs r3, 0xAE + lsls r3, 1 + adds r0, r6, r3 + strb r7, [r0] + adds r4, 0x5 + adds r0, r6, r4 + strb r7, [r0] + adds r2, 0x7 + adds r0, r6, r2 + strb r7, [r0] + adds r3, 0x3 + adds r0, r6, r3 + strb r7, [r0] + adds r4, 0x2 + adds r0, r6, r4 + strb r7, [r0] + ldrh r0, [r6, 0x4] + subs r0, 0x32 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _0806BF70 + strb r7, [r1] +_0806BF70: + mov r0, r8 + ldrh r1, [r0, 0x6] + lsls r1, 16 + ldrh r0, [r0, 0x4] + orrs r0, r1 + str r0, [sp, 0x8] + mov r1, r9 + ldr r0, [r1] + movs r2, 0x4 + ldrsh r1, [r6, r2] + add r2, sp, 0x8 + ldr r3, _0806BFB8 + ldr r3, [r3] + ldr r4, _0806BFBC + adds r3, r4 + ldrb r3, [r3] + bl sub_800F8D0 + mov r0, r8 + bl sub_807191C + mov r0, r8 + movs r1, 0 + movs r2, 0 + bl sub_806A898 + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0806BFB4: .4byte 0x00000145 +_0806BFB8: .4byte gUnknown_203B418 +_0806BFBC: .4byte 0x00018208 + thumb_func_end sub_806BC68 + + thumb_func_start sub_806BFC0 +sub_806BFC0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x3C + adds r4, r0, 0 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp] + adds r1, r4, 0 + adds r1, 0xA8 + movs r0, 0 + strb r0, [r1] + adds r1, 0x1 + strb r0, [r1] + adds r1, 0x3 + strb r0, [r1] + adds r1, 0x1 + strb r0, [r1] + adds r1, 0x1 + strb r0, [r1] + adds r1, 0x1 + strb r0, [r1] + adds r1, 0x1 + strb r0, [r1] + adds r1, 0x8 + strb r0, [r1] + adds r1, 0x1 + strb r0, [r1] + adds r2, r4, 0 + adds r2, 0xB4 + movs r1, 0x22 + str r1, [r2] + adds r1, r4, 0 + adds r1, 0xBC + strb r0, [r1] + adds r1, 0x1 + strb r0, [r1] + adds r1, 0x3 + strb r0, [r1] + adds r1, 0x4 + strb r0, [r1] + adds r1, 0x1 + strb r0, [r1] + adds r1, 0x3 + strb r0, [r1] + adds r1, 0x3 + strb r0, [r1] + adds r1, 0x1 + strb r0, [r1] + adds r1, 0x4 + strb r0, [r1] + adds r1, 0x9 + strb r0, [r1] + adds r1, 0x1 + strb r0, [r1] + adds r1, 0x2 + strb r0, [r1] + adds r1, 0x1 + strb r0, [r1] + adds r1, 0x3 + strb r0, [r1] + adds r1, 0x4 + strb r0, [r1] + adds r1, 0x1 + strb r0, [r1] + adds r1, 0x3 + strb r0, [r1] + adds r1, 0x1 + strb r0, [r1] + adds r1, 0x3 + strb r0, [r1] + adds r1, 0x1 + strb r0, [r1] + adds r1, 0x3 + strb r0, [r1] + adds r1, 0x1 + strb r0, [r1] + adds r1, 0x1 + strb r0, [r1] + movs r0, 0xB2 + lsls r0, 1 + adds r1, r4, r0 + movs r0, 0xFF + strb r0, [r1] + ldr r2, _0806C168 + adds r1, r4, r2 + movs r0, 0x1 + negs r0, r0 + strb r0, [r1] + movs r1, 0 + movs r7, 0x84 + lsls r7, 1 + adds r0, r4, r7 + movs r5, 0x4 +_0806C080: + strb r1, [r0] + strb r1, [r0, 0x5] + adds r0, 0x1 + subs r5, 0x1 + cmp r5, 0 + bge _0806C080 + movs r0, 0 + str r0, [sp, 0x4] + movs r5, 0 + adds r1, r4, 0 + adds r1, 0x5E + str r1, [sp, 0x8] + movs r2, 0x5C + adds r2, r4 + mov r10, r2 + adds r7, r4, 0 + adds r7, 0xFD + str r7, [sp, 0x20] + adds r0, r4, 0 + adds r0, 0xF4 + str r0, [sp, 0xC] + adds r1, 0x9D + str r1, [sp, 0x1C] + adds r2, r4, 0 + adds r2, 0xF5 + str r2, [sp, 0x10] + subs r7, 0x7 + str r7, [sp, 0x14] + adds r0, 0x3 + str r0, [sp, 0x18] + adds r1, 0x4 + str r1, [sp, 0x24] + movs r2, 0x1 + mov r9, r2 + movs r3, 0xA + subs r7, 0xC2 + str r7, [sp, 0x28] + subs r0, 0xCB + str r0, [sp, 0x2C] + adds r2, r4, 0 + adds r2, 0x24 + subs r1, 0xDF + str r1, [sp, 0x38] + adds r6, r4, 0 + adds r6, 0x1C + movs r7, 0x80 + lsls r7, 1 + mov r8, r7 +_0806C0E0: + movs r1, 0x2 + ldrsh r0, [r4, r1] + adds r1, r5, 0 + str r2, [sp, 0x30] + str r3, [sp, 0x34] + bl sub_808DC84 + ldr r7, [sp, 0x8] + adds r1, r7, r5 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + ldr r2, [sp, 0x30] + ldr r3, [sp, 0x34] + cmp r0, 0x25 + bne _0806C104 + movs r0, 0x1 + str r0, [sp, 0x4] +_0806C104: + ldr r1, [sp] + cmp r1, 0 + beq _0806C11E + adds r0, r4, 0 + adds r0, 0x14 + adds r0, r5 + mov r7, r9 + strb r7, [r0] + adds r0, r4, 0 + adds r0, 0x16 + adds r0, r5 + mov r1, r9 + strb r1, [r0] +_0806C11E: + strh r3, [r6] + ldr r7, [sp, 0x38] + strh r3, [r7] + strh r3, [r2] + ldr r1, [sp, 0x2C] + mov r0, r8 + stm r1!, {r0} + str r1, [sp, 0x2C] + ldr r7, [sp, 0x28] + stm r7!, {r0} + str r7, [sp, 0x28] + adds r2, 0x2 + ldr r0, [sp, 0x38] + adds r0, 0x2 + str r0, [sp, 0x38] + adds r6, 0x2 + adds r5, 0x1 + cmp r5, 0x1 + ble _0806C0E0 + ldr r1, [sp, 0x4] + cmp r1, 0 + beq _0806C170 + movs r0, 0 + bl sub_807E580 + ldr r1, _0806C16C + lsls r0, 24 + lsrs r0, 22 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0 + mov r2, r10 + strb r0, [r2] + adds r0, r4, 0 + adds r0, 0x5D + strb r1, [r0] + b _0806C188 + .align 2, 0 +_0806C168: .4byte 0x00000165 +_0806C16C: .4byte gUnknown_80F520C +_0806C170: + movs r5, 0 +_0806C172: + movs r7, 0x2 + ldrsh r0, [r4, r7] + adds r1, r5, 0 + bl sub_808DC68 + mov r2, r10 + adds r1, r2, r5 + strb r0, [r1] + adds r5, 0x1 + cmp r5, 0x1 + ble _0806C172 +_0806C188: + ldr r0, _0806C1D0 + ldr r1, [r0] + movs r2, 0 + movs r0, 0x1 + strb r0, [r1, 0xC] + movs r0, 0 + strh r2, [r4, 0x28] + movs r7, 0x89 + lsls r7, 1 + adds r1, r4, r7 + strb r0, [r1] + ldr r1, [sp, 0x20] + strb r0, [r1] + ldr r2, _0806C1D4 + adds r1, r4, r2 + strb r0, [r1] + ldr r7, [sp, 0xC] + strb r0, [r7] + ldr r1, [sp, 0x1C] + strb r0, [r1] + ldr r2, [sp, 0x10] + strb r0, [r2] + ldr r7, [sp, 0x14] + strb r0, [r7] + ldr r1, [sp, 0x18] + strb r0, [r1] + ldr r2, [sp, 0x24] + strb r0, [r2] + add sp, 0x3C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0806C1D0: .4byte gUnknown_203B418 +_0806C1D4: .4byte 0x00000113 + thumb_func_end sub_806BFC0 + + thumb_func_start sub_806C1D8 +sub_806C1D8: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r5, 0 +_0806C1E2: + ldr r0, _0806C258 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _0806C25C + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + adds r5, 0x1 + mov r9, r5 + cmp r0, 0 + beq _0806C244 + ldr r4, [r4, 0x70] + ldrb r6, [r4, 0xA] + cmp r6, 0 + blt _0806C244 + movs r5, 0 + movs r0, 0x8C + lsls r0, 1 + mov r12, r0 + movs r2, 0x1 + mov r8, r2 + adds r3, r4, 0 + movs r7, 0xFE +_0806C218: + lsls r0, r5, 3 + adds r0, r4 + add r0, r12 + ldrb r1, [r0] + mov r0, r8 + ands r0, r1 + cmp r0, 0 + beq _0806C234 + ldr r0, _0806C260 + adds r2, r3, r0 + ldrb r1, [r2] + adds r0, r7, 0 + ands r0, r1 + strb r0, [r2] +_0806C234: + adds r3, 0x8 + adds r5, 0x1 + cmp r5, 0x3 + ble _0806C218 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_806C264 +_0806C244: + mov r5, r9 + cmp r5, 0x3 + ble _0806C1E2 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0806C258: .4byte gUnknown_203B418 +_0806C25C: .4byte 0x0001357c +_0806C260: .4byte 0x00000119 + thumb_func_end sub_806C1D8 + + thumb_func_start sub_806C264 +sub_806C264: + push {r4,r5,lr} + mov r12, r1 + ldr r2, _0806C31C + movs r1, 0x64 + muls r0, r1 + ldr r1, _0806C320 + adds r0, r1 + ldr r1, [r2] + adds r3, r1, r0 + mov r2, r12 + ldrh r0, [r2, 0xE] + strh r0, [r3, 0x10] + ldrh r0, [r2, 0x10] + strh r0, [r3, 0x12] + ldr r0, [r2, 0x18] + str r0, [r3, 0x18] + adds r2, 0x14 + adds r1, r3, 0 + adds r1, 0x14 + movs r4, 0x1 +_0806C28C: + ldrb r0, [r2] + strb r0, [r1] + ldrb r0, [r2, 0x2] + strb r0, [r1, 0x2] + adds r2, 0x1 + adds r1, 0x1 + subs r4, 0x1 + cmp r4, 0 + bge _0806C28C + ldr r4, _0806C324 + adds r0, r4, 0 + mov r5, r12 + ldrh r5, [r5, 0x4] + adds r0, r5 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bhi _0806C2B6 + movs r0, 0xBC + lsls r0, 1 + strh r0, [r3, 0xE] +_0806C2B6: + adds r1, r3, 0 + adds r1, 0x1C + movs r0, 0x8C + lsls r0, 1 + add r0, r12 + ldm r0!, {r2,r4,r5} + stm r1!, {r2,r4,r5} + ldm r0!, {r2,r4,r5} + stm r1!, {r2,r4,r5} + ldm r0!, {r2,r4,r5} + stm r1!, {r2,r4,r5} + mov r1, r12 + ldrb r0, [r1, 0x9] + strb r0, [r3, 0x3] + ldrh r0, [r1, 0xC] + strh r0, [r3, 0x8] + mov r0, r12 + adds r0, 0x8C + ldr r0, [r0] + str r0, [r3, 0x4C] + mov r0, r12 + adds r0, 0x94 + ldrb r1, [r0] + adds r0, r3, 0 + adds r0, 0x50 + strb r1, [r0] + mov r2, r12 + ldr r0, [r2, 0x3C] + str r0, [r3, 0x54] + movs r0, 0x9E + lsls r0, 1 + add r0, r12 + ldr r0, [r0] + str r0, [r3, 0x44] + movs r0, 0xA0 + lsls r0, 1 + add r0, r12 + ldr r0, [r0] + str r0, [r3, 0x48] + ldr r0, [r2, 0x60] + str r0, [r3, 0x40] + movs r4, 0xA + ldrsh r1, [r3, r4] + ldr r0, _0806C328 + cmp r1, r0 + bne _0806C316 + ldr r0, _0806C32C + strh r0, [r3, 0xA] +_0806C316: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0806C31C: .4byte gUnknown_203B45C +_0806C320: .4byte 0x00008df8 +_0806C324: .4byte 0xfffffe87 +_0806C328: .4byte 0x000055aa +_0806C32C: .4byte 0x00005aa5 + thumb_func_end sub_806C264 + + thumb_func_start sub_806C330 +sub_806C330: + push {r4-r7,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r2, 16 + asrs r2, 16 + mov r12, r2 + lsls r3, 24 + lsrs r7, r3, 24 + ldr r0, _0806C370 + ldr r0, [r0] + ldr r1, _0806C374 + adds r2, r0, r1 + movs r3, 0 + ldr r0, [r2, 0x40] + cmp r3, r0 + bge _0806C382 + mov r1, r12 + lsls r0, r1, 16 + lsrs r6, r0, 16 + adds r1, r2, 0 +_0806C358: + ldrb r0, [r1, 0x3] + cmp r0, 0 + beq _0806C378 + ldrb r0, [r1, 0x4] + cmp r0, r4 + bne _0806C378 + ldrb r0, [r1, 0x5] + cmp r0, r5 + bne _0806C378 + strh r6, [r1] + strb r7, [r1, 0x2] + b _0806C3B8 + .align 2, 0 +_0806C370: .4byte gUnknown_203B418 +_0806C374: .4byte 0x0000057c +_0806C378: + adds r1, 0x8 + adds r3, 0x1 + ldr r0, [r2, 0x40] + cmp r3, r0 + blt _0806C358 +_0806C382: + ldr r0, [r2, 0x40] + cmp r0, 0x7 + bgt _0806C3B8 + lsls r0, 3 + adds r0, r2, r0 + movs r1, 0x1 + strb r1, [r0, 0x3] + ldr r0, [r2, 0x40] + lsls r0, 3 + adds r0, r2, r0 + strb r4, [r0, 0x4] + ldr r0, [r2, 0x40] + lsls r0, 3 + adds r0, r2, r0 + strb r5, [r0, 0x5] + ldr r0, [r2, 0x40] + lsls r0, 3 + adds r0, r2, r0 + mov r1, r12 + strh r1, [r0] + ldr r0, [r2, 0x40] + lsls r0, 3 + adds r0, r2, r0 + strb r7, [r0, 0x2] + ldr r0, [r2, 0x40] + adds r0, 0x1 + str r0, [r2, 0x40] +_0806C3B8: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_806C330 + + thumb_func_start sub_806C3C0 +sub_806C3C0: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x18 + ldr r0, _0806C424 + ldr r0, [r0] + ldr r1, _0806C428 + adds r7, r0, r1 + movs r6, 0 + ldr r0, [r7, 0x40] + cmp r6, r0 + bge _0806C416 + mov r5, sp + movs r0, 0 + mov r8, r0 + movs r2, 0 + adds r4, r7, 0 +_0806C3E2: + ldrb r0, [r4, 0x3] + cmp r0, 0 + beq _0806C40C + ldrh r0, [r4] + strh r0, [r5] + strh r2, [r5, 0x8] + ldrb r0, [r4, 0x4] + strh r0, [r5, 0xC] + ldrb r0, [r4, 0x5] + strh r0, [r5, 0xE] + ldrb r0, [r4, 0x2] + strb r0, [r5, 0x2] + str r2, [sp, 0x4] + mov r1, r8 + strb r1, [r5, 0x10] + mov r0, sp + movs r1, 0x1 + str r2, [sp, 0x14] + bl sub_806B7F8 + ldr r2, [sp, 0x14] +_0806C40C: + adds r4, 0x8 + adds r6, 0x1 + ldr r0, [r7, 0x40] + cmp r6, r0 + blt _0806C3E2 +_0806C416: + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0806C424: .4byte gUnknown_203B418 +_0806C428: .4byte 0x0000057c + thumb_func_end sub_806C3C0 + + thumb_func_start sub_806C42C +sub_806C42C: + ldr r0, _0806C43C + ldr r0, [r0] + ldr r1, _0806C440 + adds r0, r1 + movs r1, 0 + str r1, [r0, 0x40] + bx lr + .align 2, 0 +_0806C43C: .4byte gUnknown_203B418 +_0806C440: .4byte 0x0000057c + thumb_func_end sub_806C42C + + thumb_func_start sub_806C444 +sub_806C444: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + adds r7, r1, 0 + lsls r0, 16 + asrs r6, r0, 16 + adds r0, r6, 0 + bl sub_808DBC0 + adds r5, r0, 0 + movs r4, 0x2 + cmp r4, r7 + bgt _0806C478 + mov r8, sp +_0806C462: + mov r0, sp + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_808E010 + mov r1, r8 + ldrh r0, [r1, 0x4] + adds r5, r0 + adds r4, 0x1 + cmp r4, r7 + ble _0806C462 +_0806C478: + adds r0, r5, 0 + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_806C444 + + thumb_func_start sub_806C488 +sub_806C488: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + adds r7, r1, 0 + mov r8, r2 + lsls r0, 16 + asrs r6, r0, 16 + adds r0, r6, 0 + mov r1, r8 + bl sub_808DC28 + adds r5, r0, 0 + movs r4, 0x2 + cmp r4, r7 + bgt _0806C4C4 + mov r0, sp + adds r0, 0x6 + add r8, r0 +_0806C4AE: + mov r0, sp + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_808E010 + mov r1, r8 + ldrb r0, [r1] + adds r5, r0 + adds r4, 0x1 + cmp r4, r7 + ble _0806C4AE +_0806C4C4: + adds r0, r5, 0 + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_806C488 + + thumb_func_start sub_806C4D4 +sub_806C4D4: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + adds r7, r1, 0 + mov r8, r2 + lsls r0, 16 + asrs r6, r0, 16 + adds r0, r6, 0 + mov r1, r8 + bl sub_808DC48 + adds r5, r0, 0 + movs r4, 0x2 + cmp r4, r7 + bgt _0806C50E + add r0, sp, 0x8 + add r8, r0 +_0806C4F8: + mov r0, sp + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_808E010 + mov r1, r8 + ldrb r0, [r1] + adds r5, r0 + adds r4, 0x1 + cmp r4, r7 + ble _0806C4F8 +_0806C50E: + adds r0, r5, 0 + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_806C4D4 + + thumb_func_start sub_806C51C +sub_806C51C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x50 + adds r6, r0, 0 + ldr r0, [r6, 0x70] + mov r8, r0 + ldr r0, _0806C544 + ldr r1, [r0] + ldr r2, _0806C548 + adds r0, r1, r2 + ldr r0, [r0] + cmp r0, r6 + bne _0806C54C + movs r3, 0 + str r3, [sp, 0x38] + b _0806C554 + .align 2, 0 +_0806C544: .4byte gUnknown_203B418 +_0806C548: .4byte 0x000181f8 +_0806C54C: + ldr r4, _0806C5AC + adds r0, r1, r4 + ldrb r0, [r0] + str r0, [sp, 0x38] +_0806C554: + mov r0, r8 + adds r0, 0xC8 + ldrb r1, [r0] + str r0, [sp, 0x40] + cmp r1, 0x2 + bne _0806C564 + movs r7, 0x1 + str r7, [sp, 0x38] +_0806C564: + adds r0, r6, 0 + adds r0, 0x6B + adds r1, r6, 0 + adds r1, 0x6A + ldrb r2, [r0] + str r0, [sp, 0x48] + mov r9, r1 + adds r5, r6, 0 + adds r5, 0x6D + adds r0, 0x1 + str r0, [sp, 0x4C] + adds r4, r6, 0 + adds r4, 0x6F + subs r1, 0x47 + str r1, [sp, 0x44] + mov r3, r9 + ldrb r3, [r3] + cmp r2, r3 + bne _0806C676 + ldrb r0, [r5] + ldr r7, [sp, 0x4C] + ldrb r7, [r7] + cmp r0, r7 + bne _0806C654 + ldrb r0, [r4] + cmp r0, 0 + bne _0806C654 + movs r2, 0 + ldrh r1, [r6, 0x28] + movs r0, 0x80 + lsls r0, 6 + ands r0, r1 + cmp r0, 0 + beq _0806C5B0 + movs r0, 0 + b _0806C5B2 + .align 2, 0 +_0806C5AC: .4byte 0x00018210 +_0806C5B0: + lsrs r0, r1, 15 +_0806C5B2: + cmp r0, 0 + bne _0806C5B8 + movs r2, 0x1 +_0806C5B8: + adds r0, r6, 0 + adds r0, 0x23 + str r0, [sp, 0x44] + cmp r2, 0 + beq _0806C654 + adds r0, r6, 0 + bl sub_806CEBC + lsls r0, 24 + lsrs r3, r0, 24 + adds r1, r6, 0 + adds r1, 0x21 + movs r0, 0x1 + strb r0, [r1] + mov r1, r8 + adds r1, 0xFE + ldrb r0, [r1] + cmp r0, 0x63 + bne _0806C620 + ldr r1, [sp, 0x48] + ldrb r0, [r1] + cmp r0, 0xC + bhi _0806C61C + mov r0, r8 + adds r0, 0xC0 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0806C5F4 + movs r2, 0x2 + b _0806C600 +_0806C5F4: + ldr r2, [sp, 0x44] + ldrb r0, [r2] + movs r2, 0x1 + cmp r0, 0x2 + bhi _0806C600 + movs r2, 0 +_0806C600: + ldr r1, _0806C618 + movs r0, 0xD + muls r0, r2 + ldr r7, [sp, 0x48] + ldrb r7, [r7] + adds r0, r7 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x7 + bne _0806C622 + adds r0, r3, 0 + b _0806C622 + .align 2, 0 +_0806C618: .4byte gUnknown_8106EC8 +_0806C61C: + movs r0, 0x63 + b _0806C622 +_0806C620: + ldrb r0, [r1] +_0806C622: + cmp r0, 0x63 + beq _0806C654 + mov r1, r9 + strb r0, [r1] + ldrb r1, [r5] + movs r0, 0x7 + ands r0, r1 + ldr r2, [sp, 0x4C] + strb r0, [r2] + movs r0, 0x1 + strb r0, [r4] + mov r7, r9 + ldrb r0, [r7] + cmp r0, 0x6 + bne _0806C654 + adds r1, r6, 0 + adds r1, 0x6E + ldrb r0, [r1] + adds r0, 0x1 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x10 + bne _0806C654 + strb r3, [r7] +_0806C654: + ldr r1, [sp, 0x48] + ldrb r0, [r1] + mov r2, r9 + ldrb r2, [r2] + cmp r0, r2 + bne _0806C676 + ldrb r0, [r5] + ldr r3, [sp, 0x4C] + ldrb r3, [r3] + cmp r0, r3 + bne _0806C676 + ldrb r0, [r4] + movs r7, 0x28 + adds r7, r6 + mov r10, r7 + cmp r0, 0 + beq _0806C714 +_0806C676: + mov r1, r9 + ldrb r0, [r1] + ldr r2, [sp, 0x48] + strb r0, [r2] + ldr r3, [sp, 0x4C] + mov r10, r3 + ldrb r0, [r3] + strb r0, [r5] + movs r7, 0 + strb r7, [r4] + adds r0, r6, 0 + adds r0, 0x68 + movs r1, 0 + ldrsh r7, [r0, r1] + mov r2, r8 + movs r3, 0x4 + ldrsh r0, [r2, r3] + mov r4, r9 + ldrb r1, [r4] + bl sub_808DA44 + lsls r0, 24 + cmp r0, 0 + beq _0806C6A8 + movs r7, 0 +_0806C6A8: + ldr r0, [sp, 0x38] + cmp r0, 0 + bne _0806C6D6 + bl Random + movs r4, 0x3 + ands r4, r0 + adds r5, r6, 0 + adds r5, 0x28 + ldr r1, [r6, 0x64] + mov r3, r9 + ldrb r2, [r3] + mov r0, r10 + ldrb r3, [r0] + str r7, [sp] + str r4, [sp, 0x4] + ldr r4, [sp, 0x38] + str r4, [sp, 0x8] + adds r0, r5, 0 + bl sub_80053AC + mov r10, r5 + b _0806C704 +_0806C6D6: + ldr r0, _0806C774 + bl sub_80687D0 + adds r5, r0, 0 + bl Random + movs r1, 0x3 + ands r1, r0 + adds r4, r6, 0 + adds r4, 0x28 + mov r0, r9 + ldrb r2, [r0] + ldr r0, [sp, 0x4C] + ldrb r3, [r0] + str r7, [sp] + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80053AC + mov r10, r4 +_0806C704: + mov r2, r9 + ldrb r0, [r2] + cmp r0, 0x6 + beq _0806C714 + adds r1, r6, 0 + adds r1, 0x6E + movs r0, 0 + strb r0, [r1] +_0806C714: + ldr r0, _0806C778 + ldr r1, [r0] + ldr r3, _0806C77C + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + beq _0806C784 + ldr r4, [sp, 0x48] + ldrb r0, [r4] + cmp r0, 0x7 + bne _0806C73C + mov r7, r8 + movs r1, 0x4 + ldrsh r0, [r7, r1] + bl sub_808DB14 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _0806C7E2 +_0806C73C: + movs r0, 0xAE + lsls r0, 1 + add r0, r8 + ldrb r0, [r0] + cmp r0, 0 + beq _0806C76A + movs r0, 0xB0 + lsls r0, 1 + add r0, r8 + ldrb r0, [r0] + cmp r0, 0 + bne _0806C7E2 + ldr r0, _0806C780 + add r0, r8 + ldrb r0, [r0] + cmp r0, 0 + beq _0806C76A + mov r0, r10 + bl sub_80054BC + mov r0, r10 + bl sub_80054BC +_0806C76A: + mov r0, r10 + bl sub_80054BC + b _0806C7E2 + .align 2, 0 +_0806C774: .4byte 0x000001a5 +_0806C778: .4byte gUnknown_203B418 +_0806C77C: .4byte 0x0001356c +_0806C780: .4byte 0x0000015f +_0806C784: + mov r0, r8 + adds r0, 0xB0 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0806C7E2 + cmp r0, 0x6 + beq _0806C7E2 + ldr r2, _0806C7B4 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _0806C7BC + ldr r3, _0806C7B8 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _0806C7BC + mov r0, r10 + bl sub_80054BC + mov r0, r10 + bl sub_80054BC + b _0806C7DC + .align 2, 0 +_0806C7B4: .4byte 0x0000066c +_0806C7B8: .4byte 0x0001c05f +_0806C7BC: + ldr r4, [sp, 0x48] + ldrb r0, [r4] + cmp r0, 0 + beq _0806C7C8 + cmp r0, 0x7 + bne _0806C7DC +_0806C7C8: + ldr r0, [r6, 0x70] + movs r7, 0x82 + lsls r7, 1 + adds r0, r7 + ldr r0, [r0] + cmp r0, 0x1 + ble _0806C7DC + mov r0, r10 + bl sub_80054BC +_0806C7DC: + mov r0, r10 + bl sub_80054BC +_0806C7E2: + ldr r1, [r6, 0xC] + ldr r0, [r6, 0x14] + cmp r1, r0 + bne _0806C800 + ldr r1, [r6, 0x10] + ldr r0, [r6, 0x18] + cmp r1, r0 + bne _0806C800 + ldr r1, [sp, 0x44] + ldrb r0, [r1] + cmp r0, 0x9 + bhi _0806C806 + adds r0, 0x1 + strb r0, [r1] + b _0806C806 +_0806C800: + movs r0, 0 + ldr r2, [sp, 0x44] + strb r0, [r2] +_0806C806: + ldr r0, [r6, 0xC] + str r0, [r6, 0x14] + ldr r2, [r6, 0x10] + str r2, [r6, 0x18] + cmp r0, 0 + bge _0806C814 + adds r0, 0xFF +_0806C814: + asrs r1, r0, 8 + ldr r0, _0806C88C + ldr r3, [r0] + ldr r4, _0806C890 + adds r0, r3, r4 + movs r7, 0 + ldrsh r0, [r0, r7] + subs r1, r0 + str r1, [sp, 0x2C] + ldr r0, [r6, 0x1C] + subs r0, r2, r0 + movs r1, 0xBA + lsls r1, 1 + add r1, r8 + ldr r1, [r1] + subs r0, r1 + cmp r0, 0 + bge _0806C83A + adds r0, 0xFF +_0806C83A: + asrs r1, r0, 8 + ldr r4, _0806C894 + adds r0, r3, r4 + movs r7, 0 + ldrsh r3, [r0, r7] + subs r1, r3 + str r1, [sp, 0x30] + adds r0, r2, 0 + cmp r0, 0 + bge _0806C850 + adds r0, 0xFF +_0806C850: + asrs r0, 8 + subs r0, r3 + mov r9, r0 + lsrs r0, 31 + add r0, r9 + asrs r0, 1 + mov r9, r0 + movs r0, 0xAB + lsls r0, 1 + add r0, r8 + ldrb r0, [r0] + cmp r0, 0 + bne _0806C870 + movs r0, 0x1 + negs r0, r0 + add r9, r0 +_0806C870: + movs r0, 0xAE + lsls r0, 1 + add r0, r8 + ldrb r0, [r0] + cmp r0, 0 + bne _0806C898 + adds r0, r6, 0 + bl sub_8042768 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x34] + b _0806C8D8 + .align 2, 0 +_0806C88C: .4byte gUnknown_203B418 +_0806C890: .4byte 0x000181f0 +_0806C894: .4byte 0x000181f2 +_0806C898: + ldr r0, _0806C8B8 + add r0, r8 + ldrb r0, [r0] + cmp r0, 0 + beq _0806C8C6 + ldr r0, _0806C8BC + ldr r0, [r0] + movs r1, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0806C8C0 + ldr r1, [sp, 0x2C] + adds r1, 0x1 + str r1, [sp, 0x2C] + b _0806C8C6 + .align 2, 0 +_0806C8B8: .4byte 0x0000015d +_0806C8BC: .4byte gUnknown_202EDCC +_0806C8C0: + ldr r2, [sp, 0x2C] + subs r2, 0x1 + str r2, [sp, 0x2C] +_0806C8C6: + movs r1, 0 + movs r0, 0xAF + lsls r0, 1 + add r0, r8 + ldrb r0, [r0] + cmp r0, 0 + bne _0806C8D6 + movs r1, 0x1 +_0806C8D6: + str r1, [sp, 0x34] +_0806C8D8: + ldr r0, [r6, 0xC] + cmp r0, 0 + bge _0806C8E0 + adds r0, 0xFF +_0806C8E0: + lsls r0, 8 + lsrs r0, 16 + ldr r1, _0806C998 + ldr r2, [sp, 0x28] + ands r2, r1 + orrs r2, r0 + str r2, [sp, 0x28] + ldr r1, [r6, 0x10] + ldr r0, [r6, 0x1C] + subs r1, r0 + movs r5, 0xBA + lsls r5, 1 + add r5, r8 + ldr r0, [r5] + subs r0, r1, r0 + cmp r0, 0 + bge _0806C904 + adds r0, 0xFF +_0806C904: + lsls r0, 8 + lsrs r0, 16 + lsls r0, 16 + ldr r1, _0806C99C + ands r2, r1 + orrs r2, r0 + str r2, [sp, 0x28] + add r0, sp, 0xC + mov r1, r10 + bl sub_8005700 + mov r4, r8 + adds r4, 0x98 + ldr r0, [r4] + add r1, sp, 0x28 + ldr r2, _0806C9A0 + ldr r2, [r2] + ldr r3, _0806C9A4 + adds r2, r3 + ldrb r3, [r2] + add r2, sp, 0xC + bl sub_800F958 + adds r0, r6, 0 + bl sub_804187C + adds r2, r0, 0 + ldr r4, [r4] + mov r0, r8 + movs r1, 0x4 + ldrsh r7, [r0, r1] + movs r3, 0 + ldr r0, [sp, 0x34] + cmp r0, 0 + beq _0806C958 + movs r0, 0xA6 + lsls r0, 1 + add r0, r8 + ldrb r1, [r0] + negs r0, r1 + orrs r0, r1 + lsrs r3, r0, 31 +_0806C958: + adds r0, r4, 0 + adds r1, r7, 0 + bl sub_800F75C + adds r0, r6, 0 + mov r1, r9 + bl sub_8042EC8 + movs r0, 0xAE + lsls r0, 1 + add r0, r8 + ldrb r1, [r0] + cmp r1, 0 + bne _0806C9BA + mov r0, r8 + adds r0, 0xFF + ldrb r0, [r0] + cmp r0, 0x1 + bne _0806C9AC + ldr r1, [r5] + ldr r0, _0806C9A8 + cmp r1, r0 + bgt _0806C9BA + movs r2, 0x80 + lsls r2, 4 + adds r0, r1, r2 + str r0, [r5] + movs r1, 0xC8 + lsls r1, 8 + cmp r0, r1 + ble _0806C9BA + b _0806C9B8 + .align 2, 0 +_0806C998: .4byte 0xffff0000 +_0806C99C: .4byte 0x0000ffff +_0806C9A0: .4byte gUnknown_203B418 +_0806C9A4: .4byte 0x00018208 +_0806C9A8: .4byte 0x0000c7ff +_0806C9AC: + ldr r0, [r5] + ldr r3, _0806CA5C + adds r0, r3 + str r0, [r5] + cmp r0, 0 + bge _0806C9BA +_0806C9B8: + str r1, [r5] +_0806C9BA: + ldr r4, [sp, 0x34] + cmp r4, 0 + bne _0806C9C2 + b _0806CBDE +_0806C9C2: + movs r4, 0 + adds r0, r6, 0 + bl sub_806CF54 + lsls r0, 24 + lsrs r7, r0, 24 + add r1, sp, 0x1C + ldr r2, _0806CA60 + strh r2, [r1] + ldr r0, _0806CA64 + strh r0, [r1, 0x2] + strh r2, [r1, 0x4] + strh r4, [r1, 0x6] + strh r4, [r1, 0x8] + ldr r0, _0806CA68 + ldr r0, [r0] + ldr r2, _0806CA6C + adds r0, r2 + ldrb r0, [r0] + lsls r0, 10 + strh r0, [r1, 0xA] + mov r3, r8 + ldrb r0, [r3, 0x6] + adds r5, r1, 0 + cmp r0, 0 + beq _0806CA08 + ldr r1, _0806CA70 + adds r0, r1, 0 + ldrh r2, [r3, 0x4] + adds r0, r2 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bhi _0806CA08 + movs r4, 0x1 +_0806CA08: + mov r0, r8 + adds r0, 0xE4 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0806CA22 + ldr r0, _0806CA68 + ldr r0, [r0] + ldr r3, _0806CA74 + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _0806CA22 + movs r4, 0x1 +_0806CA22: + cmp r4, 0 + beq _0806CA32 + ldrh r1, [r5, 0x6] + movs r4, 0x80 + lsls r4, 3 + adds r0, r4, 0 + orrs r0, r1 + strh r0, [r5, 0x6] +_0806CA32: + movs r0, 0 + str r0, [sp, 0x3C] + mov r1, r8 + ldrb r0, [r1, 0x6] + cmp r0, 0 + beq _0806CA46 + ldr r2, [sp, 0x40] + ldrb r0, [r2] + cmp r0, 0x2 + bne _0806CA4A +_0806CA46: + movs r3, 0x1 + str r3, [sp, 0x3C] +_0806CA4A: + mov r0, r8 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x4A + beq _0806CA58 + cmp r0, 0x47 + bne _0806CA78 +_0806CA58: + movs r0, 0x1 + b _0806CA7A + .align 2, 0 +_0806CA5C: .4byte 0xfffff400 +_0806CA60: .4byte 0x0000f3ff +_0806CA64: .4byte 0x0000ffff +_0806CA68: .4byte gUnknown_203B418 +_0806CA6C: .4byte 0x00018208 +_0806CA70: .4byte 0xfffffe5f +_0806CA74: .4byte 0x0001820f +_0806CA78: + movs r0, 0 +_0806CA7A: + cmp r0, 0 + bne _0806CA88 + mov r0, r8 + adds r0, 0xA4 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0806CA8C +_0806CA88: + movs r4, 0x1 + str r4, [sp, 0x3C] +_0806CA8C: + mov r0, r8 + adds r0, 0xFF + ldrb r0, [r0] + cmp r0, 0x2 + beq _0806CB16 + mov r0, r8 + adds r0, 0xB0 + ldrb r1, [r0] + cmp r1, 0x6 + beq _0806CAAC + subs r0, 0x4 + ldrb r0, [r0] + cmp r0, 0x4 + beq _0806CAAC + cmp r1, 0x2 + bne _0806CABA +_0806CAAC: + ldr r0, _0806CAC4 + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + ldr r1, [sp, 0x2C] + adds r1, r0 + str r1, [sp, 0x2C] +_0806CABA: + ldr r2, [sp, 0x38] + cmp r2, 0 + beq _0806CACC + ldr r0, _0806CAC8 + b _0806CAD2 + .align 2, 0 +_0806CAC4: .4byte gUnknown_202EDCC +_0806CAC8: .4byte 0x000001a5 +_0806CACC: + mov r3, r8 + movs r4, 0x4 + ldrsh r0, [r3, r4] +_0806CAD2: + movs r1, 0 + bl sub_808DD68 + lsls r0, 24 + lsrs r2, r0, 24 + adds r0, r6, 0 + adds r0, 0x22 + ldrb r1, [r0] + cmp r1, 0 + bne _0806CAF8 + str r2, [sp] + str r5, [sp, 0x4] + mov r0, r10 + ldr r1, [sp, 0x2C] + ldr r2, [sp, 0x30] + mov r3, r9 + bl sub_800558C + b _0806CB16 +_0806CAF8: + cmp r1, 0x1 + bne _0806CB16 + ldr r0, _0806CBF0 + ldr r0, [r0] + ands r0, r1 + cmp r0, 0 + beq _0806CB16 + str r2, [sp] + str r5, [sp, 0x4] + mov r0, r10 + ldr r1, [sp, 0x2C] + ldr r2, [sp, 0x30] + mov r3, r9 + bl sub_800558C +_0806CB16: + ldr r0, [r6, 0xC] + cmp r0, 0 + bge _0806CB1E + adds r0, 0xFF +_0806CB1E: + asrs r0, 8 + ldrh r1, [r6, 0x38] + adds r0, r1 + movs r1, 0xB8 + lsls r1, 1 + add r1, r8 + strh r0, [r1] + ldr r0, [r6, 0x10] + cmp r0, 0 + bge _0806CB34 + adds r0, 0xFF +_0806CB34: + asrs r0, 8 + ldrh r2, [r6, 0x3A] + adds r0, r2 + movs r3, 0xB9 + lsls r3, 1 + add r3, r8 + strh r0, [r3] + movs r4, 0 + ldrsh r2, [r1, r4] + ldr r0, _0806CBF4 + ldr r1, [r0] + ldr r4, _0806CBF8 + adds r0, r1, r4 + movs r4, 0 + ldrsh r0, [r0, r4] + subs r4, r2, r0 + movs r0, 0 + ldrsh r2, [r3, r0] + ldr r3, _0806CBFC + adds r1, r3 + movs r3, 0 + ldrsh r0, [r1, r3] + subs r5, r2, r0 + movs r0, 0x20 + negs r0, r0 + cmp r4, r0 + blt _0806CBDE + cmp r5, r0 + blt _0806CBDE + ldr r0, _0806CC00 + cmp r4, r0 + bgt _0806CBDE + cmp r5, 0xBF + bgt _0806CBDE + cmp r7, 0x6 + beq _0806CBDE + adds r0, r6, 0 + adds r0, 0x22 + ldrb r0, [r0] + cmp r0, 0 + bne _0806CBDE + ldr r0, [sp, 0x3C] + lsls r2, r0, 3 + adds r2, r0 + lsls r2, 3 + lsls r0, r7, 1 + adds r0, r7 + lsls r0, 2 + ldr r1, _0806CC04 + adds r0, r1 + adds r3, r2, r0 + movs r0, 0xAB + lsls r0, 1 + add r0, r8 + ldrb r0, [r0] + cmp r0, 0 + beq _0806CBDE + movs r2, 0x8 + ldrsh r1, [r3, r2] + adds r1, r4, r1 + ldr r0, _0806CC08 + ands r1, r0 + ldrh r2, [r3, 0x2] + movs r0, 0xFE + lsls r0, 8 + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x2] + movs r4, 0xA + ldrsh r1, [r3, r4] + adds r1, r5, r1 + ldr r0, _0806CC0C + ands r1, r0 + lsls r1, 4 + ldrh r2, [r3, 0x6] + movs r0, 0xF + ands r0, r2 + orrs r0, r1 + strh r0, [r3, 0x6] + adds r0, r3, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl AddSprite +_0806CBDE: + add sp, 0x50 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0806CBF0: .4byte gUnknown_202EDCC +_0806CBF4: .4byte gUnknown_203B418 +_0806CBF8: .4byte 0x000181f0 +_0806CBFC: .4byte 0x000181f2 +_0806CC00: .4byte 0x0000010f +_0806CC04: .4byte gUnknown_202ED28 +_0806CC08: .4byte 0x000001ff +_0806CC0C: .4byte 0x00000fff + thumb_func_end sub_806C51C + + thumb_func_start sub_806CC10 +sub_806CC10: + push {r4,r5,lr} + movs r5, 0 +_0806CC14: + ldr r0, _0806CC68 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _0806CC6C + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0806CC5C + ldr r2, [r4, 0x70] + movs r1, 0xB3 + lsls r1, 1 + adds r0, r2, r1 + ldrb r1, [r0] + cmp r1, 0 + beq _0806CC5C + subs r1, 0x1 + strb r1, [r0] + movs r0, 0x1 + ands r1, r0 + cmp r1, 0 + bne _0806CC5C + adds r0, r2, 0 + adds r0, 0x46 + ldrb r2, [r0] + subs r2, 0x1 + movs r0, 0x7 + ands r2, r0 + adds r0, r4, 0 + movs r1, 0 + bl sub_806CDD4 +_0806CC5C: + adds r5, 0x1 + cmp r5, 0x13 + ble _0806CC14 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0806CC68: .4byte gUnknown_203B418 +_0806CC6C: .4byte 0x000135cc + thumb_func_end sub_806CC10 + + thumb_func_start sub_806CC70 +sub_806CC70: + push {r4,r5,lr} + movs r5, 0 +_0806CC74: + ldr r0, _0806CCAC + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _0806CCB0 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0806CCA0 + adds r0, r4, 0 + bl sub_806CEBC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_806CCB4 +_0806CCA0: + adds r5, 0x1 + cmp r5, 0x13 + ble _0806CC74 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0806CCAC: .4byte gUnknown_203B418 +_0806CCB0: .4byte 0x000135cc + thumb_func_end sub_806CC70 + + thumb_func_start sub_806CCB4 +sub_806CCB4: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xC + adds r5, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + ldr r7, [r5, 0x70] + ldr r0, _0806CD40 + ldr r0, [r0] + ldr r2, _0806CD44 + adds r1, r0, r2 + ldrb r6, [r1] + ldr r3, _0806CD48 + adds r0, r3 + ldr r0, [r0] + cmp r5, r0 + bne _0806CCDC + movs r6, 0 +_0806CCDC: + adds r0, r5, 0 + adds r0, 0x6B + movs r3, 0 + strb r4, [r0] + adds r2, r5, 0 + adds r2, 0x6A + strb r4, [r2] + adds r4, r7, 0 + adds r4, 0x46 + ldrb r0, [r4] + adds r1, r5, 0 + adds r1, 0x6D + strb r0, [r1] + ldrb r0, [r4] + subs r1, 0x1 + strb r0, [r1] + adds r0, r5, 0 + adds r0, 0x6F + strb r3, [r0] + subs r0, 0x7 + movs r3, 0 + ldrsh r4, [r0, r3] + mov r9, r4 + adds r0, r7, 0 + adds r0, 0xC8 + ldrb r0, [r0] + adds r7, r2, 0 + mov r8, r1 + cmp r0, 0x2 + beq _0806CD4C + cmp r6, 0 + bne _0806CD4C + bl Random + movs r4, 0x3 + ands r4, r0 + adds r0, r5, 0 + adds r0, 0x28 + ldr r1, [r5, 0x64] + ldrb r2, [r7] + mov r7, r8 + ldrb r3, [r7] + mov r7, r9 + str r7, [sp] + str r4, [sp, 0x4] + str r6, [sp, 0x8] + bl sub_80053AC + b _0806CD76 + .align 2, 0 +_0806CD40: .4byte gUnknown_203B418 +_0806CD44: .4byte 0x00018210 +_0806CD48: .4byte 0x000181f8 +_0806CD4C: + ldr r0, _0806CD8C + bl sub_80687D0 + adds r4, r0, 0 + bl Random + movs r1, 0x3 + ands r1, r0 + adds r0, r5, 0 + adds r0, 0x28 + ldrb r2, [r7] + mov r6, r8 + ldrb r3, [r6] + mov r7, r9 + str r7, [sp] + str r1, [sp, 0x4] + movs r1, 0 + str r1, [sp, 0x8] + adds r1, r4, 0 + bl sub_80053AC +_0806CD76: + adds r1, r5, 0 + adds r1, 0x6E + movs r0, 0 + strb r0, [r1] + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0806CD8C: .4byte 0x000001a5 + thumb_func_end sub_806CCB4 + + thumb_func_start sub_806CD90 +sub_806CD90: + push {r4,r5,lr} + movs r5, 0 +_0806CD94: + ldr r0, _0806CDCC + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _0806CDD0 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0806CDC0 + adds r0, r4, 0 + bl sub_806CEBC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_806CCB4 +_0806CDC0: + adds r5, 0x1 + cmp r5, 0x13 + ble _0806CD94 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0806CDCC: .4byte gUnknown_203B418 +_0806CDD0: .4byte 0x000135cc + thumb_func_end sub_806CD90 + + thumb_func_start sub_806CDD4 +sub_806CDD4: + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r2, 0 + lsls r1, 24 + lsrs r5, r1, 24 + bl sub_80450F8 + cmp r0, 0x1 + bne _0806CDF4 + adds r0, r4, 0 + adds r0, 0x6A + strb r5, [r0] + cmp r6, 0x7 + bhi _0806CDF4 + adds r0, 0x2 + strb r6, [r0] +_0806CDF4: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_806CDD4 + + thumb_func_start sub_806CDFC +sub_806CDFC: + push {r4-r7,lr} + adds r4, r0, 0 + adds r6, r2, 0 + lsls r1, 24 + lsrs r5, r1, 24 + adds r7, r5, 0 + bl sub_80450F8 + cmp r0, 0x1 + bne _0806CE2E + adds r0, r4, 0 + adds r0, 0x6B + ldrb r0, [r0] + cmp r0, r5 + bne _0806CE24 + adds r0, r4, 0 + adds r0, 0x6D + ldrb r0, [r0] + cmp r0, r6 + beq _0806CE2E +_0806CE24: + adds r0, r4, 0 + adds r1, r7, 0 + adds r2, r6, 0 + bl sub_806CDD4 +_0806CE2E: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_806CDFC + + thumb_func_start sub_806CE34 +sub_806CE34: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80450F8 + cmp r0, 0x1 + bne _0806CE62 + adds r0, r4, 0 + bl sub_806CEBC + adds r1, r4, 0 + adds r1, 0x6A + strb r0, [r1] + cmp r5, 0x7 + bhi _0806CE62 + ldr r0, [r4, 0x70] + movs r1, 0x7 + ands r1, r5 + adds r0, 0x46 + strb r1, [r0] + adds r0, r4, 0 + adds r0, 0x6C + strb r1, [r0] +_0806CE62: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_806CE34 + + thumb_func_start sub_806CE68 +sub_806CE68: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80450F8 + cmp r0, 0x1 + bne _0806CE8C + adds r0, r4, 0 + bl sub_806CEBC + adds r1, r4, 0 + adds r1, 0x6A + strb r0, [r1] + cmp r5, 0x7 + bhi _0806CE8C + adds r0, r4, 0 + adds r0, 0x6C + strb r5, [r0] +_0806CE8C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_806CE68 + + thumb_func_start sub_806CE94 +sub_806CE94: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_80450F8 + cmp r0, 0x1 + bne _0806CEB4 + adds r1, r4, 0 + adds r1, 0x6A + movs r0, 0x6 + strb r0, [r1] + cmp r5, 0x7 + bhi _0806CEB4 + adds r0, r4, 0 + adds r0, 0x6C + strb r5, [r0] +_0806CEB4: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_806CE94 + + thumb_func_start sub_806CEBC +sub_806CEBC: + push {lr} + ldr r0, [r0, 0x70] + adds r1, r0, 0 + adds r0, 0xA8 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0806CED2 + cmp r0, 0x5 + beq _0806CED2 + cmp r0, 0x3 + bne _0806CEE8 +_0806CED2: + movs r2, 0x4 + ldrsh r0, [r1, r2] + cmp r0, 0xB9 + bne _0806CEE4 + adds r0, r1, 0 + adds r0, 0xA9 + ldrb r0, [r0] + cmp r0, 0x7F + beq _0806CEF2 +_0806CEE4: + movs r0, 0x5 + b _0806CEF8 +_0806CEE8: + adds r0, r1, 0 + adds r0, 0xC0 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0806CEF6 +_0806CEF2: + movs r0, 0x7 + b _0806CEF8 +_0806CEF6: + movs r0, 0xB +_0806CEF8: + pop {r1} + bx r1 + thumb_func_end sub_806CEBC + + thumb_func_start sub_806CEFC +sub_806CEFC: + push {r4,lr} + adds r4, r1, 0 + ldr r2, [r0, 0x70] + movs r3, 0x7 + ands r1, r3 + adds r2, 0x46 + strb r1, [r2] + movs r1, 0x7 + ands r1, r4 + bl sub_806CE68 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_806CEFC + + thumb_func_start sub_806CF18 +sub_806CF18: + push {r4-r6,lr} + adds r4, r0, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0806CF4C + ldr r6, [r4, 0x70] + movs r5, 0 + b _0806CF2E +_0806CF2C: + adds r5, 0x1 +_0806CF2E: + cmp r5, 0x63 + bgt _0806CF4C + movs r0, 0x21 + bl sub_803E46C + movs r1, 0x4 + ldrsh r0, [r6, r1] + adds r1, r4, 0 + adds r1, 0x6B + ldrb r1, [r1] + bl sub_808DA44 + lsls r0, 24 + cmp r0, 0 + bne _0806CF2C +_0806CF4C: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_806CF18 + + thumb_func_start sub_806CF54 +sub_806CF54: + ldr r0, [r0, 0x70] + movs r1, 0x81 + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + bx lr + thumb_func_end sub_806CF54 + + thumb_func_start sub_806CF60 +sub_806CF60: + push {r4,r5,lr} + movs r5, 0 +_0806CF64: + ldr r0, _0806CF90 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _0806CF94 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0806CF84 + adds r0, r4, 0 + bl sub_806CF98 +_0806CF84: + adds r5, 0x1 + cmp r5, 0x13 + ble _0806CF64 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0806CF90: .4byte gUnknown_203B418 +_0806CF94: .4byte 0x000135cc + thumb_func_end sub_806CF60 + + thumb_func_start sub_806CF98 +sub_806CF98: + push {r4-r7,lr} + adds r4, r0, 0 + bl sub_8045128 + ldrh r0, [r0] + movs r5, 0x3 + ands r5, r0 + adds r6, r5, 0 + ldr r7, [r4, 0x70] + movs r1, 0x4 + ldrsh r0, [r7, r1] + bl sub_808DAE4 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r5, 0x3 + bne _0806CFBE + movs r0, 0x6 + b _0806CFF8 +_0806CFBE: + cmp r5, 0x1 + bne _0806CFCE + bl sub_804AF74 + lsls r0, 24 + cmp r0, 0 + beq _0806CFEE + b _0806CFE8 +_0806CFCE: + cmp r6, 0x2 + bne _0806CFEE + ldr r1, _0806D000 + ldr r0, _0806D004 + ldr r0, [r0] + ldr r2, _0806D008 + adds r0, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0806CFEE +_0806CFE8: + ldr r0, _0806D00C + adds r0, r4, r0 + ldrb r4, [r0] +_0806CFEE: + movs r1, 0x81 + lsls r1, 2 + adds r0, r7, r1 + strb r4, [r0] + adds r0, r4, 0 +_0806CFF8: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0806D000: .4byte gUnknown_810ACC0 +_0806D004: .4byte gUnknown_203B418 +_0806D008: .4byte 0x00003a0e +_0806D00C: .4byte gUnknown_8106EEF + thumb_func_end sub_806CF98 + + thumb_func_start sub_806D010 +sub_806D010: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + adds r6, r0, 0 + adds r5, r1, 0 + mov r8, r2 + ldr r0, [sp, 0x40] + lsls r0, 16 + asrs r0, 16 + mov r10, r0 + movs r7, 0 + ldr r0, [sp, 0x3C] + str r0, [sp] + mov r1, r10 + str r1, [sp, 0x4] + ldr r2, [sp, 0x48] + str r2, [sp, 0x8] + adds r0, r6, 0 + adds r1, r5, 0 + mov r2, r8 + bl sub_806D528 + lsls r0, 24 + cmp r0, 0 + beq _0806D04A + b _0806D514 +_0806D04A: + mov r3, r8 + ldrb r0, [r3, 0xF] + cmp r0, 0 + beq _0806D054 + b _0806D514 +_0806D054: + adds r0, r6, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _0806D062 + b _0806D514 +_0806D062: + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _0806D070 + b _0806D514 +_0806D070: + adds r0, r6, 0 + bl sub_80450F8 + cmp r0, 0x1 + beq _0806D07C + b _0806D514 +_0806D07C: + adds r0, r5, 0 + bl sub_80450F8 + cmp r0, 0x1 + beq _0806D088 + b _0806D514 +_0806D088: + ldr r0, [sp, 0x44] + mov r9, r0 + adds r0, r5, 0 + bl sub_8070CD0 + lsls r0, 24 + cmp r0, 0 + bne _0806D0A2 + ldr r0, [r5, 0x70] + adds r0, 0xC0 + ldrb r0, [r0] + cmp r0, 0 + beq _0806D0A6 +_0806D0A2: + movs r1, 0 + mov r9, r1 +_0806D0A6: + mov r2, r9 + cmp r2, 0 + beq _0806D100 + movs r3, 0x4 + ldrsh r1, [r6, r3] + movs r2, 0x4 + ldrsh r0, [r5, r2] + subs r1, r0 + cmp r1, 0 + bge _0806D0BC + negs r1, r1 +_0806D0BC: + cmp r1, 0x1 + bgt _0806D100 + movs r3, 0x6 + ldrsh r1, [r6, r3] + movs r2, 0x6 + ldrsh r0, [r5, r2] + subs r1, r0 + cmp r1, 0 + bge _0806D0D0 + negs r1, r1 +_0806D0D0: + cmp r1, 0x1 + bgt _0806D100 + cmp r6, r5 + beq _0806D100 + mov r3, r8 + ldrb r0, [r3, 0xC] + bl sub_8092354 + lsls r0, 24 + cmp r0, 0 + beq _0806D100 + ldr r0, [r5, 0x70] + adds r0, 0xC4 + ldrb r0, [r0] + cmp r0, 0xD + bne _0806D100 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_8042730 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_807F43C +_0806D100: + ldr r0, [r5, 0x70] + adds r0, 0xC0 + ldrb r0, [r0] + cmp r0, 0xC + bne _0806D118 + ldr r0, _0806D3BC + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r5, 0 + movs r3, 0x1 + bl sub_8077084 +_0806D118: + adds r0, r6, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _0806D126 + b _0806D514 +_0806D126: + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _0806D134 + b _0806D514 +_0806D134: + mov r0, r9 + cmp r0, 0 + beq _0806D216 + cmp r6, r5 + beq _0806D216 + movs r2, 0x4 + ldrsh r1, [r6, r2] + movs r3, 0x4 + ldrsh r0, [r5, r3] + subs r1, r0 + cmp r1, 0 + bge _0806D14E + negs r1, r1 +_0806D14E: + cmp r1, 0x1 + bgt _0806D216 + movs r0, 0x6 + ldrsh r1, [r6, r0] + movs r2, 0x6 + ldrsh r0, [r5, r2] + subs r1, r0 + cmp r1, 0 + bge _0806D162 + negs r1, r1 +_0806D162: + cmp r1, 0x1 + bgt _0806D216 + mov r3, r8 + ldrb r0, [r3, 0xC] + bl sub_8092354 + lsls r0, 24 + lsrs r4, r0, 24 + ldr r0, [r5, 0x70] + adds r0, 0xC4 + ldrb r0, [r0] + cmp r0, 0x4 + bne _0806D188 + cmp r4, 0 + beq _0806D188 + adds r0, r5, 0 + bl sub_8041B18 + adds r7, 0x4 +_0806D188: + ldr r0, [r5, 0x70] + adds r0, 0xC4 + ldrb r0, [r0] + cmp r0, 0xA + bne _0806D19E + cmp r4, 0 + beq _0806D19E + adds r0, r5, 0 + bl sub_8041B18 + adds r7, 0x1 +_0806D19E: + ldr r0, [r5, 0x70] + adds r0, 0xC4 + ldrb r0, [r0] + cmp r0, 0x8 + bne _0806D1B4 + cmp r4, 0 + bne _0806D1B4 + adds r0, r5, 0 + bl sub_8041B90 + adds r7, 0x4 +_0806D1B4: + adds r0, r5, 0 + movs r1, 0x12 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806D1C4 + adds r7, 0x2 +_0806D1C4: + cmp r7, 0 + beq _0806D216 + ldr r0, _0806D3C0 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80522F4 + mov r1, r8 + ldr r0, [r1] + muls r0, r7 + cmp r0, 0 + bge _0806D1E0 + adds r0, 0x3 +_0806D1E0: + asrs r0, 2 + str r0, [sp, 0xC] + add r2, sp, 0xC + mov r3, r8 + ldrb r0, [r3, 0xC] + movs r1, 0 + strb r0, [r2, 0xC] + movs r0, 0x6 + str r0, [sp, 0x10] + movs r0, 0x2 + str r0, [sp, 0x14] + adds r0, r2, 0 + strb r1, [r0, 0xD] + strb r1, [r0, 0xE] + strb r1, [r0, 0xF] + ldr r0, [sp, 0x3C] + str r0, [sp] + mov r1, r10 + str r1, [sp, 0x4] + ldr r2, [sp, 0x48] + str r2, [sp, 0x8] + adds r0, r5, 0 + adds r1, r6, 0 + add r2, sp, 0xC + movs r3, 0 + bl sub_806D528 +_0806D216: + adds r0, r6, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _0806D224 + b _0806D514 +_0806D224: + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _0806D232 + b _0806D514 +_0806D232: + mov r3, r9 + cmp r3, 0 + bne _0806D23A + b _0806D48A +_0806D23A: + cmp r6, r5 + bne _0806D240 + b _0806D48A +_0806D240: + movs r0, 0x4 + ldrsh r1, [r6, r0] + movs r2, 0x4 + ldrsh r0, [r5, r2] + subs r1, r0 + cmp r1, 0 + bge _0806D250 + negs r1, r1 +_0806D250: + cmp r1, 0x1 + ble _0806D256 + b _0806D48A +_0806D256: + movs r3, 0x6 + ldrsh r1, [r6, r3] + movs r2, 0x6 + ldrsh r0, [r5, r2] + subs r1, r0 + cmp r1, 0 + bge _0806D266 + negs r1, r1 +_0806D266: + cmp r1, 0x1 + ble _0806D26C + b _0806D48A +_0806D26C: + mov r3, r8 + ldrb r0, [r3, 0xC] + bl sub_8092354 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r4, [r6, 0x70] + adds r0, r5, 0 + movs r1, 0x5 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806D2C2 + adds r0, r6, 0 + movs r1, 0xA + bl sub_8071858 + lsls r0, 24 + cmp r0, 0 + bne _0806D2C2 + adds r0, r6, 0 + movs r1, 0x37 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + bne _0806D2C2 + movs r0, 0x64 + bl sub_8084100 + ldr r1, _0806D3C4 + movs r2, 0 + ldrsh r1, [r1, r2] + cmp r0, r1 + bge _0806D2C2 + movs r3, 0xBC + lsls r3, 1 + adds r2, r4, r3 + ldrh r1, [r2] + movs r0, 0x1 + orrs r0, r1 + strh r0, [r2] +_0806D2C2: + adds r0, r5, 0 + movs r1, 0xA + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806D2EE + movs r0, 0x64 + bl sub_8084100 + ldr r1, _0806D3C8 + movs r2, 0 + ldrsh r1, [r1, r2] + cmp r0, r1 + bge _0806D2EE + movs r3, 0xBC + lsls r3, 1 + adds r2, r4, r3 + ldrh r1, [r2] + movs r0, 0x2 + orrs r0, r1 + strh r0, [r2] +_0806D2EE: + adds r0, r5, 0 + movs r1, 0x17 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806D328 + adds r0, r6, 0 + movs r1, 0x11 + bl sub_8071858 + lsls r0, 24 + cmp r0, 0 + beq _0806D328 + movs r0, 0x64 + bl sub_8084100 + ldr r1, _0806D3CC + movs r2, 0 + ldrsh r1, [r1, r2] + cmp r0, r1 + bge _0806D328 + movs r3, 0xBC + lsls r3, 1 + adds r2, r4, r3 + ldrh r1, [r2] + movs r0, 0x4 + orrs r0, r1 + strh r0, [r2] +_0806D328: + adds r0, r5, 0 + movs r1, 0x20 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806D358 + cmp r7, 0 + beq _0806D358 + movs r0, 0x64 + bl sub_8084100 + ldr r1, _0806D3D0 + movs r2, 0 + ldrsh r1, [r1, r2] + cmp r0, r1 + bge _0806D358 + movs r3, 0xBC + lsls r3, 1 + adds r2, r4, r3 + ldrh r1, [r2] + movs r0, 0x8 + orrs r0, r1 + strh r0, [r2] +_0806D358: + adds r0, r5, 0 + movs r1, 0x27 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806D384 + movs r0, 0x64 + bl sub_8084100 + ldr r1, _0806D3D4 + movs r2, 0 + ldrsh r1, [r1, r2] + cmp r0, r1 + bge _0806D384 + movs r3, 0xBC + lsls r3, 1 + adds r2, r4, r3 + ldrh r1, [r2] + movs r0, 0x20 + orrs r0, r1 + strh r0, [r2] +_0806D384: + adds r0, r5, 0 + movs r1, 0x3D + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806D3FA + cmp r7, 0 + beq _0806D3FA + movs r0, 0x64 + bl sub_8084100 + ldr r1, _0806D3D8 + movs r2, 0 + ldrsh r1, [r1, r2] + cmp r0, r1 + bge _0806D3FA + movs r0, 0x3 + bl sub_8084100 + cmp r0, 0 + bgt _0806D3DC + movs r3, 0xBC + lsls r3, 1 + adds r2, r4, r3 + ldrh r1, [r2] + movs r0, 0x40 + b _0806D3F6 + .align 2, 0 +_0806D3BC: .4byte gUnknown_8106A4C +_0806D3C0: .4byte gUnknown_80FCFA4 +_0806D3C4: .4byte gUnknown_80F4E10 +_0806D3C8: .4byte gUnknown_80F4E12 +_0806D3CC: .4byte gUnknown_80F4E14 +_0806D3D0: .4byte gUnknown_80F4E16 +_0806D3D4: .4byte gUnknown_80F4E18 +_0806D3D8: .4byte gUnknown_80F4E1A +_0806D3DC: + cmp r0, 0x1 + bgt _0806D3EC + movs r0, 0xBC + lsls r0, 1 + adds r2, r4, r0 + ldrh r1, [r2] + movs r0, 0x10 + b _0806D3F6 +_0806D3EC: + movs r1, 0xBC + lsls r1, 1 + adds r2, r4, r1 + ldrh r1, [r2] + movs r0, 0x80 +_0806D3F6: + orrs r0, r1 + strh r0, [r2] +_0806D3FA: + adds r0, r5, 0 + movs r1, 0x3E + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806D428 + movs r0, 0x64 + bl sub_8084100 + ldr r1, _0806D4D4 + movs r2, 0 + ldrsh r1, [r1, r2] + cmp r0, r1 + bge _0806D428 + movs r3, 0xBC + lsls r3, 1 + adds r2, r4, r3 + ldrh r1, [r2] + subs r3, 0x78 + adds r0, r3, 0 + orrs r0, r1 + strh r0, [r2] +_0806D428: + adds r0, r5, 0 + movs r1, 0x44 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806D45A + cmp r7, 0 + beq _0806D45A + movs r0, 0x64 + bl sub_8084100 + ldr r1, _0806D4D8 + movs r2, 0 + ldrsh r1, [r1, r2] + cmp r0, r1 + bge _0806D45A + movs r3, 0xBC + lsls r3, 1 + adds r2, r4, r3 + ldrh r1, [r2] + adds r3, 0x88 + adds r0, r3, 0 + orrs r0, r1 + strh r0, [r2] +_0806D45A: + adds r0, r5, 0 + movs r1, 0x1 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806D48A + movs r0, 0x64 + bl sub_8084100 + ldr r1, _0806D4DC + movs r2, 0 + ldrsh r1, [r1, r2] + cmp r0, r1 + bge _0806D48A + movs r3, 0xBC + lsls r3, 1 + adds r2, r4, r3 + ldrh r1, [r2] + movs r3, 0x80 + lsls r3, 3 + adds r0, r3, 0 + orrs r0, r1 + strh r0, [r2] +_0806D48A: + adds r0, r6, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0806D514 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0806D514 + mov r0, r9 + cmp r0, 0 + beq _0806D514 + ldr r2, [r5, 0x70] + adds r6, r2, 0 + adds r3, r2, 0 + adds r3, 0xD0 + ldrb r0, [r3] + cmp r0, 0x2 + bne _0806D514 + ldr r0, _0806D4E0 + ldr r1, [r0] + adds r0, r2, 0 + adds r0, 0xD8 + ldrb r0, [r0] + lsls r0, 2 + ldr r2, _0806D4E4 + adds r1, r2 + adds r1, r0 + ldr r4, [r1] + cmp r4, 0 + bne _0806D4E8 + strb r4, [r3] + b _0806D514 + .align 2, 0 +_0806D4D4: .4byte gUnknown_80F4E1C +_0806D4D8: .4byte gUnknown_80F4E1E +_0806D4DC: .4byte gUnknown_80F4E20 +_0806D4E0: .4byte gUnknown_203B418 +_0806D4E4: .4byte 0x000135cc +_0806D4E8: + ldr r0, [r4, 0x70] + adds r0, 0x98 + adds r1, r6, 0 + adds r1, 0xD4 + ldr r2, [r0] + ldr r0, [r1] + cmp r2, r0 + beq _0806D4FE + movs r0, 0 + strb r0, [r3] + b _0806D514 +_0806D4FE: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8041D00 + mov r3, r8 + ldr r1, [r3] + ldr r3, _0806D524 + adds r0, r4, 0 + movs r2, 0xC + bl sub_806F324 +_0806D514: + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0806D524: .4byte 0x000001f9 + thumb_func_end sub_806D010 + + thumb_func_start sub_806D528 +sub_806D528: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x58 + mov r9, r0 + adds r7, r1, 0 + adds r5, r2, 0 + str r3, [sp, 0x4C] + ldr r0, [sp, 0x7C] + lsls r0, 16 + asrs r0, 16 + str r0, [sp, 0x50] + movs r0, 0 + str r0, [sp, 0x54] + mov r10, r0 + mov r8, r0 + mov r1, r10 + strb r1, [r5, 0xF] + adds r0, r7, 0 + bl sub_80450F8 + cmp r0, 0x1 + beq _0806D55C + b _0806D754 +_0806D55C: + ldr r6, [r7, 0x70] + mov r0, r9 + adds r1, r7, 0 + bl sub_807A96C + mov r0, r9 + adds r1, r7, 0 + bl sub_806F450 + mov r0, r9 + bl sub_80450F8 + cmp r0, 0x1 + bne _0806D592 + mov r2, r9 + ldr r0, [r2, 0x70] + adds r0, 0xDC + ldrb r0, [r0] + cmp r0, 0x3 + bne _0806D592 + ldrb r0, [r5, 0xE] + cmp r0, 0 + bne _0806D592 + ldr r0, _0806D5C8 + movs r3, 0 + ldrsh r0, [r0, r3] + str r0, [r5] +_0806D592: + ldr r0, _0806D5CC + ldr r1, [sp, 0x50] + cmp r1, r0 + beq _0806D5DC + adds r0, r7, 0 + movs r1, 0xD + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806D5DC + ldr r1, [r5] + ldr r0, _0806D5D0 + cmp r1, r0 + bne _0806D5DC + ldr r0, _0806D5D4 + adds r1, r7, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _0806D5D8 + ldr r2, [r0] + mov r0, r9 + adds r1, r7, 0 + bl sub_80522F4 + b _0806D71E + .align 2, 0 +_0806D5C8: .4byte gUnknown_80F4F8C +_0806D5CC: .4byte 0x0000020e +_0806D5D0: .4byte 0x0000270f +_0806D5D4: .4byte gUnknown_202DFE8 +_0806D5D8: .4byte gUnknown_80FCA90 +_0806D5DC: + adds r0, r6, 0 + adds r0, 0xB0 + ldrb r4, [r0] + mov r10, r0 + cmp r4, 0x1 + bne _0806D618 + ldr r0, _0806D610 + adds r1, r7, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _0806D614 + ldr r2, [r0] + mov r0, r9 + adds r1, r7, 0 + bl sub_80522F4 + mov r0, r9 + adds r1, r7, 0 + bl sub_8042238 + strb r4, [r5, 0xF] +_0806D608: + movs r0, 0 + bl _0806E0F0 + .align 2, 0 +_0806D610: .4byte gUnknown_202DFE8 +_0806D614: .4byte gUnknown_80F9600 +_0806D618: + adds r0, r6, 0 + adds r0, 0xA8 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0806D62A + cmp r0, 0x5 + beq _0806D62A + cmp r0, 0x3 + bne _0806D63A +_0806D62A: + adds r0, r6, 0 + adds r0, 0xA9 + ldrb r0, [r0] + cmp r0, 0x7F + bne _0806D63A + adds r0, r7, 0 + bl sub_807A9B0 +_0806D63A: + adds r0, r7, 0 + movs r1, 0x23 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806D660 + ldrb r0, [r5, 0xC] + cmp r0, 0x5 + bne _0806D660 +_0806D64E: + ldr r2, [r5] + movs r0, 0 + str r0, [sp] + mov r0, r9 + adds r1, r7, 0 + movs r3, 0 + bl sub_8077C44 + b _0806D754 +_0806D660: + adds r0, r7, 0 + movs r1, 0x24 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806D674 + ldrb r0, [r5, 0xC] + cmp r0, 0x3 + beq _0806D64E +_0806D674: + movs r2, 0xA9 + lsls r2, 1 + adds r0, r6, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _0806D6D0 + ldrb r0, [r5, 0xD] + cmp r0, 0 + beq _0806D692 + ldr r0, _0806D6A4 + ldr r2, [r0] + mov r0, r9 + adds r1, r7, 0 + bl sub_80522F4 +_0806D692: + ldr r0, [r5, 0x8] + cmp r0, 0x1 + beq _0806D6B0 + cmp r0, 0x1 + bcc _0806D6A8 + cmp r0, 0x3 + beq _0806D6C4 + b _0806D6D0 + .align 2, 0 +_0806D6A4: .4byte gUnknown_80F9614 +_0806D6A8: + ldr r0, _0806D6AC + b _0806D6B2 + .align 2, 0 +_0806D6AC: .4byte gUnknown_80F9630 +_0806D6B0: + ldr r0, _0806D6C0 +_0806D6B2: + ldr r2, [r0] + mov r0, r9 + adds r1, r7, 0 + bl sub_80522F4 + b _0806D6D0 + .align 2, 0 +_0806D6C0: .4byte gUnknown_80F9654 +_0806D6C4: + ldr r0, _0806D728 + ldr r2, [r0] + mov r0, r9 + adds r1, r7, 0 + bl sub_80522F4 +_0806D6D0: + ldr r4, _0806D72C + adds r0, r4, 0 + mov r1, r9 + movs r2, 0 + bl sub_8045B94 + adds r4, 0x50 + adds r0, r4, 0 + adds r1, r7, 0 + movs r2, 0 + bl sub_8045B94 + ldr r1, [r5] + cmp r1, 0 + bne _0806D760 + mov r0, r9 + bl sub_8045888 + lsls r0, 24 + cmp r0, 0 + beq _0806D734 + adds r0, r7, 0 + bl sub_8045888 + lsls r0, 24 + cmp r0, 0 + beq _0806D734 + movs r3, 0xA9 + lsls r3, 1 + adds r0, r6, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _0806D71E + ldr r0, _0806D730 + ldr r2, [r0] + mov r0, r9 + adds r1, r7, 0 + bl sub_80522F4 +_0806D71E: + mov r0, r9 + adds r1, r7, 0 + bl sub_8042238 + b _0806D754 + .align 2, 0 +_0806D728: .4byte gUnknown_80F9670 +_0806D72C: .4byte gUnknown_202DF98 +_0806D730: .4byte gUnknown_80F9688 +_0806D734: + movs r1, 0xA9 + lsls r1, 1 + adds r0, r6, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0806D74C + ldr r0, _0806D75C + ldr r2, [r0] + mov r0, r9 + adds r1, r7, 0 + bl sub_80522F4 +_0806D74C: + movs r0, 0x1E + movs r1, 0x18 + bl sub_803E708 +_0806D754: + movs r0, 0x1 + strb r0, [r5, 0xF] + b _0806D608 + .align 2, 0 +_0806D75C: .4byte gUnknown_80F9688 +_0806D760: + ldr r0, _0806D7B8 + cmp r1, r0 + bne _0806D7C4 + ldr r0, [sp, 0x80] + cmp r0, 0 + beq _0806D796 + adds r0, r7, 0 + bl sub_8045888 + lsls r0, 24 + cmp r0, 0 + beq _0806D796 + adds r0, r7, 0 + bl sub_8045128 + mov r8, r0 + movs r0, 0x14 + movs r1, 0x18 + bl sub_803E708 + mov r2, r8 + ldrh r1, [r2, 0x4] + movs r0, 0x4 + orrs r0, r1 + strh r0, [r2, 0x4] + bl sub_8049ED4 +_0806D796: + movs r3, 0xA9 + lsls r3, 1 + adds r0, r6, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _0806D7AE + ldr r0, _0806D7BC + ldr r2, [r0] + mov r0, r9 + adds r1, r7, 0 + bl sub_80522F4 +_0806D7AE: + adds r1, r6, 0 + adds r1, 0xA0 + ldr r0, _0806D7C0 + str r0, [r1] + b _0806D84A + .align 2, 0 +_0806D7B8: .4byte 0x0000270f +_0806D7BC: .4byte gUnknown_80F96A8 +_0806D7C0: .4byte 0x000003e7 +_0806D7C4: + ldr r0, _0806D824 + str r1, [r0] + ldr r1, _0806D828 + ldr r0, [r5, 0x4] + lsls r0, 2 + adds r0, r1 + ldr r4, [r0] + adds r2, r6, 0 + adds r2, 0xA0 + ldr r0, [r2] + ldr r1, [r5] + adds r0, r1 + str r0, [r2] + ldr r1, _0806D82C + cmp r0, r1 + ble _0806D7E6 + str r1, [r2] +_0806D7E6: + adds r0, r7, 0 + bl sub_8045888 + lsls r0, 24 + cmp r0, 0 + beq _0806D830 + ldr r0, [r5, 0x4] + cmp r0, 0xE + beq _0806D808 + ldr r0, [r5] + negs r0, r0 + movs r3, 0x1 + negs r3, r3 + adds r1, r7, 0 + movs r2, 0x1 + bl sub_803ED30 +_0806D808: + movs r1, 0xA9 + lsls r1, 1 + adds r0, r6, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0806D84A + cmp r4, 0 + beq _0806D84A + mov r0, r9 + adds r1, r7, 0 + adds r2, r4, 0 + bl sub_80522F4 + b _0806D84A + .align 2, 0 +_0806D824: .4byte gUnknown_202DE30 +_0806D828: .4byte gUnknown_80F9764 +_0806D82C: .4byte 0x000003e7 +_0806D830: + movs r2, 0xA9 + lsls r2, 1 + adds r0, r6, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _0806D84A + cmp r4, 0 + beq _0806D84A + mov r0, r9 + adds r1, r7, 0 + adds r2, r4, 0 + bl sub_80522F4 +_0806D84A: + ldr r0, [r5, 0x4] + cmp r0, 0xE + bne _0806D858 + movs r3, 0xE + ldrsh r0, [r6, r3] + cmp r0, 0x1 + bgt _0806D900 +_0806D858: + mov r0, r8 + cmp r0, 0 + bne _0806D900 + adds r0, r7, 0 + bl sub_8045888 + lsls r0, 24 + cmp r0, 0 + beq _0806D900 + mov r2, r9 + ldr r1, [r2, 0x4] + ldr r0, [r7, 0x4] + cmp r1, r0 + beq _0806D8E6 + mov r0, r9 + bl sub_80450F8 + cmp r0, 0x1 + bne _0806D8E6 + movs r4, 0 + ldrb r0, [r6, 0x7] + cmp r0, 0 + beq _0806D8B4 + ldr r0, _0806D8B0 + ldr r0, [r0] + ldrb r0, [r0, 0x2] + cmp r0, 0 + beq _0806D8B6 + adds r0, r7, 0 + bl sub_806A458 + lsls r0, 24 + cmp r0, 0 + bne _0806D8B6 + adds r0, r7, 0 + mov r1, r9 + bl sub_8045990 + lsls r0, 24 + lsrs r0, 24 + negs r1, r0 + orrs r1, r0 + lsrs r4, r1, 31 + b _0806D8B6 + .align 2, 0 +_0806D8B0: .4byte gUnknown_203B46C +_0806D8B4: + movs r4, 0 +_0806D8B6: + adds r0, r6, 0 + adds r0, 0xE8 + ldrb r0, [r0] + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _0806D8C8 + movs r4, 0 +_0806D8C8: + cmp r4, 0 + beq _0806D8E0 + ldr r4, [r7, 0x70] + adds r0, r7, 0x4 + mov r1, r9 + adds r1, 0x4 + bl sub_80983D8 + movs r1, 0x7 + ands r0, r1 + adds r4, 0x46 + strb r0, [r4] +_0806D8E0: + adds r0, r7, 0 + bl sub_8069DCC +_0806D8E6: + ldr r0, [r7, 0x70] + adds r0, 0x46 + ldrb r2, [r0] + adds r0, r7, 0 + movs r1, 0x6 + bl sub_806CDD4 + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80420E8 + movs r3, 0x1 + str r3, [sp, 0x54] +_0806D900: + movs r0, 0xE + ldrsh r4, [r6, r0] + ldr r1, [r5] + cmp r4, r1 + ble _0806D910 + ldrh r0, [r6, 0xE] + subs r0, r1 + b _0806D912 +_0806D910: + movs r0, 0 +_0806D912: + strh r0, [r6, 0xE] + adds r0, r6, 0 + adds r0, 0xC4 + ldrb r0, [r0] + cmp r0, 0x9 + bne _0806D93C + movs r1, 0xE + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _0806D958 + movs r0, 0x1 + strh r0, [r6, 0xE] + ldr r0, _0806D938 + ldr r2, [r0] + mov r0, r9 + adds r1, r7, 0 + bl sub_80522F4 + b _0806D958 + .align 2, 0 +_0806D938: .4byte gUnknown_8100548 +_0806D93C: + ldr r2, [sp, 0x4C] + cmp r2, 0x1 + bne _0806D958 + movs r3, 0xE + ldrsh r0, [r6, r3] + cmp r0, 0 + bne _0806D958 + strh r2, [r6, 0xE] + ldr r0, _0806D9C8 + ldr r2, [r0] + mov r0, r9 + adds r1, r7, 0 + bl sub_80522F4 +_0806D958: + movs r1, 0xE + ldrsh r0, [r6, r1] + subs r4, r0 + cmp r4, 0 + bge _0806D964 + movs r4, 0 +_0806D964: + ldr r2, [sp, 0x54] + cmp r2, 0 + bne _0806D970 + mov r3, r8 + cmp r3, 0 + beq _0806D978 +_0806D970: + movs r0, 0xA + movs r1, 0x18 + bl sub_803E708 +_0806D978: + movs r1, 0xE + ldrsh r0, [r6, r1] + cmp r0, 0 + beq _0806D9D4 + ldr r2, [sp, 0x54] + cmp r2, 0 + beq _0806D98E + adds r0, r7, 0 + movs r1, 0x8 + bl sub_806CE68 +_0806D98E: + adds r0, r7, 0 + movs r1, 0x10 + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _0806D9B2 + cmp r4, 0 + ble _0806D9B2 + ldr r1, [r5] + ldr r0, _0806D9CC + cmp r1, r0 + beq _0806D9B2 + mov r0, r9 + adds r1, r7, 0 + adds r2, r4, 0 + bl sub_8071D4C +_0806D9B2: + mov r3, r8 + cmp r3, 0 + bne _0806D9BA + b _0806D608 +_0806D9BA: + ldrh r1, [r3, 0x4] + ldr r0, _0806D9D0 + ands r0, r1 + strh r0, [r3, 0x4] + bl sub_8049ED4 + b _0806D608 + .align 2, 0 +_0806D9C8: .4byte gUnknown_810056C +_0806D9CC: .4byte 0x0000270f +_0806D9D0: .4byte 0x0000fffb +_0806D9D4: + adds r0, r6, 0 + adds r0, 0xE4 + ldrb r0, [r0] + cmp r0, 0x2 + bne _0806D9E6 + mov r0, r9 + adds r1, r7, 0 + bl sub_807A7C8 +_0806D9E6: + mov r0, r8 + cmp r0, 0 + beq _0806DA18 + movs r0, 0x14 + movs r1, 0x18 + bl sub_803E708 + adds r1, r7, 0 + adds r1, 0x22 + movs r0, 0x2 + strb r0, [r1] + movs r0, 0xA + movs r1, 0x18 + bl sub_803E708 + mov r2, r8 + ldrh r1, [r2, 0x4] + ldr r0, _0806DA14 + ands r0, r1 + strh r0, [r2, 0x4] + bl sub_8049ED4 + b _0806DA2E + .align 2, 0 +_0806DA14: .4byte 0x0000fffb +_0806DA18: + ldr r3, [sp, 0x54] + cmp r3, 0 + beq _0806DA2E + adds r1, r7, 0 + adds r1, 0x22 + movs r0, 0x1 + strb r0, [r1] + movs r0, 0x1E + movs r1, 0x18 + bl sub_803E708 +_0806DA2E: + movs r0, 0x1 + mov r8, r0 + mov r0, r9 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0806DA50 + mov r0, r9 + bl sub_80450F8 + cmp r0, 0x1 + bne _0806DA50 + cmp r9, r7 + beq _0806DA50 + movs r1, 0 + mov r8, r1 +_0806DA50: + movs r2, 0xA6 + lsls r2, 1 + adds r1, r6, r2 + movs r0, 0 + strb r0, [r1] + ldr r4, _0806DA88 + adds r0, r4, 0 + mov r1, r9 + movs r2, 0 + bl sub_8045B94 + adds r4, 0x50 + adds r0, r4, 0 + adds r1, r7, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, [r5, 0x4] + subs r0, 0x13 + cmp r0, 0x1 + bhi _0806DA9C + ldrb r0, [r6, 0x6] + cmp r0, 0 + beq _0806DA90 + ldr r0, _0806DA8C + ldr r2, [r0] + b _0806DAC2 + .align 2, 0 +_0806DA88: .4byte gUnknown_202DF98 +_0806DA8C: .4byte gUnknown_80F9E44 +_0806DA90: + ldr r0, _0806DA98 + ldr r1, [r0] + b _0806DB86 + .align 2, 0 +_0806DA98: .4byte gUnknown_80F9E44 +_0806DA9C: + ldrb r0, [r6, 0x6] + cmp r0, 0 + beq _0806DAD0 + adds r0, r6, 0 + adds r0, 0xA4 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0806DAB8 + ldr r0, _0806DAB4 + mov r3, r8 + lsls r1, r3, 2 + b _0806DB82 + .align 2, 0 +_0806DAB4: .4byte gUnknown_80F9DF0 +_0806DAB8: + ldr r0, _0806DACC + mov r2, r8 + lsls r1, r2, 2 + adds r1, r0 + ldr r2, [r1] +_0806DAC2: + mov r0, r9 + adds r1, r7, 0 + bl sub_80522F4 + b _0806DBA4 + .align 2, 0 +_0806DACC: .4byte gUnknown_80F9CC0 +_0806DAD0: + ldr r2, _0806DB04 + ldrb r1, [r6, 0xA] + movs r0, 0x64 + muls r0, r1 + ldr r3, _0806DB08 + adds r0, r3 + ldr r1, [r2] + adds r3, r1, r0 + ldrb r0, [r6, 0x7] + cmp r0, 0 + bne _0806DB00 + adds r0, r6, 0 + adds r0, 0x40 + ldrb r1, [r0] + adds r2, r0, 0 + cmp r1, 0x41 + bne _0806DB18 + ldr r0, _0806DB0C + ldr r0, [r0] + ldr r1, _0806DB10 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0806DB18 +_0806DB00: + ldr r0, _0806DB14 + b _0806DB7E + .align 2, 0 +_0806DB04: .4byte gUnknown_203B45C +_0806DB08: .4byte 0x00008df8 +_0806DB0C: .4byte gUnknown_203B418 +_0806DB10: .4byte 0x0000065c +_0806DB14: .4byte gUnknown_80F9CEC +_0806DB18: + ldrb r0, [r2] + cmp r0, 0x4A + beq _0806DB22 + cmp r0, 0x47 + bne _0806DB26 +_0806DB22: + movs r0, 0x1 + b _0806DB28 +_0806DB26: + movs r0, 0 +_0806DB28: + cmp r0, 0 + beq _0806DB38 + ldr r0, _0806DB34 + mov r3, r8 + lsls r1, r3, 2 + b _0806DB82 + .align 2, 0 +_0806DB34: .4byte gUnknown_80F9DAC +_0806DB38: + adds r0, r6, 0 + adds r0, 0xA4 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0806DB4C + ldr r0, _0806DB48 + b _0806DB7E + .align 2, 0 +_0806DB48: .4byte gUnknown_80F9DF0 +_0806DB4C: + movs r1, 0xA + ldrsh r0, [r3, r1] + bl sub_806A58C + lsls r0, 24 + cmp r0, 0 + beq _0806DB94 + ldr r0, _0806DB70 + ldr r0, [r0] + ldr r2, _0806DB74 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _0806DB7C + ldr r0, _0806DB78 + mov r3, r8 + lsls r1, r3, 2 + b _0806DB82 + .align 2, 0 +_0806DB70: .4byte gUnknown_203B418 +_0806DB74: .4byte 0x0000065d +_0806DB78: .4byte gUnknown_80F9D8C +_0806DB7C: + ldr r0, _0806DB90 +_0806DB7E: + mov r2, r8 + lsls r1, r2, 2 +_0806DB82: + adds r1, r0 + ldr r1, [r1] +_0806DB86: + mov r0, r9 + bl sub_805239C + b _0806DBA4 + .align 2, 0 +_0806DB90: .4byte gUnknown_80F9D84 +_0806DB94: + ldr r0, _0806DC4C + mov r3, r8 + lsls r1, r3, 2 + adds r1, r0 + ldr r1, [r1] + mov r0, r9 + bl sub_805239C +_0806DBA4: + mov r1, r10 + ldrb r0, [r1] + subs r0, 0x3 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _0806DBBC + adds r0, r6, 0 + adds r0, 0x9C + ldr r0, [r0] + bl sub_8076CB4 +_0806DBBC: + adds r1, r6, 0 + adds r1, 0x60 + ldrb r3, [r1] + movs r2, 0x1 + mov r8, r2 + mov r0, r8 + ands r0, r3 + adds r5, r1, 0 + cmp r0, 0 + beq _0806DC5C + movs r0, 0x8 + ands r0, r3 + cmp r0, 0 + bne _0806DC5C + movs r0, 0x2 + ands r0, r3 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0806DC5C + ldrb r0, [r5, 0x2] + cmp r0, 0xD2 + bne _0806DC5C + adds r0, r7, 0 + bl sub_8042148 + adds r0, r7, 0 + adds r0, 0x22 + strb r4, [r0] + ldrh r0, [r6, 0x10] + movs r2, 0 + strh r0, [r6, 0xE] + movs r3, 0xAC + lsls r3, 1 + adds r0, r6, r3 + strb r2, [r0] + movs r1, 0xA6 + lsls r1, 1 + adds r0, r6, r1 + mov r3, r8 + strb r3, [r0] + movs r0, 0x9E + lsls r0, 1 + adds r1, r6, r0 + movs r3, 0xA0 + lsls r3, 1 + adds r0, r6, r3 + ldr r0, [r0] + str r0, [r1] + ldrb r0, [r6, 0x7] + cmp r0, 0 + beq _0806DC36 + ldr r0, _0806DC50 + ldr r1, [r0] + ldr r3, _0806DC54 + adds r1, r3 + strb r2, [r1] + ldr r0, [r0] + ldr r1, _0806DC58 + adds r0, r1 + strb r2, [r0] +_0806DC36: + strb r2, [r5, 0x2] + strb r2, [r5, 0x1] + strb r2, [r5] + adds r0, r6, 0 + adds r0, 0xC8 + ldrb r0, [r0] + cmp r0, 0x3 + bne _0806DC48 + b _0806DEC8 +_0806DC48: + b _0806DEE4 + .align 2, 0 +_0806DC4C: .4byte gUnknown_80F9D28 +_0806DC50: .4byte gUnknown_203B418 +_0806DC54: .4byte 0x00000679 +_0806DC58: .4byte 0x00000676 +_0806DC5C: + ldrb r0, [r6, 0x7] + cmp r0, 0 + bne _0806DC64 + b _0806DDFC +_0806DC64: + mov r10, r5 + ldrb r1, [r5] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0806DC72 + b _0806DDFC +_0806DC72: + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0806DC7C + b _0806DDFC +_0806DC7C: + ldrb r0, [r5, 0x2] + cmp r0, 0xD8 + beq _0806DC84 + b _0806DDFC +_0806DC84: + movs r4, 0 +_0806DC86: + ldr r0, _0806DD80 + ldr r0, [r0] + lsls r1, r4, 2 + ldr r2, _0806DD84 + adds r0, r2 + adds r0, r1 + ldr r0, [r0] + mov r8, r0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0806DCDE + cmp r8, r7 + beq _0806DCDE + adds r0, r7, 0 + mov r1, r8 + bl sub_8045990 + lsls r0, 24 + cmp r0, 0 + beq _0806DCDE + mov r3, r8 + movs r0, 0x4 + ldrsh r1, [r3, r0] + movs r2, 0x4 + ldrsh r0, [r7, r2] + subs r1, r0 + cmp r1, 0 + bge _0806DCC4 + negs r1, r1 +_0806DCC4: + cmp r1, 0x1 + bgt _0806DCDE + mov r3, r8 + movs r0, 0x6 + ldrsh r1, [r3, r0] + movs r2, 0x6 + ldrsh r0, [r7, r2] + subs r1, r0 + cmp r1, 0 + bge _0806DCDA + negs r1, r1 +_0806DCDA: + cmp r1, 0x1 + ble _0806DCE4 +_0806DCDE: + adds r4, 0x1 + cmp r4, 0x3 + ble _0806DC86 +_0806DCE4: + cmp r4, 0x4 + bne _0806DCEA + b _0806DDFC +_0806DCEA: + adds r0, r7, 0 + bl sub_8042148 + mov r3, r8 + ldr r4, [r3, 0x4] + ldr r1, _0806DD88 + mov r0, r8 + adds r2, r7, 0 + bl sub_8068FE0 + lsls r1, r4, 16 + asrs r1, 16 + asrs r4, 16 + adds r0, r7, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_80694C0 + adds r0, r7, 0 + movs r1, 0 + bl sub_804535C + adds r1, r7, 0 + adds r1, 0x22 + movs r0, 0 + strb r0, [r1] + ldrh r0, [r6, 0x10] + movs r4, 0 + strh r0, [r6, 0xE] + adds r0, r7, 0 + bl sub_8042A24 + movs r1, 0xAC + lsls r1, 1 + adds r0, r6, r1 + strb r4, [r0] + movs r2, 0xA6 + lsls r2, 1 + adds r1, r6, r2 + movs r0, 0x1 + strb r0, [r1] + movs r3, 0x9E + lsls r3, 1 + adds r1, r6, r3 + subs r2, 0xC + adds r0, r6, r2 + ldr r0, [r0] + str r0, [r1] + ldrb r0, [r6, 0x7] + cmp r0, 0 + beq _0806DD62 + ldr r0, _0806DD80 + ldr r1, [r0] + ldr r3, _0806DD8C + adds r1, r3 + strb r4, [r1] + ldr r0, [r0] + ldr r1, _0806DD90 + adds r0, r1 + strb r4, [r0] +_0806DD62: + mov r2, r10 + strb r4, [r2, 0x2] + strb r4, [r2, 0x1] + strb r4, [r2] + adds r0, r6, 0 + adds r0, 0xC8 + ldrb r0, [r0] + cmp r0, 0x3 + bne _0806DD94 + mov r0, r9 + adds r1, r7, 0 + movs r2, 0x3 + bl sub_807A5D0 + b _0806DDA2 + .align 2, 0 +_0806DD80: .4byte gUnknown_203B418 +_0806DD84: .4byte 0x0001357c +_0806DD88: .4byte 0x00000221 +_0806DD8C: .4byte 0x00000679 +_0806DD90: .4byte 0x00000676 +_0806DD94: + cmp r0, 0x2 + bne _0806DDA2 + mov r0, r9 + adds r1, r7, 0 + movs r2, 0x2 + bl sub_807A5D0 +_0806DDA2: + adds r0, r7, 0 + bl sub_8078084 + adds r0, r6, 0 + movs r1, 0 + bl sub_806BFC0 + bl sub_800DBBC + adds r0, r7, 0 + bl sub_806A390 + adds r0, r7, 0 + bl sub_806CEBC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r7, 0 + bl sub_806CCB4 + adds r0, r7, 0 + bl sub_80418D4 + ldr r4, _0806DDF0 + adds r0, r4, 0 + adds r1, r7, 0 + movs r2, 0 + bl sub_8045B94 + adds r4, 0x50 + adds r0, r4, 0 + mov r1, r8 + movs r2, 0 + bl sub_8045B94 + ldr r0, _0806DDF4 + b _0806DF2E + .align 2, 0 +_0806DDF0: .4byte gUnknown_202DF98 +_0806DDF4: .4byte gUnknown_80FD484 +_0806DDF8: + mov r4, r8 + b _0806DE64 +_0806DDFC: + adds r0, r7, 0 + movs r1, 0x16 + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + bne _0806DE0C + b _0806DF48 +_0806DE0C: + movs r4, 0 + ldrb r1, [r5] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0806DE28 + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _0806DE28 + ldrb r0, [r5, 0x2] + cmp r0, 0x3A + bne _0806DE28 + adds r4, r5, 0 +_0806DE28: + cmp r4, 0 + bne _0806DE68 + ldrb r0, [r6, 0x6] + cmp r0, 0 + bne _0806DE64 + movs r3, 0 + ldr r0, _0806DED4 + ldr r2, [r0] + mov r12, r2 + movs r0, 0x1 + mov r10, r0 +_0806DE3E: + lsls r0, r3, 2 + add r0, r12 + mov r8, r0 + ldrb r1, [r2] + mov r0, r10 + ands r0, r1 + cmp r0, 0 + beq _0806DE5C + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _0806DE5C + ldrb r0, [r2, 0x2] + cmp r0, 0x3A + beq _0806DDF8 +_0806DE5C: + adds r2, 0x4 + adds r3, 0x1 + cmp r3, 0x13 + ble _0806DE3E +_0806DE64: + cmp r4, 0 + beq _0806DF48 +_0806DE68: + adds r0, r7, 0 + bl sub_8042148 + adds r0, r4, 0 + movs r1, 0x46 + movs r2, 0x2 + bl sub_8045C28 + adds r1, r7, 0 + adds r1, 0x22 + movs r0, 0 + strb r0, [r1] + ldrh r0, [r6, 0x10] + movs r2, 0 + strh r0, [r6, 0xE] + movs r1, 0xAC + lsls r1, 1 + adds r0, r6, r1 + strb r2, [r0] + movs r3, 0xA6 + lsls r3, 1 + adds r1, r6, r3 + movs r0, 0x1 + strb r0, [r1] + movs r0, 0x9E + lsls r0, 1 + adds r1, r6, r0 + subs r3, 0xC + adds r0, r6, r3 + ldr r0, [r0] + str r0, [r1] + ldrb r0, [r6, 0x7] + cmp r0, 0 + beq _0806DEBE + ldr r0, _0806DED8 + ldr r1, [r0] + ldr r3, _0806DEDC + adds r1, r3 + strb r2, [r1] + ldr r0, [r0] + ldr r1, _0806DEE0 + adds r0, r1 + strb r2, [r0] +_0806DEBE: + adds r0, r6, 0 + adds r0, 0xC8 + ldrb r0, [r0] + cmp r0, 0x3 + bne _0806DEE4 +_0806DEC8: + mov r0, r9 + adds r1, r7, 0 + movs r2, 0x3 + bl sub_807A5D0 + b _0806DEF2 + .align 2, 0 +_0806DED4: .4byte gUnknown_203B460 +_0806DED8: .4byte gUnknown_203B418 +_0806DEDC: .4byte 0x00000679 +_0806DEE0: .4byte 0x00000676 +_0806DEE4: + cmp r0, 0x2 + bne _0806DEF2 + mov r0, r9 + adds r1, r7, 0 + movs r2, 0x2 + bl sub_807A5D0 +_0806DEF2: + adds r0, r7, 0 + bl sub_8078084 + adds r0, r6, 0 + movs r1, 0 + bl sub_806BFC0 + bl sub_800DBBC + adds r0, r7, 0 + bl sub_806A390 + adds r0, r7, 0 + bl sub_806CEBC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r7, 0 + bl sub_806CCB4 + adds r0, r7, 0 + bl sub_80418D4 + ldr r0, _0806DF40 + adds r1, r7, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _0806DF44 +_0806DF2E: + ldr r1, [r0] + mov r0, r9 + bl sub_805239C + adds r0, r7, 0 + bl sub_806F63C + bl _0806D608 + .align 2, 0 +_0806DF40: .4byte gUnknown_202DFE8 +_0806DF44: .4byte gUnknown_80FD46C +_0806DF48: + ldrb r4, [r6, 0x7] + cmp r4, 0 + bne _0806DF68 + ldrb r1, [r5] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0806DF68 + adds r1, r7, 0x4 + adds r0, r7, 0 + adds r2, r5, 0 + bl sub_80464C8 + strb r4, [r5, 0x2] + strb r4, [r5, 0x1] + strb r4, [r5] +_0806DF68: + adds r0, r6, 0 + adds r0, 0xF7 + ldrb r0, [r0] + cmp r0, 0 + beq _0806DF7E + ldr r0, _0806E02C + ldr r0, [r0] + ldr r2, _0806E030 + adds r0, r2 + ldr r1, _0806E034 + strh r1, [r0] +_0806DF7E: + movs r3, 0 + mov r10, r3 + mov r0, r9 + bl sub_80450F8 + cmp r0, 0x1 + bne _0806E066 + mov r0, r9 + ldr r4, [r0, 0x70] + movs r1, 0x2 + ldrsh r0, [r6, r1] + ldrb r1, [r6, 0x9] + bl sub_808DD18 + adds r5, r0, 0 + adds r0, r6, 0 + adds r0, 0xFB + ldrb r0, [r0] + cmp r0, 0 + beq _0806DFAE + cmp r0, 0x2 + bne _0806DFB4 + lsls r0, r5, 1 + adds r5, r0, r5 +_0806DFAE: + lsrs r0, r5, 31 + adds r0, r5, r0 + asrs r5, r0, 1 +_0806DFB4: + cmp r5, 0 + bne _0806DFBA + movs r5, 0x1 +_0806DFBA: + ldrb r0, [r4, 0x7] + cmp r0, 0 + beq _0806DFC8 + movs r2, 0x2 + ldrsh r0, [r6, r2] + bl sub_80980B4 +_0806DFC8: + adds r0, r6, 0 + adds r0, 0xF4 + ldrb r0, [r0] + cmp r0, 0 + beq _0806DFDA + ldr r3, _0806E038 + adds r1, r4, r3 + movs r0, 0x1 + strb r0, [r1] +_0806DFDA: + ldr r0, [sp, 0x78] + cmp r0, 0x1 + bne _0806E066 + ldrb r0, [r4, 0x6] + cmp r0, 0 + bne _0806E040 + ldrb r0, [r6, 0x6] + cmp r0, 0 + beq _0806E066 + mov r0, r9 + mov r1, r9 + adds r2, r5, 0 + bl sub_8071D4C + movs r6, 0 +_0806DFF8: + ldr r0, _0806E02C + ldr r0, [r0] + lsls r1, r6, 2 + ldr r2, _0806E03C + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0806E020 + cmp r4, r9 + beq _0806E020 + mov r0, r9 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_8071D4C +_0806E020: + adds r6, 0x1 + cmp r6, 0x3 + ble _0806DFF8 + movs r3, 0x1 + mov r10, r3 + b _0806E066 + .align 2, 0 +_0806E02C: .4byte gUnknown_203B418 +_0806E030: .4byte 0x0000066a +_0806E034: .4byte 0x000003e7 +_0806E038: .4byte 0x0000014b +_0806E03C: .4byte 0x0001357c +_0806E040: + ldr r5, _0806E0BC + ldr r0, [r5] + ldr r1, _0806E0C0 + adds r0, r1 + ldrb r0, [r0] + bl sub_809033C + lsls r0, 24 + cmp r0, 0 + beq _0806E066 + ldr r2, _0806E0C4 + adds r0, r4, r2 + add r3, sp, 0x78 + ldrb r3, [r3] + strb r3, [r0] + ldr r0, [r5] + add r1, sp, 0x78 + ldrb r1, [r1] + strb r1, [r0, 0xD] +_0806E066: + mov r0, r9 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0806E08A + mov r0, r9 + bl sub_80450F8 + cmp r0, 0x1 + bne _0806E08A + mov r2, r9 + ldr r0, [r2, 0x70] + ldrb r0, [r0, 0x7] + cmp r0, 0 + bne _0806E08A + movs r3, 0 + mov r10, r3 +_0806E08A: + mov r0, r10 + cmp r0, 0 + beq _0806E0E4 + add r0, sp, 0x4 + adds r1, r7, 0 + bl sub_8069D4C + mov r0, r9 + adds r1, r7, 0 + bl sub_806F660 + lsls r0, 24 + cmp r0, 0 + beq _0806E0D8 + mov r0, r9 + adds r1, r7, 0 + add r2, sp, 0x4 + bl sub_806FA5C + lsls r0, 24 + cmp r0, 0 + bne _0806E0CC + ldr r1, _0806E0C8 + adds r0, r7, 0 + b _0806E0DC + .align 2, 0 +_0806E0BC: .4byte gUnknown_203B418 +_0806E0C0: .4byte 0x00000644 +_0806E0C4: .4byte 0x00000149 +_0806E0C8: .4byte 0x000001f5 +_0806E0CC: + ldr r1, _0806E0D4 + movs r0, 0x1 + strb r0, [r1] + b _0806E0EE + .align 2, 0 +_0806E0D4: .4byte gUnknown_202F221 +_0806E0D8: + adds r0, r7, 0 + ldr r1, [sp, 0x50] +_0806E0DC: + mov r2, r9 + bl sub_8068FE0 + b _0806E0EE +_0806E0E4: + adds r0, r7, 0 + ldr r1, [sp, 0x50] + mov r2, r9 + bl sub_8068FE0 +_0806E0EE: + movs r0, 0x1 +_0806E0F0: + add sp, 0x58 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_806D528 + + thumb_func_start sub_806E100 +sub_806E100: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + adds r6, r0, 0 + mov r8, r1 + str r2, [sp, 0x18] + lsls r3, 24 + lsrs r7, r3, 24 + movs r0, 0 + mov r9, r0 + movs r1, 0 + str r1, [sp, 0x20] + mov r2, r8 + ldr r2, [r2, 0x70] + str r2, [sp, 0x24] + ldr r3, [sp, 0x18] + ldr r3, [r3, 0x70] + mov r10, r3 + adds r0, r6, 0 + movs r1, 0x1 + bl sub_800A020 + mov r0, r9 + ldr r4, [sp, 0x48] + strb r0, [r4, 0xD] + strb r0, [r4, 0xE] + movs r1, 0 + str r1, [sp, 0x1C] + ldr r0, [sp, 0x18] + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _0806E14E + movs r0, 0x1 + b _0806E61A +_0806E14E: + cmp r7, 0x1 + beq _0806E156 + cmp r7, 0x7 + bne _0806E15A +_0806E156: + movs r2, 0x1 + str r2, [sp, 0x20] +_0806E15A: + ldr r0, [sp, 0x18] + movs r1, 0x35 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806E170 + cmp r7, 0 + beq _0806E170 + movs r3, 0x1 + str r3, [sp, 0x1C] +_0806E170: + movs r0, 0x2 + ldr r4, [sp, 0x48] + str r0, [r4, 0x8] + movs r5, 0 + add r0, sp, 0x10 + mov r9, r0 + b _0806E1F2 +_0806E17E: + mov r1, r10 + adds r1, 0x5C + ldr r2, [sp, 0x20] + cmp r2, 0 + beq _0806E1B4 + adds r0, r1, r5 + ldrb r0, [r0] + cmp r0, 0xE + bne _0806E1B4 + mov r0, r10 + adds r0, 0xF5 + ldrb r0, [r0] + cmp r0, 0 + bne _0806E1B4 + movs r4, 0 + ldr r0, _0806E1AC + ldr r0, [r0] + ldr r3, _0806E1B0 + adds r1, r0, r3 + movs r0, 0x1 + strb r0, [r1] + b _0806E1CA + .align 2, 0 +_0806E1AC: .4byte gUnknown_203B418 +_0806E1B0: .4byte 0x00000179 +_0806E1B4: + ldr r2, _0806E4E4 + adds r0, r1, r5 + ldrb r1, [r0] + lsls r1, 1 + lsls r0, r7, 3 + adds r0, r7 + lsls r0, 2 + adds r1, r0 + adds r1, r2 + movs r0, 0 + ldrsh r4, [r1, r0] +_0806E1CA: + cmp r4, 0x2 + beq _0806E1DC + lsls r0, r4, 2 + add r0, sp + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r6, 0 + bl sub_800A34C +_0806E1DC: + lsls r0, r5, 2 + add r0, r9 + str r4, [r0] + ldr r0, _0806E4E8 + ldr r0, [r0] + movs r1, 0x9E + lsls r1, 1 + adds r0, r1 + adds r0, r5 + strb r4, [r0] + adds r5, 0x1 +_0806E1F2: + cmp r5, 0x1 + bgt _0806E20E + mov r1, sp + ldr r0, _0806E4EC + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r0, [r0] + str r0, [r1] + adds r0, r6, 0 + bl sub_800A2A0 + lsls r0, 24 + cmp r0, 0 + beq _0806E17E +_0806E20E: + ldr r2, _0806E4F0 + mov r1, r9 + ldr r0, [r1, 0x4] + lsls r0, 2 + ldr r1, [sp, 0x10] + lsls r1, 4 + adds r0, r1 + adds r0, r2 + ldr r0, [r0] + ldr r2, [sp, 0x48] + str r0, [r2, 0x8] + movs r3, 0x1 + mov r9, r3 + cmp r0, 0x3 + beq _0806E240 + movs r4, 0 + mov r9, r4 + ldr r0, [sp, 0x1C] + cmp r0, 0 + beq _0806E240 + ldr r0, _0806E4F4 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r6] + str r1, [r6, 0x4] +_0806E240: + cmp r7, 0x2 + beq _0806E248 + cmp r7, 0x6 + bne _0806E26C +_0806E248: + ldr r0, [sp, 0x18] + movs r1, 0x2 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806E26C + ldr r0, _0806E4E8 + ldr r0, [r0] + ldr r2, _0806E4F8 + adds r1, r0, r2 + movs r0, 0x1 + strb r0, [r1] + ldr r2, _0806E4FC + adds r0, r6, 0 + adds r1, r6, 0 + bl sub_800A34C +_0806E26C: + cmp r7, 0x2 + bne _0806E2A0 + ldr r0, [sp, 0x18] + bl sub_807723C + lsls r0, 24 + cmp r0, 0 + beq _0806E2A0 + ldr r0, _0806E4E8 + ldr r0, [r0] + movs r3, 0xB7 + lsls r3, 1 + adds r0, r3 + movs r4, 0 + movs r5, 0x1 + strb r5, [r0] + adds r0, r6, 0 + movs r1, 0 + bl sub_800A020 + ldr r0, [sp, 0x48] + str r4, [r0, 0x8] + strb r4, [r0, 0xD] + strb r5, [r0, 0xE] + movs r1, 0 + mov r9, r1 +_0806E2A0: + cmp r7, 0x9 + bne _0806E2D2 + ldr r0, [sp, 0x18] + movs r1, 0x37 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806E2D2 + ldr r0, _0806E4E8 + ldr r0, [r0] + ldr r2, _0806E500 + adds r0, r2 + movs r4, 0 + movs r5, 0x1 + strb r5, [r0] + adds r0, r6, 0 + movs r1, 0 + bl sub_800A020 + ldr r3, [sp, 0x48] + str r4, [r3, 0x8] + strb r4, [r3, 0xD] + strb r5, [r3, 0xE] + mov r9, r4 +_0806E2D2: + cmp r7, 0x3 + bne _0806E340 + mov r0, r8 + movs r1, 0x10 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806E340 + movs r4, 0 + ldr r0, [sp, 0x24] + movs r2, 0x10 + ldrsh r1, [r0, r2] + cmp r1, 0 + bge _0806E2F2 + adds r1, 0x3 +_0806E2F2: + asrs r1, 2 + ldr r3, [sp, 0x24] + movs r2, 0xE + ldrsh r0, [r3, r2] + cmp r1, r0 + blt _0806E300 + movs r4, 0x1 +_0806E300: + ldr r0, [sp, 0x24] + movs r1, 0x80 + adds r2, r4, 0 + bl sub_8071ACC + lsls r0, 24 + lsrs r5, r0, 24 + cmp r4, 0 + beq _0806E32A + ldr r0, _0806E4E8 + ldr r0, [r0] + movs r3, 0xB8 + lsls r3, 1 + adds r0, r3 + movs r1, 0x1 + strb r1, [r0] + ldr r2, _0806E504 + adds r0, r6, 0 + adds r1, r6, 0 + bl sub_800A34C +_0806E32A: + cmp r5, 0 + beq _0806E340 + mov r0, r8 + bl sub_80428EC + ldr r0, _0806E508 + ldr r2, [r0] + mov r0, r8 + ldr r1, [sp, 0x18] + bl sub_80522F4 +_0806E340: + cmp r7, 0x4 + bne _0806E3AC + mov r0, r8 + movs r1, 0x1A + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806E3AC + movs r4, 0 + ldr r0, [sp, 0x24] + movs r2, 0x10 + ldrsh r1, [r0, r2] + cmp r1, 0 + bge _0806E360 + adds r1, 0x3 +_0806E360: + asrs r1, 2 + ldr r3, [sp, 0x24] + movs r2, 0xE + ldrsh r0, [r3, r2] + cmp r1, r0 + blt _0806E36E + movs r4, 0x1 +_0806E36E: + ldr r0, [sp, 0x24] + movs r1, 0x2 + adds r2, r4, 0 + bl sub_8071ACC + lsls r0, 24 + lsrs r5, r0, 24 + cmp r4, 0 + beq _0806E396 + ldr r0, _0806E4E8 + ldr r0, [r0] + ldr r3, _0806E50C + adds r1, r0, r3 + movs r0, 0x1 + strb r0, [r1] + ldr r2, _0806E504 + adds r0, r6, 0 + adds r1, r6, 0 + bl sub_800A34C +_0806E396: + cmp r5, 0 + beq _0806E3AC + mov r0, r8 + bl sub_80428D8 + ldr r0, _0806E510 + ldr r2, [r0] + mov r0, r8 + ldr r1, [sp, 0x18] + bl sub_80522F4 +_0806E3AC: + cmp r7, 0xC + bne _0806E41A + mov r0, r8 + movs r1, 0x43 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806E41A + movs r4, 0 + ldr r0, [sp, 0x24] + movs r2, 0x10 + ldrsh r1, [r0, r2] + cmp r1, 0 + bge _0806E3CC + adds r1, 0x3 +_0806E3CC: + asrs r1, 2 + ldr r3, [sp, 0x24] + movs r2, 0xE + ldrsh r0, [r3, r2] + cmp r1, r0 + blt _0806E3DA + movs r4, 0x1 +_0806E3DA: + ldr r0, [sp, 0x24] + movs r1, 0x10 + adds r2, r4, 0 + bl sub_8071ACC + lsls r0, 24 + lsrs r5, r0, 24 + cmp r4, 0 + beq _0806E404 + ldr r0, _0806E4E8 + ldr r0, [r0] + movs r3, 0xB9 + lsls r3, 1 + adds r1, r0, r3 + movs r0, 0x1 + strb r0, [r1] + ldr r2, _0806E504 + adds r0, r6, 0 + adds r1, r6, 0 + bl sub_800A34C +_0806E404: + cmp r5, 0 + beq _0806E41A + mov r0, r8 + bl sub_8042978 + ldr r0, _0806E514 + ldr r2, [r0] + mov r0, r8 + ldr r1, [sp, 0x18] + bl sub_80522F4 +_0806E41A: + cmp r7, 0x2 + bne _0806E486 + mov r0, r8 + movs r1, 0x46 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806E486 + movs r4, 0 + ldr r0, [sp, 0x24] + movs r2, 0x10 + ldrsh r1, [r0, r2] + cmp r1, 0 + bge _0806E43A + adds r1, 0x3 +_0806E43A: + asrs r1, 2 + ldr r3, [sp, 0x24] + movs r2, 0xE + ldrsh r0, [r3, r2] + cmp r1, r0 + blt _0806E448 + movs r4, 0x1 +_0806E448: + ldr r0, [sp, 0x24] + movs r1, 0x20 + adds r2, r4, 0 + bl sub_8071ACC + lsls r0, 24 + lsrs r5, r0, 24 + cmp r4, 0 + beq _0806E470 + ldr r0, _0806E4E8 + ldr r0, [r0] + ldr r3, _0806E518 + adds r1, r0, r3 + movs r0, 0x1 + strb r0, [r1] + ldr r2, _0806E504 + adds r0, r6, 0 + adds r1, r6, 0 + bl sub_800A34C +_0806E470: + cmp r5, 0 + beq _0806E486 + mov r0, r8 + bl sub_804298C + ldr r0, _0806E51C + ldr r2, [r0] + mov r0, r8 + ldr r1, [sp, 0x18] + bl sub_80522F4 +_0806E486: + adds r0, r6, 0 + bl sub_800A2A0 + lsls r0, 24 + cmp r0, 0 + bne _0806E4B8 + mov r0, r8 + adds r1, r7, 0 + bl sub_8071858 + lsls r0, 24 + cmp r0, 0 + beq _0806E4B8 + ldr r0, _0806E4E8 + ldr r0, [r0] + movs r4, 0xBA + lsls r4, 1 + adds r0, r4 + movs r1, 0x1 + strb r1, [r0] + ldr r2, _0806E520 + adds r0, r6, 0 + adds r1, r6, 0 + bl sub_800A34C +_0806E4B8: + mov r0, r8 + bl sub_807E580 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + bne _0806E53E + cmp r7, 0x2 + bne _0806E524 + ldr r0, _0806E4E8 + ldr r0, [r0] + movs r1, 0xB6 + lsls r1, 1 + adds r0, r1 + strb r4, [r0] + ldr r2, _0806E520 + adds r0, r6, 0 + adds r1, r6, 0 + bl sub_800A34C + b _0806E53E + .align 2, 0 +_0806E4E4: .4byte gUnknown_80F522C +_0806E4E8: .4byte gUnknown_203B418 +_0806E4EC: .4byte gUnknown_8106F54 +_0806E4F0: .4byte gUnknown_80F54B4 +_0806E4F4: .4byte gUnknown_8106EFC +_0806E4F8: .4byte 0x0000016d +_0806E4FC: .4byte gUnknown_8106F1C +_0806E500: .4byte 0x0000016f +_0806E504: .4byte gUnknown_8106F0C +_0806E508: .4byte gUnknown_80FEDA8 +_0806E50C: .4byte 0x00000171 +_0806E510: .4byte gUnknown_80FED88 +_0806E514: .4byte gUnknown_80FEDC8 +_0806E518: .4byte 0x00000173 +_0806E51C: .4byte gUnknown_80FEDE8 +_0806E520: .4byte gUnknown_8106F14 +_0806E524: + cmp r7, 0x3 + bne _0806E53E + ldr r0, _0806E560 + ldr r0, [r0] + movs r2, 0xB6 + lsls r2, 1 + adds r0, r2 + strb r4, [r0] + ldr r2, _0806E564 + adds r0, r6, 0 + adds r1, r6, 0 + bl sub_800A34C +_0806E53E: + cmp r4, 0x4 + bne _0806E586 + cmp r7, 0x2 + bne _0806E56C + ldr r0, _0806E560 + ldr r0, [r0] + ldr r3, _0806E568 + adds r1, r0, r3 + movs r0, 0x1 + strb r0, [r1] + ldr r2, _0806E564 + adds r0, r6, 0 + adds r1, r6, 0 + bl sub_800A34C + b _0806E586 + .align 2, 0 +_0806E560: .4byte gUnknown_203B418 +_0806E564: .4byte gUnknown_8106F1C +_0806E568: .4byte 0x0000016b +_0806E56C: + cmp r7, 0x3 + bne _0806E586 + ldr r0, _0806E62C + ldr r0, [r0] + ldr r2, _0806E630 + adds r1, r0, r2 + movs r0, 0x1 + strb r0, [r1] + ldr r2, _0806E634 + adds r0, r6, 0 + adds r1, r6, 0 + bl sub_800A34C +_0806E586: + cmp r4, 0x3 + bne _0806E5A6 + cmp r7, 0x1 + beq _0806E5A6 + ldr r2, _0806E638 + adds r0, r6, 0 + adds r1, r6, 0 + bl sub_800A34C + ldr r0, _0806E62C + ldr r0, [r0] + movs r3, 0xB5 + lsls r3, 1 + adds r1, r0, r3 + movs r0, 0x1 + strb r0, [r1] +_0806E5A6: + ldr r0, _0806E62C + ldr r1, [r0] + ldr r2, _0806E63C + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _0806E5B8 + cmp r4, 0x6 + bne _0806E5CE +_0806E5B8: + cmp r7, 0x5 + bne _0806E5CE + ldr r3, _0806E640 + adds r1, r3 + movs r0, 0x1 + strb r0, [r1] + ldr r2, _0806E644 + adds r0, r6, 0 + adds r1, r6, 0 + bl sub_800A34C +_0806E5CE: + ldr r0, _0806E62C + ldr r1, [r0] + ldr r4, _0806E648 + adds r0, r1, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _0806E5F4 + cmp r7, 0x2 + bne _0806E5F4 + movs r0, 0xBB + lsls r0, 1 + adds r1, r0 + movs r0, 0x1 + strb r0, [r1] + ldr r2, _0806E644 + adds r0, r6, 0 + adds r1, r6, 0 + bl sub_800A34C +_0806E5F4: + cmp r7, 0x5 + bne _0806E618 + ldr r0, [sp, 0x24] + adds r0, 0xC0 + ldrb r0, [r0] + cmp r0, 0xB + bne _0806E618 + ldr r0, _0806E62C + ldr r0, [r0] + ldr r2, _0806E64C + adds r1, r0, r2 + movs r0, 0x1 + strb r0, [r1] + ldr r2, _0806E650 + adds r0, r6, 0 + adds r1, r6, 0 + bl sub_800A34C +_0806E618: + mov r0, r9 +_0806E61A: + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0806E62C: .4byte gUnknown_203B418 +_0806E630: .4byte 0x0000016b +_0806E634: .4byte gUnknown_8106F14 +_0806E638: .4byte gUnknown_8106F64 +_0806E63C: .4byte 0x0000e277 +_0806E640: .4byte 0x00000175 +_0806E644: .4byte gUnknown_8106F1C +_0806E648: .4byte 0x0000e278 +_0806E64C: .4byte 0x00000177 +_0806E650: .4byte gUnknown_8106F0C + thumb_func_end sub_806E100 + + thumb_func_start sub_806E654 +sub_806E654: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + mov r9, r0 + str r1, [sp, 0x14] + lsls r2, 24 + lsrs r4, r2, 24 + movs r5, 0x1 + movs r0, 0 + str r0, [sp, 0x10] + adds r0, r1, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0806E6DC + cmp r4, 0x1 + beq _0806E682 + cmp r4, 0x7 + bne _0806E686 +_0806E682: + movs r1, 0x1 + str r1, [sp, 0x10] +_0806E686: + mov r2, r9 + ldr r2, [r2, 0x70] + mov r8, r2 + ldr r3, [sp, 0x14] + ldr r3, [r3, 0x70] + mov r10, r3 + cmp r4, 0x2 + bne _0806E6A2 + ldr r0, [sp, 0x14] + bl sub_807723C + lsls r0, 24 + cmp r0, 0 + bne _0806E6C6 +_0806E6A2: + cmp r4, 0x5 + bne _0806E6B4 + ldr r0, [sp, 0x14] + movs r1, 0x23 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + bne _0806E6C6 +_0806E6B4: + cmp r4, 0x3 + bne _0806E6CA + ldr r0, [sp, 0x14] + movs r1, 0x24 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806E6CA +_0806E6C6: + movs r0, 0 + b _0806E894 +_0806E6CA: + cmp r4, 0x9 + bne _0806E6E0 + ldr r0, [sp, 0x14] + movs r1, 0x37 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806E6E0 +_0806E6DC: + movs r0, 0x1 + b _0806E894 +_0806E6E0: + mov r6, r10 + adds r6, 0x5C + str r6, [sp, 0x18] + lsls r0, r4, 3 + adds r0, r4 + lsls r0, 2 + mov r12, r0 + adds r2, r6, 0 +_0806E6F0: + mov r0, sp + ldr r1, _0806E724 + ldm r1!, {r3,r6,r7} + stm r0!, {r3,r6,r7} + ldr r1, [r1] + str r1, [r0] + ldr r7, [sp, 0x10] + cmp r7, 0 + beq _0806E730 + ldrb r0, [r2] + cmp r0, 0xE + bne _0806E730 + mov r0, r10 + adds r0, 0xF5 + ldrb r0, [r0] + cmp r0, 0 + bne _0806E730 + movs r3, 0 + ldr r0, _0806E728 + ldr r0, [r0] + ldr r6, _0806E72C + adds r1, r0, r6 + movs r0, 0x1 + strb r0, [r1] + b _0806E73E + .align 2, 0 +_0806E724: .4byte gUnknown_8106F6C +_0806E728: .4byte gUnknown_203B418 +_0806E72C: .4byte 0x00000179 +_0806E730: + ldrb r0, [r2] + lsls r0, 1 + add r0, r12 + ldr r7, _0806E854 + adds r0, r7 + movs r1, 0 + ldrsh r3, [r0, r1] +_0806E73E: + cmp r5, 0 + beq _0806E75E + lsls r0, r3, 2 + add r0, sp + ldr r0, [r0] + muls r5, r0 + lsrs r0, r5, 31 + adds r0, r5, r0 + asrs r5, r0, 1 + cmp r5, 0 + beq _0806E84E + adds r2, 0x1 + ldr r0, [sp, 0x18] + adds r0, 0x1 + cmp r2, r0 + ble _0806E6F0 +_0806E75E: + cmp r4, 0x2 + beq _0806E766 + cmp r4, 0x6 + bne _0806E774 +_0806E766: + ldr r0, [sp, 0x14] + movs r1, 0x2 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + bne _0806E84E +_0806E774: + cmp r4, 0x3 + bne _0806E7A0 + mov r0, r9 + movs r1, 0x10 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806E7A0 + mov r2, r8 + movs r3, 0x10 + ldrsh r1, [r2, r3] + cmp r1, 0 + bge _0806E792 + adds r1, 0x3 +_0806E792: + asrs r1, 2 + mov r6, r8 + movs r7, 0xE + ldrsh r0, [r6, r7] + cmp r1, r0 + blt _0806E7A0 + lsls r5, 1 +_0806E7A0: + cmp r4, 0x4 + bne _0806E7CC + mov r0, r9 + movs r1, 0x1A + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806E7CC + mov r0, r8 + movs r2, 0x10 + ldrsh r1, [r0, r2] + cmp r1, 0 + bge _0806E7BE + adds r1, 0x3 +_0806E7BE: + asrs r1, 2 + mov r3, r8 + movs r6, 0xE + ldrsh r0, [r3, r6] + cmp r1, r0 + blt _0806E7CC + lsls r5, 1 +_0806E7CC: + cmp r4, 0xC + bne _0806E7F8 + mov r0, r9 + movs r1, 0x43 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806E7F8 + mov r7, r8 + movs r0, 0x10 + ldrsh r1, [r7, r0] + cmp r1, 0 + bge _0806E7EA + adds r1, 0x3 +_0806E7EA: + asrs r1, 2 + mov r2, r8 + movs r3, 0xE + ldrsh r0, [r2, r3] + cmp r1, r0 + blt _0806E7F8 + lsls r5, 1 +_0806E7F8: + cmp r4, 0x2 + bne _0806E824 + mov r0, r9 + movs r1, 0x46 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806E824 + mov r6, r8 + movs r7, 0x10 + ldrsh r1, [r6, r7] + cmp r1, 0 + bge _0806E816 + adds r1, 0x3 +_0806E816: + asrs r1, 2 + mov r2, r8 + movs r3, 0xE + ldrsh r0, [r2, r3] + cmp r1, r0 + blt _0806E824 + lsls r5, 1 +_0806E824: + cmp r5, 0 + beq _0806E84E + mov r0, r9 + adds r1, r4, 0 + bl sub_8071858 + lsls r0, 24 + cmp r0, 0 + beq _0806E838 + lsls r5, 1 +_0806E838: + mov r0, r9 + bl sub_807E580 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0806E85A + cmp r4, 0x2 + beq _0806E858 + cmp r4, 0x3 + bne _0806E85A +_0806E84E: + movs r0, 0x2 + b _0806E894 + .align 2, 0 +_0806E854: .4byte gUnknown_80F522C +_0806E858: + lsls r5, 1 +_0806E85A: + ldr r0, _0806E8A4 + ldr r1, [r0] + ldr r6, _0806E8A8 + adds r1, r6 + ldrb r1, [r1] + cmp r1, 0 + beq _0806E86C + cmp r4, 0x5 + beq _0806E84E +_0806E86C: + ldr r0, [r0] + ldr r7, _0806E8AC + adds r0, r7 + ldrb r0, [r0] + cmp r0, 0 + beq _0806E87C + cmp r4, 0x2 + beq _0806E84E +_0806E87C: + cmp r4, 0x5 + bne _0806E88C + mov r0, r8 + adds r0, 0xC0 + ldrb r0, [r0] + cmp r0, 0xB + bne _0806E88C + lsls r5, 1 +_0806E88C: + cmp r5, 0x2 + ble _0806E892 + movs r5, 0x3 +_0806E892: + adds r0, r5, 0x2 +_0806E894: + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0806E8A4: .4byte gUnknown_203B418 +_0806E8A8: .4byte 0x0000e277 +_0806E8AC: .4byte 0x0000e278 + thumb_func_end sub_806E654 + + thumb_func_start sub_806E8B0 +sub_806E8B0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + adds r6, r0, 0 + mov r9, r1 + adds r0, r2, 0 + str r3, [sp] + lsls r0, 24 + lsrs r0, 24 + movs r7, 0x1 + movs r1, 0x1 + mov r8, r1 + movs r2, 0x1 + str r2, [sp, 0x4] + str r1, [sp, 0x8] + bl sub_8092354 + movs r2, 0 + mov r10, r2 + lsls r0, 24 + cmp r0, 0 + bne _0806E8E6 + movs r0, 0x1 + mov r10, r0 +_0806E8E6: + adds r0, r6, 0 + movs r1, 0x11 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806E92C + ldr r5, [r6, 0x70] + adds r0, r6, 0 + bl sub_8070A58 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl sub_8071ACC + lsls r0, 24 + lsrs r0, 24 + cmp r4, 0 + beq _0806E916 + movs r7, 0x2 +_0806E916: + cmp r0, 0 + beq _0806E92C + adds r0, r6, 0 + bl sub_80428B0 + ldr r0, _0806EADC + ldr r2, [r0] + adds r0, r6, 0 + mov r1, r9 + bl sub_80522F4 +_0806E92C: + adds r0, r6, 0 + movs r1, 0x22 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + bne _0806E948 + adds r0, r6, 0 + movs r1, 0x4B + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806E98E +_0806E948: + ldr r2, [r6, 0x70] + movs r4, 0 + ldr r0, [sp, 0x30] + cmp r0, 0x20 + bgt _0806E95A + mov r1, r10 + cmp r1, 0 + bne _0806E95A + movs r4, 0x1 +_0806E95A: + movs r1, 0x80 + lsls r1, 1 + adds r0, r2, 0 + adds r2, r4, 0 + bl sub_8071ACC + lsls r0, 24 + lsrs r1, r0, 24 + cmp r4, 0 + beq _0806E978 + lsls r0, r7, 1 + adds r7, r0, r7 + mov r2, r8 + lsls r2, 1 + mov r8, r2 +_0806E978: + cmp r1, 0 + beq _0806E98E + adds r0, r6, 0 + bl sub_80428C4 + ldr r0, _0806EAE0 + ldr r2, [r0] + adds r0, r6, 0 + mov r1, r9 + bl sub_80522F4 +_0806E98E: + adds r0, r6, 0 + movs r1, 0x30 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806E9AC + mov r0, r10 + cmp r0, 0 + bne _0806E9AC + lsls r0, r7, 1 + adds r7, r0, r7 + mov r1, r8 + lsls r1, 1 + mov r8, r1 +_0806E9AC: + ldr r0, [r6, 0x70] + ldrb r0, [r0, 0x6] + movs r4, 0x1 + cmp r0, 0 + beq _0806E9B8 + movs r4, 0 +_0806E9B8: + adds r0, r6, 0 + movs r1, 0x38 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806E9EA + mov r2, r10 + cmp r2, 0x1 + bne _0806E9EA + ldr r0, _0806EAE4 + ldr r0, [r0] + ldr r1, _0806EAE8 + adds r0, r1 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _0806E9EA + lsls r0, r7, 4 + subs r7, r0, r7 + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 1 + mov r8, r0 +_0806E9EA: + adds r0, r6, 0 + movs r1, 0x3F + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806EA1C + mov r0, r10 + cmp r0, 0x1 + bne _0806EA1C + ldr r0, _0806EAE4 + ldr r0, [r0] + ldr r1, _0806EAEC + adds r0, r1 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _0806EA1C + lsls r0, r7, 4 + subs r7, r0, r7 + mov r2, r8 + lsls r0, r2, 2 + add r0, r8 + lsls r0, 1 + mov r8, r0 +_0806EA1C: + mov r0, r9 + movs r1, 0x6 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806EA38 + mov r0, r10 + cmp r0, 0 + bne _0806EA38 + lsls r7, 2 + mov r1, r8 + lsls r0, r1, 2 + add r8, r0 +_0806EA38: + mov r0, r9 + movs r1, 0x34 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806EA90 + mov r2, r10 + cmp r2, 0 + bne _0806EA90 + mov r0, r9 + ldr r5, [r0, 0x70] + bl sub_8070A58 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + movs r1, 0x8 + adds r2, r4, 0 + bl sub_8071ACC + lsls r0, 24 + lsrs r1, r0, 24 + cmp r4, 0 + beq _0806EA7A + ldr r2, [sp, 0x4] + lsls r0, r2, 1 + adds r2, r0, r2 + str r2, [sp, 0x4] + ldr r0, [sp, 0x8] + lsls r0, 1 + str r0, [sp, 0x8] +_0806EA7A: + cmp r1, 0 + beq _0806EA90 + mov r0, r9 + bl sub_8042940 + ldr r0, _0806EAF0 + ldr r2, [r0] + adds r0, r6, 0 + mov r1, r9 + bl sub_80522F4 +_0806EA90: + ldr r1, [sp] + ldr r0, [r1] + muls r0, r7 + str r0, [r1] + ldr r2, [sp, 0x2C] + ldr r0, [r2] + ldr r1, [sp, 0x4] + muls r0, r1 + str r0, [r2] + mov r2, r8 + cmp r2, 0x1 + beq _0806EAB6 + ldr r1, [sp] + ldr r0, [r1] + mov r1, r8 + bl __divsi3 + ldr r2, [sp] + str r0, [r2] +_0806EAB6: + ldr r0, [sp, 0x8] + cmp r0, 0x1 + beq _0806EACA + ldr r1, [sp, 0x2C] + ldr r0, [r1] + ldr r1, [sp, 0x8] + bl __divsi3 + ldr r2, [sp, 0x2C] + str r0, [r2] +_0806EACA: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0806EADC: .4byte gUnknown_80FEE04 +_0806EAE0: .4byte gUnknown_80FEE2C +_0806EAE4: .4byte gUnknown_203B418 +_0806EAE8: .4byte 0x000037fa +_0806EAEC: .4byte 0x000037f8 +_0806EAF0: .4byte gUnknown_80FEE54 + thumb_func_end sub_806E8B0 + + thumb_func_start sub_806EAF4 +sub_806EAF4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8C + str r0, [sp, 0x70] + mov r9, r1 + adds r7, r3, 0 + ldr r0, [sp, 0xB8] + ldr r1, [sp, 0xBC] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x74] + lsls r0, 16 + lsrs r4, r0, 16 + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x78] + ldr r0, [sp, 0x70] + ldr r0, [r0, 0x70] + mov r10, r0 + mov r1, r9 + ldr r1, [r1, 0x70] + str r1, [sp, 0x7C] + adds r0, r2, 0 + bl sub_8092354 + movs r2, 0 + str r2, [sp, 0x80] + lsls r0, 24 + cmp r0, 0 + bne _0806EB3A + movs r3, 0x1 + str r3, [sp, 0x80] +_0806EB3A: + bl sub_806F500 + mov r6, r10 + ldrb r0, [r6, 0x7] + cmp r0, 0 + bne _0806EB72 + movs r0, 0x9E + lsls r0, 1 + add r0, r10 + ldr r0, [r0] + bl sub_8094450 + adds r1, r0, 0 + cmp r1, 0 + bne _0806EB72 + movs r0, 0x1 + ldr r2, [sp, 0xB0] + str r0, [r2] + str r1, [r2, 0x4] + movs r0, 0x2 + str r0, [r2, 0x8] + add r3, sp, 0x74 + ldrb r3, [r3] + strb r3, [r2, 0xC] + strb r1, [r2, 0xD] + strb r1, [r2, 0xE] + strb r1, [r2, 0xF] + b _0806F294 +_0806EB72: + ldr r0, _0806EBA4 + cmp r4, r0 + bne _0806EBA8 + mov r0, r9 + movs r1, 0x35 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806EBA8 + movs r0, 0x1 + ldr r6, [sp, 0xB0] + str r0, [r6] + movs r1, 0 + str r1, [r6, 0x4] + movs r0, 0x2 + str r0, [r6, 0x8] + add r0, sp, 0x74 + ldrb r0, [r0] + strb r0, [r6, 0xC] + strb r1, [r6, 0xD] + strb r1, [r6, 0xE] + strb r1, [r6, 0xF] + b _0806F294 + .align 2, 0 +_0806EBA4: .4byte 0x00000163 +_0806EBA8: + add r1, sp, 0x74 + ldrb r2, [r1] + ldr r1, [sp, 0xB0] + strb r2, [r1, 0xC] + ldr r1, _0806EDA4 + ldr r0, [r1] + movs r2, 0x9A + lsls r2, 1 + adds r0, r2 + add r3, sp, 0x74 + ldrb r3, [r3] + strb r3, [r0] + ldr r2, [r1] + movs r6, 0x9C + lsls r6, 1 + adds r0, r2, r6 + ldr r1, [sp, 0x80] + str r1, [r0] + lsls r1, 1 + mov r0, r10 + adds r0, 0x1C + adds r0, r1 + movs r3, 0 + ldrsh r4, [r0, r3] + mov r8, r1 + ldr r6, [sp, 0x78] + cmp r6, 0 + beq _0806EBF8 + ldr r0, [sp, 0x74] + cmp r0, 0x2 + bne _0806EBF8 + mov r1, r10 + movs r3, 0x28 + ldrsh r0, [r1, r3] + adds r4, r0 + ldrh r1, [r1, 0x28] + movs r6, 0xA2 + lsls r6, 1 + adds r0, r2, r6 + strh r1, [r0] +_0806EBF8: + mov r0, r10 + movs r2, 0x4 + ldrsh r1, [r0, r2] + ldr r0, _0806EDA8 + cmp r1, r0 + bne _0806EC06 + adds r4, 0x2 +_0806EC06: + movs r0, 0xD1 + lsls r0, 1 + cmp r1, r0 + bne _0806EC10 + subs r4, 0x2 +_0806EC10: + ldr r0, _0806EDAC + cmp r1, r0 + bne _0806EC18 + subs r4, 0x2 +_0806EC18: + cmp r4, 0 + bge _0806EC1E + movs r4, 0 +_0806EC1E: + cmp r4, 0x14 + ble _0806EC24 + movs r4, 0x14 +_0806EC24: + ldr r6, _0806EDA4 + ldr r0, [r6] + movs r3, 0x9F + lsls r3, 1 + adds r0, r3 + strb r4, [r0] + ldr r1, [r6] + mov r5, r10 + adds r5, 0x14 + ldr r0, [sp, 0x80] + adds r2, r5, r0 + ldrb r0, [r2] + adds r0, r7 + adds r3, 0x2 + adds r1, r3 + strh r0, [r1] + ldrb r0, [r2] + adds r0, r7 + lsls r0, 8 + ldr r2, _0806EDB0 + lsls r1, r4, 2 + adds r1, r2 + ldr r1, [r1] + bl sub_8009DA4 + adds r2, r0, 0 + ldr r0, [sp, 0x80] + lsls r4, r0, 2 + mov r0, r10 + adds r0, 0x2C + adds r0, r4 + ldr r1, [r0] + adds r0, r2, 0 + bl sub_8009DA4 + adds r2, r0, 0 + str r5, [sp, 0x88] + cmp r2, 0 + bge _0806EC74 + adds r0, 0xFF +_0806EC74: + asrs r0, 8 + str r0, [sp, 0x8] + ldr r0, [sp, 0x7C] + adds r0, 0x20 + add r0, r8 + movs r1, 0 + ldrsh r3, [r0, r1] + ldr r2, [sp, 0x80] + cmp r2, 0 + bne _0806ECA0 + ldr r0, [sp, 0x7C] + adds r0, 0xC0 + ldrb r0, [r0] + cmp r0, 0x6 + bne _0806ECA0 + ldr r0, [r6] + movs r6, 0xBD + lsls r6, 1 + adds r1, r0, r6 + movs r0, 0x1 + strb r0, [r1] + adds r3, 0x1 +_0806ECA0: + ldr r0, [sp, 0x7C] + movs r2, 0x4 + ldrsh r1, [r0, r2] + ldr r0, _0806EDA8 + cmp r1, r0 + bne _0806ECAE + subs r3, 0x2 +_0806ECAE: + movs r0, 0xD1 + lsls r0, 1 + cmp r1, r0 + bne _0806ECB8 + adds r3, 0x2 +_0806ECB8: + ldr r0, _0806EDAC + cmp r1, r0 + bne _0806ECC0 + subs r3, 0x2 +_0806ECC0: + cmp r3, 0 + bge _0806ECC6 + movs r3, 0 +_0806ECC6: + cmp r3, 0x14 + ble _0806ECCC + movs r3, 0x14 +_0806ECCC: + ldr r5, _0806EDA4 + ldr r0, [r5] + ldr r6, _0806EDB4 + adds r0, r6 + strb r3, [r0] + ldr r2, [r5] + ldr r0, [sp, 0x7C] + adds r0, 0x16 + ldr r1, [sp, 0x80] + adds r0, r1 + ldrb r1, [r0] + adds r6, 0x3 + adds r2, r6 + strh r1, [r2] + ldrb r0, [r0] + lsls r0, 8 + ldr r2, _0806EDB8 + lsls r1, r3, 2 + adds r1, r2 + ldr r1, [r1] + bl sub_8009DA4 + adds r2, r0, 0 + ldr r0, [sp, 0x7C] + adds r0, 0x34 + adds r0, r4 + ldr r1, [r0] + adds r0, r2, 0 + bl sub_8009DA4 + cmp r0, 0 + bge _0806ED0E + adds r0, 0xFF +_0806ED0E: + asrs r0, 8 + str r0, [sp, 0xC] + movs r0, 0x64 + bl sub_8084100 + str r0, [sp, 0x84] + ldr r0, [sp, 0x80] + cmp r0, 0 + bne _0806EDC8 + ldr r0, [sp, 0x70] + movs r1, 0x13 + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _0806ED4A + ldr r2, _0806EDBC + movs r3, 0 + ldrsh r1, [r2, r3] + ldr r0, [sp, 0x8] + adds r0, r1 + str r0, [sp, 0x8] + ldr r1, [r5] + movs r6, 0xB0 + lsls r6, 1 + adds r1, r6 + ldrb r0, [r2] + ldrb r2, [r1] + adds r0, r2 + strb r0, [r1] +_0806ED4A: + ldr r0, [sp, 0x70] + movs r1, 0x2B + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _0806ED74 + ldr r2, _0806EDC0 + movs r3, 0 + ldrsh r1, [r2, r3] + ldr r0, [sp, 0x8] + adds r0, r1 + str r0, [sp, 0x8] + ldr r1, [r5] + movs r6, 0xB0 + lsls r6, 1 + adds r1, r6 + ldrb r0, [r2] + ldrb r2, [r1] + adds r0, r2 + strb r0, [r1] +_0806ED74: + ldr r3, [sp, 0x78] + cmp r3, 0 + beq _0806EE4A + mov r0, r9 + movs r1, 0x1E + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _0806EE4A + ldr r2, _0806EDC4 + movs r6, 0 + ldrsh r1, [r2, r6] + ldr r0, [sp, 0xC] + adds r0, r1 + str r0, [sp, 0xC] + ldr r0, [r5] + movs r3, 0xB1 + lsls r3, 1 + adds r1, r0, r3 + ldrb r0, [r2] + ldrb r6, [r1] + adds r0, r6 + b _0806EE48 + .align 2, 0 +_0806EDA4: .4byte gUnknown_203B418 +_0806EDA8: .4byte 0x000001a1 +_0806EDAC: .4byte 0x000001a3 +_0806EDB0: .4byte gUnknown_80F504C +_0806EDB4: .4byte 0x0000013f +_0806EDB8: .4byte gUnknown_80F50A0 +_0806EDBC: .4byte gUnknown_810AC60 +_0806EDC0: .4byte gUnknown_810AC68 +_0806EDC4: .4byte gUnknown_810AC64 +_0806EDC8: + ldr r0, [sp, 0x78] + cmp r0, 0 + beq _0806EDF6 + mov r0, r9 + movs r1, 0x22 + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _0806EDF6 + ldr r2, _0806EEF8 + movs r3, 0 + ldrsh r1, [r2, r3] + ldr r0, [sp, 0xC] + adds r0, r1 + str r0, [sp, 0xC] + ldr r0, [r5] + ldr r6, _0806EEFC + adds r1, r0, r6 + ldrb r0, [r2] + ldrb r2, [r1] + adds r0, r2 + strb r0, [r1] +_0806EDF6: + ldr r0, [sp, 0x70] + movs r1, 0x21 + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _0806EE20 + ldr r2, _0806EF00 + movs r3, 0 + ldrsh r1, [r2, r3] + ldr r0, [sp, 0x8] + adds r0, r1 + str r0, [sp, 0x8] + ldr r0, _0806EF04 + ldr r0, [r0] + ldr r6, _0806EF08 + adds r1, r0, r6 + ldrb r0, [r2] + ldrb r2, [r1] + adds r0, r2 + strb r0, [r1] +_0806EE20: + ldr r0, [sp, 0x70] + movs r1, 0x2B + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _0806EE4A + ldr r2, _0806EF0C + movs r3, 0 + ldrsh r1, [r2, r3] + ldr r0, [sp, 0x8] + adds r0, r1 + str r0, [sp, 0x8] + ldr r0, _0806EF04 + ldr r0, [r0] + ldr r6, _0806EF08 + adds r1, r0, r6 + ldrb r0, [r2] + ldrb r2, [r1] + adds r0, r2 +_0806EE48: + strb r0, [r1] +_0806EE4A: + ldr r0, _0806EF04 + ldr r2, [r0] + movs r3, 0xA3 + lsls r3, 1 + adds r1, r2, r3 + add r0, sp, 0x8 + ldrh r0, [r0] + strh r0, [r1] + movs r6, 0xA4 + lsls r6, 1 + adds r1, r2, r6 + add r4, sp, 0xC + ldrh r0, [r4] + strh r0, [r1] + ldr r0, [sp, 0x8] + cmp r0, 0 + bge _0806EE70 + movs r0, 0 + str r0, [sp, 0x8] +_0806EE70: + ldr r1, _0806EF10 + ldr r0, [sp, 0x8] + cmp r0, r1 + ble _0806EE7C + ldr r0, _0806EF14 + str r0, [sp, 0x8] +_0806EE7C: + movs r3, 0xA8 + lsls r3, 1 + add r3, r10 + ldrh r2, [r3] + ldr r1, _0806EF18 + adds r0, r1, 0 + ands r0, r2 + strh r0, [r3] + movs r2, 0xA7 + lsls r2, 1 + add r2, r10 + ldrh r0, [r2] + ands r1, r0 + strh r1, [r2] + str r4, [sp] + ldr r0, [sp, 0x84] + str r0, [sp, 0x4] + ldr r0, [sp, 0x70] + mov r1, r9 + ldr r2, [sp, 0x74] + add r3, sp, 0x8 + bl sub_806E8B0 + add r5, sp, 0x10 + ldr r1, [sp, 0x8] + ldr r0, [sp, 0xC] + subs r1, r0 + adds r0, r5, 0 + bl sub_800A020 + add r4, sp, 0x18 + adds r0, r4, 0 + movs r1, 0x8 + bl sub_800A020 + adds r0, r5, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_800A3F0 + mov r1, r10 + ldrb r6, [r1, 0x6] + mov r8, r5 + adds r7, r4, 0 + cmp r6, 0 + bne _0806EF20 + ldrb r1, [r1, 0x9] + adds r0, r7, 0 + bl sub_800A020 + str r6, [sp, 0x20] + ldr r0, _0806EF1C + add r2, sp, 0x20 + str r0, [r2, 0x4] + adds r0, r7, 0 + adds r1, r7, 0 + bl sub_800A34C + mov r2, r10 + ldrb r0, [r2, 0x9] + lsls r0, 1 + b _0806EF60 + .align 2, 0 +_0806EEF8: .4byte gUnknown_810AC66 +_0806EEFC: .4byte 0x00000163 +_0806EF00: .4byte gUnknown_810AC62 +_0806EF04: .4byte gUnknown_203B418 +_0806EF08: .4byte 0x00000161 +_0806EF0C: .4byte gUnknown_810AC68 +_0806EF10: .4byte 0x000003e6 +_0806EF14: .4byte 0x000003e7 +_0806EF18: .4byte 0x0000feff +_0806EF1C: .4byte 0x0000aaaa +_0806EF20: + ldr r3, [sp, 0x88] + ldr r6, [sp, 0x80] + adds r0, r3, r6 + ldrb r0, [r0] + str r0, [sp, 0x28] + movs r0, 0x1 + str r0, [sp, 0x2C] + add r3, sp, 0x28 + add r0, sp, 0x2C + str r0, [sp] + ldr r0, [sp, 0x84] + str r0, [sp, 0x4] + ldr r0, [sp, 0x70] + mov r1, r9 + ldr r2, [sp, 0x74] + bl sub_806E8B0 + ldr r1, [sp, 0x28] + adds r0, r7, 0 + bl sub_800A020 + add r4, sp, 0x20 + adds r0, r4, 0 + movs r1, 0x3 + bl sub_800A020 + adds r0, r7, 0 + adds r1, r7, 0 + adds r2, r4, 0 + bl sub_800A3F0 + ldr r0, [sp, 0x28] +_0806EF60: + movs r1, 0x3 + bl __divsi3 + adds r6, r0, 0 + add r5, sp, 0x30 + adds r0, r5, 0 + mov r1, r8 + adds r2, r7, 0 + bl sub_800A6D0 + ldr r4, _0806F098 + ldr r0, [r4] + movs r1, 0xA5 + lsls r1, 1 + adds r0, r1 + movs r2, 0 + mov r8, r2 + strh r6, [r0] + adds r0, r5, 0 + bl sub_800A048 + ldr r1, [r4] + movs r3, 0xA6 + lsls r3, 1 + adds r1, r3 + strh r0, [r1] + ldr r0, [sp, 0x30] + ldr r1, [sp, 0x34] + str r0, [sp, 0x38] + str r1, [sp, 0x3C] + str r0, [sp, 0x48] + str r1, [sp, 0x4C] + add r6, sp, 0x38 + adds r0, r6, 0 + adds r1, r6, 0 + adds r2, r6, 0 + bl sub_800A34C + mov r0, r8 + str r0, [sp, 0x40] + ldr r0, _0806F09C + add r5, sp, 0x40 + str r0, [r5, 0x4] + adds r0, r6, 0 + adds r1, r6, 0 + adds r2, r5, 0 + bl sub_800A34C + adds r0, r5, 0 + movs r1, 0x2 + bl sub_800A020 + add r4, sp, 0x48 + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_800A34C + ldr r1, [sp, 0xC] + adds r0, r5, 0 + bl sub_800A020 + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_800A6F0 + adds r0, r5, 0 + movs r1, 0xA + bl sub_800A020 + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_800A6D0 + add r5, sp, 0x50 + adds r0, r5, 0 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_800A6D0 + ldr r4, _0806F0A0 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_800A2F0 + lsls r0, 24 + mov r8, r5 + cmp r0, 0 + beq _0806F01E + ldr r0, [r4] + ldr r1, [r4, 0x4] + str r0, [sp, 0x50] + str r1, [sp, 0x54] +_0806F01E: + ldr r4, _0806F0A4 + mov r0, r8 + adds r1, r4, 0 + bl sub_800A2F0 + lsls r0, 24 + cmp r0, 0 + beq _0806F036 + ldr r0, [r4] + ldr r1, [r4, 0x4] + str r0, [sp, 0x50] + str r1, [sp, 0x54] +_0806F036: + add r4, sp, 0x58 + ldr r1, [sp, 0xB0] + str r1, [sp] + adds r0, r4, 0 + ldr r1, [sp, 0x70] + mov r2, r9 + ldr r3, [sp, 0x74] + bl sub_806E100 + lsls r0, 24 + lsrs r5, r0, 24 + adds r7, r4, 0 + ldr r2, [sp, 0x74] + cmp r2, 0x2 + bne _0806F0BC + mov r0, r9 + bl sub_807723C + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _0806F0BC + ldr r3, [sp, 0x7C] + movs r6, 0xA9 + lsls r6, 1 + adds r1, r3, r6 + ldrb r0, [r1] + cmp r0, 0 + bne _0806F0BC + ldr r0, [sp, 0x78] + cmp r0, 0 + beq _0806F118 + movs r0, 0x1 + strb r0, [r1] + ldr r0, _0806F0A8 + mov r1, r9 + movs r2, 0 + bl sub_8045B94 + cmp r4, 0x1 + bne _0806F0B0 + ldr r0, _0806F0AC + ldr r2, [r0] + ldr r0, [sp, 0x70] + mov r1, r9 + bl sub_80522F4 + b _0806F0BC + .align 2, 0 +_0806F098: .4byte gUnknown_203B418 +_0806F09C: .4byte 0x00000ccc +_0806F0A0: .4byte gUnknown_8106F24 +_0806F0A4: .4byte gUnknown_8106F04 +_0806F0A8: .4byte gUnknown_202DFE8 +_0806F0AC: .4byte gUnknown_80FAE00 +_0806F0B0: + ldr r0, _0806F15C + ldr r2, [r0] + ldr r0, [sp, 0x70] + mov r1, r9 + bl sub_80522F4 +_0806F0BC: + ldr r1, [sp, 0x78] + cmp r1, 0 + beq _0806F118 + ldr r2, [sp, 0x80] + cmp r2, 0 + bne _0806F0EE + ldr r0, [sp, 0x7C] + adds r0, 0xC4 + ldrb r4, [r0] + cmp r4, 0x1 + bne _0806F0EE + mov r0, r9 + bl sub_8041B74 + ldr r2, _0806F160 + adds r0, r7, 0 + adds r1, r7, 0 + bl sub_800A34C + ldr r0, _0806F164 + ldr r0, [r0] + movs r3, 0xB3 + lsls r3, 1 + adds r0, r3 + strb r4, [r0] +_0806F0EE: + ldr r6, [sp, 0x80] + cmp r6, 0x1 + bne _0806F118 + ldr r0, [sp, 0x7C] + adds r0, 0xC4 + ldrb r0, [r0] + cmp r0, 0x3 + bne _0806F118 + mov r0, r9 + bl sub_8041B5C + ldr r2, _0806F160 + adds r0, r7, 0 + adds r1, r7, 0 + bl sub_800A34C + ldr r0, _0806F164 + ldr r0, [r0] + ldr r1, _0806F168 + adds r0, r1 + strb r6, [r0] +_0806F118: + mov r0, r9 + movs r1, 0xC + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + bne _0806F1F4 + mov r0, r9 + movs r1, 0x13 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + bne _0806F1F4 + mov r3, r10 + ldrb r0, [r3, 0x6] + ldr r4, [sp, 0xAC] + cmp r0, 0 + beq _0806F140 + movs r4, 0 +_0806F140: + mov r0, r10 + adds r0, 0xDC + ldrb r0, [r0] + cmp r0, 0x4 + bne _0806F170 + ldr r4, _0806F16C + ldr r0, _0806F164 + ldr r0, [r0] + movs r6, 0xB4 + lsls r6, 1 + adds r0, r6 + movs r1, 0x1 + strb r1, [r0] + b _0806F1DA + .align 2, 0 +_0806F15C: .4byte gUnknown_80FADD8 +_0806F160: .4byte gUnknown_8106F1C +_0806F164: .4byte gUnknown_203B418 +_0806F168: .4byte 0x00000167 +_0806F16C: .4byte 0x000003e7 +_0806F170: + ldr r0, [sp, 0x70] + movs r1, 0xC + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _0806F194 + ldr r0, _0806F2A4 + movs r1, 0 + ldrsh r0, [r0, r1] + adds r4, r0 + ldr r0, _0806F2A8 + ldr r0, [r0] + movs r2, 0xB2 + lsls r2, 1 + adds r0, r2 + movs r1, 0x1 + strb r1, [r0] +_0806F194: + mov r0, r9 + movs r1, 0xD + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _0806F1B6 + ldr r0, _0806F2A4 + movs r3, 0 + ldrsh r0, [r0, r3] + adds r4, r0 + ldr r0, _0806F2A8 + ldr r0, [r0] + ldr r6, _0806F2AC + adds r1, r0, r6 + movs r0, 0x1 + strb r0, [r1] +_0806F1B6: + cmp r5, 0 + beq _0806F1DA + ldr r0, [sp, 0x70] + movs r1, 0x1 + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _0806F1DA + ldr r0, _0806F2B0 + movs r1, 0 + ldrsh r4, [r0, r1] + ldr r0, _0806F2A8 + ldr r0, [r0] + ldr r2, _0806F2B4 + adds r1, r0, r2 + movs r0, 0x1 + strb r0, [r1] +_0806F1DA: + movs r0, 0x64 + bl sub_8084100 + cmp r0, r4 + bge _0806F1F4 + ldr r2, _0806F2B8 + adds r0, r7, 0 + adds r1, r7, 0 + bl sub_800A34C + movs r0, 0x1 + ldr r3, [sp, 0xB0] + strb r0, [r3, 0xD] +_0806F1F4: + mov r0, r8 + bl sub_800A048 + ldr r5, _0806F2A8 + ldr r1, [r5] + movs r6, 0xAA + lsls r6, 1 + adds r1, r6 + str r0, [r1] + mov r0, r8 + mov r1, r8 + adds r2, r7, 0 + bl sub_800A34C + ldr r0, [r5] + movs r1, 0xAE + lsls r1, 1 + adds r0, r1 + ldr r2, [sp, 0xB4] + str r2, [r0] + add r4, sp, 0x60 + adds r0, r4, 0 + adds r1, r2, 0 + bl sub_800A088 + mov r0, r8 + mov r1, r8 + adds r2, r4, 0 + bl sub_800A34C + mov r0, r8 + bl sub_800A048 + ldr r1, [r5] + movs r3, 0xA8 + lsls r3, 1 + adds r1, r3 + str r0, [r1] + movs r0, 0x80 + lsls r0, 7 + bl sub_8084100 + movs r6, 0 + str r6, [sp, 0x58] + movs r1, 0xE0 + lsls r1, 8 + adds r0, r1 + str r0, [r7, 0x4] + mov r0, r8 + mov r1, r8 + adds r2, r7, 0 + bl sub_800A34C + add r4, sp, 0x68 + adds r0, r4, 0 + movs r1, 0x64 + bl sub_800A020 + adds r0, r7, 0 + adds r1, r4, 0 + adds r2, r7, 0 + bl sub_800A34C + adds r0, r7, 0 + bl sub_800A048 + ldr r1, [r5] + movs r2, 0xAC + lsls r2, 1 + adds r1, r2 + str r0, [r1] + mov r0, r8 + bl sub_800A048 + ldr r3, [sp, 0xB0] + str r0, [r3] + str r6, [r3, 0x4] + cmp r0, 0 + bne _0806F294 + strb r0, [r3, 0xD] +_0806F294: + add sp, 0x8C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0806F2A4: .4byte gUnknown_80F4DAE +_0806F2A8: .4byte gUnknown_203B418 +_0806F2AC: .4byte 0x00000165 +_0806F2B0: .4byte gUnknown_80F4DB0 +_0806F2B4: .4byte 0x00000169 +_0806F2B8: .4byte gUnknown_8106F14 + thumb_func_end sub_806EAF4 + + thumb_func_start sub_806F2BC +sub_806F2BC: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + adds r5, r0, 0 + mov r12, r1 + ldr r7, [sp, 0x2C] + lsls r2, 24 + lsrs r4, r2, 24 + adds r6, r3, 0 + cmp r6, 0 + bgt _0806F2D6 + movs r6, 0x1 +_0806F2D6: + ldr r0, _0806F320 + cmp r6, r0 + ble _0806F2DE + adds r6, r0, 0 +_0806F2DE: + movs r0, 0 + mov r8, r0 + strb r4, [r7, 0xC] + str r7, [sp] + add r0, sp, 0x4 + adds r1, r5, 0 + mov r2, r12 + adds r3, r4, 0 + bl sub_806E100 + add r4, sp, 0xC + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_800A020 + adds r0, r4, 0 + adds r1, r4, 0 + add r2, sp, 0x4 + bl sub_800A34C + adds r0, r4, 0 + bl sub_800A048 + str r0, [r7] + mov r0, r8 + str r0, [r7, 0x4] + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0806F320: .4byte 0x000003e7 + thumb_func_end sub_806F2BC + + thumb_func_start sub_806F324 +sub_806F324: + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x94 + mov r8, r0 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r4, r3, 16 + asrs r4, 16 + add r0, sp, 0x10 + bl sub_80457DC + add r2, sp, 0x84 + str r5, [sp, 0x84] + movs r0, 0x2 + str r0, [r2, 0x8] + movs r0, 0 + strb r0, [r2, 0xC] + str r6, [r2, 0x4] + strb r0, [r2, 0xD] + strb r0, [r2, 0xE] + strb r0, [r2, 0xF] + str r0, [sp] + str r4, [sp, 0x4] + str r0, [sp, 0x8] + str r0, [sp, 0xC] + add r0, sp, 0x10 + mov r1, r8 + movs r3, 0 + bl sub_806D010 + add sp, 0x94 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_806F324 + + thumb_func_start sub_806F370 +sub_806F370: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + mov r10, r0 + adds r7, r1, 0 + mov r9, r3 + ldr r0, [sp, 0x50] + ldr r1, [sp, 0x54] + ldr r3, [sp, 0x58] + lsls r0, 24 + lsrs r4, r0, 24 + lsls r1, 16 + asrs r1, 16 + mov r8, r1 + adds r5, r2, 0 + movs r0, 0x2 + str r0, [sp, 0x18] + str r3, [sp, 0x14] + add r0, sp, 0x10 + movs r1, 0 + strb r4, [r0, 0xC] + strb r1, [r0, 0xD] + strb r1, [r0, 0xE] + cmp r4, 0 + beq _0806F3FC + ldr r1, [r7, 0x70] + movs r2, 0 + lsls r0, r4, 3 + mov r3, sp + adds r3, 0x20 + str r3, [sp, 0x28] + ldr r6, _0806F408 + mov r12, r6 + adds r1, 0x5C + adds r0, r4 + lsls r3, r0, 2 + ldr r4, [sp, 0x28] +_0806F3C0: + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r3 + add r0, r12 + movs r6, 0 + ldrsh r0, [r0, r6] + stm r4!, {r0} + adds r2, 0x1 + cmp r2, 0x1 + ble _0806F3C0 + adds r0, r7, 0 + movs r1, 0x35 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0806F3FC + ldr r2, _0806F40C + ldr r1, [sp, 0x28] + ldr r0, [r1, 0x4] + lsls r0, 2 + ldr r1, [sp, 0x20] + lsls r1, 4 + adds r0, r1 + adds r0, r2 + ldr r0, [r0] + cmp r0, 0x3 + beq _0806F3FC + movs r5, 0 +_0806F3FC: + str r5, [sp, 0x10] + cmp r5, 0 + bne _0806F410 + add r1, sp, 0x10 + movs r0, 0x1 + b _0806F414 + .align 2, 0 +_0806F408: .4byte gUnknown_80F522C +_0806F40C: .4byte gUnknown_80F54B4 +_0806F410: + add r1, sp, 0x10 + movs r0, 0 +_0806F414: + strb r0, [r1, 0xF] + mov r3, r9 + str r3, [sp] + mov r6, r8 + str r6, [sp, 0x4] + ldr r0, [sp, 0x5C] + str r0, [sp, 0x8] + ldr r0, [sp, 0x60] + str r0, [sp, 0xC] + mov r0, r10 + adds r1, r7, 0 + add r2, sp, 0x10 + movs r3, 0 + bl sub_806D010 + ldr r0, [sp, 0x4C] + cmp r0, 0 + beq _0806F440 + add r0, sp, 0x10 + ldrb r0, [r0, 0xF] + ldr r1, [sp, 0x4C] + strb r0, [r1] +_0806F440: + add sp, 0x2C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_806F370 + + thumb_func_start sub_806F450 +sub_806F450: + push {r4-r6,lr} + adds r5, r0, 0 + ldr r4, [r1, 0x70] + adds r6, r4, 0 + ldrb r0, [r4, 0x8] + cmp r0, 0 + beq _0806F47A + adds r0, r5, 0 + bl sub_80450F8 + cmp r0, 0x1 + bne _0806F47A + ldr r0, [r5, 0x70] + ldrb r0, [r0, 0x6] + cmp r0, 0 + beq _0806F476 + movs r0, 0x2 + strb r0, [r4, 0x8] + b _0806F47A +_0806F476: + movs r0, 0x3 + strb r0, [r6, 0x8] +_0806F47A: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_806F450 + + thumb_func_start sub_806F480 +sub_806F480: + push {lr} + lsls r1, 24 + lsrs r1, 24 + ldr r2, [r0, 0x70] + adds r3, r2, 0 + ldrb r0, [r2, 0x8] + cmp r0, 0 + beq _0806F49E + cmp r1, 0 + beq _0806F49A + movs r0, 0x2 + strb r0, [r2, 0x8] + b _0806F49E +_0806F49A: + movs r0, 0x3 + strb r0, [r3, 0x8] +_0806F49E: + pop {r0} + bx r0 + thumb_func_end sub_806F480 + + thumb_func_start sub_806F4A4 +sub_806F4A4: + push {r4-r6,lr} + lsls r1, 24 + lsrs r4, r1, 24 + ldr r5, [r0, 0x70] + movs r1, 0xE + bl sub_8071858 + lsls r0, 24 + cmp r0, 0 + beq _0806F4CE + cmp r4, 0x1 + beq _0806F4C0 + cmp r4, 0x7 + bne _0806F4CE +_0806F4C0: + adds r0, r5, 0 + adds r0, 0xF5 + ldrb r0, [r0] + cmp r0, 0 + bne _0806F4CE +_0806F4CA: + movs r0, 0 + b _0806F4F6 +_0806F4CE: + movs r2, 0 + lsls r0, r4, 3 + ldr r6, _0806F4FC + adds r3, r5, 0 + adds r3, 0x5C + adds r0, r4 + lsls r1, r0, 2 +_0806F4DC: + adds r0, r3, r2 + ldrb r0, [r0] + lsls r0, 1 + adds r0, r1 + adds r0, r6 + movs r4, 0 + ldrsh r0, [r0, r4] + cmp r0, 0 + beq _0806F4CA + adds r2, 0x1 + cmp r2, 0x1 + ble _0806F4DC + movs r0, 0x1 +_0806F4F6: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0806F4FC: .4byte gUnknown_80F522C + thumb_func_end sub_806F4A4 + + thumb_func_start sub_806F500 +sub_806F500: + ldr r0, _0806F5F4 + ldr r0, [r0] + mov r12, r0 + movs r0, 0x9A + lsls r0, 1 + add r0, r12 + movs r1, 0 + strb r1, [r0] + str r1, [r0, 0x4] + strb r1, [r0, 0x8] + strb r1, [r0, 0x9] + movs r2, 0xA + strb r2, [r0, 0xA] + strb r2, [r0, 0xB] + movs r2, 0 + movs r3, 0x1 + strh r3, [r0, 0xC] + strh r3, [r0, 0xE] + strh r1, [r0, 0x10] + strh r1, [r0, 0x14] + strh r1, [r0, 0x12] + strh r1, [r0, 0x16] + strh r1, [r0, 0x18] + str r1, [r0, 0x1C] + str r1, [r0, 0x24] + str r1, [r0, 0x28] + movs r0, 0xB0 + lsls r0, 1 + add r0, r12 + strb r2, [r0] + ldr r0, _0806F5F8 + add r0, r12 + strb r2, [r0] + movs r0, 0xB1 + lsls r0, 1 + add r0, r12 + strb r2, [r0] + ldr r0, _0806F5FC + add r0, r12 + strb r2, [r0] + movs r0, 0xB2 + lsls r0, 1 + add r0, r12 + strb r2, [r0] + ldr r0, _0806F600 + add r0, r12 + strb r2, [r0] + movs r0, 0xB3 + lsls r0, 1 + add r0, r12 + strb r2, [r0] + ldr r0, _0806F604 + add r0, r12 + strb r2, [r0] + movs r0, 0xB4 + lsls r0, 1 + add r0, r12 + strb r2, [r0] + ldr r0, _0806F608 + add r0, r12 + strb r2, [r0] + movs r0, 0xB5 + lsls r0, 1 + add r0, r12 + strb r2, [r0] + movs r0, 0xB6 + lsls r0, 1 + add r0, r12 + strb r2, [r0] + ldr r0, _0806F60C + add r0, r12 + strb r2, [r0] + ldr r0, _0806F610 + add r0, r12 + strb r2, [r0] + movs r0, 0xB7 + lsls r0, 1 + add r0, r12 + strb r2, [r0] + ldr r0, _0806F614 + add r0, r12 + strb r2, [r0] + movs r0, 0xB8 + lsls r0, 1 + add r0, r12 + strb r2, [r0] + ldr r0, _0806F618 + add r0, r12 + strb r2, [r0] + movs r0, 0xB9 + lsls r0, 1 + add r0, r12 + strb r2, [r0] + ldr r0, _0806F61C + add r0, r12 + strb r2, [r0] + movs r0, 0xBA + lsls r0, 1 + add r0, r12 + strb r2, [r0] + ldr r0, _0806F620 + add r0, r12 + strb r2, [r0] + movs r0, 0xBB + lsls r0, 1 + add r0, r12 + strb r2, [r0] + ldr r0, _0806F624 + add r0, r12 + strb r2, [r0] + movs r0, 0xBC + lsls r0, 1 + add r0, r12 + strb r2, [r0] + ldr r0, _0806F628 + add r0, r12 + strb r2, [r0] + movs r0, 0xBD + lsls r0, 1 + add r0, r12 + strb r2, [r0] + bx lr + .align 2, 0 +_0806F5F4: .4byte gUnknown_203B418 +_0806F5F8: .4byte 0x00000161 +_0806F5FC: .4byte 0x00000163 +_0806F600: .4byte 0x00000165 +_0806F604: .4byte 0x00000167 +_0806F608: .4byte 0x00000169 +_0806F60C: .4byte 0x0000016b +_0806F610: .4byte 0x0000016d +_0806F614: .4byte 0x0000016f +_0806F618: .4byte 0x00000171 +_0806F61C: .4byte 0x00000173 +_0806F620: .4byte 0x00000175 +_0806F624: .4byte 0x00000177 +_0806F628: .4byte 0x00000179 + thumb_func_end sub_806F500 + + thumb_func_start sub_806F62C +sub_806F62C: + ldr r1, _0806F638 + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bx lr + .align 2, 0 +_0806F638: .4byte gUnknown_8106F7C + thumb_func_end sub_806F62C + + thumb_func_start sub_806F63C +sub_806F63C: + push {lr} + ldr r1, _0806F658 + ldr r1, [r1] + ldr r2, _0806F65C + adds r1, r2 + ldr r1, [r1, 0x10] + cmp r1, r0 + bne _0806F652 + adds r0, r1, 0 + bl sub_803F508 +_0806F652: + pop {r0} + bx r0 + .align 2, 0 +_0806F658: .4byte gUnknown_203B418 +_0806F65C: .4byte 0x000181e8 + thumb_func_end sub_806F63C + + thumb_func_start sub_806F660 +sub_806F660: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r6, r0, 0 + mov r8, r1 + ldr r0, [r6, 0x70] + mov r10, r0 + ldr r4, [r1, 0x70] + movs r1, 0x1 + negs r1, r1 + mov r9, r1 + movs r2, 0x4 + ldrsh r0, [r4, r2] + bl sub_808DACC + lsls r0, 24 + lsrs r5, r0, 24 + ldr r0, _0806F6C0 + ldr r3, [r0] + ldr r1, _0806F6C4 + adds r0, r3, r1 + ldrh r2, [r0] + subs r0, r2, 0x4 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bls _0806F702 + lsls r0, r2, 16 + asrs r1, r0, 16 + cmp r1, 0x9 + beq _0806F702 + cmp r1, 0xF + beq _0806F702 + adds r0, r2, 0 + subs r0, 0x2C + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x4 + bhi _0806F6CC + ldr r2, _0806F6C8 + adds r0, r3, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _0806F702 + b _0806F8FC + .align 2, 0 +_0806F6C0: .4byte gUnknown_203B418 +_0806F6C4: .4byte 0x00003a14 +_0806F6C8: .4byte 0x0000065c +_0806F6CC: + cmp r1, 0x31 + bne _0806F6F0 + ldr r1, _0806F6EC + adds r0, r3, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0806F6DC + b _0806F8FC +_0806F6DC: + movs r0, 0xCF + lsls r0, 1 + bl sub_8097900 + lsls r0, 24 + cmp r0, 0 + bne _0806F702 + b _0806F8FC + .align 2, 0 +_0806F6EC: .4byte 0x00000659 +_0806F6F0: + ldr r2, _0806F834 + adds r0, r3, r2 + ldrb r0, [r0] + bl sub_8090148 + lsls r0, 24 + cmp r0, 0 + bne _0806F702 + b _0806F8FC +_0806F702: + ldr r0, _0806F838 + ldr r0, [r0] + ldr r3, _0806F83C + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0 + beq _0806F712 + b _0806F8FC +_0806F712: + ldrh r1, [r4, 0x2] + adds r0, r1, 0 + subs r0, 0x90 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bls _0806F766 + lsls r0, r1, 16 + asrs r1, r0, 16 + ldr r0, _0806F840 + cmp r1, r0 + beq _0806F766 + subs r0, 0x1 + cmp r1, r0 + beq _0806F766 + adds r0, 0x2 + cmp r1, r0 + beq _0806F766 + adds r0, 0x8A + cmp r1, r0 + beq _0806F766 + adds r0, 0x1 + cmp r1, r0 + beq _0806F766 + adds r0, 0x4 + cmp r1, r0 + beq _0806F766 + subs r0, 0x1 + cmp r1, r0 + beq _0806F766 + adds r0, 0x2 + cmp r1, r0 + beq _0806F766 + subs r0, 0x9 + cmp r1, r0 + beq _0806F766 + adds r0, 0x1 + cmp r1, r0 + beq _0806F766 + adds r0, 0x1 + cmp r1, r0 + bne _0806F776 +_0806F766: + movs r1, 0x2 + ldrsh r0, [r4, r1] + bl sub_808E734 + lsls r0, 24 + cmp r0, 0 + beq _0806F776 + b _0806F8FC +_0806F776: + movs r2, 0x2 + ldrsh r0, [r4, r2] + bl sub_806F9BC + lsls r0, 24 + cmp r0, 0 + bne _0806F786 + b _0806F8FC +_0806F786: + movs r3, 0x4 + ldrsh r1, [r6, r3] + mov r2, r8 + movs r3, 0x4 + ldrsh r0, [r2, r3] + subs r1, r0 + cmp r1, 0 + bge _0806F798 + negs r1, r1 +_0806F798: + cmp r1, 0x1 + ble _0806F79E + b _0806F8FC +_0806F79E: + movs r0, 0x6 + ldrsh r1, [r6, r0] + mov r2, r8 + movs r3, 0x6 + ldrsh r0, [r2, r3] + subs r1, r0 + cmp r1, 0 + bge _0806F7B0 + negs r1, r1 +_0806F7B0: + cmp r1, 0x1 + ble _0806F7B6 + b _0806F8FC +_0806F7B6: + adds r0, r4, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x4A + bne _0806F7C2 + b _0806F8FC +_0806F7C2: + adds r0, r4, 0 + adds r0, 0xA4 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0806F7CE + b _0806F8FC +_0806F7CE: + mov r0, r8 + adds r1, r6, 0 + bl sub_8045990 + lsls r0, 24 + cmp r0, 0 + bne _0806F7DE + b _0806F8FC +_0806F7DE: + bl sub_806F910 + movs r0, 0xFA + lsls r0, 2 + bl sub_8084100 + adds r7, r0, 0 + movs r1, 0x2 + ldrsh r0, [r4, r1] + bl sub_808DCC0 + lsls r0, 16 + asrs r4, r0, 16 + ldr r0, _0806F844 + cmp r4, r0 + bne _0806F800 + b _0806F8FC +_0806F800: + adds r0, r6, 0 + movs r1, 0x2E + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _0806F816 + ldr r0, _0806F848 + movs r2, 0 + ldrsh r0, [r0, r2] + adds r4, r0 +_0806F816: + ldr r0, _0806F84C + mov r3, r10 + ldrb r1, [r3, 0x9] + lsls r1, 1 + adds r1, r0 + movs r2, 0 + ldrsh r0, [r1, r2] + adds r4, r0 + cmp r7, r4 + bge _0806F8FC + movs r4, 0 + movs r0, 0x6 + subs r3, r0, r5 + ldr r7, _0806F850 + b _0806F856 + .align 2, 0 +_0806F834: .4byte 0x00000644 +_0806F838: .4byte gUnknown_203B418 +_0806F83C: .4byte 0x0000065d +_0806F840: .4byte 0x0000010d +_0806F844: .4byte 0xfffffc19 +_0806F848: .4byte gUnknown_80F5008 +_0806F84C: .4byte gUnknown_80F5700 +_0806F850: .4byte gUnknown_202EE70 +_0806F854: + adds r4, 0x1 +_0806F856: + cmp r4, r3 + bgt _0806F878 + movs r2, 0 + cmp r2, r5 + bge _0806F872 + adds r1, r4, r7 + b _0806F86C +_0806F864: + adds r1, 0x1 + adds r2, 0x1 + cmp r2, r5 + bge _0806F872 +_0806F86C: + ldrb r0, [r1] + cmp r0, 0 + beq _0806F864 +_0806F872: + cmp r2, r5 + bne _0806F854 + mov r9, r4 +_0806F878: + movs r0, 0x1 + negs r0, r0 + cmp r9, r0 + beq _0806F8F4 + movs r4, 0 + ldr r3, _0806F8BC + ldr r0, [r3] + ldr r2, _0806F8C0 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0806F8B4 + adds r7, r3, 0 + adds r5, r2, 0 + movs r2, 0 + movs r3, 0x1 +_0806F89C: + adds r2, 0x64 + adds r4, 0x1 + cmp r4, 0x3 + bgt _0806F8B4 + ldr r0, [r7] + adds r0, r2, r0 + adds r0, r5 + ldrb r1, [r0] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _0806F89C +_0806F8B4: + cmp r4, 0x4 + beq _0806F8F4 + movs r4, 0 + b _0806F8C6 + .align 2, 0 +_0806F8BC: .4byte gUnknown_203B45C +_0806F8C0: .4byte 0x00008df8 +_0806F8C4: + adds r4, 0x1 +_0806F8C6: + cmp r4, 0x3 + bgt _0806F8E2 + ldr r0, _0806F8EC + ldr r0, [r0] + lsls r1, r4, 2 + ldr r3, _0806F8F0 + adds r0, r3 + adds r0, r1 + ldr r0, [r0] + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _0806F8C4 +_0806F8E2: + cmp r4, 0x4 + beq _0806F8F4 + movs r0, 0x1 + b _0806F8FE + .align 2, 0 +_0806F8EC: .4byte gUnknown_203B418 +_0806F8F0: .4byte 0x0001357c +_0806F8F4: + adds r0, r6, 0 + mov r1, r8 + bl nullsub_96 +_0806F8FC: + movs r0, 0 +_0806F8FE: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_806F660 + + thumb_func_start nullsub_96 +nullsub_96: + bx lr + thumb_func_end nullsub_96 + + thumb_func_start sub_806F910 +sub_806F910: + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r5, 0 + movs r6, 0 + movs r7, 0x40 +_0806F91C: + ldr r0, _0806F9AC + ldr r0, [r0] + lsls r1, r6, 2 + ldr r2, _0806F9B0 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + adds r1, r6, 0x1 + mov r8, r1 + cmp r0, 0 + beq _0806F98A + ldr r0, [r4, 0x70] + movs r2, 0x4 + ldrsh r0, [r0, r2] + bl sub_808DACC + lsls r0, 24 + lsrs r1, r0, 24 + adds r0, r4, 0 + adds r0, 0x68 + strh r7, [r0] + ldr r0, [r4, 0x70] + ldr r2, _0806F9B4 + adds r0, r2 + strb r6, [r0] + ldr r0, [r4, 0x70] + adds r2, 0x1 + adds r0, r2 + strb r1, [r0] + cmp r1, 0 + beq _0806F978 + ldr r3, _0806F9B8 + movs r2, 0x1 +_0806F966: + cmp r5, 0x5 + bgt _0806F972 + adds r0, r5, r3 + strb r2, [r0] + adds r7, 0x10 + adds r5, 0x1 +_0806F972: + subs r1, 0x1 + cmp r1, 0 + bne _0806F966 +_0806F978: + adds r0, r4, 0 + bl sub_806CEBC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_806CCB4 +_0806F98A: + mov r6, r8 + cmp r6, 0x3 + ble _0806F91C + cmp r5, 0x5 + bgt _0806F9A2 + ldr r2, _0806F9B8 + movs r1, 0 +_0806F998: + adds r0, r5, r2 + strb r1, [r0] + adds r5, 0x1 + cmp r5, 0x5 + ble _0806F998 +_0806F9A2: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0806F9AC: .4byte gUnknown_203B418 +_0806F9B0: .4byte 0x0001357c +_0806F9B4: .4byte 0x00000167 +_0806F9B8: .4byte gUnknown_202EE70 + thumb_func_end sub_806F910 + + thumb_func_start sub_806F9BC +sub_806F9BC: + push {r4,r5,lr} + sub sp, 0xC + lsls r0, 16 + asrs r4, r0, 16 + ldr r5, _0806FA40 + ldr r0, [r5] + movs r1, 0xCB + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0806FA3C + adds r0, r4, 0 + bl sub_808529C + lsls r0, 24 + cmp r0, 0 + beq _0806FA3C + cmp r4, 0x97 + bne _0806F9F2 + ldr r0, [r5] + movs r1, 0xCF + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0806FA3C +_0806F9F2: + movs r0, 0xCC + lsls r0, 1 + cmp r4, r0 + beq _0806FA3C + ldr r0, _0806FA44 + cmp r4, r0 + beq _0806FA3C + ldr r0, _0806FA48 + cmp r4, r0 + beq _0806FA3C + movs r0, 0xD1 + lsls r0, 1 + cmp r4, r0 + beq _0806FA3C + ldr r0, _0806FA4C + cmp r4, r0 + beq _0806FA3C + adds r0, r4, 0 + bl sub_808DBF4 + lsls r0, 24 + cmp r0, 0 + bne _0806FA50 + adds r0, r4, 0 + bl sub_808DBA8 + lsls r0, 24 + lsrs r0, 24 + mov r1, sp + movs r2, 0 + movs r3, 0 + bl sub_8092638 + mov r0, sp + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _0806FA50 +_0806FA3C: + movs r0, 0 + b _0806FA52 + .align 2, 0 +_0806FA40: .4byte gUnknown_203B418 +_0806FA44: .4byte 0x00000199 +_0806FA48: .4byte 0x000001a1 +_0806FA4C: .4byte 0x000001a3 +_0806FA50: + movs r0, 0x1 +_0806FA52: + add sp, 0xC + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_806F9BC + + thumb_func_start sub_806FA5C +sub_806FA5C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + mov r8, r0 + adds r5, r1, 0 + adds r6, r2, 0 + adds r0, r5, 0x4 + mov r1, r8 + adds r1, 0x4 + bl sub_80983D8 + adds r4, r0, 0 + movs r0, 0 + mov r10, r0 + movs r1, 0 + ldrsh r0, [r6, r1] + bl sub_808DBA8 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + adds r0, r5, 0 + adds r0, 0x22 + mov r2, r10 + strb r2, [r0] + mov r0, r8 + adds r1, r5, 0 + bl sub_807A0CC + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_806CE68 + ldr r0, _0806FAD4 + movs r3, 0 + ldrsh r1, [r6, r3] + bl sub_808D908 + ldr r0, _0806FAD8 + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_8052B8C + cmp r0, 0 + bne _0806FAE4 + movs r4, 0 + ldrsh r1, [r6, r4] + ldr r0, _0806FADC + cmp r1, r0 + beq _0806FB28 + ldr r0, _0806FAE0 + ldr r1, [r0] + mov r0, r8 + bl sub_80522A8 + b _0806FB28 + .align 2, 0 +_0806FAD4: .4byte gUnknown_202DF98 +_0806FAD8: .4byte gUnknown_80F9FE8 +_0806FADC: .4byte 0x0000019d +_0806FAE0: .4byte gUnknown_80FA004 +_0806FAE4: + movs r7, 0 + ldr r3, _0806FB2C + ldr r0, [r3] + ldr r2, _0806FB30 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0806FB1A + mov r12, r3 + adds r4, r2, 0 + movs r2, 0 + movs r3, 0x1 +_0806FB00: + adds r2, 0x64 + adds r7, 0x1 + cmp r7, 0x3 + bgt _0806FB1A + mov r1, r12 + ldr r0, [r1] + adds r0, r2, r0 + adds r0, r4 + ldrb r1, [r0] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _0806FB00 +_0806FB1A: + cmp r7, 0x4 + bne _0806FB38 + ldr r0, _0806FB34 + ldr r1, [r0] + mov r0, r8 + bl sub_80522A8 +_0806FB28: + movs r0, 0 + b _0806FCF0 + .align 2, 0 +_0806FB2C: .4byte gUnknown_203B45C +_0806FB30: .4byte 0x00008df8 +_0806FB34: .4byte gUnknown_80FA030 +_0806FB38: + mov r0, r9 + bl sub_8092600 + lsls r0, 24 + cmp r0, 0 + bne _0806FB4E + mov r0, r9 + bl sub_80925EC + movs r2, 0x1 + mov r10, r2 +_0806FB4E: + movs r1, 0xFA + lsls r1, 1 + adds r0, r5, 0 + mov r2, r8 + bl sub_8068FE0 + ldr r1, _0806FC40 + movs r0, 0x64 + muls r0, r7 + ldr r3, _0806FC44 + adds r0, r3 + ldr r1, [r1] + adds r5, r1, r0 + movs r4, 0 + movs r0, 0x3 + strh r0, [r5] + strb r4, [r5, 0x2] + ldrh r0, [r6, 0xE] + strb r0, [r5, 0x3] + movs r0, 0x1 + strh r0, [r5, 0x8] + adds r0, r5, 0 + adds r0, 0x4C + movs r1, 0 + bl sub_808EC94 + ldr r0, [r6, 0x44] + str r0, [r5, 0x54] + adds r0, r5, 0 + adds r0, 0x50 + strb r4, [r0] + ldr r0, _0806FC48 + strh r0, [r5, 0xA] + strh r7, [r5, 0xC] + ldrh r0, [r6] + strh r0, [r5, 0xE] + ldr r0, _0806FC4C + ldr r0, [r0] + ldr r4, _0806FC50 + adds r0, r4 + ldr r0, [r0] + str r0, [r5, 0x4] + ldrh r0, [r6, 0x8] + strh r0, [r5, 0x10] + ldrh r0, [r6, 0x8] + strh r0, [r5, 0x12] + ldr r0, [r6, 0x14] + str r0, [r5, 0x44] + ldr r0, [r6, 0x18] + str r0, [r5, 0x48] + movs r2, 0 + adds r7, r6, 0 + adds r7, 0x20 + adds r4, r6, 0 + adds r4, 0xA + adds r3, r6, 0 + adds r3, 0xC + adds r1, r5, 0 + adds r1, 0x14 +_0806FBC4: + adds r0, r4, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r3, r2 + ldrb r0, [r0] + strb r0, [r1, 0x2] + adds r1, 0x1 + adds r2, 0x1 + cmp r2, 0x1 + ble _0806FBC4 + ldr r0, [r6, 0x10] + str r0, [r5, 0x18] + adds r1, r5, 0 + adds r1, 0x1C + adds r0, r7, 0 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r0, [r6, 0x1C] + str r0, [r5, 0x40] + adds r4, r5, 0 + adds r4, 0x58 + movs r1, 0 + ldrsh r0, [r6, r1] + bl sub_808D994 + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0xA + bl sub_8092310 + bl sub_8097848 + movs r2, 0 + ldrsh r0, [r6, r2] + movs r3, 0x4 + ldrsh r1, [r6, r3] + movs r3, 0x6 + ldrsh r2, [r6, r3] + add r3, sp, 0xC + str r3, [sp] + movs r3, 0 + str r3, [sp, 0x4] + movs r3, 0x1 + str r3, [sp, 0x8] + adds r3, r5, 0 + bl sub_806B8CC + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0 + bne _0806FC58 + ldr r0, _0806FC54 + ldr r1, [r0] + mov r0, r8 + bl sub_80522A8 + strh r7, [r5] + b _0806FCEE + .align 2, 0 +_0806FC40: .4byte gUnknown_203B45C +_0806FC44: .4byte 0x00008df8 +_0806FC48: .4byte 0x0000ffff +_0806FC4C: .4byte gUnknown_203B418 +_0806FC50: .4byte 0x00000644 +_0806FC54: .4byte gUnknown_80FA058 +_0806FC58: + bl sub_8083D88 + movs r0, 0xA0 + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0806FC78 + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_8052B8C + cmp r0, 0x1 + bne _0806FC94 + b _0806FC88 + .align 2, 0 +_0806FC78: .4byte gUnknown_80FA090 +_0806FC7C: + ldr r0, _0806FD00 + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 +_0806FC88: + adds r0, r4, 0 + bl sub_805FBE8 + lsls r0, 24 + cmp r0, 0 + beq _0806FC7C +_0806FC94: + ldr r4, _0806FD04 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0 + bl sub_808D9DC + ldr r0, _0806FD08 + ldr r1, [r0] + mov r0, r8 + bl sub_80522A8 + mov r0, r10 + cmp r0, 0 + beq _0806FCD8 + bl sub_8085480 + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _0806FD0C + mov r1, r9 + bl sub_8092558 + movs r0, 0xCE + bl sub_8011988 + ldr r0, _0806FD10 + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 +_0806FCD8: + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0x97 + bne _0806FCEE + ldr r2, _0806FD14 + ldr r1, [r2] + movs r0, 0x1 + strb r0, [r1, 0x4] + ldr r1, [r2] + movs r0, 0x3 + strb r0, [r1, 0x11] +_0806FCEE: + movs r0, 0x1 +_0806FCF0: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0806FD00: .4byte gUnknown_80FA0C8 +_0806FD04: .4byte gUnknown_202DF98 +_0806FD08: .4byte gUnknown_80FA0F0 +_0806FD0C: .4byte gUnknown_202E628 +_0806FD10: .4byte gUnknown_80FA120 +_0806FD14: .4byte gUnknown_203B418 + thumb_func_end sub_806FA5C + + thumb_func_start sub_806FD18 +sub_806FD18: + push {r4-r7,lr} + ldr r4, [r0, 0x70] + movs r6, 0x1 + negs r6, r6 + movs r1, 0x4 + ldrsh r0, [r4, r1] + bl sub_808DACC + lsls r0, 24 + lsrs r5, r0, 24 + movs r2, 0x2 + ldrsh r0, [r4, r2] + bl sub_806F9BC + lsls r0, 24 + cmp r0, 0 + beq _0806FDEC + bl sub_806F910 + movs r4, 0 + movs r0, 0x6 + subs r3, r0, r5 + ldr r7, _0806FD48 + b _0806FD4E + .align 2, 0 +_0806FD48: .4byte gUnknown_202EE70 +_0806FD4C: + adds r4, 0x1 +_0806FD4E: + cmp r4, r3 + bgt _0806FD70 + movs r2, 0 + cmp r2, r5 + bge _0806FD6A + adds r1, r4, r7 + b _0806FD64 +_0806FD5C: + adds r1, 0x1 + adds r2, 0x1 + cmp r2, r5 + bge _0806FD6A +_0806FD64: + ldrb r0, [r1] + cmp r0, 0 + beq _0806FD5C +_0806FD6A: + cmp r2, r5 + bne _0806FD4C + adds r6, r4, 0 +_0806FD70: + movs r0, 0x1 + negs r0, r0 + cmp r6, r0 + beq _0806FDEC + movs r4, 0 + ldr r3, _0806FDB4 + ldr r0, [r3] + ldr r2, _0806FDB8 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0806FDAC + adds r6, r3, 0 + adds r5, r2, 0 + movs r2, 0 + movs r3, 0x1 +_0806FD94: + adds r2, 0x64 + adds r4, 0x1 + cmp r4, 0x3 + bgt _0806FDAC + ldr r0, [r6] + adds r0, r2, r0 + adds r0, r5 + ldrb r1, [r0] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _0806FD94 +_0806FDAC: + cmp r4, 0x4 + beq _0806FDEC + movs r4, 0 + b _0806FDBE + .align 2, 0 +_0806FDB4: .4byte gUnknown_203B45C +_0806FDB8: .4byte 0x00008df8 +_0806FDBC: + adds r4, 0x1 +_0806FDBE: + cmp r4, 0x3 + bgt _0806FDDA + ldr r0, _0806FDE4 + ldr r0, [r0] + lsls r1, r4, 2 + ldr r2, _0806FDE8 + adds r0, r2 + adds r0, r1 + ldr r0, [r0] + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _0806FDBC +_0806FDDA: + cmp r4, 0x4 + beq _0806FDEC + movs r0, 0x1 + b _0806FDEE + .align 2, 0 +_0806FDE4: .4byte gUnknown_203B418 +_0806FDE8: .4byte 0x0001357c +_0806FDEC: + movs r0, 0 +_0806FDEE: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_806FD18 + + thumb_func_start sub_806FDF4 +sub_806FDF4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x60 + str r0, [sp, 0x58] + mov r10, r1 + str r2, [sp, 0x5C] + movs r0, 0 + mov r9, r0 + str r0, [r2] + add r0, sp, 0xC + bl sub_8069D4C + movs r6, 0 + ldr r3, _0806FE50 + ldr r0, [r3] + ldr r2, _0806FE54 + adds r0, r2 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0806FE46 + adds r5, r3, 0 + adds r4, r2, 0 + movs r2, 0 + movs r3, 0x1 +_0806FE2E: + adds r2, 0x64 + adds r6, 0x1 + cmp r6, 0x3 + bgt _0806FE46 + ldr r0, [r5] + adds r0, r2, r0 + adds r0, r4 + ldrb r1, [r0] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _0806FE2E +_0806FE46: + cmp r6, 0x4 + bne _0806FE58 + movs r0, 0 + b _0806FFF8 + .align 2, 0 +_0806FE50: .4byte gUnknown_203B45C +_0806FE54: .4byte 0x00008df8 +_0806FE58: + add r0, sp, 0xC + movs r1, 0 + ldrsh r0, [r0, r1] + bl sub_808DBA8 + lsls r0, 24 + lsrs r7, r0, 24 + ldr r1, _0806FF74 + movs r0, 0x64 + muls r0, r6 + ldr r2, _0806FF78 + adds r0, r2 + ldr r1, [r1] + adds r5, r1, r0 + movs r4, 0 + movs r0, 0x3 + strh r0, [r5] + strb r4, [r5, 0x2] + add r0, sp, 0xC + ldrh r0, [r0, 0xE] + strb r0, [r5, 0x3] + movs r0, 0x1 + strh r0, [r5, 0x8] + adds r0, r5, 0 + adds r0, 0x4C + movs r1, 0 + bl sub_808EC94 + ldr r0, [sp, 0x50] + str r0, [r5, 0x54] + adds r0, r5, 0 + adds r0, 0x50 + strb r4, [r0] + ldr r0, _0806FF7C + strh r0, [r5, 0xA] + strh r6, [r5, 0xC] + add r0, sp, 0xC + ldrh r0, [r0] + strh r0, [r5, 0xE] + ldr r0, _0806FF80 + ldr r0, [r0] + ldr r3, _0806FF84 + adds r0, r3 + ldr r0, [r0] + str r0, [r5, 0x4] + add r0, sp, 0xC + ldrh r0, [r0, 0x8] + strh r0, [r5, 0x10] + add r0, sp, 0xC + ldrh r0, [r0, 0x8] + strh r0, [r5, 0x12] + ldr r0, [sp, 0x20] + str r0, [r5, 0x44] + ldr r0, [sp, 0x24] + str r0, [r5, 0x48] + movs r2, 0 + add r6, sp, 0x2C + add r4, sp, 0x54 + mov r8, r4 + mov r4, sp + adds r4, 0x16 + add r3, sp, 0x18 + adds r1, r5, 0 + adds r1, 0x14 +_0806FED8: + adds r0, r4, r2 + ldrb r0, [r0] + strb r0, [r1] + adds r0, r3, r2 + ldrb r0, [r0] + strb r0, [r1, 0x2] + adds r1, 0x1 + adds r2, 0x1 + cmp r2, 0x1 + ble _0806FED8 + ldr r0, [sp, 0x1C] + str r0, [r5, 0x18] + adds r1, r5, 0 + adds r1, 0x1C + adds r0, r6, 0 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r0, [sp, 0x28] + str r0, [r5, 0x40] + adds r4, r5, 0 + adds r4, 0x58 + add r0, sp, 0xC + movs r1, 0 + ldrsh r0, [r0, r1] + bl sub_808D994 + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0xA + bl sub_8092310 + adds r0, r7, 0 + bl sub_8092600 + lsls r0, 24 + cmp r0, 0 + bne _0806FF34 + adds r0, r7, 0 + bl sub_80925EC + movs r2, 0x1 + mov r9, r2 +_0806FF34: + bl sub_8097848 + movs r1, 0xFA + lsls r1, 1 + mov r0, r10 + ldr r2, [sp, 0x58] + bl sub_8068FE0 + add r0, sp, 0xC + movs r3, 0 + ldrsh r0, [r0, r3] + add r1, sp, 0xC + movs r2, 0x4 + ldrsh r1, [r1, r2] + add r2, sp, 0xC + movs r3, 0x6 + ldrsh r2, [r2, r3] + mov r3, r8 + str r3, [sp] + movs r3, 0 + str r3, [sp, 0x4] + str r3, [sp, 0x8] + adds r3, r5, 0 + bl sub_806B8CC + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0806FF88 + strh r0, [r5] + b _0806FFF6 + .align 2, 0 +_0806FF74: .4byte gUnknown_203B45C +_0806FF78: .4byte 0x00008df8 +_0806FF7C: .4byte 0x0000ffff +_0806FF80: .4byte gUnknown_203B418 +_0806FF84: .4byte 0x00000644 +_0806FF88: + ldr r0, _0806FF9C + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_8052B8C + cmp r0, 0x1 + bne _0806FFB8 + b _0806FFAC + .align 2, 0 +_0806FF9C: .4byte gUnknown_80FA090 +_0806FFA0: + ldr r0, _08070008 + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 +_0806FFAC: + adds r0, r4, 0 + bl sub_805FBE8 + lsls r0, 24 + cmp r0, 0 + beq _0806FFA0 +_0806FFB8: + mov r4, r9 + cmp r4, 0 + beq _0806FFE6 + bl sub_8085480 + adds r1, r0, 0 + ldr r0, _0807000C + movs r2, 0 + bl sub_8045B94 + ldr r0, _08070010 + adds r1, r7, 0 + bl sub_8092558 + movs r0, 0xCE + bl sub_8011988 + ldr r0, _08070014 + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 +_0806FFE6: + ldr r0, _08070018 + adds r1, r5, 0 + movs r2, 0 + bl sub_808D9DC + ldr r0, [sp, 0x54] + ldr r1, [sp, 0x5C] + str r0, [r1] +_0806FFF6: + movs r0, 0x1 +_0806FFF8: + add sp, 0x60 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08070008: .4byte gUnknown_80FA0C8 +_0807000C: .4byte gUnknown_202DF98 +_08070010: .4byte gUnknown_202E628 +_08070014: .4byte gUnknown_80FA120 +_08070018: .4byte gUnknown_202E088 + thumb_func_end sub_806FDF4 + + thumb_func_start sub_807001C +sub_807001C: + push {r4-r6,lr} + adds r5, r0, 0 + ldr r4, [r5, 0x70] + ldr r0, _08070050 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r4, 0 + adds r0, 0x44 + movs r1, 0x1 + bl sub_8044C94 + adds r0, r4, 0 + adds r0, 0xA8 + ldrb r0, [r0] + cmp r0, 0x3 + bne _08070042 + b _0807019C +_08070042: + cmp r0, 0x3 + bgt _08070054 + cmp r0, 0x1 + bne _0807004C + b _0807019C +_0807004C: + b _0807005A + .align 2, 0 +_08070050: .4byte gUnknown_202DF98 +_08070054: + cmp r0, 0x5 + bne _0807005A + b _0807019C +_0807005A: + adds r0, r4, 0 + adds r0, 0xB0 + ldrb r0, [r0] + cmp r0, 0x3 + beq _0807008C + cmp r0, 0x3 + bgt _0807006E + cmp r0, 0x1 + beq _0807007A + b _080700AC +_0807006E: + cmp r0, 0x4 + beq _0807009C + cmp r0, 0x6 + bne _08070078 + b _0807019C +_08070078: + b _080700AC +_0807007A: + ldr r0, _08070088 + ldr r1, [r0] + adds r0, r5, 0 + bl sub_80522A8 + b _0807019C + .align 2, 0 +_08070088: .4byte gUnknown_80F954C +_0807008C: + ldr r0, _08070098 + ldr r1, [r0] + adds r0, r5, 0 + bl sub_80522A8 + b _0807019C + .align 2, 0 +_08070098: .4byte gUnknown_80F956C +_0807009C: + ldr r0, _080700A8 + ldr r1, [r0] + adds r0, r5, 0 + bl sub_80522A8 + b _0807019C + .align 2, 0 +_080700A8: .4byte gUnknown_80F958C +_080700AC: + adds r0, r4, 0 + adds r0, 0xBC + ldrb r0, [r0] + cmp r0, 0x3 + beq _080700D4 + cmp r0, 0x7 + beq _080700E4 + adds r0, r4, 0 + adds r0, 0xC0 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080700F4 + ldr r0, _080700D0 + ldr r1, [r0] + adds r0, r5, 0 + bl sub_80522A8 + b _0807019C + .align 2, 0 +_080700D0: .4byte gUnknown_80F95D8 +_080700D4: + ldr r0, _080700E0 + ldr r1, [r0] + adds r0, r5, 0 + bl sub_80522A8 + b _0807019C + .align 2, 0 +_080700E0: .4byte gUnknown_80F95A4 +_080700E4: + ldr r0, _080700F0 + ldr r1, [r0] + adds r0, r5, 0 + bl sub_80522A8 + b _0807019C + .align 2, 0 +_080700F0: .4byte gUnknown_80F95BC +_080700F4: + adds r0, r4, 0 + adds r0, 0xC8 + ldrb r0, [r0] + cmp r0, 0x2 + bne _0807012E + adds r0, r4, 0 + adds r0, 0x44 + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl sub_8044CA0 + movs r0, 0x8 + bl sub_8084100 + adds r1, r4, 0 + adds r1, 0x46 + strb r0, [r1] + ldrh r1, [r5, 0x4] + movs r2, 0xB6 + lsls r2, 1 + adds r0, r4, r2 + strh r1, [r0] + ldrh r0, [r5, 0x6] + subs r0, 0x1 + movs r1, 0xB7 + lsls r1, 1 + adds r2, r4, r1 + strh r0, [r2] + b _0807019C +_0807012E: + ldrb r0, [r4, 0x8] + cmp r0, 0x1 + beq _0807019C + adds r0, r4, 0 + adds r0, 0xE8 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0807017C + adds r6, r4, 0 + adds r6, 0x46 + ldrb r1, [r6] + adds r0, r5, 0 + bl sub_8070D6C + lsls r0, 24 + cmp r0, 0 + bne _08070166 + movs r0, 0x2 + bl sub_8084100 + cmp r0, 0 + beq _08070174 + movs r0, 0x8 + bl sub_8084100 + movs r1, 0x7 + ands r1, r0 + strb r1, [r6] +_08070166: + adds r0, r4, 0 + adds r0, 0x44 + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl sub_8044CA0 + b _0807019C +_08070174: + adds r0, r5, 0 + bl sub_807BB94 + b _0807019C +_0807017C: + cmp r0, 0x2 + beq _08070184 + movs r0, 0 + b _0807019E +_08070184: + adds r0, r4, 0 + adds r0, 0x44 + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl sub_8044CA0 + movs r0, 0x8 + bl sub_8084100 + adds r1, r4, 0 + adds r1, 0x46 + strb r0, [r1] +_0807019C: + movs r0, 0x1 +_0807019E: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_807001C + + thumb_func_start sub_80701A4 +sub_80701A4: + push {r4-r7,lr} + adds r7, r0, 0 + ldr r6, [r7, 0x70] + movs r4, 0 + ldr r0, _080701D4 + adds r1, r7, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r6, 0 + adds r0, 0x44 + movs r1, 0x1 + bl sub_8044C94 + adds r0, r6, 0 + adds r0, 0xA8 + ldrb r0, [r0] + cmp r0, 0x3 + beq _080701DC + cmp r0, 0x3 + bgt _080701D8 + cmp r0, 0x1 + beq _080701DC + b _080701E4 + .align 2, 0 +_080701D4: .4byte gUnknown_202DF98 +_080701D8: + cmp r0, 0x5 + bne _080701E4 +_080701DC: + ldr r0, _080701E0 + b _08070278 + .align 2, 0 +_080701E0: .4byte gUnknown_80F95EC +_080701E4: + adds r0, r6, 0 + adds r0, 0xB0 + ldrb r0, [r0] + cmp r0, 0x3 + beq _0807020C + cmp r0, 0x3 + bgt _080701F8 + cmp r0, 0x1 + beq _08070202 + b _0807021C +_080701F8: + cmp r0, 0x4 + beq _08070214 + cmp r0, 0x6 + beq _08070280 + b _0807021C +_08070202: + ldr r0, _08070208 + b _08070278 + .align 2, 0 +_08070208: .4byte gUnknown_80F954C +_0807020C: + ldr r0, _08070210 + b _08070278 + .align 2, 0 +_08070210: .4byte gUnknown_80F956C +_08070214: + ldr r0, _08070218 + b _08070278 + .align 2, 0 +_08070218: .4byte gUnknown_80F958C +_0807021C: + adds r0, r6, 0 + adds r0, 0xBC + ldrb r0, [r0] + cmp r0, 0x8 + bhi _0807026C + lsls r0, 2 + ldr r1, _08070230 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08070230: .4byte _08070234 + .align 2, 0 +_08070234: + .4byte _0807026C + .4byte _0807026C + .4byte _08070258 + .4byte _0807025C + .4byte _0807026C + .4byte _0807026C + .4byte _0807026C + .4byte _08070264 + .4byte _0807026C +_08070258: + movs r4, 0x1 + b _0807026C +_0807025C: + ldr r0, _08070260 + b _08070278 + .align 2, 0 +_08070260: .4byte gUnknown_80F95A4 +_08070264: + ldr r0, _08070268 + b _08070278 + .align 2, 0 +_08070268: .4byte gUnknown_80F95BC +_0807026C: + adds r0, r6, 0 + adds r0, 0xC0 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08070288 + ldr r0, _08070284 +_08070278: + ldr r1, [r0] + adds r0, r7, 0 + bl sub_80522A8 +_08070280: + movs r0, 0x1 + b _08070322 + .align 2, 0 +_08070284: .4byte gUnknown_80F95D8 +_08070288: + cmp r0, 0 + beq _08070320 + cmp r0, 0xB + beq _08070320 + cmp r0, 0xC + beq _08070320 + cmp r4, 0 + beq _080702A8 + ldr r0, _080702A4 + ldr r1, [r0] + adds r0, r7, 0 + bl sub_80522A8 + b _0807031A + .align 2, 0 +_080702A4: .4byte gUnknown_8100660 +_080702A8: + movs r5, 0 + movs r0, 0x8C + lsls r0, 1 + adds r4, r6, r0 +_080702B0: + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08070312 + adds r0, r7, 0 + adds r1, r4, 0 + bl sub_80570AC + lsls r0, 24 + cmp r0, 0 + beq _08070312 + adds r0, r6, 0 + adds r0, 0xC2 + ldrb r0, [r0] + cmp r0, r5 + bne _08070312 + adds r0, r6, 0 + adds r0, 0x44 + movs r1, 0x14 + bl sub_8044C94 + adds r3, r5, 0 + adds r7, r6, 0 + adds r7, 0x50 + cmp r5, 0 + ble _0807030E + ldrb r1, [r4] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0807030E + movs r4, 0x2 + lsls r0, r5, 3 + movs r1, 0x8C + lsls r1, 1 + adds r0, r1 + adds r2, r0, r6 +_080702FC: + subs r2, 0x8 + subs r3, 0x1 + cmp r3, 0 + ble _0807030E + ldrb r1, [r2] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + bne _080702FC +_0807030E: + strb r3, [r7] + b _08070280 +_08070312: + adds r4, 0x8 + adds r5, 0x1 + cmp r5, 0x3 + ble _080702B0 +_0807031A: + adds r0, r7, 0 + bl sub_8079764 +_08070320: + movs r0, 0 +_08070322: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80701A4 + + thumb_func_start sub_8070328 +sub_8070328: + push {lr} + lsls r0, 16 + asrs r0, 16 + bl sub_808DB14 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0x3 + bhi _0807033E + adds r0, r1, 0 + b _08070344 +_0807033E: + ldr r0, _08070348 + adds r0, r1, r0 + ldrb r0, [r0] +_08070344: + pop {r1} + bx r1 + .align 2, 0 +_08070348: .4byte gUnknown_202F314 + thumb_func_end sub_8070328 + + thumb_func_start sub_807034C +sub_807034C: + push {r4,lr} + adds r4, r1, 0 + lsls r0, 16 + asrs r2, r0, 16 + ldr r0, [r4, 0x10] + cmp r0, 0 + bne _08070398 + ldrh r1, [r4] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _08070398 + adds r0, r2, 0 + bl sub_8070328 + lsls r0, 24 + lsrs r2, r0, 24 + ldrh r0, [r4] + movs r1, 0x3 + ands r1, r0 + cmp r2, 0x1 + beq _08070388 + cmp r2, 0x1 + bgt _08070382 + cmp r2, 0 + beq _0807038C + b _08070390 +_08070382: + cmp r2, 0x2 + beq _08070394 + b _08070390 +_08070388: + cmp r1, 0x2 + beq _08070390 +_0807038C: + cmp r1, 0x1 + bne _08070398 +_08070390: + movs r0, 0 + b _0807039A +_08070394: + cmp r1, 0 + bne _08070390 +_08070398: + movs r0, 0x1 +_0807039A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_807034C + + thumb_func_start sub_80703A0 +sub_80703A0: + push {r4-r7,lr} + adds r6, r0, 0 + adds r4, r1, 0 + ldr r7, [r6, 0x70] + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl sub_804954C + adds r5, r0, 0 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + blt _08070456 + movs r2, 0x2 + ldrsh r1, [r4, r2] + cmp r1, 0 + blt _08070456 + cmp r0, 0x37 + bgt _08070456 + cmp r1, 0x1F + bgt _08070456 + ldr r0, [r5, 0x10] + cmp r0, 0 + bne _08070456 + ldrh r1, [r5] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _08070456 + bl sub_80441E8 + lsls r0, 24 + cmp r0, 0 + bne _08070400 + adds r0, r7, 0 + adds r0, 0xE4 + ldrb r0, [r0] + cmp r0, 0x3 + beq _0807044E + adds r0, r6, 0 + movs r1, 0x9 + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + bne _0807044E +_08070400: + movs r1, 0x2 + ldrsh r0, [r7, r1] + bl sub_8070328 + lsls r0, 24 + lsrs r4, r0, 24 + ldrh r0, [r5] + movs r5, 0x3 + ands r5, r0 + adds r0, r6, 0 + movs r1, 0xC + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _08070422 + movs r4, 0x2 +_08070422: + adds r0, r6, 0 + movs r1, 0xD + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _08070432 + movs r4, 0x3 +_08070432: + cmp r4, 0x1 + beq _08070446 + cmp r4, 0x1 + bgt _08070440 + cmp r4, 0 + beq _0807044A + b _0807044E +_08070440: + cmp r4, 0x2 + beq _08070452 + b _0807044E +_08070446: + cmp r5, 0x2 + beq _0807044E +_0807044A: + cmp r5, 0x1 + bne _08070456 +_0807044E: + movs r0, 0 + b _08070458 +_08070452: + cmp r5, 0 + bne _0807044E +_08070456: + movs r0, 0x1 +_08070458: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80703A0 + + thumb_func_start sub_8070460 +sub_8070460: + push {r4,lr} + adds r1, r0, 0 + ldr r0, [r1, 0x70] + adds r4, r0, 0 + adds r0, 0xE4 + ldrb r0, [r0] + cmp r0, 0x3 + beq _08070492 + adds r0, r1, 0 + movs r1, 0x9 + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + bne _08070492 + movs r1, 0x2 + ldrsh r0, [r4, r1] + bl sub_8070328 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + beq _08070492 + movs r0, 0 + b _08070494 +_08070492: + movs r0, 0x1 +_08070494: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8070460 + + thumb_func_start sub_807049C +sub_807049C: + push {r4-r7,lr} + adds r6, r0, 0 + adds r4, r1, 0 + ldr r7, [r6, 0x70] + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl sub_804954C + adds r5, r0, 0 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + blt _0807055A + movs r2, 0x2 + ldrsh r1, [r4, r2] + cmp r1, 0 + blt _0807055A + cmp r0, 0x37 + bgt _0807055A + cmp r1, 0x1F + bgt _0807055A + ldrh r1, [r5] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _0807055A + ldr r0, [r5, 0x10] + cmp r0, 0 + beq _080704E2 + bl sub_80450F8 + cmp r0, 0x1 + bne _0807055A +_080704E2: + bl sub_80441E8 + lsls r0, 24 + cmp r0, 0 + bne _08070504 + adds r0, r7, 0 + adds r0, 0xE4 + ldrb r0, [r0] + cmp r0, 0x3 + beq _08070552 + adds r0, r6, 0 + movs r1, 0x9 + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + bne _08070552 +_08070504: + movs r1, 0x2 + ldrsh r0, [r7, r1] + bl sub_8070328 + lsls r0, 24 + lsrs r4, r0, 24 + ldrh r0, [r5] + movs r5, 0x3 + ands r5, r0 + adds r0, r6, 0 + movs r1, 0xC + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _08070526 + movs r4, 0x2 +_08070526: + adds r0, r6, 0 + movs r1, 0xD + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _08070536 + movs r4, 0x3 +_08070536: + cmp r4, 0x1 + beq _0807054A + cmp r4, 0x1 + bgt _08070544 + cmp r4, 0 + beq _0807054E + b _08070552 +_08070544: + cmp r4, 0x2 + beq _08070556 + b _08070552 +_0807054A: + cmp r5, 0x2 + beq _08070552 +_0807054E: + cmp r5, 0x1 + bne _0807055A +_08070552: + movs r0, 0 + b _0807055C +_08070556: + cmp r5, 0 + bne _08070552 +_0807055A: + movs r0, 0x1 +_0807055C: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_807049C + + thumb_func_start sub_8070564 +sub_8070564: + push {r4-r6,lr} + adds r4, r1, 0 + ldr r6, [r0, 0x70] + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl sub_804954C + adds r5, r0, 0 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + blt _080705E6 + movs r2, 0x2 + ldrsh r1, [r4, r2] + cmp r1, 0 + blt _080705E6 + cmp r0, 0x37 + bgt _080705E6 + cmp r1, 0x1F + bgt _080705E6 + ldrh r1, [r5] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _080705E6 + ldr r0, [r5, 0x10] + cmp r0, 0 + beq _080705A8 + bl sub_80450F8 + cmp r0, 0x1 + bne _080705E6 +_080705A8: + movs r1, 0x2 + ldrsh r0, [r6, r1] + bl sub_8070328 + lsls r0, 24 + lsrs r2, r0, 24 + adds r3, r2, 0 + ldrh r0, [r5] + movs r1, 0x3 + ands r1, r0 + adds r0, r1, 0 + cmp r2, 0x1 + beq _080705DE + cmp r2, 0x1 + bgt _080705CC + cmp r2, 0 + beq _080705D8 + b _080705D4 +_080705CC: + cmp r3, 0x3 + bgt _080705D4 + cmp r1, 0 + beq _080705E6 +_080705D4: + movs r0, 0 + b _080705E8 +_080705D8: + cmp r1, 0x1 + bne _080705E6 + b _080705D4 +_080705DE: + cmp r1, 0x2 + beq _080705D4 + cmp r0, 0x1 + beq _080705D4 +_080705E6: + movs r0, 0x1 +_080705E8: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8070564 + + thumb_func_start sub_80705F0 +sub_80705F0: + push {r4-r7,lr} + adds r6, r0, 0 + adds r4, r1, 0 + ldr r7, [r6, 0x70] + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl sub_804954C + adds r5, r0, 0 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + blt _0807069A + movs r2, 0x2 + ldrsh r1, [r4, r2] + cmp r1, 0 + blt _0807069A + cmp r0, 0x37 + bgt _0807069A + cmp r1, 0x1F + bgt _0807069A + ldrh r1, [r5] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _0807069A + ldr r0, [r5, 0x10] + cmp r0, 0 + beq _08070636 + bl sub_80450F8 + cmp r0, 0x1 + bne _0807069A +_08070636: + bl sub_80441E8 + lsls r0, 24 + cmp r0, 0 + bne _08070658 + adds r0, r7, 0 + adds r0, 0xE4 + ldrb r0, [r0] + cmp r0, 0x3 + beq _08070696 + adds r0, r6, 0 + movs r1, 0x9 + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + bne _08070696 +_08070658: + movs r1, 0x2 + ldrsh r0, [r7, r1] + bl sub_8070328 + lsls r0, 24 + lsrs r4, r0, 24 + ldrh r0, [r5] + movs r5, 0x3 + ands r5, r0 + adds r0, r6, 0 + movs r1, 0xC + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _0807067A + movs r4, 0x2 +_0807067A: + adds r0, r6, 0 + movs r1, 0xD + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _0807068A + movs r4, 0x3 +_0807068A: + cmp r4, 0 + blt _08070696 + cmp r4, 0x2 + bgt _08070696 + cmp r5, 0 + beq _0807069A +_08070696: + movs r0, 0 + b _0807069C +_0807069A: + movs r0, 0x1 +_0807069C: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80705F0 + + thumb_func_start sub_80706A4 +sub_80706A4: + push {r4-r7,lr} + adds r7, r0, 0 + adds r4, r1, 0 + ldr r6, [r7, 0x70] + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl sub_804954C + adds r5, r0, 0 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + blt _0807076A + movs r2, 0x2 + ldrsh r1, [r4, r2] + cmp r1, 0 + blt _0807076A + cmp r0, 0x37 + bgt _0807076A + cmp r1, 0x1F + bgt _0807076A + ldrh r1, [r5] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _0807076A + ldr r0, [r5, 0x10] + cmp r0, 0 + beq _080706F2 + bl sub_80450F8 + cmp r0, 0x1 + bne _0807076A + ldr r0, [r5, 0x10] + ldr r0, [r0, 0x70] + cmp r0, r6 + bne _0807076A +_080706F2: + bl sub_80441E8 + lsls r0, 24 + cmp r0, 0 + bne _08070714 + adds r0, r6, 0 + adds r0, 0xE4 + ldrb r0, [r0] + cmp r0, 0x3 + beq _08070762 + adds r0, r7, 0 + movs r1, 0x9 + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + bne _08070762 +_08070714: + movs r1, 0x2 + ldrsh r0, [r6, r1] + bl sub_8070328 + lsls r0, 24 + lsrs r4, r0, 24 + ldrh r0, [r5] + movs r5, 0x3 + ands r5, r0 + adds r0, r7, 0 + movs r1, 0xC + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _08070736 + movs r4, 0x2 +_08070736: + adds r0, r7, 0 + movs r1, 0xD + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _08070746 + movs r4, 0x3 +_08070746: + cmp r4, 0x1 + beq _0807075A + cmp r4, 0x1 + bgt _08070754 + cmp r4, 0 + beq _0807075E + b _08070762 +_08070754: + cmp r4, 0x2 + beq _08070766 + b _08070762 +_0807075A: + cmp r5, 0x2 + beq _08070762 +_0807075E: + cmp r5, 0x1 + bne _0807076A +_08070762: + movs r0, 0 + b _0807076C +_08070766: + cmp r5, 0 + bne _08070762 +_0807076A: + movs r0, 0x1 +_0807076C: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80706A4 + + thumb_func_start sub_8070774 +sub_8070774: + push {r4-r6,lr} + adds r6, r0, 0 + ldr r5, [r6, 0x70] + movs r4, 0 + movs r0, 0x84 + lsls r0, 1 + adds r1, r5, r0 + movs r2, 0x4 +_08070784: + ldrb r0, [r1, 0x5] + cmp r0, 0 + beq _0807078C + subs r4, 0x1 +_0807078C: + ldrb r0, [r1] + cmp r0, 0 + beq _08070794 + adds r4, 0x1 +_08070794: + adds r1, 0x1 + subs r2, 0x1 + cmp r2, 0 + bge _08070784 + adds r0, r5, 0 + adds r0, 0xAC + ldrb r0, [r0] + cmp r0, 0x4 + bne _080707A8 + subs r4, 0x1 +_080707A8: + movs r1, 0x2 + ldrsh r0, [r5, r1] + bl sub_808DAFC + adds r4, r0 + adds r0, r6, 0 + movs r1, 0x6 + bl sub_8071858 + lsls r0, 24 + cmp r0, 0 + beq _080707D0 + adds r0, r6, 0 + bl sub_807E580 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x7 + bne _080707D0 + adds r4, 0x1 +_080707D0: + movs r0, 0x4 + ldrsh r1, [r5, r0] + ldr r0, _0807081C + cmp r1, r0 + bne _080707DC + adds r4, 0x1 +_080707DC: + movs r0, 0x2 + ldrsh r1, [r5, r0] + movs r0, 0xBE + lsls r0, 1 + cmp r1, r0 + bne _080707FE + ldrb r0, [r5, 0x6] + cmp r0, 0 + beq _080707FE + ldr r0, _08070820 + ldr r0, [r0] + ldr r1, _08070824 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080707FE + adds r4, 0x1 +_080707FE: + cmp r4, 0 + bge _08070804 + movs r4, 0 +_08070804: + cmp r4, 0x4 + ble _0807080A + movs r4, 0x4 +_0807080A: + movs r1, 0x82 + lsls r1, 1 + adds r0, r5, r1 + str r4, [r0] + adds r0, r4, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0807081C: .4byte 0x000001a3 +_08070820: .4byte gUnknown_203B418 +_08070824: .4byte 0x0000066e + thumb_func_end sub_8070774 + + thumb_func_start sub_8070828 +sub_8070828: + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r6, r1, 24 + movs r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08070840 + movs r0, 0 + b _080708AE +_08070840: + adds r0, r4, 0 + movs r1, 0x1B + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0807085E + adds r0, r4, 0 + bl sub_807E580 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bne _0807085E + movs r5, 0x1 +_0807085E: + adds r0, r4, 0 + movs r1, 0x4A + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0807087C + adds r0, r4, 0 + bl sub_807E580 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0807087C + movs r5, 0x1 +_0807087C: + cmp r6, 0 + beq _080708A0 + ldr r0, [r4, 0x70] + movs r1, 0x40 + adds r2, r5, 0 + bl sub_8071ACC + lsls r0, 24 + cmp r0, 0 + beq _080708A0 + adds r0, r4, 0 + bl sub_80429B4 + ldr r0, _080708A8 + ldr r1, [r0] + adds r0, r4, 0 + bl sub_80522A8 +_080708A0: + cmp r5, 0 + bne _080708AC + movs r0, 0x1 + b _080708AE + .align 2, 0 +_080708A8: .4byte gUnknown_80FEE80 +_080708AC: + movs r0, 0x2 +_080708AE: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8070828 + + thumb_func_start sub_80708B4 +sub_80708B4: + push {r4,r5,lr} + adds r3, r0, 0 + adds r4, r2, 0 + ldr r0, _080708E8 + ldr r2, [r0] + ldr r5, _080708EC + adds r0, r2, r5 + ldrb r0, [r0] + cmp r0, 0 + bne _080708DC + adds r5, 0x6 + adds r0, r2, r5 + ldrb r0, [r0] + cmp r0, 0 + bne _080708DC + adds r0, r1, 0 + adds r0, 0xE4 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080708F4 +_080708DC: + ldrb r0, [r1, 0x6] + cmp r0, 0 + beq _080708F4 + ldr r0, _080708F0 + b _08070900 + .align 2, 0 +_080708E8: .4byte gUnknown_203B418 +_080708EC: .4byte 0x0001820a +_080708F0: .4byte gUnknown_80F8988 +_080708F4: + adds r0, r1, 0 + adds r0, 0xC8 + ldrb r0, [r0] + cmp r0, 0x2 + bne _08070910 + ldr r0, _0807090C +_08070900: + ldr r1, [r0] + adds r0, r3, 0 + bl strcpy + b _0807095A + .align 2, 0 +_0807090C: .4byte gUnknown_80F8968 +_08070910: + ldrb r0, [r1, 0x6] + cmp r0, 0 + beq _08070942 + adds r0, r1, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x4A + beq _0807092A + adds r0, r1, 0 + adds r0, 0xA4 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08070936 +_0807092A: + movs r0, 0x4 + ldrsh r1, [r1, r0] + adds r0, r3, 0 + bl sub_808D8E0 + b _0807095A +_08070936: + movs r5, 0x4 + ldrsh r1, [r1, r5] + adds r0, r3, 0 + bl sub_808D908 + b _0807095A +_08070942: + ldr r2, _08070960 + ldrb r1, [r1, 0xA] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08070964 + adds r0, r1 + ldr r1, [r2] + adds r1, r0 + adds r0, r3, 0 + adds r2, r4, 0 + bl sub_808D9DC +_0807095A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08070960: .4byte gUnknown_203B45C +_08070964: .4byte 0x00008df8 + thumb_func_end sub_80708B4 + + thumb_func_start sub_8070968 +sub_8070968: + push {r4,lr} + adds r4, r0, 0 + adds r3, r2, 0 + adds r0, r1, 0 + adds r0, 0xC8 + ldrb r0, [r0] + cmp r0, 0x2 + bne _08070990 + ldr r1, _08070988 + adds r2, 0x30 + ldr r0, _0807098C + ldr r3, [r0] + adds r0, r4, 0 + bl sub_800D158 + b _080709BA + .align 2, 0 +_08070988: .4byte gUnknown_8106FA4 +_0807098C: .4byte gUnknown_80F8974 +_08070990: + ldrb r0, [r1, 0x6] + cmp r0, 0 + beq _080709A2 + movs r0, 0x4 + ldrsh r1, [r1, r0] + adds r0, r4, 0 + bl sub_808D908 + b _080709BA +_080709A2: + ldr r2, _080709C0 + ldrb r1, [r1, 0xA] + movs r0, 0x64 + muls r0, r1 + ldr r1, _080709C4 + adds r0, r1 + ldr r1, [r2] + adds r1, r0 + adds r0, r4, 0 + adds r2, r3, 0 + bl sub_808D9DC +_080709BA: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080709C0: .4byte gUnknown_203B45C +_080709C4: .4byte 0x00008df8 + thumb_func_end sub_8070968 + + thumb_func_start sub_80709C8 +sub_80709C8: + push {r4,lr} + adds r3, r0, 0 + ldr r0, _080709F8 + ldr r2, [r0] + ldr r4, _080709FC + adds r0, r2, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _080709EE + adds r4, 0x6 + adds r0, r2, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _080709EE + adds r0, r1, 0 + adds r0, 0xE4 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08070A04 +_080709EE: + ldrb r0, [r1, 0x6] + cmp r0, 0 + beq _08070A04 + ldr r0, _08070A00 + b _08070A10 + .align 2, 0 +_080709F8: .4byte gUnknown_203B418 +_080709FC: .4byte 0x0001820a +_08070A00: .4byte gUnknown_80F8994 +_08070A04: + adds r0, r1, 0 + adds r0, 0xC8 + ldrb r0, [r0] + cmp r0, 0x2 + bne _08070A20 + ldr r0, _08070A1C +_08070A10: + ldr r1, [r0] + adds r0, r3, 0 + bl strcpy + b _08070A48 + .align 2, 0 +_08070A1C: .4byte gUnknown_80F8974 +_08070A20: + ldrb r0, [r1, 0x6] + cmp r0, 0 + beq _08070A32 + movs r0, 0x4 + ldrsh r1, [r1, r0] + adds r0, r3, 0 + bl sub_808D8BC + b _08070A48 +_08070A32: + ldr r2, _08070A50 + ldrb r1, [r1, 0xA] + movs r0, 0x64 + muls r0, r1 + ldr r1, _08070A54 + adds r0, r1 + ldr r1, [r2] + adds r1, r0 + adds r0, r3, 0 + bl sub_808DA0C +_08070A48: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08070A50: .4byte gUnknown_203B45C +_08070A54: .4byte 0x00008df8 + thumb_func_end sub_80709C8 + + thumb_func_start sub_8070A58 +sub_8070A58: + push {r4,lr} + ldr r0, [r0, 0x70] + mov r12, r0 + adds r0, 0xA8 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08070ADE + cmp r0, 0x3 + beq _08070ADE + cmp r0, 0x4 + beq _08070ADE + mov r0, r12 + adds r0, 0xAC + ldrb r0, [r0] + cmp r0, 0 + bne _08070ADE + mov r0, r12 + adds r0, 0xB0 + ldrb r0, [r0] + cmp r0, 0x5 + beq _08070A86 + cmp r0, 0 + bne _08070ADE +_08070A86: + mov r0, r12 + adds r0, 0xBC + ldrb r0, [r0] + cmp r0, 0 + bne _08070ADE + mov r0, r12 + adds r0, 0xC8 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08070ADE + cmp r0, 0x2 + beq _08070ADE + mov r0, r12 + adds r0, 0xD0 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08070ADE + mov r0, r12 + adds r0, 0xDC + ldrb r0, [r0] + cmp r0, 0x2 + beq _08070ADE + mov r0, r12 + adds r0, 0xE8 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08070ADE + cmp r0, 0x2 + beq _08070ADE + mov r0, r12 + adds r0, 0xEC + ldrb r0, [r0] + cmp r0, 0x1 + beq _08070ADE + mov r0, r12 + adds r0, 0xF5 + ldrb r0, [r0] + cmp r0, 0 + bne _08070ADE + mov r0, r12 + adds r0, 0xFD + ldrb r0, [r0] + cmp r0, 0 + beq _08070AE2 +_08070ADE: + movs r0, 0x1 + b _08070B1E +_08070AE2: + movs r3, 0 + movs r4, 0x1 + movs r2, 0x8C + lsls r2, 1 + add r2, r12 +_08070AEC: + ldrb r1, [r2] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _08070B00 + ldrb r1, [r2, 0x1] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + bne _08070ADE +_08070B00: + adds r2, 0x8 + adds r3, 0x1 + cmp r3, 0x3 + ble _08070AEC + movs r3, 0 + ldr r1, _08070B24 + add r1, r12 +_08070B0E: + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _08070ADE + adds r3, 0x1 + cmp r3, 0x4 + ble _08070B0E + movs r0, 0 +_08070B1E: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08070B24: .4byte 0x0000010d + thumb_func_end sub_8070A58 + + thumb_func_start sub_8070B28 +sub_8070B28: + push {lr} + ldr r0, [r0, 0x70] + adds r0, 0xA8 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08070B40 + cmp r0, 0x5 + beq _08070B40 + cmp r0, 0x3 + beq _08070B40 + movs r0, 0 + b _08070B42 +_08070B40: + movs r0, 0x1 +_08070B42: + pop {r1} + bx r1 + thumb_func_end sub_8070B28 + + thumb_func_start sub_8070B48 +sub_8070B48: + push {lr} + ldr r0, [r0, 0x70] + adds r1, r0, 0 + movs r2, 0x10 + ldrsh r0, [r1, r2] + cmp r0, 0 + bge _08070B58 + adds r0, 0x3 +_08070B58: + movs r2, 0xE + ldrsh r1, [r1, r2] + asrs r0, 2 + cmp r1, r0 + ble _08070B66 + movs r0, 0 + b _08070B68 +_08070B66: + movs r0, 0x1 +_08070B68: + pop {r1} + bx r1 + thumb_func_end sub_8070B48 + + thumb_func_start sub_8070B6C +sub_8070B6C: + push {lr} + lsls r1, 24 + ldr r2, [r0, 0x70] + cmp r1, 0 + beq _08070B80 + adds r0, r2, 0 + adds r0, 0xE8 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08070BB8 +_08070B80: + adds r0, r2, 0 + adds r0, 0xA8 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08070BB8 + cmp r0, 0x5 + beq _08070BB8 + cmp r0, 0x3 + beq _08070BB8 + adds r0, r2, 0 + adds r0, 0xBC + ldrb r0, [r0] + cmp r0, 0x3 + beq _08070BB8 + cmp r0, 0x7 + beq _08070BB8 + adds r0, r2, 0 + adds r0, 0xB0 + ldrb r0, [r0] + cmp r0, 0x6 + beq _08070BB8 + adds r0, r2, 0 + adds r0, 0xFA + ldrb r0, [r0] + cmp r0, 0 + bne _08070BB8 + movs r0, 0 + b _08070BBA +_08070BB8: + movs r0, 0x1 +_08070BBA: + pop {r1} + bx r1 + thumb_func_end sub_8070B6C + + thumb_func_start sub_8070BC0 +sub_8070BC0: + push {r4-r6,lr} + adds r4, r0, 0 + ldr r5, [r4, 0x70] + movs r1, 0 + bl sub_80570F4 + lsls r0, 24 + cmp r0, 0 + bne _08070C56 + adds r6, r5, 0 + adds r6, 0xA8 + ldrb r0, [r6] + cmp r0, 0x4 + beq _08070C56 + cmp r0, 0x3 + beq _08070C56 + adds r0, r4, 0 + bl sub_8071494 + lsls r0, 24 + cmp r0, 0 + bne _08070C56 + adds r0, r5, 0 + adds r0, 0xEC + ldrb r0, [r0] + cmp r0, 0x1 + beq _08070C56 + adds r0, r5, 0 + adds r0, 0xB0 + ldrb r1, [r0] + cmp r1, 0x6 + beq _08070C56 + cmp r1, 0x1 + beq _08070C56 + adds r0, r5, 0 + adds r0, 0xBC + ldrb r3, [r0] + adds r4, r0, 0 + cmp r3, 0x2 + beq _08070C56 + ldrb r2, [r6] + cmp r2, 0x1 + beq _08070C56 + adds r0, r5, 0 + adds r0, 0xE4 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08070C56 + cmp r2, 0x5 + beq _08070C56 + cmp r3, 0x1 + beq _08070C56 + cmp r1, 0x3 + beq _08070C56 + cmp r1, 0x4 + beq _08070C56 + adds r0, r5, 0 + adds r0, 0xE8 + ldrb r1, [r0] + cmp r1, 0x2 + beq _08070C56 + adds r0, r5, 0 + adds r0, 0xC8 + ldrb r0, [r0] + cmp r0, 0x2 + beq _08070C56 + cmp r1, 0x1 + beq _08070C56 + ldrb r0, [r4] + cmp r0, 0x7 + beq _08070C56 + cmp r0, 0x3 + beq _08070C56 + movs r0, 0x1 + b _08070C58 +_08070C56: + movs r0, 0 +_08070C58: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8070BC0 + + thumb_func_start sub_8070C60 +sub_8070C60: + push {r4,lr} + adds r4, r0, 0 + ldr r1, [r4, 0x70] + adds r0, r1, 0 + adds r0, 0xA4 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08070CC6 + adds r0, r1, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x4A + beq _08070C7E + cmp r0, 0x47 + bne _08070C82 +_08070C7E: + movs r0, 0x1 + b _08070C84 +_08070C82: + movs r0, 0 +_08070C84: + cmp r0, 0 + bne _08070CC6 + ldrb r0, [r1, 0x7] + cmp r0, 0 + bne _08070C9A + adds r0, r4, 0 + bl sub_8071494 + lsls r0, 24 + cmp r0, 0 + bne _08070CC6 +_08070C9A: + adds r0, r4, 0 + movs r1, 0 + bl sub_8070B6C + lsls r0, 24 + cmp r0, 0 + bne _08070CC6 + adds r0, r4, 0 + bl sub_8070CD0 + lsls r0, 24 + cmp r0, 0 + bne _08070CC6 + adds r0, r4, 0 + movs r1, 0 + bl sub_80570F4 + lsls r0, 24 + cmp r0, 0 + bne _08070CC6 + movs r0, 0 + b _08070CC8 +_08070CC6: + movs r0, 0x1 +_08070CC8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8070C60 + + thumb_func_start sub_8070CD0 +sub_8070CD0: + push {lr} + ldr r1, [r0, 0x70] + adds r0, r1, 0 + adds r0, 0xA8 + ldrb r0, [r0] + cmp r0, 0x2 + beq _08070CE2 + cmp r0, 0 + bne _08070CFE +_08070CE2: + adds r0, r1, 0 + adds r0, 0xB0 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08070CFE + cmp r0, 0x6 + beq _08070CFE + adds r0, r1, 0 + adds r0, 0xC0 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08070CFE + movs r0, 0 + b _08070D00 +_08070CFE: + movs r0, 0x1 +_08070D00: + pop {r1} + bx r1 + thumb_func_end sub_8070CD0 + + thumb_func_start sub_8070D04 +sub_8070D04: + push {lr} + adds r3, r0, 0 + lsls r1, 24 + ldr r2, [r3, 0x70] + cmp r1, 0 + bne _08070D22 + adds r0, r2, 0 + adds r0, 0xA8 + ldrb r0, [r0] + cmp r0, 0x2 + beq _08070D22 + cmp r0, 0x4 + beq _08070D22 + cmp r0, 0 + bne _08070D64 +_08070D22: + adds r0, r2, 0 + adds r0, 0xB0 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08070D64 + cmp r0, 0x3 + beq _08070D64 + cmp r0, 0x4 + beq _08070D64 + cmp r0, 0x6 + beq _08070D64 + adds r0, r2, 0 + adds r0, 0xBC + ldrb r0, [r0] + cmp r0, 0x1 + beq _08070D64 + cmp r0, 0x3 + beq _08070D64 + cmp r0, 0x7 + beq _08070D64 + adds r0, r2, 0 + adds r0, 0xAC + ldrb r0, [r0] + cmp r0, 0x4 + beq _08070D64 + adds r0, r3, 0 + bl sub_8071494 + lsls r0, 24 + cmp r0, 0 + bne _08070D64 + movs r0, 0 + b _08070D66 +_08070D64: + movs r0, 0x1 +_08070D66: + pop {r1} + bx r1 + thumb_func_end sub_8070D04 + + thumb_func_start sub_8070D6C +sub_8070D6C: + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + ldr r0, [r4, 0x70] + movs r1, 0x2 + ldrsh r0, [r0, r1] + bl sub_8070328 + lsls r0, 24 + lsrs r5, r0, 24 + movs r2, 0x4 + ldrsh r0, [r4, r2] + ldr r1, _08070DD8 + lsls r2, r6, 2 + adds r2, r1 + movs r3, 0 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r3, 0x6 + ldrsh r1, [r4, r3] + movs r3, 0x2 + ldrsh r2, [r2, r3] + adds r1, r2 + bl sub_804954C + adds r2, r0, 0 + ldrh r1, [r2] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _08070E34 + ldr r0, [r2, 0x10] + cmp r0, 0 + bne _08070E34 + bl sub_80441E8 + lsls r0, 24 + cmp r0, 0 + bne _08070E04 + ldr r0, [r4, 0x70] + adds r0, 0xE4 + ldrb r0, [r0] + cmp r0, 0x3 + beq _08070DD2 + adds r0, r4, 0 + movs r1, 0x9 + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _08070DDC +_08070DD2: + movs r5, 0x3 + b _08070E04 + .align 2, 0 +_08070DD8: .4byte gUnknown_80F4448 +_08070DDC: + adds r0, r4, 0 + movs r1, 0xC + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + bne _08070E02 + adds r0, r4, 0 + movs r1, 0xD + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _08070E04 + movs r0, 0x1 + ands r0, r6 + movs r5, 0x3 + cmp r0, 0 + beq _08070E04 +_08070E02: + movs r5, 0x2 +_08070E04: + movs r1, 0x4 + ldrsh r0, [r4, r1] + movs r2, 0x6 + ldrsh r1, [r4, r2] + bl sub_804954C + adds r2, r0, 0 + adds r1, r2, 0 + adds r1, 0xA + adds r1, r5 + ldr r2, _08070E30 + movs r0, 0x7 + ands r0, r6 + adds r0, r2 + ldrb r1, [r1] + ldrb r0, [r0] + ands r0, r1 + cmp r0, 0 + beq _08070E34 + movs r0, 0x1 + b _08070E36 + .align 2, 0 +_08070E30: .4byte gUnknown_8106FAD +_08070E34: + movs r0, 0 +_08070E36: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8070D6C + + thumb_func_start sub_8070E3C +sub_8070E3C: + push {r4-r7,lr} + adds r4, r0, 0 + adds r6, r1, 0 + adds r7, r2, 0 + ldr r0, [r4, 0x70] + movs r1, 0x2 + ldrsh r0, [r0, r1] + bl sub_8070328 + lsls r0, 24 + lsrs r5, r0, 24 + movs r2, 0 + ldrsh r0, [r6, r2] + ldr r1, _08070EB0 + lsls r2, r7, 2 + adds r2, r1 + movs r3, 0 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r3, 0x2 + ldrsh r1, [r6, r3] + movs r3, 0x2 + ldrsh r2, [r2, r3] + adds r1, r2 + bl sub_804954C + adds r2, r0, 0 + ldrh r1, [r2] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _08070F0C + ldr r0, [r2, 0x10] + cmp r0, 0 + beq _08070E8A + bl sub_80450F8 + cmp r0, 0x1 + bne _08070F0C +_08070E8A: + bl sub_80441E8 + lsls r0, 24 + cmp r0, 0 + bne _08070EDC + ldr r0, [r4, 0x70] + adds r0, 0xE4 + ldrb r0, [r0] + cmp r0, 0x3 + beq _08070EAC + adds r0, r4, 0 + movs r1, 0x9 + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _08070EB4 +_08070EAC: + movs r5, 0x3 + b _08070EDC + .align 2, 0 +_08070EB0: .4byte gUnknown_80F4448 +_08070EB4: + adds r0, r4, 0 + movs r1, 0xC + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + bne _08070EDA + adds r0, r4, 0 + movs r1, 0xD + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _08070EDC + movs r0, 0x1 + ands r0, r7 + movs r5, 0x3 + cmp r0, 0 + beq _08070EDC +_08070EDA: + movs r5, 0x2 +_08070EDC: + movs r1, 0 + ldrsh r0, [r6, r1] + movs r2, 0x2 + ldrsh r1, [r6, r2] + bl sub_804954C + adds r2, r0, 0 + adds r1, r2, 0 + adds r1, 0xA + adds r1, r5 + ldr r2, _08070F08 + movs r0, 0x7 + ands r0, r7 + adds r0, r2 + ldrb r1, [r1] + ldrb r0, [r0] + ands r0, r1 + cmp r0, 0 + beq _08070F0C + movs r0, 0x1 + b _08070F0E + .align 2, 0 +_08070F08: .4byte gUnknown_8106FB5 +_08070F0C: + movs r0, 0 +_08070F0E: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8070E3C + + thumb_func_start sub_8070F14 +sub_8070F14: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r1, 0x4 + ldrsh r0, [r4, r1] + ldr r1, _08070F70 + lsls r2, r5, 2 + adds r2, r1 + movs r3, 0 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r3, 0x6 + ldrsh r1, [r4, r3] + movs r3, 0x2 + ldrsh r2, [r2, r3] + adds r1, r2 + bl sub_804954C + adds r2, r0, 0 + ldrh r1, [r2] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _08070F78 + ldr r0, [r2, 0x10] + cmp r0, 0 + bne _08070F78 + movs r1, 0x4 + ldrsh r0, [r4, r1] + movs r2, 0x6 + ldrsh r1, [r4, r2] + bl sub_804954C + adds r2, r0, 0 + ldr r1, _08070F74 + movs r0, 0x7 + ands r0, r5 + adds r0, r1 + ldrb r1, [r2, 0xA] + ldrb r0, [r0] + ands r0, r1 + cmp r0, 0 + beq _08070F78 + movs r0, 0x1 + b _08070F7A + .align 2, 0 +_08070F70: .4byte gUnknown_80F4448 +_08070F74: .4byte gUnknown_8106FBD +_08070F78: + movs r0, 0 +_08070F7A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8070F14 + + thumb_func_start sub_8070F80 +sub_8070F80: + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + ldr r0, [r4, 0x70] + movs r1, 0x2 + ldrsh r0, [r0, r1] + bl sub_8070328 + lsls r0, 24 + lsrs r5, r0, 24 + movs r2, 0x4 + ldrsh r0, [r4, r2] + ldr r1, _08070FF4 + lsls r2, r6, 2 + adds r2, r1 + movs r3, 0 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r3, 0x6 + ldrsh r1, [r4, r3] + movs r3, 0x2 + ldrsh r2, [r2, r3] + adds r1, r2 + bl sub_804954C + adds r2, r0, 0 + ldrh r1, [r2] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _08071050 + ldr r0, [r2, 0x10] + cmp r0, 0 + beq _08070FCC + bl sub_80450F8 + cmp r0, 0x1 + bne _08071050 +_08070FCC: + bl sub_80441E8 + lsls r0, 24 + cmp r0, 0 + bne _08071020 + ldr r0, [r4, 0x70] + adds r0, 0xE4 + ldrb r0, [r0] + cmp r0, 0x3 + beq _08070FEE + adds r0, r4, 0 + movs r1, 0x9 + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _08070FF8 +_08070FEE: + movs r5, 0x3 + b _08071020 + .align 2, 0 +_08070FF4: .4byte gUnknown_80F4448 +_08070FF8: + adds r0, r4, 0 + movs r1, 0xC + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + bne _0807101E + adds r0, r4, 0 + movs r1, 0xD + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _08071020 + movs r0, 0x1 + ands r0, r6 + movs r5, 0x3 + cmp r0, 0 + beq _08071020 +_0807101E: + movs r5, 0x2 +_08071020: + movs r1, 0x4 + ldrsh r0, [r4, r1] + movs r2, 0x6 + ldrsh r1, [r4, r2] + bl sub_804954C + adds r2, r0, 0 + adds r1, r2, 0 + adds r1, 0xA + adds r1, r5 + ldr r2, _0807104C + movs r0, 0x7 + ands r0, r6 + adds r0, r2 + ldrb r1, [r1] + ldrb r0, [r0] + ands r0, r1 + cmp r0, 0 + beq _08071050 + movs r0, 0x1 + b _08071052 + .align 2, 0 +_0807104C: .4byte gUnknown_8106FC5 +_08071050: + movs r0, 0 +_08071052: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8070F80 + + thumb_func_start sub_8071058 +sub_8071058: + push {r4-r7,lr} + adds r5, r0, 0 + adds r7, r1, 0 + ldr r0, [r5, 0x70] + movs r1, 0x2 + ldrsh r0, [r0, r1] + bl sub_8070328 + lsls r0, 24 + lsrs r6, r0, 24 + movs r2, 0x4 + ldrsh r0, [r5, r2] + ldr r1, _080710D4 + lsls r2, r7, 2 + adds r2, r1 + movs r3, 0 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r3, 0x6 + ldrsh r1, [r5, r3] + movs r3, 0x2 + ldrsh r2, [r2, r3] + adds r1, r2 + bl sub_804954C + adds r4, r0, 0 + ldrh r1, [r4] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _08071130 + ldr r0, [r4, 0x10] + cmp r0, 0 + beq _080710AE + bl sub_80450F8 + cmp r0, 0x1 + beq _080710AE + ldr r0, [r4, 0x10] + ldr r0, [r0, 0x70] + ldrb r0, [r0, 0x6] + cmp r0, 0 + bne _08071130 +_080710AE: + bl sub_80441E8 + lsls r0, 24 + cmp r0, 0 + bne _08071100 + ldr r0, [r5, 0x70] + adds r0, 0xE4 + ldrb r0, [r0] + cmp r0, 0x3 + beq _080710D0 + adds r0, r5, 0 + movs r1, 0x9 + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _080710D8 +_080710D0: + movs r6, 0x3 + b _08071100 + .align 2, 0 +_080710D4: .4byte gUnknown_80F4448 +_080710D8: + adds r0, r5, 0 + movs r1, 0xC + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + bne _080710FE + adds r0, r5, 0 + movs r1, 0xD + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _08071100 + movs r0, 0x1 + ands r0, r7 + movs r6, 0x3 + cmp r0, 0 + beq _08071100 +_080710FE: + movs r6, 0x2 +_08071100: + movs r1, 0x4 + ldrsh r0, [r5, r1] + movs r2, 0x6 + ldrsh r1, [r5, r2] + bl sub_804954C + adds r4, r0, 0 + adds r1, r4, 0 + adds r1, 0xA + adds r1, r6 + ldr r2, _0807112C + movs r0, 0x7 + ands r0, r7 + adds r0, r2 + ldrb r1, [r1] + ldrb r0, [r0] + ands r0, r1 + cmp r0, 0 + beq _08071130 + movs r0, 0x1 + b _08071132 + .align 2, 0 +_0807112C: .4byte gUnknown_8106FCD +_08071130: + movs r0, 0 +_08071132: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8071058 + + thumb_func_start sub_8071138 +sub_8071138: + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + ldr r0, [r4, 0x70] + movs r1, 0x2 + ldrsh r0, [r0, r1] + bl sub_8070328 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x1 + bhi _08071152 + movs r5, 0x2 +_08071152: + movs r2, 0x4 + ldrsh r0, [r4, r2] + ldr r1, _080711B0 + lsls r2, r6, 2 + adds r2, r1 + movs r3, 0 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r3, 0x6 + ldrsh r1, [r4, r3] + movs r3, 0x2 + ldrsh r2, [r2, r3] + adds r1, r2 + bl sub_804954C + adds r2, r0, 0 + ldrh r1, [r2] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _0807120C + ldr r0, [r2, 0x10] + cmp r0, 0 + beq _0807118A + bl sub_80450F8 + cmp r0, 0x1 + bne _0807120C +_0807118A: + bl sub_80441E8 + lsls r0, 24 + cmp r0, 0 + bne _080711DC + ldr r0, [r4, 0x70] + adds r0, 0xE4 + ldrb r0, [r0] + cmp r0, 0x3 + beq _080711AC + adds r0, r4, 0 + movs r1, 0x9 + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _080711B4 +_080711AC: + movs r5, 0x3 + b _080711DC + .align 2, 0 +_080711B0: .4byte gUnknown_80F4448 +_080711B4: + adds r0, r4, 0 + movs r1, 0xC + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + bne _080711DA + adds r0, r4, 0 + movs r1, 0xD + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _080711DC + movs r0, 0x1 + ands r0, r6 + movs r5, 0x3 + cmp r0, 0 + beq _080711DC +_080711DA: + movs r5, 0x2 +_080711DC: + movs r1, 0x4 + ldrsh r0, [r4, r1] + movs r2, 0x6 + ldrsh r1, [r4, r2] + bl sub_804954C + adds r2, r0, 0 + adds r1, r2, 0 + adds r1, 0xA + adds r1, r5 + ldr r2, _08071208 + movs r0, 0x7 + ands r0, r6 + adds r0, r2 + ldrb r1, [r1] + ldrb r0, [r0] + ands r0, r1 + cmp r0, 0 + beq _0807120C + movs r0, 0x1 + b _0807120E + .align 2, 0 +_08071208: .4byte gUnknown_8106FD5 +_0807120C: + movs r0, 0 +_0807120E: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8071138 + + thumb_func_start sub_8071214 +sub_8071214: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + adds r7, r1, 0 + mov r8, r2 + ldr r0, [r4, 0x70] + movs r1, 0x2 + ldrsh r0, [r0, r1] + bl sub_8070328 + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0 + mov r2, r8 + strb r0, [r2] + movs r3, 0x4 + ldrsh r0, [r4, r3] + ldr r1, _0807130C + lsls r2, r7, 2 + adds r2, r1 + movs r3, 0 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r3, 0x6 + ldrsh r1, [r4, r3] + movs r3, 0x2 + ldrsh r2, [r2, r3] + adds r1, r2 + bl sub_804954C + adds r5, r0, 0 + ldrh r1, [r5] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08071260 + b _0807137E +_08071260: + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _08071286 + ldr r0, _08071310 + ldr r0, [r0] + ldr r1, _08071314 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _08071286 + adds r0, r4, 0 + movs r1, 0xF + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _08071286 + b _0807137E +_08071286: + ldr r0, [r5, 0x14] + cmp r0, 0 + beq _080712B8 + adds r0, r4, 0 + movs r1, 0xE + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _080712B8 + ldr r0, [r5, 0x14] + bl sub_80450F8 + cmp r0, 0x2 + bne _080712B8 + ldr r0, [r5, 0x14] + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0 + bne _0807137E + ldr r0, [r4, 0x70] + adds r0, 0xE8 + ldrb r0, [r0] + cmp r0, 0x3 + beq _0807137E +_080712B8: + ldrh r1, [r5] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + bne _080712E6 + ldr r1, _08071318 + ldr r0, _08071310 + ldr r0, [r0] + ldr r2, _0807131C + adds r0, r2 + movs r3, 0 + ldrsh r0, [r0, r3] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _080712E6 + adds r0, r4, 0 + movs r1, 0x14 + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + bne _0807137E +_080712E6: + bl sub_80441E8 + lsls r0, 24 + cmp r0, 0 + bne _08071348 + ldr r0, [r4, 0x70] + adds r0, 0xE4 + ldrb r0, [r0] + cmp r0, 0x3 + beq _08071308 + adds r0, r4, 0 + movs r1, 0x9 + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _08071320 +_08071308: + movs r6, 0x3 + b _08071348 + .align 2, 0 +_0807130C: .4byte gUnknown_80F4448 +_08071310: .4byte gUnknown_203B418 +_08071314: .4byte 0x00000671 +_08071318: .4byte gUnknown_810ACC0 +_0807131C: .4byte 0x00003a0e +_08071320: + adds r0, r4, 0 + movs r1, 0xC + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + bne _08071346 + adds r0, r4, 0 + movs r1, 0xD + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _08071348 + movs r0, 0x1 + ands r0, r7 + movs r6, 0x3 + cmp r0, 0 + beq _08071348 +_08071346: + movs r6, 0x2 +_08071348: + movs r1, 0x4 + ldrsh r0, [r4, r1] + movs r2, 0x6 + ldrsh r1, [r4, r2] + bl sub_804954C + adds r0, 0xA + adds r0, r6 + ldr r2, _08071374 + movs r1, 0x7 + ands r1, r7 + adds r1, r2 + ldrb r2, [r0] + ldrb r0, [r1] + ands r0, r2 + cmp r0, 0 + beq _0807137E + ldr r0, [r5, 0x10] + cmp r0, 0 + bne _08071378 + movs r0, 0x1 + b _08071380 + .align 2, 0 +_08071374: .4byte gUnknown_8106FDD +_08071378: + movs r0, 0x1 + mov r3, r8 + strb r0, [r3] +_0807137E: + movs r0, 0 +_08071380: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8071214 + + thumb_func_start sub_807138C +sub_807138C: + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, [r4, 0x70] + movs r1, 0x2 + ldrsh r0, [r0, r1] + bl sub_8070328 + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_80441E8 + lsls r0, 24 + cmp r0, 0 + bne _080713E2 + ldr r0, [r4, 0x70] + adds r0, 0xE4 + ldrb r0, [r0] + cmp r0, 0x3 + beq _080713E0 + adds r0, r4, 0 + movs r1, 0x9 + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + bne _080713E0 + adds r0, r4, 0 + movs r1, 0xC + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _080713D2 + movs r5, 0x2 + b _080713E2 +_080713D2: + adds r0, r4, 0 + movs r1, 0xD + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _080713E2 +_080713E0: + movs r5, 0x3 +_080713E2: + cmp r5, 0x3 + bne _08071408 + ldr r4, [r4, 0x70] + movs r0, 0x64 + bl sub_8084100 + movs r1, 0xFD + lsls r1, 1 + adds r2, r4, r1 + ldrh r1, [r2] + adds r1, r0 + strh r1, [r2] + lsls r1, 16 + asrs r1, 16 + cmp r1, 0xC7 + ble _08071458 + movs r0, 0 + strh r0, [r2] + b _08071468 +_08071408: + ldr r1, _0807145C + ldr r0, _08071460 + ldr r0, [r0] + ldr r2, _08071464 + adds r0, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08071432 + cmp r5, 0x1 + bne _08071432 + adds r0, r4, 0 + movs r1, 0x14 + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _08071432 + movs r5, 0 +_08071432: + movs r1, 0x4 + ldrsh r0, [r4, r1] + movs r2, 0x6 + ldrsh r1, [r4, r2] + bl sub_804954C + adds r0, 0xA + adds r0, r5 + ldrb r0, [r0] + cmp r0, 0x54 + beq _08071468 + cmp r0, 0x51 + beq _08071468 + cmp r0, 0x45 + beq _08071468 + cmp r0, 0x15 + beq _08071468 + cmp r0, 0x55 + beq _08071468 +_08071458: + movs r0, 0 + b _0807146A + .align 2, 0 +_0807145C: .4byte gUnknown_810ACC0 +_08071460: .4byte gUnknown_203B418 +_08071464: .4byte 0x00003a0e +_08071468: + movs r0, 0x1 +_0807146A: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_807138C + + thumb_func_start sub_8071470 +sub_8071470: + push {r4,lr} + lsls r1, 24 + lsrs r4, r1, 24 + movs r1, 0x3 + bl sub_80718AC + lsls r0, 24 + cmp r0, 0 + beq _0807148A + cmp r4, 0 + beq _0807148A + movs r0, 0x1 + b _0807148C +_0807148A: + movs r0, 0 +_0807148C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8071470 + + thumb_func_start sub_8071494 +sub_8071494: + push {r4,r5,lr} + adds r5, r0, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807150E + ldr r4, [r5, 0x70] + adds r0, r4, 0 + adds r0, 0xFA + ldrb r0, [r0] + cmp r0, 0 + bne _0807150A + ldrb r0, [r4, 0x7] + cmp r0, 0 + bne _0807150E + adds r0, r5, 0 + movs r1, 0x2B + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _080714DC + movs r2, 0 + movs r1, 0x10 + ldrsh r0, [r4, r1] + lsrs r1, r0, 31 + adds r0, r1 + movs r3, 0xE + ldrsh r1, [r4, r3] + asrs r0, 1 + cmp r1, r0 + bge _080714D8 + movs r2, 0x1 +_080714D8: + cmp r2, 0 + bne _0807150A +_080714DC: + adds r0, r5, 0 + movs r1, 0xA + bl sub_80718AC + lsls r0, 24 + cmp r0, 0 + bne _0807150A + adds r0, r5, 0 + movs r1, 0x6 + bl sub_80718AC + lsls r0, 24 + cmp r0, 0 + beq _0807150E + movs r1, 0x10 + ldrsh r0, [r4, r1] + lsrs r1, r0, 31 + adds r0, r1 + movs r2, 0xE + ldrsh r1, [r4, r2] + asrs r0, 1 + cmp r1, r0 + bgt _0807150E +_0807150A: + movs r0, 0x1 + b _08071510 +_0807150E: + movs r0, 0 +_08071510: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8071494 + + thumb_func_start sub_8071518 +sub_8071518: + push {r4,r5,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + bl sub_8071494 + lsls r0, 24 + cmp r0, 0 + bne _0807152E + movs r0, 0 + b _08071538 +_0807152E: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8071540 + movs r0, 0x1 +_08071538: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8071518 + + thumb_func_start sub_8071540 +sub_8071540: + push {r4-r7,lr} + adds r5, r0, 0 + lsls r1, 24 + lsrs r7, r1, 24 + ldr r4, [r5, 0x70] + adds r6, r4, 0 + ldrb r0, [r4, 0x7] + cmp r0, 0 + bne _08071590 + adds r0, r5, 0 + movs r1, 0x2B + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _08071590 + movs r2, 0 + movs r1, 0x10 + ldrsh r0, [r4, r1] + lsrs r1, r0, 31 + adds r0, r1 + movs r3, 0xE + ldrsh r1, [r4, r3] + asrs r0, 1 + cmp r1, r0 + bgt _08071576 + movs r2, 0x1 +_08071576: + adds r0, r6, 0 + movs r1, 0x4 + bl sub_8071ACC + lsls r0, 24 + lsrs r0, 24 + cmp r7, 0 + beq _08071590 + cmp r0, 0 + beq _08071590 + adds r0, r5, 0 + bl sub_8042910 +_08071590: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8071540 + + thumb_func_start sub_8071598 +sub_8071598: + push {r4-r6,lr} + adds r6, r0, 0 + lsls r2, 24 + lsrs r2, 24 + lsls r3, 24 + lsrs r3, 24 + ldr r5, [r6, 0x70] + ldr r4, [r1, 0x70] + cmp r6, r1 + bne _080715B0 + movs r0, 0 + b _08071670 +_080715B0: + ldrb r0, [r5, 0x8] + cmp r0, 0x1 + beq _08071606 + ldrb r0, [r4, 0x8] + cmp r0, 0x1 + beq _08071606 + adds r0, r5, 0 + adds r0, 0xA4 + ldrb r1, [r0] + cmp r1, 0x4 + beq _08071606 + adds r0, r4, 0 + adds r0, 0xA4 + ldrb r0, [r0] + cmp r0, 0x4 + beq _08071606 + cmp r1, 0x1 + beq _08071606 + cmp r0, 0x1 + beq _08071606 + cmp r3, 0 + beq _080715EC + ldrb r0, [r5, 0x6] + cmp r0, 0 + bne _080715EC + adds r0, r4, 0 + adds r0, 0xB0 + ldrb r0, [r0] + cmp r0, 0x6 + beq _08071606 +_080715EC: + cmp r2, 0 + bne _0807160A + adds r0, r4, 0 + adds r0, 0xE4 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0807160A + adds r0, r6, 0 + bl sub_8071884 + lsls r0, 24 + cmp r0, 0 + bne _0807160A +_08071606: + movs r0, 0x2 + b _08071670 +_0807160A: + movs r1, 0x80 + lsls r1, 1 + adds r0, r5, r1 + ldrb r0, [r0] + movs r6, 0 + cmp r0, 0 + beq _08071620 + movs r6, 0x2 + cmp r0, 0x1 + bne _08071620 + movs r6, 0x1 +_08071620: + ldrb r0, [r5, 0x8] + cmp r0, 0 + beq _08071630 + movs r5, 0 + cmp r0, 0x3 + bne _08071638 + movs r5, 0x1 + b _08071638 +_08071630: + ldrb r1, [r5, 0x6] + negs r0, r1 + orrs r0, r1 + lsrs r5, r0, 31 +_08071638: + ldrb r0, [r4, 0x8] + cmp r0, 0 + beq _08071648 + movs r1, 0 + cmp r0, 0x3 + bne _08071650 + movs r1, 0x1 + b _08071650 +_08071648: + ldrb r1, [r4, 0x6] + negs r0, r1 + orrs r0, r1 + lsrs r1, r0, 31 +_08071650: + movs r3, 0 + adds r0, r4, 0 + adds r0, 0xC8 + ldrb r0, [r0] + cmp r0, 0x2 + bne _0807165E + movs r3, 0x1 +_0807165E: + ldr r2, _08071678 + lsls r0, r1, 1 + adds r0, r3, r0 + lsls r1, r5, 2 + adds r0, r1 + lsls r1, r6, 3 + adds r0, r1 + adds r0, r2 + ldrb r0, [r0] +_08071670: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08071678: .4byte gUnknown_8106FE5 + thumb_func_end sub_8071598 + + thumb_func_start sub_807167C +sub_807167C: + push {lr} + ldr r2, [r0, 0x70] + ldr r1, [r1, 0x70] + adds r0, r2, 0 + adds r0, 0xA4 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080716D2 + adds r0, r2, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x4A + beq _0807169A + cmp r0, 0x47 + bne _0807169E +_0807169A: + movs r0, 0x1 + b _080716A0 +_0807169E: + movs r0, 0 +_080716A0: + cmp r0, 0 + bne _080716D2 + ldrb r0, [r2, 0x8] + cmp r0, 0 + bne _080716D2 + adds r0, r1, 0 + adds r0, 0xA4 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080716D2 + adds r0, r1, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x4A + beq _080716C2 + cmp r0, 0x47 + bne _080716C6 +_080716C2: + movs r0, 0x1 + b _080716C8 +_080716C6: + movs r0, 0 +_080716C8: + cmp r0, 0 + bne _080716D2 + ldrb r0, [r1, 0x8] + cmp r0, 0 + beq _080716D6 +_080716D2: + movs r0, 0x2 + b _080716E4 +_080716D6: + ldrb r0, [r2, 0x6] + ldrb r1, [r1, 0x6] + cmp r0, r1 + bne _080716E2 + movs r0, 0 + b _080716E4 +_080716E2: + movs r0, 0x1 +_080716E4: + pop {r1} + bx r1 + thumb_func_end sub_807167C + + thumb_func_start sub_80716E8 +sub_80716E8: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + lsls r2, 24 + lsrs r2, 24 + ldr r0, [r4, 0x70] + adds r0, 0xC4 + ldrb r0, [r0] + cmp r0, 0x2 + bne _08071720 + cmp r2, 0 + beq _08071714 + ldr r0, _08071718 + movs r2, 0 + bl sub_8045B94 + ldr r0, _0807171C + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08071714: + movs r0, 0x1 + b _08071722 + .align 2, 0 +_08071718: .4byte gUnknown_202DF98 +_0807171C: .4byte gUnknown_80FC2FC +_08071720: + movs r0, 0 +_08071722: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80716E8 + + thumb_func_start sub_8071728 +sub_8071728: + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + lsls r2, 24 + lsrs r2, 24 + adds r5, r2, 0 + ldr r0, [r4, 0x70] + adds r0, 0xC4 + ldrb r0, [r0] + cmp r0, 0xE + bne _08071758 + cmp r2, 0 + beq _0807178E + ldr r0, _08071750 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08071754 + b _08071784 + .align 2, 0 +_08071750: .4byte gUnknown_202DF98 +_08071754: .4byte gUnknown_80FC31C +_08071758: + adds r0, r4, 0 + movs r1, 0xF + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + bne _08071774 + adds r0, r4, 0 + movs r1, 0x18 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0807179C +_08071774: + cmp r5, 0 + beq _0807178E + ldr r0, _08071794 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08071798 +_08071784: + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_0807178E: + movs r0, 0x1 + b _0807179E + .align 2, 0 +_08071794: .4byte gUnknown_202DF98 +_08071798: .4byte gUnknown_80FCEFC +_0807179C: + movs r0, 0 +_0807179E: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8071728 + + thumb_func_start sub_80717A4 +sub_80717A4: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r8, r0 + lsls r1, 16 + lsrs r1, 16 + mov r9, r1 + ldr r6, [r0, 0x70] + adds r0, r6, 0 + adds r0, 0xA8 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080717CE + cmp r0, 0x5 + beq _080717CE + cmp r0, 0x3 + beq _080717CE + b _08071816 +_080717CA: + movs r0, 0x1 + b _08071818 +_080717CE: + movs r7, 0 + movs r0, 0x8C + lsls r0, 1 + adds r4, r6, r0 + adds r5, r4, 0 +_080717D8: + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0807180C + ldrb r0, [r6, 0x7] + cmp r0, 0 + bne _080717F0 + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0807180C +_080717F0: + mov r0, r8 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_805744C + lsls r0, 24 + cmp r0, 0 + beq _0807180C + ldrb r0, [r4, 0x4] + cmp r0, 0 + beq _0807180C + ldrh r0, [r4, 0x2] + cmp r0, r9 + beq _080717CA +_0807180C: + adds r4, 0x8 + adds r5, 0x8 + adds r7, 0x1 + cmp r7, 0x3 + ble _080717D8 +_08071816: + movs r0, 0 +_08071818: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80717A4 + + thumb_func_start sub_8071824 +sub_8071824: + push {r4,r5,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08071850 + ldr r1, [r4, 0x70] + adds r0, r1, 0 + adds r0, 0x5E + ldrb r0, [r0] + cmp r0, r5 + beq _0807184C + adds r0, r1, 0 + adds r0, 0x5F + ldrb r0, [r0] + cmp r0, r5 + bne _08071850 +_0807184C: + movs r0, 0x1 + b _08071852 +_08071850: + movs r0, 0 +_08071852: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8071824 + + thumb_func_start sub_8071858 +sub_8071858: + push {lr} + lsls r1, 24 + lsrs r1, 24 + adds r3, r1, 0 + ldr r0, [r0, 0x70] + adds r2, r0, 0 + cmp r1, 0 + beq _0807187A + adds r0, 0x5C + ldrb r0, [r0] + cmp r0, r1 + beq _0807187E + adds r0, r2, 0 + adds r0, 0x5D + ldrb r0, [r0] + cmp r0, r3 + beq _0807187E +_0807187A: + movs r0, 0 + b _08071880 +_0807187E: + movs r0, 0x1 +_08071880: + pop {r1} + bx r1 + thumb_func_end sub_8071858 + + thumb_func_start sub_8071884 +sub_8071884: + push {lr} + adds r1, r0, 0 + ldr r0, [r1, 0x70] + adds r0, 0xE8 + ldrb r0, [r0] + cmp r0, 0x3 + beq _080718A4 + adds r0, r1, 0 + movs r1, 0x1A + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + bne _080718A4 + movs r0, 0 + b _080718A6 +_080718A4: + movs r0, 0x1 +_080718A6: + pop {r1} + bx r1 + thumb_func_end sub_8071884 + + thumb_func_start sub_80718AC +sub_80718AC: + push {lr} + lsls r1, 24 + lsrs r1, 24 + ldr r2, [r0, 0x70] + ldrb r0, [r2, 0x7] + cmp r0, 0 + beq _080718C4 + movs r0, 0 + cmp r1, 0x1 + bne _080718D4 + movs r0, 0x1 + b _080718D4 +_080718C4: + movs r3, 0 + adds r0, r2, 0 + adds r0, 0x94 + ldrb r0, [r0] + cmp r0, r1 + bne _080718D2 + movs r3, 0x1 +_080718D2: + adds r0, r3, 0 +_080718D4: + pop {r1} + bx r1 + thumb_func_end sub_80718AC + + thumb_func_start sub_80718D8 +sub_80718D8: + push {lr} + lsls r2, r1, 24 + lsrs r2, 24 + ldr r0, [r0, 0x70] + adds r0, 0x90 + movs r1, 0x1 + lsls r1, r2 + bl sub_808ECD0 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_80718D8 + + thumb_func_start sub_80718F4 +sub_80718F4: + push {r4,lr} + adds r4, r1, 0 + lsls r4, 24 + lsrs r4, 24 + lsls r2, 24 + lsrs r2, 24 + ldr r0, [r0, 0x70] + adds r0, 0x90 + movs r3, 0x1 + adds r1, r3, 0 + lsls r1, r4 + lsls r3, r2 + orrs r1, r3 + bl sub_808ECD0 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80718F4 + + thumb_func_start sub_807191C +sub_807191C: + push {r4-r6,lr} + ldr r5, [r0, 0x70] + ldrb r1, [r5, 0x6] + cmp r1, 0 + beq _08071978 + adds r4, r5, 0 + adds r4, 0x90 + adds r0, r4, 0 + movs r1, 0x8 + bl sub_808EC30 + adds r0, r4, 0 + movs r1, 0x6 + bl sub_808EC30 + adds r0, r4, 0 + movs r1, 0x2 + bl sub_808EC30 + adds r0, r5, 0 + adds r0, 0xF7 + ldrb r0, [r0] + cmp r0, 0 + beq _08071954 + adds r0, r4, 0 + movs r1, 0x12 + bl sub_808EC30 +_08071954: + ldrb r0, [r5, 0x9] + ldr r1, _08071974 + movs r2, 0 + ldrsh r1, [r1, r2] + cmp r0, r1 + blt _08071968 + adds r0, r4, 0 + movs r1, 0x16 + bl sub_808EC30 +_08071968: + adds r1, r5, 0 + adds r1, 0x94 + movs r0, 0x2 + strb r0, [r1] + b _080719BE + .align 2, 0 +_08071974: .4byte gUnknown_80F59C4 +_08071978: + adds r0, r5, 0 + adds r0, 0x90 + strb r1, [r0] + adds r2, r5, 0 + adds r2, 0x91 + strb r1, [r2] + adds r2, 0x1 + strb r1, [r2] + movs r4, 0x1 + adds r6, r0, 0 +_0807198C: + movs r1, 0xC + ldrsh r0, [r5, r1] + lsls r1, r4, 24 + lsrs r1, 24 + bl sub_808EB7C + lsls r0, 24 + cmp r0, 0 + beq _080719B8 + movs r1, 0x1 + lsls r1, r4 + adds r0, r5, 0 + adds r0, 0x8C + bl sub_808ECD0 + lsls r0, 24 + cmp r0, 0 + beq _080719B8 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_808EC30 +_080719B8: + adds r4, 0x1 + cmp r4, 0x17 + ble _0807198C +_080719BE: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_807191C + + thumb_func_start sub_80719C4 +sub_80719C4: + push {r4-r6,lr} + adds r5, r0, 0 + ldr r0, [r5, 0x70] + ldrb r0, [r0, 0x6] + cmp r0, 0 + beq _080719D6 + b _08071A0A +_080719D2: + movs r0, 0x1 + b _08071A0C +_080719D6: + movs r6, 0 +_080719D8: + ldr r0, _08071A14 + ldr r0, [r0] + lsls r1, r6, 2 + ldr r2, _08071A18 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08071A04 + cmp r5, r4 + beq _08071A04 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8045990 + lsls r0, 24 + cmp r0, 0 + bne _080719D2 +_08071A04: + adds r6, 0x1 + cmp r6, 0x3 + ble _080719D8 +_08071A0A: + movs r0, 0 +_08071A0C: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08071A14: .4byte gUnknown_203B418 +_08071A18: .4byte 0x0001357c + thumb_func_end sub_80719C4 + + thumb_func_start sub_8071A1C +sub_8071A1C: + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + ldrh r1, [r2, 0x2] + movs r0, 0xA2 + lsls r0, 1 + cmp r1, r0 + beq _08071A38 + adds r0, r2, 0 + bl sub_8092B00 + lsls r0, 24 + lsrs r0, 24 + b _08071A3E +_08071A38: + ldr r0, [r3, 0x70] + adds r0, 0x3E + ldrb r0, [r0] +_08071A3E: + pop {r1} + bx r1 + thumb_func_end sub_8071A1C + + thumb_func_start sub_8071A44 +sub_8071A44: + push {r4,lr} + adds r2, r0, 0 + adds r4, r1, 0 + ldrh r1, [r4, 0x2] + movs r0, 0xA2 + lsls r0, 1 + cmp r1, r0 + beq _08071A60 + adds r0, r4, 0 + bl sub_8092BC0 + ldrb r1, [r4, 0x5] + adds r0, r1 + b _08071A6A +_08071A60: + ldr r0, [r2, 0x70] + movs r1, 0x3C + ldrsh r0, [r0, r1] + ldrb r4, [r4, 0x5] + adds r0, r4 +_08071A6A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8071A44 + + thumb_func_start sub_8071A70 +sub_8071A70: + push {lr} + movs r1, 0x2 + ldrsh r0, [r0, r1] + bl sub_808DBD8 + lsls r0, 24 + cmp r0, 0 + beq _08071A84 + movs r0, 0x1 + b _08071A86 +_08071A84: + movs r0, 0 +_08071A86: + pop {r1} + bx r1 + thumb_func_end sub_8071A70 + + thumb_func_start sub_8071A8C +sub_8071A8C: + push {r4,lr} + adds r4, r0, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08071AC2 + ldr r1, [r4, 0x70] + adds r0, r1, 0 + adds r0, 0xA4 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08071AC2 + adds r0, r1, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x4A + beq _08071AB4 + cmp r0, 0x47 + bne _08071AB8 +_08071AB4: + movs r0, 0x1 + b _08071ABA +_08071AB8: + movs r0, 0 +_08071ABA: + cmp r0, 0 + bne _08071AC2 + movs r0, 0x1 + b _08071AC4 +_08071AC2: + movs r0, 0 +_08071AC4: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8071A8C + + thumb_func_start sub_8071ACC +sub_8071ACC: + push {r4,r5,lr} + adds r3, r0, 0 + lsls r1, 16 + lsrs r4, r1, 16 + lsls r2, 24 + lsrs r5, r2, 24 + movs r1, 0xA7 + lsls r1, 1 + adds r0, r3, r1 + ldrh r0, [r0] + ands r0, r4 + cmp r0, 0 + beq _08071AF6 + movs r0, 0xA8 + lsls r0, 1 + adds r2, r3, r0 + ldrh r1, [r2] + adds r0, r4, 0 + orrs r0, r1 + strh r0, [r2] + b _08071B02 +_08071AF6: + movs r0, 0xA8 + lsls r0, 1 + adds r1, r3, r0 + ldrh r0, [r1] + bics r0, r4 + strh r0, [r1] +_08071B02: + cmp r5, 0 + beq _08071B16 + movs r1, 0xA7 + lsls r1, 1 + adds r2, r3, r1 + ldrh r1, [r2] + adds r0, r4, 0 + orrs r0, r1 + strh r0, [r2] + b _08071B22 +_08071B16: + movs r0, 0xA7 + lsls r0, 1 + adds r1, r3, r0 + ldrh r0, [r1] + bics r0, r4 + strh r0, [r1] +_08071B22: + movs r1, 0xA8 + lsls r1, 1 + adds r0, r3, r1 + ldrh r0, [r0] + ands r0, r4 + cmp r0, 0 + bne _08071B40 + subs r1, 0x2 + adds r0, r3, r1 + ldrh r0, [r0] + ands r0, r4 + cmp r0, 0 + beq _08071B40 + movs r0, 0x1 + b _08071B42 +_08071B40: + movs r0, 0 +_08071B42: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8071ACC + + thumb_func_start sub_8071B48 +sub_8071B48: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + movs r0, 0 + mov r8, r0 + ldr r0, _08071B94 + ldr r6, [r0] + ldr r1, _08071B98 + adds r0, r6, r1 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + bne _08071B66 + b _08071D3E +_08071B66: + subs r1, 0x20 + adds r0, r6, r1 + ldrb r0, [r0] + cmp r0, 0x15 + bne _08071B7C + ldr r2, _08071B9C + adds r0, r6, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _08071B7C + b _08071D3E +_08071B7C: + ldr r0, _08071BA0 + adds r1, r6, r0 + ldrh r0, [r1] + adds r2, r0, 0x1 + strh r2, [r1] + ldr r1, _08071BA4 + adds r0, r6, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _08071BAC + ldr r0, _08071BA8 + b _08071BAE + .align 2, 0 +_08071B94: .4byte gUnknown_203B418 +_08071B98: .4byte 0x00000664 +_08071B9C: .4byte 0x000037fd +_08071BA0: .4byte 0x00000662 +_08071BA4: .4byte 0x0000066e +_08071BA8: .4byte gUnknown_80F4DAA +_08071BAC: + ldr r0, _08071C60 +_08071BAE: + lsls r1, r2, 16 + asrs r1, 16 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r1, r0 + bge _08071BBC + b _08071D3E +_08071BBC: + ldr r1, _08071C64 + adds r0, r6, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0xE1 + lsls r0, 2 + cmp r1, r0 + ble _08071BF6 + ldr r1, _08071C68 + adds r0, r6, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08071BF6 + ldrh r0, [r4, 0x26] + ldr r2, _08071C6C + adds r1, r6, r2 + ldr r1, [r1] + cmp r0, r1 + bne _08071BF6 + ldr r0, _08071C70 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + mov r8, r4 +_08071BF6: + ldr r1, _08071C64 + adds r0, r6, r1 + movs r1, 0 + strh r1, [r0] + ldr r2, _08071C68 + adds r0, r6, r2 + str r1, [r0] + movs r7, 0 + movs r5, 0 +_08071C08: + lsls r0, r5, 2 + ldr r2, _08071C74 + adds r1, r6, r2 + adds r1, r0 + ldr r4, [r1] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08071C3A + movs r1, 0x4 + ldrsh r0, [r4, r1] + movs r2, 0x6 + ldrsh r1, [r4, r2] + bl sub_804954C + ldrh r0, [r0] + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _08071C3A + adds r7, 0x1 +_08071C3A: + adds r5, 0x1 + cmp r5, 0xF + ble _08071C08 + ldr r1, _08071C78 + adds r0, r6, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _08071C92 + ldr r0, _08071C7C + ldr r0, [r0] + ldr r2, _08071C80 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0xFF + bne _08071C88 + ldr r0, _08071C84 + movs r1, 0 + ldrsh r0, [r0, r1] + b _08071C8E + .align 2, 0 +_08071C60: .4byte gUnknown_80F4DAC +_08071C64: .4byte 0x00000662 +_08071C68: .4byte 0x00017b34 +_08071C6C: .4byte 0x00017b40 +_08071C70: .4byte gUnknown_202DF98 +_08071C74: .4byte 0x0001358c +_08071C78: .4byte 0x0000066e +_08071C7C: .4byte gUnknown_203B418 +_08071C80: .4byte 0x00003a0c +_08071C84: .4byte gUnknown_80F4DA6 +_08071C88: + ldr r0, _08071CB8 + movs r2, 0 + ldrsh r0, [r0, r2] +_08071C8E: + cmp r7, r0 + bge _08071D3E +_08071C92: + mov r0, r8 + cmp r0, 0 + beq _08071CA8 + ldr r0, _08071CBC + ldr r1, [r0] + movs r0, 0 + bl sub_805239C + mov r0, r8 + bl sub_8042920 +_08071CA8: + ldr r1, _08071CC0 + adds r0, r6, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08071CC4 + movs r5, 0xBE + lsls r5, 1 + b _08071CCE + .align 2, 0 +_08071CB8: .4byte gUnknown_80F4DA8 +_08071CBC: .4byte gUnknown_80FED68 +_08071CC0: .4byte 0x0000066e +_08071CC4: + movs r0, 0 + bl sub_803D970 + lsls r0, 16 + asrs r5, r0, 16 +_08071CCE: + adds r0, r5, 0 + bl sub_803DA20 + adds r4, r0, 0 + cmp r4, 0 + bne _08071CDC + movs r4, 0x1 +_08071CDC: + adds r0, r5, 0 + movs r1, 0 + bl sub_806AA0C + lsls r0, 24 + cmp r0, 0 + beq _08071D3E + add r0, sp, 0xC + bl sub_8083660 + lsls r0, 24 + cmp r0, 0 + beq _08071D3E + mov r0, sp + movs r1, 0 + strh r5, [r0] + strh r4, [r0, 0x8] + strb r1, [r0, 0x2] + movs r0, 0x64 + bl sub_8084100 + adds r4, r0, 0 + ldr r0, _08071D24 + ldr r0, [r0] + ldr r2, _08071D28 + adds r0, r2 + ldrb r0, [r0] + bl sub_8090168 + lsls r0, 16 + asrs r0, 16 + cmp r4, r0 + bge _08071D2C + movs r0, 0x1 + b _08071D2E + .align 2, 0 +_08071D24: .4byte gUnknown_203B418 +_08071D28: .4byte 0x00000644 +_08071D2C: + movs r0, 0 +_08071D2E: + str r0, [sp, 0x4] + mov r1, sp + movs r0, 0 + strb r0, [r1, 0x10] + mov r0, sp + movs r1, 0 + bl sub_806B7F8 +_08071D3E: + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8071B48 + + thumb_func_start sub_8071D4C +sub_8071D4C: + push {lr} + ldr r3, [r1, 0x70] + ldrb r0, [r3, 0x9] + cmp r0, 0x64 + beq _08071D94 + adds r0, r3, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x4A + beq _08071D64 + cmp r0, 0x47 + bne _08071D68 +_08071D64: + movs r0, 0x1 + b _08071D6A +_08071D68: + movs r0, 0 +_08071D6A: + cmp r0, 0 + bne _08071D94 + ldr r1, [r3, 0x18] + adds r2, r1, r2 + ldr r0, _08071D98 + cmp r2, r0 + ble _08071D7A + ldr r2, _08071D9C +_08071D7A: + subs r2, r1 + cmp r2, 0 + beq _08071D94 + movs r0, 0xFE + lsls r0, 1 + adds r1, r3, r0 + ldr r0, [r1] + adds r0, r2 + str r0, [r1] + ldr r0, _08071DA0 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0xD] +_08071D94: + pop {r0} + bx r0 + .align 2, 0 +_08071D98: .4byte 0x0098967e +_08071D9C: .4byte 0x0098967f +_08071DA0: .4byte gUnknown_203B418 + thumb_func_end sub_8071D4C + + thumb_func_start sub_8071DA4 +sub_8071DA4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xD4 + str r0, [sp, 0xB4] + ldr r2, _08071E44 + ldr r1, [r2] + ldrb r0, [r1, 0xD] + cmp r0, 0 + bne _08071DBE + b _08071FE2 +_08071DBE: + movs r0, 0 + strb r0, [r1, 0xD] + ldr r0, [r2] + ldrb r0, [r0, 0x10] + cmp r0, 0 + beq _08071DCC + b _08071FE2 +_08071DCC: + ldr r0, [sp, 0xB4] + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08071DE2 + mov r0, sp + bl sub_80457DC + mov r0, sp + str r0, [sp, 0xB4] +_08071DE2: + movs r4, 0 +_08071DE4: + movs r5, 0 + ldr r0, _08071E44 + ldr r0, [r0] + lsls r1, r4, 2 + ldr r2, _08071E48 + adds r0, r2 + adds r0, r1 + ldr r0, [r0] + mov r8, r0 + movs r0, 0 + str r0, [sp, 0xB8] + movs r1, 0 + movs r2, 0 + str r1, [sp, 0xBC] + str r2, [sp, 0xC0] + movs r0, 0 + movs r1, 0 + str r0, [sp, 0xC4] + str r1, [sp, 0xC8] + adds r1, r4, 0x1 + str r1, [sp, 0xCC] + mov r2, r8 + cmp r2, 0 + bne _08071E16 + b _08071FDA +_08071E16: + mov r0, r8 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08071E24 + b _08071FDA +_08071E24: + mov r0, r8 + ldr r6, [r0, 0x70] + movs r1, 0xE + ldrsh r0, [r6, r1] + cmp r0, 0 + bne _08071E32 + b _08071FDA +_08071E32: + adds r1, r6, 0 + adds r1, 0xF9 + ldrb r0, [r1] + cmp r0, 0 + beq _08071E4C + add r2, sp, 0xB8 + ldrb r2, [r2] + strb r2, [r1] + b _08071FCA + .align 2, 0 +_08071E44: .4byte gUnknown_203B418 +_08071E48: .4byte 0x000135cc +_08071E4C: + movs r1, 0xFE + lsls r1, 1 + adds r0, r6, r1 + ldr r0, [r0] + mov r10, r0 + cmp r0, 0 + beq _08071EB6 + ldrb r0, [r6, 0x7] + cmp r0, 0 + beq _08071E68 + ldrb r1, [r6, 0x9] + add r0, sp, 0x74 + bl sub_808EB48 +_08071E68: + movs r0, 0x10 + ldrsh r2, [r6, r0] + str r2, [sp, 0xB8] + ldrb r1, [r6, 0x14] + str r1, [sp, 0xBC] + ldrb r2, [r6, 0x15] + str r2, [sp, 0xC0] + ldrb r0, [r6, 0x16] + str r0, [sp, 0xC4] + ldrb r1, [r6, 0x17] + str r1, [sp, 0xC8] + ldrb r0, [r6, 0x9] + cmp r0, 0x64 + beq _08071EB6 + ldr r0, [r6, 0x18] + add r0, r10 + str r0, [r6, 0x18] + mov r2, r10 + ldr r0, _08071EE8 + str r2, [r0] + ldr r0, _08071EEC + adds r1, r6, 0 + movs r2, 0 + bl sub_80708B4 + ldr r0, _08071EF0 + ldr r2, [r0] + ldr r0, [sp, 0xB4] + mov r1, r8 + bl sub_80522F4 + ldr r0, [sp, 0xB4] + mov r1, r8 + movs r2, 0x1 + movs r3, 0x1 + bl sub_80723D0 + lsls r0, 24 + lsrs r5, r0, 24 +_08071EB6: + ldr r1, _08071EF4 + adds r0, r6, r1 + ldrb r0, [r0] + adds r4, 0x1 + str r4, [sp, 0xCC] + cmp r0, 0 + beq _08071F3A + movs r2, 0x2 + ldrsh r0, [r6, r2] + add r1, sp, 0x8C + movs r2, 0 + movs r3, 0 + bl sub_808E400 + adds r7, r0, 0 + add r0, sp, 0x8C + mov r9, r0 + cmp r7, 0 + beq _08071F38 + adds r0, r7, 0 + bl sub_8084100 + adds r4, r0, 0 + movs r1, 0 + b _08071F02 + .align 2, 0 +_08071EE8: .4byte gUnknown_202DE30 +_08071EEC: .4byte gUnknown_202DF98 +_08071EF0: .4byte gUnknown_80F9E64 +_08071EF4: .4byte 0x00000149 +_08071EF8: + adds r4, 0x1 + cmp r4, r7 + blt _08071F00 + movs r4, 0 +_08071F00: + adds r1, 0x1 +_08071F02: + cmp r1, r7 + bge _08071F38 + lsls r0, r4, 1 + mov r2, r9 + adds r5, r2, r0 + movs r2, 0 + ldrsh r0, [r5, r2] + str r1, [sp, 0xD0] + bl sub_803D930 + lsls r0, 24 + ldr r1, [sp, 0xD0] + cmp r0, 0 + beq _08071EF8 + movs r2, 0 + ldrsh r0, [r5, r2] + bl sub_80687D0 + ldr r1, [sp, 0xD0] + cmp r0, 0 + beq _08071EF8 + movs r0, 0 + ldrsh r2, [r5, r0] + ldr r0, [sp, 0xB4] + mov r1, r8 + bl sub_8072B78 +_08071F38: + movs r5, 0 +_08071F3A: + cmp r5, 0 + beq _08071F7A + ldrb r0, [r6, 0x6] + cmp r0, 0 + bne _08071F7A + movs r1, 0x10 + ldrsh r0, [r6, r1] + ldr r2, [sp, 0xB8] + subs r0, r2 + ldr r1, _08071FF4 + str r0, [r1] + ldrb r0, [r6, 0x14] + ldr r2, [sp, 0xBC] + subs r0, r2 + str r0, [r1, 0x4] + ldrb r0, [r6, 0x16] + ldr r1, [sp, 0xC4] + subs r0, r1 + ldr r2, _08071FF4 + str r0, [r2, 0x8] + ldrb r0, [r6, 0x15] + ldr r1, [sp, 0xC0] + subs r0, r1 + str r0, [r2, 0xC] + ldrb r0, [r6, 0x17] + ldr r2, [sp, 0xC8] + subs r0, r2 + ldr r1, _08071FF4 + str r0, [r1, 0x10] + mov r0, r8 + bl sub_807218C +_08071F7A: + mov r2, r10 + cmp r2, 0 + beq _08071FCA + ldrb r0, [r6, 0x7] + cmp r0, 0 + beq _08071FCA + ldrb r1, [r6, 0x9] + add r0, sp, 0x80 + bl sub_808EB48 + movs r4, 0 + add r7, sp, 0x74 + add r5, sp, 0x80 +_08071F94: + adds r0, r7, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _08071FC4 + adds r0, r5, r4 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08071FC4 + ldr r0, _08071FF8 + mov r1, r8 + movs r2, 0 + bl sub_8045B94 + lsls r1, r4, 24 + lsrs r1, 24 + ldr r0, _08071FFC + bl sub_808EAC0 + ldr r0, _08072000 + ldr r2, [r0] + ldr r0, [sp, 0xB4] + mov r1, r8 + bl sub_80522F4 +_08071FC4: + adds r4, 0x1 + cmp r4, 0xB + ble _08071F94 +_08071FCA: + movs r1, 0xFE + lsls r1, 1 + adds r0, r6, r1 + movs r1, 0 + str r1, [r0] + ldr r2, _08072004 + adds r0, r6, r2 + strb r1, [r0] +_08071FDA: + ldr r4, [sp, 0xCC] + cmp r4, 0x13 + bgt _08071FE2 + b _08071DE4 +_08071FE2: + add sp, 0xD4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08071FF4: .4byte gUnknown_202DE30 +_08071FF8: .4byte gUnknown_202DF98 +_08071FFC: .4byte gUnknown_202DE58 +_08072000: .4byte gUnknown_80FF730 +_08072004: .4byte 0x00000149 + thumb_func_end sub_8071DA4 + + thumb_func_start sub_8072008 +sub_8072008: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x38 + mov r9, r0 + mov r8, r1 + adds r4, r2, 0 + ldr r0, [sp, 0x58] + lsls r3, 24 + lsrs r3, 24 + mov r10, r3 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x24] + mov r0, r8 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08072036 + b _08072162 +_08072036: + movs r0, 0 + str r0, [sp, 0x28] + mov r1, r8 + ldr r5, [r1, 0x70] + ldrb r0, [r5, 0x7] + cmp r0, 0 + beq _0807204C + add r0, sp, 0xC + ldrb r1, [r5, 0x9] + bl sub_808EB48 +_0807204C: + movs r0, 0x10 + ldrsh r2, [r5, r0] + str r2, [sp, 0x2C] + ldrb r6, [r5, 0x14] + ldrb r7, [r5, 0x15] + ldrb r1, [r5, 0x16] + str r1, [sp, 0x30] + ldrb r2, [r5, 0x17] + str r2, [sp, 0x34] + adds r0, r5, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x4A + beq _0807206C + cmp r0, 0x47 + bne _08072070 +_0807206C: + movs r0, 0x1 + b _08072072 +_08072070: + movs r0, 0 +_08072072: + cmp r0, 0 + bne _080720E6 + ldrb r0, [r5, 0x9] + adds r2, r0, r4 + cmp r2, 0x63 + ble _08072080 + movs r2, 0x64 +_08072080: + cmp r2, r0 + beq _080720E6 + movs r0, 0x2 + ldrsh r1, [r5, r0] + mov r0, sp + bl sub_808E010 + ldr r0, [sp] + str r0, [r5, 0x18] + mov r0, r9 + mov r1, r8 + mov r2, r10 + ldr r3, [sp, 0x24] + bl sub_80723D0 + ldr r1, [sp, 0x28] + orrs r1, r0 + lsls r0, r1, 24 + lsrs r0, 24 + str r0, [sp, 0x28] + cmp r0, 0 + beq _080720E6 + ldrb r0, [r5, 0x6] + cmp r0, 0 + bne _080720E6 + ldr r1, _08072174 + movs r2, 0x10 + ldrsh r0, [r5, r2] + ldr r2, [sp, 0x2C] + subs r0, r2 + str r0, [r1] + ldrb r0, [r5, 0x14] + subs r0, r6 + str r0, [r1, 0x4] + ldrb r0, [r5, 0x16] + ldr r2, [sp, 0x30] + subs r0, r2 + str r0, [r1, 0x8] + ldrb r0, [r5, 0x15] + subs r0, r7 + str r0, [r1, 0xC] + ldrb r0, [r5, 0x17] + ldr r2, [sp, 0x34] + subs r0, r2 + str r0, [r1, 0x10] + mov r0, r10 + cmp r0, 0 + beq _080720E6 + mov r0, r8 + bl sub_807218C +_080720E6: + ldrb r0, [r5, 0x7] + cmp r0, 0 + beq _08072130 + add r4, sp, 0x18 + ldrb r1, [r5, 0x9] + adds r0, r4, 0 + bl sub_808EB48 + movs r6, 0 + add r7, sp, 0xC +_080720FA: + adds r0, r7, r6 + ldrb r0, [r0] + cmp r0, 0 + bne _0807212A + adds r0, r4, r6 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0807212A + ldr r0, _08072178 + mov r1, r8 + movs r2, 0 + bl sub_8045B94 + lsls r1, r6, 24 + lsrs r1, 24 + ldr r0, _0807217C + bl sub_808EAC0 + ldr r0, _08072180 + ldr r2, [r0] + mov r0, r9 + mov r1, r8 + bl sub_80522F4 +_0807212A: + adds r6, 0x1 + cmp r6, 0xB + ble _080720FA +_08072130: + movs r1, 0xFE + lsls r1, 1 + adds r0, r5, r1 + movs r1, 0 + str r1, [r0] + ldr r2, _08072184 + adds r0, r5, r2 + strb r1, [r0] + ldr r0, [sp, 0x28] + cmp r0, 0 + bne _08072162 + mov r1, r10 + cmp r1, 0 + beq _08072162 + ldr r0, _08072178 + mov r1, r8 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08072188 + ldr r2, [r0] + mov r0, r9 + mov r1, r8 + bl sub_80522F4 +_08072162: + add sp, 0x38 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08072174: .4byte gUnknown_202DE30 +_08072178: .4byte gUnknown_202DF98 +_0807217C: .4byte gUnknown_202DE58 +_08072180: .4byte gUnknown_80FF730 +_08072184: .4byte 0x00000149 +_08072188: .4byte gUnknown_80F9B74 + thumb_func_end sub_8072008 + + thumb_func_start sub_807218C +sub_807218C: + push {r4-r6,lr} + sub sp, 0x190 + adds r4, r0, 0 + movs r6, 0 + ldr r5, [r4, 0x70] + movs r1, 0 + bl sub_806A2BC + ldr r0, _080721C8 + adds r1, r5, 0 + movs r2, 0 + bl sub_80708B4 + adds r0, r4, 0 + bl sub_8070BC0 + lsls r0, 24 + cmp r0, 0 + beq _08072200 + movs r3, 0 + movs r0, 0x2 + ldrsh r1, [r5, r0] + adds r0, r5, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x4A + bne _080721CC + movs r1, 0xD2 + lsls r1, 1 + b _080721EC + .align 2, 0 +_080721C8: .4byte gUnknown_202DF98 +_080721CC: + cmp r0, 0x47 + bne _080721D8 + ldr r1, _080721D4 + b _080721EC + .align 2, 0 +_080721D4: .4byte 0x000001a5 +_080721D8: + cmp r0, 0x41 + bne _080721EC + ldr r0, _080721F8 + ldr r0, [r0] + ldr r2, _080721FC + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080721EC + movs r3, 0x1 +_080721EC: + mov r0, sp + movs r2, 0x3 + bl sub_806A3D4 + b _0807220A + .align 2, 0 +_080721F8: .4byte gUnknown_203B418 +_080721FC: .4byte 0x0000065c +_08072200: + ldr r0, _08072308 + ldr r1, [r0] + mov r0, sp + bl strcpy +_0807220A: + movs r0, 0 + mov r1, sp + movs r2, 0x1 + bl sub_80527C4 + mov r0, sp + movs r1, 0 + strb r1, [r0] + ldr r4, _0807230C + ldr r0, [r4] + cmp r0, 0 + ble _0807222E + ldr r0, _08072310 + ldr r1, [r0] + mov r0, sp + bl strcat + adds r6, 0x1 +_0807222E: + ldr r0, [r4, 0x4] + cmp r0, 0 + ble _0807225A + ldr r0, _08072314 + adds r1, r6, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _0807224E + ldr r0, _08072318 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r0 + ldr r1, [r1] + mov r0, sp + bl strcat +_0807224E: + ldr r0, _0807231C + ldr r1, [r0] + mov r0, sp + bl strcat + adds r6, 0x1 +_0807225A: + ldr r0, _0807230C + ldr r0, [r0, 0x8] + cmp r0, 0 + ble _08072288 + ldr r0, _08072314 + adds r1, r6, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _0807227C + ldr r0, _08072318 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r0 + ldr r1, [r1] + mov r0, sp + bl strcat +_0807227C: + ldr r0, _08072320 + ldr r1, [r0] + mov r0, sp + bl strcat + adds r6, 0x1 +_08072288: + ldr r0, _0807230C + ldr r0, [r0, 0xC] + cmp r0, 0 + ble _080722B6 + ldr r0, _08072314 + adds r1, r6, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _080722AA + ldr r0, _08072318 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r0 + ldr r1, [r1] + mov r0, sp + bl strcat +_080722AA: + ldr r0, _08072324 + ldr r1, [r0] + mov r0, sp + bl strcat + adds r6, 0x1 +_080722B6: + ldr r0, _0807230C + ldr r0, [r0, 0x10] + cmp r0, 0 + ble _080722E2 + ldr r0, _08072314 + adds r1, r6, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _080722D8 + ldr r0, _08072318 + ldrb r1, [r1] + lsls r1, 2 + adds r1, r0 + ldr r1, [r1] + mov r0, sp + bl strcat +_080722D8: + ldr r0, _08072328 + ldr r1, [r0] + mov r0, sp + bl strcat +_080722E2: + mov r0, sp + ldrb r0, [r0] + cmp r0, 0 + beq _080722F4 + movs r0, 0 + mov r1, sp + movs r2, 0x1 + bl sub_80527C4 +_080722F4: + bl sub_8083600 + movs r1, 0 + bl sub_806A2BC + add sp, 0x190 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08072308: .4byte gUnknown_80FCF18 +_0807230C: .4byte gUnknown_202DE30 +_08072310: .4byte gUnknown_80F9ACC +_08072314: .4byte gUnknown_8107010 +_08072318: .4byte gUnknown_8107018 +_0807231C: .4byte gUnknown_80F9AEC +_08072320: .4byte gUnknown_80F9B10 +_08072324: .4byte gUnknown_80F9B34 +_08072328: .4byte gUnknown_80F9B58 + thumb_func_end sub_807218C + + thumb_func_start sub_807232C +sub_807232C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + mov r8, r0 + adds r5, r1, 0 + adds r7, r2, 0 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080723B6 + movs r6, 0 + ldr r4, [r5, 0x70] + adds r0, r4, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x4A + beq _08072358 + cmp r0, 0x47 + bne _0807235C +_08072358: + movs r0, 0x1 + b _0807235E +_0807235C: + movs r0, 0 +_0807235E: + cmp r0, 0 + bne _0807238C + ldrb r0, [r4, 0x9] + subs r2, r0, r7 + cmp r2, 0 + bgt _0807236C + movs r2, 0x1 +_0807236C: + cmp r2, r0 + beq _0807238C + movs r0, 0x2 + ldrsh r1, [r4, r0] + mov r0, sp + bl sub_808E010 + ldr r0, [sp] + str r0, [r4, 0x18] + mov r0, r8 + adds r1, r5, 0 + bl sub_80725A4 + orrs r6, r0 + lsls r0, r6, 24 + lsrs r6, r0, 24 +_0807238C: + movs r1, 0xFE + lsls r1, 1 + adds r0, r4, r1 + movs r1, 0 + str r1, [r0] + ldr r2, _080723C4 + adds r0, r4, r2 + strb r1, [r0] + cmp r6, 0 + bne _080723B6 + ldr r0, _080723C8 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _080723CC + ldr r2, [r0] + mov r0, r8 + adds r1, r5, 0 + bl sub_80522F4 +_080723B6: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080723C4: .4byte 0x00000149 +_080723C8: .4byte gUnknown_202DF98 +_080723CC: .4byte gUnknown_80F9B94 + thumb_func_end sub_807232C + + thumb_func_start sub_80723D0 +sub_80723D0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + str r0, [sp, 0xC] + mov r10, r1 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x10] + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x14] + movs r0, 0 + str r0, [sp, 0x18] + mov r0, r10 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08072422 + mov r1, r10 + ldr r5, [r1, 0x70] + movs r0, 0x2 + ldrsh r3, [r5, r0] + str r3, [sp, 0x1C] + ldr r1, [r5, 0x18] + str r1, [sp, 0x20] + adds r0, r5, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x4A + beq _08072418 + cmp r0, 0x47 + bne _0807241C +_08072418: + movs r0, 0x1 + b _0807241E +_0807241C: + movs r0, 0 +_0807241E: + cmp r0, 0 + beq _08072426 +_08072422: + movs r0, 0 + b _08072576 +_08072426: + ldrb r0, [r5, 0x9] + adds r0, 0x1 + mov r8, r0 + mov r9, sp + b _0807255A +_08072430: + mov r3, r8 + strb r3, [r5, 0x9] + ldr r0, [sp, 0x20] + str r0, [r5, 0x18] + ldr r1, [sp, 0x10] + cmp r1, 0 + beq _080724A4 + ldrb r0, [r5, 0x6] + cmp r0, 0 + bne _08072480 + mov r0, r10 + movs r1, 0 + bl sub_806A2BC + ldr r3, [sp, 0x18] + cmp r3, 0 + bne _08072456 + bl sub_8083D58 +_08072456: + ldr r0, _08072474 + mov r1, r8 + str r1, [r0] + ldr r0, _08072478 + adds r1, r5, 0 + movs r2, 0 + bl sub_80708B4 + ldr r0, _0807247C + ldr r1, [r0] + mov r0, r10 + bl sub_80528F4 + b _080724A4 + .align 2, 0 +_08072474: .4byte gUnknown_202DE30 +_08072478: .4byte gUnknown_202DF98 +_0807247C: .4byte gUnknown_80F9E80 +_08072480: + ldr r3, [sp, 0x18] + cmp r3, 0 + bne _0807248A + bl sub_8083D58 +_0807248A: + ldr r0, _08072588 + mov r1, r8 + str r1, [r0] + ldr r0, _0807258C + adds r1, r5, 0 + movs r2, 0 + bl sub_80708B4 + ldr r0, _08072590 + ldr r1, [r0] + mov r0, r10 + bl sub_805239C +_080724A4: + movs r3, 0x1 + str r3, [sp, 0x18] + mov r1, r9 + ldrh r0, [r1, 0x4] + ldrh r3, [r5, 0x10] + adds r0, r3 + movs r2, 0 + strh r0, [r5, 0x10] + ldrh r1, [r1, 0x4] + ldrh r3, [r5, 0xE] + adds r1, r3 + strh r1, [r5, 0xE] + lsls r0, 16 + ldr r1, _08072594 + cmp r0, r1 + ble _080724C8 + ldr r0, _08072598 + strh r0, [r5, 0x10] +_080724C8: + movs r0, 0xE + ldrsh r1, [r5, r0] + ldrh r2, [r5, 0x10] + movs r3, 0x10 + ldrsh r0, [r5, r3] + cmp r1, r0 + blt _080724D8 + strh r2, [r5, 0xE] +_080724D8: + ldr r7, _0807259C + ldrb r4, [r5, 0x14] + str r4, [r7] + ldrb r1, [r5, 0x15] + str r1, [r7, 0x4] + ldr r6, _080725A0 + ldrb r2, [r5, 0x16] + str r2, [r6] + ldrb r0, [r5, 0x17] + mov r12, r0 + mov r3, r9 + ldrb r0, [r3, 0x6] + adds r4, r0 + str r4, [r7] + ldrb r0, [r3, 0x7] + adds r1, r0 + str r1, [r7, 0x4] + ldrb r0, [r3, 0x8] + adds r2, r0 + str r2, [r6] + ldrb r0, [r3, 0x9] + mov r1, r12 + adds r3, r1, r0 + str r3, [r6, 0x4] + cmp r4, 0xFE + ble _08072510 + movs r3, 0xFF + str r3, [r7] +_08072510: + ldr r0, [r7, 0x4] + cmp r0, 0xFE + ble _0807251A + movs r0, 0xFF + str r0, [r7, 0x4] +_0807251A: + ldr r0, [r6] + cmp r0, 0xFE + ble _08072524 + movs r1, 0xFF + str r1, [r6] +_08072524: + ldr r0, [r6, 0x4] + cmp r0, 0xFE + ble _0807252E + movs r3, 0xFF + str r3, [r6, 0x4] +_0807252E: + mov r0, r10 + bl sub_807191C + mov r0, r10 + bl sub_8079764 + ldr r0, [r7] + strb r0, [r5, 0x14] + ldr r0, [r7, 0x4] + strb r0, [r5, 0x15] + ldr r0, [r6] + strb r0, [r5, 0x16] + ldr r0, [r6, 0x4] + strb r0, [r5, 0x17] + ldr r0, [sp, 0xC] + mov r1, r10 + ldr r2, [sp, 0x10] + ldr r3, [sp, 0x14] + bl sub_8072778 + movs r0, 0x1 + add r8, r0 +_0807255A: + mov r1, r8 + cmp r1, 0x64 + bgt _08072574 + mov r0, sp + ldr r1, [sp, 0x1C] + mov r2, r8 + bl sub_808E010 + ldr r0, [sp] + ldr r3, [sp, 0x20] + cmp r0, r3 + bgt _08072574 + b _08072430 +_08072574: + ldr r0, [sp, 0x18] +_08072576: + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08072588: .4byte gUnknown_202DE30 +_0807258C: .4byte gUnknown_202DF98 +_08072590: .4byte gUnknown_80F9E80 +_08072594: .4byte 0x03e60000 +_08072598: .4byte 0x000003e7 +_0807259C: .4byte gUnknown_202F31C +_080725A0: .4byte gUnknown_202F324 + thumb_func_end sub_80723D0 + + thumb_func_start sub_80725A4 +sub_80725A4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + str r0, [sp, 0xC] + str r1, [sp, 0x10] + adds r0, r1, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _080725C2 + b _0807272E +_080725C2: + ldr r0, [sp, 0x10] + ldr r5, [r0, 0x70] + movs r2, 0x2 + ldrsh r1, [r5, r2] + str r1, [sp, 0x18] + ldr r3, [r5, 0x18] + str r3, [sp, 0x1C] + ldrb r0, [r5, 0x9] + str r0, [sp, 0x20] + adds r0, r5, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x4A + beq _080725E2 + cmp r0, 0x47 + bne _080725E6 +_080725E2: + movs r0, 0x1 + b _080725E8 +_080725E6: + movs r0, 0 +_080725E8: + cmp r0, 0 + beq _080725EE + b _0807272E +_080725EE: + movs r1, 0x1 + mov r8, r1 + b _080725F8 +_080725F4: + movs r2, 0x1 + add r8, r2 +_080725F8: + ldrb r3, [r5, 0x9] + cmp r8, r3 + bge _08072610 + mov r0, sp + ldr r1, [sp, 0x18] + mov r2, r8 + bl sub_808E010 + ldr r0, [sp] + ldr r1, [sp, 0x1C] + cmp r0, r1 + blt _080725F4 +_08072610: + mov r2, r8 + subs r2, 0x1 + str r2, [sp, 0x14] + ldrb r3, [r5, 0x9] + mov r8, r3 + cmp r8, r2 + ble _08072710 + mov r9, sp + movs r0, 0x1 + mov r10, r0 +_08072624: + mov r4, r8 + adds r4, 0x1 + mov r1, r8 + cmp r1, 0x63 + bgt _08072640 + mov r0, sp + ldr r1, [sp, 0x18] + adds r2, r4, 0 + bl sub_808E010 + ldr r0, [sp] + subs r0, 0x1 + str r0, [r5, 0x18] + b _08072644 +_08072640: + ldr r2, [sp, 0x1C] + str r2, [r5, 0x18] +_08072644: + ldr r3, [sp, 0x20] + cmp r3, r8 + ble _08072704 + mov r0, sp + ldr r1, [sp, 0x18] + adds r2, r4, 0 + bl sub_808E010 + mov r0, r8 + strb r0, [r5, 0x9] + ldrh r0, [r5, 0x10] + mov r2, r9 + ldrh r1, [r2, 0x4] + subs r0, r1 + strh r0, [r5, 0x10] + ldrh r0, [r5, 0xE] + ldrh r1, [r2, 0x4] + subs r0, r1 + strh r0, [r5, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bgt _08072676 + mov r3, r10 + strh r3, [r5, 0xE] +_08072676: + movs r1, 0x10 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + bgt _08072682 + mov r2, r10 + strh r2, [r5, 0x10] +_08072682: + movs r3, 0xE + ldrsh r1, [r5, r3] + ldrh r2, [r5, 0x10] + movs r3, 0x10 + ldrsh r0, [r5, r3] + cmp r1, r0 + blt _08072692 + strh r2, [r5, 0xE] +_08072692: + ldr r7, _08072734 + ldrb r4, [r5, 0x14] + str r4, [r7] + ldrb r1, [r5, 0x15] + str r1, [r7, 0x4] + ldr r6, _08072738 + ldrb r2, [r5, 0x16] + str r2, [r6] + ldrb r0, [r5, 0x17] + mov r12, r0 + mov r3, r9 + ldrb r0, [r3, 0x6] + subs r4, r0 + str r4, [r7] + ldrb r0, [r3, 0x7] + subs r1, r0 + str r1, [r7, 0x4] + ldrb r0, [r3, 0x8] + subs r2, r0 + str r2, [r6] + ldrb r0, [r3, 0x9] + mov r1, r12 + subs r3, r1, r0 + str r3, [r6, 0x4] + cmp r4, 0x1 + bgt _080726CA + mov r2, r10 + str r2, [r7] +_080726CA: + ldr r0, [r7, 0x4] + cmp r0, 0x1 + bgt _080726D4 + mov r3, r10 + str r3, [r7, 0x4] +_080726D4: + ldr r0, [r6] + cmp r0, 0x1 + bgt _080726DE + mov r0, r10 + str r0, [r6] +_080726DE: + ldr r0, [r6, 0x4] + cmp r0, 0x1 + bgt _080726E8 + mov r1, r10 + str r1, [r6, 0x4] +_080726E8: + ldr r0, [sp, 0x10] + bl sub_807191C + ldr r0, [sp, 0x10] + bl sub_8079764 + ldr r0, [r7] + strb r0, [r5, 0x14] + ldr r0, [r7, 0x4] + strb r0, [r5, 0x15] + ldr r0, [r6] + strb r0, [r5, 0x16] + ldr r0, [r6, 0x4] + strb r0, [r5, 0x17] +_08072704: + movs r2, 0x1 + negs r2, r2 + add r8, r2 + ldr r3, [sp, 0x14] + cmp r8, r3 + bgt _08072624 +_08072710: + ldr r0, _0807273C + adds r1, r5, 0 + movs r2, 0 + bl sub_80708B4 + ldrb r1, [r5, 0x9] + ldr r0, [sp, 0x20] + cmp r1, r0 + bne _08072744 + ldr r0, _08072740 + ldr r2, [r0] + ldr r0, [sp, 0xC] + ldr r1, [sp, 0x10] + bl sub_80522F4 +_0807272E: + movs r0, 0 + b _08072760 + .align 2, 0 +_08072734: .4byte gUnknown_202F31C +_08072738: .4byte gUnknown_202F324 +_0807273C: .4byte gUnknown_202DF98 +_08072740: .4byte gUnknown_80F9EEC +_08072744: + ldr r0, _08072770 + str r1, [r0] + movs r1, 0xD3 + lsls r1, 1 + ldr r0, [sp, 0x10] + bl sub_80421C0 + ldr r0, _08072774 + ldr r2, [r0] + ldr r0, [sp, 0xC] + ldr r1, [sp, 0x10] + bl sub_80522F4 + movs r0, 0x1 +_08072760: + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08072770: .4byte gUnknown_202DE30 +_08072774: .4byte gUnknown_80F9EC8 + thumb_func_end sub_80725A4 + + thumb_func_start sub_8072778 +sub_8072778: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xD0 + mov r9, r1 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0xC4] + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0xC8] + ldr r0, [r1, 0x70] + mov r8, r0 + movs r1, 0 + str r1, [sp, 0xCC] + ldrb r0, [r0, 0x6] + cmp r0, 0 + beq _080727A8 + movs r2, 0 + str r2, [sp, 0xC8] + movs r4, 0 + str r4, [sp, 0xC4] +_080727A8: + mov r0, r8 + movs r2, 0x2 + ldrsh r1, [r0, r2] + ldrb r2, [r0, 0x9] + movs r4, 0xC + ldrsh r3, [r0, r4] + mov r0, sp + bl sub_808E0AC + adds r7, r0, 0 + add r4, sp, 0x20 + movs r1, 0x8C + lsls r1, 1 + add r1, r8 + adds r0, r4, 0 + bl sub_8093FC8 + mov r10, r4 + cmp r7, 0 + beq _08072810 + adds r0, r7, 0 + bl sub_8084100 + movs r2, 0 + lsls r0, 1 + mov r1, sp + adds r6, r1, r0 + mov r5, sp + adds r5, 0x21 + mov r3, r10 +_080727E4: + lsls r0, r2, 3 + add r0, sp + adds r0, 0x20 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08072806 + ldrh r1, [r6] + adds r0, r3, 0 + bl sub_8092A88 + ldrb r1, [r5] + movs r0, 0x4 + orrs r0, r1 + strb r0, [r5] + b _08072810 +_08072806: + adds r5, 0x8 + adds r3, 0x8 + adds r2, 0x1 + cmp r2, 0x7 + ble _080727E4 +_08072810: + movs r5, 0 + movs r4, 0x1 +_08072814: + movs r7, 0 + movs r2, 0 +_08072818: + lsls r0, r2, 3 + add r0, sp + adds r0, 0x20 + ldrb r1, [r0] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _0807282A + adds r7, 0x1 +_0807282A: + adds r2, 0x1 + cmp r2, 0x7 + ble _08072818 + cmp r7, 0x4 + bgt _080728D4 + movs r3, 0 + movs r5, 0 + cmp r3, r7 + bge _0807287C + movs r4, 0x8C + lsls r4, 1 + add r4, r8 + mov r6, r10 +_08072844: + lsls r0, r5, 3 + movs r2, 0x8C + lsls r2, 1 + add r2, r8 + adds r2, r0 + ldr r0, [r6] + ldr r1, [r6, 0x4] + str r0, [r2] + str r1, [r2, 0x4] + ldrb r1, [r4, 0x1] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08072872 + movs r0, 0xFB + ands r0, r1 + strb r0, [r4, 0x1] + add r0, sp, 0x60 + adds r1, r4, 0 + movs r2, 0 + bl sub_80928C0 + movs r3, 0x1 +_08072872: + adds r4, 0x8 + adds r6, 0x8 + adds r5, 0x1 + cmp r5, r7 + blt _08072844 +_0807287C: + cmp r5, 0x3 + bgt _08072894 + movs r2, 0x8C + lsls r2, 1 + movs r1, 0 +_08072886: + lsls r0, r5, 3 + add r0, r8 + adds r0, r2 + strb r1, [r0] + adds r5, 0x1 + cmp r5, 0x3 + ble _08072886 +_08072894: + cmp r3, 0 + beq _08072928 + ldr r2, [sp, 0xC4] + cmp r2, 0 + beq _08072928 + ldr r0, _080728C8 + mov r1, r8 + movs r2, 0 + bl sub_80708B4 + ldr r0, _080728CC + add r1, sp, 0x60 + bl strcpy + mov r0, r9 + movs r1, 0x9C + lsls r1, 1 + bl sub_80421C0 + ldr r0, _080728D0 + ldr r1, [r0] + mov r0, r9 + bl sub_80528F4 + b _08072928 + .align 2, 0 +_080728C8: .4byte gUnknown_202DF98 +_080728CC: .4byte gUnknown_202DE58 +_080728D0: .4byte gUnknown_80F9F04 +_080728D4: + mov r1, r8 + ldrb r0, [r1, 0x6] + cmp r0, 0 + bne _08072918 + ldr r2, [sp, 0xC8] + cmp r2, 0 + beq _08072918 + ldr r0, [sp, 0xCC] + cmp r0, 0 + bne _08072902 + ldr r1, [sp, 0xC4] + cmp r1, 0 + beq _08072902 + movs r0, 0xA + movs r1, 0x6 + bl sub_803E708 + ldr r0, _08072914 + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 +_08072902: + movs r2, 0x1 + str r2, [sp, 0xCC] + mov r0, r9 + mov r1, r10 + movs r3, 0 + bl sub_8063E70 + b _08072920 + .align 2, 0 +_08072914: .4byte gUnknown_80F9FA4 +_08072918: + mov r0, r9 + mov r1, r10 + bl sub_8072B24 +_08072920: + adds r5, 0x1 + cmp r5, 0x1D + bgt _08072928 + b _08072814 +_08072928: + add sp, 0xD0 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8072778 + + thumb_func_start sub_8072938 +sub_8072938: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xA4 + mov r9, r0 + lsls r1, 16 + lsrs r5, r1, 16 + ldr r0, [r0, 0x70] + mov r8, r0 + movs r1, 0 + mov r10, r1 + movs r1, 0x8C + lsls r1, 1 + add r1, r8 + mov r0, sp + bl sub_8093FC8 + movs r3, 0 + mov r4, sp + mov r2, sp +_08072964: + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08072980 + adds r0, r2, 0 + adds r1, r5, 0 + bl sub_8092A88 + ldrb r1, [r4, 0x1] + movs r0, 0x4 + orrs r0, r1 + strb r0, [r4, 0x1] + b _0807298A +_08072980: + adds r4, 0x8 + adds r2, 0x8 + adds r3, 0x1 + cmp r3, 0x7 + ble _08072964 +_0807298A: + movs r4, 0 + movs r5, 0x1 +_0807298E: + movs r7, 0 + mov r2, sp + movs r3, 0x7 +_08072994: + ldrb r1, [r2] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _080729A0 + adds r7, 0x1 +_080729A0: + adds r2, 0x8 + subs r3, 0x1 + cmp r3, 0 + bge _08072994 + cmp r7, 0x4 + bgt _08072A50 + movs r5, 0 + cmp r5, r7 + bge _080729F4 + movs r4, 0x8C + lsls r4, 1 + add r4, r8 + mov r6, sp +_080729BA: + lsls r0, r5, 3 + movs r2, 0x8C + lsls r2, 1 + add r2, r8 + adds r2, r0 + ldr r0, [r6] + ldr r1, [r6, 0x4] + str r0, [r2] + str r1, [r2, 0x4] + ldrb r1, [r4, 0x1] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080729EA + movs r0, 0xFB + ands r0, r1 + strb r0, [r4, 0x1] + add r0, sp, 0x40 + adds r1, r4, 0 + movs r2, 0 + bl sub_80928C0 + movs r0, 0x1 + mov r10, r0 +_080729EA: + adds r4, 0x8 + adds r6, 0x8 + adds r5, 0x1 + cmp r5, r7 + blt _080729BA +_080729F4: + cmp r5, 0x3 + bgt _08072A0C + movs r2, 0x8C + lsls r2, 1 + movs r1, 0 +_080729FE: + lsls r0, r5, 3 + add r0, r8 + adds r0, r2 + strb r1, [r0] + adds r5, 0x1 + cmp r5, 0x3 + ble _080729FE +_08072A0C: + mov r1, r10 + cmp r1, 0 + beq _08072A92 + mov r1, r8 + ldrb r0, [r1, 0x6] + cmp r0, 0 + bne _08072A8C + ldr r0, _08072A44 + mov r1, r9 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08072A48 + add r1, sp, 0x40 + bl strcpy + mov r0, r9 + movs r1, 0x9C + lsls r1, 1 + bl sub_80421C0 + ldr r0, _08072A4C + ldr r1, [r0] + mov r0, r9 + bl sub_80528F4 + b _08072A8C + .align 2, 0 +_08072A44: .4byte gUnknown_202DF98 +_08072A48: .4byte gUnknown_202DE58 +_08072A4C: .4byte gUnknown_80F9F04 +_08072A50: + movs r0, 0 + mov r10, r0 + mov r1, r8 + ldrb r0, [r1, 0x6] + cmp r0, 0 + bne _08072A84 + ldr r0, _08072A80 + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 + mov r0, r9 + mov r1, sp + movs r2, 0x1 + movs r3, 0x1 + bl sub_8063E70 + lsls r0, 24 + cmp r0, 0 + bne _08072A84 + movs r0, 0 + b _08072AB0 + .align 2, 0 +_08072A80: .4byte gUnknown_80FDF40 +_08072A84: + adds r4, 0x1 + cmp r4, 0x1D + bgt _08072A8C + b _0807298E +_08072A8C: + mov r0, r10 + cmp r0, 0 + bne _08072AAE +_08072A92: + mov r1, r8 + ldrb r0, [r1, 0x6] + cmp r0, 0 + bne _08072AAE + ldr r0, _08072AC0 + mov r1, r9 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08072AC4 + ldr r1, [r0] + mov r0, r9 + bl sub_80528F4 +_08072AAE: + movs r0, 0x1 +_08072AB0: + add sp, 0xA4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08072AC0: .4byte gUnknown_202DF98 +_08072AC4: .4byte gUnknown_80F9F2C + thumb_func_end sub_8072938 + + thumb_func_start sub_8072AC8 +sub_8072AC8: + push {r4-r7,lr} + sub sp, 0x4 + adds r6, r0, 0 + adds r7, r2, 0 + lsls r1, 16 + asrs r0, r1, 16 + movs r3, 0 + adds r2, r6, 0x6 +_08072AD8: + strh r3, [r2] + subs r2, 0x2 + cmp r2, r6 + bge _08072AD8 + movs r5, 0 + bl sub_8092B18 + adds r4, r0, 0 + b _08072B04 +_08072AEA: + cmp r5, 0x4 + bne _08072AF6 + movs r0, 0x4 + bl sub_8084100 + b _08072AFA +_08072AF6: + adds r0, r5, 0 + adds r5, 0x1 +_08072AFA: + lsls r0, 1 + adds r0, r6 + mov r1, sp + ldrh r1, [r1] + strh r1, [r0] +_08072B04: + ldrb r0, [r4] + cmp r0, 0 + beq _08072B1C + adds r0, r4, 0 + mov r1, sp + bl sub_808E07C + adds r4, r0, 0 + ldrb r0, [r4] + adds r4, 0x1 + cmp r0, r7 + ble _08072AEA +_08072B1C: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8072AC8 + + thumb_func_start sub_8072B24 +sub_8072B24: + push {r4-r7,lr} + adds r5, r1, 0 + movs r4, 0 + movs r7, 0x1 + movs r6, 0xFD + adds r2, r5, 0 + movs r3, 0x7 +_08072B32: + ldrb r1, [r2] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _08072B44 + adds r0, r6, 0 + ands r0, r1 + strb r0, [r2] + adds r4, 0x1 +_08072B44: + adds r2, 0x8 + subs r3, 0x1 + cmp r3, 0 + bge _08072B32 + adds r0, r4, 0 + bl sub_8084100 + adds r3, r0, 0 + adds r4, r5, 0 + adds r4, 0x38 + cmp r3, 0x6 + bgt _08072B6C + lsls r0, r3, 3 + adds r2, r0, r5 +_08072B60: + ldr r0, [r2, 0x8] + ldr r1, [r2, 0xC] + stm r2!, {r0,r1} + adds r3, 0x1 + cmp r3, 0x6 + ble _08072B60 +_08072B6C: + movs r0, 0 + strb r0, [r4] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8072B24 + + thumb_func_start sub_8072B78 +sub_8072B78: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x20 + mov r8, r0 + adds r7, r1, 0 + lsls r5, r2, 16 + asrs r5, 16 + ldr r6, [r7, 0x70] + ldr r4, _08072BFC + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_80708B4 + adds r4, 0x50 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_808D908 + adds r0, r5, 0 + bl sub_80687D0 + adds r4, r0, 0 + lsls r0, r5, 16 + lsrs r0, 16 + strh r0, [r6, 0x4] + strh r0, [r6, 0x2] + ldrb r2, [r6, 0x9] + mov r0, sp + adds r1, r5, 0 + bl sub_808E010 + ldr r0, [sp] + str r0, [r6, 0x18] + str r4, [r7, 0x64] + adds r0, r6, 0 + movs r1, 0 + bl sub_806BFC0 + adds r0, r7, 0 + bl sub_8069E0C + adds r0, r7, 0 + movs r1, 0x7 + bl sub_806CCB4 + ldr r0, _08072C00 + ldr r2, [r0] + mov r0, r8 + adds r1, r7, 0 + bl sub_80522F4 + adds r0, r7, 0 + bl sub_8042A44 + bl sub_8083D78 + movs r0, 0x9E + lsls r0, 1 + cmp r5, r0 + bne _08072C74 + movs r5, 0 + ldr r4, _08072C04 + b _08072C0C + .align 2, 0 +_08072BFC: .4byte gUnknown_202DF98 +_08072C00: .4byte gUnknown_80FE2EC +_08072C04: .4byte gUnknown_80F4448 +_08072C08: + adds r4, 0x4 + adds r5, 0x1 +_08072C0C: + cmp r5, 0x7 + bgt _08072C36 + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0x4 + ldrsh r1, [r7, r2] + adds r0, r1 + movs r3, 0x2 + ldrsh r1, [r4, r3] + movs r3, 0x6 + ldrsh r2, [r7, r3] + adds r1, r2 + bl sub_804954C + adds r1, r0, 0 + ldr r0, _08072C80 + bl sub_807034C + lsls r0, 24 + cmp r0, 0 + bne _08072C08 +_08072C36: + ldr r0, _08072C80 + mov r8, r0 + bl sub_803D930 + lsls r0, 24 + cmp r0, 0 + beq _08072C74 + add r0, sp, 0xC + movs r3, 0 + movs r4, 0 + mov r1, r8 + strh r1, [r0] + ldrb r1, [r6, 0x9] + strh r1, [r0, 0x8] + strb r3, [r0, 0x2] + ldr r1, _08072C84 + lsls r2, r5, 2 + adds r2, r1 + ldrh r1, [r7, 0x4] + ldrh r5, [r2] + adds r1, r5 + strh r1, [r0, 0xC] + ldrh r1, [r7, 0x6] + ldrh r2, [r2, 0x2] + adds r1, r2 + strh r1, [r0, 0xE] + str r4, [r0, 0x4] + strb r3, [r0, 0x10] + movs r1, 0x1 + bl sub_806B7F8 +_08072C74: + add sp, 0x20 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08072C80: .4byte 0x0000013d +_08072C84: .4byte gUnknown_80F4448 + thumb_func_end sub_8072B78 + + thumb_func_start sub_8072C88 +sub_8072C88: + push {lr} + ldr r1, [r0, 0x70] + ldrb r0, [r1, 0x6] + cmp r0, 0 + bne _08072CA2 + adds r0, r1, 0 + adds r0, 0x94 + ldrb r0, [r0] + bl sub_808EAFC + lsls r0, 24 + lsrs r0, 24 + b _08072CA4 +_08072CA2: + movs r0, 0 +_08072CA4: + pop {r1} + bx r1 + thumb_func_end sub_8072C88 + + thumb_func_start sub_8072CA8 +sub_8072CA8: + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, [r5, 0x70] + ldrb r0, [r0, 0x6] + cmp r0, 0 + bne _08072CEC + bl sub_8083600 + adds r4, r0, 0 + cmp r4, 0 + beq _08072CEC + ldr r0, [r4, 0x70] + adds r0, 0xC8 + ldrb r0, [r0] + cmp r0, 0x2 + beq _08072CEC + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl sub_8071598 + lsls r0, 24 + cmp r0, 0 + bne _08072CEC + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8045A00 + lsls r0, 24 + cmp r0, 0 + beq _08072CEC + adds r0, r4, 0 + b _08072CEE +_08072CEC: + movs r0, 0 +_08072CEE: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8072CA8 + + thumb_func_start sub_8072CF4 +sub_8072CF4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r4, r0, 0 + movs r0, 0x1 + bl sub_804178C + ldr r1, _08072D4C + movs r0, 0x1 + strb r0, [r1] + ldr r6, [r4, 0x70] + adds r0, r6, 0 + adds r0, 0xFC + movs r1, 0 + strb r1, [r0] + subs r0, 0x9 + strb r1, [r0] + ldr r0, _08072D50 + ldr r0, [r0] + adds r0, 0xB8 + str r4, [r0] + ldr r2, _08072D54 + adds r0, r6, 0 + adds r0, 0x44 + ldrh r0, [r0] + lsls r1, r0, 1 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _08072D64 + ldrb r0, [r6, 0x7] + cmp r0, 0 + beq _08072D58 + adds r0, r2, 0x1 + adds r0, r1, r0 + ldrb r1, [r0] + adds r0, r4, 0 + bl sub_805EFB4 + b _08072D64 + .align 2, 0 +_08072D4C: .4byte gUnknown_203B434 +_08072D50: .4byte gUnknown_203B418 +_08072D54: .4byte gUnknown_80F58F4 +_08072D58: + adds r0, r2, 0x1 + adds r0, r1, r0 + ldrb r1, [r0] + adds r0, r4, 0 + bl sub_8075BA4 +_08072D64: + adds r0, r4, 0 + movs r1, 0 + bl sub_8070D04 + lsls r0, 24 + cmp r0, 0 + beq _08072D86 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80570F4 + lsls r0, 24 + cmp r0, 0 + beq _08072D86 + adds r0, r4, 0 + bl sub_8079764 +_08072D86: + movs r7, 0x1 + movs r5, 0xFB + movs r0, 0x8C + lsls r0, 1 + adds r2, r6, r0 + movs r3, 0x3 +_08072D92: + ldrb r1, [r2] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _08072DA4 + ldrb r1, [r2, 0x1] + adds r0, r5, 0 + ands r0, r1 + strb r0, [r2, 0x1] +_08072DA4: + adds r2, 0x8 + subs r3, 0x1 + cmp r3, 0 + bge _08072D92 + adds r0, r4, 0 + movs r1, 0 + bl sub_8045028 + lsls r0, 24 + cmp r0, 0 + bne _08072E08 + adds r0, r4, 0 + bl sub_807520C + lsls r0, 24 + cmp r0, 0 + beq _08072DF0 + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _08072DD2 + b _080732D4 +_08072DD2: + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08072DE0 + b _080732D4 +_08072DE0: + ldr r0, _08072DEC + ldrb r0, [r0] + cmp r0, 0 + beq _08072DF0 + movs r0, 0x1 + b _080732D6 + .align 2, 0 +_08072DEC: .4byte gUnknown_202F32D +_08072DF0: + ldrb r0, [r6, 0x7] + cmp r0, 0 + bne _08072DFC + movs r0, 0xA + bl sub_8052740 +_08072DFC: + adds r0, r4, 0 + bl sub_806A1E8 + movs r0, 0xA + bl sub_803E46C +_08072E08: + adds r0, r6, 0 + adds r0, 0x44 + ldrh r1, [r0] + adds r5, r0, 0 + cmp r1, 0x1 + bls _08072E26 + cmp r1, 0x4 + beq _08072E26 + cmp r1, 0x2 + beq _08072E26 + movs r2, 0xA4 + lsls r2, 1 + adds r1, r6, r2 + movs r0, 0x1 + strb r0, [r1] +_08072E26: + movs r3, 0 + mov r10, r3 + movs r7, 0xA5 + lsls r7, 1 + adds r0, r6, r7 + mov r1, r10 + strb r1, [r0] + ldr r0, _08072E50 + strb r1, [r0] + ldr r0, _08072E54 + strb r1, [r0] + ldrh r0, [r5] + subs r0, 0x2 + cmp r0, 0x3F + bls _08072E46 + b _080731B4 +_08072E46: + lsls r0, 2 + ldr r1, _08072E58 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08072E50: .4byte gUnknown_202F221 +_08072E54: .4byte gUnknown_202F222 +_08072E58: .4byte _08072E5C + .align 2, 0 +_08072E5C: + .4byte _08072F5C + .4byte _080731B4 + .4byte _080731B4 + .4byte _080731B4 + .4byte _080731B4 + .4byte _080731B4 + .4byte _08073104 + .4byte _080730A4 + .4byte _0807310C + .4byte _0807311C + .4byte _080731B4 + .4byte _08073094 + .4byte _08073094 + .4byte _080731B4 + .4byte _080731B4 + .4byte _080731B4 + .4byte _08073094 + .4byte _0807314C + .4byte _08073154 + .4byte _0807303E + .4byte _080731B4 + .4byte _0807315C + .4byte _080731B4 + .4byte _080731B4 + .4byte _080731B4 + .4byte _080731B4 + .4byte _080731B4 + .4byte _080731B4 + .4byte _080731B4 + .4byte _080731B4 + .4byte _080731B4 + .4byte _080731B4 + .4byte _080731B4 + .4byte _08073186 + .4byte _0807318E + .4byte _08073170 + .4byte _08073046 + .4byte _0807311C + .4byte _080731B4 + .4byte _080731B4 + .4byte _080731B4 + .4byte _080731B4 + .4byte _080731B4 + .4byte _080731B4 + .4byte _080731B4 + .4byte _080731B4 + .4byte _080731B4 + .4byte _0807309C + .4byte _08073162 + .4byte _080731B4 + .4byte _080731B4 + .4byte _080731B4 + .4byte _080730AC + .4byte _080730B4 + .4byte _080730C4 + .4byte _08073196 + .4byte _08073114 + .4byte _080730E0 + .4byte _080730CC + .4byte _080730D6 + .4byte _080730BC + .4byte _0807317E + .4byte _080731B4 + .4byte _0807311C +_08072F5C: + adds r0, r6, 0 + adds r0, 0xB0 + ldrb r0, [r0] + cmp r0, 0x2 + beq _08072F76 + cmp r0, 0x7 + beq _08072F76 + cmp r0, 0x5 + beq _08072F76 + cmp r0, 0x3 + beq _08072F76 + cmp r0, 0x4 + bne _08072F84 +_08072F76: + movs r0, 0 + strh r0, [r5] + ldr r2, _08072F80 + adds r1, r6, r2 + b _08072FDA + .align 2, 0 +_08072F80: .4byte 0x00000147 +_08072F84: + movs r3, 0 + mov r9, r3 + ldr r1, _08072FE0 + adds r2, r6, 0 + adds r2, 0x46 + ldrb r3, [r2] + lsls r0, r3, 2 + adds r0, r1 + ldrh r1, [r0] + ldrh r7, [r4, 0x4] + adds r1, r7 + lsls r1, 16 + ldrh r0, [r0, 0x2] + ldrh r7, [r4, 0x6] + adds r0, r7 + lsls r0, 16 + lsrs r1, 16 + mov r8, r1 + orrs r1, r0 + mov r8, r1 + ldrh r1, [r6] + movs r0, 0x80 + lsls r0, 8 + ands r0, r1 + adds r7, r2, 0 + cmp r0, 0 + bne _08072FCC + adds r0, r4, 0 + adds r1, r3, 0 + bl sub_8070D6C + lsls r0, 24 + cmp r0, 0 + bne _08072FCC + movs r2, 0x1 + mov r9, r2 +_08072FCC: + mov r3, r9 + cmp r3, 0 + beq _08072FE8 + movs r0, 0 + strh r0, [r5] + ldr r7, _08072FE4 + adds r1, r6, r7 +_08072FDA: + movs r0, 0x1 + strb r0, [r1] + b _080731B8 + .align 2, 0 +_08072FE0: .4byte gUnknown_80F4448 +_08072FE4: .4byte 0x00000147 +_08072FE8: + ldrh r1, [r4, 0x6] + lsls r1, 16 + ldrh r0, [r4, 0x4] + orrs r0, r1 + str r0, [sp] + mov r0, r8 + lsls r1, r0, 16 + asrs r1, 16 + asrs r2, r0, 16 + adds r0, r4, 0 + movs r3, 0 + bl sub_80694C0 + ldrb r1, [r7] + adds r0, r4, 0 + mov r2, sp + bl sub_8074FB0 + adds r0, r4, 0 + movs r1, 0xD + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _08073038 + adds r0, r6, 0 + adds r0, 0xE4 + ldrb r0, [r0] + cmp r0, 0x3 + beq _08073038 + adds r0, r4, 0 + movs r1, 0x9 + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + bne _08073038 + adds r0, r4, 0x4 + bl sub_804AE08 +_08073038: + movs r1, 0x1 + mov r10, r1 + b _080731B8 +_0807303E: + adds r0, r4, 0 + bl sub_807CABC + b _080731B8 +_08073046: + ldr r0, _08073064 + ldr r1, [r0] + ldr r2, _08073068 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0x15 + bne _08073074 + ldr r3, _0807306C + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _08073074 + ldr r0, _08073070 + b _080731A2 + .align 2, 0 +_08073064: .4byte gUnknown_203B418 +_08073068: .4byte 0x00000644 +_0807306C: .4byte 0x000037fe +_08073070: .4byte gUnknown_80FA5B4 +_08073074: + bl sub_804267C + ldr r0, _0807308C + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x2] + ldr r1, _08073090 + adds r0, r6, 0 + adds r0, 0x46 + ldrb r0, [r0] + strb r0, [r1] + b _080731B8 + .align 2, 0 +_0807308C: .4byte gUnknown_203B418 +_08073090: .4byte gUnknown_202F32C +_08073094: + adds r0, r4, 0 + bl sub_8067110 + b _080731B8 +_0807309C: + adds r0, r4, 0 + bl sub_807CB3C + b _080731B8 +_080730A4: + adds r0, r4, 0 + bl sub_8066744 + b _080731B8 +_080730AC: + adds r0, r4, 0 + bl sub_80668D0 + b _080731B8 +_080730B4: + adds r0, r4, 0 + bl sub_8066AC0 + b _080731B8 +_080730BC: + adds r0, r4, 0 + bl sub_8066BD4 + b _080731B8 +_080730C4: + adds r0, r4, 0 + bl sub_8066CF0 + b _080731B8 +_080730CC: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_806675C + b _080731B8 +_080730D6: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_806684C + b _080731B8 +_080730E0: + ldr r0, _080730FC + ldr r1, [r0] + adds r2, r1, 0 + adds r2, 0xBC + adds r0, r6, 0 + adds r0, 0x48 + ldrb r0, [r0] + lsls r0, 2 + ldr r7, _08073100 + adds r1, r7 + adds r1, r0 + ldr r0, [r1] + str r0, [r2] + b _080731B8 + .align 2, 0 +_080730FC: .4byte gUnknown_203B418 +_08073100: .4byte 0x0001357c +_08073104: + adds r0, r4, 0 + bl sub_8066D04 + b _080731B8 +_0807310C: + adds r0, r4, 0 + bl sub_8066E14 + b _080731B8 +_08073114: + adds r0, r4, 0 + bl sub_8066FA4 + b _080731B8 +_0807311C: + adds r0, r6, 0 + bl sub_8071A70 + lsls r0, 24 + cmp r0, 0 + beq _08073136 + adds r0, r4, 0 + bl nullsub_95 + adds r0, r4, 0 + bl sub_80671A0 + b _080731B8 +_08073136: + ldr r0, _08073144 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08073148 + b _080731A2 + .align 2, 0 +_08073144: .4byte gUnknown_202DF98 +_08073148: .4byte gUnknown_80FE6D4 +_0807314C: + adds r0, r4, 0 + bl sub_8067510 + b _080731B8 +_08073154: + adds r0, r4, 0 + bl sub_8067884 + b _080731B8 +_0807315C: + movs r1, 0xB0 + lsls r1, 1 + b _08073164 +_08073162: + ldr r1, _0807316C +_08073164: + adds r0, r4, 0 + bl sub_8067904 + b _080731B8 + .align 2, 0 +_0807316C: .4byte 0x00000163 +_08073170: + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0 + bl sub_807FE9C + b _080731B8 +_0807317E: + adds r0, r4, 0 + bl sub_8073D08 + b _080731B8 +_08073186: + adds r0, r4, 0 + bl sub_8073CF0 + b _080731B8 +_0807318E: + adds r0, r4, 0 + bl sub_8073CFC + b _080731B8 +_08073196: + ldr r0, _080731AC + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _080731B0 +_080731A2: + ldr r1, [r0] + adds r0, r4, 0 + bl sub_80522A8 + b _080731B8 + .align 2, 0 +_080731AC: .4byte gUnknown_202DF98 +_080731B0: .4byte gUnknown_80FE478 +_080731B4: + movs r0, 0x1 + strh r0, [r5] +_080731B8: + adds r0, r4, 0 + bl sub_807FD84 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _080731CC + b _080732D4 +_080731CC: + ldr r0, [r4, 0x70] + movs r2, 0xA5 + lsls r2, 1 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0 + bne _080731E2 + strb r0, [r1] + adds r0, r4, 0 + bl sub_8079764 +_080731E2: + movs r0, 0 + bl sub_8041888 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080732D4 + bl sub_8085140 + ldr r3, _080732E8 + adds r1, r6, r3 + ldrb r0, [r1] + cmp r0, 0 + beq _08073242 + movs r5, 0 + strb r5, [r1] + movs r7, 0x8C + lsls r7, 1 + adds r2, r6, r7 + movs r0, 0x1 + mov r12, r0 + movs r7, 0x10 + movs r3, 0x3 +_08073214: + ldrb r1, [r2] + mov r0, r12 + ands r0, r1 + cmp r0, 0 + beq _0807322C + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _0807322C + movs r0, 0 + strb r0, [r2, 0x4] + movs r5, 0x1 +_0807322C: + adds r2, 0x8 + subs r3, 0x1 + cmp r3, 0 + bge _08073214 + cmp r5, 0 + beq _08073242 + ldr r0, _080732EC + ldr r1, [r0] + adds r0, r4, 0 + bl sub_80522A8 +_08073242: + bl sub_807360C + bl sub_8044B84 + lsls r0, 24 + cmp r0, 0 + bne _08073264 + bl sub_807348C + bl sub_80732F0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080732D4 +_08073264: + mov r1, r10 + cmp r1, 0 + beq _08073270 + adds r0, r4, 0 + bl sub_8075818 +_08073270: + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080732D4 + bl sub_8044B84 + lsls r0, 24 + cmp r0, 0 + bne _0807328A + bl sub_8046D20 +_0807328A: + movs r0, 0 + bl sub_8041888 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080732D4 + movs r2, 0xA2 + lsls r2, 1 + adds r0, r6, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080732D4 + mov r3, r10 + cmp r3, 0 + bne _080732D4 + adds r1, r4, 0x4 + adds r0, r4, 0 + bl sub_80706A4 + lsls r0, 24 + cmp r0, 0 + beq _080732C8 + adds r0, r4, 0 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl sub_807D148 +_080732C8: + adds r0, r4, 0 + bl sub_8074094 + adds r0, r4, 0 + bl sub_8071DA4 +_080732D4: + movs r0, 0 +_080732D6: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080732E8: .4byte 0x0000014b +_080732EC: .4byte gUnknown_80FD2CC + thumb_func_end sub_8072CF4 + + thumb_func_start sub_80732F0 +sub_80732F0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + movs r4, 0 +_080732FE: + movs r5, 0 + ldr r0, _0807335C + ldr r0, [r0] + lsls r1, r4, 2 + ldr r2, _08073360 + adds r0, r2 + adds r0, r1 + ldr r0, [r0] + mov r8, r0 + bl sub_80450E0 + lsls r0, 24 + adds r4, 0x1 + str r4, [sp, 0x10] + cmp r0, 0 + bne _08073320 + b _08073472 +_08073320: + mov r0, r8 + ldr r7, [r0, 0x70] + movs r1, 0xB2 + lsls r1, 1 + adds r4, r7, r1 + ldrb r0, [r4] + cmp r0, 0xFF + bne _08073332 + b _08073472 +_08073332: + adds r2, r0, 0 + mov r9, r2 + mov r0, r8 + movs r1, 0x1 + bl sub_8070D04 + lsls r0, 24 + cmp r0, 0 + bne _0807336E + mov r0, r8 + bl sub_8070B28 + lsls r0, 24 + cmp r0, 0 + bne _08073364 + ldrb r0, [r4] + movs r2, 0xFF + orrs r0, r2 + strb r0, [r4] + b _08073472 + .align 2, 0 +_0807335C: .4byte gUnknown_203B418 +_08073360: .4byte 0x000135cc +_08073364: + adds r0, r7, 0 + adds r0, 0xEC + ldrb r0, [r0] + cmp r0, 0x1 + bne _08073378 +_0807336E: + ldrb r0, [r4] + movs r1, 0xFF + orrs r0, r1 + strb r0, [r4] + b _08073472 +_08073378: + movs r0, 0x4 + bl sub_8084100 + adds r3, r0, 0 + movs r4, 0 +_08073382: + lsls r0, r3, 3 + movs r2, 0x8C + lsls r2, 1 + adds r0, r2 + adds r2, r7, r0 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08073448 + ldr r0, [r2] + ldr r1, [r2, 0x4] + str r0, [sp, 0x8] + str r1, [sp, 0xC] + ldr r1, [sp, 0x8] + lsrs r0, r1, 16 + cmp r0, 0x8A + beq _08073448 + adds r1, r0, 0 + ldr r0, _08073434 + cmp r1, r0 + beq _08073448 + movs r6, 0 + movs r0, 0x46 + adds r0, r7 + mov r10, r0 + movs r1, 0x8C + lsls r1, 1 + adds r4, r7, r1 +_080733BC: + lsls r0, r6, 3 + movs r2, 0x8C + lsls r2, 1 + adds r0, r2 + adds r5, r7, r0 + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080733F4 + ldrb r0, [r7, 0x7] + cmp r0, 0 + bne _080733DE + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080733F4 +_080733DE: + ldrh r0, [r4, 0x2] + cmp r0, 0xE3 + bne _080733F4 + mov r0, r8 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_80573CC + lsls r0, 24 + cmp r0, 0 + bne _08073440 +_080733F4: + adds r4, 0x8 + adds r6, 0x1 + cmp r6, 0x3 + ble _080733BC +_080733FC: + ldr r0, _08073438 + mov r1, r8 + movs r2, 0 + bl sub_8045B94 + ldr r0, _0807343C + ldr r1, [r0] + mov r0, r8 + bl sub_80522A8 + movs r0, 0x7 + mov r1, r9 + ands r1, r0 + movs r0, 0 + mov r2, r10 + strb r1, [r2] + str r0, [sp] + add r0, sp, 0x8 + str r0, [sp, 0x4] + mov r0, r8 + movs r1, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_8055FA0 + movs r5, 0x1 + b _08073456 + .align 2, 0 +_08073434: .4byte 0x00000147 +_08073438: .4byte gUnknown_202DF98 +_0807343C: .4byte gUnknown_80FCF38 +_08073440: + adds r0, r5, 0x4 + bl sub_80838EC + b _080733FC +_08073448: + adds r3, 0x1 + cmp r3, 0x4 + bne _08073450 + movs r3, 0 +_08073450: + adds r4, 0x1 + cmp r4, 0x3 + ble _08073382 +_08073456: + movs r2, 0xB2 + lsls r2, 1 + adds r1, r7, r2 + ldrb r0, [r1] + movs r2, 0xFF + orrs r0, r2 + strb r0, [r1] + cmp r5, 0 + beq _08073472 + mov r0, r8 + movs r1, 0xB8 + lsls r1, 2 + bl sub_80421C0 +_08073472: + ldr r4, [sp, 0x10] + cmp r4, 0x13 + bgt _0807347A + b _080732FE +_0807347A: + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80732F0 + + thumb_func_start sub_807348C +sub_807348C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + movs r4, 0 + movs r0, 0xFF + mov r9, r0 +_0807349E: + ldr r0, _080734E8 + ldr r0, [r0] + lsls r1, r4, 2 + ldr r2, _080734EC + adds r0, r2 + adds r0, r1 + ldr r7, [r0] + adds r0, r7, 0 + bl sub_80450E0 + lsls r0, 24 + adds r4, 0x1 + str r4, [sp, 0x10] + cmp r0, 0 + bne _080734BE + b _080735E6 +_080734BE: + ldr r6, [r7, 0x70] + ldr r0, _080734F0 + adds r4, r6, r0 + ldrb r0, [r4] + cmp r0, 0xFF + bne _080734CC + b _080735E6 +_080734CC: + adds r1, r0, 0 + mov r8, r1 + adds r0, r7, 0 + movs r1, 0x1 + bl sub_8070D04 + lsls r0, 24 + cmp r0, 0 + beq _080734F4 + ldrb r0, [r4] + mov r2, r9 + orrs r0, r2 + strb r0, [r4] + b _080735DA + .align 2, 0 +_080734E8: .4byte gUnknown_203B418 +_080734EC: .4byte 0x000135cc +_080734F0: .4byte 0x00000165 +_080734F4: + adds r0, r7, 0 + bl sub_8070B28 + lsls r0, 24 + cmp r0, 0 + bne _08073514 + ldrb r0, [r4] + mov r1, r9 + orrs r0, r1 + strb r0, [r4] + movs r2, 0xB2 + lsls r2, 1 + adds r1, r6, r2 + ldrb r0, [r1] + mov r2, r9 + b _080735E2 +_08073514: + adds r0, r6, 0 + adds r0, 0xEC + ldrb r0, [r0] + cmp r0, 0x1 + bne _0807354A + ldrb r0, [r4] + mov r1, r9 + orrs r0, r1 + strb r0, [r4] + movs r2, 0xB2 + lsls r2, 1 + adds r1, r6, r2 + ldrb r0, [r1] + mov r2, r9 + b _080735E2 +_08073532: + ldr r0, [r5] + ldr r1, [r5, 0x4] + str r0, [sp, 0x8] + str r1, [sp, 0xC] + adds r0, r5, 0x4 + bl sub_80838EC + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_806ACE8 + b _0807359C +_0807354A: + movs r3, 0 + movs r0, 0x46 + adds r0, r6 + mov r10, r0 + movs r1, 0x8C + lsls r1, 1 + adds r4, r6, r1 +_08073558: + lsls r0, r3, 3 + movs r2, 0x8C + lsls r2, 1 + adds r0, r2 + adds r5, r6, r0 + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08073594 + ldrb r0, [r6, 0x7] + cmp r0, 0 + bne _0807357A + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08073594 +_0807357A: + ldrh r0, [r4, 0x2] + cmp r0, 0x19 + bne _08073594 + adds r0, r7, 0 + adds r1, r5, 0 + movs r2, 0x1 + str r3, [sp, 0x14] + bl sub_80573CC + lsls r0, 24 + ldr r3, [sp, 0x14] + cmp r0, 0 + bne _08073532 +_08073594: + adds r4, 0x8 + adds r3, 0x1 + cmp r3, 0x3 + ble _08073558 +_0807359C: + ldr r0, _08073600 + adds r1, r7, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08073604 + ldr r1, [r0] + adds r0, r7, 0 + bl sub_80522A8 + movs r0, 0x7 + mov r1, r8 + ands r1, r0 + movs r0, 0 + mov r2, r10 + strb r1, [r2] + str r0, [sp] + add r0, sp, 0x8 + str r0, [sp, 0x4] + adds r0, r7, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_8055FA0 + ldr r2, _08073608 + adds r1, r6, r2 + ldrb r0, [r1] + mov r2, r9 + orrs r0, r2 + strb r0, [r1] +_080735DA: + movs r0, 0xB2 + lsls r0, 1 + adds r1, r6, r0 + ldrb r0, [r1] +_080735E2: + orrs r0, r2 + strb r0, [r1] +_080735E6: + ldr r4, [sp, 0x10] + cmp r4, 0x13 + bgt _080735EE + b _0807349E +_080735EE: + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08073600: .4byte gUnknown_202DF98 +_08073604: .4byte gUnknown_80FCF50 +_08073608: .4byte 0x00000165 + thumb_func_end sub_807348C + + thumb_func_start sub_807360C +sub_807360C: + push {r4,r5,lr} + movs r5, 0 +_08073610: + ldr r0, _08073650 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _08073654 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08073644 + ldr r0, [r4, 0x70] + movs r2, 0xA9 + lsls r2, 1 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0 + beq _08073644 + movs r0, 0 + strb r0, [r1] + adds r0, r4, 0 + adds r1, r4, 0 + bl sub_8077274 +_08073644: + adds r5, 0x1 + cmp r5, 0x13 + ble _08073610 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08073650: .4byte gUnknown_203B418 +_08073654: .4byte 0x000135cc + thumb_func_end sub_807360C + + thumb_func_start sub_8073658 +sub_8073658: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x58 + mov r8, r0 + ldr r6, [r0, 0x70] + bl sub_8070C60 + lsls r0, 24 + cmp r0, 0 + beq _080736B8 + adds r1, r6, 0 + adds r1, 0xFC + movs r0, 0 + strb r0, [r1] + b _080739C4 +_0807367C: + adds r0, r6, 0 + adds r0, 0x44 + movs r1, 0x24 + bl sub_8044C94 + adds r0, r6, 0 + adds r0, 0x48 + add r1, sp, 0x54 + ldrb r1, [r1] + strb r1, [r0] + mov r2, r8 + ldrh r1, [r2, 0x4] + adds r0, 0x4 + strh r1, [r0] + ldrh r0, [r2, 0x6] + adds r1, r6, 0 + adds r1, 0x4E + strh r0, [r1] + ldr r0, _080736B4 + adds r0, r7, r0 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + adds r1, r6, 0 + adds r1, 0x46 + strb r0, [r1] + b _08073718 + .align 2, 0 +_080736B4: .4byte gUnknown_202F330 +_080736B8: + adds r0, r6, 0 + adds r0, 0xFC + ldrb r0, [r0] + cmp r0, 0 + bne _080736C4 + b _080737DC +_080736C4: + adds r7, r6, 0 + adds r7, 0x60 + ldrb r1, [r7] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080736D4 + b _080739C4 +_080736D4: + movs r3, 0x81 + str r3, [sp, 0x54] + ldrb r0, [r7, 0x2] + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _0807372C + mov r0, r8 + movs r1, 0x2 + adds r2, r7, 0 + movs r3, 0x1 + bl sub_80739DC + movs r5, 0 + ldr r0, _08073724 + ldr r0, [r0] + cmp r5, r0 + bge _08073718 + ldr r4, _08073728 +_080736FE: + lsls r7, r5, 2 + ldr r0, [r4] + bl sub_8084144 + lsls r0, 24 + cmp r0, 0 + bne _0807367C + adds r4, 0x4 + adds r5, 0x1 + ldr r0, _08073724 + ldr r0, [r0] + cmp r5, r0 + blt _080736FE +_08073718: + ldr r0, _08073724 + ldr r0, [r0] + cmp r5, r0 + beq _08073722 + b _080739C4 +_08073722: + b _08073792 + .align 2, 0 +_08073724: .4byte gUnknown_203B440 +_08073728: .4byte gUnknown_202F358 +_0807372C: + cmp r0, 0x1 + bne _0807377C + mov r0, r8 + adds r1, r7, 0 + mov r2, sp + movs r3, 0x1 + bl sub_8073AA0 + ldr r0, _08073778 + ldr r0, [r0] + cmp r0, 0 + beq _08073792 + bl sub_8084100 + adds r4, r0, 0 + adds r0, r6, 0 + adds r0, 0x44 + movs r1, 0x24 + bl sub_8044C94 + adds r0, r6, 0 + adds r0, 0x48 + add r1, sp, 0x54 + ldrb r1, [r1] + strb r1, [r0] + mov r2, r8 + ldrh r1, [r2, 0x4] + adds r0, 0x4 + strh r1, [r0] + ldrh r0, [r2, 0x6] + adds r1, r6, 0 + adds r1, 0x4E + strh r0, [r1] + mov r0, r8 + adds r0, 0x4 + lsls r4, 2 + add r4, sp + b _0807395E + .align 2, 0 +_08073778: .4byte gUnknown_203B440 +_0807377C: + subs r0, 0x2 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _08073792 + adds r0, r6, 0 + adds r0, 0x44 + movs r1, 0x23 + bl sub_8044C94 + b _080738CE +_08073792: + adds r0, r6, 0 + adds r0, 0x44 + movs r1, 0x39 + bl sub_8044C94 + b _080739C4 +_0807379E: + adds r0, r6, 0 + adds r0, 0x44 + movs r1, 0x24 + bl sub_8044C94 + adds r0, r6, 0 + adds r0, 0x48 + add r3, sp, 0x54 + ldrb r3, [r3] + strb r3, [r0] + mov r0, r8 + ldrh r1, [r0, 0x4] + adds r0, r6, 0 + adds r0, 0x4C + strh r1, [r0] + mov r1, r8 + ldrh r0, [r1, 0x6] + adds r1, r6, 0 + adds r1, 0x4E + strh r0, [r1] + ldr r0, _080737D8 + add r0, r10 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + adds r1, r6, 0 + adds r1, 0x46 + strb r0, [r1] + b _080739C4 + .align 2, 0 +_080737D8: .4byte gUnknown_202F330 +_080737DC: + mov r0, r8 + movs r1, 0x16 + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + bne _080737EC + b _080739C4 +_080737EC: + movs r2, 0x1 + str r2, [sp, 0x50] +_080737F0: + ldr r3, [sp, 0x50] + cmp r3, 0x1 + bne _080737FE + adds r7, r6, 0 + adds r7, 0x60 + movs r0, 0x81 + b _0807384E +_080737FE: + ldr r1, [sp, 0x50] + cmp r1, 0 + bne _08073832 + mov r2, r8 + movs r3, 0x4 + ldrsh r0, [r2, r3] + movs r3, 0x6 + ldrsh r1, [r2, r3] + bl sub_804954C + adds r4, r0, 0 + ldr r0, [r4, 0x14] + cmp r0, 0 + bne _0807381C + b _080739B8 +_0807381C: + bl sub_80450F8 + cmp r0, 0x3 + beq _08073826 + b _080739B8 +_08073826: + ldr r0, [r4, 0x14] + bl sub_8045108 + adds r7, r0, 0 + movs r0, 0x80 + b _0807384E +_08073832: + ldrb r0, [r6, 0x7] + cmp r0, 0 + bne _0807383A + b _080739C4 +_0807383A: + ldr r1, _080738C0 + ldr r2, [sp, 0x50] + lsls r0, r2, 2 + subs r0, 0x8 + ldr r1, [r1] + adds r7, r1, r0 + adds r0, r2, 0 + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 +_0807384E: + str r0, [sp, 0x54] + ldrb r1, [r7] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0807385C + b _080739B8 +_0807385C: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08073866 + b _080739B8 +_08073866: + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08073870 + b _080739B8 +_08073870: + ldrb r0, [r7, 0x2] + movs r1, 0 + bl sub_8090DAC + lsls r0, 24 + cmp r0, 0 + beq _080738EC + mov r0, r8 + adds r1, r7, 0 + movs r2, 0x2 + bl sub_8048F28 + adds r5, r0, 0 + cmp r5, 0 + beq _080738EC + ldrb r0, [r7, 0x2] + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + cmp r4, 0x9 + bne _080738A4 + ldrb r0, [r6, 0x6] + cmp r0, 0 + beq _080738EC +_080738A4: + adds r0, r5, 0 + bl sub_8084144 + lsls r0, 24 + cmp r0, 0 + beq _080738EC + cmp r4, 0x9 + bne _080738C4 + adds r0, r6, 0 + adds r0, 0x44 + movs r1, 0x31 + bl sub_8044C94 + b _080738CE + .align 2, 0 +_080738C0: .4byte gUnknown_203B460 +_080738C4: + adds r0, r6, 0 + adds r0, 0x44 + movs r1, 0x23 + bl sub_8044C94 +_080738CE: + adds r0, r6, 0 + adds r0, 0x48 + add r3, sp, 0x54 + ldrb r3, [r3] + strb r3, [r0] + mov r0, r8 + ldrh r1, [r0, 0x4] + adds r0, r6, 0 + adds r0, 0x4C + strh r1, [r0] + mov r2, r8 + ldrh r1, [r2, 0x6] + adds r0, 0x2 + strh r1, [r0] + b _080739C4 +_080738EC: + adds r0, r6, 0 + bl sub_8071A70 + lsls r0, 24 + cmp r0, 0 + beq _080739B8 + movs r3, 0x1 + mov r9, r3 +_080738FC: + ldrb r0, [r7, 0x2] + mov r1, r9 + bl sub_8090DAC + lsls r0, 24 + cmp r0, 0 + beq _080739AE + ldrb r0, [r7, 0x2] + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08073978 + mov r0, r8 + adds r1, r7, 0 + mov r2, sp + movs r3, 0 + bl sub_8073AA0 + ldr r1, _08073974 + ldr r0, [r1] + cmp r0, 0 + beq _080739AE + bl sub_8084100 + adds r4, r0, 0 + adds r0, r6, 0 + adds r0, 0x44 + movs r1, 0x24 + bl sub_8044C94 + adds r0, r6, 0 + adds r0, 0x48 + add r2, sp, 0x54 + ldrb r2, [r2] + strb r2, [r0] + mov r3, r8 + ldrh r1, [r3, 0x4] + adds r0, 0x4 + strh r1, [r0] + ldrh r0, [r3, 0x6] + adds r1, r6, 0 + adds r1, 0x4E + strh r0, [r1] + lsls r4, 2 + add r4, sp + mov r0, r8 + adds r0, 0x4 +_0807395E: + adds r1, r4, 0 + bl sub_80983D8 + movs r1, 0x7 + ands r0, r1 + adds r1, r6, 0 + adds r1, 0x46 + strb r0, [r1] + ldr r0, [r4] + str r0, [r6, 0x58] + b _080739C4 + .align 2, 0 +_08073974: .4byte gUnknown_203B440 +_08073978: + mov r0, r8 + mov r1, r9 + adds r2, r7, 0 + movs r3, 0 + bl sub_80739DC + movs r5, 0 + ldr r1, _080739D4 + ldr r0, [r1] + cmp r5, r0 + bge _080739AE + ldr r4, _080739D8 +_08073990: + lsls r2, r5, 2 + mov r10, r2 + ldr r0, [r4] + bl sub_8084144 + lsls r0, 24 + cmp r0, 0 + beq _080739A2 + b _0807379E +_080739A2: + adds r4, 0x4 + adds r5, 0x1 + ldr r3, _080739D4 + ldr r0, [r3] + cmp r5, r0 + blt _08073990 +_080739AE: + movs r0, 0x1 + add r9, r0 + mov r1, r9 + cmp r1, 0x2 + ble _080738FC +_080739B8: + ldr r2, [sp, 0x50] + adds r2, 0x1 + str r2, [sp, 0x50] + cmp r2, 0x15 + bgt _080739C4 + b _080737F0 +_080739C4: + add sp, 0x58 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080739D4: .4byte gUnknown_203B440 +_080739D8: .4byte gUnknown_202F358 + thumb_func_end sub_8073658 + + thumb_func_start sub_80739DC +sub_80739DC: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r5, r0, 0 + mov r10, r1 + mov r9, r2 + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + ldr r1, _08073A44 + movs r0, 0 + str r0, [r1] + ldr r1, _08073A48 + movs r2, 0 + adds r0, r1, 0x7 +_08073A00: + strb r2, [r0] + subs r0, 0x1 + cmp r0, r1 + bge _08073A00 + movs r7, 0 +_08073A0A: + ldr r0, _08073A4C + ldr r0, [r0] + lsls r1, r7, 2 + ldr r2, _08073A50 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08073A88 + cmp r5, r4 + beq _08073A88 + mov r0, r10 + cmp r0, 0x1 + bne _08073A54 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl sub_8071598 + lsls r0, 24 + cmp r0, 0 + bne _08073A88 + movs r6, 0x3 + b _08073A6A + .align 2, 0 +_08073A44: .4byte gUnknown_203B440 +_08073A48: .4byte gUnknown_202F350 +_08073A4C: .4byte gUnknown_203B418 +_08073A50: .4byte 0x000135cc +_08073A54: + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_8071598 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08073A88 + movs r6, 0x1 +_08073A6A: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8045990 + lsls r0, 24 + cmp r0, 0 + beq _08073A88 + mov r2, r8 + str r2, [sp] + adds r0, r5, 0 + adds r1, r4, 0 + mov r2, r9 + adds r3, r6, 0 + bl sub_8073B78 +_08073A88: + adds r7, 0x1 + cmp r7, 0x13 + ble _08073A0A + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80739DC + + thumb_func_start sub_8073AA0 +sub_8073AA0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r5, r0, 0 + mov r10, r1 + mov r9, r2 + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + ldr r1, _08073B6C + movs r0, 0 + str r0, [r1] + movs r6, 0 + adds r7, r1, 0 +_08073AC0: + ldr r0, _08073B70 + ldr r0, [r0] + lsls r1, r6, 2 + ldr r2, _08073B74 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08073B56 + cmp r5, r4 + beq _08073B56 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8045990 + lsls r0, 24 + cmp r0, 0 + beq _08073B56 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_8071598 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08073B56 + movs r3, 0x4 + ldrsh r1, [r4, r3] + movs r2, 0x4 + ldrsh r0, [r5, r2] + subs r2, r1, r0 + cmp r2, 0 + bge _08073B10 + negs r2, r2 +_08073B10: + movs r3, 0x6 + ldrsh r1, [r4, r3] + movs r3, 0x6 + ldrsh r0, [r5, r3] + subs r1, r0 + cmp r1, 0 + bge _08073B20 + negs r1, r1 +_08073B20: + cmp r1, r2 + bge _08073B26 + adds r1, r2, 0 +_08073B26: + cmp r1, 0xA + bgt _08073B56 + mov r0, r8 + cmp r0, 0 + bne _08073B44 + adds r0, r4, 0 + mov r1, r10 + movs r2, 0x1 + bl sub_8048F28 + bl sub_8084144 + lsls r0, 24 + cmp r0, 0 + beq _08073B56 +_08073B44: + ldr r2, [r7] + lsls r1, r2, 2 + add r1, r9 + ldrh r0, [r4, 0x4] + strh r0, [r1] + ldrh r0, [r4, 0x6] + strh r0, [r1, 0x2] + adds r2, 0x1 + str r2, [r7] +_08073B56: + adds r6, 0x1 + cmp r6, 0x13 + ble _08073AC0 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08073B6C: .4byte gUnknown_203B440 +_08073B70: .4byte gUnknown_203B418 +_08073B74: .4byte 0x000135cc + thumb_func_end sub_8073AA0 + + thumb_func_start sub_8073B78 +sub_8073B78: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r4, r0, 0 + adds r5, r1, 0 + mov r9, r2 + mov r10, r3 + ldr r0, [sp, 0x20] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + movs r0, 0x4 + ldrsh r1, [r4, r0] + movs r2, 0x4 + ldrsh r0, [r5, r2] + subs r2, r1, r0 + cmp r2, 0 + bge _08073BA2 + negs r2, r2 +_08073BA2: + movs r3, 0x6 + ldrsh r1, [r4, r3] + movs r6, 0x6 + ldrsh r0, [r5, r6] + subs r1, r0 + cmp r1, 0 + bge _08073BB2 + negs r1, r1 +_08073BB2: + ldr r0, [r4, 0x70] + adds r0, 0xE0 + ldrb r0, [r0] + cmp r0, 0 + bne _08073BCA + adds r0, r1, 0 + cmp r1, r2 + bge _08073BC4 + adds r0, r2, 0 +_08073BC4: + cmp r0, 0xA + ble _08073BCA + b _08073CDC +_08073BCA: + movs r6, 0x1 + negs r6, r6 + cmp r2, r1 + bne _08073C14 + movs r7, 0x4 + ldrsh r1, [r4, r7] + movs r2, 0x4 + ldrsh r0, [r5, r2] + ldrh r2, [r4, 0x4] + ldrh r3, [r5, 0x4] + cmp r1, r0 + bge _08073BFA + movs r6, 0x6 + ldrsh r1, [r4, r6] + movs r7, 0x6 + ldrsh r0, [r5, r7] + cmp r1, r0 + bge _08073BF2 + movs r6, 0x1 + b _08073C7E +_08073BF2: + cmp r1, r0 + ble _08073BFA + movs r6, 0x3 + b _08073C7E +_08073BFA: + lsls r1, r2, 16 + lsls r0, r3, 16 + movs r6, 0x7 + cmp r1, r0 + ble _08073C7A + movs r0, 0x6 + ldrsh r1, [r4, r0] + movs r2, 0x6 + ldrsh r0, [r5, r2] + cmp r1, r0 + ble _08073C7A + movs r6, 0x5 + b _08073C7E +_08073C14: + movs r3, 0x4 + ldrsh r1, [r4, r3] + movs r7, 0x4 + ldrsh r0, [r5, r7] + ldrh r2, [r4, 0x4] + ldrh r3, [r5, 0x4] + cmp r1, r0 + bne _08073C34 + movs r0, 0x6 + ldrsh r1, [r4, r0] + movs r7, 0x6 + ldrsh r0, [r5, r7] + cmp r1, r0 + bge _08073C34 + movs r6, 0 + b _08073C7E +_08073C34: + lsls r1, r2, 16 + lsls r0, r3, 16 + cmp r1, r0 + bge _08073C4C + movs r0, 0x6 + ldrsh r1, [r4, r0] + movs r7, 0x6 + ldrsh r0, [r5, r7] + cmp r1, r0 + bne _08073C4C + movs r6, 0x2 + b _08073C7E +_08073C4C: + lsls r1, r2, 16 + lsls r0, r3, 16 + cmp r1, r0 + bne _08073C64 + movs r0, 0x6 + ldrsh r1, [r4, r0] + movs r7, 0x6 + ldrsh r0, [r5, r7] + cmp r1, r0 + ble _08073C64 + movs r6, 0x4 + b _08073C7E +_08073C64: + lsls r1, r2, 16 + lsls r0, r3, 16 + cmp r1, r0 + ble _08073C7A + movs r0, 0x6 + ldrsh r1, [r4, r0] + movs r2, 0x6 + ldrsh r0, [r5, r2] + cmp r1, r0 + bne _08073C7A + movs r6, 0x6 +_08073C7A: + cmp r6, 0 + blt _08073CDC +_08073C7E: + ldr r0, _08073CC0 + adds r7, r6, r0 + ldrb r0, [r7] + cmp r0, 0 + bne _08073CDC + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + movs r3, 0xA + bl sub_807C9F8 + lsls r0, 24 + cmp r0, 0 + beq _08073CDC + movs r0, 0x1 + strb r0, [r7] + ldr r1, _08073CC4 + ldr r0, _08073CC8 + ldr r0, [r0] + lsls r0, 2 + adds r1, r0, r1 + str r6, [r1] + ldr r1, _08073CCC + adds r4, r0, r1 + mov r3, r8 + cmp r3, 0 + bne _08073CD0 + adds r0, r5, 0 + mov r1, r9 + mov r2, r10 + bl sub_8048F28 + b _08073CD2 + .align 2, 0 +_08073CC0: .4byte gUnknown_202F350 +_08073CC4: .4byte gUnknown_202F330 +_08073CC8: .4byte gUnknown_203B440 +_08073CCC: .4byte gUnknown_202F358 +_08073CD0: + movs r0, 0x64 +_08073CD2: + str r0, [r4] + ldr r1, _08073CEC + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] +_08073CDC: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08073CEC: .4byte gUnknown_203B440 + thumb_func_end sub_8073B78 + + thumb_func_start sub_8073CF0 +sub_8073CF0: + push {lr} + bl sub_8067110 + pop {r0} + bx r0 + thumb_func_end sub_8073CF0 + + thumb_func_start sub_8073CFC +sub_8073CFC: + push {lr} + bl sub_80671A0 + pop {r0} + bx r0 + thumb_func_end sub_8073CFC + + thumb_func_start sub_8073D08 +sub_8073D08: + push {lr} + bl sub_8073D14 + pop {r0} + bx r0 + thumb_func_end sub_8073D08 + + thumb_func_start sub_8073D14 +sub_8073D14: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xB0 + adds r6, r0, 0 + ldr r4, [r6, 0x70] + bl sub_8045128 + ldr r5, [r0, 0x14] + cmp r5, 0 + bne _08073D30 + b _0807407A +_08073D30: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _08073D3C + b _0807407A +_08073D3C: + ldr r0, _08073D68 + adds r1, r6, 0 + movs r2, 0 + bl sub_8045B94 + ldrb r0, [r4, 0x7] + cmp r0, 0 + beq _08073D4E + b _0807407A +_08073D4E: + ldrb r0, [r4, 0x8] + cmp r0, 0x1 + bne _08073D56 + b _0807407A +_08073D56: + adds r0, r4, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x4A + beq _08073D64 + cmp r0, 0x47 + bne _08073D6C +_08073D64: + movs r0, 0x1 + b _08073D6E + .align 2, 0 +_08073D68: .4byte gUnknown_202DF98 +_08073D6C: + movs r0, 0 +_08073D6E: + cmp r0, 0 + beq _08073D74 + b _0807407A +_08073D74: + adds r0, r4, 0 + adds r0, 0xA4 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08073D80 + b _0807407A +_08073D80: + ldr r0, [r6, 0x70] + mov r10, r0 + adds r0, r5, 0 + bl sub_8045108 + adds r5, r0, 0 + ldrb r1, [r5] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08073D98 + b _0807407A +_08073D98: + adds r0, r6, 0 + movs r1, 0x1 + bl sub_8071518 + lsls r0, 24 + cmp r0, 0 + beq _08073DC8 + ldr r0, _08073DBC + adds r1, r5, 0 + bl sub_8045BF8 + ldr r0, _08073DC0 + adds r1, r6, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08073DC4 + b _0807404C + .align 2, 0 +_08073DBC: .4byte gUnknown_202DE58 +_08073DC0: .4byte gUnknown_202DF98 +_08073DC4: .4byte gUnknown_80F8F88 +_08073DC8: + mov r1, r10 + ldrb r0, [r1, 0x6] + cmp r0, 0 + bne _08073E24 + ldrb r0, [r5, 0x2] + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6 + bne _08073E24 + mov r7, r10 + ldrb r0, [r7, 0x6] + cmp r0, 0 + beq _08073DF4 + ldr r0, _08073DF0 + bl sub_8083E38 + b _08073DFC + .align 2, 0 +_08073DF0: .4byte 0x0000014b +_08073DF4: + movs r0, 0xA6 + lsls r0, 1 + bl sub_8083E38 +_08073DFC: + adds r0, r5, 0 + bl sub_80915D4 + bl sub_80913A0 + ldr r0, _08073E1C + adds r1, r5, 0 + bl sub_8045BF8 + adds r0, r6, 0x4 + movs r1, 0x1 + bl sub_80461C8 + ldr r0, _08073E20 + b _0807404C + .align 2, 0 +_08073E1C: .4byte gUnknown_202DE58 +_08073E20: .4byte gUnknown_80F9054 +_08073E24: + ldr r0, _08073E64 + ldr r0, [r0] + ldr r1, _08073E68 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08073E70 + mov r7, r10 + ldrb r0, [r7, 0x6] + cmp r0, 0 + bne _08073E70 + movs r4, 0 + add r2, sp, 0x54 + adds r7, 0x60 + ldr r0, _08073E6C + mov r1, sp + ldr r0, [r0] + adds r3, r2, 0 +_08073E48: + stm r3!, {r0} + stm r1!, {r4} + adds r0, 0x4 + adds r4, 0x1 + cmp r4, 0x13 + ble _08073E48 + str r7, [r2, 0x50] + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x50] + movs r0, 0x15 + mov r8, r0 + b _08073E80 + .align 2, 0 +_08073E64: .4byte gUnknown_203B418 +_08073E68: .4byte 0x0000065b +_08073E6C: .4byte gUnknown_203B460 +_08073E70: + mov r0, r10 + adds r0, 0x60 + str r0, [sp, 0x54] + movs r0, 0x1 + negs r0, r0 + str r0, [sp] + movs r1, 0x1 + mov r8, r1 +_08073E80: + ldrb r0, [r5, 0x2] + add r7, sp, 0xA8 + strb r0, [r7] + adds r0, r7, 0 + ldrb r0, [r0] + cmp r0, 0x8 + bls _08073E90 + b _08073FA8 +_08073E90: + ldrb r1, [r5] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08073E9C + b _08073FA8 +_08073E9C: + movs r1, 0x1 + negs r1, r1 + mov r12, r1 + mov r7, r12 + str r7, [sp, 0xAC] + movs r4, 0 + cmp r4, r8 + bge _08073EEC + ldr r0, _08073F94 + mov r9, r0 + add r3, sp, 0x54 +_08073EB2: + ldr r2, [r3] + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08073EE4 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08073EE4 + ldr r1, [r5] + mov r7, r9 + ands r1, r7 + ldr r0, [r2] + ands r0, r7 + cmp r1, r0 + bne _08073EE4 + ldrb r0, [r2, 0x1] + cmp r0, 0x63 + beq _08073EE4 + ldr r1, [sp, 0xAC] + cmp r1, r0 + bge _08073EE4 + str r0, [sp, 0xAC] + mov r12, r4 +_08073EE4: + adds r3, 0x4 + adds r4, 0x1 + cmp r4, r8 + blt _08073EB2 +_08073EEC: + movs r0, 0x1 + negs r0, r0 + cmp r12, r0 + bne _08073F40 + mov r7, r12 + str r7, [sp, 0xAC] + movs r4, 0 + cmp r4, r8 + bge _08073F38 + add r0, sp, 0xA8 + ldrb r0, [r0] + mov r9, r0 + add r3, sp, 0x54 +_08073F06: + ldr r2, [r3] + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08073F30 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08073F30 + ldrb r1, [r2, 0x2] + cmp r9, r1 + bne _08073F30 + ldrb r0, [r2, 0x1] + cmp r0, 0x63 + beq _08073F30 + ldr r7, [sp, 0xAC] + cmp r7, r0 + bge _08073F30 + str r0, [sp, 0xAC] + mov r12, r4 +_08073F30: + adds r3, 0x4 + adds r4, 0x1 + cmp r4, r8 + blt _08073F06 +_08073F38: + movs r0, 0x1 + negs r0, r0 + cmp r12, r0 + beq _08073FA8 +_08073F40: + add r0, sp, 0x54 + mov r1, r12 + lsls r4, r1, 2 + adds r3, r0, r4 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + ldrb r0, [r5, 0x1] + adds r1, r0 + cmp r1, 0x62 + ble _08073F56 + movs r1, 0x63 +_08073F56: + strb r1, [r2, 0x1] + ldrb r1, [r5] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08073F6C + ldr r0, [r3] + ldrb r1, [r0] + movs r2, 0x8 + orrs r1, r2 + strb r1, [r0] +_08073F6C: + ldr r0, _08073F98 + adds r1, r5, 0 + bl sub_8045BF8 + adds r0, r6, 0x4 + movs r1, 0x1 + bl sub_80461C8 + movs r0, 0xA5 + lsls r0, 1 + bl sub_8083E38 + mov r7, sp + adds r0, r7, r4 + ldr r0, [r0] + cmp r0, 0 + bge _08073FA0 + ldr r0, _08073F9C + b _0807404C + .align 2, 0 +_08073F94: .4byte 0x00ff0008 +_08073F98: .4byte gUnknown_202DE58 +_08073F9C: .4byte gUnknown_80F9018 +_08073FA0: + ldr r0, _08073FA4 + b _0807404C + .align 2, 0 +_08073FA4: .4byte gUnknown_80F9050 +_08073FA8: + movs r4, 0 + cmp r4, r8 + bge _08073FD2 + ldr r0, [sp, 0x54] + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08073FD2 + movs r3, 0x1 + add r2, sp, 0x54 +_08073FBE: + adds r2, 0x4 + adds r4, 0x1 + cmp r4, r8 + bge _08073FD2 + ldr r0, [r2] + ldrb r1, [r0] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _08073FBE +_08073FD2: + cmp r4, r8 + bne _08073FEC + ldr r0, _08073FE4 + adds r1, r5, 0 + bl sub_8045BF8 + ldr r0, _08073FE8 + b _0807404C + .align 2, 0 +_08073FE4: .4byte gUnknown_202DE58 +_08073FE8: .4byte gUnknown_80F8F54 +_08073FEC: + mov r1, r10 + ldrb r0, [r1, 0x6] + cmp r0, 0 + beq _08074000 + ldr r0, _08073FFC + bl sub_8083E38 + b _08074008 + .align 2, 0 +_08073FFC: .4byte 0x0000014b +_08074000: + movs r0, 0xA5 + lsls r0, 1 + bl sub_8083E38 +_08074008: + lsls r0, r4, 2 + add r0, sp + ldr r0, [r0] + cmp r0, 0 + bge _08074034 + ldr r0, [r5] + mov r7, r10 + str r0, [r7, 0x60] + ldr r0, _0807402C + adds r1, r5, 0 + bl sub_8045BF8 + adds r0, r6, 0x4 + movs r1, 0x1 + bl sub_80461C8 + ldr r0, _08074030 + b _0807404C + .align 2, 0 +_0807402C: .4byte gUnknown_202DE58 +_08074030: .4byte gUnknown_80F9018 +_08074034: + adds r0, r5, 0 + bl sub_8091290 + lsls r0, 24 + cmp r0, 0 + beq _08074060 + ldr r0, _08074058 + adds r1, r6, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _0807405C +_0807404C: + ldr r1, [r0] + adds r0, r6, 0 + bl sub_805239C + b _0807407A + .align 2, 0 +_08074058: .4byte gUnknown_202DF98 +_0807405C: .4byte gUnknown_80F8FAC +_08074060: + ldr r0, _0807408C + adds r1, r5, 0 + bl sub_8045BF8 + adds r0, r6, 0x4 + movs r1, 0x1 + bl sub_80461C8 + ldr r0, _08074090 + ldr r1, [r0] + adds r0, r6, 0 + bl sub_805239C +_0807407A: + add sp, 0xB0 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0807408C: .4byte gUnknown_202DE58 +_08074090: .4byte gUnknown_80F9050 + thumb_func_end sub_8073D14 + + thumb_func_start sub_8074094 +sub_8074094: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x30 + adds r5, r0, 0 + cmp r5, 0 + bne _080740AA + bl _08074B2E +_080740AA: + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _080740B8 + bl _08074B2E +_080740B8: + bl sub_8044B28 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + beq _080740C8 + bl _08074B2E +_080740C8: + ldr r0, [r5, 0x70] + mov r8, r0 + movs r0, 0xA3 + lsls r0, 1 + add r0, r8 + strb r6, [r0] + bl sub_805229C + adds r0, r5, 0 + bl sub_807E8F0 + adds r0, r5, 0 + movs r1, 0x16 + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _08074170 + ldr r4, _0807434C + add r4, r8 + ldrb r0, [r4] + adds r0, 0x1 + strb r0, [r4] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x13 + bls _08074102 + movs r0, 0x13 + strb r0, [r4] +_08074102: + movs r0, 0x64 + bl sub_8084100 + ldr r2, _08074350 + ldrb r1, [r4] + lsls r1, 1 + adds r1, r2 + movs r2, 0 + ldrsh r1, [r1, r2] + cmp r0, r1 + bge _08074170 + strb r6, [r4] + adds r0, r5, 0 + bl sub_80444F4 + movs r0, 0 + bl sub_807520C + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08074136 + bl _08074B2E +_08074136: + bl sub_8044B28 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _08074146 + bl _08074B2E +_08074146: + adds r0, r5, 0 + adds r1, r5, 0 + movs r2, 0 + movs r3, 0 + bl sub_807D148 + mov r3, r8 + ldrb r0, [r3, 0x7] + cmp r0, 0 + bne _0807415C + b _080743B0 +_0807415C: + ldr r1, _08074354 + ldr r0, [r1] + strb r4, [r0, 0x1] + ldr r0, [r1] + movs r4, 0xB8 + lsls r4, 3 + adds r0, r4 + movs r1, 0x1 + negs r1, r1 + str r1, [r0] +_08074170: + mov r1, r8 + ldrb r0, [r1, 0x7] + cmp r0, 0 + bne _0807417A + b _080743B0 +_0807417A: + movs r2, 0 + mov r9, r2 + movs r4, 0xA + adds r0, r5, 0 + movs r1, 0x17 + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _08074190 + movs r4, 0 +_08074190: + adds r0, r5, 0 + movs r1, 0x1F + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _080741A0 + subs r4, 0x1 +_080741A0: + adds r0, r5, 0 + movs r1, 0x10 + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _080741B0 + subs r4, 0x1 +_080741B0: + adds r0, r5, 0 + movs r1, 0x1B + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _080741C0 + adds r4, 0x1 +_080741C0: + adds r0, r5, 0 + movs r1, 0xA + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _080741D0 + adds r4, 0x1 +_080741D0: + adds r0, r5, 0 + movs r1, 0x2B + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _080741E0 + adds r4, 0x1 +_080741E0: + cmp r4, 0 + bge _080741E6 + movs r4, 0 +_080741E6: + cmp r4, 0x13 + ble _080741EC + movs r4, 0x13 +_080741EC: + mov r3, r9 + str r3, [sp, 0x8] + ldr r0, _08074358 + str r0, [sp, 0xC] + add r6, sp, 0x10 + lsls r2, r4, 3 + ldr r0, _0807435C + adds r2, r0 + adds r0, r6, 0 + add r1, sp, 0x8 + bl sub_800A34C + ldr r2, _08074360 + add r2, r8 + ldrb r0, [r2] + cmp r0, 0x1 + bls _0807421E + ldr r1, _08074364 + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + lsls r1, 16 + ldr r0, [r6, 0x4] + adds r0, r1 + str r0, [r6, 0x4] +_0807421E: + mov r4, r9 + strb r4, [r2] + movs r4, 0x9E + lsls r4, 1 + add r4, r8 + ldr r7, [r4] + add r0, sp, 0x18 + adds r1, r6, 0 + bl sub_80943A8 + ldr r2, [sp, 0x18] + add r0, sp, 0x1C + adds r1, r7, 0 + bl sub_80942C0 + ldr r0, [sp, 0x1C] + str r0, [r4] + movs r6, 0x1 + adds r0, r7, 0 + bl sub_8094450 + cmp r0, 0x13 + ble _0807425C + ldr r0, [r4] + bl sub_8094450 + cmp r0, 0x13 + bgt _0807425C + ldr r0, _08074368 + ldr r0, [r0] + mov r9, r0 +_0807425C: + adds r0, r7, 0 + bl sub_8094450 + cmp r0, 0x9 + ble _0807427C + movs r0, 0x9E + lsls r0, 1 + add r0, r8 + ldr r0, [r0] + bl sub_8094450 + cmp r0, 0x9 + bgt _0807427C + ldr r0, _0807436C + ldr r0, [r0] + mov r9, r0 +_0807427C: + movs r4, 0x9E + lsls r4, 1 + add r4, r8 + ldr r0, [r4] + bl sub_8094450 + cmp r0, 0 + bne _08074298 + add r0, sp, 0x20 + movs r1, 0 + bl sub_80943A0 + ldr r0, [sp, 0x20] + str r0, [r4] +_08074298: + ldr r0, [r4] + bl sub_8094450 + cmp r0, 0 + bge _080742AE + add r0, sp, 0x24 + movs r1, 0 + bl sub_80943A0 + ldr r0, [sp, 0x24] + str r0, [r4] +_080742AE: + ldr r0, [r4] + bl sub_8094450 + cmp r0, 0 + bne _08074384 + bl sub_805E804 + adds r0, r5, 0 + bl sub_80444F4 + movs r0, 0 + bl sub_807520C + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _080742D8 + bl _08074B2E +_080742D8: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _080742E6 + bl _08074B2E +_080742E6: + ldr r3, _08074354 + ldr r0, [r3] + ldr r2, _08074370 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0x9 + bhi _080742F8 + adds r0, 0x1 + strb r0, [r1] +_080742F8: + ldr r0, [r3] + adds r0, r2 + ldrb r2, [r0] + cmp r2, 0x1 + bne _08074308 + ldr r0, _08074374 + ldr r0, [r0] + mov r9, r0 +_08074308: + cmp r2, 0x2 + bne _08074314 + ldr r0, _08074378 + ldr r0, [r0] + mov r9, r0 + movs r6, 0 +_08074314: + cmp r2, 0x3 + bne _08074320 + ldr r0, _0807437C + ldr r0, [r0] + mov r9, r0 + movs r6, 0 +_08074320: + adds r0, r5, 0 + adds r1, r5, 0 + bl sub_807A96C + ldr r3, _08074380 + adds r0, r5, 0 + movs r1, 0x1 + movs r2, 0xE + bl sub_806F324 + movs r1, 0xA3 + lsls r1, 1 + add r1, r8 + movs r0, 0x1 + strb r0, [r1] + ldr r0, [r4] + bl sub_8094450 + cmp r0, 0 + beq _08074390 + b _080743B0 + .align 2, 0 +_0807434C: .4byte 0x00000169 +_08074350: .4byte gUnknown_80F5594 +_08074354: .4byte gUnknown_203B418 +_08074358: .4byte 0x0000199a +_0807435C: .4byte gUnknown_80F54F4 +_08074360: .4byte 0x00000153 +_08074364: .4byte gUnknown_80F60DC +_08074368: .4byte gUnknown_80FD594 +_0807436C: .4byte gUnknown_80FD5B8 +_08074370: .4byte 0x00000679 +_08074374: .4byte gUnknown_80FD5DC +_08074378: .4byte gUnknown_80FD608 +_0807437C: .4byte gUnknown_80FD628 +_08074380: .4byte 0x00000211 +_08074384: + ldr r0, _08074408 + ldr r0, [r0] + ldr r1, _0807440C + adds r0, r1 + movs r1, 0 + strb r1, [r0] +_08074390: + mov r2, r9 + cmp r2, 0 + beq _080743B0 + cmp r6, 0 + beq _080743A0 + ldr r0, _08074410 + bl sub_8083E38 +_080743A0: + adds r0, r5, 0 + mov r1, r9 + bl sub_80522A8 + movs r0, 0x1E + movs r1, 0x32 + bl sub_803E708 +_080743B0: + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _080743BE + b _08074B2E +_080743BE: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _080743CA + b _08074B2E +_080743CA: + ldr r0, _08074408 + ldr r0, [r0] + ldr r3, _08074414 + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0 + bne _08074480 + adds r0, r5, 0 + bl sub_807E580 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bne _0807441C + adds r0, r5, 0 + movs r1, 0x6 + bl sub_8071858 + lsls r0, 24 + cmp r0, 0 + bne _08074466 + ldr r0, _08074418 + movs r4, 0 + ldrsh r1, [r0, r4] + movs r3, 0x88 + lsls r3, 2 + adds r0, r5, 0 + movs r2, 0x12 + bl sub_806F324 + b _08074466 + .align 2, 0 +_08074408: .4byte gUnknown_203B418 +_0807440C: .4byte 0x00000679 +_08074410: .4byte 0x00000153 +_08074414: .4byte 0x0000e266 +_08074418: .4byte gUnknown_80F4F8E +_0807441C: + adds r0, r5, 0 + bl sub_807E580 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08074466 + adds r0, r5, 0 + movs r1, 0x9 + bl sub_8071858 + lsls r0, 24 + cmp r0, 0 + bne _08074466 + adds r0, r5, 0 + movs r1, 0xD + bl sub_8071858 + lsls r0, 24 + cmp r0, 0 + bne _08074466 + adds r0, r5, 0 + movs r1, 0x11 + bl sub_8071858 + lsls r0, 24 + cmp r0, 0 + bne _08074466 + ldr r0, _08074608 + movs r2, 0 + ldrsh r1, [r0, r2] + movs r3, 0x88 + lsls r3, 2 + adds r0, r5, 0 + movs r2, 0x12 + bl sub_806F324 +_08074466: + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08074474 + b _08074B2E +_08074474: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _08074480 + b _08074B2E +_08074480: + movs r0, 0x64 + bl sub_8084100 + adds r4, r0, 0 + adds r0, r5, 0 + movs r1, 0x21 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _080744D8 + ldr r0, _0807460C + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r4, r0 + bge _080744D8 + adds r0, r5, 0 + bl sub_8070A58 + lsls r0, 24 + cmp r0, 0 + beq _080744D8 + movs r0, 0 + bl sub_807520C + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _080744C0 + b _08074B2E +_080744C0: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _080744CC + b _08074B2E +_080744CC: + adds r0, r5, 0 + adds r1, r5, 0 + movs r2, 0x1 + movs r3, 0 + bl sub_8079F20 +_080744D8: + adds r0, r5, 0 + movs r1, 0xB + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0807450C + ldr r2, _08074610 + add r2, r8 + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] + ldrb r1, [r2] + ldr r0, _08074614 + movs r4, 0 + ldrsh r0, [r0, r4] + cmp r1, r0 + blt _0807450C + movs r0, 0 + strb r0, [r2] + adds r0, r5, 0 + adds r1, r5, 0 + movs r2, 0x7F + movs r3, 0 + bl sub_8077910 +_0807450C: + mov r0, r8 + adds r0, 0xA8 + ldrb r0, [r0] + cmp r0, 0x4 + bne _0807453C + movs r0, 0 + bl sub_807520C + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _0807452A + b _08074B2E +_0807452A: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _08074536 + b _08074B2E +_08074536: + adds r0, r5, 0 + bl sub_80420B8 +_0807453C: + mov r0, r8 + adds r0, 0xAC + ldrb r1, [r0] + adds r6, r0, 0 + cmp r1, 0x1 + bne _080745B6 + mov r4, r8 + adds r4, 0xAE + ldrb r0, [r4] + cmp r0, 0 + beq _0807455C + subs r0, 0x1 + strb r0, [r4] + lsls r0, 24 + cmp r0, 0 + bne _0807459C +_0807455C: + movs r0, 0 + bl sub_807520C + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08074570 + b _08074B2E +_08074570: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _0807457C + b _08074B2E +_0807457C: + ldr r0, _08074618 + ldrh r0, [r0] + strb r0, [r4] + adds r0, r5, 0 + adds r1, r5, 0 + bl sub_807A96C + ldr r0, _0807461C + movs r2, 0 + ldrsh r1, [r0, r2] + movs r3, 0x82 + lsls r3, 2 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_806F324 +_0807459C: + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _080745AA + b _08074B2E +_080745AA: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _080745B6 + b _08074B2E +_080745B6: + ldrb r0, [r6] + cmp r0, 0x2 + bne _08074628 + mov r4, r8 + adds r4, 0xAE + ldrb r0, [r4] + cmp r0, 0 + beq _080745D0 + subs r0, 0x1 + strb r0, [r4] + lsls r0, 24 + cmp r0, 0 + bne _08074696 +_080745D0: + movs r0, 0 + bl sub_807520C + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _080745E4 + b _08074B2E +_080745E4: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _080745F0 + b _08074B2E +_080745F0: + ldr r0, _08074620 + ldrh r0, [r0] + strb r0, [r4] + adds r0, r5, 0 + adds r1, r5, 0 + bl sub_807A96C + ldr r0, _08074624 + movs r3, 0 + ldrsh r1, [r0, r3] + b _0807468C + .align 2, 0 +_08074608: .4byte gUnknown_80F4F8E +_0807460C: .4byte gUnknown_80F4E0C +_08074610: .4byte 0x00000113 +_08074614: .4byte gUnknown_80F4F30 +_08074618: .4byte gUnknown_80F4F32 +_0807461C: .4byte gUnknown_80F4F70 +_08074620: .4byte gUnknown_80F4F34 +_08074624: .4byte gUnknown_80F4F72 +_08074628: + cmp r0, 0x3 + bne _080746B0 + mov r2, r8 + adds r2, 0xAE + ldrb r0, [r2] + cmp r0, 0 + beq _08074640 + subs r0, 0x1 + strb r0, [r2] + lsls r0, 24 + cmp r0, 0 + bne _08074696 +_08074640: + mov r1, r8 + adds r1, 0xAF + ldrb r4, [r1] + cmp r4, 0x1C + bhi _0807464E + adds r0, r4, 0x1 + strb r0, [r1] +_0807464E: + ldr r0, _08074718 + ldrh r0, [r0] + strb r0, [r2] + cmp r4, 0x1C + ble _0807465A + movs r4, 0x1D +_0807465A: + movs r0, 0 + bl sub_807520C + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _0807466E + b _08074B2E +_0807466E: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _0807467A + b _08074B2E +_0807467A: + adds r0, r5, 0 + adds r1, r5, 0 + bl sub_807A96C + ldr r1, _0807471C + lsls r0, r4, 1 + adds r0, r1 + movs r4, 0 + ldrsh r1, [r0, r4] +_0807468C: + ldr r3, _08074720 + adds r0, r5, 0 + movs r2, 0x3 + bl sub_806F324 +_08074696: + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _080746A4 + b _08074B2E +_080746A4: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _080746B0 + b _08074B2E +_080746B0: + mov r0, r8 + adds r0, 0xB0 + ldrb r1, [r0] + mov r10, r0 + cmp r1, 0x7 + bne _08074730 + mov r4, r8 + adds r4, 0xB9 + ldrb r0, [r4] + cmp r0, 0 + beq _080746D0 + subs r0, 0x1 + strb r0, [r4] + lsls r0, 24 + cmp r0, 0 + bne _08074786 +_080746D0: + movs r0, 0 + bl sub_807520C + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _080746E4 + b _08074B2E +_080746E4: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _080746F0 + b _08074B2E +_080746F0: + ldr r0, _08074724 + ldrh r0, [r0] + strb r0, [r4] + adds r0, r5, 0 + adds r1, r5, 0 + bl sub_807A96C + mov r0, r8 + adds r0, 0xB4 + ldr r1, [r0] + adds r0, r5, 0 + bl sub_8041C4C + ldr r0, _08074728 + movs r2, 0 + ldrsh r1, [r0, r2] + ldr r3, _0807472C + adds r0, r5, 0 + movs r2, 0x2 + b _08074782 + .align 2, 0 +_08074718: .4byte gUnknown_80F4F36 +_0807471C: .4byte gUnknown_80F4FC8 +_08074720: .4byte 0x0000020a +_08074724: .4byte gUnknown_80F4F38 +_08074728: .4byte gUnknown_80F4F74 +_0807472C: .4byte 0x00000209 +_08074730: + cmp r1, 0x4 + bne _080747B0 + mov r4, r8 + adds r4, 0xB9 + ldrb r0, [r4] + cmp r0, 0 + beq _08074748 + subs r0, 0x1 + strb r0, [r4] + lsls r0, 24 + cmp r0, 0 + bne _08074786 +_08074748: + movs r0, 0 + bl sub_807520C + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _0807475C + b _08074B2E +_0807475C: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _08074768 + b _08074B2E +_08074768: + ldr r0, _080747A4 + ldrh r0, [r0] + strb r0, [r4] + adds r0, r5, 0 + adds r1, r5, 0 + bl sub_807A96C + ldr r0, _080747A8 + movs r3, 0 + ldrsh r1, [r0, r3] + ldr r3, _080747AC + adds r0, r5, 0 + movs r2, 0x5 +_08074782: + bl sub_806F324 +_08074786: + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08074794 + b _08074B2E +_08074794: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _080747A0 + b _08074B2E +_080747A0: + b _08074802 + .align 2, 0 +_080747A4: .4byte gUnknown_80F4F3A +_080747A8: .4byte gUnknown_80F4F76 +_080747AC: .4byte 0x0000020b +_080747B0: + cmp r1, 0x5 + bne _08074802 + mov r4, r8 + adds r4, 0xB9 + ldrb r0, [r4] + cmp r0, 0 + beq _080747C8 + subs r0, 0x1 + strb r0, [r4] + lsls r0, 24 + cmp r0, 0 + bne _08074802 +_080747C8: + movs r0, 0 + bl sub_807520C + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _080747DC + b _08074B2E +_080747DC: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _080747E8 + b _08074B2E +_080747E8: + ldr r0, _080748D4 + ldrh r0, [r0] + strb r0, [r4] + ldr r0, _080748D8 + movs r4, 0 + ldrsh r2, [r0, r4] + movs r0, 0x1 + str r0, [sp] + adds r0, r5, 0 + adds r1, r5, 0 + movs r3, 0 + bl sub_8077C44 +_08074802: + mov r0, r8 + adds r0, 0xC8 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0807488A + mov r2, r8 + adds r2, 0xCC + ldrb r0, [r2] + cmp r0, 0 + beq _08074820 + subs r0, 0x1 + strb r0, [r2] + lsls r0, 24 + cmp r0, 0 + bne _08074870 +_08074820: + mov r0, r8 + movs r3, 0x10 + ldrsh r1, [r0, r3] + cmp r1, 0 + bge _0807482C + adds r1, 0x3 +_0807482C: + asrs r4, r1, 2 + cmp r4, 0 + bne _08074834 + movs r4, 0x1 +_08074834: + ldr r0, _080748DC + ldrh r0, [r0] + strb r0, [r2] + movs r0, 0 + bl sub_807520C + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _0807484E + b _08074B2E +_0807484E: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _0807485A + b _08074B2E +_0807485A: + adds r0, r5, 0 + adds r1, r5, 0 + bl sub_807A96C + movs r3, 0x83 + lsls r3, 2 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x7 + bl sub_806F324 +_08074870: + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _0807487E + b _08074B2E +_0807487E: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _0807488A + b _08074B2E +_0807488A: + mov r3, r8 + adds r3, 0xD0 + ldrb r4, [r3] + mov r9, r4 + cmp r4, 0x1 + beq _08074898 + b _080749AE +_08074898: + mov r2, r8 + adds r2, 0xDA + ldrb r0, [r2] + cmp r0, 0 + beq _080748AC + subs r0, 0x1 + strb r0, [r2] + lsls r0, 24 + cmp r0, 0 + bne _08074994 +_080748AC: + ldr r0, _080748E0 + movs r1, 0 + ldrsh r6, [r0, r1] + ldr r0, _080748E4 + ldr r1, [r0] + mov r0, r8 + adds r0, 0xD8 + ldrb r0, [r0] + lsls r0, 2 + ldr r4, _080748E8 + adds r1, r4 + adds r1, r0 + ldr r4, [r1] + ldr r0, _080748EC + ldrh r0, [r0] + strb r0, [r2] + cmp r4, 0 + bne _080748F0 + strb r4, [r3] + b _08074994 + .align 2, 0 +_080748D4: .4byte gUnknown_80F4F3C +_080748D8: .4byte gUnknown_80F4FB2 +_080748DC: .4byte gUnknown_80F4F3E +_080748E0: .4byte gUnknown_80F4FB4 +_080748E4: .4byte gUnknown_203B418 +_080748E8: .4byte 0x000135cc +_080748EC: .4byte gUnknown_80F4F40 +_080748F0: + ldr r0, [r4, 0x70] + adds r0, 0x98 + mov r1, r8 + adds r1, 0xD4 + ldr r2, [r0] + ldr r0, [r1] + cmp r2, r0 + beq _08074906 + movs r0, 0 + strb r0, [r3] + b _08074994 +_08074906: + adds r0, r5, 0 + movs r1, 0x3A + bl sub_8071824 + lsls r0, 24 + lsrs r7, r0, 24 + adds r0, r5, 0 + bl sub_80444F4 + movs r0, 0 + bl sub_807520C + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _0807492C + b _08074B2E +_0807492C: + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _0807493A + b _08074B2E +_0807493A: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _08074946 + b _08074B2E +_08074946: + mov r1, r10 + ldrb r0, [r1] + cmp r0, 0x1 + beq _08074994 + adds r0, r5, 0 + adds r1, r5, 0 + bl sub_807A96C + ldr r3, _08074980 + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0x9 + bl sub_806F324 + cmp r7, 0 + beq _08074984 + adds r0, r4, 0 + adds r1, r4, 0 + bl sub_807A96C + movs r3, 0xFD + lsls r3, 1 + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0xD + bl sub_806F324 + b _08074994 + .align 2, 0 +_08074980: .4byte 0x0000020d +_08074984: + mov r2, r9 + str r2, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r6, 0 + movs r3, 0 + bl sub_8077C44 +_08074994: + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _080749A2 + b _08074B2E +_080749A2: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _080749AE + b _08074B2E +_080749AE: + mov r4, r8 + adds r4, 0xFD + ldrb r0, [r4] + cmp r0, 0 + beq _08074A46 + adds r0, r4, 0 + bl sub_80838EC + ldrb r0, [r4] + cmp r0, 0 + bne _08074A46 + movs r0, 0 + bl sub_807520C + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _080749D8 + b _08074B2E +_080749D8: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _080749E4 + b _08074B2E +_080749E4: + ldr r0, _08074A18 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08074A1C + ldr r1, [r0] + adds r0, r5, 0 + bl sub_80522A8 + adds r0, r5, 0 + adds r1, r5, 0 + bl sub_807A96C + mov r0, r8 + adds r0, 0xC4 + ldrb r0, [r0] + cmp r0, 0x7 + bne _08074A24 + ldr r0, _08074A20 + ldr r1, [r0] + adds r0, r5, 0 + bl sub_80522A8 + b _08074A30 + .align 2, 0 +_08074A18: .4byte gUnknown_202DFE8 +_08074A1C: .4byte gUnknown_80FEB30 +_08074A20: .4byte gUnknown_810075C +_08074A24: + ldr r1, _08074B40 + ldr r3, _08074B44 + adds r0, r5, 0 + movs r2, 0xB + bl sub_806F324 +_08074A30: + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08074B2E + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _08074B2E +_08074A46: + mov r0, r8 + adds r0, 0xC0 + ldrb r1, [r0] + adds r7, r0, 0 + cmp r1, 0x1 + bne _08074AD4 + mov r4, r8 + adds r4, 0xC1 + adds r0, r4, 0 + bl sub_80838EC + ldrb r0, [r4] + cmp r0, 0 + bne _08074AD4 + strb r0, [r7] + adds r0, r5, 0 + movs r1, 0 + bl sub_8070B6C + lsls r0, 24 + cmp r0, 0 + bne _08074AD4 + adds r0, r5, 0 + movs r1, 0 + bl sub_8070D04 + lsls r0, 24 + cmp r0, 0 + bne _08074AD4 + adds r0, r5, 0 + bl sub_8070CD0 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _08074AD4 + movs r0, 0 + bl sub_807520C + add r4, sp, 0x28 + ldr r1, _08074B48 + adds r0, r4, 0 + bl sub_8092A88 + ldrb r0, [r4] + movs r1, 0x10 + orrs r0, r1 + strb r0, [r4] + str r6, [sp] + str r4, [sp, 0x4] + adds r0, r5, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl sub_8055FA0 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08074B2E + bl sub_8044B28 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _08074B2E + mov r0, r8 + adds r0, 0xA0 + str r1, [r0] +_08074AD4: + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08074B2E + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _08074B2E + ldrb r0, [r7] + cmp r0, 0xC + bne _08074B1E + mov r4, r8 + adds r4, 0xC1 + adds r0, r4, 0 + bl sub_80838EC + ldrb r0, [r4] + cmp r0, 0 + bne _08074B1E + strb r0, [r7] + movs r1, 0xA5 + lsls r1, 1 + add r1, r8 + strb r0, [r1] + ldr r0, _08074B4C + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08074B50 + ldr r1, [r0] + adds r0, r5, 0 + bl sub_80522A8 +_08074B1E: + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08074B2E + bl sub_8044B28 +_08074B2E: + add sp, 0x30 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08074B40: .4byte 0x0000270f +_08074B44: .4byte 0x0000020e +_08074B48: .4byte 0x00000165 +_08074B4C: .4byte gUnknown_202DF98 +_08074B50: .4byte gUnknown_80FABD8 + thumb_func_end sub_8074094 + + thumb_func_start sub_8074B54 +sub_8074B54: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + cmp r7, 0 + bne _08074B62 + b _08074F96 +_08074B62: + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08074B6E + b _08074F96 +_08074B6E: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _08074B7A + b _08074F96 +_08074B7A: + bl sub_805229C + ldr r6, [r7, 0x70] + movs r1, 0xA3 + lsls r1, 1 + adds r0, r6, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _08074C48 + adds r0, r6, 0 + adds r0, 0xAC + ldrb r0, [r0] + cmp r0, 0x2 + beq _08074C48 + cmp r0, 0x3 + beq _08074C48 + movs r4, 0 + ldrb r0, [r6, 0x6] + cmp r0, 0 + bne _08074BAE + movs r2, 0x2 + ldrsh r0, [r6, r2] + bl sub_808DB2C + lsls r0, 24 + lsrs r4, r0, 24 +_08074BAE: + cmp r4, 0 + beq _08074C48 + adds r0, r7, 0 + movs r1, 0xA + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _08074BC8 + ldr r0, _08074EF8 + movs r3, 0 + ldrsh r0, [r0, r3] + adds r4, r0 +_08074BC8: + adds r0, r6, 0 + adds r0, 0xC4 + ldrb r0, [r0] + cmp r0, 0x6 + bne _08074BDA + ldr r0, _08074EFC + movs r1, 0 + ldrsh r0, [r0, r1] + adds r4, r0 +_08074BDA: + adds r0, r7, 0 + movs r1, 0x3 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _08074BFE + adds r0, r7, 0 + bl sub_807E580 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bne _08074BFE + ldr r0, _08074F00 + movs r2, 0 + ldrsh r0, [r0, r2] + adds r4, r0 +_08074BFE: + movs r0, 0xFA + lsls r0, 1 + cmp r4, r0 + ble _08074C08 + adds r4, r0, 0 +_08074C08: + cmp r4, 0x1D + bgt _08074C0E + movs r4, 0x1E +_08074C0E: + movs r3, 0xFC + lsls r3, 1 + adds r1, r6, r3 + ldrh r0, [r6, 0x10] + ldrh r2, [r1] + adds r0, r2 + strh r0, [r1] + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, r4 + blt _08074C38 +_08074C24: + ldrh r0, [r6, 0xE] + adds r0, 0x1 + strh r0, [r6, 0xE] + ldrh r0, [r1] + subs r0, r4 + strh r0, [r1] + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, r4 + bge _08074C24 +_08074C38: + movs r3, 0xE + ldrsh r1, [r6, r3] + ldrh r2, [r6, 0x10] + movs r3, 0x10 + ldrsh r0, [r6, r3] + cmp r1, r0 + blt _08074C48 + strh r2, [r6, 0xE] +_08074C48: + adds r0, r6, 0 + adds r0, 0xA8 + ldrb r0, [r0] + cmp r0, 0 + beq _08074C6E + adds r4, r6, 0 + adds r4, 0xA9 + adds r0, r4, 0 + bl sub_80838EC + ldrb r0, [r4] + cmp r0, 0 + bne _08074C6E + adds r0, r7, 0 + adds r1, r7, 0 + movs r2, 0x1 + movs r3, 0x1 + bl sub_807A124 +_08074C6E: + adds r0, r7, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08074C7C + b _08074F96 +_08074C7C: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _08074C88 + b _08074F96 +_08074C88: + adds r0, r6, 0 + adds r0, 0xAC + ldrb r0, [r0] + cmp r0, 0 + beq _08074CAA + adds r4, r6, 0 + adds r4, 0xAD + adds r0, r4, 0 + bl sub_80838EC + ldrb r0, [r4] + cmp r0, 0 + bne _08074CAA + adds r0, r7, 0 + adds r1, r7, 0 + bl sub_807A290 +_08074CAA: + adds r0, r7, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08074CB8 + b _08074F96 +_08074CB8: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _08074CC4 + b _08074F96 +_08074CC4: + adds r0, r6, 0 + adds r0, 0xB0 + ldrb r0, [r0] + cmp r0, 0 + beq _08074CE6 + adds r4, r6, 0 + adds r4, 0xB8 + adds r0, r4, 0 + bl sub_80838EC + ldrb r0, [r4] + cmp r0, 0 + bne _08074CE6 + adds r0, r7, 0 + adds r1, r7, 0 + bl sub_807A324 +_08074CE6: + adds r0, r7, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08074CF4 + b _08074F96 +_08074CF4: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _08074D00 + b _08074F96 +_08074D00: + adds r0, r6, 0 + adds r0, 0xBC + ldrb r0, [r0] + cmp r0, 0 + beq _08074D22 + adds r4, r6, 0 + adds r4, 0xBD + adds r0, r4, 0 + bl sub_80838EC + ldrb r0, [r4] + cmp r0, 0 + bne _08074D22 + adds r0, r7, 0 + adds r1, r7, 0 + bl sub_807A400 +_08074D22: + adds r0, r7, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08074D30 + b _08074F96 +_08074D30: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _08074D3C + b _08074F96 +_08074D3C: + adds r0, r6, 0 + adds r0, 0xC4 + ldrb r0, [r0] + cmp r0, 0 + beq _08074D5E + adds r4, r6, 0 + adds r4, 0xC5 + adds r0, r4, 0 + bl sub_80838EC + ldrb r0, [r4] + cmp r0, 0 + bne _08074D5E + adds r0, r7, 0 + adds r1, r7, 0 + bl sub_807A4C8 +_08074D5E: + adds r0, r7, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08074D6C + b _08074F96 +_08074D6C: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _08074D78 + b _08074F96 +_08074D78: + adds r0, r6, 0 + adds r0, 0xC8 + ldrb r0, [r0] + cmp r0, 0 + beq _08074D9C + adds r4, r6, 0 + adds r4, 0xCB + adds r0, r4, 0 + bl sub_80838EC + ldrb r0, [r4] + cmp r0, 0 + bne _08074D9C + adds r0, r7, 0 + adds r1, r7, 0 + movs r2, 0 + bl sub_807A5D0 +_08074D9C: + adds r0, r7, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08074DAA + b _08074F96 +_08074DAA: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _08074DB6 + b _08074F96 +_08074DB6: + adds r0, r6, 0 + adds r0, 0xD0 + ldrb r0, [r0] + cmp r0, 0 + beq _08074DD8 + adds r4, r6, 0 + adds r4, 0xD9 + adds r0, r4, 0 + bl sub_80838EC + ldrb r0, [r4] + cmp r0, 0 + bne _08074DD8 + adds r0, r7, 0 + adds r1, r7, 0 + bl sub_807A6C8 +_08074DD8: + adds r0, r7, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08074DE6 + b _08074F96 +_08074DE6: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _08074DF2 + b _08074F96 +_08074DF2: + adds r0, r6, 0 + adds r0, 0xDC + ldrb r0, [r0] + cmp r0, 0 + beq _08074E14 + adds r4, r6, 0 + adds r4, 0xDD + adds r0, r4, 0 + bl sub_80838EC + ldrb r0, [r4] + cmp r0, 0 + bne _08074E14 + adds r0, r7, 0 + adds r1, r7, 0 + bl sub_807A734 +_08074E14: + adds r0, r7, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08074E22 + b _08074F96 +_08074E22: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _08074E2E + b _08074F96 +_08074E2E: + adds r0, r6, 0 + adds r0, 0xE4 + ldrb r0, [r0] + cmp r0, 0 + beq _08074E50 + adds r4, r6, 0 + adds r4, 0xE5 + adds r0, r4, 0 + bl sub_80838EC + ldrb r0, [r4] + cmp r0, 0 + bne _08074E50 + adds r0, r7, 0 + adds r1, r7, 0 + bl sub_807A7C8 +_08074E50: + adds r0, r7, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08074E5E + b _08074F96 +_08074E5E: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _08074E6A + b _08074F96 +_08074E6A: + adds r0, r6, 0 + adds r0, 0xE8 + ldrb r0, [r0] + cmp r0, 0 + beq _08074E8C + adds r4, r6, 0 + adds r4, 0xE9 + adds r0, r4, 0 + bl sub_80838EC + ldrb r0, [r4] + cmp r0, 0 + bne _08074E8C + adds r0, r7, 0 + adds r1, r7, 0 + bl sub_807A888 +_08074E8C: + adds r0, r7, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08074E9A + b _08074F96 +_08074E9A: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _08074F96 + adds r0, r6, 0 + adds r0, 0xEC + ldrb r0, [r0] + cmp r0, 0 + beq _08074EC6 + adds r4, r6, 0 + adds r4, 0xED + adds r0, r4, 0 + bl sub_80838EC + ldrb r0, [r4] + cmp r0, 0 + bne _08074EC6 + adds r0, r7, 0 + adds r1, r7, 0 + bl sub_807A924 +_08074EC6: + adds r0, r7, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08074F96 + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _08074F96 + adds r4, r6, 0 + adds r4, 0xFA + ldrb r0, [r4] + cmp r0, 0 + beq _08074F18 + adds r0, r4, 0 + bl sub_80838EC + ldrb r0, [r4] + cmp r0, 0 + bne _08074F18 + ldr r0, _08074F04 + adds r1, r7, 0 + b _08074F08 + .align 2, 0 +_08074EF8: .4byte gUnknown_80F4FC4 +_08074EFC: .4byte gUnknown_80F4FC0 +_08074F00: .4byte gUnknown_80F4FC2 +_08074F04: .4byte gUnknown_202DF98 +_08074F08: + movs r2, 0 + bl sub_8045B94 + ldr r0, _08074FA0 + ldr r1, [r0] + adds r0, r7, 0 + bl sub_80522A8 +_08074F18: + movs r0, 0 + mov r8, r0 + movs r5, 0 +_08074F1E: + ldr r1, _08074FA4 + adds r0, r6, r1 + adds r4, r0, r5 + ldrb r0, [r4] + cmp r0, 0 + beq _08074F3C + adds r0, r5, r1 + adds r0, r6, r0 + bl sub_80838EC + ldrb r0, [r4] + cmp r0, 0 + bne _08074F3C + movs r2, 0x1 + mov r8, r2 +_08074F3C: + movs r3, 0x84 + lsls r3, 1 + adds r0, r6, r3 + adds r4, r0, r5 + ldrb r0, [r4] + cmp r0, 0 + beq _08074F5C + adds r0, r5, r3 + adds r0, r6, r0 + bl sub_80838EC + ldrb r0, [r4] + cmp r0, 0 + bne _08074F5C + movs r0, 0x1 + mov r8, r0 +_08074F5C: + adds r5, 0x1 + cmp r5, 0x4 + ble _08074F1E + mov r1, r8 + cmp r1, 0 + beq _08074F96 + ldr r0, [r7, 0x70] + movs r2, 0x82 + lsls r2, 1 + adds r0, r2 + ldr r4, [r0] + adds r0, r7, 0 + bl sub_8070774 + adds r5, r0, 0 + cmp r4, r5 + beq _08074F96 + ldr r0, _08074FA8 + adds r1, r7, 0 + movs r2, 0 + bl sub_8045B94 + ldr r1, _08074FAC + lsls r0, r5, 2 + adds r0, r1 + ldr r1, [r0] + adds r0, r7, 0 + bl sub_80522A8 +_08074F96: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08074FA0: .4byte gUnknown_8100740 +_08074FA4: .4byte 0x0000010d +_08074FA8: .4byte gUnknown_202DF98 +_08074FAC: .4byte gUnknown_80FA124 + thumb_func_end sub_8074B54 + + thumb_func_start sub_8074FB0 +sub_8074FB0: + push {r4-r6,lr} + adds r3, r0, 0 + adds r5, r1, 0 + ldr r4, [r3, 0x70] + movs r1, 0xFA + lsls r1, 1 + adds r0, r4, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x3 + ble _08074FD0 + adds r1, r4, 0 + adds r1, 0x44 + movs r0, 0 + strh r0, [r1] + b _08075040 +_08074FD0: + ldr r0, _08074FE0 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0 + beq _08074FE8 + ldr r1, _08074FE4 + movs r0, 0x2 + b _08074FEC + .align 2, 0 +_08074FE0: .4byte gUnknown_203B46C +_08074FE4: .4byte gUnknown_202F378 +_08074FE8: + ldr r1, _08075048 + movs r0, 0x1 +_08074FEC: + str r0, [r1] + adds r6, r1, 0 + movs r1, 0xFA + lsls r1, 1 + adds r0, r4, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + movs r0, 0xC2 + lsls r0, 1 + adds r1, r0 + adds r1, r4, r1 + movs r0, 0 + strb r0, [r1, 0x1A] + str r5, [r1, 0xC] + ldrh r0, [r3, 0x4] + strh r0, [r1] + ldrh r0, [r3, 0x6] + strh r0, [r1, 0x2] + movs r3, 0 + ldrsh r0, [r2, r3] + str r0, [r1, 0x4] + movs r3, 0x2 + ldrsh r0, [r2, r3] + str r0, [r1, 0x8] + ldr r0, _0807504C + lsls r2, r5, 2 + adds r2, r0 + movs r5, 0 + ldrsh r0, [r2, r5] + ldr r3, [r6] + muls r0, r3 + str r0, [r1, 0x10] + movs r5, 0x2 + ldrsh r0, [r2, r5] + muls r0, r3 + str r0, [r1, 0x14] + adds r0, r4, 0 + bl sub_8075050 +_08075040: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08075048: .4byte gUnknown_202F378 +_0807504C: .4byte gUnknown_80F4D44 + thumb_func_end sub_8074FB0 + + thumb_func_start sub_8075050 +sub_8075050: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + mov r9, r0 + adds r6, r1, 0 + ldr r0, _08075070 + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0 + beq _08075078 + ldr r1, _08075074 + movs r0, 0x2 + b _0807507C + .align 2, 0 +_08075070: .4byte gUnknown_203B46C +_08075074: .4byte gUnknown_202F378 +_08075078: + ldr r1, _080750D0 + movs r0, 0x1 +_0807507C: + str r0, [r1] + movs r1, 0xFA + lsls r1, 1 + add r1, r9 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + bne _080750D4 + ldr r0, _080750D0 + ldr r1, [r0] + lsls r1, 1 + movs r0, 0x18 + bl __divsi3 + movs r1, 0xCE + lsls r1, 1 + add r1, r9 + strh r0, [r1] + movs r2, 0xCA + lsls r2, 1 + add r2, r9 + ldr r1, [r2] + lsls r1, 1 + str r1, [r2] + movs r2, 0xCC + lsls r2, 1 + add r2, r9 + ldr r1, [r2] + lsls r1, 1 + str r1, [r2] + strh r0, [r6, 0x18] + ldr r0, [r6, 0x10] + lsls r0, 1 + str r0, [r6, 0x10] + ldr r0, [r6, 0x14] + lsls r0, 1 + str r0, [r6, 0x14] + b _080751F8 + .align 2, 0 +_080750D0: .4byte gUnknown_202F378 +_080750D4: + cmp r0, 0x3 + bne _08075160 + ldr r1, [r6, 0x10] + str r1, [sp] + ldr r0, [r6, 0x14] + str r0, [sp, 0x4] + movs r4, 0xCE + lsls r4, 1 + add r4, r9 + movs r5, 0 + movs r7, 0x1 +_080750EA: + ldr r1, _0807515C + ldr r0, [r1] + lsls r1, r0, 1 + adds r1, r0 + movs r0, 0x18 + bl __divsi3 + strh r0, [r4] + movs r3, 0xCA + lsls r3, 1 + add r3, r9 + adds r3, r5 + ldr r1, [r3] + lsls r0, r1, 1 + adds r0, r1 + str r0, [r3] + movs r2, 0xCC + lsls r2, 1 + add r2, r9 + adds r2, r5 + ldr r1, [r2] + lsls r0, r1, 1 + adds r0, r1 + str r0, [r2] + ldr r0, [r3] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + str r0, [r3] + ldr r0, [r2] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + str r0, [r2] + adds r4, 0x1C + adds r5, 0x1C + subs r7, 0x1 + cmp r7, 0 + bge _080750EA + ldr r1, _0807515C + ldr r0, [r1] + lsls r1, r0, 1 + adds r1, r0 + movs r0, 0x18 + bl __divsi3 + strh r0, [r6, 0x18] + ldr r1, [sp] + lsls r0, r1, 1 + adds r0, r1 + str r0, [r6, 0x10] + ldr r1, [sp, 0x4] + lsls r0, r1, 1 + adds r0, r1 + str r0, [r6, 0x14] + b _080751F8 + .align 2, 0 +_0807515C: .4byte gUnknown_202F378 +_08075160: + cmp r0, 0x4 + bne _080751EC + ldr r0, [r6, 0x10] + str r0, [sp] + ldr r1, [r6, 0x14] + str r1, [sp, 0x4] + movs r7, 0xCE + lsls r7, 1 + add r7, r9 + movs r0, 0 + mov r8, r0 + movs r1, 0x2 + mov r10, r1 +_0807517A: + ldr r0, _080751E8 + ldr r1, [r0] + lsls r1, 2 + movs r0, 0x18 + bl __divsi3 + strh r0, [r7] + movs r4, 0xCA + lsls r4, 1 + add r4, r9 + add r4, r8 + ldr r0, [r4] + lsls r0, 2 + str r0, [r4] + movs r5, 0xCC + lsls r5, 1 + add r5, r9 + add r5, r8 + ldr r0, [r5] + lsls r0, 2 + str r0, [r5] + ldr r0, [r4] + movs r1, 0x3 + bl __divsi3 + str r0, [r4] + ldr r0, [r5] + movs r1, 0x3 + bl __divsi3 + str r0, [r5] + adds r7, 0x1C + movs r1, 0x1C + add r8, r1 + movs r0, 0x1 + negs r0, r0 + add r10, r0 + mov r1, r10 + cmp r1, 0 + bge _0807517A + ldr r0, _080751E8 + ldr r1, [r0] + lsls r1, 2 + movs r0, 0x18 + bl __divsi3 + strh r0, [r6, 0x18] + ldr r1, [sp] + lsls r0, r1, 2 + str r0, [r6, 0x10] + ldr r1, [sp, 0x4] + lsls r0, r1, 2 + str r0, [r6, 0x14] + b _080751F8 + .align 2, 0 +_080751E8: .4byte gUnknown_202F378 +_080751EC: + ldr r0, _08075208 + ldr r1, [r0] + movs r0, 0x18 + bl __divsi3 + strh r0, [r6, 0x18] +_080751F8: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08075208: .4byte gUnknown_202F378 + thumb_func_end sub_8075050 + + thumb_func_start sub_807520C +sub_807520C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + mov r10, r0 + movs r7, 0 + movs r0, 0 + mov r9, r0 + ldr r0, _08075238 + mov r1, r9 + strb r1, [r0] + ldr r0, _0807523C + ldr r0, [r0] + ldrb r0, [r0] + cmp r0, 0 + beq _08075244 + ldr r1, _08075240 + movs r0, 0x2 + b _08075248 + .align 2, 0 +_08075238: .4byte gUnknown_202F32D +_0807523C: .4byte gUnknown_203B46C +_08075240: .4byte gUnknown_202F378 +_08075244: + ldr r1, _080752D0 + movs r0, 0x1 +_08075248: + str r0, [r1] + movs r2, 0 + mov r8, r2 +_0807524E: + ldr r0, _080752D4 + ldr r0, [r0] + mov r3, r8 + lsls r1, r3, 2 + ldr r4, _080752D8 + adds r0, r4 + adds r0, r1 + ldr r5, [r0] + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807534C + ldr r4, [r5, 0x70] + movs r1, 0xFA + lsls r1, 1 + adds r0, r4, r1 + movs r3, 0 + ldrsh r2, [r0, r3] + cmp r2, 0 + bne _080752E0 + ldr r0, _080752DC + adds r1, r4, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _0807534C + strb r2, [r1] + movs r1, 0xB6 + lsls r1, 1 + adds r6, r4, r1 + ldr r1, [r6] + cmp r1, 0 + beq _0807534C + ldr r0, [r5, 0x4] + cmp r1, r0 + beq _0807534C + adds r0, r5, 0 + movs r1, 0x1 + bl sub_8070B6C + lsls r0, 24 + cmp r0, 0 + beq _080752B2 + adds r0, r5, 0 + bl sub_8070CD0 + lsls r0, 24 + cmp r0, 0 + bne _0807534C +_080752B2: + adds r0, r5, 0x4 + adds r1, r6, 0 + bl sub_80983D8 + adds r1, r0, 0 + adds r0, r4, 0 + adds r0, 0x46 + ldrb r0, [r0] + cmp r1, r0 + beq _0807534C + adds r0, r5, 0 + bl sub_806CE68 + b _0807534C + .align 2, 0 +_080752D0: .4byte gUnknown_202F378 +_080752D4: .4byte gUnknown_203B418 +_080752D8: .4byte 0x000135cc +_080752DC: .4byte 0x00000147 +_080752E0: + ldrh r1, [r4] + movs r2, 0x80 + lsls r2, 6 + adds r0, r2, 0 + orrs r0, r1 + strh r0, [r4] + movs r3, 0xC4 + lsls r3, 1 + adds r0, r4, r3 + ldr r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 11 + movs r1, 0xC0 + lsls r1, 4 + adds r0, r1 + str r0, [sp] + movs r2, 0xC6 + lsls r2, 1 + adds r0, r4, r2 + ldr r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 11 + movs r3, 0x80 + lsls r3, 5 + adds r0, r3 + str r0, [sp, 0x4] + adds r0, r5, 0 + mov r1, sp + bl sub_804535C + movs r1, 0xC8 + lsls r1, 1 + adds r0, r4, r1 + ldr r2, [r0] + adds r0, r5, 0 + movs r1, 0 + bl sub_806CDFC + movs r2, 0xFB + lsls r2, 1 + adds r0, r4, r2 + movs r3, 0 + strh r3, [r0] + movs r7, 0x1 + adds r0, r5, 0 + bl sub_8045888 + lsls r0, 24 + cmp r0, 0 + beq _0807534C + movs r4, 0x1 + mov r9, r4 +_0807534C: + movs r0, 0x1 + add r8, r0 + mov r1, r8 + cmp r1, 0x13 + bgt _08075358 + b _0807524E +_08075358: + cmp r7, 0 + bne _08075360 + movs r0, 0 + b _0807566C +_08075360: + ldr r0, _08075390 + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0xB8 + ldr r2, [r1] + str r2, [sp, 0x10] + mov r3, r10 + str r3, [r1] + ldr r4, _08075394 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _0807537C + b _080754AE +_0807537C: + mov r0, r9 + cmp r0, 0 + bne _08075384 + b _080754AE +_08075384: + movs r0, 0x35 + bl sub_80526D0 + movs r5, 0 + b _0807549E + .align 2, 0 +_08075390: .4byte gUnknown_203B418 +_08075394: .4byte 0x0000066c +_08075398: + movs r0, 0x7 + bl sub_803E46C + movs r1, 0 + mov r8, r1 + adds r5, 0x1 + mov r9, r5 +_080753A6: + ldr r0, _08075420 + ldr r0, [r0] + mov r2, r8 + lsls r1, r2, 2 + ldr r3, _08075424 + adds r0, r3 + adds r0, r1 + ldr r3, [r0] + adds r0, r3, 0 + str r3, [sp, 0x14] + bl sub_80450E0 + lsls r0, 24 + ldr r3, [sp, 0x14] + cmp r0, 0 + beq _08075492 + ldr r0, [r3, 0x70] + adds r7, r0, 0 + movs r4, 0xFB + lsls r4, 1 + adds r5, r7, r4 + movs r1, 0 + ldrsh r0, [r5, r1] + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + movs r2, 0xC2 + lsls r2, 1 + adds r1, r2 + adds r4, r7, r1 + movs r0, 0xFA + lsls r0, 1 + adds r6, r7, r0 + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0 + beq _08075492 + ldr r1, [r4, 0x10] + ldr r2, [r4, 0x14] + adds r0, r3, 0 + bl sub_804539C + ldrh r0, [r4, 0x18] + subs r0, 0x1 + strh r0, [r4, 0x18] + lsls r0, 16 + asrs r2, r0, 16 + ldr r3, [sp, 0x14] + cmp r2, 0 + bne _08075492 + ldrh r0, [r5] + adds r0, 0x1 + strh r0, [r5] + lsls r0, 16 + asrs r0, 16 + movs r4, 0 + ldrsh r1, [r6, r4] + cmp r0, r1 + bne _08075428 + strh r2, [r6] + b _08075492 + .align 2, 0 +_08075420: .4byte gUnknown_203B418 +_08075424: .4byte 0x000135cc +_08075428: + movs r0, 0 + ldrsh r1, [r5, r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + movs r2, 0xC4 + lsls r2, 1 + adds r1, r7, r2 + adds r1, r0 + ldr r1, [r1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 11 + movs r4, 0xC0 + lsls r4, 4 + adds r0, r4 + str r0, [sp, 0x8] + movs r0, 0 + ldrsh r1, [r5, r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r2, 0x4 + adds r1, r7, r2 + adds r1, r0 + ldr r1, [r1] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 11 + movs r4, 0x80 + lsls r4, 5 + adds r0, r4 + add r1, sp, 0x8 + str r0, [r1, 0x4] + adds r0, r3, 0 + str r3, [sp, 0x14] + bl sub_804535C + movs r0, 0 + ldrsh r1, [r5, r0] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + movs r2, 0xC8 + lsls r2, 1 + adds r1, r7, r2 + adds r1, r0 + ldr r2, [r1] + ldr r3, [sp, 0x14] + adds r0, r3, 0 + movs r1, 0 + bl sub_806CDFC +_08075492: + movs r3, 0x1 + add r8, r3 + mov r4, r8 + cmp r4, 0x13 + ble _080753A6 + mov r5, r9 +_0807549E: + ldr r0, _08075510 + ldr r1, [r0] + movs r0, 0x18 + bl __divsi3 + cmp r5, r0 + bge _080754AE + b _08075398 +_080754AE: + movs r0, 0 + mov r8, r0 +_080754B2: + ldr r0, _08075514 + ldr r0, [r0] + mov r2, r8 + lsls r1, r2, 2 + ldr r3, _08075518 + adds r0, r3 + adds r0, r1 + ldr r5, [r0] + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080754F6 + ldr r4, [r5, 0x70] + movs r0, 0xFA + lsls r0, 1 + adds r1, r4, r0 + movs r0, 0 + strh r0, [r1] + adds r0, r5, 0 + bl nullsub_97 + ldrh r0, [r4] + movs r2, 0x80 + lsls r2, 6 + adds r1, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _080754F6 + adds r0, r5, 0 + movs r1, 0 + bl sub_804535C +_080754F6: + movs r3, 0x1 + add r8, r3 + mov r4, r8 + cmp r4, 0x13 + ble _080754B2 + bl sub_807AA30 + movs r7, 0 +_08075506: + movs r5, 0 + adds r0, r7, 0x1 + mov r8, r0 + b _08075600 + .align 2, 0 +_08075510: .4byte gUnknown_202F378 +_08075514: .4byte gUnknown_203B418 +_08075518: .4byte 0x000135cc +_0807551C: + ldr r2, [r4, 0x70] + cmp r7, 0 + bne _0807552A + ldrb r0, [r2, 0x7] + cmp r0, 0 + beq _080755FE + b _08075530 +_0807552A: + ldrb r0, [r2, 0x7] + cmp r0, 0 + bne _080755FE +_08075530: + ldr r6, [r4, 0x4] + ldrh r1, [r2] + movs r3, 0x80 + lsls r3, 6 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _080755BC + ldr r3, _08075560 + adds r0, r3, 0 + ands r0, r1 + strh r0, [r2] + ldrb r0, [r2, 0x7] + cmp r0, 0 + beq _08075564 + adds r0, r4, 0x4 + bl sub_804AC20 + movs r0, 0 + bl sub_807EC28 + bl sub_805EE30 + b _0807556A + .align 2, 0 +_08075560: .4byte 0x0000dfff +_08075564: + adds r0, r4, 0 + bl sub_8075708 +_0807556A: + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080755FE + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _0807562A + movs r0, 0 + bl sub_8043ED0 + adds r0, r4, 0 + bl sub_8074094 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080755FE + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _0807562A + adds r0, r4, 0 + bl sub_8071DA4 + bl sub_8046D20 + ldr r0, _08075650 + ldr r0, [r0] + ldr r1, _08075654 + adds r0, r1 + ldrb r1, [r0] + adds r0, r4, 0 + bl sub_8075900 +_080755BC: + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080755FE + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _0807562A + ldr r0, [r4, 0x4] + cmp r6, r0 + beq _080755DE + ldr r1, _08075658 + movs r0, 0x1 + strb r0, [r1] +_080755DE: + adds r0, r4, 0 + bl sub_806A5B8 + adds r1, r4, 0x4 + adds r0, r4, 0 + bl sub_80706A4 + lsls r0, 24 + cmp r0, 0 + beq _080755FE + adds r0, r4, 0 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl sub_807D148 +_080755FE: + adds r5, 0x1 +_08075600: + cmp r5, 0x13 + bgt _0807562A + ldr r0, _08075650 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _0807565C + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080755FE + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _0807562A + b _0807551C +_0807562A: + mov r7, r8 + cmp r7, 0x1 + bgt _08075632 + b _08075506 +_08075632: + bl sub_8086AC0 + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _08075660 + bl sub_8085140 + ldr r0, _08075650 + ldr r0, [r0] + adds r0, 0xB8 + ldr r3, [sp, 0x10] + str r3, [r0] + b _0807566A + .align 2, 0 +_08075650: .4byte gUnknown_203B418 +_08075654: .4byte 0x00003a08 +_08075658: .4byte gUnknown_202F32D +_0807565C: .4byte 0x000135cc +_08075660: + ldr r0, _0807567C + ldr r0, [r0] + adds r0, 0xB8 + ldr r4, [sp, 0x10] + str r4, [r0] +_0807566A: + movs r0, 0x1 +_0807566C: + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0807567C: .4byte gUnknown_203B418 + thumb_func_end sub_807520C + + thumb_func_start sub_8075680 +sub_8075680: + push {r4-r7,lr} + movs r7, 0 +_08075684: + ldr r0, _080756FC + ldr r0, [r0] + lsls r1, r7, 2 + ldr r2, _08075700 + adds r0, r2 + adds r0, r1 + ldr r5, [r0] + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080756EE + ldr r6, [r5, 0x70] + ldrb r0, [r6, 0x7] + cmp r0, 0 + bne _080756EE + movs r0, 0xB6 + lsls r0, 1 + adds r4, r6, r0 + ldr r1, [r4] + cmp r1, 0 + beq _080756EE + ldr r0, [r5, 0x4] + cmp r1, r0 + beq _080756EE + adds r0, r5, 0 + movs r1, 0x1 + bl sub_8070B6C + lsls r0, 24 + cmp r0, 0 + bne _080756EE + adds r0, r5, 0x4 + adds r1, r4, 0 + bl sub_80983D8 + adds r4, r0, 0 + movs r1, 0x7 + ands r0, r1 + adds r1, r6, 0 + adds r1, 0x46 + strb r0, [r1] + adds r0, r5, 0 + bl sub_806CEBC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + adds r2, r4, 0 + bl sub_806CDD4 +_080756EE: + adds r7, 0x1 + cmp r7, 0x13 + ble _08075684 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080756FC: .4byte gUnknown_203B418 +_08075700: .4byte 0x000135cc + thumb_func_end sub_8075680 + + thumb_func_start nullsub_97 +nullsub_97: + bx lr + thumb_func_end nullsub_97 + + thumb_func_start sub_8075708 +sub_8075708: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r4, r0, 0 + ldr r6, [r4, 0x70] + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807580C + adds r0, r4, 0 + bl sub_8045128 + adds r5, r0, 0 + adds r0, r4, 0 + movs r1, 0xD + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _08075752 + adds r0, r6, 0 + adds r0, 0xE4 + ldrb r0, [r0] + cmp r0, 0x3 + beq _08075752 + adds r0, r4, 0 + movs r1, 0x9 + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + bne _08075752 + adds r0, r4, 0x4 + bl sub_804AE84 +_08075752: + ldr r5, [r5, 0x14] + cmp r5, 0 + beq _0807580C + adds r0, r5, 0 + bl sub_80450F8 + cmp r0, 0x5 + bhi _0807580C + lsls r0, 2 + ldr r1, _0807576C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0807576C: .4byte _08075770 + .align 2, 0 +_08075770: + .4byte _0807580C + .4byte _0807580C + .4byte _08075788 + .4byte _08075806 + .4byte _0807580C + .4byte _0807580C +_08075788: + adds r0, r5, 0 + bl sub_8045104 + adds r7, r0, 0 + movs r0, 0 + mov r8, r0 + mov r9, r0 + adds r0, r4, 0 + movs r1, 0x13 + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _080757BA + adds r1, r5, 0 + adds r1, 0x20 + ldrb r0, [r1] + cmp r0, 0 + bne _080757BA + movs r0, 0x1 + strb r0, [r1] + bl sub_8049ED4 + movs r0, 0x1 + mov r9, r0 +_080757BA: + ldrb r0, [r7, 0x1] + cmp r0, 0 + bne _080757D2 + adds r0, r5, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0 + beq _080757EC + ldrb r0, [r6, 0x6] + cmp r0, 0 + bne _080757EC + b _080757F2 +_080757D2: + cmp r0, 0x1 + bne _080757DE + ldrb r0, [r6, 0x6] + cmp r0, 0 + beq _080757EC + b _080757F2 +_080757DE: + cmp r0, 0x2 + bne _080757EC + ldrb r0, [r6, 0x6] + cmp r0, 0 + bne _080757EC + movs r0, 0x1 + mov r8, r0 +_080757EC: + mov r0, r8 + cmp r0, 0 + beq _0807580C +_080757F2: + mov r0, r9 + cmp r0, 0 + bne _0807580C + adds r1, r4, 0x4 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_807FE9C + b _0807580C +_08075806: + adds r0, r4, 0 + bl sub_8073D14 +_0807580C: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8075708 + + thumb_func_start sub_8075818 +sub_8075818: + push {r4-r6,lr} + adds r4, r0, 0 + ldr r6, [r4, 0x70] + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080758F6 + adds r0, r4, 0 + bl sub_8045128 + adds r5, r0, 0 + adds r0, r4, 0 + movs r1, 0xD + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _08075848 + ldrh r1, [r5] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _080758F2 +_08075848: + ldr r4, [r5, 0x14] + cmp r4, 0 + beq _080758F6 + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0x5 + bhi _080758F6 + lsls r0, 2 + ldr r1, _08075864 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08075864: .4byte _08075868 + .align 2, 0 +_08075868: + .4byte _080758F6 + .4byte _080758F6 + .4byte _08075880 + .4byte _080758BE + .4byte _080758F6 + .4byte _080758F6 +_08075880: + adds r0, r4, 0 + bl sub_8045104 + movs r1, 0 + ldrb r0, [r0, 0x1] + cmp r0, 0 + bne _080758A0 + adds r0, r4, 0 + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0 + beq _080758B8 + ldrb r0, [r6, 0x6] + cmp r0, 0 + bne _080758B8 + b _080758F2 +_080758A0: + cmp r0, 0x1 + bne _080758AC + ldrb r0, [r6, 0x6] + cmp r0, 0 + beq _080758B8 + b _080758F2 +_080758AC: + cmp r0, 0x2 + bne _080758B8 + ldrb r0, [r6, 0x6] + cmp r0, 0 + bne _080758B8 + movs r1, 0x1 +_080758B8: + cmp r1, 0 + beq _080758F6 + b _080758F2 +_080758BE: + ldrb r0, [r6, 0x7] + cmp r0, 0 + bne _080758F6 + adds r0, r6, 0 + adds r0, 0x60 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080758F6 + ldrh r1, [r5] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _080758E2 + ldrb r0, [r6, 0x6] + cmp r0, 0 + bne _080758F6 +_080758E2: + adds r0, r4, 0 + bl sub_8045108 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080758F6 +_080758F2: + movs r0, 0x1 + b _080758F8 +_080758F6: + movs r0, 0 +_080758F8: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8075818 + + thumb_func_start sub_8075900 +sub_8075900: + push {r4-r6,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r6, r1, 24 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807597A + ldr r0, [r4, 0x70] + ldrb r0, [r0, 0x6] + cmp r0, 0 + bne _0807597A + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _0807597A + ldr r5, _08075980 + ldr r0, [r5] + ldr r1, _08075984 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0807597A + adds r0, r4, 0 + bl sub_8045128 + ldrh r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0807597A + bl sub_8083600 + ldr r1, _08075988 + ldr r1, [r1] + bl sub_80522A8 + ldr r0, [r5] + ldr r1, _0807598C + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_807AB38 + movs r0, 0 + bl sub_8041888 + adds r0, r4, 0x4 + bl sub_803F428 + lsls r0, 24 + cmp r0, 0 + beq _0807597A + movs r0, 0x78 + movs r1, 0x39 + bl sub_803E708 +_0807597A: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08075980: .4byte gUnknown_203B418 +_08075984: .4byte 0x00000671 +_08075988: .4byte gUnknown_80FE308 +_0807598C: .4byte 0x00000672 + thumb_func_end sub_8075900 + + thumb_func_start sub_8075990 +sub_8075990: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r7, r0, 0 + ldr r5, [r7, 0x70] + ldrh r1, [r5] + movs r0, 0x80 + lsls r0, 8 + ands r0, r1 + lsls r0, 16 + lsrs r6, r0, 16 + cmp r6, 0 + beq _080759C2 + adds r0, r5, 0 + adds r0, 0xB0 + ldrb r0, [r0] + cmp r0, 0x6 + beq _080759B8 + b _08075B92 +_080759B8: + adds r0, r7, 0 + adds r1, r7, 0 + bl sub_807A324 + b _08075B92 +_080759C2: + movs r1, 0x80 + lsls r1, 1 + adds r0, r5, r1 + strb r6, [r0] + adds r0, r5, 0 + adds r0, 0xA4 + ldrb r1, [r0] + mov r9, r0 + cmp r1, 0 + beq _080759E4 + adds r0, r7, 0 + bl sub_8085A50 + lsls r0, 24 + cmp r0, 0 + bne _080759E4 + b _08075B92 +_080759E4: + mov r2, r9 + ldrb r0, [r2] + cmp r0, 0x1 + beq _08075A36 + adds r4, r5, 0 + adds r4, 0xFC + ldrb r0, [r4] + cmp r0, 0 + beq _08075A36 + adds r0, r7, 0 + bl sub_8070C60 + lsls r0, 24 + cmp r0, 0 + beq _08075A24 + strb r6, [r4] + ldr r0, _08075A1C + adds r1, r7, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08075A20 + ldr r1, [r0] + adds r0, r7, 0 + bl sub_80522A8 + b _08075B92 + .align 2, 0 +_08075A1C: .4byte gUnknown_202DF98 +_08075A20: .4byte gUnknown_81004E4 +_08075A24: + adds r0, r7, 0 + bl sub_8073658 + adds r0, r5, 0 + adds r0, 0x44 + ldrh r0, [r0] + cmp r0, 0 + beq _08075A36 + b _08075B92 +_08075A36: + adds r0, r7, 0 + bl sub_807001C + lsls r0, 24 + cmp r0, 0 + beq _08075A44 + b _08075B92 +_08075A44: + ldr r0, _08075AA4 + ldr r0, [r0] + ldr r1, _08075AA8 + adds r0, r1 + ldrb r0, [r0] + movs r2, 0x44 + adds r2, r5 + mov r8, r2 + cmp r0, 0 + beq _08075AB6 + movs r6, 0 +_08075A5A: + ldr r0, _08075AA4 + ldr r0, [r0] + lsls r1, r6, 2 + ldr r2, _08075AAC + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08075AB0 + ldr r0, [r4, 0x70] + adds r0, 0xC8 + ldrb r0, [r0] + cmp r0, 0x2 + bne _08075AB0 + adds r0, r7, 0 + adds r1, r4, 0 + bl sub_8045990 + lsls r0, 24 + cmp r0, 0 + beq _08075AB0 + ldr r0, [r4, 0x70] + adds r0, 0xC9 + ldrb r0, [r0] + movs r1, 0x1 + cmp r0, 0 + beq _08075A9A + movs r1, 0x2 +_08075A9A: + movs r2, 0x80 + lsls r2, 1 + adds r0, r5, r2 + strb r1, [r0] + b _08075AB6 + .align 2, 0 +_08075AA4: .4byte gUnknown_203B418 +_08075AA8: .4byte 0x000037fc +_08075AAC: .4byte 0x000135cc +_08075AB0: + adds r6, 0x1 + cmp r6, 0x13 + ble _08075A5A +_08075AB6: + mov r4, r8 + adds r0, r4, 0 + bl sub_8044C88 + mov r1, r9 + ldrb r0, [r1] + cmp r0, 0x1 + bne _08075AF4 + movs r2, 0x2 + ldrsh r1, [r5, r2] + adds r0, r4, 0 + bl sub_8044CA0 + movs r0, 0x8 + bl sub_8084100 + adds r1, r5, 0 + adds r1, 0x46 + strb r0, [r1] + ldrh r1, [r7, 0x4] + movs r2, 0xB6 + lsls r2, 1 + adds r0, r5, r2 + strh r1, [r0] + ldrh r0, [r7, 0x6] + subs r0, 0x1 + movs r1, 0xB7 + lsls r1, 1 + adds r2, r5, r1 + strh r0, [r2] + b _08075B92 +_08075AF4: + adds r0, r7, 0 + bl sub_8073658 + ldrh r6, [r4] + cmp r6, 0 + bne _08075B92 + adds r0, r7, 0 + movs r1, 0x15 + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + bne _08075B3C + adds r0, r7, 0 + bl sub_807BB94 + ldrh r0, [r4] + cmp r0, 0 + bne _08075B92 + adds r0, r5, 0 + adds r0, 0xBC + ldrb r0, [r0] + cmp r0, 0x2 + beq _08075B46 + movs r1, 0x2 + ldrsh r0, [r5, r1] + bl sub_808DB48 + lsls r0, 24 + cmp r0, 0 + beq _08075B92 + adds r0, r7, 0 + movs r1, 0x1 + bl sub_807ADB8 + b _08075B92 +_08075B3C: + adds r0, r5, 0 + adds r0, 0xBC + ldrb r0, [r0] + cmp r0, 0x2 + bne _08075B52 +_08075B46: + movs r2, 0x2 + ldrsh r1, [r5, r2] + adds r0, r4, 0 + bl sub_8044CA0 + b _08075B92 +_08075B52: + movs r1, 0x2 + ldrsh r0, [r5, r1] + bl sub_808DB48 + lsls r0, 24 + cmp r0, 0 + beq _08075B68 + adds r0, r7, 0 + movs r1, 0x1 + bl sub_807ADB8 +_08075B68: + mov r2, r8 + ldrh r0, [r2] + cmp r0, 0x1 + bhi _08075B92 + adds r0, r7, 0 + bl sub_807BB94 + mov r1, r8 + ldrh r0, [r1] + cmp r0, 0x1 + bls _08075B92 + adds r0, r5, 0 + adds r0, 0x79 + strb r6, [r0] + movs r2, 0xA2 + lsls r2, 1 + adds r0, r5, r2 + strb r6, [r0] + ldr r1, _08075BA0 + adds r0, r5, r1 + strb r6, [r0] +_08075B92: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08075BA0: .4byte 0x00000147 + thumb_func_end sub_8075990 + + thumb_func_start sub_8075BA4 +sub_8075BA4: + push {r4,r5,lr} + adds r5, r0, 0 + lsls r1, 24 + ldr r4, [r5, 0x70] + cmp r1, 0 + beq _08075BD0 + adds r0, r4, 0 + adds r0, 0xBC + ldrb r0, [r0] + cmp r0, 0x4 + bne _08075BD0 + adds r0, r4, 0 + adds r0, 0x46 + ldrb r1, [r0] + adds r1, 0x4 + movs r2, 0x7 + ands r1, r2 + strb r1, [r0] + adds r0, r5, 0 + bl sub_8069DCC + b _08075BEC +_08075BD0: + adds r0, r4, 0 + adds r0, 0xBC + ldrb r0, [r0] + cmp r0, 0x2 + bne _08075BEC + movs r0, 0x8 + bl sub_8084100 + adds r1, r4, 0 + adds r1, 0x46 + strb r0, [r1] + adds r0, r5, 0 + bl sub_8069DCC +_08075BEC: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8075BA4 + + thumb_func_start sub_8075BF4 +sub_8075BF4: + push {r4-r7,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r7, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08075C0A + movs r0, 0 + b _08075C52 +_08075C0A: + ldr r6, [r5, 0x70] + adds r1, r6, 0 + adds r1, 0xA8 + ldrb r0, [r1] + cmp r0, 0x3 + beq _08075C48 + cmp r0, 0x1 + beq _08075C44 + movs r0, 0x1 + strb r0, [r1] + cmp r4, 0x7F + beq _08075C3C + adds r0, r5, 0 + movs r1, 0x2F + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _08075C3C + lsrs r0, r4, 31 + adds r0, r4, r0 + asrs r4, r0, 1 + cmp r4, 0 + bgt _08075C3C + movs r4, 0x1 +_08075C3C: + adds r0, r6, 0 + adds r0, 0xA9 + strb r4, [r0] + b _08075C4A +_08075C44: + movs r7, 0x1 + b _08075C4A +_08075C48: + movs r7, 0x2 +_08075C4A: + adds r0, r5, 0 + bl sub_80418D4 + adds r0, r7, 0 +_08075C52: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8075BF4 + + thumb_func_start sub_8075C58 +sub_8075C58: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + adds r4, r1, 0 + mov r8, r2 + lsls r3, 24 + lsrs r5, r3, 24 + adds r7, r5, 0 + movs r2, 0x1 + adds r3, r5, 0 + bl sub_8075CFC + lsls r0, 24 + cmp r0, 0 + bne _08075CEC + ldr r0, [r4, 0x70] + adds r0, 0xA8 + ldrb r0, [r0] + cmp r0, 0x2 + bne _08075C90 + cmp r5, 0 + beq _08075CEC + ldr r0, _08075C8C + b _08075CCE + .align 2, 0 +_08075C8C: .4byte gUnknown_80FB380 +_08075C90: + cmp r0, 0x5 + bne _08075CA0 + cmp r7, 0 + beq _08075CEC + ldr r0, _08075C9C + b _08075CCE + .align 2, 0 +_08075C9C: .4byte gUnknown_80FB384 +_08075CA0: + adds r0, r4, 0 + bl sub_8041AF4 + adds r0, r4, 0 + mov r1, r8 + bl sub_8075BF4 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0 + movs r1, 0x8 + bl sub_806CE68 + cmp r5, 0x1 + bne _08075CC8 + ldr r0, _08075CC4 + b _08075CCE + .align 2, 0 +_08075CC4: .4byte gUnknown_80FB338 +_08075CC8: + cmp r5, 0x2 + bne _08075CE0 + ldr r0, _08075CDC +_08075CCE: + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08075CEC + .align 2, 0 +_08075CDC: .4byte gUnknown_80FB35C +_08075CE0: + ldr r0, _08075CF8 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08075CEC: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08075CF8: .4byte gUnknown_80FB318 + thumb_func_end sub_8075C58 + + thumb_func_start sub_8075CFC +sub_8075CFC: + push {r4-r7,lr} + adds r6, r0, 0 + adds r4, r1, 0 + lsls r2, 24 + lsrs r7, r2, 24 + lsls r3, 24 + lsrs r5, r3, 24 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08075DAA + ldr r0, _08075D4C + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + cmp r7, 0 + beq _08075D34 + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_80716E8 + lsls r0, 24 + cmp r0, 0 + bne _08075DAA +_08075D34: + adds r0, r4, 0 + movs r1, 0x11 + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _08075D54 + cmp r5, 0 + beq _08075DAA + ldr r0, _08075D50 + b _08075DA0 + .align 2, 0 +_08075D4C: .4byte gUnknown_202DF98 +_08075D50: .4byte gUnknown_80FCD54 +_08075D54: + adds r0, r4, 0 + movs r1, 0x36 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _08075D70 + cmp r5, 0 + beq _08075DAA + ldr r0, _08075D6C + b _08075DA0 + .align 2, 0 +_08075D6C: .4byte gUnknown_80FCD58 +_08075D70: + adds r0, r4, 0 + movs r1, 0x49 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _08075D8C + cmp r5, 0 + beq _08075DAA + ldr r0, _08075D88 + b _08075DA0 + .align 2, 0 +_08075D88: .4byte gUnknown_80FCD88 +_08075D8C: + adds r0, r4, 0 + movs r1, 0x15 + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _08075DB4 + cmp r5, 0 + beq _08075DAA + ldr r0, _08075DB0 +_08075DA0: + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08075DAA: + movs r0, 0x1 + b _08075DB6 + .align 2, 0 +_08075DB0: .4byte gUnknown_80FD548 +_08075DB4: + movs r0, 0 +_08075DB6: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8075CFC + + thumb_func_start sub_8075DBC +sub_8075DBC: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r7, r0, 0 + adds r5, r1, 0 + mov r8, r2 + movs r0, 0 + mov r9, r0 + adds r0, r7, 0 + movs r2, 0x1 + movs r3, 0x1 + bl sub_8075CFC + lsls r0, 24 + cmp r0, 0 + bne _08075E62 + ldr r6, [r5, 0x70] + adds r4, r6, 0 + adds r4, 0xA8 + ldrb r0, [r4] + cmp r0, 0x2 + beq _08075E50 + adds r0, r5, 0 + bl sub_8041EC8 + ldrb r0, [r4] + cmp r0, 0x3 + beq _08075E1A + adds r4, 0x1 + mov r0, r8 + strb r0, [r4] + adds r0, r5, 0 + movs r1, 0x2F + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _08075E1E + ldrb r0, [r4] + lsrs r0, 1 + strb r0, [r4] + cmp r0, 0 + bne _08075E1E + movs r0, 0x1 + strb r0, [r4] + b _08075E1E +_08075E1A: + movs r0, 0x1 + mov r9, r0 +_08075E1E: + adds r1, r6, 0 + adds r1, 0xA8 + movs r0, 0x3 + strb r0, [r1] + adds r0, r5, 0 + movs r1, 0x8 + bl sub_806CE68 + mov r0, r9 + cmp r0, 0 + beq _08075E3C + ldr r0, _08075E38 + b _08075E3E + .align 2, 0 +_08075E38: .4byte gUnknown_80FB3CC +_08075E3C: + ldr r0, _08075E4C +_08075E3E: + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 + b _08075E5C + .align 2, 0 +_08075E4C: .4byte gUnknown_80FB3A4 +_08075E50: + ldr r0, _08075E70 + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 +_08075E5C: + adds r0, r5, 0 + bl sub_80418D4 +_08075E62: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08075E70: .4byte gUnknown_80FB3D0 + thumb_func_end sub_8075DBC + + thumb_func_start sub_8075E74 +sub_8075E74: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r7, r0, 0 + adds r5, r1, 0 + mov r8, r2 + movs r0, 0 + mov r9, r0 + adds r0, r7, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_8075CFC + lsls r0, 24 + cmp r0, 0 + bne _08075F22 + ldr r6, [r5, 0x70] + adds r4, r6, 0 + adds r4, 0xA8 + ldrb r0, [r4] + cmp r0, 0x2 + beq _08075F10 + adds r0, r5, 0 + bl sub_8041ED8 + ldrb r0, [r4] + cmp r0, 0 + beq _08075EB2 + cmp r0, 0x4 + bne _08075ED8 +_08075EB2: + adds r4, r6, 0 + adds r4, 0xA9 + mov r0, r8 + strb r0, [r4] + adds r0, r5, 0 + movs r1, 0x2F + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _08075EDC + ldrb r0, [r4] + lsrs r0, 1 + strb r0, [r4] + cmp r0, 0 + bne _08075EDC + movs r0, 0x1 + strb r0, [r4] + b _08075EDC +_08075ED8: + movs r0, 0x1 + mov r9, r0 +_08075EDC: + adds r1, r6, 0 + adds r1, 0xA8 + movs r0, 0x5 + strb r0, [r1] + adds r0, r5, 0 + movs r1, 0x8 + bl sub_806CE68 + mov r0, r9 + cmp r0, 0 + beq _08075EFC + ldr r0, _08075EF8 + b _08075EFE + .align 2, 0 +_08075EF8: .4byte gUnknown_80FB360 +_08075EFC: + ldr r0, _08075F0C +_08075EFE: + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 + b _08075F1C + .align 2, 0 +_08075F0C: .4byte gUnknown_80FB31C +_08075F10: + ldr r0, _08075F30 + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 +_08075F1C: + adds r0, r5, 0 + bl sub_80418D4 +_08075F22: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08075F30: .4byte gUnknown_80FB388 + thumb_func_end sub_8075E74 + + thumb_func_start sub_8075F34 +sub_8075F34: + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r6, r2, 0 + movs r2, 0x1 + movs r3, 0x1 + bl sub_8075CFC + lsls r0, 24 + cmp r0, 0 + bne _08075FC2 + ldr r2, [r4, 0x70] + adds r1, r2, 0 + adds r1, 0xA8 + ldrb r0, [r1] + cmp r0, 0 + bne _08075F78 + movs r0, 0x4 + strb r0, [r1] + adds r0, r2, 0 + adds r0, 0xA9 + strb r6, [r0] + adds r0, r4, 0 + bl nullsub_91 + adds r0, r4, 0 + movs r1, 0x8 + bl sub_806CE68 + ldr r0, _08075F74 + b _08075F9E + .align 2, 0 +_08075F74: .4byte gUnknown_80FB3E0 +_08075F78: + cmp r0, 0x1 + beq _08075F84 + cmp r0, 0x3 + beq _08075F84 + cmp r0, 0x5 + bne _08075F8C +_08075F84: + ldr r0, _08075F88 + b _08075F9E + .align 2, 0 +_08075F88: .4byte gUnknown_80FB418 +_08075F8C: + cmp r0, 0x2 + bne _08075F98 + ldr r0, _08075F94 + b _08075F9E + .align 2, 0 +_08075F94: .4byte gUnknown_80FB3F8 +_08075F98: + cmp r0, 0x4 + bne _08075FB0 + ldr r0, _08075FAC +_08075F9E: + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08075FBC + .align 2, 0 +_08075FAC: .4byte gUnknown_80FB414 +_08075FB0: + ldr r0, _08075FC8 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08075FBC: + adds r0, r4, 0 + bl sub_80418D4 +_08075FC2: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08075FC8: .4byte gUnknown_80FB3E0 + thumb_func_end sub_8075F34 + + thumb_func_start sub_8075FCC +sub_8075FCC: + push {r4-r7,lr} + adds r6, r0, 0 + adds r4, r1, 0 + movs r7, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08076086 + ldr r5, [r4, 0x70] + adds r0, r5, 0 + adds r0, 0xA8 + ldrb r0, [r0] + cmp r0, 0x1 + beq _08075FF4 + cmp r0, 0x5 + beq _08075FF4 + cmp r0, 0x3 + bne _08075FF6 +_08075FF4: + movs r7, 0x1 +_08075FF6: + ldr r0, _08076060 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r1, r5, 0 + adds r1, 0xA8 + ldrb r0, [r1] + cmp r0, 0x2 + beq _08076074 + movs r0, 0x2 + strb r0, [r1] + ldr r1, _08076064 + adds r0, r4, 0 + movs r2, 0 + bl sub_808417C + adds r0, 0x1 + adds r1, r5, 0 + adds r1, 0xA9 + strb r0, [r1] + ldr r0, _08076068 + adds r1, r5, r0 + movs r0, 0xFF + strb r0, [r1] + adds r0, 0x65 + adds r1, r5, r0 + movs r0, 0x1 + negs r0, r0 + strb r0, [r1] + adds r0, r4, 0 + bl sub_8041EE8 + adds r0, r4, 0 + movs r1, 0x8 + bl sub_806CE68 + cmp r7, 0 + beq _08076050 + ldr r0, _0807606C + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08076050: + ldr r0, _08076070 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08076080 + .align 2, 0 +_08076060: .4byte gUnknown_202DF98 +_08076064: .4byte gUnknown_80F4E7C +_08076068: .4byte 0x00000165 +_0807606C: .4byte gUnknown_80FB41C +_08076070: .4byte gUnknown_80FB458 +_08076074: + ldr r0, _0807608C + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08076080: + adds r0, r4, 0 + bl sub_80418D4 +_08076086: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0807608C: .4byte gUnknown_80FB43C + thumb_func_end sub_8075FCC + + thumb_func_start sub_8076090 +sub_8076090: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r6, r0, 0 + adds r4, r1, 0 + adds r7, r3, 0 + ldr r0, [sp, 0x1C] + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807613A + ldr r5, [r4, 0x70] + mov r0, r8 + cmp r0, 0 + beq _080760D0 + adds r0, r6, 0 + adds r1, r4, 0 + mov r2, r9 + bl sub_80716E8 + lsls r0, 24 + cmp r0, 0 + bne _0807613A +_080760D0: + ldr r0, _08076100 + adds r1, r5, 0 + movs r2, 0 + bl sub_80708B4 + adds r1, r5, 0 + adds r1, 0xBC + ldrb r0, [r1] + cmp r0, 0x3 + beq _08076110 + movs r0, 0x3 + strb r0, [r1] + adds r1, r7, 0x1 + adds r0, r5, 0 + adds r0, 0xBD + strb r1, [r0] + adds r0, r4, 0 + bl nullsub_72 + cmp r7, 0x1 + bne _08076108 + ldr r0, _08076104 + b _08076116 + .align 2, 0 +_08076100: .4byte gUnknown_202DF98 +_08076104: .4byte gUnknown_80FB480 +_08076108: + ldr r0, _0807610C + b _08076116 + .align 2, 0 +_0807610C: .4byte gUnknown_80FB4D4 +_08076110: + cmp r7, 0x1 + bne _08076128 + ldr r0, _08076124 +_08076116: + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08076134 + .align 2, 0 +_08076124: .4byte gUnknown_80FB4B0 +_08076128: + ldr r0, _08076148 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08076134: + adds r0, r4, 0 + bl sub_80418D4 +_0807613A: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08076148: .4byte gUnknown_80FB4F0 + thumb_func_end sub_8076090 + + thumb_func_start sub_807614C +sub_807614C: + push {r4-r7,lr} + adds r6, r0, 0 + adds r4, r1, 0 + lsls r2, 24 + lsrs r7, r2, 24 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08076206 + ldr r5, [r4, 0x70] + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r7, 0 + bl sub_80716E8 + lsls r0, 24 + cmp r0, 0 + bne _08076206 + adds r0, r4, 0 + movs r1, 0x29 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _080761A8 + ldr r0, _080761A0 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + cmp r7, 0 + beq _08076206 + ldr r0, _080761A4 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08076206 + .align 2, 0 +_080761A0: .4byte gUnknown_202DF98 +_080761A4: .4byte gUnknown_80FCC4C +_080761A8: + ldr r0, _080761E8 + adds r1, r5, 0 + movs r2, 0 + bl sub_80708B4 + adds r1, r5, 0 + adds r1, 0xBC + ldrb r0, [r1] + cmp r0, 0x7 + beq _080761F4 + movs r0, 0x7 + strb r0, [r1] + ldr r1, _080761EC + adds r0, r4, 0 + movs r2, 0x1 + bl sub_808417C + adds r0, 0x1 + adds r1, r5, 0 + adds r1, 0xBD + strb r0, [r1] + adds r0, r4, 0 + bl sub_8041EF8 + ldr r0, _080761F0 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08076200 + .align 2, 0 +_080761E8: .4byte gUnknown_202DF98 +_080761EC: .4byte gUnknown_80F4F00 +_080761F0: .4byte gUnknown_80FB50C +_080761F4: + ldr r0, _0807620C + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08076200: + adds r0, r4, 0 + bl sub_80418D4 +_08076206: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0807620C: .4byte gUnknown_80FB52C + thumb_func_end sub_807614C + + thumb_func_start sub_8076210 +sub_8076210: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r7, r0, 0 + adds r5, r1, 0 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + lsls r3, 24 + lsrs r3, 24 + mov r10, r3 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08076238 + b _080763DA +_08076238: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r10 + bl sub_80716E8 + lsls r0, 24 + cmp r0, 0 + beq _0807624A + b _080763DA +_0807624A: + ldr r0, [r5, 0x70] + mov r8, r0 + ldr r0, _08076274 + mov r1, r8 + movs r2, 0 + bl sub_80708B4 + adds r0, r5, 0 + movs r1, 0x42 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0807627C + mov r1, r10 + cmp r1, 0 + bne _0807626E + b _080763DA +_0807626E: + ldr r0, _08076278 + b _080762CC + .align 2, 0 +_08076274: .4byte gUnknown_202DF98 +_08076278: .4byte gUnknown_80FCE5C +_0807627C: + adds r0, r5, 0 + movs r1, 0x2 + bl sub_8071858 + lsls r0, 24 + cmp r0, 0 + beq _0807629C + mov r2, r10 + cmp r2, 0 + bne _08076292 + b _080763DA +_08076292: + ldr r0, _08076298 + b _080762CC + .align 2, 0 +_08076298: .4byte gUnknown_80FCE84 +_0807629C: + adds r0, r5, 0 + bl sub_8045128 + ldrh r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + bne _080762E8 + ldr r1, _080762D8 + ldr r0, _080762DC + ldr r0, [r0] + ldr r3, _080762E0 + adds r0, r3 + movs r2, 0 + ldrsh r0, [r0, r2] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080762E8 + mov r3, r10 + cmp r3, 0 + bne _080762CA + b _080763DA +_080762CA: + ldr r0, _080762E4 +_080762CC: + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 + b _080763DA + .align 2, 0 +_080762D8: .4byte gUnknown_810ACC0 +_080762DC: .4byte gUnknown_203B418 +_080762E0: .4byte 0x00003a0e +_080762E4: .4byte gUnknown_80FEBBC +_080762E8: + movs r6, 0x1 + mov r1, r8 + adds r1, 0xAC + ldrb r0, [r1] + cmp r0, 0x1 + beq _08076338 + movs r4, 0 + strb r6, [r1] + ldr r1, _08076330 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_808417C + adds r0, 0x1 + mov r1, r8 + adds r1, 0xAD + strb r0, [r1] + mov r0, r8 + adds r0, 0xAE + strb r4, [r0] + adds r0, 0x1 + strb r4, [r0] + movs r6, 0 + mov r0, r9 + cmp r0, 0 + beq _08076322 + adds r0, r5, 0 + bl sub_8041C34 +_08076322: + ldr r0, _08076334 + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 + b _08076344 + .align 2, 0 +_08076330: .4byte gUnknown_80F4E30 +_08076334: .4byte gUnknown_80FB548 +_08076338: + ldr r0, _080763E8 + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 +_08076344: + adds r0, r5, 0 + bl sub_80418D4 + adds r0, r5, 0 + movs r1, 0x19 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _080763DA + cmp r6, 0 + bne _080763DA + movs r1, 0 + mov r9, r1 + movs r6, 0 +_08076362: + movs r2, 0x4 + ldrsh r0, [r5, r2] + ldr r1, _080763EC + lsls r2, r6, 2 + adds r2, r1 + movs r3, 0 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r3, 0x6 + ldrsh r1, [r5, r3] + movs r3, 0x2 + ldrsh r2, [r2, r3] + adds r1, r2 + bl sub_804954C + ldr r4, [r0, 0x10] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080763D4 + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0x1 + bne _080763D4 + mov r0, r9 + cmp r0, 0 + bne _080763B8 + movs r1, 0x1 + mov r9, r1 + ldr r0, _080763F0 + mov r1, r8 + movs r2, 0 + bl sub_80708B4 + ldr r0, _080763F4 + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 +_080763B8: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_807167C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080763D4 + adds r0, r7, 0 + adds r1, r4, 0 + movs r2, 0x1 + mov r3, r10 + bl sub_8076210 +_080763D4: + adds r6, 0x1 + cmp r6, 0x7 + ble _08076362 +_080763DA: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080763E8: .4byte gUnknown_80FB564 +_080763EC: .4byte gUnknown_80F4448 +_080763F0: .4byte gUnknown_202DF98 +_080763F4: .4byte gUnknown_80FF01C + thumb_func_end sub_8076210 + + thumb_func_start sub_80763F8 +sub_80763F8: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r7, r0, 0 + adds r5, r1, 0 + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _0807641A + b _080765C0 +_0807641A: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r10 + bl sub_80716E8 + lsls r0, 24 + cmp r0, 0 + beq _0807642C + b _080765C0 +_0807642C: + ldr r0, [r5, 0x70] + mov r8, r0 + ldr r0, _08076454 + mov r1, r8 + movs r2, 0 + bl sub_80708B4 + adds r0, r5, 0 + movs r1, 0x14 + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _0807645C + mov r1, r10 + cmp r1, 0 + bne _08076450 + b _080765C0 +_08076450: + ldr r0, _08076458 + b _080764A4 + .align 2, 0 +_08076454: .4byte gUnknown_202DF98 +_08076458: .4byte gUnknown_80FD524 +_0807645C: + adds r0, r5, 0 + movs r1, 0x45 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0807647C + mov r3, r10 + cmp r3, 0 + bne _08076472 + b _080765C0 +_08076472: + ldr r0, _08076478 + b _080764A4 + .align 2, 0 +_08076478: .4byte gUnknown_80FCEB0 +_0807647C: + adds r0, r5, 0 + movs r1, 0x8 + bl sub_8071858 + lsls r0, 24 + cmp r0, 0 + bne _0807649A + adds r0, r5, 0 + movs r1, 0x11 + bl sub_8071858 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _080764B4 +_0807649A: + mov r0, r10 + cmp r0, 0 + bne _080764A2 + b _080765C0 +_080764A2: + ldr r0, _080764B0 +_080764A4: + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 + b _080765C0 + .align 2, 0 +_080764B0: .4byte gUnknown_80FCEDC +_080764B4: + movs r6, 0x1 + mov r1, r8 + adds r1, 0xAC + ldrb r0, [r1] + cmp r0, 0x3 + beq _08076520 + cmp r0, 0x2 + beq _0807650C + movs r0, 0x2 + strb r0, [r1] + ldr r1, _08076504 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_808417C + adds r0, 0x1 + mov r1, r8 + adds r1, 0xAD + strb r0, [r1] + mov r0, r8 + adds r0, 0xAE + strb r4, [r0] + adds r0, 0x1 + strb r4, [r0] + movs r6, 0 + adds r0, r5, 0 + bl sub_8041C6C + ldr r0, _08076508 + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 + adds r0, r5, 0 + movs r1, 0x8 + bl sub_806CE94 + b _0807652C + .align 2, 0 +_08076504: .4byte gUnknown_80F4E34 +_08076508: .4byte gUnknown_80FB598 +_0807650C: + ldr r0, _0807651C + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 + b _0807652C + .align 2, 0 +_0807651C: .4byte gUnknown_80FB5D4 +_08076520: + ldr r0, _080765D0 + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 +_0807652C: + adds r0, r5, 0 + movs r1, 0x19 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _080765BA + cmp r6, 0 + bne _080765BA + movs r1, 0 + mov r9, r1 + movs r6, 0 +_08076544: + movs r3, 0x4 + ldrsh r0, [r5, r3] + ldr r1, _080765D4 + lsls r2, r6, 2 + adds r2, r1 + movs r3, 0 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r3, 0x6 + ldrsh r1, [r5, r3] + movs r3, 0x2 + ldrsh r2, [r2, r3] + adds r1, r2 + bl sub_804954C + ldr r4, [r0, 0x10] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080765B4 + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0x1 + bne _080765B4 + mov r0, r9 + cmp r0, 0 + bne _0807659A + movs r1, 0x1 + mov r9, r1 + ldr r0, _080765D8 + mov r1, r8 + movs r2, 0 + bl sub_80708B4 + ldr r0, _080765DC + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 +_0807659A: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_807167C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080765B4 + adds r0, r7, 0 + adds r1, r4, 0 + mov r2, r10 + bl sub_80763F8 +_080765B4: + adds r6, 0x1 + cmp r6, 0x7 + ble _08076544 +_080765BA: + adds r0, r5, 0 + bl sub_80418D4 +_080765C0: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080765D0: .4byte gUnknown_80FB5F8 +_080765D4: .4byte gUnknown_80F4448 +_080765D8: .4byte gUnknown_202DF98 +_080765DC: .4byte gUnknown_80FF01C + thumb_func_end sub_80763F8 + + thumb_func_start sub_80765E0 +sub_80765E0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r7, r0, 0 + adds r5, r1, 0 + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08076602 + b _08076790 +_08076602: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r10 + bl sub_80716E8 + lsls r0, 24 + cmp r0, 0 + beq _08076614 + b _08076790 +_08076614: + ldr r0, [r5, 0x70] + mov r8, r0 + ldr r0, _0807663C + mov r1, r8 + movs r2, 0 + bl sub_80708B4 + adds r0, r5, 0 + movs r1, 0x14 + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _08076644 + mov r1, r10 + cmp r1, 0 + bne _08076638 + b _08076790 +_08076638: + ldr r0, _08076640 + b _0807668C + .align 2, 0 +_0807663C: .4byte gUnknown_202DF98 +_08076640: .4byte gUnknown_80FD524 +_08076644: + adds r0, r5, 0 + movs r1, 0x45 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _08076664 + mov r3, r10 + cmp r3, 0 + bne _0807665A + b _08076790 +_0807665A: + ldr r0, _08076660 + b _0807668C + .align 2, 0 +_08076660: .4byte gUnknown_80FCEB0 +_08076664: + adds r0, r5, 0 + movs r1, 0x8 + bl sub_8071858 + lsls r0, 24 + cmp r0, 0 + bne _08076682 + adds r0, r5, 0 + movs r1, 0x11 + bl sub_8071858 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _0807669C +_08076682: + mov r0, r10 + cmp r0, 0 + bne _0807668A + b _08076790 +_0807668A: + ldr r0, _08076698 +_0807668C: + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 + b _08076790 + .align 2, 0 +_08076698: .4byte gUnknown_80FCEDC +_0807669C: + movs r6, 0x1 + mov r1, r8 + adds r1, 0xAC + ldrb r0, [r1] + cmp r0, 0x3 + beq _080766F0 + movs r0, 0x3 + strb r0, [r1] + ldr r1, _080766E8 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_808417C + adds r0, 0x1 + mov r1, r8 + adds r1, 0xAD + strb r0, [r1] + mov r0, r8 + adds r0, 0xAE + strb r4, [r0] + adds r0, 0x1 + strb r4, [r0] + movs r6, 0 + adds r0, r5, 0 + bl sub_8041C7C + ldr r0, _080766EC + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 + adds r0, r5, 0 + movs r1, 0x8 + bl sub_806CE94 + b _080766FC + .align 2, 0 +_080766E8: .4byte gUnknown_80F4E38 +_080766EC: .4byte gUnknown_80FB5B4 +_080766F0: + ldr r0, _080767A0 + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 +_080766FC: + adds r0, r5, 0 + movs r1, 0x19 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0807678A + cmp r6, 0 + bne _0807678A + movs r1, 0 + mov r9, r1 + movs r6, 0 +_08076714: + movs r3, 0x4 + ldrsh r0, [r5, r3] + ldr r1, _080767A4 + lsls r2, r6, 2 + adds r2, r1 + movs r3, 0 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r3, 0x6 + ldrsh r1, [r5, r3] + movs r3, 0x2 + ldrsh r2, [r2, r3] + adds r1, r2 + bl sub_804954C + ldr r4, [r0, 0x10] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08076784 + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0x1 + bne _08076784 + mov r0, r9 + cmp r0, 0 + bne _0807676A + movs r1, 0x1 + mov r9, r1 + ldr r0, _080767A8 + mov r1, r8 + movs r2, 0 + bl sub_80708B4 + ldr r0, _080767AC + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 +_0807676A: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_807167C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08076784 + adds r0, r7, 0 + adds r1, r4, 0 + mov r2, r10 + bl sub_80765E0 +_08076784: + adds r6, 0x1 + cmp r6, 0x7 + ble _08076714 +_0807678A: + adds r0, r5, 0 + bl sub_80418D4 +_08076790: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080767A0: .4byte gUnknown_80FB5F8 +_080767A4: .4byte gUnknown_80F4448 +_080767A8: .4byte gUnknown_202DF98 +_080767AC: .4byte gUnknown_80FF01C + thumb_func_end sub_80765E0 + + thumb_func_start sub_80767B0 +sub_80767B0: + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r0 + adds r5, r1, 0 + lsls r2, 24 + lsrs r4, r2, 24 + adds r6, r4, 0 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _080767CE + b _080768C8 +_080767CE: + ldr r0, _0807680C + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + ldr r7, [r5, 0x70] + adds r0, r7, 0 + adds r0, 0xB0 + ldrb r0, [r0] + cmp r0, 0x1 + beq _080768C8 + mov r0, r8 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_80716E8 + lsls r0, 24 + cmp r0, 0 + bne _080768C8 + adds r0, r5, 0 + movs r1, 0x41 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _08076814 + cmp r4, 0 + beq _080768C8 + ldr r0, _08076810 + b _0807685C + .align 2, 0 +_0807680C: .4byte gUnknown_202DF98 +_08076810: .4byte gUnknown_80FCDE0 +_08076814: + adds r0, r5, 0 + movs r1, 0x6 + bl sub_8071858 + lsls r0, 24 + cmp r0, 0 + beq _08076830 + cmp r4, 0 + beq _080768C8 + ldr r0, _0807682C + b _0807685C + .align 2, 0 +_0807682C: .4byte gUnknown_80FCE00 +_08076830: + adds r0, r5, 0 + bl sub_8045128 + ldrh r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + bne _08076878 + ldr r1, _08076868 + ldr r0, _0807686C + ldr r0, [r0] + ldr r2, _08076870 + adds r0, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x1 + bne _08076878 + cmp r6, 0 + beq _080768C8 + ldr r0, _08076874 +_0807685C: + ldr r2, [r0] + mov r0, r8 + adds r1, r5, 0 + bl sub_80522F4 + b _080768C8 + .align 2, 0 +_08076868: .4byte gUnknown_810ACC0 +_0807686C: .4byte gUnknown_203B418 +_08076870: .4byte 0x00003a0e +_08076874: .4byte gUnknown_80FCE34 +_08076878: + adds r6, r7, 0 + adds r6, 0xB0 + ldrb r0, [r6] + subs r0, 0x3 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _08076892 + adds r0, r7, 0 + adds r0, 0x9C + ldr r0, [r0] + bl sub_8076CB4 +_08076892: + adds r0, r5, 0 + bl sub_8041F08 + movs r4, 0 + movs r0, 0x1 + strb r0, [r6] + ldr r1, _080768D4 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_808417C + adds r0, 0x1 + adds r1, r7, 0 + adds r1, 0xB8 + strb r0, [r1] + adds r0, r7, 0 + adds r0, 0xB9 + strb r4, [r0] + ldr r0, _080768D8 + ldr r2, [r0] + mov r0, r8 + adds r1, r5, 0 + bl sub_80522F4 + adds r0, r5, 0 + bl sub_80418D4 +_080768C8: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080768D4: .4byte gUnknown_80F4E2C +_080768D8: .4byte gUnknown_80FB610 + thumb_func_end sub_80767B0 + + thumb_func_start sub_80768DC +sub_80768DC: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + adds r5, r1, 0 + lsls r2, 16 + asrs r2, 16 + mov r8, r2 + lsls r3, 24 + lsrs r4, r3, 24 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080769BE + adds r0, r7, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_80716E8 + lsls r0, 24 + cmp r0, 0 + bne _080769BE + ldr r6, [r5, 0x70] + adds r0, r6, 0 + adds r0, 0xB0 + ldrb r1, [r0] + subs r0, r1, 0x3 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _0807692A + adds r0, r6, 0 + adds r0, 0x9C + ldr r0, [r0] + bl sub_8076CB4 + b _08076948 +_0807692A: + lsls r0, r1, 24 + lsrs r0, 24 + cmp r0, 0x5 + bne _08076948 + ldr r0, _0807699C + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _080769A0 + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 +_08076948: + ldr r0, _0807699C + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + adds r1, r6, 0 + adds r1, 0xB0 + ldrb r0, [r1] + cmp r0, 0x7 + beq _080769AC + movs r4, 0 + movs r0, 0x7 + strb r0, [r1] + ldr r1, _080769A4 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_808417C + adds r0, 0x1 + adds r1, r6, 0 + adds r1, 0xB8 + strb r0, [r1] + adds r0, r6, 0 + adds r0, 0xB9 + strb r4, [r0] + subs r0, 0x5 + mov r1, r8 + str r1, [r0] + adds r0, r5, 0 + bl nullsub_71 + ldr r0, _080769A8 + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 + adds r0, r5, 0 + movs r1, 0x8 + bl sub_806CE94 + b _080769B8 + .align 2, 0 +_0807699C: .4byte gUnknown_202DF98 +_080769A0: .4byte gUnknown_80FA844 +_080769A4: .4byte gUnknown_80F4E58 +_080769A8: .4byte gUnknown_80FB628 +_080769AC: + ldr r0, _080769C8 + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 +_080769B8: + adds r0, r5, 0 + bl sub_80418D4 +_080769BE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080769C8: .4byte gUnknown_80FB64C + thumb_func_end sub_80768DC + + thumb_func_start sub_80769CC +sub_80769CC: + push {r4-r7,lr} + adds r7, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08076A9A + adds r0, r7, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_80716E8 + lsls r0, 24 + cmp r0, 0 + bne _08076A9A + ldr r6, [r5, 0x70] + adds r0, r6, 0 + adds r0, 0xB0 + ldrb r1, [r0] + subs r0, r1, 0x3 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _08076A0C + adds r0, r6, 0 + adds r0, 0x9C + ldr r0, [r0] + bl sub_8076CB4 + b _08076A2A +_08076A0C: + lsls r0, r1, 24 + lsrs r0, 24 + cmp r0, 0x5 + bne _08076A2A + ldr r0, _08076A78 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08076A7C + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 +_08076A2A: + ldr r0, _08076A78 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + adds r1, r6, 0 + adds r1, 0xB0 + ldrb r0, [r1] + cmp r0, 0x2 + beq _08076A88 + movs r4, 0 + movs r0, 0x2 + strb r0, [r1] + ldr r1, _08076A80 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_808417C + adds r0, 0x1 + adds r1, r6, 0 + adds r1, 0xB8 + strb r0, [r1] + adds r0, r6, 0 + adds r0, 0xB9 + strb r4, [r0] + adds r0, r5, 0 + bl nullsub_70 + ldr r0, _08076A84 + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 + adds r0, r5, 0 + movs r1, 0x8 + bl sub_806CE94 + b _08076A94 + .align 2, 0 +_08076A78: .4byte gUnknown_202DF98 +_08076A7C: .4byte gUnknown_80FA844 +_08076A80: .4byte gUnknown_80F4E54 +_08076A84: .4byte gUnknown_80FB668 +_08076A88: + ldr r0, _08076AA0 + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 +_08076A94: + adds r0, r5, 0 + bl sub_80418D4 +_08076A9A: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08076AA0: .4byte gUnknown_80FB688 + thumb_func_end sub_80769CC + + thumb_func_start sub_8076AA4 +sub_8076AA4: + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08076B3A + ldr r1, [r5, 0x70] + adds r7, r1, 0 + adds r6, r1, 0 + adds r6, 0xB0 + ldrb r0, [r6] + subs r0, 0x3 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _08076AD8 + adds r0, r1, 0 + adds r0, 0x9C + ldr r0, [r0] + bl sub_8076CB4 +_08076AD8: + ldr r0, _08076B1C + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + ldrb r0, [r6] + cmp r0, 0x5 + beq _08076B28 + movs r4, 0 + movs r0, 0x5 + strb r0, [r6] + ldr r1, _08076B20 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_808417C + adds r0, 0x1 + adds r1, r7, 0 + adds r1, 0xB8 + strb r0, [r1] + adds r0, r7, 0 + adds r0, 0xB9 + strb r4, [r0] + adds r0, r5, 0 + bl nullsub_90 + ldr r0, _08076B24 + ldr r2, [r0] + mov r0, r8 + adds r1, r5, 0 + bl sub_80522F4 + b _08076B34 + .align 2, 0 +_08076B1C: .4byte gUnknown_202DF98 +_08076B20: .4byte gUnknown_80F4E60 +_08076B24: .4byte gUnknown_80FB6A4 +_08076B28: + ldr r0, _08076B44 + ldr r2, [r0] + mov r0, r8 + adds r1, r5, 0 + bl sub_80522F4 +_08076B34: + adds r0, r5, 0 + bl sub_80418D4 +_08076B3A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08076B44: .4byte gUnknown_80FB6C0 + thumb_func_end sub_8076AA4 + + thumb_func_start sub_8076B48 +sub_8076B48: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08076B60 + b _08076C9E +_08076B60: + adds r0, r6, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_80716E8 + lsls r0, 24 + lsrs r7, r0, 24 + cmp r7, 0 + beq _08076B74 + b _08076C9E +_08076B74: + ldr r5, [r6, 0x70] + ldr r0, [r4, 0x70] + mov r8, r0 + adds r1, r5, 0 + adds r1, 0xB0 + ldrb r0, [r1] + subs r0, 0x3 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _08076C20 + mov r2, r8 + adds r2, 0xB0 + ldrb r0, [r2] + cmp r0, 0x3 + beq _08076C20 + cmp r0, 0x4 + beq _08076C20 + movs r0, 0x3 + strb r0, [r1] + adds r1, 0x8 + movs r0, 0x7F + strb r0, [r1] + adds r0, r5, 0 + adds r0, 0xB9 + strb r7, [r0] + movs r0, 0x4 + strb r0, [r2] + ldr r1, _08076C0C + adds r0, r4, 0 + movs r2, 0x1 + bl sub_808417C + adds r0, 0x1 + mov r1, r8 + adds r1, 0xB8 + strb r0, [r1] + mov r0, r8 + adds r0, 0xB9 + strb r7, [r0] + adds r2, r5, 0 + adds r2, 0x9C + ldr r0, _08076C10 + ldr r1, [r0] + ldr r0, _08076C14 + adds r1, r0 + ldr r0, [r1] + str r0, [r2] + mov r2, r8 + adds r2, 0x9C + ldr r0, [r1] + str r0, [r2] + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + adds r0, r6, 0 + adds r1, r4, 0 + bl nullsub_69 + ldr r0, _08076C18 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08076C1C + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + adds r0, r4, 0 + movs r1, 0x8 + bl sub_806CE94 + b _08076C98 + .align 2, 0 +_08076C0C: .4byte gUnknown_80F4E5C +_08076C10: .4byte gUnknown_203B418 +_08076C14: .4byte 0x000037f4 +_08076C18: .4byte gUnknown_202DF98 +_08076C1C: .4byte gUnknown_80FB6D8 +_08076C20: + adds r7, r5, 0 + adds r7, 0xB0 + ldrb r0, [r7] + cmp r0, 0x3 + bne _08076C40 + ldr r0, _08076CA8 + adds r1, r6, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08076CAC + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08076C40: + mov r5, r8 + adds r5, 0xB0 + ldrb r0, [r5] + cmp r0, 0x3 + bne _08076C60 + ldr r0, _08076CA8 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08076CAC + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08076C60: + ldrb r0, [r7] + cmp r0, 0x4 + bne _08076C7C + ldr r0, _08076CA8 + adds r1, r6, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08076CB0 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08076C7C: + ldrb r0, [r5] + cmp r0, 0x4 + bne _08076C98 + ldr r0, _08076CA8 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08076CB0 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08076C98: + adds r0, r4, 0 + bl sub_80418D4 +_08076C9E: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08076CA8: .4byte gUnknown_202DF98 +_08076CAC: .4byte gUnknown_80FB6FC +_08076CB0: .4byte gUnknown_80FB718 + thumb_func_end sub_8076B48 + + thumb_func_start sub_8076CB4 +sub_8076CB4: + push {r4-r7,lr} + adds r7, r0, 0 + movs r5, 0 + movs r6, 0 +_08076CBC: + ldr r0, _08076D08 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _08076D0C + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08076CFA + ldr r1, [r4, 0x70] + adds r2, r1, 0 + adds r2, 0x9C + ldr r0, [r2] + cmp r0, r7 + bne _08076CF4 + adds r1, 0xB0 + ldrb r0, [r1] + subs r0, 0x3 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _08076CF2 + strb r6, [r1] +_08076CF2: + str r6, [r2] +_08076CF4: + adds r0, r4, 0 + bl sub_80418D4 +_08076CFA: + adds r5, 0x1 + cmp r5, 0x13 + ble _08076CBC + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08076D08: .4byte gUnknown_203B418 +_08076D0C: .4byte 0x000135cc + thumb_func_end sub_8076CB4 + + thumb_func_start sub_8076D10 +sub_8076D10: + push {r4-r7,lr} + adds r7, r0, 0 + adds r6, r1, 0 + adds r0, r6, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08076E0E + adds r0, r7, 0 + adds r1, r6, 0 + movs r2, 0x1 + bl sub_80716E8 + lsls r0, 24 + cmp r0, 0 + bne _08076E0E + adds r0, r6, 0 + bl sub_8041C08 + ldr r4, [r6, 0x70] + adds r5, r4, 0 + adds r5, 0xB0 + ldrb r0, [r5] + subs r0, 0x3 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _08076D54 + adds r0, r4, 0 + adds r0, 0x9C + ldr r0, [r0] + bl sub_8076CB4 +_08076D54: + ldr r0, _08076D74 + adds r1, r6, 0 + movs r2, 0 + bl sub_8045B94 + ldrb r0, [r5] + cmp r0, 0x6 + beq _08076DAC + movs r0, 0x6 + strb r0, [r5] + ldrb r0, [r4, 0x7] + cmp r0, 0 + beq _08076D7C + ldr r1, _08076D78 + b _08076D7E + .align 2, 0 +_08076D74: .4byte gUnknown_202DF98 +_08076D78: .4byte gUnknown_80F4EBC +_08076D7C: + ldr r1, _08076DA4 +_08076D7E: + adds r0, r6, 0 + movs r2, 0x1 + bl sub_808417C + adds r0, 0x1 + adds r1, r4, 0 + adds r1, 0xB8 + strb r0, [r1] + adds r1, r4, 0 + adds r1, 0xB9 + movs r0, 0 + strb r0, [r1] + ldr r0, _08076DA8 + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r6, 0 + bl sub_80522F4 + b _08076DB8 + .align 2, 0 +_08076DA4: .4byte gUnknown_80F4EC0 +_08076DA8: .4byte gUnknown_80FB7BC +_08076DAC: + ldr r0, _08076E14 + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r6, 0 + bl sub_80522F4 +_08076DB8: + ldrb r0, [r4, 0x6] + cmp r0, 0 + beq _08076E08 + movs r5, 0 + movs r7, 0 +_08076DC2: + ldr r0, _08076E18 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _08076E1C + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08076E02 + ldr r1, [r4, 0x70] + adds r3, r1, 0 + adds r3, 0x78 + ldrb r0, [r3] + cmp r0, 0x1 + bne _08076E02 + adds r2, r1, 0 + adds r2, 0x80 + ldr r0, [r2] + cmp r0, r6 + bne _08076E02 + movs r0, 0x6 + strb r0, [r3] + str r7, [r2] + adds r0, r1, 0 + adds r0, 0x7C + strh r7, [r0] + subs r0, 0x2 + strb r7, [r0] +_08076E02: + adds r5, 0x1 + cmp r5, 0x3 + ble _08076DC2 +_08076E08: + adds r0, r6, 0 + bl sub_80418D4 +_08076E0E: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08076E14: .4byte gUnknown_80FB7DC +_08076E18: .4byte gUnknown_203B418 +_08076E1C: .4byte 0x0001357c + thumb_func_end sub_8076D10 + + thumb_func_start sub_8076E20 +sub_8076E20: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r6, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + mov r9, r3 + ldr r0, [sp, 0x1C] + ldr r1, [sp, 0x20] + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08076E4C + b _08076F6E +_08076E4C: + cmp r5, 0 + beq _08076E64 + ldr r0, _08076E5C + ldr r1, _08076E60 + ldr r1, [r1] + bl strcpy + b _08076E6E + .align 2, 0 +_08076E5C: .4byte gUnknown_202DE58 +_08076E60: .4byte gUnknown_80FC0C8 +_08076E64: + ldr r0, _08076EA0 + ldr r1, _08076EA4 + ldr r1, [r1] + bl strcpy +_08076E6E: + cmp r7, 0 + beq _08076EE4 + adds r0, r6, 0 + adds r1, r4, 0 + mov r2, r8 + bl sub_8071728 + lsls r0, 24 + cmp r0, 0 + bne _08076F6E + adds r0, r4, 0 + movs r1, 0xB + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _08076EB0 + ldr r0, _08076EA8 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08076EAC + b _08076ECE + .align 2, 0 +_08076EA0: .4byte gUnknown_202DE58 +_08076EA4: .4byte gUnknown_80FC0B8 +_08076EA8: .4byte gUnknown_202DF98 +_08076EAC: .4byte gUnknown_80FD550 +_08076EB0: + adds r0, r4, 0 + movs r1, 0x9 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _08076EE4 + cmp r5, 0 + bne _08076EE4 + ldr r0, _08076EDC + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08076EE0 +_08076ECE: + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08076F6E + .align 2, 0 +_08076EDC: .4byte gUnknown_202DF98 +_08076EE0: .4byte gUnknown_80FCA60 +_08076EE4: + ldr r7, [r4, 0x70] + ldr r0, _08076F0C + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8041F28 + mov r0, r9 + cmp r0, 0x1 + bne _08076F18 + ldr r0, _08076F10 + ldr r1, _08076F14 + ldr r1, [r1] + bl strcpy + b _08076F22 + .align 2, 0 +_08076F0C: .4byte gUnknown_202DF98 +_08076F10: .4byte gUnknown_202DEA8 +_08076F14: .4byte gUnknown_80FC0E4 +_08076F18: + ldr r0, _08076F50 + ldr r1, _08076F54 + ldr r1, [r1] + bl strcpy +_08076F22: + lsls r1, r5, 1 + adds r0, r7, 0 + adds r0, 0x1C + adds r1, r0, r1 + movs r2, 0 + ldrsh r3, [r1, r2] + mov r0, r9 + subs r3, r0 + cmp r3, 0 + bge _08076F38 + movs r3, 0 +_08076F38: + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, r3 + beq _08076F5C + strh r3, [r1] + ldr r0, _08076F58 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08076F68 + .align 2, 0 +_08076F50: .4byte gUnknown_202DEA8 +_08076F54: .4byte gUnknown_80FC0D4 +_08076F58: .4byte gUnknown_80FC15C +_08076F5C: + ldr r0, _08076F7C + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08076F68: + adds r0, r4, 0 + bl sub_80418D4 +_08076F6E: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08076F7C: .4byte gUnknown_80FC274 + thumb_func_end sub_8076E20 + + thumb_func_start sub_8076F80 +sub_8076F80: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r6, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + mov r9, r3 + ldr r0, [sp, 0x1C] + ldr r1, [sp, 0x20] + lsls r0, 24 + lsrs r7, r0, 24 + lsls r1, 24 + lsrs r1, 24 + mov r8, r1 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08077072 + cmp r5, 0 + beq _08076FC4 + ldr r0, _08076FBC + ldr r1, _08076FC0 + ldr r1, [r1] + bl strcpy + b _08076FCE + .align 2, 0 +_08076FBC: .4byte gUnknown_202DE58 +_08076FC0: .4byte gUnknown_80FC0AC +_08076FC4: + ldr r0, _08077008 + ldr r1, _0807700C + ldr r1, [r1] + bl strcpy +_08076FCE: + cmp r7, 0 + beq _08076FE2 + adds r0, r6, 0 + adds r1, r4, 0 + mov r2, r8 + bl sub_8071728 + lsls r0, 24 + cmp r0, 0 + bne _08077072 +_08076FE2: + ldr r7, [r4, 0x70] + ldr r0, _08077010 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8041F4C + mov r0, r9 + cmp r0, 0x1 + bne _0807701C + ldr r0, _08077014 + ldr r1, _08077018 + ldr r1, [r1] + bl strcpy + b _08077026 + .align 2, 0 +_08077008: .4byte gUnknown_202DE58 +_0807700C: .4byte gUnknown_80FC09C +_08077010: .4byte gUnknown_202DF98 +_08077014: .4byte gUnknown_202DEA8 +_08077018: .4byte gUnknown_80FC0E4 +_0807701C: + ldr r0, _08077054 + ldr r1, _08077058 + ldr r1, [r1] + bl strcpy +_08077026: + lsls r1, r5, 1 + adds r0, r7, 0 + adds r0, 0x20 + adds r1, r0, r1 + movs r2, 0 + ldrsh r3, [r1, r2] + mov r0, r9 + subs r3, r0 + cmp r3, 0 + bge _0807703C + movs r3, 0 +_0807703C: + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, r3 + beq _08077060 + strh r3, [r1] + ldr r0, _0807705C + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _0807706C + .align 2, 0 +_08077054: .4byte gUnknown_202DEA8 +_08077058: .4byte gUnknown_80FC0D4 +_0807705C: .4byte gUnknown_80FC158 +_08077060: + ldr r0, _08077080 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_0807706C: + adds r0, r4, 0 + bl sub_80418D4 +_08077072: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08077080: .4byte gUnknown_80FC248 + thumb_func_end sub_8076F80 + + thumb_func_start sub_8077084 +sub_8077084: + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r0 + adds r4, r1, 0 + adds r5, r2, 0 + adds r6, r3, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08077152 + ldr r7, [r4, 0x70] + ldr r0, _080770C4 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8041F70 + cmp r5, 0 + beq _080770D0 + ldr r0, _080770C8 + ldr r1, _080770CC + ldr r1, [r1] + bl strcpy + b _080770DA + .align 2, 0 +_080770C4: .4byte gUnknown_202DF98 +_080770C8: .4byte gUnknown_202DE58 +_080770CC: .4byte gUnknown_80FC0C8 +_080770D0: + ldr r0, _080770EC + ldr r1, _080770F0 + ldr r1, [r1] + bl strcpy +_080770DA: + cmp r6, 0x1 + bne _080770FC + ldr r0, _080770F4 + ldr r1, _080770F8 + ldr r1, [r1] + bl strcpy + b _08077106 + .align 2, 0 +_080770EC: .4byte gUnknown_202DE58 +_080770F0: .4byte gUnknown_80FC0B8 +_080770F4: .4byte gUnknown_202DEA8 +_080770F8: .4byte gUnknown_80FC0E4 +_080770FC: + ldr r0, _08077134 + ldr r1, _08077138 + ldr r1, [r1] + bl strcpy +_08077106: + lsls r1, r5, 1 + adds r0, r7, 0 + adds r0, 0x1C + adds r1, r0, r1 + movs r0, 0 + ldrsh r3, [r1, r0] + adds r3, r6 + cmp r3, 0x13 + ble _0807711A + movs r3, 0x14 +_0807711A: + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, r3 + beq _08077140 + strh r3, [r1] + ldr r0, _0807713C + ldr r2, [r0] + mov r0, r8 + adds r1, r4, 0 + bl sub_80522F4 + b _0807714C + .align 2, 0 +_08077134: .4byte gUnknown_202DEA8 +_08077138: .4byte gUnknown_80FC0D4 +_0807713C: .4byte gUnknown_80FC13C +_08077140: + ldr r0, _0807715C + ldr r2, [r0] + mov r0, r8 + adds r1, r4, 0 + bl sub_80522F4 +_0807714C: + adds r0, r4, 0 + bl sub_80418D4 +_08077152: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0807715C: .4byte gUnknown_80FC270 + thumb_func_end sub_8077084 + + thumb_func_start sub_8077160 +sub_8077160: + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r0 + adds r4, r1, 0 + adds r5, r2, 0 + adds r6, r3, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807722E + ldr r7, [r4, 0x70] + ldr r0, _080771A0 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8041F94 + cmp r5, 0 + beq _080771AC + ldr r0, _080771A4 + ldr r1, _080771A8 + ldr r1, [r1] + bl strcpy + b _080771B6 + .align 2, 0 +_080771A0: .4byte gUnknown_202DF98 +_080771A4: .4byte gUnknown_202DE58 +_080771A8: .4byte gUnknown_80FC0AC +_080771AC: + ldr r0, _080771C8 + ldr r1, _080771CC + ldr r1, [r1] + bl strcpy +_080771B6: + cmp r6, 0x1 + bne _080771D8 + ldr r0, _080771D0 + ldr r1, _080771D4 + ldr r1, [r1] + bl strcpy + b _080771E2 + .align 2, 0 +_080771C8: .4byte gUnknown_202DE58 +_080771CC: .4byte gUnknown_80FC09C +_080771D0: .4byte gUnknown_202DEA8 +_080771D4: .4byte gUnknown_80FC0E4 +_080771D8: + ldr r0, _08077210 + ldr r1, _08077214 + ldr r1, [r1] + bl strcpy +_080771E2: + lsls r1, r5, 1 + adds r0, r7, 0 + adds r0, 0x20 + adds r1, r0, r1 + movs r0, 0 + ldrsh r3, [r1, r0] + adds r3, r6 + cmp r3, 0x13 + ble _080771F6 + movs r3, 0x14 +_080771F6: + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, r3 + beq _0807721C + strh r3, [r1] + ldr r0, _08077218 + ldr r2, [r0] + mov r0, r8 + adds r1, r4, 0 + bl sub_80522F4 + b _08077228 + .align 2, 0 +_08077210: .4byte gUnknown_202DEA8 +_08077214: .4byte gUnknown_80FC0D4 +_08077218: .4byte gUnknown_80FC138 +_0807721C: + ldr r0, _08077238 + ldr r2, [r0] + mov r0, r8 + adds r1, r4, 0 + bl sub_80522F4 +_08077228: + adds r0, r4, 0 + bl sub_80418D4 +_0807722E: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08077238: .4byte gUnknown_80FC21C + thumb_func_end sub_8077160 + + thumb_func_start sub_807723C +sub_807723C: + push {r4,lr} + adds r4, r0, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08077258 + adds r0, r4, 0 + movs r1, 0x48 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + bne _0807725C +_08077258: + movs r0, 0 + b _0807726C +_0807725C: + ldr r0, [r4, 0x70] + movs r1, 0x28 + ldrsh r0, [r0, r1] + cmp r0, 0x1 + bgt _0807726A + movs r0, 0x2 + b _0807726C +_0807726A: + movs r0, 0x1 +_0807726C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_807723C + + thumb_func_start sub_8077274 +sub_8077274: + push {r4,r5,lr} + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080772B4 + ldr r0, [r5, 0x70] + adds r4, r0, 0 + ldr r0, _080772BC + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + movs r0, 0x28 + ldrsh r1, [r4, r0] + adds r1, 0x1 + cmp r1, 0x1 + ble _0807729E + movs r1, 0x2 +_0807729E: + movs r2, 0x28 + ldrsh r0, [r4, r2] + cmp r0, r1 + beq _080772AE + strh r1, [r4, 0x28] + adds r0, r5, 0 + bl sub_8041C58 +_080772AE: + adds r0, r5, 0 + bl sub_80418D4 +_080772B4: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080772BC: .4byte gUnknown_202DF98 + thumb_func_end sub_8077274 + + thumb_func_start sub_80772C0 +sub_80772C0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r9, r0 + adds r5, r1, 0 + adds r4, r2, 0 + adds r7, r3, 0 + ldr r0, [sp, 0x20] + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _080772E6 + b _08077422 +_080772E6: + cmp r4, 0 + beq _08077300 + ldr r0, _080772F8 + ldr r1, _080772FC + ldr r1, [r1] + bl strcpy + b _0807730A + .align 2, 0 +_080772F8: .4byte gUnknown_202DE58 +_080772FC: .4byte gUnknown_80FC0C8 +_08077300: + ldr r0, _08077340 + ldr r1, _08077344 + ldr r1, [r1] + bl strcpy +_0807730A: + cmp r7, 0xFF + bgt _08077320 + mov r0, r9 + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_8071728 + lsls r0, 24 + cmp r0, 0 + beq _08077320 + b _08077422 +_08077320: + adds r0, r5, 0 + movs r1, 0xB + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _08077350 + cmp r7, 0xFF + bgt _08077350 + ldr r0, _08077348 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _0807734C + b _08077376 + .align 2, 0 +_08077340: .4byte gUnknown_202DE58 +_08077344: .4byte gUnknown_80FC0B8 +_08077348: .4byte gUnknown_202DF98 +_0807734C: .4byte gUnknown_80FD550 +_08077350: + adds r0, r5, 0 + movs r1, 0x9 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0807738C + cmp r4, 0 + bne _0807738C + cmp r7, 0xFF + bgt _0807738C + cmp r6, 0 + beq _08077422 + ldr r0, _08077384 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08077388 +_08077376: + ldr r2, [r0] + mov r0, r9 + adds r1, r5, 0 + bl sub_80522F4 + b _08077422 + .align 2, 0 +_08077384: .4byte gUnknown_202DF98 +_08077388: .4byte gUnknown_80FCA60 +_0807738C: + ldr r0, [r5, 0x70] + mov r8, r0 + ldr r0, _080773B8 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + lsls r1, r4, 2 + mov r0, r8 + adds r0, 0x2C + adds r0, r1 + ldr r0, [r0] + mov r10, r0 + adds r6, r1, 0 + cmp r7, 0xFF + bgt _080773BC + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8041FD8 + b _080773C4 + .align 2, 0 +_080773B8: .4byte gUnknown_202DF98 +_080773BC: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8041FB4 +_080773C4: + mov r0, r8 + adds r0, 0x2C + adds r4, r0, r6 + ldr r0, [r4] + adds r1, r7, 0 + bl sub_8009DA4 + str r0, [r4] + cmp r0, 0x1 + bgt _080773DC + movs r0, 0x2 + str r0, [r4] +_080773DC: + ldr r0, [r4] + ldr r1, _080773F0 + cmp r0, r1 + ble _080773E6 + str r1, [r4] +_080773E6: + ldr r0, [r4] + cmp r10, r0 + ble _080773F8 + ldr r0, _080773F4 + b _080773FE + .align 2, 0 +_080773F0: .4byte 0x000063fd +_080773F4: .4byte gUnknown_80FC11C +_080773F8: + cmp r10, r0 + bge _08077410 + ldr r0, _0807740C +_080773FE: + ldr r2, [r0] + mov r0, r9 + adds r1, r5, 0 + bl sub_80522F4 + b _0807741C + .align 2, 0 +_0807740C: .4byte gUnknown_80FC118 +_08077410: + ldr r0, _08077430 + ldr r2, [r0] + mov r0, r9 + adds r1, r5, 0 + bl sub_80522F4 +_0807741C: + adds r0, r5, 0 + bl sub_80418D4 +_08077422: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08077430: .4byte gUnknown_80FC184 + thumb_func_end sub_80772C0 + + thumb_func_start sub_8077434 +sub_8077434: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r9, r0 + adds r5, r1, 0 + adds r4, r2, 0 + mov r8, r3 + ldr r0, [sp, 0x20] + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807752E + cmp r4, 0 + beq _08077470 + ldr r0, _08077468 + ldr r1, _0807746C + ldr r1, [r1] + bl strcpy + b _0807747A + .align 2, 0 +_08077468: .4byte gUnknown_202DE58 +_0807746C: .4byte gUnknown_80FC0AC +_08077470: + ldr r0, _080774BC + ldr r1, _080774C0 + ldr r1, [r1] + bl strcpy +_0807747A: + mov r0, r8 + cmp r0, 0xFF + bgt _08077490 + mov r0, r9 + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_8071728 + lsls r0, 24 + cmp r0, 0 + bne _0807752E +_08077490: + ldr r7, [r5, 0x70] + ldr r0, _080774C4 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + lsls r1, r4, 2 + adds r0, r7, 0 + adds r0, 0x34 + adds r0, r1 + ldr r0, [r0] + mov r10, r0 + adds r6, r1, 0 + mov r0, r8 + cmp r0, 0xFF + bgt _080774C8 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_804201C + b _080774D0 + .align 2, 0 +_080774BC: .4byte gUnknown_202DE58 +_080774C0: .4byte gUnknown_80FC09C +_080774C4: .4byte gUnknown_202DF98 +_080774C8: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8041FFC +_080774D0: + adds r0, r7, 0 + adds r0, 0x34 + adds r4, r0, r6 + ldr r0, [r4] + mov r1, r8 + bl sub_8009DA4 + str r0, [r4] + cmp r0, 0x1 + bgt _080774E8 + movs r0, 0x2 + str r0, [r4] +_080774E8: + ldr r0, [r4] + ldr r1, _080774FC + cmp r0, r1 + ble _080774F2 + str r1, [r4] +_080774F2: + ldr r0, [r4] + cmp r10, r0 + ble _08077504 + ldr r0, _08077500 + b _0807750A + .align 2, 0 +_080774FC: .4byte 0x000063fd +_08077500: .4byte gUnknown_80FC114 +_08077504: + cmp r10, r0 + bge _0807751C + ldr r0, _08077518 +_0807750A: + ldr r2, [r0] + mov r0, r9 + adds r1, r5, 0 + bl sub_80522F4 + b _08077528 + .align 2, 0 +_08077518: .4byte gUnknown_80FC0FC +_0807751C: + ldr r0, _0807753C + ldr r2, [r0] + mov r0, r9 + adds r1, r5, 0 + bl sub_80522F4 +_08077528: + adds r0, r5, 0 + bl sub_80418D4 +_0807752E: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0807753C: .4byte gUnknown_80FC180 + thumb_func_end sub_8077434 + + thumb_func_start sub_8077540 +sub_8077540: + push {r4-r7,lr} + adds r7, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080775D2 + ldr r6, [r4, 0x70] + ldr r0, _08077578 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8042040 + cmp r5, 0 + beq _08077584 + ldr r0, _0807757C + ldr r1, _08077580 + ldr r1, [r1] + bl strcpy + b _0807758E + .align 2, 0 +_08077578: .4byte gUnknown_202DF98 +_0807757C: .4byte gUnknown_202DE58 +_08077580: .4byte gUnknown_80FC090 +_08077584: + ldr r0, _080775B4 + ldr r1, _080775B8 + ldr r1, [r1] + bl strcpy +_0807758E: + lsls r0, r5, 1 + adds r1, r6, 0 + adds r1, 0x24 + adds r1, r0 + ldrh r2, [r1] + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0x13 + bgt _080775C0 + adds r0, r2, 0x1 + strh r0, [r1] + ldr r0, _080775BC + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _080775CC + .align 2, 0 +_080775B4: .4byte gUnknown_202DE58 +_080775B8: .4byte gUnknown_80FC084 +_080775BC: .4byte gUnknown_80FC1C4 +_080775C0: + ldr r0, _080775D8 + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r4, 0 + bl sub_80522F4 +_080775CC: + adds r0, r4, 0 + bl sub_80418D4 +_080775D2: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080775D8: .4byte gUnknown_80FC218 + thumb_func_end sub_8077540 + + thumb_func_start sub_80775DC +sub_80775DC: + push {r4-r7,lr} + adds r7, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r3, 24 + lsrs r4, r3, 24 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080776B6 + cmp r6, 0 + beq _0807760C + ldr r0, _08077604 + ldr r1, _08077608 + ldr r1, [r1] + bl strcpy + b _08077616 + .align 2, 0 +_08077604: .4byte gUnknown_202DE58 +_08077608: .4byte gUnknown_80FC090 +_0807760C: + ldr r0, _08077654 + ldr r1, _08077658 + ldr r1, [r1] + bl strcpy +_08077616: + adds r0, r7, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_8071728 + lsls r0, 24 + cmp r0, 0 + bne _080776B6 + adds r0, r5, 0 + movs r1, 0x1E + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _08077664 + cmp r6, 0 + bne _08077664 + cmp r4, 0 + beq _080776B6 + ldr r0, _0807765C + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08077660 + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 + b _080776B6 + .align 2, 0 +_08077654: .4byte gUnknown_202DE58 +_08077658: .4byte gUnknown_80FC084 +_0807765C: .4byte gUnknown_202DF98 +_08077660: .4byte gUnknown_80FCA64 +_08077664: + ldr r4, [r5, 0x70] + ldr r0, _0807769C + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_8042060 + lsls r0, r6, 1 + adds r4, 0x24 + adds r1, r4, r0 + ldrh r2, [r1] + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0 + beq _080776A4 + subs r0, r2, 0x1 + strh r0, [r1] + ldr r0, _080776A0 + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 + b _080776B0 + .align 2, 0 +_0807769C: .4byte gUnknown_202DF98 +_080776A0: .4byte gUnknown_80FC1A4 +_080776A4: + ldr r0, _080776BC + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 +_080776B0: + adds r0, r5, 0 + bl sub_80418D4 +_080776B6: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080776BC: .4byte gUnknown_80FC1F0 + thumb_func_end sub_80775DC + + thumb_func_start sub_80776C0 +sub_80776C0: + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r1, 0 + lsls r2, 24 + lsrs r6, r2, 24 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08077776 + adds r0, r5, 0 + adds r1, r4, 0 + adds r2, r6, 0 + bl sub_80716E8 + lsls r0, 24 + cmp r0, 0 + bne _08077776 + adds r0, r4, 0 + movs r1, 0x1F + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _08077718 + ldr r0, _08077710 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + cmp r6, 0 + beq _08077776 + ldr r0, _08077714 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08077776 + .align 2, 0 +_08077710: .4byte gUnknown_202DF98 +_08077714: .4byte gUnknown_80FCC18 +_08077718: + ldr r6, [r4, 0x70] + ldr r0, _08077758 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r1, r6, 0 + adds r1, 0xBC + ldrb r0, [r1] + cmp r0, 0x1 + beq _08077764 + movs r0, 0x1 + strb r0, [r1] + ldr r1, _0807775C + adds r0, r4, 0 + movs r2, 0x1 + bl sub_808417C + adds r0, 0x1 + adds r1, r6, 0 + adds r1, 0xBD + strb r0, [r1] + adds r0, r4, 0 + bl sub_80420A0 + ldr r0, _08077760 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08077770 + .align 2, 0 +_08077758: .4byte gUnknown_202DF98 +_0807775C: .4byte gUnknown_80F4E3C +_08077760: .4byte gUnknown_80FB2E0 +_08077764: + ldr r0, _0807777C + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08077770: + adds r0, r4, 0 + bl sub_80418D4 +_08077776: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0807777C: .4byte gUnknown_80FB300 + thumb_func_end sub_80776C0 + + thumb_func_start sub_8077780 +sub_8077780: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r7, r0, 0 + adds r5, r1, 0 + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _080777A2 + b _080778F0 +_080777A2: + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r10 + bl sub_80716E8 + lsls r0, 24 + cmp r0, 0 + beq _080777B4 + b _080778F0 +_080777B4: + adds r0, r5, 0 + movs r1, 0x16 + bl sub_8071824 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _080777EC + ldr r0, _080777E4 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + mov r0, r10 + cmp r0, 0 + bne _080777D6 + b _080778F0 +_080777D6: + ldr r0, _080777E8 + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 + b _080778F0 + .align 2, 0 +_080777E4: .4byte gUnknown_202DF98 +_080777E8: .4byte gUnknown_80FCBF8 +_080777EC: + movs r6, 0x1 + ldr r1, [r5, 0x70] + mov r8, r1 + ldr r0, _08077844 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + mov r1, r8 + adds r1, 0xAC + ldrb r0, [r1] + cmp r0, 0x4 + beq _08077850 + movs r0, 0x4 + strb r0, [r1] + ldr r1, _08077848 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_808417C + adds r0, 0x1 + mov r1, r8 + adds r1, 0xAD + strb r0, [r1] + mov r0, r8 + adds r0, 0xAE + strb r4, [r0] + adds r0, 0x1 + strb r4, [r0] + movs r6, 0 + ldr r0, _0807784C + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 + adds r0, r5, 0 + bl sub_8041C1C + adds r0, r5, 0 + bl sub_8070774 + b _0807785C + .align 2, 0 +_08077844: .4byte gUnknown_202DF98 +_08077848: .4byte gUnknown_80F4E50 +_0807784C: .4byte gUnknown_80FB2AC +_08077850: + ldr r0, _08077900 + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 +_0807785C: + adds r0, r5, 0 + movs r1, 0x19 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _080778EA + cmp r6, 0 + bne _080778EA + movs r3, 0 + mov r9, r3 + movs r6, 0 +_08077874: + movs r1, 0x4 + ldrsh r0, [r5, r1] + ldr r1, _08077904 + lsls r2, r6, 2 + adds r2, r1 + movs r3, 0 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r3, 0x6 + ldrsh r1, [r5, r3] + movs r3, 0x2 + ldrsh r2, [r2, r3] + adds r1, r2 + bl sub_804954C + ldr r4, [r0, 0x10] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080778E4 + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0x1 + bne _080778E4 + mov r0, r9 + cmp r0, 0 + bne _080778CA + movs r1, 0x1 + mov r9, r1 + ldr r0, _08077908 + mov r1, r8 + movs r2, 0 + bl sub_80708B4 + ldr r0, _0807790C + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80522F4 +_080778CA: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_807167C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _080778E4 + adds r0, r7, 0 + adds r1, r4, 0 + mov r2, r10 + bl sub_8077780 +_080778E4: + adds r6, 0x1 + cmp r6, 0x7 + ble _08077874 +_080778EA: + adds r0, r5, 0 + bl sub_80418D4 +_080778F0: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08077900: .4byte gUnknown_80FB2CC +_08077904: .4byte gUnknown_80F4448 +_08077908: .4byte gUnknown_202DF98 +_0807790C: .4byte gUnknown_80FF01C + thumb_func_end sub_8077780 + + thumb_func_start sub_8077910 +sub_8077910: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r8, r0 + adds r5, r1, 0 + adds r4, r2, 0 + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080779DE + cmp r4, 0 + bne _08077940 + ldr r1, _08077964 + adds r0, r5, 0 + movs r2, 0 + bl sub_808417C + adds r4, r0, 0x1 +_08077940: + ldr r6, [r5, 0x70] + ldr r0, _08077968 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r5, 0 + bl sub_8070774 + adds r7, r0, 0 + cmp r7, 0x4 + bne _08077970 + mov r0, r9 + cmp r0, 0 + beq _080779D8 + ldr r0, _0807796C + b _0807799E + .align 2, 0 +_08077964: .4byte gUnknown_80F4E40 +_08077968: .4byte gUnknown_202DF98 +_0807796C: .4byte gUnknown_80FC2B8 +_08077970: + movs r2, 0 + movs r0, 0x84 + lsls r0, 1 + adds r1, r6, r0 + b _08077988 +_0807797A: + adds r2, 0x1 + cmp r2, 0x4 + bgt _08077990 + movs r1, 0x84 + lsls r1, 1 + adds r0, r6, r1 + adds r1, r0, r2 +_08077988: + ldrb r0, [r1] + cmp r0, 0 + bne _0807797A + strb r4, [r1] +_08077990: + adds r0, r5, 0 + bl sub_8070774 + adds r4, r0, 0 + cmp r7, r4 + bne _080779B0 + ldr r0, _080779AC +_0807799E: + ldr r2, [r0] + mov r0, r8 + adds r1, r5, 0 + bl sub_80522F4 + b _080779D8 + .align 2, 0 +_080779AC: .4byte gUnknown_80FC298 +_080779B0: + adds r0, r5, 0 + bl sub_8041CB8 + ldr r1, _080779EC + lsls r0, r4, 2 + adds r0, r1 + ldr r2, [r0] + mov r0, r8 + adds r1, r5, 0 + bl sub_80522F4 + adds r1, r6, 0 + adds r1, 0xF8 + movs r2, 0 + movs r0, 0x1 + strb r0, [r1] + movs r1, 0xA4 + lsls r1, 1 + adds r0, r6, r1 + strb r2, [r0] +_080779D8: + adds r0, r5, 0 + bl sub_80418D4 +_080779DE: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080779EC: .4byte gUnknown_80FA124 + thumb_func_end sub_8077910 + + thumb_func_start sub_80779F0 +sub_80779F0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r10, r0 + adds r5, r1, 0 + mov r8, r2 + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08077AD0 + mov r0, r10 + adds r1, r5, 0 + mov r2, r9 + bl sub_80716E8 + lsls r0, 24 + cmp r0, 0 + bne _08077AD0 + ldr r7, [r5, 0x70] + ldr r0, _08077A48 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r5, 0 + bl sub_8070774 + str r0, [sp] + cmp r0, 0 + bne _08077A50 + mov r0, r9 + cmp r0, 0 + beq _08077ACA + ldr r0, _08077A4C + b _08077AA2 + .align 2, 0 +_08077A48: .4byte gUnknown_202DF98 +_08077A4C: .4byte gUnknown_80FC2D8 +_08077A50: + movs r0, 0 + cmp r0, r8 + bge _08077A8C +_08077A56: + movs r1, 0 + adds r6, r0, 0x1 +_08077A5A: + ldr r2, _08077A78 + adds r0, r7, r2 + adds r4, r0, r1 + ldrb r0, [r4] + cmp r0, 0 + bne _08077A80 + adds r0, r5, 0 + ldr r1, _08077A7C + movs r2, 0x1 + bl sub_808417C + adds r0, 0x1 + strb r0, [r4] + b _08077A86 + .align 2, 0 +_08077A78: .4byte 0x0000010d +_08077A7C: .4byte gUnknown_80F4E48 +_08077A80: + adds r1, 0x1 + cmp r1, 0x4 + ble _08077A5A +_08077A86: + adds r0, r6, 0 + cmp r0, r8 + blt _08077A56 +_08077A8C: + adds r0, r5, 0 + bl sub_8070774 + adds r4, r0, 0 + ldr r0, [sp] + cmp r0, r4 + bne _08077AB4 + mov r2, r9 + cmp r2, 0 + beq _08077ACA + ldr r0, _08077AB0 +_08077AA2: + ldr r2, [r0] + mov r0, r10 + adds r1, r5, 0 + bl sub_80522F4 + b _08077ACA + .align 2, 0 +_08077AB0: .4byte gUnknown_80FC298 +_08077AB4: + adds r0, r5, 0 + bl sub_8041CCC + ldr r0, _08077AE0 + lsls r1, r4, 2 + adds r1, r0 + ldr r2, [r1] + mov r0, r10 + adds r1, r5, 0 + bl sub_80522F4 +_08077ACA: + adds r0, r5, 0 + bl sub_80418D4 +_08077AD0: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08077AE0: .4byte gUnknown_80FA124 + thumb_func_end sub_80779F0 + + thumb_func_start sub_8077AE4 +sub_8077AE4: + push {r4-r7,lr} + adds r6, r0, 0 + adds r4, r1, 0 + lsls r2, 24 + lsrs r5, r2, 24 + adds r7, r5, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08077BAA + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_80716E8 + lsls r0, 24 + cmp r0, 0 + bne _08077BAA + ldr r0, _08077B2C + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r4, 0 + movs r1, 0x12 + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _08077B34 + cmp r5, 0 + beq _08077BAA + ldr r0, _08077B30 + b _08077B48 + .align 2, 0 +_08077B2C: .4byte gUnknown_202DF98 +_08077B30: .4byte gUnknown_80FD500 +_08077B34: + adds r0, r4, 0 + movs r1, 0x40 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _08077B58 + cmp r7, 0 + beq _08077BAA + ldr r0, _08077B54 +_08077B48: + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08077BAA + .align 2, 0 +_08077B54: .4byte gUnknown_80FCDB4 +_08077B58: + adds r0, r4, 0 + bl sub_8041BE8 + ldr r5, [r4, 0x70] + adds r1, r5, 0 + adds r1, 0xBC + ldrb r0, [r1] + cmp r0, 0x2 + beq _08077B98 + movs r0, 0x2 + strb r0, [r1] + ldr r1, _08077B90 + adds r0, r4, 0 + movs r2, 0x1 + bl sub_808417C + adds r0, 0x1 + adds r1, r5, 0 + adds r1, 0xBD + strb r0, [r1] + ldr r0, _08077B94 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08077BA4 + .align 2, 0 +_08077B90: .4byte gUnknown_80F4E4C +_08077B94: .4byte gUnknown_80FB25C +_08077B98: + ldr r0, _08077BB0 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08077BA4: + adds r0, r4, 0 + bl sub_80418D4 +_08077BAA: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08077BB0: .4byte gUnknown_80FB27C + thumb_func_end sub_8077AE4 + + thumb_func_start sub_8077BB4 +sub_8077BB4: + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + lsls r2, 24 + lsrs r5, r2, 24 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08077C3A + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_80716E8 + lsls r0, 24 + cmp r0, 0 + bne _08077C3A + ldr r5, [r4, 0x70] + ldr r0, _08077C1C + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r1, r5, 0 + adds r1, 0xBC + ldrb r0, [r1] + cmp r0, 0x4 + beq _08077C28 + movs r0, 0x4 + strb r0, [r1] + ldr r1, _08077C20 + adds r0, r4, 0 + movs r2, 0x1 + bl sub_808417C + adds r0, 0x1 + adds r1, r5, 0 + adds r1, 0xBD + strb r0, [r1] + adds r0, r4, 0 + bl sub_8041BF8 + ldr r0, _08077C24 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08077C34 + .align 2, 0 +_08077C1C: .4byte gUnknown_202DF98 +_08077C20: .4byte gUnknown_80F4ECC +_08077C24: .4byte gUnknown_80FB940 +_08077C28: + ldr r0, _08077C40 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08077C34: + adds r0, r4, 0 + bl sub_80418D4 +_08077C3A: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08077C40: .4byte gUnknown_80FB960 + thumb_func_end sub_8077BB4 + + thumb_func_start sub_8077C44 +sub_8077C44: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r9, r0 + adds r5, r1, 0 + mov r10, r2 + mov r8, r3 + ldr r0, [sp, 0x24] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08077C6E + b _08077DC8 +_08077C6E: + ldr r4, [r5, 0x70] + movs r0, 0x10 + ldrsh r7, [r4, r0] + movs r1, 0xE + ldrsh r6, [r4, r1] + ldrh r2, [r4, 0xE] + adds r0, r6, 0 + ldrh r1, [r4, 0x10] + mov r12, r1 + adds r1, r7, 0 + cmp r0, r1 + bne _08077C8C + mov r0, r8 + cmp r0, 0 + bgt _08077C92 +_08077C8C: + mov r3, r10 + cmp r3, 0 + bne _08077CD0 +_08077C92: + ldrh r1, [r4, 0x10] + add r1, r8 + strh r1, [r4, 0x10] + ldrh r0, [r4, 0xE] + add r0, r8 + strh r0, [r4, 0xE] + lsls r1, 16 + asrs r1, 16 + ldr r0, _08077CCC + cmp r1, r0 + ble _08077CAA + strh r0, [r4, 0x10] +_08077CAA: + movs r1, 0xE + ldrsh r0, [r4, r1] + movs r3, 0x10 + ldrsh r2, [r4, r3] + ldrh r1, [r4, 0x10] + cmp r0, r2 + ble _08077CBA + strh r1, [r4, 0xE] +_08077CBA: + movs r1, 0xE + ldrsh r0, [r4, r1] + cmp r0, r2 + bne _08077CC4 + adds r6, r0, 0 +_08077CC4: + adds r0, r5, 0 + bl sub_8041C94 + b _08077CE8 + .align 2, 0 +_08077CCC: .4byte 0x000003e7 +_08077CD0: + mov r3, r10 + adds r0, r2, r3 + strh r0, [r4, 0xE] + lsls r0, 16 + asrs r0, 16 + cmp r0, r1 + ble _08077CE2 + mov r0, r12 + strh r0, [r4, 0xE] +_08077CE2: + adds r0, r5, 0 + bl sub_8041CA8 +_08077CE8: + movs r1, 0x10 + ldrsh r0, [r4, r1] + subs r7, r0, r7 + movs r2, 0xE + ldrsh r0, [r4, r2] + subs r6, r0, r6 + adds r0, r5, 0 + bl sub_80418D4 + ldr r0, _08077D1C + str r6, [r0] + str r7, [r0, 0x4] + ldr r0, _08077D20 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + cmp r6, 0 + bne _08077D28 + cmp r7, 0 + bne _08077D28 + ldr r3, [sp] + cmp r3, 0 + beq _08077DC8 + ldr r0, _08077D24 + b _08077D3A + .align 2, 0 +_08077D1C: .4byte gUnknown_202DE30 +_08077D20: .4byte gUnknown_202DF98 +_08077D24: .4byte gUnknown_80FB204 +_08077D28: + mov r0, r8 + cmp r0, 0 + bne _08077D4C + cmp r6, 0 + bne _08077D4C + ldr r1, [sp] + cmp r1, 0 + beq _08077DC8 + ldr r0, _08077D48 +_08077D3A: + ldr r2, [r0] + mov r0, r9 + adds r1, r5, 0 + bl sub_80522F4 + b _08077DC8 + .align 2, 0 +_08077D48: .4byte gUnknown_80FB21C +_08077D4C: + movs r2, 0 + mov r8, r2 + cmp r7, 0 + beq _08077D6E + adds r0, r5, 0 + bl sub_8045888 + lsls r0, 24 + cmp r0, 0 + beq _08077D62 + mov r8, r7 +_08077D62: + ldr r0, _08077DA0 + ldr r2, [r0] + mov r0, r9 + adds r1, r5, 0 + bl sub_80522F4 +_08077D6E: + cmp r6, 0 + beq _08077DB4 + adds r0, r5, 0 + bl sub_8045888 + lsls r0, 24 + cmp r0, 0 + beq _08077D80 + mov r8, r6 +_08077D80: + mov r3, r10 + cmp r3, 0 + beq _08077DB4 + movs r0, 0x10 + ldrsh r1, [r4, r0] + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r1, r0 + bne _08077DA8 + ldr r0, _08077DA4 + ldr r2, [r0] + mov r0, r9 + adds r1, r5, 0 + bl sub_80522F4 + b _08077DB4 + .align 2, 0 +_08077DA0: .4byte gUnknown_80FB240 +_08077DA4: .4byte gUnknown_80FB1E0 +_08077DA8: + ldr r0, _08077DD8 + ldr r2, [r0] + mov r0, r9 + adds r1, r5, 0 + bl sub_80522F4 +_08077DB4: + mov r3, r8 + cmp r3, 0 + beq _08077DC8 + movs r3, 0x1 + negs r3, r3 + mov r0, r8 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_803ED30 +_08077DC8: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08077DD8: .4byte gUnknown_80FB1C4 + thumb_func_end sub_8077C44 + + thumb_func_start sub_8077DDC +sub_8077DDC: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08077E3C + ldr r0, [r4, 0x70] + adds r1, r0, 0 + adds r1, 0xF1 + ldrb r0, [r1] + cmp r0, 0 + beq _08077E0C + ldr r0, _08077E08 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08077E3C + .align 2, 0 +_08077E08: .4byte gUnknown_80FAEF0 +_08077E0C: + movs r0, 0x1 + strb r0, [r1] + adds r0, r4, 0 + bl nullsub_75 + ldr r0, _08077E44 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08077E48 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 + movs r0, 0 + bl sub_803F580 + bl sub_8040A84 + adds r0, r4, 0 + bl sub_80418D4 +_08077E3C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08077E44: .4byte gUnknown_202DF98 +_08077E48: .4byte gUnknown_80FAEA0 + thumb_func_end sub_8077DDC + + thumb_func_start sub_8077E4C +sub_8077E4C: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08077EC0 + bl sub_8043D10 + lsls r0, 24 + cmp r0, 0 + beq _08077E70 + ldr r0, _08077E6C + b _08077E7E + .align 2, 0 +_08077E6C: .4byte gUnknown_80FAF3C +_08077E70: + ldr r0, [r4, 0x70] + adds r1, r0, 0 + adds r1, 0xF2 + ldrb r0, [r1] + cmp r0, 0 + beq _08077E90 + ldr r0, _08077E8C +_08077E7E: + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08077EC0 + .align 2, 0 +_08077E8C: .4byte gUnknown_80FAF1C +_08077E90: + movs r0, 0x1 + strb r0, [r1] + adds r0, r4, 0 + bl nullsub_76 + ldr r0, _08077EC8 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08077ECC + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 + movs r0, 0 + bl sub_803F580 + bl sub_8040A84 + adds r0, r4, 0 + bl sub_80418D4 +_08077EC0: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08077EC8: .4byte gUnknown_202DF98 +_08077ECC: .4byte gUnknown_80FAEC8 + thumb_func_end sub_8077E4C + + thumb_func_start sub_8077ED0 +sub_8077ED0: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08077F30 + ldr r0, [r4, 0x70] + adds r1, r0, 0 + adds r1, 0xF0 + ldrb r0, [r1] + cmp r0, 0 + beq _08077F00 + ldr r0, _08077EFC + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08077F30 + .align 2, 0 +_08077EFC: .4byte gUnknown_80FAFD0 +_08077F00: + movs r0, 0x1 + strb r0, [r1] + adds r0, r4, 0 + bl nullsub_77 + ldr r0, _08077F38 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08077F3C + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 + movs r0, 0 + bl sub_803F580 + bl sub_8040A84 + adds r0, r4, 0 + bl sub_80418D4 +_08077F30: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08077F38: .4byte gUnknown_202DF98 +_08077F3C: .4byte gUnknown_80FAFAC + thumb_func_end sub_8077ED0 + + thumb_func_start sub_8077F40 +sub_8077F40: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r5, r0, 0 + adds r4, r1, 0 + lsls r2, 24 + lsrs r6, r2, 24 + mov r9, r6 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08077F62 + b _08078068 +_08077F62: + adds r0, r5, 0 + bl sub_80450F8 + mov r10, r0 + cmp r0, 0x1 + beq _08077F70 + b _08078068 +_08077F70: + ldr r7, [r4, 0x70] + cmp r5, r4 + bne _08077F88 + cmp r6, 0 + beq _08078068 + ldr r0, _08077F84 + ldr r2, [r0] + adds r0, r4, 0 + b _08078022 + .align 2, 0 +_08077F84: .4byte gUnknown_8100610 +_08077F88: + adds r0, r5, 0 + adds r1, r4, 0 + mov r2, r9 + bl sub_80716E8 + lsls r0, 24 + cmp r0, 0 + bne _08078068 + ldr r0, _08077FC0 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r4, 0 + movs r1, 0x4 + bl sub_8071858 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + cmp r0, 0 + beq _08077FC8 + mov r0, r9 + cmp r0, 0 + beq _08078068 + ldr r0, _08077FC4 + b _0807801E + .align 2, 0 +_08077FC0: .4byte gUnknown_202DF98 +_08077FC4: .4byte gUnknown_8100640 +_08077FC8: + adds r6, r7, 0 + adds r6, 0xD0 + ldrb r0, [r6] + cmp r0, 0x1 + beq _0807801C + cmp r0, 0x2 + bne _08077FE2 + ldr r0, _08078014 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08077FE2: + mov r1, r10 + strb r1, [r6] + ldr r1, _08078018 + adds r0, r4, 0 + movs r2, 0x1 + bl sub_808417C + adds r0, 0x1 + adds r1, r7, 0 + adds r1, 0xD9 + strb r0, [r1] + adds r0, r7, 0 + adds r0, 0xDA + mov r6, r8 + strb r6, [r0] + adds r0, r4, 0 + bl nullsub_78 + adds r1, r7, 0 + adds r1, 0xD8 + movs r0, 0xFF + strb r0, [r1] + movs r2, 0 + adds r3, r1, 0 + b _08078030 + .align 2, 0 +_08078014: .4byte gUnknown_80FAA8C +_08078018: .4byte gUnknown_80F4EB0 +_0807801C: + ldr r0, _0807802C +_0807801E: + ldr r2, [r0] + adds r0, r5, 0 +_08078022: + adds r1, r4, 0 + bl sub_80522F4 + b _08078068 + .align 2, 0 +_0807802C: .4byte gUnknown_80FAE7C +_08078030: + ldr r0, _08078078 + ldr r0, [r0] + lsls r1, r2, 2 + ldr r6, _0807807C + adds r0, r6 + adds r0, r1 + ldr r0, [r0] + cmp r5, r0 + bne _08078050 + strb r2, [r3] + ldr r0, [r5, 0x70] + adds r1, r7, 0 + adds r1, 0xD4 + adds r0, 0x98 + ldr r0, [r0] + str r0, [r1] +_08078050: + adds r2, 0x1 + cmp r2, 0x13 + ble _08078030 + ldr r0, _08078080 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 + adds r0, r4, 0 + bl sub_80418D4 +_08078068: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08078078: .4byte gUnknown_203B418 +_0807807C: .4byte 0x000135cc +_08078080: .4byte gUnknown_80FAE58 + thumb_func_end sub_8077F40 + + thumb_func_start sub_8078084 +sub_8078084: + push {r4-r6,lr} + ldr r6, [r0, 0x70] + movs r5, 0 +_0807808A: + ldr r0, _080780DC + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _080780E0 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080780D0 + ldr r1, [r4, 0x70] + adds r3, r1, 0 + adds r3, 0xD0 + ldrb r0, [r3] + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _080780D0 + adds r0, r1, 0 + adds r0, 0xD4 + adds r1, r6, 0 + adds r1, 0x98 + ldr r2, [r0] + ldr r0, [r1] + cmp r2, r0 + bne _080780D0 + movs r0, 0 + strb r0, [r3] + adds r0, r4, 0 + bl sub_80418D4 +_080780D0: + adds r5, 0x1 + cmp r5, 0x13 + ble _0807808A + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080780DC: .4byte gUnknown_203B418 +_080780E0: .4byte 0x000135cc + thumb_func_end sub_8078084 + + thumb_func_start sub_80780E4 +sub_80780E4: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080781C4 + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0x1 + bne _080781C4 + adds r0, r5, 0 + bl sub_80450F8 + cmp r0, 0x1 + bne _080781C4 + ldr r6, [r4, 0x70] + ldr r0, _0807816C + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r7, r6, 0 + adds r7, 0xD0 + ldrb r0, [r7] + cmp r0, 0x2 + beq _08078178 + cmp r0, 0x1 + bne _08078134 + ldr r0, _08078170 + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80522F4 +_08078134: + movs r0, 0 + mov r8, r0 + movs r0, 0x2 + strb r0, [r7] + ldr r1, _08078174 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_808417C + adds r0, 0x1 + adds r1, r6, 0 + adds r1, 0xD9 + strb r0, [r1] + adds r0, r6, 0 + adds r0, 0xDA + mov r1, r8 + strb r1, [r0] + adds r0, r5, 0 + bl nullsub_74 + adds r1, r6, 0 + adds r1, 0xD8 + movs r0, 0xFF + strb r0, [r1] + movs r2, 0 + adds r3, r1, 0 + b _0807818C + .align 2, 0 +_0807816C: .4byte gUnknown_202DF98 +_08078170: .4byte gUnknown_80FA79C +_08078174: .4byte gUnknown_80F4EF0 +_08078178: + ldr r0, _08078188 + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80522F4 + b _080781C4 + .align 2, 0 +_08078188: .4byte gUnknown_80FBB78 +_0807818C: + ldr r0, _080781D0 + ldr r0, [r0] + lsls r1, r2, 2 + ldr r7, _080781D4 + adds r0, r7 + adds r0, r1 + ldr r0, [r0] + cmp r5, r0 + bne _080781AC + strb r2, [r3] + ldr r0, [r5, 0x70] + adds r1, r6, 0 + adds r1, 0xD4 + adds r0, 0x98 + ldr r0, [r0] + str r0, [r1] +_080781AC: + adds r2, 0x1 + cmp r2, 0x13 + ble _0807818C + ldr r0, _080781D8 + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80522F4 + adds r0, r5, 0 + bl sub_80418D4 +_080781C4: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080781D0: .4byte gUnknown_203B418 +_080781D4: .4byte 0x000135cc +_080781D8: .4byte gUnknown_80FBB4C + thumb_func_end sub_80780E4 + + thumb_func_start sub_80781DC +sub_80781DC: + push {r4-r7,lr} + adds r7, r0, 0 + adds r4, r1, 0 + adds r6, r2, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08078242 + ldr r5, [r4, 0x70] + ldr r0, _08078228 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r1, r5, 0 + adds r1, 0xDC + ldrb r0, [r1] + cmp r0, 0x1 + beq _08078230 + movs r0, 0x1 + strb r0, [r1] + adds r1, r6, 0x1 + adds r0, r5, 0 + adds r0, 0xDD + strb r1, [r0] + adds r0, r4, 0 + bl sub_8041CDC + ldr r0, _0807822C + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _0807823C + .align 2, 0 +_08078228: .4byte gUnknown_202DF98 +_0807822C: .4byte gUnknown_80FB73C +_08078230: + ldr r0, _08078248 + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r4, 0 + bl sub_80522F4 +_0807823C: + adds r0, r4, 0 + bl sub_80418D4 +_08078242: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08078248: .4byte gUnknown_80FB764 + thumb_func_end sub_80781DC + + thumb_func_start sub_807824C +sub_807824C: + push {r4-r7,lr} + adds r6, r0, 0 + adds r4, r1, 0 + adds r7, r2, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080782C2 + adds r0, r6, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_80716E8 + lsls r0, 24 + cmp r0, 0 + bne _080782C2 + ldr r5, [r4, 0x70] + ldr r0, _080782A8 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r1, r5, 0 + adds r1, 0xDC + ldrb r0, [r1] + cmp r0, 0x2 + beq _080782B0 + movs r0, 0x2 + strb r0, [r1] + adds r1, r7, 0x1 + adds r0, r5, 0 + adds r0, 0xDD + strb r1, [r0] + adds r0, r4, 0 + bl sub_8041CEC + ldr r0, _080782AC + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _080782BC + .align 2, 0 +_080782A8: .4byte gUnknown_202DF98 +_080782AC: .4byte gUnknown_80FB780 +_080782B0: + ldr r0, _080782C8 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_080782BC: + adds r0, r4, 0 + bl sub_80418D4 +_080782C2: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080782C8: .4byte gUnknown_80FB7A0 + thumb_func_end sub_807824C + + thumb_func_start sub_80782CC +sub_80782CC: + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807833E + ldr r5, [r4, 0x70] + ldr r0, _08078320 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r1, r5, 0 + adds r1, 0xDC + ldrb r0, [r1] + cmp r0, 0x3 + beq _0807832C + movs r0, 0x3 + strb r0, [r1] + ldr r1, _08078324 + adds r0, r4, 0 + movs r2, 0 + bl sub_808417C + adds r0, 0x1 + adds r1, r5, 0 + adds r1, 0xDD + strb r0, [r1] + adds r0, r4, 0 + bl nullsub_79 + ldr r0, _08078328 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08078338 + .align 2, 0 +_08078320: .4byte gUnknown_202DF98 +_08078324: .4byte gUnknown_80F4EC4 +_08078328: .4byte gUnknown_80FB8BC +_0807832C: + ldr r0, _08078344 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08078338: + adds r0, r4, 0 + bl sub_80418D4 +_0807833E: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08078344: .4byte gUnknown_80FB8E4 + thumb_func_end sub_80782CC + + thumb_func_start sub_8078348 +sub_8078348: + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080783BA + ldr r5, [r4, 0x70] + ldr r0, _0807839C + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r1, r5, 0 + adds r1, 0xDC + ldrb r0, [r1] + cmp r0, 0x4 + beq _080783A8 + movs r0, 0x4 + strb r0, [r1] + ldr r1, _080783A0 + adds r0, r4, 0 + movs r2, 0 + bl sub_808417C + adds r0, 0x1 + adds r1, r5, 0 + adds r1, 0xDD + strb r0, [r1] + adds r0, r4, 0 + bl nullsub_80 + ldr r0, _080783A4 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _080783B4 + .align 2, 0 +_0807839C: .4byte gUnknown_202DF98 +_080783A0: .4byte gUnknown_80F4EC8 +_080783A4: .4byte gUnknown_80FB900 +_080783A8: + ldr r0, _080783C0 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_080783B4: + adds r0, r4, 0 + bl sub_80418D4 +_080783BA: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080783C0: .4byte gUnknown_80FB924 + thumb_func_end sub_8078348 + + thumb_func_start sub_80783C4 +sub_80783C4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + adds r5, r0, 0 + adds r7, r1, 0 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x18] + adds r0, r7, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _080783E8 + b _0807856A +_080783E8: + adds r0, r5, 0 + adds r1, r7, 0 + movs r2, 0x1 + bl sub_80716E8 + lsls r0, 24 + cmp r0, 0 + beq _080783FA + b _0807856A +_080783FA: + ldr r4, [r7, 0x70] + ldr r0, _08078420 + adds r1, r7, 0 + movs r2, 0 + bl sub_8045B94 + adds r1, r4, 0 + adds r1, 0xC8 + ldrb r0, [r1] + cmp r0, 0x2 + bne _08078428 + ldr r0, _08078424 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r7, 0 + bl sub_80522F4 + b _0807856A + .align 2, 0 +_08078420: .4byte gUnknown_202DF98 +_08078424: .4byte gUnknown_80FB994 +_08078428: + movs r6, 0 + mov r8, r1 + movs r0, 0xC9 + adds r0, r4 + mov r9, r0 + movs r1, 0xCA + adds r1, r4 + mov r10, r1 + adds r2, r4, 0 + adds r2, 0xCB + str r2, [sp, 0x1C] + adds r4, 0xCC + str r4, [sp, 0x20] +_08078442: + ldr r0, _0807857C + ldr r0, [r0] + lsls r1, r6, 2 + ldr r3, _08078580 + adds r0, r3 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08078480 + cmp r7, r4 + beq _08078480 + ldr r0, [r4, 0x70] + adds r0, 0xC8 + ldrb r0, [r0] + subs r0, 0x2 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _08078480 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_807A5D0 + movs r0, 0x2A + bl sub_803E46C +_08078480: + adds r6, 0x1 + cmp r6, 0x13 + ble _08078442 + adds r0, r7, 0 + bl sub_8041D38 + ldr r0, _08078584 + adds r1, r7, 0 + movs r2, 0 + bl sub_8045B94 + mov r4, r8 + ldrb r0, [r4] + cmp r0, 0 + beq _080784A8 + adds r0, r5, 0 + adds r1, r7, 0 + movs r2, 0x2 + bl sub_807A5D0 +_080784A8: + movs r4, 0 + movs r0, 0x2 + mov r1, r8 + strb r0, [r1] + ldr r0, [r5, 0x70] + ldrb r0, [r0, 0x6] + mov r2, r9 + strb r0, [r2] + mov r3, sp + ldrb r0, [r3, 0x18] + mov r3, r10 + strb r0, [r3] + ldr r1, _08078588 + adds r0, r7, 0 + movs r2, 0x1 + bl sub_808417C + adds r0, 0x1 + ldr r1, [sp, 0x1C] + strb r0, [r1] + ldr r2, [sp, 0x20] + strb r4, [r2] + adds r0, r7, 0 + bl sub_806CEBC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r7, 0 + bl sub_806CCB4 + ldr r0, _0807857C + ldr r0, [r0] + ldr r3, _0807858C + adds r0, r3 + movs r1, 0x1 + strb r1, [r0] + ldr r0, _08078590 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r7, 0 + bl sub_80522F4 + movs r6, 0 + mov r8, r6 +_08078502: + ldr r0, _0807857C + ldr r0, [r0] + lsls r1, r6, 2 + ldr r4, _08078580 + adds r0, r4 + adds r0, r1 + ldr r0, [r0] + mov r9, r0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807855E + mov r5, r9 + ldr r4, [r5, 0x70] + adds r1, r4, 0 + adds r1, 0x78 + movs r0, 0x6 + strb r0, [r1] + adds r0, r4, 0 + adds r0, 0x80 + mov r1, r8 + str r1, [r0] + subs r0, 0x4 + strh r1, [r0] + ldrb r0, [r4, 0x7] + cmp r0, 0 + bne _0807855E + mov r1, sp + adds r0, r4, 0 + adds r0, 0x44 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + mov r0, r9 + movs r1, 0x1 + bl sub_807ADB8 + adds r1, r4, 0 + adds r1, 0x44 + mov r0, sp + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} +_0807855E: + adds r6, 0x1 + cmp r6, 0x13 + ble _08078502 + adds r0, r7, 0 + bl sub_80418D4 +_0807856A: + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0807857C: .4byte gUnknown_203B418 +_08078580: .4byte 0x000135cc +_08078584: .4byte gUnknown_202DF98 +_08078588: .4byte gUnknown_80F4ED0 +_0807858C: .4byte 0x000037fc +_08078590: .4byte gUnknown_80FB978 + thumb_func_end sub_80783C4 + + thumb_func_start sub_8078594 +sub_8078594: + push {r4-r7,lr} + adds r5, r0, 0 + adds r6, r1, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807866E + adds r0, r6, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807866E + ldr r4, [r5, 0x70] + ldr r7, [r6, 0x70] + adds r0, r5, 0 + movs r1, 0xE + bl sub_8071858 + lsls r0, 24 + cmp r0, 0 + beq _08078640 + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0x1 + bl sub_80716E8 + lsls r0, 24 + cmp r0, 0 + bne _0807866E + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0x1 + bl sub_807A5D0 + adds r0, r6, 0 + bl sub_8041D48 + movs r1, 0xE + ldrsh r0, [r4, r1] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + strh r0, [r4, 0xE] + cmp r0, 0 + bne _080785F6 + movs r0, 0x1 + strh r0, [r4, 0xE] +_080785F6: + adds r1, r7, 0 + adds r1, 0xC8 + ldrb r0, [r1] + cmp r0, 0x1 + beq _0807861C + movs r0, 0x1 + strb r0, [r1] + ldr r1, _08078634 + adds r0, r6, 0 + movs r2, 0x1 + bl sub_808417C + adds r0, 0x1 + adds r1, r7, 0 + adds r1, 0xCB + strb r0, [r1] + adds r1, 0x1 + movs r0, 0 + strb r0, [r1] +_0807861C: + ldr r0, _08078638 + adds r1, r6, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _0807863C + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_80522F4 + b _08078668 + .align 2, 0 +_08078634: .4byte gUnknown_80F4EA4 +_08078638: .4byte gUnknown_202DF98 +_0807863C: .4byte gUnknown_80FB004 +_08078640: + ldr r0, _08078674 + ldr r4, [r0] + adds r0, r5, 0 + adds r1, r5, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8077084 + adds r0, r5, 0 + adds r1, r5, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8077160 + adds r0, r5, 0 + adds r1, r5, 0 + movs r2, 0x1 + movs r3, 0x1 + bl sub_80779F0 +_08078668: + adds r0, r6, 0 + bl sub_80418D4 +_0807866E: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08078674: .4byte gUnknown_8106A4C + thumb_func_end sub_8078594 + + thumb_func_start sub_8078678 +sub_8078678: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + adds r6, r1, 0 + adds r0, r6, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08078732 + adds r0, r7, 0 + adds r1, r6, 0 + movs r2, 0x3 + bl sub_807A5D0 + movs r5, 0 +_0807869A: + ldr r0, _0807873C + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _08078740 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080786C8 + ldr r0, [r4, 0x70] + adds r0, 0xC8 + ldrb r0, [r0] + cmp r0, 0x3 + bne _080786C8 + adds r0, r7, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_807A5D0 +_080786C8: + adds r5, 0x1 + cmp r5, 0x13 + ble _0807869A + adds r0, r6, 0 + bl nullsub_81 + ldr r5, [r6, 0x70] + mov r8, r5 + adds r1, r5, 0 + adds r1, 0xC8 + ldrb r0, [r1] + cmp r0, 0x3 + beq _08078700 + movs r4, 0 + movs r0, 0x3 + strb r0, [r1] + ldr r1, _08078744 + adds r0, r6, 0 + movs r2, 0 + bl sub_808417C + adds r0, 0x1 + adds r1, r5, 0 + adds r1, 0xCB + strb r0, [r1] + adds r0, r5, 0 + adds r0, 0xCC + strb r4, [r0] +_08078700: + ldr r0, _0807873C + ldr r1, [r0] + ldr r2, _08078748 + adds r0, r1, r2 + str r6, [r0] + ldr r0, _0807874C + adds r1, r0 + mov r0, r8 + adds r0, 0x98 + ldr r0, [r0] + str r0, [r1] + ldr r0, _08078750 + adds r1, r6, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08078754 + ldr r2, [r0] + adds r0, r7, 0 + adds r1, r6, 0 + bl sub_80522F4 + adds r0, r6, 0 + bl sub_80418D4 +_08078732: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0807873C: .4byte gUnknown_203B418 +_08078740: .4byte 0x000135cc +_08078744: .4byte gUnknown_80F4EA8 +_08078748: .4byte 0x00017b30 +_0807874C: .4byte 0x00017b3c +_08078750: .4byte gUnknown_202DF98 +_08078754: .4byte gUnknown_80FB01C + thumb_func_end sub_8078678 + + thumb_func_start sub_8078758 +sub_8078758: + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080787DA + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_80716E8 + lsls r0, 24 + cmp r0, 0 + bne _080787DA + ldr r6, [r4, 0x70] + ldr r0, _080787BC + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r1, r6, 0 + adds r1, 0xBC + ldrb r0, [r1] + cmp r0, 0x5 + beq _080787C8 + movs r0, 0x5 + strb r0, [r1] + ldr r1, _080787C0 + adds r0, r4, 0 + movs r2, 0x1 + bl sub_808417C + adds r0, 0x1 + adds r1, r6, 0 + adds r1, 0xBD + strb r0, [r1] + adds r0, r4, 0 + bl nullsub_73 + ldr r0, _080787C4 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _080787D4 + .align 2, 0 +_080787BC: .4byte gUnknown_202DF98 +_080787C0: .4byte gUnknown_80F4ED8 +_080787C4: .4byte gUnknown_80FB9F0 +_080787C8: + ldr r0, _080787E0 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 +_080787D4: + adds r0, r4, 0 + bl sub_80418D4 +_080787DA: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080787E0: .4byte gUnknown_80FBA14 + thumb_func_end sub_8078758 + + thumb_func_start sub_80787E4 +sub_80787E4: + push {r4-r6,lr} + adds r6, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08078852 + ldr r4, [r5, 0x70] + ldr r0, _08078834 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + movs r0, 0x89 + lsls r0, 1 + adds r4, r0 + ldrb r0, [r4] + cmp r0, 0x2 + bhi _08078840 + adds r0, 0x1 + strb r0, [r4] + movs r0, 0x1 + bl sub_804178C + adds r0, r5, 0 + bl sub_8041D5C + ldr r1, _08078838 + ldrb r0, [r4] + str r0, [r1] + ldr r0, _0807883C + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80522F4 + b _0807884C + .align 2, 0 +_08078834: .4byte gUnknown_202DF98 +_08078838: .4byte gUnknown_202DE30 +_0807883C: .4byte gUnknown_80FBA38 +_08078840: + ldr r0, _08078858 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80522F4 +_0807884C: + adds r0, r5, 0 + bl sub_80418D4 +_08078852: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08078858: .4byte gUnknown_80FBA60 + thumb_func_end sub_80787E4 + + thumb_func_start sub_807885C +sub_807885C: + push {r4-r7,lr} + adds r6, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080788DE + ldr r0, [r4, 0x70] + adds r7, r0, 0 + adds r5, r7, 0 + adds r5, 0xE4 + ldrb r0, [r5] + cmp r0, 0x2 + bne _08078884 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_807A7C8 +_08078884: + ldr r0, _080788C0 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldrb r0, [r5] + cmp r0, 0x1 + beq _080788CC + movs r0, 0x1 + strb r0, [r5] + ldr r1, _080788C4 + adds r0, r4, 0 + movs r2, 0 + bl sub_808417C + adds r0, 0x1 + adds r1, r7, 0 + adds r1, 0xE5 + strb r0, [r1] + adds r0, r4, 0 + bl sub_8041D84 + ldr r0, _080788C8 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _080788D8 + .align 2, 0 +_080788C0: .4byte gUnknown_202DF98 +_080788C4: .4byte gUnknown_80F4EE4 +_080788C8: .4byte gUnknown_80FBA80 +_080788CC: + ldr r0, _080788E4 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_080788D8: + adds r0, r4, 0 + bl sub_80418D4 +_080788DE: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080788E4: .4byte gUnknown_80FBAA0 + thumb_func_end sub_807885C + + thumb_func_start sub_80788E8 +sub_80788E8: + push {r4-r6,lr} + adds r6, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807895E + adds r0, r6, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_80716E8 + lsls r0, 24 + cmp r0, 0 + bne _0807895E + adds r0, r5, 0 + bl nullsub_82 + ldr r4, [r5, 0x70] + ldr r0, _08078940 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + adds r4, 0xFD + ldrb r0, [r4] + cmp r0, 0 + bne _0807894C + ldr r1, _08078944 + adds r0, r5, 0 + movs r2, 0 + bl sub_808417C + adds r0, 0x1 + strb r0, [r4] + ldr r0, _08078948 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80522F4 + b _08078958 + .align 2, 0 +_08078940: .4byte gUnknown_202DF98 +_08078944: .4byte gUnknown_80F4EEC +_08078948: .4byte gUnknown_80FBB04 +_0807894C: + ldr r0, _08078964 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80522F4 +_08078958: + adds r0, r5, 0 + bl sub_80418D4 +_0807895E: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08078964: .4byte gUnknown_80FBB28 + thumb_func_end sub_80788E8 + + thumb_func_start sub_8078968 +sub_8078968: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + adds r4, r1, 0 + ldr r5, [r4, 0x70] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08078A4A + adds r0, r6, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_80716E8 + lsls r0, 24 + cmp r0, 0 + bne _08078A4A + movs r3, 0 + ldr r0, _080789E8 + mov r8, r0 + movs r1, 0x1 + mov r12, r1 + movs r0, 0x8C + lsls r0, 1 + adds r2, r5, r0 + movs r7, 0x10 +_080789A2: + ldrb r1, [r2] + mov r0, r12 + ands r0, r1 + cmp r0, 0 + beq _080789B4 + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + bne _080789BC +_080789B4: + adds r2, 0x8 + adds r3, 0x1 + cmp r3, 0x3 + ble _080789A2 +_080789BC: + cmp r3, 0x4 + bne _080789F0 + movs r1, 0x9C + lsls r1, 1 + adds r0, r5, r1 + ldrb r1, [r0] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _080789F0 + mov r0, r8 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _080789EC + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08078A4A + .align 2, 0 +_080789E8: .4byte gUnknown_202DF98 +_080789EC: .4byte gUnknown_80FBBD4 +_080789F0: + mov r0, r8 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r1, r5, 0 + adds r1, 0xBC + ldrb r0, [r1] + cmp r0, 0x6 + beq _08078A38 + movs r0, 0x6 + strb r0, [r1] + ldr r1, _08078A30 + adds r0, r4, 0 + movs r2, 0x1 + bl sub_808417C + adds r0, 0x1 + adds r1, r5, 0 + adds r1, 0xBD + strb r0, [r1] + adds r0, r4, 0 + bl nullsub_83 + ldr r0, _08078A34 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08078A44 + .align 2, 0 +_08078A30: .4byte gUnknown_80F4EF4 +_08078A34: .4byte gUnknown_80FBB94 +_08078A38: + ldr r0, _08078A54 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08078A44: + adds r0, r4, 0 + bl sub_80418D4 +_08078A4A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08078A54: .4byte gUnknown_80FBBB8 + thumb_func_end sub_8078968 + + thumb_func_start sub_8078A58 +sub_8078A58: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + mov r8, r0 + adds r6, r1, 0 + adds r7, r2, 0 + adds r5, r3, 0 + adds r0, r6, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08078B4A + ldr r4, [r6, 0x70] + cmp r5, 0 + beq _08078AE0 + mov r0, sp + adds r1, r5, 0 + bl sub_80943A0 + ldr r2, [sp] + movs r0, 0xA0 + lsls r0, 1 + adds r5, r4, r0 + ldr r7, [r5] + add r0, sp, 0x4 + adds r1, r7, 0 + bl sub_80942C0 + ldr r2, [sp, 0x4] + str r2, [r5] + movs r0, 0x9E + lsls r0, 1 + adds r4, r0 + ldr r1, [r4] + add r0, sp, 0x8 + bl sub_8094318 + ldr r0, [sp, 0x8] + str r0, [r4] + ldr r0, _08078AD0 + adds r1, r6, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r7, 0 + bl sub_8094450 + adds r4, r0, 0 + ldr r0, [r5] + bl sub_8094450 + cmp r4, r0 + beq _08078AD8 + adds r0, r6, 0 + bl sub_8041D9C + ldr r0, _08078AD4 + b _08078B22 + .align 2, 0 +_08078AD0: .4byte gUnknown_202DF98 +_08078AD4: .4byte gUnknown_80FBD9C +_08078AD8: + ldr r0, _08078ADC + b _08078B22 + .align 2, 0 +_08078ADC: .4byte gUnknown_80FBE3C +_08078AE0: + add r0, sp, 0xC + adds r1, r7, 0 + bl sub_80943A0 + ldr r2, [sp, 0xC] + movs r0, 0x9E + lsls r0, 1 + adds r4, r0 + ldr r7, [r4] + add r0, sp, 0x10 + adds r1, r7, 0 + bl sub_80942C0 + ldr r0, [sp, 0x10] + str r0, [r4] + ldr r0, _08078B30 + adds r1, r6, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r7, 0 + bl sub_8094450 + adds r5, r0, 0 + ldr r0, [r4] + bl sub_8094450 + cmp r5, r0 + beq _08078B38 + adds r0, r6, 0 + bl nullsub_84 + ldr r0, _08078B34 +_08078B22: + ldr r2, [r0] + mov r0, r8 + adds r1, r6, 0 + bl sub_80522F4 + b _08078B44 + .align 2, 0 +_08078B30: .4byte gUnknown_202DF98 +_08078B34: .4byte gUnknown_80FBD78 +_08078B38: + ldr r0, _08078B58 + ldr r2, [r0] + mov r0, r8 + adds r1, r6, 0 + bl sub_80522F4 +_08078B44: + adds r0, r6, 0 + bl sub_80418D4 +_08078B4A: + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08078B58: .4byte gUnknown_80FBE40 + thumb_func_end sub_8078A58 + + thumb_func_start sub_8078B5C +sub_8078B5C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + mov r9, r0 + adds r6, r1, 0 + mov r10, r2 + str r3, [sp, 0x1C] + ldr r0, [sp, 0x48] + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + adds r0, r6, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08078B86 + b _08078D78 +_08078B86: + ldr r7, [r6, 0x70] + ldrb r0, [r7, 0x7] + cmp r0, 0 + bne _08078BB8 + adds r0, r6, 0 + movs r1, 0x1B + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _08078BB8 + mov r0, r8 + cmp r0, 0 + bne _08078BA4 + b _08078D78 +_08078BA4: + ldr r0, _08078BB4 + ldr r2, [r0] + mov r0, r9 + adds r1, r6, 0 + bl sub_80522F4 + b _08078D78 + .align 2, 0 +_08078BB4: .4byte gUnknown_80FBEA0 +_08078BB8: + movs r5, 0 + ldr r1, [sp, 0x1C] + cmp r1, 0 + beq _08078BE8 + movs r1, 0x9E + lsls r1, 1 + adds r0, r7, r1 + ldr r0, [r0] + bl sub_8094450 + adds r4, r0, 0 + movs r1, 0xA0 + lsls r1, 1 + adds r0, r7, r1 + ldr r0, [r0] + bl sub_8094450 + cmp r4, r0 + blt _08078BE0 + movs r5, 0x1 +_08078BE0: + ldr r0, _08078C8C + cmp r10, r0 + bne _08078BE8 + movs r5, 0x1 +_08078BE8: + cmp r5, 0 + beq _08078CC0 + movs r0, 0xA0 + lsls r0, 1 + adds r5, r7, r0 + ldr r1, [r5] + str r1, [sp, 0x20] + subs r0, 0x4 + adds r0, r7 + mov r10, r0 + ldr r0, [r0] + bl sub_8094450 + adds r4, r0, 0 + ldr r0, [r5] + bl sub_8094450 + movs r1, 0 + str r1, [sp, 0x24] + cmp r4, r0 + bne _08078C16 + movs r0, 0x1 + str r0, [sp, 0x24] +_08078C16: + mov r0, sp + ldr r1, [sp, 0x1C] + bl sub_80943A0 + ldr r2, [sp] + ldr r1, [r5] + add r0, sp, 0x4 + bl sub_8094268 + ldr r4, [sp, 0x4] + str r4, [r5] + add r0, sp, 0x8 + movs r1, 0xC8 + bl sub_80943A0 + ldr r2, [sp, 0x8] + add r0, sp, 0xC + adds r1, r4, 0 + bl sub_8094318 + ldr r0, [sp, 0xC] + str r0, [r5] + mov r1, r10 + str r0, [r1] + ldr r0, [sp, 0x24] + cmp r0, 0 + bne _08078C5E + mov r1, r8 + cmp r1, 0 + beq _08078C5E + ldr r0, _08078C90 + ldr r2, [r0] + mov r0, r9 + adds r1, r6, 0 + bl sub_80522F4 +_08078C5E: + ldr r0, [sp, 0x20] + bl sub_8094450 + adds r4, r0, 0 + movs r1, 0xA0 + lsls r1, 1 + adds r0, r7, r1 + ldr r0, [r0] + bl sub_8094450 + cmp r4, r0 + bne _08078C9C + ldr r0, _08078C94 + adds r1, r6, 0 + movs r2, 0 + bl sub_8045B94 + mov r0, r8 + cmp r0, 0 + beq _08078D72 + ldr r0, _08078C98 + b _08078D4E + .align 2, 0 +_08078C8C: .4byte 0x000003e7 +_08078C90: .4byte gUnknown_80FBE64 +_08078C94: .4byte gUnknown_202DF98 +_08078C98: .4byte gUnknown_80FBDF0 +_08078C9C: + adds r0, r6, 0 + bl sub_8041DB0 + ldr r0, _08078CB8 + adds r1, r6, 0 + movs r2, 0 + bl sub_8045B94 + mov r1, r8 + cmp r1, 0 + beq _08078D72 + ldr r0, _08078CBC + b _08078D4E + .align 2, 0 +_08078CB8: .4byte gUnknown_202DF98 +_08078CBC: .4byte gUnknown_80FBDC4 +_08078CC0: + movs r0, 0x9E + lsls r0, 1 + adds r5, r7, r0 + ldr r4, [r5] + add r0, sp, 0x10 + mov r1, r10 + bl sub_80943A0 + ldr r2, [sp, 0x10] + ldr r1, [r5] + add r0, sp, 0x14 + bl sub_8094268 + ldr r1, [sp, 0x14] + str r1, [r5] + movs r0, 0xA0 + lsls r0, 1 + adds r7, r0 + ldr r2, [r7] + add r0, sp, 0x18 + bl sub_8094318 + ldr r0, [sp, 0x18] + str r0, [r5] + ldr r0, _08078D28 + cmp r10, r0 + bne _08078CFA + ldr r0, [r7] + str r0, [r5] +_08078CFA: + adds r0, r6, 0 + bl nullsub_85 + ldr r0, _08078D2C + adds r1, r6, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r4, 0 + bl sub_8094450 + adds r4, r0, 0 + ldr r0, [r5] + bl sub_8094450 + cmp r4, r0 + bne _08078D34 + mov r1, r8 + cmp r1, 0 + beq _08078D72 + ldr r0, _08078D30 + b _08078D4E + .align 2, 0 +_08078D28: .4byte 0x000003e7 +_08078D2C: .4byte gUnknown_202DF98 +_08078D30: .4byte gUnknown_80FBE14 +_08078D34: + ldr r0, [r5] + bl sub_8094450 + adds r4, r0, 0 + ldr r0, [r7] + bl sub_8094450 + cmp r4, r0 + blt _08078D60 + mov r0, r8 + cmp r0, 0 + beq _08078D72 + ldr r0, _08078D5C +_08078D4E: + ldr r2, [r0] + mov r0, r9 + adds r1, r6, 0 + bl sub_80522F4 + b _08078D72 + .align 2, 0 +_08078D5C: .4byte gUnknown_80FBE64 +_08078D60: + mov r1, r8 + cmp r1, 0 + beq _08078D72 + ldr r0, _08078D88 + ldr r2, [r0] + mov r0, r9 + adds r1, r6, 0 + bl sub_80522F4 +_08078D72: + adds r0, r6, 0 + bl sub_80418D4 +_08078D78: + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08078D88: .4byte gUnknown_80FBE84 + thumb_func_end sub_8078B5C + + thumb_func_start sub_8078D8C +sub_8078D8C: + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08078E0E + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_80716E8 + lsls r0, 24 + cmp r0, 0 + bne _08078E0E + ldr r6, [r4, 0x70] + ldr r0, _08078DF0 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r1, r6, 0 + adds r1, 0xEC + ldrb r0, [r1] + cmp r0, 0x1 + beq _08078DFC + movs r0, 0x1 + strb r0, [r1] + ldr r1, _08078DF4 + adds r0, r4, 0 + movs r2, 0x1 + bl sub_808417C + adds r0, 0x1 + adds r1, r6, 0 + adds r1, 0xED + strb r0, [r1] + adds r0, r4, 0 + bl nullsub_86 + ldr r0, _08078DF8 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08078E08 + .align 2, 0 +_08078DF0: .4byte gUnknown_202DF98 +_08078DF4: .4byte gUnknown_80F4F1C +_08078DF8: .4byte gUnknown_80FBF68 +_08078DFC: + ldr r0, _08078E14 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08078E08: + adds r0, r4, 0 + bl sub_80418D4 +_08078E0E: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08078E14: .4byte gUnknown_80FBF84 + thumb_func_end sub_8078D8C + + thumb_func_start sub_8078E18 +sub_8078E18: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, _08078E48 + add sp, r4 + mov r10, r0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08078F2E + ldr r7, [r5, 0x70] + adds r0, r7, 0 + adds r0, 0xE4 + ldrb r0, [r0] + cmp r0, 0x2 + bne _08078E50 + ldr r0, _08078E4C + b _08078EC0 + .align 2, 0 +_08078E48: .4byte 0xfffffe00 +_08078E4C: .4byte gUnknown_80FBF04 +_08078E50: + ldr r0, _08078ECC + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + mov r0, sp + movs r1, 0 + bl sub_803D870 + mov r8, r0 + cmp r0, 0 + beq _08078EBE + movs r0, 0 + mov r9, r0 + movs r6, 0 +_08078E6E: + mov r0, r8 + bl sub_8084100 + lsls r0, 3 + add r0, sp + bl sub_808E9B8 + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + adds r0, r5, 0 + bl sub_8069F54 + lsls r0, 16 + asrs r4, r0, 16 + movs r1, 0x4 + ldrsh r0, [r7, r1] + cmp r4, r0 + beq _08078EAE + adds r0, r4, 0 + movs r1, 0x1 + bl sub_806AA0C + lsls r0, 24 + cmp r0, 0 + beq _08078EAE + adds r0, r4, 0 + bl sub_80687D0 + mov r9, r0 + cmp r0, 0 + bne _08078EB4 +_08078EAE: + adds r6, 0x1 + cmp r6, 0x13 + ble _08078E6E +_08078EB4: + cmp r6, 0x14 + beq _08078EBE + mov r2, r9 + cmp r2, 0 + bne _08078ED4 +_08078EBE: + ldr r0, _08078ED0 +_08078EC0: + ldr r2, [r0] + mov r0, r10 + adds r1, r5, 0 + bl sub_80522F4 + b _08078F2E + .align 2, 0 +_08078ECC: .4byte gUnknown_202DF98 +_08078ED0: .4byte gUnknown_80FBEE4 +_08078ED4: + strh r4, [r7, 0x4] + mov r0, r9 + str r0, [r5, 0x64] + adds r1, r7, 0 + adds r1, 0xE4 + movs r0, 0x2 + strb r0, [r1] + ldr r1, _08078F44 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_808417C + adds r0, 0x1 + adds r1, r7, 0 + adds r1, 0xE5 + strb r0, [r1] + adds r0, r5, 0 + bl sub_806CF98 + adds r0, r5, 0 + bl nullsub_87 + adds r0, r5, 0 + bl sub_806CEBC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl sub_806CCB4 + ldr r0, _08078F48 + movs r2, 0x4 + ldrsh r1, [r7, r2] + bl sub_808D908 + ldr r0, _08078F4C + ldr r2, [r0] + mov r0, r10 + adds r1, r5, 0 + bl sub_80522F4 + adds r0, r5, 0 + bl sub_80418D4 +_08078F2E: + movs r3, 0x80 + lsls r3, 2 + add sp, r3 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08078F44: .4byte gUnknown_80F4EFC +_08078F48: .4byte gUnknown_202DFE8 +_08078F4C: .4byte gUnknown_80FBEC0 + thumb_func_end sub_8078E18 + + thumb_func_start sub_8078F50 +sub_8078F50: + push {r4-r7,lr} + adds r6, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08078FD2 + ldr r0, [r4, 0x70] + adds r7, r0, 0 + adds r5, r7, 0 + adds r5, 0xE4 + ldrb r0, [r5] + cmp r0, 0x2 + bne _08078F78 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_807A7C8 +_08078F78: + ldr r0, _08078FB4 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldrb r0, [r5] + cmp r0, 0x3 + beq _08078FC0 + movs r0, 0x3 + strb r0, [r5] + ldr r1, _08078FB8 + adds r0, r4, 0 + movs r2, 0 + bl sub_808417C + adds r0, 0x1 + adds r1, r7, 0 + adds r1, 0xE5 + strb r0, [r1] + adds r0, r4, 0 + bl nullsub_88 + ldr r0, _08078FBC + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08078FCC + .align 2, 0 +_08078FB4: .4byte gUnknown_202DF98 +_08078FB8: .4byte gUnknown_80F4F04 +_08078FBC: .4byte gUnknown_80FBF28 +_08078FC0: + ldr r0, _08078FD8 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08078FCC: + adds r0, r4, 0 + bl sub_80418D4 +_08078FD2: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08078FD8: .4byte gUnknown_80FBF50 + thumb_func_end sub_8078F50 + + thumb_func_start sub_8078FDC +sub_8078FDC: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r6, r0, 0 + adds r4, r1, 0 + lsls r2, 16 + asrs r7, r2, 16 + mov r10, r7 + movs r0, 0 + mov r8, r0 + mov r9, r0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080790B6 + adds r0, r6, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_80716E8 + lsls r0, 24 + cmp r0, 0 + bne _080790B6 + ldr r5, [r4, 0x70] + ldr r0, _08079064 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + movs r1, 0x26 + ldrsh r0, [r5, r1] + cmp r0, 0xA + ble _0807902E + movs r0, 0xA + strh r0, [r5, 0x26] + movs r0, 0x1 + mov r8, r0 +_0807902E: + mov r1, r8 + cmp r1, 0 + beq _0807904C + adds r0, r4, 0 + adds r1, r7, 0 + bl sub_8041DD8 + ldr r0, _08079068 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + movs r0, 0x1 + mov r9, r0 +_0807904C: + adds r5, 0xF5 + ldrb r0, [r5] + cmp r0, 0 + beq _08079070 + ldr r0, _0807906C + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _080790B6 + .align 2, 0 +_08079064: .4byte gUnknown_202DF98 +_08079068: .4byte gUnknown_80FC000 +_0807906C: .4byte gUnknown_80FBFB8 +_08079070: + mov r1, r9 + cmp r1, 0 + bne _0807907E + adds r0, r4, 0 + mov r1, r10 + bl sub_8041DD8 +_0807907E: + adds r0, r4, 0 + movs r1, 0xE + bl sub_8071858 + lsls r0, 24 + cmp r0, 0 + bne _080790A0 + ldr r0, _0807909C + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _080790B0 + .align 2, 0 +_0807909C: .4byte gUnknown_80FBFD8 +_080790A0: + movs r0, 0x1 + strb r0, [r5] + ldr r0, _080790C4 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_080790B0: + adds r0, r4, 0 + bl sub_80418D4 +_080790B6: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080790C4: .4byte gUnknown_80FBF9C + thumb_func_end sub_8078FDC + + thumb_func_start sub_80790C8 +sub_80790C8: + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08079134 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_80716E8 + lsls r0, 24 + cmp r0, 0 + bne _08079134 + ldr r6, _0807911C + ldr r0, [r6] + ldr r1, _08079120 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _08079128 + adds r0, r4, 0 + bl nullsub_89 + ldr r0, [r6] + ldr r1, _08079120 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + adds r0, r4, 0 + bl sub_80418D4 + ldr r0, _08079124 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08079134 + .align 2, 0 +_0807911C: .4byte gUnknown_203B418 +_08079120: .4byte 0x00000676 +_08079124: .4byte gUnknown_80FC028 +_08079128: + ldr r0, _0807913C + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08079134: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0807913C: .4byte gUnknown_80FC054 + thumb_func_end sub_80790C8 + + thumb_func_start sub_8079140 +sub_8079140: + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080791CE + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_80716E8 + lsls r0, 24 + cmp r0, 0 + bne _080791CE + ldr r6, [r4, 0x70] + ldr r0, _080791B0 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r1, r6, 0 + adds r1, 0xE8 + ldrb r0, [r1] + cmp r0, 0x1 + beq _080791BC + movs r0, 0x1 + strb r0, [r1] + ldr r1, _080791B4 + adds r0, r4, 0 + movs r2, 0x1 + bl sub_808417C + adds r0, 0x1 + adds r1, r6, 0 + adds r1, 0xE9 + strb r0, [r1] + adds r0, r4, 0 + bl sub_8041E0C + ldr r0, _080791B8 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 + movs r0, 0x31 + bl sub_803E46C + bl sub_8049ED4 + bl sub_8040A84 + b _080791C8 + .align 2, 0 +_080791B0: .4byte gUnknown_202DF98 +_080791B4: .4byte gUnknown_80F4F08 +_080791B8: .4byte gUnknown_80FB7F4 +_080791BC: + ldr r0, _080791D4 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 +_080791C8: + adds r0, r4, 0 + bl sub_80418D4 +_080791CE: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080791D4: .4byte gUnknown_80FB810 + thumb_func_end sub_8079140 + + thumb_func_start sub_80791D8 +sub_80791D8: + push {r4-r7,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08079266 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_80716E8 + lsls r0, 24 + cmp r0, 0 + bne _08079266 + ldr r7, [r4, 0x70] + ldr r0, _08079248 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r6, r7, 0 + adds r6, 0xE8 + ldrb r0, [r6] + cmp r0, 0x2 + beq _08079254 + adds r0, r4, 0 + bl sub_8041E1C + ldr r0, _0807924C + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 + movs r0, 0x2 + strb r0, [r6] + ldr r1, _08079250 + adds r0, r4, 0 + movs r2, 0x1 + bl sub_808417C + adds r0, 0x1 + adds r1, r7, 0 + adds r1, 0xE9 + strb r0, [r1] + movs r0, 0x1 + bl sub_803F580 + bl sub_8049ED4 + bl sub_8040A84 + b _08079260 + .align 2, 0 +_08079248: .4byte gUnknown_202DF98 +_0807924C: .4byte gUnknown_80FB834 +_08079250: .4byte gUnknown_80F4F0C +_08079254: + ldr r0, _0807926C + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08079260: + adds r0, r4, 0 + bl sub_80418D4 +_08079266: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0807926C: .4byte gUnknown_80FB85C + thumb_func_end sub_80791D8 + + thumb_func_start sub_8079270 +sub_8079270: + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080792EE + ldr r5, [r4, 0x70] + ldr r0, _080792D0 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r1, r5, 0 + adds r1, 0xE8 + ldrb r0, [r1] + cmp r0, 0x3 + beq _080792DC + movs r0, 0x3 + strb r0, [r1] + ldr r1, _080792D4 + adds r0, r4, 0 + movs r2, 0 + bl sub_808417C + adds r0, 0x1 + adds r1, r5, 0 + adds r1, 0xE9 + strb r0, [r1] + adds r0, r4, 0 + bl sub_8041E3C + ldr r0, _080792D8 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + movs r0, 0x31 + bl sub_803E46C + bl sub_8049ED4 + bl sub_8040A84 + b _080792E8 + .align 2, 0 +_080792D0: .4byte gUnknown_202DF98 +_080792D4: .4byte gUnknown_80F4F10 +_080792D8: .4byte gUnknown_80FB880 +_080792DC: + ldr r0, _080792F4 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_080792E8: + adds r0, r4, 0 + bl sub_80418D4 +_080792EE: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080792F4: .4byte gUnknown_80FB89C + thumb_func_end sub_8079270 + + thumb_func_start sub_80792F8 +sub_80792F8: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + mov r10, r0 + adds r6, r1, 0 + mov r9, r2 + movs r0, 0 + mov r8, r0 + adds r0, r6, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807939A + ldr r0, [r6, 0x70] + movs r1, 0x8C + lsls r1, 1 + adds r4, r0, r1 + adds r5, r4, 0 + movs r7, 0x3 +_08079326: + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0807935E + ldrb r0, [r4, 0x4] + str r0, [sp] + adds r0, r5, 0 + bl sub_8092BF4 + str r0, [sp, 0x4] + ldr r1, [sp] + ldr r0, [sp, 0x4] + cmp r1, r0 + bge _0807935E + ldr r0, [sp] + add r0, r9 + str r0, [sp] + ldr r1, [sp] + ldr r0, [sp, 0x4] + cmp r1, r0 + ble _08079356 + ldr r0, [sp, 0x4] + str r0, [sp] +_08079356: + ldr r0, [sp] + strb r0, [r4, 0x4] + movs r0, 0x1 + mov r8, r0 +_0807935E: + adds r4, 0x8 + adds r5, 0x8 + subs r7, 0x1 + cmp r7, 0 + bge _08079326 + mov r1, r8 + cmp r1, 0 + beq _08079388 + adds r0, r6, 0 + bl sub_8041E4C + ldr r0, _08079384 + ldr r2, [r0] + mov r0, r10 + adds r1, r6, 0 + bl sub_80522F4 + b _08079394 + .align 2, 0 +_08079384: .4byte gUnknown_80FDBD0 +_08079388: + ldr r0, _080793AC + ldr r2, [r0] + mov r0, r10 + adds r1, r6, 0 + bl sub_80522F4 +_08079394: + adds r0, r6, 0 + bl sub_80418D4 +_0807939A: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080793AC: .4byte gUnknown_80FDBF0 + thumb_func_end sub_80792F8 + + thumb_func_start sub_80793B0 +sub_80793B0: + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08079416 + ldr r0, _080793FC + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, [r4, 0x70] + adds r1, r0, 0 + ldrb r0, [r1, 0x14] + adds r2, r0, 0 + adds r0, r2, r5 + cmp r0, 0xFE + ble _080793DE + movs r0, 0xFF +_080793DE: + strb r0, [r1, 0x14] + lsls r0, 24 + lsrs r0, 24 + cmp r2, r0 + bcs _08079404 + adds r0, r4, 0 + bl sub_8041E60 + ldr r0, _08079400 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08079410 + .align 2, 0 +_080793FC: .4byte gUnknown_202DF98 +_08079400: .4byte gUnknown_80FC33C +_08079404: + ldr r0, _0807941C + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08079410: + adds r0, r4, 0 + bl sub_80418D4 +_08079416: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0807941C: .4byte gUnknown_80FC360 + thumb_func_end sub_80793B0 + + thumb_func_start sub_8079420 +sub_8079420: + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08079486 + ldr r0, _0807946C + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, [r4, 0x70] + adds r1, r0, 0 + ldrb r0, [r1, 0x15] + adds r2, r0, 0 + adds r0, r2, r5 + cmp r0, 0xFE + ble _0807944E + movs r0, 0xFF +_0807944E: + strb r0, [r1, 0x15] + lsls r0, 24 + lsrs r0, 24 + cmp r2, r0 + bcs _08079474 + adds r0, r4, 0 + bl sub_8041E74 + ldr r0, _08079470 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08079480 + .align 2, 0 +_0807946C: .4byte gUnknown_202DF98 +_08079470: .4byte gUnknown_80FC388 +_08079474: + ldr r0, _0807948C + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08079480: + adds r0, r4, 0 + bl sub_80418D4 +_08079486: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0807948C: .4byte gUnknown_80FC3B4 + thumb_func_end sub_8079420 + + thumb_func_start sub_8079490 +sub_8079490: + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080794F6 + ldr r0, _080794DC + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, [r4, 0x70] + adds r1, r0, 0 + ldrb r0, [r1, 0x16] + adds r2, r0, 0 + adds r0, r2, r5 + cmp r0, 0xFE + ble _080794BE + movs r0, 0xFF +_080794BE: + strb r0, [r1, 0x16] + lsls r0, 24 + lsrs r0, 24 + cmp r2, r0 + bcs _080794E4 + adds r0, r4, 0 + bl sub_8041E84 + ldr r0, _080794E0 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _080794F0 + .align 2, 0 +_080794DC: .4byte gUnknown_202DF98 +_080794E0: .4byte gUnknown_80FC3D8 +_080794E4: + ldr r0, _080794FC + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_080794F0: + adds r0, r4, 0 + bl sub_80418D4 +_080794F6: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080794FC: .4byte gUnknown_80FC3FC + thumb_func_end sub_8079490 + + thumb_func_start sub_8079500 +sub_8079500: + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08079566 + ldr r0, _0807954C + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, [r4, 0x70] + adds r1, r0, 0 + ldrb r0, [r1, 0x17] + adds r2, r0, 0 + adds r0, r2, r5 + cmp r0, 0xFE + ble _0807952E + movs r0, 0xFF +_0807952E: + strb r0, [r1, 0x17] + lsls r0, 24 + lsrs r0, 24 + cmp r2, r0 + bcs _08079554 + adds r0, r4, 0 + bl sub_8041E94 + ldr r0, _08079550 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08079560 + .align 2, 0 +_0807954C: .4byte gUnknown_202DF98 +_08079550: .4byte gUnknown_80FC428 +_08079554: + ldr r0, _0807956C + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08079560: + adds r0, r4, 0 + bl sub_80418D4 +_08079566: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0807956C: .4byte gUnknown_80FC454 + thumb_func_end sub_8079500 + + thumb_func_start sub_8079570 +sub_8079570: + push {r4-r6,lr} + adds r6, r0, 0 + adds r5, r1, 0 + ldr r4, [r5, 0x70] + ldr r0, _080795A0 + movs r2, 0 + bl sub_8045B94 + adds r4, 0xE0 + ldrb r0, [r4] + cmp r0, 0x1 + beq _080795A8 + movs r0, 0x1 + strb r0, [r4] + adds r0, r5, 0 + bl sub_8041EA4 + ldr r0, _080795A4 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80522F4 + b _080795B4 + .align 2, 0 +_080795A0: .4byte gUnknown_202DFE8 +_080795A4: .4byte gUnknown_80FD20C +_080795A8: + ldr r0, _080795C0 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80522F4 +_080795B4: + adds r0, r5, 0 + bl sub_80418D4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080795C0: .4byte gUnknown_80FD22C + thumb_func_end sub_8079570 + + thumb_func_start sub_80795C4 +sub_80795C4: + push {r4-r6,lr} + adds r6, r0, 0 + adds r5, r1, 0 + ldr r4, [r5, 0x70] + ldr r0, _080795F4 + movs r2, 0 + bl sub_8045B94 + adds r4, 0xE0 + ldrb r0, [r4] + cmp r0, 0x2 + beq _080795FC + movs r0, 0x2 + strb r0, [r4] + adds r0, r5, 0 + bl sub_8041EB4 + ldr r0, _080795F8 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80522F4 + b _08079608 + .align 2, 0 +_080795F4: .4byte gUnknown_202DFE8 +_080795F8: .4byte gUnknown_80FD254 +_080795FC: + ldr r0, _08079614 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80522F4 +_08079608: + adds r0, r5, 0 + bl sub_80418D4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08079614: .4byte gUnknown_80FD27C + thumb_func_end sub_80795C4 + + thumb_func_start sub_8079618 +sub_8079618: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r9, r0 + adds r7, r1, 0 + mov r8, r3 + lsls r2, 24 + lsrs r6, r2, 24 + adds r0, r7, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08079638 + b _08079752 +_08079638: + ldr r5, [r7, 0x70] + ldr r0, _08079660 + adds r1, r7, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r5, 0 + adds r0, 0xC0 + ldrb r0, [r0] + cmp r0, r6 + bne _08079668 + cmp r6, 0xC + bne _08079668 + ldr r0, _08079664 + ldr r2, [r0] + mov r0, r9 + adds r1, r7, 0 + bl sub_80522F4 + b _08079752 + .align 2, 0 +_08079660: .4byte gUnknown_202DF98 +_08079664: .4byte gUnknown_80FC074 +_08079668: + adds r0, r5, 0 + adds r0, 0xC0 + strb r6, [r0] + movs r4, 0 + movs r1, 0x8C + lsls r1, 1 + adds r0, r5, r1 + subs r2, r6, 0x7 + b _0807968A +_0807967A: + adds r4, 0x1 + cmp r4, 0x3 + bgt _08079694 + lsls r0, r4, 3 + movs r1, 0x8C + lsls r1, 1 + adds r0, r1 + adds r0, r5, r0 +_0807968A: + cmp r0, r8 + bne _0807967A + adds r0, r5, 0 + adds r0, 0xC2 + strb r4, [r0] +_08079694: + movs r1, 0xA5 + lsls r1, 1 + adds r0, r5, r1 + movs r1, 0x1 + strb r1, [r0] + movs r4, 0 + lsls r0, r2, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _080796B2 + adds r0, r5, 0 + adds r0, 0xFF + strb r1, [r0] + movs r4, 0x1 + b _080796C6 +_080796B2: + adds r0, r6, 0 + subs r0, 0x9 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _080796C6 + adds r1, r5, 0 + adds r1, 0xFF + movs r0, 0x2 + strb r0, [r1] +_080796C6: + cmp r6, 0x1 + bne _080796E4 + ldr r1, _08079718 + adds r0, r7, 0 + movs r2, 0 + bl sub_808417C + adds r0, 0x1 + adds r2, r5, 0 + adds r2, 0xC1 + movs r1, 0 + strb r0, [r2] + adds r0, r5, 0 + adds r0, 0xA0 + str r1, [r0] +_080796E4: + cmp r6, 0xC + bne _080796FA + ldr r1, _0807971C + adds r0, r7, 0 + movs r2, 0 + bl sub_808417C + adds r0, 0x1 + adds r1, r5, 0 + adds r1, 0xC1 + strb r0, [r1] +_080796FA: + adds r0, r7, 0 + adds r1, r4, 0 + bl sub_8041BD0 + mov r0, r9 + adds r1, r7, 0 + ldr r2, [sp, 0x1C] + bl sub_80522F4 + adds r0, r7, 0 + bl sub_80418D4 + movs r4, 0 + ldr r6, _08079720 + b _0807972C + .align 2, 0 +_08079718: .4byte gUnknown_80F4E9C +_0807971C: .4byte gUnknown_80F4EA0 +_08079720: .4byte 0x0000c7ff +_08079724: + movs r0, 0x53 + bl sub_803E46C + adds r4, 0x1 +_0807972C: + ldr r0, _08079760 + cmp r4, r0 + bgt _08079752 + movs r1, 0x1 + adds r0, r5, 0 + adds r0, 0xFF + ldrb r0, [r0] + cmp r0, 0x1 + bne _0807974E + movs r1, 0xBA + lsls r1, 1 + adds r0, r5, r1 + ldr r0, [r0] + movs r1, 0 + cmp r0, r6 + ble _0807974E + movs r1, 0x1 +_0807974E: + cmp r1, 0 + beq _08079724 +_08079752: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08079760: .4byte 0x0000018f + thumb_func_end sub_8079618 + + thumb_func_start sub_8079764 +sub_8079764: + push {r4,lr} + adds r4, r0, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807979A + ldr r2, [r4, 0x70] + adds r3, r2, 0 + adds r3, 0xC0 + ldrb r0, [r3] + cmp r0, 0x1 + beq _08079794 + cmp r0, 0xC + beq _08079794 + movs r1, 0 + strb r1, [r3] + movs r3, 0xA5 + lsls r3, 1 + adds r0, r2, r3 + strb r1, [r0] + adds r0, r2, 0 + adds r0, 0xFF + strb r1, [r0] +_08079794: + adds r0, r4, 0 + bl sub_80418D4 +_0807979A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8079764 + + thumb_func_start sub_80797A0 +sub_80797A0: + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r0 + adds r4, r1, 0 + lsls r2, 24 + lsrs r7, r2, 24 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08079822 + ldr r6, [r4, 0x70] + ldr r0, _080797E0 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r5, r6, 0 + adds r5, 0xC4 + ldrb r0, [r5] + cmp r0, r7 + bne _080797E8 + ldr r0, _080797E4 + ldr r2, [r0] + mov r0, r8 + adds r1, r4, 0 + bl sub_80522F4 + b _08079822 + .align 2, 0 +_080797E0: .4byte gUnknown_202DF98 +_080797E4: .4byte gUnknown_80FB10C +_080797E8: + adds r0, r4, 0 + bl nullsub_57 + ldrb r0, [r5] + cmp r0, 0x4 + beq _0807980A + cmp r0, 0xA + beq _0807980A + ldr r1, _0807982C + adds r0, r4, 0 + movs r2, 0 + bl sub_808417C + adds r0, 0x1 + adds r1, r6, 0 + adds r1, 0xC5 + strb r0, [r1] +_0807980A: + adds r0, r6, 0 + adds r0, 0xC4 + strb r7, [r0] + ldr r0, _08079830 + ldr r2, [r0] + mov r0, r8 + adds r1, r4, 0 + bl sub_80522F4 + adds r0, r4, 0 + bl sub_80418D4 +_08079822: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0807982C: .4byte gUnknown_80F4E98 +_08079830: .4byte gUnknown_80FB0E0 + thumb_func_end sub_80797A0 + + thumb_func_start sub_8079834 +sub_8079834: + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080798A6 + ldr r5, [r4, 0x70] + ldr r0, _08079888 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r1, r5, 0 + adds r1, 0xC4 + ldrb r0, [r1] + cmp r0, 0x2 + beq _08079894 + movs r0, 0x2 + strb r0, [r1] + ldr r1, _0807988C + adds r0, r4, 0 + movs r2, 0 + bl sub_808417C + adds r0, 0x1 + adds r1, r5, 0 + adds r1, 0xC5 + strb r0, [r1] + adds r0, r4, 0 + bl nullsub_58 + ldr r0, _08079890 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _080798A0 + .align 2, 0 +_08079888: .4byte gUnknown_202DF98 +_0807988C: .4byte gUnknown_80F4E88 +_08079890: .4byte gUnknown_80FB048 +_08079894: + ldr r0, _080798AC + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_080798A0: + adds r0, r4, 0 + bl sub_80418D4 +_080798A6: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080798AC: .4byte gUnknown_80FB074 + thumb_func_end sub_8079834 + + thumb_func_start sub_80798B0 +sub_80798B0: + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08079922 + ldr r5, [r4, 0x70] + ldr r0, _08079904 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r1, r5, 0 + adds r1, 0xC4 + ldrb r0, [r1] + cmp r0, 0xE + beq _08079910 + movs r0, 0xE + strb r0, [r1] + ldr r1, _08079908 + adds r0, r4, 0 + movs r2, 0 + bl sub_808417C + adds r0, 0x1 + adds r1, r5, 0 + adds r1, 0xC5 + strb r0, [r1] + adds r0, r4, 0 + bl nullsub_59 + ldr r0, _0807990C + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _0807991C + .align 2, 0 +_08079904: .4byte gUnknown_202DF98 +_08079908: .4byte gUnknown_80F4E8C +_0807990C: .4byte gUnknown_80FB09C +_08079910: + ldr r0, _08079928 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_0807991C: + adds r0, r4, 0 + bl sub_80418D4 +_08079922: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08079928: .4byte gUnknown_80FB0C4 + thumb_func_end sub_80798B0 + + thumb_func_start sub_807992C +sub_807992C: + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807999E + ldr r5, [r4, 0x70] + ldr r0, _08079980 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r1, r5, 0 + adds r1, 0xC4 + ldrb r0, [r1] + cmp r0, 0x6 + beq _0807998C + movs r0, 0x6 + strb r0, [r1] + ldr r1, _08079984 + adds r0, r4, 0 + movs r2, 0 + bl sub_808417C + adds r0, 0x1 + adds r1, r5, 0 + adds r1, 0xC5 + strb r0, [r1] + adds r0, r4, 0 + bl sub_8041B34 + ldr r0, _08079988 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08079998 + .align 2, 0 +_08079980: .4byte gUnknown_202DF98 +_08079984: .4byte gUnknown_80F4EB4 +_08079988: .4byte gUnknown_80FAE1C +_0807998C: + ldr r0, _080799A4 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08079998: + adds r0, r4, 0 + bl sub_80418D4 +_0807999E: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080799A4: .4byte gUnknown_80FAE3C + thumb_func_end sub_807992C + + thumb_func_start sub_80799A8 +sub_80799A8: + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08079A1A + ldr r5, [r4, 0x70] + ldr r0, _080799FC + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r1, r5, 0 + adds r1, 0xC4 + ldrb r0, [r1] + cmp r0, 0x5 + beq _08079A08 + movs r0, 0x5 + strb r0, [r1] + ldr r1, _08079A00 + adds r0, r4, 0 + movs r2, 0 + bl sub_808417C + adds r0, 0x1 + adds r1, r5, 0 + adds r1, 0xC5 + strb r0, [r1] + adds r0, r4, 0 + bl nullsub_60 + ldr r0, _08079A04 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08079A14 + .align 2, 0 +_080799FC: .4byte gUnknown_202DF98 +_08079A00: .4byte gUnknown_80F4E90 +_08079A04: .4byte gUnknown_80FAF5C +_08079A08: + ldr r0, _08079A20 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08079A14: + adds r0, r4, 0 + bl sub_80418D4 +_08079A1A: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08079A20: .4byte gUnknown_80FAF8C + thumb_func_end sub_80799A8 + + thumb_func_start sub_8079A24 +sub_8079A24: + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08079A96 + ldr r5, [r4, 0x70] + ldr r0, _08079A78 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r1, r5, 0 + adds r1, 0xC4 + ldrb r0, [r1] + cmp r0, 0x3 + beq _08079A84 + movs r0, 0x3 + strb r0, [r1] + ldr r1, _08079A7C + adds r0, r4, 0 + movs r2, 0 + bl sub_808417C + adds r0, 0x1 + adds r1, r5, 0 + adds r1, 0xC5 + strb r0, [r1] + adds r0, r4, 0 + bl nullsub_61 + ldr r0, _08079A80 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08079A90 + .align 2, 0 +_08079A78: .4byte gUnknown_202DF98 +_08079A7C: .4byte gUnknown_80F4E84 +_08079A80: .4byte gUnknown_80FB130 +_08079A84: + ldr r0, _08079A9C + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08079A90: + adds r0, r4, 0 + bl sub_80418D4 +_08079A96: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08079A9C: .4byte gUnknown_80FB160 + thumb_func_end sub_8079A24 + + thumb_func_start sub_8079AA0 +sub_8079AA0: + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08079B12 + ldr r5, [r4, 0x70] + ldr r0, _08079AF4 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r1, r5, 0 + adds r1, 0xC4 + ldrb r0, [r1] + cmp r0, 0x1 + beq _08079B00 + movs r0, 0x1 + strb r0, [r1] + ldr r1, _08079AF8 + adds r0, r4, 0 + movs r2, 0 + bl sub_808417C + adds r0, 0x1 + adds r1, r5, 0 + adds r1, 0xC5 + strb r0, [r1] + adds r0, r4, 0 + bl nullsub_62 + ldr r0, _08079AFC + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08079B0C + .align 2, 0 +_08079AF4: .4byte gUnknown_202DF98 +_08079AF8: .4byte gUnknown_80F4E80 +_08079AFC: .4byte gUnknown_80FB17C +_08079B00: + ldr r0, _08079B18 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08079B0C: + adds r0, r4, 0 + bl sub_80418D4 +_08079B12: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08079B18: .4byte gUnknown_80FB1A8 + thumb_func_end sub_8079AA0 + + thumb_func_start sub_8079B1C +sub_8079B1C: + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08079B98 + adds r0, r4, 0 + bl nullsub_63 + ldr r5, [r4, 0x70] + adds r1, r5, 0 + adds r1, 0xC4 + ldrb r0, [r1] + cmp r0, 0x7 + beq _08079B7C + movs r0, 0x7 + strb r0, [r1] + ldr r1, _08079B70 + adds r0, r4, 0 + movs r2, 0 + bl sub_808417C + adds r0, 0x1 + adds r1, r5, 0 + adds r1, 0xC5 + strb r0, [r1] + ldr r0, _08079B74 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08079B78 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08079B92 + .align 2, 0 +_08079B70: .4byte gUnknown_80F4ED4 +_08079B74: .4byte gUnknown_202DF98 +_08079B78: .4byte gUnknown_80FB9B0 +_08079B7C: + ldr r0, _08079BA0 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _08079BA4 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08079B92: + adds r0, r4, 0 + bl sub_80418D4 +_08079B98: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08079BA0: .4byte gUnknown_202DF98 +_08079BA4: .4byte gUnknown_80FB9D8 + thumb_func_end sub_8079B1C + + thumb_func_start sub_8079BA8 +sub_8079BA8: + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08079C1A + ldr r5, [r4, 0x70] + ldr r0, _08079BFC + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r1, r5, 0 + adds r1, 0xC4 + ldrb r0, [r1] + cmp r0, 0x8 + beq _08079C08 + movs r0, 0x8 + strb r0, [r1] + ldr r1, _08079C00 + adds r0, r4, 0 + movs r2, 0 + bl sub_808417C + adds r0, 0x1 + adds r1, r5, 0 + adds r1, 0xC5 + strb r0, [r1] + adds r0, r4, 0 + bl nullsub_64 + ldr r0, _08079C04 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08079C14 + .align 2, 0 +_08079BFC: .4byte gUnknown_202DF98 +_08079C00: .4byte gUnknown_80F4EE8 +_08079C04: .4byte gUnknown_80FBAC0 +_08079C08: + ldr r0, _08079C20 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08079C14: + adds r0, r4, 0 + bl sub_80418D4 +_08079C1A: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08079C20: .4byte gUnknown_80FBAE4 + thumb_func_end sub_8079BA8 + + thumb_func_start sub_8079C24 +sub_8079C24: + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08079C96 + ldr r5, [r4, 0x70] + ldr r0, _08079C78 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r1, r5, 0 + adds r1, 0xC4 + ldrb r0, [r1] + cmp r0, 0x9 + beq _08079C84 + movs r0, 0x9 + strb r0, [r1] + ldr r1, _08079C7C + adds r0, r4, 0 + movs r2, 0 + bl sub_808417C + adds r0, 0x1 + adds r1, r5, 0 + adds r1, 0xC5 + strb r0, [r1] + adds r0, r4, 0 + bl nullsub_65 + ldr r0, _08079C80 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08079C90 + .align 2, 0 +_08079C78: .4byte gUnknown_202DF98 +_08079C7C: .4byte gUnknown_80F4EF8 +_08079C80: .4byte gUnknown_80FBBF0 +_08079C84: + ldr r0, _08079C9C + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08079C90: + adds r0, r4, 0 + bl sub_80418D4 +_08079C96: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08079C9C: .4byte gUnknown_80FBC14 + thumb_func_end sub_8079C24 + + thumb_func_start sub_8079CA0 +sub_8079CA0: + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08079D12 + ldr r5, [r4, 0x70] + ldr r0, _08079CF4 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r1, r5, 0 + adds r1, 0xC4 + ldrb r0, [r1] + cmp r0, 0xB + beq _08079D00 + movs r0, 0xB + strb r0, [r1] + ldr r1, _08079CF8 + adds r0, r4, 0 + movs r2, 0 + bl sub_808417C + adds r0, 0x1 + adds r1, r5, 0 + adds r1, 0xC5 + strb r0, [r1] + adds r0, r4, 0 + bl nullsub_66 + ldr r0, _08079CFC + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08079D0C + .align 2, 0 +_08079CF4: .4byte gUnknown_202DF98 +_08079CF8: .4byte gUnknown_80F4F18 +_08079CFC: .4byte gUnknown_80FBC38 +_08079D00: + ldr r0, _08079D18 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08079D0C: + adds r0, r4, 0 + bl sub_80418D4 +_08079D12: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08079D18: .4byte gUnknown_80FBC5C + thumb_func_end sub_8079CA0 + + thumb_func_start sub_8079D1C +sub_8079D1C: + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08079DAE + ldr r6, [r4, 0x70] + adds r0, r4, 0 + movs r1, 0x25 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _08079D50 + ldr r0, _08079D4C + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08079DAE + .align 2, 0 +_08079D4C: .4byte gUnknown_8100720 +_08079D50: + ldr r0, _08079D90 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r1, r6, 0 + adds r1, 0xC4 + ldrb r0, [r1] + cmp r0, 0xC + beq _08079D9C + movs r0, 0xC + strb r0, [r1] + ldr r1, _08079D94 + adds r0, r4, 0 + movs r2, 0 + bl sub_808417C + adds r0, 0x1 + adds r1, r6, 0 + adds r1, 0xC5 + strb r0, [r1] + adds r0, r4, 0 + bl nullsub_67 + ldr r0, _08079D98 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08079DA8 + .align 2, 0 +_08079D90: .4byte gUnknown_202DF98 +_08079D94: .4byte gUnknown_80F4F20 +_08079D98: .4byte gUnknown_80FBC7C +_08079D9C: + ldr r0, _08079DB4 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08079DA8: + adds r0, r4, 0 + bl sub_80418D4 +_08079DAE: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08079DB4: .4byte gUnknown_80FBCA4 + thumb_func_end sub_8079D1C + + thumb_func_start sub_8079DB8 +sub_8079DB8: + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08079E2A + ldr r5, [r4, 0x70] + ldr r0, _08079E0C + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r1, r5, 0 + adds r1, 0xC4 + ldrb r0, [r1] + cmp r0, 0xD + beq _08079E18 + movs r0, 0xD + strb r0, [r1] + ldr r1, _08079E10 + adds r0, r4, 0 + movs r2, 0 + bl sub_808417C + adds r0, 0x1 + adds r1, r5, 0 + adds r1, 0xC5 + strb r0, [r1] + adds r0, r4, 0 + bl nullsub_68 + ldr r0, _08079E14 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _08079E24 + .align 2, 0 +_08079E0C: .4byte gUnknown_202DF98 +_08079E10: .4byte gUnknown_80F4F24 +_08079E14: .4byte gUnknown_80FBCC8 +_08079E18: + ldr r0, _08079E30 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08079E24: + adds r0, r4, 0 + bl sub_80418D4 +_08079E2A: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08079E30: .4byte gUnknown_80FBCF0 + thumb_func_end sub_8079DB8 + + thumb_func_start sub_8079E34 +sub_8079E34: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r8, r0 + adds r5, r1, 0 + lsls r2, 24 + lsrs r2, 24 + mov r9, r2 + movs r6, 0 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08079F0E + ldr r0, [r5, 0x70] + mov r12, r0 + movs r4, 0 + movs r7, 0xA +_08079E5C: + lsls r2, r4, 1 + mov r0, r12 + adds r0, 0x1C + adds r1, r0, r2 + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0xA + beq _08079E70 + strh r7, [r1] + movs r6, 0x1 +_08079E70: + mov r0, r12 + adds r0, 0x20 + adds r1, r0, r2 + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0xA + beq _08079E82 + strh r7, [r1] + movs r6, 0x1 +_08079E82: + mov r0, r12 + adds r0, 0x24 + adds r1, r0, r2 + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0xA + beq _08079E94 + strh r7, [r1] + movs r6, 0x1 +_08079E94: + lsls r3, r4, 2 + mov r0, r12 + adds r0, 0x2C + adds r1, r0, r3 + ldr r0, [r1] + movs r2, 0x80 + lsls r2, 1 + cmp r0, r2 + beq _08079EAA + str r2, [r1] + movs r6, 0x1 +_08079EAA: + mov r0, r12 + adds r0, 0x34 + adds r1, r0, r3 + ldr r0, [r1] + cmp r0, r2 + beq _08079EBA + str r2, [r1] + movs r6, 0x1 +_08079EBA: + adds r4, 0x1 + cmp r4, 0x1 + ble _08079E5C + cmp r6, 0 + beq _08079ECC + adds r0, r5, 0 + bl sub_80420C8 + b _08079ED8 +_08079ECC: + mov r3, r9 + cmp r3, 0 + beq _08079ED8 + adds r0, r5, 0 + bl sub_80420C8 +_08079ED8: + ldr r0, _08079EF4 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + cmp r6, 0 + beq _08079EFC + ldr r0, _08079EF8 + ldr r2, [r0] + mov r0, r8 + adds r1, r5, 0 + bl sub_80522F4 + b _08079F08 + .align 2, 0 +_08079EF4: .4byte gUnknown_202DF98 +_08079EF8: .4byte gUnknown_80FBD18 +_08079EFC: + ldr r0, _08079F1C + ldr r2, [r0] + mov r0, r8 + adds r1, r5, 0 + bl sub_80522F4 +_08079F08: + adds r0, r5, 0 + bl sub_80418D4 +_08079F0E: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08079F1C: .4byte gUnknown_80FBD3C + thumb_func_end sub_8079E34 + + thumb_func_start sub_8079F20 +sub_8079F20: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r5, r0, 0 + adds r4, r1, 0 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp] + lsls r3, 24 + lsrs r3, 24 + mov r10, r3 + movs r0, 0 + mov r8, r0 + mov r9, r0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08079F50 + b _0807A0B8 +_08079F50: + ldr r7, [r4, 0x70] + adds r0, r4, 0 + bl sub_8070A58 + lsls r0, 24 + cmp r0, 0 + beq _08079FF2 + movs r2, 0x1 + mov r8, r2 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl sub_807A124 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _08079F7C + b _0807A0B8 +_08079F7C: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_807A290 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_807A324 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_807A400 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_807A5D0 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_807A6C8 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_807A734 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_807A888 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_807A924 + adds r1, r7, 0 + adds r1, 0xFD + ldrb r0, [r1] + cmp r0, 0 + beq _08079FD8 + mov r0, r9 + strb r0, [r1] + ldr r0, _0807A08C + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08079FD8: + adds r1, r7, 0 + adds r1, 0xF5 + ldrb r0, [r1] + cmp r0, 0 + beq _08079FF2 + mov r2, r9 + strb r2, [r1] + ldr r0, _0807A090 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 +_08079FF2: + adds r0, r4, 0 + bl sub_8070774 + adds r6, r0, 0 + movs r1, 0 + movs r3, 0x4 + ldr r2, _0807A094 + adds r0, r7, r2 +_0807A002: + strb r1, [r0] + subs r0, 0x1 + subs r3, 0x1 + cmp r3, 0 + bge _0807A002 + adds r0, r4, 0 + bl sub_8070774 + cmp r6, r0 + beq _0807A032 + movs r0, 0x1 + mov r8, r0 + ldr r1, _0807A098 + movs r2, 0x82 + lsls r2, 1 + adds r0, r7, r2 + ldr r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 +_0807A032: + movs r6, 0x1 + movs r0, 0x8C + lsls r0, 1 + adds r2, r7, r0 + movs r7, 0xFE + movs r3, 0x3 +_0807A03E: + ldrb r1, [r2] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _0807A05E + ldrb r1, [r2, 0x1] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _0807A05E + movs r0, 0x1 + mov r8, r0 + mov r9, r0 + adds r0, r7, 0 + ands r0, r1 + strb r0, [r2, 0x1] +_0807A05E: + adds r2, 0x8 + subs r3, 0x1 + cmp r3, 0 + bge _0807A03E + mov r2, r8 + cmp r2, 0 + beq _0807A0A0 + ldr r0, [sp] + cmp r0, 0 + beq _0807A078 + adds r0, r4, 0 + bl sub_80420C8 +_0807A078: + mov r2, r9 + cmp r2, 0 + beq _0807A0B2 + ldr r0, _0807A09C + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _0807A0B2 + .align 2, 0 +_0807A08C: .4byte gUnknown_8100594 +_0807A090: .4byte gUnknown_81005B8 +_0807A094: .4byte 0x00000111 +_0807A098: .4byte gUnknown_80FA124 +_0807A09C: .4byte gUnknown_81005DC +_0807A0A0: + mov r0, r10 + cmp r0, 0 + bne _0807A0B2 + ldr r0, _0807A0C8 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 +_0807A0B2: + adds r0, r4, 0 + bl sub_80418D4 +_0807A0B8: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0807A0C8: .4byte gUnknown_81004E8 + thumb_func_end sub_8079F20 + + thumb_func_start sub_807A0CC +sub_807A0CC: + push {r4-r7,lr} + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807A11E + ldr r4, [r5, 0x70] + adds r0, r4, 0 + movs r1, 0 + bl sub_806BFC0 + adds r1, r4, 0 + adds r1, 0xFD + movs r0, 0 + strb r0, [r1] + subs r1, 0x8 + strb r0, [r1] + movs r7, 0x1 + movs r6, 0xFE + movs r0, 0x8C + lsls r0, 1 + adds r2, r4, r0 + movs r3, 0x3 +_0807A0FE: + ldrb r1, [r2] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _0807A110 + ldrb r1, [r2, 0x1] + adds r0, r6, 0 + ands r0, r1 + strb r0, [r2, 0x1] +_0807A110: + adds r2, 0x8 + subs r3, 0x1 + cmp r3, 0 + bge _0807A0FE + adds r0, r5, 0 + bl sub_80418D4 +_0807A11E: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_807A0CC + + thumb_func_start sub_807A124 +sub_807A124: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + adds r6, r0, 0 + adds r5, r1, 0 + lsls r2, 24 + lsrs r4, r2, 24 + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + movs r0, 0 + mov r9, r0 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _0807A14E + b _0807A27C +_0807A14E: + ldr r7, [r5, 0x70] + ldr r0, _0807A170 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r7, 0 + adds r0, 0xA8 + ldrb r0, [r0] + cmp r0, 0x6 + bls _0807A166 + b _0807A260 +_0807A166: + lsls r0, 2 + ldr r1, _0807A174 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0807A170: .4byte gUnknown_202DF98 +_0807A174: .4byte _0807A178 + .align 2, 0 +_0807A178: + .4byte _0807A260 + .4byte _0807A194 + .4byte _0807A1A0 + .4byte _0807A1B4 + .4byte _0807A228 + .4byte _0807A1E8 + .4byte _0807A260 +_0807A194: + movs r1, 0x1 + mov r9, r1 + ldr r0, _0807A19C + b _0807A1A2 + .align 2, 0 +_0807A19C: .4byte gUnknown_80FA6E8 +_0807A1A0: + ldr r0, _0807A1B0 +_0807A1A2: + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80522F4 + b _0807A260 + .align 2, 0 +_0807A1B0: .4byte gUnknown_80FA708 +_0807A1B4: + movs r2, 0x1 + mov r9, r2 + ldr r0, _0807A1DC + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80522F4 + mov r0, r8 + cmp r0, 0 + beq _0807A260 + ldr r0, _0807A1E0 + movs r2, 0 + ldrsh r1, [r0, r2] + ldr r3, _0807A1E4 + adds r0, r5, 0 + movs r2, 0x8 + bl sub_806F324 + b _0807A260 + .align 2, 0 +_0807A1DC: .4byte gUnknown_80FA70C +_0807A1E0: .4byte gUnknown_80F4F78 +_0807A1E4: .4byte 0x0000020f +_0807A1E8: + movs r0, 0x1 + mov r9, r0 + ldr r0, _0807A220 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80522F4 + ldr r0, _0807A224 + movs r1, 0 + ldrsh r2, [r0, r1] + movs r4, 0 + str r4, [sp] + adds r0, r6, 0 + adds r1, r5, 0 + movs r3, 0 + bl sub_8077C44 + adds r0, r7, 0 + adds r0, 0xA8 + strb r4, [r0] + adds r0, r6, 0 + adds r1, r5, 0 + movs r2, 0x1 + movs r3, 0x1 + bl sub_8079F20 + b _0807A260 + .align 2, 0 +_0807A220: .4byte gUnknown_80FA710 +_0807A224: .4byte gUnknown_80F4F7A +_0807A228: + cmp r4, 0 + beq _0807A254 + adds r1, r7, 0 + adds r1, 0xA8 + movs r0, 0 + strb r0, [r1] + ldr r1, _0807A250 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_808417C + adds r2, r0, 0 + adds r2, 0x1 + adds r0, r6, 0 + adds r1, r5, 0 + movs r3, 0x1 + bl sub_8075C58 + b _0807A27C + .align 2, 0 +_0807A250: .4byte gUnknown_80F4F2C +_0807A254: + ldr r0, _0807A28C + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80522F4 +_0807A260: + adds r1, r7, 0 + adds r1, 0xA8 + movs r0, 0 + strb r0, [r1] + adds r0, r5, 0 + bl sub_80418D4 + mov r2, r9 + cmp r2, 0 + beq _0807A27C + adds r0, r5, 0 + movs r1, 0x8 + bl sub_806CE68 +_0807A27C: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0807A28C: .4byte gUnknown_80FA734 + thumb_func_end sub_807A124 + + thumb_func_start sub_807A290 +sub_807A290: + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807A31A + ldr r6, [r4, 0x70] + ldr r0, _0807A2C4 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r6, 0 + adds r0, 0xAC + ldrb r0, [r0] + cmp r0, 0x5 + bhi _0807A30C + lsls r0, 2 + ldr r1, _0807A2C8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0807A2C4: .4byte gUnknown_202DF98 +_0807A2C8: .4byte _0807A2CC + .align 2, 0 +_0807A2CC: + .4byte _0807A30C + .4byte _0807A300 + .4byte _0807A2E4 + .4byte _0807A2E4 + .4byte _0807A2EC + .4byte _0807A30C +_0807A2E4: + ldr r0, _0807A2E8 + b _0807A2EE + .align 2, 0 +_0807A2E8: .4byte gUnknown_80FA8A8 +_0807A2EC: + ldr r0, _0807A2FC +_0807A2EE: + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _0807A30C + .align 2, 0 +_0807A2FC: .4byte gUnknown_80FA868 +_0807A300: + ldr r0, _0807A320 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 +_0807A30C: + adds r1, r6, 0 + adds r1, 0xAC + movs r0, 0 + strb r0, [r1] + adds r0, r4, 0 + bl sub_80418D4 +_0807A31A: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0807A320: .4byte gUnknown_80FA888 + thumb_func_end sub_807A290 + + thumb_func_start sub_807A324 +sub_807A324: + push {r4-r7,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r7, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807A3F4 + ldr r6, [r4, 0x70] + ldr r0, _0807A358 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r6, 0 + adds r0, 0xB0 + ldrb r0, [r0] + cmp r0, 0x8 + bhi _0807A3DC + lsls r0, 2 + ldr r1, _0807A35C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0807A358: .4byte gUnknown_202DF98 +_0807A35C: .4byte _0807A360 + .align 2, 0 +_0807A360: + .4byte _0807A3DC + .4byte _0807A384 + .4byte _0807A3A0 + .4byte _0807A3B4 + .4byte _0807A3B4 + .4byte _0807A3A0 + .4byte _0807A3D0 + .4byte _0807A398 + .4byte _0807A3DC +_0807A384: + ldr r0, _0807A394 + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 + movs r7, 0x1 + b _0807A3DC + .align 2, 0 +_0807A394: .4byte gUnknown_80FA8BC +_0807A398: + ldr r0, _0807A39C + b _0807A3A2 + .align 2, 0 +_0807A39C: .4byte gUnknown_80FA820 +_0807A3A0: + ldr r0, _0807A3B0 +_0807A3A2: + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _0807A3DC + .align 2, 0 +_0807A3B0: .4byte gUnknown_80FA824 +_0807A3B4: + ldr r0, _0807A3CC + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 + adds r0, r6, 0 + adds r0, 0x9C + ldr r0, [r0] + bl sub_8076CB4 + b _0807A3DC + .align 2, 0 +_0807A3CC: .4byte gUnknown_80FA81C +_0807A3D0: + ldr r0, _0807A3FC + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 +_0807A3DC: + adds r1, r6, 0 + adds r1, 0xB0 + movs r0, 0 + strb r0, [r1] + adds r0, r4, 0 + bl sub_80418D4 + cmp r7, 0 + beq _0807A3F4 + adds r0, r4, 0 + bl sub_8042A74 +_0807A3F4: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0807A3FC: .4byte gUnknown_80FABF8 + thumb_func_end sub_807A324 + + thumb_func_start sub_807A400 +sub_807A400: + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807A4BC + ldr r6, [r5, 0x70] + ldr r0, _0807A434 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r6, 0 + adds r0, 0xBC + ldrb r0, [r0] + cmp r0, 0x8 + bhi _0807A4A8 + lsls r0, 2 + ldr r1, _0807A438 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0807A434: .4byte gUnknown_202DF98 +_0807A438: .4byte _0807A43C + .align 2, 0 +_0807A43C: + .4byte _0807A4A8 + .4byte _0807A49C + .4byte _0807A460 + .4byte _0807A478 + .4byte _0807A468 + .4byte _0807A470 + .4byte _0807A488 + .4byte _0807A480 + .4byte _0807A4A8 +_0807A460: + ldr r0, _0807A464 + b _0807A48A + .align 2, 0 +_0807A464: .4byte gUnknown_80FA800 +_0807A468: + ldr r0, _0807A46C + b _0807A48A + .align 2, 0 +_0807A46C: .4byte gUnknown_80FA97C +_0807A470: + ldr r0, _0807A474 + b _0807A48A + .align 2, 0 +_0807A474: .4byte gUnknown_80FA9DC +_0807A478: + ldr r0, _0807A47C + b _0807A48A + .align 2, 0 +_0807A47C: .4byte gUnknown_80FAC38 +_0807A480: + ldr r0, _0807A484 + b _0807A48A + .align 2, 0 +_0807A484: .4byte gUnknown_80FAB90 +_0807A488: + ldr r0, _0807A498 +_0807A48A: + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80522F4 + b _0807A4A8 + .align 2, 0 +_0807A498: .4byte gUnknown_80FAAAC +_0807A49C: + ldr r0, _0807A4C4 + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80522F4 +_0807A4A8: + adds r1, r6, 0 + adds r1, 0xBC + movs r0, 0 + strb r0, [r1] + adds r0, r5, 0 + bl sub_80418D4 + adds r0, r5, 0 + bl sub_8070774 +_0807A4BC: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0807A4C4: .4byte gUnknown_80FAC18 + thumb_func_end sub_807A400 + + thumb_func_start sub_807A4C8 +sub_807A4C8: + push {r4,r5,lr} + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _0807A4DA + b _0807A5C4 +_0807A4DA: + ldr r5, [r4, 0x70] + ldr r0, _0807A4FC + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r5, 0 + adds r0, 0xC4 + ldrb r0, [r0] + cmp r0, 0xF + bhi _0807A5B6 + lsls r0, 2 + ldr r1, _0807A500 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0807A4FC: .4byte gUnknown_202DF98 +_0807A500: .4byte _0807A504 + .align 2, 0 +_0807A504: + .4byte _0807A5B6 + .4byte _0807A544 + .4byte _0807A54C + .4byte _0807A554 + .4byte _0807A55C + .4byte _0807A564 + .4byte _0807A56C + .4byte _0807A574 + .4byte _0807A57C + .4byte _0807A584 + .4byte _0807A55C + .4byte _0807A58C + .4byte _0807A594 + .4byte _0807A59C + .4byte _0807A5AC + .4byte _0807A5B6 +_0807A544: + ldr r0, _0807A548 + b _0807A59E + .align 2, 0 +_0807A548: .4byte gUnknown_80FA638 +_0807A54C: + ldr r0, _0807A550 + b _0807A59E + .align 2, 0 +_0807A550: .4byte gUnknown_80FA69C +_0807A554: + ldr r0, _0807A558 + b _0807A59E + .align 2, 0 +_0807A558: .4byte gUnknown_80FA658 +_0807A55C: + ldr r0, _0807A560 + b _0807A59E + .align 2, 0 +_0807A560: .4byte gUnknown_80FA67C +_0807A564: + ldr r0, _0807A568 + b _0807A59E + .align 2, 0 +_0807A568: .4byte gUnknown_80FA6BC +_0807A56C: + ldr r0, _0807A570 + b _0807A59E + .align 2, 0 +_0807A570: .4byte gUnknown_80FA6D4 +_0807A574: + ldr r0, _0807A578 + b _0807A59E + .align 2, 0 +_0807A578: .4byte gUnknown_80FA9C0 +_0807A57C: + ldr r0, _0807A580 + b _0807A59E + .align 2, 0 +_0807A580: .4byte gUnknown_80FAA68 +_0807A584: + ldr r0, _0807A588 + b _0807A59E + .align 2, 0 +_0807A588: .4byte gUnknown_80FAAC8 +_0807A58C: + ldr r0, _0807A590 + b _0807A59E + .align 2, 0 +_0807A590: .4byte gUnknown_80FAAE8 +_0807A594: + ldr r0, _0807A598 + b _0807A59E + .align 2, 0 +_0807A598: .4byte gUnknown_80FAB08 +_0807A59C: + ldr r0, _0807A5A8 +_0807A59E: + ldr r1, [r0] + adds r0, r4, 0 + bl sub_80522A8 + b _0807A5B6 + .align 2, 0 +_0807A5A8: .4byte gUnknown_80FAB28 +_0807A5AC: + ldr r0, _0807A5CC + ldr r1, [r0] + adds r0, r4, 0 + bl sub_80522A8 +_0807A5B6: + adds r1, r5, 0 + adds r1, 0xC4 + movs r0, 0 + strb r0, [r1] + adds r0, r4, 0 + bl sub_80418D4 +_0807A5C4: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0807A5CC: .4byte gUnknown_80FAB40 + thumb_func_end sub_807A4C8 + + thumb_func_start sub_807A5D0 +sub_807A5D0: + push {r4-r7,lr} + adds r5, r1, 0 + lsls r2, 24 + lsrs r6, r2, 24 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807A6B2 + ldr r7, [r5, 0x70] + ldr r0, _0807A604 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r7, 0 + adds r0, 0xC8 + ldrb r0, [r0] + cmp r0, 0x4 + bhi _0807A6A4 + lsls r0, 2 + ldr r1, _0807A608 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0807A604: .4byte gUnknown_202DF98 +_0807A608: .4byte _0807A60C + .align 2, 0 +_0807A60C: + .4byte _0807A6A4 + .4byte _0807A620 + .4byte _0807A668 + .4byte _0807A634 + .4byte _0807A6A4 +_0807A620: + cmp r6, 0x1 + beq _0807A6A4 + ldr r0, _0807A630 + ldr r1, [r0] + adds r0, r5, 0 + bl sub_80522A8 + b _0807A6A4 + .align 2, 0 +_0807A630: .4byte gUnknown_80FA7BC +_0807A634: + cmp r6, 0x3 + beq _0807A642 + ldr r0, _0807A658 + ldr r1, [r0] + adds r0, r5, 0 + bl sub_80522A8 +_0807A642: + ldr r0, _0807A65C + ldr r0, [r0] + ldr r2, _0807A660 + adds r1, r0, r2 + movs r2, 0 + str r2, [r1] + ldr r1, _0807A664 + adds r0, r1 + str r2, [r0] + b _0807A6A4 + .align 2, 0 +_0807A658: .4byte gUnknown_80FA7DC +_0807A65C: .4byte gUnknown_203B418 +_0807A660: .4byte 0x00017b30 +_0807A664: .4byte 0x00017b3c +_0807A668: + adds r0, r7, 0 + adds r0, 0xC8 + movs r4, 0 + strb r4, [r0] + adds r0, r5, 0 + bl sub_806CEBC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl sub_806CCB4 + ldr r0, _0807A6B8 + ldr r0, [r0] + ldr r2, _0807A6BC + adds r0, r2 + strb r4, [r0] + cmp r6, 0x2 + beq _0807A6A4 + ldr r0, _0807A6C0 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _0807A6C4 + ldr r1, [r0] + adds r0, r5, 0 + bl sub_80522A8 +_0807A6A4: + adds r1, r7, 0 + adds r1, 0xC8 + movs r0, 0 + strb r0, [r1] + adds r0, r5, 0 + bl sub_80418D4 +_0807A6B2: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0807A6B8: .4byte gUnknown_203B418 +_0807A6BC: .4byte 0x000037fc +_0807A6C0: .4byte gUnknown_202DF98 +_0807A6C4: .4byte gUnknown_80FA9A0 + thumb_func_end sub_807A5D0 + + thumb_func_start sub_807A6C8 +sub_807A6C8: + push {r4,r5,lr} + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807A72A + ldr r5, [r4, 0x70] + ldr r0, _0807A6F8 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r5, 0 + adds r0, 0xD0 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0807A6FC + cmp r0, 0x1 + ble _0807A716 + cmp r0, 0x2 + beq _0807A70C + b _0807A716 + .align 2, 0 +_0807A6F8: .4byte gUnknown_202DF98 +_0807A6FC: + ldr r0, _0807A708 + ldr r1, [r0] + adds r0, r4, 0 + bl sub_80522A8 + b _0807A716 + .align 2, 0 +_0807A708: .4byte gUnknown_80FA79C +_0807A70C: + ldr r0, _0807A730 + ldr r1, [r0] + adds r0, r4, 0 + bl sub_80522A8 +_0807A716: + adds r1, r5, 0 + adds r1, 0xD0 + movs r0, 0 + strb r0, [r1] + adds r1, 0x8 + movs r0, 0xFF + strb r0, [r1] + adds r0, r4, 0 + bl sub_80418D4 +_0807A72A: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0807A730: .4byte gUnknown_80FAA8C + thumb_func_end sub_807A6C8 + + thumb_func_start sub_807A734 +sub_807A734: + push {r4,r5,lr} + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807A7BC + ldr r5, [r4, 0x70] + ldr r0, _0807A764 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r5, 0 + adds r0, 0xDC + ldrb r0, [r0] + cmp r0, 0x5 + bhi _0807A7AE + lsls r0, 2 + ldr r1, _0807A768 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0807A764: .4byte gUnknown_202DF98 +_0807A768: .4byte _0807A76C + .align 2, 0 +_0807A76C: + .4byte _0807A7AE + .4byte _0807A784 + .4byte _0807A78C + .4byte _0807A794 + .4byte _0807A7A4 + .4byte _0807A7AE +_0807A784: + ldr r0, _0807A788 + b _0807A796 + .align 2, 0 +_0807A788: .4byte gUnknown_80FA8E0 +_0807A78C: + ldr r0, _0807A790 + b _0807A796 + .align 2, 0 +_0807A790: .4byte gUnknown_80FA90C +_0807A794: + ldr r0, _0807A7A0 +_0807A796: + ldr r1, [r0] + adds r0, r4, 0 + bl sub_80522A8 + b _0807A7AE + .align 2, 0 +_0807A7A0: .4byte gUnknown_80FA934 +_0807A7A4: + ldr r0, _0807A7C4 + ldr r1, [r0] + adds r0, r4, 0 + bl sub_80522A8 +_0807A7AE: + adds r1, r5, 0 + adds r1, 0xDC + movs r0, 0 + strb r0, [r1] + adds r0, r4, 0 + bl sub_80418D4 +_0807A7BC: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0807A7C4: .4byte gUnknown_80FA95C + thumb_func_end sub_807A734 + + thumb_func_start sub_807A7C8 +sub_807A7C8: + push {r4-r6,lr} + adds r4, r1, 0 + movs r6, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807A87E + ldr r5, [r4, 0x70] + ldr r0, _0807A7FC + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r5, 0 + adds r0, 0xE4 + ldrb r0, [r0] + cmp r0, 0x4 + bhi _0807A866 + lsls r0, 2 + ldr r1, _0807A800 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0807A7FC: .4byte gUnknown_202DF98 +_0807A800: .4byte _0807A804 + .align 2, 0 +_0807A804: + .4byte _0807A866 + .4byte _0807A818 + .4byte _0807A834 + .4byte _0807A824 + .4byte _0807A866 +_0807A818: + movs r6, 0x1 + ldr r0, _0807A820 + b _0807A826 + .align 2, 0 +_0807A820: .4byte gUnknown_80FA9F4 +_0807A824: + ldr r0, _0807A830 +_0807A826: + ldr r1, [r0] + adds r0, r4, 0 + bl sub_80522A8 + b _0807A866 + .align 2, 0 +_0807A830: .4byte gUnknown_80FABBC +_0807A834: + movs r0, 0x2 + ldrsh r1, [r5, r0] + adds r0, r4, 0 + bl sub_8069F54 + strh r0, [r5, 0x4] + movs r1, 0x4 + ldrsh r0, [r5, r1] + bl sub_80687D0 + str r0, [r4, 0x64] + adds r0, r4, 0 + bl sub_806CEBC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_806CCB4 + ldr r0, _0807A884 + ldr r1, [r0] + adds r0, r4, 0 + bl sub_80522A8 +_0807A866: + adds r1, r5, 0 + adds r1, 0xE4 + movs r0, 0 + strb r0, [r1] + adds r0, r4, 0 + bl sub_80418D4 + cmp r6, 0 + beq _0807A87E + movs r0, 0x1 + bl sub_807EC28 +_0807A87E: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0807A884: .4byte gUnknown_80FAB6C + thumb_func_end sub_807A7C8 + + thumb_func_start sub_807A888 +sub_807A888: + push {r4,r5,lr} + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807A918 + ldr r5, [r4, 0x70] + ldr r0, _0807A8B8 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r5, 0 + adds r0, 0xE8 + ldrb r0, [r0] + cmp r0, 0x4 + bhi _0807A8F6 + lsls r0, 2 + ldr r1, _0807A8BC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0807A8B8: .4byte gUnknown_202DF98 +_0807A8BC: .4byte _0807A8C0 + .align 2, 0 +_0807A8C0: + .4byte _0807A8F6 + .4byte _0807A8D4 + .4byte _0807A8DC + .4byte _0807A8EC + .4byte _0807A8F6 +_0807A8D4: + ldr r0, _0807A8D8 + b _0807A8DE + .align 2, 0 +_0807A8D8: .4byte gUnknown_80FAA0C +_0807A8DC: + ldr r0, _0807A8E8 +_0807A8DE: + ldr r1, [r0] + adds r0, r4, 0 + bl sub_80522A8 + b _0807A8F6 + .align 2, 0 +_0807A8E8: .4byte gUnknown_80FAA2C +_0807A8EC: + ldr r0, _0807A920 + ldr r1, [r0] + adds r0, r4, 0 + bl sub_80522A8 +_0807A8F6: + adds r0, r5, 0 + adds r0, 0xE8 + movs r1, 0 + strb r1, [r0] + adds r0, r4, 0 + bl sub_80418D4 + ldrb r0, [r5, 0x7] + cmp r0, 0 + beq _0807A918 + movs r0, 0x31 + bl sub_803E46C + bl sub_8049ED4 + bl sub_8040A84 +_0807A918: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0807A920: .4byte gUnknown_80FAA48 + thumb_func_end sub_807A888 + + thumb_func_start sub_807A924 +sub_807A924: + push {r4,r5,lr} + adds r5, r1, 0 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807A95C + ldr r4, [r5, 0x70] + ldr r0, _0807A964 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + adds r4, 0xEC + ldrb r0, [r4] + cmp r0, 0x1 + bne _0807A952 + ldr r0, _0807A968 + ldr r1, [r0] + adds r0, r5, 0 + bl sub_80522A8 +_0807A952: + movs r0, 0 + strb r0, [r4] + adds r0, r5, 0 + bl sub_80418D4 +_0807A95C: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0807A964: .4byte gUnknown_202DF98 +_0807A968: .4byte gUnknown_80FABC0 + thumb_func_end sub_807A924 + + thumb_func_start sub_807A96C +sub_807A96C: + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + ldr r0, [r4, 0x70] + adds r5, r0, 0 + movs r2, 0 + adds r0, 0xB0 + ldrb r0, [r0] + cmp r0, 0x6 + bne _0807A988 + adds r0, r6, 0 + bl sub_807A324 + movs r2, 0x1 +_0807A988: + adds r0, r5, 0 + adds r0, 0xA8 + ldrh r1, [r0] + ldr r0, _0807A9AC + cmp r1, r0 + bne _0807A9A2 + adds r0, r6, 0 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_807A124 + movs r2, 0x1 +_0807A9A2: + adds r0, r2, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0807A9AC: .4byte 0x00007f01 + thumb_func_end sub_807A96C + + thumb_func_start sub_807A9B0 +sub_807A9B0: + push {r4,lr} + adds r4, r0, 0 + ldr r0, [r4, 0x70] + adds r1, r0, 0 + adds r1, 0xA8 + movs r2, 0 + strb r2, [r1] + adds r0, 0xA9 + strb r2, [r0] + adds r0, r4, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_806A898 + adds r0, r4, 0 + bl sub_80418D4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_807A9B0 + + thumb_func_start sub_807A9D8 +sub_807A9D8: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807AA20 + ldr r2, [r4, 0x70] + adds r3, r2, 0 + adds r3, 0xB0 + ldrb r0, [r3] + cmp r0, 0x1 + bne _0807AA20 + movs r1, 0 + strb r1, [r3] + adds r0, r2, 0 + adds r0, 0xB8 + strb r1, [r0] + adds r0, 0x1 + strb r1, [r0] + ldr r0, _0807AA28 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _0807AA2C + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80522F4 + adds r0, r4, 0 + bl sub_80418D4 +_0807AA20: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0807AA28: .4byte gUnknown_202DF98 +_0807AA2C: .4byte gUnknown_80FA8BC + thumb_func_end sub_807A9D8 + + thumb_func_start sub_807AA30 +sub_807AA30: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r4, 0 +_0807AA3C: + ldr r0, _0807AAD8 + ldr r0, [r0] + lsls r1, r4, 2 + ldr r2, _0807AADC + adds r0, r2 + adds r0, r1 + ldr r5, [r0] + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + adds r4, 0x1 + mov r10, r4 + cmp r0, 0 + beq _0807AB22 + ldr r1, [r5, 0x70] + adds r0, r1, 0 + adds r0, 0xA8 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0807AB22 + adds r0, r1, 0 + adds r0, 0xA9 + ldrb r0, [r0] + cmp r0, 0x7F + bne _0807AB22 + movs r0, 0 + mov r9, r0 + mov r8, r0 + adds r0, r5, 0 + bl sub_80450FC + lsls r0, 24 + lsrs r7, r0, 24 + movs r6, 0 +_0807AA82: + ldr r0, _0807AAD8 + ldr r0, [r0] + lsls r1, r6, 2 + ldr r2, _0807AAE0 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807AB00 + adds r0, r4, 0 + movs r1, 0x18 + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + bne _0807AB00 + movs r0, 0x4 + ldrsh r1, [r4, r0] + movs r2, 0x4 + ldrsh r0, [r5, r2] + subs r1, r0 + cmp r1, 0 + bge _0807AABA + negs r1, r1 +_0807AABA: + cmp r1, 0x1 + bgt _0807AAE4 + movs r0, 0x6 + ldrsh r1, [r4, r0] + movs r2, 0x6 + ldrsh r0, [r5, r2] + subs r1, r0 + cmp r1, 0 + bge _0807AACE + negs r1, r1 +_0807AACE: + cmp r1, 0x1 + bgt _0807AAE4 + movs r0, 0x1 + mov r9, r0 + b _0807AB06 + .align 2, 0 +_0807AAD8: .4byte gUnknown_203B418 +_0807AADC: .4byte 0x0001358c +_0807AAE0: .4byte 0x0001357c +_0807AAE4: + adds r0, r4, 0 + movs r1, 0x1D + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _0807AB00 + adds r0, r4, 0 + bl sub_80450FC + lsls r0, 24 + lsrs r0, 24 + cmp r7, r0 + beq _0807AB1C +_0807AB00: + adds r6, 0x1 + cmp r6, 0x3 + ble _0807AA82 +_0807AB06: + mov r2, r8 + cmp r2, 0 + bne _0807AB1C + mov r0, r9 + cmp r0, 0 + beq _0807AB16 + movs r2, 0x1 + mov r8, r2 +_0807AB16: + mov r0, r8 + cmp r0, 0 + beq _0807AB22 +_0807AB1C: + adds r0, r5, 0 + bl sub_807A9B0 +_0807AB22: + mov r4, r10 + cmp r4, 0xF + ble _0807AA3C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_807AA30 + + thumb_func_start sub_807AB38 +sub_807AB38: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1A8 + adds r2, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + ldr r0, [r2, 0x70] + ldrb r0, [r0, 0x6] + cmp r0, 0 + beq _0807AB54 + b _0807ADA6 +_0807AB54: + adds r0, r2, 0 + str r2, [sp, 0x1A4] + bl sub_8045128 + ldrh r1, [r0] + movs r0, 0x40 + ands r0, r1 + ldr r2, [sp, 0x1A4] + cmp r0, 0 + bne _0807AB6A + b _0807ADA6 +_0807AB6A: + ldr r3, _0807AC10 + ldr r0, [r3] + ldr r5, _0807AC14 + adds r1, r0, r5 + ldrb r0, [r1] + cmp r0, 0 + beq _0807AB7A + b _0807ADA6 +_0807AB7A: + movs r0, 0x1 + strb r0, [r1] + ldr r3, [r3] + ldr r1, _0807AC18 + adds r0, r3, r1 + ldrb r1, [r0] + cmp r1, 0xFF + bne _0807AB8C + b _0807ADA6 +_0807AB8C: + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r5, _0807AC1C + adds r0, r5 + adds r3, r0 + movs r0, 0 + mov r8, r0 + cmp r4, 0 + beq _0807AC20 + movs r1, 0x6 + ldrsh r0, [r2, r1] + subs r6, r0, 0x4 + adds r0, 0x4 + cmp r6, r0 + ble _0807ABAE + b _0807ACB4 +_0807ABAE: + movs r4, 0x4 + ldrsh r0, [r2, r4] + subs r4, r0, 0x4 + adds r0, 0x4 + adds r5, r6, 0x1 + mov r9, r5 + cmp r4, r0 + bgt _0807AC00 + mov r1, r8 + lsls r0, r1, 2 + mov r1, sp + adds r5, r0, r1 +_0807ABC6: + adds r0, r4, 0 + adds r1, r6, 0 + str r2, [sp, 0x1A4] + bl sub_8049590 + adds r1, r0, 0 + ldr r0, [r1, 0x10] + ldr r2, [sp, 0x1A4] + cmp r0, 0 + bne _0807ABF4 + ldrh r1, [r1] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + bne _0807ABF4 + mov r0, r8 + cmp r0, 0x63 + bgt _0807ABF4 + strh r4, [r5] + strh r6, [r5, 0x2] + adds r5, 0x4 + movs r1, 0x1 + add r8, r1 +_0807ABF4: + adds r4, 0x1 + movs r1, 0x4 + ldrsh r0, [r2, r1] + adds r0, 0x4 + cmp r4, r0 + ble _0807ABC6 +_0807AC00: + mov r6, r9 + movs r4, 0x6 + ldrsh r0, [r2, r4] + adds r0, 0x4 + cmp r6, r0 + ble _0807ABAE + b _0807ACB4 + .align 2, 0 +_0807AC10: .4byte gUnknown_203B418 +_0807AC14: .4byte 0x00000671 +_0807AC18: .4byte 0x00003a0c +_0807AC1C: .4byte 0x000104c4 +_0807AC20: + movs r5, 0x4 + ldrsh r0, [r2, r5] + subs r1, r0, 0x4 + movs r5, 0x2 + ldrsh r4, [r3, r5] + mov r10, r4 + cmp r10, r1 + bge _0807AC32 + mov r10, r1 +_0807AC32: + adds r1, r0, 0x5 + movs r0, 0x6 + ldrsh r7, [r3, r0] + cmp r7, r1 + ble _0807AC3E + adds r7, r1, 0 +_0807AC3E: + movs r1, 0x6 + ldrsh r0, [r2, r1] + subs r2, r0, 0x4 + movs r4, 0x4 + ldrsh r1, [r3, r4] + cmp r1, r2 + bge _0807AC4E + adds r1, r2, 0 +_0807AC4E: + adds r0, 0x5 + movs r5, 0x8 + ldrsh r2, [r3, r5] + cmp r2, r0 + ble _0807AC5A + adds r2, r0, 0 +_0807AC5A: + adds r6, r1, 0 + cmp r6, r2 + bge _0807ACB4 +_0807AC60: + mov r4, r10 + adds r0, r6, 0x1 + mov r9, r0 + cmp r4, r7 + bge _0807ACAE + mov r1, r8 + lsls r0, r1, 2 + mov r1, sp + adds r5, r0, r1 +_0807AC72: + adds r0, r4, 0 + adds r1, r6, 0 + str r2, [sp, 0x1A4] + bl sub_8049590 + adds r1, r0, 0 + ldr r0, [r1, 0x10] + ldr r2, [sp, 0x1A4] + cmp r0, 0 + bne _0807ACA8 + ldrh r1, [r1] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + bne _0807ACA8 + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0807ACA8 + mov r0, r8 + cmp r0, 0x63 + bgt _0807ACA8 + strh r4, [r5] + strh r6, [r5, 0x2] + adds r5, 0x4 + movs r1, 0x1 + add r8, r1 +_0807ACA8: + adds r4, 0x1 + cmp r4, r7 + blt _0807AC72 +_0807ACAE: + mov r6, r9 + cmp r6, r2 + blt _0807AC60 +_0807ACB4: + ldr r0, _0807AD74 + movs r2, 0 + ldrsh r0, [r0, r2] + ldr r1, _0807AD78 + movs r4, 0 + ldrsh r1, [r1, r4] + bl sub_808411C + adds r7, r0, 0 + cmp r7, r8 + blt _0807ACCC + mov r7, r8 +_0807ACCC: + movs r6, 0 + cmp r6, r7 + bge _0807ADA0 + mov r10, r6 +_0807ACD4: + mov r0, r8 + bl sub_8084100 + adds r2, r0, 0 + movs r3, 0 + cmp r3, r8 + bge _0807AD0C + lsls r0, r2, 2 + mov r5, sp + adds r1, r5, r0 + movs r4, 0 + ldrsh r1, [r1, r4] + adds r5, r0, 0 + cmp r1, 0 + bne _0807AD1C +_0807ACF2: + adds r2, 0x1 + cmp r2, r8 + blt _0807ACFA + movs r2, 0 +_0807ACFA: + adds r3, 0x1 + cmp r3, r8 + bge _0807AD0C + lsls r0, r2, 2 + add r0, sp + movs r5, 0 + ldrsh r0, [r0, r5] + cmp r0, 0 + beq _0807ACF2 +_0807AD0C: + lsls r0, r2, 2 + mov r2, sp + adds r1, r2, r0 + movs r4, 0 + ldrsh r1, [r1, r4] + adds r5, r0, 0 + cmp r1, 0 + beq _0807ADA0 +_0807AD1C: + movs r0, 0x1 + bl sub_803D970 + add r4, sp, 0x190 + movs r1, 0 + strh r0, [r4] + mov r0, r10 + strh r0, [r4, 0x8] + strb r1, [r4, 0x2] + mov r1, r10 + str r1, [r4, 0x4] + movs r0, 0x1 + strb r0, [r4, 0x10] + mov r2, sp + adds r1, r2, r5 + ldrh r0, [r1] + strh r0, [r4, 0xC] + ldrh r0, [r1, 0x2] + strh r0, [r4, 0xE] + movs r5, 0 + ldrsh r0, [r4, r5] + movs r1, 0x1 + bl sub_806AA0C + lsls r0, 24 + adds r6, 0x1 + mov r9, r6 + cmp r0, 0 + beq _0807AD9A + adds r0, r4, 0 + movs r1, 0 + bl sub_806B7F8 + adds r4, r0, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807AD9A + movs r0, 0xC8 + lsls r0, 8 + str r0, [r4, 0x1C] + movs r5, 0 + b _0807AD84 + .align 2, 0 +_0807AD74: .4byte gUnknown_80F4DA2 +_0807AD78: .4byte gUnknown_80F4DA4 +_0807AD7C: + movs r0, 0x57 + bl sub_803E46C + adds r5, 0x1 +_0807AD84: + cmp r5, 0x63 + bgt _0807AD96 + ldr r0, [r4, 0x1C] + movs r1, 0xAA + bl sub_8009DA4 + str r0, [r4, 0x1C] + cmp r0, 0xFF + bgt _0807AD7C +_0807AD96: + mov r0, r10 + str r0, [r4, 0x1C] +_0807AD9A: + mov r6, r9 + cmp r6, r7 + blt _0807ACD4 +_0807ADA0: + movs r0, 0x1 + bl sub_804178C +_0807ADA6: + add sp, 0x1A8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_807AB38 + + thumb_func_start sub_807ADB8 +sub_807ADB8: + push {r4-r7,lr} + adds r5, r0, 0 + lsls r1, 24 + lsrs r7, r1, 24 + ldr r4, [r5, 0x70] + adds r0, r4, 0 + adds r0, 0x79 + movs r6, 0 + strb r6, [r0] + adds r0, 0x1 + strb r6, [r0] + adds r0, 0x1 + strb r6, [r0] + adds r0, r5, 0 + movs r1, 0x7 + bl sub_80718AC + lsls r0, 24 + cmp r0, 0 + beq _0807ADFA + movs r1, 0x10 + ldrsh r0, [r4, r1] + lsrs r1, r0, 31 + adds r0, r1 + movs r2, 0xE + ldrsh r1, [r4, r2] + asrs r0, 1 + cmp r1, r0 + bgt _0807ADFA + adds r0, r4, 0 + adds r0, 0x44 + strh r6, [r0] + b _0807AEB4 +_0807ADFA: + adds r0, r5, 0 + movs r1, 0x9 + bl sub_80718AC + lsls r0, 24 + cmp r0, 0 + beq _0807AE12 + adds r1, r4, 0 + adds r1, 0x44 + movs r0, 0 + strh r0, [r1] + b _0807AEB4 +_0807AE12: + ldrb r0, [r4, 0x7] + cmp r0, 0 + bne _0807AE32 + movs r1, 0x9E + lsls r1, 1 + adds r0, r4, r1 + ldr r0, [r0] + bl sub_8094450 + adds r1, r0, 0 + cmp r1, 0 + bne _0807AE32 + adds r0, r4, 0 + adds r0, 0x44 + strh r1, [r0] + b _0807AEB4 +_0807AE32: + adds r0, r4, 0 + adds r0, 0xA4 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0807AE6A + adds r0, r4, 0 + adds r0, 0x44 + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl sub_8044CA0 + movs r0, 0x8 + bl sub_8084100 + adds r1, r4, 0 + adds r1, 0x46 + strb r0, [r1] + ldrh r1, [r5, 0x4] + movs r2, 0xB6 + lsls r2, 1 + adds r0, r4, r2 + strh r1, [r0] + ldrh r0, [r5, 0x6] + subs r0, 0x1 + adds r2, 0x2 + adds r1, r4, r2 + strh r0, [r1] + b _0807AEB4 +_0807AE6A: + adds r0, r5, 0 + adds r1, r7, 0 + bl sub_8071518 + lsls r0, 24 + cmp r0, 0 + beq _0807AE80 + adds r0, r5, 0 + bl sub_807B5E0 + b _0807AE9C +_0807AE80: + adds r0, r5, 0 + bl sub_807AEBC + lsls r0, 24 + cmp r0, 0 + beq _0807AE96 + adds r1, r4, 0 + adds r1, 0x44 + movs r0, 0x3F + strh r0, [r1] + b _0807AEB4 +_0807AE96: + adds r0, r5, 0 + bl sub_807AF58 +_0807AE9C: + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _0807AEAC + adds r0, r4, 0 + adds r0, 0x44 + strh r2, [r0] + b _0807AEB4 +_0807AEAC: + adds r0, r5, 0 + adds r1, r7, 0 + bl sub_807B2D8 +_0807AEB4: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_807ADB8 + + thumb_func_start sub_807AEBC +sub_807AEBC: + push {r4-r6,lr} + adds r4, r0, 0 + ldr r5, [r4, 0x70] + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807AF50 + adds r0, r4, 0 + bl sub_8070C60 + lsls r0, 24 + cmp r0, 0 + bne _0807AF50 + adds r0, r4, 0 + bl sub_8045128 + adds r6, r0, 0 + ldr r4, [r6, 0x14] + cmp r4, 0 + beq _0807AF50 + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0x5 + bhi _0807AF50 + lsls r0, 2 + ldr r1, _0807AEFC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0807AEFC: .4byte _0807AF00 + .align 2, 0 +_0807AF00: + .4byte _0807AF50 + .4byte _0807AF50 + .4byte _0807AF50 + .4byte _0807AF18 + .4byte _0807AF50 + .4byte _0807AF50 +_0807AF18: + ldrb r0, [r5, 0x7] + cmp r0, 0 + bne _0807AF50 + adds r0, r5, 0 + adds r0, 0x60 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0807AF50 + ldrh r1, [r6] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _0807AF3C + ldrb r0, [r5, 0x6] + cmp r0, 0 + bne _0807AF50 +_0807AF3C: + adds r0, r4, 0 + bl sub_8045108 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0807AF50 + movs r0, 0x1 + b _0807AF52 +_0807AF50: + movs r0, 0 +_0807AF52: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_807AEBC + + thumb_func_start sub_807AF58 +sub_807AF58: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + mov r8, r0 + ldr r7, [r0, 0x70] + bl sub_8072C88 + lsls r0, 24 + cmp r0, 0 + beq _0807AF74 + b _0807B12C +_0807AF74: + ldr r0, _0807AF8C + ldr r1, [r0] + ldr r2, _0807AF90 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _0807AF98 + ldr r3, _0807AF94 + adds r6, r1, r3 + movs r4, 0x14 + mov r10, r4 + b _0807AFB4 + .align 2, 0 +_0807AF8C: .4byte gUnknown_203B418 +_0807AF90: .4byte 0x000037fc +_0807AF94: .4byte 0x000135cc +_0807AF98: + ldrb r0, [r7, 0x6] + cmp r0, 0 + beq _0807AFAC + ldr r0, _0807AFA8 + adds r6, r1, r0 + movs r1, 0x4 + mov r10, r1 + b _0807AFB4 + .align 2, 0 +_0807AFA8: .4byte 0x0001357c +_0807AFAC: + ldr r2, _0807B01C + adds r6, r1, r2 + movs r3, 0x10 + mov r10, r3 +_0807AFB4: + mov r0, r8 + bl sub_8070460 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + movs r4, 0x1 + negs r4, r4 + str r4, [sp] + ldr r0, _0807B020 + mov r9, r0 + movs r5, 0 + adds r1, r7, 0 + adds r1, 0x78 + str r1, [sp, 0x8] + cmp r5, r10 + bge _0807B09E +_0807AFD6: + lsls r0, r5, 2 + adds r0, r6 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807B098 + ldr r0, [r4, 0x70] + adds r1, r0, 0 + adds r1, 0xA4 + ldrb r1, [r1] + adds r2, r0, 0 + cmp r1, 0 + bne _0807B098 + ldr r0, _0807B024 + ldr r0, [r0] + ldr r3, _0807B028 + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0 + beq _0807B02C + mov r0, r8 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_8071598 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0807B098 + ldr r2, [r4, 0x70] + b _0807B03C + .align 2, 0 +_0807B01C: .4byte 0x0001358c +_0807B020: .4byte 0x000003e7 +_0807B024: .4byte gUnknown_203B418 +_0807B028: .4byte 0x000037fc +_0807B02C: + ldrb r0, [r7, 0x6] + cmp r0, 0 + bne _0807B03C + adds r0, r2, 0 + adds r0, 0xB0 + ldrb r0, [r0] + cmp r0, 0x6 + beq _0807B098 +_0807B03C: + ldrb r0, [r2, 0x8] + cmp r0, 0x1 + beq _0807B098 + ldr r0, [sp, 0x4] + cmp r0, 0 + beq _0807B074 + mov r2, r8 + movs r3, 0x4 + ldrsh r1, [r2, r3] + movs r2, 0x4 + ldrsh r0, [r4, r2] + subs r1, r0 + cmp r1, 0 + bge _0807B05A + negs r1, r1 +_0807B05A: + cmp r1, 0x5 + bgt _0807B074 + mov r3, r8 + movs r0, 0x6 + ldrsh r1, [r3, r0] + movs r2, 0x6 + ldrsh r0, [r4, r2] + subs r1, r0 + cmp r1, 0 + bge _0807B070 + negs r1, r1 +_0807B070: + cmp r1, 0x5 + ble _0807B082 +_0807B074: + mov r0, r8 + adds r1, r4, 0 + bl sub_8045A00 + lsls r0, 24 + cmp r0, 0 + beq _0807B098 +_0807B082: + adds r1, r4, 0x4 + mov r0, r8 + adds r0, 0x4 + bl sub_8098434 + cmp r9, r0 + ble _0807B098 + mov r9, r0 + str r5, [sp] + cmp r0, 0x1 + ble _0807B09E +_0807B098: + adds r5, 0x1 + cmp r5, r10 + blt _0807AFD6 +_0807B09E: + ldr r3, [sp] + cmp r3, 0 + blt _0807B12C + movs r2, 0 + movs r5, 0x1 + ldr r4, [sp, 0x8] + strb r5, [r4] + adds r1, r7, 0 + adds r1, 0x88 + lsls r0, r3, 2 + adds r4, r0, r6 + ldr r0, [r4] + ldr r0, [r0, 0x4] + str r0, [r1] + subs r1, 0x8 + ldr r0, [r4] + str r0, [r1] + ldrh r1, [r0, 0x26] + adds r0, r7, 0 + adds r0, 0x7C + strh r1, [r0] + subs r0, 0x2 + strb r5, [r0] + movs r1, 0x8A + lsls r1, 1 + adds r0, r7, r1 + str r2, [r0] + mov r0, r8 + movs r1, 0x8 + bl sub_80718AC + lsls r0, 24 + cmp r0, 0 + bne _0807B0E4 + b _0807B2C6 +_0807B0E4: + mov r0, r8 + bl sub_80719C4 + lsls r0, 24 + cmp r0, 0 + beq _0807B0F2 + b _0807B2C6 +_0807B0F2: + mov r2, r8 + movs r3, 0x4 + ldrsh r1, [r2, r3] + ldr r2, [r4] + movs r4, 0x4 + ldrsh r0, [r2, r4] + subs r1, r0 + cmp r1, 0 + bge _0807B106 + negs r1, r1 +_0807B106: + cmp r1, 0x1 + ble _0807B10C + b _0807B2C6 +_0807B10C: + mov r0, r8 + movs r3, 0x6 + ldrsh r1, [r0, r3] + movs r4, 0x6 + ldrsh r0, [r2, r4] + subs r0, r1, r0 + cmp r0, 0 + bge _0807B11E + negs r0, r0 +_0807B11E: + cmp r0, 0x1 + ble _0807B124 + b _0807B2C6 +_0807B124: + adds r0, r7, 0 + adds r0, 0x7B + strb r5, [r0] + b _0807B2C6 +_0807B12C: + mov r0, r8 + movs r1, 0x1 + bl sub_80718AC + lsls r0, 24 + cmp r0, 0 + bne _0807B17C + ldrb r5, [r7, 0x6] + adds r0, r7, 0 + adds r0, 0x78 + str r0, [sp, 0x8] + cmp r5, 0 + bne _0807B222 + mov r0, r8 + bl sub_8072CA8 + adds r4, r0, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807B222 + movs r0, 0x1 + ldr r1, [sp, 0x8] + strb r0, [r1] + adds r1, r7, 0 + adds r1, 0x88 + ldr r0, [r4, 0x4] + str r0, [r1] + adds r0, r7, 0 + adds r0, 0x80 + str r4, [r0] + ldrh r1, [r4, 0x26] + subs r0, 0x4 + strh r1, [r0] + movs r2, 0x8A + lsls r2, 1 + adds r0, r7, r2 + str r5, [r0] + b _0807B2C6 +_0807B17C: + ldrb r0, [r7, 0x7] + adds r3, r7, 0 + adds r3, 0x78 + str r3, [sp, 0x8] + cmp r0, 0 + beq _0807B222 + ldr r4, _0807B1BC + ldr r0, [r4] + ldr r1, _0807B1C0 + adds r0, r1 + ldrb r0, [r0] + mov r2, r8 + movs r3, 0x4 + ldrsh r0, [r2, r3] + movs r3, 0x6 + ldrsh r1, [r2, r3] + bl sub_804954C + ldrb r1, [r0, 0x9] + cmp r1, 0xFF + bne _0807B1C4 + mov r4, r8 + movs r0, 0x4 + ldrsh r1, [r4, r0] + subs r2, r1, 0x2 + mov r10, r2 + movs r3, 0x6 + ldrsh r0, [r4, r3] + subs r2, r0, 0x2 + adds r6, r1, 0x2 + adds r0, 0x2 + b _0807B1EC + .align 2, 0 +_0807B1BC: .4byte gUnknown_203B418 +_0807B1C0: .4byte 0x00018209 +_0807B1C4: + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r1, _0807B26C + adds r0, r1 + ldr r1, [r4] + adds r1, r0 + movs r2, 0x2 + ldrsh r0, [r1, r2] + subs r0, 0x1 + mov r10, r0 + movs r3, 0x4 + ldrsh r0, [r1, r3] + subs r2, r0, 0x1 + movs r4, 0x6 + ldrsh r0, [r1, r4] + adds r6, r0, 0x1 + movs r3, 0x8 + ldrsh r0, [r1, r3] + adds r0, 0x1 +_0807B1EC: + mov r9, r0 + adds r5, r2, 0 + adds r4, r7, 0 + adds r4, 0x78 + str r4, [sp, 0x8] + cmp r5, r9 + bgt _0807B222 +_0807B1FA: + mov r4, r10 + cmp r4, r6 + bgt _0807B21C +_0807B200: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8049590 + ldr r0, [r0, 0x14] + cmp r0, 0 + beq _0807B216 + bl sub_80450F8 + cmp r0, 0x3 + beq _0807B270 +_0807B216: + adds r4, 0x1 + cmp r4, r6 + ble _0807B200 +_0807B21C: + adds r5, 0x1 + cmp r5, r9 + ble _0807B1FA +_0807B222: + ldr r1, [sp, 0x8] + ldrb r0, [r1] + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bhi _0807B2C0 + adds r3, r7, 0 + adds r3, 0x80 + ldr r1, [r3] + cmp r1, 0 + beq _0807B2C0 + adds r2, r7, 0 + adds r2, 0x7C + ldrh r0, [r1, 0x26] + ldrh r4, [r2] + cmp r0, r4 + bne _0807B2B4 + ldr r1, [r1, 0x70] + mov r9, r1 + movs r5, 0 + mov r4, r9 + adds r4, 0x68 +_0807B250: + lsls r6, r5, 2 + mov r0, r8 + adds r1, r4, 0 + bl sub_8045ABC + lsls r0, 24 + cmp r0, 0 + bne _0807B294 + adds r4, 0x4 + adds r5, 0x1 + cmp r5, 0x3 + ble _0807B250 + b _0807B2C0 + .align 2, 0 +_0807B26C: .4byte 0x000104c4 +_0807B270: + movs r1, 0 + movs r0, 0x7 + ldr r2, [sp, 0x8] + strb r0, [r2] + adds r0, r7, 0 + adds r0, 0x88 + strh r4, [r0] + adds r0, 0x2 + strh r5, [r0] + subs r0, 0xA + str r1, [r0] + subs r0, 0x4 + strh r1, [r0] + movs r3, 0x8A + lsls r3, 1 + adds r0, r7, r3 + str r1, [r0] + b _0807B2C6 +_0807B294: + movs r2, 0 + movs r0, 0x2 + ldr r4, [sp, 0x8] + strb r0, [r4] + adds r1, r7, 0 + adds r1, 0x88 + mov r0, r9 + adds r0, 0x68 + adds r0, r6 + ldr r0, [r0] + str r0, [r1] + movs r1, 0x8A + lsls r1, 1 + adds r0, r7, r1 + str r2, [r0] + b _0807B2C6 +_0807B2B4: + movs r1, 0 + movs r0, 0x6 + ldr r4, [sp, 0x8] + strb r0, [r4] + str r1, [r3] + strh r1, [r2] +_0807B2C0: + mov r0, r8 + bl sub_807B920 +_0807B2C6: + movs r0, 0x1 + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_807AF58 + + thumb_func_start sub_807B2D8 +sub_807B2D8: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x3C + mov r9, r0 + lsls r1, 24 + lsrs r7, r1, 24 + ldr r5, [r0, 0x70] + movs r0, 0xB6 + lsls r0, 1 + adds r1, r5, r0 + adds r4, r5, 0 + adds r4, 0x88 + ldr r0, [r4] + str r0, [r1] + mov r2, r9 + ldr r1, [r2, 0x4] + ldr r0, [r4] + cmp r1, r0 + beq _0807B348 + mov r6, r9 + adds r6, 0x4 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80983D8 + mov r8, r0 + adds r0, r5, 0 + adds r0, 0x7A + ldrb r1, [r0] + mov r0, r9 + bl sub_8071470 + lsls r0, 24 + cmp r0, 0 + beq _0807B366 + adds r0, r5, 0 + adds r0, 0x78 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0807B37C + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_8083478 + lsls r0, 24 + cmp r0, 0 + beq _0807B37C + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_8098434 + cmp r0, 0x2 + bne _0807B354 +_0807B348: + adds r0, r5, 0 + adds r0, 0x44 + movs r1, 0x1 + bl sub_8044C94 + b _0807B5CE +_0807B354: + cmp r0, 0x1 + bgt _0807B37C + movs r3, 0x4 + add r8, r3 + movs r0, 0x7 + mov r1, r8 + ands r1, r0 + mov r8, r1 + b _0807B37C +_0807B366: + adds r0, r5, 0 + adds r0, 0x7B + ldrb r0, [r0] + cmp r0, 0 + beq _0807B37C + movs r2, 0x4 + add r8, r2 + movs r0, 0x7 + mov r3, r8 + ands r3, r0 + mov r8, r3 +_0807B37C: + add r4, sp, 0x30 + mov r0, r9 + mov r1, r8 + adds r2, r4, 0 + bl sub_8071214 + lsls r0, 24 + cmp r0, 0 + beq _0807B3A8 + adds r0, r5, 0 + adds r0, 0x44 + movs r2, 0x2 + ldrsh r1, [r5, r2] + bl sub_8044CA0 + movs r0, 0x7 + mov r3, r8 + ands r3, r0 + adds r0, r5, 0 + adds r0, 0x46 + strb r3, [r0] + b _0807B5CE +_0807B3A8: + ldrb r0, [r4] + cmp r0, 0 + beq _0807B444 + ldrb r0, [r5, 0x6] + cmp r0, 0 + bne _0807B3E8 + ldr r1, _0807B3E0 + adds r0, r5, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0807B3E8 + adds r0, r5, 0 + adds r0, 0x79 + movs r4, 0x1 + strb r4, [r0] + movs r2, 0xA2 + lsls r2, 1 + adds r0, r5, r2 + strb r4, [r0] + adds r0, r5, 0 + adds r0, 0x44 + movs r1, 0x1 + bl sub_8044C94 + ldr r3, _0807B3E4 + adds r0, r5, r3 + strb r4, [r0] + b _0807B5CE + .align 2, 0 +_0807B3E0: .4byte 0x00000145 +_0807B3E4: .4byte 0x00000147 +_0807B3E8: + mov r0, r9 + movs r2, 0x4 + ldrsh r1, [r0, r2] + ldr r2, _0807B434 + mov r3, r8 + lsls r0, r3, 2 + adds r2, r0, r2 + movs r3, 0 + ldrsh r0, [r2, r3] + adds r1, r0 + adds r0, r5, 0 + adds r0, 0x88 + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r1, r0 + bne _0807B43C + mov r1, r9 + movs r3, 0x6 + ldrsh r0, [r1, r3] + movs r3, 0x2 + ldrsh r1, [r2, r3] + adds r0, r1 + adds r1, r5, 0 + adds r1, 0x8A + movs r2, 0 + ldrsh r1, [r1, r2] + cmp r0, r1 + bne _0807B43C + adds r0, r5, 0 + adds r0, 0x44 + movs r1, 0x1 + bl sub_8044C94 + ldr r3, _0807B438 + adds r1, r5, r3 + movs r0, 0x1 + strb r0, [r1] + b _0807B5CE + .align 2, 0 +_0807B434: .4byte gUnknown_80F4448 +_0807B438: .4byte 0x00000147 +_0807B43C: + adds r1, r5, 0 + adds r1, 0x79 + movs r0, 0x1 + strb r0, [r1] +_0807B444: + mov r3, sp + mov r2, sp + mov r1, sp + add r0, sp, 0x28 + movs r4, 0x1 + strb r4, [r0] + add r0, sp, 0x20 + strb r4, [r0] + strb r4, [r1, 0x18] + strb r4, [r2, 0x10] + strb r4, [r3, 0x8] + ldrb r6, [r5, 0x6] + cmp r6, 0 + bne _0807B4C8 + mov r0, r8 + ands r0, r4 + cmp r0, 0 + beq _0807B4C8 + mov r1, r9 + movs r2, 0x4 + ldrsh r0, [r1, r2] + adds r1, r5, 0 + adds r1, 0x88 + movs r3, 0 + ldrsh r1, [r1, r3] + subs r2, r0, r1 + cmp r2, 0 + bge _0807B47E + negs r2, r2 +_0807B47E: + mov r0, r9 + movs r3, 0x6 + ldrsh r1, [r0, r3] + adds r0, r5, 0 + adds r0, 0x8A + movs r3, 0 + ldrsh r0, [r0, r3] + subs r1, r0 + cmp r1, 0 + bge _0807B494 + negs r1, r1 +_0807B494: + cmp r2, 0x2 + bgt _0807B4C8 + cmp r1, 0x2 + bgt _0807B4C8 + cmp r2, r1 + beq _0807B4C8 + movs r3, 0x2 + mov r0, r8 + ands r3, r0 + cmp r3, 0 + beq _0807B4BA + cmp r2, r1 + bge _0807B4B4 + mov r0, sp + strb r6, [r0, 0x10] + b _0807B4C8 +_0807B4B4: + mov r0, sp + strb r6, [r0, 0x8] + b _0807B4C8 +_0807B4BA: + cmp r2, r1 + bge _0807B4C4 + mov r0, sp + strb r3, [r0, 0x8] + b _0807B4C8 +_0807B4C4: + mov r0, sp + strb r3, [r0, 0x10] +_0807B4C8: + movs r1, 0x3 + mov r10, r1 + mov r0, r9 + adds r1, r7, 0 + bl sub_8071518 + lsls r0, 24 + cmp r0, 0 + bne _0807B4E4 + adds r0, r5, 0 + adds r0, 0x7B + ldrb r0, [r0] + cmp r0, 0 + beq _0807B4E8 +_0807B4E4: + movs r2, 0x5 + mov r10, r2 +_0807B4E8: + movs r6, 0x1 + adds r3, r5, 0 + adds r3, 0x44 + str r3, [sp, 0x34] + cmp r6, r10 + bge _0807B53C + mov r3, sp + mov r4, sp + adds r4, 0xA + add r7, sp, 0x8 +_0807B4FC: + lsls r0, r6, 3 + add r2, sp, 0x4 + adds r2, r0 + ldr r1, _0807B598 + lsls r0, r6, 2 + adds r0, r1 + ldr r1, [r0] + add r1, r8 + movs r0, 0x7 + ands r1, r0 + str r1, [r2] + mov r0, r9 + adds r2, r4, 0 + str r3, [sp, 0x38] + bl sub_8071214 + strb r0, [r7, 0x1] + lsls r0, 24 + ldr r3, [sp, 0x38] + cmp r0, 0 + bne _0807B532 + ldrb r0, [r4] + cmp r0, 0 + bne _0807B532 + movs r0, 0x1 + strb r0, [r3, 0x10] + strb r0, [r3, 0x8] +_0807B532: + adds r4, 0x8 + adds r7, 0x8 + adds r6, 0x1 + cmp r6, r10 + blt _0807B4FC +_0807B53C: + movs r6, 0x1 + cmp r6, r10 + bge _0807B56E + adds r3, r5, 0 + adds r3, 0x79 + add r1, sp, 0x8 + movs r4, 0x8 + movs r7, 0x1 +_0807B54C: + adds r2, r4, 0 + ldrb r0, [r1, 0x1] + cmp r0, 0 + beq _0807B55A + ldrb r0, [r1] + cmp r0, 0 + bne _0807B5A0 +_0807B55A: + ldrb r0, [r1, 0x2] + cmp r0, 0 + beq _0807B562 + strb r7, [r3] +_0807B562: + adds r1, 0x8 + adds r4, r2, 0 + adds r4, 0x8 + adds r6, 0x1 + cmp r6, r10 + blt _0807B54C +_0807B56E: + ldr r0, [sp, 0x34] + movs r1, 0x1 + bl sub_8044C94 + ldr r1, _0807B59C + adds r0, r5, r1 + movs r1, 0 + movs r2, 0x1 + strb r2, [r0] + ldrb r0, [r5, 0x7] + cmp r0, 0 + beq _0807B5BC + adds r0, r5, 0 + adds r0, 0x79 + strb r1, [r0] + movs r2, 0xA2 + lsls r2, 1 + adds r0, r5, r2 + strb r1, [r0] + b _0807B5CE + .align 2, 0 +_0807B598: .4byte gUnknown_80F4D04 +_0807B59C: .4byte 0x00000147 +_0807B5A0: + movs r3, 0x2 + ldrsh r1, [r5, r3] + ldr r0, [sp, 0x34] + bl sub_8044CA0 + add r0, sp, 0x4 + adds r0, r4 + ldr r0, [r0] + movs r1, 0x7 + ands r0, r1 + adds r1, r5, 0 + adds r1, 0x46 + strb r0, [r1] + b _0807B5CE +_0807B5BC: + adds r0, r5, 0 + adds r0, 0x79 + ldrb r0, [r0] + cmp r0, 0 + beq _0807B5CE + movs r1, 0xA2 + lsls r1, 1 + adds r0, r5, r1 + strb r2, [r0] +_0807B5CE: + add sp, 0x3C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_807B2D8 + + thumb_func_start sub_807B5E0 +sub_807B5E0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x30 + adds r7, r0, 0 + ldr r0, _0807B61C + str r0, [sp, 0x8] + ldr r1, [r7, 0x70] + str r1, [sp, 0x10] + adds r0, r7, 0 + bl sub_80450FC + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r0, _0807B620 + ldr r1, [r0] + ldr r2, _0807B624 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _0807B62C + ldr r3, _0807B628 + adds r0, r1, r3 + movs r4, 0x14 + mov r9, r4 + b _0807B64C + .align 2, 0 +_0807B61C: .4byte 0x000f423f +_0807B620: .4byte gUnknown_203B418 +_0807B624: .4byte 0x000037fc +_0807B628: .4byte 0x000135cc +_0807B62C: + ldr r2, [sp, 0x10] + ldrb r0, [r2, 0x6] + cmp r0, 0 + beq _0807B644 + ldr r3, _0807B640 + adds r0, r1, r3 + movs r4, 0x4 + mov r9, r4 + b _0807B64C + .align 2, 0 +_0807B640: .4byte 0x0001357c +_0807B644: + ldr r2, _0807B790 + adds r0, r1, r2 + movs r3, 0x10 + mov r9, r3 +_0807B64C: + movs r4, 0 + str r4, [sp, 0xC] + movs r1, 0xFF + str r1, [sp, 0x4] + mov r8, r4 + cmp r4, r9 + bge _0807B6D8 + adds r6, r0, 0 +_0807B65C: + ldr r4, [r6] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807B6CE + adds r0, r7, 0 + adds r1, r4, 0 + bl sub_8045990 + lsls r0, 24 + cmp r0, 0 + beq _0807B6CE + ldr r0, _0807B794 + ldr r0, [r0] + ldr r2, _0807B798 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _0807B69A + adds r0, r7, 0 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_8071598 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0807B6CE +_0807B69A: + adds r1, r4, 0x4 + adds r0, r7, 0x4 + bl sub_8098434 + ldr r3, [sp, 0x8] + cmp r3, r0 + ble _0807B6CE + str r0, [sp, 0x8] + str r4, [sp, 0xC] + adds r0, r4, 0 + bl sub_80450FC + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4] + ldr r1, [sp, 0x10] + adds r1, 0x88 + ldr r4, [sp, 0xC] + ldr r0, [r4, 0x4] + str r0, [r1] + ldr r0, [sp, 0x10] + movs r2, 0xB6 + lsls r2, 1 + adds r1, r0, r2 + ldr r0, [r4, 0x4] + str r0, [r1] +_0807B6CE: + adds r6, 0x4 + movs r3, 0x1 + add r8, r3 + cmp r8, r9 + blt _0807B65C +_0807B6D8: + ldr r0, _0807B79C + ldr r4, [sp, 0x8] + cmp r4, r0 + bne _0807B6E2 + b _0807B906 +_0807B6E2: + ldr r0, [sp, 0x10] + adds r0, 0x88 + str r0, [sp, 0x28] + ldr r1, [sp, 0x10] + adds r1, 0x78 + str r1, [sp, 0x24] + ldr r2, [sp, 0x4] + cmp r10, r2 + beq _0807B6F6 + b _0807B8E0 +_0807B6F6: + mov r3, r10 + cmp r3, 0xFF + bne _0807B6FE + b _0807B8E0 +_0807B6FE: + movs r4, 0x4 + ldrsh r0, [r7, r4] + movs r2, 0x6 + ldrsh r1, [r7, r2] + bl sub_804954C + ldrh r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0807B7B2 + ldrh r0, [r7, 0x6] + lsls r0, 16 + ldrh r5, [r7, 0x4] + orrs r5, r0 + movs r4, 0 +_0807B71E: + ldr r1, _0807B7A0 + lsls r0, r4, 2 + adds r0, r1 + ldrh r1, [r0] + ldrh r3, [r7, 0x4] + adds r1, r3 + lsls r1, 16 + ldrh r0, [r0, 0x2] + ldrh r2, [r7, 0x6] + adds r0, r2 + lsls r0, 16 + lsrs r5, r1, 16 + orrs r5, r0 + lsls r0, r5, 16 + asrs r0, 16 + asrs r1, r5, 16 + bl sub_804954C + ldrb r0, [r0, 0x9] + cmp r0, r10 + beq _0807B758 + adds r0, r7, 0 + adds r1, r4, 0 + mov r2, sp + bl sub_8071214 + lsls r0, 24 + cmp r0, 0 + bne _0807B75E +_0807B758: + adds r4, 0x1 + cmp r4, 0x7 + ble _0807B71E +_0807B75E: + cmp r4, 0x8 + bne _0807B7A4 + movs r0, 0x8 + bl sub_8084100 + adds r4, r0, 0 + movs r0, 0x6 + ldr r3, [sp, 0x24] + strb r0, [r3] + ldr r0, _0807B7A0 + lsls r1, r4, 2 + adds r1, r0 + ldrh r0, [r1] + ldrh r4, [r7, 0x4] + adds r0, r4 + ldr r2, [sp, 0x28] + strh r0, [r2] + ldrh r0, [r1, 0x2] + ldrh r7, [r7, 0x6] + adds r0, r7 + ldr r1, [sp, 0x10] + adds r1, 0x8A + strh r0, [r1] + movs r0, 0x1 + b _0807B910 + .align 2, 0 +_0807B790: .4byte 0x0001358c +_0807B794: .4byte gUnknown_203B418 +_0807B798: .4byte 0x000037fc +_0807B79C: .4byte 0x000f423f +_0807B7A0: .4byte gUnknown_80F4448 +_0807B7A4: + movs r0, 0x5 + ldr r3, [sp, 0x24] + strb r0, [r3] + ldr r4, [sp, 0x28] + str r5, [r4] + movs r0, 0x1 + b _0807B910 +_0807B7B2: + ldr r0, _0807B8D0 + mov r2, r10 + lsls r1, r2, 7 + ldr r3, _0807B8D4 + adds r1, r3 + ldr r0, [r0] + adds r1, r0, r1 + str r1, [sp, 0x18] + lsls r1, r2, 1 + ldr r4, _0807B8D8 + adds r0, r4 + adds r0, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + str r1, [sp, 0x14] + ldr r3, _0807B8DC + str r3, [sp, 0x20] + movs r4, 0 + str r4, [sp, 0x1C] + ldr r0, [sp, 0xC] + movs r1, 0x4 + ldrsh r3, [r0, r1] + movs r2, 0x4 + ldrsh r0, [r7, r2] + subs r2, r3, r0 + cmp r2, 0 + bge _0807B7EA + negs r2, r2 +_0807B7EA: + ldr r4, [sp, 0xC] + movs r0, 0x6 + ldrsh r1, [r4, r0] + movs r4, 0x6 + ldrsh r0, [r7, r4] + subs r1, r0 + mov r8, r1 + cmp r1, 0 + bge _0807B802 + mov r0, r8 + negs r0, r0 + mov r8, r0 +_0807B802: + cmp r8, r2 + bge _0807B808 + mov r8, r2 +_0807B808: + movs r1, 0 + mov r9, r1 + ldr r2, [sp, 0x10] + adds r2, 0x8A + str r2, [sp, 0x2C] + ldr r4, [sp, 0x1C] + ldr r0, [sp, 0x14] + cmp r4, r0 + bge _0807B8AA + mov r10, r3 + ldr r6, [sp, 0x18] +_0807B81E: + movs r1, 0 + ldrsh r3, [r6, r1] + mov r2, r10 + subs r0, r2, r3 + cmp r0, 0 + bge _0807B82C + negs r0, r0 +_0807B82C: + ldr r4, [sp, 0xC] + movs r1, 0x6 + ldrsh r4, [r4, r1] + mov r12, r4 + movs r4, 0x2 + ldrsh r2, [r6, r4] + mov r4, r12 + subs r1, r4, r2 + cmp r1, 0 + bge _0807B842 + negs r1, r1 +_0807B842: + cmp r1, r0 + bge _0807B848 + adds r1, r0, 0 +_0807B848: + movs r0, 0x4 + ldrsh r4, [r7, r0] + subs r0, r3, r4 + movs r3, 0x6 + ldrsh r5, [r7, r3] + subs r3, r2, r5 + movs r2, 0x1 + negs r2, r2 + cmp r0, r2 + bge _0807B85E + adds r0, r2, 0 +_0807B85E: + cmp r3, r2 + bge _0807B864 + adds r3, r2, 0 +_0807B864: + cmp r0, 0x1 + ble _0807B86A + movs r0, 0x1 +_0807B86A: + cmp r3, 0x1 + ble _0807B870 + movs r3, 0x1 +_0807B870: + adds r0, r4, r0 + mov r4, r10 + subs r2, r4, r0 + cmp r2, 0 + bge _0807B87C + negs r2, r2 +_0807B87C: + adds r0, r5, r3 + mov r3, r12 + subs r0, r3, r0 + cmp r0, 0 + bge _0807B888 + negs r0, r0 +_0807B888: + cmp r0, r2 + bge _0807B88E + adds r0, r2, 0 +_0807B88E: + cmp r0, r8 + blt _0807B89E + ldr r4, [sp, 0x20] + cmp r4, r1 + bge _0807B89E + mov r0, r9 + str r0, [sp, 0x1C] + str r1, [sp, 0x20] +_0807B89E: + adds r6, 0x4 + movs r1, 0x1 + add r9, r1 + ldr r2, [sp, 0x14] + cmp r9, r2 + blt _0807B81E +_0807B8AA: + ldr r3, [sp, 0x20] + cmp r3, 0 + blt _0807B8E0 + movs r0, 0x5 + ldr r4, [sp, 0x24] + strb r0, [r4] + ldr r1, [sp, 0x1C] + lsls r0, r1, 2 + ldr r2, [sp, 0x18] + adds r0, r2 + ldrh r1, [r0] + ldr r3, [sp, 0x28] + strh r1, [r3] + ldrh r0, [r0, 0x2] + ldr r4, [sp, 0x2C] + strh r0, [r4] + movs r0, 0x1 + b _0807B910 + .align 2, 0 +_0807B8D0: .4byte gUnknown_203B418 +_0807B8D4: .4byte 0x00010884 +_0807B8D8: .4byte 0x00010844 +_0807B8DC: .4byte 0xfff0bdc1 +_0807B8E0: + movs r0, 0x5 + ldr r1, [sp, 0x24] + strb r0, [r1] + ldr r2, [sp, 0xC] + ldrh r1, [r2, 0x4] + ldrh r0, [r7, 0x4] + subs r1, r0 + subs r0, r1 + ldr r3, [sp, 0x28] + strh r0, [r3] + ldrh r0, [r2, 0x6] + ldrh r1, [r7, 0x6] + subs r0, r1 + subs r1, r0 + ldr r0, [sp, 0x10] + adds r0, 0x8A + strh r1, [r0] + movs r0, 0x1 + b _0807B910 +_0807B906: + adds r0, r7, 0 + bl sub_807B920 + lsls r0, 24 + lsrs r0, 24 +_0807B910: + add sp, 0x30 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_807B5E0 + + thumb_func_start sub_807B920 +sub_807B920: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + adds r6, r0, 0 + ldr r7, [r6, 0x70] + bl sub_80450FC + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0xFF + bne _0807B9DC + movs r0, 0 + str r0, [sp, 0x4] + adds r4, r7, 0 + adds r4, 0x46 + ldrb r0, [r4] + adds r0, 0x4 + mov r8, r0 + movs r0, 0x7 + mov r1, r8 + ands r1, r0 + mov r8, r1 + adds r0, r6, 0 + bl sub_807138C + lsls r0, 24 + mov r9, r4 + cmp r0, 0 + beq _0807B96C + movs r0, 0x8 + bl sub_8084100 + strb r0, [r4] + movs r2, 0x1 + str r2, [sp, 0x4] +_0807B96C: + movs r3, 0 + movs r4, 0x78 + adds r4, r7 + mov r10, r4 + adds r0, r7, 0 + adds r0, 0x88 + str r0, [sp, 0x8] + adds r7, 0x8A + ldr r5, _0807B9D4 +_0807B97E: + mov r1, r9 + ldrb r0, [r1] + ldr r1, [r5] + adds r4, r0, r1 + movs r0, 0x7 + ands r4, r0 + ldr r2, [sp, 0x4] + cmp r2, 0 + beq _0807B994 + cmp r4, r8 + beq _0807B9AA +_0807B994: + adds r0, r6, 0 + adds r1, r4, 0 + mov r2, sp + str r3, [sp, 0xC] + bl sub_8071214 + lsls r0, 24 + ldr r3, [sp, 0xC] + cmp r0, 0 + beq _0807B9AA + b _0807BB42 +_0807B9AA: + adds r5, 0x4 + adds r3, 0x1 + cmp r3, 0x7 + ble _0807B97E + movs r0, 0x8 + bl sub_8084100 + movs r1, 0x6 + mov r3, r10 + strb r1, [r3] + ldr r1, _0807B9D8 + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0] + ldrh r4, [r6, 0x4] + adds r1, r4 + ldr r2, [sp, 0x8] + strh r1, [r2] + ldrh r0, [r0, 0x2] + b _0807BB5A + .align 2, 0 +_0807B9D4: .4byte gUnknown_80F4D04 +_0807B9D8: .4byte gUnknown_80F4448 +_0807B9DC: + ldr r0, _0807BA30 + ldr r2, [r0] + lsls r1, r3, 1 + ldr r4, _0807BA34 + adds r0, r2, r4 + adds r0, r1 + movs r4, 0 + ldrsh r1, [r0, r4] + mov r8, r1 + lsls r0, r3, 7 + ldr r1, _0807BA38 + adds r0, r1 + adds r2, r0 + mov r9, r2 + movs r2, 0x8A + lsls r2, 1 + adds r0, r7, r2 + ldr r0, [r0] + cmp r0, 0 + beq _0807BA40 + movs r0, 0x8 + bl sub_8084100 + adds r2, r7, 0 + adds r2, 0x78 + movs r1, 0x6 + strb r1, [r2] + ldr r1, _0807BA3C + lsls r0, 2 + adds r0, r1 + ldrh r1, [r0] + ldrh r3, [r6, 0x4] + adds r1, r3 + adds r2, 0x10 + strh r1, [r2] + ldrh r0, [r0, 0x2] + ldrh r6, [r6, 0x6] + adds r0, r6 + adds r1, r7, 0 + adds r1, 0x8A + strh r0, [r1] + b _0807BB60 + .align 2, 0 +_0807BA30: .4byte gUnknown_203B418 +_0807BA34: .4byte 0x00010844 +_0807BA38: .4byte 0x00010884 +_0807BA3C: .4byte gUnknown_80F4448 +_0807BA40: + adds r0, r7, 0 + adds r0, 0x78 + ldrb r1, [r0] + mov r10, r0 + cmp r1, 0x4 + beq _0807BAA2 + mov r4, r8 + cmp r4, 0 + bne _0807BA84 + movs r0, 0x8 + bl sub_8084100 + adds r4, r0, 0 + movs r0, 0x6 + mov r1, r10 + strb r0, [r1] + ldr r0, _0807BA80 + lsls r2, r4, 2 + adds r2, r0 + ldrh r0, [r2] + ldrh r3, [r6, 0x4] + adds r0, r3 + adds r1, r7, 0 + adds r1, 0x88 + strh r0, [r1] + ldrh r0, [r2, 0x2] + ldrh r6, [r6, 0x6] + adds r0, r6 + adds r1, 0x2 + strh r0, [r1] + b _0807BB60 + .align 2, 0 +_0807BA80: .4byte gUnknown_80F4448 +_0807BA84: + movs r5, 0 +_0807BA86: + mov r0, r8 + bl sub_8084100 + adds r4, r0, 0 + ldr r0, [r6, 0x4] + lsls r1, r4, 2 + mov r4, r9 + adds r2, r1, r4 + ldr r1, [r2] + cmp r0, r1 + bne _0807BB18 + adds r5, 0x1 + cmp r5, 0x9 + ble _0807BA86 +_0807BAA2: + movs r1, 0x4 + ldrsh r0, [r6, r1] + movs r2, 0x6 + ldrsh r1, [r6, r2] + bl sub_804954C + ldrh r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0807BB60 + movs r0, 0x8 + bl sub_8084100 + adds r4, r0, 0 + movs r3, 0 + mov r9, r3 +_0807BAC4: + movs r0, 0x7 + ands r4, r0 + movs r0, 0x4 + ldrsh r2, [r6, r0] + ldr r0, _0807BB14 + lsls r1, r4, 2 + adds r1, r0 + movs r3, 0 + ldrsh r0, [r1, r3] + adds r2, r0 + mov r8, r2 + movs r0, 0x6 + ldrsh r2, [r6, r0] + movs r3, 0x2 + ldrsh r0, [r1, r3] + adds r5, r2, r0 + mov r0, r8 + adds r1, r5, 0 + bl sub_804954C + ldrb r0, [r0, 0x9] + cmp r0, 0xFF + bne _0807BB04 + adds r0, r6, 0 + adds r1, r4, 0 + mov r2, sp + adds r2, 0x1 + bl sub_8071214 + lsls r0, 24 + cmp r0, 0 + bne _0807BB2E +_0807BB04: + movs r0, 0x1 + add r9, r0 + adds r4, 0x1 + mov r1, r9 + cmp r1, 0x7 + ble _0807BAC4 + b _0807BB60 + .align 2, 0 +_0807BB14: .4byte gUnknown_80F4448 +_0807BB18: + movs r0, 0x4 + mov r3, r10 + strb r0, [r3] + ldrh r1, [r2] + adds r0, r7, 0 + adds r0, 0x88 + strh r1, [r0] + ldrh r1, [r2, 0x2] + adds r0, 0x2 + strh r1, [r0] + b _0807BB60 +_0807BB2E: + movs r0, 0x3 + mov r4, r10 + strb r0, [r4] + adds r0, r7, 0 + adds r0, 0x88 + mov r1, r8 + strh r1, [r0] + adds r0, 0x2 + strh r5, [r0] + b _0807BB60 +_0807BB42: + movs r0, 0x3 + mov r2, r10 + strb r0, [r2] + ldr r0, _0807BB74 + lsls r1, r4, 2 + adds r1, r0 + ldrh r0, [r1] + ldrh r3, [r6, 0x4] + adds r0, r3 + ldr r4, [sp, 0x8] + strh r0, [r4] + ldrh r0, [r1, 0x2] +_0807BB5A: + ldrh r6, [r6, 0x6] + adds r0, r6 + strh r0, [r7] +_0807BB60: + movs r0, 0x1 + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0807BB74: .4byte gUnknown_80F4448 + thumb_func_end sub_807B920 + + thumb_func_start sub_807BB78 +sub_807BB78: + ldr r3, [r0, 0x70] + adds r1, r3, 0 + adds r1, 0x78 + movs r2, 0 + strb r2, [r1] + adds r1, 0x10 + ldr r0, [r0, 0x4] + str r0, [r1] + adds r0, r3, 0 + adds r0, 0x80 + str r2, [r0] + subs r0, 0x4 + strh r2, [r0] + bx lr + thumb_func_end sub_807BB78 + + thumb_func_start sub_807BB94 +sub_807BB94: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x5C + mov r10, r0 + ldr r0, [r0, 0x70] + mov r8, r0 + mov r0, r10 + movs r1, 0 + bl sub_8070D04 + lsls r0, 24 + cmp r0, 0 + beq _0807BBB6 + b _0807C03A +_0807BBB6: + mov r0, r10 + movs r1, 0x1 + bl sub_8071518 + lsls r0, 24 + cmp r0, 0 + beq _0807BBC6 + b _0807C03A +_0807BBC6: + mov r0, r10 + movs r1, 0x8 + bl sub_80718AC + lsls r0, 24 + cmp r0, 0 + beq _0807BBD6 + b _0807C03A +_0807BBD6: + mov r0, r8 + adds r0, 0xBC + ldrb r0, [r0] + cmp r0, 0x2 + bne _0807BBF2 + ldr r0, _0807BC70 + movs r1, 0 + ldrsh r0, [r0, r1] + bl sub_8084144 + lsls r0, 24 + cmp r0, 0 + beq _0807BBF2 + b _0807C03A +_0807BBF2: + mov r0, r8 + adds r0, 0xC0 + ldrb r1, [r0] + str r0, [sp, 0x50] + cmp r1, 0 + beq _0807BC7C + movs r5, 0 + movs r4, 0x8C + lsls r4, 1 + add r4, r8 +_0807BC06: + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0807BC74 + mov r0, r10 + adds r1, r4, 0 + bl sub_80570AC + lsls r0, 24 + cmp r0, 0 + beq _0807BC74 + mov r0, r8 + adds r0, 0xC2 + ldrb r0, [r0] + cmp r0, r5 + bne _0807BC74 + mov r0, r8 + adds r0, 0x44 + movs r1, 0x15 + bl sub_8044C94 + adds r3, r5, 0 + mov r6, r8 + adds r6, 0x48 + cmp r5, 0 + bgt _0807BC3E + b _0807C006 +_0807BC3E: + ldrb r1, [r4] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0807BC4A + b _0807C006 +_0807BC4A: + movs r4, 0x2 + lsls r0, r5, 3 + movs r2, 0x8C + lsls r2, 1 + adds r0, r2 + mov r7, r8 + adds r2, r0, r7 +_0807BC58: + subs r2, 0x8 + subs r3, 0x1 + cmp r3, 0 + bgt _0807BC62 + b _0807C006 +_0807BC62: + ldrb r1, [r2] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + bne _0807BC58 + b _0807C006 + .align 2, 0 +_0807BC70: .4byte gUnknown_80F4DB2 +_0807BC74: + adds r4, 0x8 + adds r5, 0x1 + cmp r5, 0x3 + ble _0807BC06 +_0807BC7C: + movs r0, 0 + str r0, [sp, 0x44] + movs r1, 0 + str r1, [sp, 0x40] + movs r2, 0x8C + lsls r2, 1 + add r2, r8 + movs r4, 0x1 + movs r3, 0x4 + movs r5, 0x3 +_0807BC90: + ldrb r1, [r2] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _0807BCB0 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _0807BCA8 + ldr r7, [sp, 0x40] + adds r7, 0x1 + str r7, [sp, 0x40] +_0807BCA8: + ldrb r0, [r2, 0x4] + ldr r1, [sp, 0x44] + adds r1, r0 + str r1, [sp, 0x44] +_0807BCB0: + adds r2, 0x8 + subs r5, 0x1 + cmp r5, 0 + bge _0807BC90 + ldr r2, [sp, 0x44] + cmp r2, 0 + bne _0807BCF8 + add r4, sp, 0x2C + movs r1, 0xB0 + lsls r1, 1 + adds r0, r4, 0 + bl sub_8092A88 + mov r0, sp + mov r1, r10 + adds r2, r4, 0 + bl sub_807C04C + mov r0, sp + ldrb r0, [r0] + cmp r0, 0 + bne _0807BCDE + b _0807C03A +_0807BCDE: + mov r0, r8 + adds r0, 0x44 + movs r1, 0x17 + bl sub_8044C94 + mov r0, sp + ldrb r1, [r0, 0x1] + movs r0, 0x7 + ands r0, r1 + mov r1, r8 + adds r1, 0x46 + strb r0, [r1] + b _0807C008 +_0807BCF8: + mov r0, r10 + movs r1, 0xB + bl sub_80718D8 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x48] + mov r0, r10 + movs r1, 0x6 + bl sub_80718D8 + lsls r0, 24 + lsrs r0, 24 + negs r1, r0 + orrs r1, r0 + lsrs r1, 31 + str r1, [sp, 0x3C] + movs r7, 0 + str r7, [sp, 0x44] + mov r0, sp + adds r0, 0x28 + str r0, [sp, 0x4C] + adds r2, r0, 0 + movs r1, 0x1 + adds r0, 0x3 +_0807BD2A: + strb r1, [r0] + subs r0, 0x1 + cmp r0, r2 + bge _0807BD2A + ldr r1, [sp, 0x3C] + cmp r1, 0 + beq _0807BDC0 + movs r2, 0x63 + movs r4, 0 + movs r5, 0 + movs r3, 0x8C + lsls r3, 1 + add r3, r8 + b _0807BD98 +_0807BD46: + cmp r5, 0 + beq _0807BD7A + ldrb r1, [r3] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0807BD7A + adds r0, r4, 0x1 + adds r6, r5, 0x1 + cmp r0, r5 + bge _0807BD74 + cmp r2, 0x1 + bgt _0807BD74 + adds r1, r4, 0 + cmp r1, r5 + bge _0807BD74 + ldr r2, [sp, 0x4C] + movs r4, 0 +_0807BD6A: + adds r0, r2, r1 + strb r4, [r0] + adds r1, 0x1 + cmp r1, r5 + blt _0807BD6A +_0807BD74: + ldrb r2, [r3, 0x4] + adds r4, r5, 0 + b _0807BD86 +_0807BD7A: + ldrb r1, [r3, 0x4] + cmp r1, r2 + ble _0807BD82 + adds r1, r2, 0 +_0807BD82: + adds r2, r1, 0 + adds r6, r5, 0x1 +_0807BD86: + adds r5, r6, 0 + cmp r5, 0x3 + bgt _0807BDA2 + lsls r0, r5, 3 + movs r7, 0x8C + lsls r7, 1 + adds r0, r7 + mov r1, r8 + adds r3, r1, r0 +_0807BD98: + ldrb r1, [r3] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0807BD46 +_0807BDA2: + adds r0, r4, 0x1 + cmp r0, r5 + bge _0807BDC0 + cmp r2, 0x1 + bgt _0807BDC0 + adds r1, r4, 0 + cmp r1, r5 + bge _0807BDC0 + ldr r2, [sp, 0x4C] + movs r3, 0 +_0807BDB6: + adds r0, r2, r1 + strb r3, [r0] + adds r1, 0x1 + cmp r1, r5 + blt _0807BDB6 +_0807BDC0: + movs r5, 0 + movs r2, 0 + str r2, [sp, 0x54] + add r4, sp, 0x4 + movs r7, 0x8C + lsls r7, 1 + add r7, r8 + adds r6, r7, 0 + mov r9, sp + mov r0, sp + str r0, [sp, 0x58] +_0807BDD6: + movs r2, 0 + mov r1, r9 + strb r2, [r1] + ldrb r1, [r7] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0807BE64 + ldr r1, [sp, 0x4C] + adds r0, r1, r5 + ldrb r0, [r0] + cmp r0, 0 + beq _0807BE64 + mov r0, r10 + adds r1, r5, 0 + ldr r2, [sp, 0x3C] + bl sub_8057348 + lsls r0, 24 + cmp r0, 0 + beq _0807BE64 + ldrb r1, [r7] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0807BE64 + movs r0, 0x1 + mov r2, r9 + strb r0, [r2] + ldr r1, [sp, 0x50] + ldrb r0, [r1] + cmp r0, 0xB + bne _0807BE38 + ldrh r0, [r7, 0x2] + cmp r0, 0x80 + bne _0807BE24 + movs r2, 0 + str r2, [r4] + b _0807BE64 +_0807BE24: + mov r0, r10 + adds r1, r6, 0 + bl sub_8071A1C + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + beq _0807BE4A + movs r0, 0x1 + b _0807BE54 +_0807BE38: + ldr r1, [sp, 0x48] + cmp r1, 0 + beq _0807BE4A + ldr r0, [sp, 0x58] + mov r1, r10 + adds r2, r6, 0 + bl sub_807C04C + b _0807BE54 +_0807BE4A: + adds r0, r6, 0 + bl sub_8092B90 + lsls r0, 24 + lsrs r0, 24 +_0807BE54: + str r0, [r4] + add r0, sp, 0x4 + ldr r2, [sp, 0x54] + adds r0, r2 + ldr r0, [r0] + ldr r1, [sp, 0x44] + adds r1, r0 + str r1, [sp, 0x44] +_0807BE64: + ldr r2, [sp, 0x54] + adds r2, 0x8 + str r2, [sp, 0x54] + adds r4, 0x8 + adds r7, 0x8 + adds r6, 0x8 + movs r0, 0x8 + add r9, r0 + ldr r1, [sp, 0x58] + adds r1, 0x8 + str r1, [sp, 0x58] + adds r5, 0x1 + cmp r5, 0x3 + ble _0807BDD6 + movs r0, 0 + str r0, [sp, 0x24] + mov r0, r10 + movs r1, 0x17 + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + bne _0807BECA + ldr r2, [sp, 0x50] + ldrb r0, [r2] + cmp r0, 0xB + beq _0807BECA + add r0, sp, 0x20 + movs r1, 0x1 + strb r1, [r0] + ldrb r0, [r2] + cmp r0, 0xB + bne _0807BEAA + str r1, [sp, 0x24] + b _0807BEC2 +_0807BEAA: + ldr r7, [sp, 0x48] + cmp r7, 0 + beq _0807BEB4 + movs r0, 0x2 + b _0807BEC0 +_0807BEB4: + ldr r0, _0807BEE8 + ldr r2, [sp, 0x40] + lsls r1, r2, 1 + adds r1, r0 + movs r7, 0 + ldrsh r0, [r1, r7] +_0807BEC0: + str r0, [sp, 0x24] +_0807BEC2: + ldr r0, [sp, 0x24] + ldr r1, [sp, 0x44] + adds r1, r0 + str r1, [sp, 0x44] +_0807BECA: + ldr r2, [sp, 0x48] + cmp r2, 0 + beq _0807BF2A + movs r5, 0 + movs r7, 0 + str r7, [sp, 0x44] + add r0, sp, 0x4 + adds r3, r0, 0 + mov r2, sp + movs r4, 0x4 +_0807BEDE: + ldrb r1, [r2] + cmp r1, 0 + bne _0807BEEC + str r1, [r3] + b _0807BEF4 + .align 2, 0 +_0807BEE8: .4byte gUnknown_80F4E22 +_0807BEEC: + ldr r1, [r3] + cmp r5, r1 + bge _0807BEF4 + adds r5, r1, 0 +_0807BEF4: + adds r3, 0x8 + adds r2, 0x8 + subs r4, 0x1 + cmp r4, 0 + bge _0807BEDE + movs r4, 0 + movs r6, 0 + adds r1, r0, 0 + adds r3, r1, 0 + mov r2, sp +_0807BF08: + ldrb r0, [r2] + cmp r0, 0 + beq _0807BF1E + ldr r0, [r1] + cmp r5, r0 + beq _0807BF16 + str r6, [r1] +_0807BF16: + ldr r0, [r3] + ldr r7, [sp, 0x44] + adds r7, r0 + str r7, [sp, 0x44] +_0807BF1E: + adds r1, 0x8 + adds r3, 0x8 + adds r2, 0x8 + adds r4, 0x1 + cmp r4, 0x4 + ble _0807BF08 +_0807BF2A: + ldr r0, [sp, 0x44] + cmp r0, 0 + bne _0807BF32 + b _0807C03A +_0807BF32: + bl sub_8084100 + str r0, [sp, 0x38] + movs r1, 0 + mov r9, r1 + mov r0, r10 + movs r1, 0x17 + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + bne _0807BF5A + add r1, sp, 0x34 + mov r0, r10 + movs r2, 0x1 + bl sub_807C854 + lsls r0, 24 + lsrs r6, r0, 24 + b _0807BF5E +_0807BF5A: + movs r6, 0 + str r6, [sp, 0x34] +_0807BF5E: + movs r5, 0 + mov r4, sp + movs r7, 0 +_0807BF64: + ldrb r0, [r4] + cmp r0, 0 + beq _0807C010 + add r0, sp, 0x4 + adds r0, r7 + ldr r0, [r0] + cmp r0, 0 + beq _0807C010 + add r9, r0 + ldr r2, [sp, 0x38] + cmp r9, r2 + blt _0807C010 + cmp r5, 0x4 + bne _0807BF9C + cmp r6, 0 + beq _0807C03A + mov r0, r8 + adds r0, 0x44 + movs r1, 0x32 + bl sub_8044C94 + ldr r0, [sp, 0x34] + movs r1, 0x7 + ands r0, r1 + mov r1, r8 + adds r1, 0x46 + strb r0, [r1] + b _0807C008 +_0807BF9C: + movs r0, 0x8C + lsls r0, 1 + mov r9, r0 + adds r2, r7, r0 + add r2, r8 + adds r0, r4, 0 + mov r1, r10 + bl sub_807C04C + ldrb r0, [r4] + cmp r0, 0 + beq _0807C01A + mov r0, r8 + adds r0, 0x44 + movs r1, 0x15 + bl sub_8044C94 + adds r3, r5, 0 + mov r6, r8 + adds r6, 0x48 + movs r1, 0x46 + add r1, r8 + mov r12, r1 + cmp r5, 0 + ble _0807BFFC + mov r2, r8 + adds r0, r2, r7 + add r0, r9 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0807BFFC + movs r7, 0x2 + lsls r0, r5, 3 + movs r1, 0x8C + lsls r1, 1 + adds r0, r1 + adds r2, r0, r2 +_0807BFEA: + subs r2, 0x8 + subs r3, 0x1 + cmp r3, 0 + ble _0807BFFC + ldrb r1, [r2] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + bne _0807BFEA +_0807BFFC: + ldrb r1, [r4, 0x1] + movs r0, 0x7 + ands r0, r1 + mov r2, r12 + strb r0, [r2] +_0807C006: + strb r3, [r6] +_0807C008: + mov r0, r10 + bl sub_8069DCC + b _0807C03A +_0807C010: + adds r4, 0x8 + adds r7, 0x8 + adds r5, 0x1 + cmp r5, 0x4 + ble _0807BF64 +_0807C01A: + cmp r6, 0 + beq _0807C03A + mov r0, r8 + adds r0, 0x44 + movs r1, 0x32 + bl sub_8044C94 + ldr r0, [sp, 0x34] + movs r1, 0x7 + ands r0, r1 + mov r1, r8 + adds r1, 0x46 + strb r0, [r1] + mov r0, r10 + bl sub_8069DCC +_0807C03A: + add sp, 0x5C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_807BB94 + + thumb_func_start sub_807C04C +sub_807C04C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + str r0, [sp, 0x8] + adds r6, r1, 0 + mov r10, r2 + movs r0, 0x1 + str r0, [sp, 0x10] + ldr r4, [r6, 0x70] + movs r1, 0 + mov r8, r1 + ldr r1, _0807C0C8 + movs r2, 0 + adds r0, r1, 0x7 +_0807C06E: + strb r2, [r0] + subs r0, 0x1 + cmp r0, r1 + bge _0807C06E + adds r0, r6, 0 + mov r1, r10 + movs r2, 0x1 + bl sub_807CD64 + lsls r0, 16 + asrs r0, 16 + str r0, [sp, 0xC] + adds r0, r6, 0 + movs r1, 0x8 + bl sub_80718D8 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x14] + movs r0, 0 + ldr r2, [sp, 0x8] + strb r0, [r2] + adds r0, r4, 0 + adds r0, 0xBC + ldrb r0, [r0] + cmp r0, 0x5 + bne _0807C0B0 + mov r0, r10 + bl sub_8092C54 + lsls r0, 24 + cmp r0, 0 + beq _0807C0C4 +_0807C0B0: + ldr r3, [sp, 0x14] + cmp r3, 0 + beq _0807C0CC + adds r0, r6, 0 + mov r1, r10 + bl sub_805C498 + lsls r0, 24 + cmp r0, 0 + bne _0807C0CC +_0807C0C4: + movs r0, 0x1 + b _0807C48C + .align 2, 0 +_0807C0C8: .4byte gUnknown_202F380 +_0807C0CC: + movs r0, 0xF0 + ldr r1, [sp, 0xC] + ands r0, r1 + cmp r0, 0 + beq _0807C0DE + cmp r0, 0x10 + beq _0807C0DE + cmp r0, 0x20 + bne _0807C19C +_0807C0DE: + adds r0, r4, 0 + adds r0, 0xE8 + ldrb r1, [r0] + cmp r1, 0x1 + bne _0807C128 + subs r0, 0xA2 + ldrb r7, [r0] + ldr r0, _0807C118 + adds r0, r7, r0 + ldrb r3, [r0] + cmp r3, 0 + beq _0807C0F8 + b _0807C3F6 +_0807C0F8: + strb r1, [r0] + ldr r0, _0807C11C + add r0, r8 + strb r7, [r0] + ldr r0, _0807C120 + mov r4, r8 + lsls r2, r4, 2 + adds r0, r2, r0 + movs r1, 0x63 + str r1, [r0] + ldr r0, _0807C124 + adds r2, r0 + str r3, [r2] + movs r0, 0x1 + add r8, r0 + b _0807C3F6 + .align 2, 0 +_0807C118: .4byte gUnknown_202F380 +_0807C11C: .4byte gUnknown_202F388 +_0807C120: .4byte gUnknown_202F390 +_0807C124: .4byte gUnknown_202F3B0 +_0807C128: + movs r7, 0 + movs r0, 0xF0 + ldr r1, [sp, 0xC] + ands r0, r1 + lsls r5, r0, 16 +_0807C132: + movs r2, 0x4 + ldrsh r0, [r6, r2] + ldr r1, _0807C198 + lsls r2, r7, 2 + adds r2, r1 + movs r3, 0 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r4, 0x6 + ldrsh r1, [r6, r4] + movs r3, 0x2 + ldrsh r2, [r2, r3] + adds r1, r2 + bl sub_804954C + ldr r4, [r0, 0x10] + cmp r4, 0 + beq _0807C18E + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0x1 + bne _0807C18E + asrs r0, r5, 16 + cmp r0, 0x10 + beq _0807C178 + cmp r0, 0x20 + beq _0807C178 + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_8071138 + lsls r0, 24 + cmp r0, 0 + beq _0807C18E +_0807C178: + mov r0, r10 + str r0, [sp] + ldr r1, [sp, 0x14] + str r1, [sp, 0x4] + mov r0, r8 + ldr r1, [sp, 0xC] + adds r2, r6, 0 + adds r3, r4, 0 + bl sub_807C580 + mov r8, r0 +_0807C18E: + adds r7, 0x1 + cmp r7, 0x7 + ble _0807C132 + b _0807C3F6 + .align 2, 0 +_0807C198: .4byte gUnknown_80F4448 +_0807C19C: + cmp r0, 0x30 + bne _0807C1F0 + movs r5, 0 +_0807C1A2: + ldr r0, _0807C1E8 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _0807C1EC + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807C1E0 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_8045990 + lsls r0, 24 + cmp r0, 0 + beq _0807C1E0 + mov r3, r10 + str r3, [sp] + ldr r0, [sp, 0x14] + str r0, [sp, 0x4] + mov r0, r8 + ldr r1, [sp, 0xC] + adds r2, r6, 0 + adds r3, r4, 0 + bl sub_807C580 + mov r8, r0 +_0807C1E0: + adds r5, 0x1 + cmp r5, 0x13 + ble _0807C1A2 + b _0807C3F6 + .align 2, 0 +_0807C1E8: .4byte gUnknown_203B418 +_0807C1EC: .4byte 0x000135cc +_0807C1F0: + cmp r0, 0x40 + bne _0807C2A8 + movs r7, 0 + ldr r1, _0807C2A4 + mov r9, r1 +_0807C1FA: + movs r2, 0x4 + ldrsh r0, [r6, r2] + mov r3, r9 + movs r4, 0 + ldrsh r1, [r3, r4] + adds r0, r1 + movs r2, 0x6 + ldrsh r1, [r6, r2] + movs r4, 0x2 + ldrsh r2, [r3, r4] + adds r1, r2 + bl sub_804954C + adds r4, r0, 0 + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_8071138 + lsls r0, 24 + cmp r0, 0 + beq _0807C296 + ldr r5, [r4, 0x10] + cmp r5, 0 + beq _0807C250 + adds r0, r5, 0 + bl sub_80450F8 + cmp r0, 0x1 + bne _0807C250 + mov r4, r8 + mov r0, r10 + str r0, [sp] + ldr r1, [sp, 0x14] + str r1, [sp, 0x4] + adds r0, r4, 0 + ldr r1, [sp, 0xC] + adds r2, r6, 0 + adds r3, r5, 0 + bl sub_807C580 + mov r8, r0 + cmp r4, r8 + bne _0807C296 +_0807C250: + movs r2, 0x4 + ldrsh r0, [r6, r2] + mov r3, r9 + movs r4, 0 + ldrsh r1, [r3, r4] + lsls r1, 1 + adds r0, r1 + movs r2, 0x6 + ldrsh r1, [r6, r2] + movs r4, 0x2 + ldrsh r2, [r3, r4] + lsls r2, 1 + adds r1, r2 + bl sub_804954C + adds r4, r0, 0 + ldr r5, [r4, 0x10] + cmp r5, 0 + beq _0807C296 + adds r0, r5, 0 + bl sub_80450F8 + cmp r0, 0x1 + bne _0807C296 + mov r0, r10 + str r0, [sp] + ldr r1, [sp, 0x14] + str r1, [sp, 0x4] + mov r0, r8 + ldr r1, [sp, 0xC] + adds r2, r6, 0 + adds r3, r5, 0 + bl sub_807C580 + mov r8, r0 +_0807C296: + movs r2, 0x4 + add r9, r2 + adds r7, 0x1 + cmp r7, 0x7 + ble _0807C1FA + b _0807C3F6 + .align 2, 0 +_0807C2A4: .4byte gUnknown_80F4448 +_0807C2A8: + cmp r0, 0x50 + beq _0807C2B0 + cmp r0, 0x80 + bne _0807C394 +_0807C2B0: + movs r3, 0x1 + str r3, [sp, 0x18] + cmp r0, 0x50 + bne _0807C2BC + movs r4, 0xA + str r4, [sp, 0x18] +_0807C2BC: + movs r0, 0 + mov r9, r0 +_0807C2C0: + ldr r0, _0807C37C + ldr r0, [r0] + mov r2, r9 + lsls r1, r2, 2 + ldr r3, _0807C380 + adds r0, r3 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807C370 + cmp r6, r4 + beq _0807C370 + adds r1, r4, 0x4 + adds r0, r6, 0x4 + bl sub_80983D8 + adds r5, r0, 0 + ldr r0, _0807C384 + adds r7, r5, r0 + ldrb r0, [r7] + cmp r0, 0 + bne _0807C370 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_8045990 + lsls r0, 24 + cmp r0, 0 + beq _0807C370 + adds r0, r6, 0 + adds r1, r4, 0 + ldr r2, [sp, 0x18] + bl sub_807C4A0 + lsls r0, 24 + cmp r0, 0 + beq _0807C370 + ldr r0, [sp, 0x14] + str r0, [sp] + ldr r0, [sp, 0xC] + adds r1, r6, 0 + adds r2, r4, 0 + mov r3, r10 + bl sub_807C648 + lsls r0, 24 + cmp r0, 0 + beq _0807C370 + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r5, 0 + ldr r3, [sp, 0x18] + bl sub_807C9F8 + lsls r0, 24 + cmp r0, 0 + beq _0807C370 + movs r0, 0x1 + strb r0, [r7] + ldr r0, _0807C388 + add r0, r8 + strb r5, [r0] + adds r0, r6, 0 + mov r1, r10 + bl sub_8071A1C + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r6, 0 + ldr r1, [sp, 0xC] + adds r2, r4, 0 + bl sub_807C7AC + ldr r1, _0807C38C + mov r3, r8 + lsls r2, r3, 2 + adds r1, r2, r1 + str r0, [r1] + ldr r0, _0807C390 + adds r2, r0 + str r4, [r2] + movs r4, 0x1 + add r8, r4 +_0807C370: + movs r0, 0x1 + add r9, r0 + mov r1, r9 + cmp r1, 0x13 + ble _0807C2C0 + b _0807C3F6 + .align 2, 0 +_0807C37C: .4byte gUnknown_203B418 +_0807C380: .4byte 0x000135cc +_0807C384: .4byte gUnknown_202F380 +_0807C388: .4byte gUnknown_202F388 +_0807C38C: .4byte gUnknown_202F390 +_0807C390: .4byte gUnknown_202F3B0 +_0807C394: + cmp r0, 0x60 + bne _0807C3DC + movs r5, 0 +_0807C39A: + ldr r0, _0807C3D4 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _0807C3D8 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807C3CA + mov r3, r10 + str r3, [sp] + ldr r0, [sp, 0x14] + str r0, [sp, 0x4] + mov r0, r8 + ldr r1, [sp, 0xC] + adds r2, r6, 0 + adds r3, r4, 0 + bl sub_807C580 + mov r8, r0 +_0807C3CA: + adds r5, 0x1 + cmp r5, 0x13 + ble _0807C39A + b _0807C3F6 + .align 2, 0 +_0807C3D4: .4byte gUnknown_203B418 +_0807C3D8: .4byte 0x000135cc +_0807C3DC: + cmp r0, 0x70 + bne _0807C3F6 + mov r1, r10 + str r1, [sp] + ldr r2, [sp, 0x14] + str r2, [sp, 0x4] + mov r0, r8 + ldr r1, [sp, 0xC] + adds r2, r6, 0 + adds r3, r6, 0 + bl sub_807C580 + mov r8, r0 +_0807C3F6: + mov r3, r8 + cmp r3, 0 + bne _0807C402 + ldr r4, [sp, 0x8] + strb r3, [r4] + b _0807C48A +_0807C402: + movs r4, 0 + movs r3, 0 + mov r0, r8 + cmp r0, 0 + ble _0807C420 + ldr r2, _0807C464 + mov r1, r8 +_0807C410: + ldr r0, [r2] + cmp r3, r0 + bge _0807C418 + adds r3, r0, 0 +_0807C418: + adds r2, 0x4 + subs r1, 0x1 + cmp r1, 0 + bne _0807C410 +_0807C420: + mov r1, r8 + cmp r1, 0 + ble _0807C43A + movs r5, 0 + ldr r2, _0807C464 +_0807C42A: + ldr r0, [r2] + cmp r3, r0 + beq _0807C432 + str r5, [r2] +_0807C432: + adds r2, 0x4 + subs r1, 0x1 + cmp r1, 0 + bne _0807C42A +_0807C43A: + str r3, [sp, 0x10] + mov r2, r8 + cmp r2, 0 + ble _0807C450 + ldr r2, _0807C464 + mov r1, r8 +_0807C446: + ldm r2!, {r0} + adds r4, r0 + subs r1, 0x1 + cmp r1, 0 + bne _0807C446 +_0807C450: + adds r0, r4, 0 + bl sub_8084100 + adds r2, r0, 0 + movs r1, 0 + cmp r1, r8 + bge _0807C478 + ldr r3, _0807C464 + b _0807C470 + .align 2, 0 +_0807C464: .4byte gUnknown_202F390 +_0807C468: + adds r3, 0x4 + adds r1, 0x1 + cmp r1, r8 + bge _0807C478 +_0807C470: + ldr r0, [r3] + subs r2, r0 + cmp r2, 0 + bge _0807C468 +_0807C478: + movs r0, 0x1 + ldr r3, [sp, 0x8] + strb r0, [r3] + ldr r0, _0807C49C + adds r0, r1, r0 + ldrb r0, [r0] + strb r0, [r3, 0x1] + movs r0, 0x8 + str r0, [r3, 0x4] +_0807C48A: + ldr r0, [sp, 0x10] +_0807C48C: + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0807C49C: .4byte gUnknown_202F388 + thumb_func_end sub_807C04C + + thumb_func_start sub_807C4A0 +sub_807C4A0: + push {r4-r7,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0x4 + ldrsh r1, [r4, r0] + movs r3, 0x4 + ldrsh r0, [r5, r3] + subs r3, r1, r0 + cmp r3, 0 + bge _0807C4B6 + negs r3, r3 +_0807C4B6: + movs r6, 0x6 + ldrsh r1, [r4, r6] + movs r7, 0x6 + ldrsh r0, [r5, r7] + subs r1, r0 + cmp r1, 0 + bge _0807C4C6 + negs r1, r1 +_0807C4C6: + adds r0, r1, 0 + cmp r1, r3 + bge _0807C4CE + adds r0, r3, 0 +_0807C4CE: + cmp r0, 0xA + bgt _0807C578 + cmp r0, r2 + bgt _0807C578 + movs r6, 0x1 + negs r6, r6 + cmp r3, r1 + bne _0807C516 + movs r0, 0x4 + ldrsh r1, [r4, r0] + movs r2, 0x4 + ldrsh r0, [r5, r2] + ldrh r2, [r4, 0x4] + ldrh r3, [r5, 0x4] + cmp r1, r0 + bge _0807C4FE + movs r6, 0x6 + ldrsh r1, [r4, r6] + movs r7, 0x6 + ldrsh r0, [r5, r7] + cmp r1, r0 + blt _0807C574 + cmp r1, r0 + bgt _0807C574 +_0807C4FE: + lsls r1, r2, 16 + lsls r0, r3, 16 + movs r6, 0x7 + cmp r1, r0 + ble _0807C570 + movs r0, 0x6 + ldrsh r1, [r4, r0] + movs r2, 0x6 + ldrsh r0, [r5, r2] + cmp r1, r0 + ble _0807C570 + b _0807C574 +_0807C516: + movs r3, 0x4 + ldrsh r1, [r4, r3] + movs r7, 0x4 + ldrsh r0, [r5, r7] + ldrh r2, [r4, 0x4] + ldrh r3, [r5, 0x4] + cmp r1, r0 + bne _0807C532 + movs r0, 0x6 + ldrsh r1, [r4, r0] + movs r7, 0x6 + ldrsh r0, [r5, r7] + cmp r1, r0 + blt _0807C574 +_0807C532: + lsls r1, r2, 16 + lsls r0, r3, 16 + cmp r1, r0 + bge _0807C546 + movs r0, 0x6 + ldrsh r1, [r4, r0] + movs r7, 0x6 + ldrsh r0, [r5, r7] + cmp r1, r0 + beq _0807C574 +_0807C546: + lsls r1, r2, 16 + lsls r0, r3, 16 + cmp r1, r0 + bne _0807C55A + movs r0, 0x6 + ldrsh r1, [r4, r0] + movs r7, 0x6 + ldrsh r0, [r5, r7] + cmp r1, r0 + bgt _0807C574 +_0807C55A: + lsls r1, r2, 16 + lsls r0, r3, 16 + cmp r1, r0 + ble _0807C570 + movs r0, 0x6 + ldrsh r1, [r4, r0] + movs r2, 0x6 + ldrsh r0, [r5, r2] + cmp r1, r0 + bne _0807C570 + movs r6, 0x6 +_0807C570: + cmp r6, 0 + blt _0807C578 +_0807C574: + movs r0, 0x1 + b _0807C57A +_0807C578: + movs r0, 0 +_0807C57A: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_807C4A0 + + thumb_func_start sub_807C580 +sub_807C580: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r6, r0, 0 + adds r5, r2, 0 + adds r7, r3, 0 + ldr r0, [sp, 0x28] + lsls r1, 16 + asrs r1, 16 + mov r9, r1 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + ldr r2, [r5, 0x70] + ldr r1, [r5, 0x4] + ldr r0, [r7, 0x4] + cmp r1, r0 + beq _0807C5BC + movs r0, 0xF0 + mov r1, r9 + ands r0, r1 + cmp r0, 0x30 + beq _0807C5BC + cmp r0, 0x60 + beq _0807C5BC + cmp r0, 0x70 + bne _0807C5C4 +_0807C5BC: + adds r0, r2, 0 + adds r0, 0x46 + ldrb r4, [r0] + b _0807C5CE +_0807C5C4: + adds r0, r5, 0x4 + adds r1, r7, 0x4 + bl sub_80983D8 + adds r4, r0, 0 +_0807C5CE: + ldr r0, _0807C638 + adds r0, r4 + mov r8, r0 + ldrb r0, [r0] + cmp r0, 0 + bne _0807C624 + mov r0, r10 + str r0, [sp] + mov r0, r9 + adds r1, r5, 0 + adds r2, r7, 0 + ldr r3, [sp, 0x24] + bl sub_807C648 + lsls r0, 24 + cmp r0, 0 + beq _0807C624 + movs r0, 0x1 + mov r1, r8 + strb r0, [r1] + ldr r0, _0807C63C + adds r0, r6, r0 + strb r4, [r0] + adds r0, r5, 0 + ldr r1, [sp, 0x24] + bl sub_8071A1C + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + adds r0, r5, 0 + mov r1, r9 + adds r2, r7, 0 + bl sub_807C7AC + ldr r1, _0807C640 + lsls r2, r6, 2 + adds r1, r2, r1 + str r0, [r1] + ldr r0, _0807C644 + adds r2, r0 + str r7, [r2] + adds r6, 0x1 +_0807C624: + adds r0, r6, 0 + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0807C638: .4byte gUnknown_202F380 +_0807C63C: .4byte gUnknown_202F388 +_0807C640: .4byte gUnknown_202F390 +_0807C644: .4byte gUnknown_202F3B0 + thumb_func_end sub_807C580 + + thumb_func_start sub_807C648 +sub_807C648: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r5, r1, 0 + adds r4, r2, 0 + mov r8, r3 + ldr r1, [sp, 0x1C] + lsls r0, 16 + asrs r6, r0, 16 + lsls r1, 24 + lsrs r1, 24 + mov r9, r1 + movs r7, 0 + movs r0, 0xF + ands r0, r6 + adds r1, r0, 0 + cmp r1, 0 + bne _0807C686 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_8071598 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0807C6E0 + movs r7, 0x1 + b _0807C6E4 +_0807C686: + cmp r1, 0x1 + beq _0807C6BE + cmp r1, 0x2 + bne _0807C692 + ldr r1, [r4, 0x70] + b _0807C69C +_0807C692: + cmp r1, 0x5 + bne _0807C6B6 + ldr r1, [r4, 0x70] + cmp r5, r4 + beq _0807C6B2 +_0807C69C: + movs r7, 0x1 + ldrb r0, [r1, 0x8] + cmp r0, 0x1 + beq _0807C6B2 + adds r0, r1, 0 + adds r0, 0xA4 + ldrb r0, [r0] + cmp r0, 0x4 + beq _0807C6B2 + cmp r0, 0x1 + bne _0807C6E0 +_0807C6B2: + movs r0, 0 + b _0807C7A0 +_0807C6B6: + cmp r1, 0x6 + bne _0807C6D4 + cmp r5, r4 + beq _0807C6B2 +_0807C6BE: + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_8071598 + lsls r0, 24 + cmp r0, 0 + bne _0807C6E0 + movs r7, 0x1 + b _0807C6E4 +_0807C6D4: + subs r0, 0x3 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _0807C6E0 + movs r7, 0x1 +_0807C6E0: + cmp r7, 0 + beq _0807C79E +_0807C6E4: + mov r0, r9 + cmp r0, 0 + beq _0807C77C + adds r0, r5, 0 + adds r1, r4, 0 + mov r2, r8 + bl sub_805CEB8 + lsls r0, 24 + cmp r0, 0 + beq _0807C6B2 + movs r1, 0xF0 + lsls r1, 4 + ands r1, r6 + movs r0, 0x80 + lsls r0, 1 + cmp r1, r0 + beq _0807C78A + movs r0, 0x80 + lsls r0, 2 + cmp r1, r0 + beq _0807C76E + movs r0, 0xC0 + lsls r0, 2 + cmp r1, r0 + bne _0807C720 + adds r0, r4, 0 + bl sub_8070A58 + b _0807C774 +_0807C720: + movs r0, 0x80 + lsls r0, 3 + cmp r1, r0 + bne _0807C730 + adds r0, r4, 0 + bl sub_8070B28 + b _0807C774 +_0807C730: + movs r0, 0xC0 + lsls r0, 3 + cmp r1, r0 + bne _0807C75A + ldr r1, [r4, 0x70] + adds r0, r1, 0 + adds r0, 0x5C + ldrb r0, [r0] + cmp r0, 0xE + beq _0807C74E + adds r0, r1, 0 + adds r0, 0x5D + ldrb r0, [r0] + cmp r0, 0xE + bne _0807C6B2 +_0807C74E: + adds r0, r1, 0 + adds r0, 0xF5 + ldrb r0, [r0] + cmp r0, 0 + beq _0807C79E + b _0807C6B2 +_0807C75A: + movs r0, 0xA0 + lsls r0, 3 + cmp r1, r0 + bne _0807C79E + adds r0, r4, 0 + bl sub_8070A58 + lsls r0, 24 + cmp r0, 0 + bne _0807C79E +_0807C76E: + adds r0, r4, 0 + bl sub_8070B48 +_0807C774: + lsls r0, 24 + cmp r0, 0 + bne _0807C79E + b _0807C6B2 +_0807C77C: + movs r0, 0xF0 + lsls r0, 4 + ands r0, r6 + movs r1, 0x80 + lsls r1, 1 + cmp r0, r1 + bne _0807C79E +_0807C78A: + mov r0, r8 + movs r1, 0x2 + bl sub_8092BD8 + adds r4, r0, 0 + movs r0, 0x64 + bl sub_8084100 + cmp r0, r4 + bge _0807C6B2 +_0807C79E: + adds r0, r7, 0 +_0807C7A0: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_807C648 + + thumb_func_start sub_807C7AC +sub_807C7AC: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r5, r0, 0 + mov r8, r2 + lsls r1, 16 + asrs r1, 16 + lsls r3, 24 + lsrs r3, 24 + mov r9, r3 + movs r6, 0x1 + ldr r4, [r2, 0x70] + adds r7, r4, 0 + ldrb r0, [r4, 0x6] + cmp r0, 0 + beq _0807C7D6 + movs r0, 0xF + ands r0, r1 + cmp r0, 0 + beq _0807C7DA +_0807C7D6: + movs r0, 0x1 + b _0807C848 +_0807C7DA: + adds r0, r5, 0 + movs r1, 0x9 + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _0807C804 + ldr r0, _0807C7FC + ldr r0, [r0] + movs r2, 0x2 + ldrsh r1, [r4, r2] + ldr r2, _0807C800 + adds r0, r2 + adds r0, r1 + ldrb r6, [r0] + b _0807C846 + .align 2, 0 +_0807C7FC: .4byte gUnknown_203B418 +_0807C800: .4byte 0x0000363c +_0807C804: + adds r0, r5, 0 + movs r1, 0xA + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _0807C828 + ldrb r1, [r7, 0xE] + movs r2, 0xC + negs r2, r2 + adds r0, r2, 0 + subs r0, r1 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _0807C846 + movs r6, 0x1 + b _0807C846 +_0807C828: + adds r0, r5, 0 + movs r1, 0xB + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _0807C846 + adds r0, r5, 0 + mov r1, r8 + mov r2, r9 + bl sub_806E654 + adds r0, 0x1 + lsls r0, 24 + lsrs r6, r0, 24 +_0807C846: + adds r0, r6, 0 +_0807C848: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_807C7AC + + thumb_func_start sub_807C854 +sub_807C854: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x50 + adds r7, r0, 0 + str r1, [sp, 0x40] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x44] + ldr r0, [r7, 0x70] + movs r1, 0 + mov r8, r1 + adds r1, r0, 0 + adds r1, 0x46 + ldrb r6, [r1] + adds r0, 0xE8 + ldrb r0, [r0] + movs r3, 0x8 + mov r10, r3 + cmp r0, 0x1 + bne _0807C886 + movs r0, 0x1 + mov r10, r0 +_0807C886: + movs r4, 0 + adds r0, r7, 0 + movs r1, 0x9 + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + bne _0807C8A4 + adds r0, r7, 0 + movs r1, 0xA + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _0807C8A6 +_0807C8A4: + movs r4, 0x1 +_0807C8A6: + str r4, [sp, 0x48] + adds r0, r7, 0 + movs r1, 0x8 + bl sub_80718D8 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x4C] + movs r1, 0 + mov r9, r1 + cmp r9, r10 + bge _0807C952 +_0807C8BE: + movs r0, 0x7 + ands r6, r0 + movs r3, 0x4 + ldrsh r0, [r7, r3] + ldr r1, _0807C95C + lsls r2, r6, 2 + adds r2, r1 + movs r3, 0 + ldrsh r1, [r2, r3] + adds r0, r1 + movs r3, 0x6 + ldrsh r1, [r7, r3] + movs r3, 0x2 + ldrsh r2, [r2, r3] + adds r1, r2 + bl sub_804954C + ldr r5, [r0, 0x10] + cmp r5, 0 + beq _0807C948 + adds r0, r5, 0 + bl sub_80450F8 + cmp r0, 0x1 + bne _0807C948 + adds r0, r7, 0 + adds r1, r6, 0 + bl sub_8071138 + lsls r0, 24 + cmp r0, 0 + beq _0807C948 + adds r0, r7, 0 + adds r1, r5, 0 + movs r2, 0 + ldr r3, [sp, 0x44] + bl sub_8071598 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _0807C948 + ldr r0, [sp, 0x4C] + cmp r0, 0 + beq _0807C922 + ldr r0, [r5, 0x70] + adds r0, 0xB0 + ldrb r0, [r0] + cmp r0, 0x1 + beq _0807C948 +_0807C922: + mov r1, r8 + lsls r4, r1, 2 + mov r3, sp + adds r0, r3, r4 + str r6, [r0] + adds r0, r7, 0 + movs r1, 0 + adds r2, r5, 0 + movs r3, 0 + bl sub_807C7AC + add r1, sp, 0x20 + adds r1, r4 + str r0, [r1] + ldr r0, [sp, 0x48] + cmp r0, 0 + beq _0807C960 + movs r1, 0x1 + add r8, r1 +_0807C948: + movs r3, 0x1 + add r9, r3 + adds r6, 0x1 + cmp r9, r10 + blt _0807C8BE +_0807C952: + mov r0, r8 + cmp r0, 0 + bne _0807C966 + movs r0, 0 + b _0807C9E8 + .align 2, 0 +_0807C95C: .4byte gUnknown_80F4448 +_0807C960: + ldr r1, [sp, 0x40] + str r6, [r1] + b _0807C9E6 +_0807C966: + movs r4, 0 + movs r3, 0 + mov r0, r8 + cmp r0, 0 + ble _0807C984 + add r1, sp, 0x20 + mov r2, r8 +_0807C974: + ldr r0, [r1] + cmp r3, r0 + bge _0807C97C + adds r3, r0, 0 +_0807C97C: + adds r1, 0x4 + subs r2, 0x1 + cmp r2, 0 + bne _0807C974 +_0807C984: + mov r1, r8 + cmp r1, 0 + ble _0807C9A0 + movs r5, 0 + add r1, sp, 0x20 + mov r2, r8 +_0807C990: + ldr r0, [r1] + cmp r3, r0 + beq _0807C998 + str r5, [r1] +_0807C998: + adds r1, 0x4 + subs r2, 0x1 + cmp r2, 0 + bne _0807C990 +_0807C9A0: + mov r3, r8 + cmp r3, 0 + ble _0807C9B4 + add r1, sp, 0x20 + mov r2, r8 +_0807C9AA: + ldm r1!, {r0} + adds r4, r0 + subs r2, 0x1 + cmp r2, 0 + bne _0807C9AA +_0807C9B4: + adds r0, r4, 0 + bl sub_8084100 + adds r1, r0, 0 + movs r2, 0 + cmp r2, r8 + bge _0807C9DC + ldr r0, [sp, 0x20] + subs r1, r0 + cmp r1, 0 + blt _0807C9DC + add r3, sp, 0x20 +_0807C9CC: + adds r3, 0x4 + adds r2, 0x1 + cmp r2, r8 + bge _0807C9DC + ldr r0, [r3] + subs r1, r0 + cmp r1, 0 + bge _0807C9CC +_0807C9DC: + lsls r0, r2, 2 + add r0, sp + ldr r0, [r0] + ldr r1, [sp, 0x40] + str r0, [r1] +_0807C9E6: + movs r0, 0x1 +_0807C9E8: + add sp, 0x50 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_807C854 + + thumb_func_start sub_807C9F8 +sub_807C9F8: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r4, r0, 0 + mov r10, r1 + adds r7, r2, 0 + adds r5, r3, 0 + movs r0, 0x4 + ldrsh r1, [r4, r0] + mov r2, r10 + movs r3, 0x4 + ldrsh r0, [r2, r3] + subs r2, r1, r0 + cmp r2, 0 + bge _0807CA1C + negs r2, r2 +_0807CA1C: + movs r6, 0x6 + ldrsh r1, [r4, r6] + mov r3, r10 + movs r6, 0x6 + ldrsh r0, [r3, r6] + subs r6, r1, r0 + cmp r6, 0 + bge _0807CA2E + negs r6, r6 +_0807CA2E: + cmp r6, r2 + bge _0807CA34 + adds r6, r2, 0 +_0807CA34: + cmp r6, r5 + ble _0807CA3A + adds r6, r5, 0 +_0807CA3A: + adds r0, r4, 0 + movs r1, 0x3 + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + bne _0807CA50 + cmp r6, r5 + bgt _0807CAAC +_0807CA4C: + movs r0, 0x1 + b _0807CAAE +_0807CA50: + movs r0, 0x4 + ldrsh r5, [r4, r0] + movs r1, 0x6 + ldrsh r4, [r4, r1] + ldr r1, _0807CA70 + lsls r0, r7, 2 + adds r0, r1 + movs r3, 0 + ldrsh r2, [r0, r3] + mov r9, r2 + movs r2, 0x2 + ldrsh r1, [r0, r2] + mov r8, r1 + movs r7, 0 + b _0807CA94 + .align 2, 0 +_0807CA70: .4byte gUnknown_80F4448 +_0807CA74: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_804954C + adds r2, r0, 0 + ldrh r1, [r2] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _0807CAAC + ldr r0, [r2, 0x10] + cmp r0, r10 + beq _0807CA4C + cmp r0, 0 + bne _0807CAAC + adds r7, 0x1 +_0807CA94: + cmp r7, r6 + bgt _0807CAAC + add r5, r9 + add r4, r8 + cmp r5, 0 + ble _0807CAAC + cmp r4, 0 + ble _0807CAAC + cmp r5, 0x36 + bgt _0807CAAC + cmp r4, 0x1E + ble _0807CA74 +_0807CAAC: + movs r0, 0 +_0807CAAE: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_807C9F8 + + thumb_func_start sub_807CABC +sub_807CABC: + push {r4-r6,lr} + sub sp, 0x4 + adds r4, r0, 0 + movs r6, 0 + b _0807CADC +_0807CAC6: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _0807CB0A + ldr r1, _0807CB38 + adds r0, r5, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0807CB0A + adds r6, 0x1 +_0807CADC: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8070828 + cmp r6, r0 + bge _0807CB0A + ldr r5, [r4, 0x70] + adds r0, r5, 0 + adds r0, 0x48 + ldrb r1, [r0] + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0x1 + movs r3, 0 + bl sub_8055A00 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _0807CAC6 +_0807CB0A: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8057588 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807CB2A + ldr r0, [r4, 0x70] + adds r0, 0x48 + ldrb r1, [r0] + adds r0, r4, 0 + bl sub_806A9B4 +_0807CB2A: + adds r0, r4, 0 + bl sub_806A1B0 + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0807CB38: .4byte 0x00000159 + thumb_func_end sub_807CABC + + thumb_func_start sub_807CB3C +sub_807CB3C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x30 + adds r6, r0, 0 + ldr r7, [r6, 0x70] + movs r1, 0 + movs r2, 0x15 + bl sub_8044D90 + adds r2, r0, 0 + ldr r5, [r2] + ldrb r1, [r2] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _0807CB80 + ldr r0, _0807CB78 + adds r1, r2, 0 + bl sub_8045BF8 + ldr r0, _0807CB7C + ldr r1, [r0] + adds r0, r6, 0 + bl sub_80522A8 + b _0807CD54 + .align 2, 0 +_0807CB78: .4byte gUnknown_202DE58 +_0807CB7C: .4byte gUnknown_80FE3E8 +_0807CB80: + add r0, sp, 0x8 + adds r1, r7, 0 + adds r1, 0x44 + ldm r1!, {r2-r4} + stm r0!, {r2-r4} + ldm r1!, {r2-r4} + stm r0!, {r2-r4} + bl sub_80441BC + lsls r0, 24 + cmp r0, 0 + beq _0807CBAC + ldr r0, _0807CBA8 + ldr r1, [r0] + adds r0, r6, 0 + bl sub_80522A8 + movs r4, 0x1 + b _0807CCDE + .align 2, 0 +_0807CBA8: .4byte gUnknown_81004C4 +_0807CBAC: + movs r0, 0x1 + mov r8, r0 + add r4, sp, 0x20 + lsls r5, 8 + lsrs r0, r5, 24 + bl sub_80913CC + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_8092A88 + ldrb r0, [r7, 0x7] + mov r10, r4 + mov r9, r5 + cmp r0, 0 + bne _0807CC08 + ldr r1, _0807CC20 + ldr r0, [sp, 0x28] + ands r0, r1 + mov r1, r8 + orrs r0, r1 + str r0, [sp, 0x28] + movs r0, 0xA + add r4, sp, 0x28 + str r0, [r4, 0x4] + movs r3, 0x8C + lsls r3, 1 + adds r2, r7, r3 + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_807C04C + ldrb r0, [r4] + cmp r0, 0 + beq _0807CC08 + ldrb r1, [r4, 0x1] + movs r0, 0x7 + ands r0, r1 + adds r1, r7, 0 + adds r1, 0x46 + strb r0, [r1] + adds r0, r6, 0 + bl sub_8069DCC +_0807CC08: + adds r0, r7, 0 + adds r0, 0xBC + ldrb r0, [r0] + cmp r0, 0x1 + bne _0807CC2C + ldr r0, _0807CC24 + adds r1, r6, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _0807CC28 + b _0807CC3C + .align 2, 0 +_0807CC20: .4byte 0xffffff00 +_0807CC24: .4byte gUnknown_202DF98 +_0807CC28: .4byte gUnknown_80FC714 +_0807CC2C: + cmp r0, 0x7 + bne _0807CC50 + ldr r0, _0807CC48 + adds r1, r6, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _0807CC4C +_0807CC3C: + ldr r1, [r0] + adds r0, r6, 0 + bl sub_80522A8 + b _0807CCDC + .align 2, 0 +_0807CC48: .4byte gUnknown_202DF98 +_0807CC4C: .4byte gUnknown_80FC718 +_0807CC50: + adds r0, r7, 0 + adds r0, 0xAC + ldrb r0, [r0] + cmp r0, 0x4 + bne _0807CC72 + ldr r0, _0807CCB8 + adds r1, r6, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _0807CCBC + ldr r1, [r0] + adds r0, r6, 0 + bl sub_80522A8 + movs r4, 0 + mov r8, r4 +_0807CC72: + mov r0, r8 + cmp r0, 0 + beq _0807CCDC + mov r5, r9 + lsrs r0, r5, 24 + cmp r0, 0xB6 + beq _0807CC84 + cmp r0, 0xBF + bne _0807CCC0 +_0807CC84: + adds r0, r6, 0 + movs r1, 0 + movs r2, 0x7A + bl sub_8044DF0 + mov r2, r10 + ldrb r1, [r2] + movs r0, 0x8 + movs r4, 0 + orrs r0, r1 + add r3, sp, 0x20 + movs r1, 0x4 + orrs r0, r1 + strb r0, [r3] + movs r0, 0xA + strb r0, [r3, 0x4] + lsrs r2, r5, 24 + str r4, [sp] + str r3, [sp, 0x4] + adds r0, r6, 0 + movs r1, 0 + movs r3, 0 + bl sub_8055FA0 + b _0807CCDE + .align 2, 0 +_0807CCB8: .4byte gUnknown_202DF98 +_0807CCBC: .4byte gUnknown_80FC6A8 +_0807CCC0: + mov r3, r9 + lsrs r2, r3, 24 + movs r0, 0 + str r0, [sp] + mov r4, r10 + str r4, [sp, 0x4] + adds r0, r6, 0 + movs r1, 0 + movs r3, 0 + bl sub_8055FA0 + lsls r0, 24 + lsrs r4, r0, 24 + b _0807CCDE +_0807CCDC: + movs r4, 0 +_0807CCDE: + adds r0, r6, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807CD38 + cmp r4, 0 + beq _0807CCF8 + adds r0, r6, 0 + movs r1, 0 + movs r2, 0x7A + bl sub_8044DF0 +_0807CCF8: + adds r0, r6, 0 + bl sub_8071DA4 + adds r0, r6, 0 + movs r1, 0x8 + bl sub_806CE68 + ldrb r0, [r7, 0x7] + cmp r0, 0 + beq _0807CD18 + adds r0, r6, 0x4 + bl sub_804AC20 + movs r0, 0 + bl sub_807EC28 +_0807CD18: + adds r0, r6, 0 + bl sub_806A5B8 + ldr r0, _0807CD30 + ldr r0, [r0] + ldr r1, _0807CD34 + adds r0, r1 + ldrb r1, [r0] + adds r0, r6, 0 + bl sub_8075900 + b _0807CD44 + .align 2, 0 +_0807CD30: .4byte gUnknown_203B418 +_0807CD34: .4byte 0x00003a08 +_0807CD38: + cmp r4, 0 + beq _0807CD44 + add r0, sp, 0x8 + movs r1, 0 + bl sub_8044D40 +_0807CD44: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _0807CD54 + adds r0, r6, 0 + bl sub_806A1B0 +_0807CD54: + add sp, 0x30 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_807CB3C + + thumb_func_start sub_807CD64 +sub_807CD64: + push {r4,r5,lr} + adds r3, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + ldrh r0, [r4, 0x2] + cmp r0, 0xED + bne _0807CD88 + cmp r5, 0 + bne _0807CD88 + adds r0, r3, 0 + movs r1, 0xE + bl sub_8071858 + lsls r0, 24 + cmp r0, 0 + bne _0807CD88 + movs r0, 0x73 + b _0807CD94 +_0807CD88: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8092AE0 + lsls r0, 16 + asrs r0, 16 +_0807CD94: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_807CD64 + + thumb_func_start sub_807CD9C +sub_807CD9C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x34 + mov r9, r0 + adds r6, r1, 0 + adds r4, r2, 0 + movs r0, 0xA + str r0, [sp, 0x24] + bl sub_80441E8 + lsls r0, 24 + cmp r0, 0 + beq _0807CDC4 + ldr r0, _0807CDC0 + b _0807CDFE + .align 2, 0 +_0807CDC0: .4byte gUnknown_80FC9E8 +_0807CDC4: + cmp r9, r6 + bne _0807CDE4 + ldr r0, _0807CDDC + adds r1, r6, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _0807CDE0 + ldr r2, [r0] + adds r0, r6, 0 + b _0807CE02 + .align 2, 0 +_0807CDDC: .4byte gUnknown_202DF98 +_0807CDE0: .4byte gUnknown_80FCA10 +_0807CDE4: + ldr r0, _0807CE0C + adds r1, r6, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r6, 0 + movs r1, 0xE + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0807CE28 + ldr r0, _0807CE10 +_0807CDFE: + ldr r2, [r0] + mov r0, r9 +_0807CE02: + adds r1, r6, 0 + bl sub_80522F4 + b _0807D02A + .align 2, 0 +_0807CE0C: .4byte gUnknown_202DF98 +_0807CE10: .4byte gUnknown_80FCBCC +_0807CE14: + str r0, [sp, 0x28] + b _0807CF26 +_0807CE18: + ldrh r0, [r5] + movs r1, 0x3 + ands r1, r0 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + mov r10, r0 + b _0807CF20 +_0807CE28: + ldr r1, [r6, 0x70] + adds r2, r4, 0x4 + movs r3, 0x7 + adds r0, r2, 0 + ands r0, r3 + adds r1, 0x46 + strb r0, [r1] + movs r0, 0x7 + ands r2, r0 + adds r0, r6, 0 + movs r1, 0x6 + bl sub_806CDD4 + ldr r1, _0807D03C + adds r0, r6, 0 + bl sub_80421C0 + ldr r0, _0807D040 + ldr r2, [r0] + mov r0, r9 + adds r1, r6, 0 + bl sub_80522F4 + movs r1, 0x1 + mov r10, r1 + movs r2, 0 + str r2, [sp, 0x28] + lsls r1, r4, 2 + ldr r0, _0807D044 + adds r1, r0 + mov r8, r1 + add r7, sp, 0x18 +_0807CE68: + ldr r2, [r6, 0x4] + str r2, [sp, 0x18] + ldrh r0, [r7] + mov r3, r8 + ldrh r3, [r3] + adds r0, r3 + lsls r0, 16 + lsrs r0, 16 + ldr r1, _0807D048 + ands r1, r2 + orrs r1, r0 + str r1, [sp, 0x18] + asrs r0, r1, 16 + mov r2, r8 + ldrh r2, [r2, 0x2] + adds r0, r2 + lsls r0, 16 + ldr r2, _0807D04C + ands r2, r1 + orrs r2, r0 + str r2, [sp, 0x18] + movs r3, 0 + ldrsh r0, [r7, r3] + cmp r0, 0 + blt _0807CF20 + asrs r1, r2, 16 + cmp r1, 0 + blt _0807CF20 + cmp r0, 0x37 + bgt _0807CF20 + cmp r1, 0x1F + bgt _0807CF20 + mov r1, r8 + movs r2, 0 + ldrsh r0, [r1, r2] + lsls r0, 10 + str r0, [sp, 0x2C] + movs r3, 0x2 + ldrsh r0, [r1, r3] + lsls r0, 10 + str r0, [sp, 0x30] + movs r4, 0x5 +_0807CEBC: + adds r0, r6, 0 + ldr r1, [sp, 0x2C] + ldr r2, [sp, 0x30] + bl sub_804539C + adds r0, r6, 0 + bl sub_8045888 + lsls r0, 24 + cmp r0, 0 + beq _0807CED8 + movs r0, 0x19 + bl sub_803E46C +_0807CED8: + subs r4, 0x1 + cmp r4, 0 + bge _0807CEBC + movs r1, 0 + ldrsh r0, [r7, r1] + ldr r1, [sp, 0x18] + asrs r1, 16 + bl sub_804954C + adds r5, r0, 0 + ldr r0, [r5, 0x10] + cmp r0, 0 + bne _0807CE14 + add r4, sp, 0x18 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80705F0 + lsls r0, 24 + cmp r0, 0 + bne _0807CE18 + movs r2, 0 + ldrsh r1, [r7, r2] + movs r3, 0x2 + ldrsh r2, [r4, r3] + adds r0, r6, 0 + movs r3, 0x1 + bl sub_80694C0 + ldr r0, [sp, 0x24] + subs r0, 0x1 + str r0, [sp, 0x24] + cmp r0, 0 + bgt _0807CE68 + movs r1, 0x1 + mov r10, r1 +_0807CF20: + mov r2, r10 + cmp r2, 0 + bne _0807CF4E +_0807CF26: + adds r1, r6, 0x4 + adds r0, r6, 0 + bl sub_807D068 + ldr r0, _0807D050 + movs r3, 0 + ldrsh r2, [r0, r3] + movs r1, 0 + str r1, [sp] + str r1, [sp, 0x4] + ldr r0, _0807D054 + str r0, [sp, 0x8] + str r1, [sp, 0xC] + str r1, [sp, 0x10] + str r1, [sp, 0x14] + mov r0, r9 + adds r1, r6, 0 + movs r3, 0 + bl sub_806F370 +_0807CF4E: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _0807D02A + ldr r0, [sp, 0x28] + cmp r0, 0 + beq _0807CF9E + add r4, sp, 0x1C + ldr r1, _0807D058 + adds r0, r4, 0 + bl sub_8092A88 + ldr r0, [sp, 0x28] + adds r1, r4, 0 + bl sub_80571F0 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0807CF9E + mov r0, r9 + ldr r1, [sp, 0x28] + bl sub_807A96C + ldr r0, _0807D050 + movs r1, 0 + ldrsh r2, [r0, r1] + str r4, [sp] + str r4, [sp, 0x4] + ldr r0, _0807D05C + str r0, [sp, 0x8] + str r4, [sp, 0xC] + str r4, [sp, 0x10] + str r4, [sp, 0x14] + mov r0, r9 + ldr r1, [sp, 0x28] + movs r3, 0 + bl sub_806F370 +_0807CF9E: + bl sub_8044B28 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0807D02A + adds r0, r6, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807D02A + adds r0, r6, 0 + bl sub_806A5B8 + adds r4, r6, 0x4 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80706A4 + lsls r0, 24 + cmp r0, 0 + beq _0807CFD8 + adds r0, r6, 0 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0 + bl sub_807D148 +_0807CFD8: + adds r0, r6, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807D02A + adds r0, r6, 0 + movs r1, 0x8 + bl sub_806CE68 + ldr r0, [r6, 0x70] + ldrb r0, [r0, 0x7] + cmp r0, 0 + beq _0807D014 + ldr r1, _0807D060 + ldr r0, [r1] + strb r5, [r0, 0x1] + ldr r0, [r1] + movs r2, 0xB8 + lsls r2, 3 + adds r0, r2 + movs r1, 0x1 + negs r1, r1 + str r1, [r0] + adds r0, r4, 0 + bl sub_804AC20 + movs r0, 0 + bl sub_807EC28 +_0807D014: + adds r0, r6, 0 + bl sub_806A5B8 + ldr r0, _0807D060 + ldr r0, [r0] + ldr r3, _0807D064 + adds r0, r3 + ldrb r1, [r0] + adds r0, r6, 0 + bl sub_8075900 +_0807D02A: + add sp, 0x34 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0807D03C: .4byte 0x000001a3 +_0807D040: .4byte gUnknown_80F8A0C +_0807D044: .4byte gUnknown_80F4448 +_0807D048: .4byte 0xffff0000 +_0807D04C: .4byte 0x0000ffff +_0807D050: .4byte gUnknown_80F4F90 +_0807D054: .4byte 0x00000219 +_0807D058: .4byte 0x00000163 +_0807D05C: .4byte 0x0000021a +_0807D060: .4byte gUnknown_203B418 +_0807D064: .4byte 0x00003a08 + thumb_func_end sub_807CD9C + + thumb_func_start sub_807D068 +sub_807D068: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + adds r6, r0, 0 + movs r0, 0 + ldrsh r2, [r1, r0] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 11 + movs r2, 0xC0 + lsls r2, 4 + adds r2, r0 + mov r10, r2 + movs r0, 0x2 + ldrsh r1, [r1, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 11 + movs r1, 0x80 + lsls r1, 5 + adds r1, r0 + mov r9, r1 + ldr r0, [r6, 0xC] + subs r0, r2 + cmp r0, 0 + bge _0807D0A4 + negs r0, r0 +_0807D0A4: + ldr r1, [r6, 0x10] + cmp r0, 0xB + bgt _0807D0B8 + mov r2, r9 + subs r0, r1, r2 + cmp r0, 0 + bge _0807D0B4 + negs r0, r0 +_0807D0B4: + cmp r0, 0xB + ble _0807D11E +_0807D0B8: + movs r0, 0 + mov r8, r0 + ldr r5, [r6, 0xC] + adds r4, r1, 0 + mov r1, r10 + subs r0, r1, r5 + movs r1, 0xC + bl __divsi3 + str r0, [sp, 0x8] + mov r2, r9 + subs r0, r2, r4 + movs r1, 0xC + bl __divsi3 + str r0, [sp, 0xC] + mov r0, sp + str r0, [sp, 0x10] + movs r7, 0xB +_0807D0DE: + ldr r1, [sp, 0x8] + adds r5, r1 + ldr r2, [sp, 0xC] + adds r4, r2 + str r5, [sp] + ldr r0, [sp, 0x10] + str r4, [r0, 0x4] + mov r0, r8 + bl sub_8009C7C + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + str r1, [r6, 0x1C] + adds r0, r6, 0 + mov r1, sp + bl sub_804535C + adds r0, r6, 0 + bl sub_8045888 + lsls r0, 24 + cmp r0, 0 + beq _0807D114 + movs r0, 0x1A + bl sub_803E46C +_0807D114: + movs r1, 0xAA + add r8, r1 + subs r7, 0x1 + cmp r7, 0 + bge _0807D0DE +_0807D11E: + mov r2, r10 + str r2, [sp] + mov r0, r9 + str r0, [sp, 0x4] + movs r0, 0 + str r0, [r6, 0x1C] + adds r0, r6, 0 + mov r1, sp + bl sub_804535C + movs r0, 0x1A + bl sub_803E46C + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_807D068 + + thumb_func_start sub_807D148 +sub_807D148: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + mov r8, r0 + adds r5, r1, 0 + mov r9, r2 + str r3, [sp, 0x4] + ldr r0, [r5, 0x70] + mov r10, r0 + movs r1, 0 + str r1, [sp, 0x8] + ldr r0, _0807D180 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r5, 0 + movs r1, 0xE + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0807D188 + ldr r0, _0807D184 + b _0807D194 + .align 2, 0 +_0807D180: .4byte gUnknown_202DF98 +_0807D184: .4byte gUnknown_80FCAE8 +_0807D188: + bl sub_80441E8 + lsls r0, 24 + cmp r0, 0 + beq _0807D1A4 + ldr r0, _0807D1A0 +_0807D194: + ldr r2, [r0] + mov r0, r8 + adds r1, r5, 0 + bl sub_80522F4 + b _0807D3A8 + .align 2, 0 +_0807D1A0: .4byte gUnknown_80FC97C +_0807D1A4: + mov r2, r9 + cmp r2, 0x1 + bne _0807D1DC + ldr r0, _0807D1D0 + ldr r0, [r0] + ldr r3, _0807D1D4 + adds r0, r3 + ldr r1, [r0] + ldr r0, [r5, 0x4] + cmp r1, r0 + bne _0807D1DC + ldr r0, _0807D1D8 + ldr r2, [r0] + mov r0, r8 + adds r1, r5, 0 + bl sub_80522F4 + mov r0, r8 + adds r1, r5, 0 + bl sub_8076D10 + b _0807D3A8 + .align 2, 0 +_0807D1D0: .4byte gUnknown_203B418 +_0807D1D4: .4byte 0x0000e21c +_0807D1D8: .4byte gUnknown_80FC9A0 +_0807D1DC: + ldr r0, _0807D27C + ldr r2, [r0] + mov r0, r8 + adds r1, r5, 0 + bl sub_80522F4 + adds r0, r5, 0 + adds r1, r5, 0 + bl sub_807A96C + mov r0, r8 + adds r1, r5, 0 + bl sub_80421AC + adds r0, r5, 0 + bl sub_8045888 + lsls r0, 24 + cmp r0, 0 + beq _0807D252 + mov r0, r10 + adds r0, 0x46 + ldrb r4, [r0] + ldr r1, [r5, 0x1C] + movs r2, 0x80 + lsls r2, 4 + adds r1, r2 + str r1, [r5, 0x1C] + ldr r2, _0807D280 + adds r6, r0, 0 + cmp r1, r2 + bgt _0807D252 + movs r7, 0x7 +_0807D21E: + ldr r0, _0807D284 + ldr r0, [r0] + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _0807D23C + adds r4, 0x1 + ands r4, r7 + adds r0, r4, 0 + ands r0, r7 + strb r0, [r6] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_806CE68 +_0807D23C: + movs r0, 0x22 + bl sub_803E46C + ldr r1, [r5, 0x1C] + movs r3, 0x80 + lsls r3, 4 + adds r1, r3 + str r1, [r5, 0x1C] + ldr r0, _0807D280 + cmp r1, r0 + ble _0807D21E +_0807D252: + mov r0, r9 + cmp r0, 0x1 + beq _0807D288 + cmp r0, 0x1 + bcc _0807D264 + cmp r0, 0x2 + beq _0807D2B0 + cmp r0, 0x3 + beq _0807D2C8 +_0807D264: + mov r0, sp + bl sub_8083660 + lsls r0, 24 + cmp r0, 0 + bne _0807D2CE + ldr r0, [r5, 0x4] + str r0, [sp] + movs r1, 0x1 + str r1, [sp, 0x8] + b _0807D2CE + .align 2, 0 +_0807D27C: .4byte gUnknown_80FC584 +_0807D280: .4byte 0x00009fff +_0807D284: .4byte gUnknown_202EDCC +_0807D288: + ldr r0, _0807D2A8 + ldr r1, [r0] + ldr r2, _0807D2AC + adds r1, r2 + mov r0, sp + bl sub_808384C + lsls r0, 24 + cmp r0, 0 + bne _0807D2CE + ldr r0, [r5, 0x4] + str r0, [sp] + movs r3, 0x1 + str r3, [sp, 0x8] + b _0807D2CE + .align 2, 0 +_0807D2A8: .4byte gUnknown_203B418 +_0807D2AC: .4byte 0x0000e21c +_0807D2B0: + mov r0, sp + ldr r1, [sp, 0x4] + bl sub_808384C + lsls r0, 24 + cmp r0, 0 + bne _0807D2CE + ldr r0, [r5, 0x4] + str r0, [sp] + movs r0, 0x1 + str r0, [sp, 0x8] + b _0807D2CE +_0807D2C8: + ldr r1, [sp, 0x4] + ldr r0, [r1] + str r0, [sp] +_0807D2CE: + mov r0, sp + movs r2, 0 + ldrsh r1, [r0, r2] + movs r3, 0x2 + ldrsh r2, [r0, r3] + adds r0, r5, 0 + movs r3, 0x1 + bl sub_80694C0 + adds r0, r5, 0 + movs r1, 0 + bl sub_804535C + adds r0, r5, 0 + bl sub_807BB78 + movs r0, 0x1 + bl sub_803F580 + adds r0, r5, 0 + bl sub_8045888 + lsls r0, 24 + cmp r0, 0 + beq _0807D340 + mov r1, r10 + adds r1, 0x46 + ldrb r4, [r1] + movs r0, 0x9C + lsls r0, 8 + str r0, [r5, 0x1C] + adds r6, r1, 0 + movs r7, 0x7 +_0807D310: + ldr r0, _0807D3B8 + ldr r0, [r0] + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _0807D32E + adds r4, 0x1 + ands r4, r7 + adds r0, r4, 0 + ands r0, r7 + strb r0, [r6] + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_806CE68 +_0807D32E: + movs r0, 0x22 + bl sub_803E46C + ldr r0, [r5, 0x1C] + ldr r1, _0807D3BC + adds r0, r1 + str r0, [r5, 0x1C] + cmp r0, 0 + bgt _0807D310 +_0807D340: + movs r4, 0 + str r4, [r5, 0x1C] + movs r0, 0x22 + bl sub_803E46C + ldr r2, [sp, 0x8] + cmp r2, 0 + beq _0807D35C + ldr r0, _0807D3C0 + ldr r2, [r0] + mov r0, r8 + adds r1, r5, 0 + bl sub_80522F4 +_0807D35C: + mov r3, r9 + cmp r3, 0x1 + bne _0807D36A + mov r0, r8 + adds r1, r5, 0 + bl sub_8076D10 +_0807D36A: + mov r1, r10 + ldrb r0, [r1, 0x7] + cmp r0, 0 + beq _0807D392 + adds r0, r5, 0x4 + bl sub_804AC20 + ldr r1, _0807D3C4 + ldr r0, [r1] + strb r4, [r0, 0x1] + ldr r0, [r1] + movs r2, 0xB8 + lsls r2, 3 + adds r0, r2 + movs r1, 0x1 + negs r1, r1 + str r1, [r0] + movs r0, 0 + bl sub_807EC28 +_0807D392: + adds r0, r5, 0 + bl sub_806A5B8 + ldr r0, _0807D3C4 + ldr r0, [r0] + ldr r3, _0807D3C8 + adds r0, r3 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_8075900 +_0807D3A8: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0807D3B8: .4byte gUnknown_202EDCC +_0807D3BC: .4byte 0xfffffc00 +_0807D3C0: .4byte gUnknown_80FCB14 +_0807D3C4: .4byte gUnknown_203B418 +_0807D3C8: .4byte 0x00003a08 + thumb_func_end sub_807D148 + + thumb_func_start sub_807D3CC +sub_807D3CC: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + mov r8, r0 + movs r2, 0 + ldr r4, _0807D448 + ldr r0, [r4] + ldr r1, _0807D44C + adds r0, r1 + ldrb r6, [r0] + cmp r6, 0 + bne _0807D3E8 + movs r6, 0x2 +_0807D3E8: + mov r0, r8 + str r2, [sp] + bl sub_80450FC + lsls r0, 24 + lsrs r1, r0, 24 + ldr r2, [sp] + cmp r1, 0xFF + bne _0807D450 + mov r3, r8 + movs r1, 0x6 + ldrsh r0, [r3, r1] + subs r5, r0, r6 + adds r0, r6 + cmp r5, r0 + bgt _0807D4A8 +_0807D408: + mov r3, r8 + movs r1, 0x4 + ldrsh r0, [r3, r1] + subs r4, r0, r6 + adds r0, r6 + adds r7, r5, 0x1 + cmp r4, r0 + bgt _0807D438 +_0807D418: + adds r0, r4, 0 + adds r1, r5, 0 + str r2, [sp] + bl sub_807D4E0 + ldr r2, [sp] + orrs r2, r0 + lsls r0, r2, 24 + lsrs r2, r0, 24 + adds r4, 0x1 + mov r3, r8 + movs r1, 0x4 + ldrsh r0, [r3, r1] + adds r0, r6 + cmp r4, r0 + ble _0807D418 +_0807D438: + adds r5, r7, 0 + mov r3, r8 + movs r1, 0x6 + ldrsh r0, [r3, r1] + adds r0, r6 + cmp r5, r0 + ble _0807D408 + b _0807D4A8 + .align 2, 0 +_0807D448: .4byte gUnknown_203B418 +_0807D44C: .4byte 0x00018209 +_0807D450: + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r3, _0807D468 + adds r0, r3 + ldr r1, [r4] + adds r6, r1, r0 + movs r1, 0x4 + ldrsh r0, [r6, r1] + subs r5, r0, 0x1 + b _0807D49E + .align 2, 0 +_0807D468: .4byte 0x000104c4 +_0807D46C: + movs r1, 0x2 + ldrsh r0, [r6, r1] + subs r4, r0, 0x1 + movs r3, 0x6 + ldrsh r0, [r6, r3] + adds r0, 0x1 + adds r7, r5, 0x1 + cmp r4, r0 + bgt _0807D49C +_0807D47E: + adds r0, r4, 0 + adds r1, r5, 0 + str r2, [sp] + bl sub_807D4E0 + ldr r2, [sp] + orrs r2, r0 + lsls r0, r2, 24 + lsrs r2, r0, 24 + adds r4, 0x1 + movs r1, 0x6 + ldrsh r0, [r6, r1] + adds r0, 0x1 + cmp r4, r0 + ble _0807D47E +_0807D49C: + adds r5, r7, 0 +_0807D49E: + movs r3, 0x8 + ldrsh r0, [r6, r3] + adds r0, 0x1 + cmp r5, r0 + ble _0807D46C +_0807D4A8: + cmp r2, 0 + beq _0807D4C4 + ldr r0, _0807D4C0 + ldr r1, [r0] + mov r0, r8 + bl sub_80522A8 + bl sub_8040A84 + bl sub_8049ED4 + b _0807D4CE + .align 2, 0 +_0807D4C0: .4byte gUnknown_80FD2F8 +_0807D4C4: + ldr r0, _0807D4DC + ldr r1, [r0] + mov r0, r8 + bl sub_80522A8 +_0807D4CE: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0807D4DC: .4byte gUnknown_80FD320 + thumb_func_end sub_807D3CC + + thumb_func_start sub_807D4E0 +sub_807D4E0: + push {r4,lr} + bl sub_804954C + ldr r4, [r0, 0x14] + cmp r4, 0 + beq _0807D506 + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0x2 + bne _0807D506 + adds r1, r4, 0 + adds r1, 0x20 + ldrb r0, [r1] + cmp r0, 0 + bne _0807D506 + movs r0, 0x1 + strb r0, [r1] + b _0807D508 +_0807D506: + movs r0, 0 +_0807D508: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_807D4E0 + + thumb_func_start sub_807D510 +sub_807D510: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, _0807D540 + add sp, r4 + ldr r1, _0807D544 + add r1, sp + str r0, [r1] + movs r2, 0 + movs r3, 0xD1 + lsls r3, 4 + add r3, sp + str r2, [r3] + ldr r4, _0807D548 + add r4, sp + str r2, [r4] + add r5, sp, 0x4 + mov r8, r5 + mov r10, r2 + mov r9, r2 + add r7, sp, 0x8 + b _0807D606 + .align 2, 0 +_0807D540: .4byte 0xfffff2d4 +_0807D544: .4byte 0x00000d08 +_0807D548: .4byte 0x00000d0c +_0807D54C: + movs r0, 0x4 + ldrsh r1, [r5, r0] + ldr r2, _0807D650 + add r2, sp + ldr r2, [r2] + movs r3, 0x4 + ldrsh r0, [r2, r3] + subs r1, r0 + cmp r1, 0 + bge _0807D562 + negs r1, r1 +_0807D562: + cmp r1, 0x2 + bgt _0807D580 + movs r3, 0x6 + ldrsh r1, [r5, r3] + ldr r4, _0807D650 + add r4, sp + ldr r4, [r4] + movs r2, 0x6 + ldrsh r0, [r4, r2] + subs r1, r0 + cmp r1, 0 + bge _0807D57C + negs r1, r1 +_0807D57C: + cmp r1, 0x2 + ble _0807D5FE +_0807D580: + movs r1, 0x4 + ldrsh r0, [r5, r1] + movs r2, 0x6 + ldrsh r1, [r5, r2] + bl sub_804954C + ldrh r1, [r0] + movs r2, 0x3 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _0807D5FE + mov r3, r8 + str r2, [r3] + ldr r4, _0807D654 + add r4, sp + ldr r1, _0807D658 + add r1, sp + ldr r1, [r1] + lsls r0, r1, 2 + adds r4, r0 + str r4, [r7, 0x6C] + ldr r0, [r5, 0x4] + str r0, [r7] + movs r2, 0x4 + ldrsh r0, [r5, r2] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, 0x4 + lsls r1, 8 + movs r3, 0x6 + ldrsh r0, [r5, r3] + lsls r2, r0, 1 + adds r2, r0 + lsls r2, 3 + adds r2, 0x4 + lsls r2, 8 + mov r0, r8 + bl sub_8045394 + movs r2, 0 + movs r1, 0 + strh r1, [r7, 0x22] + movs r0, 0x1 + strb r0, [r7, 0x1C] + strb r2, [r7, 0x1E] + str r1, [r7, 0x18] + ldr r0, _0807D65C + ldr r0, [r0] + ldr r5, _0807D660 + adds r0, r5 + add r0, r9 + ldr r0, [r0] + str r0, [r4] + adds r7, 0x74 + movs r0, 0x74 + add r8, r0 + ldr r2, _0807D658 + add r2, sp + ldr r1, [r2] + adds r1, 0x1 + str r1, [r2] +_0807D5FE: + movs r3, 0x4 + add r9, r3 + movs r4, 0x1 + add r10, r4 +_0807D606: + ldr r0, _0807D65C + ldr r1, [r0] + ldr r5, _0807D664 + adds r0, r1, r5 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r10, r0 + bge _0807D634 + ldr r3, _0807D668 + adds r0, r1, r3 + add r0, r9 + ldr r5, [r0] + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807D5FE + ldr r4, _0807D658 + add r4, sp + ldr r4, [r4] + cmp r4, 0x18 + ble _0807D54C +_0807D634: + ldr r5, _0807D658 + add r5, sp + ldr r5, [r5] + cmp r5, 0 + bne _0807D670 + ldr r0, _0807D66C + ldr r1, [r0] + ldr r2, _0807D650 + add r2, sp + ldr r0, [r2] + bl sub_80522A8 + b _0807D9F4 + .align 2, 0 +_0807D650: .4byte 0x00000d08 +_0807D654: .4byte 0x00000b58 +_0807D658: .4byte 0x00000d0c +_0807D65C: .4byte gUnknown_203B418 +_0807D660: .4byte 0x00003804 +_0807D664: .4byte 0x00003904 +_0807D668: .4byte 0x0001361c +_0807D66C: .4byte gUnknown_80FE034 +_0807D670: + movs r1, 0 + movs r7, 0x1D + ldr r0, _0807D754 + add r0, sp +_0807D678: + strb r1, [r0] + subs r0, 0x1 + subs r7, 0x1 + cmp r7, 0 + bge _0807D678 + movs r7, 0 + ldr r3, _0807D758 + add r3, sp + ldr r3, [r3] + cmp r7, r3 + blt _0807D690 + b _0807D7CC +_0807D690: + ldr r4, _0807D75C + mov r10, r4 + ldr r5, _0807D760 + movs r0, 0 + ldrsh r5, [r5, r0] + ldr r0, _0807D764 + add r0, sp + str r5, [r0] +_0807D6A0: + movs r1, 0 + mov r9, r1 + ldr r2, _0807D768 + add r2, sp + ldr r2, [r2] + ldrh r0, [r2, 0x4] + ldr r1, _0807D76C + ands r6, r1 + orrs r6, r0 + ldrh r0, [r2, 0x6] + lsls r0, 16 + mov r4, r10 + ands r6, r4 + orrs r6, r0 + mov r4, r9 + adds r5, r7, 0x1 + movs r0, 0xD2 + lsls r0, 4 + add r0, sp + str r5, [r0] + ldr r1, _0807D760 + ldr r2, _0807D764 + add r2, sp + ldr r2, [r2] + cmp r2, 0x63 + beq _0807D790 + ldr r3, _0807D770 + add r3, sp + mov r8, r3 +_0807D6DA: + ldr r0, _0807D774 + add r0, sp + adds r0, r4 + ldr r5, _0807D778 + add r5, sp + str r0, [r5] + ldrb r0, [r0] + cmp r0, 0 + bne _0807D77C + lsls r2, r4, 2 + adds r2, r1 + ldrh r0, [r2] + ldr r1, _0807D768 + add r1, sp + ldr r1, [r1] + ldrh r1, [r1, 0x4] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + ldr r1, _0807D76C + ands r6, r1 + orrs r6, r0 + ldrh r0, [r2, 0x2] + ldr r2, _0807D768 + add r2, sp + ldr r2, [r2] + ldrh r2, [r2, 0x6] + adds r0, r2 + lsls r0, 16 + mov r3, r10 + ands r6, r3 + orrs r6, r0 + lsls r0, r6, 16 + asrs r0, 16 + asrs r1, r6, 16 + bl sub_804954C + adds r2, r0, 0 + ldrh r1, [r2] + movs r3, 0x3 + ands r3, r1 + cmp r3, 0x1 + bne _0807D77C + movs r5, 0x80 + lsls r5, 2 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _0807D77C + ldr r0, [r2, 0x14] + cmp r0, 0 + bne _0807D77C + lsls r0, r7, 2 + add r0, r8 + str r6, [r0] + ldr r0, _0807D778 + add r0, sp + ldr r0, [r0] + strb r3, [r0] + b _0807D7B8 + .align 2, 0 +_0807D754: .4byte 0x00000d05 +_0807D758: .4byte 0x00000d0c +_0807D75C: .4byte 0x0000ffff +_0807D760: .4byte gUnknown_80F4468 +_0807D764: .4byte 0x00000d18 +_0807D768: .4byte 0x00000d08 +_0807D76C: .4byte 0xffff0000 +_0807D770: .4byte 0x00000bbc +_0807D774: .4byte 0x00000ce8 +_0807D778: .4byte 0x00000d28 +_0807D77C: + adds r4, 0x1 + cmp r4, 0x1D + bgt _0807D790 + lsls r0, r4, 2 + ldr r1, _0807D9B4 + adds r0, r1 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0x63 + bne _0807D6DA +_0807D790: + mov r3, r9 + cmp r3, 0 + bne _0807D7B8 + movs r0, 0x74 + muls r0, r7 + add r0, sp + adds r0, 0x4 + str r3, [r0] + ldr r1, _0807D9B8 + add r1, sp + lsls r0, r7, 2 + adds r1, r0 + ldrh r2, [r1] + mov r0, r10 + orrs r0, r2 + strh r0, [r1] + ldrh r2, [r1, 0x2] + mov r0, r10 + orrs r0, r2 + strh r0, [r1, 0x2] +_0807D7B8: + movs r4, 0xD2 + lsls r4, 4 + add r4, sp + ldr r7, [r4] + ldr r5, _0807D9BC + add r5, sp + ldr r5, [r5] + cmp r7, r5 + bge _0807D7CC + b _0807D6A0 +_0807D7CC: + movs r7, 0 + ldr r0, _0807D9BC + add r0, sp + ldr r0, [r0] + cmp r7, r0 + bge _0807D866 +_0807D7D8: + movs r0, 0x74 + adds r1, r7, 0 + muls r1, r0 + mov r8, r1 + mov r4, sp + add r4, r8 + adds r4, 0x4 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807D85A + adds r0, r4, 0x4 + movs r1, 0x1 + bl sub_80461C8 + movs r2, 0x4 + ldrsh r0, [r4, r2] + movs r3, 0x6 + ldrsh r1, [r4, r3] + bl sub_80402AC + movs r5, 0xC2 + lsls r5, 4 + add r5, sp + lsls r6, r7, 3 + adds r5, r6 + ldr r4, _0807D9B8 + add r4, sp + lsls r0, r7, 2 + adds r4, r0 + movs r0, 0 + ldrsh r1, [r4, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, 0x4 + lsls r0, 8 + add r1, sp, 0x10 + add r1, r8 + ldr r1, [r1] + subs r0, r1 + movs r1, 0x3C + bl __divsi3 + str r0, [r5] + ldr r5, _0807D9C0 + add r5, sp + adds r5, r6 + movs r2, 0x2 + ldrsh r1, [r4, r2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + adds r0, 0x4 + lsls r0, 8 + add r1, sp, 0x14 + add r1, r8 + ldr r1, [r1] + subs r0, r1 + movs r1, 0x3C + bl __divsi3 + str r0, [r5] +_0807D85A: + adds r7, 0x1 + ldr r3, _0807D9BC + add r3, sp + ldr r3, [r3] + cmp r7, r3 + blt _0807D7D8 +_0807D866: + movs r1, 0xD1 + lsls r1, 1 + ldr r4, _0807D9C4 + add r4, sp + ldr r0, [r4] + bl sub_80421C0 + movs r5, 0 + mov r9, r5 + ldr r0, _0807D9C8 + ldr r0, [r0] + ldr r1, _0807D9CC + adds r0, r1 + ldrb r0, [r0] + ldr r2, _0807D9D0 + add r2, sp + str r0, [r2] + mov r10, r5 + movs r6, 0 +_0807D88C: + movs r7, 0 + mov r3, r10 + adds r3, 0x22 + ldr r4, _0807D9D4 + add r4, sp + str r3, [r4] + adds r5, r6, 0x1 + ldr r0, _0807D9D8 + add r0, sp + str r5, [r0] + ldr r1, _0807D9BC + add r1, sp + ldr r1, [r1] + cmp r7, r1 + bge _0807D916 + mov r2, r9 + lsls r2, 24 + mov r8, r2 +_0807D8B0: + movs r0, 0x74 + adds r5, r7, 0 + muls r5, r0 + mov r4, sp + adds r4, r5 + adds r4, 0x4 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807D90A + movs r0, 0xC2 + lsls r0, 4 + add r0, sp + lsls r2, r7, 3 + adds r0, r2 + ldr r1, [r0] + ldr r0, _0807D9C0 + add r0, sp + adds r0, r2 + ldr r2, [r0] + adds r0, r4, 0 + bl sub_804539C + mov r0, r10 + bl sub_8009C7C + add r2, sp, 0x20 + adds r2, r5 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + str r1, [r2] + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + ldr r3, _0807D9D0 + add r3, sp + ldr r1, [r3] + movs r2, 0 + mov r4, r8 + lsrs r3, r4, 24 + bl sub_80462AC +_0807D90A: + adds r7, 0x1 + ldr r5, _0807D9BC + add r5, sp + ldr r5, [r5] + cmp r7, r5 + blt _0807D8B0 +_0807D916: + movs r0, 0x13 + bl sub_803E46C + ldr r0, _0807D9D4 + add r0, sp + ldr r0, [r0] + mov r10, r0 + movs r0, 0x3 + ands r0, r6 + cmp r0, 0 + bne _0807D930 + movs r1, 0x1 + add r9, r1 +_0807D930: + movs r0, 0x7 + mov r2, r9 + ands r2, r0 + mov r9, r2 + ldr r3, _0807D9D8 + add r3, sp + ldr r6, [r3] + cmp r6, 0x3B + ble _0807D88C + movs r7, 0 + ldr r4, _0807D9BC + add r4, sp + ldr r4, [r4] + cmp r7, r4 + bge _0807D996 +_0807D94E: + ldr r0, _0807D9B8 + add r0, sp + lsls r1, r7, 2 + adds r4, r0, r1 + movs r5, 0 + ldrsh r0, [r4, r5] + cmp r0, 0 + blt _0807D98A + movs r0, 0x74 + muls r0, r7 + add r0, sp + adds r0, 0x4 + bl sub_8045108 + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0x1 + bl sub_80460F8 + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl sub_80402AC + movs r3, 0x1 + movs r4, 0xD1 + lsls r4, 4 + add r4, sp + str r3, [r4] +_0807D98A: + adds r7, 0x1 + ldr r5, _0807D9BC + add r5, sp + ldr r5, [r5] + cmp r7, r5 + blt _0807D94E +_0807D996: + movs r0, 0xD1 + lsls r0, 4 + add r0, sp + ldr r0, [r0] + cmp r0, 0 + beq _0807D9E0 + ldr r0, _0807D9DC + ldr r1, [r0] + ldr r2, _0807D9C4 + add r2, sp + ldr r0, [r2] + bl sub_80522A8 + b _0807D9EE + .align 2, 0 +_0807D9B4: .4byte gUnknown_80F4468 +_0807D9B8: .4byte 0x00000bbc +_0807D9BC: .4byte 0x00000d0c +_0807D9C0: .4byte 0x00000c24 +_0807D9C4: .4byte 0x00000d08 +_0807D9C8: .4byte gUnknown_203B418 +_0807D9CC: .4byte 0x00018210 +_0807D9D0: .4byte 0x00000d14 +_0807D9D4: .4byte 0x00000d1c +_0807D9D8: .4byte 0x00000d24 +_0807D9DC: .4byte gUnknown_80FE060 +_0807D9E0: + ldr r0, _0807DA08 + ldr r1, [r0] + ldr r3, _0807DA0C + add r3, sp + ldr r0, [r3] + bl sub_80522A8 +_0807D9EE: + movs r0, 0x1 + bl sub_807EC28 +_0807D9F4: + ldr r3, _0807DA10 + add sp, r3 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0807DA08: .4byte gUnknown_80FE034 +_0807DA0C: .4byte 0x00000d08 +_0807DA10: .4byte 0x00000d2c + thumb_func_end sub_807D510 + + thumb_func_start sub_807DA14 +sub_807DA14: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r5, r0, 0 + adds r6, r1, 0 + lsls r2, 24 + lsrs r4, r2, 24 + ldr r0, [r6, 0x70] + mov r10, r0 + adds r0, r6, 0 + movs r1, 0xE + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0807DA50 + ldr r0, _0807DA48 + adds r1, r6, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _0807DA4C + b _0807DA5C + .align 2, 0 +_0807DA48: .4byte gUnknown_202DF98 +_0807DA4C: .4byte gUnknown_80FCB98 +_0807DA50: + bl sub_80441E8 + lsls r0, 24 + cmp r0, 0 + beq _0807DA6C + ldr r0, _0807DA68 +_0807DA5C: + ldr r2, [r0] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_80522F4 + b _0807DB5E + .align 2, 0 +_0807DA68: .4byte gUnknown_80FC9C0 +_0807DA6C: + cmp r4, 0x8 + bne _0807DA76 + mov r0, r10 + adds r0, 0x46 + ldrb r4, [r0] +_0807DA76: + adds r0, r6, 0 + movs r1, 0x6 + adds r2, r4, 0 + bl sub_806CDD4 + lsls r1, r4, 2 + adds r2, r6, 0x4 + mov r9, r2 + ldr r0, _0807DAFC + adds r1, r0 + mov r8, r1 +_0807DA8C: + ldrh r0, [r6, 0x4] + mov r3, r8 + ldrh r3, [r3] + adds r0, r3 + lsls r0, 16 + ldrh r1, [r6, 0x6] + mov r2, r8 + ldrh r2, [r2, 0x2] + adds r1, r2 + lsls r1, 16 + lsrs r7, r0, 16 + orrs r7, r1 + lsls r0, r7, 16 + asrs r5, r0, 16 + cmp r5, 0 + ble _0807DB00 + asrs r4, r7, 16 + cmp r4, 0 + ble _0807DB00 + cmp r5, 0x36 + bgt _0807DB00 + cmp r4, 0x1E + bgt _0807DB00 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_804954C + adds r1, r0, 0 + ldr r0, [r1, 0x10] + cmp r0, 0 + bne _0807DB00 + ldrh r1, [r1] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _0807DB00 + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + movs r3, 0 + bl sub_80694C0 + adds r0, r6, 0 + movs r1, 0 + bl sub_804535C + adds r0, r6, 0 + bl sub_8045888 + lsls r0, 24 + cmp r0, 0 + beq _0807DA8C + movs r0, 0x3A + bl sub_803E46C + b _0807DA8C + .align 2, 0 +_0807DAFC: .4byte gUnknown_80F4448 +_0807DB00: + adds r0, r6, 0 + bl sub_806A5B8 + mov r1, r9 + adds r0, r6, 0 + bl sub_80706A4 + lsls r0, 24 + cmp r0, 0 + beq _0807DB20 + adds r0, r6, 0 + adds r1, r6, 0 + movs r2, 0 + movs r3, 0 + bl sub_807D148 +_0807DB20: + adds r0, r6, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807DB5E + adds r0, r6, 0 + movs r1, 0x8 + bl sub_806CE68 + mov r3, r10 + ldrb r0, [r3, 0x7] + cmp r0, 0 + beq _0807DB48 + mov r0, r9 + bl sub_804AC20 + movs r0, 0 + bl sub_807EC28 +_0807DB48: + adds r0, r6, 0 + bl sub_806A5B8 + ldr r0, _0807DB6C + ldr r0, [r0] + ldr r1, _0807DB70 + adds r0, r1 + ldrb r1, [r0] + adds r0, r6, 0 + bl sub_8075900 +_0807DB5E: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0807DB6C: .4byte gUnknown_203B418 +_0807DB70: .4byte 0x00003a08 + thumb_func_end sub_807DA14 + + thumb_func_start sub_807DB74 +sub_807DB74: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r7, r0, 0 + movs r0, 0 + mov r8, r0 + bl sub_80441E8 + lsls r0, 24 + cmp r0, 0 + beq _0807DB94 + ldr r0, _0807DB90 + b _0807DBA0 + .align 2, 0 +_0807DB90: .4byte gUnknown_80FD060 +_0807DB94: + bl sub_804AF74 + lsls r0, 24 + cmp r0, 0 + beq _0807DBB0 + ldr r0, _0807DBAC +_0807DBA0: + ldr r1, [r0] + adds r0, r7, 0 + bl sub_80522A8 + b _0807DC54 + .align 2, 0 +_0807DBAC: .4byte gUnknown_80FD08C +_0807DBB0: + movs r5, 0 + ldr r0, _0807DC24 + adds r6, r0, 0 +_0807DBB6: + movs r4, 0 +_0807DBB8: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8049590 + adds r2, r0, 0 + ldrh r1, [r2] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + bne _0807DBE2 + adds r0, r1, 0 + ands r0, r6 + movs r1, 0x1 + orrs r0, r1 + strh r0, [r2] + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80498A8 + movs r1, 0x1 + mov r8, r1 +_0807DBE2: + adds r4, 0x1 + cmp r4, 0x37 + ble _0807DBB8 + adds r5, 0x1 + cmp r5, 0x1F + ble _0807DBB6 + movs r5, 0 +_0807DBF0: + movs r4, 0 + adds r6, r5, 0x1 +_0807DBF4: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8049BB0 + adds r4, 0x1 + cmp r4, 0x37 + ble _0807DBF4 + adds r5, r6, 0 + cmp r5, 0x1F + ble _0807DBF0 + mov r0, r8 + cmp r0, 0 + beq _0807DC30 + ldr r1, _0807DC28 + adds r0, r7, 0 + bl sub_80421C0 + ldr r0, _0807DC2C + ldr r1, [r0] + adds r0, r7, 0 + bl sub_80522A8 + b _0807DC3A + .align 2, 0 +_0807DC24: .4byte 0x0000fffc +_0807DC28: .4byte 0x000001a1 +_0807DC2C: .4byte gUnknown_80FD05C +_0807DC30: + ldr r0, _0807DC60 + ldr r1, [r0] + adds r0, r7, 0 + bl sub_80522A8 +_0807DC3A: + ldr r0, _0807DC64 + ldr r0, [r0] + movs r1, 0xCE + lsls r1, 3 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + bl sub_806CF60 + bl sub_8040A84 + bl sub_8049ED4 +_0807DC54: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0807DC60: .4byte gUnknown_80FD060 +_0807DC64: .4byte gUnknown_203B418 + thumb_func_end sub_807DB74 + + thumb_func_start sub_807DC68 +sub_807DC68: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r9, r0 + ldr r0, _0807DC88 + ldr r1, [r0] + ldr r2, _0807DC8C + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _0807DC94 + ldr r0, _0807DC90 + b _0807DCB8 + .align 2, 0 +_0807DC88: .4byte gUnknown_203B418 +_0807DC8C: .4byte 0x00003a08 +_0807DC90: .4byte gUnknown_80FD3C8 +_0807DC94: + ldr r3, _0807DCA4 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + beq _0807DCAC + ldr r0, _0807DCA8 + b _0807DCB8 + .align 2, 0 +_0807DCA4: .4byte 0x00003a0b +_0807DCA8: .4byte gUnknown_80FD3CC +_0807DCAC: + bl sub_80441BC + lsls r0, 24 + cmp r0, 0 + beq _0807DCC8 + ldr r0, _0807DCC4 +_0807DCB8: + ldr r1, [r0] + mov r0, r9 + bl sub_80522A8 + b _0807DF0E + .align 2, 0 +_0807DCC4: .4byte gUnknown_80FD3D0 +_0807DCC8: + movs r0, 0 + mov r8, r0 + movs r5, 0x1 + movs r1, 0 + mov r10, r1 + ldr r2, _0807DD68 + adds r7, r2, 0 +_0807DCD6: + movs r4, 0x1 +_0807DCD8: + movs r6, 0 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8049590 + adds r2, r0, 0 + ldrh r1, [r2] + ldr r3, _0807DD6C + adds r0, r3, 0 + adds r3, r1, 0 + ands r3, r0 + strh r3, [r2] + mov r0, r10 + strb r0, [r2, 0x9] + movs r0, 0x10 + ands r0, r3 + cmp r0, 0 + bne _0807DD94 + movs r0, 0x80 + lsls r0, 1 + adds r1, r0, 0 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _0807DD94 + ldrh r0, [r2, 0x4] + movs r1, 0x3 + orrs r0, r1 + strh r0, [r2, 0x4] + ldr r1, _0807DD70 + adds r0, r1, 0 + adds r1, r3, 0 + ands r1, r0 + strh r1, [r2] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0807DD28 + movs r3, 0x1 + mov r8, r3 +_0807DD28: + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x2 + beq _0807DD94 + cmp r0, 0x3 + beq _0807DD94 + cmp r5, 0x1 + beq _0807DD44 + cmp r4, 0x1 + beq _0807DD44 + cmp r5, 0x36 + beq _0807DD44 + cmp r4, 0x1E + bne _0807DD5C +_0807DD44: + ldr r0, [r2, 0x14] + cmp r0, 0 + bne _0807DD5C + ldr r0, _0807DD74 + ldr r0, [r0] + movs r1, 0xCE + lsls r1, 3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0807DD5C + movs r6, 0x1 +_0807DD5C: + cmp r6, 0 + beq _0807DD78 + ldrh r0, [r2] + ands r0, r7 + movs r1, 0x2 + b _0807DD90 + .align 2, 0 +_0807DD68: .4byte 0x0000fffc +_0807DD6C: .4byte 0x0000fbff +_0807DD70: .4byte 0x0000fff7 +_0807DD74: .4byte gUnknown_203B418 +_0807DD78: + ldrh r1, [r2] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + beq _0807DD94 + adds r0, r1, 0 + ands r0, r7 + movs r1, 0x1 + orrs r0, r1 + movs r3, 0x80 + lsls r3, 3 + adds r1, r3, 0 +_0807DD90: + orrs r0, r1 + strh r0, [r2] +_0807DD94: + adds r4, 0x1 + cmp r4, 0x1E + ble _0807DCD8 + adds r5, 0x1 + cmp r5, 0x36 + ble _0807DCD6 + ldr r0, _0807DF1C + ldr r1, [r0] + ldr r2, _0807DF20 + adds r0, r1, r2 + movs r3, 0 + ldrsh r0, [r0, r3] + adds r2, 0x2 + adds r1, r2 + movs r3, 0 + ldrsh r1, [r1, r3] + movs r2, 0x1 + bl sub_8050C30 + lsls r0, 24 + cmp r0, 0 + beq _0807DE02 + movs r5, 0 + movs r6, 0x84 + lsls r6, 8 + movs r7, 0 +_0807DDC8: + movs r4, 0 +_0807DDCA: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8049590 + adds r2, r0, 0 + ldrh r1, [r2] + movs r3, 0x80 + lsls r3, 1 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _0807DDF6 + adds r0, r6, 0 + ands r0, r1 + cmp r0, r6 + bne _0807DDF6 + ldr r3, _0807DF24 + adds r0, r3, 0 + ands r0, r1 + movs r1, 0x2 + orrs r0, r1 + strh r0, [r2] +_0807DDF6: + adds r4, 0x1 + cmp r4, 0x1F + ble _0807DDCA + adds r5, 0x1 + cmp r5, 0x37 + ble _0807DDC8 +_0807DE02: + mov r0, r8 + cmp r0, 0 + beq _0807DE14 + ldr r0, _0807DF1C + ldr r0, [r0] + ldr r1, _0807DF28 + adds r0, r1 + movs r1, 0 + strb r1, [r0] +_0807DE14: + movs r5, 0 +_0807DE16: + movs r4, 0 + adds r6, r5, 0x1 +_0807DE1A: + mov r2, r8 + cmp r2, 0 + beq _0807DE30 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8049590 + ldrh r2, [r0] + movs r1, 0x40 + orrs r1, r2 + strh r1, [r0] +_0807DE30: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8049BB0 + adds r4, 0x1 + cmp r4, 0x1F + ble _0807DE1A + adds r5, r6, 0 + cmp r5, 0x37 + ble _0807DE16 + movs r5, 0 +_0807DE46: + ldr r0, _0807DF1C + ldr r0, [r0] + lsls r1, r5, 2 + ldr r3, _0807DF2C + adds r0, r3 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807DE74 + movs r1, 0x4 + ldrsh r0, [r4, r1] + movs r2, 0x6 + ldrsh r1, [r4, r2] + bl sub_804954C + ldrb r1, [r0, 0x9] + adds r0, r4, 0 + adds r0, 0x25 + strb r1, [r0] +_0807DE74: + adds r5, 0x1 + cmp r5, 0x13 + ble _0807DE46 + bl sub_804EB30 + bl sub_804AAD4 + bl sub_8049884 + bl sub_806CF60 + bl sub_8040A84 + bl sub_8049ED4 + ldr r0, _0807DF30 + ldr r1, [r0] + mov r0, r9 + bl sub_80522A8 + movs r0, 0x28 + movs r1, 0x2B + bl sub_803E708 + mov r0, r9 + movs r1, 0x1 + bl sub_8075900 + movs r5, 0 +_0807DEAE: + ldr r0, _0807DF1C + ldr r0, [r0] + lsls r1, r5, 2 + ldr r3, _0807DF2C + adds r0, r3 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807DEF4 + adds r0, r4, 0 + bl sub_806A5B8 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807DEF4 + adds r1, r4, 0x4 + adds r0, r4, 0 + bl sub_80706A4 + lsls r0, 24 + cmp r0, 0 + beq _0807DEF4 + adds r0, r4, 0 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl sub_807D148 +_0807DEF4: + adds r5, 0x1 + cmp r5, 0x13 + ble _0807DEAE + ldr r0, _0807DF1C + ldr r0, [r0] + ldr r1, _0807DF34 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + movs r0, 0x14 + movs r1, 0x2B + bl sub_803E708 +_0807DF0E: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0807DF1C: .4byte gUnknown_203B418 +_0807DF20: .4byte 0x0000e21c +_0807DF24: .4byte 0x0000fffc +_0807DF28: .4byte 0x00003a0c +_0807DF2C: .4byte 0x000135cc +_0807DF30: .4byte gUnknown_80FD3A0 +_0807DF34: .4byte 0x00003a08 + thumb_func_end sub_807DC68 + + thumb_func_start sub_807DF38 +sub_807DF38: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + str r0, [sp, 0x8] + mov r10, r1 + str r2, [sp, 0xC] + adds r6, r3, 0 + ldr r0, [sp, 0x40] + ldr r1, [sp, 0x44] + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x10] + lsls r1, 16 + asrs r1, 16 + str r1, [sp, 0x14] + movs r5, 0 + b _0807DF62 +_0807DF60: + adds r5, 0x1 +_0807DF62: + cmp r5, 0x13 + bgt _0807DF8E + ldr r0, _0807DFA8 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _0807DFAC + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807DF60 + adds r0, r4, 0 + movs r1, 0x15 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0807DF60 +_0807DF8E: + cmp r5, 0x14 + beq _0807DFB4 + ldr r0, [sp, 0x8] + mov r1, r10 + bl sub_804218C + ldr r0, _0807DFB0 + mov r1, r10 + movs r2, 0 + bl sub_8045B94 + b _0807DFC2 + .align 2, 0 +_0807DFA8: .4byte gUnknown_203B418 +_0807DFAC: .4byte 0x000135cc +_0807DFB0: .4byte gUnknown_202DF98 +_0807DFB4: + mov r0, r10 + bl sub_807E580 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x4 + bne _0807DFD4 +_0807DFC2: + ldr r0, _0807DFD0 + ldr r2, [r0] + ldr r0, [sp, 0x8] + mov r1, r10 + bl sub_80522F4 + b _0807E174 + .align 2, 0 +_0807DFD0: .4byte gUnknown_80F96EC +_0807DFD4: + ldr r0, [sp, 0x8] + mov r1, r10 + adds r2, r6, 0 + bl sub_804216C + ldr r0, _0807E184 + mov r1, r10 + movs r2, 0 + bl sub_8045B94 + ldr r0, _0807E188 + ldr r2, [r0] + ldr r0, [sp, 0x8] + mov r1, r10 + bl sub_80522F4 + movs r5, 0 + ldr r0, _0807E18C + lsls r1, r6, 2 + adds r0, r1, r0 + ldr r0, [r0] + mov r9, r0 + ldrh r4, [r0] + movs r3, 0 + ldrsh r0, [r0, r3] + str r1, [sp, 0x1C] + cmp r0, 0x63 + bne _0807E00E + b _0807E124 +_0807E00E: + mov r0, sp + adds r0, 0x4 + str r0, [sp, 0x18] +_0807E014: + ldr r1, [sp, 0xC] + ldrh r0, [r1] + adds r0, r4, r0 + lsls r0, 16 + lsrs r0, 16 + ldr r2, _0807E190 + ldr r1, [sp, 0x4] + ands r1, r2 + orrs r1, r0 + str r1, [sp, 0x4] + ldr r2, [sp, 0xC] + ldrh r0, [r2, 0x2] + mov r3, r9 + ldrh r3, [r3, 0x2] + adds r0, r3 + lsls r0, 16 + ldr r2, _0807E194 + ands r2, r1 + orrs r2, r0 + str r2, [sp, 0x4] + ldr r1, [sp, 0x18] + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0 + blt _0807E112 + asrs r1, r2, 16 + cmp r1, 0 + blt _0807E112 + cmp r0, 0x37 + bgt _0807E112 + cmp r1, 0x1F + bgt _0807E112 + bl sub_8049590 + mov r8, r0 + ldr r0, [sp, 0x18] + movs r2, 0 + ldrsh r1, [r0, r2] + cmp r1, 0 + ble _0807E0BE + ldr r0, [sp, 0x4] + asrs r0, 16 + cmp r0, 0 + ble _0807E0BE + cmp r1, 0x36 + bgt _0807E0BE + cmp r0, 0x1E + bgt _0807E0BE + mov r3, r8 + ldrh r1, [r3] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _0807E0BE + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _0807E0BE + ldr r2, _0807E198 + adds r0, r2, 0 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + strh r0, [r3] + movs r5, 0x1 + negs r5, r5 + add r7, sp, 0x4 +_0807E09A: + movs r4, 0x1 + negs r4, r4 + adds r6, r5, 0x1 +_0807E0A0: + movs r3, 0 + ldrsh r0, [r7, r3] + adds r0, r4 + ldr r1, [sp, 0x4] + asrs r1, 16 + adds r1, r5 + bl sub_80498A8 + adds r4, 0x1 + cmp r4, 0x1 + ble _0807E0A0 + adds r5, r6, 0 + cmp r5, 0x1 + ble _0807E09A + movs r5, 0x1 +_0807E0BE: + mov r0, r8 + ldr r4, [r0, 0x14] + cmp r4, 0 + beq _0807E0DC + cmp r4, r10 + beq _0807E0DC + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0x3 + bne _0807E0DC + add r0, sp, 0x4 + movs r1, 0 + bl sub_80461C8 +_0807E0DC: + mov r1, r8 + ldr r4, [r1, 0x10] + cmp r4, 0 + beq _0807E112 + cmp r4, r10 + beq _0807E112 + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0x1 + bne _0807E112 + ldr r0, _0807E19C + ldr r2, [sp, 0x1C] + adds r0, r2, r0 + ldr r0, [r0] + str r0, [sp] + ldr r0, [sp, 0x8] + adds r1, r4, 0 + ldr r2, [sp, 0x10] + ldr r3, [sp, 0x14] + bl sub_807E1A0 + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _0807E124 +_0807E112: + movs r3, 0x4 + add r9, r3 + mov r0, r9 + ldrh r4, [r0] + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x63 + beq _0807E124 + b _0807E014 +_0807E124: + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _0807E174 + mov r0, r10 + bl sub_80450F8 + cmp r0, 0x1 + bne _0807E14E + ldr r0, _0807E19C + ldr r2, [sp, 0x1C] + adds r0, r2, r0 + ldr r0, [r0] + str r0, [sp] + ldr r0, [sp, 0x8] + mov r1, r10 + ldr r2, [sp, 0x10] + ldr r3, [sp, 0x14] + bl sub_807E1A0 +_0807E14E: + cmp r5, 0 + beq _0807E174 + movs r5, 0 +_0807E154: + movs r4, 0 + adds r6, r5, 0x1 +_0807E158: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8049BB0 + adds r4, 0x1 + cmp r4, 0x37 + ble _0807E158 + adds r5, r6, 0 + cmp r5, 0x1F + ble _0807E154 + bl sub_8040A84 + bl sub_8049ED4 +_0807E174: + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0807E184: .4byte gUnknown_202DF98 +_0807E188: .4byte gUnknown_80F96BC +_0807E18C: .4byte gUnknown_8107178 +_0807E190: .4byte 0xffff0000 +_0807E194: .4byte 0x0000ffff +_0807E198: .4byte 0x0000fffc +_0807E19C: .4byte gUnknown_203B444 + thumb_func_end sub_807DF38 + + thumb_func_start sub_807E1A0 +sub_807E1A0: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x24 + mov r9, r0 + adds r6, r1, 0 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 16 + asrs r7, r3, 16 + adds r0, r6, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807E244 + ldr r5, [r6, 0x70] + add r4, sp, 0x1C + ldr r1, _0807E20C + adds r0, r4, 0 + bl sub_8092A88 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80571F0 + lsls r0, 24 + cmp r0, 0 + bne _0807E244 + ldrb r0, [r5, 0x6] + cmp r0, 0 + bne _0807E210 + movs r0, 0xE + ldrsh r4, [r5, r0] + lsrs r0, r4, 31 + adds r5, r4, r0 + asrs r4, r5, 1 + adds r0, r6, 0 + movs r1, 0x2 + bl sub_8071858 + lsls r0, 24 + cmp r0, 0 + beq _0807E202 + lsrs r0, r5, 31 + adds r0, r4, r0 + asrs r4, r0, 1 +_0807E202: + cmp r4, 0 + bgt _0807E226 + movs r4, 0x1 + b _0807E226 + .align 2, 0 +_0807E20C: .4byte 0x00000163 +_0807E210: + ldr r4, [sp, 0x40] + adds r0, r6, 0 + movs r1, 0x2 + bl sub_8071858 + lsls r0, 24 + cmp r0, 0 + beq _0807E226 + lsrs r0, r4, 31 + adds r0, r4, r0 + asrs r4, r0, 1 +_0807E226: + add r0, sp, 0x18 + str r0, [sp] + mov r0, r8 + str r0, [sp, 0x4] + str r7, [sp, 0x8] + movs r0, 0 + str r0, [sp, 0xC] + str r0, [sp, 0x10] + str r0, [sp, 0x14] + mov r0, r9 + adds r1, r6, 0 + adds r2, r4, 0 + movs r3, 0 + bl sub_806F370 +_0807E244: + add sp, 0x24 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_807E1A0 + + thumb_func_start sub_807E254 +sub_807E254: + push {r4-r7,lr} + sub sp, 0x8 + adds r6, r0, 0 + adds r7, r1, 0 + movs r1, 0xE + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0807E274 + ldr r0, _0807E270 + adds r1, r6, 0 + b _0807E286 + .align 2, 0 +_0807E270: .4byte gUnknown_202DF98 +_0807E274: + adds r0, r7, 0 + movs r1, 0xE + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0807E2A4 + ldr r0, _0807E29C + adds r1, r7, 0 +_0807E286: + movs r2, 0 + bl sub_8045B94 + ldr r0, _0807E2A0 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_80522F4 + b _0807E366 + .align 2, 0 +_0807E29C: .4byte gUnknown_202DF98 +_0807E2A0: .4byte gUnknown_80FCAC0 +_0807E2A4: + ldrh r1, [r6, 0x6] + lsls r1, 16 + ldrh r0, [r6, 0x4] + orrs r0, r1 + str r0, [sp] + ldrh r1, [r7, 0x6] + lsls r1, 16 + ldrh r0, [r7, 0x4] + orrs r0, r1 + str r0, [sp, 0x4] + mov r5, sp + mov r0, sp + bl nullsub_93 + add r4, sp, 0x4 + adds r0, r4, 0 + bl nullsub_93 + movs r0, 0 + ldrsh r1, [r4, r0] + movs r0, 0x2 + ldrsh r2, [r4, r0] + adds r0, r6, 0 + movs r3, 0x1 + bl sub_80694C0 + mov r0, sp + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0x2 + ldrsh r2, [r5, r0] + adds r0, r7, 0 + movs r3, 0x1 + bl sub_80694C0 + adds r0, r6, 0 + movs r1, 0 + bl sub_804535C + adds r0, r7, 0 + movs r1, 0 + bl sub_804535C + adds r0, r6, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807E330 + ldr r0, [r6, 0x70] + ldrb r0, [r0, 0x7] + cmp r0, 0 + beq _0807E31A + adds r0, r6, 0x4 + bl sub_804AC20 + movs r0, 0 + bl sub_807EC28 +_0807E31A: + adds r0, r6, 0 + bl sub_806A5B8 + ldr r0, _0807E370 + ldr r0, [r0] + ldr r1, _0807E374 + adds r0, r1 + ldrb r1, [r0] + adds r0, r6, 0 + bl sub_8075900 +_0807E330: + adds r0, r7, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807E366 + ldr r0, [r7, 0x70] + ldrb r0, [r0, 0x7] + cmp r0, 0 + beq _0807E350 + adds r0, r7, 0x4 + bl sub_804AC20 + movs r0, 0 + bl sub_807EC28 +_0807E350: + adds r0, r7, 0 + bl sub_806A5B8 + ldr r0, _0807E370 + ldr r0, [r0] + ldr r2, _0807E374 + adds r0, r2 + ldrb r1, [r0] + adds r0, r7, 0 + bl sub_8075900 +_0807E366: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0807E370: .4byte gUnknown_203B418 +_0807E374: .4byte 0x00003a08 + thumb_func_end sub_807E254 + + thumb_func_start sub_807E378 +sub_807E378: + push {r4-r7,lr} + bl sub_8083600 + adds r4, r0, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _0807E38C + b _0807E564 +_0807E38C: + ldr r0, _0807E41C + ldr r1, [r0] + ldr r3, _0807E420 + adds r2, r1, r3 + ldrh r3, [r2] + movs r5, 0 + ldrsh r1, [r2, r5] + adds r6, r0, 0 + cmp r1, 0 + ble _0807E3AA + subs r0, r3, 0x1 + strh r0, [r2] + lsls r0, 16 + cmp r0, 0 + bgt _0807E3B4 +_0807E3AA: + ldr r0, [r6] + ldr r1, _0807E424 + adds r0, r1 + movs r1, 0x3 + strb r1, [r0] +_0807E3B4: + adds r5, r6, 0 + ldr r1, [r5] + ldr r7, _0807E424 + adds r0, r1, r7 + ldrb r0, [r0] + cmp r0, 0 + bne _0807E434 + ldr r2, _0807E420 + adds r0, r1, r2 + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r0, 0xF9 + ble _0807E3D0 + b _0807E564 +_0807E3D0: + bl sub_805E804 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_806A2BC + adds r0, r4, 0 + bl sub_807520C + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _0807E3EE + b _0807E564 +_0807E3EE: + ldr r0, _0807E428 + ldr r1, [r0] + adds r0, r4, 0 + bl sub_80522A8 + ldr r1, _0807E42C + ldr r0, [r5] + ldr r2, _0807E430 + adds r0, r2 + movs r3, 0 + ldrsh r0, [r0, r3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0 + bl sub_80426C8 + ldr r0, [r5] + adds r0, r7 + movs r1, 0x1 + strb r1, [r0] + b _0807E564 + .align 2, 0 +_0807E41C: .4byte gUnknown_203B418 +_0807E420: .4byte 0x00000666 +_0807E424: .4byte 0x0000067a +_0807E428: .4byte gUnknown_80F9C4C +_0807E42C: .4byte gUnknown_80F5FAC +_0807E430: .4byte 0x00003a0e +_0807E434: + cmp r0, 0x1 + bne _0807E4A0 + ldr r2, _0807E490 + adds r0, r1, r2 + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r0, 0x95 + ble _0807E446 + b _0807E564 +_0807E446: + bl sub_805E804 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_806A2BC + adds r0, r4, 0 + bl sub_807520C + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _0807E464 + b _0807E564 +_0807E464: + ldr r0, _0807E494 + ldr r1, [r0] + adds r0, r4, 0 + bl sub_80522A8 + ldr r1, _0807E498 + ldr r0, [r5] + ldr r2, _0807E49C + adds r0, r2 + movs r3, 0 + ldrsh r0, [r0, r3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x1 + bl sub_80426C8 + ldr r0, [r5] + adds r0, r7 + movs r1, 0x2 + strb r1, [r0] + b _0807E564 + .align 2, 0 +_0807E490: .4byte 0x00000666 +_0807E494: .4byte gUnknown_80F9C70 +_0807E498: .4byte gUnknown_80F5FAC +_0807E49C: .4byte 0x00003a0e +_0807E4A0: + cmp r0, 0x2 + bne _0807E508 + ldr r2, _0807E4F8 + adds r0, r1, r2 + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r0, 0x31 + bgt _0807E564 + bl sub_805E804 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_806A2BC + adds r0, r4, 0 + bl sub_807520C + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _0807E564 + ldr r0, _0807E4FC + ldr r1, [r0] + adds r0, r4, 0 + bl sub_80522A8 + ldr r1, _0807E500 + ldr r0, [r5] + ldr r2, _0807E504 + adds r0, r2 + movs r3, 0 + ldrsh r0, [r0, r3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x2 + bl sub_80426C8 + ldr r0, [r5] + adds r0, r7 + movs r1, 0x3 + strb r1, [r0] + b _0807E564 + .align 2, 0 +_0807E4F8: .4byte 0x00000666 +_0807E4FC: .4byte gUnknown_80F9C8C +_0807E500: .4byte gUnknown_80F5FAC +_0807E504: .4byte 0x00003a0e +_0807E508: + ldr r5, _0807E56C + adds r0, r1, r5 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bgt _0807E564 + bl sub_805E804 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_806A2BC + adds r0, r4, 0 + bl sub_807520C + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _0807E564 + ldr r0, _0807E570 + ldr r1, [r0] + adds r0, r4, 0 + bl sub_80522A8 + ldr r1, _0807E574 + ldr r0, [r6] + ldr r2, _0807E578 + adds r0, r2 + movs r3, 0 + ldrsh r0, [r0, r3] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x3 + bl sub_80426C8 + ldr r0, [r6] + adds r0, r7 + movs r1, 0x4 + strb r1, [r0] + ldr r1, _0807E57C + adds r0, r4, 0 + adds r2, r4, 0 + bl sub_8068FE0 +_0807E564: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0807E56C: .4byte 0x00000666 +_0807E570: .4byte gUnknown_80F9CBC +_0807E574: .4byte gUnknown_80F5FAC +_0807E578: .4byte 0x00003a0e +_0807E57C: .4byte 0x0000021e + thumb_func_end sub_807E378 + + thumb_func_start sub_807E580 +sub_807E580: + push {lr} + cmp r0, 0 + beq _0807E596 + movs r1, 0x2D + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _0807E596 + movs r0, 0 + b _0807E5A0 +_0807E596: + ldr r0, _0807E5A4 + ldr r0, [r0] + ldr r1, _0807E5A8 + adds r0, r1 + ldrb r0, [r0] +_0807E5A0: + pop {r1} + bx r1 + .align 2, 0 +_0807E5A4: .4byte gUnknown_203B418 +_0807E5A8: .4byte 0x0000e264 + thumb_func_end sub_807E580 + + thumb_func_start sub_807E5AC +sub_807E5AC: + push {lr} + ldr r0, _0807E5DC + ldr r0, [r0] + ldr r1, _0807E5E0 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x8 + bne _0807E5C6 + movs r0, 0x8 + bl sub_8084100 + lsls r0, 24 + lsrs r0, 24 +_0807E5C6: + bl sub_807E5E4 + bl sub_8069E8C + movs r0, 0 + movs r1, 0x1 + bl sub_807EAA0 + pop {r0} + bx r0 + .align 2, 0 +_0807E5DC: .4byte gUnknown_203B418 +_0807E5E0: .4byte 0x0001c578 + thumb_func_end sub_807E5AC + + thumb_func_start sub_807E5E4 +sub_807E5E4: + push {r4-r6,lr} + ldr r3, _0807E674 + ldr r1, [r3] + ldr r2, _0807E678 + adds r1, r2 + movs r4, 0 + strb r0, [r1] + ldr r0, [r3] + adds r2, r0, r2 + ldrb r1, [r2] + ldr r2, _0807E67C + adds r0, r2 + strb r1, [r0] + ldr r0, [r3] + ldr r1, _0807E680 + adds r0, r1 + strb r4, [r0] + movs r2, 0 + adds r4, r3, 0 + ldr r6, _0807E684 + movs r1, 0 + ldr r5, _0807E688 +_0807E610: + ldr r0, [r4] + adds r0, r6 + adds r0, r2 + strb r1, [r0] + ldr r0, [r4] + adds r0, r5 + adds r0, r2 + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x7 + ble _0807E610 + ldr r0, [r3] + ldr r2, _0807E68C + adds r0, r2 + movs r2, 0 + movs r1, 0x9 + strb r1, [r0] + ldr r0, [r3] + ldr r1, _0807E690 + adds r0, r1 + strb r2, [r0] + ldr r0, [r3] + adds r1, 0x1 + adds r0, r1 + strb r2, [r0] + movs r6, 0xBE + lsls r6, 1 + ldr r5, _0807E694 + movs r4, 0xBF + lsls r4, 1 +_0807E64C: + ldr r0, [r3] + lsls r1, r2, 2 + adds r0, r1 + adds r0, r6 + strb r2, [r0] + ldr r0, [r3] + adds r0, r1 + adds r0, r5 + strb r2, [r0] + ldr r0, [r3] + adds r0, r1 + adds r0, r4 + strb r2, [r0] + adds r2, 0x1 + cmp r2, 0xFF + ble _0807E64C + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0807E674: .4byte gUnknown_203B418 +_0807E678: .4byte 0x0000e265 +_0807E67C: .4byte 0x0000e264 +_0807E680: .4byte 0x0000e279 +_0807E684: .4byte 0x0000e267 +_0807E688: .4byte 0x0000e26f +_0807E68C: .4byte 0x0000e266 +_0807E690: .4byte 0x0000e277 +_0807E694: .4byte 0x0000017d + thumb_func_end sub_807E5E4 + + thumb_func_start sub_807E698 +sub_807E698: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + movs r0, 0 + bl sub_807E580 + lsls r0, 24 + lsrs r0, 16 + str r0, [sp, 0x4] + ldr r0, _0807E724 + ldr r0, [r0] + ldr r0, [r0, 0x4] + mov r10, r0 + movs r0, 0 + bl sub_807E580 + lsls r0, 24 + lsrs r0, 24 + ldr r1, [sp] + bl sub_8042818 + movs r0, 0x25 + bl sub_803E46C + movs r0, 0x1 + bl sub_804178C + ldr r1, _0807E728 + ldrb r0, [r1] + str r0, [sp, 0x8] + movs r0, 0x1 + strb r0, [r1] + movs r1, 0 + mov r9, r1 + ldr r2, _0807E72C + mov r8, r2 +_0807E6EC: + movs r7, 0 + movs r0, 0x25 + bl sub_803E46C + movs r6, 0 + ldr r1, [sp, 0x4] + lsls r0, r1, 2 + mov r2, r10 + adds r5, r0, r2 + movs r0, 0xFF + mov r12, r0 +_0807E702: + mov r1, r8 + ldr r0, [r1] + adds r0, r6 + movs r2, 0xBE + lsls r2, 1 + adds r4, r0, r2 + ldrb r0, [r4] + ldrb r3, [r5] + subs r1, r0, r3 + cmp r1, 0 + bge _0807E71A + negs r1, r1 +_0807E71A: + cmp r1, 0x9 + bgt _0807E730 + strb r3, [r4] + b _0807E746 + .align 2, 0 +_0807E724: .4byte gUnknown_202ECA0 +_0807E728: .4byte gUnknown_203B40D +_0807E72C: .4byte gUnknown_203B418 +_0807E730: + movs r7, 0x1 + adds r2, r0, 0 + adds r1, r3, 0 + cmp r2, r1 + bcs _0807E73E + adds r0, 0xA + b _0807E744 +_0807E73E: + cmp r2, r1 + bls _0807E746 + subs r0, 0xA +_0807E744: + strb r0, [r4] +_0807E746: + mov r1, r8 + ldr r0, [r1] + adds r0, r6 + ldr r2, _0807E764 + adds r4, r0, r2 + ldrb r0, [r4] + ldrb r3, [r5, 0x1] + subs r1, r0, r3 + cmp r1, 0 + bge _0807E75C + negs r1, r1 +_0807E75C: + cmp r1, 0x9 + bgt _0807E768 + strb r3, [r4] + b _0807E77E + .align 2, 0 +_0807E764: .4byte 0x0000017d +_0807E768: + movs r7, 0x1 + adds r2, r0, 0 + adds r1, r3, 0 + cmp r2, r1 + bcs _0807E776 + adds r0, 0xA + b _0807E77C +_0807E776: + cmp r2, r1 + bls _0807E77E + subs r0, 0xA +_0807E77C: + strb r0, [r4] +_0807E77E: + mov r1, r8 + ldr r0, [r1] + adds r0, r6 + movs r2, 0xBF + lsls r2, 1 + adds r4, r0, r2 + ldrb r0, [r4] + ldrb r3, [r5, 0x2] + subs r1, r0, r3 + cmp r1, 0 + bge _0807E796 + negs r1, r1 +_0807E796: + cmp r1, 0x9 + bgt _0807E79E + strb r3, [r4] + b _0807E7B4 +_0807E79E: + movs r7, 0x1 + adds r2, r0, 0 + adds r1, r3, 0 + cmp r2, r1 + bcs _0807E7AC + adds r0, 0xA + b _0807E7B2 +_0807E7AC: + cmp r2, r1 + bls _0807E7B4 + subs r0, 0xA +_0807E7B2: + strb r0, [r4] +_0807E7B4: + adds r6, 0x4 + adds r5, 0x4 + movs r0, 0x1 + negs r0, r0 + add r12, r0 + mov r1, r12 + cmp r1, 0 + bge _0807E702 + movs r0, 0 + movs r1, 0 + bl sub_803E874 + cmp r7, 0 + beq _0807E7DA + movs r2, 0x1 + add r9, r2 + mov r0, r9 + cmp r0, 0x3F + ble _0807E6EC +_0807E7DA: + ldr r0, _0807E7F8 + mov r1, sp + ldrb r1, [r1, 0x8] + strb r1, [r0] + ldr r0, [sp] + bl sub_807E7FC + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0807E7F8: .4byte gUnknown_203B40D + thumb_func_end sub_807E698 + + thumb_func_start sub_807E7FC +sub_807E7FC: + push {r4-r6,lr} + lsls r0, 24 + lsrs r4, r0, 24 + ldr r6, _0807E874 + ldr r0, [r6] + ldr r1, _0807E878 + adds r0, r1 + ldr r5, [r0] + cmp r5, 0 + bne _0807E816 + bl sub_8083600 + adds r5, r0, 0 +_0807E816: + cmp r4, 0 + beq _0807E844 + ldr r0, [r6] + ldr r2, _0807E87C + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _0807E844 + ldr r4, _0807E880 + movs r0, 0 + bl sub_807E580 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + bl sub_807EA18 + ldr r0, _0807E884 + ldr r1, [r0] + adds r0, r5, 0 + bl sub_80522A8 +_0807E844: + movs r5, 0 +_0807E846: + ldr r0, _0807E874 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _0807E888 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807E866 + adds r0, r4, 0 + bl sub_807E8F0 +_0807E866: + adds r5, 0x1 + cmp r5, 0x13 + ble _0807E846 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0807E874: .4byte gUnknown_203B418 +_0807E878: .4byte 0x000181f8 +_0807E87C: .4byte 0x0001356c +_0807E880: .4byte gUnknown_202DF98 +_0807E884: .4byte gUnknown_80FC5E0 +_0807E888: .4byte 0x000135cc + thumb_func_end sub_807E7FC + + thumb_func_start sub_807E88C +sub_807E88C: + push {r4-r7,lr} + movs r0, 0 + bl sub_807E580 + lsls r0, 24 + ldr r1, _0807E8E4 + ldr r1, [r1] + ldr r1, [r1, 0x4] + movs r4, 0 + ldr r5, _0807E8E8 + lsrs r0, 14 + adds r3, r0, r1 + movs r6, 0xBE + lsls r6, 1 +_0807E8A8: + ldr r0, [r5] + lsls r2, r4, 2 + adds r0, r2 + ldrb r1, [r3] + adds r0, r6 + strb r1, [r0] + ldr r0, [r5] + adds r0, r2 + ldrb r1, [r3, 0x1] + ldr r7, _0807E8EC + adds r0, r7 + strb r1, [r0] + ldr r0, [r5] + adds r0, r2 + ldrb r1, [r3, 0x2] + movs r2, 0xBF + lsls r2, 1 + adds r0, r2 + strb r1, [r0] + adds r3, 0x4 + adds r4, 0x1 + cmp r4, 0xFF + ble _0807E8A8 + movs r0, 0 + movs r1, 0 + bl sub_803E874 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0807E8E4: .4byte gUnknown_202ECA0 +_0807E8E8: .4byte gUnknown_203B418 +_0807E8EC: .4byte 0x0000017d + thumb_func_end sub_807E88C + + thumb_func_start sub_807E8F0 +sub_807E8F0: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + adds r5, r0, 0 + movs r0, 0 + mov r8, r0 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _0807E90E + b _0807EA0A +_0807E90E: + ldr r4, [r5, 0x70] + movs r0, 0x4 + ldrsh r1, [r4, r0] + mov r9, r1 + mov r1, sp + adds r6, r4, 0 + adds r6, 0x5C + ldrb r0, [r6] + strb r0, [r1] + adds r7, r4, 0 + adds r7, 0x5D + ldrb r0, [r7] + strb r0, [r1, 0x1] + adds r0, r5, 0 + bl sub_8070774 + adds r0, r5, 0 + movs r1, 0x25 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0807E958 + adds r0, r5, 0 + bl sub_807E580 + ldr r1, _0807E954 + lsls r0, 24 + lsrs r0, 22 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r6] + mov r1, r8 + strb r1, [r7] + b _0807E984 + .align 2, 0 +_0807E954: .4byte gUnknown_80F520C +_0807E958: + adds r0, r4, 0 + adds r0, 0xC4 + ldrb r0, [r0] + cmp r0, 0xC + beq _0807E984 + adds r0, r4, 0 + adds r0, 0xF6 + ldrb r0, [r0] + cmp r0, 0 + bne _0807E984 + movs r1, 0x2 + ldrsh r0, [r4, r1] + movs r1, 0 + bl sub_808DC68 + strb r0, [r6] + movs r1, 0x2 + ldrsh r0, [r4, r1] + movs r1, 0x1 + bl sub_808DC68 + strb r0, [r7] +_0807E984: + mov r0, sp + adds r1, r4, 0 + adds r1, 0x5C + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bne _0807E9A0 + mov r0, sp + adds r1, r4, 0 + adds r1, 0x5D + ldrb r0, [r0, 0x1] + ldrb r1, [r1] + cmp r0, r1 + beq _0807E9A4 +_0807E9A0: + movs r0, 0x1 + mov r8, r0 +_0807E9A4: + ldr r1, _0807E9D0 + adds r0, r1, 0 + ldrh r1, [r4, 0x2] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x3 + bhi _0807E9FE + adds r0, r5, 0 + movs r1, 0x25 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0807E9D4 + movs r0, 0x2 + ldrsh r1, [r4, r0] + adds r0, r5, 0 + bl sub_8069F54 + b _0807E9D8 + .align 2, 0 +_0807E9D0: .4byte 0xfffffe88 +_0807E9D4: + movs r0, 0xBC + lsls r0, 1 +_0807E9D8: + strh r0, [r4, 0x4] + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, r9 + beq _0807E9FE + bl sub_80687D0 + str r0, [r5, 0x64] + adds r0, r5, 0 + bl sub_806CEBC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl sub_806CCB4 + movs r0, 0x1 + mov r8, r0 +_0807E9FE: + mov r1, r8 + cmp r1, 0 + beq _0807EA0A + adds r0, r5, 0 + bl sub_80429D8 +_0807EA0A: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_807E8F0 + + thumb_func_start sub_807EA18 +sub_807EA18: + push {lr} + lsls r1, 24 + ldr r2, _0807EA2C + lsrs r1, 22 + adds r1, r2 + ldr r1, [r1] + bl strcpy + pop {r0} + bx r0 + .align 2, 0 +_0807EA2C: .4byte gUnknown_80F9A54 + thumb_func_end sub_807EA18 + + thumb_func_start sub_807EA30 +sub_807EA30: + push {lr} + lsls r0, 24 + cmp r0, 0 + bne _0807EA6C + ldr r1, _0807EA5C + movs r0, 0 + movs r2, 0 + bl sub_808417C + ldr r1, _0807EA60 + ldr r1, [r1] + ldr r2, _0807EA64 + adds r1, r2 + strb r0, [r1] + bl sub_8083600 + ldr r1, _0807EA68 + ldr r1, [r1] + bl sub_80522A8 + b _0807EA8C + .align 2, 0 +_0807EA5C: .4byte gUnknown_80F4EAC +_0807EA60: .4byte gUnknown_203B418 +_0807EA64: .4byte 0x0000e277 +_0807EA68: .4byte gUnknown_80FAD8C +_0807EA6C: + ldr r1, _0807EA90 + movs r0, 0 + movs r2, 0 + bl sub_808417C + ldr r1, _0807EA94 + ldr r1, [r1] + ldr r2, _0807EA98 + adds r1, r2 + strb r0, [r1] + bl sub_8083600 + ldr r1, _0807EA9C + ldr r1, [r1] + bl sub_80522A8 +_0807EA8C: + pop {r0} + bx r0 + .align 2, 0 +_0807EA90: .4byte gUnknown_80F4EAC +_0807EA94: .4byte gUnknown_203B418 +_0807EA98: .4byte 0x0000e278 +_0807EA9C: .4byte gUnknown_80FADB0 + thumb_func_end sub_807EA30 + + thumb_func_start sub_807EAA0 +sub_807EAA0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + lsls r0, 24 + lsrs r0, 24 + str r0, [sp] + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x4] + movs r0, 0 + mov r8, r0 + movs r1, 0x1 + negs r1, r1 + mov r9, r1 + movs r2, 0 + str r2, [sp, 0x8] + bl sub_807E580 + lsls r0, 24 + lsrs r0, 24 + mov r10, r0 + movs r5, 0 + ldr r7, _0807EAF0 + ldr r6, _0807EAF4 +_0807EAD6: + ldr r3, [r7] + adds r0, r3, r6 + adds r4, r0, r5 + ldr r1, _0807EAF8 + adds r0, r3, r1 + adds r0, r5 + ldrb r0, [r0] + ldrb r2, [r4] + adds r1, r0, 0 + cmp r2, r1 + bcs _0807EAFC + strb r0, [r4] + b _0807EB08 + .align 2, 0 +_0807EAF0: .4byte gUnknown_203B418 +_0807EAF4: .4byte 0x0000e267 +_0807EAF8: .4byte 0x0000e26f +_0807EAFC: + cmp r2, r1 + bls _0807EB08 + adds r0, r5, r6 + adds r0, r3, r0 + bl sub_80838EC +_0807EB08: + ldr r0, [r7] + ldr r2, _0807EB38 + adds r0, r2 + adds r0, r5 + ldrb r1, [r0] + ldr r0, _0807EB3C + cmp r8, r1 + bge _0807EB1C + mov r8, r1 + mov r9, r5 +_0807EB1C: + adds r5, 0x1 + cmp r5, 0x7 + ble _0807EAD6 + mov r1, r9 + cmp r1, 0 + bge _0807EB44 + ldr r0, [r0] + ldr r2, _0807EB40 + adds r1, r0, r2 + ldrb r1, [r1] + subs r2, 0x1 + adds r0, r2 + strb r1, [r0] + b _0807EB4E + .align 2, 0 +_0807EB38: .4byte 0x0000e267 +_0807EB3C: .4byte gUnknown_203B418 +_0807EB40: .4byte 0x0000e265 +_0807EB44: + ldr r0, [r0] + ldr r1, _0807EB94 + adds r0, r1 + mov r2, r9 + strb r2, [r0] +_0807EB4E: + ldr r0, _0807EB98 + ldr r1, [r0] + ldr r2, _0807EB9C + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _0807EB64 + ldr r0, _0807EB94 + adds r1, r0 + movs r0, 0 + strb r0, [r1] +_0807EB64: + movs r0, 0 + bl sub_807E580 + lsls r0, 24 + lsrs r0, 24 + cmp r10, r0 + bne _0807EB78 + ldr r1, [sp, 0x4] + cmp r1, 0 + beq _0807EB82 +_0807EB78: + movs r2, 0x1 + str r2, [sp, 0x8] + ldr r0, [sp] + bl sub_807E698 +_0807EB82: + ldr r0, _0807EB98 + ldr r0, [r0] + ldr r2, _0807EBA0 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0 + beq _0807EBA4 + subs r0, 0x1 + b _0807EBA6 + .align 2, 0 +_0807EB94: .4byte 0x0000e264 +_0807EB98: .4byte gUnknown_203B418 +_0807EB9C: .4byte 0x0000e279 +_0807EBA0: .4byte 0x0000e266 +_0807EBA4: + movs r0, 0x9 +_0807EBA6: + strb r0, [r1] + ldr r4, _0807EC14 + ldr r0, [r4] + ldr r2, _0807EC18 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0 + beq _0807EBD4 + adds r0, r1, 0 + bl sub_80838EC + ldr r0, [r4] + ldr r1, _0807EC18 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0807EBD4 + bl sub_8083600 + ldr r1, _0807EC1C + ldr r1, [r1] + bl sub_80522A8 +_0807EBD4: + ldr r4, _0807EC14 + ldr r0, [r4] + ldr r2, _0807EC20 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0 + beq _0807EC00 + adds r0, r1, 0 + bl sub_80838EC + ldr r0, [r4] + ldr r1, _0807EC20 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0807EC00 + bl sub_8083600 + ldr r1, _0807EC24 + ldr r1, [r1] + bl sub_80522A8 +_0807EC00: + ldr r0, [sp, 0x8] + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0807EC14: .4byte gUnknown_203B418 +_0807EC18: .4byte 0x0000e277 +_0807EC1C: .4byte gUnknown_80FA778 +_0807EC20: .4byte 0x0000e278 +_0807EC24: .4byte gUnknown_80FA758 + thumb_func_end sub_807EAA0 + + thumb_func_start sub_807EC28 +sub_807EC28: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + beq _0807EC46 + b _0807EF32 +_0807EC46: + bl sub_8083600 + adds r7, r0, 0 + ldr r0, [r7, 0x70] + mov r9, r0 + ldr r4, _0807ECB4 + ldr r0, [r4] + movs r5, 0xD3 + lsls r5, 3 + adds r0, r5 + ldrb r0, [r0] + str r0, [sp, 0x8] + adds r0, r7, 0 + bl sub_8045128 + ldrh r0, [r0] + lsrs r0, 5 + mov r10, r0 + movs r0, 0x1 + mov r1, r10 + ands r1, r0 + mov r10, r1 + ldr r0, [r4] + adds r0, r5 + strb r1, [r0] + ldr r0, [r4] + ldr r3, _0807ECB8 + adds r0, r3 + mov r2, r10 + strb r2, [r0] + ldr r2, [r4] + ldr r6, _0807ECBC + adds r0, r2, r6 + ldrb r1, [r0] + cmp r1, 0 + beq _0807EC90 + b _0807EF32 +_0807EC90: + adds r6, 0x26 + adds r0, r2, r6 + ldr r0, [r0] + cmp r0, 0 + bne _0807EC9C + b _0807EF32 +_0807EC9C: + mov r0, r9 + adds r0, 0xE4 + ldrb r0, [r0] + cmp r0, 0x1 + bne _0807ECC0 + adds r0, r2, r5 + strb r1, [r0] + ldr r0, [r4] + adds r0, r3 + strb r1, [r0] + b _0807EF32 + .align 2, 0 +_0807ECB4: .4byte gUnknown_203B418 +_0807ECB8: .4byte 0x00000699 +_0807ECBC: .4byte 0x0000066e +_0807ECC0: + movs r0, 0 + str r0, [sp, 0xC] + movs r6, 0 +_0807ECC6: + ldr r0, _0807ED48 + ldr r0, [r0] + lsls r1, r6, 2 + ldr r2, _0807ED4C + adds r0, r2 + adds r0, r1 + ldr r5, [r0] + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807ED0E + ldr r0, [r5, 0x70] + ldrb r0, [r0, 0x8] + cmp r0, 0x1 + bne _0807ED0E + adds r0, r5, 0 + bl sub_8070BC0 + lsls r0, 24 + cmp r0, 0 + beq _0807ED0E + adds r0, r7, 0 + bl sub_80450FC + adds r4, r0, 0 + adds r0, r5, 0 + bl sub_80450FC + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _0807ED0E + movs r0, 0x1 + str r0, [sp, 0xC] +_0807ED0E: + adds r6, 0x1 + cmp r6, 0xF + ble _0807ECC6 + ldr r1, _0807ED50 + ldr r0, [sp] + ands r0, r1 + movs r1, 0xBE + lsls r1, 1 + orrs r0, r1 + ldr r1, _0807ED54 + ands r0, r1 + str r0, [sp] + ldr r1, [sp, 0x8] + cmp r1, 0 + bne _0807ED5C + mov r2, r10 + cmp r2, 0x1 + bne _0807ED64 + ldr r6, [sp, 0xC] + cmp r6, 0 + bne _0807ED3A + b _0807EF32 +_0807ED3A: + ldr r0, _0807ED58 + ldr r1, [r0] + mov r0, sp + movs r2, 0x1 + bl sub_80527C4 + b _0807EF32 + .align 2, 0 +_0807ED48: .4byte gUnknown_203B418 +_0807ED4C: .4byte 0x0001358c +_0807ED50: .4byte 0xffff0000 +_0807ED54: .4byte 0xff00ffff +_0807ED58: .4byte gUnknown_80FE674 +_0807ED5C: + mov r0, r10 + cmp r0, 0x1 + bne _0807ED64 + b _0807EF32 +_0807ED64: + ldr r1, [sp, 0x8] + cmp r1, 0x1 + bne _0807ED70 + mov r2, r10 + cmp r2, 0 + beq _0807ED78 +_0807ED70: + mov r6, r8 + cmp r6, 0 + bne _0807ED78 + b _0807EF32 +_0807ED78: + movs r0, 0 + str r0, [sp, 0x10] + movs r1, 0 + str r1, [sp, 0x14] + bl sub_807EF48 + lsls r0, 24 + cmp r0, 0 + bne _0807ED8C + b _0807EECC +_0807ED8C: + movs r2, 0x1 + str r2, [sp, 0x14] + movs r6, 0 +_0807ED92: + ldr r0, _0807EE90 + ldr r0, [r0] + lsls r1, r6, 2 + ldr r2, _0807EE94 + adds r0, r2 + adds r0, r1 + ldr r5, [r0] + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _0807EDAE + b _0807EEC4 +_0807EDAE: + ldr r0, [r5, 0x70] + ldrb r0, [r0, 0x8] + cmp r0, 0x1 + beq _0807EDB8 + b _0807EEC4 +_0807EDB8: + adds r0, r5, 0 + bl sub_8070BC0 + lsls r0, 24 + cmp r0, 0 + bne _0807EDC6 + b _0807EEC4 +_0807EDC6: + adds r0, r7, 0 + bl sub_80450FC + adds r4, r0, 0 + adds r0, r5, 0 + bl sub_80450FC + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _0807EEC4 + movs r6, 0x1 + str r6, [sp, 0x10] + movs r0, 0x4 + ldrsh r1, [r7, r0] + movs r2, 0x4 + ldrsh r0, [r5, r2] + subs r1, r0 + cmp r1, 0 + bge _0807EDF0 + negs r1, r1 +_0807EDF0: + cmp r1, 0x1 + bgt _0807EE10 + movs r6, 0x6 + ldrsh r1, [r7, r6] + movs r2, 0x6 + ldrsh r0, [r5, r2] + subs r1, r0 + cmp r1, 0 + bge _0807EE04 + negs r1, r1 +_0807EE04: + adds r6, r7, 0x4 + mov r9, r6 + adds r0, r5, 0x4 + mov r8, r0 + cmp r1, 0x1 + ble _0807EE72 +_0807EE10: + movs r3, 0x1 + negs r3, r3 + add r6, sp, 0x4 + adds r1, r7, 0x4 + mov r9, r1 + adds r2, r5, 0x4 + mov r8, r2 +_0807EE1E: + movs r4, 0x1 + negs r4, r4 +_0807EE22: + ldrh r0, [r7, 0x4] + adds r0, r3 + lsls r0, 16 + lsrs r0, 16 + ldr r1, _0807EE98 + ldr r2, [sp, 0x4] + ands r2, r1 + orrs r2, r0 + str r2, [sp, 0x4] + ldrh r0, [r7, 0x6] + adds r0, r4 + lsls r0, 16 + ldr r1, _0807EE9C + ands r1, r2 + orrs r1, r0 + str r1, [sp, 0x4] + movs r2, 0 + ldrsh r0, [r6, r2] + asrs r1, 16 + str r3, [sp, 0x18] + bl sub_804954C + ldrb r0, [r0, 0x9] + ldr r3, [sp, 0x18] + cmp r0, 0xFF + beq _0807EE66 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_80703A0 + lsls r0, 24 + ldr r3, [sp, 0x18] + cmp r0, 0 + beq _0807EEA0 +_0807EE66: + adds r4, 0x1 + cmp r4, 0x1 + ble _0807EE22 + adds r3, 0x1 + cmp r3, 0x1 + ble _0807EE1E +_0807EE72: + adds r0, r7, 0 + bl sub_8070BC0 + lsls r0, 24 + cmp r0, 0 + beq _0807EEAE + mov r0, r9 + mov r1, r8 + bl sub_80983D8 + adds r1, r0, 0 + adds r0, r7, 0 + bl sub_806CE34 + b _0807EEB2 + .align 2, 0 +_0807EE90: .4byte gUnknown_203B418 +_0807EE94: .4byte 0x0001358c +_0807EE98: .4byte 0xffff0000 +_0807EE9C: .4byte 0x0000ffff +_0807EEA0: + adds r0, r7, 0 + adds r1, r5, 0 + movs r2, 0x3 + adds r3, r6, 0 + bl sub_807D148 + b _0807EE72 +_0807EEAE: + movs r6, 0 + str r6, [sp, 0x10] +_0807EEB2: + mov r0, r8 + mov r1, r9 + bl sub_80983D8 + adds r1, r0, 0 + adds r0, r5, 0 + bl sub_806CE68 + b _0807EECC +_0807EEC4: + adds r6, 0x1 + cmp r6, 0xF + bgt _0807EECC + b _0807ED92 +_0807EECC: + ldr r0, [sp, 0x14] + cmp r0, 0 + beq _0807EF04 + ldr r1, [sp, 0x10] + cmp r1, 0 + beq _0807EEDE + ldr r0, [sp, 0xC] + cmp r0, 0 + bne _0807EF04 +_0807EEDE: + ldr r0, _0807EEF8 + ldr r0, [r0] + ldr r2, _0807EEFC + adds r1, r0, r2 + ldr r6, _0807EF00 + adds r0, r6 + ldr r1, [r1] + ldr r0, [r0] + cmp r1, r0 + ble _0807EF32 +_0807EEF2: + bl sub_807F33C + b _0807EF32 + .align 2, 0 +_0807EEF8: .4byte gUnknown_203B418 +_0807EEFC: .4byte 0x00000694 +_0807EF00: .4byte 0x0000068c +_0807EF04: + ldr r0, [sp, 0x10] + bl sub_807EFFC + ldr r0, [sp, 0x10] + bl sub_807F19C + cmp r0, 0 + bne _0807EEF2 + ldr r0, [sp, 0x8] + cmp r0, 0x1 + bne _0807EF32 + mov r1, r10 + cmp r1, 0 + bne _0807EF32 + ldr r2, [sp, 0xC] + cmp r2, 0 + beq _0807EF32 + ldr r0, _0807EF44 + ldr r1, [r0] + mov r0, sp + movs r2, 0x1 + bl sub_80527C4 +_0807EF32: + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0807EF44: .4byte gUnknown_80FE65C + thumb_func_end sub_807EC28 + + thumb_func_start sub_807EF48 +sub_807EF48: + push {lr} + ldr r0, _0807EF70 + ldr r2, [r0] + ldr r1, _0807EF74 + adds r0, r2, r1 + ldr r3, _0807EF78 + adds r1, r2, r3 + ldr r0, [r0] + ldr r1, [r1] + subs r0, r1 + cmp r0, 0 + bgt _0807EF7C + movs r1, 0xD2 + lsls r1, 3 + adds r0, r2, r1 + ldr r0, [r0] + cmp r0, 0 + bne _0807EF7C + movs r0, 0 + b _0807EF7E + .align 2, 0 +_0807EF70: .4byte gUnknown_203B418 +_0807EF74: .4byte 0x00000694 +_0807EF78: .4byte 0x0000068c +_0807EF7C: + movs r0, 0x1 +_0807EF7E: + pop {r1} + bx r1 + thumb_func_end sub_807EF48 + + thumb_func_start sub_807EF84 +sub_807EF84: + push {r4,lr} + sub sp, 0x4 + ldr r1, _0807EFD0 + ldr r0, [sp] + ands r0, r1 + movs r1, 0xBE + lsls r1, 1 + orrs r0, r1 + ldr r1, _0807EFD4 + ands r0, r1 + str r0, [sp] + movs r0, 0x1 + bl sub_807EFFC + movs r0, 0x1 + bl sub_807F19C + adds r4, r0, 0 + cmp r4, 0 + beq _0807EFE2 + bl sub_8083600 + bl sub_8045128 + ldrh r1, [r0] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0807EFDC + cmp r4, 0x2 + beq _0807EFEE + ldr r0, _0807EFD8 + ldr r1, [r0] + mov r0, sp + movs r2, 0x1 + bl sub_80527C4 + b _0807EFEE + .align 2, 0 +_0807EFD0: .4byte 0xffff0000 +_0807EFD4: .4byte 0xff00ffff +_0807EFD8: .4byte gUnknown_80FE63C +_0807EFDC: + bl sub_807F33C + b _0807EFEE +_0807EFE2: + ldr r0, _0807EFF8 + ldr r1, [r0] + mov r0, sp + movs r2, 0x1 + bl sub_80527C4 +_0807EFEE: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0807EFF8: .4byte gUnknown_80FE5F0 + thumb_func_end sub_807EF84 + + thumb_func_start sub_807EFFC +sub_807EFFC: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r3, r0, 24 + ldr r4, _0807F168 + ldr r0, [r4] + movs r5, 0xD2 + lsls r5, 3 + adds r2, r0, r5 + ldr r0, [r2] + cmp r0, 0 + bne _0807F01E + b _0807F158 +_0807F01E: + ldr r1, _0807F16C + ldr r0, [sp] + ands r0, r1 + movs r1, 0xBE + lsls r1, 1 + orrs r0, r1 + ldr r1, _0807F170 + ands r0, r1 + str r0, [sp] + cmp r3, 0 + bne _0807F036 + b _0807F158 +_0807F036: + ldr r1, _0807F174 + ldr r0, [r2] + str r0, [r1] + ldr r0, _0807F178 + ldr r1, [r0] + mov r0, sp + movs r2, 0x1 + bl sub_8052B8C + cmp r0, 0x1 + beq _0807F04E + b _0807F158 +_0807F04E: + movs r0, 0xA6 + lsls r0, 1 + bl sub_8083E38 + ldr r0, [r4] + adds r0, r5 + ldr r0, [r0] + bl sub_80913A0 + ldr r0, [r4] + ldr r2, _0807F17C + adds r1, r0, r2 + ldr r1, [r1] + str r1, [sp, 0xC] + ldr r2, _0807F180 + adds r1, r0, r2 + ldr r6, [r1] + ldr r1, _0807F184 + adds r0, r1 + ldr r0, [r0] + cmp r6, r0 + bgt _0807F134 + mov r8, r4 +_0807F07C: + mov r2, r8 + ldr r0, [r2] + ldr r2, _0807F188 + adds r1, r0, r2 + ldr r5, [r1] + ldr r1, _0807F18C + adds r0, r1 + ldr r0, [r0] + adds r2, r6, 0x1 + mov r10, r2 + cmp r5, r0 + bgt _0807F124 + lsls r0, r6, 16 + lsrs r0, 16 + mov r9, r0 +_0807F09A: + lsls r0, r5, 16 + mov r1, r9 + orrs r0, r1 + str r0, [sp, 0x4] + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_804954C + adds r4, r0, 0 + ldrh r1, [r4] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0807F114 + ldr r0, [r4, 0x14] + cmp r0, 0 + beq _0807F114 + bl sub_80450F8 + cmp r0, 0x3 + bne _0807F114 + ldr r0, [r4, 0x14] + bl sub_8045108 + adds r2, r0, 0 + ldrb r1, [r2] + movs r7, 0x2 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _0807F114 + ldr r0, [r2] + str r0, [sp, 0x8] + add r4, sp, 0x4 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80461C8 + ldr r0, [sp, 0x8] + lsrs r0, 16 + lsls r0, 24 + lsrs r0, 24 + bl sub_80914E4 + lsls r0, 24 + add r3, sp, 0x8 + cmp r0, 0 + beq _0807F10A + ldrb r0, [r3] + adds r2, r7, 0 + orrs r2, r0 + ldr r1, _0807F190 + ldr r0, [sp, 0x8] + ands r0, r1 + orrs r0, r2 + str r0, [sp, 0x8] +_0807F10A: + adds r0, r4, 0 + adds r1, r3, 0 + movs r2, 0x1 + bl sub_80460F8 +_0807F114: + adds r5, 0x1 + mov r2, r8 + ldr r0, [r2] + ldr r1, _0807F18C + adds r0, r1 + ldr r0, [r0] + cmp r5, r0 + ble _0807F09A +_0807F124: + mov r6, r10 + mov r2, r8 + ldr r0, [r2] + ldr r1, _0807F184 + adds r0, r1 + ldr r0, [r0] + cmp r6, r0 + ble _0807F07C +_0807F134: + ldr r0, _0807F168 + ldr r0, [r0] + ldr r1, _0807F194 + adds r2, r0, r1 + subs r1, 0x8 + adds r0, r1 + ldr r1, [r0] + ldr r0, [sp, 0xC] + subs r1, r0 + ldr r0, [r2] + adds r0, r1 + str r0, [r2] + ldr r0, _0807F198 + ldr r1, [r0] + mov r0, sp + movs r2, 0x1 + bl sub_80527C4 +_0807F158: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0807F168: .4byte gUnknown_203B418 +_0807F16C: .4byte 0xffff0000 +_0807F170: .4byte 0xff00ffff +_0807F174: .4byte gUnknown_202DE30 +_0807F178: .4byte gUnknown_80FE5C0 +_0807F17C: .4byte 0x0000068c +_0807F180: .4byte 0x0000e240 +_0807F184: .4byte 0x0000e248 +_0807F188: .4byte 0x0000e244 +_0807F18C: .4byte 0x0000e24c +_0807F190: .4byte 0xffffff00 +_0807F194: .4byte 0x00000694 +_0807F198: .4byte gUnknown_80FE4F4 + thumb_func_end sub_807EFFC + + thumb_func_start sub_807F19C +sub_807F19C: + push {r4-r7,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r2, r0, 24 + ldr r1, _0807F1EC + ldr r0, [sp] + ands r0, r1 + movs r1, 0xBE + lsls r1, 1 + orrs r0, r1 + ldr r1, _0807F1F0 + ands r0, r1 + str r0, [sp] + ldr r0, _0807F1F4 + ldr r0, [r0] + ldr r3, _0807F1F8 + adds r1, r0, r3 + subs r3, 0x8 + adds r0, r3 + ldr r1, [r1] + ldr r0, [r0] + subs r4, r1, r0 + cmp r4, 0 + bgt _0807F1CE + b _0807F31A +_0807F1CE: + cmp r2, 0 + beq _0807F1E6 + ldr r0, _0807F1FC + str r4, [r0] + ldr r0, _0807F200 + ldr r1, [r0] + mov r0, sp + movs r2, 0x1 + bl sub_8052B8C + cmp r0, 0x1 + beq _0807F204 +_0807F1E6: + movs r0, 0x1 + b _0807F31C + .align 2, 0 +_0807F1EC: .4byte 0xffff0000 +_0807F1F0: .4byte 0xff00ffff +_0807F1F4: .4byte gUnknown_203B418 +_0807F1F8: .4byte 0x00000694 +_0807F1FC: .4byte gUnknown_202DE30 +_0807F200: .4byte gUnknown_80FE568 +_0807F204: + ldr r0, _0807F224 + ldr r0, [r0] + movs r1, 0x98 + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + cmp r0, r4 + bge _0807F22C + ldr r0, _0807F228 + ldr r1, [r0] + mov r0, sp + movs r2, 0x1 + bl sub_80527C4 + movs r0, 0x2 + b _0807F31C + .align 2, 0 +_0807F224: .4byte gUnknown_203B460 +_0807F228: .4byte gUnknown_80FE520 +_0807F22C: + movs r0, 0xA6 + lsls r0, 1 + bl sub_8083E38 + negs r0, r4 + bl sub_80913A0 + movs r6, 0 +_0807F23C: + movs r5, 0 + adds r7, r6, 0x1 +_0807F240: + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_804954C + adds r4, r0, 0 + ldrh r1, [r4] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _0807F27E + ldr r0, [r4, 0x14] + cmp r0, 0 + beq _0807F27E + bl sub_80450F8 + cmp r0, 0x3 + bne _0807F27E + ldr r0, [r4, 0x14] + bl sub_8045108 + adds r4, r0, 0 + ldrb r0, [r4, 0x2] + bl sub_80914E4 + lsls r0, 24 + cmp r0, 0 + beq _0807F27E + ldrb r1, [r4] + movs r0, 0xFD + ands r0, r1 + strb r0, [r4] +_0807F27E: + adds r5, 0x1 + cmp r5, 0x1F + ble _0807F240 + adds r6, r7, 0 + cmp r6, 0x37 + ble _0807F23C + movs r5, 0 +_0807F28C: + ldr r0, _0807F324 + lsls r1, r5, 2 + ldr r0, [r0] + adds r4, r0, r1 + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0807F2B2 + ldrb r0, [r4, 0x2] + bl sub_80914E4 + lsls r0, 24 + cmp r0, 0 + beq _0807F2B2 + ldrb r1, [r4] + movs r0, 0xFD + ands r0, r1 + strb r0, [r4] +_0807F2B2: + adds r5, 0x1 + cmp r5, 0x13 + ble _0807F28C + movs r5, 0 +_0807F2BA: + ldr r0, _0807F328 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _0807F32C + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807F2F8 + ldr r0, [r4, 0x70] + adds r4, r0, 0 + adds r4, 0x60 + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0807F2F8 + ldrb r0, [r4, 0x2] + bl sub_80914E4 + lsls r0, 24 + cmp r0, 0 + beq _0807F2F8 + ldrb r1, [r4] + movs r0, 0xFD + ands r0, r1 + strb r0, [r4] +_0807F2F8: + adds r5, 0x1 + cmp r5, 0x13 + ble _0807F2BA + ldr r0, _0807F328 + ldr r0, [r0] + ldr r3, _0807F330 + adds r1, r0, r3 + ldr r2, _0807F334 + adds r0, r2 + ldr r0, [r0] + str r0, [r1] + ldr r0, _0807F338 + ldr r1, [r0] + mov r0, sp + movs r2, 0x1 + bl sub_80527C4 +_0807F31A: + movs r0, 0 +_0807F31C: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0807F324: .4byte gUnknown_203B460 +_0807F328: .4byte gUnknown_203B418 +_0807F32C: .4byte 0x000135cc +_0807F330: .4byte 0x00000694 +_0807F334: .4byte 0x0000068c +_0807F338: .4byte gUnknown_80FE4D4 + thumb_func_end sub_807F19C + + thumb_func_start sub_807F33C +sub_807F33C: + push {r4-r7,lr} + ldr r2, _0807F41C + ldr r0, [r2] + ldr r1, _0807F420 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r2] + ldr r2, _0807F424 + adds r0, r2 + strb r1, [r0] + bl sub_8083600 + ldr r1, _0807F428 + ldr r1, [r1] + bl sub_80522A8 + movs r6, 0 +_0807F360: + movs r5, 0 + adds r7, r6, 0x1 +_0807F364: + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_804954C + adds r4, r0, 0 + ldr r0, [r4, 0x14] + cmp r0, 0 + beq _0807F38A + bl sub_80450F8 + cmp r0, 0x3 + bne _0807F38A + ldr r0, [r4, 0x14] + bl sub_8045108 + ldrb r2, [r0] + movs r1, 0xFD + ands r1, r2 + strb r1, [r0] +_0807F38A: + adds r5, 0x1 + cmp r5, 0x1F + ble _0807F364 + adds r6, r7, 0 + cmp r6, 0x37 + ble _0807F360 + movs r6, 0 + ldr r4, _0807F42C + movs r5, 0x1 + movs r3, 0xFD +_0807F39E: + lsls r1, r6, 2 + ldr r0, [r4] + adds r2, r0, r1 + ldrb r1, [r2] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _0807F3B4 + adds r0, r3, 0 + ands r0, r1 + strb r0, [r2] +_0807F3B4: + adds r6, 0x1 + cmp r6, 0x13 + ble _0807F39E + movs r6, 0 +_0807F3BC: + ldr r0, _0807F41C + ldr r0, [r0] + lsls r1, r6, 2 + ldr r3, _0807F430 + adds r0, r3 + adds r0, r1 + ldr r5, [r0] + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807F3F4 + ldr r4, [r5, 0x70] + movs r0, 0 + strb r0, [r4, 0x8] + adds r0, r5, 0 + bl sub_8070774 + adds r4, 0x60 + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0807F3F4 + movs r0, 0xFD + ands r0, r1 + strb r0, [r4] +_0807F3F4: + adds r6, 0x1 + cmp r6, 0x13 + ble _0807F3BC + ldr r0, _0807F41C + ldr r1, [r0] + ldr r2, _0807F434 + adds r0, r1, r2 + movs r2, 0 + str r2, [r0] + ldr r3, _0807F438 + adds r0, r1, r3 + str r2, [r0] + movs r0, 0xD2 + lsls r0, 3 + adds r1, r0 + str r2, [r1] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0807F41C: .4byte gUnknown_203B418 +_0807F420: .4byte 0x0000066e +_0807F424: .4byte 0x0000066f +_0807F428: .4byte gUnknown_80FE4B8 +_0807F42C: .4byte gUnknown_203B460 +_0807F430: .4byte 0x000135cc +_0807F434: .4byte 0x00000694 +_0807F438: .4byte 0x0000068c + thumb_func_end sub_807F33C + + thumb_func_start sub_807F43C +sub_807F43C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10C + str r0, [sp, 0xEC] + mov r8, r1 + mov r0, r8 + movs r1, 0xE + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _0807F470 + ldr r0, _0807F468 + mov r1, r8 + movs r2, 0 + bl sub_8045B94 + ldr r0, _0807F46C + b _0807F694 + .align 2, 0 +_0807F468: .4byte gUnknown_202DF98 +_0807F46C: .4byte gUnknown_80FCB40 +_0807F470: + ldr r0, [sp, 0xEC] + cmp r0, r8 + bne _0807F490 + ldr r0, _0807F488 + mov r1, r8 + movs r2, 0 + bl sub_8045B94 + ldr r0, _0807F48C + ldr r2, [r0] + mov r0, r8 + b _0807F698 + .align 2, 0 +_0807F488: .4byte gUnknown_202DF98 +_0807F48C: .4byte gUnknown_80FCB70 +_0807F490: + mov r1, r8 + ldr r0, [r1, 0x4] + add r1, sp, 0xD4 + str r0, [r1] + movs r2, 0 + str r2, [sp, 0xF0] +_0807F49C: + movs r3, 0 + mov r9, r3 + movs r7, 0 + mov r4, sp + adds r4, 0x18 + str r4, [sp, 0x108] +_0807F4A8: + ldr r0, _0807F504 + ldr r0, [r0] + lsls r1, r7, 2 + ldr r2, _0807F508 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + adds r3, r7, 0x1 + str r3, [sp, 0x104] + cmp r0, 0 + bne _0807F4C8 + b _0807F602 +_0807F4C8: + ldr r0, [sp, 0xEC] + cmp r0, r4 + bne _0807F4D0 + b _0807F602 +_0807F4D0: + cmp r8, r4 + bne _0807F4D6 + b _0807F602 +_0807F4D6: + adds r1, r4, 0 + bl sub_8045990 + lsls r0, 24 + cmp r0, 0 + bne _0807F4E4 + b _0807F602 +_0807F4E4: + ldr r1, [sp, 0xF0] + cmp r1, 0 + bne _0807F50C + ldr r0, [sp, 0xEC] + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_8071598 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _0807F500 + b _0807F602 +_0807F500: + b _0807F51E + .align 2, 0 +_0807F504: .4byte gUnknown_203B418 +_0807F508: .4byte 0x000135cc +_0807F50C: + ldr r0, [sp, 0xEC] + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_8071598 + lsls r0, 24 + cmp r0, 0 + bne _0807F602 +_0807F51E: + ldr r2, [sp, 0xF0] + cmp r2, 0 + bne _0807F594 + movs r5, 0 + add r6, sp, 0xC8 + adds r3, r7, 0x1 + str r3, [sp, 0x104] + adds r7, r6, 0 + ldr r0, _0807F588 + mov r10, r0 +_0807F532: + ldr r0, _0807F58C + lsls r3, r5, 2 + adds r3, r0 + ldrh r0, [r4, 0x4] + ldrh r1, [r3] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + ldr r1, [r6] + mov r2, r10 + ands r1, r2 + orrs r1, r0 + str r1, [r7] + ldrh r2, [r4, 0x6] + ldrh r3, [r3, 0x2] + adds r2, r3 + lsls r2, 16 + ldr r0, _0807F590 + ands r1, r0 + orrs r1, r2 + str r1, [r7] + mov r0, r8 + add r1, sp, 0xC8 + bl sub_80703A0 + lsls r0, 24 + cmp r0, 0 + beq _0807F570 + adds r5, 0x1 + cmp r5, 0x7 + ble _0807F532 +_0807F570: + cmp r5, 0x8 + beq _0807F602 + mov r3, r9 + cmp r3, 0x27 + bgt _0807F602 + ldr r0, [r4, 0x4] + ldr r4, [sp, 0x108] + stm r4!, {r0} + str r4, [sp, 0x108] + movs r0, 0x1 + add r9, r0 + b _0807F602 + .align 2, 0 +_0807F588: .4byte 0xffff0000 +_0807F58C: .4byte gUnknown_80F4448 +_0807F590: .4byte 0x0000ffff +_0807F594: + movs r5, 0 + add r6, sp, 0xCC + adds r1, r7, 0x1 + str r1, [sp, 0x104] + adds r7, r6, 0 + mov r2, r9 + lsls r0, r2, 2 + add r0, sp + adds r0, 0x18 + mov r10, r0 +_0807F5A8: + ldr r0, _0807F630 + lsls r3, r5, 2 + adds r3, r0 + ldrh r0, [r4, 0x4] + ldrh r1, [r3] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + ldr r2, _0807F634 + ldr r1, [r6] + ands r1, r2 + orrs r1, r0 + str r1, [r7] + ldrh r2, [r4, 0x6] + ldrh r3, [r3, 0x2] + adds r2, r3 + lsls r2, 16 + ldr r0, _0807F638 + ands r1, r0 + orrs r1, r2 + str r1, [r7] + mov r0, r8 + add r1, sp, 0xCC + bl sub_80703A0 + lsls r0, 24 + cmp r0, 0 + bne _0807F5FC + mov r2, r9 + cmp r2, 0x27 + bgt _0807F5FC + ldr r0, [r6] + mov r3, r10 + adds r3, 0x4 + mov r10, r3 + subs r3, 0x4 + stm r3!, {r0} + ldr r0, [sp, 0x108] + adds r0, 0x4 + str r0, [sp, 0x108] + movs r1, 0x1 + add r9, r1 +_0807F5FC: + adds r5, 0x1 + cmp r5, 0x7 + ble _0807F5A8 +_0807F602: + ldr r7, [sp, 0x104] + cmp r7, 0x13 + bgt _0807F60A + b _0807F4A8 +_0807F60A: + mov r2, r9 + cmp r2, 0 + bne _0807F63C + ldr r3, [sp, 0xF0] + adds r3, 0x1 + str r3, [sp, 0xF0] + cmp r3, 0x1 + bgt _0807F61C + b _0807F49C +_0807F61C: + ldr r0, [sp, 0xEC] + adds r0, 0x4 + add r4, sp, 0xB8 + adds r1, r4, 0 + bl sub_80833E8 + movs r7, 0 + add r5, sp, 0xD0 + adds r6, r5, 0 + b _0807F654 + .align 2, 0 +_0807F630: .4byte gUnknown_80F4448 +_0807F634: .4byte 0xffff0000 +_0807F638: .4byte 0x0000ffff +_0807F63C: + mov r0, r9 + bl sub_8084100 + lsls r0, 2 + add r0, sp + adds r0, 0x18 + ldr r0, [r0] + str r0, [sp, 0xD4] + b _0807F6A8 +_0807F64E: + ldr r0, [r5] + str r0, [sp, 0xD4] + b _0807F68E +_0807F654: + ldr r0, [r4] + ldr r1, [r4, 0x8] + bl sub_808411C + lsls r0, 16 + lsrs r0, 16 + ldr r2, _0807F6A0 + ldr r1, [r5] + ands r1, r2 + orrs r1, r0 + str r1, [r6] + ldr r0, [r4, 0x4] + ldr r1, [r4, 0xC] + bl sub_808411C + lsls r0, 16 + ldrh r1, [r6] + orrs r1, r0 + str r1, [r6] + mov r0, r8 + add r1, sp, 0xD0 + bl sub_80703A0 + lsls r0, 24 + cmp r0, 0 + beq _0807F64E + adds r7, 0x1 + cmp r7, 0x63 + ble _0807F654 +_0807F68E: + cmp r7, 0x64 + bne _0807F6A8 + ldr r0, _0807F6A4 +_0807F694: + ldr r2, [r0] + ldr r0, [sp, 0xEC] +_0807F698: + mov r1, r8 + bl sub_80522F4 + b _0807F99C + .align 2, 0 +_0807F6A0: .4byte 0xffff0000 +_0807F6A4: .4byte gUnknown_80FE6B4 +_0807F6A8: + ldr r0, _0807F860 + mov r1, r8 + movs r2, 0 + bl sub_8045B94 + ldr r0, _0807F864 + ldr r2, [r0] + ldr r0, [sp, 0xEC] + mov r1, r8 + bl sub_80522F4 + mov r0, r8 + bl sub_8045888 + lsls r0, 24 + cmp r0, 0 + beq _0807F6D0 + ldr r0, _0807F868 + bl sub_8083E38 +_0807F6D0: + movs r4, 0 + str r4, [sp, 0x100] + mov r1, r8 + ldr r0, [r1, 0x70] + adds r0, 0x46 + ldrb r0, [r0] + mov r9, r0 + add r2, sp, 0xD4 + movs r3, 0 + ldrsh r1, [r2, r3] + mov r4, r8 + movs r3, 0x4 + ldrsh r0, [r4, r3] + subs r3, r1, r0 + movs r4, 0x2 + ldrsh r1, [r2, r4] + mov r2, r8 + movs r4, 0x6 + ldrsh r0, [r2, r4] + subs r1, r0 + cmp r1, r3 + bge _0807F6FE + adds r1, r3, 0 +_0807F6FE: + lsls r6, r1, 4 + cmp r6, 0x50 + ble _0807F706 + movs r6, 0x50 +_0807F706: + cmp r6, 0x9 + bgt _0807F70C + movs r6, 0xA +_0807F70C: + mov r1, r8 + adds r1, 0x4 + add r0, sp, 0xD4 + bl sub_80983D8 + adds r5, r0, 0 + add r2, sp, 0xD4 + movs r1, 0 + ldrsh r0, [r2, r1] + lsls r4, r0, 1 + adds r4, r0 + lsls r4, 11 + movs r3, 0xC0 + lsls r3, 4 + adds r4, r3 + ldr r0, _0807F86C + lsls r5, 2 + adds r5, r0 + movs r1, 0 + ldrsh r0, [r5, r1] + lsls r0, 8 + movs r1, 0x3 + bl __divsi3 + adds r4, r0 + str r4, [sp, 0xF4] + movs r3, 0xD6 + add r3, sp + movs r2, 0 + ldrsh r0, [r3, r2] + lsls r4, r0, 1 + adds r4, r0 + lsls r4, 11 + movs r0, 0x80 + lsls r0, 5 + adds r4, r0 + movs r1, 0x2 + ldrsh r0, [r5, r1] + lsls r0, 8 + movs r1, 0x3 + bl __divsi3 + adds r4, r0 + str r4, [sp, 0xF8] + mov r2, r8 + ldr r5, [r2, 0xC] + ldr r3, [sp, 0xF4] + subs r0, r3, r5 + adds r1, r6, 0 + bl __divsi3 + str r0, [sp, 0xFC] + mov r0, r8 + ldr r4, [r0, 0x10] + ldr r1, [sp, 0xF8] + subs r0, r1, r4 + adds r1, r6, 0 + bl __divsi3 + mov r10, r0 + add r0, sp, 0xD8 + str r5, [r0] + str r4, [r0, 0x4] + movs r7, 0 + adds r5, r0, 0 + cmp r7, r6 + bge _0807F7FC + adds r4, r5, 0 +_0807F794: + ldr r0, [r5] + ldr r2, [sp, 0xFC] + adds r0, r2, r0 + str r0, [r4] + ldr r0, [r4, 0x4] + add r0, r10 + str r0, [r4, 0x4] + mov r0, r8 + adds r1, r4, 0 + bl sub_804535C + mov r0, r8 + bl sub_8045888 + lsls r0, 24 + cmp r0, 0 + beq _0807F7E6 + ldr r0, [sp, 0x100] + bl sub_8009C7C + lsls r0, 5 + mov r3, r8 + str r0, [r3, 0x1C] + movs r0, 0x3B + bl sub_803E46C + movs r0, 0x3 + ands r0, r7 + cmp r0, 0 + bne _0807F7E6 + movs r0, 0x7 + mov r1, r9 + ands r1, r0 + mov r9, r1 + mov r0, r8 + movs r1, 0x6 + mov r2, r9 + bl sub_806CDD4 + movs r2, 0x1 + add r9, r2 +_0807F7E6: + movs r0, 0x80 + lsls r0, 4 + adds r1, r6, 0 + bl __divsi3 + ldr r3, [sp, 0x100] + adds r3, r0 + str r3, [sp, 0x100] + adds r7, 0x1 + cmp r7, r6 + blt _0807F794 +_0807F7FC: + ldr r4, [sp, 0xF4] + str r4, [r5] + add r1, sp, 0xD8 + ldr r0, [sp, 0xF8] + str r0, [r1, 0x4] + movs r0, 0 + mov r2, r8 + str r0, [r2, 0x1C] + mov r0, r8 + bl sub_804535C + movs r0, 0x3B + bl sub_803E46C + mov r3, r8 + ldr r0, [r3, 0x70] + movs r1, 0x7 + mov r4, r9 + ands r4, r1 + adds r0, 0x46 + strb r4, [r0] + add r2, sp, 0xD4 + movs r1, 0 + ldrsh r0, [r2, r1] + adds r4, r2, 0 + movs r3, 0x2 + ldrsh r1, [r4, r3] + bl sub_804954C + ldr r6, [r0, 0x10] + adds r0, r6, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + bne _0807F876 + add r2, sp, 0xD4 + movs r0, 0 + ldrsh r1, [r2, r0] + movs r3, 0x2 + ldrsh r2, [r4, r3] + mov r0, r8 + movs r3, 0x1 + bl sub_80694C0 + mov r0, r8 + bl sub_807F9BC + b _0807F99C + .align 2, 0 +_0807F860: .4byte gUnknown_202DF98 +_0807F864: .4byte gUnknown_80FE690 +_0807F868: .4byte 0x000001a3 +_0807F86C: .4byte gUnknown_80F4448 +_0807F870: + ldr r0, [r7] + str r0, [sp, 0xD4] + b _0807F8BE +_0807F876: + movs r5, 0 + add r4, sp, 0xE0 + adds r7, r4, 0 +_0807F87C: + ldr r0, _0807F8D0 + lsls r3, r5, 2 + adds r3, r0 + add r1, sp, 0xD4 + ldrh r0, [r1] + ldrh r2, [r3] + adds r0, r2 + lsls r0, 16 + lsrs r0, 16 + ldr r2, _0807F8D4 + ldr r1, [r7] + ands r1, r2 + orrs r1, r0 + str r1, [r4] + add r0, sp, 0xD4 + ldrh r2, [r0, 0x2] + ldrh r3, [r3, 0x2] + adds r2, r3 + lsls r2, 16 + ldr r0, _0807F8D8 + ands r1, r0 + orrs r1, r2 + str r1, [r4] + mov r0, r8 + add r1, sp, 0xE0 + bl sub_80703A0 + lsls r0, 24 + cmp r0, 0 + beq _0807F870 + adds r5, 0x1 + cmp r5, 0x7 + ble _0807F87C +_0807F8BE: + cmp r5, 0x8 + bne _0807F8DC + ldr r0, [sp, 0xEC] + mov r1, r8 + movs r2, 0 + movs r3, 0 + bl sub_807D148 + b _0807F8FA + .align 2, 0 +_0807F8D0: .4byte gUnknown_80F4448 +_0807F8D4: .4byte 0xffff0000 +_0807F8D8: .4byte 0x0000ffff +_0807F8DC: + mov r0, r8 + add r1, sp, 0xD4 + bl sub_807D068 + add r0, sp, 0xD4 + movs r3, 0 + ldrsh r1, [r0, r3] + movs r0, 0xD6 + add r0, sp + movs r4, 0 + ldrsh r2, [r0, r4] + mov r0, r8 + movs r3, 0x1 + bl sub_80694C0 +_0807F8FA: + adds r0, r6, 0 + bl sub_80450F8 + cmp r0, 0x1 + bne _0807F954 + add r4, sp, 0xE4 + ldr r1, _0807F9AC + adds r0, r4, 0 + bl sub_8092A88 + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80571F0 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0807F93C + ldr r0, _0807F9B0 + movs r3, 0 + ldrsh r2, [r0, r3] + str r1, [sp] + str r1, [sp, 0x4] + ldr r0, _0807F9B4 + str r0, [sp, 0x8] + str r1, [sp, 0xC] + str r1, [sp, 0x10] + str r1, [sp, 0x14] + ldr r0, [sp, 0xEC] + adds r1, r6, 0 + movs r3, 0 + bl sub_806F370 +_0807F93C: + adds r0, r6, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807F954 + ldr r0, [r6, 0x70] + adds r0, 0x46 + ldrb r1, [r0] + adds r0, r6, 0 + bl sub_806CE68 +_0807F954: + ldr r0, _0807F9B0 + movs r4, 0 + ldrsh r2, [r0, r4] + movs r1, 0 + str r1, [sp] + str r1, [sp, 0x4] + ldr r0, _0807F9B8 + str r0, [sp, 0x8] + str r1, [sp, 0xC] + str r1, [sp, 0x10] + str r1, [sp, 0x14] + ldr r0, [sp, 0xEC] + mov r1, r8 + movs r3, 0 + bl sub_806F370 + mov r0, r8 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807F98E + mov r1, r8 + ldr r0, [r1, 0x70] + adds r0, 0x46 + ldrb r1, [r0] + mov r0, r8 + bl sub_806CE68 +_0807F98E: + movs r0, 0x1E + movs r1, 0x3B + bl sub_803E708 + mov r0, r8 + bl sub_807F9BC +_0807F99C: + add sp, 0x10C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0807F9AC: .4byte 0x00000163 +_0807F9B0: .4byte gUnknown_80F4F92 +_0807F9B4: .4byte 0x0000021a +_0807F9B8: .4byte 0x00000219 + thumb_func_end sub_807F43C + + thumb_func_start sub_807F9BC +sub_807F9BC: + push {r4,lr} + adds r4, r0, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0807FA0A + ldr r0, [r4, 0x70] + ldrb r0, [r0, 0x7] + cmp r0, 0 + beq _0807F9F4 + ldr r2, _0807FA10 + ldr r1, [r2] + movs r0, 0 + strb r0, [r1, 0x1] + ldr r0, [r2] + movs r1, 0xB8 + lsls r1, 3 + adds r0, r1 + movs r1, 0x1 + negs r1, r1 + str r1, [r0] + adds r0, r4, 0x4 + bl sub_804AC20 + movs r0, 0 + bl sub_807EC28 +_0807F9F4: + adds r0, r4, 0 + bl sub_806A5B8 + ldr r0, _0807FA10 + ldr r0, [r0] + ldr r1, _0807FA14 + adds r0, r1 + ldrb r1, [r0] + adds r0, r4, 0 + bl sub_8075900 +_0807FA0A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0807FA10: .4byte gUnknown_203B418 +_0807FA14: .4byte 0x00003a08 + thumb_func_end sub_807F9BC + + thumb_func_start sub_807FA18 +sub_807FA18: + push {r4-r7,lr} + sub sp, 0x4 + movs r6, 0 +_0807FA1E: + movs r5, 0 + adds r7, r6, 0x1 +_0807FA22: + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_8049590 + adds r4, r0, 0 + ldrh r1, [r4, 0x4] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0807FA88 + lsls r0, r5, 16 + lsls r1, r6, 16 + lsrs r0, 16 + orrs r0, r1 + str r0, [sp] + ldrh r1, [r4, 0x4] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0807FA4E + movs r0, 0x6 + b _0807FA56 +_0807FA4E: + bl sub_803D6FC + lsls r0, 24 + lsrs r0, 24 +_0807FA56: + cmp r0, 0x11 + bne _0807FA72 + movs r0, 0x11 + mov r1, sp + movs r2, 0x2 + bl sub_8045684 + cmp r0, 0 + beq _0807FA88 + str r0, [r4, 0x14] + adds r1, r0, 0 + adds r1, 0x20 + movs r0, 0x1 + b _0807FA86 +_0807FA72: + mov r1, sp + movs r2, 0 + bl sub_8045684 + cmp r0, 0 + beq _0807FA88 + str r0, [r4, 0x14] + adds r1, r0, 0 + adds r1, 0x20 + movs r0, 0 +_0807FA86: + strb r0, [r1] +_0807FA88: + adds r5, 0x1 + cmp r5, 0x37 + ble _0807FA22 + adds r6, r7, 0 + cmp r6, 0x1F + ble _0807FA1E + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_807FA18 + + thumb_func_start sub_807FA9C +sub_807FA9C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + ldr r2, _0807FAC4 + ldr r0, [r2] + ldr r3, _0807FAC8 + adds r1, r0, r3 + ldrb r1, [r1] + str r1, [sp] + ldr r1, _0807FACC + adds r0, r1 + movs r3, 0 + ldrsh r0, [r0, r3] + subs r1, r0, 0x5 + mov r8, r1 + b _0807FBFE + .align 2, 0 +_0807FAC4: .4byte gUnknown_203B418 +_0807FAC8: .4byte 0x0001820f +_0807FACC: .4byte 0x000181ea +_0807FAD0: + ldr r0, [r2] + ldr r2, _0807FC18 + adds r0, r2 + movs r3, 0 + ldrsh r0, [r0, r3] + subs r5, r0, 0x6 + adds r0, 0x6 + mov r1, r8 + adds r1, 0x1 + str r1, [sp, 0x4] + cmp r5, r0 + blt _0807FAEA + b _0807FBEE +_0807FAEA: + ldr r7, _0807FC1C + ldr r2, _0807FC20 + mov r10, r2 + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 3 + mov r9, r0 +_0807FAF8: + movs r6, 0 + adds r0, r5, 0 + mov r1, r8 + bl sub_804954C + adds r4, r0, 0 + ldr r0, [r4, 0x14] + cmp r0, 0 + beq _0807FB24 + bl sub_80450F8 + cmp r0, 0x2 + bne _0807FB24 + ldr r0, [r4, 0x14] + adds r0, 0x20 + ldrb r0, [r0] + cmp r0, 0 + bne _0807FB22 + ldr r3, [sp] + cmp r3, 0 + beq _0807FB24 +_0807FB22: + movs r6, 0x1 +_0807FB24: + ldrh r0, [r4] + movs r2, 0x80 + lsls r2, 2 + adds r1, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _0807FB34 + movs r6, 0x1 +_0807FB34: + cmp r6, 0 + beq _0807FBD6 + ldr r0, _0807FC24 + ldr r1, [r0] + ldr r3, _0807FC28 + adds r0, r1, r3 + movs r2, 0 + ldrsh r0, [r0, r2] + mov r2, r9 + subs r3, r2, r0 + mov r2, r8 + lsls r0, r2, 1 + add r0, r8 + lsls r0, 3 + ldr r2, _0807FC2C + adds r1, r2 + movs r2, 0 + ldrsh r1, [r1, r2] + subs r2, r0, r1 + movs r0, 0x20 + negs r0, r0 + cmp r3, r0 + blt _0807FBD6 + cmp r2, r0 + blt _0807FBD6 + movs r0, 0x88 + lsls r0, 1 + cmp r3, r0 + bgt _0807FBD6 + cmp r2, 0xC0 + bgt _0807FBD6 + ldrh r1, [r7] + mov r0, r10 + ands r0, r1 + strh r0, [r7] + ldr r1, _0807FC30 + ands r1, r2 + lsls r1, 4 + ldrh r2, [r7, 0x6] + movs r0, 0xF + ands r0, r2 + orrs r0, r1 + strh r0, [r7, 0x6] + ldr r0, _0807FC34 + ands r3, r0 + ldrh r0, [r7, 0x2] + movs r2, 0xFE + lsls r2, 8 + adds r1, r2, 0 + ands r0, r1 + orrs r0, r3 + strh r0, [r7, 0x2] + ldrh r1, [r7, 0x4] + mov r0, r10 + ands r0, r1 + movs r3, 0xC0 + lsls r3, 4 + orrs r0, r3 + movs r1, 0 + orrs r0, r1 + movs r1, 0xA0 + lsls r1, 8 + ldr r2, _0807FC30 + ands r0, r2 + orrs r0, r1 + movs r3, 0 + orrs r0, r3 + movs r2, 0xFE + lsls r2, 1 + movs r3, 0xFC + lsls r3, 8 + adds r1, r3, 0 + ands r0, r1 + orrs r0, r2 + strh r0, [r7, 0x4] + adds r0, r7, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl AddSprite +_0807FBD6: + movs r0, 0x18 + add r9, r0 + adds r5, 0x1 + ldr r0, _0807FC24 + ldr r0, [r0] + ldr r1, _0807FC18 + adds r0, r1 + movs r2, 0 + ldrsh r0, [r0, r2] + adds r0, 0x6 + cmp r5, r0 + blt _0807FAF8 +_0807FBEE: + ldr r3, [sp, 0x4] + mov r8, r3 + ldr r2, _0807FC24 + ldr r0, [r2] + ldr r1, _0807FC38 + adds r0, r1 + movs r3, 0 + ldrsh r0, [r0, r3] +_0807FBFE: + adds r0, 0x5 + cmp r8, r0 + bge _0807FC06 + b _0807FAD0 +_0807FC06: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0807FC18: .4byte 0x000181e8 +_0807FC1C: .4byte gUnknown_202EDC0 +_0807FC20: .4byte 0x0000f3ff +_0807FC24: .4byte gUnknown_203B418 +_0807FC28: .4byte 0x000181f0 +_0807FC2C: .4byte 0x000181f2 +_0807FC30: .4byte 0x00000fff +_0807FC34: .4byte 0x000001ff +_0807FC38: .4byte 0x000181ea + thumb_func_end sub_807FA9C + + thumb_func_start sub_807FC3C +sub_807FC3C: + push {r4-r7,lr} + ldr r6, _0807FC70 + ldr r4, [r6] + ldrh r5, [r0] + ldr r7, _0807FC74 + adds r3, r4, r7 + strh r5, [r3] + ldrh r3, [r0, 0x2] + ldr r5, _0807FC78 + adds r0, r4, r5 + strh r3, [r0] + adds r7, 0x4 + adds r4, r7 + strb r1, [r4] + ldr r0, [r6] + ldr r1, _0807FC7C + adds r0, r1 + strb r2, [r0] + ldr r0, [r6] + subs r5, 0x6 + adds r0, r5 + movs r1, 0x1 + strb r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0807FC70: .4byte gUnknown_203B418 +_0807FC74: .4byte 0x00013574 +_0807FC78: .4byte 0x00013576 +_0807FC7C: .4byte 0x00013579 + thumb_func_end sub_807FC3C + + thumb_func_start sub_807FC80 +sub_807FC80: + push {lr} + movs r1, 0 + ldrsh r2, [r0, r1] + movs r3, 0x2 + ldrsh r1, [r0, r3] + adds r0, r2, 0 + bl sub_8049590 + adds r2, r0, 0 + ldrh r1, [r2] + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + cmp r0, 0 + bne _0807FCCA + ldrb r0, [r2, 0x9] + cmp r0, 0xFF + beq _0807FCCA + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _0807FCCA + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _0807FCCA + movs r0, 0x3 + ands r0, r1 + cmp r0, 0x1 + bne _0807FCCA + ldr r0, [r2, 0x14] + cmp r0, 0 + beq _0807FCCE + bl sub_80450F8 + cmp r0, 0x2 + beq _0807FCCE +_0807FCCA: + movs r0, 0 + b _0807FCD0 +_0807FCCE: + movs r0, 0x1 +_0807FCD0: + pop {r1} + bx r1 + thumb_func_end sub_807FC80 + + thumb_func_start sub_807FCD4 +sub_807FCD4: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + movs r1, 0 + ldrsh r0, [r7, r1] + movs r2, 0x2 + ldrsh r1, [r7, r2] + bl sub_8049590 + adds r6, r0, 0 + cmp r5, 0x13 + bls _0807FD12 + movs r4, 0 + b _0807FCFE +_0807FCFC: + adds r4, 0x1 +_0807FCFE: + cmp r4, 0x1D + bgt _0807FD0C + bl sub_803D6FC + adds r5, r0, 0 + cmp r5, 0x11 + beq _0807FCFC +_0807FD0C: + cmp r4, 0x1E + bne _0807FD12 + movs r5, 0x10 +_0807FD12: + ldrh r1, [r6] + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + cmp r0, 0 + bne _0807FD6E + ldrb r0, [r6, 0x9] + cmp r0, 0xFF + beq _0807FD6E + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _0807FD6E + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _0807FD6E + movs r4, 0x3 + ands r4, r1 + cmp r4, 0x1 + bne _0807FD6E + ldr r0, [r6, 0x14] + cmp r0, 0 + beq _0807FD60 + bl sub_80450F8 + cmp r0, 0x2 + bne _0807FD6E + ldr r0, [r6, 0x14] + bl sub_8045104 + strb r5, [r0] + ldr r0, [r6, 0x14] + bl sub_8045104 + mov r1, r8 + strb r1, [r0, 0x1] + ldr r0, [r6, 0x14] + b _0807FD74 +_0807FD60: + adds r0, r5, 0 + adds r1, r7, 0 + mov r2, r8 + bl sub_8045684 + cmp r0, 0 + bne _0807FD72 +_0807FD6E: + movs r0, 0 + b _0807FD7A +_0807FD72: + str r0, [r6, 0x14] +_0807FD74: + adds r0, 0x20 + strb r4, [r0] + movs r0, 0x1 +_0807FD7A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_807FCD4 + + thumb_func_start sub_807FD84 +sub_807FD84: + push {r4-r6,lr} + adds r6, r0, 0 + movs r5, 0 + ldr r4, _0807FD9C + ldr r0, [r4] + ldr r2, _0807FDA0 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0 + bne _0807FDA4 + movs r0, 0 + b _0807FDF6 + .align 2, 0 +_0807FD9C: .4byte gUnknown_203B418 +_0807FDA0: .4byte 0x00013570 +_0807FDA4: + strb r5, [r1] + ldr r2, [r4] + ldr r3, _0807FDD8 + adds r0, r2, r3 + adds r3, 0x4 + adds r1, r2, r3 + ldrb r1, [r1] + adds r3, 0x1 + adds r2, r3 + ldrb r2, [r2] + bl sub_807FCD4 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + beq _0807FDE0 + ldr r1, [r4] + ldr r0, _0807FDD8 + adds r1, r0 + ldr r0, _0807FDDC + ldr r2, [r0] + adds r0, r6, 0 + bl sub_8052364 + b _0807FDF0 + .align 2, 0 +_0807FDD8: .4byte 0x00013574 +_0807FDDC: .4byte gUnknown_80FC5F8 +_0807FDE0: + ldr r1, [r4] + ldr r2, _0807FDFC + adds r1, r2 + ldr r0, _0807FE00 + ldr r2, [r0] + adds r0, r6, 0 + bl sub_8052364 +_0807FDF0: + bl sub_8049ED4 + adds r0, r5, 0 +_0807FDF6: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0807FDFC: .4byte 0x00013574 +_0807FE00: .4byte gUnknown_80FC5FC + thumb_func_end sub_807FD84 + + thumb_func_start sub_807FE04 +sub_807FE04: + push {r4,r5,lr} + adds r2, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + movs r1, 0 + ldrsh r0, [r2, r1] + movs r3, 0x2 + ldrsh r1, [r2, r3] + bl sub_8049590 + adds r4, r0, 0 + ldr r0, [r4, 0x14] + cmp r0, 0 + beq _0807FE3C + bl sub_80450F8 + cmp r0, 0x2 + bne _0807FE3C + ldr r1, [r4, 0x14] + movs r0, 0 + str r0, [r1] + str r0, [r4, 0x14] + cmp r5, 0 + beq _0807FE38 + bl sub_8049ED4 +_0807FE38: + movs r0, 0x1 + b _0807FE3E +_0807FE3C: + movs r0, 0 +_0807FE3E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_807FE04 + + thumb_func_start sub_807FE44 +sub_807FE44: + push {r4,r5,lr} + adds r2, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + movs r1, 0 + ldrsh r0, [r2, r1] + movs r3, 0x2 + ldrsh r1, [r2, r3] + bl sub_804954C + adds r4, r0, 0 + ldr r0, [r4, 0x14] + cmp r0, 0 + beq _0807FE7C + bl sub_80450F8 + cmp r0, 0x2 + bne _0807FE7C + ldr r0, [r4, 0x14] + adds r0, 0x20 + movs r1, 0x1 + strb r1, [r0] + cmp r5, 0 + beq _0807FE78 + bl sub_8049ED4 +_0807FE78: + movs r0, 0x1 + b _0807FE7E +_0807FE7C: + movs r0, 0 +_0807FE7E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_807FE44 + + thumb_func_start sub_807FE84 +sub_807FE84: + push {lr} + lsls r1, 24 + ldr r2, _0807FE98 + lsrs r1, 22 + adds r1, r2 + ldr r1, [r1] + bl strcpy + pop {r0} + bx r0 + .align 2, 0 +_0807FE98: .4byte gUnknown_80F91F0 + thumb_func_end sub_807FE84 + + thumb_func_start sub_807FE9C +sub_807FE9C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + adds r5, r0, 0 + mov r9, r1 + str r2, [sp] + lsls r3, 24 + lsrs r6, r3, 24 + movs r2, 0 + ldrsh r0, [r1, r2] + movs r3, 0x2 + ldrsh r1, [r1, r3] + bl sub_8049590 + str r0, [sp, 0x4] + ldr r0, [r0, 0x14] + mov r10, r0 + movs r1, 0 + str r1, [sp, 0x8] + cmp r0, 0 + bne _0807FECE + b _080801B4 +_0807FECE: + bl sub_80450F8 + cmp r0, 0x2 + beq _0807FED8 + b _080801B4 +_0807FED8: + mov r0, r10 + bl sub_8045104 + mov r8, r0 + ldr r0, _0807FF58 + mov r2, r8 + ldrb r1, [r2] + bl sub_807FE84 + ldr r3, [sp, 0x4] + ldr r4, [r3, 0x10] + cmp r4, 0 + beq _0807FEFE + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0x1 + beq _0807FEFE + movs r4, 0 +_0807FEFE: + mov r1, r10 + adds r1, 0x20 + ldrb r0, [r1] + str r0, [sp, 0xC] + movs r0, 0x1 + strb r0, [r1] + cmp r4, 0 + beq _0807FF96 + adds r0, r4, 0 + bl sub_806A1E8 + cmp r6, 0 + beq _0807FF96 + mov r1, r8 + ldrb r0, [r1] + cmp r0, 0x11 + beq _0807FF96 + movs r0, 0x64 + bl sub_8084100 + adds r7, r0, 0 + movs r6, 0 + adds r0, r4, 0 + movs r1, 0x1C + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _0807FF3C + ldr r0, _0807FF5C + ldr r6, [r0] +_0807FF3C: + ldr r2, [sp, 0xC] + cmp r2, 0x1 + beq _0807FF50 + ldr r0, _0807FF60 + ldr r0, [r0] + ldr r3, _0807FF64 + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0 + beq _0807FF68 +_0807FF50: + cmp r7, 0 + bge _0807FF70 + b _0807FF6C + .align 2, 0 +_0807FF58: .4byte gUnknown_202DF98 +_0807FF5C: .4byte gUnknown_80FDB5C +_0807FF60: .4byte gUnknown_203B418 +_0807FF64: .4byte 0x0001820f +_0807FF68: + cmp r7, 0xE + bgt _0807FF70 +_0807FF6C: + ldr r0, _0807FFD8 + ldr r6, [r0] +_0807FF70: + cmp r6, 0 + beq _0807FF96 + mov r0, r9 + bl sub_803F428 + lsls r0, 24 + cmp r0, 0 + beq _0807FF84 + bl sub_8049ED4 +_0807FF84: + adds r0, r5, 0 + adds r1, r4, 0 + adds r2, r6, 0 + bl sub_80522F4 + ldr r0, [sp] + cmp r0, 0 + bne _0807FF96 + b _080801B4 +_0807FF96: + mov r0, r9 + bl sub_803F428 + lsls r0, 24 + cmp r0, 0 + beq _0807FFFA + movs r1, 0xAE + lsls r1, 1 + movs r0, 0 + bl sub_80421C0 + bl sub_8049ED4 + mov r1, r8 + ldrb r2, [r1] + adds r0, r5, 0 + mov r1, r9 + bl sub_804225C + ldr r0, _0807FFDC + ldr r0, [r0] + ldr r2, _0807FFE0 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _0807FFE8 + ldr r0, _0807FFE4 + ldr r1, [r0] + adds r0, r5, 0 + bl sub_80522A8 + b _0807FFFA + .align 2, 0 +_0807FFD8: .4byte gUnknown_80FDB7C +_0807FFDC: .4byte gUnknown_203B418 +_0807FFE0: .4byte 0x0001820a +_0807FFE4: .4byte gUnknown_80FD7F4 +_0807FFE8: + ldr r0, _08080010 + mov r3, r8 + ldrb r1, [r3] + lsls r1, 2 + adds r1, r0 + ldr r1, [r1] + adds r0, r5, 0 + bl sub_80522A8 +_0807FFFA: + cmp r4, 0 + beq _08080020 + mov r1, r8 + ldrb r0, [r1, 0x1] + cmp r0, 0x2 + bne _08080014 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_806F480 + b _08080020 + .align 2, 0 +_08080010: .4byte gUnknown_80FD7F8 +_08080014: + cmp r0, 0x1 + bne _08080020 + adds r0, r4, 0 + movs r1, 0 + bl sub_806F480 +_08080020: + mov r2, r8 + ldrb r0, [r2] + cmp r0, 0x1B + bls _0808002A + b _08080194 +_0808002A: + lsls r0, 2 + ldr r1, _08080034 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08080034: .4byte _08080038 + .align 2, 0 +_08080038: + .4byte _080800A8 + .4byte _080800B2 + .4byte _080800BC + .4byte _080800C6 + .4byte _080800D0 + .4byte _080800DA + .4byte _080800E6 + .4byte _080800F0 + .4byte _080800FA + .4byte _08080104 + .4byte _0808010E + .4byte _08080118 + .4byte _08080122 + .4byte _0808012C + .4byte _08080136 + .4byte _08080140 + .4byte _0808014A + .4byte _08080168 + .4byte _08080172 + .4byte _08080180 + .4byte _08080194 + .4byte _08080194 + .4byte _08080194 + .4byte _08080194 + .4byte _08080194 + .4byte _08080194 + .4byte _08080194 + .4byte _080800DA +_080800A8: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8080A5C + b _08080194 +_080800B2: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80801CC + b _08080194 +_080800BC: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_808024C + b _08080194 +_080800C6: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8080418 + b _08080194 +_080800D0: + adds r0, r5, 0 + mov r1, r9 + bl sub_8080620 + b _0808017A +_080800DA: + adds r0, r5, 0 + adds r1, r4, 0 + ldr r2, [sp, 0x4] + bl sub_8080504 + b _08080194 +_080800E6: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8080374 + b _08080194 +_080800F0: + mov r0, r10 + adds r1, r4, 0 + bl sub_8080884 + b _08080194 +_080800FA: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8080364 + b _08080194 +_08080104: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8080388 + b _08080194 +_0808010E: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80803B4 + b _08080194 +_08080118: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80807C0 + b _08080194 +_08080122: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80803C8 + b _08080194 +_0808012C: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80803D8 + b _08080194 +_08080136: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80803F8 + b _08080194 +_08080140: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_8080700 + b _08080194 +_0808014A: + cmp r4, 0 + beq _08080194 + ldr r0, _08080160 + movs r2, 0 + ldrsh r1, [r0, r2] + ldr r3, _08080164 + adds r0, r4, 0 + movs r2, 0xF + bl sub_806F324 + b _08080194 + .align 2, 0 +_08080160: .4byte gUnknown_80F4F86 +_08080164: .4byte 0x00000213 +_08080168: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80807B4 + b _08080194 +_08080172: + adds r0, r5, 0 + mov r1, r9 + bl sub_80808A4 +_0808017A: + movs r3, 0x1 + str r3, [sp, 0x8] + b _08080194 +_08080180: + cmp r4, 0 + beq _08080194 + ldr r0, _080801C4 + movs r2, 0 + ldrsh r1, [r0, r2] + ldr r3, _080801C8 + adds r0, r4, 0 + movs r2, 0xA + bl sub_806F324 +_08080194: + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080801A6 + adds r0, r4, 0 + bl sub_8071DA4 +_080801A6: + ldr r3, [sp, 0x8] + cmp r3, 0 + beq _080801B4 + mov r0, r9 + movs r1, 0x1 + bl sub_807FE04 +_080801B4: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080801C4: .4byte gUnknown_80F4F84 +_080801C8: .4byte 0x00000206 + thumb_func_end sub_807FE9C + + thumb_func_start sub_80801CC +sub_80801CC: + push {r4,r5,lr} + sub sp, 0x8 + adds r5, r0, 0 + adds r4, r1, 0 + cmp r4, 0 + beq _08080240 + movs r0, 0x64 + bl sub_8084100 + adds r1, r0, 0 + cmp r0, 0x18 + bgt _080801EC + ldr r0, _080801E8 + b _080801F2 + .align 2, 0 +_080801E8: .4byte gUnknown_8106A4C +_080801EC: + cmp r0, 0x31 + bgt _0808020C + ldr r0, _08080208 +_080801F2: + ldr r2, [r0] + movs r0, 0x1 + str r0, [sp] + str r0, [sp, 0x4] + adds r0, r5, 0 + adds r1, r4, 0 + movs r3, 0x1 + bl sub_8076E20 + b _08080240 + .align 2, 0 +_08080208: .4byte gUnknown_8106A50 +_0808020C: + cmp r1, 0x4A + bgt _0808022C + ldr r0, _08080228 + ldr r2, [r0] + movs r0, 0x1 + str r0, [sp] + str r0, [sp, 0x4] + adds r0, r5, 0 + adds r1, r4, 0 + movs r3, 0x1 + bl sub_8076F80 + b _08080240 + .align 2, 0 +_08080228: .4byte gUnknown_8106A4C +_0808022C: + ldr r0, _08080248 + ldr r2, [r0] + movs r0, 0x1 + str r0, [sp] + str r0, [sp, 0x4] + adds r0, r5, 0 + adds r1, r4, 0 + movs r3, 0x1 + bl sub_8076F80 +_08080240: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08080248: .4byte gUnknown_8106A50 + thumb_func_end sub_80801CC + + thumb_func_start sub_808024C +sub_808024C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x5C + str r0, [sp, 0x54] + mov r10, r1 + ldr r0, [r1, 0x70] + mov r8, r0 + mov r0, r10 + movs r1, 0xE + bl sub_8046CB0 + lsls r0, 24 + cmp r0, 0 + beq _08080278 + ldr r0, _08080274 + b _08080300 + .align 2, 0 +_08080274: .4byte gUnknown_80FDC7C +_08080278: + movs r6, 0 + mov r1, r8 + ldrb r0, [r1, 0x7] + movs r1, 0x60 + add r1, r8 + mov r9, r1 + cmp r0, 0 + beq _080802C8 + movs r5, 0 + ldr r7, _0808030C + mov r0, sp + str r0, [sp, 0x58] +_08080290: + lsls r4, r5, 2 + ldr r0, [r7] + adds r2, r4, r0 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080802C2 + ldrb r0, [r2, 0x2] + bl sub_8091544 + lsls r0, 24 + cmp r0, 0 + beq _080802C2 + ldr r0, [r7] + adds r2, r0, r4 + ldrb r1, [r2] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _080802C2 + ldr r1, [sp, 0x58] + stm r1!, {r2} + str r1, [sp, 0x58] + adds r6, 0x1 +_080802C2: + adds r5, 0x1 + cmp r5, 0x13 + ble _08080290 +_080802C8: + mov r0, r9 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080802FA + mov r0, r8 + adds r0, 0x62 + ldrb r0, [r0] + bl sub_8091544 + lsls r0, 24 + cmp r0, 0 + beq _080802FA + mov r0, r9 + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _080802FA + lsls r0, r6, 2 + add r0, sp + mov r1, r9 + str r1, [r0] + adds r6, 0x1 +_080802FA: + cmp r6, 0 + bne _08080314 + ldr r0, _08080310 +_08080300: + ldr r2, [r0] + ldr r0, [sp, 0x54] + mov r1, r10 + bl sub_80522F4 + b _0808034A + .align 2, 0 +_0808030C: .4byte gUnknown_203B460 +_08080310: .4byte gUnknown_80FDC40 +_08080314: + adds r0, r6, 0 + bl sub_8084100 + ldr r2, _0808035C + lsls r0, 2 + mov r1, sp + adds r4, r1, r0 + ldr r1, [r4] + adds r0, r2, 0 + bl sub_8045BF8 + ldr r2, [r4] + ldrb r1, [r2] + movs r0, 0x8 + orrs r0, r1 + strb r0, [r2] + movs r1, 0xC9 + lsls r1, 1 + mov r0, r10 + bl sub_80421C0 + ldr r0, _08080360 + ldr r2, [r0] + ldr r0, [sp, 0x54] + mov r1, r10 + bl sub_80522F4 +_0808034A: + add sp, 0x5C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0808035C: .4byte gUnknown_202DE58 +_08080360: .4byte gUnknown_80FDC18 + thumb_func_end sub_808024C + + thumb_func_start sub_8080364 +sub_8080364: + push {lr} + cmp r1, 0 + beq _08080370 + movs r2, 0x1 + bl sub_8077AE4 +_08080370: + pop {r0} + bx r0 + thumb_func_end sub_8080364 + + thumb_func_start sub_8080374 +sub_8080374: + push {lr} + cmp r1, 0 + beq _08080382 + movs r2, 0 + movs r3, 0 + bl sub_807D148 +_08080382: + pop {r0} + bx r0 + thumb_func_end sub_8080374 + + thumb_func_start sub_8080388 +sub_8080388: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + cmp r4, 0 + beq _080803A8 + ldr r1, _080803B0 + adds r0, r4, 0 + movs r2, 0x1 + bl sub_808417C + adds r2, r0, 0 + adds r0, r5, 0 + adds r1, r4, 0 + movs r3, 0x1 + bl sub_8075C58 +_080803A8: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080803B0: .4byte gUnknown_80F4E74 + thumb_func_end sub_8080388 + + thumb_func_start sub_80803B4 +sub_80803B4: + push {lr} + cmp r1, 0 + beq _080803C2 + movs r2, 0x1 + movs r3, 0x1 + bl sub_80779F0 +_080803C2: + pop {r0} + bx r0 + thumb_func_end sub_80803B4 + + thumb_func_start sub_80803C8 +sub_80803C8: + push {lr} + cmp r1, 0 + beq _080803D4 + movs r2, 0x1 + bl sub_80763F8 +_080803D4: + pop {r0} + bx r0 + thumb_func_end sub_80803C8 + + thumb_func_start sub_80803D8 +sub_80803D8: + push {lr} + sub sp, 0x8 + adds r2, r1, 0x4 + movs r3, 0 + str r3, [sp] + ldr r3, _080803F4 + str r3, [sp, 0x4] + movs r3, 0x1 + bl sub_807DF38 + add sp, 0x8 + pop {r0} + bx r0 + .align 2, 0 +_080803F4: .4byte 0x00000212 + thumb_func_end sub_80803D8 + + thumb_func_start sub_80803F8 +sub_80803F8: + push {lr} + sub sp, 0x8 + adds r2, r1, 0x4 + movs r3, 0 + str r3, [sp] + ldr r3, _08080414 + str r3, [sp, 0x4] + movs r3, 0x2 + bl sub_807DF38 + add sp, 0x8 + pop {r0} + bx r0 + .align 2, 0 +_08080414: .4byte 0x00000212 + thumb_func_end sub_80803F8 + + thumb_func_start sub_8080418 +sub_8080418: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x58 + mov r8, r0 + adds r6, r1, 0 + movs r0, 0 + mov r9, r0 + cmp r6, 0 + beq _080804F0 + ldr r7, [r6, 0x70] + movs r3, 0 + ldrb r0, [r7, 0x7] + cmp r0, 0 + beq _0808045A + ldr r0, _080804C0 + movs r1, 0x1 + mov r12, r1 + ldr r2, [r0] + mov r4, sp + movs r5, 0x13 +_08080444: + ldrb r1, [r2] + mov r0, r12 + ands r0, r1 + cmp r0, 0 + beq _08080452 + stm r4!, {r2} + adds r3, 0x1 +_08080452: + adds r2, 0x4 + subs r5, 0x1 + cmp r5, 0 + bge _08080444 +_0808045A: + adds r2, r7, 0 + adds r2, 0x60 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08080470 + lsls r0, r3, 2 + add r0, sp + str r2, [r0] + adds r3, 0x1 +_08080470: + cmp r3, 0 + ble _080804B6 + mov r4, sp + adds r5, r3, 0 +_08080478: + ldr r0, [r4] + ldrb r0, [r0, 0x2] + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _080804AE + ldr r0, [r4] + ldrb r0, [r0, 0x2] + cmp r0, 0x54 + beq _080804AE + movs r0, 0x64 + bl sub_8084100 + ldr r1, _080804C4 + movs r2, 0 + ldrsh r1, [r1, r2] + cmp r0, r1 + bge _080804AE + movs r0, 0x1 + add r9, r0 + ldr r0, [r4] + movs r1, 0x54 + movs r2, 0x2 + bl sub_8045C28 +_080804AE: + adds r4, 0x4 + subs r5, 0x1 + cmp r5, 0 + bne _08080478 +_080804B6: + mov r1, r9 + cmp r1, 0x1 + bne _080804CC + ldr r0, _080804C8 + b _080804D4 + .align 2, 0 +_080804C0: .4byte gUnknown_203B460 +_080804C4: .4byte gUnknown_80F4E0E +_080804C8: .4byte gUnknown_80FD788 +_080804CC: + mov r2, r9 + cmp r2, 0 + bne _080804E4 + ldr r0, _080804E0 +_080804D4: + ldr r2, [r0] + mov r0, r8 + adds r1, r6, 0 + bl sub_80522F4 + b _080804F0 + .align 2, 0 +_080804E0: .4byte gUnknown_80FD7D4 +_080804E4: + ldr r0, _08080500 + ldr r2, [r0] + mov r0, r8 + adds r1, r6, 0 + bl sub_80522F4 +_080804F0: + add sp, 0x58 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08080500: .4byte gUnknown_80FD7AC + thumb_func_end sub_8080418 + + thumb_func_start sub_8080504 +sub_8080504: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + adds r4, r1, 0 + adds r7, r2, 0 + movs r0, 0 + mov r8, r0 + cmp r4, 0 + bne _0808051A + b _0808060E +_0808051A: + bl sub_80441BC + lsls r0, 24 + cmp r0, 0 + beq _08080534 + ldr r0, _08080530 + ldr r1, [r0] + adds r0, r6, 0 + bl sub_80522A8 + b _0808060E + .align 2, 0 +_08080530: .4byte gUnknown_80FED0C +_08080534: + ldr r5, [r4, 0x70] + adds r0, r4, 0 + bl sub_8045888 + lsls r0, 24 + cmp r0, 0 + beq _0808055E + adds r0, r7, 0 + movs r1, 0x1B + bl sub_8080B00 + movs r1, 0x1 + mov r8, r1 + ldr r1, _080805A4 + adds r0, r4, 0 + bl sub_80421C0 + movs r0, 0x1E + movs r1, 0x48 + bl sub_803E708 +_0808055E: + ldrb r0, [r5, 0x7] + cmp r0, 0 + beq _080805C4 + bl sub_8043D10 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _080805B4 + movs r2, 0xAE + lsls r2, 1 + adds r0, r5, r2 + movs r1, 0x1 + strb r1, [r0] + adds r2, 0x2 + adds r0, r5, r2 + strb r1, [r0] + movs r0, 0x28 + movs r1, 0x4B + bl sub_803E708 + ldr r0, _080805A8 + movs r2, 0 + ldrsh r1, [r0, r2] + ldr r3, _080805AC + adds r0, r4, 0 + movs r2, 0x11 + bl sub_806F324 + ldr r0, _080805B0 + ldr r1, [r0] + movs r0, 0x2 + strb r0, [r1, 0x2] + b _0808060E + .align 2, 0 +_080805A4: .4byte 0x00000193 +_080805A8: .4byte gUnknown_80F4F8A +_080805AC: .4byte 0x00000215 +_080805B0: .4byte gUnknown_203B418 +_080805B4: + ldr r0, _080805C0 + ldr r1, [r0] + adds r0, r6, 0 + bl sub_80522A8 + b _08080600 + .align 2, 0 +_080805C0: .4byte gUnknown_80F9728 +_080805C4: + ldr r0, _080805E4 + adds r1, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldrb r0, [r5, 0x6] + cmp r0, 0 + beq _080805EC + ldr r0, _080805E8 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80522F4 + b _080805F6 + .align 2, 0 +_080805E4: .4byte gUnknown_202DF98 +_080805E8: .4byte gUnknown_80F970C +_080805EC: + ldr r0, _08080618 + ldr r1, [r0] + adds r0, r6, 0 + bl sub_805239C +_080805F6: + ldr r1, _0808061C + adds r0, r4, 0 + adds r2, r6, 0 + bl sub_8068FE0 +_08080600: + mov r0, r8 + cmp r0, 0 + beq _0808060E + adds r0, r7, 0 + movs r1, 0x5 + bl sub_8080B00 +_0808060E: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08080618: .4byte gUnknown_80F970C +_0808061C: .4byte 0x00000215 + thumb_func_end sub_8080504 + + thumb_func_start sub_8080620 +sub_8080620: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + str r0, [sp, 0x14] + adds r7, r1, 0 + movs r0, 0x3 + bl sub_8084100 + adds r6, r0, 0 + adds r4, r6, 0x2 + movs r0, 0x8 + bl sub_8084100 + adds r5, r0, 0 + bl sub_80441BC + lsls r0, 24 + cmp r0, 0 + bne _080806CA + movs r0, 0 + mov r8, r0 + cmp r8, r4 + bge _080806BA + mov r4, sp + movs r1, 0 + mov r10, r1 + movs r2, 0 + mov r9, r2 + adds r6, 0x2 +_08080660: + movs r0, 0 + bl sub_803D970 + movs r1, 0x7 + ands r5, r1 + strh r0, [r4] + movs r1, 0 + ldrsh r0, [r4, r1] + movs r1, 0 + bl sub_806AA0C + lsls r0, 24 + cmp r0, 0 + beq _080806B2 + mov r2, r9 + strh r2, [r4, 0x8] + mov r0, r10 + strb r0, [r4, 0x2] + ldr r0, _080806D8 + lsls r1, r5, 2 + adds r1, r0 + ldrh r0, [r1] + ldrh r2, [r7] + adds r0, r2 + strh r0, [r4, 0xC] + ldrh r0, [r1, 0x2] + ldrh r1, [r7, 0x2] + adds r0, r1 + strh r0, [r4, 0xE] + mov r2, r9 + str r2, [sp, 0x4] + mov r0, r10 + strb r0, [r4, 0x10] + mov r0, sp + movs r1, 0x1 + bl sub_806B7F8 + cmp r0, 0 + beq _080806B2 + movs r1, 0x1 + add r8, r1 +_080806B2: + adds r5, 0x1 + subs r6, 0x1 + cmp r6, 0 + bne _08080660 +_080806BA: + movs r1, 0xCA + lsls r1, 1 + adds r0, r7, 0 + bl sub_80421EC + mov r2, r8 + cmp r2, 0 + bne _080806E0 +_080806CA: + ldr r0, _080806DC + ldr r1, [r0] + ldr r0, [sp, 0x14] + bl sub_80522A8 + b _080806EA + .align 2, 0 +_080806D8: .4byte gUnknown_80F4448 +_080806DC: .4byte gUnknown_80FED04 +_080806E0: + ldr r0, _080806FC + ldr r1, [r0] + ldr r0, [sp, 0x14] + bl sub_80522A8 +_080806EA: + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080806FC: .4byte gUnknown_80FED00 + thumb_func_end sub_8080620 + + thumb_func_start sub_8080700 +sub_8080700: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x20 + mov r8, r0 + adds r5, r1, 0 + movs r0, 0 + mov r12, r0 + cmp r5, 0 + beq _080807A4 + ldr r7, [r5, 0x70] + movs r4, 0 + movs r3, 0 + mov r6, sp +_0808071C: + lsls r0, r3, 3 + movs r1, 0x8C + lsls r1, 1 + adds r0, r1 + adds r2, r7, r0 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08080742 + ldrb r0, [r2, 0x4] + cmp r0, 0 + beq _08080742 + lsls r1, r4, 2 + stm r6!, {r2} + add r0, sp, 0x10 + adds r0, r1 + str r3, [r0] + adds r4, 0x1 +_08080742: + adds r3, 0x1 + cmp r3, 0x3 + ble _0808071C + cmp r4, 0 + beq _0808077A + adds r0, r4, 0 + bl sub_8084100 + adds r4, r0, 0 + lsls r4, 2 + mov r0, sp + adds r2, r0, r4 + ldr r1, [r2] + movs r0, 0 + strb r0, [r1, 0x4] + ldr r0, _08080790 + ldr r1, [r2] + movs r2, 0 + bl sub_80928C0 + add r0, sp, 0x10 + adds r0, r4 + ldr r1, [r0] + adds r0, r5, 0 + bl sub_806A9B4 + movs r1, 0x1 + mov r12, r1 +_0808077A: + mov r0, r12 + cmp r0, 0 + beq _08080798 + ldr r0, _08080794 + ldr r2, [r0] + mov r0, r8 + adds r1, r5, 0 + bl sub_80522F4 + b _080807A4 + .align 2, 0 +_08080790: .4byte gUnknown_202DE58 +_08080794: .4byte gUnknown_80FDA80 +_08080798: + ldr r0, _080807B0 + ldr r2, [r0] + mov r0, r8 + adds r1, r5, 0 + bl sub_80522F4 +_080807A4: + add sp, 0x20 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080807B0: .4byte gUnknown_80FDAA0 + thumb_func_end sub_8080700 + + thumb_func_start sub_80807B4 +sub_80807B4: + push {lr} + movs r2, 0 + bl sub_8079E34 + pop {r0} + bx r0 + thumb_func_end sub_80807B4 + + thumb_func_start sub_80807C0 +sub_80807C0: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x10 + mov r8, r0 + adds r7, r1, 0 + movs r0, 0 + mov r9, r0 + cmp r7, 0 + beq _08080870 + mov r0, r8 + movs r2, 0x1 + bl sub_80716E8 + lsls r0, 24 + cmp r0, 0 + bne _08080870 + ldr r0, [r7, 0x70] + movs r5, 0 + movs r6, 0x1 + movs r1, 0x8C + lsls r1, 1 + adds r2, r0, r1 + adds r3, r2, 0 + mov r12, sp + movs r4, 0x3 +_080807F6: + ldrb r1, [r2] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _08080816 + ldrb r1, [r2, 0x1] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _08080816 + mov r0, r12 + adds r0, 0x4 + mov r12, r0 + subs r0, 0x4 + stm r0!, {r3} + adds r5, 0x1 +_08080816: + adds r2, 0x8 + adds r3, 0x8 + subs r4, 0x1 + cmp r4, 0 + bge _080807F6 + cmp r5, 0 + beq _08080848 + adds r0, r5, 0 + bl sub_8084100 + lsls r0, 2 + mov r1, sp + adds r3, r1, r0 + ldr r2, [r3] + ldrb r1, [r2, 0x1] + movs r0, 0x1 + orrs r0, r1 + strb r0, [r2, 0x1] + ldr r0, _0808085C + ldr r1, [r3] + movs r2, 0 + bl sub_80928C0 + movs r0, 0x1 + mov r9, r0 +_08080848: + mov r1, r9 + cmp r1, 0 + beq _08080864 + ldr r0, _08080860 + ldr r2, [r0] + mov r0, r8 + adds r1, r7, 0 + bl sub_80522F4 + b _08080870 + .align 2, 0 +_0808085C: .4byte gUnknown_202DE58 +_08080860: .4byte gUnknown_80FDB04 +_08080864: + ldr r0, _08080880 + ldr r2, [r0] + mov r0, r8 + adds r1, r7, 0 + bl sub_80522F4 +_08080870: + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08080880: .4byte gUnknown_80FDB2C + thumb_func_end sub_80807C0 + + thumb_func_start sub_8080884 +sub_8080884: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + cmp r4, 0 + beq _0808089E + movs r0, 0x8 + bl sub_8084100 + adds r2, r0, 0 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_807CD9C +_0808089E: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8080884 + + thumb_func_start sub_80808A4 +sub_80808A4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x30 + str r0, [sp, 0x14] + adds r5, r1, 0 + movs r0, 0 + str r0, [sp, 0x20] + ldr r6, _080808D0 + ldr r0, [r6] + ldr r1, _080808D4 + adds r0, r1 + ldrb r4, [r0] + bl sub_80441BC + lsls r0, 24 + cmp r0, 0 + beq _080808DC + ldr r0, _080808D8 + b _08080A2E + .align 2, 0 +_080808D0: .4byte gUnknown_203B418 +_080808D4: .4byte 0x00018209 +_080808D8: .4byte gUnknown_80FED08 +_080808DC: + cmp r4, 0 + bne _080808E2 + movs r4, 0x2 +_080808E2: + movs r2, 0 + ldrsh r0, [r5, r2] + movs r3, 0x2 + ldrsh r1, [r5, r3] + bl sub_804954C + ldrb r1, [r0, 0x9] + cmp r1, 0xFF + bne _0808090A + movs r0, 0 + ldrsh r1, [r5, r0] + subs r2, r1, r4 + str r2, [sp, 0x18] + movs r3, 0x2 + ldrsh r0, [r5, r3] + subs r2, r0, r4 + adds r1, r4 + mov r10, r1 + adds r0, r4 + b _08080934 +_0808090A: + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r1, _08080994 + adds r0, r1 + ldr r1, [r6] + adds r1, r0 + movs r2, 0x2 + ldrsh r0, [r1, r2] + subs r0, 0x1 + str r0, [sp, 0x18] + movs r3, 0x4 + ldrsh r0, [r1, r3] + subs r2, r0, 0x1 + movs r3, 0x6 + ldrsh r0, [r1, r3] + adds r0, 0x1 + mov r10, r0 + movs r3, 0x8 + ldrsh r0, [r1, r3] + adds r0, 0x1 +_08080934: + str r0, [sp, 0x1C] + adds r7, r2, 0 + ldr r0, [sp, 0x1C] + cmp r7, r0 + bgt _08080A26 +_0808093E: + ldr r6, [sp, 0x18] + adds r1, r7, 0x1 + str r1, [sp, 0x24] + cmp r6, r10 + bgt _08080A1E + mov r5, sp +_0808094A: + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_804954C + adds r4, r0, 0 + ldr r0, [r4, 0x14] + adds r2, r6, 0x1 + mov r9, r2 + cmp r0, 0 + beq _08080A18 + bl sub_80450F8 + cmp r0, 0x3 + bne _08080A18 + ldr r0, [r4, 0x14] + bl sub_8045108 + ldrb r1, [r0] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08080A18 + movs r0, 0xBE + lsls r0, 1 + strh r0, [r5] + movs r2, 0 + mov r4, sp +_08080980: + ldr r0, _08080998 + ldr r0, [r0] + ldr r3, _0808099C + adds r0, r3 + ldrb r0, [r0] + cmp r0, 0 + beq _080809A0 + movs r0, 0xBE + lsls r0, 1 + b _080809AE + .align 2, 0 +_08080994: .4byte 0x000104c4 +_08080998: .4byte gUnknown_203B418 +_0808099C: .4byte 0x0000066e +_080809A0: + movs r0, 0 + str r2, [sp, 0x28] + bl sub_803D970 + lsls r0, 16 + asrs r0, 16 + ldr r2, [sp, 0x28] +_080809AE: + movs r1, 0 + mov r8, r1 + movs r3, 0 + strh r0, [r4] + movs r1, 0 + ldrsh r0, [r4, r1] + movs r1, 0 + str r2, [sp, 0x28] + str r3, [sp, 0x2C] + bl sub_806AA0C + lsls r0, 24 + ldr r2, [sp, 0x28] + ldr r3, [sp, 0x2C] + cmp r0, 0 + bne _080809D4 + adds r2, 0x1 + cmp r2, 0x63 + ble _08080980 +_080809D4: + movs r2, 0 + ldrsh r0, [r5, r2] + movs r1, 0 + str r3, [sp, 0x2C] + bl sub_806AA0C + lsls r0, 24 + ldr r3, [sp, 0x2C] + cmp r0, 0 + beq _08080A10 + strh r3, [r5, 0x8] + mov r0, r8 + strb r0, [r5, 0x2] + strh r6, [r5, 0xC] + strh r7, [r5, 0xE] + str r3, [sp, 0x4] + strb r0, [r5, 0x10] + mov r0, sp + movs r1, 0x1 + bl sub_806B7F8 + cmp r0, 0 + beq _08080A10 + add r0, sp, 0xC + movs r1, 0 + bl sub_80461C8 + ldr r1, [sp, 0x20] + adds r1, 0x1 + str r1, [sp, 0x20] +_08080A10: + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_80402AC +_08080A18: + mov r6, r9 + cmp r6, r10 + ble _0808094A +_08080A1E: + ldr r7, [sp, 0x24] + ldr r2, [sp, 0x1C] + cmp r7, r2 + ble _0808093E +_08080A26: + ldr r3, [sp, 0x20] + cmp r3, 0 + beq _08080A3C + ldr r0, _08080A38 +_08080A2E: + ldr r1, [r0] + ldr r0, [sp, 0x14] + bl sub_80522A8 + b _08080A46 + .align 2, 0 +_08080A38: .4byte gUnknown_80FDACC +_08080A3C: + ldr r0, _08080A58 + ldr r1, [r0] + ldr r0, [sp, 0x14] + bl sub_80522A8 +_08080A46: + add sp, 0x30 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08080A58: .4byte gUnknown_80FDAE4 + thumb_func_end sub_80808A4 + + thumb_func_start sub_8080A5C +sub_8080A5C: + push {r4-r7,lr} + sub sp, 0xC + adds r7, r0, 0 + adds r4, r1, 0 + cmp r4, 0 + beq _08080AEC + adds r0, r4, 0 + movs r1, 0x6 + movs r2, 0x8 + bl sub_806CDD4 + movs r0, 0x10 + movs r1, 0x55 + bl sub_803E708 + adds r0, r4, 0 + movs r1, 0x8 + bl sub_806CE68 + ldr r5, [r4, 0x70] + adds r2, r5, 0 + adds r2, 0x60 + ldrb r1, [r2] + movs r6, 0x1 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _08080AEC + ldr r0, [r5, 0x60] + str r0, [sp, 0x8] + movs r0, 0 + strb r0, [r2] + bl sub_80910B4 + movs r1, 0xC8 + lsls r1, 1 + adds r0, r4, 0 + bl sub_80421C0 + adds r0, r5, 0 + adds r0, 0x46 + ldrb r0, [r0] + movs r2, 0x7 + ands r2, r0 + ldr r0, _08080AF4 + lsls r2, 2 + adds r2, r0 + ldrh r0, [r2] + ldrh r1, [r4, 0x4] + adds r0, r1 + lsls r0, 16 + lsrs r0, 16 + ldr r3, _08080AF8 + ldr r1, [sp, 0x4] + ands r1, r3 + orrs r1, r0 + str r1, [sp, 0x4] + ldrh r0, [r2, 0x2] + ldrh r2, [r4, 0x6] + adds r0, r2 + lsls r0, 16 + ldr r2, _08080AFC + ands r1, r2 + orrs r1, r0 + str r1, [sp, 0x4] + adds r1, r4, 0x4 + add r3, sp, 0x8 + str r6, [sp] + adds r0, r7, 0 + add r2, sp, 0x4 + bl sub_804687C +_08080AEC: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08080AF4: .4byte gUnknown_80F4448 +_08080AF8: .4byte 0xffff0000 +_08080AFC: .4byte 0x0000ffff + thumb_func_end sub_8080A5C + + thumb_func_start sub_8080B00 +sub_8080B00: + push {r4,r5,lr} + lsls r1, 24 + lsrs r5, r1, 24 + ldr r4, [r0, 0x14] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08080B2A + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0x2 + bne _08080B26 + adds r0, r4, 0 + bl sub_8045104 + strb r5, [r0] +_08080B26: + bl sub_8049ED4 +_08080B2A: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8080B00 + + thumb_func_start sub_8080B30 +sub_8080B30: + push {lr} + sub sp, 0x10 + adds r3, r0, 0 + adds r2, r1, 0 + mov r0, sp + adds r1, r3, 0 + bl sub_8082F9C + movs r0, 0 + str r0, [sp, 0xC] + add r1, sp, 0xC + mov r0, sp + movs r2, 0x4 + bl sub_8082FA8 + mov r0, sp + bl sub_8080B90 + mov r0, sp + bl sub_8081454 + mov r0, sp + bl sub_808165C + mov r0, sp + bl sub_808173C + mov r0, sp + bl sub_8080BBC + mov r0, sp + bl sub_8080C44 + mov r0, sp + bl sub_8080CF0 + ldr r1, _08080B8C + mov r0, sp + bl sub_808300C + mov r0, sp + bl nullsub_98 + add sp, 0x10 + pop {r0} + bx r0 + .align 2, 0 +_08080B8C: .4byte gUnknown_81071D4 + thumb_func_end sub_8080B30 + + thumb_func_start sub_8080B90 +sub_8080B90: + push {r4,lr} + adds r4, r0, 0 + ldr r1, _08080BB0 + bl sub_808300C + ldr r0, _08080BB4 + ldr r1, [r0] + ldr r0, _08080BB8 + adds r1, r0 + adds r0, r4, 0 + movs r2, 0x58 + bl sub_8082FA8 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08080BB0: .4byte gUnknown_81071E0 +_08080BB4: .4byte gUnknown_203B418 +_08080BB8: .4byte 0x00000644 + thumb_func_end sub_8080B90 + + thumb_func_start sub_8080BBC +sub_8080BBC: + push {r4-r7,lr} + sub sp, 0x8 + adds r6, r0, 0 + ldr r1, _08080C38 + movs r2, 0 + add r0, sp, 0x4 +_08080BC8: + strb r2, [r0] + subs r0, 0x1 + cmp r0, sp + bge _08080BC8 + adds r0, r6, 0 + bl sub_808300C + movs r7, 0 +_08080BD8: + ldr r0, _08080C3C + ldr r0, [r0] + lsls r1, r7, 2 + ldr r2, _08080C40 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + movs r5, 0 + cmp r4, 0 + beq _08080C1A + adds r0, r4, 0 + bl sub_80450F8 + cmp r0, 0x3 + bne _08080C1A + adds r0, r4, 0 + bl sub_8045108 + adds r1, r0, 0 + adds r0, r6, 0 + bl sub_8081788 + adds r1, r4, 0x4 + adds r0, r6, 0 + movs r2, 0x1 + bl sub_8082FA8 + adds r1, r4, 0x6 + adds r0, r6, 0 + movs r2, 0x1 + bl sub_8082FA8 + movs r5, 0x1 +_08080C1A: + cmp r5, 0 + bne _08080C28 + adds r0, r6, 0 + mov r1, sp + movs r2, 0x5 + bl sub_8082FA8 +_08080C28: + adds r7, 0x1 + cmp r7, 0x3F + ble _08080BD8 + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08080C38: .4byte gUnknown_81071E0 +_08080C3C: .4byte gUnknown_203B418 +_08080C40: .4byte 0x0001361c + thumb_func_end sub_8080BBC + + thumb_func_start sub_8080C44 +sub_8080C44: + push {r4-r7,lr} + sub sp, 0x8 + adds r6, r0, 0 + movs r7, 0 + ldr r3, _08080CE4 + movs r2, 0xFF +_08080C50: + mov r0, sp + adds r1, r0, r7 + ldrb r0, [r1] + orrs r0, r2 + strb r0, [r1] + adds r7, 0x1 + cmp r7, 0x4 + ble _08080C50 + adds r0, r6, 0 + adds r1, r3, 0 + bl sub_808300C + movs r7, 0 +_08080C6A: + ldr r0, _08080CE8 + ldr r0, [r0] + lsls r1, r7, 2 + ldr r2, _08080CEC + adds r0, r2 + adds r0, r1 + ldr r5, [r0] + movs r4, 0 + cmp r5, 0 + beq _08080CC8 + adds r0, r5, 0 + bl sub_80450F8 + cmp r0, 0x2 + bne _08080CC8 + adds r0, r5, 0 + bl sub_8045104 + adds r4, r0, 0 + adds r0, r6, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_8082FA8 + adds r4, 0x1 + adds r0, r6, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_8082FA8 + adds r1, r5, 0 + adds r1, 0x20 + adds r0, r6, 0 + movs r2, 0x1 + bl sub_8082FA8 + adds r1, r5, 0x4 + adds r0, r6, 0 + movs r2, 0x1 + bl sub_8082FA8 + adds r1, r5, 0x6 + adds r0, r6, 0 + movs r2, 0x1 + bl sub_8082FA8 + movs r4, 0x1 +_08080CC8: + cmp r4, 0 + bne _08080CD6 + adds r0, r6, 0 + mov r1, sp + movs r2, 0x5 + bl sub_8082FA8 +_08080CD6: + adds r7, 0x1 + cmp r7, 0x3F + ble _08080C6A + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08080CE4: .4byte gUnknown_81071E0 +_08080CE8: .4byte gUnknown_203B418 +_08080CEC: .4byte 0x0001371c + thumb_func_end sub_8080C44 + + thumb_func_start sub_8080CF0 +sub_8080CF0: + push {r4-r6,lr} + adds r6, r0, 0 + ldr r1, _08080DD4 + bl sub_808300C + ldr r4, _08080DD8 + ldr r0, [r4] + ldr r1, _08080DDC + adds r0, r1 + ldr r1, [r0] + adds r0, r6, 0 + bl sub_8083078 + ldr r0, [r4] + ldr r2, _08080DE0 + adds r0, r2 + ldr r1, [r0] + adds r0, r6, 0 + bl sub_8083078 + ldr r0, [r4] + ldr r1, _08080DE4 + adds r0, r1 + ldrb r1, [r0] + adds r0, r6, 0 + bl sub_80830B4 + ldr r0, [r4] + ldr r2, _08080DE8 + adds r0, r2 + ldrb r1, [r0] + adds r0, r6, 0 + bl sub_80830B4 + ldr r0, [r4] + ldr r1, _08080DEC + adds r0, r1 + ldrb r1, [r0] + adds r0, r6, 0 + bl sub_80830B4 + ldr r0, [r4] + ldr r2, _08080DF0 + adds r0, r2 + ldrb r1, [r0] + adds r0, r6, 0 + bl sub_80830B4 + ldr r0, [r4] + ldr r1, _08080DF4 + adds r0, r1 + ldrb r1, [r0] + adds r0, r6, 0 + bl sub_80830B4 + ldr r0, [r4] + ldr r2, _08080DF8 + adds r0, r2 + ldrb r1, [r0] + adds r0, r6, 0 + bl sub_80830B4 + ldr r0, [r4] + ldr r1, _08080DFC + adds r0, r1 + ldrb r1, [r0] + adds r0, r6, 0 + bl sub_80830B4 + ldr r0, [r4] + ldr r2, _08080E00 + adds r0, r2 + ldrb r1, [r0] + adds r0, r6, 0 + bl sub_80830B4 + ldr r0, [r4] + movs r1, 0xE0 + lsls r1, 6 + adds r0, r1 + ldrh r1, [r0] + adds r0, r6, 0 + bl sub_8083030 + movs r5, 0 +_08080D9A: + ldr r0, [r4] + lsls r1, r5, 2 + ldr r2, _08080E04 + adds r0, r2 + adds r0, r1 + ldr r1, [r0] + adds r0, r6, 0 + bl sub_8080E0C + adds r5, 0x1 + cmp r5, 0x3 + ble _08080D9A + movs r5, 0 + ldr r4, _08080DD8 +_08080DB6: + ldr r0, [r4] + lsls r1, r5, 2 + ldr r2, _08080E08 + adds r0, r2 + adds r0, r1 + ldr r1, [r0] + adds r0, r6, 0 + bl sub_8080E0C + adds r5, 0x1 + cmp r5, 0xF + ble _08080DB6 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08080DD4: .4byte gUnknown_81071E0 +_08080DD8: .4byte gUnknown_203B418 +_08080DDC: .4byte 0x000037f0 +_08080DE0: .4byte 0x000037f4 +_08080DE4: .4byte 0x000037f8 +_08080DE8: .4byte 0x000037f9 +_08080DEC: .4byte 0x000037fa +_08080DF0: .4byte 0x000037fb +_08080DF4: .4byte 0x000037fc +_08080DF8: .4byte 0x000037fd +_08080DFC: .4byte 0x000037fe +_08080E00: .4byte 0x000037ff +_08080E04: .4byte 0x0001357c +_08080E08: .4byte 0x0001358c + thumb_func_end sub_8080CF0 + + thumb_func_start sub_8080E0C +sub_8080E0C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, _08080E88 + add sp, r4 + adds r5, r0, 0 + adds r4, r1, 0 + movs r1, 0 + add r0, sp, 0x20C + str r1, [r0] + movs r1, 0x1 + movs r6, 0x82 + lsls r6, 2 + mov r2, sp + adds r0, r2, r6 + str r1, [r0] + adds r0, r5, 0 + movs r1, 0xAA + bl sub_8083060 + adds r0, r5, 0 + movs r1, 0x55 + bl sub_8083060 + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08080E8C + ldr r6, [r4, 0x70] + add r1, sp, 0x208 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_8082FA8 + adds r1, r4, 0x4 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_8082FA8 + adds r1, r4, 0x6 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_8082FA8 + adds r1, r4, 0 + adds r1, 0x20 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_8082FA8 + adds r1, r4, 0 + adds r1, 0x26 + adds r0, r5, 0 + movs r2, 0x2 + bl sub_8082FA8 + b _08080ECC + .align 2, 0 +_08080E88: .4byte 0xfffffd6c +_08080E8C: + mov r0, sp + movs r1, 0 + adds r2, r6, 0 + bl memset + mov r6, sp + add r4, sp, 0x20C + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_8082FA8 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_8082FA8 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_8082FA8 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_8082FA8 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x2 + bl sub_8082FA8 +_08080ECC: + ldrh r1, [r6] + adds r0, r5, 0 + bl sub_8083030 + movs r0, 0x4 + ldrsh r1, [r6, r0] + adds r0, r5, 0 + bl sub_80817F4 + movs r2, 0x2 + ldrsh r1, [r6, r2] + adds r0, r5, 0 + bl sub_80817F4 + ldrb r1, [r6, 0x6] + adds r0, r5, 0 + bl sub_80830B4 + ldrb r1, [r6, 0x7] + adds r0, r5, 0 + bl sub_80830B4 + ldrb r1, [r6, 0x8] + adds r0, r5, 0 + bl sub_8083060 + ldrb r1, [r6, 0x9] + adds r0, r5, 0 + bl sub_8083060 + ldrb r1, [r6, 0xA] + adds r0, r5, 0 + bl sub_8083060 + adds r1, r6, 0 + adds r1, 0x40 + adds r0, r5, 0 + bl sub_80818C8 + movs r0, 0xC + ldrsh r1, [r6, r0] + adds r0, r5, 0 + bl sub_8083048 + movs r2, 0xE + ldrsh r1, [r6, r2] + adds r0, r5, 0 + bl sub_8083048 + movs r0, 0x10 + ldrsh r1, [r6, r0] + adds r0, r5, 0 + bl sub_8083048 + movs r2, 0x12 + ldrsh r1, [r6, r2] + adds r0, r5, 0 + bl sub_8083048 + ldrb r1, [r6, 0x14] + adds r0, r5, 0 + bl sub_8083060 + ldrb r1, [r6, 0x15] + adds r0, r5, 0 + bl sub_8083060 + ldrb r1, [r6, 0x16] + adds r0, r5, 0 + bl sub_8083060 + ldrb r1, [r6, 0x17] + adds r0, r5, 0 + bl sub_8083060 + ldr r1, [r6, 0x18] + adds r0, r5, 0 + bl sub_8083078 + movs r0, 0x1C + ldrsh r1, [r6, r0] + adds r0, r5, 0 + bl sub_8083048 + movs r2, 0x1E + ldrsh r1, [r6, r2] + adds r0, r5, 0 + bl sub_8083048 + movs r0, 0x20 + ldrsh r1, [r6, r0] + adds r0, r5, 0 + bl sub_8083048 + movs r2, 0x22 + ldrsh r1, [r6, r2] + adds r0, r5, 0 + bl sub_8083048 + movs r0, 0x24 + ldrsh r1, [r6, r0] + adds r0, r5, 0 + bl sub_8083048 + movs r2, 0x26 + ldrsh r1, [r6, r2] + adds r0, r5, 0 + bl sub_8083048 + movs r0, 0x28 + ldrsh r1, [r6, r0] + adds r0, r5, 0 + bl sub_8083048 + ldr r1, [r6, 0x2C] + adds r0, r5, 0 + bl sub_80830A0 + ldr r1, [r6, 0x30] + adds r0, r5, 0 + bl sub_80830A0 + ldr r1, [r6, 0x34] + adds r0, r5, 0 + bl sub_80830A0 + ldr r1, [r6, 0x38] + adds r0, r5, 0 + bl sub_80830A0 + adds r1, r6, 0 + adds r1, 0x44 + adds r0, r5, 0 + bl sub_80817C8 + adds r0, r6, 0 + adds r0, 0x5C + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_808180C + adds r0, r6, 0 + adds r0, 0x5D + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_808180C + adds r0, r6, 0 + adds r0, 0x5E + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_8081824 + adds r0, r6, 0 + adds r0, 0x5F + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_8081824 + adds r1, r6, 0 + adds r1, 0x60 + adds r0, r5, 0 + bl sub_8081788 + adds r0, r6, 0 + adds r0, 0x64 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_80817B0 + movs r1, 0x78 + adds r1, r6 + mov r8, r1 + movs r2, 0x8C + adds r2, r6 + mov r9, r2 + movs r0, 0x90 + adds r0, r6 + mov r10, r0 + adds r1, r6, 0 + adds r1, 0x94 + str r1, [sp, 0x214] + adds r2, r6, 0 + adds r2, 0x3C + str r2, [sp, 0x210] + adds r0, r6, 0 + adds r0, 0x98 + str r0, [sp, 0x218] + adds r1, 0x8 + str r1, [sp, 0x21C] + adds r2, 0x64 + str r2, [sp, 0x220] + adds r0, 0x10 + str r0, [sp, 0x228] + adds r1, 0x10 + str r1, [sp, 0x22C] + adds r2, 0x10 + str r2, [sp, 0x230] + adds r0, 0x14 + str r0, [sp, 0x234] + adds r1, 0x14 + str r1, [sp, 0x238] + adds r2, 0x14 + str r2, [sp, 0x23C] + adds r0, 0xC + str r0, [sp, 0x240] + adds r1, 0x10 + str r1, [sp, 0x244] + adds r2, 0x18 + str r2, [sp, 0x248] + adds r0, 0x18 + str r0, [sp, 0x24C] + adds r1, 0x14 + str r1, [sp, 0x250] + adds r2, 0xC + str r2, [sp, 0x254] + adds r0, 0xC + str r0, [sp, 0x258] + adds r1, 0xC + str r1, [sp, 0x25C] + adds r2, 0x9 + str r2, [sp, 0x260] + adds r0, 0x6 + str r0, [sp, 0x264] + adds r1, 0x3 + str r1, [sp, 0x268] + adds r2, 0x3 + str r2, [sp, 0x26C] + adds r0, 0x9 + str r0, [sp, 0x280] + adds r1, 0x2 + str r1, [sp, 0x270] + adds r2, 0x2 + str r2, [sp, 0x274] + subs r0, 0x4 + str r0, [sp, 0x278] + adds r1, 0x5 + str r1, [sp, 0x27C] + adds r2, 0x6 + str r2, [sp, 0x284] + adds r0, 0x6 + str r0, [sp, 0x288] + adds r1, 0x4 + str r1, [sp, 0x28C] + adds r2, 0x3 + str r2, [sp, 0x290] + subs r0, 0x59 + str r0, [sp, 0x224] + adds r4, r6, 0 + adds r4, 0x68 + movs r7, 0x3 +_080810C2: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80830D8 + adds r4, 0x4 + subs r7, 0x1 + cmp r7, 0 + bge _080810C2 + adds r0, r5, 0 + mov r1, r8 + bl sub_80818E4 + adds r0, r5, 0 + mov r1, r9 + bl sub_8081B54 + adds r0, r5, 0 + mov r1, r10 + bl sub_8081B54 + ldr r2, [sp, 0x214] + ldrb r1, [r2] + adds r0, r5, 0 + bl sub_8081880 + adds r0, r5, 0 + ldr r1, [sp, 0x210] + bl sub_8081898 + ldr r0, [sp, 0x218] + ldr r1, [r0] + adds r0, r5, 0 + bl sub_8083078 + ldr r2, [sp, 0x21C] + ldr r1, [r2] + adds r0, r5, 0 + bl sub_8083078 + ldr r0, [sp, 0x220] + ldr r1, [r0] + adds r0, r5, 0 + bl sub_8083078 + adds r0, r5, 0 + ldr r1, [sp, 0x228] + bl sub_8081920 + adds r0, r5, 0 + ldr r1, [sp, 0x22C] + bl sub_808193C + adds r0, r5, 0 + ldr r1, [sp, 0x230] + bl sub_8081968 + adds r0, r5, 0 + ldr r1, [sp, 0x234] + bl sub_8081994 + adds r0, r5, 0 + ldr r1, [sp, 0x238] + bl sub_80819B0 + adds r0, r5, 0 + ldr r1, [sp, 0x23C] + bl sub_80819D4 + adds r0, r5, 0 + ldr r1, [sp, 0x240] + bl sub_80819F0 + adds r0, r5, 0 + ldr r1, [sp, 0x244] + bl sub_8081A24 + adds r0, r5, 0 + ldr r1, [sp, 0x248] + bl sub_8081A58 + adds r0, r5, 0 + ldr r1, [sp, 0x24C] + bl sub_8081A74 + adds r0, r5, 0 + ldr r1, [sp, 0x250] + bl sub_8081A80 + adds r0, r5, 0 + ldr r1, [sp, 0x254] + bl sub_8081A9C + adds r0, r5, 0 + ldr r1, [sp, 0x258] + bl sub_8081AB8 + ldr r2, [sp, 0x25C] + ldrb r1, [r2] + adds r0, r5, 0 + bl sub_80830B4 + ldr r0, [sp, 0x260] + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_80830B4 + ldr r2, [sp, 0x264] + ldrb r1, [r2] + adds r0, r5, 0 + bl sub_80830B4 + ldr r0, [sp, 0x268] + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_80830B4 + ldr r2, [sp, 0x26C] + ldrb r1, [r2] + adds r0, r5, 0 + bl sub_80830B4 + ldr r0, [sp, 0x280] + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_8083060 + ldr r2, [sp, 0x270] + ldrb r1, [r2] + adds r0, r5, 0 + bl sub_80830B4 + ldr r0, [sp, 0x274] + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_80830B4 + ldr r2, [sp, 0x278] + ldrb r1, [r2] + adds r0, r5, 0 + bl sub_80830B4 + ldr r0, [sp, 0x27C] + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_8083060 + ldr r2, [sp, 0x284] + ldrb r1, [r2] + adds r0, r5, 0 + bl sub_80830B4 + ldr r0, [sp, 0x288] + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_8083060 + ldr r2, [sp, 0x28C] + ldrb r1, [r2] + adds r0, r5, 0 + bl sub_8083060 + ldr r0, [sp, 0x290] + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_808183C + movs r1, 0x80 + lsls r1, 1 + adds r0, r6, r1 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_8081854 + movs r2, 0x82 + lsls r2, 1 + adds r0, r6, r2 + ldr r1, [r0] + adds r0, r5, 0 + bl sub_808186C + movs r0, 0x84 + lsls r0, 1 + adds r1, r6, r0 + adds r0, r5, 0 + movs r2, 0x5 + bl sub_808314C + ldr r2, _08081428 + adds r1, r6, r2 + adds r0, r5, 0 + movs r2, 0x5 + bl sub_808314C + movs r1, 0x89 + lsls r1, 1 + adds r0, r6, r1 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_8083060 + ldr r2, _0808142C + adds r0, r6, r2 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_8083060 + movs r1, 0x8A + lsls r1, 1 + adds r0, r6, r1 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_8083060 + movs r2, 0x8C + lsls r2, 1 + adds r1, r6, r2 + adds r0, r5, 0 + bl sub_8081B08 + movs r0, 0x9E + lsls r0, 1 + adds r1, r6, r0 + adds r0, r5, 0 + bl sub_8081B34 + movs r2, 0xA0 + lsls r2, 1 + adds r1, r6, r2 + adds r0, r5, 0 + bl sub_8081B34 + movs r1, 0xA2 + lsls r1, 1 + adds r0, r6, r1 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_80830B4 + ldr r2, _08081430 + adds r0, r6, r2 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_80830B4 + ldr r1, _08081434 + adds r0, r6, r1 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_80830B4 + movs r2, 0xA3 + lsls r2, 1 + adds r0, r6, r2 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_80830B4 + movs r1, 0xA4 + lsls r1, 1 + adds r0, r6, r1 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_80830B4 + ldr r2, _08081438 + adds r0, r6, r2 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_80830B4 + movs r1, 0xA5 + lsls r1, 1 + adds r0, r6, r1 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_80830B4 + ldr r2, _0808143C + adds r0, r6, r2 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_80830B4 + movs r1, 0xA6 + lsls r1, 1 + adds r0, r6, r1 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_80830B4 + movs r2, 0xA7 + lsls r2, 1 + adds r0, r6, r2 + ldrh r1, [r0] + adds r0, r5, 0 + bl sub_8083030 + movs r1, 0xA8 + lsls r1, 1 + adds r0, r6, r1 + ldrh r1, [r0] + adds r0, r5, 0 + bl sub_8083030 + movs r2, 0xA9 + lsls r2, 1 + adds r0, r6, r2 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_80830B4 + ldr r1, _08081440 + adds r0, r6, r1 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_8083060 + movs r2, 0xAA + lsls r2, 1 + adds r0, r6, r2 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_80830B4 + ldr r1, _08081444 + adds r0, r6, r1 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_80830B4 + movs r2, 0xAB + lsls r2, 1 + adds r0, r6, r2 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_80830B4 + movs r1, 0xB2 + lsls r1, 1 + adds r0, r6, r1 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_8083060 + ldr r2, _08081448 + adds r0, r6, r2 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_8083060 + movs r1, 0xB3 + lsls r1, 1 + adds r0, r6, r1 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_8083060 + ldr r2, _0808144C + adds r0, r6, r2 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_8083060 + movs r1, 0xB4 + lsls r1, 1 + adds r0, r6, r1 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_8083060 + ldr r2, _08081450 + adds r0, r6, r2 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_8083060 + movs r0, 0xB6 + lsls r0, 1 + adds r1, r6, r0 + adds r0, r5, 0 + bl sub_80830D8 + movs r1, 0xBA + lsls r1, 1 + adds r0, r6, r1 + ldr r1, [r0] + adds r0, r5, 0 + bl sub_80830A0 + movs r2, 0xBC + lsls r2, 1 + adds r0, r6, r2 + ldrh r1, [r0] + adds r0, r5, 0 + bl sub_8083030 + movs r1, 0xFC + lsls r1, 1 + adds r0, r6, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + adds r0, r5, 0 + bl sub_8083048 + movs r1, 0xFD + lsls r1, 1 + adds r0, r6, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + adds r0, r5, 0 + bl sub_8083048 + movs r1, 0xFE + lsls r1, 1 + adds r0, r6, r1 + ldr r1, [r0] + adds r0, r5, 0 + bl sub_8083078 + ldr r2, [sp, 0x224] + ldrb r1, [r2] + adds r0, r5, 0 + bl sub_80818B8 + movs r3, 0xA5 + lsls r3, 2 + add sp, r3 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08081428: .4byte 0x0000010d +_0808142C: .4byte 0x00000113 +_08081430: .4byte 0x00000145 +_08081434: .4byte 0x00000147 +_08081438: .4byte 0x00000149 +_0808143C: .4byte 0x0000014b +_08081440: .4byte 0x00000153 +_08081444: .4byte 0x00000155 +_08081448: .4byte 0x00000165 +_0808144C: .4byte 0x00000167 +_08081450: .4byte 0x00000169 + thumb_func_end sub_8080E0C + + thumb_func_start sub_8081454 +sub_8081454: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r7, r0, 0 + ldr r1, _08081600 + bl sub_808300C + ldr r4, _08081604 + ldr r0, [r4] + ldr r1, _08081608 + adds r0, r1 + ldrb r1, [r0] + adds r0, r7, 0 + bl sub_80830B4 + ldr r0, [r4] + ldr r2, _0808160C + adds r0, r2 + ldrb r1, [r0] + adds r0, r7, 0 + bl sub_80830B4 + ldr r0, [r4] + ldr r1, _08081610 + adds r0, r1 + ldrb r1, [r0] + adds r0, r7, 0 + bl sub_80830B4 + ldr r0, [r4] + ldr r2, _08081614 + adds r0, r2 + ldrb r1, [r0] + adds r0, r7, 0 + bl sub_80830B4 + ldr r0, [r4] + ldr r1, _08081618 + adds r0, r1 + ldrb r1, [r0] + adds r0, r7, 0 + bl sub_8083060 + ldr r0, [r4] + ldr r2, _0808161C + adds r0, r2 + ldrb r1, [r0] + adds r0, r7, 0 + bl sub_8083060 + ldr r0, [r4] + ldr r1, _08081620 + adds r0, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + adds r0, r7, 0 + bl sub_8083048 + ldr r0, [r4] + ldr r1, _08081624 + adds r0, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + adds r0, r7, 0 + bl sub_8083048 + ldr r0, [r4] + ldr r1, _08081628 + adds r0, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + adds r0, r7, 0 + bl sub_8083048 + ldr r0, [r4] + ldr r1, _0808162C + adds r0, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + adds r0, r7, 0 + bl sub_8083048 + ldr r0, [r4] + ldr r1, _08081630 + adds r0, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + adds r0, r7, 0 + bl sub_8083048 + movs r1, 0 + mov r9, r4 +_08081510: + lsls r0, r1, 2 + adds r2, r1, 0x1 + mov r8, r2 + adds r0, r1 + lsls r0, 2 + adds r0, r1 + lsls r0, 6 + ldr r1, _08081634 + adds r6, r0, r1 + movs r5, 0 + movs r4, 0x37 +_08081526: + mov r2, r9 + ldr r1, [r2] + adds r1, r6 + adds r1, r5 + adds r0, r7, 0 + bl sub_8081B60 + adds r5, 0x18 + subs r4, 0x1 + cmp r4, 0 + bge _08081526 + mov r1, r8 + cmp r1, 0x1F + ble _08081510 + ldr r4, _08081604 + ldr r1, [r4] + ldr r0, _08081638 + adds r1, r0 + adds r0, r7, 0 + bl sub_80830D8 + ldr r1, [r4] + ldr r2, _0808163C + adds r1, r2 + adds r0, r7, 0 + bl sub_80830D8 + ldr r6, _08081640 + movs r5, 0x7 +_08081560: + ldr r1, [r4] + adds r1, r6 + adds r0, r7, 0 + bl sub_80830D8 + adds r6, 0x4 + subs r5, 0x1 + cmp r5, 0 + bge _08081560 + ldr r4, _08081604 + ldr r1, [r4] + ldr r0, _08081644 + adds r1, r0 + adds r0, r7, 0 + bl sub_80830F8 + ldr r1, [r4] + ldr r2, _08081648 + adds r1, r2 + adds r0, r7, 0 + bl sub_80830F8 + ldr r1, [r4] + ldr r0, _0808164C + adds r1, r0 + adds r0, r7, 0 + bl sub_808312C + movs r1, 0 + mov r10, r4 +_0808159C: + movs r4, 0 + adds r2, r1, 0x1 + mov r8, r2 + lsls r0, r1, 1 + lsls r2, r1, 3 + mov r9, r2 + adds r0, r1 + lsls r0, 6 + ldr r1, _08081650 + adds r6, r0, r1 + movs r5, 0 +_080815B2: + mov r2, r10 + ldr r1, [r2] + adds r1, r6 + adds r1, r5 + adds r0, r7, 0 + bl sub_8081B60 + mov r1, r10 + ldr r0, [r1] + mov r2, r9 + adds r1, r4, r2 + ldr r2, _08081654 + adds r0, r2 + adds r0, r1 + ldrb r1, [r0] + adds r0, r7, 0 + bl sub_8083060 + adds r5, 0x18 + adds r4, 0x1 + cmp r4, 0x7 + ble _080815B2 + mov r1, r8 + cmp r1, 0x7 + ble _0808159C + ldr r0, _08081604 + ldr r1, [r0] + ldr r0, _08081658 + adds r1, r0 + adds r0, r7, 0 + bl sub_8081B94 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08081600: .4byte gUnknown_81071E0 +_08081604: .4byte gUnknown_203B418 +_08081608: .4byte 0x00003a08 +_0808160C: .4byte 0x00003a09 +_08081610: .4byte 0x00003a0a +_08081614: .4byte 0x00003a0b +_08081618: .4byte 0x00003a0c +_0808161C: .4byte 0x00003a0d +_08081620: .4byte 0x00003a0e +_08081624: .4byte 0x00003a10 +_08081628: .4byte 0x00003a12 +_0808162C: .4byte 0x00003a14 +_08081630: .4byte 0x00003a16 +_08081634: .4byte 0x00003a18 +_08081638: .4byte 0x0000e218 +_0808163C: .4byte 0x0000e21c +_08081640: .4byte 0x0000e220 +_08081644: .4byte 0x0000e240 +_08081648: .4byte 0x0000e250 +_0808164C: .4byte 0x0000e260 +_08081650: .4byte 0x0000e27c +_08081654: .4byte 0x0000e87c +_08081658: .4byte 0x0000e264 + thumb_func_end sub_8081454 + + thumb_func_start sub_808165C +sub_808165C: + push {r4,r5,lr} + adds r5, r0, 0 + ldr r1, _08081708 + bl sub_808300C + ldr r4, _0808170C + ldr r0, [r4] + ldr r1, _08081710 + adds r0, r1 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_8083060 + ldr r0, [r4] + ldr r1, _08081714 + adds r0, r1 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_8083060 + ldr r0, [r4] + ldr r1, _08081718 + adds r0, r1 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_80830B4 + ldr r0, [r4] + ldr r1, _0808171C + adds r0, r1 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_80830B4 + ldr r0, [r4] + ldr r1, _08081720 + adds r0, r1 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_80830B4 + ldr r0, [r4] + ldr r1, _08081724 + adds r0, r1 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_80830B4 + ldr r0, [r4] + ldr r1, _08081728 + adds r0, r1 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_80830B4 + ldr r0, [r4] + ldr r1, _0808172C + adds r0, r1 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_80830B4 + ldr r0, [r4] + ldr r1, _08081730 + adds r0, r1 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_80830B4 + ldr r0, [r4] + ldr r1, _08081734 + adds r0, r1 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_80830B4 + ldr r0, [r4] + ldr r1, _08081738 + adds r0, r1 + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_80830B4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08081708: .4byte gUnknown_81071E0 +_0808170C: .4byte gUnknown_203B418 +_08081710: .4byte 0x00018208 +_08081714: .4byte 0x00018209 +_08081718: .4byte 0x0001820a +_0808171C: .4byte 0x0001820b +_08081720: .4byte 0x0001820c +_08081724: .4byte 0x0001820d +_08081728: .4byte 0x0001820e +_0808172C: .4byte 0x0001820f +_08081730: .4byte 0x00018210 +_08081734: .4byte 0x00018211 +_08081738: .4byte 0x00018213 + thumb_func_end sub_808165C + + thumb_func_start sub_808173C +sub_808173C: + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, _08081778 + ldr r0, [r4] + ldr r1, _0808177C + adds r0, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + adds r0, r5, 0 + bl sub_8083048 + ldr r0, [r4] + ldr r1, _08081780 + adds r0, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + adds r0, r5, 0 + bl sub_8083048 + ldr r0, [r4] + ldr r1, _08081784 + adds r0, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + adds r0, r5, 0 + bl sub_8083048 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08081778: .4byte gUnknown_203B418 +_0808177C: .4byte 0x0001ced6 +_08081780: .4byte 0x0001ced8 +_08081784: .4byte 0x0001ceda + thumb_func_end sub_808173C + + thumb_func_start sub_8081788 +sub_8081788: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + bl sub_8082FA8 + adds r1, r5, 0x1 + adds r0, r4, 0 + movs r2, 0x1 + bl sub_8082FA8 + adds r5, 0x2 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_8082FA8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8081788 + + thumb_func_start sub_80817B0 +sub_80817B0: + push {lr} + sub sp, 0x4 + mov r2, sp + strb r1, [r2] + mov r1, sp + movs r2, 0x1 + bl sub_8082FA8 + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80817B0 + + thumb_func_start sub_80817C8 +sub_80817C8: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r1, r4, 0x2 + movs r2, 0x1 + bl sub_8082FA8 + adds r1, r4, 0 + adds r1, 0x14 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_8082FA8 + adds r4, 0x16 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_8082FA8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80817C8 + + thumb_func_start sub_80817F4 +sub_80817F4: + push {lr} + sub sp, 0x4 + mov r2, sp + strh r1, [r2] + mov r1, sp + movs r2, 0x2 + bl sub_8082FA8 + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80817F4 + + thumb_func_start sub_808180C +sub_808180C: + push {lr} + sub sp, 0x4 + mov r2, sp + strb r1, [r2] + mov r1, sp + movs r2, 0x1 + bl sub_8082FA8 + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_808180C + + thumb_func_start sub_8081824 +sub_8081824: + push {lr} + sub sp, 0x4 + mov r2, sp + strb r1, [r2] + mov r1, sp + movs r2, 0x1 + bl sub_8082FA8 + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8081824 + + thumb_func_start sub_808183C +sub_808183C: + push {lr} + sub sp, 0x4 + mov r2, sp + strb r1, [r2] + mov r1, sp + movs r2, 0x1 + bl sub_8082FA8 + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_808183C + + thumb_func_start sub_8081854 +sub_8081854: + push {lr} + sub sp, 0x4 + mov r2, sp + strb r1, [r2] + mov r1, sp + movs r2, 0x1 + bl sub_8082FA8 + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8081854 + + thumb_func_start sub_808186C +sub_808186C: + push {lr} + sub sp, 0x4 + str r1, [sp] + mov r1, sp + movs r2, 0x4 + bl sub_8082FA8 + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_808186C + + thumb_func_start sub_8081880 +sub_8081880: + push {lr} + sub sp, 0x4 + mov r2, sp + strb r1, [r2] + mov r1, sp + movs r2, 0x1 + bl sub_8082FA8 + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8081880 + + thumb_func_start sub_8081898 +sub_8081898: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r0, 0 + ldrsh r1, [r4, r0] + adds r0, r5, 0 + bl sub_8083048 + ldrb r1, [r4, 0x2] + adds r0, r5, 0 + bl sub_808180C + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8081898 + + thumb_func_start sub_80818B8 +sub_80818B8: + push {lr} + lsls r1, 24 + lsrs r1, 24 + bl sub_8083060 + pop {r0} + bx r0 + thumb_func_end sub_80818B8 + + thumb_func_start sub_80818C8 +sub_80818C8: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldrb r1, [r4] + bl sub_8083060 + ldrb r1, [r4, 0x1] + adds r0, r5, 0 + bl sub_8083060 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80818C8 + + thumb_func_start sub_80818E4 +sub_80818E4: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r2, 0x1 + bl sub_8082FA8 + ldrb r1, [r4, 0x1] + adds r0, r5, 0 + bl sub_80830B4 + ldrb r1, [r4, 0x2] + adds r0, r5, 0 + bl sub_80830B4 + ldrb r1, [r4, 0x3] + adds r0, r5, 0 + bl sub_80830B4 + ldrh r1, [r4, 0x4] + adds r0, r5, 0 + bl sub_8083030 + adds r4, 0x10 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80830D8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80818E4 + + thumb_func_start sub_8081920 +sub_8081920: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r2, 0x1 + bl sub_8082FA8 + ldrb r1, [r4, 0x1] + adds r0, r5, 0 + bl sub_8083060 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8081920 + + thumb_func_start sub_808193C +sub_808193C: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r2, 0x1 + bl sub_8082FA8 + ldrb r1, [r4, 0x1] + adds r0, r5, 0 + bl sub_8083060 + ldrb r1, [r4, 0x2] + adds r0, r5, 0 + bl sub_8083060 + ldrb r1, [r4, 0x3] + adds r0, r5, 0 + bl sub_8083060 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_808193C + + thumb_func_start sub_8081968 +sub_8081968: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r2, 0x1 + bl sub_8082FA8 + ldrb r1, [r4, 0x8] + adds r0, r5, 0 + bl sub_8083060 + ldrb r1, [r4, 0x9] + adds r0, r5, 0 + bl sub_8083060 + ldr r1, [r4, 0x4] + adds r0, r5, 0 + bl sub_8083078 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8081968 + + thumb_func_start sub_8081994 +sub_8081994: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r2, 0x1 + bl sub_8082FA8 + ldrb r1, [r4, 0x1] + adds r0, r5, 0 + bl sub_8083060 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8081994 + + thumb_func_start sub_80819B0 +sub_80819B0: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r2, 0x1 + bl sub_8082FA8 + ldrb r1, [r4, 0x1] + adds r0, r5, 0 + bl sub_8083060 + ldrb r1, [r4, 0x2] + adds r0, r5, 0 + bl sub_8083060 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80819B0 + + thumb_func_start sub_80819D4 +sub_80819D4: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r2, 0x1 + bl sub_8082FA8 + ldrb r1, [r4, 0x1] + adds r0, r5, 0 + bl sub_8083060 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80819D4 + + thumb_func_start sub_80819F0 +sub_80819F0: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r2, 0x1 + bl sub_8082FA8 + ldrb r1, [r4, 0x1] + adds r0, r5, 0 + bl sub_80830B4 + ldrb r1, [r4, 0x2] + adds r0, r5, 0 + bl sub_80830B4 + ldrb r1, [r4, 0x3] + adds r0, r5, 0 + bl sub_8083060 + ldrb r1, [r4, 0x4] + adds r0, r5, 0 + bl sub_8083060 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80819F0 + + thumb_func_start sub_8081A24 +sub_8081A24: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r2, 0x1 + bl sub_8082FA8 + ldr r1, [r4, 0x4] + adds r0, r5, 0 + bl sub_8083078 + ldrb r1, [r4, 0x8] + adds r0, r5, 0 + bl sub_8083060 + ldrb r1, [r4, 0x9] + adds r0, r5, 0 + bl sub_8083060 + ldrb r1, [r4, 0xA] + adds r0, r5, 0 + bl sub_8083060 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8081A24 + + thumb_func_start sub_8081A58 +sub_8081A58: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r2, 0x1 + bl sub_8082FA8 + ldrb r1, [r4, 0x1] + adds r0, r5, 0 + bl sub_8083060 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8081A58 + + thumb_func_start sub_8081A74 +sub_8081A74: + push {lr} + movs r2, 0x1 + bl sub_8082FA8 + pop {r0} + bx r0 + thumb_func_end sub_8081A74 + + thumb_func_start sub_8081A80 +sub_8081A80: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r2, 0x1 + bl sub_8082FA8 + ldrb r1, [r4, 0x1] + adds r0, r5, 0 + bl sub_8083060 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8081A80 + + thumb_func_start sub_8081A9C +sub_8081A9C: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r2, 0x1 + bl sub_8082FA8 + ldrb r1, [r4, 0x1] + adds r0, r5, 0 + bl sub_8083060 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8081A9C + + thumb_func_start sub_8081AB8 +sub_8081AB8: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r2, 0x1 + bl sub_8082FA8 + ldrb r1, [r4, 0x1] + adds r0, r5, 0 + bl sub_8083060 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8081AB8 + + thumb_func_start sub_8081AD4 +sub_8081AD4: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldrb r1, [r4] + bl sub_8083060 + ldrb r1, [r4, 0x1] + adds r0, r5, 0 + bl sub_8083060 + adds r1, r4, 0x2 + adds r0, r5, 0 + movs r2, 0x2 + bl sub_8082FA8 + ldrb r1, [r4, 0x4] + adds r0, r5, 0 + bl sub_8083060 + ldrb r1, [r4, 0x5] + adds r0, r5, 0 + bl sub_8083060 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8081AD4 + + thumb_func_start sub_8081B08 +sub_8081B08: + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + adds r4, r7, 0 + movs r5, 0x3 +_08081B12: + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_8081AD4 + adds r4, 0x8 + subs r5, 0x1 + cmp r5, 0 + bge _08081B12 + adds r0, r7, 0 + adds r0, 0x20 + ldrb r1, [r0] + adds r0, r6, 0 + bl sub_8083060 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8081B08 + + thumb_func_start sub_8081B34 +sub_8081B34: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r0, 0 + ldrsh r1, [r4, r0] + adds r0, r5, 0 + bl sub_8083048 + movs r0, 0x2 + ldrsh r1, [r4, r0] + adds r0, r5, 0 + bl sub_8083048 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8081B34 + + thumb_func_start sub_8081B54 +sub_8081B54: + push {lr} + movs r2, 0x3 + bl sub_8082FA8 + pop {r0} + bx r0 + thumb_func_end sub_8081B54 + + thumb_func_start sub_8081B60 +sub_8081B60: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldrh r1, [r4] + bl sub_8083030 + ldrh r1, [r4, 0x4] + adds r0, r5, 0 + bl sub_8083030 + adds r1, r4, 0 + adds r1, 0x9 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_8082FA8 + adds r4, 0xE + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_8082FA8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8081B60 + + thumb_func_start sub_8081B94 +sub_8081B94: + push {r4-r6,lr} + adds r6, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + bl sub_8082FA8 + adds r1, r5, 0x1 + adds r0, r6, 0 + movs r2, 0x1 + bl sub_8082FA8 + movs r4, 0 +_08081BAC: + adds r0, r5, 0x3 + adds r0, r4 + ldrb r1, [r0] + adds r0, r6, 0 + bl sub_8083060 + adds r0, r5, 0 + adds r0, 0xB + adds r0, r4 + ldrb r1, [r0] + adds r0, r6, 0 + bl sub_8083060 + adds r4, 0x1 + cmp r4, 0x7 + ble _08081BAC + ldrb r1, [r5, 0x2] + adds r0, r6, 0 + bl sub_8083060 + ldrb r1, [r5, 0x13] + adds r0, r6, 0 + bl sub_8083060 + ldrb r1, [r5, 0x14] + adds r0, r6, 0 + bl sub_8083060 + ldrb r1, [r5, 0x15] + adds r0, r6, 0 + bl sub_80830B4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8081B94 + + thumb_func_start sub_8081BF4 +sub_8081BF4: + push {lr} + sub sp, 0x10 + adds r3, r0, 0 + adds r2, r1, 0 + mov r0, sp + adds r1, r3, 0 + bl sub_8082FD4 + add r1, sp, 0xC + mov r0, sp + movs r2, 0x4 + bl sub_8082FE0 + mov r0, sp + bl sub_8081C50 + mov r0, sp + bl sub_8081C7C + mov r0, sp + bl sub_8081F2C + mov r0, sp + bl sub_808201C + mov r0, sp + bl sub_8082060 + mov r0, sp + bl sub_80820D8 + mov r0, sp + bl sub_808217C + ldr r1, _08081C4C + mov r0, sp + bl sub_8083018 + mov r0, sp + bl nullsub_98 + add sp, 0x10 + pop {r0} + bx r0 + .align 2, 0 +_08081C4C: .4byte gUnknown_81071D4 + thumb_func_end sub_8081BF4 + + thumb_func_start sub_8081C50 +sub_8081C50: + push {r4,lr} + adds r4, r0, 0 + ldr r1, _08081C70 + bl sub_8083018 + ldr r0, _08081C74 + ldr r1, [r0] + ldr r0, _08081C78 + adds r1, r0 + adds r0, r4, 0 + movs r2, 0x58 + bl sub_8082FE0 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08081C70: .4byte gUnknown_81071E0 +_08081C74: .4byte gUnknown_203B418 +_08081C78: .4byte 0x00000644 + thumb_func_end sub_8081C50 + + thumb_func_start sub_8081C7C +sub_8081C7C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r7, r0, 0 + ldr r1, _08081E20 + bl sub_8083018 + adds r0, r7, 0 + bl sub_80831DC + ldr r4, _08081E24 + ldr r1, [r4] + ldr r2, _08081E28 + adds r1, r2 + strb r0, [r1] + adds r0, r7, 0 + bl sub_80831DC + ldr r1, [r4] + ldr r3, _08081E2C + adds r1, r3 + strb r0, [r1] + adds r0, r7, 0 + bl sub_80831DC + ldr r1, [r4] + ldr r2, _08081E30 + adds r1, r2 + strb r0, [r1] + adds r0, r7, 0 + bl sub_80831DC + ldr r1, [r4] + ldr r3, _08081E34 + adds r1, r3 + strb r0, [r1] + adds r0, r7, 0 + bl sub_8083188 + ldr r1, [r4] + ldr r2, _08081E38 + adds r1, r2 + strb r0, [r1] + adds r0, r7, 0 + bl sub_8083188 + ldr r1, [r4] + ldr r3, _08081E3C + adds r1, r3 + strb r0, [r1] + adds r0, r7, 0 + bl sub_8083170 + ldr r1, [r4] + ldr r2, _08081E40 + adds r1, r2 + strh r0, [r1] + adds r0, r7, 0 + bl sub_8083170 + ldr r1, [r4] + ldr r3, _08081E44 + adds r1, r3 + strh r0, [r1] + adds r0, r7, 0 + bl sub_8083170 + ldr r1, [r4] + ldr r2, _08081E48 + adds r1, r2 + strh r0, [r1] + adds r0, r7, 0 + bl sub_8083170 + ldr r1, [r4] + ldr r3, _08081E4C + adds r1, r3 + strh r0, [r1] + adds r0, r7, 0 + bl sub_8083170 + ldr r1, [r4] + ldr r2, _08081E50 + adds r1, r2 + strh r0, [r1] + movs r1, 0 + mov r9, r4 +_08081D2E: + lsls r0, r1, 2 + adds r3, r1, 0x1 + mov r8, r3 + adds r0, r1 + lsls r0, 2 + adds r0, r1 + lsls r0, 6 + ldr r1, _08081E54 + adds r6, r0, r1 + movs r5, 0 + movs r4, 0x37 +_08081D44: + mov r2, r9 + ldr r1, [r2] + adds r1, r6 + adds r1, r5 + adds r0, r7, 0 + bl sub_8081E7C + adds r5, 0x18 + subs r4, 0x1 + cmp r4, 0 + bge _08081D44 + mov r1, r8 + cmp r1, 0x1F + ble _08081D2E + ldr r4, _08081E24 + ldr r1, [r4] + ldr r3, _08081E58 + adds r1, r3 + adds r0, r7, 0 + bl sub_80831F8 + ldr r1, [r4] + ldr r0, _08081E5C + adds r1, r0 + adds r0, r7, 0 + bl sub_80831F8 + ldr r6, _08081E60 + movs r5, 0x7 +_08081D7E: + ldr r1, [r4] + adds r1, r6 + adds r0, r7, 0 + bl sub_80831F8 + adds r6, 0x4 + subs r5, 0x1 + cmp r5, 0 + bge _08081D7E + ldr r4, _08081E24 + ldr r1, [r4] + ldr r2, _08081E64 + adds r1, r2 + adds r0, r7, 0 + bl sub_8083220 + ldr r1, [r4] + ldr r3, _08081E68 + adds r1, r3 + adds r0, r7, 0 + bl sub_8083220 + ldr r1, [r4] + ldr r0, _08081E6C + adds r1, r0 + adds r0, r7, 0 + bl sub_8083260 + movs r1, 0 + mov r10, r4 +_08081DBA: + movs r4, 0 + adds r2, r1, 0x1 + mov r8, r2 + lsls r0, r1, 1 + lsls r3, r1, 3 + mov r9, r3 + adds r0, r1 + lsls r0, 6 + ldr r1, _08081E70 + adds r6, r0, r1 + movs r5, 0 +_08081DD0: + mov r2, r10 + ldr r1, [r2] + adds r1, r6 + adds r1, r5 + adds r0, r7, 0 + bl sub_8081E7C + adds r0, r7, 0 + bl sub_8083188 + mov r3, r10 + ldr r1, [r3] + mov r3, r9 + adds r2, r4, r3 + ldr r3, _08081E74 + adds r1, r3 + adds r1, r2 + strb r0, [r1] + adds r5, 0x18 + adds r4, 0x1 + cmp r4, 0x7 + ble _08081DD0 + mov r1, r8 + cmp r1, 0x7 + ble _08081DBA + ldr r0, _08081E24 + ldr r1, [r0] + ldr r0, _08081E78 + adds r1, r0 + adds r0, r7, 0 + bl sub_8081EC0 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08081E20: .4byte gUnknown_81071E0 +_08081E24: .4byte gUnknown_203B418 +_08081E28: .4byte 0x00003a08 +_08081E2C: .4byte 0x00003a09 +_08081E30: .4byte 0x00003a0a +_08081E34: .4byte 0x00003a0b +_08081E38: .4byte 0x00003a0c +_08081E3C: .4byte 0x00003a0d +_08081E40: .4byte 0x00003a0e +_08081E44: .4byte 0x00003a10 +_08081E48: .4byte 0x00003a12 +_08081E4C: .4byte 0x00003a14 +_08081E50: .4byte 0x00003a16 +_08081E54: .4byte 0x00003a18 +_08081E58: .4byte 0x0000e218 +_08081E5C: .4byte 0x0000e21c +_08081E60: .4byte 0x0000e220 +_08081E64: .4byte 0x0000e240 +_08081E68: .4byte 0x0000e250 +_08081E6C: .4byte 0x0000e260 +_08081E70: .4byte 0x0000e27c +_08081E74: .4byte 0x0000e87c +_08081E78: .4byte 0x0000e264 + thumb_func_end sub_8081C7C + + thumb_func_start sub_8081E7C +sub_8081E7C: + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x18 + bl memset + adds r0, r5, 0 + bl sub_8083158 + movs r6, 0 + strh r0, [r4] + adds r0, r5, 0 + bl sub_8083158 + strh r0, [r4, 0x4] + adds r1, r4, 0 + adds r1, 0x9 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_8082FE0 + adds r1, r4, 0 + adds r1, 0xE + adds r0, r5, 0 + movs r2, 0x1 + bl sub_8082FE0 + str r6, [r4, 0x10] + str r6, [r4, 0x14] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8081E7C + + thumb_func_start sub_8081EC0 +sub_8081EC0: + push {r4-r6,lr} + adds r6, r0, 0 + adds r5, r1, 0 + adds r0, r5, 0 + movs r1, 0 + movs r2, 0x18 + bl memset + adds r0, r6, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_8082FE0 + adds r1, r5, 0x1 + adds r0, r6, 0 + movs r2, 0x1 + bl sub_8082FE0 + movs r4, 0 +_08081EE6: + adds r0, r6, 0 + bl sub_8083188 + adds r1, r5, 0x3 + adds r1, r4 + strb r0, [r1] + adds r0, r6, 0 + bl sub_8083188 + adds r1, r5, 0 + adds r1, 0xB + adds r1, r4 + strb r0, [r1] + adds r4, 0x1 + cmp r4, 0x7 + ble _08081EE6 + adds r0, r6, 0 + bl sub_8083188 + strb r0, [r5, 0x2] + adds r0, r6, 0 + bl sub_8083188 + strb r0, [r5, 0x13] + adds r0, r6, 0 + bl sub_8083188 + strb r0, [r5, 0x14] + adds r0, r6, 0 + bl sub_80831DC + strb r0, [r5, 0x15] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8081EC0 + + thumb_func_start sub_8081F2C +sub_8081F2C: + push {r4,r5,lr} + adds r5, r0, 0 + ldr r1, _08081FE4 + bl sub_8083018 + ldr r4, _08081FE8 + ldr r0, [r4] + ldr r1, _08081FEC + adds r0, r1 + movs r1, 0 + str r1, [r0] + adds r0, r5, 0 + bl sub_8083188 + ldr r1, [r4] + ldr r2, _08081FF0 + adds r1, r2 + strb r0, [r1] + adds r0, r5, 0 + bl sub_8083188 + ldr r1, [r4] + ldr r2, _08081FF4 + adds r1, r2 + strb r0, [r1] + adds r0, r5, 0 + bl sub_80831DC + ldr r1, [r4] + ldr r2, _08081FF8 + adds r1, r2 + strb r0, [r1] + adds r0, r5, 0 + bl sub_80831DC + ldr r1, [r4] + ldr r2, _08081FFC + adds r1, r2 + strb r0, [r1] + adds r0, r5, 0 + bl sub_80831DC + ldr r1, [r4] + ldr r2, _08082000 + adds r1, r2 + strb r0, [r1] + adds r0, r5, 0 + bl sub_80831DC + ldr r1, [r4] + ldr r2, _08082004 + adds r1, r2 + strb r0, [r1] + adds r0, r5, 0 + bl sub_80831DC + ldr r1, [r4] + ldr r2, _08082008 + adds r1, r2 + strb r0, [r1] + adds r0, r5, 0 + bl sub_80831DC + ldr r1, [r4] + ldr r2, _0808200C + adds r1, r2 + strb r0, [r1] + adds r0, r5, 0 + bl sub_80831DC + ldr r1, [r4] + ldr r2, _08082010 + adds r1, r2 + strb r0, [r1] + adds r0, r5, 0 + bl sub_80831DC + ldr r1, [r4] + ldr r2, _08082014 + adds r1, r2 + strb r0, [r1] + adds r0, r5, 0 + bl sub_80831DC + ldr r1, [r4] + ldr r2, _08082018 + adds r1, r2 + strb r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08081FE4: .4byte gUnknown_81071E0 +_08081FE8: .4byte gUnknown_203B418 +_08081FEC: .4byte 0x000181f8 +_08081FF0: .4byte 0x00018208 +_08081FF4: .4byte 0x00018209 +_08081FF8: .4byte 0x0001820a +_08081FFC: .4byte 0x0001820b +_08082000: .4byte 0x0001820c +_08082004: .4byte 0x0001820d +_08082008: .4byte 0x0001820e +_0808200C: .4byte 0x0001820f +_08082010: .4byte 0x00018210 +_08082014: .4byte 0x00018211 +_08082018: .4byte 0x00018213 + thumb_func_end sub_8081F2C + + thumb_func_start sub_808201C +sub_808201C: + push {r4,r5,lr} + adds r5, r0, 0 + bl sub_8083170 + ldr r4, _08082050 + ldr r1, [r4] + ldr r2, _08082054 + adds r1, r2 + strh r0, [r1] + adds r0, r5, 0 + bl sub_8083170 + ldr r1, [r4] + ldr r2, _08082058 + adds r1, r2 + strh r0, [r1] + adds r0, r5, 0 + bl sub_8083170 + ldr r1, [r4] + ldr r2, _0808205C + adds r1, r2 + strh r0, [r1] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08082050: .4byte gUnknown_203B418 +_08082054: .4byte 0x0001ced6 +_08082058: .4byte 0x0001ced8 +_0808205C: .4byte 0x0001ceda + thumb_func_end sub_808201C + + thumb_func_start sub_8082060 +sub_8082060: + push {r4-r7,lr} + sub sp, 0x8 + adds r5, r0, 0 + ldr r1, _080820A4 + bl sub_8083018 + add r4, sp, 0x4 + mov r7, sp + movs r6, 0x3F +_08082072: + adds r0, r5, 0 + mov r1, sp + bl sub_80820A8 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80831F8 + ldrb r1, [r7] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08082096 + adds r0, r4, 0 + mov r1, sp + movs r2, 0 + bl sub_80460F8 +_08082096: + subs r6, 0x1 + cmp r6, 0 + bge _08082072 + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080820A4: .4byte gUnknown_81071E0 + thumb_func_end sub_8082060 + + thumb_func_start sub_80820A8 +sub_80820A8: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r0, 0 + str r0, [r4] + adds r0, r5, 0 + movs r2, 0x1 + bl sub_8082FE0 + adds r1, r4, 0x1 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_8082FE0 + adds r4, 0x2 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_8082FE0 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80820A8 + + thumb_func_start sub_80820D8 +sub_80820D8: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r5, r0, 0 + ldr r1, _08082178 + bl sub_8083018 + movs r0, 0x1 + add r0, sp + mov r9, r0 + add r1, sp, 0x4 + mov r8, r1 + mov r7, sp + movs r2, 0x3F + mov r10, r2 +_080820FC: + movs r0, 0x6 + strb r0, [r7] + movs r0, 0 + mov r3, sp + strb r0, [r3, 0x1] + adds r0, r5, 0 + mov r1, sp + movs r2, 0x1 + bl sub_8082FE0 + adds r0, r5, 0 + mov r1, sp + adds r1, 0x1 + movs r2, 0x1 + bl sub_8082FE0 + adds r0, r5, 0 + bl sub_80831DC + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r5, 0 + add r1, sp, 0x4 + bl sub_80831F8 + ldrb r0, [r7] + cmp r0, 0xFF + beq _0808215C + mov r1, r8 + movs r2, 0 + ldrsh r0, [r1, r2] + mov r3, sp + movs r2, 0x6 + ldrsh r1, [r3, r2] + bl sub_8049590 + adds r4, r0, 0 + ldrb r0, [r7] + mov r3, r9 + ldrb r2, [r3] + mov r1, r8 + bl sub_8045684 + cmp r0, 0 + beq _0808215C + str r0, [r4, 0x14] + adds r0, 0x20 + strb r6, [r0] +_0808215C: + movs r0, 0x1 + negs r0, r0 + add r10, r0 + mov r1, r10 + cmp r1, 0 + bge _080820FC + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08082178: .4byte gUnknown_81071E0 + thumb_func_end sub_80820D8 + + thumb_func_start sub_808217C +sub_808217C: + push {r4,r5,lr} + adds r5, r0, 0 + ldr r1, _08082250 + bl sub_8083018 + adds r0, r5, 0 + bl sub_80831A0 + ldr r4, _08082254 + ldr r1, [r4] + ldr r2, _08082258 + adds r1, r2 + str r0, [r1] + adds r0, r5, 0 + bl sub_80831A0 + ldr r1, [r4] + ldr r2, _0808225C + adds r1, r2 + str r0, [r1] + adds r0, r5, 0 + bl sub_80831DC + ldr r1, [r4] + ldr r2, _08082260 + adds r1, r2 + strb r0, [r1] + adds r0, r5, 0 + bl sub_80831DC + ldr r1, [r4] + ldr r2, _08082264 + adds r1, r2 + strb r0, [r1] + adds r0, r5, 0 + bl sub_80831DC + ldr r1, [r4] + ldr r2, _08082268 + adds r1, r2 + strb r0, [r1] + adds r0, r5, 0 + bl sub_80831DC + ldr r1, [r4] + ldr r2, _0808226C + adds r1, r2 + strb r0, [r1] + adds r0, r5, 0 + bl sub_80831DC + ldr r1, [r4] + ldr r2, _08082270 + adds r1, r2 + strb r0, [r1] + adds r0, r5, 0 + bl sub_80831DC + ldr r1, [r4] + ldr r2, _08082274 + adds r1, r2 + strb r0, [r1] + adds r0, r5, 0 + bl sub_80831DC + ldr r1, [r4] + ldr r2, _08082278 + adds r1, r2 + strb r0, [r1] + adds r0, r5, 0 + bl sub_80831DC + ldr r1, [r4] + ldr r2, _0808227C + adds r1, r2 + strb r0, [r1] + adds r0, r5, 0 + bl sub_8083158 + ldr r1, [r4] + movs r2, 0xE0 + lsls r2, 6 + adds r1, r2 + strh r0, [r1] + movs r4, 0 +_08082226: + adds r0, r5, 0 + movs r1, 0x1 + adds r2, r4, 0 + bl sub_8082280 + adds r4, 0x1 + cmp r4, 0x3 + ble _08082226 + movs r4, 0 +_08082238: + adds r0, r5, 0 + movs r1, 0 + adds r2, r4, 0 + bl sub_8082280 + adds r4, 0x1 + cmp r4, 0xF + ble _08082238 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08082250: .4byte gUnknown_81071E0 +_08082254: .4byte gUnknown_203B418 +_08082258: .4byte 0x000037f0 +_0808225C: .4byte 0x000037f4 +_08082260: .4byte 0x000037f8 +_08082264: .4byte 0x000037f9 +_08082268: .4byte 0x000037fa +_0808226C: .4byte 0x000037fb +_08082270: .4byte 0x000037fc +_08082274: .4byte 0x000037fd +_08082278: .4byte 0x000037fe +_0808227C: .4byte 0x000037ff + thumb_func_end sub_808217C + + thumb_func_start sub_8082280 +sub_8082280: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, _0808266C + add sp, r4 + adds r5, r0, 0 + str r2, [sp, 0x210] + lsls r1, 24 + lsrs r1, 24 + str r1, [sp, 0x20C] + movs r2, 0x82 + lsls r2, 2 + mov r0, sp + movs r1, 0 + bl memset + adds r0, r5, 0 + bl sub_8083188 + adds r0, r5, 0 + bl sub_8083188 + adds r0, r5, 0 + bl sub_8083188 + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x214] + add r4, sp, 0x208 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80831F8 + adds r0, r5, 0 + bl sub_80831DC + lsls r0, 24 + lsrs r0, 24 + str r0, [sp, 0x218] + adds r0, r5, 0 + bl sub_8083158 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x21C] + ldr r1, _08082670 + movs r0, 0 + str r0, [r1] + adds r0, r5, 0 + bl sub_8083158 + mov r1, sp + strh r0, [r1] + adds r0, r5, 0 + bl sub_8082BC0 + mov r1, sp + strh r0, [r1, 0x4] + adds r0, r5, 0 + bl sub_8082BC0 + mov r1, sp + strh r0, [r1, 0x2] + adds r0, r5, 0 + bl sub_80831DC + mov r1, sp + strb r0, [r1, 0x6] + adds r0, r5, 0 + bl sub_80831DC + mov r1, sp + strb r0, [r1, 0x7] + adds r0, r5, 0 + bl sub_8083188 + mov r1, sp + strb r0, [r1, 0x8] + adds r0, r5, 0 + bl sub_8083188 + mov r1, sp + strb r0, [r1, 0x9] + adds r0, r5, 0 + bl sub_8083188 + mov r1, sp + strb r0, [r1, 0xA] + add r1, sp, 0x40 + adds r0, r5, 0 + bl sub_8082F64 + adds r0, r5, 0 + bl sub_8083170 + mov r1, sp + strh r0, [r1, 0xC] + adds r0, r5, 0 + bl sub_8083170 + mov r1, sp + strh r0, [r1, 0xE] + adds r0, r5, 0 + bl sub_8083170 + mov r1, sp + strh r0, [r1, 0x10] + adds r0, r5, 0 + bl sub_8083170 + mov r1, sp + strh r0, [r1, 0x12] + adds r0, r5, 0 + bl sub_8083188 + mov r1, sp + strb r0, [r1, 0x14] + adds r0, r5, 0 + bl sub_8083188 + mov r1, sp + strb r0, [r1, 0x15] + adds r0, r5, 0 + bl sub_8083188 + mov r1, sp + strb r0, [r1, 0x16] + adds r0, r5, 0 + bl sub_8083188 + mov r1, sp + strb r0, [r1, 0x17] + adds r0, r5, 0 + bl sub_80831A0 + str r0, [sp, 0x18] + adds r0, r5, 0 + bl sub_8083170 + mov r1, sp + strh r0, [r1, 0x1C] + adds r0, r5, 0 + bl sub_8083170 + mov r1, sp + strh r0, [r1, 0x1E] + adds r0, r5, 0 + bl sub_8083170 + mov r1, sp + strh r0, [r1, 0x20] + adds r0, r5, 0 + bl sub_8083170 + mov r1, sp + strh r0, [r1, 0x22] + adds r0, r5, 0 + bl sub_8083170 + mov r1, sp + strh r0, [r1, 0x24] + adds r0, r5, 0 + bl sub_8083170 + mov r1, sp + strh r0, [r1, 0x26] + adds r0, r5, 0 + bl sub_8083170 + mov r1, sp + strh r0, [r1, 0x28] + adds r0, r5, 0 + bl sub_80831C8 + str r0, [sp, 0x2C] + adds r0, r5, 0 + bl sub_80831C8 + str r0, [sp, 0x30] + adds r0, r5, 0 + bl sub_80831C8 + str r0, [sp, 0x34] + adds r0, r5, 0 + bl sub_80831C8 + str r0, [sp, 0x38] + add r1, sp, 0x44 + adds r0, r5, 0 + bl sub_8082CBC + adds r0, r5, 0 + bl sub_8082BFC + add r1, sp, 0x5C + strb r0, [r1] + adds r0, r5, 0 + bl sub_8082BFC + mov r1, sp + adds r1, 0x5D + strb r0, [r1] + adds r0, r5, 0 + bl sub_8082C18 + mov r1, sp + adds r1, 0x5E + strb r0, [r1] + adds r0, r5, 0 + bl sub_8082C18 + mov r1, sp + adds r1, 0x5F + strb r0, [r1] + add r1, sp, 0x60 + adds r0, r5, 0 + bl sub_80820A8 + adds r0, r5, 0 + bl sub_8082BE0 + add r1, sp, 0x64 + strb r0, [r1] + add r7, sp, 0x78 + add r0, sp, 0x8C + mov r8, r0 + add r1, sp, 0x90 + mov r9, r1 + add r2, sp, 0x94 + mov r10, r2 + mov r3, sp + adds r3, 0x3C + str r3, [sp, 0x270] + mov r0, sp + adds r0, 0x98 + str r0, [sp, 0x274] + mov r1, sp + adds r1, 0x9C + str r1, [sp, 0x278] + mov r2, sp + adds r2, 0xA0 + str r2, [sp, 0x27C] + adds r3, 0x6C + str r3, [sp, 0x284] + adds r0, 0x14 + str r0, [sp, 0x288] + adds r1, 0x14 + str r1, [sp, 0x28C] + adds r2, 0x1C + str r2, [sp, 0x290] + adds r3, 0x18 + str r3, [sp, 0x294] + adds r0, 0x18 + str r0, [sp, 0x298] + adds r1, 0x18 + str r1, [sp, 0x29C] + adds r2, 0x14 + str r2, [sp, 0x220] + adds r3, 0x1C + str r3, [sp, 0x224] + adds r0, 0x1C + str r0, [sp, 0x228] + adds r1, 0x1C + str r1, [sp, 0x22C] + adds r2, 0x18 + str r2, [sp, 0x230] + adds r3, 0x10 + str r3, [sp, 0x234] + adds r0, 0x10 + str r0, [sp, 0x238] + adds r1, 0xD + str r1, [sp, 0x23C] + adds r2, 0xA + str r2, [sp, 0x240] + adds r3, 0x7 + str r3, [sp, 0x244] + adds r0, 0x4 + str r0, [sp, 0x248] + adds r1, 0xA + str r1, [sp, 0x25C] + adds r2, 0x3 + str r2, [sp, 0x24C] + adds r3, 0x3 + str r3, [sp, 0x250] + adds r0, 0x3 + str r0, [sp, 0x254] + subs r1, 0x1 + str r1, [sp, 0x258] + adds r2, 0x7 + str r2, [sp, 0x260] + adds r3, 0x7 + str r3, [sp, 0x264] + adds r0, 0x7 + str r0, [sp, 0x268] + adds r1, 0x5 + str r1, [sp, 0x26C] + subs r2, 0x58 + str r2, [sp, 0x280] + add r4, sp, 0x68 + movs r6, 0x3 +_080824DC: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80831F8 + adds r4, 0x4 + subs r6, 0x1 + cmp r6, 0 + bge _080824DC + adds r0, r5, 0 + adds r1, r7, 0 + bl sub_8082CE4 + adds r0, r5, 0 + mov r1, r8 + bl sub_8082D28 + adds r0, r5, 0 + mov r1, r9 + bl sub_8082D28 + adds r0, r5, 0 + bl sub_8082C84 + movs r4, 0 + mov r3, r10 + strb r0, [r3] + adds r0, r5, 0 + ldr r1, [sp, 0x270] + bl sub_8082F80 + adds r0, r5, 0 + bl sub_80831A0 + ldr r1, [sp, 0x274] + str r0, [r1] + adds r0, r5, 0 + bl sub_80831A0 + ldr r2, [sp, 0x278] + str r0, [r2] + adds r0, r5, 0 + bl sub_80831A0 + ldr r3, [sp, 0x27C] + str r0, [r3] + adds r0, r5, 0 + ldr r1, [sp, 0x284] + bl sub_8082D34 + adds r0, r5, 0 + ldr r1, [sp, 0x288] + bl sub_8082D50 + adds r0, r5, 0 + ldr r1, [sp, 0x28C] + bl sub_8082D7C + adds r0, r5, 0 + ldr r1, [sp, 0x290] + bl sub_8082DA8 + adds r0, r5, 0 + ldr r1, [sp, 0x294] + bl sub_8082DC4 + adds r0, r5, 0 + ldr r1, [sp, 0x298] + bl sub_8082DE8 + adds r0, r5, 0 + ldr r1, [sp, 0x29C] + bl sub_8082E04 + adds r0, r5, 0 + ldr r1, [sp, 0x220] + bl sub_8082E38 + adds r0, r5, 0 + ldr r1, [sp, 0x224] + bl sub_8082E6C + adds r0, r5, 0 + ldr r1, [sp, 0x228] + bl sub_8082E88 + adds r0, r5, 0 + ldr r1, [sp, 0x22C] + bl sub_8082E94 + adds r0, r5, 0 + ldr r1, [sp, 0x230] + bl sub_8082EB0 + adds r0, r5, 0 + ldr r1, [sp, 0x234] + bl sub_8082ECC + adds r0, r5, 0 + bl sub_80831DC + ldr r1, [sp, 0x238] + strb r0, [r1] + adds r0, r5, 0 + bl sub_80831DC + ldr r2, [sp, 0x23C] + strb r0, [r2] + adds r0, r5, 0 + bl sub_80831DC + ldr r3, [sp, 0x240] + strb r0, [r3] + adds r0, r5, 0 + bl sub_80831DC + ldr r1, [sp, 0x244] + strb r0, [r1] + adds r0, r5, 0 + bl sub_80831DC + ldr r2, [sp, 0x248] + strb r0, [r2] + adds r0, r5, 0 + bl sub_8083188 + ldr r3, [sp, 0x25C] + strb r0, [r3] + adds r0, r5, 0 + bl sub_80831DC + ldr r1, [sp, 0x24C] + strb r0, [r1] + adds r0, r5, 0 + bl sub_80831DC + ldr r2, [sp, 0x250] + strb r0, [r2] + adds r0, r5, 0 + bl sub_80831DC + ldr r3, [sp, 0x254] + strb r0, [r3] + adds r0, r5, 0 + bl sub_8083188 + ldr r1, [sp, 0x258] + strb r0, [r1] + adds r0, r5, 0 + bl sub_80831DC + ldr r2, [sp, 0x260] + strb r0, [r2] + adds r0, r5, 0 + bl sub_8083188 + ldr r3, [sp, 0x264] + strb r0, [r3] + adds r0, r5, 0 + bl sub_8083188 + ldr r1, [sp, 0x268] + strb r0, [r1] + adds r0, r5, 0 + bl sub_8082C34 + ldr r2, [sp, 0x26C] + strb r0, [r2] + adds r0, r5, 0 + bl sub_8082C50 + add r1, sp, 0x100 + strb r0, [r1] + adds r0, r5, 0 + bl sub_8082C6C + add r1, sp, 0x104 + str r0, [r1] + add r1, sp, 0x108 + adds r0, r5, 0 + movs r2, 0x5 + bl sub_8083288 + ldr r1, _08082674 + add r1, sp + adds r0, r5, 0 + movs r2, 0x5 + bl sub_8083288 + adds r0, r5, 0 + bl sub_8083188 + movs r1, 0x89 + lsls r1, 1 + add r1, sp + strb r0, [r1] + adds r0, r5, 0 + bl sub_8083188 + b _08082678 + .align 2, 0 +_0808266C: .4byte 0xfffffd60 +_08082670: .4byte gUnknown_203B450 +_08082674: .4byte 0x0000010d +_08082678: + ldr r1, _08082818 + add r1, sp + strb r0, [r1] + adds r0, r5, 0 + bl sub_8083188 + add r1, sp, 0x114 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + add r1, sp, 0x118 + adds r0, r5, 0 + bl sub_8082F1C + add r1, sp, 0x13C + adds r0, r5, 0 + bl sub_8082F48 + add r1, sp, 0x140 + adds r0, r5, 0 + bl sub_8082F48 + adds r0, r5, 0 + bl sub_80831DC + add r1, sp, 0x144 + strb r0, [r1] + adds r0, r5, 0 + bl sub_80831DC + ldr r1, _0808281C + add r1, sp + strb r0, [r1] + adds r0, r5, 0 + bl sub_80831DC + ldr r1, _08082820 + add r1, sp + strb r0, [r1] + adds r0, r5, 0 + bl sub_80831DC + movs r1, 0xA3 + lsls r1, 1 + add r1, sp + strb r0, [r1] + adds r0, r5, 0 + bl sub_80831DC + add r1, sp, 0x148 + strb r0, [r1] + adds r0, r5, 0 + bl sub_80831DC + ldr r1, _08082824 + add r1, sp + strb r0, [r1] + adds r0, r5, 0 + bl sub_80831DC + movs r1, 0xA5 + lsls r1, 1 + add r1, sp + strb r0, [r1] + adds r0, r5, 0 + bl sub_80831DC + ldr r1, _08082828 + add r1, sp + strb r0, [r1] + adds r0, r5, 0 + bl sub_80831DC + add r1, sp, 0x14C + strb r0, [r1] + adds r0, r5, 0 + bl sub_8083158 + movs r1, 0xA7 + lsls r1, 1 + add r1, sp + strh r0, [r1] + adds r0, r5, 0 + bl sub_8083158 + add r1, sp, 0x150 + strh r0, [r1] + adds r0, r5, 0 + bl sub_80831DC + movs r1, 0xA9 + lsls r1, 1 + add r1, sp + strb r0, [r1] + adds r0, r5, 0 + bl sub_8083188 + ldr r1, _0808282C + add r1, sp + strb r0, [r1] + adds r0, r5, 0 + bl sub_80831DC + add r1, sp, 0x154 + strb r0, [r1] + adds r0, r5, 0 + bl sub_80831DC + ldr r1, _08082830 + add r1, sp + strb r0, [r1] + adds r0, r5, 0 + bl sub_80831DC + movs r1, 0xAB + lsls r1, 1 + add r1, sp + strb r0, [r1] + adds r0, r5, 0 + bl sub_8083188 + add r1, sp, 0x164 + strb r0, [r1] + adds r0, r5, 0 + bl sub_8083188 + ldr r1, _08082834 + add r1, sp + strb r0, [r1] + adds r0, r5, 0 + bl sub_8083188 + movs r1, 0xB3 + lsls r1, 1 + add r1, sp + strb r0, [r1] + adds r0, r5, 0 + bl sub_8083188 + ldr r1, _08082838 + add r1, sp + strb r0, [r1] + adds r0, r5, 0 + bl sub_8083188 + add r1, sp, 0x168 + strb r0, [r1] + adds r0, r5, 0 + bl sub_8083188 + ldr r1, _0808283C + add r1, sp + strb r0, [r1] + add r1, sp, 0x16C + adds r0, r5, 0 + bl sub_80831F8 + adds r0, r5, 0 + bl sub_80831C8 + add r1, sp, 0x174 + str r0, [r1] + adds r0, r5, 0 + bl sub_8083158 + add r1, sp, 0x178 + strh r0, [r1] + adds r0, r5, 0 + bl sub_8083170 + add r1, sp, 0x1F8 + strh r0, [r1] + adds r0, r5, 0 + bl sub_8083170 + movs r1, 0xFD + lsls r1, 1 + add r1, sp + strh r0, [r1] + adds r0, r5, 0 + bl sub_80831A0 + add r1, sp, 0x1FC + str r0, [r1] + adds r0, r5, 0 + bl sub_8082CA0 + ldr r3, [sp, 0x280] + strb r0, [r3] + ldr r0, _08082840 + str r4, [r0] + ldr r0, [sp, 0x214] + cmp r0, 0 + beq _080828BE + ldr r1, [sp, 0x20C] + cmp r1, 0 + beq _08082844 + mov r0, sp + movs r2, 0x2 + ldrsh r0, [r0, r2] + mov r1, sp + movs r3, 0x4 + ldrsh r1, [r1, r3] + ldr r2, [sp, 0x210] + bl sub_80828E0 + b _08082856 + .align 2, 0 +_08082818: .4byte 0x00000113 +_0808281C: .4byte 0x00000145 +_08082820: .4byte 0x00000147 +_08082824: .4byte 0x00000149 +_08082828: .4byte 0x0000014b +_0808282C: .4byte 0x00000153 +_08082830: .4byte 0x00000155 +_08082834: .4byte 0x00000165 +_08082838: .4byte 0x00000167 +_0808283C: .4byte 0x00000169 +_08082840: .4byte gUnknown_203B450 +_08082844: + mov r0, sp + movs r1, 0x2 + ldrsh r0, [r0, r1] + mov r1, sp + movs r2, 0x4 + ldrsh r1, [r1, r2] + ldr r2, [sp, 0x210] + bl sub_8082A08 +_08082856: + adds r7, r0, 0 + cmp r7, 0 + beq _080828BE + ldr r6, [r7, 0x70] + movs r5, 0x82 + lsls r5, 2 + mov r3, sp + adds r4, r3, r5 + movs r1, 0 + ldrsh r0, [r4, r1] + ldr r3, _080828D4 + add r3, sp + movs r2, 0 + ldrsh r1, [r3, r2] + bl sub_8049590 + ldr r1, [r4] + str r1, [r7, 0x8] + ldr r1, [r4] + str r1, [r7, 0x4] + str r7, [r0, 0x10] + adds r0, r7, 0 + adds r0, 0x20 + movs r4, 0 + add r1, sp, 0x218 + ldrb r1, [r1] + strb r1, [r0] + add r2, sp, 0x21C + ldrh r2, [r2] + strh r2, [r7, 0x26] + adds r0, r6, 0 + mov r1, sp + adds r2, r5, 0 + bl memcpy + ldr r0, _080828D8 + str r4, [r0] + ldrb r0, [r6, 0x7] + cmp r0, 0 + beq _080828B0 + ldr r0, _080828DC + ldrh r1, [r7, 0x4] + strh r1, [r0] + ldrh r1, [r7, 0x6] + strh r1, [r0, 0x2] +_080828B0: + adds r0, r7, 0 + bl sub_807191C + adds r0, r7, 0 + movs r1, 0 + bl sub_804535C +_080828BE: + movs r3, 0xA8 + lsls r3, 2 + add sp, r3 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080828D4: .4byte 0x0000020a +_080828D8: .4byte gUnknown_203B450 +_080828DC: .4byte gUnknown_203B410 + thumb_func_end sub_8082280 + + thumb_func_start sub_80828E0 +sub_80828E0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r5, r2, 0 + lsls r0, 16 + asrs r0, 16 + mov r10, r0 + lsls r1, 16 + asrs r1, 16 + mov r8, r1 + movs r4, 0x1 + negs r4, r4 + mov r0, r8 + bl sub_808DACC + lsls r0, 24 + lsrs r6, r0, 24 + movs r3, 0 + movs r0, 0x6 + subs r7, r0, r6 + ldr r0, _08082914 + mov r9, r0 + b _0808291A + .align 2, 0 +_08082914: .4byte gUnknown_202EE70 +_08082918: + adds r3, 0x1 +_0808291A: + cmp r3, r7 + bgt _0808293E + movs r2, 0 + cmp r2, r6 + bge _08082938 + mov r0, r9 + adds r1, r3, r0 + b _08082932 +_0808292A: + adds r1, 0x1 + adds r2, 0x1 + cmp r2, r6 + bge _08082938 +_08082932: + ldrb r0, [r1] + cmp r0, 0 + beq _0808292A +_08082938: + cmp r2, r6 + bne _08082918 + adds r4, r3, 0 +_0808293E: + movs r0, 0x1 + negs r0, r0 + cmp r4, r0 + bne _0808294A + movs r0, 0 + b _080829E6 +_0808294A: + ldr r2, _080829F4 + ldr r0, [r2] + lsls r1, r5, 2 + ldr r3, _080829F8 + adds r0, r3 + adds r0, r1 + ldr r7, [r0] + movs r0, 0x1 + mov r9, r0 + str r0, [r7] + adds r0, r7, 0 + adds r0, 0x24 + strb r5, [r0] + lsls r0, r5, 6 + adds r0, r5 + lsls r0, 3 + ldr r1, _080829FC + adds r0, r1 + ldr r1, [r2] + adds r1, r0 + str r1, [r7, 0x70] + movs r5, 0 + mov r3, r10 + strh r3, [r1, 0x2] + ldr r0, [r7, 0x70] + mov r1, r8 + strh r1, [r0, 0x4] + ldr r0, [r7, 0x70] + strb r5, [r0, 0x6] + mov r0, r8 + bl sub_80687D0 + str r0, [r7, 0x64] + lsls r0, r4, 4 + adds r0, 0x40 + adds r1, r7, 0 + adds r1, 0x68 + strh r0, [r1] + adds r1, 0x2 + movs r0, 0x7 + strb r0, [r1] + adds r0, r7, 0 + adds r0, 0x6C + strb r5, [r0] + adds r1, 0x1 + movs r0, 0xFF + strb r0, [r1] + adds r0, r7, 0 + adds r0, 0x6D + mov r3, r9 + strb r3, [r0] + adds r0, 0x2 + strb r3, [r0] + movs r0, 0 + str r0, [r7, 0x1C] + bl sub_8045ACC + ldr r0, [r7, 0x70] + ldr r1, _08082A00 + adds r0, r1 + strb r4, [r0] + ldr r0, [r7, 0x70] + movs r3, 0xB4 + lsls r3, 1 + adds r0, r3 + strb r6, [r0] + cmp r6, 0 + beq _080829E4 + ldr r3, _08082A04 + movs r2, 0x1 + adds r1, r6, 0 +_080829D8: + adds r0, r4, r3 + strb r2, [r0] + adds r4, 0x1 + subs r1, 0x1 + cmp r1, 0 + bne _080829D8 +_080829E4: + adds r0, r7, 0 +_080829E6: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080829F4: .4byte gUnknown_203B418 +_080829F8: .4byte 0x0001357c +_080829FC: .4byte 0x0000069c +_08082A00: .4byte 0x00000167 +_08082A04: .4byte gUnknown_202EE70 + thumb_func_end sub_80828E0 + + thumb_func_start sub_8082A08 +sub_8082A08: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r5, r2, 0 + lsls r0, 16 + asrs r0, 16 + str r0, [sp] + lsls r1, 16 + asrs r1, 16 + mov r9, r1 + movs r0, 0x1 + negs r0, r0 + mov r8, r0 + mov r0, r9 + bl sub_808DACC + lsls r0, 24 + lsrs r6, r0, 24 + movs r3, 0 + movs r0, 0x10 + subs r4, r0, r6 + ldr r7, _08082A3C + b _08082A42 + .align 2, 0 +_08082A3C: .4byte gUnknown_202EE76 +_08082A40: + adds r3, 0x1 +_08082A42: + cmp r3, r4 + bgt _08082A64 + movs r2, 0 + cmp r2, r6 + bge _08082A5E + adds r1, r3, r7 + b _08082A58 +_08082A50: + adds r1, 0x1 + adds r2, 0x1 + cmp r2, r6 + bge _08082A5E +_08082A58: + ldrb r0, [r1] + cmp r0, 0 + beq _08082A50 +_08082A5E: + cmp r2, r6 + bne _08082A40 + mov r8, r3 +_08082A64: + movs r0, 0x1 + negs r0, r0 + cmp r8, r0 + bne _08082A70 + movs r0, 0 + b _08082B1C +_08082A70: + ldr r2, _08082B2C + ldr r0, [r2] + lsls r1, r5, 2 + ldr r3, _08082B30 + adds r0, r3 + adds r0, r1 + ldr r7, [r0] + movs r4, 0x1 + str r4, [r7] + adds r0, r7, 0 + adds r0, 0x24 + movs r1, 0 + mov r10, r1 + strb r5, [r0] + subs r0, 0x2 + mov r3, r10 + strb r3, [r0] + lsls r0, r5, 6 + adds r0, r5 + lsls r0, 3 + ldr r1, _08082B34 + adds r0, r1 + ldr r1, [r2] + adds r1, r0 + str r1, [r7, 0x70] + movs r5, 0 + mov r2, sp + ldrh r2, [r2] + strh r2, [r1, 0x2] + ldr r0, [r7, 0x70] + mov r3, r9 + strh r3, [r0, 0x4] + ldr r0, [r7, 0x70] + strb r4, [r0, 0x6] + mov r0, r9 + bl sub_80687D0 + str r0, [r7, 0x64] + mov r1, r8 + lsls r0, r1, 4 + adds r0, 0xA0 + adds r1, r7, 0 + adds r1, 0x68 + strh r0, [r1] + adds r1, 0x2 + movs r0, 0x7 + strb r0, [r1] + adds r0, r7, 0 + adds r0, 0x6C + strb r5, [r0] + adds r1, 0x1 + movs r0, 0xFF + strb r0, [r1] + adds r0, r7, 0 + adds r0, 0x6D + strb r4, [r0] + adds r0, 0x2 + strb r4, [r0] + mov r2, r10 + str r2, [r7, 0x1C] + ldr r0, [r7, 0x70] + ldr r3, _08082B38 + adds r0, r3 + mov r4, r8 + strb r4, [r0] + ldr r0, [r7, 0x70] + movs r1, 0xB4 + lsls r1, 1 + adds r0, r1 + strb r6, [r0] + cmp r6, 0 + beq _08082B16 + ldr r3, _08082B3C + movs r2, 0x1 + adds r1, r6, 0 +_08082B06: + mov r4, r8 + adds r0, r4, r3 + strb r2, [r0] + movs r0, 0x1 + add r8, r0 + subs r1, 0x1 + cmp r1, 0 + bne _08082B06 +_08082B16: + bl sub_8045ACC + adds r0, r7, 0 +_08082B1C: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08082B2C: .4byte gUnknown_203B418 +_08082B30: .4byte 0x0001358c +_08082B34: .4byte 0x00000ebc +_08082B38: .4byte 0x00000167 +_08082B3C: .4byte gUnknown_202EE76 + thumb_func_end sub_8082A08 + + thumb_func_start sub_8082B40 +sub_8082B40: + push {r4-r6,lr} + sub sp, 0x4 + movs r6, 0 +_08082B46: + ldr r0, _08082BB8 + ldr r0, [r0] + lsls r1, r6, 2 + ldr r2, _08082BBC + adds r0, r2 + adds r0, r1 + ldr r5, [r0] + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08082BA8 + ldr r4, [r5, 0x70] + movs r1, 0x4 + ldrsh r0, [r4, r1] + bl sub_80687D0 + str r0, [r5, 0x64] + adds r0, r5, 0 + bl sub_806CEBC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r5, 0 + bl sub_806CCB4 + ldr r0, [r5, 0x4] + str r0, [sp] + adds r0, r4, 0 + adds r0, 0x98 + ldr r0, [r0] + movs r2, 0x4 + ldrsh r1, [r4, r2] + mov r2, sp + movs r3, 0x3 + bl sub_800F8D0 + movs r1, 0x4 + ldrsh r0, [r5, r1] + movs r2, 0x6 + ldrsh r1, [r5, r2] + bl sub_8049590 + ldrb r1, [r0, 0x9] + adds r0, r5, 0 + adds r0, 0x25 + strb r1, [r0] +_08082BA8: + adds r6, 0x1 + cmp r6, 0x13 + ble _08082B46 + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08082BB8: .4byte gUnknown_203B418 +_08082BBC: .4byte 0x000135cc + thumb_func_end sub_8082B40 + + thumb_func_start sub_8082BC0 +sub_8082BC0: + push {lr} + sub sp, 0x4 + mov r2, sp + movs r1, 0 + strh r1, [r2] + mov r1, sp + movs r2, 0x2 + bl sub_8082FE0 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + add sp, 0x4 + pop {r1} + bx r1 + thumb_func_end sub_8082BC0 + + thumb_func_start sub_8082BE0 +sub_8082BE0: + push {lr} + sub sp, 0x4 + mov r2, sp + movs r1, 0 + strb r1, [r2] + mov r1, sp + movs r2, 0x1 + bl sub_8082FE0 + mov r0, sp + ldrb r0, [r0] + add sp, 0x4 + pop {r1} + bx r1 + thumb_func_end sub_8082BE0 + + thumb_func_start sub_8082BFC +sub_8082BFC: + push {lr} + sub sp, 0x4 + mov r2, sp + movs r1, 0 + strb r1, [r2] + mov r1, sp + movs r2, 0x1 + bl sub_8082FE0 + mov r0, sp + ldrb r0, [r0] + add sp, 0x4 + pop {r1} + bx r1 + thumb_func_end sub_8082BFC + + thumb_func_start sub_8082C18 +sub_8082C18: + push {lr} + sub sp, 0x4 + mov r2, sp + movs r1, 0 + strb r1, [r2] + mov r1, sp + movs r2, 0x1 + bl sub_8082FE0 + mov r0, sp + ldrb r0, [r0] + add sp, 0x4 + pop {r1} + bx r1 + thumb_func_end sub_8082C18 + + thumb_func_start sub_8082C34 +sub_8082C34: + push {lr} + sub sp, 0x4 + mov r2, sp + movs r1, 0 + strb r1, [r2] + mov r1, sp + movs r2, 0x1 + bl sub_8082FE0 + mov r0, sp + ldrb r0, [r0] + add sp, 0x4 + pop {r1} + bx r1 + thumb_func_end sub_8082C34 + + thumb_func_start sub_8082C50 +sub_8082C50: + push {lr} + sub sp, 0x4 + mov r2, sp + movs r1, 0 + strb r1, [r2] + mov r1, sp + movs r2, 0x1 + bl sub_8082FE0 + mov r0, sp + ldrb r0, [r0] + add sp, 0x4 + pop {r1} + bx r1 + thumb_func_end sub_8082C50 + + thumb_func_start sub_8082C6C +sub_8082C6C: + push {lr} + sub sp, 0x4 + movs r1, 0 + str r1, [sp] + mov r1, sp + movs r2, 0x4 + bl sub_8082FE0 + ldr r0, [sp] + add sp, 0x4 + pop {r1} + bx r1 + thumb_func_end sub_8082C6C + + thumb_func_start sub_8082C84 +sub_8082C84: + push {lr} + sub sp, 0x4 + mov r2, sp + movs r1, 0 + strb r1, [r2] + mov r1, sp + movs r2, 0x1 + bl sub_8082FE0 + mov r0, sp + ldrb r0, [r0] + add sp, 0x4 + pop {r1} + bx r1 + thumb_func_end sub_8082C84 + + thumb_func_start sub_8082CA0 +sub_8082CA0: + push {lr} + sub sp, 0x4 + mov r2, sp + movs r1, 0 + strb r1, [r2] + mov r1, sp + movs r2, 0x1 + bl sub_8082FE0 + mov r0, sp + ldrb r0, [r0] + add sp, 0x4 + pop {r1} + bx r1 + thumb_func_end sub_8082CA0 + + thumb_func_start sub_8082CBC +sub_8082CBC: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r0, 0 + strh r0, [r4] + adds r1, r4, 0x2 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_8082FE0 + movs r0, 0x7 + strb r0, [r4, 0x3] + adds r4, 0x14 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80831F8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8082CBC + + thumb_func_start sub_8082CE4 +sub_8082CE4: + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r2, 0x1 + bl sub_8082FE0 + adds r0, r5, 0 + bl sub_80831DC + movs r6, 0 + strb r0, [r4, 0x1] + adds r0, r5, 0 + bl sub_80831DC + strb r0, [r4, 0x2] + adds r0, r5, 0 + bl sub_80831DC + strb r0, [r4, 0x3] + adds r0, r5, 0 + bl sub_8083158 + strh r0, [r4, 0x4] + str r6, [r4, 0x8] + str r6, [r4, 0xC] + adds r4, 0x10 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80831F8 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8082CE4 + + thumb_func_start sub_8082D28 +sub_8082D28: + push {lr} + movs r2, 0x3 + bl sub_8082FE0 + pop {r0} + bx r0 + thumb_func_end sub_8082D28 + + thumb_func_start sub_8082D34 +sub_8082D34: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + bl sub_8082FE0 + adds r0, r4, 0 + bl sub_8083188 + strb r0, [r5, 0x1] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8082D34 + + thumb_func_start sub_8082D50 +sub_8082D50: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + bl sub_8082FE0 + adds r0, r4, 0 + bl sub_8083188 + strb r0, [r5, 0x1] + adds r0, r4, 0 + bl sub_8083188 + strb r0, [r5, 0x2] + adds r0, r4, 0 + bl sub_8083188 + strb r0, [r5, 0x3] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8082D50 + + thumb_func_start sub_8082D7C +sub_8082D7C: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + bl sub_8082FE0 + adds r0, r4, 0 + bl sub_8083188 + strb r0, [r5, 0x8] + adds r0, r4, 0 + bl sub_8083188 + strb r0, [r5, 0x9] + adds r0, r4, 0 + bl sub_80831A0 + str r0, [r5, 0x4] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8082D7C + + thumb_func_start sub_8082DA8 +sub_8082DA8: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + bl sub_8082FE0 + adds r0, r4, 0 + bl sub_8083188 + strb r0, [r5, 0x1] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8082DA8 + + thumb_func_start sub_8082DC4 +sub_8082DC4: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + bl sub_8082FE0 + adds r0, r4, 0 + bl sub_8083188 + strb r0, [r5, 0x1] + adds r0, r4, 0 + bl sub_8083188 + strb r0, [r5, 0x2] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8082DC4 + + thumb_func_start sub_8082DE8 +sub_8082DE8: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + bl sub_8082FE0 + adds r0, r4, 0 + bl sub_8083188 + strb r0, [r5, 0x1] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8082DE8 + + thumb_func_start sub_8082E04 +sub_8082E04: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + bl sub_8082FE0 + adds r0, r4, 0 + bl sub_80831DC + strb r0, [r5, 0x1] + adds r0, r4, 0 + bl sub_80831DC + strb r0, [r5, 0x2] + adds r0, r4, 0 + bl sub_8083188 + strb r0, [r5, 0x3] + adds r0, r4, 0 + bl sub_8083188 + strb r0, [r5, 0x4] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8082E04 + + thumb_func_start sub_8082E38 +sub_8082E38: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + bl sub_8082FE0 + adds r0, r4, 0 + bl sub_80831A0 + str r0, [r5, 0x4] + adds r0, r4, 0 + bl sub_8083188 + strb r0, [r5, 0x8] + adds r0, r4, 0 + bl sub_8083188 + strb r0, [r5, 0x9] + adds r0, r4, 0 + bl sub_8083188 + strb r0, [r5, 0xA] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8082E38 + + thumb_func_start sub_8082E6C +sub_8082E6C: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + bl sub_8082FE0 + adds r0, r4, 0 + bl sub_8083188 + strb r0, [r5, 0x1] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8082E6C + + thumb_func_start sub_8082E88 +sub_8082E88: + push {lr} + movs r2, 0x1 + bl sub_8082FE0 + pop {r0} + bx r0 + thumb_func_end sub_8082E88 + + thumb_func_start sub_8082E94 +sub_8082E94: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + bl sub_8082FE0 + adds r0, r4, 0 + bl sub_8083188 + strb r0, [r5, 0x1] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8082E94 + + thumb_func_start sub_8082EB0 +sub_8082EB0: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + bl sub_8082FE0 + adds r0, r4, 0 + bl sub_8083188 + strb r0, [r5, 0x1] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8082EB0 + + thumb_func_start sub_8082ECC +sub_8082ECC: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x1 + bl sub_8082FE0 + adds r0, r4, 0 + bl sub_8083188 + strb r0, [r5, 0x1] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8082ECC + + thumb_func_start sub_8082EE8 +sub_8082EE8: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_8083188 + strb r0, [r5] + adds r0, r4, 0 + bl sub_8083188 + strb r0, [r5, 0x1] + adds r1, r5, 0x2 + adds r0, r4, 0 + movs r2, 0x2 + bl sub_8082FE0 + adds r0, r4, 0 + bl sub_8083188 + strb r0, [r5, 0x4] + adds r0, r4, 0 + bl sub_8083188 + strb r0, [r5, 0x5] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8082EE8 + + thumb_func_start sub_8082F1C +sub_8082F1C: + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + adds r4, r7, 0 + movs r5, 0x3 +_08082F26: + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_8082EE8 + adds r4, 0x8 + subs r5, 0x1 + cmp r5, 0 + bge _08082F26 + adds r0, r6, 0 + bl sub_8083188 + adds r1, r7, 0 + adds r1, 0x20 + strb r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8082F1C + + thumb_func_start sub_8082F48 +sub_8082F48: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_8083170 + strh r0, [r5] + adds r0, r4, 0 + bl sub_8083170 + strh r0, [r5, 0x2] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8082F48 + + thumb_func_start sub_8082F64 +sub_8082F64: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_8083188 + strb r0, [r5] + adds r0, r4, 0 + bl sub_8083188 + strb r0, [r5, 0x1] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8082F64 + + thumb_func_start sub_8082F80 +sub_8082F80: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_8083170 + strh r0, [r5] + adds r0, r4, 0 + bl sub_8082BFC + strb r0, [r5, 0x2] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8082F80 + + thumb_func_start sub_8082F9C +sub_8082F9C: + str r1, [r0] + movs r3, 0 + str r3, [r0, 0x8] + adds r1, r2 + str r1, [r0, 0x4] + bx lr + thumb_func_end sub_8082F9C + + thumb_func_start sub_8082FA8 +sub_8082FA8: + push {r4,lr} + adds r3, r0, 0 + adds r4, r1, 0 + cmp r2, 0 + beq _08082FCC +_08082FB2: + ldr r1, [r3] + ldrb r0, [r4] + strb r0, [r1] + ldr r0, [r3] + adds r0, 0x1 + str r0, [r3] + adds r4, 0x1 + subs r2, 0x1 + ldr r0, [r3, 0x8] + adds r0, 0x1 + str r0, [r3, 0x8] + cmp r2, 0 + bne _08082FB2 +_08082FCC: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8082FA8 + + thumb_func_start sub_8082FD4 +sub_8082FD4: + str r1, [r0] + movs r3, 0 + str r3, [r0, 0x8] + adds r1, r2 + str r1, [r0, 0x4] + bx lr + thumb_func_end sub_8082FD4 + + thumb_func_start sub_8082FE0 +sub_8082FE0: + push {r4,lr} + adds r3, r0, 0 + adds r4, r1, 0 + cmp r2, 0 + beq _08083002 +_08082FEA: + ldr r1, [r3] + ldrb r0, [r1] + strb r0, [r4] + adds r1, 0x1 + str r1, [r3] + adds r4, 0x1 + subs r2, 0x1 + ldr r0, [r3, 0x8] + adds r0, 0x1 + str r0, [r3, 0x8] + cmp r2, 0 + bne _08082FEA +_08083002: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8082FE0 + + thumb_func_start nullsub_98 +nullsub_98: + bx lr + thumb_func_end nullsub_98 + + thumb_func_start sub_808300C +sub_808300C: + push {lr} + movs r2, 0x8 + bl sub_8082FA8 + pop {r0} + bx r0 + thumb_func_end sub_808300C + + thumb_func_start sub_8083018 +sub_8083018: + push {lr} + sub sp, 0xC + mov r1, sp + movs r2, 0x8 + bl sub_8082FE0 + mov r1, sp + movs r0, 0 + strb r0, [r1, 0x8] + add sp, 0xC + pop {r0} + bx r0 + thumb_func_end sub_8083018 + + thumb_func_start sub_8083030 +sub_8083030: + push {lr} + sub sp, 0x4 + mov r2, sp + strh r1, [r2] + mov r1, sp + movs r2, 0x2 + bl sub_8082FA8 + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8083030 + + thumb_func_start sub_8083048 +sub_8083048: + push {lr} + sub sp, 0x4 + mov r2, sp + strh r1, [r2] + mov r1, sp + movs r2, 0x2 + bl sub_8082FA8 + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8083048 + + thumb_func_start sub_8083060 +sub_8083060: + push {lr} + sub sp, 0x4 + mov r2, sp + strb r1, [r2] + mov r1, sp + movs r2, 0x1 + bl sub_8082FA8 + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8083060 + + thumb_func_start sub_8083078 +sub_8083078: + push {lr} + sub sp, 0x4 + str r1, [sp] + mov r1, sp + movs r2, 0x4 + bl sub_8082FA8 + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8083078 + + thumb_func_start sub_808308C +sub_808308C: + push {lr} + sub sp, 0x4 + str r1, [sp] + mov r1, sp + movs r2, 0x4 + bl sub_8082FA8 + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_808308C + + thumb_func_start sub_80830A0 +sub_80830A0: + push {lr} + sub sp, 0x4 + str r1, [sp] + mov r1, sp + movs r2, 0x4 + bl sub_8082FA8 + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80830A0 + + thumb_func_start sub_80830B4 +sub_80830B4: + push {lr} + sub sp, 0x4 + adds r3, r0, 0 + lsls r1, 24 + movs r2, 0 + cmp r1, 0 + beq _080830C4 + movs r2, 0xFF +_080830C4: + mov r0, sp + strb r2, [r0] + adds r0, r3, 0 + mov r1, sp + movs r2, 0x1 + bl sub_8082FA8 + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_80830B4 + + thumb_func_start sub_80830D8 +sub_80830D8: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r2, 0x1 + bl sub_8082FA8 + adds r4, 0x2 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_8082FA8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80830D8 + + thumb_func_start sub_80830F8 +sub_80830F8: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r2, 0x1 + bl sub_8082FA8 + adds r1, r4, 0x4 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_8082FA8 + adds r1, r4, 0 + adds r1, 0x8 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_8082FA8 + adds r4, 0xC + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_8082FA8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80830F8 + + thumb_func_start sub_808312C +sub_808312C: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r2, 0x1 + bl sub_8082FA8 + adds r4, 0x2 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_8082FA8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_808312C + + thumb_func_start sub_808314C +sub_808314C: + push {lr} + bl sub_8082FA8 + pop {r0} + bx r0 + thumb_func_end sub_808314C + + thumb_func_start sub_8083158 +sub_8083158: + push {lr} + sub sp, 0x4 + mov r1, sp + movs r2, 0x2 + bl sub_8082FE0 + mov r0, sp + ldrh r0, [r0] + add sp, 0x4 + pop {r1} + bx r1 + thumb_func_end sub_8083158 + + thumb_func_start sub_8083170 +sub_8083170: + push {lr} + sub sp, 0x4 + mov r1, sp + movs r2, 0x2 + bl sub_8082FE0 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + add sp, 0x4 + pop {r1} + bx r1 + thumb_func_end sub_8083170 + + thumb_func_start sub_8083188 +sub_8083188: + push {lr} + sub sp, 0x4 + mov r1, sp + movs r2, 0x1 + bl sub_8082FE0 + mov r0, sp + ldrb r0, [r0] + add sp, 0x4 + pop {r1} + bx r1 + thumb_func_end sub_8083188 + + thumb_func_start sub_80831A0 +sub_80831A0: + push {lr} + sub sp, 0x4 + mov r1, sp + movs r2, 0x4 + bl sub_8082FE0 + ldr r0, [sp] + add sp, 0x4 + pop {r1} + bx r1 + thumb_func_end sub_80831A0 + + thumb_func_start sub_80831B4 +sub_80831B4: + push {lr} + sub sp, 0x4 + mov r1, sp + movs r2, 0x4 + bl sub_8082FE0 + ldr r0, [sp] + add sp, 0x4 + pop {r1} + bx r1 + thumb_func_end sub_80831B4 + + thumb_func_start sub_80831C8 +sub_80831C8: + push {lr} + sub sp, 0x4 + mov r1, sp + movs r2, 0x4 + bl sub_8082FE0 + ldr r0, [sp] + add sp, 0x4 + pop {r1} + bx r1 + thumb_func_end sub_80831C8 + + thumb_func_start sub_80831DC +sub_80831DC: + push {lr} + sub sp, 0x4 + mov r1, sp + movs r2, 0x1 + bl sub_8082FE0 + mov r0, sp + ldrb r1, [r0] + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + add sp, 0x4 + pop {r1} + bx r1 + thumb_func_end sub_80831DC + + thumb_func_start sub_80831F8 +sub_80831F8: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r0, 0 + strh r0, [r4] + strh r0, [r4, 0x2] + adds r0, r5, 0 + movs r2, 0x1 + bl sub_8082FE0 + adds r4, 0x2 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_8082FE0 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80831F8 + + thumb_func_start sub_8083220 +sub_8083220: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r0, 0 + str r0, [r4] + str r0, [r4, 0x4] + str r0, [r4, 0x8] + str r0, [r4, 0xC] + adds r0, r5, 0 + movs r2, 0x1 + bl sub_8082FE0 + adds r1, r4, 0x4 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_8082FE0 + adds r1, r4, 0 + adds r1, 0x8 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_8082FE0 + adds r4, 0xC + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_8082FE0 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8083220 + + thumb_func_start sub_8083260 +sub_8083260: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r0, 0 + strh r0, [r4] + strh r0, [r4, 0x2] + adds r0, r5, 0 + movs r2, 0x1 + bl sub_8082FE0 + adds r4, 0x2 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_8082FE0 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8083260 + + thumb_func_start sub_8083288 +sub_8083288: + push {lr} + bl sub_8082FE0 + pop {r0} + bx r0 + thumb_func_end sub_8083288 + + thumb_func_start sub_8083294 +sub_8083294: + push {r4-r7,lr} + adds r4, r0, 0 + adds r6, r1, 0 + ldr r7, _080832E8 + ldr r0, [r7] + ldr r1, _080832EC + adds r0, r1 + ldrb r5, [r0] + cmp r5, 0 + bne _080832AA + movs r5, 0x2 +_080832AA: + movs r2, 0 + ldrsh r0, [r4, r2] + movs r3, 0x2 + ldrsh r1, [r4, r3] + bl sub_804954C + ldrb r1, [r0, 0x9] + cmp r1, 0xFF + bne _080832F0 + movs r0, 0 + ldrsh r1, [r4, r0] + movs r2, 0 + ldrsh r0, [r6, r2] + subs r1, r0 + cmp r1, 0 + bge _080832CC + negs r1, r1 +_080832CC: + cmp r1, r5 + bgt _0808332E + movs r3, 0x2 + ldrsh r1, [r4, r3] + movs r4, 0x2 + ldrsh r0, [r6, r4] + subs r0, r1, r0 + cmp r0, 0 + bge _080832E0 + negs r0, r0 +_080832E0: + cmp r0, r5 + bgt _0808332E +_080832E4: + movs r0, 0x1 + b _08083330 + .align 2, 0 +_080832E8: .4byte gUnknown_203B418 +_080832EC: .4byte 0x00018209 +_080832F0: + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + ldr r1, _08083338 + adds r0, r1 + ldr r1, [r7] + adds r1, r0 + movs r2, 0x2 + ldrsh r0, [r1, r2] + subs r0, 0x1 + movs r4, 0 + ldrsh r3, [r6, r4] + cmp r0, r3 + bgt _0808332E + movs r2, 0x4 + ldrsh r0, [r1, r2] + subs r0, 0x1 + movs r4, 0x2 + ldrsh r2, [r6, r4] + cmp r0, r2 + bgt _0808332E + movs r4, 0x6 + ldrsh r0, [r1, r4] + adds r0, 0x1 + cmp r0, r3 + ble _0808332E + movs r3, 0x8 + ldrsh r0, [r1, r3] + adds r0, 0x1 + cmp r0, r2 + bgt _080832E4 +_0808332E: + movs r0, 0 +_08083330: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08083338: .4byte 0x000104c4 + thumb_func_end sub_8083294 + + thumb_func_start sub_808333C +sub_808333C: + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r1, 0 + ldrsh r0, [r4, r1] + movs r2, 0x2 + ldrsh r1, [r4, r2] + bl sub_804954C + ldrb r2, [r0, 0x9] + cmp r2, 0xFF + beq _08083394 + ldr r1, _080833C4 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 2 + ldr r3, _080833C8 + adds r0, r3 + ldr r1, [r1] + adds r1, r0 + movs r6, 0x2 + ldrsh r0, [r1, r6] + subs r0, 0x1 + movs r2, 0 + ldrsh r3, [r5, r2] + cmp r0, r3 + bgt _08083394 + movs r6, 0x4 + ldrsh r0, [r1, r6] + subs r0, 0x1 + movs r6, 0x2 + ldrsh r2, [r5, r6] + cmp r0, r2 + bgt _08083394 + movs r6, 0x6 + ldrsh r0, [r1, r6] + adds r0, 0x1 + cmp r0, r3 + ble _08083394 + movs r3, 0x8 + ldrsh r0, [r1, r3] + adds r0, 0x1 + cmp r0, r2 + bgt _080833DE +_08083394: + movs r6, 0 + ldrsh r3, [r4, r6] + movs r0, 0 + ldrsh r2, [r5, r0] + movs r6, 0x2 + ldrsh r1, [r4, r6] + movs r6, 0x2 + ldrsh r0, [r5, r6] + subs r1, r0 + subs r3, r2 + cmp r3, 0 + bge _080833AE + negs r3, r3 +_080833AE: + cmp r1, 0 + bge _080833B4 + negs r1, r1 +_080833B4: + cmp r1, r3 + bge _080833BA + adds r1, r3, 0 +_080833BA: + cmp r1, 0x2 + ble _080833CC +_080833BE: + movs r0, 0 + b _080833E0 + .align 2, 0 +_080833C4: .4byte gUnknown_203B418 +_080833C8: .4byte 0x000104c4 +_080833CC: + cmp r1, 0x2 + bne _080833DE + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8083478 + lsls r0, 24 + cmp r0, 0 + beq _080833BE +_080833DE: + movs r0, 0x1 +_080833E0: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_808333C + + thumb_func_start sub_80833E8 +sub_80833E8: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r1, 0 + ldrsh r0, [r5, r1] + movs r2, 0x2 + ldrsh r1, [r5, r2] + bl sub_804954C + adds r1, r0, 0 + ldr r0, _08083438 + ldr r3, [r0] + ldr r2, _0808343C + adds r0, r3, r2 + ldrb r2, [r0] + cmp r2, 0 + bne _0808340C + movs r2, 0x2 +_0808340C: + ldrb r0, [r1, 0x9] + cmp r0, 0xFF + bne _08083440 + movs r1, 0 + ldrsh r0, [r5, r1] + subs r0, r2 + str r0, [r4] + movs r1, 0 + ldrsh r0, [r5, r1] + adds r0, r2 + adds r0, 0x1 + str r0, [r4, 0x8] + movs r1, 0x2 + ldrsh r0, [r5, r1] + subs r0, r2 + str r0, [r4, 0x4] + movs r1, 0x2 + ldrsh r0, [r5, r1] + adds r0, r2 + adds r0, 0x1 + b _0808346A + .align 2, 0 +_08083438: .4byte gUnknown_203B418 +_0808343C: .4byte 0x00018209 +_08083440: + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r2, _08083474 + adds r1, r2 + adds r1, r3, r1 + movs r2, 0x2 + ldrsh r0, [r1, r2] + subs r0, 0x1 + str r0, [r4] + movs r2, 0x6 + ldrsh r0, [r1, r2] + adds r0, 0x2 + str r0, [r4, 0x8] + movs r2, 0x4 + ldrsh r0, [r1, r2] + subs r0, 0x1 + str r0, [r4, 0x4] + movs r2, 0x8 + ldrsh r0, [r1, r2] + adds r0, 0x2 +_0808346A: + str r0, [r4, 0xC] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08083474: .4byte 0x000104c4 + thumb_func_end sub_80833E8 + + thumb_func_start sub_8083478 +sub_8083478: + push {r4-r7,lr} + sub sp, 0x4 + adds r3, r0, 0 + adds r6, r1, 0 + movs r0, 0 + ldrsh r1, [r3, r0] + movs r2, 0 + ldrsh r0, [r6, r2] + subs r1, r0 + cmp r1, 0 + bge _08083490 + negs r1, r1 +_08083490: + cmp r1, 0x1 + bgt _080834A8 + movs r5, 0x2 + ldrsh r1, [r3, r5] + movs r2, 0x2 + ldrsh r0, [r6, r2] + subs r1, r0 + cmp r1, 0 + bge _080834A4 + negs r1, r1 +_080834A4: + cmp r1, 0x1 + ble _0808355A +_080834A8: + movs r5, 0 + ldrsh r4, [r3, r5] + movs r1, 0 + ldrsh r0, [r6, r1] + subs r2, r4, r0 + cmp r2, 0 + bge _080834B8 + negs r2, r2 +_080834B8: + movs r5, 0x2 + ldrsh r1, [r3, r5] + movs r5, 0x2 + ldrsh r0, [r6, r5] + subs r0, r1, r0 + cmp r0, 0 + bge _080834C8 + negs r0, r0 +_080834C8: + cmp r0, r2 + bge _080834CE + adds r0, r2, 0 +_080834CE: + cmp r0, 0x2 + bne _0808355E + adds r5, r4, 0 + adds r4, r1, 0 + movs r7, 0 +_080834D8: + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r5, r0 + bge _080834E2 + adds r5, 0x1 +_080834E2: + cmp r5, r0 + ble _080834E8 + subs r5, 0x1 +_080834E8: + movs r2, 0x2 + ldrsh r0, [r6, r2] + cmp r4, r0 + bge _080834F2 + adds r4, 0x1 +_080834F2: + cmp r4, r0 + ble _080834F8 + subs r4, 0x1 +_080834F8: + adds r0, r5, 0 + adds r1, r4, 0 + str r3, [sp] + bl sub_804954C + ldrh r1, [r0] + movs r0, 0x3 + ands r0, r1 + ldr r3, [sp] + cmp r0, 0 + beq _0808355E + adds r7, 0x1 + cmp r7, 0x1 + ble _080834D8 + movs r0, 0 + ldrsh r5, [r6, r0] + movs r1, 0x2 + ldrsh r4, [r6, r1] + movs r7, 0 +_0808351E: + movs r2, 0 + ldrsh r0, [r3, r2] + cmp r5, r0 + bge _08083528 + adds r5, 0x1 +_08083528: + cmp r5, r0 + ble _0808352E + subs r5, 0x1 +_0808352E: + movs r1, 0x2 + ldrsh r0, [r3, r1] + cmp r4, r0 + bge _08083538 + adds r4, 0x1 +_08083538: + cmp r4, r0 + ble _0808353E + subs r4, 0x1 +_0808353E: + adds r0, r5, 0 + adds r1, r4, 0 + str r3, [sp] + bl sub_804954C + ldrh r1, [r0] + movs r0, 0x3 + ands r0, r1 + ldr r3, [sp] + cmp r0, 0 + beq _0808355E + adds r7, 0x1 + cmp r7, 0x1 + ble _0808351E +_0808355A: + movs r0, 0x1 + b _08083560 +_0808355E: + movs r0, 0 +_08083560: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8083478 + + thumb_func_start sub_8083568 +sub_8083568: + push {r4,r5,lr} + lsls r2, 24 + lsrs r5, r2, 24 + ldr r2, _080835E0 + ldr r2, [r2] + ldr r4, _080835E4 + adds r3, r2, r4 + movs r4, 0 + ldrsh r3, [r3, r4] + subs r3, r0, r3 + ldr r0, _080835E8 + adds r2, r0 + movs r4, 0 + ldrsh r0, [r2, r4] + subs r4, r1, r0 + movs r0, 0x10 + negs r0, r0 + cmp r3, r0 + blt _080835F8 + cmp r4, r0 + blt _080835F8 + cmp r3, 0xFF + bgt _080835F8 + cmp r4, 0xAF + bgt _080835F8 + ldr r1, _080835EC + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + adds r0, r1 + movs r1, 0x8 + ldrsh r2, [r0, r1] + adds r2, r3, r2 + ldr r1, _080835F0 + ands r2, r1 + ldrh r3, [r0, 0x2] + movs r1, 0xFE + lsls r1, 8 + ands r1, r3 + orrs r1, r2 + strh r1, [r0, 0x2] + movs r1, 0xA + ldrsh r2, [r0, r1] + adds r2, r4, r2 + ldr r1, _080835F4 + ands r2, r1 + lsls r2, 4 + ldrh r3, [r0, 0x6] + movs r1, 0xF + ands r1, r3 + orrs r1, r2 + strh r1, [r0, 0x6] + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl AddSprite + movs r0, 0x1 + b _080835FA + .align 2, 0 +_080835E0: .4byte gUnknown_203B418 +_080835E4: .4byte 0x000181f0 +_080835E8: .4byte 0x000181f2 +_080835EC: .4byte gUnknown_202ED28 +_080835F0: .4byte 0x000001ff +_080835F4: .4byte 0x00000fff +_080835F8: + movs r0, 0 +_080835FA: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8083568 + + thumb_func_start sub_8083600 +sub_8083600: + push {r4,r5,lr} + ldr r0, _08083638 + ldr r0, [r0] + cmp r0, 0 + bne _0808364A + movs r5, 0 +_0808360C: + ldr r0, _0808363C + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _08083640 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0808362E + ldr r0, [r4, 0x70] + ldrb r0, [r0, 0x7] + cmp r0, 0 + bne _08083644 +_0808362E: + adds r5, 0x1 + cmp r5, 0x3 + ble _0808360C + movs r0, 0 + b _0808364A + .align 2, 0 +_08083638: .4byte gUnknown_203B450 +_0808363C: .4byte gUnknown_203B418 +_08083640: .4byte 0x0001357c +_08083644: + ldr r0, _08083650 + str r4, [r0] + adds r0, r4, 0 +_0808364A: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08083650: .4byte gUnknown_203B450 + thumb_func_end sub_8083600 + + thumb_func_start sub_8083654 +sub_8083654: + push {lr} + bl sub_8083600 + ldr r0, [r0, 0x70] + pop {r1} + bx r1 + thumb_func_end sub_8083654 + + thumb_func_start sub_8083660 +sub_8083660: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, _080836D4 + add sp, r4 + movs r1, 0xE0 + lsls r1, 5 + add r1, sp + str r0, [r1] + bl sub_8083600 + ldr r2, _080836D8 + add r2, sp + str r0, [r2] + movs r7, 0 + movs r0, 0 + ldr r1, _080836DC + add r1, sp + str r0, [r1] +_0808368A: + movs r0, 0x38 + bl sub_8084100 + adds r4, r0, 0 + movs r0, 0x20 + bl sub_8084100 + ldr r2, _080836E0 + add r2, sp + str r0, [r2] + ldr r0, _080836D8 + add r0, sp + ldr r0, [r0] + ldr r3, [r0, 0x4] + adds r5, r4, 0 + movs r1, 0 + ldr r4, [r2] + ldr r0, _080836E4 + cmp r7, r0 + ble _080836B4 + b _080837E6 +_080836B4: + movs r2, 0x3 + mov r10, r2 + lsls r0, r7, 2 + mov r2, sp + adds r6, r0, r2 +_080836BE: + movs r0, 0 + mov r8, r0 + adds r2, r5, 0x1 + ldr r0, _080836E8 + add r0, sp + str r2, [r0] + adds r1, 0x1 + ldr r2, _080836EC + add r2, sp + str r1, [r2] + b _0808379C + .align 2, 0 +_080836D4: .4byte 0xffffe3e4 +_080836D8: .4byte 0x00001c04 +_080836DC: .4byte 0x00001c0c +_080836E0: .4byte 0x00001c08 +_080836E4: .4byte 0x000006ff +_080836E8: .4byte 0x00001c14 +_080836EC: .4byte 0x00001c10 +_080836F0: + ldr r0, _08083738 + add r0, sp + ldr r0, [r0] + cmp r0, 0 + bne _0808373C + ldrh r1, [r2] + mov r0, r10 + ands r0, r1 + cmp r0, 0x1 + bne _08083782 + ldrb r0, [r2, 0x9] + cmp r0, 0xFF + beq _08083782 + ldr r0, [r2, 0x14] + cmp r0, 0 + bne _08083782 + ldr r0, [r2, 0x10] + cmp r0, 0 + bne _08083782 + lsls r0, r3, 16 + asrs r0, 16 + subs r0, r5 + cmp r0, 0 + bge _08083722 + negs r0, r0 +_08083722: + cmp r0, 0x5 + bgt _08083788 + asrs r0, r3, 16 + subs r0, r4 + cmp r0, 0 + bge _08083730 + negs r0, r0 +_08083730: + cmp r0, 0x5 + ble _08083782 + b _08083788 + .align 2, 0 +_08083738: .4byte 0x00001c0c +_0808373C: + ldr r1, _08083764 + add r1, sp + ldr r1, [r1] + cmp r1, 0x1 + bne _08083768 + ldrh r1, [r2] + mov r0, r10 + ands r0, r1 + cmp r0, 0x1 + bne _08083782 + ldrb r0, [r2, 0x9] + cmp r0, 0xFF + beq _08083782 + ldr r0, [r2, 0x14] + cmp r0, 0 + bne _08083782 + ldr r0, [r2, 0x10] + cmp r0, 0 + bne _08083782 + b _08083788 + .align 2, 0 +_08083764: .4byte 0x00001c0c +_08083768: + ldrh r1, [r2] + mov r0, r10 + ands r0, r1 + cmp r0, 0x1 + bne _08083782 + ldr r0, [r2, 0x14] + cmp r0, 0 + bne _08083782 + ldr r0, [r2, 0x10] + cmp r0, 0 + bne _08083782 + movs r2, 0x1 + mov r9, r2 +_08083782: + mov r0, r9 + cmp r0, 0 + beq _08083790 +_08083788: + strb r5, [r6] + strb r4, [r6, 0x1] + adds r6, 0x4 + adds r7, 0x1 +_08083790: + adds r4, 0x1 + cmp r4, 0x1F + ble _08083798 + movs r4, 0 +_08083798: + movs r1, 0x1 + add r8, r1 +_0808379C: + mov r2, r8 + cmp r2, 0x1F + bgt _080837C2 + movs r0, 0 + mov r9, r0 + adds r0, r5, 0 + adds r1, r4, 0 + ldr r2, _0808380C + add r2, sp + str r3, [r2] + bl sub_804954C + adds r2, r0, 0 + ldr r0, _08083810 + ldr r1, _0808380C + add r1, sp + ldr r3, [r1] + cmp r7, r0 + ble _080836F0 +_080837C2: + ldr r2, _08083814 + add r2, sp + ldr r5, [r2] + cmp r5, 0x37 + ble _080837CE + movs r5, 0 +_080837CE: + ldr r0, _08083818 + add r0, sp + ldr r1, [r0] + cmp r1, 0x37 + bgt _080837E6 + ldr r2, _0808381C + add r2, sp + ldr r4, [r2] + ldr r0, _08083810 + cmp r7, r0 + bgt _080837E6 + b _080836BE +_080837E6: + cmp r7, 0 + beq _08083820 + adds r0, r7, 0 + bl sub_8084100 + lsls r0, 2 + mov r2, sp + adds r1, r2, r0 + ldrb r0, [r1] + movs r2, 0xE0 + lsls r2, 5 + add r2, sp + ldr r2, [r2] + strh r0, [r2] + ldrb r0, [r1, 0x1] + strh r0, [r2, 0x2] + movs r0, 0x1 + b _08083832 + .align 2, 0 +_0808380C: .4byte 0x00001c18 +_08083810: .4byte 0x000006ff +_08083814: .4byte 0x00001c14 +_08083818: .4byte 0x00001c10 +_0808381C: .4byte 0x00001c08 +_08083820: + ldr r0, _08083844 + add r0, sp + ldr r2, [r0] + adds r2, 0x1 + str r2, [r0] + cmp r2, 0x2 + bgt _08083830 + b _0808368A +_08083830: + movs r0, 0 +_08083832: + ldr r3, _08083848 + add sp, r3 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08083844: .4byte 0x00001c0c +_08083848: .4byte 0x00001c1c + thumb_func_end sub_8083660 + + thumb_func_start sub_808384C +sub_808384C: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x4 + adds r3, r0, 0 + mov r9, r1 + movs r0, 0 + mov r8, r0 + ldr r0, _080838BC + movs r2, 0 + ldrsh r1, [r0, r2] + cmp r1, 0x63 + beq _080838D8 + movs r6, 0 +_0808386A: + adds r2, r6, r0 + movs r4, 0 + ldrsh r1, [r2, r4] + mov r5, r9 + movs r7, 0 + ldrsh r0, [r5, r7] + adds r5, r1, r0 + movs r0, 0x2 + ldrsh r1, [r2, r0] + mov r2, r9 + movs r4, 0x2 + ldrsh r0, [r2, r4] + adds r4, r1, r0 + adds r0, r5, 0 + adds r1, r4, 0 + str r3, [sp] + bl sub_804954C + adds r1, r0, 0 + ldrh r2, [r1] + movs r7, 0x80 + lsls r7, 4 + adds r0, r7, 0 + ands r0, r2 + ldr r3, [sp] + cmp r0, 0 + bne _080838C0 + movs r0, 0x3 + ands r0, r2 + cmp r0, 0x1 + bne _080838C0 + ldr r0, [r1, 0x14] + cmp r0, 0 + bne _080838C0 + ldr r0, [r1, 0x10] + cmp r0, 0 + bne _080838C0 + strh r5, [r3] + strh r4, [r3, 0x2] + movs r0, 0x1 + b _080838DA + .align 2, 0 +_080838BC: .4byte gUnknown_80F4468 +_080838C0: + adds r6, 0x4 + movs r0, 0x1 + add r8, r0 + mov r2, r8 + cmp r2, 0x18 + bgt _080838D8 + ldr r0, _080838E8 + adds r1, r6, r0 + movs r4, 0 + ldrsh r1, [r1, r4] + cmp r1, 0x63 + bne _0808386A +_080838D8: + movs r0, 0 +_080838DA: + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080838E8: .4byte gUnknown_80F4468 + thumb_func_end sub_808384C + + thumb_func_start sub_80838EC +sub_80838EC: + push {lr} + adds r2, r0, 0 + ldrb r0, [r2] + adds r1, r0, 0 + cmp r1, 0x7F + beq _08083900 + cmp r1, 0 + beq _08083900 + subs r0, 0x1 + strb r0, [r2] +_08083900: + pop {r0} + bx r0 + thumb_func_end sub_80838EC + + thumb_func_start sub_8083904 +sub_8083904: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + str r0, [sp] + mov r10, r1 + ldr r4, [r1, 0x70] + str r4, [sp, 0x4] + adds r5, r4, 0 + adds r5, 0x46 + ldrb r6, [r5] + mov r0, r10 + movs r1, 0x1 + bl sub_8070B6C + lsls r0, 24 + cmp r0, 0 + beq _08083954 + ldr r0, _08083950 + lsls r2, r6, 2 + adds r2, r0 + movs r0, 0 + ldrsh r1, [r2, r0] + lsls r0, r1, 1 + adds r0, r1 + mov r1, r10 + ldrh r1, [r1, 0x4] + adds r0, r1 + ldr r3, [sp] + strh r0, [r3] + movs r4, 0x2 + ldrsh r1, [r2, r4] + lsls r0, r1, 1 + adds r0, r1 + b _08083A6E + .align 2, 0 +_08083950: .4byte gUnknown_80F4448 +_08083954: + ldr r1, [r4, 0x58] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08083960 + b _08083A8C +_08083960: + ldrb r0, [r5] + ldr r1, _080839A0 + lsls r0, 3 + adds r0, r1 + ldr r7, [r0] + movs r3, 0x4 + ldrsh r2, [r0, r3] + str r2, [sp, 0x8] + movs r2, 0x6 + ldrsh r1, [r0, r2] + str r1, [sp, 0xC] + mov r3, r10 + movs r0, 0x4 + ldrsh r3, [r3, r0] + str r3, [sp, 0x10] + mov r1, r10 + movs r2, 0x6 + ldrsh r1, [r1, r2] + str r1, [sp, 0x14] + ldr r0, _080839A4 + ldr r1, [r0] + ldr r3, _080839A8 + adds r0, r1, r3 + ldrb r0, [r0] + cmp r0, 0 + beq _080839B0 + ldr r4, _080839AC + adds r4, r1, r4 + str r4, [sp, 0x18] + movs r0, 0x14 + b _080839D0 + .align 2, 0 +_080839A0: .4byte gUnknown_80F4CC4 +_080839A4: .4byte gUnknown_203B418 +_080839A8: .4byte 0x000037fc +_080839AC: .4byte 0x000135cc +_080839B0: + ldrb r0, [r4, 0x6] + cmp r0, 0 + bne _080839C8 + ldr r2, _080839C4 + adds r2, r1, r2 + str r2, [sp, 0x18] + movs r3, 0x10 + str r3, [sp, 0x1C] + b _080839D2 + .align 2, 0 +_080839C4: .4byte 0x0001358c +_080839C8: + ldr r4, _08083A78 + adds r4, r1, r4 + str r4, [sp, 0x18] + movs r0, 0x4 +_080839D0: + str r0, [sp, 0x1C] +_080839D2: + movs r1, 0 + ldrsh r0, [r7, r1] + cmp r0, 0x63 + beq _08083A46 +_080839DA: + movs r2, 0 + ldrsh r0, [r7, r2] + ldr r3, [sp, 0x8] + muls r0, r3 + ldr r4, [sp, 0x10] + adds r4, r0 + mov r9, r4 + movs r1, 0x2 + ldrsh r0, [r7, r1] + ldr r2, [sp, 0xC] + muls r0, r2 + ldr r3, [sp, 0x14] + adds r3, r0 + mov r8, r3 + movs r6, 0 + ldr r4, [sp, 0x1C] + cmp r6, r4 + bge _08083A3C + ldr r5, [sp, 0x18] +_08083A00: + ldr r4, [r5] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08083A32 + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, r9 + bne _08083A32 + movs r2, 0x6 + ldrsh r0, [r4, r2] + cmp r0, r8 + bne _08083A32 + mov r0, r10 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl sub_8071598 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08083A80 +_08083A32: + adds r5, 0x4 + adds r6, 0x1 + ldr r3, [sp, 0x1C] + cmp r6, r3 + blt _08083A00 +_08083A3C: + adds r7, 0x4 + movs r4, 0 + ldrsh r0, [r7, r4] + cmp r0, 0x63 + bne _080839DA +_08083A46: + ldr r2, _08083A7C + ldr r1, [sp, 0x4] + adds r1, 0x46 + ldrb r0, [r1] + lsls r0, 2 + adds r0, r2 + movs r3, 0 + ldrsh r0, [r0, r3] + lsls r0, 1 + mov r4, r10 + ldrh r4, [r4, 0x4] + adds r0, r4 + ldr r3, [sp] + strh r0, [r3] + ldrb r0, [r1] + lsls r0, 2 + adds r0, r2 + movs r4, 0x2 + ldrsh r0, [r0, r4] + lsls r0, 1 +_08083A6E: + mov r1, r10 + ldrh r1, [r1, 0x6] + adds r0, r1 + strh r0, [r3, 0x2] + b _08083A9E + .align 2, 0 +_08083A78: .4byte 0x0001357c +_08083A7C: .4byte gUnknown_80F4448 +_08083A80: + mov r3, r9 + ldr r2, [sp] + strh r3, [r2] + mov r4, r8 + strh r4, [r2, 0x2] + b _08083A9E +_08083A8C: + ldr r0, [sp, 0x4] + adds r0, 0x58 + ldrh r0, [r0] + ldr r1, [sp] + strh r0, [r1] + ldr r0, [sp, 0x4] + adds r0, 0x5A + ldrh r0, [r0] + strh r0, [r1, 0x2] +_08083A9E: + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8083904 + + thumb_func_start sub_8083AB0 +sub_8083AB0: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + adds r5, r1, 0 + adds r7, r2, 0 + lsls r0, 16 + asrs r0, 16 + mov r8, r0 + ldr r0, _08083AFC + ldr r0, [r0] + ldr r1, _08083B00 + adds r4, r0, r1 + movs r6, 0 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08083AE4 + adds r0, r5, 0 + bl sub_80450F8 + cmp r0, 0x1 + bne _08083AE4 + ldr r6, [r5, 0x70] +_08083AE4: + ldr r5, [r7, 0x70] + cmp r6, 0 + beq _08083B04 + mov r0, sp + adds r1, r6, 0 + bl sub_80709C8 + adds r0, r4, 0 + mov r1, sp + bl sub_80922F4 + b _08083B0E + .align 2, 0 +_08083AFC: .4byte gUnknown_203B418 +_08083B00: .4byte 0x0001ce98 +_08083B04: + ldr r0, _08083C04 + ldr r1, [r0] + adds r0, r4, 0 + bl sub_80922F4 +_08083B0E: + mov r0, sp + adds r1, r5, 0 + bl sub_80709C8 + adds r0, r4, 0 + adds r0, 0xA + mov r1, sp + bl sub_80922F4 + movs r2, 0 + mov r3, r8 + strh r3, [r4, 0x14] + ldr r0, [r5, 0x60] + str r0, [r4, 0x1C] + ldr r0, [r5, 0x18] + str r0, [r4, 0x20] + ldrb r0, [r5, 0x9] + adds r1, r4, 0 + adds r1, 0x2A + strb r0, [r1] + ldrh r0, [r5, 0x10] + strh r0, [r4, 0x24] + ldrb r0, [r5, 0x14] + subs r1, 0x4 + strb r0, [r1] + ldrb r0, [r5, 0x15] + adds r1, 0x1 + strb r0, [r1] + ldrb r1, [r5, 0x16] + adds r0, r4, 0 + adds r0, 0x28 + strb r1, [r0] + ldrb r0, [r5, 0x17] + adds r1, r4, 0 + adds r1, 0x29 + strb r0, [r1] + ldr r0, _08083C08 + ldr r0, [r0] + ldr r1, _08083C0C + adds r0, r1 + ldr r0, [r0] + str r0, [r4, 0x18] + adds r3, r4, 0 + adds r3, 0x2B + strb r2, [r3] + adds r6, r4, 0 + adds r6, 0x2C + strb r2, [r6] + movs r0, 0x2D + adds r0, r4 + mov r12, r0 + strb r2, [r0] + adds r4, 0x2E + strb r2, [r4] + adds r0, r5, 0 + adds r0, 0x60 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08083BF8 + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _08083BF8 + adds r1, r5, 0 + adds r1, 0x62 + ldrb r0, [r1] + cmp r0, 0x13 + bne _08083BA4 + ldr r0, _08083C10 + ldrb r0, [r0] + ldrb r2, [r3] + adds r0, r2 + strb r0, [r3] +_08083BA4: + ldrb r0, [r1] + cmp r0, 0x2B + bne _08083BB4 + ldr r0, _08083C14 + ldrb r0, [r0] + ldrb r2, [r3] + adds r0, r2 + strb r0, [r3] +_08083BB4: + ldrb r0, [r1] + cmp r0, 0x21 + bne _08083BC4 + ldr r0, _08083C18 + ldrb r0, [r0] + ldrb r3, [r6] + adds r0, r3 + strb r0, [r6] +_08083BC4: + ldrb r0, [r1] + cmp r0, 0x2B + bne _08083BD4 + ldr r0, _08083C14 + ldrb r0, [r0] + ldrb r2, [r6] + adds r0, r2 + strb r0, [r6] +_08083BD4: + ldrb r0, [r1] + cmp r0, 0x1E + bne _08083BE8 + ldr r0, _08083C1C + ldrb r0, [r0] + mov r3, r12 + ldrb r3, [r3] + adds r0, r3 + mov r2, r12 + strb r0, [r2] +_08083BE8: + ldrb r0, [r1] + cmp r0, 0x22 + bne _08083BF8 + ldr r0, _08083C20 + ldrb r0, [r0] + ldrb r3, [r4] + adds r0, r3 + strb r0, [r4] +_08083BF8: + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08083C04: .4byte gUnknown_80FE6F4 +_08083C08: .4byte gUnknown_203B418 +_08083C0C: .4byte 0x00000644 +_08083C10: .4byte gUnknown_810AC60 +_08083C14: .4byte gUnknown_810AC68 +_08083C18: .4byte gUnknown_810AC62 +_08083C1C: .4byte gUnknown_810AC64 +_08083C20: .4byte gUnknown_810AC66 + thumb_func_end sub_8083AB0 + + thumb_func_start sub_8083C24 +sub_8083C24: + push {lr} + ldr r0, _08083C3C + ldr r0, [r0] + ldr r1, _08083C40 + adds r0, r1 + movs r2, 0x14 + ldrsh r1, [r0, r2] + ldr r0, _08083C44 + cmp r1, r0 + ble _08083C48 + movs r0, 0 + b _08083C4A + .align 2, 0 +_08083C3C: .4byte gUnknown_203B418 +_08083C40: .4byte 0x0001ce98 +_08083C44: .4byte 0x00000225 +_08083C48: + movs r0, 0x1 +_08083C4A: + pop {r1} + bx r1 + thumb_func_end sub_8083C24 + + thumb_func_start sub_8083C50 +sub_8083C50: + push {lr} + ldr r0, _08083C74 + ldr r0, [r0] + ldr r1, _08083C78 + adds r0, r1 + movs r2, 0x14 + ldrsh r1, [r0, r2] + ldr r0, _08083C7C + cmp r1, r0 + beq _08083C70 + adds r0, 0x3 + cmp r1, r0 + beq _08083C70 + subs r0, 0x2 + cmp r1, r0 + bne _08083C80 +_08083C70: + movs r0, 0x1 + b _08083C82 + .align 2, 0 +_08083C74: .4byte gUnknown_203B418 +_08083C78: .4byte 0x0001ce98 +_08083C7C: .4byte 0x00000227 +_08083C80: + movs r0, 0 +_08083C82: + pop {r1} + bx r1 + thumb_func_end sub_8083C50 + + thumb_func_start sub_8083C88 +sub_8083C88: + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + ldr r4, _08083CC4 + ldr r0, [r4] + ldr r1, _08083CC8 + adds r5, r0, r1 + ldr r1, _08083CCC + adds r0, r1 + ldrb r0, [r0] + bl sub_80900F4 + lsls r0, 24 + cmp r0, 0 + bne _08083CB6 + ldr r0, [r4] + ldr r1, _08083CD0 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _08083CC0 + cmp r6, 0 + bne _08083CC0 +_08083CB6: + movs r0, 0x14 + ldrsh r1, [r5, r0] + ldr r0, _08083CD4 + cmp r1, r0 + beq _08083CD8 +_08083CC0: + movs r0, 0x1 + b _08083CDA + .align 2, 0 +_08083CC4: .4byte gUnknown_203B418 +_08083CC8: .4byte 0x0001ce98 +_08083CCC: .4byte 0x00000644 +_08083CD0: .4byte 0x0000065c +_08083CD4: .4byte 0x00000227 +_08083CD8: + movs r0, 0 +_08083CDA: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8083C88 + + thumb_func_start sub_8083CE0 +sub_8083CE0: + push {lr} + lsls r0, 24 + cmp r0, 0 + beq _08083CF2 + ldr r0, _08083D00 + movs r1, 0x1A + ldrsh r0, [r0, r1] + cmp r0, 0x1 + ble _08083CFC +_08083CF2: + ldr r0, _08083D04 + movs r1, 0x80 + lsls r1, 1 + bl sub_800C074 +_08083CFC: + pop {r0} + bx r0 + .align 2, 0 +_08083D00: .4byte gUnknown_202EE10 +_08083D04: .4byte 0x0000012d + thumb_func_end sub_8083CE0 + + thumb_func_start sub_8083D08 +sub_8083D08: + push {lr} + movs r0, 0x97 + lsls r0, 1 + movs r1, 0x80 + lsls r1, 1 + bl sub_800C074 + pop {r0} + bx r0 + thumb_func_end sub_8083D08 + + thumb_func_start sub_8083D1C +sub_8083D1C: + push {lr} + ldr r0, _08083D2C + movs r1, 0x80 + lsls r1, 1 + bl sub_800C074 + pop {r0} + bx r0 + .align 2, 0 +_08083D2C: .4byte 0x00000133 + thumb_func_end sub_8083D1C + + thumb_func_start sub_8083D30 +sub_8083D30: + push {lr} + ldr r0, _08083D40 + movs r1, 0x80 + lsls r1, 1 + bl sub_800C074 + pop {r0} + bx r0 + .align 2, 0 +_08083D40: .4byte 0x0000012f + thumb_func_end sub_8083D30 + + thumb_func_start sub_8083D44 +sub_8083D44: + push {lr} + movs r0, 0x98 + lsls r0, 1 + movs r1, 0x80 + lsls r1, 1 + bl sub_800C074 + pop {r0} + bx r0 + thumb_func_end sub_8083D44 + + thumb_func_start sub_8083D58 +sub_8083D58: + push {lr} + movs r1, 0x80 + lsls r1, 1 + movs r0, 0xC8 + bl sub_800C074 + pop {r0} + bx r0 + thumb_func_end sub_8083D58 + + thumb_func_start sub_8083D68 +sub_8083D68: + push {lr} + movs r1, 0x80 + lsls r1, 1 + movs r0, 0xCF + bl sub_800C074 + pop {r0} + bx r0 + thumb_func_end sub_8083D68 + + thumb_func_start sub_8083D78 +sub_8083D78: + push {lr} + movs r1, 0x80 + lsls r1, 1 + movs r0, 0xD3 + bl sub_800C074 + pop {r0} + bx r0 + thumb_func_end sub_8083D78 + + thumb_func_start sub_8083D88 +sub_8083D88: + push {lr} + movs r1, 0x80 + lsls r1, 1 + movs r0, 0xCC + bl sub_800C074 + pop {r0} + bx r0 + thumb_func_end sub_8083D88 + + thumb_func_start sub_8083D98 +sub_8083D98: + push {lr} + movs r0, 0x33 + bl sub_8083E88 + ldr r2, _08083DCC + ldr r0, [r2] + ldr r1, _08083DD0 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + ldr r3, _08083DD4 + adds r0, r3 + strb r1, [r0] + ldr r0, [r2] + adds r3, 0x27 + adds r0, r3 + strb r1, [r0] + ldr r0, [r2] + ldr r1, _08083DD8 + adds r0, r1 + ldr r1, _08083DDC + strh r1, [r0] + pop {r0} + bx r0 + .align 2, 0 +_08083DCC: .4byte gUnknown_203B418 +_08083DD0: .4byte 0x0000066f +_08083DD4: .4byte 0x00000672 +_08083DD8: .4byte 0x0000066a +_08083DDC: .4byte 0x000003e7 + thumb_func_end sub_8083D98 + + thumb_func_start sub_8083DE0 +sub_8083DE0: + push {lr} + movs r0, 0x34 + bl sub_8083E88 + ldr r2, _08083E14 + ldr r0, [r2] + ldr r1, _08083E18 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + ldr r3, _08083E1C + adds r0, r3 + strb r1, [r0] + ldr r0, [r2] + adds r3, 0x27 + adds r0, r3 + strb r1, [r0] + ldr r0, [r2] + ldr r1, _08083E20 + adds r0, r1 + ldr r1, _08083E24 + strh r1, [r0] + pop {r0} + bx r0 + .align 2, 0 +_08083E14: .4byte gUnknown_203B418 +_08083E18: .4byte 0x0000066f +_08083E1C: .4byte 0x00000672 +_08083E20: .4byte 0x0000066a +_08083E24: .4byte 0x000003e7 + thumb_func_end sub_8083DE0 + + thumb_func_start sub_8083E28 +sub_8083E28: + push {lr} + movs r1, 0x80 + lsls r1, 1 + movs r0, 0xCF + bl sub_800C074 + pop {r0} + bx r0 + thumb_func_end sub_8083E28 + + thumb_func_start sub_8083E38 +sub_8083E38: + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, _08083E54 + cmp r2, r0 + beq _08083E4E + movs r1, 0x80 + lsls r1, 1 + adds r0, r2, 0 + bl sub_800C074 +_08083E4E: + pop {r0} + bx r0 + .align 2, 0 +_08083E54: .4byte 0x000003e5 + thumb_func_end sub_8083E38 + + thumb_func_start sub_8083E58 +sub_8083E58: + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, _08083E70 + cmp r1, r0 + beq _08083E6A + adds r0, r1, 0 + bl sub_800C298 +_08083E6A: + pop {r0} + bx r0 + .align 2, 0 +_08083E70: .4byte 0x000003e5 + thumb_func_end sub_8083E58 + + thumb_func_start sub_8083E74 +sub_8083E74: + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl sub_800C5D0 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_8083E74 + + thumb_func_start sub_8083E88 +sub_8083E88: + ldr r1, _08083E9C + ldr r1, [r1] + ldr r3, _08083EA0 + adds r2, r1, r3 + movs r3, 0 + strh r0, [r2] + ldr r0, _08083EA4 + adds r1, r0 + strh r3, [r1] + bx lr + .align 2, 0 +_08083E9C: .4byte gUnknown_203B418 +_08083EA0: .4byte 0x0001ceda +_08083EA4: .4byte 0x0001ced4 + thumb_func_end sub_8083E88 + + thumb_func_start sub_8083EA8 +sub_8083EA8: + push {r4,r5,lr} + lsls r0, 16 + lsrs r0, 16 + ldr r2, _08083ECC + ldr r2, [r2] + movs r4, 0x80 + lsls r4, 8 + adds r3, r4, 0 + ldr r5, _08083ED0 + adds r4, r2, r5 + orrs r0, r3 + strh r0, [r4] + ldr r0, _08083ED4 + adds r2, r0 + strh r1, [r2] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08083ECC: .4byte gUnknown_203B418 +_08083ED0: .4byte 0x0001ceda +_08083ED4: .4byte 0x0001ced4 + thumb_func_end sub_8083EA8 + + thumb_func_start sub_8083ED8 +sub_8083ED8: + push {lr} + lsls r0, 16 + lsrs r0, 16 + bl sub_80118C4 + ldr r0, _08083F00 + ldr r1, [r0] + ldr r2, _08083F04 + adds r0, r1, r2 + ldr r2, _08083F08 + strh r2, [r0] + ldr r3, _08083F0C + adds r0, r1, r3 + strh r2, [r0] + ldr r0, _08083F10 + adds r1, r0 + strh r2, [r1] + pop {r0} + bx r0 + .align 2, 0 +_08083F00: .4byte gUnknown_203B418 +_08083F04: .4byte 0x0001ced6 +_08083F08: .4byte 0x000003e7 +_08083F0C: .4byte 0x0001ced8 +_08083F10: .4byte 0x0001ceda + thumb_func_end sub_8083ED8 + + thumb_func_start sub_8083F14 +sub_8083F14: + push {lr} + bl sub_8083F34 + bl sub_8011924 + pop {r0} + bx r0 + thumb_func_end sub_8083F14 + + thumb_func_start sub_8083F24 +sub_8083F24: + push {lr} + bl sub_800C068 + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_8083F24 + + thumb_func_start sub_8083F34 +sub_8083F34: + ldr r0, _08083F4C + ldr r0, [r0] + ldr r1, _08083F50 + adds r0, r1 + movs r1, 0 + str r1, [r0] + str r1, [r0, 0x4] + ldr r1, _08083F54 + strh r1, [r0, 0xA] + strh r1, [r0, 0xC] + strh r1, [r0, 0xE] + bx lr + .align 2, 0 +_08083F4C: .4byte gUnknown_203B418 +_08083F50: .4byte 0x0001cecc +_08083F54: .4byte 0x000003e7 + thumb_func_end sub_8083F34 + + thumb_func_start sub_8083F58 +sub_8083F58: + push {r4,lr} + ldr r0, _08083F7C + ldr r2, [r0] + ldr r0, _08083F80 + adds r4, r2, r0 + ldr r1, _08083F84 + adds r3, r2, r1 + ldrh r1, [r3] + ldr r0, _08083F88 + cmp r1, r0 + bne _08083FB2 + ldr r1, _08083F8C + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08083F90 + movs r1, 0x12 + b _08083FB2 + .align 2, 0 +_08083F7C: .4byte gUnknown_203B418 +_08083F80: .4byte 0x0001cecc +_08083F84: .4byte 0x0000066a +_08083F88: .4byte 0x000003e7 +_08083F8C: .4byte 0x0000066f +_08083F90: + ldr r1, _08083FA0 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08083FA4 + movs r1, 0x80 + b _08083FB2 + .align 2, 0 +_08083FA0: .4byte 0x00000672 +_08083FA4: + ldr r1, _08083FC4 + adds r0, r2, r1 + ldrb r0, [r0] + movs r1, 0x11 + cmp r0, 0 + bne _08083FB2 + ldrh r1, [r4, 0xE] +_08083FB2: + ldr r0, [r4] + cmp r0, 0x4 + bne _08083FC8 + ldrh r0, [r4, 0xC] + cmp r1, r0 + beq _08083FDA + movs r0, 0x2 + b _08083FD6 + .align 2, 0 +_08083FC4: .4byte 0x00000699 +_08083FC8: + ldr r2, _08083FEC + cmp r1, r2 + beq _08083FDA + ldrh r0, [r4, 0xA] + cmp r0, r2 + bne _08083FDA + movs r0, 0x1 +_08083FD6: + str r0, [r4] + strh r1, [r4, 0xA] +_08083FDA: + ldr r0, [r4] + cmp r0, 0x4 + bhi _08084084 + lsls r0, 2 + ldr r1, _08083FF0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08083FEC: .4byte 0x000003e7 +_08083FF0: .4byte _08083FF4 + .align 2, 0 +_08083FF4: + .4byte _08084084 + .4byte _08084008 + .4byte _08084050 + .4byte _0808405E + .4byte _08084084 +_08084008: + ldrh r1, [r4, 0xA] + ldr r0, _08084014 + cmp r1, r0 + bne _08084018 + movs r0, 0 + b _08084040 + .align 2, 0 +_08084014: .4byte 0x000003e7 +_08084018: + movs r0, 0x80 + lsls r0, 8 + ands r0, r1 + cmp r0, 0 + beq _08084030 + ldr r0, _0808402C + ands r0, r1 + bl sub_800BDFC + b _0808403A + .align 2, 0 +_0808402C: .4byte 0x00007fff +_08084030: + ldr r0, _08084048 + ands r0, r1 + ldrh r1, [r4, 0x8] + bl sub_800BE8C +_0808403A: + ldrh r0, [r4, 0xA] + strh r0, [r4, 0xC] + movs r0, 0x4 +_08084040: + str r0, [r4] + ldr r0, _0808404C + strh r0, [r4, 0xA] + b _08084084 + .align 2, 0 +_08084048: .4byte 0x00007fff +_0808404C: .4byte 0x000003e7 +_08084050: + movs r0, 0x1E + bl sub_800BFD0 + movs r0, 0x1E + str r0, [r4, 0x4] + movs r0, 0x3 + b _08084082 +_0808405E: + ldr r0, [r4, 0x4] + cmp r0, 0 + beq _0808406C + subs r0, 0x1 + str r0, [r4, 0x4] + cmp r0, 0 + bne _08084084 +_0808406C: + ldrh r1, [r4, 0xA] + ldr r0, _0808407C + cmp r1, r0 + bne _08084080 + bl sub_800BF80 + movs r0, 0 + b _08084082 + .align 2, 0 +_0808407C: .4byte 0x000003e7 +_08084080: + movs r0, 0x1 +_08084082: + str r0, [r4] +_08084084: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8083F58 + + thumb_func_start sub_808408C +sub_808408C: + ldr r2, _0808409C + movs r1, 0x1 + orrs r1, r0 + ldr r0, _080840A0 + ands r0, r1 + str r0, [r2] + bx lr + .align 2, 0 +_0808409C: .4byte gUnknown_203B458 +_080840A0: .4byte 0x00ffffff + thumb_func_end sub_808408C + + thumb_func_start sub_80840A4 +sub_80840A4: + ldr r3, _080840C8 + ldr r0, [r3] + ldr r2, _080840CC + adds r1, r0, 0 + muls r1, r2 + adds r1, 0x1 + lsrs r0, r1, 16 + muls r1, r2 + adds r1, 0x1 + str r1, [r3] + ldr r2, _080840D0 + ands r1, r2 + orrs r0, r1 + ldr r1, _080840D4 + ands r0, r1 + movs r1, 0x1 + orrs r0, r1 + bx lr + .align 2, 0 +_080840C8: .4byte gUnknown_203B458 +_080840CC: .4byte 0x5d588b65 +_080840D0: .4byte 0xffff0000 +_080840D4: .4byte 0x00ffffff + thumb_func_end sub_80840A4 + + thumb_func_start sub_80840D8 +sub_80840D8: + ldr r2, _080840E4 + movs r1, 0x1 + orrs r1, r0 + str r1, [r2] + bx lr + .align 2, 0 +_080840E4: .4byte gUnknown_203B454 + thumb_func_end sub_80840D8 + + thumb_func_start sub_80840E8 +sub_80840E8: + ldr r2, _080840F8 + ldr r1, [r2] + ldr r0, _080840FC + muls r0, r1 + adds r0, 0x1 + str r0, [r2] + lsrs r0, 16 + bx lr + .align 2, 0 +_080840F8: .4byte gUnknown_203B454 +_080840FC: .4byte 0x5d588b65 + thumb_func_end sub_80840E8 + + thumb_func_start sub_8084100 +sub_8084100: + push {r4,lr} + adds r4, r0, 0 + bl sub_80840E8 + ldr r1, _08084118 + ands r0, r1 + muls r0, r4 + asrs r0, 16 + ands r0, r1 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08084118: .4byte 0x0000ffff + thumb_func_end sub_8084100 + + thumb_func_start sub_808411C +sub_808411C: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + cmp r5, r4 + beq _0808413C + cmp r5, r4 + blt _08084134 + subs r0, r5, r4 + bl sub_8084100 + adds r0, r4 + b _0808413C +_08084134: + subs r0, r4, r5 + bl sub_8084100 + adds r0, r5 +_0808413C: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_808411C + + thumb_func_start sub_8084144 +sub_8084144: + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x64 + bl sub_8084100 + cmp r0, r4 + blt _08084156 + movs r0, 0 + b _08084158 +_08084156: + movs r0, 0x1 +_08084158: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8084144 + + thumb_func_start sub_8084160 +sub_8084160: + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x64 + bl sub_8084100 + cmp r0, r4 + blt _08084172 + movs r0, 0 + b _08084174 +_08084172: + movs r0, 0x1 +_08084174: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8084160 + + thumb_func_start sub_808417C +sub_808417C: + push {r4-r6,lr} + adds r5, r0, 0 + lsls r2, 24 + lsrs r6, r2, 24 + movs r2, 0 + ldrsh r0, [r1, r2] + movs r2, 0x2 + ldrsh r1, [r1, r2] + bl sub_808411C + adds r4, r0, 0 + adds r0, r5, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080841DC + adds r0, r5, 0 + bl sub_80450F8 + cmp r0, 0x1 + bne _080841DC + cmp r6, 0 + beq _080841DC + adds r0, r5, 0 + movs r1, 0x12 + bl sub_80718D8 + lsls r0, 24 + cmp r0, 0 + beq _080841C4 + cmp r4, 0x7F + beq _080841C4 + lsrs r0, r4, 31 + adds r0, r4, r0 + asrs r4, r0, 1 +_080841C4: + adds r0, r5, 0 + movs r1, 0x14 + bl sub_8071824 + lsls r0, 24 + cmp r0, 0 + beq _080841DC + cmp r4, 0x7F + beq _080841DC + cmp r4, 0x4 + ble _080841DC + movs r4, 0x5 +_080841DC: + cmp r4, 0 + bgt _080841E2 + movs r4, 0x1 +_080841E2: + adds r0, r4, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_808417C + + thumb_func_start sub_80841EC +sub_80841EC: + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0xC4 + add r0, sp, 0x60 + mov r8, r0 + movs r1, 0 + movs r2, 0x60 + bl memset + movs r0, 0x6 + str r0, [sp, 0x64] + add r1, sp, 0x68 + movs r6, 0 + movs r0, 0x4 + strh r0, [r1] + movs r2, 0x3 + strh r2, [r1, 0x2] + add r1, sp, 0x6C + movs r0, 0x16 + strh r0, [r1] + mov r0, sp + adds r0, 0x6E + movs r5, 0xE + movs r1, 0xE + strh r1, [r0] + add r0, sp, 0x70 + strh r1, [r0] + add r4, sp, 0xC0 + str r4, [sp, 0x74] + str r2, [sp, 0x7C] + add r0, sp, 0x90 + str r2, [r0, 0x4] + add r0, sp, 0xA8 + str r2, [r0, 0x4] + mov r0, sp + mov r1, r8 + movs r2, 0x60 + bl memcpy + movs r0, 0x1 + strb r0, [r4] + strb r6, [r4, 0x1] + strb r5, [r4, 0x2] + strb r6, [r4, 0x3] + mov r1, sp + movs r0, 0x14 + strh r0, [r1, 0xA] + mov r0, sp + movs r1, 0x1 + bl sub_803ECB4 + ldr r0, _0808426C + ldr r0, [r0] + ldr r1, _08084270 + adds r0, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + ldr r0, _08084274 + cmp r1, r0 + ble _08084278 + bl sub_8083DE0 + b _0808427C + .align 2, 0 +_0808426C: .4byte gUnknown_203B418 +_08084270: .4byte 0x0001ceac +_08084274: .4byte 0x00000225 +_08084278: + bl sub_8083D98 +_0808427C: + ldr r0, _080842B8 + ldr r1, [r0] + ldr r0, _080842BC + ldr r2, [r0] + ldr r0, _080842C0 + adds r2, r0 + movs r0, 0 + bl sub_8094558 + mov r4, sp +_08084290: + movs r0, 0x36 + bl sub_803E668 + bl sub_8083F58 + ldrh r1, [r4, 0xA] + movs r2, 0xA + ldrsh r0, [r4, r2] + cmp r0, 0x3 + ble _080842C4 + subs r0, r1, 0x1 + strh r0, [r4, 0xA] + movs r0, 0xA0 + strb r0, [r4] + mov r0, sp + movs r1, 0x1 + bl sub_803ECB4 + b _08084290 + .align 2, 0 +_080842B8: .4byte gUnknown_80FE6E8 +_080842BC: .4byte gUnknown_203B418 +_080842C0: .4byte 0x0001ce98 +_080842C4: + bl sub_8094D14 + lsls r0, 24 + cmp r0, 0 + bne _080842DA + ldr r0, _080842EC + ldrh r1, [r0, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08084290 +_080842DA: + bl sub_8083D08 + add sp, 0xC4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080842EC: .4byte gUnknown_20255F0 + thumb_func_end sub_80841EC + + thumb_func_start sub_80842F0 +sub_80842F0: + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r1, _0808436C + ldr r0, [r1] + ldr r2, _08084370 + adds r0, r2 + movs r2, 0 + strb r2, [r0] + ldr r0, [r1] + ldr r3, _08084374 + adds r0, r3 + strb r2, [r0] + ldr r0, [r1] + movs r5, 0xCF + lsls r5, 3 + adds r0, r5 + ldrb r0, [r0] + cmp r0, 0x2 + bne _080843AE + movs r6, 0 + ldr r0, _08084378 + mov r8, r0 + movs r7, 0x1 +_08084320: + lsls r0, r6, 24 + lsrs r0, 24 + bl sub_8096AB4 + adds r4, r0, 0 + ldrb r0, [r4] + cmp r0, 0x6 + bne _080843A8 + ldr r3, _0808436C + ldr r5, [r3] + ldr r1, _0808437C + adds r0, r5, r1 + ldrh r0, [r0] + ldrh r2, [r4, 0x4] + mov r1, r8 + ands r1, r0 + mov r0, r8 + ands r0, r2 + cmp r1, r0 + bne _080843A8 + ldrb r0, [r4, 0x1] + cmp r0, 0x3 + beq _080843A8 + cmp r0, 0x4 + bne _08084380 + ldrb r1, [r4, 0x10] + ldr r2, _08084374 + adds r0, r5, r2 + strb r1, [r0] + ldr r2, [r3] + ldrh r1, [r4, 0xE] + movs r3, 0xD1 + lsls r3, 3 + adds r0, r2, r3 + strh r1, [r0] + strb r7, [r2, 0x9] + b _080843A8 + .align 2, 0 +_0808436C: .4byte gUnknown_203B418 +_08084370: .4byte 0x00000677 +_08084374: .4byte 0x0000068a +_08084378: .4byte 0x0000ffff +_0808437C: .4byte 0x00000644 +_08084380: + cmp r0, 0 + beq _0808438C + cmp r0, 0x2 + beq _0808438C + cmp r0, 0x1 + bne _080843A8 +_0808438C: + ldr r2, [r3] + ldrh r0, [r4, 0xE] + movs r5, 0xD1 + lsls r5, 3 + adds r1, r2, r5 + strh r0, [r1] + ldrb r0, [r4, 0x1] + cmp r0, 0x2 + bne _080843A4 + ldr r1, _080843B8 + adds r0, r2, r1 + strb r7, [r0] +_080843A4: + ldr r0, [r3] + strb r7, [r0, 0x9] +_080843A8: + adds r6, 0x1 + cmp r6, 0x7 + ble _08084320 +_080843AE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080843B8: .4byte 0x00000677 + thumb_func_end sub_80842F0 + + thumb_func_start sub_80843BC +sub_80843BC: + push {r4-r6,lr} + lsls r0, 16 + asrs r6, r0, 16 + movs r4, 0 + ldr r5, _08084418 +_080843C6: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8096AB4 + adds r3, r0, 0 + ldrb r0, [r3] + cmp r0, 0x6 + bne _0808440C + ldr r0, _0808441C + ldr r0, [r0] + ldr r1, _08084420 + adds r0, r1 + ldrh r0, [r0] + ldrh r2, [r3, 0x4] + adds r1, r5, 0 + ands r1, r0 + adds r0, r5, 0 + ands r0, r2 + cmp r1, r0 + bne _0808440C + ldrb r0, [r3, 0x1] + cmp r0, 0 + beq _08084400 + cmp r0, 0x4 + beq _08084400 + cmp r0, 0x2 + beq _08084400 + cmp r0, 0x1 + bne _0808440C +_08084400: + movs r1, 0xE + ldrsh r0, [r3, r1] + cmp r6, r0 + bne _0808440C + movs r0, 0x8 + strb r0, [r3] +_0808440C: + adds r4, 0x1 + cmp r4, 0x7 + ble _080843C6 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08084418: .4byte 0x0000ffff +_0808441C: .4byte gUnknown_203B418 +_08084420: .4byte 0x00000644 + thumb_func_end sub_80843BC + + thumb_func_start sub_8084424 +sub_8084424: + push {r4,lr} + movs r4, 0 +_08084428: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8096AB4 + adds r1, r0, 0 + ldrb r0, [r1] + cmp r0, 0x8 + bne _0808443C + movs r0, 0x9 + strb r0, [r1] +_0808443C: + adds r4, 0x1 + cmp r4, 0x7 + ble _08084428 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8084424 + + thumb_func_start sub_8084448 +sub_8084448: + push {r4-r7,lr} + adds r5, r0, 0 + ldr r7, [r5, 0x70] + ldr r4, _0808447C + bl sub_8083600 + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r4, 0x50 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r5, 0 + bl sub_8070BC0 + lsls r0, 24 + cmp r0, 0 + bne _08084484 + ldr r0, _08084480 + b _080844F0 + .align 2, 0 +_0808447C: .4byte gUnknown_202DF98 +_08084480: .4byte gUnknown_80FA464 +_08084484: + ldr r4, _080844FC + ldr r0, [r4] + ldr r6, _08084500 + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0 + beq _08084540 + ldr r0, _08084504 + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_8052B8C + cmp r0, 0x1 + beq _080844A4 + b _080845D4 +_080844A4: + ldr r0, _08084508 + ldr r1, [r4] + adds r1, r6 + ldrb r1, [r1] + movs r2, 0 + bl sub_8090DC4 + movs r3, 0 + ldr r0, _0808450C + adds r6, r0, 0 + ldr r2, [r6] +_080844BA: + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080844E2 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080844E2 + movs r0, 0x18 + ands r0, r1 + cmp r0, 0x18 + beq _080844E2 + ldr r0, [r4] + ldr r1, _08084500 + adds r0, r1 + ldrb r1, [r2, 0x2] + ldrb r0, [r0] + cmp r1, r0 + beq _080844EA +_080844E2: + adds r2, 0x4 + adds r3, 0x1 + cmp r3, 0x13 + ble _080844BA +_080844EA: + cmp r3, 0x14 + bne _08084514 + ldr r0, _08084510 +_080844F0: + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 + b _080845D4 + .align 2, 0 +_080844FC: .4byte gUnknown_203B418 +_08084500: .4byte 0x0000068a +_08084504: .4byte gUnknown_80FA32C +_08084508: .4byte gUnknown_202DE58 +_0808450C: .4byte gUnknown_203B460 +_08084510: .4byte gUnknown_80FA448 +_08084514: + lsls r1, r3, 2 + ldr r0, [r6] + adds r1, r0 + movs r0, 0 + strb r0, [r1, 0x2] + strb r0, [r1, 0x1] + strb r0, [r1] + bl sub_80910B4 + ldr r0, _08084538 + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 + ldr r0, _0808453C + b _0808455E + .align 2, 0 +_08084538: .4byte gUnknown_80FA2B0 +_0808453C: .4byte gUnknown_80FA370 +_08084540: + ldr r0, _080845B0 + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_8052B8C + cmp r0, 0x1 + bne _080845D4 + ldr r0, _080845B4 + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 + ldr r0, _080845B8 +_0808455E: + ldr r4, [r0] + movs r1, 0x2 + ldrsh r0, [r7, r1] + bl sub_80843BC + adds r0, r5, 0x4 + bl sub_8042A34 + movs r1, 0x87 + lsls r1, 2 + adds r0, r5, 0 + movs r2, 0 + bl sub_8068FE0 + movs r0, 0x1 + bl sub_804178C + ldr r5, _080845BC +_08084582: + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_8052B8C + cmp r0, 0x1 + bne _080845C4 + ldr r0, _080845C0 + ldr r1, [r0] + movs r0, 0 + movs r2, 0 + bl sub_8052B8C + adds r1, r0, 0 + cmp r1, 0x1 + bne _08084582 + ldr r0, [r5] + strb r1, [r0, 0x4] + ldr r1, [r5] + movs r0, 0x2 + strb r0, [r1, 0x11] + b _080845D4 + .align 2, 0 +_080845B0: .4byte gUnknown_80FA2F0 +_080845B4: .4byte gUnknown_80FA260 +_080845B8: .4byte gUnknown_80FA36C +_080845BC: .4byte gUnknown_203B418 +_080845C0: .4byte gUnknown_80FA394 +_080845C4: + ldr r0, _080845DC + ldr r1, [r0] + movs r0, 0 + movs r2, 0 + bl sub_8052B8C + cmp r0, 0x1 + bne _08084582 +_080845D4: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080845DC: .4byte gUnknown_80FA3B8 + thumb_func_end sub_8084448 + + thumb_func_start sub_80845E0 +sub_80845E0: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r6, r0, 0 + ldr r0, [r6, 0x70] + mov r8, r0 + movs r7, 0 + movs r1, 0 + mov r9, r1 + ldr r4, _08084620 + bl sub_8083600 + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + bl sub_8045B94 + adds r4, 0x50 + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r6, 0 + bl sub_8070BC0 + lsls r0, 24 + cmp r0, 0 + bne _08084630 + ldr r0, _08084624 + b _080846B4 + .align 2, 0 +_08084620: .4byte gUnknown_202DF98 +_08084624: .4byte gUnknown_80FA530 +_08084628: + adds r7, r4, 0 + ldr r2, [r7, 0x70] + mov r9, r2 + b _08084674 +_08084630: + movs r5, 0 +_08084632: + ldr r0, _08084660 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _08084664 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0808466E + ldr r0, [r4, 0x70] + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x4A + beq _0808465A + cmp r0, 0x47 + bne _08084668 +_0808465A: + movs r0, 0x1 + b _0808466A + .align 2, 0 +_08084660: .4byte gUnknown_203B418 +_08084664: .4byte 0x0001357c +_08084668: + movs r0, 0 +_0808466A: + cmp r0, 0 + bne _08084628 +_0808466E: + adds r5, 0x1 + cmp r5, 0x3 + ble _08084632 +_08084674: + cmp r7, 0 + bne _08084680 + ldr r0, _0808467C + b _080846B4 + .align 2, 0 +_0808467C: .4byte gUnknown_80FA52C +_08084680: + ldr r0, _0808469C + adds r1, r7, 0 + movs r2, 0 + bl sub_8045B94 + adds r0, r7, 0 + bl sub_8070BC0 + lsls r0, 24 + cmp r0, 0 + bne _080846A4 + ldr r0, _080846A0 + b _080846B4 + .align 2, 0 +_0808469C: .4byte gUnknown_202E038 +_080846A0: .4byte gUnknown_80FA54C +_080846A4: + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_8045990 + lsls r0, 24 + cmp r0, 0 + bne _080846C4 + ldr r0, _080846C0 +_080846B4: + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 + b _08084768 + .align 2, 0 +_080846C0: .4byte gUnknown_80FA500 +_080846C4: + ldr r0, _08084744 + ldr r1, [r0] + movs r0, 0 + movs r2, 0x1 + bl sub_80527C4 + mov r1, r8 + movs r2, 0x2 + ldrsh r0, [r1, r2] + bl sub_80843BC + ldr r5, _08084748 + ldr r0, [r5] + ldr r1, _0808474C + adds r0, r1 + ldrb r1, [r0] + mov r0, r9 + adds r0, 0x40 + strb r1, [r0] + adds r0, r6, 0x4 + bl sub_8042A34 + adds r0, r7, 0x4 + bl sub_8042A34 + movs r4, 0x87 + lsls r4, 2 + adds r0, r6, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_8068FE0 + adds r0, r7, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_8068FE0 + movs r0, 0x1 + bl sub_804178C + ldr r4, _08084750 +_08084716: + movs r0, 0 + ldr r1, [r4] + movs r2, 0x1 + bl sub_8052B8C + cmp r0, 0x1 + bne _08084758 + ldr r0, _08084754 + ldr r1, [r0] + movs r0, 0 + movs r2, 0 + bl sub_8052B8C + adds r1, r0, 0 + cmp r1, 0x1 + bne _08084716 + ldr r0, [r5] + strb r1, [r0, 0x4] + ldr r1, [r5] + movs r0, 0x2 + strb r0, [r1, 0x11] + b _08084768 + .align 2, 0 +_08084744: .4byte gUnknown_80FA4D4 +_08084748: .4byte gUnknown_203B418 +_0808474C: .4byte 0x00000644 +_08084750: .4byte gUnknown_80FA4D8 +_08084754: .4byte gUnknown_80FA394 +_08084758: + ldr r0, _08084774 + ldr r1, [r0] + movs r0, 0 + movs r2, 0 + bl sub_8052B8C + cmp r0, 0x1 + bne _08084716 +_08084768: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08084774: .4byte gUnknown_80FA3B8 + thumb_func_end sub_80845E0 + + thumb_func_start sub_8084778 +sub_8084778: + push {r4,lr} + ldr r0, _080847B8 + ldr r1, _080847BC + bl strcpy + movs r4, 0 +_08084784: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8096AB4 + adds r1, r0, 0 + ldrb r0, [r1] + cmp r0, 0x6 + bne _080847C8 + ldr r0, _080847C0 + ldr r0, [r0] + ldr r2, _080847C4 + adds r0, r2 + ldrb r0, [r0] + ldrb r2, [r1, 0x4] + cmp r0, r2 + bne _080847C8 + ldrb r0, [r1, 0x1] + cmp r0, 0x2 + bne _080847C8 + movs r0, 0xE + ldrsh r1, [r1, r0] + ldr r0, _080847B8 + bl sub_808D908 + b _080847CE + .align 2, 0 +_080847B8: .4byte gUnknown_202E088 +_080847BC: .4byte gUnknown_8107224 +_080847C0: .4byte gUnknown_203B418 +_080847C4: .4byte 0x00000644 +_080847C8: + adds r4, 0x1 + cmp r4, 0x7 + ble _08084784 +_080847CE: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8084778 + + thumb_func_start sub_80847D4 +sub_80847D4: + push {r4,r5,lr} + ldr r2, _08084820 + ldr r0, [r2] + ldr r1, _08084824 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r2] + ldr r2, _08084828 + adds r0, r2 + strb r1, [r0] + bl sub_8040A84 + movs r4, 0 + ldr r0, _0808482C + ldrb r0, [r0] + cmp r0, 0 + beq _08084846 + movs r3, 0 +_080847FA: + ldr r0, _08084820 + ldr r0, [r0] + ldr r5, _08084830 + adds r0, r5 + movs r2, 0 + ldrsh r1, [r0, r2] + adds r0, r1, 0 + subs r0, 0x1C + cmp r0, 0x15 + bhi _08084810 + movs r1, 0x1B +_08084810: + ldr r2, _0808482C + adds r0, r3, r2 + ldrb r5, [r0] + cmp r1, r5 + bne _08084834 + bl sub_8084854 + b _08084846 + .align 2, 0 +_08084820: .4byte gUnknown_203B418 +_08084824: .4byte 0x00003a0d +_08084828: .4byte 0x0001356c +_0808482C: .4byte gUnknown_8107234 +_08084830: .4byte 0x00003a14 +_08084834: + adds r3, 0x8 + adds r4, 0x1 + ldr r0, _08084850 + cmp r4, r0 + bgt _08084846 + adds r0, r3, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080847FA +_08084846: + bl sub_8097FF8 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08084850: .4byte 0x000003e6 + thumb_func_end sub_80847D4 + + thumb_func_start sub_8084854 +sub_8084854: + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _08084874 + ldr r2, [r5] + movs r1, 0xCF + lsls r1, 3 + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _0808487C + ldrb r1, [r4, 0x5] + ldr r3, _08084878 + adds r0, r2, r3 + strb r1, [r0] + b _080848C8 + .align 2, 0 +_08084874: .4byte gUnknown_203B418 +_08084878: .4byte 0x00003a0d +_0808487C: + ldrb r0, [r4, 0x4] + bl sub_8098100 + lsls r0, 24 + cmp r0, 0 + beq _08084898 + ldr r0, [r5] + ldrb r1, [r4, 0x5] + ldr r2, _08084894 + adds r0, r2 + strb r1, [r0] + b _080848C8 + .align 2, 0 +_08084894: .4byte 0x00003a0d +_08084898: + ldrb r0, [r4, 0x2] + bl sub_8098100 + lsls r0, 24 + cmp r0, 0 + beq _080848B4 + ldr r0, [r5] + ldrb r1, [r4, 0x3] + ldr r3, _080848B0 + adds r0, r3 + strb r1, [r0] + b _080848C8 + .align 2, 0 +_080848B0: .4byte 0x00003a0d +_080848B4: + ldr r0, [r5] + ldrb r1, [r4, 0x1] + ldr r2, _080848E0 + adds r0, r2 + strb r1, [r0] + ldrb r0, [r4, 0x2] + cmp r0, 0x40 + beq _080848C8 + bl sub_8097FA8 +_080848C8: + ldr r0, _080848E4 + ldr r0, [r0] + ldr r3, _080848E8 + adds r0, r3 + movs r1, 0x1 + strb r1, [r0] + movs r0, 0 + bl sub_807E5E4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080848E0: .4byte 0x00003a0d +_080848E4: .4byte gUnknown_203B418 +_080848E8: .4byte 0x00000675 + thumb_func_end sub_8084854 + + thumb_func_start sub_80848EC +sub_80848EC: + movs r0, 0x1 + bx lr + thumb_func_end sub_80848EC + + thumb_func_start sub_80848F0 +sub_80848F0: + push {lr} + ldr r2, _08084918 + ldr r0, [r2] + ldr r1, _0808491C + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r2] + ldr r1, _08084920 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3C + bls _0808490C + b _08084B5C +_0808490C: + lsls r0, 2 + ldr r1, _08084924 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08084918: .4byte gUnknown_203B418 +_0808491C: .4byte 0x0001356c +_08084920: .4byte 0x00003a0d +_08084924: .4byte _08084928 + .align 2, 0 +_08084928: + .4byte _08084A1C + .4byte _08084A2C + .4byte _08084A2C + .4byte _08084A32 + .4byte _08084A38 + .4byte _08084A38 + .4byte _08084A3E + .4byte _08084A44 + .4byte _08084A44 + .4byte _08084A4A + .4byte _08084A50 + .4byte _08084A50 + .4byte _08084A56 + .4byte _08084A5C + .4byte _08084A62 + .4byte _08084A68 + .4byte _08084A6E + .4byte _08084A74 + .4byte _08084A7A + .4byte _08084A80 + .4byte _08084A86 + .4byte _08084A8C + .4byte _08084A92 + .4byte _08084A98 + .4byte _08084A98 + .4byte _08084A9E + .4byte _08084AA4 + .4byte _08084AA4 + .4byte _08084AAA + .4byte _08084AB0 + .4byte _08084AB0 + .4byte _08084AB6 + .4byte _08084ABC + .4byte _08084ABC + .4byte _08084AC2 + .4byte _08084AC8 + .4byte _08084ACE + .4byte _08084AD4 + .4byte _08084ADA + .4byte _08084AE0 + .4byte _08084AE6 + .4byte _08084AEC + .4byte _08084AF2 + .4byte _08084AF8 + .4byte _08084AFE + .4byte _08084B04 + .4byte _08084B0A + .4byte _08084B10 + .4byte _08084B16 + .4byte _08084B1C + .4byte _08084B22 + .4byte _08084B28 + .4byte _08084B2E + .4byte _08084B34 + .4byte _08084B3A + .4byte _08084B40 + .4byte _08084B46 + .4byte _08084B4C + .4byte _08084B52 + .4byte _08084B58 + .4byte _08084A1C +_08084A1C: + ldr r0, [r2] + ldr r1, _08084A28 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + b _08084B5C + .align 2, 0 +_08084A28: .4byte 0x0001356c +_08084A2C: + bl sub_8086B14 + b _08084B5C +_08084A32: + bl sub_8086B94 + b _08084B5C +_08084A38: + bl sub_8086E9C + b _08084B5C +_08084A3E: + bl sub_8086F00 + b _08084B5C +_08084A44: + bl sub_8087230 + b _08084B5C +_08084A4A: + bl sub_808729C + b _08084B5C +_08084A50: + bl sub_80877E8 + b _08084B5C +_08084A56: + bl sub_8087848 + b _08084B5C +_08084A5C: + bl sub_8087F54 + b _08084B5C +_08084A62: + bl sub_8087FB4 + b _08084B5C +_08084A68: + bl sub_8087FF8 + b _08084B5C +_08084A6E: + bl sub_80885A0 + b _08084B5C +_08084A74: + bl sub_80885C4 + b _08084B5C +_08084A7A: + bl sub_808862C + b _08084B5C +_08084A80: + bl sub_80886C4 + b _08084B5C +_08084A86: + bl sub_808875C + b _08084B5C +_08084A8C: + bl sub_8088DC0 + b _08084B5C +_08084A92: + bl sub_8088E5C + b _08084B5C +_08084A98: + bl sub_80892C8 + b _08084B5C +_08084A9E: + bl sub_8089328 + b _08084B5C +_08084AA4: + bl sub_808970C + b _08084B5C +_08084AAA: + bl sub_808974C + b _08084B5C +_08084AB0: + bl sub_8089914 + b _08084B5C +_08084AB6: + bl sub_8089978 + b _08084B5C +_08084ABC: + bl sub_8089C44 + b _08084B5C +_08084AC2: + bl sub_8089C90 + b _08084B5C +_08084AC8: + bl sub_8089EFC + b _08084B5C +_08084ACE: + bl sub_8089F44 + b _08084B5C +_08084AD4: + bl sub_8089F8C + b _08084B5C +_08084ADA: + bl sub_808A264 + b _08084B5C +_08084AE0: + bl sub_808A2C0 + b _08084B5C +_08084AE6: + bl sub_808A308 + b _08084B5C +_08084AEC: + bl sub_808A608 + b _08084B5C +_08084AF2: + bl sub_808A668 + b _08084B5C +_08084AF8: + bl sub_808A9E4 + b _08084B5C +_08084AFE: + bl sub_808AA3C + b _08084B5C +_08084B04: + bl sub_808AA94 + b _08084B5C +_08084B0A: + bl sub_808ACC0 + b _08084B5C +_08084B10: + bl sub_808AD48 + b _08084B5C +_08084B16: + bl sub_808ADCC + b _08084B5C +_08084B1C: + bl sub_808B2F4 + b _08084B5C +_08084B22: + bl sub_808B35C + b _08084B5C +_08084B28: + bl sub_808BDEC + b _08084B5C +_08084B2E: + bl sub_808C10C + b _08084B5C +_08084B34: + bl sub_808C3A0 + b _08084B5C +_08084B3A: + bl sub_808C5C0 + b _08084B5C +_08084B40: + bl sub_808C938 + b _08084B5C +_08084B46: + bl sub_808C9C4 + b _08084B5C +_08084B4C: + bl sub_808CB5C + b _08084B5C +_08084B52: + bl sub_808CBB0 + b _08084B5C +_08084B58: + bl sub_808CD44 +_08084B5C: + bl sub_8097FF8 + pop {r0} + bx r0 + thumb_func_end sub_80848F0 + + thumb_func_start sub_8084B64 +sub_8084B64: + push {lr} + ldr r0, _08084B80 + ldr r0, [r0] + ldr r1, _08084B84 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3C + bls _08084B76 + b _08084DDA +_08084B76: + lsls r0, 2 + ldr r1, _08084B88 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08084B80: .4byte gUnknown_203B418 +_08084B84: .4byte 0x00003a0d +_08084B88: .4byte _08084B8C + .align 2, 0 +_08084B8C: + .4byte _08084DDA + .4byte _08084C80 + .4byte _08084C86 + .4byte _08084C8C + .4byte _08084C92 + .4byte _08084C98 + .4byte _08084C9E + .4byte _08084CA4 + .4byte _08084CAA + .4byte _08084CB0 + .4byte _08084CB6 + .4byte _08084CBC + .4byte _08084CC2 + .4byte _08084CC8 + .4byte _08084CCE + .4byte _08084CD4 + .4byte _08084CDA + .4byte _08084CE0 + .4byte _08084CE6 + .4byte _08084CEC + .4byte _08084CF2 + .4byte _08084CF8 + .4byte _08084CFE + .4byte _08084D04 + .4byte _08084D0A + .4byte _08084D10 + .4byte _08084D16 + .4byte _08084D1C + .4byte _08084D22 + .4byte _08084D28 + .4byte _08084D28 + .4byte _08084D2E + .4byte _08084D34 + .4byte _08084D3A + .4byte _08084D40 + .4byte _08084D46 + .4byte _08084D4C + .4byte _08084D52 + .4byte _08084D58 + .4byte _08084D5E + .4byte _08084D64 + .4byte _08084D6A + .4byte _08084D70 + .4byte _08084D76 + .4byte _08084D7C + .4byte _08084D82 + .4byte _08084D88 + .4byte _08084D8E + .4byte _08084D94 + .4byte _08084D9A + .4byte _08084DA0 + .4byte _08084DA6 + .4byte _08084DAC + .4byte _08084DB2 + .4byte _08084DB8 + .4byte _08084DBE + .4byte _08084DC4 + .4byte _08084DCA + .4byte _08084DD0 + .4byte _08084DD6 + .4byte _08084DDA +_08084C80: + bl sub_8086C0C + b _08084DDA +_08084C86: + bl sub_8086DAC + b _08084DDA +_08084C8C: + bl sub_8086E40 + b _08084DDA +_08084C92: + bl sub_8086FB8 + b _08084DDA +_08084C98: + bl sub_8087064 + b _08084DDA +_08084C9E: + bl sub_8087130 + b _08084DDA +_08084CA4: + bl sub_8087364 + b _08084DDA +_08084CAA: + bl sub_80875C0 + b _08084DDA +_08084CB0: + bl sub_808765C + b _08084DDA +_08084CB6: + bl sub_8087924 + b _08084DDA +_08084CBC: + bl sub_8087B20 + b _08084DDA +_08084CC2: + bl sub_8087C38 + b _08084DDA +_08084CC8: + bl sub_80880B8 + b _08084DDA +_08084CCE: + bl sub_8088304 + b _08084DDA +_08084CD4: + bl sub_8088398 + b _08084DDA +_08084CDA: + bl sub_8088608 + b _08084DDA +_08084CE0: + bl sub_8088618 + b _08084DDA +_08084CE6: + bl sub_8088854 + b _08084DDA +_08084CEC: + bl sub_8088A9C + b _08084DDA +_08084CF2: + bl sub_8088B60 + b _08084DDA +_08084CF8: + bl sub_8088EF4 + b _08084DDA +_08084CFE: + bl sub_8089168 + b _08084DDA +_08084D04: + bl sub_80893E4 + b _08084DDA +_08084D0A: + bl sub_8089500 + b _08084DDA +_08084D10: + bl sub_8089588 + b _08084DDA +_08084D16: + bl sub_80897F0 + b _08084DDA +_08084D1C: + bl sub_8089878 + b _08084DDA +_08084D22: + bl sub_80898E4 + b _08084DDA +_08084D28: + bl sub_8089A30 + b _08084DDA +_08084D2E: + bl sub_8089AD4 + b _08084DDA +_08084D34: + bl sub_8089D2C + b _08084DDA +_08084D3A: + bl sub_8089D8C + b _08084DDA +_08084D40: + bl sub_8089DEC + b _08084DDA +_08084D46: + bl sub_808A020 + b _08084DDA +_08084D4C: + bl sub_808A0C8 + b _08084DDA +_08084D52: + bl sub_808A144 + b _08084DDA +_08084D58: + bl sub_808A39C + b _08084DDA +_08084D5E: + bl sub_808A454 + b _08084DDA +_08084D64: + bl sub_808A4B0 + b _08084DDA +_08084D6A: + bl sub_808A724 + b _08084DDA +_08084D70: + bl sub_808A828 + b _08084DDA +_08084D76: + bl sub_808AB20 + b _08084DDA +_08084D7C: + bl sub_808ABD8 + b _08084DDA +_08084D82: + bl sub_808AC3C + b _08084DDA +_08084D88: + bl sub_808B130 + b _08084DDA +_08084D8E: + bl sub_808B164 + b _08084DDA +_08084D94: + bl sub_808B198 + b _08084DDA +_08084D9A: + bl sub_808B45C + b _08084DDA +_08084DA0: + bl sub_808BA78 + b _08084DDA +_08084DA6: + bl sub_808BE94 + b _08084DDA +_08084DAC: + bl sub_808C1CC + b _08084DDA +_08084DB2: + bl sub_808C43C + b _08084DDA +_08084DB8: + bl sub_808C628 + b _08084DDA +_08084DBE: + bl sub_808C998 + b _08084DDA +_08084DC4: + bl sub_808CA1C + b _08084DDA +_08084DCA: + bl nullsub_101 + b _08084DDA +_08084DD0: + bl sub_808CC04 + b _08084DDA +_08084DD6: + bl sub_808CD9C +_08084DDA: + bl sub_8085764 + bl sub_80857B8 + ldr r0, _08084DF8 + ldr r0, [r0] + ldr r1, _08084DFC + adds r0, r1 + movs r1, 0 + strb r1, [r0] + bl sub_8097FF8 + pop {r0} + bx r0 + .align 2, 0 +_08084DF8: .4byte gUnknown_203B418 +_08084DFC: .4byte 0x0001356c + thumb_func_end sub_8084B64 + + thumb_func_start sub_8084E00 +sub_8084E00: + push {r4,r5,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r3, r1, 24 + lsls r2, 24 + lsrs r5, r2, 24 + cmp r3, 0 + bne _08084E12 + b _0808512E +_08084E12: + ldr r1, _08084E30 + ldr r0, [r1] + ldr r2, _08084E34 + adds r0, r2 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0x3C + bls _08084E24 + b _0808511A +_08084E24: + lsls r0, 2 + ldr r1, _08084E38 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08084E30: .4byte gUnknown_203B418 +_08084E34: .4byte 0x00003a0d +_08084E38: .4byte _08084E3C + .align 2, 0 +_08084E3C: + .4byte _0808511A + .4byte _08084F30 + .4byte _08084F30 + .4byte _0808511A + .4byte _08084F44 + .4byte _08084F44 + .4byte _0808511A + .4byte _08084F58 + .4byte _08084F58 + .4byte _08084F58 + .4byte _08084F6C + .4byte _08084F6C + .4byte _08084F6C + .4byte _08084F80 + .4byte _08084F80 + .4byte _08084F80 + .4byte _0808511A + .4byte _0808511A + .4byte _08084F94 + .4byte _08084F94 + .4byte _08084F94 + .4byte _0808511A + .4byte _0808511A + .4byte _08084FA8 + .4byte _08084FA8 + .4byte _08084FA8 + .4byte _08084FBC + .4byte _08084FBC + .4byte _0808511A + .4byte _08084FD4 + .4byte _08084FD4 + .4byte _08084FD4 + .4byte _08084FE8 + .4byte _08084FE8 + .4byte _08084FE8 + .4byte _08084FFC + .4byte _08084FFC + .4byte _08084FFC + .4byte _08085010 + .4byte _08085010 + .4byte _08085010 + .4byte _08085024 + .4byte _08085024 + .4byte _08085038 + .4byte _08085038 + .4byte _08085038 + .4byte _0808504C + .4byte _08085064 + .4byte _0808507C + .4byte _08085094 + .4byte _08085094 + .4byte _080850AC + .4byte _080850C4 + .4byte _080850DC + .4byte _080850F4 + .4byte _0808510C + .4byte _0808511A + .4byte _0808511A + .4byte _0808511A + .4byte _0808511A + .4byte _0808511A +_08084F30: + ldr r0, [r2] + ldr r1, _08084F40 + adds r0, r1 + ldrb r1, [r0] + adds r0, r3, 0 + bl sub_8086BDC + b _0808511A + .align 2, 0 +_08084F40: .4byte 0x00003a0d +_08084F44: + ldr r0, [r2] + ldr r2, _08084F54 + adds r0, r2 + ldrb r1, [r0] + adds r0, r3, 0 + bl sub_8086F54 + b _0808511A + .align 2, 0 +_08084F54: .4byte 0x00003a0d +_08084F58: + ldr r0, [r2] + ldr r1, _08084F68 + adds r0, r1 + ldrb r1, [r0] + adds r0, r3, 0 + bl sub_8087334 + b _0808511A + .align 2, 0 +_08084F68: .4byte 0x00003a0d +_08084F6C: + ldr r0, [r2] + ldr r2, _08084F7C + adds r0, r2 + ldrb r1, [r0] + adds r0, r3, 0 + bl sub_80878F4 + b _0808511A + .align 2, 0 +_08084F7C: .4byte 0x00003a0d +_08084F80: + ldr r0, [r2] + ldr r1, _08084F90 + adds r0, r1 + ldrb r1, [r0] + adds r0, r3, 0 + bl sub_8088088 + b _0808511A + .align 2, 0 +_08084F90: .4byte 0x00003a0d +_08084F94: + ldr r0, [r2] + ldr r2, _08084FA4 + adds r0, r2 + ldrb r1, [r0] + adds r0, r3, 0 + bl sub_8088818 + b _0808511A + .align 2, 0 +_08084FA4: .4byte 0x00003a0d +_08084FA8: + ldr r0, [r2] + ldr r1, _08084FB8 + adds r0, r1 + ldrb r1, [r0] + adds r0, r3, 0 + bl sub_80893B4 + b _0808511A + .align 2, 0 +_08084FB8: .4byte 0x00003a0d +_08084FBC: + ldr r0, [r2] + ldr r2, _08084FD0 + adds r0, r2 + ldrb r2, [r0] + adds r0, r4, 0 + adds r1, r3, 0 + bl sub_8089788 + b _0808511A + .align 2, 0 +_08084FD0: .4byte 0x00003a0d +_08084FD4: + ldr r0, [r2] + ldr r1, _08084FE4 + adds r0, r1 + ldrb r1, [r0] + adds r0, r3, 0 + bl sub_8089A00 + b _0808511A + .align 2, 0 +_08084FE4: .4byte 0x00003a0d +_08084FE8: + ldr r0, [r2] + ldr r2, _08084FF8 + adds r0, r2 + ldrb r1, [r0] + adds r0, r3, 0 + bl sub_8089CFC + b _0808511A + .align 2, 0 +_08084FF8: .4byte 0x00003a0d +_08084FFC: + ldr r0, [r2] + ldr r1, _0808500C + adds r0, r1 + ldrb r1, [r0] + adds r0, r3, 0 + bl sub_8089FF0 + b _0808511A + .align 2, 0 +_0808500C: .4byte 0x00003a0d +_08085010: + ldr r0, [r2] + ldr r2, _08085020 + adds r0, r2 + ldrb r1, [r0] + adds r0, r3, 0 + bl sub_808A36C + b _0808511A + .align 2, 0 +_08085020: .4byte 0x00003a0d +_08085024: + ldr r0, [r2] + ldr r1, _08085034 + adds r0, r1 + ldrb r1, [r0] + adds r0, r3, 0 + bl sub_808A6E8 + b _0808511A + .align 2, 0 +_08085034: .4byte 0x00003a0d +_08085038: + ldr r0, [r2] + ldr r2, _08085048 + adds r0, r2 + ldrb r1, [r0] + adds r0, r3, 0 + bl sub_808AAF0 + b _0808511A + .align 2, 0 +_08085048: .4byte 0x00003a0d +_0808504C: + ldr r0, [r2] + ldr r1, _08085060 + adds r0, r1 + ldrb r1, [r0] + adds r2, r4, 0x4 + adds r0, r3, 0 + bl sub_808AE54 + b _0808511A + .align 2, 0 +_08085060: .4byte 0x00003a0d +_08085064: + ldr r0, [r2] + ldr r2, _08085078 + adds r0, r2 + ldrb r1, [r0] + adds r2, r4, 0x4 + adds r0, r3, 0 + bl sub_808AEC8 + b _0808511A + .align 2, 0 +_08085078: .4byte 0x00003a0d +_0808507C: + ldr r0, [r2] + ldr r1, _08085090 + adds r0, r1 + ldrb r1, [r0] + adds r2, r4, 0x4 + adds r0, r3, 0 + bl sub_808AF3C + b _0808511A + .align 2, 0 +_08085090: .4byte 0x00003a0d +_08085094: + ldr r0, [r2] + ldr r2, _080850A8 + adds r0, r2 + ldrb r1, [r0] + adds r0, r3, 0 + adds r2, r5, 0 + bl sub_808B3E4 + b _0808511A + .align 2, 0 +_080850A8: .4byte 0x00003a0d +_080850AC: + ldr r0, [r2] + ldr r1, _080850C0 + adds r0, r1 + ldrb r1, [r0] + adds r0, r3, 0 + adds r2, r5, 0 + bl sub_808BE70 + b _0808511A + .align 2, 0 +_080850C0: .4byte 0x00003a0d +_080850C4: + ldr r0, [r2] + ldr r2, _080850D8 + adds r0, r2 + ldrb r1, [r0] + adds r0, r3, 0 + adds r2, r5, 0 + bl sub_808C1A4 + b _0808511A + .align 2, 0 +_080850D8: .4byte 0x00003a0d +_080850DC: + ldr r0, [r2] + ldr r1, _080850F0 + adds r0, r1 + ldrb r1, [r0] + adds r0, r3, 0 + adds r2, r5, 0 + bl sub_808C414 + b _0808511A + .align 2, 0 +_080850F0: .4byte 0x00003a0d +_080850F4: + ldr r0, [r2] + ldr r2, _08085108 + adds r0, r2 + ldrb r1, [r0] + adds r0, r3, 0 + adds r2, r5, 0 + bl nullsub_100 + b _0808511A + .align 2, 0 +_08085108: .4byte 0x00003a0d +_0808510C: + ldr r0, [r2] + ldr r1, _08085134 + adds r0, r1 + ldrb r1, [r0] + adds r0, r4, 0 + bl sub_808C948 +_0808511A: + cmp r5, 0 + bne _0808512E + ldr r0, _08085138 + ldr r0, [r0] + ldrb r0, [r0, 0x2] + cmp r0, 0 + beq _0808512E + ldr r0, _0808513C + bl sub_8083E88 +_0808512E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08085134: .4byte 0x00003a0d +_08085138: .4byte gUnknown_203B418 +_0808513C: .4byte 0x000003e7 + thumb_func_end sub_8084E00 + + thumb_func_start sub_8085140 +sub_8085140: + push {lr} + ldr r1, _08085160 + ldr r0, [r1] + ldr r2, _08085164 + adds r0, r2 + ldrb r0, [r0] + adds r2, r1, 0 + cmp r0, 0x3C + bls _08085154 + b _08085294 +_08085154: + lsls r0, 2 + ldr r1, _08085168 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08085160: .4byte gUnknown_203B418 +_08085164: .4byte 0x00003a0d +_08085168: .4byte _0808516C + .align 2, 0 +_0808516C: + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085260 + .4byte _08085274 + .4byte _08085288 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 + .4byte _08085294 +_08085260: + ldr r0, [r2] + ldr r1, _08085270 + adds r0, r1 + ldrb r0, [r0] + bl sub_808AFB0 + b _08085294 + .align 2, 0 +_08085270: .4byte 0x00003a0d +_08085274: + ldr r0, [r2] + ldr r2, _08085284 + adds r0, r2 + ldrb r0, [r0] + bl sub_808B030 + b _08085294 + .align 2, 0 +_08085284: .4byte 0x00003a0d +_08085288: + ldr r0, [r2] + ldr r1, _08085298 + adds r0, r1 + ldrb r0, [r0] + bl sub_808B0B0 +_08085294: + pop {r0} + bx r0 + .align 2, 0 +_08085298: .4byte 0x00003a0d + thumb_func_end sub_8085140 + + thumb_func_start sub_808529C +sub_808529C: + push {lr} + lsls r0, 16 + asrs r1, r0, 16 + adds r2, r1, 0 + movs r3, 0x40 + movs r0, 0x86 + lsls r0, 1 + cmp r1, r0 + beq _08085348 + cmp r1, r0 + bgt _080852E0 + cmp r1, 0x90 + beq _08085334 + cmp r1, 0x90 + bgt _080852CE + cmp r1, 0x38 + beq _08085354 + cmp r1, 0x38 + bgt _080852C8 + cmp r1, 0x17 + beq _08085328 + b _0808535A +_080852C8: + cmp r1, 0x5E + beq _08085328 + b _0808535A +_080852CE: + cmp r1, 0x92 + beq _08085330 + cmp r1, 0x92 + blt _0808532C + cmp r1, 0x96 + beq _08085340 + cmp r1, 0xFC + beq _08085324 + b _0808535A +_080852E0: + ldr r0, _08085304 + cmp r1, r0 + beq _08085358 + cmp r1, r0 + bgt _08085308 + subs r0, 0x87 + cmp r1, r0 + beq _0808534C + cmp r1, r0 + blt _08085344 + adds r0, 0x5 + cmp r1, r0 + beq _08085350 + adds r0, 0x3A + cmp r1, r0 + beq _08085328 + b _0808535A + .align 2, 0 +_08085304: .4byte 0x00000195 +_08085308: + ldr r0, _08085320 + cmp r2, r0 + beq _08085358 + cmp r2, r0 + blt _08085358 + adds r0, 0x4 + cmp r2, r0 + beq _08085338 + adds r0, 0x1 + cmp r2, r0 + beq _0808533C + b _0808535A + .align 2, 0 +_08085320: .4byte 0x00000197 +_08085324: + movs r3, 0x1 + b _0808535A +_08085328: + movs r3, 0x3 + b _0808535A +_0808532C: + movs r3, 0x5 + b _0808535A +_08085330: + movs r3, 0x7 + b _0808535A +_08085334: + movs r3, 0x9 + b _0808535A +_08085338: + movs r3, 0xC + b _0808535A +_0808533C: + movs r3, 0xF + b _0808535A +_08085340: + movs r3, 0x13 + b _0808535A +_08085344: + movs r3, 0x15 + b _0808535A +_08085348: + movs r3, 0x17 + b _0808535A +_0808534C: + movs r3, 0x19 + b _0808535A +_08085350: + movs r3, 0x1A + b _0808535A +_08085354: + movs r3, 0x11 + b _0808535A +_08085358: + movs r3, 0x1D +_0808535A: + cmp r3, 0x40 + beq _0808536E + adds r0, r3, 0 + bl sub_8098100 + lsls r0, 24 + cmp r0, 0 + bne _0808536E + movs r0, 0 + b _08085370 +_0808536E: + movs r0, 0x1 +_08085370: + pop {r1} + bx r1 + thumb_func_end sub_808529C + + thumb_func_start sub_8085374 +sub_8085374: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + movs r7, 0 + movs r6, 0 + bl sub_808D3F8 + movs r2, 0x8 + ldrsh r1, [r0, r2] + mov r8, r1 + movs r5, 0 +_0808538E: + ldr r0, _08085444 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _08085448 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080853BE + ldr r1, [r4, 0x70] + ldrb r0, [r1, 0x7] + cmp r0, 0 + beq _080853B2 + adds r7, r4, 0 +_080853B2: + adds r0, r1, 0 + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x41 + bne _080853BE + adds r6, r4, 0 +_080853BE: + adds r5, 0x1 + cmp r5, 0x3 + ble _0808538E + cmp r7, 0 + beq _0808546E + cmp r6, 0 + bne _0808546E + ldr r0, _08085444 + ldr r0, [r0] + ldr r1, _0808544C + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0808546E + movs r6, 0 + ldr r0, _08085450 + ldr r4, [r0] + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0x63 + beq _0808546E + mov r5, sp + movs r0, 0 + mov r9, r0 +_080853EE: + ldrh r0, [r7, 0x4] + adds r0, r4 + lsls r0, 16 + lsrs r0, 16 + ldr r1, _08085454 + ands r4, r1 + orrs r4, r0 + asrs r1, r4, 16 + ldrh r2, [r7, 0x6] + adds r1, r2 + lsls r1, 16 + ldr r0, _08085458 + ands r4, r0 + orrs r4, r1 + lsls r0, r4, 16 + asrs r0, 16 + asrs r1, r4, 16 + bl sub_804954C + adds r1, r0, 0 + mov r0, r8 + bl sub_807034C + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _0808545C + mov r0, r8 + strh r0, [r5] + movs r0, 0x1 + strh r0, [r5, 0x8] + movs r0, 0x2 + strb r0, [r5, 0x2] + str r4, [sp, 0xC] + str r1, [sp, 0x4] + mov r1, r9 + strb r1, [r5, 0x10] + mov r0, sp + movs r1, 0x1 + bl sub_806B7F8 + b _0808546E + .align 2, 0 +_08085444: .4byte gUnknown_203B418 +_08085448: .4byte 0x0001357c +_0808544C: .4byte 0x0000065c +_08085450: .4byte gUnknown_80F4598 +_08085454: .4byte 0xffff0000 +_08085458: .4byte 0x0000ffff +_0808545C: + adds r6, 0x1 + ldr r0, _0808547C + lsls r1, r6, 2 + adds r1, r0 + ldr r4, [r1] + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0x63 + bne _080853EE +_0808546E: + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0808547C: .4byte gUnknown_80F4598 + thumb_func_end sub_8085374 + + thumb_func_start sub_8085480 +sub_8085480: + push {lr} + bl sub_8083600 + pop {r1} + bx r1 + thumb_func_end sub_8085480 + + thumb_func_start sub_808548C +sub_808548C: + push {r4,r5,lr} + movs r5, 0 +_08085490: + ldr r0, _080854B8 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _080854BC + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080854C0 + ldr r0, [r4, 0x70] + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x41 + bne _080854C0 + adds r0, r4, 0 + b _080854CC + .align 2, 0 +_080854B8: .4byte gUnknown_203B418 +_080854BC: .4byte 0x0001357c +_080854C0: + adds r5, 0x1 + cmp r5, 0x3 + ble _08085490 + movs r0, 0x2 + bl sub_8085680 +_080854CC: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_808548C + + thumb_func_start sub_80854D4 +sub_80854D4: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x20 + movs r6, 0 + movs r5, 0 + add r0, sp, 0x10 + mov r8, r0 + mov r7, sp +_080854E6: + ldr r0, _080855D8 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _080855DC + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08085504 + stm r7!, {r4} + adds r6, 0x1 +_08085504: + adds r5, 0x1 + cmp r5, 0x3 + ble _080854E6 + cmp r6, 0x3 + bgt _0808551C + movs r1, 0 + lsls r0, r6, 2 + add r0, sp +_08085514: + stm r0!, {r1} + adds r6, 0x1 + cmp r6, 0x3 + ble _08085514 +_0808551C: + movs r6, 0 + movs r4, 0 + mov r2, sp + mov r3, r8 + movs r5, 0x3 +_08085526: + ldr r1, [r2] + cmp r1, 0 + beq _0808553A + ldr r0, [r1, 0x70] + ldrb r0, [r0, 0x7] + cmp r0, 0 + beq _0808553A + str r4, [r2] + stm r3!, {r1} + adds r6, 0x1 +_0808553A: + adds r2, 0x4 + subs r5, 0x1 + cmp r5, 0 + bge _08085526 + movs r4, 0 + mov r2, sp + lsls r0, r6, 2 + mov r1, r8 + adds r3, r0, r1 + movs r5, 0x3 +_0808554E: + ldr r1, [r2] + cmp r1, 0 + beq _08085564 + ldr r0, [r1, 0x70] + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x41 + bne _08085564 + str r4, [r2] + stm r3!, {r1} + adds r6, 0x1 +_08085564: + adds r2, 0x4 + subs r5, 0x1 + cmp r5, 0 + bge _0808554E + movs r3, 0 + mov r2, sp + lsls r0, r6, 2 + add r0, r8 + movs r5, 0x3 +_08085576: + ldr r1, [r2] + cmp r1, 0 + beq _08085582 + str r3, [r2] + stm r0!, {r1} + adds r6, 0x1 +_08085582: + adds r2, 0x4 + subs r5, 0x1 + cmp r5, 0 + bge _08085576 + cmp r6, 0x3 + bgt _0808559C + movs r1, 0 + lsls r0, r6, 2 + add r0, r8 +_08085594: + stm r0!, {r1} + adds r6, 0x1 + cmp r6, 0x3 + ble _08085594 +_0808559C: + movs r5, 0 + mov r4, r8 +_080855A0: + lsls r1, r5, 2 + ldr r3, [r4] + cmp r3, 0 + beq _080855C4 + ldr r0, _080855D8 + ldr r0, [r0] + adds r0, r1 + ldr r2, _080855E0 + adds r1, r0, r2 + movs r6, 0 + ldrsh r1, [r1, r6] + adds r2, 0x2 + adds r0, r2 + movs r6, 0 + ldrsh r2, [r0, r6] + adds r0, r3, 0 + bl sub_80856C8 +_080855C4: + adds r4, 0x4 + adds r5, 0x1 + cmp r5, 0x3 + ble _080855A0 + add sp, 0x20 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080855D8: .4byte gUnknown_203B418 +_080855DC: .4byte 0x0001357c +_080855E0: .4byte 0x0000e220 + thumb_func_end sub_80854D4 + + thumb_func_start sub_80855E4 +sub_80855E4: + push {r4-r7,lr} + adds r6, r0, 0 + movs r7, 0 + movs r5, 0 +_080855EC: + ldr r0, _08085634 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _08085638 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08085618 + ldr r0, [r4, 0x70] + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x41 + bne _08085612 + movs r7, 0x1 +_08085612: + adds r0, r4, 0 + bl _call_via_r6 +_08085618: + adds r5, 0x1 + cmp r5, 0x3 + ble _080855EC + cmp r7, 0 + bne _0808562E + bl sub_808548C + cmp r0, 0 + beq _0808562E + bl _call_via_r6 +_0808562E: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08085634: .4byte gUnknown_203B418 +_08085638: .4byte 0x0001357c + thumb_func_end sub_80855E4 + + thumb_func_start sub_808563C +sub_808563C: + push {r4-r6,lr} + adds r6, r0, 0 + movs r5, 0 +_08085642: + ldr r0, _08085678 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _0808567C + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0808566C + ldr r0, [r4, 0x70] + adds r0, 0x40 + ldrb r0, [r0] + cmp r0, 0x41 + beq _0808566C + adds r0, r4, 0 + bl _call_via_r6 +_0808566C: + adds r5, 0x1 + cmp r5, 0xF + ble _08085642 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08085678: .4byte gUnknown_203B418 +_0808567C: .4byte 0x0001358c + thumb_func_end sub_808563C + + thumb_func_start sub_8085680 +sub_8085680: + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 +_08085688: + ldr r0, _080856B0 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _080856B4 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080856B8 + ldr r0, [r4, 0x70] + adds r0, 0xA4 + ldrb r0, [r0] + cmp r0, r6 + bne _080856B8 + adds r0, r4, 0 + b _080856C0 + .align 2, 0 +_080856B0: .4byte gUnknown_203B418 +_080856B4: .4byte 0x000135cc +_080856B8: + adds r5, 0x1 + cmp r5, 0x13 + ble _08085688 + movs r0, 0 +_080856C0: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8085680 + + thumb_func_start sub_80856C8 +sub_80856C8: + push {r4,lr} + adds r4, r0, 0 + movs r3, 0x1 + bl sub_80694C0 + adds r0, r4, 0 + movs r1, 0 + bl sub_804535C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80856C8 + + thumb_func_start sub_80856E0 +sub_80856E0: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + adds r7, r1, 0 + ldr r0, [r6, 0x70] + mov r8, r0 + adds r0, r6, 0 + movs r1, 0x6 + adds r2, r7, 0 + bl sub_80861D4 + movs r5, 0xBA + lsls r5, 1 + add r5, r8 + movs r4, 0x4 +_08085700: + ldr r0, [r5] + movs r1, 0x80 + lsls r1, 2 + adds r0, r1 + str r0, [r5] + movs r0, 0x46 + bl sub_803E46C + subs r4, 0x1 + cmp r4, 0 + bge _08085700 + movs r1, 0x7 + adds r0, r7, 0 + ands r0, r1 + mov r1, r8 + adds r1, 0x46 + strb r0, [r1] + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_806CE68 + movs r5, 0xBA + lsls r5, 1 + add r5, r8 + movs r4, 0x4 +_08085732: + ldr r0, [r5] + ldr r1, _08085760 + adds r0, r1 + str r0, [r5] + movs r0, 0x46 + bl sub_803E46C + subs r4, 0x1 + cmp r4, 0 + bge _08085732 + movs r1, 0xBA + lsls r1, 1 + add r1, r8 + movs r0, 0 + str r0, [r1] + movs r0, 0x46 + bl sub_803E46C + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08085760: .4byte 0xfffffe00 + thumb_func_end sub_80856E0 + + thumb_func_start sub_8085764 +sub_8085764: + push {r4,r5,lr} + sub sp, 0x74 + mov r0, sp + bl sub_80457DC + movs r5, 0 +_08085770: + ldr r0, _080857AC + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _080857B0 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0808579E + ldr r0, [r4, 0x70] + adds r0, 0xA4 + ldrb r0, [r0] + cmp r0, 0x2 + bne _0808579E + adds r0, r4, 0 + ldr r1, _080857B4 + mov r2, sp + bl sub_8068FE0 +_0808579E: + adds r5, 0x1 + cmp r5, 0xF + ble _08085770 + add sp, 0x74 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080857AC: .4byte gUnknown_203B418 +_080857B0: .4byte 0x0001358c +_080857B4: .4byte 0x00000207 + thumb_func_end sub_8085764 + + thumb_func_start sub_80857B8 +sub_80857B8: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r7, 0 + ldr r0, _08085854 + mov r9, r0 + ldr r1, _08085858 + mov r8, r1 +_080857CA: + mov r2, r9 + ldr r0, [r2] + lsls r1, r7, 2 + ldr r3, _0808585C + adds r0, r3 + adds r0, r1 + ldr r6, [r0] + adds r0, r6, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08085840 + ldr r5, [r6, 0x70] + mov r0, r9 + ldr r1, [r0] + ldrb r0, [r1, 0x4] + cmp r0, 0 + bne _08085840 + ldrb r4, [r1, 0x2] + cmp r4, 0 + bne _08085840 + adds r0, r6, 0 + movs r1, 0 + bl sub_804535C + movs r1, 0xAE + lsls r1, 1 + adds r0, r5, r1 + strb r4, [r0] + adds r1, r5, 0 + adds r1, 0xFE + movs r0, 0x63 + strb r0, [r1] + adds r2, r5, 0 + adds r2, 0x46 + ldrb r0, [r2] + lsls r0, 2 + add r0, r8 + ldrh r1, [r6, 0x4] + ldrh r0, [r0] + adds r1, r0 + movs r3, 0xB6 + lsls r3, 1 + adds r0, r5, r3 + strh r1, [r0] + ldrb r0, [r2] + lsls r0, 2 + add r0, r8 + ldrh r1, [r6, 0x6] + ldrh r0, [r0, 0x2] + adds r1, r0 + adds r3, 0x2 + adds r0, r5, r3 + strh r1, [r0] + ldrb r1, [r2] + adds r0, r6, 0 + bl sub_806CE68 +_08085840: + adds r7, 0x1 + cmp r7, 0x13 + ble _080857CA + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08085854: .4byte gUnknown_203B418 +_08085858: .4byte gUnknown_80F4448 +_0808585C: .4byte 0x000135cc + thumb_func_end sub_80857B8 + + thumb_func_start sub_8085860 +sub_8085860: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0 + bl sub_803F4A0 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 11 + movs r1, 0xC0 + lsls r1, 4 + adds r0, r1 + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 11 + movs r2, 0x80 + lsls r2, 5 + adds r1, r2 + bl sub_803F878 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8085860 + + thumb_func_start sub_8085890 +sub_8085890: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0 + bl sub_803F4A0 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_803F878 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8085890 + + thumb_func_start sub_80858AC +sub_80858AC: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r7, r0, 0 + adds r4, r1, 0 + bl sub_803F994 + adds r6, r0, 0 + bl sub_803F9B0 + adds r5, r0, 0 + ldr r0, [r7] + subs r0, r6 + adds r1, r4, 0 + bl __divsi3 + mov r9, r0 + ldr r0, [r7, 0x4] + subs r0, r5 + adds r1, r4, 0 + bl __divsi3 + mov r8, r0 + movs r0, 0 + bl sub_803F4A0 + cmp r4, 0 + ble _080858FE +_080858E6: + add r6, r9 + add r5, r8 + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_803F878 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0x1 + cmp r4, 0 + bne _080858E6 +_080858FE: + ldr r0, [r7] + ldr r1, [r7, 0x4] + bl sub_803F878 + movs r0, 0x46 + bl sub_803E46C + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80858AC + + thumb_func_start sub_8085918 +sub_8085918: + push {r4,lr} + ldr r3, [r0, 0x70] + movs r4, 0x7 + adds r2, r1, 0 + ands r2, r4 + adds r3, 0x46 + strb r2, [r3] + bl sub_806CE68 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8085918 + + thumb_func_start sub_8085930 +sub_8085930: + push {r4-r7,lr} + adds r6, r0, 0 + movs r5, 0 + movs r0, 0x7 + adds r7, r6, 0 + ands r7, r0 +_0808593C: + ldr r0, _0808596C + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _08085970 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08085982 + cmp r6, 0x7 + ble _08085974 + movs r0, 0x8 + bl RandomCapped + adds r1, r0, 0 + adds r0, r4, 0 + bl sub_806CE68 + b _08085982 + .align 2, 0 +_0808596C: .4byte gUnknown_203B418 +_08085970: .4byte 0x0001357c +_08085974: + ldr r0, [r4, 0x70] + adds r0, 0x46 + strb r7, [r0] + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_806CE68 +_08085982: + adds r5, 0x1 + cmp r5, 0x3 + ble _0808593C + movs r5, 0 + movs r0, 0x7 + adds r7, r6, 0 + ands r7, r0 +_08085990: + ldr r0, _080859CC + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _080859D0 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080859E2 + ldr r1, [r4, 0x70] + adds r0, r1, 0 + adds r0, 0xA4 + ldrb r0, [r0] + cmp r0, 0x2 + bne _080859E2 + cmp r6, 0x7 + ble _080859D4 + movs r0, 0x8 + bl RandomCapped + adds r1, r0, 0 + adds r0, r4, 0 + bl sub_806CE68 + b _080859E2 + .align 2, 0 +_080859CC: .4byte gUnknown_203B418 +_080859D0: .4byte 0x0001358c +_080859D4: + adds r0, r1, 0 + adds r0, 0x46 + strb r7, [r0] + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_806CE68 +_080859E2: + adds r5, 0x1 + cmp r5, 0xF + ble _08085990 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8085930 + + thumb_func_start sub_80859F0 +sub_80859F0: + push {r4-r7,lr} + adds r6, r0, 0 + movs r5, 0 + movs r0, 0x7 + adds r7, r6, 0 + ands r7, r0 +_080859FC: + ldr r0, _08085A2C + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _08085A30 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08085A42 + cmp r6, 0x7 + ble _08085A34 + movs r0, 0x8 + bl RandomCapped + adds r1, r0, 0 + adds r0, r4, 0 + bl sub_806CE68 + b _08085A42 + .align 2, 0 +_08085A2C: .4byte gUnknown_203B418 +_08085A30: .4byte 0x0001358c +_08085A34: + ldr r0, [r4, 0x70] + adds r0, 0x46 + strb r7, [r0] + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_806CE68 +_08085A42: + adds r5, 0x1 + cmp r5, 0xF + ble _080859FC + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80859F0 + + thumb_func_start sub_8085A50 +sub_8085A50: + push {lr} + ldr r0, [r0, 0x70] + adds r0, 0xA4 + ldrb r0, [r0] + cmp r0, 0x24 + bhi _08085B04 + lsls r0, 2 + ldr r1, _08085A68 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08085A68: .4byte _08085A6C + .align 2, 0 +_08085A6C: + .4byte _08085B04 + .4byte _08085B00 + .4byte _08085B04 + .4byte _08085B00 + .4byte _08085B04 + .4byte _08085B00 + .4byte _08085B00 + .4byte _08085B00 + .4byte _08085B00 + .4byte _08085B00 + .4byte _08085B04 + .4byte _08085B04 + .4byte _08085B04 + .4byte _08085B00 + .4byte _08085B00 + .4byte _08085B00 + .4byte _08085B00 + .4byte _08085B00 + .4byte _08085B00 + .4byte _08085B00 + .4byte _08085B00 + .4byte _08085B00 + .4byte _08085B00 + .4byte _08085B00 + .4byte _08085B00 + .4byte _08085B00 + .4byte _08085B00 + .4byte _08085B00 + .4byte _08085B00 + .4byte _08085B00 + .4byte _08085B00 + .4byte _08085B00 + .4byte _08085B00 + .4byte _08085B00 + .4byte _08085B00 + .4byte _08085B00 + .4byte _08085B00 +_08085B00: + movs r0, 0x1 + b _08085B06 +_08085B04: + movs r0, 0 +_08085B06: + pop {r1} + bx r1 + thumb_func_end sub_8085A50 + + thumb_func_start sub_8085B0C +sub_8085B0C: + push {r4,r5,lr} + sub sp, 0x1C + adds r5, r0, 0 + ldr r1, _08085B48 + mov r0, sp + movs r2, 0x19 + bl memcpy + mov r0, sp + ldrb r0, [r0] + cmp r0, 0 + beq _08085B3E + mov r4, sp +_08085B26: + ldrb r1, [r4] + adds r0, r5, 0 + bl sub_8085918 + movs r0, 0x6 + movs r1, 0x46 + bl sub_803E708 + adds r4, 0x1 + ldrb r0, [r4] + cmp r0, 0 + bne _08085B26 +_08085B3E: + add sp, 0x1C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08085B48: .4byte gUnknown_8107358 + thumb_func_end sub_8085B0C + + thumb_func_start sub_8085B4C +sub_8085B4C: + push {r4-r6,lr} + adds r5, r0, 0 + ldr r0, _08085B7C + str r3, [r0] + cmp r3, 0 + ble _08085B76 + movs r6, 0x1 + adds r4, r1, 0 + adds r1, r5, 0 +_08085B5E: + strb r6, [r1] + ldm r2!, {r0} + str r0, [r1, 0x4] + ldm r4!, {r0} + str r0, [r1, 0xC] + movs r5, 0x4 + ldrsh r0, [r0, r5] + str r0, [r1, 0x8] + adds r1, 0x10 + subs r3, 0x1 + cmp r3, 0 + bne _08085B5E +_08085B76: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08085B7C: .4byte gUnknown_202F3D8 + thumb_func_end sub_8085B4C + + thumb_func_start sub_8085B80 +sub_8085B80: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r1, r0, 0 + movs r0, 0 + mov r8, r0 + movs r7, 0 + ldr r0, _08085BE4 + ldr r0, [r0] + cmp r8, r0 + bge _08085C3E + adds r5, r1, 0 +_08085B98: + ldr r6, [r5, 0x4] + ldr r2, [r6, 0x70] + adds r3, r2, 0 + ldr r4, [r5, 0xC] + ldrb r0, [r5] + cmp r0, 0 + beq _08085C32 + movs r1, 0x1 + mov r8, r1 + ldr r0, [r5, 0x8] + cmp r0, 0 + bne _08085C08 + adds r4, 0x8 + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0 + bne _08085BE8 + strb r0, [r5] + ldrb r1, [r4] + movs r0, 0x7 + ands r0, r1 + adds r1, r2, 0 + adds r1, 0x46 + strb r0, [r1] + movs r3, 0 + ldrsh r2, [r4, r3] + adds r0, r6, 0 + movs r1, 0x7 + bl sub_806CDD4 + movs r0, 0xA + ldrsh r1, [r4, r0] + movs r3, 0xC + ldrsh r2, [r4, r3] + adds r0, r6, 0 + bl sub_80856C8 + b _08085C32 + .align 2, 0 +_08085BE4: .4byte gUnknown_202F3D8 +_08085BE8: + movs r1, 0x4 + ldrsh r0, [r4, r1] + str r0, [r5, 0x8] + str r4, [r5, 0xC] + ldrb r1, [r4] + movs r0, 0x7 + ands r0, r1 + adds r1, r3, 0 + adds r1, 0x46 + strb r0, [r1] + movs r3, 0 + ldrsh r2, [r4, r3] + adds r0, r6, 0 + movs r1, 0 + bl sub_806CDD4 +_08085C08: + ldr r0, [r5, 0x8] + subs r0, 0x1 + str r0, [r5, 0x8] + ldr r1, _08085C4C + movs r2, 0 + ldrsh r0, [r4, r2] + lsls r0, 2 + adds r0, r1 + movs r3, 0 + ldrsh r1, [r0, r3] + movs r3, 0x2 + ldrsh r2, [r4, r3] + muls r1, r2 + lsls r1, 8 + movs r3, 0x2 + ldrsh r0, [r0, r3] + muls r2, r0 + lsls r2, 8 + adds r0, r6, 0 + bl sub_804539C +_08085C32: + adds r5, 0x10 + adds r7, 0x1 + ldr r0, _08085C50 + ldr r0, [r0] + cmp r7, r0 + blt _08085B98 +_08085C3E: + mov r0, r8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08085C4C: .4byte gUnknown_80F4448 +_08085C50: .4byte gUnknown_202F3D8 + thumb_func_end sub_8085B80 + + thumb_func_start sub_8085C54 +sub_8085C54: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + str r0, [sp, 0x14] + mov r10, r1 + mov r9, r2 + ldr r4, [sp, 0x48] + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x18] + lsls r4, 24 + lsrs r4, 24 + bl sub_8085E98 + movs r0, 0 + mov r8, r0 + ldr r0, _08085E70 + ldr r0, [r0] + ldr r5, [r0, 0x4] + cmp r4, 0 + beq _08085CAE + ldr r1, [sp, 0x14] + cmp r1, 0 + blt _08085C92 + lsrs r0, r1, 31 + adds r0, r1, r0 + asrs r0, 1 + str r0, [sp, 0x14] +_08085C92: + mov r2, r10 + cmp r2, 0 + blt _08085CA0 + lsrs r0, r2, 31 + add r0, r10 + asrs r0, 1 + mov r10, r0 +_08085CA0: + mov r3, r9 + cmp r3, 0 + blt _08085CAE + lsrs r0, r3, 31 + add r0, r9 + asrs r0, 1 + mov r9, r0 +_08085CAE: + ldr r1, _08085E74 + ldr r0, [sp, 0x8] + ands r0, r1 + ldr r1, _08085E78 + ands r0, r1 + ldr r1, _08085E7C + ands r0, r1 + str r0, [sp, 0x8] + ldr r0, _08085E80 + ldr r2, [r0] + ldr r0, _08085E84 + ldr r3, [r0] + movs r0, 0xBE + lsls r0, 1 + adds r3, r0 + mov r0, r8 + add r1, sp, 0x8 + bl SetBGPaletteBufferColorRGB + adds r5, 0x4 + movs r1, 0x1 + add r8, r1 + ldr r2, [sp, 0x14] + lsls r2, 16 + str r2, [sp, 0x1C] + mov r3, r10 + lsls r3, 16 + str r3, [sp, 0x20] + mov r0, r9 + lsls r0, 16 + str r0, [sp, 0x24] + add r7, sp, 0xC + movs r1, 0xA0 + cmp r1, 0x1 + ble _08085D56 + add r6, sp, 0x8 + movs r4, 0xA0 + subs r4, 0x1 +_08085CFA: + ldrb r0, [r5] + ldr r3, [sp, 0x14] + adds r2, r0, r3 + ldrb r0, [r5, 0x1] + mov r3, r10 + adds r1, r0, r3 + ldrb r0, [r5, 0x2] + add r0, r9 + cmp r2, 0xFF + ble _08085D10 + movs r2, 0xFF +_08085D10: + cmp r1, 0xFF + ble _08085D16 + movs r1, 0xFF +_08085D16: + cmp r0, 0xFF + ble _08085D1C + movs r0, 0xFF +_08085D1C: + cmp r2, 0 + bge _08085D22 + movs r2, 0 +_08085D22: + cmp r1, 0 + bge _08085D28 + movs r1, 0 +_08085D28: + cmp r0, 0 + bge _08085D2E + movs r0, 0 +_08085D2E: + strb r2, [r6] + strb r1, [r6, 0x1] + strb r0, [r6, 0x2] + ldr r0, _08085E80 + ldr r2, [r0] + ldr r0, _08085E84 + ldr r3, [r0] + movs r0, 0xBE + lsls r0, 1 + adds r3, r0 + mov r0, r8 + add r1, sp, 0x8 + bl SetBGPaletteBufferColorRGB + adds r5, 0x4 + movs r1, 0x1 + add r8, r1 + subs r4, 0x1 + cmp r4, 0 + bne _08085CFA +_08085D56: + ldr r2, _08085E88 + ldr r3, [sp, 0x1C] + lsrs r0, r3, 16 + ldr r1, [sp, 0x20] + orrs r0, r1 + str r0, [sp, 0xC] + ldr r3, [sp, 0x24] + lsrs r1, r3, 16 + ldr r0, [r7, 0x4] + ands r0, r2 + orrs r0, r1 + str r0, [r7, 0x4] + ldr r0, _08085E8C + ldr r1, _08085E80 + ldr r3, [r1] + ldr r1, _08085E84 + ldr r1, [r1] + movs r2, 0xBE + lsls r2, 1 + adds r1, r2 + str r1, [sp] + str r7, [sp, 0x4] + movs r1, 0xA0 + movs r2, 0x20 + bl sub_8004C00 + movs r3, 0x20 + add r8, r3 + ldr r5, _08085E90 + add r6, sp, 0x8 + movs r4, 0x20 +_08085D94: + ldrb r0, [r5] + ldr r1, [sp, 0x14] + adds r2, r0, r1 + ldrb r0, [r5, 0x1] + mov r3, r10 + adds r1, r0, r3 + ldrb r0, [r5, 0x2] + add r0, r9 + cmp r2, 0xFF + ble _08085DAA + movs r2, 0xFF +_08085DAA: + cmp r1, 0xFF + ble _08085DB0 + movs r1, 0xFF +_08085DB0: + cmp r0, 0xFF + ble _08085DB6 + movs r0, 0xFF +_08085DB6: + cmp r2, 0 + bge _08085DBC + movs r2, 0 +_08085DBC: + cmp r1, 0 + bge _08085DC2 + movs r1, 0 +_08085DC2: + cmp r0, 0 + bge _08085DC8 + movs r0, 0 +_08085DC8: + strb r2, [r6] + strb r1, [r6, 0x1] + strb r0, [r6, 0x2] + ldr r0, _08085E80 + ldr r2, [r0] + ldr r7, _08085E84 + ldr r3, [r7] + movs r0, 0xBE + lsls r0, 1 + adds r3, r0 + mov r0, r8 + add r1, sp, 0x8 + bl SetBGPaletteBufferColorRGB + adds r5, 0x4 + movs r1, 0x1 + add r8, r1 + subs r4, 0x1 + cmp r4, 0 + bne _08085D94 + ldr r2, [sp, 0x18] + cmp r2, 0 + beq _08085E5E + ldr r0, [r7] + ldr r3, _08085E94 + adds r0, r3 + ldr r0, [r0] + ldr r5, [r0, 0x4] + movs r0, 0x80 + lsls r0, 1 + mov r8, r0 + add r6, sp, 0x8 + movs r4, 0xD0 +_08085E0A: + ldrb r0, [r5] + ldr r1, [sp, 0x14] + adds r2, r0, r1 + ldrb r0, [r5, 0x1] + mov r3, r10 + adds r1, r0, r3 + ldrb r0, [r5, 0x2] + add r0, r9 + cmp r2, 0xFF + ble _08085E20 + movs r2, 0xFF +_08085E20: + cmp r1, 0xFF + ble _08085E26 + movs r1, 0xFF +_08085E26: + cmp r0, 0xFF + ble _08085E2C + movs r0, 0xFF +_08085E2C: + cmp r2, 0 + bge _08085E32 + movs r2, 0 +_08085E32: + cmp r1, 0 + bge _08085E38 + movs r1, 0 +_08085E38: + cmp r0, 0 + bge _08085E3E + movs r0, 0 +_08085E3E: + strb r2, [r6] + strb r1, [r6, 0x1] + strb r0, [r6, 0x2] + ldr r0, _08085E80 + ldr r2, [r0] + mov r0, r8 + add r1, sp, 0x8 + movs r3, 0 + bl SetBGPaletteBufferColorRGB + adds r5, 0x4 + movs r0, 0x1 + add r8, r0 + subs r4, 0x1 + cmp r4, 0 + bne _08085E0A +_08085E5E: + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08085E70: .4byte gUnknown_202EE88 +_08085E74: .4byte 0xffffff00 +_08085E78: .4byte 0xffff00ff +_08085E7C: .4byte 0xff00ffff +_08085E80: .4byte gUnknown_202EDC8 +_08085E84: .4byte gUnknown_203B418 +_08085E88: .4byte 0xffff0000 +_08085E8C: .4byte gUnknown_202EE8C +_08085E90: .4byte gUnknown_202ECA4 +_08085E94: .4byte 0x000181e4 + thumb_func_end sub_8085C54 + + thumb_func_start sub_8085E98 +sub_8085E98: + ldr r0, _08085EA8 + ldr r0, [r0] + ldr r1, _08085EAC + adds r0, r1 + movs r1, 0 + strb r1, [r0] + bx lr + .align 2, 0 +_08085EA8: .4byte gUnknown_203B418 +_08085EAC: .4byte 0x00018215 + thumb_func_end sub_8085E98 + + thumb_func_start sub_8085EB0 +sub_8085EB0: + ldr r0, _08085EC0 + ldr r0, [r0] + ldr r1, _08085EC4 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + bx lr + .align 2, 0 +_08085EC0: .4byte gUnknown_203B418 +_08085EC4: .4byte 0x00018215 + thumb_func_end sub_8085EB0 + + thumb_func_start sub_8085EC8 +sub_8085EC8: + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x28 + adds r4, r0, 0 + mov r8, r1 + mov r9, r2 + adds r6, r3, 0 + ldr r5, [sp, 0x40] + lsls r4, 16 + asrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + adds r0, r4, 0 + bl sub_800EE5C + bl sub_800EF64 + movs r0, 0x46 + bl sub_803E46C + str r4, [sp] + mov r0, r8 + str r0, [sp, 0x4] + mov r2, r9 + str r2, [sp, 0x8] + mov r1, sp + ldrh r0, [r6] + movs r2, 0 + strh r0, [r1, 0xC] + ldrh r0, [r6, 0x2] + strh r0, [r1, 0xE] + mov r0, sp + strh r2, [r0, 0x10] + strh r2, [r0, 0x12] + ldr r0, _08085F3C + str r0, [sp, 0x18] + add r1, sp, 0x1C + ldr r0, _08085F40 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + mov r0, sp + bl sub_800E890 + cmp r5, 0 + beq _08085F2E + bl sub_8085F44 + movs r0, 0x1 + negs r0, r0 +_08085F2E: + add sp, 0x28 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08085F3C: .4byte 0x0000ffff +_08085F40: .4byte gUnknown_8107374 + thumb_func_end sub_8085EC8 + + thumb_func_start sub_8085F44 +sub_8085F44: + push {r4,lr} + adds r4, r0, 0 + b _08085F5C +_08085F4A: + ldr r0, _08085F70 + ldr r0, [r0] + ldr r1, _08085F74 + adds r0, r1 + bl sub_800E90C + movs r0, 0x46 + bl sub_803E46C +_08085F5C: + adds r0, r4, 0 + bl sub_800E9A8 + lsls r0, 24 + cmp r0, 0 + bne _08085F4A + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08085F70: .4byte gUnknown_203B418 +_08085F74: .4byte 0x000181f0 + thumb_func_end sub_8085F44 + + thumb_func_start sub_8085F78 +sub_8085F78: + push {lr} + ldr r0, _08085F94 + ldr r0, [r0] + ldr r1, _08085F98 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x3C + bls _08085F8A + b _080860A4 +_08085F8A: + lsls r0, 2 + ldr r1, _08085F9C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08085F94: .4byte gUnknown_203B418 +_08085F98: .4byte 0x00003a0d +_08085F9C: .4byte _08085FA0 + .align 2, 0 +_08085FA0: + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _08086094 + .4byte _08086094 + .4byte _08086094 + .4byte _0808609A + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A0 + .4byte _080860A0 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 + .4byte _080860A4 +_08086094: + bl sub_8088848 + b _080860A4 +_0808609A: + bl sub_8088EE8 + b _080860A4 +_080860A0: + bl sub_808A718 +_080860A4: + pop {r0} + bx r0 + thumb_func_end sub_8085F78 + + thumb_func_start sub_80860A8 +sub_80860A8: + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + ldr r0, _08086108 + ldr r2, [r0] + movs r3, 0x1 +_080860B6: + ldrb r1, [r2] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _080860C6 + ldrb r0, [r2, 0x2] + cmp r0, r6 + beq _08086104 +_080860C6: + adds r2, 0x4 + adds r5, 0x1 + cmp r5, 0x13 + ble _080860B6 + movs r5, 0 +_080860D0: + ldr r0, _0808610C + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _08086110 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08086114 + ldr r2, [r4, 0x70] + adds r0, r2, 0 + adds r0, 0x60 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08086114 + adds r0, r2, 0 + adds r0, 0x62 + ldrb r0, [r0] + cmp r0, r6 + bne _08086114 +_08086104: + movs r0, 0x1 + b _0808611C + .align 2, 0 +_08086108: .4byte gUnknown_203B460 +_0808610C: .4byte gUnknown_203B418 +_08086110: .4byte 0x0001357c +_08086114: + adds r5, 0x1 + cmp r5, 0x3 + ble _080860D0 + movs r0, 0 +_0808611C: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80860A8 + + thumb_func_start sub_8086124 +sub_8086124: + ldr r0, [r0, 0x70] + movs r2, 0xB0 + lsls r2, 1 + adds r0, r2 + strb r1, [r0] + bx lr + thumb_func_end sub_8086124 + + thumb_func_start sub_8086130 +sub_8086130: + push {lr} + movs r0, 0x3C + bl sub_8083ED8 + movs r0, 0x3C + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08086194 + ldr r0, [r0] + bl sub_8052FB8 + movs r0, 0x1E + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08086198 + ldr r0, [r0] + bl sub_8052FB8 + movs r0, 0x1E + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808619C + ldr r0, [r0] + bl sub_8052FB8 + movs r0, 0x1E + movs r1, 0x46 + bl sub_803E708 + ldr r0, _080861A0 + ldr r0, [r0] + bl sub_8052FB8 + movs r0, 0x1E + movs r1, 0x46 + bl sub_803E708 + ldr r0, _080861A4 + ldr r0, [r0] + bl sub_8052FB8 + movs r0, 0x1E + movs r1, 0x46 + bl sub_803E708 + pop {r0} + bx r0 + .align 2, 0 +_08086194: .4byte gUnknown_810665C +_08086198: .4byte gUnknown_810668C +_0808619C: .4byte gUnknown_81066D4 +_080861A0: .4byte gUnknown_81066F0 +_080861A4: .4byte gUnknown_810671C + thumb_func_end sub_8086130 + + thumb_func_start sub_80861A8 +sub_80861A8: + push {lr} + movs r1, 0 + movs r2, 0x8 + bl sub_806CDD4 + pop {r0} + bx r0 + thumb_func_end sub_80861A8 + + thumb_func_start sub_80861B8 +sub_80861B8: + push {r4,r5,lr} + adds r4, r1, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, [r0, 0x70] + adds r1, r4, 0 + bl sub_806CDD4 + adds r5, 0xFE + strb r4, [r5] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80861B8 + + thumb_func_start sub_80861D4 +sub_80861D4: + push {r4,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r1, 24 + bl sub_806CDD4 + adds r0, r4, 0 + bl sub_80861EC + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80861D4 + + thumb_func_start sub_80861EC +sub_80861EC: + ldr r0, [r0, 0x70] + adds r0, 0xFE + movs r1, 0x63 + strb r1, [r0] + bx lr + thumb_func_end sub_80861EC + + thumb_func_start sub_80861F8 +sub_80861F8: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + adds r6, r1, 0 + lsls r0, 16 + asrs r0, 16 + adds r5, r0, 0 + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + bl sub_800EE5C + bl sub_800EF64 + movs r0, 0x46 + bl sub_803E46C + ldr r0, [r6, 0x70] + mov r8, r0 + movs r1, 0 + mov r9, r1 + str r1, [sp, 0x28] + adds r0, r5, 0 + bl sub_800E700 + adds r7, r0, 0 + add r4, sp, 0x28 + movs r2, 0x1 + negs r2, r2 + cmp r7, r2 + beq _0808624A + adds r1, r6, 0 + adds r1, 0x28 + lsls r2, r7, 24 + lsrs r2, 24 + adds r0, r4, 0 + bl sub_800569C +_0808624A: + str r5, [sp] + mov r3, r9 + str r3, [sp, 0x4] + mov r0, r8 + adds r0, 0x46 + ldrb r0, [r0] + str r0, [sp, 0x8] + mov r1, sp + ldr r0, [r6, 0xC] + cmp r0, 0 + bge _08086262 + adds r0, 0xFF +_08086262: + asrs r0, 8 + strh r0, [r1, 0xC] + mov r1, sp + ldr r0, [r6, 0x10] + cmp r0, 0 + bge _08086270 + adds r0, 0xFF +_08086270: + asrs r0, 8 + strh r0, [r1, 0xE] + mov r1, sp + ldrh r0, [r4] + strh r0, [r1, 0x10] + add r0, sp, 0x28 + ldrh r0, [r0, 0x2] + strh r0, [r1, 0x12] + str r7, [sp, 0x14] + ldr r0, _080862B4 + str r0, [sp, 0x18] + add r1, sp, 0x1C + ldr r0, _080862B8 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + mov r0, sp + bl sub_800E890 + mov r4, r10 + cmp r4, 0 + beq _080862A2 + bl sub_8085F44 + movs r0, 0x1 + negs r0, r0 +_080862A2: + add sp, 0x2C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080862B4: .4byte 0x0000ffff +_080862B8: .4byte gUnknown_8107380 + thumb_func_end sub_80861F8 + + thumb_func_start sub_80862BC +sub_80862BC: + push {r4,lr} + adds r4, r0, 0 + movs r0, 0xE8 + lsls r0, 1 + bl sub_8083E38 + ldr r0, _080862D8 + adds r1, r4, 0 + movs r2, 0 + bl sub_80861F8 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080862D8: .4byte 0x00000143 + thumb_func_end sub_80862BC + + thumb_func_start sub_80862DC +sub_80862DC: + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r0, [r4, 0xC] + str r0, [sp] + ldr r0, [r4, 0x10] + movs r1, 0xE0 + lsls r1, 6 + adds r0, r1 + str r0, [sp, 0x4] + adds r0, r4, 0 + mov r1, sp + bl sub_804535C + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x4 + bl sub_806CDD4 + adds r0, r4, 0 + bl sub_8086A54 + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80862DC + + thumb_func_start sub_8086310 +sub_8086310: + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r0, [r4, 0xC] + str r0, [sp] + ldr r0, [r4, 0x10] + movs r1, 0x90 + lsls r1, 8 + adds r0, r1 + str r0, [sp, 0x4] + adds r0, r4, 0 + mov r1, sp + bl sub_804535C + adds r0, r4, 0 + movs r1, 0 + bl sub_806CE68 + adds r0, r4, 0 + bl sub_8086A3C + adds r4, 0x20 + movs r0, 0 + strb r0, [r4] + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8086310 + + thumb_func_start sub_8086348 +sub_8086348: + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r0, [r4, 0xC] + movs r1, 0xF0 + lsls r1, 7 + adds r0, r1 + str r0, [sp] + ldr r0, [r4, 0x10] + ldr r1, _08086380 + adds r0, r1 + str r0, [sp, 0x4] + adds r0, r4, 0 + mov r1, sp + bl sub_804535C + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x6 + bl sub_806CDD4 + adds r0, r4, 0 + bl sub_8086A54 + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08086380: .4byte 0xffffe000 + thumb_func_end sub_8086348 + + thumb_func_start sub_8086384 +sub_8086384: + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + ldr r0, [r4, 0xC] + movs r1, 0xF0 + lsls r1, 7 + adds r0, r1 + str r0, [sp] + ldr r0, [r4, 0x10] + str r0, [sp, 0x4] + adds r0, r4, 0 + mov r1, sp + bl sub_804535C + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x6 + bl sub_806CDD4 + adds r0, r4, 0 + bl sub_8086A54 + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8086384 + + thumb_func_start sub_80863B8 +sub_80863B8: + push {lr} + movs r1, 0 + movs r2, 0x4 + bl sub_806CDD4 + pop {r0} + bx r0 + thumb_func_end sub_80863B8 + + thumb_func_start sub_80863C8 +sub_80863C8: + push {lr} + movs r1, 0 + movs r2, 0 + bl sub_806CDD4 + pop {r0} + bx r0 + thumb_func_end sub_80863C8 + + thumb_func_start sub_80863D8 +sub_80863D8: + push {lr} + movs r1, 0 + movs r2, 0x6 + bl sub_806CDD4 + pop {r0} + bx r0 + thumb_func_end sub_80863D8 + + thumb_func_start sub_80863E8 +sub_80863E8: + push {lr} + movs r1, 0x6 + movs r2, 0x4 + bl sub_806CDD4 + pop {r0} + bx r0 + thumb_func_end sub_80863E8 + + thumb_func_start sub_80863F8 +sub_80863F8: + push {lr} + movs r1, 0x4 + bl sub_806CE68 + pop {r0} + bx r0 + thumb_func_end sub_80863F8 + + thumb_func_start sub_8086404 +sub_8086404: + push {lr} + movs r1, 0x6 + bl sub_806CE68 + pop {r0} + bx r0 + thumb_func_end sub_8086404 + + thumb_func_start sub_8086410 +sub_8086410: + push {lr} + ldr r2, _08086420 + movs r1, 0 + bl sub_804539C + pop {r0} + bx r0 + .align 2, 0 +_08086420: .4byte 0xffffff00 + thumb_func_end sub_8086410 + + thumb_func_start sub_8086424 +sub_8086424: + push {lr} + movs r2, 0x80 + lsls r2, 1 + movs r1, 0 + bl sub_804539C + pop {r0} + bx r0 + thumb_func_end sub_8086424 + + thumb_func_start sub_8086434 +sub_8086434: + push {lr} + ldr r1, _08086444 + movs r2, 0 + bl sub_804539C + pop {r0} + bx r0 + .align 2, 0 +_08086444: .4byte 0xffffff00 + thumb_func_end sub_8086434 + + thumb_func_start sub_8086448 +sub_8086448: + push {r4,r5,lr} + ldr r0, _08086488 + bl sub_80855E4 + movs r5, 0x37 +_08086452: + bl sub_803F994 + adds r4, r0, 0 + bl sub_803F9B0 + adds r1, r0, 0 + movs r0, 0x80 + lsls r0, 1 + adds r1, r0 + adds r0, r4, 0 + bl sub_803F878 + ldr r0, _0808648C + bl sub_80855E4 + movs r0, 0x46 + bl sub_803E46C + subs r5, 0x1 + cmp r5, 0 + bge _08086452 + ldr r0, _08086490 + bl sub_80855E4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08086488: .4byte sub_80862DC +_0808648C: .4byte sub_8086410 +_08086490: .4byte sub_80863F8 + thumb_func_end sub_8086448 + + thumb_func_start sub_8086494 +sub_8086494: + push {r4,lr} + movs r0, 0x3 + bl sub_8085930 + movs r0, 0x4 + movs r1, 0x46 + bl sub_803E708 + movs r0, 0x2 + bl sub_8085930 + movs r0, 0x4 + movs r1, 0x46 + bl sub_803E708 + movs r0, 0x1 + bl sub_8085930 + movs r0, 0x4 + movs r1, 0x46 + bl sub_803E708 + movs r0, 0 + bl sub_8085930 + movs r0, 0x4 + movs r1, 0x46 + bl sub_803E708 + ldr r0, _080864F4 + bl sub_80855E4 + movs r4, 0x8F +_080864D6: + ldr r0, _080864F8 + bl sub_80855E4 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0x1 + cmp r4, 0 + bge _080864D6 + ldr r0, _080864FC + bl sub_80855E4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080864F4: .4byte sub_80863C8 +_080864F8: .4byte sub_8086424 +_080864FC: .4byte sub_8086310 + thumb_func_end sub_8086494 + + thumb_func_start sub_8086500 +sub_8086500: + push {r4,r5,lr} + ldr r0, _08086540 + bl sub_80855E4 + movs r5, 0x47 +_0808650A: + bl sub_803F994 + adds r4, r0, 0 + movs r0, 0x80 + lsls r0, 1 + adds r4, r0 + bl sub_803F9B0 + adds r1, r0, 0 + adds r0, r4, 0 + bl sub_803F878 + ldr r0, _08086544 + bl sub_80855E4 + movs r0, 0x46 + bl sub_803E46C + subs r5, 0x1 + cmp r5, 0 + bge _0808650A + ldr r0, _08086548 + bl sub_80855E4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08086540: .4byte sub_8086348 +_08086544: .4byte sub_8086434 +_08086548: .4byte sub_8086404 + thumb_func_end sub_8086500 + + thumb_func_start sub_808654C +sub_808654C: + push {r4,r5,lr} + ldr r0, _0808658C + bl sub_80855E4 + movs r5, 0x77 +_08086556: + bl sub_803F994 + adds r4, r0, 0 + movs r0, 0x80 + lsls r0, 1 + adds r4, r0 + bl sub_803F9B0 + adds r1, r0, 0 + adds r0, r4, 0 + bl sub_803F878 + ldr r0, _08086590 + bl sub_80855E4 + movs r0, 0x46 + bl sub_803E46C + subs r5, 0x1 + cmp r5, 0 + bge _08086556 + ldr r0, _08086594 + bl sub_80855E4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808658C: .4byte sub_8086384 +_08086590: .4byte sub_8086434 +_08086594: .4byte sub_8086404 + thumb_func_end sub_808654C + + thumb_func_start sub_8086598 +sub_8086598: + push {r4,r5,lr} + ldr r0, _080865D8 + bl sub_80855E4 + movs r5, 0x17 +_080865A2: + bl sub_803F994 + adds r4, r0, 0 + bl sub_803F9B0 + adds r1, r0, 0 + ldr r0, _080865DC + adds r1, r0 + adds r0, r4, 0 + bl sub_803F878 + ldr r0, _080865E0 + bl sub_80855E4 + movs r0, 0x46 + bl sub_803E46C + subs r5, 0x1 + cmp r5, 0 + bge _080865A2 + ldr r0, _080865E4 + bl sub_80855E4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080865D8: .4byte sub_80863B8 +_080865DC: .4byte 0xffffff00 +_080865E0: .4byte sub_8086410 +_080865E4: .4byte sub_80863F8 + thumb_func_end sub_8086598 + + thumb_func_start sub_80865E8 +sub_80865E8: + push {r4-r6,lr} + ldr r0, _08086630 + bl sub_80855E4 + ldr r6, _08086634 + movs r5, 0xB +_080865F4: + bl sub_803F994 + adds r4, r0, 0 + bl sub_803F9B0 + adds r1, r0, 0 + movs r0, 0x80 + lsls r0, 2 + adds r1, r0 + adds r0, r4, 0 + bl sub_803F878 + adds r0, r6, 0 + bl sub_80855E4 + adds r0, r6, 0 + bl sub_80855E4 + movs r0, 0x46 + bl sub_803E46C + subs r5, 0x1 + cmp r5, 0 + bge _080865F4 + ldr r0, _08086638 + bl sub_80855E4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08086630: .4byte sub_80863E8 +_08086634: .4byte sub_8086424 +_08086638: .4byte sub_80863F8 + thumb_func_end sub_80865E8 + + thumb_func_start sub_808663C +sub_808663C: + push {r4-r6,lr} + ldr r0, _08086684 + bl sub_80855E4 + ldr r6, _08086688 + movs r5, 0xF +_08086648: + bl sub_803F994 + adds r4, r0, 0 + bl sub_803F9B0 + adds r1, r0, 0 + movs r0, 0x80 + lsls r0, 2 + adds r1, r0 + adds r0, r4, 0 + bl sub_803F878 + adds r0, r6, 0 + bl sub_80855E4 + adds r0, r6, 0 + bl sub_80855E4 + movs r0, 0x46 + bl sub_803E46C + subs r5, 0x1 + cmp r5, 0 + bge _08086648 + ldr r0, _0808668C + bl sub_80855E4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08086684: .4byte sub_80863E8 +_08086688: .4byte sub_8086424 +_0808668C: .4byte sub_80863F8 + thumb_func_end sub_808663C + + thumb_func_start sub_8086690 +sub_8086690: + push {r4,lr} + ldr r0, _080866B8 + bl sub_80855E4 + movs r4, 0x2F +_0808669A: + ldr r0, _080866BC + bl sub_80855E4 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0x1 + cmp r4, 0 + bge _0808669A + ldr r0, _080866C0 + bl sub_80855E4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080866B8: .4byte sub_80863D8 +_080866BC: .4byte sub_8086434 +_080866C0: .4byte sub_8086404 + thumb_func_end sub_8086690 + + thumb_func_start sub_80866C4 +sub_80866C4: + push {r4,lr} + adds r4, r0, 0 + bl sub_8085480 + bl sub_808696C + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r4, 0 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_8086494 + ldr r0, _080866F8 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x2] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080866F8: .4byte gUnknown_203B418 + thumb_func_end sub_80866C4 + + thumb_func_start sub_80866FC +sub_80866FC: + push {r4-r6,lr} + sub sp, 0x4 + movs r4, 0 + movs r6, 0 + movs r5, 0xFA + negs r5, r5 +_08086708: + str r6, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, r5 + bge _08086708 + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80866FC + + thumb_func_start sub_808672C +sub_808672C: + push {lr} + bl sub_803E748 + pop {r0} + bx r0 + thumb_func_end sub_808672C + + thumb_func_start sub_8086738 +sub_8086738: + push {r4,r5,lr} + sub sp, 0x4 + movs r4, 0 + movs r5, 0 +_08086740: + str r5, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + adds r4, 0xA + cmp r4, 0xF9 + ble _08086740 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8086738 + + thumb_func_start sub_8086764 +sub_8086764: + push {r4,r5,lr} + sub sp, 0x4 + movs r4, 0xFA + movs r5, 0 +_0808676C: + str r5, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0x5 + cmp r4, 0 + bge _0808676C + bl sub_8085EB0 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8086764 + + thumb_func_start sub_8086794 +sub_8086794: + push {r4,r5,lr} + sub sp, 0x4 + ldr r1, _080867A4 + movs r0, 0 + str r0, [r1] + movs r4, 0 + adds r5, r1, 0 + b _080867AA + .align 2, 0 +_080867A4: .4byte gUnknown_202EDC8 +_080867A8: + adds r4, 0x1 +_080867AA: + cmp r4, 0xC7 + bgt _080867D8 + movs r0, 0 + str r0, [sp] + movs r1, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_8085C54 + bl sub_803E9D0 + movs r0, 0x46 + bl sub_803E46C + movs r0, 0x3 + ands r0, r4 + cmp r0, 0 + bne _080867A8 + ldr r0, [r5] + adds r0, 0x1 + str r0, [r5] + cmp r0, 0x1F + bne _080867A8 +_080867D8: + movs r0, 0x46 + bl sub_803E46C + ldr r0, _080867F0 + ldr r1, [r0] + movs r0, 0 + strb r0, [r1, 0x7] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080867F0: .4byte gUnknown_203B418 + thumb_func_end sub_8086794 + + thumb_func_start sub_80867F4 +sub_80867F4: + ldr r1, _08086808 + movs r0, 0 + strb r0, [r1] + strb r0, [r1, 0x1] + strb r0, [r1, 0x2] + strb r0, [r1, 0x3] + strb r0, [r1, 0x4] + strb r0, [r1, 0x5] + bx lr + .align 2, 0 +_08086808: .4byte gUnknown_202F3D0 + thumb_func_end sub_80867F4 + + thumb_func_start sub_808680C +sub_808680C: + push {lr} + ldr r0, _08086824 + movs r1, 0x1 + strb r1, [r0] + ldrb r0, [r0, 0x3] + cmp r0, 0 + beq _08086820 + ldr r0, _08086828 + bl sub_8083E38 +_08086820: + pop {r0} + bx r0 + .align 2, 0 +_08086824: .4byte gUnknown_202F3D0 +_08086828: .4byte 0x000001f9 + thumb_func_end sub_808680C + + thumb_func_start sub_808682C +sub_808682C: + ldr r1, _08086834 + movs r0, 0 + strb r0, [r1] + bx lr + .align 2, 0 +_08086834: .4byte gUnknown_202F3D0 + thumb_func_end sub_808682C + + thumb_func_start sub_8086838 +sub_8086838: + ldr r3, _08086844 + strb r0, [r3, 0x1] + strb r1, [r3, 0x2] + strb r2, [r3, 0x3] + bx lr + .align 2, 0 +_08086844: .4byte gUnknown_202F3D0 + thumb_func_end sub_8086838 + + thumb_func_start sub_8086848 +sub_8086848: + ldr r2, _08086850 + strb r0, [r2, 0x4] + strb r1, [r2, 0x5] + bx lr + .align 2, 0 +_08086850: .4byte gUnknown_202F3D0 + thumb_func_end sub_8086848 + + thumb_func_start sub_8086854 +sub_8086854: + push {r4,lr} + ldr r4, _08086874 + ldrb r1, [r4] + cmp r1, 0 + beq _080868DC + ldrb r0, [r4, 0x4] + cmp r0, 0 + bne _080868A4 + ldrb r0, [r4, 0x1] + cmp r0, 0 + beq _08086878 + movs r0, 0x50 + strb r0, [r4, 0x4] + movs r0, 0x10 + b _0808688A + .align 2, 0 +_08086874: .4byte gUnknown_202F3D0 +_08086878: + movs r0, 0x6 + bl RandomCapped + adds r0, 0x2 + strb r0, [r4, 0x4] + movs r0, 0x6 + bl RandomCapped + adds r0, 0x2 +_0808688A: + strb r0, [r4, 0x5] + ldr r0, _0808689C + ldrb r0, [r0, 0x3] + cmp r0, 0 + beq _080868A8 + ldr r0, _080868A0 + bl sub_8083E38 + b _080868A8 + .align 2, 0 +_0808689C: .4byte gUnknown_202F3D0 +_080868A0: .4byte 0x000001f9 +_080868A4: + subs r0, 0x1 + strb r0, [r4, 0x4] +_080868A8: + ldr r3, _080868CC + ldrb r0, [r3, 0x5] + cmp r0, 0 + beq _080868B4 + subs r0, 0x1 + strb r0, [r3, 0x5] +_080868B4: + ldr r0, _080868D0 + ldr r1, [r0] + ldr r0, _080868D4 + adds r1, r0 + ldr r2, _080868D8 + ldrb r0, [r3, 0x5] + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + str r0, [r1] + b _080868E6 + .align 2, 0 +_080868CC: .4byte gUnknown_202F3D0 +_080868D0: .4byte gUnknown_203B418 +_080868D4: .4byte 0x000181fc +_080868D8: .4byte gUnknown_8107314 +_080868DC: + ldr r0, _080868EC + ldr r0, [r0] + ldr r2, _080868F0 + adds r0, r2 + str r1, [r0] +_080868E6: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080868EC: .4byte gUnknown_203B418 +_080868F0: .4byte 0x000181fc + thumb_func_end sub_8086854 + + thumb_func_start sub_80868F4 +sub_80868F4: + ldr r1, [r0, 0x70] + movs r2, 0xAE + lsls r2, 1 + adds r1, r2 + movs r2, 0x1 + strb r2, [r1] + ldr r0, [r0, 0x70] + ldr r1, _0808690C + adds r0, r1 + strb r2, [r0] + bx lr + .align 2, 0 +_0808690C: .4byte 0x0000015d + thumb_func_end sub_80868F4 + + thumb_func_start sub_8086910 +sub_8086910: + ldr r1, [r0, 0x70] + movs r2, 0xAE + lsls r2, 1 + adds r1, r2 + movs r2, 0 + strb r2, [r1] + ldr r0, [r0, 0x70] + ldr r1, _08086928 + adds r0, r1 + strb r2, [r0] + bx lr + .align 2, 0 +_08086928: .4byte 0x0000015d + thumb_func_end sub_8086910 + + thumb_func_start sub_808692C +sub_808692C: + push {lr} + movs r0, 0x5 + bl sub_80859F0 + movs r0, 0x4 + movs r1, 0x46 + bl sub_803E708 + movs r0, 0x6 + bl sub_80859F0 + movs r0, 0x4 + movs r1, 0x46 + bl sub_803E708 + movs r0, 0x7 + bl sub_80859F0 + movs r0, 0x4 + movs r1, 0x46 + bl sub_803E708 + movs r0, 0 + bl sub_80859F0 + movs r0, 0x4 + movs r1, 0x46 + bl sub_803E708 + pop {r0} + bx r0 + thumb_func_end sub_808692C + + thumb_func_start sub_808696C +sub_808696C: + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, [r5, 0x70] + adds r0, 0x46 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x4 + bl sub_8002984 + adds r4, r0, 0 + lsls r4, 24 + asrs r4, 24 + adds r0, r5, 0 + movs r1, 0x4 + movs r2, 0x2 + adds r3, r4, 0 + bl sub_80869E4 + movs r0, 0xF + movs r1, 0x46 + bl sub_803E708 + adds r0, r4, 0 + movs r1, 0x5 + bl sub_8002984 + adds r4, r0, 0 + lsls r4, 24 + asrs r4, 24 + adds r0, r5, 0 + movs r1, 0x4 + movs r2, 0x1 + adds r3, r4, 0 + bl sub_80869E4 + movs r0, 0xF + movs r1, 0x46 + bl sub_803E708 + adds r0, r4, 0 + movs r1, 0x4 + bl sub_8002984 + adds r3, r0, 0 + lsls r3, 24 + asrs r3, 24 + adds r0, r5, 0 + movs r1, 0x4 + movs r2, 0x2 + bl sub_80869E4 + movs r0, 0xF + movs r1, 0x46 + bl sub_803E708 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_808696C + + thumb_func_start sub_80869E4 +sub_80869E4: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r7, r0, 0 + mov r9, r1 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + asrs r6, r3, 24 + ldr r0, [r7, 0x70] + adds r0, 0x46 + movs r4, 0 + ldrsb r4, [r0, r4] + cmp r4, r6 + beq _08086A30 + adds r5, r0, 0 +_08086A08: + adds r0, r4, 0 + adds r1, r6, 0 + mov r2, r8 + bl sub_8002A70 + lsls r0, 24 + asrs r4, r0, 24 + movs r0, 0x7 + ands r0, r4 + strb r0, [r5] + ldrb r1, [r5] + adds r0, r7, 0 + bl sub_806CE68 + mov r0, r9 + movs r1, 0x46 + bl sub_803E708 + cmp r4, r6 + bne _08086A08 +_08086A30: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80869E4 + + thumb_func_start sub_8086A3C +sub_8086A3C: + ldr r1, [r0, 0x70] + movs r2, 0xAE + lsls r2, 1 + adds r1, r2 + movs r2, 0x1 + strb r2, [r1] + ldr r0, [r0, 0x70] + movs r1, 0xAF + lsls r1, 1 + adds r0, r1 + strb r2, [r0] + bx lr + thumb_func_end sub_8086A3C + + thumb_func_start sub_8086A54 +sub_8086A54: + ldr r1, [r0, 0x70] + movs r2, 0xAE + lsls r2, 1 + adds r1, r2 + movs r3, 0 + movs r2, 0x1 + strb r2, [r1] + ldr r0, [r0, 0x70] + movs r1, 0xAF + lsls r1, 1 + adds r0, r1 + strb r3, [r0] + bx lr + thumb_func_end sub_8086A54 + + thumb_func_start sub_8086A70 +sub_8086A70: + push {r4-r6,lr} + adds r5, r0, 0 + lsls r2, 16 + lsrs r4, r2, 16 + ldr r3, [r5, 0x70] + adds r2, r3, 0 + movs r0, 0xF7 + adds r0, r3 + mov r12, r0 + movs r0, 0x1 + mov r6, r12 + strb r0, [r6] + ldrh r0, [r3, 0x10] + strh r0, [r3, 0x12] + cmp r1, 0 + beq _08086A94 + strh r1, [r3, 0x10] + strh r1, [r3, 0xE] +_08086A94: + ldr r0, _08086AB8 + ldr r0, [r0] + ldr r1, _08086ABC + adds r0, r1 + strh r4, [r0] + adds r0, r2, 0 + adds r0, 0x8C + mov r2, r12 + ldrb r1, [r2] + bl sub_808EC94 + adds r0, r5, 0 + bl sub_807191C + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08086AB8: .4byte gUnknown_203B418 +_08086ABC: .4byte 0x0000066a + thumb_func_end sub_8086A70 + + thumb_func_start sub_8086AC0 +sub_8086AC0: + push {lr} + bl sub_8044B28 + lsls r0, 24 + cmp r0, 0 + bne _08086ADA + ldr r0, _08086AE0 + ldr r0, [r0] + ldrb r0, [r0, 0x2] + cmp r0, 0 + bne _08086ADA + bl sub_8097FF8 +_08086ADA: + pop {r0} + bx r0 + .align 2, 0 +_08086AE0: .4byte gUnknown_203B418 + thumb_func_end sub_8086AC0 + + thumb_func_start sub_8086AE4 +sub_8086AE4: + push {lr} + lsls r0, 16 + asrs r1, r0, 16 + ldr r0, _08086B04 + ldr r0, [r0] + ldr r2, _08086B08 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + beq _08086B0C + adds r0, r1, 0 + bl sub_808E734 + lsls r0, 24 + lsrs r0, 24 + b _08086B0E + .align 2, 0 +_08086B04: .4byte gUnknown_203B418 +_08086B08: .4byte 0x0000065c +_08086B0C: + movs r0, 0x1 +_08086B0E: + pop {r1} + bx r1 + thumb_func_end sub_8086AE4 + + thumb_func_start sub_8086B14 +sub_8086B14: + push {r4-r6,lr} + mov r6, r8 + push {r6} + bl sub_8085480 + mov r8, r0 + movs r0, 0x4 + bl sub_8085680 + adds r6, r0, 0 + movs r0, 0x3 + bl sub_8085680 + adds r5, r0, 0 + movs r0, 0x72 + bl sub_8083E88 + bl sub_8085374 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + ldr r4, _08086B8C + adds r0, r4, 0 + bl sub_80855E4 + adds r0, r5, 0 + bl _call_via_r4 + ldr r0, [r6, 0x70] + movs r1, 0xAE + lsls r1, 1 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] + mov r2, r8 + movs r3, 0x4 + ldrsh r0, [r2, r3] + movs r3, 0x6 + ldrsh r1, [r2, r3] + subs r1, 0x2 + bl sub_8085860 + ldr r4, _08086B90 + adds r0, r4, 0 + movs r1, 0x32 + bl sub_808D8BC + adds r4, 0x50 + adds r0, r4, 0 + movs r1, 0xFC + bl sub_808D8BC + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08086B8C: .4byte sub_8086A3C +_08086B90: .4byte gUnknown_202E038 + thumb_func_end sub_8086B14 + + thumb_func_start sub_8086B94 +sub_8086B94: + push {r4-r6,lr} + bl sub_8085480 + adds r6, r0, 0 + movs r0, 0x4 + bl sub_8085680 + adds r5, r0, 0 + movs r0, 0x3 + bl sub_8085680 + movs r4, 0x87 + lsls r4, 2 + adds r1, r4, 0 + movs r2, 0 + bl sub_8068FE0 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_8068FE0 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + movs r1, 0x4 + ldrsh r0, [r6, r1] + movs r2, 0x6 + ldrsh r1, [r6, r2] + bl sub_8085860 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8086B94 + + thumb_func_start sub_8086BDC +sub_8086BDC: + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + movs r2, 0xFF + lsls r2, 24 + adds r1, r2 + lsrs r1, 24 + cmp r1, 0x1 + bhi _08086C02 + cmp r0, 0x3 + bne _08086C02 + movs r0, 0x1 + bl sub_8097FA8 + ldr r0, _08086C08 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x2] +_08086C02: + pop {r0} + bx r0 + .align 2, 0 +_08086C08: .4byte gUnknown_203B418 + thumb_func_end sub_8086BDC + + thumb_func_start sub_8086C0C +sub_8086C0C: + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x10 + bl sub_8085480 + mov r8, r0 + bl sub_808548C + mov r9, r0 + movs r0, 0x4 + bl sub_8085680 + adds r4, r0, 0 + movs r0, 0x3 + bl sub_8085680 + adds r6, r0, 0 + ldr r0, [r4, 0xC] + str r0, [sp] + ldr r0, [r4, 0x10] + movs r1, 0xC0 + lsls r1, 6 + adds r0, r1 + str r0, [sp, 0x4] + ldr r0, [r6, 0xC] + str r0, [sp, 0x8] + ldr r0, [r6, 0x10] + movs r2, 0x80 + lsls r2, 6 + adds r0, r2 + add r5, sp, 0x8 + str r0, [r5, 0x4] + bl sub_8086448 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + mov r0, r9 + bl sub_80862BC + movs r0, 0x20 + movs r1, 0x46 + bl sub_803E708 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08086D84 + bl sub_8052910 + mov r0, sp + movs r1, 0x40 + bl sub_80858AC + movs r0, 0x40 + movs r1, 0x46 + bl sub_803E708 + adds r0, r5, 0 + movs r1, 0x30 + bl sub_80858AC + ldr r0, _08086D88 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, [r4, 0x70] + ldr r2, _08086D8C + adds r1, r0, r2 + movs r0, 0x1 + strb r0, [r1] + mov r0, sp + movs r1, 0x30 + bl sub_80858AC + ldr r0, _08086D90 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r5, 0 + movs r1, 0x20 + bl sub_80858AC + movs r0, 0x20 + movs r1, 0x46 + bl sub_803E708 + adds r0, r6, 0 + bl sub_8086E74 + ldr r0, _08086D94 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08086D98 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08086D9C + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08086DA0 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r6, 0 + movs r1, 0xD + movs r2, 0 + bl sub_806CDD4 + ldr r0, _08086DA4 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + mov r0, r9 + movs r1, 0x4 + movs r2, 0x1 + movs r3, 0x2 + bl sub_80869E4 + mov r0, r8 + movs r1, 0x4 + movs r2, 0x2 + movs r3, 0x6 + bl sub_80869E4 + ldr r0, _08086DA8 + bl sub_8052910 + mov r0, r9 + movs r1, 0x4 + movs r2, 0x2 + movs r3, 0x4 + bl sub_80869E4 + mov r0, r8 + movs r1, 0x4 + movs r2, 0x1 + movs r3, 0x4 + bl sub_80869E4 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r0, 0xB + bl sub_8083E88 + movs r0, 0xC + add r8, r0 + mov r0, r8 + movs r1, 0x10 + bl sub_80858AC + add sp, 0x10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08086D84: .4byte gUnknown_8100768 +_08086D88: .4byte gUnknown_8100798 +_08086D8C: .4byte 0x0000015d +_08086D90: .4byte gUnknown_8100820 +_08086D94: .4byte gUnknown_8100844 +_08086D98: .4byte gUnknown_8100880 +_08086D9C: .4byte gUnknown_8100928 +_08086DA0: .4byte gUnknown_8100A04 +_08086DA4: .4byte gUnknown_8100B80 +_08086DA8: .4byte gUnknown_8100BC0 + thumb_func_end sub_8086C0C + + thumb_func_start sub_8086DAC +sub_8086DAC: + push {r4,r5,lr} + sub sp, 0x8 + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0x3 + bl sub_8085680 + adds r4, r0, 0 + ldr r0, [r4, 0xC] + str r0, [sp] + ldr r0, [r4, 0x10] + movs r1, 0x80 + lsls r1, 6 + adds r0, r1 + str r0, [sp, 0x4] + bl sub_8086448 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r4, 0 + bl sub_8086E74 + mov r0, sp + movs r1, 0x10 + bl sub_80858AC + ldr r0, _08086E34 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08086E38 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r4, 0 + movs r1, 0xD + movs r2, 0 + bl sub_806CDD4 + ldr r0, _08086E3C + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r5, 0xC + adds r0, r5, 0 + movs r1, 0x10 + bl sub_80858AC + movs r0, 0xB + bl sub_8083E88 + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08086E34: .4byte gUnknown_8100C90 +_08086E38: .4byte gUnknown_8100CBC +_08086E3C: .4byte gUnknown_8100CDC + thumb_func_end sub_8086DAC + + thumb_func_start sub_8086E40 +sub_8086E40: + push {lr} + bl sub_8085480 + bl sub_808696C + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08086E6C + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08086E70 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x2] + pop {r0} + bx r0 + .align 2, 0 +_08086E6C: .4byte gUnknown_8100D3C +_08086E70: .4byte gUnknown_203B418 + thumb_func_end sub_8086E40 + + thumb_func_start sub_8086E74 +sub_8086E74: + push {r4,lr} + adds r4, r0, 0 + movs r1, 0xF + movs r2, 0 + bl sub_806CDD4 + adds r0, r4, 0 + bl sub_8086A54 + movs r0, 0xFC + lsls r0, 1 + bl sub_8083E38 + movs r0, 0x44 + movs r1, 0x46 + bl sub_803E708 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8086E74 + + thumb_func_start sub_8086E9C +sub_8086E9C: + push {r4,r5,lr} + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0x72 + bl sub_8083E88 + bl sub_8085374 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + ldr r4, _08086EF8 + adds r0, r4, 0 + bl sub_80855E4 + adds r0, r4, 0 + bl sub_808563C + movs r1, 0x4 + ldrsh r0, [r5, r1] + movs r2, 0x6 + ldrsh r1, [r5, r2] + subs r1, 0x3 + bl sub_8085860 + ldr r4, _08086EFC + adds r0, r4, 0 + movs r1, 0xB + bl sub_808D8BC + adds r0, r4, 0 + adds r0, 0x50 + movs r1, 0x5E + bl sub_808D8BC + adds r4, 0xA0 + adds r0, r4, 0 + movs r1, 0xA + bl sub_808D8BC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08086EF8: .4byte sub_8086A3C +_08086EFC: .4byte gUnknown_202E038 + thumb_func_end sub_8086E9C + + thumb_func_start sub_8086F00 +sub_8086F00: + push {r4,lr} + bl sub_8085480 + adds r4, r0, 0 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + ldr r0, _08086F4C + bl sub_80855E4 + movs r1, 0x4 + ldrsh r0, [r4, r1] + movs r2, 0x6 + ldrsh r1, [r4, r2] + subs r1, 0x3 + bl sub_8085860 + ldr r4, _08086F50 + adds r0, r4, 0 + movs r1, 0xB + bl sub_808D8BC + adds r0, r4, 0 + adds r0, 0x50 + movs r1, 0x5E + bl sub_808D8BC + adds r4, 0xA0 + adds r0, r4, 0 + movs r1, 0xA + bl sub_808D8BC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08086F4C: .4byte sub_8086A3C +_08086F50: .4byte gUnknown_202E038 + thumb_func_end sub_8086F00 + + thumb_func_start sub_8086F54 +sub_8086F54: + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + movs r0, 0xFC + lsls r0, 24 + adds r1, r0 + lsrs r1, 24 + cmp r1, 0x1 + bhi _08086FA8 + movs r5, 0 +_08086F6A: + ldr r0, _08086FB0 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _08086FB4 + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _08086F8E + ldr r0, [r4, 0x70] + adds r0, 0xA4 + ldrb r0, [r0] + cmp r0, r6 + bne _08086FA8 +_08086F8E: + adds r5, 0x1 + cmp r5, 0xF + ble _08086F6A + movs r0, 0 + cmp r0, 0 + bne _08086FA8 + movs r0, 0x3 + bl sub_8097FA8 + ldr r0, _08086FB0 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x2] +_08086FA8: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08086FB0: .4byte gUnknown_203B418 +_08086FB4: .4byte 0x0001358c + thumb_func_end sub_8086F54 + + thumb_func_start sub_8086FB8 +sub_8086FB8: + push {r4,lr} + bl sub_8085480 + adds r4, r0, 0 + bl sub_8086448 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08087048 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808704C + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_8087144 + movs r0, 0xA + bl sub_8083E88 + ldr r0, _08087050 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08087054 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08087058 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808705C + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08087060 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r4, 0xC + adds r0, r4, 0 + movs r1, 0x10 + bl sub_80858AC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08087048: .4byte gUnknown_8100DB0 +_0808704C: .4byte gUnknown_8100E64 +_08087050: .4byte gUnknown_8100E88 +_08087054: .4byte gUnknown_8100F14 +_08087058: .4byte gUnknown_8101004 +_0808705C: .4byte gUnknown_8101050 +_08087060: .4byte gUnknown_81010D0 + thumb_func_end sub_8086FB8 + + thumb_func_start sub_8087064 +sub_8087064: + push {r4,r5,lr} + bl sub_8085480 + adds r4, r0, 0 + bl sub_808548C + adds r5, r0, 0 + bl sub_8086448 + ldr r0, _08087118 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808711C + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_8087144 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08087120 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08087124 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r4, 0 + movs r1, 0x6 + movs r2, 0x4 + bl sub_806CDD4 + adds r0, r5, 0 + movs r1, 0x6 + movs r2, 0x4 + bl sub_806CDD4 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r4, 0 + movs r1, 0x7 + movs r2, 0x4 + bl sub_806CDD4 + adds r0, r5, 0 + movs r1, 0x7 + movs r2, 0x4 + bl sub_806CDD4 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08087128 + bl sub_8052910 + ldr r0, _0808712C + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r4, 0xC + adds r0, r4, 0 + movs r1, 0x10 + bl sub_80858AC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08087118: .4byte gUnknown_8101164 +_0808711C: .4byte gUnknown_8100E64 +_08087120: .4byte gUnknown_8101240 +_08087124: .4byte gUnknown_8101310 +_08087128: .4byte gUnknown_810137C +_0808712C: .4byte gUnknown_8101408 + thumb_func_end sub_8087064 + + thumb_func_start sub_8087130 +sub_8087130: + push {lr} + bl sub_8086448 + ldr r0, _08087140 + bl sub_80866C4 + pop {r0} + bx r0 + .align 2, 0 +_08087140: .4byte gUnknown_8101440 + thumb_func_end sub_8087130 + + thumb_func_start sub_8087144 +sub_8087144: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0xF0 + movs r0, 0x5 + bl sub_8085680 + adds r7, r0, 0 + movs r0, 0x6 + bl sub_8085680 + mov r8, r0 + movs r0, 0x7 + bl sub_8085680 + mov r9, r0 + ldr r1, _080871E0 + mov r0, sp + movs r2, 0x38 + bl memcpy + add r6, sp, 0x38 + ldr r1, _080871E4 + adds r0, r6, 0 + movs r2, 0x38 + bl memcpy + add r4, sp, 0x70 + ldr r1, _080871E8 + adds r0, r4, 0 + movs r2, 0x38 + bl memcpy + add r5, sp, 0xA8 + mov r0, sp + str r0, [r5] + str r6, [r5, 0x4] + str r4, [r5, 0x8] + add r4, sp, 0xB4 + str r7, [r4] + mov r3, r8 + str r3, [r4, 0x4] + mov r0, r9 + str r0, [r4, 0x8] + movs r0, 0xA + bl sub_8083E88 + adds r0, r7, 0 + bl sub_8086A54 + mov r0, r8 + bl sub_8086A54 + mov r0, r9 + bl sub_8086A54 + add r6, sp, 0xC0 + adds r0, r6, 0 + adds r1, r5, 0 + adds r2, r4, 0 + movs r3, 0x3 + bl sub_8085B4C + ldr r0, [r7, 0x70] + ldr r2, _080871EC + adds r0, r2 + movs r1, 0x1 + strb r1, [r0] + mov r3, r8 + ldr r0, [r3, 0x70] + adds r0, r2 + strb r1, [r0] + mov r3, r9 + ldr r0, [r3, 0x70] + adds r0, r2 + strb r1, [r0] + b _080871F6 + .align 2, 0 +_080871E0: .4byte gUnknown_810739C +_080871E4: .4byte gUnknown_81073D4 +_080871E8: .4byte gUnknown_810740C +_080871EC: .4byte 0x0000015f +_080871F0: + movs r0, 0x46 + bl sub_803E46C +_080871F6: + adds r0, r6, 0 + bl sub_8085B80 + lsls r0, 24 + lsrs r2, r0, 24 + cmp r2, 0 + bne _080871F0 + ldr r0, [r7, 0x70] + ldr r1, _0808722C + adds r0, r1 + strb r2, [r0] + mov r3, r8 + ldr r0, [r3, 0x70] + adds r0, r1 + strb r2, [r0] + mov r3, r9 + ldr r0, [r3, 0x70] + adds r0, r1 + strb r2, [r0] + add sp, 0xF0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0808722C: .4byte 0x0000015f + thumb_func_end sub_8087144 + + thumb_func_start sub_8087230 +sub_8087230: + push {r4-r6,lr} + bl sub_8085480 + adds r6, r0, 0 + movs r0, 0x8 + bl sub_8085680 + adds r5, r0, 0 + movs r0, 0x72 + bl sub_8083E88 + bl sub_8085374 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + ldr r4, _08087294 + adds r0, r4, 0 + bl sub_80855E4 + adds r0, r5, 0 + movs r1, 0 + bl sub_8085918 + adds r0, r5, 0 + bl _call_via_r4 + movs r1, 0x4 + ldrsh r0, [r6, r1] + movs r2, 0x6 + ldrsh r1, [r6, r2] + subs r1, 0x3 + bl sub_8085860 + ldr r4, _08087298 + movs r1, 0x96 + lsls r1, 1 + adds r0, r4, 0 + bl sub_808D8BC + adds r4, 0x50 + adds r0, r4, 0 + movs r1, 0x91 + bl sub_808D8BC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08087294: .4byte sub_8086A3C +_08087298: .4byte gUnknown_202E038 + thumb_func_end sub_8087230 + + thumb_func_start sub_808729C +sub_808729C: + push {r4-r6,lr} + sub sp, 0x4 + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0x8 + bl sub_8085680 + adds r4, r0, 0 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + ldr r6, _080872DC + adds r0, r6, 0 + bl sub_80855E4 + movs r0, 0x91 + bl sub_8086AE4 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _080872E0 + movs r1, 0x87 + lsls r1, 2 + adds r0, r4, 0 + movs r2, 0 + bl sub_8068FE0 + b _08087300 + .align 2, 0 +_080872DC: .4byte sub_8086A3C +_080872E0: + ldr r0, _0808732C + movs r3, 0 + ldrsh r2, [r0, r3] + str r1, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + movs r3, 0 + bl sub_8072008 + adds r0, r4, 0 + movs r1, 0 + bl sub_8085918 + adds r0, r4, 0 + bl _call_via_r6 +_08087300: + movs r1, 0x4 + ldrsh r0, [r5, r1] + movs r2, 0x6 + ldrsh r1, [r5, r2] + subs r1, 0x3 + bl sub_8085860 + ldr r4, _08087330 + movs r1, 0x96 + lsls r1, 1 + adds r0, r4, 0 + bl sub_808D8BC + adds r4, 0x50 + adds r0, r4, 0 + movs r1, 0x91 + bl sub_808D8BC + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0808732C: .4byte gUnknown_80F57CC +_08087330: .4byte gUnknown_202E038 + thumb_func_end sub_808729C + + thumb_func_start sub_8087334 +sub_8087334: + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + movs r2, 0xF9 + lsls r2, 24 + adds r1, r2 + lsrs r1, 24 + cmp r1, 0x2 + bhi _0808735A + cmp r0, 0x8 + bne _0808735A + movs r0, 0x5 + bl sub_8097FA8 + ldr r0, _08087360 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x2] +_0808735A: + pop {r0} + bx r0 + .align 2, 0 +_08087360: .4byte gUnknown_203B418 + thumb_func_end sub_8087334 + + thumb_func_start sub_8087364 +sub_8087364: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x70 + bl sub_8085480 + mov r9, r0 + bl sub_808548C + adds r6, r0, 0 + movs r0, 0x8 + bl sub_8085680 + str r0, [sp, 0x68] + bl sub_8086448 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r6, 0 + bl sub_808696C + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r6, 0 + movs r1, 0x4 + movs r2, 0x1 + movs r3, 0x2 + bl sub_80869E4 + mov r0, r9 + movs r1, 0x4 + movs r2, 0x2 + movs r3, 0x6 + bl sub_80869E4 + ldr r0, _08087470 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r6, 0 + movs r1, 0x4 + movs r2, 0x2 + movs r3, 0x4 + bl sub_80869E4 + mov r0, r9 + movs r1, 0x4 + movs r2, 0x1 + movs r3, 0x4 + bl sub_80869E4 + ldr r0, _08087474 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r0, 0x3 + bl sub_808775C + bl sub_8083F14 + movs r0, 0xED + lsls r0, 1 + bl sub_8083E38 + ldr r0, _08087478 + bl sub_8052910 + ldr r0, [sp, 0x68] + bl sub_8087704 + movs r0, 0x9 + bl sub_8083E88 + adds r0, r6, 0 + movs r1, 0x6 + movs r2, 0x4 + bl sub_806CDD4 + ldr r0, _0808747C + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r6, 0 + movs r1, 0x2 + movs r2, 0x1 + movs r3, 0x1 + bl sub_80869E4 + mov r1, sp + ldr r0, _08087480 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + mov r0, sp + str r0, [sp, 0x58] + str r6, [sp, 0x5C] + add r4, sp, 0x18 + add r1, sp, 0x58 + add r2, sp, 0x5C + adds r0, r4, 0 + movs r3, 0x1 + bl sub_8085B4C + ldr r0, [r6, 0x70] + ldr r2, _08087484 + adds r1, r0, r2 + movs r0, 0x1 + strb r0, [r1] + add r7, sp, 0x28 + add r3, sp, 0x48 + mov r8, r3 + add r0, sp, 0x60 + mov r10, r0 + mov r1, sp + adds r1, 0x64 + str r1, [sp, 0x6C] + b _0808748E + .align 2, 0 +_08087470: .4byte gUnknown_81014B0 +_08087474: .4byte gUnknown_8101504 +_08087478: .4byte gUnknown_81015A0 +_0808747C: .4byte gUnknown_81015D4 +_08087480: .4byte gUnknown_810744C +_08087484: .4byte 0x0000015f +_08087488: + movs r0, 0x46 + bl sub_803E46C +_0808748E: + adds r0, r4, 0 + bl sub_8085B80 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _08087488 + ldr r0, [r6, 0x70] + ldr r2, _08087510 + adds r0, r2 + strb r5, [r0] + ldr r0, [r6, 0x70] + ldr r4, _08087514 + adds r0, r4 + movs r1, 0x1 + strb r1, [r0] + adds r0, r6, 0 + movs r1, 0x2 + movs r2, 0x2 + movs r3, 0x4 + bl sub_80869E4 + ldr r0, _08087518 + bl sub_8052910 + movs r0, 0x3C + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808751C + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, [r6, 0x70] + adds r0, r4 + strb r5, [r0] + adds r0, r6, 0 + movs r1, 0x2 + movs r2, 0x2 + movs r3, 0x5 + bl sub_80869E4 + adds r1, r7, 0 + ldr r0, _08087520 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r3,r4} + stm r1!, {r3,r4} + str r7, [sp, 0x60] + str r6, [sp, 0x64] + mov r0, r8 + mov r1, r10 + ldr r2, [sp, 0x6C] + movs r3, 0x1 + bl sub_8085B4C + mov r4, r9 + adds r4, 0xC + b _0808752A + .align 2, 0 +_08087510: .4byte 0x0000015f +_08087514: .4byte 0x0000015d +_08087518: .4byte gUnknown_81015E8 +_0808751C: .4byte gUnknown_8101624 +_08087520: .4byte gUnknown_8107464 +_08087524: + movs r0, 0x46 + bl sub_803E46C +_0808752A: + mov r0, r8 + bl sub_8085B80 + lsls r0, 24 + cmp r0, 0 + bne _08087524 + adds r0, r6, 0 + movs r1, 0x2 + movs r2, 0x1 + movs r3, 0x3 + bl sub_80869E4 + ldr r0, _080875B0 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r0, 0x3 + bl sub_808775C + ldr r0, _080875B4 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r0, 0x1 + bl sub_808775C + ldr r0, _080875B8 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r0, 0x2 + bl sub_808775C + ldr r0, _080875BC + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r1, 0x96 + lsls r1, 1 + ldr r0, [sp, 0x68] + movs r2, 0xB + bl sub_8086A70 + adds r0, r4, 0 + movs r1, 0x10 + bl sub_80858AC + add sp, 0x70 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080875B0: .4byte gUnknown_810165C +_080875B4: .4byte gUnknown_8101750 +_080875B8: .4byte gUnknown_810178C +_080875BC: .4byte gUnknown_81017B4 + thumb_func_end sub_8087364 + + thumb_func_start sub_80875C0 +sub_80875C0: + push {r4,r5,lr} + bl sub_8085480 + adds r4, r0, 0 + movs r0, 0x8 + bl sub_8085680 + adds r5, r0, 0 + bl sub_8086448 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08087648 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r0, 0xED + lsls r0, 1 + bl sub_8083E38 + ldr r0, _0808764C + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r5, 0 + bl sub_8087704 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08087650 + bl sub_8052910 + movs r0, 0x1 + bl sub_808775C + ldr r0, _08087654 + bl sub_8052910 + movs r0, 0x2 + bl sub_808775C + ldr r0, _08087658 + bl sub_8052910 + movs r1, 0x96 + lsls r1, 1 + adds r0, r5, 0 + movs r2, 0xB + bl sub_8086A70 + adds r4, 0xC + adds r0, r4, 0 + movs r1, 0x10 + bl sub_80858AC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08087648: .4byte gUnknown_81017E4 +_0808764C: .4byte gUnknown_81015A0 +_08087650: .4byte gUnknown_8101898 +_08087654: .4byte gUnknown_81018EC +_08087658: .4byte gUnknown_8101918 + thumb_func_end sub_80875C0 + + thumb_func_start sub_808765C +sub_808765C: + push {r4,r5,lr} + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0x8 + bl sub_8085680 + adds r4, r0, 0 + bl sub_8086448 + movs r0, 0x91 + bl sub_8086AE4 + lsls r0, 24 + cmp r0, 0 + beq _08087688 + ldr r0, _08087684 + bl sub_80866C4 + b _080876EA + .align 2, 0 +_08087684: .4byte gUnknown_8101A38 +_08087688: + movs r0, 0x1 + bl sub_808775C + movs r0, 0xED + lsls r0, 1 + bl sub_8083E38 + ldr r0, _080876F0 + bl sub_8052910 + adds r0, r4, 0 + bl sub_8087704 + ldr r0, _080876F4 + bl sub_8052910 + movs r0, 0x1 + bl sub_808775C + ldr r0, _080876F8 + bl sub_8052910 + movs r0, 0x2 + bl sub_808775C + ldr r0, _080876FC + bl sub_8052910 + movs r0, 0x2 + bl sub_808775C + ldr r0, _08087700 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r1, 0x96 + lsls r1, 1 + adds r0, r4, 0 + movs r2, 0xB + bl sub_8086A70 + adds r0, r5, 0 + adds r0, 0xC + movs r1, 0x10 + bl sub_80858AC +_080876EA: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080876F0: .4byte gUnknown_810193C +_080876F4: .4byte gUnknown_8101970 +_080876F8: .4byte gUnknown_8101994 +_080876FC: .4byte gUnknown_81019E4 +_08087700: .4byte gUnknown_8101A04 + thumb_func_end sub_808765C + + thumb_func_start sub_8087704 +sub_8087704: + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, [r5, 0x70] + movs r1, 0xAE + lsls r1, 1 + adds r0, r1 + movs r2, 0 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r5, 0x70] + movs r1, 0xAF + lsls r1, 1 + adds r0, r1 + strb r2, [r0] + ldr r0, [r5, 0x70] + adds r1, 0x16 + adds r0, r1 + movs r1, 0xC8 + str r1, [r0] + movs r0, 0xF5 + lsls r0, 1 + bl sub_8083E38 + movs r4, 0xC8 +_08087734: + ldr r0, [r5, 0x70] + movs r1, 0xBA + lsls r1, 1 + adds r0, r1 + lsls r1, r4, 8 + str r1, [r0] + movs r0, 0x46 + bl sub_803E46C + subs r4, 0x5 + cmp r4, 0 + bge _08087734 + movs r0, 0x1E + movs r1, 0x46 + bl sub_803E708 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8087704 + + thumb_func_start sub_808775C +sub_808775C: + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r0, 0xFB + lsls r0, 1 + bl sub_8083E38 + cmp r5, 0x2 + ble _08087790 + movs r4, 0xFA +_08087770: + lsrs r2, r4, 31 + adds r2, r4, r2 + asrs r2, 1 + movs r0, 0x1 + str r0, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0xC7 + bgt _08087770 +_08087790: + cmp r5, 0x1 + ble _080877B6 + movs r4, 0xFA +_08087796: + lsrs r2, r4, 31 + adds r2, r4, r2 + asrs r2, 1 + movs r0, 0x1 + str r0, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0xC7 + bgt _08087796 +_080877B6: + movs r4, 0xFA +_080877B8: + adds r2, r4, 0 + cmp r4, 0 + bge _080877C0 + adds r2, r4, 0x3 +_080877C0: + asrs r2, 2 + movs r0, 0x1 + str r0, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0 + bge _080877B8 + bl sub_8085EB0 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_808775C + + thumb_func_start sub_80877E8 +sub_80877E8: + push {r4-r6,lr} + bl sub_8085480 + adds r6, r0, 0 + movs r0, 0x9 + bl sub_8085680 + adds r5, r0, 0 + movs r0, 0x26 + bl sub_8083E88 + bl sub_8085374 + bl sub_80854D4 + movs r0, 0x6 + bl sub_8085930 + ldr r4, _08087840 + adds r0, r4, 0 + bl sub_80855E4 + adds r0, r5, 0 + movs r1, 0 + bl sub_8085918 + adds r0, r5, 0 + bl _call_via_r4 + movs r1, 0x4 + ldrsh r0, [r6, r1] + subs r0, 0x3 + movs r2, 0x6 + ldrsh r1, [r6, r2] + subs r1, 0x2 + bl sub_8085860 + ldr r0, _08087844 + movs r1, 0x92 + bl sub_808D8BC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08087840: .4byte sub_8086A3C +_08087844: .4byte gUnknown_202E038 + thumb_func_end sub_80877E8 + + thumb_func_start sub_8087848 +sub_8087848: + push {r4-r6,lr} + sub sp, 0x4 + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0x9 + bl sub_8085680 + adds r4, r0, 0 + movs r0, 0x26 + bl sub_8083E88 + bl sub_80854D4 + movs r0, 0x6 + bl sub_8085930 + ldr r6, _08087890 + adds r0, r6, 0 + bl sub_80855E4 + movs r0, 0x92 + bl sub_8086AE4 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _08087894 + movs r1, 0x87 + lsls r1, 2 + adds r0, r4, 0 + movs r2, 0 + bl sub_8068FE0 + b _080878B4 + .align 2, 0 +_08087890: .4byte sub_8086A3C +_08087894: + ldr r0, _080878E8 + movs r3, 0 + ldrsh r2, [r0, r3] + str r1, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + movs r3, 0 + bl sub_8072008 + adds r0, r4, 0 + movs r1, 0 + bl sub_8085918 + adds r0, r4, 0 + bl _call_via_r6 +_080878B4: + movs r1, 0x4 + ldrsh r0, [r5, r1] + subs r0, 0x5 + movs r2, 0x6 + ldrsh r1, [r5, r2] + bl sub_8085860 + bl sub_803F994 + adds r4, r0, 0 + bl sub_803F9B0 + adds r1, r0, 0 + ldr r3, _080878EC + adds r1, r3 + adds r0, r4, 0 + bl sub_803F878 + ldr r0, _080878F0 + movs r1, 0x92 + bl sub_808D8BC + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080878E8: .4byte gUnknown_80F57CE +_080878EC: .4byte 0xfffff000 +_080878F0: .4byte gUnknown_202E038 + thumb_func_end sub_8087848 + + thumb_func_start sub_80878F4 +sub_80878F4: + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + movs r2, 0xF6 + lsls r2, 24 + adds r1, r2 + lsrs r1, 24 + cmp r1, 0x2 + bhi _0808791A + cmp r0, 0x9 + bne _0808791A + movs r0, 0x7 + bl sub_8097FA8 + ldr r0, _08087920 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x2] +_0808791A: + pop {r0} + bx r0 + .align 2, 0 +_08087920: .4byte gUnknown_203B418 + thumb_func_end sub_80878F4 + + thumb_func_start sub_8087924 +sub_8087924: + push {r4-r6,lr} + bl sub_8085480 + adds r5, r0, 0 + bl sub_808548C + adds r4, r0, 0 + movs r0, 0x9 + bl sub_8085680 + adds r6, r0, 0 + movs r0, 0xC + movs r1, 0x5 + bl sub_8087D80 + bl sub_8086500 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08087AE8 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r4, 0 + movs r1, 0x4 + movs r2, 0x1 + movs r3, 0x5 + bl sub_80869E4 + movs r0, 0x4 + movs r1, 0x46 + bl sub_803E708 + adds r0, r4, 0 + bl sub_808696C + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08087AEC + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r0, 0xC + movs r1, 0x5 + bl sub_8087D80 + movs r0, 0x9 + movs r1, 0x5 + bl sub_8087DE8 + ldr r0, _08087AF0 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r4, 0 + movs r1, 0x4 + movs r2, 0x1 + movs r3, 0x2 + bl sub_80869E4 + adds r0, r5, 0 + movs r1, 0x4 + movs r2, 0x2 + movs r3, 0x6 + bl sub_80869E4 + ldr r0, _08087AF4 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r4, 0 + movs r1, 0x4 + movs r2, 0x2 + movs r3, 0x6 + bl sub_80869E4 + bl sub_8086690 + ldr r0, _08087AF8 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r0, 0x5 + bl sub_8085930 + movs r0, 0x4 + movs r1, 0x46 + bl sub_803E708 + movs r0, 0x4 + bl sub_8085930 + ldr r0, _08087AFC + bl sub_8083E38 + bl sub_8083F14 + bl sub_8087F24 + ldr r0, _08087B00 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08087B04 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08087B08 + bl sub_8083E38 + adds r0, r4, 0 + movs r1, 0x4 + bl sub_80856E0 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08087B0C + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_8087EB0 + movs r0, 0xED + lsls r0, 1 + bl sub_8083E38 + ldr r0, _08087B10 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r0, 0x9 + movs r1, 0x5 + bl sub_8087D80 + movs r0, 0xB + movs r1, 0x5 + bl sub_8087DE8 + ldr r0, _08087B14 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r0, 0xC + movs r1, 0x5 + bl sub_8087D80 + movs r0, 0x9 + movs r1, 0x5 + bl sub_8087DE8 + adds r0, r6, 0 + bl sub_8087D30 + bl sub_808663C + bl sub_8087EB0 + ldr r0, _08087B18 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r0, 0xB + movs r1, 0x6 + bl sub_8087DE8 + ldr r0, _08087B1C + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r1, 0xC8 + lsls r1, 1 + adds r0, r6, 0 + movs r2, 0xB + bl sub_8086A70 + adds r5, 0xC + adds r0, r5, 0 + movs r1, 0x10 + bl sub_80858AC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08087AE8: .4byte gUnknown_8101A9C +_08087AEC: .4byte gUnknown_8101AD4 +_08087AF0: .4byte gUnknown_8101C30 +_08087AF4: .4byte gUnknown_8101CBC +_08087AF8: .4byte gUnknown_8101D8C +_08087AFC: .4byte 0x000002f2 +_08087B00: .4byte gUnknown_8101DA0 +_08087B04: .4byte gUnknown_8101E1C +_08087B08: .4byte 0x000001cf +_08087B0C: .4byte gUnknown_8101EAC +_08087B10: .4byte gUnknown_8102070 +_08087B14: .4byte gUnknown_81020A4 +_08087B18: .4byte gUnknown_81020D4 +_08087B1C: .4byte gUnknown_8102108 + thumb_func_end sub_8087924 + + thumb_func_start sub_8087B20 +sub_8087B20: + push {r4-r6,lr} + bl sub_8085480 + adds r5, r0, 0 + bl sub_808548C + adds r4, r0, 0 + movs r0, 0x9 + bl sub_8085680 + adds r6, r0, 0 + movs r0, 0xA + movs r1, 0x5 + bl sub_8087D80 + bl sub_8086500 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r4, 0 + bl sub_808696C + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08087C24 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r4, 0 + movs r1, 0x4 + movs r2, 0x1 + movs r3, 0x2 + bl sub_80869E4 + adds r0, r5, 0 + movs r1, 0x4 + movs r2, 0x2 + movs r3, 0x6 + bl sub_80869E4 + ldr r0, _08087C28 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r4, 0 + movs r1, 0x4 + movs r2, 0x2 + movs r3, 0x6 + bl sub_80869E4 + adds r0, r5, 0 + movs r1, 0x4 + movs r2, 0x2 + movs r3, 0x6 + bl sub_80869E4 + bl sub_8086690 + bl sub_8087F24 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r0, 0x5 + bl sub_8085930 + movs r0, 0x4 + movs r1, 0x46 + bl sub_803E708 + movs r0, 0x4 + bl sub_8085930 + adds r0, r6, 0 + bl sub_8087D30 + bl sub_808663C + bl sub_8087EB0 + ldr r0, _08087C2C + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r0, 0xB + movs r1, 0x6 + bl sub_8087DE8 + ldr r0, _08087C30 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08087C34 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r1, 0xC8 + lsls r1, 1 + adds r0, r6, 0 + movs r2, 0xB + bl sub_8086A70 + adds r5, 0xC + adds r0, r5, 0 + movs r1, 0x10 + bl sub_80858AC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08087C24: .4byte gUnknown_8102158 +_08087C28: .4byte gUnknown_8102190 +_08087C2C: .4byte gUnknown_8102200 +_08087C30: .4byte gUnknown_8102254 +_08087C34: .4byte gUnknown_81022F8 + thumb_func_end sub_8087B20 + + thumb_func_start sub_8087C38 +sub_8087C38: + push {r4,r5,lr} + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0x9 + bl sub_8085680 + adds r4, r0, 0 + movs r0, 0xC + movs r1, 0x5 + bl sub_8087D80 + bl sub_808654C + movs r0, 0x92 + bl sub_8086AE4 + lsls r0, 24 + cmp r0, 0 + beq _08087CA4 + movs r0, 0x5 + bl sub_8085930 + movs r0, 0x4 + movs r1, 0x46 + bl sub_803E708 + movs r0, 0x4 + bl sub_8085930 + movs r0, 0x4 + movs r1, 0x46 + bl sub_803E708 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08087C9C + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08087CA0 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x2] + b _08087D16 + .align 2, 0 +_08087C9C: .4byte gUnknown_8100D3C +_08087CA0: .4byte gUnknown_203B418 +_08087CA4: + ldr r0, _08087D1C + bl sub_8052910 + movs r0, 0x5 + bl sub_8085930 + movs r0, 0x4 + movs r1, 0x46 + bl sub_803E708 + movs r0, 0x4 + bl sub_8085930 + adds r0, r4, 0 + bl sub_8087D30 + ldr r0, _08087D20 + bl sub_8052910 + movs r0, 0xC + movs r1, 0x5 + bl sub_8087D80 + movs r0, 0x9 + movs r1, 0x5 + bl sub_8087DE8 + ldr r0, _08087D24 + bl sub_8052910 + bl sub_8087EB0 + ldr r0, _08087D28 + bl sub_8052910 + movs r0, 0xB + movs r1, 0x6 + bl sub_8087DE8 + ldr r0, _08087D2C + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r1, 0xC8 + lsls r1, 1 + adds r0, r4, 0 + movs r2, 0xB + bl sub_8086A70 + adds r0, r5, 0 + adds r0, 0xC + movs r1, 0x10 + bl sub_80858AC +_08087D16: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08087D1C: .4byte gUnknown_810232C +_08087D20: .4byte gUnknown_8102398 +_08087D24: .4byte gUnknown_81023C4 +_08087D28: .4byte gUnknown_8102400 +_08087D2C: .4byte gUnknown_8102454 + thumb_func_end sub_8087C38 + + thumb_func_start sub_8087D30 +sub_8087D30: + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, [r5, 0x70] + movs r1, 0xAE + lsls r1, 1 + adds r0, r1 + movs r2, 0 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r5, 0x70] + movs r1, 0xAF + lsls r1, 1 + adds r0, r1 + strb r2, [r0] + ldr r0, [r5, 0x70] + adds r1, 0x16 + adds r0, r1 + movs r1, 0xC8 + lsls r1, 8 + str r1, [r0] + movs r0, 0xFC + lsls r0, 1 + bl sub_8083E38 + movs r4, 0xC8 +_08087D62: + ldr r0, [r5, 0x70] + movs r1, 0xBA + lsls r1, 1 + adds r0, r1 + lsls r1, r4, 8 + str r1, [r0] + movs r0, 0x46 + bl sub_803E46C + subs r4, 0x5 + cmp r4, 0 + bge _08087D62 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8087D30 + + thumb_func_start sub_8087D80 +sub_8087D80: + push {lr} + sub sp, 0x8 + adds r3, r1, 0 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 11 + movs r2, 0xC0 + lsls r2, 4 + adds r0, r1, r2 + cmp r0, 0 + bge _08087D98 + adds r0, 0xFF +_08087D98: + lsls r0, 8 + lsrs r0, 16 + ldr r1, _08087DE0 + ldr r2, [sp, 0x4] + ands r2, r1 + orrs r2, r0 + str r2, [sp, 0x4] + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 11 + movs r1, 0x80 + lsls r1, 5 + adds r0, r1 + cmp r0, 0 + bge _08087DB8 + adds r0, 0xFF +_08087DB8: + lsls r0, 8 + lsrs r0, 16 + lsls r0, 16 + ldr r1, _08087DE4 + ands r2, r1 + orrs r2, r0 + str r2, [sp, 0x4] + movs r0, 0xB9 + lsls r0, 1 + movs r1, 0 + str r1, [sp] + movs r1, 0x10 + movs r2, 0 + add r3, sp, 0x4 + bl sub_8085EC8 + add sp, 0x8 + pop {r0} + bx r0 + .align 2, 0 +_08087DE0: .4byte 0xffff0000 +_08087DE4: .4byte 0x0000ffff + thumb_func_end sub_8087D80 + + thumb_func_start sub_8087DE8 +sub_8087DE8: + push {r4-r6,lr} + sub sp, 0x8 + adds r3, r1, 0 + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 11 + movs r2, 0xC0 + lsls r2, 4 + adds r0, r1, r2 + cmp r0, 0 + bge _08087E00 + adds r0, 0xFF +_08087E00: + lsls r0, 8 + lsrs r0, 16 + ldr r1, _08087EA8 + ldr r2, [sp, 0x4] + ands r2, r1 + orrs r2, r0 + str r2, [sp, 0x4] + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 11 + movs r1, 0x80 + lsls r1, 5 + adds r0, r1 + cmp r0, 0 + bge _08087E20 + adds r0, 0xFF +_08087E20: + lsls r0, 8 + lsrs r0, 16 + lsls r0, 16 + ldr r1, _08087EAC + ands r2, r1 + orrs r2, r0 + str r2, [sp, 0x4] + movs r0, 0xB9 + lsls r0, 1 + movs r1, 0 + str r1, [sp] + movs r1, 0x16 + movs r2, 0 + add r3, sp, 0x4 + bl sub_8085EC8 + adds r6, r0, 0 + movs r0, 0xF6 + lsls r0, 1 + bl sub_8083E38 + movs r4, 0xFA + movs r5, 0x1 +_08087E4E: + str r5, [sp] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0x13 + bgt _08087E4E + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r4, 0xFA + movs r5, 0x1 +_08087E74: + str r5, [sp] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0 + bge _08087E74 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_8085EB0 + adds r0, r6, 0 + bl sub_8085F44 + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08087EA8: .4byte 0xffff0000 +_08087EAC: .4byte 0x0000ffff + thumb_func_end sub_8087DE8 + + thumb_func_start sub_8087EB0 +sub_8087EB0: + push {r4,lr} + sub sp, 0x4 + ldr r0, _08087F20 + bl sub_8083E38 + movs r4, 0xFA +_08087EBC: + lsrs r2, r4, 31 + adds r2, r4, r2 + asrs r2, 1 + movs r0, 0x1 + str r0, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0x9 + bgt _08087EBC + movs r0, 0x1E + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08087F20 + bl sub_8083E38 + movs r4, 0xFA +_08087EEC: + lsrs r2, r4, 31 + adds r2, r4, r2 + asrs r2, 1 + movs r0, 0x1 + str r0, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0 + bge _08087EEC + movs r0, 0x1E + movs r1, 0x46 + bl sub_803E708 + bl sub_8085EB0 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08087F20: .4byte 0x000001ed + thumb_func_end sub_8087EB0 + + thumb_func_start sub_8087F24 +sub_8087F24: + push {r4-r6,lr} + sub sp, 0x4 + movs r4, 0 + movs r6, 0 + movs r5, 0x50 + negs r5, r5 +_08087F30: + str r6, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r4, 0 + movs r3, 0 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0x8 + cmp r4, r5 + bge _08087F30 + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8087F24 + + thumb_func_start sub_8087F54 +sub_8087F54: + push {r4-r6,lr} + bl sub_8085480 + adds r6, r0, 0 + movs r0, 0xD + bl sub_8085680 + adds r5, r0, 0 + movs r0, 0x72 + bl sub_8083E88 + bl sub_8085374 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + ldr r4, _08087FAC + adds r0, r4, 0 + bl sub_80855E4 + adds r0, r5, 0 + movs r1, 0 + bl sub_8085918 + adds r0, r5, 0 + bl _call_via_r4 + movs r1, 0x4 + ldrsh r0, [r6, r1] + movs r2, 0x6 + ldrsh r1, [r6, r2] + subs r1, 0x3 + bl sub_8085860 + ldr r0, _08087FB0 + movs r1, 0x90 + bl sub_808D8BC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08087FAC: .4byte sub_8086A3C +_08087FB0: .4byte gUnknown_202E038 + thumb_func_end sub_8087F54 + + thumb_func_start sub_8087FB4 +sub_8087FB4: + push {r4,lr} + movs r0, 0xD + bl sub_8085680 + adds r4, r0, 0 + movs r0, 0x72 + bl sub_8083E88 + bl sub_8085374 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + adds r0, r4, 0 + movs r1, 0 + bl sub_8085918 + adds r0, r4, 0 + movs r1, 0xF + movs r2, 0 + bl sub_806CDD4 + ldr r0, _08087FF4 + movs r1, 0x90 + bl sub_808D8BC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08087FF4: .4byte gUnknown_202E038 + thumb_func_end sub_8087FB4 + + thumb_func_start sub_8087FF8 +sub_8087FF8: + push {r4-r6,lr} + sub sp, 0x4 + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0xD + bl sub_8085680 + adds r4, r0, 0 + bl sub_8085374 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + ldr r6, _0808803C + adds r0, r6, 0 + bl sub_80855E4 + movs r0, 0x90 + bl sub_8086AE4 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _08088040 + movs r1, 0x87 + lsls r1, 2 + adds r0, r4, 0 + movs r2, 0 + bl sub_8068FE0 + b _08088060 + .align 2, 0 +_0808803C: .4byte sub_8086A3C +_08088040: + ldr r0, _08088080 + movs r3, 0 + ldrsh r2, [r0, r3] + str r1, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + movs r3, 0 + bl sub_8072008 + adds r0, r4, 0 + movs r1, 0 + bl sub_8085918 + adds r0, r4, 0 + bl _call_via_r6 +_08088060: + movs r1, 0x4 + ldrsh r0, [r5, r1] + movs r2, 0x6 + ldrsh r1, [r5, r2] + subs r1, 0x3 + bl sub_8085860 + ldr r0, _08088084 + movs r1, 0x90 + bl sub_808D8BC + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08088080: .4byte gUnknown_80F57D0 +_08088084: .4byte gUnknown_202E038 + thumb_func_end sub_8087FF8 + + thumb_func_start sub_8088088 +sub_8088088: + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + movs r2, 0xF3 + lsls r2, 24 + adds r1, r2 + lsrs r1, 24 + cmp r1, 0x2 + bhi _080880AE + cmp r0, 0xD + bne _080880AE + movs r0, 0x9 + bl sub_8097FA8 + ldr r0, _080880B4 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x2] +_080880AE: + pop {r0} + bx r0 + .align 2, 0 +_080880B4: .4byte gUnknown_203B418 + thumb_func_end sub_8088088 + + thumb_func_start sub_80880B8 +sub_80880B8: + push {r4-r6,lr} + mov r6, r8 + push {r6} + bl sub_8085480 + adds r5, r0, 0 + bl sub_808548C + adds r6, r0, 0 + movs r0, 0xD + bl sub_8085680 + mov r8, r0 + bl sub_8086448 + adds r0, r6, 0 + bl sub_808696C + ldr r0, _080882C8 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_8086598 + bl sub_8083F14 + ldr r0, _080882CC + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r6, 0 + movs r1, 0x4 + movs r2, 0x1 + movs r3, 0x2 + bl sub_80869E4 + adds r0, r5, 0 + movs r1, 0x4 + movs r2, 0x2 + movs r3, 0x6 + bl sub_80869E4 + ldr r0, _080882D0 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r5, 0 + movs r1, 0x6 + bl sub_8085918 + movs r0, 0x4 + movs r1, 0x46 + bl sub_803E708 + adds r0, r5, 0 + movs r1, 0x5 + bl sub_8085918 + movs r0, 0x4 + movs r1, 0x46 + bl sub_803E708 + adds r0, r5, 0 + movs r1, 0x6 + bl sub_8085918 + movs r0, 0x4 + movs r1, 0x46 + bl sub_803E708 + adds r0, r5, 0 + movs r1, 0x7 + bl sub_8085918 + movs r0, 0x4 + movs r1, 0x46 + bl sub_803E708 + adds r0, r5, 0 + movs r1, 0x6 + bl sub_8085918 + movs r0, 0x4 + movs r1, 0x46 + bl sub_803E708 + adds r0, r5, 0 + movs r1, 0x5 + bl sub_8085918 + movs r0, 0x4 + movs r1, 0x46 + bl sub_803E708 + adds r0, r5, 0 + movs r1, 0x6 + bl sub_8085918 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _080882D4 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _080882D8 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r5, 0 + movs r1, 0x4 + movs r2, 0x1 + movs r3, 0x4 + bl sub_80869E4 + adds r0, r6, 0 + movs r1, 0x4 + movs r2, 0x2 + movs r3, 0x4 + bl sub_80869E4 + ldr r4, _080882DC + adds r0, r4, 0 + bl sub_8083E38 + adds r0, r6, 0 + bl sub_808696C + adds r0, r4, 0 + bl sub_8083E38 + adds r0, r5, 0 + bl sub_808696C + ldr r0, _080882E0 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _080882E4 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r0, 0 + bl sub_8083E38 + ldr r0, _080882E8 + ldr r0, [r0] + ldr r1, _080882EC + adds r0, r1 + movs r1, 0x7 + strb r1, [r0] + movs r0, 0 + movs r1, 0x1 + bl sub_807EAA0 + movs r0, 0xF7 + lsls r0, 1 + bl sub_8083E38 + bl sub_8088574 + ldr r0, _080882F0 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_80884E0 + bl sub_8086738 + movs r0, 0xED + lsls r0, 1 + bl sub_8083E38 + ldr r0, _080882F4 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r0, 0xF5 + lsls r0, 1 + bl sub_8083E38 + mov r0, r8 + bl sub_8088484 + bl sub_80865E8 + bl sub_80884E0 + ldr r0, _080882F8 + bl sub_8052910 + mov r0, r8 + movs r1, 0xF + movs r2, 0 + bl sub_806CDD4 + bl sub_80884E0 + ldr r0, _080882FC + bl sub_8052910 + mov r0, r8 + movs r1, 0x10 + movs r2, 0 + bl sub_806CDD4 + bl sub_80884E0 + ldr r0, _08088300 + bl sub_8052910 + mov r0, r8 + movs r1, 0xF + movs r2, 0 + bl sub_806CDD4 + movs r0, 0x10 + movs r1, 0x46 + bl sub_803E708 + movs r1, 0xE1 + lsls r1, 1 + mov r0, r8 + movs r2, 0xB + bl sub_8086A70 + adds r5, 0xC + adds r0, r5, 0 + movs r1, 0x10 + bl sub_80858AC + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080882C8: .4byte gUnknown_8102478 +_080882CC: .4byte gUnknown_81025B4 +_080882D0: .4byte gUnknown_81025D4 +_080882D4: .4byte gUnknown_8102610 +_080882D8: .4byte gUnknown_81026C4 +_080882DC: .4byte 0x000001d5 +_080882E0: .4byte gUnknown_810270C +_080882E4: .4byte gUnknown_810272C +_080882E8: .4byte gUnknown_203B418 +_080882EC: .4byte 0x0000e265 +_080882F0: .4byte gUnknown_81027BC +_080882F4: .4byte gUnknown_8102810 +_080882F8: .4byte gUnknown_8102840 +_080882FC: .4byte gUnknown_810286C +_08088300: .4byte gUnknown_81028B8 + thumb_func_end sub_80880B8 + + thumb_func_start sub_8088304 +sub_8088304: + push {r4,r5,lr} + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0xD + bl sub_8085680 + adds r4, r0, 0 + ldr r0, _08088384 + ldr r0, [r0] + ldr r1, _08088388 + adds r0, r1 + movs r1, 0x7 + strb r1, [r0] + movs r0, 0 + movs r1, 0x1 + bl sub_807EAA0 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808838C + bl sub_8052910 + adds r0, r4, 0 + movs r1, 0x10 + movs r2, 0 + bl sub_806CDD4 + bl sub_80884E0 + ldr r0, _08088390 + bl sub_8052910 + bl sub_80884E0 + ldr r0, _08088394 + bl sub_8052910 + adds r0, r4, 0 + movs r1, 0xF + movs r2, 0 + bl sub_806CDD4 + movs r0, 0x28 + movs r1, 0x46 + bl sub_803E708 + movs r1, 0xE1 + lsls r1, 1 + adds r0, r4, 0 + movs r2, 0xB + bl sub_8086A70 + adds r5, 0xC + adds r0, r5, 0 + movs r1, 0x10 + bl sub_80858AC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08088384: .4byte gUnknown_203B418 +_08088388: .4byte 0x0000e265 +_0808838C: .4byte gUnknown_81028D4 +_08088390: .4byte gUnknown_8102918 +_08088394: .4byte gUnknown_8102948 + thumb_func_end sub_8088304 + + thumb_func_start sub_8088398 +sub_8088398: + push {r4,r5,lr} + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0xD + bl sub_8085680 + adds r4, r0, 0 + bl sub_8086448 + movs r0, 0x90 + bl sub_8086AE4 + lsls r0, 24 + cmp r0, 0 + beq _080883C4 + ldr r0, _080883C0 + bl sub_80866C4 + b _08088460 + .align 2, 0 +_080883C0: .4byte gUnknown_8102A9C +_080883C4: + ldr r0, _08088468 + ldr r0, [r0] + ldr r1, _0808846C + adds r0, r1 + movs r1, 0x7 + strb r1, [r0] + movs r0, 0 + movs r1, 0x1 + bl sub_807EAA0 + bl sub_80884E0 + bl sub_8086738 + movs r0, 0xED + lsls r0, 1 + bl sub_8083E38 + ldr r0, _08088470 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r4, 0 + bl sub_8088484 + bl sub_80884E0 + ldr r0, _08088474 + bl sub_8052910 + adds r0, r4, 0 + movs r1, 0xF + movs r2, 0 + bl sub_806CDD4 + bl sub_80884E0 + ldr r0, _08088478 + bl sub_8052910 + adds r0, r4, 0 + movs r1, 0x10 + movs r2, 0 + bl sub_806CDD4 + bl sub_80884E0 + ldr r0, _0808847C + bl sub_8052910 + bl sub_80884E0 + ldr r0, _08088480 + bl sub_8052910 + adds r0, r4, 0 + movs r1, 0xF + movs r2, 0 + bl sub_806CDD4 + movs r0, 0x28 + movs r1, 0x46 + bl sub_803E708 + movs r1, 0xE1 + lsls r1, 1 + adds r0, r4, 0 + movs r2, 0xB + bl sub_8086A70 + adds r0, r5, 0 + adds r0, 0xC + movs r1, 0x10 + bl sub_80858AC +_08088460: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08088468: .4byte gUnknown_203B418 +_0808846C: .4byte 0x0000e265 +_08088470: .4byte gUnknown_8102984 +_08088474: .4byte gUnknown_81029B4 +_08088478: .4byte gUnknown_8102A18 +_0808847C: .4byte gUnknown_8102A24 +_08088480: .4byte gUnknown_8102A74 + thumb_func_end sub_8088398 + + thumb_func_start sub_8088484 +sub_8088484: + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + ldr r0, [r5, 0x70] + movs r1, 0xAE + lsls r1, 1 + adds r0, r1 + movs r2, 0 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r5, 0x70] + movs r1, 0xAF + lsls r1, 1 + adds r0, r1 + strb r2, [r0] + movs r0, 0xF5 + lsls r0, 1 + bl sub_8083E38 + movs r4, 0xFA +_080884AC: + ldr r0, [r5, 0x70] + movs r1, 0xBA + lsls r1, 1 + adds r0, r1 + lsls r1, r4, 8 + str r1, [r0] + lsrs r2, r4, 31 + adds r2, r4, r2 + asrs r2, 1 + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0x5 + cmp r4, 0 + bge _080884AC + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8088484 + + thumb_func_start sub_80884E0 +sub_80884E0: + push {r4,r5,lr} + sub sp, 0x4 + ldr r0, _08088570 + bl sub_8083E38 + movs r4, 0xFA +_080884EC: + lsrs r0, r4, 31 + adds r0, r4, r0 + asrs r0, 1 + movs r1, 0x1 + str r1, [sp] + adds r1, r4, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0x95 + bgt _080884EC + movs r0, 0x4 + movs r1, 0x46 + bl sub_803E708 + movs r4, 0xFA + movs r5, 0x1 +_08088518: + str r5, [sp] + movs r0, 0 + adds r1, r4, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0xC7 + bgt _08088518 + movs r0, 0x4 + movs r1, 0x46 + bl sub_803E708 + movs r4, 0xFA +_0808853C: + lsrs r0, r4, 31 + adds r0, r4, r0 + asrs r0, 1 + movs r1, 0x1 + str r1, [sp] + adds r1, r4, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0 + bge _0808853C + movs r0, 0x4 + movs r1, 0x46 + bl sub_803E708 + bl sub_8085EB0 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08088570: .4byte 0x000002ad + thumb_func_end sub_80884E0 + + thumb_func_start sub_8088574 +sub_8088574: + push {r4,r5,lr} + sub sp, 0x4 + movs r4, 0 + movs r5, 0 +_0808857C: + str r5, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r4, 0 + movs r3, 0 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + adds r4, 0x8 + cmp r4, 0x50 + ble _0808857C + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8088574 + + thumb_func_start sub_80885A0 +sub_80885A0: + push {lr} + movs r0, 0x3C + bl sub_8083ED8 + movs r0, 0x3C + movs r1, 0x46 + bl sub_803E708 + bl sub_8083F14 + ldr r0, _080885C0 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x7] + pop {r0} + bx r0 + .align 2, 0 +_080885C0: .4byte gUnknown_203B418 + thumb_func_end sub_80885A0 + + thumb_func_start sub_80885C4 +sub_80885C4: + push {r4,lr} + bl sub_8085480 + adds r4, r0, 0 + movs r0, 0x3C + bl sub_8083ED8 + movs r0, 0x3C + movs r1, 0x46 + bl sub_803E708 + bl sub_8083F14 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + ldr r0, _08088604 + bl sub_80855E4 + movs r1, 0x4 + ldrsh r0, [r4, r1] + movs r2, 0x6 + ldrsh r1, [r4, r2] + subs r1, 0x3 + bl sub_8085860 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08088604: .4byte sub_8086A3C + thumb_func_end sub_80885C4 + + thumb_func_start sub_8088608 +sub_8088608: + ldr r0, _08088614 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x2] + bx lr + .align 2, 0 +_08088614: .4byte gUnknown_203B418 + thumb_func_end sub_8088608 + + thumb_func_start sub_8088618 +sub_8088618: + push {lr} + bl sub_8086448 + ldr r0, _08088628 + bl sub_80866C4 + pop {r0} + bx r0 + .align 2, 0 +_08088628: .4byte gUnknown_8102B10 + thumb_func_end sub_8088618 + + thumb_func_start sub_808862C +sub_808862C: + push {r4-r6,lr} + mov r6, r8 + push {r6} + bl sub_8085480 + mov r8, r0 + movs r0, 0xA + bl sub_8085680 + adds r5, r0, 0 + movs r0, 0xE + bl sub_8085680 + adds r6, r0, 0 + movs r0, 0x72 + bl sub_8083E88 + bl sub_80867F4 + bl sub_8085374 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + ldr r4, _080886B8 + adds r0, r4, 0 + bl sub_80855E4 + adds r0, r5, 0 + movs r1, 0x4 + bl sub_8085918 + adds r0, r5, 0 + movs r1, 0xD + movs r2, 0x4 + bl sub_80861D4 + adds r0, r6, 0 + movs r1, 0 + bl sub_8085918 + adds r0, r6, 0 + bl _call_via_r4 + mov r1, r8 + movs r2, 0x4 + ldrsh r0, [r1, r2] + movs r3, 0x6 + ldrsh r1, [r1, r3] + subs r1, 0x3 + bl sub_8085860 + ldr r4, _080886BC + ldr r1, _080886C0 + adds r0, r4, 0 + bl sub_808D8BC + adds r4, 0x50 + adds r0, r4, 0 + movs r1, 0x41 + bl sub_808D8BC + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080886B8: .4byte sub_8086A3C +_080886BC: .4byte gUnknown_202E038 +_080886C0: .4byte 0x0000019b + thumb_func_end sub_808862C + + thumb_func_start sub_80886C4 +sub_80886C4: + push {r4-r6,lr} + bl sub_8085480 + adds r6, r0, 0 + movs r0, 0xA + bl sub_8085680 + adds r5, r0, 0 + movs r0, 0xE + bl sub_8085680 + adds r4, r0, 0 + ldr r0, _0808874C + bl sub_8083E38 + bl sub_80867F4 + bl sub_8085374 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + movs r1, 0x87 + lsls r1, 2 + adds r0, r5, 0 + movs r2, 0 + bl sub_8068FE0 + adds r0, r4, 0 + movs r1, 0 + bl sub_8085918 + adds r0, r4, 0 + bl sub_8086A3C + movs r1, 0x4 + ldrsh r0, [r6, r1] + movs r2, 0x6 + ldrsh r1, [r6, r2] + bl sub_8085860 + bl sub_803F994 + adds r4, r0, 0 + bl sub_803F9B0 + adds r1, r0, 0 + ldr r0, _08088750 + adds r1, r0 + adds r0, r4, 0 + bl sub_803F878 + ldr r4, _08088754 + ldr r1, _08088758 + adds r0, r4, 0 + bl sub_808D8BC + adds r4, 0x50 + adds r0, r4, 0 + movs r1, 0x41 + bl sub_808D8BC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0808874C: .4byte 0x000003e5 +_08088750: .4byte 0xfffff000 +_08088754: .4byte gUnknown_202E038 +_08088758: .4byte 0x0000019b + thumb_func_end sub_80886C4 + + thumb_func_start sub_808875C +sub_808875C: + push {r4-r7,lr} + sub sp, 0x4 + bl sub_8085480 + adds r7, r0, 0 + movs r0, 0xA + bl sub_8085680 + adds r4, r0, 0 + movs r0, 0xE + bl sub_8085680 + adds r5, r0, 0 + bl sub_80867F4 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + ldr r0, _080887B4 + bl sub_80855E4 + movs r6, 0x87 + lsls r6, 2 + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_8068FE0 + ldr r0, _080887B8 + bl sub_8086AE4 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _080887BC + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_8068FE0 + b _080887E0 + .align 2, 0 +_080887B4: .4byte sub_8086A3C +_080887B8: .4byte 0x0000019b +_080887BC: + ldr r0, _0808880C + movs r3, 0 + ldrsh r2, [r0, r3] + str r1, [sp] + adds r0, r5, 0 + adds r1, r5, 0 + movs r3, 0 + bl sub_8072008 + adds r0, r5, 0 + movs r1, 0 + bl sub_8085918 + adds r0, r5, 0 + movs r1, 0xF + movs r2, 0 + bl sub_80861D4 +_080887E0: + movs r1, 0x4 + ldrsh r0, [r7, r1] + movs r2, 0x6 + ldrsh r1, [r7, r2] + subs r1, 0x3 + bl sub_8085860 + ldr r4, _08088810 + ldr r1, _08088814 + adds r0, r4, 0 + bl sub_808D8BC + adds r4, 0x50 + adds r0, r4, 0 + movs r1, 0x41 + bl sub_808D8BC + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0808880C: .4byte gUnknown_80F57D2 +_08088810: .4byte gUnknown_202E038 +_08088814: .4byte 0x0000019b + thumb_func_end sub_808875C + + thumb_func_start sub_8088818 +sub_8088818: + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + movs r2, 0xEE + lsls r2, 24 + adds r1, r2 + lsrs r1, 24 + cmp r1, 0x2 + bhi _0808883E + cmp r0, 0xE + bne _0808883E + movs r0, 0xC + bl sub_8097FA8 + ldr r0, _08088844 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x2] +_0808883E: + pop {r0} + bx r0 + .align 2, 0 +_08088844: .4byte gUnknown_203B418 + thumb_func_end sub_8088818 + + thumb_func_start sub_8088848 +sub_8088848: + push {lr} + bl sub_8086854 + pop {r0} + bx r0 + thumb_func_end sub_8088848 + + thumb_func_start sub_8088854 +sub_8088854: + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + bl sub_8085480 + adds r5, r0, 0 + bl sub_808548C + mov r8, r0 + movs r0, 0xA + bl sub_8085680 + adds r6, r0, 0 + movs r0, 0xE + bl sub_8085680 + mov r9, r0 + bl sub_8086448 + ldr r0, _08088A5C + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r0, 0x3C + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08088A60 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x1 + bl sub_8086838 + bl sub_808680C + movs r0, 0x3C + movs r1, 0x46 + bl sub_803E708 + bl sub_808682C + movs r0, 0x1E + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08088A64 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x1 + bl sub_8086838 + bl sub_808680C + movs r0, 0x3C + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08088A68 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_8088CA0 + ldr r0, _08088A6C + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08088A70 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r4, _08088A74 + adds r0, r4, 0 + bl sub_8083E38 + mov r0, r8 + bl sub_808696C + ldr r0, _08088A78 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_808682C + movs r0, 0x3C + movs r1, 0x46 + bl sub_803E708 + adds r0, r6, 0 + movs r1, 0x6 + movs r2, 0x4 + bl sub_80861B8 + ldr r0, _08088A7C + bl sub_8083E38 + bl sub_8086738 + movs r1, 0x87 + lsls r1, 2 + adds r0, r6, 0 + movs r2, 0 + bl sub_8068FE0 + ldr r0, _08088A80 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08088A84 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r0, 0x4 + bl sub_8085930 + bl sub_8086764 + movs r0, 0x28 + movs r1, 0x46 + bl sub_803E708 + adds r0, r4, 0 + bl sub_8083E38 + mov r0, r8 + bl sub_808696C + ldr r0, _08088A88 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x1 + bl sub_8086838 + bl sub_808680C + movs r0, 0x3C + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08088A8C + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_8083F14 + bl sub_8088D30 + movs r0, 0x1E + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08088A90 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08088A94 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r0, 0x1E + movs r1, 0x46 + bl sub_803E708 + bl sub_808682C + movs r0, 0x3C + movs r1, 0x46 + bl sub_803E708 + movs r0, 0xFD + lsls r0, 1 + bl sub_8083E38 + bl sub_8086738 + movs r0, 0x4 + bl sub_8085930 + ldr r0, _08088A98 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + mov r0, r9 + bl sub_8086A54 + movs r0, 0x4 + bl sub_8085930 + bl sub_8086764 + movs r1, 0xFA + lsls r1, 1 + mov r0, r9 + movs r2, 0xB + bl sub_8086A70 + adds r5, 0xC + adds r0, r5, 0 + movs r1, 0x10 + bl sub_80858AC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08088A5C: .4byte gUnknown_8102E70 +_08088A60: .4byte gUnknown_8102EBC +_08088A64: .4byte gUnknown_8102EE0 +_08088A68: .4byte gUnknown_8102EF8 +_08088A6C: .4byte gUnknown_8102F30 +_08088A70: .4byte gUnknown_8102F64 +_08088A74: .4byte 0x000001d5 +_08088A78: .4byte gUnknown_8102F84 +_08088A7C: .4byte 0x00000205 +_08088A80: .4byte gUnknown_8102FAC +_08088A84: .4byte gUnknown_8102FC4 +_08088A88: .4byte gUnknown_8102FD8 +_08088A8C: .4byte gUnknown_8103054 +_08088A90: .4byte gUnknown_81030D8 +_08088A94: .4byte gUnknown_8103110 +_08088A98: .4byte gUnknown_8103140 + thumb_func_end sub_8088854 + + thumb_func_start sub_8088A9C +sub_8088A9C: + push {r4,r5,lr} + bl sub_8085480 + adds r4, r0, 0 + movs r0, 0xE + bl sub_8085680 + adds r5, r0, 0 + movs r0, 0x1 + movs r1, 0x1 + movs r2, 0x1 + bl sub_8086838 + bl sub_808680C + movs r0, 0x3C + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08088B50 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_8088CA0 + movs r0, 0x1E + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08088B54 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08088B58 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_808682C + movs r0, 0x3C + movs r1, 0x46 + bl sub_803E708 + bl sub_8083F14 + movs r0, 0xFD + lsls r0, 1 + bl sub_8083E38 + bl sub_8086738 + ldr r0, _08088B5C + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r5, 0 + bl sub_8086A54 + movs r0, 0x4 + bl sub_8085930 + bl sub_8086764 + movs r1, 0xFA + lsls r1, 1 + adds r0, r5, 0 + movs r2, 0xB + bl sub_8086A70 + adds r4, 0xC + adds r0, r4, 0 + movs r1, 0x10 + bl sub_80858AC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08088B50: .4byte gUnknown_8103188 +_08088B54: .4byte gUnknown_8103228 +_08088B58: .4byte gUnknown_8103310 +_08088B5C: .4byte gUnknown_8103340 + thumb_func_end sub_8088A9C + + thumb_func_start sub_8088B60 +sub_8088B60: + push {r4-r6,lr} + bl sub_8085480 + adds r6, r0, 0 + movs r0, 0xE + bl sub_8085680 + adds r5, r0, 0 + bl sub_8086448 + ldr r0, _08088B88 + bl sub_8086AE4 + lsls r0, 24 + cmp r0, 0 + beq _08088B90 + ldr r0, _08088B8C + bl sub_80866C4 + b _08088BF2 + .align 2, 0 +_08088B88: .4byte 0x0000019b +_08088B8C: .4byte gUnknown_8103488 +_08088B90: + ldr r0, _08088BF8 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r5, 0 + bl sub_8088C08 + adds r0, r5, 0 + bl sub_8088C08 + ldr r0, _08088BFC + bl sub_8052910 + movs r4, 0xFB + lsls r4, 1 + adds r0, r4, 0 + bl sub_8083E38 + bl sub_8088CA0 + ldr r0, _08088C00 + bl sub_8052910 + adds r0, r4, 0 + bl sub_8083E38 + bl sub_8088CA0 + ldr r0, _08088C04 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r1, 0xFA + lsls r1, 1 + adds r0, r5, 0 + movs r2, 0xB + bl sub_8086A70 + adds r0, r6, 0 + adds r0, 0xC + movs r1, 0x10 + bl sub_80858AC +_08088BF2: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08088BF8: .4byte gUnknown_81033A0 +_08088BFC: .4byte gUnknown_81033AC +_08088C00: .4byte gUnknown_810343C +_08088C04: .4byte gUnknown_810347C + thumb_func_end sub_8088B60 + + thumb_func_start sub_8088C08 +sub_8088C08: + push {r4,r5,lr} + adds r5, r0, 0 + movs r0, 0x18 + movs r1, 0x10 + bl sub_8086848 + adds r0, r5, 0 + movs r1, 0 + movs r2, 0 + bl sub_806CDD4 + movs r4, 0 +_08088C20: + cmp r4, 0xA + beq _08088C28 + cmp r4, 0x20 + bne _08088C3C +_08088C28: + ldr r0, _08088C9C + bl sub_8083E38 + movs r0, 0 + movs r1, 0x1 + movs r2, 0 + bl sub_8086838 + bl sub_808680C +_08088C3C: + adds r0, r4, 0 + subs r0, 0xA + cmp r0, 0xB + bls _08088C48 + cmp r4, 0x1F + ble _08088C54 +_08088C48: + adds r0, r5, 0 + movs r1, 0 + movs r2, 0x80 + lsls r2, 1 + bl sub_804539C +_08088C54: + movs r0, 0x46 + bl sub_803E46C + adds r4, 0x1 + cmp r4, 0x2B + ble _08088C20 + movs r0, 0x4 + ldrsh r1, [r5, r0] + movs r0, 0x6 + ldrsh r2, [r5, r0] + adds r2, 0x1 + adds r0, r5, 0 + bl sub_80856C8 + adds r0, r5, 0 + movs r1, 0xF + movs r2, 0 + bl sub_80861D4 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_808682C + movs r0, 0x4 + bl sub_8085930 + movs r0, 0x22 + movs r1, 0x46 + bl sub_803E708 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08088C9C: .4byte 0x000001f9 + thumb_func_end sub_8088C08 + + thumb_func_start sub_8088CA0 +sub_8088CA0: + push {r4,lr} + sub sp, 0x4 + movs r4, 0xFA +_08088CA6: + lsrs r2, r4, 31 + adds r2, r4, r2 + asrs r2, 1 + movs r0, 0x1 + str r0, [sp] + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0x95 + bgt _08088CA6 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r4, 0xFA +_08088CD0: + lsrs r1, r4, 31 + adds r1, r4, r1 + asrs r1, 1 + movs r0, 0x1 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0xC7 + bgt _08088CD0 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r4, 0xFA +_08088CFA: + lsrs r2, r4, 31 + adds r2, r4, r2 + asrs r2, 1 + movs r0, 0x1 + str r0, [sp] + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0 + bge _08088CFA + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_8085EB0 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8088CA0 + + thumb_func_start sub_8088D30 +sub_8088D30: + push {r4,lr} + sub sp, 0x4 + movs r4, 0xFA +_08088D36: + lsrs r2, r4, 31 + adds r2, r4, r2 + asrs r2, 1 + movs r0, 0x1 + str r0, [sp] + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0x95 + bgt _08088D36 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r4, 0xFA +_08088D60: + lsrs r1, r4, 31 + adds r1, r4, r1 + asrs r1, 1 + movs r0, 0x1 + str r0, [sp] + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0xC7 + bgt _08088D60 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r4, 0xFA +_08088D8A: + lsrs r2, r4, 31 + adds r2, r4, r2 + asrs r2, 1 + movs r0, 0x1 + str r0, [sp] + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0 + bge _08088D8A + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_8085EB0 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8088D30 + + thumb_func_start sub_8088DC0 +sub_8088DC0: + push {r4-r6,lr} + mov r6, r8 + push {r6} + bl sub_8085480 + mov r8, r0 + movs r0, 0xB + bl sub_8085680 + adds r5, r0, 0 + movs r0, 0xC + bl sub_8085680 + adds r6, r0, 0 + bl sub_80867F4 + movs r0, 0 + movs r1, 0x1 + movs r2, 0 + bl sub_8086838 + bl sub_8085374 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + ldr r4, _08088E50 + adds r0, r4, 0 + bl sub_80855E4 + adds r0, r5, 0 + bl _call_via_r4 + adds r0, r5, 0 + movs r1, 0xE + movs r2, 0 + bl sub_806CDD4 + adds r0, r6, 0 + bl _call_via_r4 + adds r0, r6, 0 + movs r1, 0xE + movs r2, 0 + bl sub_806CDD4 + mov r1, r8 + movs r2, 0x4 + ldrsh r0, [r1, r2] + movs r3, 0x6 + ldrsh r1, [r1, r3] + subs r1, 0x3 + bl sub_8085860 + ldr r4, _08088E54 + ldr r1, _08088E58 + adds r0, r4, 0 + bl sub_808D8BC + adds r4, 0x50 + adds r0, r4, 0 + movs r1, 0x41 + bl sub_808D8BC + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08088E50: .4byte sub_8086A3C +_08088E54: .4byte gUnknown_202E038 +_08088E58: .4byte 0x0000019b + thumb_func_end sub_8088DC0 + + thumb_func_start sub_8088E5C +sub_8088E5C: + push {r4-r6,lr} + mov r6, r8 + push {r6} + bl sub_8085480 + mov r8, r0 + movs r0, 0xB + bl sub_8085680 + adds r5, r0, 0 + movs r0, 0xC + bl sub_8085680 + adds r6, r0, 0 + bl sub_80867F4 + movs r0, 0 + movs r1, 0x1 + movs r2, 0 + bl sub_8086838 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + ldr r0, _08088EDC + bl sub_80855E4 + movs r4, 0x87 + lsls r4, 2 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_8068FE0 + adds r0, r6, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_8068FE0 + mov r1, r8 + movs r2, 0x4 + ldrsh r0, [r1, r2] + movs r3, 0x6 + ldrsh r1, [r1, r3] + subs r1, 0x3 + bl sub_8085860 + ldr r4, _08088EE0 + ldr r1, _08088EE4 + adds r0, r4, 0 + bl sub_808D8BC + adds r4, 0x50 + adds r0, r4, 0 + movs r1, 0x41 + bl sub_808D8BC + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08088EDC: .4byte sub_8086A3C +_08088EE0: .4byte gUnknown_202E038 +_08088EE4: .4byte 0x0000019b + thumb_func_end sub_8088E5C + + thumb_func_start sub_8088EE8 +sub_8088EE8: + push {lr} + bl sub_8086854 + pop {r0} + bx r0 + thumb_func_end sub_8088EE8 + + thumb_func_start sub_8088EF4 +sub_8088EF4: + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0xC + bl sub_8085480 + mov r9, r0 + bl sub_808548C + adds r5, r0, 0 + movs r0, 0xB + bl sub_8085680 + mov r8, r0 + movs r0, 0xC + bl sub_8085680 + adds r6, r0, 0 + mov r0, sp + mov r1, r9 + adds r2, r5, 0 + bl sub_8052D44 + bl sub_8086448 + adds r0, r5, 0 + bl sub_808696C + ldr r0, _08089118 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r5, 0 + movs r1, 0x4 + movs r2, 0x1 + movs r3, 0x2 + bl sub_80869E4 + mov r0, r9 + movs r1, 0x4 + movs r2, 0x2 + movs r3, 0x6 + bl sub_80869E4 + ldr r0, _0808911C + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_8083F14 + ldr r0, _08089120 + bl sub_80855E4 + bl sub_808680C + ldr r4, _08089124 + adds r0, r4, 0 + bl sub_8083E38 + movs r0, 0x28 + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08089128 + bl sub_8052910 + movs r0, 0x78 + movs r1, 0x46 + bl sub_803E708 + adds r0, r4, 0 + bl sub_8083E58 + bl sub_808682C + ldr r0, _0808912C + bl sub_80855E4 + movs r0, 0x14 + movs r1, 0x46 + bl sub_803E708 + movs r0, 0x4 + bl sub_8085930 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08089130 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r4, 0x10 + adds r0, r4, 0 + bl sub_8083E38 + adds r0, r5, 0 + bl sub_808696C + ldr r0, _08089134 + bl sub_8083E38 + adds r0, r5, 0 + movs r1, 0x4 + bl sub_80856E0 + ldr r0, _08089138 + bl sub_8052910 + mov r1, r8 + ldr r0, [r1, 0x70] + movs r2, 0xAF + lsls r2, 1 + adds r0, r2 + movs r1, 0 + strb r1, [r0] + ldr r0, [r6, 0x70] + adds r0, r2 + strb r1, [r0] + mov r1, r8 + ldr r0, [r1, 0xC] + ldr r1, [r6, 0xC] + adds r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + str r0, [sp, 0x4] + mov r0, r8 + ldr r1, [r0, 0x10] + ldr r0, [r6, 0x10] + adds r1, r0 + lsrs r0, r1, 31 + adds r1, r0 + asrs r1, 1 + movs r0, 0x80 + lsls r0, 4 + adds r1, r0 + add r0, sp, 0x4 + str r1, [r0, 0x4] + movs r1, 0x20 + bl sub_80858AC + movs r0, 0x3C + movs r1, 0x46 + bl sub_803E708 + bl sub_80891F0 + ldr r0, _0808913C + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08089140 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + mov r0, r9 + movs r1, 0x4 + movs r2, 0x2 + movs r3, 0x5 + bl sub_80869E4 + ldr r0, _08089144 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08089148 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808914C + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + mov r0, r9 + movs r1, 0x4 + movs r2, 0x1 + movs r3, 0x3 + bl sub_80869E4 + adds r0, r5, 0 + movs r1, 0x4 + movs r2, 0x1 + movs r3, 0x3 + bl sub_80869E4 + ldr r0, _08089150 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r4, 0 + bl sub_8083E38 + adds r0, r5, 0 + bl sub_808696C + ldr r0, _08089154 + bl sub_8052910 + movs r0, 0x1E + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08089158 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r5, 0 + movs r1, 0x4 + movs r2, 0x1 + movs r3, 0x2 + bl sub_80869E4 + mov r0, r9 + movs r1, 0x4 + movs r2, 0x2 + movs r3, 0x6 + bl sub_80869E4 + ldr r0, _0808915C + bl sub_8052910 + bl sub_8089294 + ldr r0, _08089160 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08089164 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x2] + add sp, 0xC + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08089118: .4byte gUnknown_8102B1C +_0808911C: .4byte gUnknown_8102B54 +_08089120: .4byte sub_80868F4 +_08089124: .4byte 0x000001c5 +_08089128: .4byte gUnknown_8102BC4 +_0808912C: .4byte sub_8086910 +_08089130: .4byte gUnknown_8102BE4 +_08089134: .4byte 0x000001c7 +_08089138: .4byte gUnknown_8102C30 +_0808913C: .4byte gUnknown_8102C54 +_08089140: .4byte gUnknown_8102C98 +_08089144: .4byte gUnknown_8102CB0 +_08089148: .4byte gUnknown_8102CF8 +_0808914C: .4byte gUnknown_8102D34 +_08089150: .4byte gUnknown_8102D4C +_08089154: .4byte gUnknown_8102D7C +_08089158: .4byte gUnknown_8102DFC +_0808915C: .4byte gUnknown_8102E2C +_08089160: .4byte gUnknown_8102E54 +_08089164: .4byte gUnknown_203B418 + thumb_func_end sub_8088EF4 + + thumb_func_start sub_8089168 +sub_8089168: + push {r4,lr} + bl sub_8085480 + adds r4, r0, 0 + bl sub_8086448 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r4, 0 + bl sub_808696C + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r4, 0xC + adds r0, r4, 0 + movs r1, 0x10 + bl sub_80858AC + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8089168 + + thumb_func_start sub_808919C +sub_808919C: + push {lr} + ldr r2, _080891AC + movs r1, 0 + bl sub_804539C + pop {r0} + bx r0 + .align 2, 0 +_080891AC: .4byte 0xfffffe00 + thumb_func_end sub_808919C + + thumb_func_start sub_80891B0 +sub_80891B0: + push {r4,lr} + adds r4, r0, 0 + movs r1, 0 + movs r2, 0x4 + bl sub_806CDD4 + ldr r0, [r4, 0x70] + ldr r2, _080891CC + adds r1, r0, r2 + movs r0, 0x1 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080891CC: .4byte 0x0000015f + thumb_func_end sub_80891B0 + + thumb_func_start sub_80891D0 +sub_80891D0: + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x7 + movs r2, 0x4 + bl sub_806CDD4 + ldr r0, [r4, 0x70] + ldr r2, _080891EC + adds r1, r0, r2 + movs r0, 0 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080891EC: .4byte 0x0000015f + thumb_func_end sub_80891D0 + + thumb_func_start sub_80891F0 +sub_80891F0: + push {r4,lr} + ldr r0, _08089218 + bl sub_80855E4 + movs r4, 0x2F +_080891FA: + ldr r0, _0808921C + bl sub_80855E4 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0x1 + cmp r4, 0 + bge _080891FA + ldr r0, _08089220 + bl sub_80855E4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08089218: .4byte sub_80891B0 +_0808921C: .4byte sub_808919C +_08089220: .4byte sub_80891D0 + thumb_func_end sub_80891F0 + + thumb_func_start sub_8089224 +sub_8089224: + push {lr} + adds r3, r0, 0 + ldr r1, [r3, 0x10] + movs r0, 0x90 + lsls r0, 8 + cmp r1, r0 + ble _0808928C + ldr r1, [r3, 0xC] + ldr r0, _08089248 + cmp r1, r0 + bgt _08089250 + movs r0, 0xB4 + lsls r0, 8 + cmp r1, r0 + ble _08089256 + ldr r1, _0808924C + b _08089278 + .align 2, 0 +_08089248: .4byte 0x0000e3ff +_0808924C: .4byte 0xfffffe00 +_08089250: + ldr r0, _08089264 + cmp r1, r0 + bgt _0808926C +_08089256: + ldr r2, _08089268 + adds r0, r3, 0 + movs r1, 0 + bl sub_804539C + b _0808928C + .align 2, 0 +_08089264: .4byte 0x0000fbff +_08089268: .4byte 0xfffffe00 +_0808926C: + movs r0, 0x8A + lsls r0, 9 + cmp r1, r0 + bgt _08089282 + movs r1, 0x80 + lsls r1, 2 +_08089278: + adds r0, r3, 0 + movs r2, 0 + bl sub_804539C + b _0808928C +_08089282: + ldr r2, _08089290 + adds r0, r3, 0 + movs r1, 0 + bl sub_804539C +_0808928C: + pop {r0} + bx r0 + .align 2, 0 +_08089290: .4byte 0xfffffe00 + thumb_func_end sub_8089224 + + thumb_func_start sub_8089294 +sub_8089294: + push {r4,lr} + ldr r0, _080892BC + bl sub_80855E4 + movs r4, 0x77 +_0808929E: + ldr r0, _080892C0 + bl sub_80855E4 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0x1 + cmp r4, 0 + bge _0808929E + ldr r0, _080892C4 + bl sub_80855E4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080892BC: .4byte sub_80891B0 +_080892C0: .4byte sub_8089224 +_080892C4: .4byte sub_80891D0 + thumb_func_end sub_8089294 + + thumb_func_start sub_80892C8 +sub_80892C8: + push {r4-r6,lr} + bl sub_8085480 + adds r6, r0, 0 + movs r0, 0xF + bl sub_8085680 + adds r5, r0, 0 + movs r0, 0x1A + bl sub_8083E88 + bl sub_8085374 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + ldr r4, _08089320 + adds r0, r4, 0 + bl sub_80855E4 + adds r0, r5, 0 + movs r1, 0 + bl sub_8085918 + adds r0, r5, 0 + bl _call_via_r4 + movs r1, 0x4 + ldrsh r0, [r6, r1] + movs r2, 0x6 + ldrsh r1, [r6, r2] + subs r1, 0x3 + bl sub_8085860 + ldr r0, _08089324 + movs r1, 0xCE + lsls r1, 1 + bl sub_808D8BC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08089320: .4byte sub_8086A3C +_08089324: .4byte gUnknown_202E038 + thumb_func_end sub_80892C8 + + thumb_func_start sub_8089328 +sub_8089328: + push {r4-r6,lr} + sub sp, 0x4 + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0xF + bl sub_8085680 + adds r4, r0, 0 + movs r0, 0x1A + bl sub_8083E88 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + ldr r6, _08089370 + adds r0, r6, 0 + bl sub_80855E4 + movs r0, 0xCE + lsls r0, 1 + bl sub_8086AE4 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _08089374 + movs r1, 0x87 + lsls r1, 2 + adds r0, r4, 0 + movs r2, 0 + bl sub_8068FE0 + b _0808938C + .align 2, 0 +_08089370: .4byte sub_8086A3C +_08089374: + ldr r0, _080893AC + movs r3, 0 + ldrsh r2, [r0, r3] + str r1, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + movs r3, 0 + bl sub_8072008 + adds r0, r4, 0 + bl _call_via_r6 +_0808938C: + movs r1, 0x4 + ldrsh r0, [r5, r1] + movs r2, 0x6 + ldrsh r1, [r5, r2] + subs r1, 0x3 + bl sub_8085860 + ldr r0, _080893B0 + movs r1, 0xCE + lsls r1, 1 + bl sub_808D8BC + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080893AC: .4byte gUnknown_80F57CA +_080893B0: .4byte gUnknown_202E038 + thumb_func_end sub_8089328 + + thumb_func_start sub_80893B4 +sub_80893B4: + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + movs r2, 0xE9 + lsls r2, 24 + adds r1, r2 + lsrs r1, 24 + cmp r1, 0x2 + bhi _080893DA + cmp r0, 0xF + bne _080893DA + movs r0, 0xF + bl sub_8097FA8 + ldr r0, _080893E0 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x2] +_080893DA: + pop {r0} + bx r0 + .align 2, 0 +_080893E0: .4byte gUnknown_203B418 + thumb_func_end sub_80893B4 + + thumb_func_start sub_80893E4 +sub_80893E4: + push {r4-r6,lr} + bl sub_8085480 + adds r5, r0, 0 + bl sub_808548C + adds r4, r0, 0 + movs r0, 0xF + bl sub_8085680 + adds r6, r0, 0 + bl sub_8086448 + ldr r0, _080894D4 + bl sub_8052910 + bl sub_8089674 + ldr r0, _080894D8 + bl sub_8052910 + adds r0, r4, 0 + movs r1, 0x4 + bl sub_80856E0 + adds r0, r4, 0 + bl sub_808696C + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r4, 0 + movs r1, 0x4 + movs r2, 0x1 + movs r3, 0x2 + bl sub_80869E4 + adds r0, r5, 0 + movs r1, 0x4 + movs r2, 0x2 + movs r3, 0x6 + bl sub_80869E4 + ldr r0, _080894DC + bl sub_8052910 + adds r0, r4, 0 + movs r1, 0x4 + movs r2, 0x2 + movs r3, 0x4 + bl sub_80869E4 + adds r0, r5, 0 + movs r1, 0x4 + movs r2, 0x1 + movs r3, 0x4 + bl sub_80869E4 + ldr r0, _080894E0 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _080894E4 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _080894E8 + bl sub_8052910 + bl sub_8089674 + movs r0, 0xED + lsls r0, 1 + bl sub_8083E38 + ldr r0, _080894EC + bl sub_8052910 + adds r0, r6, 0 + bl sub_8089620 + ldr r0, _080894F0 + bl sub_8052910 + bl sub_8089674 + ldr r0, _080894F4 + bl sub_8052910 + bl sub_8089674 + ldr r0, _080894F8 + bl sub_8052910 + bl sub_8089674 + ldr r0, _080894FC + bl sub_8052910 + movs r1, 0x96 + lsls r1, 2 + adds r0, r6, 0 + movs r2, 0x20 + bl sub_8086A70 + adds r5, 0xC + adds r0, r5, 0 + movs r1, 0x10 + bl sub_80858AC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080894D4: .4byte gUnknown_8103500 +_080894D8: .4byte gUnknown_810352C +_080894DC: .4byte gUnknown_8103578 +_080894E0: .4byte gUnknown_81035D4 +_080894E4: .4byte gUnknown_8103618 +_080894E8: .4byte gUnknown_810367C +_080894EC: .4byte gUnknown_8103690 +_080894F0: .4byte gUnknown_81036C8 +_080894F4: .4byte gUnknown_81037A0 +_080894F8: .4byte gUnknown_81037D4 +_080894FC: .4byte gUnknown_8103820 + thumb_func_end sub_80893E4 + + thumb_func_start sub_8089500 +sub_8089500: + push {r4,r5,lr} + bl sub_8085480 + adds r4, r0, 0 + movs r0, 0xF + bl sub_8085680 + adds r5, r0, 0 + bl sub_8086448 + bl sub_8089674 + movs r0, 0xED + lsls r0, 1 + bl sub_8083E38 + ldr r0, _08089574 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r5, 0 + bl sub_8089620 + ldr r0, _08089578 + bl sub_8052910 + bl sub_8089674 + ldr r0, _0808957C + bl sub_8052910 + bl sub_8089674 + ldr r0, _08089580 + bl sub_8052910 + bl sub_8089674 + ldr r0, _08089584 + bl sub_8052910 + movs r1, 0x96 + lsls r1, 2 + adds r0, r5, 0 + movs r2, 0x20 + bl sub_8086A70 + adds r4, 0xC + adds r0, r4, 0 + movs r1, 0x10 + bl sub_80858AC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08089574: .4byte gUnknown_8103690 +_08089578: .4byte gUnknown_8103844 +_0808957C: .4byte gUnknown_8103874 +_08089580: .4byte gUnknown_81038A8 +_08089584: .4byte gUnknown_81038F8 + thumb_func_end sub_8089500 + + thumb_func_start sub_8089588 +sub_8089588: + push {r4,r5,lr} + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0xF + bl sub_8085680 + adds r4, r0, 0 + bl sub_8086448 + movs r0, 0xCE + lsls r0, 1 + bl sub_8086AE4 + lsls r0, 24 + cmp r0, 0 + beq _080895B8 + ldr r0, _080895B4 + bl sub_80866C4 + b _08089606 + .align 2, 0 +_080895B4: .4byte gUnknown_8103B58 +_080895B8: + movs r0, 0xED + lsls r0, 1 + bl sub_8083E38 + ldr r0, _0808960C + bl sub_8052910 + adds r0, r4, 0 + bl sub_8089620 + ldr r0, _08089610 + bl sub_8052910 + bl sub_8089674 + ldr r0, _08089614 + bl sub_8052910 + bl sub_8089674 + ldr r0, _08089618 + bl sub_8052910 + bl sub_8089674 + ldr r0, _0808961C + bl sub_8052910 + movs r1, 0x96 + lsls r1, 2 + adds r0, r4, 0 + movs r2, 0xB + bl sub_8086A70 + adds r0, r5, 0 + adds r0, 0xC + movs r1, 0x10 + bl sub_80858AC +_08089606: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808960C: .4byte gUnknown_8103904 +_08089610: .4byte gUnknown_8103938 +_08089614: .4byte gUnknown_8103AA4 +_08089618: .4byte gUnknown_8103AE4 +_0808961C: .4byte gUnknown_8103B30 + thumb_func_end sub_8089588 + + thumb_func_start sub_8089620 +sub_8089620: + push {r4-r6,lr} + adds r6, r0, 0 + ldr r0, [r6, 0x70] + movs r2, 0xAF + lsls r2, 1 + adds r1, r0, r2 + movs r0, 0 + strb r0, [r1] + movs r5, 0xC8 + lsls r5, 8 + movs r4, 0xC0 + lsls r4, 3 + movs r0, 0xFC + lsls r0, 1 + bl sub_8083E38 + b _08089652 +_08089642: + ldr r0, [r6, 0x70] + movs r1, 0xBA + lsls r1, 1 + adds r0, r1 + str r5, [r0] + movs r0, 0x46 + bl sub_803E46C +_08089652: + subs r5, r4 + subs r4, 0x18 + cmp r4, 0x13 + bgt _0808965C + movs r4, 0x14 +_0808965C: + cmp r5, 0 + bge _08089642 + ldr r0, [r6, 0x70] + movs r2, 0xBA + lsls r2, 1 + adds r0, r2 + movs r1, 0 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8089620 + + thumb_func_start sub_8089674 +sub_8089674: + push {r4,lr} + sub sp, 0x4 + movs r0, 0xFB + lsls r0, 1 + bl sub_8083E38 + movs r4, 0xFA +_08089682: + lsrs r2, r4, 31 + adds r2, r4, r2 + asrs r2, 1 + movs r0, 0x1 + str r0, [sp] + adds r0, r2, 0 + adds r1, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0x95 + bgt _08089682 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r4, 0xFA +_080896AC: + lsrs r0, r4, 31 + adds r0, r4, r0 + asrs r0, 1 + movs r1, 0x1 + str r1, [sp] + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0xC7 + bgt _080896AC + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r4, 0xFA +_080896D6: + lsrs r2, r4, 31 + adds r2, r4, r2 + asrs r2, 1 + movs r0, 0x1 + str r0, [sp] + adds r0, r2, 0 + adds r1, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0 + bge _080896D6 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_8085EB0 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8089674 + + thumb_func_start sub_808970C +sub_808970C: + push {r4,lr} + bl sub_8085480 + adds r4, r0, 0 + movs r0, 0x7D + bl sub_8083E88 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + ldr r0, _08089744 + bl sub_80855E4 + ldr r0, _08089748 + bl sub_808563C + movs r1, 0x4 + ldrsh r0, [r4, r1] + movs r2, 0x6 + ldrsh r1, [r4, r2] + subs r1, 0x3 + bl sub_8085860 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08089744: .4byte sub_8086A3C +_08089748: .4byte sub_8089908 + thumb_func_end sub_808970C + + thumb_func_start sub_808974C +sub_808974C: + push {r4,lr} + bl sub_8085480 + adds r4, r0, 0 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + ldr r0, _08089780 + bl sub_80855E4 + ldr r0, _08089784 + bl sub_808563C + movs r1, 0x4 + ldrsh r0, [r4, r1] + movs r2, 0x6 + ldrsh r1, [r4, r2] + subs r1, 0x3 + bl sub_8085860 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08089780: .4byte sub_8086A3C +_08089784: .4byte sub_80898F8 + thumb_func_end sub_808974C + + thumb_func_start sub_8089788 +sub_8089788: + push {r4-r7,lr} + adds r7, r0, 0 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r2, 24 + movs r0, 0xE6 + lsls r0, 24 + adds r2, r0 + lsrs r2, 24 + cmp r2, 0x1 + bhi _080897E2 + movs r5, 0 +_080897A0: + ldr r0, _080897E8 + ldr r0, [r0] + lsls r1, r5, 2 + ldr r2, _080897EC + adds r0, r2 + adds r0, r1 + ldr r4, [r0] + adds r0, r4, 0 + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _080897C8 + cmp r4, r7 + beq _080897C8 + ldr r0, [r4, 0x70] + adds r0, 0xA4 + ldrb r0, [r0] + cmp r0, r6 + beq _080897E2 +_080897C8: + adds r5, 0x1 + cmp r5, 0xF + ble _080897A0 + movs r0, 0 + cmp r0, 0 + bne _080897E2 + movs r0, 0x11 + bl sub_8097FA8 + ldr r0, _080897E8 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x2] +_080897E2: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080897E8: .4byte gUnknown_203B418 +_080897EC: .4byte 0x0001358c + thumb_func_end sub_8089788 + + thumb_func_start sub_80897F0 +sub_80897F0: + push {r4,lr} + bl sub_8085480 + adds r4, r0, 0 + bl sub_8086448 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08089858 + bl sub_808563C + movs r0, 0x20 + movs r1, 0x46 + bl sub_803E708 + bl sub_808692C + ldr r0, _0808985C + bl sub_8052910 + ldr r0, _08089860 + bl sub_8052910 + ldr r0, _08089864 + bl sub_8052910 + ldr r0, _08089868 + bl sub_8052910 + ldr r0, _0808986C + bl sub_8052910 + ldr r0, _08089870 + bl sub_8052910 + ldr r0, _08089874 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r4, 0xC + adds r0, r4, 0 + movs r1, 0x10 + bl sub_80858AC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08089858: .4byte sub_80862BC +_0808985C: .4byte gUnknown_8103BD8 +_08089860: .4byte gUnknown_8103C00 +_08089864: .4byte gUnknown_8103C3C +_08089868: .4byte gUnknown_8103C74 +_0808986C: .4byte gUnknown_8103CC4 +_08089870: .4byte gUnknown_8103D0C +_08089874: .4byte gUnknown_8103D50 + thumb_func_end sub_80897F0 + + thumb_func_start sub_8089878 +sub_8089878: + push {r4,lr} + bl sub_8085480 + adds r4, r0, 0 + bl sub_8086448 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _080898D0 + bl sub_808563C + movs r0, 0x20 + movs r1, 0x46 + bl sub_803E708 + bl sub_808692C + ldr r0, _080898D4 + bl sub_8052910 + ldr r0, _080898D8 + bl sub_8052910 + ldr r0, _080898DC + bl sub_8052910 + ldr r0, _080898E0 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r4, 0xC + adds r0, r4, 0 + movs r1, 0x10 + bl sub_80858AC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080898D0: .4byte sub_80862BC +_080898D4: .4byte gUnknown_8103D8C +_080898D8: .4byte gUnknown_8103D98 +_080898DC: .4byte gUnknown_8103DD8 +_080898E0: .4byte gUnknown_8103E28 + thumb_func_end sub_8089878 + + thumb_func_start sub_80898E4 +sub_80898E4: + push {lr} + bl sub_8086448 + ldr r0, _080898F4 + bl sub_80866C4 + pop {r0} + bx r0 + .align 2, 0 +_080898F4: .4byte gUnknown_8103E34 + thumb_func_end sub_80898E4 + + thumb_func_start sub_80898F8 +sub_80898F8: + push {lr} + movs r1, 0x87 + lsls r1, 2 + movs r2, 0 + bl sub_8068FE0 + pop {r0} + bx r0 + thumb_func_end sub_80898F8 + + thumb_func_start sub_8089908 +sub_8089908: + push {lr} + movs r1, 0x4 + bl sub_8085918 + pop {r0} + bx r0 + thumb_func_end sub_8089908 + + thumb_func_start sub_8089914 +sub_8089914: + push {r4-r6,lr} + bl sub_8085480 + adds r6, r0, 0 + movs r0, 0x11 + bl sub_8085680 + adds r5, r0, 0 + bl sub_8083F14 + ldr r0, _0808996C + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x7] + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + ldr r4, _08089970 + adds r0, r4, 0 + bl sub_80855E4 + adds r0, r5, 0 + movs r1, 0 + bl sub_8085918 + adds r0, r5, 0 + bl _call_via_r4 + movs r1, 0x4 + ldrsh r0, [r6, r1] + movs r2, 0x6 + ldrsh r1, [r6, r2] + subs r1, 0x3 + bl sub_8085860 + ldr r0, _08089974 + movs r1, 0x96 + bl sub_808D8BC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0808996C: .4byte gUnknown_203B418 +_08089970: .4byte sub_8086A3C +_08089974: .4byte gUnknown_202E038 + thumb_func_end sub_8089914 + + thumb_func_start sub_8089978 +sub_8089978: + push {r4-r6,lr} + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0x11 + bl sub_8085680 + adds r4, r0, 0 + bl sub_8083F14 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + ldr r6, _080899C0 + adds r0, r6, 0 + bl sub_80855E4 + movs r0, 0x96 + bl sub_808E734 + lsls r0, 24 + cmp r0, 0 + beq _080899C4 + movs r0, 0x23 + bl sub_8083E88 + movs r1, 0x87 + lsls r1, 2 + adds r0, r4, 0 + movs r2, 0 + bl sub_8068FE0 + b _080899DA + .align 2, 0 +_080899C0: .4byte sub_8086A3C +_080899C4: + ldr r0, _080899F8 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x7] + adds r0, r4, 0 + movs r1, 0 + bl sub_8085918 + adds r0, r4, 0 + bl _call_via_r6 +_080899DA: + movs r1, 0x4 + ldrsh r0, [r5, r1] + movs r2, 0x6 + ldrsh r1, [r5, r2] + subs r1, 0x3 + bl sub_8085860 + ldr r0, _080899FC + movs r1, 0x96 + bl sub_808D8BC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080899F8: .4byte gUnknown_203B418 +_080899FC: .4byte gUnknown_202E038 + thumb_func_end sub_8089978 + + thumb_func_start sub_8089A00 +sub_8089A00: + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + movs r2, 0xE3 + lsls r2, 24 + adds r1, r2 + lsrs r1, 24 + cmp r1, 0x2 + bhi _08089A26 + cmp r0, 0x11 + bne _08089A26 + movs r0, 0x13 + bl sub_8097FA8 + ldr r0, _08089A2C + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x2] +_08089A26: + pop {r0} + bx r0 + .align 2, 0 +_08089A2C: .4byte gUnknown_203B418 + thumb_func_end sub_8089A00 + + thumb_func_start sub_8089A30 +sub_8089A30: + push {r4,r5,lr} + bl sub_8085480 + adds r4, r0, 0 + movs r0, 0x11 + bl sub_8085680 + adds r5, r0, 0 + bl sub_8086448 + ldr r0, _08089AC0 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r0, 0x23 + bl sub_8083E88 + bl sub_8086794 + movs r0, 0x1E + movs r1, 0x46 + bl sub_803E708 + adds r0, r5, 0 + bl sub_8089B64 + movs r0, 0x3C + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08089AC4 + bl sub_8052910 + ldr r0, _08089AC8 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_8089BB8 + ldr r0, _08089ACC + bl sub_8052910 + bl sub_8089BB8 + ldr r0, _08089AD0 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r1, 0xE1 + lsls r1, 2 + adds r0, r5, 0 + movs r2, 0x20 + bl sub_8086A70 + adds r4, 0xC + adds r0, r4, 0 + movs r1, 0x10 + bl sub_80858AC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08089AC0: .4byte gUnknown_8103EA4 +_08089AC4: .4byte gUnknown_8103F0C +_08089AC8: .4byte gUnknown_8103F4C +_08089ACC: .4byte gUnknown_8103FCC +_08089AD0: .4byte gUnknown_8104008 + thumb_func_end sub_8089A30 + + thumb_func_start sub_8089AD4 +sub_8089AD4: + push {r4,r5,lr} + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0x11 + bl sub_8085680 + adds r4, r0, 0 + bl sub_8086448 + movs r0, 0x96 + bl sub_808E734 + lsls r0, 24 + cmp r0, 0 + beq _08089B00 + ldr r0, _08089AFC + bl sub_80866C4 + b _08089B4E + .align 2, 0 +_08089AFC: .4byte gUnknown_8104144 +_08089B00: + ldr r0, _08089B54 + bl sub_8052910 + movs r0, 0x23 + bl sub_8083E88 + bl sub_8086794 + adds r0, r4, 0 + bl sub_8089B64 + movs r0, 0x3C + movs r1, 0x46 + bl sub_803E708 + ldr r0, _08089B58 + bl sub_8052910 + bl sub_8089BB8 + ldr r0, _08089B5C + bl sub_8052910 + bl sub_8089BB8 + ldr r0, _08089B60 + bl sub_8052910 + movs r1, 0xE1 + lsls r1, 2 + adds r0, r4, 0 + movs r2, 0x20 + bl sub_8086A70 + adds r0, r5, 0 + adds r0, 0xC + movs r1, 0x10 + bl sub_80858AC +_08089B4E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08089B54: .4byte gUnknown_8104044 +_08089B58: .4byte gUnknown_8104050 +_08089B5C: .4byte gUnknown_81040CC +_08089B60: .4byte gUnknown_8104114 + thumb_func_end sub_8089AD4 + + thumb_func_start sub_8089B64 +sub_8089B64: + push {r4-r6,lr} + adds r6, r0, 0 + ldr r0, [r6, 0x70] + movs r2, 0xAF + lsls r2, 1 + adds r1, r0, r2 + movs r0, 0 + strb r0, [r1] + movs r5, 0xC8 + lsls r5, 8 + movs r4, 0x80 + lsls r4, 3 + movs r0, 0xFC + lsls r0, 1 + bl sub_8083E38 + b _08089B96 +_08089B86: + ldr r0, [r6, 0x70] + movs r1, 0xBA + lsls r1, 1 + adds r0, r1 + str r5, [r0] + movs r0, 0x46 + bl sub_803E46C +_08089B96: + subs r5, r4 + subs r4, 0xB + cmp r4, 0x1D + bgt _08089BA0 + movs r4, 0x1E +_08089BA0: + cmp r5, 0 + bge _08089B86 + ldr r0, [r6, 0x70] + movs r2, 0xBA + lsls r2, 1 + adds r0, r2 + movs r1, 0 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8089B64 + + thumb_func_start sub_8089BB8 +sub_8089BB8: + push {r4,r5,lr} + sub sp, 0x4 + movs r0, 0xFB + lsls r0, 1 + bl sub_8083E38 + movs r4, 0xFA + movs r5, 0x1 +_08089BC8: + str r5, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0x95 + bgt _08089BC8 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r4, 0xFA + movs r5, 0x1 +_08089BEE: + str r5, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0xC7 + bgt _08089BEE + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r4, 0xFA + movs r5, 0x1 +_08089C14: + str r5, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0 + bge _08089C14 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_8085EB0 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8089BB8 + + thumb_func_start sub_8089C44 +sub_8089C44: + push {r4,r5,lr} + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0x12 + bl sub_8085680 + adds r4, r0, 0 + movs r0, 0x72 + bl sub_8083E88 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + adds r0, r4, 0 + movs r1, 0 + bl sub_8085918 + movs r1, 0x4 + ldrsh r0, [r5, r1] + movs r2, 0x6 + ldrsh r1, [r5, r2] + bl sub_8085860 + ldr r0, _08089C88 + ldr r1, _08089C8C + bl sub_808D8BC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08089C88: .4byte gUnknown_202E038 +_08089C8C: .4byte 0x0000010d + thumb_func_end sub_8089C44 + + thumb_func_start sub_8089C90 +sub_8089C90: + push {r4,r5,lr} + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0x12 + bl sub_8085680 + adds r4, r0, 0 + movs r0, 0x72 + bl sub_8083E88 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + ldr r0, _08089CCC + bl sub_808E734 + lsls r0, 24 + cmp r0, 0 + beq _08089CD0 + movs r1, 0x87 + lsls r1, 2 + adds r0, r4, 0 + movs r2, 0 + bl sub_8068FE0 + b _08089CD8 + .align 2, 0 +_08089CCC: .4byte 0x0000010d +_08089CD0: + adds r0, r4, 0 + movs r1, 0 + bl sub_8085918 +_08089CD8: + movs r1, 0x4 + ldrsh r0, [r5, r1] + movs r2, 0x6 + ldrsh r1, [r5, r2] + bl sub_8085860 + ldr r0, _08089CF4 + ldr r1, _08089CF8 + bl sub_808D8BC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08089CF4: .4byte gUnknown_202E038 +_08089CF8: .4byte 0x0000010d + thumb_func_end sub_8089C90 + + thumb_func_start sub_8089CFC +sub_8089CFC: + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + movs r2, 0xE0 + lsls r2, 24 + adds r1, r2 + lsrs r1, 24 + cmp r1, 0x2 + bhi _08089D22 + cmp r0, 0x12 + bne _08089D22 + movs r0, 0x15 + bl sub_8097FA8 + ldr r0, _08089D28 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x2] +_08089D22: + pop {r0} + bx r0 + .align 2, 0 +_08089D28: .4byte gUnknown_203B418 + thumb_func_end sub_8089CFC + + thumb_func_start sub_8089D2C +sub_8089D2C: + push {r4,r5,lr} + bl sub_8085480 + adds r4, r0, 0 + movs r0, 0x12 + bl sub_8085680 + adds r5, r0, 0 + bl sub_8089E68 + ldr r0, _08089D80 + bl sub_8052910 + bl sub_8089E68 + ldr r0, _08089D84 + bl sub_8052910 + bl sub_8089E68 + ldr r0, _08089D88 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r1, 0x96 + lsls r1, 2 + adds r0, r5, 0 + movs r2, 0xB + bl sub_8086A70 + adds r4, 0xC + adds r0, r4, 0 + movs r1, 0x10 + bl sub_80858AC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08089D80: .4byte gUnknown_8104150 +_08089D84: .4byte gUnknown_81041AC +_08089D88: .4byte gUnknown_81041F8 + thumb_func_end sub_8089D2C + + thumb_func_start sub_8089D8C +sub_8089D8C: + push {r4,r5,lr} + bl sub_8085480 + adds r4, r0, 0 + movs r0, 0x12 + bl sub_8085680 + adds r5, r0, 0 + bl sub_8089E68 + ldr r0, _08089DE0 + bl sub_8052910 + bl sub_8089E68 + ldr r0, _08089DE4 + bl sub_8052910 + bl sub_8089E68 + ldr r0, _08089DE8 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r1, 0x96 + lsls r1, 2 + adds r0, r5, 0 + movs r2, 0xB + bl sub_8086A70 + adds r4, 0xC + adds r0, r4, 0 + movs r1, 0x10 + bl sub_80858AC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08089DE0: .4byte gUnknown_8104240 +_08089DE4: .4byte gUnknown_81042AC +_08089DE8: .4byte gUnknown_81042B8 + thumb_func_end sub_8089D8C + + thumb_func_start sub_8089DEC +sub_8089DEC: + push {r4,r5,lr} + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0x12 + bl sub_8085680 + adds r4, r0, 0 + ldr r0, _08089E10 + bl sub_808E734 + lsls r0, 24 + cmp r0, 0 + beq _08089E18 + ldr r0, _08089E14 + bl sub_80866C4 + b _08089E54 + .align 2, 0 +_08089E10: .4byte 0x0000010d +_08089E14: .4byte gUnknown_81043DC +_08089E18: + bl sub_8089E68 + ldr r0, _08089E5C + bl sub_8052910 + bl sub_8089E68 + ldr r0, _08089E60 + bl sub_8052910 + bl sub_8089E68 + ldr r0, _08089E64 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r1, 0x96 + lsls r1, 2 + adds r0, r4, 0 + movs r2, 0xB + bl sub_8086A70 + adds r0, r5, 0 + adds r0, 0xC + movs r1, 0x10 + bl sub_80858AC +_08089E54: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08089E5C: .4byte gUnknown_8104310 +_08089E60: .4byte gUnknown_810439C +_08089E64: .4byte gUnknown_81043C0 + thumb_func_end sub_8089DEC + + thumb_func_start sub_8089E68 +sub_8089E68: + push {r4,r5,lr} + sub sp, 0x4 + ldr r0, _08089EF8 + bl sub_8083E38 + movs r4, 0xFA +_08089E74: + lsrs r2, r4, 31 + adds r2, r4, r2 + asrs r2, 1 + movs r0, 0x1 + str r0, [sp] + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0x95 + bgt _08089E74 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r4, 0xFA + movs r5, 0x1 +_08089EA0: + str r5, [sp] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0xC7 + bgt _08089EA0 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r4, 0xFA +_08089EC4: + lsrs r2, r4, 31 + adds r2, r4, r2 + asrs r2, 1 + movs r0, 0x1 + str r0, [sp] + adds r0, r4, 0 + adds r1, r2, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0 + bge _08089EC4 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_8085EB0 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08089EF8: .4byte 0x000001ed + thumb_func_end sub_8089E68 + + thumb_func_start sub_8089EFC +sub_8089EFC: + push {r4,r5,lr} + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0x13 + bl sub_8085680 + adds r4, r0, 0 + movs r0, 0x72 + bl sub_8083E88 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + adds r0, r4, 0 + movs r1, 0 + bl sub_8085918 + movs r1, 0x4 + ldrsh r0, [r5, r1] + movs r2, 0x6 + ldrsh r1, [r5, r2] + bl sub_8085860 + ldr r0, _08089F40 + movs r1, 0x86 + lsls r1, 1 + bl sub_808D8BC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08089F40: .4byte gUnknown_202E038 + thumb_func_end sub_8089EFC + + thumb_func_start sub_8089F44 +sub_8089F44: + push {r4,r5,lr} + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0x13 + bl sub_8085680 + adds r4, r0, 0 + movs r0, 0x72 + bl sub_8083E88 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + adds r0, r4, 0 + movs r1, 0 + bl sub_8085918 + movs r1, 0x4 + ldrsh r0, [r5, r1] + movs r2, 0x6 + ldrsh r1, [r5, r2] + bl sub_8085860 + ldr r0, _08089F88 + movs r1, 0x86 + lsls r1, 1 + bl sub_808D8BC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08089F88: .4byte gUnknown_202E038 + thumb_func_end sub_8089F44 + + thumb_func_start sub_8089F8C +sub_8089F8C: + push {r4,r5,lr} + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0x13 + bl sub_8085680 + adds r4, r0, 0 + movs r0, 0x72 + bl sub_8083E88 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + movs r0, 0x86 + lsls r0, 1 + bl sub_808E734 + lsls r0, 24 + cmp r0, 0 + beq _08089FC8 + movs r1, 0x87 + lsls r1, 2 + adds r0, r4, 0 + movs r2, 0 + bl sub_8068FE0 + b _08089FD0 +_08089FC8: + adds r0, r4, 0 + movs r1, 0 + bl sub_8085918 +_08089FD0: + movs r1, 0x4 + ldrsh r0, [r5, r1] + movs r2, 0x6 + ldrsh r1, [r5, r2] + bl sub_8085860 + ldr r0, _08089FEC + movs r1, 0x86 + lsls r1, 1 + bl sub_808D8BC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08089FEC: .4byte gUnknown_202E038 + thumb_func_end sub_8089F8C + + thumb_func_start sub_8089FF0 +sub_8089FF0: + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + movs r2, 0xDD + lsls r2, 24 + adds r1, r2 + lsrs r1, 24 + cmp r1, 0x2 + bhi _0808A016 + cmp r0, 0x13 + bne _0808A016 + movs r0, 0x17 + bl sub_8097FA8 + ldr r0, _0808A01C + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x2] +_0808A016: + pop {r0} + bx r0 + .align 2, 0 +_0808A01C: .4byte gUnknown_203B418 + thumb_func_end sub_8089FF0 + + thumb_func_start sub_808A020 +sub_808A020: + push {r4,r5,lr} + bl sub_8085480 + adds r4, r0, 0 + movs r0, 0x13 + bl sub_8085680 + adds r5, r0, 0 + ldr r0, _0808A0A4 + bl sub_8052910 + bl sub_808A1D8 + ldr r0, _0808A0A8 + bl sub_8052910 + ldr r0, _0808A0AC + ldr r0, [r0] + ldr r1, _0808A0B0 + adds r0, r1 + movs r1, 0x4 + strb r1, [r0] + movs r0, 0 + movs r1, 0x1 + bl sub_807EAA0 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808A0B4 + bl sub_8052910 + bl sub_808A1D8 + ldr r0, _0808A0B8 + bl sub_8052910 + bl sub_808A1D8 + ldr r0, _0808A0BC + bl sub_8052910 + bl sub_808A1D8 + ldr r0, _0808A0C0 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r1, _0808A0C4 + adds r0, r5, 0 + movs r2, 0xB + bl sub_8086A70 + adds r4, 0xC + adds r0, r4, 0 + movs r1, 0x10 + bl sub_80858AC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808A0A4: .4byte gUnknown_8104450 +_0808A0A8: .4byte gUnknown_81044B4 +_0808A0AC: .4byte gUnknown_203B418 +_0808A0B0: .4byte 0x0000e265 +_0808A0B4: .4byte gUnknown_8104510 +_0808A0B8: .4byte gUnknown_810453C +_0808A0BC: .4byte gUnknown_8104570 +_0808A0C0: .4byte gUnknown_81045B0 +_0808A0C4: .4byte 0x0000028a + thumb_func_end sub_808A020 + + thumb_func_start sub_808A0C8 +sub_808A0C8: + push {r4,r5,lr} + bl sub_8085480 + adds r4, r0, 0 + movs r0, 0x13 + bl sub_8085680 + adds r5, r0, 0 + ldr r0, _0808A12C + ldr r0, [r0] + ldr r1, _0808A130 + adds r0, r1 + movs r1, 0x4 + strb r1, [r0] + movs r0, 0 + movs r1, 0x1 + bl sub_807EAA0 + bl sub_808A1D8 + ldr r0, _0808A134 + bl sub_8052910 + bl sub_808A1D8 + ldr r0, _0808A138 + bl sub_8052910 + bl sub_808A1D8 + ldr r0, _0808A13C + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r1, _0808A140 + adds r0, r5, 0 + movs r2, 0xB + bl sub_8086A70 + adds r4, 0xC + adds r0, r4, 0 + movs r1, 0x10 + bl sub_80858AC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808A12C: .4byte gUnknown_203B418 +_0808A130: .4byte 0x0000e265 +_0808A134: .4byte gUnknown_81045F8 +_0808A138: .4byte gUnknown_8104674 +_0808A13C: .4byte gUnknown_81046A0 +_0808A140: .4byte 0x0000028a + thumb_func_end sub_808A0C8 + + thumb_func_start sub_808A144 +sub_808A144: + push {r4,r5,lr} + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0x13 + bl sub_8085680 + adds r4, r0, 0 + movs r0, 0x86 + lsls r0, 1 + bl sub_808E734 + lsls r0, 24 + cmp r0, 0 + beq _0808A170 + ldr r0, _0808A16C + bl sub_80866C4 + b _0808A1BA + .align 2, 0 +_0808A16C: .4byte gUnknown_8104778 +_0808A170: + ldr r0, _0808A1C0 + ldr r0, [r0] + ldr r1, _0808A1C4 + adds r0, r1 + movs r1, 0x4 + strb r1, [r0] + movs r0, 0 + movs r1, 0x1 + bl sub_807EAA0 + ldr r0, _0808A1C8 + bl sub_8052910 + bl sub_808A1D8 + ldr r0, _0808A1CC + bl sub_8052910 + bl sub_808A1D8 + ldr r0, _0808A1D0 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r1, _0808A1D4 + adds r0, r4, 0 + movs r2, 0xB + bl sub_8086A70 + adds r0, r5, 0 + adds r0, 0xC + movs r1, 0x10 + bl sub_80858AC +_0808A1BA: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808A1C0: .4byte gUnknown_203B418 +_0808A1C4: .4byte 0x0000e265 +_0808A1C8: .4byte gUnknown_81046CC +_0808A1CC: .4byte gUnknown_8104744 +_0808A1D0: .4byte gUnknown_810476C +_0808A1D4: .4byte 0x0000028a + thumb_func_end sub_808A144 + + thumb_func_start sub_808A1D8 +sub_808A1D8: + push {r4,r5,lr} + sub sp, 0x4 + movs r0, 0xFB + lsls r0, 1 + bl sub_8083E38 + movs r4, 0xFA + movs r5, 0x1 +_0808A1E8: + str r5, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0x95 + bgt _0808A1E8 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r4, 0xFA + movs r5, 0x1 +_0808A20E: + str r5, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0xC7 + bgt _0808A20E + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r4, 0xFA + movs r5, 0x1 +_0808A234: + str r5, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0 + bge _0808A234 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_8085EB0 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_808A1D8 + + thumb_func_start sub_808A264 +sub_808A264: + push {r4-r6,lr} + bl sub_8085480 + adds r6, r0, 0 + movs r0, 0x14 + bl sub_8085680 + adds r5, r0, 0 + movs r0, 0x72 + bl sub_8083E88 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + ldr r4, _0808A2B8 + adds r0, r4, 0 + bl sub_80855E4 + adds r0, r5, 0 + movs r1, 0 + bl sub_8085918 + adds r0, r5, 0 + bl _call_via_r4 + movs r1, 0x4 + ldrsh r0, [r6, r1] + movs r2, 0x6 + ldrsh r1, [r6, r2] + subs r1, 0x3 + bl sub_8085860 + ldr r0, _0808A2BC + movs r1, 0x87 + lsls r1, 1 + bl sub_808D8BC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0808A2B8: .4byte sub_8086A3C +_0808A2BC: .4byte gUnknown_202E038 + thumb_func_end sub_808A264 + + thumb_func_start sub_808A2C0 +sub_808A2C0: + push {r4,r5,lr} + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0x14 + bl sub_8085680 + adds r4, r0, 0 + movs r0, 0x72 + bl sub_8083E88 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + adds r0, r4, 0 + movs r1, 0 + bl sub_8085918 + movs r1, 0x4 + ldrsh r0, [r5, r1] + movs r2, 0x6 + ldrsh r1, [r5, r2] + bl sub_8085860 + ldr r0, _0808A304 + movs r1, 0x87 + lsls r1, 1 + bl sub_808D8BC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808A304: .4byte gUnknown_202E038 + thumb_func_end sub_808A2C0 + + thumb_func_start sub_808A308 +sub_808A308: + push {r4,r5,lr} + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0x14 + bl sub_8085680 + adds r4, r0, 0 + movs r0, 0x72 + bl sub_8083E88 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + movs r0, 0x87 + lsls r0, 1 + bl sub_808E734 + lsls r0, 24 + cmp r0, 0 + beq _0808A344 + movs r1, 0x87 + lsls r1, 2 + adds r0, r4, 0 + movs r2, 0 + bl sub_8068FE0 + b _0808A34C +_0808A344: + adds r0, r4, 0 + movs r1, 0 + bl sub_8085918 +_0808A34C: + movs r1, 0x4 + ldrsh r0, [r5, r1] + movs r2, 0x6 + ldrsh r1, [r5, r2] + bl sub_8085860 + ldr r0, _0808A368 + movs r1, 0x87 + lsls r1, 1 + bl sub_808D8BC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808A368: .4byte gUnknown_202E038 + thumb_func_end sub_808A308 + + thumb_func_start sub_808A36C +sub_808A36C: + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + movs r2, 0xDA + lsls r2, 24 + adds r1, r2 + lsrs r1, 24 + cmp r1, 0x2 + bhi _0808A392 + cmp r0, 0x14 + bne _0808A392 + movs r0, 0x19 + bl sub_8097FA8 + ldr r0, _0808A398 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x2] +_0808A392: + pop {r0} + bx r0 + .align 2, 0 +_0808A398: .4byte gUnknown_203B418 + thumb_func_end sub_808A36C + + thumb_func_start sub_808A39C +sub_808A39C: + push {r4,r5,lr} + bl sub_8085480 + adds r4, r0, 0 + movs r0, 0x14 + bl sub_8085680 + adds r5, r0, 0 + bl sub_8086448 + ldr r0, _0808A434 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808A438 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r0, 0x1 + movs r1, 0x2 + bl sub_80426C8 + movs r0, 0x3C + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808A43C + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r5, 0 + bl sub_808A528 + ldr r0, _0808A440 + bl sub_8052910 + ldr r0, _0808A444 + bl sub_8052910 + bl sub_808A57C + ldr r0, _0808A448 + bl sub_8052910 + bl sub_808A57C + ldr r0, _0808A44C + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r1, _0808A450 + adds r0, r5, 0 + movs r2, 0xB + bl sub_8086A70 + adds r4, 0xC + adds r0, r4, 0 + movs r1, 0x10 + bl sub_80858AC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808A434: .4byte gUnknown_8104784 +_0808A438: .4byte gUnknown_8104790 +_0808A43C: .4byte gUnknown_81047B0 +_0808A440: .4byte gUnknown_810484C +_0808A444: .4byte gUnknown_8104888 +_0808A448: .4byte gUnknown_81048C8 +_0808A44C: .4byte gUnknown_8104914 +_0808A450: .4byte 0x0000028a + thumb_func_end sub_808A39C + + thumb_func_start sub_808A454 +sub_808A454: + push {r4,r5,lr} + bl sub_8085480 + adds r4, r0, 0 + movs r0, 0x14 + bl sub_8085680 + adds r5, r0, 0 + ldr r0, _0808A4A0 + bl sub_8052910 + bl sub_808A57C + ldr r0, _0808A4A4 + bl sub_8052910 + bl sub_808A57C + ldr r0, _0808A4A8 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r1, _0808A4AC + adds r0, r5, 0 + movs r2, 0xB + bl sub_8086A70 + adds r4, 0xC + adds r0, r4, 0 + movs r1, 0x10 + bl sub_80858AC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808A4A0: .4byte gUnknown_8104930 +_0808A4A4: .4byte gUnknown_8104980 +_0808A4A8: .4byte gUnknown_8104998 +_0808A4AC: .4byte 0x0000028a + thumb_func_end sub_808A454 + + thumb_func_start sub_808A4B0 +sub_808A4B0: + push {r4,r5,lr} + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0x14 + bl sub_8085680 + adds r4, r0, 0 + movs r0, 0x87 + lsls r0, 1 + bl sub_808E734 + lsls r0, 24 + cmp r0, 0 + beq _0808A4DC + ldr r0, _0808A4D8 + bl sub_80866C4 + b _0808A512 + .align 2, 0 +_0808A4D8: .4byte gUnknown_8104AC8 +_0808A4DC: + ldr r0, _0808A518 + bl sub_8052910 + bl sub_808A57C + ldr r0, _0808A51C + bl sub_8052910 + bl sub_808A57C + ldr r0, _0808A520 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r1, _0808A524 + adds r0, r4, 0 + movs r2, 0xB + bl sub_8086A70 + adds r0, r5, 0 + adds r0, 0xC + movs r1, 0x10 + bl sub_80858AC +_0808A512: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808A518: .4byte gUnknown_81049D4 +_0808A51C: .4byte gUnknown_8104A80 +_0808A520: .4byte gUnknown_8104A9C +_0808A524: .4byte 0x0000028a + thumb_func_end sub_808A4B0 + + thumb_func_start sub_808A528 +sub_808A528: + push {r4-r6,lr} + adds r6, r0, 0 + ldr r0, [r6, 0x70] + movs r2, 0xAF + lsls r2, 1 + adds r1, r0, r2 + movs r0, 0 + strb r0, [r1] + movs r5, 0xC8 + lsls r5, 8 + movs r4, 0xC0 + lsls r4, 4 + movs r0, 0xFC + lsls r0, 1 + bl sub_8083E38 + b _0808A55A +_0808A54A: + ldr r0, [r6, 0x70] + movs r1, 0xBA + lsls r1, 1 + adds r0, r1 + str r5, [r0] + movs r0, 0x46 + bl sub_803E46C +_0808A55A: + subs r5, r4 + subs r4, 0x60 + cmp r4, 0x13 + bgt _0808A564 + movs r4, 0x14 +_0808A564: + cmp r5, 0 + bge _0808A54A + ldr r0, [r6, 0x70] + movs r2, 0xBA + lsls r2, 1 + adds r0, r2 + movs r1, 0 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_808A528 + + thumb_func_start sub_808A57C +sub_808A57C: + push {r4,r5,lr} + sub sp, 0x4 + movs r0, 0xF7 + lsls r0, 1 + bl sub_8083E38 + movs r4, 0xFA + movs r5, 0x1 +_0808A58C: + str r5, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0x95 + bgt _0808A58C + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r4, 0xFA + movs r5, 0x1 +_0808A5B2: + str r5, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0xC7 + bgt _0808A5B2 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r4, 0xFA + movs r5, 0x1 +_0808A5D8: + str r5, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0 + bge _0808A5D8 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_8085EB0 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_808A57C + + thumb_func_start sub_808A608 +sub_808A608: + push {r4,r5,lr} + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0x15 + bl sub_8085680 + adds r4, r0, 0 + movs r0, 0x1C + bl sub_8083E88 + bl sub_80867F4 + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl sub_8086838 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + adds r0, r4, 0 + movs r1, 0 + bl sub_8085918 + adds r0, r4, 0 + bl sub_8086A3C + movs r1, 0x4 + ldrsh r0, [r5, r1] + movs r2, 0x6 + ldrsh r1, [r5, r2] + subs r1, 0x6 + bl sub_8085860 + ldr r0, _0808A660 + ldr r1, _0808A664 + bl sub_808D8BC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808A660: .4byte gUnknown_202E038 +_0808A664: .4byte 0x00000113 + thumb_func_end sub_808A608 + + thumb_func_start sub_808A668 +sub_808A668: + push {r4,r5,lr} + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0x15 + bl sub_8085680 + adds r4, r0, 0 + movs r0, 0x1C + bl sub_8083E88 + bl sub_80867F4 + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl sub_8086838 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + ldr r0, _0808A6B0 + bl sub_808E734 + lsls r0, 24 + cmp r0, 0 + beq _0808A6B4 + movs r1, 0x87 + lsls r1, 2 + adds r0, r4, 0 + movs r2, 0 + bl sub_8068FE0 + b _0808A6C2 + .align 2, 0 +_0808A6B0: .4byte 0x00000113 +_0808A6B4: + adds r0, r4, 0 + movs r1, 0 + bl sub_8085918 + adds r0, r4, 0 + bl sub_8086A3C +_0808A6C2: + movs r1, 0x4 + ldrsh r0, [r5, r1] + movs r2, 0x6 + ldrsh r1, [r5, r2] + subs r1, 0x6 + bl sub_8085860 + ldr r0, _0808A6E0 + ldr r1, _0808A6E4 + bl sub_808D8BC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808A6E0: .4byte gUnknown_202E038 +_0808A6E4: .4byte 0x00000113 + thumb_func_end sub_808A668 + + thumb_func_start sub_808A6E8 +sub_808A6E8: + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + movs r2, 0xD7 + lsls r2, 24 + adds r1, r2 + lsrs r1, 24 + cmp r1, 0x1 + bhi _0808A70E + cmp r0, 0x15 + bne _0808A70E + movs r0, 0x1A + bl sub_8097FA8 + ldr r0, _0808A714 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x2] +_0808A70E: + pop {r0} + bx r0 + .align 2, 0 +_0808A714: .4byte gUnknown_203B418 + thumb_func_end sub_808A6E8 + + thumb_func_start sub_808A718 +sub_808A718: + push {lr} + bl sub_8086854 + pop {r0} + bx r0 + thumb_func_end sub_808A718 + + thumb_func_start sub_808A724 +sub_808A724: + push {r4-r6,lr} + sub sp, 0x8 + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0x15 + bl sub_8085680 + adds r6, r0, 0 + ldr r0, [r5, 0xC] + str r0, [sp] + ldr r0, [r5, 0x10] + ldr r1, _0808A800 + adds r0, r1 + str r0, [sp, 0x4] + mov r0, sp + movs r1, 0x88 + bl sub_80858AC + movs r0, 0x40 + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808A804 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_808A958 + ldr r0, _0808A808 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808A80C + bl sub_80855E4 + bl sub_808680C + ldr r4, _0808A810 + adds r0, r4, 0 + bl sub_8083E38 + movs r0, 0xFA + movs r1, 0x46 + bl sub_803E708 + adds r0, r6, 0 + bl sub_808A904 + adds r0, r4, 0 + bl sub_8083E58 + bl sub_808682C + ldr r0, _0808A814 + bl sub_80855E4 + movs r0, 0x4 + bl sub_8085930 + ldr r0, _0808A818 + bl sub_8052910 + ldr r0, _0808A81C + bl sub_8052910 + movs r0, 0x1E + movs r1, 0x46 + bl sub_803E708 + movs r0, 0x1E + movs r1, 0x46 + bl sub_803E708 + bl sub_808A958 + ldr r0, _0808A820 + bl sub_8052910 + bl sub_808A958 + ldr r0, _0808A824 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r1, 0xC8 + lsls r1, 2 + adds r0, r6, 0 + movs r2, 0x20 + bl sub_8086A70 + adds r5, 0xC + adds r0, r5, 0 + movs r1, 0x10 + bl sub_80858AC + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0808A800: .4byte 0xfffff000 +_0808A804: .4byte gUnknown_8104AD4 +_0808A808: .4byte gUnknown_8104BEC +_0808A80C: .4byte sub_80868F4 +_0808A810: .4byte 0x000001c5 +_0808A814: .4byte sub_8086910 +_0808A818: .4byte gUnknown_8104C10 +_0808A81C: .4byte gUnknown_8104C54 +_0808A820: .4byte gUnknown_8104CB4 +_0808A824: .4byte gUnknown_8104CE0 + thumb_func_end sub_808A724 + + thumb_func_start sub_808A828 +sub_808A828: + push {r4,r5,lr} + sub sp, 0x8 + bl sub_8085480 + adds r4, r0, 0 + movs r0, 0x15 + bl sub_8085680 + adds r5, r0, 0 + ldr r0, [r4, 0xC] + str r0, [sp] + ldr r0, [r4, 0x10] + ldr r1, _0808A86C + adds r0, r1 + str r0, [sp, 0x4] + mov r0, sp + movs r1, 0x88 + bl sub_80858AC + movs r0, 0x40 + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808A870 + bl sub_808E734 + lsls r0, 24 + cmp r0, 0 + beq _0808A878 + ldr r0, _0808A874 + bl sub_80866C4 + b _0808A8E2 + .align 2, 0 +_0808A86C: .4byte 0xfffff000 +_0808A870: .4byte 0x00000113 +_0808A874: .4byte gUnknown_8104E54 +_0808A878: + ldr r0, _0808A8EC + bl sub_8052910 + bl sub_808A958 + ldr r0, _0808A8F0 + bl sub_80855E4 + bl sub_808680C + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r5, 0 + bl sub_808A904 + bl sub_808682C + ldr r0, _0808A8F4 + bl sub_80855E4 + movs r0, 0x4 + bl sub_8085930 + ldr r0, _0808A8F8 + bl sub_8052910 + bl sub_808A958 + ldr r0, _0808A8FC + bl sub_8052910 + bl sub_808A958 + ldr r0, _0808A900 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r1, 0xC8 + lsls r1, 2 + adds r0, r5, 0 + movs r2, 0x20 + bl sub_8086A70 + adds r0, r4, 0 + adds r0, 0xC + movs r1, 0x10 + bl sub_80858AC +_0808A8E2: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808A8EC: .4byte gUnknown_8104CEC +_0808A8F0: .4byte sub_80868F4 +_0808A8F4: .4byte sub_8086910 +_0808A8F8: .4byte gUnknown_8104D60 +_0808A8FC: .4byte gUnknown_8104DDC +_0808A900: .4byte gUnknown_8104E0C + thumb_func_end sub_808A828 + + thumb_func_start sub_808A904 +sub_808A904: + push {r4-r6,lr} + adds r6, r0, 0 + ldr r0, [r6, 0x70] + movs r2, 0xAF + lsls r2, 1 + adds r1, r0, r2 + movs r0, 0 + strb r0, [r1] + movs r5, 0xC8 + lsls r5, 8 + movs r4, 0xC0 + lsls r4, 4 + movs r0, 0xFC + lsls r0, 1 + bl sub_8083E38 + b _0808A936 +_0808A926: + ldr r0, [r6, 0x70] + movs r1, 0xBA + lsls r1, 1 + adds r0, r1 + str r5, [r0] + movs r0, 0x46 + bl sub_803E46C +_0808A936: + subs r5, r4 + subs r4, 0x60 + cmp r4, 0x13 + bgt _0808A940 + movs r4, 0x14 +_0808A940: + cmp r5, 0 + bge _0808A926 + ldr r0, [r6, 0x70] + movs r2, 0xBA + lsls r2, 1 + adds r0, r2 + movs r1, 0 + str r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_808A904 + + thumb_func_start sub_808A958 +sub_808A958: + push {r4,r5,lr} + sub sp, 0x4 + ldr r0, _0808A9E0 + bl sub_8083E38 + movs r4, 0xFA + movs r5, 0x1 +_0808A966: + str r5, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0x95 + bgt _0808A966 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r4, 0xFA + movs r5, 0x1 +_0808A98C: + str r5, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0xC7 + bgt _0808A98C + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r4, 0xFA + movs r5, 0x1 +_0808A9B2: + str r5, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0 + bge _0808A9B2 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_8085EB0 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808A9E0: .4byte 0x000001ed + thumb_func_end sub_808A958 + + thumb_func_start sub_808A9E4 +sub_808A9E4: + push {r4,r5,lr} + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0x16 + bl sub_8085680 + adds r4, r0, 0 + movs r0, 0x72 + bl sub_8083E88 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + ldr r0, _0808AA30 + bl sub_80855E4 + adds r0, r4, 0 + movs r1, 0x4 + bl sub_8085918 + movs r1, 0x4 + ldrsh r0, [r5, r1] + movs r2, 0x6 + ldrsh r1, [r5, r2] + subs r1, 0x4 + bl sub_8085860 + ldr r0, _0808AA34 + ldr r1, _0808AA38 + bl sub_808D8BC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808AA30: .4byte sub_8086A3C +_0808AA34: .4byte gUnknown_202E038 +_0808AA38: .4byte 0x00000199 + thumb_func_end sub_808A9E4 + + thumb_func_start sub_808AA3C +sub_808AA3C: + push {r4,r5,lr} + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0x16 + bl sub_8085680 + adds r4, r0, 0 + movs r0, 0x72 + bl sub_8083E88 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + ldr r0, _0808AA88 + bl sub_80855E4 + adds r0, r4, 0 + movs r1, 0x4 + bl sub_8085918 + movs r1, 0x4 + ldrsh r0, [r5, r1] + movs r2, 0x6 + ldrsh r1, [r5, r2] + subs r1, 0x3 + bl sub_8085860 + ldr r0, _0808AA8C + ldr r1, _0808AA90 + bl sub_808D8BC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808AA88: .4byte sub_8086A3C +_0808AA8C: .4byte gUnknown_202E038 +_0808AA90: .4byte 0x00000199 + thumb_func_end sub_808AA3C + + thumb_func_start sub_808AA94 +sub_808AA94: + push {r4,r5,lr} + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0x16 + bl sub_8085680 + adds r4, r0, 0 + movs r0, 0x72 + bl sub_8083E88 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + ldr r0, _0808AAE4 + bl sub_80855E4 + movs r1, 0x87 + lsls r1, 2 + adds r0, r4, 0 + movs r2, 0 + bl sub_8068FE0 + movs r1, 0x4 + ldrsh r0, [r5, r1] + movs r2, 0x6 + ldrsh r1, [r5, r2] + subs r1, 0x3 + bl sub_8085860 + ldr r0, _0808AAE8 + ldr r1, _0808AAEC + bl sub_808D8BC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808AAE4: .4byte sub_8086A3C +_0808AAE8: .4byte gUnknown_202E038 +_0808AAEC: .4byte 0x00000199 + thumb_func_end sub_808AA94 + + thumb_func_start sub_808AAF0 +sub_808AAF0: + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + movs r2, 0xD5 + lsls r2, 24 + adds r1, r2 + lsrs r1, 24 + cmp r1, 0x2 + bhi _0808AB16 + cmp r0, 0x16 + bne _0808AB16 + movs r0, 0x1C + bl sub_8097FA8 + ldr r0, _0808AB1C + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x2] +_0808AB16: + pop {r0} + bx r0 + .align 2, 0 +_0808AB1C: .4byte gUnknown_203B418 + thumb_func_end sub_808AAF0 + + thumb_func_start sub_808AB20 +sub_808AB20: + push {r4,r5,lr} + sub sp, 0x10 + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0x16 + bl sub_8085680 + adds r4, r0, 0 + ldr r0, [r4, 0xC] + str r0, [sp, 0x4] + ldr r0, [r4, 0x10] + movs r1, 0x80 + lsls r1, 6 + adds r0, r1 + str r0, [sp, 0x8] + ldr r0, _0808ABC4 + str r0, [sp, 0xC] + ldr r0, _0808ABC8 + add r3, sp, 0xC + movs r1, 0x1 + str r1, [sp] + movs r1, 0 + movs r2, 0 + bl sub_8085EC8 + movs r0, 0x1E + movs r1, 0x46 + bl sub_803E708 + bl sub_8086448 + add r0, sp, 0x4 + movs r1, 0x18 + bl sub_80858AC + movs r0, 0x2 + movs r1, 0x46 + bl sub_803E708 + adds r0, r4, 0 + bl sub_80862BC + movs r0, 0x20 + movs r1, 0x46 + bl sub_803E708 + bl sub_808692C + ldr r0, _0808ABCC + bl sub_8052910 + bl sub_808AC50 + ldr r0, _0808ABD0 + bl sub_8052910 + bl sub_808AC50 + ldr r0, _0808ABD4 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r1, 0x96 + lsls r1, 2 + adds r0, r4, 0 + movs r2, 0xB + bl sub_8086A70 + adds r5, 0xC + adds r0, r5, 0 + movs r1, 0x10 + bl sub_80858AC + add sp, 0x10 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808ABC4: .4byte 0x007000fc +_0808ABC8: .4byte 0x000001bd +_0808ABCC: .4byte gUnknown_8104E60 +_0808ABD0: .4byte gUnknown_8104EFC +_0808ABD4: .4byte gUnknown_8104F30 + thumb_func_end sub_808AB20 + + thumb_func_start sub_808ABD8 +sub_808ABD8: + push {r4,r5,lr} + bl sub_8085480 + adds r4, r0, 0 + movs r0, 0x16 + bl sub_8085680 + adds r5, r0, 0 + bl sub_8086448 + bl sub_808692C + ldr r0, _0808AC30 + bl sub_8052910 + bl sub_808AC50 + ldr r0, _0808AC34 + bl sub_8052910 + bl sub_808AC50 + ldr r0, _0808AC38 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r1, 0x96 + lsls r1, 2 + adds r0, r5, 0 + movs r2, 0xB + bl sub_8086A70 + adds r4, 0xC + adds r0, r4, 0 + movs r1, 0x10 + bl sub_80858AC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808AC30: .4byte gUnknown_8104F64 +_0808AC34: .4byte gUnknown_8104EFC +_0808AC38: .4byte gUnknown_8104F30 + thumb_func_end sub_808ABD8 + + thumb_func_start sub_808AC3C +sub_808AC3C: + push {lr} + bl sub_8086448 + ldr r0, _0808AC4C + bl sub_80866C4 + pop {r0} + bx r0 + .align 2, 0 +_0808AC4C: .4byte gUnknown_8104FC8 + thumb_func_end sub_808AC3C + + thumb_func_start sub_808AC50 +sub_808AC50: + push {r4,r5,lr} + sub sp, 0x4 + movs r0, 0xF7 + lsls r0, 1 + bl sub_8083E38 + ldr r1, _0808ACBC + movs r0, 0x1F + str r0, [r1] + movs r4, 0xFA + movs r5, 0x1 +_0808AC66: + str r5, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0x95 + bgt _0808AC66 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r4, 0xFA + movs r5, 0x1 +_0808AC8C: + str r5, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0 + bge _0808AC8C + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_8085EB0 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808ACBC: .4byte gUnknown_202EDC8 + thumb_func_end sub_808AC50 + + thumb_func_start sub_808ACC0 +sub_808ACC0: + push {r4,lr} + ldr r4, _0808ACF4 + adds r0, r4, 0 + bl sub_808E734 + lsls r0, 24 + cmp r0, 0 + beq _0808ACF8 + movs r0, 0x17 + bl sub_8085680 + movs r1, 0x87 + lsls r1, 2 + movs r2, 0 + bl sub_8068FE0 + movs r0, 0x22 + bl sub_8097FA8 + movs r0, 0x1D + bl sub_8097FA8 + movs r0, 0x79 + bl sub_808B1CC + b _0808AD38 + .align 2, 0 +_0808ACF4: .4byte 0x00000195 +_0808ACF8: + movs r0, 0x79 + bl sub_80860A8 + lsls r0, 24 + cmp r0, 0 + bne _0808AD10 + movs r0, 0x7A + bl sub_80860A8 + lsls r0, 24 + cmp r0, 0 + beq _0808AD1E +_0808AD10: + movs r0, 0x22 + bl sub_8098044 + movs r0, 0x1D + bl sub_8097FA8 + b _0808AD38 +_0808AD1E: + movs r0, 0x22 + bl sub_8098044 + movs r0, 0x1D + bl sub_8098044 + ldr r0, _0808AD40 + bl sub_80855E4 + ldr r0, _0808AD44 + adds r1, r4, 0 + bl sub_808D8BC +_0808AD38: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0808AD40: .4byte sub_808B2B0 +_0808AD44: .4byte gUnknown_202E038 + thumb_func_end sub_808ACC0 + + thumb_func_start sub_808AD48 +sub_808AD48: + push {r4,lr} + movs r4, 0xCB + lsls r4, 1 + adds r0, r4, 0 + bl sub_808E734 + lsls r0, 24 + cmp r0, 0 + beq _0808AD7E + movs r0, 0x18 + bl sub_8085680 + movs r1, 0x87 + lsls r1, 2 + movs r2, 0 + bl sub_8068FE0 + movs r0, 0x22 + bl sub_8097FA8 + movs r0, 0x1D + bl sub_8097FA8 + movs r0, 0x77 + bl sub_808B1CC + b _0808ADBE +_0808AD7E: + movs r0, 0x77 + bl sub_80860A8 + lsls r0, 24 + cmp r0, 0 + bne _0808AD96 + movs r0, 0x7A + bl sub_80860A8 + lsls r0, 24 + cmp r0, 0 + beq _0808ADA4 +_0808AD96: + movs r0, 0x22 + bl sub_8098044 + movs r0, 0x1D + bl sub_8097FA8 + b _0808ADBE +_0808ADA4: + movs r0, 0x22 + bl sub_8098044 + movs r0, 0x1D + bl sub_8098044 + ldr r0, _0808ADC4 + bl sub_80855E4 + ldr r0, _0808ADC8 + adds r1, r4, 0 + bl sub_808D8BC +_0808ADBE: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0808ADC4: .4byte sub_808B2B0 +_0808ADC8: .4byte gUnknown_202E038 + thumb_func_end sub_808AD48 + + thumb_func_start sub_808ADCC +sub_808ADCC: + push {r4,lr} + ldr r4, _0808AE00 + adds r0, r4, 0 + bl sub_808E734 + lsls r0, 24 + cmp r0, 0 + beq _0808AE04 + movs r0, 0x19 + bl sub_8085680 + movs r1, 0x87 + lsls r1, 2 + movs r2, 0 + bl sub_8068FE0 + movs r0, 0x22 + bl sub_8097FA8 + movs r0, 0x1D + bl sub_8097FA8 + movs r0, 0x78 + bl sub_808B1CC + b _0808AE44 + .align 2, 0 +_0808AE00: .4byte 0x00000197 +_0808AE04: + movs r0, 0x78 + bl sub_80860A8 + lsls r0, 24 + cmp r0, 0 + bne _0808AE1C + movs r0, 0x7A + bl sub_80860A8 + lsls r0, 24 + cmp r0, 0 + beq _0808AE2A +_0808AE1C: + movs r0, 0x22 + bl sub_8098044 + movs r0, 0x1D + bl sub_8097FA8 + b _0808AE44 +_0808AE2A: + movs r0, 0x22 + bl sub_8098044 + movs r0, 0x1D + bl sub_8098044 + ldr r0, _0808AE4C + bl sub_80855E4 + ldr r0, _0808AE50 + adds r1, r4, 0 + bl sub_808D8BC +_0808AE44: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0808AE4C: .4byte sub_808B2B0 +_0808AE50: .4byte gUnknown_202E038 + thumb_func_end sub_808ADCC + + thumb_func_start sub_808AE54 +sub_808AE54: + push {r4-r6,lr} + sub sp, 0x8 + adds r6, r2, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + bl sub_8085480 + adds r1, r0, 0 + mov r0, sp + movs r2, 0 + bl sub_8052D44 + movs r0, 0x22 + bl sub_8098100 + lsls r0, 24 + cmp r0, 0 + bne _0808AEBA + cmp r4, 0x2E + bne _0808AEBA + cmp r5, 0x17 + bne _0808AEBA + movs r0, 0 + bl sub_808B1CC + movs r0, 0x1D + bl sub_8098100 + lsls r0, 24 + cmp r0, 0 + bne _0808AEBA + add r4, sp, 0x4 + adds r0, r4, 0 + movs r1, 0x79 + movs r2, 0 + bl sub_8090A8C + bl sub_8083600 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_80464C8 + movs r0, 0x72 + bl sub_8083E88 + ldr r0, _0808AEC4 + bl sub_8052910 +_0808AEBA: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0808AEC4: .4byte gUnknown_8105040 + thumb_func_end sub_808AE54 + + thumb_func_start sub_808AEC8 +sub_808AEC8: + push {r4-r6,lr} + sub sp, 0x8 + adds r6, r2, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + bl sub_8085480 + adds r1, r0, 0 + mov r0, sp + movs r2, 0 + bl sub_8052D44 + movs r0, 0x22 + bl sub_8098100 + lsls r0, 24 + cmp r0, 0 + bne _0808AF2E + cmp r4, 0x2F + bne _0808AF2E + cmp r5, 0x18 + bne _0808AF2E + movs r0, 0 + bl sub_808B1CC + movs r0, 0x1D + bl sub_8098100 + lsls r0, 24 + cmp r0, 0 + bne _0808AF2E + add r4, sp, 0x4 + adds r0, r4, 0 + movs r1, 0x77 + movs r2, 0 + bl sub_8090A8C + bl sub_8083600 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_80464C8 + movs r0, 0x72 + bl sub_8083E88 + ldr r0, _0808AF38 + bl sub_8052910 +_0808AF2E: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0808AF38: .4byte gUnknown_810510C + thumb_func_end sub_808AEC8 + + thumb_func_start sub_808AF3C +sub_808AF3C: + push {r4-r6,lr} + sub sp, 0x8 + adds r6, r2, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r1, 24 + lsrs r4, r1, 24 + bl sub_8085480 + adds r1, r0, 0 + mov r0, sp + movs r2, 0 + bl sub_8052D44 + movs r0, 0x22 + bl sub_8098100 + lsls r0, 24 + cmp r0, 0 + bne _0808AFA2 + cmp r4, 0x30 + bne _0808AFA2 + cmp r5, 0x19 + bne _0808AFA2 + movs r0, 0 + bl sub_808B1CC + movs r0, 0x1D + bl sub_8098100 + lsls r0, 24 + cmp r0, 0 + bne _0808AFA2 + add r4, sp, 0x4 + adds r0, r4, 0 + movs r1, 0x78 + movs r2, 0 + bl sub_8090A8C + bl sub_8083600 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_80464C8 + movs r0, 0x72 + bl sub_8083E88 + ldr r0, _0808AFAC + bl sub_8052910 +_0808AFA2: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0808AFAC: .4byte gUnknown_81051D0 + thumb_func_end sub_808AF3C + + thumb_func_start sub_808AFB0 +sub_808AFB0: + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8085480 + adds r1, r0, 0 + mov r0, sp + movs r2, 0 + bl sub_8052D44 + movs r0, 0x22 + bl sub_8098100 + lsls r0, 24 + cmp r0, 0 + bne _0808B01E + cmp r4, 0x2E + bne _0808B01E + movs r0, 0x1D + bl sub_8098100 + lsls r0, 24 + cmp r0, 0 + bne _0808B01E + movs r0, 0x79 + bl sub_80860A8 + lsls r0, 24 + cmp r0, 0 + beq _0808B01E + movs r0, 0x1D + bl sub_8097FD0 + ldr r4, _0808B028 + bl sub_8083600 + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _0808B02C + bl sub_8052910 + movs r0, 0 + movs r1, 0xD4 + bl sub_80421C0 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_8046D20 +_0808B01E: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0808B028: .4byte gUnknown_202DF98 +_0808B02C: .4byte gUnknown_81050B4 + thumb_func_end sub_808AFB0 + + thumb_func_start sub_808B030 +sub_808B030: + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8085480 + adds r1, r0, 0 + mov r0, sp + movs r2, 0 + bl sub_8052D44 + movs r0, 0x22 + bl sub_8098100 + lsls r0, 24 + cmp r0, 0 + bne _0808B09E + cmp r4, 0x2F + bne _0808B09E + movs r0, 0x1D + bl sub_8098100 + lsls r0, 24 + cmp r0, 0 + bne _0808B09E + movs r0, 0x77 + bl sub_80860A8 + lsls r0, 24 + cmp r0, 0 + beq _0808B09E + movs r0, 0x1D + bl sub_8097FD0 + ldr r4, _0808B0A8 + bl sub_8083600 + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _0808B0AC + bl sub_8052910 + movs r0, 0 + movs r1, 0xD4 + bl sub_80421C0 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_8046D20 +_0808B09E: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0808B0A8: .4byte gUnknown_202DF98 +_0808B0AC: .4byte gUnknown_810517C + thumb_func_end sub_808B030 + + thumb_func_start sub_808B0B0 +sub_808B0B0: + push {r4,lr} + sub sp, 0x4 + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_8085480 + adds r1, r0, 0 + mov r0, sp + movs r2, 0 + bl sub_8052D44 + movs r0, 0x22 + bl sub_8098100 + lsls r0, 24 + cmp r0, 0 + bne _0808B11E + cmp r4, 0x30 + bne _0808B11E + movs r0, 0x1D + bl sub_8098100 + lsls r0, 24 + cmp r0, 0 + bne _0808B11E + movs r0, 0x78 + bl sub_80860A8 + lsls r0, 24 + cmp r0, 0 + beq _0808B11E + movs r0, 0x1D + bl sub_8097FD0 + ldr r4, _0808B128 + bl sub_8083600 + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0 + bl sub_8045B94 + ldr r0, _0808B12C + bl sub_8052910 + movs r0, 0 + movs r1, 0xD4 + bl sub_80421C0 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_8046D20 +_0808B11E: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0808B128: .4byte gUnknown_202DF98 +_0808B12C: .4byte gUnknown_8105244 + thumb_func_end sub_808B0B0 + + thumb_func_start sub_808B130 +sub_808B130: + push {lr} + movs r0, 0x22 + bl sub_8098100 + lsls r0, 24 + cmp r0, 0 + bne _0808B158 + movs r0, 0x4 + bl sub_8085930 + ldr r0, _0808B15C + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808B160 + bl sub_808563C +_0808B158: + pop {r0} + bx r0 + .align 2, 0 +_0808B15C: .4byte gUnknown_8104FD4 +_0808B160: .4byte sub_808B2C4 + thumb_func_end sub_808B130 + + thumb_func_start sub_808B164 +sub_808B164: + push {lr} + movs r0, 0x22 + bl sub_8098100 + lsls r0, 24 + cmp r0, 0 + bne _0808B18C + movs r0, 0x4 + bl sub_8085930 + ldr r0, _0808B190 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808B194 + bl sub_808563C +_0808B18C: + pop {r0} + bx r0 + .align 2, 0 +_0808B190: .4byte gUnknown_8105028 +_0808B194: .4byte sub_808B2D4 + thumb_func_end sub_808B164 + + thumb_func_start sub_808B198 +sub_808B198: + push {lr} + movs r0, 0x22 + bl sub_8098100 + lsls r0, 24 + cmp r0, 0 + bne _0808B1C0 + movs r0, 0x4 + bl sub_8085930 + ldr r0, _0808B1C4 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808B1C8 + bl sub_808563C +_0808B1C0: + pop {r0} + bx r0 + .align 2, 0 +_0808B1C4: .4byte gUnknown_8105034 +_0808B1C8: .4byte sub_808B2E4 + thumb_func_end sub_808B198 + + thumb_func_start sub_808B1CC +sub_808B1CC: + push {r4-r7,lr} + sub sp, 0x8 + lsls r0, 24 + lsrs r6, r0, 24 + ldr r7, _0808B21C + ldr r2, [r7] + ldr r1, _0808B220 + adds r0, r2, r1 + ldrh r0, [r0] + ldr r5, _0808B224 + ldr r1, [sp] + ands r1, r5 + orrs r1, r0 + str r1, [sp] + ldr r3, _0808B228 + adds r2, r3 + ldrh r0, [r2] + lsls r0, 16 + ldr r4, _0808B22C + adds r2, r4, 0 + ands r2, r1 + orrs r2, r0 + str r2, [sp] + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + blt _0808B208 + cmp r2, 0 + bge _0808B244 +_0808B208: + bl sub_8083600 + adds r2, r0, 0 + cmp r2, 0 + bne _0808B230 + ldr r1, [r7] + movs r0, 0x1 + strb r0, [r1, 0x2] + b _0808B2A8 + .align 2, 0 +_0808B21C: .4byte gUnknown_203B418 +_0808B220: .4byte 0x00000684 +_0808B224: .4byte 0xffff0000 +_0808B228: .4byte 0x00000686 +_0808B22C: .4byte 0x0000ffff +_0808B230: + ldrh r0, [r2, 0x4] + ldr r1, [sp] + ands r1, r5 + orrs r1, r0 + str r1, [sp] + ldrh r0, [r2, 0x6] + lsls r0, 16 + ands r1, r4 + orrs r1, r0 + str r1, [sp] +_0808B244: + mov r5, sp + mov r0, sp + movs r1, 0 + bl sub_807FE04 + mov r0, sp + movs r2, 0 + ldrsh r0, [r0, r2] + movs r3, 0x2 + ldrsh r1, [r5, r3] + bl sub_8049590 + ldrh r2, [r0] + movs r3, 0x80 + lsls r3, 2 + adds r1, r3, 0 + orrs r1, r2 + strh r1, [r0] + cmp r6, 0 + beq _0808B2A0 + adds r0, r6, 0 + bl sub_80860A8 + lsls r0, 24 + cmp r0, 0 + bne _0808B2A0 + movs r0, 0x7A + bl sub_80860A8 + lsls r0, 24 + cmp r0, 0 + bne _0808B2A0 + add r4, sp, 0x4 + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0 + bl sub_8090A8C + ldrh r0, [r5, 0x2] + subs r0, 0x1 + strh r0, [r5, 0x2] + mov r0, sp + adds r1, r4, 0 + movs r2, 0x1 + bl sub_80460F8 +_0808B2A0: + bl sub_8049ED4 + bl sub_8040A84 +_0808B2A8: + add sp, 0x8 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_808B1CC + + thumb_func_start sub_808B2B0 +sub_808B2B0: + push {lr} + ldr r1, [r0, 0x70] + adds r1, 0x46 + movs r2, 0x4 + strb r2, [r1] + movs r1, 0x4 + bl sub_806CE68 + pop {r0} + bx r0 + thumb_func_end sub_808B2B0 + + thumb_func_start sub_808B2C4 +sub_808B2C4: + push {lr} + movs r1, 0xE1 + lsls r1, 1 + movs r2, 0xB + bl sub_8086A70 + pop {r0} + bx r0 + thumb_func_end sub_808B2C4 + + thumb_func_start sub_808B2D4 +sub_808B2D4: + push {lr} + movs r1, 0xE1 + lsls r1, 1 + movs r2, 0xB + bl sub_8086A70 + pop {r0} + bx r0 + thumb_func_end sub_808B2D4 + + thumb_func_start sub_808B2E4 +sub_808B2E4: + push {lr} + movs r1, 0xE1 + lsls r1, 1 + movs r2, 0xB + bl sub_8086A70 + pop {r0} + bx r0 + thumb_func_end sub_808B2E4 + + thumb_func_start sub_808B2F4 +sub_808B2F4: + push {r4-r6,lr} + bl sub_8085480 + adds r6, r0, 0 + movs r0, 0x1A + bl sub_8085680 + adds r5, r0, 0 + movs r0, 0x79 + bl sub_8083E88 + bl sub_808BCE4 + bl sub_8049ED4 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + ldr r4, _0808B350 + adds r0, r4, 0 + bl sub_80855E4 + adds r0, r5, 0 + movs r1, 0 + bl sub_8085918 + adds r0, r5, 0 + bl _call_via_r4 + movs r1, 0x4 + ldrsh r0, [r6, r1] + movs r2, 0x6 + ldrsh r1, [r6, r2] + subs r1, 0x3 + bl sub_8085860 + ldr r0, _0808B354 + ldr r1, _0808B358 + bl sub_808D8BC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0808B350: .4byte sub_8086A3C +_0808B354: .4byte gUnknown_202E038 +_0808B358: .4byte 0x0000019d + thumb_func_end sub_808B2F4 + + thumb_func_start sub_808B35C +sub_808B35C: + push {r4-r6,lr} + bl sub_8085480 + adds r6, r0, 0 + movs r0, 0x1A + bl sub_8085680 + adds r4, r0, 0 + movs r0, 0x79 + bl sub_8083E88 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + ldr r5, _0808B3A0 + adds r0, r5, 0 + bl sub_80855E4 + ldr r0, _0808B3A4 + bl sub_808E734 + lsls r0, 24 + cmp r0, 0 + beq _0808B3A8 + movs r1, 0x87 + lsls r1, 2 + adds r0, r4, 0 + movs r2, 0 + bl sub_8068FE0 + b _0808B3BE + .align 2, 0 +_0808B3A0: .4byte sub_8086A3C +_0808B3A4: .4byte 0x0000019d +_0808B3A8: + adds r0, r4, 0 + movs r1, 0 + bl sub_8085918 + adds r0, r4, 0 + bl _call_via_r5 + bl sub_808BCE4 + bl sub_8049ED4 +_0808B3BE: + movs r1, 0x4 + ldrsh r0, [r6, r1] + movs r2, 0x6 + ldrsh r1, [r6, r2] + subs r1, 0x3 + bl sub_8085860 + ldr r0, _0808B3DC + ldr r1, _0808B3E0 + bl sub_808D8BC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0808B3DC: .4byte gUnknown_202E038 +_0808B3E0: .4byte 0x0000019d + thumb_func_end sub_808B35C + + thumb_func_start sub_808B3E4 +sub_808B3E4: + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsls r2, 24 + lsrs r4, r2, 24 + movs r2, 0xCF + lsls r2, 24 + adds r1, r2 + lsrs r1, 24 + cmp r1, 0x1 + bhi _0808B44E + cmp r0, 0x1A + bne _0808B44E + movs r0, 0x1E + bl sub_8097FA8 + cmp r4, 0 + beq _0808B418 + ldr r0, _0808B414 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x2] + b _0808B44E + .align 2, 0 +_0808B414: .4byte gUnknown_203B418 +_0808B418: + ldr r0, _0808B434 + ldr r0, [r0] + ldr r1, _0808B438 + adds r0, r1 + ldrb r4, [r0] + movs r0, 0x36 + bl sub_80860A8 + lsls r0, 24 + cmp r0, 0 + beq _0808B43C + bl sub_808B5B8 + b _0808B440 + .align 2, 0 +_0808B434: .4byte gUnknown_203B418 +_0808B438: .4byte 0x0001356c +_0808B43C: + bl sub_808B50C +_0808B440: + ldr r0, _0808B454 + ldr r0, [r0] + ldr r2, _0808B458 + adds r0, r2 + strb r4, [r0] + bl sub_8040A84 +_0808B44E: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0808B454: .4byte gUnknown_203B418 +_0808B458: .4byte 0x0001356c + thumb_func_end sub_808B3E4 + + thumb_func_start sub_808B45C +sub_808B45C: + push {r4,r5,lr} + bl sub_8085480 + adds r4, r0, 0 + movs r0, 0x1A + bl sub_8085680 + adds r5, r0, 0 + bl sub_8086448 + movs r0, 0x40 + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808B4F8 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r4, 0 + bl sub_808696C + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808B4FC + bl sub_8052910 + movs r0, 0x37 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_80861F8 + ldr r0, _0808B500 + bl sub_80855E4 + movs r0, 0x3C + movs r1, 0x46 + bl sub_803E708 + adds r0, r5, 0 + bl sub_808BBB8 + movs r0, 0x5A + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808B504 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808B508 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r1, 0xAF + lsls r1, 1 + adds r0, r5, 0 + movs r2, 0x20 + bl sub_8086A70 + adds r4, 0xC + adds r0, r4, 0 + movs r1, 0x10 + bl sub_80858AC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808B4F8: .4byte gUnknown_8105438 +_0808B4FC: .4byte gUnknown_81054A0 +_0808B500: .4byte sub_80862BC +_0808B504: .4byte gUnknown_81054E4 +_0808B508: .4byte gUnknown_810550C + thumb_func_end sub_808B45C + + thumb_func_start sub_808B50C +sub_808B50C: + push {r4,r5,lr} + movs r0, 0x1A + bl sub_8085680 + adds r5, r0, 0 + ldr r0, _0808B59C + ldr r1, _0808B5A0 + bl sub_808D8BC + ldr r4, _0808B5A4 + adds r0, r4, 0 + bl sub_80855E4 + adds r0, r5, 0 + bl _call_via_r4 + movs r0, 0 + bl sub_8041888 + ldr r0, [r5, 0x70] + movs r1, 0xAE + lsls r1, 1 + adds r0, r1 + movs r1, 0 + movs r4, 0x1 + strb r4, [r0] + ldr r0, [r5, 0x70] + movs r2, 0xAF + lsls r2, 1 + adds r0, r2 + strb r1, [r0] + adds r0, r5, 0 + movs r1, 0xE + movs r2, 0 + bl sub_80861B8 + movs r0, 0x1E + bl sub_8083ED8 + movs r0, 0x1E + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808B5A8 + bl sub_8052910 + movs r0, 0x79 + bl sub_8083E88 + ldr r0, _0808B5AC + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r5, 0 + bl sub_808BC20 + ldr r0, _0808B5B0 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808B5B4 + ldr r0, [r0] + strb r4, [r0, 0x2] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808B59C: .4byte gUnknown_202E038 +_0808B5A0: .4byte 0x0000019d +_0808B5A4: .4byte sub_808BBA8 +_0808B5A8: .4byte gUnknown_810554C +_0808B5AC: .4byte gUnknown_8105558 +_0808B5B0: .4byte gUnknown_81055F4 +_0808B5B4: .4byte gUnknown_203B418 + thumb_func_end sub_808B50C + + thumb_func_start sub_808B5B8 +sub_808B5B8: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x78 + movs r0, 0x1A + bl sub_8085680 + adds r6, r0, 0 + ldr r0, _0808B82C + ldr r1, _0808B830 + bl sub_808D8BC + ldr r4, _0808B834 + adds r0, r4, 0 + bl sub_80855E4 + adds r0, r6, 0 + bl _call_via_r4 + movs r0, 0 + bl sub_8041888 + ldr r0, [r6, 0x70] + movs r1, 0xAE + lsls r1, 1 + adds r0, r1 + movs r1, 0 + movs r4, 0x1 + strb r4, [r0] + ldr r0, [r6, 0x70] + movs r2, 0xAF + lsls r2, 1 + adds r0, r2 + strb r1, [r0] + adds r0, r6, 0 + movs r1, 0xE + movs r2, 0 + bl sub_80861B8 + ldr r0, _0808B838 + bl sub_80855E4 + ldr r0, _0808B83C + ldr r0, [r0] + ldr r1, _0808B840 + adds r0, r1 + strb r4, [r0] + movs r0, 0x1E + bl sub_8083ED8 + movs r0, 0x1E + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808B844 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808B848 + bl sub_8083E38 + movs r0, 0x96 + movs r1, 0x46 + bl sub_803E708 + adds r0, r6, 0 + bl sub_80862BC + ldr r0, _0808B84C + bl sub_8052910 + movs r0, 0x79 + bl sub_8083E88 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r6, 0 + movs r1, 0 + bl sub_80856E0 + movs r0, 0xB5 + lsls r0, 1 + bl sub_8083E38 + ldr r0, _0808B850 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r6, 0 + bl sub_808696C + ldr r0, _0808B854 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 +_0808B690: + ldr r4, _0808B858 +_0808B692: + movs r0, 0 + ldr r1, [r4] + ldr r2, _0808B85C + ldr r3, _0808B860 + bl sub_8052C68 + mov r9, r0 + cmp r0, 0 + ble _0808B692 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + mov r2, r9 + cmp r2, 0x1 + bne _0808B754 + ldr r0, _0808B864 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r6, 0 + bl sub_808BC70 + movs r0, 0 + add r7, sp, 0x6C +_0808B6CA: + adds r0, 0x1 + mov r8, r0 + mov r4, sp + movs r5, 0x8 +_0808B6D2: + adds r0, r4, 0 + movs r1, 0x69 + movs r2, 0 + bl sub_8045C28 + adds r4, 0x4 + subs r5, 0x1 + cmp r5, 0 + bge _0808B6D2 + movs r0, 0x3 + bl sub_8084100 + ldrh r1, [r6, 0x4] + adds r1, r0 + subs r1, 0x1 + lsls r1, 16 + lsrs r1, 16 + ldr r2, _0808B868 + ldr r0, [sp, 0x6C] + ands r0, r2 + orrs r0, r1 + str r0, [sp, 0x6C] + movs r0, 0x3 + bl sub_8084100 + ldrh r2, [r6, 0x6] + adds r2, r0 + subs r2, 0x1 + lsls r2, 16 + ldr r0, _0808B86C + ldr r1, [sp, 0x6C] + ands r1, r0 + orrs r1, r2 + str r1, [sp, 0x6C] + movs r2, 0 + ldrsh r0, [r7, r2] + asrs r1, 16 + bl sub_8049590 + ldrh r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _0808B744 + movs r0, 0xA6 + lsls r0, 1 + bl sub_8083E38 + adds r0, r7, 0 + bl sub_808BB3C + adds r0, r6, 0 + adds r1, r7, 0 + mov r2, sp + movs r3, 0x9 + bl sub_8046860 +_0808B744: + mov r0, r8 + cmp r0, 0x5 + ble _0808B6CA + ldr r0, [r6, 0x70] + ldr r2, _0808B870 + adds r1, r0, r2 + movs r0, 0 + strb r0, [r1] +_0808B754: + mov r0, r9 + cmp r0, 0x2 + bne _0808B80A + ldr r0, _0808B874 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r6, 0 + bl sub_808BC70 + movs r0, 0 + add r1, sp, 0x24 + mov r8, r1 + add r7, sp, 0x70 +_0808B776: + adds r0, 0x1 + mov r10, r0 + mov r4, r8 + movs r5, 0x8 +_0808B77E: + movs r0, 0 + bl sub_803D73C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + movs r2, 0 + bl sub_8045C28 + adds r4, 0x4 + subs r5, 0x1 + cmp r5, 0 + bge _0808B77E + movs r0, 0x3 + bl sub_8084100 + ldrh r1, [r6, 0x4] + adds r1, r0 + subs r1, 0x1 + lsls r1, 16 + lsrs r1, 16 + ldr r2, _0808B868 + ldr r0, [sp, 0x70] + ands r0, r2 + orrs r0, r1 + str r0, [sp, 0x70] + movs r0, 0x3 + bl sub_8084100 + ldrh r2, [r6, 0x6] + adds r2, r0 + subs r2, 0x1 + lsls r2, 16 + ldr r0, _0808B86C + ldr r1, [sp, 0x70] + ands r1, r0 + orrs r1, r2 + str r1, [sp, 0x70] + movs r2, 0 + ldrsh r0, [r7, r2] + asrs r1, 16 + bl sub_8049590 + ldrh r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _0808B7FA + movs r0, 0xC8 + lsls r0, 1 + bl sub_8083E38 + adds r0, r7, 0 + bl sub_808BB3C + adds r0, r6, 0 + adds r1, r7, 0 + mov r2, r8 + movs r3, 0x9 + bl sub_8046860 +_0808B7FA: + mov r0, r10 + cmp r0, 0x5 + ble _0808B776 + ldr r0, [r6, 0x70] + ldr r2, _0808B870 + adds r1, r0, r2 + movs r0, 0 + strb r0, [r1] +_0808B80A: + mov r0, r9 + cmp r0, 0x3 + bne _0808B8CA + bl sub_808BD94 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3A + bne _0808B87C + ldr r0, _0808B878 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + b _0808B690 + .align 2, 0 +_0808B82C: .4byte gUnknown_202E038 +_0808B830: .4byte 0x0000019d +_0808B834: .4byte sub_808BBA8 +_0808B838: .4byte sub_80861A8 +_0808B83C: .4byte gUnknown_203B418 +_0808B840: .4byte 0x0001356c +_0808B844: .4byte gUnknown_8105668 +_0808B848: .4byte 0x000001a7 +_0808B84C: .4byte gUnknown_8105674 +_0808B850: .4byte gUnknown_81056B8 +_0808B854: .4byte gUnknown_81056DC +_0808B858: .4byte gUnknown_8105798 +_0808B85C: .4byte gUnknown_810579C +_0808B860: .4byte 0x00000705 +_0808B864: .4byte gUnknown_810581C +_0808B868: .4byte 0xffff0000 +_0808B86C: .4byte 0x0000ffff +_0808B870: .4byte 0x0000015d +_0808B874: .4byte gUnknown_8105974 +_0808B878: .4byte gUnknown_8105A08 +_0808B87C: + ldr r0, _0808BA30 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r6, 0 + bl sub_808BC70 + ldr r0, [r6, 0x70] + ldr r2, _0808BA34 + adds r1, r0, r2 + movs r0, 0 + strb r0, [r1] + ldr r0, _0808BA38 + bl sub_8052910 + adds r0, r4, 0 + bl sub_80925EC + movs r0, 0xD4 + bl sub_8083E38 + bl sub_8083600 + adds r1, r0, 0 + ldr r0, _0808BA3C + movs r2, 0 + bl sub_8045B94 + ldr r0, _0808BA40 + adds r1, r4, 0 + movs r2, 0 + bl sub_8092578 + ldr r0, _0808BA44 + bl sub_8052910 +_0808B8CA: + mov r0, r9 + cmp r0, 0x4 + bne _0808B98E + ldr r0, _0808BA48 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r6, 0 + bl sub_808BC70 + movs r0, 0 + add r1, sp, 0x48 + mov r8, r1 + add r7, sp, 0x74 +_0808B8EC: + adds r0, 0x1 + mov r10, r0 + mov r4, r8 + movs r5, 0x3 +_0808B8F4: + movs r0, 0x8 + bl sub_8084100 + ldr r2, _0808BA4C + adds r0, r2 + ldrb r1, [r0] + adds r0, r4, 0 + movs r2, 0 + bl sub_8045C28 + adds r4, 0x4 + subs r5, 0x1 + cmp r5, 0 + bge _0808B8F4 + movs r0, 0x3 + bl sub_8084100 + ldrh r1, [r6, 0x4] + adds r1, r0 + subs r1, 0x1 + lsls r1, 16 + lsrs r1, 16 + ldr r2, _0808BA50 + ldr r0, [sp, 0x74] + ands r0, r2 + orrs r0, r1 + str r0, [sp, 0x74] + movs r0, 0x3 + bl sub_8084100 + ldrh r2, [r6, 0x6] + adds r2, r0 + subs r2, 0x1 + lsls r2, 16 + ldr r0, _0808BA54 + ldr r1, [sp, 0x74] + ands r1, r0 + orrs r1, r2 + str r1, [sp, 0x74] + movs r2, 0 + ldrsh r0, [r7, r2] + asrs r1, 16 + bl sub_8049590 + ldrh r1, [r0] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _0808B970 + movs r0, 0xC8 + lsls r0, 1 + bl sub_8083E38 + adds r0, r7, 0 + bl sub_808BB3C + adds r0, r6, 0 + adds r1, r7, 0 + mov r2, r8 + movs r3, 0x4 + bl sub_8046860 +_0808B970: + mov r0, r10 + cmp r0, 0x4 + ble _0808B8EC + ldr r0, [r6, 0x70] + ldr r2, _0808BA34 + adds r1, r0, r2 + movs r0, 0 + strb r0, [r1] + ldr r0, _0808BA58 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 +_0808B98E: + mov r0, r9 + cmp r0, 0x5 + bne _0808B9F8 + ldr r0, _0808BA5C + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r6, 0 + bl sub_808BC70 + ldr r0, [r6, 0x70] + ldr r2, _0808BA34 + adds r1, r0, r2 + movs r0, 0 + strb r0, [r1] + ldr r0, _0808BA60 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_8083600 + adds r1, r0, 0 + adds r1, 0x4 + adds r0, r6, 0x4 + bl sub_80983D8 + adds r1, r0, 0 + adds r0, r6, 0 + bl sub_8085918 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808BA64 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808BA68 + ldr r0, [r0] + ldr r1, _0808BA6C + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] +_0808B9F8: + ldr r0, _0808BA70 + bl sub_8052910 + adds r0, r6, 0 + bl sub_808BC20 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808BA74 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_808BD38 + add sp, 0x78 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0808BA30: .4byte gUnknown_8105AD4 +_0808BA34: .4byte 0x0000015d +_0808BA38: .4byte gUnknown_8105B20 +_0808BA3C: .4byte gUnknown_202DF98 +_0808BA40: .4byte gUnknown_202DE58 +_0808BA44: .4byte gUnknown_8105B68 +_0808BA48: .4byte gUnknown_8105BA8 +_0808BA4C: .4byte gUnknown_81074FC +_0808BA50: .4byte 0xffff0000 +_0808BA54: .4byte 0x0000ffff +_0808BA58: .4byte gUnknown_8105BF4 +_0808BA5C: .4byte gUnknown_8105D2C +_0808BA60: .4byte gUnknown_8105D80 +_0808BA64: .4byte gUnknown_8105D9C +_0808BA68: .4byte gUnknown_203B418 +_0808BA6C: .4byte 0x00000674 +_0808BA70: .4byte gUnknown_81058E0 +_0808BA74: .4byte gUnknown_810593C + thumb_func_end sub_808B5B8 + + thumb_func_start sub_808BA78 +sub_808BA78: + push {lr} + ldr r0, _0808BA94 + bl sub_808E734 + lsls r0, 24 + cmp r0, 0 + beq _0808BA9C + bl sub_8086448 + ldr r0, _0808BA98 + bl sub_80866C4 + b _0808BAA0 + .align 2, 0 +_0808BA94: .4byte 0x0000019d +_0808BA98: .4byte gUnknown_8105E14 +_0808BA9C: + bl sub_808B45C +_0808BAA0: + pop {r0} + bx r0 + thumb_func_end sub_808BA78 + + thumb_func_start sub_808BAA4 +sub_808BAA4: + push {r4,r5,lr} + sub sp, 0x4 + ldr r0, _0808BB34 + bl sub_8083E38 + ldr r1, _0808BB38 + movs r0, 0x1F + str r0, [r1] + movs r4, 0xFA + movs r5, 0x1 +_0808BAB8: + str r5, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0x95 + bgt _0808BAB8 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r4, 0xFA + movs r5, 0x1 +_0808BADE: + str r5, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0xC7 + bgt _0808BADE + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r4, 0xFA + movs r5, 0x1 +_0808BB04: + str r5, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0 + bge _0808BB04 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_8085EB0 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808BB34: .4byte 0x000002c1 +_0808BB38: .4byte gUnknown_202EDC8 + thumb_func_end sub_808BAA4 + + thumb_func_start sub_808BB3C +sub_808BB3C: + push {lr} + sub sp, 0x8 + adds r3, r0, 0 + movs r0, 0 + ldrsh r1, [r3, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 11 + movs r1, 0xC0 + lsls r1, 4 + adds r0, r1 + cmp r0, 0 + bge _0808BB58 + adds r0, 0xFF +_0808BB58: + lsls r0, 8 + lsrs r0, 16 + ldr r1, _0808BBA0 + ldr r2, [sp, 0x4] + ands r2, r1 + orrs r2, r0 + str r2, [sp, 0x4] + movs r0, 0x2 + ldrsh r1, [r3, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 11 + movs r1, 0x80 + lsls r1, 5 + adds r0, r1 + cmp r0, 0 + bge _0808BB7C + adds r0, 0xFF +_0808BB7C: + lsls r0, 8 + lsrs r0, 16 + lsls r0, 16 + ldr r1, _0808BBA4 + ands r2, r1 + orrs r2, r0 + str r2, [sp, 0x4] + movs r0, 0 + str r0, [sp] + movs r0, 0x64 + movs r1, 0 + movs r2, 0 + add r3, sp, 0x4 + bl sub_8085EC8 + add sp, 0x8 + pop {r0} + bx r0 + .align 2, 0 +_0808BBA0: .4byte 0xffff0000 +_0808BBA4: .4byte 0x0000ffff + thumb_func_end sub_808BB3C + + thumb_func_start sub_808BBA8 +sub_808BBA8: + push {lr} + ldr r0, [r0, 0x70] + movs r1, 0 + bl sub_806BFC0 + pop {r0} + bx r0 + thumb_func_end sub_808BBA8 + + thumb_func_start sub_808BBB8 +sub_808BBB8: + push {r4-r7,lr} + adds r5, r0, 0 + movs r0, 0x1B + adds r1, r5, 0 + movs r2, 0 + bl sub_80861F8 + adds r0, r5, 0 + bl sub_8086A54 + adds r0, r5, 0 + movs r1, 0xE + movs r2, 0 + bl sub_80861B8 + movs r4, 0xA0 + lsls r4, 8 + movs r6, 0x80 + lsls r6, 2 + movs r0, 0xFC + lsls r0, 1 + bl sub_8083E38 + ldr r7, _0808BBEC + b _0808BC00 + .align 2, 0 +_0808BBEC: .4byte 0x000017ff +_0808BBF0: + ldr r0, [r5, 0x70] + movs r1, 0xBA + lsls r1, 1 + adds r0, r1 + str r4, [r0] + movs r0, 0x46 + bl sub_803E46C +_0808BC00: + subs r4, r6 + cmp r4, r7 + bgt _0808BC0A + movs r6, 0x80 + lsls r6, 1 +_0808BC0A: + cmp r4, 0 + bge _0808BBF0 + ldr r0, [r5, 0x70] + movs r1, 0xBA + lsls r1, 1 + adds r0, r1 + movs r1, 0 + str r1, [r0] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_808BBB8 + + thumb_func_start sub_808BC20 +sub_808BC20: + push {r4-r6,lr} + adds r5, r0, 0 + movs r0, 0xA6 + lsls r0, 2 + bl sub_8083E38 + movs r4, 0 + movs r6, 0x7 +_0808BC30: + adds r1, r4, 0 + ands r1, r6 + adds r0, r5, 0 + bl sub_8085918 + movs r0, 0x3 + movs r1, 0x46 + bl sub_803E708 + adds r4, 0x1 + cmp r4, 0x18 + ble _0808BC30 + ldr r0, [r5, 0x70] + movs r2, 0xAF + lsls r2, 1 + adds r1, r0, r2 + movs r0, 0x1 + strb r0, [r1] + ldr r0, _0808BC6C + bl sub_8083E38 + movs r0, 0x63 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_80861F8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0808BC6C: .4byte 0x0000027f + thumb_func_end sub_808BC20 + + thumb_func_start sub_808BC70 +sub_808BC70: + push {r4,lr} + adds r4, r0, 0 + ldr r0, [r4, 0x70] + ldr r2, _0808BCD4 + adds r1, r0, r2 + movs r0, 0x1 + strb r0, [r1] + ldr r0, _0808BCD8 + bl sub_8052910 + ldr r0, _0808BCDC + bl sub_8083E38 + movs r0, 0x67 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_80861F8 + movs r0, 0xAA + lsls r0, 2 + bl sub_8083E38 + movs r0, 0x68 + adds r1, r4, 0 + movs r2, 0 + bl sub_80861F8 + adds r4, r0, 0 + ldr r0, _0808BCE0 + bl sub_8052910 + adds r0, r4, 0 + bl sub_800E9A8 + lsls r0, 24 + cmp r0, 0 + beq _0808BCC0 + adds r0, r4, 0 + bl sub_800DC14 +_0808BCC0: + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_808BAA4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0808BCD4: .4byte 0x0000015d +_0808BCD8: .4byte gUnknown_81058A8 +_0808BCDC: .4byte 0x00000375 +_0808BCE0: .4byte gUnknown_81058C4 + thumb_func_end sub_808BC70 + + thumb_func_start sub_808BCE4 +sub_808BCE4: + push {lr} + ldr r0, _0808BD24 + ldr r1, [r0] + ldr r2, _0808BD28 + adds r0, r1, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + ldr r2, _0808BD2C + adds r1, r2 + movs r2, 0 + ldrsh r1, [r1, r2] + bl sub_8049590 + ldrh r2, [r0] + ldr r1, _0808BD30 + ands r1, r2 + movs r2, 0x10 + orrs r1, r2 + ldr r2, _0808BD34 + ands r1, r2 + strh r1, [r0] + bl sub_8049884 + bl sub_8049B8C + bl sub_8049ED4 + bl sub_8040A84 + pop {r0} + bx r0 + .align 2, 0 +_0808BD24: .4byte gUnknown_203B418 +_0808BD28: .4byte 0x0000e23c +_0808BD2C: .4byte 0x0000e23e +_0808BD30: .4byte 0x0000fffc +_0808BD34: .4byte 0x0000fdff + thumb_func_end sub_808BCE4 + + thumb_func_start sub_808BD38 +sub_808BD38: + push {r4,lr} + ldr r0, _0808BD84 + ldr r1, [r0] + ldr r2, _0808BD88 + adds r0, r1, r2 + movs r4, 0 + ldrsh r0, [r0, r4] + adds r2, 0x2 + adds r1, r2 + movs r4, 0 + ldrsh r1, [r1, r4] + bl sub_8049590 + ldrh r2, [r0] + ldr r1, _0808BD8C + ands r1, r2 + movs r3, 0x1 + orrs r1, r3 + ldr r2, _0808BD90 + ands r1, r2 + movs r4, 0x80 + lsls r4, 2 + adds r2, r4, 0 + orrs r1, r2 + strh r1, [r0] + strb r3, [r0, 0x8] + bl sub_8049884 + bl sub_8049B8C + bl sub_8049ED4 + bl sub_8040A84 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0808BD84: .4byte gUnknown_203B418 +_0808BD88: .4byte 0x0000e23c +_0808BD8C: .4byte 0x0000fffc +_0808BD90: .4byte 0x0000ffef + thumb_func_end sub_808BD38 + + thumb_func_start sub_808BD94 +sub_808BD94: + push {r4,r5,lr} + sub sp, 0x3C + movs r5, 0 + movs r4, 0x1 +_0808BD9C: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8092534 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + beq _0808BDC4 + cmp r0, 0x2 + beq _0808BDC4 + ldr r0, _0808BDDC + ldr r0, [r0] + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _0808BDC4 + mov r1, sp + adds r0, r1, r5 + strb r4, [r0] + adds r5, 0x1 +_0808BDC4: + adds r4, 0x1 + cmp r4, 0x39 + ble _0808BD9C + cmp r5, 0 + beq _0808BDE0 + adds r0, r5, 0 + bl sub_8084100 + add r0, sp + ldrb r0, [r0] + b _0808BDE2 + .align 2, 0 +_0808BDDC: .4byte gUnknown_203B468 +_0808BDE0: + movs r0, 0x3A +_0808BDE2: + add sp, 0x3C + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_808BD94 + + thumb_func_start sub_808BDEC +sub_808BDEC: + push {r4,r5,lr} + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0x1B + bl sub_8085680 + adds r4, r0, 0 + bl sub_8083F14 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + ldr r0, _0808BE34 + bl sub_80855E4 + movs r0, 0x89 + lsls r0, 1 + bl sub_808E734 + lsls r0, 24 + cmp r0, 0 + beq _0808BE38 + movs r0, 0x23 + bl sub_8083E88 + movs r1, 0x87 + lsls r1, 2 + adds r0, r4, 0 + movs r2, 0 + bl sub_8068FE0 + b _0808BE48 + .align 2, 0 +_0808BE34: .4byte sub_8086A3C +_0808BE38: + ldr r0, _0808BE68 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x7] + adds r0, r4, 0 + movs r1, 0 + bl sub_8085918 +_0808BE48: + movs r1, 0x4 + ldrsh r0, [r5, r1] + movs r2, 0x6 + ldrsh r1, [r5, r2] + subs r1, 0x3 + bl sub_8085860 + ldr r0, _0808BE6C + movs r1, 0x89 + lsls r1, 1 + bl sub_808D8BC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808BE68: .4byte gUnknown_203B418 +_0808BE6C: .4byte gUnknown_202E038 + thumb_func_end sub_808BDEC + + thumb_func_start sub_808BE70 +sub_808BE70: + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x33 + bne _0808BE8A + cmp r0, 0x1B + bne _0808BE8A + ldr r0, _0808BE90 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x2] +_0808BE8A: + pop {r0} + bx r0 + .align 2, 0 +_0808BE90: .4byte gUnknown_203B418 + thumb_func_end sub_808BE70 + + thumb_func_start sub_808BE94 +sub_808BE94: + push {r4-r6,lr} + sub sp, 0x4 + bl sub_8085480 + adds r6, r0, 0 + movs r0, 0x1B + bl sub_8085680 + adds r4, r0, 0 + movs r0, 0x89 + lsls r0, 1 + bl sub_808E734 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + beq _0808BEC8 + bl sub_8086448 + ldr r0, _0808BEC4 + bl sub_80866C4 + b _0808BF7C + .align 2, 0 +_0808BEC4: .4byte gUnknown_8106068 +_0808BEC8: + bl sub_8083F14 + bl sub_8086448 + ldr r0, _0808BF84 + bl sub_8052910 + movs r0, 0x23 + movs r1, 0x3C + bl sub_8083EA8 + bl sub_808C0CC + ldr r0, _0808BF88 + bl sub_8052910 + bl sub_808BFA0 + ldr r0, _0808BF8C + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808BF90 + bl sub_8052910 + movs r0, 0xFC + lsls r0, 1 + bl sub_8083E38 + adds r0, r4, 0 + movs r1, 0xD + movs r2, 0 + bl sub_80861D4 + movs r0, 0x2B + movs r1, 0x46 + bl sub_803E708 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl sub_80861B8 + ldr r0, _0808BF94 + bl sub_8052910 + bl sub_808BFA0 + ldr r0, _0808BF98 + bl sub_8052910 + bl sub_808C02C + movs r2, 0xFA + negs r2, r2 + str r5, [sp] + adds r0, r2, 0 + adds r1, r2, 0 + movs r3, 0x1 + bl sub_8085C54 + bl sub_8083F14 + adds r0, r4, 0 + movs r1, 0x7 + movs r2, 0 + bl sub_80861D4 + ldr r0, _0808BF9C + bl sub_8052910 + bl sub_808BFA0 + movs r1, 0xC8 + lsls r1, 2 + adds r0, r4, 0 + movs r2, 0x20 + bl sub_8086A70 + movs r0, 0x23 + bl sub_8083E88 + adds r0, r6, 0 + adds r0, 0xC + movs r1, 0x10 + bl sub_80858AC +_0808BF7C: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0808BF84: .4byte gUnknown_8105E88 +_0808BF88: .4byte gUnknown_8105EF8 +_0808BF8C: .4byte gUnknown_8105F38 +_0808BF90: .4byte gUnknown_8105F74 +_0808BF94: .4byte gUnknown_8105FA0 +_0808BF98: .4byte gUnknown_8105FD8 +_0808BF9C: .4byte gUnknown_8106024 + thumb_func_end sub_808BE94 + + thumb_func_start sub_808BFA0 +sub_808BFA0: + push {r4,r5,lr} + sub sp, 0x4 + movs r0, 0xFB + lsls r0, 1 + bl sub_8083E38 + movs r4, 0xFA + movs r5, 0x1 +_0808BFB0: + str r5, [sp] + movs r0, 0 + movs r1, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0x95 + bgt _0808BFB0 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r4, 0xFA + movs r5, 0x1 +_0808BFD6: + str r5, [sp] + movs r0, 0 + adds r1, r4, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0xC7 + bgt _0808BFD6 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r4, 0xFA + movs r5, 0x1 +_0808BFFC: + str r5, [sp] + movs r0, 0 + movs r1, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0 + bge _0808BFFC + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_8085EB0 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_808BFA0 + + thumb_func_start sub_808C02C +sub_808C02C: + push {r4,r5,lr} + sub sp, 0x4 + movs r0, 0xFB + lsls r0, 1 + bl sub_8083E38 + movs r4, 0 + movs r5, 0 +_0808C03C: + str r5, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + adds r4, 0x64 + cmp r4, 0xC7 + ble _0808C03C + movs r4, 0xC8 + movs r5, 0 +_0808C05A: + str r5, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0x64 + cmp r4, 0 + bge _0808C05A + movs r0, 0x4 + movs r1, 0x46 + bl sub_803E708 + movs r4, 0 + movs r5, 0 +_0808C080: + str r5, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + adds r4, 0x64 + cmp r4, 0xC7 + ble _0808C080 + movs r4, 0xC8 + movs r5, 0 +_0808C09E: + str r5, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0x64 + cmp r4, 0 + bge _0808C09E + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_8085EB0 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_808C02C + + thumb_func_start sub_808C0CC +sub_808C0CC: + push {lr} + sub sp, 0x4 + ldr r1, _0808C104 + movs r0, 0x1F + str r0, [r1] + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_8085C54 + bl sub_803E9D0 + movs r0, 0x46 + bl sub_803E46C + ldr r0, _0808C108 + ldr r1, [r0] + movs r0, 0 + strb r0, [r1, 0x7] + bl sub_808BFA0 + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_0808C104: .4byte gUnknown_202EDC8 +_0808C108: .4byte gUnknown_203B418 + thumb_func_end sub_808C0CC + + thumb_func_start sub_808C10C +sub_808C10C: + push {r4,r5,lr} + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0x1C + bl sub_8085680 + adds r4, r0, 0 + bl sub_8083F14 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + movs r0, 0xCD + lsls r0, 1 + bl sub_808E734 + lsls r0, 24 + cmp r0, 0 + beq _0808C146 + movs r1, 0x87 + lsls r1, 2 + adds r0, r4, 0 + movs r2, 0 + bl sub_8068FE0 + b _0808C156 +_0808C146: + ldr r0, _0808C194 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x7] + adds r0, r4, 0 + movs r1, 0 + bl sub_8085918 +_0808C156: + movs r1, 0x4 + ldrsh r0, [r5, r1] + movs r2, 0x6 + ldrsh r1, [r5, r2] + bl sub_8085860 + bl sub_803F994 + adds r4, r0, 0 + bl sub_803F9B0 + adds r1, r0, 0 + ldr r0, _0808C198 + adds r1, r0 + adds r0, r4, 0 + bl sub_803F878 + ldr r4, _0808C19C + movs r1, 0xCD + lsls r1, 1 + adds r0, r4, 0 + bl sub_808D8BC + adds r4, 0x50 + ldr r1, _0808C1A0 + adds r0, r4, 0 + bl sub_808D8BC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808C194: .4byte gUnknown_203B418 +_0808C198: .4byte 0xfffff000 +_0808C19C: .4byte gUnknown_202E038 +_0808C1A0: .4byte 0x0000019b + thumb_func_end sub_808C10C + + thumb_func_start sub_808C1A4 +sub_808C1A4: + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x34 + bne _0808C1C4 + cmp r0, 0x1C + bne _0808C1C4 + ldr r0, _0808C1C8 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x2] + movs r0, 0x23 + bl sub_8083E88 +_0808C1C4: + pop {r0} + bx r0 + .align 2, 0 +_0808C1C8: .4byte gUnknown_203B418 + thumb_func_end sub_808C1A4 + + thumb_func_start sub_808C1CC +sub_808C1CC: + push {r4,r5,lr} + bl sub_8085480 + adds r4, r0, 0 + movs r0, 0x1C + bl sub_8085680 + adds r5, r0, 0 + bl sub_8083F14 + movs r0, 0xCD + lsls r0, 1 + bl sub_808E734 + lsls r0, 24 + cmp r0, 0 + beq _0808C224 + movs r0, 0x23 + movs r1, 0x3C + bl sub_8083EA8 + adds r0, r4, 0 + bl sub_808696C + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808C21C + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808C220 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x2] + b _0808C2AE + .align 2, 0 +_0808C21C: .4byte gUnknown_81062A8 +_0808C220: .4byte gUnknown_203B418 +_0808C224: + ldr r0, _0808C2B4 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808C2B8 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl nullsub_99 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808C2BC + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r0, 0x23 + movs r1, 0x3C + bl sub_8083EA8 + bl sub_808C360 + ldr r0, _0808C2C0 + bl sub_8052910 + bl sub_808C2D4 + ldr r0, _0808C2C4 + bl sub_8052910 + bl sub_808C2D4 + ldr r0, _0808C2C8 + bl sub_8052910 + bl sub_808C2D4 + ldr r0, _0808C2CC + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r1, 0x96 + lsls r1, 2 + adds r0, r5, 0 + movs r2, 0xB + bl sub_8086A70 + movs r0, 0x23 + bl sub_8083E88 + adds r0, r4, 0 + adds r0, 0xC + movs r1, 0x10 + bl sub_80858AC +_0808C2AE: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808C2B4: .4byte gUnknown_8106074 +_0808C2B8: .4byte gUnknown_81060BC +_0808C2BC: .4byte gUnknown_8106104 +_0808C2C0: .4byte gUnknown_8106140 +_0808C2C4: .4byte gUnknown_8106214 +_0808C2C8: .4byte gUnknown_8106244 +_0808C2CC: .4byte gUnknown_810627C + thumb_func_end sub_808C1CC + + thumb_func_start nullsub_99 +nullsub_99: + bx lr + thumb_func_end nullsub_99 + + thumb_func_start sub_808C2D4 +sub_808C2D4: + push {r4,r5,lr} + sub sp, 0x4 + movs r0, 0xFC + lsls r0, 1 + bl sub_8083E38 + movs r4, 0xFA + movs r5, 0x1 +_0808C2E4: + str r5, [sp] + movs r0, 0 + movs r1, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0x95 + bgt _0808C2E4 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r4, 0xFA + movs r5, 0x1 +_0808C30A: + str r5, [sp] + movs r0, 0 + adds r1, r4, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0xC7 + bgt _0808C30A + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r4, 0xFA + movs r5, 0x1 +_0808C330: + str r5, [sp] + movs r0, 0 + movs r1, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0 + bge _0808C330 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_8085EB0 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_808C2D4 + + thumb_func_start sub_808C360 +sub_808C360: + push {lr} + sub sp, 0x4 + ldr r1, _0808C398 + movs r0, 0x1F + str r0, [r1] + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_8085C54 + bl sub_803E9D0 + movs r0, 0x46 + bl sub_803E46C + ldr r0, _0808C39C + ldr r1, [r0] + movs r0, 0 + strb r0, [r1, 0x7] + bl sub_808C2D4 + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_0808C398: .4byte gUnknown_202EDC8 +_0808C39C: .4byte gUnknown_203B418 + thumb_func_end sub_808C360 + + thumb_func_start sub_808C3A0 +sub_808C3A0: + push {r4,lr} + bl sub_8085480 + adds r4, r0, 0 + bl sub_8083F14 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + ldr r0, _0808C3D4 + bl sub_80855E4 + movs r0, 0xCF + lsls r0, 1 + bl sub_808E734 + lsls r0, 24 + cmp r0, 0 + beq _0808C3DC + ldr r0, _0808C3D8 + bl sub_808563C + b _0808C3EA + .align 2, 0 +_0808C3D4: .4byte sub_8086A3C +_0808C3D8: .4byte sub_808C590 +_0808C3DC: + ldr r0, _0808C408 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x7] + ldr r0, _0808C40C + bl sub_808563C +_0808C3EA: + movs r1, 0x4 + ldrsh r0, [r4, r1] + movs r2, 0x6 + ldrsh r1, [r4, r2] + subs r1, 0x3 + bl sub_8085860 + ldr r0, _0808C410 + movs r1, 0xCF + lsls r1, 1 + bl sub_808D8BC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0808C408: .4byte gUnknown_203B418 +_0808C40C: .4byte sub_808C5A0 +_0808C410: .4byte gUnknown_202E038 + thumb_func_end sub_808C3A0 + + thumb_func_start sub_808C414 +sub_808C414: + push {lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x35 + bne _0808C434 + cmp r0, 0x1D + bne _0808C434 + ldr r0, _0808C438 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x2] + movs r0, 0x1A + bl sub_8083E88 +_0808C434: + pop {r0} + bx r0 + .align 2, 0 +_0808C438: .4byte gUnknown_203B418 + thumb_func_end sub_808C414 + + thumb_func_start sub_808C43C +sub_808C43C: + push {r4,lr} + bl sub_8085480 + adds r4, r0, 0 + bl sub_8086448 + movs r0, 0xCF + lsls r0, 1 + bl sub_808E734 + lsls r0, 24 + cmp r0, 0 + beq _0808C464 + ldr r0, _0808C460 + bl sub_80866C4 + b _0808C4A8 + .align 2, 0 +_0808C460: .4byte gUnknown_81063C4 +_0808C464: + ldr r0, _0808C4B0 + bl sub_8052910 + movs r0, 0x1A + movs r1, 0x3C + bl sub_8083EA8 + bl sub_808C550 + ldr r0, _0808C4B4 + bl sub_8052910 + bl sub_808C4C4 + ldr r0, _0808C4B8 + bl sub_8052910 + bl sub_808C4C4 + ldr r0, _0808C4BC + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808C4C0 + bl sub_808563C + adds r0, r4, 0 + adds r0, 0xC + movs r1, 0x10 + bl sub_80858AC +_0808C4A8: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0808C4B0: .4byte gUnknown_81062B4 +_0808C4B4: .4byte gUnknown_81062E8 +_0808C4B8: .4byte gUnknown_8106368 +_0808C4BC: .4byte gUnknown_8106390 +_0808C4C0: .4byte sub_808C5AC + thumb_func_end sub_808C43C + + thumb_func_start sub_808C4C4 +sub_808C4C4: + push {r4,r5,lr} + sub sp, 0x4 + ldr r0, _0808C54C + bl sub_8083E38 + movs r4, 0xFA + movs r5, 0x1 +_0808C4D2: + str r5, [sp] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0x95 + bgt _0808C4D2 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r4, 0xFA + movs r5, 0x1 +_0808C4F8: + str r5, [sp] + adds r0, r4, 0 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0xC7 + bgt _0808C4F8 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r4, 0xFA + movs r5, 0x1 +_0808C51E: + str r5, [sp] + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_8085C54 + movs r0, 0x46 + bl sub_803E46C + subs r4, 0xA + cmp r4, 0 + bge _0808C51E + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_8085EB0 + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808C54C: .4byte 0x000002c1 + thumb_func_end sub_808C4C4 + + thumb_func_start sub_808C550 +sub_808C550: + push {lr} + sub sp, 0x4 + ldr r1, _0808C588 + movs r0, 0x1F + str r0, [r1] + movs r0, 0x1 + str r0, [sp] + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0x1 + bl sub_8085C54 + bl sub_803E9D0 + movs r0, 0x46 + bl sub_803E46C + ldr r0, _0808C58C + ldr r1, [r0] + movs r0, 0 + strb r0, [r1, 0x7] + bl sub_808C4C4 + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_0808C588: .4byte gUnknown_202EDC8 +_0808C58C: .4byte gUnknown_203B418 + thumb_func_end sub_808C550 + + thumb_func_start sub_808C590 +sub_808C590: + push {lr} + movs r1, 0x87 + lsls r1, 2 + movs r2, 0 + bl sub_8068FE0 + pop {r0} + bx r0 + thumb_func_end sub_808C590 + + thumb_func_start sub_808C5A0 +sub_808C5A0: + push {lr} + movs r1, 0 + bl sub_8085918 + pop {r0} + bx r0 + thumb_func_end sub_808C5A0 + + thumb_func_start sub_808C5AC +sub_808C5AC: + push {lr} + ldr r1, _0808C5BC + movs r2, 0x20 + bl sub_8086A70 + pop {r0} + bx r0 + .align 2, 0 +_0808C5BC: .4byte 0x000003b6 + thumb_func_end sub_808C5AC + + thumb_func_start sub_808C5C0 +sub_808C5C0: + push {r4,r5,lr} + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0x1E + bl sub_8085680 + adds r4, r0, 0 + movs r0, 0x7F + bl sub_8083E88 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + adds r0, r4, 0 + movs r1, 0 + bl sub_8085918 + movs r1, 0x4 + ldrsh r0, [r5, r1] + movs r2, 0x6 + ldrsh r1, [r5, r2] + bl sub_8085860 + bl sub_803F994 + adds r4, r0, 0 + bl sub_803F9B0 + adds r1, r0, 0 + ldr r0, _0808C61C + adds r1, r0 + adds r0, r4, 0 + bl sub_803F878 + ldr r0, _0808C620 + movs r1, 0x8A + lsls r1, 1 + bl sub_808D8BC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808C61C: .4byte 0xfffff000 +_0808C620: .4byte gUnknown_202E038 + thumb_func_end sub_808C5C0 + + thumb_func_start nullsub_100 +nullsub_100: + bx lr + thumb_func_end nullsub_100 + + thumb_func_start sub_808C628 +sub_808C628: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + bl sub_8085480 + adds r7, r0, 0 + movs r0, 0x1E + bl sub_8085680 + str r0, [sp] + movs r0, 0x8A + lsls r0, 1 + bl sub_808E734 + lsls r0, 24 + cmp r0, 0 + bne _0808C658 + ldr r0, [sp] + bl sub_806FD18 + lsls r0, 24 + cmp r0, 0 + bne _0808C680 +_0808C658: + movs r1, 0x87 + lsls r1, 2 + ldr r0, [sp] + movs r2, 0 + bl sub_8068FE0 + adds r0, r7, 0 + bl sub_808696C + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808C67C + bl sub_8052910 + b _0808C8AC + .align 2, 0 +_0808C67C: .4byte gUnknown_810663C +_0808C680: + adds r0, r7, 0 + bl sub_808696C + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r7, 0 + bl sub_80862BC + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808C71C + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_8086598 + bl sub_8086598 + bl sub_8086598 + bl sub_8086598 + ldr r0, _0808C720 + bl sub_8052910 + ldr r4, _0808C724 + adds r0, r4, 0 + bl sub_8083E38 + ldr r0, [sp] + movs r1, 0xA + movs r2, 0 + bl sub_806CDD4 + movs r0, 0x14 + movs r1, 0x46 + bl sub_803E708 + ldr r0, [sp] + movs r1, 0 + bl sub_806CE68 + movs r0, 0x4 + movs r1, 0x46 + bl sub_803E708 + adds r0, r4, 0 + bl sub_8083E38 + ldr r0, [sp] + movs r1, 0xA + movs r2, 0 + bl sub_806CDD4 + ldr r0, _0808C728 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r0, 0 + mov r8, r4 + ldr r6, _0808C72C +_0808C70E: + cmp r0, 0 + beq _0808C730 + cmp r0, 0x1 + bne _0808C718 + b _0808C828 +_0808C718: + b _0808C8A6 + .align 2, 0 +_0808C71C: .4byte gUnknown_81063D0 +_0808C720: .4byte gUnknown_8106400 +_0808C724: .4byte 0x000001c7 +_0808C728: .4byte gUnknown_810643C +_0808C72C: .4byte 0x000001d5 +_0808C730: + ldr r5, _0808C75C +_0808C732: + movs r0, 0 + ldr r1, [r5] + ldr r2, _0808C760 + ldr r3, _0808C764 + bl sub_8052C68 + adds r4, r0, 0 + cmp r4, 0 + ble _0808C732 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + cmp r4, 0x1 + bne _0808C824 + bl sub_8083F14 + movs r0, 0xCC + bl sub_8083E38 + b _0808C76E + .align 2, 0 +_0808C75C: .4byte gUnknown_81065A8 +_0808C760: .4byte gUnknown_81065AC +_0808C764: .4byte 0x00000701 +_0808C768: + movs r0, 0x46 + bl sub_803E46C +_0808C76E: + movs r0, 0xCC + bl sub_8083E74 + lsls r0, 24 + cmp r0, 0 + bne _0808C768 + movs r0, 0x7F + bl sub_8083E88 + mov r0, r8 + bl sub_8083E38 + ldr r0, [sp] + movs r1, 0xD + movs r2, 0 + bl sub_80861D4 + movs r0, 0x37 + movs r1, 0x46 + bl sub_803E708 + adds r0, r6, 0 + bl sub_8083E38 + movs r0, 0x1A + movs r1, 0x46 + bl sub_803E708 + adds r0, r6, 0 + bl sub_8083E38 + movs r0, 0x1C + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808C818 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r1, [sp] + adds r0, r7, 0 + mov r2, sp + bl sub_806FDF4 + movs r0, 0x7F + bl sub_8083E88 + ldr r0, _0808C81C + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + mov r0, r8 + bl sub_8083E38 + ldr r0, [sp] + movs r1, 0xD + movs r2, 0 + bl sub_80861D4 + movs r0, 0x37 + movs r1, 0x46 + bl sub_803E708 + adds r0, r6, 0 + bl sub_8083E38 + movs r0, 0x1A + movs r1, 0x46 + bl sub_803E708 + adds r0, r6, 0 + bl sub_8083E38 + movs r0, 0x1B + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808C820 + b _0808C898 + .align 2, 0 +_0808C818: .4byte gUnknown_8106468 +_0808C81C: .4byte gUnknown_810648C +_0808C820: .4byte gUnknown_81064BC +_0808C824: + movs r0, 0x1 + b _0808C8A6 +_0808C828: + ldr r5, _0808C844 +_0808C82A: + movs r0, 0 + ldr r1, [r5] + ldr r2, _0808C848 + ldr r3, _0808C84C + bl sub_8052C68 + adds r4, r0, 0 + cmp r4, 0 + ble _0808C82A + cmp r4, 0x1 + bne _0808C850 + movs r0, 0 + b _0808C8A6 + .align 2, 0 +_0808C844: .4byte gUnknown_810660C +_0808C848: .4byte gUnknown_8106610 +_0808C84C: .4byte 0x00000701 +_0808C850: + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808C8D0 + bl sub_8052910 + ldr r1, [sp] + movs r0, 0x3E + movs r2, 0x1 + bl sub_80861F8 + movs r0, 0x18 + movs r1, 0x46 + bl sub_803E708 + ldr r1, [sp] + movs r0, 0x3E + movs r2, 0x1 + bl sub_80861F8 + movs r0, 0xE + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808C8D4 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, [sp] + bl sub_808C8E0 + ldr r0, _0808C8D8 +_0808C898: + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + movs r0, 0x2 +_0808C8A6: + cmp r0, 0x2 + beq _0808C8AC + b _0808C70E +_0808C8AC: + movs r0, 0x1E + bl sub_8083ED8 + movs r0, 0x1E + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808C8DC + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x2] + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0808C8D0: .4byte gUnknown_8106500 +_0808C8D4: .4byte gUnknown_8106534 +_0808C8D8: .4byte gUnknown_8106560 +_0808C8DC: .4byte gUnknown_203B418 + thumb_func_end sub_808C628 + + thumb_func_start sub_808C8E0 +sub_808C8E0: + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, _0808C934 + bl sub_8083E38 + adds r0, r5, 0 + movs r1, 0 + movs r2, 0 + bl sub_806CDD4 + movs r4, 0 +_0808C8F6: + ldr r0, [r5, 0x70] + movs r1, 0xBA + lsls r1, 1 + adds r0, r1 + lsls r1, r4, 8 + str r1, [r0] + movs r0, 0x46 + bl sub_803E46C + adds r4, 0x1 + cmp r4, 0xF + ble _0808C8F6 + movs r4, 0x10 +_0808C910: + ldr r0, [r5, 0x70] + movs r1, 0xBA + lsls r1, 1 + adds r0, r1 + lsls r1, r4, 8 + str r1, [r0] + movs r0, 0x46 + bl sub_803E46C + adds r4, 0x4 + cmp r4, 0xC7 + ble _0808C910 + adds r0, r5, 0 + bl sub_8086A3C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808C934: .4byte 0x000001a5 + thumb_func_end sub_808C8E0 + + thumb_func_start sub_808C938 +sub_808C938: + push {lr} + ldr r0, _0808C944 + bl sub_80855E4 + pop {r0} + bx r0 + .align 2, 0 +_0808C944: .4byte sub_808C9B0 + thumb_func_end sub_808C938 + + thumb_func_start sub_808C948 +sub_808C948: + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0x37 + bne _0808C98A + movs r5, 0 + movs r4, 0 + b _0808C95C +_0808C95A: + adds r4, 0x1 +_0808C95C: + cmp r4, 0xF + bgt _0808C97E + ldr r0, _0808C990 + ldr r0, [r0] + lsls r1, r4, 2 + ldr r2, _0808C994 + adds r0, r2 + adds r0, r1 + ldr r0, [r0] + cmp r0, r6 + beq _0808C95A + bl sub_80450E0 + lsls r0, 24 + cmp r0, 0 + beq _0808C95A + movs r5, 0x1 +_0808C97E: + cmp r5, 0 + bne _0808C98A + ldr r0, _0808C990 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x2] +_0808C98A: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0808C990: .4byte gUnknown_203B418 +_0808C994: .4byte 0x0001358c + thumb_func_end sub_808C948 + + thumb_func_start sub_808C998 +sub_808C998: + push {lr} + ldr r0, _0808C9AC + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + pop {r0} + bx r0 + .align 2, 0 +_0808C9AC: .4byte gUnknown_8106720 + thumb_func_end sub_808C998 + + thumb_func_start sub_808C9B0 +sub_808C9B0: + push {lr} + ldr r1, [r0, 0x70] + adds r1, 0x46 + movs r2, 0x4 + strb r2, [r1] + movs r1, 0x4 + bl sub_806CE68 + pop {r0} + bx r0 + thumb_func_end sub_808C9B0 + + thumb_func_start sub_808C9C4 +sub_808C9C4: + push {r4,r5,lr} + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0x7 + bl sub_8085680 + adds r4, r0, 0 + movs r0, 0x72 + bl sub_8083E88 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + ldr r0, _0808CA10 + bl sub_80855E4 + adds r0, r4, 0 + movs r1, 0 + bl sub_8085918 + movs r1, 0x4 + ldrsh r0, [r5, r1] + movs r2, 0x6 + ldrsh r1, [r5, r2] + subs r1, 0x3 + bl sub_8085860 + ldr r0, _0808CA14 + ldr r1, _0808CA18 + bl sub_808D8BC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808CA10: .4byte sub_8086A3C +_0808CA14: .4byte gUnknown_202E038 +_0808CA18: .4byte 0x0000014d + thumb_func_end sub_808C9C4 + + thumb_func_start sub_808CA1C +sub_808CA1C: + push {r4,r5,lr} + movs r0, 0x7 + bl sub_8085680 + adds r5, r0, 0 + bl sub_808696C + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808CB44 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r5, 0 + movs r1, 0x4 + movs r2, 0x2 + movs r3, 0x4 + bl sub_80869E4 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808CB48 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_8086448 + bl sub_8086598 + movs r0, 0x20 + movs r1, 0x46 + bl sub_803E708 + adds r0, r5, 0 + bl sub_80862BC + movs r0, 0x20 + movs r1, 0x46 + bl sub_803E708 + adds r0, r5, 0 + movs r1, 0x4 + movs r2, 0x2 + movs r3, 0 + bl sub_80869E4 + ldr r0, _0808CB4C + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r4, _0808CB50 + adds r0, r4, 0 + bl sub_8083E38 + adds r0, r5, 0 + movs r1, 0xA + movs r2, 0 + bl sub_806CDD4 + movs r0, 0x14 + movs r1, 0x46 + bl sub_803E708 + adds r0, r5, 0 + movs r1, 0 + bl sub_806CE68 + movs r0, 0x4 + movs r1, 0x46 + bl sub_803E708 + adds r0, r4, 0 + bl sub_8083E38 + adds r0, r5, 0 + movs r1, 0xA + movs r2, 0 + bl sub_806CDD4 + movs r0, 0x14 + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808CB54 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r5, 0 + movs r1, 0 + movs r2, 0 + bl sub_806CDD4 + movs r4, 0x17 +_0808CAF6: + adds r0, r5, 0 + movs r1, 0 + movs r2, 0x80 + lsls r2, 1 + bl sub_804539C + movs r0, 0x46 + bl sub_803E46C + subs r4, 0x1 + cmp r4, 0 + bge _0808CAF6 + adds r0, r5, 0 + movs r1, 0 + bl sub_806CE68 + movs r0, 0x20 + movs r1, 0x46 + bl sub_803E708 + adds r0, r5, 0 + bl sub_8042B0C + movs r1, 0x87 + lsls r1, 2 + adds r0, r5, 0 + movs r2, 0 + bl sub_8068FE0 + ldr r2, _0808CB58 + ldr r1, [r2] + movs r0, 0x1 + strb r0, [r1, 0x4] + ldr r1, [r2] + movs r0, 0x4 + strb r0, [r1, 0x11] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808CB44: .4byte gUnknown_8106778 +_0808CB48: .4byte gUnknown_81067BC +_0808CB4C: .4byte gUnknown_81067E0 +_0808CB50: .4byte 0x000001c7 +_0808CB54: .4byte gUnknown_8106834 +_0808CB58: .4byte gUnknown_203B418 + thumb_func_end sub_808CA1C + + thumb_func_start sub_808CB5C +sub_808CB5C: + push {r4,r5,lr} + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0x7 + bl sub_8085680 + adds r4, r0, 0 + movs r0, 0x72 + bl sub_8083E88 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + movs r1, 0x87 + lsls r1, 2 + adds r0, r4, 0 + movs r2, 0 + bl sub_8068FE0 + movs r1, 0x4 + ldrsh r0, [r5, r1] + movs r2, 0x6 + ldrsh r1, [r5, r2] + bl sub_8085860 + ldr r0, _0808CBA4 + ldr r1, _0808CBA8 + bl sub_808D8BC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808CBA4: .4byte gUnknown_202E038 +_0808CBA8: .4byte 0x0000014d + thumb_func_end sub_808CB5C + + thumb_func_start nullsub_101 +nullsub_101: + bx lr + thumb_func_end nullsub_101 + + thumb_func_start sub_808CBB0 +sub_808CBB0: + push {r4,r5,lr} + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0x1F + bl sub_8085680 + adds r4, r0, 0 + movs r0, 0x72 + bl sub_8083E88 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + ldr r0, _0808CBFC + bl sub_80855E4 + adds r0, r4, 0 + movs r1, 0 + bl sub_8085918 + movs r1, 0x4 + ldrsh r0, [r5, r1] + movs r2, 0x6 + ldrsh r1, [r5, r2] + subs r1, 0x3 + bl sub_8085860 + ldr r0, _0808CC00 + movs r1, 0x82 + lsls r1, 1 + bl sub_808D8BC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808CBFC: .4byte sub_8086A3C +_0808CC00: .4byte gUnknown_202E038 + thumb_func_end sub_808CBB0 + + thumb_func_start sub_808CC04 +sub_808CC04: + push {r4,r5,lr} + movs r0, 0x1F + bl sub_8085680 + adds r5, r0, 0 + bl sub_808696C + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808CD2C + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r5, 0 + movs r1, 0x4 + movs r2, 0x2 + movs r3, 0x4 + bl sub_80869E4 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808CD30 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + bl sub_8086448 + bl sub_8086598 + movs r0, 0x20 + movs r1, 0x46 + bl sub_803E708 + adds r0, r5, 0 + bl sub_80862BC + movs r0, 0x20 + movs r1, 0x46 + bl sub_803E708 + adds r0, r5, 0 + movs r1, 0x4 + movs r2, 0x2 + movs r3, 0 + bl sub_80869E4 + ldr r0, _0808CD34 + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + ldr r4, _0808CD38 + adds r0, r4, 0 + bl sub_8083E38 + adds r0, r5, 0 + movs r1, 0xA + movs r2, 0 + bl sub_806CDD4 + movs r0, 0x14 + movs r1, 0x46 + bl sub_803E708 + adds r0, r5, 0 + movs r1, 0 + bl sub_806CE68 + movs r0, 0x4 + movs r1, 0x46 + bl sub_803E708 + adds r0, r4, 0 + bl sub_8083E38 + adds r0, r5, 0 + movs r1, 0xA + movs r2, 0 + bl sub_806CDD4 + movs r0, 0x14 + movs r1, 0x46 + bl sub_803E708 + ldr r0, _0808CD3C + bl sub_8052910 + movs r0, 0xA + movs r1, 0x46 + bl sub_803E708 + adds r0, r5, 0 + movs r1, 0 + movs r2, 0 + bl sub_806CDD4 + movs r4, 0x17 +_0808CCDE: + adds r0, r5, 0 + movs r1, 0 + movs r2, 0x80 + lsls r2, 1 + bl sub_804539C + movs r0, 0x46 + bl sub_803E46C + subs r4, 0x1 + cmp r4, 0 + bge _0808CCDE + adds r0, r5, 0 + movs r1, 0 + bl sub_806CE68 + movs r0, 0x20 + movs r1, 0x46 + bl sub_803E708 + adds r0, r5, 0 + bl sub_8042B0C + movs r1, 0x87 + lsls r1, 2 + adds r0, r5, 0 + movs r2, 0 + bl sub_8068FE0 + ldr r2, _0808CD40 + ldr r1, [r2] + movs r0, 0x1 + strb r0, [r1, 0x4] + ldr r1, [r2] + movs r0, 0x4 + strb r0, [r1, 0x11] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808CD2C: .4byte gUnknown_810688C +_0808CD30: .4byte gUnknown_81068D0 +_0808CD34: .4byte gUnknown_8106918 +_0808CD38: .4byte 0x000001c7 +_0808CD3C: .4byte gUnknown_8106934 +_0808CD40: .4byte gUnknown_203B418 + thumb_func_end sub_808CC04 + + thumb_func_start sub_808CD44 +sub_808CD44: + push {r4,r5,lr} + bl sub_8085480 + adds r5, r0, 0 + movs r0, 0x1F + bl sub_8085680 + adds r4, r0, 0 + movs r0, 0x72 + bl sub_8083E88 + bl sub_80854D4 + movs r0, 0x4 + bl sub_8085930 + ldr r0, _0808CD94 + bl sub_80855E4 + movs r1, 0x87 + lsls r1, 2 + adds r0, r4, 0 + movs r2, 0 + bl sub_8068FE0 + movs r1, 0x4 + ldrsh r0, [r5, r1] + movs r2, 0x6 + ldrsh r1, [r5, r2] + subs r1, 0x3 + bl sub_8085860 + ldr r0, _0808CD98 + movs r1, 0x82 + lsls r1, 1 + bl sub_808D8BC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808CD94: .4byte sub_8086A3C +_0808CD98: .4byte gUnknown_202E038 + thumb_func_end sub_808CD44 + + thumb_func_start sub_808CD9C +sub_808CD9C: + push {lr} + bl sub_8086448 + ldr r0, _0808CDAC + bl sub_80866C4 + pop {r0} + bx r0 + .align 2, 0 +_0808CDAC: .4byte gUnknown_810697C + thumb_func_end sub_808CD9C + + thumb_func_start sub_808CDB0 +sub_808CDB0: + lsls r0, 24 + lsrs r0, 21 + ldr r1, _0808CDBC + adds r0, r1 + bx lr + .align 2, 0 +_0808CDBC: .4byte gUnknown_8107544 + thumb_func_end sub_808CDB0 + + thumb_func_start sub_808CDC0 +sub_808CDC0: + push {lr} + ldr r1, _0808CDE4 + ldr r0, _0808CDE8 + str r0, [r1] + ldr r0, _0808CDEC + ldr r1, _0808CDF0 + bl sub_800A9EC + ldr r1, _0808CDF4 + str r0, [r1] + ldr r1, _0808CDF8 + ldr r0, [r0, 0x4] + str r0, [r1] + ldr r1, _0808CDFC + movs r0, 0 + strh r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_0808CDE4: .4byte gUnknown_203B45C +_0808CDE8: .4byte gUnknown_202F400 +_0808CDEC: .4byte gUnknown_81075F4 +_0808CDF0: .4byte gUnknown_8300500 +_0808CDF4: .4byte gUnknown_202F3E4 +_0808CDF8: .4byte gUnknown_202F3E0 +_0808CDFC: .4byte gUnknown_20384E8 + thumb_func_end sub_808CDC0 + + thumb_func_start sub_808CE00 +sub_808CE00: + ldr r0, _0808CE04 + bx lr + .align 2, 0 +_0808CE04: .4byte gUnknown_202F400 + thumb_func_end sub_808CE00 + + thumb_func_start sub_808CE08 +sub_808CE08: + push {r4-r7,lr} + ldr r4, _0808CE60 + movs r3, 0 + movs r1, 0 + ldr r2, _0808CE64 +_0808CE12: + ldr r0, [r4] + adds r0, r1 + strh r3, [r0] + adds r1, 0x58 + subs r2, 0x1 + cmp r2, 0 + bne _0808CE12 + ldr r5, _0808CE60 + ldr r4, _0808CE68 + movs r3, 0 + movs r1, 0 + movs r2, 0x3 +_0808CE2A: + ldr r0, [r5] + adds r0, r1 + adds r0, r4 + strh r3, [r0] + adds r1, 0x64 + subs r2, 0x1 + cmp r2, 0 + bge _0808CE2A + ldr r7, _0808CE60 + ldr r6, _0808CE6C + movs r4, 0 + movs r3, 0 + ldr r5, _0808CE70 + movs r2, 0x3 +_0808CE46: + ldr r0, [r7] + adds r0, r3 + adds r1, r0, r6 + strh r4, [r1] + adds r0, r5 + strh r4, [r0] + adds r3, 0x58 + subs r2, 0x1 + cmp r2, 0 + bge _0808CE46 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0808CE60: .4byte gUnknown_203B45C +_0808CE64: .4byte 0x0000019d +_0808CE68: .4byte 0x00008df8 +_0808CE6C: .4byte 0x00008f90 +_0808CE70: .4byte 0x00008f88 + thumb_func_end sub_808CE08 + + thumb_func_start sub_808CE74 +sub_808CE74: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x6C + mov r8, r2 + lsls r0, 16 + asrs r7, r0, 16 + lsls r1, 24 + mov r2, sp + movs r0, 0x3 + strh r0, [r2] + cmp r1, 0 + beq _0808CE9C + mov r1, sp + movs r0, 0x1 + strb r0, [r1, 0x2] + movs r0, 0x40 + b _0808CEA4 +_0808CE9C: + mov r1, sp + movs r0, 0 + strb r0, [r1, 0x2] + movs r0, 0x41 +_0808CEA4: + strb r0, [r1, 0x4] + mov r0, sp + movs r6, 0 + movs r5, 0x1 + strb r5, [r0, 0x3] + adds r0, r7, 0 + bl sub_808DBC0 + mov r1, sp + movs r4, 0 + strh r0, [r1, 0x16] + adds r0, r7, 0 + movs r1, 0 + bl sub_808DC28 + mov r1, sp + strb r0, [r1, 0x18] + adds r0, r7, 0 + movs r1, 0x1 + bl sub_808DC28 + mov r1, sp + strb r0, [r1, 0x19] + adds r0, r7, 0 + movs r1, 0 + bl sub_808DC48 + mov r1, sp + strb r0, [r1, 0x1A] + adds r0, r7, 0 + movs r1, 0x1 + bl sub_808DC48 + mov r1, sp + strb r0, [r1, 0x1B] + mov r0, sp + strh r5, [r0, 0x14] + strb r4, [r0, 0xC] + strb r4, [r0, 0x10] + add r0, sp, 0x20 + movs r1, 0 + bl sub_808EC94 + mov r0, sp + strh r7, [r0, 0x8] + add r0, sp, 0x28 + strb r4, [r0] + adds r0, 0x1 + strb r4, [r0] + str r6, [sp, 0x1C] + add r0, sp, 0x24 + strb r4, [r0] + mov r0, sp + strb r4, [r0, 0x5] + add r0, sp, 0x2C + adds r1, r7, 0 + bl sub_808E490 + mov r0, r8 + cmp r0, 0 + bne _0808CF5C + add r4, sp, 0x58 + adds r0, r4, 0 + adds r1, r7, 0 + bl sub_808D8BC + add r0, sp, 0x4C + adds r1, r4, 0 + movs r2, 0xA + bl sub_8092310 + lsls r4, r7, 3 + b _0808CF72 +_0808CF36: + mov r1, r8 + ldr r0, [r1] + adds r0, r6 + mov r1, sp + movs r2, 0x58 + bl memcpy + ldr r0, _0808CF58 + ldr r0, [r0] + adds r0, r4 + mov r5, r9 + strb r5, [r0] + adds r0, r7, 0 + bl sub_80980B4 + b _0808CFB8 + .align 2, 0 +_0808CF58: .4byte gUnknown_203B468 +_0808CF5C: + movs r2, 0 + lsls r4, r7, 3 + add r3, sp, 0x4C +_0808CF62: + adds r0, r3, r2 + mov r5, r8 + adds r1, r5, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x9 + ble _0808CF62 +_0808CF72: + ldr r0, _0808CFC8 + ldr r1, [r0] + adds r0, r4, r7 + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0, 0x16] + mov r10, r0 + movs r5, 0 + ldr r0, _0808CFCC + mov r8, r0 + movs r1, 0x1 + mov r9, r1 +_0808CF8A: + movs r0, 0x58 + adds r6, r5, 0 + muls r6, r0 + mov r1, r8 + ldr r0, [r1] + adds r0, r6, r0 + ldrb r1, [r0] + mov r0, r9 + ands r0, r1 + cmp r0, 0 + bne _0808CFAE + adds r0, r5, 0 + bl sub_80923D4 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, r10 + beq _0808CF36 +_0808CFAE: + adds r5, 0x1 + movs r0, 0xCE + lsls r0, 1 + cmp r5, r0 + ble _0808CF8A +_0808CFB8: + add sp, 0x6C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0808CFC8: .4byte gUnknown_202F3E0 +_0808CFCC: .4byte gUnknown_203B45C + thumb_func_end sub_808CE74 + + thumb_func_start sub_808CFD0 +sub_808CFD0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + adds r7, r0, 0 + mov r10, r2 + adds r4, r3, 0 + lsls r1, 16 + asrs r1, 16 + mov r9, r1 + lsls r4, 24 + lsrs r4, 24 + movs r5, 0 + movs r0, 0 + mov r8, r0 + movs r0, 0x1 + movs r6, 0x1 + strh r6, [r7] + strb r5, [r7, 0x2] + strb r0, [r7, 0x3] + mov r0, r9 + bl sub_808DBC0 + strh r0, [r7, 0x16] + mov r0, r9 + movs r1, 0 + bl sub_808DC28 + strb r0, [r7, 0x18] + mov r0, r9 + movs r1, 0x1 + bl sub_808DC28 + strb r0, [r7, 0x19] + mov r0, r9 + movs r1, 0 + bl sub_808DC48 + strb r0, [r7, 0x1A] + mov r0, r9 + movs r1, 0x1 + bl sub_808DC48 + strb r0, [r7, 0x1B] + mov r1, r9 + strh r1, [r7, 0x8] + adds r0, r7, 0 + adds r0, 0x28 + adds r1, r4, 0 + bl sub_8090B08 + mov r4, r8 + str r4, [r7, 0x1C] + adds r0, r7, 0 + adds r0, 0x24 + strb r5, [r0] + strh r6, [r7, 0x14] + ldr r1, [sp, 0x34] + ldr r0, [r1] + str r0, [r7, 0x4] + strb r5, [r7, 0xC] + strb r5, [r7, 0x10] + adds r0, r7, 0 + adds r0, 0x20 + movs r1, 0 + bl sub_808EC94 + ldr r4, [sp, 0x38] + cmp r4, 0 + beq _0808D08C + movs r0, 0x4C + adds r0, r7 + mov r8, r0 + adds r5, r4, 0 + adds r4, r7, 0 + adds r4, 0x2C + movs r6, 0x3 +_0808D06E: + ldrh r0, [r5] + cmp r0, 0 + beq _0808D07E + adds r1, r0, 0 + adds r0, r4, 0 + bl sub_8092AD4 + b _0808D080 +_0808D07E: + strb r0, [r4] +_0808D080: + adds r5, 0x2 + adds r4, 0x8 + subs r6, 0x1 + cmp r6, 0 + bge _0808D06E + b _0808D09A +_0808D08C: + adds r0, r7, 0 + adds r0, 0x2C + mov r1, r9 + bl sub_808E490 + adds r7, 0x4C + mov r8, r7 +_0808D09A: + mov r1, r10 + cmp r1, 0 + bne _0808D0B4 + mov r0, sp + mov r1, r9 + bl sub_808D8BC + mov r0, r8 + mov r1, sp + movs r2, 0xA + bl sub_8092310 + b _0808D0C8 +_0808D0B4: + movs r2, 0 + mov r3, r8 +_0808D0B8: + adds r0, r3, r2 + mov r4, r10 + adds r1, r4, r2 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x9 + ble _0808D0B8 +_0808D0C8: + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_808CFD0 + + thumb_func_start sub_808D0D8 +sub_808D0D8: + push {r4-r7,lr} + adds r7, r0, 0 + movs r6, 0 + movs r4, 0x1 + strb r4, [r7, 0x3] + movs r1, 0x8 + ldrsh r0, [r7, r1] + bl sub_808DBC0 + movs r5, 0 + strh r0, [r7, 0x16] + movs r2, 0x8 + ldrsh r0, [r7, r2] + movs r1, 0 + bl sub_808DC28 + strb r0, [r7, 0x18] + movs r1, 0x8 + ldrsh r0, [r7, r1] + movs r1, 0x1 + bl sub_808DC28 + strb r0, [r7, 0x19] + movs r2, 0x8 + ldrsh r0, [r7, r2] + movs r1, 0 + bl sub_808DC48 + strb r0, [r7, 0x1A] + movs r1, 0x8 + ldrsh r0, [r7, r1] + movs r1, 0x1 + bl sub_808DC48 + strb r0, [r7, 0x1B] + str r6, [r7, 0x1C] + adds r0, r7, 0 + adds r0, 0x24 + strb r5, [r0] + strh r4, [r7, 0x14] + subs r0, 0x4 + movs r1, 0 + bl sub_808EC94 + adds r0, r7, 0 + adds r0, 0x2C + movs r2, 0x8 + ldrsh r1, [r7, r2] + bl sub_808E490 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_808D0D8 + + thumb_func_start sub_808D144 +sub_808D144: + push {r4-r7,lr} + adds r5, r0, 0 + adds r7, r1, 0 + movs r4, 0 + movs r0, 0x1 + strh r0, [r5] + strb r4, [r5, 0x2] + ldrh r0, [r7, 0x16] + strb r0, [r5, 0x3] + ldrh r0, [r7, 0x14] + strh r0, [r5, 0x16] + ldrh r0, [r7, 0x1A] + strb r0, [r5, 0x18] + ldrh r0, [r7, 0x1C] + strb r0, [r5, 0x19] + ldrh r0, [r7, 0x1E] + strb r0, [r5, 0x1A] + ldrh r0, [r7, 0x20] + strb r0, [r5, 0x1B] + ldrh r0, [r7, 0x4] + strh r0, [r5, 0x8] + adds r0, r5, 0 + adds r0, 0x28 + ldrb r1, [r7, 0x6] + bl sub_8090B08 + ldr r0, [r7, 0x24] + str r0, [r5, 0x1C] + adds r0, r5, 0 + adds r0, 0x24 + strb r4, [r0] + ldrh r0, [r7, 0x18] + strh r0, [r5, 0x14] + ldr r0, [r7, 0x8] + str r0, [r5, 0x4] + strb r4, [r5, 0xC] + strb r4, [r5, 0x10] + adds r0, r5, 0 + adds r0, 0x20 + movs r1, 0 + bl sub_808EC94 + movs r6, 0 + adds r4, r5, 0 + adds r4, 0x2C +_0808D19E: + lsls r1, r6, 1 + adds r0, r7, 0 + adds r0, 0xC + adds r0, r1 + ldrh r1, [r0] + cmp r1, 0 + beq _0808D1B4 + adds r0, r4, 0 + bl sub_8092AD4 + b _0808D1B6 +_0808D1B4: + strb r1, [r4] +_0808D1B6: + adds r4, 0x8 + adds r6, 0x1 + cmp r6, 0x3 + ble _0808D19E + movs r6, 0 + adds r3, r5, 0 + adds r3, 0x4C + ldr r2, [r7] +_0808D1C6: + adds r0, r3, r6 + adds r1, r2, r6 + ldrb r1, [r1] + strb r1, [r0] + adds r6, 0x1 + cmp r6, 0x9 + ble _0808D1C6 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_808D144 + + thumb_func_start sub_808D1DC +sub_808D1DC: + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r0 + movs r2, 0x8 + ldrsh r1, [r0, r2] + ldr r0, _0808D204 + ldr r2, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 3 + adds r0, r2 + ldrb r6, [r0, 0x16] + ldr r0, _0808D208 + ldr r0, [r0] + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0 + bne _0808D238 + b _0808D268 + .align 2, 0 +_0808D204: .4byte gUnknown_202F3E0 +_0808D208: .4byte gUnknown_203B468 +_0808D20C: + ldr r0, [r7] + adds r0, r5 + mov r1, r8 + movs r2, 0x58 + bl memcpy + ldr r1, [r7] + adds r1, r5 + ldrh r2, [r1] + ldr r0, _0808D234 + ands r0, r2 + strh r0, [r1] + mov r1, r8 + movs r2, 0x8 + ldrsh r0, [r1, r2] + bl sub_80980B4 + ldr r0, [r7] + adds r0, r5 + b _0808D26A + .align 2, 0 +_0808D234: .4byte 0x0000bfff +_0808D238: + movs r4, 0 + ldr r7, _0808D274 +_0808D23C: + movs r0, 0x58 + adds r5, r4, 0 + muls r5, r0 + ldr r0, [r7] + adds r0, r5, r0 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0808D25E + adds r0, r4, 0 + bl sub_80923D4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, r6 + beq _0808D20C +_0808D25E: + adds r4, 0x1 + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + ble _0808D23C +_0808D268: + movs r0, 0 +_0808D26A: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0808D274: .4byte gUnknown_203B45C + thumb_func_end sub_808D1DC + + thumb_func_start sub_808D278 +sub_808D278: + push {r4-r7,lr} + lsls r0, 16 + asrs r0, 16 + ldr r1, _0808D29C + ldr r2, [r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrb r6, [r1, 0x16] + ldr r0, _0808D2A0 + ldr r0, [r0] + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0 + bne _0808D2AA + b _0808D2DA + .align 2, 0 +_0808D29C: .4byte gUnknown_202F3E0 +_0808D2A0: .4byte gUnknown_203B468 +_0808D2A4: + ldr r0, [r7] + adds r0, r5 + b _0808D2DC +_0808D2AA: + movs r4, 0 + ldr r7, _0808D2E4 +_0808D2AE: + movs r0, 0x58 + adds r5, r4, 0 + muls r5, r0 + ldr r0, [r7] + adds r0, r5, r0 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0808D2D0 + adds r0, r4, 0 + bl sub_80923D4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, r6 + beq _0808D2A4 +_0808D2D0: + adds r4, 0x1 + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + ble _0808D2AE +_0808D2DA: + movs r0, 0 +_0808D2DC: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0808D2E4: .4byte gUnknown_203B45C + thumb_func_end sub_808D278 + + thumb_func_start sub_808D2E8 +sub_808D2E8: + push {r4-r6,lr} + sub sp, 0x60 + adds r4, r0, 0 + adds r6, r1, 0 + adds r5, r2, 0 + ldr r0, [sp, 0x70] + lsls r4, 16 + asrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + str r3, [sp] + str r0, [sp, 0x4] + add r0, sp, 0x8 + adds r1, r4, 0 + adds r2, r6, 0 + adds r3, r5, 0 + bl sub_808CFD0 + add r0, sp, 0x8 + bl sub_808D1DC + add sp, 0x60 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_808D2E8 + + thumb_func_start sub_808D31C +sub_808D31C: + push {lr} + adds r1, r0, 0 + ldrb r0, [r1, 0x2] + cmp r0, 0 + bne _0808D338 + movs r2, 0 + ldrb r0, [r1, 0x4] + cmp r0, 0x41 + bne _0808D330 + movs r2, 0x1 +_0808D330: + adds r0, r2, 0 + cmp r0, 0 + bne _0808D338 + strh r0, [r1] +_0808D338: + pop {r0} + bx r0 + thumb_func_end sub_808D31C + + thumb_func_start sub_808D33C +sub_808D33C: + push {r4,lr} + movs r3, 0 + ldr r0, _0808D360 + ldr r4, [r0] +_0808D344: + movs r0, 0x58 + muls r0, r3 + adds r2, r0, r4 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0808D364 + ldrb r0, [r2, 0x2] + cmp r0, 0 + beq _0808D364 + adds r0, r2, 0 + b _0808D370 + .align 2, 0 +_0808D360: .4byte gUnknown_203B45C +_0808D364: + adds r3, 0x1 + movs r0, 0xCE + lsls r0, 1 + cmp r3, r0 + ble _0808D344 + movs r0, 0 +_0808D370: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_808D33C + + thumb_func_start sub_808D378 +sub_808D378: + push {r4,lr} + movs r3, 0 + ldr r0, _0808D3A4 + ldr r4, [r0] +_0808D380: + movs r0, 0x58 + muls r0, r3 + adds r2, r0, r4 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0808D3A8 + movs r1, 0 + ldrb r0, [r2, 0x4] + cmp r0, 0x41 + bne _0808D39A + movs r1, 0x1 +_0808D39A: + cmp r1, 0 + beq _0808D3A8 + adds r0, r2, 0 + b _0808D3B4 + .align 2, 0 +_0808D3A4: .4byte gUnknown_203B45C +_0808D3A8: + adds r3, 0x1 + movs r0, 0xCE + lsls r0, 1 + cmp r3, r0 + ble _0808D380 + movs r0, 0 +_0808D3B4: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_808D378 + + thumb_func_start sub_808D3BC +sub_808D3BC: + push {r4-r6,lr} + movs r4, 0 + ldr r0, _0808D3E0 + ldr r2, [r0] + adds r3, r2, 0 + movs r6, 0x1 + movs r5, 0xCE + lsls r5, 1 +_0808D3CC: + ldrb r1, [r2] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _0808D3E4 + ldrb r0, [r2, 0x4] + cmp r0, 0x40 + bne _0808D3E4 + adds r0, r3, 0 + b _0808D3F0 + .align 2, 0 +_0808D3E0: .4byte gUnknown_203B45C +_0808D3E4: + adds r2, 0x58 + adds r3, 0x58 + adds r4, 0x1 + cmp r4, r5 + ble _0808D3CC + movs r0, 0 +_0808D3F0: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_808D3BC + + thumb_func_start sub_808D3F8 +sub_808D3F8: + push {r4-r6,lr} + movs r4, 0 + ldr r0, _0808D41C + ldr r2, [r0] + adds r3, r2, 0 + movs r6, 0x1 + movs r5, 0xCE + lsls r5, 1 +_0808D408: + ldrb r1, [r2] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _0808D420 + ldrb r0, [r2, 0x4] + cmp r0, 0x41 + bne _0808D420 + adds r0, r3, 0 + b _0808D42C + .align 2, 0 +_0808D41C: .4byte gUnknown_203B45C +_0808D420: + adds r2, 0x58 + adds r3, 0x58 + adds r4, 0x1 + cmp r4, r5 + ble _0808D408 + movs r0, 0 +_0808D42C: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_808D3F8 + + thumb_func_start sub_808D434 +sub_808D434: + push {r4-r7,lr} + adds r6, r1, 0 + lsls r0, 16 + asrs r5, r0, 16 + ldr r0, _0808D468 + ldr r2, [r0] + movs r4, 0 + movs r3, 0 + movs r0, 0x1 + mov r12, r0 + movs r7, 0xCE + lsls r7, 1 +_0808D44C: + ldrb r1, [r2] + mov r0, r12 + ands r0, r1 + cmp r0, 0 + beq _0808D46E + movs r1, 0x8 + ldrsh r0, [r2, r1] + cmp r0, r5 + bne _0808D46E + cmp r4, r6 + bne _0808D46C + adds r0, r2, 0 + b _0808D478 + .align 2, 0 +_0808D468: .4byte gUnknown_203B45C +_0808D46C: + adds r4, 0x1 +_0808D46E: + adds r3, 0x1 + adds r2, 0x58 + cmp r3, r7 + ble _0808D44C + movs r0, 0 +_0808D478: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_808D434 + + thumb_func_start sub_808D480 +sub_808D480: + push {r4,r5,lr} + ldr r0, _0808D4A8 + ldr r2, [r0] + movs r4, 0 + movs r5, 0x1 + ldr r3, _0808D4AC +_0808D48C: + ldrb r1, [r2] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _0808D498 + adds r4, 0x1 +_0808D498: + subs r3, 0x1 + adds r2, 0x58 + cmp r3, 0 + bne _0808D48C + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0808D4A8: .4byte gUnknown_203B45C +_0808D4AC: .4byte 0x0000019d + thumb_func_end sub_808D480 + + thumb_func_start sub_808D4B0 +sub_808D4B0: + push {r4-r6,lr} + ldr r0, _0808D4F8 + ldr r2, [r0] + movs r5, 0 + movs r4, 0 + ldr r6, _0808D4FC +_0808D4BC: + ldrh r3, [r2] + lsrs r0, r3, 1 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0808D4E4 + ldrb r0, [r2, 0x2] + cmp r0, 0 + bne _0808D4E4 + movs r1, 0 + ldrb r0, [r2, 0x4] + cmp r0, 0x41 + bne _0808D4D8 + movs r1, 0x1 +_0808D4D8: + cmp r1, 0 + bne _0808D4E4 + movs r5, 0x1 + adds r0, r6, 0 + ands r0, r3 + strh r0, [r2] +_0808D4E4: + adds r4, 0x1 + adds r2, 0x58 + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + ble _0808D4BC + adds r0, r5, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0808D4F8: .4byte gUnknown_203B45C +_0808D4FC: .4byte 0x0000fffd + thumb_func_end sub_808D4B0 + + thumb_func_start sub_808D500 +sub_808D500: + push {r4-r6,lr} + ldr r0, _0808D53C + ldr r2, [r0] + movs r5, 0 + movs r4, 0 + ldr r6, _0808D540 +_0808D50C: + ldrh r3, [r2] + lsrs r0, r3, 1 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0808D526 + ldrb r0, [r2, 0x2] + cmp r0, 0 + bne _0808D526 + movs r5, 0x1 + adds r0, r6, 0 + ands r0, r3 + strh r0, [r2] +_0808D526: + adds r4, 0x1 + adds r2, 0x58 + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + ble _0808D50C + adds r0, r5, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0808D53C: .4byte gUnknown_203B45C +_0808D540: .4byte 0x0000fffd + thumb_func_end sub_808D500 + + thumb_func_start sub_808D544 +sub_808D544: + push {r4-r7,lr} + adds r4, r0, 0 + ldr r0, _0808D57C + ldr r3, [r0] + movs r5, 0 + movs r2, 0 + movs r7, 0x1 + movs r6, 0xCE + lsls r6, 1 + adds r1, r4, 0 +_0808D558: + ldrh r0, [r3] + lsrs r0, 1 + ands r0, r7 + cmp r0, 0 + beq _0808D56C + cmp r4, 0 + beq _0808D568 + str r2, [r1] +_0808D568: + adds r1, 0x4 + adds r5, 0x1 +_0808D56C: + adds r2, 0x1 + adds r3, 0x58 + cmp r2, r6 + ble _0808D558 + adds r0, r5, 0 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0808D57C: .4byte gUnknown_203B45C + thumb_func_end sub_808D544 + + thumb_func_start sub_808D580 +sub_808D580: + push {r4-r7,lr} + adds r6, r0, 0 + ldr r0, _0808D5AC + ldr r2, [r0] + movs r5, 0 + movs r4, 0 + mov r12, r0 + adds r3, r6, 0 +_0808D590: + ldrb r0, [r2, 0x2] + cmp r0, 0 + beq _0808D5B0 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0808D5B0 + cmp r6, 0 + beq _0808D5B0 + str r4, [r3] + adds r5, 0x1 + b _0808D5BC + .align 2, 0 +_0808D5AC: .4byte gUnknown_203B45C +_0808D5B0: + adds r4, 0x1 + adds r2, 0x58 + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + ble _0808D590 +_0808D5BC: + mov r0, r12 + ldr r2, [r0] + movs r4, 0 + lsls r0, r5, 2 + adds r7, r0, r6 +_0808D5C6: + movs r1, 0 + ldrb r0, [r2, 0x4] + cmp r0, 0x41 + bne _0808D5D0 + movs r1, 0x1 +_0808D5D0: + cmp r1, 0 + beq _0808D5F8 + ldrb r0, [r2, 0x2] + cmp r0, 0 + bne _0808D5F8 + ldrh r1, [r2] + lsrs r0, r1, 1 + movs r3, 0x1 + ands r0, r3 + cmp r0, 0 + beq _0808D5F8 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _0808D5F8 + cmp r6, 0 + beq _0808D5F8 + str r4, [r7] + adds r5, 0x1 + b _0808D604 +_0808D5F8: + adds r4, 0x1 + adds r2, 0x58 + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + ble _0808D5C6 +_0808D604: + mov r0, r12 + ldr r2, [r0] + movs r4, 0 + movs r3, 0x1 + lsls r0, r5, 2 + adds r7, r0, r6 +_0808D610: + ldrh r1, [r2] + lsrs r0, r1, 1 + ands r0, r3 + cmp r0, 0 + beq _0808D63E + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _0808D63E + ldrb r0, [r2, 0x2] + cmp r0, 0 + bne _0808D63E + movs r1, 0 + ldrb r0, [r2, 0x4] + cmp r0, 0x41 + bne _0808D632 + movs r1, 0x1 +_0808D632: + cmp r1, 0 + bne _0808D63E + cmp r6, 0 + beq _0808D63E + stm r7!, {r4} + adds r5, 0x1 +_0808D63E: + adds r4, 0x1 + adds r2, 0x58 + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + ble _0808D610 + adds r0, r5, 0 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_808D580 + + thumb_func_start sub_808D654 +sub_808D654: + push {r4-r6,lr} + adds r5, r0, 0 + ldr r0, _0808D6A0 + ldr r2, [r0] + movs r6, 0 + movs r4, 0 + adds r3, r5, 0 +_0808D662: + ldrh r0, [r2] + lsrs r0, 1 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0808D68C + ldrb r0, [r2, 0x2] + cmp r0, 0 + bne _0808D68C + movs r1, 0 + ldrb r0, [r2, 0x4] + cmp r0, 0x41 + bne _0808D67E + movs r1, 0x1 +_0808D67E: + cmp r1, 0 + bne _0808D68C + cmp r5, 0 + beq _0808D688 + str r4, [r3] +_0808D688: + adds r3, 0x4 + adds r6, 0x1 +_0808D68C: + adds r4, 0x1 + adds r2, 0x58 + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + ble _0808D662 + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0808D6A0: .4byte gUnknown_203B45C + thumb_func_end sub_808D654 + + thumb_func_start sub_808D6A4 +sub_808D6A4: + push {r4-r6,lr} + adds r5, r0, 0 + ldr r0, _0808D6E4 + ldr r2, [r0] + movs r6, 0 + movs r4, 0 + adds r3, r5, 0 +_0808D6B2: + ldrh r0, [r2] + lsrs r0, 1 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0808D6CE + ldrb r0, [r2, 0x2] + cmp r0, 0 + bne _0808D6CE + cmp r5, 0 + beq _0808D6CA + str r4, [r3] +_0808D6CA: + adds r3, 0x4 + adds r6, 0x1 +_0808D6CE: + adds r4, 0x1 + adds r2, 0x58 + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + ble _0808D6B2 + adds r0, r6, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0808D6E4: .4byte gUnknown_203B45C + thumb_func_end sub_808D6A4 + + thumb_func_start sub_808D6E8 +sub_808D6E8: + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r7, 0 + movs r5, 0 + movs r4, 0 + ldr r0, _0808D740 + mov r8, r0 + movs r6, 0x1 +_0808D6FA: + movs r0, 0x58 + adds r1, r4, 0 + muls r1, r0 + mov r2, r8 + ldr r0, [r2] + adds r2, r0, r1 + ldrh r1, [r2] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _0808D728 + lsrs r0, r1, 1 + ands r0, r6 + cmp r0, 0 + beq _0808D728 + movs r1, 0x8 + ldrsh r0, [r2, r1] + bl sub_808DACC + lsls r0, 24 + lsrs r0, 24 + adds r5, r0 + adds r7, 0x1 +_0808D728: + adds r4, 0x1 + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + ble _0808D6FA + cmp r5, 0x5 + bgt _0808D744 + cmp r7, 0x3 + bgt _0808D744 + movs r0, 0x1 + b _0808D746 + .align 2, 0 +_0808D740: .4byte gUnknown_203B45C +_0808D744: + movs r0, 0 +_0808D746: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_808D6E8 + + thumb_func_start sub_808D750 +sub_808D750: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 16 + asrs r0, 16 + mov r8, r0 + movs r6, 0 + movs r5, 0 + movs r4, 0 + ldr r0, _0808D7C8 + mov r9, r0 + movs r7, 0x1 +_0808D76A: + movs r0, 0x58 + adds r1, r4, 0 + muls r1, r0 + mov r2, r9 + ldr r0, [r2] + adds r1, r0, r1 + ldrh r2, [r1] + adds r0, r7, 0 + ands r0, r2 + cmp r0, 0 + beq _0808D798 + lsrs r0, r2, 1 + ands r0, r7 + cmp r0, 0 + beq _0808D798 + movs r2, 0x8 + ldrsh r0, [r1, r2] + bl sub_808DACC + lsls r0, 24 + lsrs r0, 24 + adds r5, r0 + adds r6, 0x1 +_0808D798: + adds r4, 0x1 + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + ble _0808D76A + cmp r6, 0x3 + bgt _0808D7CC + ldr r2, _0808D7C8 + movs r0, 0x58 + mov r1, r8 + muls r1, r0 + ldr r0, [r2] + adds r1, r0, r1 + movs r2, 0x8 + ldrsh r0, [r1, r2] + bl sub_808DACC + lsls r0, 24 + lsrs r0, 24 + adds r5, r0 + cmp r5, 0x6 + bgt _0808D7CC + movs r0, 0x1 + b _0808D7CE + .align 2, 0 +_0808D7C8: .4byte gUnknown_203B45C +_0808D7CC: + movs r0, 0 +_0808D7CE: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_808D750 + + thumb_func_start sub_808D7DC +sub_808D7DC: + lsls r0, 16 + asrs r0, 16 + ldr r3, _0808D7FC + movs r2, 0x58 + muls r2, r0 + ldr r0, [r3] + adds r0, r2 + adds r2, r0, 0 + adds r2, 0x28 + ldrb r2, [r2] + strb r2, [r1] + adds r0, 0x29 + ldrb r0, [r0] + strb r0, [r1, 0x1] + bx lr + .align 2, 0 +_0808D7FC: .4byte gUnknown_203B45C + thumb_func_end sub_808D7DC + + thumb_func_start sub_808D800 +sub_808D800: + lsls r0, 16 + asrs r0, 16 + ldr r3, _0808D820 + movs r2, 0x58 + muls r2, r0 + ldr r0, [r3] + adds r0, r2 + ldrb r3, [r1] + adds r2, r0, 0 + adds r2, 0x28 + strb r3, [r2] + ldrb r1, [r1, 0x1] + adds r0, 0x29 + strb r1, [r0] + bx lr + .align 2, 0 +_0808D820: .4byte gUnknown_203B45C + thumb_func_end sub_808D800 + + thumb_func_start sub_808D824 +sub_808D824: + push {r4,lr} + sub sp, 0x14 + adds r4, r0, 0 + movs r1, 0x8 + ldrsh r0, [r4, r1] + bl sub_808D994 + adds r1, r0, 0 + mov r0, sp + bl sub_80922F4 + movs r2, 0 + adds r4, 0x4C +_0808D83E: + adds r0, r4, r2 + mov r3, sp + adds r1, r3, r2 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + beq _0808D850 + movs r0, 0 + b _0808D85C +_0808D850: + cmp r0, 0 + beq _0808D85A + adds r2, 0x1 + cmp r2, 0x9 + ble _0808D83E +_0808D85A: + movs r0, 0x1 +_0808D85C: + add sp, 0x14 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_808D824 + + thumb_func_start sub_808D864 +sub_808D864: + push {r4-r7,lr} + lsls r0, 16 + asrs r0, 16 + lsls r1, 16 + asrs r1, 16 + ldr r2, _0808D8A0 + movs r3, 0x58 + muls r0, r3 + ldr r2, [r2] + adds r0, r2, r0 + adds r6, r0, 0 + adds r6, 0x4C + adds r0, r1, 0 + muls r0, r3 + adds r2, r0 + adds r5, r2, 0 + adds r5, 0x4C + movs r7, 0 +_0808D888: + ldrb r0, [r6] + bl sub_8092280 + adds r4, r0, 0 + ldrb r0, [r5] + bl sub_8092280 + cmp r4, r0 + ble _0808D8A4 + movs r0, 0x1 + b _0808D8B4 + .align 2, 0 +_0808D8A0: .4byte gUnknown_203B45C +_0808D8A4: + cmp r4, r0 + blt _0808D8B2 + adds r6, 0x1 + adds r5, 0x1 + adds r7, 0x1 + cmp r7, 0x9 + ble _0808D888 +_0808D8B2: + movs r0, 0 +_0808D8B4: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_808D864 + + thumb_func_start sub_808D8BC +sub_808D8BC: + push {lr} + lsls r1, 16 + asrs r1, 16 + ldr r2, _0808D8DC + ldr r3, [r2] + lsls r2, r1, 3 + adds r2, r1 + lsls r2, 3 + adds r2, r3 + ldr r1, [r2] + movs r2, 0x14 + bl strncpy + pop {r0} + bx r0 + .align 2, 0 +_0808D8DC: .4byte gUnknown_202F3E0 + thumb_func_end sub_808D8BC + + thumb_func_start sub_808D8E0 +sub_808D8E0: + push {r4,lr} + lsls r3, r1, 16 + asrs r3, 16 + ldr r1, _0808D900 + ldr r2, _0808D904 + ldr r4, [r2] + lsls r2, r3, 3 + adds r2, r3 + lsls r2, 3 + adds r2, r4 + ldr r2, [r2] + bl sub_800D158 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0808D900: .4byte gUnknown_8107600 +_0808D904: .4byte gUnknown_202F3E0 + thumb_func_end sub_808D8E0 + + thumb_func_start sub_808D908 +sub_808D908: + push {r4,lr} + lsls r3, r1, 16 + asrs r3, 16 + ldr r1, _0808D928 + ldr r2, _0808D92C + ldr r4, [r2] + lsls r2, r3, 3 + adds r2, r3 + lsls r2, 3 + adds r2, r4 + ldr r2, [r2] + bl sub_800D158 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0808D928: .4byte gUnknown_8107608 +_0808D92C: .4byte gUnknown_202F3E0 + thumb_func_end sub_808D908 + + thumb_func_start sub_808D930 +sub_808D930: + push {r4-r7,lr} + adds r7, r0, 0 + lsls r1, 16 + asrs r6, r1, 16 + adds r0, r6, 0 + bl sub_808E770 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xC9 + bne _0808D970 + ldr r5, _0808D968 + movs r0, 0xC9 + bl sub_808D994 + adds r4, r0, 0 + adds r0, r6, 0 + bl sub_808E8C8 + ldr r1, _0808D96C + adds r0, r1 + ldrb r3, [r0] + adds r0, r7, 0 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_800D158 + b _0808D986 + .align 2, 0 +_0808D968: .4byte gUnknown_8107630 +_0808D96C: .4byte gUnknown_8107610 +_0808D970: + ldr r1, _0808D98C + ldr r0, _0808D990 + ldr r2, [r0] + lsls r0, r6, 3 + adds r0, r6 + lsls r0, 3 + adds r0, r2 + ldr r2, [r0] + adds r0, r7, 0 + bl sub_800D158 +_0808D986: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0808D98C: .4byte gUnknown_8107638 +_0808D990: .4byte gUnknown_202F3E0 + thumb_func_end sub_808D930 + + thumb_func_start sub_808D994 +sub_808D994: + lsls r0, 16 + asrs r0, 16 + ldr r1, _0808D9A8 + ldr r2, [r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, [r1] + bx lr + .align 2, 0 +_0808D9A8: .4byte gUnknown_202F3E0 + thumb_func_end sub_808D994 + + thumb_func_start sub_808D9AC +sub_808D9AC: + push {r4,r5,lr} + sub sp, 0x14 + adds r5, r0, 0 + adds r4, r2, 0 + adds r1, 0x4C + mov r0, sp + movs r2, 0xA + bl sub_80922B4 + cmp r4, 0 + bne _0808D9C4 + movs r4, 0x5 +_0808D9C4: + ldr r1, _0808D9D8 + adds r0, r5, 0 + adds r2, r4, 0 + mov r3, sp + bl sub_800D158 + add sp, 0x14 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808D9D8: .4byte gUnknown_810763C + thumb_func_end sub_808D9AC + + thumb_func_start sub_808D9DC +sub_808D9DC: + push {r4,r5,lr} + sub sp, 0x14 + adds r5, r0, 0 + adds r4, r2, 0 + adds r1, 0x58 + mov r0, sp + movs r2, 0xA + bl sub_80922B4 + cmp r4, 0 + bne _0808D9F4 + movs r4, 0x6 +_0808D9F4: + ldr r1, _0808DA08 + adds r0, r5, 0 + adds r2, r4, 0 + mov r3, sp + bl sub_800D158 + add sp, 0x14 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0808DA08: .4byte gUnknown_810763C + thumb_func_end sub_808D9DC + + thumb_func_start sub_808DA0C +sub_808DA0C: + push {r4,lr} + sub sp, 0x14 + adds r4, r0, 0 + adds r1, 0x58 + mov r0, sp + movs r2, 0xA + bl sub_80922B4 + ldr r1, _0808DA30 + adds r0, r4, 0 + mov r2, sp + bl sub_800D158 + add sp, 0x14 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0808DA30: .4byte gUnknown_8107638 + thumb_func_end sub_808DA0C + + thumb_func_start sub_808DA34 +sub_808DA34: + push {lr} + adds r1, 0x4C + movs r2, 0xA + bl sub_80922B4 + pop {r0} + bx r0 + thumb_func_end sub_808DA34 + + thumb_func_start sub_808DA44 +sub_808DA44: + push {r4-r6,lr} + sub sp, 0x30 + lsls r0, 16 + asrs r4, r0, 16 + lsls r1, 24 + lsrs r2, r1, 24 + cmp r2, 0xC + bls _0808DAA0 + mov r1, sp + ldr r0, _0808DA98 + ldm r0!, {r3,r5,r6} + stm r1!, {r3,r5,r6} + ldm r0!, {r3,r5,r6} + stm r1!, {r3,r5,r6} + ldm r0!, {r3,r5,r6} + stm r1!, {r3,r5,r6} + ldm r0!, {r3,r5,r6} + stm r1!, {r3,r5,r6} + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _0808DA92 + mov r1, sp + add r3, sp, 0x48 +_0808DA76: + movs r5, 0 + ldrsh r0, [r1, r5] + cmp r0, r4 + bne _0808DA84 + ldr r0, [r1, 0x4] + cmp r0, r2 + beq _0808DA9C +_0808DA84: + adds r1, 0x8 + cmp r1, r3 + bgt _0808DA92 + movs r6, 0 + ldrsh r0, [r1, r6] + cmp r0, 0 + bne _0808DA76 +_0808DA92: + movs r0, 0 + b _0808DAA6 + .align 2, 0 +_0808DA98: .4byte gUnknown_8107654 +_0808DA9C: + movs r0, 0x1 + b _0808DAA6 +_0808DAA0: + ldr r0, _0808DAB0 + adds r0, r2, r0 + ldrb r0, [r0] +_0808DAA6: + add sp, 0x30 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0808DAB0: .4byte gUnknown_8107645 + thumb_func_end sub_808DA44 + + thumb_func_start sub_808DAB4 +sub_808DAB4: + lsls r0, 16 + asrs r0, 16 + ldr r1, _0808DAC8 + ldr r2, [r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, [r1, 0x4] + bx lr + .align 2, 0 +_0808DAC8: .4byte gUnknown_202F3E0 + thumb_func_end sub_808DAB4 + + thumb_func_start sub_808DACC +sub_808DACC: + lsls r0, 16 + asrs r0, 16 + ldr r1, _0808DAE0 + ldr r2, [r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrb r0, [r1, 0x9] + bx lr + .align 2, 0 +_0808DAE0: .4byte gUnknown_202F3E0 + thumb_func_end sub_808DACC + + thumb_func_start sub_808DAE4 +sub_808DAE4: + lsls r0, 16 + asrs r0, 16 + ldr r1, _0808DAF8 + ldr r2, [r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrb r0, [r1, 0x19] + bx lr + .align 2, 0 +_0808DAF8: .4byte gUnknown_202F3E0 + thumb_func_end sub_808DAE4 + + thumb_func_start sub_808DAFC +sub_808DAFC: + lsls r0, 16 + asrs r0, 16 + ldr r1, _0808DB10 + ldr r2, [r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldr r0, [r1, 0xC] + bx lr + .align 2, 0 +_0808DB10: .4byte gUnknown_202F3E0 + thumb_func_end sub_808DAFC + + thumb_func_start sub_808DB14 +sub_808DB14: + lsls r0, 16 + asrs r0, 16 + ldr r1, _0808DB28 + ldr r2, [r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrb r0, [r1, 0x15] + bx lr + .align 2, 0 +_0808DB28: .4byte gUnknown_202F3E0 + thumb_func_end sub_808DB14 + + thumb_func_start sub_808DB2C +sub_808DB2C: + lsls r0, 16 + asrs r0, 16 + ldr r1, _0808DB44 + ldr r2, [r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrb r0, [r1, 0x1B] + lsls r0, 25 + lsrs r0, 24 + bx lr + .align 2, 0 +_0808DB44: .4byte gUnknown_202F3E0 + thumb_func_end sub_808DB2C + + thumb_func_start sub_808DB48 +sub_808DB48: + lsls r0, 16 + asrs r0, 16 + ldr r1, _0808DB5C + ldr r2, [r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrb r0, [r1, 0x1C] + bx lr + .align 2, 0 +_0808DB5C: .4byte gUnknown_202F3E0 + thumb_func_end sub_808DB48 + + thumb_func_start sub_808DB60 +sub_808DB60: + lsls r0, 16 + asrs r0, 16 + ldr r1, _0808DB74 + ldr r2, [r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrb r0, [r1, 0x1D] + bx lr + .align 2, 0 +_0808DB74: .4byte gUnknown_202F3E0 + thumb_func_end sub_808DB60 + + thumb_func_start sub_808DB78 +sub_808DB78: + lsls r0, 16 + asrs r0, 16 + ldr r1, _0808DB8C + ldr r2, [r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrh r0, [r1, 0x2C] + bx lr + .align 2, 0 +_0808DB8C: .4byte gUnknown_202F3E0 + thumb_func_end sub_808DB78 + + thumb_func_start sub_808DB90 +sub_808DB90: + lsls r0, 16 + asrs r0, 16 + ldr r1, _0808DBA4 + ldr r2, [r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrh r0, [r1, 0x2E] + bx lr + .align 2, 0 +_0808DBA4: .4byte gUnknown_202F3E0 + thumb_func_end sub_808DB90 + + thumb_func_start sub_808DBA8 +sub_808DBA8: + lsls r0, 16 + asrs r0, 16 + ldr r1, _0808DBBC + ldr r2, [r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrb r0, [r1, 0x16] + bx lr + .align 2, 0 +_0808DBBC: .4byte gUnknown_202F3E0 + thumb_func_end sub_808DBA8 + + thumb_func_start sub_808DBC0 +sub_808DBC0: + lsls r0, 16 + asrs r0, 16 + ldr r1, _0808DBD4 + ldr r2, [r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrh r0, [r1, 0x1E] + bx lr + .align 2, 0 +_0808DBD4: .4byte gUnknown_202F3E0 + thumb_func_end sub_808DBC0 + + thumb_func_start sub_808DBD8 +sub_808DBD8: + lsls r0, 16 + asrs r0, 16 + ldr r1, _0808DBF0 + ldr r2, [r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + adds r1, 0x33 + ldrb r0, [r1] + bx lr + .align 2, 0 +_0808DBF0: .4byte gUnknown_202F3E0 + thumb_func_end sub_808DBD8 + + thumb_func_start sub_808DBF4 +sub_808DBF4: + lsls r0, 16 + asrs r0, 16 + ldr r1, _0808DC08 + ldr r2, [r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + ldrb r0, [r1, 0x12] + bx lr + .align 2, 0 +_0808DC08: .4byte gUnknown_202F3E0 + thumb_func_end sub_808DBF4 + + thumb_func_start sub_808DC0C +sub_808DC0C: + lsls r0, 16 + asrs r0, 16 + ldr r1, _0808DC24 + ldr r2, [r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0x34 + ldrsh r0, [r1, r2] + bx lr + .align 2, 0 +_0808DC24: .4byte gUnknown_202F3E0 + thumb_func_end sub_808DC0C + + thumb_func_start sub_808DC28 +sub_808DC28: + lsls r0, 16 + asrs r0, 16 + ldr r2, _0808DC44 + ldr r3, [r2] + lsls r2, r0, 3 + adds r2, r0 + lsls r2, 3 + adds r2, r3 + lsls r1, 1 + adds r2, 0x24 + adds r2, r1 + ldrh r0, [r2] + bx lr + .align 2, 0 +_0808DC44: .4byte gUnknown_202F3E0 + thumb_func_end sub_808DC28 + + thumb_func_start sub_808DC48 +sub_808DC48: + lsls r0, 16 + asrs r0, 16 + ldr r2, _0808DC64 + ldr r3, [r2] + lsls r2, r0, 3 + adds r2, r0 + lsls r2, 3 + adds r2, r3 + lsls r1, 1 + adds r2, 0x28 + adds r2, r1 + ldrh r0, [r2] + bx lr + .align 2, 0 +_0808DC64: .4byte gUnknown_202F3E0 + thumb_func_end sub_808DC48 + + thumb_func_start sub_808DC68 +sub_808DC68: + lsls r0, 16 + asrs r0, 16 + ldr r2, _0808DC80 + ldr r3, [r2] + lsls r2, r0, 3 + adds r2, r0 + lsls r2, 3 + adds r2, r3 + adds r2, 0x13 + adds r2, r1 + ldrb r0, [r2] + bx lr + .align 2, 0 +_0808DC80: .4byte gUnknown_202F3E0 + thumb_func_end sub_808DC68 + + thumb_func_start sub_808DC84 +sub_808DC84: + lsls r0, 16 + asrs r0, 16 + ldr r2, _0808DC9C + ldr r3, [r2] + lsls r2, r0, 3 + adds r2, r0 + lsls r2, 3 + adds r2, r3 + adds r2, 0x17 + adds r2, r1 + ldrb r0, [r2] + bx lr + .align 2, 0 +_0808DC9C: .4byte gUnknown_202F3E0 + thumb_func_end sub_808DC84 + + thumb_func_start sub_808DCA0 +sub_808DCA0: + lsls r0, 16 + asrs r0, 16 + ldr r2, _0808DCBC + ldr r3, [r2] + lsls r2, r0, 3 + adds r2, r0 + lsls r2, 3 + adds r2, r3 + lsls r1, 1 + adds r2, 0x3C + adds r2, r1 + movs r1, 0 + ldrsh r0, [r2, r1] + bx lr + .align 2, 0 +_0808DCBC: .4byte gUnknown_202F3E0 + thumb_func_end sub_808DCA0 + + thumb_func_start sub_808DCC0 +sub_808DCC0: + lsls r0, 16 + asrs r0, 16 + ldr r1, _0808DCD8 + ldr r2, [r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + adds r1, 0x40 + movs r2, 0 + ldrsh r0, [r1, r2] + bx lr + .align 2, 0 +_0808DCD8: .4byte gUnknown_202F3E0 + thumb_func_end sub_808DCC0 + + thumb_func_start sub_808DCDC +sub_808DCDC: + lsls r0, 16 + asrs r0, 16 + ldr r2, _0808DCF8 + ldr r3, [r2] + lsls r2, r0, 3 + adds r2, r0 + lsls r2, 3 + adds r2, r3 + lsls r1, 1 + adds r2, 0x42 + adds r2, r1 + movs r1, 0 + ldrsh r0, [r2, r1] + bx lr + .align 2, 0 +_0808DCF8: .4byte gUnknown_202F3E0 + thumb_func_end sub_808DCDC + + thumb_func_start sub_808DCFC +sub_808DCFC: + lsls r0, 16 + asrs r0, 16 + ldr r1, _0808DD14 + ldr r2, [r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 3 + adds r1, r2 + movs r2, 0x3E + ldrsh r0, [r1, r2] + bx lr + .align 2, 0 +_0808DD14: .4byte gUnknown_202F3E0 + thumb_func_end sub_808DCFC + + thumb_func_start sub_808DD18 +sub_808DD18: + push {r4,lr} + lsls r0, 16 + asrs r0, 16 + ldr r2, _0808DD44 + ldr r3, [r2] + lsls r2, r0, 3 + adds r2, r0 + lsls r2, 3 + adds r2, r3 + ldr r4, [r2, 0x20] + subs r1, 0x1 + adds r0, r4, 0 + muls r0, r1 + movs r1, 0xA + bl __divsi3 + adds r4, r0 + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0808DD44: .4byte gUnknown_202F3E0 + thumb_func_end sub_808DD18 + + thumb_func_start sub_808DD48 +sub_808DD48: + lsls r0, 16 + asrs r0, 16 + ldr r2, _0808DD64 + ldr r3, [r2] + lsls r2, r0, 3 + adds r2, r0 + lsls r2, 3 + adds r2, r3 + ldr r3, [r2, 0x38] + ldr r2, [r2, 0x34] + str r2, [r1] + str r3, [r1, 0x4] + bx lr + .align 2, 0 +_0808DD64: .4byte gUnknown_202F3E0 + thumb_func_end sub_808DD48 + + thumb_func_start sub_808DD68 +sub_808DD68: + push {lr} + lsls r0, 16 + asrs r2, r0, 16 + cmp r1, 0 + bne _0808DD88 + ldr r0, _0808DD84 + ldr r1, [r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + ldrb r0, [r0, 0x8] + b _0808DD8A + .align 2, 0 +_0808DD84: .4byte gUnknown_202F3E0 +_0808DD88: + movs r0, 0xA +_0808DD8A: + pop {r1} + bx r1 + thumb_func_end sub_808DD68 + + thumb_func_start sub_808DD90 +sub_808DD90: + push {lr} + sub sp, 0xC + lsls r0, 16 + asrs r2, r0, 16 + ldr r0, _0808DDBC + ldr r1, [r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x10] + cmp r0, 0 + beq _0808DDC8 + ldr r1, _0808DDC0 + mov r0, sp + bl sprintf + ldr r1, _0808DDC4 + mov r0, sp + bl sub_800A908 + b _0808DDCA + .align 2, 0 +_0808DDBC: .4byte gUnknown_202F3E0 +_0808DDC0: .4byte gUnknown_8107684 +_0808DDC4: .4byte gUnknown_8510000 +_0808DDC8: + movs r0, 0 +_0808DDCA: + add sp, 0xC + pop {r1} + bx r1 + thumb_func_end sub_808DD90 + + thumb_func_start sub_808DDD0 +sub_808DDD0: + push {lr} + sub sp, 0xC + lsls r0, 16 + asrs r2, r0, 16 + ldr r0, _0808DDFC + ldr r1, [r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 3 + adds r0, r1 + ldrh r0, [r0, 0x10] + cmp r0, 0 + beq _0808DE08 + ldr r1, _0808DE00 + mov r0, sp + bl sprintf + ldr r1, _0808DE04 + mov r0, sp + bl sub_800A9EC + b _0808DE0A + .align 2, 0 +_0808DDFC: .4byte gUnknown_202F3E0 +_0808DE00: .4byte gUnknown_8107684 +_0808DE04: .4byte gUnknown_8510000 +_0808DE08: + movs r0, 0 +_0808DE0A: + add sp, 0xC + pop {r1} + bx r1 + thumb_func_end sub_808DDD0 + + thumb_func_start sub_808DE10 +sub_808DE10: + lsls r0, 16 + asrs r0, 16 + ldr r2, _0808DE2C + ldr r3, [r2] + lsls r2, r0, 3 + adds r2, r0 + lsls r2, 3 + adds r2, r3 + ldrh r0, [r2, 0x10] + asrs r0, r1 + movs r1, 0x1 + ands r0, r1 + bx lr + .align 2, 0 +_0808DE2C: .4byte gUnknown_202F3E0 + thumb_func_end sub_808DE10 + + thumb_func_start sub_808DE30 +sub_808DE30: + push {r4,lr} + adds r2, r1, 0 + ldr r4, _0808DE4C + movs r1, 0x58 + adds r3, r2, 0 + muls r3, r1 + ldr r1, [r4] + adds r1, r3 + bl sub_808DE50 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0808DE4C: .4byte gUnknown_203B45C + thumb_func_end sub_808DE30 + + thumb_func_start sub_808DE50 +sub_808DE50: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r5, r0, 0 + adds r6, r1, 0 + adds r4, r2, 0 + ldrh r0, [r6] + strh r0, [r5] + ldrb r0, [r6, 0x3] + strb r0, [r5, 0x3] + ldrh r0, [r6, 0x14] + strh r0, [r5, 0x8] + ldr r0, [r6, 0x20] + str r0, [r5, 0x4C] + adds r0, r5, 0 + adds r0, 0x54 + bl sub_808E6F4 + ldr r0, [r6, 0x4] + str r0, [r5, 0x4] + ldrb r0, [r6, 0x2] + strb r0, [r5, 0x2] + strh r4, [r5, 0xA] + ldrh r0, [r6, 0x8] + strh r0, [r5, 0xE] + adds r0, r6, 0 + adds r0, 0x24 + ldrb r1, [r0] + adds r0, r5, 0 + adds r0, 0x50 + strb r1, [r0] + ldrh r0, [r6, 0x16] + strh r0, [r5, 0x12] + strh r0, [r5, 0x10] + add r0, sp, 0x4 + mov r8, r0 + adds r2, r6, 0 + adds r2, 0x18 + adds r1, r5, 0 + adds r1, 0x14 + movs r3, 0x1 +_0808DEA4: + ldrb r0, [r2] + strb r0, [r1] + ldrb r0, [r2, 0x2] + strb r0, [r1, 0x2] + adds r2, 0x1 + adds r1, 0x1 + subs r3, 0x1 + cmp r3, 0 + bge _0808DEA4 + ldr r0, [r6, 0x1C] + str r0, [r5, 0x18] + adds r0, r5, 0 + adds r0, 0x1C + adds r1, r6, 0 + adds r1, 0x2C + bl sub_8093F50 + movs r3, 0 + movs r0, 0x28 + adds r0, r6 + mov r12, r0 + adds r2, r5, 0 + adds r2, 0x40 + adds r7, r5, 0 + adds r7, 0x58 + adds r4, r6, 0 + adds r4, 0x4C +_0808DEDA: + adds r0, r7, r3 + adds r1, r4, r3 + ldrb r1, [r1] + strb r1, [r0] + adds r3, 0x1 + cmp r3, 0x9 + ble _0808DEDA + mov r0, r12 + ldrb r1, [r0] + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + cmp r0, 0 + beq _0808DF00 + adds r0, r2, 0 + mov r1, r12 + bl sub_8090B64 + b _0808DF06 +_0808DF00: + strb r0, [r2, 0x2] + strb r0, [r2, 0x1] + strb r0, [r2] +_0808DF06: + mov r0, sp + movs r1, 0x64 + bl sub_80943A0 + ldr r0, [sp] + str r0, [r5, 0x44] + mov r0, r8 + movs r1, 0x64 + bl sub_80943A0 + ldr r0, [sp, 0x4] + str r0, [r5, 0x48] + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_808DE50 + + thumb_func_start sub_808DF2C +sub_808DF2C: + push {lr} + ldr r3, _0808DF40 + movs r2, 0x58 + muls r2, r0 + ldr r0, [r3] + adds r0, r2 + bl sub_808DF44 + pop {r0} + bx r0 + .align 2, 0 +_0808DF40: .4byte gUnknown_203B45C + thumb_func_end sub_808DF2C + + thumb_func_start sub_808DF44 +sub_808DF44: + push {r4-r7,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldrh r0, [r4] + strh r0, [r5] + ldrb r0, [r4, 0x3] + strb r0, [r5, 0x3] + ldrh r0, [r4, 0x8] + strh r0, [r5, 0x14] + ldr r0, [r4, 0x4C] + str r0, [r5, 0x20] + ldr r0, [r4, 0x4] + str r0, [r5, 0x4] + ldrb r0, [r4, 0x2] + strb r0, [r5, 0x2] + ldrh r0, [r4, 0xE] + strh r0, [r5, 0x8] + adds r0, r4, 0 + adds r0, 0x50 + ldrb r1, [r0] + adds r0, r5, 0 + adds r0, 0x24 + strb r1, [r0] + ldrh r0, [r4, 0x12] + strh r0, [r5, 0x16] + adds r2, r4, 0 + adds r2, 0x14 + adds r1, r5, 0 + adds r1, 0x18 + movs r3, 0x1 +_0808DF80: + ldrb r0, [r2] + strb r0, [r1] + ldrb r0, [r2, 0x2] + strb r0, [r1, 0x2] + adds r2, 0x1 + adds r1, 0x1 + subs r3, 0x1 + cmp r3, 0 + bge _0808DF80 + ldr r0, [r4, 0x18] + str r0, [r5, 0x1C] + adds r0, r5, 0 + adds r0, 0x2C + adds r1, r4, 0 + adds r1, 0x1C + bl sub_8093FA8 + movs r3, 0 + adds r7, r4, 0 + adds r7, 0x40 + adds r6, r5, 0 + adds r6, 0x28 + adds r5, 0x4C + adds r2, r4, 0 + adds r2, 0x58 +_0808DFB2: + adds r0, r5, r3 + adds r1, r2, r3 + ldrb r1, [r1] + strb r1, [r0] + adds r3, 0x1 + cmp r3, 0x9 + ble _0808DFB2 + ldrb r0, [r7] + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0808DFD4 + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_8090BB0 + b _0808DFD6 +_0808DFD4: + strb r1, [r6] +_0808DFD6: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_808DF44 + + thumb_func_start sub_808DFDC +sub_808DFDC: + push {lr} + ldr r3, _0808E000 + movs r2, 0x58 + muls r2, r0 + ldr r0, [r3] + adds r3, r0, r2 + adds r1, 0x40 + ldrb r0, [r1] + movs r2, 0x1 + ands r2, r0 + cmp r2, 0 + beq _0808E004 + adds r0, r3, 0 + adds r0, 0x28 + bl sub_8090BB0 + b _0808E00A + .align 2, 0 +_0808E000: .4byte gUnknown_203B45C +_0808E004: + adds r0, r3, 0 + adds r0, 0x28 + strb r2, [r0] +_0808E00A: + pop {r0} + bx r0 + thumb_func_end sub_808DFDC + + thumb_func_start sub_808E010 +sub_808E010: + push {r4-r6,lr} + sub sp, 0xC + adds r6, r0, 0 + adds r5, r2, 0 + lsls r1, 16 + asrs r2, r1, 16 + ldr r1, _0808E06C + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, r2 + beq _0808E04A + strh r2, [r1] + ldr r1, _0808E070 + mov r0, sp + bl sprintf + ldr r1, _0808E074 + mov r0, sp + bl sub_800A9EC + adds r4, r0, 0 + ldr r0, _0808E078 + movs r1, 0 + adds r2, r4, 0 + bl sub_800AAA8 + adds r0, r4, 0 + bl sub_800AA14 +_0808E04A: + subs r5, 0x1 + cmp r5, 0 + bge _0808E052 + movs r5, 0 +_0808E052: + ldr r0, _0808E078 + lsls r1, r5, 1 + adds r1, r5 + lsls r1, 2 + adds r2, r6, 0 + adds r1, r0 + ldm r1!, {r0,r3,r4} + stm r2!, {r0,r3,r4} + add sp, 0xC + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0808E06C: .4byte gUnknown_20384E8 +_0808E070: .4byte gUnknown_810768C +_0808E074: .4byte gUnknown_8300500 +_0808E078: .4byte gUnknown_20384F0 + thumb_func_end sub_808E010 + + thumb_func_start sub_808E07C +sub_808E07C: + push {r4,lr} + adds r2, r0, 0 + adds r4, r1, 0 + ldrb r1, [r2] + adds r2, 0x1 + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0808E094 + ldrb r3, [r2] + adds r2, 0x1 + b _0808E098 +_0808E094: + adds r3, r1, 0 + movs r1, 0 +_0808E098: + movs r0, 0x7F + ands r3, r0 + ands r1, r0 + lsls r0, r1, 7 + orrs r0, r3 + strh r0, [r4] + adds r0, r2, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_808E07C + + thumb_func_start sub_808E0AC +sub_808E0AC: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r6, r0, 0 + mov r8, r2 + adds r5, r3, 0 + lsls r1, 16 + asrs r1, 16 + adds r2, r1, 0 + movs r7, 0 + ldr r0, _0808E0DC + cmp r1, r0 + beq _0808E0D8 + cmp r1, 0 + beq _0808E0D8 + movs r0, 0xD2 + lsls r0, 1 + cmp r1, r0 + bne _0808E0E0 +_0808E0D8: + movs r0, 0 + b _0808E170 + .align 2, 0 +_0808E0DC: .4byte 0x000001a5 +_0808E0E0: + adds r0, r2, 0 + bl sub_8092B18 + adds r1, r0, 0 + mov r4, sp + movs r0, 0x88 + lsls r0, 1 + mov r10, r0 + movs r3, 0xB1 + lsls r3, 1 + mov r9, r3 + b _0808E156 +_0808E0F8: + cmp r0, r8 + bne _0808E156 + movs r2, 0x1 + ldrh r0, [r4] + cmp r0, 0xEE + bne _0808E110 + ldr r0, _0808E180 + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r5, r0 + bge _0808E110 + movs r2, 0 +_0808E110: + ldrh r0, [r4] + cmp r0, 0xEF + bne _0808E122 + ldr r0, _0808E184 + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r5, r0 + bge _0808E122 + movs r2, 0 +_0808E122: + ldrh r0, [r4] + cmp r0, r10 + bne _0808E134 + ldr r0, _0808E188 + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r5, r0 + bge _0808E134 + movs r2, 0 +_0808E134: + ldrh r0, [r4] + cmp r0, r9 + bne _0808E146 + ldr r0, _0808E18C + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r5, r0 + bge _0808E146 + movs r2, 0 +_0808E146: + cmp r2, 0 + beq _0808E156 + cmp r7, 0xF + bgt _0808E156 + ldrh r0, [r4] + strh r0, [r6] + adds r6, 0x2 + adds r7, 0x1 +_0808E156: + ldrb r0, [r1] + cmp r0, 0 + beq _0808E16E + adds r0, r1, 0 + mov r1, sp + bl sub_808E07C + adds r1, r0, 0 + ldrb r0, [r1] + adds r1, 0x1 + cmp r0, r8 + ble _0808E0F8 +_0808E16E: + adds r0, r7, 0 +_0808E170: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0808E180: .4byte gUnknown_810ACB8 +_0808E184: .4byte gUnknown_810ACBA +_0808E188: .4byte gUnknown_810ACBC +_0808E18C: .4byte gUnknown_810ACBE + thumb_func_end sub_808E0AC + + thumb_func_start sub_808E190 +sub_808E190: + push {r4,r5,lr} + sub sp, 0x4 + lsls r0, 16 + lsrs r5, r0, 16 + lsls r1, 16 + asrs r4, r1, 16 + ldr r0, _0808E1B8 + cmp r4, r0 + beq _0808E20C + cmp r4, 0 + beq _0808E20C + movs r0, 0xD2 + lsls r0, 1 + cmp r4, r0 + beq _0808E20C + movs r0, 0xB0 + lsls r0, 1 + cmp r5, r0 + bne _0808E1C0 + b _0808E20C + .align 2, 0 +_0808E1B8: .4byte 0x000001a5 +_0808E1BC: + movs r0, 0x1 + b _0808E20E +_0808E1C0: + adds r0, r4, 0 + bl sub_8092B18 + adds r1, r0, 0 + b _0808E1DE +_0808E1CA: + adds r0, r1, 0 + mov r1, sp + bl sub_808E07C + adds r1, r0, 0 + adds r1, 0x1 + mov r0, sp + ldrh r0, [r0] + cmp r5, r0 + beq _0808E1BC +_0808E1DE: + ldrb r0, [r1] + cmp r0, 0 + bne _0808E1CA + adds r0, r4, 0 + bl sub_8092B54 + adds r1, r0, 0 + ldrb r0, [r1] + cmp r0, 0 + beq _0808E20C + mov r4, sp + adds r4, 0x2 +_0808E1F6: + adds r0, r1, 0 + adds r1, r4, 0 + bl sub_808E07C + adds r1, r0, 0 + ldrh r0, [r4] + cmp r0, r5 + beq _0808E1BC + ldrb r0, [r1] + cmp r0, 0 + bne _0808E1F6 +_0808E20C: + movs r0, 0 +_0808E20E: + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_808E190 + + thumb_func_start sub_808E218 +sub_808E218: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + mov r10, r0 + mov r8, r1 + movs r0, 0 + mov r9, r0 + movs r0, 0xCF + lsls r0, 2 + add r0, r10 + mov r1, r9 + str r1, [r0] + mov r2, r8 + movs r3, 0x8 + ldrsh r1, [r2, r3] + ldr r0, _0808E254 + cmp r1, r0 + beq _0808E24E + cmp r1, 0 + beq _0808E24E + movs r0, 0xD2 + lsls r0, 1 + cmp r1, r0 + bne _0808E258 +_0808E24E: + movs r0, 0 + b _0808E396 + .align 2, 0 +_0808E254: .4byte 0x000001a5 +_0808E258: + mov r0, r8 + mov r1, sp + bl sub_808E3B8 + str r0, [sp, 0x10] + movs r5, 0 + cmp r9, r0 + blt _0808E26A + b _0808E38A +_0808E26A: + lsls r4, r5, 2 + mov r1, sp + adds r0, r1, r4 + movs r2, 0 + ldrsh r0, [r0, r2] + bl sub_8092B18 + adds r6, r0, 0 + str r4, [sp, 0x18] + adds r5, 0x1 + str r5, [sp, 0x14] + b _0808E35E +_0808E282: + movs r0, 0xCE + lsls r0, 1 + cmp r9, r0 + bgt _0808E35E + movs r7, 0x1 + ldrh r0, [r4] + cmp r0, 0xEE + bne _0808E2A4 + ldr r0, _0808E3A8 + mov r3, r8 + movs r4, 0x14 + ldrsh r1, [r3, r4] + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r1, r0 + bge _0808E2A4 + movs r7, 0 +_0808E2A4: + mov r3, r12 + ldrh r0, [r3] + cmp r0, 0xEF + bne _0808E2BE + ldr r0, _0808E3AC + mov r4, r8 + movs r2, 0x14 + ldrsh r1, [r4, r2] + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r1, r0 + bge _0808E2BE + movs r7, 0 +_0808E2BE: + mov r4, r12 + ldrh r1, [r4] + movs r0, 0x88 + lsls r0, 1 + cmp r1, r0 + bne _0808E2DC + ldr r0, _0808E3B0 + mov r2, r8 + movs r3, 0x14 + ldrsh r1, [r2, r3] + movs r4, 0 + ldrsh r0, [r0, r4] + cmp r1, r0 + bge _0808E2DC + movs r7, 0 +_0808E2DC: + mov r0, r12 + ldrh r1, [r0] + movs r0, 0xB1 + lsls r0, 1 + cmp r1, r0 + bne _0808E2FA + ldr r0, _0808E3B4 + mov r2, r8 + movs r3, 0x14 + ldrsh r1, [r2, r3] + movs r4, 0 + ldrsh r0, [r0, r4] + cmp r1, r0 + bge _0808E2FA + movs r7, 0 +_0808E2FA: + movs r4, 0x1 + mov r5, r12 + mov r2, r8 + adds r2, 0x2C + movs r3, 0x3 +_0808E304: + ldrb r1, [r2] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _0808E318 + ldrh r0, [r2, 0x2] + ldrh r1, [r5] + cmp r0, r1 + bne _0808E318 + movs r7, 0 +_0808E318: + adds r2, 0x8 + subs r3, 0x1 + cmp r3, 0 + bge _0808E304 + cmp r7, 0 + beq _0808E35E + movs r2, 0 + cmp r2, r9 + bge _0808E34A + mov r3, r10 + ldrh r0, [r3] + mov r4, r12 + ldrh r4, [r4] + cmp r0, r4 + beq _0808E34A + mov r3, r12 + mov r1, r10 +_0808E33A: + adds r1, 0x2 + adds r2, 0x1 + cmp r2, r9 + bge _0808E34A + ldrh r0, [r1] + ldrh r4, [r3] + cmp r0, r4 + bne _0808E33A +_0808E34A: + cmp r2, r9 + bne _0808E35E + mov r1, r9 + lsls r0, r1, 1 + add r0, r10 + mov r2, r12 + ldrh r1, [r2] + strh r1, [r0] + movs r3, 0x1 + add r9, r3 +_0808E35E: + ldrb r0, [r6] + cmp r0, 0 + beq _0808E380 + add r4, sp, 0xC + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_808E07C + adds r6, r0, 0 + ldrb r0, [r6] + adds r6, 0x1 + ldr r1, [sp, 0x18] + add r1, sp + ldrb r1, [r1, 0x2] + mov r12, r4 + cmp r0, r1 + ble _0808E282 +_0808E380: + ldr r5, [sp, 0x14] + ldr r4, [sp, 0x10] + cmp r5, r4 + bge _0808E38A + b _0808E26A +_0808E38A: + movs r0, 0xCF + lsls r0, 2 + add r0, r10 + mov r1, r9 + str r1, [r0] + mov r0, r9 +_0808E396: + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0808E3A8: .4byte gUnknown_810ACB8 +_0808E3AC: .4byte gUnknown_810ACBA +_0808E3B0: .4byte gUnknown_810ACBC +_0808E3B4: .4byte gUnknown_810ACBE + thumb_func_end sub_808E218 + + thumb_func_start sub_808E3B8 +sub_808E3B8: + push {r4-r7,lr} + ldrh r2, [r0, 0x8] + strh r2, [r1] + ldrb r2, [r0, 0x3] + strb r2, [r1, 0x2] + movs r7, 0x1 + movs r3, 0x8 + ldrsh r2, [r0, r3] + movs r6, 0 + adds r5, r0, 0 + adds r5, 0xC + adds r4, r1, 0x4 + b _0808E3E0 +_0808E3D2: + strh r2, [r4] + ldrb r0, [r5] + strb r0, [r4, 0x2] + adds r4, 0x4 + adds r7, 0x1 + adds r5, 0x4 + adds r6, 0x1 +_0808E3E0: + cmp r6, 0x1 + bgt _0808E3F8 + ldrb r0, [r5] + cmp r0, 0 + beq _0808E3F8 + adds r0, r2, 0 + bl sub_808DC0C + lsls r0, 16 + asrs r2, r0, 16 + cmp r2, 0 + bne _0808E3D2 +_0808E3F8: + adds r0, r7, 0 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_808E3B8 + + thumb_func_start sub_808E400 +sub_808E400: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + lsls r0, 16 + asrs r0, 16 + mov r9, r0 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp] + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0x4] + movs r0, 0 + mov r10, r0 + movs r7, 0x1 + adds r6, r1, 0 +_0808E426: + lsls r0, r7, 16 + asrs r5, r0, 16 + mov r8, r5 + adds r0, r5, 0 + bl sub_808DC0C + lsls r0, 16 + asrs r0, 16 + cmp r9, r0 + bne _0808E46C + ldr r0, [sp] + cmp r0, 0 + bne _0808E456 + mov r0, r9 + bl sub_808DACC + adds r4, r0, 0 + adds r0, r5, 0 + bl sub_808DACC + lsls r4, 24 + lsls r0, 24 + cmp r4, r0 + bne _0808E46C +_0808E456: + ldr r0, [sp, 0x4] + cmp r0, 0 + bne _0808E462 + ldr r0, _0808E488 + cmp r5, r0 + beq _0808E46C +_0808E462: + mov r0, r8 + strh r0, [r6] + adds r6, 0x2 + movs r0, 0x1 + add r10, r0 +_0808E46C: + adds r7, 0x1 + ldr r0, _0808E48C + cmp r7, r0 + ble _0808E426 + mov r0, r10 + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0808E488: .4byte 0x0000013d +_0808E48C: .4byte 0x000001a7 + thumb_func_end sub_808E400 + + thumb_func_start sub_808E490 +sub_808E490: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x20 + mov r8, r0 + lsls r1, 16 + asrs r1, 16 + ldr r3, _0808E4F8 + mov r0, sp + movs r2, 0x1 + bl sub_808E0AC + adds r7, r0, 0 + cmp r7, 0 + bne _0808E4B8 + movs r7, 0x1 + mov r1, sp + movs r0, 0xCC + lsls r0, 1 + strh r0, [r1] +_0808E4B8: + movs r4, 0 + cmp r4, r7 + bge _0808E4D8 + mov r6, sp + mov r5, r8 + adds r4, r7, 0 +_0808E4C4: + ldrh r1, [r6] + adds r0, r5, 0 + bl sub_8092AD4 + adds r6, 0x2 + adds r5, 0x8 + subs r4, 0x1 + cmp r4, 0 + bne _0808E4C4 + adds r4, r7, 0 +_0808E4D8: + cmp r4, 0x3 + bgt _0808E4EC + movs r1, 0 + lsls r0, r4, 3 + add r0, r8 +_0808E4E2: + strb r1, [r0] + adds r0, 0x8 + adds r4, 0x1 + cmp r4, 0x3 + ble _0808E4E2 +_0808E4EC: + add sp, 0x20 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0808E4F8: .4byte 0x000003e7 + thumb_func_end sub_808E490 + + thumb_func_start sub_808E4FC +sub_808E4FC: + push {lr} + sub sp, 0x10 + ldr r1, _0808E518 + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + mov r1, sp + bl sub_8097DF0 + ldr r0, [sp] + ldr r0, [r0] + add sp, 0x10 + pop {r1} + bx r1 + .align 2, 0 +_0808E518: .4byte gUnknown_810D628 + thumb_func_end sub_808E4FC + + thumb_func_start sub_808E51C +sub_808E51C: + push {lr} + sub sp, 0x10 + ldr r1, _0808E538 + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + mov r1, sp + bl sub_8097DF0 + ldr r0, [sp] + ldr r0, [r0, 0x4] + add sp, 0x10 + pop {r1} + bx r1 + .align 2, 0 +_0808E538: .4byte gUnknown_810D628 + thumb_func_end sub_808E51C + + thumb_func_start sub_808E53C +sub_808E53C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r8, r0 + str r1, [sp] + ldr r0, _0808E628 + ldr r1, _0808E62C + bl sub_800A9EC + adds r7, r0, 0 + ldr r4, [r7, 0x4] + movs r6, 0x7 + adds r4, 0x4 + mov r1, r8 + lsls r0, r1, 5 + ldr r2, _0808E630 + adds r5, r0, r2 +_0808E564: + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x20 + bl CpuCopy + adds r5, 0x20 + adds r4, 0x20 + subs r6, 0x1 + cmp r6, 0 + bne _0808E564 + adds r0, r7, 0 + bl sub_800AA14 + movs r6, 0 + movs r0, 0x3 + mov r12, r0 + ldr r1, _0808E634 + mov r10, r1 + ldr r2, _0808E638 + mov r9, r2 + ldr r5, _0808E63C + movs r7, 0 + mov r4, r12 + ldr r0, [sp] + ands r4, r0 + lsls r4, 10 +_0808E598: + lsls r3, r6, 3 + ldr r0, _0808E640 + adds r3, r0 + ldrh r1, [r3] + ldr r0, _0808E644 + ands r0, r1 + ldr r1, _0808E648 + ands r0, r1 + mov r2, r10 + ands r0, r2 + ldr r1, _0808E64C + ands r0, r1 + ldr r1, _0808E650 + ands r0, r1 + strh r0, [r3] + ldr r1, [r5] + mov r2, r12 + ands r1, r2 + lsls r1, 14 + mov r2, r9 + ands r0, r2 + orrs r0, r1 + strh r0, [r3] + ldrh r0, [r3, 0x2] + ldr r1, _0808E654 + ands r1, r0 + strh r1, [r3, 0x2] + ldr r0, _0808E63C + adds r0, 0x4 + adds r0, r7, r0 + ldr r0, [r0] + mov r2, r12 + ands r0, r2 + lsls r0, 14 + mov r2, r9 + ands r1, r2 + orrs r1, r0 + strh r1, [r3, 0x2] + ldr r1, [r5, 0x8] + add r1, r8 + ldr r0, _0808E658 + ands r1, r0 + ldrh r2, [r3, 0x4] + movs r0, 0xFC + lsls r0, 8 + ands r0, r2 + orrs r0, r1 + mov r1, r10 + ands r0, r1 + orrs r0, r4 + ldr r1, _0808E65C + ands r0, r1 + strh r0, [r3, 0x4] + ldrh r1, [r3, 0x6] + ldr r0, _0808E660 + ands r0, r1 + ldr r1, _0808E664 + ands r0, r1 + strh r0, [r3, 0x6] + adds r5, 0xC + adds r7, 0xC + adds r6, 0x1 + cmp r6, 0x2 + ble _0808E598 + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0808E628: .4byte gUnknown_81076BC +_0808E62C: .4byte gUnknown_83B0000 +_0808E630: .4byte 0x06010000 +_0808E634: .4byte 0x0000f3ff +_0808E638: .4byte 0x00003fff +_0808E63C: .4byte gUnknown_8107698 +_0808E640: .4byte gUnknown_202F3E8 +_0808E644: .4byte 0x0000feff +_0808E648: .4byte 0x0000fdff +_0808E64C: .4byte 0x0000efff +_0808E650: .4byte 0x0000dfff +_0808E654: .4byte 0x0000c1ff +_0808E658: .4byte 0x000003ff +_0808E65C: .4byte 0x00000fff +_0808E660: .4byte 0x0000fffe +_0808E664: .4byte 0x0000fffd + thumb_func_end sub_808E53C + + thumb_func_start sub_808E668 +sub_808E668: + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + lsls r0, 16 + asrs r1, r0, 16 + ldr r2, _0808E6E0 + adds r0, r2 + lsrs r0, 16 + cmp r0, 0x1 + bls _0808E6D6 + adds r0, r1, 0 + bl sub_808DAE4 + lsls r0, 24 + lsrs r0, 24 + movs r3, 0 + ldrsh r2, [r4, r3] + movs r3, 0x10 + ldrsh r1, [r5, r3] + adds r2, r1 + movs r1, 0x2 + ldrsh r3, [r4, r1] + movs r4, 0x12 + ldrsh r1, [r5, r4] + adds r3, r1 + ldr r4, _0808E6E4 + lsls r1, r0, 2 + adds r1, r4 + ldr r1, [r1] + adds r2, r1 + subs r3, 0x4 + ldr r1, _0808E6E8 + ands r2, r1 + lsls r0, 3 + ldr r1, _0808E6EC + adds r0, r1 + ldrh r4, [r0, 0x2] + movs r1, 0xFE + lsls r1, 8 + ands r1, r4 + orrs r1, r2 + strh r1, [r0, 0x2] + ldr r1, _0808E6F0 + ands r3, r1 + lsls r3, 4 + ldrh r2, [r0, 0x6] + movs r1, 0xF + ands r1, r2 + orrs r1, r3 + strh r1, [r0, 0x6] + movs r1, 0 + movs r2, 0 + movs r3, 0 + bl AddSprite +_0808E6D6: + movs r0, 0x1 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0808E6E0: .4byte 0xffce0000 +_0808E6E4: .4byte gUnknown_81076C4 +_0808E6E8: .4byte 0x000001ff +_0808E6EC: .4byte gUnknown_202F3E8 +_0808E6F0: .4byte 0x00000fff + thumb_func_end sub_808E668 + + thumb_func_start sub_808E6F4 +sub_808E6F4: + push {r4,r5,lr} + adds r5, r0, 0 + movs r0, 0xA + bl RandomCapped + ldr r1, _0808E70C + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + strh r0, [r5] + movs r4, 0 + b _0808E712 + .align 2, 0 +_0808E70C: .4byte gUnknown_810AC90 +_0808E710: + adds r4, 0x1 +_0808E712: + cmp r4, 0x63 + bgt _0808E724 + movs r0, 0x12 + bl RandomCapped + strb r0, [r5, 0x2] + lsls r0, 24 + cmp r0, 0 + beq _0808E710 +_0808E724: + cmp r4, 0x64 + bne _0808E72C + movs r0, 0x2 + strb r0, [r5, 0x2] +_0808E72C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_808E6F4 + + thumb_func_start sub_808E734 +sub_808E734: + push {r4-r6,lr} + lsls r0, 16 + asrs r4, r0, 16 + movs r3, 0 + ldr r0, _0808E75C + ldr r2, [r0] + movs r6, 0x1 + movs r5, 0xCE + lsls r5, 1 +_0808E746: + ldrb r1, [r2] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _0808E760 + movs r1, 0x8 + ldrsh r0, [r2, r1] + cmp r0, r4 + bne _0808E760 + movs r0, 0x1 + b _0808E76A + .align 2, 0 +_0808E75C: .4byte gUnknown_203B45C +_0808E760: + adds r2, 0x58 + adds r3, 0x1 + cmp r3, r5 + ble _0808E746 + movs r0, 0 +_0808E76A: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_808E734 + + thumb_func_start sub_808E770 +sub_808E770: + push {lr} + lsls r0, 16 + asrs r1, r0, 16 + ldr r0, _0808E788 + cmp r1, r0 + beq _0808E792 + movs r0, 0xBD + lsls r0, 1 + cmp r1, r0 + bne _0808E78C + subs r0, 0x2 + b _0808E854 + .align 2, 0 +_0808E788: .4byte 0x00000179 +_0808E78C: + ldr r0, _0808E798 + cmp r1, r0 + bne _0808E79C +_0808E792: + movs r0, 0xBC + lsls r0, 1 + b _0808E854 + .align 2, 0 +_0808E798: .4byte 0x0000017b +_0808E79C: + cmp r1, 0xCA + beq _0808E80E + cmp r1, 0xCB + beq _0808E80E + cmp r1, 0xCC + beq _0808E80E + cmp r1, 0xCD + beq _0808E80E + cmp r1, 0xCE + beq _0808E80E + cmp r1, 0xCF + beq _0808E80E + cmp r1, 0xD0 + beq _0808E80E + cmp r1, 0xD1 + beq _0808E80E + cmp r1, 0xD2 + beq _0808E80E + cmp r1, 0xD3 + beq _0808E80E + cmp r1, 0xD4 + beq _0808E80E + cmp r1, 0xD5 + beq _0808E80E + cmp r1, 0xD6 + beq _0808E80E + cmp r1, 0xD7 + beq _0808E80E + cmp r1, 0xD8 + beq _0808E80E + cmp r1, 0xD9 + beq _0808E80E + cmp r1, 0xDA + beq _0808E80E + cmp r1, 0xDB + beq _0808E80E + cmp r1, 0xDC + beq _0808E80E + cmp r1, 0xDD + beq _0808E80E + cmp r1, 0xDE + beq _0808E80E + cmp r1, 0xDF + beq _0808E80E + cmp r1, 0xE0 + beq _0808E80E + cmp r1, 0xE1 + beq _0808E80E + cmp r1, 0xE2 + beq _0808E80E + ldr r0, _0808E814 + cmp r1, r0 + beq _0808E80E + movs r0, 0xD0 + lsls r0, 1 + cmp r1, r0 + bne _0808E818 +_0808E80E: + movs r0, 0xC9 + b _0808E854 + .align 2, 0 +_0808E814: .4byte 0x0000019f +_0808E818: + ldr r0, _0808E82C + cmp r1, r0 + beq _0808E836 + movs r0, 0xD1 + lsls r0, 1 + cmp r1, r0 + bne _0808E830 + subs r0, 0x4 + b _0808E854 + .align 2, 0 +_0808E82C: .4byte 0x000001a1 +_0808E830: + ldr r0, _0808E83C + cmp r1, r0 + bne _0808E840 +_0808E836: + movs r0, 0xCF + lsls r0, 1 + b _0808E854 + .align 2, 0 +_0808E83C: .4byte 0x000001a3 +_0808E840: + ldr r0, _0808E84C + cmp r1, r0 + beq _0808E850 + adds r0, r1, 0 + b _0808E854 + .align 2, 0 +_0808E84C: .4byte 0x000001a7 +_0808E850: + movs r0, 0xCE + lsls r0, 1 +_0808E854: + pop {r1} + bx r1 + thumb_func_end sub_808E770 + + thumb_func_start sub_808E858 +sub_808E858: + push {lr} + lsls r0, 16 + asrs r1, r0, 16 + adds r2, r1, 0 + ldr r0, _0808E874 + cmp r1, r0 + beq _0808E87E + movs r0, 0xBD + lsls r0, 1 + cmp r1, r0 + bne _0808E878 + subs r0, 0x2 + b _0808E8C4 + .align 2, 0 +_0808E874: .4byte 0x00000179 +_0808E878: + ldr r0, _0808E884 + cmp r1, r0 + bne _0808E888 +_0808E87E: + movs r0, 0xBC + lsls r0, 1 + b _0808E8C4 + .align 2, 0 +_0808E884: .4byte 0x0000017b +_0808E888: + ldr r0, _0808E89C + cmp r1, r0 + beq _0808E8A6 + movs r0, 0xD1 + lsls r0, 1 + cmp r1, r0 + bne _0808E8A0 + subs r0, 0x4 + b _0808E8C4 + .align 2, 0 +_0808E89C: .4byte 0x000001a1 +_0808E8A0: + ldr r0, _0808E8AC + cmp r1, r0 + bne _0808E8B0 +_0808E8A6: + movs r0, 0xCF + lsls r0, 1 + b _0808E8C4 + .align 2, 0 +_0808E8AC: .4byte 0x000001a3 +_0808E8B0: + ldr r0, _0808E8BC + cmp r2, r0 + beq _0808E8C0 + adds r0, r2, 0 + b _0808E8C4 + .align 2, 0 +_0808E8BC: .4byte 0x000001a7 +_0808E8C0: + movs r0, 0xCE + lsls r0, 1 +_0808E8C4: + pop {r1} + bx r1 + thumb_func_end sub_808E858 + + thumb_func_start sub_808E8C8 +sub_808E8C8: + push {lr} + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0xCA + bne _0808E8D6 + movs r0, 0x1 + b _0808E9B2 +_0808E8D6: + cmp r1, 0xCB + bne _0808E8DE + movs r0, 0x2 + b _0808E9B2 +_0808E8DE: + cmp r1, 0xCC + bne _0808E8E6 + movs r0, 0x3 + b _0808E9B2 +_0808E8E6: + cmp r1, 0xCD + bne _0808E8EE + movs r0, 0x4 + b _0808E9B2 +_0808E8EE: + cmp r1, 0xCE + bne _0808E8F6 + movs r0, 0x5 + b _0808E9B2 +_0808E8F6: + cmp r1, 0xCF + bne _0808E8FE + movs r0, 0x6 + b _0808E9B2 +_0808E8FE: + cmp r1, 0xD0 + bne _0808E906 + movs r0, 0x7 + b _0808E9B2 +_0808E906: + cmp r1, 0xD1 + bne _0808E90E + movs r0, 0x8 + b _0808E9B2 +_0808E90E: + cmp r1, 0xD2 + bne _0808E916 + movs r0, 0x9 + b _0808E9B2 +_0808E916: + cmp r1, 0xD3 + bne _0808E91E + movs r0, 0xA + b _0808E9B2 +_0808E91E: + cmp r1, 0xD4 + bne _0808E926 + movs r0, 0xB + b _0808E9B2 +_0808E926: + cmp r1, 0xD5 + bne _0808E92E + movs r0, 0xC + b _0808E9B2 +_0808E92E: + cmp r1, 0xD6 + bne _0808E936 + movs r0, 0xD + b _0808E9B2 +_0808E936: + cmp r1, 0xD7 + bne _0808E93E + movs r0, 0xE + b _0808E9B2 +_0808E93E: + cmp r1, 0xD8 + bne _0808E946 + movs r0, 0xF + b _0808E9B2 +_0808E946: + cmp r1, 0xD9 + bne _0808E94E + movs r0, 0x10 + b _0808E9B2 +_0808E94E: + cmp r1, 0xDA + bne _0808E956 + movs r0, 0x11 + b _0808E9B2 +_0808E956: + cmp r1, 0xDB + bne _0808E95E + movs r0, 0x12 + b _0808E9B2 +_0808E95E: + cmp r1, 0xDC + bne _0808E966 + movs r0, 0x13 + b _0808E9B2 +_0808E966: + cmp r1, 0xDD + bne _0808E96E + movs r0, 0x14 + b _0808E9B2 +_0808E96E: + cmp r1, 0xDE + bne _0808E976 + movs r0, 0x15 + b _0808E9B2 +_0808E976: + cmp r1, 0xDF + bne _0808E97E + movs r0, 0x16 + b _0808E9B2 +_0808E97E: + cmp r1, 0xE0 + bne _0808E986 + movs r0, 0x17 + b _0808E9B2 +_0808E986: + cmp r1, 0xE1 + bne _0808E98E + movs r0, 0x18 + b _0808E9B2 +_0808E98E: + cmp r1, 0xE2 + bne _0808E996 + movs r0, 0x19 + b _0808E9B2 +_0808E996: + ldr r0, _0808E9A0 + cmp r1, r0 + bne _0808E9A4 + movs r0, 0x1A + b _0808E9B2 + .align 2, 0 +_0808E9A0: .4byte 0x0000019f +_0808E9A4: + movs r0, 0xD0 + lsls r0, 1 + cmp r1, r0 + beq _0808E9B0 + movs r0, 0 + b _0808E9B2 +_0808E9B0: + movs r0, 0x1B +_0808E9B2: + pop {r1} + bx r1 + thumb_func_end sub_808E8C8 + + thumb_func_start sub_808E9B8 +sub_808E9B8: + ldrh r1, [r0] + ldr r0, _0808E9C0 + ands r0, r1 + bx lr + .align 2, 0 +_0808E9C0: .4byte 0x000001ff + thumb_func_end sub_808E9B8 + + thumb_func_start sub_808E9C4 +sub_808E9C4: + lsls r1, 16 + asrs r1, 16 + ldrh r3, [r0] + movs r2, 0xFE + lsls r2, 8 + ands r2, r3 + orrs r2, r1 + strh r2, [r0] + bx lr + thumb_func_end sub_808E9C4 + + thumb_func_start sub_808E9D8 +sub_808E9D8: + lsls r2, 16 + asrs r2, 16 + lsls r1, 9 + orrs r2, r1 + strh r2, [r0] + bx lr + thumb_func_end sub_808E9D8 + + thumb_func_start sub_808E9E4 +sub_808E9E4: + ldrh r0, [r0] + lsrs r0, 9 + bx lr + thumb_func_end sub_808E9E4 + + thumb_func_start sub_808E9EC +sub_808E9EC: + push {r4-r6,lr} + adds r3, r1, 0 + ldrb r2, [r0, 0x18] + str r2, [r3] + ldrb r1, [r0, 0x19] + str r1, [r3, 0x4] + ldrb r1, [r0, 0x1A] + str r1, [r3, 0x8] + ldrb r1, [r0, 0x1B] + str r1, [r3, 0xC] + movs r1, 0 + strb r1, [r3, 0x10] + strb r1, [r3, 0x11] + strb r1, [r3, 0x12] + strb r1, [r3, 0x13] + adds r1, r0, 0 + adds r1, 0x28 + ldrb r0, [r1] + cmp r0, 0 + beq _0808EA96 + adds r4, r0, 0 + adds r5, r4, 0 + cmp r4, 0x13 + bne _0808EA2A + ldr r1, _0808EA9C + ldrh r0, [r1] + strb r0, [r3, 0x10] + movs r6, 0 + ldrsh r0, [r1, r6] + adds r0, r2, r0 + str r0, [r3] +_0808EA2A: + cmp r4, 0x21 + bne _0808EA42 + ldr r1, _0808EAA0 + ldrb r0, [r1] + ldrb r2, [r3, 0x11] + adds r0, r2 + strb r0, [r3, 0x11] + movs r6, 0 + ldrsh r1, [r1, r6] + ldr r0, [r3, 0x4] + adds r0, r1 + str r0, [r3, 0x4] +_0808EA42: + cmp r4, 0x2B + bne _0808EA66 + ldr r2, _0808EAA4 + ldrb r0, [r2] + ldrb r6, [r3, 0x10] + adds r1, r0, r6 + strb r1, [r3, 0x10] + ldrb r1, [r3, 0x11] + adds r0, r1 + strb r0, [r3, 0x11] + movs r6, 0 + ldrsh r1, [r2, r6] + ldr r0, [r3] + adds r0, r1 + str r0, [r3] + ldr r0, [r3, 0x4] + adds r0, r1 + str r0, [r3, 0x4] +_0808EA66: + cmp r4, 0x1E + bne _0808EA7E + ldr r1, _0808EAA8 + ldrb r0, [r1] + ldrb r2, [r3, 0x12] + adds r0, r2 + strb r0, [r3, 0x12] + movs r6, 0 + ldrsh r1, [r1, r6] + ldr r0, [r3, 0x8] + adds r0, r1 + str r0, [r3, 0x8] +_0808EA7E: + cmp r5, 0x22 + bne _0808EA96 + ldr r1, _0808EAAC + ldrb r0, [r1] + ldrb r2, [r3, 0x13] + adds r0, r2 + strb r0, [r3, 0x13] + movs r6, 0 + ldrsh r1, [r1, r6] + ldr r0, [r3, 0xC] + adds r0, r1 + str r0, [r3, 0xC] +_0808EA96: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0808EA9C: .4byte gUnknown_810AC60 +_0808EAA0: .4byte gUnknown_810AC62 +_0808EAA4: .4byte gUnknown_810AC68 +_0808EAA8: .4byte gUnknown_810AC64 +_0808EAAC: .4byte gUnknown_810AC66 + thumb_func_end sub_808E9EC + + thumb_func_start sub_808EAB0 +sub_808EAB0: + lsls r0, 24 + ldr r1, _0808EABC + lsrs r0, 22 + adds r0, r1 + ldr r0, [r0] + bx lr + .align 2, 0 +_0808EABC: .4byte gUnknown_8112234 + thumb_func_end sub_808EAB0 + + thumb_func_start sub_808EAC0 +sub_808EAC0: + push {lr} + lsls r1, 24 + ldr r2, _0808EAD8 + lsrs r1, 22 + adds r1, r2 + ldr r1, [r1] + movs r2, 0x14 + bl strncpy + pop {r0} + bx r0 + .align 2, 0 +_0808EAD8: .4byte gUnknown_8112C14 + thumb_func_end sub_808EAC0 + + thumb_func_start sub_808EADC +sub_808EADC: + lsls r0, 24 + ldr r1, _0808EAE8 + lsrs r0, 22 + adds r0, r1 + ldr r0, [r0] + bx lr + .align 2, 0 +_0808EAE8: .4byte gUnknown_811240C + thumb_func_end sub_808EADC + + thumb_func_start sub_808EAEC +sub_808EAEC: + lsls r0, 24 + ldr r1, _0808EAF8 + lsrs r0, 22 + adds r0, r1 + ldr r0, [r0] + bx lr + .align 2, 0 +_0808EAF8: .4byte gUnknown_8112CFC + thumb_func_end sub_808EAEC + + thumb_func_start sub_808EAFC +sub_808EAFC: + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0808EB08 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_0808EB08: .4byte gUnknown_810A36B + thumb_func_end sub_808EAFC + + thumb_func_start sub_808EB0C +sub_808EB0C: + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0 + movs r3, 0 + ldr r1, _0808EB44 +_0808EB18: + movs r6, 0 + ldrsh r0, [r1, r6] + cmp r0, r5 + bgt _0808EB26 + adds r0, r4, r2 + strb r3, [r0] + adds r2, 0x1 +_0808EB26: + adds r1, 0x2 + adds r3, 0x1 + cmp r3, 0xB + ble _0808EB18 + cmp r2, 0xB + bgt _0808EB3E + movs r1, 0xB +_0808EB34: + adds r0, r4, r2 + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0xB + ble _0808EB34 +_0808EB3E: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0808EB44: .4byte gUnknown_810A378 + thumb_func_end sub_808EB0C + + thumb_func_start sub_808EB48 +sub_808EB48: + push {r4-r7,lr} + adds r4, r1, 0 + movs r6, 0x1 + movs r5, 0 + adds r2, r0, 0 + ldr r1, _0808EB64 + movs r3, 0xB +_0808EB56: + movs r7, 0 + ldrsh r0, [r1, r7] + cmp r0, r4 + bgt _0808EB68 + strb r6, [r2] + b _0808EB6A + .align 2, 0 +_0808EB64: .4byte gUnknown_810A378 +_0808EB68: + strb r5, [r2] +_0808EB6A: + adds r2, 0x1 + adds r1, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _0808EB56 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_808EB48 + + thumb_func_start sub_808EB7C +sub_808EB7C: + push {lr} + adds r2, r0, 0 + lsls r1, 24 + lsrs r1, 24 + cmp r1, 0 + bne _0808EB8C + movs r0, 0 + b _0808EB9E +_0808EB8C: + movs r3, 0 + ldr r0, _0808EBA4 + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] + cmp r0, r2 + bgt _0808EB9C + movs r3, 0x1 +_0808EB9C: + adds r0, r3, 0 +_0808EB9E: + pop {r1} + bx r1 + .align 2, 0 +_0808EBA4: .4byte gUnknown_810A390 + thumb_func_end sub_808EB7C + + thumb_func_start sub_808EBA8 +sub_808EBA8: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + mov r8, r1 + movs r6, 0 + movs r5, 0x1 +_0808EBB6: + lsls r0, r5, 24 + lsrs r4, r0, 24 + mov r0, r8 + adds r1, r4, 0 + bl sub_808EB7C + lsls r0, 24 + cmp r0, 0 + beq _0808EBCE + adds r0, r7, r6 + strb r4, [r0] + adds r6, 0x1 +_0808EBCE: + adds r5, 0x1 + cmp r5, 0x17 + ble _0808EBB6 + adds r1, r6, 0 + cmp r6, 0x17 + bgt _0808EBE6 + movs r2, 0 +_0808EBDC: + adds r0, r7, r1 + strb r2, [r0] + adds r1, 0x1 + cmp r1, 0x17 + ble _0808EBDC +_0808EBE6: + adds r0, r6, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_808EBA8 + + thumb_func_start sub_808EBF4 +sub_808EBF4: + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + movs r5, 0x1 + lsls r5, r6 + adds r1, r5, 0 + bl sub_808ECD0 + lsls r0, 24 + cmp r0, 0 + beq _0808EC22 + ldrb r0, [r4] + bics r0, r5 + strb r0, [r4] + asrs r1, r5, 8 + ldrb r0, [r4, 0x1] + bics r0, r1 + strb r0, [r4, 0x1] + asrs r1, r5, 16 + ldrb r0, [r4, 0x2] + bics r0, r1 + strb r0, [r4, 0x2] + b _0808EC2A +_0808EC22: + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_808EC30 +_0808EC2A: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_808EBF4 + + thumb_func_start sub_808EC30 +sub_808EC30: + push {r4-r7,lr} + adds r3, r0, 0 + adds r7, r1, 0 + movs r4, 0 + ldr r1, _0808EC90 + lsls r0, r7, 2 + adds r0, r1 + ldr r6, [r0] + adds r5, r1, 0 + movs r0, 0x1 + mov r12, r0 +_0808EC46: + ldr r0, [r5] + cmp r6, r0 + bne _0808EC66 + mov r1, r12 + lsls r1, r4 + ldrb r0, [r3] + bics r0, r1 + strb r0, [r3] + asrs r2, r1, 8 + ldrb r0, [r3, 0x1] + bics r0, r2 + strb r0, [r3, 0x1] + asrs r1, 16 + ldrb r0, [r3, 0x2] + bics r0, r1 + strb r0, [r3, 0x2] +_0808EC66: + adds r5, 0x4 + adds r4, 0x1 + cmp r4, 0x17 + ble _0808EC46 + movs r1, 0x1 + lsls r1, r7 + ldrb r2, [r3] + adds r0, r1, 0 + orrs r0, r2 + strb r0, [r3] + asrs r0, r1, 8 + ldrb r2, [r3, 0x1] + orrs r0, r2 + strb r0, [r3, 0x1] + asrs r1, 16 + ldrb r0, [r3, 0x2] + orrs r1, r0 + strb r1, [r3, 0x2] + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0808EC90: .4byte gUnknown_81076E4 + thumb_func_end sub_808EC30 + + thumb_func_start sub_808EC94 +sub_808EC94: + push {r4,r5,lr} + adds r5, r0, 0 + lsls r4, r1, 24 + lsrs r4, 24 + movs r0, 0 + strb r0, [r5] + strb r0, [r5, 0x1] + strb r0, [r5, 0x2] + adds r0, r5, 0 + movs r1, 0x2 + bl sub_808EC30 + adds r0, r5, 0 + movs r1, 0x3 + bl sub_808EC30 + adds r0, r5, 0 + movs r1, 0x16 + bl sub_808EC30 + cmp r4, 0 + beq _0808ECC8 + adds r0, r5, 0 + movs r1, 0x12 + bl sub_808EC30 +_0808ECC8: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_808EC94 + + thumb_func_start sub_808ECD0 +sub_808ECD0: + push {lr} + adds r2, r0, 0 + adds r3, r1, 0 + ldrb r0, [r2] + ands r0, r3 + cmp r0, 0 + bne _0808ECF6 + ldrb r0, [r2, 0x1] + lsrs r1, r3, 8 + ands r0, r1 + cmp r0, 0 + bne _0808ECF6 + ldrb r0, [r2, 0x2] + lsrs r1, r3, 16 + ands r0, r1 + cmp r0, 0 + bne _0808ECF6 + movs r0, 0 + b _0808ECF8 +_0808ECF6: + movs r0, 0x1 +_0808ECF8: + pop {r1} + bx r1 + thumb_func_end sub_808ECD0 + + thumb_func_start sub_808ECFC +sub_808ECFC: + movs r0, 0 + bx lr + thumb_func_end sub_808ECFC + + thumb_func_start sub_808ED00 +sub_808ED00: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + mov r0, sp + bl sub_808D580 + adds r6, r0, 0 + movs r4, 0 + cmp r4, r6 + bge _0808ED44 + movs r0, 0x58 + mov r8, r0 + mov r7, sp + movs r5, 0 + adds r4, r6, 0 +_0808ED20: + ldr r0, _0808ED70 + ldr r1, [r0] + adds r0, r1, r5 + ldr r2, _0808ED74 + adds r0, r2 + ldm r7!, {r2} + mov r3, r8 + muls r3, r2 + adds r2, r3, 0 + adds r1, r2 + movs r2, 0x58 + bl memcpy + adds r5, 0x58 + subs r4, 0x1 + cmp r4, 0 + bne _0808ED20 + adds r4, r6, 0 +_0808ED44: + cmp r4, 0x3 + bgt _0808ED64 + ldr r5, _0808ED70 + ldr r3, _0808ED74 + movs r2, 0 + movs r0, 0x58 + adds r1, r4, 0 + muls r1, r0 +_0808ED54: + ldr r0, [r5] + adds r0, r1 + adds r0, r3 + strh r2, [r0] + adds r1, 0x58 + adds r4, 0x1 + cmp r4, 0x3 + ble _0808ED54 +_0808ED64: + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0808ED70: .4byte gUnknown_203B45C +_0808ED74: .4byte 0x00008f88 + thumb_func_end sub_808ED00 + + thumb_func_start sub_808ED78 +sub_808ED78: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + adds r3, r0, 0 + adds r2, r1, 0 + add r4, sp, 0xC + adds r0, r4, 0 + adds r1, r3, 0 + bl sub_809486C + mov r10, r4 + mov r0, sp + adds r0, 0x1E + str r0, [sp, 0x20] + add r1, sp, 0x1C + mov r8, r1 + ldr r0, _0808EDF0 + adds r2, r0, 0 + mov r1, sp + movs r5, 0x5 +_0808EDA6: + ldrh r0, [r1] + orrs r0, r2 + strh r0, [r1] + adds r1, 0x2 + subs r5, 0x1 + cmp r5, 0 + bge _0808EDA6 + movs r0, 0x1 + negs r0, r0 + ldr r1, [sp, 0x20] + strh r0, [r1] + movs r5, 0 + mov r4, sp +_0808EDC0: + ldr r2, _0808EDF4 + movs r0, 0x58 + adds r1, r5, 0 + muls r1, r0 + ldr r0, [r2] + adds r1, r0, r1 + ldrh r2, [r1] + movs r0, 0x1 + ands r0, r2 + cmp r0, 0 + beq _0808EDF8 + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + beq _0808EDE2 + strh r5, [r4] + adds r4, 0x2 +_0808EDE2: + ldrb r0, [r1, 0x2] + cmp r0, 0 + beq _0808EDFA + ldr r0, [sp, 0x20] + strh r5, [r0] + b _0808EDFA + .align 2, 0 +_0808EDF0: .4byte 0x0000ffff +_0808EDF4: .4byte gUnknown_203B45C +_0808EDF8: + strb r0, [r1, 0x3] +_0808EDFA: + mov r0, r10 + bl sub_808EFA0 + adds r5, 0x1 + movs r0, 0xCE + lsls r0, 1 + cmp r5, r0 + ble _0808EDC0 + ldr r1, _0808EE34 + mov r9, r1 + mov r4, r10 + ldr r7, _0808EE38 + movs r6, 0 + movs r5, 0x3 +_0808EE16: + mov r1, r9 + ldr r0, [r1] + adds r0, r6, r0 + ldr r1, _0808EE38 + adds r0, r1 + ldrb r0, [r0] + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0808EE3C + movs r0, 0xFF + mov r1, r8 + strb r0, [r1] + b _0808EE40 + .align 2, 0 +_0808EE34: .4byte gUnknown_203B45C +_0808EE38: .4byte 0x00008f88 +_0808EE3C: + mov r0, r8 + strb r1, [r0] +_0808EE40: + adds r0, r4, 0 + mov r1, r8 + movs r2, 0x1 + bl sub_809488C + mov r0, r9 + ldr r1, [r0] + adds r1, r7 + adds r0, r4, 0 + bl sub_808EFA0 + adds r7, 0x58 + adds r6, 0x58 + subs r5, 0x1 + cmp r5, 0 + bge _0808EE16 + mov r4, sp + movs r5, 0x5 +_0808EE64: + mov r0, r10 + adds r1, r4, 0 + movs r2, 0x10 + bl sub_809488C + adds r4, 0x2 + subs r5, 0x1 + cmp r5, 0 + bge _0808EE64 + mov r0, r10 + ldr r1, [sp, 0x20] + movs r2, 0x10 + bl sub_809488C + mov r0, r10 + bl nullsub_102 + mov r1, r10 + ldr r0, [r1, 0x8] + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_808ED78 + + thumb_func_start sub_808EE9C +sub_808EE9C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + adds r3, r0, 0 + adds r2, r1, 0 + mov r0, sp + adds r1, r3, 0 + bl sub_809485C + movs r5, 0 + add r7, sp, 0x10 + movs r0, 0x12 + add r0, sp + mov r8, r0 + ldr r6, _0808EF10 + movs r4, 0 +_0808EEBE: + ldr r1, [r6] + adds r1, r4 + mov r0, sp + bl sub_808F068 + adds r4, 0x58 + adds r5, 0x1 + movs r0, 0xCE + lsls r0, 1 + cmp r5, r0 + ble _0808EEBE + movs r5, 0 + adds r6, r7, 0 + ldr r7, _0808EF10 +_0808EEDA: + mov r0, sp + adds r1, r6, 0 + movs r2, 0x1 + bl sub_8094924 + movs r0, 0x58 + adds r4, r5, 0 + muls r4, r0 + ldr r1, _0808EF14 + adds r0, r4, r1 + ldr r1, [r7] + adds r1, r0 + mov r0, sp + bl sub_808F068 + ldrb r0, [r6] + movs r1, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0808EF18 + ldr r0, [r7] + adds r0, r4 + ldr r2, _0808EF14 + adds r0, r2 + movs r1, 0x3 + b _0808EF20 + .align 2, 0 +_0808EF10: .4byte gUnknown_203B45C +_0808EF14: .4byte 0x00008f88 +_0808EF18: + ldr r0, [r7] + adds r0, r4 + ldr r3, _0808EF98 + adds r0, r3 +_0808EF20: + strh r1, [r0] + adds r5, 0x1 + cmp r5, 0x3 + ble _0808EEDA + mov r4, r8 + movs r6, 0xCE + lsls r6, 1 + movs r5, 0x5 +_0808EF30: + mov r0, sp + adds r1, r4, 0 + movs r2, 0x10 + bl sub_8094924 + ldrh r0, [r4] + cmp r0, r6 + bhi _0808EF56 + ldr r0, _0808EF9C + ldr r2, [r0] + movs r0, 0 + ldrsh r1, [r4, r0] + movs r0, 0x58 + muls r0, r1 + adds r2, r0 + ldrh r1, [r2] + movs r0, 0x2 + orrs r0, r1 + strh r0, [r2] +_0808EF56: + subs r5, 0x1 + cmp r5, 0 + bge _0808EF30 + mov r0, sp + mov r1, r8 + movs r2, 0x10 + bl sub_8094924 + mov r2, r8 + ldrh r1, [r2] + movs r0, 0xCE + lsls r0, 1 + cmp r1, r0 + bhi _0808EF84 + ldr r0, _0808EF9C + ldr r1, [r0] + movs r3, 0 + ldrsh r2, [r2, r3] + movs r0, 0x58 + muls r0, r2 + adds r1, r0 + movs r0, 0x1 + strb r0, [r1, 0x2] +_0808EF84: + mov r0, sp + bl nullsub_102 + ldr r0, [sp, 0x8] + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0808EF98: .4byte 0x00008f88 +_0808EF9C: .4byte gUnknown_203B45C + thumb_func_end sub_808EE9C + + thumb_func_start sub_808EFA0 +sub_808EFA0: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r1, r5, 0x3 + movs r2, 0x7 + bl sub_809488C + adds r1, r5, 0 + adds r1, 0x8 + adds r0, r4, 0 + movs r2, 0x9 + bl sub_809488C + adds r1, r5, 0x4 + adds r0, r4, 0 + bl sub_80902F4 + adds r1, r5, 0 + adds r1, 0xC + adds r0, r4, 0 + bl sub_808F41C + adds r1, r5, 0 + adds r1, 0x10 + adds r0, r4, 0 + bl sub_808F41C + adds r1, r5, 0 + adds r1, 0x14 + adds r0, r4, 0 + movs r2, 0xA + bl sub_809488C + adds r1, r5, 0 + adds r1, 0x16 + adds r0, r4, 0 + movs r2, 0xA + bl sub_809488C + adds r1, r5, 0 + adds r1, 0x18 + adds r0, r4, 0 + movs r2, 0x8 + bl sub_809488C + adds r1, r5, 0 + adds r1, 0x19 + adds r0, r4, 0 + movs r2, 0x8 + bl sub_809488C + adds r1, r5, 0 + adds r1, 0x1A + adds r0, r4, 0 + movs r2, 0x8 + bl sub_809488C + adds r1, r5, 0 + adds r1, 0x1B + adds r0, r4, 0 + movs r2, 0x8 + bl sub_809488C + adds r1, r5, 0 + adds r1, 0x1C + adds r0, r4, 0 + movs r2, 0x18 + bl sub_809488C + adds r1, r5, 0 + adds r1, 0x20 + adds r0, r4, 0 + movs r2, 0x18 + bl sub_809488C + adds r1, r5, 0 + adds r1, 0x24 + adds r0, r4, 0 + movs r2, 0x4 + bl sub_809488C + adds r1, r5, 0 + adds r1, 0x28 + adds r0, r4, 0 + bl sub_8091DE0 + adds r1, r5, 0 + adds r1, 0x2C + adds r0, r4, 0 + bl sub_8094108 + adds r1, r5, 0 + adds r1, 0x4C + adds r0, r4, 0 + movs r2, 0x50 + bl sub_809488C + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_808EFA0 + + thumb_func_start sub_808F068 +sub_808F068: + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x58 + bl memset + movs r6, 0 + movs r0, 0 + strh r0, [r4] + strb r6, [r4, 0x2] + adds r1, r4, 0x3 + adds r0, r5, 0 + movs r2, 0x7 + bl sub_8094924 + ldrb r0, [r4, 0x3] + cmp r0, 0 + beq _0808F098 + ldrh r0, [r4] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r4] +_0808F098: + adds r1, r4, 0 + adds r1, 0x8 + adds r0, r5, 0 + movs r2, 0x9 + bl sub_8094924 + adds r1, r4, 0x4 + adds r0, r5, 0 + bl sub_8090314 + adds r1, r4, 0 + adds r1, 0xC + adds r0, r5, 0 + bl sub_808F410 + adds r1, r4, 0 + adds r1, 0x10 + adds r0, r5, 0 + bl sub_808F410 + adds r1, r4, 0 + adds r1, 0x14 + adds r0, r5, 0 + movs r2, 0xA + bl sub_8094924 + adds r1, r4, 0 + adds r1, 0x16 + adds r0, r5, 0 + movs r2, 0xA + bl sub_8094924 + adds r1, r4, 0 + adds r1, 0x18 + adds r0, r5, 0 + movs r2, 0x8 + bl sub_8094924 + adds r1, r4, 0 + adds r1, 0x19 + adds r0, r5, 0 + movs r2, 0x8 + bl sub_8094924 + adds r1, r4, 0 + adds r1, 0x1A + adds r0, r5, 0 + movs r2, 0x8 + bl sub_8094924 + adds r1, r4, 0 + adds r1, 0x1B + adds r0, r5, 0 + movs r2, 0x8 + bl sub_8094924 + adds r1, r4, 0 + adds r1, 0x1C + adds r0, r5, 0 + movs r2, 0x18 + bl sub_8094924 + adds r1, r4, 0 + adds r1, 0x20 + adds r0, r5, 0 + movs r2, 0x18 + bl sub_8094924 + adds r1, r4, 0 + adds r1, 0x24 + adds r0, r5, 0 + movs r2, 0x4 + bl sub_8094924 + adds r1, r4, 0 + adds r1, 0x28 + adds r0, r5, 0 + bl sub_8091DC0 + adds r1, r4, 0 + adds r1, 0x2C + adds r0, r5, 0 + bl sub_8094128 + adds r1, r4, 0 + adds r1, 0x4C + adds r0, r5, 0 + movs r2, 0x50 + bl sub_8094924 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_808F068 + + thumb_func_start sub_808F154 +sub_808F154: + push {r4-r7,lr} + sub sp, 0x14 + adds r3, r0, 0 + adds r2, r1, 0 + mov r0, sp + adds r1, r3, 0 + bl sub_809486C + add r2, sp, 0x10 + movs r0, 0xFF + strb r0, [r2] + mov r1, sp + adds r1, 0x11 + movs r0, 0 + strb r0, [r1] + movs r5, 0 + adds r6, r2, 0 + adds r7, r1, 0 +_0808F178: + ldr r1, _0808F2A8 + movs r0, 0x64 + muls r0, r5 + ldr r2, _0808F2AC + adds r0, r2 + ldr r1, [r1] + adds r4, r1, r0 + mov r0, sp + adds r1, r4, 0 + movs r2, 0x2 + bl sub_809488C + ldrb r0, [r4, 0x2] + adds r1, r7, 0 + cmp r0, 0 + beq _0808F19A + adds r1, r6, 0 +_0808F19A: + mov r0, sp + movs r2, 0x1 + bl sub_809488C + adds r1, r4, 0x3 + mov r0, sp + movs r2, 0x7 + bl sub_809488C + adds r1, r4, 0x4 + mov r0, sp + bl sub_80902F4 + adds r1, r4, 0 + adds r1, 0x8 + mov r0, sp + movs r2, 0xA + bl sub_809488C + adds r1, r4, 0 + adds r1, 0xA + mov r0, sp + movs r2, 0x10 + bl sub_809488C + adds r1, r4, 0 + adds r1, 0xC + mov r0, sp + movs r2, 0x10 + bl sub_809488C + adds r1, r4, 0 + adds r1, 0xE + mov r0, sp + movs r2, 0x9 + bl sub_809488C + adds r1, r4, 0 + adds r1, 0x10 + mov r0, sp + movs r2, 0xA + bl sub_809488C + adds r1, r4, 0 + adds r1, 0x12 + mov r0, sp + movs r2, 0xA + bl sub_809488C + adds r1, r4, 0 + adds r1, 0x14 + mov r0, sp + movs r2, 0x8 + bl sub_809488C + adds r1, r4, 0 + adds r1, 0x15 + mov r0, sp + movs r2, 0x8 + bl sub_809488C + adds r1, r4, 0 + adds r1, 0x16 + mov r0, sp + movs r2, 0x8 + bl sub_809488C + adds r1, r4, 0 + adds r1, 0x17 + mov r0, sp + movs r2, 0x8 + bl sub_809488C + adds r1, r4, 0 + adds r1, 0x18 + mov r0, sp + movs r2, 0x18 + bl sub_809488C + adds r1, r4, 0 + adds r1, 0x1C + mov r0, sp + bl sub_8094184 + adds r1, r4, 0 + adds r1, 0x40 + mov r0, sp + bl sub_8091E28 + adds r1, r4, 0 + adds r1, 0x44 + mov r0, sp + bl sub_809449C + adds r1, r4, 0 + adds r1, 0x48 + mov r0, sp + bl sub_809449C + adds r1, r4, 0 + adds r1, 0x4C + mov r0, sp + movs r2, 0x18 + bl sub_809488C + adds r1, r4, 0 + adds r1, 0x50 + mov r0, sp + movs r2, 0x4 + bl sub_809488C + adds r1, r4, 0 + adds r1, 0x54 + mov r0, sp + bl sub_808F448 + adds r1, r4, 0 + adds r1, 0x58 + mov r0, sp + movs r2, 0x50 + bl sub_809488C + adds r5, 0x1 + cmp r5, 0x3 + bgt _0808F296 + b _0808F178 +_0808F296: + mov r0, sp + bl nullsub_102 + ldr r0, [sp, 0x8] + add sp, 0x14 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0808F2A8: .4byte gUnknown_203B45C +_0808F2AC: .4byte 0x00008df8 + thumb_func_end sub_808F154 + + thumb_func_start sub_808F2B0 +sub_808F2B0: + push {r4-r6,lr} + sub sp, 0x14 + adds r3, r0, 0 + adds r2, r1, 0 + mov r0, sp + adds r1, r3, 0 + bl sub_809485C + movs r5, 0 + add r6, sp, 0x10 +_0808F2C4: + ldr r1, _0808F300 + movs r0, 0x64 + muls r0, r5 + ldr r2, _0808F304 + adds r0, r2 + ldr r1, [r1] + adds r4, r1, r0 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x64 + bl memset + mov r0, sp + adds r1, r4, 0 + movs r2, 0x2 + bl sub_8094924 + mov r0, sp + adds r1, r6, 0 + movs r2, 0x1 + bl sub_8094924 + ldrb r0, [r6] + movs r2, 0x1 + adds r1, r2, 0 + ands r1, r0 + cmp r1, 0 + beq _0808F308 + strb r2, [r4, 0x2] + b _0808F30A + .align 2, 0 +_0808F300: .4byte gUnknown_203B45C +_0808F304: .4byte 0x00008df8 +_0808F308: + strb r1, [r4, 0x2] +_0808F30A: + adds r1, r4, 0x3 + mov r0, sp + movs r2, 0x7 + bl sub_8094924 + adds r1, r4, 0x4 + mov r0, sp + bl sub_8090314 + adds r1, r4, 0 + adds r1, 0x8 + mov r0, sp + movs r2, 0xA + bl sub_8094924 + adds r1, r4, 0 + adds r1, 0xA + mov r0, sp + movs r2, 0x10 + bl sub_8094924 + adds r1, r4, 0 + adds r1, 0xC + mov r0, sp + movs r2, 0x10 + bl sub_8094924 + adds r1, r4, 0 + adds r1, 0xE + mov r0, sp + movs r2, 0x9 + bl sub_8094924 + adds r1, r4, 0 + adds r1, 0x10 + mov r0, sp + movs r2, 0xA + bl sub_8094924 + adds r1, r4, 0 + adds r1, 0x12 + mov r0, sp + movs r2, 0xA + bl sub_8094924 + adds r1, r4, 0 + adds r1, 0x14 + mov r0, sp + movs r2, 0x8 + bl sub_8094924 + adds r1, r4, 0 + adds r1, 0x15 + mov r0, sp + movs r2, 0x8 + bl sub_8094924 + adds r1, r4, 0 + adds r1, 0x16 + mov r0, sp + movs r2, 0x8 + bl sub_8094924 + adds r1, r4, 0 + adds r1, 0x17 + mov r0, sp + movs r2, 0x8 + bl sub_8094924 + adds r1, r4, 0 + adds r1, 0x18 + mov r0, sp + movs r2, 0x18 + bl sub_8094924 + adds r1, r4, 0 + adds r1, 0x1C + mov r0, sp + bl sub_80941FC + adds r1, r4, 0 + adds r1, 0x40 + mov r0, sp + bl sub_8091E00 + adds r1, r4, 0 + adds r1, 0x44 + mov r0, sp + bl sub_809447C + adds r1, r4, 0 + adds r1, 0x48 + mov r0, sp + bl sub_809447C + adds r1, r4, 0 + adds r1, 0x4C + mov r0, sp + movs r2, 0x18 + bl sub_8094924 + adds r1, r4, 0 + adds r1, 0x50 + mov r0, sp + movs r2, 0x4 + bl sub_8094924 + adds r1, r4, 0 + adds r1, 0x54 + mov r0, sp + bl sub_808F428 + adds r1, r4, 0 + adds r1, 0x58 + mov r0, sp + movs r2, 0x50 + bl sub_8094924 + adds r5, 0x1 + cmp r5, 0x3 + bgt _0808F3FE + b _0808F2C4 +_0808F3FE: + mov r0, sp + bl nullsub_102 + ldr r0, [sp, 0x8] + add sp, 0x14 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_808F2B0 + + thumb_func_start sub_808F410 +sub_808F410: + push {lr} + movs r2, 0x7 + bl sub_8094924 + pop {r0} + bx r0 + thumb_func_end sub_808F410 + + thumb_func_start sub_808F41C +sub_808F41C: + push {lr} + movs r2, 0x7 + bl sub_809488C + pop {r0} + bx r0 + thumb_func_end sub_808F41C + + thumb_func_start sub_808F428 +sub_808F428: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r2, 0xA + bl sub_8094924 + adds r4, 0x2 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x5 + bl sub_8094924 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_808F428 + + thumb_func_start sub_808F448 +sub_808F448: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r2, 0xA + bl sub_809488C + adds r4, 0x2 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x5 + bl sub_809488C + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_808F448 + + thumb_func_start sub_808F468 +sub_808F468: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + mov r8, r0 + adds r4, r1, 0 + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0x14] + movs r0, 0 + strh r0, [r4, 0x4] + movs r0, 0x1 + str r0, [sp, 0x18] + add r7, sp, 0xC +_0808F488: + ldr r1, [sp, 0x18] + lsls r0, r1, 16 + asrs r0, 16 + cmp r0, 0x41 + bne _0808F49C + movs r0, 0x41 + adds r1, r7, 0 + bl sub_808DD48 + b _0808F4A2 +_0808F49C: + adds r1, r7, 0 + bl sub_808DD48 +_0808F4A2: + ldrh r0, [r7, 0x2] + cmp r0, 0 + beq _0808F4B6 + mov r2, r8 + movs r3, 0x8 + ldrsh r1, [r2, r3] + movs r2, 0 + ldrsh r0, [r7, r2] + cmp r1, r0 + beq _0808F4C2 +_0808F4B6: + ldr r3, [sp, 0x18] + adds r3, 0x1 + str r3, [sp, 0x18] + ldr r0, _0808F4D4 + cmp r3, r0 + ble _0808F488 +_0808F4C2: + movs r0, 0xD4 + lsls r0, 1 + ldr r1, [sp, 0x18] + cmp r1, r0 + bne _0808F4D8 + movs r0, 0x4 + strh r0, [r4, 0x4] + b _0808F6EC + .align 2, 0 +_0808F4D4: .4byte 0x000001a7 +_0808F4D8: + movs r2, 0x1 + str r2, [sp, 0x18] + movs r3, 0x8 + mov r10, r3 +_0808F4E0: + movs r0, 0 + mov r9, r0 + ldr r1, [sp, 0x18] + lsls r0, r1, 16 + asrs r0, 16 + str r0, [sp, 0x1C] + adds r1, r7, 0 + bl sub_808DD48 + ldrh r0, [r7, 0x2] + cmp r0, 0 + bne _0808F4FA + b _0808F6DE +_0808F4FA: + mov r2, r8 + movs r3, 0x8 + ldrsh r1, [r2, r3] + movs r2, 0 + ldrsh r0, [r7, r2] + cmp r1, r0 + beq _0808F50A + b _0808F6DE +_0808F50A: + ldr r0, [sp, 0x1C] + bl sub_808DBA8 + lsls r0, 24 + lsrs r5, r0, 24 + mov r3, r8 + movs r1, 0x8 + ldrsh r0, [r3, r1] + bl sub_808DBA8 + lsls r0, 24 + lsrs r6, r0, 24 + adds r0, r5, 0 + mov r1, sp + movs r2, 0 + movs r3, 0 + bl sub_8092638 + mov r0, sp + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _0808F544 + ldrh r0, [r4, 0x4] + movs r1, 0x20 + orrs r0, r1 + strh r0, [r4, 0x4] + movs r2, 0x1 + mov r9, r2 + b _0808F566 +_0808F544: + mov r0, sp + movs r3, 0x2 + ldrsh r1, [r0, r3] + cmp r5, r6 + bne _0808F550 + subs r1, 0x1 +_0808F550: + mov r0, sp + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, r1 + bgt _0808F566 + ldrh r0, [r4, 0x4] + movs r1, 0x40 + orrs r0, r1 + strh r0, [r4, 0x4] + movs r3, 0x1 + mov r9, r3 +_0808F566: + ldrh r0, [r7, 0x2] + cmp r0, 0x1 + bne _0808F588 + ldrh r2, [r4, 0x4] + ands r0, r2 + cmp r0, 0 + beq _0808F576 + b _0808F6DE +_0808F576: + mov r0, r8 + ldrb r1, [r0, 0x3] + movs r3, 0x4 + ldrsh r0, [r7, r3] + cmp r1, r0 + bge _0808F5E6 + movs r0, 0x2 + orrs r0, r2 + b _0808F5C8 +_0808F588: + cmp r0, 0x2 + bne _0808F5A8 + mov r2, r8 + movs r3, 0x14 + ldrsh r1, [r2, r3] + movs r2, 0x4 + ldrsh r0, [r7, r2] + cmp r1, r0 + bge _0808F5E6 + ldrh r0, [r4, 0x4] + movs r1, 0x10 + orrs r0, r1 + strh r0, [r4, 0x4] + movs r3, 0x1 + mov r9, r3 + b _0808F5E6 +_0808F5A8: + cmp r0, 0x3 + bne _0808F5E6 + ldr r0, [sp, 0x14] + cmp r0, 0 + beq _0808F5D0 + ldrb r0, [r4] + movs r2, 0x4 + ldrsh r1, [r7, r2] + cmp r0, r1 + beq _0808F5E6 + ldrb r0, [r4, 0x1] + cmp r0, r1 + beq _0808F5E6 + ldrh r0, [r4, 0x4] + mov r3, r10 + orrs r0, r3 +_0808F5C8: + strh r0, [r4, 0x4] + movs r0, 0x1 + mov r9, r0 + b _0808F5E6 +_0808F5D0: + ldrb r0, [r7, 0x4] + bl sub_8091130 + cmp r0, 0 + bge _0808F5E6 + ldrh r0, [r4, 0x4] + mov r1, r10 + orrs r0, r1 + strh r0, [r4, 0x4] + movs r2, 0x1 + mov r9, r2 +_0808F5E6: + ldrh r0, [r7, 0x6] + cmp r0, 0x4 + bne _0808F604 + ldr r3, [sp, 0x14] + cmp r3, 0 + beq _0808F600 + ldrb r0, [r4] + cmp r0, 0x76 + beq _0808F6CA + ldrb r0, [r4, 0x1] + cmp r0, 0x76 + beq _0808F6CA + b _0808F666 +_0808F600: + movs r0, 0x76 + b _0808F672 +_0808F604: + cmp r0, 0x5 + bne _0808F614 + mov r3, r8 + ldrb r0, [r3, 0x18] + ldrb r1, [r3, 0x1A] + cmp r0, r1 + bhi _0808F6CA + b _0808F6DE +_0808F614: + cmp r0, 0x6 + bne _0808F624 + mov r2, r8 + ldrb r0, [r2, 0x18] + ldrb r3, [r2, 0x1A] + cmp r0, r3 + bcc _0808F6CA + b _0808F6DE +_0808F624: + cmp r0, 0x7 + bne _0808F634 + mov r1, r8 + ldrb r0, [r1, 0x18] + ldrb r2, [r1, 0x1A] + cmp r0, r2 + beq _0808F6CA + b _0808F6DE +_0808F634: + cmp r0, 0x8 + bne _0808F650 + ldr r3, [sp, 0x14] + cmp r3, 0 + beq _0808F64C + ldrb r0, [r4] + cmp r0, 0x30 + beq _0808F6CA + ldrb r0, [r4, 0x1] + cmp r0, 0x30 + beq _0808F6CA + b _0808F666 +_0808F64C: + movs r0, 0x30 + b _0808F672 +_0808F650: + cmp r0, 0x9 + bne _0808F684 + ldr r3, [sp, 0x14] + cmp r3, 0 + beq _0808F670 + ldrb r0, [r4] + cmp r0, 0x31 + beq _0808F6CA + ldrb r0, [r4, 0x1] + cmp r0, 0x31 + beq _0808F6CA +_0808F666: + ldrh r0, [r4, 0x4] + mov r1, r10 + orrs r0, r1 + strh r0, [r4, 0x4] + b _0808F6DE +_0808F670: + movs r0, 0x31 +_0808F672: + bl sub_8091130 + cmp r0, 0 + bge _0808F6CA + ldrh r0, [r4, 0x4] + mov r2, r10 + orrs r0, r2 + strh r0, [r4, 0x4] + b _0808F6DE +_0808F684: + cmp r0, 0xB + bne _0808F694 + ldrb r1, [r4, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0808F6CA + b _0808F6DE +_0808F694: + cmp r0, 0xC + bne _0808F6A4 + ldrb r1, [r4, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0808F6CA + b _0808F6DE +_0808F6A4: + cmp r0, 0xA + bne _0808F6CA + ldr r3, [sp, 0x14] + cmp r3, 0 + beq _0808F6BC + ldrb r0, [r4] + cmp r0, 0x2F + beq _0808F6CA + ldrb r0, [r4, 0x1] + cmp r0, 0x2F + beq _0808F6CA + b _0808F6DE +_0808F6BC: + movs r0, 0x2F + bl sub_8091130 + cmp r0, 0 + bge _0808F6CA + movs r0, 0x1 + mov r9, r0 +_0808F6CA: + mov r1, r9 + cmp r1, 0 + bne _0808F6DE + ldrh r0, [r4, 0x4] + movs r1, 0x1 + orrs r0, r1 + strh r0, [r4, 0x4] + mov r2, sp + ldrh r2, [r2, 0x1C] + strh r2, [r4, 0x6] +_0808F6DE: + ldr r3, [sp, 0x18] + adds r3, 0x1 + str r3, [sp, 0x18] + ldr r0, _0808F6FC + cmp r3, r0 + bgt _0808F6EC + b _0808F4E0 +_0808F6EC: + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0808F6FC: .4byte 0x000001a7 + thumb_func_end sub_808F468 + + thumb_func_start sub_808F700 +sub_808F700: + push {r4,lr} + sub sp, 0x8 + mov r4, sp + mov r1, sp + movs r2, 0 + bl sub_808F468 + ldrh r1, [r4, 0x4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0808F71C + movs r0, 0x1 + b _0808F72A +_0808F71C: + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _0808F728 + movs r0, 0 + b _0808F72A +_0808F728: + movs r0, 0x2 +_0808F72A: + add sp, 0x8 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_808F700 + + thumb_func_start sub_808F734 +sub_808F734: + push {r4-r7,lr} + sub sp, 0x58 + adds r5, r0, 0 + lsls r4, r1, 16 + asrs r4, 16 + movs r6, 0 + mov r0, sp + adds r1, r5, 0 + movs r2, 0x58 + bl memcpy + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_808F798 + adds r7, r0, 0 + movs r0, 0x9E + lsls r0, 1 + cmp r4, r0 + bne _0808F782 + mov r0, sp + strb r6, [r0, 0x2] + add r0, sp, 0x28 + strb r6, [r0] + add r4, sp, 0x4C + ldr r5, _0808F794 + adds r0, r5, 0 + bl sub_808D994 + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0xA + bl sub_8092310 + mov r0, sp + adds r1, r5, 0 + bl sub_808F798 + adds r6, r0, 0 +_0808F782: + cmp r6, 0 + beq _0808F78A + bl sub_8097848 +_0808F78A: + adds r0, r7, 0 + add sp, 0x58 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0808F794: .4byte 0x0000013d + thumb_func_end sub_808F734 + + thumb_func_start sub_808F798 +sub_808F798: + push {r4-r6,lr} + sub sp, 0xA4 + adds r4, r0, 0 + lsls r1, 16 + asrs r5, r1, 16 + mov r0, sp + adds r1, r4, 0 + movs r2, 0x58 + bl memcpy + mov r0, sp + movs r1, 0x8 + ldrsh r6, [r0, r1] + add r0, sp, 0x58 + mov r1, sp + ldrb r2, [r1, 0x3] + adds r1, r5, 0 + bl sub_808E010 + ldr r0, [sp, 0x58] + str r0, [sp, 0x1C] + movs r0, 0 + strh r0, [r4] + mov r0, sp + strh r5, [r0, 0x8] + ldrb r0, [r0, 0xC] + cmp r0, 0 + bne _0808F7DA + mov r0, sp + mov r1, sp + ldrb r1, [r1, 0x3] + strb r1, [r0, 0xC] + b _0808F7EA +_0808F7DA: + mov r0, sp + ldrb r0, [r0, 0x10] + cmp r0, 0 + bne _0808F7EA + mov r0, sp + mov r1, sp + ldrb r1, [r1, 0x3] + strb r1, [r0, 0x10] +_0808F7EA: + add r4, sp, 0x64 + adds r0, r6, 0 + bl sub_808D994 + adds r1, r0, 0 + adds r0, r4, 0 + bl sub_80922F4 + movs r2, 0 + b _0808F800 +_0808F7FE: + adds r2, 0x1 +_0808F800: + cmp r2, 0x9 + bgt _0808F816 + adds r1, r4, r2 + add r0, sp, 0x4C + adds r0, r2 + ldrb r1, [r1] + ldrb r0, [r0] + cmp r1, r0 + bne _0808F82E + cmp r1, 0 + bne _0808F7FE +_0808F816: + movs r0, 0x1 + cmp r0, 0 + beq _0808F82E + add r4, sp, 0x4C + adds r0, r5, 0 + bl sub_808D994 + adds r1, r0, 0 + adds r0, r4, 0 + movs r2, 0xA + bl sub_8092310 +_0808F82E: + mov r0, sp + bl sub_808D1DC + add sp, 0xA4 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_808F798 + + thumb_func_start sub_808F83C +sub_808F83C: + movs r0, 0 + strb r0, [r2] + bx lr + thumb_func_end sub_808F83C + + thumb_func_start sub_808F844 +sub_808F844: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x30 + adds r5, r0, 0 + adds r4, r1, 0 + mov r10, r2 + str r3, [sp, 0x2C] + ldr r0, [sp, 0x50] + bl sub_80073B8 + ldr r0, _0808F880 + mov r1, r10 + adds r1, 0x2 + movs r2, 0x14 + bl strncpy + movs r0, 0x20 + mov r9, r0 + cmp r5, 0x5 + bls _0808F874 + b _0808FED6 +_0808F874: + lsls r0, r5, 2 + ldr r1, _0808F884 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0808F880: .4byte gUnknown_202DF98 +_0808F884: .4byte _0808F888 + .align 2, 0 +_0808F888: + .4byte _0808FED6 + .4byte _0808FBF4 + .4byte _0808F8A0 + .4byte _0808FB44 + .4byte _0808FCB0 + .4byte _0808FDB0 +_0808F8A0: + lsls r0, r4, 3 + adds r0, 0x10 + ldr r2, _0808F998 + movs r5, 0 + str r5, [sp] + movs r1, 0 + ldr r3, [sp, 0x50] + bl sub_8014FF0 + ldr r4, _0808F99C + mov r1, r10 + ldr r0, [r1, 0x2C] + str r0, [r4] + ldr r0, [r1, 0x30] + str r0, [r4, 0x4] + ldr r0, _0808F9A0 + ldr r2, [r0] + str r5, [sp] + movs r0, 0x4 + mov r1, r9 + ldr r3, [sp, 0x50] + bl sub_8014FF0 + movs r2, 0xA + add r9, r2 + ldr r0, _0808F9A4 + ldr r2, [r0] + str r5, [sp] + movs r0, 0x4 + mov r1, r9 + ldr r3, [sp, 0x50] + bl sub_8014FF0 + movs r3, 0xA + add r9, r3 + mov r0, r10 + ldr r2, [r0, 0x2C] + cmp r2, 0x63 + bgt _0808F914 + movs r3, 0 + ldrsh r1, [r0, r3] + adds r2, 0x1 + add r0, sp, 0x8 + bl sub_808E010 + ldr r0, [sp, 0x8] + mov r2, r10 + ldr r1, [r2, 0x30] + subs r0, r1 + str r0, [r4] + ldr r0, _0808F9A8 + ldr r2, [r0] + str r5, [sp] + movs r0, 0x4 + mov r1, r9 + ldr r3, [sp, 0x50] + bl sub_8014FF0 +_0808F914: + movs r3, 0xC + add r9, r3 + mov r1, r10 + ldr r0, [r1, 0x24] + str r0, [r4] + ldr r0, [r1, 0x28] + str r0, [r4, 0x4] + ldr r0, _0808F9AC + ldr r2, [r0] + str r5, [sp] + movs r0, 0x4 + mov r1, r9 + ldr r3, [sp, 0x50] + bl sub_8014FF0 + movs r2, 0xA + add r9, r2 + ldr r0, _0808F9B0 + ldr r2, [r0] + str r5, [sp] + movs r0, 0x4 + mov r1, r9 + ldr r3, [sp, 0x50] + bl sub_8014FF0 + ldr r0, _0808F9B4 + ldr r2, [r0] + mov r0, r10 + adds r0, 0x34 + ldrb r3, [r0] + str r3, [r4] + mov r1, r10 + adds r1, 0x39 + ldrb r0, [r1] + cmp r0, 0 + beq _0808F964 + adds r0, r3, r0 + str r0, [r4] + ldr r0, _0808F9B8 + ldr r2, [r0] +_0808F964: + str r5, [sp] + movs r0, 0x4 + mov r1, r9 + ldr r3, [sp, 0x50] + bl sub_8014FF0 + mov r1, r10 + adds r1, 0x3B + ldrb r3, [r1] + cmp r3, 0 + beq _0808F9C0 + mov r0, r10 + adds r0, 0x36 + ldrb r0, [r0] + adds r1, r3, 0 + adds r0, r1 + str r0, [r4] + ldr r0, _0808F9BC + ldr r2, [r0] + str r5, [sp] + movs r0, 0x4 + mov r1, r9 + ldr r3, [sp, 0x50] + bl sub_8014FF0 + b _0808F9D8 + .align 2, 0 +_0808F998: .4byte gUnknown_8107754 +_0808F99C: .4byte gUnknown_202DE30 +_0808F9A0: .4byte gUnknown_810DD80 +_0808F9A4: .4byte gUnknown_810DD9C +_0808F9A8: .4byte gUnknown_810DDB8 +_0808F9AC: .4byte gUnknown_810DDD0 +_0808F9B0: .4byte gUnknown_810DDE4 +_0808F9B4: .4byte gUnknown_810DE0C +_0808F9B8: .4byte gUnknown_810DE20 +_0808F9BC: .4byte gUnknown_810DE4C +_0808F9C0: + mov r0, r10 + adds r0, 0x36 + ldrb r0, [r0] + str r0, [r4] + ldr r0, _0808FA44 + ldr r2, [r0] + str r3, [sp] + movs r0, 0x4 + mov r1, r9 + ldr r3, [sp, 0x50] + bl sub_8014FF0 +_0808F9D8: + movs r3, 0xA + add r9, r3 + ldr r0, _0808FA48 + ldr r2, [r0] + movs r5, 0 + str r5, [sp] + movs r0, 0x4 + mov r1, r9 + ldr r3, [sp, 0x50] + bl sub_8014FF0 + ldr r0, _0808FA4C + ldr r2, [r0] + ldr r4, _0808FA50 + mov r0, r10 + adds r0, 0x35 + ldrb r3, [r0] + str r3, [r4] + mov r1, r10 + adds r1, 0x3A + ldrb r0, [r1] + cmp r0, 0 + beq _0808FA0E + adds r0, r3, r0 + str r0, [r4] + ldr r0, _0808FA54 + ldr r2, [r0] +_0808FA0E: + str r5, [sp] + movs r0, 0x4 + mov r1, r9 + ldr r3, [sp, 0x50] + bl sub_8014FF0 + mov r1, r10 + adds r1, 0x3C + ldrb r3, [r1] + cmp r3, 0 + beq _0808FA5C + mov r0, r10 + adds r0, 0x37 + ldrb r0, [r0] + adds r1, r3, 0 + adds r0, r1 + str r0, [r4] + ldr r0, _0808FA58 + ldr r2, [r0] + str r5, [sp] + movs r0, 0x4 + mov r1, r9 + ldr r3, [sp, 0x50] + bl sub_8014FF0 + b _0808FA74 + .align 2, 0 +_0808FA44: .4byte gUnknown_810DE38 +_0808FA48: .4byte gUnknown_810DDFC +_0808FA4C: .4byte gUnknown_810DE24 +_0808FA50: .4byte gUnknown_202DE30 +_0808FA54: .4byte gUnknown_810DE28 +_0808FA58: .4byte gUnknown_810DE54 +_0808FA5C: + mov r0, r10 + adds r0, 0x37 + ldrb r0, [r0] + str r0, [r4] + ldr r0, _0808FA94 + ldr r2, [r0] + str r3, [sp] + movs r0, 0x4 + mov r1, r9 + ldr r3, [sp, 0x50] + bl sub_8014FF0 +_0808FA74: + movs r0, 0xA + add r9, r0 + mov r2, r10 + adds r2, 0x20 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0808FA9C + ldr r0, _0808FA98 + adds r1, r2, 0 + movs r2, 0 + bl sub_8090E14 + b _0808FAA6 + .align 2, 0 +_0808FA94: .4byte gUnknown_810DE50 +_0808FA98: .4byte gUnknown_202DE58 +_0808FA9C: + ldr r0, _0808FB24 + ldr r1, _0808FB28 + ldr r1, [r1] + bl strcpy +_0808FAA6: + ldr r0, _0808FB2C + ldr r2, [r0] + movs r4, 0 + str r4, [sp] + movs r0, 0x4 + mov r1, r9 + ldr r3, [sp, 0x50] + bl sub_8014FF0 + movs r1, 0xC + add r9, r1 + ldr r1, _0808FB30 + mov r2, r10 + movs r3, 0x3E + ldrsh r0, [r2, r3] + str r0, [r1] + movs r1, 0x3E + ldrsh r0, [r2, r1] + movs r1, 0xA + bl __divsi3 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _0808FADA + movs r0, 0 +_0808FADA: + cmp r0, 0x62 + ble _0808FAE0 + movs r0, 0x63 +_0808FAE0: + ldr r1, _0808FB34 + lsls r0, 2 + adds r0, r1 + ldr r5, _0808FB38 + ldr r1, [r0] + adds r0, r5, 0 + bl strcpy + ldr r0, _0808FB3C + ldr r2, [r0] + str r4, [sp] + movs r0, 0x4 + mov r1, r9 + ldr r3, [sp, 0x50] + bl sub_8014FF0 + movs r2, 0xA + add r9, r2 + mov r0, r10 + adds r0, 0x38 + ldrb r4, [r0] + cmp r4, 0 + beq _0808FB10 + b _0808FED6 +_0808FB10: + adds r0, 0x1C + ldrb r1, [r0] + adds r0, r5, 0 + bl sub_808EAC0 + ldr r0, _0808FB40 + ldr r2, [r0] + str r4, [sp] + b _0808FECC + .align 2, 0 +_0808FB24: .4byte gUnknown_202DE58 +_0808FB28: .4byte gUnknown_810DE58 +_0808FB2C: .4byte gUnknown_810DE6C +_0808FB30: .4byte gUnknown_202DE30 +_0808FB34: .4byte gUnknown_8115718 +_0808FB38: .4byte gUnknown_202DF98 +_0808FB3C: .4byte gUnknown_810DE80 +_0808FB40: .4byte gUnknown_810DE98 +_0808FB44: + lsls r0, r4, 3 + adds r0, 0x10 + ldr r2, _0808FBE8 + movs r4, 0 + str r4, [sp] + movs r1, 0 + ldr r3, [sp, 0x50] + bl sub_8014FF0 + ldr r2, _0808FBEC + str r4, [sp] + movs r0, 0x4 + mov r1, r9 + ldr r3, [sp, 0x50] + bl sub_8014FF0 + mov r3, r10 + ldrb r0, [r3, 0x16] + bl sub_8092344 + adds r2, r0, 0 + str r4, [sp] + movs r0, 0x38 + mov r1, r9 + ldr r3, [sp, 0x50] + bl sub_8014FF0 + mov r1, r10 + ldrb r0, [r1, 0x17] + cmp r0, 0 + beq _0808FB94 + bl sub_8092344 + adds r2, r0, 0 + str r4, [sp] + movs r0, 0x60 + mov r1, r9 + ldr r3, [sp, 0x50] + bl sub_8014FF0 +_0808FB94: + movs r2, 0xC + add r9, r2 + ldr r2, _0808FBF0 + str r4, [sp] + movs r0, 0x4 + mov r1, r9 + ldr r3, [sp, 0x50] + bl sub_8014FF0 + movs r3, 0xC + add r9, r3 + mov r1, r10 + ldrb r0, [r1, 0x18] + bl sub_8092390 + adds r2, r0, 0 + str r4, [sp] + movs r5, 0xB + str r5, [sp, 0x4] + movs r0, 0x4 + mov r1, r9 + ldr r3, [sp, 0x50] + bl sub_8015034 + movs r2, 0x21 + add r9, r2 + mov r3, r10 + ldrb r0, [r3, 0x19] + cmp r0, 0 + bne _0808FBD2 + b _0808FED6 +_0808FBD2: + bl sub_8092390 + adds r2, r0, 0 + str r4, [sp] + str r5, [sp, 0x4] + movs r0, 0x4 + mov r1, r9 + ldr r3, [sp, 0x50] + bl sub_8015034 + b _0808FED6 + .align 2, 0 +_0808FBE8: .4byte gUnknown_810775C +_0808FBEC: .4byte gUnknown_8107768 +_0808FBF0: .4byte gUnknown_8107770 +_0808FBF4: + lsls r0, r4, 3 + adds r0, 0x10 + ldr r1, _0808FC34 + ldr r2, [r1] + movs r1, 0 + str r1, [sp] + ldr r3, [sp, 0x50] + bl sub_8014FF0 + mov r0, r10 + adds r0, 0x56 + movs r1, 0 + ldrsh r0, [r0, r1] + subs r5, r0, 0x1 + movs r2, 0xC + negs r2, r2 + add r9, r2 + movs r7, 0 + ldr r6, [sp, 0x2C] + adds r6, 0xC + adds r1, r6, 0 + movs r2, 0 + ldr r0, [sp, 0x2C] + adds r0, 0x2C +_0808FC24: + str r2, [r0] + subs r0, 0x4 + cmp r0, r1 + bge _0808FC24 + movs r3, 0 + mov r8, r3 + b _0808FC88 + .align 2, 0 +_0808FC34: .4byte gUnknown_810DD58 +_0808FC38: + mov r0, r10 + adds r0, 0x58 + adds r4, r0, r5 + ldrb r0, [r4] + cmp r0, 0 + beq _0808FC78 + movs r7, 0x1 + ldr r0, _0808FCA0 + ldrb r1, [r4] + lsls r1, 2 + adds r1, r0 + ldr r0, _0808FCA4 + ldr r1, [r1] + movs r2, 0x50 + bl strncpy + ldr r2, _0808FCA8 + movs r0, 0 + str r0, [sp] + movs r0, 0xC + mov r1, r9 + ldr r3, [sp, 0x50] + bl sub_8014FF0 + mov r0, r8 + cmp r0, 0 + ble _0808FC78 + subs r0, 0x1 + lsls r0, 2 + adds r0, r6, r0 + ldrb r1, [r4] + str r1, [r0] +_0808FC78: + movs r1, 0x1 + add r8, r1 + adds r5, 0x1 + movs r2, 0xC + add r9, r2 + mov r3, r8 + cmp r3, 0x9 + bgt _0808FC90 +_0808FC88: + cmp r5, 0 + blt _0808FC78 + cmp r5, 0xB + ble _0808FC38 +_0808FC90: + cmp r7, 0 + beq _0808FC96 + b _0808FED6 +_0808FC96: + ldr r0, _0808FCAC + ldr r2, [r0] + str r7, [sp] + b _0808FD98 + .align 2, 0 +_0808FCA0: .4byte gUnknown_810CF1C +_0808FCA4: .4byte gUnknown_202DEA8 +_0808FCA8: .4byte gUnknown_8107784 +_0808FCAC: .4byte gUnknown_810DF78 +_0808FCB0: + lsls r0, r4, 3 + adds r0, 0x10 + ldr r1, _0808FCF8 + ldr r2, [r1] + movs r1, 0 + str r1, [sp] + ldr r3, [sp, 0x50] + bl sub_8014FF0 + add r4, sp, 0x14 + mov r0, r10 + movs r2, 0x3E + ldrsh r1, [r0, r2] + adds r0, r4, 0 + bl sub_808EBA8 + mov r0, r10 + adds r0, 0x40 + movs r3, 0 + ldrsh r0, [r0, r3] + subs r7, r0, 0x1 + mov r1, r9 + subs r1, 0xC + movs r2, 0 + ldr r0, [sp, 0x2C] + adds r0, 0x8 +_0808FCE4: + strb r2, [r0] + subs r0, 0x1 + ldr r3, [sp, 0x2C] + cmp r0, r3 + bge _0808FCE4 + mov r9, r1 + movs r4, 0 + mov r8, r4 + b _0808FD84 + .align 2, 0 +_0808FCF8: .4byte gUnknown_810DD68 +_0808FCFC: + mov r5, sp + adds r5, r7 + adds r5, 0x14 + ldrb r0, [r5] + cmp r0, 0 + beq _0808FD74 + movs r4, 0x1 + bl sub_808EAB0 + adds r1, r0, 0 + ldr r6, _0808FD3C + adds r0, r6, 0 + movs r2, 0x50 + bl strncpy + mov r0, r10 + adds r0, 0x50 + adds r1, r4, 0 + ldrb r5, [r5] + lsls r1, r5 + bl sub_808ECD0 + lsls r0, 24 + cmp r0, 0 + beq _0808FD44 + adds r0, r6, 0 + subs r0, 0x50 + ldr r1, _0808FD40 + bl strcpy + b _0808FD4E + .align 2, 0 +_0808FD3C: .4byte gUnknown_202DEA8 +_0808FD40: .4byte gUnknown_8107788 +_0808FD44: + adds r0, r6, 0 + subs r0, 0x50 + ldr r1, _0808FDA4 + bl strcpy +_0808FD4E: + mov r0, r8 + cmp r0, 0 + ble _0808FD64 + subs r0, 0x1 + ldr r1, [sp, 0x2C] + adds r0, r1, r0 + mov r1, sp + adds r1, r7 + adds r1, 0x14 + ldrb r1, [r1] + strb r1, [r0] +_0808FD64: + ldr r2, _0808FDA8 + movs r0, 0 + str r0, [sp] + movs r0, 0xC + mov r1, r9 + ldr r3, [sp, 0x50] + bl sub_8014FF0 +_0808FD74: + movs r2, 0x1 + add r8, r2 + adds r7, 0x1 + movs r3, 0xC + add r9, r3 + mov r0, r8 + cmp r0, 0x9 + bgt _0808FD8C +_0808FD84: + cmp r7, 0 + blt _0808FD74 + cmp r7, 0x17 + ble _0808FCFC +_0808FD8C: + cmp r4, 0 + beq _0808FD92 + b _0808FED6 +_0808FD92: + ldr r0, _0808FDAC + ldr r2, [r0] + str r4, [sp] +_0808FD98: + movs r0, 0xC + movs r1, 0x20 + ldr r3, [sp, 0x50] + bl sub_8014FF0 + b _0808FED6 + .align 2, 0 +_0808FDA4: .4byte gUnknown_810778C +_0808FDA8: .4byte gUnknown_8107790 +_0808FDAC: .4byte gUnknown_810DF84 +_0808FDB0: + lsls r0, r4, 3 + adds r0, 0x10 + ldr r2, _0808FEEC + movs r5, 0 + str r5, [sp] + movs r1, 0 + ldr r3, [sp, 0x50] + bl sub_8014FF0 + ldr r6, _0808FEF0 + mov r2, r10 + movs r3, 0 + ldrsh r1, [r2, r3] + adds r0, r6, 0 + bl sub_808D8BC + ldr r1, _0808FEF4 + mov r2, r10 + movs r3, 0 + ldrsh r0, [r2, r3] + str r0, [r1] + ldr r0, _0808FEF8 + ldr r2, [r0] + str r5, [sp] + movs r0, 0x4 + mov r1, r9 + ldr r3, [sp, 0x50] + bl sub_8014FF0 + movs r0, 0xA + add r9, r0 + mov r1, r10 + movs r2, 0 + ldrsh r0, [r1, r2] + bl sub_808DBA8 + lsls r0, 24 + lsrs r0, 24 + bl sub_8092524 + adds r1, r0, 0 + ldr r4, _0808FEFC + adds r0, r4, 0 + movs r2, 0x50 + bl strncpy + ldr r0, _0808FF00 + ldr r2, [r0] + str r5, [sp] + movs r0, 0x4 + mov r1, r9 + ldr r3, [sp, 0x50] + bl sub_8014FF0 + movs r3, 0xA + add r9, r3 + ldr r0, _0808FF04 + ldr r2, [r0] + str r5, [sp] + movs r0, 0x4 + mov r1, r9 + ldr r3, [sp, 0x50] + bl sub_8014FF0 + movs r0, 0xD + add r9, r0 + ldr r0, _0808FF08 + ldr r2, [r0] + str r5, [sp] + movs r0, 0x4 + mov r1, r9 + ldr r3, [sp, 0x50] + bl sub_8014FF0 + movs r1, 0xA + add r9, r1 + mov r1, r10 + adds r1, 0x1C + adds r0, r4, 0 + bl sub_8090208 + ldr r0, _0808FF0C + ldr r2, [r0] + str r5, [sp] + movs r0, 0x4 + mov r1, r9 + ldr r3, [sp, 0x50] + bl sub_8014FF0 + movs r2, 0xD + add r9, r2 + mov r3, r10 + movs r1, 0 + ldrsh r0, [r3, r1] + bl sub_808DAB4 + adds r1, r0, 0 + adds r0, r6, 0 + movs r2, 0x14 + bl strncpy + ldr r0, _0808FF10 + ldr r2, [r0] + str r5, [sp] + movs r0, 0x4 + mov r1, r9 + ldr r3, [sp, 0x50] + bl sub_8014FF0 + movs r2, 0xD + add r9, r2 + ldr r4, _0808FF14 + mov r3, r10 + movs r1, 0 + ldrsh r0, [r3, r1] + bl sub_808DACC + lsls r0, 24 + lsrs r0, 22 + adds r0, r4 + ldr r1, [r0] + adds r0, r6, 0 + bl strcpy + ldr r0, _0808FF18 + ldr r2, [r0] + str r5, [sp] + movs r0, 0x4 + mov r1, r9 + ldr r3, [sp, 0x50] + bl sub_8014FF0 + movs r2, 0xD + add r9, r2 + ldr r1, _0808FF1C + mov r0, r10 + adds r0, 0x4C + ldrb r0, [r0] + lsls r0, 2 + adds r0, r1 + ldr r2, [r0] + str r5, [sp] +_0808FECC: + movs r0, 0x4 + mov r1, r9 + ldr r3, [sp, 0x50] + bl sub_8014FF0 +_0808FED6: + ldr r0, [sp, 0x50] + bl sub_80073E0 + add sp, 0x30 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0808FEEC: .4byte gUnknown_8107798 +_0808FEF0: .4byte gUnknown_202DF98 +_0808FEF4: .4byte gUnknown_202DE30 +_0808FEF8: .4byte gUnknown_810DEB4 +_0808FEFC: .4byte gUnknown_202DE58 +_0808FF00: .4byte gUnknown_810DEC8 +_0808FF04: .4byte gUnknown_810DEDC +_0808FF08: .4byte gUnknown_810DFB4 +_0808FF0C: .4byte gUnknown_810DFC8 +_0808FF10: .4byte gUnknown_810DEF4 +_0808FF14: .4byte gUnknown_810E02C +_0808FF18: .4byte gUnknown_810DF98 +_0808FF1C: .4byte gUnknown_810DFCC + thumb_func_end sub_808F844 + + thumb_func_start sub_808FF20 +sub_808FF20: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r5, r0, 0 + adds r6, r1, 0 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + adds r0, r5, 0x2 + movs r2, 0 + bl sub_808D9AC + ldrh r0, [r6, 0x8] + strh r0, [r5] + movs r1, 0x16 + ldrsh r0, [r6, r1] + str r0, [r5, 0x24] + str r0, [r5, 0x28] + ldrb r0, [r6, 0x3] + str r0, [r5, 0x2C] + ldr r0, [r6, 0x1C] + str r0, [r5, 0x30] + movs r4, 0 +_0808FF50: + adds r1, r5, 0 + adds r1, 0x34 + adds r1, r4 + adds r0, r6, 0 + adds r0, 0x18 + adds r0, r4 + ldrb r0, [r0] + strb r0, [r1] + adds r1, r5, 0 + adds r1, 0x36 + adds r1, r4 + adds r0, r6, 0 + adds r0, 0x1A + adds r0, r4 + ldrb r0, [r0] + strb r0, [r1] + movs r7, 0x8 + ldrsh r0, [r6, r7] + adds r1, r4, 0 + bl sub_808DC68 + adds r1, r5, 0 + adds r1, 0x16 + adds r1, r4 + strb r0, [r1] + movs r1, 0x8 + ldrsh r0, [r6, r1] + adds r1, r4, 0 + bl sub_808DC84 + adds r1, r5, 0 + adds r1, 0x18 + adds r1, r4 + strb r0, [r1] + adds r4, 0x1 + cmp r4, 0x1 + ble _0808FF50 + ldrb r2, [r6, 0x2] + adds r1, r5, 0 + adds r1, 0x38 + movs r0, 0 + strb r2, [r1] + adds r2, r5, 0 + adds r2, 0x39 + strb r0, [r2] + adds r3, r5, 0 + adds r3, 0x3A + strb r0, [r3] + movs r7, 0x3B + adds r7, r5 + mov r12, r7 + strb r0, [r7] + movs r1, 0x3C + adds r1, r5 + mov r9, r1 + strb r0, [r1] + adds r0, r6, 0 + adds r0, 0x28 + ldrb r1, [r0] + adds r4, r0, 0 + cmp r1, 0 + beq _08090026 + cmp r1, 0x13 + bne _0808FFDA + ldr r0, _08090060 + ldrb r0, [r0] + ldrb r7, [r2] + adds r0, r7 + strb r0, [r2] +_0808FFDA: + ldrb r1, [r4] + cmp r1, 0x21 + bne _0808FFEA + ldr r0, _08090064 + ldrb r0, [r0] + ldrb r7, [r3] + adds r0, r7 + strb r0, [r3] +_0808FFEA: + cmp r1, 0x2B + bne _0808FFFE + ldr r0, _08090068 + ldrb r0, [r0] + ldrb r7, [r2] + adds r1, r0, r7 + strb r1, [r2] + ldrb r1, [r3] + adds r0, r1 + strb r0, [r3] +_0808FFFE: + ldrb r0, [r4] + cmp r0, 0x1E + bne _08090012 + ldr r0, _0809006C + ldrb r0, [r0] + mov r2, r12 + ldrb r2, [r2] + adds r0, r2 + mov r7, r12 + strb r0, [r7] +_08090012: + ldrb r0, [r4] + cmp r0, 0x22 + bne _08090026 + ldr r0, _08090070 + ldrb r0, [r0] + mov r1, r9 + ldrb r1, [r1] + adds r0, r1 + mov r2, r9 + strb r0, [r2] +_08090026: + adds r0, r6, 0 + adds r0, 0x24 + ldrb r1, [r0] + adds r0, r5, 0 + adds r0, 0x54 + strb r1, [r0] + subs r0, 0x34 + adds r1, r4, 0 + bl sub_8090B64 + ldrh r0, [r6, 0x14] + strh r0, [r5, 0x3E] + ldr r0, [r6, 0x4] + str r0, [r5, 0x1C] + ldr r0, [r6, 0xC] + str r0, [r5, 0x44] + ldr r0, [r6, 0x10] + str r0, [r5, 0x48] + ldr r0, [r6, 0x20] + str r0, [r5, 0x50] + mov r7, r8 + cmp r7, 0 + beq _08090074 + adds r0, r6, 0 + bl sub_808F700 + adds r1, r5, 0 + adds r1, 0x4C + b _0809007A + .align 2, 0 +_08090060: .4byte gUnknown_810AC60 +_08090064: .4byte gUnknown_810AC62 +_08090068: .4byte gUnknown_810AC68 +_0809006C: .4byte gUnknown_810AC64 +_08090070: .4byte gUnknown_810AC66 +_08090074: + adds r1, r5, 0 + adds r1, 0x4C + movs r0, 0x3 +_0809007A: + strb r0, [r1] + adds r1, r5, 0 + adds r1, 0x58 + movs r2, 0 + adds r0, r5, 0 + adds r0, 0x63 +_08090086: + strb r2, [r0] + subs r0, 0x1 + cmp r0, r1 + bge _08090086 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_808FF20 + + thumb_func_start sub_809009C +sub_809009C: + lsls r0, 24 + ldr r1, _080900A8 + lsrs r0, 21 + adds r0, r1 + ldr r0, [r0] + bx lr + .align 2, 0 +_080900A8: .4byte gUnknown_8111A28 + thumb_func_end sub_809009C + + thumb_func_start sub_80900AC +sub_80900AC: + lsls r0, 24 + ldr r1, _080900BC + lsrs r0, 21 + adds r1, 0x4 + adds r0, r1 + ldr r0, [r0] + bx lr + .align 2, 0 +_080900BC: .4byte gUnknown_8111A28 + thumb_func_end sub_80900AC + + thumb_func_start sub_80900C0 +sub_80900C0: + lsls r0, 24 + ldr r1, _080900CC + lsrs r0, 20 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_080900CC: .4byte gUnknown_8109D30 + thumb_func_end sub_80900C0 + + thumb_func_start sub_80900D0 +sub_80900D0: + lsls r0, 24 + ldr r1, _080900E0 + lsrs r0, 20 + adds r0, r1 + movs r1, 0xC + ldrsh r0, [r0, r1] + bx lr + .align 2, 0 +_080900E0: .4byte gUnknown_8109D30 + thumb_func_end sub_80900D0 + + thumb_func_start sub_80900E4 +sub_80900E4: + lsls r0, 24 + ldr r1, _080900F0 + lsrs r0, 20 + adds r0, r1 + ldrb r0, [r0, 0xA] + bx lr + .align 2, 0 +_080900F0: .4byte gUnknown_8109D30 + thumb_func_end sub_80900E4 + + thumb_func_start sub_80900F4 +sub_80900F4: + lsls r0, 24 + ldr r1, _08090100 + lsrs r0, 20 + adds r0, r1 + ldrb r0, [r0, 0x9] + bx lr + .align 2, 0 +_08090100: .4byte gUnknown_8109D30 + thumb_func_end sub_80900F4 + + thumb_func_start sub_8090104 +sub_8090104: + lsls r0, 24 + ldr r1, _08090110 + lsrs r0, 20 + adds r0, r1 + ldrb r0, [r0, 0x6] + bx lr + .align 2, 0 +_08090110: .4byte gUnknown_8109D30 + thumb_func_end sub_8090104 + + thumb_func_start sub_8090114 +sub_8090114: + lsls r0, 24 + ldr r1, _08090120 + lsrs r0, 20 + adds r0, r1 + ldrb r0, [r0, 0x4] + bx lr + .align 2, 0 +_08090120: .4byte gUnknown_8109D30 + thumb_func_end sub_8090114 + + thumb_func_start sub_8090124 +sub_8090124: + lsls r0, 24 + ldr r1, _08090130 + lsrs r0, 20 + adds r0, r1 + ldrb r0, [r0, 0x7] + bx lr + .align 2, 0 +_08090130: .4byte gUnknown_8109D30 + thumb_func_end sub_8090124 + + thumb_func_start sub_8090134 +sub_8090134: + lsls r0, 24 + ldr r1, _08090144 + lsrs r0, 20 + adds r0, r1 + ldrb r0, [r0, 0x3] + lsls r0, 24 + asrs r0, 24 + bx lr + .align 2, 0 +_08090144: .4byte gUnknown_8109D30 + thumb_func_end sub_8090134 + + thumb_func_start sub_8090148 +sub_8090148: + lsls r0, 24 + ldr r1, _08090154 + lsrs r0, 20 + adds r0, r1 + ldrb r0, [r0, 0x2] + bx lr + .align 2, 0 +_08090154: .4byte gUnknown_8109D30 + thumb_func_end sub_8090148 + + thumb_func_start sub_8090158 +sub_8090158: + lsls r0, 24 + ldr r1, _08090164 + lsrs r0, 20 + adds r0, r1 + ldrb r0, [r0, 0x8] + bx lr + .align 2, 0 +_08090164: .4byte gUnknown_8109D30 + thumb_func_end sub_8090158 + + thumb_func_start sub_8090168 +sub_8090168: + lsls r0, 24 + ldr r1, _08090178 + lsrs r0, 20 + adds r0, r1 + movs r1, 0xE + ldrsh r0, [r0, r1] + bx lr + .align 2, 0 +_08090178: .4byte gUnknown_8109D30 + thumb_func_end sub_8090168 + + thumb_func_start sub_809017C +sub_809017C: + push {r4-r6,lr} + sub sp, 0x4 + adds r1, r0, 0 + mov r0, sp + bl sub_80901D8 + movs r5, 0 + ldr r2, _080901AC + ldrb r0, [r2] + cmp r0, 0x3F + beq _080901C6 + mov r3, sp + ldrb r6, [r3] + movs r4, 0 + adds r1, r2, 0 +_0809019A: + ldrb r0, [r1] + cmp r6, r0 + bne _080901B0 + ldrb r0, [r3, 0x1] + ldrb r2, [r1, 0x1] + cmp r0, r2 + bne _080901B0 + movs r0, 0x1 + b _080901C8 + .align 2, 0 +_080901AC: .4byte gUnknown_8107828 +_080901B0: + adds r4, 0x4 + adds r1, 0x4 + adds r5, 0x1 + ldr r0, _080901D0 + cmp r5, r0 + bgt _080901C6 + ldr r2, _080901D4 + adds r0, r4, r2 + ldrb r0, [r0] + cmp r0, 0x3F + bne _0809019A +_080901C6: + movs r0, 0 +_080901C8: + add sp, 0x4 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080901D0: .4byte 0x000003e6 +_080901D4: .4byte gUnknown_8107828 + thumb_func_end sub_809017C + + thumb_func_start sub_80901D8 +sub_80901D8: + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + ldrb r0, [r2] + subs r0, 0x4B + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x16 + bhi _080901FE + movs r0, 0x34 + strb r0, [r3] + ldrb r1, [r2] + subs r1, 0x4B + lsls r0, r1, 1 + adds r0, r1 + ldrb r2, [r2, 0x1] + adds r0, r2 + strb r0, [r3, 0x1] + b _08090202 +_080901FE: + ldr r0, [r2] + str r0, [r3] +_08090202: + pop {r0} + bx r0 + thumb_func_end sub_80901D8 + + thumb_func_start sub_8090208 +sub_8090208: + push {lr} + ldr r3, _08090220 + ldr r2, _08090224 + ldrb r1, [r1] + lsls r1, 3 + adds r1, r2 + ldr r2, [r1] + adds r1, r3, 0 + bl sub_800D158 + pop {r0} + bx r0 + .align 2, 0 +_08090220: .4byte gUnknown_8108F10 +_08090224: .4byte gUnknown_8111A28 + thumb_func_end sub_8090208 + + thumb_func_start sub_8090228 +sub_8090228: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + ldr r0, _08090250 + ldrb r3, [r4] + lsls r1, r3, 4 + adds r1, r0 + ldrb r0, [r1] + cmp r0, 0 + beq _0809025C + ldr r1, _08090254 + ldr r2, _08090258 + lsls r0, r3, 3 + adds r0, r2 + ldr r2, [r0] + ldrb r3, [r4, 0x1] + adds r0, r5, 0 + bl sub_800D158 + b _0809026E + .align 2, 0 +_08090250: .4byte gUnknown_8109D30 +_08090254: .4byte gUnknown_8108F18 +_08090258: .4byte gUnknown_8111A28 +_0809025C: + ldr r1, _08090274 + ldr r2, _08090278 + lsls r0, r3, 3 + adds r0, r2 + ldr r2, [r0] + ldrb r3, [r4, 0x1] + adds r0, r5, 0 + bl sub_800D158 +_0809026E: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08090274: .4byte gUnknown_8108F2C +_08090278: .4byte gUnknown_8111A28 + thumb_func_end sub_8090228 + + thumb_func_start sub_809027C +sub_809027C: + push {lr} + ldr r2, _08090294 + ldrb r1, [r1] + lsls r1, 3 + adds r1, r2 + ldr r1, [r1] + movs r2, 0x50 + bl strncpy + pop {r0} + bx r0 + .align 2, 0 +_08090294: .4byte gUnknown_8111A28 + thumb_func_end sub_809027C + + thumb_func_start sub_8090298 +sub_8090298: + push {lr} + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + subs r0, 0x4B + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x16 + bhi _080902AE + movs r0, 0x4 + b _080902C2 +_080902AE: + cmp r1, 0x3E + bhi _080902C0 + ldr r0, _080902BC + adds r0, r1, r0 + ldrb r0, [r0] + b _080902C2 + .align 2, 0 +_080902BC: .4byte gUnknown_81077A8 +_080902C0: + movs r0, 0x1 +_080902C2: + pop {r1} + bx r1 + thumb_func_end sub_8090298 + + thumb_func_start sub_80902C8 +sub_80902C8: + push {lr} + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + subs r0, 0x4B + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x16 + bls _080902EC + cmp r1, 0x3E + bhi _080902EC + ldr r0, _080902E8 + adds r0, r1, r0 + ldrb r0, [r0] + b _080902EE + .align 2, 0 +_080902E8: .4byte gUnknown_81077E8 +_080902EC: + movs r0, 0 +_080902EE: + pop {r1} + bx r1 + thumb_func_end sub_80902C8 + + thumb_func_start sub_80902F4 +sub_80902F4: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r2, 0x7 + bl sub_809488C + adds r4, 0x1 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x7 + bl sub_809488C + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80902F4 + + thumb_func_start sub_8090314 +sub_8090314: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r0, 0 + strb r0, [r4] + strb r0, [r4, 0x1] + adds r0, r5, 0 + movs r2, 0x7 + bl sub_8094924 + adds r4, 0x1 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x7 + bl sub_8094924 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8090314 + + thumb_func_start sub_809033C +sub_809033C: + lsls r0, 24 + ldr r1, _08090348 + lsrs r0, 20 + adds r0, r1 + ldrb r0, [r0, 0x1] + bx lr + .align 2, 0 +_08090348: .4byte gUnknown_8109D30 + thumb_func_end sub_809033C + + thumb_func_start sub_809034C +sub_809034C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xF8 + adds r7, r2, 0 + ldr r2, [sp, 0x118] + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r1, 16 + asrs r1, 16 + str r1, [sp, 0xE0] + lsls r3, 24 + lsrs r3, 24 + str r3, [sp, 0xE4] + lsls r2, 24 + lsrs r2, 24 + str r2, [sp, 0xE8] + bl sub_8090A34 + str r0, [sp, 0xEC] + movs r5, 0 + movs r0, 0 + str r0, [sp, 0xF4] + mov r8, r0 + add r4, sp, 0xC8 + movs r0, 0xA + strb r0, [r4] + add r1, sp, 0xF4 + ldrb r1, [r1] + strb r1, [r4, 0x1] + ldr r1, _0809040C + adds r0, r7, 0 + bl strcpy + movs r2, 0 + str r2, [sp, 0xF0] + movs r3, 0 + ldr r0, _08090410 + ldr r6, [r0] + movs r4, 0x1 +_080903A2: + movs r0, 0x58 + muls r0, r3 + adds r2, r6, r0 + ldrh r1, [r2] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _080903D0 + lsrs r0, r1, 1 + ands r0, r4 + cmp r0, 0 + beq _080903D0 + adds r0, r2, 0 + adds r0, 0x28 + ldrb r0, [r0] + cmp r0, 0 + beq _080903CA + ldr r0, [sp, 0xF0] + adds r0, 0x1 + str r0, [sp, 0xF0] +_080903CA: + adds r5, 0x1 + cmp r5, 0x4 + beq _080903DA +_080903D0: + adds r3, 0x1 + movs r0, 0xCE + lsls r0, 1 + cmp r3, r0 + ble _080903A2 +_080903DA: + ldr r0, _08090414 + mov r2, r9 + lsls r1, r2, 4 + adds r0, r1, r0 + ldrb r0, [r0, 0x5] + mov r9, r1 + ldr r1, [sp, 0xE4] + cmp r1, 0 + bne _080903F2 + cmp r0, 0x3 + ble _080903F2 + movs r0, 0x3 +_080903F2: + cmp r5, r0 + ble _0809043C + cmp r0, 0x1 + bne _0809041C + ldr r0, _08090418 + ldr r0, [r0] + mov r1, sp + add r2, sp, 0xC8 + movs r3, 0 + bl sub_8014BC4 + b _08090430 + .align 2, 0 +_0809040C: .4byte gUnknown_8108F40 +_08090410: .4byte gUnknown_203B45C +_08090414: .4byte gUnknown_8109D30 +_08090418: .4byte gUnknown_8115A2C +_0809041C: + ldr r1, _08090464 + subs r0, r5, r0 + str r0, [r1] + ldr r0, _08090468 + ldr r0, [r0] + mov r1, sp + add r2, sp, 0xC8 + movs r3, 0 + bl sub_8014BC4 +_08090430: + adds r0, r7, 0 + mov r1, sp + bl sub_8090888 + movs r2, 0x1 + mov r8, r2 +_0809043C: + ldr r0, _0809046C + mov r2, r9 + adds r1, r2, r0 + ldrb r0, [r1, 0x4] + cmp r0, 0 + beq _0809048E + ldr r1, [sp, 0xEC] + cmp r0, r1 + bge _0809048E + ldr r1, _08090464 + str r0, [r1] + ldr r2, [sp, 0xEC] + subs r0, r2, r0 + str r0, [r1, 0x4] + mov r0, r8 + cmp r0, 0 + bne _08090474 + ldr r0, _08090470 + b _08090476 + .align 2, 0 +_08090464: .4byte gUnknown_202DE30 +_08090468: .4byte gUnknown_81159DC +_0809046C: .4byte gUnknown_8109D30 +_08090470: .4byte gUnknown_8115A80 +_08090474: + ldr r0, _080904AC +_08090476: + ldr r0, [r0] + mov r1, sp + add r2, sp, 0xC8 + movs r3, 0 + bl sub_8014BC4 + adds r0, r7, 0 + mov r1, sp + bl sub_8090888 + movs r1, 0x1 + mov r8, r1 +_0809048E: + ldr r2, [sp, 0xE0] + cmp r2, 0 + beq _0809054E + ldr r0, _080904B0 + adds r1, r2, 0 + bl sub_808D908 + cmp r5, 0x3 + ble _080904D2 + mov r0, r8 + cmp r0, 0 + bne _080904B8 + ldr r0, _080904B4 + b _080904BA + .align 2, 0 +_080904AC: .4byte gUnknown_8115ADC +_080904B0: .4byte gUnknown_202DF98 +_080904B4: .4byte gUnknown_8115B3C +_080904B8: + ldr r0, _08090528 +_080904BA: + ldr r0, [r0] + mov r1, sp + add r2, sp, 0xC8 + movs r3, 0 + bl sub_8014BC4 + adds r0, r7, 0 + mov r1, sp + bl sub_8090888 + movs r1, 0x1 + mov r8, r1 +_080904D2: + ldr r0, [sp, 0xE0] + bl sub_808DACC + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r2, _0809052C + mov r10, r2 + movs r6, 0x1 +_080904E4: + movs r0, 0x58 + adds r1, r4, 0 + muls r1, r0 + mov r2, r10 + ldr r0, [r2] + adds r2, r0, r1 + ldrh r1, [r2] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _08090510 + lsrs r0, r1, 1 + ands r0, r6 + cmp r0, 0 + beq _08090510 + movs r1, 0x8 + ldrsh r0, [r2, r1] + bl sub_808DACC + lsls r0, 24 + lsrs r0, 24 + adds r5, r0 +_08090510: + adds r4, 0x1 + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + ble _080904E4 + cmp r5, 0x6 + ble _0809054E + mov r2, r8 + cmp r2, 0 + bne _08090534 + ldr r0, _08090530 + b _08090536 + .align 2, 0 +_08090528: .4byte gUnknown_8115BA4 +_0809052C: .4byte gUnknown_203B45C +_08090530: .4byte gUnknown_8115BF4 +_08090534: + ldr r0, _080905D0 +_08090536: + ldr r0, [r0] + mov r1, sp + add r2, sp, 0xC8 + movs r3, 0 + bl sub_8014BC4 + adds r0, r7, 0 + mov r1, sp + bl sub_8090888 + movs r0, 0x1 + mov r8, r0 +_0809054E: + ldr r1, [sp, 0xE4] + cmp r1, 0 + beq _08090602 + add r5, sp, 0xCC + ldr r1, _080905D4 + adds r0, r5, 0 + movs r2, 0x8 + bl memcpy + add r4, sp, 0xD4 + ldr r1, _080905D8 + adds r0, r4, 0 + movs r2, 0x4 + bl memcpy + movs r6, 0 + mov r10, r4 + ldr r0, _080905DC + add r0, r9 + ldrb r5, [r0, 0xB] + add r4, sp, 0xCC +_08090578: + adds r0, r5, 0 + asrs r0, r6 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0809059E + ldrh r0, [r4] + bl sub_8090820 + lsls r0, 24 + cmp r0, 0 + bne _0809059E + mov r2, r10 + adds r0, r2, r6 + ldrb r0, [r0] + bl sub_80911A4 + cmp r0, 0 + beq _080905A6 +_0809059E: + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0x3 + ble _08090578 +_080905A6: + cmp r6, 0x3 + bgt _08090602 + add r4, sp, 0xD8 + lsls r0, r6, 1 + add r0, sp + adds r0, 0xCC + ldrh r1, [r0] + adds r0, r4, 0 + bl sub_8092A88 + ldr r0, _080905E0 + adds r1, r4, 0 + movs r2, 0 + bl sub_80928C0 + mov r0, r8 + cmp r0, 0 + bne _080905E8 + ldr r0, _080905E4 + b _080905EA + .align 2, 0 +_080905D0: .4byte gUnknown_8115C4C +_080905D4: .4byte gUnknown_8108F42 +_080905D8: .4byte gUnknown_8108F4A +_080905DC: .4byte gUnknown_8109D30 +_080905E0: .4byte gUnknown_202DE58 +_080905E4: .4byte gUnknown_8115CB8 +_080905E8: + ldr r0, _080906A0 +_080905EA: + ldr r0, [r0] + mov r1, sp + add r2, sp, 0xC8 + movs r3, 0 + bl sub_8014BC4 + adds r0, r7, 0 + mov r1, sp + bl sub_8090888 + movs r1, 0x1 + mov r8, r1 +_08090602: + ldr r0, _080906A4 + add r0, r9 + ldrb r1, [r0, 0xB] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080906CE + ldr r5, _080906A8 + ldr r2, [sp, 0xE0] + cmp r2, 0 + beq _0809063A + adds r0, r2, 0 + movs r1, 0 + bl sub_808DC68 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + beq _08090638 + ldr r0, [sp, 0xE0] + movs r1, 0x1 + bl sub_808DC68 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bne _0809063A +_08090638: + movs r5, 0 +_0809063A: + ldr r0, _080906A8 + cmp r5, r0 + bne _080906CE + movs r5, 0 + movs r6, 0x1 +_08090644: + ldr r2, _080906AC + movs r0, 0x58 + adds r1, r5, 0 + muls r1, r0 + ldr r0, [r2] + adds r4, r0, r1 + ldrh r1, [r4] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _08090686 + lsrs r0, r1, 1 + ands r0, r6 + cmp r0, 0 + beq _08090686 + movs r1, 0x8 + ldrsh r0, [r4, r1] + movs r1, 0 + bl sub_808DC68 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + beq _08090690 + movs r2, 0x8 + ldrsh r0, [r4, r2] + movs r1, 0x1 + bl sub_808DC68 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + beq _08090690 +_08090686: + adds r5, 0x1 + movs r0, 0xCE + lsls r0, 1 + cmp r5, r0 + ble _08090644 +_08090690: + ldr r0, _080906A8 + cmp r5, r0 + bne _080906CE + mov r0, r8 + cmp r0, 0 + bne _080906B4 + ldr r0, _080906B0 + b _080906B6 + .align 2, 0 +_080906A0: .4byte gUnknown_8115D14 +_080906A4: .4byte gUnknown_8109D30 +_080906A8: .4byte 0x0000019d +_080906AC: .4byte gUnknown_203B45C +_080906B0: .4byte gUnknown_8115D5C +_080906B4: + ldr r0, _080906D8 +_080906B6: + ldr r0, [r0] + mov r1, sp + add r2, sp, 0xC8 + movs r3, 0 + bl sub_8014BC4 + adds r0, r7, 0 + mov r1, sp + bl sub_8090888 + movs r1, 0x1 + mov r8, r1 +_080906CE: + mov r2, r8 + cmp r2, 0 + beq _080906DC + movs r0, 0x1 + b _0809080E + .align 2, 0 +_080906D8: .4byte gUnknown_8115D94 +_080906DC: + ldr r0, _080907EC + add r0, r9 + ldrb r0, [r0, 0xA] + cmp r0, 0 + beq _080906EC + ldr r0, [sp, 0xE8] + cmp r0, 0 + beq _0809071A +_080906EC: + ldr r1, [sp, 0xF4] + cmp r1, 0 + bne _08090708 + ldr r0, _080907F0 + ldr r1, [r0] + adds r0, r7, 0 + bl strcpy + adds r0, r7, 0 + add r1, sp, 0xC8 + bl strcat + movs r2, 0x1 + str r2, [sp, 0xF4] +_08090708: + ldr r0, _080907F4 + ldr r1, [r0] + adds r0, r7, 0 + bl strcat + adds r0, r7, 0 + add r1, sp, 0xC8 + bl strcat +_0809071A: + ldr r0, _080907EC + add r0, r9 + ldrb r0, [r0, 0x6] + cmp r0, 0 + beq _08090752 + ldr r0, [sp, 0xF4] + cmp r0, 0 + bne _08090740 + ldr r0, _080907F0 + ldr r1, [r0] + adds r0, r7, 0 + bl strcpy + adds r0, r7, 0 + add r1, sp, 0xC8 + bl strcat + movs r1, 0x1 + str r1, [sp, 0xF4] +_08090740: + ldr r0, _080907F8 + ldr r1, [r0] + adds r0, r7, 0 + bl strcat + adds r0, r7, 0 + add r1, sp, 0xC8 + bl strcat +_08090752: + ldr r0, _080907EC + add r0, r9 + ldrb r0, [r0, 0x4] + cmp r0, 0 + bne _08090792 + ldr r2, [sp, 0xEC] + ldr r0, [sp, 0xF0] + cmn r2, r0 + beq _08090792 + ldr r1, [sp, 0xF4] + cmp r1, 0 + bne _08090780 + ldr r0, _080907F0 + ldr r1, [r0] + adds r0, r7, 0 + bl strcpy + adds r0, r7, 0 + add r1, sp, 0xC8 + bl strcat + movs r2, 0x1 + str r2, [sp, 0xF4] +_08090780: + ldr r0, _080907FC + ldr r1, [r0] + adds r0, r7, 0 + bl strcat + adds r0, r7, 0 + add r1, sp, 0xC8 + bl strcat +_08090792: + ldr r0, _080907EC + add r0, r9 + ldrb r0, [r0, 0x7] + cmp r0, 0 + bne _080907DA + ldr r0, _08090800 + ldr r0, [r0] + movs r1, 0x98 + lsls r1, 2 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + beq _080907DA + ldr r2, [sp, 0xF4] + cmp r2, 0 + bne _080907C8 + ldr r0, _080907F0 + ldr r1, [r0] + adds r0, r7, 0 + bl strcpy + adds r0, r7, 0 + add r1, sp, 0xC8 + bl strcat + movs r0, 0x1 + str r0, [sp, 0xF4] +_080907C8: + ldr r0, _08090804 + ldr r1, [r0] + adds r0, r7, 0 + bl strcat + adds r0, r7, 0 + add r1, sp, 0xC8 + bl strcat +_080907DA: + ldr r1, [sp, 0xF4] + cmp r1, 0 + bne _0809080C + ldr r1, _08090808 + adds r0, r7, 0 + bl sub_800D158 + movs r0, 0 + b _0809080E + .align 2, 0 +_080907EC: .4byte gUnknown_8109D30 +_080907F0: .4byte gUnknown_8115DD4 +_080907F4: .4byte gUnknown_8115E00 +_080907F8: .4byte gUnknown_8115E28 +_080907FC: .4byte gUnknown_8115E54 +_08090800: .4byte gUnknown_203B460 +_08090804: .4byte gUnknown_8115E80 +_08090808: .4byte gUnknown_8108F50 +_0809080C: + movs r0, 0x2 +_0809080E: + add sp, 0xF8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_809034C + + thumb_func_start sub_8090820 +sub_8090820: + push {r4-r7,lr} + lsls r0, 16 + lsrs r6, r0, 16 + movs r4, 0 + ldr r0, _08090868 + ldr r0, [r0] + mov r12, r0 + movs r7, 0x1 +_08090830: + movs r0, 0x58 + muls r0, r4 + mov r2, r12 + adds r1, r2, r0 + ldrh r2, [r1] + adds r0, r7, 0 + ands r0, r2 + cmp r0, 0 + beq _08090874 + lsrs r0, r2, 1 + ands r0, r7 + cmp r0, 0 + beq _08090874 + movs r3, 0 + movs r5, 0x1 + adds r2, r1, 0 + adds r2, 0x2C +_08090852: + ldrb r1, [r2] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _0809086C + ldrh r0, [r2, 0x2] + cmp r0, r6 + bne _0809086C + movs r0, 0x1 + b _08090880 + .align 2, 0 +_08090868: .4byte gUnknown_203B45C +_0809086C: + adds r2, 0x8 + adds r3, 0x1 + cmp r3, 0x3 + ble _08090852 +_08090874: + adds r4, 0x1 + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + ble _08090830 + movs r0, 0 +_08090880: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8090820 + + thumb_func_start sub_8090888 +sub_8090888: + push {r4-r7,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r6, 0 + b _0809089C +_08090892: + ldrb r0, [r4] + cmp r0, 0xA + bne _0809089A + adds r6, 0x1 +_0809089A: + adds r4, 0x1 +_0809089C: + ldrb r0, [r4] + cmp r0, 0 + bne _08090892 + ldrb r7, [r5] + b _080908AE +_080908A6: + movs r0, 0xA + strb r0, [r4] + adds r4, 0x1 + adds r6, 0x1 +_080908AE: + adds r0, r6, 0 + movs r1, 0x3 + bl __modsi3 + cmp r0, 0 + bne _080908A6 + adds r1, r7, 0 + lsls r0, r1, 24 + cmp r0, 0 + beq _080908CE +_080908C2: + strb r1, [r4] + adds r4, 0x1 + adds r5, 0x1 + ldrb r1, [r5] + cmp r1, 0 + bne _080908C2 +_080908CE: + movs r0, 0 + strb r0, [r4] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8090888 + + thumb_func_start sub_80908D8 +sub_80908D8: + push {lr} + adds r2, r0, 0 + ldrb r0, [r2] + cmp r0, 0x3E + bhi _08090908 + ldr r0, _08090900 + ldrb r3, [r2] + adds r0, r3, r0 + ldrb r1, [r2, 0x1] + ldrb r0, [r0] + cmp r1, r0 + bcs _08090908 + ldr r1, _08090904 + lsls r0, r3, 2 + adds r0, r1 + ldrb r1, [r2, 0x1] + ldr r0, [r0] + adds r0, r1 + ldrb r0, [r0] + b _0809090A + .align 2, 0 +_08090900: .4byte gUnknown_81077A8 +_08090904: .4byte gUnknown_8108084 +_08090908: + movs r0, 0x1 +_0809090A: + pop {r1} + bx r1 + thumb_func_end sub_80908D8 + + thumb_func_start sub_8090910 +sub_8090910: + push {r4-r7,lr} + adds r5, r0, 0 + adds r7, r1, 0 + ldr r4, _0809094C + adds r0, r4, 0 + bl RandomCapped + adds r6, r0, 0 + adds r0, r4, 0 + bl RandomCapped + adds r2, r0, 0 + ldrb r0, [r5] + cmp r0, 0x3E + bhi _08090954 + ldr r0, _08090950 + ldrb r1, [r5] + adds r1, r0 + ldrb r0, [r5, 0x1] + ldrb r1, [r1] + cmp r0, r1 + bcs _08090954 + adds r0, r7, 0 + adds r1, r6, 0 + bl sub_8091E94 + lsls r0, 24 + lsrs r0, 24 + b _08090956 + .align 2, 0 +_0809094C: .4byte 0x0000270f +_08090950: .4byte gUnknown_81077A8 +_08090954: + movs r0, 0x46 +_08090956: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8090910 + + thumb_func_start sub_809095C +sub_809095C: + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0x3E + bls _0809096A +_08090966: + movs r0, 0x1 + b _0809098C +_0809096A: + movs r2, 0 + ldr r0, _08090994 + ldrb r1, [r0] + adds r4, r0, 0 + cmp r1, 0x3F + beq _0809098A + adds r1, r4, 0 +_08090978: + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, r3 + beq _08090966 + adds r2, 0x1 + adds r0, r2, r4 + ldrb r0, [r0] + cmp r0, 0x3F + bne _08090978 +_0809098A: + movs r0, 0 +_0809098C: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08090994: .4byte gUnknown_810A350 + thumb_func_end sub_809095C + + thumb_func_start sub_8090998 +sub_8090998: + push {lr} + ldr r1, _080909B8 + ldr r0, _080909BC + str r0, [r1] + ldr r0, _080909C0 + ldr r1, _080909C4 + bl sub_800A9EC + ldr r1, _080909C8 + str r0, [r1] + ldr r1, _080909CC + ldr r0, [r0, 0x4] + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_080909B8: .4byte gUnknown_203B460 +_080909BC: .4byte gUnknown_20389A8 +_080909C0: .4byte gUnknown_8109764 +_080909C4: .4byte gUnknown_8300500 +_080909C8: .4byte gUnknown_20389A0 +_080909CC: .4byte gUnknown_20389A4 + thumb_func_end sub_8090998 + + thumb_func_start sub_80909D0 +sub_80909D0: + ldr r0, _080909D4 + bx lr + .align 2, 0 +_080909D4: .4byte gUnknown_20389A8 + thumb_func_end sub_80909D0 + + thumb_func_start sub_80909D8 +sub_80909D8: + push {r4,lr} + movs r4, 0 + ldr r3, _08090A30 + movs r2, 0 +_080909E0: + ldr r0, [r3] + lsls r1, r4, 2 + adds r0, r1 + strb r2, [r0] + adds r4, 0x1 + cmp r4, 0x13 + ble _080909E0 + movs r4, 0 + ldr r3, _08090A30 + movs r2, 0 +_080909F4: + ldr r0, [r3] + lsls r1, r4, 1 + adds r0, 0x50 + adds r0, r1 + strh r2, [r0] + adds r4, 0x1 + cmp r4, 0xEF + ble _080909F4 + movs r4, 0 +_08090A06: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8091840 + adds r4, 0x1 + cmp r4, 0x7 + ble _08090A06 + ldr r0, _08090A30 + ldr r2, [r0] + movs r1, 0x98 + lsls r1, 2 + adds r0, r2, r1 + movs r1, 0 + str r1, [r0] + movs r3, 0x99 + lsls r3, 2 + adds r0, r2, r3 + str r1, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08090A30: .4byte gUnknown_203B460 + thumb_func_end sub_80909D8 + + thumb_func_start sub_8090A34 +sub_8090A34: + push {r4,r5,lr} + movs r4, 0 + ldr r0, _08090A5C + movs r5, 0x1 + ldr r2, [r0] + movs r3, 0x13 +_08090A40: + ldrb r1, [r2] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _08090A4C + adds r4, 0x1 +_08090A4C: + adds r2, 0x4 + subs r3, 0x1 + cmp r3, 0 + bge _08090A40 + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08090A5C: .4byte gUnknown_203B460 + thumb_func_end sub_8090A34 + + thumb_func_start sub_8090A60 +sub_8090A60: + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_8090BD0 + lsls r0, 24 + cmp r0, 0 + beq _08090A84 + adds r0, r4, 0 + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + beq _08090A84 + movs r0, 0 + b _08090A86 +_08090A84: + movs r0, 0x1 +_08090A86: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8090A60 + + thumb_func_start sub_8090A8C +sub_8090A8C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + cmp r5, 0 + beq _08090AF8 + movs r7, 0x1 + strb r7, [r6] + strb r5, [r6, 0x2] + adds r0, r5, 0 + bl sub_8090A60 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _08090AD4 + adds r0, r5, 0 + movs r1, 0 + bl sub_8090D80 + adds r4, r0, 0 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_8090D80 + adds r1, r0, 0 + adds r0, r4, 0 + bl RandomRange + strb r0, [r6, 0x1] + b _08090AE8 +_08090AD4: + adds r0, r5, 0 + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6 + bne _08090AE6 + strb r7, [r6, 0x1] + b _08090AE8 +_08090AE6: + strb r4, [r6, 0x1] +_08090AE8: + mov r0, r8 + cmp r0, 0 + beq _08090AFE + ldrb r1, [r6] + movs r0, 0x8 + orrs r0, r1 + strb r0, [r6] + b _08090AFE +_08090AF8: + strb r5, [r6] + strb r5, [r6, 0x2] + strb r5, [r6, 0x1] +_08090AFE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8090A8C + + thumb_func_start sub_8090B08 +sub_8090B08: + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 24 + lsrs r5, r1, 24 + cmp r5, 0 + beq _08090B5A + strb r5, [r6] + adds r0, r5, 0 + bl sub_8090A60 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + beq _08090B42 + adds r0, r5, 0 + movs r1, 0 + bl sub_8090D80 + adds r4, r0, 0 + adds r0, r5, 0 + movs r1, 0x1 + bl sub_8090D80 + adds r1, r0, 0 + adds r0, r4, 0 + bl RandomRange + strb r0, [r6, 0x1] + b _08090B5E +_08090B42: + adds r0, r5, 0 + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6 + bne _08090B56 + movs r0, 0x1 + strb r0, [r6, 0x1] + b _08090B5E +_08090B56: + strb r4, [r6, 0x1] + b _08090B5E +_08090B5A: + strb r5, [r6] + strb r5, [r6, 0x1] +_08090B5E: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8090B08 + + thumb_func_start sub_8090B64 +sub_8090B64: + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + ldrb r1, [r5] + adds r0, r1, 0 + cmp r0, 0 + beq _08090BA4 + movs r0, 0x1 + strb r0, [r4] + strb r1, [r4, 0x2] + ldrb r0, [r4, 0x2] + bl sub_8090A60 + lsls r0, 24 + lsrs r6, r0, 24 + cmp r6, 0 + bne _08090B9A + ldrb r0, [r4, 0x2] + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6 + beq _08090B9A + ldrb r0, [r4, 0x2] + cmp r0, 0x7C + bne _08090BA0 +_08090B9A: + ldrb r0, [r5, 0x1] + strb r0, [r4, 0x1] + b _08090BAA +_08090BA0: + strb r6, [r4, 0x1] + b _08090BAA +_08090BA4: + strb r0, [r4, 0x2] + strb r0, [r4, 0x1] + strb r0, [r4] +_08090BAA: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8090B64 + + thumb_func_start sub_8090BB0 +sub_8090BB0: + push {lr} + adds r3, r0, 0 + ldrb r0, [r1] + movs r2, 0x1 + ands r2, r0 + cmp r2, 0 + beq _08090BC8 + ldrb r0, [r1, 0x2] + strb r0, [r3] + ldrb r0, [r1, 0x1] + strb r0, [r3, 0x1] + b _08090BCA +_08090BC8: + strb r2, [r3] +_08090BCA: + pop {r0} + bx r0 + thumb_func_end sub_8090BB0 + + thumb_func_start sub_8090BD0 +sub_8090BD0: + lsls r0, 24 + ldr r1, _08090BE0 + ldr r1, [r1] + lsrs r0, 19 + adds r0, r1 + ldrb r0, [r0, 0xC] + bx lr + .align 2, 0 +_08090BE0: .4byte gUnknown_20389A4 + thumb_func_end sub_8090BD0 + + thumb_func_start sub_8090BE4 +sub_8090BE4: + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0x2] + cmp r0, 0x69 + bne _08090BF6 + adds r0, r4, 0 + bl sub_80915D4 + b _08090C24 +_08090BF6: + ldrb r0, [r4, 0x2] + bl sub_8090A60 + lsls r0, 24 + cmp r0, 0 + bne _08090C14 + ldrb r0, [r4, 0x2] + ldr r1, _08090C10 + ldr r1, [r1] + lsls r0, 5 + adds r0, r1 + ldr r0, [r0, 0x4] + b _08090C24 + .align 2, 0 +_08090C10: .4byte gUnknown_20389A4 +_08090C14: + ldrb r0, [r4, 0x2] + ldr r1, _08090C2C + ldr r1, [r1] + lsls r0, 5 + adds r0, r1 + ldrb r1, [r4, 0x1] + ldr r0, [r0, 0x4] + muls r0, r1 +_08090C24: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08090C2C: .4byte gUnknown_20389A4 + thumb_func_end sub_8090BE4 + + thumb_func_start sub_8090C30 +sub_8090C30: + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0x2] + cmp r0, 0x69 + bne _08090C42 + adds r0, r4, 0 + bl sub_80915D4 + b _08090C70 +_08090C42: + ldrb r0, [r4, 0x2] + bl sub_8090A60 + lsls r0, 24 + cmp r0, 0 + bne _08090C60 + ldrb r0, [r4, 0x2] + ldr r1, _08090C5C + ldr r1, [r1] + lsls r0, 5 + adds r0, r1 + ldr r0, [r0, 0x8] + b _08090C70 + .align 2, 0 +_08090C5C: .4byte gUnknown_20389A4 +_08090C60: + ldrb r0, [r4, 0x2] + ldr r1, _08090C78 + ldr r1, [r1] + lsls r0, 5 + adds r0, r1 + ldrb r1, [r4, 0x1] + ldr r0, [r0, 0x8] + muls r0, r1 +_08090C70: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08090C78: .4byte gUnknown_20389A4 + thumb_func_end sub_8090C30 + + thumb_func_start sub_8090C7C +sub_8090C7C: + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0x2] + bl sub_80914E4 + lsls r0, 24 + cmp r0, 0 + bne _08090C90 + movs r0, 0 + b _08090CC0 +_08090C90: + ldrb r0, [r4, 0x2] + bl sub_8090A60 + lsls r0, 24 + cmp r0, 0 + bne _08090CB0 + ldrb r0, [r4, 0x2] + ldr r1, _08090CAC + ldr r1, [r1] + lsls r0, 5 + adds r0, r1 + ldr r0, [r0, 0x4] + b _08090CC0 + .align 2, 0 +_08090CAC: .4byte gUnknown_20389A4 +_08090CB0: + ldrb r0, [r4, 0x2] + ldr r1, _08090CC8 + ldr r1, [r1] + lsls r0, 5 + adds r0, r1 + ldrb r1, [r4, 0x1] + ldr r0, [r0, 0x4] + muls r0, r1 +_08090CC0: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08090CC8: .4byte gUnknown_20389A4 + thumb_func_end sub_8090C7C + + thumb_func_start sub_8090CCC +sub_8090CCC: + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0x2] + bl sub_80914E4 + lsls r0, 24 + cmp r0, 0 + bne _08090CE0 + movs r0, 0 + b _08090D10 +_08090CE0: + ldrb r0, [r4, 0x2] + bl sub_8090A60 + lsls r0, 24 + cmp r0, 0 + bne _08090D00 + ldrb r0, [r4, 0x2] + ldr r1, _08090CFC + ldr r1, [r1] + lsls r0, 5 + adds r0, r1 + ldr r0, [r0, 0x8] + b _08090D10 + .align 2, 0 +_08090CFC: .4byte gUnknown_20389A4 +_08090D00: + ldrb r0, [r4, 0x2] + ldr r1, _08090D18 + ldr r1, [r1] + lsls r0, 5 + adds r0, r1 + ldrb r1, [r4, 0x1] + ldr r0, [r0, 0x8] + muls r0, r1 +_08090D10: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08090D18: .4byte gUnknown_20389A4 + thumb_func_end sub_8090CCC + + thumb_func_start sub_8090D1C +sub_8090D1C: + lsls r0, 24 + ldr r1, _08090D2C + ldr r1, [r1] + lsrs r0, 19 + adds r0, r1 + ldr r0, [r0, 0x4] + bx lr + .align 2, 0 +_08090D2C: .4byte gUnknown_20389A4 + thumb_func_end sub_8090D1C + + thumb_func_start sub_8090D30 +sub_8090D30: + lsls r0, 24 + ldr r1, _08090D40 + ldr r1, [r1] + lsrs r0, 19 + adds r0, r1 + ldr r0, [r0, 0x8] + bx lr + .align 2, 0 +_08090D40: .4byte gUnknown_20389A4 + thumb_func_end sub_8090D30 + + thumb_func_start sub_8090D44 +sub_8090D44: + lsls r0, 24 + ldr r1, _08090D54 + ldr r1, [r1] + lsrs r0, 19 + adds r0, r1 + ldrb r0, [r0, 0x1A] + bx lr + .align 2, 0 +_08090D54: .4byte gUnknown_20389A4 + thumb_func_end sub_8090D44 + + thumb_func_start sub_8090D58 +sub_8090D58: + lsls r0, 24 + ldr r1, _08090D68 + ldr r1, [r1] + lsrs r0, 19 + adds r0, r1 + ldrb r0, [r0, 0x1D] + bx lr + .align 2, 0 +_08090D68: .4byte gUnknown_20389A4 + thumb_func_end sub_8090D58 + + thumb_func_start sub_8090D6C +sub_8090D6C: + lsls r0, 24 + ldr r1, _08090D7C + ldr r1, [r1] + lsrs r0, 19 + adds r0, r1 + ldrb r0, [r0, 0x1E] + bx lr + .align 2, 0 +_08090D7C: .4byte gUnknown_20389A4 + thumb_func_end sub_8090D6C + + thumb_func_start sub_8090D80 +sub_8090D80: + lsls r0, 24 + ldr r2, _08090D94 + ldr r2, [r2] + lsrs r0, 19 + adds r0, r2 + adds r0, 0x1B + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_08090D94: .4byte gUnknown_20389A4 + thumb_func_end sub_8090D80 + + thumb_func_start sub_8090D98 +sub_8090D98: + lsls r0, 24 + ldr r1, _08090DA8 + ldr r1, [r1] + lsrs r0, 19 + adds r0, r1 + ldr r0, [r0, 0x10] + bx lr + .align 2, 0 +_08090DA8: .4byte gUnknown_20389A4 + thumb_func_end sub_8090D98 + + thumb_func_start sub_8090DAC +sub_8090DAC: + lsls r0, 24 + ldr r2, _08090DC0 + ldr r2, [r2] + lsrs r0, 19 + adds r0, r2 + adds r0, 0x14 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_08090DC0: .4byte gUnknown_20389A4 + thumb_func_end sub_8090DAC + + thumb_func_start sub_8090DC4 +sub_8090DC4: + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x54 + adds r6, r0, 0 + adds r4, r1, 0 + mov r8, r2 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _08090E10 + ldr r1, [r0] + lsls r0, r4, 5 + adds r0, r1 + ldr r1, [r0] + mov r0, sp + movs r2, 0x50 + bl strncpy + add r5, sp, 0x50 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0 + bl sub_8090A8C + movs r0, 0x1 + strb r0, [r5, 0x1] + adds r0, r6, 0 + mov r1, sp + adds r2, r5, 0 + mov r3, r8 + bl sub_8090F58 + add sp, 0x54 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08090E10: .4byte gUnknown_20389A4 + thumb_func_end sub_8090DC4 + + thumb_func_start sub_8090E14 +sub_8090E14: + push {r4-r7,lr} + sub sp, 0x50 + adds r6, r0, 0 + adds r5, r1, 0 + adds r7, r2, 0 + movs r4, 0 + cmp r7, 0 + beq _08090E2C + ldrb r1, [r7, 0x8] + negs r0, r1 + orrs r0, r1 + lsrs r4, r0, 31 +_08090E2C: + ldrb r0, [r5, 0x2] + bl sub_8090BD0 + lsls r0, 24 + cmp r0, 0 + bne _08090E3E + cmp r4, 0 + bne _08090E50 + b _08090E70 +_08090E3E: + ldrb r0, [r5, 0x2] + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08090E90 + cmp r4, 0 + beq _08090E70 +_08090E50: + ldr r1, _08090E68 + ldrb r0, [r5, 0x2] + ldr r2, _08090E6C + ldr r2, [r2] + lsls r0, 5 + adds r0, r2 + ldr r2, [r0] + ldrb r3, [r5, 0x1] + mov r0, sp + bl sub_800D158 + b _08090EC4 + .align 2, 0 +_08090E68: .4byte gUnknown_8109770 +_08090E6C: .4byte gUnknown_20389A4 +_08090E70: + ldr r1, _08090E88 + ldrb r0, [r5, 0x2] + ldr r2, _08090E8C + ldr r2, [r2] + lsls r0, 5 + adds r0, r2 + ldr r2, [r0] + mov r0, sp + bl sub_800D158 + b _08090EC4 + .align 2, 0 +_08090E88: .4byte gUnknown_8109778 +_08090E8C: .4byte gUnknown_20389A4 +_08090E90: + ldrb r0, [r5, 0x2] + cmp r0, 0x69 + bne _08090EB0 + ldr r4, _08090EAC + adds r0, r5, 0 + bl sub_80915D4 + adds r2, r0, 0 + mov r0, sp + adds r1, r4, 0 + bl sub_800D158 + b _08090EC4 + .align 2, 0 +_08090EAC: .4byte gUnknown_810977C +_08090EB0: + ldrb r0, [r5, 0x2] + ldr r1, _08090F2C + ldr r1, [r1] + lsls r0, 5 + adds r0, r1 + ldr r1, [r0] + mov r0, sp + movs r2, 0x50 + bl strncpy +_08090EC4: + ldrb r1, [r5] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08090EE2 + ldr r1, _08090F30 + adds r0, r6, 0 + mov r2, sp + bl sub_800D158 + mov r0, sp + adds r1, r6, 0 + movs r2, 0x50 + bl strncpy +_08090EE2: + cmp r7, 0 + beq _08090F38 + ldrb r0, [r7, 0x4] + cmp r0, 0 + beq _08090F0A + ldrb r1, [r5] + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _08090F0A + ldr r1, _08090F34 + adds r0, r6, 0 + mov r2, sp + bl sub_800D158 + mov r0, sp + adds r1, r6, 0 + movs r2, 0x50 + bl strncpy +_08090F0A: + ldr r0, [r7] + cmp r0, 0x1 + beq _08090F14 + cmp r0, 0x3 + bne _08090F44 +_08090F14: + ldrb r1, [r5] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08090F38 + adds r0, r6, 0 + mov r1, sp + adds r2, r5, 0 + adds r3, r7, 0 + bl sub_8090F58 + b _08090F50 + .align 2, 0 +_08090F2C: .4byte gUnknown_20389A4 +_08090F30: .4byte gUnknown_8109784 +_08090F34: .4byte gUnknown_810978C +_08090F38: + adds r0, r6, 0 + mov r1, sp + movs r2, 0x50 + bl strncpy + b _08090F50 +_08090F44: + adds r0, r6, 0 + mov r1, sp + adds r2, r5, 0 + adds r3, r7, 0 + bl sub_8090F58 +_08090F50: + add sp, 0x50 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8090E14 + + thumb_func_start sub_8090F58 +sub_8090F58: + push {r4-r6,lr} + sub sp, 0x2C + adds r5, r0, 0 + adds r6, r1, 0 + adds r0, r2, 0 + adds r4, r3, 0 + cmp r4, 0 + bne _08090F6C + adds r0, r5, 0 + b _08090F94 +_08090F6C: + ldr r1, [r4] + cmp r1, 0x1 + bcc _08090F8A + cmp r1, 0x2 + bhi _08090F7E + bl sub_8090BE4 + adds r1, r0, 0 + b _08090F8C +_08090F7E: + cmp r1, 0x4 + bhi _08090F8A + bl sub_8090C30 + adds r1, r0, 0 + b _08090F8C +_08090F8A: + movs r1, 0 +_08090F8C: + cmp r1, 0 + bne _08090F9C + adds r0, r5, 0 + adds r1, r6, 0 +_08090F94: + movs r2, 0x50 + bl strncpy + b _08090FDE +_08090F9C: + movs r2, 0x6 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _08090FC8 + adds r0, r1, 0 + add r1, sp, 0x4 + movs r2, 0x1 + bl sub_8090FEC + ldr r1, _08090FC4 + movs r0, 0x6 + ldrsh r3, [r4, r0] + add r2, sp, 0x4 + str r2, [sp] + adds r0, r5, 0 + adds r2, r6, 0 + bl sub_800D158 + b _08090FDE + .align 2, 0 +_08090FC4: .4byte gUnknown_8109794 +_08090FC8: + adds r0, r1, 0 + add r1, sp, 0x4 + movs r2, 0 + bl sub_8090FEC + ldr r1, _08090FE8 + adds r0, r5, 0 + adds r2, r6, 0 + add r3, sp, 0x4 + bl sub_800D158 +_08090FDE: + add sp, 0x2C + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08090FE8: .4byte gUnknown_81097A4 + thumb_func_end sub_8090F58 + + thumb_func_start sub_8090FEC +sub_8090FEC: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r5, r0, 0 + adds r4, r1, 0 + lsls r2, 24 + lsrs r2, 24 + mov r10, r2 + movs r0, 0 + mov r8, r0 + movs r6, 0 + movs r2, 0 + ldr r1, _08091050 + mov r9, r1 + mov r12, r9 +_0809100E: + movs r1, 0 + lsls r3, r2, 2 + ldr r7, _08091054 + adds r0, r3, r7 + ldr r0, [r0] + adds r7, r2, 0x1 + cmp r5, r0 + blt _0809102C + ldr r2, _08091054 +_08091020: + adds r0, r3, r2 + ldr r0, [r0] + subs r5, r0 + adds r1, 0x1 + cmp r5, r0 + bge _08091020 +_0809102C: + cmp r1, 0x9 + ble _08091032 + movs r1, 0x9 +_08091032: + cmp r1, 0 + beq _0809105C + movs r0, 0x1 + mov r8, r0 + lsls r1, 1 + mov r2, r12 + adds r0, r1, r2 + ldrb r0, [r0] + strb r0, [r4] + adds r4, 0x1 + ldr r0, _08091058 + adds r1, r0 + ldrb r0, [r1] + b _0809106C + .align 2, 0 +_08091050: .4byte gUnknown_81097C4 +_08091054: .4byte gUnknown_81097B0 +_08091058: .4byte gUnknown_81097C5 +_0809105C: + mov r1, r8 + cmp r1, 0 + beq _08091074 + mov r2, r12 + ldrb r0, [r2] + strb r0, [r4] + adds r4, 0x1 + ldrb r0, [r2, 0x1] +_0809106C: + strb r0, [r4] + adds r4, 0x1 + adds r6, 0x1 + b _08091080 +_08091074: + mov r0, r10 + cmp r0, 0 + beq _08091080 + movs r0, 0x60 + strb r0, [r4] + adds r4, 0x1 +_08091080: + adds r2, r7, 0 + cmp r2, 0x4 + ble _0809100E + lsls r1, r5, 1 + mov r2, r9 + adds r0, r1, r2 + ldrb r0, [r0] + strb r0, [r4] + adds r4, 0x1 + mov r0, r9 + adds r0, 0x1 + adds r1, r0 + ldrb r0, [r1] + strb r0, [r4] + adds r6, 0x1 + movs r0, 0 + strb r0, [r4, 0x1] + adds r0, r6, 0 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8090FEC + + thumb_func_start sub_80910B4 +sub_80910B4: + push {r4-r7,lr} + movs r2, 0 + movs r4, 0 + ldr r7, _080910C0 + movs r3, 0 + b _080910DA + .align 2, 0 +_080910C0: .4byte gUnknown_203B460 +_080910C4: + cmp r2, r4 + ble _080910D4 + ldr r0, [r7] + lsls r1, r4, 2 + adds r1, r0, r1 + adds r0, r3 + ldr r0, [r0] + str r0, [r1] +_080910D4: + adds r3, 0x4 + adds r2, 0x1 + adds r4, 0x1 +_080910DA: + cmp r2, 0x13 + bgt _08091106 + ldr r0, [r7] + adds r0, r3, r0 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _08091106 + ldr r5, _0809112C + movs r6, 0x1 +_080910F0: + adds r3, 0x4 + adds r2, 0x1 + cmp r2, 0x13 + bgt _08091106 + ldr r0, [r5] + adds r0, r3, r0 + ldrb r1, [r0] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _080910F0 +_08091106: + cmp r2, 0x14 + bne _080910C4 + cmp r4, 0x13 + bgt _08091124 + ldr r3, _0809112C + movs r2, 0 +_08091112: + lsls r1, r4, 2 + ldr r0, [r3] + adds r1, r0 + strb r2, [r1, 0x2] + strb r2, [r1, 0x1] + strb r2, [r1] + adds r4, 0x1 + cmp r4, 0x13 + ble _08091112 +_08091124: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0809112C: .4byte gUnknown_203B460 + thumb_func_end sub_80910B4 + + thumb_func_start sub_8091130 +sub_8091130: + push {r4,r5,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r3, 0 + ldr r0, _08091154 + ldr r2, [r0] + movs r5, 0x1 +_0809113E: + ldrb r1, [r2] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _08091158 + ldrb r0, [r2, 0x2] + cmp r0, r4 + bne _08091158 + adds r0, r3, 0 + b _08091164 + .align 2, 0 +_08091154: .4byte gUnknown_203B460 +_08091158: + adds r2, 0x4 + adds r3, 0x1 + cmp r3, 0x13 + ble _0809113E + movs r0, 0x1 + negs r0, r0 +_08091164: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8091130 + + thumb_func_start sub_809116C +sub_809116C: + push {r4-r6,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 + ldr r0, _080911A0 + ldr r2, [r0] + movs r6, 0x1 + movs r3, 0x13 +_0809117C: + ldrb r1, [r2] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _0809118E + ldrb r0, [r2, 0x2] + cmp r0, r5 + bne _0809118E + adds r4, 0x1 +_0809118E: + adds r2, 0x4 + subs r3, 0x1 + cmp r3, 0 + bge _0809117C + adds r0, r4, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080911A0: .4byte gUnknown_203B460 + thumb_func_end sub_809116C + + thumb_func_start sub_80911A4 +sub_80911A4: + push {r4-r7,lr} + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + bl sub_809116C + adds r4, r0, 0 + movs r3, 0 + ldr r0, _080911F4 + ldr r7, [r0] + movs r6, 0x1 +_080911BA: + movs r0, 0x58 + muls r0, r3 + adds r2, r7, r0 + ldrh r1, [r2] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _080911E2 + lsrs r0, r1, 1 + ands r0, r6 + cmp r0, 0 + beq _080911E2 + adds r0, r2, 0 + adds r0, 0x28 + ldrb r0, [r0] + cmp r0, 0 + beq _080911E2 + cmp r0, r5 + bne _080911E2 + adds r4, 0x1 +_080911E2: + adds r3, 0x1 + movs r0, 0xCE + lsls r0, 1 + cmp r3, r0 + ble _080911BA + adds r0, r4, 0 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080911F4: .4byte gUnknown_203B45C + thumb_func_end sub_80911A4 + + thumb_func_start sub_80911F8 +sub_80911F8: + push {r4,r5,lr} + adds r2, r0, 0 + ldr r4, _08091230 + cmp r2, 0x12 + bgt _0809121C + adds r5, r4, 0 + lsls r0, r2, 2 + adds r3, r0, 0x4 +_08091208: + ldr r0, [r5] + lsls r1, r2, 2 + adds r1, r0, r1 + adds r0, r3 + ldr r0, [r0] + str r0, [r1] + adds r3, 0x4 + adds r2, 0x1 + cmp r2, 0x12 + ble _08091208 +_0809121C: + ldr r0, [r4] + adds r0, 0x4E + movs r1, 0 + strb r1, [r0] + ldr r0, [r4] + adds r0, 0x4C + strb r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08091230: .4byte gUnknown_203B460 + thumb_func_end sub_80911F8 + + thumb_func_start sub_8091234 +sub_8091234: + ldr r3, _08091248 + ldr r1, [r3] + lsls r0, 2 + adds r1, r0 + movs r2, 0 + strb r2, [r1, 0x2] + ldr r1, [r3] + adds r1, r0 + strb r2, [r1] + bx lr + .align 2, 0 +_08091248: .4byte gUnknown_203B460 + thumb_func_end sub_8091234 + + thumb_func_start sub_809124C +sub_809124C: + push {lr} + sub sp, 0x4 + adds r3, r0, 0 + adds r2, r1, 0 + lsls r3, 24 + lsrs r3, 24 + lsls r2, 24 + lsrs r2, 24 + mov r0, sp + adds r1, r3, 0 + bl sub_8090A8C + mov r0, sp + bl sub_8091290 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r1} + bx r1 + thumb_func_end sub_809124C + + thumb_func_start sub_8091274 +sub_8091274: + push {lr} + sub sp, 0x4 + adds r1, r0, 0 + mov r0, sp + bl sub_8090B64 + mov r0, sp + bl sub_8091290 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x4 + pop {r1} + bx r1 + thumb_func_end sub_8091274 + + thumb_func_start sub_8091290 +sub_8091290: + push {r4-r6,lr} + adds r4, r0, 0 + movs r3, 0 + ldr r5, _080912B4 + movs r6, 0x1 +_0809129A: + lsls r1, r3, 2 + ldr r0, [r5] + adds r2, r1, r0 + ldrb r1, [r2] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _080912B8 + ldr r0, [r4] + str r0, [r2] + movs r0, 0 + b _080912C0 + .align 2, 0 +_080912B4: .4byte gUnknown_203B460 +_080912B8: + adds r3, 0x1 + cmp r3, 0x13 + ble _0809129A + movs r0, 0x1 +_080912C0: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8091290 + + thumb_func_start sub_80912C8 +sub_80912C8: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r5, 0 + movs r6, 0 +_080912D6: + ldr r0, _0809139C + lsls r1, r5, 2 + ldr r0, [r0] + adds r4, r0, r1 + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080912FE + ldrb r0, [r4, 0x2] + cmp r0, 0x69 + bne _080912FE + adds r0, r4, 0 + bl sub_80915D4 + bl sub_80913A0 + strb r6, [r4, 0x2] + strb r6, [r4, 0x1] + strb r6, [r4] +_080912FE: + adds r5, 0x1 + cmp r5, 0x13 + ble _080912D6 + bl sub_80910B4 + movs r5, 0 +_0809130A: + movs r0, 0x1 + negs r0, r0 + mov r9, r0 + lsls r2, r5, 2 + ldr r1, _0809139C + mov r8, r1 + ldr r0, [r1] + adds r3, r2, r0 + ldrb r1, [r3] + movs r0, 0x1 + ands r0, r1 + mov r10, r2 + adds r7, r5, 0x1 + cmp r0, 0 + beq _08091382 + ldrb r0, [r3, 0x2] + bl sub_8090D44 + adds r6, r0, 0 + adds r4, r7, 0 + cmp r7, 0x13 + bgt _08091368 +_08091336: + lsls r5, r4, 2 + mov r1, r8 + ldr r0, [r1] + adds r2, r5, r0 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08091362 + ldrb r0, [r2, 0x2] + bl sub_8090D44 + cmp r6, r0 + ble _08091362 + mov r9, r4 + mov r1, r8 + ldr r0, [r1] + adds r0, r5 + ldrb r0, [r0, 0x2] + bl sub_8090D44 + adds r6, r0, 0 +_08091362: + adds r4, 0x1 + cmp r4, 0x13 + ble _08091336 +_08091368: + mov r4, r9 + cmp r4, 0 + blt _08091382 + ldr r0, _0809139C + ldr r1, [r0] + mov r0, r10 + adds r2, r1, r0 + ldr r3, [r2] + lsls r0, r4, 2 + adds r1, r0 + ldr r0, [r1] + str r0, [r2] + str r3, [r1] +_08091382: + adds r5, r7, 0 + cmp r5, 0x13 + ble _0809130A + bl sub_80910B4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0809139C: .4byte gUnknown_203B460 + thumb_func_end sub_80912C8 + + thumb_func_start sub_80913A0 +sub_80913A0: + push {lr} + ldr r1, _080913C4 + ldr r1, [r1] + movs r3, 0x98 + lsls r3, 2 + adds r2, r1, r3 + ldr r1, [r2] + adds r1, r0 + str r1, [r2] + ldr r0, _080913C8 + cmp r1, r0 + bgt _080913BE + cmp r1, 0 + bge _080913C0 + movs r0, 0 +_080913BE: + str r0, [r2] +_080913C0: + pop {r0} + bx r0 + .align 2, 0 +_080913C4: .4byte gUnknown_203B460 +_080913C8: .4byte 0x0001869f + thumb_func_end sub_80913A0 + + thumb_func_start sub_80913CC +sub_80913CC: + lsls r0, 24 + ldr r1, _080913DC + ldr r1, [r1] + lsrs r0, 19 + adds r0, r1 + ldrh r0, [r0, 0x18] + bx lr + .align 2, 0 +_080913DC: .4byte gUnknown_20389A4 + thumb_func_end sub_80913CC + + thumb_func_start sub_80913E0 +sub_80913E0: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x5C + adds r6, r0, 0 + adds r5, r1, 0 + mov r8, r2 + ldrb r0, [r6, 0x2] + bl sub_8090D98 + ldrb r1, [r6, 0x2] + add r0, sp, 0x4 + movs r2, 0 + bl sub_8090DC4 + ldrb r0, [r6, 0x2] + cmp r0, 0x7C + bne _08091414 + ldr r0, _080914D4 + ldrb r1, [r6, 0x1] + adds r1, 0x7D + lsls r1, 24 + lsrs r1, 24 + movs r2, 0 + bl sub_8090DC4 +_08091414: + adds r0, r5, 0 + bl sub_80073B8 + movs r7, 0 + str r7, [sp] + movs r0, 0x10 + movs r1, 0 + add r2, sp, 0x4 + adds r3, r5, 0 + bl sub_8014FF0 + ldrb r0, [r6, 0x2] + bl sub_8090D98 + adds r2, r0, 0 + str r7, [sp] + movs r0, 0x8 + movs r1, 0x18 + adds r3, r5, 0 + bl sub_8014FF0 + ldrb r0, [r6, 0x2] + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x5 + bne _080914B6 + add r4, sp, 0x54 + ldrb r0, [r6, 0x2] + bl sub_80913CC + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_8092A88 + movs r0, 0x7 + str r0, [sp] + adds r0, r5, 0 + movs r1, 0x4 + movs r2, 0x52 + movs r3, 0xC8 + bl sub_80078A4 + ldr r0, _080914D8 + ldr r2, [r0] + str r7, [sp] + movs r0, 0x4 + movs r1, 0x54 + adds r3, r5, 0 + bl sub_8014FF0 + adds r0, r4, 0 + bl sub_8092B00 + lsls r0, 24 + lsrs r0, 24 + bl sub_8092334 + adds r2, r0, 0 + str r7, [sp] + movs r0, 0x40 + movs r1, 0x54 + adds r3, r5, 0 + bl sub_8014FF0 + adds r0, r4, 0 + bl sub_8092BF4 + ldr r1, _080914DC + str r0, [r1] + ldr r0, _080914E0 + ldr r2, [r0] + str r7, [sp] + movs r0, 0x80 + movs r1, 0x54 + adds r3, r5, 0 + bl sub_8014FF0 +_080914B6: + adds r0, r5, 0 + bl sub_80073E0 + ldrb r0, [r6, 0x2] + bl sub_8090D98 + mov r1, r8 + bl sub_8097DF0 + add sp, 0x5C + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080914D4: .4byte gUnknown_202DE58 +_080914D8: .4byte gUnknown_810CF0C +_080914DC: .4byte gUnknown_202DE30 +_080914E0: .4byte gUnknown_8115970 + thumb_func_end sub_80913E0 + + thumb_func_start sub_80914E4 +sub_80914E4: + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + adds r4, r0, 0 + cmp r0, 0 + beq _0809151A + cmp r0, 0x69 + beq _0809151A + cmp r0, 0x79 + beq _0809151A + cmp r0, 0x77 + beq _0809151A + cmp r0, 0x78 + beq _0809151A + cmp r0, 0x7A + beq _0809151A + bl sub_8090D30 + cmp r0, 0 + beq _0809151A + adds r0, r4, 0 + bl sub_8090D1C + cmp r0, 0 + beq _0809151A + movs r0, 0x1 + b _0809151C +_0809151A: + movs r0, 0 +_0809151C: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80914E4 + + thumb_func_start sub_8091524 +sub_8091524: + push {lr} + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0 + beq _0809153C + cmp r0, 0x69 + beq _0809153C + cmp r1, 0x7C + beq _0809153C + movs r0, 0x1 + b _0809153E +_0809153C: + movs r0, 0 +_0809153E: + pop {r1} + bx r1 + thumb_func_end sub_8091524 + + thumb_func_start sub_8091544 +sub_8091544: + push {lr} + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0 + beq _08091568 + cmp r0, 0x69 + beq _08091568 + cmp r0, 0x79 + beq _08091568 + cmp r0, 0x77 + beq _08091568 + cmp r0, 0x78 + beq _08091568 + cmp r1, 0x7A + beq _08091568 + movs r0, 0x1 + b _0809156A +_08091568: + movs r0, 0 +_0809156A: + pop {r1} + bx r1 + thumb_func_end sub_8091544 + + thumb_func_start sub_8091570 +sub_8091570: + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _08091596 + adds r0, r4, 0 + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + beq _08091596 + movs r0, 0 + b _08091598 +_08091596: + movs r0, 0x1 +_08091598: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8091570 + + thumb_func_start sub_80915A0 +sub_80915A0: + push {lr} + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0xE0 + beq _080915CC + cmp r0, 0xE1 + beq _080915CC + cmp r0, 0xE2 + beq _080915CC + cmp r0, 0xE3 + beq _080915CC + cmp r0, 0xE4 + beq _080915CC + cmp r0, 0xE5 + beq _080915CC + cmp r0, 0xE6 + beq _080915CC + cmp r1, 0xE7 + beq _080915CC + movs r0, 0 + b _080915CE +_080915CC: + movs r0, 0x1 +_080915CE: + pop {r1} + bx r1 + thumb_func_end sub_80915A0 + + thumb_func_start sub_80915D4 +sub_80915D4: + ldr r1, _080915E0 + ldrb r0, [r0, 0x1] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bx lr + .align 2, 0 +_080915E0: .4byte gUnknown_810A3F0 + thumb_func_end sub_80915D4 + + thumb_func_start sub_80915E4 +sub_80915E4: + ldr r1, _080915F0 + ldrb r0, [r0, 0x1] + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bx lr + .align 2, 0 +_080915F0: .4byte gUnknown_810A3F0 + thumb_func_end sub_80915E4 + + thumb_func_start sub_80915F4 +sub_80915F4: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + adds r7, r3, 0 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + ldr r0, _080916B8 + strh r0, [r7] + movs r0, 0 + strh r0, [r7, 0x2] + adds r0, r5, 0 + bl sub_8091764 + lsls r0, 24 + cmp r0, 0 + bne _0809161E + b _08091756 +_0809161E: + movs r1, 0x8 + ldrsh r0, [r6, r1] + movs r1, 0 + bl sub_808DC68 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + movs r2, 0x8 + ldrsh r0, [r6, r2] + movs r1, 0x1 + bl sub_808DC68 + lsls r0, 24 + lsrs r0, 24 + adds r2, r5, 0 + subs r2, 0x55 + ldr r5, _080916BC + lsls r2, 1 + lsls r1, r4, 3 + adds r1, r4 + lsls r1, 2 + adds r1, r2, r1 + adds r1, r5 + movs r4, 0 + ldrsh r3, [r1, r4] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r2, r1 + adds r2, r5 + movs r1, 0 + ldrsh r0, [r2, r1] + movs r2, 0x14 + ldrsh r1, [r6, r2] + adds r3, r0 + ldrh r4, [r6, 0x14] + adds r3, r4 + strh r3, [r6, 0x14] + movs r2, 0x14 + ldrsh r0, [r6, r2] + subs r1, r0, r1 + lsls r3, 16 + cmp r3, 0 + bgt _0809167C + movs r0, 0x1 + strh r0, [r6, 0x14] +_0809167C: + movs r4, 0x14 + ldrsh r0, [r6, r4] + ldr r2, _080916C0 + cmp r0, r2 + ble _08091688 + strh r2, [r6, 0x14] +_08091688: + movs r0, 0 + cmp r1, 0x8 + bgt _0809169C + movs r0, 0x1 + cmp r1, 0x4 + bgt _0809169C + movs r0, 0x3 + cmp r1, 0x2 + ble _0809169C + movs r0, 0x2 +_0809169C: + strh r0, [r7] + mov r1, r8 + cmp r1, 0 + bne _08091756 + cmp r0, 0 + bne _080916C4 + movs r0, 0x10 + bl RandomCapped + cmp r0, 0xA + bne _080916C4 + movs r0, 0xF + b _080916D2 + .align 2, 0 +_080916B8: .4byte 0x0000ffff +_080916BC: .4byte gUnknown_810A580 +_080916C0: .4byte 0x000003e7 +_080916C4: + movs r0, 0x4 + bl RandomCapped + ldr r1, _080916EC + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] +_080916D2: + strh r0, [r7, 0x2] + ldrh r1, [r7, 0x2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080916F6 + ldrb r0, [r6, 0x18] + cmp r0, 0xFE + bhi _080916F0 + adds r0, 0x1 + strb r0, [r6, 0x18] + b _080916F6 + .align 2, 0 +_080916EC: .4byte gUnknown_81097E0 +_080916F0: + ldr r0, _0809170C + ands r0, r1 + strh r0, [r7, 0x2] +_080916F6: + ldrh r1, [r7, 0x2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08091716 + ldrb r0, [r6, 0x19] + cmp r0, 0xFE + bhi _08091710 + adds r0, 0x1 + strb r0, [r6, 0x19] + b _08091716 + .align 2, 0 +_0809170C: .4byte 0x0000fffe +_08091710: + ldr r0, _0809172C + ands r0, r1 + strh r0, [r7, 0x2] +_08091716: + ldrh r1, [r7, 0x2] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08091736 + ldrb r0, [r6, 0x1A] + cmp r0, 0xFE + bhi _08091730 + adds r0, 0x1 + strb r0, [r6, 0x1A] + b _08091736 + .align 2, 0 +_0809172C: .4byte 0x0000fffd +_08091730: + ldr r0, _0809174C + ands r0, r1 + strh r0, [r7, 0x2] +_08091736: + ldrh r1, [r7, 0x2] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08091756 + ldrb r0, [r6, 0x1B] + cmp r0, 0xFE + bhi _08091750 + adds r0, 0x1 + strb r0, [r6, 0x1B] + b _08091756 + .align 2, 0 +_0809174C: .4byte 0x0000fffb +_08091750: + ldr r0, _08091760 + ands r0, r1 + strh r0, [r7, 0x2] +_08091756: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08091760: .4byte 0x0000fff7 + thumb_func_end sub_80915F4 + + thumb_func_start sub_8091764 +sub_8091764: + push {lr} + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x55 + bls _08091776 + cmp r0, 0x66 + bhi _08091776 + movs r0, 0x1 + b _08091778 +_08091776: + movs r0, 0 +_08091778: + pop {r1} + bx r1 + thumb_func_end sub_8091764 + + thumb_func_start sub_809177C +sub_809177C: + push {r4,lr} + movs r4, 0 +_08091780: + lsls r1, r4, 2 + ldr r0, _080917A4 + ldr r0, [r0] + adds r2, r1, r0 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080917A8 + ldrb r0, [r2, 0x2] + bl sub_8091764 + lsls r0, 24 + cmp r0, 0 + beq _080917A8 + movs r0, 0x1 + b _080917B0 + .align 2, 0 +_080917A4: .4byte gUnknown_203B460 +_080917A8: + adds r4, 0x1 + cmp r4, 0x13 + ble _08091780 + movs r0, 0 +_080917B0: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809177C + + thumb_func_start sub_80917B8 +sub_80917B8: + push {r4,lr} + adds r4, r0, 0 + ldrb r0, [r4, 0x2] + bl sub_8090A60 + lsls r0, 24 + cmp r0, 0 + beq _080917E0 + ldr r2, _080917DC + ldr r1, [r2] + ldrb r0, [r4, 0x2] + lsls r0, 1 + adds r1, 0x50 + adds r1, r0 + ldrh r0, [r1] + ldrb r3, [r4, 0x1] + adds r0, r3 + b _080917F0 + .align 2, 0 +_080917DC: .4byte gUnknown_203B460 +_080917E0: + ldr r2, _0809180C + ldr r1, [r2] + ldrb r0, [r4, 0x2] + lsls r0, 1 + adds r1, 0x50 + adds r1, r0 + ldrh r0, [r1] + adds r0, 0x1 +_080917F0: + strh r0, [r1] + ldr r0, [r2] + ldrb r1, [r4, 0x2] + lsls r1, 1 + adds r0, 0x50 + adds r2, r0, r1 + ldrh r0, [r2] + ldr r1, _08091810 + cmp r0, r1 + bls _08091806 + strh r1, [r2] +_08091806: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0809180C: .4byte gUnknown_203B460 +_08091810: .4byte 0x000003e7 + thumb_func_end sub_80917B8 + + thumb_func_start sub_8091814 +sub_8091814: + push {lr} + movs r3, 0 + ldr r0, _0809183C + ldr r0, [r0] + movs r2, 0x8C + lsls r2, 2 + adds r1, r0, r2 + movs r2, 0x7 +_08091824: + ldrb r0, [r1] + cmp r0, 0 + beq _0809182C + adds r3, 0x1 +_0809182C: + adds r1, 0x4 + subs r2, 0x1 + cmp r2, 0 + bge _08091824 + adds r0, r3, 0 + pop {r1} + bx r1 + .align 2, 0 +_0809183C: .4byte gUnknown_203B460 + thumb_func_end sub_8091814 + + thumb_func_start sub_8091840 +sub_8091840: + lsls r0, 24 + ldr r1, _08091858 + lsrs r0, 22 + movs r2, 0x8C + lsls r2, 2 + adds r0, r2 + ldr r1, [r1] + adds r1, r0 + movs r0, 0 + strb r0, [r1] + strb r0, [r1, 0x1] + bx lr + .align 2, 0 +_08091858: .4byte gUnknown_203B460 + thumb_func_end sub_8091840 + + thumb_func_start sub_809185C +sub_809185C: + lsls r0, 24 + ldr r1, _08091870 + lsrs r0, 22 + movs r2, 0x8C + lsls r2, 2 + adds r0, r2 + ldr r1, [r1] + adds r1, r0 + adds r0, r1, 0 + bx lr + .align 2, 0 +_08091870: .4byte gUnknown_203B460 + thumb_func_end sub_809185C + + thumb_func_start sub_8091874 +sub_8091874: + push {r4-r7,lr} + movs r2, 0 + movs r4, 0 + ldr r7, _08091884 + movs r6, 0x8C + lsls r6, 2 + movs r3, 0 + b _080918A0 + .align 2, 0 +_08091884: .4byte gUnknown_203B460 +_08091888: + cmp r2, r4 + ble _0809189A + ldr r0, [r7] + lsls r1, r4, 2 + adds r0, r6 + adds r1, r0, r1 + adds r0, r3 + ldr r0, [r0] + str r0, [r1] +_0809189A: + adds r3, 0x4 + adds r2, 0x1 + adds r4, 0x1 +_080918A0: + cmp r2, 0x7 + bgt _080918CA + ldr r0, [r7] + adds r0, r3 + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0 + bne _080918CA + ldr r5, _080918E8 + movs r1, 0x8C + lsls r1, 2 +_080918B6: + adds r3, 0x4 + adds r2, 0x1 + cmp r2, 0x7 + bgt _080918CA + ldr r0, [r5] + adds r0, r3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080918B6 +_080918CA: + cmp r2, 0x8 + bne _08091888 + cmp r4, 0x7 + bgt _080918E0 +_080918D2: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8091840 + adds r4, 0x1 + cmp r4, 0x7 + ble _080918D2 +_080918E0: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080918E8: .4byte gUnknown_203B460 + thumb_func_end sub_8091874 + + thumb_func_start sub_80918EC +sub_80918EC: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r0, 0 +_080918F8: + adds r1, r0, 0x1 + mov r8, r1 + mov r6, r8 + cmp r1, 0x7 + bgt _08091964 + ldr r1, _08091978 + mov r9, r1 + lsls r7, r0, 2 + movs r0, 0x8C + lsls r0, 2 + mov r10, r0 +_0809190E: + mov r1, r9 + ldr r0, [r1] + adds r0, r7 + add r0, r10 + ldrb r0, [r0] + bl sub_8090D44 + adds r4, r0, 0 + mov r1, r9 + ldr r0, [r1] + lsls r5, r6, 2 + adds r0, r5 + add r0, r10 + ldrb r0, [r0] + bl sub_8090D44 + cmp r4, r0 + bgt _0809194C + cmp r4, r0 + bne _0809195E + mov r1, r9 + ldr r0, [r1] + adds r2, r0, r7 + ldr r1, _0809197C + adds r2, r1 + adds r0, r5 + adds r0, r1 + ldrb r1, [r2] + ldrb r0, [r0] + cmp r1, r0 + bcs _0809195E +_0809194C: + mov r1, r9 + ldr r0, [r1] + add r0, r10 + adds r2, r0, r7 + ldr r3, [r2] + adds r0, r5 + ldr r1, [r0] + str r1, [r2] + str r3, [r0] +_0809195E: + adds r6, 0x1 + cmp r6, 0x7 + ble _0809190E +_08091964: + mov r0, r8 + cmp r0, 0x6 + ble _080918F8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08091978: .4byte gUnknown_203B460 +_0809197C: .4byte 0x00000231 + thumb_func_end sub_80918EC + + thumb_func_start sub_8091980 +sub_8091980: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + mov r1, sp + ldr r0, _080919F4 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r0, [r0] + str r0, [r1] + movs r5, 0 +_0809199C: + lsls r0, r5, 24 + lsrs r0, 24 + bl sub_8091840 + adds r5, 0x1 + cmp r5, 0x7 + ble _0809199C + mov r0, r8 + lsls r7, r0, 2 + ldr r6, _080919F8 + movs r5, 0x7 +_080919B2: + adds r0, r6, 0 + bl RandomCapped + adds r4, r0, 0 + adds r0, r6, 0 + bl RandomCapped + adds r2, r0, 0 + mov r1, sp + adds r0, r1, r7 + ldr r0, [r0] + adds r1, r4, 0 + bl sub_8091E94 + lsls r0, 24 + lsrs r0, 24 + bl sub_80919FC + subs r5, 0x1 + cmp r5, 0 + bge _080919B2 + bl sub_80918EC + mov r0, r8 + bl sub_8091BB4 + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080919F4: .4byte gUnknown_81097E8 +_080919F8: .4byte 0x0000270f + thumb_func_end sub_8091980 + + thumb_func_start sub_80919FC +sub_80919FC: + push {r4,r5,lr} + sub sp, 0x4 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, sp + bl sub_8090B08 + movs r3, 0 + ldr r5, _08091A34 + movs r4, 0x8C + lsls r4, 2 +_08091A14: + ldr r1, [r5] + lsls r2, r3, 2 + adds r0, r1, r2 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _08091A38 + movs r3, 0x8C + lsls r3, 2 + adds r0, r1, r3 + adds r0, r2 + ldr r1, [sp] + str r1, [r0] + movs r0, 0 + b _08091A40 + .align 2, 0 +_08091A34: .4byte gUnknown_203B460 +_08091A38: + adds r3, 0x1 + cmp r3, 0x7 + ble _08091A14 + movs r0, 0x1 +_08091A40: + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80919FC + + thumb_func_start sub_8091A48 +sub_8091A48: + push {lr} + movs r3, 0 + ldr r0, _08091A70 + ldr r0, [r0] + movs r2, 0x94 + lsls r2, 2 + adds r1, r0, r2 + movs r2, 0x3 +_08091A58: + ldrb r0, [r1] + cmp r0, 0 + beq _08091A60 + adds r3, 0x1 +_08091A60: + adds r1, 0x4 + subs r2, 0x1 + cmp r2, 0 + bge _08091A58 + adds r0, r3, 0 + pop {r1} + bx r1 + .align 2, 0 +_08091A70: .4byte gUnknown_203B460 + thumb_func_end sub_8091A48 + + thumb_func_start sub_8091A74 +sub_8091A74: + lsls r0, 24 + ldr r1, _08091A8C + lsrs r0, 22 + movs r2, 0x94 + lsls r2, 2 + adds r0, r2 + ldr r1, [r1] + adds r1, r0 + movs r0, 0 + strb r0, [r1] + strb r0, [r1, 0x1] + bx lr + .align 2, 0 +_08091A8C: .4byte gUnknown_203B460 + thumb_func_end sub_8091A74 + + thumb_func_start sub_8091A90 +sub_8091A90: + lsls r0, 24 + ldr r1, _08091AA4 + lsrs r0, 22 + movs r2, 0x94 + lsls r2, 2 + adds r0, r2 + ldr r1, [r1] + adds r1, r0 + adds r0, r1, 0 + bx lr + .align 2, 0 +_08091AA4: .4byte gUnknown_203B460 + thumb_func_end sub_8091A90 + + thumb_func_start sub_8091AA8 +sub_8091AA8: + push {r4-r7,lr} + movs r2, 0 + movs r4, 0 + ldr r7, _08091AB8 + movs r6, 0x94 + lsls r6, 2 + movs r3, 0 + b _08091AD4 + .align 2, 0 +_08091AB8: .4byte gUnknown_203B460 +_08091ABC: + cmp r2, r4 + ble _08091ACE + ldr r0, [r7] + lsls r1, r4, 2 + adds r0, r6 + adds r1, r0, r1 + adds r0, r3 + ldr r0, [r0] + str r0, [r1] +_08091ACE: + adds r3, 0x4 + adds r2, 0x1 + adds r4, 0x1 +_08091AD4: + cmp r2, 0x3 + bgt _08091AFE + ldr r0, [r7] + adds r0, r3 + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0 + bne _08091AFE + ldr r5, _08091B1C + movs r1, 0x94 + lsls r1, 2 +_08091AEA: + adds r3, 0x4 + adds r2, 0x1 + cmp r2, 0x3 + bgt _08091AFE + ldr r0, [r5] + adds r0, r3 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08091AEA +_08091AFE: + cmp r2, 0x4 + bne _08091ABC + cmp r4, 0x3 + bgt _08091B14 +_08091B06: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8091A74 + adds r4, 0x1 + cmp r4, 0x3 + ble _08091B06 +_08091B14: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08091B1C: .4byte gUnknown_203B460 + thumb_func_end sub_8091AA8 + + thumb_func_start sub_8091B20 +sub_8091B20: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + movs r0, 0 +_08091B2C: + adds r1, r0, 0x1 + mov r8, r1 + mov r6, r8 + cmp r1, 0x3 + bgt _08091B98 + ldr r1, _08091BAC + mov r9, r1 + lsls r7, r0, 2 + movs r0, 0x94 + lsls r0, 2 + mov r10, r0 +_08091B42: + mov r1, r9 + ldr r0, [r1] + adds r0, r7 + add r0, r10 + ldrb r0, [r0] + bl sub_8090D44 + adds r4, r0, 0 + mov r1, r9 + ldr r0, [r1] + lsls r5, r6, 2 + adds r0, r5 + add r0, r10 + ldrb r0, [r0] + bl sub_8090D44 + cmp r4, r0 + bgt _08091B80 + cmp r4, r0 + bne _08091B92 + mov r1, r9 + ldr r0, [r1] + adds r2, r0, r7 + ldr r1, _08091BB0 + adds r2, r1 + adds r0, r5 + adds r0, r1 + ldrb r1, [r2] + ldrb r0, [r0] + cmp r1, r0 + bcs _08091B92 +_08091B80: + mov r1, r9 + ldr r0, [r1] + add r0, r10 + adds r2, r0, r7 + ldr r3, [r2] + adds r0, r5 + ldr r1, [r0] + str r1, [r2] + str r3, [r0] +_08091B92: + adds r6, 0x1 + cmp r6, 0x3 + ble _08091B42 +_08091B98: + mov r0, r8 + cmp r0, 0x2 + ble _08091B2C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08091BAC: .4byte gUnknown_203B460 +_08091BB0: .4byte 0x00000251 + thumb_func_end sub_8091B20 + + thumb_func_start sub_8091BB4 +sub_8091BB4: + push {r4-r7,lr} + sub sp, 0x10 + lsls r0, 24 + lsrs r4, r0, 24 + mov r1, sp + ldr r0, _08091C14 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldr r0, [r0] + str r0, [r1] + movs r5, 0 +_08091BCA: + lsls r0, r5, 24 + lsrs r0, 24 + bl sub_8091A74 + adds r5, 0x1 + cmp r5, 0x3 + ble _08091BCA + lsls r7, r4, 2 + ldr r6, _08091C18 + movs r5, 0x3 +_08091BDE: + adds r0, r6, 0 + bl RandomCapped + adds r4, r0, 0 + adds r0, r6, 0 + bl RandomCapped + adds r2, r0, 0 + mov r1, sp + adds r0, r1, r7 + ldr r0, [r0] + adds r1, r4, 0 + bl sub_8091E94 + lsls r0, 24 + lsrs r0, 24 + bl sub_8091C1C + subs r5, 0x1 + cmp r5, 0 + bge _08091BDE + bl sub_8091B20 + add sp, 0x10 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08091C14: .4byte gUnknown_81097F8 +_08091C18: .4byte 0x0000270f + thumb_func_end sub_8091BB4 + + thumb_func_start sub_8091C1C +sub_8091C1C: + push {r4,r5,lr} + sub sp, 0x4 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + mov r0, sp + bl sub_8090B08 + movs r3, 0 + ldr r5, _08091C54 + movs r4, 0x94 + lsls r4, 2 +_08091C34: + ldr r1, [r5] + lsls r2, r3, 2 + adds r0, r1, r2 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _08091C58 + movs r3, 0x94 + lsls r3, 2 + adds r0, r1, r3 + adds r0, r2 + ldr r1, [sp] + str r1, [r0] + movs r0, 0 + b _08091C60 + .align 2, 0 +_08091C54: .4byte gUnknown_203B460 +_08091C58: + adds r3, 0x1 + cmp r3, 0x3 + ble _08091C34 + movs r0, 0x1 +_08091C60: + add sp, 0x4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8091C1C + + thumb_func_start sub_8091C68 +sub_8091C68: + push {r4-r6,lr} + sub sp, 0x10 + adds r3, r0, 0 + adds r2, r1, 0 + mov r0, sp + adds r1, r3, 0 + bl sub_809486C + movs r4, 0 + ldr r5, _08091D10 +_08091C7C: + lsls r0, r4, 2 + ldr r1, [r5] + adds r1, r0 + mov r0, sp + bl sub_8091E28 + adds r4, 0x1 + cmp r4, 0x13 + ble _08091C7C + ldr r6, _08091D10 + movs r5, 0x50 + movs r4, 0xEF +_08091C94: + ldr r1, [r6] + adds r1, r5 + mov r0, sp + movs r2, 0xA + bl sub_809488C + adds r5, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _08091C94 + ldr r6, _08091D10 + movs r5, 0x8C + lsls r5, 2 + movs r4, 0x7 +_08091CB0: + ldr r1, [r6] + adds r1, r5 + mov r0, sp + bl sub_8091DE0 + adds r5, 0x4 + subs r4, 0x1 + cmp r4, 0 + bge _08091CB0 + ldr r6, _08091D10 + movs r5, 0x94 + lsls r5, 2 + movs r4, 0x3 +_08091CCA: + ldr r1, [r6] + adds r1, r5 + mov r0, sp + bl sub_8091DE0 + adds r5, 0x4 + subs r4, 0x1 + cmp r4, 0 + bge _08091CCA + ldr r4, _08091D10 + ldr r1, [r4] + movs r0, 0x98 + lsls r0, 2 + adds r1, r0 + mov r0, sp + movs r2, 0x18 + bl sub_809488C + ldr r1, [r4] + movs r0, 0x99 + lsls r0, 2 + adds r1, r0 + mov r0, sp + movs r2, 0x18 + bl sub_809488C + mov r0, sp + bl nullsub_102 + ldr r0, [sp, 0x8] + add sp, 0x10 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08091D10: .4byte gUnknown_203B460 + thumb_func_end sub_8091C68 + + thumb_func_start sub_8091D14 +sub_8091D14: + push {r4-r6,lr} + sub sp, 0x10 + adds r3, r0, 0 + adds r2, r1, 0 + mov r0, sp + adds r1, r3, 0 + bl sub_809485C + movs r4, 0 + ldr r5, _08091DBC +_08091D28: + lsls r0, r4, 2 + ldr r1, [r5] + adds r1, r0 + mov r0, sp + bl sub_8091E00 + adds r4, 0x1 + cmp r4, 0x13 + ble _08091D28 + ldr r6, _08091DBC + movs r5, 0x50 + movs r4, 0xEF +_08091D40: + ldr r1, [r6] + adds r1, r5 + mov r0, sp + movs r2, 0xA + bl sub_8094924 + adds r5, 0x2 + subs r4, 0x1 + cmp r4, 0 + bge _08091D40 + ldr r6, _08091DBC + movs r5, 0x8C + lsls r5, 2 + movs r4, 0x7 +_08091D5C: + ldr r1, [r6] + adds r1, r5 + mov r0, sp + bl sub_8091DC0 + adds r5, 0x4 + subs r4, 0x1 + cmp r4, 0 + bge _08091D5C + ldr r6, _08091DBC + movs r5, 0x94 + lsls r5, 2 + movs r4, 0x3 +_08091D76: + ldr r1, [r6] + adds r1, r5 + mov r0, sp + bl sub_8091DC0 + adds r5, 0x4 + subs r4, 0x1 + cmp r4, 0 + bge _08091D76 + ldr r4, _08091DBC + ldr r1, [r4] + movs r0, 0x98 + lsls r0, 2 + adds r1, r0 + mov r0, sp + movs r2, 0x18 + bl sub_8094924 + ldr r1, [r4] + movs r0, 0x99 + lsls r0, 2 + adds r1, r0 + mov r0, sp + movs r2, 0x18 + bl sub_8094924 + mov r0, sp + bl nullsub_102 + ldr r0, [sp, 0x8] + add sp, 0x10 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08091DBC: .4byte gUnknown_203B460 + thumb_func_end sub_8091D14 + + thumb_func_start sub_8091DC0 +sub_8091DC0: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r2, 0x8 + bl sub_8094924 + adds r4, 0x1 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x7 + bl sub_8094924 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8091DC0 + + thumb_func_start sub_8091DE0 +sub_8091DE0: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r2, 0x8 + bl sub_809488C + adds r4, 0x1 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x7 + bl sub_809488C + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8091DE0 + + thumb_func_start sub_8091E00 +sub_8091E00: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x8 + bl sub_8094924 + adds r1, r5, 0x1 + adds r0, r4, 0 + movs r2, 0x7 + bl sub_8094924 + adds r5, 0x2 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x8 + bl sub_8094924 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8091E00 + + thumb_func_start sub_8091E28 +sub_8091E28: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x8 + bl sub_809488C + adds r1, r5, 0x1 + adds r0, r4, 0 + movs r2, 0x7 + bl sub_809488C + adds r5, 0x2 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x8 + bl sub_809488C + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8091E28 + + thumb_func_start sub_8091E50 +sub_8091E50: + lsls r0, 24 + ldr r1, _08091E5C + lsrs r0, 22 + adds r0, r1 + ldr r0, [r0] + bx lr + .align 2, 0 +_08091E5C: .4byte gUnknown_810AF50 + thumb_func_end sub_8091E50 + + thumb_func_start sub_8091E60 +sub_8091E60: + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + lsls r0, r1, 24 + lsrs r4, r0, 24 + cmp r3, 0x3E + bhi _08091E8C + ldr r2, _08091E88 + lsrs r0, 27 + lsls r1, r3, 5 + adds r0, r1 + adds r0, r2 + ldrb r0, [r0] + movs r1, 0x7 + ands r1, r4 + asrs r0, r1 + movs r1, 0x1 + ands r0, r1 + b _08091E8E + .align 2, 0 +_08091E88: .4byte gUnknown_8108F64 +_08091E8C: + movs r0, 0 +_08091E8E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8091E60 + + thumb_func_start sub_8091E94 +sub_8091E94: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, _08091EE4 + add sp, r4 + mov r8, r1 + mov r10, r2 + ldr r1, _08091EE8 + subs r0, 0x1 + lsls r0, 2 + adds r0, r1 + movs r3, 0 + add r1, sp, 0x18 + mov r9, r1 + ldr r2, _08091EEC + mov r12, r2 + add r6, sp, 0x1F8 + ldr r2, [r0] + adds r7, r6, 0 + movs r4, 0 +_08091EC0: + ldrh r1, [r2] + cmp r1, r12 + bls _08091EF4 + ldrh r0, [r2] + ldr r1, _08091EF0 + adds r0, r1 + cmp r0, 0 + beq _08091EFC + movs r5, 0 + adds r1, r7, r4 +_08091ED4: + strh r5, [r1] + adds r1, 0x2 + adds r4, 0x2 + adds r3, 0x1 + subs r0, 0x1 + cmp r0, 0 + bne _08091ED4 + b _08091EFC + .align 2, 0 +_08091EE4: .4byte 0xfffffc10 +_08091EE8: .4byte gUnknown_8108E58 +_08091EEC: .4byte 0x0000752f +_08091EF0: .4byte 0xffff8ad0 +_08091EF4: + adds r0, r6, r4 + strh r1, [r0] + adds r4, 0x2 + adds r3, 0x1 +_08091EFC: + adds r2, 0x2 + cmp r3, 0xFB + ble _08091EC0 + movs r3, 0xB + add r2, sp, 0x1F8 + mov r1, sp +_08091F08: + ldrh r0, [r2] + strh r0, [r1] + adds r2, 0x2 + adds r1, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _08091F08 + mov r2, r9 + add r1, sp, 0x210 + movs r3, 0xEF +_08091F1C: + ldrh r0, [r1] + strh r0, [r2] + adds r1, 0x2 + adds r2, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _08091F1C + movs r7, 0xC + movs r6, 0 + mov r0, sp + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + beq _08091F4A + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, r8 + blt _08091F4A + movs r7, 0 + b _08091F66 +_08091F46: + mov r8, r5 + b _08091F9C +_08091F4A: + adds r6, 0x1 + cmp r6, 0xB + bgt _08091F66 + lsls r0, r6, 1 + mov r2, sp + adds r1, r2, r0 + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0 + beq _08091F4A + cmp r0, r8 + blt _08091F4A + lsls r0, r6, 24 + lsrs r7, r0, 24 +_08091F66: + movs r0, 0x46 + mov r8, r0 + cmp r7, 0xC + beq _08091F9C + movs r6, 0 + mov r4, r9 +_08091F72: + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _08091F94 + lsls r0, r6, 24 + lsrs r5, r0, 24 + adds r0, r5, 0 + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, r7 + bne _08091F94 + movs r2, 0 + ldrsh r0, [r4, r2] + cmp r0, r10 + bge _08091F46 +_08091F94: + adds r4, 0x2 + adds r6, 0x1 + cmp r6, 0xEF + ble _08091F72 +_08091F9C: + mov r0, r8 + movs r3, 0xFC + lsls r3, 2 + add sp, r3 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8091E94 + + thumb_func_start sub_8091FB4 +sub_8091FB4: + push {r4-r6,lr} + movs r6, 0 +_08091FB8: + ldr r0, _08092038 + lsls r1, r6, 2 + ldr r0, [r0] + adds r4, r0, r1 + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08091FE8 + movs r0, 0xF7 + ands r0, r1 + movs r5, 0 + strb r0, [r4] + ldrb r0, [r4, 0x2] + cmp r0, 0x69 + bne _08091FE8 + adds r0, r4, 0 + bl sub_80915D4 + bl sub_80913A0 + strb r5, [r4, 0x2] + strb r5, [r4, 0x1] + strb r5, [r4] +_08091FE8: + adds r6, 0x1 + cmp r6, 0x13 + ble _08091FB8 + bl sub_80910B4 + movs r6, 0 +_08091FF4: + movs r0, 0x58 + adds r1, r6, 0 + muls r1, r0 + ldr r0, _0809203C + ldr r0, [r0] + adds r2, r1, r0 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08092026 + adds r4, r2, 0 + adds r4, 0x28 + ldrb r0, [r4] + cmp r0, 0 + beq _08092026 + cmp r0, 0x69 + bne _08092026 + adds r0, r4, 0 + bl sub_80915E4 + bl sub_80913A0 + movs r0, 0 + strb r0, [r4] +_08092026: + adds r6, 0x1 + movs r0, 0xCE + lsls r0, 1 + cmp r6, r0 + ble _08091FF4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08092038: .4byte gUnknown_203B460 +_0809203C: .4byte gUnknown_203B45C + thumb_func_end sub_8091FB4 + + thumb_func_start sub_8092040 +sub_8092040: + push {r4,lr} + lsls r0, 24 + lsrs r3, r0, 24 + cmp r3, 0xEF + bls _0809204E +_0809204A: + movs r0, 0x1 + b _08092070 +_0809204E: + movs r2, 0 + ldr r0, _08092078 + ldrb r1, [r0] + adds r4, r0, 0 + cmp r1, 0xF0 + beq _0809206E + adds r1, r4, 0 +_0809205C: + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, r3 + beq _0809204A + adds r2, 0x1 + adds r0, r2, r4 + ldrb r0, [r0] + cmp r0, 0xF0 + bne _0809205C +_0809206E: + movs r0, 0 +_08092070: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08092078: .4byte gUnknown_810A35B + thumb_func_end sub_8092040 + + thumb_func_start sub_809207C +sub_809207C: + ldr r1, _08092084 + ldr r0, _08092088 + str r0, [r1] + bx lr + .align 2, 0 +_08092084: .4byte gUnknown_203B464 +_08092088: .4byte gUnknown_2038C10 + thumb_func_end sub_809207C + + thumb_func_start sub_809208C +sub_809208C: + ldr r0, _08092090 + bx lr + .align 2, 0 +_08092090: .4byte gUnknown_2038C10 + thumb_func_end sub_809208C + + thumb_func_start sub_8092094 +sub_8092094: + push {r4,lr} + ldr r4, _080920B0 + ldr r0, [r4] + ldr r1, _080920B4 + movs r2, 0xA + bl sub_8092310 + ldr r1, [r4] + movs r0, 0 + str r0, [r1, 0xC] + strb r0, [r1, 0x10] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080920B0: .4byte gUnknown_203B464 +_080920B4: .4byte gUnknown_810982C + thumb_func_end sub_8092094 + + thumb_func_start sub_80920B8 +sub_80920B8: + push {lr} + adds r2, r0, 0 + movs r1, 0 + ldr r0, _080920D4 + ldr r3, [r0] +_080920C2: + adds r0, r3, r1 + ldrb r0, [r0] + strb r0, [r2] + adds r2, 0x1 + adds r1, 0x1 + cmp r1, 0x9 + ble _080920C2 + pop {r0} + bx r0 + .align 2, 0 +_080920D4: .4byte gUnknown_203B464 + thumb_func_end sub_80920B8 + + thumb_func_start sub_80920D8 +sub_80920D8: + push {lr} + ldr r1, _080920E8 + ldr r1, [r1] + movs r2, 0xA + bl sub_80922B4 + pop {r0} + bx r0 + .align 2, 0 +_080920E8: .4byte gUnknown_203B464 + thumb_func_end sub_80920D8 + + thumb_func_start sub_80920EC +sub_80920EC: + push {r4,lr} + adds r3, r0, 0 + movs r2, 0 + ldr r4, _0809210C +_080920F4: + ldr r0, [r4] + adds r0, r2 + ldrb r1, [r3] + strb r1, [r0] + adds r3, 0x1 + adds r2, 0x1 + cmp r2, 0x9 + ble _080920F4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0809210C: .4byte gUnknown_203B464 + thumb_func_end sub_80920EC + + thumb_func_start sub_8092110 +sub_8092110: + ldr r0, _08092118 + ldr r0, [r0] + ldr r0, [r0, 0xC] + bx lr + .align 2, 0 +_08092118: .4byte gUnknown_203B464 + thumb_func_end sub_8092110 + + thumb_func_start sub_809211C +sub_809211C: + push {lr} + bl sub_8092178 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6 + beq _08092144 + ldr r1, _0809213C + lsls r0, 2 + adds r0, r1 + ldr r1, _08092140 + ldr r1, [r1] + ldr r0, [r0] + ldr r1, [r1, 0xC] + subs r0, r1 + b _08092146 + .align 2, 0 +_0809213C: .4byte gUnknown_8109810 +_08092140: .4byte gUnknown_203B464 +_08092144: + movs r0, 0 +_08092146: + pop {r1} + bx r1 + thumb_func_end sub_809211C + + thumb_func_start sub_809214C +sub_809214C: + ldr r1, _08092154 + ldr r1, [r1] + str r0, [r1, 0xC] + bx lr + .align 2, 0 +_08092154: .4byte gUnknown_203B464 + thumb_func_end sub_809214C + + thumb_func_start sub_8092158 +sub_8092158: + push {lr} + ldr r1, _08092170 + ldr r2, [r1] + ldr r1, [r2, 0xC] + adds r1, r0 + str r1, [r2, 0xC] + ldr r0, _08092174 + cmp r1, r0 + ble _0809216C + str r0, [r2, 0xC] +_0809216C: + pop {r0} + bx r0 + .align 2, 0 +_08092170: .4byte gUnknown_203B464 +_08092174: .4byte 0x05f5e0ff + thumb_func_end sub_8092158 + + thumb_func_start sub_8092178 +sub_8092178: + push {lr} + movs r1, 0 + ldr r0, _08092190 + ldr r0, [r0] + ldr r3, [r0, 0xC] + ldr r2, _08092194 +_08092184: + ldr r0, [r2] + cmp r3, r0 + bge _08092198 + lsls r0, r1, 24 + lsrs r0, 24 + b _080921A2 + .align 2, 0 +_08092190: .4byte gUnknown_203B464 +_08092194: .4byte gUnknown_8109810 +_08092198: + adds r2, 0x4 + adds r1, 0x1 + cmp r1, 0x6 + ble _08092184 + movs r0, 0x6 +_080921A2: + pop {r1} + bx r1 + thumb_func_end sub_8092178 + + thumb_func_start sub_80921A8 +sub_80921A8: + lsls r0, 24 + ldr r1, _080921B4 + lsrs r0, 22 + adds r0, r1 + ldr r0, [r0] + bx lr + .align 2, 0 +_080921B4: .4byte gUnknown_810B44C + thumb_func_end sub_80921A8 + + thumb_func_start sub_80921B8 +sub_80921B8: + ldr r0, _080921C0 + ldr r0, [r0] + ldrb r0, [r0, 0x10] + bx lr + .align 2, 0 +_080921C0: .4byte gUnknown_203B464 + thumb_func_end sub_80921B8 + + thumb_func_start sub_80921C4 +sub_80921C4: + push {r4-r6,lr} + sub sp, 0x14 + adds r3, r0, 0 + adds r2, r1, 0 + add r6, sp, 0x10 + movs r0, 0xFF + strb r0, [r6] + mov r5, sp + adds r5, 0x11 + movs r0, 0 + strb r0, [r5] + mov r0, sp + adds r1, r3, 0 + bl sub_809486C + ldr r4, _08092228 + ldr r1, [r4] + mov r0, sp + movs r2, 0x58 + bl sub_809488C + ldr r1, [r4] + adds r1, 0xC + mov r0, sp + movs r2, 0x20 + bl sub_809488C + movs r0, 0 + bl sub_80023E4 + ldr r1, [r4] + strb r0, [r1, 0x10] + ldr r0, [r4] + ldrb r0, [r0, 0x10] + adds r1, r5, 0 + cmp r0, 0 + beq _08092210 + adds r1, r6, 0 +_08092210: + mov r0, sp + movs r2, 0x1 + bl sub_809488C + mov r0, sp + bl nullsub_102 + ldr r0, [sp, 0x8] + add sp, 0x14 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08092228: .4byte gUnknown_203B464 + thumb_func_end sub_80921C4 + + thumb_func_start sub_809222C +sub_809222C: + push {r4,r5,lr} + sub sp, 0x14 + adds r3, r0, 0 + adds r2, r1, 0 + mov r0, sp + adds r1, r3, 0 + bl sub_809485C + ldr r5, _0809227C + ldr r1, [r5] + mov r0, sp + movs r2, 0x58 + bl sub_8094924 + ldr r1, [r5] + adds r1, 0xC + mov r0, sp + movs r2, 0x20 + bl sub_8094924 + add r4, sp, 0x10 + mov r0, sp + adds r1, r4, 0 + movs r2, 0x1 + bl sub_8094924 + ldr r2, [r5] + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + strb r0, [r2, 0x10] + mov r0, sp + bl nullsub_102 + ldr r0, [sp, 0x8] + add sp, 0x14 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0809227C: .4byte gUnknown_203B464 + thumb_func_end sub_809222C + + thumb_func_start sub_8092280 +sub_8092280: + lsls r0, 24 + lsrs r0, 24 + bx lr + thumb_func_end sub_8092280 + + thumb_func_start sub_8092288 +sub_8092288: + lsls r0, 24 + lsrs r0, 24 + bx lr + thumb_func_end sub_8092288 + + thumb_func_start sub_8092290 +sub_8092290: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + b _080922A4 +_08092298: + ldrb r0, [r4] + adds r4, 0x1 + bl sub_8092288 + strb r0, [r5] + adds r5, 0x1 +_080922A4: + ldrb r0, [r4] + cmp r0, 0 + bne _08092298 + movs r0, 0 + strb r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8092290 + + thumb_func_start sub_80922B4 +sub_80922B4: + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + b _080922CA +_080922BE: + ldrb r0, [r4] + adds r4, 0x1 + bl sub_8092288 + strb r0, [r6] + adds r6, 0x1 +_080922CA: + adds r0, r5, 0 + subs r5, 0x1 + cmp r0, 0 + ble _080922D8 + ldrb r0, [r4] + cmp r0, 0 + bne _080922BE +_080922D8: + movs r0, 0 + strb r0, [r6] + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80922B4 + + thumb_func_start sub_80922E4 +sub_80922E4: + ldr r1, _080922F0 + lsls r0, 2 + adds r0, r1 + ldr r0, [r0] + bx lr + .align 2, 0 +_080922F0: .4byte gUnknown_810983C + thumb_func_end sub_80922E4 + + thumb_func_start sub_80922F4 +sub_80922F4: + push {lr} + adds r2, r0, 0 + b _08092300 +_080922FA: + strb r0, [r2] + adds r1, 0x1 + adds r2, 0x1 +_08092300: + ldrb r0, [r1] + cmp r0, 0 + bne _080922FA + movs r0, 0 + strb r0, [r2] + pop {r0} + bx r0 + thumb_func_end sub_80922F4 + + thumb_func_start sub_8092310 +sub_8092310: + push {r4,lr} + adds r4, r0, 0 + b _0809231C +_08092316: + strb r0, [r4] + adds r4, 0x1 + adds r1, 0x1 +_0809231C: + adds r0, r2, 0 + subs r2, 0x1 + cmp r0, 0 + ble _0809232E + ldrb r0, [r1] + adds r3, r0, 0 + cmp r3, 0 + bne _08092316 + strb r3, [r4] +_0809232E: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8092310 + + thumb_func_start sub_8092334 +sub_8092334: + lsls r0, 24 + ldr r1, _08092340 + lsrs r0, 22 + adds r0, r1 + ldr r0, [r0] + bx lr + .align 2, 0 +_08092340: .4byte gUnknown_810AD4C + thumb_func_end sub_8092334 + + thumb_func_start sub_8092344 +sub_8092344: + lsls r0, 24 + ldr r1, _08092350 + lsrs r0, 22 + adds r0, r1 + ldr r0, [r0] + bx lr + .align 2, 0 +_08092350: .4byte gUnknown_810AE24 + thumb_func_end sub_8092344 + + thumb_func_start sub_8092354 +sub_8092354: + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08092360 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_08092360: .4byte gUnknown_810AC7C + thumb_func_end sub_8092354 + + thumb_func_start sub_8092364 +sub_8092364: + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08092370 + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_08092370: .4byte gUnknown_810AC6A + thumb_func_end sub_8092364 + + thumb_func_start sub_8092374 +sub_8092374: + push {lr} + lsls r1, 24 + ldr r2, _0809238C + lsrs r1, 22 + adds r1, r2 + ldr r1, [r1] + movs r2, 0x50 + bl strncpy + pop {r0} + bx r0 + .align 2, 0 +_0809238C: .4byte gUnknown_810B4C8 + thumb_func_end sub_8092374 + + thumb_func_start sub_8092390 +sub_8092390: + lsls r0, 24 + ldr r1, _0809239C + lsrs r0, 22 + adds r0, r1 + ldr r0, [r0] + bx lr + .align 2, 0 +_0809239C: .4byte gUnknown_810B988 + thumb_func_end sub_8092390 + + thumb_func_start sub_80923A0 +sub_80923A0: + ldr r1, _080923A8 + ldr r0, _080923AC + str r0, [r1] + bx lr + .align 2, 0 +_080923A8: .4byte gUnknown_203B468 +_080923AC: .4byte gUnknown_2038C28 + thumb_func_end sub_80923A0 + + thumb_func_start sub_80923B0 +sub_80923B0: + ldr r0, _080923B4 + bx lr + .align 2, 0 +_080923B4: .4byte gUnknown_2038C28 + thumb_func_end sub_80923B0 + + thumb_func_start sub_80923B8 +sub_80923B8: + push {lr} + movs r1, 0 + ldr r3, _080923D0 + movs r2, 0 +_080923C0: + ldr r0, [r3] + adds r0, r1 + strb r2, [r0] + adds r1, 0x1 + cmp r1, 0x39 + ble _080923C0 + pop {r0} + bx r0 + .align 2, 0 +_080923D0: .4byte gUnknown_203B468 + thumb_func_end sub_80923B8 + + thumb_func_start sub_80923D4 +sub_80923D4: + push {r4,r5,lr} + adds r4, r0, 0 + movs r3, 0 + movs r1, 0 + ldr r2, _080923F0 +_080923DE: + movs r5, 0 + ldrsh r0, [r2, r5] + adds r3, r0 + cmp r3, r4 + ble _080923F4 + lsls r0, r1, 24 + lsrs r0, 24 + b _080923FE + .align 2, 0 +_080923F0: .4byte gUnknown_810AA90 +_080923F4: + adds r2, 0x8 + adds r1, 0x1 + cmp r1, 0x39 + ble _080923DE + movs r0, 0 +_080923FE: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80923D4 + + thumb_func_start sub_8092404 +sub_8092404: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r10, r1 + lsls r0, 24 + lsrs r0, 24 + mov r9, r0 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + lsls r3, 24 + lsrs r7, r3, 24 + movs r6, 0 + movs r4, 0 + mov r5, r10 +_08092426: + movs r0, 0x58 + adds r1, r4, 0 + muls r1, r0 + ldr r0, _08092494 + ldr r0, [r0] + adds r2, r1, r0 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08092472 + ldrb r0, [r2, 0x2] + cmp r0, 0 + beq _08092448 + mov r0, r8 + cmp r0, 0 + beq _08092472 +_08092448: + movs r1, 0 + ldrb r0, [r2, 0x4] + cmp r0, 0x41 + bne _08092452 + movs r1, 0x1 +_08092452: + cmp r1, 0 + beq _0809245A + cmp r7, 0 + beq _08092472 +_0809245A: + adds r0, r4, 0 + bl sub_80923D4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, r9 + bne _08092472 + cmp r6, 0xF + bgt _08092472 + strh r4, [r5] + adds r5, 0x2 + adds r6, 0x1 +_08092472: + adds r4, 0x1 + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + ble _08092426 + lsls r0, r6, 1 + add r0, r10 + ldr r2, _08092498 + adds r1, r2, 0 + strh r1, [r0] + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08092494: .4byte gUnknown_203B45C +_08092498: .4byte 0x0000ffff + thumb_func_end sub_8092404 + + thumb_func_start sub_809249C +sub_809249C: + push {r4-r7,lr} + lsls r0, 24 + lsrs r6, r0, 24 + lsls r1, 24 + lsrs r7, r1, 24 + ldr r0, _080924F8 + ldr r0, [r0] + adds r0, r6 + ldrb r0, [r0] + cmp r0, 0 + beq _0809251A + movs r5, 0 +_080924B4: + ldr r2, _080924FC + movs r0, 0x58 + adds r1, r5, 0 + muls r1, r0 + ldr r0, [r2] + adds r4, r0, r1 + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08092502 + adds r0, r5, 0 + bl sub_80923D4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, r6 + bne _08092502 + movs r1, 0 + ldrb r0, [r4, 0x4] + cmp r0, 0x41 + bne _080924E2 + movs r1, 0x1 +_080924E2: + cmp r1, 0 + bne _080924F2 + ldrb r1, [r4, 0x2] + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + cmp r0, 0 + beq _08092500 +_080924F2: + movs r7, 0 + b _08092502 + .align 2, 0 +_080924F8: .4byte gUnknown_203B468 +_080924FC: .4byte gUnknown_203B45C +_08092500: + strh r0, [r4] +_08092502: + adds r5, 0x1 + movs r0, 0xCE + lsls r0, 1 + cmp r5, r0 + ble _080924B4 + cmp r7, 0 + beq _0809251A + ldr r0, _08092520 + ldr r0, [r0] + adds r0, r6 + movs r1, 0 + strb r1, [r0] +_0809251A: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08092520: .4byte gUnknown_203B468 + thumb_func_end sub_809249C + + thumb_func_start sub_8092524 +sub_8092524: + lsls r0, 24 + ldr r1, _08092530 + lsrs r0, 22 + adds r0, r1 + ldr r0, [r0] + bx lr + .align 2, 0 +_08092530: .4byte gUnknown_81139D0 + thumb_func_end sub_8092524 + + thumb_func_start sub_8092534 +sub_8092534: + lsls r0, 24 + ldr r1, _08092540 + lsrs r0, 21 + adds r0, r1 + ldrb r0, [r0, 0x2] + bx lr + .align 2, 0 +_08092540: .4byte gUnknown_810AA90 + thumb_func_end sub_8092534 + + thumb_func_start sub_8092544 +sub_8092544: + lsls r0, 24 + ldr r1, _08092554 + lsrs r0, 21 + adds r1, 0x4 + adds r0, r1 + ldr r0, [r0] + bx lr + .align 2, 0 +_08092554: .4byte gUnknown_810AA90 + thumb_func_end sub_8092544 + + thumb_func_start sub_8092558 +sub_8092558: + push {lr} + lsls r2, r1, 24 + ldr r1, _08092570 + ldr r3, _08092574 + lsrs r2, 22 + adds r2, r3 + ldr r2, [r2] + bl sub_800D158 + pop {r0} + bx r0 + .align 2, 0 +_08092570: .4byte gUnknown_81098A4 +_08092574: .4byte gUnknown_81139D0 + thumb_func_end sub_8092558 + + thumb_func_start sub_8092578 +sub_8092578: + push {r4,r5,lr} + sub sp, 0x18 + adds r5, r0, 0 + lsls r1, 24 + lsrs r4, r1, 24 + lsls r2, 24 + cmp r2, 0 + beq _080925C0 + ldr r0, _080925B4 + lsls r1, r4, 3 + adds r0, 0x4 + adds r1, r0 + ldr r0, [r1] + add r1, sp, 0x4 + movs r2, 0x1 + bl sub_8090FEC + ldr r1, _080925B8 + ldr r2, _080925BC + lsls r0, r4, 2 + adds r0, r2 + ldr r2, [r0] + add r0, sp, 0x4 + str r0, [sp] + adds r0, r5, 0 + movs r3, 0x60 + bl sub_800D158 + b _080925CE + .align 2, 0 +_080925B4: .4byte gUnknown_810AA90 +_080925B8: .4byte gUnknown_81098AC +_080925BC: .4byte gUnknown_81139D0 +_080925C0: + ldr r0, _080925D8 + lsls r1, r4, 2 + adds r1, r0 + ldr r1, [r1] + adds r0, r5, 0 + bl strcpy +_080925CE: + add sp, 0x18 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080925D8: .4byte gUnknown_81139D0 + thumb_func_end sub_8092578 + + thumb_func_start sub_80925DC +sub_80925DC: + lsls r0, 24 + ldr r1, _080925E8 + lsrs r0, 22 + adds r0, r1 + ldr r0, [r0] + bx lr + .align 2, 0 +_080925E8: .4byte gUnknown_8113E30 + thumb_func_end sub_80925DC + + thumb_func_start sub_80925EC +sub_80925EC: + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080925FC + ldr r1, [r1] + adds r1, r0 + movs r0, 0x1 + strb r0, [r1] + bx lr + .align 2, 0 +_080925FC: .4byte gUnknown_203B468 + thumb_func_end sub_80925EC + + thumb_func_start sub_8092600 +sub_8092600: + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08092610 + ldr r1, [r1] + adds r1, r0 + ldrb r0, [r1] + bx lr + .align 2, 0 +_08092610: .4byte gUnknown_203B468 + thumb_func_end sub_8092600 + + thumb_func_start sub_8092614 +sub_8092614: + push {lr} + movs r1, 0x1 + ldr r0, _08092628 + ldr r2, [r0] +_0809261C: + adds r0, r2, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0809262C + movs r0, 0 + b _08092634 + .align 2, 0 +_08092628: .4byte gUnknown_203B468 +_0809262C: + adds r1, 0x1 + cmp r1, 0x39 + ble _0809261C + movs r0, 0x1 +_08092634: + pop {r1} + bx r1 + thumb_func_end sub_8092614 + + thumb_func_start sub_8092638 +sub_8092638: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + lsls r2, 24 + lsrs r2, 24 + mov r12, r2 + lsls r3, 24 + lsrs r3, 24 + mov r8, r3 + movs r6, 0 + movs r3, 0 + ldr r2, _080926DC + cmp r3, r5 + bge _0809266E + ldr r1, _080926E0 + adds r3, r5, 0 +_0809265E: + movs r7, 0 + ldrsh r0, [r1, r7] + adds r6, r0 + adds r1, 0x8 + subs r3, 0x1 + cmp r3, 0 + bne _0809265E + adds r3, r5, 0 +_0809266E: + str r6, [r4, 0x8] + ldr r0, [r2] + adds r0, r3 + ldrb r0, [r0] + strb r0, [r4, 0x4] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _080926E8 + movs r0, 0 + strh r0, [r4, 0x2] + ldr r1, _080926E0 + lsls r0, r3, 3 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r4] + movs r3, 0 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r3, r0 + bge _080926EC + ldr r5, _080926E4 +_0809269A: + movs r0, 0x58 + adds r1, r6, 0 + muls r1, r0 + ldr r0, [r5] + adds r2, r0, r1 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080926CC + mov r7, r12 + cmp r7, 0 + beq _080926BA + ldrb r0, [r2, 0x2] + cmp r0, 0 + bne _080926CC +_080926BA: + mov r0, r8 + cmp r0, 0 + beq _080926C6 + ldrb r0, [r2, 0x4] + cmp r0, 0x41 + beq _080926CC +_080926C6: + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] +_080926CC: + adds r3, 0x1 + adds r6, 0x1 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r3, r0 + blt _0809269A + b _080926EC + .align 2, 0 +_080926DC: .4byte gUnknown_203B468 +_080926E0: .4byte gUnknown_810AA90 +_080926E4: .4byte gUnknown_203B45C +_080926E8: + strh r0, [r4, 0x2] + strh r0, [r4] +_080926EC: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8092638 + + thumb_func_start sub_80926F8 +sub_80926F8: + push {r4-r7,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r3, r0, 24 + lsls r2, 24 + lsrs r7, r2, 24 + movs r5, 0 + movs r2, 0 + ldr r0, _08092780 + mov r12, r0 + cmp r2, r3 + bge _08092724 + ldr r1, _08092784 + adds r2, r3, 0 +_08092714: + movs r6, 0 + ldrsh r0, [r1, r6] + adds r5, r0 + adds r1, 0x8 + subs r2, 0x1 + cmp r2, 0 + bne _08092714 + adds r2, r3, 0 +_08092724: + str r5, [r4, 0x8] + mov r1, r12 + ldr r0, [r1] + adds r0, r2 + ldrb r0, [r0] + strb r0, [r4, 0x4] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _0809279C + movs r0, 0 + strh r0, [r4, 0x2] + ldr r1, _08092784 + lsls r0, r2, 3 + adds r0, r1 + ldrh r0, [r0] + strh r0, [r4] + movs r6, 0 + ldrsh r0, [r4, r6] + cmp r0, 0 + ble _080927A0 + ldr r6, _08092788 + adds r2, r0, 0 +_08092752: + movs r0, 0x58 + adds r1, r5, 0 + muls r1, r0 + ldr r0, [r6] + adds r3, r0, r1 + ldrb r1, [r3] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08092792 + ldrb r0, [r3, 0x2] + cmp r0, 0 + bne _08092776 + cmp r7, 0 + bne _0809278C + ldrb r0, [r3, 0x4] + cmp r0, 0x41 + bne _0809278C +_08092776: + ldrh r0, [r4] + subs r0, 0x1 + strh r0, [r4] + b _08092792 + .align 2, 0 +_08092780: .4byte gUnknown_203B468 +_08092784: .4byte gUnknown_810AA90 +_08092788: .4byte gUnknown_203B45C +_0809278C: + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] +_08092792: + subs r2, 0x1 + adds r5, 0x1 + cmp r2, 0 + bne _08092752 + b _080927A0 +_0809279C: + strh r0, [r4, 0x2] + strh r0, [r4] +_080927A0: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80926F8 + + thumb_func_start sub_80927A8 +sub_80927A8: + push {r4,r5,lr} + sub sp, 0x14 + adds r3, r0, 0 + adds r2, r1, 0 + mov r0, sp + adds r1, r3, 0 + bl sub_809486C + movs r4, 0 + add r5, sp, 0x10 +_080927BC: + ldr r0, _080927F0 + ldr r0, [r0] + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _080927CC + movs r0, 0x1 + negs r0, r0 +_080927CC: + str r0, [sp, 0x10] + mov r0, sp + adds r1, r5, 0 + movs r2, 0x1 + bl sub_809488C + adds r4, 0x1 + cmp r4, 0x39 + ble _080927BC + mov r0, sp + bl nullsub_102 + ldr r0, [sp, 0x8] + add sp, 0x14 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080927F0: .4byte gUnknown_203B468 + thumb_func_end sub_80927A8 + + thumb_func_start sub_80927F4 +sub_80927F4: + push {r4-r7,lr} + sub sp, 0x14 + adds r3, r0, 0 + adds r2, r1, 0 + mov r0, sp + adds r1, r3, 0 + bl sub_809485C + movs r4, 0 + add r7, sp, 0x10 + movs r6, 0x1 + ldr r5, _08092828 +_0809280C: + mov r0, sp + adds r1, r7, 0 + movs r2, 0x1 + bl sub_8094924 + ldr r1, [sp, 0x10] + ands r1, r6 + cmp r1, 0 + beq _0809282C + ldr r0, [r5] + adds r0, r4 + strb r6, [r0] + b _08092832 + .align 2, 0 +_08092828: .4byte gUnknown_203B468 +_0809282C: + ldr r0, [r5] + adds r0, r4 + strb r1, [r0] +_08092832: + adds r4, 0x1 + cmp r4, 0x39 + ble _0809280C + mov r0, sp + bl nullsub_102 + ldr r0, [sp, 0x8] + add sp, 0x14 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80927F4 + + thumb_func_start sub_8092848 +sub_8092848: + push {lr} + ldr r0, _08092868 + ldr r1, _0809286C + bl sub_800A9EC + ldr r1, _08092870 + str r0, [r1] + ldr r1, _08092874 + ldr r2, [r0, 0x4] + ldr r0, [r2] + str r0, [r1] + ldr r1, _08092878 + ldr r0, [r2, 0x4] + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_08092868: .4byte gUnknown_81098D0 +_0809286C: .4byte gUnknown_8300500 +_08092870: .4byte gUnknown_2038C64 +_08092874: .4byte gUnknown_2038C68 +_08092878: .4byte gUnknown_2038C6C + thumb_func_end sub_8092848 + + thumb_func_start sub_809287C +sub_809287C: + push {lr} + adds r2, r0, 0 + ldrb r1, [r2] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + bne _08092894 + ldrb r1, [r2, 0x1] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08092898 +_08092894: + movs r0, 0x32 + b _0809289A +_08092898: + movs r0, 0x34 +_0809289A: + pop {r1} + bx r1 + thumb_func_end sub_809287C + + thumb_func_start sub_80928A0 +sub_80928A0: + push {r4,r5,lr} + sub sp, 0x8 + adds r4, r0, 0 + adds r5, r2, 0 + mov r0, sp + bl sub_8093F10 + adds r0, r4, 0 + mov r1, sp + adds r2, r5, 0 + bl sub_80928C0 + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80928A0 + + thumb_func_start sub_80928C0 +sub_80928C0: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x20 + adds r7, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + adds r0, r4, 0 + bl sub_809287C + lsls r0, 24 + lsrs r6, r0, 24 + cmp r5, 0 + bne _080928DE + ldr r5, _080928F0 +_080928DE: + ldrb r1, [r4, 0x5] + cmp r1, 0 + beq _080928F8 + ldr r1, _080928F4 + ldrb r2, [r4, 0x5] + add r0, sp, 0x14 + bl sub_800D158 + b _080928FC + .align 2, 0 +_080928F0: .4byte gUnknown_81098C4 +_080928F4: .4byte gUnknown_81098DC +_080928F8: + add r0, sp, 0x14 + strb r1, [r0] +_080928FC: + ldrb r0, [r5, 0x8] + cmp r0, 0 + beq _08092904 + movs r6, 0x2 +_08092904: + ldrb r0, [r5, 0x9] + cmp r0, 0 + beq _08092918 + ldrh r0, [r4, 0x2] + bl sub_809422C + lsls r0, 24 + cmp r0, 0 + beq _08092918 + movs r6, 0x2 +_08092918: + ldr r0, [r5] + cmp r0, 0x4 + bls _08092920 + b _08092A6A +_08092920: + lsls r0, 2 + ldr r1, _0809292C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0809292C: .4byte _08092930 + .align 2, 0 +_08092930: + .4byte _08092944 + .4byte _0809296C + .4byte _08092998 + .4byte _080929C4 + .4byte _08092A20 +_08092944: + ldr r1, _08092964 + ldrh r2, [r4, 0x2] + ldr r0, _08092968 + ldr r3, [r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + adds r0, r3 + ldr r3, [r0] + add r0, sp, 0x14 + str r0, [sp] + adds r0, r7, 0 + adds r2, r6, 0 + bl sub_800D158 + b _08092A6A + .align 2, 0 +_08092964: .4byte gUnknown_81098E0 +_08092968: .4byte gUnknown_2038C68 +_0809296C: + adds r0, r4, 0 + bl sub_8092BF4 + adds r3, r0, 0 + ldr r1, _0809298C + mov r8, r1 + ldrb r1, [r4] + movs r0, 0x8 + ands r0, r1 + ldr r1, _08092990 + mov r12, r1 + cmp r0, 0 + beq _080929E2 + ldr r0, _08092994 + b _080929E0 + .align 2, 0 +_0809298C: .4byte gUnknown_81098EC +_08092990: .4byte gUnknown_810990C +_08092994: .4byte gUnknown_8109908 +_08092998: + adds r0, r4, 0 + bl sub_8092BF4 + adds r3, r0, 0 + ldr r0, _080929B8 + mov r8, r0 + ldrb r1, [r4] + movs r0, 0x8 + ands r0, r1 + ldr r1, _080929BC + mov r12, r1 + cmp r0, 0 + beq _080929E2 + ldr r0, _080929C0 + b _080929E0 + .align 2, 0 +_080929B8: .4byte gUnknown_8109910 +_080929BC: .4byte gUnknown_810990C +_080929C0: .4byte gUnknown_8109908 +_080929C4: + adds r0, r4, 0 + bl sub_8092BF4 + adds r3, r0, 0 + ldr r0, _08092A10 + mov r8, r0 + ldrb r1, [r4] + movs r0, 0x4 + ands r0, r1 + ldr r1, _08092A14 + mov r12, r1 + cmp r0, 0 + beq _080929E2 + ldr r0, _08092A18 +_080929E0: + mov r12, r0 +_080929E2: + ldrh r1, [r4, 0x2] + ldr r0, _08092A1C + ldr r2, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + str r0, [sp] + add r1, sp, 0x14 + str r1, [sp, 0x4] + ldr r0, [r5, 0x4] + str r0, [sp, 0x8] + ldrb r0, [r4, 0x4] + str r0, [sp, 0xC] + str r3, [sp, 0x10] + adds r0, r7, 0 + mov r1, r8 + adds r2, r6, 0 + mov r3, r12 + bl sub_800D158 + b _08092A6A + .align 2, 0 +_08092A10: .4byte gUnknown_81098EC +_08092A14: .4byte gUnknown_810990C +_08092A18: .4byte gUnknown_8109928 +_08092A1C: .4byte gUnknown_2038C68 +_08092A20: + adds r0, r4, 0 + bl sub_8092BF4 + adds r3, r0, 0 + ldr r0, _08092A78 + mov r8, r0 + ldrb r1, [r4] + movs r0, 0x4 + ands r0, r1 + ldr r1, _08092A7C + mov r12, r1 + cmp r0, 0 + beq _08092A3E + ldr r0, _08092A80 + mov r12, r0 +_08092A3E: + ldrh r1, [r4, 0x2] + ldr r0, _08092A84 + ldr r2, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r0, [r0] + str r0, [sp] + add r1, sp, 0x14 + str r1, [sp, 0x4] + ldr r0, [r5, 0x4] + str r0, [sp, 0x8] + ldrb r0, [r4, 0x4] + str r0, [sp, 0xC] + str r3, [sp, 0x10] + adds r0, r7, 0 + mov r1, r8 + adds r2, r6, 0 + mov r3, r12 + bl sub_800D158 +_08092A6A: + add sp, 0x20 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08092A78: .4byte gUnknown_8109910 +_08092A7C: .4byte gUnknown_810990C +_08092A80: .4byte gUnknown_8109928 +_08092A84: .4byte gUnknown_2038C68 + thumb_func_end sub_80928C0 + + thumb_func_start sub_8092A88 +sub_8092A88: + push {r4,r5,lr} + adds r4, r0, 0 + movs r2, 0 + movs r0, 0x5 + strb r0, [r4] + strb r2, [r4, 0x1] + movs r5, 0 + strh r1, [r4, 0x2] + adds r0, r4, 0 + bl sub_8092BF4 + strb r0, [r4, 0x4] + strb r5, [r4, 0x5] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8092A88 + + thumb_func_start sub_8092AA8 +sub_8092AA8: + push {r4,r5,lr} + adds r5, r0, 0 + lsls r1, 16 + lsrs r2, r1, 16 + cmp r2, 0 + bne _08092AB8 + strb r2, [r5] + b _08092ACE +_08092AB8: + movs r1, 0 + movs r0, 0x5 + strb r0, [r5] + strb r1, [r5, 0x1] + movs r4, 0 + strh r2, [r5, 0x2] + adds r0, r5, 0 + bl sub_8092BF4 + strb r0, [r5, 0x4] + strb r4, [r5, 0x5] +_08092ACE: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8092AA8 + + thumb_func_start sub_8092AD4 +sub_8092AD4: + movs r2, 0x5 + strb r2, [r0] + movs r2, 0 + strh r1, [r0, 0x2] + strb r2, [r0, 0x4] + bx lr + thumb_func_end sub_8092AD4 + + thumb_func_start sub_8092AE0 +sub_8092AE0: + ldrh r2, [r0, 0x2] + ldr r0, _08092AFC + ldr r3, [r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + adds r0, r3 + lsls r1, 1 + adds r0, 0x8 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + bx lr + .align 2, 0 +_08092AFC: .4byte gUnknown_2038C68 + thumb_func_end sub_8092AE0 + + thumb_func_start sub_8092B00 +sub_8092B00: + ldrh r1, [r0, 0x2] + ldr r0, _08092B14 + ldr r2, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x6] + bx lr + .align 2, 0 +_08092B14: .4byte gUnknown_2038C68 + thumb_func_end sub_8092B00 + + thumb_func_start sub_8092B18 +sub_8092B18: + push {lr} + lsls r0, 16 + asrs r1, r0, 16 + adds r2, r1, 0 + ldr r0, _08092B40 + cmp r1, r0 + beq _08092B48 + cmp r1, 0 + beq _08092B48 + movs r0, 0xD2 + lsls r0, 1 + cmp r2, r0 + beq _08092B48 + ldr r0, _08092B44 + ldr r1, [r0] + lsls r0, r2, 3 + adds r0, r1 + ldr r0, [r0] + b _08092B4A + .align 2, 0 +_08092B40: .4byte 0x000001a5 +_08092B44: .4byte gUnknown_2038C6C +_08092B48: + ldr r0, _08092B50 +_08092B4A: + pop {r1} + bx r1 + .align 2, 0 +_08092B50: .4byte gUnknown_810992B + thumb_func_end sub_8092B18 + + thumb_func_start sub_8092B54 +sub_8092B54: + push {lr} + lsls r0, 16 + asrs r1, r0, 16 + adds r2, r1, 0 + ldr r0, _08092B7C + cmp r1, r0 + beq _08092B84 + cmp r1, 0 + beq _08092B84 + movs r0, 0xD2 + lsls r0, 1 + cmp r2, r0 + beq _08092B84 + ldr r0, _08092B80 + ldr r1, [r0] + lsls r0, r2, 3 + adds r0, r1 + ldr r0, [r0, 0x4] + b _08092B86 + .align 2, 0 +_08092B7C: .4byte 0x000001a5 +_08092B80: .4byte gUnknown_2038C6C +_08092B84: + ldr r0, _08092B8C +_08092B86: + pop {r1} + bx r1 + .align 2, 0 +_08092B8C: .4byte gUnknown_810992B + thumb_func_end sub_8092B54 + + thumb_func_start sub_8092B90 +sub_8092B90: + ldrh r1, [r0, 0x2] + ldr r0, _08092BA4 + ldr r2, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0xD] + bx lr + .align 2, 0 +_08092BA4: .4byte gUnknown_2038C68 + thumb_func_end sub_8092B90 + + thumb_func_start sub_8092BA8 +sub_8092BA8: + ldrh r1, [r0, 0x2] + ldr r0, _08092BBC + ldr r2, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x11] + bx lr + .align 2, 0 +_08092BBC: .4byte gUnknown_2038C68 + thumb_func_end sub_8092BA8 + + thumb_func_start sub_8092BC0 +sub_8092BC0: + ldrh r1, [r0, 0x2] + ldr r0, _08092BD4 + ldr r2, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + movs r1, 0x4 + ldrsh r0, [r0, r1] + bx lr + .align 2, 0 +_08092BD4: .4byte gUnknown_2038C68 + thumb_func_end sub_8092BC0 + + thumb_func_start sub_8092BD8 +sub_8092BD8: + ldrh r2, [r0, 0x2] + ldr r0, _08092BF0 + ldr r3, [r0] + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + adds r0, r3 + adds r0, 0xE + adds r0, r1 + ldrb r0, [r0] + bx lr + .align 2, 0 +_08092BF0: .4byte gUnknown_2038C68 + thumb_func_end sub_8092BD8 + + thumb_func_start sub_8092BF4 +sub_8092BF4: + ldrh r1, [r0, 0x2] + ldr r0, _08092C08 + ldr r2, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0xC] + bx lr + .align 2, 0 +_08092C08: .4byte gUnknown_2038C68 + thumb_func_end sub_8092BF4 + + thumb_func_start sub_8092C0C +sub_8092C0C: + ldrh r1, [r0, 0x2] + ldr r0, _08092C20 + ldr r2, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x12] + bx lr + .align 2, 0 +_08092C20: .4byte gUnknown_2038C68 + thumb_func_end sub_8092C0C + + thumb_func_start sub_8092C24 +sub_8092C24: + ldrh r1, [r0, 0x2] + ldr r0, _08092C38 + ldr r2, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x13] + bx lr + .align 2, 0 +_08092C38: .4byte gUnknown_2038C68 + thumb_func_end sub_8092C24 + + thumb_func_start sub_8092C3C +sub_8092C3C: + ldrh r1, [r0, 0x2] + ldr r0, _08092C50 + ldr r2, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x17] + bx lr + .align 2, 0 +_08092C50: .4byte gUnknown_2038C68 + thumb_func_end sub_8092C3C + + thumb_func_start sub_8092C54 +sub_8092C54: + ldrh r1, [r0, 0x2] + ldr r0, _08092C68 + ldr r2, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x18] + bx lr + .align 2, 0 +_08092C68: .4byte gUnknown_2038C68 + thumb_func_end sub_8092C54 + + thumb_func_start sub_8092C6C +sub_8092C6C: + ldrh r1, [r0, 0x2] + ldr r0, _08092C80 + ldr r2, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x19] + bx lr + .align 2, 0 +_08092C80: .4byte gUnknown_2038C68 + thumb_func_end sub_8092C6C + + thumb_func_start sub_8092C84 +sub_8092C84: + push {r4,lr} + sub sp, 0x8 + adds r4, r0, 0 + lsls r1, 16 + lsrs r1, 16 + mov r0, sp + bl sub_8092A88 + adds r0, r4, 0 + mov r1, sp + movs r2, 0 + bl sub_80928C0 + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8092C84 + + thumb_func_start sub_8092CA8 +sub_8092CA8: + lsls r0, 16 + lsrs r0, 16 + ldr r1, _08092CBC + ldr r2, [r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldr r0, [r1, 0x20] + bx lr + .align 2, 0 +_08092CBC: .4byte gUnknown_2038C68 + thumb_func_end sub_8092CA8 + + thumb_func_start sub_8092CC0 +sub_8092CC0: + lsls r0, 16 + lsrs r0, 16 + ldr r1, _08092CD4 + ldr r2, [r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x14] + bx lr + .align 2, 0 +_08092CD4: .4byte gUnknown_2038C68 + thumb_func_end sub_8092CC0 + + thumb_func_start sub_8092CD8 +sub_8092CD8: + lsls r0, 16 + lsrs r0, 16 + ldr r1, _08092CEC + ldr r2, [r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x15] + bx lr + .align 2, 0 +_08092CEC: .4byte gUnknown_2038C68 + thumb_func_end sub_8092CD8 + + thumb_func_start sub_8092CF0 +sub_8092CF0: + lsls r0, 16 + lsrs r0, 16 + ldr r1, _08092D04 + ldr r2, [r1] + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + adds r1, r2 + ldrb r0, [r1, 0x16] + bx lr + .align 2, 0 +_08092D04: .4byte gUnknown_2038C68 + thumb_func_end sub_8092CF0 + + thumb_func_start sub_8092D08 +sub_8092D08: + push {lr} + adds r2, r0, 0 + ldrh r1, [r2, 0x2] + cmp r1, 0xD9 + beq _08092D4C + movs r0, 0x8E + lsls r0, 1 + cmp r1, r0 + beq _08092D4C + cmp r1, 0x53 + beq _08092D4C + cmp r1, 0x22 + beq _08092D4C + cmp r1, 0x54 + beq _08092D4C + cmp r1, 0xAB + beq _08092D4C + ldr r0, _08092D48 + cmp r1, r0 + beq _08092D4C + cmp r1, 0x1B + beq _08092D4C + cmp r1, 0xF1 + beq _08092D4C + cmp r1, 0x19 + beq _08092D4C + ldrh r0, [r2, 0x2] + cmp r0, 0x1A + beq _08092D4C + movs r0, 0 + b _08092D4E + .align 2, 0 +_08092D48: .4byte 0x00000125 +_08092D4C: + movs r0, 0x1 +_08092D4E: + pop {r1} + bx r1 + thumb_func_end sub_8092D08 + + thumb_func_start sub_8092D54 +sub_8092D54: + push {r4-r6,lr} + adds r6, r0, 0 + adds r0, r1, 0 + ldr r5, _08092D78 + ldr r4, _08092D7C + bl sub_8092C6C + lsls r0, 2 + adds r0, r4 + ldr r2, [r0] + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_800D158 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08092D78: .4byte gUnknown_810992C +_08092D7C: .4byte gUnknown_810CC0C + thumb_func_end sub_8092D54 + + thumb_func_start sub_8092D80 +sub_8092D80: + push {r4,r5,lr} + adds r3, r1, 0 + movs r5, 0 + lsls r1, r3, 3 + adds r1, r0 +_08092D8A: + adds r1, 0x8 + adds r3, 0x1 + cmp r3, 0x4 + beq _08092DB0 + ldrb r2, [r1] + movs r4, 0x1 + adds r0, r4, 0 + ands r0, r2 + cmp r0, 0 + beq _08092DB0 + lsrs r0, r2, 1 + ands r0, r4 + cmp r0, 0 + bne _08092DAA + adds r0, r3, 0 + b _08092DB2 +_08092DAA: + adds r5, 0x1 + cmp r5, 0x3 + ble _08092D8A +_08092DB0: + movs r0, 0 +_08092DB2: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8092D80 + + thumb_func_start sub_8092DB8 +sub_8092DB8: + push {r4-r6,lr} + adds r4, r0, 0 + movs r5, 0 + movs r6, 0x1 +_08092DC0: + subs r1, 0x1 + cmp r1, 0 + bge _08092DF0 + movs r2, 0x3 + ldrb r1, [r4, 0x18] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _08092DD6 + movs r1, 0x3 + b _08092DEC +_08092DD6: + subs r2, 0x1 + cmp r2, 0 + blt _08092E12 + lsls r0, r2, 3 + adds r0, r4 + ldrb r1, [r0] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _08092DD6 + adds r1, r2, 0 +_08092DEC: + cmp r2, 0 + blt _08092E12 +_08092DF0: + lsls r0, r1, 3 + adds r0, r4 + ldrb r2, [r0] + movs r3, 0x1 + adds r0, r3, 0 + ands r0, r2 + cmp r0, 0 + beq _08092E12 + lsrs r0, r2, 1 + ands r0, r3 + cmp r0, 0 + bne _08092E0C + adds r0, r1, 0 + b _08092E14 +_08092E0C: + adds r5, 0x1 + cmp r5, 0x3 + ble _08092DC0 +_08092E12: + movs r0, 0 +_08092E14: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8092DB8 + + thumb_func_start sub_8092E1C +sub_8092E1C: + push {r4,r5,lr} + adds r3, r1, 0 + movs r5, 0 + lsls r1, r3, 3 + adds r1, r0 +_08092E26: + adds r1, 0x8 + adds r3, 0x1 + cmp r3, 0x8 + beq _08092E4C + ldrb r2, [r1] + movs r4, 0x1 + adds r0, r4, 0 + ands r0, r2 + cmp r0, 0 + beq _08092E4C + lsrs r0, r2, 1 + ands r0, r4 + cmp r0, 0 + bne _08092E46 + adds r0, r3, 0 + b _08092E4E +_08092E46: + adds r5, 0x1 + cmp r5, 0x7 + ble _08092E26 +_08092E4C: + movs r0, 0 +_08092E4E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8092E1C + + thumb_func_start sub_8092E54 +sub_8092E54: + push {r4,r5,lr} + adds r3, r1, 0 + movs r5, 0 + lsls r1, r3, 3 + adds r1, r0 +_08092E5E: + adds r1, 0x8 + adds r3, 0x1 + cmp r3, 0x8 + beq _08092E84 + ldrb r2, [r1] + movs r4, 0x1 + adds r0, r4, 0 + ands r0, r2 + cmp r0, 0 + beq _08092E84 + lsrs r0, r2, 1 + ands r0, r4 + cmp r0, 0 + bne _08092E7E + adds r0, r3, 0 + b _08092E86 +_08092E7E: + adds r5, 0x1 + cmp r5, 0x7 + ble _08092E5E +_08092E84: + movs r0, 0 +_08092E86: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8092E54 + + thumb_func_start sub_8092E8C +sub_8092E8C: + push {r4-r6,lr} + adds r6, r0, 0 + movs r5, 0 + lsls r0, r1, 3 + adds r3, r0, r6 +_08092E96: + subs r3, 0x8 + subs r1, 0x1 + cmp r1, 0 + bge _08092EC6 + movs r3, 0x7 + movs r4, 0x1 + adds r2, r6, 0 + adds r2, 0x38 +_08092EA6: + ldrb r1, [r2] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _08092EBC + lsrs r0, r1, 1 + ands r0, r4 + cmp r0, 0 + bne _08092EBC + adds r0, r3, 0 + b _08092EE6 +_08092EBC: + subs r2, 0x8 + subs r3, 0x1 + cmp r3, 0 + bgt _08092EA6 + b _08092EE4 +_08092EC6: + ldrb r2, [r3] + movs r4, 0x1 + adds r0, r4, 0 + ands r0, r2 + cmp r0, 0 + beq _08092EE4 + lsrs r0, r2, 1 + ands r0, r4 + cmp r0, 0 + bne _08092EDE + adds r0, r1, 0 + b _08092EE6 +_08092EDE: + adds r5, 0x1 + cmp r5, 0x7 + ble _08092E96 +_08092EE4: + movs r0, 0 +_08092EE6: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8092E8C + + thumb_func_start sub_8092EEC +sub_8092EEC: + push {r4-r6,lr} + adds r6, r0, 0 + movs r5, 0 + lsls r0, r1, 3 + adds r3, r0, r6 +_08092EF6: + subs r3, 0x8 + subs r1, 0x1 + cmp r1, 0 + bge _08092F26 + movs r3, 0x7 + movs r4, 0x1 + adds r2, r6, 0 + adds r2, 0x38 +_08092F06: + ldrb r1, [r2] + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + beq _08092F1C + lsrs r0, r1, 1 + ands r0, r4 + cmp r0, 0 + bne _08092F1C + adds r0, r3, 0 + b _08092F46 +_08092F1C: + subs r2, 0x8 + subs r3, 0x1 + cmp r3, 0 + bgt _08092F06 + b _08092F44 +_08092F26: + ldrb r2, [r3] + movs r4, 0x1 + adds r0, r4, 0 + ands r0, r2 + cmp r0, 0 + beq _08092F44 + lsrs r0, r2, 1 + ands r0, r4 + cmp r0, 0 + bne _08092F3E + adds r0, r1, 0 + b _08092F46 +_08092F3E: + adds r5, 0x1 + cmp r5, 0x7 + ble _08092EF6 +_08092F44: + movs r0, 0 +_08092F46: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8092EEC + + thumb_func_start sub_8092F4C +sub_8092F4C: + push {r4,lr} + adds r2, r0, 0 + cmp r1, 0 + ble _08092F78 + movs r4, 0x1 + lsls r0, r1, 3 + adds r3, r0, r2 +_08092F5A: + ldrb r2, [r3] + adds r0, r4, 0 + ands r0, r2 + cmp r0, 0 + beq _08092F78 + lsrs r0, r2, 1 + ands r0, r4 + cmp r0, 0 + bne _08092F70 + adds r0, r1, 0 + b _08092F7A +_08092F70: + subs r3, 0x8 + subs r1, 0x1 + cmp r1, 0 + bgt _08092F5A +_08092F78: + movs r0, 0 +_08092F7A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8092F4C + + thumb_func_start sub_8092F80 +sub_8092F80: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x80 + adds r7, r0, 0 + mov r8, r1 + lsls r0, r1, 3 + adds r0, r7, r0 + ldrb r2, [r0] + movs r1, 0x80 + orrs r1, r2 + strb r1, [r0] + adds r0, r7, 0 + mov r1, sp + bl sub_8093784 + mov r0, sp + bl sub_8093744 + adds r3, r0, 0 + cmp r3, 0x2 + bhi _08092FCC + lsls r1, r3, 5 + adds r0, r3, 0x1 + lsls r0, 5 + mov r2, sp + adds r5, r0, r2 + adds r4, r1, r2 + movs r6, 0x3 +_08092FBA: + ldr r2, [r4] + ldr r3, [r4, 0x4] + ldr r0, [r5] + ldr r1, [r5, 0x4] + stm r4!, {r0,r1} + stm r5!, {r2,r3} + subs r6, 0x1 + cmp r6, 0 + bge _08092FBA +_08092FCC: + adds r0, r7, 0 + mov r1, sp + bl sub_80937E0 + movs r3, 0 + movs r5, 0x80 + movs r4, 0x7F + adds r1, r7, 0 +_08092FDC: + ldrb r2, [r1] + adds r0, r5, 0 + ands r0, r2 + cmp r0, 0 + beq _08092FF0 + adds r0, r4, 0 + ands r0, r2 + strb r0, [r1] + mov r8, r3 + b _08092FF8 +_08092FF0: + adds r1, 0x8 + adds r3, 0x1 + cmp r3, 0x3 + ble _08092FDC +_08092FF8: + mov r0, r8 + add sp, 0x80 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8092F80 + + thumb_func_start sub_8093008 +sub_8093008: + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, _0809307C + add sp, r4 + adds r7, r0, 0 + mov r8, r1 + lsls r0, r1, 3 + adds r0, r7, r0 + ldrb r2, [r0] + movs r1, 0x80 + orrs r1, r2 + strb r1, [r0] + adds r0, r7, 0 + mov r1, sp + bl sub_8093974 + mov r0, sp + bl sub_80938F4 + adds r3, r0, 0 + cmp r3, 0x6 + bhi _08093056 + lsls r1, r3, 6 + adds r0, r3, 0x1 + lsls r0, 6 + mov r2, sp + adds r5, r0, r2 + adds r4, r1, r2 + movs r6, 0x7 +_08093044: + ldr r2, [r4] + ldr r3, [r4, 0x4] + ldr r0, [r5] + ldr r1, [r5, 0x4] + stm r4!, {r0,r1} + stm r5!, {r2,r3} + subs r6, 0x1 + cmp r6, 0 + bge _08093044 +_08093056: + adds r0, r7, 0 + mov r1, sp + bl sub_8093A2C + movs r3, 0 + movs r5, 0x80 + movs r4, 0x7F + adds r1, r7, 0 +_08093066: + ldrb r2, [r1] + adds r0, r5, 0 + ands r0, r2 + cmp r0, 0 + beq _08093080 + adds r0, r4, 0 + ands r0, r2 + strb r0, [r1] + mov r8, r3 + b _08093088 + .align 2, 0 +_0809307C: .4byte 0xfffffe00 +_08093080: + adds r1, 0x8 + adds r3, 0x1 + cmp r3, 0x7 + ble _08093066 +_08093088: + mov r0, r8 + movs r3, 0x80 + lsls r3, 2 + add sp, r3 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8093008 + + thumb_func_start sub_809309C +sub_809309C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, _08093110 + add sp, r4 + adds r7, r0, 0 + mov r8, r1 + lsls r0, r1, 3 + adds r0, r7, r0 + ldrb r2, [r0] + movs r1, 0x80 + orrs r1, r2 + strb r1, [r0] + adds r0, r7, 0 + mov r1, sp + bl sub_80939D0 + mov r0, sp + bl sub_8093934 + adds r3, r0, 0 + cmp r3, 0x6 + bhi _080930EA + lsls r1, r3, 6 + adds r0, r3, 0x1 + lsls r0, 6 + mov r2, sp + adds r5, r0, r2 + adds r4, r1, r2 + movs r6, 0x7 +_080930D8: + ldr r2, [r4] + ldr r3, [r4, 0x4] + ldr r0, [r5] + ldr r1, [r5, 0x4] + stm r4!, {r0,r1} + stm r5!, {r2,r3} + subs r6, 0x1 + cmp r6, 0 + bge _080930D8 +_080930EA: + adds r0, r7, 0 + mov r1, sp + bl sub_8093B40 + movs r3, 0 + movs r5, 0x80 + movs r4, 0x7F + adds r1, r7, 0 +_080930FA: + ldrb r2, [r1] + adds r0, r5, 0 + ands r0, r2 + cmp r0, 0 + beq _08093114 + adds r0, r4, 0 + ands r0, r2 + strb r0, [r1] + mov r8, r3 + b _0809311C + .align 2, 0 +_08093110: .4byte 0xfffffe00 +_08093114: + adds r1, 0x8 + adds r3, 0x1 + cmp r3, 0x7 + ble _080930FA +_0809311C: + mov r0, r8 + movs r3, 0x80 + lsls r3, 2 + add sp, r3 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_809309C + + thumb_func_start sub_8093130 +sub_8093130: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x80 + adds r7, r0, 0 + mov r8, r1 + lsls r0, r1, 3 + adds r0, r7, r0 + ldrb r2, [r0] + movs r1, 0x80 + orrs r1, r2 + strb r1, [r0] + adds r0, r7, 0 + mov r1, sp + bl sub_8093784 + mov r0, sp + bl sub_8093744 + adds r1, r0, 0 + subs r0, r1, 0x1 + cmp r0, 0x2 + bhi _0809317C + lsls r1, 5 + lsls r0, 5 + mov r2, sp + adds r5, r0, r2 + adds r4, r1, r2 + movs r6, 0x3 +_0809316A: + ldr r2, [r4] + ldr r3, [r4, 0x4] + ldr r0, [r5] + ldr r1, [r5, 0x4] + stm r4!, {r0,r1} + stm r5!, {r2,r3} + subs r6, 0x1 + cmp r6, 0 + bge _0809316A +_0809317C: + adds r0, r7, 0 + mov r1, sp + bl sub_80937E0 + movs r1, 0 + movs r5, 0x80 + movs r4, 0x7F + adds r2, r7, 0 +_0809318C: + ldrb r3, [r2] + adds r0, r5, 0 + ands r0, r3 + cmp r0, 0 + beq _080931A0 + adds r0, r4, 0 + ands r0, r3 + strb r0, [r2] + mov r8, r1 + b _080931A8 +_080931A0: + adds r2, 0x8 + adds r1, 0x1 + cmp r1, 0x3 + ble _0809318C +_080931A8: + mov r0, r8 + add sp, 0x80 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8093130 + + thumb_func_start sub_80931B8 +sub_80931B8: + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, _0809322C + add sp, r4 + adds r7, r0, 0 + mov r8, r1 + lsls r0, r1, 3 + adds r0, r7, r0 + ldrb r2, [r0] + movs r1, 0x80 + orrs r1, r2 + strb r1, [r0] + adds r0, r7, 0 + mov r1, sp + bl sub_8093974 + mov r0, sp + bl sub_80938F4 + adds r1, r0, 0 + subs r0, r1, 0x1 + cmp r0, 0x6 + bhi _08093206 + lsls r1, 6 + lsls r0, 6 + mov r2, sp + adds r5, r0, r2 + adds r4, r1, r2 + movs r6, 0x7 +_080931F4: + ldr r2, [r4] + ldr r3, [r4, 0x4] + ldr r0, [r5] + ldr r1, [r5, 0x4] + stm r4!, {r0,r1} + stm r5!, {r2,r3} + subs r6, 0x1 + cmp r6, 0 + bge _080931F4 +_08093206: + adds r0, r7, 0 + mov r1, sp + bl sub_8093A2C + movs r1, 0 + movs r5, 0x80 + movs r4, 0x7F + adds r2, r7, 0 +_08093216: + ldrb r3, [r2] + adds r0, r5, 0 + ands r0, r3 + cmp r0, 0 + beq _08093230 + adds r0, r4, 0 + ands r0, r3 + strb r0, [r2] + mov r8, r1 + b _08093238 + .align 2, 0 +_0809322C: .4byte 0xfffffe00 +_08093230: + adds r2, 0x8 + adds r1, 0x1 + cmp r1, 0x7 + ble _08093216 +_08093238: + mov r0, r8 + movs r3, 0x80 + lsls r3, 2 + add sp, r3 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80931B8 + + thumb_func_start sub_809324C +sub_809324C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, _080932C0 + add sp, r4 + adds r7, r0, 0 + mov r8, r1 + lsls r0, r1, 3 + adds r0, r7, r0 + ldrb r2, [r0] + movs r1, 0x80 + orrs r1, r2 + strb r1, [r0] + adds r0, r7, 0 + mov r1, sp + bl sub_80939D0 + mov r0, sp + bl sub_8093934 + adds r1, r0, 0 + subs r0, r1, 0x1 + cmp r0, 0x6 + bhi _0809329A + lsls r1, 6 + lsls r0, 6 + mov r2, sp + adds r5, r0, r2 + adds r4, r1, r2 + movs r6, 0x7 +_08093288: + ldr r2, [r4] + ldr r3, [r4, 0x4] + ldr r0, [r5] + ldr r1, [r5, 0x4] + stm r4!, {r0,r1} + stm r5!, {r2,r3} + subs r6, 0x1 + cmp r6, 0 + bge _08093288 +_0809329A: + adds r0, r7, 0 + mov r1, sp + bl sub_8093B40 + movs r1, 0 + movs r5, 0x80 + movs r4, 0x7F + adds r2, r7, 0 +_080932AA: + ldrb r3, [r2] + adds r0, r5, 0 + ands r0, r3 + cmp r0, 0 + beq _080932C4 + adds r0, r4, 0 + ands r0, r3 + strb r0, [r2] + mov r8, r1 + b _080932CC + .align 2, 0 +_080932C0: .4byte 0xfffffe00 +_080932C4: + adds r2, 0x8 + adds r1, 0x1 + cmp r1, 0x7 + ble _080932AA +_080932CC: + mov r0, r8 + movs r3, 0x80 + lsls r3, 2 + add sp, r3 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_809324C + + thumb_func_start sub_80932E0 +sub_80932E0: + push {lr} + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _080932F4 + movs r0, 0 + b _080932F6 +_080932F4: + movs r0, 0x1 +_080932F6: + pop {r1} + bx r1 + thumb_func_end sub_80932E0 + + thumb_func_start sub_80932FC +sub_80932FC: + push {lr} + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _08093310 + movs r0, 0 + b _08093312 +_08093310: + movs r0, 0x1 +_08093312: + pop {r1} + bx r1 + thumb_func_end sub_80932FC + + thumb_func_start sub_8093318 +sub_8093318: + push {r4,lr} + sub sp, 0x40 + adds r4, r0, 0 + mov r0, sp + movs r2, 0x40 + bl MemoryCopy8 + adds r0, r4, 0 + mov r1, sp + bl sub_8093400 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x40 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8093318 + + thumb_func_start sub_809333C +sub_809333C: + push {r4,lr} + sub sp, 0x40 + adds r4, r0, 0 + mov r0, sp + movs r2, 0x40 + bl MemoryCopy8 + adds r0, r4, 0 + mov r1, sp + bl sub_8093468 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x40 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809333C + + thumb_func_start sub_8093360 +sub_8093360: + push {r4,lr} + sub sp, 0x40 + adds r4, r0, 0 + mov r0, sp + movs r2, 0x40 + bl MemoryCopy8 + adds r0, r4, 0 + mov r1, sp + bl sub_80933D8 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x40 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8093360 + + thumb_func_start sub_8093384 +sub_8093384: + push {lr} + lsls r0, 3 + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _08093398 + movs r0, 0x1 + b _0809339A +_08093398: + movs r0, 0 +_0809339A: + pop {r1} + bx r1 + thumb_func_end sub_8093384 + + thumb_func_start sub_80933A0 +sub_80933A0: + push {r4-r6,lr} + movs r4, 0 + movs r6, 0x1 + movs r5, 0x2 + movs r3, 0x7 +_080933AA: + ldrb r2, [r1] + adds r0, r6, 0 + ands r0, r2 + cmp r0, 0 + beq _080933BE + adds r0, r5, 0 + ands r0, r2 + cmp r0, 0 + bne _080933BE + adds r4, 0x1 +_080933BE: + adds r1, 0x8 + subs r3, 0x1 + cmp r3, 0 + bge _080933AA + cmp r4, 0x1 + bgt _080933CE + movs r0, 0 + b _080933D0 +_080933CE: + movs r0, 0x1 +_080933D0: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80933A0 + + thumb_func_start sub_80933D8 +sub_80933D8: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + bl sub_8093400 + lsls r0, 24 + cmp r0, 0 + bne _080933F6 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8093468 + lsls r0, 24 + lsrs r0, 24 + b _080933F8 +_080933F6: + movs r0, 0x1 +_080933F8: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80933D8 + + thumb_func_start sub_8093400 +sub_8093400: + push {r4-r7,lr} + adds r4, r0, 0 + adds r7, r1, 0 + lsls r0, r4, 3 + adds r0, r7, r0 + ldrh r0, [r0, 0x2] + bl sub_809422C + lsls r0, 24 + cmp r0, 0 + beq _08093428 + b _08093460 +_08093418: + adds r0, r1, 0 + orrs r0, r2 + strb r0, [r6] + adds r0, r7, 0 + bl sub_809371C + movs r0, 0x1 + b _08093462 +_08093428: + adds r5, r4, 0x1 + cmp r5, 0x7 + bgt _08093460 + lsls r0, r5, 3 + adds r4, r0, r7 + adds r6, r4, 0 +_08093434: + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08093460 + ldrh r0, [r4, 0x2] + bl sub_809422C + lsls r0, 24 + cmp r0, 0 + bne _08093460 + ldrb r1, [r4] + movs r2, 0x2 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08093418 + adds r4, 0x8 + adds r6, 0x8 + adds r5, 0x1 + cmp r5, 0x7 + ble _08093434 +_08093460: + movs r0, 0 +_08093462: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8093400 + + thumb_func_start sub_8093468 +sub_8093468: + push {r4-r7,lr} + adds r6, r1, 0 + movs r5, 0 + adds r1, r0, 0x1 + movs r4, 0 + cmp r1, 0x7 + bgt _080934A0 + movs r0, 0x2 + mov r12, r0 + movs r7, 0xFD + lsls r0, r1, 3 + adds r3, r0, r6 +_08093480: + ldrb r2, [r3] + mov r0, r12 + ands r0, r2 + cmp r0, 0 + beq _080934A0 + adds r0, r7, 0 + ands r0, r2 + strb r0, [r3] + movs r5, 0x1 + adds r3, 0x8 + adds r1, 0x1 + adds r4, 0x1 + cmp r4, 0x7 + bgt _080934A0 + cmp r1, 0x7 + ble _08093480 +_080934A0: + adds r0, r6, 0 + bl sub_809371C + adds r0, r5, 0 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8093468 + + thumb_func_start sub_80934B0 +sub_80934B0: + push {lr} + adds r2, r0, 0 + adds r0, r2, 0x1 + cmp r0, 0x7 + bgt _080934D2 + lsls r0, r2, 3 + adds r0, 0x8 + adds r0, r1, r0 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080934D2 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _080934D6 +_080934D2: + movs r0, 0 + b _080934D8 +_080934D6: + movs r0, 0x1 +_080934D8: + pop {r1} + bx r1 + thumb_func_end sub_80934B0 + + thumb_func_start sub_80934DC +sub_80934DC: + push {r4-r7,lr} + adds r5, r1, 0 + lsls r0, 3 + adds r4, r5, r0 + ldrb r1, [r4] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080934F4 + movs r0, 0xF7 + ands r0, r1 + b _0809351A +_080934F4: + movs r7, 0x1 + movs r6, 0xF7 + adds r1, r5, 0 + movs r3, 0x3 +_080934FC: + ldrb r2, [r1] + adds r0, r7, 0 + ands r0, r2 + cmp r0, 0 + beq _0809350C + adds r0, r6, 0 + ands r0, r2 + strb r0, [r1] +_0809350C: + adds r1, 0x8 + subs r3, 0x1 + cmp r3, 0 + bge _080934FC + ldrb r1, [r4] + movs r0, 0x8 + orrs r0, r1 +_0809351A: + strb r0, [r4] + adds r0, r5, 0 + bl sub_809371C + movs r0, 0x1 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80934DC + + thumb_func_start sub_809352C +sub_809352C: + push {lr} + lsls r0, 3 + adds r0, r1, r0 + ldrb r3, [r0] + movs r2, 0xF7 + ands r2, r3 + strb r2, [r0] + adds r0, r1, 0 + bl sub_809371C + pop {r0} + bx r0 + thumb_func_end sub_809352C + + thumb_func_start sub_8093544 +sub_8093544: + push {lr} + lsls r0, 3 + adds r0, r1, r0 + ldrb r2, [r0] + movs r3, 0x4 + eors r2, r3 + strb r2, [r0] + adds r0, r1, 0 + bl sub_809371C + movs r0, 0x1 + pop {r1} + bx r1 + thumb_func_end sub_8093544 + + thumb_func_start sub_8093560 +sub_8093560: + push {r4-r7,lr} + adds r4, r0, 0 + adds r6, r1, 0 + movs r5, 0x1 + lsls r0, r4, 3 + adds r0, r6, r0 + ldrh r0, [r0, 0x2] + strh r0, [r2] + movs r1, 0 + adds r0, r2, 0x2 + movs r3, 0x2 +_08093576: + strh r1, [r0] + adds r0, 0x2 + subs r3, 0x1 + cmp r3, 0 + bge _08093576 + adds r4, 0x1 + adds r2, 0x2 + cmp r4, 0x7 + bgt _080935B0 + cmp r5, 0x3 + bgt _080935B0 + movs r7, 0x2 + lsls r0, r4, 3 + adds r3, r0, r6 +_08093592: + ldrb r1, [r3] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _080935B0 + ldrh r0, [r3, 0x2] + strh r0, [r2] + adds r2, 0x2 + adds r5, 0x1 + adds r3, 0x8 + adds r4, 0x1 + cmp r4, 0x7 + bgt _080935B0 + cmp r5, 0x3 + ble _08093592 +_080935B0: + adds r0, r5, 0 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8093560 + + thumb_func_start sub_80935B8 +sub_80935B8: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r5, r0, 0 + movs r0, 0x63 + mov r12, r0 + movs r0, 0 + mov r8, r0 + movs r6, 0 + adds r4, r1, 0 + cmp r4, 0 + blt _08093606 + lsls r0, r4, 3 + adds r2, r5, r0 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08093606 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08093606 + movs r7, 0x1 + movs r3, 0x2 +_080935EC: + subs r2, 0x8 + subs r4, 0x1 + cmp r4, 0 + blt _08093606 + ldrb r1, [r2] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _08093606 + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + bne _080935EC +_08093606: + adds r2, r4, 0x1 + mov r9, r2 + cmp r2, 0x3 + bgt _08093642 + lsls r0, r2, 3 + adds r3, r5, r0 + ldrb r1, [r3] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08093642 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08093642 + movs r6, 0x1 + movs r7, 0x2 +_08093628: + adds r3, 0x8 + adds r2, 0x1 + cmp r2, 0x3 + bgt _08093642 + ldrb r1, [r3] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _08093642 + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + bne _08093628 +_08093642: + cmp r6, 0 + bne _0809364A + movs r0, 0x63 + b _080936CC +_0809364A: + movs r6, 0 + b _08093668 +_0809364E: + ldrb r0, [r3, 0x4] + cmp r12, r0 + ble _08093656 + mov r12, r0 +_08093656: + cmp r0, 0 + bne _0809365C + movs r6, 0x1 +_0809365C: + ldrb r1, [r3, 0x1] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _08093668 + movs r6, 0x1 +_08093668: + subs r2, 0x1 + cmp r2, r4 + blt _0809367C + lsls r0, r2, 3 + adds r3, r5, r0 + ldrb r1, [r3] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _0809364E +_0809367C: + cmp r6, 0 + beq _080936C6 + mov r2, r9 + cmp r2, 0x3 + bgt _080936C0 + lsls r0, r2, 3 + adds r3, r5, r0 + ldrb r1, [r3] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080936C0 + movs r6, 0x2 + movs r4, 0xFD +_08093698: + ldrb r1, [r3] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _080936C0 + adds r0, r4, 0 + ands r0, r1 + strb r0, [r3] + movs r0, 0x1 + mov r8, r0 + adds r2, 0x1 + cmp r2, 0x3 + bgt _080936C0 + lsls r0, r2, 3 + adds r3, r5, r0 + ldrb r1, [r3] + mov r0, r8 + ands r0, r1 + cmp r0, 0 + bne _08093698 +_080936C0: + mov r0, r8 + cmp r0, 0 + bne _080936CA +_080936C6: + mov r0, r12 + b _080936CC +_080936CA: + movs r0, 0 +_080936CC: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80935B8 + + thumb_func_start sub_80936D8 +sub_80936D8: + push {r4,lr} + sub sp, 0x80 + adds r4, r0, 0 + mov r1, sp + bl sub_8093784 + adds r0, r4, 0 + mov r1, sp + bl sub_80937E0 + add sp, 0x80 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80936D8 + + thumb_func_start sub_80936F4 +sub_80936F4: + push {r4,lr} + ldr r4, _08093718 + add sp, r4 + adds r4, r0, 0 + mov r1, sp + bl sub_8093974 + adds r0, r4, 0 + mov r1, sp + bl sub_8093A2C + movs r3, 0x80 + lsls r3, 2 + add sp, r3 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08093718: .4byte 0xfffffe00 + thumb_func_end sub_80936F4 + + thumb_func_start sub_809371C +sub_809371C: + push {r4,lr} + ldr r4, _08093740 + add sp, r4 + adds r4, r0, 0 + mov r1, sp + bl sub_80939D0 + adds r0, r4, 0 + mov r1, sp + bl sub_8093B40 + movs r3, 0x80 + lsls r3, 2 + add sp, r3 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08093740: .4byte 0xfffffe00 + thumb_func_end sub_809371C + + thumb_func_start sub_8093744 +sub_8093744: + push {r4-r7,lr} + adds r7, r0, 0 + movs r4, 0 + movs r6, 0x1 + movs r5, 0x80 +_0809374E: + movs r3, 0 + lsls r0, r4, 5 + adds r2, r0, r7 +_08093754: + ldrb r1, [r2] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _0809376A + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _0809376A + adds r0, r4, 0 + b _0809377C +_0809376A: + adds r2, 0x8 + adds r3, 0x1 + cmp r3, 0x3 + ble _08093754 + adds r4, 0x1 + cmp r4, 0x3 + ble _0809374E + movs r0, 0x1 + negs r0, r0 +_0809377C: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8093744 + + thumb_func_start sub_8093784 +sub_8093784: + push {r4-r7,lr} + adds r6, r0, 0 + movs r2, 0 + movs r4, 0 +_0809378C: + lsls r0, r2, 5 + adds r2, 0x1 + movs r3, 0x3 + adds r0, r1 + adds r0, 0x18 +_08093796: + strb r4, [r0] + subs r0, 0x8 + subs r3, 0x1 + cmp r3, 0 + bge _08093796 + cmp r2, 0x3 + ble _0809378C + movs r3, 0 + movs r5, 0 + adds r4, r1, 0 + subs r4, 0x20 + movs r7, 0x2 +_080937AE: + cmp r5, 0 + beq _080937BC + ldrb r1, [r6] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + bne _080937C0 +_080937BC: + adds r4, 0x20 + movs r3, 0 +_080937C0: + lsls r2, r3, 3 + adds r2, r4 + ldm r6!, {r0,r1} + str r0, [r2] + str r1, [r2, 0x4] + ldrb r1, [r2] + movs r0, 0xFD + ands r0, r1 + strb r0, [r2] + adds r3, 0x1 + adds r5, 0x1 + cmp r5, 0x3 + ble _080937AE + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8093784 + + thumb_func_start sub_80937E0 +sub_80937E0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + str r0, [sp, 0x8] + mov r9, r1 + movs r0, 0 + mov r8, r0 + movs r6, 0 + add r1, sp, 0x4 + mov r10, r1 + mov r12, r6 + movs r3, 0x1 +_080937FE: + mov r2, sp + adds r0, r2, r6 + mov r7, r12 + strb r7, [r0] + mov r1, sp + adds r1, r6 + adds r1, 0x4 + mov r2, r12 + strb r2, [r1] + adds r7, r0, 0 + lsls r0, r6, 5 + adds r6, 0x1 + adds r5, r1, 0 + mov r1, r9 + adds r2, r0, r1 + movs r4, 0x3 +_0809381E: + ldrb r1, [r2] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _0809383E + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08093832 + strb r3, [r7] +_08093832: + ldrb r1, [r2] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _0809383E + strb r3, [r5] +_0809383E: + adds r2, 0x8 + subs r4, 0x1 + cmp r4, 0 + bge _0809381E + cmp r6, 0x3 + ble _080937FE + movs r6, 0 + mov r2, r8 + lsls r2, 3 + str r2, [sp, 0xC] +_08093852: + movs r4, 0 + lsls r0, r6, 5 + mov r7, r9 + adds r5, r0, r7 + ldr r0, [sp, 0xC] + ldr r1, [sp, 0x8] + adds r2, r0, r1 + mov r7, r10 + adds r7, r6 + mov r12, r7 +_08093866: + ldrb r1, [r5] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080938D6 + ldr r0, [r5] + ldr r1, [r5, 0x4] + str r0, [r2] + str r1, [r2, 0x4] + cmp r4, 0 + bne _08093884 + ldrb r1, [r2] + movs r0, 0xFD + ands r0, r1 + b _0809388A +_08093884: + ldrb r0, [r2] + movs r1, 0x2 + orrs r0, r1 +_0809388A: + strb r0, [r2] + ldrb r0, [r2] + movs r3, 0xF7 + ands r3, r0 + movs r1, 0 + movs r0, 0xFB + ands r3, r0 + strb r3, [r2] + mov r7, sp + adds r0, r7, r6 + ldrb r0, [r0] + cmp r0, 0 + beq _080938B0 + cmp r4, 0 + bne _080938B0 + movs r1, 0x8 + adds r0, r3, 0 + orrs r0, r1 + strb r0, [r2] +_080938B0: + mov r1, r12 + ldrb r0, [r1] + cmp r0, 0 + beq _080938C4 + cmp r4, 0 + bne _080938C4 + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_080938C4: + adds r2, 0x8 + ldr r7, [sp, 0xC] + adds r7, 0x8 + str r7, [sp, 0xC] + movs r0, 0x1 + add r8, r0 + mov r1, r8 + cmp r1, 0x4 + beq _080938E4 +_080938D6: + adds r5, 0x8 + adds r4, 0x1 + cmp r4, 0x3 + ble _08093866 + adds r6, 0x1 + cmp r6, 0x3 + ble _08093852 +_080938E4: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80937E0 + + thumb_func_start sub_80938F4 +sub_80938F4: + push {r4-r7,lr} + adds r7, r0, 0 + movs r4, 0 + movs r6, 0x1 + movs r5, 0x80 +_080938FE: + movs r3, 0 + lsls r0, r4, 6 + adds r2, r0, r7 +_08093904: + ldrb r1, [r2] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _0809391A + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _0809391A + adds r0, r4, 0 + b _0809392C +_0809391A: + adds r2, 0x8 + adds r3, 0x1 + cmp r3, 0x7 + ble _08093904 + adds r4, 0x1 + cmp r4, 0x7 + ble _080938FE + movs r0, 0x1 + negs r0, r0 +_0809392C: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80938F4 + + thumb_func_start sub_8093934 +sub_8093934: + push {r4-r7,lr} + adds r7, r0, 0 + movs r4, 0 + movs r6, 0x1 + movs r5, 0x80 +_0809393E: + movs r3, 0 + lsls r0, r4, 6 + adds r2, r0, r7 +_08093944: + ldrb r1, [r2] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _0809395A + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _0809395A + adds r0, r4, 0 + b _0809396C +_0809395A: + adds r2, 0x8 + adds r3, 0x1 + cmp r3, 0x7 + ble _08093944 + adds r4, 0x1 + cmp r4, 0x7 + ble _0809393E + movs r0, 0x1 + negs r0, r0 +_0809396C: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8093934 + + thumb_func_start sub_8093974 +sub_8093974: + push {r4-r7,lr} + adds r6, r0, 0 + movs r2, 0 + movs r4, 0 +_0809397C: + lsls r0, r2, 6 + adds r2, 0x1 + movs r3, 0x7 + adds r0, r1 + adds r0, 0x38 +_08093986: + strb r4, [r0] + subs r0, 0x8 + subs r3, 0x1 + cmp r3, 0 + bge _08093986 + cmp r2, 0x7 + ble _0809397C + movs r3, 0 + movs r5, 0 + adds r4, r1, 0 + subs r4, 0x40 + movs r7, 0x2 +_0809399E: + cmp r5, 0 + beq _080939AC + ldrb r1, [r6] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + bne _080939B0 +_080939AC: + adds r4, 0x40 + movs r3, 0 +_080939B0: + lsls r2, r3, 3 + adds r2, r4 + ldm r6!, {r0,r1} + str r0, [r2] + str r1, [r2, 0x4] + ldrb r1, [r2] + movs r0, 0xFD + ands r0, r1 + strb r0, [r2] + adds r3, 0x1 + adds r5, 0x1 + cmp r5, 0x7 + ble _0809399E + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8093974 + + thumb_func_start sub_80939D0 +sub_80939D0: + push {r4-r7,lr} + adds r6, r0, 0 + movs r2, 0 + movs r4, 0 +_080939D8: + lsls r0, r2, 6 + adds r2, 0x1 + movs r3, 0x7 + adds r0, r1 + adds r0, 0x38 +_080939E2: + strb r4, [r0] + subs r0, 0x8 + subs r3, 0x1 + cmp r3, 0 + bge _080939E2 + cmp r2, 0x7 + ble _080939D8 + movs r3, 0 + movs r5, 0 + adds r4, r1, 0 + subs r4, 0x40 + movs r7, 0x2 +_080939FA: + cmp r5, 0 + beq _08093A08 + ldrb r1, [r6] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + bne _08093A0C +_08093A08: + adds r4, 0x40 + movs r3, 0 +_08093A0C: + lsls r2, r3, 3 + adds r2, r4 + ldm r6!, {r0,r1} + str r0, [r2] + str r1, [r2, 0x4] + ldrb r1, [r2] + movs r0, 0xFD + ands r0, r1 + strb r0, [r2] + adds r3, 0x1 + adds r5, 0x1 + cmp r5, 0x7 + ble _080939FA + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80939D0 + + thumb_func_start sub_8093A2C +sub_8093A2C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + str r0, [sp, 0x10] + mov r9, r1 + movs r0, 0 + mov r8, r0 + movs r6, 0 + add r1, sp, 0x8 + mov r10, r1 + mov r12, r6 + movs r3, 0x1 +_08093A4A: + mov r2, sp + adds r0, r2, r6 + mov r7, r12 + strb r7, [r0] + mov r1, sp + adds r1, r6 + adds r1, 0x8 + mov r2, r12 + strb r2, [r1] + adds r7, r0, 0 + lsls r0, r6, 6 + adds r6, 0x1 + adds r5, r1, 0 + mov r1, r9 + adds r2, r0, r1 + movs r4, 0x7 +_08093A6A: + ldrb r1, [r2] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _08093A8A + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08093A7E + strb r3, [r7] +_08093A7E: + ldrb r1, [r2] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08093A8A + strb r3, [r5] +_08093A8A: + adds r2, 0x8 + subs r4, 0x1 + cmp r4, 0 + bge _08093A6A + cmp r6, 0x7 + ble _08093A4A + movs r6, 0 + mov r2, r8 + lsls r2, 3 + str r2, [sp, 0x14] +_08093A9E: + movs r4, 0 + lsls r0, r6, 6 + mov r7, r9 + adds r5, r0, r7 + ldr r0, [sp, 0x14] + ldr r1, [sp, 0x10] + adds r2, r0, r1 + mov r7, r10 + adds r7, r6 + mov r12, r7 +_08093AB2: + ldrb r1, [r5] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08093B22 + ldr r0, [r5] + ldr r1, [r5, 0x4] + str r0, [r2] + str r1, [r2, 0x4] + cmp r4, 0 + bne _08093AD0 + ldrb r1, [r2] + movs r0, 0xFD + ands r0, r1 + b _08093AD6 +_08093AD0: + ldrb r0, [r2] + movs r1, 0x2 + orrs r0, r1 +_08093AD6: + strb r0, [r2] + ldrb r0, [r2] + movs r3, 0xF7 + ands r3, r0 + movs r1, 0 + movs r0, 0xFB + ands r3, r0 + strb r3, [r2] + mov r7, sp + adds r0, r7, r6 + ldrb r0, [r0] + cmp r0, 0 + beq _08093AFC + cmp r4, 0 + bne _08093AFC + movs r1, 0x8 + adds r0, r3, 0 + orrs r0, r1 + strb r0, [r2] +_08093AFC: + mov r1, r12 + ldrb r0, [r1] + cmp r0, 0 + beq _08093B10 + cmp r4, 0 + bne _08093B10 + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_08093B10: + adds r2, 0x8 + ldr r7, [sp, 0x14] + adds r7, 0x8 + str r7, [sp, 0x14] + movs r0, 0x1 + add r8, r0 + mov r1, r8 + cmp r1, 0x8 + beq _08093B30 +_08093B22: + adds r5, 0x8 + adds r4, 0x1 + cmp r4, 0x7 + ble _08093AB2 + adds r6, 0x1 + cmp r6, 0x7 + ble _08093A9E +_08093B30: + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8093A2C + + thumb_func_start sub_8093B40 +sub_8093B40: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + str r0, [sp, 0x10] + mov r9, r1 + movs r0, 0 + mov r8, r0 + movs r6, 0 + add r1, sp, 0x8 + mov r10, r1 + mov r12, r6 + movs r3, 0x1 +_08093B5E: + mov r2, sp + adds r0, r2, r6 + mov r7, r12 + strb r7, [r0] + mov r1, sp + adds r1, r6 + adds r1, 0x8 + mov r2, r12 + strb r2, [r1] + adds r7, r0, 0 + lsls r0, r6, 6 + adds r6, 0x1 + adds r5, r1, 0 + mov r1, r9 + adds r2, r0, r1 + movs r4, 0x7 +_08093B7E: + ldrb r1, [r2] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _08093B9E + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _08093B92 + strb r3, [r7] +_08093B92: + ldrb r1, [r2] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _08093B9E + strb r3, [r5] +_08093B9E: + adds r2, 0x8 + subs r4, 0x1 + cmp r4, 0 + bge _08093B7E + cmp r6, 0x7 + ble _08093B5E + movs r6, 0 + mov r2, r8 + lsls r2, 3 + str r2, [sp, 0x14] +_08093BB2: + movs r4, 0 + lsls r0, r6, 6 + mov r7, r9 + adds r5, r0, r7 + ldr r0, [sp, 0x14] + ldr r1, [sp, 0x10] + adds r2, r0, r1 + mov r7, r10 + adds r7, r6 + mov r12, r7 +_08093BC6: + ldrb r1, [r5] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08093C36 + ldr r0, [r5] + ldr r1, [r5, 0x4] + str r0, [r2] + str r1, [r2, 0x4] + cmp r4, 0 + bne _08093BE4 + ldrb r1, [r2] + movs r0, 0xFD + ands r0, r1 + b _08093BEA +_08093BE4: + ldrb r0, [r2] + movs r1, 0x2 + orrs r0, r1 +_08093BEA: + strb r0, [r2] + ldrb r0, [r2] + movs r3, 0xF7 + ands r3, r0 + movs r1, 0 + movs r0, 0xFB + ands r3, r0 + strb r3, [r2] + mov r7, sp + adds r0, r7, r6 + ldrb r0, [r0] + cmp r0, 0 + beq _08093C10 + cmp r4, 0 + bne _08093C10 + movs r1, 0x8 + adds r0, r3, 0 + orrs r0, r1 + strb r0, [r2] +_08093C10: + mov r1, r12 + ldrb r0, [r1] + cmp r0, 0 + beq _08093C24 + cmp r4, 0 + bne _08093C24 + ldrb r0, [r2] + movs r1, 0x4 + orrs r0, r1 + strb r0, [r2] +_08093C24: + adds r2, 0x8 + ldr r7, [sp, 0x14] + adds r7, 0x8 + str r7, [sp, 0x14] + movs r0, 0x1 + add r8, r0 + mov r1, r8 + cmp r1, 0x8 + beq _08093C44 +_08093C36: + adds r5, 0x8 + adds r4, 0x1 + cmp r4, 0x7 + ble _08093BC6 + adds r6, 0x1 + cmp r6, 0x7 + ble _08093BB2 +_08093C44: + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8093B40 + + thumb_func_start sub_8093C54 +sub_8093C54: + push {r4-r7,lr} + sub sp, 0x40 + adds r6, r0, 0 + lsls r0, r1, 3 + adds r0, r6 + movs r2, 0 + strb r2, [r0] + adds r3, r1, 0x1 + cmp r3, 0x7 + bgt _08093CA6 + lsls r0, r3, 3 + adds r4, r6, r0 + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08093CA6 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08093CA6 + mov r12, r2 + movs r7, 0x1 + adds r2, r4, 0 + movs r5, 0x2 +_08093C86: + mov r0, r12 + strb r0, [r4] + adds r2, 0x8 + adds r3, 0x1 + cmp r3, 0x7 + bgt _08093CA6 + adds r4, r2, 0 + ldrb r1, [r2] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _08093CA6 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _08093C86 +_08093CA6: + movs r4, 0 + movs r7, 0x1 + adds r2, r6, 0 + mov r5, sp + movs r3, 0x7 +_08093CB0: + ldrb r1, [r2] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _08093CC2 + ldr r0, [r2] + ldr r1, [r2, 0x4] + stm r5!, {r0,r1} + adds r4, 0x1 +_08093CC2: + adds r2, 0x8 + subs r3, 0x1 + cmp r3, 0 + bge _08093CB0 + cmp r4, 0x7 + bgt _08093CDE + movs r1, 0 + lsls r0, r4, 3 + add r0, sp +_08093CD4: + strb r1, [r0] + adds r0, 0x8 + adds r4, 0x1 + cmp r4, 0x7 + ble _08093CD4 +_08093CDE: + mov r4, sp + adds r2, r6, 0 + movs r3, 0x7 +_08093CE4: + ldm r4!, {r0,r1} + stm r2!, {r0,r1} + subs r3, 0x1 + cmp r3, 0 + bge _08093CE4 + add sp, 0x40 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8093C54 + + thumb_func_start sub_8093CF8 +sub_8093CF8: + push {r4-r7,lr} + sub sp, 0x40 + adds r6, r0, 0 + lsls r0, r1, 3 + adds r0, r6 + movs r2, 0 + strb r2, [r0] + adds r3, r1, 0x1 + cmp r3, 0x7 + bgt _08093D4A + lsls r0, r3, 3 + adds r4, r6, r0 + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08093D4A + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08093D4A + mov r12, r2 + movs r7, 0x1 + adds r2, r4, 0 + movs r5, 0x2 +_08093D2A: + mov r0, r12 + strb r0, [r4] + adds r2, 0x8 + adds r3, 0x1 + cmp r3, 0x7 + bgt _08093D4A + adds r4, r2, 0 + ldrb r1, [r2] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _08093D4A + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + bne _08093D2A +_08093D4A: + movs r4, 0 + movs r7, 0x1 + adds r2, r6, 0 + mov r5, sp + movs r3, 0x7 +_08093D54: + ldrb r1, [r2] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _08093D66 + ldr r0, [r2] + ldr r1, [r2, 0x4] + stm r5!, {r0,r1} + adds r4, 0x1 +_08093D66: + adds r2, 0x8 + subs r3, 0x1 + cmp r3, 0 + bge _08093D54 + cmp r4, 0x7 + bgt _08093D82 + movs r1, 0 + lsls r0, r4, 3 + add r0, sp +_08093D78: + strb r1, [r0] + adds r0, 0x8 + adds r4, 0x1 + cmp r4, 0x7 + ble _08093D78 +_08093D82: + mov r4, sp + adds r2, r6, 0 + movs r3, 0x7 +_08093D88: + ldm r4!, {r0,r1} + stm r2!, {r0,r1} + subs r3, 0x1 + cmp r3, 0 + bge _08093D88 + add sp, 0x40 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8093CF8 + + thumb_func_start sub_8093D9C +sub_8093D9C: + push {r4-r6,lr} + sub sp, 0x8 + adds r4, r0, 0 + adds r5, r2, 0 + adds r6, r3, 0 + lsls r1, 16 + lsrs r1, 16 + mov r0, sp + bl sub_8092A88 + adds r0, r4, 0 + mov r1, sp + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_8093DE8 + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8093D9C + + thumb_func_start sub_8093DC4 +sub_8093DC4: + push {r4-r6,lr} + sub sp, 0x8 + adds r4, r0, 0 + adds r5, r2, 0 + adds r6, r3, 0 + mov r0, sp + bl sub_8093F10 + adds r0, r4, 0 + mov r1, sp + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_8093DE8 + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8093DC4 + + thumb_func_start sub_8093DE8 +sub_8093DE8: + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r4, _08093E80 + add sp, r4 + adds r4, r0, 0 + adds r6, r1, 0 + adds r5, r2, 0 + mov r8, r3 + adds r0, r5, 0 + bl sub_80073B8 + ldr r0, _08093E84 + adds r1, r6, 0 + movs r2, 0 + bl sub_80928C0 + lsls r4, 3 + adds r4, 0x10 + ldr r2, _08093E88 + movs r7, 0 + str r7, [sp] + adds r0, r4, 0 + movs r1, 0 + adds r3, r5, 0 + bl sub_8014FF0 + movs r3, 0x13 + ldrh r1, [r6, 0x2] + ldr r4, _08093E8C + ldr r2, [r4] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r2, [r0, 0x1C] + ldrb r0, [r2] + cmp r0, 0x2A + bne _08093E3A + movs r3, 0x10 + adds r2, 0x1 +_08093E3A: + str r7, [sp] + movs r0, 0x4 + adds r1, r3, 0 + adds r3, r5, 0 + bl sub_8014FF0 + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_8093E90 + adds r0, r5, 0 + bl sub_80073E0 + ldrh r1, [r6, 0x2] + ldr r2, [r4] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldr r1, [r0, 0x1C] + add r0, sp, 0x4 + bl strcpy + add r0, sp, 0x4 + mov r1, r8 + bl sub_8097DF0 + movs r3, 0xC9 + lsls r3, 2 + add sp, r3 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08093E80: .4byte 0xfffffcdc +_08093E84: .4byte gUnknown_202DF98 +_08093E88: .4byte gUnknown_8109930 +_08093E8C: .4byte gUnknown_2038C68 + thumb_func_end sub_8093DE8 + + thumb_func_start sub_8093E90 +sub_8093E90: + push {r4-r6,lr} + sub sp, 0x4 + adds r6, r0, 0 + adds r5, r1, 0 + movs r0, 0x7 + str r0, [sp] + adds r0, r5, 0 + movs r1, 0x4 + movs r2, 0x48 + movs r3, 0xC8 + bl sub_80078A4 + ldr r0, _08093F00 + adds r1, r6, 0 + bl sub_8092D54 + ldr r0, _08093F04 + ldr r2, [r0] + movs r4, 0 + str r4, [sp] + movs r0, 0x4 + movs r1, 0x4A + adds r3, r5, 0 + bl sub_8014FF0 + ldr r0, _08093F08 + ldr r2, [r0] + str r4, [sp] + movs r0, 0x4 + movs r1, 0x56 + adds r3, r5, 0 + bl sub_8014FF0 + adds r0, r6, 0 + bl sub_8092B00 + lsls r0, 24 + lsrs r0, 24 + bl sub_8092334 + adds r2, r0, 0 + str r4, [sp] + movs r0, 0x40 + movs r1, 0x56 + adds r3, r5, 0 + bl sub_8014FF0 + adds r0, r6, 0 + bl sub_8092BC0 + ldr r1, _08093F0C + str r0, [r1] + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08093F00: .4byte gUnknown_202DF98 +_08093F04: .4byte gUnknown_810CF00 +_08093F08: .4byte gUnknown_810CF0C +_08093F0C: .4byte gUnknown_202DE30 + thumb_func_end sub_8093E90 + + thumb_func_start sub_8093F10 +sub_8093F10: + push {r4,lr} + adds r3, r0, 0 + adds r4, r1, 0 + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08093F48 + movs r0, 0 + strb r1, [r3] + strb r0, [r3, 0x1] + ldrh r0, [r4, 0x2] + strh r0, [r3, 0x2] + ldrh r1, [r4, 0x2] + ldr r0, _08093F44 + ldr r2, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0xC] + strb r0, [r3, 0x4] + ldrb r0, [r4, 0x4] + strb r0, [r3, 0x5] + b _08093F4A + .align 2, 0 +_08093F44: .4byte gUnknown_2038C68 +_08093F48: + strb r0, [r3] +_08093F4A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8093F10 + + thumb_func_start sub_8093F50 +sub_8093F50: + push {r4-r7,lr} + adds r6, r0, 0 + movs r7, 0 + adds r3, r6, 0 + adds r4, r1, 0 + movs r5, 0x3 +_08093F5C: + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08093F8C + strb r1, [r3] + strb r7, [r3, 0x1] + ldrh r0, [r4, 0x2] + strh r0, [r3, 0x2] + ldrh r1, [r4, 0x2] + ldr r0, _08093F88 + ldr r2, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0xC] + strb r0, [r3, 0x4] + ldrb r0, [r4, 0x4] + strb r0, [r3, 0x5] + b _08093F8E + .align 2, 0 +_08093F88: .4byte gUnknown_2038C68 +_08093F8C: + strb r0, [r3] +_08093F8E: + adds r3, 0x8 + adds r4, 0x8 + subs r5, 0x1 + cmp r5, 0 + bge _08093F5C + adds r1, r6, 0 + adds r1, 0x20 + movs r0, 0 + strb r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8093F50 + + thumb_func_start sub_8093FA8 +sub_8093FA8: + push {lr} + adds r2, r0, 0 + movs r3, 0x3 +_08093FAE: + ldrb r0, [r1] + strb r0, [r2] + ldrh r0, [r1, 0x2] + strh r0, [r2, 0x2] + ldrb r0, [r1, 0x5] + strb r0, [r2, 0x4] + adds r2, 0x8 + adds r1, 0x8 + subs r3, 0x1 + cmp r3, 0 + bge _08093FAE + pop {r0} + bx r0 + thumb_func_end sub_8093FA8 + + thumb_func_start sub_8093FC8 +sub_8093FC8: + push {r4-r7,lr} + adds r5, r0, 0 + adds r2, r1, 0 + movs r3, 0 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08094002 + movs r7, 0xFB + movs r6, 0x1 + adds r4, r2, 0 + adds r2, r5, 0 +_08093FE2: + ldm r4!, {r0,r1} + str r0, [r2] + str r1, [r2, 0x4] + ldrb r1, [r2, 0x1] + adds r0, r7, 0 + ands r0, r1 + strb r0, [r2, 0x1] + adds r2, 0x8 + adds r3, 0x1 + cmp r3, 0x3 + bgt _08094002 + ldrb r1, [r4] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _08093FE2 +_08094002: + cmp r3, 0x7 + bgt _08094016 + movs r1, 0 + lsls r0, r3, 3 + adds r0, r5 +_0809400C: + strb r1, [r0] + adds r0, 0x8 + adds r3, 0x1 + cmp r3, 0x7 + ble _0809400C +_08094016: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8093FC8 + + thumb_func_start sub_809401C +sub_809401C: + push {r4-r6,lr} + adds r5, r0, 0 + adds r3, r1, 0 + movs r2, 0 + ldrb r1, [r3] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08094046 + movs r6, 0x1 + adds r4, r5, 0 +_08094032: + ldm r3!, {r0,r1} + stm r4!, {r0,r1} + adds r2, 0x1 + cmp r2, 0x3 + bgt _08094046 + ldrb r1, [r3] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _08094032 +_08094046: + cmp r2, 0x7 + bgt _0809405A + movs r1, 0 + lsls r0, r2, 3 + adds r0, r5 +_08094050: + strb r1, [r0] + adds r0, 0x8 + adds r2, 0x1 + cmp r2, 0x7 + ble _08094050 +_0809405A: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_809401C + + thumb_func_start sub_8094060 +sub_8094060: + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + movs r4, 0 + movs r5, 0 + adds r3, r6, 0 + ldrb r1, [r3] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08094084 +_08094076: + lsls r2, r4, 3 + adds r2, r7, r2 + ldr r0, [r3] + ldr r1, [r3, 0x4] + str r0, [r2] + str r1, [r2, 0x4] + adds r4, 0x1 +_08094084: + adds r5, 0x1 + cmp r5, 0x7 + bgt _0809409C + lsls r0, r5, 3 + adds r3, r6, r0 + ldrb r1, [r3] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08094084 + cmp r4, 0x3 + ble _08094076 +_0809409C: + cmp r4, 0x3 + bgt _080940B0 + movs r1, 0 + lsls r0, r4, 3 + adds r0, r7 +_080940A6: + strb r1, [r0] + adds r0, 0x8 + adds r4, 0x1 + cmp r4, 0x3 + ble _080940A6 +_080940B0: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8094060 + + thumb_func_start sub_80940B8 +sub_80940B8: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x4 + bl sub_809488C + adds r1, r5, 0x2 + adds r0, r4, 0 + movs r2, 0x9 + bl sub_809488C + adds r5, 0x4 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x7 + bl sub_809488C + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80940B8 + + thumb_func_start sub_80940E0 +sub_80940E0: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x4 + bl sub_8094924 + adds r1, r5, 0x2 + adds r0, r4, 0 + movs r2, 0x9 + bl sub_8094924 + adds r5, 0x4 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0x7 + bl sub_8094924 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80940E0 + + thumb_func_start sub_8094108 +sub_8094108: + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + movs r5, 0x3 +_08094110: + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80940B8 + adds r4, 0x8 + subs r5, 0x1 + cmp r5, 0 + bge _08094110 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8094108 + + thumb_func_start sub_8094128 +sub_8094128: + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + movs r5, 0x3 +_08094130: + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80940E0 + adds r4, 0x8 + subs r5, 0x1 + cmp r5, 0 + bge _08094130 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8094128 + + thumb_func_start sub_8094148 +sub_8094148: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r2, 0x4 + bl sub_809488C + adds r1, r4, 0x1 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_809488C + adds r1, r4, 0x2 + adds r0, r5, 0 + movs r2, 0x9 + bl sub_809488C + adds r1, r4, 0x4 + adds r0, r5, 0 + movs r2, 0x7 + bl sub_809488C + adds r4, 0x5 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x7 + bl sub_809488C + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8094148 + + thumb_func_start sub_8094184 +sub_8094184: + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + adds r4, r7, 0 + movs r5, 0x3 +_0809418E: + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_8094148 + adds r4, 0x8 + subs r5, 0x1 + cmp r5, 0 + bge _0809418E + adds r1, r7, 0 + adds r1, 0x20 + adds r0, r6, 0 + movs r2, 0x8 + bl sub_809488C + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8094184 + + thumb_func_start sub_80941B0 +sub_80941B0: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x8 + bl memset + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x4 + bl sub_8094924 + adds r1, r4, 0x1 + adds r0, r5, 0 + movs r2, 0x1 + bl sub_8094924 + adds r1, r4, 0x2 + adds r0, r5, 0 + movs r2, 0x9 + bl sub_8094924 + adds r1, r4, 0x4 + adds r0, r5, 0 + movs r2, 0x7 + bl sub_8094924 + adds r4, 0x5 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x7 + bl sub_8094924 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80941B0 + + thumb_func_start sub_80941FC +sub_80941FC: + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r1, 0 + adds r4, r7, 0 + movs r5, 0x3 +_08094206: + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80941B0 + adds r4, 0x8 + subs r5, 0x1 + cmp r5, 0 + bge _08094206 + adds r1, r7, 0 + adds r1, 0x20 + movs r0, 0 + strb r0, [r1] + adds r0, r6, 0 + movs r2, 0x8 + bl sub_8094924 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80941FC + + thumb_func_start sub_809422C +sub_809422C: + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + adds r2, r1, 0 + cmp r1, 0x97 + beq _08094260 + cmp r1, 0x64 + beq _08094260 + cmp r1, 0x3C + beq _08094260 + cmp r1, 0x4B + beq _08094260 + movs r0, 0xAE + lsls r0, 1 + cmp r1, r0 + beq _08094260 + cmp r1, 0x99 + beq _08094260 + cmp r1, 0xCD + beq _08094260 + cmp r1, 0x9C + beq _08094260 + cmp r2, 0x8 + beq _08094260 + movs r0, 0 + b _08094262 +_08094260: + movs r0, 0x1 +_08094262: + pop {r1} + bx r1 + thumb_func_end sub_809422C + + thumb_func_start sub_8094268 +sub_8094268: + push {r4-r6,lr} + adds r5, r0, 0 + adds r3, r1, 0 + asrs r0, r3, 16 + asrs r1, r2, 16 + adds r0, r1 + lsls r0, 16 + ldr r6, _080942B0 + ands r3, r6 + orrs r3, r0 + adds r2, r3, r2 + lsls r2, 16 + lsrs r2, 16 + ldr r4, _080942B4 + ands r3, r4 + orrs r3, r2 + asrs r1, r3, 16 + ldr r0, _080942B8 + cmp r1, r0 + ble _080942A6 + adds r0, r3, 0x1 + lsls r0, 16 + lsrs r0, 16 + ands r3, r4 + orrs r3, r0 + asrs r0, r3, 16 + ldr r1, _080942BC + adds r0, r1 + lsls r0, 16 + ands r3, r6 + orrs r3, r0 +_080942A6: + str r3, [r5] + adds r0, r5, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080942B0: .4byte 0x0000ffff +_080942B4: .4byte 0xffff0000 +_080942B8: .4byte 0x000003e7 +_080942BC: .4byte 0xfffffc18 + thumb_func_end sub_8094268 + + thumb_func_start sub_80942C0 +sub_80942C0: + push {r4,r5,lr} + adds r5, r0, 0 + adds r3, r1, 0 + asrs r0, r3, 16 + asrs r1, r2, 16 + subs r0, r1 + lsls r0, 16 + ldr r4, _08094310 + ands r3, r4 + orrs r3, r0 + subs r2, r3, r2 + lsls r2, 16 + lsrs r2, 16 + ldr r1, _08094314 + ands r3, r1 + orrs r3, r2 + cmp r3, 0 + bge _080942FC + subs r0, r3, 0x1 + lsls r0, 16 + lsrs r0, 16 + ands r3, r1 + orrs r3, r0 + asrs r0, r3, 16 + movs r2, 0xFA + lsls r2, 2 + adds r0, r2 + lsls r0, 16 + ands r3, r4 + orrs r3, r0 +_080942FC: + lsls r0, r3, 16 + cmp r0, 0 + bge _08094304 + movs r3, 0 +_08094304: + str r3, [r5] + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08094310: .4byte 0x0000ffff +_08094314: .4byte 0xffff0000 + thumb_func_end sub_80942C0 + + thumb_func_start sub_8094318 +sub_8094318: + push {r4,lr} + adds r4, r0, 0 + adds r3, r1, 0 + lsls r0, r3, 16 + asrs r1, r0, 16 + lsls r0, r2, 16 + asrs r0, 16 + cmp r1, r0 + bgt _08094336 + cmp r1, r0 + blt _0809433A + asrs r1, r3, 16 + asrs r0, r2, 16 + cmp r1, r0 + ble _0809433A +_08094336: + str r2, [r4] + b _0809433C +_0809433A: + str r3, [r4] +_0809433C: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8094318 + + thumb_func_start sub_8094344 +sub_8094344: + push {r4,lr} + adds r4, r0, 0 + adds r3, r1, 0 + lsls r0, r3, 16 + asrs r1, r0, 16 + lsls r0, r2, 16 + asrs r0, 16 + cmp r1, r0 + bgt _08094362 + cmp r1, r0 + blt _08094366 + asrs r1, r3, 16 + asrs r0, r2, 16 + cmp r1, r0 + ble _08094366 +_08094362: + str r3, [r4] + b _08094368 +_08094366: + str r2, [r4] +_08094368: + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8094344 + + thumb_func_start sub_8094370 +sub_8094370: + push {r4,r5,lr} + adds r5, r0, 0 + lsls r1, 16 + lsls r2, 16 + ldr r4, _08094398 + lsrs r3, r1, 16 + orrs r3, r2 + asrs r2, 16 + ldr r1, _0809439C + asrs r0, r1, 16 + cmp r2, r0 + ble _0809438C + ands r3, r4 + orrs r3, r1 +_0809438C: + str r3, [r5] + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08094398: .4byte 0x0000ffff +_0809439C: .4byte 0x03e70000 + thumb_func_end sub_8094370 + + thumb_func_start sub_80943A0 +sub_80943A0: + lsls r1, 16 + lsrs r2, r1, 16 + str r2, [r0] + bx lr + thumb_func_end sub_80943A0 + + thumb_func_start sub_80943A8 +sub_80943A8: + push {r4,r5,lr} + ldr r3, [r1, 0x4] + lsrs r2, r3, 16 + ldr r1, _080943D4 + ands r5, r1 + orrs r5, r2 + ldr r4, _080943D8 + adds r2, r4, 0 + ands r2, r3 + lsls r1, r2, 5 + subs r1, r2 + lsls r1, 2 + adds r1, r2 + lsls r1, 3 + lsrs r1, 16 + lsls r1, 16 + ands r5, r4 + orrs r5, r1 + str r5, [r0] + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080943D4: .4byte 0xffff0000 +_080943D8: .4byte 0x0000ffff + thumb_func_end sub_80943A8 + + thumb_func_start sub_80943DC +sub_80943DC: + push {r4-r6,lr} + mov r6, r8 + push {r6} + mov r8, r0 + adds r4, r1, 0 + lsls r1, r4, 16 + asrs r1, 16 + lsls r0, r1, 5 + subs r0, r1 + lsls r0, 2 + adds r0, r1 + lsls r0, 3 + asrs r1, r4, 16 + adds r0, r1 + lsls r3, r2, 16 + asrs r3, 16 + lsls r1, r3, 5 + subs r1, r3 + lsls r1, 2 + adds r1, r3 + lsls r1, 3 + asrs r2, 16 + adds r1, r2 + muls r0, r1 + movs r5, 0xFA + lsls r5, 2 + adds r1, r5, 0 + bl __divsi3 + adds r6, r0, 0 + adds r1, r5, 0 + bl __divsi3 + lsls r0, 16 + lsrs r0, 16 + ldr r1, _08094448 + ands r4, r1 + orrs r4, r0 + adds r0, r6, 0 + adds r1, r5, 0 + bl __modsi3 + lsls r0, 16 + ldr r1, _0809444C + ands r1, r4 + orrs r0, r1 + mov r1, r8 + str r0, [r1] + mov r0, r8 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08094448: .4byte 0xffff0000 +_0809444C: .4byte 0x0000ffff + thumb_func_end sub_80943DC + + thumb_func_start sub_8094450 +sub_8094450: + push {lr} + adds r1, r0, 0 + lsls r0, r1, 16 + asrs r2, r0, 16 + cmp r2, 0 + bne _0809446A + asrs r0, r1, 16 + cmp r0, 0 + bne _08094466 + movs r0, 0 + b _08094476 +_08094466: + movs r0, 0x1 + b _08094476 +_0809446A: + asrs r0, r1, 16 + cmp r0, 0 + bne _08094474 + adds r0, r2, 0 + b _08094476 +_08094474: + adds r0, r2, 0x1 +_08094476: + pop {r1} + bx r1 + thumb_func_end sub_8094450 + + thumb_func_start sub_809447C +sub_809447C: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r2, 0x10 + bl sub_8094924 + adds r4, 0x2 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x10 + bl sub_8094924 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_809447C + + thumb_func_start sub_809449C +sub_809449C: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + movs r2, 0x10 + bl sub_809488C + adds r4, 0x2 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x10 + bl sub_809488C + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_809449C + + thumb_func_start sub_80944BC +sub_80944BC: + push {r4,lr} + sub sp, 0x8 + adds r4, r1, 0 + lsls r0, 16 + asrs r1, r0, 16 + ldr r0, _080944F4 + cmp r1, r0 + bgt _08094500 + lsls r1, 16 + lsrs r1, 16 + mov r0, sp + bl sub_8092AA8 + ldr r0, _080944F8 + mov r1, sp + movs r2, 0 + bl sub_80928C0 + ldr r0, _080944FC + ldr r0, [r0] + adds r2, r4, 0 + adds r2, 0xC8 + adds r1, r4, 0 + movs r3, 0 + bl sub_8014BC4 + b _08094516 + .align 2, 0 +_080944F4: .4byte 0x000001f3 +_080944F8: .4byte gUnknown_202DE58 +_080944FC: .4byte gUnknown_811383C +_08094500: + ldr r0, _08094520 + ldr r2, _08094524 + adds r1, r2 + lsls r1, 3 + adds r0, 0x4 + adds r1, r0 + ldr r1, [r1] + adds r0, r4, 0 + movs r2, 0xC8 + bl strncpy +_08094516: + add sp, 0x8 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08094520: .4byte gUnknown_8113080 +_08094524: .4byte 0xfffffe0c + thumb_func_end sub_80944BC + + thumb_func_start sub_8094528 +sub_8094528: + push {lr} + lsls r0, 16 + asrs r1, r0, 16 + ldr r0, _08094544 + cmp r1, r0 + ble _08094550 + ldr r0, _08094548 + ldr r2, _0809454C + adds r1, r2 + lsls r1, 3 + adds r1, r0 + ldrb r0, [r1] + b _08094552 + .align 2, 0 +_08094544: .4byte 0x000001f3 +_08094548: .4byte gUnknown_8113080 +_0809454C: .4byte 0xfffffe0c +_08094550: + movs r0, 0x1 +_08094552: + pop {r1} + bx r1 + thumb_func_end sub_8094528 + + thumb_func_start sub_8094558 +sub_8094558: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xCC + adds r7, r0, 0 + adds r4, r1, 0 + adds r6, r2, 0 + bl sub_80073B8 + movs r5, 0 + str r5, [sp] + movs r0, 0x10 + movs r1, 0 + adds r2, r4, 0 + adds r3, r7, 0 + bl sub_8014FF0 + ldr r4, _080945D0 + adds r1, r6, 0 + adds r1, 0x18 + adds r0, r4, 0 + bl sub_8090208 + ldr r0, _080945D4 + ldr r2, [r0] + str r5, [sp] + movs r0, 0x4 + movs r1, 0x10 + adds r3, r7, 0 + bl sub_8014FF0 + movs r5, 0x1A + adds r0, r4, 0 + adds r1, r6, 0 + movs r2, 0xA + bl sub_80922B4 + adds r4, 0x50 + adds r1, r6, 0 + adds r1, 0xA + adds r0, r4, 0 + movs r2, 0xA + bl sub_80922B4 + movs r1, 0x14 + ldrsh r0, [r6, r1] + bl sub_8094528 + lsls r0, 24 + cmp r0, 0 + beq _080945DC + ldr r0, _080945D8 + ldr r0, [r0] + add r2, sp, 0xCC + add r1, sp, 0x4 + movs r3, 0 + bl sub_8014BC4 + b _080945EA + .align 2, 0 +_080945D0: .4byte gUnknown_202DF98 +_080945D4: .4byte gUnknown_8113850 +_080945D8: .4byte gUnknown_8113868 +_080945DC: + ldr r0, _0809465C + ldr r0, [r0] + add r2, sp, 0xCC + add r1, sp, 0x4 + movs r3, 0 + bl sub_8014BC4 +_080945EA: + add r0, sp, 0x4 + bl sub_8008ED0 + movs r4, 0xB0 + subs r0, r4, r0 + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + movs r1, 0 + mov r8, r1 + str r1, [sp] + adds r1, r5, 0 + add r2, sp, 0x4 + adds r3, r7, 0 + bl sub_8014FF0 + adds r5, 0xA + movs r1, 0x14 + ldrsh r0, [r6, r1] + add r1, sp, 0x4 + bl sub_80944BC + add r0, sp, 0x4 + bl sub_8008ED0 + subs r4, r0 + lsrs r0, r4, 31 + adds r4, r0 + asrs r0, r4, 1 + mov r1, r8 + str r1, [sp] + adds r1, r5, 0 + add r2, sp, 0x4 + adds r3, r7, 0 + bl sub_8014FF0 + adds r5, 0x10 + ldr r1, _08094660 + ldr r0, [r6, 0x20] + str r0, [r1] + adds r0, r6, 0 + adds r0, 0x2A + ldrb r0, [r0] + str r0, [r1, 0x4] + cmp r0, 0x63 + ble _08094668 + ldr r0, _08094664 + ldr r2, [r0] + mov r0, r8 + str r0, [sp] + movs r0, 0x4 + adds r1, r5, 0 + adds r3, r7, 0 + bl sub_8014FF0 + b _0809467A + .align 2, 0 +_0809465C: .4byte gUnknown_8113870 +_08094660: .4byte gUnknown_202DE30 +_08094664: .4byte gUnknown_81138C0 +_08094668: + ldr r0, _080946CC + ldr r2, [r0] + mov r1, r8 + str r1, [sp] + movs r0, 0x4 + adds r1, r5, 0 + adds r3, r7, 0 + bl sub_8014FF0 +_0809467A: + adds r5, 0xA + ldr r4, _080946D0 + movs r1, 0x24 + ldrsh r0, [r6, r1] + str r0, [r4] + ldr r0, _080946D4 + ldr r2, [r0] + movs r0, 0 + mov r8, r0 + str r0, [sp] + movs r0, 0x4 + adds r1, r5, 0 + adds r3, r7, 0 + bl sub_8014FF0 + adds r5, 0xA + adds r0, r6, 0 + adds r0, 0x26 + ldrb r2, [r0] + str r2, [r4] + adds r0, 0x2 + ldrb r0, [r0] + str r0, [r4, 0x4] + adds r0, r6, 0 + adds r0, 0x2B + ldrb r1, [r0] + cmp r1, 0 + beq _080946DC + adds r0, r1, 0 + adds r0, r2, r0 + str r0, [r4] + ldr r0, _080946D8 + ldr r2, [r0] + mov r1, r8 + str r1, [sp] + movs r0, 0x4 + adds r1, r5, 0 + adds r3, r7, 0 + bl sub_8014FF0 + b _080946EC + .align 2, 0 +_080946CC: .4byte gUnknown_8113898 +_080946D0: .4byte gUnknown_202DE30 +_080946D4: .4byte gUnknown_81138D0 +_080946D8: .4byte gUnknown_8113950 +_080946DC: + ldr r0, _08094714 + ldr r2, [r0] + str r1, [sp] + movs r0, 0x4 + adds r1, r5, 0 + adds r3, r7, 0 + bl sub_8014FF0 +_080946EC: + adds r0, r6, 0 + adds r0, 0x2D + ldrb r1, [r0] + cmp r1, 0 + beq _08094720 + ldr r2, _08094718 + ldr r0, [r2, 0x4] + adds r0, r1 + str r0, [r2, 0x4] + ldr r0, _0809471C + ldr r2, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0x4 + adds r1, r5, 0 + adds r3, r7, 0 + bl sub_8014FF0 + b _08094730 + .align 2, 0 +_08094714: .4byte gUnknown_81138E4 +_08094718: .4byte gUnknown_202DE30 +_0809471C: .4byte gUnknown_8113974 +_08094720: + ldr r0, _08094768 + ldr r2, [r0] + str r1, [sp] + movs r0, 0x4 + adds r1, r5, 0 + adds r3, r7, 0 + bl sub_8014FF0 +_08094730: + adds r5, 0xA + ldr r2, _0809476C + adds r0, r6, 0 + adds r0, 0x27 + ldrb r3, [r0] + str r3, [r2] + adds r0, 0x2 + ldrb r0, [r0] + str r0, [r2, 0x4] + adds r0, r6, 0 + adds r0, 0x2C + ldrb r1, [r0] + cmp r1, 0 + beq _08094774 + adds r0, r1, 0 + adds r0, r3, r0 + str r0, [r2] + ldr r0, _08094770 + ldr r2, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0x4 + adds r1, r5, 0 + adds r3, r7, 0 + bl sub_8014FF0 + b _08094784 + .align 2, 0 +_08094768: .4byte gUnknown_8113900 +_0809476C: .4byte gUnknown_202DE30 +_08094770: .4byte gUnknown_8113990 +_08094774: + ldr r0, _080947AC + ldr r2, [r0] + str r1, [sp] + movs r0, 0x4 + adds r1, r5, 0 + adds r3, r7, 0 + bl sub_8014FF0 +_08094784: + adds r0, r6, 0 + adds r0, 0x2E + ldrb r1, [r0] + cmp r1, 0 + beq _080947B8 + ldr r2, _080947B0 + ldr r0, [r2, 0x4] + adds r0, r1 + str r0, [r2, 0x4] + ldr r0, _080947B4 + ldr r2, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0x4 + adds r1, r5, 0 + adds r3, r7, 0 + bl sub_8014FF0 + b _080947C8 + .align 2, 0 +_080947AC: .4byte gUnknown_8113918 +_080947B0: .4byte gUnknown_202DE30 +_080947B4: .4byte gUnknown_81139B4 +_080947B8: + ldr r0, _080947E4 + ldr r2, [r0] + str r1, [sp] + movs r0, 0x4 + adds r1, r5, 0 + adds r3, r7, 0 + bl sub_8014FF0 +_080947C8: + adds r5, 0x10 + adds r2, r6, 0 + adds r2, 0x1C + ldrb r1, [r6, 0x1C] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080947EC + ldr r0, _080947E8 + adds r1, r2, 0 + movs r2, 0 + bl sub_8090E14 + b _080947F6 + .align 2, 0 +_080947E4: .4byte gUnknown_8113934 +_080947E8: .4byte gUnknown_202DE58 +_080947EC: + ldr r0, _0809481C + ldr r1, _08094820 + ldr r1, [r1] + bl strcpy +_080947F6: + ldr r0, _08094824 + ldr r2, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0x4 + adds r1, r5, 0 + adds r3, r7, 0 + bl sub_8014FF0 + adds r0, r7, 0 + bl sub_80073E0 + add sp, 0xCC + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0809481C: .4byte gUnknown_202DE58 +_08094820: .4byte gUnknown_81139B8 +_08094824: .4byte gUnknown_81139CC + thumb_func_end sub_8094558 + + thumb_func_start sub_8094828 +sub_8094828: + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + lsls r1, 24 + lsrs r0, r1, 24 + cmp r0, 0 + beq _08094852 + bl sub_8090BD0 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x9 + bne _0809484C + ldr r0, _08094848 + b _08094856 + .align 2, 0 +_08094848: .4byte 0x00000223 +_0809484C: + movs r0, 0x89 + lsls r0, 2 + b _08094856 +_08094852: + lsls r0, r2, 16 + asrs r0, 16 +_08094856: + pop {r1} + bx r1 + thumb_func_end sub_8094828 + + thumb_func_start sub_809485C +sub_809485C: + str r1, [r0] + movs r3, 0 + str r3, [r0, 0x8] + str r3, [r0, 0xC] + adds r1, r2 + str r1, [r0, 0x4] + bx lr + thumb_func_end sub_809485C + + thumb_func_start sub_809486C +sub_809486C: + push {lr} + str r1, [r0] + movs r3, 0 + str r3, [r0, 0x8] + str r3, [r0, 0xC] + adds r3, r1, r2 + str r3, [r0, 0x4] + adds r0, r1, 0 + adds r1, r2, 0 + bl MemoryClear8 + pop {r0} + bx r0 + thumb_func_end sub_809486C + + thumb_func_start nullsub_102 +nullsub_102: + bx lr + thumb_func_end nullsub_102 + + thumb_func_start sub_809488C +sub_809488C: + push {r4-r7,lr} + adds r3, r0, 0 + adds r4, r2, 0 + movs r5, 0 + adds r6, r1, 0 + cmp r4, 0 + beq _080948DE + movs r7, 0x1 +_0809489C: + ldrb r0, [r6] + asrs r0, r5 + ands r0, r7 + cmp r0, 0 + beq _080948B4 + ldr r2, [r3] + ldr r1, [r3, 0x8] + adds r0, r7, 0 + lsls r0, r1 + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] +_080948B4: + adds r5, 0x1 + cmp r5, 0x8 + bne _080948BE + adds r6, 0x1 + movs r5, 0 +_080948BE: + ldr r0, [r3, 0x8] + adds r0, 0x1 + str r0, [r3, 0x8] + cmp r0, 0x8 + bne _080948D2 + ldr r0, [r3] + adds r0, 0x1 + str r0, [r3] + movs r0, 0 + str r0, [r3, 0x8] +_080948D2: + ldr r0, [r3, 0xC] + adds r0, 0x1 + str r0, [r3, 0xC] + subs r4, 0x1 + cmp r4, 0 + bne _0809489C +_080948DE: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_809488C + + thumb_func_start sub_80948E4 +sub_80948E4: + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r2, 0 + adds r6, r1, 0 + cmp r5, 0 + beq _0809491C +_080948F0: + ldrb r1, [r6] + ldr r0, [r4, 0x8] + lsls r1, r0 + ldr r3, [r4] + ldrb r2, [r3] + adds r0, r1, 0 + orrs r0, r2 + strb r0, [r3] + ldr r2, [r4] + adds r0, r2, 0x1 + str r0, [r4] + asrs r1, 8 + ldrb r0, [r2, 0x1] + orrs r1, r0 + strb r1, [r2, 0x1] + adds r6, 0x1 + ldr r0, [r4, 0xC] + adds r0, 0x8 + str r0, [r4, 0xC] + subs r5, 0x1 + cmp r5, 0 + bne _080948F0 +_0809491C: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80948E4 + + thumb_func_start sub_8094924 +sub_8094924: + push {r4-r7,lr} + adds r3, r0, 0 + adds r5, r2, 0 + movs r6, 0 + adds r2, r1, 0 + cmp r5, 0 + beq _08094978 +_08094932: + cmp r6, 0 + bne _08094938 + strb r6, [r2] +_08094938: + ldr r7, [r3] + ldrb r0, [r7] + ldr r4, [r3, 0x8] + asrs r0, r4 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08094952 + adds r0, r1, 0 + lsls r0, r6 + ldrb r1, [r2] + orrs r0, r1 + strb r0, [r2] +_08094952: + adds r6, 0x1 + cmp r6, 0x8 + bne _0809495C + adds r2, 0x1 + movs r6, 0 +_0809495C: + adds r0, r4, 0x1 + str r0, [r3, 0x8] + cmp r0, 0x8 + bne _0809496C + adds r0, r7, 0x1 + str r0, [r3] + movs r0, 0 + str r0, [r3, 0x8] +_0809496C: + ldr r0, [r3, 0xC] + adds r0, 0x1 + str r0, [r3, 0xC] + subs r5, 0x1 + cmp r5, 0 + bne _08094932 +_08094978: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8094924 + + thumb_func_start sub_8094980 +sub_8094980: + ldr r1, _08094988 + ldr r0, _0809498C + str r0, [r1] + bx lr + .align 2, 0 +_08094988: .4byte gUnknown_203B46C +_0809498C: .4byte gUnknown_2038C70 + thumb_func_end sub_8094980 + + thumb_func_start sub_8094990 +sub_8094990: + ldr r0, _08094994 + bx lr + .align 2, 0 +_08094994: .4byte gUnknown_2038C70 + thumb_func_end sub_8094990 + + thumb_func_start sub_8094998 +sub_8094998: + push {lr} + lsls r0, 24 + ldr r2, _080949D8 + ldr r1, [r2] + movs r3, 0 + strb r3, [r1, 0x8] + cmp r0, 0 + beq _080949AC + ldr r0, [r2] + strb r3, [r0, 0xB] +_080949AC: + ldr r0, [r2] + strb r3, [r0, 0x9] + ldr r0, [r2] + strb r3, [r0, 0xA] + ldr r0, [r2] + strb r3, [r0] + ldr r0, [r2] + movs r1, 0x1 + strb r1, [r0, 0x1] + ldr r0, [r2] + strb r1, [r0, 0x2] + ldr r0, [r2] + strb r1, [r0, 0x3] + ldr r0, [r2] + strb r1, [r0, 0x4] + ldr r0, [r2] + strb r3, [r0, 0xC] + bl sub_8094C14 + pop {r0} + bx r0 + .align 2, 0 +_080949D8: .4byte gUnknown_203B46C + thumb_func_end sub_8094998 + + thumb_func_start sub_80949DC +sub_80949DC: + push {lr} + adds r2, r0, 0 + ldr r0, _08094A38 + ldr r1, [r0] + ldrb r0, [r1, 0x8] + ldrb r3, [r2, 0x8] + cmp r0, r3 + bne _08094A3C + ldrb r0, [r1, 0x9] + ldrb r3, [r2, 0x9] + cmp r0, r3 + bne _08094A3C + ldrb r0, [r1, 0xA] + ldrb r3, [r2, 0xA] + cmp r0, r3 + bne _08094A3C + ldrb r0, [r1, 0xB] + ldrb r3, [r2, 0xB] + cmp r0, r3 + bne _08094A3C + ldrb r0, [r1] + ldrb r3, [r2] + cmp r0, r3 + bne _08094A3C + ldrb r0, [r1, 0x1] + ldrb r3, [r2, 0x1] + cmp r0, r3 + bne _08094A3C + ldrb r0, [r1, 0x2] + ldrb r3, [r2, 0x2] + cmp r0, r3 + bne _08094A3C + ldrb r0, [r1, 0x3] + ldrb r3, [r2, 0x3] + cmp r0, r3 + bne _08094A3C + ldrb r0, [r1, 0x4] + ldrb r3, [r2, 0x4] + cmp r0, r3 + bne _08094A3C + ldrb r0, [r1, 0xC] + ldrb r2, [r2, 0xC] + cmp r0, r2 + bne _08094A3C + movs r0, 0x1 + b _08094A3E + .align 2, 0 +_08094A38: .4byte gUnknown_203B46C +_08094A3C: + movs r0, 0 +_08094A3E: + pop {r1} + bx r1 + thumb_func_end sub_80949DC + + thumb_func_start sub_8094A44 +sub_8094A44: + push {r4-r7,lr} + sub sp, 0x4 + adds r4, r0, 0 + movs r1, 0xFF + mov r0, sp + strb r1, [r0] + mov r7, sp + adds r7, 0x1 + movs r0, 0 + strb r0, [r7] + ldr r5, _08094B14 + ldr r1, [r5] + adds r1, 0x8 + adds r0, r4, 0 + movs r2, 0x2 + bl sub_809488C + ldr r0, [r5] + ldrb r0, [r0, 0x9] + mov r1, sp + adds r6, r7, 0 + cmp r0, 0 + bne _08094A74 + adds r1, r6, 0 +_08094A74: + adds r0, r4, 0 + movs r2, 0x1 + bl sub_809488C + ldr r0, [r5] + ldrb r0, [r0, 0xA] + adds r1, r6, 0 + cmp r0, 0 + beq _08094A88 + mov r1, sp +_08094A88: + adds r0, r4, 0 + movs r2, 0x1 + bl sub_809488C + ldr r0, [r5] + ldrb r0, [r0, 0xB] + adds r1, r6, 0 + cmp r0, 0 + beq _08094A9C + mov r1, sp +_08094A9C: + adds r0, r4, 0 + movs r2, 0x1 + bl sub_809488C + ldr r0, [r5] + ldrb r0, [r0] + adds r1, r6, 0 + cmp r0, 0 + beq _08094AB0 + mov r1, sp +_08094AB0: + adds r0, r4, 0 + movs r2, 0x1 + bl sub_809488C + ldr r0, [r5] + ldrb r0, [r0, 0x1] + adds r1, r6, 0 + cmp r0, 0 + beq _08094AC4 + mov r1, sp +_08094AC4: + adds r0, r4, 0 + movs r2, 0x1 + bl sub_809488C + ldr r0, [r5] + ldrb r0, [r0, 0x2] + adds r1, r6, 0 + cmp r0, 0 + beq _08094AD8 + mov r1, sp +_08094AD8: + adds r0, r4, 0 + movs r2, 0x1 + bl sub_809488C + ldr r0, [r5] + ldrb r0, [r0, 0x3] + adds r1, r7, 0 + cmp r0, 0 + beq _08094AEC + mov r1, sp +_08094AEC: + adds r0, r4, 0 + movs r2, 0x1 + bl sub_809488C + ldr r1, [r5] + adds r1, 0x4 + adds r0, r4, 0 + movs r2, 0x3 + bl sub_809488C + ldr r1, [r5] + adds r1, 0xC + adds r0, r4, 0 + movs r2, 0x2 + bl sub_809488C + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08094B14: .4byte gUnknown_203B46C + thumb_func_end sub_8094A44 + + thumb_func_start sub_8094B18 +sub_8094B18: + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x4 + adds r6, r0, 0 + mov r1, sp + movs r2, 0x2 + bl sub_8094924 + ldr r5, _08094C10 + ldr r2, [r5] + mov r0, sp + ldrb r1, [r0] + movs r0, 0x3 + mov r8, r0 + ands r0, r1 + strb r0, [r2, 0x8] + adds r0, r6, 0 + mov r1, sp + movs r2, 0x1 + bl sub_8094924 + ldr r2, [r5] + mov r0, sp + ldrb r1, [r0] + movs r4, 0x1 + adds r0, r4, 0 + ands r0, r1 + strb r0, [r2, 0x9] + adds r0, r6, 0 + mov r1, sp + movs r2, 0x1 + bl sub_8094924 + ldr r2, [r5] + mov r0, sp + ldrb r1, [r0] + adds r0, r4, 0 + ands r0, r1 + strb r0, [r2, 0xA] + adds r0, r6, 0 + mov r1, sp + movs r2, 0x1 + bl sub_8094924 + ldr r2, [r5] + mov r0, sp + ldrb r1, [r0] + adds r0, r4, 0 + ands r0, r1 + strb r0, [r2, 0xB] + adds r0, r6, 0 + mov r1, sp + movs r2, 0x1 + bl sub_8094924 + ldr r2, [r5] + mov r0, sp + ldrb r1, [r0] + adds r0, r4, 0 + ands r0, r1 + strb r0, [r2] + adds r0, r6, 0 + mov r1, sp + movs r2, 0x1 + bl sub_8094924 + ldr r2, [r5] + mov r0, sp + ldrb r1, [r0] + adds r0, r4, 0 + ands r0, r1 + strb r0, [r2, 0x1] + adds r0, r6, 0 + mov r1, sp + movs r2, 0x1 + bl sub_8094924 + ldr r2, [r5] + mov r0, sp + ldrb r1, [r0] + adds r0, r4, 0 + ands r0, r1 + strb r0, [r2, 0x2] + adds r0, r6, 0 + mov r1, sp + movs r2, 0x1 + bl sub_8094924 + ldr r1, [r5] + mov r0, sp + ldrb r0, [r0] + ands r4, r0 + strb r4, [r1, 0x3] + adds r0, r6, 0 + mov r1, sp + movs r2, 0x3 + bl sub_8094924 + ldr r2, [r5] + mov r0, sp + ldrb r1, [r0] + movs r0, 0x7 + ands r0, r1 + strb r0, [r2, 0x4] + adds r0, r6, 0 + mov r1, sp + movs r2, 0x2 + bl sub_8094924 + ldr r1, [r5] + mov r0, sp + ldrb r0, [r0] + mov r2, r8 + ands r2, r0 + strb r2, [r1, 0xC] + bl sub_8094C14 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08094C10: .4byte gUnknown_203B46C + thumb_func_end sub_8094B18 + + thumb_func_start sub_8094C14 +sub_8094C14: + push {r4,lr} + sub sp, 0x10 + mov r1, sp + ldr r0, _08094C40 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r0, [r0] + str r0, [r1] + ldr r0, _08094C44 + ldr r0, [r0] + ldrb r1, [r0, 0x8] + movs r0, 0x3 + ands r0, r1 + lsls r0, 2 + add r0, sp + ldr r0, [r0] + bl sub_80099F0 + add sp, 0x10 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08094C40: .4byte gUnknown_8109954 +_08094C44: .4byte gUnknown_203B46C + thumb_func_end sub_8094C14 + + thumb_func_start sub_8094C48 +sub_8094C48: + push {lr} + ldr r0, _08094C5C + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r0, 0 + beq _08094C60 + cmp r0, 0x3 + beq _08094C60 + movs r0, 0x1 + b _08094C62 + .align 2, 0 +_08094C5C: .4byte gUnknown_203B46C +_08094C60: + movs r0, 0 +_08094C62: + pop {r1} + bx r1 + thumb_func_end sub_8094C48 + + thumb_func_start sub_8094C68 +sub_8094C68: + push {lr} + ldr r0, _08094C7C + ldr r0, [r0] + ldrb r0, [r0, 0x4] + cmp r0, 0x2 + beq _08094C80 + cmp r0, 0x5 + beq _08094C80 + movs r0, 0x1 + b _08094C82 + .align 2, 0 +_08094C7C: .4byte gUnknown_203B46C +_08094C80: + movs r0, 0 +_08094C82: + pop {r1} + bx r1 + thumb_func_end sub_8094C68 + + thumb_func_start sub_8094C88 +sub_8094C88: + push {lr} + ldr r0, _08094C98 + ldr r1, [r0] + ldrb r0, [r1, 0x4] + cmp r0, 0x2 + bhi _08094C9C + movs r0, 0x1 + b _08094CA8 + .align 2, 0 +_08094C98: .4byte gUnknown_203B46C +_08094C9C: + subs r0, 0x3 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bhi _08094CAA + movs r0, 0x4 +_08094CA8: + strb r0, [r1, 0x4] +_08094CAA: + pop {r0} + bx r0 + thumb_func_end sub_8094C88 + + thumb_func_start sub_8094CB0 +sub_8094CB0: + ldr r1, _08094CBC + strh r1, [r0] + movs r1, 0x1 + negs r1, r1 + strh r1, [r0, 0x2] + bx lr + .align 2, 0 +_08094CBC: .4byte 0x0000ffff + thumb_func_end sub_8094CB0 + + thumb_func_start sub_8094CC0 +sub_8094CC0: + ldr r1, _08094CCC + strh r1, [r0] + movs r1, 0x1 + negs r1, r1 + strh r1, [r0, 0x2] + bx lr + .align 2, 0 +_08094CCC: .4byte 0x0000ffff + thumb_func_end sub_8094CC0 + + thumb_func_start sub_8094CD0 +sub_8094CD0: + ldr r1, _08094CDC + strh r1, [r0] + movs r1, 0x1 + negs r1, r1 + strh r1, [r0, 0x2] + bx lr + .align 2, 0 +_08094CDC: .4byte 0x0000ffff + thumb_func_end sub_8094CD0 + + thumb_func_start sub_8094CE0 +sub_8094CE0: + ldr r1, _08094CEC + strh r1, [r0] + movs r1, 0x1 + negs r1, r1 + strh r1, [r0, 0x2] + bx lr + .align 2, 0 +_08094CEC: .4byte 0x0000ffff + thumb_func_end sub_8094CE0 + + thumb_func_start sub_8094CF0 +sub_8094CF0: + ldr r1, _08094CFC + strh r1, [r0] + movs r1, 0x1 + negs r1, r1 + strh r1, [r0, 0x2] + bx lr + .align 2, 0 +_08094CFC: .4byte 0x0000ffff + thumb_func_end sub_8094CF0 + + thumb_func_start sub_8094D00 +sub_8094D00: + ldr r1, _08094D0C + strh r1, [r0] + movs r1, 0x1 + negs r1, r1 + strh r1, [r0, 0x2] + bx lr + .align 2, 0 +_08094D0C: .4byte 0x0000ffff + thumb_func_end sub_8094D00 + + thumb_func_start sub_8094D10 +sub_8094D10: + movs r0, 0 + bx lr + thumb_func_end sub_8094D10 + + thumb_func_start sub_8094D14 +sub_8094D14: + movs r0, 0 + bx lr + thumb_func_end sub_8094D14 + + thumb_func_start sub_8094D18 +sub_8094D18: + movs r0, 0 + bx lr + thumb_func_end sub_8094D18 + + thumb_func_start sub_8094D1C +sub_8094D1C: + movs r0, 0 + bx lr + thumb_func_end sub_8094D1C + + thumb_func_start sub_8094D20 +sub_8094D20: + movs r0, 0 + bx lr + thumb_func_end sub_8094D20 + + thumb_func_start sub_8094D24 +sub_8094D24: + movs r0, 0 + bx lr + thumb_func_end sub_8094D24 + + thumb_func_start sub_8094D28 +sub_8094D28: + push {r4-r7,lr} + ldr r2, _08094D64 + str r0, [r2] + ldr r1, _08094D68 + movs r0, 0x1 + str r0, [r1] + ldr r7, _08094D6C + adds r5, r2, 0 + adds r4, r1, 0 + ldr r6, _08094D70 +_08094D3C: + ldr r2, [r4] + lsls r3, r2, 2 + adds r3, r5 + subs r0, r2, 0x1 + lsls r0, 2 + adds r0, r5 + ldr r0, [r0] + lsrs r1, r0, 30 + eors r0, r1 + muls r0, r6 + adds r0, r2 + str r0, [r3] + adds r2, 0x1 + str r2, [r4] + cmp r2, r7 + ble _08094D3C + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08094D64: .4byte gUnknown_3001198 +_08094D68: .4byte gUnknown_203B470 +_08094D6C: .4byte 0x0000026f +_08094D70: .4byte 0x6c078965 + thumb_func_end sub_8094D28 + + thumb_func_start sub_8094D74 +sub_8094D74: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r8, r0 + adds r7, r1, 0 + ldr r0, _08094E34 + bl sub_8094D28 + movs r4, 0x1 + movs r5, 0 + adds r3, r7, 0 + movs r0, 0x9C + lsls r0, 2 + cmp r3, r0 + bge _08094D96 + adds r3, r0, 0 +_08094D96: + ldr r6, _08094E38 + cmp r3, 0 + beq _08094DE2 + mov r9, r6 + ldr r0, _08094E3C + adds r0, r6 + mov r12, r0 + adds r2, r6, 0 +_08094DA6: + ldr r1, [r2] + lsrs r0, r1, 30 + eors r1, r0 + ldr r0, _08094E40 + muls r0, r1 + ldr r1, [r2, 0x4] + eors r1, r0 + lsls r0, r5, 2 + add r0, r8 + ldr r0, [r0] + adds r1, r0 + adds r1, r5 + str r1, [r2, 0x4] + adds r2, 0x4 + adds r4, 0x1 + adds r5, 0x1 + ldr r0, _08094E44 + cmp r4, r0 + ble _08094DD6 + mov r1, r12 + ldr r0, [r1] + str r0, [r6] + mov r2, r9 + movs r4, 0x1 +_08094DD6: + cmp r5, r7 + blt _08094DDC + movs r5, 0 +_08094DDC: + subs r3, 0x1 + cmp r3, 0 + bne _08094DA6 +_08094DE2: + ldr r3, _08094E44 + ldr r5, _08094E38 + ldr r0, _08094E3C + adds r0, r5 + mov r8, r0 + lsls r0, r4, 2 + subs r0, 0x4 + adds r2, r0, r5 + ldr r1, _08094E48 + mov r12, r1 + adds r7, r3, 0 +_08094DF8: + ldr r0, [r2] + lsrs r1, r0, 30 + eors r0, r1 + mov r1, r12 + muls r1, r0 + ldr r0, [r2, 0x4] + eors r0, r1 + subs r0, r4 + str r0, [r2, 0x4] + adds r2, 0x4 + adds r4, 0x1 + cmp r4, r7 + ble _08094E1C + mov r1, r8 + ldr r0, [r1] + str r0, [r6] + adds r2, r5, 0 + movs r4, 0x1 +_08094E1C: + subs r3, 0x1 + cmp r3, 0 + bne _08094DF8 + movs r0, 0x80 + lsls r0, 24 + str r0, [r6] + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08094E34: .4byte 0x012bd6aa +_08094E38: .4byte gUnknown_3001198 +_08094E3C: .4byte 0x000009bc +_08094E40: .4byte 0x0019660d +_08094E44: .4byte 0x0000026f +_08094E48: .4byte 0x5d588b65 + thumb_func_end sub_8094D74 + + thumb_func_start sub_8094E4C +sub_8094E4C: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r0, _08094F54 + ldr r2, [r0] + ldr r1, _08094F58 + mov r8, r0 + cmp r2, r1 + ble _08094F1C + ldr r0, _08094F5C + cmp r2, r0 + bne _08094E6C + ldr r0, _08094F60 + bl sub_8094D28 +_08094E6C: + movs r3, 0 + ldr r0, _08094F64 + mov r9, r0 + ldr r7, _08094F68 + mov r12, r9 + adds r5, r7, 0 +_08094E78: + ldr r4, [r5] + movs r6, 0x80 + lsls r6, 24 + ands r4, r6 + ldr r0, [r5, 0x4] + ldr r1, _08094F6C + ands r0, r1 + orrs r4, r0 + ldr r1, _08094F70 + adds r0, r3, r1 + lsls r0, 2 + adds r0, r7 + lsrs r2, r4, 1 + ldr r1, [r0] + eors r1, r2 + movs r0, 0x1 + ands r4, r0 + lsls r0, r4, 2 + add r0, r12 + ldr r0, [r0] + eors r1, r0 + stm r5!, {r1} + adds r3, 0x1 + cmp r3, 0xE2 + ble _08094E78 + ldr r5, _08094F74 + cmp r3, r5 + bgt _08094EE6 + ldr r1, _08094F68 + ldr r4, _08094F64 + mov r12, r4 + lsls r0, r3, 2 + adds r2, r0, r1 + ldr r4, _08094F78 + adds r0, r4 + adds r7, r0, r1 +_08094EC0: + ldr r4, [r2] + ands r4, r6 + ldr r0, [r2, 0x4] + ldr r1, _08094F6C + ands r0, r1 + orrs r4, r0 + lsrs r0, r4, 1 + ldm r7!, {r1} + eors r1, r0 + movs r0, 0x1 + ands r4, r0 + lsls r0, r4, 2 + add r0, r12 + ldr r0, [r0] + eors r1, r0 + stm r2!, {r1} + adds r3, 0x1 + cmp r3, r5 + ble _08094EC0 +_08094EE6: + ldr r2, _08094F68 + ldr r0, _08094F7C + adds r3, r2, r0 + ldr r4, [r3] + movs r0, 0x80 + lsls r0, 24 + ands r4, r0 + ldr r0, [r2] + ldr r1, _08094F6C + ands r0, r1 + orrs r4, r0 + movs r1, 0xC6 + lsls r1, 3 + adds r2, r1 + lsrs r0, r4, 1 + ldr r1, [r2] + eors r1, r0 + movs r0, 0x1 + ands r4, r0 + lsls r0, r4, 2 + add r0, r9 + ldr r0, [r0] + eors r1, r0 + str r1, [r3] + movs r0, 0 + mov r4, r8 + str r0, [r4] +_08094F1C: + ldr r2, _08094F68 + mov r0, r8 + ldr r1, [r0] + lsls r0, r1, 2 + adds r0, r2 + ldr r4, [r0] + adds r1, 0x1 + mov r0, r8 + str r1, [r0] + lsrs r0, r4, 11 + eors r4, r0 + lsls r0, r4, 7 + ldr r1, _08094F80 + ands r0, r1 + eors r4, r0 + lsls r0, r4, 15 + ldr r1, _08094F84 + ands r0, r1 + eors r4, r0 + lsrs r0, r4, 18 + eors r4, r0 + adds r0, r4, 0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08094F54: .4byte gUnknown_203B470 +_08094F58: .4byte 0x0000026f +_08094F5C: .4byte 0x00000271 +_08094F60: .4byte 0x00001571 +_08094F64: .4byte gUnknown_203B474 +_08094F68: .4byte gUnknown_3001198 +_08094F6C: .4byte 0x7fffffff +_08094F70: .4byte 0x0000018d +_08094F74: .4byte 0x0000026e +_08094F78: .4byte 0xfffffc74 +_08094F7C: .4byte 0x000009bc +_08094F80: .4byte 0x9d2c5680 +_08094F84: .4byte 0xefc60000 + thumb_func_end sub_8094E4C + + thumb_func_start sub_8094F88 +sub_8094F88: + push {lr} + ldr r1, _08094F98 + ldr r0, _08094F9C + str r0, [r1] + bl sub_8094FA8 + pop {r0} + bx r0 + .align 2, 0 +_08094F98: .4byte gUnknown_203B47C +_08094F9C: .4byte gUnknown_2038C80 + thumb_func_end sub_8094F88 + + thumb_func_start sub_8094FA0 +sub_8094FA0: + ldr r0, _08094FA4 + bx lr + .align 2, 0 +_08094FA4: .4byte gUnknown_2038C80 + thumb_func_end sub_8094FA0 + + thumb_func_start sub_8094FA8 +sub_8094FA8: + movs r1, 0 + strb r1, [r0, 0x4] + strb r1, [r0, 0x3] + strb r1, [r0, 0x2] + strh r1, [r0] + bx lr + thumb_func_end sub_8094FA8 + + thumb_func_start sub_8094FB4 +sub_8094FB4: + push {lr} + adds r2, r0, 0 + ldrb r0, [r2, 0x4] + adds r0, 0x1 + movs r1, 0 + strb r0, [r2, 0x4] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3B + bls _0809500A + strb r1, [r2, 0x4] + ldrb r0, [r2, 0x3] + adds r0, 0x1 + strb r0, [r2, 0x3] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3B + bls _0809500A + strb r1, [r2, 0x3] + ldrb r0, [r2, 0x2] + adds r0, 0x1 + strb r0, [r2, 0x2] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3B + bls _0809500A + strb r1, [r2, 0x2] + ldrh r3, [r2] + movs r0, 0 + ldrsh r1, [r2, r0] + ldr r0, _08094FFC + cmp r1, r0 + bgt _08095000 + adds r0, r3, 0x1 + b _08095008 + .align 2, 0 +_08094FFC: .4byte 0x0000270e +_08095000: + movs r0, 0x3B + strb r0, [r2, 0x3] + strb r0, [r2, 0x2] + ldr r0, _08095010 +_08095008: + strh r0, [r2] +_0809500A: + pop {r0} + bx r0 + .align 2, 0 +_08095010: .4byte 0x0000270f + thumb_func_end sub_8094FB4 + + thumb_func_start sub_8095014 +sub_8095014: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r1, 0 + ldrsh r0, [r4, r1] + ldr r1, _08095030 + cmp r0, r1 + bgt _08095034 + str r0, [r5] + ldrb r0, [r4, 0x2] + str r0, [r2] + ldrb r0, [r4, 0x3] + b _0809503A + .align 2, 0 +_08095030: .4byte 0x0000270f +_08095034: + str r1, [r5] + movs r0, 0x3B + str r0, [r2] +_0809503A: + str r0, [r3] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8095014 + + thumb_func_start sub_8095044 +sub_8095044: + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, _0809507C + ldr r1, [r4] + adds r1, 0x4 + movs r2, 0x6 + bl sub_809488C + ldr r1, [r4] + adds r1, 0x3 + adds r0, r5, 0 + movs r2, 0x6 + bl sub_809488C + ldr r1, [r4] + adds r1, 0x2 + adds r0, r5, 0 + movs r2, 0x6 + bl sub_809488C + ldr r1, [r4] + adds r0, r5, 0 + movs r2, 0xE + bl sub_809488C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0809507C: .4byte gUnknown_203B47C + thumb_func_end sub_8095044 + + thumb_func_start sub_8095080 +sub_8095080: + push {r4,r5,lr} + adds r5, r0, 0 + ldr r4, _080950B8 + ldr r1, [r4] + adds r1, 0x4 + movs r2, 0x6 + bl sub_8094924 + ldr r1, [r4] + adds r1, 0x3 + adds r0, r5, 0 + movs r2, 0x6 + bl sub_8094924 + ldr r1, [r4] + adds r1, 0x2 + adds r0, r5, 0 + movs r2, 0x6 + bl sub_8094924 + ldr r1, [r4] + adds r0, r5, 0 + movs r2, 0xE + bl sub_8094924 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080950B8: .4byte gUnknown_203B47C + thumb_func_end sub_8095080 + + thumb_func_start sub_80950BC +sub_80950BC: + ldr r1, _080950D8 + ldr r0, _080950DC + str r0, [r1] + ldr r1, _080950E0 + ldr r0, _080950E4 + str r0, [r1] + ldr r1, _080950E8 + ldr r0, _080950EC + str r0, [r1] + ldr r1, _080950F0 + ldr r0, _080950F4 + str r0, [r1] + bx lr + .align 2, 0 +_080950D8: .4byte gUnknown_203B480 +_080950DC: .4byte gUnknown_2038C88 +_080950E0: .4byte gUnknown_203B484 +_080950E4: .4byte gUnknown_2039288 +_080950E8: .4byte gUnknown_203B488 +_080950EC: .4byte gUnknown_20392E8 +_080950F0: .4byte gUnknown_203B48C +_080950F4: .4byte gUnknown_20393C0 + thumb_func_end sub_80950BC + + thumb_func_start sub_80950F8 +sub_80950F8: + ldr r0, _080950FC + bx lr + .align 2, 0 +_080950FC: .4byte gUnknown_2038C88 + thumb_func_end sub_80950F8 + + thumb_func_start sub_8095100 +sub_8095100: + ldr r0, _08095104 + bx lr + .align 2, 0 +_08095104: .4byte gUnknown_2039288 + thumb_func_end sub_8095100 + + thumb_func_start sub_8095108 +sub_8095108: + ldr r0, _0809510C + bx lr + .align 2, 0 +_0809510C: .4byte gUnknown_20392E8 + thumb_func_end sub_8095108 + + thumb_func_start sub_8095110 +sub_8095110: + ldr r0, _08095114 + bx lr + .align 2, 0 +_08095114: .4byte gUnknown_20393C0 + thumb_func_end sub_8095110 + + thumb_func_start sub_8095118 +sub_8095118: + push {r4,lr} + ldr r4, _0809517C + ldr r0, [r4] + movs r2, 0xC0 + lsls r2, 3 + movs r1, 0 + bl MemoryFill8 + ldr r0, _08095180 + ldr r0, [r0] + movs r1, 0 + movs r2, 0x5C + bl MemoryFill8 + movs r2, 0 + movs r1, 0 + movs r3, 0x1F +_0809513A: + ldr r0, [r4] + adds r0, r1 + strb r2, [r0] + ldr r0, [r4] + adds r0, r1 + adds r0, 0x22 + strb r2, [r0] + ldr r0, [r4] + adds r0, r1 + adds r0, 0x2D + strb r2, [r0] + adds r1, 0x30 + subs r3, 0x1 + cmp r3, 0 + bge _0809513A + ldr r2, _08095184 + ldr r1, [r2] + movs r0, 0 + str r0, [r1] + movs r3, 0 + movs r4, 0x1 + negs r4, r4 +_08095166: + ldr r0, [r2] + lsls r1, r3, 2 + adds r0, 0x4 + adds r0, r1 + str r4, [r0] + adds r3, 0x1 + cmp r3, 0x1F + ble _08095166 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0809517C: .4byte gUnknown_203B480 +_08095180: .4byte gUnknown_203B484 +_08095184: .4byte gUnknown_203B48C + thumb_func_end sub_8095118 + + thumb_func_start nullsub_206 +nullsub_206: + bx lr + thumb_func_end nullsub_206 + + thumb_func_start nullsub_207 +nullsub_207: + bx lr + thumb_func_end nullsub_207 + + thumb_func_start sub_8095190 +sub_8095190: + push {lr} + movs r2, 0x2 + ldr r0, _080951A8 + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0x60 +_0809519C: + ldrb r0, [r1] + cmp r0, 0 + bne _080951AC + adds r0, r2, 0 + b _080951B8 + .align 2, 0 +_080951A8: .4byte gUnknown_203B480 +_080951AC: + adds r1, 0x30 + adds r2, 0x1 + cmp r2, 0x1F + ble _0809519C + movs r0, 0x1 + negs r0, r0 +_080951B8: + pop {r1} + bx r1 + thumb_func_end sub_8095190 + + thumb_func_start sub_80951BC +sub_80951BC: + push {r4,lr} + adds r4, r0, 0 + bl sub_8095190 + adds r2, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r2, r0 + beq _080951F4 + ldr r0, _080951F0 + ldr r1, [r0] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 4 + adds r1, r0 + adds r0, r4, 0 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + movs r0, 0x1 + b _080951F6 + .align 2, 0 +_080951F0: .4byte gUnknown_203B480 +_080951F4: + movs r0, 0 +_080951F6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80951BC + + thumb_func_start sub_80951FC +sub_80951FC: + push {r4,r5,lr} + ldr r1, _08095224 + ldr r1, [r1] + adds r1, 0x30 + ldrb r2, [r1] + negs r3, r2 + orrs r3, r2 + lsrs r3, 31 + ldm r0!, {r2,r4,r5} + stm r1!, {r2,r4,r5} + ldm r0!, {r2,r4,r5} + stm r1!, {r2,r4,r5} + ldm r0!, {r2,r4,r5} + stm r1!, {r2,r4,r5} + ldm r0!, {r2,r4,r5} + stm r1!, {r2,r4,r5} + adds r0, r3, 0 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08095224: .4byte gUnknown_203B480 + thumb_func_end sub_80951FC + + thumb_func_start sub_8095228 +sub_8095228: + lsls r0, 24 + lsrs r0, 24 + ldr r2, _0809523C + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 4 + ldr r0, [r2] + adds r0, r1 + bx lr + .align 2, 0 +_0809523C: .4byte gUnknown_203B480 + thumb_func_end sub_8095228 + + thumb_func_start sub_8095240 +sub_8095240: + push {r4,r5,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r5, _08095270 + lsls r4, r0, 1 + adds r4, r0 + lsls r4, 4 + ldr r0, [r5] + adds r0, r4 + movs r1, 0 + movs r2, 0x30 + bl MemoryFill8 + ldr r0, [r5] + adds r0, r4 + movs r1, 0 + strb r1, [r0] + ldr r0, [r5] + adds r0, r4 + adds r0, 0x22 + strb r1, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08095270: .4byte gUnknown_203B480 + thumb_func_end sub_8095240 + + thumb_func_start sub_8095274 +sub_8095274: + push {lr} + ldr r1, _08095294 + ldr r3, [r1] + adds r2, r3, 0 + ldm r2!, {r1} + lsls r1, 2 + adds r2, r1 + str r0, [r2] + ldr r0, [r3] + movs r1, 0 + cmp r0, 0x1E + bgt _0809528E + adds r1, r0, 0x1 +_0809528E: + str r1, [r3] + pop {r0} + bx r0 + .align 2, 0 +_08095294: .4byte gUnknown_203B48C + thumb_func_end sub_8095274 + + thumb_func_start sub_8095298 +sub_8095298: + push {lr} + adds r3, r0, 0 + movs r2, 0 + ldr r0, _080952B0 + ldr r0, [r0] + adds r1, r0, 0x4 +_080952A4: + ldr r0, [r1] + cmp r0, r3 + bne _080952B4 + movs r0, 0x1 + b _080952BE + .align 2, 0 +_080952B0: .4byte gUnknown_203B48C +_080952B4: + adds r1, 0x4 + adds r2, 0x1 + cmp r2, 0x1F + ble _080952A4 + movs r0, 0 +_080952BE: + pop {r1} + bx r1 + thumb_func_end sub_8095298 + + thumb_func_start sub_80952C4 +sub_80952C4: + push {r4,lr} + ldr r2, _080952EC + ldr r1, [r2] + movs r0, 0 + str r0, [r1] + movs r3, 0 + adds r4, r2, 0 + movs r2, 0x1 + negs r2, r2 +_080952D6: + ldr r0, [r4] + lsls r1, r3, 2 + adds r0, 0x4 + adds r0, r1 + str r2, [r0] + adds r3, 0x1 + cmp r3, 0x1F + ble _080952D6 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080952EC: .4byte gUnknown_203B48C + thumb_func_end sub_80952C4 + + thumb_func_start sub_80952F0 +sub_80952F0: + push {r4,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r1, r0, 24 + movs r3, 0 + ldr r0, _08095310 + ldr r2, [r0] +_080952FE: + ldrb r0, [r2] + cmp r0, r1 + bne _08095314 + ldr r0, [r2, 0x10] + cmp r0, r4 + bne _08095314 + movs r0, 0x1 + b _0809531E + .align 2, 0 +_08095310: .4byte gUnknown_203B480 +_08095314: + adds r2, 0x30 + adds r3, 0x1 + cmp r3, 0x1F + ble _080952FE + movs r0, 0 +_0809531E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80952F0 + + thumb_func_start sub_8095324 +sub_8095324: + push {r4,lr} + lsls r0, 24 + lsrs r4, r0, 24 + movs r3, 0 + ldr r0, _0809534C + ldr r1, [r0] + movs r2, 0x1F +_08095332: + ldrb r0, [r1] + cmp r0, r4 + bne _0809533A + adds r3, 0x1 +_0809533A: + adds r1, 0x30 + subs r2, 0x1 + cmp r2, 0 + bge _08095332 + adds r0, r3, 0 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0809534C: .4byte gUnknown_203B480 + thumb_func_end sub_8095324 + + thumb_func_start sub_8095350 +sub_8095350: + push {lr} + movs r3, 0 + ldr r0, _08095370 + ldr r1, [r0] + movs r2, 0x1F +_0809535A: + ldrb r0, [r1] + cmp r0, 0 + beq _08095362 + adds r3, 0x1 +_08095362: + adds r1, 0x30 + subs r2, 0x1 + cmp r2, 0 + bge _0809535A + adds r0, r3, 0 + pop {r1} + bx r1 + .align 2, 0 +_08095370: .4byte gUnknown_203B480 + thumb_func_end sub_8095350 + + thumb_func_start sub_8095374 +sub_8095374: + push {lr} + movs r3, 0x1 + negs r3, r3 + movs r2, 0 + ldr r0, _08095398 + ldr r1, [r0] +_08095380: + ldrb r0, [r1] + cmp r0, 0x1 + bne _08095388 + adds r3, r2, 0 +_08095388: + adds r1, 0x30 + adds r2, 0x1 + cmp r2, 0x1F + ble _08095380 + adds r0, r3, 0 + pop {r1} + bx r1 + .align 2, 0 +_08095398: .4byte gUnknown_203B480 + thumb_func_end sub_8095374 + + thumb_func_start sub_809539C +sub_809539C: + push {r4,lr} + adds r4, r1, 0 + lsls r0, 24 + lsrs r1, r0, 24 + movs r3, 0 + ldr r0, _080953BC + ldr r2, [r0] +_080953AA: + ldrb r0, [r2] + cmp r0, r1 + bne _080953C0 + ldr r0, [r2, 0x10] + cmp r0, r4 + bne _080953C0 + adds r0, r3, 0 + b _080953CC + .align 2, 0 +_080953BC: .4byte gUnknown_203B480 +_080953C0: + adds r2, 0x30 + adds r3, 0x1 + cmp r3, 0x1F + ble _080953AA + movs r0, 0x1 + negs r0, r0 +_080953CC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809539C + + thumb_func_start sub_80953D4 +sub_80953D4: + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + movs r2, 0 + ldr r0, _080953EC + ldr r1, [r0] +_080953E0: + ldrb r0, [r1] + cmp r0, r3 + bne _080953F0 + adds r0, r2, 0 + b _080953FC + .align 2, 0 +_080953EC: .4byte gUnknown_203B480 +_080953F0: + adds r1, 0x30 + adds r2, 0x1 + cmp r2, 0x1F + ble _080953E0 + movs r0, 0x1 + negs r0, r0 +_080953FC: + pop {r1} + bx r1 + thumb_func_end sub_80953D4 + + thumb_func_start sub_8095400 +sub_8095400: + push {lr} + adds r3, r0, 0 + movs r2, 0 + ldr r0, _08095418 + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0x10 +_0809540E: + ldr r0, [r1] + cmp r0, r3 + bne _0809541C + adds r0, r2, 0 + b _08095428 + .align 2, 0 +_08095418: .4byte gUnknown_203B480 +_0809541C: + adds r1, 0x30 + adds r2, 0x1 + cmp r2, 0x1F + ble _0809540E + movs r0, 0x1 + negs r0, r0 +_08095428: + pop {r1} + bx r1 + thumb_func_end sub_8095400 + + thumb_func_start sub_809542C +sub_809542C: + push {r4,lr} + sub sp, 0x14 + ldr r4, _08095490 + ldr r2, [r4] + movs r1, 0x1 + strb r1, [r2] + ldr r2, [r4] + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r2, 0x4] + str r1, [r2, 0x8] + bl Random + bl sub_8094D28 + bl sub_8094E4C + ldr r1, [r4] + str r0, [r1, 0x10] + bl sub_808D33C + ldr r1, [r4] + ldrh r0, [r0, 0x8] + strh r0, [r1, 0xC] + bl sub_808D33C + adds r1, r0, 0 + mov r0, sp + bl sub_808DA34 + ldr r0, [r4] + adds r0, 0x14 + mov r1, sp + bl sub_80922F4 + bl sub_8011C34 + ldr r1, [r4] + str r0, [r1, 0x24] + ldrb r0, [r1, 0x4] + bl sub_8090134 + ldr r1, [r4] + adds r1, 0x2C + strb r0, [r1] + add sp, 0x14 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08095490: .4byte gUnknown_203B480 + thumb_func_end sub_809542C + + thumb_func_start sub_8095494 +sub_8095494: + lsls r1, 24 + lsrs r1, 24 + ldr r2, _080954B0 + ldr r3, [r2] + lsls r2, r1, 1 + adds r2, r1 + lsls r2, 4 + adds r3, r2 + ldr r1, [r3, 0x4] + ldr r2, [r3, 0x8] + str r1, [r0] + str r2, [r0, 0x4] + bx lr + .align 2, 0 +_080954B0: .4byte gUnknown_203B480 + thumb_func_end sub_8095494 + + thumb_func_start sub_80954B4 +sub_80954B4: + push {lr} + movs r0, 0x3 + bl sub_8095324 + cmp r0, 0 + bne _080954C4 + movs r0, 0 + b _080954C6 +_080954C4: + movs r0, 0x1 +_080954C6: + pop {r1} + bx r1 + thumb_func_end sub_80954B4 + + thumb_func_start sub_80954CC +sub_80954CC: + push {r4-r6,lr} + sub sp, 0x10 + adds r3, r0, 0 + adds r2, r1, 0 + mov r0, sp + adds r1, r3, 0 + bl sub_809485C + ldr r6, _08095618 + movs r5, 0 + movs r4, 0x1F +_080954E2: + ldr r1, [r6] + adds r1, r5 + mov r0, sp + bl sub_8095774 + adds r5, 0x30 + subs r4, 0x1 + cmp r4, 0 + bge _080954E2 + ldr r4, _0809561C + ldr r1, [r4] + mov r0, sp + movs r2, 0x20 + bl sub_8094924 + ldr r5, [r4] + adds r4, r5, 0x4 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x58 + bl memset + mov r0, sp + adds r1, r4, 0 + movs r2, 0x2 + bl sub_8094924 + adds r1, r5, 0x6 + mov r0, sp + movs r2, 0x1 + bl sub_8094924 + adds r1, r5, 0x7 + mov r0, sp + movs r2, 0x7 + bl sub_8094924 + adds r4, 0x4 + mov r0, sp + adds r1, r4, 0 + bl sub_8090314 + adds r1, r5, 0 + adds r1, 0xC + mov r0, sp + movs r2, 0x9 + bl sub_8094924 + adds r1, r5, 0 + adds r1, 0x10 + mov r0, sp + bl sub_808F410 + adds r1, r5, 0 + adds r1, 0x14 + mov r0, sp + bl sub_808F410 + adds r1, r5, 0 + adds r1, 0x18 + mov r0, sp + movs r2, 0xA + bl sub_8094924 + adds r1, r5, 0 + adds r1, 0x1A + mov r0, sp + movs r2, 0xA + bl sub_8094924 + adds r1, r5, 0 + adds r1, 0x1C + mov r0, sp + movs r2, 0x8 + bl sub_8094924 + adds r1, r5, 0 + adds r1, 0x1D + mov r0, sp + movs r2, 0x8 + bl sub_8094924 + adds r1, r5, 0 + adds r1, 0x1E + mov r0, sp + movs r2, 0x8 + bl sub_8094924 + adds r1, r5, 0 + adds r1, 0x1F + mov r0, sp + movs r2, 0x8 + bl sub_8094924 + adds r1, r5, 0 + adds r1, 0x20 + mov r0, sp + movs r2, 0x18 + bl sub_8094924 + adds r1, r5, 0 + adds r1, 0x24 + mov r0, sp + movs r2, 0x18 + bl sub_8094924 + adds r1, r5, 0 + adds r1, 0x28 + mov r0, sp + movs r2, 0x4 + bl sub_8094924 + adds r1, r5, 0 + adds r1, 0x2C + mov r0, sp + bl sub_8091DC0 + adds r1, r5, 0 + adds r1, 0x30 + mov r0, sp + bl sub_8094128 + adds r1, r5, 0 + adds r1, 0x50 + mov r0, sp + movs r2, 0x50 + bl sub_8094924 + ldr r4, _08095620 + ldr r1, [r4] + mov r0, sp + movs r2, 0x20 + bl sub_8094924 + adds r6, r4, 0 + movs r5, 0x4 + movs r4, 0x1F +_080955F4: + ldr r1, [r6] + adds r1, r5 + mov r0, sp + movs r2, 0x20 + bl sub_8094924 + adds r5, 0x4 + subs r4, 0x1 + cmp r4, 0 + bge _080955F4 + mov r0, sp + bl nullsub_102 + ldr r0, [sp, 0x8] + add sp, 0x10 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08095618: .4byte gUnknown_203B480 +_0809561C: .4byte gUnknown_203B484 +_08095620: .4byte gUnknown_203B48C + thumb_func_end sub_80954CC + + thumb_func_start sub_8095624 +sub_8095624: + push {r4-r6,lr} + sub sp, 0x10 + adds r3, r0, 0 + adds r2, r1, 0 + mov r0, sp + adds r1, r3, 0 + bl sub_809486C + ldr r6, _08095768 + movs r5, 0 + movs r4, 0x1F +_0809563A: + ldr r1, [r6] + adds r1, r5 + mov r0, sp + bl sub_8095824 + adds r5, 0x30 + subs r4, 0x1 + cmp r4, 0 + bge _0809563A + ldr r4, _0809576C + ldr r1, [r4] + mov r0, sp + movs r2, 0x20 + bl sub_809488C + ldr r5, [r4] + adds r4, r5, 0x4 + mov r0, sp + adds r1, r4, 0 + movs r2, 0x2 + bl sub_809488C + adds r1, r5, 0x6 + mov r0, sp + movs r2, 0x1 + bl sub_809488C + adds r1, r5, 0x7 + mov r0, sp + movs r2, 0x7 + bl sub_809488C + adds r4, 0x4 + mov r0, sp + adds r1, r4, 0 + bl sub_80902F4 + adds r1, r5, 0 + adds r1, 0xC + mov r0, sp + movs r2, 0x9 + bl sub_809488C + adds r1, r5, 0 + adds r1, 0x10 + mov r0, sp + bl sub_808F41C + adds r1, r5, 0 + adds r1, 0x14 + mov r0, sp + bl sub_808F41C + adds r1, r5, 0 + adds r1, 0x18 + mov r0, sp + movs r2, 0xA + bl sub_809488C + adds r1, r5, 0 + adds r1, 0x1A + mov r0, sp + movs r2, 0xA + bl sub_809488C + adds r1, r5, 0 + adds r1, 0x1C + mov r0, sp + movs r2, 0x8 + bl sub_809488C + adds r1, r5, 0 + adds r1, 0x1D + mov r0, sp + movs r2, 0x8 + bl sub_809488C + adds r1, r5, 0 + adds r1, 0x1E + mov r0, sp + movs r2, 0x8 + bl sub_809488C + adds r1, r5, 0 + adds r1, 0x1F + mov r0, sp + movs r2, 0x8 + bl sub_809488C + adds r1, r5, 0 + adds r1, 0x20 + mov r0, sp + movs r2, 0x18 + bl sub_809488C + adds r1, r5, 0 + adds r1, 0x24 + mov r0, sp + movs r2, 0x18 + bl sub_809488C + adds r1, r5, 0 + adds r1, 0x28 + mov r0, sp + movs r2, 0x4 + bl sub_809488C + adds r1, r5, 0 + adds r1, 0x2C + mov r0, sp + bl sub_8091DE0 + adds r1, r5, 0 + adds r1, 0x30 + mov r0, sp + bl sub_8094108 + adds r1, r5, 0 + adds r1, 0x50 + mov r0, sp + movs r2, 0x50 + bl sub_809488C + ldr r4, _08095770 + ldr r1, [r4] + mov r0, sp + movs r2, 0x20 + bl sub_809488C + adds r6, r4, 0 + movs r5, 0x4 + movs r4, 0x1F +_08095742: + ldr r1, [r6] + adds r1, r5 + mov r0, sp + movs r2, 0x20 + bl sub_809488C + adds r5, 0x4 + subs r4, 0x1 + cmp r4, 0 + bge _08095742 + mov r0, sp + bl nullsub_102 + ldr r0, [sp, 0x8] + add sp, 0x10 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_08095768: .4byte gUnknown_203B480 +_0809576C: .4byte gUnknown_203B484 +_08095770: .4byte gUnknown_203B48C + thumb_func_end sub_8095624 + + thumb_func_start sub_8095774 +sub_8095774: + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x4 + bl sub_8094924 + adds r1, r5, 0x4 + adds r0, r4, 0 + bl sub_8090314 + adds r1, r5, 0 + adds r1, 0x8 + adds r0, r4, 0 + movs r2, 0x18 + bl sub_8094924 + adds r1, r5, 0 + adds r1, 0xC + adds r0, r4, 0 + movs r2, 0x9 + bl sub_8094924 + adds r1, r5, 0 + adds r1, 0x10 + adds r0, r4, 0 + movs r2, 0x20 + bl sub_8094924 + adds r1, r5, 0 + adds r1, 0x14 + adds r0, r4, 0 + movs r2, 0x50 + bl sub_8094924 + adds r1, r5, 0 + adds r1, 0x20 + adds r0, r4, 0 + movs r2, 0x8 + bl sub_8094924 + adds r1, r5, 0 + adds r1, 0x21 + adds r0, r4, 0 + movs r2, 0x8 + bl sub_8094924 + adds r1, r5, 0 + adds r1, 0x22 + adds r0, r4, 0 + movs r2, 0x8 + bl sub_8094924 + adds r1, r5, 0 + adds r1, 0x24 + adds r0, r4, 0 + movs r2, 0x20 + bl sub_8094924 + adds r1, r5, 0 + adds r1, 0x28 + adds r0, r4, 0 + movs r2, 0x20 + bl sub_8094924 + adds r1, r5, 0 + adds r1, 0x2C + adds r0, r4, 0 + movs r2, 0x8 + bl sub_8094924 + adds r0, r4, 0 + mov r1, sp + movs r2, 0x1 + bl sub_8094924 + mov r0, sp + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + adds r1, r5, 0 + adds r1, 0x2D + strb r0, [r1] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8095774 + + thumb_func_start sub_8095824 +sub_8095824: + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + adds r4, r1, 0 + movs r1, 0xFF + mov r0, sp + strb r1, [r0] + mov r6, sp + adds r6, 0x1 + movs r0, 0 + strb r0, [r6] + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x4 + bl sub_809488C + adds r1, r4, 0x4 + adds r0, r5, 0 + bl sub_80902F4 + adds r1, r4, 0 + adds r1, 0x8 + adds r0, r5, 0 + movs r2, 0x18 + bl sub_809488C + adds r1, r4, 0 + adds r1, 0xC + adds r0, r5, 0 + movs r2, 0x9 + bl sub_809488C + adds r1, r4, 0 + adds r1, 0x10 + adds r0, r5, 0 + movs r2, 0x20 + bl sub_809488C + adds r1, r4, 0 + adds r1, 0x14 + adds r0, r5, 0 + movs r2, 0x50 + bl sub_809488C + adds r1, r4, 0 + adds r1, 0x20 + adds r0, r5, 0 + movs r2, 0x8 + bl sub_809488C + adds r1, r4, 0 + adds r1, 0x21 + adds r0, r5, 0 + movs r2, 0x8 + bl sub_809488C + adds r1, r4, 0 + adds r1, 0x22 + adds r0, r5, 0 + movs r2, 0x8 + bl sub_809488C + adds r1, r4, 0 + adds r1, 0x24 + adds r0, r5, 0 + movs r2, 0x20 + bl sub_809488C + adds r1, r4, 0 + adds r1, 0x28 + adds r0, r5, 0 + movs r2, 0x20 + bl sub_809488C + adds r1, r4, 0 + adds r1, 0x2C + adds r0, r5, 0 + movs r2, 0x8 + bl sub_809488C + adds r0, r4, 0 + adds r0, 0x2D + ldrb r0, [r0] + mov r1, sp + cmp r0, 0 + bne _080958D2 + adds r1, r6, 0 +_080958D2: + adds r0, r5, 0 + movs r2, 0x1 + bl sub_809488C + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8095824 + + thumb_func_start sub_80958E4 +sub_80958E4: + str r1, [r0] + bx lr + thumb_func_end sub_80958E4 + + thumb_func_start sub_80958E8 +sub_80958E8: + ldr r1, _080958F0 + ldr r0, _080958F4 + str r0, [r1] + bx lr + .align 2, 0 +_080958F0: .4byte gUnknown_203B490 +_080958F4: .4byte gUnknown_2039448 + thumb_func_end sub_80958E8 + + thumb_func_start sub_80958F8 +sub_80958F8: + ldr r0, _080958FC + bx lr + .align 2, 0 +_080958FC: .4byte gUnknown_2039448 + thumb_func_end sub_80958F8 + + thumb_func_start sub_8095900 +sub_8095900: + push {r4-r7,lr} + movs r4, 0 +_08095904: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8096040 + adds r4, 0x1 + cmp r4, 0x3 + ble _08095904 + movs r4, 0 +_08095914: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_80965B8 + adds r4, 0x1 + cmp r4, 0x7 + ble _08095914 + movs r4, 0 +_08095924: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8096C3C + adds r4, 0x1 + cmp r4, 0x7 + ble _08095924 + movs r4, 0 + ldr r3, _080959B8 + movs r2, 0xBC + lsls r2, 2 + movs r1, 0 +_0809593C: + ldr r0, [r3] + adds r0, r2 + adds r0, r4 + strb r1, [r0] + adds r4, 0x1 + cmp r4, 0x37 + ble _0809593C + ldr r4, _080959B8 + ldr r0, [r4] + movs r1, 0xCA + lsls r1, 2 + adds r0, r1 + movs r1, 0 + strb r1, [r0] + ldr r0, [r4] + movs r7, 0xC8 + lsls r7, 1 + adds r0, r7 + movs r1, 0x28 + bl MemoryClear8 + ldr r0, [r4] + movs r1, 0xDC + lsls r1, 1 + adds r0, r1 + movs r1, 0x78 + bl MemoryClear8 + adds r3, r4, 0 + movs r5, 0 + movs r2, 0 + movs r6, 0x8C + lsls r6, 2 + movs r4, 0xF +_08095980: + ldr r0, [r3] + adds r0, r2 + adds r0, r6 + movs r1, 0x63 + strb r1, [r0] + ldr r0, [r3] + adds r0, r2 + ldr r7, _080959BC + adds r0, r7 + movs r1, 0x1 + strb r1, [r0] + ldr r1, [r3] + adds r7, 0x3 + adds r0, r1, r7 + adds r0, r2 + str r5, [r0] + adds r7, 0x4 + adds r0, r1, r7 + adds r0, r2 + str r5, [r0] + adds r2, 0xC + subs r4, 0x1 + cmp r4, 0 + bge _08095980 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080959B8: .4byte gUnknown_203B490 +_080959BC: .4byte 0x00000231 + thumb_func_end sub_8095900 + + thumb_func_start sub_80959C0 +sub_80959C0: + push {lr} + adds r1, r0, 0 + ldrb r0, [r1] + cmp r0, 0x5 + bne _080959D6 + adds r0, r1, 0 + bl sub_80959DC + lsls r0, 24 + lsrs r0, 24 + b _080959D8 +_080959D6: + movs r0, 0 +_080959D8: + pop {r1} + bx r1 + thumb_func_end sub_80959C0 + + thumb_func_start sub_80959DC +sub_80959DC: + push {r4-r6,lr} + adds r5, r0, 0 + ldrb r0, [r5, 0x1] + cmp r0, 0x4 + bls _080959E8 + b _08095B16 +_080959E8: + cmp r0, 0x4 + bne _080959F8 + ldrb r0, [r5, 0x4] + bl sub_8090114 + cmp r0, 0 + bne _080959F8 + b _08095B16 +_080959F8: + ldrb r0, [r5, 0x2] + cmp r0, 0x9 + bls _08095A00 + b _08095B16 +_08095A00: + ldrb r0, [r5, 0x4] + bl sub_809095C + lsls r0, 24 + cmp r0, 0 + beq _08095A0E + b _08095B16 +_08095A0E: + ldrb r4, [r5, 0x5] + ldrb r0, [r5, 0x4] + bl sub_8090298 + cmp r4, r0 + bge _08095B16 + adds r4, r5, 0x4 + adds r0, r4, 0 + bl sub_809017C + lsls r0, 24 + adds r6, r4, 0 + cmp r0, 0 + bne _08095B16 + movs r1, 0xC + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _08095B16 + ldr r4, _08095B1C + cmp r0, r4 + bgt _08095B16 + movs r2, 0xC + ldrsh r0, [r5, r2] + bl sub_808E770 + movs r2, 0xC + ldrsh r1, [r5, r2] + lsls r0, 16 + asrs r0, 16 + cmp r1, r0 + bne _08095B16 + movs r1, 0xC + ldrsh r0, [r5, r1] + bl sub_803C0DC + lsls r0, 24 + cmp r0, 0 + beq _08095B16 + movs r2, 0xE + ldrsh r0, [r5, r2] + cmp r0, r4 + bgt _08095B16 + movs r1, 0xE + ldrsh r0, [r5, r1] + bl sub_808E770 + movs r2, 0xE + ldrsh r1, [r5, r2] + lsls r0, 16 + asrs r0, 16 + cmp r1, r0 + bne _08095B16 + movs r1, 0xE + ldrsh r0, [r5, r1] + bl sub_803C0DC + lsls r0, 24 + cmp r0, 0 + beq _08095B16 + ldrb r0, [r5, 0x1] + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _08095A9C + movs r2, 0xE + ldrsh r1, [r5, r2] + movs r2, 0xC + ldrsh r0, [r5, r2] + cmp r1, r0 + bne _08095B16 +_08095A9C: + ldrb r0, [r5, 0x10] + bl sub_8092040 + lsls r0, 24 + cmp r0, 0 + bne _08095B16 + ldrb r0, [r5, 0x10] + bl sub_8090A60 + lsls r0, 24 + cmp r0, 0 + bne _08095B16 + ldrb r0, [r5, 0x10] + bl sub_8091524 + lsls r0, 24 + cmp r0, 0 + beq _08095B16 + ldrb r0, [r5, 0x1] + cmp r0, 0x3 + bne _08095AD4 + ldrb r0, [r5, 0x4] + ldrb r1, [r5, 0x10] + bl sub_8091E60 + lsls r0, 24 + cmp r0, 0 + beq _08095B16 +_08095AD4: + ldrb r0, [r5, 0x11] + cmp r0, 0x4 + beq _08095B16 + cmp r0, 0xA + beq _08095B16 + cmp r0, 0xA + bhi _08095B16 + ldrb r0, [r5, 0x12] + bl sub_8092040 + lsls r0, 24 + cmp r0, 0 + bne _08095B16 + ldrb r0, [r5, 0x13] + cmp r0, 0x39 + bhi _08095B16 + ldrb r0, [r5, 0x11] + cmp r0, 0x9 + bne _08095B20 + ldrb r0, [r5, 0x13] + bl sub_8092534 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08095B16 + ldrb r1, [r5, 0x1] + adds r0, r6, 0 + bl sub_803C1D0 + lsls r0, 24 + cmp r0, 0 + bne _08095B20 +_08095B16: + movs r0, 0 + b _08095B22 + .align 2, 0 +_08095B1C: .4byte 0x000001a7 +_08095B20: + movs r0, 0x1 +_08095B22: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80959DC + + thumb_func_start sub_8095B28 +sub_8095B28: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r4, _08095B44 + add sp, r4 + adds r4, r0, 0 + bl sub_8095CE0 + lsls r0, 24 + cmp r0, 0 + bne _08095B48 + movs r0, 0 + b _08095CCC + .align 2, 0 +_08095B44: .4byte 0xfffffcb0 +_08095B48: + movs r0, 0x5 + strb r0, [r4] + movs r0, 0x8 + bl RandomCapped + ldr r1, _08095BC8 + adds r0, r1 + ldrb r0, [r0] + strb r0, [r4, 0x1] + cmp r0, 0x2 + bne _08095B6C + bl sub_8092178 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08095B6C + strb r0, [r4, 0x1] +_08095B6C: + movs r0, 0 + strb r0, [r4, 0x2] + bl Random + ldr r1, _08095BCC + ands r1, r0 + str r1, [r4, 0x8] + movs r7, 0 + movs r5, 0x1 + adds r0, r4, 0x4 + mov r8, r0 + movs r1, 0x12 + adds r1, r4 + mov r9, r1 + mov r6, sp +_08095B8A: + lsls r0, r5, 16 + asrs r0, 16 + bl sub_803C110 + lsls r0, 24 + cmp r0, 0 + beq _08095B9E + strh r5, [r6] + adds r6, 0x2 + adds r7, 0x1 +_08095B9E: + adds r5, 0x1 + ldr r0, _08095BD0 + cmp r5, r0 + ble _08095B8A + cmp r7, 0 + beq _08095BD4 + adds r0, r7, 0 + bl RandomCapped + lsls r0, 1 + add r0, sp + ldrh r0, [r0] + strh r0, [r4, 0xC] + adds r0, r7, 0 + bl RandomCapped + lsls r0, 1 + add r0, sp + ldrh r0, [r0] + b _08095BDC + .align 2, 0 +_08095BC8: .4byte gUnknown_8109984 +_08095BCC: .4byte 0x00ffffff +_08095BD0: .4byte 0x000001a7 +_08095BD4: + movs r0, 0x10 + strh r0, [r4, 0xC] + movs r0, 0x91 + lsls r0, 1 +_08095BDC: + strh r0, [r4, 0xE] + ldrb r0, [r4, 0x1] + subs r0, 0x1 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bls _08095BEE + ldrh r0, [r4, 0xC] + strh r0, [r4, 0xE] +_08095BEE: + ldrb r0, [r4, 0x4] + bl sub_8095F28 + strb r0, [r4, 0x10] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _08095C10 + strb r0, [r4, 0x1] + ldrh r0, [r4, 0xC] + strh r0, [r4, 0xE] + adds r2, r4, 0 + adds r2, 0x10 + mov r0, r8 + movs r1, 0 + bl sub_803C37C +_08095C10: + ldrb r0, [r4, 0x4] + bl sub_8090114 + adds r1, r0, 0 + cmp r1, 0 + bne _08095C28 + ldrb r0, [r4, 0x1] + cmp r0, 0x4 + bne _08095C28 + strb r1, [r4, 0x1] + ldrh r0, [r4, 0xC] + strh r0, [r4, 0xE] +_08095C28: + ldrb r1, [r4, 0x1] + mov r0, r8 + mov r2, r9 + bl sub_803C37C + ldrb r0, [r4, 0x10] + ldrb r1, [r4, 0x12] + cmp r0, r1 + beq _08095C28 + movs r0, 0 + strb r0, [r4, 0x13] + ldrb r0, [r4, 0x1] + cmp r0, 0x2 + beq _08095C90 + cmp r0, 0x2 + bgt _08095C4E + cmp r0, 0x1 + beq _08095C6C + b _08095CCA +_08095C4E: + cmp r0, 0x4 + bgt _08095CCA + bl Random + adds r1, r0, 0 + movs r0, 0xE0 + lsls r0, 3 + ands r1, r0 + movs r0, 0xC0 + lsls r0, 2 + cmp r1, r0 + beq _08095CC4 + cmp r1, r0 + bgt _08095CB4 + b _08095CAA +_08095C6C: + bl Random + adds r1, r0, 0 + movs r0, 0x70 + ands r1, r0 + cmp r1, 0x10 + beq _08095C80 + cmp r1, 0x30 + beq _08095C88 + b _08095CCA +_08095C80: + adds r0, r4, 0 + bl sub_803C3E0 + b _08095CCA +_08095C88: + adds r0, r4, 0 + bl sub_803C45C + b _08095CCA +_08095C90: + bl Random + movs r1, 0xC0 + lsls r1, 6 + ands r1, r0 + movs r0, 0x80 + lsls r0, 5 + cmp r1, r0 + bne _08095CCA + adds r0, r4, 0 + bl sub_803C4F0 + b _08095CCA +_08095CAA: + movs r0, 0x80 + lsls r0, 1 + cmp r1, r0 + beq _08095CBC + b _08095CCA +_08095CB4: + movs r0, 0xC0 + lsls r0, 3 + cmp r1, r0 + bne _08095CCA +_08095CBC: + adds r0, r4, 0 + bl sub_803C580 + b _08095CCA +_08095CC4: + adds r0, r4, 0 + bl sub_803C610 +_08095CCA: + movs r0, 0x1 +_08095CCC: + movs r3, 0xD4 + lsls r3, 2 + add sp, r3 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8095B28 + + thumb_func_start sub_8095CE0 +sub_8095CE0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x60 + str r0, [sp, 0x44] + mov r0, sp + bl sub_80A29B0 + str r0, [sp, 0x4C] + cmp r0, 0 + bne _08095D0C + mov r0, sp + add r1, sp, 0x4C + ldrb r1, [r1] + strb r1, [r0] + mov r1, sp + movs r0, 0x1 + strb r0, [r1, 0x1] + movs r2, 0x2 + str r2, [sp, 0x4C] +_08095D0C: + ldr r0, [sp, 0x4C] + bl RandomCapped + mov r9, r0 + str r0, [sp, 0x48] + mov r1, sp + adds r1, 0x40 + str r1, [sp, 0x5C] +_08095D1C: + mov r0, sp + add r0, r9 + ldrb r7, [r0] + adds r0, r7, 0 + bl sub_8090298 + str r0, [sp, 0x58] + lsrs r0, 31 + ldr r2, [sp, 0x58] + adds r0, r2, r0 + asrs r0, 1 + str r0, [sp, 0x54] + adds r1, r2, 0 + bl RandomRange + adds r4, r0, 0 + str r4, [sp, 0x50] +_08095D3E: + movs r0, 0x1 + mov r8, r0 + ldr r1, _08095DF4 + ldr r0, [sp, 0x40] + ands r0, r1 + orrs r0, r7 + lsls r2, r4, 24 + lsrs r2, 16 + ldr r1, _08095DF8 + ands r0, r1 + orrs r0, r2 + str r0, [sp, 0x40] + ldr r0, [sp, 0x5C] + bl sub_809017C + lsls r0, 24 + cmp r0, 0 + beq _08095D66 + movs r1, 0 + mov r8, r1 +_08095D66: + ldr r2, _08095DFC + mov r10, r2 + movs r6, 0 + movs r5, 0x3 +_08095D6E: + mov r1, r10 + ldr r0, [r1] + adds r0, r6 + adds r1, r7, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8095E38 + lsls r0, 24 + cmp r0, 0 + beq _08095D88 + movs r2, 0 + mov r8, r2 +_08095D88: + adds r6, 0x14 + subs r5, 0x1 + cmp r5, 0 + bge _08095D6E + ldr r0, _08095DFC + mov r10, r0 + movs r6, 0x50 + movs r5, 0x7 +_08095D98: + mov r1, r10 + ldr r0, [r1] + adds r0, r6 + adds r1, r7, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8095E38 + lsls r0, 24 + cmp r0, 0 + beq _08095DB2 + movs r2, 0 + mov r8, r2 +_08095DB2: + adds r6, 0x14 + subs r5, 0x1 + cmp r5, 0 + bge _08095D98 + ldr r0, _08095DFC + mov r10, r0 + movs r6, 0xF0 + movs r5, 0x7 +_08095DC2: + mov r1, r10 + ldr r0, [r1] + adds r0, r6 + adds r1, r7, 0 + adds r2, r4, 0 + movs r3, 0x1 + bl sub_8095E38 + lsls r0, 24 + cmp r0, 0 + beq _08095DDC + movs r2, 0 + mov r8, r2 +_08095DDC: + adds r6, 0x14 + subs r5, 0x1 + cmp r5, 0 + bge _08095DC2 + mov r0, r8 + cmp r0, 0 + beq _08095E00 + ldr r1, [sp, 0x44] + strb r7, [r1, 0x4] + strb r4, [r1, 0x5] + movs r0, 0x1 + b _08095E28 + .align 2, 0 +_08095DF4: .4byte 0xffffff00 +_08095DF8: .4byte 0xffff00ff +_08095DFC: .4byte gUnknown_203B490 +_08095E00: + adds r4, 0x1 + ldr r2, [sp, 0x58] + cmp r4, r2 + blt _08095E0A + ldr r4, [sp, 0x54] +_08095E0A: + ldr r0, [sp, 0x50] + cmp r4, r0 + bne _08095D3E + movs r1, 0x1 + add r9, r1 + ldr r2, [sp, 0x4C] + cmp r9, r2 + bne _08095E1E + movs r0, 0 + mov r9, r0 +_08095E1E: + ldr r1, [sp, 0x48] + cmp r9, r1 + beq _08095E26 + b _08095D1C +_08095E26: + movs r0, 0 +_08095E28: + add sp, 0x60 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8095CE0 + + thumb_func_start sub_8095E38 +sub_8095E38: + push {r4,lr} + adds r4, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r3, 24 + lsrs r3, 24 + ldrb r0, [r4] + cmp r0, 0 + beq _08095E6E + ldrb r0, [r4, 0x1] + cmp r0, 0x2 + bne _08095E5E + cmp r3, 0x1 + bne _08095E5E + ldrb r0, [r4, 0x4] + cmp r0, r1 + bne _08095E6E + movs r0, 0x1 + b _08095E70 +_08095E5E: + ldrb r0, [r4, 0x4] + cmp r0, r1 + bne _08095E6E + ldrb r0, [r4, 0x5] + cmp r0, r2 + bne _08095E6E + movs r0, 0x1 + b _08095E70 +_08095E6E: + movs r0, 0 +_08095E70: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8095E38 + + thumb_func_start sub_8095E78 +sub_8095E78: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x3C + movs r6, 0 + movs r5, 0x1 +_08095E84: + ldr r0, _08095F04 + ldr r0, [r0] + adds r0, r5 + ldrb r0, [r0] + adds r1, r5, 0x1 + mov r8, r1 + cmp r0, 0 + bne _08095EF6 + lsls r0, r5, 24 + lsrs r0, 24 + bl sub_8092534 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + bne _08095EF6 + movs r4, 0 + ldr r0, _08095F08 + ldr r1, [r0] + movs r3, 0x3 +_08095EAC: + ldrb r0, [r1] + cmp r0, 0 + beq _08095EBA + ldrb r0, [r1, 0x11] + cmp r0, 0x9 + bne _08095EBA + movs r4, 0x1 +_08095EBA: + adds r1, 0x14 + subs r3, 0x1 + cmp r3, 0 + bge _08095EAC + ldr r0, _08095F08 + ldr r0, [r0] + adds r2, r0, 0 + adds r2, 0xF0 + adds r1, r0, 0 + movs r3, 0x7 +_08095ECE: + ldrb r0, [r2] + cmp r0, 0 + beq _08095EE0 + ldr r7, _08095F0C + adds r0, r1, r7 + ldrb r0, [r0] + cmp r0, 0x9 + bne _08095EE0 + movs r4, 0x1 +_08095EE0: + adds r2, 0x14 + adds r1, 0x14 + subs r3, 0x1 + cmp r3, 0 + bge _08095ECE + cmp r4, 0 + bne _08095EF6 + mov r1, sp + adds r0, r1, r6 + strb r5, [r0] + adds r6, 0x1 +_08095EF6: + mov r5, r8 + cmp r5, 0x39 + ble _08095E84 + cmp r6, 0 + bne _08095F10 + movs r0, 0 + b _08095F1A + .align 2, 0 +_08095F04: .4byte gUnknown_203B468 +_08095F08: .4byte gUnknown_203B490 +_08095F0C: .4byte 0x00000101 +_08095F10: + adds r0, r6, 0 + bl RandomCapped + add r0, sp + ldrb r0, [r0] +_08095F1A: + add sp, 0x3C + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8095E78 + + thumb_func_start sub_8095F28 +sub_8095F28: + push {r4-r7,lr} + sub sp, 0xF0 + lsls r0, 24 + lsrs r7, r0, 24 + movs r6, 0 + movs r5, 0x1 +_08095F34: + lsls r4, r5, 24 + cmp r7, 0x63 + beq _08095F48 + lsrs r1, r4, 24 + adds r0, r7, 0 + bl sub_8091E60 + lsls r0, 24 + cmp r0, 0 + beq _08095F6A +_08095F48: + lsrs r4, 24 + adds r0, r4, 0 + bl sub_8090A60 + lsls r0, 24 + cmp r0, 0 + bne _08095F6A + adds r0, r4, 0 + bl sub_8091524 + lsls r0, 24 + cmp r0, 0 + beq _08095F6A + mov r1, sp + adds r0, r1, r6 + strb r5, [r0] + adds r6, 0x1 +_08095F6A: + adds r5, 0x1 + cmp r5, 0xEF + ble _08095F34 + cmp r6, 0 + beq _08095F80 + adds r0, r6, 0 + bl RandomCapped + add r0, sp + ldrb r0, [r0] + b _08095F82 +_08095F80: + movs r0, 0 +_08095F82: + add sp, 0xF0 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8095F28 + + thumb_func_start sub_8095F8C +sub_8095F8C: + push {r4,r5,lr} + movs r5, 0 + movs r4, 0 +_08095F92: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8096000 + lsls r0, 24 + cmp r0, 0 + bne _08095FA2 + adds r5, 0x1 +_08095FA2: + adds r4, 0x1 + cmp r4, 0x3 + ble _08095F92 + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095F8C + + thumb_func_start sub_8095FB0 +sub_8095FB0: + push {r4,r5,lr} + adds r4, r0, 0 + movs r3, 0 + ldr r5, _08095FD4 + movs r2, 0 +_08095FBA: + ldr r0, [r5] + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0 + bne _08095FD8 + adds r0, r4, 0 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2,r3} + stm r1!, {r2,r3} + movs r0, 0 + b _08095FE2 + .align 2, 0 +_08095FD4: .4byte gUnknown_203B490 +_08095FD8: + adds r2, 0x14 + adds r3, 0x1 + cmp r3, 0x3 + ble _08095FBA + movs r0, 0x1 +_08095FE2: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8095FB0 + + thumb_func_start sub_8095FE8 +sub_8095FE8: + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08095FFC + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + ldr r0, [r2] + adds r0, r1 + bx lr + .align 2, 0 +_08095FFC: .4byte gUnknown_203B490 + thumb_func_end sub_8095FE8 + + thumb_func_start sub_8096000 +sub_8096000: + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0809601C + ldr r2, [r1] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r2, r1 + ldrb r0, [r2] + cmp r0, 0 + beq _08096020 + movs r0, 0 + b _08096022 + .align 2, 0 +_0809601C: .4byte gUnknown_203B490 +_08096020: + movs r0, 0x1 +_08096022: + pop {r1} + bx r1 + thumb_func_end sub_8096000 + + thumb_func_start sub_8096028 +sub_8096028: + push {r4,lr} + movs r4, 0 +_0809602C: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8096040 + adds r4, 0x1 + cmp r4, 0x3 + ble _0809602C + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8096028 + + thumb_func_start sub_8096040 +sub_8096040: + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, _08096074 + ldr r1, [r3] + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 2 + adds r1, r2 + movs r4, 0 + strb r4, [r1] + ldr r0, [r3] + adds r0, r2 + movs r1, 0x63 + strb r1, [r0, 0x4] + ldr r0, [r3] + adds r0, r2 + strb r4, [r0, 0x5] + ldr r0, [r3] + adds r0, r2 + movs r1, 0x5 + strb r1, [r0, 0x11] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08096074: .4byte gUnknown_203B490 + thumb_func_end sub_8096040 + + thumb_func_start sub_8096078 +sub_8096078: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r2, 0 + movs r3, 0 + ldr r0, _08096090 + mov r12, r0 + mov r8, r3 + movs r4, 0 + mov r9, r4 + b _080960B6 + .align 2, 0 +_08096090: .4byte gUnknown_203B490 +_08096094: + cmp r2, r3 + ble _080960AA + mov r1, r12 + ldr r0, [r1] + mov r5, r8 + adds r1, r0, r5 + adds r0, r4 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r6,r7} + stm r1!, {r6,r7} +_080960AA: + adds r4, 0x14 + movs r0, 0x14 + add r9, r0 + adds r2, 0x1 + add r8, r0 + adds r3, 0x1 +_080960B6: + cmp r2, 0x3 + bgt _080960E2 + mov r1, r12 + ldr r0, [r1] + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + bne _080960E2 + ldr r6, _08096110 + mov r1, r9 +_080960CA: + adds r1, 0x14 + adds r4, 0x14 + movs r5, 0x14 + add r9, r5 + adds r2, 0x1 + cmp r2, 0x3 + bgt _080960E2 + ldr r0, [r6] + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080960CA +_080960E2: + cmp r2, 0x4 + bne _08096094 + cmp r3, 0x3 + bgt _08096102 + ldr r4, _08096110 + movs r2, 0 + lsls r0, r3, 2 + adds r0, r3 + lsls r1, r0, 2 +_080960F4: + ldr r0, [r4] + adds r0, r1 + strb r2, [r0] + adds r1, 0x14 + adds r3, 0x1 + cmp r3, 0x3 + ble _080960F4 +_08096102: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08096110: .4byte gUnknown_203B490 + thumb_func_end sub_8096078 + + thumb_func_start sub_8096114 +sub_8096114: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + movs r1, 0 +_08096122: + adds r0, r1, 0x1 + mov r10, r0 + mov r8, r10 + cmp r0, 0x3 + bgt _08096198 + ldr r2, _080961B0 + mov r9, r2 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + mov r12, r0 + mov r3, r10 + lsls r0, r3, 2 + add r0, r10 + lsls r4, r0, 2 +_08096140: + mov r5, r9 + ldr r1, [r5] + adds r3, r1, r4 + ldrb r0, [r3] + cmp r0, 0 + beq _0809618C + mov r6, r12 + adds r2, r1, r6 + ldrb r1, [r2, 0x4] + ldrb r0, [r3, 0x4] + cmp r1, r0 + bhi _08096164 + cmp r1, r0 + bne _0809618C + ldrb r0, [r2, 0x5] + ldrb r7, [r3, 0x5] + cmp r0, r7 + bls _0809618C +_08096164: + mov r1, sp + adds r0, r2, 0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r5,r6} + stm r1!, {r5,r6} + adds r1, r2, 0 + adds r0, r3, 0 + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r5,r6} + stm r1!, {r5,r6} + mov r7, r9 + ldr r1, [r7] + adds r1, r4 + mov r0, sp + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r6,r7} + stm r1!, {r6,r7} +_0809618C: + adds r4, 0x14 + movs r0, 0x1 + add r8, r0 + mov r1, r8 + cmp r1, 0x3 + ble _08096140 +_08096198: + mov r1, r10 + cmp r1, 0x2 + ble _08096122 + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080961B0: .4byte gUnknown_203B490 + thumb_func_end sub_8096114 + + thumb_func_start sub_80961B4 +sub_80961B4: + push {lr} + bl sub_8096E2C + lsls r0, 24 + cmp r0, 0 + beq _080961CE + ldr r0, _080961D4 + ldr r0, [r0] + movs r1, 0xCA + lsls r1, 2 + adds r0, r1 + movs r1, 0x1 + strb r1, [r0] +_080961CE: + pop {r0} + bx r0 + .align 2, 0 +_080961D4: .4byte gUnknown_203B490 + thumb_func_end sub_80961B4 + + thumb_func_start sub_80961D8 +sub_80961D8: + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r7, 0 + bl sub_8095F8C + adds r6, r0, 0 + movs r1, 0x4 + bl RandomRange + mov r8, r0 + cmp r6, 0x3 + bgt _08096202 + ldr r4, _08096208 + ldr r0, [r4] + movs r2, 0xCA + lsls r2, 2 + adds r1, r0, r2 + ldrb r0, [r1] + cmp r0, 0 + bne _0809620C +_08096202: + movs r0, 0 + b _080963A8 + .align 2, 0 +_08096208: .4byte gUnknown_203B490 +_0809620C: + strb r7, [r1] + movs r5, 0x38 + movs r0, 0xA + movs r1, 0x31 + movs r2, 0x1 + bl sub_8001D08 + lsls r0, 24 + cmp r0, 0 + beq _0809623A + ldr r0, [r4] + ldr r1, _08096328 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0809623A + movs r0, 0x35 + bl sub_8096E80 + lsls r0, 24 + cmp r0, 0 + bne _0809623A + movs r5, 0x35 +_0809623A: + movs r0, 0xF + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _0809629C + ldr r0, _0809632C + ldr r0, [r0] + movs r2, 0xC9 + lsls r2, 2 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _08096264 + movs r0, 0x34 + bl sub_8096E80 + lsls r0, 24 + cmp r0, 0 + bne _08096264 + movs r5, 0x34 +_08096264: + ldr r0, _0809632C + ldr r0, [r0] + ldr r1, _08096330 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _08096280 + movs r0, 0x33 + bl sub_8096E80 + lsls r0, 24 + cmp r0, 0 + bne _08096280 + movs r5, 0x33 +_08096280: + ldr r0, _0809632C + ldr r0, [r0] + ldr r2, _08096334 + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _0809629C + movs r0, 0x32 + bl sub_8096E80 + lsls r0, 24 + cmp r0, 0 + bne _0809629C + movs r5, 0x32 +_0809629C: + bl sub_8092178 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x6 + bne _080962C4 + ldr r0, _0809632C + ldr r0, [r0] + ldr r1, _08096338 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080962C4 + movs r0, 0x36 + bl sub_8096E80 + lsls r0, 24 + cmp r0, 0 + bne _080962C4 + movs r5, 0x36 +_080962C4: + movs r0, 0x6 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _080962EC + ldr r0, _0809632C + ldr r0, [r0] + ldr r2, _0809633C + adds r0, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080962EC + movs r0, 0x37 + bl sub_8096E80 + lsls r0, 24 + cmp r0, 0 + bne _080962EC + movs r5, 0x37 +_080962EC: + cmp r5, 0x38 + bne _08096310 + cmp r6, r8 + bgt _08096392 + bl sub_8096E2C + lsls r0, 24 + lsrs r5, r0, 24 + movs r0, 0xE + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + bne _0809630C + cmp r5, 0x2 + bhi _0809638E +_0809630C: + cmp r5, 0x31 + bhi _0809638E +_08096310: + lsls r0, r6, 24 + lsrs r0, 24 + bl sub_8095FE8 + adds r4, r0, 0 + movs r0, 0x1 + strb r0, [r4] + movs r0, 0x62 + strb r0, [r4, 0x4] + strb r5, [r4, 0x5] + b _0809638A + .align 2, 0 +_08096328: .4byte 0x00000325 +_0809632C: .4byte gUnknown_203B490 +_08096330: .4byte 0x00000323 +_08096334: .4byte 0x00000322 +_08096338: .4byte 0x00000326 +_0809633C: .4byte 0x00000327 +_08096340: + lsls r0, r6, 24 + lsrs r0, 24 + bl sub_8095FE8 + adds r4, r0, 0 + bl sub_8095B28 + lsls r0, 24 + cmp r0, 0 + beq _08096392 + bl sub_8095E78 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r4, 0x4 + ldrb r1, [r4, 0x1] + bl sub_803C1D0 + lsls r0, 24 + cmp r0, 0 + bne _0809636C + movs r5, 0 +_0809636C: + movs r0, 0x5 + movs r1, 0xA + bl RandomRange + strb r0, [r4, 0x11] + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x9 + bne _0809638A + cmp r5, 0 + bne _08096388 + movs r0, 0x5 + strb r0, [r4, 0x11] + b _0809638A +_08096388: + strb r5, [r4, 0x13] +_0809638A: + movs r7, 0x1 + adds r6, 0x1 +_0809638E: + cmp r6, r8 + ble _08096340 +_08096392: + bl sub_80963B4 + lsls r0, 24 + cmp r0, 0 + beq _0809639E + movs r7, 0x1 +_0809639E: + bl sub_8096078 + bl sub_8096114 + adds r0, r7, 0 +_080963A8: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80961D8 + + thumb_func_start sub_80963B4 +sub_80963B4: + push {r4-r6,lr} + movs r6, 0 + bl sub_8096E2C + lsls r0, 24 + lsrs r5, r0, 24 + bl sub_8095F8C + adds r4, r0, 0 + cmp r4, 0x3 + ble _080963CE + movs r0, 0 + b _080963F4 +_080963CE: + movs r0, 0xE + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _080963F2 + cmp r5, 0x31 + bhi _080963F2 + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8095FE8 + movs r1, 0x1 + strb r1, [r0] + movs r1, 0x62 + strb r1, [r0, 0x4] + strb r5, [r0, 0x5] + movs r6, 0x1 +_080963F2: + adds r0, r6, 0 +_080963F4: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80963B4 + + thumb_func_start sub_80963FC +sub_80963FC: + push {r4-r6,lr} + movs r6, 0 +_08096400: + lsls r0, r6, 24 + lsrs r4, r0, 24 + adds r0, r4, 0 + bl sub_8095FE8 + adds r5, r0, 0 + ldrb r0, [r5] + cmp r0, 0x1 + beq _08096418 + adds r0, r4, 0 + bl sub_8096040 +_08096418: + adds r6, 0x1 + cmp r6, 0x3 + ble _08096400 + bl sub_8096078 + bl sub_8095F8C + lsls r0, 24 + lsrs r0, 24 + bl sub_8095FE8 + adds r5, r0, 0 + movs r0, 0 + movs r4, 0x5 + strb r4, [r5] + strb r0, [r5, 0x1] + strb r0, [r5, 0x2] + movs r0, 0x2 + strb r0, [r5, 0x4] + movs r0, 0x3 + strb r0, [r5, 0x5] + bl Random + ldr r1, _08096484 + ands r1, r0 + str r1, [r5, 0x8] + movs r0, 0x10 + strh r0, [r5, 0xC] + strh r0, [r5, 0xE] + ldrb r0, [r5, 0x4] + bl sub_8095F28 + strb r0, [r5, 0x10] + strb r4, [r5, 0x11] +_0809645C: + ldrb r1, [r5, 0x1] + adds r0, r5, 0x4 + adds r2, r5, 0 + adds r2, 0x12 + bl sub_803C37C + ldrb r0, [r5, 0x10] + ldrb r1, [r5, 0x12] + cmp r0, r1 + beq _0809645C + movs r0, 0 + strb r0, [r5, 0x13] + bl sub_8096078 + bl sub_8096114 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08096484: .4byte 0x00ffffff + thumb_func_end sub_80963FC + + thumb_func_start sub_8096488 +sub_8096488: + push {r4,lr} + movs r4, 0 +_0809648C: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8096040 + adds r4, 0x1 + cmp r4, 0x3 + ble _0809648C + movs r0, 0 + bl sub_8095FE8 + movs r2, 0 + movs r1, 0x1 + strb r1, [r0] + movs r1, 0x62 + strb r1, [r0, 0x4] + strb r2, [r0, 0x5] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8096488 + + thumb_func_start sub_80964B4 +sub_80964B4: + push {lr} + ldr r0, _080964D4 + ldr r0, [r0] + ldr r1, _080964D8 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _080964DC + movs r0, 0x35 + bl sub_8096E80 + lsls r0, 24 + cmp r0, 0 + bne _080964DC + movs r0, 0 + b _080964DE + .align 2, 0 +_080964D4: .4byte gUnknown_203B490 +_080964D8: .4byte 0x00000325 +_080964DC: + movs r0, 0x1 +_080964DE: + pop {r1} + bx r1 + thumb_func_end sub_80964B4 + + thumb_func_start sub_80964E4 +sub_80964E4: + push {lr} + ldr r0, _08096504 + ldr r0, [r0] + ldr r1, _08096508 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + bne _0809650C + movs r0, 0x36 + bl sub_8096E80 + lsls r0, 24 + cmp r0, 0 + bne _0809650C + movs r0, 0 + b _0809650E + .align 2, 0 +_08096504: .4byte gUnknown_203B490 +_08096508: .4byte 0x00000326 +_0809650C: + movs r0, 0x1 +_0809650E: + pop {r1} + bx r1 + thumb_func_end sub_80964E4 + + thumb_func_start sub_8096514 +sub_8096514: + push {r4,r5,lr} + movs r5, 0 + movs r4, 0 +_0809651A: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_809658C + lsls r0, 24 + cmp r0, 0 + bne _0809652A + adds r5, 0x1 +_0809652A: + adds r4, 0x1 + cmp r4, 0x7 + ble _0809651A + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8096514 + + thumb_func_start sub_8096538 +sub_8096538: + push {r4,r5,lr} + adds r4, r0, 0 + movs r3, 0 + ldr r5, _08096560 + movs r2, 0 +_08096542: + ldr r0, [r5] + adds r0, r2 + adds r1, r0, 0 + adds r1, 0x50 + ldrb r0, [r1] + cmp r0, 0 + bne _08096564 + adds r0, r4, 0 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2,r3} + stm r1!, {r2,r3} + movs r0, 0 + b _0809656E + .align 2, 0 +_08096560: .4byte gUnknown_203B490 +_08096564: + adds r2, 0x14 + adds r3, 0x1 + cmp r3, 0x7 + ble _08096542 + movs r0, 0x1 +_0809656E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8096538 + + thumb_func_start sub_8096574 +sub_8096574: + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08096588 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, 0x50 + ldr r0, [r2] + adds r0, r1 + bx lr + .align 2, 0 +_08096588: .4byte gUnknown_203B490 + thumb_func_end sub_8096574 + + thumb_func_start sub_809658C +sub_809658C: + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080965AC + ldr r2, [r1] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r2, r1 + adds r2, 0x50 + ldrb r0, [r2] + cmp r0, 0 + beq _080965B0 + movs r0, 0 + b _080965B2 + .align 2, 0 +_080965AC: .4byte gUnknown_203B490 +_080965B0: + movs r0, 0x1 +_080965B2: + pop {r1} + bx r1 + thumb_func_end sub_809658C + + thumb_func_start sub_80965B8 +sub_80965B8: + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r4, _080965F0 + ldr r1, [r4] + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 2 + adds r1, r2 + adds r1, 0x50 + movs r3, 0 + strb r3, [r1] + ldr r0, [r4] + adds r0, r2 + adds r0, 0x54 + movs r1, 0x63 + strb r1, [r0] + ldr r0, [r4] + adds r0, r2 + adds r0, 0x55 + strb r3, [r0] + ldr r0, [r4] + adds r0, r2 + adds r0, 0x61 + strb r3, [r0] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080965F0: .4byte gUnknown_203B490 + thumb_func_end sub_80965B8 + + thumb_func_start sub_80965F4 +sub_80965F4: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r2, 0 + movs r3, 0 + ldr r0, _0809660C + mov r12, r0 + mov r8, r3 + movs r4, 0 + mov r9, r4 + b _08096636 + .align 2, 0 +_0809660C: .4byte gUnknown_203B490 +_08096610: + cmp r2, r3 + ble _0809662A + mov r1, r12 + ldr r0, [r1] + mov r5, r8 + adds r1, r0, r5 + adds r0, r4 + adds r1, 0x50 + adds r0, 0x50 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r6,r7} + stm r1!, {r6,r7} +_0809662A: + adds r4, 0x14 + movs r0, 0x14 + add r9, r0 + adds r2, 0x1 + add r8, r0 + adds r3, 0x1 +_08096636: + cmp r2, 0x7 + bgt _08096666 + mov r1, r12 + ldr r0, [r1] + adds r0, r4 + adds r0, 0x50 + ldrb r0, [r0] + cmp r0, 0 + bne _08096666 + ldr r6, _08096694 + mov r1, r9 +_0809664C: + adds r1, 0x14 + adds r4, 0x14 + movs r5, 0x14 + add r9, r5 + adds r2, 0x1 + cmp r2, 0x7 + bgt _08096666 + ldr r0, [r6] + adds r0, r1 + adds r0, 0x50 + ldrb r0, [r0] + cmp r0, 0 + beq _0809664C +_08096666: + cmp r2, 0x8 + bne _08096610 + cmp r3, 0x7 + bgt _08096688 + ldr r4, _08096694 + movs r2, 0 + lsls r0, r3, 2 + adds r0, r3 + lsls r1, r0, 2 +_08096678: + ldr r0, [r4] + adds r0, r1 + adds r0, 0x50 + strb r2, [r0] + adds r1, 0x14 + adds r3, 0x1 + cmp r3, 0x7 + ble _08096678 +_08096688: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08096694: .4byte gUnknown_203B490 + thumb_func_end sub_80965F4 + + thumb_func_start sub_8096698 +sub_8096698: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + movs r1, 0 +_080966A6: + adds r6, r1, 0x1 + mov r10, r6 + cmp r6, 0x7 + bgt _08096730 + ldr r0, _08096748 + mov r8, r0 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + mov r9, r0 + lsls r0, r6, 2 + adds r0, r6 + lsls r4, r0, 2 +_080966C0: + mov r2, r8 + ldr r1, [r2] + adds r3, r1, r4 + adds r5, r3, 0 + adds r5, 0x50 + ldrb r0, [r5] + cmp r0, 0 + beq _08096724 + add r1, r9 + mov r12, r1 + mov r0, r12 + adds r0, 0x54 + adds r1, r3, 0 + adds r1, 0x54 + ldrb r2, [r0] + ldrb r0, [r1] + cmp r2, r0 + bhi _080966F6 + cmp r2, r0 + bne _08096724 + mov r0, r12 + adds r0, 0x55 + adds r1, 0x1 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bls _08096724 +_080966F6: + mov r1, sp + mov r0, r12 + adds r0, 0x50 + ldm r0!, {r2,r3,r7} + stm r1!, {r2,r3,r7} + ldm r0!, {r3,r7} + stm r1!, {r3,r7} + mov r1, r12 + adds r1, 0x50 + adds r0, r5, 0 + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r7} + stm r1!, {r2,r7} + mov r3, r8 + ldr r1, [r3] + adds r1, r4 + adds r1, 0x50 + mov r0, sp + ldm r0!, {r2,r5,r7} + stm r1!, {r2,r5,r7} + ldm r0!, {r3,r5} + stm r1!, {r3,r5} +_08096724: + adds r4, 0x14 + movs r7, 0x1 + add r10, r7 + mov r0, r10 + cmp r0, 0x7 + ble _080966C0 +_08096730: + adds r1, r6, 0 + cmp r1, 0x6 + ble _080966A6 + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08096748: .4byte gUnknown_203B490 + thumb_func_end sub_8096698 + + thumb_func_start sub_809674C +sub_809674C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r0, 0x4 + movs r1, 0x8 + bl RandomRange + mov r8, r0 + ldr r3, _08096864 + movs r2, 0 + movs r1, 0 + movs r7, 0x7 +_08096764: + ldr r0, [r3] + adds r0, r1 + adds r0, 0x50 + strb r2, [r0] + adds r1, 0x14 + subs r7, 0x1 + cmp r7, 0 + bge _08096764 + movs r7, 0 + movs r0, 0xE + bl sub_8097318 + lsls r0, 24 + cmp r0, 0 + beq _080967C0 + movs r0, 0 + bl sub_8096574 + adds r5, r0, 0 + movs r4, 0x2 + strb r4, [r5] + movs r0, 0x6 + strb r0, [r5, 0x1] + movs r0, 0x1 + strb r0, [r5, 0x2] + movs r0, 0x2A + strb r0, [r5, 0x4] + movs r0, 0xA + strb r0, [r5, 0x5] + bl Random + ldr r1, _08096868 + ands r1, r0 + str r1, [r5, 0x8] + movs r1, 0 + movs r0, 0xC2 + lsls r0, 1 + strh r0, [r5, 0xC] + movs r0, 0x38 + strh r0, [r5, 0xE] + strb r1, [r5, 0x10] + strb r4, [r5, 0x11] + movs r0, 0x3A + strb r0, [r5, 0x12] + strb r1, [r5, 0x13] + movs r7, 0x1 +_080967C0: + movs r0, 0xF + bl sub_8097318 + lsls r0, 24 + cmp r0, 0 + beq _0809680A + lsls r0, r7, 24 + lsrs r0, 24 + bl sub_8096574 + adds r5, r0, 0 + movs r0, 0x3 + strb r0, [r5] + movs r0, 0x6 + strb r0, [r5, 0x1] + movs r4, 0x2 + strb r4, [r5, 0x2] + movs r0, 0x35 + strb r0, [r5, 0x4] + movs r0, 0xF + strb r0, [r5, 0x5] + bl Random + ldr r1, _08096868 + ands r1, r0 + str r1, [r5, 0x8] + movs r1, 0 + movs r0, 0x82 + lsls r0, 1 + strh r0, [r5, 0xC] + strh r0, [r5, 0xE] + strb r1, [r5, 0x10] + strb r4, [r5, 0x11] + movs r0, 0x3A + strb r0, [r5, 0x12] + strb r1, [r5, 0x13] + adds r7, 0x1 +_0809680A: + movs r0, 0x1C + bl sub_8097318 + lsls r0, 24 + cmp r0, 0 + beq _08096854 + lsls r0, r7, 24 + lsrs r0, 24 + bl sub_8096574 + adds r5, r0, 0 + movs r0, 0x4 + strb r0, [r5] + movs r0, 0x6 + strb r0, [r5, 0x1] + movs r0, 0x3 + strb r0, [r5, 0x2] + movs r0, 0x1A + strb r0, [r5, 0x4] + movs r0, 0x14 + strb r0, [r5, 0x5] + bl Random + ldr r1, _08096868 + ands r1, r0 + str r1, [r5, 0x8] + movs r1, 0 + ldr r0, _0809686C + strh r0, [r5, 0xC] + strh r0, [r5, 0xE] + strb r1, [r5, 0x10] + movs r0, 0x2 + strb r0, [r5, 0x11] + movs r0, 0x3A + strb r0, [r5, 0x12] + strb r1, [r5, 0x13] + adds r7, 0x1 +_08096854: + lsls r0, r7, 2 + adds r0, r7 + lsls r0, 2 + adds r5, r0, 0 + adds r5, 0x50 + adds r4, r0, 0 + b _08096886 + .align 2, 0 +_08096864: .4byte gUnknown_203B490 +_08096868: .4byte 0x00ffffff +_0809686C: .4byte 0x0000014d +_08096870: + movs r0, 0 + movs r1, 0x4 + bl RandomRange + ldr r1, [r6] + adds r1, r4 + adds r1, 0x61 + strb r0, [r1] + adds r5, 0x14 + adds r4, 0x14 + adds r7, 0x1 +_08096886: + cmp r7, r8 + bgt _0809689A + ldr r6, _080968AC + ldr r0, [r6] + adds r0, r5 + bl sub_8095B28 + lsls r0, 24 + cmp r0, 0 + bne _08096870 +_0809689A: + bl sub_80965F4 + bl sub_8096698 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080968AC: .4byte gUnknown_203B490 + thumb_func_end sub_809674C + + thumb_func_start sub_80968B0 +sub_80968B0: + push {r4,r5,lr} + adds r3, r0, 0 + movs r4, 0 + ldr r0, _08096928 + ldr r0, [r0] + adds r2, r0, 0 + adds r2, 0xF0 +_080968BE: + ldrb r0, [r2] + cmp r0, 0 + beq _0809692C + ldrb r0, [r3, 0x1] + ldrb r1, [r2, 0x1] + cmp r0, r1 + bne _0809692C + ldrb r0, [r3, 0x2] + ldrb r5, [r2, 0x2] + cmp r0, r5 + bne _0809692C + ldrb r0, [r3, 0x4] + ldrb r1, [r2, 0x4] + cmp r0, r1 + bne _0809692C + ldrb r0, [r3, 0x5] + ldrb r5, [r2, 0x5] + cmp r0, r5 + bne _0809692C + ldr r1, [r3, 0x8] + ldr r0, [r2, 0x8] + cmp r1, r0 + bne _0809692C + movs r0, 0xC + ldrsh r1, [r3, r0] + movs r5, 0xC + ldrsh r0, [r2, r5] + cmp r1, r0 + bne _0809692C + movs r0, 0xE + ldrsh r1, [r3, r0] + movs r5, 0xE + ldrsh r0, [r2, r5] + cmp r1, r0 + bne _0809692C + ldrb r0, [r3, 0x10] + ldrb r1, [r2, 0x10] + cmp r0, r1 + bne _0809692C + ldrb r0, [r3, 0x11] + ldrb r5, [r2, 0x11] + cmp r0, r5 + bne _0809692C + ldrb r0, [r3, 0x12] + ldrb r1, [r2, 0x12] + cmp r0, r1 + bne _0809692C + ldrb r0, [r3, 0x13] + ldrb r5, [r2, 0x13] + cmp r0, r5 + bne _0809692C + movs r0, 0x1 + b _08096936 + .align 2, 0 +_08096928: .4byte gUnknown_203B490 +_0809692C: + adds r2, 0x14 + adds r4, 0x1 + cmp r4, 0x7 + ble _080968BE + movs r0, 0 +_08096936: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80968B0 + + thumb_func_start sub_809693C +sub_809693C: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r4, r0, 0 + ldrb r0, [r4, 0x4] + mov r9, r0 + ldrb r0, [r4, 0x5] + mov r8, r0 + movs r7, 0 + adds r0, r4, 0 + bl sub_80959C0 + lsls r0, 24 + cmp r0, 0 + bne _08096962 + b _0809699A +_0809695E: + movs r0, 0x1 + b _0809699C +_08096962: + ldrb r0, [r4, 0x1] + cmp r0, 0x2 + bne _0809696A + movs r7, 0x1 +_0809696A: + movs r6, 0 + movs r5, 0xF0 + movs r4, 0 +_08096970: + ldr r0, _080969A8 + ldr r1, [r0] + adds r0, r1, r4 + adds r0, 0xF0 + ldrb r0, [r0] + cmp r0, 0x6 + bne _08096990 + adds r0, r1, r5 + mov r1, r9 + mov r2, r8 + adds r3, r7, 0 + bl sub_8095E38 + lsls r0, 24 + cmp r0, 0 + bne _0809695E +_08096990: + adds r5, 0x14 + adds r4, 0x14 + adds r6, 0x1 + cmp r6, 0x7 + ble _08096970 +_0809699A: + movs r0, 0 +_0809699C: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080969A8: .4byte gUnknown_203B490 + thumb_func_end sub_809693C + + thumb_func_start sub_80969AC +sub_80969AC: + push {r4,r5,lr} + movs r5, 0 + movs r4, 0 +_080969B2: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8096ACC + lsls r0, 24 + cmp r0, 0 + bne _080969C2 + adds r5, 0x1 +_080969C2: + adds r4, 0x1 + cmp r4, 0x7 + ble _080969B2 + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80969AC + + thumb_func_start sub_80969D0 +sub_80969D0: + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 + movs r4, 0 +_080969DA: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8096AB4 + adds r1, r0, 0 + ldrb r0, [r1, 0x4] + cmp r0, r6 + bne _080969FA + ldrb r0, [r1] + cmp r0, 0x6 + beq _080969F8 + cmp r0, 0x8 + beq _080969F8 + cmp r0, 0x9 + bne _080969FA +_080969F8: + adds r5, 0x1 +_080969FA: + adds r4, 0x1 + cmp r4, 0x7 + ble _080969DA + adds r0, r5, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80969D0 + + thumb_func_start sub_8096A08 +sub_8096A08: + push {r4-r6,lr} + sub sp, 0xC + adds r6, r1, 0 + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 +_08096A14: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8096AB4 + adds r2, r0, 0 + ldrb r0, [r2, 0x4] + cmp r0, r5 + bne _08096A68 + ldrb r0, [r2] + cmp r0, 0x6 + bne _08096A68 + ldrb r0, [r2, 0x1] + cmp r0, 0x2 + bne _08096A68 + ldr r1, _08096A60 + ldr r0, [sp, 0x8] + ands r0, r1 + movs r1, 0x4A + orrs r0, r1 + ldr r1, _08096A64 + ands r0, r1 + movs r1, 0x80 + lsls r1, 1 + orrs r0, r1 + str r0, [sp, 0x8] + movs r0, 0xC + ldrsh r1, [r2, r0] + add r0, sp, 0x8 + str r0, [sp] + movs r0, 0 + str r0, [sp, 0x4] + adds r0, r6, 0 + movs r2, 0 + movs r3, 0 + bl sub_808CFD0 + movs r0, 0x1 + b _08096A70 + .align 2, 0 +_08096A60: .4byte 0xffffff00 +_08096A64: .4byte 0xffff00ff +_08096A68: + adds r4, 0x1 + cmp r4, 0x7 + ble _08096A14 + movs r0, 0 +_08096A70: + add sp, 0xC + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8096A08 + + thumb_func_start sub_8096A78 +sub_8096A78: + push {r4,r5,lr} + adds r4, r0, 0 + movs r3, 0 + ldr r5, _08096AA0 + movs r2, 0 +_08096A82: + ldr r0, [r5] + adds r0, r2 + adds r1, r0, 0 + adds r1, 0xF0 + ldrb r0, [r1] + cmp r0, 0 + bne _08096AA4 + adds r0, r4, 0 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2,r3} + stm r1!, {r2,r3} + movs r0, 0 + b _08096AAE + .align 2, 0 +_08096AA0: .4byte gUnknown_203B490 +_08096AA4: + adds r2, 0x14 + adds r3, 0x1 + cmp r3, 0x7 + ble _08096A82 + movs r0, 0x1 +_08096AAE: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8096A78 + + thumb_func_start sub_8096AB4 +sub_8096AB4: + lsls r0, 24 + lsrs r0, 24 + ldr r2, _08096AC8 + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r1, 0xF0 + ldr r0, [r2] + adds r0, r1 + bx lr + .align 2, 0 +_08096AC8: .4byte gUnknown_203B490 + thumb_func_end sub_8096AB4 + + thumb_func_start sub_8096ACC +sub_8096ACC: + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08096AEC + ldr r2, [r1] + lsls r1, r0, 2 + adds r1, r0 + lsls r1, 2 + adds r2, r1 + adds r2, 0xF0 + ldrb r0, [r2] + cmp r0, 0 + beq _08096AF0 + movs r0, 0 + b _08096AF2 + .align 2, 0 +_08096AEC: .4byte gUnknown_203B490 +_08096AF0: + movs r0, 0x1 +_08096AF2: + pop {r1} + bx r1 + thumb_func_end sub_8096ACC + + thumb_func_start sub_8096AF8 +sub_8096AF8: + push {r4-r6,lr} + adds r5, r0, 0 + adds r0, r1, 0 + adds r4, r2, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r4, 24 + lsrs r4, 24 + bl sub_8096AB4 + adds r3, r0, 0 + movs r1, 0 + strb r1, [r5] + ldrh r0, [r3, 0xC] + strh r0, [r5, 0x2] + strh r1, [r5, 0x4] + ldrb r0, [r3, 0x4] + cmp r0, r4 + bne _08096B92 + ldrb r0, [r3, 0x1] + cmp r0, 0x4 + bhi _08096B92 + lsls r0, 2 + ldr r1, _08096B30 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08096B30: .4byte _08096B34 + .align 2, 0 +_08096B34: + .4byte _08096B78 + .4byte _08096B84 + .4byte _08096B84 + .4byte _08096B48 + .4byte _08096B78 +_08096B48: + ldrb r0, [r3] + cmp r0, 0x6 + bne _08096B92 + ldr r0, _08096B74 + movs r6, 0x1 + ldr r2, [r0] + movs r4, 0x13 +_08096B56: + ldrb r1, [r2] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _08096B6A + ldrb r0, [r2, 0x2] + ldrb r1, [r3, 0x10] + cmp r0, r1 + bne _08096B6A + strb r6, [r5] +_08096B6A: + adds r2, 0x4 + subs r4, 0x1 + cmp r4, 0 + bge _08096B56 + b _08096B92 + .align 2, 0 +_08096B74: .4byte gUnknown_203B460 +_08096B78: + ldrb r0, [r3] + cmp r0, 0x9 + bne _08096B92 + movs r0, 0x1 + strb r0, [r5] + b _08096B92 +_08096B84: + ldrb r0, [r3] + cmp r0, 0x9 + bne _08096B92 + movs r0, 0x1 + strb r0, [r5] + ldrh r0, [r3, 0xE] + strh r0, [r5, 0x4] +_08096B92: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_8096AF8 + + thumb_func_start sub_8096B98 +sub_8096B98: + push {r4,r5,lr} + lsls r0, 24 + lsrs r5, r0, 24 + movs r4, 0 +_08096BA0: + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8096AB4 + adds r1, r0, 0 + ldrb r0, [r1] + cmp r0, 0x6 + bne _08096BC2 + ldrb r0, [r1, 0x1] + cmp r0, 0x2 + bne _08096BC2 + ldrb r0, [r1, 0x4] + cmp r0, r5 + bne _08096BC2 + movs r2, 0xE + ldrsh r0, [r1, r2] + b _08096BCA +_08096BC2: + adds r4, 0x1 + cmp r4, 0x7 + ble _08096BA0 + movs r0, 0 +_08096BCA: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8096B98 + + thumb_func_start sub_8096BD0 +sub_8096BD0: + push {r4,r5,lr} + ldr r0, _08096C04 + ldr r0, [r0] + adds r5, r0, 0 + adds r5, 0xF0 + movs r4, 0 +_08096BDC: + ldrb r0, [r5] + cmp r0, 0x9 + bgt _08096BEE + cmp r0, 0x7 + blt _08096BEE + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8096C3C +_08096BEE: + adds r5, 0x14 + adds r4, 0x1 + cmp r4, 0x7 + ble _08096BDC + bl sub_8096C80 + bl sub_8096D24 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08096C04: .4byte gUnknown_203B490 + thumb_func_end sub_8096BD0 + + thumb_func_start sub_8096C08 +sub_8096C08: + push {lr} + adds r3, r0, 0 + ldr r0, _08096C28 + ldr r0, [r0] + adds r1, r0, 0 + adds r1, 0xF0 + movs r2, 0 +_08096C16: + ldrb r0, [r1] + cmp r0, 0x4 + bls _08096C2C + ldrb r0, [r1, 0x2] + cmp r0, 0x4 + bne _08096C2C + strb r2, [r3] + movs r0, 0x1 + b _08096C36 + .align 2, 0 +_08096C28: .4byte gUnknown_203B490 +_08096C2C: + adds r1, 0x14 + adds r2, 0x1 + cmp r2, 0x7 + ble _08096C16 + movs r0, 0 +_08096C36: + pop {r1} + bx r1 + thumb_func_end sub_8096C08 + + thumb_func_start sub_8096C3C +sub_8096C3C: + push {r4,lr} + lsls r0, 24 + lsrs r0, 24 + ldr r3, _08096C78 + ldr r1, [r3] + lsls r2, r0, 2 + adds r2, r0 + lsls r2, 2 + adds r1, r2 + adds r1, 0xF0 + movs r4, 0 + strb r4, [r1] + ldr r0, [r3] + adds r0, r2 + adds r0, 0xF4 + movs r1, 0x63 + strb r1, [r0] + ldr r0, [r3] + adds r0, r2 + adds r0, 0xF5 + strb r4, [r0] + ldr r0, [r3] + adds r0, r2 + ldr r2, _08096C7C + adds r1, r0, r2 + movs r0, 0x5 + strb r0, [r1] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08096C78: .4byte gUnknown_203B490 +_08096C7C: .4byte 0x00000101 + thumb_func_end sub_8096C3C + + thumb_func_start sub_8096C80 +sub_8096C80: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + movs r2, 0 + movs r3, 0 + ldr r0, _08096C98 + mov r12, r0 + mov r8, r3 + movs r4, 0 + mov r9, r4 + b _08096CC2 + .align 2, 0 +_08096C98: .4byte gUnknown_203B490 +_08096C9C: + cmp r2, r3 + ble _08096CB6 + mov r1, r12 + ldr r0, [r1] + mov r5, r8 + adds r1, r0, r5 + adds r0, r4 + adds r1, 0xF0 + adds r0, 0xF0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldm r0!, {r6,r7} + stm r1!, {r6,r7} +_08096CB6: + adds r4, 0x14 + movs r0, 0x14 + add r9, r0 + adds r2, 0x1 + add r8, r0 + adds r3, 0x1 +_08096CC2: + cmp r2, 0x7 + bgt _08096CF2 + mov r1, r12 + ldr r0, [r1] + adds r0, r4 + adds r0, 0xF0 + ldrb r0, [r0] + cmp r0, 0 + bne _08096CF2 + ldr r6, _08096D20 + mov r1, r9 +_08096CD8: + adds r1, 0x14 + adds r4, 0x14 + movs r5, 0x14 + add r9, r5 + adds r2, 0x1 + cmp r2, 0x7 + bgt _08096CF2 + ldr r0, [r6] + adds r0, r1 + adds r0, 0xF0 + ldrb r0, [r0] + cmp r0, 0 + beq _08096CD8 +_08096CF2: + cmp r2, 0x8 + bne _08096C9C + cmp r3, 0x7 + bgt _08096D14 + ldr r4, _08096D20 + movs r2, 0 + lsls r0, r3, 2 + adds r0, r3 + lsls r1, r0, 2 +_08096D04: + ldr r0, [r4] + adds r0, r1 + adds r0, 0xF0 + strb r2, [r0] + adds r1, 0x14 + adds r3, 0x1 + cmp r3, 0x7 + ble _08096D04 +_08096D14: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08096D20: .4byte gUnknown_203B490 + thumb_func_end sub_8096C80 + + thumb_func_start sub_8096D24 +sub_8096D24: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + movs r1, 0 +_08096D32: + adds r6, r1, 0x1 + mov r10, r6 + cmp r6, 0x7 + bgt _08096DBC + ldr r0, _08096DD4 + mov r8, r0 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + mov r9, r0 + lsls r0, r6, 2 + adds r0, r6 + lsls r4, r0, 2 +_08096D4C: + mov r1, r8 + ldr r2, [r1] + adds r3, r2, r4 + adds r5, r3, 0 + adds r5, 0xF0 + str r5, [sp, 0x14] + ldrb r0, [r5] + cmp r0, 0 + beq _08096DB0 + add r2, r9 + mov r12, r2 + mov r0, r12 + adds r0, 0xF4 + adds r1, r3, 0 + adds r1, 0xF4 + ldrb r2, [r0] + ldrb r0, [r1] + cmp r2, r0 + bhi _08096D84 + cmp r2, r0 + bne _08096DB0 + mov r0, r12 + adds r0, 0xF5 + adds r1, 0x1 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bls _08096DB0 +_08096D84: + mov r2, r12 + adds r2, 0xF0 + mov r1, sp + adds r0, r2, 0 + ldm r0!, {r3,r5,r7} + stm r1!, {r3,r5,r7} + ldm r0!, {r3,r7} + stm r1!, {r3,r7} + ldr r0, [sp, 0x14] + ldm r0!, {r1,r5,r7} + stm r2!, {r1,r5,r7} + ldm r0!, {r3,r5} + stm r2!, {r3,r5} + mov r7, r8 + ldr r1, [r7] + adds r1, r4 + adds r1, 0xF0 + mov r0, sp + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + ldm r0!, {r2,r7} + stm r1!, {r2,r7} +_08096DB0: + adds r4, 0x14 + movs r3, 0x1 + add r10, r3 + mov r5, r10 + cmp r5, 0x7 + ble _08096D4C +_08096DBC: + adds r1, r6, 0 + cmp r1, 0x6 + ble _08096D32 + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08096DD4: .4byte gUnknown_203B490 + thumb_func_end sub_8096D24 + + thumb_func_start sub_8096DD8 +sub_8096DD8: + ldr r0, _08096DE4 + ldr r0, [r0] + movs r1, 0xC8 + lsls r1, 1 + adds r0, r1 + bx lr + .align 2, 0 +_08096DE4: .4byte gUnknown_203B490 + thumb_func_end sub_8096DD8 + + thumb_func_start sub_8096DE8 +sub_8096DE8: + ldr r0, _08096DF4 + ldr r0, [r0] + movs r1, 0xDC + lsls r1, 1 + adds r0, r1 + bx lr + .align 2, 0 +_08096DF4: .4byte gUnknown_203B490 + thumb_func_end sub_8096DE8 + + thumb_func_start sub_8096DF8 +sub_8096DF8: + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08096E10 + ldr r1, [r1] + movs r2, 0xBC + lsls r2, 2 + adds r1, r2 + adds r1, r0 + movs r0, 0x1 + strb r0, [r1] + bx lr + .align 2, 0 +_08096E10: .4byte gUnknown_203B490 + thumb_func_end sub_8096DF8 + + thumb_func_start sub_8096E14 +sub_8096E14: + lsls r0, 24 + lsrs r0, 24 + ldr r1, _08096E28 + ldr r1, [r1] + movs r2, 0xBC + lsls r2, 2 + adds r1, r2 + adds r1, r0 + ldrb r0, [r1] + bx lr + .align 2, 0 +_08096E28: .4byte gUnknown_203B490 + thumb_func_end sub_8096E14 + + thumb_func_start sub_8096E2C +sub_8096E2C: + push {lr} + movs r3, 0 + ldr r0, _08096E70 + ldr r1, [r0] + movs r2, 0x3 +_08096E36: + ldrb r0, [r1] + cmp r0, 0x1 + bne _08096E48 + ldrb r0, [r1, 0x5] + cmp r3, r0 + bgt _08096E48 + cmp r0, 0x31 + bhi _08096E48 + adds r3, r0, 0x1 +_08096E48: + adds r1, 0x14 + subs r2, 0x1 + cmp r2, 0 + bge _08096E36 + adds r2, r3, 0 + cmp r2, 0x31 + bgt _08096E7A + ldr r0, _08096E70 + ldr r0, [r0] + movs r3, 0xBC + lsls r3, 2 + adds r1, r0, r3 +_08096E60: + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _08096E74 + lsls r0, r2, 24 + lsrs r0, 24 + b _08096E7C + .align 2, 0 +_08096E70: .4byte gUnknown_203B490 +_08096E74: + adds r2, 0x1 + cmp r2, 0x31 + ble _08096E60 +_08096E7A: + movs r0, 0x38 +_08096E7C: + pop {r1} + bx r1 + thumb_func_end sub_8096E2C + + thumb_func_start sub_8096E80 +sub_8096E80: + push {lr} + lsls r0, 24 + lsrs r3, r0, 24 + movs r2, 0 + ldr r0, _08096E9C + ldr r1, [r0] +_08096E8C: + ldrb r0, [r1] + cmp r0, 0x1 + bne _08096EA0 + ldrb r0, [r1, 0x5] + cmp r3, r0 + bne _08096EA0 + movs r0, 0x1 + b _08096EAA + .align 2, 0 +_08096E9C: .4byte gUnknown_203B490 +_08096EA0: + adds r1, 0x14 + adds r2, 0x1 + cmp r2, 0x3 + ble _08096E8C + movs r0, 0 +_08096EAA: + pop {r1} + bx r1 + thumb_func_end sub_8096E80 + + thumb_func_start sub_8096EB0 +sub_8096EB0: + ldrb r1, [r0, 0x2] + ldrb r2, [r0, 0x1] + adds r1, r2 + ldrb r3, [r0, 0x4] + adds r2, r1, r3 + ldrb r1, [r0, 0x5] + adds r2, r1 + ldr r1, [r0, 0x8] + lsls r1, 8 + adds r2, r1 + movs r3, 0xC + ldrsh r1, [r0, r3] + lsls r1, 12 + adds r2, r1 + movs r3, 0xE + ldrsh r1, [r0, r3] + lsls r1, 16 + adds r2, r1 + ldrb r1, [r0, 0x10] + lsls r1, 24 + adds r1, r2, r1 + ldrb r3, [r0, 0x11] + adds r2, r1, r3 + ldrb r1, [r0, 0x12] + adds r1, r2, r1 + ldrb r0, [r0, 0x13] + adds r2, r1, r0 + adds r0, r2, 0 + bx lr + thumb_func_end sub_8096EB0 + + thumb_func_start sub_8096EEC +sub_8096EEC: + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r12, r0 + movs r3, 0xF + ldr r5, _08096F4C + mov r8, r5 + movs r4, 0x8C + lsls r4, 2 +_08096EFE: + mov r0, r8 + ldr r2, [r0] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 2 + adds r1, r2, r1 + subs r3, 0x1 + lsls r0, r3, 1 + adds r0, r3 + lsls r0, 2 + adds r2, r0 + adds r1, r4 + adds r2, r4 + ldm r2!, {r0,r6,r7} + stm r1!, {r0,r6,r7} + cmp r3, 0 + bgt _08096EFE + ldr r2, [r5] + movs r3, 0x8C + lsls r3, 2 + adds r2, r3 + mov r6, r12 + ldr r0, [r6, 0x4] + ldr r1, [r6, 0x8] + str r0, [r2] + str r1, [r2, 0x4] + mov r0, r12 + bl sub_8096EB0 + ldr r1, [r5] + movs r7, 0x8E + lsls r7, 2 + adds r1, r7 + str r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08096F4C: .4byte gUnknown_203B490 + thumb_func_end sub_8096EEC + + thumb_func_start sub_8096F50 +sub_8096F50: + push {r4-r7,lr} + adds r4, r0, 0 + bl sub_8096EB0 + mov r12, r0 + movs r5, 0 + ldr r0, _08096F8C + ldr r7, [r0] + ldrb r6, [r4, 0x4] + movs r3, 0 +_08096F64: + movs r1, 0x8C + lsls r1, 2 + adds r0, r3, r1 + adds r2, r7, r0 + ldrb r0, [r2] + cmp r0, r6 + bne _08096F90 + ldrb r0, [r2, 0x1] + ldrb r1, [r4, 0x5] + cmp r0, r1 + bne _08096F90 + ldr r1, [r2, 0x4] + ldr r0, [r4, 0x8] + cmp r1, r0 + bne _08096F90 + ldr r0, [r2, 0x8] + cmp r0, r12 + bne _08096F90 + movs r0, 0x1 + b _08096F9A + .align 2, 0 +_08096F8C: .4byte gUnknown_203B490 +_08096F90: + adds r3, 0xC + adds r5, 0x1 + cmp r5, 0xF + ble _08096F64 + movs r0, 0 +_08096F9A: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8096F50 + + thumb_func_start sub_8096FA0 +sub_8096FA0: + push {r4-r7,lr} + sub sp, 0x14 + adds r3, r0, 0 + adds r2, r1, 0 + mov r0, sp + adds r1, r3, 0 + bl sub_809485C + add r7, sp, 0x10 + ldr r6, _08097020 + movs r5, 0 + movs r4, 0x3 +_08096FB8: + ldr r1, [r6] + adds r1, r5 + mov r0, sp + bl sub_80971EC + adds r5, 0x14 + subs r4, 0x1 + cmp r4, 0 + bge _08096FB8 + ldr r6, _08097020 + movs r5, 0x50 + movs r4, 0x7 +_08096FD0: + ldr r1, [r6] + adds r1, r5 + mov r0, sp + bl sub_80971EC + adds r5, 0x14 + subs r4, 0x1 + cmp r4, 0 + bge _08096FD0 + ldr r6, _08097020 + movs r5, 0xF0 + movs r4, 0x7 +_08096FE8: + ldr r1, [r6] + adds r1, r5 + mov r0, sp + bl sub_80971EC + adds r5, 0x14 + subs r4, 0x1 + cmp r4, 0 + bge _08096FE8 + movs r4, 0 + movs r6, 0x1 + ldr r5, _08097020 +_08097000: + mov r0, sp + adds r1, r7, 0 + movs r2, 0x1 + bl sub_8094924 + ldr r1, [sp, 0x10] + ands r1, r6 + cmp r1, 0 + beq _08097024 + ldr r0, [r5] + movs r1, 0xBC + lsls r1, 2 + adds r0, r1 + adds r0, r4 + strb r6, [r0] + b _08097030 + .align 2, 0 +_08097020: .4byte gUnknown_203B490 +_08097024: + ldr r0, [r5] + movs r2, 0xBC + lsls r2, 2 + adds r0, r2 + adds r0, r4 + strb r1, [r0] +_08097030: + adds r4, 0x1 + cmp r4, 0x37 + ble _08097000 + mov r0, sp + adds r1, r7, 0 + movs r2, 0x1 + bl sub_8094924 + ldr r1, [sp, 0x10] + movs r2, 0x1 + ands r1, r2 + cmp r1, 0 + beq _0809705C + ldr r0, _08097058 + ldr r0, [r0] + movs r1, 0xCA + lsls r1, 2 + adds r0, r1 + strb r2, [r0] + b _08097068 + .align 2, 0 +_08097058: .4byte gUnknown_203B490 +_0809705C: + ldr r0, _080970D4 + ldr r0, [r0] + movs r2, 0xCA + lsls r2, 2 + adds r0, r2 + strb r1, [r0] +_08097068: + ldr r4, _080970D4 + ldr r1, [r4] + movs r0, 0xC8 + lsls r0, 1 + adds r1, r0 + movs r2, 0xA0 + lsls r2, 1 + mov r0, sp + bl sub_8094924 + ldr r1, [r4] + movs r2, 0xDC + lsls r2, 1 + adds r1, r2 + movs r2, 0xF0 + lsls r2, 2 + mov r0, sp + bl sub_8094924 + adds r6, r4, 0 + movs r5, 0x8C + lsls r5, 2 + movs r4, 0xF +_08097096: + ldr r1, [r6] + adds r1, r5 + adds r1, 0x8 + mov r0, sp + movs r2, 0x20 + bl sub_8094924 + ldr r1, [r6] + adds r1, r5 + adds r1, 0x4 + mov r0, sp + movs r2, 0x18 + bl sub_8094924 + ldr r1, [r6] + adds r1, r5 + mov r0, sp + bl sub_8090314 + adds r5, 0xC + subs r4, 0x1 + cmp r4, 0 + bge _08097096 + mov r0, sp + bl nullsub_102 + ldr r0, [sp, 0x8] + add sp, 0x14 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080970D4: .4byte gUnknown_203B490 + thumb_func_end sub_8096FA0 + + thumb_func_start sub_80970D8 +sub_80970D8: + push {r4-r7,lr} + sub sp, 0x14 + adds r3, r0, 0 + adds r2, r1, 0 + mov r0, sp + adds r1, r3, 0 + bl sub_809486C + add r7, sp, 0x10 + ldr r6, _080971E8 + movs r5, 0 + movs r4, 0x3 +_080970F0: + ldr r1, [r6] + adds r1, r5 + mov r0, sp + bl sub_8097270 + adds r5, 0x14 + subs r4, 0x1 + cmp r4, 0 + bge _080970F0 + ldr r6, _080971E8 + movs r5, 0x50 + movs r4, 0x7 +_08097108: + ldr r1, [r6] + adds r1, r5 + mov r0, sp + bl sub_8097270 + adds r5, 0x14 + subs r4, 0x1 + cmp r4, 0 + bge _08097108 + ldr r6, _080971E8 + movs r5, 0xF0 + movs r4, 0x7 +_08097120: + ldr r1, [r6] + adds r1, r5 + mov r0, sp + bl sub_8097270 + adds r5, 0x14 + subs r4, 0x1 + cmp r4, 0 + bge _08097120 + movs r4, 0 +_08097134: + ldr r0, _080971E8 + ldr r0, [r0] + movs r1, 0xBC + lsls r1, 2 + adds r0, r1 + adds r0, r4 + ldrb r0, [r0] + cmp r0, 0 + beq _0809714A + movs r0, 0x1 + negs r0, r0 +_0809714A: + str r0, [sp, 0x10] + mov r0, sp + adds r1, r7, 0 + movs r2, 0x1 + bl sub_809488C + adds r4, 0x1 + cmp r4, 0x37 + ble _08097134 + ldr r0, _080971E8 + ldr r0, [r0] + movs r1, 0xCA + lsls r1, 2 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _08097170 + movs r0, 0x1 + negs r0, r0 +_08097170: + str r0, [sp, 0x10] + mov r0, sp + adds r1, r7, 0 + movs r2, 0x1 + bl sub_809488C + ldr r4, _080971E8 + ldr r1, [r4] + movs r0, 0xC8 + lsls r0, 1 + adds r1, r0 + movs r2, 0xA0 + lsls r2, 1 + mov r0, sp + bl sub_809488C + ldr r1, [r4] + movs r0, 0xDC + lsls r0, 1 + adds r1, r0 + movs r2, 0xF0 + lsls r2, 2 + mov r0, sp + bl sub_809488C + adds r6, r4, 0 + movs r5, 0x8C + lsls r5, 2 + movs r4, 0xF +_080971AA: + ldr r1, [r6] + adds r1, r5 + adds r1, 0x8 + mov r0, sp + movs r2, 0x20 + bl sub_809488C + ldr r1, [r6] + adds r1, r5 + adds r1, 0x4 + mov r0, sp + movs r2, 0x18 + bl sub_809488C + ldr r1, [r6] + adds r1, r5 + mov r0, sp + bl sub_80902F4 + adds r5, 0xC + subs r4, 0x1 + cmp r4, 0 + bge _080971AA + mov r0, sp + bl nullsub_102 + ldr r0, [sp, 0x8] + add sp, 0x14 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080971E8: .4byte gUnknown_203B490 + thumb_func_end sub_80970D8 + + thumb_func_start sub_80971EC +sub_80971EC: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x4 + bl sub_8094924 + adds r1, r5, 0x1 + adds r0, r4, 0 + movs r2, 0x3 + bl sub_8094924 + adds r1, r5, 0x2 + adds r0, r4, 0 + movs r2, 0x4 + bl sub_8094924 + adds r1, r5, 0 + adds r1, 0xC + adds r0, r4, 0 + movs r2, 0x9 + bl sub_8094924 + adds r1, r5, 0 + adds r1, 0xE + adds r0, r4, 0 + movs r2, 0x9 + bl sub_8094924 + adds r1, r5, 0 + adds r1, 0x10 + adds r0, r4, 0 + movs r2, 0x8 + bl sub_8094924 + adds r1, r5, 0 + adds r1, 0x11 + adds r0, r4, 0 + movs r2, 0x4 + bl sub_8094924 + adds r1, r5, 0 + adds r1, 0x12 + adds r0, r4, 0 + movs r2, 0x8 + bl sub_8094924 + adds r1, r5, 0 + adds r1, 0x13 + adds r0, r4, 0 + movs r2, 0x6 + bl sub_8094924 + adds r1, r5, 0 + adds r1, 0x8 + adds r0, r4, 0 + movs r2, 0x18 + bl sub_8094924 + adds r1, r5, 0x4 + adds r0, r4, 0 + bl sub_8090314 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80971EC + + thumb_func_start sub_8097270 +sub_8097270: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r2, 0x4 + bl sub_809488C + adds r1, r5, 0x1 + adds r0, r4, 0 + movs r2, 0x3 + bl sub_809488C + adds r1, r5, 0x2 + adds r0, r4, 0 + movs r2, 0x4 + bl sub_809488C + adds r1, r5, 0 + adds r1, 0xC + adds r0, r4, 0 + movs r2, 0x9 + bl sub_809488C + adds r1, r5, 0 + adds r1, 0xE + adds r0, r4, 0 + movs r2, 0x9 + bl sub_809488C + adds r1, r5, 0 + adds r1, 0x10 + adds r0, r4, 0 + movs r2, 0x8 + bl sub_809488C + adds r1, r5, 0 + adds r1, 0x11 + adds r0, r4, 0 + movs r2, 0x4 + bl sub_809488C + adds r1, r5, 0 + adds r1, 0x12 + adds r0, r4, 0 + movs r2, 0x8 + bl sub_809488C + adds r1, r5, 0 + adds r1, 0x13 + adds r0, r4, 0 + movs r2, 0x6 + bl sub_809488C + adds r1, r5, 0 + adds r1, 0x8 + adds r0, r4, 0 + movs r2, 0x18 + bl sub_809488C + adds r1, r5, 0x4 + adds r0, r4, 0 + bl sub_80902F4 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_8097270 + + thumb_func_start sub_80972F4 +sub_80972F4: + push {lr} + movs r0, 0 + movs r1, 0x2B + bl sub_80015C0 + movs r0, 0 + movs r1, 0x2C + bl sub_80015C0 + movs r0, 0 + movs r1, 0x2D + bl sub_80015C0 + pop {r0} + bx r0 + thumb_func_end sub_80972F4 + + thumb_func_start nullsub_128 +nullsub_128: + bx lr + thumb_func_end nullsub_128 + + thumb_func_start sub_8097318 +sub_8097318: + push {lr} + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xD + bne _08097326 + movs r0, 0 + b _08097338 +_08097326: + lsls r2, r0, 16 + lsrs r2, 16 + movs r0, 0 + movs r1, 0x2B + bl sub_8001784 + cmp r0, 0 + beq _08097338 + movs r0, 0x1 +_08097338: + pop {r1} + bx r1 + thumb_func_end sub_8097318 + + thumb_func_start sub_809733C +sub_809733C: + push {r4-r6,lr} + lsls r0, 16 + asrs r4, r0, 16 + lsls r1, 24 + lsrs r6, r1, 24 + cmp r4, 0xD + beq _0809737C + lsls r0, r4, 16 + lsrs r5, r0, 16 + movs r0, 0 + movs r1, 0x2C + adds r2, r5, 0 + bl sub_8001784 + cmp r0, 0 + bne _0809737C + movs r0, 0 + movs r1, 0x2B + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_800199C + cmp r6, 0 + beq _0809737C + cmp r4, 0xE + blt _0809737C + cmp r4, 0xF + ble _08097378 + cmp r4, 0x1C + bne _0809737C +_08097378: + bl sub_809674C +_0809737C: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_809733C + + thumb_func_start sub_8097384 +sub_8097384: + push {lr} + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xD + bne _08097392 + movs r0, 0 + b _080973A4 +_08097392: + lsls r2, r0, 16 + lsrs r2, 16 + movs r0, 0 + movs r1, 0x2C + bl sub_8001784 + cmp r0, 0 + beq _080973A4 + movs r0, 0x1 +_080973A4: + pop {r1} + bx r1 + thumb_func_end sub_8097384 + + thumb_func_start sub_80973A8 +sub_80973A8: + push {r4-r6,lr} + lsls r0, 16 + asrs r0, 16 + lsls r1, 24 + lsrs r6, r1, 24 + cmp r0, 0xD + beq _080973EE + lsls r5, r0, 16 + cmp r6, 0 + beq _080973E2 + bl sub_80A26B8 + lsls r0, 16 + asrs r4, r0, 16 + lsrs r2, r5, 16 + movs r0, 0 + movs r1, 0x2B + movs r3, 0 + bl sub_800199C + movs r0, 0x1 + negs r0, r0 + cmp r4, r0 + beq _080973E2 + movs r0, 0 + movs r1, 0x12 + adds r2, r4, 0 + bl sub_80018D8 +_080973E2: + lsrs r2, r5, 16 + movs r0, 0 + movs r1, 0x2C + adds r3, r6, 0 + bl sub_800199C +_080973EE: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80973A8 + + thumb_func_start sub_80973F4 +sub_80973F4: + push {lr} + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xD + bne _08097402 + movs r0, 0 + b _08097414 +_08097402: + lsls r2, r0, 16 + lsrs r2, 16 + movs r0, 0 + movs r1, 0x2D + bl sub_8001784 + cmp r0, 0 + beq _08097414 + movs r0, 0x1 +_08097414: + pop {r1} + bx r1 + thumb_func_end sub_80973F4 + + thumb_func_start sub_8097418 +sub_8097418: + push {r4-r7,lr} + lsls r0, 16 + asrs r5, r0, 16 + lsls r1, 24 + lsrs r7, r1, 24 + cmp r5, 0xD + beq _08097470 + lsls r6, r5, 16 + cmp r7, 0 + beq _08097464 + lsrs r2, r6, 16 + movs r0, 0 + movs r1, 0x2C + movs r3, 0 + bl sub_800199C + cmp r5, 0x1E + bgt _08097464 + lsls r0, r5, 3 + ldr r1, _08097478 + adds r4, r0, r1 + ldrb r0, [r4, 0x4] + cmp r0, 0xFF + beq _0809744C + bl sub_8097FA8 +_0809744C: + ldrb r0, [r4, 0x5] + cmp r0, 0xFF + beq _08097456 + bl sub_8097FA8 +_08097456: + cmp r5, 0x9 + bne _08097460 + movs r0, 0x1F + bl sub_8097FA8 +_08097460: + bl sub_8097FF8 +_08097464: + lsrs r2, r6, 16 + movs r0, 0 + movs r1, 0x2D + adds r3, r7, 0 + bl sub_800199C +_08097470: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08097478: .4byte gUnknown_8109994 + thumb_func_end sub_8097418 + + thumb_func_start sub_809747C +sub_809747C: + push {lr} + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xD + beq _08097494 + bl sub_80A270C + lsls r0, 24 + lsrs r0, 24 + bl sub_809009C + b _08097496 +_08097494: + ldr r0, _0809749C +_08097496: + pop {r1} + bx r1 + .align 2, 0 +_0809749C: .4byte gUnknown_8109CA8 + thumb_func_end sub_809747C + + thumb_func_start sub_80974A0 +sub_80974A0: + push {lr} + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xD + beq _080974B8 + bl sub_80A270C + lsls r0, 24 + lsrs r0, 24 + bl sub_809009C + b _080974BA +_080974B8: + ldr r0, _080974C0 +_080974BA: + pop {r1} + bx r1 + .align 2, 0 +_080974C0: .4byte gUnknown_8109CA8 + thumb_func_end sub_80974A0 + + thumb_func_start sub_80974C4 +sub_80974C4: + push {lr} + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1E + ble _080974D8 + ldr r0, _080974D4 + b _080974E0 + .align 2, 0 +_080974D4: .4byte gUnknown_8109CC0 +_080974D8: + lsls r0, 3 + ldr r1, _080974E4 + adds r0, r1 + ldr r0, [r0] +_080974E0: + pop {r1} + bx r1 + .align 2, 0 +_080974E4: .4byte gUnknown_8109994 + thumb_func_end sub_80974C4 + + thumb_func_start sub_80974E8 +sub_80974E8: + push {lr} + movs r0, 0 + movs r1, 0x2E + bl sub_80015C0 + movs r0, 0 + movs r1, 0x2F + bl sub_80015C0 + pop {r0} + bx r0 + thumb_func_end sub_80974E8 + + thumb_func_start nullsub_208 +nullsub_208: + bx lr + thumb_func_end nullsub_208 + + thumb_func_start sub_8097504 +sub_8097504: + push {lr} + lsls r0, 16 + asrs r0, 16 + adds r1, r0, 0 + cmp r0, 0x10 + bgt _08097568 + cmp r0, 0xE + bhi _08097580 + lsls r0, 2 + ldr r1, _08097520 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08097520: .4byte _08097524 + .align 2, 0 +_08097524: + .4byte _08097564 + .4byte _08097564 + .4byte _08097560 + .4byte _08097580 + .4byte _08097580 + .4byte _08097564 + .4byte _08097580 + .4byte _08097564 + .4byte _08097580 + .4byte _08097564 + .4byte _08097560 + .4byte _08097560 + .4byte _08097560 + .4byte _08097574 + .4byte _08097564 +_08097560: + movs r0, 0xE + b _08097576 +_08097564: + movs r0, 0xF + b _08097576 +_08097568: + cmp r1, 0x16 + bgt _08097584 + cmp r1, 0x16 + beq _08097584 + cmp r1, 0x15 + beq _08097584 +_08097574: + movs r0, 0x6 +_08097576: + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _08097584 +_08097580: + movs r0, 0x1 + b _08097586 +_08097584: + movs r0, 0 +_08097586: + pop {r1} + bx r1 + thumb_func_end sub_8097504 + + thumb_func_start sub_809758C +sub_809758C: + push {lr} + adds r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + movs r0, 0 + movs r1, 0x2E + bl sub_8001784 + cmp r0, 0 + beq _080975A2 + movs r0, 0x1 +_080975A2: + pop {r1} + bx r1 + thumb_func_end sub_809758C + + thumb_func_start sub_80975A8 +sub_80975A8: + push {lr} + adds r2, r0, 0 + adds r3, r1, 0 + lsls r3, 24 + lsrs r3, 24 + lsls r2, 16 + lsrs r2, 16 + movs r0, 0 + movs r1, 0x2E + bl sub_800199C + pop {r0} + bx r0 + thumb_func_end sub_80975A8 + + thumb_func_start sub_80975C4 +sub_80975C4: + push {lr} + lsls r0, 16 + asrs r0, 16 + bl sub_80A2728 + lsls r0, 24 + lsrs r0, 24 + bl sub_809009C + pop {r1} + bx r1 + thumb_func_end sub_80975C4 + + thumb_func_start sub_80975DC +sub_80975DC: + push {lr} + lsls r0, 16 + ldr r1, _08097600 + adds r0, r1 + lsrs r0, 16 + cmp r0, 0x1 + bhi _08097610 + movs r2, 0x1 + negs r2, r2 + movs r0, 0x3 + movs r1, 0xE + bl sub_8001D08 + lsls r0, 24 + cmp r0, 0 + beq _08097608 + ldr r0, _08097604 + b _08097612 + .align 2, 0 +_08097600: .4byte 0xffe90000 +_08097604: .4byte gUnknown_8109CD4 +_08097608: + ldr r0, _0809760C + b _08097612 + .align 2, 0 +_0809760C: .4byte gUnknown_8109CE4 +_08097610: + ldr r0, _08097618 +_08097612: + pop {r1} + bx r1 + .align 2, 0 +_08097618: .4byte gUnknown_8109CF4 + thumb_func_end sub_80975DC + + thumb_func_start sub_809761C +sub_809761C: + push {r4,lr} + movs r4, 0 +_08097620: + lsls r0, r4, 16 + asrs r0, 16 + bl sub_809758C + lsls r0, 24 + cmp r0, 0 + bne _08097632 + movs r0, 0 + b _0809763A +_08097632: + adds r4, 0x1 + cmp r4, 0x10 + ble _08097620 + movs r0, 0x1 +_0809763A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809761C + + thumb_func_start sub_8097640 +sub_8097640: + push {lr} + movs r0, 0 + movs r1, 0x2E + movs r2, 0x1F + bl sub_8001784 + cmp r0, 0 + bne _0809766A + bl sub_809761C + lsls r0, 24 + cmp r0, 0 + beq _0809766A + movs r0, 0 + movs r1, 0x2E + movs r2, 0x1F + movs r3, 0x1 + bl sub_800199C + movs r0, 0x1 + b _0809766C +_0809766A: + movs r0, 0 +_0809766C: + pop {r1} + bx r1 + thumb_func_end sub_8097640 + + thumb_func_start sub_8097670 +sub_8097670: + ldr r1, _08097678 + ldr r0, _0809767C + str r0, [r1] + bx lr + .align 2, 0 +_08097678: .4byte gUnknown_203B494 +_0809767C: .4byte gUnknown_2039778 + thumb_func_end sub_8097670 + + thumb_func_start sub_8097680 +sub_8097680: + ldr r0, _08097684 + bx lr + .align 2, 0 +_08097684: .4byte gUnknown_2039778 + thumb_func_end sub_8097680 + + thumb_func_start sub_8097688 +sub_8097688: + ldr r3, _08097698 + ldr r2, [r3] + ldrb r1, [r0] + strb r1, [r2, 0x10] + ldr r1, [r3] + ldrb r0, [r0, 0x1] + strb r0, [r1, 0x11] + bx lr + .align 2, 0 +_08097698: .4byte gUnknown_203B494 + thumb_func_end sub_8097688 + + thumb_func_start sub_809769C +sub_809769C: + ldr r0, _080976A4 + ldr r0, [r0] + adds r0, 0x10 + bx lr + .align 2, 0 +_080976A4: .4byte gUnknown_203B494 + thumb_func_end sub_809769C + + thumb_func_start sub_80976A8 +sub_80976A8: + push {r4,lr} + ldr r3, _080976F4 + ldr r1, [r3] + movs r0, 0 + str r0, [r1] + strh r0, [r1, 0x14] + strh r0, [r1, 0x16] + strh r0, [r1, 0x18] + adds r2, r1, 0 + adds r2, 0xC0 + str r0, [r2] + str r0, [r1, 0x8] + str r0, [r1, 0xC] + movs r2, 0 + adds r4, r3, 0 + movs r3, 0 +_080976C8: + ldr r0, [r4] + lsls r1, r2, 2 + adds r0, 0x1C + adds r0, r1 + str r3, [r0] + adds r2, 0x1 + cmp r2, 0xD + ble _080976C8 + movs r2, 0 + ldr r4, _080976F4 + movs r3, 0 +_080976DE: + ldr r0, [r4] + lsls r1, r2, 2 + adds r0, 0x8C + adds r0, r1 + str r3, [r0] + adds r2, 0x1 + cmp r2, 0xC + ble _080976DE + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080976F4: .4byte gUnknown_203B494 + thumb_func_end sub_80976A8 + + thumb_func_start sub_80976F8 +sub_80976F8: + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0809770C + ldr r2, [r1] + movs r1, 0x1 + lsls r1, r0 + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] + bx lr + .align 2, 0 +_0809770C: .4byte gUnknown_203B494 + thumb_func_end sub_80976F8 + + thumb_func_start sub_8097710 +sub_8097710: + push {lr} + lsls r0, 24 + lsrs r0, 24 + ldr r1, _0809772C + ldr r2, [r1] + movs r1, 0x1 + lsls r1, r0 + ldr r0, [r2] + ands r0, r1 + cmp r0, 0 + bne _08097730 + movs r0, 0 + b _08097732 + .align 2, 0 +_0809772C: .4byte gUnknown_203B494 +_08097730: + movs r0, 0x1 +_08097732: + pop {r1} + bx r1 + thumb_func_end sub_8097710 + + thumb_func_start sub_8097738 +sub_8097738: + lsls r0, 24 + ldr r1, _08097744 + lsrs r0, 22 + adds r0, r1 + ldr r0, [r0] + bx lr + .align 2, 0 +_08097744: .4byte gUnknown_810B04C + thumb_func_end sub_8097738 + + thumb_func_start sub_8097748 +sub_8097748: + ldr r0, _08097754 + ldr r1, [r0] + movs r0, 0 + str r0, [r1, 0x4] + bx lr + .align 2, 0 +_08097754: .4byte gUnknown_203B494 + thumb_func_end sub_8097748 + + thumb_func_start sub_8097758 +sub_8097758: + push {lr} + ldr r0, _08097770 + ldr r1, [r0] + ldr r0, [r1, 0x4] + adds r0, 0x1 + str r0, [r1, 0x4] + ldr r2, _08097774 + cmp r0, r2 + ble _0809776C + str r2, [r1, 0x4] +_0809776C: + pop {r0} + bx r0 + .align 2, 0 +_08097770: .4byte gUnknown_203B494 +_08097774: .4byte 0x0001869f + thumb_func_end sub_8097758 + + thumb_func_start sub_8097778 +sub_8097778: + ldr r0, _08097780 + ldr r0, [r0] + ldr r0, [r0, 0x4] + bx lr + .align 2, 0 +_08097780: .4byte gUnknown_203B494 + thumb_func_end sub_8097778 + + thumb_func_start sub_8097784 +sub_8097784: + ldr r1, _0809778C + ldr r1, [r1] + str r0, [r1, 0x4] + bx lr + .align 2, 0 +_0809778C: .4byte gUnknown_203B494 + thumb_func_end sub_8097784 + + thumb_func_start sub_8097790 +sub_8097790: + push {lr} + ldr r0, _080977B0 + ldr r1, [r0] + ldr r0, [r1, 0x8] + adds r0, 0x1 + str r0, [r1, 0x8] + ldr r2, _080977B4 + cmp r0, r2 + ble _080977A4 + str r2, [r1, 0x8] +_080977A4: + movs r0, 0x8 + bl sub_80976F8 + pop {r0} + bx r0 + .align 2, 0 +_080977B0: .4byte gUnknown_203B494 +_080977B4: .4byte 0x0001869f + thumb_func_end sub_8097790 + + thumb_func_start sub_80977B8 +sub_80977B8: + ldr r0, _080977C0 + ldr r0, [r0] + ldr r0, [r0, 0x8] + bx lr + .align 2, 0 +_080977C0: .4byte gUnknown_203B494 + thumb_func_end sub_80977B8 + + thumb_func_start sub_80977C4 +sub_80977C4: + ldr r1, _080977CC + ldr r1, [r1] + str r0, [r1, 0x8] + bx lr + .align 2, 0 +_080977CC: .4byte gUnknown_203B494 + thumb_func_end sub_80977C4 + + thumb_func_start sub_80977D0 +sub_80977D0: + push {lr} + ldr r0, _080977F0 + ldr r1, [r0] + ldr r0, [r1, 0xC] + adds r0, 0x1 + str r0, [r1, 0xC] + ldr r2, _080977F4 + cmp r0, r2 + ble _080977E4 + str r2, [r1, 0xC] +_080977E4: + movs r0, 0x9 + bl sub_80976F8 + pop {r0} + bx r0 + .align 2, 0 +_080977F0: .4byte gUnknown_203B494 +_080977F4: .4byte 0x0001869f + thumb_func_end sub_80977D0 + + thumb_func_start sub_80977F8 +sub_80977F8: + ldr r0, _08097800 + ldr r0, [r0] + ldr r0, [r0, 0xC] + bx lr + .align 2, 0 +_08097800: .4byte gUnknown_203B494 + thumb_func_end sub_80977F8 + + thumb_func_start sub_8097804 +sub_8097804: + ldr r1, _0809780C + ldr r1, [r1] + str r0, [r1, 0xC] + bx lr + .align 2, 0 +_0809780C: .4byte gUnknown_203B494 + thumb_func_end sub_8097804 + + thumb_func_start sub_8097810 +sub_8097810: + push {lr} + ldr r0, _08097830 + ldr r2, [r0] + ldrh r3, [r2, 0x14] + movs r0, 0x14 + ldrsh r1, [r2, r0] + ldr r0, _08097834 + cmp r1, r0 + bgt _08097826 + adds r0, r3, 0x1 + strh r0, [r2, 0x14] +_08097826: + movs r0, 0xB + bl sub_80976F8 + pop {r0} + bx r0 + .align 2, 0 +_08097830: .4byte gUnknown_203B494 +_08097834: .4byte 0x0000270e + thumb_func_end sub_8097810 + + thumb_func_start sub_8097838 +sub_8097838: + ldr r0, _08097844 + ldr r0, [r0] + movs r1, 0x14 + ldrsh r0, [r0, r1] + bx lr + .align 2, 0 +_08097844: .4byte gUnknown_203B494 + thumb_func_end sub_8097838 + + thumb_func_start sub_8097848 +sub_8097848: + push {lr} + ldr r0, _08097868 + ldr r2, [r0] + ldrh r3, [r2, 0x16] + movs r0, 0x16 + ldrsh r1, [r2, r0] + ldr r0, _0809786C + cmp r1, r0 + bgt _0809785E + adds r0, r3, 0x1 + strh r0, [r2, 0x16] +_0809785E: + movs r0, 0xA + bl sub_80976F8 + pop {r0} + bx r0 + .align 2, 0 +_08097868: .4byte gUnknown_203B494 +_0809786C: .4byte 0x0000270e + thumb_func_end sub_8097848 + + thumb_func_start sub_8097870 +sub_8097870: + ldr r0, _0809787C + ldr r0, [r0] + movs r1, 0x16 + ldrsh r0, [r0, r1] + bx lr + .align 2, 0 +_0809787C: .4byte gUnknown_203B494 + thumb_func_end sub_8097870 + + thumb_func_start sub_8097880 +sub_8097880: + ldr r0, _0809788C + ldr r0, [r0] + movs r1, 0x18 + ldrsh r0, [r0, r1] + bx lr + .align 2, 0 +_0809788C: .4byte gUnknown_203B494 + thumb_func_end sub_8097880 + + thumb_func_start sub_8097890 +sub_8097890: + push {lr} + ldr r0, _080978B0 + ldr r0, [r0] + adds r2, r0, 0 + adds r2, 0xC0 + ldr r1, [r2] + ldr r0, _080978B4 + cmp r1, r0 + bgt _080978A6 + adds r0, r1, 0x1 + str r0, [r2] +_080978A6: + movs r0, 0xC + bl sub_80976F8 + pop {r0} + bx r0 + .align 2, 0 +_080978B0: .4byte gUnknown_203B494 +_080978B4: .4byte 0x0001869e + thumb_func_end sub_8097890 + + thumb_func_start sub_80978B8 +sub_80978B8: + ldr r0, _080978C4 + ldr r0, [r0] + adds r0, 0xC0 + movs r1, 0 + ldrsh r0, [r0, r1] + bx lr + .align 2, 0 +_080978C4: .4byte gUnknown_203B494 + thumb_func_end sub_80978B8 + + thumb_func_start sub_80978C8 +sub_80978C8: + push {lr} + lsls r0, 16 + asrs r0, 16 + bl sub_808E858 + lsls r0, 16 + asrs r3, r0, 16 + ldr r0, _080978FC + ldr r2, [r0] + adds r0, r3, 0 + cmp r3, 0 + bge _080978E2 + adds r0, 0x1F +_080978E2: + asrs r0, 5 + lsls r1, r0, 2 + adds r2, 0x54 + adds r2, r1 + lsls r0, 5 + subs r0, r3, r0 + movs r1, 0x1 + lsls r1, r0 + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] + pop {r0} + bx r0 + .align 2, 0 +_080978FC: .4byte gUnknown_203B494 + thumb_func_end sub_80978C8 + + thumb_func_start sub_8097900 +sub_8097900: + push {lr} + lsls r0, 16 + asrs r0, 16 + bl sub_808E858 + lsls r0, 16 + asrs r3, r0, 16 + ldr r0, _08097938 + ldr r2, [r0] + adds r0, r3, 0 + cmp r3, 0 + bge _0809791A + adds r0, 0x1F +_0809791A: + asrs r0, 5 + lsls r1, r0, 2 + adds r2, 0x1C + adds r2, r1 + lsls r0, 5 + subs r0, r3, r0 + movs r1, 0x1 + lsls r1, r0 + ldr r0, [r2] + ands r0, r1 + cmp r0, 0 + bne _0809793C + movs r0, 0 + b _0809793E + .align 2, 0 +_08097938: .4byte gUnknown_203B494 +_0809793C: + movs r0, 0x1 +_0809793E: + pop {r1} + bx r1 + thumb_func_end sub_8097900 + + thumb_func_start sub_8097944 +sub_8097944: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + movs r0, 0x1 + str r0, [sp] + movs r1, 0x1 + str r1, [sp, 0x4] + movs r0, 0xD + bl sub_8097710 + lsls r0, 24 + cmp r0, 0 + bne _08097974 + bl sub_8092614 + lsls r0, 24 + cmp r0, 0 + beq _08097974 + movs r0, 0xD + bl sub_80976F8 +_08097974: + movs r4, 0 + ldr r0, _08097B5C + mov r10, r0 + mov r8, r4 +_0809797C: + ldr r1, _08097B60 + ldr r0, [r1] + mov r1, r8 + adds r2, r1, r0 + ldrb r1, [r2] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080979F6 + movs r0, 0x8 + ldrsh r3, [r2, r0] + mov r1, r10 + ldr r2, [r1] + adds r0, r3, 0 + cmp r3, 0 + bge _0809799E + adds r0, 0x1F +_0809799E: + asrs r0, 5 + lsls r1, r0, 2 + adds r2, 0x1C + adds r2, r1 + lsls r0, 5 + subs r0, r3, r0 + movs r1, 0x1 + lsls r1, r0 + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] + ldr r0, _08097B60 + mov r9, r0 + mov r12, r8 + movs r7, 0x1 + movs r6, 0x2C + movs r5, 0x3 +_080979C0: + mov r1, r9 + ldr r0, [r1] + add r0, r12 + adds r3, r0, r6 + ldrb r1, [r3] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _080979EE + mov r0, r10 + ldr r2, [r0] + ldrh r3, [r3, 0x2] + lsrs r0, r3, 5 + lsls r0, 2 + adds r2, 0x8C + adds r2, r0 + movs r0, 0x1F + ands r3, r0 + adds r1, r7, 0 + lsls r1, r3 + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] +_080979EE: + adds r6, 0x8 + subs r5, 0x1 + cmp r5, 0 + bge _080979C0 +_080979F6: + movs r1, 0x58 + add r8, r1 + adds r4, 0x1 + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + ble _0809797C + movs r4, 0 + ldr r1, _08097B64 +_08097A08: + cmp r4, 0 + bne _08097A0E + b _08097B80 +_08097A0E: + ldr r0, _08097B68 + cmp r4, r0 + bne _08097A16 + b _08097B80 +_08097A16: + adds r0, 0x1 + cmp r4, r0 + bne _08097A1E + b _08097B80 +_08097A1E: + adds r0, 0x1 + cmp r4, r0 + bne _08097A26 + b _08097B80 +_08097A26: + adds r0, 0x26 + cmp r4, r0 + bne _08097A2E + b _08097B80 +_08097A2E: + adds r0, 0x1 + cmp r4, r0 + bne _08097A36 + b _08097B80 +_08097A36: + adds r0, 0x1 + cmp r4, r0 + bne _08097A3E + b _08097B80 +_08097A3E: + adds r0, 0x1 + cmp r4, r0 + bne _08097A46 + b _08097B80 +_08097A46: + adds r0, 0x1 + cmp r4, r0 + bne _08097A4E + b _08097B80 +_08097A4E: + adds r0, 0x1 + cmp r4, r0 + bne _08097A56 + b _08097B80 +_08097A56: + cmp r4, r1 + bne _08097A5C + b _08097B80 +_08097A5C: + ldr r0, _08097B5C + ldr r5, [r0] + adds r0, r4, 0 + cmp r4, 0 + bge _08097A68 + adds r0, 0x1F +_08097A68: + asrs r0, 5 + lsls r3, r0, 2 + adds r1, r5, 0 + adds r1, 0x54 + adds r1, r3 + lsls r0, 5 + subs r0, r4, r0 + movs r2, 0x1 + lsls r2, r0 + ldr r0, [r1] + ands r0, r2 + cmp r0, 0 + bne _08097A86 + movs r0, 0 + str r0, [sp, 0x4] +_08097A86: + adds r0, r5, 0 + adds r0, 0x1C + adds r0, r3 + ldr r0, [r0] + ands r0, r2 + cmp r0, 0 + beq _08097B7C + cmp r4, 0x92 + bne _08097A9E + movs r0, 0x10 + bl sub_80976F8 +_08097A9E: + cmp r4, 0x91 + bne _08097AA8 + movs r0, 0x11 + bl sub_80976F8 +_08097AA8: + cmp r4, 0x90 + bne _08097AB2 + movs r0, 0x12 + bl sub_80976F8 +_08097AB2: + movs r0, 0xCF + lsls r0, 1 + cmp r4, r0 + bne _08097AC0 + movs r0, 0x13 + bl sub_80976F8 +_08097AC0: + ldr r0, _08097B6C + cmp r4, r0 + bne _08097ACC + movs r0, 0x14 + bl sub_80976F8 +_08097ACC: + movs r0, 0x86 + lsls r0, 1 + cmp r4, r0 + bne _08097ADA + movs r0, 0x15 + bl sub_80976F8 +_08097ADA: + movs r0, 0x87 + lsls r0, 1 + cmp r4, r0 + bne _08097AE8 + movs r0, 0x16 + bl sub_80976F8 +_08097AE8: + ldr r0, _08097B70 + cmp r4, r0 + bne _08097AF4 + movs r0, 0x17 + bl sub_80976F8 +_08097AF4: + movs r0, 0xCD + lsls r0, 1 + cmp r4, r0 + bne _08097B02 + movs r0, 0x18 + bl sub_80976F8 +_08097B02: + ldr r0, _08097B74 + cmp r4, r0 + bne _08097B0E + movs r0, 0x19 + bl sub_80976F8 +_08097B0E: + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + bne _08097B1C + movs r0, 0x1A + bl sub_80976F8 +_08097B1C: + movs r0, 0x89 + lsls r0, 1 + cmp r4, r0 + bne _08097B2A + movs r0, 0x1B + bl sub_80976F8 +_08097B2A: + movs r0, 0x8A + lsls r0, 1 + cmp r4, r0 + bne _08097B38 + movs r0, 0x1C + bl sub_80976F8 +_08097B38: + cmp r4, 0x97 + bne _08097B42 + movs r0, 0x1D + bl sub_80976F8 +_08097B42: + cmp r4, 0x96 + bne _08097B4C + movs r0, 0x1E + bl sub_80976F8 +_08097B4C: + ldr r0, _08097B78 + cmp r4, r0 + bne _08097B80 + movs r0, 0x1F + bl sub_80976F8 + b _08097B80 + .align 2, 0 +_08097B5C: .4byte gUnknown_203B494 +_08097B60: .4byte gUnknown_203B45C +_08097B64: .4byte 0x000001a7 +_08097B68: .4byte 0x00000179 +_08097B6C: .4byte 0x0000010d +_08097B70: .4byte 0x00000113 +_08097B74: .4byte 0x0000019b +_08097B78: .4byte 0x0000019d +_08097B7C: + movs r1, 0 + str r1, [sp] +_08097B80: + adds r4, 0x1 + ldr r1, _08097C0C + cmp r4, r1 + bgt _08097B8A + b _08097A08 +_08097B8A: + ldr r0, [sp] + cmp r0, 0 + beq _08097B96 + movs r0, 0xF + bl sub_80976F8 +_08097B96: + ldr r1, [sp, 0x4] + cmp r1, 0 + beq _08097BA2 + movs r0, 0xE + bl sub_80976F8 +_08097BA2: + movs r3, 0 + movs r4, 0 +_08097BA6: + cmp r4, 0 + beq _08097BE2 + ldr r0, _08097C10 + cmp r4, r0 + beq _08097BE2 + adds r0, 0x1 + cmp r4, r0 + beq _08097BE2 + adds r0, 0x1 + cmp r4, r0 + beq _08097BE2 + ldr r0, _08097C14 + ldr r2, [r0] + adds r0, r4, 0 + cmp r4, 0 + bge _08097BC8 + adds r0, 0x1F +_08097BC8: + asrs r0, 5 + lsls r1, r0, 2 + adds r2, 0x8C + adds r2, r1 + lsls r0, 5 + subs r0, r4, r0 + movs r1, 0x1 + lsls r1, r0 + ldr r0, [r2] + ands r0, r1 + cmp r0, 0 + beq _08097BE2 + adds r3, 0x1 +_08097BE2: + adds r4, 0x1 + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + ble _08097BA6 + cmp r3, 0 + beq _08097BFC + ldr r0, _08097C14 + ldr r0, [r0] + strh r3, [r0, 0x18] + movs r0, 0x7 + bl sub_80976F8 +_08097BFC: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08097C0C: .4byte 0x000001a7 +_08097C10: .4byte 0x00000163 +_08097C14: .4byte gUnknown_203B494 + thumb_func_end sub_8097944 + + thumb_func_start sub_8097C18 +sub_8097C18: + push {r4-r6,lr} + adds r5, r0, 0 + bl sub_8097944 + ldr r4, _08097CBC + ldr r1, [r4] + adds r1, 0x4 + adds r0, r5, 0 + movs r2, 0x11 + bl sub_809488C + ldr r1, [r4] + adds r1, 0x8 + adds r0, r5, 0 + movs r2, 0x11 + bl sub_809488C + ldr r1, [r4] + adds r1, 0xC + adds r0, r5, 0 + movs r2, 0x11 + bl sub_809488C + ldr r1, [r4] + adds r0, r5, 0 + movs r2, 0x20 + bl sub_809488C + ldr r1, [r4] + adds r1, 0x14 + adds r0, r5, 0 + movs r2, 0xE + bl sub_809488C + ldr r1, [r4] + adds r1, 0x16 + adds r0, r5, 0 + movs r2, 0xE + bl sub_809488C + ldr r1, [r4] + adds r1, 0x18 + adds r0, r5, 0 + movs r2, 0x9 + bl sub_809488C + ldr r1, [r4] + adds r1, 0xC0 + adds r0, r5, 0 + movs r2, 0x11 + bl sub_809488C + ldr r1, [r4] + adds r1, 0x1C + movs r6, 0xE0 + lsls r6, 1 + adds r0, r5, 0 + adds r2, r6, 0 + bl sub_809488C + ldr r1, [r4] + adds r1, 0x54 + adds r0, r5, 0 + adds r2, r6, 0 + bl sub_809488C + ldr r1, [r4] + adds r1, 0x8C + movs r2, 0xD0 + lsls r2, 1 + adds r0, r5, 0 + bl sub_809488C + ldr r1, [r4] + adds r1, 0x10 + adds r0, r5, 0 + bl sub_80902F4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08097CBC: .4byte gUnknown_203B494 + thumb_func_end sub_8097C18 + + thumb_func_start sub_8097CC0 +sub_8097CC0: + push {r4-r6,lr} + adds r5, r0, 0 + ldr r4, _08097D5C + ldr r1, [r4] + adds r1, 0x4 + movs r2, 0x11 + bl sub_8094924 + ldr r1, [r4] + adds r1, 0x8 + adds r0, r5, 0 + movs r2, 0x11 + bl sub_8094924 + ldr r1, [r4] + adds r1, 0xC + adds r0, r5, 0 + movs r2, 0x11 + bl sub_8094924 + ldr r1, [r4] + adds r0, r5, 0 + movs r2, 0x20 + bl sub_8094924 + ldr r1, [r4] + adds r1, 0x14 + adds r0, r5, 0 + movs r2, 0xE + bl sub_8094924 + ldr r1, [r4] + adds r1, 0x16 + adds r0, r5, 0 + movs r2, 0xE + bl sub_8094924 + ldr r1, [r4] + adds r1, 0x18 + adds r0, r5, 0 + movs r2, 0x9 + bl sub_8094924 + ldr r1, [r4] + adds r1, 0xC0 + adds r0, r5, 0 + movs r2, 0x11 + bl sub_8094924 + ldr r1, [r4] + adds r1, 0x1C + movs r6, 0xE0 + lsls r6, 1 + adds r0, r5, 0 + adds r2, r6, 0 + bl sub_8094924 + ldr r1, [r4] + adds r1, 0x54 + adds r0, r5, 0 + adds r2, r6, 0 + bl sub_8094924 + ldr r1, [r4] + adds r1, 0x8C + movs r2, 0xD0 + lsls r2, 1 + adds r0, r5, 0 + bl sub_8094924 + ldr r1, [r4] + adds r1, 0x10 + adds r0, r5, 0 + bl sub_8090314 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08097D5C: .4byte gUnknown_203B494 + thumb_func_end sub_8097CC0 + + thumb_func_start sub_8097D60 +sub_8097D60: + push {lr} + sub sp, 0x10 + adds r3, r0, 0 + adds r2, r1, 0 + mov r0, sp + adds r1, r3, 0 + bl sub_809486C + mov r0, sp + bl sub_8094A44 + mov r0, sp + bl sub_8095044 + mov r0, sp + bl sub_8097C18 + mov r0, sp + bl sub_8098248 + mov r0, sp + bl nullsub_102 + ldr r0, [sp, 0x8] + add sp, 0x10 + pop {r1} + bx r1 + thumb_func_end sub_8097D60 + + thumb_func_start sub_8097D98 +sub_8097D98: + push {lr} + sub sp, 0x10 + adds r3, r0, 0 + adds r2, r1, 0 + mov r0, sp + adds r1, r3, 0 + bl sub_809485C + mov r0, sp + bl sub_8094B18 + mov r0, sp + bl sub_8095080 + mov r0, sp + bl sub_8097CC0 + mov r0, sp + bl sub_8098308 + mov r0, sp + bl nullsub_102 + ldr r0, [sp, 0x8] + add sp, 0x10 + pop {r1} + bx r1 + thumb_func_end sub_8097D98 + + thumb_func_start sub_8097DD0 +sub_8097DD0: + push {lr} + adds r2, r0, 0 + adds r3, r1, 0 + ldr r1, [r2] + ldr r0, [r3] + cmp r1, r0 + bne _08097DEA + ldr r1, [r2, 0x4] + ldr r0, [r3, 0x4] + cmp r1, r0 + bne _08097DEA + movs r0, 0x1 + b _08097DEC +_08097DEA: + movs r0, 0 +_08097DEC: + pop {r1} + bx r1 + thumb_func_end sub_8097DD0 + + thumb_func_start sub_8097DF0 +sub_8097DF0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1F8 + mov r8, r0 + str r1, [sp, 0x1F0] + movs r0, 0 + mov r9, r0 + movs r7, 0 + ldr r1, _08097E3C + ldr r0, [r1] + cmp r0, 0 + beq _08097E6E +_08097E0E: + movs r4, 0 + lsls r5, r7, 3 + lsls r1, r7, 2 + mov r10, r1 + adds r6, r7, 0x1 + ldr r2, _08097E3C + adds r3, r5, r2 + add r1, sp, 0x18C +_08097E1E: + ldr r0, [r3] + adds r0, r4 + ldrb r2, [r0] + cmp r2, 0x23 + bne _08097E40 + ldrb r0, [r0, 0x1] + cmp r0, 0x72 + bne _08097E40 + strb r2, [r1] + adds r1, 0x1 + strb r0, [r1] + adds r1, 0x1 + movs r0, 0 + strb r0, [r1] + b _08097E50 + .align 2, 0 +_08097E3C: .4byte gUnknown_810E074 +_08097E40: + ldr r0, [r3] + adds r0, r4 + ldrb r0, [r0] + strb r0, [r1] + adds r1, 0x1 + adds r4, 0x1 + cmp r4, 0x63 + ble _08097E1E +_08097E50: + add r0, sp, 0x18C + bl strlen + mov r1, sp + add r1, r10 + str r0, [r1] + adds r7, r6, 0 + cmp r6, 0x62 + bgt _08097E6E + lsls r0, r6, 3 + ldr r1, _08097EB4 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + bne _08097E0E +_08097E6E: + mov r2, r8 + ldrb r0, [r2] + cmp r0, 0 + beq _08097F2C + ldr r3, _08097EB4 +_08097E78: + cmp r0, 0x23 + bne _08097F08 + movs r7, 0 + adds r1, r3, 0 + ldr r0, [r1] + cmp r0, 0 + beq _08097F20 + mov r2, r9 + lsls r0, r2, 2 + ldr r2, [sp, 0x1F0] + adds r0, r2 + mov r10, r0 +_08097E90: + lsls r4, r7, 3 + adds r0, r4, r1 + ldr r0, [r0] + lsls r1, r7, 2 + add r1, sp + ldr r2, [r1] + mov r1, r8 + str r3, [sp, 0x1F4] + bl sub_800B2D4 + lsls r0, 24 + adds r5, r4, 0 + adds r6, r7, 0x1 + ldr r3, [sp, 0x1F4] + cmp r0, 0 + bne _08097EF0 + movs r4, 0 + b _08097EBA + .align 2, 0 +_08097EB4: .4byte gUnknown_810E074 +_08097EB8: + adds r4, 0x1 +_08097EBA: + cmp r4, r9 + bge _08097ED6 + adds r0, r5, r3 + lsls r1, r4, 2 + ldr r2, [sp, 0x1F0] + adds r1, r2 + ldr r1, [r1] + str r3, [sp, 0x1F4] + bl sub_8097DD0 + lsls r0, 24 + ldr r3, [sp, 0x1F4] + cmp r0, 0 + beq _08097EB8 +_08097ED6: + cmp r4, r9 + bne _08097EF0 + mov r0, r9 + cmp r0, 0x3 + bgt _08097EF0 + adds r0, r5, r3 + mov r1, r10 + adds r1, 0x4 + mov r10, r1 + subs r1, 0x4 + stm r1!, {r0} + movs r2, 0x1 + add r9, r2 +_08097EF0: + adds r7, r6, 0 + cmp r6, 0x62 + bgt _08097F20 + ldr r1, _08097F04 + lsls r0, r6, 3 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + bne _08097E90 + b _08097F20 + .align 2, 0 +_08097F04: .4byte gUnknown_810E074 +_08097F08: + mov r0, r8 + ldrb r1, [r0] + adds r0, r1, 0 + adds r0, 0x7F + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bls _08097F1C + cmp r1, 0x87 + bne _08097F20 +_08097F1C: + movs r1, 0x1 + add r8, r1 +_08097F20: + movs r2, 0x1 + add r8, r2 + mov r1, r8 + ldrb r0, [r1] + cmp r0, 0 + bne _08097E78 +_08097F2C: + mov r0, r9 + add sp, 0x1F8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8097DF0 + + thumb_func_start sub_8097F40 +sub_8097F40: + push {lr} + movs r2, 0 + ldr r1, _08097F58 + adds r0, r1 + ldrb r0, [r0] + cmp r0, 0x2 + bne _08097F50 + movs r2, 0x1 +_08097F50: + adds r0, r2, 0 + pop {r1} + bx r1 + .align 2, 0 +_08097F58: .4byte gUnknown_810ACC0 + thumb_func_end sub_8097F40 + + thumb_func_start sub_8097F5C +sub_8097F5C: + ldr r1, _08097F64 + ldr r0, _08097F68 + str r0, [r1] + bx lr + .align 2, 0 +_08097F64: .4byte gUnknown_203B498 +_08097F68: .4byte gUnknown_2039840 + thumb_func_end sub_8097F5C + + thumb_func_start sub_8097F6C +sub_8097F6C: + ldr r0, _08097F70 + bx lr + .align 2, 0 +_08097F70: .4byte gUnknown_2039840 + thumb_func_end sub_8097F6C + + thumb_func_start sub_8097F74 +sub_8097F74: + push {r4,lr} + ldr r4, _08097FA0 + ldr r0, [r4] + movs r1, 0 + movs r2, 0x64 + bl memset + movs r2, 0 + ldr r3, _08097FA4 +_08097F86: + ldr r0, [r4] + adds r0, 0x58 + adds r0, r2 + ldrb r1, [r3, 0x2] + strb r1, [r0] + adds r3, 0x4 + adds r2, 0x1 + cmp r2, 0xB + ble _08097F86 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08097FA0: .4byte gUnknown_203B498 +_08097FA4: .4byte gUnknown_810AD0C + thumb_func_end sub_8097F74 + + thumb_func_start sub_8097FA8 +sub_8097FA8: + lsls r0, 24 + ldr r1, _08097FCC + ldr r3, [r1] + lsrs r1, r0, 29 + lsls r1, 2 + adds r3, 0x48 + adds r3, r1 + movs r1, 0xF8 + lsls r1, 21 + ands r1, r0 + lsrs r1, 24 + movs r2, 0x1 + lsls r2, r1 + ldr r0, [r3] + orrs r0, r2 + str r0, [r3] + bx lr + .align 2, 0 +_08097FCC: .4byte gUnknown_203B498 + thumb_func_end sub_8097FA8 + + thumb_func_start sub_8097FD0 +sub_8097FD0: + lsls r0, 24 + ldr r1, _08097FF4 + ldr r3, [r1] + lsrs r1, r0, 29 + lsls r1, 2 + adds r3, 0x3C + adds r3, r1 + movs r1, 0xF8 + lsls r1, 21 + ands r1, r0 + lsrs r1, 24 + movs r2, 0x1 + lsls r2, r1 + ldr r0, [r3] + orrs r0, r2 + str r0, [r3] + bx lr + .align 2, 0 +_08097FF4: .4byte gUnknown_203B498 + thumb_func_end sub_8097FD0 + + thumb_func_start sub_8097FF8 +sub_8097FF8: + push {r4-r7,lr} + movs r4, 0 + ldr r6, _08098040 + movs r7, 0x1 +_08098000: + ldr r5, [r6] + adds r0, r4, 0 + cmp r4, 0 + bge _0809800A + adds r0, 0x1F +_0809800A: + asrs r0, 5 + lsls r3, r0, 2 + adds r1, r5, 0 + adds r1, 0x48 + adds r1, r3 + lsls r0, 5 + subs r0, r4, r0 + adds r2, r7, 0 + lsls r2, r0 + ldr r0, [r1] + ands r0, r2 + cmp r0, 0 + beq _08098030 + adds r1, r5, 0 + adds r1, 0x3C + adds r1, r3 + ldr r0, [r1] + orrs r0, r2 + str r0, [r1] +_08098030: + adds r4, 0x1 + cmp r4, 0x3F + ble _08098000 + bl sub_8098080 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08098040: .4byte gUnknown_203B498 + thumb_func_end sub_8097FF8 + + thumb_func_start sub_8098044 +sub_8098044: + push {r4,r5,lr} + lsls r0, 24 + ldr r1, _0809807C + ldr r3, [r1] + lsrs r5, r0, 29 + lsls r5, 2 + adds r4, r3, 0 + adds r4, 0x3C + adds r4, r5 + movs r1, 0xF8 + lsls r1, 21 + ands r1, r0 + lsrs r1, 24 + movs r2, 0x1 + lsls r2, r1 + mvns r2, r2 + ldr r0, [r4] + ands r0, r2 + str r0, [r4] + adds r3, 0x48 + adds r3, r5 + ldr r0, [r3] + ands r0, r2 + str r0, [r3] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0809807C: .4byte gUnknown_203B498 + thumb_func_end sub_8098044 + + thumb_func_start sub_8098080 +sub_8098080: + push {r4,lr} + movs r2, 0 + ldr r4, _080980A0 + movs r3, 0 +_08098088: + ldr r0, [r4] + lsls r1, r2, 2 + adds r0, 0x48 + adds r0, r1 + str r3, [r0] + adds r2, 0x1 + cmp r2, 0x2 + ble _08098088 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080980A0: .4byte gUnknown_203B498 + thumb_func_end sub_8098080 + + thumb_func_start sub_80980A4 +sub_80980A4: + ldr r0, _080980B0 + ldr r2, [r0] + ldrb r0, [r2] + movs r1, 0x1 + strb r1, [r2] + bx lr + .align 2, 0 +_080980B0: .4byte gUnknown_203B498 + thumb_func_end sub_80980A4 + + thumb_func_start sub_80980B4 +sub_80980B4: + push {lr} + lsls r0, 16 + asrs r1, r0, 16 + adds r3, r1, 0 + ldr r0, _080980F8 + cmp r1, r0 + beq _080980F4 + adds r0, 0x1 + cmp r1, r0 + beq _080980F4 + adds r0, 0x1 + cmp r1, r0 + beq _080980F4 + ldr r0, _080980FC + ldr r2, [r0] + adds r0, r1, 0 + cmp r1, 0 + bge _080980DA + adds r0, 0x1F +_080980DA: + asrs r0, 5 + lsls r1, r0, 2 + adds r2, 0x4 + adds r2, r1 + lsls r0, 5 + subs r0, r3, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + lsls r1, r0 + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] +_080980F4: + pop {r0} + bx r0 + .align 2, 0 +_080980F8: .4byte 0x000001a5 +_080980FC: .4byte gUnknown_203B498 + thumb_func_end sub_80980B4 + + thumb_func_start sub_8098100 +sub_8098100: + push {lr} + lsls r1, r0, 24 + lsrs r3, r1, 24 + cmp r3, 0x3F + bls _0809810E + movs r0, 0 + b _0809812C +_0809810E: + ldr r0, _08098130 + ldr r2, [r0] + lsrs r0, r1, 29 + lsls r0, 2 + adds r2, 0x3C + adds r2, r0 + movs r0, 0x1F + ands r0, r3 + movs r1, 0x1 + lsls r1, r0 + ldr r0, [r2] + ands r0, r1 + cmp r0, 0 + beq _0809812C + movs r0, 0x1 +_0809812C: + pop {r1} + bx r1 + .align 2, 0 +_08098130: .4byte gUnknown_203B498 + thumb_func_end sub_8098100 + + thumb_func_start sub_8098134 +sub_8098134: + push {lr} + lsls r0, 16 + asrs r1, r0, 16 + adds r3, r1, 0 + ldr r0, _0809816C + ldr r2, [r0] + adds r0, r1, 0 + cmp r1, 0 + bge _08098148 + adds r0, 0x1F +_08098148: + asrs r0, 5 + lsls r1, r0, 2 + adds r2, 0x4 + adds r2, r1 + lsls r0, 5 + subs r0, r3, r0 + lsls r0, 16 + asrs r0, 16 + movs r1, 0x1 + lsls r1, r0 + ldr r0, [r2] + ands r0, r1 + cmp r0, 0 + beq _08098166 + movs r0, 0x1 +_08098166: + pop {r1} + bx r1 + .align 2, 0 +_0809816C: .4byte gUnknown_203B498 + thumb_func_end sub_8098134 + + thumb_func_start sub_8098170 +sub_8098170: + push {lr} + adds r3, r0, 0 + ldr r0, _0809819C + ldr r2, [r0] + adds r0, r3, 0 + cmp r3, 0 + bge _08098180 + adds r0, 0x1F +_08098180: + asrs r0, 5 + lsls r1, r0, 2 + adds r2, 0x54 + adds r2, r1 + lsls r0, 5 + subs r0, r3, r0 + movs r1, 0x1 + lsls r1, r0 + ldr r0, [r2] + orrs r0, r1 + str r0, [r2] + pop {r0} + bx r0 + .align 2, 0 +_0809819C: .4byte gUnknown_203B498 + thumb_func_end sub_8098170 + + thumb_func_start sub_80981A0 +sub_80981A0: + push {lr} + adds r3, r0, 0 + cmp r3, 0x1E + ble _080981AC + movs r0, 0 + b _080981D4 +_080981AC: + ldr r0, _080981D8 + ldr r2, [r0] + adds r1, r3, 0 + cmp r3, 0 + bge _080981B8 + adds r1, 0x1F +_080981B8: + asrs r1, 5 + lsls r0, r1, 2 + adds r2, 0x54 + adds r2, r0 + lsls r1, 5 + subs r1, r3, r1 + movs r0, 0x1 + lsls r0, r1 + ldr r2, [r2] + ands r2, r0 + cmp r2, 0 + beq _080981D2 + movs r2, 0x1 +_080981D2: + adds r0, r2, 0 +_080981D4: + pop {r1} + bx r1 + .align 2, 0 +_080981D8: .4byte gUnknown_203B498 + thumb_func_end sub_80981A0 + + thumb_func_start sub_80981DC +sub_80981DC: + push {r4,r5,lr} + lsls r0, 16 + asrs r3, r0, 16 + movs r1, 0 + ldr r4, _080981FC + ldr r2, _08098200 +_080981E8: + movs r5, 0 + ldrsh r0, [r2, r5] + cmp r0, r3 + bne _08098204 + ldr r0, [r4] + adds r0, 0x58 + adds r0, r1 + ldrb r0, [r0] + b _0809820E + .align 2, 0 +_080981FC: .4byte gUnknown_203B498 +_08098200: .4byte gUnknown_810AD0C +_08098204: + adds r2, 0x4 + adds r1, 0x1 + cmp r1, 0xB + ble _080981E8 + movs r0, 0x1 +_0809820E: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80981DC + + thumb_func_start sub_8098214 +sub_8098214: + push {r4-r6,lr} + lsls r0, 16 + asrs r3, r0, 16 + movs r1, 0 + ldr r5, _08098240 + movs r4, 0x1 + ldr r2, _08098244 +_08098222: + movs r6, 0 + ldrsh r0, [r2, r6] + cmp r0, r3 + bne _08098232 + ldr r0, [r5] + adds r0, 0x58 + adds r0, r1 + strb r4, [r0] +_08098232: + adds r2, 0x4 + adds r1, 0x1 + cmp r1, 0xB + ble _08098222 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08098240: .4byte gUnknown_203B498 +_08098244: .4byte gUnknown_810AD0C + thumb_func_end sub_8098214 + + thumb_func_start sub_8098248 +sub_8098248: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + adds r7, r0, 0 + mov r5, sp + adds r5, 0x3 + movs r0, 0xFF + strb r0, [r5] + add r4, sp, 0x4 + movs r0, 0 + strb r0, [r4] + ldr r0, _08098300 + ldr r1, [r0] + adds r0, r7, 0 + movs r2, 0x1 + bl sub_809488C + movs r6, 0 + mov r9, r5 + mov r8, r4 + mov r4, sp + adds r4, 0x1 + mov r5, sp + adds r5, 0x2 +_0809827C: + lsls r0, r6, 16 + asrs r0, 16 + bl sub_8098134 + mov r1, sp + strb r0, [r1] + adds r0, r7, 0 + movs r2, 0x1 + bl sub_809488C + adds r6, 0x1 + ldr r0, _08098304 + cmp r6, r0 + ble _0809827C + movs r6, 0 +_0809829A: + lsls r0, r6, 24 + lsrs r0, 24 + bl sub_8098100 + strb r0, [r4] + adds r0, r7, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_809488C + adds r6, 0x1 + cmp r6, 0x3F + ble _0809829A + movs r6, 0 + adds r4, r5, 0 +_080982B8: + adds r0, r6, 0 + bl sub_80981A0 + strb r0, [r4] + adds r0, r7, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_809488C + adds r6, 0x1 + cmp r6, 0x1E + ble _080982B8 + movs r6, 0 +_080982D2: + ldr r0, _08098300 + ldr r0, [r0] + adds r0, 0x58 + adds r0, r6 + ldrb r0, [r0] + mov r1, r8 + cmp r0, 0 + beq _080982E4 + mov r1, r9 +_080982E4: + adds r0, r7, 0 + movs r2, 0x1 + bl sub_809488C + adds r6, 0x1 + cmp r6, 0xB + ble _080982D2 + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08098300: .4byte gUnknown_203B498 +_08098304: .4byte 0x000001a7 + thumb_func_end sub_8098248 + + thumb_func_start sub_8098308 +sub_8098308: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r6, r0, 0 + ldr r4, _080983D0 + ldr r0, [r4] + movs r1, 0 + movs r2, 0x64 + bl memset + ldr r1, [r4] + adds r0, r6, 0 + movs r2, 0x1 + bl sub_8094924 + movs r4, 0 + mov r5, sp + adds r5, 0x1 + mov r7, sp + adds r7, 0x2 + movs r0, 0x3 + add r0, sp + mov r8, r0 +_08098338: + adds r0, r6, 0 + mov r1, sp + movs r2, 0x1 + bl sub_8094924 + mov r0, sp + ldrb r0, [r0] + cmp r0, 0 + beq _08098352 + lsls r0, r4, 16 + asrs r0, 16 + bl sub_80980B4 +_08098352: + adds r4, 0x1 + ldr r0, _080983D4 + cmp r4, r0 + ble _08098338 + movs r4, 0 +_0809835C: + adds r0, r6, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_8094924 + ldrb r0, [r5] + cmp r0, 0 + beq _08098374 + lsls r0, r4, 24 + lsrs r0, 24 + bl sub_8097FA8 +_08098374: + adds r4, 0x1 + cmp r4, 0x3F + ble _0809835C + movs r4, 0 + adds r5, r7, 0 +_0809837E: + adds r0, r6, 0 + adds r1, r5, 0 + movs r2, 0x1 + bl sub_8094924 + ldrb r0, [r5] + cmp r0, 0 + beq _08098394 + adds r0, r4, 0 + bl sub_8098170 +_08098394: + adds r4, 0x1 + cmp r4, 0x1E + ble _0809837E + movs r4, 0 +_0809839C: + adds r0, r6, 0 + mov r1, r8 + movs r2, 0x1 + bl sub_8094924 + ldr r0, _080983D0 + ldr r1, [r0] + adds r1, 0x58 + adds r1, r4 + mov r0, sp + adds r0, 0x3 + ldrb r2, [r0] + movs r0, 0x1 + ands r0, r2 + strb r0, [r1] + adds r4, 0x1 + cmp r4, 0xB + ble _0809839C + bl sub_8097FF8 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080983D0: .4byte gUnknown_203B498 +_080983D4: .4byte 0x000001a7 + thumb_func_end sub_8098308 + + thumb_func_start sub_80983D8 +sub_80983D8: + push {r4,lr} + movs r2, 0 + ldrsh r3, [r1, r2] + movs r4, 0 + ldrsh r2, [r0, r4] + subs r2, r3, r2 + movs r3, 0x2 + ldrsh r1, [r1, r3] + movs r4, 0x2 + ldrsh r0, [r0, r4] + subs r1, r0 + cmp r2, 0 + bne _080983FA + cmp r1, 0 + bne _080983FA + movs r0, 0 + b _08098428 +_080983FA: + cmp r2, 0 + ble _08098400 + movs r2, 0x1 +_08098400: + cmp r1, 0 + ble _08098406 + movs r1, 0x1 +_08098406: + movs r0, 0x1 + negs r0, r0 + cmp r2, r0 + bgt _08098410 + adds r2, r0, 0 +_08098410: + cmp r1, r0 + bgt _08098416 + adds r1, r0, 0 +_08098416: + ldr r3, _08098430 + adds r2, 0x1 + adds r1, 0x1 + lsls r0, r1, 1 + adds r0, r1 + adds r0, r2 + lsls r0, 2 + adds r0, r3 + ldr r0, [r0] +_08098428: + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_08098430: .4byte gUnknown_8115E94 + thumb_func_end sub_80983D8 + + thumb_func_start sub_8098434 +sub_8098434: + push {r4,lr} + adds r3, r0, 0 + adds r4, r1, 0 + movs r0, 0 + ldrsh r1, [r3, r0] + movs r2, 0 + ldrsh r0, [r4, r2] + subs r2, r1, r0 + cmp r2, 0 + bge _0809844A + negs r2, r2 +_0809844A: + movs r0, 0x2 + ldrsh r1, [r3, r0] + movs r3, 0x2 + ldrsh r0, [r4, r3] + subs r0, r1, r0 + cmp r0, 0 + bge _0809845A + negs r0, r0 +_0809845A: + cmp r0, r2 + bge _08098460 + adds r0, r2, 0 +_08098460: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8098434 + + thumb_func_start sub_8098468 +sub_8098468: + push {r4-r7,lr} + sub sp, 0x8 + ldr r1, _08098494 + str r0, [r1] + ldr r4, _08098498 + movs r2, 0 + strb r2, [r4] + ldr r3, _0809849C + movs r1, 0x1 + strb r1, [r3] + ldr r1, _080984A0 + strb r2, [r1] + subs r0, 0xD + adds r2, r1, 0 + cmp r0, 0x4 + bhi _08098504 + lsls r0, 2 + ldr r1, _080984A4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08098494: .4byte gUnknown_20398B4 +_08098498: .4byte gUnknown_20398B9 +_0809849C: .4byte gUnknown_20398B8 +_080984A0: .4byte gUnknown_20398BA +_080984A4: .4byte _080984A8 + .align 2, 0 +_080984A8: + .4byte _080984BC + .4byte _080984C8 + .4byte _080984CE + .4byte _080984D4 + .4byte _080984FC +_080984BC: + movs r1, 0x1 + strb r1, [r2] + movs r0, 0 + strb r0, [r3] + strb r1, [r4] + b _08098504 +_080984C8: + movs r0, 0x1 + strb r0, [r3] + b _08098502 +_080984CE: + movs r0, 0x1 + strb r0, [r3] + b _08098502 +_080984D4: + add r2, sp, 0x4 + movs r0, 0x3 + mov r1, sp + bl sub_8001B88 + ldr r2, _080984F4 + movs r1, 0 + ldr r0, [sp] + cmp r0, 0 + bne _080984EA + movs r1, 0x1 +_080984EA: + strb r1, [r2] + ldr r1, _080984F8 + movs r0, 0x1 + strb r0, [r1] + b _08098504 + .align 2, 0 +_080984F4: .4byte gUnknown_20398B8 +_080984F8: .4byte gUnknown_20398B9 +_080984FC: + movs r0, 0 + strb r0, [r3] + movs r0, 0x1 +_08098502: + strb r0, [r4] +_08098504: + bl sub_801180C + ldr r0, _080985B0 + ldrb r0, [r0] + cmp r0, 0 + bne _08098522 + movs r0, 0xD + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + bne _08098522 + movs r0, 0x10 + bl sub_80118C4 +_08098522: + ldr r1, _080985B4 + ldr r2, _080985B8 + adds r0, r2, 0 + strh r0, [r1] + movs r0, 0 + bl xxx_update_some_bg_tiles + bl sub_8099648 + bl sub_809975C + bl sub_809D0AC + bl sub_80A7744 + bl sub_809D490 + bl sub_80A62F0 + bl sub_809C5C4 + bl sub_809A560 + bl sub_809CB50 + bl sub_80A4A7C + bl nullsub_117 + bl sub_80AD990 + bl sub_80A77F8 + bl sub_80ABB54 + bl sub_80ACB90 + bl sub_809A62C + ldr r0, _080985BC + movs r1, 0 + strb r1, [r0] + ldr r0, _080985C0 + strb r1, [r0] + ldr r6, _080985C4 + movs r0, 0x1 + str r0, [r6] + ldr r1, _080985C8 + movs r0, 0 + str r0, [r1] + ldr r0, _080985CC + movs r4, 0x1 + negs r4, r4 + str r4, [r0] + ldr r5, _080985D0 + movs r0, 0 + movs r1, 0xD + bl sub_8001658 + strh r0, [r5] + movs r0, 0 + movs r1, 0xE + bl sub_8001658 + ldr r1, _080985D4 + str r0, [r1] + ldr r0, _080985D8 + strh r4, [r0] + adds r7, r4, 0 + ldr r0, [r6] + b _08098988 + .align 2, 0 +_080985B0: .4byte gUnknown_20398B9 +_080985B4: .4byte gUnknown_2026E4E +_080985B8: .4byte 0x00000808 +_080985BC: .4byte gUnknown_203B49C +_080985C0: .4byte gUnknown_203B49D +_080985C4: .4byte gUnknown_20398A8 +_080985C8: .4byte gUnknown_20398AC +_080985CC: .4byte gUnknown_20398B0 +_080985D0: .4byte gUnknown_20398BE +_080985D4: .4byte gUnknown_20398C0 +_080985D8: .4byte gUnknown_20398C4 +_080985DC: + movs r0, 0x1 + negs r0, r0 + bl sub_809A71C + bl sub_809A76C + bl sub_809977C + ldr r0, _08098600 + ldr r0, [r0] + cmp r0, 0x11 + bls _080985F6 + b _08098756 +_080985F6: + lsls r0, 2 + ldr r1, _08098604 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08098600: .4byte gUnknown_20398B4 +_08098604: .4byte _08098608 + .align 2, 0 +_08098608: + .4byte _08098650 + .4byte _08098756 + .4byte _08098660 + .4byte _08098660 + .4byte _08098756 + .4byte _08098666 + .4byte _08098756 + .4byte _08098756 + .4byte _08098756 + .4byte _0809866A + .4byte _0809866A + .4byte _0809866A + .4byte _0809866A + .4byte _0809870C + .4byte _08098748 + .4byte _0809874C + .4byte _08098750 + .4byte _08098754 +_08098650: + bl sub_8098C58 + ldr r1, _0809865C + movs r0, 0x1 + str r0, [r1] + b _08098756 + .align 2, 0 +_0809865C: .4byte gUnknown_20398B4 +_08098660: + bl sub_8001D88 + b _08098756 +_08098666: + movs r7, 0x70 + b _08098756 +_0809866A: + ldr r0, _080986BC + ldr r2, [r0] + movs r0, 0 + movs r1, 0x16 + bl sub_80018D8 + movs r0, 0 + movs r1, 0x25 + movs r2, 0 + bl sub_80018D8 + bl sub_8098C58 + movs r0, 0 + movs r1, 0x15 + movs r2, 0x1 + movs r3, 0x2 + bl sub_800226C + movs r0, 0 + movs r1, 0x13 + bl sub_8001658 + lsls r0, 16 + asrs r4, r0, 16 + movs r0, 0x1 + negs r0, r0 + cmp r4, r0 + beq _08098756 + cmp r4, 0x51 + bne _080986C0 + movs r0, 0 + movs r1, 0x14 + bl sub_8001658 + lsls r0, 16 + asrs r0, 16 + bl sub_80A2608 + b _080986C6 + .align 2, 0 +_080986BC: .4byte gUnknown_20398B4 +_080986C0: + adds r0, r4, 0 + bl sub_80A2608 +_080986C6: + movs r1, 0xA + ldrsh r7, [r0, r1] + ldr r5, _08098700 + ldr r0, [r5] + cmp r0, 0x9 + bne _080986E0 + lsls r2, r4, 16 + lsrs r2, 16 + movs r0, 0 + movs r1, 0x31 + movs r3, 0x1 + bl sub_800199C +_080986E0: + ldr r0, [r5] + bl sub_8098FCC + lsls r0, 16 + asrs r1, r0, 16 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08098756 + ldr r0, _08098704 + strh r1, [r0] + ldr r1, _08098708 + movs r0, 0 + str r0, [r1] + b _08098756 + .align 2, 0 +_08098700: .4byte gUnknown_20398B4 +_08098704: .4byte gUnknown_20398BE +_08098708: .4byte gUnknown_20398C0 +_0809870C: + bl sub_8098C58 + ldr r1, _08098744 + movs r0, 0x1 + str r0, [r1] + movs r0, 0 + movs r1, 0x18 + movs r2, 0x1 + bl sub_80018D8 + movs r0, 0 + movs r1, 0xF + movs r2, 0 + bl sub_80018D8 + movs r0, 0 + movs r1, 0xD + movs r2, 0 + bl sub_80018D8 + movs r0, 0 + movs r1, 0xE + movs r2, 0 + bl sub_80018D8 + movs r7, 0x71 + b _08098756 + .align 2, 0 +_08098744: .4byte gUnknown_20398B4 +_08098748: + movs r7, 0x73 + b _08098756 +_0809874C: + movs r7, 0x74 + b _08098756 +_08098750: + movs r7, 0x75 + b _08098756 +_08098754: + movs r7, 0x76 +_08098756: + ldr r0, _08098790 + ldrb r0, [r0] + cmp r0, 0 + bne _080987C0 + movs r0, 0 + movs r1, 0xD + bl sub_8001658 + adds r5, r0, 0 + ldr r4, _08098794 + ldr r2, [r4] + movs r0, 0 + movs r1, 0x18 + bl sub_80018D8 + ldr r4, [r4] + cmp r4, 0x1 + beq _080987A6 + cmp r4, 0x3 + bne _0809879C + ldr r0, _08098798 + movs r1, 0 + ldrsh r2, [r0, r1] + movs r0, 0 + movs r1, 0xF + bl sub_80018D8 + b _080987A6 + .align 2, 0 +_08098790: .4byte gUnknown_20398B9 +_08098794: .4byte gUnknown_20398B4 +_08098798: .4byte gUnknown_20398BE +_0809879C: + movs r0, 0 + movs r1, 0xF + adds r2, r5, 0 + bl sub_80018D8 +_080987A6: + ldr r0, _0809882C + movs r1, 0 + ldrsh r2, [r0, r1] + movs r0, 0 + movs r1, 0xD + bl sub_80018D8 + ldr r0, _08098830 + ldr r2, [r0] + movs r0, 0 + movs r1, 0xE + bl sub_80018D8 +_080987C0: + ldr r1, _08098834 + movs r0, 0x2 + str r0, [r1] + ldr r0, _08098838 + movs r1, 0 + str r1, [r0] + ldr r0, _0809883C + str r1, [r0] + ldr r0, _08098840 + movs r4, 0x1 + negs r4, r4 + str r4, [r0] + ldr r2, _08098844 + ldr r1, _0809882C + ldrh r0, [r1] + strh r0, [r2] + strh r4, [r1] + bl sub_809977C + bl sub_809D4B0 + adds r0, r4, 0 + bl sub_80A6390 + bl sub_809C63C + bl sub_809A62C + bl sub_80A4AEC + bl sub_809D0BC + bl sub_80AD9D0 + bl sub_80A786C + bl sub_80ABB98 + bl sub_80ACBD4 + bl sub_809C658 + bl nullsub_16 + bl sub_8097944 + cmp r7, r4 + beq _08098848 + adds r0, r7, 0 + movs r1, 0 + bl sub_80A4BFC + b _08098850 + .align 2, 0 +_0809882C: .4byte gUnknown_20398BE +_08098830: .4byte gUnknown_20398C0 +_08098834: .4byte gUnknown_20398B4 +_08098838: .4byte gUnknown_20398A8 +_0809883C: .4byte gUnknown_20398AC +_08098840: .4byte gUnknown_20398B0 +_08098844: .4byte gUnknown_20398BC +_08098848: + movs r0, 0x66 + movs r1, 0 + bl sub_80A4BFC +_08098850: + bl sub_80A59C0 + movs r0, 0 + movs r1, 0 + bl sub_8005838 + bl sub_80060EC + bl xxx_call_update_bg_sound_input +_08098864: + bl xxx_call_update_bg_sound_input + bl sub_80A6E68 + ldr r0, _08098890 + ldr r0, [r0] + cmp r0, 0 + beq _080988B2 + ldr r1, _08098894 + ldr r0, [r1] + cmp r0, 0 + ble _0809889C + subs r0, 0x1 + str r0, [r1] + cmp r0, 0 + bgt _080988F8 + ldr r0, _08098898 + ldr r0, [r0] + bl sub_80999D4 + b _080988F8 + .align 2, 0 +_08098890: .4byte gUnknown_20398A8 +_08098894: .4byte gUnknown_20398AC +_08098898: .4byte gUnknown_20398B0 +_0809889C: + bl sub_8099B94 + lsls r0, 24 + cmp r0, 0 + bne _080988F8 + bl sub_809C740 + lsls r0, 24 + cmp r0, 0 + bne _0809897C + b _080988F8 +_080988B2: + ldr r0, _08098968 + ldrb r0, [r0] + cmp r0, 0 + beq _080988F8 + ldr r0, _0809896C + ldrb r0, [r0] + cmp r0, 0 + bne _080988F8 + bl sub_809AFAC + lsls r0, 24 + cmp r0, 0 + bne _080988F8 + ldr r0, _08098970 + ldrh r0, [r0, 0x2] + ldr r2, _08098974 + adds r1, r2, 0 + ands r0, r1 + cmp r0, 0 + bne _080988E4 + bl sub_80048BC + lsls r0, 24 + cmp r0, 0 + beq _080988F8 +_080988E4: + movs r0, 0x72 + movs r1, 0 + bl sub_80A4BFC + movs r0, 0x1E + bl sub_8098F44 + movs r0, 0x1E + bl sub_80118C4 +_080988F8: + bl sub_80A59C0 + bl nullsub_124 + bl sub_80AB254 + bl sub_80ACA3C + bl sub_80AD714 + bl nullsub_105 + bl sub_809B474 + bl sub_80A2380 + bl sub_809D25C + bl sub_80A59DC + bl sub_809B614 + bl sub_809CA20 + bl sub_80A6E80 + bl sub_8099BE4 + bl sub_8099744 + bl sub_8011860 + ldr r0, _08098978 + ldr r0, [r0] + bl sub_8094FB4 + bl sub_800CB20 + bl sub_800485C + bl nullsub_120 + bl sub_80A5E70 + bl sub_809B638 + bl nullsub_106 + bl sub_80A73EC + bl sub_8099750 + bl sub_8009908 + b _08098864 + .align 2, 0 +_08098968: .4byte gUnknown_20398B9 +_0809896C: .4byte gUnknown_20398B8 +_08098970: .4byte gUnknown_20255F0 +_08098974: .4byte 0x0000030f +_08098978: .4byte gUnknown_203B47C +_0809897C: + bl sub_80A4AEC + movs r7, 0x1 + negs r7, r7 + ldr r0, _080989E8 + ldr r0, [r0] +_08098988: + subs r0, 0x1 + cmp r0, 0x1 + bhi _08098990 + b _080985DC +_08098990: + bl sub_80A4AC4 + bl nullsub_118 + bl sub_80A78F0 + bl sub_80ABBD4 + bl sub_80ACC10 + bl sub_80ADA08 + bl sub_809CB74 + bl sub_809A610 + bl sub_809C618 + bl sub_80A658C + bl sub_809D508 + bl sub_80A7754 + bl nullsub_119 + bl sub_8099768 + bl nullsub_103 + bl nullsub_16 + ldr r0, _080989EC + ldrb r0, [r0] + cmp r0, 0 + beq _080989FA + ldr r0, _080989E8 + ldr r0, [r0] + cmp r0, 0x9 + beq _080989F0 + cmp r0, 0xA + bne _080989F0 + movs r0, 0x10 + b _08098BD2 + .align 2, 0 +_080989E8: .4byte gUnknown_20398A8 +_080989EC: .4byte gUnknown_20398B9 +_080989F0: + movs r0, 0x1E + bl sub_80118C4 + movs r0, 0xF + b _08098BD2 +_080989FA: + ldr r0, _08098A10 + ldr r0, [r0] + subs r0, 0x3 + cmp r0, 0x5 + bls _08098A06 + b _08098BC0 +_08098A06: + lsls r0, 2 + ldr r1, _08098A14 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08098A10: .4byte gUnknown_20398A8 +_08098A14: .4byte _08098A18 + .align 2, 0 +_08098A18: + .4byte _08098A30 + .4byte _08098A72 + .4byte _08098AA0 + .4byte _08098B08 + .4byte _08098B58 + .4byte _08098B8C +_08098A30: + movs r4, 0x1 + negs r4, r4 + movs r0, 0 + movs r1, 0x13 + adds r2, r4, 0 + bl sub_80018D8 + movs r0, 0 + movs r1, 0x14 + adds r2, r4, 0 + bl sub_80018D8 + movs r0, 0 + movs r1, 0x18 + movs r2, 0x4 + bl sub_80018D8 + movs r0, 0 + movs r1, 0x16 + movs r2, 0x4 + bl sub_80018D8 + movs r0, 0 + movs r1, 0xD + bl sub_8001658 + adds r2, r0, 0 + movs r0, 0 + movs r1, 0xF + bl sub_80018D8 + movs r0, 0x5 + b _08098BD2 +_08098A72: + movs r0, 0 + movs r1, 0x13 + movs r2, 0 + bl sub_80018D8 + movs r0, 0 + movs r1, 0x18 + movs r2, 0x5 + bl sub_80018D8 + movs r0, 0 + movs r1, 0x16 + movs r2, 0x5 + bl sub_80018D8 + movs r2, 0x1 + negs r2, r2 + movs r0, 0 + movs r1, 0x13 + bl sub_80018D8 + movs r0, 0x6 + b _08098BD2 +_08098AA0: + ldr r5, _08098B04 + movs r1, 0 + ldrsh r0, [r5, r1] + bl sub_80A2654 + adds r4, r0, 0 + lsls r4, 16 + asrs r4, 16 + movs r0, 0 + ldrsh r2, [r5, r0] + movs r0, 0 + movs r1, 0x13 + bl sub_80018D8 + movs r0, 0 + movs r1, 0x14 + adds r2, r4, 0 + bl sub_80018D8 + ldrh r2, [r5] + movs r0, 0 + movs r1, 0x30 + movs r3, 0x1 + bl sub_800199C + movs r0, 0 + movs r1, 0x18 + movs r2, 0x7 + bl sub_80018D8 + movs r0, 0 + movs r1, 0x16 + movs r2, 0x7 + bl sub_80018D8 + movs r0, 0 + movs r1, 0x11 + bl sub_8001658 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bne _08098B00 + movs r0, 0 + movs r1, 0x11 + movs r2, 0 + bl sub_80018D8 +_08098B00: + movs r0, 0x7 + b _08098BD2 + .align 2, 0 +_08098B04: .4byte gUnknown_20398C4 +_08098B08: + movs r0, 0 + movs r1, 0x13 + movs r2, 0x51 + bl sub_80018D8 + ldr r0, _08098B54 + movs r1, 0 + ldrsh r2, [r0, r1] + movs r0, 0 + movs r1, 0x14 + bl sub_80018D8 + movs r0, 0 + movs r1, 0x18 + movs r2, 0x7 + bl sub_80018D8 + movs r0, 0 + movs r1, 0x16 + movs r2, 0x7 + bl sub_80018D8 + movs r0, 0 + movs r1, 0x11 + bl sub_8001658 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xA + bne _08098B4E + movs r0, 0 + movs r1, 0x11 + movs r2, 0 + bl sub_80018D8 +_08098B4E: + movs r0, 0x8 + b _08098BD2 + .align 2, 0 +_08098B54: .4byte gUnknown_20398C4 +_08098B58: + movs r0, 0 + movs r1, 0x13 + movs r2, 0x50 + bl sub_80018D8 + ldr r0, _08098B88 + ldrb r2, [r0] + movs r0, 0 + movs r1, 0x14 + bl sub_80018D8 + movs r0, 0 + movs r1, 0x18 + movs r2, 0x7 + bl sub_80018D8 + movs r0, 0 + movs r1, 0x16 + movs r2, 0x7 + bl sub_80018D8 + movs r0, 0x9 + b _08098BD2 + .align 2, 0 +_08098B88: .4byte gUnknown_2039950 +_08098B8C: + movs r0, 0 + movs r1, 0x13 + movs r2, 0x52 + bl sub_80018D8 + ldr r0, _08098BBC + movs r1, 0 + ldrsh r2, [r0, r1] + movs r0, 0 + movs r1, 0x14 + bl sub_80018D8 + movs r0, 0 + movs r1, 0x18 + movs r2, 0x7 + bl sub_80018D8 + movs r0, 0 + movs r1, 0x16 + movs r2, 0x7 + bl sub_80018D8 + movs r0, 0xA + b _08098BD2 + .align 2, 0 +_08098BBC: .4byte gUnknown_20398C4 +_08098BC0: + movs r0, 0 + movs r1, 0x18 + movs r2, 0x1 + bl sub_80018D8 + movs r0, 0x10 + bl sub_80118C4 + movs r0, 0xE +_08098BD2: + add sp, 0x8 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8098468 + + thumb_func_start sub_8098BDC +sub_8098BDC: + push {lr} + bl sub_809B57C + bl sub_80A2380 + bl sub_809D25C + bl sub_80A59DC + bl sub_809B614 + bl sub_809CA20 + bl sub_80A6E80 + bl sub_8099BE4 + bl sub_8099744 + bl sub_8011860 + ldr r0, _08098C54 + ldr r0, [r0] + bl sub_8094FB4 + bl sub_800CB20 + bl sub_800485C + bl nullsub_120 + bl sub_80A5E70 + bl sub_809B638 + bl nullsub_106 + bl sub_80A73EC + bl sub_8099750 + bl sub_8009908 + bl xxx_call_update_bg_sound_input + bl sub_80A6E68 + bl sub_80A59C0 + bl nullsub_124 + bl sub_80AB254 + bl sub_80ACA3C + bl sub_80AD714 + pop {r0} + bx r0 + .align 2, 0 +_08098C54: .4byte gUnknown_203B47C + thumb_func_end sub_8098BDC + + thumb_func_start sub_8098C58 +sub_8098C58: + push {lr} + movs r0, 0 + movs r1, 0x36 + bl sub_80015C0 + movs r0, 0 + movs r1, 0x39 + bl sub_80015C0 + bl sub_809CB8C + bl sub_8001D88 + movs r0, 0 + movs r1, 0x2A + bl sub_8001658 + cmp r0, 0 + beq _08098CA2 + movs r0, 0 + movs r1, 0x29 + bl sub_8001658 + adds r2, r0, 0 + adds r2, 0x1 + cmp r2, 0xF + ble _08098C90 + movs r2, 0 +_08098C90: + movs r0, 0 + movs r1, 0x29 + bl sub_80018D8 + movs r0, 0 + movs r1, 0x2A + movs r2, 0 + bl sub_80018D8 +_08098CA2: + movs r0, 0 + movs r1, 0x42 + movs r2, 0 + bl sub_8001784 + adds r3, r0, 0 + cmp r3, 0 + bgt _08098CB4 + movs r3, 0x1 +_08098CB4: + subs r3, 0x1 + movs r0, 0 + movs r1, 0x42 + movs r2, 0 + bl sub_800199C + bl sub_8098CC8 + pop {r0} + bx r0 + thumb_func_end sub_8098C58 + + thumb_func_start sub_8098CC8 +sub_8098CC8: + push {lr} + movs r0, 0x3 + movs r1, 0xB + movs r2, 0 + bl sub_8001CC4 + lsls r0, 24 + cmp r0, 0 + beq _08098CDE + movs r1, 0 + b _08098D06 +_08098CDE: + movs r0, 0x3 + movs r1, 0xF + movs r2, 0 + bl sub_8001CC4 + lsls r0, 24 + cmp r0, 0 + beq _08098CF2 + movs r1, 0x1 + b _08098D06 +_08098CF2: + movs r0, 0x3 + movs r1, 0x12 + movs r2, 0 + bl sub_8001CC4 + lsls r0, 24 + movs r1, 0x3 + cmp r0, 0 + beq _08098D06 + movs r1, 0x2 +_08098D06: + adds r0, r1, 0 + bl sub_8091980 + bl sub_809674C + bl sub_80961B4 + bl sub_8091FB4 + pop {r0} + bx r0 + thumb_func_end sub_8098CC8 + + thumb_func_start sub_8098D1C +sub_8098D1C: + push {r4-r7,lr} + adds r7, r1, 0 + adds r4, r2, 0 + lsls r0, 16 + asrs r5, r0, 16 + ldr r6, _08098D34 + ldr r0, [r6] + cmp r0, 0 + beq _08098D38 + movs r0, 0 + b _08098D60 + .align 2, 0 +_08098D34: .4byte gUnknown_20398A8 +_08098D38: + ldr r1, _08098D68 + movs r0, 0 + adds r2, r5, 0 + adds r3, r4, 0 + bl Log + movs r1, 0x1 + str r1, [r6] + ldr r0, _08098D6C + str r1, [r0] + ldr r0, _08098D70 + str r4, [r0] + ldr r1, _08098D74 + movs r0, 0x2 + str r0, [r1] + ldr r0, _08098D78 + strh r5, [r0] + ldr r0, _08098D7C + str r7, [r0] + movs r0, 0x1 +_08098D60: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08098D68: .4byte gUnknown_8115F5C +_08098D6C: .4byte gUnknown_20398AC +_08098D70: .4byte gUnknown_20398B0 +_08098D74: .4byte gUnknown_20398B4 +_08098D78: .4byte gUnknown_20398BE +_08098D7C: .4byte gUnknown_20398C0 + thumb_func_end sub_8098D1C + + thumb_func_start sub_8098D80 +sub_8098D80: + push {r4,lr} + adds r4, r0, 0 + ldr r1, _08098DB8 + ldr r0, [r1] + cmp r0, 0 + bne _08098DC4 + movs r0, 0x3 + str r0, [r1] + ldr r1, _08098DBC + movs r0, 0x1 + str r0, [r1] + ldr r0, _08098DC0 + str r4, [r0] + bl sub_809C730 + movs r0, 0xD + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + bne _08098DB2 + lsls r0, r4, 16 + lsrs r0, 16 + bl sub_80118C4 +_08098DB2: + movs r0, 0x1 + b _08098DC6 + .align 2, 0 +_08098DB8: .4byte gUnknown_20398A8 +_08098DBC: .4byte gUnknown_20398AC +_08098DC0: .4byte gUnknown_20398B0 +_08098DC4: + movs r0, 0 +_08098DC6: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8098D80 + + thumb_func_start sub_8098DCC +sub_8098DCC: + push {r4,lr} + adds r4, r0, 0 + ldr r1, _08098E04 + ldr r0, [r1] + cmp r0, 0 + bne _08098E10 + movs r0, 0x4 + str r0, [r1] + ldr r1, _08098E08 + movs r0, 0x1 + str r0, [r1] + ldr r0, _08098E0C + str r4, [r0] + bl sub_809C730 + movs r0, 0xD + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + bne _08098DFE + lsls r0, r4, 16 + lsrs r0, 16 + bl sub_80118C4 +_08098DFE: + movs r0, 0x1 + b _08098E12 + .align 2, 0 +_08098E04: .4byte gUnknown_20398A8 +_08098E08: .4byte gUnknown_20398AC +_08098E0C: .4byte gUnknown_20398B0 +_08098E10: + movs r0, 0 +_08098E12: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8098DCC + + thumb_func_start sub_8098E18 +sub_8098E18: + push {r4-r6,lr} + adds r6, r1, 0 + lsls r0, 16 + asrs r2, r0, 16 + adds r5, r2, 0 + ldr r4, _08098E40 + ldr r0, [r4] + cmp r0, 0 + bne _08098EA8 + ldr r1, _08098E44 + movs r0, 0 + adds r3, r6, 0 + bl Log + ldr r0, _08098E48 + ldrb r0, [r0] + cmp r0, 0 + beq _08098E4C + movs r0, 0x7 + b _08098E8A + .align 2, 0 +_08098E40: .4byte gUnknown_20398A8 +_08098E44: .4byte gUnknown_8115F80 +_08098E48: .4byte gUnknown_203B49D +_08098E4C: + ldr r0, _08098E74 + ldrb r0, [r0] + ldr r1, _08098E78 + cmp r0, 0 + bne _08098E58 + strh r5, [r1] +_08098E58: + movs r2, 0 + ldrsh r0, [r1, r2] + bl sub_80A2750 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x2 + beq _08098E88 + cmp r0, 0x2 + bgt _08098E7C + cmp r0, 0x1 + beq _08098E84 + b _08098E8C + .align 2, 0 +_08098E74: .4byte gUnknown_203B49C +_08098E78: .4byte gUnknown_20398C4 +_08098E7C: + cmp r0, 0x4 + bne _08098E8C + movs r0, 0x8 + b _08098E8A +_08098E84: + movs r0, 0x5 + b _08098E8A +_08098E88: + movs r0, 0x6 +_08098E8A: + str r0, [r4] +_08098E8C: + ldr r0, _08098EA0 + movs r1, 0x1 + str r1, [r0] + ldr r0, _08098EA4 + str r6, [r0] + bl sub_809C730 + movs r0, 0x1 + b _08098EAA + .align 2, 0 +_08098EA0: .4byte gUnknown_20398AC +_08098EA4: .4byte gUnknown_20398B0 +_08098EA8: + movs r0, 0 +_08098EAA: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_8098E18 + + thumb_func_start sub_8098EB0 +sub_8098EB0: + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _08098EE4 + ldr r0, [r5] + cmp r0, 0 + bne _08098EF8 + ldr r0, _08098EE8 + ldrb r0, [r0] + cmp r0, 0 + beq _08098EF8 + ldr r1, _08098EEC + movs r0, 0 + adds r2, r4, 0 + bl Log + movs r0, 0x7 + str r0, [r5] + ldr r1, _08098EF0 + movs r0, 0x1 + str r0, [r1] + ldr r0, _08098EF4 + str r4, [r0] + bl sub_809C730 + movs r0, 0x1 + b _08098EFA + .align 2, 0 +_08098EE4: .4byte gUnknown_20398A8 +_08098EE8: .4byte gUnknown_203B49D +_08098EEC: .4byte gUnknown_8115FA4 +_08098EF0: .4byte gUnknown_20398AC +_08098EF4: .4byte gUnknown_20398B0 +_08098EF8: + movs r0, 0 +_08098EFA: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_8098EB0 + + thumb_func_start sub_8098F00 +sub_8098F00: + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _08098F10 + ldr r0, [r5] + cmp r0, 0 + beq _08098F14 + movs r0, 0 + b _08098F32 + .align 2, 0 +_08098F10: .4byte gUnknown_20398A8 +_08098F14: + ldr r1, _08098F38 + movs r0, 0 + adds r2, r4, 0 + bl Log + movs r0, 0x9 + str r0, [r5] + ldr r1, _08098F3C + movs r0, 0x1 + str r0, [r1] + ldr r0, _08098F40 + str r4, [r0] + bl sub_809C730 + movs r0, 0x1 +_08098F32: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08098F38: .4byte gUnknown_8115FC8 +_08098F3C: .4byte gUnknown_20398AC +_08098F40: .4byte gUnknown_20398B0 + thumb_func_end sub_8098F00 + + thumb_func_start sub_8098F44 +sub_8098F44: + push {r4,r5,lr} + adds r4, r0, 0 + ldr r5, _08098F54 + ldr r0, [r5] + cmp r0, 0 + beq _08098F58 + movs r0, 0 + b _08098F76 + .align 2, 0 +_08098F54: .4byte gUnknown_20398A8 +_08098F58: + ldr r1, _08098F7C + movs r0, 0 + adds r2, r4, 0 + bl Log + movs r0, 0xA + str r0, [r5] + ldr r1, _08098F80 + movs r0, 0x1 + str r0, [r1] + ldr r0, _08098F84 + str r4, [r0] + bl sub_809C730 + movs r0, 0x1 +_08098F76: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_08098F7C: .4byte gUnknown_8115FE8 +_08098F80: .4byte gUnknown_20398AC +_08098F84: .4byte gUnknown_20398B0 + thumb_func_end sub_8098F44 + + thumb_func_start sub_8098F88 +sub_8098F88: + ldr r0, _08098F90 + ldrb r0, [r0] + bx lr + .align 2, 0 +_08098F90: .4byte gUnknown_20398B9 + thumb_func_end sub_8098F88 + + thumb_func_start sub_8098F94 +sub_8098F94: + ldr r0, _08098F9C + ldrb r0, [r0] + bx lr + .align 2, 0 +_08098F9C: .4byte gUnknown_20398BA + thumb_func_end sub_8098F94 + + thumb_func_start sub_8098FA0 +sub_8098FA0: + push {lr} + movs r0, 0 + movs r1, 0x11 + bl sub_8001658 + lsls r0, 16 + asrs r0, 16 + pop {r1} + bx r1 + thumb_func_end sub_8098FA0 + + thumb_func_start sub_8098FB4 +sub_8098FB4: + push {lr} + movs r0, 0 + movs r1, 0x11 + bl sub_8001658 + lsls r0, 16 + asrs r0, 16 + bl sub_80A2B18 + pop {r1} + bx r1 + thumb_func_end sub_8098FB4 + + thumb_func_start sub_8098FCC +sub_8098FCC: + push {r4,lr} + movs r0, 0 + movs r1, 0x13 + bl sub_8001658 + lsls r0, 16 + asrs r1, r0, 16 + adds r2, r1, 0 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0809909E + cmp r1, 0x51 + bne _08098FF6 + movs r0, 0 + movs r1, 0x14 + bl sub_8001658 + lsls r0, 16 + asrs r0, 16 + b _08098FF8 +_08098FF6: + adds r0, r2, 0 +_08098FF8: + bl sub_80A2608 + adds r4, r0, 0 + ldr r0, _0809900C + ldr r0, [r0] + cmp r0, 0x9 + bne _08099010 + movs r1, 0x2 + ldrsh r0, [r4, r1] + b _080990B2 + .align 2, 0 +_0809900C: .4byte gUnknown_20398B4 +_08099010: + ldrh r0, [r4, 0x4] + subs r0, 0xB2 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x17 + bhi _080990AE + lsls r0, 2 + ldr r1, _08099028 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08099028: .4byte _0809902C + .align 2, 0 +_0809902C: + .4byte _0809908C + .4byte _080990AE + .4byte _080990AE + .4byte _080990AE + .4byte _080990AE + .4byte _080990AE + .4byte _080990AE + .4byte _080990AE + .4byte _080990AE + .4byte _080990AE + .4byte _080990AE + .4byte _080990AE + .4byte _080990AE + .4byte _080990AE + .4byte _080990AE + .4byte _080990A2 + .4byte _080990AE + .4byte _080990A2 + .4byte _080990AE + .4byte _080990AE + .4byte _080990A2 + .4byte _080990AE + .4byte _080990AE + .4byte _080990A2 +_0809908C: + movs r2, 0x1 + negs r2, r2 + movs r0, 0x3 + movs r1, 0x2 + bl sub_8001D44 + lsls r0, 24 + cmp r0, 0 + beq _080990AE +_0809909E: + movs r0, 0xC + b _080990B2 +_080990A2: + movs r0, 0x5 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _0809909E +_080990AE: + movs r1, 0x4 + ldrsh r0, [r4, r1] +_080990B2: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8098FCC + + thumb_func_start sub_80990B8 +sub_80990B8: + push {lr} + movs r0, 0xB + bl sub_8098FCC + lsls r0, 16 + asrs r2, r0, 16 + movs r0, 0x1 + negs r0, r0 + cmp r2, r0 + bne _080990D2 + bl sub_8098FB4 + b _080990E4 +_080990D2: + ldr r1, _080990E8 + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + movs r1, 0x2 + ldrsh r0, [r0, r1] + bl sub_80A2B18 +_080990E4: + pop {r1} + bx r1 + .align 2, 0 +_080990E8: .4byte gUnknown_811BAF4 + thumb_func_end sub_80990B8 + + thumb_func_start sub_80990EC +sub_80990EC: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x80 + adds r7, r0, 0 + lsls r1, 16 + asrs r4, r1, 16 + adds r0, r4, 0 + bl sub_80A2608 + mov r8, r0 + ldrb r0, [r0, 0xC] + movs r5, 0 + strb r0, [r7] + movs r0, 0x1 + strb r0, [r7, 0x1] + strb r5, [r7, 0xC] + adds r0, r4, 0 + bl sub_80A2750 + lsls r0, 16 + asrs r6, r0, 16 + cmp r6, 0x2 + beq _080991C8 + cmp r6, 0x2 + bgt _08099126 + cmp r6, 0x1 + beq _0809912C + b _080991CA +_08099126: + cmp r6, 0x4 + beq _080991C4 + b _080991CA +_0809912C: + movs r1, 0 + strb r5, [r7, 0xB] + adds r0, r4, 0 + subs r0, 0x25 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bhi _0809913E + movs r1, 0x1 +_0809913E: + cmp r1, 0 + beq _080991CA + strb r6, [r7, 0xC] + mov r0, sp + movs r1, 0x5B + bl sub_80A8EC0 + add r4, sp, 0x18 + adds r0, r4, 0 + mov r1, sp + movs r2, 0xA + bl sub_8092310 + add r5, sp, 0x30 + str r4, [sp, 0x58] + add r1, sp, 0x5C + movs r2, 0 + movs r0, 0x5E + strh r0, [r1] + mov r0, sp + adds r0, 0x5E + strb r2, [r0] + add r0, sp, 0x60 + movs r1, 0x47 + strb r1, [r0] + strb r2, [r0, 0x1] + add r1, sp, 0x64 + movs r0, 0x82 + lsls r0, 1 + strh r0, [r1] + movs r0, 0xE0 + strh r0, [r1, 0x2] + movs r0, 0xAC + strh r0, [r1, 0x4] + movs r0, 0xBE + strh r0, [r1, 0x6] + add r1, sp, 0x6C + movs r0, 0x50 + strh r0, [r1] + mov r0, sp + adds r0, 0x6E + movs r2, 0xF + strh r2, [r0] + add r0, sp, 0x70 + strh r6, [r0] + adds r0, 0x2 + movs r1, 0x19 + strh r1, [r0] + strh r1, [r0, 0x2] + adds r0, 0x4 + strh r2, [r0] + strh r2, [r0, 0x2] + ldr r0, _080991C0 + str r0, [sp, 0x7C] + add r1, sp, 0x58 + adds r0, r5, 0 + movs r2, 0x28 + bl memcpy + adds r0, r7, 0 + adds r0, 0x18 + adds r1, r5, 0 + bl sub_808D144 + b _080991CA + .align 2, 0 +_080991C0: .4byte 0x000061a8 +_080991C4: + strb r5, [r7, 0xB] + b _080991CA +_080991C8: + strb r6, [r7, 0xB] +_080991CA: + movs r0, 0 + strb r0, [r7, 0x4] + strb r0, [r7, 0xD] + mov r1, r8 + ldrb r0, [r1, 0x11] + add sp, 0x80 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80990EC + + thumb_func_start sub_80991E0 +sub_80991E0: + push {lr} + adds r2, r0, 0 + ldr r3, _08099204 + ldrh r0, [r3] + strh r0, [r1] + ldr r0, _08099208 + ldrb r0, [r0] + cmp r0, 0 + bne _0809920C + movs r0, 0 + ldrsh r1, [r3, r0] + adds r0, r2, 0 + bl sub_80990EC + lsls r0, 24 + lsrs r0, 24 + b _08099218 + .align 2, 0 +_08099204: .4byte gUnknown_20398C4 +_08099208: .4byte gUnknown_203B49C +_0809920C: + ldr r1, _0809921C + adds r0, r2, 0 + movs r2, 0x88 + bl memcpy + movs r0, 0x1 +_08099218: + pop {r1} + bx r1 + .align 2, 0 +_0809921C: .4byte gUnknown_20398C8 + thumb_func_end sub_80991E0 + + thumb_func_start sub_8099220 +sub_8099220: + push {lr} + adds r2, r0, 0 + lsls r1, 16 + asrs r3, r1, 16 + cmp r2, 0 + beq _08099258 + ldr r1, _08099248 + movs r0, 0x1 + strb r0, [r1] + ldr r1, _0809924C + movs r0, 0 + strb r0, [r1] + ldr r0, _08099250 + strh r3, [r0] + ldr r0, _08099254 + adds r1, r2, 0 + movs r2, 0x88 + bl memcpy + b _0809926A + .align 2, 0 +_08099248: .4byte gUnknown_203B49C +_0809924C: .4byte gUnknown_203B49D +_08099250: .4byte gUnknown_20398C4 +_08099254: .4byte gUnknown_20398C8 +_08099258: + ldr r0, _08099270 + strb r2, [r0] + ldr r0, _08099274 + strb r2, [r0] + ldr r1, _08099278 + movs r2, 0x1 + negs r2, r2 + adds r0, r2, 0 + strh r0, [r1] +_0809926A: + pop {r0} + bx r0 + .align 2, 0 +_08099270: .4byte gUnknown_203B49C +_08099274: .4byte gUnknown_203B49D +_08099278: .4byte gUnknown_20398C4 + thumb_func_end sub_8099220 + + thumb_func_start sub_809927C +sub_809927C: + push {r4,r5,lr} + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + ldr r0, _080992CC + movs r1, 0x1 + strb r1, [r0] + ldr r0, _080992D0 + strb r1, [r0] + ldr r1, _080992D4 + movs r0, 0x50 + strh r0, [r1] + ldr r4, _080992D8 + strb r5, [r4] + movs r0, 0 + movs r1, 0x13 + movs r2, 0x50 + bl sub_80018D8 + ldrb r2, [r4] + movs r0, 0 + movs r1, 0x14 + bl sub_80018D8 + ldr r4, _080992DC + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8095494 + subs r4, 0x10 + movs r1, 0 + movs r0, 0x1 + strb r0, [r4, 0xB] + strb r1, [r4, 0xC] + strb r1, [r4, 0x4] + strb r1, [r4, 0xD] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080992CC: .4byte gUnknown_203B49C +_080992D0: .4byte gUnknown_203B49D +_080992D4: .4byte gUnknown_20398C4 +_080992D8: .4byte gUnknown_2039950 +_080992DC: .4byte gUnknown_20398D8 + thumb_func_end sub_809927C + + thumb_func_start sub_80992E0 +sub_80992E0: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r0, 0 + movs r1, 0x13 + bl sub_8001658 + lsls r0, 16 + asrs r1, r0, 16 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08099316 + cmp r1, 0x50 + beq _08099316 + cmp r1, 0x51 + beq _08099316 + cmp r1, 0x52 + beq _08099316 + strh r1, [r4] + movs r0, 0 + movs r1, 0x14 + bl sub_8001658 + strh r0, [r5] + movs r0, 0x1 + b _08099322 +_08099316: + movs r1, 0x1 + negs r1, r1 + adds r0, r1, 0 + strh r0, [r4] + strh r0, [r5] + movs r0, 0 +_08099322: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80992E0 + + thumb_func_start sub_8099328 +sub_8099328: + push {r4,lr} + adds r4, r0, 0 + movs r0, 0 + movs r1, 0x13 + bl sub_8001658 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x51 + bne _08099358 + movs r0, 0 + movs r1, 0x14 + bl sub_8001658 + lsls r0, 16 + asrs r0, 16 + bl sub_80A2608 + ldrb r0, [r0, 0xC] + cmp r0, 0x3E + bhi _08099358 + strb r0, [r4] + movs r0, 0x1 + b _0809935A +_08099358: + movs r0, 0 +_0809935A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8099328 + + thumb_func_start sub_8099360 +sub_8099360: + push {r4,lr} + adds r4, r0, 0 + movs r0, 0 + movs r1, 0x13 + bl sub_8001658 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x52 + beq _08099378 + movs r0, 0 + b _0809938E +_08099378: + movs r0, 0 + movs r1, 0x14 + bl sub_8001658 + lsls r0, 16 + asrs r0, 16 + bl sub_80A2608 + ldrb r0, [r0, 0xC] + strb r0, [r4] + movs r0, 0x1 +_0809938E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8099360 + + thumb_func_start sub_8099394 +sub_8099394: + push {r4,lr} + adds r4, r0, 0 + movs r0, 0 + movs r1, 0x13 + bl sub_8001658 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x50 + beq _080993AC + movs r0, 0 + b _080993B8 +_080993AC: + movs r0, 0 + movs r1, 0x14 + bl sub_8001658 + strb r0, [r4] + movs r0, 0x1 +_080993B8: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8099394 + + thumb_func_start sub_80993C0 +sub_80993C0: + push {lr} + lsls r0, 24 + ldr r2, _080993D4 + movs r1, 0 + cmp r0, 0 + bne _080993CE + movs r1, 0x1 +_080993CE: + strb r1, [r2] + pop {r0} + bx r0 + .align 2, 0 +_080993D4: .4byte gUnknown_20398B8 + thumb_func_end sub_80993C0 + + thumb_func_start sub_80993D8 +sub_80993D8: + push {lr} + bl sub_80A4B38 + pop {r0} + bx r0 + thumb_func_end sub_80993D8 + + thumb_func_start sub_80993E4 +sub_80993E4: + push {lr} + bl sub_80A4B54 + pop {r0} + bx r0 + thumb_func_end sub_80993E4 + + thumb_func_start sub_80993F0 +sub_80993F0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x28 + movs r0, 0 + mov r10, r0 + bl sub_801180C + movs r0, 0x10 + bl sub_80118C4 + ldr r1, _0809948C + ldr r2, _08099490 + adds r0, r2, 0 + strh r0, [r1] + movs r0, 0 + bl xxx_update_some_bg_tiles + movs r0, 0 + movs r1, 0x14 + bl sub_80095CC + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0 + movs r1, 0x14 + bl sub_8009408 + bl sub_8099648 + bl sub_809975C + bl sub_809D0AC + bl sub_8014144 + movs r0, 0 + movs r1, 0 + bl sub_8005838 + bl sub_80A4A7C + mov r7, sp + add r0, sp, 0x8 + mov r8, r0 +_08099454: + bl sub_801D9E4 + lsls r0, 24 + cmp r0, 0 + beq _0809949C + mov r0, r10 + bl sub_801DA58 +_08099464: + movs r0, 0 + movs r1, 0 + bl sub_8005838 + movs r0, 0 + bl sub_8012A18 + bl sub_801DA78 + cmp r0, 0x2 + beq _08099494 + cmp r0, 0x3 + bne _08099464 + bl sub_801DAC0 + lsls r0, 16 + asrs r0, 16 + mov r10, r0 + b _080994A2 + .align 2, 0 +_0809948C: .4byte gUnknown_2026E4E +_08099490: .4byte 0x00000808 +_08099494: + movs r1, 0x1 + negs r1, r1 + mov r10, r1 + b _080994A2 +_0809949C: + movs r2, 0x1 + negs r2, r2 + mov r10, r2 +_080994A2: + bl sub_801DB0C + movs r0, 0x1 + negs r0, r0 + cmp r10, r0 + bne _080994B0 + b _08099624 +_080994B0: + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + bl sub_80A4AEC + bl sub_809D0BC + mov r0, r10 + bl sub_80A4DCC + mov r0, sp + mov r1, r8 + bl sub_80A579C + ldr r0, [r7, 0x4] + movs r1, 0xC0 + lsls r1, 4 + adds r0, r1 + str r0, [r7, 0x4] + mov r2, r8 + ldr r0, [r2, 0x4] + adds r0, r1 + str r0, [r2, 0x4] + ldr r0, [sp] + ldr r1, _08099520 + adds r0, r1 + str r0, [sp] + ldr r0, [r7, 0x4] + adds r0, r1 + str r0, [r7, 0x4] + ldr r0, [sp, 0x8] + movs r2, 0x80 + lsls r2, 3 + adds r0, r2 + str r0, [sp, 0x8] + mov r0, r8 + ldr r1, [r0, 0x4] + adds r1, r2 + str r1, [r0, 0x4] + ldr r2, [sp, 0x8] + ldr r0, [sp] + subs r0, r2, r0 + str r0, [sp, 0x20] + ldr r0, [r7, 0x4] + subs r0, r1, r0 + str r0, [sp, 0x24] + movs r4, 0 + movs r5, 0 + movs r0, 0x4 + bl sub_80999E8 + mov r9, r5 + b _08099604 + .align 2, 0 +_08099520: .4byte 0xfffffc00 +_08099524: + ldr r0, _0809953C + ldrh r1, [r0, 0x2] + ldrh r6, [r0] + movs r0, 0x4 + ands r1, r0 + cmp r1, 0 + beq _08099540 + bl sub_80999FC + movs r1, 0x1 + mov r9, r1 + b _080995AE + .align 2, 0 +_0809953C: .4byte gUnknown_20255F0 +_08099540: + adds r0, r6, 0 + bl sub_809CFE8 + lsls r0, 24 + asrs r1, r0, 24 + movs r2, 0x1 + negs r2, r2 + cmp r1, r2 + beq _0809959A + add r0, sp, 0x10 + movs r2, 0x80 + lsls r2, 1 + bl sub_8002BB8 + ldr r2, [sp, 0x10] + ldr r3, [sp, 0x14] + movs r0, 0x2 + ands r6, r0 + cmp r6, 0 + beq _0809956A + movs r0, 0x4 +_0809956A: + adds r1, r0, 0 + muls r1, r2 + adds r1, r4 + adds r4, r1, 0 + muls r0, r3 + adds r5, r0 + cmp r1, 0 + bge _0809957E + movs r4, 0 + b _08099588 +_0809957E: + ldr r0, [sp, 0x20] + cmp r4, r0 + blt _08099588 + adds r4, r0, 0 + subs r4, 0x1 +_08099588: + cmp r5, 0 + bge _08099590 + movs r5, 0 + b _0809959A +_08099590: + ldr r1, [sp, 0x24] + cmp r5, r1 + blt _0809959A + adds r5, r1, 0 + subs r5, 0x1 +_0809959A: + ldr r0, [sp] + adds r0, r4 + str r0, [sp, 0x18] + ldr r0, [r7, 0x4] + adds r0, r5 + add r1, sp, 0x18 + str r0, [r1, 0x4] + movs r0, 0 + bl sub_809D158 +_080995AE: + bl sub_809D25C + bl sub_80A59DC + bl sub_80144C4 + movs r0, 0 + movs r1, 0 + bl sub_8005838 + bl sub_80060EC + ldr r0, _08099620 + ldr r0, [r0] + ldrb r0, [r0, 0xA] + bl nullsub_8 + bl sub_8005180 + bl sub_8099BE4 + bl sub_8099744 + bl sub_8011860 + bl sub_800CB20 + bl sub_800485C + bl nullsub_120 + bl sub_80A5E70 + bl xxx_call_update_bg_vram + bl CopySpritesToOam + bl sub_8005304 + bl sub_8099750 + bl sub_8009908 +_08099604: + bl xxx_call_update_bg_sound_input + movs r0, 0 + bl sub_8004D8C + mov r2, r9 + cmp r2, 0 + beq _08099524 + bl sub_8099B94 + lsls r0, 24 + cmp r0, 0 + bne _080995AE + b _08099454 + .align 2, 0 +_08099620: .4byte gUnknown_203B46C +_08099624: + movs r0, 0x10 + bl sub_80118C4 + bl sub_80A4AC4 + bl sub_8099768 + bl nullsub_103 + add sp, 0x28 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80993F0 + + thumb_func_start sub_8099648 +sub_8099648: + push {lr} + bl sub_8003600 + bl sub_809965C + pop {r0} + bx r0 + thumb_func_end sub_8099648 + + thumb_func_start nullsub_103 +nullsub_103: + bx lr + thumb_func_end nullsub_103 + + thumb_func_start sub_809965C +sub_809965C: + push {r4,lr} + movs r0, 0 + bl sub_8099690 + ldr r0, _08099688 + ldr r1, _0809968C + bl sub_800A9EC + adds r4, r0, 0 + movs r0, 0xF8 + lsls r0, 1 + ldr r1, [r4, 0x4] + movs r2, 0x10 + bl sub_800388C + adds r0, r4, 0 + bl sub_800AA14 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08099688: .4byte gUnknown_811601C +_0809968C: .4byte gUnknown_8300500 + thumb_func_end sub_809965C + + thumb_func_start sub_8099690 +sub_8099690: + push {r4-r6,lr} + adds r4, r0, 0 + ldr r0, _080996BC + ldr r1, _080996C0 + bl sub_800A9EC + adds r6, r0, 0 + cmp r4, 0x1 + beq _080996CC + cmp r4, 0x2 + beq _080996D4 + ldr r0, _080996C4 + ldr r0, [r0] + ldrb r0, [r0, 0xB] + ldr r4, _080996C8 + cmp r0, 0 + beq _080996D6 + movs r0, 0x80 + lsls r0, 1 + adds r4, r0 + b _080996D6 + .align 2, 0 +_080996BC: .4byte gUnknown_8116028 +_080996C0: .4byte gUnknown_8300500 +_080996C4: .4byte gUnknown_203B46C +_080996C8: .4byte gUnknown_202D078 +_080996CC: + ldr r4, _080996D0 + b _080996D6 + .align 2, 0 +_080996D0: .4byte gUnknown_202D1B8 +_080996D4: + ldr r4, _08099704 +_080996D6: + movs r0, 0xF0 + adds r1, r4, 0 + movs r2, 0x10 + bl sub_800388C + adds r5, r4, 0 + movs r4, 0 +_080996E4: + adds r0, r4, 0 + adds r0, 0xF0 + adds r1, r5, 0 + adds r5, 0x4 + bl nullsub_5 + adds r4, 0x1 + cmp r4, 0xF + ble _080996E4 + adds r0, r6, 0 + bl sub_800AA14 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08099704: .4byte gUnknown_202D1F8 + thumb_func_end sub_8099690 + + thumb_func_start sub_8099708 +sub_8099708: + push {lr} + sub sp, 0x4 + str r1, [sp] + lsls r0, 16 + lsrs r0, 16 + bl sub_8003810 + add sp, 0x4 + pop {r0} + bx r0 + thumb_func_end sub_8099708 + + thumb_func_start sub_809971C +sub_809971C: + push {r4-r6,lr} + adds r6, r1, 0 + lsls r0, 16 + lsrs r5, r0, 16 + cmp r2, 0 + ble _0809973E + adds r4, r2, 0 +_0809972A: + adds r0, r5, 0 + adds r1, r0, 0x1 + lsls r1, 16 + lsrs r5, r1, 16 + ldm r6!, {r1} + bl sub_8003810 + subs r4, 0x1 + cmp r4, 0 + bne _0809972A +_0809973E: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_809971C + + thumb_func_start sub_8099744 +sub_8099744: + push {lr} + bl sub_80039B8 + pop {r0} + bx r0 + thumb_func_end sub_8099744 + + thumb_func_start sub_8099750 +sub_8099750: + push {lr} + bl TransferBGPaletteBuffer + pop {r0} + bx r0 + thumb_func_end sub_8099750 + + thumb_func_start sub_809975C +sub_809975C: + push {lr} + bl sub_809977C + pop {r0} + bx r0 + thumb_func_end sub_809975C + + thumb_func_start sub_8099768 +sub_8099768: + push {lr} + bl sub_809977C + bl sub_8099744 + bl sub_8099750 + pop {r0} + bx r0 + thumb_func_end sub_8099768 + + thumb_func_start sub_809977C +sub_809977C: + push {r4-r6,lr} + mov r6, r8 + push {r6} + ldr r1, _080997DC + movs r0, 0 + strb r0, [r1] + ldr r1, _080997E0 + movs r0, 0 + strh r0, [r1] + ldr r6, _080997E4 + adds r0, r6, 0 + bl sub_8099838 + ldr r0, _080997E8 + mov r8, r0 + bl sub_8099838 + ldr r4, _080997EC + adds r0, r4, 0 + bl sub_8099838 + subs r4, 0x8 + movs r0, 0 + str r0, [r4] + movs r5, 0x80 + lsls r5, 1 + strh r5, [r4, 0x14] + strh r0, [r6, 0xC] + bl sub_8099DD0 + mov r0, r8 + strh r5, [r0, 0xC] + adds r0, r5, 0 + bl sub_8099E58 + ldr r1, _080997F0 + movs r2, 0 + adds r0, r1, 0 + adds r0, 0x40 +_080997CA: + strh r2, [r0] + subs r0, 0x2 + cmp r0, r1 + bge _080997CA + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080997DC: .4byte gUnknown_2039990 +_080997E0: .4byte gUnknown_2039992 +_080997E4: .4byte gUnknown_2039958 +_080997E8: .4byte gUnknown_2039968 +_080997EC: .4byte gUnknown_2039980 +_080997F0: .4byte gUnknown_2039998 + thumb_func_end sub_809977C + + thumb_func_start sub_80997F4 +sub_80997F4: + push {lr} + lsls r0, 16 + ldr r2, _08099818 + lsrs r0, 15 + adds r0, r2 + strh r1, [r0] + ldr r0, _0809981C + bl sub_8099848 + ldr r0, _08099820 + bl sub_8099848 + ldr r0, _08099824 + bl sub_8099848 + pop {r0} + bx r0 + .align 2, 0 +_08099818: .4byte gUnknown_2039998 +_0809981C: .4byte gUnknown_2039958 +_08099820: .4byte gUnknown_2039968 +_08099824: .4byte gUnknown_2039980 + thumb_func_end sub_80997F4 + + thumb_func_start sub_8099828 +sub_8099828: + lsls r0, 16 + ldr r1, _08099834 + lsrs r0, 15 + adds r0, r1 + ldrh r0, [r0] + bx lr + .align 2, 0 +_08099834: .4byte gUnknown_2039998 + thumb_func_end sub_8099828 + + thumb_func_start sub_8099838 +sub_8099838: + movs r1, 0x1 + str r1, [r0] + movs r1, 0 + strh r1, [r0, 0xC] + strh r1, [r0, 0x4] + strh r1, [r0, 0x6] + bx lr + thumb_func_end sub_8099838 + + thumb_func_start sub_8099848 +sub_8099848: + push {lr} + adds r1, r0, 0 + ldr r0, [r1] + cmp r0, 0 + bne _08099856 + movs r0, 0x1 + str r0, [r1] +_08099856: + pop {r0} + bx r0 + thumb_func_end sub_8099848 + + thumb_func_start sub_809985C +sub_809985C: + push {lr} + adds r2, r0, 0 + cmp r1, 0 + blt _08099872 + cmp r1, 0 + bne _08099874 + movs r0, 0x80 + lsls r0, 1 + strh r0, [r2, 0xC] + movs r0, 0x1 + b _08099876 +_08099872: + movs r1, 0x1E +_08099874: + movs r0, 0x2 +_08099876: + str r0, [r2] + strh r1, [r2, 0x4] + strh r1, [r2, 0x6] + pop {r0} + bx r0 + thumb_func_end sub_809985C + + thumb_func_start sub_8099880 +sub_8099880: + push {lr} + adds r2, r0, 0 + cmp r1, 0 + blt _08099892 + cmp r1, 0 + bne _08099894 + strh r1, [r2, 0xC] + movs r0, 0x1 + b _08099896 +_08099892: + movs r1, 0x1E +_08099894: + movs r0, 0x3 +_08099896: + str r0, [r2] + strh r1, [r2, 0x4] + strh r1, [r2, 0x6] + pop {r0} + bx r0 + thumb_func_end sub_8099880 + + thumb_func_start sub_80998A0 +sub_80998A0: + push {r4,lr} + adds r4, r0, 0 + lsls r2, 16 + lsrs r2, 16 + lsls r3, 16 + lsrs r3, 16 + cmp r1, 0 + bge _080998B2 + movs r1, 0x1E +_080998B2: + cmp r2, r3 + bls _080998BE + movs r0, 0x5 + str r0, [r4] + subs r0, r2, r3 + b _080998D0 +_080998BE: + cmp r2, r3 + bcs _080998CA + movs r0, 0x4 + str r0, [r4] + subs r0, r3, r2 + b _080998D0 +_080998CA: + movs r0, 0x1 + str r0, [r4] + movs r0, 0 +_080998D0: + strh r0, [r4, 0xA] + strh r1, [r4, 0x4] + strh r1, [r4, 0x6] + strh r2, [r4, 0xC] + strh r3, [r4, 0x8] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80998A0 + + thumb_func_start sub_80998E0 +sub_80998E0: + push {r4,lr} + adds r4, r0, 0 + ldr r0, [r4] + cmp r0, 0x5 + bhi _080999CA + lsls r0, 2 + ldr r1, _080998F4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080998F4: .4byte _080998F8 + .align 2, 0 +_080998F8: + .4byte _080999CA + .4byte _080999C2 + .4byte _08099910 + .4byte _08099946 + .4byte _08099976 + .4byte _0809999A +_08099910: + ldrh r0, [r4, 0x4] + subs r0, 0x1 + strh r0, [r4, 0x4] + lsls r0, 16 + cmp r0, 0 + ble _08099940 + movs r1, 0x4 + ldrsh r0, [r4, r1] + lsls r0, 8 + movs r2, 0x6 + ldrsh r1, [r4, r2] + bl __divsi3 + movs r2, 0x80 + lsls r2, 1 + adds r1, r2, 0 + subs r1, r0 + lsls r1, 16 + lsrs r1, 16 + ldrh r0, [r4, 0xC] + cmp r0, r1 + bcs _080999C6 + strh r1, [r4, 0xC] + b _080999C6 +_08099940: + movs r0, 0x80 + lsls r0, 1 + b _080999C0 +_08099946: + ldrh r0, [r4, 0x4] + subs r0, 0x1 + movs r1, 0 + strh r0, [r4, 0x4] + lsls r0, 16 + cmp r0, 0 + ble _08099970 + movs r1, 0x4 + ldrsh r0, [r4, r1] + lsls r0, 8 + movs r2, 0x6 + ldrsh r1, [r4, r2] + bl __divsi3 + lsls r0, 16 + lsrs r1, r0, 16 + ldrh r0, [r4, 0xC] + cmp r0, r1 + bls _080999C6 + strh r1, [r4, 0xC] + b _080999C6 +_08099970: + strh r1, [r4, 0xC] + str r1, [r4] + b _080999C6 +_08099976: + ldrh r0, [r4, 0x4] + subs r0, 0x1 + strh r0, [r4, 0x4] + lsls r0, 16 + cmp r0, 0 + ble _080999BE + movs r0, 0x4 + ldrsh r1, [r4, r0] + ldrh r0, [r4, 0xA] + muls r0, r1 + movs r2, 0x6 + ldrsh r1, [r4, r2] + bl __divsi3 + ldrh r1, [r4, 0x8] + subs r1, r0 + strh r1, [r4, 0xC] + b _080999C6 +_0809999A: + ldrh r0, [r4, 0x4] + subs r0, 0x1 + strh r0, [r4, 0x4] + lsls r0, 16 + cmp r0, 0 + ble _080999BE + movs r0, 0x4 + ldrsh r1, [r4, r0] + ldrh r0, [r4, 0xA] + muls r0, r1 + movs r2, 0x6 + ldrsh r1, [r4, r2] + bl __divsi3 + ldrh r1, [r4, 0x8] + adds r1, r0 + strh r1, [r4, 0xC] + b _080999C6 +_080999BE: + ldrh r0, [r4, 0x8] +_080999C0: + strh r0, [r4, 0xC] +_080999C2: + movs r0, 0 + str r0, [r4] +_080999C6: + movs r0, 0x1 + b _080999CC +_080999CA: + movs r0, 0 +_080999CC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80998E0 + + thumb_func_start sub_80999D4 +sub_80999D4: + ldr r2, _080999E0 + movs r1, 0x1 + strb r1, [r2] + ldr r1, _080999E4 + strh r0, [r1] + bx lr + .align 2, 0 +_080999E0: .4byte gUnknown_2039990 +_080999E4: .4byte gUnknown_2039992 + thumb_func_end sub_80999D4 + + thumb_func_start sub_80999E8 +sub_80999E8: + push {lr} + adds r1, r0, 0 + ldr r0, _080999F8 + bl sub_809985C + pop {r0} + bx r0 + .align 2, 0 +_080999F8: .4byte gUnknown_2039958 + thumb_func_end sub_80999E8 + + thumb_func_start sub_80999FC +sub_80999FC: + push {lr} + adds r1, r0, 0 + ldr r0, _08099A0C + bl sub_8099880 + pop {r0} + bx r0 + .align 2, 0 +_08099A0C: .4byte gUnknown_2039958 + thumb_func_end sub_80999FC + + thumb_func_start sub_8099A10 +sub_8099A10: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r3, r2, 0 + lsls r4, 16 + lsrs r4, 16 + lsls r3, 16 + lsrs r3, 16 + ldr r0, _08099A30 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_80998A0 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08099A30: .4byte gUnknown_2039958 + thumb_func_end sub_8099A10 + + thumb_func_start sub_8099A34 +sub_8099A34: + push {lr} + adds r1, r0, 0 + ldr r0, _08099A44 + bl sub_809985C + pop {r0} + bx r0 + .align 2, 0 +_08099A44: .4byte gUnknown_2039968 + thumb_func_end sub_8099A34 + + thumb_func_start sub_8099A48 +sub_8099A48: + push {lr} + adds r1, r0, 0 + ldr r0, _08099A58 + bl sub_8099880 + pop {r0} + bx r0 + .align 2, 0 +_08099A58: .4byte gUnknown_2039968 + thumb_func_end sub_8099A48 + + thumb_func_start sub_8099A5C +sub_8099A5C: + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + str r2, [sp] + ldr r0, _08099A88 + str r4, [r0] + ldr r2, [sp] + str r2, [r0, 0x4] + movs r2, 0 + strh r2, [r0, 0x14] + adds r0, 0x8 + bl sub_809985C + subs r0, r4, 0x1 + cmp r0, 0xD + bhi _08099AF0 + lsls r0, 2 + ldr r1, _08099A8C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08099A88: .4byte gUnknown_2039978 +_08099A8C: .4byte _08099A90 + .align 2, 0 +_08099A90: + .4byte _08099AC8 + .4byte _08099AF0 + .4byte _08099AC8 + .4byte _08099AF0 + .4byte _08099AE8 + .4byte _08099AF0 + .4byte _08099AE8 + .4byte _08099AF0 + .4byte _08099AE0 + .4byte _08099AF0 + .4byte _08099AE0 + .4byte _08099AF0 + .4byte _08099AE8 + .4byte _08099AE8 +_08099AC8: + ldr r0, _08099AD8 + movs r1, 0x80 + lsls r1, 1 + strh r1, [r0, 0xC] + ldr r0, _08099ADC + strh r1, [r0, 0xC] + b _08099AF0 + .align 2, 0 +_08099AD8: .4byte gUnknown_2039968 +_08099ADC: .4byte gUnknown_2039958 +_08099AE0: + ldr r1, _08099AE4 + b _08099AEA + .align 2, 0 +_08099AE4: .4byte gUnknown_2039968 +_08099AE8: + ldr r1, _08099AF8 +_08099AEA: + movs r0, 0x80 + lsls r0, 1 + strh r0, [r1, 0xC] +_08099AF0: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08099AF8: .4byte gUnknown_2039958 + thumb_func_end sub_8099A5C + + thumb_func_start sub_8099AFC +sub_8099AFC: + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + str r2, [sp] + ldr r0, _08099B28 + str r4, [r0] + ldr r2, [sp] + str r2, [r0, 0x4] + movs r2, 0x80 + lsls r2, 1 + strh r2, [r0, 0x14] + adds r0, 0x8 + bl sub_8099880 + subs r0, r4, 0x2 + cmp r0, 0xC + bhi _08099B86 + lsls r0, 2 + ldr r1, _08099B2C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08099B28: .4byte gUnknown_2039978 +_08099B2C: .4byte _08099B30 + .align 2, 0 +_08099B30: + .4byte _08099B64 + .4byte _08099B86 + .4byte _08099B64 + .4byte _08099B86 + .4byte _08099B80 + .4byte _08099B86 + .4byte _08099B80 + .4byte _08099B86 + .4byte _08099B78 + .4byte _08099B86 + .4byte _08099B78 + .4byte _08099B80 + .4byte _08099B80 +_08099B64: + ldr r0, _08099B70 + movs r1, 0 + strh r1, [r0, 0xC] + ldr r0, _08099B74 + strh r1, [r0, 0xC] + b _08099B86 + .align 2, 0 +_08099B70: .4byte gUnknown_2039968 +_08099B74: .4byte gUnknown_2039958 +_08099B78: + ldr r1, _08099B7C + b _08099B82 + .align 2, 0 +_08099B7C: .4byte gUnknown_2039968 +_08099B80: + ldr r1, _08099B90 +_08099B82: + movs r0, 0 + strh r0, [r1, 0xC] +_08099B86: + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_08099B90: .4byte gUnknown_2039958 + thumb_func_end sub_8099AFC + + thumb_func_start sub_8099B94 +sub_8099B94: + push {lr} + ldr r0, _08099BA4 + ldrb r0, [r0] + cmp r0, 0 + beq _08099BA8 + movs r0, 0x1 + b _08099BD6 + .align 2, 0 +_08099BA4: .4byte gUnknown_2039990 +_08099BA8: + ldr r1, _08099BBC + ldr r0, [r1] + cmp r0, 0 + beq _08099BC0 + ldr r0, [r1, 0x8] + cmp r0, 0 + beq _08099BD6 + movs r0, 0x1 + b _08099BD6 + .align 2, 0 +_08099BBC: .4byte gUnknown_2039978 +_08099BC0: + movs r1, 0 + ldr r0, _08099BDC + ldr r0, [r0] + cmp r0, 0 + bne _08099BD2 + ldr r0, _08099BE0 + ldr r0, [r0] + cmp r0, 0 + beq _08099BD4 +_08099BD2: + movs r1, 0x1 +_08099BD4: + adds r0, r1, 0 +_08099BD6: + pop {r1} + bx r1 + .align 2, 0 +_08099BDC: .4byte gUnknown_2039958 +_08099BE0: .4byte gUnknown_2039968 + thumb_func_end sub_8099B94 + + thumb_func_start sub_8099BE4 +sub_8099BE4: + push {r4,r5,lr} + ldr r4, _08099C10 + ldr r0, [r4] + cmp r0, 0 + bne _08099BF6 + ldr r0, [r4, 0x8] + cmp r0, 0 + bne _08099BF6 + b _08099D08 +_08099BF6: + adds r0, r4, 0 + adds r0, 0x8 + bl sub_80998E0 + lsls r0, 24 + cmp r0, 0 + beq _08099C14 + ldrh r0, [r4, 0x14] + ldr r1, [r4, 0x4] + bl sub_8099E80 + b _08099DC0 + .align 2, 0 +_08099C10: .4byte gUnknown_2039978 +_08099C14: + ldr r0, [r4, 0x8] + cmp r0, 0 + beq _08099C1C + b _08099DC0 +_08099C1C: + ldr r0, [r4] + cmp r0, 0xE + bls _08099C24 + b _08099DC0 +_08099C24: + lsls r0, 2 + ldr r1, _08099C30 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08099C30: .4byte _08099C34 + .align 2, 0 +_08099C34: + .4byte _08099DC0 + .4byte _08099C70 + .4byte _08099CD8 + .4byte _08099C70 + .4byte _08099CD8 + .4byte _08099C70 + .4byte _08099CD8 + .4byte _08099C70 + .4byte _08099CD8 + .4byte _08099C70 + .4byte _08099CD8 + .4byte _08099C70 + .4byte _08099CD8 + .4byte _08099CD8 + .4byte _08099CD8 +_08099C70: + ldr r0, _08099C80 + ldrh r1, [r0, 0x14] + adds r3, r0, 0 + cmp r1, 0xFF + bls _08099C84 + movs r0, 0 + str r0, [r3] + b _08099DC0 + .align 2, 0 +_08099C80: .4byte gUnknown_2039978 +_08099C84: + ldr r0, _08099CA0 + ldrb r0, [r0] + cmp r0, 0 + bne _08099C8E + b _08099DC0 +_08099C8E: + movs r2, 0 + ldr r0, [r3] + cmp r0, 0x3 + beq _08099CB2 + cmp r0, 0x3 + bhi _08099CA4 + cmp r0, 0x1 + beq _08099CAE + b _08099CBC + .align 2, 0 +_08099CA0: .4byte gUnknown_2039990 +_08099CA4: + cmp r0, 0x5 + beq _08099CB6 + cmp r0, 0x7 + beq _08099CBA + b _08099CBC +_08099CAE: + movs r2, 0x2 + b _08099CC0 +_08099CB2: + movs r2, 0x4 + b _08099CC0 +_08099CB6: + movs r2, 0x6 + b _08099CC0 +_08099CBA: + movs r2, 0x8 +_08099CBC: + cmp r2, 0 + beq _08099CD4 +_08099CC0: + ldr r0, _08099CD0 + movs r4, 0 + ldrsh r1, [r0, r4] + adds r0, r2, 0 + ldr r2, [r3, 0x4] + bl sub_8099AFC + b _08099DC0 + .align 2, 0 +_08099CD0: .4byte gUnknown_2039992 +_08099CD4: + str r2, [r3] + b _08099DC0 +_08099CD8: + ldr r2, _08099CE4 + ldrh r0, [r2, 0x14] + cmp r0, 0 + bne _08099CE8 + str r0, [r2] + b _08099DC0 + .align 2, 0 +_08099CE4: .4byte gUnknown_2039978 +_08099CE8: + ldr r0, _08099D00 + ldrb r0, [r0] + cmp r0, 0 + beq _08099DC0 + ldr r0, [r2] + ldr r1, _08099D04 + movs r3, 0 + ldrsh r1, [r1, r3] + ldr r2, [r2, 0x4] + bl sub_8099AFC + b _08099DC0 + .align 2, 0 +_08099D00: .4byte gUnknown_2039990 +_08099D04: .4byte gUnknown_2039992 +_08099D08: + ldr r0, _08099D88 + ldrb r0, [r0] + cmp r0, 0 + beq _08099D98 + movs r5, 0x1 + ldr r4, _08099D8C + ldrh r0, [r4, 0xC] + cmp r0, 0 + bne _08099D20 + ldr r0, [r4] + cmp r0, 0 + beq _08099D46 +_08099D20: + movs r5, 0 + ldr r0, [r4] + cmp r0, 0x3 + beq _08099D34 + ldr r0, _08099D90 + movs r2, 0 + ldrsh r1, [r0, r2] + adds r0, r4, 0 + bl sub_8099880 +_08099D34: + adds r0, r4, 0 + bl sub_80998E0 + lsls r0, 24 + cmp r0, 0 + beq _08099D46 + ldrh r0, [r4, 0xC] + bl sub_8099DD0 +_08099D46: + ldr r4, _08099D94 + ldrh r0, [r4, 0xC] + cmp r0, 0 + bne _08099D54 + ldr r0, [r4] + cmp r0, 0 + beq _08099D7A +_08099D54: + movs r5, 0 + ldr r0, [r4] + cmp r0, 0x3 + beq _08099D68 + ldr r0, _08099D90 + movs r3, 0 + ldrsh r1, [r0, r3] + adds r0, r4, 0 + bl sub_8099880 +_08099D68: + adds r0, r4, 0 + bl sub_80998E0 + lsls r0, 24 + cmp r0, 0 + beq _08099D7A + ldrh r0, [r4, 0xC] + bl sub_8099E58 +_08099D7A: + cmp r5, 0 + beq _08099DC0 + ldr r1, _08099D88 + movs r0, 0 + strb r0, [r1] + b _08099DC0 + .align 2, 0 +_08099D88: .4byte gUnknown_2039990 +_08099D8C: .4byte gUnknown_2039958 +_08099D90: .4byte gUnknown_2039992 +_08099D94: .4byte gUnknown_2039968 +_08099D98: + ldr r4, _08099DC8 + adds r0, r4, 0 + bl sub_80998E0 + lsls r0, 24 + cmp r0, 0 + beq _08099DAC + ldrh r0, [r4, 0xC] + bl sub_8099DD0 +_08099DAC: + ldr r4, _08099DCC + adds r0, r4, 0 + bl sub_80998E0 + lsls r0, 24 + cmp r0, 0 + beq _08099DC0 + ldrh r0, [r4, 0xC] + bl sub_8099E58 +_08099DC0: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08099DC8: .4byte gUnknown_2039958 +_08099DCC: .4byte gUnknown_2039968 + thumb_func_end sub_8099BE4 + + thumb_func_start sub_8099DD0 +sub_8099DD0: + push {r4-r7,lr} + lsls r0, 16 + lsrs r7, r0, 16 + movs r4, 0 + ldr r6, _08099DF4 + movs r5, 0xD +_08099DDC: + ldrh r1, [r6] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08099DF8 + lsrs r0, r4, 16 + movs r1, 0x80 + lsls r1, 1 + bl sub_8003664 + b _08099E00 + .align 2, 0 +_08099DF4: .4byte gUnknown_2039998 +_08099DF8: + lsrs r0, r4, 16 + adds r1, r7, 0 + bl sub_8003664 +_08099E00: + movs r0, 0x80 + lsls r0, 9 + adds r4, r0 + adds r6, 0x2 + subs r5, 0x1 + cmp r5, 0 + bge _08099DDC + ldr r0, _08099E30 + movs r4, 0x80 + lsls r4, 13 + adds r6, r0, 0 + adds r6, 0x20 + movs r5, 0xE +_08099E1A: + ldrh r1, [r6] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08099E34 + lsrs r0, r4, 16 + movs r1, 0x80 + lsls r1, 1 + bl sub_8003664 + b _08099E3C + .align 2, 0 +_08099E30: .4byte gUnknown_2039998 +_08099E34: + lsrs r0, r4, 16 + adds r1, r7, 0 + bl sub_8003664 +_08099E3C: + movs r0, 0x80 + lsls r0, 9 + adds r4, r0 + adds r6, 0x2 + subs r5, 0x1 + cmp r5, 0 + bge _08099E1A + movs r0, 0x20 + adds r1, r7, 0 + bl sub_8003664 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8099DD0 + + thumb_func_start sub_8099E58 +sub_8099E58: + push {r4,lr} + adds r4, r0, 0 + lsls r4, 16 + lsrs r4, 16 + movs r0, 0xF + adds r1, r4, 0 + bl sub_8003664 + movs r0, 0xE + adds r1, r4, 0 + bl sub_8003664 + movs r0, 0x1F + adds r1, r4, 0 + bl sub_8003664 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_8099E58 + + thumb_func_start sub_8099E80 +sub_8099E80: + push {r4-r7,lr} + sub sp, 0x4 + str r1, [sp] + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, _08099EA0 + ldr r1, [r0] + adds r2, r0, 0 + cmp r1, 0xE + bls _08099E96 + b _0809A558 +_08099E96: + lsls r0, r1, 2 + ldr r1, _08099EA4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_08099EA0: .4byte gUnknown_2039978 +_08099EA4: .4byte _08099EA8 + .align 2, 0 +_08099EA8: + .4byte _0809A558 + .4byte _08099EE4 + .4byte _0809A05A + .4byte _0809A1D2 + .4byte _0809A34A + .4byte _08099FDE + .4byte _0809A156 + .4byte _0809A2CE + .4byte _0809A4BC + .4byte _08099F5E + .4byte _0809A0D6 + .4byte _0809A24E + .4byte _0809A3EA + .4byte _0809A48A + .4byte _0809A48A +_08099EE4: + movs r4, 0 + movs r5, 0 + ldr r7, _08099F00 +_08099EEA: + ldrh r1, [r7] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08099F04 + lsrs r0, r5, 16 + movs r1, 0x80 + lsls r1, 1 + bl sub_8003664 + b _08099F0E + .align 2, 0 +_08099F00: .4byte gUnknown_2039998 +_08099F04: + lsrs r0, r5, 16 + adds r1, r6, 0 + ldr r2, [sp] + bl sub_80036AC +_08099F0E: + movs r0, 0x80 + lsls r0, 9 + adds r5, r0 + adds r7, 0x2 + adds r4, 0x1 + cmp r4, 0xF + ble _08099EEA + movs r4, 0x10 + movs r5, 0x80 + lsls r5, 13 + ldr r0, _08099F40 + adds r7, r0, 0 + adds r7, 0x20 +_08099F28: + ldrh r1, [r7] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08099F44 + lsrs r0, r5, 16 + movs r1, 0x80 + lsls r1, 1 + bl sub_8003664 + b _08099F4E + .align 2, 0 +_08099F40: .4byte gUnknown_2039998 +_08099F44: + lsrs r0, r5, 16 + adds r1, r6, 0 + ldr r2, [sp] + bl sub_80036AC +_08099F4E: + movs r0, 0x80 + lsls r0, 9 + adds r5, r0 + adds r7, 0x2 + adds r4, 0x1 + cmp r4, 0x1F + ble _08099F28 + b _0809A558 +_08099F5E: + movs r4, 0xE + movs r5, 0xE0 + lsls r5, 12 + ldr r0, _08099F80 + adds r7, r0, 0 + adds r7, 0x1C +_08099F6A: + ldrh r1, [r7] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08099F84 + lsrs r0, r5, 16 + movs r1, 0x80 + lsls r1, 1 + bl sub_8003664 + b _08099F8E + .align 2, 0 +_08099F80: .4byte gUnknown_2039998 +_08099F84: + lsrs r0, r5, 16 + adds r1, r6, 0 + ldr r2, [sp] + bl sub_80036AC +_08099F8E: + movs r0, 0x80 + lsls r0, 9 + adds r5, r0 + adds r7, 0x2 + adds r4, 0x1 + cmp r4, 0xF + ble _08099F6A + movs r4, 0x1F + movs r5, 0xF8 + lsls r5, 13 + ldr r0, _08099FC0 + adds r7, r0, 0 + adds r7, 0x3E +_08099FA8: + ldrh r1, [r7] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _08099FC4 + lsrs r0, r5, 16 + movs r1, 0x80 + lsls r1, 1 + bl sub_8003664 + b _08099FCE + .align 2, 0 +_08099FC0: .4byte gUnknown_2039998 +_08099FC4: + lsrs r0, r5, 16 + adds r1, r6, 0 + ldr r2, [sp] + bl sub_80036AC +_08099FCE: + movs r0, 0x80 + lsls r0, 9 + adds r5, r0 + adds r7, 0x2 + adds r4, 0x1 + cmp r4, 0x1F + ble _08099FA8 + b _0809A558 +_08099FDE: + movs r4, 0 + movs r5, 0 + ldr r7, _08099FFC +_08099FE4: + ldrh r1, [r7] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0809A000 + lsrs r0, r5, 16 + movs r1, 0x80 + lsls r1, 1 + bl sub_8003664 + b _0809A00A + .align 2, 0 +_08099FFC: .4byte gUnknown_2039998 +_0809A000: + lsrs r0, r5, 16 + adds r1, r6, 0 + ldr r2, [sp] + bl sub_80036AC +_0809A00A: + movs r0, 0x80 + lsls r0, 9 + adds r5, r0 + adds r7, 0x2 + adds r4, 0x1 + cmp r4, 0xD + ble _08099FE4 + movs r4, 0x10 + movs r5, 0x80 + lsls r5, 13 + ldr r0, _0809A03C + adds r7, r0, 0 + adds r7, 0x20 +_0809A024: + ldrh r1, [r7] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0809A040 + lsrs r0, r5, 16 + movs r1, 0x80 + lsls r1, 1 + bl sub_8003664 + b _0809A04A + .align 2, 0 +_0809A03C: .4byte gUnknown_2039998 +_0809A040: + lsrs r0, r5, 16 + adds r1, r6, 0 + ldr r2, [sp] + bl sub_80036AC +_0809A04A: + movs r0, 0x80 + lsls r0, 9 + adds r5, r0 + adds r7, 0x2 + adds r4, 0x1 + cmp r4, 0x1E + ble _0809A024 + b _0809A558 +_0809A05A: + movs r4, 0 + movs r5, 0 + ldr r7, _0809A078 +_0809A060: + ldrh r1, [r7] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0809A07C + lsrs r0, r5, 16 + movs r1, 0x80 + lsls r1, 1 + bl sub_8003664 + b _0809A086 + .align 2, 0 +_0809A078: .4byte gUnknown_2039998 +_0809A07C: + lsrs r0, r5, 16 + adds r1, r6, 0 + ldr r2, [sp] + bl sub_80036F4 +_0809A086: + movs r0, 0x80 + lsls r0, 9 + adds r5, r0 + adds r7, 0x2 + adds r4, 0x1 + cmp r4, 0xF + ble _0809A060 + movs r4, 0x10 + movs r5, 0x80 + lsls r5, 13 + ldr r0, _0809A0B8 + adds r7, r0, 0 + adds r7, 0x20 +_0809A0A0: + ldrh r1, [r7] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0809A0BC + lsrs r0, r5, 16 + movs r1, 0x80 + lsls r1, 1 + bl sub_8003664 + b _0809A0C6 + .align 2, 0 +_0809A0B8: .4byte gUnknown_2039998 +_0809A0BC: + lsrs r0, r5, 16 + adds r1, r6, 0 + ldr r2, [sp] + bl sub_80036F4 +_0809A0C6: + movs r0, 0x80 + lsls r0, 9 + adds r5, r0 + adds r7, 0x2 + adds r4, 0x1 + cmp r4, 0x1F + ble _0809A0A0 + b _0809A558 +_0809A0D6: + movs r4, 0xE + movs r5, 0xE0 + lsls r5, 12 + ldr r0, _0809A0F8 + adds r7, r0, 0 + adds r7, 0x1C +_0809A0E2: + ldrh r1, [r7] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0809A0FC + lsrs r0, r5, 16 + movs r1, 0x80 + lsls r1, 1 + bl sub_8003664 + b _0809A106 + .align 2, 0 +_0809A0F8: .4byte gUnknown_2039998 +_0809A0FC: + lsrs r0, r5, 16 + adds r1, r6, 0 + ldr r2, [sp] + bl sub_80036F4 +_0809A106: + movs r0, 0x80 + lsls r0, 9 + adds r5, r0 + adds r7, 0x2 + adds r4, 0x1 + cmp r4, 0xF + ble _0809A0E2 + movs r4, 0x1F + movs r5, 0xF8 + lsls r5, 13 + ldr r0, _0809A138 + adds r7, r0, 0 + adds r7, 0x3E +_0809A120: + ldrh r1, [r7] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0809A13C + lsrs r0, r5, 16 + movs r1, 0x80 + lsls r1, 1 + bl sub_8003664 + b _0809A146 + .align 2, 0 +_0809A138: .4byte gUnknown_2039998 +_0809A13C: + lsrs r0, r5, 16 + adds r1, r6, 0 + ldr r2, [sp] + bl sub_80036F4 +_0809A146: + movs r0, 0x80 + lsls r0, 9 + adds r5, r0 + adds r7, 0x2 + adds r4, 0x1 + cmp r4, 0x1F + ble _0809A120 + b _0809A558 +_0809A156: + movs r4, 0 + movs r5, 0 + ldr r7, _0809A174 +_0809A15C: + ldrh r1, [r7] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0809A178 + lsrs r0, r5, 16 + movs r1, 0x80 + lsls r1, 1 + bl sub_8003664 + b _0809A182 + .align 2, 0 +_0809A174: .4byte gUnknown_2039998 +_0809A178: + lsrs r0, r5, 16 + adds r1, r6, 0 + ldr r2, [sp] + bl sub_80036F4 +_0809A182: + movs r0, 0x80 + lsls r0, 9 + adds r5, r0 + adds r7, 0x2 + adds r4, 0x1 + cmp r4, 0xD + ble _0809A15C + movs r4, 0x10 + movs r5, 0x80 + lsls r5, 13 + ldr r0, _0809A1B4 + adds r7, r0, 0 + adds r7, 0x20 +_0809A19C: + ldrh r1, [r7] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0809A1B8 + lsrs r0, r5, 16 + movs r1, 0x80 + lsls r1, 1 + bl sub_8003664 + b _0809A1C2 + .align 2, 0 +_0809A1B4: .4byte gUnknown_2039998 +_0809A1B8: + lsrs r0, r5, 16 + adds r1, r6, 0 + ldr r2, [sp] + bl sub_80036F4 +_0809A1C2: + movs r0, 0x80 + lsls r0, 9 + adds r5, r0 + adds r7, 0x2 + adds r4, 0x1 + cmp r4, 0x1E + ble _0809A19C + b _0809A558 +_0809A1D2: + movs r4, 0 + movs r5, 0 + ldr r7, _0809A1F0 +_0809A1D8: + ldrh r1, [r7] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0809A1F4 + lsrs r0, r5, 16 + movs r1, 0x80 + lsls r1, 1 + bl sub_8003664 + b _0809A1FE + .align 2, 0 +_0809A1F0: .4byte gUnknown_2039998 +_0809A1F4: + lsrs r0, r5, 16 + adds r1, r6, 0 + ldr r2, [sp] + bl sub_8003780 +_0809A1FE: + movs r0, 0x80 + lsls r0, 9 + adds r5, r0 + adds r7, 0x2 + adds r4, 0x1 + cmp r4, 0xF + ble _0809A1D8 + movs r4, 0x10 + movs r5, 0x80 + lsls r5, 13 + ldr r0, _0809A230 + adds r7, r0, 0 + adds r7, 0x20 +_0809A218: + ldrh r1, [r7] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0809A234 + lsrs r0, r5, 16 + movs r1, 0x80 + lsls r1, 1 + bl sub_8003664 + b _0809A23E + .align 2, 0 +_0809A230: .4byte gUnknown_2039998 +_0809A234: + lsrs r0, r5, 16 + adds r1, r6, 0 + ldr r2, [sp] + bl sub_8003780 +_0809A23E: + movs r0, 0x80 + lsls r0, 9 + adds r5, r0 + adds r7, 0x2 + adds r4, 0x1 + cmp r4, 0x1F + ble _0809A218 + b _0809A558 +_0809A24E: + movs r4, 0xE + movs r5, 0xE0 + lsls r5, 12 + ldr r0, _0809A270 + adds r7, r0, 0 + adds r7, 0x1C +_0809A25A: + ldrh r1, [r7] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0809A274 + lsrs r0, r5, 16 + movs r1, 0x80 + lsls r1, 1 + bl sub_8003664 + b _0809A27E + .align 2, 0 +_0809A270: .4byte gUnknown_2039998 +_0809A274: + lsrs r0, r5, 16 + adds r1, r6, 0 + ldr r2, [sp] + bl sub_8003780 +_0809A27E: + movs r0, 0x80 + lsls r0, 9 + adds r5, r0 + adds r7, 0x2 + adds r4, 0x1 + cmp r4, 0xF + ble _0809A25A + movs r4, 0x1F + movs r5, 0xF8 + lsls r5, 13 + ldr r0, _0809A2B0 + adds r7, r0, 0 + adds r7, 0x3E +_0809A298: + ldrh r1, [r7] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0809A2B4 + lsrs r0, r5, 16 + movs r1, 0x80 + lsls r1, 1 + bl sub_8003664 + b _0809A2BE + .align 2, 0 +_0809A2B0: .4byte gUnknown_2039998 +_0809A2B4: + lsrs r0, r5, 16 + adds r1, r6, 0 + ldr r2, [sp] + bl sub_8003780 +_0809A2BE: + movs r0, 0x80 + lsls r0, 9 + adds r5, r0 + adds r7, 0x2 + adds r4, 0x1 + cmp r4, 0x1F + ble _0809A298 + b _0809A558 +_0809A2CE: + movs r4, 0 + movs r5, 0 + ldr r7, _0809A2EC +_0809A2D4: + ldrh r1, [r7] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0809A2F0 + lsrs r0, r5, 16 + movs r1, 0x80 + lsls r1, 1 + bl sub_8003664 + b _0809A2FA + .align 2, 0 +_0809A2EC: .4byte gUnknown_2039998 +_0809A2F0: + lsrs r0, r5, 16 + adds r1, r6, 0 + ldr r2, [sp] + bl sub_8003780 +_0809A2FA: + movs r0, 0x80 + lsls r0, 9 + adds r5, r0 + adds r7, 0x2 + adds r4, 0x1 + cmp r4, 0xD + ble _0809A2D4 + movs r4, 0x10 + movs r5, 0x80 + lsls r5, 13 + ldr r0, _0809A32C + adds r7, r0, 0 + adds r7, 0x20 +_0809A314: + ldrh r1, [r7] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0809A330 + lsrs r0, r5, 16 + movs r1, 0x80 + lsls r1, 1 + bl sub_8003664 + b _0809A33A + .align 2, 0 +_0809A32C: .4byte gUnknown_2039998 +_0809A330: + lsrs r0, r5, 16 + adds r1, r6, 0 + ldr r2, [sp] + bl sub_8003780 +_0809A33A: + movs r0, 0x80 + lsls r0, 9 + adds r5, r0 + adds r7, 0x2 + adds r4, 0x1 + cmp r4, 0x1E + ble _0809A314 + b _0809A558 +_0809A34A: + movs r4, 0 + movs r5, 0 +_0809A34E: + ldr r0, _0809A36C + lsls r1, r4, 1 + adds r1, r0 + ldrh r1, [r1] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0809A370 + lsrs r0, r5, 16 + movs r1, 0x80 + lsls r1, 1 + bl sub_8003664 + b _0809A38C + .align 2, 0 +_0809A36C: .4byte gUnknown_2039998 +_0809A370: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0809A382 + lsrs r0, r5, 16 + adds r1, r6, 0 + bl sub_8003664 + b _0809A38C +_0809A382: + lsrs r0, r5, 16 + adds r1, r6, 0 + ldr r2, [sp] + bl sub_80037C8 +_0809A38C: + movs r0, 0x80 + lsls r0, 9 + adds r5, r0 + adds r4, 0x1 + cmp r4, 0xF + ble _0809A34E + movs r4, 0x10 + movs r5, 0x80 + lsls r5, 13 +_0809A39E: + ldr r0, _0809A3BC + lsls r1, r4, 1 + adds r1, r0 + ldrh r1, [r1] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0809A3C0 + lsrs r0, r5, 16 + movs r1, 0x80 + lsls r1, 1 + bl sub_8003664 + b _0809A3DC + .align 2, 0 +_0809A3BC: .4byte gUnknown_2039998 +_0809A3C0: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0809A3D2 + lsrs r0, r5, 16 + adds r1, r6, 0 + bl sub_8003664 + b _0809A3DC +_0809A3D2: + lsrs r0, r5, 16 + adds r1, r6, 0 + ldr r2, [sp] + bl sub_80037C8 +_0809A3DC: + movs r0, 0x80 + lsls r0, 9 + adds r5, r0 + adds r4, 0x1 + cmp r4, 0x1F + ble _0809A39E + b _0809A558 +_0809A3EA: + movs r4, 0xE + movs r5, 0xE0 + lsls r5, 12 +_0809A3F0: + ldr r0, _0809A40C + lsls r1, r4, 1 + adds r1, r0 + ldrh r1, [r1] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0809A410 + lsrs r0, r5, 16 + movs r1, 0x80 + lsls r1, 1 + bl sub_8003664 + b _0809A42C + .align 2, 0 +_0809A40C: .4byte gUnknown_2039998 +_0809A410: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0809A422 + lsrs r0, r5, 16 + adds r1, r6, 0 + bl sub_8003664 + b _0809A42C +_0809A422: + lsrs r0, r5, 16 + adds r1, r6, 0 + ldr r2, [sp] + bl sub_80037C8 +_0809A42C: + movs r0, 0x80 + lsls r0, 9 + adds r5, r0 + adds r4, 0x1 + cmp r4, 0xF + ble _0809A3F0 + movs r4, 0x1F + movs r5, 0xF8 + lsls r5, 13 +_0809A43E: + ldr r0, _0809A45C + lsls r1, r4, 1 + adds r1, r0 + ldrh r1, [r1] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0809A460 + lsrs r0, r5, 16 + movs r1, 0x80 + lsls r1, 1 + bl sub_8003664 + b _0809A47C + .align 2, 0 +_0809A45C: .4byte gUnknown_2039998 +_0809A460: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0809A472 + lsrs r0, r5, 16 + adds r1, r6, 0 + bl sub_8003664 + b _0809A47C +_0809A472: + lsrs r0, r5, 16 + adds r1, r6, 0 + ldr r2, [sp] + bl sub_80037C8 +_0809A47C: + movs r0, 0x80 + lsls r0, 9 + adds r5, r0 + adds r4, 0x1 + cmp r4, 0x1F + ble _0809A43E + b _0809A558 +_0809A48A: + ldr r0, [r2] + cmp r0, 0xD + beq _0809A496 + cmp r0, 0xE + beq _0809A4AA + b _0809A4BC +_0809A496: + mov r0, sp + movs r1, 0x90 + strb r1, [r0] + strb r1, [r0, 0x1] + mov r1, sp + movs r0, 0xFF + strb r0, [r1, 0x2] + movs r0, 0x1 + negs r0, r0 + b _0809A4BA +_0809A4AA: + mov r1, sp + movs r0, 0xFF + strb r0, [r1] + movs r0, 0xC0 + strb r0, [r1, 0x1] + movs r0, 0x80 + strb r0, [r1, 0x2] + subs r0, 0x81 +_0809A4BA: + strb r0, [r1, 0x3] +_0809A4BC: + movs r4, 0 + movs r5, 0 +_0809A4C0: + ldr r0, _0809A4DC + lsls r1, r4, 1 + adds r1, r0 + ldrh r1, [r1] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0809A4E0 + lsrs r0, r5, 16 + movs r1, 0x80 + lsls r1, 1 + bl sub_8003664 + b _0809A4FC + .align 2, 0 +_0809A4DC: .4byte gUnknown_2039998 +_0809A4E0: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0809A4F2 + lsrs r0, r5, 16 + adds r1, r6, 0 + bl sub_8003664 + b _0809A4FC +_0809A4F2: + lsrs r0, r5, 16 + adds r1, r6, 0 + ldr r2, [sp] + bl sub_80037C8 +_0809A4FC: + movs r0, 0x80 + lsls r0, 9 + adds r5, r0 + adds r4, 0x1 + cmp r4, 0xD + ble _0809A4C0 + movs r4, 0x10 + movs r5, 0x80 + lsls r5, 13 +_0809A50E: + ldr r0, _0809A52C + lsls r1, r4, 1 + adds r1, r0 + ldrh r1, [r1] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _0809A530 + lsrs r0, r5, 16 + movs r1, 0x80 + lsls r1, 1 + bl sub_8003664 + b _0809A54C + .align 2, 0 +_0809A52C: .4byte gUnknown_2039998 +_0809A530: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0809A542 + lsrs r0, r5, 16 + adds r1, r6, 0 + bl sub_8003664 + b _0809A54C +_0809A542: + lsrs r0, r5, 16 + adds r1, r6, 0 + ldr r2, [sp] + bl sub_80037C8 +_0809A54C: + movs r0, 0x80 + lsls r0, 9 + adds r5, r0 + adds r4, 0x1 + cmp r4, 0x1E + ble _0809A50E +_0809A558: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_8099E80 + + thumb_func_start sub_809A560 +sub_809A560: + push {r4-r6,lr} + bl sub_8014144 + ldr r6, _0809A5F4 + movs r0, 0xB5 + lsls r0, 3 + movs r1, 0x6 + bl MemoryAlloc + str r0, [r6] + movs r4, 0 + str r4, [r0] + movs r5, 0x1 + negs r5, r5 + str r5, [r0, 0x4] + str r5, [r0, 0x8] + ldr r0, _0809A5F8 + strh r4, [r0] + ldr r0, _0809A5FC + strh r4, [r0] + movs r0, 0 + movs r1, 0x14 + bl sub_80095CC + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0 + movs r1, 0x14 + bl sub_8009408 + bl sub_809B294 + ldr r0, [r6] + ldr r2, _0809A600 + adds r1, r0, r2 + str r4, [r1] + adds r2, 0x4 + adds r1, r0, r2 + str r4, [r1] + adds r2, 0x4 + adds r1, r0, r2 + str r4, [r1] + adds r2, 0x4 + adds r1, r0, r2 + str r4, [r1] + adds r2, 0x4 + adds r1, r0, r2 + str r4, [r1] + adds r2, 0x4 + adds r1, r0, r2 + str r4, [r1] + adds r2, 0x4 + adds r1, r0, r2 + str r4, [r1] + adds r2, 0x4 + adds r1, r0, r2 + str r5, [r1] + ldr r1, _0809A604 + adds r0, r1 + str r5, [r0] + bl sub_809A7EC + ldr r0, [r6] + ldr r2, _0809A608 + adds r0, r2 + ldr r1, _0809A60C + strh r1, [r0] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0809A5F4: .4byte gUnknown_3001B64 +_0809A5F8: .4byte gUnknown_20399DC +_0809A5FC: .4byte gUnknown_20399DE +_0809A600: .4byte 0x00000414 +_0809A604: .4byte 0x00000434 +_0809A608: .4byte 0x000005a4 +_0809A60C: .4byte 0x0000ffff + thumb_func_end sub_809A560 + + thumb_func_start sub_809A610 +sub_809A610: + push {r4,lr} + bl sub_809A62C + ldr r4, _0809A628 + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0809A628: .4byte gUnknown_3001B64 + thumb_func_end sub_809A610 + + thumb_func_start sub_809A62C +sub_809A62C: + push {r4,lr} + ldr r0, _0809A670 + ldr r0, [r0] + movs r2, 0 + str r2, [r0] + movs r1, 0x1 + negs r1, r1 + str r1, [r0, 0x4] + str r1, [r0, 0x8] + ldr r0, _0809A674 + strh r2, [r0] + ldr r0, _0809A678 + strh r2, [r0] + movs r4, 0 +_0809A648: + lsls r0, r4, 16 + asrs r0, 16 + bl sub_809A83C + adds r4, 0x1 + cmp r4, 0x9 + ble _0809A648 + ldr r0, _0809A670 + ldr r0, [r0] + ldr r1, _0809A67C + adds r0, r1 + movs r1, 0 + str r1, [r0] + movs r0, 0 + movs r1, 0x1 + bl sub_809A680 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0809A670: .4byte gUnknown_3001B64 +_0809A674: .4byte gUnknown_20399DC +_0809A678: .4byte gUnknown_20399DE +_0809A67C: .4byte 0x00000414 + thumb_func_end sub_809A62C + + thumb_func_start sub_809A680 +sub_809A680: + push {r4,lr} + adds r4, r0, 0 + cmp r4, 0x4 + bhi _0809A6C2 + lsls r0, r4, 2 + ldr r1, _0809A694 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0809A694: .4byte _0809A698 + .align 2, 0 +_0809A698: + .4byte _0809A6AC + .4byte _0809A6BC + .4byte _0809A6BC + .4byte _0809A6BC + .4byte _0809A6BC +_0809A6AC: + bl sub_809B294 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + b _0809A6D0 +_0809A6BC: + bl sub_809B294 + b _0809A6D0 +_0809A6C2: + bl sub_809B294 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C +_0809A6D0: + ldr r0, _0809A6E0 + ldr r0, [r0] + str r4, [r0] + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_0809A6E0: .4byte gUnknown_3001B64 + thumb_func_end sub_809A680 + + thumb_func_start sub_809A6E4 +sub_809A6E4: + lsls r0, 16 + lsrs r0, 16 + ldr r2, _0809A6F4 + ldrh r1, [r2] + orrs r0, r1 + strh r0, [r2] + bx lr + .align 2, 0 +_0809A6F4: .4byte gUnknown_20399DC + thumb_func_end sub_809A6E4 + + thumb_func_start sub_809A6F8 +sub_809A6F8: + lsls r0, 16 + lsrs r0, 16 + ldr r2, _0809A708 + ldrh r1, [r2] + bics r1, r0 + strh r1, [r2] + bx lr + .align 2, 0 +_0809A708: .4byte gUnknown_20399DC + thumb_func_end sub_809A6F8 + + thumb_func_start sub_809A70C +sub_809A70C: + ldr r0, _0809A714 + ldrh r0, [r0] + bx lr + .align 2, 0 +_0809A714: .4byte gUnknown_20399DC + thumb_func_end sub_809A70C + + thumb_func_start nullsub_209 +nullsub_209: + bx lr + thumb_func_end nullsub_209 + + thumb_func_start sub_809A71C +sub_809A71C: + push {lr} + adds r1, r0, 0 + ldr r0, _0809A734 + ldr r0, [r0] + str r1, [r0, 0x4] + str r1, [r0, 0x8] + adds r0, r1, 0 + bl sub_801416C + pop {r0} + bx r0 + .align 2, 0 +_0809A734: .4byte gUnknown_3001B64 + thumb_func_end sub_809A71C + + thumb_func_start sub_809A738 +sub_809A738: + push {lr} + ldr r2, _0809A74C + ldr r2, [r2] + str r0, [r2, 0x4] + str r1, [r2, 0x8] + bl sub_801416C + pop {r0} + bx r0 + .align 2, 0 +_0809A74C: .4byte gUnknown_3001B64 + thumb_func_end sub_809A738 + + thumb_func_start sub_809A750 +sub_809A750: + push {lr} + ldr r0, _0809A764 + ldr r0, [r0] + adds r0, 0xC + bl sub_809B40C + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_0809A764: .4byte gUnknown_3001B64 + thumb_func_end sub_809A750 + + thumb_func_start sub_809A768 +sub_809A768: + movs r0, 0 + bx lr + thumb_func_end sub_809A768 + + thumb_func_start sub_809A76C +sub_809A76C: + push {lr} + ldr r0, _0809A78C + ldr r0, [r0] + ldr r1, [r0] + cmp r1, 0x1 + bcc _0809A7A4 + cmp r1, 0x2 + bls _0809A790 + cmp r1, 0x3 + bne _0809A7A4 + adds r0, 0xC + movs r2, 0x1 + negs r2, r2 + movs r1, 0x4 + b _0809A798 + .align 2, 0 +_0809A78C: .4byte gUnknown_3001B64 +_0809A790: + adds r0, 0xC + movs r2, 0x1 + negs r2, r2 + movs r1, 0x84 +_0809A798: + movs r3, 0 + bl sub_809B2B8 + lsls r0, 24 + lsrs r0, 24 + b _0809A7AE +_0809A7A4: + movs r0, 0 + movs r1, 0x1 + bl sub_809A680 + movs r0, 0 +_0809A7AE: + pop {r1} + bx r1 + thumb_func_end sub_809A76C + + thumb_func_start sub_809A7B4 +sub_809A7B4: + push {lr} + ldr r0, _0809A7D8 + ldr r0, [r0] + ldr r1, [r0] + cmp r1, 0x3 + bhi _0809A7DC + cmp r1, 0x1 + bcc _0809A7DC + adds r0, 0xC + movs r2, 0x1 + negs r2, r2 + movs r1, 0x4 + movs r3, 0 + bl sub_809B2B8 + lsls r0, 24 + lsrs r0, 24 + b _0809A7E6 + .align 2, 0 +_0809A7D8: .4byte gUnknown_3001B64 +_0809A7DC: + movs r0, 0 + movs r1, 0x1 + bl sub_809A680 + movs r0, 0 +_0809A7E6: + pop {r1} + bx r1 + thumb_func_end sub_809A7B4 + + thumb_func_start sub_809A7EC +sub_809A7EC: + push {r4-r6,lr} + ldr r0, _0809A830 + ldr r0, [r0] + ldr r2, _0809A834 + adds r1, r0, r2 + ldr r0, _0809A838 + adds r6, r0, 0 + movs r3, 0 + movs r2, 0 + movs r4, 0x9 + movs r5, 0xFF +_0809A802: + ldrh r0, [r1] + orrs r0, r6 + strh r0, [r1] + strh r2, [r1, 0x2] + strb r3, [r1, 0x4] + strb r3, [r1, 0x5] + ldrb r0, [r1, 0x6] + orrs r0, r5 + strb r0, [r1, 0x6] + strb r3, [r1, 0x7] + str r2, [r1, 0x8] + str r2, [r1, 0xC] + str r2, [r1, 0x10] + str r2, [r1, 0x14] + strb r3, [r1, 0x1C] + str r2, [r1, 0x20] + subs r4, 0x1 + adds r1, 0x24 + cmp r4, 0 + bge _0809A802 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0809A830: .4byte gUnknown_3001B64 +_0809A834: .4byte 0x0000043c +_0809A838: .4byte 0x0000ffff + thumb_func_end sub_809A7EC + + thumb_func_start sub_809A83C +sub_809A83C: + push {r4-r7,lr} + lsls r0, 16 + asrs r0, 16 + ldr r2, _0809A8A0 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r3, _0809A8A4 + adds r1, r3 + ldr r2, [r2] + adds r6, r2, r1 + ldr r1, _0809A8A8 + strh r1, [r6] + movs r2, 0 + movs r7, 0 + strh r7, [r6, 0x2] + strb r2, [r6, 0x4] + strb r2, [r6, 0x5] + movs r1, 0xFF + strb r1, [r6, 0x6] + strb r2, [r6, 0x7] + str r7, [r6, 0x8] + str r7, [r6, 0xC] + str r7, [r6, 0x10] + str r7, [r6, 0x14] + strb r2, [r6, 0x1C] + lsls r4, r0, 2 + adds r4, r0 + lsls r4, 4 + ldr r0, _0809A8AC + adds r0, r4, r0 + ldr r5, _0809A8B0 + adds r1, r5, 0 + bl strcpy + ldr r0, _0809A8B4 + adds r4, r0 + adds r0, r4, 0 + adds r1, r5, 0 + bl strcpy + ldr r0, [r6, 0x20] + cmp r0, 0 + beq _0809A89A + bl sub_800AA14 + str r7, [r6, 0x20] +_0809A89A: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0809A8A0: .4byte gUnknown_3001B64 +_0809A8A4: .4byte 0x0000043c +_0809A8A8: .4byte 0x0000ffff +_0809A8AC: .4byte gUnknown_202DF98 +_0809A8B0: .4byte gUnknown_811615C +_0809A8B4: .4byte gUnknown_202E2B8 + thumb_func_end sub_809A83C + + thumb_func_start sub_809A8B8 +sub_809A8B8: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + lsls r0, 16 + asrs r0, 16 + mov r9, r0 + mov r0, sp + strh r1, [r0] + ldr r1, _0809A928 + mov r2, r9 + lsls r0, r2, 3 + add r0, r9 + lsls r0, 2 + ldr r2, _0809A92C + adds r0, r2 + ldr r1, [r1] + adds r7, r1, r0 + movs r0, 0x1 + mov r10, r0 + movs r1, 0 + str r1, [sp, 0x4] + ldr r0, [r7, 0x20] + cmp r0, 0 + beq _0809A8F6 + bl sub_800AA14 + ldr r2, [sp, 0x4] + str r2, [r7, 0x20] +_0809A8F6: + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl sub_80A7DDC + mov r0, sp + ldrh r0, [r0] + subs r0, 0xA + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x13 + bhi _0809A9D6 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + bl sub_80A8D54 + adds r5, r0, 0 + cmp r5, 0 + bne _0809A930 + movs r2, 0 + mov r10, r2 + b _0809A9D6 + .align 2, 0 +_0809A928: .4byte gUnknown_3001B64 +_0809A92C: .4byte 0x0000043c +_0809A930: + bl sub_808D3BC + cmp r5, r0 + bne _0809A940 + mov r1, sp + movs r0, 0x21 + strh r0, [r1] + b _0809A9D6 +_0809A940: + bl sub_808D3F8 + cmp r5, r0 + bne _0809A950 + mov r1, sp + movs r0, 0x22 + strh r0, [r1] + b _0809A9D6 +_0809A950: + ldrb r0, [r5, 0x4] + subs r0, 0x43 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x3 + bhi _0809A990 + movs r0, 0 + ldrsh r1, [r4, r0] + ldr r0, _0809A978 + cmp r1, r0 + beq _0809A9D6 + cmp r1, r0 + ble _0809A97C + adds r0, 0x16 + cmp r1, r0 + bgt _0809A98A + subs r0, 0x1 + cmp r1, r0 + blt _0809A98A + b _0809A9D6 + .align 2, 0 +_0809A978: .4byte 0x00000183 +_0809A97C: + movs r0, 0x82 + lsls r0, 1 + cmp r1, r0 + beq _0809A9D6 + adds r0, 0x2F + cmp r1, r0 + beq _0809A9D6 +_0809A98A: + movs r1, 0 + mov r10, r1 + b _0809A9D6 +_0809A990: + movs r2, 0 + ldrsh r1, [r4, r2] + movs r0, 0x87 + lsls r0, 1 + cmp r1, r0 + bgt _0809A9B0 + subs r0, 0x2 + cmp r1, r0 + bge _0809A9D6 + cmp r1, 0x90 + blt _0809A9D2 + cmp r1, 0x92 + ble _0809A9D6 + cmp r1, 0x96 + beq _0809A9D6 + b _0809A9D2 +_0809A9B0: + movs r0, 0xCF + lsls r0, 1 + cmp r1, r0 + bgt _0809A9CC + subs r0, 0x4 + cmp r1, r0 + bge _0809A9D6 + subs r0, 0x87 + cmp r1, r0 + bgt _0809A9D2 + subs r0, 0x1 + cmp r1, r0 + blt _0809A9D2 + b _0809A9D6 +_0809A9CC: + ldr r0, _0809A9F0 + cmp r1, r0 + beq _0809A9D6 +_0809A9D2: + movs r0, 0 + mov r10, r0 +_0809A9D6: + mov r0, sp + ldrh r0, [r0] + subs r0, 0x1 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x21 + bhi _0809AA98 + lsls r0, 2 + ldr r1, _0809A9F4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0809A9F0: .4byte 0x000001a7 +_0809A9F4: .4byte _0809A9F8 + .align 2, 0 +_0809A9F8: + .4byte _0809AA80 + .4byte _0809AA80 + .4byte _0809AA98 + .4byte _0809AA98 + .4byte _0809AA98 + .4byte _0809AA80 + .4byte _0809AA80 + .4byte _0809AA98 + .4byte _0809AA98 + .4byte _0809AA98 + .4byte _0809AA98 + .4byte _0809AA98 + .4byte _0809AA98 + .4byte _0809AA98 + .4byte _0809AA98 + .4byte _0809AA98 + .4byte _0809AA98 + .4byte _0809AA98 + .4byte _0809AA98 + .4byte _0809AA98 + .4byte _0809AA98 + .4byte _0809AA98 + .4byte _0809AA98 + .4byte _0809AA98 + .4byte _0809AA98 + .4byte _0809AA98 + .4byte _0809AA98 + .4byte _0809AA98 + .4byte _0809AA98 + .4byte _0809AA98 + .4byte _0809AA98 + .4byte _0809AA98 + .4byte _0809AA80 + .4byte _0809AA80 +_0809AA80: + movs r1, 0 + ldrsh r0, [r4, r1] + bl sub_80A8CF0 + lsls r0, 24 + cmp r0, 0 + beq _0809AA94 + movs r2, 0x1 + str r2, [sp, 0x4] + b _0809AA98 +_0809AA94: + movs r0, 0 + mov r10, r0 +_0809AA98: + mov r0, sp + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0809AB34 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + bl sub_80A7AE8 + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0 + blt _0809AACE + mov r0, sp + ldrh r0, [r0] + movs r2, 0 + mov r8, r2 + movs r6, 0 + strh r0, [r7] + adds r0, r1, 0 + bl sub_80A8BFC + strh r0, [r7, 0x2] + b _0809AAE6 +_0809AACE: + ldrh r1, [r4] + movs r2, 0 + ldrsh r0, [r4, r2] + cmp r0, 0 + beq _0809AB34 + mov r0, sp + ldrh r0, [r0] + movs r2, 0 + mov r8, r2 + movs r6, 0 + strh r0, [r7] + strh r1, [r7, 0x2] +_0809AAE6: + mov r0, r9 + lsls r4, r0, 2 + add r4, r9 + lsls r4, 4 + ldr r0, _0809AB28 + adds r0, r4, r0 + ldr r5, _0809AB2C + adds r1, r5, 0 + bl strcpy + ldr r0, _0809AB30 + adds r4, r0 + adds r0, r4, 0 + adds r1, r5, 0 + bl strcpy + mov r1, r10 + strb r1, [r7, 0x4] + mov r2, sp + ldrb r2, [r2, 0x4] + strb r2, [r7, 0x5] + movs r0, 0xFF + strb r0, [r7, 0x6] + mov r0, r8 + strb r0, [r7, 0x7] + str r6, [r7, 0x8] + str r6, [r7, 0xC] + str r6, [r7, 0x10] + str r6, [r7, 0x14] + strb r0, [r7, 0x1C] + movs r0, 0x1 + b _0809AB3C + .align 2, 0 +_0809AB28: .4byte gUnknown_202DF98 +_0809AB2C: .4byte gUnknown_811616C +_0809AB30: .4byte gUnknown_202E2B8 +_0809AB34: + mov r0, r9 + bl sub_809A83C + movs r0, 0 +_0809AB3C: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_809A8B8 + + thumb_func_start sub_809AB4C +sub_809AB4C: + push {r4-r6,lr} + lsls r0, 16 + asrs r5, r0, 16 + lsls r1, 16 + asrs r1, 16 + ldr r2, _0809AB78 + lsls r0, r5, 3 + adds r0, r5 + lsls r0, 2 + ldr r3, _0809AB7C + adds r0, r3 + ldr r2, [r2] + adds r6, r2, r0 + adds r0, r5, 0 + bl sub_809A8B8 + lsls r0, 24 + cmp r0, 0 + bne _0809AB80 + movs r0, 0 + b _0809ABA0 + .align 2, 0 +_0809AB78: .4byte gUnknown_3001B64 +_0809AB7C: .4byte 0x0000043c +_0809AB80: + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 4 + ldr r0, _0809ABA8 + adds r0, r4, r0 + movs r2, 0x2 + ldrsh r1, [r6, r2] + bl sub_808D908 + ldr r0, _0809ABAC + adds r4, r0 + ldr r1, _0809ABB0 + adds r0, r4, 0 + bl strcpy + movs r0, 0x1 +_0809ABA0: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0809ABA8: .4byte gUnknown_202DF98 +_0809ABAC: .4byte gUnknown_202E2B8 +_0809ABB0: .4byte gUnknown_811617C + thumb_func_end sub_809AB4C + + thumb_func_start sub_809ABB4 +sub_809ABB4: + push {r4-r6,lr} + lsls r0, 16 + asrs r5, r0, 16 + lsls r1, 16 + asrs r1, 16 + ldr r2, _0809ABE0 + lsls r0, r5, 3 + adds r0, r5 + lsls r0, 2 + ldr r3, _0809ABE4 + adds r0, r3 + ldr r2, [r2] + adds r6, r2, r0 + adds r0, r5, 0 + bl sub_809A8B8 + lsls r0, 24 + cmp r0, 0 + bne _0809ABE8 + movs r0, 0 + b _0809AC0A + .align 2, 0 +_0809ABE0: .4byte gUnknown_3001B64 +_0809ABE4: .4byte 0x0000043c +_0809ABE8: + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 4 + ldr r5, _0809AC10 + adds r5, r4, r5 + movs r0, 0x2 + ldrsh r1, [r6, r0] + adds r0, r5, 0 + bl sub_808D908 + ldr r0, _0809AC14 + adds r4, r0 + adds r0, r4, 0 + adds r1, r5, 0 + bl strcpy + movs r0, 0x1 +_0809AC0A: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0809AC10: .4byte gUnknown_202DF98 +_0809AC14: .4byte gUnknown_202E2B8 + thumb_func_end sub_809ABB4 + + thumb_func_start sub_809AC18 +sub_809AC18: + push {r4-r6,lr} + lsls r0, 16 + asrs r5, r0, 16 + lsls r1, 16 + asrs r1, 16 + ldr r2, _0809AC44 + lsls r0, r5, 3 + adds r0, r5 + lsls r0, 2 + ldr r3, _0809AC48 + adds r0, r3 + ldr r2, [r2] + adds r6, r2, r0 + adds r0, r5, 0 + bl sub_809A8B8 + lsls r0, 24 + cmp r0, 0 + bne _0809AC4C + movs r0, 0 + b _0809AC6E + .align 2, 0 +_0809AC44: .4byte gUnknown_3001B64 +_0809AC48: .4byte 0x0000043c +_0809AC4C: + lsls r4, r5, 2 + adds r4, r5 + lsls r4, 4 + ldr r0, _0809AC74 + adds r0, r4, r0 + movs r2, 0x2 + ldrsh r1, [r6, r2] + bl sub_808D908 + ldr r0, _0809AC78 + adds r4, r0 + movs r3, 0 + ldrsh r1, [r6, r3] + adds r0, r4, 0 + bl sub_80A8EC0 + movs r0, 0x1 +_0809AC6E: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0809AC74: .4byte gUnknown_202DF98 +_0809AC78: .4byte gUnknown_202E2B8 + thumb_func_end sub_809AC18 + + thumb_func_start sub_809AC7C +sub_809AC7C: + push {r4-r6,lr} + lsls r0, 16 + asrs r0, 16 + lsls r1, 24 + asrs r5, r1, 24 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r2, _0809AD10 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, _0809AD14 + adds r1, r0 + ldr r0, [r2] + adds r4, r0, r1 + ldr r0, [r4, 0x20] + cmp r0, 0 + beq _0809ACA8 + bl sub_800AA14 + movs r0, 0 + str r0, [r4, 0x20] +_0809ACA8: + movs r0, 0x2 + ldrsh r1, [r4, r0] + cmp r1, 0 + bge _0809ACB2 + b _0809ADC0 +_0809ACB2: + movs r0, 0x1 + negs r0, r0 + cmp r5, r0 + bne _0809ACBC + b _0809ADC0 +_0809ACBC: + cmp r1, 0 + bne _0809ACC2 + b _0809ADC0 +_0809ACC2: + cmp r6, 0x15 + beq _0809ACCE + movs r0, 0 + strb r6, [r4, 0x7] + str r0, [r4, 0x8] + str r0, [r4, 0xC] +_0809ACCE: + ldr r2, _0809AD18 + ldrb r0, [r4, 0x7] + lsls r0, 3 + adds r0, r2 + ldr r1, [r4, 0x8] + ldrh r0, [r0] + adds r0, r1 + movs r6, 0 + movs r3, 0 + strh r0, [r4, 0x18] + ldrb r0, [r4, 0x7] + lsls r0, 3 + adds r0, r2 + ldr r1, [r4, 0xC] + ldrh r0, [r0, 0x2] + adds r0, r1 + strh r0, [r4, 0x1A] + ldrb r0, [r4, 0x7] + lsls r0, 3 + adds r0, r2 + ldrb r0, [r0, 0x4] + strb r0, [r4, 0x1D] + strb r6, [r4, 0x1E] + movs r0, 0x2 + negs r0, r0 + cmp r5, r0 + bne _0809AD1C + strb r5, [r4, 0x6] + str r3, [r4, 0x10] + str r3, [r4, 0x14] + strb r6, [r4, 0x1C] + movs r0, 0 + b _0809ADD2 + .align 2, 0 +_0809AD10: .4byte gUnknown_3001B64 +_0809AD14: .4byte 0x0000043c +_0809AD18: .4byte gUnknown_8116040 +_0809AD1C: + ldrb r0, [r4, 0x4] + cmp r0, 0 + beq _0809ADC0 + movs r1, 0x2 + ldrsh r0, [r4, r1] + bl sub_808DD90 + str r0, [r4, 0x20] + cmp r0, 0 + beq _0809ADB6 + strb r5, [r4, 0x6] + str r0, [r4, 0x10] + movs r1, 0 + bl sub_800A9D8 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0x4D + beq _0809AD62 + cmp r0, 0x4D + bgt _0809AD4C + cmp r0, 0x47 + beq _0809AD56 + b _0809ADA8 +_0809AD4C: + cmp r0, 0x53 + beq _0809AD76 + cmp r0, 0x73 + beq _0809AD8A + b _0809ADA8 +_0809AD56: + movs r0, 0xF + ands r0, r5 + cmp r0, 0x5 + bgt _0809ADA8 + adds r0, r5, 0x6 + b _0809AD9C +_0809AD62: + ldrb r0, [r4, 0x1D] + cmp r0, 0 + beq _0809ADA8 + movs r0, 0xF + ands r0, r5 + cmp r0, 0x3 + bgt _0809ADA8 + strb r6, [r4, 0x1D] + adds r0, r5, 0x4 + b _0809AD9C +_0809AD76: + ldrb r0, [r4, 0x1D] + cmp r0, 0 + beq _0809ADA8 + movs r0, 0xF + ands r0, r5 + cmp r0, 0 + bgt _0809ADA8 + strb r6, [r4, 0x1D] + adds r0, r5, 0x1 + b _0809AD9C +_0809AD8A: + ldrb r0, [r4, 0x1D] + cmp r0, 0 + beq _0809ADA8 + movs r0, 0xF + ands r0, r5 + cmp r0, 0x1 + bgt _0809ADA8 + strb r6, [r4, 0x1D] + adds r0, r5, 0x2 +_0809AD9C: + lsls r0, 24 + asrs r5, r0, 24 + movs r0, 0x40 + orrs r5, r0 + lsls r0, r5, 24 + asrs r5, r0, 24 +_0809ADA8: + ldr r0, [r4, 0x20] + ldr r0, [r0, 0x4] + str r0, [r4, 0x14] + movs r0, 0xF + ands r5, r0 + strb r5, [r4, 0x1C] + b _0809ADBC +_0809ADB6: + str r0, [r4, 0x10] + str r0, [r4, 0x14] + strb r6, [r4, 0x1C] +_0809ADBC: + movs r0, 0x1 + b _0809ADD2 +_0809ADC0: + movs r0, 0xFF + strb r0, [r4, 0x6] + movs r0, 0 + strb r0, [r4, 0x7] + str r0, [r4, 0x8] + str r0, [r4, 0xC] + str r0, [r4, 0x10] + str r0, [r4, 0x14] + strb r0, [r4, 0x1C] +_0809ADD2: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_809AC7C + + thumb_func_start sub_809ADD8 +sub_809ADD8: + push {r4,lr} + adds r4, r1, 0 + lsls r0, 16 + asrs r0, 16 + ldr r2, _0809AE28 + lsls r1, r0, 3 + adds r1, r0 + lsls r1, 2 + ldr r0, _0809AE2C + adds r1, r0 + ldr r0, [r2] + adds r3, r0, r1 + movs r1, 0x2 + ldrsh r0, [r3, r1] + cmp r0, 0 + blt _0809AE34 + cmp r0, 0 + beq _0809AE34 + ldr r0, [r4] + ldr r1, [r4, 0x4] + str r0, [r3, 0x8] + str r1, [r3, 0xC] + ldr r2, _0809AE30 + ldrb r0, [r3, 0x7] + lsls r0, 3 + adds r0, r2 + ldr r1, [r3, 0x8] + ldrh r0, [r0] + adds r0, r1 + strh r0, [r3, 0x18] + ldrb r0, [r3, 0x7] + lsls r0, 3 + adds r0, r2 + ldr r1, [r3, 0xC] + ldrh r0, [r0, 0x2] + adds r0, r1 + strh r0, [r3, 0x1A] + movs r0, 0x1 + b _0809AE36 + .align 2, 0 +_0809AE28: .4byte gUnknown_3001B64 +_0809AE2C: .4byte 0x0000043c +_0809AE30: .4byte gUnknown_8116040 +_0809AE34: + movs r0, 0 +_0809AE36: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809ADD8 + + thumb_func_start sub_809AE3C +sub_809AE3C: + push {r4,lr} + lsls r0, 16 + asrs r2, r0, 16 + cmp r2, 0 + blt _0809AE88 + ldr r1, _0809AE80 + lsls r0, r2, 3 + adds r0, r2 + lsls r0, 2 + ldr r3, _0809AE84 + adds r0, r3 + ldr r1, [r1] + adds r4, r1, r0 + movs r1, 0x2 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _0809AE74 + movs r1, 0x6 + ldrsb r1, [r4, r1] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _0809AE74 + adds r0, r2, 0 + movs r1, 0 + movs r2, 0 + bl sub_809AC7C +_0809AE74: + ldr r0, [r4, 0x10] + cmp r0, 0 + beq _0809AE88 + adds r0, r4, 0 + adds r0, 0x10 + b _0809AE8A + .align 2, 0 +_0809AE80: .4byte gUnknown_3001B64 +_0809AE84: .4byte 0x0000043c +_0809AE88: + movs r0, 0 +_0809AE8A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809AE3C + + thumb_func_start sub_809AE90 +sub_809AE90: + push {r4-r6,lr} + adds r5, r0, 0 + adds r4, r2, 0 + lsls r1, 16 + asrs r6, r1, 16 + cmp r4, 0 + bne _0809AEA4 + bl sub_809A76C + b _0809AEE0 +_0809AEA4: + ldrb r0, [r4] + cmp r0, 0 + beq _0809AEDC + ldr r1, _0809AED0 + lsls r0, r5, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0 + bl sub_809A680 + ldr r0, _0809AED4 + ldr r0, [r0] + adds r0, 0xC + ldr r2, _0809AED8 + lsls r1, r5, 1 + adds r1, r2 + ldrh r1, [r1] + adds r2, r6, 0 + adds r3, r4, 0 + bl sub_809B2B8 + b _0809AEE0 + .align 2, 0 +_0809AED0: .4byte gUnknown_8116134 +_0809AED4: .4byte gUnknown_3001B64 +_0809AED8: .4byte gUnknown_8116148 +_0809AEDC: + bl sub_809A7B4 +_0809AEE0: + lsls r0, 24 + lsrs r0, 24 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_809AE90 + + thumb_func_start sub_809AEEC +sub_809AEEC: + push {r4,lr} + adds r4, r0, 0 + cmp r4, 0 + beq _0809AF1C + ldrb r0, [r4] + cmp r0, 0 + beq _0809AF1C + movs r0, 0x2 + movs r1, 0x1 + bl sub_809A680 + ldr r0, _0809AF18 + ldr r0, [r0] + adds r0, 0xC + movs r2, 0x1 + negs r2, r2 + movs r1, 0xC2 + adds r3, r4, 0 + bl sub_809B2B8 + b _0809AF20 + .align 2, 0 +_0809AF18: .4byte gUnknown_3001B64 +_0809AF1C: + bl sub_809A76C +_0809AF20: + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809AEEC + + thumb_func_start sub_809AF2C +sub_809AF2C: + push {r4,lr} + adds r4, r0, 0 + cmp r4, 0 + beq _0809AF5C + ldrb r0, [r4] + cmp r0, 0 + beq _0809AF5C + movs r0, 0x2 + movs r1, 0x1 + bl sub_809A680 + ldr r0, _0809AF58 + ldr r0, [r0] + adds r0, 0xC + movs r2, 0x1 + negs r2, r2 + movs r1, 0xC2 + adds r3, r4, 0 + bl sub_809B2B8 + b _0809AF60 + .align 2, 0 +_0809AF58: .4byte gUnknown_3001B64 +_0809AF5C: + bl sub_809A76C +_0809AF60: + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809AF2C + + thumb_func_start sub_809AF6C +sub_809AF6C: + push {r4,lr} + adds r4, r1, 0 + cmp r4, 0 + beq _0809AF9C + ldrb r0, [r4] + cmp r0, 0 + beq _0809AF9C + movs r0, 0x3 + movs r1, 0x1 + bl sub_809A680 + ldr r0, _0809AF98 + ldr r0, [r0] + adds r0, 0xC + movs r2, 0x1 + negs r2, r2 + movs r1, 0x65 + adds r3, r4, 0 + bl sub_809B2B8 + b _0809AFA0 + .align 2, 0 +_0809AF98: .4byte gUnknown_3001B64 +_0809AF9C: + bl sub_809A76C +_0809AFA0: + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809AF6C + + thumb_func_start sub_809AFAC +sub_809AFAC: + push {lr} + movs r1, 0 + ldr r0, _0809AFC4 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0x4 + bne _0809AFBC + movs r1, 0x1 +_0809AFBC: + adds r0, r1, 0 + pop {r1} + bx r1 + .align 2, 0 +_0809AFC4: .4byte gUnknown_3001B64 + thumb_func_end sub_809AFAC + + thumb_func_start sub_809AFC8 +sub_809AFC8: + push {r4,r5,lr} + sub sp, 0x8 + adds r5, r1, 0 + adds r1, r2, 0 + lsls r0, 24 + lsrs r0, 24 + lsls r1, 16 + asrs r1, 16 + ldr r4, _0809AFF8 + negs r2, r0 + orrs r2, r0 + lsrs r2, 31 + str r1, [sp] + str r3, [sp, 0x4] + adds r0, r4, 0 + movs r1, 0 + adds r3, r5, 0 + bl sub_809B028 + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0809AFF8: .4byte gUnknown_81160E8 + thumb_func_end sub_809AFC8 + + thumb_func_start sub_809AFFC +sub_809AFFC: + push {r4,lr} + sub sp, 0x4 + adds r4, r0, 0 + mov r0, sp + bl sub_809B18C + lsls r0, 24 + lsrs r2, r0, 24 + cmp r4, 0 + beq _0809B01C + movs r1, 0 + ldr r0, [sp] + cmp r0, 0x1 + bne _0809B01A + movs r1, 0x1 +_0809B01A: + strb r1, [r4] +_0809B01C: + adds r0, r2, 0 + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809AFFC + + thumb_func_start sub_809B028 +sub_809B028: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + mov r8, r0 + adds r7, r2, 0 + adds r6, r3, 0 + ldr r0, [sp, 0x2C] + lsls r1, 24 + lsrs r5, r1, 24 + lsls r0, 16 + asrs r4, r0, 16 + ldr r1, _0809B084 + lsls r0, r6, 2 + adds r0, r1 + ldr r0, [r0] + movs r1, 0 + bl sub_809A680 + ldr r0, _0809B088 + ldr r1, [r0] + ldr r0, _0809B08C + adds r2, r1, r0 + movs r0, 0x1 + str r0, [r2] + movs r0, 0x83 + lsls r0, 3 + adds r2, r1, r0 + movs r0, 0 + str r0, [r2] + ldr r2, _0809B090 + adds r0, r1, r2 + mov r2, r8 + str r2, [r0] + movs r2, 0x84 + lsls r2, 3 + adds r0, r1, r2 + movs r2, 0x2 + str r2, [r0] + ldr r0, _0809B094 + adds r1, r0 + cmp r5, 0 + beq _0809B098 + str r2, [r1] + b _0809B09A + .align 2, 0 +_0809B084: .4byte gUnknown_8116134 +_0809B088: .4byte gUnknown_3001B64 +_0809B08C: .4byte 0x00000414 +_0809B090: .4byte 0x0000041c +_0809B094: .4byte 0x00000424 +_0809B098: + str r5, [r1] +_0809B09A: + ldr r0, _0809B0D4 + ldr r0, [r0] + movs r1, 0x85 + lsls r1, 3 + adds r2, r0, r1 + movs r1, 0 + str r1, [r2] + movs r2, 0x86 + lsls r2, 3 + adds r0, r2 + str r7, [r0] + ldr r0, _0809B0D8 + lsls r2, r6, 1 + adds r0, r2, r0 + ldrh r1, [r0] + movs r0, 0x80 + lsls r0, 1 + ands r0, r1 + adds r5, r2, 0 + cmp r0, 0 + beq _0809B0F6 + cmp r4, 0 + bge _0809B0E4 + ldr r0, _0809B0DC + ldr r1, _0809B0E0 + bl strcpy + b _0809B0F6 + .align 2, 0 +_0809B0D4: .4byte gUnknown_3001B64 +_0809B0D8: .4byte gUnknown_8116148 +_0809B0DC: .4byte gUnknown_202E5D8 +_0809B0E0: .4byte gUnknown_8116180 +_0809B0E4: + ldr r0, _0809B134 + ldr r1, _0809B138 + lsls r2, r4, 2 + adds r2, r4 + lsls r2, 4 + ldr r3, _0809B13C + adds r2, r3 + bl sub_800D158 +_0809B0F6: + adds r0, r4, 0 + bl sub_809AE3C + ldr r4, _0809B140 + movs r1, 0 + str r1, [sp] + movs r3, 0x4 + str r3, [sp, 0x4] + str r1, [sp, 0x8] + str r0, [sp, 0xC] + ldr r0, _0809B144 + adds r0, r5, r0 + ldrh r2, [r0] + movs r0, 0x80 + lsls r0, 1 + ands r0, r2 + cmp r0, 0 + beq _0809B11C + movs r1, 0xC +_0809B11C: + movs r0, 0x80 + lsls r0, 2 + ands r0, r2 + cmp r0, 0 + beq _0809B128 + orrs r1, r3 +_0809B128: + movs r0, 0x20 + ands r0, r2 + cmp r0, 0 + beq _0809B148 + movs r0, 0x21 + b _0809B14A + .align 2, 0 +_0809B134: .4byte gUnknown_202E5D8 +_0809B138: .4byte gUnknown_8116188 +_0809B13C: .4byte gUnknown_202E2B8 +_0809B140: .4byte sub_809B428 +_0809B144: .4byte gUnknown_8116148 +_0809B148: + movs r0, 0x1 +_0809B14A: + orrs r0, r1 + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0x10] + ldr r0, [sp, 0x30] + adds r1, r4, 0 + adds r2, r7, 0 + mov r3, r8 + bl sub_8014248 + ldr r0, _0809B184 + ldr r0, [r0] + ldr r1, _0809B188 + adds r0, r1 + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _0809B176 + movs r0, 0x1 + bl sub_809A6E4 +_0809B176: + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_0809B184: .4byte gUnknown_3001B64 +_0809B188: .4byte 0x00000424 + thumb_func_end sub_809B028 + + thumb_func_start sub_809B18C +sub_809B18C: + push {lr} + adds r1, r0, 0 + ldr r2, _0809B1BC + cmp r1, 0 + beq _0809B1A2 + ldr r0, [r2] + movs r3, 0x86 + lsls r3, 3 + adds r0, r3 + ldr r0, [r0] + str r0, [r1] +_0809B1A2: + movs r1, 0 + ldr r0, [r2] + movs r2, 0x84 + lsls r2, 3 + adds r0, r2 + ldr r0, [r0] + cmp r0, 0x3 + bne _0809B1B4 + movs r1, 0x1 +_0809B1B4: + adds r0, r1, 0 + pop {r1} + bx r1 + .align 2, 0 +_0809B1BC: .4byte gUnknown_3001B64 + thumb_func_end sub_809B18C + + thumb_func_start sub_809B1C0 +sub_809B1C0: + push {lr} + adds r3, r2, 0 + movs r2, 0 + bl sub_809B1D4 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_809B1C0 + + thumb_func_start sub_809B1D4 +sub_809B1D4: + push {r4-r7,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + adds r7, r3, 0 + cmp r4, 0xB + beq _0809B1E8 + cmp r4, 0xC + beq _0809B1F0 + b _0809B202 +_0809B1E8: + adds r0, r5, 0 + bl sub_8021700 + b _0809B1F8 +_0809B1F0: + bl sub_8001D88 + bl sub_802FCF0 +_0809B1F8: + lsls r0, 24 + cmp r0, 0 + beq _0809B202 + movs r0, 0 + b _0809B24C +_0809B202: + movs r0, 0x4 + movs r1, 0 + bl sub_809A680 + ldr r0, _0809B254 + ldr r1, [r0] + ldr r2, _0809B258 + adds r0, r1, r2 + str r4, [r0] + movs r3, 0x83 + lsls r3, 3 + adds r0, r1, r3 + movs r2, 0 + str r2, [r0] + adds r3, 0x4 + adds r0, r1, r3 + str r2, [r0] + movs r0, 0x84 + lsls r0, 3 + adds r2, r1, r0 + movs r0, 0x1 + str r0, [r2] + ldr r2, _0809B25C + adds r0, r1, r2 + str r5, [r0] + adds r3, 0xC + adds r0, r1, r3 + str r6, [r0] + adds r2, 0x8 + adds r0, r1, r2 + str r7, [r0] + adds r3, 0x8 + adds r1, r3 + movs r0, 0x1 + negs r0, r0 + str r0, [r1] + movs r0, 0x1 +_0809B24C: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0809B254: .4byte gUnknown_3001B64 +_0809B258: .4byte 0x00000414 +_0809B25C: .4byte 0x00000424 + thumb_func_end sub_809B1D4 + + thumb_func_start sub_809B260 +sub_809B260: + push {lr} + adds r1, r0, 0 + ldr r2, _0809B290 + cmp r1, 0 + beq _0809B276 + ldr r0, [r2] + movs r3, 0x86 + lsls r3, 3 + adds r0, r3 + ldr r0, [r0] + str r0, [r1] +_0809B276: + movs r1, 0 + ldr r0, [r2] + movs r2, 0x84 + lsls r2, 3 + adds r0, r2 + ldr r0, [r0] + cmp r0, 0x3 + bne _0809B288 + movs r1, 0x1 +_0809B288: + adds r0, r1, 0 + pop {r1} + bx r1 + .align 2, 0 +_0809B290: .4byte gUnknown_3001B64 + thumb_func_end sub_809B260 + + thumb_func_start sub_809B294 +sub_809B294: + push {lr} + movs r0, 0x3 + bl sub_80063D8 + ldr r0, _0809B2B4 + ldr r0, [r0] + adds r0, 0xC + movs r2, 0x1 + negs r2, r2 + movs r1, 0 + movs r3, 0 + bl sub_809B2B8 + pop {r0} + bx r0 + .align 2, 0 +_0809B2B4: .4byte gUnknown_3001B64 + thumb_func_end sub_809B294 + + thumb_func_start sub_809B2B8 +sub_809B2B8: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + adds r4, r0, 0 + adds r7, r3, 0 + lsls r1, 16 + lsrs r5, r1, 16 + lsls r2, 16 + asrs r6, r2, 16 + strh r5, [r4] + cmp r7, 0 + bne _0809B2F6 + cmp r5, 0 + bne _0809B2DE + str r7, [r4, 0x4] + movs r0, 0 + b _0809B3FC +_0809B2DE: + movs r0, 0x4 + ands r0, r5 + cmp r0, 0 + bne _0809B2E8 + b _0809B3FA +_0809B2E8: + bl sub_8014490 + movs r0, 0 + movs r1, 0x1 + bl sub_809A680 + b _0809B3FA +_0809B2F6: + movs r0, 0x1 + str r0, [r4, 0x4] + adds r0, 0xFF + ands r0, r5 + cmp r0, 0 + beq _0809B32A + cmp r6, 0 + bge _0809B318 + ldr r0, _0809B310 + ldr r1, _0809B314 + bl strcpy + b _0809B32A + .align 2, 0 +_0809B310: .4byte gUnknown_202E5D8 +_0809B314: .4byte gUnknown_8116180 +_0809B318: + ldr r0, _0809B3D0 + ldr r1, _0809B3D4 + lsls r2, r6, 2 + adds r2, r6 + lsls r2, 4 + ldr r3, _0809B3D8 + adds r2, r3 + bl sub_800D158 +_0809B32A: + ldr r0, _0809B3DC + mov r8, r0 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0x3 + bne _0809B344 + adds r4, 0x8 + ldr r1, _0809B3E0 + adds r0, r4, 0 + adds r2, r7, 0 + bl sub_800D158 + adds r7, r4, 0 +_0809B344: + adds r0, r6, 0 + bl sub_809AE3C + ldr r1, _0809B3E4 + mov r9, r1 + movs r1, 0x1 + negs r1, r1 + mov r12, r1 + movs r2, 0 + str r2, [sp] + movs r1, 0x3 + str r1, [sp, 0x4] + str r2, [sp, 0x8] + str r0, [sp, 0xC] + movs r6, 0x80 + lsls r6, 1 + adds r0, r5, 0 + ands r0, r6 + movs r1, 0 + cmp r0, 0 + beq _0809B370 + movs r1, 0xC +_0809B370: + movs r4, 0x80 + lsls r4, 2 + adds r0, r5, 0 + ands r0, r4 + cmp r0, 0 + beq _0809B380 + movs r0, 0x4 + orrs r1, r0 +_0809B380: + mov r0, r8 + ldr r3, [r0] + ldr r2, [r3] + cmp r2, 0x3 + bne _0809B38E + movs r0, 0x10 + orrs r1, r0 +_0809B38E: + cmp r2, 0x2 + bne _0809B396 + movs r0, 0x10 + orrs r1, r0 +_0809B396: + adds r2, r1, 0 + movs r1, 0x20 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _0809B3A4 + orrs r2, r1 +_0809B3A4: + lsrs r1, r5, 6 + movs r0, 0x1 + ands r1, r0 + orrs r1, r2 + movs r0, 0x80 + ands r0, r5 + cmp r0, 0 + beq _0809B3B6 + orrs r1, r6 +_0809B3B6: + movs r0, 0x4 + ands r0, r5 + cmp r0, 0 + beq _0809B3C0 + orrs r1, r4 +_0809B3C0: + ldr r0, [r3, 0x4] + cmp r0, r12 + beq _0809B3E8 + movs r0, 0x2 + orrs r0, r1 + lsls r0, 16 + b _0809B3EA + .align 2, 0 +_0809B3D0: .4byte gUnknown_202E5D8 +_0809B3D4: .4byte gUnknown_8116188 +_0809B3D8: .4byte gUnknown_202E2B8 +_0809B3DC: .4byte gUnknown_3001B64 +_0809B3E0: .4byte gUnknown_8116190 +_0809B3E4: .4byte sub_809B428 +_0809B3E8: + lsls r0, r1, 16 +_0809B3EA: + lsrs r0, 16 + str r0, [sp, 0x10] + adds r0, r7, 0 + mov r1, r9 + mov r2, r12 + movs r3, 0 + bl sub_8014248 +_0809B3FA: + movs r0, 0x1 +_0809B3FC: + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_809B2B8 + + thumb_func_start sub_809B40C +sub_809B40C: + push {lr} + ldr r0, [r0, 0x4] + cmp r0, 0 + beq _0809B41C + cmp r0, 0x3 + bhi _0809B420 + cmp r0, 0x2 + bcc _0809B420 +_0809B41C: + movs r0, 0 + b _0809B422 +_0809B420: + movs r0, 0x1 +_0809B422: + pop {r1} + bx r1 + thumb_func_end sub_809B40C + + thumb_func_start sub_809B428 +sub_809B428: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r2, 0 + ldrb r0, [r5, 0x2] + cmp r0, 0x4F + beq _0809B44C + cmp r0, 0x4F + bgt _0809B43E + cmp r0, 0x49 + beq _0809B444 + b _0809B46A +_0809B43E: + cmp r0, 0x57 + beq _0809B454 + b _0809B46A +_0809B444: + movs r0, 0x1E + bl sub_8099A34 + b _0809B462 +_0809B44C: + movs r0, 0x1E + bl sub_8099A48 + b _0809B462 +_0809B454: + bl sub_8099B94 + lsls r0, 24 + cmp r0, 0 + beq _0809B462 + adds r0, r5, 0 + b _0809B46C +_0809B462: + adds r1, r4, 0 + adds r1, 0x21 + movs r0, 0x1 + strb r0, [r1] +_0809B46A: + movs r0, 0 +_0809B46C: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_809B428 + + thumb_func_start sub_809B474 +sub_809B474: + push {r4-r6,lr} + ldr r0, _0809B498 + ldr r1, [r0] + ldr r2, [r1] + adds r6, r0, 0 + cmp r2, 0x3 + bls _0809B56E + cmp r2, 0x4 + bne _0809B56E + movs r5, 0x84 + lsls r5, 3 + adds r0, r1, r5 + ldr r0, [r0] + cmp r0, 0x1 + beq _0809B49C + cmp r0, 0x2 + beq _0809B508 + b _0809B56E + .align 2, 0 +_0809B498: .4byte gUnknown_3001B64 +_0809B49C: + bl sub_809B648 + lsls r0, 24 + cmp r0, 0 + bne _0809B4B0 + ldr r0, [r6] + adds r0, r5 + movs r1, 0x3 + str r1, [r0] + b _0809B4E8 +_0809B4B0: + ldr r0, [r6] + movs r1, 0x83 + lsls r1, 3 + adds r0, r1 + ldr r4, [r0] + cmp r4, 0 + beq _0809B4F8 + ldr r0, [r4, 0x4] + cmp r0, 0 + beq _0809B4F2 + bl sub_809B294 + ldr r0, [r4, 0x4] + bl _call_via_r0 + lsls r0, 24 + cmp r0, 0 + bne _0809B4F2 + ldr r1, [r6] + movs r3, 0x86 + lsls r3, 3 + adds r2, r1, r3 + movs r0, 0x1 + negs r0, r0 + str r0, [r2] + adds r1, r5 + movs r0, 0x3 + str r0, [r1] +_0809B4E8: + movs r0, 0 + movs r1, 0x1 + bl sub_809A680 + b _0809B56E +_0809B4F2: + ldrh r0, [r4] + bl sub_809A6E4 +_0809B4F8: + ldr r0, _0809B534 + ldr r1, [r0] + movs r2, 0x84 + lsls r2, 3 + adds r1, r2 + movs r2, 0x2 + str r2, [r1] + adds r6, r0, 0 +_0809B508: + ldr r0, [r6] + movs r3, 0x83 + lsls r3, 3 + adds r0, r3 + ldr r4, [r0] + cmp r4, 0 + beq _0809B54E + ldr r0, [r4, 0xC] + bl _call_via_r0 + adds r2, r0, 0 + cmp r2, 0x1 + bls _0809B56E + ldr r0, [r6] + movs r3, 0x86 + lsls r3, 3 + adds r1, r0, r3 + cmp r2, 0x2 + bne _0809B538 + movs r0, 0x1 + negs r0, r0 + b _0809B53A + .align 2, 0 +_0809B534: .4byte gUnknown_3001B64 +_0809B538: + movs r0, 0 +_0809B53A: + str r0, [r1] + ldr r0, [r4, 0x8] + cmp r0, 0 + beq _0809B546 + bl _call_via_r0 +_0809B546: + ldrh r0, [r4] + bl sub_809A6F8 + b _0809B558 +_0809B54E: + bl sub_809B648 + lsls r0, 24 + cmp r0, 0 + bne _0809B56E +_0809B558: + ldr r0, _0809B578 + ldr r0, [r0] + movs r1, 0x84 + lsls r1, 3 + adds r0, r1 + movs r1, 0x3 + str r1, [r0] + movs r0, 0 + movs r1, 0x1 + bl sub_809A680 +_0809B56E: + bl sub_809B57C + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0809B578: .4byte gUnknown_3001B64 + thumb_func_end sub_809B474 + + thumb_func_start sub_809B57C +sub_809B57C: + push {r4,r5,lr} + sub sp, 0x8 + bl sub_80144C4 + ldr r5, _0809B5C8 + ldr r0, [r5] + ldr r1, [r0] + cmp r1, 0x3 + bhi _0809B5E4 + cmp r1, 0x1 + bcc _0809B5E4 + movs r4, 0x84 + lsls r4, 3 + adds r0, r4 + ldr r0, [r0] + cmp r0, 0 + beq _0809B5CC + cmp r0, 0x3 + beq _0809B5CC + mov r0, sp + bl sub_80144A4 + cmp r0, 0 + bne _0809B5E4 + ldr r1, [sp] + movs r0, 0x1 + bl sub_809D9E0 + ldr r1, [r5] + adds r2, r1, r4 + movs r0, 0x3 + str r0, [r2] + movs r0, 0x86 + lsls r0, 3 + adds r1, r0 + ldr r0, [sp] + str r0, [r1] + b _0809B5E4 + .align 2, 0 +_0809B5C8: .4byte gUnknown_3001B64 +_0809B5CC: + add r0, sp, 0x4 + bl sub_80144A4 + adds r4, r0, 0 + cmp r4, 0 + bne _0809B5E4 + movs r0, 0 + bl sub_809D9B8 + ldr r0, _0809B5FC + ldr r0, [r0] + str r4, [r0] +_0809B5E4: + ldr r0, _0809B5FC + ldr r0, [r0] + ldr r1, _0809B600 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + bge _0809B604 + movs r0, 0 + movs r1, 0 + bl sub_8005838 + b _0809B60C + .align 2, 0 +_0809B5FC: .4byte gUnknown_3001B64 +_0809B600: .4byte 0x00000434 +_0809B604: + movs r0, 0 + movs r1, 0x5 + bl sub_8005838 +_0809B60C: + add sp, 0x8 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_809B57C + + thumb_func_start sub_809B614 +sub_809B614: + push {lr} + bl sub_80060EC + ldr r0, _0809B62C + ldr r2, _0809B630 + ldrh r1, [r2] + strh r1, [r0] + ldr r0, _0809B634 + ands r0, r1 + strh r0, [r2] + pop {r0} + bx r0 + .align 2, 0 +_0809B62C: .4byte gUnknown_20399DE +_0809B630: .4byte gUnknown_20399DC +_0809B634: .4byte 0x0000fffd + thumb_func_end sub_809B614 + + thumb_func_start sub_809B638 +sub_809B638: + push {lr} + bl xxx_call_update_bg_vram + pop {r0} + bx r0 + thumb_func_end sub_809B638 + + thumb_func_start nullsub_210 +nullsub_210: + bx lr + thumb_func_end nullsub_210 + + thumb_func_start sub_809B648 +sub_809B648: + push {r4-r6,lr} + sub sp, 0x24 + ldr r0, _0809B66C + ldr r1, [r0] + ldr r2, _0809B670 + adds r1, r2 + ldr r1, [r1] + subs r1, 0x2 + adds r6, r0, 0 + cmp r1, 0x2C + bls _0809B662 + bl _0809C392 +_0809B662: + lsls r0, r1, 2 + ldr r1, _0809B674 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0809B66C: .4byte gUnknown_3001B64 +_0809B670: .4byte 0x00000414 +_0809B674: .4byte _0809B678 + .align 2, 0 +_0809B678: + .4byte _0809B72C + .4byte _0809B772 + .4byte _0809B7AC + .4byte _0809B834 + .4byte _0809B89C + .4byte _0809B8FC + .4byte _0809B91C + .4byte _0809B944 + .4byte _0809B9D2 + .4byte _0809BA2A + .4byte _0809BAA8 + .4byte _0809BB66 + .4byte _0809BBDA + .4byte _0809BBDA + .4byte _0809BC26 + .4byte _0809BC68 + .4byte _0809C1B4 + .4byte _0809BC78 + .4byte _0809C1C2 + .4byte _0809C1C2 + .4byte _0809C1C8 + .4byte _0809BCBC + .4byte _0809BCBC + .4byte _0809BD1C + .4byte _0809BD64 + .4byte _0809BDE8 + .4byte _0809BE30 + .4byte _0809BE40 + .4byte _0809BE50 + .4byte _0809BE60 + .4byte _0809BE9C + .4byte _0809BEB8 + .4byte _0809BED4 + .4byte _0809BF70 + .4byte _0809BFFC + .4byte _0809C072 + .4byte _0809C0B8 + .4byte _0809C0FC + .4byte _0809C148 + .4byte _0809C158 + .4byte _0809C168 + .4byte _0809C204 + .4byte _0809C238 + .4byte _0809C280 + .4byte _0809C32A +_0809B72C: + ldr r2, [r6] + movs r3, 0x84 + lsls r3, 3 + adds r0, r2, r3 + ldr r0, [r0] + cmp r0, 0x1 + beq _0809B780 + ldr r0, _0809B754 + ldrh r0, [r0, 0x2] + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + beq _0809B758 + movs r0, 0x86 + lsls r0, 3 + adds r1, r2, r0 + movs r0, 0x1 + str r0, [r1] + bl _0809C392 + .align 2, 0 +_0809B754: .4byte gUnknown_20255F0 +_0809B758: + bl sub_8094D14 + lsls r0, 24 + cmp r0, 0 + beq _0809B784 + ldr r0, [r6] + movs r1, 0x86 + lsls r1, 3 + adds r0, r1 + movs r1, 0x2 + str r1, [r0] + bl _0809C392 +_0809B772: + ldr r0, [r6] + movs r2, 0x84 + lsls r2, 3 + adds r0, r2 + ldr r0, [r0] + cmp r0, 0x1 + bne _0809B78A +_0809B780: + bl sub_809B294 +_0809B784: + movs r0, 0x1 + bl _0809C394 +_0809B78A: + ldr r0, _0809B7A8 + ldrh r1, [r0] + ldrh r0, [r0, 0x2] + movs r2, 0x2 + ands r0, r2 + cmp r0, 0 + beq _0809B79C + bl _0809C392 +_0809B79C: + ands r1, r2 + cmp r1, 0 + bne _0809B784 + bl _0809C392 + .align 2, 0 +_0809B7A8: .4byte gUnknown_20255F0 +_0809B7AC: + ldr r0, [r6] + movs r3, 0x84 + lsls r3, 3 + adds r0, r3 + ldr r0, [r0] + cmp r0, 0x1 + bne _0809B7F4 + bl sub_809B294 + ldr r1, [r6] + ldr r2, _0809B7D8 + adds r0, r1, r2 + ldr r0, [r0] + cmp r0, 0 + bne _0809B7E0 + ldr r3, _0809B7DC + adds r0, r1, r3 + ldr r1, [r0] + movs r0, 0 + bl sub_801602C + b _0809B784 + .align 2, 0 +_0809B7D8: .4byte 0x00000424 +_0809B7DC: .4byte 0x0000042c +_0809B7E0: + ldr r2, _0809B7F0 + adds r0, r1, r2 + ldr r1, [r0] + movs r0, 0x2 + bl sub_801602C + b _0809B784 + .align 2, 0 +_0809B7F0: .4byte 0x0000042c +_0809B7F4: + bl sub_8016080 + cmp r0, 0x3 + bne _0809B80C + bl sub_80160D8 + ldr r0, [r6] + movs r3, 0x86 + lsls r3, 3 + adds r0, r3 + bl _0809C1BC +_0809B80C: + cmp r0, 0x2 + bne _0809B784 + ldr r0, [r6] + ldr r1, _0809B830 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0 + beq _0809B784 + bl sub_80160D8 + ldr r0, [r6] + movs r2, 0x86 + lsls r2, 3 + adds r0, r2 +_0809B828: + movs r1, 0 + str r1, [r0] + bl _0809C392 + .align 2, 0 +_0809B830: .4byte 0x00000424 +_0809B834: + ldr r0, [r6] + movs r3, 0x84 + lsls r3, 3 + adds r0, r3 + ldr r0, [r0] + cmp r0, 0x1 + bne _0809B85C + bl sub_809B294 + ldr r0, [r6] + ldr r1, _0809B858 + adds r0, r1 + ldr r1, [r0] + movs r0, 0x1 + bl sub_801602C + b _0809B784 + .align 2, 0 +_0809B858: .4byte 0x0000042c +_0809B85C: + bl sub_8016080 + cmp r0, 0x3 + bne _0809B874 + bl sub_80160D8 + ldr r0, [r6] + movs r2, 0x86 + lsls r2, 3 + adds r0, r2 + bl _0809C1BC +_0809B874: + cmp r0, 0x2 + beq _0809B87A + b _0809B784 +_0809B87A: + ldr r0, [r6] + ldr r3, _0809B898 + adds r0, r3 + ldr r0, [r0] + cmp r0, 0 + bne _0809B888 + b _0809B784 +_0809B888: + bl sub_80160D8 + ldr r0, [r6] + movs r1, 0x86 + lsls r1, 3 + adds r0, r1 + b _0809B828 + .align 2, 0 +_0809B898: .4byte 0x00000424 +_0809B89C: + ldr r0, [r6] + movs r2, 0x84 + lsls r2, 3 + adds r0, r2 + ldr r0, [r0] + cmp r0, 0x1 + bne _0809B8C4 + bl sub_809B294 + ldr r0, [r6] + ldr r3, _0809B8C0 + adds r0, r3 + ldr r1, [r0] + movs r0, 0x4 + bl sub_80151C0 + b _0809B784 + .align 2, 0 +_0809B8C0: .4byte 0x0000042c +_0809B8C4: + bl sub_80154F0 + cmp r0, 0x3 + bne _0809B8D4 + bl sub_80155F0 + bl _0809C1B4 +_0809B8D4: + cmp r0, 0x2 + beq _0809B8DA + b _0809B784 +_0809B8DA: + ldr r0, [r6] + ldr r2, _0809B8F8 + adds r0, r2 + ldr r0, [r0] + cmp r0, 0 + bne _0809B8E8 + b _0809B784 +_0809B8E8: + bl sub_80155F0 + ldr r0, [r6] + movs r3, 0x86 + lsls r3, 3 + adds r0, r3 + b _0809B828 + .align 2, 0 +_0809B8F8: .4byte 0x00000424 +_0809B8FC: + ldr r0, [r6] + ldr r1, _0809B914 + adds r0, r1 + ldr r0, [r0] + bl sub_801D014 + ldr r0, [r6] + movs r2, 0x83 + lsls r2, 3 + adds r0, r2 + ldr r1, _0809B918 + b _0809B932 + .align 2, 0 +_0809B914: .4byte 0x0000042c +_0809B918: .4byte gUnknown_81161A8 +_0809B91C: + ldr r0, [r6] + ldr r3, _0809B93C + adds r0, r3 + ldr r0, [r0] + bl sub_801D014 + ldr r0, [r6] + movs r1, 0x83 + lsls r1, 3 + adds r0, r1 + ldr r1, _0809B940 +_0809B932: + str r1, [r0] + movs r0, 0x4 + bl sub_80119D4 + b _0809B784 + .align 2, 0 +_0809B93C: .4byte 0x0000042c +_0809B940: .4byte gUnknown_81161B8 +_0809B944: + bl sub_809B294 + ldr r4, _0809B984 + ldr r0, [r4] + movs r2, 0x84 + lsls r2, 3 + adds r0, r2 + ldr r0, [r0] + cmp r0, 0x1 + bne _0809B998 + bl sub_809B294 + ldr r0, [r4] + ldr r3, _0809B988 + adds r0, r3 + ldr r0, [r0] + ldr r1, _0809B98C + bl sub_8015080 + lsls r0, 24 + cmp r0, 0 + bne _0809B990 + ldr r0, [r4] +_0809B972: + movs r1, 0x86 + lsls r1, 3 + adds r0, r1 +_0809B978: + movs r1, 0x1 + negs r1, r1 + str r1, [r0] + bl _0809C392 + .align 2, 0 +_0809B984: .4byte gUnknown_3001B64 +_0809B988: .4byte 0x0000042c +_0809B98C: .4byte gUnknown_811610C +_0809B990: + movs r0, 0x4 + bl sub_80119D4 + b _0809B784 +_0809B998: + bl sub_801516C + cmp r0, 0x2 + beq _0809B9BC + cmp r0, 0x3 + beq _0809B9A6 + b _0809B784 +_0809B9A6: + bl sub_8015198 + ldr r1, [r4] + movs r2, 0x86 + lsls r2, 3 + adds r1, r2 + str r0, [r1] + bl sub_80151A4 + bl _0809C392 +_0809B9BC: + ldr r0, [r4] + movs r3, 0x86 + lsls r3, 3 + adds r0, r3 + movs r1, 0x1 + negs r1, r1 + str r1, [r0] + bl sub_80151A4 + bl _0809C392 +_0809B9D2: + bl sub_809B294 + ldr r4, _0809BA08 + ldr r0, [r4] + movs r1, 0x84 + lsls r1, 3 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0x1 + bne _0809BA1C + bl sub_809B294 + ldr r0, [r4] + ldr r2, _0809BA0C + adds r0, r2 + ldr r0, [r0] + ldr r1, _0809BA10 + bl sub_8015080 + lsls r0, 24 + cmp r0, 0 + bne _0809BA14 + ldr r0, [r4] + movs r3, 0x86 + lsls r3, 3 + adds r0, r3 + b _0809B978 + .align 2, 0 +_0809BA08: .4byte gUnknown_3001B64 +_0809BA0C: .4byte 0x0000042c +_0809BA10: .4byte gUnknown_811612C +_0809BA14: + movs r0, 0x4 + bl sub_80119D4 + b _0809B784 +_0809BA1C: + bl sub_801516C + cmp r0, 0x2 + beq _0809B9BC + cmp r0, 0x3 + beq _0809B9A6 + b _0809B784 +_0809BA2A: + ldr r0, [r6] + movs r1, 0x84 + lsls r1, 3 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0x1 + bne _0809BA68 + bl sub_809B294 + ldr r0, [r6] + ldr r2, _0809BA5C + adds r0, r2 + ldr r0, [r0] + movs r1, 0x3 + bl sub_80211AC + lsls r0, 24 + cmp r0, 0 + bne _0809BA60 + ldr r0, [r6] + movs r3, 0x86 + lsls r3, 3 + adds r0, r3 + b _0809B978 + .align 2, 0 +_0809BA5C: .4byte 0x00000424 +_0809BA60: + movs r0, 0x4 + bl sub_80119D4 + b _0809B784 +_0809BA68: + movs r0, 0x1 + bl sub_8021274 + cmp r0, 0x2 + beq _0809BA92 + cmp r0, 0x3 + beq _0809BA78 + b _0809B784 +_0809BA78: + bl sub_802132C + ldr r1, [r6] + movs r2, 0x86 + lsls r2, 3 + adds r1, r2 + lsls r0, 24 + lsrs r0, 24 + str r0, [r1] + bl sub_80213A0 + bl _0809C392 +_0809BA92: + ldr r0, [r6] + movs r3, 0x86 + lsls r3, 3 + adds r0, r3 + movs r1, 0x1 + negs r1, r1 + str r1, [r0] + bl sub_80213A0 + bl _0809C392 +_0809BAA8: + ldr r0, [r6] + movs r1, 0x84 + lsls r1, 3 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0x1 + bne _0809BB10 + movs r0, 0 + movs r1, 0x12 + bl sub_8001658 + lsls r0, 16 + asrs r0, 16 + bl sub_80A2654 + lsls r0, 16 + asrs r4, r0, 16 + bl sub_809B294 + movs r0, 0x3 + movs r1, 0 + movs r2, 0xA + movs r3, 0x1 + bl sub_802F73C + lsls r0, 24 + cmp r0, 0 + bne _0809BAEA + ldr r0, [r6] + movs r2, 0x86 + lsls r2, 3 + adds r0, r2 + b _0809B978 +_0809BAEA: + movs r5, 0x1 + negs r5, r5 + cmp r4, r5 + beq _0809BB08 + adds r0, r4, 0 + bl sub_802F848 + lsls r0, 24 + cmp r0, 0 + bne _0809BB08 + movs r0, 0 + movs r1, 0x12 + adds r2, r5, 0 + bl sub_80018D8 +_0809BB08: + movs r0, 0x4 + bl sub_80119D4 + b _0809B784 +_0809BB10: + movs r0, 0x1 + bl sub_802F8A0 + cmp r0, 0x2 + beq _0809BB50 + cmp r0, 0x3 + beq _0809BB20 + b _0809B784 +_0809BB20: + bl sub_802F90C + adds r4, r0, 0 + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 + bl sub_80A26B8 + adds r2, r0, 0 + lsls r2, 16 + asrs r2, 16 + movs r0, 0 + movs r1, 0x12 + bl sub_80018D8 + ldr r0, [r6] + movs r3, 0x86 + lsls r3, 3 + adds r0, r3 + str r4, [r0] + bl sub_802F974 + bl _0809C392 +_0809BB50: + ldr r0, [r6] + movs r1, 0x86 + lsls r1, 3 + adds r0, r1 + movs r1, 0x1 + negs r1, r1 + str r1, [r0] + bl sub_802F974 + bl _0809C392 +_0809BB66: + ldr r0, [r6] + movs r2, 0x84 + lsls r2, 3 + adds r0, r2 + ldr r0, [r0] + cmp r0, 0x1 + bne _0809BB9A + bl sub_809B294 + movs r0, 0x3 + movs r1, 0 + movs r2, 0xA + bl sub_80302E8 + lsls r0, 24 + cmp r0, 0 + bne _0809BB92 + ldr r0, [r6] + movs r3, 0x86 + lsls r3, 3 + adds r0, r3 + b _0809B978 +_0809BB92: + movs r0, 0x4 + bl sub_80119D4 + b _0809B784 +_0809BB9A: + movs r0, 0x1 + bl sub_80303AC + cmp r0, 0x2 + beq _0809BBC4 + cmp r0, 0x3 + beq _0809BBAA + b _0809B784 +_0809BBAA: + bl sub_8030418 + ldr r1, [r6] + movs r2, 0x86 + lsls r2, 3 + adds r1, r2 + lsls r0, 16 + asrs r0, 16 + str r0, [r1] + bl sub_8030480 + bl _0809C392 +_0809BBC4: + ldr r0, [r6] + movs r3, 0x86 + lsls r3, 3 + adds r0, r3 + movs r1, 0x1 + negs r1, r1 + str r1, [r0] + bl sub_8030480 + bl _0809C392 +_0809BBDA: + ldr r0, [r6] + movs r1, 0x84 + lsls r1, 3 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0x1 + bne _0809BC14 + bl sub_809B294 + ldr r0, [r6] + ldr r2, _0809BC10 + adds r0, r2 + ldr r0, [r0] + cmp r0, 0xE + bne _0809BC02 + movs r0, 0 + movs r1, 0x18 + movs r2, 0x1 + bl sub_80018D8 +_0809BC02: + movs r0, 0x1 + bl sub_8011C28 + movs r0, 0 + bl sub_8012574 + b _0809B784 + .align 2, 0 +_0809BC10: .4byte 0x00000414 +_0809BC14: + bl sub_8012600 + lsls r0, 24 + cmp r0, 0 + beq _0809BC20 + b _0809B784 +_0809BC20: + bl sub_8012750 + b _0809C392 +_0809BC26: + movs r0, 0x4 + bl sub_80023E4 + lsls r0, 24 + lsrs r0, 24 + negs r4, r0 + orrs r4, r0 + lsrs r4, 31 + bl sub_809B294 + adds r0, r4, 0 + bl sub_8016C94 + lsls r0, 24 + cmp r0, 0 + beq _0809BC5C + ldr r0, _0809BC54 + ldr r0, [r0] + movs r3, 0x83 + lsls r3, 3 + adds r0, r3 + ldr r1, _0809BC58 + b _0809C266 + .align 2, 0 +_0809BC54: .4byte gUnknown_3001B64 +_0809BC58: .4byte gUnknown_81161C8 +_0809BC5C: + ldr r0, _0809BC64 + ldr r0, [r0] + b _0809B972 + .align 2, 0 +_0809BC64: .4byte gUnknown_3001B64 +_0809BC68: + ldr r0, [r6] + movs r2, 0x83 + lsls r2, 3 + adds r0, r2 + ldr r1, _0809BC74 + b _0809C266 + .align 2, 0 +_0809BC74: .4byte gUnknown_81161D8 +_0809BC78: + movs r0, 0x4 + bl sub_80023E4 + lsls r0, 24 + lsrs r0, 24 + negs r4, r0 + orrs r4, r0 + lsrs r4, 31 + bl sub_809B294 + adds r0, r4, 0 + bl sub_80162E4 + lsls r0, 24 + cmp r0, 0 + beq _0809BCB0 + ldr r0, _0809BCA8 + ldr r0, [r0] + movs r3, 0x83 + lsls r3, 3 + adds r0, r3 + ldr r1, _0809BCAC + b _0809C266 + .align 2, 0 +_0809BCA8: .4byte gUnknown_3001B64 +_0809BCAC: .4byte gUnknown_81161E8 +_0809BCB0: + ldr r0, _0809BCB8 + ldr r0, [r0] + b _0809B972 + .align 2, 0 +_0809BCB8: .4byte gUnknown_3001B64 +_0809BCBC: + movs r0, 0x4 + bl sub_80023E4 + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_809B294 + ldr r0, _0809BCE0 + ldr r0, [r0] + ldr r2, _0809BCE4 + adds r0, r2 + ldr r0, [r0] + cmp r0, 0x17 + bne _0809BCE8 + negs r0, r4 + orrs r0, r4 + lsrs r0, 31 + b _0809BCF0 + .align 2, 0 +_0809BCE0: .4byte gUnknown_3001B64 +_0809BCE4: .4byte 0x00000414 +_0809BCE8: + movs r0, 0x2 + cmp r4, 0 + beq _0809BCF0 + movs r0, 0x3 +_0809BCF0: + bl sub_8018B00 + lsls r0, 24 + cmp r0, 0 + beq _0809BD10 + ldr r0, _0809BD08 + ldr r0, [r0] + movs r3, 0x83 + lsls r3, 3 + adds r0, r3 + ldr r1, _0809BD0C + b _0809C266 + .align 2, 0 +_0809BD08: .4byte gUnknown_3001B64 +_0809BD0C: .4byte gUnknown_81161F8 +_0809BD10: + ldr r0, _0809BD18 + ldr r0, [r0] + b _0809B972 + .align 2, 0 +_0809BD18: .4byte gUnknown_3001B64 +_0809BD1C: + movs r0, 0x4 + bl sub_80023E4 + lsls r0, 24 + lsrs r0, 24 + negs r4, r0 + orrs r4, r0 + lsrs r4, 31 + bl sub_809B294 + adds r0, r4, 0 + bl sub_801FB50 + lsls r0, 24 + cmp r0, 0 + beq _0809BD54 + ldr r0, _0809BD4C + ldr r0, [r0] + movs r2, 0x83 + lsls r2, 3 + adds r0, r2 + ldr r1, _0809BD50 + b _0809C266 + .align 2, 0 +_0809BD4C: .4byte gUnknown_3001B64 +_0809BD50: .4byte gUnknown_8116208 +_0809BD54: + ldr r0, _0809BD60 + ldr r0, [r0] + movs r3, 0x86 + lsls r3, 3 + adds r0, r3 + b _0809B978 + .align 2, 0 +_0809BD60: .4byte gUnknown_3001B64 +_0809BD64: + ldr r0, [r6] + movs r1, 0x84 + lsls r1, 3 + adds r0, r1 + ldr r0, [r0] + cmp r0, 0x1 + bne _0809BD84 + bl sub_809B294 + movs r0, 0 + movs r1, 0x39 + bl sub_80015C0 + bl sub_802465C + b _0809B784 +_0809BD84: + bl sub_80246F0 + adds r4, r0, 0 + movs r0, 0 + movs r1, 0x39 + bl sub_8001658 + cmp r0, 0 + bne _0809BDB2 + bl sub_80247B4 + lsls r0, 24 + cmp r0, 0 + beq _0809BDB2 + movs r0, 0 + movs r1, 0x39 + movs r2, 0x1 + bl sub_80018D8 + movs r0, 0x46 + movs r1, 0 + bl sub_80A4BFC +_0809BDB2: + cmp r4, 0x3 + bne _0809BDCC + bl sub_80247C0 + ldr r0, _0809BDC8 + ldr r0, [r0] + movs r2, 0x86 + lsls r2, 3 + adds r0, r2 + b _0809C1BC + .align 2, 0 +_0809BDC8: .4byte gUnknown_3001B64 +_0809BDCC: + cmp r4, 0x2 + beq _0809BDD2 + b _0809B784 +_0809BDD2: + bl sub_80247C0 + ldr r0, _0809BDE4 + ldr r0, [r0] + movs r3, 0x86 + lsls r3, 3 + adds r0, r3 + b _0809B828 + .align 2, 0 +_0809BDE4: .4byte gUnknown_3001B64 +_0809BDE8: + movs r0, 0x4 + bl sub_80023E4 + lsls r0, 24 + lsrs r0, 24 + negs r4, r0 + orrs r4, r0 + lsrs r4, 31 + bl sub_809B294 + adds r0, r4, 0 + bl sub_8021B9C + lsls r0, 24 + cmp r0, 0 + beq _0809BE20 + ldr r0, _0809BE18 + ldr r0, [r0] + movs r1, 0x83 + lsls r1, 3 + adds r0, r1 + ldr r1, _0809BE1C + b _0809C266 + .align 2, 0 +_0809BE18: .4byte gUnknown_3001B64 +_0809BE1C: .4byte gUnknown_8116218 +_0809BE20: + ldr r0, _0809BE2C + ldr r0, [r0] + movs r2, 0x86 + lsls r2, 3 + adds r0, r2 + b _0809B978 + .align 2, 0 +_0809BE2C: .4byte gUnknown_3001B64 +_0809BE30: + ldr r0, [r6] + movs r3, 0x83 + lsls r3, 3 + adds r0, r3 + ldr r1, _0809BE3C + b _0809C266 + .align 2, 0 +_0809BE3C: .4byte gUnknown_8116228 +_0809BE40: + ldr r0, [r6] + movs r1, 0x83 + lsls r1, 3 + adds r0, r1 + ldr r1, _0809BE4C + b _0809C266 + .align 2, 0 +_0809BE4C: .4byte gUnknown_8116238 +_0809BE50: + ldr r0, [r6] + movs r2, 0x83 + lsls r2, 3 + adds r0, r2 + ldr r1, _0809BE5C + b _0809C266 + .align 2, 0 +_0809BE5C: .4byte gUnknown_8116248 +_0809BE60: + bl sub_809B294 + movs r0, 0x98 + lsls r0, 1 + bl sub_80314B4 + lsls r0, 24 + cmp r0, 0 + bne _0809BE84 + ldr r0, _0809BE80 + ldr r0, [r0] + movs r3, 0x86 + lsls r3, 3 + adds r0, r3 + b _0809B978 + .align 2, 0 +_0809BE80: .4byte gUnknown_3001B64 +_0809BE84: + ldr r0, _0809BE94 + ldr r0, [r0] + movs r1, 0x83 + lsls r1, 3 + adds r0, r1 + ldr r1, _0809BE98 + b _0809C266 + .align 2, 0 +_0809BE94: .4byte gUnknown_3001B64 +_0809BE98: .4byte gUnknown_8116258 +_0809BE9C: + movs r0, 0x4 + bl sub_80119D4 + ldr r0, _0809BEB0 + ldr r0, [r0] + movs r2, 0x83 + lsls r2, 3 + adds r0, r2 + ldr r1, _0809BEB4 + b _0809C266 + .align 2, 0 +_0809BEB0: .4byte gUnknown_3001B64 +_0809BEB4: .4byte gUnknown_8116268 +_0809BEB8: + movs r0, 0x4 + bl sub_80119D4 + ldr r0, _0809BECC + ldr r0, [r0] + movs r3, 0x83 + lsls r3, 3 + adds r0, r3 + ldr r1, _0809BED0 + b _0809C266 + .align 2, 0 +_0809BECC: .4byte gUnknown_3001B64 +_0809BED0: .4byte gUnknown_8116278 +_0809BED4: + mov r0, sp + bl sub_8099328 + lsls r0, 24 + cmp r0, 0 + beq _0809BF4E + add r1, sp, 0x4 + add r2, sp, 0x8 + movs r0, 0x2 + bl sub_8001B88 + ldr r0, [sp, 0x8] + cmp r0, 0x7 + bgt _0809BF4E + add r4, sp, 0xC +_0809BEF2: + lsls r1, r0, 24 + lsrs r1, 24 + mov r0, sp + ldrb r2, [r0] + adds r0, r4, 0 + bl sub_8096AF8 + ldrb r0, [r4] + cmp r0, 0 + beq _0809BF44 + ldr r1, [sp, 0x4] + ldr r2, [sp, 0x8] + movs r0, 0x2 + bl sub_8001BB4 + ldr r0, _0809BF40 + ldr r0, [r0] + movs r1, 0x86 + lsls r1, 3 + adds r2, r0, r1 + ldrh r1, [r4, 0x2] + lsls r1, 16 + asrs r1, 16 + negs r0, r1 + orrs r0, r1 + lsrs r1, r0, 31 + movs r3, 0x4 + ldrsh r0, [r4, r3] + cmp r0, 0 + beq _0809BF30 + adds r1, 0x2 +_0809BF30: + str r1, [r2] + cmp r1, 0 + beq _0809BF38 + b _0809C392 +_0809BF38: + movs r0, 0x3 + str r0, [r2] + b _0809C392 + .align 2, 0 +_0809BF40: .4byte gUnknown_3001B64 +_0809BF44: + ldr r0, [sp, 0x8] + adds r0, 0x1 + str r0, [sp, 0x8] + cmp r0, 0x7 + ble _0809BEF2 +_0809BF4E: + ldr r0, _0809BF6C + ldr r0, [r0] + movs r1, 0x86 + lsls r1, 3 + adds r0, r1 + movs r1, 0 + str r1, [r0] + bl sub_8096BD0 + movs r0, 0x2 + movs r1, 0 + movs r2, 0 + bl sub_8001BB4 + b _0809C392 + .align 2, 0 +_0809BF6C: .4byte gUnknown_3001B64 +_0809BF70: + mov r5, sp + adds r5, 0x1 + adds r0, r5, 0 + bl sub_8099328 + lsls r0, 24 + cmp r0, 0 + bne _0809BF82 + b _0809C392 +_0809BF82: + add r1, sp, 0x14 + add r2, sp, 0x18 + movs r0, 0x2 + bl sub_8001B88 + add r4, sp, 0x1C + ldr r1, [sp, 0x18] + lsls r1, 24 + lsrs r1, 24 + ldrb r2, [r5] + adds r0, r4, 0 + bl sub_8096AF8 + ldrb r0, [r4] + cmp r0, 0 + bne _0809BFA4 + b _0809C392 +_0809BFA4: + ldr r0, [sp, 0x18] + lsls r0, 24 + lsrs r0, 24 + ldrb r1, [r5] + bl sub_802DB28 + lsls r0, 24 + cmp r0, 0 + bne _0809BFB8 + b _0809C392 +_0809BFB8: + movs r0, 0 + movs r1, 0x19 + bl sub_8001658 + cmp r0, 0x63 + bgt _0809BFCE + adds r2, r0, 0x1 + movs r0, 0 + movs r1, 0x19 + bl sub_80018D8 +_0809BFCE: + movs r0, 0 + movs r1, 0x39 + movs r2, 0x1 + bl sub_80018D8 + ldr r1, [sp, 0x14] + ldr r2, [sp, 0x18] + adds r2, 0x1 + movs r0, 0x2 + bl sub_8001BB4 + ldr r0, _0809BFF4 + ldr r0, [r0] + movs r2, 0x83 + lsls r2, 3 + adds r0, r2 + ldr r1, _0809BFF8 + b _0809C266 + .align 2, 0 +_0809BFF4: .4byte gUnknown_3001B64 +_0809BFF8: .4byte gUnknown_8116288 +_0809BFFC: + ldr r0, [r6] + movs r3, 0x84 + lsls r3, 3 + adds r0, r3 + ldr r0, [r0] + cmp r0, 0x1 + bne _0809C036 + movs r0, 0x4 + bl sub_80023E4 + lsls r0, 24 + lsrs r0, 24 + negs r4, r0 + orrs r4, r0 + asrs r4, 31 + movs r0, 0x4 + ands r4, r0 + bl sub_809B294 + adds r0, r4, 0 + bl sub_802FD14 + lsls r0, 24 + cmp r0, 0 + beq _0809C032 + bl _0809B784 +_0809C032: + ldr r0, [r6] + b _0809B972 +_0809C036: + bl sub_802FE58 + cmp r0, 0x2 + beq _0809C05E + cmp r0, 0x3 + beq _0809C046 + bl _0809B784 +_0809C046: + bl sub_802FED0 + ldr r1, [r6] + movs r2, 0x86 + lsls r2, 3 + adds r1, r2 + lsls r0, 16 + asrs r0, 16 + str r0, [r1] + bl sub_802FEE0 + b _0809C392 +_0809C05E: + ldr r0, [r6] + movs r3, 0x86 + lsls r3, 3 + adds r0, r3 + movs r1, 0x1 + negs r1, r1 + str r1, [r0] + bl sub_802FEE0 + b _0809C392 +_0809C072: + movs r4, 0x1 + movs r0, 0x4 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _0809C082 + movs r4, 0x5 +_0809C082: + bl sub_809B294 + adds r0, r4, 0 + bl sub_802FD14 + lsls r0, 24 + cmp r0, 0 + beq _0809C0A8 + ldr r0, _0809C0A0 + ldr r0, [r0] + movs r1, 0x83 + lsls r1, 3 + adds r0, r1 + ldr r1, _0809C0A4 + b _0809C266 + .align 2, 0 +_0809C0A0: .4byte gUnknown_3001B64 +_0809C0A4: .4byte gUnknown_8116298 +_0809C0A8: + ldr r0, _0809C0B4 + ldr r0, [r0] + movs r2, 0x86 + lsls r2, 3 + adds r0, r2 + b _0809B978 + .align 2, 0 +_0809C0B4: .4byte gUnknown_3001B64 +_0809C0B8: + movs r4, 0x2 + movs r0, 0x4 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _0809C0C8 + movs r4, 0x6 +_0809C0C8: + bl sub_809B294 + adds r0, r4, 0 + bl sub_802FD14 + lsls r0, 24 + cmp r0, 0 + beq _0809C0F0 + ldr r0, _0809C0E8 + ldr r0, [r0] + movs r3, 0x83 + lsls r3, 3 + adds r0, r3 + ldr r1, _0809C0EC + b _0809C266 + .align 2, 0 +_0809C0E8: .4byte gUnknown_3001B64 +_0809C0EC: .4byte gUnknown_81162A8 +_0809C0F0: + ldr r0, _0809C0F8 + ldr r0, [r0] + b _0809B972 + .align 2, 0 +_0809C0F8: .4byte gUnknown_3001B64 +_0809C0FC: + movs r4, 0x3 + movs r0, 0x4 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _0809C10C + movs r4, 0x7 +_0809C10C: + bl sub_809B294 + adds r0, r4, 0 + bl sub_802FD14 + lsls r0, 24 + cmp r0, 0 + beq _0809C134 + ldr r0, _0809C12C + ldr r0, [r0] + movs r2, 0x83 + lsls r2, 3 + adds r0, r2 + ldr r1, _0809C130 + b _0809C266 + .align 2, 0 +_0809C12C: .4byte gUnknown_3001B64 +_0809C130: .4byte gUnknown_81162B8 +_0809C134: + ldr r0, _0809C144 + ldr r0, [r0] + movs r3, 0x86 + lsls r3, 3 + adds r0, r3 + bl _0809B978 + .align 2, 0 +_0809C144: .4byte gUnknown_3001B64 +_0809C148: + ldr r0, [r6] + movs r1, 0x83 + lsls r1, 3 + adds r0, r1 + ldr r1, _0809C154 + b _0809C266 + .align 2, 0 +_0809C154: .4byte gUnknown_81162C8 +_0809C158: + ldr r0, [r6] + movs r2, 0x83 + lsls r2, 3 + adds r0, r2 + ldr r1, _0809C164 + b _0809C266 + .align 2, 0 +_0809C164: .4byte gUnknown_81162D8 +_0809C168: + bl sub_809B294 + bl sub_803B050 + lsls r0, 24 + cmp r0, 0 + beq _0809C1A0 + ldr r4, _0809C194 + ldr r0, [r4] + ldr r3, _0809C198 + adds r0, r3 + movs r1, 0 + ldrsh r0, [r0, r1] + bl sub_803B100 + ldr r0, [r4] + movs r2, 0x83 + lsls r2, 3 + adds r0, r2 + ldr r1, _0809C19C + b _0809C266 + .align 2, 0 +_0809C194: .4byte gUnknown_3001B64 +_0809C198: .4byte 0x000005a4 +_0809C19C: .4byte gUnknown_81162E8 +_0809C1A0: + ldr r0, _0809C1B0 + ldr r0, [r0] + movs r3, 0x86 + lsls r3, 3 + adds r0, r3 + bl _0809B978 + .align 2, 0 +_0809C1B0: .4byte gUnknown_3001B64 +_0809C1B4: + ldr r0, [r6] + movs r1, 0x86 + lsls r1, 3 + adds r0, r1 +_0809C1BC: + movs r1, 0x1 + str r1, [r0] + b _0809C392 +_0809C1C2: + bl sub_809B294 + b _0809C392 +_0809C1C8: + movs r0, 0x2 + bl sub_80252F0 + lsls r0, 24 + cmp r0, 0 + beq _0809C1EC + ldr r0, _0809C1E4 + ldr r0, [r0] + movs r2, 0x83 + lsls r2, 3 + adds r0, r2 + ldr r1, _0809C1E8 + b _0809C266 + .align 2, 0 +_0809C1E4: .4byte gUnknown_3001B64 +_0809C1E8: .4byte gUnknown_81162F8 +_0809C1EC: + ldr r0, _0809C200 + ldr r0, [r0] + movs r3, 0x86 + lsls r3, 3 + adds r0, r3 + movs r1, 0x2 + negs r1, r1 + str r1, [r0] + b _0809C392 + .align 2, 0 +_0809C200: .4byte gUnknown_3001B64 +_0809C204: + ldr r1, [r6] + ldr r2, _0809C230 + adds r0, r1, r2 + ldr r0, [r0] + movs r3, 0x85 + lsls r3, 3 + adds r1, r3 + ldr r1, [r1] + bl sub_809CCDC + ldr r1, [r6] + movs r3, 0x86 + lsls r3, 3 + adds r2, r1, r3 + str r0, [r2] + movs r0, 0x83 + lsls r0, 3 + adds r1, r0 + ldr r0, _0809C234 + str r0, [r1] + bl _0809B784 + .align 2, 0 +_0809C230: .4byte 0x00000424 +_0809C234: .4byte gUnknown_8116308 +_0809C238: + ldr r0, [r6] + movs r2, 0x85 + lsls r2, 3 + adds r1, r0, r2 + ldr r5, [r1] + ldr r3, _0809C26C + adds r0, r3 + ldrb r4, [r0] + bl sub_809B294 + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x1 + bl sub_801B60C + lsls r0, 24 + cmp r0, 0 + beq _0809C274 + ldr r0, [r6] + movs r1, 0x83 + lsls r1, 3 + adds r0, r1 + ldr r1, _0809C270 +_0809C266: + str r1, [r0] + bl _0809B784 + .align 2, 0 +_0809C26C: .4byte 0x00000424 +_0809C270: .4byte gUnknown_8116318 +_0809C274: + ldr r0, [r6] + movs r2, 0x86 + lsls r2, 3 + adds r0, r2 + bl _0809B978 +_0809C280: + ldr r0, [r6] + movs r3, 0x84 + lsls r3, 3 + adds r0, r3 + ldr r0, [r0] + cmp r0, 0x1 + bne _0809C2B8 + bl sub_809B294 + movs r0, 0 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + movs r0, 0 + movs r1, 0 + movs r2, 0 + movs r3, 0xA + bl sub_801A5D8 + lsls r0, 24 + cmp r0, 0 + beq _0809C2B2 + bl _0809B784 +_0809C2B2: + ldr r0, [r6] + bl _0809B972 +_0809C2B8: + movs r0, 0x1 + bl sub_801A6E8 + cmp r0, 0x2 + beq _0809C320 + cmp r0, 0x3 + beq _0809C2CA + bl _0809B784 +_0809C2CA: + bl sub_801A8AC + adds r5, r0, 0 + ldr r0, _0809C304 + ldr r0, [r0] + lsls r1, r5, 2 + adds r0, r1 + ldrb r4, [r0, 0x2] + adds r0, r4, 0 + bl sub_8091570 + lsls r0, 24 + cmp r0, 0 + beq _0809C30C + ldr r0, _0809C308 + adds r1, r4, 0 + movs r2, 0 + bl sub_8090DC4 + adds r0, r5, 0 + bl sub_80911F8 + ldr r0, [r6] + movs r2, 0x86 + lsls r2, 3 + adds r0, r2 + movs r1, 0x1 + b _0809C318 + .align 2, 0 +_0809C304: .4byte gUnknown_203B460 +_0809C308: .4byte gUnknown_202DE58 +_0809C30C: + ldr r0, [r6] + movs r3, 0x86 + lsls r3, 3 + adds r0, r3 +_0809C314: + movs r1, 0x1 + negs r1, r1 +_0809C318: + str r1, [r0] + bl sub_801A928 + b _0809C392 +_0809C320: + ldr r0, [r6] + movs r1, 0x86 + lsls r1, 3 + adds r0, r1 + b _0809C314 +_0809C32A: + adds r4, r6, 0 + ldr r0, [r4] + movs r2, 0x84 + lsls r2, 3 + adds r0, r2 + ldr r0, [r0] + cmp r0, 0x1 + bne _0809C36C + bl sub_809B294 + ldr r1, [r4] + ldr r3, _0809C368 + adds r0, r1, r3 + ldr r0, [r0] + movs r2, 0x85 + lsls r2, 3 + adds r1, r2 + ldr r1, [r1] + bl sub_8035444 + lsls r0, 24 + cmp r0, 0 + beq _0809C35C + bl _0809B784 +_0809C35C: + ldr r0, [r4] + movs r3, 0x86 + lsls r3, 3 + adds r0, r3 + bl _0809B978 + .align 2, 0 +_0809C368: .4byte 0x00000424 +_0809C36C: + bl sub_8035574 + cmp r0, 0x3 + bls _0809C378 + bl _0809B784 +_0809C378: + cmp r0, 0x2 + bcs _0809C380 + bl _0809B784 +_0809C380: + ldr r0, [r6] + movs r1, 0x86 + lsls r1, 3 + adds r0, r1 + movs r1, 0x1 + negs r1, r1 + str r1, [r0] + bl sub_803565C +_0809C392: + movs r0, 0 +_0809C394: + add sp, 0x24 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_809B648 + + thumb_func_start sub_809C39C +sub_809C39C: + push {lr} + bl sub_801D178 + ldr r1, _0809C3D4 + ldr r1, [r1] + movs r2, 0x86 + lsls r2, 3 + adds r1, r2 + str r0, [r1] + cmp r0, 0x3 + bne _0809C3CC + bl sub_801D1D4 + lsls r0, 24 + lsrs r0, 24 + bl sub_8002694 + lsls r0, 16 + asrs r0, 16 + movs r2, 0x1 + negs r2, r2 + movs r1, 0 + bl sub_8098D1C +_0809C3CC: + bl sub_801D1E0 + pop {r0} + bx r0 + .align 2, 0 +_0809C3D4: .4byte gUnknown_3001B64 + thumb_func_end sub_809C39C + + thumb_func_start sub_809C3D8 +sub_809C3D8: + push {lr} + bl sub_801D178 + ldr r1, _0809C410 + ldr r1, [r1] + movs r2, 0x86 + lsls r2, 3 + adds r1, r2 + str r0, [r1] + cmp r0, 0x3 + bne _0809C408 + bl sub_801D1D4 + lsls r0, 24 + lsrs r0, 24 + bl sub_8002694 + lsls r0, 16 + asrs r0, 16 + movs r2, 0x1 + negs r2, r2 + movs r1, 0 + bl sub_8098D1C +_0809C408: + bl sub_801D1E0 + pop {r0} + bx r0 + .align 2, 0 +_0809C410: .4byte gUnknown_3001B64 + thumb_func_end sub_809C3D8 + + thumb_func_start sub_809C414 +sub_809C414: + push {lr} + bl sub_802540C + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _0809C448 + ldr r0, _0809C444 + ldr r0, [r0] + movs r2, 0x86 + lsls r2, 3 + adds r0, r2 + str r1, [r0] + adds r0, r1, 0 + bl sub_8002694 + lsls r0, 16 + asrs r0, 16 + movs r2, 0x1 + negs r2, r2 + movs r1, 0 + bl sub_8098D1C + b _0809C458 + .align 2, 0 +_0809C444: .4byte gUnknown_3001B64 +_0809C448: + ldr r0, _0809C460 + ldr r0, [r0] + movs r1, 0x86 + lsls r1, 3 + adds r0, r1 + movs r1, 0x1 + negs r1, r1 + str r1, [r0] +_0809C458: + bl sub_8025418 + pop {r0} + bx r0 + .align 2, 0 +_0809C460: .4byte gUnknown_3001B64 + thumb_func_end sub_809C414 + + thumb_func_start sub_809C464 +sub_809C464: + push {lr} + bl sub_803C850 + bl sub_8001064 + bl sub_809965C + pop {r0} + bx r0 + thumb_func_end sub_809C464 + + thumb_func_start sub_809C478 +sub_809C478: + push {lr} + sub sp, 0x8 + bl sub_80356A0 + cmp r0, 0x3 + bne _0809C492 + ldr r0, _0809C4AC + bl sub_8011988 + bl sub_800CF0C + bl sub_800CF3C +_0809C492: + bl sub_8035758 + add r2, sp, 0x4 + movs r0, 0x3 + mov r1, sp + bl sub_8001B88 + movs r0, 0 + bl sub_80993C0 + add sp, 0x8 + pop {r0} + bx r0 + .align 2, 0 +_0809C4AC: .4byte 0x00000313 + thumb_func_end sub_809C478 + + thumb_func_start sub_809C4B0 +sub_809C4B0: + push {r4,r5,lr} + movs r4, 0x1 + negs r4, r4 + ldr r5, _0809C4FC + ldr r0, [r5] + movs r2, 0x86 + lsls r2, 3 + adds r1, r0, r2 + ldr r0, [r1] + cmp r0, 0 + bne _0809C4DE + bl sub_803B168 + lsls r0, 16 + ldr r1, [r5] + ldr r3, _0809C500 + adds r2, r1, r3 + asrs r4, r0, 16 + lsrs r0, 16 + strh r0, [r2] + movs r0, 0x86 + lsls r0, 3 + adds r1, r0 +_0809C4DE: + str r4, [r1] + bl sub_803B1BC + movs r0, 0x1 + negs r0, r0 + cmp r4, r0 + beq _0809C4F4 + adds r0, r4, 0 + movs r1, 0 + bl sub_80A4BFC +_0809C4F4: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0809C4FC: .4byte gUnknown_3001B64 +_0809C500: .4byte 0x000005a4 + thumb_func_end sub_809C4B0 + + thumb_func_start sub_809C504 +sub_809C504: + push {r4,lr} + sub sp, 0x4 + mov r0, sp + bl sub_80282DC + adds r4, r0, 0 + cmp r4, 0x1 + bne _0809C530 + mov r0, sp + ldrb r0, [r0] + bl sub_809927C + ldr r0, _0809C52C + ldr r0, [r0] + movs r1, 0x86 + lsls r1, 3 + adds r0, r1 + str r4, [r0] + b _0809C540 + .align 2, 0 +_0809C52C: .4byte gUnknown_3001B64 +_0809C530: + ldr r0, _0809C54C + ldr r0, [r0] + movs r1, 0x86 + lsls r1, 3 + adds r0, r1 + movs r1, 0x1 + negs r1, r1 + str r1, [r0] +_0809C540: + bl sub_80282FC + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0809C54C: .4byte gUnknown_3001B64 + thumb_func_end sub_809C504 + + thumb_func_start sub_809C550 +sub_809C550: + push {r4,r5,lr} + bl sub_802E90C + adds r4, r0, 0 + movs r5, 0 + bl sub_802E918 + cmp r4, 0x2 + beq _0809C586 + cmp r4, 0x2 + bhi _0809C56C + cmp r4, 0x1 + beq _0809C572 + b _0809C5AC +_0809C56C: + cmp r4, 0x3 + beq _0809C59A + b _0809C5AC +_0809C572: + movs r0, 0x4 + movs r1, 0x1D + movs r2, 0x3 + bl sub_8001CC4 + lsls r0, 24 + cmp r0, 0 + beq _0809C5AC + movs r5, 0x1 + b _0809C5AC +_0809C586: + movs r0, 0x4 + movs r1, 0x1F + movs r2, 0x2 + bl sub_8001CC4 + lsls r0, 24 + cmp r0, 0 + beq _0809C5AC + movs r5, 0x2 + b _0809C5AC +_0809C59A: + movs r0, 0xB + movs r1, 0x33 + movs r2, 0x8 + bl sub_8001CC4 + lsls r0, 24 + cmp r0, 0 + beq _0809C5AC + movs r5, 0x3 +_0809C5AC: + ldr r0, _0809C5C0 + ldr r0, [r0] + movs r1, 0x86 + lsls r1, 3 + adds r0, r1 + str r5, [r0] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0809C5C0: .4byte gUnknown_3001B64 + thumb_func_end sub_809C550 + + thumb_func_start sub_809C5C4 +sub_809C5C4: + push {r4,lr} + ldr r4, _0809C610 + movs r0, 0x24 + movs r1, 0x6 + bl MemoryAlloc + str r0, [r4] + movs r2, 0 + str r2, [r0] + str r2, [r0, 0x4] + movs r3, 0 + strh r2, [r0, 0x8] + strh r2, [r0, 0xA] + strb r3, [r0, 0xD] + ldr r0, [r4] + strb r3, [r0, 0xE] + ldr r1, [r4] + str r2, [r1, 0x10] + ldr r0, _0809C614 + strh r0, [r1, 0x14] + movs r0, 0x23 + strh r0, [r1, 0x16] + strb r3, [r1, 0x18] + ldr r1, [r4] + movs r0, 0x3F + strb r0, [r1, 0x19] + ldr r0, [r4] + str r2, [r0, 0x1C] + adds r0, 0x20 + strb r3, [r0] + bl nullsub_107 + bl sub_809C63C + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0809C610: .4byte gUnknown_3001B68 +_0809C614: .4byte 0x0000ffff + thumb_func_end sub_809C5C4 + + thumb_func_start sub_809C618 +sub_809C618: + push {r4,lr} + bl sub_809C63C + bl nullsub_107 + bl nullsub_108 + ldr r4, _0809C638 + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0809C638: .4byte gUnknown_3001B68 + thumb_func_end sub_809C618 + + thumb_func_start sub_809C63C +sub_809C63C: + push {lr} + bl nullsub_108 + ldr r0, _0809C654 + ldr r0, [r0] + movs r1, 0 + str r1, [r0, 0x1C] + adds r0, 0x20 + strb r1, [r0] + pop {r0} + bx r0 + .align 2, 0 +_0809C654: .4byte gUnknown_3001B68 + thumb_func_end sub_809C63C + + thumb_func_start sub_809C658 +sub_809C658: + push {lr} + ldr r0, _0809C670 + ldr r0, [r0] + ldrh r0, [r0, 0xA] + cmp r0, 0x5 + bhi _0809C6C8 + lsls r0, 2 + ldr r1, _0809C674 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0809C670: .4byte gUnknown_3001B68 +_0809C674: .4byte _0809C678 + .align 2, 0 +_0809C678: + .4byte _0809C6C0 + .4byte _0809C6C0 + .4byte _0809C6AC + .4byte _0809C690 + .4byte _0809C69E + .4byte _0809C6B6 +_0809C690: + bl nullsub_111 + bl nullsub_112 + bl nullsub_113 + b _0809C6C8 +_0809C69E: + bl nullsub_114 + bl nullsub_115 + bl nullsub_116 + b _0809C6C8 +_0809C6AC: + bl nullsub_109 + bl nullsub_110 + b _0809C6C8 +_0809C6B6: + bl nullsub_107 + bl nullsub_108 + b _0809C6C8 +_0809C6C0: + bl nullsub_107 + bl nullsub_108 +_0809C6C8: + pop {r0} + bx r0 + thumb_func_end sub_809C658 + + thumb_func_start sub_809C6CC +sub_809C6CC: + push {lr} + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, _0809C6E8 + ldr r1, [r0] + ldrh r0, [r1, 0x8] + cmp r0, r2 + beq _0809C6E2 + movs r0, 0 + strh r2, [r1, 0x8] + strb r0, [r1, 0xE] +_0809C6E2: + pop {r0} + bx r0 + .align 2, 0 +_0809C6E8: .4byte gUnknown_3001B68 + thumb_func_end sub_809C6CC + + thumb_func_start sub_809C6EC +sub_809C6EC: + push {lr} + bl sub_8098F88 + lsls r0, 24 + cmp r0, 0 + bne _0809C718 + ldr r0, _0809C70C + ldr r0, [r0] + ldrb r0, [r0, 0xC] + cmp r0, 0 + bne _0809C710 + movs r0, 0x4 + bl sub_809C6CC + b _0809C71E + .align 2, 0 +_0809C70C: .4byte gUnknown_203B46C +_0809C710: + movs r0, 0x3 + bl sub_809C6CC + b _0809C71E +_0809C718: + movs r0, 0x5 + bl sub_809C6CC +_0809C71E: + pop {r0} + bx r0 + thumb_func_end sub_809C6EC + + thumb_func_start sub_809C724 +sub_809C724: + ldr r0, _0809C72C + ldr r0, [r0] + ldrh r0, [r0, 0x8] + bx lr + .align 2, 0 +_0809C72C: .4byte gUnknown_3001B68 + thumb_func_end sub_809C724 + + thumb_func_start sub_809C730 +sub_809C730: + push {lr} + bl sub_809C740 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + thumb_func_end sub_809C730 + + thumb_func_start sub_809C740 +sub_809C740: + push {lr} + ldr r0, _0809C750 + ldr r0, [r0] + ldr r0, [r0] + cmp r0, 0 + beq _0809C754 + movs r0, 0 + b _0809C756 + .align 2, 0 +_0809C750: .4byte gUnknown_3001B68 +_0809C754: + movs r0, 0x1 +_0809C756: + pop {r1} + bx r1 + thumb_func_end sub_809C740 + + thumb_func_start nullsub_104 +nullsub_104: + bx lr + thumb_func_end nullsub_104 + + thumb_func_start sub_809C760 +sub_809C760: + ldr r0, _0809C76C + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0xE] + bx lr + .align 2, 0 +_0809C76C: .4byte gUnknown_3001B68 + thumb_func_end sub_809C760 + + thumb_func_start sub_809C770 +sub_809C770: + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + asrs r0, 16 + mov r8, r0 + lsls r1, 16 + asrs r6, r1, 16 + ldr r4, _0809C790 + ldr r1, [r4] + ldrb r0, [r1, 0xE] + cmp r0, 0 + beq _0809C794 + movs r0, 0 + strb r0, [r1, 0xE] + b _0809CA10 + .align 2, 0 +_0809C790: .4byte gUnknown_3001B68 +_0809C794: + ldrh r0, [r1, 0x8] + cmp r0, 0 + bne _0809C79E + bl sub_809C6EC +_0809C79E: + ldr r0, [r4] + ldrb r5, [r0, 0x18] + ldrb r7, [r0, 0x19] + cmp r6, 0x26 + bls _0809C7AA + b _0809C8C8 +_0809C7AA: + lsls r0, r6, 2 + ldr r1, _0809C7B4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0809C7B4: .4byte _0809C7B8 + .align 2, 0 +_0809C7B8: + .4byte _0809C868 + .4byte _0809C868 + .4byte _0809C868 + .4byte _0809C868 + .4byte _0809C868 + .4byte _0809C868 + .4byte _0809C868 + .4byte _0809C868 + .4byte _0809C868 + .4byte _0809C854 + .4byte _0809C868 + .4byte _0809C868 + .4byte _0809C8C8 + .4byte _0809C8C8 + .4byte _0809C8C8 + .4byte _0809C8C8 + .4byte _0809C8C8 + .4byte _0809C8C8 + .4byte _0809C8C8 + .4byte _0809C8C8 + .4byte _0809C8C8 + .4byte _0809C8C8 + .4byte _0809C8C8 + .4byte _0809C8C8 + .4byte _0809C8C8 + .4byte _0809C8C8 + .4byte _0809C8C8 + .4byte _0809C8C8 + .4byte _0809C8C8 + .4byte _0809C8C8 + .4byte _0809C8C8 + .4byte _0809C8C8 + .4byte _0809C8C8 + .4byte _0809C8C8 + .4byte _0809C8C8 + .4byte _0809C86E + .4byte _0809C8C4 + .4byte _0809C8C4 + .4byte _0809C8C4 +_0809C854: + mov r0, r8 + bl sub_8002658 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0 + bne _0809C864 + b _0809CA10 +_0809C864: + movs r4, 0x1 + b _0809C988 +_0809C868: + movs r4, 0x1 + movs r5, 0 + b _0809C988 +_0809C86E: + mov r0, r8 + subs r0, 0xA4 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xD + bls _0809C87C + b _0809CA10 +_0809C87C: + lsls r0, 2 + ldr r1, _0809C888 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0809C888: .4byte _0809C88C + .align 2, 0 +_0809C88C: + .4byte _0809C8C4 + .4byte _0809C8C4 + .4byte _0809CA10 + .4byte _0809CA10 + .4byte _0809C8C4 + .4byte _0809C8C4 + .4byte _0809C8C4 + .4byte _0809CA10 + .4byte _0809CA10 + .4byte _0809CA10 + .4byte _0809C8C4 + .4byte _0809C8C4 + .4byte _0809C8C4 + .4byte _0809C8C4 +_0809C8C4: + movs r4, 0 + b _0809C988 +_0809C8C8: + adds r0, r6, 0 + subs r0, 0xC + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x16 + bhi _0809C968 + lsls r0, 2 + ldr r1, _0809C8E0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0809C8E0: .4byte _0809C8E4 + .align 2, 0 +_0809C8E4: + .4byte _0809C968 + .4byte _0809C940 + .4byte _0809C968 + .4byte _0809C968 + .4byte _0809C968 + .4byte _0809C968 + .4byte _0809C944 + .4byte _0809C944 + .4byte _0809C948 + .4byte _0809C948 + .4byte _0809C94C + .4byte _0809C968 + .4byte _0809C950 + .4byte _0809C950 + .4byte _0809C954 + .4byte _0809C954 + .4byte _0809C958 + .4byte _0809C958 + .4byte _0809C95C + .4byte _0809C95C + .4byte _0809C960 + .4byte _0809C960 + .4byte _0809C964 +_0809C940: + movs r1, 0 + b _0809C974 +_0809C944: + movs r1, 0x7 + b _0809C974 +_0809C948: + movs r1, 0x9 + b _0809C974 +_0809C94C: + movs r1, 0xA + b _0809C974 +_0809C950: + movs r1, 0xB + b _0809C974 +_0809C954: + movs r1, 0xD + b _0809C974 +_0809C958: + movs r1, 0xF + b _0809C974 +_0809C95C: + movs r1, 0x11 + b _0809C974 +_0809C960: + movs r1, 0x13 + b _0809C974 +_0809C964: + movs r1, 0x20 + b _0809C974 +_0809C968: + movs r0, 0 + movs r1, 0x13 + bl sub_8001658 + lsls r0, 16 + asrs r1, r0, 16 +_0809C974: + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0809CA10 + adds r0, r1, 0 + bl sub_80A2740 + lsls r0, 24 + lsrs r7, r0, 24 + movs r4, 0x2 +_0809C988: + ldr r0, _0809C99C + ldr r2, [r0] + ldr r1, [r2, 0x10] + adds r3, r0, 0 + cmp r1, r4 + beq _0809C9A0 + movs r0, 0x2 + str r0, [r2] + b _0809C9DE + .align 2, 0 +_0809C99C: .4byte gUnknown_3001B68 +_0809C9A0: + cmp r4, 0x1 + bne _0809C9CC + ldrb r0, [r2, 0x18] + cmp r5, r0 + bne _0809C9B2 + movs r1, 0x14 + ldrsh r0, [r2, r1] + cmp r0, r8 + beq _0809C9BC +_0809C9B2: + strb r4, [r2, 0xC] + ldr r0, [r3] + adds r0, 0x20 + strb r4, [r0] + b _0809C9E8 +_0809C9BC: + cmp r5, 0 + bne _0809C9E8 + movs r1, 0x16 + ldrsh r0, [r2, r1] + cmp r0, r6 + beq _0809C9E8 + strb r4, [r2, 0xC] + b _0809C9E8 +_0809C9CC: + cmp r4, 0x2 + bne _0809C9E8 + ldrb r0, [r2, 0x19] + cmp r7, r0 + bne _0809C9DE + movs r1, 0x16 + ldrsh r0, [r2, r1] + cmp r0, r6 + beq _0809C9E8 +_0809C9DE: + movs r1, 0x1 + strb r1, [r2, 0xC] + ldr r0, [r3] + adds r0, 0x20 + strb r1, [r0] +_0809C9E8: + ldr r1, [r3] + ldrb r0, [r1, 0xC] + cmp r0, 0 + beq _0809CA10 + str r4, [r1, 0x10] + movs r2, 0 + mov r0, r8 + strh r0, [r1, 0x14] + strh r6, [r1, 0x16] + strb r5, [r1, 0x18] + ldr r0, [r3] + strb r7, [r0, 0x19] + ldr r1, [r3] + ldrh r0, [r1, 0x8] + cmp r0, 0x4 + beq _0809CA10 + strb r2, [r1, 0xC] + ldr r0, [r3] + adds r0, 0x20 + strb r2, [r0] +_0809CA10: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_809C770 + + thumb_func_start nullsub_105 +nullsub_105: + bx lr + thumb_func_end nullsub_105 + + thumb_func_start sub_809CA20 +sub_809CA20: + push {lr} + ldr r1, _0809CA74 + ldr r2, [r1] + ldr r0, [r2] + cmp r0, 0 + beq _0809CA38 + movs r0, 0 + str r0, [r2] + movs r0, 0x1F + str r0, [r2, 0x4] + movs r0, 0x1 + strb r0, [r2, 0xC] +_0809CA38: + ldr r1, [r1] + ldrb r0, [r1, 0xC] + cmp r0, 0 + beq _0809CAE8 + ldrh r0, [r1, 0x8] + strh r0, [r1, 0xA] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x4 + bne _0809CA5E + ldr r2, [r1, 0x10] + cmp r2, 0 + bne _0809CA5E + movs r0, 0x2 + strh r0, [r1, 0xA] + str r2, [r1, 0x1C] + adds r1, 0x20 + movs r0, 0 + strb r0, [r1] +_0809CA5E: + ldr r0, _0809CA74 + ldr r0, [r0] + ldrh r0, [r0, 0xA] + cmp r0, 0x5 + bhi _0809CADA + lsls r0, 2 + ldr r1, _0809CA78 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0809CA74: .4byte gUnknown_3001B68 +_0809CA78: .4byte _0809CA7C + .align 2, 0 +_0809CA7C: + .4byte _0809CAD2 + .4byte _0809CAD2 + .4byte _0809CABE + .4byte _0809CA94 + .4byte _0809CAB0 + .4byte _0809CAC8 +_0809CA94: + bl nullsub_111 + bl nullsub_113 + bl nullsub_112 + ldr r0, _0809CAAC + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0xD] + b _0809CADA + .align 2, 0 +_0809CAAC: .4byte gUnknown_3001B68 +_0809CAB0: + bl nullsub_114 + bl nullsub_115 + bl nullsub_116 + b _0809CADA +_0809CABE: + bl nullsub_109 + bl nullsub_110 + b _0809CADA +_0809CAC8: + bl nullsub_107 + bl nullsub_108 + b _0809CADA +_0809CAD2: + bl nullsub_107 + bl nullsub_108 +_0809CADA: + ldr r0, _0809CAE4 + ldr r1, [r0] + movs r0, 0 + strb r0, [r1, 0xC] + b _0809CB1E + .align 2, 0 +_0809CAE4: .4byte gUnknown_3001B68 +_0809CAE8: + ldrh r0, [r1, 0xA] + cmp r0, 0x5 + bhi _0809CB1E + lsls r0, 2 + ldr r1, _0809CAF8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0809CAF8: .4byte _0809CAFC + .align 2, 0 +_0809CAFC: + .4byte _0809CB1E + .4byte _0809CB1E + .4byte _0809CB1E + .4byte _0809CB14 + .4byte _0809CB1A + .4byte _0809CB1E +_0809CB14: + bl nullsub_113 + b _0809CB1E +_0809CB1A: + bl nullsub_116 +_0809CB1E: + pop {r0} + bx r0 + thumb_func_end sub_809CA20 + + thumb_func_start nullsub_106 +nullsub_106: + bx lr + thumb_func_end nullsub_106 + + thumb_func_start nullsub_107 +nullsub_107: + bx lr + thumb_func_end nullsub_107 + + thumb_func_start nullsub_108 +nullsub_108: + bx lr + thumb_func_end nullsub_108 + + thumb_func_start nullsub_109 +nullsub_109: + bx lr + thumb_func_end nullsub_109 + + thumb_func_start nullsub_110 +nullsub_110: + bx lr + thumb_func_end nullsub_110 + + thumb_func_start nullsub_111 +nullsub_111: + bx lr + thumb_func_end nullsub_111 + + thumb_func_start nullsub_112 +nullsub_112: + bx lr + thumb_func_end nullsub_112 + + thumb_func_start nullsub_113 +nullsub_113: + bx lr + thumb_func_end nullsub_113 + + thumb_func_start nullsub_114 +nullsub_114: + bx lr + thumb_func_end nullsub_114 + + thumb_func_start nullsub_115 +nullsub_115: + bx lr + thumb_func_end nullsub_115 + + thumb_func_start nullsub_116 +nullsub_116: + bx lr + thumb_func_end nullsub_116 + + thumb_func_start sub_809CB50 +sub_809CB50: + push {r4,lr} + ldr r4, _0809CB70 + movs r0, 0xC + movs r1, 0x6 + bl MemoryAlloc + str r0, [r4] + movs r1, 0x1 + negs r1, r1 + str r1, [r0, 0x4] + movs r1, 0 + str r1, [r0, 0x8] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0809CB70: .4byte gUnknown_20399E0 + thumb_func_end sub_809CB50 + + thumb_func_start sub_809CB74 +sub_809CB74: + push {r4,lr} + ldr r4, _0809CB88 + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0809CB88: .4byte gUnknown_20399E0 + thumb_func_end sub_809CB74 + + thumb_func_start sub_809CB8C +sub_809CB8C: + push {lr} + movs r0, 0 + movs r1, 0x3B + bl sub_80015C0 + movs r0, 0 + movs r1, 0x3D + bl sub_80015C0 + pop {r0} + bx r0 + thumb_func_end sub_809CB8C + + thumb_func_start sub_809CBA4 +sub_809CBA4: + push {lr} + lsls r0, 24 + lsrs r0, 24 + bl sub_8091130 + cmp r0, 0 + bge _0809CBB6 + movs r0, 0 + b _0809CBB8 +_0809CBB6: + movs r0, 0x1 +_0809CBB8: + pop {r1} + bx r1 + thumb_func_end sub_809CBA4 + + thumb_func_start sub_809CBBC +sub_809CBBC: + push {r4-r7,lr} + sub sp, 0x54 + adds r4, r0, 0 + adds r6, r1, 0 + adds r5, r2, 0 + adds r7, r3, 0 + ldrb r1, [r4] + cmp r1, 0x69 + bne _0809CC20 + ldr r1, _0809CC0C + movs r0, 0x2 + ldrsh r2, [r4, r0] + ldr r0, _0809CC10 + ldr r0, [r0] + movs r3, 0xD2 + lsls r3, 4 + adds r0, r3 + ldr r3, [r0] + mov r0, sp + bl sub_800D158 + ldr r0, _0809CC14 + ldr r0, [r0] + movs r1, 0x98 + lsls r1, 2 + adds r2, r0, r1 + movs r3, 0x2 + ldrsh r1, [r4, r3] + ldr r0, [r2] + adds r1, r0, r1 + ldr r0, _0809CC18 + cmp r1, r0 + ble _0809CC1C + cmp r6, 0 + beq _0809CC4E + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + adds r2, r6, 0 + b _0809CC4A + .align 2, 0 +_0809CC0C: .4byte gUnknown_81163E4 +_0809CC10: .4byte gUnknown_20389A4 +_0809CC14: .4byte gUnknown_203B460 +_0809CC18: .4byte 0x0001869f +_0809CC1C: + str r1, [r2] + b _0809CC5E +_0809CC20: + ldrb r0, [r4, 0x2] + lsls r1, 16 + lsls r0, 8 + orrs r0, r1 + str r0, [sp, 0x50] + add r4, sp, 0x50 + mov r0, sp + adds r1, r4, 0 + movs r2, 0 + bl sub_8090E14 + bl sub_8090A34 + cmp r0, 0x13 + ble _0809CC52 + cmp r5, 0 + beq _0809CC4E + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + adds r2, r5, 0 +_0809CC4A: + bl sub_809AE90 +_0809CC4E: + movs r0, 0 + b _0809CC82 +_0809CC52: + ldrb r0, [r4, 0x2] + movs r1, 0 + bl sub_809124C + bl sub_80910B4 +_0809CC5E: + cmp r7, 0 + beq _0809CC80 + ldr r0, _0809CC8C + mov r1, sp + bl strcpy + movs r1, 0x1 + negs r1, r1 + movs r0, 0 + adds r2, r7, 0 + bl sub_809AE90 + movs r1, 0x80 + lsls r1, 1 + movs r0, 0xCB + bl sub_8011974 +_0809CC80: + movs r0, 0x1 +_0809CC82: + add sp, 0x54 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_0809CC8C: .4byte gUnknown_202DE58 + thumb_func_end sub_809CBBC + + thumb_func_start sub_809CC90 +sub_809CC90: + push {lr} + lsls r0, 2 + ldr r1, _0809CCBC + adds r1, r0, r1 + ldrb r0, [r1] + cmp r0, 0x69 + bne _0809CCC8 + ldr r0, _0809CCC0 + ldr r0, [r0] + movs r2, 0x98 + lsls r2, 2 + adds r0, r2 + movs r2, 0x2 + ldrsh r1, [r1, r2] + ldr r0, [r0] + adds r0, r1 + ldr r1, _0809CCC4 + cmp r0, r1 + ble _0809CCD4 + movs r0, 0x2 + b _0809CCD6 + .align 2, 0 +_0809CCBC: .4byte gUnknown_81163BC +_0809CCC0: .4byte gUnknown_203B460 +_0809CCC4: .4byte 0x0001869f +_0809CCC8: + bl sub_8090A34 + cmp r0, 0x13 + ble _0809CCD4 + movs r0, 0x2 + b _0809CCD6 +_0809CCD4: + movs r0, 0x1 +_0809CCD6: + pop {r1} + bx r1 + thumb_func_end sub_809CC90 + + thumb_func_start sub_809CCDC +sub_809CCDC: + push {r4-r6,lr} + adds r6, r0, 0 + adds r4, r1, 0 + lsls r1, r6, 2 + ldr r0, _0809CD20 + adds r5, r1, r0 + ldr r0, _0809CD24 + ldr r1, [r0] + movs r0, 0x1 + negs r0, r0 + str r0, [r1, 0x4] + movs r0, 0 + str r0, [r1, 0x8] + movs r0, 0x2 + cmp r4, 0x63 + bgt _0809CD04 + movs r0, 0 + cmp r4, 0x1 + ble _0809CD04 + movs r0, 0x1 +_0809CD04: + ldr r1, _0809CD28 + ldr r2, _0809CD2C + ldr r3, _0809CD30 + lsls r0, 2 + adds r0, r3 + ldr r3, [r0] + adds r0, r5, 0 + bl sub_809CBBC + lsls r0, 24 + cmp r0, 0 + bne _0809CD34 + movs r0, 0x2 + b _0809CD3E + .align 2, 0 +_0809CD20: .4byte gUnknown_81163BC +_0809CD24: .4byte gUnknown_20399E0 +_0809CD28: .4byte gUnknown_81163F0 +_0809CD2C: .4byte gUnknown_811642C +_0809CD30: .4byte gUnknown_203B4A0 +_0809CD34: + ldr r0, _0809CD44 + ldr r0, [r0] + str r6, [r0, 0x4] + str r4, [r0, 0x8] + movs r0, 0x1 +_0809CD3E: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0809CD44: .4byte gUnknown_20399E0 + thumb_func_end sub_809CCDC + + thumb_func_start sub_809CD48 +sub_809CD48: + push {lr} + bl sub_809A750 + lsls r0, 24 + cmp r0, 0 + bne _0809CD58 + movs r0, 0x3 + b _0809CD5A +_0809CD58: + movs r0, 0 +_0809CD5A: + pop {r1} + bx r1 + thumb_func_end sub_809CD48 + + thumb_func_start nullsub_117 +nullsub_117: + bx lr + thumb_func_end nullsub_117 + + thumb_func_start nullsub_118 +nullsub_118: + bx lr + thumb_func_end nullsub_118 + + thumb_func_start sub_809CD68 +sub_809CD68: + movs r2, 0 + str r2, [r0] + str r2, [r0, 0x4] + movs r1, 0x1 + negs r1, r1 + str r1, [r0, 0x10] + str r2, [r0, 0x14] + str r2, [r0, 0x8] + strb r2, [r0, 0x18] + bx lr + thumb_func_end sub_809CD68 + + thumb_func_start sub_809CD7C +sub_809CD7C: + movs r2, 0 + str r2, [r0] + movs r1, 0x1 + negs r1, r1 + str r1, [r0, 0x10] + str r2, [r0, 0x14] + str r2, [r0, 0x8] + bx lr + thumb_func_end sub_809CD7C + + thumb_func_start sub_809CD8C +sub_809CD8C: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + cmp r4, 0x5 + bne _0809CD9E + bl sub_809CD68 + str r4, [r5] + b _0809CDB0 +_0809CD9E: + ldr r0, [r5, 0x4] + cmp r0, r4 + beq _0809CDB0 + str r4, [r5, 0x4] + movs r0, 0x1 + negs r0, r0 + str r0, [r5, 0x10] + movs r0, 0 + str r0, [r5, 0x14] +_0809CDB0: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_809CD8C + + thumb_func_start sub_809CDB8 +sub_809CDB8: + push {lr} + adds r1, r0, 0 + ldr r0, [r1, 0x4] + cmp r0, 0 + bne _0809CDC4 + ldr r0, [r1] +_0809CDC4: + pop {r1} + bx r1 + thumb_func_end sub_809CDB8 + + thumb_func_start sub_809CDC8 +sub_809CDC8: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + adds r4, r0, 0 + adds r6, r1, 0 + adds r7, r2, 0 + ldr r1, [sp, 0x24] + movs r0, 0x1 + negs r0, r0 + str r0, [r3] + ldr r0, [r4] + cmp r0, 0x1 + beq _0809CDEA + cmp r0, 0x2 + beq _0809CDFE + b _0809CE12 +_0809CDEA: + movs r0, 0x80 + lsls r0, 6 + ands r1, r0 + cmp r1, 0 + beq _0809CE12 + adds r0, r4, 0 + bl sub_809CD68 + movs r0, 0x2 + b _0809CE10 +_0809CDFE: + movs r0, 0x80 + lsls r0, 6 + ands r1, r0 + cmp r1, 0 + bne _0809CE12 + adds r0, r4, 0 + bl sub_809CD68 + movs r0, 0x1 +_0809CE10: + str r0, [r4] +_0809CE12: + ldr r0, [r4, 0x4] + mov r8, r0 + cmp r0, 0 + bne _0809CE1E + ldr r1, [r4] + mov r8, r1 +_0809CE1E: + mov r0, r8 + subs r0, 0x1 + cmp r0, 0x6 + bls _0809CE28 + b _0809CFCC +_0809CE28: + lsls r0, 2 + ldr r1, _0809CE34 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0809CE34: .4byte _0809CE38 + .align 2, 0 +_0809CE38: + .4byte _0809CE54 + .4byte _0809CF74 + .4byte _0809CFCC + .4byte _0809CFCC + .4byte _0809CECC + .4byte _0809CF5C + .4byte _0809CF5C +_0809CE54: + ldr r0, _0809CE70 + ldrh r2, [r0] + ldrh r1, [r0, 0x2] + movs r0, 0xF0 + ands r0, r2 + cmp r0, 0 + beq _0809CE74 + movs r0, 0x2 + ands r0, r2 + cmp r0, 0 + beq _0809CEA4 + movs r0, 0 + b _0809CEA8 + .align 2, 0 +_0809CE70: .4byte gUnknown_20255F0 +_0809CE74: + movs r3, 0x2 + adds r0, r1, 0 + ands r0, r3 + cmp r0, 0 + beq _0809CE82 + movs r0, 0x14 + b _0809CEA8 +_0809CE82: + ldr r0, [r4, 0x10] + cmp r0, 0x1 + ble _0809CEA4 + subs r0, 0x1 + str r0, [r4, 0x10] + adds r0, r2, 0 + ands r0, r3 + cmp r0, 0 + bne _0809CEAA + movs r0, 0x13 + str r0, [r6] + movs r1, 0x1 + negs r1, r1 + adds r0, r1, 0 + strb r0, [r7] + movs r0, 0x5 + b _0809CFDA +_0809CEA4: + movs r0, 0x1 + negs r0, r0 +_0809CEA8: + str r0, [r4, 0x10] +_0809CEAA: + movs r0, 0x1 + ands r1, r0 + cmp r1, 0 + beq _0809CEB6 + movs r0, 0xA + b _0809CEC2 +_0809CEB6: + ldr r0, [r4, 0x10] + cmp r0, 0 + bne _0809CEC0 + movs r0, 0x8 + b _0809CEC2 +_0809CEC0: + movs r0, 0x7 +_0809CEC2: + str r0, [r6] + adds r0, r2, 0 + bl sub_809CFE8 + b _0809CF4E +_0809CECC: + mov r0, sp + bl sub_809B260 + lsls r0, 24 + cmp r0, 0 + beq _0809CFCC + ldr r0, _0809CEEC + ldr r0, [r0] + ldrb r0, [r0, 0xC] + cmp r0, 0 + bne _0809CEF0 + movs r0, 0x4 + bl sub_809C6CC + b _0809CEF6 + .align 2, 0 +_0809CEEC: .4byte gUnknown_203B46C +_0809CEF0: + movs r0, 0x3 + bl sub_809C6CC +_0809CEF6: + bl nullsub_104 + adds r0, r4, 0 + bl sub_809CD7C + movs r5, 0x1 + str r5, [r4] + ldr r0, [sp] + cmp r0, 0x2 + beq _0809CF1E + cmp r0, 0x2 + bgt _0809CF14 + cmp r0, 0x1 + beq _0809CF2A + b _0809CF54 +_0809CF14: + cmp r0, 0x3 + beq _0809CF2A + cmp r0, 0x4 + beq _0809CF3C + b _0809CF54 +_0809CF1E: + movs r0, 0x4 + str r0, [r4] + movs r0, 0x1E + bl sub_8098D80 + b _0809CF46 +_0809CF2A: + movs r0, 0x4 + str r0, [r4] + str r5, [r6] + movs r1, 0x1 + negs r1, r1 + adds r0, r1, 0 + strb r0, [r7] + movs r0, 0x4 + b _0809CFDA +_0809CF3C: + str r0, [r4] + movs r0, 0x45 + movs r1, 0 + bl sub_80A4BFC +_0809CF46: + str r5, [r6] + movs r1, 0x1 + negs r1, r1 + adds r0, r1, 0 +_0809CF4E: + strb r0, [r7] + ldr r0, [r4] + b _0809CFDA +_0809CF54: + movs r0, 0x2 + bl sub_809D9B8 + b _0809CFCC +_0809CF5C: + add r0, sp, 0x4 + bl sub_809B260 + lsls r0, 24 + cmp r0, 0 + beq _0809CFCC + adds r0, r4, 0 + bl sub_809CD7C + movs r0, 0x1 + str r0, [r4] + b _0809CFDA +_0809CF74: + ldr r0, [r4, 0x8] + cmp r0, 0 + ble _0809CF86 + subs r0, 0x1 + str r0, [r4, 0x8] + movs r0, 0x9 + str r0, [r6] + ldrb r0, [r4, 0xC] + b _0809CFD6 +_0809CF86: + ldr r0, _0809CFA0 + ldrh r1, [r0] + movs r0, 0x9 + str r0, [r6] + movs r0, 0x40 + ands r0, r1 + lsls r0, 16 + lsrs r2, r0, 16 + cmp r2, 0 + beq _0809CFA4 + movs r0, 0x4 + b _0809CFB6 + .align 2, 0 +_0809CFA0: .4byte gUnknown_20255F0 +_0809CFA4: + movs r0, 0x80 + ands r1, r0 + cmp r1, 0 + beq _0809CFB0 + strb r2, [r7] + b _0809CFB8 +_0809CFB0: + movs r1, 0x1 + negs r1, r1 + adds r0, r1, 0 +_0809CFB6: + strb r0, [r7] +_0809CFB8: + ldrb r0, [r7] + strb r0, [r4, 0xC] + lsls r0, 24 + movs r1, 0xFF + lsls r1, 24 + cmp r0, r1 + beq _0809CFD8 + movs r0, 0x20 + str r0, [r4, 0x8] + b _0809CFD8 +_0809CFCC: + movs r0, 0 + str r0, [r6] + movs r1, 0x1 + negs r1, r1 + adds r0, r1, 0 +_0809CFD6: + strb r0, [r7] +_0809CFD8: + mov r0, r8 +_0809CFDA: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_809CDC8 + + thumb_func_start sub_809CFE8 +sub_809CFE8: + push {lr} + lsls r0, 16 + lsrs r1, r0, 16 + adds r2, r1, 0 + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _0809D014 + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0809D004 + movs r0, 0x3 + b _0809D052 +_0809D004: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0809D010 + movs r0, 0x5 + b _0809D052 +_0809D010: + movs r0, 0x4 + b _0809D052 +_0809D014: + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _0809D038 + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0809D028 + movs r0, 0x1 + b _0809D052 +_0809D028: + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _0809D034 + movs r0, 0x7 + b _0809D052 +_0809D034: + movs r0, 0 + b _0809D052 +_0809D038: + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + beq _0809D044 + movs r0, 0x2 + b _0809D052 +_0809D044: + movs r0, 0x20 + ands r2, r0 + cmp r2, 0 + bne _0809D050 + subs r0, 0x21 + b _0809D052 +_0809D050: + movs r0, 0x6 +_0809D052: + pop {r1} + bx r1 + thumb_func_end sub_809CFE8 + + thumb_func_start sub_809D058 +sub_809D058: + push {lr} + ldr r1, [r0, 0x4] + cmp r1, 0x3F + bgt _0809D076 + ldr r0, [r0] + cmp r0, 0x67 + bgt _0809D06A + movs r0, 0x5 + b _0809D0A6 +_0809D06A: + cmp r0, 0x88 + ble _0809D072 + movs r0, 0x3 + b _0809D0A6 +_0809D072: + movs r0, 0x4 + b _0809D0A6 +_0809D076: + cmp r1, 0x60 + ble _0809D090 + ldr r0, [r0] + cmp r0, 0x67 + bgt _0809D084 + movs r0, 0x7 + b _0809D0A6 +_0809D084: + cmp r0, 0x88 + ble _0809D08C + movs r0, 0x1 + b _0809D0A6 +_0809D08C: + movs r0, 0 + b _0809D0A6 +_0809D090: + ldr r0, [r0] + cmp r0, 0x67 + bgt _0809D09A + movs r0, 0x6 + b _0809D0A6 +_0809D09A: + cmp r0, 0x88 + bgt _0809D0A4 + movs r0, 0x1 + negs r0, r0 + b _0809D0A6 +_0809D0A4: + movs r0, 0x2 +_0809D0A6: + pop {r1} + bx r1 + thumb_func_end sub_809D058 + + thumb_func_start sub_809D0AC +sub_809D0AC: + push {lr} + bl sub_809D0BC + pop {r0} + bx r0 + thumb_func_end sub_809D0AC + + thumb_func_start nullsub_119 +nullsub_119: + bx lr + thumb_func_end nullsub_119 + + thumb_func_start sub_809D0BC +sub_809D0BC: + push {r4,r5,lr} + ldr r5, _0809D0F8 + ldr r1, _0809D0FC + ldr r2, [r1] + ldr r3, [r1, 0x4] + str r2, [r5, 0x3C] + str r3, [r5, 0x40] + adds r0, r5, 0 + adds r0, 0x44 + movs r4, 0 + strb r4, [r0] + movs r0, 0 + bl sub_809D158 + str r4, [r5, 0x8] + str r4, [r5, 0xC] + str r4, [r5, 0x10] + movs r0, 0x1 + negs r0, r0 + str r0, [r5, 0x4] + str r4, [r5, 0x24] + str r4, [r5, 0x28] + str r4, [r5, 0x2C] + str r4, [r5, 0x30] + str r4, [r5, 0x34] + str r4, [r5, 0x38] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0809D0F8: .4byte gUnknown_20399E8 +_0809D0FC: .4byte gUnknown_8116478 + thumb_func_end sub_809D0BC + + thumb_func_start sub_809D100 +sub_809D100: + push {lr} + adds r2, r0, 0 + ldr r1, _0809D120 + ldr r0, [r1, 0x24] + cmp r0, r2 + beq _0809D11A + str r2, [r1, 0x24] + movs r0, 0 + str r0, [r1, 0x28] + str r0, [r1, 0x2C] + str r0, [r1, 0x30] + str r0, [r1, 0x34] + str r0, [r1, 0x38] +_0809D11A: + pop {r0} + bx r0 + .align 2, 0 +_0809D120: .4byte gUnknown_20399E8 + thumb_func_end sub_809D100 + + thumb_func_start sub_809D124 +sub_809D124: + push {r4,lr} + adds r4, r0, 0 + ldr r3, _0809D144 + ldr r0, [r3, 0x24] + cmp r0, r4 + beq _0809D13A + str r4, [r3, 0x24] + movs r0, 0 + str r0, [r3, 0x30] + str r0, [r3, 0x34] + str r0, [r3, 0x38] +_0809D13A: + str r1, [r3, 0x28] + str r2, [r3, 0x2C] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0809D144: .4byte gUnknown_20399E8 + thumb_func_end sub_809D124 + + thumb_func_start sub_809D148 +sub_809D148: + ldr r1, _0809D154 + str r0, [r1] + movs r0, 0 + str r0, [r1, 0x8] + bx lr + .align 2, 0 +_0809D154: .4byte gUnknown_20399E8 + thumb_func_end sub_809D148 + + thumb_func_start sub_809D158 +sub_809D158: + ldr r2, _0809D16C + str r0, [r2] + movs r0, 0 + str r0, [r2, 0x8] + ldr r0, [r1] + ldr r1, [r1, 0x4] + str r0, [r2, 0x1C] + str r1, [r2, 0x20] + bx lr + .align 2, 0 +_0809D16C: .4byte gUnknown_20399E8 + thumb_func_end sub_809D158 + + thumb_func_start sub_809D170 +sub_809D170: + ldr r2, _0809D17C + str r0, [r2] + movs r0, 0 + str r0, [r2, 0x8] + str r1, [r2, 0x4] + bx lr + .align 2, 0 +_0809D17C: .4byte gUnknown_20399E8 + thumb_func_end sub_809D170 + + thumb_func_start sub_809D180 +sub_809D180: + ldr r2, _0809D18C + str r0, [r2] + movs r0, 0x1 + str r0, [r2, 0x8] + str r1, [r2, 0xC] + bx lr + .align 2, 0 +_0809D18C: .4byte gUnknown_20399E8 + thumb_func_end sub_809D180 + + thumb_func_start sub_809D190 +sub_809D190: + ldr r3, _0809D1A4 + str r0, [r3] + movs r0, 0x1 + str r0, [r3, 0x8] + str r2, [r3, 0xC] + ldr r0, [r1] + ldr r1, [r1, 0x4] + str r0, [r3, 0x14] + str r1, [r3, 0x18] + bx lr + .align 2, 0 +_0809D1A4: .4byte gUnknown_20399E8 + thumb_func_end sub_809D190 + + thumb_func_start sub_809D1A8 +sub_809D1A8: + ldr r3, _0809D1B8 + str r0, [r3] + movs r0, 0x1 + str r0, [r3, 0x8] + str r2, [r3, 0xC] + str r1, [r3, 0x4] + bx lr + .align 2, 0 +_0809D1B8: .4byte gUnknown_20399E8 + thumb_func_end sub_809D1A8 + + thumb_func_start sub_809D1BC +sub_809D1BC: + ldr r2, _0809D1C8 + str r0, [r2] + movs r0, 0x2 + str r0, [r2, 0x8] + str r1, [r2, 0x10] + bx lr + .align 2, 0 +_0809D1C8: .4byte gUnknown_20399E8 + thumb_func_end sub_809D1BC + + thumb_func_start sub_809D1CC +sub_809D1CC: + ldr r3, _0809D1E0 + str r0, [r3] + movs r0, 0x2 + str r0, [r3, 0x8] + str r2, [r3, 0x10] + ldr r0, [r1] + ldr r1, [r1, 0x4] + str r0, [r3, 0x14] + str r1, [r3, 0x18] + bx lr + .align 2, 0 +_0809D1E0: .4byte gUnknown_20399E8 + thumb_func_end sub_809D1CC + + thumb_func_start sub_809D1E4 +sub_809D1E4: + ldr r3, _0809D1F4 + str r0, [r3] + movs r0, 0x2 + str r0, [r3, 0x8] + str r2, [r3, 0x10] + str r1, [r3, 0x4] + bx lr + .align 2, 0 +_0809D1F4: .4byte gUnknown_20399E8 + thumb_func_end sub_809D1E4 + + thumb_func_start sub_809D1F8 +sub_809D1F8: + ldr r2, _0809D204 + str r0, [r2] + movs r0, 0x3 + str r0, [r2, 0x8] + str r1, [r2, 0xC] + bx lr + .align 2, 0 +_0809D204: .4byte gUnknown_20399E8 + thumb_func_end sub_809D1F8 + + thumb_func_start sub_809D208 +sub_809D208: + ldr r3, _0809D21C + str r0, [r3] + movs r0, 0x3 + str r0, [r3, 0x8] + str r2, [r3, 0xC] + ldr r0, [r1] + ldr r1, [r1, 0x4] + str r0, [r3, 0x14] + str r1, [r3, 0x18] + bx lr + .align 2, 0 +_0809D21C: .4byte gUnknown_20399E8 + thumb_func_end sub_809D208 + + thumb_func_start sub_809D220 +sub_809D220: + ldr r3, _0809D230 + str r0, [r3] + movs r0, 0x3 + str r0, [r3, 0x8] + str r2, [r3, 0xC] + str r1, [r3, 0x4] + bx lr + .align 2, 0 +_0809D230: .4byte gUnknown_20399E8 + thumb_func_end sub_809D220 + + thumb_func_start sub_809D234 +sub_809D234: + push {lr} + ldr r0, _0809D244 + ldr r0, [r0, 0x8] + cmp r0, 0 + beq _0809D240 + movs r0, 0x1 +_0809D240: + pop {r1} + bx r1 + .align 2, 0 +_0809D244: .4byte gUnknown_20399E8 + thumb_func_end sub_809D234 + + thumb_func_start sub_809D248 +sub_809D248: + ldr r3, _0809D258 + ldr r1, [r3, 0x3C] + ldr r2, [r3, 0x40] + str r1, [r0] + str r2, [r0, 0x4] + adds r3, 0x44 + ldrb r0, [r3] + bx lr + .align 2, 0 +_0809D258: .4byte gUnknown_20399E8 + thumb_func_end sub_809D248 + + thumb_func_start sub_809D25C +sub_809D25C: + push {r4-r6,lr} + sub sp, 0x24 + ldr r4, _0809D274 + ldr r0, [r4] + cmp r0, 0x2 + beq _0809D28C + cmp r0, 0x2 + bhi _0809D278 + cmp r0, 0x1 + beq _0809D27E + b _0809D2B2 + .align 2, 0 +_0809D274: .4byte gUnknown_20399E8 +_0809D278: + cmp r0, 0x3 + beq _0809D29A + b _0809D2B2 +_0809D27E: + movs r1, 0x4 + ldrsh r0, [r4, r1] + adds r1, r4, 0 + adds r1, 0x1C + bl sub_80A8FD8 + b _0809D2A6 +_0809D28C: + movs r1, 0x4 + ldrsh r0, [r4, r1] + adds r1, r4, 0 + adds r1, 0x1C + bl sub_80AC448 + b _0809D2A6 +_0809D29A: + movs r1, 0x4 + ldrsh r0, [r4, r1] + adds r1, r4, 0 + adds r1, 0x1C + bl sub_80AD360 +_0809D2A6: + lsls r0, 16 + ldr r1, _0809D2C4 + cmp r0, r1 + bne _0809D2B2 + movs r0, 0 + str r0, [r4] +_0809D2B2: + ldr r4, _0809D2C8 + ldr r0, [r4, 0x8] + cmp r0, 0x2 + beq _0809D356 + cmp r0, 0x2 + bhi _0809D2CC + cmp r0, 0x1 + beq _0809D2D2 + b _0809D388 + .align 2, 0 +_0809D2C4: .4byte 0xffff0000 +_0809D2C8: .4byte gUnknown_20399E8 +_0809D2CC: + cmp r0, 0x3 + beq _0809D314 + b _0809D388 +_0809D2D2: + ldr r0, [r4, 0x1C] + ldr r1, [r4, 0x14] + subs r0, r1 + str r0, [sp, 0x4] + ldr r0, [r4, 0x20] + ldr r1, [r4, 0x18] + subs r0, r1 + str r0, [sp, 0x8] + ldr r1, [r4, 0xC] + add r0, sp, 0x4 + bl sub_800290C + ldr r0, [sp, 0x4] + cmp r0, 0 + bne _0809D2FA + ldr r0, [sp, 0x8] + cmp r0, 0 + bne _0809D2FA + str r0, [r4, 0x8] + b _0809D392 +_0809D2FA: + ldr r2, _0809D310 + ldr r0, [r2, 0x14] + ldr r1, [sp, 0x4] + adds r0, r1 + str r0, [r2, 0x14] + ldr r0, [r2, 0x18] + ldr r1, [sp, 0x8] + adds r0, r1 + str r0, [r2, 0x18] + b _0809D392 + .align 2, 0 +_0809D310: .4byte gUnknown_20399E8 +_0809D314: + ldr r1, [r4, 0x1C] + ldr r0, [r4, 0x14] + subs r0, r1, r0 + cmp r0, 0 + bge _0809D320 + adds r0, 0xFF +_0809D320: + asrs r2, r0, 8 + ldr r1, [r4, 0x20] + ldr r0, [r4, 0x18] + subs r1, r0 + cmp r1, 0 + bge _0809D32E + adds r1, 0xFF +_0809D32E: + asrs r1, 8 + lsls r0, r2, 8 + lsls r1, 8 + bl sub_8009FB8 + cmp r0, 0 + bge _0809D33E + adds r0, 0xFF +_0809D33E: + asrs r0, 8 + lsls r0, 8 + ldr r1, [r4, 0xC] + bl __divsi3 + str r0, [r4, 0x10] + cmp r0, 0 + bgt _0809D352 + movs r0, 0x1 + str r0, [r4, 0x10] +_0809D352: + movs r0, 0x2 + str r0, [r4, 0x8] +_0809D356: + add r0, sp, 0xC + ldr r1, _0809D384 + adds r2, r1, 0 + adds r2, 0x8 + adds r5, r1, 0 + subs r5, 0x14 + ldr r3, [r5, 0x10] + movs r4, 0x1 + str r4, [sp] + bl sub_8002934 + ldr r0, [sp, 0xC] + ldr r1, [sp, 0x10] + str r0, [r5, 0x14] + str r1, [r5, 0x18] + ldr r0, [r5, 0x10] + subs r0, 0x1 + str r0, [r5, 0x10] + cmp r0, 0 + bgt _0809D392 + movs r0, 0 + str r0, [r5, 0x8] + b _0809D392 + .align 2, 0 +_0809D384: .4byte gUnknown_20399FC +_0809D388: + ldr r2, _0809D3A4 + ldr r0, [r2, 0x1C] + ldr r1, [r2, 0x20] + str r0, [r2, 0x14] + str r1, [r2, 0x18] +_0809D392: + ldr r5, _0809D3A4 + ldr r0, [r5, 0x24] + cmp r0, 0x1 + beq _0809D3A8 + cmp r0, 0x2 + beq _0809D3D2 + movs r0, 0 + str r0, [r5, 0x34] + b _0809D402 + .align 2, 0 +_0809D3A4: .4byte gUnknown_20399E8 +_0809D3A8: + ldr r0, [r5, 0x30] + subs r0, 0x1 + str r0, [r5, 0x30] + cmp r0, 0 + bgt _0809D404 + movs r0, 0x4 + str r0, [r5, 0x30] + movs r4, 0x2 + negs r4, r4 + adds r0, r4, 0 + movs r1, 0x2 + bl sub_8004530 + lsls r0, 10 + str r0, [r5, 0x34] + adds r0, r4, 0 + movs r1, 0x2 + bl sub_8004530 + lsls r0, 10 + b _0809D402 +_0809D3D2: + ldr r0, [r5, 0x30] + subs r0, 0x1 + str r0, [r5, 0x30] + cmp r0, 0 + bgt _0809D404 + ldr r0, [r5, 0x2C] + str r0, [r5, 0x30] + movs r4, 0x2 + negs r4, r4 + adds r0, r4, 0 + movs r1, 0x2 + bl sub_8004530 + ldr r1, [r5, 0x28] + muls r0, r1 + lsls r0, 8 + str r0, [r5, 0x34] + adds r0, r4, 0 + movs r1, 0x2 + bl sub_8004530 + ldr r1, [r5, 0x28] + muls r0, r1 + lsls r0, 8 +_0809D402: + str r0, [r5, 0x38] +_0809D404: + add r5, sp, 0x14 + add r6, sp, 0x1C + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_80A579C + lsls r0, 24 + cmp r0, 0 + beq _0809D474 + ldr r4, _0809D47C + ldr r0, [r4, 0x14] + ldr r1, [r4, 0x34] + adds r0, r1 + adds r2, r0, 0 + subs r2, 0x80 + ldr r0, [r4, 0x18] + ldr r1, [r4, 0x38] + adds r0, r1 + ldr r1, _0809D480 + adds r3, r0, r1 + ldr r0, [sp, 0x14] + cmp r2, r0 + bge _0809D434 + adds r2, r0, 0 +_0809D434: + ldr r0, [sp, 0x1C] + cmp r2, r0 + blt _0809D43C + subs r2, r0, 0x1 +_0809D43C: + ldr r0, [r5, 0x4] + cmp r3, r0 + bge _0809D444 + adds r3, r0, 0 +_0809D444: + ldr r1, [r6, 0x4] + cmp r3, r1 + blt _0809D44C + subs r3, r1, 0x1 +_0809D44C: + ldr r1, _0809D484 + adds r0, r2, r1 + cmp r0, 0 + bge _0809D458 + adds r1, 0xFF + adds r0, r2, r1 +_0809D458: + asrs r0, 8 + str r0, [r4, 0x3C] + ldr r1, _0809D488 + adds r0, r3, r1 + cmp r0, 0 + bge _0809D468 + adds r1, 0xFF + adds r0, r3, r1 +_0809D468: + asrs r0, 8 + str r0, [r4, 0x40] + adds r1, r4, 0 + adds r1, 0x44 + movs r0, 0x1 + strb r0, [r1] +_0809D474: + add sp, 0x24 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_0809D47C: .4byte gUnknown_20399E8 +_0809D480: .4byte 0xfffff480 +_0809D484: .4byte 0xffff8700 +_0809D488: .4byte 0xffffb000 + thumb_func_end sub_809D25C + + thumb_func_start nullsub_120 +nullsub_120: + bx lr + thumb_func_end nullsub_120 + + thumb_func_start sub_809D490 +sub_809D490: + push {r4,lr} + ldr r4, _0809D4AC + movs r0, 0x80 + lsls r0, 3 + movs r1, 0x6 + bl MemoryAlloc + str r0, [r4] + bl sub_809D4B0 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0809D4AC: .4byte gUnknown_203B4B0 + thumb_func_end sub_809D490 + + thumb_func_start sub_809D4B0 +sub_809D4B0: + push {r4,r5,lr} + ldr r0, _0809D4EC + movs r2, 0x1 + negs r2, r2 + adds r1, r2, 0 + strh r1, [r0] + ldr r0, _0809D4F0 + strh r1, [r0] + ldr r0, _0809D4F4 + strh r1, [r0] + ldr r1, _0809D4F8 + movs r0, 0 + strb r0, [r1] + movs r1, 0 + ldr r5, _0809D4FC + movs r2, 0 + ldr r3, _0809D500 + ldr r4, _0809D504 +_0809D4D4: + adds r0, r1, r5 + strb r2, [r0] + adds r0, r1, r3 + strb r2, [r0] + stm r4!, {r2} + adds r1, 0x1 + cmp r1, 0x80 + ble _0809D4D4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_0809D4EC: .4byte gUnknown_2039A30 +_0809D4F0: .4byte gUnknown_2039A32 +_0809D4F4: .4byte gUnknown_2039A34 +_0809D4F8: .4byte gUnknown_2039A36 +_0809D4FC: .4byte gUnknown_2039A38 +_0809D500: .4byte gUnknown_2039AC0 +_0809D504: .4byte gUnknown_2039B48 + thumb_func_end sub_809D4B0 + + thumb_func_start sub_809D508 +sub_809D508: + push {r4,lr} + ldr r4, _0809D51C + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0809D51C: .4byte gUnknown_203B4B0 + thumb_func_end sub_809D508 + + thumb_func_start sub_809D520 +sub_809D520: + ldr r1, _0809D528 + strh r1, [r0] + bx lr + .align 2, 0 +_0809D528: .4byte 0x0000ffff + thumb_func_end sub_809D520 + + thumb_func_start sub_809D52C +sub_809D52C: + push {lr} + movs r2, 0 + ldrsh r1, [r0, r2] + cmp r1, 0x1 + beq _0809D544 + cmp r1, 0x1 + ble _0809D562 + cmp r1, 0x2 + beq _0809D54E + cmp r1, 0x3 + beq _0809D558 + b _0809D562 +_0809D544: + movs r1, 0x2 + ldrsh r0, [r0, r1] + bl sub_80A882C + b _0809D564 +_0809D54E: + movs r2, 0x2 + ldrsh r0, [r0, r2] + bl sub_80AC240 + b _0809D564 +_0809D558: + movs r1, 0x2 + ldrsh r0, [r0, r1] + bl sub_80AD158 + b _0809D564 +_0809D562: + movs r0, 0 +_0809D564: + pop {r1} + bx r1 + thumb_func_end sub_809D52C + + thumb_func_start sub_809D568 +sub_809D568: + push {lr} + adds r3, r0, 0 + ldr r0, _0809D5B4 + strh r0, [r3] + movs r2, 0 + movs r0, 0 + strh r0, [r3, 0x2] + str r0, [r3, 0x8] + str r0, [r3, 0x4] + str r0, [r3, 0x14] + str r0, [r3, 0x10] + adds r1, r3, 0 + adds r1, 0x20 + strb r2, [r1] + str r0, [r3, 0x1C] + movs r1, 0x1 + negs r1, r1 + strh r1, [r3, 0x22] + strh r0, [r3, 0x24] + adds r2, r3, 0 + adds r2, 0x26 + movs r1, 0xFF + strb r1, [r2] + strh r0, [r3, 0x28] + strh r0, [r3, 0x2A] + strh r0, [r3, 0x2C] + str r0, [r3, 0x30] + movs r2, 0 + movs r1, 0x3 + adds r0, r3, 0 + adds r0, 0x5C +_0809D5A6: + str r2, [r0] + subs r0, 0x4 + subs r1, 0x1 + cmp r1, 0 + bge _0809D5A6 + pop {r0} + bx r0 + .align 2, 0 +_0809D5B4: .4byte 0x0000ffff + thumb_func_end sub_809D568 + + thumb_func_start sub_809D5B8 +sub_809D5B8: + push {r4,lr} + adds r4, r0, 0 + movs r0, 0 + str r0, [r4] + str r0, [r4, 0x4] + ldr r0, _0809D5FC + strh r0, [r4, 0x10] + movs r0, 0xFF + strb r0, [r4, 0x12] + adds r0, r4, 0 + adds r0, 0xC + bl sub_809D520 + movs r2, 0 + movs r1, 0x3 + adds r0, r4, 0 + adds r0, 0x20 +_0809D5DA: + str r2, [r0] + subs r0, 0x4 + subs r1, 0x1 + cmp r1, 0 + bge _0809D5DA + adds r0, r4, 0 + adds r0, 0x24 + bl sub_809D568 + adds r0, r4, 0 + adds r0, 0x84 + bl sub_809D568 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0809D5FC: .4byte 0x0000ffff + thumb_func_end sub_809D5B8 + + thumb_func_start sub_809D600 +sub_809D600: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + adds r6, r1, 0 + mov r8, r2 + adds r4, r3, 0 + ldr r5, [sp, 0x18] + lsls r4, 16 + asrs r4, 16 + lsls r5, 24 + asrs r5, 24 + bl sub_809D5B8 + str r6, [r7] + mov r0, r8 + str r0, [r7, 0x4] + strh r4, [r7, 0x10] + strb r5, [r7, 0x12] + ldrh r0, [r6] + strh r0, [r7, 0x8] + ldr r1, [r6, 0x4] + cmp r1, 0 + beq _0809D63A + mov r0, r8 + bl _call_via_r1 + strh r0, [r7, 0xA] + b _0809D63C +_0809D63A: + strh r1, [r7, 0xA] +_0809D63C: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_809D600 + + thumb_func_start sub_809D648 +sub_809D648: + push {lr} + bl sub_809D5B8 + pop {r0} + bx r0 + thumb_func_end sub_809D648 + + thumb_func_start sub_809D654 +sub_809D654: + movs r1, 0x26 + ldrsh r0, [r0, r1] + bx lr + thumb_func_end sub_809D654 + + thumb_func_start sub_809D65C +sub_809D65C: + push {lr} + adds r1, r0, 0 + movs r2, 0x26 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _0809D66E + movs r0, 0x1 + negs r0, r0 + b _0809D672 +_0809D66E: + movs r2, 0x24 + ldrsh r0, [r1, r2] +_0809D672: + pop {r1} + bx r1 + thumb_func_end sub_809D65C + + thumb_func_start sub_809D678 +sub_809D678: + movs r2, 0x26 + ldrsh r1, [r0, r2] + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + bx lr + thumb_func_end sub_809D678 + + thumb_func_start sub_809D684 +sub_809D684: + push {lr} + adds r2, r0, 0 + adds r3, r1, 0 + movs r1, 0x26 + ldrsh r0, [r2, r1] + cmp r0, 0 + beq _0809D6A4 + ldr r0, [r2, 0x34] + cmp r0, 0 + beq _0809D69C + ldr r1, [r2, 0x38] + b _0809D69E +_0809D69C: + ldr r1, [r2, 0x2C] +_0809D69E: + ldr r0, [r3] + cmp r1, r0 + beq _0809D6CC +_0809D6A4: + adds r0, r2, 0 + adds r0, 0x86 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _0809D6D0 + adds r0, r2, 0 + adds r0, 0x94 + ldr r0, [r0] + cmp r0, 0 + beq _0809D6C0 + adds r0, r2, 0 + adds r0, 0x98 + b _0809D6C4 +_0809D6C0: + adds r0, r2, 0 + adds r0, 0x8C +_0809D6C4: + ldr r1, [r0] + ldr r0, [r3] + cmp r1, r0 + bne _0809D6D0 +_0809D6CC: + movs r0, 0x1 + b _0809D6D2 +_0809D6D0: + movs r0, 0 +_0809D6D2: + pop {r1} + bx r1 + thumb_func_end sub_809D684 + + thumb_func_start sub_809D6D8 +sub_809D6D8: + lsls r1, 16 + asrs r1, 14 + adds r0, 0x14 + adds r0, r1 + str r2, [r0] + bx lr + thumb_func_end sub_809D6D8 + + thumb_func_start sub_809D6E4 +sub_809D6E4: + push {r4,lr} + lsls r2, 16 + asrs r2, 16 + lsls r4, r2, 2 + adds r3, r0, 0 + adds r3, 0x14 + adds r3, r4 + ldr r3, [r3] + str r3, [r1] + strh r2, [r1, 0x4] + ldrh r2, [r0, 0x10] + strh r2, [r1, 0x6] + ldrb r0, [r0, 0x12] + strb r0, [r1, 0x8] + adds r0, r3, 0 + cmp r0, 0 + beq _0809D708 + movs r0, 0x1 +_0809D708: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809D6E4 + + thumb_func_start sub_809D710 +sub_809D710: + push {r4,lr} + adds r4, r0, 0 + adds r3, r1, 0 + lsls r2, 16 + asrs r2, 16 + ldr r1, _0809D73C + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r1, 0x8 + adds r0, r1 + ldr r0, [r0] + str r0, [r3] + movs r0, 0x2 + strh r0, [r3, 0x4] + cmp r4, 0 + beq _0809D740 + ldrh r0, [r4, 0x10] + strh r0, [r3, 0x6] + ldrb r0, [r4, 0x12] + b _0809D746 + .align 2, 0 +_0809D73C: .4byte gUnknown_812F1F8 +_0809D740: + ldr r0, _0809D750 + strh r0, [r3, 0x6] + movs r0, 0xFF +_0809D746: + strb r0, [r3, 0x8] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_0809D750: .4byte 0x0000ffff + thumb_func_end sub_809D710 + + thumb_func_start sub_809D754 +sub_809D754: + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x24 + bl sub_809D568 + adds r4, 0x84 + adds r0, r4, 0 + bl sub_809D568 + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809D754 + + thumb_func_start sub_809D770 +sub_809D770: + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x24 + bl sub_809D568 + adds r0, r4, 0 + adds r0, 0x84 + bl sub_809D568 + movs r0, 0x4 + strh r0, [r4, 0x26] + movs r0, 0x1 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809D770 + + thumb_func_start sub_809D790 +sub_809D790: + push {r4-r7,lr} + adds r5, r0, 0 + adds r7, r1, 0 + adds r6, r2, 0 + cmp r6, 0 + beq _0809D7A2 + ldr r0, [r6] + cmp r0, 0 + bne _0809D7A6 +_0809D7A2: + movs r0, 0 + b _0809D8B8 +_0809D7A6: + movs r1, 0x4 + ldrsh r0, [r6, r1] + cmp r0, 0x5 + bhi _0809D858 + lsls r0, 2 + ldr r1, _0809D7B8 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0809D7B8: .4byte _0809D7BC + .align 2, 0 +_0809D7BC: + .4byte _0809D830 + .4byte _0809D84A + .4byte _0809D7D4 + .4byte _0809D7D4 + .4byte _0809D858 + .4byte _0809D7EE +_0809D7D4: + movs r3, 0x24 + ldrsh r0, [r5, r3] + cmp r0, 0x1 + beq _0809D838 + adds r4, r5, 0 + adds r4, 0x24 + cmp r0, 0x5 + bne _0809D86C + adds r0, r5, 0 + adds r0, 0x84 + bl sub_809D568 + b _0809D86C +_0809D7EE: + movs r1, 0x24 + ldrsh r0, [r5, r1] + cmp r0, 0x2 + beq _0809D808 + ldr r0, _0809D800 + ldr r1, _0809D804 + bl FatalError + .align 2, 0 +_0809D800: .4byte gUnknown_8116538 +_0809D804: .4byte gUnknown_8116544 +_0809D808: + adds r2, r5, 0 + adds r2, 0x84 + movs r3, 0 + ldrsh r1, [r2, r3] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0809D828 + ldr r0, _0809D820 + ldr r1, _0809D824 + bl FatalError + .align 2, 0 +_0809D820: .4byte gUnknown_8116560 +_0809D824: .4byte gUnknown_811656C +_0809D828: + adds r4, r5, 0 + adds r4, 0x24 + adds r0, r2, 0 + b _0809D840 +_0809D830: + movs r1, 0x24 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + bne _0809D84A +_0809D838: + adds r0, r5, 0 + adds r0, 0x84 + adds r4, r5, 0 + adds r4, 0x24 +_0809D840: + adds r1, r4, 0 + movs r2, 0x60 + bl memcpy + b _0809D86C +_0809D84A: + adds r0, r5, 0 + adds r0, 0x84 + bl sub_809D568 + adds r4, r5, 0 + adds r4, 0x24 + b _0809D86C +_0809D858: + ldr r0, _0809D864 + ldr r1, _0809D868 + movs r3, 0x4 + ldrsh r2, [r6, r3] + bl FatalError + .align 2, 0 +_0809D864: .4byte gUnknown_8116588 +_0809D868: .4byte gUnknown_8116594 +_0809D86C: + adds r0, r4, 0 + bl sub_809D568 + cmp r7, 0 + beq _0809D87C + ldr r0, [r7] + str r0, [r5, 0xC] + b _0809D884 +_0809D87C: + adds r0, r5, 0 + adds r0, 0xC + bl sub_809D520 +_0809D884: + ldrh r0, [r6, 0x4] + movs r1, 0 + strh r0, [r5, 0x24] + movs r0, 0x3 + strh r0, [r5, 0x26] + ldrh r0, [r6, 0x6] + strh r0, [r5, 0x30] + ldrb r0, [r6, 0x8] + adds r2, r5, 0 + adds r2, 0x32 + strb r0, [r2] + ldr r0, [r6] + str r0, [r5, 0x28] + str r0, [r5, 0x2C] + str r1, [r5, 0x34] + str r1, [r5, 0x38] + ldr r0, [r5] + ldr r2, [r0, 0x14] + cmp r2, 0 + beq _0809D8B6 + ldr r0, [r5, 0x4] + adds r1, r5, 0 + adds r1, 0x4A + bl _call_via_r2 +_0809D8B6: + movs r0, 0x1 +_0809D8B8: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_809D790 + + thumb_func_start sub_809D8C0 +sub_809D8C0: + push {r4-r6,lr} + sub sp, 0xC + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r3, 0 + lsls r2, 16 + asrs r2, 16 + mov r1, sp + bl sub_809D6E4 + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, sp + adds r3, r6, 0 + bl sub_809D790 + lsls r0, 24 + lsrs r0, 24 + add sp, 0xC + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_809D8C0 + + thumb_func_start sub_809D8EC +sub_809D8EC: + push {r4,r5,lr} + adds r4, r0, 0 + lsls r1, 16 + asrs r5, r1, 16 + cmp r5, 0 + bne _0809D910 + bl sub_809A750 + lsls r0, 24 + cmp r0, 0 + bne _0809D910 + adds r0, r4, 0 + movs r1, 0 + bl sub_80A2460 + str r0, [r4, 0x28] + movs r0, 0 + b _0809D922 +_0809D910: + adds r0, r4, 0 + adds r0, 0x46 + strh r5, [r0] + movs r0, 0x2 + strh r0, [r4, 0x26] + ldr r1, _0809D928 + movs r0, 0x1 + strb r0, [r1] + movs r0, 0x1 +_0809D922: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0809D928: .4byte gUnknown_2039A36 + thumb_func_end sub_809D8EC + + thumb_func_start sub_809D92C +sub_809D92C: + push {lr} + ldr r1, _0809D93C + bl sub_809D770 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_0809D93C: .4byte gUnknown_81165C8 + thumb_func_end sub_809D92C + + thumb_func_start sub_809D940 +sub_809D940: + push {r4,lr} + bl sub_80A8B74 + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl sub_80AC378 + orrs r4, r0 + lsls r4, 24 + lsrs r4, 24 + bl sub_80AD290 + orrs r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r4, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_809D940 + + thumb_func_start sub_809D968 +sub_809D968: + push {r4-r6,lr} + adds r5, r0, 0 + lsls r1, 16 + asrs r6, r1, 16 + movs r4, 0 + adds r2, r5, 0 + adds r2, 0x46 + ldrh r1, [r2] + movs r0, 0 + ldrsh r3, [r2, r0] + movs r0, 0x1 + negs r0, r0 + cmp r3, r0 + beq _0809D98E + cmp r3, r6 + bne _0809D98E + ldr r0, _0809D9B4 + strh r0, [r2] + movs r4, 0x1 +_0809D98E: + adds r2, r5, 0 + adds r2, 0xA6 + ldrh r1, [r2] + movs r0, 0 + ldrsh r3, [r2, r0] + movs r0, 0x1 + negs r0, r0 + cmp r3, r0 + beq _0809D9AA + cmp r3, r6 + bne _0809D9AA + ldr r0, _0809D9B4 + strh r0, [r2] + movs r4, 0x1 +_0809D9AA: + adds r0, r4, 0 + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_0809D9B4: .4byte 0x0000ffff + thumb_func_end sub_809D968 + + thumb_func_start sub_809D9B8 +sub_809D9B8: + lsls r0, 16 + asrs r0, 16 + ldr r1, _0809D9D4 + adds r1, r0, r1 + movs r3, 0 + movs r2, 0x1 + strb r2, [r1] + ldr r1, _0809D9D8 + lsls r0, 2 + adds r0, r1 + str r3, [r0] + ldr r0, _0809D9DC + strb r2, [r0] + bx lr + .align 2, 0 +_0809D9D4: .4byte gUnknown_2039A38 +_0809D9D8: .4byte gUnknown_2039B48 +_0809D9DC: .4byte gUnknown_2039A36 + thumb_func_end sub_809D9B8 + + thumb_func_start sub_809D9E0 +sub_809D9E0: + lsls r0, 16 + asrs r0, 16 + ldr r2, _0809D9FC + adds r2, r0, r2 + movs r3, 0x1 + strb r3, [r2] + ldr r2, _0809DA00 + lsls r0, 2 + adds r0, r2 + str r1, [r0] + ldr r0, _0809DA04 + strb r3, [r0] + bx lr + .align 2, 0 +_0809D9FC: .4byte gUnknown_2039A38 +_0809DA00: .4byte gUnknown_2039B48 +_0809DA04: .4byte gUnknown_2039A36 + thumb_func_end sub_809D9E0 + + thumb_func_start sub_809DA08 +sub_809DA08: + push {r4,r5,lr} + adds r5, r0, 0 + lsls r1, 16 + asrs r4, r1, 16 + ldr r1, _0809DA2C + lsls r0, r4, 2 + adds r0, r1 + str r2, [r0] + cmp r4, 0 + bne _0809DA38 + bl sub_809A750 + lsls r0, 24 + cmp r0, 0 + bne _0809DA30 + movs r0, 0 + b _0809DA5E + .align 2, 0 +_0809DA2C: .4byte gUnknown_2039B48 +_0809DA30: + adds r0, r5, 0 + adds r0, 0x46 + strh r4, [r0] + b _0809DA52 +_0809DA38: + movs r1, 0x80 + adds r2, r5, 0 + adds r2, 0x46 + adds r0, r4, 0 + orrs r0, r1 + strh r0, [r2] + ldr r0, _0809DA64 + adds r0, r4, r0 + movs r1, 0x1 + strb r1, [r0] + ldr r0, _0809DA68 + adds r0, r4, r0 + strb r1, [r0] +_0809DA52: + movs r0, 0x2 + strh r0, [r5, 0x26] + ldr r1, _0809DA6C + movs r0, 0x1 + strb r0, [r1] + movs r0, 0x1 +_0809DA5E: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_0809DA64: .4byte gUnknown_2039A38 +_0809DA68: .4byte gUnknown_2039AC0 +_0809DA6C: .4byte gUnknown_2039A36 + thumb_func_end sub_809DA08 + + thumb_func_start sub_809DA70 +sub_809DA70: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x148 + adds r7, r0, 0 + movs r1, 0x26 + ldrsh r0, [r7, r1] + cmp r0, 0 + bne _0809DA8A + bl _0809EAB8 +_0809DA8A: + movs r2, 0x26 + ldrsh r0, [r7, r2] + cmp r0, 0x4 + bls _0809DA96 + bl _0809E9CC +_0809DA96: + lsls r0, 2 + ldr r1, _0809DAA0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0809DAA0: .4byte _0809DAA4 + .align 2, 0 +_0809DAA4: + .4byte _0809E9C6 + .4byte _0809E9C6 + .4byte _0809DAB8 + .4byte _0809E900 + .4byte _0809E9C6 +_0809DAB8: + adds r1, r7, 0 + adds r1, 0x44 + ldrb r0, [r1] + subs r0, 0x3 + adds r6, r1, 0 + cmp r0, 0xED + bls _0809DACA + bl _0809E9D6 +_0809DACA: + lsls r0, 2 + ldr r1, _0809DAD4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0809DAD4: .4byte _0809DAD8 + .align 2, 0 +_0809DAD8: + .4byte _0809E382 + .4byte _0809E3C4 + .4byte _0809E524 + .4byte _0809E464 + .4byte _0809E4B4 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809DED6 + .4byte _0809DED6 + .4byte _0809DED6 + .4byte _0809DED6 + .4byte _0809DED6 + .4byte _0809DED6 + .4byte _0809DED6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E308 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E308 + .4byte _0809E308 + .4byte _0809E308 + .4byte _0809E308 + .4byte _0809E308 + .4byte _0809E308 + .4byte _0809E308 + .4byte _0809E308 + .4byte _0809E308 + .4byte _0809E31C + .4byte _0809E75C + .4byte _0809E33C + .4byte _0809E368 + .4byte _0809E658 + .4byte _0809E6B4 + .4byte _0809E6E8 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809DE90 + .4byte _0809DE90 + .4byte _0809DE90 + .4byte _0809DE90 + .4byte _0809E9D6 + .4byte _0809DE90 + .4byte _0809DE90 + .4byte _0809E9D6 + .4byte _0809DE90 + .4byte _0809DF60 + .4byte _0809DF60 + .4byte _0809DF60 + .4byte _0809DF60 + .4byte _0809DF60 + .4byte _0809DF60 + .4byte _0809DF60 + .4byte _0809E0A2 + .4byte _0809DFDC + .4byte _0809DFDC + .4byte _0809DFDC + .4byte _0809DFDC + .4byte _0809DFDC + .4byte _0809DFDC + .4byte _0809DFDC + .4byte _0809E0A2 + .4byte _0809E078 + .4byte _0809E078 + .4byte _0809E078 + .4byte _0809E078 + .4byte _0809E078 + .4byte _0809E078 + .4byte _0809E08C + .4byte _0809E08C + .4byte _0809E08C + .4byte _0809E08C + .4byte _0809E08C + .4byte _0809E08C + .4byte _0809E078 + .4byte _0809E078 + .4byte _0809E078 + .4byte _0809E078 + .4byte _0809E078 + .4byte _0809E078 + .4byte _0809E08C + .4byte _0809E08C + .4byte _0809E08C + .4byte _0809E08C + .4byte _0809E08C + .4byte _0809E08C + .4byte _0809E0E8 + .4byte _0809E0E8 + .4byte _0809DE90 + .4byte _0809DE90 + .4byte _0809DE90 + .4byte _0809DE90 + .4byte _0809DE90 + .4byte _0809DE90 + .4byte _0809E146 + .4byte _0809E146 + .4byte _0809E146 + .4byte _0809E146 + .4byte _0809E146 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809DE90 + .4byte _0809DE90 + .4byte _0809E9D6 + .4byte _0809E2D0 + .4byte _0809E2D0 + .4byte _0809E2D0 + .4byte _0809E2D0 + .4byte _0809E2D0 + .4byte _0809E2D0 + .4byte _0809E2D0 + .4byte _0809E2D0 + .4byte _0809E2D0 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E798 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E864 + .4byte _0809E864 + .4byte _0809E864 + .4byte _0809E864 + .4byte _0809E864 + .4byte _0809E864 + .4byte _0809E864 + .4byte _0809E9D6 + .4byte _0809E8D8 + .4byte _0809DE90 + .4byte _0809DE90 + .4byte _0809DEA6 + .4byte _0809DEBE + .4byte _0809DED6 + .4byte _0809DEE8 + .4byte _0809DF24 + .4byte _0809DF24 + .4byte _0809E2DE + .4byte _0809E9D6 + .4byte _0809E2DE + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 + .4byte _0809E9D6 +_0809DE90: + adds r1, r7, 0 + adds r1, 0x4E + ldrh r2, [r1] + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0 + ble _0809DEA2 + bl _0809EAB2 +_0809DEA2: + bl _0809E8F4 +_0809DEA6: + ldr r1, [r7] + ldr r0, [r7, 0x4] + ldr r1, [r1, 0x4C] + bl _call_via_r1 + lsls r0, 24 + cmp r0, 0 + beq _0809DEBA + bl _0809E9D6 +_0809DEBA: + bl _0809E8F4 +_0809DEBE: + ldr r1, [r7] + ldr r0, [r7, 0x4] + ldr r1, [r1, 0x50] + bl _call_via_r1 + lsls r0, 24 + cmp r0, 0 + beq _0809DED2 + bl _0809E9D6 +_0809DED2: + bl _0809E8F4 +_0809DED6: + bl sub_8099B94 + lsls r0, 24 + cmp r0, 0 + beq _0809DEE4 + bl _0809E9D6 +_0809DEE4: + bl _0809E8F4 +_0809DEE8: + add r1, sp, 0x4 + ldr r0, [r7, 0x40] + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldr r0, [r0] + str r0, [r1] + add r0, sp, 0x4 + ldrh r0, [r0, 0x2] + bl sub_8011940 + lsls r0, 24 + cmp r0, 0 + bne _0809DF06 + bl _0809E8F4 +_0809DF06: + adds r2, r7, 0 + adds r2, 0x50 + ldrh r1, [r2] + adds r0, r1, 0x1 + strh r0, [r2] + lsls r1, 16 + ldr r0, _0809DF20 + cmp r1, r0 + bgt _0809DF1C + bl _0809E9D6 +_0809DF1C: + bl _0809E8F4 + .align 2, 0 +_0809DF20: .4byte 0x2a2f0000 +_0809DF24: + add r1, sp, 0x4 + ldr r0, [r7, 0x40] + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r0, [r0] + str r0, [r1] + add r0, sp, 0x4 + ldrh r0, [r0, 0x2] + bl sub_80119C0 + lsls r0, 24 + cmp r0, 0 + bne _0809DF42 + bl _0809E8F4 +_0809DF42: + adds r2, r7, 0 + adds r2, 0x50 + ldrh r1, [r2] + adds r0, r1, 0x1 + strh r0, [r2] + lsls r1, 16 + ldr r0, _0809DF5C + cmp r1, r0 + bgt _0809DF58 + bl _0809E9D6 +_0809DF58: + bl _0809E8F4 + .align 2, 0 +_0809DF5C: .4byte 0x0e0f0000 +_0809DF60: + ldr r1, [r7] + ldr r0, [r7, 0x4] + add r5, sp, 0xA4 + ldr r2, [r1, 0xC] + adds r1, r5, 0 + bl _call_via_r2 + ldr r1, [r7, 0x60] + ldr r0, [r5] + subs r1, r0 + add r4, sp, 0xAC + str r1, [r4] + ldr r0, [r7, 0x64] + ldr r1, [r5, 0x4] + subs r0, r1 + str r0, [r4, 0x4] + ldr r1, [r7, 0x54] + adds r0, r4, 0 + bl sub_800290C + ldr r0, [r4] + cmp r0, 0 + bne _0809DF98 + ldr r0, [r4, 0x4] + cmp r0, 0 + bne _0809DF98 + bl _0809E8F4 +_0809DF98: + ldr r1, [r7] + ldr r0, [r7, 0x4] + ldr r2, [r1, 0x48] + adds r1, r4, 0 + bl _call_via_r2 + movs r1, 0x9 + ands r1, r0 + cmp r1, 0 + beq _0809DFB0 + bl _0809E8F4 +_0809DFB0: + ldr r2, [r7] + ldr r0, [r7, 0x4] + movs r1, 0x80 + lsls r1, 5 + ldr r2, [r2, 0x30] + bl _call_via_r2 + adds r2, r7, 0 + adds r2, 0x4E + ldrh r0, [r2] + movs r5, 0 + ldrsh r1, [r2, r5] + cmp r1, 0 + bge _0809DFD0 + bl _0809E9D6 +_0809DFD0: + cmp r1, 0 + ble _0809DFD8 + bl _0809EAAC +_0809DFD8: + bl _0809E8F4 +_0809DFDC: + ldr r1, [r7] + ldr r0, [r7, 0x4] + add r5, sp, 0xB4 + ldr r2, [r1, 0xC] + adds r1, r5, 0 + bl _call_via_r2 + ldr r1, [r7, 0x60] + ldr r0, [r5] + subs r1, r0 + add r4, sp, 0xBC + str r1, [r4] + ldr r0, [r7, 0x64] + ldr r1, [r5, 0x4] + subs r0, r1 + str r0, [r4, 0x4] + ldr r1, [r7, 0x54] + adds r0, r4, 0 + bl sub_800290C + ldr r0, [r4] + adds r5, r4, 0 + cmp r0, 0 + bne _0809E016 + ldr r0, [r5, 0x4] + cmp r0, 0 + bne _0809E016 + bl _0809E8F4 +_0809E016: + ldr r1, [r7] + ldr r0, [r7, 0x4] + ldr r2, [r1, 0x48] + adds r1, r5, 0 + bl _call_via_r2 + adds r4, r0, 0 + adds r0, r5, 0 + bl sub_8002C60 + lsls r0, 24 + adds r2, r7, 0 + adds r2, 0x4A + asrs r1, r0, 24 + lsrs r0, 24 + strb r0, [r2] + ldr r2, [r7] + ldr r0, [r7, 0x4] + ldr r2, [r2, 0x2C] + bl _call_via_r2 + movs r0, 0x9 + ands r0, r4 + cmp r0, 0 + beq _0809E04C + bl _0809E8F4 +_0809E04C: + ldr r2, [r7] + ldr r0, [r7, 0x4] + movs r1, 0x80 + lsls r1, 5 + ldr r2, [r2, 0x30] + bl _call_via_r2 + adds r2, r7, 0 + adds r2, 0x4E + ldrh r0, [r2] + movs r6, 0 + ldrsh r1, [r2, r6] + cmp r1, 0 + bge _0809E06C + bl _0809E9D6 +_0809E06C: + cmp r1, 0 + ble _0809E074 + bl _0809EAAC +_0809E074: + bl _0809E8F4 +_0809E078: + adds r6, r7, 0 + adds r6, 0x4E + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r0, 0 + ble _0809E088 + bl _0809EA62 +_0809E088: + bl _0809E8F4 +_0809E08C: + movs r2, 0x4E + adds r2, r7 + mov r8, r2 + movs r3, 0 + ldrsh r0, [r2, r3] + cmp r0, 0 + ble _0809E09E + bl _0809E9DA +_0809E09E: + bl _0809E8F4 +_0809E0A2: + ldr r1, [r7] + ldr r0, [r7, 0x4] + add r4, sp, 0xE4 + add r2, sp, 0xE8 + ldr r3, [r1, 0x10] + adds r1, r4, 0 + bl _call_via_r3 + ldr r0, [r7, 0x6C] + ldr r1, [r4] + subs r0, r1 + adds r2, r4, 0 + cmp r0, 0 + bne _0809E0C2 + bl _0809E8F4 +_0809E0C2: + ldr r4, [r7, 0x54] + cmn r0, r4 + bge _0809E0CC + subs r0, r1, r4 + b _0809E0D4 +_0809E0CC: + cmp r0, r4 + ble _0809E0D2 + adds r0, r4, 0 +_0809E0D2: + adds r0, r1, r0 +_0809E0D4: + str r0, [r2] + ldr r2, [r7] + ldr r0, [r7, 0x4] + add r1, sp, 0xE4 + ldr r1, [r1] + ldr r2, [r2, 0x28] + bl _call_via_r2 + bl _0809E9D6 +_0809E0E8: + ldr r1, [r7] + ldr r0, [r7, 0x4] + add r4, sp, 0x14 + ldr r2, [r1, 0x14] + adds r1, r4, 0 + bl _call_via_r2 + movs r1, 0 + ldrsb r1, [r4, r1] + ldr r2, [r7, 0x54] + add r4, sp, 0xEC + adds r0, r4, 0 + bl sub_8002BB8 + ldr r2, [r4] + ldr r3, [r4, 0x4] + add r1, sp, 0xF4 + str r2, [r1] + str r3, [r1, 0x4] + ldr r2, [r7] + ldr r0, [r7, 0x4] + ldr r2, [r2, 0x48] + bl _call_via_r2 + movs r1, 0x9 + ands r1, r0 + cmp r1, 0 + beq _0809E124 + bl _0809E8F4 +_0809E124: + ldr r2, [r7] + ldr r0, [r7, 0x4] + movs r1, 0x80 + lsls r1, 5 + ldr r2, [r2, 0x30] + bl _call_via_r2 + adds r1, r7, 0 + adds r1, 0x4E + ldrh r2, [r1] + movs r4, 0 + ldrsh r0, [r1, r4] + cmp r0, 0 + ble _0809E144 + bl _0809EAB2 +_0809E144: + b _0809E8F4 +_0809E146: + adds r1, r7, 0 + adds r1, 0x4E + ldrh r2, [r1] + movs r5, 0 + ldrsh r0, [r1, r5] + mov r10, r1 + cmp r0, 0 + ble _0809E15A + bl _0809EAB2 +_0809E15A: + add r1, sp, 0x4 + ldr r0, [r7, 0x40] + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldr r0, [r0] + str r0, [r1] + movs r4, 0x1 + negs r4, r4 + mov r8, r4 + movs r5, 0 + ldr r1, [r7] + ldr r0, [r7, 0x4] + mov r4, sp + adds r4, 0x15 + ldr r2, [r1, 0x14] + adds r1, r4, 0 + bl _call_via_r2 + add r0, sp, 0x4 + ldrb r0, [r0] + subs r0, 0x91 + mov r9, r4 + cmp r0, 0x4 + bhi _0809E234 + lsls r0, 2 + ldr r1, _0809E194 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0809E194: .4byte _0809E198 + .align 2, 0 +_0809E198: + .4byte _0809E1AC + .4byte _0809E1AC + .4byte _0809E1BA + .4byte _0809E1E0 + .4byte _0809E20C +_0809E1AC: + adds r0, r7, 0 + adds r0, 0x71 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + mov r8, r0 + b _0809E234 +_0809E1BA: + ldr r0, [sp, 0x8] + lsls r0, 16 + asrs r0, 16 + bl sub_80A7AE8 + lsls r0, 16 + asrs r4, r0, 16 + cmp r4, 0 + blt _0809E234 + movs r5, 0x1 + add r1, sp, 0xFC + adds r0, r4, 0 + bl sub_80A8FD8 + add r1, sp, 0x104 + adds r0, r4, 0 + bl sub_80A8F9C + b _0809E234 +_0809E1E0: + ldr r0, [sp, 0x8] + lsls r0, 16 + asrs r0, 16 + bl sub_80A7AE8 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + blt _0809E234 + movs r5, 0x1 + add r1, sp, 0xFC + bl sub_80A8FD8 + ldr r0, _0809E208 + ldr r1, [r0, 0x4] + ldr r0, [r0] + add r2, sp, 0x104 + str r0, [r2] + str r1, [r2, 0x4] + b _0809E234 + .align 2, 0 +_0809E208: .4byte gUnknown_81164DC +_0809E20C: + movs r5, 0x1 + ldr r1, [r7] + ldr r0, [r7, 0x4] + add r4, sp, 0xFC + ldr r2, [r1, 0xC] + adds r1, r4, 0 + bl _call_via_r2 + ldr r2, [r7] + ldr r0, [r7, 0x4] + add r1, sp, 0x104 + ldr r2, [r2, 0x8] + bl _call_via_r2 + ldr r0, [sp, 0x8] + lsls r0, 16 + asrs r0, 16 + adds r1, r4, 0 + bl sub_80AD8B4 +_0809E234: + cmp r5, 0 + beq _0809E282 + ldr r1, [r7] + ldr r0, [r7, 0x4] + add r5, sp, 0x10C + ldr r2, [r1, 0xC] + adds r1, r5, 0 + bl _call_via_r2 + ldr r1, [r7] + ldr r0, [r7, 0x4] + add r4, sp, 0x114 + ldr r2, [r1, 0x8] + adds r1, r4, 0 + bl _call_via_r2 + add r6, sp, 0xFC + add r3, sp, 0x104 + adds r0, r5, 0 + adds r1, r4, 0 + adds r2, r6, 0 + bl sub_8002DF0 + lsls r0, 24 + asrs r0, 24 + mov r8, r0 + movs r0, 0x1 + negs r0, r0 + cmp r8, r0 + bne _0809E28C + ldr r3, _0809E2CC + adds r0, r5, 0 + adds r1, r3, 0 + adds r2, r6, 0 + bl sub_8002D54 + lsls r0, 24 + asrs r0, 24 + mov r8, r0 +_0809E282: + movs r0, 0x1 + negs r0, r0 + cmp r8, r0 + bne _0809E28C + b _0809E8F4 +_0809E28C: + mov r5, r9 + movs r0, 0 + ldrsb r0, [r5, r0] + cmp r8, r0 + bne _0809E298 + b _0809E8F4 +_0809E298: + mov r6, r9 + movs r0, 0 + ldrsb r0, [r6, r0] + add r1, sp, 0x4 + ldrh r2, [r1, 0x2] + lsls r2, 24 + lsrs r2, 24 + mov r1, r8 + bl sub_8002A70 + adds r1, r7, 0 + adds r1, 0x4A + strb r0, [r1] + ldr r2, [r7] + ldr r0, [r7, 0x4] + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + ldr r2, [r2, 0x2C] + bl _call_via_r2 + add r0, sp, 0x4 + ldrb r0, [r0, 0x1] + mov r1, r10 + strh r0, [r1] + b _0809E9CC + .align 2, 0 +_0809E2CC: .4byte gUnknown_81164DC +_0809E2D0: + bl sub_809D234 + lsls r0, 24 + cmp r0, 0 + beq _0809E2DC + b _0809E9D6 +_0809E2DC: + b _0809E8F4 +_0809E2DE: + adds r0, r7, 0 + adds r0, 0x46 + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0809E2F0 + b _0809E9D6 +_0809E2F0: + ldr r1, _0809E304 + adds r0, r7, 0 + adds r0, 0x4C + movs r3, 0 + ldrsh r0, [r0, r3] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + b _0809E8EC + .align 2, 0 +_0809E304: .4byte gUnknown_2039B48 +_0809E308: + adds r0, r7, 0 + adds r0, 0x46 + movs r4, 0 + ldrsh r1, [r0, r4] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0809E31A + b _0809E9D6 +_0809E31A: + b _0809E8CA +_0809E31C: + adds r0, r7, 0 + adds r0, 0x46 + movs r5, 0 + ldrsh r1, [r0, r5] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0809E32E + b _0809E9D6 +_0809E32E: + bl sub_8099B94 + lsls r0, 24 + cmp r0, 0 + beq _0809E33A + b _0809E9D6 +_0809E33A: + b _0809E8CA +_0809E33C: + add r1, sp, 0x4 + ldr r0, [r7, 0x40] + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldr r0, [r0] + str r0, [r1] + add r0, sp, 0x4 + ldrb r1, [r0, 0x1] + movs r4, 0x2 + ldrsh r2, [r0, r4] + ldr r3, [sp, 0x8] + adds r0, r7, 0 + bl sub_80A14E8 + adds r1, r0, 0 + cmp r1, 0 + bge _0809E360 + b _0809E9D6 +_0809E360: + movs r0, 0x3 + strh r0, [r7, 0x26] + adds r0, r7, 0 + b _0809E60C +_0809E368: + add r0, sp, 0x11C + bl sub_809B260 + lsls r0, 24 + cmp r0, 0 + bne _0809E376 + b _0809E9D6 +_0809E376: + add r0, sp, 0x11C + ldr r1, [r0] + adds r0, r7, 0 + bl sub_80A2460 + b _0809E8C8 +_0809E382: + add r0, sp, 0x120 + bl sub_809B260 + lsls r0, 24 + cmp r0, 0 + bne _0809E390 + b _0809E9D6 +_0809E390: + add r4, sp, 0x120 + ldr r0, [r4] + cmp r0, 0 + blt _0809E3BA + add r1, sp, 0x4 + ldr r0, [r7, 0x40] + ldm r0!, {r2,r5,r6} + stm r1!, {r2,r5,r6} + ldr r0, [r0] + str r0, [r1] + ldrb r0, [r4] + bl sub_8002694 + lsls r0, 16 + asrs r0, 16 + add r1, sp, 0x4 + movs r3, 0x2 + ldrsh r2, [r1, r3] + movs r1, 0 + bl sub_8098D1C +_0809E3BA: + ldr r1, [r4] + adds r0, r7, 0 + bl sub_80A2460 + b _0809E8C8 +_0809E3C4: + adds r4, r7, 0 + adds r4, 0x4C + movs r5, 0 + ldrsh r0, [r4, r5] + cmp r0, 0 + bne _0809E40C + add r0, sp, 0x124 + bl sub_809B260 + lsls r0, 24 + cmp r0, 0 + bne _0809E3DE + b _0809E9D6 +_0809E3DE: + add r0, sp, 0x124 + ldr r0, [r0] + cmp r0, 0 + blt _0809E400 + lsls r0, 16 + asrs r0, 16 + bl sub_80A26B8 + adds r2, r0, 0 + lsls r2, 16 + asrs r2, 16 + movs r0, 0 + movs r1, 0x12 + bl sub_80018D8 + movs r0, 0x1 + b _0809E402 +_0809E400: + ldr r0, _0809E408 +_0809E402: + strh r0, [r4] + b _0809E8CE + .align 2, 0 +_0809E408: .4byte 0x0000ffff +_0809E40C: + cmp r0, 0x1 + bne _0809E464 + add r1, sp, 0x4 + ldr r0, [r7, 0x40] + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r0, [r0] + str r0, [r1] + movs r0, 0 + movs r1, 0x12 + bl sub_8001658 + adds r2, r0, 0 + lsls r2, 16 + asrs r4, r2, 16 + lsrs r2, 16 + movs r0, 0 + movs r1, 0x30 + bl sub_8001784 + cmp r4, 0x13 + bne _0809E43C + cmp r0, 0 + beq _0809E45A +_0809E43C: + add r0, sp, 0x4 + movs r5, 0x2 + ldrsh r0, [r0, r5] + bl sub_8098DCC + adds r0, r7, 0 + movs r1, 0 + bl sub_80A2460 + str r0, [r7, 0x28] + movs r0, 0 + movs r1, 0 + bl sub_80A87AC + b _0809E8F4 +_0809E45A: + movs r0, 0 + movs r1, 0x13 + movs r2, 0x13 + bl sub_80018D8 +_0809E464: + adds r0, r7, 0 + adds r0, 0x4C + movs r2, 0 + ldrsh r1, [r0, r2] + adds r5, r0, 0 + cmp r1, 0 + bne _0809E4B4 + add r0, sp, 0x128 + bl sub_809B260 + lsls r0, 24 + cmp r0, 0 + bne _0809E480 + b _0809E9D6 +_0809E480: + add r0, sp, 0x128 + ldr r1, [r0] + cmp r1, 0 + blt _0809E4AA + ldrb r0, [r6] + cmp r0, 0x4 + bne _0809E49A + lsls r0, r1, 16 + asrs r0, 16 + bl sub_80A26B8 + lsls r0, 16 + b _0809E49C +_0809E49A: + lsls r0, r1, 16 +_0809E49C: + asrs r2, r0, 16 + movs r0, 0 + movs r1, 0x13 + bl sub_80018D8 + movs r0, 0x1 + b _0809E4AC +_0809E4AA: + ldr r0, _0809E4B0 +_0809E4AC: + strh r0, [r5] + b _0809E8CE + .align 2, 0 +_0809E4B0: .4byte 0x0000ffff +_0809E4B4: + adds r0, r7, 0 + adds r0, 0x4C + movs r3, 0 + ldrsh r1, [r0, r3] + adds r5, r0, 0 + cmp r1, 0x1 + beq _0809E4C4 + b _0809E5B8 +_0809E4C4: + movs r0, 0 + movs r1, 0x13 + bl sub_8001658 + lsls r0, 16 + asrs r6, r0, 16 + add r4, sp, 0x18 + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_80990EC + lsls r0, 24 + cmp r0, 0 + beq _0809E580 + adds r0, r4, 0 + adds r1, r6, 0 + bl sub_8099220 + movs r0, 0x6 + bl sub_80023E4 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + ldrb r0, [r4] + ldr r4, _0809E51C + ldr r2, [r4] + movs r1, 0 + str r1, [sp] + bl sub_809034C + adds r1, r0, 0 + ldr r0, _0809E520 + str r1, [r0] + cmp r1, 0x1 + beq _0809E586 + cmp r1, 0x1 + bcc _0809E580 + cmp r1, 0x2 + bne _0809E5AE + strh r1, [r5] + ldr r2, [r4] + movs r0, 0x9 + b _0809E58E + .align 2, 0 +_0809E51C: .4byte gUnknown_203B4B0 +_0809E520: .4byte gUnknown_2039DA4 +_0809E524: + adds r0, r7, 0 + adds r0, 0x4C + movs r4, 0 + ldrsh r6, [r0, r4] + adds r5, r0, 0 + cmp r6, 0x1 + bne _0809E5B8 + movs r0, 0 + movs r1, 0x14 + bl sub_8001658 + lsls r0, 24 + lsrs r0, 24 + bl sub_8095228 + adds r4, r0, 0 + movs r0, 0x6 + bl sub_80023E4 + adds r3, r0, 0 + lsls r3, 24 + lsrs r3, 24 + ldrb r0, [r4, 0x4] + ldr r4, _0809E578 + ldr r2, [r4] + str r6, [sp] + movs r1, 0 + bl sub_809034C + adds r1, r0, 0 + ldr r0, _0809E57C + str r1, [r0] + cmp r1, 0x1 + beq _0809E586 + cmp r1, 0x1 + bcc _0809E580 + cmp r1, 0x2 + bne _0809E5AE + strh r1, [r5] + ldr r2, [r4] + movs r0, 0x9 + b _0809E58E + .align 2, 0 +_0809E578: .4byte gUnknown_203B4B0 +_0809E57C: .4byte gUnknown_2039DA4 +_0809E580: + movs r0, 0x3 + strh r0, [r5] + b _0809E9CC +_0809E586: + movs r0, 0x4 + strh r0, [r5] + ldr r2, [r4] + movs r0, 0xA +_0809E58E: + movs r1, 0x1 + bl sub_809B1C0 + adds r0, r7, 0 + movs r1, 0x1 + bl sub_809D8EC + lsls r0, 24 + cmp r0, 0 + bne _0809E5A4 + b _0809E9CC +_0809E5A4: + movs r0, 0 + movs r1, 0xB + bl sub_80A87AC + b _0809E9CC +_0809E5AE: + ldr r0, _0809E5B4 + strh r0, [r5] + b _0809E9CC + .align 2, 0 +_0809E5B4: .4byte 0x0000ffff +_0809E5B8: + movs r6, 0 + ldrsh r2, [r5, r6] + cmp r2, 0x2 + bne _0809E5DA + add r0, sp, 0x12C + bl sub_809B260 + lsls r0, 24 + cmp r0, 0 + bne _0809E5CE + b _0809E9D6 +_0809E5CE: + add r0, sp, 0x12C + ldr r0, [r0] + cmp r0, 0 + beq _0809E626 + movs r0, 0x3 + b _0809E628 +_0809E5DA: + cmp r2, 0x3 + bne _0809E614 + add r1, sp, 0x4 + ldr r0, [r7, 0x40] + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldr r0, [r0] + str r0, [r1] + strh r2, [r7, 0x26] + add r0, sp, 0x4 + movs r6, 0x2 + ldrsh r0, [r0, r6] + bl sub_80999FC + movs r0, 0x70 + movs r1, 0 + bl sub_80A4BFC + movs r1, 0x8 + ldrsh r0, [r7, r1] + cmp r0, 0 + bne _0809E608 + b _0809E9CC +_0809E608: + adds r0, r7, 0 + movs r1, 0x1 +_0809E60C: + bl sub_80A2460 + str r0, [r7, 0x28] + b _0809E9CC +_0809E614: + cmp r2, 0x4 + bne _0809E63C + add r0, sp, 0x130 + bl sub_809B260 + lsls r0, 24 + cmp r0, 0 + bne _0809E626 + b _0809E9D6 +_0809E626: + ldr r0, _0809E638 +_0809E628: + strh r0, [r5] + movs r0, 0 + movs r1, 0 + bl sub_80A87AC + bl sub_809A76C + b _0809E9CC + .align 2, 0 +_0809E638: .4byte 0x0000ffff +_0809E63C: + movs r0, 0 + movs r1, 0 + bl sub_8099220 + movs r4, 0x1 + negs r4, r4 + movs r0, 0 + movs r1, 0x13 + adds r2, r4, 0 + bl sub_80018D8 + adds r0, r7, 0 + adds r1, r4, 0 + b _0809E8EE +_0809E658: + add r1, sp, 0x4 + ldr r0, [r7, 0x40] + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r0, [r0] + str r0, [r1] + add r0, sp, 0x134 + bl sub_809B260 + lsls r0, 24 + cmp r0, 0 + bne _0809E672 + b _0809E9D6 +_0809E672: + add r0, sp, 0x134 + ldr r0, [r0] + cmp r0, 0x1 + bne _0809E6A4 + ldr r0, [sp, 0x8] + lsls r0, 16 + asrs r1, r0, 16 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0809E6A4 + adds r0, r1, 0 + bl sub_80A8D54 + movs r2, 0 + adds r3, r0, 0 + adds r3, 0x4C + ldr r4, _0809E6B0 +_0809E696: + adds r0, r3, r2 + adds r1, r2, r4 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x9 + ble _0809E696 +_0809E6A4: + add r0, sp, 0x134 + ldr r1, [r0] + adds r0, r7, 0 + bl sub_80A2460 + b _0809E8C8 + .align 2, 0 +_0809E6B0: .4byte gUnknown_2039D98 +_0809E6B4: + add r0, sp, 0x138 + bl sub_809B260 + lsls r0, 24 + cmp r0, 0 + bne _0809E6C2 + b _0809E9D6 +_0809E6C2: + add r4, sp, 0x138 + ldr r0, [r4] + cmp r0, 0x1 + bne _0809E6D0 + ldr r0, _0809E6DC + bl sub_80920EC +_0809E6D0: + ldr r1, [r4] + adds r0, r7, 0 + bl sub_80A2460 + b _0809E8C8 + .align 2, 0 +_0809E6DC: .4byte gUnknown_2039D98 +_0809E6E0: + movs r1, 0x2 + add r0, sp, 0x13C + str r1, [r0] + b _0809E74A +_0809E6E8: + add r1, sp, 0x4 + ldr r0, [r7, 0x40] + ldm r0!, {r2,r5,r6} + stm r1!, {r2,r5,r6} + ldr r0, [r0] + str r0, [r1] + ldr r5, [sp, 0x10] + add r0, sp, 0x13C + bl sub_809B260 + lsls r0, 24 + cmp r0, 0 + bne _0809E704 + b _0809E9D6 +_0809E704: + add r0, sp, 0x13C + ldr r0, [r0] + cmp r0, 0x1 + bne _0809E74A + add r4, sp, 0x18 + ldr r0, _0809E758 + adds r3, r4, 0 + movs r2, 0 + mov r1, sp + adds r1, 0x27 +_0809E718: + strb r2, [r1] + subs r1, 0x1 + cmp r1, r3 + bge _0809E718 + adds r1, r4, 0 + bl sub_80922F4 + movs r2, 0 + ldrb r0, [r4] + ldrb r3, [r5] + cmp r0, r3 + bne _0809E6E0 + cmp r0, 0 + beq _0809E74A +_0809E734: + adds r2, 0x1 + cmp r2, 0xF + bgt _0809E74A + adds r0, r4, r2 + adds r1, r5, r2 + ldrb r0, [r0] + ldrb r1, [r1] + cmp r0, r1 + bne _0809E6E0 + cmp r0, 0 + bne _0809E734 +_0809E74A: + add r0, sp, 0x13C + ldr r1, [r0] + adds r0, r7, 0 + bl sub_80A2460 + b _0809E8C8 + .align 2, 0 +_0809E758: .4byte gUnknown_2039D98 +_0809E75C: + adds r2, r7, 0 + adds r2, 0x50 + ldrh r3, [r2] + movs r4, 0 + ldrsh r0, [r2, r4] + cmp r0, 0 + bne _0809E76C + b _0809E872 +_0809E76C: + add r4, sp, 0xA0 + adds r0, r4, 0 + bl sub_809AFFC + lsls r0, 24 + cmp r0, 0 + bne _0809E77C + b _0809E9D6 +_0809E77C: + ldrb r0, [r4] + cmp r0, 0 + bne _0809E784 + b _0809E8CA +_0809E784: + add r1, sp, 0x4 + ldr r0, [r7, 0x40] + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldr r0, [r0] + str r0, [r1] + add r0, sp, 0x4 + movs r4, 0x2 + ldrsh r1, [r0, r4] + b _0809E8C2 +_0809E798: + add r1, sp, 0x4 + ldr r0, [r7, 0x40] + ldm r0!, {r2,r5,r6} + stm r1!, {r2,r5,r6} + ldr r0, [r0] + str r0, [r1] + adds r2, r7, 0 + adds r2, 0x50 + movs r3, 0 + ldrsh r0, [r2, r3] + adds r4, r2, 0 + cmp r0, 0 + bne _0809E84C + movs r3, 0 + adds r0, r7, 0 + adds r0, 0x4C + movs r5, 0 + ldrsh r2, [r0, r5] + adds r5, r0, 0 + cmp r2, 0 + bge _0809E7CC + ldr r0, [r7, 0x28] + ldrb r0, [r0] + cmp r0, 0xD1 + beq _0809E812 + b _0809E8F4 +_0809E7CC: + ldr r1, [r7, 0x28] + ldrb r0, [r1] + cmp r0, 0xD0 + bne _0809E7F8 + movs r6, 0x2 + ldrsh r0, [r1, r6] + cmp r0, r2 + beq _0809E812 +_0809E7DC: + ldr r0, [r7, 0x28] + adds r1, r0, 0 + adds r1, 0x10 + str r1, [r7, 0x28] + ldrb r0, [r0, 0x10] + cmp r0, 0xD0 + bne _0809E7F8 + movs r0, 0x2 + ldrsh r1, [r1, r0] + movs r2, 0 + ldrsh r0, [r5, r2] + cmp r1, r0 + bne _0809E7DC + movs r3, 0x1 +_0809E7F8: + cmp r3, 0 + bne _0809E812 + ldr r1, [r7, 0x28] + ldrb r0, [r1] + cmp r0, 0xD1 + bne _0809E8F4 +_0809E804: + adds r0, r1, 0 + adds r1, 0x10 + str r1, [r7, 0x28] + ldrb r0, [r0, 0x10] + cmp r0, 0xD1 + beq _0809E804 + b _0809E8F4 +_0809E812: + add r0, sp, 0x4 + ldrb r0, [r0, 0x1] + ldr r1, [sp, 0x8] + lsls r1, 16 + asrs r1, 16 + ldr r2, [r7, 0x28] + ldr r2, [r2, 0xC] + bl sub_809AE90 + lsls r0, 24 + cmp r0, 0 + beq _0809E844 + movs r0, 0 + movs r1, 0xA + bl sub_80A87AC + adds r0, r7, 0 + movs r1, 0 + bl sub_809D8EC + lsls r0, 24 + cmp r0, 0 + beq _0809E844 + movs r0, 0x1 + strh r0, [r4] +_0809E844: + ldr r0, [r7, 0x28] + adds r0, 0x10 + str r0, [r7, 0x28] + b _0809E9CC +_0809E84C: + adds r0, r7, 0 + adds r0, 0x46 + movs r3, 0 + ldrsh r1, [r0, r3] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0809E85E + b _0809E9D6 +_0809E85E: + movs r0, 0 + strh r0, [r2] + b _0809E8D0 +_0809E864: + adds r2, r7, 0 + adds r2, 0x50 + ldrh r3, [r2] + movs r4, 0 + ldrsh r0, [r2, r4] + cmp r0, 0 + bne _0809E88A +_0809E872: + adds r0, r7, 0 + adds r0, 0x46 + movs r5, 0 + ldrsh r1, [r0, r5] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0809E884 + b _0809E9D6 +_0809E884: + adds r0, r3, 0x1 + strh r0, [r2] + b _0809E9CC +_0809E88A: + add r0, sp, 0x140 + bl sub_809B18C + lsls r0, 24 + cmp r0, 0 + bne _0809E898 + b _0809E9D6 +_0809E898: + add r0, sp, 0x140 + ldr r3, [r0] + cmp r3, 0 + ble _0809E8CA + adds r0, r7, 0 + adds r0, 0x4C + movs r6, 0 + ldrsh r2, [r0, r6] + ldr r1, [r7, 0x40] + lsls r0, r3, 4 + lsls r2, 4 + adds r2, r1 + add r1, sp, 0x4 + adds r0, r2 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r0, [r0] + str r0, [r1] + add r0, sp, 0x4 + movs r5, 0x2 + ldrsh r1, [r0, r5] +_0809E8C2: + adds r0, r7, 0 + bl sub_80A242C +_0809E8C8: + str r0, [r7, 0x28] +_0809E8CA: + movs r0, 0x3 + strh r0, [r7, 0x26] +_0809E8CE: + movs r0, 0 +_0809E8D0: + movs r1, 0 + bl sub_80A87AC + b _0809E9CC +_0809E8D8: + adds r0, r7, 0 + adds r0, 0x46 + movs r6, 0 + ldrsh r1, [r0, r6] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _0809E9D6 + ldr r0, _0809E8FC + ldr r1, [r0, 0x4] +_0809E8EC: + adds r0, r7, 0 +_0809E8EE: + bl sub_80A2460 + str r0, [r7, 0x28] +_0809E8F4: + movs r0, 0x3 + strh r0, [r7, 0x26] + b _0809E9CC + .align 2, 0 +_0809E8FC: .4byte gUnknown_2039B48 +_0809E900: + adds r0, r7, 0 + bl ExecuteScriptCommand + strh r0, [r7, 0x26] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bhi _0809E9BC + lsls r0, 2 + ldr r1, _0809E91C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0809E91C: .4byte _0809E920 + .align 2, 0 +_0809E920: + .4byte _0809E934 + .4byte _0809E9B8 + .4byte _0809E9BC + .4byte _0809E9D6 + .4byte _0809E9B4 +_0809E934: + adds r0, r7, 0 + adds r0, 0x86 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _0809E9AA + adds r4, r7, 0 + adds r4, 0x84 + adds r0, r7, 0 + adds r0, 0x24 + adds r1, r4, 0 + movs r2, 0x60 + bl memcpy + ldr r2, [r7] + ldr r0, [r2, 0x2C] + cmp r0, 0 + beq _0809E98E + adds r5, r7, 0 + adds r5, 0x4A + movs r1, 0 + ldrsb r1, [r5, r1] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0809E98E + ldr r0, [r7, 0x4] + add r1, sp, 0x144 + ldr r2, [r2, 0x18] + bl _call_via_r2 + add r0, sp, 0x144 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 3 + ands r0, r1 + cmp r0, 0 + beq _0809E98E + ldr r2, [r7] + ldr r0, [r7, 0x4] + movs r1, 0 + ldrsb r1, [r5, r1] + ldr r2, [r2, 0x2C] + bl _call_via_r2 +_0809E98E: + ldr r0, [r7] + ldr r2, [r0, 0x30] + cmp r2, 0 + beq _0809E9A2 + ldr r0, [r7, 0x4] + adds r1, r7, 0 + adds r1, 0x48 + ldrh r1, [r1] + bl _call_via_r2 +_0809E9A2: + adds r0, r4, 0 + bl sub_809D568 + b _0809E9D6 +_0809E9AA: + adds r0, r7, 0 + adds r0, 0x24 + bl sub_809D568 + b _0809E9D6 +_0809E9B4: + movs r0, 0x4 + b _0809EABA +_0809E9B8: + movs r0, 0x1 + b _0809EABA +_0809E9BC: + adds r1, r7, 0 + adds r1, 0x50 + movs r0, 0 + strh r0, [r1] + b _0809E9CC +_0809E9C6: + movs r2, 0x26 + ldrsh r0, [r7, r2] + b _0809EABA +_0809E9CC: + movs r3, 0x1 + cmp r3, 0 + beq _0809E9D6 + bl _0809DA8A +_0809E9D6: + movs r0, 0x3 + b _0809EABA +_0809E9DA: + ldr r1, [r7] + ldr r0, [r7, 0x4] + add r4, sp, 0xCC + ldr r2, [r1, 0xC] + adds r1, r4, 0 + bl _call_via_r2 + add r5, sp, 0xD4 + adds r1, r7, 0 + adds r1, 0x58 + adds r2, r7, 0 + adds r2, 0x60 + mov r6, r8 + movs r0, 0 + ldrsh r6, [r6, r0] + mov r9, r6 + adds r6, r7, 0 + adds r6, 0x50 + movs r3, 0 + ldrsh r0, [r6, r3] + str r0, [sp] + adds r0, r5, 0 + mov r3, r9 + bl sub_8002934 + ldr r1, [r5] + ldr r0, [r4] + subs r1, r0 + add r0, sp, 0xDC + str r1, [r0] + ldr r1, [r5, 0x4] + ldr r2, [r4, 0x4] + subs r1, r2 + str r1, [r0, 0x4] + bl sub_8002C60 + lsls r0, 24 + adds r2, r7, 0 + adds r2, 0x4A + asrs r1, r0, 24 + lsrs r0, 24 + strb r0, [r2] + ldr r2, [r7] + ldr r0, [r7, 0x4] + ldr r2, [r2, 0x2C] + bl _call_via_r2 + ldr r1, [r7] + ldr r0, [r7, 0x4] + ldr r2, [r1, 0x24] + adds r1, r5, 0 + bl _call_via_r2 + ldr r2, [r7] + ldr r0, [r7, 0x4] + movs r1, 0x80 + lsls r1, 5 + ldr r2, [r2, 0x30] + bl _call_via_r2 + mov r4, r8 + ldrh r0, [r4] + subs r0, 0x1 + strh r0, [r4] + ldrh r0, [r6] + adds r0, 0x1 + strh r0, [r6] + b _0809E9D6 +_0809EA62: + add r5, sp, 0xC4 + adds r1, r7, 0 + adds r1, 0x58 + adds r2, r7, 0 + adds r2, 0x60 + movs r3, 0 + ldrsh r0, [r6, r3] + mov r8, r0 + adds r4, r7, 0 + adds r4, 0x50 + movs r3, 0 + ldrsh r0, [r4, r3] + str r0, [sp] + adds r0, r5, 0 + mov r3, r8 + bl sub_8002934 + ldr r1, [r7] + ldr r0, [r7, 0x4] + ldr r2, [r1, 0x24] + adds r1, r5, 0 + bl _call_via_r2 + ldr r2, [r7] + ldr r0, [r7, 0x4] + movs r1, 0x80 + lsls r1, 5 + ldr r2, [r2, 0x30] + bl _call_via_r2 + ldrh r0, [r6] + subs r0, 0x1 + strh r0, [r6] + ldrh r0, [r4] + adds r0, 0x1 + strh r0, [r4] + b _0809E9D6 +_0809EAAC: + subs r0, 0x1 + strh r0, [r2] + b _0809E9D6 +_0809EAB2: + subs r0, r2, 0x1 + strh r0, [r1] + b _0809E9D6 +_0809EAB8: + movs r0, 0 +_0809EABA: + add sp, 0x148 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_809DA70 + + thumb_func_start ExecuteScriptCommand +ExecuteScriptCommand: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1BC + mov r9, r0 + movs r0, 0x24 + add r0, r9 + mov r10, r0 +_0809EAE0: + mov r1, r10 + ldr r2, [r1, 0x4] + str r2, [r1, 0x1C] + add r1, sp, 0x8 + adds r0, r2, 0 + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + ldr r0, [r0] + str r0, [r1] + adds r2, 0x10 + mov r0, r10 + str r2, [r0, 0x4] + add r0, sp, 0x8 + ldrb r0, [r0] + mov r1, r10 + adds r1, 0x20 + strb r0, [r1] + lsls r0, 24 + lsrs r0, 24 + subs r0, 0x1 + adds r2, r1, 0 + cmp r0, 0xF5 + bhi _0809EAE0 + lsls r0, 2 + ldr r1, _0809EB18 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0809EB18: .4byte _0809EB1C + .align 2, 0 +_0809EB1C: + .4byte _0809EEF4 + .4byte _0809EF40 + .4byte _0809EFA2 + .4byte _0809EFD6 + .4byte _0809F064 + .4byte _0809F02A + .4byte _0809F06C + .4byte _0809F0D0 + .4byte _0809F0D0 + .4byte _0809F1FC + .4byte _0809F2C8 + .4byte _0809F2D6 + .4byte _0809F2D6 + .4byte _0809F2D6 + .4byte _0809F2D6 + .4byte _0809F2D6 + .4byte _0809F2D6 + .4byte _0809F2D6 + .4byte _0809F2D6 + .4byte _0809F2D6 + .4byte _0809F2D6 + .4byte _0809F42A + .4byte _0809F432 + .4byte _0809F43A + .4byte _0809F442 + .4byte _0809F4FE + .4byte _0809F5BE + .4byte _0809F5AE + .4byte _0809F5C6 + .4byte _0809F5C6 + .4byte _0809F660 + .4byte _0809F6EA + .4byte _0809F786 + .4byte _0809F830 + .4byte _0809F842 + .4byte _0809F854 + .4byte _0809F872 + .4byte _0809F884 + .4byte _0809F896 + .4byte _0809F896 + .4byte _0809F8E8 + .4byte _0809F8F4 + .4byte _0809F900 + .4byte _0809F90C + .4byte _0809F93E + .4byte _0809FAF8 + .4byte _0809FB10 + .4byte _0809F92E + .4byte _0809F936 + .4byte _0809FB28 + .4byte _0809FB28 + .4byte _0809FB28 + .4byte _0809FB28 + .4byte _0809FB28 + .4byte _0809FB28 + .4byte _0809FB28 + .4byte _0809FBDA + .4byte _0809FC12 + .4byte _0809FC40 + .4byte _0809FC2E + .4byte _0809FC46 + .4byte _0809FCA4 + .4byte _0809FCC4 + .4byte _0809EAE0 + .4byte _080A0E3A + .4byte _0809FCE8 + .4byte _0809FCF0 + .4byte _0809FD0A + .4byte _0809FD38 + .4byte _0809FD6C + .4byte _0809FDA0 + .4byte _0809FDA8 + .4byte _0809FDC2 + .4byte _0809FDD4 + .4byte _0809FDE2 + .4byte _0809FDC2 + .4byte _0809FDD4 + .4byte _0809FDE2 + .4byte _0809FE04 + .4byte _0809FE28 + .4byte _0809FE86 + .4byte _0809FEBE + .4byte _0809FED0 + .4byte _0809FF00 + .4byte _0809FF32 + .4byte _0809FF46 + .4byte _0809FF62 + .4byte _0809FF78 + .4byte _0809FF9A + .4byte _0809FFBA + .4byte _0809FFE4 + .4byte _080A0010 + .4byte _080A0064 + .4byte _080A0096 + .4byte _080A010E + .4byte _080A0186 + .4byte _080A0198 + .4byte _080A01B8 + .4byte _080A01F0 + .4byte _080A0220 + .4byte _080A0250 + .4byte _080A0282 + .4byte _080A0282 + .4byte _080A0560 + .4byte _080A0198 + .4byte _080A01B8 + .4byte _080A01F0 + .4byte _080A0220 + .4byte _080A0250 + .4byte _080A0282 + .4byte _080A0282 + .4byte _080A0560 + .4byte _080A02B2 + .4byte _080A0310 + .4byte _080A0370 + .4byte _080A03F8 + .4byte _080A0462 + .4byte _080A04F2 + .4byte _080A02B2 + .4byte _080A0310 + .4byte _080A0370 + .4byte _080A03F8 + .4byte _080A0462 + .4byte _080A04F2 + .4byte _080A02B2 + .4byte _080A0310 + .4byte _080A0370 + .4byte _080A03F8 + .4byte _080A0462 + .4byte _080A04F2 + .4byte _080A02B2 + .4byte _080A0310 + .4byte _080A0370 + .4byte _080A03F8 + .4byte _080A0462 + .4byte _080A04F2 + .4byte _080A057C + .4byte _080A05A4 + .4byte _080A05F0 + .4byte _080A060E + .4byte _080A065C + .4byte _080A068A + .4byte _080A068A + .4byte _080A068A + .4byte _080A07CA + .4byte _080A07DC + .4byte _080A07C4 + .4byte _080A07C4 + .4byte _080A07C4 + .4byte _0809EAE0 + .4byte _080A080C + .4byte _080A081E + .4byte _080A086A + .4byte _080A08BE + .4byte _080A08CA + .4byte _080A091E + .4byte _080A0986 + .4byte _080A0998 + .4byte _080A09EA + .4byte _080A0A52 + .4byte _080A0A64 + .4byte _080A0AB6 + .4byte _080A0B1E + .4byte _080A0B30 + .4byte _080A0B42 + .4byte _080A0B54 + .4byte _080A0B6C + .4byte _080A0B88 + .4byte _080A0BA2 + .4byte _080A0BB4 + .4byte _080A0BDA + .4byte _080A0BF6 + .4byte _080A0C08 + .4byte _080A0C20 + .4byte _080A0C38 + .4byte _080A0C50 + .4byte _080A0C68 + .4byte _080A0C80 + .4byte _080A0C90 + .4byte _080A0CA2 + .4byte _080A0CC8 + .4byte _080A0CF2 + .4byte _080A0D16 + .4byte _080A0D40 + .4byte _080A0D6A + .4byte _080A0D7A + .4byte _080A0D94 + .4byte _080A0DAE + .4byte _080A0DD6 + .4byte _080A0E08 + .4byte _080A0DE2 + .4byte _080A0E56 + .4byte _080A0E56 + .4byte _080A0E56 + .4byte _080A0E56 + .4byte _080A0E56 + .4byte _080A0E56 + .4byte _080A0E56 + .4byte _080A0E56 + .4byte _080A0E56 + .4byte _080A0E56 + .4byte _080A0E56 + .4byte _080A0E56 + .4byte _0809EAE0 + .4byte _0809EAE0 + .4byte _0809EAE0 + .4byte _080A10A0 + .4byte _0809EAE0 + .4byte _0809EAE0 + .4byte _080A10F8 + .4byte _080A10F8 + .4byte _080A10F8 + .4byte _080A10F8 + .4byte _080A10F8 + .4byte _080A10F8 + .4byte _080A10F8 + .4byte _0809EAE0 + .4byte _080A129E + .4byte _080A12A8 + .4byte _080A12B4 + .4byte _0809F0C4 + .4byte _0809F0C4 + .4byte _0809F0C4 + .4byte _0809F0C4 + .4byte _0809F0C4 + .4byte _0809F0C4 + .4byte _080A12D0 + .4byte _080A12E6 + .4byte _080A12F4 + .4byte _080A1318 + .4byte _080A1324 + .4byte _080A1338 + .4byte _080A1344 + .4byte _080A1368 + .4byte _080A1374 + .4byte _080A13CA + .4byte _080A13F8 + .4byte _080A1404 + .4byte _080A140C + .4byte _080A1428 + .4byte _080A142C + .4byte _0809EAE0 + .4byte _0809EAE0 + .4byte _0809EAE0 + .4byte _0809EAE0 + .4byte _0809EAE0 +_0809EEF4: + ldr r0, [sp, 0xC] + lsls r0, 16 + asrs r4, r0, 16 + adds r6, r4, 0 + add r0, sp, 0x8 + ldrb r5, [r0, 0x1] + movs r0, 0x1 + bl sub_8011BA4 + lsls r0, 24 + cmp r0, 0 + beq _0809EF26 + ldr r1, _0809EF38 + ldr r2, _0809EF3C + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + adds r2, 0x8 + adds r0, r2 + ldr r3, [r0] + str r5, [sp] + movs r0, 0x1 + adds r2, r4, 0 + bl Log +_0809EF26: + add r0, sp, 0x8 + movs r1, 0x2 + ldrsh r2, [r0, r1] + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_8098D1C + b _0809EAE0 + .align 2, 0 +_0809EF38: .4byte gUnknown_81165D4 +_0809EF3C: .4byte gUnknown_811BAF4 +_0809EF40: + ldr r0, [sp, 0xC] + lsls r0, 16 + asrs r4, r0, 16 + movs r5, 0x1 + negs r5, r5 + cmp r4, r5 + bne _0809EF5A + movs r0, 0 + movs r1, 0x13 + bl sub_8001658 + lsls r0, 16 + asrs r4, r0, 16 +_0809EF5A: + movs r0, 0x1 + bl sub_8011BA4 + lsls r0, 24 + cmp r0, 0 + beq _0809EF70 + ldr r1, _0809EF90 + movs r0, 0x1 + adds r2, r4, 0 + bl Log +_0809EF70: + cmp r4, r5 + beq _0809EF94 + add r0, sp, 0x8 + movs r2, 0x2 + ldrsh r1, [r0, r2] + adds r0, r4, 0 + bl sub_8098E18 + mov r0, r9 + movs r1, 0x1 + bl sub_80A2460 + mov r3, r9 + str r0, [r3, 0x28] + b _0809EAE0 + .align 2, 0 +_0809EF90: .4byte gUnknown_81165F4 +_0809EF94: + mov r0, r9 + movs r1, 0 + bl sub_80A2460 + mov r4, r9 + str r0, [r4, 0x28] + b _0809EAE0 +_0809EFA2: + ldr r0, [sp, 0xC] + bl sub_8021700 + lsls r0, 24 + cmp r0, 0 + beq _0809EFBE + movs r1, 0x1 + negs r1, r1 + mov r0, r9 + bl sub_80A2460 + mov r5, r9 + str r0, [r5, 0x28] + b _0809EAE0 +_0809EFBE: + add r0, sp, 0x8 + movs r1, 0x2 + ldrsh r0, [r0, r1] + bl sub_8098D80 + mov r0, r9 + movs r1, 0 + bl sub_80A2460 + mov r2, r9 + str r0, [r2, 0x28] + b _0809EAE0 +_0809EFD6: + ldr r1, [sp, 0xC] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _0809F00C + bl sub_802FCF0 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0 + bne _0809F0BC + movs r0, 0xC + movs r1, 0 + movs r2, 0 + bl sub_809B1C0 + lsls r0, 24 + cmp r0, 0 + beq _0809F0BC + movs r0, 0 + movs r1, 0xB + bl sub_80A87AC + mov r0, r9 + adds r0, 0x4C + strh r4, [r0] + b _0809F0C4 +_0809F00C: + lsls r0, r1, 16 + asrs r0, 16 + bl sub_80A26B8 + adds r2, r0, 0 + lsls r2, 16 + asrs r2, 16 + movs r0, 0 + movs r1, 0x12 + bl sub_80018D8 + mov r1, r9 + adds r1, 0x4C + movs r0, 0x1 + b _0809F0C2 +_0809F02A: + ldr r2, [sp, 0xC] + movs r0, 0x1 + negs r0, r0 + cmp r2, r0 + bne _0809F054 + movs r0, 0x24 + movs r1, 0 + movs r2, 0 + bl sub_809B1C0 + lsls r0, 24 + cmp r0, 0 + beq _0809F0BC + movs r0, 0 + movs r1, 0xB + bl sub_80A87AC + mov r1, r9 + adds r1, 0x4C + movs r0, 0 + b _0809F0C2 +_0809F054: + movs r0, 0 + movs r1, 0x13 + bl sub_80018D8 + mov r1, r9 + adds r1, 0x4C + movs r0, 0x1 + b _0809F0C2 +_0809F064: + mov r1, r9 + adds r1, 0x4C + movs r0, 0x1 + b _0809F0C2 +_0809F06C: + ldr r0, [sp, 0xC] + lsls r0, 16 + asrs r4, r0, 16 + movs r0, 0x1 + negs r0, r0 + cmp r4, r0 + bne _0809F088 + movs r0, 0 + movs r1, 0x13 + bl sub_8001658 + lsls r0, 16 + asrs r4, r0, 16 + b _0809F092 +_0809F088: + movs r0, 0 + movs r1, 0x13 + adds r2, r4, 0 + bl sub_80018D8 +_0809F092: + movs r0, 0x1 + bl sub_8011BA4 + lsls r0, 24 + cmp r0, 0 + beq _0809F0A8 + ldr r1, _0809F0B8 + movs r0, 0x1 + adds r2, r4, 0 + bl Log +_0809F0A8: + movs r0, 0x1 + negs r0, r0 + cmp r4, r0 + beq _0809F0BC + mov r1, r9 + adds r1, 0x4C + movs r0, 0x1 + b _0809F0C2 + .align 2, 0 +_0809F0B8: .4byte gUnknown_811660C +_0809F0BC: + mov r1, r9 + adds r1, 0x4C + ldr r0, _0809F0CC +_0809F0C2: + strh r0, [r1] +_0809F0C4: + movs r0, 0x2 + bl _080A142E + .align 2, 0 +_0809F0CC: .4byte 0x0000ffff +_0809F0D0: + add r0, sp, 0x8 + ldrb r0, [r0] + cmp r0, 0x8 + bne _0809F130 + ldr r5, _0809F11C + ldr r0, [sp, 0xC] + strh r0, [r5] + lsls r0, 16 + asrs r0, 16 + bl sub_80A4D7C + ldr r4, _0809F120 + strh r0, [r4] + ldr r1, _0809F124 + strh r0, [r1] + movs r0, 0x1 + bl sub_8011BA4 + lsls r0, 24 + cmp r0, 0 + beq _0809F16A + ldr r1, _0809F128 + movs r3, 0 + ldrsh r2, [r5, r3] + movs r5, 0 + ldrsh r3, [r4, r5] + ldr r4, _0809F12C + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r4, 0x8 + adds r0, r4 + ldr r0, [r0] + str r0, [sp] + movs r0, 0x1 + bl Log + b _0809F16A + .align 2, 0 +_0809F11C: .4byte gUnknown_2039A30 +_0809F120: .4byte gUnknown_2039A32 +_0809F124: .4byte gUnknown_2039A34 +_0809F128: .4byte gUnknown_8116628 +_0809F12C: .4byte gUnknown_811BAF4 +_0809F130: + ldr r5, _0809F1E8 + ldr r4, _0809F1EC + ldr r1, [sp, 0xC] + strh r1, [r4] + strh r1, [r5] + ldr r0, _0809F1F0 + strh r1, [r0] + movs r0, 0x1 + bl sub_8011BA4 + lsls r0, 24 + cmp r0, 0 + beq _0809F16A + ldr r1, _0809F1F4 + movs r0, 0 + ldrsh r2, [r4, r0] + movs r4, 0 + ldrsh r3, [r5, r4] + ldr r4, _0809F1F8 + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r4, 0x8 + adds r0, r4 + ldr r0, [r0] + str r0, [sp] + movs r0, 0x1 + bl Log +_0809F16A: + ldr r5, _0809F1EC + movs r0, 0 + ldrsh r2, [r5, r0] + movs r0, 0 + movs r1, 0x10 + bl sub_80018D8 + ldr r6, _0809F1F8 + movs r2, 0 + ldrsh r1, [r5, r2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r6 + movs r3, 0x2 + ldrsh r2, [r0, r3] + movs r0, 0 + movs r1, 0x11 + bl sub_80018D8 + ldr r4, _0809F1E8 + movs r1, 0 + ldrsh r0, [r4, r1] + bl sub_80A6390 + bl sub_809D0BC + bl sub_80AD9D0 + bl sub_80A786C + bl sub_80ABB98 + bl sub_80ACBD4 + movs r2, 0 + ldrsh r0, [r5, r2] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r1, r6 + movs r3, 0x2 + ldrsh r1, [r1, r3] + bl sub_809C770 + movs r5, 0 + ldrsh r0, [r4, r5] + bl sub_80A4DCC + movs r1, 0 + ldrsh r0, [r4, r1] + bl sub_80AD880 + movs r2, 0 + ldrsh r0, [r4, r2] + movs r1, 0 + movs r2, 0 + bl sub_80A791C + movs r3, 0 + ldrsh r0, [r4, r3] + b _0809F2A0 + .align 2, 0 +_0809F1E8: .4byte gUnknown_2039A32 +_0809F1EC: .4byte gUnknown_2039A30 +_0809F1F0: .4byte gUnknown_2039A34 +_0809F1F4: .4byte gUnknown_8116644 +_0809F1F8: .4byte gUnknown_811BAF4 +_0809F1FC: + ldr r0, [sp, 0xC] + lsls r0, 16 + asrs r0, 16 + bl sub_80A2608 + adds r6, r0, 0 + ldr r1, _0809F2AC + ldr r5, _0809F2B0 + ldr r4, _0809F2B4 + ldr r0, [sp, 0x10] + strh r0, [r4] + strh r0, [r5] + strh r0, [r1] + movs r0, 0x1 + bl sub_8011BA4 + lsls r0, 24 + cmp r0, 0 + beq _0809F242 + ldr r1, _0809F2B8 + movs r0, 0 + ldrsh r2, [r4, r0] + movs r4, 0 + ldrsh r3, [r5, r4] + ldr r4, _0809F2BC + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r4, 0x8 + adds r0, r4 + ldr r0, [r0] + str r0, [sp] + movs r0, 0x1 + bl Log +_0809F242: + movs r1, 0 + ldrsh r0, [r5, r1] + bl sub_80A6390 + bl sub_809D0BC + bl sub_80AD9D0 + bl sub_80A786C + bl sub_80ABB98 + bl sub_80ACBD4 + ldrb r2, [r6, 0xC] + ldr r1, _0809F2C0 + ldr r0, [sp, 0x58] + ands r0, r1 + orrs r0, r2 + str r0, [sp, 0x58] + add r1, sp, 0x8 + ldrh r2, [r1, 0x2] + lsls r2, 24 + lsrs r2, 16 + ldr r1, _0809F2C4 + ands r0, r1 + orrs r0, r2 + str r0, [sp, 0x58] + movs r2, 0 + ldrsh r0, [r5, r2] + add r1, sp, 0x58 + add r2, sp, 0x8 + ldrb r2, [r2, 0x1] + bl sub_80A50C8 + movs r3, 0 + ldrsh r0, [r5, r3] + bl sub_80AD880 + movs r4, 0 + ldrsh r0, [r5, r4] + movs r1, 0 + movs r2, 0 + bl sub_80A791C + movs r1, 0 + ldrsh r0, [r5, r1] +_0809F2A0: + movs r1, 0 + movs r2, 0 + bl sub_80ABBF0 + b _0809EAE0 + .align 2, 0 +_0809F2AC: .4byte gUnknown_2039A34 +_0809F2B0: .4byte gUnknown_2039A32 +_0809F2B4: .4byte gUnknown_2039A30 +_0809F2B8: .4byte gUnknown_8116664 +_0809F2BC: .4byte gUnknown_811BAF4 +_0809F2C0: .4byte 0xffffff00 +_0809F2C4: .4byte 0xffff00ff +_0809F2C8: + ldr r0, [sp, 0xC] + lsls r0, 16 + asrs r0, 16 + bl sub_80A5F50 + bl _0809EAE0 +_0809F2D6: + add r0, sp, 0x8 + ldrh r0, [r0, 0x2] + lsls r0, 16 + cmp r0, 0 + blt _0809F2E8 + add r0, sp, 0x8 + movs r2, 0x2 + ldrsh r0, [r0, r2] + b _0809F2EE +_0809F2E8: + mov r3, r10 + movs r4, 0xC + ldrsh r0, [r3, r4] +_0809F2EE: + adds r6, r0, 0 + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + lsls r0, 24 + cmp r0, 0 + blt _0809F302 + add r0, sp, 0x8 + movs r1, 0x1 + ldrsb r1, [r0, r1] + b _0809F308 +_0809F302: + mov r5, r10 + movs r1, 0xE + ldrsb r1, [r5, r1] +_0809F308: + adds r5, r1, 0 + add r0, sp, 0x8 + ldrb r0, [r0] + subs r0, 0xC + cmp r0, 0x9 + bls _0809F318 + bl _0809EAE0 +_0809F318: + lsls r0, 2 + ldr r1, _0809F324 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0809F324: .4byte _0809F328 + .align 2, 0 +_0809F328: + .4byte _0809F350 + .4byte _0809F380 + .4byte _0809F398 + .4byte _0809F3B0 + .4byte _0809F3C8 + .4byte _0809F3E0 + .4byte _0809F3FA + .4byte _0809F406 + .4byte _0809F412 + .4byte _0809F41E +_0809F350: + ldr r4, _0809F37C + movs r1, 0 + ldrsh r0, [r4, r1] + adds r1, r6, 0 + adds r2, r5, 0 + bl sub_80A791C + movs r2, 0 + ldrsh r0, [r4, r2] + adds r1, r6, 0 + adds r2, r5, 0 + bl sub_80ABBF0 + movs r3, 0 + ldrsh r0, [r4, r3] + adds r1, r6, 0 + adds r2, r5, 0 + bl sub_80ACC2C + movs r1, 0 + ldrsh r0, [r4, r1] + b _0809F3CE + .align 2, 0 +_0809F37C: .4byte gUnknown_2039A32 +_0809F380: + ldr r0, _0809F394 + movs r2, 0 + ldrsh r0, [r0, r2] + adds r1, r6, 0 + adds r2, r5, 0 + bl sub_80A791C + bl _0809EAE0 + .align 2, 0 +_0809F394: .4byte gUnknown_2039A32 +_0809F398: + ldr r0, _0809F3AC + movs r3, 0 + ldrsh r0, [r0, r3] + adds r1, r6, 0 + adds r2, r5, 0 + bl sub_80ABBF0 + bl _0809EAE0 + .align 2, 0 +_0809F3AC: .4byte gUnknown_2039A32 +_0809F3B0: + ldr r0, _0809F3C4 + movs r4, 0 + ldrsh r0, [r0, r4] + adds r1, r6, 0 + adds r2, r5, 0 + bl sub_80ACC2C + bl _0809EAE0 + .align 2, 0 +_0809F3C4: .4byte gUnknown_2039A32 +_0809F3C8: + ldr r0, _0809F3DC + movs r1, 0 + ldrsh r0, [r0, r1] +_0809F3CE: + adds r1, r6, 0 + adds r2, r5, 0 + bl sub_80ADA24 + bl _0809EAE0 + .align 2, 0 +_0809F3DC: .4byte gUnknown_2039A32 +_0809F3E0: + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80A7988 + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80ABC5C + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80ACC98 + b _0809F41E +_0809F3FA: + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80A7988 + bl _0809EAE0 +_0809F406: + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80ABC5C + bl _0809EAE0 +_0809F412: + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80ACC98 + bl _0809EAE0 +_0809F41E: + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80ADA90 + bl _0809EAE0 +_0809F42A: + bl sub_80A79FC + bl _0809EAE0 +_0809F432: + bl sub_80ABCCC + bl _0809EAE0 +_0809F43A: + bl sub_80ACD08 + bl _0809EAE0 +_0809F442: + mov r2, r9 + ldr r1, [r2] + ldr r0, [r2, 0x4] + add r4, sp, 0x18 + ldr r2, [r1, 0x14] + adds r1, r4, 0 + bl _call_via_r2 + add r6, sp, 0x1C + ldr r0, [sp, 0x10] + add r5, sp, 0x34 + movs r2, 0 + strb r0, [r5] + ldrb r1, [r4] + mov r0, sp + adds r0, 0x35 + strb r1, [r0] + adds r0, 0x1 + movs r1, 0x1 + strb r1, [r0] + adds r0, 0x1 + strb r1, [r0] + str r2, [sp, 0x38] + add r4, sp, 0x3C + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x10 + bl memset + ldr r2, _0809F4AC + ldr r1, [sp, 0xC] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r2, 0x8 + adds r0, r2 + ldr r0, [r0] + str r0, [r4, 0xC] + adds r0, r6, 0 + adds r1, r5, 0 + movs r2, 0x18 + bl memcpy + add r0, sp, 0x8 + ldrh r0, [r0, 0x2] + lsls r0, 16 + adds r1, r6, 0 + cmp r0, 0 + blt _0809F4B0 + add r0, sp, 0x8 + movs r3, 0x2 + ldrsh r2, [r0, r3] + b _0809F4B6 + .align 2, 0 +_0809F4AC: .4byte gUnknown_812F1F8 +_0809F4B0: + mov r4, r10 + movs r5, 0xC + ldrsh r2, [r4, r5] +_0809F4B6: + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + lsls r0, 24 + cmp r0, 0 + blt _0809F4C8 + add r0, sp, 0x8 + movs r3, 0x1 + ldrsb r3, [r0, r3] + b _0809F4CE +_0809F4C8: + mov r0, r10 + movs r3, 0xE + ldrsb r3, [r0, r3] +_0809F4CE: + movs r0, 0x1 + negs r0, r0 + bl sub_80ABD88 + lsls r0, 16 + asrs r5, r0, 16 + cmp r5, 0 + bge _0809F4E2 + bl _0809EAE0 +_0809F4E2: + mov r2, r9 + ldr r1, [r2] + ldr r0, [r2, 0x4] + add r4, sp, 0x5C + ldr r2, [r1, 0xC] + adds r1, r4, 0 + bl _call_via_r2 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80AC49C + bl _0809EAE0 +_0809F4FE: + mov r3, r9 + ldr r1, [r3] + ldr r0, [r3, 0x4] + add r4, sp, 0x4C + ldr r2, [r1, 0x14] + adds r1, r4, 0 + bl _call_via_r2 + add r5, sp, 0x1C + ldr r0, [sp, 0x10] + add r1, sp, 0x28 + movs r3, 0 + strb r0, [r1] + ldrb r2, [r4] + mov r0, sp + adds r0, 0x29 + strb r2, [r0] + adds r0, 0x1 + movs r2, 0x1 + strb r2, [r0] + adds r0, 0x1 + strb r2, [r0] + str r3, [sp, 0x2C] + ldr r3, _0809F55C + ldr r2, [sp, 0xC] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r3, 0x8 + adds r0, r3 + ldr r0, [r0] + str r0, [sp, 0x30] + adds r0, r5, 0 + movs r2, 0xC + bl memcpy + add r0, sp, 0x8 + ldrh r0, [r0, 0x2] + lsls r0, 16 + adds r1, r5, 0 + cmp r0, 0 + blt _0809F560 + add r0, sp, 0x8 + movs r4, 0x2 + ldrsh r2, [r0, r4] + b _0809F566 + .align 2, 0 +_0809F55C: .4byte gUnknown_812F1F8 +_0809F560: + mov r5, r10 + movs r0, 0xC + ldrsh r2, [r5, r0] +_0809F566: + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + lsls r0, 24 + cmp r0, 0 + blt _0809F578 + add r0, sp, 0x8 + movs r3, 0x1 + ldrsb r3, [r0, r3] + b _0809F57E +_0809F578: + mov r4, r10 + movs r3, 0xE + ldrsb r3, [r4, r3] +_0809F57E: + movs r0, 0x1 + negs r0, r0 + bl sub_80ACDC4 + lsls r0, 16 + asrs r5, r0, 16 + cmp r5, 0 + bge _0809F592 + bl _0809EAE0 +_0809F592: + mov r0, r9 + ldr r1, [r0] + ldr r0, [r0, 0x4] + add r4, sp, 0x64 + ldr r2, [r1, 0xC] + adds r1, r4, 0 + bl _call_via_r2 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80AD3B4 + bl _0809EAE0 +_0809F5AE: + add r0, sp, 0x8 + movs r1, 0x2 + ldrsh r0, [r0, r1] + movs r1, 0x1 + bl sub_80A4BFC + bl _0809EAE0 +_0809F5BE: + add r0, sp, 0x8 + movs r2, 0x2 + ldrsh r0, [r0, r2] + b _0809F712 +_0809F5C6: + ldr r1, [sp, 0xC] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0809F5D6 + lsls r0, r1, 16 + asrs r0, 16 + b _0809F5DC +_0809F5D6: + ldr r0, _0809F5F0 + movs r3, 0 + ldrsh r0, [r0, r3] +_0809F5DC: + adds r4, r0, 0 + add r0, sp, 0x8 + ldrh r0, [r0, 0x2] + lsls r0, 16 + cmp r0, 0 + blt _0809F5F4 + add r0, sp, 0x8 + movs r5, 0x2 + ldrsh r1, [r0, r5] + b _0809F5FA + .align 2, 0 +_0809F5F0: .4byte gUnknown_2039A30 +_0809F5F4: + mov r0, r10 + movs r2, 0xC + ldrsh r1, [r0, r2] +_0809F5FA: + adds r6, r1, 0 + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + lsls r0, 24 + cmp r0, 0 + blt _0809F60E + add r0, sp, 0x8 + movs r5, 0x1 + ldrsb r5, [r0, r5] + b _0809F614 +_0809F60E: + mov r3, r10 + movs r5, 0xE + ldrsb r5, [r3, r5] +_0809F614: + adds r0, r4, 0 + bl sub_80A4D7C + lsls r0, 16 + asrs r4, r0, 16 + movs r3, 0 + add r0, sp, 0x8 + ldrb r0, [r0] + cmp r0, 0x1E + bne _0809F62A + movs r3, 0x1 +_0809F62A: + adds r0, r4, 0 + adds r1, r6, 0 + adds r2, r5, 0 + bl sub_80A4C50 + ldr r1, _0809F65C + movs r5, 0 + ldrsh r0, [r1, r5] + cmp r0, r4 + bne _0809F642 + bl _0809EAE0 +_0809F642: + strh r4, [r1] + bl sub_809D940 + mov r1, r9 + movs r2, 0x8 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _0809F656 + bl _0809EAE0 +_0809F656: + bl _080A142C + .align 2, 0 +_0809F65C: .4byte gUnknown_2039A34 +_0809F660: + movs r0, 0 + movs r1, 0x13 + bl sub_8001658 + lsls r0, 16 + asrs r4, r0, 16 + adds r0, r4, 0 + bl sub_80A2608 + adds r5, r0, 0 + lsls r2, r4, 16 + lsrs r2, 16 + movs r0, 0 + movs r1, 0x30 + bl sub_8001784 + cmp r0, 0 + bne _0809F68A + movs r3, 0x6 + ldrsh r5, [r5, r3] + b _0809F68E +_0809F68A: + movs r0, 0x8 + ldrsh r5, [r5, r0] +_0809F68E: + adds r0, r4, 0 + subs r0, 0x37 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x10 + bls _0809F6DC + adds r0, r4, 0 + bl sub_80A2750 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x1 + bne _0809F6DC + movs r0, 0x1 + negs r0, r0 + cmp r5, r0 + bne _0809F6D8 + movs r0, 0x1 + bl sub_8011BA4 + lsls r0, 24 + cmp r0, 0 + beq _0809F6C6 + ldr r1, _0809F6D4 + movs r0, 0x1 + adds r2, r4, 0 + bl Log +_0809F6C6: + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_8098E18 + bl _0809EAE0 + .align 2, 0 +_0809F6D4: .4byte gUnknown_8116684 +_0809F6D8: + adds r0, r5, 0 + b _0809F712 +_0809F6DC: + movs r1, 0x1 + negs r1, r1 + adds r0, r4, 0 + bl sub_8098E18 + bl _0809EAE0 +_0809F6EA: + mov r1, r9 + movs r2, 0xC + ldrsh r0, [r1, r2] + cmp r0, 0x1 + beq _0809F71C + cmp r0, 0x1 + bgt _0809F700 + cmp r0, 0 + beq _0809F70C + bl _0809EAE0 +_0809F700: + cmp r0, 0x2 + beq _0809F73E + cmp r0, 0x3 + beq _0809F762 + bl _0809EAE0 +_0809F70C: + add r0, sp, 0x8 + movs r3, 0x2 + ldrsh r0, [r0, r3] +_0809F712: + movs r1, 0 + bl sub_80A4BFC + bl _0809EAE0 +_0809F71C: + add r4, sp, 0x1C + add r0, sp, 0x8 + movs r5, 0x2 + ldrsh r2, [r0, r5] + mov r0, r9 + adds r1, r4, 0 + bl sub_809D710 + mov r1, r9 + movs r2, 0xE + ldrsh r0, [r1, r2] + adds r1, 0x8 + adds r2, r4, 0 + bl sub_80A88D8 + bl _0809EAE0 +_0809F73E: + add r4, sp, 0x28 + add r0, sp, 0x8 + movs r3, 0x2 + ldrsh r2, [r0, r3] + mov r0, r9 + adds r1, r4, 0 + bl sub_809D710 + mov r5, r9 + movs r1, 0xE + ldrsh r0, [r5, r1] + mov r1, r9 + adds r1, 0x8 + adds r2, r4, 0 + bl sub_80AC2BC + bl _0809EAE0 +_0809F762: + add r4, sp, 0x34 + add r0, sp, 0x8 + movs r3, 0x2 + ldrsh r2, [r0, r3] + mov r0, r9 + adds r1, r4, 0 + bl sub_809D710 + mov r5, r9 + movs r1, 0xE + ldrsh r0, [r5, r1] + mov r1, r9 + adds r1, 0x8 + adds r2, r4, 0 + bl sub_80AD1D4 + bl _0809EAE0 +_0809F786: + ldr r0, [sp, 0xC] + lsls r0, 16 + asrs r0, 16 + bl sub_80A7AE8 + lsls r0, 16 + asrs r0, 16 + mov r8, r0 + cmp r0, 0 + bge _0809F79E + bl _0809EAE0 +_0809F79E: + add r1, sp, 0x6C + bl sub_80A8BD8 + ldr r0, [sp, 0x6C] + movs r1, 0x80 + lsls r1, 2 + ands r0, r1 + cmp r0, 0 + beq _0809F818 + mov r2, r9 + ldr r1, [r2] + ldr r0, [r2, 0x4] + add r7, sp, 0x70 + ldr r2, [r1, 0xC] + adds r1, r7, 0 + bl _call_via_r2 + mov r3, r9 + ldr r1, [r3] + ldr r0, [r3, 0x4] + add r5, sp, 0x78 + ldr r2, [r1, 0x8] + adds r1, r5, 0 + bl _call_via_r2 + add r6, sp, 0x80 + mov r0, r8 + adds r1, r6, 0 + bl sub_80A8FD8 + add r4, sp, 0x88 + mov r0, r8 + adds r1, r4, 0 + bl sub_80A8F9C + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r7, 0 + adds r3, r5, 0 + bl sub_8002DF0 + lsls r0, 24 + asrs r1, r0, 24 + adds r4, r1, 0 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _0809F812 + ldr r3, _0809F82C + adds r0, r7, 0 + adds r1, r3, 0 + adds r2, r6, 0 + bl sub_8002D54 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, r4 + beq _0809F818 +_0809F812: + mov r0, r8 + bl sub_80A9090 +_0809F818: + mov r4, r9 + movs r5, 0xA + ldrsh r0, [r4, r5] + mov r1, r8 + bl sub_80A89D0 + movs r0, 0x3 + bl _080A142E + .align 2, 0 +_0809F82C: .4byte gUnknown_81164DC +_0809F830: + add r0, sp, 0x8 + movs r1, 0x2 + ldrsh r0, [r0, r1] + bl sub_80999E8 + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + bl _080A130C +_0809F842: + add r0, sp, 0x8 + movs r2, 0x2 + ldrsh r0, [r0, r2] + bl sub_80999FC + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + bl _080A130C +_0809F854: + add r0, sp, 0x8 + movs r3, 0x2 + ldrsh r0, [r0, r3] + ldr r1, [sp, 0xC] + lsls r1, 16 + lsrs r1, 16 + ldr r2, [sp, 0x10] + lsls r2, 16 + lsrs r2, 16 + bl sub_8099A10 + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + bl _080A130C +_0809F872: + add r0, sp, 0x8 + movs r4, 0x2 + ldrsh r0, [r0, r4] + bl sub_8099A34 + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + bl _080A130C +_0809F884: + add r0, sp, 0x8 + movs r5, 0x2 + ldrsh r0, [r0, r5] + bl sub_8099A48 + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + bl _080A130C +_0809F896: + ldr r0, [sp, 0x10] + asrs r0, 16 + add r1, sp, 0x20 + movs r2, 0 + strb r0, [r1] + ldr r0, [sp, 0x10] + asrs r0, 8 + adds r1, 0x1 + strb r0, [r1] + ldr r1, [sp, 0x10] + mov r0, sp + adds r0, 0x22 + strb r1, [r0] + adds r0, 0x1 + strb r2, [r0] + ldr r2, [sp, 0x20] + str r2, [sp, 0x1C] + add r0, sp, 0x8 + ldrb r0, [r0] + cmp r0, 0x27 + beq _0809F8C6 + cmp r0, 0x28 + beq _0809F8D4 + b _0809F8E0 +_0809F8C6: + add r0, sp, 0x8 + movs r1, 0x2 + ldrsh r0, [r0, r1] + ldr r1, [sp, 0xC] + bl sub_8099A5C + b _0809F8E0 +_0809F8D4: + add r0, sp, 0x8 + movs r3, 0x2 + ldrsh r0, [r0, r3] + ldr r1, [sp, 0xC] + bl sub_8099AFC +_0809F8E0: + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + bl _080A130C +_0809F8E8: + add r0, sp, 0x8 + ldrh r0, [r0, 0x2] + bl sub_809A6E4 + bl _0809EAE0 +_0809F8F4: + add r0, sp, 0x8 + ldrh r0, [r0, 0x2] + bl sub_809A6F8 + bl _0809EAE0 +_0809F900: + ldr r0, [sp, 0xC] + ldr r1, [sp, 0x10] + bl sub_809A738 + bl _0809EAE0 +_0809F90C: + bl sub_809A768 + lsls r0, 24 + cmp r0, 0 + bne _0809F91A + bl _0809EAE0 +_0809F91A: + movs r0, 0 + movs r1, 0xA + bl sub_80A87AC + mov r0, r9 + movs r1, 0 + bl sub_809D8EC + bl _080A130A +_0809F92E: + bl sub_809A76C + bl _0809EAE0 +_0809F936: + bl sub_809A7B4 + bl _0809EAE0 +_0809F93E: + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + cmp r0, 0xA + bls _0809F94A + bl _0809EAE0 +_0809F94A: + lsls r0, 2 + ldr r1, _0809F954 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0809F954: .4byte _0809F958 + .align 2, 0 +_0809F958: + .4byte _0809F984 + .4byte _0809F992 + .4byte _0809F9A4 + .4byte _0809F9B6 + .4byte _0809F9D8 + .4byte _0809F9EA + .4byte _0809F9FC + .4byte _0809FA44 + .4byte _0809FA56 + .4byte _0809FA68 + .4byte _0809FAB0 +_0809F984: + add r0, sp, 0x8 + movs r4, 0x2 + ldrsh r0, [r0, r4] + bl sub_809A83C + bl _0809EAE0 +_0809F992: + add r0, sp, 0x8 + movs r5, 0x2 + ldrsh r0, [r0, r5] + mov r1, r9 + adds r1, 0x8 + bl sub_80A2500 + bl _0809EAE0 +_0809F9A4: + add r0, sp, 0x8 + movs r1, 0x2 + ldrsh r0, [r0, r1] + mov r1, r9 + adds r1, 0xC + bl sub_80A2500 + bl _0809EAE0 +_0809F9B6: + ldr r0, [sp, 0xC] + lsls r0, 16 + asrs r0, 16 + bl sub_80A7AE8 + add r1, sp, 0x90 + lsls r0, 16 + movs r2, 0x1 + orrs r0, r2 + str r0, [r1] + add r0, sp, 0x8 + movs r2, 0x2 + ldrsh r0, [r0, r2] + bl sub_80A2500 + bl _0809EAE0 +_0809F9D8: + add r0, sp, 0x8 + movs r3, 0x2 + ldrsh r0, [r0, r3] + mov r1, r9 + adds r1, 0x8 + bl sub_80A252C + bl _0809EAE0 +_0809F9EA: + add r0, sp, 0x8 + movs r4, 0x2 + ldrsh r0, [r0, r4] + mov r1, r9 + adds r1, 0xC + bl sub_80A252C + bl _0809EAE0 +_0809F9FC: + ldr r0, [sp, 0xC] + lsls r0, 16 + asrs r0, 16 + bl sub_80A7AE8 + lsls r0, 16 + add r1, sp, 0x94 + ldrh r2, [r1] + orrs r2, r0 + str r2, [r1] + cmp r2, 0 + blt _0809FA30 + ldr r0, _0809FA2C + ands r2, r0 + movs r0, 0x1 + orrs r2, r0 + str r2, [r1] + add r0, sp, 0x8 + movs r5, 0x2 + ldrsh r0, [r0, r5] + bl sub_80A252C + bl _0809EAE0 + .align 2, 0 +_0809FA2C: .4byte 0xffff0000 +_0809FA30: + add r0, sp, 0x8 + movs r1, 0x2 + ldrsh r0, [r0, r1] + ldr r1, [sp, 0xC] + lsls r1, 16 + asrs r1, 16 + bl sub_80A2584 + bl _0809EAE0 +_0809FA44: + add r0, sp, 0x8 + movs r2, 0x2 + ldrsh r0, [r0, r2] + mov r1, r9 + adds r1, 0x8 + bl sub_80A2558 + bl _0809EAE0 +_0809FA56: + add r0, sp, 0x8 + movs r3, 0x2 + ldrsh r0, [r0, r3] + mov r1, r9 + adds r1, 0xC + bl sub_80A2558 + bl _0809EAE0 +_0809FA68: + ldr r0, [sp, 0xC] + lsls r0, 16 + asrs r0, 16 + bl sub_80A7AE8 + lsls r0, 16 + add r1, sp, 0x98 + ldrh r2, [r1] + orrs r2, r0 + str r2, [r1] + cmp r2, 0 + blt _0809FA9C + ldr r0, _0809FA98 + ands r2, r0 + movs r0, 0x1 + orrs r2, r0 + str r2, [r1] + add r0, sp, 0x8 + movs r4, 0x2 + ldrsh r0, [r0, r4] + bl sub_80A2558 + bl _0809EAE0 + .align 2, 0 +_0809FA98: .4byte 0xffff0000 +_0809FA9C: + add r0, sp, 0x8 + movs r5, 0x2 + ldrsh r0, [r0, r5] + ldr r1, [sp, 0xC] + lsls r1, 16 + asrs r1, 16 + bl sub_80A2598 + bl _0809EAE0 +_0809FAB0: + ldr r0, [sp, 0xC] + lsls r0, 16 + asrs r0, 16 + bl sub_80A2740 + lsls r0, 24 + lsrs r1, r0, 24 + movs r4, 0 + ldr r0, [sp, 0xC] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + beq _0809FAD0 + cmp r0, 0x2 + beq _0809FAD4 + b _0809FAD8 +_0809FAD0: + movs r4, 0x1 + b _0809FAD8 +_0809FAD4: + movs r4, 0x1 + negs r4, r4 +_0809FAD8: + adds r0, r1, 0 + bl sub_8090298 + ldr r2, _0809FAF4 + add r1, sp, 0x8 + movs r3, 0x2 + ldrsh r1, [r1, r3] + lsls r1, 2 + adds r1, r2 + adds r0, r4 + str r0, [r1] + bl _0809EAE0 + .align 2, 0 +_0809FAF4: .4byte gUnknown_202DE30 +_0809FAF8: + add r0, sp, 0x8 + movs r4, 0x2 + ldrsh r0, [r0, r4] + ldr r1, [sp, 0xC] + lsls r1, 24 + asrs r1, 24 + add r2, sp, 0x8 + ldrb r2, [r2, 0x1] + bl sub_809AC7C + bl _0809EAE0 +_0809FB10: + ldr r0, [sp, 0xC] + add r1, sp, 0x9C + str r0, [r1] + ldr r0, [sp, 0x10] + str r0, [r1, 0x4] + add r0, sp, 0x8 + movs r5, 0x2 + ldrsh r0, [r0, r5] + bl sub_809ADD8 + bl _0809EAE0 +_0809FB28: + movs r1, 0 + ldrb r0, [r2] + subs r0, 0x32 + cmp r0, 0x6 + bhi _0809FBBE + lsls r0, 2 + ldr r1, _0809FB3C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_0809FB3C: .4byte _0809FB40 + .align 2, 0 +_0809FB40: + .4byte _0809FB5C + .4byte _0809FB6C + .4byte _0809FB7C + .4byte _0809FB8C + .4byte _0809FB9C + .4byte _0809FBAC + .4byte _0809FBB4 +_0809FB5C: + add r0, sp, 0x8 + movs r2, 0x2 + ldrsh r1, [r0, r2] + ldr r2, [sp, 0x14] + movs r0, 0 + bl sub_809AE90 + b _0809FBBA +_0809FB6C: + add r0, sp, 0x8 + movs r3, 0x2 + ldrsh r1, [r0, r3] + ldr r2, [sp, 0x14] + movs r0, 0x1 + bl sub_809AE90 + b _0809FBBA +_0809FB7C: + add r0, sp, 0x8 + movs r4, 0x2 + ldrsh r1, [r0, r4] + ldr r2, [sp, 0x14] + movs r0, 0x2 + bl sub_809AE90 + b _0809FBBA +_0809FB8C: + add r0, sp, 0x8 + movs r5, 0x2 + ldrsh r1, [r0, r5] + ldr r2, [sp, 0x14] + movs r0, 0x3 + bl sub_809AE90 + b _0809FBBA +_0809FB9C: + add r0, sp, 0x8 + movs r2, 0x2 + ldrsh r1, [r0, r2] + ldr r2, [sp, 0x14] + movs r0, 0x4 + bl sub_809AE90 + b _0809FBBA +_0809FBAC: + ldr r0, [sp, 0x14] + bl sub_809AEEC + b _0809FBBA +_0809FBB4: + ldr r0, [sp, 0x14] + bl sub_809AF2C +_0809FBBA: + lsls r0, 24 + lsrs r1, r0, 24 +_0809FBBE: + cmp r1, 0 + bne _0809FBC6 + bl _0809EAE0 +_0809FBC6: + movs r0, 0 + movs r1, 0xA + bl sub_80A87AC + mov r0, r9 + movs r1, 0 + bl sub_809D8EC + bl _080A130A +_0809FBDA: + add r0, sp, 0x8 + movs r3, 0x2 + ldrsh r0, [r0, r3] + ldr r1, [sp, 0x14] + bl sub_809AF6C + lsls r0, 24 + cmp r0, 0 + bne _0809FBF0 + bl _0809EAE0 +_0809FBF0: + add r0, sp, 0x8 + ldrh r0, [r0, 0x2] + lsls r0, 16 + cmp r0, 0 + bge _0809FBFE + bl _0809EAE0 +_0809FBFE: + movs r0, 0 + movs r1, 0xA + bl sub_80A87AC + mov r0, r9 + movs r1, 0 + bl sub_809D8EC + bl _080A130A +_0809FC12: + add r0, sp, 0x8 + ldrb r1, [r0, 0x1] + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + ldr r1, [sp, 0xC] + ldr r2, [sp, 0x10] + lsls r2, 16 + asrs r2, 16 + ldr r3, [sp, 0x14] + bl sub_809AFC8 + bl _080A1280 +_0809FC2E: + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + ldr r1, [sp, 0xC] + ldr r2, [sp, 0x10] + ldr r3, [sp, 0x14] + bl sub_809B1D4 + bl _080A1292 +_0809FC40: + movs r0, 0 + bl _080A0654 +_0809FC46: + ldr r0, [sp, 0xC] + lsls r0, 16 + asrs r1, r0, 16 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _0809FC90 + adds r0, r1, 0 + bl sub_80A8D54 + cmp r0, 0 + bne _0809FC62 + bl _0809EAE0 +_0809FC62: + movs r3, 0 + ldr r2, _0809FC8C + adds r5, r2, 0 + adds r4, r0, 0 + adds r4, 0x4C +_0809FC6C: + adds r0, r3, r5 + adds r1, r4, r3 + ldrb r1, [r1] + strb r1, [r0] + adds r3, 0x1 + cmp r3, 0x9 + ble _0809FC6C + movs r0, 0 + strb r0, [r2, 0xA] + movs r0, 0x4 + movs r1, 0 + bl sub_809B1C0 + bl _080A1292 + .align 2, 0 +_0809FC8C: .4byte gUnknown_2039D98 +_0809FC90: + ldr r2, _0809FCA0 + movs r0, 0x4 + movs r1, 0x1 + bl sub_809B1C0 + bl _080A1292 + .align 2, 0 +_0809FCA0: .4byte gUnknown_2039D98 +_0809FCA4: + ldr r4, _0809FCC0 + adds r0, r4, 0 + bl sub_80920B8 + movs r0, 0 + strb r0, [r4, 0xA] + movs r0, 0x5 + movs r1, 0 + adds r2, r4, 0 + bl sub_809B1C0 + bl _080A1292 + .align 2, 0 +_0809FCC0: .4byte gUnknown_2039D98 +_0809FCC4: + ldr r2, _0809FCE4 + adds r3, r2, 0 + movs r1, 0 + adds r0, r2, 0 + adds r0, 0xB +_0809FCCE: + strb r1, [r0] + subs r0, 0x1 + cmp r0, r3 + bge _0809FCCE + add r0, sp, 0x8 + ldrb r1, [r0, 0x1] + movs r0, 0x6 + bl sub_809B1C0 + bl _080A1292 + .align 2, 0 +_0809FCE4: .4byte gUnknown_2039D98 +_0809FCE8: + bl sub_80118A4 + bl _0809EAE0 +_0809FCF0: + add r0, sp, 0x8 + ldrh r0, [r0, 0x2] + lsls r0, 16 + cmp r0, 0 + blt _0809FD00 + add r0, sp, 0x8 + ldrh r0, [r0, 0x2] + b _0809FD02 +_0809FD00: + movs r0, 0x1E +_0809FD02: + bl sub_80118C4 + bl _0809EAE0 +_0809FD0A: + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + cmp r0, 0 + bne _0809FD1E + ldr r0, [sp, 0xC] + lsls r0, 16 + lsrs r0, 16 + bl sub_80A25AC + b _0809FD20 +_0809FD1E: + ldr r0, [sp, 0xC] +_0809FD20: + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, _0809FD34 + cmp r1, r0 + beq _0809FDA0 + adds r0, r1, 0 + bl sub_80118F0 + bl _0809EAE0 + .align 2, 0 +_0809FD34: .4byte 0x000003e7 +_0809FD38: + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + cmp r0, 0 + bne _0809FD4C + ldr r0, [sp, 0xC] + lsls r0, 16 + lsrs r0, 16 + bl sub_80A25AC + b _0809FD4E +_0809FD4C: + ldr r0, [sp, 0xC] +_0809FD4E: + lsls r0, 16 + lsrs r2, r0, 16 + ldr r0, _0809FD68 + cmp r2, r0 + beq _0809FDA0 + add r0, sp, 0x8 + ldrh r1, [r0, 0x2] + adds r0, r2, 0 + bl sub_8011900 + bl _0809EAE0 + .align 2, 0 +_0809FD68: .4byte 0x000003e7 +_0809FD6C: + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + cmp r0, 0 + bne _0809FD80 + ldr r0, [sp, 0xC] + lsls r0, 16 + lsrs r0, 16 + bl sub_80A25AC + b _0809FD82 +_0809FD80: + ldr r0, [sp, 0xC] +_0809FD82: + lsls r0, 16 + lsrs r1, r0, 16 + ldr r0, _0809FD9C + cmp r1, r0 + bne _0809FD90 + bl _0809EAE0 +_0809FD90: + adds r0, r1, 0 + bl sub_8011914 + bl _0809EAE0 + .align 2, 0 +_0809FD9C: .4byte 0x000003e7 +_0809FDA0: + bl sub_8011924 + bl _0809EAE0 +_0809FDA8: + add r0, sp, 0x8 + ldrh r0, [r0, 0x2] + lsls r0, 16 + cmp r0, 0 + blt _0809FDB8 + add r0, sp, 0x8 + ldrh r0, [r0, 0x2] + b _0809FDBA +_0809FDB8: + movs r0, 0x1E +_0809FDBA: + bl sub_8011930 + bl _0809EAE0 +_0809FDC2: + ldr r0, [sp, 0xC] + lsls r0, 16 + lsrs r0, 16 + movs r1, 0x80 + lsls r1, 1 + bl sub_8011974 + bl _0809EAE0 +_0809FDD4: + ldr r0, [sp, 0xC] + lsls r0, 16 + lsrs r0, 16 + bl sub_801199C + bl _0809EAE0 +_0809FDE2: + ldr r0, [sp, 0xC] + lsls r0, 16 + lsrs r2, r0, 16 + add r0, sp, 0x8 + ldrh r0, [r0, 0x2] + lsls r0, 16 + cmp r0, 0 + blt _0809FDF8 + add r0, sp, 0x8 + ldrh r1, [r0, 0x2] + b _0809FDFA +_0809FDF8: + movs r1, 0x1E +_0809FDFA: + adds r0, r2, 0 + bl sub_80119AC + bl _0809EAE0 +_0809FE04: + mov r1, r9 + adds r1, 0x84 + movs r5, 0 + ldrsh r0, [r1, r5] + cmp r0, 0x1 + bne _0809FE16 + adds r0, r1, 0 + bl sub_809D568 +_0809FE16: + mov r0, r9 + ldr r1, [r0] + ldr r0, [r0, 0x4] + ldr r2, [r1, 0x1C] + movs r1, 0 + bl _call_via_r2 + bl _0809EAE0 +_0809FE28: + mov r0, r9 + adds r0, 0xC + bl sub_809D52C + adds r4, r0, 0 + cmp r4, 0 + bne _0809FE3A + bl _0809EAE0 +_0809FE3A: + ldr r1, [r4] + mov r2, r9 + ldr r0, [r2, 0x4] + add r5, sp, 0xA4 + ldr r2, [r1, 0xC] + adds r1, r5, 0 + bl _call_via_r2 + ldr r1, [r4] + mov r3, r9 + ldr r0, [r3, 0x4] + mov r4, sp + adds r4, 0x4D + ldr r2, [r1, 0x14] + adds r1, r4, 0 + bl _call_via_r2 + mov r0, r9 + ldr r1, [r0] + ldr r0, [r0, 0x4] + ldr r2, [r1, 0x24] + adds r1, r5, 0 + bl _call_via_r2 + ldrb r0, [r4] + mov r1, r9 + adds r1, 0x4A + strb r0, [r1] + mov r1, r9 + ldr r2, [r1] + ldr r0, [r1, 0x4] + movs r1, 0 + ldrsb r1, [r4, r1] + ldr r2, [r2, 0x2C] + bl _call_via_r2 + bl _0809EAE0 +_0809FE86: + mov r2, r9 + ldr r1, [r2] + ldr r0, [r2, 0x4] + add r6, sp, 0xAC + ldr r2, [r1, 0xC] + adds r1, r6, 0 + bl _call_via_r2 + add r0, sp, 0x8 + movs r3, 0x2 + ldrsh r0, [r0, r3] + add r4, sp, 0xB4 + add r5, sp, 0xBC + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_80AD914 + mov r0, r9 + ldr r1, [r0] + ldr r0, [r0, 0x4] + ldr r3, [r1, 0x20] + adds r1, r4, 0 + adds r2, r5, 0 + bl _call_via_r3 + bl _0809EAE0 +_0809FEBE: + mov r1, r9 + ldr r2, [r1] + ldr r0, [r1, 0x4] + ldr r1, [sp, 0xC] + ldr r2, [r2, 0x3C] + bl _call_via_r2 + bl _0809EAE0 +_0809FED0: + ldr r0, [sp, 0xC] + movs r1, 0x80 + lsls r1, 3 + ands r0, r1 + cmp r0, 0 + beq _0809FEEE + mov r1, r9 + adds r1, 0x84 + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0x1 + bne _0809FEEE + adds r0, r1, 0 + bl sub_809D568 +_0809FEEE: + mov r3, r9 + ldr r2, [r3] + ldr r0, [r3, 0x4] + ldr r1, [sp, 0xC] + ldr r2, [r2, 0x40] + bl _call_via_r2 + bl _0809EAE0 +_0809FF00: + mov r4, r9 + ldr r2, [r4] + ldr r0, [r4, 0x4] + mov r1, r9 + adds r1, 0x4A + ldr r2, [r2, 0x14] + bl _call_via_r2 + add r0, sp, 0x8 + ldrh r1, [r0, 0x2] + cmp r1, 0 + beq _0809FF1E + mov r0, r9 + adds r0, 0x48 + strh r1, [r0] +_0809FF1E: + mov r5, r9 + ldr r2, [r5] + ldr r0, [r5, 0x4] + add r1, sp, 0x8 + ldrh r1, [r1, 0x2] + ldr r2, [r2, 0x30] + bl _call_via_r2 + bl _0809EAE0 +_0809FF32: + mov r0, r9 + ldr r2, [r0] + ldr r0, [r0, 0x4] + add r1, sp, 0x8 + ldrh r1, [r1, 0x2] + ldr r2, [r2, 0x34] + bl _call_via_r2 + bl _0809EAE0 +_0809FF46: + mov r1, r9 + ldr r3, [r1] + ldr r0, [r1, 0x4] + ldr r1, [sp, 0xC] + lsls r1, 16 + asrs r1, 16 + add r2, sp, 0x8 + movs r4, 0x2 + ldrsh r2, [r2, r4] + ldr r3, [r3, 0x38] + bl _call_via_r3 + bl _0809EAE0 +_0809FF62: + mov r5, r9 + ldr r2, [r5] + ldr r0, [r5, 0x4] + add r1, sp, 0x8 + movs r3, 0x2 + ldrsh r1, [r1, r3] + ldr r2, [r2, 0x44] + bl _call_via_r2 + bl _0809EAE0 +_0809FF78: + ldr r0, [sp, 0xC] + lsls r0, 8 + add r1, sp, 0xC4 + str r0, [r1] + ldr r0, [sp, 0x10] + lsls r0, 8 + str r0, [r1, 0x4] + mov r4, r9 + ldr r2, [r4] + ldr r0, [r4, 0x4] + ldr r2, [r2, 0x24] + bl _call_via_r2 + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + mov r5, r10 + b _080A05EA +_0809FF9A: + add r0, sp, 0x8 + movs r1, 0x2 + ldrsh r0, [r0, r1] + lsls r0, 8 + add r1, sp, 0xCC + str r0, [r1] + ldr r0, [sp, 0xC] + lsls r0, 8 + str r0, [r1, 0x4] + mov r3, r9 + ldr r2, [r3] + ldr r0, [r3, 0x4] + ldr r2, [r2, 0x48] + bl _call_via_r2 + b _080A0650 +_0809FFBA: + add r0, sp, 0x8 + movs r5, 0x2 + ldrsh r0, [r0, r5] + bl sub_800451C + lsls r0, 8 + add r4, sp, 0xD4 + str r0, [r4] + ldr r0, [sp, 0xC] + bl sub_800451C + lsls r0, 8 + str r0, [r4, 0x4] + mov r0, r9 + ldr r1, [r0] + ldr r0, [r0, 0x4] + ldr r2, [r1, 0x48] + adds r1, r4, 0 + bl _call_via_r2 + b _080A07B4 +_0809FFE4: + mov r2, r9 + ldr r1, [r2] + ldr r0, [r2, 0x4] + add r4, sp, 0xDC + ldr r2, [r1, 0xC] + adds r1, r4, 0 + bl _call_via_r2 + ldr r0, [sp, 0xC] + lsls r0, 16 + asrs r0, 16 + adds r1, r4, 0 + bl sub_80AD8B4 + mov r3, r9 + ldr r1, [r3] + ldr r0, [r3, 0x4] + ldr r2, [r1, 0x24] + adds r1, r4, 0 + bl _call_via_r2 + b _080A0650 +_080A0010: + mov r5, r9 + ldr r1, [r5] + ldr r0, [r5, 0x4] + add r6, sp, 0xE4 + ldr r2, [r1, 0xC] + adds r1, r6, 0 + bl _call_via_r2 + ldr r0, [sp, 0xC] + lsls r0, 16 + asrs r0, 16 + add r4, sp, 0xEC + add r5, sp, 0xF4 + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_80AD914 + ldr r0, [r5] + ldr r1, [r4] + subs r0, r1 + bl sub_800451C + ldr r1, [r4] + adds r1, r0 + str r1, [r6] + ldr r0, [r5, 0x4] + ldr r1, [r4, 0x4] + subs r0, r1 + bl sub_800451C + ldr r1, [r4, 0x4] + adds r1, r0 + str r1, [r6, 0x4] + mov r0, r9 + ldr r1, [r0] + ldr r0, [r0, 0x4] + ldr r2, [r1, 0x24] + adds r1, r6, 0 + bl _call_via_r2 + b _080A07B4 +_080A0064: + ldr r0, [sp, 0xC] + lsls r0, 16 + asrs r0, 16 + bl sub_80A7AE8 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _080A007A + bl _0809EAE0 +_080A007A: + add r4, sp, 0xFC + adds r1, r4, 0 + bl sub_80A8FD8 + mov r2, r9 + ldr r1, [r2] + ldr r0, [r2, 0x4] + ldr r2, [r1, 0x24] + adds r1, r4, 0 + bl _call_via_r2 + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + b _080A03F0 +_080A0096: + ldr r2, [sp, 0xC] + lsls r2, 16 + lsrs r2, 16 + movs r0, 0 + movs r1, 0x32 + bl sub_8001784 + add r5, sp, 0x104 + str r0, [r5] + ldr r2, [sp, 0xC] + lsls r2, 16 + lsrs r2, 16 + movs r0, 0 + movs r1, 0x33 + bl sub_8001784 + str r0, [r5, 0x4] + ldr r2, [sp, 0xC] + lsls r2, 16 + lsrs r2, 16 + movs r0, 0 + movs r1, 0x34 + bl sub_8001784 + adds r6, r0, 0 + ldr r2, [sp, 0xC] + lsls r2, 16 + lsrs r2, 16 + movs r0, 0 + movs r1, 0x35 + bl sub_8001784 + adds r4, r0, 0 + lsls r4, 24 + asrs r4, 24 + mov r0, r9 + ldr r1, [r0] + ldr r0, [r0, 0x4] + ldr r2, [r1, 0x24] + adds r1, r5, 0 + bl _call_via_r2 + mov r2, r9 + ldr r1, [r2] + ldr r0, [r2, 0x4] + ldr r2, [r1, 0x28] + adds r1, r6, 0 + bl _call_via_r2 + mov r0, r9 + adds r0, 0x4A + strb r4, [r0] + mov r3, r9 + ldr r1, [r3] + ldr r0, [r3, 0x4] + ldr r2, [r1, 0x2C] + adds r1, r4, 0 + bl _call_via_r2 + b _080A0650 +_080A010E: + mov r5, r9 + ldr r1, [r5] + ldr r0, [r5, 0x4] + add r4, sp, 0x10C + ldr r2, [r1, 0xC] + adds r1, r4, 0 + bl _call_via_r2 + ldr r3, [r5] + ldr r0, [r5, 0x4] + add r1, sp, 0x114 + add r2, sp, 0x118 + ldr r3, [r3, 0x10] + bl _call_via_r3 + ldr r1, [r5] + ldr r0, [r5, 0x4] + mov r5, sp + adds r5, 0x4E + ldr r2, [r1, 0x14] + adds r1, r5, 0 + bl _call_via_r2 + ldr r2, [sp, 0xC] + lsls r2, 16 + lsrs r2, 16 + add r0, sp, 0x10C + ldr r3, [r0] + movs r0, 0 + movs r1, 0x32 + bl sub_800199C + ldr r2, [sp, 0xC] + lsls r2, 16 + lsrs r2, 16 + ldr r3, [r4, 0x4] + movs r0, 0 + movs r1, 0x33 + bl sub_800199C + ldr r2, [sp, 0xC] + lsls r2, 16 + lsrs r2, 16 + add r0, sp, 0x114 + ldr r3, [r0] + movs r0, 0 + movs r1, 0x34 + bl sub_800199C + ldr r2, [sp, 0xC] + lsls r2, 16 + lsrs r2, 16 + movs r3, 0 + ldrsb r3, [r5, r3] + movs r0, 0 + movs r1, 0x35 + bl sub_800199C + bl _0809EAE0 +_080A0186: + mov r0, r9 + ldr r2, [r0] + ldr r0, [r0, 0x4] + ldr r1, [sp, 0xC] + lsls r1, 8 + ldr r2, [r2, 0x28] + bl _call_via_r2 + b _080A07B4 +_080A0198: + ldr r0, [sp, 0xC] + lsls r0, 8 + mov r2, r10 + str r0, [r2, 0x3C] + ldr r0, [sp, 0x10] + lsls r0, 8 + str r0, [r2, 0x40] + add r0, sp, 0x8 + movs r3, 0x2 + ldrsh r0, [r0, r3] + str r0, [r2, 0x30] + ldr r0, _080A01B4 + bl _080A12AE + .align 2, 0 +_080A01B4: .4byte 0x0000ffff +_080A01B8: + mov r4, r9 + ldr r1, [r4] + ldr r0, [r4, 0x4] + add r4, sp, 0x11C + ldr r2, [r1, 0xC] + adds r1, r4, 0 + bl _call_via_r2 + ldr r1, [sp, 0xC] + lsls r1, 8 + add r0, sp, 0x11C + ldr r0, [r0] + adds r0, r1 + mov r5, r10 + str r0, [r5, 0x3C] + ldr r1, [sp, 0x10] + lsls r1, 8 + ldr r0, [r4, 0x4] + adds r0, r1 + str r0, [r5, 0x40] + add r0, sp, 0x8 + movs r1, 0x2 + ldrsh r0, [r0, r1] + str r0, [r5, 0x30] + ldr r0, _080A01EC + b _080A05EA + .align 2, 0 +_080A01EC: .4byte 0x0000ffff +_080A01F0: + mov r2, r9 + ldr r1, [r2] + ldr r0, [r2, 0x4] + mov r4, r10 + adds r4, 0x3C + ldr r2, [r1, 0xC] + adds r1, r4, 0 + bl _call_via_r2 + ldr r0, [sp, 0xC] + lsls r0, 16 + asrs r0, 16 + adds r1, r4, 0 + bl sub_80AD8B4 + add r0, sp, 0x8 + movs r3, 0x2 + ldrsh r0, [r0, r3] + mov r4, r10 + str r0, [r4, 0x30] + ldr r0, _080A021C + b _080A0656 + .align 2, 0 +_080A021C: .4byte 0x0000ffff +_080A0220: + mov r5, r9 + ldr r1, [r5] + ldr r0, [r5, 0x4] + mov r4, r10 + adds r4, 0x3C + ldr r2, [r1, 0xC] + adds r1, r4, 0 + bl _call_via_r2 + ldr r0, [sp, 0xC] + lsls r0, 16 + asrs r0, 16 + adds r1, r4, 0 + bl sub_80AD8B4 + add r0, sp, 0x8 + movs r1, 0x2 + ldrsh r0, [r0, r1] + mov r2, r10 + str r0, [r2, 0x30] + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + bl _080A12AE +_080A0250: + mov r3, r9 + ldr r1, [r3] + ldr r0, [r3, 0x4] + mov r4, r10 + adds r4, 0x3C + ldr r2, [r1, 0xC] + adds r1, r4, 0 + bl _call_via_r2 + ldr r0, [sp, 0xC] + lsls r0, 16 + asrs r0, 16 + adds r1, r4, 0 + bl sub_80AD8B4 + add r0, sp, 0x8 + movs r4, 0x2 + ldrsh r0, [r0, r4] + mov r5, r10 + str r0, [r5, 0x30] + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + bl sub_800451C + b _080A05EA +_080A0282: + ldr r0, [sp, 0xC] + lsls r0, 16 + asrs r0, 16 + bl sub_80A7AE8 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _080A0298 + bl _0809EAE0 +_080A0298: + mov r1, r10 + adds r1, 0x3C + bl sub_80A8FD8 + add r0, sp, 0x8 + movs r1, 0x2 + ldrsh r0, [r0, r1] + mov r2, r10 + str r0, [r2, 0x30] + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + bl _080A12AE +_080A02B2: + mov r3, r9 + ldr r2, [r3] + ldr r0, [r3, 0x4] + mov r1, r10 + adds r1, 0x34 + ldr r2, [r2, 0xC] + bl _call_via_r2 + ldr r0, [sp, 0xC] + lsls r1, r0, 8 + mov r4, r10 + str r1, [r4, 0x3C] + ldr r0, [sp, 0x10] + lsls r2, r0, 8 + str r2, [r4, 0x40] + add r0, sp, 0x8 + ldrb r0, [r0] + cmp r0, 0x7D + beq _080A02DC + cmp r0, 0x83 + bne _080A0304 +_080A02DC: + mov r5, r10 + ldr r0, [r5, 0x34] + subs r0, r1, r0 + ldr r1, [r5, 0x38] + subs r1, r2, r1 + bl sub_8009FB8 + add r1, sp, 0x8 + movs r2, 0x2 + ldrsh r1, [r1, r2] + bl __divsi3 + strh r0, [r5, 0x2A] + lsls r0, 16 + cmp r0, 0 + ble _080A0300 + bl _0809F0C4 +_080A0300: + movs r0, 0x1 + b _080A05EA +_080A0304: + add r0, sp, 0x8 + ldrh r0, [r0, 0x2] + mov r3, r10 + strh r0, [r3, 0x2A] + bl _0809F0C4 +_080A0310: + mov r4, r9 + ldr r2, [r4] + ldr r0, [r4, 0x4] + mov r1, r10 + adds r1, 0x34 + ldr r2, [r2, 0xC] + bl _call_via_r2 + ldr r0, [sp, 0xC] + lsls r0, 8 + mov r5, r10 + ldr r4, [r5, 0x34] + adds r3, r4, r0 + str r3, [r5, 0x3C] + ldr r0, [sp, 0x10] + lsls r0, 8 + ldr r2, [r5, 0x38] + adds r1, r2, r0 + str r1, [r5, 0x40] + add r0, sp, 0x8 + ldrb r0, [r0] + cmp r0, 0x7E + beq _080A0342 + cmp r0, 0x84 + bne _080A036A +_080A0342: + subs r0, r3, r4 + subs r1, r2 + bl sub_8009FB8 + add r1, sp, 0x8 + movs r2, 0x2 + ldrsh r1, [r1, r2] + bl __divsi3 + mov r3, r10 + strh r0, [r3, 0x2A] + lsls r0, 16 + cmp r0, 0 + ble _080A0362 + bl _0809F0C4 +_080A0362: + movs r0, 0x1 + strh r0, [r3, 0x2A] + bl _0809F0C4 +_080A036A: + add r0, sp, 0x8 + ldrh r0, [r0, 0x2] + b _080A0654 +_080A0370: + ldr r4, [sp, 0xC] + lsls r4, 1 + subs r4, 0x1 + ldr r5, [sp, 0x10] + lsls r5, 1 + subs r5, 0x1 + mov r0, r9 + ldr r2, [r0] + ldr r0, [r0, 0x4] + mov r1, r10 + adds r1, 0x34 + ldr r2, [r2, 0xC] + bl _call_via_r2 + adds r0, r4, 0 + bl sub_800451C + add r1, sp, 0x8 + movs r2, 0x2 + ldrsh r1, [r1, r2] + subs r0, r1 + lsls r0, 8 + mov r3, r10 + ldr r1, [r3, 0x34] + adds r1, r0 + str r1, [r3, 0x3C] + adds r0, r5, 0 + bl sub_800451C + ldr r1, [sp, 0xC] + subs r0, r1 + lsls r0, 8 + mov r4, r10 + ldr r3, [r4, 0x38] + adds r2, r3, r0 + str r2, [r4, 0x40] + add r0, sp, 0x8 + ldrb r0, [r0] + cmp r0, 0x7F + beq _080A03C4 + cmp r0, 0x85 + bne _080A03EC +_080A03C4: + mov r5, r10 + ldr r0, [r5, 0x3C] + ldr r1, [r5, 0x34] + subs r0, r1 + subs r1, r2, r3 + bl sub_8009FB8 + add r1, sp, 0x8 + movs r2, 0x2 + ldrsh r1, [r1, r2] + bl __divsi3 + strh r0, [r5, 0x2A] + lsls r0, 16 + cmp r0, 0 + ble _080A03E8 + bl _0809F0C4 +_080A03E8: + movs r0, 0x1 + b _080A05EA +_080A03EC: + add r0, sp, 0x8 + ldrh r0, [r0, 0x2] +_080A03F0: + mov r3, r10 + strh r0, [r3, 0x2A] + bl _0809F0C4 +_080A03F8: + mov r4, r9 + ldr r2, [r4] + ldr r0, [r4, 0x4] + mov r1, r10 + adds r1, 0x34 + ldr r2, [r2, 0xC] + bl _call_via_r2 + mov r5, r10 + ldr r0, [r5, 0x34] + ldr r1, [r5, 0x38] + mov r2, r10 + str r0, [r2, 0x3C] + str r1, [r2, 0x40] + ldr r0, [sp, 0xC] + lsls r0, 16 + asrs r0, 16 + mov r1, r10 + adds r1, 0x3C + bl sub_80AD8B4 + add r0, sp, 0x8 + ldrb r0, [r0] + cmp r0, 0x80 + beq _080A042E + cmp r0, 0x86 + bne _080A045C +_080A042E: + mov r3, r10 + ldr r0, [r3, 0x3C] + ldr r1, [r3, 0x34] + subs r0, r1 + ldr r1, [r3, 0x40] + ldr r2, [r3, 0x38] + subs r1, r2 + bl sub_8009FB8 + add r1, sp, 0x8 + movs r4, 0x2 + ldrsh r1, [r1, r4] + bl __divsi3 + mov r5, r10 + strh r0, [r5, 0x2A] + lsls r0, 16 + cmp r0, 0 + ble _080A0458 + bl _0809F0C4 +_080A0458: + movs r0, 0x1 + b _080A05EA +_080A045C: + add r0, sp, 0x8 + ldrh r0, [r0, 0x2] + b _080A07B8 +_080A0462: + ldr r4, [sp, 0xC] + lsls r4, 1 + subs r4, 0x1 + mov r2, r9 + ldr r1, [r2] + ldr r0, [r2, 0x4] + mov r5, r10 + adds r5, 0x3C + ldr r2, [r1, 0xC] + adds r1, r5, 0 + bl _call_via_r2 + ldr r0, [sp, 0x10] + lsls r0, 16 + asrs r0, 16 + adds r1, r5, 0 + bl sub_80AD8B4 + adds r0, r4, 0 + bl sub_800451C + add r1, sp, 0x8 + movs r3, 0x2 + ldrsh r1, [r1, r3] + subs r0, r1 + lsls r0, 8 + mov r5, r10 + ldr r1, [r5, 0x3C] + adds r1, r0 + str r1, [r5, 0x3C] + adds r0, r4, 0 + bl sub_800451C + add r1, sp, 0x8 + movs r2, 0x2 + ldrsh r1, [r1, r2] + subs r0, r1 + lsls r0, 8 + ldr r1, [r5, 0x40] + adds r2, r1, r0 + str r2, [r5, 0x40] + add r0, sp, 0x8 + ldrb r0, [r0] + cmp r0, 0x81 + beq _080A04C0 + cmp r0, 0x87 + bne _080A04EC +_080A04C0: + mov r3, r10 + ldr r0, [r3, 0x3C] + ldr r1, [r3, 0x34] + subs r0, r1 + ldr r1, [r3, 0x38] + subs r1, r2, r1 + bl sub_8009FB8 + add r1, sp, 0x8 + movs r4, 0x2 + ldrsh r1, [r1, r4] + bl __divsi3 + mov r5, r10 + strh r0, [r5, 0x2A] + lsls r0, 16 + cmp r0, 0 + ble _080A04E8 + bl _0809F0C4 +_080A04E8: + movs r0, 0x1 + b _080A05EA +_080A04EC: + add r0, sp, 0x8 + ldrh r0, [r0, 0x2] + b _080A07B8 +_080A04F2: + ldr r0, [sp, 0xC] + lsls r0, 16 + asrs r0, 16 + bl sub_80A7AE8 + lsls r0, 16 + asrs r4, r0, 16 + cmp r4, 0 + bge _080A0508 + bl _0809EAE0 +_080A0508: + mov r3, r9 + ldr r2, [r3] + ldr r0, [r3, 0x4] + mov r1, r10 + adds r1, 0x34 + ldr r2, [r2, 0xC] + bl _call_via_r2 + mov r1, r10 + adds r1, 0x3C + adds r0, r4, 0 + bl sub_80A8FD8 + add r0, sp, 0x8 + ldrb r0, [r0] + cmp r0, 0x82 + beq _080A052E + cmp r0, 0x88 + bne _080A055A +_080A052E: + mov r4, r10 + ldr r0, [r4, 0x3C] + ldr r1, [r4, 0x34] + subs r0, r1 + ldr r1, [r4, 0x40] + ldr r2, [r4, 0x38] + subs r1, r2 + bl sub_8009FB8 + add r1, sp, 0x8 + movs r5, 0x2 + ldrsh r1, [r1, r5] + bl __divsi3 + strh r0, [r4, 0x2A] + lsls r0, 16 + cmp r0, 0 + ble _080A0556 + bl _0809F0C4 +_080A0556: + movs r0, 0x1 + b _080A0656 +_080A055A: + add r0, sp, 0x8 + ldrh r0, [r0, 0x2] + b _080A07B8 +_080A0560: + ldr r0, [sp, 0xC] + lsls r0, 8 + mov r2, r10 + str r0, [r2, 0x48] + add r0, sp, 0x8 + movs r3, 0x2 + ldrsh r0, [r0, r3] + str r0, [r2, 0x30] + ldr r0, _080A0578 + bl _080A12AE + .align 2, 0 +_080A0578: .4byte 0x0000ffff +_080A057C: + ldr r1, [sp, 0xC] + mov r0, r9 + adds r0, 0x4A + strb r1, [r0] + mov r4, r9 + ldr r2, [r4] + ldr r0, [r4, 0x4] + lsls r1, 24 + asrs r1, 24 + ldr r2, [r2, 0x2C] + bl _call_via_r2 + add r0, sp, 0x8 + movs r5, 0x2 + ldrsh r0, [r0, r5] + mov r1, r10 + str r0, [r1, 0x30] + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + b _080A07BA +_080A05A4: + mov r2, r9 + ldr r1, [r2] + ldr r0, [r2, 0x4] + mov r4, sp + adds r4, 0x4F + ldr r2, [r1, 0x14] + adds r1, r4, 0 + bl _call_via_r2 + movs r0, 0 + ldrsb r0, [r4, r0] + ldr r1, [sp, 0xC] + lsls r1, 24 + lsrs r1, 24 + bl sub_8002984 + mov r1, r9 + adds r1, 0x4A + strb r0, [r1] + mov r3, r9 + ldr r2, [r3] + ldr r0, [r3, 0x4] + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + ldr r2, [r2, 0x2C] + bl _call_via_r2 + add r0, sp, 0x8 + movs r4, 0x2 + ldrsh r0, [r0, r4] + mov r5, r10 + str r0, [r5, 0x30] + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] +_080A05EA: + strh r0, [r5, 0x2A] + bl _0809F0C4 +_080A05F0: + add r0, sp, 0x8 + ldrh r0, [r0, 0x2] + mov r1, r9 + adds r1, 0x4A + strb r0, [r1] + mov r0, r9 + ldr r2, [r0] + ldr r0, [r0, 0x4] +_080A0600: + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + ldr r2, [r2, 0x2C] + bl _call_via_r2 + b _080A07B4 +_080A060E: + ldr r0, [sp, 0xC] + lsls r0, 16 + asrs r0, 16 + bl sub_80A7AE8 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + blt _080A0650 + add r4, sp, 0x50 + adds r1, r4, 0 + bl sub_80A9050 + movs r0, 0 + ldrsb r0, [r4, r0] + add r1, sp, 0x8 + ldrh r1, [r1, 0x2] + lsls r1, 24 + lsrs r1, 24 + bl sub_8002984 + mov r1, r9 + adds r1, 0x4A + strb r0, [r1] + mov r3, r9 + ldr r2, [r3] + ldr r0, [r3, 0x4] + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + ldr r2, [r2, 0x2C] + bl _call_via_r2 +_080A0650: + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] +_080A0654: + mov r4, r10 +_080A0656: + strh r0, [r4, 0x2A] + bl _0809F0C4 +_080A065C: + mov r5, r9 + ldr r1, [r5] + ldr r0, [r5, 0x4] + mov r4, sp + adds r4, 0x51 + ldr r2, [r1, 0x14] + adds r1, r4, 0 + bl _call_via_r2 + movs r0, 0 + ldrsb r0, [r4, r0] + add r1, sp, 0x8 + ldrh r1, [r1, 0x2] + lsls r1, 24 + lsrs r1, 24 + bl sub_8002984 + mov r1, r9 + adds r1, 0x4A + strb r0, [r1] + ldr r2, [r5] + ldr r0, [r5, 0x4] + b _080A0600 +_080A068A: + movs r5, 0 + add r0, sp, 0x8 + ldrb r0, [r0] + cmp r0, 0x8F + beq _080A06CA + cmp r0, 0x8F + bgt _080A069E + cmp r0, 0x8E + beq _080A06A4 + b _080A0724 +_080A069E: + cmp r0, 0x90 + beq _080A06F8 + b _080A0724 +_080A06A4: + ldr r0, [sp, 0xC] + lsls r0, 16 + asrs r0, 16 + bl sub_80A7AE8 + lsls r0, 16 + asrs r4, r0, 16 + cmp r4, 0 + blt _080A0724 + movs r5, 0x1 + add r1, sp, 0x124 + adds r0, r4, 0 + bl sub_80A8FD8 + add r1, sp, 0x12C + adds r0, r4, 0 + bl sub_80A8F9C + b _080A0724 +_080A06CA: + ldr r0, [sp, 0xC] + lsls r0, 16 + asrs r0, 16 + bl sub_80A7AE8 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + blt _080A0724 + movs r5, 0x1 + add r1, sp, 0x124 + bl sub_80A8FD8 + ldr r0, _080A06F4 + ldr r1, [r0, 0x4] + ldr r0, [r0] + add r2, sp, 0x12C + str r0, [r2] + str r1, [r2, 0x4] + b _080A0724 + .align 2, 0 +_080A06F4: .4byte gUnknown_81164DC +_080A06F8: + movs r5, 0x1 + mov r2, r9 + ldr r1, [r2] + ldr r0, [r2, 0x4] + add r4, sp, 0x124 + ldr r2, [r1, 0xC] + adds r1, r4, 0 + bl _call_via_r2 + mov r3, r9 + ldr r2, [r3] + ldr r0, [r3, 0x4] + add r1, sp, 0x12C + ldr r2, [r2, 0x8] + bl _call_via_r2 + ldr r0, [sp, 0xC] + lsls r0, 16 + asrs r0, 16 + adds r1, r4, 0 + bl sub_80AD8B4 +_080A0724: + cmp r5, 0 + beq _080A07B4 + mov r4, r9 + ldr r1, [r4] + ldr r0, [r4, 0x4] + add r5, sp, 0x134 + ldr r2, [r1, 0xC] + adds r1, r5, 0 + bl _call_via_r2 + ldr r1, [r4] + ldr r0, [r4, 0x4] + add r4, sp, 0x13C + ldr r2, [r1, 0x8] + adds r1, r4, 0 + bl _call_via_r2 + add r7, sp, 0x124 + add r3, sp, 0x12C + adds r0, r5, 0 + adds r1, r4, 0 + adds r2, r7, 0 + bl sub_8002DF0 + mov r1, sp + adds r1, 0x52 + strb r0, [r1] + movs r0, 0x1 + negs r0, r0 + movs r4, 0 + ldrsb r4, [r1, r4] + adds r6, r1, 0 + cmp r4, r0 + bne _080A078C + ldr r3, _080A07C0 + adds r0, r5, 0 + adds r1, r3, 0 + adds r2, r7, 0 + bl sub_8002D54 + strb r0, [r6] + movs r0, 0 + ldrsb r0, [r6, r0] + cmp r0, r4 + bne _080A078C + mov r5, r9 + ldr r1, [r5] + ldr r0, [r5, 0x4] + ldr r2, [r1, 0x14] + adds r1, r6, 0 + bl _call_via_r2 +_080A078C: + movs r0, 0 + ldrsb r0, [r6, r0] + add r1, sp, 0x8 + ldrh r1, [r1, 0x2] + lsls r1, 24 + lsrs r1, 24 + bl sub_8002984 + mov r1, r9 + adds r1, 0x4A + strb r0, [r1] + mov r0, r9 + ldr r2, [r0] + ldr r0, [r0, 0x4] + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + ldr r2, [r2, 0x2C] + bl _call_via_r2 +_080A07B4: + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] +_080A07B8: + mov r1, r10 +_080A07BA: + strh r0, [r1, 0x2A] + bl _0809F0C4 + .align 2, 0 +_080A07C0: .4byte gUnknown_81164DC +_080A07C4: + movs r0, 0 + bl _080A12AC +_080A07CA: + ldr r0, [sp, 0xC] + mov r1, r9 + adds r1, 0x71 + movs r2, 0 + strb r0, [r1] + mov r3, r10 + strh r2, [r3, 0x2A] + bl _0809F0C4 +_080A07DC: + mov r4, r9 + ldr r1, [r4] + ldr r0, [r4, 0x4] + mov r4, sp + adds r4, 0x53 + ldr r2, [r1, 0x14] + adds r1, r4, 0 + bl _call_via_r2 + movs r0, 0 + ldrsb r0, [r4, r0] + ldr r1, [sp, 0xC] + lsls r1, 24 + lsrs r1, 24 + bl sub_8002984 + mov r1, r9 + adds r1, 0x71 + movs r2, 0 + strb r0, [r1] + mov r5, r10 + strh r2, [r5, 0x2A] + bl _0809F0C4 +_080A080C: + add r0, sp, 0x8 + movs r1, 0x2 + ldrsh r0, [r0, r1] + ldr r1, [sp, 0xC] + ldr r2, [sp, 0x10] + bl sub_809D124 + bl _0809EAE0 +_080A081E: + mov r2, r9 + ldr r1, [r2] + ldr r0, [r2, 0x4] + ldr r1, [r1, 0x4] + bl _call_via_r1 + lsls r0, 16 + asrs r1, r0, 16 + mov r3, r9 + movs r4, 0x8 + ldrsh r0, [r3, r4] + cmp r0, 0x2 + beq _080A0856 + cmp r0, 0x2 + bgt _080A0844 + cmp r0, 0x1 + beq _080A084C + bl _0809EAE0 +_080A0844: + cmp r0, 0x3 + beq _080A0860 + bl _0809EAE0 +_080A084C: + movs r0, 0x1 + bl sub_809D170 + bl _0809EAE0 +_080A0856: + movs r0, 0x2 + bl sub_809D170 + bl _0809EAE0 +_080A0860: + movs r0, 0x3 + bl sub_809D170 + bl _0809EAE0 +_080A086A: + mov r5, r9 + ldr r1, [r5] + ldr r0, [r5, 0x4] + ldr r1, [r1, 0x4] + bl _call_via_r1 + lsls r0, 16 + asrs r0, 16 + movs r2, 0x8 + ldrsh r1, [r5, r2] + cmp r1, 0x2 + beq _080A08A0 + cmp r1, 0x2 + bgt _080A088E + cmp r1, 0x1 + beq _080A0896 + bl _0809EAE0 +_080A088E: + cmp r1, 0x3 + beq _080A08AA + bl _0809EAE0 +_080A0896: + add r4, sp, 0x144 + adds r1, r4, 0 + bl sub_80A8FD8 + b _080A08B2 +_080A08A0: + add r4, sp, 0x144 + adds r1, r4, 0 + bl sub_80AC448 + b _080A08B2 +_080A08AA: + add r4, sp, 0x144 + adds r1, r4, 0 + bl sub_80AD360 +_080A08B2: + movs r0, 0 + adds r1, r4, 0 + bl sub_809D158 + bl _0809EAE0 +_080A08BE: + movs r0, 0x1 + movs r1, 0 + bl sub_809D170 + bl _0809EAE0 +_080A08CA: + mov r3, r9 + ldr r1, [r3] + ldr r0, [r3, 0x4] + ldr r1, [r1, 0x4] + bl _call_via_r1 + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0 + bge _080A08E2 + bl _0809EAE0 +_080A08E2: + mov r4, r9 + movs r5, 0x8 + ldrsh r0, [r4, r5] + cmp r0, 0x2 + beq _080A090A + cmp r0, 0x2 + bgt _080A08F8 + cmp r0, 0x1 + beq _080A0900 + bl _0809EAE0 +_080A08F8: + cmp r0, 0x3 + beq _080A0914 + bl _0809EAE0 +_080A0900: + add r0, sp, 0x8 + movs r3, 0x2 + ldrsh r2, [r0, r3] + movs r0, 0x1 + b _080A0990 +_080A090A: + add r0, sp, 0x8 + movs r4, 0x2 + ldrsh r2, [r0, r4] + movs r0, 0x2 + b _080A0990 +_080A0914: + add r0, sp, 0x8 + movs r5, 0x2 + ldrsh r2, [r0, r5] + movs r0, 0x3 + b _080A0990 +_080A091E: + mov r0, r9 + ldr r1, [r0] + ldr r0, [r0, 0x4] + ldr r1, [r1, 0x4] + bl _call_via_r1 + lsls r0, 16 + asrs r0, 16 + mov r2, r9 + movs r3, 0x8 + ldrsh r1, [r2, r3] + cmp r1, 0x2 + beq _080A095C + cmp r1, 0x2 + bgt _080A0944 + cmp r1, 0x1 + beq _080A094C + bl _0809EAE0 +_080A0944: + cmp r1, 0x3 + beq _080A096C + bl _0809EAE0 +_080A094C: + add r4, sp, 0x14C + adds r1, r4, 0 + bl sub_80A8FD8 + add r0, sp, 0x8 + movs r5, 0x2 + ldrsh r2, [r0, r5] + b _080A097A +_080A095C: + add r4, sp, 0x14C + adds r1, r4, 0 + bl sub_80AC448 + add r0, sp, 0x8 + movs r1, 0x2 + ldrsh r2, [r0, r1] + b _080A097A +_080A096C: + add r4, sp, 0x14C + adds r1, r4, 0 + bl sub_80AD360 + add r0, sp, 0x8 + movs r3, 0x2 + ldrsh r2, [r0, r3] +_080A097A: + movs r0, 0 + adds r1, r4, 0 + bl sub_809D190 + bl _0809F0C4 +_080A0986: + add r0, sp, 0x8 + movs r4, 0x2 + ldrsh r2, [r0, r4] + movs r0, 0x1 + movs r1, 0 +_080A0990: + bl sub_809D1A8 + bl _0809F0C4 +_080A0998: + mov r5, r9 + ldr r1, [r5] + ldr r0, [r5, 0x4] + ldr r1, [r1, 0x4] + bl _call_via_r1 + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0 + bge _080A09B0 + bl _0809EAE0 +_080A09B0: + movs r2, 0x8 + ldrsh r0, [r5, r2] + cmp r0, 0x2 + beq _080A09D6 + cmp r0, 0x2 + bgt _080A09C4 + cmp r0, 0x1 + beq _080A09CC + bl _0809EAE0 +_080A09C4: + cmp r0, 0x3 + beq _080A09E0 + bl _0809EAE0 +_080A09CC: + add r0, sp, 0x8 + movs r3, 0x2 + ldrsh r2, [r0, r3] + movs r0, 0x1 + b _080A0A5C +_080A09D6: + add r0, sp, 0x8 + movs r4, 0x2 + ldrsh r2, [r0, r4] + movs r0, 0x2 + b _080A0A5C +_080A09E0: + add r0, sp, 0x8 + movs r5, 0x2 + ldrsh r2, [r0, r5] + movs r0, 0x3 + b _080A0A5C +_080A09EA: + mov r0, r9 + ldr r1, [r0] + ldr r0, [r0, 0x4] + ldr r1, [r1, 0x4] + bl _call_via_r1 + lsls r0, 16 + asrs r0, 16 + mov r2, r9 + movs r3, 0x8 + ldrsh r1, [r2, r3] + cmp r1, 0x2 + beq _080A0A28 + cmp r1, 0x2 + bgt _080A0A10 + cmp r1, 0x1 + beq _080A0A18 + bl _0809EAE0 +_080A0A10: + cmp r1, 0x3 + beq _080A0A38 + bl _0809EAE0 +_080A0A18: + add r4, sp, 0x154 + adds r1, r4, 0 + bl sub_80A8FD8 + add r0, sp, 0x8 + movs r5, 0x2 + ldrsh r2, [r0, r5] + b _080A0A46 +_080A0A28: + add r4, sp, 0x154 + adds r1, r4, 0 + bl sub_80AC448 + add r0, sp, 0x8 + movs r1, 0x2 + ldrsh r2, [r0, r1] + b _080A0A46 +_080A0A38: + add r4, sp, 0x154 + adds r1, r4, 0 + bl sub_80AD360 + add r0, sp, 0x8 + movs r3, 0x2 + ldrsh r2, [r0, r3] +_080A0A46: + movs r0, 0 + adds r1, r4, 0 + bl sub_809D1CC + bl _0809F0C4 +_080A0A52: + add r0, sp, 0x8 + movs r4, 0x2 + ldrsh r2, [r0, r4] + movs r0, 0x1 + movs r1, 0 +_080A0A5C: + bl sub_809D1E4 + bl _0809F0C4 +_080A0A64: + mov r5, r9 + ldr r1, [r5] + ldr r0, [r5, 0x4] + ldr r1, [r1, 0x4] + bl _call_via_r1 + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0 + bge _080A0A7C + bl _0809EAE0 +_080A0A7C: + movs r2, 0x8 + ldrsh r0, [r5, r2] + cmp r0, 0x2 + beq _080A0AA2 + cmp r0, 0x2 + bgt _080A0A90 + cmp r0, 0x1 + beq _080A0A98 + bl _0809EAE0 +_080A0A90: + cmp r0, 0x3 + beq _080A0AAC + bl _0809EAE0 +_080A0A98: + add r0, sp, 0x8 + movs r3, 0x2 + ldrsh r2, [r0, r3] + movs r0, 0x1 + b _080A0B28 +_080A0AA2: + add r0, sp, 0x8 + movs r4, 0x2 + ldrsh r2, [r0, r4] + movs r0, 0x2 + b _080A0B28 +_080A0AAC: + add r0, sp, 0x8 + movs r5, 0x2 + ldrsh r2, [r0, r5] + movs r0, 0x3 + b _080A0B28 +_080A0AB6: + mov r0, r9 + ldr r1, [r0] + ldr r0, [r0, 0x4] + ldr r1, [r1, 0x4] + bl _call_via_r1 + lsls r0, 16 + asrs r0, 16 + mov r2, r9 + movs r3, 0x8 + ldrsh r1, [r2, r3] + cmp r1, 0x2 + beq _080A0AF4 + cmp r1, 0x2 + bgt _080A0ADC + cmp r1, 0x1 + beq _080A0AE4 + bl _0809EAE0 +_080A0ADC: + cmp r1, 0x3 + beq _080A0B04 + bl _0809EAE0 +_080A0AE4: + add r4, sp, 0x15C + adds r1, r4, 0 + bl sub_80A8FD8 + add r0, sp, 0x8 + movs r5, 0x2 + ldrsh r2, [r0, r5] + b _080A0B12 +_080A0AF4: + add r4, sp, 0x15C + adds r1, r4, 0 + bl sub_80AC448 + add r0, sp, 0x8 + movs r1, 0x2 + ldrsh r2, [r0, r1] + b _080A0B12 +_080A0B04: + add r4, sp, 0x15C + adds r1, r4, 0 + bl sub_80AD360 + add r0, sp, 0x8 + movs r3, 0x2 + ldrsh r2, [r0, r3] +_080A0B12: + movs r0, 0 + adds r1, r4, 0 + bl sub_809D208 + bl _0809F0C4 +_080A0B1E: + add r0, sp, 0x8 + movs r4, 0x2 + ldrsh r2, [r0, r4] + movs r0, 0x1 + movs r1, 0 +_080A0B28: + bl sub_809D220 + bl _0809F0C4 +_080A0B30: + mov r0, r10 + adds r0, 0x50 + add r1, sp, 0x8 + movs r5, 0x2 + ldrsh r1, [r1, r5] + bl sub_8001570 + bl _0809EAE0 +_080A0B42: + mov r0, r10 + adds r0, 0x50 + add r1, sp, 0x8 + movs r2, 0x2 + ldrsh r1, [r1, r2] + bl sub_80015C0 + bl _0809EAE0 +_080A0B54: + mov r0, r10 + adds r0, 0x50 + add r1, sp, 0x8 + movs r3, 0x2 + ldrsh r1, [r1, r3] + ldr r2, [sp, 0xC] + add r3, sp, 0x8 + ldrb r3, [r3, 0x1] + bl sub_800226C + bl _0809EAE0 +_080A0B6C: + mov r0, r10 + adds r0, 0x50 + add r1, sp, 0x8 + movs r4, 0x2 + ldrsh r1, [r1, r4] + ldr r2, [sp, 0xC] + lsls r2, 16 + asrs r2, 16 + add r3, sp, 0x8 + ldrb r3, [r3, 0x1] + bl sub_80022A0 + bl _0809EAE0 +_080A0B88: + mov r0, r10 + adds r0, 0x50 + add r1, sp, 0x8 + movs r5, 0x2 + ldrsh r1, [r1, r5] + ldr r2, [sp, 0xC] + lsls r2, 16 + lsrs r2, 16 + ldr r3, [sp, 0x10] + bl sub_800199C + bl _0809EAE0 +_080A0BA2: + add r0, sp, 0x8 + movs r1, 0x2 + ldrsh r0, [r0, r1] + ldr r1, [sp, 0xC] + ldr r2, [sp, 0x10] + bl sub_8001BB4 + bl _0809EAE0 +_080A0BB4: + add r0, sp, 0x8 + movs r2, 0x2 + ldrsh r0, [r0, r2] + add r1, sp, 0x164 + add r2, sp, 0x168 + bl sub_8001B88 + add r0, sp, 0x8 + movs r3, 0x2 + ldrsh r0, [r0, r3] + add r1, sp, 0x164 + ldr r1, [r1] + add r2, sp, 0x168 + ldr r2, [r2] + adds r2, 0x1 + bl sub_8001BB4 + bl _0809EAE0 +_080A0BDA: + ldr r2, [sp, 0xC] + movs r0, 0 + movs r1, 0x13 + bl sub_80018D8 + add r0, sp, 0x8 + movs r4, 0x2 + ldrsh r2, [r0, r4] + movs r0, 0 + movs r1, 0x16 + bl sub_80018D8 + bl _0809EAE0 +_080A0BF6: + add r0, sp, 0x8 + movs r5, 0x2 + ldrsh r2, [r0, r5] + movs r0, 0 + movs r1, 0x1C + bl sub_80018D8 + bl _0809EAE0 +_080A0C08: + add r0, sp, 0x8 + movs r1, 0x2 + ldrsh r0, [r0, r1] + add r1, sp, 0x8 + ldrb r2, [r1, 0x1] + negs r1, r2 + orrs r1, r2 + lsrs r1, 31 + bl sub_80026E8 + bl _0809EAE0 +_080A0C20: + add r0, sp, 0x8 + movs r2, 0x2 + ldrsh r0, [r0, r2] + add r1, sp, 0x8 + ldrb r2, [r1, 0x1] + negs r1, r2 + orrs r1, r2 + lsrs r1, 31 + bl sub_809733C + bl _0809EAE0 +_080A0C38: + add r0, sp, 0x8 + movs r3, 0x2 + ldrsh r0, [r0, r3] + add r1, sp, 0x8 + ldrb r2, [r1, 0x1] + negs r1, r2 + orrs r1, r2 + lsrs r1, 31 + bl sub_80973A8 + bl _0809EAE0 +_080A0C50: + add r0, sp, 0x8 + movs r4, 0x2 + ldrsh r0, [r0, r4] + add r1, sp, 0x8 + ldrb r2, [r1, 0x1] + negs r1, r2 + orrs r1, r2 + lsrs r1, 31 + bl sub_8097418 + bl _0809EAE0 +_080A0C68: + add r0, sp, 0x8 + movs r5, 0x2 + ldrsh r0, [r0, r5] + add r1, sp, 0x8 + ldrb r2, [r1, 0x1] + negs r1, r2 + orrs r1, r2 + lsrs r1, 31 + bl sub_80975A8 + bl _0809EAE0 +_080A0C80: + add r0, sp, 0x8 + ldrh r0, [r0, 0x2] + lsls r0, 24 + lsrs r0, 24 + bl sub_80976F8 + bl _0809EAE0 +_080A0C90: + add r0, sp, 0x8 + movs r2, 0x2 + ldrsh r1, [r0, r2] + ldr r2, [sp, 0xC] + movs r0, 0 + movs r3, 0x2 + bl sub_80022F8 + b _080A0E1E +_080A0CA2: + mov r0, r10 + adds r0, 0x50 + ldr r1, [sp, 0xC] + lsls r1, 16 + asrs r1, 16 + ldr r2, [sp, 0x10] + add r3, sp, 0x8 + ldrb r3, [r3, 0x1] + bl sub_80022F8 + lsls r0, 24 + cmp r0, 0 + bne _080A0CC0 + bl _0809EAE0 +_080A0CC0: + add r0, sp, 0x8 + movs r4, 0x2 + ldrsh r1, [r0, r4] + b _080A0D5C +_080A0CC8: + mov r0, r10 + adds r0, 0x50 + ldr r1, [sp, 0xC] + lsls r1, 16 + asrs r1, 16 + ldr r2, [sp, 0x10] + lsls r2, 16 + asrs r2, 16 + add r3, sp, 0x8 + ldrb r3, [r3, 0x1] + bl sub_8002318 + lsls r0, 24 + cmp r0, 0 + bne _080A0CEA + bl _0809EAE0 +_080A0CEA: + add r0, sp, 0x8 + movs r2, 0x2 + ldrsh r1, [r0, r2] + b _080A0E2C +_080A0CF2: + mov r0, r10 + adds r0, 0x50 + ldr r1, [sp, 0xC] + lsls r1, 16 + asrs r1, 16 + ldr r2, [sp, 0x10] + lsls r2, 16 + lsrs r2, 16 + bl sub_8001784 + cmp r0, 0 + bne _080A0D0E + bl _0809EAE0 +_080A0D0E: + add r0, sp, 0x8 + movs r4, 0x2 + ldrsh r1, [r0, r4] + b _080A0D5C +_080A0D16: + mov r0, r10 + adds r0, 0x50 + ldr r1, [sp, 0xC] + lsls r1, 16 + asrs r1, 16 + bl sub_8001AB0 + ldr r1, [sp, 0x10] + add r2, sp, 0x8 + ldrb r2, [r2, 0x1] + bl sub_80022E8 + lsls r0, 24 + cmp r0, 0 + bne _080A0D38 + bl _0809EAE0 +_080A0D38: + add r0, sp, 0x8 + movs r2, 0x2 + ldrsh r1, [r0, r2] + b _080A0E2C +_080A0D40: + add r0, sp, 0x8 + movs r4, 0x2 + ldrsh r0, [r0, r4] + ldr r1, [sp, 0xC] + ldr r2, [sp, 0x10] + bl sub_8001CC4 + lsls r0, 24 + cmp r0, 0 + bne _080A0D58 + bl _0809EAE0 +_080A0D58: + add r0, sp, 0x8 + ldrb r1, [r0, 0x1] +_080A0D5C: + mov r0, r9 + bl sub_80A242C + mov r5, r10 + str r0, [r5, 0x4] + bl _0809EAE0 +_080A0D6A: + add r0, sp, 0x8 + movs r1, 0x2 + ldrsh r0, [r0, r1] + ldr r1, [sp, 0xC] + ldr r2, [sp, 0x10] + bl sub_8001D08 + b _080A0DBA +_080A0D7A: + add r0, sp, 0x8 + movs r3, 0x2 + ldrsh r0, [r0, r3] + ldr r1, [sp, 0xC] + ldr r2, [sp, 0x10] + bl sub_8001D44 + lsls r0, 24 + cmp r0, 0 + bne _080A0D92 + bl _0809EAE0 +_080A0D92: + b _080A0DF6 +_080A0D94: + add r0, sp, 0x8 + movs r5, 0x2 + ldrsh r0, [r0, r5] + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + bne _080A0DA8 + bl _0809EAE0 +_080A0DA8: + add r0, sp, 0x8 + ldrb r1, [r0, 0x1] + b _080A132A +_080A0DAE: + add r0, sp, 0x8 + ldrh r0, [r0, 0x2] + lsls r0, 24 + lsrs r0, 24 + bl sub_8098100 +_080A0DBA: + lsls r0, 24 + cmp r0, 0 + bne _080A0DC4 + bl _0809EAE0 +_080A0DC4: + add r0, sp, 0x8 + ldrb r1, [r0, 0x1] + mov r0, r9 + bl sub_80A242C + mov r2, r10 + str r0, [r2, 0x4] + bl _0809EAE0 +_080A0DD6: + ldr r0, [sp, 0xC] + lsls r0, 16 + asrs r0, 16 + bl sub_80026CC + b _080A0E1E +_080A0DE2: + add r0, sp, 0x8 + ldrh r0, [r0, 0x2] + lsls r0, 24 + lsrs r0, 24 + bl sub_809CBA4 + cmp r0, 0 + bgt _080A0DF6 + bl _0809EAE0 +_080A0DF6: + add r0, sp, 0x8 + ldrb r1, [r0, 0x1] + mov r0, r9 + bl sub_80A242C + mov r4, r10 + str r0, [r4, 0x4] + bl _0809EAE0 +_080A0E08: + mov r5, r9 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + beq _080A0E16 + bl _0809EAE0 +_080A0E16: + movs r2, 0xA + ldrsh r0, [r5, r2] + bl sub_80A8C98 +_080A0E1E: + lsls r0, 24 + cmp r0, 0 + bne _080A0E28 + bl _0809EAE0 +_080A0E28: + add r0, sp, 0x8 + ldrb r1, [r0, 0x1] +_080A0E2C: + mov r0, r9 + bl sub_80A242C + mov r3, r10 + str r0, [r3, 0x4] + bl _0809EAE0 +_080A0E3A: + add r0, sp, 0x8 + ldrh r0, [r0, 0x2] + lsls r0, 24 + lsrs r0, 24 + bl sub_8091130 + cmp r0, 0 + bge _080A0E4E + bl _0809EAE0 +_080A0E4E: + bl sub_80911F8 + bl _0809EAE0 +_080A0E56: + add r0, sp, 0x8 + ldrb r2, [r0] + adds r0, r2, 0 + subs r0, 0xC0 + cmp r0, 0xB + bls _080A0E64 + b _080A1088 +_080A0E64: + lsls r0, 2 + ldr r1, _080A0E70 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080A0E70: .4byte _080A0E74 + .align 2, 0 +_080A0E74: + .4byte _080A0EA4 + .4byte _080A0EB6 + .4byte _080A0ECC + .4byte _080A0EFA + .4byte _080A0F08 + .4byte _080A0F14 + .4byte _080A0F26 + .4byte _080A0F36 + .4byte _080A0F98 + .4byte _080A1008 + .4byte _080A0F4C + .4byte _080A107A +_080A0EA4: + mov r0, r10 + adds r0, 0x50 + add r1, sp, 0x8 + movs r4, 0x2 + ldrsh r1, [r1, r4] + bl sub_8001658 + adds r1, r0, 0 + b _080A1098 +_080A0EB6: + mov r0, r10 + adds r0, 0x50 + add r1, sp, 0x8 + movs r5, 0x2 + ldrsh r1, [r1, r5] + bl sub_8001658 + ldr r1, [sp, 0xC] + add r2, sp, 0x8 + ldrb r2, [r2, 0x1] + b _080A0EF2 +_080A0ECC: + mov r4, r10 + adds r4, 0x50 + add r0, sp, 0x8 + movs r2, 0x2 + ldrsh r1, [r0, r2] + adds r0, r4, 0 + bl sub_8001658 + adds r5, r0, 0 + ldr r1, [sp, 0xC] + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + bl sub_8001658 + adds r1, r0, 0 + add r0, sp, 0x8 + ldrb r2, [r0, 0x1] + adds r0, r5, 0 +_080A0EF2: + bl sub_8002260 + adds r1, r0, 0 + b _080A1098 +_080A0EFA: + add r0, sp, 0x8 + movs r3, 0x2 + ldrsh r0, [r0, r3] + bl sub_800451C + adds r1, r0, 0 + b _080A1098 +_080A0F08: + add r0, sp, 0x8 + movs r4, 0x2 + ldrsh r1, [r0, r4] + movs r0, 0 + movs r2, 0 + b _080A0F1E +_080A0F14: + add r0, sp, 0x8 + movs r5, 0x2 + ldrsh r1, [r0, r5] + movs r0, 0 + movs r2, 0x1 +_080A0F1E: + bl sub_8001784 + adds r1, r0, 0 + b _080A1098 +_080A0F26: + ldr r0, [sp, 0xC] + lsls r0, 16 + asrs r0, 16 + bl sub_80A8C2C + lsls r0, 16 + asrs r1, r0, 16 + b _080A1098 +_080A0F36: + mov r0, r9 + ldr r1, [r0] + ldr r0, [r0, 0x4] + add r4, sp, 0x54 + ldr r2, [r1, 0x14] + adds r1, r4, 0 + bl _call_via_r2 + movs r1, 0 + ldrsb r1, [r4, r1] + b _080A1098 +_080A0F4C: + mov r2, r9 + ldr r1, [r2] + ldr r0, [r2, 0x4] + movs r3, 0xB6 + lsls r3, 1 + add r3, sp + mov r8, r3 + ldr r2, [r1, 0xC] + mov r1, r8 + bl _call_via_r2 + add r6, sp, 0x16C + ldr r0, [r6] + ldr r1, [r6, 0x4] + add r4, sp, 0x174 + str r0, [r4] + str r1, [r4, 0x4] + ldr r0, [sp, 0xC] + lsls r0, 16 + asrs r0, 16 + adds r5, r4, 0 + adds r1, r5, 0 + bl sub_80AD8B4 + ldr r1, [r4] + ldr r0, [r6] + subs r1, r0 + add r0, sp, 0x17C + str r1, [r0] + ldr r1, [r5, 0x4] + mov r4, r8 + ldr r0, [r4, 0x4] + subs r1, r0 + add r0, sp, 0x17C + str r1, [r0, 0x4] + bl sub_8002C60 + b _080A106A +_080A0F98: + ldr r0, [sp, 0xC] + lsls r0, 16 + asrs r0, 16 + bl sub_80A7AE8 + lsls r0, 16 + asrs r6, r0, 16 + cmp r6, 0 + blt _080A1074 + mov r5, r9 + ldr r1, [r5] + ldr r0, [r5, 0x4] + movs r2, 0xC2 + lsls r2, 1 + add r2, sp + mov r8, r2 + ldr r2, [r1, 0xC] + mov r1, r8 + bl _call_via_r2 + ldr r1, [r5] + ldr r0, [r5, 0x4] + add r5, sp, 0x18C + ldr r2, [r1, 0x8] + adds r1, r5, 0 + bl _call_via_r2 + add r7, sp, 0x194 + adds r0, r6, 0 + adds r1, r7, 0 + bl sub_80A8FD8 + add r4, sp, 0x19C + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80A8F9C + mov r0, r8 + adds r1, r5, 0 + adds r2, r7, 0 + adds r3, r4, 0 + bl sub_8002DF0 + lsls r0, 24 + asrs r1, r0, 24 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080A1098 + ldr r3, _080A1004 + mov r0, r8 + adds r1, r3, 0 + adds r2, r7, 0 + b _080A1066 + .align 2, 0 +_080A1004: .4byte gUnknown_81164DC +_080A1008: + ldr r0, [sp, 0xC] + lsls r0, 16 + asrs r0, 16 + bl sub_80A7AE8 + lsls r0, 16 + asrs r7, r0, 16 + cmp r7, 0 + blt _080A1074 + mov r3, r9 + ldr r1, [r3] + ldr r0, [r3, 0x4] + add r6, sp, 0x1A4 + ldr r2, [r1, 0xC] + adds r1, r6, 0 + bl _call_via_r2 + mov r4, r9 + ldr r1, [r4] + ldr r0, [r4, 0x4] + add r4, sp, 0x1AC + ldr r2, [r1, 0x8] + adds r1, r4, 0 + bl _call_via_r2 + add r5, sp, 0x1B4 + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80A8FD8 + ldr r7, _080A1070 + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r7, 0 + bl sub_8002DF0 + lsls r0, 24 + asrs r1, r0, 24 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080A1098 + adds r0, r6, 0 + adds r1, r7, 0 + adds r2, r5, 0 + adds r3, r7, 0 +_080A1066: + bl sub_8002D54 +_080A106A: + lsls r0, 24 + asrs r1, r0, 24 + b _080A1098 + .align 2, 0 +_080A1070: .4byte gUnknown_81164DC +_080A1074: + movs r1, 0x1 + negs r1, r1 + b _080A1098 +_080A107A: + add r0, sp, 0x8 + movs r5, 0x2 + ldrsh r0, [r0, r5] + bl sub_809CC90 + adds r1, r0, 0 + b _080A1098 +_080A1088: + ldr r0, _080A1090 + ldr r1, _080A1094 + bl FatalError + .align 2, 0 +_080A1090: .4byte gUnknown_81166B4 +_080A1094: .4byte gUnknown_81166C0 +_080A1098: + mov r0, r9 + bl sub_80A2460 + b _080A1330 +_080A10A0: + mov r0, r10 + adds r0, 0x50 + add r1, sp, 0x8 + movs r2, 0x2 + ldrsh r1, [r1, r2] + bl sub_8001658 + adds r2, r0, 0 + mov r3, r10 + strh r2, [r3, 0x28] + ldr r1, [r3, 0x4] + ldrb r0, [r1] + cmp r0, 0xD0 + bne _080A10DE + lsls r0, r2, 16 + asrs r3, r0, 16 +_080A10C0: + adds r2, r1, 0 + movs r4, 0x2 + ldrsh r0, [r1, r4] + cmp r0, r3 + bne _080A10CE + bl _0809F0C4 +_080A10CE: + adds r0, r1, 0 + adds r0, 0x10 + mov r5, r10 + str r0, [r5, 0x4] + adds r1, r0, 0 + ldrb r0, [r2, 0x10] + cmp r0, 0xD0 + beq _080A10C0 +_080A10DE: + mov r1, r10 + ldr r0, [r1, 0x4] + ldrb r0, [r0] + cmp r0, 0xD1 + beq _080A10EC + bl _0809EAE0 +_080A10EC: + ldr r0, _080A10F4 + strh r0, [r1, 0x28] + bl _0809F0C4 + .align 2, 0 +_080A10F4: .4byte 0x0000ffff +_080A10F8: + ldr r7, [sp, 0x14] + ldr r1, _080A11F0 + movs r0, 0 + str r0, [r1] + mov r2, r10 + strh r0, [r2, 0x28] + add r0, sp, 0x8 + ldrb r0, [r0] + cmp r0, 0xD8 + bgt _080A1176 + cmp r0, 0xD6 + blt _080A1176 + mov r0, r10 + adds r0, 0x50 + ldr r1, [sp, 0x10] + lsls r1, 16 + asrs r1, 16 + bl sub_8001658 + adds r3, r0, 0 + mov r4, r10 + ldr r1, [r4, 0x4] + ldrb r0, [r1] + cmp r0, 0xD0 + bne _080A114E +_080A112A: + adds r2, r1, 0 + movs r5, 0x2 + ldrsh r0, [r2, r5] + cmp r0, r3 + bne _080A1136 + ldr r7, [r2, 0xC] +_080A1136: + adds r0, r1, 0 + adds r0, 0x10 + mov r1, r10 + str r0, [r1, 0x4] + ldrh r1, [r1, 0x28] + adds r1, 0x1 + mov r4, r10 + strh r1, [r4, 0x28] + adds r1, r0, 0 + ldrb r0, [r2, 0x10] + cmp r0, 0xD0 + beq _080A112A +_080A114E: + mov r5, r10 + ldr r1, [r5, 0x4] + ldrb r0, [r1] + cmp r0, 0xD1 + bne _080A1176 +_080A1158: + cmp r7, 0 + bne _080A115E + ldr r7, [r1, 0xC] +_080A115E: + mov r0, r10 + ldr r2, [r0, 0x4] + adds r1, r2, 0 + adds r1, 0x10 + str r1, [r0, 0x4] + ldrh r0, [r0, 0x28] + adds r0, 0x1 + mov r3, r10 + strh r0, [r3, 0x28] + ldrb r0, [r2, 0x10] + cmp r0, 0xD1 + beq _080A1158 +_080A1176: + cmp r7, 0 + bne _080A117C + ldr r7, _080A11F4 +_080A117C: + mov r4, r10 + ldr r5, [r4, 0x4] + ldrb r0, [r5] + cmp r0, 0xD9 + bne _080A11B8 + ldr r0, _080A11F8 + mov r8, r0 + ldr r6, _080A11F0 + movs r1, 0x4 + add r1, r8 + mov r12, r1 +_080A1192: + ldr r1, [r6] + lsls r2, r1, 3 + mov r4, r8 + adds r3, r2, r4 + adds r4, r5, 0 + ldr r0, [r4, 0xC] + str r0, [r3] + add r2, r12 + adds r1, 0x1 + str r1, [r2] + str r1, [r6] + adds r0, r4, 0 + adds r0, 0x10 + mov r5, r10 + str r0, [r5, 0x4] + adds r5, r0, 0 + ldrb r0, [r4, 0x10] + cmp r0, 0xD9 + beq _080A1192 +_080A11B8: + ldr r0, _080A11F0 + ldr r1, [r0] + cmp r1, 0 + bgt _080A11C4 + bl _0809EAE0 +_080A11C4: + ldr r3, _080A11F8 + lsls r2, r1, 3 + adds r1, r2, r3 + movs r0, 0 + str r0, [r1] + adds r0, r3, 0x4 + adds r2, r0 + add r0, sp, 0x8 + movs r1, 0x2 + ldrsh r0, [r0, r1] + str r0, [r2] + add r0, sp, 0x8 + ldrb r0, [r0] + subs r0, 0xD2 + cmp r0, 0x6 + bhi _080A1280 + lsls r0, 2 + ldr r1, _080A11FC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080A11F0: .4byte gUnknown_203B4AC +_080A11F4: .4byte gUnknown_81166D8 +_080A11F8: .4byte gUnknown_2039D50 +_080A11FC: .4byte _080A1200 + .align 2, 0 +_080A1200: + .4byte _080A121C + .4byte _080A121C + .4byte _080A123E + .4byte _080A1260 + .4byte _080A121C + .4byte _080A123E + .4byte _080A1260 +_080A121C: + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + negs r1, r0 + orrs r1, r0 + lsrs r1, 31 + movs r2, 0x1 + negs r2, r2 + ldr r0, [sp, 0xC] + lsls r0, 16 + asrs r0, 16 + str r0, [sp] + str r7, [sp, 0x4] + adds r0, r3, 0 + movs r3, 0 + bl sub_809B028 + b _080A1280 +_080A123E: + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + negs r1, r0 + orrs r1, r0 + lsrs r1, 31 + movs r2, 0x1 + negs r2, r2 + ldr r0, [sp, 0xC] + lsls r0, 16 + asrs r0, 16 + str r0, [sp] + str r7, [sp, 0x4] + adds r0, r3, 0 + movs r3, 0x1 + bl sub_809B028 + b _080A1280 +_080A1260: + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + negs r1, r0 + orrs r1, r0 + lsrs r1, 31 + movs r2, 0x1 + negs r2, r2 + ldr r0, [sp, 0xC] + lsls r0, 16 + asrs r0, 16 + str r0, [sp] + str r7, [sp, 0x4] + adds r0, r3, 0 + movs r3, 0x2 + bl sub_809B028 +_080A1280: + mov r0, r9 + movs r1, 0x1 + bl sub_809D8EC + lsls r0, 24 + cmp r0, 0 + bne _080A1292 + bl _0809EAE0 +_080A1292: + movs r0, 0 + movs r1, 0xB + bl sub_80A87AC + bl _0809F0C4 +_080A129E: + mov r0, r9 + movs r1, 0x1 + bl sub_809D8EC + b _080A130A +_080A12A8: + add r0, sp, 0x8 + ldrh r0, [r0, 0x2] +_080A12AC: + mov r2, r10 +_080A12AE: + strh r0, [r2, 0x2A] + bl _0809F0C4 +_080A12B4: + add r0, sp, 0x8 + movs r3, 0x2 + ldrsh r1, [r0, r3] + ldr r0, [sp, 0xC] + subs r0, r1 + bl sub_800451C + add r1, sp, 0x8 + ldrh r1, [r1, 0x2] + adds r1, r0 + mov r4, r10 + strh r1, [r4, 0x2A] + bl _0809F0C4 +_080A12D0: + add r0, sp, 0x8 + ldrh r0, [r0, 0x2] + mov r5, r10 + strh r0, [r5, 0x28] + add r0, sp, 0x8 + movs r2, 0x2 + ldrsh r1, [r0, r2] + mov r0, r9 + bl sub_809D8EC + b _080A130A +_080A12E6: + add r0, sp, 0x8 + movs r3, 0x2 + ldrsh r0, [r0, r3] + bl sub_809D9B8 + bl _0809EAE0 +_080A12F4: + add r0, sp, 0x8 + ldrh r0, [r0, 0x2] + mov r4, r10 + strh r0, [r4, 0x28] + add r0, sp, 0x8 + movs r5, 0x2 + ldrsh r1, [r0, r5] + ldrb r2, [r0, 0x1] + mov r0, r9 + bl sub_809DA08 +_080A130A: + lsls r0, 24 +_080A130C: + cmp r0, 0 + bne _080A1314 + bl _0809EAE0 +_080A1314: + bl _0809F0C4 +_080A1318: + mov r1, r10 + adds r1, 0x10 + mov r0, r10 + adds r0, 0x4 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} +_080A1324: + add r0, sp, 0x8 + movs r5, 0x2 + ldrsh r1, [r0, r5] +_080A132A: + mov r0, r9 + bl sub_80A242C +_080A1330: + mov r1, r10 + str r0, [r1, 0x4] + bl _0809EAE0 +_080A1338: + mov r1, r10 + adds r1, 0x10 + mov r0, r10 + adds r0, 0x4 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} +_080A1344: + ldr r2, _080A1364 + add r0, sp, 0x8 + movs r5, 0x2 + ldrsh r1, [r0, r5] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r2, 0x8 + adds r0, r2 + ldr r0, [r0] + mov r1, r10 + str r0, [r1, 0x4] + str r0, [r1, 0x8] + bl _0809EAE0 + .align 2, 0 +_080A1364: .4byte gUnknown_812F1F8 +_080A1368: + mov r1, r10 + adds r1, 0x10 + mov r0, r10 + adds r0, 0x4 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} +_080A1374: + ldr r0, _080A138C + movs r5, 0 + ldrsh r1, [r0, r5] + add r0, sp, 0x8 + ldrh r0, [r0, 0x2] + lsls r0, 16 + cmp r0, 0 + blt _080A1390 + add r0, sp, 0x8 + movs r3, 0x2 + ldrsh r2, [r0, r3] + b _080A1396 + .align 2, 0 +_080A138C: .4byte gUnknown_2039A34 +_080A1390: + mov r4, r10 + movs r5, 0xC + ldrsh r2, [r4, r5] +_080A1396: + adds r5, r2, 0 + add r0, sp, 0x8 + ldrb r0, [r0, 0x1] + lsls r0, 24 + cmp r0, 0 + blt _080A13AA + add r0, sp, 0x8 + movs r4, 0x1 + ldrsb r4, [r0, r4] + b _080A13B0 +_080A13AA: + mov r0, r10 + movs r4, 0xE + ldrsb r4, [r0, r4] +_080A13B0: + add r0, sp, 0x1C + adds r2, r5, 0 + adds r3, r4, 0 + bl sub_80A4B70 + ldr r0, [sp, 0x1C] + mov r1, r10 + str r0, [r1, 0x4] + str r0, [r1, 0x8] + strh r5, [r1, 0xC] + strb r4, [r1, 0xE] + bl _0809EAE0 +_080A13CA: + mov r0, r10 + adds r0, 0x50 + add r1, sp, 0x8 + movs r2, 0x2 + ldrsh r1, [r1, r2] + bl sub_8001658 + lsls r0, 16 + asrs r0, 16 + bl sub_80A4D7C + ldr r4, _080A13F4 + strh r0, [r4] + bl sub_809D940 + movs r3, 0 + ldrsh r0, [r4, r3] + bl sub_80A4CC4 + bl _0809EAE0 + .align 2, 0 +_080A13F4: .4byte gUnknown_2039A34 +_080A13F8: + movs r0, 0 + mov r4, r10 + str r0, [r4, 0x10] + str r0, [r4, 0x14] + bl _0809EAE0 +_080A1404: + mov r5, r10 + ldr r0, [r5, 0x10] + cmp r0, 0 + bne _080A1410 +_080A140C: + movs r0, 0 + b _080A142E +_080A1410: + mov r0, r10 + adds r0, 0x4 + mov r1, r10 + adds r1, 0x10 + ldm r1!, {r2-r4} + stm r0!, {r2-r4} + movs r0, 0 + mov r5, r10 + str r0, [r5, 0x10] + str r0, [r5, 0x14] + bl _0809EAE0 +_080A1428: + movs r0, 0x1 + b _080A142E +_080A142C: + movs r0, 0x4 +_080A142E: + add sp, 0x1BC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end ExecuteScriptCommand + + thumb_func_start sub_80A1440 +sub_80A1440: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r3, r2, 0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_80A14E8 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80A1440 + + thumb_func_start sub_80A145C +sub_80A145C: + push {r4,r5,lr} + sub sp, 0xF4 + lsls r0, 16 + asrs r4, r0, 16 + lsls r0, r4, 1 + adds r0, r4 + lsls r0, 2 + ldr r1, _080A14C8 + adds r0, r1 + movs r1, 0x2 + ldrsh r0, [r0, r1] + cmp r0, 0xB + bne _080A14C4 + add r5, sp, 0x10 + ldr r1, _080A14CC + movs r0, 0 + str r0, [sp] + adds r0, r5, 0 + movs r2, 0 + movs r3, 0 + bl sub_809D600 + movs r0, 0 + add r1, sp, 0x4 + adds r2, r4, 0 + bl sub_809D710 + ldr r3, _080A14D0 + adds r0, r5, 0 + movs r1, 0 + add r2, sp, 0x4 + bl sub_809D790 + add r1, sp, 0x44 + add r0, sp, 0x38 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r0, _080A14D4 + str r0, [r5, 0x34] + str r0, [r5, 0x38] + ldr r1, _080A14D8 + adds r0, r5, 0 + bl sub_809DA70 + adds r4, r0, 0 + lsls r4, 16 + asrs r4, 16 + adds r0, r5, 0 + bl sub_809D648 + cmp r4, 0 + beq _080A14DC +_080A14C4: + movs r0, 0 + b _080A14DE + .align 2, 0 +_080A14C8: .4byte gUnknown_812F1F8 +_080A14CC: .4byte gUnknown_8116488 +_080A14D0: .4byte gUnknown_81166F8 +_080A14D4: .4byte gUnknown_81164E4 +_080A14D8: .4byte gUnknown_8116704 +_080A14DC: + movs r0, 0x1 +_080A14DE: + add sp, 0xF4 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80A145C + + thumb_func_start sub_80A14E8 +sub_80A14E8: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + ldr r4, _080A1514 + add sp, r4 + adds r6, r0, 0 + adds r5, r2, 0 + adds r7, r3, 0 + lsls r1, 24 + lsrs r1, 24 + subs r0, r1, 0x1 + cmp r0, 0x49 + bls _080A1508 + bl _080A236A +_080A1508: + lsls r0, 2 + ldr r1, _080A1518 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080A1514: .4byte 0xfffffc80 +_080A1518: .4byte _080A151C + .align 2, 0 +_080A151C: + .4byte _080A1644 + .4byte _080A164C + .4byte _080A1672 + .4byte _080A167A + .4byte _080A1680 + .4byte _080A1688 + .4byte _080A1690 + .4byte _080A1698 + .4byte _080A169E + .4byte _080A16C6 + .4byte _080A1730 + .4byte _080A1756 + .4byte _080A178C + .4byte _080A1792 + .4byte _080A17C0 + .4byte _080A17C6 + .4byte _080A1800 + .4byte _080A1814 + .4byte _080A1824 + .4byte _080A1840 + .4byte _080A185E + .4byte _080A18C2 + .4byte _080A18E2 + .4byte _080A18F2 + .4byte _080A1904 + .4byte _080A197C + .4byte _080A1988 + .4byte _080A19DC + .4byte _080A19FC + .4byte _080A1A0E + .4byte _080A1A18 + .4byte _080A1A70 + .4byte _080A1AF8 + .4byte _080A1B20 + .4byte _080A1B36 + .4byte _080A1B58 + .4byte _080A1B64 + .4byte _080A1BD8 + .4byte _080A1BE4 + .4byte _080A1C30 + .4byte _080A1C84 + .4byte _080A1DEC + .4byte _080A1E30 + .4byte _080A1E3C + .4byte _080A1ED0 + .4byte _080A1ED6 + .4byte _080A1F28 + .4byte _080A1F3C + .4byte _080A1F44 + .4byte _080A1F50 + .4byte _080A1F80 + .4byte _080A1FDA + .4byte _080A202C + .4byte _080A2054 + .4byte _080A2060 + .4byte _080A204A + .4byte _080A206C + .4byte _080A2076 + .4byte _080A207C + .4byte _080A2082 + .4byte _080A20D4 + .4byte _080A20F4 + .4byte _080A21E4 + .4byte _080A228C + .4byte _080A229E + .4byte _080A2298 + .4byte _080A22AE + .4byte _080A22CC + .4byte _080A22E4 + .4byte _080A2304 + .4byte _080A2320 + .4byte _080A232E + .4byte _080A233A + .4byte _080A2346 +_080A1644: + bl sub_8098C58 + bl _080A236A +_080A164C: + bl sub_8011C34 + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _080A1660 + bl Random + bl sub_8011C40 +_080A1660: + movs r0, 0x1 + bl sub_8011C28 + bl sub_8001064 + bl sub_809965C + bl _080A236A +_080A1672: + bl sub_8098CC8 + bl _080A236A +_080A167A: + bl sub_80961D8 + b _080A1804 +_080A1680: + bl sub_8096028 + bl _080A236A +_080A1688: + bl sub_80963FC + bl _080A236A +_080A1690: + bl sub_8096488 + bl _080A236A +_080A1698: + bl sub_80964B4 + b _080A1804 +_080A169E: + movs r0, 0x8 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + bne _080A16B0 + bl sub_808D4B0 + b _080A16B4 +_080A16B0: + bl sub_808D500 +_080A16B4: + lsls r0, 24 + lsrs r4, r0, 24 + bl nullsub_104 + negs r0, r4 + orrs r0, r4 + lsrs r0, 31 + bl _080A236C +_080A16C6: + movs r1, 0xC + ldrsh r0, [r6, r1] + cmp r0, 0x1 + beq _080A16D2 + bl _080A236A +_080A16D2: + movs r2, 0xE + ldrsh r0, [r6, r2] + add r1, sp, 0x314 + bl sub_80A8C4C + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0 + bne _080A16E8 + bl _080A236A +_080A16E8: + add r0, sp, 0x314 + ldrb r0, [r0] + cmp r0, 0x44 + bne _080A16FC + movs r0, 0x82 + lsls r0, 1 + cmp r1, r0 + bne _080A16FC + bl _080A203C +_080A16FC: + movs r3, 0xE + ldrsh r0, [r6, r3] + bl sub_80A90C8 + lsls r0, 16 + ldr r1, _080A172C + asrs r0, 14 + adds r0, r1 + ldr r1, [r0] + add r0, sp, 0x4 + bl strcpy + movs r0, 0 + movs r1, 0x1 + add r2, sp, 0x4 + bl sub_809AE90 +_080A171E: + lsls r0, 24 +_080A1720: + cmp r0, 0 + beq _080A1726 + b _080A1EBE +_080A1726: + bl _080A236A + .align 2, 0 +_080A172C: .4byte gUnknown_813237C +_080A1730: + movs r0, 0 + movs r1, 0x14 + bl sub_8001658 + lsls r0, 16 + asrs r0, 16 + bl sub_80A2740 + lsls r0, 24 + lsrs r0, 24 + bl sub_80969D0 + movs r1, 0 + cmp r0, 0 + ble _080A1750 + movs r1, 0x1 +_080A1750: + adds r0, r1, 0 + bl _080A236C +_080A1756: + add r4, sp, 0x104 + adds r0, r4, 0 + bl sub_8099394 + lsls r0, 24 + cmp r0, 0 + bne _080A1768 + bl _080A236A +_080A1768: + ldr r0, _080A1788 + ldr r1, [r0] + ldrb r2, [r4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 4 + adds r1, r0 + adds r1, 0x2C + movs r0, 0 + ldrsb r0, [r1, r0] +_080A177C: + cmp r0, 0 + ble _080A1782 + b _080A1EBE +_080A1782: + bl _080A236A + .align 2, 0 +_080A1788: .4byte gUnknown_203B480 +_080A178C: + bl sub_8097640 + b _080A1804 +_080A1792: + movs r5, 0x11 +_080A1794: + lsls r4, r5, 16 + asrs r0, r4, 16 + bl sub_809758C + lsls r0, 24 + cmp r0, 0 + beq _080A17B6 + lsrs r4, 16 + movs r0, 0 + movs r1, 0x2F + adds r2, r4, 0 + bl sub_8001784 + cmp r0, 0 + bne _080A17B6 + bl _080A234E +_080A17B6: + adds r5, 0x1 + cmp r5, 0x16 + ble _080A1794 + bl _080A236A +_080A17C0: + bl sub_80964E4 + b _080A1804 +_080A17C6: + movs r4, 0x8 + ldrsh r0, [r6, r4] + cmp r0, 0x1 + beq _080A17D2 + bl _080A236A +_080A17D2: + movs r5, 0xA + ldrsh r0, [r6, r5] + cmp r0, 0 + beq _080A17DE + bl _080A236A +_080A17DE: + movs r1, 0xC + ldrsh r0, [r6, r1] + cmp r0, 0x1 + beq _080A17EA + bl _080A236A +_080A17EA: + movs r2, 0xA + ldrsh r4, [r6, r2] + movs r3, 0xE + ldrsh r0, [r6, r3] + bl sub_80A8E9C + adds r1, r0, 0 + adds r0, r4, 0 + bl sub_80A87E0 + b _080A171E +_080A1800: + bl sub_80A8D20 +_080A1804: + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + negs r0, r1 + orrs r0, r1 + lsrs r0, 31 + bl _080A236C +_080A1814: + ldr r0, _080A1820 + ldrh r0, [r0] + movs r1, 0xC0 + lsls r1, 2 + ands r0, r1 + b _080A1720 + .align 2, 0 +_080A1820: .4byte gUnknown_20255F0 +_080A1824: + lsls r0, r5, 16 + asrs r0, 16 + bl sub_80A8D54 + cmp r0, 0 + bne _080A1834 + bl _080A236A +_080A1834: + ldrh r0, [r0] + lsrs r0, 1 + movs r1, 0x1 + ands r0, r1 + bl _080A236C +_080A1840: + movs r4, 0x8 + ldrsh r0, [r6, r4] + cmp r0, 0x1 + beq _080A184C + bl _080A236A +_080A184C: + movs r5, 0xA + ldrsh r0, [r6, r5] + bl sub_80A8BFC + lsls r0, 16 + asrs r0, 16 + bl sub_808DB48 + b _080A171E +_080A185E: + lsls r0, r5, 16 + asrs r0, 16 + bl sub_80A7AE8 + lsls r0, 16 + asrs r5, r0, 16 + cmp r5, 0 + bge _080A1872 + bl _080A236A +_080A1872: + lsls r4, r7, 8 + ldr r1, [r6] + ldr r0, [r6, 0x4] + add r7, sp, 0x318 + ldr r2, [r1, 0xC] + adds r1, r7, 0 + bl _call_via_r2 + add r6, sp, 0x320 + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_80A8FD8 + add r0, sp, 0x318 + ldr r3, [r0] + subs r1, r3, r4 + add r0, sp, 0x320 + ldr r2, [r0] + cmp r1, r2 + ble _080A189E + bl _080A236A +_080A189E: + adds r0, r3, r4 + cmp r0, r2 + bge _080A18A8 + bl _080A236A +_080A18A8: + ldr r2, [r7, 0x4] + subs r0, r2, r4 + ldr r1, [r6, 0x4] + cmp r0, r1 + ble _080A18B6 + bl _080A236A +_080A18B6: + adds r0, r2, r4 + cmp r0, r1 + blt _080A18BE + b _080A1EBE +_080A18BE: + bl _080A236A +_080A18C2: + movs r0, 0x1 + bl sub_80A8D54 + cmp r0, 0 + bne _080A18D0 + bl _080A236A +_080A18D0: + adds r1, r0, 0 + adds r1, 0x4C + movs r2, 0 + adds r0, 0x55 +_080A18D8: + strb r2, [r0] + subs r0, 0x1 + cmp r0, r1 + bge _080A18D8 + b _080A1EBE +_080A18E2: + movs r0, 0xC + bl sub_80925EC + movs r0, 0x12 + bl sub_80925EC + bl _080A236A +_080A18F2: + ldr r0, _080A1900 + movs r1, 0x3C +_080A18F6: + movs r2, 0xA + bl sub_80A8F50 + bl _080A236A + .align 2, 0 +_080A1900: .4byte gUnknown_2039D98 +_080A1904: + movs r0, 0x51 + bl sub_808DBA8 + lsls r0, 24 + lsrs r0, 24 + bl sub_80925EC + add r1, sp, 0x4 + ldr r0, _080A1970 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r4,r6} + stm r1!, {r2,r4,r6} + ldm r0!, {r3,r4,r6} + stm r1!, {r3,r4,r6} + ldr r0, [r0] + str r0, [r1] + add r4, sp, 0x2C + adds r0, r4, 0 + add r1, sp, 0x4 + bl sub_808D144 + adds r0, r4, 0 + bl sub_808D1DC + cmp r0, 0 + bne _080A193C + b _080A1EBE +_080A193C: + movs r3, 0 + ldr r1, _080A1974 + mov r8, r1 + lsls r6, r5, 2 + ldr r2, _080A1978 + adds r4, r0, 0 + adds r4, 0x4C + mov r7, r8 +_080A194C: + adds r0, r4, r3 + adds r1, r3, r7 + ldrb r1, [r1] + strb r1, [r0] + adds r3, 0x1 + cmp r3, 0x9 + ble _080A194C +_080A195A: + adds r0, r6, r5 + lsls r0, 4 + adds r0, r2 + mov r1, r8 + movs r2, 0xA + bl sub_80922B4 +_080A1968: + bl sub_8097848 + bl _080A236A + .align 2, 0 +_080A1970: .4byte gUnknown_8116710 +_080A1974: .4byte gUnknown_2039D98 +_080A1978: .4byte gUnknown_202E2B8 +_080A197C: + ldr r0, _080A1984 + movs r1, 0x53 + b _080A18F6 + .align 2, 0 +_080A1984: .4byte gUnknown_2039D98 +_080A1988: + ldr r0, _080A19D4 + bl sub_808DBA8 + lsls r0, 24 + lsrs r0, 24 + bl sub_80925EC + add r1, sp, 0x84 + adds r2, r1, 0 + ldr r0, _080A19D8 + ldm r0!, {r3-r5} + stm r2!, {r3-r5} + ldm r0!, {r3,r4,r6} + stm r2!, {r3,r4,r6} + ldm r0!, {r3,r5,r6} + stm r2!, {r3,r5,r6} + ldr r0, [r0] + str r0, [r2] + add r4, sp, 0xAC + adds r0, r4, 0 + bl sub_808D144 + adds r0, r4, 0 + bl sub_808D1DC + adds r4, r0, 0 + cmp r4, 0 + bne _080A19C2 + b _080A1EBE +_080A19C2: + bl sub_8097848 + ldrh r1, [r4] + movs r0, 0x2 + orrs r0, r1 + strh r0, [r4] + bl _080A236A + .align 2, 0 +_080A19D4: .4byte 0x00000183 +_080A19D8: .4byte gUnknown_8116738 +_080A19DC: + ldr r0, _080A19F8 + movs r1, 0 + bl sub_808D434 + adds r2, r0, 0 + cmp r2, 0 + bne _080A19EC + b _080A1EBE +_080A19EC: + ldrh r1, [r2] + movs r0, 0x2 + orrs r0, r1 + strh r0, [r2] + bl _080A236A + .align 2, 0 +_080A19F8: .4byte 0x00000183 +_080A19FC: + movs r0, 0x82 + lsls r0, 1 +_080A1A00: + bl sub_808D278 + cmp r0, 0 + bne _080A1A0A + b _080A1EBE +_080A1A0A: + bl _080A236A +_080A1A0E: + ldr r0, _080A1A14 + movs r1, 0x7C + b _080A18F6 + .align 2, 0 +_080A1A14: .4byte gUnknown_2039D98 +_080A1A18: + add r1, sp, 0x108 + adds r2, r1, 0 + ldr r0, _080A1A64 + ldm r0!, {r3,r4,r6} + stm r2!, {r3,r4,r6} + ldm r0!, {r3,r4,r6} + stm r2!, {r3,r4,r6} + ldm r0!, {r3,r4,r6} + stm r2!, {r3,r4,r6} + ldr r0, [r0] + str r0, [r2] + add r4, sp, 0x130 + adds r0, r4, 0 + bl sub_808D144 + adds r0, r4, 0 + bl sub_808D1DC + cmp r0, 0 + bne _080A1A42 + b _080A1EBE +_080A1A42: + movs r3, 0 + ldr r4, _080A1A68 + mov r8, r4 + lsls r6, r5, 2 + ldr r2, _080A1A6C + adds r4, r0, 0 + adds r4, 0x4C + mov r7, r8 +_080A1A52: + adds r0, r4, r3 + adds r1, r3, r7 + ldrb r1, [r1] + strb r1, [r0] + adds r3, 0x1 + cmp r3, 0x9 + ble _080A1A52 + b _080A195A + .align 2, 0 +_080A1A64: .4byte gUnknown_8116760 +_080A1A68: .4byte gUnknown_2039D98 +_080A1A6C: .4byte gUnknown_202E2B8 +_080A1A70: + movs r0, 0x9E + movs r1, 0x1 + bl sub_80026E8 + movs r0, 0x91 + movs r1, 0 + bl sub_808D434 + cmp r0, 0 + bne _080A1A9A + ldr r3, _080A1AEC + str r0, [sp] + movs r0, 0x91 + movs r1, 0 + movs r2, 0 + bl sub_808D2E8 + cmp r0, 0 + beq _080A1A9A + bl sub_8097848 +_080A1A9A: + movs r0, 0x92 + movs r1, 0 + bl sub_808D434 + cmp r0, 0 + bne _080A1ABC + ldr r3, _080A1AF0 + str r0, [sp] + movs r0, 0x92 + movs r1, 0 + movs r2, 0 + bl sub_808D2E8 + cmp r0, 0 + beq _080A1ABC + bl sub_8097848 +_080A1ABC: + movs r0, 0x90 + movs r1, 0 + bl sub_808D434 + cmp r0, 0 + beq _080A1ACC + bl _080A236A +_080A1ACC: + ldr r3, _080A1AF4 + str r0, [sp] + movs r0, 0x90 + movs r1, 0 + movs r2, 0 + bl sub_808D2E8 + cmp r0, 0 + bne _080A1AE2 + bl _080A236A +_080A1AE2: + bl sub_8097848 + bl _080A236A + .align 2, 0 +_080A1AEC: .4byte gUnknown_8116788 +_080A1AF0: .4byte gUnknown_811678C +_080A1AF4: .4byte gUnknown_8116790 +_080A1AF8: + movs r0, 0x90 + bl sub_808E734 + lsls r0, 24 + cmp r0, 0 + bne _080A1B08 + bl _080A236A +_080A1B08: + movs r0, 0x91 + bl sub_808E734 + lsls r0, 24 + cmp r0, 0 + bne _080A1B18 + bl _080A236A +_080A1B18: + movs r0, 0x92 + bl sub_808E734 + b _080A171E +_080A1B20: + bl sub_808D33C + ldrh r0, [r0, 0x8] + subs r0, 0x90 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bls _080A1B32 + b _080A1EBE +_080A1B32: + bl _080A236A +_080A1B36: + bl sub_808D33C + cmp r0, 0 + beq _080A1B4A + movs r5, 0x8 + ldrsh r1, [r0, r5] + ldr r0, _080A1B54 + cmp r1, r0 + bne _080A1B4A + b _080A203C +_080A1B4A: + ldr r0, _080A1B54 + bl sub_8098134 + b _080A171E + .align 2, 0 +_080A1B54: .4byte 0x00000113 +_080A1B58: + ldr r0, _080A1B60 + movs r1, 0x79 + b _080A18F6 + .align 2, 0 +_080A1B60: .4byte gUnknown_2039D98 +_080A1B64: + ldr r4, _080A1BCC + adds r0, r4, 0 + bl sub_808DBA8 + lsls r0, 24 + lsrs r0, 24 + bl sub_8092600 + lsls r0, 24 + cmp r0, 0 + bne _080A1B88 + adds r0, r4, 0 + bl sub_808DBA8 + lsls r0, 24 + lsrs r0, 24 + bl sub_80925EC +_080A1B88: + add r1, sp, 0x188 + adds r2, r1, 0 + ldr r0, _080A1BD0 + ldm r0!, {r3,r4,r6} + stm r2!, {r3,r4,r6} + ldm r0!, {r3,r5,r6} + stm r2!, {r3,r5,r6} + ldm r0!, {r4-r6} + stm r2!, {r4-r6} + ldr r0, [r0] + str r0, [r2] + add r4, sp, 0x1B0 + adds r0, r4, 0 + bl sub_808D144 + adds r0, r4, 0 + bl sub_808D1DC + cmp r0, 0 + bne _080A1BB2 + b _080A1EBE +_080A1BB2: + movs r2, 0 + adds r3, r0, 0 + adds r3, 0x4C + ldr r4, _080A1BD4 +_080A1BBA: + adds r0, r3, r2 + adds r1, r2, r4 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x9 + ble _080A1BBA + b _080A1968 + .align 2, 0 +_080A1BCC: .4byte 0x00000199 +_080A1BD0: .4byte gUnknown_8116794 +_080A1BD4: .4byte gUnknown_2039D98 +_080A1BD8: + ldr r0, _080A1BE0 + movs r1, 0x7A + b _080A18F6 + .align 2, 0 +_080A1BE0: .4byte gUnknown_2039D98 +_080A1BE4: + add r1, sp, 0x208 + adds r2, r1, 0 + ldr r0, _080A1C28 + ldm r0!, {r3-r5} + stm r2!, {r3-r5} + ldm r0!, {r3,r4,r6} + stm r2!, {r3,r4,r6} + ldm r0!, {r3,r5,r6} + stm r2!, {r3,r5,r6} + ldr r0, [r0] + str r0, [r2] + add r4, sp, 0x230 + adds r0, r4, 0 + bl sub_808D144 + adds r0, r4, 0 + bl sub_808D1DC + cmp r0, 0 + bne _080A1C0E + b _080A1EBE +_080A1C0E: + movs r2, 0 + adds r3, r0, 0 + adds r3, 0x4C + ldr r4, _080A1C2C +_080A1C16: + adds r0, r3, r2 + adds r1, r2, r4 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x9 + ble _080A1C16 + b _080A1968 + .align 2, 0 +_080A1C28: .4byte gUnknown_81167BC +_080A1C2C: .4byte gUnknown_2039D98 +_080A1C30: + bl sub_8090A34 + cmp r0, 0x13 + ble _080A1C70 + ldr r0, _080A1C64 + ldrb r4, [r0, 0x2] + adds r0, r4, 0 + bl sub_8091524 + lsls r0, 24 + cmp r0, 0 + bne _080A1C4A + b _080A236A +_080A1C4A: + ldr r0, _080A1C68 + ldr r0, [r0] + lsls r1, r4, 1 + adds r0, 0x50 + adds r1, r0, r1 + ldrh r2, [r1] + ldr r0, _080A1C6C + cmp r2, r0 + bls _080A1C5E + b _080A236A +_080A1C5E: + adds r0, r2, 0x1 + strh r0, [r1] + b _080A236A + .align 2, 0 +_080A1C64: .4byte gUnknown_81167E4 +_080A1C68: .4byte gUnknown_203B460 +_080A1C6C: .4byte 0x000003e6 +_080A1C70: + ldr r0, _080A1C80 + ldrb r0, [r0, 0x2] + movs r1, 0 + bl sub_809124C + bl sub_80910B4 + b _080A236A + .align 2, 0 +_080A1C80: .4byte gUnknown_81167E4 +_080A1C84: + movs r0, 0xD1 + lsls r0, 1 + bl RandomCapped + adds r0, 0x1 + lsls r0, 16 + asrs r5, r0, 16 + movs r0, 0x20 + bl RandomCapped + adds r4, r0, 0 + movs r7, 0xD2 + lsls r7, 1 + movs r6, 0 + ldr r0, _080A1DE0 + mov r8, r0 +_080A1CA4: + adds r0, r5, 0x1 + lsls r0, 16 + asrs r5, r0, 16 + cmp r5, r8 + ble _080A1CB0 + movs r5, 0x1 +_080A1CB0: + subs r7, 0x1 + cmp r7, 0 + bge _080A1CCC + cmp r6, 0 + bne _080A1CBC + b _080A2360 +_080A1CBC: + cmp r4, r6 + blt _080A1CCC + adds r0, r6, 0 + bl RandomCapped + adds r4, r0, 0 + movs r7, 0xD2 + lsls r7, 1 +_080A1CCC: + adds r0, r5, 0 + subs r0, 0x90 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x2 + bls _080A1CA4 + ldr r0, _080A1DE4 + cmp r5, r0 + beq _080A1CA4 + adds r0, 0x1 + cmp r5, r0 + beq _080A1CA4 + adds r0, 0xB + cmp r5, r0 + beq _080A1CA4 + subs r0, 0xD + cmp r5, r0 + beq _080A1CA4 + subs r0, 0x88 + cmp r5, r0 + beq _080A1CA4 + adds r0, 0x67 + cmp r5, r0 + beq _080A1CA4 + adds r0, 0x1 + cmp r5, r0 + beq _080A1CA4 + adds r0, 0x1 + cmp r5, r0 + beq _080A1CA4 + adds r0, 0x23 + cmp r5, r0 + beq _080A1CA4 + adds r0, 0x3 + cmp r5, r0 + beq _080A1CA4 + adds r0, 0x1 + cmp r5, r0 + beq _080A1CA4 + cmp r5, r8 + beq _080A1CA4 + cmp r5, 0x96 + beq _080A1CA4 + subs r0, 0x5 + cmp r5, r0 + beq _080A1CA4 + cmp r5, 0x97 + beq _080A1CA4 + subs r0, 0x5 + cmp r5, r0 + beq _080A1CA4 + adds r0, 0x1 + cmp r5, r0 + beq _080A1CA4 + subs r0, 0x8C + cmp r5, r0 + beq _080A1CA4 + subs r0, 0x1 + cmp r5, r0 + beq _080A1CA4 + adds r0, 0x2 + cmp r5, r0 + beq _080A1CA4 + adds r0, 0x5 + cmp r5, r0 + beq _080A1CA4 + adds r0, 0x82 + cmp r5, r0 + beq _080A1CA4 + adds r0, 0x1 + cmp r5, r0 + beq _080A1CA4 + adds r0, 0x1 + cmp r5, r0 + beq _080A1CA4 + subs r0, 0x83 + cmp r5, r0 + beq _080A1CA4 + adds r0, r5, 0 + bl sub_80981DC + lsls r0, 24 + cmp r0, 0 + beq _080A1CA4 + adds r0, r5, 0 + bl sub_808DBA8 + lsls r0, 24 + lsrs r0, 24 + bl sub_8092600 + lsls r0, 24 + cmp r0, 0 + beq _080A1D9E + adds r0, r5, 0 + bl sub_808E734 + lsls r0, 24 + cmp r0, 0 + bne _080A1CA4 + adds r0, r5, 0 + bl sub_808D278 + cmp r0, 0 + beq _080A1CA4 +_080A1D9E: + adds r6, 0x1 + subs r4, 0x1 + cmp r4, 0 + blt _080A1DA8 + b _080A1CA4 +_080A1DA8: + movs r0, 0 + movs r1, 0x1F + adds r2, r5, 0 + bl sub_80018D8 + ldr r4, _080A1DE8 + adds r0, r5, 0 + bl sub_808DBA8 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + movs r2, 0 + bl sub_8092578 + adds r0, r5, 0 + bl sub_808DBA8 + lsls r0, 24 + lsrs r0, 24 + bl sub_8092600 + lsls r0, 24 + cmp r0, 0 + bne _080A1EBE + b _080A203C + .align 2, 0 +_080A1DE0: .4byte 0x000001a3 +_080A1DE4: .4byte 0x0000019b +_080A1DE8: .4byte gUnknown_202E628 +_080A1DEC: + movs r0, 0 + movs r1, 0x1F + bl sub_8001658 + lsls r0, 16 + asrs r5, r0, 16 + ldr r4, _080A1E2C + adds r0, r5, 0 + bl sub_808DBA8 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + movs r2, 0 + bl sub_8092578 + cmp r5, 0 + bne _080A1E14 + b _080A236A +_080A1E14: + adds r0, r5, 0 + bl sub_808DBA8 + lsls r0, 24 + lsrs r0, 24 + bl sub_8092600 + lsls r0, 24 + cmp r0, 0 + bne _080A1EBE + b _080A203C + .align 2, 0 +_080A1E2C: .4byte gUnknown_202E628 +_080A1E30: + ldr r0, _080A1E38 + movs r1, 0x20 + b _080A18F6 + .align 2, 0 +_080A1E38: .4byte gUnknown_2039D98 +_080A1E3C: + cmp r5, 0 + bne _080A1E42 + b _080A2360 +_080A1E42: + movs r0, 0 + movs r1, 0x1F + bl sub_8001658 + lsls r0, 16 + asrs r5, r0, 16 + adds r6, r5, 0 + ldr r4, _080A1EC4 + adds r0, r5, 0 + bl sub_808DBA8 + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + movs r2, 0 + bl sub_8092578 + cmp r5, 0 + bne _080A1E6C + b _080A236A +_080A1E6C: + adds r0, r5, 0 + bl sub_808DBA8 + lsls r0, 24 + lsrs r0, 24 + bl sub_8092600 + lsls r0, 24 + cmp r0, 0 + bne _080A1E8E + adds r0, r5, 0 + bl sub_808DBA8 + lsls r0, 24 + lsrs r0, 24 + bl sub_80925EC +_080A1E8E: + ldr r3, _080A1EC8 + movs r0, 0 + str r0, [sp] + adds r0, r6, 0 + movs r1, 0 + movs r2, 0 + bl sub_808D2E8 + cmp r0, 0 + bne _080A1EA4 + b _080A236A +_080A1EA4: + movs r2, 0 + adds r3, r0, 0 + adds r3, 0x4C + ldr r4, _080A1ECC +_080A1EAC: + adds r0, r3, r2 + adds r1, r2, r4 + ldrb r1, [r1] + strb r1, [r0] + adds r2, 0x1 + cmp r2, 0x9 + ble _080A1EAC + bl sub_8097848 +_080A1EBE: + movs r0, 0x1 + b _080A236C + .align 2, 0 +_080A1EC4: .4byte gUnknown_202E628 +_080A1EC8: .4byte gUnknown_81167E8 +_080A1ECC: .4byte gUnknown_2039D98 +_080A1ED0: + bl sub_809211C + b _080A177C +_080A1ED6: + bl sub_8092178 + lsls r0, 24 + lsrs r4, r0, 24 + bl sub_809211C + cmp r0, 0 + bgt _080A1EE8 + b _080A236A +_080A1EE8: + bl sub_8092158 + bl sub_8092178 + adds r5, r0, 0 + lsls r5, 24 + lsrs r5, 24 + adds r0, r4, 0 + bl sub_80921A8 + adds r1, r0, 0 + ldr r4, _080A1F30 + adds r0, r4, 0 + bl strcpy + adds r0, r5, 0 + bl sub_80921A8 + adds r1, r0, 0 + adds r4, 0x50 + adds r0, r4, 0 + bl strcpy + movs r1, 0x1 + negs r1, r1 + ldr r2, _080A1F34 + movs r0, 0 + bl sub_809AE90 + lsls r0, 24 + cmp r0, 0 + bne _080A1EBE +_080A1F28: + ldr r0, _080A1F38 + bl sub_80913A0 + b _080A236A + .align 2, 0 +_080A1F30: .4byte gUnknown_202DE58 +_080A1F34: .4byte gUnknown_81167EC +_080A1F38: .4byte 0x00002710 +_080A1F3C: + ldr r0, _080A1F40 + b _080A1A00 + .align 2, 0 +_080A1F40: .4byte 0x00000133 +_080A1F44: + ldr r0, _080A1F4C + movs r1, 0x52 + b _080A18F6 + .align 2, 0 +_080A1F4C: .4byte gUnknown_2039D98 +_080A1F50: + add r1, sp, 0x288 + adds r2, r1, 0 + ldr r0, _080A1F7C + ldm r0!, {r3-r5} + stm r2!, {r3-r5} + ldm r0!, {r3,r4,r6} + stm r2!, {r3,r4,r6} + ldm r0!, {r3,r5,r6} + stm r2!, {r3,r5,r6} + ldr r0, [r0] + str r0, [r2] + add r4, sp, 0x2B0 + adds r0, r4, 0 + bl sub_808D144 + adds r0, r4, 0 + bl sub_808D1DC + cmp r0, 0 + beq _080A1EBE + b _080A1968 + .align 2, 0 +_080A1F7C: .4byte gUnknown_811681C +_080A1F80: + movs r2, 0x1 + negs r2, r2 + movs r0, 0x3 + movs r1, 0x12 + bl sub_8001D44 + lsls r0, 24 + cmp r0, 0 + bne _080A1F94 + b _080A236A +_080A1F94: + movs r0, 0 + movs r1, 0xF + bl sub_8001658 + cmp r0, 0x4 + bne _080A1FA2 + b _080A236A +_080A1FA2: + movs r0, 0 + movs r1, 0x42 + movs r2, 0 + bl sub_8001784 + cmp r0, 0 + ble _080A1FB2 + b _080A236A +_080A1FB2: + movs r0, 0x80 + lsls r0, 1 + bl sub_800451C + cmp r0, 0 + bne _080A1FCC + movs r0, 0 + movs r1, 0x42 + movs r2, 0 + movs r3, 0x4 + bl sub_800199C + b _080A1EBE +_080A1FCC: + movs r0, 0 + movs r1, 0x42 + movs r2, 0 + movs r3, 0x1 + bl sub_800199C + b _080A236A +_080A1FDA: + ldr r6, _080A200C + ldr r7, _080A2010 + movs r5, 0x2 +_080A1FE0: + bl sub_8090A34 + cmp r0, 0x13 + ble _080A2018 + ldrb r4, [r6, 0x2] + adds r0, r4, 0 + bl sub_8091524 + lsls r0, 24 + cmp r0, 0 + beq _080A2024 + ldr r0, _080A2014 + ldr r0, [r0] + lsls r1, r4, 1 + adds r0, 0x50 + adds r1, r0, r1 + ldrh r0, [r1] + cmp r0, r7 + bhi _080A2024 + adds r0, 0x1 + strh r0, [r1] + b _080A2024 + .align 2, 0 +_080A200C: .4byte gUnknown_8116844 +_080A2010: .4byte 0x000003e6 +_080A2014: .4byte gUnknown_203B460 +_080A2018: + ldrb r0, [r6, 0x2] + movs r1, 0 + bl sub_809124C + bl sub_80910B4 +_080A2024: + subs r5, 0x1 + cmp r5, 0 + bge _080A1FE0 + b _080A236A +_080A202C: + bl sub_808D33C + cmp r0, 0 + beq _080A2040 + movs r4, 0x8 + ldrsh r0, [r0, r4] + cmp r0, 0x71 + bne _080A2040 +_080A203C: + movs r0, 0x2 + b _080A236C +_080A2040: + movs r0, 0x71 + bl sub_8098134 + bl _080A171E +_080A204A: + movs r0, 0 + movs r1, 0x1 + bl sub_80A56A0 + b _080A236A +_080A2054: + add r0, sp, 0x328 + str r5, [r0] + str r7, [r0, 0x4] + bl sub_80A56F0 + b _080A236A +_080A2060: + add r0, sp, 0x330 + str r5, [r0] + str r7, [r0, 0x4] + bl sub_80A5704 + b _080A236A +_080A206C: + lsls r0, r5, 16 + lsrs r0, 16 + bl sub_809C6CC + b _080A236A +_080A2076: + bl sub_809C6EC + b _080A236A +_080A207C: + bl sub_809C760 + b _080A236A +_080A2082: + movs r0, 0 + movs r4, 0x80 + lsls r4, 9 +_080A2088: + movs r1, 0x80 + lsls r1, 15 + bl sub_80A86C8 + adds r0, r4, 0 + movs r5, 0x80 + lsls r5, 9 + adds r4, r5 + asrs r0, 16 + cmp r0, 0x17 + ble _080A2088 + movs r0, 0 + adds r4, r5, 0 +_080A20A2: + movs r1, 0x80 + lsls r1, 15 + bl sub_80AC1B0 + adds r0, r4, 0 + movs r6, 0x80 + lsls r6, 9 + adds r4, r6 + asrs r0, 16 + cmp r0, 0xF + ble _080A20A2 + movs r0, 0 + adds r4, r6, 0 +_080A20BC: + movs r1, 0x80 + lsls r1, 15 + bl sub_80AD0C8 + adds r0, r4, 0 + movs r1, 0x80 + lsls r1, 9 + adds r4, r1 + asrs r0, 16 + cmp r0, 0xF + ble _080A20BC + b _080A236A +_080A20D4: + add r0, sp, 0x338 + str r5, [r0] + adds r4, r0, 0 + str r7, [r4, 0x4] + movs r0, 0x1 + adds r1, r4, 0 + bl sub_80A5984 + adds r2, r0, 0 + lsls r2, 16 + lsrs r2, 16 + movs r0, 0 + adds r1, r4, 0 + bl sub_80A59A0 + b _080A236A +_080A20F4: + add r1, sp, 0x308 + movs r2, 0 + movs r0, 0x1 + strb r0, [r1] + strb r2, [r1, 0x1] + strb r0, [r1, 0x2] + strb r0, [r1, 0x3] + str r2, [r1, 0x4] + ldr r0, _080A21D8 + ldr r2, _080A21DC + adds r0, r2 + ldr r0, [r0] + str r0, [r1, 0x8] + movs r0, 0x1 + negs r0, r0 + lsls r2, r5, 16 + asrs r2, 16 + lsls r3, r7, 24 + asrs r3, 24 + bl sub_80ACDC4 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + bge _080A2128 + b _080A236A +_080A2128: + bl sub_80AD158 + adds r7, r0, 0 + add r4, sp, 0x340 + add r5, sp, 0x348 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80A579C + ldr r0, [r4, 0x4] + movs r1, 0xC0 + lsls r1, 4 + adds r0, r1 + str r0, [r4, 0x4] + ldr r0, [r5, 0x4] + adds r0, r1 + str r0, [r5, 0x4] + ldr r1, [r6] + ldr r0, [r6, 0x4] + add r6, sp, 0x350 + ldr r2, [r1, 0xC] + adds r1, r6, 0 + bl _call_via_r2 + add r1, sp, 0x350 + ldr r2, [r1] + add r0, sp, 0x340 + ldr r0, [r0] + cmp r2, r0 + blt _080A216E + add r0, sp, 0x348 + ldr r0, [r0] + cmp r2, r0 + blt _080A2170 + subs r0, 0x1 +_080A216E: + str r0, [r1] +_080A2170: + ldr r1, [r6, 0x4] + ldr r0, [r4, 0x4] + cmp r1, r0 + blt _080A2180 + ldr r0, [r5, 0x4] + cmp r1, r0 + blt _080A2182 + subs r0, 0x1 +_080A2180: + str r0, [r6, 0x4] +_080A2182: + add r1, sp, 0x340 + ldr r0, [r1] + ldr r2, _080A21E0 + adds r0, r2 + str r0, [r1] + ldr r0, [r4, 0x4] + adds r0, r2 + str r0, [r4, 0x4] + add r1, sp, 0x348 + ldr r0, [r1] + movs r2, 0x80 + lsls r2, 3 + adds r0, r2 + str r0, [r1] + ldr r0, [r5, 0x4] + adds r0, r2 + str r0, [r5, 0x4] + ldr r1, [r7] + ldr r0, [r7, 0x4] + ldr r3, [r1, 0x20] + adds r1, r4, 0 + adds r2, r5, 0 + bl _call_via_r3 + ldr r1, [r7] + ldr r0, [r7, 0x4] + ldr r2, [r1, 0x24] + adds r1, r6, 0 + bl _call_via_r2 + movs r0, 0 + movs r1, 0 + add r2, sp, 0x358 + str r0, [r2] + str r1, [r2, 0x4] + ldr r2, [r7] + ldr r0, [r7, 0x4] + add r1, sp, 0x358 + ldr r2, [r2, 0x48] + bl _call_via_r2 + b _080A1EBE + .align 2, 0 +_080A21D8: .4byte gUnknown_812F1F8 +_080A21DC: .4byte 0x00001310 +_080A21E0: .4byte 0xfffffc00 +_080A21E4: + ldr r0, _080A2288 + ldrh r4, [r0] + ldrh r0, [r0, 0x2] + movs r1, 0xC + ands r0, r1 + cmp r0, 0 + beq _080A21F4 + b _080A236A +_080A21F4: + adds r0, r4, 0 + bl sub_809CFE8 + lsls r0, 24 + asrs r1, r0, 24 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080A2282 + movs r2, 0x80 + lsls r2, 1 + add r0, sp, 0x360 + bl sub_8002BB8 + add r0, sp, 0x360 + ldr r1, [r0, 0x4] + ldr r0, [r0] + add r2, sp, 0x368 + str r0, [r2] + str r1, [r2, 0x4] + movs r0, 0x2 + ands r4, r0 + cmp r4, 0 + beq _080A2226 + movs r0, 0x4 +_080A2226: + cmp r0, 0 + beq _080A2282 + movs r3, 0xDA + lsls r3, 2 + add r3, sp + mov r9, r3 + add r7, sp, 0x370 + add r4, sp, 0x378 + mov r8, r0 +_080A2238: + ldr r1, [r6] + ldr r0, [r6, 0x4] + ldr r2, [r1, 0x48] + mov r1, r9 + bl _call_via_r2 + cmp r0, 0 + beq _080A2276 + movs r5, 0 + str r5, [r7] + mov r1, r9 + ldr r0, [r1, 0x4] + str r0, [r7, 0x4] + ldr r1, [r6] + ldr r0, [r6, 0x4] + ldr r2, [r1, 0x48] + adds r1, r7, 0 + bl _call_via_r2 + cmp r0, 0 + beq _080A2276 + mov r2, r9 + ldr r0, [r2] + str r0, [r4] + str r5, [r4, 0x4] + ldr r1, [r6] + ldr r0, [r6, 0x4] + ldr r2, [r1, 0x48] + adds r1, r4, 0 + bl _call_via_r2 +_080A2276: + movs r3, 0x1 + negs r3, r3 + add r8, r3 + mov r5, r8 + cmp r5, 0 + bne _080A2238 +_080A2282: + movs r0, 0x1 + negs r0, r0 + b _080A236C + .align 2, 0 +_080A2288: .4byte gUnknown_20255F0 +_080A228C: + negs r0, r5 + orrs r0, r5 + lsrs r0, 31 + bl sub_80993C0 + b _080A236A +_080A2298: + movs r0, 0x1 + bl sub_8011C28 +_080A229E: + adds r0, r5, 0 + bl sub_8098F00 + lsls r0, r5, 16 + lsrs r0, 16 + bl sub_80118C4 + b _080A236A +_080A22AE: + bl sub_800C068 + ldr r1, _080A22C4 + strh r0, [r1] + lsls r0, 16 + ldr r1, _080A22C8 + cmp r0, r1 + beq _080A22C0 + b _080A1EBE +_080A22C0: + b _080A236A + .align 2, 0 +_080A22C4: .4byte gUnknown_2039DA8 +_080A22C8: .4byte 0x03e70000 +_080A22CC: + ldr r4, _080A22DC + ldrh r0, [r4] + ldr r5, _080A22E0 + cmp r0, r5 + beq _080A236A + bl sub_80118F0 + b _080A2312 + .align 2, 0 +_080A22DC: .4byte gUnknown_2039DA8 +_080A22E0: .4byte 0x000003e7 +_080A22E4: + ldr r4, _080A22FC + ldrh r0, [r4] + ldr r6, _080A2300 + cmp r0, r6 + beq _080A236A + lsls r1, r5, 16 + lsrs r1, 16 + bl sub_8011900 + strh r6, [r4] + b _080A1EBE + .align 2, 0 +_080A22FC: .4byte gUnknown_2039DA8 +_080A2300: .4byte 0x000003e7 +_080A2304: + ldr r4, _080A2318 + ldrh r0, [r4] + ldr r5, _080A231C + cmp r0, r5 + beq _080A236A + bl sub_8011914 +_080A2312: + strh r5, [r4] + b _080A1EBE + .align 2, 0 +_080A2318: .4byte gUnknown_2039DA8 +_080A231C: .4byte 0x000003e7 +_080A2320: + lsls r0, r5, 16 + lsrs r0, 16 + lsls r1, r7, 16 + lsrs r1, 16 + bl sub_80997F4 + b _080A236A +_080A232E: + lsls r1, r5, 16 + lsrs r1, 16 + movs r0, 0x1E + bl sub_80997F4 + b _080A236A +_080A233A: + lsls r1, r5, 16 + lsrs r1, 16 + movs r0, 0 + bl sub_80A6A90 + b _080A236A +_080A2346: + movs r0, 0 + bl sub_80A6C88 + b _080A236A +_080A234E: + movs r0, 0 + movs r1, 0x2F + adds r2, r4, 0 + movs r3, 0x1 + bl sub_800199C + adds r0, r5, 0 + subs r0, 0x10 + b _080A236C +_080A2360: + movs r0, 0 + movs r1, 0x1F + movs r2, 0 + bl sub_80018D8 +_080A236A: + movs r0, 0 +_080A236C: + movs r3, 0xE0 + lsls r3, 2 + add sp, r3 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80A14E8 + + thumb_func_start sub_80A2380 +sub_80A2380: + push {r4-r7,lr} + ldr r1, _080A241C + ldrb r0, [r1] + cmp r0, 0 + beq _080A2414 + movs r0, 0 + strb r0, [r1] + movs r6, 0 +_080A2390: + ldr r0, _080A2420 + adds r7, r6, r0 + ldrb r0, [r7] + cmp r0, 0 + beq _080A240E + movs r0, 0x1 + ldr r1, _080A2424 + adds r2, r6, 0 + bl Log + lsls r5, r6, 16 + asrs r5, 16 + adds r0, r5, 0 + bl sub_80A4D2C + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + bl sub_80A8B1C + orrs r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + bl sub_80AC320 + orrs r4, r0 + lsls r4, 24 + lsrs r4, 24 + adds r0, r5, 0 + bl sub_80AD238 + orrs r4, r0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _080A2428 + adds r5, r6, r0 + ldrb r0, [r5] + cmp r0, 0 + beq _080A240C + cmp r4, 0 + beq _080A240E + movs r0, 0x80 + adds r4, r6, 0 + orrs r4, r0 + lsls r4, 16 + asrs r4, 16 + adds r0, r4, 0 + bl sub_80A4D2C + adds r0, r4, 0 + bl sub_80A8B1C + adds r0, r4, 0 + bl sub_80AC320 + adds r0, r4, 0 + bl sub_80AD238 + movs r0, 0 + strb r0, [r5] +_080A240C: + strb r0, [r7] +_080A240E: + adds r6, 0x1 + cmp r6, 0x80 + ble _080A2390 +_080A2414: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A241C: .4byte gUnknown_2039A36 +_080A2420: .4byte gUnknown_2039A38 +_080A2424: .4byte gUnknown_8116848 +_080A2428: .4byte gUnknown_2039AC0 + thumb_func_end sub_80A2380 + + thumb_func_start sub_80A242C +sub_80A242C: + push {r4-r7,lr} + sub sp, 0x10 + adds r4, r1, 0 + ldr r0, [r0, 0x2C] + adds r2, r0, 0 + adds r2, 0x10 + mov r3, sp +_080A243A: + mov r1, sp + adds r0, r2, 0 + ldm r0!, {r5-r7} + stm r1!, {r5-r7} + ldr r0, [r0] + str r0, [r1] + adds r2, 0x10 + ldrb r0, [r3] + cmp r0, 0xF4 + bne _080A243A + movs r1, 0x2 + ldrsh r0, [r3, r1] + cmp r4, r0 + bne _080A243A + adds r0, r2, 0 + add sp, 0x10 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80A242C + + thumb_func_start sub_80A2460 +sub_80A2460: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + adds r5, r0, 0 + mov r8, r1 + ldr r6, [r5, 0x28] + mov r4, sp +_080A2470: + mov r0, sp + adds r1, r6, 0 + ldm r1!, {r2,r3,r7} + stm r0!, {r2,r3,r7} + ldr r1, [r1] + str r1, [r0] + ldrb r0, [r4] + cmp r0, 0xCC + bne _080A249E + ldr r1, [sp, 0x4] + mov r0, r8 + movs r2, 0x2 + bl sub_80022E8 + lsls r0, 24 + cmp r0, 0 + beq _080A24F0 + movs r0, 0x2 + ldrsh r1, [r4, r0] + adds r0, r5, 0 + bl sub_80A242C + b _080A24F4 +_080A249E: + cmp r0, 0xCD + bne _080A24BE + ldr r1, [sp, 0x4] + ldrb r2, [r4, 0x1] + mov r0, r8 + bl sub_80022E8 + lsls r0, 24 + cmp r0, 0 + beq _080A24F0 + movs r2, 0x2 + ldrsh r1, [r4, r2] + adds r0, r5, 0 + bl sub_80A242C + b _080A24F4 +_080A24BE: + cmp r0, 0xCE + bne _080A24EC + ldr r1, [sp, 0x4] + lsls r1, 16 + asrs r1, 16 + adds r0, r5, 0 + adds r0, 0x74 + bl sub_8001658 + adds r1, r0, 0 + ldrb r2, [r4, 0x1] + mov r0, r8 + bl sub_80022E8 + lsls r0, 24 + cmp r0, 0 + beq _080A24F0 + movs r3, 0x2 + ldrsh r1, [r4, r3] + adds r0, r5, 0 + bl sub_80A242C + b _080A24F4 +_080A24EC: + adds r0, r6, 0 + b _080A24F4 +_080A24F0: + adds r6, 0x10 + b _080A2470 +_080A24F4: + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80A2460 + + thumb_func_start sub_80A2500 +sub_80A2500: + push {r4,lr} + adds r4, r0, 0 + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0x1 + bne _080A2524 + lsls r4, 16 + asrs r4, 16 + movs r2, 0x2 + ldrsh r0, [r1, r2] + bl sub_80A8BBC + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + bl sub_809AB4C +_080A2524: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A2500 + + thumb_func_start sub_80A252C +sub_80A252C: + push {r4,lr} + adds r4, r0, 0 + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0x1 + bne _080A2550 + lsls r4, 16 + asrs r4, 16 + movs r2, 0x2 + ldrsh r0, [r1, r2] + bl sub_80A8BBC + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + bl sub_809ABB4 +_080A2550: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A252C + + thumb_func_start sub_80A2558 +sub_80A2558: + push {r4,lr} + adds r4, r0, 0 + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0x1 + bne _080A257C + lsls r4, 16 + asrs r4, 16 + movs r2, 0x2 + ldrsh r0, [r1, r2] + bl sub_80A8BBC + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + adds r0, r4, 0 + bl sub_809AC18 +_080A257C: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A2558 + + thumb_func_start sub_80A2584 +sub_80A2584: + push {lr} + lsls r1, 16 + asrs r1, 16 + lsls r0, 16 + asrs r0, 16 + bl sub_809ABB4 + pop {r0} + bx r0 + thumb_func_end sub_80A2584 + + thumb_func_start sub_80A2598 +sub_80A2598: + push {lr} + lsls r1, 16 + asrs r1, 16 + lsls r0, 16 + asrs r0, 16 + bl sub_809AC18 + pop {r0} + bx r0 + thumb_func_end sub_80A2598 + + thumb_func_start sub_80A25AC +sub_80A25AC: + push {r4,r5,lr} + lsls r0, 16 + lsrs r4, r0, 16 + adds r5, r4, 0 + bl sub_8098F88 + lsls r0, 24 + cmp r0, 0 + beq _080A25C2 + adds r0, r4, 0 + b _080A2602 +_080A25C2: + cmp r4, 0x32 + bne _080A25CA + movs r0, 0x32 + b _080A2602 +_080A25CA: + movs r0, 0xC + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + bne _080A25E0 + ldr r0, _080A25DC + b _080A2602 + .align 2, 0 +_080A25DC: .4byte 0x000003e7 +_080A25E0: + movs r0, 0xD + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _080A25F0 + movs r0, 0x13 + b _080A2602 +_080A25F0: + cmp r4, 0x1 + bne _080A2600 + movs r0, 0 + movs r1, 0x28 + bl sub_8001658 + movs r0, 0x1 + b _080A2602 +_080A2600: + adds r0, r5, 0 +_080A2602: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80A25AC + + thumb_func_start sub_80A2608 +sub_80A2608: + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + ldr r1, _080A261C + adds r0, r1 + bx lr + .align 2, 0 +_080A261C: .4byte gUnknown_81168A8 + thumb_func_end sub_80A2608 + + thumb_func_start sub_80A2620 +sub_80A2620: + push {lr} + lsls r0, 16 + asrs r0, 16 + bl sub_80A26B8 + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + lsls r0, r1, 2 + adds r0, r1 + lsls r0, 2 + ldr r1, _080A2640 + adds r0, r1 + pop {r1} + bx r1 + .align 2, 0 +_080A2640: .4byte gUnknown_81168A8 + thumb_func_end sub_80A2620 + + thumb_func_start sub_80A2644 +sub_80A2644: + ldr r1, _080A2650 + lsls r0, 1 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + bx lr + .align 2, 0 +_080A2650: .4byte gUnknown_8116F24 + thumb_func_end sub_80A2644 + + thumb_func_start sub_80A2654 +sub_80A2654: + push {lr} + lsls r0, 16 + asrs r0, 16 + bl sub_80A2608 + movs r1, 0xE + ldrsh r0, [r0, r1] + pop {r1} + bx r1 + thumb_func_end sub_80A2654 + + thumb_func_start sub_80A2668 +sub_80A2668: + push {lr} + lsls r0, 16 + ldr r2, _080A267C + adds r1, r0, r2 + lsrs r0, r1, 16 + cmp r0, 0x18 + bls _080A2680 + movs r0, 0x1 + negs r0, r0 + b _080A2682 + .align 2, 0 +_080A267C: .4byte 0xffc90000 +_080A2680: + asrs r0, r1, 16 +_080A2682: + pop {r1} + bx r1 + thumb_func_end sub_80A2668 + + thumb_func_start sub_80A2688 +sub_80A2688: + push {lr} + lsls r0, 24 + lsrs r1, r0, 24 + adds r3, r1, 0 + adds r2, r1, 0 + subs r2, 0x4B + lsls r0, r2, 24 + lsrs r0, 24 + cmp r0, 0x16 + bhi _080A26A0 + adds r0, r2, 0 + b _080A26B4 +_080A26A0: + cmp r1, 0x2F + bne _080A26A8 + movs r0, 0x17 + b _080A26B4 +_080A26A8: + cmp r3, 0x30 + beq _080A26B2 + movs r0, 0x1 + negs r0, r0 + b _080A26B4 +_080A26B2: + movs r0, 0x18 +_080A26B4: + pop {r1} + bx r1 + thumb_func_end sub_80A2688 + + thumb_func_start sub_80A26B8 +sub_80A26B8: + lsls r0, 16 + ldr r1, _080A26C8 + asrs r0, 15 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + bx lr + .align 2, 0 +_080A26C8: .4byte gUnknown_8116F9A + thumb_func_end sub_80A26B8 + + thumb_func_start sub_80A26CC +sub_80A26CC: + lsls r0, 16 + movs r1, 0xDC + lsls r1, 14 + adds r0, r1 + asrs r0, 16 + bx lr + thumb_func_end sub_80A26CC + + thumb_func_start sub_80A26D8 +sub_80A26D8: + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 +_080A26E0: + lsls r0, r5, 16 + asrs r4, r0, 16 + adds r0, r4, 0 + bl sub_80A2608 + adds r1, r0, 0 + ldrb r0, [r1, 0x11] + cmp r0, 0 + beq _080A26FC + ldrb r0, [r1, 0xC] + cmp r0, r6 + bne _080A26FC + adds r0, r4, 0 + b _080A2706 +_080A26FC: + adds r5, 0x1 + cmp r5, 0x52 + ble _080A26E0 + movs r0, 0x1 + negs r0, r0 +_080A2706: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80A26D8 + + thumb_func_start sub_80A270C +sub_80A270C: + push {lr} + lsls r0, 16 + ldr r1, _080A2724 + asrs r0, 15 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + bl sub_80A2608 + ldrb r0, [r0, 0xC] + pop {r1} + bx r1 + .align 2, 0 +_080A2724: .4byte gUnknown_8116F9A + thumb_func_end sub_80A270C + + thumb_func_start sub_80A2728 +sub_80A2728: + push {lr} + lsls r0, 16 + movs r1, 0xDC + lsls r1, 14 + adds r0, r1 + asrs r0, 16 + bl sub_80A2608 + ldrb r0, [r0, 0xC] + pop {r1} + bx r1 + thumb_func_end sub_80A2728 + + thumb_func_start sub_80A2740 +sub_80A2740: + push {lr} + lsls r0, 16 + asrs r0, 16 + bl sub_80A2608 + ldrb r0, [r0, 0xC] + pop {r1} + bx r1 + thumb_func_end sub_80A2740 + + thumb_func_start sub_80A2750 +sub_80A2750: + push {r4,lr} + lsls r0, 16 + asrs r1, r0, 16 + adds r2, r1, 0 + cmp r1, 0x50 + bne _080A2760 + movs r0, 0x3 + b _080A27C4 +_080A2760: + cmp r1, 0x51 + beq _080A27BE + cmp r1, 0x52 + beq _080A2780 + adds r0, r1, 0 + subs r0, 0x28 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xE + bls _080A27BE + adds r0, r1, 0 + subs r0, 0x37 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x18 + bhi _080A2784 +_080A2780: + movs r0, 0x4 + b _080A27C4 +_080A2784: + adds r0, r2, 0 + bl sub_80A2608 + adds r4, r0, 0 + movs r0, 0xE + ldrsh r1, [r4, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080A27C2 + movs r0, 0x5 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + bne _080A27C2 + movs r1, 0xE + ldrsh r0, [r4, r1] + bl sub_80973F4 + lsls r0, 24 + cmp r0, 0 + beq _080A27C2 + movs r0, 0x1 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _080A27C2 +_080A27BE: + movs r0, 0x2 + b _080A27C4 +_080A27C2: + movs r0, 0x1 +_080A27C4: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80A2750 + + thumb_func_start sub_80A27CC +sub_80A27CC: + push {r4,r5,lr} + lsls r0, 16 + asrs r4, r0, 16 + adds r5, r4, 0 + adds r0, r4, 0 + bl sub_80A2620 + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080A281A + movs r0, 0x5 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + bne _080A281A + adds r0, r4, 0 + bl sub_8097384 + lsls r0, 24 + cmp r0, 0 + bne _080A2816 + movs r0, 0x1 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _080A281A + adds r0, r5, 0 + bl sub_80973F4 + lsls r0, 24 + cmp r0, 0 + beq _080A281A +_080A2816: + movs r0, 0x1 + b _080A281C +_080A281A: + movs r0, 0 +_080A281C: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80A27CC + + thumb_func_start sub_80A2824 +sub_80A2824: + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r0, 0x5 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + bne _080A28AC + movs r0, 0x1 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _080A2880 + movs r5, 0 +_080A2844: + lsls r0, r5, 16 + asrs r4, r0, 16 + adds r0, r4, 0 + bl sub_80A2620 + adds r1, r0, 0 + ldrb r0, [r1, 0x11] + cmp r0, 0 + beq _080A2874 + ldrb r0, [r1, 0xC] + cmp r0, r6 + bne _080A2874 + adds r0, r4, 0 + bl sub_8097384 + lsls r0, 24 + cmp r0, 0 + bne _080A287C + adds r0, r4, 0 + bl sub_80973F4 + lsls r0, 24 + cmp r0, 0 + bne _080A287C +_080A2874: + adds r5, 0x1 + cmp r5, 0x2D + ble _080A2844 + b _080A28AC +_080A287C: + movs r0, 0x1 + b _080A28AE +_080A2880: + movs r5, 0 +_080A2882: + lsls r0, r5, 16 + asrs r4, r0, 16 + adds r0, r4, 0 + bl sub_80A2620 + adds r1, r0, 0 + ldrb r0, [r1, 0x11] + cmp r0, 0 + beq _080A28A6 + ldrb r0, [r1, 0xC] + cmp r0, r6 + bne _080A28A6 + adds r0, r4, 0 + bl sub_8097384 + lsls r0, 24 + cmp r0, 0 + bne _080A287C +_080A28A6: + adds r5, 0x1 + cmp r5, 0x2D + ble _080A2882 +_080A28AC: + movs r0, 0 +_080A28AE: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80A2824 + + thumb_func_start sub_80A28B4 +sub_80A28B4: + push {r4,lr} + lsls r0, 16 + asrs r4, r0, 16 + adds r0, r4, 0 + bl sub_80A2620 + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080A28E8 + adds r0, r4, 0 + bl sub_8097384 + lsls r0, 24 + cmp r0, 0 + bne _080A28E4 + adds r0, r4, 0 + bl sub_80973F4 + lsls r0, 24 + cmp r0, 0 + beq _080A28E8 +_080A28E4: + movs r0, 0x1 + b _080A28EA +_080A28E8: + movs r0, 0 +_080A28EA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80A28B4 + + thumb_func_start sub_80A28F0 +sub_80A28F0: + push {r4-r6,lr} + lsls r0, 24 + lsrs r6, r0, 24 + movs r5, 0 +_080A28F8: + lsls r0, r5, 16 + asrs r4, r0, 16 + adds r0, r4, 0 + bl sub_80A2620 + adds r1, r0, 0 + ldrb r0, [r1, 0x11] + cmp r0, 0 + beq _080A292C + ldrb r0, [r1, 0xC] + cmp r0, r6 + bne _080A292C + adds r0, r4, 0 + bl sub_8097384 + lsls r0, 24 + cmp r0, 0 + bne _080A2928 + adds r0, r4, 0 + bl sub_80973F4 + lsls r0, 24 + cmp r0, 0 + beq _080A292C +_080A2928: + movs r0, 0x1 + b _080A2934 +_080A292C: + adds r5, 0x1 + cmp r5, 0x2D + ble _080A28F8 + movs r0, 0 +_080A2934: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80A28F0 + + thumb_func_start sub_80A293C +sub_80A293C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x40 + mov r8, r0 + movs r7, 0 + movs r1, 0 + mov r0, sp + adds r0, 0x3E +_080A294E: + strb r1, [r0] + subs r0, 0x1 + cmp r0, sp + bge _080A294E + movs r5, 0 +_080A2958: + lsls r0, r5, 16 + asrs r4, r0, 16 + adds r0, r4, 0 + bl sub_80A2620 + adds r6, r0, 0 + ldrb r0, [r6, 0x11] + cmp r0, 0 + beq _080A2980 + adds r0, r4, 0 + bl sub_8097384 + lsls r0, 24 + cmp r0, 0 + beq _080A2980 + ldrb r0, [r6, 0xC] + mov r2, sp + adds r1, r2, r0 + movs r0, 0x1 + strb r0, [r1] +_080A2980: + adds r5, 0x1 + cmp r5, 0x2D + ble _080A2958 + movs r5, 0 +_080A2988: + mov r1, sp + adds r0, r1, r5 + ldrb r0, [r0] + cmp r0, 0 + beq _080A299A + mov r2, r8 + adds r0, r2, r7 + strb r5, [r0] + adds r7, 0x1 +_080A299A: + adds r5, 0x1 + cmp r5, 0x3E + ble _080A2988 + adds r0, r7, 0 + add sp, 0x40 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80A293C + + thumb_func_start sub_80A29B0 +sub_80A29B0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x48 + mov r8, r0 + movs r7, 0 + movs r0, 0x2B + add r0, sp + mov r9, r0 + add r1, sp, 0x2C + mov r10, r1 + mov r2, sp + adds r2, 0x2D + str r2, [sp, 0x40] + mov r0, sp + adds r0, 0x2E + str r0, [sp, 0x44] + movs r1, 0 + adds r0, 0x10 +_080A29DA: + strb r1, [r0] + subs r0, 0x1 + cmp r0, sp + bge _080A29DA + movs r0, 0x1 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _080A2A1E + movs r5, 0 +_080A29F0: + lsls r0, r5, 16 + asrs r4, r0, 16 + adds r0, r4, 0 + bl sub_80A2620 + adds r6, r0, 0 + ldrb r0, [r6, 0x11] + cmp r0, 0 + beq _080A2A18 + adds r0, r4, 0 + bl sub_80973F4 + lsls r0, 24 + cmp r0, 0 + beq _080A2A18 + ldrb r0, [r6, 0xC] + mov r2, sp + adds r1, r2, r0 + movs r0, 0x1 + strb r0, [r1] +_080A2A18: + adds r5, 0x1 + cmp r5, 0x2D + ble _080A29F0 +_080A2A1E: + movs r0, 0 + mov r1, r9 + strb r0, [r1] + mov r2, r10 + strb r0, [r2] + ldr r1, [sp, 0x40] + strb r0, [r1] + ldr r2, [sp, 0x44] + strb r0, [r2] + movs r5, 0 +_080A2A32: + mov r1, sp + adds r0, r1, r5 + ldrb r0, [r0] + cmp r0, 0 + beq _080A2A44 + mov r2, r8 + adds r0, r2, r7 + strb r5, [r0] + adds r7, 0x1 +_080A2A44: + adds r5, 0x1 + cmp r5, 0x3E + ble _080A2A32 + adds r0, r7, 0 + add sp, 0x48 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80A29B0 + + thumb_func_start sub_80A2A5C +sub_80A2A5C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x40 + mov r8, r0 + movs r7, 0 + movs r1, 0 + mov r0, sp + adds r0, 0x3E +_080A2A6E: + strb r1, [r0] + subs r0, 0x1 + cmp r0, sp + bge _080A2A6E + movs r0, 0x1 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _080A2AC0 + movs r6, 0 +_080A2A84: + lsls r0, r6, 16 + asrs r4, r0, 16 + adds r0, r4, 0 + bl sub_80A2620 + adds r5, r0, 0 + ldrb r0, [r5, 0x11] + cmp r0, 0 + beq _080A2AB8 + adds r0, r4, 0 + bl sub_8097384 + lsls r0, 24 + cmp r0, 0 + bne _080A2AAE + adds r0, r4, 0 + bl sub_80973F4 + lsls r0, 24 + cmp r0, 0 + beq _080A2AB8 +_080A2AAE: + ldrb r0, [r5, 0xC] + mov r2, sp + adds r1, r2, r0 + movs r0, 0x1 + strb r0, [r1] +_080A2AB8: + adds r6, 0x1 + cmp r6, 0x2D + ble _080A2A84 + b _080A2AF0 +_080A2AC0: + movs r6, 0 +_080A2AC2: + lsls r0, r6, 16 + asrs r4, r0, 16 + adds r0, r4, 0 + bl sub_80A2620 + adds r5, r0, 0 + ldrb r0, [r5, 0x11] + cmp r0, 0 + beq _080A2AEA + adds r0, r4, 0 + bl sub_8097384 + lsls r0, 24 + cmp r0, 0 + beq _080A2AEA + ldrb r0, [r5, 0xC] + mov r2, sp + adds r1, r2, r0 + movs r0, 0x1 + strb r0, [r1] +_080A2AEA: + adds r6, 0x1 + cmp r6, 0x2D + ble _080A2AC2 +_080A2AF0: + movs r6, 0 +_080A2AF2: + mov r1, sp + adds r0, r1, r6 + ldrb r0, [r0] + cmp r0, 0 + beq _080A2B04 + mov r2, r8 + adds r0, r2, r7 + strb r6, [r0] + adds r7, 0x1 +_080A2B04: + adds r6, 0x1 + cmp r6, 0x3E + ble _080A2AF2 + adds r0, r7, 0 + add sp, 0x40 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80A2A5C + + thumb_func_start sub_80A2B18 +sub_80A2B18: + lsls r0, 16 + ldr r1, _080A2B24 + asrs r0, 14 + adds r0, r1 + ldr r0, [r0] + bx lr + .align 2, 0 +_080A2B24: .4byte gUnknown_8117000 + thumb_func_end sub_80A2B18 + + thumb_func_start sub_80A2B28 +sub_80A2B28: + push {lr} + movs r0, 0 + movs r1, 0x11 + bl sub_8001658 + lsls r0, 16 + asrs r0, 16 + bl sub_80A2B18 + pop {r1} + bx r1 + thumb_func_end sub_80A2B28 + + thumb_func_start sub_80A2B40 +sub_80A2B40: + push {r4-r6,lr} + adds r5, r0, 0 + ldr r2, _080A2BFC + adds r0, r5, r2 + ldm r1!, {r2-r4} + stm r0!, {r2-r4} + ldm r1!, {r2-r4} + stm r0!, {r2-r4} + ldr r3, _080A2C00 + adds r0, r5, r3 + movs r4, 0 + ldrsh r1, [r0, r4] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 1 + movs r1, 0x6 + bl MemoryAlloc + movs r2, 0xA9 + lsls r2, 3 + adds r1, r5, r2 + str r0, [r1] + movs r6, 0 + movs r3, 0xA7 + lsls r3, 3 + adds r0, r5, r3 + movs r4, 0 + ldrsh r0, [r0, r4] + cmp r6, r0 + bge _080A2BC0 +_080A2B7C: + lsls r4, r6, 2 + ldr r0, _080A2C04 + adds r2, r5, r0 + adds r2, r4 + ldr r1, _080A2C08 + adds r0, r5, r1 + movs r3, 0 + ldrsh r0, [r0, r3] + adds r1, r6, 0x2 + adds r0, r1 + lsls r0, 11 + ldr r1, _080A2C0C + adds r0, r1 + str r0, [r2] + ldr r1, _080A2C10 + adds r0, r5, r1 + movs r2, 0 + ldrsh r0, [r0, r2] + lsls r0, 7 + movs r1, 0x6 + bl MemoryAlloc + ldr r3, _080A2C14 + adds r1, r5, r3 + adds r1, r4 + str r0, [r1] + adds r6, 0x1 + movs r4, 0xA7 + lsls r4, 3 + adds r0, r5, r4 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r6, r0 + blt _080A2B7C +_080A2BC0: + cmp r6, 0x1 + bgt _080A2BD8 + movs r1, 0 + lsls r0, r6, 2 + ldr r2, _080A2C14 + adds r0, r2 + adds r0, r5 +_080A2BCE: + str r1, [r0, 0x8] + stm r0!, {r1} + adds r6, 0x1 + cmp r6, 0x1 + ble _080A2BCE +_080A2BD8: + movs r3, 0xA8 + lsls r3, 3 + adds r0, r5, r3 + ldr r1, [r0] + cmp r1, 0 + beq _080A2C20 + ldr r4, _080A2C18 + adds r0, r5, r4 + movs r1, 0 + ldrsh r0, [r0, r1] + lsls r0, 8 + movs r1, 0x6 + bl MemoryAlloc + ldr r2, _080A2C1C + adds r1, r5, r2 + str r0, [r1] + b _080A2C26 + .align 2, 0 +_080A2BFC: .4byte 0x0000052c +_080A2C00: .4byte 0x00000534 +_080A2C04: .4byte 0x00000554 +_080A2C08: .4byte 0x00000536 +_080A2C0C: .4byte gUnknown_202B038 +_080A2C10: .4byte 0x0000053c +_080A2C14: .4byte 0x0000054c +_080A2C18: .4byte 0x0000053a +_080A2C1C: .4byte 0x00000544 +_080A2C20: + ldr r3, _080A2CF0 + adds r0, r5, r3 + str r1, [r0] +_080A2C26: + movs r4, 0x86 + lsls r4, 3 + adds r0, r5, r4 + movs r1, 0 + str r1, [r0] + ldr r2, _080A2CF4 + adds r0, r5, r2 + str r1, [r0] + movs r3, 0x87 + lsls r3, 3 + adds r0, r5, r3 + str r1, [r0] + adds r4, 0xC + adds r0, r5, r4 + str r1, [r0] + adds r2, 0xC + adds r0, r5, r2 + str r1, [r0] + adds r3, 0xF2 + adds r0, r5, r3 + strb r1, [r0] + adds r4, 0x8 + adds r2, r5, r4 + ldr r0, _080A2CF8 + strh r0, [r2] + movs r2, 0x8D + lsls r2, 3 + adds r0, r5, r2 + str r1, [r0] + subs r3, 0xE2 + adds r0, r5, r3 + strb r1, [r0] + adds r4, 0x5 + adds r0, r5, r4 + strb r1, [r0] + subs r2, 0x1E + adds r0, r5, r2 + strb r1, [r0] + adds r3, 0x3 + adds r0, r5, r3 + strb r1, [r0] + adds r4, 0x3 + adds r0, r5, r4 + strb r1, [r0] + adds r2, 0x3 + adds r0, r5, r2 + strb r1, [r0] + adds r2, r5, 0 + adds r3, 0x21 + adds r0, r5, r3 + str r1, [r0] + adds r4, 0x24 + adds r0, r5, r4 + strb r1, [r0] + adds r3, 0x5 + adds r0, r5, r3 + strb r1, [r0] + movs r0, 0 + movs r1, 0xD +_080A2C9C: + strh r0, [r2] + strh r0, [r2, 0x2] + str r0, [r2, 0x8] + str r0, [r2, 0x4] + subs r1, 0x1 + adds r2, 0x10 + cmp r1, 0 + bge _080A2C9C + movs r1, 0 + movs r4, 0xF8 + lsls r4, 2 + adds r0, r5, r4 + movs r2, 0x1 +_080A2CB6: + strb r1, [r0] + strb r1, [r0, 0x1] + strh r1, [r0, 0x2] + strh r1, [r0, 0x4] + str r1, [r0, 0x8] + str r1, [r0, 0xC] + str r1, [r0, 0x14] + str r1, [r0, 0x10] + str r1, [r0, 0x1C] + str r1, [r0, 0x18] + str r1, [r0, 0x20] + str r1, [r0, 0x24] + adds r0, 0x28 + subs r2, 0x1 + cmp r2, 0 + bge _080A2CB6 + movs r4, 0 +_080A2CD8: + adds r0, r5, 0 + adds r1, r4, 0 + ldr r2, _080A2CFC + bl sub_80A456C + adds r4, 0x1 + cmp r4, 0x1 + ble _080A2CD8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080A2CF0: .4byte 0x00000544 +_080A2CF4: .4byte 0x00000434 +_080A2CF8: .4byte 0x0000ffff +_080A2CFC: .4byte gUnknown_81172B8 + thumb_func_end sub_80A2B40 + + thumb_func_start sub_80A2D00 +sub_80A2D00: + push {r4-r7,lr} + adds r6, r0, 0 + bl sub_80A2DD4 + ldr r0, _080A2D5C + adds r4, r6, r0 + ldr r0, [r4] + cmp r0, 0 + beq _080A2D1A + bl MemoryFree + movs r0, 0 + str r0, [r4] +_080A2D1A: + movs r1, 0xA9 + lsls r1, 3 + adds r4, r6, r1 + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] + movs r5, 0 + movs r7, 0 +_080A2D2E: + lsls r2, r5, 2 + ldr r1, _080A2D60 + adds r0, r6, r1 + adds r1, r0, r2 + ldr r0, [r1] + cmp r0, 0 + beq _080A2D3E + str r7, [r1] +_080A2D3E: + ldr r1, _080A2D64 + adds r0, r6, r1 + adds r4, r0, r2 + ldr r0, [r4] + cmp r0, 0 + beq _080A2D50 + bl MemoryFree + str r7, [r4] +_080A2D50: + adds r5, 0x1 + cmp r5, 0x1 + ble _080A2D2E + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A2D5C: .4byte 0x00000544 +_080A2D60: .4byte 0x00000554 +_080A2D64: .4byte 0x0000054c + thumb_func_end sub_80A2D00 + + thumb_func_start sub_80A2D68 +sub_80A2D68: + push {r4,lr} + ldr r1, _080A2D84 + adds r4, r0, r1 + ldr r0, [r4] + cmp r0, 0 + beq _080A2D7C + bl MemoryFree + movs r0, 0 + str r0, [r4] +_080A2D7C: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A2D84: .4byte 0x00000544 + thumb_func_end sub_80A2D68 + + thumb_func_start sub_80A2D88 +sub_80A2D88: + push {r4-r7,lr} + adds r6, r0, 0 + movs r0, 0xA8 + lsls r0, 3 + adds r7, r6, r0 + ldr r0, [r7] + cmp r0, 0 + beq _080A2DC6 + movs r1, 0x89 + lsls r1, 3 + adds r5, r6, r1 + ldr r2, _080A2DCC + adds r4, r6, r2 + movs r1, 0 + ldrsh r0, [r4, r1] + lsls r0, 8 + movs r1, 0x6 + bl MemoryAlloc + ldr r2, _080A2DD0 + adds r1, r6, r2 + str r0, [r1] + subs r2, 0xDC + adds r1, r6, r2 + ldr r1, [r1] + movs r2, 0 + ldrsh r3, [r4, r2] + ldr r4, [r7] + adds r2, r5, 0 + bl _call_via_r4 +_080A2DC6: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A2DCC: .4byte 0x0000053a +_080A2DD0: .4byte 0x00000544 + thumb_func_end sub_80A2D88 + + thumb_func_start sub_80A2DD4 +sub_80A2DD4: + push {r4-r6,lr} + adds r6, r0, 0 + movs r0, 0xFA + lsls r0, 2 + adds r4, r6, r0 + movs r5, 0x1 +_080A2DE0: + ldr r0, [r4] + cmp r0, 0 + beq _080A2DEE + bl sub_800AA14 + movs r0, 0 + str r0, [r4] +_080A2DEE: + adds r4, 0x28 + subs r5, 0x1 + cmp r5, 0 + bge _080A2DE0 + ldr r0, _080A2E5C + adds r4, r6, r0 + ldr r0, [r4] + cmp r0, 0 + beq _080A2E08 + bl sub_800AA14 + movs r0, 0 + str r0, [r4] +_080A2E08: + movs r0, 0x88 + lsls r0, 3 + adds r4, r6, r0 + ldr r0, [r4] + cmp r0, 0 + beq _080A2E1C + bl sub_800AA14 + movs r0, 0 + str r0, [r4] +_080A2E1C: + movs r0, 0x86 + lsls r0, 3 + adds r4, r6, r0 + ldr r0, [r4] + cmp r0, 0 + beq _080A2E30 + bl sub_800AA14 + movs r0, 0 + str r0, [r4] +_080A2E30: + ldr r0, _080A2E60 + adds r4, r6, r0 + ldr r0, [r4] + cmp r0, 0 + beq _080A2E42 + bl sub_800AA14 + movs r0, 0 + str r0, [r4] +_080A2E42: + movs r0, 0x87 + lsls r0, 3 + adds r4, r6, r0 + ldr r0, [r4] + cmp r0, 0 + beq _080A2E56 + bl sub_800AA14 + movs r0, 0 + str r0, [r4] +_080A2E56: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080A2E5C: .4byte 0x0000043c +_080A2E60: .4byte 0x00000434 + thumb_func_end sub_80A2DD4 + + thumb_func_start sub_80A2E64 +sub_80A2E64: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r7, r0, 0 + bl sub_80A2DD4 + ldr r0, _080A2FA4 + adds r1, r7, r0 + ldr r0, _080A2FA8 + strh r0, [r1] + movs r1, 0xA5 + lsls r1, 3 + adds r0, r7, r1 + movs r1, 0 + movs r2, 0 + strh r2, [r0] + movs r3, 0x89 + lsls r3, 3 + adds r0, r7, r3 + strb r1, [r0] + ldr r4, _080A2FAC + adds r0, r7, r4 + strb r1, [r0] + adds r3, 0x2 + adds r0, r7, r3 + strb r1, [r0] + adds r4, 0x2 + adds r0, r7, r4 + strb r1, [r0] + adds r3, 0x2 + adds r0, r7, r3 + strb r1, [r0] + adds r4, 0x2 + adds r0, r7, r4 + strb r1, [r0] + adds r3, r7, 0 + adds r4, 0x1F + adds r0, r7, r4 + str r2, [r0] + movs r2, 0x8E + lsls r2, 3 + adds r0, r7, r2 + strb r1, [r0] + adds r4, 0x5 + adds r0, r7, r4 + strb r1, [r0] + movs r0, 0 + movs r1, 0xD +_080A2ECA: + strh r0, [r3] + strh r0, [r3, 0x2] + str r0, [r3, 0x8] + str r0, [r3, 0x4] + subs r1, 0x1 + adds r3, 0x10 + cmp r1, 0 + bge _080A2ECA + movs r1, 0 + movs r2, 0xF8 + lsls r2, 2 + adds r0, r7, r2 + movs r2, 0x1 +_080A2EE4: + strb r1, [r0] + strb r1, [r0, 0x1] + strh r1, [r0, 0x2] + strh r1, [r0, 0x4] + str r1, [r0, 0x8] + str r1, [r0, 0xC] + str r1, [r0, 0x14] + str r1, [r0, 0x10] + str r1, [r0, 0x1C] + str r1, [r0, 0x18] + str r1, [r0, 0x20] + str r1, [r0, 0x24] + adds r0, 0x28 + subs r2, 0x1 + cmp r2, 0 + bge _080A2EE4 + ldr r3, _080A2FB0 + adds r0, r7, r3 + movs r4, 0 + ldrsh r0, [r0, r4] + lsls r0, 20 + lsrs r6, r0, 16 + movs r5, 0 + ldr r1, _080A2FB4 + adds r0, r7, r1 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r5, r0 + bge _080A2F78 + mov r10, r5 + add r4, sp, 0x4 + movs r3, 0xFF + mov r9, r3 +_080A2F26: + mov r0, r10 + str r0, [sp] + ldrb r0, [r4] + mov r1, r9 + orrs r0, r1 + strb r0, [r4] + ldrb r0, [r4, 0x1] + orrs r0, r1 + strb r0, [r4, 0x1] + ldrb r0, [r4, 0x2] + orrs r0, r1 + strb r0, [r4, 0x2] + mov r2, r10 + strb r2, [r4, 0x3] + adds r0, r6, 0 + adds r1, r0, 0x1 + lsls r1, 16 + lsrs r6, r1, 16 + ldr r1, [sp] + bl sub_8003810 + adds r5, 0x1 + mov r8, r5 + movs r5, 0xE +_080A2F56: + adds r0, r6, 0 + adds r1, r0, 0x1 + lsls r1, 16 + lsrs r6, r1, 16 + ldr r1, [sp, 0x4] + bl sub_8003810 + subs r5, 0x1 + cmp r5, 0 + bge _080A2F56 + mov r5, r8 + ldr r3, _080A2FB4 + adds r0, r7, r3 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r5, r0 + blt _080A2F26 +_080A2F78: + adds r0, r7, 0 + movs r1, 0 + bl sub_80A3BB0 + movs r2, 0x91 + lsls r2, 3 + adds r0, r7, r2 + bl sub_80A3EB0 + ldr r3, _080A2FB8 + adds r1, r7, r3 + movs r0, 0x1 + strb r0, [r1] + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A2FA4: .4byte 0x00000444 +_080A2FA8: .4byte 0x0000ffff +_080A2FAC: .4byte 0x00000449 +_080A2FB0: .4byte 0x0000052c +_080A2FB4: .4byte 0x0000052e +_080A2FB8: .4byte 0x0000052a + thumb_func_end sub_80A2E64 + + thumb_func_start sub_80A2FBC +sub_80A2FBC: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + mov r9, r0 + lsls r1, 16 + asrs r4, r1, 16 + movs r0, 0x1 + negs r0, r0 + cmp r4, r0 + bne _080A2FDE + mov r0, r9 + bl sub_80A2E64 + b _080A3428 +_080A2FDE: + mov r0, r9 + bl sub_80A2DD4 + ldr r0, _080A3284 + add r0, r9 + strh r4, [r0] + lsls r0, r4, 3 + subs r0, r4 + lsls r0, 2 + ldr r1, _080A3288 + adds r0, r1 + str r0, [sp, 0xC] + ldr r0, [r0] + ldr r4, _080A328C + adds r1, r4, 0 + bl sub_800A9EC + movs r6, 0x86 + lsls r6, 3 + add r6, r9 + str r0, [r6] + ldr r1, [sp, 0xC] + ldr r0, [r1, 0x4] + adds r1, r4, 0 + bl sub_800A9EC + ldr r5, _080A3290 + add r5, r9 + str r0, [r5] + ldr r2, [sp, 0xC] + ldr r0, [r2, 0x8] + adds r1, r4, 0 + bl sub_800A9EC + movs r1, 0x87 + lsls r1, 3 + add r1, r9 + str r0, [r1] + ldr r1, [r6] + ldr r1, [r1, 0x4] + str r1, [sp, 0x18] + ldr r1, [r5] + ldr r1, [r1, 0x4] + mov r8, r1 + ldr r6, [r0, 0x4] + ldr r3, _080A3294 + add r3, r9 + str r3, [sp, 0x10] + ldr r4, _080A3298 + add r4, r9 + str r4, [sp, 0x14] + movs r5, 0x89 + lsls r5, 3 + add r5, r9 + mov r10, r5 + ldr r7, [sp, 0x18] + ldrb r0, [r7] + strh r0, [r3] + adds r0, r7, 0 + adds r0, 0x2 + str r0, [sp, 0x18] + ldrb r0, [r0] + strh r0, [r3, 0x2] + ldr r1, [sp, 0x18] + adds r1, 0x2 + str r1, [sp, 0x18] + mov r2, r8 + ldrh r0, [r2] + strh r0, [r4] + movs r3, 0x2 + add r8, r3 + mov r4, r8 + ldrh r0, [r4] + ldr r5, [sp, 0x14] + strh r0, [r5, 0x2] + add r8, r3 + mov r7, r8 + ldrh r0, [r7] + strh r0, [r5, 0x4] + add r8, r3 + add r3, sp, 0x8 + ldr r0, _080A329C + add r0, r9 + str r0, [sp, 0x1C] + adds r1, r0, 0 + movs r2, 0x3 +_080A308A: + mov r4, r8 + ldrh r0, [r4] + strh r0, [r1] + movs r5, 0x2 + add r8, r5 + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _080A308A + mov r7, r8 + ldrh r0, [r7] + movs r2, 0 + movs r1, 0 + ldr r4, [sp, 0x14] + strh r0, [r4, 0xE] + add r8, r5 + ldrb r0, [r6] + mov r5, r10 + strb r0, [r5] + adds r6, 0x1 + ldrb r0, [r6] + strb r0, [r5, 0x1] + adds r6, 0x1 + ldrb r0, [r6] + strb r0, [r5, 0x2] + adds r6, 0x1 + ldrb r0, [r6] + strb r0, [r5, 0x3] + adds r6, 0x1 + ldrb r0, [r6] + strb r0, [r5, 0x4] + adds r6, 0x1 + ldrb r0, [r6] + strb r0, [r5, 0x5] + adds r6, 0x1 + ldrb r0, [r6] + strh r0, [r5, 0x6] + adds r6, 0x2 + ldrb r0, [r6] + strh r0, [r5, 0x8] + adds r6, 0x2 + ldrb r0, [r6] + strh r0, [r5, 0xA] + adds r6, 0x2 + ldr r7, [sp, 0x18] + ldr r0, _080A32A0 + add r0, r9 + movs r4, 0 + ldrsh r0, [r0, r4] + lsls r0, 20 + lsrs r5, r0, 16 + str r1, [sp, 0x4] + movs r0, 0xFF + strb r0, [r3] + movs r0, 0x1 + negs r0, r0 + strb r0, [r3, 0x1] + strb r0, [r3, 0x2] + strb r2, [r3, 0x3] + movs r4, 0 + ldr r1, [sp, 0x10] + movs r2, 0 + ldrsh r0, [r1, r2] + ldr r3, [sp, 0xC] + adds r3, 0xC + str r3, [sp, 0x20] + cmp r4, r0 + bge _080A3158 + ldr r0, _080A32A4 + add r0, r9 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r4, r0 + bge _080A3198 +_080A311E: + adds r0, r5, 0 + adds r1, r0, 0x1 + lsls r1, 16 + lsrs r5, r1, 16 + ldr r1, [sp, 0x4] + bl sub_8003810 + adds r0, r5, 0 + adds r1, r7, 0 + movs r2, 0xF + bl sub_809971C + adds r0, r5, 0 + adds r0, 0xF + lsls r0, 16 + lsrs r5, r0, 16 + adds r7, 0x3C + adds r4, 0x1 + ldr r2, [sp, 0x10] + movs r3, 0 + ldrsh r0, [r2, r3] + cmp r4, r0 + bge _080A3158 + ldr r0, _080A32A4 + add r0, r9 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r4, r0 + blt _080A311E +_080A3158: + ldr r0, _080A32A4 + add r0, r9 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r4, r0 + bge _080A3198 +_080A3164: + adds r0, r5, 0 + adds r1, r0, 0x1 + lsls r1, 16 + lsrs r5, r1, 16 + ldr r1, [sp, 0x4] + bl sub_8003810 + adds r7, r4, 0x1 + movs r4, 0xE +_080A3176: + adds r0, r5, 0 + adds r1, r0, 0x1 + lsls r1, 16 + lsrs r5, r1, 16 + ldr r1, [sp, 0x8] + bl sub_8003810 + subs r4, 0x1 + cmp r4, 0 + bge _080A3176 + adds r4, r7, 0 + ldr r0, _080A32A4 + add r0, r9 + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r4, r0 + blt _080A3164 +_080A3198: + movs r0, 0xA6 + lsls r0, 3 + add r0, r9 + movs r4, 0 + ldrsh r0, [r0, r4] + lsls r0, 5 + ldr r5, _080A32A8 + adds r0, r5 + ldr r4, _080A32A0 + add r4, r9 + ldr r5, _080A3298 + add r5, r9 + mov r1, r8 + adds r2, r4, 0 + adds r3, r5, 0 + bl sub_80A37C4 + movs r0, 0xA9 + lsls r0, 3 + add r0, r9 + ldr r0, [r0] + movs r1, 0xA5 + lsls r1, 3 + add r1, r9 + ldr r7, [sp, 0x14] + movs r3, 0x4 + ldrsh r2, [r7, r3] + subs r2, 0x1 + lsls r2, 5 + add r2, r8 + str r5, [sp] + adds r3, r4, 0 + bl sub_80A382C + ldr r0, _080A32AC + add r0, r9 + movs r3, 0x89 + lsls r3, 3 + add r3, r9 + adds r1, r6, 0 + adds r2, r4, 0 + bl sub_80A3908 + adds r6, r0, 0 + movs r0, 0x8D + lsls r0, 3 + add r0, r9 + str r6, [r0] + ldr r0, _080A32B0 + add r0, r9 + ldr r2, [r0] + cmp r2, 0 + beq _080A321C + movs r1, 0xA8 + lsls r1, 3 + add r1, r9 + ldr r0, _080A32B4 + add r0, r9 + movs r4, 0 + ldrsh r3, [r0, r4] + ldr r4, [r1] + adds r0, r2, 0 + adds r1, r6, 0 + mov r2, r10 + bl _call_via_r4 +_080A321C: + mov r2, r9 + movs r4, 0 + ldr r5, [sp, 0x10] + movs r6, 0x2 + ldrsh r0, [r5, r6] + cmp r0, 0 + beq _080A32E4 + movs r7, 0 + ldrsh r1, [r5, r7] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 2 + ldr r5, [sp, 0x18] + adds r3, r5, r0 + lsls r1, 2 + adds r6, r3, r1 + ldr r0, _080A32B8 + add r0, r9 + str r3, [r0] + movs r0, 0x8E + lsls r0, 3 + add r0, r9 + movs r1, 0x1 + strb r1, [r0] + ldr r0, _080A32BC + add r0, r9 + strb r1, [r0] + ldr r7, [sp, 0x10] + movs r1, 0 + ldrsh r0, [r7, r1] + cmp r4, r0 + bge _080A32F8 + ldr r1, _080A32A4 + add r1, r9 + movs r5, 0 + ldrsh r0, [r1, r5] + cmp r4, r0 + bge _080A32F8 + movs r5, 0 + mov r8, r1 +_080A326C: + movs r7, 0x2 + ldrsh r0, [r3, r7] + cmp r0, 0 + ble _080A32C0 + str r6, [r2, 0x4] + movs r0, 0x2 + ldrsh r1, [r3, r0] + lsls r0, r1, 4 + subs r0, r1 + lsls r0, 2 + adds r6, r0 + b _080A32C2 + .align 2, 0 +_080A3284: .4byte 0x00000444 +_080A3288: .4byte gUnknown_81188F0 +_080A328C: .4byte 0x09890000 +_080A3290: .4byte 0x00000434 +_080A3294: .4byte 0x00000464 +_080A3298: .4byte 0x00000454 +_080A329C: .4byte 0x0000045a +_080A32A0: .4byte 0x0000052c +_080A32A4: .4byte 0x0000052e +_080A32A8: .4byte 0x06008000 +_080A32AC: .4byte 0x0000054c +_080A32B0: .4byte 0x00000544 +_080A32B4: .4byte 0x0000053a +_080A32B8: .4byte 0x0000046c +_080A32BC: .4byte 0x00000471 +_080A32C0: + str r5, [r2, 0x4] +_080A32C2: + strh r5, [r2] + strh r5, [r2, 0x2] + str r5, [r2, 0x8] + adds r4, 0x1 + adds r2, 0x10 + adds r3, 0x4 + ldr r1, [sp, 0x10] + movs r7, 0 + ldrsh r0, [r1, r7] + cmp r4, r0 + bge _080A32F8 + mov r1, r8 + movs r7, 0 + ldrsh r0, [r1, r7] + cmp r4, r0 + blt _080A326C + b _080A32F8 +_080A32E4: + ldr r0, _080A3384 + add r0, r9 + str r4, [r0] + movs r0, 0x8E + lsls r0, 3 + add r0, r9 + strb r4, [r0] + ldr r0, _080A3388 + add r0, r9 + strb r4, [r0] +_080A32F8: + cmp r4, 0xD + bgt _080A330E + movs r0, 0 +_080A32FE: + strh r0, [r2] + strh r0, [r2, 0x2] + str r0, [r2, 0x8] + str r0, [r2, 0x4] + adds r4, 0x1 + adds r2, 0x10 + cmp r4, 0xD + ble _080A32FE +_080A330E: + movs r0, 0xA6 + lsls r0, 3 + add r0, r9 + movs r1, 0 + ldrsh r0, [r0, r1] + ldr r2, [sp, 0x14] + movs r3, 0x4 + ldrsh r1, [r2, r3] + adds r0, r1 + lsls r0, 5 + ldr r4, _080A338C + adds r5, r0, r4 + movs r7, 0 + movs r6, 0 + mov r8, r6 + movs r4, 0xF8 + lsls r4, 2 + add r4, r9 + ldr r0, [sp, 0x1C] + str r0, [sp, 0x28] + ldr r3, [sp, 0x20] +_080A3338: + ldr r0, [r3] + cmp r0, 0 + beq _080A3394 + ldr r1, _080A3390 + str r3, [sp, 0x24] + bl sub_800A9EC + str r0, [r4, 0x8] + movs r1, 0x1 + strb r1, [r4] + strb r1, [r4, 0x1] + ldr r2, [r0, 0x4] + str r2, [r4, 0xC] + adds r1, r2, 0x4 + movs r0, 0x2 + ldrsh r6, [r2, r0] + lsls r6, 2 + adds r0, r1, r6 + str r1, [r4, 0x14] + str r1, [r4, 0x10] + str r0, [r4, 0x1C] + str r0, [r4, 0x18] + mov r1, r8 + strh r1, [r4, 0x2] + ldr r0, [r2, 0x4] + strh r0, [r4, 0x4] + str r5, [r4, 0x20] + ldr r2, [sp, 0x28] + movs r6, 0 + ldrsh r0, [r2, r6] + lsls r0, 5 + str r0, [r4, 0x24] + movs r1, 0 + ldrsh r0, [r2, r1] + lsls r0, 5 + adds r5, r0 + ldr r3, [sp, 0x24] + b _080A33AC + .align 2, 0 +_080A3384: .4byte 0x0000046c +_080A3388: .4byte 0x00000471 +_080A338C: .4byte 0x06008000 +_080A3390: .4byte 0x09890000 +_080A3394: + strb r0, [r4] + strb r0, [r4, 0x1] + strh r0, [r4, 0x4] + strh r0, [r4, 0x2] + str r0, [r4, 0x8] + str r0, [r4, 0xC] + str r0, [r4, 0x14] + str r0, [r4, 0x10] + str r0, [r4, 0x1C] + str r0, [r4, 0x18] + str r0, [r4, 0x20] + str r0, [r4, 0x24] +_080A33AC: + adds r4, 0x28 + ldr r2, [sp, 0x28] + adds r2, 0x2 + str r2, [sp, 0x28] + adds r3, 0x4 + adds r7, 0x1 + cmp r7, 0x1 + ble _080A3338 + cmp r7, 0x3 + bgt _080A340E +_080A33C0: + lsls r0, r7, 2 + ldr r3, [sp, 0x20] + adds r0, r3, r0 + ldr r0, [r0] + adds r4, r7, 0x1 + cmp r0, 0 + beq _080A3408 + ldr r1, _080A3438 + bl sub_800A9EC + adds r3, r0, 0 + ldr r0, [r3, 0x4] + adds r1, r0, 0x4 + movs r6, 0x2 + ldrsh r0, [r0, r6] + lsls r0, 2 + adds r1, r0 + lsls r0, r7, 1 + ldr r7, [sp, 0x1C] + adds r0, r7, r0 + movs r2, 0 + ldrsh r0, [r0, r2] + lsls r0, 4 + cmp r0, 0 + ble _080A3402 + adds r2, r0, 0 +_080A33F4: + ldrh r0, [r1] + strh r0, [r5] + adds r1, 0x2 + adds r5, 0x2 + subs r2, 0x1 + cmp r2, 0 + bne _080A33F4 +_080A3402: + adds r0, r3, 0 + bl sub_800AA14 +_080A3408: + adds r7, r4, 0 + cmp r7, 0x3 + ble _080A33C0 +_080A340E: + mov r0, r9 + movs r1, 0 + bl sub_80A3BB0 + movs r0, 0x91 + lsls r0, 3 + add r0, r9 + bl sub_80A3EB0 + ldr r1, _080A343C + add r1, r9 + movs r0, 0x1 + strb r0, [r1] +_080A3428: + add sp, 0x2C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A3438: .4byte 0x09890000 +_080A343C: .4byte 0x0000052a + thumb_func_end sub_80A2FBC + + thumb_func_start sub_80A3440 +sub_80A3440: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4C + mov r9, r0 + str r2, [sp, 0x34] + str r3, [sp, 0x38] + lsls r1, 16 + asrs r5, r1, 16 + movs r0, 0x1 + negs r0, r0 + cmp r5, r0 + beq _080A3464 + ldrb r0, [r2] + cmp r0, 0x63 + bne _080A346C +_080A3464: + mov r0, r9 + bl sub_80A2E64 + b _080A376C +_080A346C: + mov r0, r9 + adds r1, r5, 0 + bl sub_80A2FBC + mov r0, r9 + bl sub_80A2DD4 + ldr r0, _080A377C + add r0, r9 + strh r5, [r0] + lsls r4, r5, 3 + subs r4, r5 + lsls r4, 2 + ldr r0, _080A3780 + adds r4, r0 + ldr r0, [r4] + ldr r5, _080A3784 + adds r1, r5, 0 + bl sub_800A9EC + movs r1, 0x86 + lsls r1, 3 + add r1, r9 + mov r8, r1 + str r0, [r1] + ldr r0, [r4, 0x4] + adds r1, r5, 0 + bl sub_800A9EC + ldr r6, _080A3788 + add r6, r9 + str r0, [r6] + ldr r0, [r4, 0x8] + adds r1, r5, 0 + bl sub_800A9EC + movs r1, 0x87 + lsls r1, 3 + add r1, r9 + str r0, [r1] + mov r2, r8 + ldr r1, [r2] + ldr r2, [r1, 0x4] + ldr r1, [r6] + ldr r3, [r1, 0x4] + ldr r7, [r0, 0x4] + ldr r1, _080A378C + add r1, r9 + ldr r4, _080A3790 + add r4, r9 + str r4, [sp, 0x3C] + movs r0, 0x89 + lsls r0, 3 + add r0, r9 + mov r10, r0 + ldrb r0, [r2] + strh r0, [r1] + ldrb r0, [r2, 0x2] + strh r0, [r1, 0x2] + ldrh r0, [r3] + strh r0, [r4] + adds r3, 0x2 + ldrh r0, [r3] + strh r0, [r4, 0x2] + adds r3, 0x2 + ldrh r0, [r3] + strh r0, [r4, 0x4] + adds r3, 0x2 + add r5, sp, 0x2C + ldr r1, _080A3794 + add r1, r9 + str r1, [sp, 0x48] + movs r2, 0x3 +_080A34FE: + ldrh r0, [r3] + strh r0, [r1] + adds r3, 0x2 + adds r1, 0x2 + subs r2, 0x1 + cmp r2, 0 + bge _080A34FE + ldrh r0, [r3] + movs r2, 0 + mov r8, r2 + ldr r4, [sp, 0x3C] + strh r0, [r4, 0xE] + ldrb r0, [r7] + mov r1, r10 + strb r0, [r1] + adds r7, 0x1 + ldrb r0, [r7] + strb r0, [r1, 0x1] + adds r7, 0x1 + ldrb r0, [r7] + strb r0, [r1, 0x2] + adds r7, 0x1 + ldrb r0, [r7] + strb r0, [r1, 0x3] + adds r7, 0x1 + ldrb r0, [r7] + strb r0, [r1, 0x4] + adds r7, 0x1 + ldrb r0, [r7] + strb r0, [r1, 0x5] + adds r7, 0x1 + ldrb r0, [r7] + strh r0, [r1, 0x6] + adds r7, 0x2 + ldrb r0, [r7] + strh r0, [r1, 0x8] + adds r7, 0x2 + ldrb r0, [r7] + strh r0, [r1, 0xA] + adds r7, 0x2 + ldr r4, _080A3798 + add r4, r9 + ldr r0, [r4] + str r0, [sp, 0x2C] + str r2, [r5, 0x4] + ldr r2, _080A379C + add r2, r9 + movs r3, 0x89 + lsls r3, 3 + add r3, r9 + adds r0, r5, 0 + adds r1, r7, 0 + bl sub_80A3908 + adds r7, r0, 0 + movs r0, 0x8D + lsls r0, 3 + add r0, r9 + str r7, [r0] + ldr r5, _080A37A0 + add r5, r9 + movs r6, 0x88 + lsls r6, 3 + add r6, r9 + ldr r2, _080A37A4 + movs r0, 0xA9 + lsls r0, 3 + add r0, r9 + ldr r3, [r0] + ldr r0, _080A37A8 + add r0, r9 + ldr r0, [r0] + str r0, [sp] + ldr r0, [sp, 0x34] + str r0, [sp, 0x4] + ldr r1, [sp, 0x38] + str r1, [sp, 0x8] + movs r0, 0x40 + str r0, [sp, 0xC] + mov r1, r10 + ldrb r0, [r1, 0x5] + str r0, [sp, 0x10] + ldr r0, [r4] + str r0, [sp, 0x14] + mov r0, r8 + str r0, [sp, 0x18] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_80ADD9C + ldr r0, [r5] + movs r1, 0 + bl sub_800A9D8 + ldr r0, [r6] + movs r1, 0 + bl sub_800A9D8 + movs r2, 0xA8 + lsls r2, 3 + add r2, r9 + ldr r0, [r4] + ldr r1, _080A37AC + add r1, r9 + movs r4, 0 + ldrsh r3, [r1, r4] + ldr r4, [r2] + adds r1, r7, 0 + mov r2, r10 + bl _call_via_r4 + movs r0, 0x80 + lsls r0, 2 + ldr r1, [sp, 0x3C] + strh r0, [r1, 0x4] + ldr r1, [sp, 0x48] + movs r2, 0 + adds r0, r1, 0x6 +_080A35EA: + strh r2, [r0] + subs r0, 0x2 + cmp r0, r1 + bge _080A35EA + movs r2, 0 + movs r0, 0xFA + ldr r4, [sp, 0x3C] + strh r0, [r4, 0xE] + ldr r1, _080A378C + add r1, r9 + movs r0, 0xC + strh r0, [r1] + ldr r0, _080A37B0 + add r0, r9 + strh r2, [r0] + ldr r0, _080A37A0 + add r0, r9 + ldr r0, [r0] + cmp r0, 0 + beq _080A36E6 + ldr r4, [r0, 0x4] + movs r7, 0 + str r7, [sp, 0x1C] + add r1, sp, 0x20 + movs r0, 0xFF + strb r0, [r1] + movs r0, 0x1 + negs r0, r0 + strb r0, [r1, 0x1] + strb r0, [r1, 0x2] + movs r0, 0 + strb r0, [r1, 0x3] + movs r5, 0 + ldr r0, _080A37B4 + add r0, r9 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r5, r0 + bge _080A36E6 + mov r2, sp + adds r2, 0x28 + str r2, [sp, 0x40] + mov r0, sp + adds r0, 0x29 + str r0, [sp, 0x44] + movs r1, 0x2A + add r1, sp + mov r10, r1 + movs r2, 0x2B + add r2, sp + mov r8, r2 +_080A3650: + adds r0, r7, 0 + adds r1, r0, 0x1 + lsls r1, 16 + lsrs r7, r1, 16 + ldr r1, [sp, 0x1C] + bl sub_8003810 + adds r4, 0x4 + adds r6, r5, 0x1 + movs r5, 0xE +_080A3664: + ldrb r0, [r4] + ldr r1, [sp, 0x40] + strb r0, [r1] + ldrb r0, [r4, 0x1] + ldr r2, [sp, 0x44] + strb r0, [r2] + ldrb r0, [r4, 0x2] + mov r1, r10 + strb r0, [r1] + ldrb r0, [r4, 0x3] + mov r2, r8 + strb r0, [r2] + ldr r1, [sp, 0x28] + str r1, [sp, 0x24] + adds r0, r7, 0 + adds r2, r0, 0x1 + lsls r2, 16 + lsrs r7, r2, 16 + bl sub_8003810 + adds r4, 0x4 + subs r5, 0x1 + cmp r5, 0 + bge _080A3664 + adds r5, r6, 0 + cmp r5, 0xB + bgt _080A36A6 + ldr r0, _080A37B4 + add r0, r9 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r5, r0 + blt _080A3650 +_080A36A6: + ldr r0, _080A37B4 + add r0, r9 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r5, r0 + bge _080A36E6 +_080A36B2: + adds r0, r7, 0 + adds r1, r0, 0x1 + lsls r1, 16 + lsrs r7, r1, 16 + ldr r1, [sp, 0x1C] + bl sub_8003810 + adds r6, r5, 0x1 + movs r5, 0xE +_080A36C4: + adds r0, r7, 0 + adds r1, r0, 0x1 + lsls r1, 16 + lsrs r7, r1, 16 + ldr r1, [sp, 0x20] + bl sub_8003810 + subs r5, 0x1 + cmp r5, 0 + bge _080A36C4 + adds r5, r6, 0 + ldr r0, _080A37B4 + add r0, r9 + movs r4, 0 + ldrsh r0, [r0, r4] + cmp r5, r0 + blt _080A36B2 +_080A36E6: + mov r4, r9 + movs r0, 0x88 + lsls r0, 3 + add r0, r9 + ldr r1, [r0] + cmp r1, 0 + beq _080A36FE + mov r0, r9 + adds r0, 0xE0 + movs r2, 0x20 + bl sub_8004AA4 +_080A36FE: + ldr r0, _080A37B8 + add r0, r9 + movs r1, 0 + str r1, [r0] + movs r0, 0x8E + lsls r0, 3 + add r0, r9 + strb r1, [r0] + ldr r0, _080A37BC + add r0, r9 + strb r1, [r0] + movs r0, 0 + movs r1, 0xD +_080A3718: + strh r0, [r4] + strh r0, [r4, 0x2] + str r0, [r4, 0x8] + str r0, [r4, 0x4] + subs r1, 0x1 + adds r4, 0x10 + cmp r1, 0 + bge _080A3718 + movs r1, 0 + movs r0, 0xF8 + lsls r0, 2 + add r0, r9 + movs r2, 0x1 +_080A3732: + strb r1, [r0] + strb r1, [r0, 0x1] + strh r1, [r0, 0x4] + strh r1, [r0, 0x2] + str r1, [r0, 0x8] + str r1, [r0, 0xC] + str r1, [r0, 0x14] + str r1, [r0, 0x10] + str r1, [r0, 0x1C] + str r1, [r0, 0x18] + str r1, [r0, 0x20] + str r1, [r0, 0x24] + adds r0, 0x28 + subs r2, 0x1 + cmp r2, 0 + bge _080A3732 + mov r0, r9 + movs r1, 0 + bl sub_80A3BB0 + movs r0, 0x91 + lsls r0, 3 + add r0, r9 + bl sub_80A3EB0 + ldr r1, _080A37C0 + add r1, r9 + movs r0, 0x1 + strb r0, [r1] +_080A376C: + add sp, 0x4C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A377C: .4byte 0x00000444 +_080A3780: .4byte gUnknown_81188F0 +_080A3784: .4byte 0x09890000 +_080A3788: .4byte 0x00000434 +_080A378C: .4byte 0x00000464 +_080A3790: .4byte 0x00000454 +_080A3794: .4byte 0x0000045a +_080A3798: .4byte 0x00000544 +_080A379C: .4byte 0x0000052c +_080A37A0: .4byte 0x0000043c +_080A37A4: .4byte 0x06008000 +_080A37A8: .4byte 0x0000054c +_080A37AC: .4byte 0x0000053a +_080A37B0: .4byte 0x00000466 +_080A37B4: .4byte 0x0000052e +_080A37B8: .4byte 0x0000046c +_080A37BC: .4byte 0x00000471 +_080A37C0: .4byte 0x0000052a + thumb_func_end sub_80A3440 + + thumb_func_start sub_80A37C4 +sub_80A37C4: + push {r4-r6,lr} + adds r6, r2, 0 + adds r4, r1, 0 + adds r2, r0, 0 + movs r0, 0 + movs r1, 0xF +_080A37D0: + strh r0, [r2] + adds r2, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _080A37D0 + movs r0, 0x1 + movs r1, 0x4 + ldrsh r3, [r3, r1] + cmp r0, r3 + bge _080A37FE + adds r5, r3, 0 +_080A37E6: + adds r3, r0, 0x1 + movs r1, 0xF +_080A37EA: + ldrh r0, [r4] + strh r0, [r2] + adds r4, 0x2 + adds r2, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _080A37EA + adds r0, r3, 0 + cmp r0, r5 + blt _080A37E6 +_080A37FE: + movs r3, 0x6 + ldrsh r1, [r6, r3] + cmp r0, r1 + bge _080A3820 + ldr r3, _080A3828 + adds r4, r3, 0 + adds r5, r1, 0 +_080A380C: + adds r3, r0, 0x1 + movs r1, 0xF +_080A3810: + strh r4, [r2] + adds r2, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _080A3810 + adds r0, r3, 0 + cmp r0, r5 + blt _080A380C +_080A3820: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080A3828: .4byte 0x0000ffff + thumb_func_end sub_80A37C4 + + thumb_func_start sub_80A382C +sub_80A382C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r1, 0 + mov r8, r3 + ldr r3, [sp, 0x18] + adds r4, r2, 0 + adds r2, r0, 0 + mov r1, r8 + ldrh r0, [r1] + lsls r0, 12 + ldrh r1, [r1, 0x4] + orrs r0, r1 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r1, [r3] + ldr r0, _080A385C + cmp r1, r0 + bne _080A3860 + movs r0, 0x1 + strh r0, [r5] + movs r5, 0x4 + b _080A3890 + .align 2, 0 +_080A385C: .4byte 0x00020002 +_080A3860: + ldr r0, _080A3870 + cmp r1, r0 + bne _080A3874 + movs r0, 0x2 + strh r0, [r5] + movs r5, 0x9 + b _080A3890 + .align 2, 0 +_080A3870: .4byte 0x00030003 +_080A3874: + movs r0, 0 + strh r0, [r5] + ldr r0, _080A3888 + ldr r1, _080A388C + movs r4, 0 + ldrsh r2, [r3, r4] + movs r6, 0x2 + ldrsh r3, [r3, r6] + bl FatalError + .align 2, 0 +_080A3888: .4byte gUnknown_81172E8 +_080A388C: .4byte gUnknown_81172F4 +_080A3890: + movs r0, 0 + movs r1, 0x8 +_080A3894: + strh r0, [r2] + adds r2, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _080A3894 + movs r0, 0x1 + movs r7, 0xE + ldrsh r1, [r3, r7] + cmp r0, r1 + bge _080A38DC + mov r12, r1 +_080A38AA: + movs r1, 0 + adds r3, r0, 0x1 + cmp r1, r5 + bge _080A38C6 + adds r1, r5, 0 +_080A38B4: + ldrh r0, [r4] + adds r0, r6, r0 + strh r0, [r2] + adds r4, 0x2 + adds r2, 0x2 + subs r1, 0x1 + cmp r1, 0 + bne _080A38B4 + adds r1, r5, 0 +_080A38C6: + cmp r1, 0x8 + bgt _080A38D6 + movs r0, 0 +_080A38CC: + strh r0, [r2] + adds r2, 0x2 + adds r1, 0x1 + cmp r1, 0x8 + ble _080A38CC +_080A38D6: + adds r0, r3, 0 + cmp r0, r12 + blt _080A38AA +_080A38DC: + mov r1, r8 + movs r4, 0x8 + ldrsh r3, [r1, r4] + cmp r0, r3 + bge _080A38FE + movs r4, 0 + adds r5, r3, 0 +_080A38EA: + adds r3, r0, 0x1 + movs r1, 0x8 +_080A38EE: + strh r4, [r2] + adds r2, 0x2 + subs r1, 0x1 + cmp r1, 0 + bge _080A38EE + adds r0, r3, 0 + cmp r0, r5 + blt _080A38EA +_080A38FE: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80A382C + + thumb_func_start sub_80A3908 +sub_80A3908: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + str r0, [sp] + str r2, [sp, 0x4] + mov r9, r3 + adds r6, r1, 0 + movs r2, 0 + ldr r1, [sp, 0x4] + movs r3, 0xC + ldrsh r0, [r1, r3] + cmp r2, r0 + blt _080A392A + b _080A3B6C +_080A392A: + lsls r0, r2, 2 + ldr r4, [sp] + adds r0, r4 + ldr r0, [r0] + mov r12, r0 + movs r1, 0 + adds r2, 0x1 + str r2, [sp, 0x8] + mov r5, r9 + ldrb r5, [r5, 0x5] + cmp r1, r5 + blt _080A3944 + b _080A3B2A +_080A3944: + ldr r0, _080A39A4 + mov r10, r0 +_080A3948: + movs r2, 0 + mov r8, r2 + cmp r1, 0 + bne _080A3A18 + movs r3, 0x1 + str r3, [sp, 0xC] + mov r4, r9 + ldrb r4, [r4, 0x4] + cmp r1, r4 + blt _080A395E + b _080A3B04 +_080A395E: + ldrb r1, [r6] + adds r6, 0x1 + cmp r1, 0xBF + ble _080A39A8 + adds r2, r1, 0 + subs r2, 0xBF + cmp r1, 0xBF + ble _080A39A0 + ldr r5, _080A39A4 + adds r4, r5, 0 + adds r3, r2, 0 +_080A3974: + ldrb r1, [r6] + ldrb r0, [r6, 0x1] + lsls r0, 8 + orrs r1, r0 + ldrb r0, [r6, 0x2] + lsls r0, 16 + orrs r1, r0 + adds r6, 0x3 + adds r0, r1, 0 + ands r0, r4 + mov r5, r12 + strh r0, [r5] + movs r0, 0x2 + add r12, r0 + asrs r1, 12 + ands r1, r4 + mov r5, r12 + strh r1, [r5] + add r12, r0 + subs r3, 0x1 + cmp r3, 0 + bne _080A3974 +_080A39A0: + lsls r0, r2, 1 + b _080A3A0C + .align 2, 0 +_080A39A4: .4byte 0x00000fff +_080A39A8: + cmp r1, 0x7F + ble _080A39EA + ldrb r2, [r6] + ldrb r0, [r6, 0x1] + lsls r0, 8 + orrs r2, r0 + ldrb r0, [r6, 0x2] + lsls r0, 16 + orrs r2, r0 + adds r6, 0x3 + adds r4, r1, 0 + subs r4, 0x7F + cmp r1, 0x7F + ble _080A39E6 + adds r0, r2, 0 + mov r1, r10 + ands r0, r1 + asrs r1, r2, 12 + mov r2, r10 + ands r1, r2 + adds r3, r4, 0 +_080A39D2: + mov r5, r12 + strh r0, [r5] + movs r2, 0x2 + add r12, r2 + mov r5, r12 + strh r1, [r5] + add r12, r2 + subs r3, 0x1 + cmp r3, 0 + bne _080A39D2 +_080A39E6: + lsls r0, r4, 1 + b _080A3A0C +_080A39EA: + movs r3, 0 + adds r0, r1, 0x1 + cmp r3, r1 + bgt _080A3A0A + movs r1, 0 + adds r3, r0, 0 +_080A39F6: + mov r2, r12 + strh r1, [r2] + movs r4, 0x2 + add r12, r4 + mov r5, r12 + strh r1, [r5] + add r12, r4 + subs r3, 0x1 + cmp r3, 0 + bne _080A39F6 +_080A3A0A: + lsls r0, 1 +_080A3A0C: + add r8, r0 + mov r0, r9 + ldrb r0, [r0, 0x4] + cmp r8, r0 + blt _080A395E + b _080A3B04 +_080A3A18: + mov r4, r12 + subs r4, 0x80 + adds r1, 0x1 + str r1, [sp, 0xC] + mov r1, r9 + ldrb r1, [r1, 0x4] + cmp r8, r1 + bge _080A3B04 +_080A3A28: + ldrb r1, [r6] + adds r6, 0x1 + cmp r1, 0xBF + ble _080A3A80 + adds r5, r1, 0 + subs r5, 0xBF + cmp r1, 0xBF + ble _080A3A78 + ldr r2, _080A3A7C + adds r7, r2, 0 + adds r3, r5, 0 +_080A3A3E: + ldrb r2, [r6] + ldrb r0, [r6, 0x1] + lsls r0, 8 + orrs r2, r0 + ldrb r0, [r6, 0x2] + lsls r0, 16 + orrs r2, r0 + adds r6, 0x3 + adds r0, r2, 0 + ands r0, r7 + ldrh r1, [r4] + eors r0, r1 + mov r1, r12 + strh r0, [r1] + adds r4, 0x2 + movs r0, 0x2 + add r12, r0 + asrs r2, 12 + ands r2, r7 + ldrh r0, [r4] + eors r2, r0 + mov r1, r12 + strh r2, [r1] + adds r4, 0x2 + movs r2, 0x2 + add r12, r2 + subs r3, 0x1 + cmp r3, 0 + bne _080A3A3E +_080A3A78: + lsls r0, r5, 1 + b _080A3AFA + .align 2, 0 +_080A3A7C: .4byte 0x00000fff +_080A3A80: + cmp r1, 0x7F + ble _080A3AD2 + ldrb r2, [r6] + ldrb r0, [r6, 0x1] + lsls r0, 8 + orrs r2, r0 + ldrb r0, [r6, 0x2] + lsls r0, 16 + orrs r2, r0 + adds r6, 0x3 + adds r7, r1, 0 + subs r7, 0x7F + cmp r1, 0x7F + ble _080A3ACE + adds r5, r2, 0 + mov r3, r10 + ands r5, r3 + asrs r2, 12 + ands r2, r3 + adds r3, r7, 0 +_080A3AA8: + ldrh r1, [r4] + adds r0, r5, 0 + eors r0, r1 + mov r1, r12 + strh r0, [r1] + adds r4, 0x2 + movs r0, 0x2 + add r12, r0 + ldrh r1, [r4] + adds r0, r2, 0 + eors r0, r1 + mov r1, r12 + strh r0, [r1] + adds r4, 0x2 + movs r0, 0x2 + add r12, r0 + subs r3, 0x1 + cmp r3, 0 + bne _080A3AA8 +_080A3ACE: + lsls r0, r7, 1 + b _080A3AFA +_080A3AD2: + movs r3, 0 + adds r2, r1, 0x1 + cmp r3, r1 + bgt _080A3AF8 + adds r3, r2, 0 +_080A3ADC: + ldrh r0, [r4] + mov r1, r12 + strh r0, [r1] + adds r4, 0x2 + movs r5, 0x2 + add r12, r5 + ldrh r0, [r4] + mov r1, r12 + strh r0, [r1] + adds r4, 0x2 + add r12, r5 + subs r3, 0x1 + cmp r3, 0 + bne _080A3ADC +_080A3AF8: + lsls r0, r2, 1 +_080A3AFA: + add r8, r0 + mov r2, r9 + ldrb r2, [r2, 0x4] + cmp r8, r2 + blt _080A3A28 +_080A3B04: + mov r3, r8 + cmp r3, 0x3F + bgt _080A3B1E + movs r0, 0 +_080A3B0C: + mov r4, r12 + strh r0, [r4] + movs r5, 0x2 + add r12, r5 + movs r1, 0x1 + add r8, r1 + mov r2, r8 + cmp r2, 0x3F + ble _080A3B0C +_080A3B1E: + ldr r1, [sp, 0xC] + mov r3, r9 + ldrb r3, [r3, 0x5] + cmp r1, r3 + bge _080A3B2A + b _080A3948 +_080A3B2A: + ldr r4, [sp, 0x4] + movs r5, 0x10 + ldrsh r0, [r4, r5] + cmp r1, r0 + bge _080A3B5E + movs r2, 0 +_080A3B36: + adds r1, 0x1 + str r1, [sp, 0xC] + movs r0, 0x3F + mov r8, r0 +_080A3B3E: + mov r1, r12 + strh r2, [r1] + movs r3, 0x2 + add r12, r3 + movs r4, 0x1 + negs r4, r4 + add r8, r4 + mov r5, r8 + cmp r5, 0 + bge _080A3B3E + ldr r1, [sp, 0xC] + ldr r3, [sp, 0x4] + movs r4, 0x10 + ldrsh r0, [r3, r4] + cmp r1, r0 + blt _080A3B36 +_080A3B5E: + ldr r2, [sp, 0x8] + ldr r5, [sp, 0x4] + movs r1, 0xC + ldrsh r0, [r5, r1] + cmp r2, r0 + bge _080A3B6C + b _080A392A +_080A3B6C: + adds r0, r6, 0 + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80A3908 + + thumb_func_start sub_80A3B80 +sub_80A3B80: + push {r4,lr} + adds r3, r0, 0 + lsls r1, 24 + lsrs r1, 24 + lsls r2, 24 + lsrs r2, 24 + ldr r4, _080A3BA8 + adds r0, r3, r4 + ldr r0, [r0] + cmp r0, 0 + beq _080A3BA2 + adds r4, 0x4 + adds r0, r3, r4 + strb r1, [r0] + ldr r1, _080A3BAC + adds r0, r3, r1 + strb r2, [r0] +_080A3BA2: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A3BA8: .4byte 0x0000046c +_080A3BAC: .4byte 0x00000471 + thumb_func_end sub_80A3B80 + + thumb_func_start sub_80A3BB0 +sub_80A3BB0: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r5, r0, 0 + lsls r1, 16 + asrs r1, 16 + adds r6, r1, 0 + movs r0, 0x91 + lsls r0, 3 + adds r0, r5 + mov r8, r0 + cmp r1, 0 + blt _080A3BD4 + cmp r1, 0x1 + ble _080A3BD4 + cmp r1, 0x4 + ble _080A3C00 +_080A3BD4: + ldr r1, _080A3BFC + adds r0, r5, r1 + movs r1, 0x1 + str r1, [r0] + movs r2, 0xA7 + lsls r2, 3 + adds r0, r5, r2 + movs r1, 0 + ldrsh r3, [r0, r1] + movs r0, 0 + cmp r6, 0x1 + bne _080A3BEE + movs r0, 0x1 +_080A3BEE: + str r0, [sp] + mov r0, r8 + adds r1, r5, 0 + movs r2, 0 + bl sub_80A3D40 + b _080A3C48 + .align 2, 0 +_080A3BFC: .4byte 0x00000474 +_080A3C00: + ldr r2, _080A3C88 + adds r0, r5, r2 + movs r7, 0x2 + str r7, [r0] + movs r0, 0xA7 + lsls r0, 3 + adds r4, r5, r0 + movs r2, 0 + ldrsh r0, [r4, r2] + subs r3, r0, 0x1 + movs r0, 0 + cmp r1, 0x4 + bne _080A3C1C + movs r0, 0x1 +_080A3C1C: + str r0, [sp] + mov r0, r8 + adds r1, r5, 0 + movs r2, 0 + bl sub_80A3D40 + movs r1, 0x9B + lsls r1, 3 + adds r0, r5, r1 + movs r1, 0 + ldrsh r2, [r4, r1] + subs r2, 0x1 + adds r3, r7, 0 + eors r3, r6 + negs r1, r3 + orrs r1, r3 + lsrs r1, 31 + str r1, [sp] + adds r1, r5, 0 + movs r3, 0x1 + bl sub_80A3D40 +_080A3C48: + movs r6, 0 + ldr r2, _080A3C88 + adds r0, r5, r2 + ldr r0, [r0] + cmp r6, r0 + bge _080A3CF0 + movs r0, 0x8F + lsls r0, 3 + adds r7, r5, r0 + mov r4, r8 +_080A3C5C: + adds r0, r5, 0 + adds r1, r6, 0 + ldr r2, _080A3C8C + bl sub_80A456C + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080A3C72 + cmp r0, 0x2 + beq _080A3CB4 +_080A3C72: + movs r2, 0 + ldrsh r0, [r4, r2] + cmp r0, 0x1 + beq _080A3C94 + cmp r0, 0x1 + ble _080A3C82 + cmp r0, 0x2 + beq _080A3C9C +_080A3C82: + ldr r0, _080A3C90 + b _080A3CD6 + .align 2, 0 +_080A3C88: .4byte 0x00000474 +_080A3C8C: .4byte gUnknown_8117314 +_080A3C90: .4byte sub_80A3EBC +_080A3C94: + ldr r0, _080A3C98 + b _080A3CD6 + .align 2, 0 +_080A3C98: .4byte sub_80A3EF4 +_080A3C9C: + ldrb r0, [r4, 0x6] + ldr r1, _080A3CAC + cmp r0, 0 + beq _080A3CA6 + ldr r1, _080A3CB0 +_080A3CA6: + str r1, [r4, 0x18] + b _080A3CD8 + .align 2, 0 +_080A3CAC: .4byte sub_80A4088 +_080A3CB0: .4byte sub_80A41C4 +_080A3CB4: + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0x1 + beq _080A3CCC + cmp r0, 0x1 + ble _080A3CC4 + cmp r0, 0x2 + beq _080A3CD4 +_080A3CC4: + ldr r0, _080A3CC8 + b _080A3CD6 + .align 2, 0 +_080A3CC8: .4byte sub_80A3ED4 +_080A3CCC: + ldr r0, _080A3CD0 + b _080A3CD6 + .align 2, 0 +_080A3CD0: .4byte sub_80A3F94 +_080A3CD4: + ldr r0, _080A3D34 +_080A3CD6: + str r0, [r4, 0x18] +_080A3CD8: + adds r0, r4, 0 + adds r1, r7, 0 + bl sub_80A3E14 + adds r7, 0x8 + adds r4, 0x50 + adds r6, 0x1 + ldr r2, _080A3D38 + adds r0, r5, r2 + ldr r0, [r0] + cmp r6, r0 + blt _080A3C5C +_080A3CF0: + ldr r1, _080A3D38 + adds r0, r5, r1 + ldr r6, [r0] + cmp r6, 0x1 + bgt _080A3D26 + lsls r0, r6, 2 + adds r0, r6 + lsls r0, 4 + mov r2, r8 + adds r4, r0, r2 +_080A3D04: + adds r0, r5, 0 + adds r1, r6, 0 + ldr r2, _080A3D3C + bl sub_80A456C + movs r0, 0 + str r0, [sp] + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0 + movs r3, 0 + bl sub_80A3D40 + adds r4, 0x50 + adds r6, 0x1 + cmp r6, 0x1 + ble _080A3D04 +_080A3D26: + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A3D34: .4byte sub_80A4358 +_080A3D38: .4byte 0x00000474 +_080A3D3C: .4byte gUnknown_8117314 + thumb_func_end sub_80A3BB0 + + thumb_func_start sub_80A3D40 +sub_80A3D40: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r4, r0, 0 + adds r5, r1, 0 + mov r8, r3 + ldr r1, [sp, 0x1C] + movs r3, 0xA5 + lsls r3, 3 + adds r0, r5, r3 + ldrh r0, [r0] + strh r0, [r4] + strh r2, [r4, 0x2] + mov r7, r8 + strh r7, [r4, 0x4] + strb r1, [r4, 0x6] + ldr r1, _080A3E10 + adds r0, r5, r1 + ldrb r0, [r0] + str r0, [r4, 0x8] + subs r3, 0xDB + adds r0, r5, r3 + ldrb r0, [r0] + str r0, [r4, 0xC] + movs r7, 0x89 + lsls r7, 3 + adds r0, r5, r7 + ldrb r0, [r0] + lsls r0, 3 + str r0, [r4, 0x10] + subs r1, 0x3 + adds r0, r5, r1 + ldrb r0, [r0] + lsls r0, 3 + str r0, [r4, 0x14] + adds r3, 0xFB + adds r0, r5, r3 + ldr r0, [r0] + str r0, [r4, 0x1C] + movs r3, 0 + cmp r3, r8 + bge _080A3DE0 + adds r7, 0xF0 + adds r6, r5, r7 + movs r1, 0 + ldrsh r0, [r6, r1] + cmp r2, r0 + bge _080A3DE0 + lsls r0, r2, 2 + adds r7, 0x14 + adds r0, r7 + adds r1, r0, r5 + movs r0, 0x20 + adds r0, r4 + mov r12, r0 + movs r7, 0x28 + adds r7, r4 + mov r9, r7 +_080A3DB6: + ldr r0, [r1] + mov r7, r12 + adds r7, 0x4 + mov r12, r7 + subs r7, 0x4 + stm r7!, {r0} + ldr r0, [r1, 0x8] + mov r7, r9 + adds r7, 0x4 + mov r9, r7 + subs r7, 0x4 + stm r7!, {r0} + adds r3, 0x1 + adds r1, 0x4 + adds r2, 0x1 + cmp r3, r8 + bge _080A3DE0 + movs r7, 0 + ldrsh r0, [r6, r7] + cmp r2, r0 + blt _080A3DB6 +_080A3DE0: + cmp r3, 0x1 + bgt _080A3DF8 + movs r1, 0 + lsls r0, r3, 2 + adds r0, 0x20 + adds r0, r4 +_080A3DEC: + str r1, [r0] + str r1, [r0, 0x8] + adds r0, 0x4 + adds r3, 0x1 + cmp r3, 0x1 + ble _080A3DEC +_080A3DF8: + movs r0, 0x8F + lsls r0, 3 + adds r1, r5, r0 + adds r0, r4, 0 + bl sub_80A3E14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A3E10: .4byte 0x0000044c + thumb_func_end sub_80A3D40 + + thumb_func_start sub_80A3E14 +sub_80A3E14: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r4, r0, 0 + adds r0, r1, 0 + ldr r1, [r0] + mov r8, r1 + str r1, [r4, 0x30] + cmp r1, 0 + bge _080A3E2A + adds r1, 0x7 +_080A3E2A: + asrs r6, r1, 3 + str r6, [r4, 0x38] + ldr r7, [r0, 0x4] + str r7, [r4, 0x34] + adds r0, r7, 0 + cmp r7, 0 + bge _080A3E3A + adds r0, r7, 0x7 +_080A3E3A: + asrs r5, r0, 3 + str r5, [r4, 0x3C] + movs r3, 0 + ldrsh r2, [r4, r3] + cmp r2, 0x1 + beq _080A3E60 + cmp r2, 0x1 + bgt _080A3E50 + cmp r2, 0 + beq _080A3E56 + b _080A3EA4 +_080A3E50: + cmp r2, 0x2 + beq _080A3E7E + b _080A3EA4 +_080A3E56: + str r2, [r4, 0x40] + str r2, [r4, 0x44] + str r2, [r4, 0x48] + str r2, [r4, 0x4C] + b _080A3EA4 +_080A3E60: + lsrs r1, 31 + adds r1, r6, r1 + asrs r1, 1 + str r1, [r4, 0x40] + lsrs r0, 31 + adds r0, r5, r0 + asrs r0, 1 + str r0, [r4, 0x44] + lsls r1, 4 + mov r2, r8 + subs r1, r2, r1 + str r1, [r4, 0x48] + lsls r0, 4 + subs r0, r7, r0 + b _080A3EA2 +_080A3E7E: + adds r0, r6, 0 + movs r1, 0x3 + bl __divsi3 + str r0, [r4, 0x40] + adds r0, r5, 0 + movs r1, 0x3 + bl __divsi3 + str r0, [r4, 0x44] + lsls r0, r6, 3 + mov r3, r8 + subs r0, r3, r0 + str r0, [r4, 0x48] + adds r0, r7, 0 + movs r1, 0x18 + bl __modsi3 +_080A3EA2: + str r0, [r4, 0x4C] +_080A3EA4: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80A3E14 + + thumb_func_start sub_80A3EB0 +sub_80A3EB0: + push {lr} + ldr r1, [r0, 0x18] + bl _call_via_r1 + pop {r0} + bx r0 + thumb_func_end sub_80A3EB0 + + thumb_func_start sub_80A3EBC +sub_80A3EBC: + push {lr} + ldr r0, [r0, 0x28] + movs r2, 0 + movs r1, 0x80 + lsls r1, 3 +_080A3EC6: + strh r2, [r0] + adds r0, 0x2 + subs r1, 0x1 + cmp r1, 0 + bne _080A3EC6 + pop {r0} + bx r0 + thumb_func_end sub_80A3EBC + + thumb_func_start sub_80A3ED4 +sub_80A3ED4: + push {lr} + ldr r1, [r0, 0x28] + ldr r0, [r0, 0x2C] + movs r3, 0 + movs r2, 0x80 + lsls r2, 3 +_080A3EE0: + strh r3, [r1] + adds r1, 0x2 + strh r3, [r0] + adds r0, 0x2 + subs r2, 0x1 + cmp r2, 0 + bne _080A3EE0 + pop {r0} + bx r0 + thumb_func_end sub_80A3ED4 + + thumb_func_start sub_80A3EF4 +sub_80A3EF4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + ldr r1, [r0, 0x44] + lsls r1, 6 + ldr r2, [r0, 0x40] + adds r1, r2 + lsls r1, 1 + ldr r2, [r0, 0x20] + adds r2, r1 + movs r1, 0 + mov r12, r1 + ldr r3, [r0, 0x28] + str r3, [sp, 0xC] + ldr r0, [r0, 0x1C] + mov r10, r0 + mov r0, sp + str r0, [sp, 0x8] +_080A3F1E: + adds r5, r2, 0 + movs r2, 0x80 + adds r2, r5 + mov r9, r2 + adds r1, 0x1 + mov r8, r1 + ldr r1, [sp, 0x8] + mov r3, r12 + lsls r0, r3, 1 + ldr r2, [sp, 0xC] + adds r0, r2 + movs r2, 0x1 +_080A3F36: + stm r1!, {r0} + adds r0, 0x40 + movs r3, 0x20 + add r12, r3 + subs r2, 0x1 + cmp r2, 0 + bge _080A3F36 + movs r4, 0 + mov r7, sp +_080A3F48: + ldrh r1, [r5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 1 + mov r1, r10 + adds r3, r1, r0 + adds r5, 0x2 + adds r6, r4, 0x1 + adds r4, r7, 0 + movs r2, 0x1 +_080A3F5C: + ldr r0, [r4] + ldrh r1, [r3] + strh r1, [r0] + adds r3, 0x2 + adds r0, 0x2 + ldrh r1, [r3] + strh r1, [r0] + adds r3, 0x2 + adds r0, 0x2 + stm r4!, {r0} + subs r2, 0x1 + cmp r2, 0 + bge _080A3F5C + adds r4, r6, 0 + cmp r4, 0xF + ble _080A3F48 + mov r2, r9 + mov r1, r8 + cmp r1, 0xA + ble _080A3F1E + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80A3EF4 + + thumb_func_start sub_80A3F94 +sub_80A3F94: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x34 + ldr r1, [r0, 0x44] + lsls r1, 6 + ldr r2, [r0, 0x40] + adds r1, r2 + lsls r1, 1 + ldr r2, [r0, 0x20] + adds r3, r2, r1 + ldr r2, [r0, 0x24] + adds r2, r1 + movs r1, 0 + ldr r4, [r0, 0x28] + str r4, [sp, 0x2C] + ldr r5, [r0, 0x2C] + str r5, [sp, 0x18] + ldr r0, [r0, 0x1C] + str r0, [sp, 0x1C] + mov r0, sp + str r0, [sp, 0x10] + mov r4, sp + adds r4, 0x8 + str r4, [sp, 0x14] + movs r5, 0 + str r5, [sp, 0x30] +_080A3FCE: + mov r8, r3 + mov r12, r2 + mov r0, r8 + adds r0, 0x80 + str r0, [sp, 0x20] + mov r4, r12 + adds r4, 0x80 + str r4, [sp, 0x24] + adds r1, 0x1 + str r1, [sp, 0x28] + ldr r3, [sp, 0x14] + ldr r2, [sp, 0x10] + ldr r5, [sp, 0x30] + ldr r0, [sp, 0x18] + adds r1, r5, r0 + ldr r4, [sp, 0x2C] + adds r0, r5, r4 + movs r5, 0x1 +_080A3FF2: + stm r2!, {r0} + stm r3!, {r1} + adds r1, 0x40 + adds r0, 0x40 + ldr r4, [sp, 0x30] + adds r4, 0x40 + str r4, [sp, 0x30] + subs r5, 0x1 + cmp r5, 0 + bge _080A3FF2 + movs r2, 0 + ldr r5, [sp, 0x1C] + mov r9, r5 +_080A400C: + mov r0, r8 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 1 + mov r1, r9 + adds r4, r1, r0 + movs r5, 0x2 + add r8, r5 + mov r0, r12 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 1 + mov r1, r9 + adds r3, r1, r0 + add r12, r5 + movs r5, 0 + adds r2, 0x1 + mov r10, r2 + ldr r7, [sp, 0x14] + ldr r6, [sp, 0x10] +_080A4038: + ldr r1, [r6] + ldr r2, [r7] + ldrh r0, [r4] + strh r0, [r1] + adds r4, 0x2 + adds r1, 0x2 + ldrh r0, [r4] + strh r0, [r1] + adds r4, 0x2 + adds r1, 0x2 + ldrh r0, [r3] + strh r0, [r2] + adds r3, 0x2 + adds r2, 0x2 + ldrh r0, [r3] + strh r0, [r2] + adds r3, 0x2 + adds r2, 0x2 + stm r6!, {r1} + stm r7!, {r2} + adds r5, 0x1 + cmp r5, 0x1 + ble _080A4038 + mov r2, r10 + cmp r2, 0xF + ble _080A400C + ldr r3, [sp, 0x20] + ldr r2, [sp, 0x24] + ldr r1, [sp, 0x28] + cmp r1, 0xA + ble _080A3FCE + add sp, 0x34 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80A3F94 + + thumb_func_start sub_80A4088 +sub_80A4088: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + adds r4, r0, 0 + ldr r0, [r4, 0x38] + movs r1, 0x3 + bl __modsi3 + adds r7, r0, 0 + ldr r0, [r4, 0x44] + lsls r0, 6 + ldr r1, [r4, 0x40] + adds r0, r1 + lsls r0, 1 + ldr r1, [r4, 0x20] + adds r1, r0 + movs r0, 0 + mov r8, r0 + ldr r2, [r4, 0x28] + str r2, [sp, 0xC] + ldr r4, [r4, 0x1C] + mov r12, r4 +_080A40BA: + adds r5, r1, 0 + movs r1, 0x80 + adds r1, r5 + mov r9, r1 + adds r0, 0x1 + mov r10, r0 + mov r1, sp + mov r2, r8 + lsls r0, r2, 1 + ldr r2, [sp, 0xC] + adds r0, r2 + movs r3, 0x2 +_080A40D2: + stm r1!, {r0} + adds r0, 0x40 + movs r2, 0x20 + add r8, r2 + subs r3, 0x1 + cmp r3, 0 + bge _080A40D2 + cmp r7, 0 + beq _080A412E + ldrh r1, [r5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 1 + mov r1, r12 + adds r2, r1, r0 + adds r5, 0x2 + cmp r7, 0x1 + bne _080A4116 + adds r2, 0x2 + mov r4, sp + movs r3, 0x2 +_080A40FC: + ldr r0, [r4] + ldrh r1, [r2] + strh r1, [r0] + adds r0, 0x2 + ldrh r1, [r2, 0x2] + strh r1, [r0] + adds r0, 0x2 + stm r4!, {r0} + adds r2, 0x6 + subs r3, 0x1 + cmp r3, 0 + bge _080A40FC + b _080A412E +_080A4116: + adds r2, 0x4 + mov r4, sp + movs r3, 0x2 +_080A411C: + ldr r1, [r4] + ldrh r0, [r2] + strh r0, [r1] + adds r1, 0x2 + stm r4!, {r1} + adds r2, 0x6 + subs r3, 0x1 + cmp r3, 0 + bge _080A411C +_080A412E: + movs r3, 0 +_080A4130: + ldrh r1, [r5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 1 + mov r1, r12 + adds r2, r1, r0 + adds r5, 0x2 + adds r6, r3, 0x1 + mov r4, sp + movs r3, 0x2 +_080A4144: + ldr r1, [r4] + ldrh r0, [r2] + strh r0, [r1] + adds r2, 0x2 + adds r1, 0x2 + ldrh r0, [r2] + strh r0, [r1] + adds r2, 0x2 + adds r1, 0x2 + ldrh r0, [r2] + strh r0, [r1] + adds r2, 0x2 + adds r1, 0x2 + stm r4!, {r1} + subs r3, 0x1 + cmp r3, 0 + bge _080A4144 + adds r3, r6, 0 + cmp r3, 0x9 + ble _080A4130 + cmp r7, 0x1 + beq _080A41AA + ldrh r1, [r5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 1 + mov r1, r12 + adds r2, r1, r0 + cmp r7, 0 + bne _080A4198 + mov r4, sp + movs r3, 0x2 +_080A4184: + ldm r4!, {r0} + ldrh r1, [r2] + strh r1, [r0] + ldrh r1, [r2, 0x2] + strh r1, [r0, 0x2] + adds r2, 0x6 + subs r3, 0x1 + cmp r3, 0 + bge _080A4184 + b _080A41AA +_080A4198: + mov r4, sp + movs r3, 0x2 +_080A419C: + ldm r4!, {r1} + ldrh r0, [r2] + strh r0, [r1] + adds r2, 0x6 + subs r3, 0x1 + cmp r3, 0 + bge _080A419C +_080A41AA: + mov r1, r9 + mov r0, r10 + cmp r0, 0x7 + ble _080A40BA + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80A4088 + + thumb_func_start sub_80A41C4 +sub_80A41C4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + mov r8, r0 + ldr r0, [r0, 0x38] + movs r1, 0x3 + bl __modsi3 + str r0, [sp, 0xC] + mov r0, r8 + ldr r2, [r0, 0x44] + lsls r0, r2, 6 + mov r1, r8 + ldr r3, [r1, 0x40] + adds r0, r3 + lsls r0, 1 + ldr r1, [r1, 0x20] + adds r4, r1, r0 + movs r0, 0 + str r0, [sp, 0x10] + mov r1, r8 + ldr r0, [r1, 0xC] + subs r0, r2 + mov r10, r0 + ldr r0, [r1, 0x8] + subs r0, r3 + str r0, [sp, 0x14] + movs r2, 0 +_080A4202: + ldr r5, [sp, 0x14] + mov r3, r10 + cmp r3, 0 + ble _080A4212 + movs r0, 0x1 + negs r0, r0 + add r10, r0 + b _080A4222 +_080A4212: + mov r1, r8 + ldr r1, [r1, 0xC] + mov r10, r1 + mov r3, r8 + ldr r0, [r3, 0x40] + lsls r0, 1 + ldr r1, [r3, 0x20] + adds r4, r1, r0 +_080A4222: + adds r6, r4, 0 + mov r0, r8 + ldr r1, [r0, 0x28] + ldrh r7, [r4] + ldr r3, [r0, 0x1C] + mov r9, r3 + adds r0, r4, 0x2 + mov r12, r0 + adds r4, 0x80 + str r4, [sp, 0x18] + adds r2, 0x1 + str r2, [sp, 0x1C] + mov r2, sp + ldr r3, [sp, 0x10] + lsls r0, r3, 1 + adds r0, r1 + movs r3, 0x2 +_080A4244: + stm r2!, {r0} + adds r0, 0x40 + ldr r4, [sp, 0x10] + adds r4, 0x20 + str r4, [sp, 0x10] + subs r3, 0x1 + cmp r3, 0 + bge _080A4244 + ldr r0, [sp, 0xC] + cmp r0, 0 + beq _080A42B2 + lsls r0, r7, 3 + adds r0, r7 + lsls r0, 1 + mov r1, r9 + adds r2, r1, r0 + mov r6, r12 + ldr r3, [sp, 0xC] + cmp r3, 0x1 + bne _080A428C + adds r2, 0x2 + mov r4, sp + movs r3, 0x2 +_080A4272: + ldr r0, [r4] + ldrh r1, [r2] + strh r1, [r0] + adds r0, 0x2 + ldrh r1, [r2, 0x2] + strh r1, [r0] + adds r0, 0x2 + stm r4!, {r0} + adds r2, 0x6 + subs r3, 0x1 + cmp r3, 0 + bge _080A4272 + b _080A42A4 +_080A428C: + adds r2, 0x4 + mov r4, sp + movs r3, 0x2 +_080A4292: + ldr r1, [r4] + ldrh r0, [r2] + strh r0, [r1] + adds r1, 0x2 + stm r4!, {r1} + adds r2, 0x6 + subs r3, 0x1 + cmp r3, 0 + bge _080A4292 +_080A42A4: + subs r5, 0x1 + cmp r5, 0 + bgt _080A42B2 + mov r4, r8 + ldr r5, [r4, 0x8] + lsls r0, r5, 1 + subs r6, r0 +_080A42B2: + movs r3, 0 +_080A42B4: + ldrh r1, [r6] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 1 + mov r1, r9 + adds r2, r1, r0 + adds r6, 0x2 + subs r5, 0x1 + adds r7, r3, 0x1 + mov r4, sp + movs r3, 0x2 +_080A42CA: + ldr r1, [r4] + ldrh r0, [r2] + strh r0, [r1] + adds r2, 0x2 + adds r1, 0x2 + ldrh r0, [r2] + strh r0, [r1] + adds r2, 0x2 + adds r1, 0x2 + ldrh r0, [r2] + strh r0, [r1] + adds r2, 0x2 + adds r1, 0x2 + stm r4!, {r1} + subs r3, 0x1 + cmp r3, 0 + bge _080A42CA + cmp r5, 0 + bgt _080A42F8 + mov r3, r8 + ldr r5, [r3, 0x8] + lsls r0, r5, 1 + subs r6, r0 +_080A42F8: + adds r3, r7, 0 + cmp r3, 0x9 + ble _080A42B4 + ldr r4, [sp, 0xC] + cmp r4, 0x1 + beq _080A433E + ldrh r1, [r6] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 1 + mov r1, r9 + adds r2, r1, r0 + cmp r4, 0 + bne _080A432C + mov r4, sp + movs r3, 0x2 +_080A4318: + ldm r4!, {r0} + ldrh r1, [r2] + strh r1, [r0] + ldrh r1, [r2, 0x2] + strh r1, [r0, 0x2] + adds r2, 0x6 + subs r3, 0x1 + cmp r3, 0 + bge _080A4318 + b _080A433E +_080A432C: + mov r4, sp + movs r3, 0x2 +_080A4330: + ldm r4!, {r1} + ldrh r0, [r2] + strh r0, [r1] + adds r2, 0x6 + subs r3, 0x1 + cmp r3, 0 + bge _080A4330 +_080A433E: + ldr r4, [sp, 0x18] + ldr r2, [sp, 0x1C] + cmp r2, 0x7 + bgt _080A4348 + b _080A4202 +_080A4348: + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80A41C4 + + thumb_func_start sub_80A4358 +sub_80A4358: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x3C + adds r4, r0, 0 + ldr r0, [r4, 0x38] + movs r1, 0x3 + bl __modsi3 + str r0, [sp, 0x18] + ldr r0, [r4, 0x44] + lsls r0, 6 + ldr r1, [r4, 0x40] + adds r0, r1 + lsls r0, 1 + ldr r1, [r4, 0x20] + adds r2, r1, r0 + ldr r1, [r4, 0x24] + adds r1, r0 + movs r0, 0 + ldr r3, [r4, 0x28] + str r3, [sp, 0x24] + ldr r5, [r4, 0x2C] + str r5, [sp, 0x28] + ldr r4, [r4, 0x1C] + str r4, [sp, 0x20] + mov r3, sp + adds r3, 0xC + str r3, [sp, 0x1C] + movs r4, 0 + str r4, [sp, 0x38] +_080A439A: + mov r12, r2 + mov r8, r1 + mov r5, r12 + adds r5, 0x80 + str r5, [sp, 0x30] + adds r1, 0x80 + str r1, [sp, 0x34] + adds r0, 0x1 + str r0, [sp, 0x2C] + add r3, sp, 0xC + mov r2, sp + ldr r4, [sp, 0x38] + ldr r5, [sp, 0x28] + adds r1, r4, r5 + ldr r5, [sp, 0x24] + adds r0, r4, r5 + movs r5, 0x2 +_080A43BC: + stm r2!, {r0} + stm r3!, {r1} + adds r1, 0x40 + adds r0, 0x40 + ldr r4, [sp, 0x38] + adds r4, 0x40 + str r4, [sp, 0x38] + subs r5, 0x1 + cmp r5, 0 + bge _080A43BC + ldr r5, [sp, 0x18] + cmp r5, 0 + beq _080A445C + mov r0, r12 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 1 + ldr r1, [sp, 0x20] + adds r4, r1, r0 + movs r3, 0x2 + add r12, r3 + mov r5, r8 + ldrh r1, [r5] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 1 + ldr r1, [sp, 0x20] + adds r3, r1, r0 + movs r5, 0x2 + add r8, r5 + ldr r0, [sp, 0x18] + cmp r0, 0x1 + bne _080A4434 + adds r4, 0x2 + adds r3, 0x2 + ldr r7, [sp, 0x1C] + mov r6, sp +_080A4408: + ldr r1, [r6] + ldr r2, [r7] + ldrh r0, [r4] + strh r0, [r1] + adds r1, 0x2 + ldrh r0, [r4, 0x2] + strh r0, [r1] + adds r1, 0x2 + ldrh r0, [r3] + strh r0, [r2] + adds r2, 0x2 + ldrh r0, [r3, 0x2] + strh r0, [r2] + adds r2, 0x2 + stm r6!, {r1} + stm r7!, {r2} + adds r4, 0x6 + adds r3, 0x6 + subs r5, 0x1 + cmp r5, 0 + bge _080A4408 + b _080A445C +_080A4434: + adds r4, 0x4 + adds r3, 0x4 + ldr r6, [sp, 0x1C] + mov r2, sp + movs r5, 0x2 +_080A443E: + ldr r1, [r2] + ldrh r0, [r4] + strh r0, [r1] + adds r1, 0x2 + stm r2!, {r1} + ldr r1, [r6] + ldrh r0, [r3] + strh r0, [r1] + adds r1, 0x2 + stm r6!, {r1} + adds r4, 0x6 + adds r3, 0x6 + subs r5, 0x1 + cmp r5, 0 + bge _080A443E +_080A445C: + movs r2, 0 + ldr r1, [sp, 0x20] + mov r9, r1 +_080A4462: + mov r3, r12 + ldrh r1, [r3] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 1 + mov r5, r9 + adds r4, r5, r0 + movs r0, 0x2 + add r12, r0 + mov r3, r8 + ldrh r1, [r3] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 1 + adds r3, r5, r0 + movs r5, 0x2 + add r8, r5 + movs r5, 0 + adds r2, 0x1 + mov r10, r2 + mov r7, sp + add r6, sp, 0xC +_080A448E: + ldr r1, [r7] + ldr r2, [r6] + ldrh r0, [r4] + strh r0, [r1] + adds r4, 0x2 + adds r1, 0x2 + ldrh r0, [r4] + strh r0, [r1] + adds r4, 0x2 + adds r1, 0x2 + ldrh r0, [r4] + strh r0, [r1] + adds r4, 0x2 + adds r1, 0x2 + ldrh r0, [r3] + strh r0, [r2] + adds r3, 0x2 + adds r2, 0x2 + ldrh r0, [r3] + strh r0, [r2] + adds r3, 0x2 + adds r2, 0x2 + ldrh r0, [r3] + strh r0, [r2] + adds r3, 0x2 + adds r2, 0x2 + stm r7!, {r1} + stm r6!, {r2} + adds r5, 0x1 + cmp r5, 0x2 + ble _080A448E + mov r2, r10 + cmp r2, 0x9 + ble _080A4462 + ldr r0, [sp, 0x18] + cmp r0, 0x1 + beq _080A453A + mov r3, r12 + ldrh r1, [r3] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 1 + ldr r5, [sp, 0x20] + adds r4, r5, r0 + mov r0, r8 + ldrh r1, [r0] + lsls r0, r1, 3 + adds r0, r1 + lsls r0, 1 + adds r3, r5, r0 + ldr r1, [sp, 0x18] + cmp r1, 0 + bne _080A451E + ldr r7, [sp, 0x1C] + mov r6, sp + movs r5, 0x2 +_080A44FE: + ldm r6!, {r1} + ldm r7!, {r2} + ldrh r0, [r4] + strh r0, [r1] + ldrh r0, [r4, 0x2] + strh r0, [r1, 0x2] + ldrh r0, [r3] + strh r0, [r2] + ldrh r0, [r3, 0x2] + strh r0, [r2, 0x2] + adds r4, 0x6 + adds r3, 0x6 + subs r5, 0x1 + cmp r5, 0 + bge _080A44FE + b _080A453A +_080A451E: + ldr r6, [sp, 0x1C] + mov r2, sp + movs r5, 0x2 +_080A4524: + ldm r2!, {r1} + ldrh r0, [r4] + strh r0, [r1] + ldm r6!, {r1} + ldrh r0, [r3] + strh r0, [r1] + adds r4, 0x6 + adds r3, 0x6 + subs r5, 0x1 + cmp r5, 0 + bge _080A4524 +_080A453A: + ldr r2, [sp, 0x30] + ldr r1, [sp, 0x34] + ldr r0, [sp, 0x2C] + cmp r0, 0x7 + bgt _080A4546 + b _080A439A +_080A4546: + add sp, 0x3C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80A4358 + + thumb_func_start sub_80A4558 +sub_80A4558: + lsls r1, 3 + movs r3, 0x8F + lsls r3, 3 + adds r0, r3 + adds r0, r1 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r2] + str r1, [r2, 0x4] + bx lr + thumb_func_end sub_80A4558 + + thumb_func_start sub_80A456C +sub_80A456C: + lsls r1, 3 + movs r3, 0x8F + lsls r3, 3 + adds r0, r3 + adds r0, r1 + ldr r1, [r2] + ldr r2, [r2, 0x4] + str r1, [r0] + str r2, [r0, 0x4] + bx lr + thumb_func_end sub_80A456C + + thumb_func_start sub_80A4580 +sub_80A4580: + push {r4,lr} + adds r3, r2, 0 + lsls r2, r1, 2 + adds r2, r1 + lsls r2, 4 + movs r1, 0x91 + lsls r1, 3 + adds r2, r1 + adds r2, r0, r2 + ldr r0, [r3] + cmp r0, 0 + bge _080A45AE + ldrb r0, [r2, 0x6] + ldr r4, [r3, 0x4] + cmp r0, 0 + beq _080A45CA + ldr r1, [r2, 0x10] +_080A45A2: + ldr r0, [r3] + adds r0, r1 + str r0, [r3] + cmp r0, 0 + blt _080A45A2 + b _080A45CC +_080A45AE: + ldr r1, [r2, 0x10] + ldr r4, [r3, 0x4] + cmp r0, r1 + blt _080A45CC + ldrb r0, [r2, 0x6] + cmp r0, 0 + beq _080A45C8 +_080A45BC: + ldr r0, [r3] + subs r0, r1 + str r0, [r3] + cmp r0, r1 + bge _080A45BC + b _080A45CC +_080A45C8: + subs r0, r1, 0x1 +_080A45CA: + str r0, [r3] +_080A45CC: + cmp r4, 0 + bge _080A45E4 + ldrb r0, [r2, 0x6] + cmp r0, 0 + beq _080A45FE + ldr r1, [r2, 0x14] +_080A45D8: + ldr r0, [r3, 0x4] + adds r0, r1 + str r0, [r3, 0x4] + cmp r0, 0 + blt _080A45D8 + b _080A4600 +_080A45E4: + ldr r1, [r2, 0x14] + cmp r4, r1 + blt _080A4600 + ldrb r0, [r2, 0x6] + cmp r0, 0 + beq _080A45FC +_080A45F0: + ldr r0, [r3, 0x4] + subs r0, r1 + str r0, [r3, 0x4] + cmp r0, r1 + bge _080A45F0 + b _080A4600 +_080A45FC: + subs r0, r1, 0x1 +_080A45FE: + str r0, [r3, 0x4] +_080A4600: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A4580 + + thumb_func_start sub_80A4608 +sub_80A4608: + movs r3, 0x89 + lsls r3, 3 + adds r2, r0, r3 + ldrb r2, [r2] + str r2, [r1] + ldr r2, _080A461C + adds r0, r2 + ldrb r0, [r0] + str r0, [r1, 0x4] + bx lr + .align 2, 0 +_080A461C: .4byte 0x00000449 + thumb_func_end sub_80A4608 + + thumb_func_start sub_80A4620 +sub_80A4620: + movs r3, 0x89 + lsls r3, 3 + adds r2, r0, r3 + ldrb r2, [r2] + lsls r2, 3 + str r2, [r1] + ldr r2, _080A4638 + adds r0, r2 + ldrb r0, [r0] + lsls r0, 3 + str r0, [r1, 0x4] + bx lr + .align 2, 0 +_080A4638: .4byte 0x00000449 + thumb_func_end sub_80A4620 + + thumb_func_start sub_80A463C +sub_80A463C: + movs r3, 0 + str r3, [r1] + str r3, [r1, 0x4] + movs r3, 0x89 + lsls r3, 3 + adds r1, r0, r3 + ldrb r1, [r1] + lsls r1, 11 + str r1, [r2] + ldr r1, _080A465C + adds r0, r1 + ldrb r0, [r0] + lsls r0, 11 + str r0, [r2, 0x4] + bx lr + .align 2, 0 +_080A465C: .4byte 0x00000449 + thumb_func_end sub_80A463C + + thumb_func_start sub_80A4660 +sub_80A4660: + push {r4-r7,lr} + adds r6, r3, 0 + lsls r1, 24 + lsrs r5, r1, 24 + ldr r1, _080A4678 + adds r0, r1 + ldr r4, [r0] + cmp r4, 0 + bne _080A467C + movs r0, 0 + b _080A46B6 + .align 2, 0 +_080A4678: .4byte 0x00000544 +_080A467C: + ldr r0, [r2, 0x4] + lsls r0, 8 + ldr r1, [r2] + adds r0, r1 + ldr r1, _080A46BC + adds r0, r1 + adds r4, r0 + ldr r3, [r6, 0x4] + cmp r3, 0 + ble _080A46B4 + movs r7, 0x80 + lsls r7, 1 +_080A4694: + ldr r1, [r6] + adds r2, r4, 0 + cmp r1, 0 + ble _080A46AC +_080A469C: + ldrb r0, [r2] + ands r0, r5 + adds r2, 0x1 + cmp r0, 0 + bne _080A46B6 + subs r1, 0x1 + cmp r1, 0 + bgt _080A469C +_080A46AC: + adds r4, r7 + subs r3, 0x1 + cmp r3, 0 + bgt _080A4694 +_080A46B4: + movs r0, 0 +_080A46B6: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080A46BC: .4byte 0x00000405 + thumb_func_end sub_80A4660 + + thumb_func_start sub_80A46C0 +sub_80A46C0: + push {r4-r7,lr} + adds r6, r3, 0 + lsls r1, 24 + lsrs r5, r1, 24 + ldr r1, _080A46D8 + adds r0, r1 + ldr r4, [r0] + cmp r4, 0 + bne _080A46DC +_080A46D2: + movs r0, 0 + b _080A4716 + .align 2, 0 +_080A46D8: .4byte 0x00000544 +_080A46DC: + ldr r0, [r2, 0x4] + lsls r0, 8 + ldr r1, [r2] + adds r0, r1 + ldr r1, _080A471C + adds r0, r1 + adds r4, r0 + ldr r3, [r6, 0x4] + cmp r3, 0 + ble _080A4714 + movs r7, 0x80 + lsls r7, 1 +_080A46F4: + ldr r1, [r6] + adds r2, r4, 0 + cmp r1, 0 + ble _080A470C +_080A46FC: + ldrb r0, [r2] + ands r0, r5 + adds r2, 0x1 + cmp r0, r5 + bne _080A46D2 + subs r1, 0x1 + cmp r1, 0 + bgt _080A46FC +_080A470C: + adds r4, r7 + subs r3, 0x1 + cmp r3, 0 + bgt _080A46F4 +_080A4714: + movs r0, 0x1 +_080A4716: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080A471C: .4byte 0x00000405 + thumb_func_end sub_80A46C0 + + thumb_func_start sub_80A4720 +sub_80A4720: + lsls r1, 2 + ldr r3, _080A473C + adds r0, r3 + adds r0, r1 + ldr r1, [r2, 0x4] + lsls r1, 7 + ldr r3, [r0] + adds r3, r1 + ldr r0, [r2] + lsls r0, 1 + adds r3, r0 + ldrh r0, [r3] + bx lr + .align 2, 0 +_080A473C: .4byte 0x0000054c + thumb_func_end sub_80A4720 + + thumb_func_start sub_80A4740 +sub_80A4740: + push {r4,lr} + lsls r1, 2 + ldr r4, _080A4760 + adds r0, r4 + adds r0, r1 + ldr r1, [r2, 0x4] + lsls r1, 7 + ldr r4, [r0] + adds r4, r1 + ldr r0, [r2] + lsls r0, 1 + adds r4, r0 + strh r3, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A4760: .4byte 0x0000054c + thumb_func_end sub_80A4740 + + thumb_func_start sub_80A4764 +sub_80A4764: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + mov r9, r0 + ldr r0, _080A47E8 + add r0, r9 + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080A4784 + b _080A49CE +_080A4784: + ldr r0, _080A47EC + add r0, r9 + movs r6, 0 + ldrsh r0, [r0, r6] + cmp r0, 0 + beq _080A4864 + mov r4, r9 + ldr r0, _080A47F0 + add r0, r9 + ldr r5, [r0] + ldr r0, _080A47F4 + add r0, r9 + movs r1, 0 + ldrsh r0, [r0, r1] + lsls r0, 20 + lsrs r6, r0, 16 + movs r7, 0 + ldr r0, _080A47F8 + add r0, r9 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r7, r0 + bge _080A484C +_080A47B2: + ldr r1, [r4, 0x4] + cmp r1, 0 + beq _080A4832 + ldrh r0, [r4, 0x2] + subs r0, 0x1 + strh r0, [r4, 0x2] + lsls r0, 16 + cmp r0, 0 + bgt _080A4832 + ldrh r0, [r4] + subs r0, 0x1 + strh r0, [r4] + lsls r0, 16 + cmp r0, 0 + bgt _080A4808 + ldr r0, _080A47FC + add r0, r9 + ldrb r0, [r0] + cmp r0, 0 + beq _080A4800 + ldrh r0, [r5] + strh r0, [r4, 0x2] + ldrh r0, [r5, 0x2] + strh r0, [r4] + str r1, [r4, 0x8] + b _080A480C + .align 2, 0 +_080A47E8: .4byte 0x00000444 +_080A47EC: .4byte 0x00000466 +_080A47F0: .4byte 0x0000046c +_080A47F4: .4byte 0x0000052c +_080A47F8: .4byte 0x00000464 +_080A47FC: .4byte 0x00000471 +_080A4800: + strh r0, [r4] + strh r0, [r4, 0x2] + str r0, [r4, 0x8] + b _080A480C +_080A4808: + ldrh r0, [r5] + strh r0, [r4, 0x2] +_080A480C: + ldr r0, [r4, 0x8] + cmp r0, 0 + beq _080A4832 + movs r0, 0 + str r0, [sp] + adds r0, r6, 0 + movs r1, 0 + bl sub_8003810 + adds r0, r6, 0x1 + lsls r0, 16 + lsrs r0, 16 + ldr r1, [r4, 0x8] + movs r2, 0xF + bl sub_809971C + ldr r0, [r4, 0x8] + adds r0, 0x3C + str r0, [r4, 0x8] +_080A4832: + adds r7, 0x1 + adds r4, 0x10 + adds r5, 0x4 + adds r0, r6, 0 + adds r0, 0x10 + lsls r0, 16 + lsrs r6, r0, 16 + ldr r0, _080A485C + add r0, r9 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r7, r0 + blt _080A47B2 +_080A484C: + movs r0, 0x8E + lsls r0, 3 + add r0, r9 + ldrb r1, [r0] + ldr r0, _080A4860 + add r0, r9 + strb r1, [r0] + b _080A48E6 + .align 2, 0 +_080A485C: .4byte 0x00000464 +_080A4860: .4byte 0x00000471 +_080A4864: + movs r0, 0x88 + lsls r0, 3 + add r0, r9 + ldr r0, [r0] + cmp r0, 0 + beq _080A48E6 + mov r4, r9 + adds r4, 0xE0 + movs r6, 0xA0 + movs r5, 0x1F +_080A4878: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8004D14 + lsls r0, 24 + cmp r0, 0 + beq _080A48DC + adds r0, r4, 0 + movs r1, 0x1 + bl sub_8004D40 + lsls r0, 24 + cmp r0, 0 + bne _080A48DC + ldrh r0, [r4, 0x6] + subs r0, 0x1 + strh r0, [r4, 0x6] + lsls r0, 16 + cmp r0, 0 + bgt _080A48DC + ldrh r0, [r4, 0x4] + strh r0, [r4, 0x6] + ldr r1, [r4, 0xC] + ldr r0, [r4, 0x10] + cmp r1, r0 + bcc _080A48B0 + ldr r0, [r4, 0x8] + str r0, [r4, 0xC] +_080A48B0: + ldr r1, [r4, 0xC] + ldm r1!, {r0} + str r0, [r4, 0x14] + str r1, [r4, 0xC] + ldrb r1, [r4, 0x14] + add r0, sp, 0x4 + strb r1, [r0] + ldrb r1, [r4, 0x15] + adds r0, 0x1 + strb r1, [r0] + ldrb r1, [r4, 0x16] + adds r0, 0x1 + strb r1, [r0] + ldrb r1, [r4, 0x17] + adds r0, 0x1 + strb r1, [r0] + ldr r1, [sp, 0x4] + str r1, [sp] + lsls r0, r6, 16 + lsrs r0, 16 + bl sub_8003810 +_080A48DC: + subs r5, 0x1 + adds r4, 0x18 + adds r6, 0x1 + cmp r5, 0 + bge _080A4878 +_080A48E6: + movs r5, 0 + movs r4, 0x1 +_080A48EA: + movs r2, 0xF8 + lsls r2, 2 + adds r0, r5, r2 + mov r6, r9 + adds r2, r6, r0 + ldrb r0, [r2] + cmp r0, 0 + beq _080A4942 + ldrh r1, [r2, 0x4] + subs r0, r1, 0x1 + strh r0, [r2, 0x4] + lsls r1, 16 + cmp r1, 0 + bgt _080A4942 + ldr r0, [r2, 0x14] + adds r0, 0x4 + str r0, [r2, 0x14] + ldr r1, [r2, 0x24] + lsrs r1, 1 + lsls r1, 1 + ldr r0, [r2, 0x1C] + adds r0, r1 + str r0, [r2, 0x1C] + ldrh r0, [r2, 0x2] + adds r0, 0x1 + movs r3, 0 + strh r0, [r2, 0x2] + ldr r1, [r2, 0xC] + lsls r0, 16 + asrs r0, 16 + movs r6, 0x2 + ldrsh r1, [r1, r6] + cmp r0, r1 + blt _080A4938 + ldr r0, [r2, 0x10] + str r0, [r2, 0x14] + ldr r0, [r2, 0x18] + str r0, [r2, 0x1C] + strh r3, [r2, 0x2] +_080A4938: + movs r0, 0x1 + strb r0, [r2, 0x1] + ldr r0, [r2, 0x14] + ldr r0, [r0] + strh r0, [r2, 0x4] +_080A4942: + adds r5, 0x28 + subs r4, 0x1 + cmp r4, 0 + bge _080A48EA + movs r4, 0x91 + lsls r4, 3 + add r4, r9 + movs r7, 0x8F + lsls r7, 3 + add r7, r9 + movs r0, 0 + mov r8, r0 + b _080A49BC +_080A495C: + adds r0, r4, 0 + adds r1, r7, 0 + bl sub_80A3E14 + adds r0, r4, 0 + bl sub_80A3EB0 + movs r6, 0 + movs r2, 0x2 + ldrsh r1, [r4, r2] + ldr r0, _080A4998 + add r0, r9 + movs r2, 0 + ldrsh r0, [r0, r2] + adds r5, r1, r0 + movs r1, 0x4 + ldrsh r0, [r4, r1] + movs r2, 0x1 + add r8, r2 + movs r1, 0x50 + adds r1, r4 + mov r10, r1 + adds r7, 0x8 + cmp r6, r0 + bge _080A49BA +_080A498E: + cmp r5, 0 + beq _080A499C + cmp r5, 0x1 + beq _080A49A6 + b _080A49AE + .align 2, 0 +_080A4998: .4byte 0x00000536 +_080A499C: + ldr r0, [r4, 0x48] + ldr r1, [r4, 0x4C] + bl sub_800CCA0 + b _080A49AE +_080A49A6: + ldr r0, [r4, 0x48] + ldr r1, [r4, 0x4C] + bl sub_800CCAC +_080A49AE: + adds r6, 0x1 + adds r5, 0x1 + movs r2, 0x4 + ldrsh r0, [r4, r2] + cmp r6, r0 + blt _080A498E +_080A49BA: + mov r4, r10 +_080A49BC: + ldr r0, _080A49E0 + add r0, r9 + ldr r0, [r0] + cmp r8, r0 + blt _080A495C + ldr r1, _080A49E4 + add r1, r9 + movs r0, 0x1 + strb r0, [r1] +_080A49CE: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A49E0: .4byte 0x00000474 +_080A49E4: .4byte 0x0000052a + thumb_func_end sub_80A4764 + + thumb_func_start sub_80A49E8 +sub_80A49E8: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r6, r0, 0 + ldr r0, _080A4A74 + adds r5, r6, r0 + movs r1, 0xFF + lsls r1, 2 + adds r4, r6, r1 + ldr r0, _080A4A78 + adds r0, r6 + mov r8, r0 + movs r7, 0x1 +_080A4A02: + ldrb r0, [r5] + cmp r0, 0 + beq _080A4A1C + ldr r0, [r4, 0x4] + ldr r1, [r4] + ldr r2, [r4, 0x8] + bl MemoryCopy32 + movs r0, 0 + strb r0, [r5] + movs r0, 0x1 + mov r1, r8 + strb r0, [r1] +_080A4A1C: + adds r5, 0x28 + adds r4, 0x28 + subs r7, 0x1 + cmp r7, 0 + bge _080A4A02 + ldr r1, _080A4A78 + adds r0, r6, r1 + ldrb r0, [r0] + cmp r0, 0 + beq _080A4A68 + movs r5, 0 + adds r1, 0xC + adds r0, r6, r1 + movs r1, 0 + ldrsh r4, [r0, r1] + movs r1, 0xA7 + lsls r1, 3 + adds r0, r6, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r5, r0 + bge _080A4A60 + movs r0, 0xA7 + lsls r0, 3 + adds r7, r6, r0 +_080A4A4E: + adds r0, r4, 0x2 + bl sub_80098F8 + adds r5, 0x1 + adds r4, 0x1 + movs r1, 0 + ldrsh r0, [r7, r1] + cmp r5, r0 + blt _080A4A4E +_080A4A60: + ldr r0, _080A4A78 + adds r1, r6, r0 + movs r0, 0 + strb r0, [r1] +_080A4A68: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A4A74: .4byte 0x000003e1 +_080A4A78: .4byte 0x0000052a + thumb_func_end sub_80A49E8 + + thumb_func_start sub_80A4A7C +sub_80A4A7C: + push {r4,lr} + sub sp, 0x4 + ldr r4, _080A4AB8 + movs r0, 0x88 + lsls r0, 1 + movs r1, 0x6 + bl MemoryAlloc + str r0, [r4] + adds r2, r0, 0 + adds r2, 0xE4 + ldr r1, _080A4ABC + strh r1, [r2] + ldr r1, _080A4AC0 + movs r3, 0x1 + negs r3, r3 + str r3, [sp] + movs r2, 0 + bl sub_809D600 + movs r0, 0 + bl sub_80A5E8C + bl sub_80A4AEC + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A4AB8: .4byte gUnknown_3001B6C +_080A4ABC: .4byte 0x0000ffff +_080A4AC0: .4byte gUnknown_811736C + thumb_func_end sub_80A4A7C + + thumb_func_start sub_80A4AC4 +sub_80A4AC4: + push {r4,lr} + bl sub_80A4AEC + bl sub_80A5EBC + ldr r4, _080A4AE8 + ldr r0, [r4] + bl sub_809D648 + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A4AE8: .4byte gUnknown_3001B6C + thumb_func_end sub_80A4AC4 + + thumb_func_start sub_80A4AEC +sub_80A4AEC: + push {r4,lr} + movs r0, 0 + movs r1, 0x37 + bl sub_80015C0 + movs r0, 0 + movs r1, 0x38 + bl sub_80015C0 + ldr r0, _080A4B2C + ldr r0, [r0] + ldr r1, _080A4B30 + bl sub_809D754 + ldr r4, _080A4B34 + ldr r0, [r4] + cmp r0, 0 + beq _080A4B1E + bl sub_80A2D00 + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_080A4B1E: + movs r0, 0 + bl sub_80A5EDC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A4B2C: .4byte gUnknown_3001B6C +_080A4B30: .4byte gUnknown_8117538 +_080A4B34: .4byte gUnknown_3001B70 + thumb_func_end sub_80A4AEC + + thumb_func_start sub_80A4B38 +sub_80A4B38: + push {lr} + bl nullsub_121 + ldr r0, _080A4B50 + ldr r0, [r0] + cmp r0, 0 + beq _080A4B4A + bl sub_80A2D68 +_080A4B4A: + pop {r0} + bx r0 + .align 2, 0 +_080A4B50: .4byte gUnknown_3001B70 + thumb_func_end sub_80A4B38 + + thumb_func_start sub_80A4B54 +sub_80A4B54: + push {lr} + ldr r0, _080A4B6C + ldr r0, [r0] + cmp r0, 0 + beq _080A4B62 + bl sub_80A2D88 +_080A4B62: + bl nullsub_122 + pop {r0} + bx r0 + .align 2, 0 +_080A4B6C: .4byte gUnknown_3001B70 + thumb_func_end sub_80A4B54 + + thumb_func_start sub_80A4B70 +sub_80A4B70: + push {r4-r6,lr} + mov r6, r9 + mov r5, r8 + push {r5,r6} + sub sp, 0x4 + mov r8, r0 + adds r4, r1, 0 + adds r6, r2, 0 + adds r5, r3, 0 + lsls r4, 16 + asrs r4, 16 + lsls r6, 16 + asrs r6, 16 + lsls r5, 24 + asrs r5, 24 + adds r0, r4, 0 + bl sub_80A77A0 + ldr r1, _080A4BE0 + adds r0, r4, 0 + bl sub_80A77D0 + mov r9, r0 + ldr r1, _080A4BE4 + str r5, [sp] + movs r0, 0 + adds r2, r4, 0 + adds r3, r6, 0 + bl Log + lsls r1, r6, 3 + mov r2, r9 + ldr r0, [r2, 0x4] + adds r0, r1 + lsls r1, r5, 2 + adds r1, r5 + lsls r1, 3 + ldr r0, [r0, 0x4] + adds r0, r1 + ldr r0, [r0, 0x24] + ldr r0, [r0] + ldr r0, [r0, 0x8] + mov r1, r8 + str r0, [r1] + movs r0, 0x2 + strh r0, [r1, 0x4] + strh r6, [r1, 0x6] + strb r5, [r1, 0x8] + add sp, 0x4 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080A4BE0: .4byte gUnknown_8117560 +_080A4BE4: .4byte gUnknown_811756C + thumb_func_end sub_80A4B70 + + thumb_func_start sub_80A4BE8 +sub_80A4BE8: + push {lr} + lsls r1, 16 + asrs r1, 16 + movs r2, 0 + movs r3, 0 + bl sub_80A4B70 + pop {r0} + bx r0 + thumb_func_end sub_80A4BE8 + + thumb_func_start sub_80A4BFC +sub_80A4BFC: + push {r4,r5,lr} + sub sp, 0xC + adds r4, r0, 0 + adds r5, r1, 0 + lsls r4, 16 + asrs r4, 16 + lsls r5, 24 + lsrs r5, 24 + ldr r1, _080A4C44 + movs r0, 0 + adds r2, r4, 0 + adds r3, r5, 0 + bl Log + movs r0, 0 + mov r1, sp + adds r2, r4, 0 + bl sub_809D710 + cmp r5, 0 + beq _080A4C2C + mov r1, sp + movs r0, 0x5 + strh r0, [r1, 0x4] +_080A4C2C: + ldr r0, _080A4C48 + ldr r0, [r0] + ldr r3, _080A4C4C + movs r1, 0 + mov r2, sp + bl sub_809D790 + add sp, 0xC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080A4C44: .4byte gUnknown_8117594 +_080A4C48: .4byte gUnknown_3001B6C +_080A4C4C: .4byte gUnknown_81175E0 + thumb_func_end sub_80A4BFC + + thumb_func_start sub_80A4C50 +sub_80A4C50: + push {r4-r6,lr} + mov r6, r8 + push {r6} + sub sp, 0x14 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + mov r8, r3 + lsls r4, 16 + asrs r4, 16 + lsls r5, 16 + asrs r5, 16 + lsls r6, 24 + asrs r6, 24 + mov r0, r8 + lsls r0, 24 + lsrs r0, 24 + mov r8, r0 + ldr r1, _080A4CB8 + str r6, [sp] + str r0, [sp, 0x4] + movs r0, 0 + adds r2, r4, 0 + adds r3, r5, 0 + bl Log + add r0, sp, 0x8 + adds r1, r4, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_80A4B70 + mov r0, r8 + cmp r0, 0 + beq _080A4C9C + add r1, sp, 0x8 + movs r0, 0x5 + strh r0, [r1, 0x4] +_080A4C9C: + ldr r0, _080A4CBC + ldr r0, [r0] + ldr r3, _080A4CC0 + movs r1, 0 + add r2, sp, 0x8 + bl sub_809D790 + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080A4CB8: .4byte gUnknown_81175EC +_080A4CBC: .4byte gUnknown_3001B6C +_080A4CC0: .4byte gUnknown_8117644 + thumb_func_end sub_80A4C50 + + thumb_func_start sub_80A4CC4 +sub_80A4CC4: + push {r4,lr} + sub sp, 0xC + adds r4, r0, 0 + lsls r4, 16 + asrs r4, 16 + ldr r1, _080A4D08 + movs r0, 0 + adds r2, r4, 0 + bl Log + mov r0, sp + adds r1, r4, 0 + bl sub_80A4BE8 + mov r1, sp + movs r3, 0 + movs r2, 0 + movs r0, 0x2 + strh r0, [r1, 0x4] + mov r0, sp + strh r2, [r0, 0x6] + strb r3, [r0, 0x8] + ldr r0, _080A4D0C + ldr r0, [r0] + ldr r3, _080A4D10 + movs r1, 0 + mov r2, sp + bl sub_809D790 + add sp, 0xC + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A4D08: .4byte gUnknown_8117650 +_080A4D0C: .4byte gUnknown_3001B6C +_080A4D10: .4byte gUnknown_8117698 + thumb_func_end sub_80A4CC4 + + thumb_func_start sub_80A4D14 +sub_80A4D14: + push {lr} + ldr r0, _080A4D28 + ldr r0, [r0] + bl sub_809D678 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_080A4D28: .4byte gUnknown_3001B6C + thumb_func_end sub_80A4D14 + + thumb_func_start sub_80A4D2C +sub_80A4D2C: + push {lr} + adds r1, r0, 0 + lsls r1, 16 + asrs r1, 16 + ldr r0, _080A4D44 + ldr r0, [r0] + bl sub_809D968 + lsls r0, 24 + lsrs r0, 24 + pop {r1} + bx r1 + .align 2, 0 +_080A4D44: .4byte gUnknown_3001B6C + thumb_func_end sub_80A4D2C + + thumb_func_start sub_80A4D48 +sub_80A4D48: + push {lr} + lsls r0, 16 + asrs r2, r0, 16 + movs r0, 0x1 + negs r0, r0 + cmp r2, r0 + beq _080A4D74 + ldr r1, _080A4D70 + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0x5 + beq _080A4D6C + cmp r0, 0x8 + bne _080A4D74 +_080A4D6C: + movs r0, 0 + b _080A4D76 + .align 2, 0 +_080A4D70: .4byte gUnknown_811BAF4 +_080A4D74: + movs r0, 0x1 +_080A4D76: + pop {r1} + bx r1 + thumb_func_end sub_80A4D48 + + thumb_func_start sub_80A4D7C +sub_80A4D7C: + push {r4,r5,lr} + lsls r0, 16 + asrs r5, r0, 16 + cmp r5, 0x9 + beq _080A4D94 + cmp r5, 0x9 + bgt _080A4D90 + cmp r5, 0x2 + beq _080A4DB6 + b _080A4DC4 +_080A4D90: + cmp r5, 0xC + bne _080A4DC4 +_080A4D94: + movs r0, 0 + movs r1, 0x27 + bl sub_8001658 + adds r4, r0, 0 + movs r0, 0 + movs r1, 0x28 + bl sub_8001658 + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 1 + adds r1, r0 + adds r1, r5, r1 + lsls r1, 16 + asrs r5, r1, 16 + b _080A4DC4 +_080A4DB6: + movs r0, 0x6 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _080A4DC4 + movs r5, 0x3 +_080A4DC4: + adds r0, r5, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80A4D7C + + thumb_func_start sub_80A4DCC +sub_80A4DCC: + push {r4-r6,lr} + lsls r0, 16 + asrs r5, r0, 16 + ldr r1, _080A4E38 + movs r0, 0 + adds r2, r5, 0 + bl Log + movs r0, 0 + movs r1, 0x37 + bl sub_80015C0 + movs r0, 0 + movs r1, 0x38 + bl sub_80015C0 + movs r0, 0 + bl sub_80A5EDC + ldr r4, _080A4E3C + ldr r0, [r4] + cmp r0, 0 + beq _080A4E08 + bl sub_80A2D00 + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_080A4E08: + ldr r0, _080A4E40 + movs r1, 0x6 + bl MemoryAlloc + adds r2, r0, 0 + str r2, [r4] + ldr r0, _080A4E44 + ldr r0, [r0] + adds r0, 0xE4 + strh r5, [r0] + movs r0, 0x1 + negs r0, r0 + cmp r5, r0 + bne _080A4E4C + ldr r1, _080A4E48 + adds r0, r2, 0 + bl sub_80A2B40 + ldr r0, [r4] + adds r1, r5, 0 + bl sub_80A2FBC + b _080A50BA + .align 2, 0 +_080A4E38: .4byte gUnknown_81176A4 +_080A4E3C: .4byte gUnknown_3001B70 +_080A4E40: .4byte 0x0000055c +_080A4E44: .4byte gUnknown_3001B6C +_080A4E48: .4byte gUnknown_8117324 +_080A4E4C: + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + ldr r1, _080A4E6C + adds r6, r0, r1 + ldrh r0, [r6] + adds r0, 0x1 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xC + bhi _080A4F20 + lsls r0, 2 + ldr r1, _080A4E70 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080A4E6C: .4byte gUnknown_811BAF4 +_080A4E70: .4byte _080A4E74 + .align 2, 0 +_080A4E74: + .4byte _080A4F08 + .4byte _080A4F20 + .4byte _080A4F20 + .4byte _080A4F20 + .4byte _080A4F20 + .4byte _080A4F20 + .4byte _080A4EA8 + .4byte _080A4EA8 + .4byte _080A4EA8 + .4byte _080A4EA8 + .4byte _080A4EA8 + .4byte _080A4ECC + .4byte _080A4ECC +_080A4EA8: + ldr r0, _080A4EC0 + ldr r0, [r0] + ldr r1, _080A4EC4 + bl sub_80A2B40 + ldr r1, _080A4EC8 + movs r2, 0x80 + lsls r2, 5 + adds r0, r2, 0 + strh r0, [r1] + b _080A4F30 + .align 2, 0 +_080A4EC0: .4byte gUnknown_3001B70 +_080A4EC4: .4byte gUnknown_811733C +_080A4EC8: .4byte gUnknown_2026E4E +_080A4ECC: + ldr r4, _080A4EDC + movs r1, 0 + ldrsh r0, [r4, r1] + movs r1, 0x1 + negs r1, r1 + ldr r6, _080A4EE0 + b _080A4EEA + .align 2, 0 +_080A4EDC: .4byte gUnknown_81173C0 +_080A4EE0: .4byte gUnknown_3001B70 +_080A4EE4: + adds r4, 0xC + movs r2, 0 + ldrsh r0, [r4, r2] +_080A4EEA: + cmp r0, r1 + beq _080A4EF2 + cmp r0, r5 + bne _080A4EE4 +_080A4EF2: + ldr r0, [r6] + bl MemoryFree + movs r0, 0 + str r0, [r6] + adds r1, r4, 0x4 + ldr r2, [r4, 0x8] + adds r0, r5, 0 + bl sub_80A50C8 + b _080A50BA +_080A4F08: + ldr r0, _080A4F18 + ldr r1, _080A4F1C + movs r2, 0 + ldrsh r3, [r6, r2] + adds r2, r5, 0 + bl FatalError + .align 2, 0 +_080A4F18: .4byte gUnknown_81176D0 +_080A4F1C: .4byte gUnknown_81176DC +_080A4F20: + ldr r0, _080A4FA0 + ldr r0, [r0] + ldr r1, _080A4FA4 + bl sub_80A2B40 + movs r0, 0x1 + bl sub_80A5EDC +_080A4F30: + ldr r5, _080A4FA0 + ldr r0, [r5] + movs r2, 0x4 + ldrsh r1, [r6, r2] + bl sub_80A2FBC + ldr r0, _080A4FA8 + ldr r0, [r0] + mov r12, r0 + adds r0, 0xE8 + movs r1, 0 + str r1, [r0] + adds r0, 0x4 + str r1, [r0] + adds r0, 0x4 + str r1, [r0] + adds r0, 0x4 + str r1, [r0] + adds r0, 0x4 + str r1, [r0] + adds r0, 0x4 + str r1, [r0] + movs r4, 0x80 + lsls r4, 1 + add r4, r12 + movs r3, 0x82 + lsls r3, 1 + add r3, r12 + movs r2, 0x84 + lsls r2, 1 + add r2, r12 + movs r0, 0x86 + lsls r0, 1 + add r0, r12 + str r1, [r0] + str r1, [r2] + str r1, [r3] + str r1, [r4] + mov r0, r12 + adds r0, 0xE4 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0xAD + beq _080A5034 + cmp r0, 0xAD + bgt _080A4FC0 + cmp r0, 0xA3 + bgt _080A4FAC + cmp r0, 0xA2 + bge _080A4FEE + cmp r0, 0x4 + beq _080A5084 + cmp r0, 0xA1 + beq _080A5084 + b _080A50A2 + .align 2, 0 +_080A4FA0: .4byte gUnknown_3001B70 +_080A4FA4: .4byte gUnknown_8117324 +_080A4FA8: .4byte gUnknown_3001B6C +_080A4FAC: + cmp r0, 0xAA + beq _080A500C + cmp r0, 0xAA + bgt _080A4FBA + cmp r0, 0xA8 + beq _080A500C + b _080A50A2 +_080A4FBA: + cmp r0, 0xAB + beq _080A5018 + b _080A50A2 +_080A4FC0: + cmp r0, 0xBA + beq _080A506A + cmp r0, 0xBA + bgt _080A4FD6 + cmp r0, 0xAF + beq _080A5072 + cmp r0, 0xAF + blt _080A5044 + cmp r0, 0xB0 + beq _080A5060 + b _080A50A2 +_080A4FD6: + cmp r0, 0xDF + beq _080A4FEE + cmp r0, 0xDF + bgt _080A4FE4 + cmp r0, 0xC0 + beq _080A5020 + b _080A50A2 +_080A4FE4: + cmp r0, 0xE0 + beq _080A508E + cmp r0, 0xE1 + beq _080A5096 + b _080A50A2 +_080A4FEE: + ldr r0, _080A5000 + ldr r0, [r0] + movs r1, 0x4 + bl sub_80A3BB0 + ldr r1, _080A5004 + ldr r2, _080A5008 + b _080A5050 + .align 2, 0 +_080A5000: .4byte gUnknown_3001B70 +_080A5004: .4byte gUnknown_2026E4E +_080A5008: .4byte 0x00000808 +_080A500C: + ldr r0, _080A5014 + ldr r0, [r0] + b _080A5062 + .align 2, 0 +_080A5014: .4byte gUnknown_3001B70 +_080A5018: + ldr r0, [r5] + movs r1, 0x1 + bl sub_80A3BB0 +_080A5020: + ldr r0, _080A5030 + ldr r0, [r0] + movs r1, 0 + movs r2, 0 + bl sub_80A3B80 + b _080A50A2 + .align 2, 0 +_080A5030: .4byte gUnknown_3001B70 +_080A5034: + ldr r1, _080A503C + ldr r2, _080A5040 + b _080A5050 + .align 2, 0 +_080A503C: .4byte gUnknown_2026E4E +_080A5040: .4byte 0x00001010 +_080A5044: + ldr r0, [r5] + movs r1, 0x4 + bl sub_80A3BB0 + ldr r1, _080A5058 + ldr r2, _080A505C +_080A5050: + adds r0, r2, 0 + strh r0, [r1] + b _080A50A2 + .align 2, 0 +_080A5058: .4byte gUnknown_2026E4E +_080A505C: .4byte 0x0000080c +_080A5060: + ldr r0, [r5] +_080A5062: + movs r1, 0x1 + bl sub_80A3BB0 + b _080A50A2 +_080A506A: + ldr r0, _080A507C + ldr r2, _080A5080 + adds r1, r2, 0 + strh r1, [r0] +_080A5072: + ldr r0, [r5] + movs r1, 0x4 + bl sub_80A3BB0 + b _080A50A2 + .align 2, 0 +_080A507C: .4byte gUnknown_2026E4E +_080A5080: .4byte 0x00001010 +_080A5084: + ldr r0, [r5] + movs r1, 0x3 + bl sub_80A3BB0 + b _080A50A2 +_080A508E: + ldr r0, [r5] + movs r1, 0x3 + bl sub_80A3BB0 +_080A5096: + ldr r0, _080A50C0 + ldr r0, [r0] + movs r1, 0 + movs r2, 0 + bl sub_80A3B80 +_080A50A2: + movs r0, 0x6 + ldrsh r1, [r6, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080A50B4 + adds r0, r1, 0 + bl sub_80A5F50 +_080A50B4: + ldr r0, _080A50C4 + bl sub_80A56D8 +_080A50BA: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080A50C0: .4byte gUnknown_3001B70 +_080A50C4: .4byte gUnknown_81176F8 + thumb_func_end sub_80A4DCC + + thumb_func_start sub_80A50C8 +sub_80A50C8: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r8, r1 + mov r10, r2 + lsls r0, 16 + asrs r5, r0, 16 + ldr r1, _080A514C + movs r0, 0 + adds r2, r5, 0 + bl Log + movs r0, 0 + movs r1, 0x37 + bl sub_80015C0 + movs r0, 0 + movs r1, 0x38 + bl sub_80015C0 + movs r0, 0 + bl sub_80A5EDC + ldr r7, _080A5150 + ldr r0, [r7] + cmp r0, 0 + beq _080A5110 + bl sub_80A2D00 + ldr r0, [r7] + bl MemoryFree + movs r0, 0 + str r0, [r7] +_080A5110: + ldr r0, _080A5154 + movs r1, 0x6 + bl MemoryAlloc + adds r2, r0, 0 + str r2, [r7] + ldr r0, _080A5158 + mov r9, r0 + ldr r0, [r0] + adds r0, 0xE4 + movs r4, 0 + strh r5, [r0] + movs r6, 0x1 + negs r6, r6 + cmp r5, r6 + beq _080A5138 + mov r1, r8 + ldrb r0, [r1] + cmp r0, 0x63 + bne _080A5160 +_080A5138: + ldr r1, _080A515C + adds r0, r2, 0 + bl sub_80A2B40 + ldr r0, [r7] + adds r1, r6, 0 + bl sub_80A2FBC + b _080A51EC + .align 2, 0 +_080A514C: .4byte gUnknown_8117700 +_080A5150: .4byte gUnknown_3001B70 +_080A5154: .4byte 0x0000055c +_080A5158: .4byte gUnknown_3001B6C +_080A515C: .4byte gUnknown_8117324 +_080A5160: + lsls r0, r5, 1 + adds r0, r5 + lsls r0, 2 + ldr r1, _080A5180 + adds r6, r0, r1 + ldrh r0, [r6] + subs r0, 0xA + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bls _080A518C + ldr r0, _080A5184 + ldr r1, _080A5188 + adds r2, r5, 0 + bl FatalError + .align 2, 0 +_080A5180: .4byte gUnknown_811BAF4 +_080A5184: .4byte gUnknown_8117734 +_080A5188: .4byte gUnknown_8117740 +_080A518C: + ldr r1, _080A51FC + adds r0, r2, 0 + bl sub_80A2B40 + movs r0, 0x1 + bl sub_80A5EDC + ldr r0, [r7] + movs r2, 0x4 + ldrsh r1, [r6, r2] + mov r2, r8 + mov r3, r10 + bl sub_80A3440 + mov r0, r9 + ldr r0, [r0] + mov r12, r0 + adds r0, 0xE8 + str r4, [r0] + adds r0, 0x4 + str r4, [r0] + adds r0, 0x4 + str r4, [r0] + adds r0, 0x4 + str r4, [r0] + adds r0, 0x4 + str r4, [r0] + adds r0, 0x4 + str r4, [r0] + movs r3, 0x80 + lsls r3, 1 + add r3, r12 + movs r2, 0x82 + lsls r2, 1 + add r2, r12 + movs r1, 0x84 + lsls r1, 1 + add r1, r12 + movs r0, 0x86 + lsls r0, 1 + add r0, r12 + str r4, [r0] + str r4, [r1] + str r4, [r2] + str r4, [r3] + ldr r0, _080A5200 + bl sub_80A56D8 +_080A51EC: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A51FC: .4byte gUnknown_8117354 +_080A5200: .4byte gUnknown_8117754 + thumb_func_end sub_80A50C8 + + thumb_func_start sub_80A5204 +sub_80A5204: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + str r0, [sp] + mov r8, r1 + str r2, [sp, 0x4] + str r3, [sp, 0x8] + movs r1, 0x8 + ldrsh r0, [r2, r1] + cmp r0, 0 + bgt _080A5222 + b _080A53EA +_080A5222: + mov r5, r8 + ldr r2, [sp] + mov r12, r2 + movs r0, 0 + ldr r3, [sp, 0x4] + ldrb r3, [r3, 0x1] + str r3, [sp, 0x10] + ldr r1, [sp, 0x4] + ldrh r2, [r1, 0xA] + mov r1, sp + strh r2, [r1, 0xC] + movs r1, 0xFF +_080A523A: + adds r0, 0x1 + mov r10, r0 + movs r3, 0xFF + mov r9, r3 +_080A5242: + mov r0, r12 + strb r1, [r0] + movs r2, 0x1 + add r12, r2 + movs r3, 0x1 + negs r3, r3 + add r9, r3 + mov r0, r9 + cmp r0, 0 + bge _080A5242 + mov r0, r10 + cmp r0, 0x3 + ble _080A523A + movs r1, 0 + ldr r2, [sp, 0x10] + cmp r1, r2 + blt _080A5266 + b _080A53BA +_080A5266: + ldr r3, [sp, 0x4] + ldrb r7, [r3] +_080A526A: + adds r0, 0x1 + mov r10, r0 + adds r0, r1, 0x1 + str r0, [sp, 0x14] + movs r0, 0xFF + movs r2, 0x4 + mov r9, r2 +_080A5278: + mov r3, r12 + strb r0, [r3] + movs r2, 0x1 + add r12, r2 + movs r3, 0x1 + negs r3, r3 + add r9, r3 + mov r2, r9 + cmp r2, 0 + bge _080A5278 + movs r3, 0x5 + mov r9, r3 + movs r0, 0 + cmp r1, 0 + bne _080A5308 + cmp r1, r7 + bge _080A5394 +_080A529A: + ldrb r1, [r5] + adds r5, 0x1 + cmp r1, 0xBF + ble _080A52C2 + adds r6, r0, 0 + subs r6, 0xBF + cmp r1, 0xBF + ble _080A5300 + adds r2, r1, 0 + subs r2, 0xBF +_080A52AE: + ldrb r0, [r5] + mov r3, r12 + strb r0, [r3] + adds r5, 0x1 + movs r0, 0x1 + add r12, r0 + subs r2, 0x1 + cmp r2, 0 + bne _080A52AE + b _080A5300 +_080A52C2: + cmp r1, 0x7F + ble _080A52E6 + ldrb r4, [r5] + adds r5, 0x1 + adds r6, r0, 0 + subs r6, 0x7F + cmp r1, 0x7F + ble _080A5300 + adds r2, r1, 0 + subs r2, 0x7F +_080A52D6: + mov r3, r12 + strb r4, [r3] + movs r0, 0x1 + add r12, r0 + subs r2, 0x1 + cmp r2, 0 + bne _080A52D6 + b _080A5300 +_080A52E6: + movs r2, 0 + adds r6, r0, 0x1 + cmp r2, r1 + bgt _080A5300 + movs r0, 0 + adds r2, r1, 0x1 +_080A52F2: + mov r3, r12 + strb r0, [r3] + movs r3, 0x1 + add r12, r3 + subs r2, 0x1 + cmp r2, 0 + bne _080A52F2 +_080A5300: + adds r0, r6, r1 + cmp r0, r7 + blt _080A529A + b _080A5394 +_080A5308: + ldr r4, _080A5340 + add r4, r12 + cmp r0, r7 + bge _080A5394 +_080A5310: + ldrb r3, [r5] + adds r5, 0x1 + cmp r3, 0xBF + ble _080A5344 + adds r6, r0, 0 + subs r6, 0xBF + cmp r3, 0xBF + ble _080A538E + adds r2, r3, 0 + subs r2, 0xBF +_080A5324: + ldrb r1, [r5] + ldrb r0, [r4] + eors r1, r0 + mov r0, r12 + strb r1, [r0] + adds r4, 0x1 + adds r5, 0x1 + movs r1, 0x1 + add r12, r1 + subs r2, 0x1 + cmp r2, 0 + bne _080A5324 + b _080A538E + .align 2, 0 +_080A5340: .4byte 0xffffff00 +_080A5344: + cmp r3, 0x7F + ble _080A5372 + ldrb r2, [r5] + mov r8, r2 + adds r5, 0x1 + adds r6, r0, 0 + subs r6, 0x7F + cmp r3, 0x7F + ble _080A538E + adds r2, r3, 0 + subs r2, 0x7F +_080A535A: + ldrb r1, [r4] + mov r0, r8 + eors r0, r1 + mov r1, r12 + strb r0, [r1] + adds r4, 0x1 + movs r0, 0x1 + add r12, r0 + subs r2, 0x1 + cmp r2, 0 + bne _080A535A + b _080A538E +_080A5372: + movs r2, 0 + adds r6, r0, 0x1 + cmp r2, r3 + bgt _080A538E + adds r2, r3, 0x1 +_080A537C: + ldrb r0, [r4] + mov r1, r12 + strb r0, [r1] + adds r4, 0x1 + movs r0, 0x1 + add r12, r0 + subs r2, 0x1 + cmp r2, 0 + bne _080A537C +_080A538E: + adds r0, r6, r3 + cmp r0, r7 + blt _080A5310 +_080A5394: + add r9, r7 + mov r1, r9 + cmp r1, 0xFF + bgt _080A53AE + movs r0, 0xFF +_080A539E: + mov r2, r12 + strb r0, [r2] + movs r3, 0x1 + add r12, r3 + add r9, r3 + mov r1, r9 + cmp r1, 0xFF + ble _080A539E +_080A53AE: + ldr r1, [sp, 0x14] + mov r0, r10 + ldr r2, [sp, 0x10] + cmp r1, r2 + bge _080A53BA + b _080A526A +_080A53BA: + ldr r3, [sp, 0x8] + cmp r0, r3 + bge _080A53E6 + movs r1, 0xFF +_080A53C2: + adds r0, 0x1 + mov r10, r0 + movs r0, 0xFF + mov r9, r0 +_080A53CA: + mov r2, r12 + strb r1, [r2] + movs r3, 0x1 + add r12, r3 + movs r0, 0x1 + negs r0, r0 + add r9, r0 + mov r2, r9 + cmp r2, 0 + bge _080A53CA + mov r0, r10 + ldr r3, [sp, 0x8] + cmp r0, r3 + blt _080A53C2 +_080A53E6: + mov r8, r5 + b _080A547E +_080A53EA: + ldr r1, [sp] + movs r0, 0 + ldr r2, [sp, 0x4] + ldrb r2, [r2, 0x1] + str r2, [sp, 0x10] + ldr r3, [sp, 0x4] + ldrh r2, [r3, 0xA] + mov r3, sp + strh r2, [r3, 0xC] + movs r6, 0xFF +_080A53FE: + adds r5, r0, 0x1 + movs r4, 0xFF +_080A5402: + strb r6, [r1] + adds r1, 0x1 + subs r4, 0x1 + cmp r4, 0 + bge _080A5402 + adds r0, r5, 0 + cmp r0, 0x3 + ble _080A53FE + movs r4, 0 + ldr r3, [sp, 0x10] + cmp r4, r3 + bge _080A5460 + ldr r2, [sp, 0x4] + ldrb r7, [r2] + movs r3, 0xFF +_080A5420: + adds r5, r0, 0x1 + adds r2, r4, 0x1 + movs r4, 0x4 +_080A5426: + strb r3, [r1] + adds r1, 0x1 + subs r4, 0x1 + cmp r4, 0 + bge _080A5426 + movs r4, 0x5 + cmp r7, 0 + beq _080A5444 + movs r6, 0 + adds r0, r7, 0 +_080A543A: + strb r6, [r1] + adds r1, 0x1 + subs r0, 0x1 + cmp r0, 0 + bne _080A543A +_080A5444: + adds r4, r7 + cmp r4, 0xFF + bgt _080A5456 + movs r0, 0xFF +_080A544C: + strb r0, [r1] + adds r1, 0x1 + adds r4, 0x1 + cmp r4, 0xFF + ble _080A544C +_080A5456: + adds r4, r2, 0 + adds r0, r5, 0 + ldr r2, [sp, 0x10] + cmp r4, r2 + blt _080A5420 +_080A5460: + ldr r3, [sp, 0x8] + cmp r0, r3 + bge _080A547E + movs r6, 0xFF +_080A5468: + adds r5, r0, 0x1 + movs r4, 0xFF +_080A546C: + strb r6, [r1] + adds r1, 0x1 + subs r4, 0x1 + cmp r4, 0 + bge _080A546C + adds r0, r5, 0 + ldr r2, [sp, 0x8] + cmp r0, r2 + blt _080A5468 +_080A547E: + mov r3, sp + ldrh r3, [r3, 0xC] + lsls r0, r3, 16 + cmp r0, 0 + bgt _080A548A + b _080A5590 +_080A548A: + mov r6, r8 + ldr r0, [sp] + movs r1, 0x80 + lsls r1, 3 + adds r2, r0, r1 + movs r0, 0 + ldr r3, [sp, 0x10] + cmp r0, r3 + bge _080A5586 + movs r1, 0xFB + mov r10, r1 +_080A54A0: + adds r2, 0x5 + movs r4, 0 + cmp r0, 0 + bne _080A54EC + ldr r3, [sp, 0x4] + ldrb r7, [r3] + movs r1, 0x1 + mov r9, r1 + cmp r0, r7 + bge _080A5574 +_080A54B4: + ldrb r1, [r6] + adds r6, 0x1 + cmp r1, 0x7F + ble _080A54DE + subs r4, 0x7F + cmp r1, 0x7F + ble _080A54D6 + movs r5, 0x80 + adds r3, r1, 0 + subs r3, 0x7F +_080A54C8: + ldrb r0, [r2] + orrs r0, r5 + strb r0, [r2] + adds r2, 0x1 + subs r3, 0x1 + cmp r3, 0 + bne _080A54C8 +_080A54D6: + adds r4, r1 + ldr r3, [sp, 0x4] + ldrb r7, [r3] + b _080A54E6 +_080A54DE: + adds r0, r1, 0x1 + adds r2, r0 + adds r0, r4, 0x1 + adds r4, r0, r1 +_080A54E6: + cmp r4, r7 + blt _080A54B4 + b _080A5574 +_080A54EC: + ldr r1, _080A5538 + adds r1, r2 + mov r12, r1 + ldr r3, [sp, 0x4] + ldrb r7, [r3] + adds r0, 0x1 + mov r9, r0 + cmp r4, r7 + bge _080A5574 +_080A54FE: + ldrb r5, [r6] + adds r6, 0x1 + cmp r5, 0x7F + ble _080A553C + subs r4, 0x7F + cmp r5, 0x7F + ble _080A556A + movs r7, 0x80 + movs r0, 0x80 + mov r8, r0 + adds r3, r5, 0 + subs r3, 0x7F +_080A5516: + mov r0, r12 + ldrb r1, [r0] + mov r0, r8 + ands r0, r1 + movs r1, 0x1 + add r12, r1 + cmp r0, 0 + bne _080A552C + ldrb r0, [r2] + orrs r0, r7 + strb r0, [r2] +_080A552C: + adds r2, 0x1 + subs r3, 0x1 + cmp r3, 0 + bne _080A5516 + b _080A556A + .align 2, 0 +_080A5538: .4byte 0xffffff00 +_080A553C: + movs r3, 0 + adds r4, 0x1 + cmp r3, r5 + bgt _080A556A + movs r7, 0x80 + movs r3, 0x80 + mov r8, r3 + adds r3, r5, 0x1 +_080A554C: + mov r0, r12 + ldrb r1, [r0] + mov r0, r8 + ands r0, r1 + movs r1, 0x1 + add r12, r1 + cmp r0, 0 + beq _080A5562 + ldrb r0, [r2] + orrs r0, r7 + strb r0, [r2] +_080A5562: + adds r2, 0x1 + subs r3, 0x1 + cmp r3, 0 + bne _080A554C +_080A556A: + adds r4, r5 + ldr r3, [sp, 0x4] + ldrb r7, [r3] + cmp r4, r7 + blt _080A54FE +_080A5574: + mov r1, r10 + subs r0, r1, r7 + adds r2, r0 + mov r0, r9 + ldr r3, [sp, 0x4] + ldrb r3, [r3, 0x1] + str r3, [sp, 0x10] + cmp r0, r3 + blt _080A54A0 +_080A5586: + mov r8, r6 + ldr r0, [sp, 0x4] + ldrh r1, [r0, 0xA] + mov r0, sp + strh r1, [r0, 0xC] +_080A5590: + mov r2, sp + ldrh r2, [r2, 0xC] + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, 0x1 + ble _080A568C + mov r6, r8 + ldr r3, [sp] + movs r0, 0x80 + lsls r0, 3 + adds r2, r3, r0 + movs r0, 0 + b _080A5684 +_080A55AA: + adds r2, 0x5 + movs r4, 0 + cmp r0, 0 + bne _080A55F2 + ldr r3, [sp, 0x4] + ldrb r7, [r3] + movs r1, 0x1 + mov r10, r1 + cmp r0, r7 + bge _080A567C +_080A55BE: + ldrb r1, [r6] + adds r6, 0x1 + cmp r1, 0x7F + ble _080A55E4 + subs r4, 0x7F + cmp r1, 0x7F + ble _080A55E0 + movs r5, 0x40 + adds r3, r1, 0 + subs r3, 0x7F +_080A55D2: + ldrb r0, [r2] + orrs r0, r5 + strb r0, [r2] + adds r2, 0x1 + subs r3, 0x1 + cmp r3, 0 + bne _080A55D2 +_080A55E0: + adds r4, r1 + b _080A55EC +_080A55E4: + adds r0, r1, 0x1 + adds r2, r0 + adds r0, r4, 0x1 + adds r4, r0, r1 +_080A55EC: + cmp r4, r7 + blt _080A55BE + b _080A567C +_080A55F2: + ldr r3, _080A5640 + adds r3, r2 + mov r12, r3 + ldr r1, [sp, 0x4] + ldrb r7, [r1] + adds r0, 0x1 + mov r10, r0 + cmp r4, r7 + bge _080A567C +_080A5604: + ldrb r5, [r6] + adds r6, 0x1 + cmp r5, 0x7F + ble _080A5644 + subs r4, 0x7F + cmp r5, 0x7F + ble _080A5676 + movs r3, 0x40 + mov r8, r3 + movs r0, 0x40 + mov r9, r0 + adds r3, r5, 0 + subs r3, 0x7F +_080A561E: + mov r0, r12 + ldrb r1, [r0] + mov r0, r9 + ands r0, r1 + movs r1, 0x1 + add r12, r1 + cmp r0, 0 + bne _080A5636 + ldrb r0, [r2] + mov r1, r8 + orrs r0, r1 + strb r0, [r2] +_080A5636: + adds r2, 0x1 + subs r3, 0x1 + cmp r3, 0 + bne _080A561E + b _080A5676 + .align 2, 0 +_080A5640: .4byte 0xffffff00 +_080A5644: + movs r3, 0 + adds r4, 0x1 + cmp r3, r5 + bgt _080A5676 + movs r3, 0x40 + mov r8, r3 + movs r0, 0x40 + mov r9, r0 + adds r3, r5, 0x1 +_080A5656: + mov r0, r12 + ldrb r1, [r0] + mov r0, r9 + ands r0, r1 + movs r1, 0x1 + add r12, r1 + cmp r0, 0 + beq _080A566E + ldrb r0, [r2] + mov r1, r8 + orrs r0, r1 + strb r0, [r2] +_080A566E: + adds r2, 0x1 + subs r3, 0x1 + cmp r3, 0 + bne _080A5656 +_080A5676: + adds r4, r5 + cmp r4, r7 + blt _080A5604 +_080A567C: + movs r3, 0xFB + subs r0, r3, r7 + adds r2, r0 + mov r0, r10 +_080A5684: + ldr r1, [sp, 0x10] + cmp r0, r1 + blt _080A55AA + mov r8, r6 +_080A568C: + mov r0, r8 + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80A5204 + + thumb_func_start sub_80A56A0 +sub_80A56A0: + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + lsls r3, 24 + lsrs r3, 24 + lsls r2, 24 + lsrs r2, 24 + ldr r0, _080A56BC + ldr r0, [r0] + adds r1, r3, 0 + bl sub_80A3B80 + pop {r0} + bx r0 + .align 2, 0 +_080A56BC: .4byte gUnknown_3001B70 + thumb_func_end sub_80A56A0 + + thumb_func_start sub_80A56C0 +sub_80A56C0: + push {lr} + adds r2, r0, 0 + ldr r0, _080A56D4 + ldr r0, [r0] + movs r1, 0 + bl sub_80A4558 + pop {r0} + bx r0 + .align 2, 0 +_080A56D4: .4byte gUnknown_3001B70 + thumb_func_end sub_80A56C0 + + thumb_func_start sub_80A56D8 +sub_80A56D8: + push {lr} + adds r2, r0, 0 + ldr r0, _080A56EC + ldr r0, [r0] + movs r1, 0 + bl sub_80A456C + pop {r0} + bx r0 + .align 2, 0 +_080A56EC: .4byte gUnknown_3001B70 + thumb_func_end sub_80A56D8 + + thumb_func_start sub_80A56F0 +sub_80A56F0: + ldr r1, _080A5700 + ldr r2, [r1] + adds r2, 0xE8 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r2] + str r1, [r2, 0x4] + bx lr + .align 2, 0 +_080A5700: .4byte gUnknown_3001B6C + thumb_func_end sub_80A56F0 + + thumb_func_start sub_80A5704 +sub_80A5704: + ldr r1, _080A5724 + ldr r3, [r1] + adds r2, r3, 0 + adds r2, 0xF8 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [r2] + str r1, [r2, 0x4] + adds r0, r3, 0 + adds r0, 0xF0 + movs r1, 0 + str r1, [r0] + adds r0, 0x4 + str r1, [r0] + bx lr + .align 2, 0 +_080A5724: .4byte gUnknown_3001B6C + thumb_func_end sub_80A5704 + + thumb_func_start sub_80A5728 +sub_80A5728: + ldr r0, _080A5734 + ldr r0, [r0] + adds r0, 0xE4 + movs r1, 0 + ldrsh r0, [r0, r1] + bx lr + .align 2, 0 +_080A5734: .4byte gUnknown_3001B6C + thumb_func_end sub_80A5728 + + thumb_func_start sub_80A5738 +sub_80A5738: + ldr r0, _080A5750 + ldr r0, [r0] + adds r0, 0xE4 + movs r2, 0 + ldrsh r1, [r0, r2] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, _080A5754 + adds r0, r1 + bx lr + .align 2, 0 +_080A5750: .4byte gUnknown_3001B6C +_080A5754: .4byte gUnknown_811BAF4 + thumb_func_end sub_80A5738 + + thumb_func_start sub_80A5758 +sub_80A5758: + push {lr} + adds r1, r0, 0 + ldr r0, _080A5768 + ldr r0, [r0] + cmp r0, 0 + bne _080A576C + movs r0, 0 + b _080A5772 + .align 2, 0 +_080A5768: .4byte gUnknown_3001B70 +_080A576C: + bl sub_80A4608 + movs r0, 0x1 +_080A5772: + pop {r1} + bx r1 + thumb_func_end sub_80A5758 + + thumb_func_start sub_80A5778 +sub_80A5778: + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + ldr r0, _080A578C + ldr r0, [r0] + cmp r0, 0 + bne _080A5790 + movs r0, 0 + b _080A5798 + .align 2, 0 +_080A578C: .4byte gUnknown_3001B70 +_080A5790: + adds r1, r3, 0 + bl sub_80A463C + movs r0, 0x1 +_080A5798: + pop {r1} + bx r1 + thumb_func_end sub_80A5778 + + thumb_func_start sub_80A579C +sub_80A579C: + push {r4-r7,lr} + adds r6, r0, 0 + adds r5, r1, 0 + ldr r0, _080A5838 + ldr r3, [r0] + cmp r3, 0 + beq _080A5854 + ldr r0, _080A583C + ldr r0, [r0] + adds r2, r0, 0 + adds r2, 0xE4 + movs r0, 0 + ldrsh r1, [r2, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080A5854 + adds r0, r1, 0 + lsls r4, r0, 1 + adds r4, r0 + lsls r4, 2 + ldr r0, _080A5840 + adds r4, r0 + adds r0, r3, 0 + adds r1, r6, 0 + adds r2, r5, 0 + bl sub_80A463C + ldr r2, [r6] + mov r12, r2 + movs r0, 0xF0 + lsls r0, 7 + add r0, r12 + str r0, [r6] + ldr r3, [r6, 0x4] + movs r7, 0xA0 + lsls r7, 7 + adds r0, r3, r7 + str r0, [r6, 0x4] + ldr r2, [r5] + ldr r1, _080A5844 + adds r0, r2, r1 + str r0, [r5] + ldr r1, [r5, 0x4] + ldr r7, _080A5848 + adds r0, r1, r7 + str r0, [r5, 0x4] + movs r7, 0 + ldrsh r0, [r4, r7] + cmp r0, 0xA + bne _080A581E + movs r0, 0x90 + lsls r0, 8 + add r0, r12 + str r0, [r6] + movs r4, 0xD0 + lsls r4, 7 + adds r0, r3, r4 + str r0, [r6, 0x4] + ldr r7, _080A584C + adds r0, r2, r7 + str r0, [r5] + ldr r2, _080A5850 + adds r0, r1, r2 + str r0, [r5, 0x4] +_080A581E: + ldr r1, [r6] + ldr r0, [r5] + cmp r1, r0 + ble _080A5828 + str r1, [r5] +_080A5828: + ldr r1, [r6, 0x4] + ldr r0, [r5, 0x4] + cmp r1, r0 + ble _080A5832 + str r1, [r5, 0x4] +_080A5832: + movs r0, 0x1 + b _080A5856 + .align 2, 0 +_080A5838: .4byte gUnknown_3001B70 +_080A583C: .4byte gUnknown_3001B6C +_080A5840: .4byte gUnknown_811BAF4 +_080A5844: .4byte 0xffff8800 +_080A5848: .4byte 0xffffb000 +_080A584C: .4byte 0xffff7000 +_080A5850: .4byte 0xffff9800 +_080A5854: + movs r0, 0 +_080A5856: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80A579C + + thumb_func_start sub_80A585C +sub_80A585C: + push {r4-r7,lr} + adds r7, r1, 0 + ldr r1, _080A5884 + ldr r2, [r1] + ldr r1, _080A5888 + adds r2, r1 + ldr r1, [r0, 0x4] + lsls r1, 8 + ldr r0, [r0] + adds r1, r0 + ldr r0, _080A588C + adds r1, r0 + ldr r0, [r2] + adds r5, r0, r1 + ldr r4, [r7, 0x4] + cmp r0, 0 + bne _080A5890 +_080A587E: + movs r0, 0x1 + b _080A58C0 + .align 2, 0 +_080A5884: .4byte gUnknown_3001B70 +_080A5888: .4byte 0x00000544 +_080A588C: .4byte 0x00000405 +_080A5890: + cmp r4, 0 + ble _080A58BE + movs r1, 0x80 + lsls r1, 1 + mov r12, r1 +_080A589A: + ldr r2, [r7] + adds r3, r5, 0 + cmp r2, 0 + ble _080A58B6 + movs r6, 0x80 +_080A58A4: + ldrb r1, [r3] + adds r0, r6, 0 + ands r0, r1 + adds r3, 0x1 + cmp r0, 0 + bne _080A587E + subs r2, 0x1 + cmp r2, 0 + bgt _080A58A4 +_080A58B6: + add r5, r12 + subs r4, 0x1 + cmp r4, 0 + bgt _080A589A +_080A58BE: + movs r0, 0 +_080A58C0: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80A585C + + thumb_func_start sub_80A58C8 +sub_80A58C8: + push {r4-r7,lr} + adds r7, r1, 0 + ldr r1, _080A58F0 + ldr r2, [r1] + ldr r1, _080A58F4 + adds r2, r1 + ldr r1, [r0, 0x4] + lsls r1, 8 + ldr r0, [r0] + adds r1, r0 + ldr r0, _080A58F8 + adds r1, r0 + ldr r0, [r2] + adds r5, r0, r1 + ldr r4, [r7, 0x4] + cmp r0, 0 + bne _080A58FC +_080A58EA: + movs r0, 0x1 + b _080A592C + .align 2, 0 +_080A58F0: .4byte gUnknown_3001B70 +_080A58F4: .4byte 0x00000544 +_080A58F8: .4byte 0x00000405 +_080A58FC: + cmp r4, 0 + ble _080A592A + movs r1, 0x80 + lsls r1, 1 + mov r12, r1 +_080A5906: + ldr r2, [r7] + adds r3, r5, 0 + cmp r2, 0 + ble _080A5922 + movs r6, 0x40 +_080A5910: + ldrb r1, [r3] + adds r0, r6, 0 + ands r0, r1 + adds r3, 0x1 + cmp r0, 0 + bne _080A58EA + subs r2, 0x1 + cmp r2, 0 + bgt _080A5910 +_080A5922: + add r5, r12 + subs r4, 0x1 + cmp r4, 0 + bgt _080A5906 +_080A592A: + movs r0, 0 +_080A592C: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80A58C8 + + thumb_func_start sub_80A5934 +sub_80A5934: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r3, r2, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _080A5958 + ldr r0, [r0] + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_80A4660 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080A5958: .4byte gUnknown_3001B70 + thumb_func_end sub_80A5934 + + thumb_func_start sub_80A595C +sub_80A595C: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r3, r2, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r0, _080A5980 + ldr r0, [r0] + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_80A46C0 + lsls r0, 24 + lsrs r0, 24 + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080A5980: .4byte gUnknown_3001B70 + thumb_func_end sub_80A595C + + thumb_func_start sub_80A5984 +sub_80A5984: + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + ldr r0, _080A599C + ldr r0, [r0] + adds r1, r3, 0 + bl sub_80A4720 + lsls r0, 16 + lsrs r0, 16 + pop {r1} + bx r1 + .align 2, 0 +_080A599C: .4byte gUnknown_3001B70 + thumb_func_end sub_80A5984 + + thumb_func_start sub_80A59A0 +sub_80A59A0: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + lsls r3, r2, 16 + lsrs r3, 16 + ldr r0, _080A59BC + ldr r0, [r0] + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_80A4740 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080A59BC: .4byte gUnknown_3001B70 + thumb_func_end sub_80A59A0 + + thumb_func_start sub_80A59C0 +sub_80A59C0: + push {lr} + bl nullsub_123 + ldr r0, _080A59D4 + ldr r0, [r0] + ldr r1, _080A59D8 + bl sub_809DA70 + pop {r0} + bx r0 + .align 2, 0 +_080A59D4: .4byte gUnknown_3001B6C +_080A59D8: .4byte gUnknown_8117770 + thumb_func_end sub_80A59C0 + + thumb_func_start sub_80A59DC +sub_80A59DC: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x58 + ldr r7, _080A5A34 + ldr r0, [r7] + cmp r0, 0 + bne _080A59F0 + b _080A5E5A +_080A59F0: + mov r9, sp + mov r0, sp + bl sub_809D248 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _080A5A04 + str r0, [sp] + str r0, [sp, 0x4] +_080A5A04: + ldr r0, _080A5A38 + mov r8, r0 + ldr r3, [r0] + adds r0, r3, 0 + adds r0, 0xE4 + movs r1, 0 + ldrsh r0, [r0, r1] + mov r6, r8 + cmp r0, 0xAB + bne _080A5A1A + b _080A5BBE +_080A5A1A: + cmp r0, 0xAB + bgt _080A5A46 + cmp r0, 0xA3 + bgt _080A5A3C + cmp r0, 0xA2 + bge _080A5A76 + cmp r0, 0x4 + bne _080A5A2C + b _080A5D76 +_080A5A2C: + cmp r0, 0xA1 + bne _080A5A32 + b _080A5E28 +_080A5A32: + b _080A5E46 + .align 2, 0 +_080A5A34: .4byte gUnknown_3001B70 +_080A5A38: .4byte gUnknown_3001B6C +_080A5A3C: + cmp r0, 0xA8 + beq _080A5AF4 + cmp r0, 0xAA + beq _080A5AF4 + b _080A5E46 +_080A5A46: + cmp r0, 0xB0 + bne _080A5A4C + b _080A5C76 +_080A5A4C: + cmp r0, 0xB0 + bgt _080A5A5E + cmp r0, 0xAE + bne _080A5A56 + b _080A5B58 +_080A5A56: + cmp r0, 0xAF + bne _080A5A5C + b _080A5BD8 +_080A5A5C: + b _080A5E46 +_080A5A5E: + cmp r0, 0xDF + beq _080A5A76 + cmp r0, 0xDF + bgt _080A5A6E + cmp r0, 0xBA + bne _080A5A6C + b _080A5D18 +_080A5A6C: + b _080A5E46 +_080A5A6E: + cmp r0, 0xE0 + bne _080A5A74 + b _080A5DDA +_080A5A74: + b _080A5E46 +_080A5A76: + ldr r3, [r6] + adds r2, r3, 0 + adds r2, 0xF4 + ldr r1, [r2] + adds r0, r1, 0x2 + str r0, [r2] + adds r4, r3, 0 + adds r4, 0xFC + cmp r0, 0 + bge _080A5A8C + adds r0, r1, 0x5 +_080A5A8C: + asrs r1, r0, 2 + ldr r0, [r4] + adds r0, r1 + str r0, [r4] + ldr r0, [r2] + movs r1, 0x3 + ands r0, r1 + str r0, [r2] + ldr r5, _080A5AF0 + ldr r0, [r5] + adds r2, r3, 0 + adds r2, 0xF8 + movs r1, 0 + bl sub_80A4580 + ldr r0, [sp] + str r0, [sp, 0x8] + ldr r0, [r6] + adds r0, 0xFC + ldr r1, [sp, 0x4] + ldr r0, [r0] + adds r1, r0 + add r4, sp, 0x8 + str r1, [r4, 0x4] + ldr r0, [r5] + movs r1, 0 + adds r2, r4, 0 + bl sub_80A4580 + ldr r0, [r5] + movs r1, 0 + adds r2, r4, 0 + bl sub_80A456C + ldr r0, [sp] + str r0, [sp, 0x8] + ldr r0, [r6] + adds r0, 0xFC + ldr r1, [sp, 0x4] + ldr r0, [r0] + subs r1, r0 + str r1, [r4, 0x4] + ldr r0, [r5] + movs r1, 0x1 + adds r2, r4, 0 + bl sub_80A4580 + ldr r0, [r5] + b _080A5DD0 + .align 2, 0 +_080A5AF0: .4byte gUnknown_3001B70 +_080A5AF4: + ldr r2, [r6] + adds r3, r2, 0 + adds r3, 0xF0 + adds r0, r2, 0 + adds r0, 0xE8 + ldr r1, [r3] + ldr r0, [r0] + adds r1, r0 + str r1, [r3] + adds r2, 0xF8 + cmp r1, 0 + bge _080A5B0E + adds r1, 0x7 +_080A5B0E: + asrs r1, 3 + ldr r0, [r2] + adds r0, r1 + str r0, [r2] + ldr r1, [r3] + adds r0, r1, 0 + cmp r1, 0 + bge _080A5B20 + adds r0, r1, 0x7 +_080A5B20: + asrs r0, 3 + lsls r0, 3 + subs r0, r1, r0 + str r0, [r3] + ldr r5, _080A5B54 + ldr r0, [r5] + movs r1, 0 + bl sub_80A4580 + ldr r0, [r6] + adds r0, 0xF8 + ldr r1, [sp] + ldr r0, [r0] + adds r1, r0 + str r1, [sp, 0x10] + ldr r0, [sp, 0x4] + add r4, sp, 0x10 + str r0, [r4, 0x4] + ldr r0, [r5] + movs r1, 0 + adds r2, r4, 0 + bl sub_80A4580 + ldr r0, [r5] + movs r1, 0 + b _080A5DD2 + .align 2, 0 +_080A5B54: .4byte gUnknown_3001B70 +_080A5B58: + adds r4, r3, 0 + adds r4, 0xF0 + adds r0, r3, 0 + adds r0, 0xE8 + ldr r1, [r4] + ldr r0, [r0] + adds r1, r0 + str r1, [r4] + adds r2, r3, 0 + adds r2, 0xF8 + cmp r1, 0 + bge _080A5B72 + adds r1, 0x7 +_080A5B72: + asrs r1, 3 + ldr r0, [r2] + adds r0, r1 + str r0, [r2] + ldr r1, [r4] + adds r0, r1, 0 + cmp r1, 0 + bge _080A5B84 + adds r0, r1, 0x7 +_080A5B84: + asrs r0, 3 + lsls r0, 3 + subs r0, r1, r0 + str r0, [r4] + ldr r0, [r7] + movs r1, 0 + bl sub_80A4580 + mov r1, r8 + ldr r0, [r1] + adds r0, 0xF8 + ldr r1, [sp] + ldr r0, [r0] + adds r1, r0 + str r1, [sp, 0x18] + ldr r0, [sp, 0x4] + add r4, sp, 0x18 + str r0, [r4, 0x4] + ldr r0, [r7] + movs r1, 0 + adds r2, r4, 0 + bl sub_80A4580 + ldr r0, [r7] + movs r1, 0 + adds r2, r4, 0 + bl sub_80A456C + b _080A5DCE +_080A5BBE: + ldr r0, [sp] + ldr r1, [sp, 0x4] + str r0, [sp, 0x20] + str r1, [sp, 0x24] + ldr r0, [r7] + add r4, sp, 0x20 + movs r1, 0 + adds r2, r4, 0 + bl sub_80A4580 + ldr r0, [r7] + movs r1, 0 + b _080A5DD2 +_080A5BD8: + ldr r0, [r7] + movs r1, 0 + mov r2, sp + bl sub_80A456C + mov r0, r8 + ldr r3, [r0] + adds r4, r3, 0 + adds r4, 0xF0 + adds r1, r3, 0 + adds r1, 0xE8 + ldr r0, [r4] + ldr r1, [r1] + adds r0, r1 + str r0, [r4] + adds r5, r3, 0 + adds r5, 0xF4 + adds r1, r3, 0 + adds r1, 0xEC + ldr r0, [r5] + ldr r1, [r1] + adds r0, r1 + str r0, [r5] + adds r2, r3, 0 + adds r2, 0xF8 + ldr r1, [r4] + cmp r1, 0 + bge _080A5C12 + adds r1, 0x7 +_080A5C12: + asrs r1, 3 + ldr r0, [r2] + adds r0, r1 + str r0, [r2] + adds r3, 0xFC + ldr r1, [r5] + cmp r1, 0 + bge _080A5C24 + adds r1, 0x7 +_080A5C24: + asrs r1, 3 + ldr r0, [r3] + adds r0, r1 + str r0, [r3] + ldr r1, [r4] + adds r0, r1, 0 + cmp r1, 0 + bge _080A5C36 + adds r0, r1, 0x7 +_080A5C36: + asrs r0, 3 + lsls r0, 3 + subs r0, r1, r0 + str r0, [r4] + ldr r1, [r5] + adds r0, r1, 0 + cmp r1, 0 + bge _080A5C48 + adds r0, r1, 0x7 +_080A5C48: + asrs r0, 3 + lsls r0, 3 + subs r0, r1, r0 + str r0, [r5] + ldr r0, [r7] + movs r1, 0 + bl sub_80A4580 + mov r1, r8 + ldr r2, [r1] + adds r1, r2, 0 + adds r1, 0xF8 + ldr r0, [sp] + ldr r1, [r1] + adds r0, r1 + str r0, [sp, 0x28] + adds r2, 0xFC + mov r1, r9 + ldr r0, [r1, 0x4] + ldr r1, [r2] + adds r0, r1 + add r4, sp, 0x28 + b _080A5DC2 +_080A5C76: + adds r4, r3, 0 + adds r4, 0xF0 + adds r1, r3, 0 + adds r1, 0xE8 + ldr r0, [r4] + ldr r1, [r1] + adds r0, r1 + str r0, [r4] + adds r5, r3, 0 + adds r5, 0xF4 + adds r1, r3, 0 + adds r1, 0xEC + ldr r0, [r5] + ldr r1, [r1] + adds r0, r1 + str r0, [r5] + adds r6, r3, 0 + adds r6, 0xF8 + ldr r1, [r4] + cmp r1, 0 + bge _080A5CA2 + adds r1, 0x7 +_080A5CA2: + asrs r1, 3 + ldr r0, [r6] + adds r0, r1 + str r0, [r6] + adds r2, r3, 0 + adds r2, 0xFC + ldr r1, [r5] + cmp r1, 0 + bge _080A5CB6 + adds r1, 0x7 +_080A5CB6: + asrs r1, 3 + ldr r0, [r2] + adds r0, r1 + str r0, [r2] + ldr r1, [r4] + adds r0, r1, 0 + cmp r1, 0 + bge _080A5CC8 + adds r0, r1, 0x7 +_080A5CC8: + asrs r0, 3 + lsls r0, 3 + subs r0, r1, r0 + str r0, [r4] + ldr r1, [r5] + adds r0, r1, 0 + cmp r1, 0 + bge _080A5CDA + adds r0, r1, 0x7 +_080A5CDA: + asrs r0, 3 + lsls r0, 3 + subs r0, r1, r0 + str r0, [r5] + ldr r0, [r7] + movs r1, 0 + adds r2, r6, 0 + bl sub_80A4580 + mov r0, r8 + ldr r2, [r0] + adds r1, r2, 0 + adds r1, 0xF8 + ldr r0, [sp] + ldr r1, [r1] + adds r0, r1 + str r0, [sp, 0x30] + adds r2, 0xFC + ldr r0, [sp, 0x4] + ldr r1, [r2] + adds r0, r1 + add r4, sp, 0x30 + str r0, [r4, 0x4] + ldr r0, [r7] + movs r1, 0 + adds r2, r4, 0 + bl sub_80A4580 + ldr r0, [r7] + movs r1, 0 + b _080A5DD2 +_080A5D18: + ldr r0, [r7] + movs r1, 0x1 + mov r2, sp + bl sub_80A456C + mov r0, r8 + ldr r1, [r0] + adds r3, r1, 0 + adds r3, 0xF0 + ldr r4, [r3] + adds r0, r4, 0x1 + str r0, [r3] + adds r2, r1, 0 + adds r2, 0xF8 + cmp r0, 0 + bge _080A5D3A + adds r0, r4, 0x4 +_080A5D3A: + asrs r1, r0, 2 + ldr r0, [r2] + adds r0, r1 + str r0, [r2] + ldr r0, [r3] + movs r1, 0x3 + ands r0, r1 + str r0, [r3] + ldr r0, [r7] + movs r1, 0x1 + bl sub_80A4580 + mov r1, r8 + ldr r0, [r1] + adds r0, 0xF8 + ldr r1, [sp] + ldr r0, [r0] + adds r1, r0 + str r1, [sp, 0x38] + ldr r0, [sp, 0x4] + add r4, sp, 0x38 + str r0, [r4, 0x4] + ldr r0, [r7] + movs r1, 0 + adds r2, r4, 0 + bl sub_80A4580 + ldr r0, [r7] + movs r1, 0 + b _080A5DD2 +_080A5D76: + ldr r0, [r7] + movs r1, 0 + mov r2, sp + bl sub_80A456C + mov r0, r8 + ldr r1, [r0] + adds r3, r1, 0 + adds r3, 0xF0 + ldr r4, [r3] + adds r0, r4, 0x1 + str r0, [r3] + adds r2, r1, 0 + adds r2, 0xF8 + cmp r0, 0 + bge _080A5D98 + adds r0, 0x7 +_080A5D98: + asrs r1, r0, 3 + ldr r0, [r2] + adds r0, r1 + str r0, [r2] + ldr r0, [r3] + movs r1, 0x7 + ands r0, r1 + str r0, [r3] + ldr r0, [r7] + movs r1, 0x1 + bl sub_80A4580 + mov r1, r8 + ldr r0, [r1] + adds r0, 0xF8 + ldr r1, [sp] + ldr r0, [r0] + adds r1, r0 + str r1, [sp, 0x40] + ldr r0, [sp, 0x4] + add r4, sp, 0x40 +_080A5DC2: + str r0, [r4, 0x4] + ldr r0, [r7] + movs r1, 0x1 + adds r2, r4, 0 + bl sub_80A4580 +_080A5DCE: + ldr r0, [r7] +_080A5DD0: + movs r1, 0x1 +_080A5DD2: + adds r2, r4, 0 + bl sub_80A456C + b _080A5E52 +_080A5DDA: + ldr r0, [r7] + movs r1, 0 + mov r2, sp + bl sub_80A456C + mov r0, r8 + ldr r1, [r0] + adds r3, r1, 0 + adds r3, 0xF0 + ldr r4, [r3] + adds r0, r4, 0x1 + str r0, [r3] + adds r2, r1, 0 + adds r2, 0xF8 + cmp r0, 0 + bge _080A5DFC + adds r0, 0x7 +_080A5DFC: + asrs r1, r0, 3 + ldr r0, [r2] + adds r0, r1 + str r0, [r2] + ldr r0, [r3] + movs r1, 0x7 + ands r0, r1 + str r0, [r3] + ldr r0, [r7] + movs r1, 0x1 + bl sub_80A4580 + mov r1, r8 + ldr r0, [r1] + adds r0, 0xF8 + ldr r0, [r0] + str r0, [sp, 0x48] + ldr r0, [sp, 0x4] + add r2, sp, 0x48 + str r0, [r2, 0x4] + ldr r0, [r7] + b _080A5E3E +_080A5E28: + ldr r0, [r7] + movs r1, 0 + mov r2, sp + bl sub_80A456C + movs r0, 0 + movs r1, 0 + str r0, [sp, 0x50] + str r1, [sp, 0x54] + ldr r0, [r7] + add r2, sp, 0x50 +_080A5E3E: + movs r1, 0x1 + bl sub_80A456C + b _080A5E52 +_080A5E46: + ldr r0, _080A5E6C + ldr r0, [r0] + movs r1, 0 + mov r2, sp + bl sub_80A456C +_080A5E52: + ldr r0, _080A5E6C + ldr r0, [r0] + bl sub_80A4764 +_080A5E5A: + bl sub_80A60D8 + add sp, 0x58 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A5E6C: .4byte gUnknown_3001B70 + thumb_func_end sub_80A59DC + + thumb_func_start sub_80A5E70 +sub_80A5E70: + push {lr} + ldr r0, _080A5E88 + ldr r0, [r0] + cmp r0, 0 + beq _080A5E7E + bl sub_80A49E8 +_080A5E7E: + bl sub_80A62D0 + pop {r0} + bx r0 + .align 2, 0 +_080A5E88: .4byte gUnknown_3001B70 + thumb_func_end sub_80A5E70 + + thumb_func_start sub_80A5E8C +sub_80A5E8C: + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + ldr r5, _080A5EB4 + movs r0, 0x24 + movs r1, 0x6 + bl MemoryAlloc + str r0, [r5] + ldr r1, _080A5EB8 + strh r1, [r0] + movs r1, 0 + strb r1, [r0, 0x2] + adds r0, r4, 0 + bl sub_80A5EDC + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080A5EB4: .4byte gUnknown_3001B74 +_080A5EB8: .4byte 0x0000ffff + thumb_func_end sub_80A5E8C + + thumb_func_start sub_80A5EBC +sub_80A5EBC: + push {r4,lr} + movs r0, 0 + bl sub_80A5EDC + ldr r4, _080A5ED8 + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A5ED8: .4byte gUnknown_3001B74 + thumb_func_end sub_80A5EBC + + thumb_func_start sub_80A5EDC +sub_80A5EDC: + push {r4-r6,lr} + lsls r0, 24 + lsrs r0, 24 + adds r5, r0, 0 + movs r6, 0x1 + negs r6, r6 + movs r0, 0 + movs r1, 0x1B + adds r2, r6, 0 + bl sub_80018D8 + ldr r0, _080A5F34 + ldr r1, [r0] + ldr r0, _080A5F38 + strh r0, [r1] + strb r5, [r1, 0x2] + ldr r4, _080A5F3C + ldr r0, [r4] + cmp r0, 0 + beq _080A5F12 + bl sub_80A2D00 + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] +_080A5F12: + cmp r5, 0 + beq _080A5F2E + ldr r0, _080A5F40 + movs r1, 0x6 + bl MemoryAlloc + str r0, [r4] + ldr r1, _080A5F44 + bl sub_80A2B40 + ldr r0, [r4] + adds r1, r6, 0 + bl sub_80A2FBC +_080A5F2E: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080A5F34: .4byte gUnknown_3001B74 +_080A5F38: .4byte 0x0000ffff +_080A5F3C: .4byte gUnknown_3001B78 +_080A5F40: .4byte 0x0000055c +_080A5F44: .4byte gUnknown_8117784 + thumb_func_end sub_80A5EDC + + thumb_func_start nullsub_121 +nullsub_121: + bx lr + thumb_func_end nullsub_121 + + thumb_func_start nullsub_122 +nullsub_122: + bx lr + thumb_func_end nullsub_122 + + thumb_func_start sub_80A5F50 +sub_80A5F50: + push {r4-r7,lr} + lsls r0, 16 + asrs r5, r0, 16 + adds r7, r5, 0 + ldr r1, _080A5F94 + ldr r6, _080A5F98 + ldr r0, [r6] + ldrb r3, [r0, 0x2] + movs r0, 0 + adds r2, r5, 0 + bl Log + movs r0, 0 + movs r1, 0x1B + adds r2, r5, 0 + bl sub_80018D8 + ldr r0, [r6] + movs r4, 0 + strh r5, [r0] + ldrb r0, [r0, 0x2] + cmp r0, 0 + bne _080A5F80 + b _080A60B4 +_080A5F80: + movs r0, 0x1 + negs r0, r0 + cmp r5, r0 + bne _080A5FA0 + ldr r0, _080A5F9C + ldr r0, [r0] + adds r1, r5, 0 + bl sub_80A2FBC + b _080A60B4 + .align 2, 0 +_080A5F94: .4byte gUnknown_811779C +_080A5F98: .4byte gUnknown_3001B74 +_080A5F9C: .4byte gUnknown_3001B78 +_080A5FA0: + lsls r1, r7, 2 + ldr r0, _080A5FD8 + adds r5, r1, r0 + ldr r0, _080A5FDC + ldr r0, [r0] + movs r2, 0x2 + ldrsh r1, [r5, r2] + bl sub_80A2FBC + ldr r0, [r6] + str r4, [r0, 0x4] + str r4, [r0, 0x8] + str r4, [r0, 0xC] + str r4, [r0, 0x10] + str r4, [r0, 0x20] + str r4, [r0, 0x1C] + str r4, [r0, 0x18] + str r4, [r0, 0x14] + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0xF + bhi _080A6098 + lsls r0, 2 + ldr r1, _080A5FE0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080A5FD8: .4byte gUnknown_811E5F4 +_080A5FDC: .4byte gUnknown_3001B78 +_080A5FE0: .4byte _080A5FE4 + .align 2, 0 +_080A5FE4: + .4byte _080A6088 + .4byte _080A6098 + .4byte _080A6098 + .4byte _080A6088 + .4byte _080A6088 + .4byte _080A6088 + .4byte _080A6098 + .4byte _080A6040 + .4byte _080A6088 + .4byte _080A6024 + .4byte _080A6098 + .4byte _080A6098 + .4byte _080A6098 + .4byte _080A6098 + .4byte _080A6050 + .4byte _080A606C +_080A6024: + ldr r0, _080A6034 + ldr r0, [r0] + movs r1, 0x1 + bl sub_80A3BB0 + ldr r1, _080A6038 + ldr r2, _080A603C + b _080A60B0 + .align 2, 0 +_080A6034: .4byte gUnknown_3001B78 +_080A6038: .4byte gUnknown_2026E4E +_080A603C: .4byte 0x0000040c +_080A6040: + ldr r1, _080A6048 + ldr r2, _080A604C + b _080A60B0 + .align 2, 0 +_080A6048: .4byte gUnknown_2026E4E +_080A604C: .4byte 0x00000808 +_080A6050: + ldr r0, _080A6060 + ldr r0, [r0] + movs r1, 0x1 + bl sub_80A3BB0 + ldr r1, _080A6064 + ldr r2, _080A6068 + b _080A60B0 + .align 2, 0 +_080A6060: .4byte gUnknown_3001B78 +_080A6064: .4byte gUnknown_2026E4E +_080A6068: .4byte 0x00001010 +_080A606C: + ldr r0, _080A607C + ldr r0, [r0] + movs r1, 0x1 + bl sub_80A3BB0 + ldr r1, _080A6080 + ldr r2, _080A6084 + b _080A60B0 + .align 2, 0 +_080A607C: .4byte gUnknown_3001B78 +_080A6080: .4byte gUnknown_2026E4E +_080A6084: .4byte 0x0000040c +_080A6088: + ldr r1, _080A6090 + ldr r2, _080A6094 + b _080A60B0 + .align 2, 0 +_080A6090: .4byte gUnknown_2026E4E +_080A6094: .4byte 0x00001010 +_080A6098: + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0x1 + bne _080A60AA + ldr r0, _080A60BC + ldr r0, [r0] + movs r1, 0x1 + bl sub_80A3BB0 +_080A60AA: + ldr r1, _080A60C0 + movs r2, 0x80 + lsls r2, 5 +_080A60B0: + adds r0, r2, 0 + strh r0, [r1] +_080A60B4: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A60BC: .4byte gUnknown_3001B78 +_080A60C0: .4byte gUnknown_2026E4E + thumb_func_end sub_80A5F50 + + thumb_func_start sub_80A60C4 +sub_80A60C4: + ldr r0, _080A60D0 + ldr r0, [r0] + movs r1, 0 + ldrsh r0, [r0, r1] + bx lr + .align 2, 0 +_080A60D0: .4byte gUnknown_3001B74 + thumb_func_end sub_80A60C4 + + thumb_func_start nullsub_123 +nullsub_123: + bx lr + thumb_func_end nullsub_123 + + thumb_func_start sub_80A60D8 +sub_80A60D8: + push {r4-r6,lr} + sub sp, 0x28 + ldr r0, _080A6104 + ldr r3, [r0] + ldrb r1, [r3, 0x2] + adds r6, r0, 0 + cmp r1, 0 + bne _080A60EA + b _080A62C0 +_080A60EA: + ldrh r0, [r3] + adds r0, 0x1 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x10 + bls _080A60F8 + b _080A6278 +_080A60F8: + lsls r0, 2 + ldr r1, _080A6108 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080A6104: .4byte gUnknown_3001B74 +_080A6108: .4byte _080A610C + .align 2, 0 +_080A610C: + .4byte _080A62AC + .4byte _080A6278 + .4byte _080A6278 + .4byte _080A6278 + .4byte _080A6278 + .4byte _080A6278 + .4byte _080A6278 + .4byte _080A6278 + .4byte _080A6278 + .4byte _080A6278 + .4byte _080A6150 + .4byte _080A61CC + .4byte _080A61CC + .4byte _080A61CC + .4byte _080A61CC + .4byte _080A61D0 + .4byte _080A6224 +_080A6150: + ldr r2, [r6] + ldr r1, [r2, 0x4] + adds r0, r1, 0x2 + str r0, [r2, 0x4] + ldr r4, [r2, 0x8] + adds r3, r4, 0x1 + str r3, [r2, 0x8] + cmp r0, 0 + bge _080A6164 + adds r0, r1, 0x5 +_080A6164: + asrs r1, r0, 2 + ldr r0, [r2, 0xC] + adds r0, r1 + str r0, [r2, 0xC] + adds r1, r3, 0 + cmp r1, 0 + bge _080A6174 + adds r1, r4, 0x4 +_080A6174: + asrs r1, 2 + ldr r0, [r2, 0x10] + adds r0, r1 + str r0, [r2, 0x10] + ldr r4, _080A61C8 + ldr r0, [r4] + adds r2, 0xC + movs r1, 0 + bl sub_80A4580 + ldr r1, [r6] + ldr r0, [r1, 0x4] + movs r2, 0x3 + ands r0, r2 + str r0, [r1, 0x4] + ldr r0, [r1, 0x8] + ands r0, r2 + str r0, [r1, 0x8] + mov r0, sp + bl sub_80A56C0 + ldr r2, [r6] + ldr r0, [sp] + ldr r1, [r2, 0xC] + subs r0, r1 + str r0, [sp] + ldr r0, [sp, 0x4] + ldr r1, [r2, 0x10] + adds r0, r1 + str r0, [sp, 0x4] + ldr r0, [r4] + movs r1, 0 + mov r2, sp + bl sub_80A4580 + ldr r0, [r4] + movs r1, 0 + mov r2, sp + bl sub_80A456C + b _080A62B8 + .align 2, 0 +_080A61C8: .4byte gUnknown_3001B78 +_080A61CC: + add r4, sp, 0x8 + b _080A628E +_080A61D0: + ldr r2, [r6] + ldr r1, [r2, 0x4] + adds r0, r1, 0x1 + str r0, [r2, 0x4] + cmp r0, 0 + bge _080A61DE + adds r0, r1, 0x4 +_080A61DE: + asrs r1, r0, 2 + ldr r0, [r2, 0xC] + adds r0, r1 + str r0, [r2, 0xC] + ldr r5, _080A6220 + ldr r0, [r5] + adds r2, 0xC + movs r1, 0 + bl sub_80A4580 + ldr r2, [r6] + ldr r0, [r2, 0x4] + movs r1, 0x3 + ands r0, r1 + str r0, [r2, 0x4] + add r4, sp, 0x10 + adds r0, r4, 0 + bl sub_80A56C0 + ldr r1, [r6] + ldr r0, [sp, 0x10] + ldr r1, [r1, 0xC] + subs r0, r1 + str r0, [sp, 0x10] + movs r0, 0 + str r0, [r4, 0x4] + ldr r0, [r5] + movs r1, 0 + adds r2, r4, 0 + bl sub_80A4580 + ldr r0, [r5] + b _080A6298 + .align 2, 0 +_080A6220: .4byte gUnknown_3001B78 +_080A6224: + ldr r2, [r6] + ldr r1, [r2, 0x4] + adds r0, r1, 0x2 + str r0, [r2, 0x4] + cmp r0, 0 + bge _080A6232 + adds r0, r1, 0x5 +_080A6232: + asrs r1, r0, 2 + ldr r0, [r2, 0xC] + adds r0, r1 + str r0, [r2, 0xC] + ldr r5, _080A6274 + ldr r0, [r5] + adds r2, 0xC + movs r1, 0 + bl sub_80A4580 + ldr r2, [r6] + ldr r0, [r2, 0x4] + movs r1, 0x3 + ands r0, r1 + str r0, [r2, 0x4] + add r4, sp, 0x18 + adds r0, r4, 0 + bl sub_80A56C0 + ldr r1, [r6] + ldr r0, [sp, 0x18] + ldr r1, [r1, 0xC] + subs r0, r1 + str r0, [sp, 0x18] + movs r0, 0 + str r0, [r4, 0x4] + ldr r0, [r5] + movs r1, 0 + adds r2, r4, 0 + bl sub_80A4580 + ldr r0, [r5] + b _080A6298 + .align 2, 0 +_080A6274: .4byte gUnknown_3001B78 +_080A6278: + ldr r0, [r6] + movs r1, 0 + ldrsh r0, [r0, r1] + lsls r0, 2 + ldr r1, _080A62A4 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bne _080A62AC + add r4, sp, 0x20 +_080A628E: + adds r0, r4, 0 + bl sub_80A56C0 + ldr r0, _080A62A8 + ldr r0, [r0] +_080A6298: + movs r1, 0 + adds r2, r4, 0 + bl sub_80A456C + b _080A62B8 + .align 2, 0 +_080A62A4: .4byte gUnknown_811E5F4 +_080A62A8: .4byte gUnknown_3001B78 +_080A62AC: + ldr r0, _080A62C8 + ldr r0, [r0] + ldr r2, _080A62CC + movs r1, 0 + bl sub_80A456C +_080A62B8: + ldr r0, _080A62C8 + ldr r0, [r0] + bl sub_80A4764 +_080A62C0: + add sp, 0x28 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080A62C8: .4byte gUnknown_3001B78 +_080A62CC: .4byte gUnknown_81177BC + thumb_func_end sub_80A60D8 + + thumb_func_start sub_80A62D0 +sub_80A62D0: + push {lr} + ldr r0, _080A62E8 + ldr r0, [r0] + ldrb r0, [r0, 0x2] + cmp r0, 0 + beq _080A62E4 + ldr r0, _080A62EC + ldr r0, [r0] + bl sub_80A49E8 +_080A62E4: + pop {r0} + bx r0 + .align 2, 0 +_080A62E8: .4byte gUnknown_3001B74 +_080A62EC: .4byte gUnknown_3001B78 + thumb_func_end sub_80A62D0 + + thumb_func_start sub_80A62F0 +sub_80A62F0: + push {r4-r7,lr} + ldr r4, _080A6378 + movs r0, 0x88 + lsls r0, 1 + movs r1, 0x6 + bl MemoryAlloc + str r0, [r4] + ldr r0, _080A637C + ldr r1, _080A6380 + bl sub_800A9EC + ldr r1, _080A6384 + str r0, [r1] + movs r0, 0x1 + bl sub_800DAC0 + ldr r4, [r4] + ldr r1, _080A6388 + movs r0, 0x16 + str r0, [r1] + ldr r1, _080A638C + movs r0, 0x1 + strb r0, [r1] + movs r0, 0 + movs r2, 0 + movs r1, 0x80 + lsls r1, 9 + adds r3, r1, 0 +_080A632A: + str r2, [r4] + lsls r0, 4 + str r0, [r4, 0x4] + str r2, [r4, 0x8] + adds r0, r1, 0 + adds r1, r3 + asrs r0, 16 + adds r4, 0xC + cmp r0, 0x15 + ble _080A632A + ldr r0, _080A6378 + ldr r0, [r0] + movs r1, 0x84 + lsls r1, 1 + adds r4, r0, r1 + movs r6, 0 + movs r7, 0 + movs r5, 0xE8 + lsls r5, 13 +_080A6350: + strh r7, [r4] + strh r7, [r4, 0x2] + lsrs r0, r5, 16 + movs r1, 0 + bl sub_80997F4 + movs r0, 0x80 + lsls r0, 9 + adds r5, r0 + adds r6, 0x1 + adds r4, 0x4 + cmp r6, 0x1 + ble _080A6350 + movs r0, 0x1 + negs r0, r0 + bl sub_80A6390 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A6378: .4byte gUnknown_3001B7C +_080A637C: .4byte gUnknown_81177CC +_080A6380: .4byte gUnknown_83B0000 +_080A6384: .4byte gUnknown_203B4B4 +_080A6388: .4byte gUnknown_2039DD4 +_080A638C: .4byte gUnknown_2039DD0 + thumb_func_end sub_80A62F0 + + thumb_func_start sub_80A6390 +sub_80A6390: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + lsls r0, 16 + asrs r0, 16 + mov r9, r0 + ldr r1, _080A641C + movs r0, 0 + bl Log + ldr r0, _080A6420 + movs r1, 0 + mov r8, r1 + strh r1, [r0] + ldr r0, _080A6424 + strh r1, [r0] + bl sub_80A6460 + mov r0, r9 + bl sub_80A4D48 + lsls r0, 24 + movs r1, 0x2 + cmp r0, 0 + beq _080A63C6 + movs r1, 0x3 +_080A63C6: + movs r0, 0xF8 + lsls r0, 1 + bl sub_808E53C + ldr r5, _080A6428 + adds r0, r5, 0 + bl sub_8004E8C + ldr r4, _080A642C + adds r0, r4, 0 + bl sub_8004E8C + ldrh r1, [r4, 0x4] + ldr r6, _080A6430 + adds r0, r6, 0 + ands r0, r1 + strh r0, [r4, 0x4] + ldrh r1, [r4, 0xA] + adds r0, r6, 0 + ands r0, r1 + movs r2, 0x80 + lsls r2, 4 + adds r7, r2, 0 + orrs r0, r7 + strh r0, [r4, 0xA] + mov r0, r9 + bl sub_80A4D48 + lsls r0, 24 + cmp r0, 0 + beq _080A6434 + ldrh r1, [r5, 0x4] + adds r0, r6, 0 + ands r0, r1 + strh r0, [r5, 0x4] + ldrh r1, [r5, 0xA] + adds r0, r6, 0 + ands r0, r1 + movs r2, 0xC0 + lsls r2, 4 + adds r1, r2, 0 + orrs r0, r1 + b _080A6444 + .align 2, 0 +_080A641C: .4byte gUnknown_81177D8 +_080A6420: .4byte gUnknown_2039DCC +_080A6424: .4byte gUnknown_2039DCE +_080A6428: .4byte gUnknown_2039DB0 +_080A642C: .4byte gUnknown_2039DC0 +_080A6430: .4byte 0x0000f3ff +_080A6434: + ldrh r1, [r5, 0x4] + adds r0, r6, 0 + ands r0, r1 + strh r0, [r5, 0x4] + ldrh r1, [r5, 0xA] + adds r0, r6, 0 + ands r0, r1 + orrs r0, r7 +_080A6444: + strh r0, [r5, 0xA] + movs r0, 0x1 + bl sub_8004D8C + movs r0, 0x1 + bl nullsub_10 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80A6390 + + thumb_func_start sub_80A6460 +sub_80A6460: + push {r4-r7,lr} + ldr r0, _080A649C + ldr r1, _080A64A0 + bl sub_800A9EC + adds r7, r0, 0 + movs r5, 0x80 + lsls r5, 1 + ldr r4, [r7, 0x4] + movs r6, 0xC +_080A6474: + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x10 + bl sub_809971C + adds r0, r5, 0 + adds r0, 0x10 + lsls r0, 16 + lsrs r5, r0, 16 + adds r4, 0x40 + subs r6, 0x1 + cmp r6, 0 + bge _080A6474 + adds r0, r7, 0 + bl sub_800AA14 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A649C: .4byte gUnknown_81177EC +_080A64A0: .4byte gUnknown_8510000 + thumb_func_end sub_80A6460 + + thumb_func_start sub_80A64A4 +sub_80A64A4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r0, _080A6508 + ldr r0, [r0] + movs r1, 0x84 + lsls r1, 1 + adds r7, r0, r1 + bl sub_80A6460 + movs r0, 0 + mov r8, r0 +_080A64C0: + movs r1, 0x2 + ldrsh r0, [r7, r1] + cmp r0, 0 + ble _080A6568 + ldrh r5, [r7] + mov r0, r8 + adds r0, 0x1D + lsls r0, 16 + lsrs r0, 16 + mov r10, r0 + mov r1, r8 + lsls r0, r1, 20 + movs r1, 0xE8 + lsls r1, 17 + adds r0, r1 + lsrs r0, 16 + mov r9, r0 + movs r0, 0x80 + lsls r0, 2 + adds r1, r0, 0 + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _080A6514 + ldr r0, _080A650C + ldr r1, _080A6510 + bl sub_800A9EC + adds r6, r0, 0 + movs r0, 0xFF + ands r0, r5 + lsls r0, 6 + ldr r1, [r6, 0x4] + adds r2, r1, r0 + b _080A652A + .align 2, 0 +_080A6508: .4byte gUnknown_3001B7C +_080A650C: .4byte gUnknown_81177EC +_080A6510: .4byte gUnknown_8510000 +_080A6514: + movs r0, 0xFF + ands r0, r5 + lsls r0, 2 + ldr r1, _080A6584 + adds r0, r1 + ldr r0, [r0] + ldr r1, _080A6588 + bl sub_800A9EC + adds r6, r0, 0 + ldr r2, [r6, 0x4] +_080A652A: + movs r1, 0x80 + lsls r1, 5 + adds r0, r1, 0 + adds r1, r5, 0 + ands r1, r0 + lsls r1, 16 + lsrs r1, 16 + negs r1, r1 + lsrs r4, r1, 31 + movs r1, 0x80 + lsls r1, 6 + adds r0, r1, 0 + ands r5, r0 + cmp r5, 0 + beq _080A654C + movs r0, 0x2 + orrs r4, r0 +_080A654C: + mov r0, r9 + adds r1, r2, 0 + movs r2, 0x10 + bl sub_809971C + mov r0, r10 + adds r1, r4, 0 + bl sub_80997F4 + cmp r6, 0 + beq _080A6568 + adds r0, r6, 0 + bl sub_800AA14 +_080A6568: + movs r0, 0x1 + add r8, r0 + adds r7, 0x4 + mov r1, r8 + cmp r1, 0x1 + ble _080A64C0 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A6584: .4byte gUnknown_81178F4 +_080A6588: .4byte 0x09e60000 + thumb_func_end sub_80A64A4 + + thumb_func_start sub_80A658C +sub_80A658C: + push {r4,lr} + bl sub_800DB7C + movs r0, 0 + bl sub_8004D8C + movs r0, 0 + bl nullsub_10 + bl sub_8005180 + bl nullsub_12 + bl CopySpritesToOam + bl nullsub_13 + bl sub_8005304 + bl nullsub_14 + ldr r0, _080A65D0 + ldr r0, [r0] + bl sub_800AA14 + ldr r4, _080A65D4 + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A65D0: .4byte gUnknown_203B4B4 +_080A65D4: .4byte gUnknown_3001B7C + thumb_func_end sub_80A658C + + thumb_func_start sub_80A65D8 +sub_80A65D8: + adds r0, 0x50 + ldrh r0, [r0] + bx lr + thumb_func_end sub_80A65D8 + + thumb_func_start sub_80A65E0 +sub_80A65E0: + lsrs r0, 16 + ldr r2, _080A65EC + adds r1, r2, 0 + ands r0, r1 + bx lr + .align 2, 0 +_080A65EC: .4byte 0x0000337f + thumb_func_end sub_80A65E0 + + thumb_func_start sub_80A65F0 +sub_80A65F0: + push {r4-r6,lr} + adds r3, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, 0x50 + strh r1, [r0] + movs r0, 0x4 + ands r0, r1 + lsls r0, 16 + lsrs r0, 16 + negs r0, r0 + asrs r2, r0, 31 + movs r0, 0x40 + ands r2, r0 + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080A6616 + subs r2, 0x40 +_080A6616: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080A6624 + adds r1, r2, 0 + adds r1, 0x48 + b _080A6628 +_080A6624: + adds r1, r2, 0 + adds r1, 0x40 +_080A6628: + adds r0, r3, 0 + adds r0, 0x6A + strh r1, [r0] + adds r2, r3, 0 + adds r2, 0x50 + ldrh r1, [r2] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080A6648 + adds r1, r3, 0 + adds r1, 0x3C + ldr r0, _080A6644 + b _080A664E + .align 2, 0 +_080A6644: .4byte gUnknown_2039DC0 +_080A6648: + adds r1, r3, 0 + adds r1, 0x3C + ldr r0, _080A6680 +_080A664E: + ldm r0!, {r4-r6} + stm r1!, {r4-r6} + ldrh r1, [r2] + movs r0, 0x20 + ands r0, r1 + cmp r0, 0 + beq _080A6678 + ldrh r2, [r3, 0x3C] + ldr r1, _080A6684 + adds r0, r1, 0 + ands r0, r2 + strh r0, [r3, 0x3C] + adds r2, r3, 0 + adds r2, 0x42 + ldrh r0, [r2] + ands r1, r0 + movs r3, 0x80 + lsls r3, 3 + adds r0, r3, 0 + orrs r1, r0 + strh r1, [r2] +_080A6678: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080A6680: .4byte gUnknown_2039DB0 +_080A6684: .4byte 0x0000f3ff + thumb_func_end sub_80A65F0 + + thumb_func_start sub_80A6688 +sub_80A6688: + push {r4,lr} + adds r4, r0, 0 + adds r0, r1, 0 + bl sub_80A65E0 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_80A65F0 + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A6688 + + thumb_func_start sub_80A66A4 +sub_80A66A4: + push {lr} + movs r1, 0 + adds r0, 0x48 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + ble _080A66B4 + movs r1, 0x1 +_080A66B4: + adds r0, r1, 0 + pop {r1} + bx r1 + thumb_func_end sub_80A66A4 + + thumb_func_start sub_80A66BC +sub_80A66BC: + push {lr} + adds r0, 0x52 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _080A66CC + movs r0, 0 + b _080A66CE +_080A66CC: + movs r0, 0x1 +_080A66CE: + pop {r1} + bx r1 + thumb_func_end sub_80A66BC + + thumb_func_start sub_80A66D4 +sub_80A66D4: + push {lr} + adds r1, r0, 0 + adds r0, 0x52 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + bge _080A66F2 + adds r0, r1, 0 + adds r0, 0x48 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + ble _080A66F2 + movs r0, 0x1 + b _080A66F4 +_080A66F2: + movs r0, 0 +_080A66F4: + pop {r1} + bx r1 + thumb_func_end sub_80A66D4 + + thumb_func_start sub_80A66F8 +sub_80A66F8: + push {lr} + adds r1, r0, 0 + adds r0, 0x52 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + blt _080A6716 + ldrh r1, [r1] + movs r0, 0x80 + lsls r0, 6 + ands r0, r1 + cmp r0, 0 + bne _080A6716 + lsrs r0, r1, 15 + b _080A6718 +_080A6716: + movs r0, 0 +_080A6718: + pop {r1} + bx r1 + thumb_func_end sub_80A66F8 + + thumb_func_start sub_80A671C +sub_80A671C: + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r4, 0 + adds r6, 0x58 + movs r0, 0 + ldrsh r1, [r6, r0] + cmp r1, 0 + beq _080A6752 + movs r0, 0xE0 + lsls r0, 1 + cmp r1, r0 + beq _080A674A + ldr r0, [r4, 0x5C] + movs r5, 0x1 + negs r5, r5 + cmp r0, r5 + beq _080A674A + bl sub_800E9E4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + beq _080A674E +_080A674A: + movs r0, 0x1 + b _080A6754 +_080A674E: + str r5, [r4, 0x5C] + strh r0, [r6] +_080A6752: + movs r0, 0 +_080A6754: + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80A671C + + thumb_func_start sub_80A675C +sub_80A675C: + push {r4-r6,lr} + sub sp, 0x8 + adds r6, r1, 0 + mov r0, sp + bl sub_809D248 + lsls r0, 24 + cmp r0, 0 + beq _080A678C + ldr r1, [r6] + cmp r1, 0 + bge _080A6776 + adds r1, 0xFF +_080A6776: + asrs r1, 8 + ldr r0, [sp] + subs r4, r1, r0 + ldr r1, [r6, 0x4] + cmp r1, 0 + bge _080A6784 + adds r1, 0xFF +_080A6784: + asrs r1, 8 + ldr r0, [sp, 0x4] + subs r5, r1, r0 + b _080A67A0 +_080A678C: + ldr r0, [r6] + cmp r0, 0 + bge _080A6794 + adds r0, 0xFF +_080A6794: + asrs r4, r0, 8 + ldr r1, [r6, 0x4] + cmp r1, 0 + bge _080A679E + adds r1, 0xFF +_080A679E: + asrs r5, r1, 8 +_080A67A0: + adds r1, r4, 0 + adds r1, 0x40 + ldr r0, _080A67BC + cmp r1, r0 + bhi _080A67C0 + movs r0, 0x10 + negs r0, r0 + cmp r5, r0 + blt _080A67C0 + cmp r5, 0xCF + bgt _080A67C0 + movs r0, 0x1 + b _080A67C2 + .align 2, 0 +_080A67BC: .4byte 0x0000016f +_080A67C0: + movs r0, 0 +_080A67C2: + add sp, 0x8 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80A675C + + thumb_func_start sub_80A67CC +sub_80A67CC: + push {r4-r7,lr} + adds r4, r0, 0 + adds r5, r1, 0 + movs r7, 0 + cmp r5, 0 + beq _080A67E2 + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0 + ble _080A67E2 + movs r7, 0x1 +_080A67E2: + adds r0, r2, 0 + bl sub_80A65E0 + adds r1, r0, 0 + lsls r1, 16 + lsrs r1, 16 + adds r0, r4, 0 + bl sub_80A65F0 + movs r1, 0 + str r1, [r4, 0x74] + str r1, [r4, 0x78] + movs r6, 0x1 + negs r6, r6 + str r6, [r4, 0x7C] + adds r0, r4, 0 + adds r0, 0x70 + strb r1, [r0] + subs r0, 0x4 + strh r1, [r0] + adds r0, 0x2 + strh r1, [r0] + adds r2, r4, 0 + adds r2, 0x52 + ldr r0, _080A6884 + strh r0, [r2] + str r1, [r4, 0x54] + adds r0, r4, 0 + adds r0, 0x64 + strh r1, [r0] + adds r2, 0x14 + adds r0, r6, 0 + adds r3, r0, 0 + strh r0, [r2] + adds r0, r4, 0 + adds r0, 0x68 + strh r1, [r0] + subs r0, 0x10 + strh r1, [r0] + adds r1, r4, 0 + adds r1, 0x5A + movs r0, 0xFF + strb r0, [r1] + str r6, [r4, 0x5C] + str r6, [r4, 0x60] + cmp r7, 0 + beq _080A6888 + ldr r0, [r5] + ldr r1, [r5, 0x4] + str r0, [r4, 0x48] + str r1, [r4, 0x4C] + adds r5, r4, 0 + adds r5, 0x48 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_80A68F8 + lsls r0, 24 + cmp r0, 0 + bne _080A689A + adds r0, r4, 0 + adds r0, 0x50 + ldrh r1, [r0] + movs r0, 0x80 + lsls r0, 5 + ands r0, r1 + cmp r0, 0 + bne _080A689A + adds r0, r5, 0 + bl sub_80A6CF4 + lsls r0, 24 + cmp r0, 0 + beq _080A689A + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_80A68F8 + b _080A689A + .align 2, 0 +_080A6884: .4byte 0x0000ffff +_080A6888: + adds r1, r4, 0 + adds r1, 0x48 + ldrh r0, [r1] + orrs r0, r3 + strh r0, [r1] + adds r0, r4, 0 + adds r0, 0x4A + strh r7, [r0] + str r7, [r4, 0x4C] +_080A689A: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80A67CC + + thumb_func_start sub_80A68A0 +sub_80A68A0: + push {r4,lr} + adds r4, r0, 0 + adds r0, 0x50 + ldrh r1, [r0] + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + cmp r0, 0 + beq _080A68CE + adds r0, r4, 0 + adds r0, 0x58 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + beq _080A68CE + ldr r1, [r4, 0x5C] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080A68CE + adds r0, r1, 0 + bl sub_800DC14 +_080A68CE: + ldr r0, [r4, 0x54] + cmp r0, 0 + beq _080A68DC + bl sub_800AA14 + movs r0, 0 + str r0, [r4, 0x54] +_080A68DC: + adds r0, r4, 0 + bl sub_80A69FC + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80A68A0 + + thumb_func_start sub_80A68E8 +sub_80A68E8: + push {lr} + movs r0, 0x15 +_080A68EC: + subs r0, 0x1 + cmp r0, 0 + bge _080A68EC + pop {r0} + bx r0 + thumb_func_end sub_80A68E8 + + thumb_func_start sub_80A68F8 +sub_80A68F8: + push {r4-r7,lr} + mov r12, r0 + adds r5, r2, 0 + ldr r0, _080A6924 + ldr r4, [r0] + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, r5 + blt _080A6956 + adds r5, r0, 0 + movs r3, 0 + ldr r0, [r4] + mov r6, r12 + adds r6, 0x52 + mov r7, r12 + adds r7, 0x64 + cmp r0, 0 + bne _080A6928 + movs r2, 0x1 + cmp r2, r5 + blt _080A692A + b _080A6986 + .align 2, 0 +_080A6924: .4byte gUnknown_3001B7C +_080A6928: + movs r2, 0 +_080A692A: + adds r0, r3, 0x1 + lsls r0, 16 + asrs r3, r0, 16 + adds r4, 0xC + cmp r3, 0x15 + bgt _080A6986 + ldr r0, [r4] + cmp r0, 0 + bne _080A6928 + adds r2, 0x1 + cmp r2, r5 + blt _080A692A + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + subs r0, 0xC + subs r4, r0 + adds r0, r3, 0x1 + subs r0, r2 + lsls r0, 16 + asrs r3, r0, 16 + b _080A6986 +_080A6956: + movs r3, 0x15 + adds r4, 0xFC + ldr r0, [r4] + mov r6, r12 + adds r6, 0x52 + mov r7, r12 + adds r7, 0x64 + cmp r0, 0 + bne _080A696C + movs r2, 0x1 + b _080A6982 +_080A696C: + movs r2, 0 +_080A696E: + subs r0, r3, 0x1 + lsls r0, 16 + asrs r3, r0, 16 + subs r4, 0xC + cmp r3, 0 + blt _080A6986 + ldr r0, [r4] + cmp r0, 0 + bne _080A696C + adds r2, 0x1 +_080A6982: + cmp r2, r5 + blt _080A696E +_080A6986: + cmp r2, r5 + blt _080A69C4 + strh r3, [r6] + strh r5, [r7] + movs r0, 0x1 + str r0, [r4] + mov r0, r12 + str r0, [r4, 0x8] + ldrh r1, [r1, 0x2] + bl sub_80A6A90 + cmp r5, 0x1 + ble _080A69B2 + movs r2, 0x2 + adds r0, r4, 0 + adds r0, 0xC + subs r1, r5, 0x1 +_080A69A8: + str r2, [r0] + adds r0, 0xC + subs r1, 0x1 + cmp r1, 0 + bne _080A69A8 +_080A69B2: + ldr r1, _080A69C0 + ldr r0, [r1] + subs r0, r5 + str r0, [r1] + movs r0, 0x1 + b _080A69EC + .align 2, 0 +_080A69C0: .4byte gUnknown_2039DD4 +_080A69C4: + ldr r1, _080A69F4 + movs r0, 0 + strb r0, [r1] + movs r0, 0x1 + negs r0, r0 + mov r1, r12 + str r0, [r1, 0x7C] + mov r0, r12 + adds r0, 0x70 + movs r1, 0 + strb r1, [r0] + ldr r0, _080A69F8 + strh r0, [r6] + strh r1, [r7] + mov r0, r12 + adds r0, 0x6C + strh r1, [r0] + adds r0, 0x2 + strh r1, [r0] + movs r0, 0 +_080A69EC: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080A69F4: .4byte gUnknown_2039DD0 +_080A69F8: .4byte 0x0000ffff + thumb_func_end sub_80A68F8 + + thumb_func_start sub_80A69FC +sub_80A69FC: + push {r4-r7,lr} + adds r6, r0, 0 + adds r7, r6, 0 + adds r7, 0x52 + movs r0, 0 + ldrsh r4, [r7, r0] + ldr r0, _080A6A80 + lsls r1, r4, 1 + adds r1, r4 + lsls r1, 2 + ldr r0, [r0] + adds r5, r0, r1 + cmp r4, 0 + blt _080A6A7A + adds r0, r6, 0 + bl sub_80A6C88 + movs r0, 0 + str r0, [r5, 0x8] + str r0, [r5] + adds r5, 0xC + ldr r1, _080A6A84 + ldr r0, [r1] + adds r0, 0x1 + str r0, [r1] + adds r0, r4, 0x1 + lsls r0, 16 + asrs r4, r0, 16 + adds r6, 0x64 + mov r12, r6 + cmp r4, 0x15 + bgt _080A6A6A + ldr r0, [r5] + cmp r0, 0x2 + bne _080A6A6A + movs r6, 0 + adds r2, r1, 0 + lsls r1, r4, 16 + movs r0, 0x80 + lsls r0, 9 + adds r1, r0 + adds r3, r0, 0 +_080A6A50: + str r6, [r5] + adds r5, 0xC + ldr r0, [r2] + adds r0, 0x1 + str r0, [r2] + adds r0, r1, 0 + adds r1, r3 + asrs r4, r0, 16 + cmp r4, 0x15 + bgt _080A6A6A + ldr r0, [r5] + cmp r0, 0x2 + beq _080A6A50 +_080A6A6A: + ldr r0, _080A6A88 + strh r0, [r7] + movs r0, 0 + mov r1, r12 + strh r0, [r1] + ldr r1, _080A6A8C + movs r0, 0x1 + strb r0, [r1] +_080A6A7A: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A6A80: .4byte gUnknown_3001B7C +_080A6A84: .4byte gUnknown_2039DD4 +_080A6A88: .4byte 0x0000ffff +_080A6A8C: .4byte gUnknown_2039DD0 + thumb_func_end sub_80A69FC + + thumb_func_start sub_80A6A90 +sub_80A6A90: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + mov r10, r0 + lsls r1, 16 + lsrs r2, r1, 16 + adds r5, r2, 0 + movs r0, 0xC0 + lsls r0, 2 + ands r0, r2 + cmp r0, 0 + bne _080A6AB0 + b _080A6C6C +_080A6AB0: + movs r0, 0x80 + lsls r0, 3 + ands r0, r2 + cmp r0, 0 + beq _080A6AD8 + ldr r0, _080A6AD4 + ldr r1, [r0] + movs r3, 0x86 + lsls r3, 1 + adds r4, r1, r3 + ldrh r1, [r4] + adds r3, r0, 0 + cmp r1, r2 + bne _080A6B36 + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + b _080A6C78 + .align 2, 0 +_080A6AD4: .4byte gUnknown_3001B7C +_080A6AD8: + movs r0, 0 + mov r8, r0 + ldr r1, _080A6B1C + ldr r0, [r1] + movs r2, 0x84 + lsls r2, 1 + adds r4, r0, r2 + adds r3, r1, 0 + movs r1, 0xE8 + lsls r1, 13 +_080A6AEC: + ldrh r0, [r4] + cmp r0, r5 + bne _080A6B24 + lsrs r1, 16 + adds r3, r1, 0 + ldrh r0, [r4, 0x2] + adds r0, 0x1 + strh r0, [r4, 0x2] + mov r0, r10 + cmp r0, 0 + beq _080A6B08 + subs r1, 0x10 + adds r0, 0x68 + strh r1, [r0] +_080A6B08: + adds r0, r3, 0 + subs r0, 0x10 + str r0, [sp] + str r5, [sp, 0x4] + movs r0, 0 + ldr r1, _080A6B20 + mov r2, r8 + bl Log + b _080A6C78 + .align 2, 0 +_080A6B1C: .4byte gUnknown_3001B7C +_080A6B20: .4byte gUnknown_81177F4 +_080A6B24: + movs r2, 0x80 + lsls r2, 9 + adds r1, r2 + movs r0, 0x1 + add r8, r0 + adds r4, 0x4 + mov r2, r8 + cmp r2, 0x1 + ble _080A6AEC +_080A6B36: + movs r0, 0x80 + lsls r0, 3 + ands r0, r5 + cmp r0, 0 + beq _080A6B68 + movs r0, 0x1 + mov r8, r0 + ldr r0, [r3] + movs r1, 0x86 + lsls r1, 1 + adds r4, r0, r1 + movs r2, 0x2 + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _080A6BA8 + ldr r0, _080A6B60 + ldr r1, _080A6B64 + adds r2, r5, 0 + bl FatalError + .align 2, 0 +_080A6B60: .4byte gUnknown_8117858 +_080A6B64: .4byte gUnknown_8117864 +_080A6B68: + movs r0, 0 + mov r8, r0 + ldr r0, [r3] + movs r1, 0x84 + lsls r1, 1 + adds r4, r0, r1 + movs r2, 0x2 + ldrsh r0, [r4, r2] + cmp r0, 0 + ble _080A6B90 +_080A6B7C: + movs r3, 0x1 + add r8, r3 + adds r4, 0x4 + mov r0, r8 + cmp r0, 0x1 + bgt _080A6B96 + movs r1, 0x2 + ldrsh r0, [r4, r1] + cmp r0, 0 + bgt _080A6B7C +_080A6B90: + mov r2, r8 + cmp r2, 0x1 + ble _080A6BA8 +_080A6B96: + ldr r0, _080A6BA0 + ldr r1, _080A6BA4 + adds r2, r5, 0 + bl FatalError + .align 2, 0 +_080A6BA0: .4byte gUnknown_8117888 +_080A6BA4: .4byte gUnknown_8117864 +_080A6BA8: + mov r0, r8 + adds r0, 0x1D + lsls r0, 16 + lsrs r0, 16 + str r0, [sp, 0xC] + mov r3, r8 + lsls r0, r3, 20 + movs r1, 0xE8 + lsls r1, 17 + adds r0, r1 + lsrs r0, 16 + str r0, [sp, 0x10] + movs r0, 0x80 + lsls r0, 2 + ands r0, r5 + cmp r0, 0 + beq _080A6BE8 + ldr r0, _080A6BE0 + ldr r1, _080A6BE4 + bl sub_800A9EC + mov r9, r0 + ldr r7, [r0, 0x4] + movs r0, 0xFF + ands r0, r5 + lsls r0, 6 + adds r7, r0 + b _080A6BFE + .align 2, 0 +_080A6BE0: .4byte gUnknown_81177EC +_080A6BE4: .4byte gUnknown_8510000 +_080A6BE8: + movs r0, 0xFF + ands r0, r5 + lsls r0, 2 + ldr r1, _080A6C60 + adds r0, r1 + ldr r0, [r0] + ldr r1, _080A6C64 + bl sub_800A9EC + mov r9, r0 + ldr r7, [r0, 0x4] +_080A6BFE: + movs r0, 0x80 + lsls r0, 5 + ands r0, r5 + lsls r0, 16 + lsrs r0, 16 + negs r0, r0 + lsrs r6, r0, 31 + movs r0, 0x80 + lsls r0, 6 + ands r0, r5 + cmp r0, 0 + beq _080A6C1A + movs r0, 0x2 + orrs r6, r0 +_080A6C1A: + ldr r0, [sp, 0xC] + adds r1, r6, 0 + bl sub_80997F4 + ldr r0, [sp, 0x10] + adds r1, r7, 0 + movs r2, 0x10 + bl sub_809971C + strh r5, [r4] + movs r0, 0x1 + strh r0, [r4, 0x2] + ldr r2, [sp, 0xC] + subs r2, 0x10 + mov r3, r10 + cmp r3, 0 + beq _080A6C42 + mov r0, r10 + adds r0, 0x68 + strh r2, [r0] +_080A6C42: + ldr r1, _080A6C68 + str r2, [sp] + str r5, [sp, 0x4] + str r6, [sp, 0x8] + movs r0, 0 + mov r2, r8 + ldr r3, [sp, 0xC] + bl Log + mov r0, r9 + cmp r0, 0 + beq _080A6C78 + bl sub_800AA14 + b _080A6C78 + .align 2, 0 +_080A6C60: .4byte gUnknown_81178F4 +_080A6C64: .4byte 0x09e60000 +_080A6C68: .4byte gUnknown_8117894 +_080A6C6C: + mov r1, r10 + cmp r1, 0 + beq _080A6C78 + mov r0, r10 + adds r0, 0x68 + strh r5, [r0] +_080A6C78: + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80A6A90 + + thumb_func_start sub_80A6C88 +sub_80A6C88: + push {r4-r6,lr} + adds r2, r0, 0 + cmp r2, 0 + beq _080A6C9E + adds r0, 0x68 + ldrh r0, [r0] + adds r5, r0, 0 + subs r5, 0xD + cmp r5, 0 + blt _080A6CE6 + b _080A6CA0 +_080A6C9E: + movs r5, 0x1 +_080A6CA0: + ldr r0, _080A6CEC + lsls r1, r5, 2 + movs r3, 0x84 + lsls r3, 1 + adds r1, r3 + ldr r0, [r0] + adds r4, r0, r1 + cmp r2, 0 + beq _080A6CBA + adds r1, r2, 0 + adds r1, 0x68 + movs r0, 0 + strh r0, [r1] +_080A6CBA: + ldrh r0, [r4, 0x2] + subs r0, 0x1 + movs r6, 0 + strh r0, [r4, 0x2] + lsls r0, 16 + cmp r0, 0 + bgt _080A6CE6 + ldr r1, _080A6CF0 + ldrh r3, [r4] + movs r0, 0 + adds r2, r5, 0 + bl Log + strh r6, [r4] + strh r6, [r4, 0x2] + adds r0, r5, 0 + adds r0, 0x1D + lsls r0, 16 + lsrs r0, 16 + movs r1, 0 + bl sub_80997F4 +_080A6CE6: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080A6CEC: .4byte gUnknown_3001B7C +_080A6CF0: .4byte gUnknown_81178C0 + thumb_func_end sub_80A6C88 + + thumb_func_start sub_80A6CF4 +sub_80A6CF4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x68 + movs r1, 0 + mov r8, r1 + movs r1, 0 + ldrsh r2, [r0, r1] + mov r9, r2 + movs r2, 0 + mov r10, r2 + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x60] + str r0, [sp, 0x64] + add r4, sp, 0x58 + adds r0, r4, 0 + bl sub_809D248 + movs r7, 0 + ldr r0, _080A6D70 + ldr r3, [r0] + movs r1, 0x80 + lsls r1, 6 + mov r12, r1 + mov r4, sp +_080A6D2C: + ldr r0, [r3] + cmp r0, 0x1 + bne _080A6DB4 + ldr r2, [r3, 0x8] + adds r0, r2, 0 + adds r0, 0x50 + ldrh r1, [r0] + mov r0, r12 + ands r0, r1 + cmp r0, 0 + bne _080A6DB4 + ldr r0, [r2, 0x7C] + cmp r0, 0 + blt _080A6DB4 + ldr r1, [r2, 0x74] + cmp r1, 0 + bge _080A6D50 + adds r1, 0xFF +_080A6D50: + asrs r1, 8 + ldr r0, [sp, 0x58] + subs r5, r1, r0 + ldr r1, [r2, 0x78] + cmp r1, 0 + bge _080A6D5E + adds r1, 0xFF +_080A6D5E: + asrs r1, 8 + ldr r0, [sp, 0x5C] + subs r1, r0 + adds r6, r1, 0 + cmp r1, 0 + ble _080A6D74 + adds r0, r6, 0 + adds r0, 0x28 + b _080A6D78 + .align 2, 0 +_080A6D70: .4byte gUnknown_3001B7C +_080A6D74: + movs r0, 0x28 + subs r0, r6 +_080A6D78: + str r0, [r2, 0x7C] + cmp r5, 0 + ble _080A6D88 + ldr r0, [r2, 0x7C] + cmp r5, r0 + ble _080A6D92 + str r5, [r2, 0x7C] + b _080A6D92 +_080A6D88: + negs r1, r5 + ldr r0, [r2, 0x7C] + cmp r1, r0 + ble _080A6D92 + str r1, [r2, 0x7C] +_080A6D92: + adds r0, r2, 0 + adds r0, 0x48 + movs r1, 0 + ldrsh r0, [r0, r1] + add r10, r0 + cmp r0, r9 + blt _080A6DAE + ldr r0, [r2, 0x7C] + ldr r1, [sp, 0x64] + cmp r1, r0 + bge _080A6DAE + mov r1, r8 + str r1, [sp, 0x60] + str r0, [sp, 0x64] +_080A6DAE: + stm r4!, {r2} + movs r2, 0x1 + add r8, r2 +_080A6DB4: + adds r0, r7, 0x1 + lsls r0, 16 + asrs r7, r0, 16 + adds r3, 0xC + cmp r7, 0x15 + ble _080A6D2C + cmp r10, r9 + blt _080A6E54 + ldr r0, [sp, 0x60] + cmp r0, 0 + blt _080A6DD8 + lsls r0, 2 + add r0, sp + ldr r0, [r0] + bl sub_80A69FC + movs r0, 0x1 + b _080A6E56 +_080A6DD8: + mov r1, r8 + cmp r1, 0 + ble _080A6E54 +_080A6DDE: + movs r5, 0x1 + negs r5, r5 + adds r3, r5, 0 + movs r6, 0 + mov r7, r8 + subs r7, 0x1 + mov r2, r8 + cmp r2, 0 + ble _080A6E08 + mov r2, sp + mov r1, r8 +_080A6DF4: + ldr r0, [r2] + ldr r0, [r0, 0x7C] + cmp r3, r0 + bge _080A6E00 + mov r5, r8 + adds r3, r0, 0 +_080A6E00: + adds r2, 0x4 + subs r1, 0x1 + cmp r1, 0 + bne _080A6DF4 +_080A6E08: + lsls r0, r5, 2 + mov r1, sp + adds r4, r1, r0 + ldr r0, [r4] + bl sub_80A69FC + mov r8, r7 + adds r1, r5, 0 + cmp r1, r8 + bge _080A6E28 + adds r2, r4, 0 +_080A6E1E: + ldr r0, [r2, 0x4] + stm r2!, {r0} + adds r1, 0x1 + cmp r1, r8 + blt _080A6E1E +_080A6E28: + movs r1, 0 + ldr r0, _080A6E40 + ldr r3, [r0] +_080A6E2E: + ldr r0, [r3] + cmp r0, 0 + bne _080A6E44 + adds r6, 0x1 + cmp r6, r9 + blt _080A6E46 + movs r0, 0x1 + b _080A6E56 + .align 2, 0 +_080A6E40: .4byte gUnknown_3001B7C +_080A6E44: + movs r6, 0 +_080A6E46: + adds r1, 0x1 + adds r3, 0xC + cmp r1, 0x15 + ble _080A6E2E + mov r2, r8 + cmp r2, 0 + bgt _080A6DDE +_080A6E54: + movs r0, 0 +_080A6E56: + add sp, 0x68 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80A6CF4 + + thumb_func_start sub_80A6E68 +sub_80A6E68: + push {lr} + movs r0, 0 + bl sub_8004D8C + movs r0, 0 + bl nullsub_10 + bl sub_800E970 + pop {r0} + bx r0 + thumb_func_end sub_80A6E68 + + thumb_func_start sub_80A6E80 +sub_80A6E80: + push {r4,lr} + sub sp, 0x4 + ldr r4, _080A6EC4 + adds r0, r4, 0 + bl sub_809D248 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _080A6E98 + str r0, [r4] + str r0, [r4, 0x4] +_080A6E98: + bl sub_80ABA7C + bl sub_80ACAD4 + bl sub_80AD7AC + ldrh r1, [r4, 0x4] + lsls r1, 16 + ldrh r0, [r4] + orrs r0, r1 + str r0, [sp] + mov r0, sp + bl sub_800E90C + bl sub_8005180 + bl nullsub_12 + add sp, 0x4 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A6EC4: .4byte gUnknown_2039DD8 + thumb_func_end sub_80A6E80 + + thumb_func_start sub_80A6EC8 +sub_80A6EC8: + push {lr} + adds r2, r0, 0 + adds r0, 0x52 + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r0, 0 + ble _080A6EF6 + adds r0, r2, 0 + adds r0, 0x48 + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r1, r0 + bgt _080A6EE4 + adds r1, r0, 0 +_080A6EE4: + adds r0, r2, 0 + adds r0, 0x64 + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r0, r1 + beq _080A6EF6 + adds r0, r2, 0 + adds r0, 0x66 + strh r1, [r0] +_080A6EF6: + pop {r0} + bx r0 + thumb_func_end sub_80A6EC8 + + thumb_func_start sub_80A6EFC +sub_80A6EFC: + push {r4-r7,lr} + sub sp, 0xC + adds r4, r0, 0 + lsls r1, 16 + asrs r7, r1, 16 + lsls r2, 24 + asrs r6, r2, 24 + adds r0, 0x52 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + bge _080A6F48 + adds r5, r4, 0 + adds r5, 0x66 + movs r2, 0 + ldrsh r0, [r5, r2] + cmp r0, 0 + blt _080A6F28 + adds r1, r4, 0 + adds r1, 0x48 + adds r2, r0, 0 + b _080A6F62 +_080A6F28: + adds r1, r4, 0 + adds r1, 0x48 + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0 + bgt _080A6F36 + b _080A7038 +_080A6F36: + movs r2, 0x1 + negs r2, r2 + adds r0, r4, 0 + bl sub_80A68F8 + lsls r0, 24 + cmp r0, 0 + beq _080A7038 + b _080A6F72 +_080A6F48: + adds r5, r4, 0 + adds r5, 0x66 + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0 + blt _080A6F72 + adds r0, r4, 0 + bl sub_80A69FC + adds r1, r4, 0 + adds r1, 0x48 + movs r0, 0 + ldrsh r2, [r5, r0] +_080A6F62: + adds r0, r4, 0 + bl sub_80A68F8 + lsls r0, 24 + cmp r0, 0 + beq _080A7038 + ldr r0, _080A6F8C + strh r0, [r5] +_080A6F72: + movs r0, 0x80 + lsls r0, 3 + ands r0, r7 + lsls r0, 16 + asrs r3, r0, 16 + cmp r3, 0 + beq _080A6F94 + ldrh r1, [r4] + ldr r0, _080A6F90 + ands r0, r1 + strh r0, [r4] + b _080A7038 + .align 2, 0 +_080A6F8C: .4byte 0x0000ffff +_080A6F90: .4byte 0x0000efff +_080A6F94: + ldr r2, _080A6FE0 + adds r0, r4, 0 + adds r0, 0x52 + movs r5, 0 + ldrsh r1, [r0, r5] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, [r2] + adds r1, r0 + mov r12, r1 + adds r1, r4, 0 + adds r1, 0x70 + movs r0, 0x1 + strb r0, [r1] + subs r0, 0x2 + str r0, [r4, 0x7C] + movs r1, 0xE0 + lsls r1, 3 + ands r1, r7 + movs r0, 0x80 + lsls r0, 1 + cmp r1, r0 + beq _080A6FE4 + cmp r1, r0 + ble _080A6FEE + movs r0, 0x80 + lsls r0, 2 + cmp r1, r0 + beq _080A6FFA + movs r0, 0xC0 + lsls r0, 2 + cmp r1, r0 + bne _080A6FEE + adds r0, r4, 0 + adds r0, 0x6C + strh r3, [r0] + b _080A7000 + .align 2, 0 +_080A6FE0: .4byte gUnknown_3001B7C +_080A6FE4: + adds r1, r4, 0 + adds r1, 0x6C + movs r0, 0x80 + strh r0, [r1] + b _080A7000 +_080A6FEE: + adds r1, r4, 0 + adds r1, 0x6C + movs r0, 0x80 + lsls r0, 1 + strh r0, [r1] + b _080A7000 +_080A6FFA: + adds r0, r4, 0 + adds r0, 0x6C + strh r1, [r0] +_080A7000: + adds r0, r4, 0 + adds r0, 0x6E + movs r1, 0 + strh r1, [r0] + ldr r5, [r4, 0x4C] + movs r0, 0xFF + ands r0, r7 + adds r2, r6, 0 + cmp r6, 0 + bge _080A7016 + adds r2, r6, 0x7 +_080A7016: + asrs r2, 3 + adds r2, r0, r2 + movs r3, 0x7 + ands r3, r6 + mov r6, r12 + ldr r0, [r6, 0x4] + str r0, [sp] + str r1, [sp, 0x4] + lsls r0, r7, 16 + lsrs r0, 27 + movs r1, 0x1 + ands r0, r1 + str r0, [sp, 0x8] + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80053D0 +_080A7038: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80A6EFC + + thumb_func_start sub_80A7040 +sub_80A7040: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r3, 0 + lsls r1, 16 + asrs r3, r1, 16 + lsls r2, 24 + asrs r2, 24 + adds r0, 0x50 + ldrh r1, [r0] + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + cmp r0, 0 + beq _080A708C + cmp r3, 0 + beq _080A7068 + movs r0, 0xE0 + lsls r0, 1 + cmp r3, r0 + bne _080A7080 +_080A7068: + adds r0, r4, 0 + bl sub_80A671C + lsls r0, 24 + cmp r0, 0 + beq _080A708C + adds r1, r4, 0 + adds r1, 0x58 + movs r0, 0xE0 + lsls r0, 1 + strh r0, [r1] + b _080A708C +_080A7080: + adds r0, r4, 0 + adds r0, 0x58 + strh r3, [r0] + adds r0, 0x2 + strb r2, [r0] + str r5, [r4, 0x60] +_080A708C: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80A7040 + + thumb_func_start sub_80A7094 +sub_80A7094: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x40 + adds r7, r0, 0 + mov r10, r1 + mov r8, r2 + str r3, [sp, 0x3C] + ldr r0, [r2] + ldr r1, [r2, 0x4] + str r0, [r7, 0x74] + str r1, [r7, 0x78] + movs r6, 0 + str r6, [r7, 0x7C] + adds r0, r7, 0 + adds r0, 0x50 + ldrh r1, [r0] + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + cmp r0, 0 + beq _080A7172 + adds r4, r7, 0 + adds r4, 0x58 + movs r0, 0 + ldrsh r1, [r4, r0] + cmp r1, 0 + beq _080A7172 + movs r0, 0xE0 + lsls r0, 1 + cmp r1, r0 + bne _080A70EC + ldr r0, [r7, 0x5C] + movs r5, 0x1 + negs r5, r5 + cmp r0, r5 + beq _080A70E8 + bl sub_800DC14 + str r5, [r7, 0x5C] +_080A70E8: + strh r6, [r4] + b _080A7172 +_080A70EC: + ldr r0, [r7, 0x5C] + movs r1, 0x1 + negs r1, r1 + mov r9, r1 + cmp r0, r9 + bne _080A7160 + add r1, sp, 0x8 + ldr r0, _080A715C + ldm r0!, {r2,r3,r5} + stm r1!, {r2,r3,r5} + movs r1, 0 + ldrsh r0, [r4, r1] + bl sub_800EE5C + bl sub_800EF64 + add r2, sp, 0x14 + movs r3, 0 + ldrsh r0, [r4, r3] + str r0, [sp, 0x14] + str r6, [r2, 0x4] + adds r0, r7, 0 + adds r0, 0x5A + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + str r0, [r2, 0x8] + mov r4, r8 + ldr r0, [r4] + cmp r0, 0 + bge _080A712C + adds r0, 0xFF +_080A712C: + asrs r0, 8 + strh r0, [r2, 0xC] + mov r5, r8 + ldr r0, [r5, 0x4] + cmp r0, 0 + bge _080A713A + adds r0, 0xFF +_080A713A: + asrs r0, 8 + strh r0, [r2, 0xE] + strh r6, [r2, 0x10] + strh r6, [r2, 0x12] + mov r0, r9 + str r0, [r2, 0x14] + str r6, [r2, 0x18] + add r1, sp, 0x30 + add r0, sp, 0x8 + ldm r0!, {r3-r5} + stm r1!, {r3-r5} + adds r0, r2, 0 + bl sub_800E890 + str r0, [r7, 0x5C] + b _080A7172 + .align 2, 0 +_080A715C: .4byte gUnknown_81178E0 +_080A7160: + bl sub_800E9E4 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _080A7172 + mov r1, r9 + str r1, [r7, 0x5C] + strh r0, [r4] +_080A7172: + adds r0, r7, 0 + adds r0, 0x52 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + blt _080A7222 + adds r0, r7, 0 + adds r0, 0x50 + ldrh r4, [r0] + movs r0, 0x40 + ands r0, r4 + lsls r0, 16 + lsrs r0, 16 + mov r9, r0 + cmp r0, 0 + bne _080A7222 + mov r3, r8 + ldr r1, [r3] + cmp r1, 0 + bge _080A719C + adds r1, 0xFF +_080A719C: + asrs r1, 8 + ldr r2, _080A7228 + ldr r0, [r2] + subs r5, r1, r0 + mov r1, r8 + ldr r0, [r1, 0x4] + cmp r0, 0 + bge _080A71AE + adds r0, 0xFF +_080A71AE: + asrs r1, r0, 8 + ldr r0, [r2, 0x4] + subs r6, r1, r0 + ldr r3, [sp, 0x3C] + cmp r3, 0 + bge _080A71BC + adds r3, 0xFF +_080A71BC: + asrs r0, r3, 8 + subs r0, r6, r0 + mov r8, r0 + adds r1, r5, 0 + adds r1, 0x40 + ldr r0, _080A722C + cmp r1, r0 + bhi _080A7274 + movs r0, 0x10 + negs r0, r0 + cmp r6, r0 + blt _080A7274 + cmp r6, 0xCF + bgt _080A7274 + cmp r8, r0 + blt _080A7274 + mov r2, r8 + cmp r2, 0xCF + bgt _080A7274 + movs r0, 0x10 + ands r0, r4 + cmp r0, 0 + beq _080A7234 + ldr r0, _080A7230 + ldrh r1, [r0] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080A7234 + adds r0, r7, 0 + movs r1, 0 + bl sub_80A72B8 + movs r1, 0x98 + lsls r1, 1 + adds r0, r7, 0 + adds r0, 0x68 + ldrh r0, [r0] + str r0, [sp] + adds r0, r7, 0 + adds r0, 0x3C + str r0, [sp, 0x4] + adds r0, r7, 0 + movs r2, 0xD0 + movs r3, 0 + bl sub_800558C + adds r0, r7, 0 + adds r0, 0x70 + mov r3, r9 + strb r3, [r0] +_080A7222: + movs r0, 0 + b _080A72A6 + .align 2, 0 +_080A7228: .4byte gUnknown_2039DD8 +_080A722C: .4byte 0x0000016f +_080A7230: .4byte gUnknown_2039DCC +_080A7234: + adds r4, r7, 0 + adds r4, 0x70 + ldrb r1, [r4] + adds r0, r7, 0 + bl sub_80A72B8 + adds r0, r7, 0 + adds r0, 0x6A + movs r1, 0 + ldrsh r3, [r0, r1] + adds r3, r6 + subs r0, 0x2 + ldrh r0, [r0] + str r0, [sp] + adds r0, r7, 0 + adds r0, 0x3C + str r0, [sp, 0x4] + adds r0, r7, 0 + adds r1, r5, 0 + mov r2, r8 + bl sub_800558C + movs r0, 0 + strb r0, [r4] + mov r2, r10 + cmp r2, 0 + beq _080A7270 + mov r3, r10 + str r5, [r3] + str r6, [r3, 0x4] +_080A7270: + movs r0, 0x1 + b _080A72A6 +_080A7274: + adds r4, r7, 0 + adds r4, 0x70 + ldrb r0, [r4] + cmp r0, 0 + beq _080A7222 + adds r0, r7, 0 + movs r1, 0x1 + bl sub_80A72B8 + movs r1, 0x98 + lsls r1, 1 + adds r0, r7, 0 + adds r0, 0x68 + ldrh r0, [r0] + str r0, [sp] + adds r0, r7, 0 + adds r0, 0x3C + str r0, [sp, 0x4] + adds r0, r7, 0 + movs r2, 0xD0 + movs r3, 0 + bl sub_800558C + movs r0, 0 + strb r0, [r4] +_080A72A6: + add sp, 0x40 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80A7094 + + thumb_func_start sub_80A72B8 +sub_80A72B8: + push {r4-r7,lr} + adds r6, r0, 0 + lsls r1, 24 + cmp r1, 0 + beq _080A72D2 + adds r1, r6, 0 + adds r1, 0x6E + movs r0, 0 + strh r0, [r1] + adds r0, r6, 0 + bl sub_80054BC + b _080A7304 +_080A72D2: + adds r5, r6, 0 + adds r5, 0x6E + adds r0, r6, 0 + adds r0, 0x6C + ldrh r0, [r0] + ldrh r1, [r5] + adds r0, r1 + strh r0, [r5] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xFF + ble _080A7304 + ldr r0, _080A730C + adds r7, r0, 0 +_080A72EE: + adds r4, r5, 0 + ldrh r1, [r5] + adds r0, r7, r1 + strh r0, [r5] + adds r0, r6, 0 + bl sub_80054BC + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0xFF + bgt _080A72EE +_080A7304: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A730C: .4byte 0xffffff00 + thumb_func_end sub_80A72B8 + + thumb_func_start sub_80A7310 +sub_80A7310: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + mov r12, r0 + adds r4, r1, 0 + adds r5, r2, 0 + adds r0, 0x50 + ldrh r1, [r0] + movs r0, 0x80 + lsls r0, 2 + ands r0, r1 + cmp r0, 0 + beq _080A73DC + mov r0, r12 + ldr r0, [r0, 0x5C] + mov r8, r0 + movs r0, 0x1 + negs r0, r0 + cmp r8, r0 + beq _080A73DC + ldr r0, [r4] + cmp r0, 0 + bge _080A7344 + adds r0, 0xFF +_080A7344: + lsls r0, 8 + lsrs r0, 16 + ldr r1, _080A73D0 + mov r9, r1 + ldr r2, [sp, 0x4] + ands r2, r1 + orrs r2, r0 + str r2, [sp, 0x4] + ldr r0, [r4, 0x4] + cmp r0, 0 + bge _080A735C + adds r0, 0xFF +_080A735C: + lsls r0, 8 + lsrs r0, 16 + lsls r0, 16 + ldr r6, _080A73D4 + adds r4, r6, 0 + ands r4, r2 + orrs r4, r0 + str r4, [sp, 0x4] + asrs r2, r4, 16 + ldr r0, _080A73D8 + ldr r0, [r0, 0x4] + subs r0, r2, r0 + mov r1, r12 + adds r1, 0x6A + movs r7, 0 + ldrsh r1, [r1, r7] + adds r0, r1 + adds r7, r0, 0x2 + cmp r3, 0 + bge _080A7386 + adds r3, 0xFF +_080A7386: + asrs r0, r3, 8 + subs r0, r2, r0 + lsls r0, 16 + adds r2, r6, 0 + ands r2, r4 + orrs r2, r0 + str r2, [sp, 0x4] + cmp r5, 0 + beq _080A73B8 + ldr r1, [r5] + add r0, sp, 0x4 + ldrh r0, [r0] + adds r1, r0 + lsls r1, 16 + lsrs r1, 16 + mov r0, r9 + ands r0, r2 + orrs r0, r1 + asrs r2, r0, 16 + ldr r1, [r5, 0x4] + adds r1, r2 + lsls r1, 16 + ands r0, r6 + orrs r0, r1 + str r0, [sp, 0x4] +_080A73B8: + mov r0, r12 + adds r0, 0x3C + str r0, [sp] + mov r0, r8 + add r1, sp, 0x4 + movs r2, 0 + adds r3, r7, 0 + bl sub_800E8AC + movs r0, 0x1 + b _080A73DE + .align 2, 0 +_080A73D0: .4byte 0xffff0000 +_080A73D4: .4byte 0x0000ffff +_080A73D8: .4byte gUnknown_2039DD8 +_080A73DC: + movs r0, 0 +_080A73DE: + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80A7310 + + thumb_func_start sub_80A73EC +sub_80A73EC: + push {lr} + bl CopySpritesToOam + bl nullsub_13 + bl sub_8005304 + bl nullsub_14 + ldr r1, _080A7420 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + ldr r1, _080A7424 + ldrh r0, [r1] + adds r0, 0x1 + strh r0, [r1] + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xB + bls _080A741A + movs r0, 0 + strh r0, [r1] +_080A741A: + pop {r0} + bx r0 + .align 2, 0 +_080A7420: .4byte gUnknown_2039DCC +_080A7424: .4byte gUnknown_2039DCE + thumb_func_end sub_80A73EC + + thumb_func_start sub_80A7428 +sub_80A7428: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x14 + adds r6, r0, 0 + mov r8, r3 + lsls r1, 16 + asrs r7, r1, 16 + lsls r2, 16 + asrs r2, 16 + adds r4, r2, 0 + ldr r1, _080A7480 + mov r0, sp + bl sprintf + ldr r1, _080A7484 + mov r0, sp + bl sub_800A908 + adds r5, r0, 0 + movs r1, 0 + bl sub_800A9D8 + adds r0, r4, 0 + bl sub_808DACC + lsls r0, 24 + lsrs r0, 24 + ldr r1, _080A7488 + ldr r2, [sp, 0xC] + ands r2, r1 + orrs r2, r0 + str r2, [sp, 0xC] + movs r0, 0xD3 + lsls r0, 1 + cmp r4, r0 + bne _080A7490 + ldr r0, _080A748C + ands r0, r2 + movs r1, 0x91 + lsls r1, 17 + orrs r0, r1 + str r0, [sp, 0xC] + b _080A74AC + .align 2, 0 +_080A7480: .4byte gUnknown_8117EDC +_080A7484: .4byte gUnknown_8510000 +_080A7488: .4byte 0xffff0000 +_080A748C: .4byte 0x0000ffff +_080A7490: + movs r1, 0 + cmp r7, 0x47 + bne _080A7498 + movs r1, 0x1 +_080A7498: + adds r0, r4, 0 + bl sub_808DD68 + lsls r0, 24 + lsrs r0, 8 + ldr r2, _080A74E0 + ldr r1, [sp, 0xC] + ands r1, r2 + orrs r1, r0 + str r1, [sp, 0xC] +_080A74AC: + ldr r0, [r5, 0x4] + add r1, sp, 0xC + str r0, [r1, 0x4] + adds r0, r6, 0 + mov r2, r8 + bl sub_80A67CC + str r5, [r6, 0x54] + adds r0, r6, 0 + adds r0, 0x52 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + blt _080A74D4 + movs r1, 0xC0 + lsls r1, 2 + adds r0, r6, 0 + movs r2, 0 + bl sub_80A6EFC +_080A74D4: + add sp, 0x14 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A74E0: .4byte 0x0000ffff + thumb_func_end sub_80A7428 + + thumb_func_start sub_80A74E4 +sub_80A74E4: + push {lr} + bl sub_80A68A0 + pop {r0} + bx r0 + thumb_func_end sub_80A74E4 + + thumb_func_start sub_80A74F0 +sub_80A74F0: + push {r4-r6,lr} + adds r6, r0, 0 + lsls r1, 16 + asrs r4, r1, 16 + lsls r2, 24 + asrs r5, r2, 24 + cmp r3, 0 + bge _080A7514 + movs r0, 0xE0 + lsls r0, 1 + cmp r4, r0 + beq _080A7512 + adds r0, r4, 0 + bl sub_800E700 + adds r3, r0, 0 + b _080A7514 +_080A7512: + movs r3, 0 +_080A7514: + adds r0, r6, 0 + adds r1, r4, 0 + adds r2, r5, 0 + bl sub_80A7040 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80A74F0 + + thumb_func_start sub_80A7524 +sub_80A7524: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x18 + adds r5, r0, 0 + adds r6, r2, 0 + adds r7, r3, 0 + lsls r1, 16 + asrs r1, 16 + mov r8, r1 + mov r1, sp + bl sub_80A7094 + lsls r0, 24 + cmp r0, 0 + beq _080A75C0 + ldr r1, [r5, 0x5C] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080A758C + ldr r2, [r5, 0x60] + cmp r2, 0x3 + bgt _080A7580 + cmp r2, 0 + blt _080A7580 + add r4, sp, 0x8 + lsls r2, 24 + lsrs r2, 24 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_800569C + movs r1, 0 + ldrsh r0, [r4, r1] + str r0, [sp, 0xC] + movs r1, 0x2 + ldrsh r0, [r4, r1] + add r2, sp, 0xC + str r0, [r2, 0x4] + adds r0, r5, 0 + adds r1, r6, 0 + adds r3, r7, 0 + bl sub_80A7310 + b _080A758C +_080A7580: + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + adds r3, r7, 0 + bl sub_80A7310 +_080A758C: + adds r0, r5, 0 + adds r0, 0x50 + ldrh r1, [r0] + movs r0, 0x80 + lsls r0, 1 + ands r0, r1 + cmp r0, 0 + beq _080A75B4 + ldr r0, [sp] + lsls r0, 16 + ldr r1, [sp, 0x4] + lsls r1, 16 + lsrs r0, 16 + orrs r0, r1 + str r0, [sp, 0x14] + add r1, sp, 0x14 + mov r0, r8 + adds r2, r5, 0 + bl sub_808E668 +_080A75B4: + adds r0, r5, 0 + adds r1, r6, 0 + movs r2, 0 + adds r3, r7, 0 + bl sub_80A7310 +_080A75C0: + add sp, 0x18 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80A7524 + + thumb_func_start sub_80A75CC +sub_80A75CC: + push {r4-r6,lr} + sub sp, 0x8 + adds r4, r0, 0 + adds r6, r3, 0 + lsls r2, 16 + asrs r2, 13 + ldr r0, _080A7618 + adds r2, r0 + movs r5, 0 + movs r0, 0 + ldrsb r0, [r2, r0] + lsls r0, 16 + lsrs r0, 16 + ldr r3, _080A761C + ldr r1, [sp] + ands r1, r3 + orrs r1, r0 + str r1, [sp] + ldrh r3, [r2, 0x2] + lsls r3, 16 + ldr r0, _080A7620 + ands r0, r1 + orrs r0, r3 + str r0, [sp] + ldr r0, [r2, 0x4] + cmp r0, 0 + beq _080A7628 + ldr r1, _080A7624 + bl sub_800A908 + adds r5, r0, 0 + movs r1, 0 + bl sub_800A9D8 + ldr r0, [r5, 0x4] + str r0, [sp, 0x4] + b _080A762A + .align 2, 0 +_080A7618: .4byte gUnknown_8117AE4 +_080A761C: .4byte 0xffff0000 +_080A7620: .4byte 0x0000ffff +_080A7624: .4byte 0x09e60000 +_080A7628: + str r5, [sp, 0x4] +_080A762A: + adds r0, r4, 0 + mov r1, sp + adds r2, r6, 0 + bl sub_80A67CC + str r5, [r4, 0x54] + adds r0, r4, 0 + adds r0, 0x52 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + blt _080A764E + movs r1, 0x80 + lsls r1, 4 + adds r0, r4, 0 + movs r2, 0 + bl sub_80A6EFC +_080A764E: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80A75CC + + thumb_func_start sub_80A7658 +sub_80A7658: + push {lr} + bl sub_80A68A0 + pop {r0} + bx r0 + thumb_func_end sub_80A7658 + + thumb_func_start sub_80A7664 +sub_80A7664: + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + movs r1, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_80A7094 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0 + adds r3, r6, 0 + bl sub_80A7310 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80A7664 + + thumb_func_start sub_80A7688 +sub_80A7688: + push {r4-r6,lr} + sub sp, 0x8 + adds r4, r0, 0 + adds r6, r3, 0 + lsls r2, 16 + asrs r2, 13 + ldr r0, _080A76D4 + adds r2, r0 + movs r5, 0 + movs r0, 0 + ldrsb r0, [r2, r0] + lsls r0, 16 + lsrs r0, 16 + ldr r3, _080A76D8 + ldr r1, [sp] + ands r1, r3 + orrs r1, r0 + str r1, [sp] + ldrh r3, [r2, 0x2] + lsls r3, 16 + ldr r0, _080A76DC + ands r0, r1 + orrs r0, r3 + str r0, [sp] + ldr r0, [r2, 0x4] + cmp r0, 0 + beq _080A76E4 + ldr r1, _080A76E0 + bl sub_800A908 + adds r5, r0, 0 + movs r1, 0 + bl sub_800A9D8 + ldr r0, [r5, 0x4] + str r0, [sp, 0x4] + b _080A76E6 + .align 2, 0 +_080A76D4: .4byte gUnknown_8117E8C +_080A76D8: .4byte 0xffff0000 +_080A76DC: .4byte 0x0000ffff +_080A76E0: .4byte 0x09e60000 +_080A76E4: + str r5, [sp, 0x4] +_080A76E6: + adds r0, r4, 0 + mov r1, sp + adds r2, r6, 0 + bl sub_80A67CC + str r5, [r4, 0x54] + adds r0, r4, 0 + adds r0, 0x52 + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r0, 0 + blt _080A770A + movs r1, 0x80 + lsls r1, 4 + adds r0, r4, 0 + movs r2, 0 + bl sub_80A6EFC +_080A770A: + add sp, 0x8 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80A7688 + + thumb_func_start sub_80A7714 +sub_80A7714: + push {lr} + bl sub_80A68A0 + pop {r0} + bx r0 + thumb_func_end sub_80A7714 + + thumb_func_start sub_80A7720 +sub_80A7720: + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + movs r1, 0 + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_80A7094 + adds r0, r4, 0 + adds r1, r5, 0 + movs r2, 0 + adds r3, r6, 0 + bl sub_80A7310 + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80A7720 + + thumb_func_start sub_80A7744 +sub_80A7744: + ldr r1, _080A7750 + movs r2, 0x1 + negs r2, r2 + adds r0, r2, 0 + strh r0, [r1] + bx lr + .align 2, 0 +_080A7750: .4byte gUnknown_2039DE0 + thumb_func_end sub_80A7744 + + thumb_func_start sub_80A7754 +sub_80A7754: + ldr r1, _080A7760 + movs r2, 0x1 + negs r2, r2 + adds r0, r2, 0 + strh r0, [r1] + bx lr + .align 2, 0 +_080A7760: .4byte gUnknown_2039DE0 + thumb_func_end sub_80A7754 + + thumb_func_start sub_80A7764 +sub_80A7764: + push {r4,lr} + lsls r0, 16 + asrs r4, r0, 16 + bl sub_80A7784 + movs r0, 0x1 + negs r0, r0 + cmp r4, r0 + beq _080A777A + ldr r0, _080A7780 + strh r4, [r0] +_080A777A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A7780: .4byte gUnknown_2039DE0 + thumb_func_end sub_80A7764 + + thumb_func_start sub_80A7784 +sub_80A7784: + push {lr} + ldr r2, _080A779C + movs r1, 0 + ldrsh r0, [r2, r1] + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080A7796 + strh r1, [r2] +_080A7796: + pop {r0} + bx r0 + .align 2, 0 +_080A779C: .4byte gUnknown_2039DE0 + thumb_func_end sub_80A7784 + + thumb_func_start sub_80A77A0 +sub_80A77A0: + push {lr} + lsls r0, 16 + asrs r1, r0, 16 + adds r2, r1, 0 + ldr r0, _080A77BC + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r0, r1 + beq _080A77CA + cmp r1, 0 + bge _080A77C0 + bl sub_80A7784 + b _080A77C6 + .align 2, 0 +_080A77BC: .4byte gUnknown_2039DE0 +_080A77C0: + adds r0, r2, 0 + bl sub_80A7764 +_080A77C6: + movs r0, 0x1 + b _080A77CC +_080A77CA: + movs r0, 0 +_080A77CC: + pop {r1} + bx r1 + thumb_func_end sub_80A77A0 + + thumb_func_start sub_80A77D0 +sub_80A77D0: + push {lr} + lsls r0, 16 + asrs r1, r0, 16 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080A77E8 + ldr r0, _080A77E4 + b _080A77F0 + .align 2, 0 +_080A77E4: .4byte gUnknown_8117EFC +_080A77E8: + ldr r0, _080A77F4 + lsls r1, 2 + adds r1, r0 + ldr r0, [r1] +_080A77F0: + pop {r1} + bx r1 + .align 2, 0 +_080A77F4: .4byte gUnknown_811E258 + thumb_func_end sub_80A77D0 + + thumb_func_start sub_80A77F8 +sub_80A77F8: + push {r4,r5,lr} + ldr r4, _080A7860 + movs r0, 0xCE + lsls r0, 2 + movs r1, 0x6 + bl MemoryAlloc + str r0, [r4] + ldr r4, _080A7864 + movs r0, 0xBA + lsls r0, 6 + movs r1, 0x6 + bl MemoryAlloc + str r0, [r4] + adds r1, r0, 0 + ldr r0, _080A7868 + adds r5, r0, 0 + movs r4, 0xF8 + lsls r4, 1 + movs r2, 0x80 + lsls r2, 9 + adds r3, r2, 0 +_080A7826: + ldrh r0, [r1, 0x2] + orrs r0, r5 + strh r0, [r1, 0x2] + adds r0, r2, 0 + adds r2, r3 + asrs r0, 16 + adds r1, r4 + cmp r0, 0x17 + ble _080A7826 + ldr r4, _080A7860 + ldr r1, [r4] + movs r0, 0xCB + lsls r0, 2 + adds r1, r0 + movs r0, 0 + movs r2, 0x19 + bl sub_809D710 + ldr r0, [r4] + movs r1, 0xCC + lsls r1, 2 + adds r0, r1 + movs r1, 0x1 + strh r1, [r0] + bl sub_80A786C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080A7860: .4byte gUnknown_3001B80 +_080A7864: .4byte gUnknown_3001B84 +_080A7868: .4byte 0x0000ffff + thumb_func_end sub_80A77F8 + + thumb_func_start sub_80A786C +sub_80A786C: + push {r4-r6,lr} + ldr r0, _080A78E8 + ldr r4, [r0] + movs r1, 0 + movs r6, 0x1 + negs r6, r6 + movs r5, 0x80 + lsls r5, 9 +_080A787C: + movs r2, 0x2 + ldrsh r0, [r4, r2] + cmp r0, r6 + beq _080A788A + adds r0, r1, 0 + bl sub_80A8684 +_080A788A: + adds r0, r5, 0 + movs r1, 0x80 + lsls r1, 9 + adds r5, r1 + asrs r1, r0, 16 + movs r2, 0xF8 + lsls r2, 1 + adds r4, r2 + cmp r1, 0x17 + ble _080A787C + ldr r3, _080A78EC + ldr r0, [r3] + movs r2, 0x1 + negs r2, r2 + str r2, [r0, 0x24] + adds r0, 0x28 + movs r1, 0xFF + strb r1, [r0] + movs r5, 0 + movs r4, 0 + movs r1, 0x2 +_080A78B4: + ldr r0, [r3] + adds r0, r4 + str r2, [r0, 0x8] + str r5, [r0] + str r5, [r0, 0x4] + adds r4, 0xC + subs r1, 0x1 + cmp r1, 0 + bge _080A78B4 + ldr r4, _080A78EC + movs r2, 0 + movs r3, 0x2C + movs r1, 0x3F +_080A78CE: + ldr r0, [r4] + adds r0, r3 + str r2, [r0] + str r2, [r0, 0x4] + str r2, [r0, 0x8] + adds r3, 0xC + subs r1, 0x1 + cmp r1, 0 + bge _080A78CE + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080A78E8: .4byte gUnknown_3001B84 +_080A78EC: .4byte gUnknown_3001B80 + thumb_func_end sub_80A786C + + thumb_func_start sub_80A78F0 +sub_80A78F0: + push {r4,r5,lr} + bl sub_80A786C + ldr r4, _080A7914 + ldr r0, [r4] + bl MemoryFree + movs r5, 0 + str r5, [r4] + ldr r4, _080A7918 + ldr r0, [r4] + bl MemoryFree + str r5, [r4] + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080A7914: .4byte gUnknown_3001B84 +_080A7918: .4byte gUnknown_3001B80 + thumb_func_end sub_80A78F0 + + thumb_func_start sub_80A791C +sub_80A791C: + push {r4-r7,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 16 + asrs r4, 16 + lsls r1, 16 + asrs r7, r1, 16 + lsls r2, 24 + asrs r6, r2, 24 + ldr r1, _080A7980 + adds r0, r4, 0 + bl sub_80A77D0 + adds r5, r0, 0 + ldr r1, _080A7984 + str r6, [sp] + movs r0, 0 + adds r2, r4, 0 + adds r3, r7, 0 + bl Log + lsls r1, r7, 3 + ldr r0, [r5, 0x4] + adds r0, r1 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + ldr r0, [r0, 0x4] + adds r0, r1 + ldr r5, [r0, 0x4] + ldr r0, [r0] + cmp r0, 0 + ble _080A7976 + adds r4, r0, 0 +_080A7960: + movs r0, 0x1 + negs r0, r0 + adds r1, r5, 0 + adds r2, r7, 0 + adds r3, r6, 0 + bl sub_80A80A4 + subs r4, 0x1 + adds r5, 0x18 + cmp r4, 0 + bne _080A7960 +_080A7976: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A7980: .4byte gUnknown_811808C +_080A7984: .4byte gUnknown_8118098 + thumb_func_end sub_80A791C + + thumb_func_start sub_80A7988 +sub_80A7988: + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + asrs r7, r0, 16 + lsls r1, 24 + asrs r5, r1, 24 + ldr r1, _080A79F4 + movs r0, 0 + adds r2, r7, 0 + adds r3, r5, 0 + bl Log + movs r1, 0 + ldr r0, _080A79F8 + ldr r4, [r0] + movs r0, 0x1 + negs r0, r0 + mov r8, r0 + movs r6, 0x80 + lsls r6, 9 +_080A79B2: + movs r2, 0x2 + ldrsh r0, [r4, r2] + cmp r0, r8 + beq _080A79D4 + movs r2, 0x4 + ldrsh r0, [r4, r2] + cmp r0, r7 + bne _080A79D4 + cmp r5, 0 + blt _080A79CE + movs r0, 0x6 + ldrsb r0, [r4, r0] + cmp r0, r5 + bne _080A79D4 +_080A79CE: + adds r0, r1, 0 + bl sub_80A8684 +_080A79D4: + adds r0, r6, 0 + movs r1, 0x80 + lsls r1, 9 + adds r6, r1 + asrs r1, r0, 16 + movs r2, 0xF8 + lsls r2, 1 + adds r4, r2 + cmp r1, 0x17 + ble _080A79B2 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A79F4: .4byte gUnknown_81180BC +_080A79F8: .4byte gUnknown_3001B84 + thumb_func_end sub_80A7988 + + thumb_func_start sub_80A79FC +sub_80A79FC: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + ldr r1, _080A7A70 + movs r0, 0 + bl Log + movs r6, 0 + ldr r0, _080A7A74 + ldr r4, [r0] + movs r0, 0x1 + negs r0, r0 + mov r8, r0 + movs r1, 0xA2 + lsls r1, 1 + adds r5, r4, r1 + mov r7, sp +_080A7A20: + movs r1, 0x2 + ldrsh r0, [r4, r1] + cmp r0, r8 + beq _080A7A50 + ldr r0, [r5] + ldr r1, [r4, 0x14] + adds r0, r1 + str r0, [sp] + ldr r0, [r5, 0x4] + ldr r1, [r4, 0x18] + adds r0, r1 + str r0, [r7, 0x4] + movs r1, 0xB8 + lsls r1, 1 + adds r0, r4, r1 + mov r1, sp + bl sub_80A675C + lsls r0, 24 + cmp r0, 0 + bne _080A7A50 + adds r0, r6, 0 + bl sub_80A8684 +_080A7A50: + adds r0, r6, 0x1 + lsls r0, 16 + asrs r6, r0, 16 + movs r0, 0xF8 + lsls r0, 1 + adds r5, r0 + adds r4, r0 + cmp r6, 0x17 + ble _080A7A20 + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A7A70: .4byte gUnknown_81180D8 +_080A7A74: .4byte gUnknown_3001B84 + thumb_func_end sub_80A79FC + + thumb_func_start sub_80A7A78 +sub_80A7A78: + push {r4-r7,lr} + ldr r1, _080A7AC0 + movs r0, 0 + bl Log + movs r6, 0 + ldr r0, _080A7AC4 + ldr r4, [r0] + movs r7, 0x1 + negs r7, r7 + movs r0, 0x9F + lsls r0, 1 + adds r5, r4, r0 +_080A7A92: + movs r1, 0x2 + ldrsh r0, [r4, r1] + cmp r0, r7 + beq _080A7ACC + movs r1, 0x8E + lsls r1, 1 + adds r0, r4, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 4 + ands r0, r1 + cmp r0, 0 + beq _080A7AC8 + movs r0, 0xA2 + lsls r0, 1 + adds r1, r4, r0 + adds r0, 0x8 + adds r2, r4, r0 + movs r0, 0x20 + bl sub_80ADCA0 + b _080A7ACA + .align 2, 0 +_080A7AC0: .4byte gUnknown_81180D8 +_080A7AC4: .4byte gUnknown_3001B84 +_080A7AC8: + ldr r0, _080A7AE4 +_080A7ACA: + strh r0, [r5] +_080A7ACC: + adds r0, r6, 0x1 + lsls r0, 16 + asrs r6, r0, 16 + movs r1, 0xF8 + lsls r1, 1 + adds r5, r1 + adds r4, r1 + cmp r6, 0x17 + ble _080A7A92 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A7AE4: .4byte 0x0000ffff + thumb_func_end sub_80A7A78 + + thumb_func_start sub_80A7AE8 +sub_80A7AE8: + push {r4-r7,lr} + sub sp, 0x4 + mov r1, sp + strh r0, [r1] + mov r0, sp + bl sub_80A7B94 + mov r0, sp + movs r1, 0 + ldrsh r2, [r0, r1] + movs r0, 0x1 + negs r0, r0 + cmp r2, r0 + beq _080A7B34 + movs r3, 0 + ldr r0, _080A7B24 + ldr r1, [r0] + adds r4, r2, 0 + movs r2, 0x80 + lsls r2, 9 + adds r6, r2, 0 + movs r5, 0xF8 + lsls r5, 1 +_080A7B16: + movs r7, 0x2 + ldrsh r0, [r1, r7] + cmp r0, r4 + bne _080A7B28 + adds r0, r3, 0 + b _080A7B38 + .align 2, 0 +_080A7B24: .4byte gUnknown_3001B84 +_080A7B28: + adds r0, r2, 0 + adds r2, r6 + asrs r3, r0, 16 + adds r1, r5 + cmp r3, 0x17 + ble _080A7B16 +_080A7B34: + movs r0, 0x1 + negs r0, r0 +_080A7B38: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80A7AE8 + + thumb_func_start sub_80A7B40 +sub_80A7B40: + push {r4-r7,lr} + lsls r0, 16 + asrs r4, r0, 16 + movs r3, 0 + ldr r0, _080A7B70 + ldr r1, [r0] + movs r6, 0x1 + negs r6, r6 + movs r2, 0x80 + lsls r2, 9 + movs r5, 0x9E + lsls r5, 1 +_080A7B58: + movs r7, 0x2 + ldrsh r0, [r1, r7] + cmp r0, r6 + beq _080A7B74 + adds r0, r1, r5 + movs r7, 0 + ldrsh r0, [r0, r7] + cmp r0, r4 + bne _080A7B74 + adds r0, r3, 0 + b _080A7B8C + .align 2, 0 +_080A7B70: .4byte gUnknown_3001B84 +_080A7B74: + adds r0, r2, 0 + movs r3, 0x80 + lsls r3, 9 + adds r2, r3 + asrs r3, r0, 16 + movs r7, 0xF8 + lsls r7, 1 + adds r1, r7 + cmp r3, 0x17 + ble _080A7B58 + movs r0, 0x1 + negs r0, r0 +_080A7B8C: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80A7B40 + + thumb_func_start sub_80A7B94 +sub_80A7B94: + push {r4-r7,lr} + sub sp, 0x10 + adds r7, r0, 0 + movs r0, 0 + ldrsh r2, [r7, r0] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + ldr r1, _080A7BD4 + adds r0, r1 + movs r6, 0x1 + negs r6, r6 + movs r1, 0 + ldrsh r5, [r0, r1] + cmp r5, 0x1 + bne _080A7C14 + adds r0, r2, 0 + cmp r0, 0 + bne _080A7C10 + movs r0, 0 + movs r1, 0x1C + bl sub_8001658 + adds r4, r0, 0 + cmp r4, 0x1 + beq _080A7BDE + cmp r4, 0x1 + bgt _080A7BD8 + cmp r4, 0 + beq _080A7BF2 + b _080A7C08 + .align 2, 0 +_080A7BD4: .4byte gUnknown_811E63C +_080A7BD8: + cmp r4, 0x2 + beq _080A7BE4 + b _080A7C08 +_080A7BDE: + movs r0, 0x2 + strh r0, [r7] + b _080A7C10 +_080A7BE4: + bl sub_808D33C + adds r6, r0, 0 + bl sub_808D3BC + cmp r0, r6 + bne _080A7BF6 +_080A7BF2: + strh r5, [r7] + b _080A7C10 +_080A7BF6: + bl sub_808D3F8 + cmp r0, r6 + bne _080A7C02 + strh r4, [r7] + b _080A7C10 +_080A7C02: + movs r0, 0x3 + strh r0, [r7] + b _080A7C10 +_080A7C08: + movs r1, 0x1 + negs r1, r1 + adds r0, r1, 0 + b _080A7DAC +_080A7C10: + movs r6, 0 + b _080A7DD2 +_080A7C14: + cmp r5, 0x2 + bne _080A7CD2 + movs r0, 0 + movs r1, 0x1D + bl sub_8001658 + adds r4, r0, 0 + movs r0, 0 + movs r1, 0x1E + bl sub_8001658 + adds r2, r0, 0 + ldrh r1, [r7] + subs r0, r1, 0x4 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _080A7C82 + cmp r1, 0x4 + bne _080A7C44 + adds r0, r4, 0 + cmp r0, 0 + bne _080A7C4C + b _080A7C4A +_080A7C44: + movs r0, 0 + cmp r4, 0 + beq _080A7C4C +_080A7C4A: + adds r0, r2, 0 +_080A7C4C: + cmp r0, 0x2 + beq _080A7C7A + cmp r0, 0x2 + bhi _080A7C5A + cmp r0, 0x1 + beq _080A7C6E + b _080A7DA6 +_080A7C5A: + cmp r0, 0x3 + beq _080A7C60 + b _080A7DA6 +_080A7C60: + bl sub_808D33C + adds r4, r0, 0 + bl sub_808D3BC + cmp r0, r4 + bne _080A7C72 +_080A7C6E: + movs r0, 0x6 + b _080A7C80 +_080A7C72: + bl sub_808D3F8 + cmp r0, r4 + bne _080A7C7E +_080A7C7A: + movs r0, 0x7 + b _080A7C80 +_080A7C7E: + movs r0, 0x8 +_080A7C80: + strh r0, [r7] +_080A7C82: + movs r0, 0 + ldrsh r5, [r7, r0] + cmp r5, 0x7 + beq _080A7CB0 + cmp r5, 0x7 + bgt _080A7C94 + cmp r5, 0x6 + beq _080A7C9A + b _080A7CCA +_080A7C94: + cmp r5, 0x8 + beq _080A7CC6 + b _080A7CCA +_080A7C9A: + movs r6, 0x2 + bl sub_808D33C + adds r4, r0, 0 + bl sub_808D3BC + cmp r4, r0 + beq _080A7CAC + b _080A7DD2 +_080A7CAC: + strh r5, [r7] + b _080A7DD2 +_080A7CB0: + movs r6, 0x1 + bl sub_808D33C + adds r4, r0, 0 + bl sub_808D3F8 + cmp r4, r0 + beq _080A7CC2 + b _080A7DD2 +_080A7CC2: + movs r0, 0x6 + b _080A7DD0 +_080A7CC6: + movs r6, 0x2 + b _080A7DD2 +_080A7CCA: + movs r1, 0x1 + negs r1, r1 + adds r0, r1, 0 + b _080A7DAC +_080A7CD2: + cmp r5, 0x3 + bne _080A7DB0 + ldrh r1, [r7] + adds r0, r1, 0 + subs r0, 0xA + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x3 + bhi _080A7D12 + adds r4, r2, 0 + subs r4, 0xA + bl sub_8098F88 + lsls r0, 24 + cmp r0, 0 + bne _080A7DD2 + movs r0, 0x9 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _080A7D06 + mov r0, sp + bl sub_808D6A4 + b _080A7D0C +_080A7D06: + mov r0, sp + bl sub_808D654 +_080A7D0C: + cmp r4, r0 + bge _080A7DA6 + b _080A7D7E +_080A7D12: + adds r0, r1, 0 + subs r0, 0xE + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xF + bhi _080A7DA6 + movs r0, 0 + movs r1, 0x10 + bl sub_8001658 + lsls r0, 16 + asrs r0, 16 + bl sub_8002658 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _080A7DA6 + movs r2, 0 + ldrsh r0, [r7, r2] + adds r4, r0, 0 + subs r4, 0xE + adds r0, r1, 0 + mov r1, sp + movs r2, 0 + movs r3, 0 + bl sub_8092638 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r4, r0 + bge _080A7DA6 + ldr r2, _080A7D84 + ldr r0, [sp, 0x8] + adds r0, r4 + movs r1, 0x58 + muls r1, r0 + ldr r0, [r2] + adds r4, r0, r1 + movs r0, 0x9 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _080A7D88 + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080A7DA6 + ldrb r0, [r4, 0x2] + cmp r0, 0 + bne _080A7DA6 +_080A7D7E: + movs r0, 0x1 + negs r0, r0 + b _080A7DD4 + .align 2, 0 +_080A7D84: .4byte gUnknown_203B45C +_080A7D88: + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080A7DA6 + ldrb r0, [r4, 0x2] + cmp r0, 0 + bne _080A7DA6 + movs r1, 0 + ldrb r0, [r4, 0x4] + cmp r0, 0x41 + bne _080A7DA2 + movs r1, 0x1 +_080A7DA2: + cmp r1, 0 + beq _080A7D7E +_080A7DA6: + movs r2, 0x1 + negs r2, r2 + adds r0, r2, 0 +_080A7DAC: + strh r0, [r7] + b _080A7D7E +_080A7DB0: + cmp r2, 0x23 + bne _080A7DD2 + bl sub_808D33C + adds r4, r0, 0 + bl sub_808D3BC + cmp r0, r4 + bne _080A7DC6 + movs r0, 0x21 + b _080A7DD0 +_080A7DC6: + bl sub_808D3F8 + cmp r0, r4 + bne _080A7DD2 + movs r0, 0x22 +_080A7DD0: + strh r0, [r7] +_080A7DD2: + adds r0, r6, 0 +_080A7DD4: + add sp, 0x10 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80A7B94 + + thumb_func_start sub_80A7DDC +sub_80A7DDC: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x24 + adds r7, r0, 0 + adds r5, r1, 0 + bl sub_80A7B94 + lsls r0, 16 + asrs r0, 16 + mov r8, r0 + movs r0, 0 + strh r0, [r5] + ldrh r3, [r7] + movs r1, 0 + ldrsh r0, [r7, r1] + movs r6, 0x1 + negs r6, r6 + cmp r0, r6 + bne _080A7E0A +_080A7E04: + movs r0, 0x1 + negs r0, r0 + b _080A8098 +_080A7E0A: + movs r0, 0 + ldrsh r2, [r7, r0] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + ldr r1, _080A7E50 + adds r4, r0, r1 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r0, 0x3 + beq _080A7E22 + b _080A7F38 +_080A7E22: + adds r0, r3, 0 + subs r0, 0xA + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x3 + bhi _080A7E90 + adds r4, r2, 0 + subs r4, 0xA + bl sub_8098F88 + lsls r0, 24 + cmp r0, 0 + beq _080A7E58 + ldr r0, _080A7E54 + lsls r1, r4, 1 + adds r1, r0 + ldrh r0, [r1] + strh r0, [r5] + cmp r0, 0 + bne _080A7E04 + strh r6, [r7] + b _080A7E04 + .align 2, 0 +_080A7E50: .4byte gUnknown_811E63C +_080A7E54: .4byte gUnknown_81180F0 +_080A7E58: + movs r0, 0x9 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _080A7E6C + mov r0, sp + bl sub_808D6A4 + b _080A7E72 +_080A7E6C: + mov r0, sp + bl sub_808D654 +_080A7E72: + cmp r4, r0 + blt _080A7E78 + b _080A8080 +_080A7E78: + ldr r2, _080A7E8C + lsls r0, r4, 2 + add r0, sp + ldr r1, [r0] + movs r0, 0x58 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + ldrh r0, [r0, 0x8] + b _080A800A + .align 2, 0 +_080A7E8C: .4byte gUnknown_203B45C +_080A7E90: + adds r0, r3, 0 + subs r0, 0xE + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xF + bls _080A7E9E + b _080A8080 +_080A7E9E: + movs r0, 0 + movs r1, 0x10 + bl sub_8001658 + lsls r0, 16 + asrs r0, 16 + bl sub_8002658 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + bne _080A7EB8 + b _080A8080 +_080A7EB8: + movs r2, 0 + ldrsh r0, [r7, r2] + adds r4, r0, 0 + subs r4, 0xE + adds r0, r1, 0 + mov r1, sp + movs r2, 0 + movs r3, 0 + bl sub_8092638 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + cmp r4, r0 + blt _080A7ED8 + b _080A8080 +_080A7ED8: + ldr r2, _080A7F0C + ldr r0, [sp, 0x8] + adds r0, r4 + movs r1, 0x58 + muls r1, r0 + ldr r0, [r2] + adds r4, r0, r1 + movs r0, 0x9 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _080A7F10 + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080A7EFE + b _080A8080 +_080A7EFE: + ldrb r0, [r4, 0x2] + cmp r0, 0 + beq _080A7F06 + b _080A8080 +_080A7F06: + ldrh r0, [r4, 0x8] + b _080A800A + .align 2, 0 +_080A7F0C: .4byte gUnknown_203B45C +_080A7F10: + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080A7F1C + b _080A8080 +_080A7F1C: + ldrb r0, [r4, 0x2] + cmp r0, 0 + beq _080A7F24 + b _080A8080 +_080A7F24: + movs r1, 0 + ldrb r0, [r4, 0x4] + cmp r0, 0x41 + bne _080A7F2E + movs r1, 0x1 +_080A7F2E: + cmp r1, 0 + beq _080A7F34 + b _080A8080 +_080A7F34: + ldrh r0, [r4, 0x8] + b _080A800A +_080A7F38: + subs r0, r3, 0x1 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x23 + bls _080A7F44 + b _080A808A +_080A7F44: + lsls r0, 2 + ldr r1, _080A7F50 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080A7F50: .4byte _080A7F54 + .align 2, 0 +_080A7F54: + .4byte _080A7FE4 + .4byte _080A7FEC + .4byte _080A7FF4 + .4byte _080A808A + .4byte _080A808A + .4byte _080A7FE4 + .4byte _080A7FEC + .4byte _080A7FF4 + .4byte _080A808A + .4byte _080A808A + .4byte _080A808A + .4byte _080A808A + .4byte _080A808A + .4byte _080A808A + .4byte _080A808A + .4byte _080A808A + .4byte _080A808A + .4byte _080A808A + .4byte _080A808A + .4byte _080A808A + .4byte _080A808A + .4byte _080A808A + .4byte _080A808A + .4byte _080A808A + .4byte _080A808A + .4byte _080A808A + .4byte _080A808A + .4byte _080A808A + .4byte _080A808A + .4byte _080A8032 + .4byte _080A8032 + .4byte _080A8014 + .4byte _080A7FE4 + .4byte _080A7FEC + .4byte _080A7FF4 + .4byte _080A7FFC +_080A7FE4: + bl sub_808D3BC + ldrh r0, [r0, 0x8] + b _080A8094 +_080A7FEC: + bl sub_808D3F8 + ldrh r0, [r0, 0x8] + b _080A8094 +_080A7FF4: + bl sub_808D33C + ldrh r0, [r0, 0x8] + b _080A8094 +_080A7FFC: + movs r0, 0xF + bl RandomCapped + ldr r1, _080A8010 + lsls r0, 1 + adds r0, r1 + ldrh r0, [r0] +_080A800A: + strh r0, [r5] + b _080A7E04 + .align 2, 0 +_080A8010: .4byte gUnknown_81180FC +_080A8014: + movs r0, 0 + movs r1, 0x1F + bl sub_8001658 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + beq _080A8028 + strh r0, [r5] + b _080A7E04 +_080A8028: + movs r1, 0x1 + negs r1, r1 + adds r0, r1, 0 + strh r0, [r7] + b _080A7E04 +_080A8032: + movs r0, 0x89 + strh r0, [r5] + add r6, sp, 0x10 + adds r0, r6, 0 + bl sub_8099328 + lsls r0, 24 + cmp r0, 0 + bne _080A8046 + b _080A7E04 +_080A8046: + add r1, sp, 0x14 + add r2, sp, 0x18 + movs r0, 0x2 + bl sub_8001B88 + add r4, sp, 0x1C + ldr r1, [sp, 0x18] + lsls r1, 24 + lsrs r1, 24 + ldrb r2, [r6] + adds r0, r4, 0 + bl sub_8096AF8 + ldrb r0, [r4] + cmp r0, 0 + beq _080A8076 + movs r2, 0 + ldrsh r0, [r7, r2] + cmp r0, 0x1E + bne _080A8072 + ldrh r0, [r4, 0x2] + b _080A8074 +_080A8072: + ldrh r0, [r4, 0x4] +_080A8074: + strh r0, [r5] +_080A8076: + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _080A8080 + b _080A7E04 +_080A8080: + movs r2, 0x1 + negs r2, r2 + adds r0, r2, 0 + strh r0, [r7] + b _080A7E04 +_080A808A: + movs r1, 0 + ldrsh r0, [r5, r1] + cmp r0, 0 + bne _080A8096 + ldrh r0, [r4, 0x2] +_080A8094: + strh r0, [r5] +_080A8096: + mov r0, r8 +_080A8098: + add sp, 0x24 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80A7DDC + + thumb_func_start sub_80A80A4 +sub_80A80A4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + str r1, [sp, 0x10] + lsls r0, 16 + asrs r6, r0, 16 + lsls r2, 16 + asrs r2, 16 + str r2, [sp, 0x14] + lsls r3, 24 + asrs r3, 24 + str r3, [sp, 0x18] + ldrb r1, [r1] + add r0, sp, 0xC + strh r1, [r0] + movs r0, 0 + mov r8, r0 + mov r4, sp + adds r4, 0xE + add r0, sp, 0xC + adds r1, r4, 0 + bl sub_80A7DDC + lsls r0, 16 + asrs r7, r0, 16 + add r0, sp, 0xC + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0x1 + negs r0, r0 + mov r9, r4 + cmp r1, r0 + beq _080A81AE + cmp r7, 0x1 + beq _080A8104 + cmp r7, 0x1 + bgt _080A80FA + cmp r7, 0 + beq _080A8100 + b _080A8118 +_080A80FA: + cmp r7, 0x2 + beq _080A8108 + b _080A8118 +_080A8100: + movs r6, 0 + b _080A8118 +_080A8104: + movs r6, 0x1 + b _080A8118 +_080A8108: + movs r0, 0 + movs r1, 0x1D + bl sub_8001658 + cmp r0, 0 + bne _080A8116 + movs r7, 0x1 +_080A8116: + movs r6, 0x2 +_080A8118: + add r0, sp, 0xC + movs r3, 0 + ldrsh r2, [r0, r3] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + ldr r1, _080A813C + adds r0, r1 + str r0, [sp, 0x1C] + cmp r6, 0 + bge _080A81B4 + cmp r2, 0x21 + beq _080A8140 + cmp r2, 0x23 + beq _080A8154 + adds r0, r2, 0 + b _080A8162 + .align 2, 0 +_080A813C: .4byte gUnknown_811E63C +_080A8140: + ldr r0, _080A8150 + ldr r0, [r0] + movs r4, 0x2 + ldrsh r0, [r0, r4] + cmp r0, 0x1 + beq _080A81AE + movs r0, 0x21 + b _080A8162 + .align 2, 0 +_080A8150: .4byte gUnknown_3001B84 +_080A8154: + ldr r0, _080A8188 + ldr r0, [r0] + movs r1, 0x2 + ldrsh r0, [r0, r1] + cmp r0, 0x3 + beq _080A81AE + movs r0, 0x23 +_080A8162: + bl sub_80A7AE8 + adds r6, r0, 0 + cmp r6, 0 + bge _080A81B4 + movs r2, 0x3 + ldr r0, _080A8188 + ldr r0, [r0] + movs r3, 0xBA + lsls r3, 3 + adds r5, r0, r3 + movs r4, 0x2 + ldrsh r1, [r5, r4] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080A818C + movs r6, 0x3 + b _080A81B4 + .align 2, 0 +_080A8188: .4byte gUnknown_3001B84 +_080A818C: + adds r0, r2, 0x1 + lsls r0, 16 + asrs r2, r0, 16 + movs r0, 0xF8 + lsls r0, 1 + adds r5, r0 + cmp r2, 0x17 + bgt _080A81AA + movs r3, 0x2 + ldrsh r1, [r5, r3] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080A818C + adds r6, r2, 0 +_080A81AA: + cmp r6, 0 + bge _080A81B4 +_080A81AE: + movs r0, 0x1 + negs r0, r0 + b _080A8674 +_080A81B4: + ldr r1, _080A8234 + lsls r0, r6, 5 + subs r0, r6 + lsls r0, 4 + ldr r1, [r1] + adds r5, r1, r0 + ldr r1, _080A8238 + add r0, sp, 0xC + movs r4, 0 + ldrsh r3, [r0, r4] + ldr r2, [sp, 0x1C] + movs r4, 0 + ldrsh r0, [r2, r4] + str r0, [sp] + ldr r0, [sp, 0x14] + str r0, [sp, 0x4] + ldr r2, [sp, 0x18] + str r2, [sp, 0x8] + movs r0, 0 + adds r2, r6, 0 + bl Log + movs r2, 0 + movs r3, 0x2 + ldrsh r1, [r5, r3] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080A81F0 + movs r2, 0x1 +_080A81F0: + str r2, [sp, 0x20] + strh r6, [r5] + add r0, sp, 0xC + ldrh r0, [r0] + strh r0, [r5, 0x2] + mov r4, sp + ldrh r4, [r4, 0x14] + strh r4, [r5, 0x4] + mov r0, sp + ldrb r0, [r0, 0x18] + strb r0, [r5, 0x6] + mov r1, r9 + ldrh r0, [r1] + strh r0, [r5, 0x8] + movs r2, 0x90 + lsls r2, 1 + adds r4, r5, r2 + adds r0, r4, 0 + bl sub_809CD68 + movs r0, 0x9 + str r0, [r4] + ldr r3, [sp, 0x1C] + ldrh r0, [r3] + subs r0, 0x1 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x9 + bhi _080A82D8 + lsls r0, 2 + ldr r1, _080A823C + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080A8234: .4byte gUnknown_3001B84 +_080A8238: .4byte gUnknown_811811C +_080A823C: .4byte _080A8240 + .align 2, 0 +_080A8240: + .4byte _080A8268 + .4byte _080A8280 + .4byte _080A8290 + .4byte _080A82D8 + .4byte _080A82D8 + .4byte _080A8298 + .4byte _080A82A8 + .4byte _080A82B4 + .4byte _080A82BE + .4byte _080A82CA +_080A8268: + movs r4, 0x8E + lsls r4, 1 + adds r1, r5, r4 + ldr r0, _080A827C + str r0, [r1] + movs r0, 0x90 + lsls r0, 1 + adds r1, r5, r0 + movs r0, 0x1 + b _080A82E0 + .align 2, 0 +_080A827C: .4byte 0x2300181d +_080A8280: + movs r2, 0x8E + lsls r2, 1 + adds r1, r5, r2 + ldr r0, _080A828C + b _080A82E0 + .align 2, 0 +_080A828C: .4byte 0x23001000 +_080A8290: + movs r3, 0x8E + lsls r3, 1 + adds r1, r5, r3 + b _080A82DE +_080A8298: + movs r4, 0x8E + lsls r4, 1 + adds r1, r5, r4 + ldr r0, _080A82A4 + b _080A82E0 + .align 2, 0 +_080A82A4: .4byte 0x2000000d +_080A82A8: + movs r0, 0x8E + lsls r0, 1 + adds r1, r5, r0 + movs r0, 0x80 + lsls r0, 10 + b _080A82E0 +_080A82B4: + movs r2, 0x8E + lsls r2, 1 + adds r1, r5, r2 + movs r0, 0 + b _080A82E0 +_080A82BE: + movs r3, 0x8E + lsls r3, 1 + adds r1, r5, r3 + movs r0, 0xC0 + lsls r0, 12 + b _080A82E0 +_080A82CA: + movs r4, 0x8E + lsls r4, 1 + adds r1, r5, r4 + ldr r0, _080A82D4 + b _080A82E0 + .align 2, 0 +_080A82D4: .4byte 0x20010000 +_080A82D8: + movs r0, 0x8E + lsls r0, 1 + adds r1, r5, r0 +_080A82DE: + ldr r0, _080A83DC +_080A82E0: + str r0, [r1] + ldr r2, [sp, 0x1C] + ldrb r1, [r2, 0x8] + lsls r1, 11 + str r1, [r5, 0xC] + ldrb r0, [r2, 0x9] + lsls r0, 11 + str r0, [r5, 0x10] + lsrs r1, 1 + str r1, [r5, 0x14] + lsrs r0, 1 + str r0, [r5, 0x18] + ldr r3, [sp, 0x10] + ldrb r0, [r3, 0x1] + strb r0, [r5, 0x1C] + adds r2, r3, 0 + adds r2, 0x4 + adds r4, r5, 0 + adds r4, 0x20 + ldrb r1, [r2, 0x2] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _080A8328 + ldrb r0, [r3, 0x4] + lsls r3, r0, 11 + str r3, [r5, 0x20] + ldrb r1, [r2, 0x2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080A8328 + movs r1, 0x80 + lsls r1, 3 + adds r0, r3, r1 + str r0, [r5, 0x20] +_080A8328: + ldrb r1, [r2, 0x3] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _080A834A + ldrb r0, [r2, 0x1] + lsls r3, r0, 11 + str r3, [r4, 0x4] + ldrb r1, [r2, 0x3] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080A834A + movs r2, 0x80 + lsls r2, 3 + adds r0, r3, r2 + str r0, [r4, 0x4] +_080A834A: + ldr r3, [sp, 0x20] + cmp r3, 0 + beq _080A83EC + ldrb r0, [r5, 0x1C] + movs r4, 0xA1 + lsls r4, 1 + adds r1, r5, r4 + movs r3, 0 + strb r0, [r1] + movs r0, 0xA2 + lsls r0, 1 + adds r2, r5, r0 + ldr r0, [r5, 0x20] + ldr r1, [r5, 0x14] + subs r0, r1 + str r0, [r2] + movs r1, 0xA6 + lsls r1, 1 + adds r2, r5, r1 + ldr r0, [r5, 0x20] + ldr r1, [r5, 0x14] + adds r0, r1 + str r0, [r2] + adds r4, 0x6 + adds r2, r5, r4 + ldr r0, [r5, 0x24] + ldr r1, [r5, 0x18] + subs r0, r1 + str r0, [r2] + movs r0, 0xA8 + lsls r0, 1 + adds r2, r5, r0 + ldr r0, [r5, 0x24] + ldr r1, [r5, 0x18] + adds r0, r1 + str r0, [r2] + movs r2, 0xAA + lsls r2, 1 + adds r1, r5, r2 + adds r4, 0x10 + adds r0, r5, r4 + str r3, [r0] + str r3, [r1] + movs r1, 0x9E + lsls r1, 1 + adds r0, r5, r1 + strh r7, [r0] + ldr r1, _080A83E0 + lsls r0, r7, 1 + adds r0, r7 + lsls r0, 2 + ldr r1, [r1] + adds r1, r0 + movs r0, 0x1 + negs r0, r0 + str r0, [r1, 0x8] + str r3, [r1] + str r3, [r1, 0x4] + ldrh r0, [r5, 0x2] + subs r0, 0xE + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xF + bhi _080A83E4 + movs r0, 0x12 + bl sub_800451C + movs r2, 0xA0 + lsls r2, 1 + adds r1, r5, r2 + strh r0, [r1] + b _080A83EC + .align 2, 0 +_080A83DC: .4byte 0x2300068d +_080A83E0: .4byte gUnknown_3001B80 +_080A83E4: + movs r4, 0xA0 + lsls r4, 1 + adds r0, r5, r4 + strh r3, [r0] +_080A83EC: + movs r1, 0x8E + lsls r1, 1 + adds r0, r5, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 4 + ands r0, r1 + cmp r0, 0 + beq _080A8418 + movs r2, 0xA2 + lsls r2, 1 + adds r1, r5, r2 + movs r3, 0xA6 + lsls r3, 1 + adds r2, r5, r3 + movs r0, 0x20 + bl sub_80ADCA0 + movs r4, 0x9F + lsls r4, 1 + adds r1, r5, r4 + b _080A8420 +_080A8418: + movs r0, 0x9F + lsls r0, 1 + adds r1, r5, r0 + ldr r0, _080A849C +_080A8420: + strh r0, [r1] + adds r0, r5, 0 + adds r0, 0x28 + adds r1, r5, 0 + adds r1, 0x30 + bl sub_80A5778 + ldr r1, [sp, 0x20] + cmp r1, 0 + beq _080A84AC + ldr r2, _080A84A0 + adds r1, r5, r2 + movs r0, 0xFF + strb r0, [r1] + movs r3, 0xAF + lsls r3, 1 + adds r1, r5, r3 + movs r3, 0 + movs r0, 0xC0 + lsls r0, 2 + strh r0, [r1] + movs r4, 0xB0 + lsls r4, 1 + adds r1, r5, r4 + movs r2, 0x1 + movs r0, 0x1 + strh r0, [r1] + movs r1, 0xB2 + lsls r1, 1 + adds r0, r5, r1 + str r3, [r0] + adds r4, 0x8 + adds r1, r5, r4 + ldr r0, _080A84A4 + strh r0, [r1] + movs r1, 0xAE + lsls r1, 1 + adds r0, r5, r1 + strb r2, [r0] + movs r2, 0xB5 + lsls r2, 1 + adds r0, r5, r2 + strh r3, [r0] + movs r3, 0xB8 + lsls r3, 1 + adds r0, r5, r3 + movs r4, 0x2 + ldrsh r1, [r5, r4] + movs r3, 0x8 + ldrsh r2, [r5, r3] + movs r4, 0x8E + lsls r4, 1 + adds r3, r5, r4 + ldr r3, [r3] + bl sub_80A7428 + adds r4, r5, 0 + adds r4, 0x38 + ldr r1, _080A84A8 + ldr r0, [sp, 0x18] + str r0, [sp] + b _080A855C + .align 2, 0 +_080A849C: .4byte 0x0000ffff +_080A84A0: .4byte 0x0000015d +_080A84A4: .4byte 0x00000807 +_080A84A8: .4byte gUnknown_8117F10 +_080A84AC: + adds r4, r5, 0 + adds r4, 0x38 + ldr r0, _080A84F0 + ldr r1, [r0] + movs r2, 0xCB + lsls r2, 2 + adds r1, r2 + adds r0, r4, 0 + bl sub_809D684 + lsls r0, 24 + cmp r0, 0 + beq _080A8550 + adds r0, r5, 0 + adds r0, 0xBE + movs r3, 0 + ldrsh r0, [r0, r3] + cmp r0, 0 + beq _080A84F4 + adds r0, r5, 0 + adds r0, 0xE0 + ldrh r0, [r0] + mov r10, r0 + adds r0, r5, 0 + adds r0, 0xE2 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + mov r9, r0 + adds r7, r5, 0 + adds r7, 0x80 + movs r0, 0x82 + adds r0, r5 + b _080A8508 + .align 2, 0 +_080A84F0: .4byte gUnknown_3001B80 +_080A84F4: + adds r1, r5, 0 + adds r1, 0x80 + ldrh r2, [r1] + mov r10, r2 + adds r0, r5, 0 + adds r0, 0x82 + movs r3, 0 + ldrsb r3, [r0, r3] + mov r9, r3 + adds r7, r1, 0 +_080A8508: + mov r8, r0 + adds r0, r4, 0 + bl sub_809D648 + ldr r1, _080A8544 + ldr r0, [sp, 0x18] + str r0, [sp] + adds r0, r4, 0 + adds r2, r5, 0 + ldr r3, [sp, 0x14] + bl sub_809D600 + ldr r0, _080A8548 + ldr r2, [r0] + movs r1, 0xCB + lsls r1, 2 + adds r2, r1 + ldr r3, _080A854C + adds r0, r4, 0 + movs r1, 0 + bl sub_809D790 + mov r2, r10 + strh r2, [r7] + mov r0, r9 + mov r3, r8 + strb r0, [r3] + movs r1, 0x1 + mov r8, r1 + b _080A8566 + .align 2, 0 +_080A8544: .4byte gUnknown_8117F10 +_080A8548: .4byte gUnknown_3001B80 +_080A854C: .4byte gUnknown_8118170 +_080A8550: + adds r0, r4, 0 + bl sub_809D648 + ldr r1, _080A861C + ldr r2, [sp, 0x18] + str r2, [sp] +_080A855C: + adds r0, r4, 0 + adds r2, r5, 0 + ldr r3, [sp, 0x14] + bl sub_809D600 +_080A8566: + ldr r3, [sp, 0x10] + ldr r2, [r3, 0xC] + cmp r2, 0 + bne _080A8574 + ldr r0, _080A8620 + adds r0, 0xEC + ldr r2, [r0] +_080A8574: + adds r0, r4, 0 + movs r1, 0x1 + bl sub_809D6D8 + ldr r0, [sp, 0x10] + ldr r2, [r0, 0x10] + cmp r2, 0 + bne _080A8588 + ldr r0, _080A8620 + ldr r2, [r0, 0x38] +_080A8588: + adds r0, r4, 0 + movs r1, 0x2 + bl sub_809D6D8 + ldr r1, [sp, 0x10] + ldr r2, [r1, 0x14] + cmp r2, 0 + bne _080A859C + ldr r0, _080A8620 + ldr r2, [r0, 0x50] +_080A859C: + adds r0, r4, 0 + movs r1, 0x3 + bl sub_809D6D8 + ldr r3, [sp, 0x10] + ldr r2, [r3, 0x8] + cmp r2, 0 + beq _080A8630 + adds r0, r4, 0 + movs r1, 0 + bl sub_809D6D8 + ldr r0, [sp, 0x20] + cmp r0, 0 + bne _080A860C + mov r1, r8 + cmp r1, 0 + bne _080A860C + movs r2, 0x8E + lsls r2, 1 + adds r0, r5, r2 + ldr r0, [r0] + movs r1, 0xC0 + lsls r1, 5 + ands r0, r1 + cmp r0, 0 + bne _080A860C + ldr r0, _080A8624 + ldr r2, [r0] + movs r3, 0xCB + lsls r3, 2 + adds r2, r3 + ldr r3, _080A8628 + adds r0, r4, 0 + movs r1, 0 + bl sub_809D790 + movs r1, 0xB0 + lsls r1, 1 + adds r0, r5, r1 + movs r2, 0xAF + lsls r2, 1 + adds r1, r5, r2 + ldrh r0, [r0] + ldrh r1, [r1] + orrs r0, r1 + adds r1, r5, 0 + adds r1, 0x80 + strh r0, [r1] + movs r3, 0xA1 + lsls r3, 1 + adds r0, r5, r3 + ldrb r1, [r0] + adds r0, r5, 0 + adds r0, 0x82 + strb r1, [r0] +_080A860C: + ldr r3, _080A862C + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl sub_809D8C0 + b _080A865A + .align 2, 0 +_080A861C: .4byte gUnknown_8117F10 +_080A8620: .4byte gUnknown_812F1F8 +_080A8624: .4byte gUnknown_3001B80 +_080A8628: .4byte gUnknown_811817C +_080A862C: .4byte gUnknown_8118188 +_080A8630: + mov r4, r8 + cmp r4, 0 + beq _080A865A + movs r0, 0xAE + lsls r0, 1 + adds r1, r5, r0 + movs r0, 0x1 + strb r0, [r1] + adds r0, r5, 0 + adds r0, 0x82 + ldrb r0, [r0] + movs r2, 0xA1 + lsls r2, 1 + adds r1, r5, r2 + strb r0, [r1] + adds r0, r5, 0 + adds r0, 0x80 + ldrh r1, [r0] + adds r0, r5, 0 + bl sub_80A9750 +_080A865A: + ldr r3, [sp, 0x1C] + movs r4, 0 + ldrsh r0, [r3, r4] + cmp r0, 0x1 + bne _080A8672 + ldr r0, [sp, 0x20] + cmp r0, 0 + beq _080A8672 + movs r0, 0x1 + adds r1, r6, 0 + bl sub_809D170 +_080A8672: + adds r0, r6, 0 +_080A8674: + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80A80A4 + + thumb_func_start sub_80A8684 +sub_80A8684: + push {r4,lr} + adds r2, r0, 0 + lsls r2, 16 + asrs r2, 16 + ldr r1, _080A86BC + lsls r0, r2, 5 + subs r0, r2 + lsls r0, 4 + ldr r1, [r1] + adds r4, r1, r0 + ldr r1, _080A86C0 + movs r0, 0 + bl Log + movs r1, 0xB8 + lsls r1, 1 + adds r0, r4, r1 + bl sub_80A74E4 + adds r0, r4, 0 + adds r0, 0x38 + bl sub_809D648 + ldr r0, _080A86C4 + strh r0, [r4, 0x2] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080A86BC: .4byte gUnknown_3001B84 +_080A86C0: .4byte gUnknown_8118194 +_080A86C4: .4byte 0x0000ffff + thumb_func_end sub_80A8684 + + thumb_func_start sub_80A86C8 +sub_80A86C8: + push {r4,r5,lr} + adds r5, r1, 0 + lsls r0, 16 + asrs r0, 16 + ldr r2, _080A8708 + lsls r1, r0, 5 + subs r1, r0 + lsls r1, 4 + ldr r0, [r2] + adds r4, r0, r1 + movs r1, 0x2 + ldrsh r0, [r4, r1] + movs r3, 0x1 + negs r3, r3 + cmp r0, r3 + beq _080A8744 + movs r2, 0x9E + lsls r2, 1 + adds r1, r4, r2 + movs r2, 0 + ldrsh r0, [r1, r2] + cmp r0, 0 + bne _080A870C + movs r0, 0xC0 + lsls r0, 6 + ands r0, r5 + cmp r0, 0 + beq _080A872E + bl sub_80AB5A4 + b _080A872E + .align 2, 0 +_080A8708: .4byte gUnknown_3001B84 +_080A870C: + movs r0, 0x80 + lsls r0, 5 + ands r0, r5 + cmp r0, 0 + beq _080A872E + ldr r2, _080A874C + movs r0, 0 + ldrsh r1, [r1, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r1, [r2] + adds r1, r0 + str r3, [r1, 0x8] + movs r0, 0 + str r0, [r1] + str r0, [r1, 0x4] +_080A872E: + movs r1, 0x8E + lsls r1, 1 + adds r0, r4, r1 + ldr r1, [r0] + orrs r1, r5 + str r1, [r0] + movs r2, 0xB8 + lsls r2, 1 + adds r0, r4, r2 + bl sub_80A6688 +_080A8744: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080A874C: .4byte gUnknown_3001B80 + thumb_func_end sub_80A86C8 + + thumb_func_start sub_80A8750 +sub_80A8750: + push {r4,r5,lr} + adds r5, r1, 0 + lsls r0, 16 + asrs r0, 16 + ldr r2, _080A87A8 + lsls r1, r0, 5 + subs r1, r0 + lsls r1, 4 + ldr r0, [r2] + adds r4, r0, r1 + movs r0, 0x2 + ldrsh r1, [r4, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080A87A2 + movs r1, 0x9E + lsls r1, 1 + adds r0, r4, r1 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + bne _080A878C + movs r0, 0xC0 + lsls r0, 6 + ands r0, r5 + cmp r0, 0 + beq _080A878C + bl sub_80AB5A4 +_080A878C: + movs r1, 0x8E + lsls r1, 1 + adds r0, r4, r1 + ldr r1, [r0] + bics r1, r5 + str r1, [r0] + movs r2, 0xB8 + lsls r2, 1 + adds r0, r4, r2 + bl sub_80A6688 +_080A87A2: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080A87A8: .4byte gUnknown_3001B84 + thumb_func_end sub_80A8750 + + thumb_func_start sub_80A87AC +sub_80A87AC: + push {lr} + adds r3, r1, 0 + lsls r0, 16 + asrs r0, 16 + ldr r2, _080A87DC + lsls r1, r0, 5 + subs r1, r0 + lsls r1, 4 + ldr r0, [r2] + adds r2, r0, r1 + movs r0, 0x2 + ldrsh r1, [r2, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080A87D8 + movs r1, 0x90 + lsls r1, 1 + adds r0, r2, r1 + adds r1, r3, 0 + bl sub_809CD8C +_080A87D8: + pop {r0} + bx r0 + .align 2, 0 +_080A87DC: .4byte gUnknown_3001B84 + thumb_func_end sub_80A87AC + + thumb_func_start sub_80A87E0 +sub_80A87E0: + push {r4,lr} + adds r3, r1, 0 + lsls r0, 16 + asrs r0, 16 + ldr r2, _080A8820 + lsls r1, r0, 5 + subs r1, r0 + lsls r1, 4 + ldr r0, [r2] + adds r4, r0, r1 + movs r0, 0x2 + ldrsh r1, [r4, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080A8824 + movs r0, 0x7 + movs r1, 0 + adds r2, r3, 0 + bl sub_809B1C0 + lsls r0, 24 + cmp r0, 0 + beq _080A8824 + movs r1, 0x90 + lsls r1, 1 + adds r0, r4, r1 + movs r1, 0x5 + bl sub_809CD8C + movs r0, 0x1 + b _080A8826 + .align 2, 0 +_080A8820: .4byte gUnknown_3001B84 +_080A8824: + movs r0, 0 +_080A8826: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80A87E0 + + thumb_func_start sub_80A882C +sub_80A882C: + push {lr} + lsls r0, 16 + asrs r0, 16 + ldr r2, _080A8850 + lsls r1, r0, 5 + subs r1, r0 + lsls r1, 4 + ldr r0, [r2] + adds r2, r0, r1 + movs r0, 0x2 + ldrsh r1, [r2, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080A8854 + movs r0, 0 + b _080A8858 + .align 2, 0 +_080A8850: .4byte gUnknown_3001B84 +_080A8854: + adds r0, r2, 0 + adds r0, 0x38 +_080A8858: + pop {r1} + bx r1 + thumb_func_end sub_80A882C + + thumb_func_start sub_80A885C +sub_80A885C: + push {r4,lr} + adds r4, r1, 0 + lsls r0, 16 + asrs r0, 16 + lsls r2, 16 + asrs r3, r2, 16 + ldr r2, _080A8884 + lsls r1, r0, 5 + subs r1, r0 + lsls r1, 4 + ldr r0, [r2] + adds r2, r0, r1 + movs r0, 0x2 + ldrsh r1, [r2, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080A8888 + movs r0, 0 + b _080A8898 + .align 2, 0 +_080A8884: .4byte gUnknown_3001B84 +_080A8888: + adds r0, r2, 0 + adds r0, 0x38 + adds r1, r4, 0 + adds r2, r3, 0 + bl sub_809D6E4 + lsls r0, 24 + lsrs r0, 24 +_080A8898: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80A885C + + thumb_func_start sub_80A88A0 +sub_80A88A0: + push {lr} + lsls r0, 16 + asrs r0, 16 + ldr r2, _080A88C4 + lsls r1, r0, 5 + subs r1, r0 + lsls r1, 4 + ldr r0, [r2] + adds r2, r0, r1 + movs r0, 0x2 + ldrsh r1, [r2, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080A88C8 + movs r0, 0 + b _080A88D4 + .align 2, 0 +_080A88C4: .4byte gUnknown_3001B84 +_080A88C8: + adds r0, r2, 0 + adds r0, 0x38 + bl sub_809D678 + lsls r0, 24 + lsrs r0, 24 +_080A88D4: + pop {r1} + bx r1 + thumb_func_end sub_80A88A0 + + thumb_func_start sub_80A88D8 +sub_80A88D8: + push {r4-r7,lr} + sub sp, 0x4 + adds r4, r0, 0 + adds r7, r1, 0 + adds r6, r2, 0 + lsls r4, 16 + asrs r4, 16 + ldr r1, _080A8914 + lsls r0, r4, 5 + subs r0, r4 + lsls r0, 4 + ldr r1, [r1] + adds r5, r1, r0 + ldr r1, _080A8918 + movs r0, 0x2 + ldrsh r3, [r5, r0] + str r6, [sp] + movs r0, 0 + adds r2, r4, 0 + bl Log + movs r0, 0x2 + ldrsh r1, [r5, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080A891C + movs r0, 0 + b _080A8934 + .align 2, 0 +_080A8914: .4byte gUnknown_3001B84 +_080A8918: .4byte gUnknown_81181B0 +_080A891C: + adds r0, r5, 0 + adds r0, 0x38 + ldr r3, _080A893C + adds r1, r7, 0 + adds r2, r6, 0 + bl sub_809D790 + movs r0, 0xAE + lsls r0, 1 + adds r1, r5, r0 + movs r0, 0x1 + strb r0, [r1] +_080A8934: + add sp, 0x4 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080A893C: .4byte gUnknown_81181F4 + thumb_func_end sub_80A88D8 + + thumb_func_start sub_80A8940 +sub_80A8940: + push {r4,r5,lr} + adds r3, r0, 0 + adds r5, r1, 0 + adds r4, r2, 0 + movs r0, 0xAF + lsls r0, 1 + adds r1, r3, r0 + movs r2, 0 + movs r0, 0xC0 + lsls r0, 2 + strh r0, [r1] + movs r0, 0xB0 + lsls r0, 1 + adds r1, r3, r0 + movs r0, 0x1 + strh r0, [r1] + movs r1, 0xB2 + lsls r1, 1 + adds r0, r3, r1 + str r2, [r0] + movs r0, 0xB4 + lsls r0, 1 + adds r2, r3, r0 + movs r1, 0 + ldrsh r0, [r2, r1] + ldr r1, _080A898C + cmp r0, r1 + beq _080A8984 + strh r1, [r2] + movs r0, 0xAE + lsls r0, 1 + adds r1, r3, r0 + movs r0, 0x1 + strb r0, [r1] +_080A8984: + cmp r4, 0 + bne _080A8990 + movs r0, 0 + b _080A89A2 + .align 2, 0 +_080A898C: .4byte 0x00000807 +_080A8990: + adds r0, r3, 0 + adds r0, 0x38 + ldr r3, _080A89A8 + adds r1, r5, 0 + adds r2, r4, 0 + bl sub_809D790 + lsls r0, 24 + lsrs r0, 24 +_080A89A2: + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080A89A8: .4byte gUnknown_8118218 + thumb_func_end sub_80A8940 + + thumb_func_start sub_80A89AC +sub_80A89AC: + push {r4,lr} + lsls r0, 16 + asrs r0, 16 + ldr r4, _080A89CC + lsls r3, r0, 5 + subs r3, r0 + lsls r3, 4 + ldr r0, [r4] + adds r0, r3 + bl sub_80A8940 + lsls r0, 24 + lsrs r0, 24 + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080A89CC: .4byte gUnknown_3001B84 + thumb_func_end sub_80A89AC + + thumb_func_start sub_80A89D0 +sub_80A89D0: + push {r4-r6,lr} + sub sp, 0x10 + lsls r0, 16 + asrs r2, r0, 16 + lsls r1, 16 + asrs r4, r1, 16 + cmp r2, 0 + blt _080A8A50 + cmp r4, 0 + blt _080A8A50 + ldr r1, _080A8A48 + lsls r0, r2, 5 + subs r0, r2 + lsls r0, 4 + ldr r1, [r1] + adds r5, r1, r0 + lsls r0, r4, 5 + subs r0, r4 + lsls r0, 4 + adds r1, r0 + movs r2, 0x2 + ldrsh r0, [r5, r2] + movs r2, 0x1 + negs r2, r2 + cmp r0, r2 + beq _080A8A50 + movs r3, 0x2 + ldrsh r0, [r1, r3] + cmp r0, r2 + beq _080A8A50 + adds r6, r1, 0 + adds r6, 0x38 + adds r0, r6, 0 + mov r1, sp + movs r2, 0x2 + bl sub_809D6E4 + lsls r0, 24 + cmp r0, 0 + beq _080A8A50 + movs r1, 0x1 + lsls r0, r4, 16 + orrs r0, r1 + str r0, [sp, 0xC] + adds r1, r5, 0 + adds r1, 0x40 + ldr r3, _080A8A4C + adds r0, r6, 0 + movs r2, 0x3 + bl sub_809D8C0 + add r1, sp, 0xC + adds r0, r5, 0 + mov r2, sp + bl sub_80A8940 + lsls r0, 24 + lsrs r0, 24 + b _080A8A52 + .align 2, 0 +_080A8A48: .4byte gUnknown_3001B84 +_080A8A4C: .4byte gUnknown_8118250 +_080A8A50: + movs r0, 0 +_080A8A52: + add sp, 0x10 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80A89D0 + + thumb_func_start sub_80A8A5C +sub_80A8A5C: + push {r4-r6,lr} + sub sp, 0x1C + lsls r0, 16 + asrs r2, r0, 16 + lsls r1, 16 + asrs r5, r1, 16 + cmp r2, 0 + blt _080A8AC0 + cmp r5, 0 + blt _080A8AC0 + ldr r1, _080A8ABC + lsls r0, r2, 5 + subs r0, r2 + lsls r0, 4 + ldr r1, [r1] + adds r6, r1, r0 + adds r0, r5, 0 + mov r1, sp + movs r2, 0x2 + bl sub_80AC274 + lsls r0, 24 + cmp r0, 0 + beq _080A8AC0 + movs r1, 0x2 + lsls r0, r5, 16 + orrs r0, r1 + str r0, [sp, 0x18] + add r4, sp, 0xC + adds r0, r5, 0 + adds r1, r4, 0 + movs r2, 0x3 + bl sub_80AC274 + adds r1, r6, 0 + adds r1, 0x40 + adds r0, r5, 0 + adds r2, r4, 0 + bl sub_80AC2BC + add r1, sp, 0x18 + adds r0, r6, 0 + mov r2, sp + bl sub_80A8940 + lsls r0, 24 + lsrs r0, 24 + b _080A8AC2 + .align 2, 0 +_080A8ABC: .4byte gUnknown_3001B84 +_080A8AC0: + movs r0, 0 +_080A8AC2: + add sp, 0x1C + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80A8A5C + + thumb_func_start sub_80A8ACC +sub_80A8ACC: + push {r4,lr} + sub sp, 0xC + lsls r0, 16 + asrs r2, r0, 16 + lsls r1, 16 + asrs r3, r1, 16 + cmp r2, 0 + blt _080A8B10 + cmp r3, 0 + blt _080A8B10 + ldr r1, _080A8B0C + lsls r0, r2, 5 + subs r0, r2 + lsls r0, 4 + ldr r1, [r1] + adds r4, r1, r0 + adds r0, r3, 0 + mov r1, sp + bl sub_80ADC64 + lsls r0, 24 + cmp r0, 0 + beq _080A8B10 + adds r0, r4, 0 + movs r1, 0 + mov r2, sp + bl sub_80A8940 + lsls r0, 24 + lsrs r0, 24 + b _080A8B12 + .align 2, 0 +_080A8B0C: .4byte gUnknown_3001B84 +_080A8B10: + movs r0, 0 +_080A8B12: + add sp, 0xC + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80A8ACC + + thumb_func_start sub_80A8B1C +sub_80A8B1C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + asrs r7, r0, 16 + ldr r0, _080A8B70 + ldr r4, [r0] + movs r5, 0 + movs r0, 0x1 + negs r0, r0 + mov r8, r0 + movs r6, 0x80 + lsls r6, 9 +_080A8B36: + movs r1, 0x2 + ldrsh r0, [r4, r1] + cmp r0, r8 + beq _080A8B4E + adds r0, r4, 0 + adds r0, 0x38 + adds r1, r7, 0 + bl sub_809D968 + orrs r5, r0 + lsls r0, r5, 24 + lsrs r5, r0, 24 +_080A8B4E: + adds r0, r6, 0 + movs r1, 0x80 + lsls r1, 9 + adds r6, r1 + asrs r0, 16 + movs r1, 0xF8 + lsls r1, 1 + adds r4, r1 + cmp r0, 0x17 + ble _080A8B36 + adds r0, r5, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080A8B70: .4byte gUnknown_3001B84 + thumb_func_end sub_80A8B1C + + thumb_func_start sub_80A8B74 +sub_80A8B74: + push {r4-r7,lr} + ldr r0, _080A8BB8 + ldr r4, [r0] + movs r5, 0 + movs r7, 0x1 + negs r7, r7 + movs r6, 0x80 + lsls r6, 9 +_080A8B84: + movs r1, 0x2 + ldrsh r0, [r4, r1] + cmp r0, r7 + beq _080A8B9A + adds r0, r4, 0 + adds r0, 0x38 + bl sub_809D92C + orrs r5, r0 + lsls r0, r5, 24 + lsrs r5, r0, 24 +_080A8B9A: + adds r0, r6, 0 + movs r1, 0x80 + lsls r1, 9 + adds r6, r1 + asrs r0, 16 + movs r1, 0xF8 + lsls r1, 1 + adds r4, r1 + cmp r0, 0x17 + ble _080A8B84 + adds r0, r5, 0 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080A8BB8: .4byte gUnknown_3001B84 + thumb_func_end sub_80A8B74 + + thumb_func_start sub_80A8BBC +sub_80A8BBC: + lsls r0, 16 + asrs r0, 16 + ldr r2, _080A8BD4 + lsls r1, r0, 5 + subs r1, r0 + lsls r1, 4 + ldr r0, [r2] + adds r0, r1 + movs r1, 0x2 + ldrsh r0, [r0, r1] + bx lr + .align 2, 0 +_080A8BD4: .4byte gUnknown_3001B84 + thumb_func_end sub_80A8BBC + + thumb_func_start sub_80A8BD8 +sub_80A8BD8: + lsls r0, 16 + asrs r0, 16 + ldr r3, _080A8BF8 + lsls r2, r0, 5 + subs r2, r0 + lsls r2, 4 + ldr r0, [r3] + adds r0, r2 + movs r3, 0x8E + lsls r3, 1 + adds r2, r0, r3 + ldr r2, [r2] + str r2, [r1] + movs r1, 0x2 + ldrsh r0, [r0, r1] + bx lr + .align 2, 0 +_080A8BF8: .4byte gUnknown_3001B84 + thumb_func_end sub_80A8BD8 + + thumb_func_start sub_80A8BFC +sub_80A8BFC: + push {lr} + lsls r0, 16 + asrs r0, 16 + ldr r2, _080A8C20 + lsls r1, r0, 5 + subs r1, r0 + lsls r1, 4 + ldr r0, [r2] + adds r2, r0, r1 + movs r0, 0x2 + ldrsh r1, [r2, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080A8C24 + movs r0, 0 + b _080A8C28 + .align 2, 0 +_080A8C20: .4byte gUnknown_3001B84 +_080A8C24: + movs r1, 0x8 + ldrsh r0, [r2, r1] +_080A8C28: + pop {r1} + bx r1 + thumb_func_end sub_80A8BFC + + thumb_func_start sub_80A8C2C +sub_80A8C2C: + push {r4,lr} + sub sp, 0x4 + mov r1, sp + strh r0, [r1] + mov r4, sp + adds r4, 0x2 + mov r0, sp + adds r1, r4, 0 + bl sub_80A7DDC + movs r1, 0 + ldrsh r0, [r4, r1] + add sp, 0x4 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80A8C2C + + thumb_func_start sub_80A8C4C +sub_80A8C4C: + push {r4,r5,lr} + adds r5, r1, 0 + lsls r0, 16 + asrs r0, 16 + ldr r2, _080A8C80 + lsls r1, r0, 5 + subs r1, r0 + lsls r1, 4 + ldr r0, [r2] + adds r4, r0, r1 + movs r0, 0x2 + ldrsh r1, [r4, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080A8C90 + adds r0, r1, 0 + bl sub_80A8D54 + adds r1, r0, 0 + cmp r1, 0 + beq _080A8C84 + ldr r0, [r1, 0x4] + str r0, [r5] + b _080A8C8A + .align 2, 0 +_080A8C80: .4byte gUnknown_3001B84 +_080A8C84: + movs r0, 0x63 + strb r0, [r5] + strb r1, [r5, 0x1] +_080A8C8A: + movs r1, 0x8 + ldrsh r0, [r4, r1] + b _080A8C92 +_080A8C90: + movs r0, 0 +_080A8C92: + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80A8C4C + + thumb_func_start sub_80A8C98 +sub_80A8C98: + push {r4,lr} + lsls r0, 16 + asrs r0, 16 + ldr r2, _080A8CD4 + lsls r1, r0, 5 + subs r1, r0 + lsls r1, 4 + ldr r0, [r2] + adds r3, r0, r1 + movs r0, 0x2 + ldrsh r1, [r3, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080A8CE8 + ldr r1, _080A8CD8 + ldrh r2, [r1] + movs r4, 0 + ldrsh r0, [r1, r4] + cmp r0, 0 + beq _080A8CE8 + movs r0, 0x8 + ldrsh r3, [r3, r0] +_080A8CC6: + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, r3 + bne _080A8CDC + movs r0, 0x1 + b _080A8CEA + .align 2, 0 +_080A8CD4: .4byte gUnknown_3001B84 +_080A8CD8: .4byte gUnknown_8117FCE +_080A8CDC: + adds r1, 0x2 + ldrh r2, [r1] + movs r4, 0 + ldrsh r0, [r1, r4] + cmp r0, 0 + bne _080A8CC6 +_080A8CE8: + movs r0, 0 +_080A8CEA: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80A8C98 + + thumb_func_start sub_80A8CF0 +sub_80A8CF0: + push {r4,lr} + lsls r0, 16 + asrs r3, r0, 16 + ldr r1, _080A8CFC + b _080A8D0E + .align 2, 0 +_080A8CFC: .4byte gUnknown_8117FCE +_080A8D00: + lsls r0, r2, 16 + asrs r0, 16 + cmp r0, r3 + bne _080A8D0C + movs r0, 0x1 + b _080A8D1A +_080A8D0C: + adds r1, 0x2 +_080A8D0E: + ldrh r2, [r1] + movs r4, 0 + ldrsh r0, [r1, r4] + cmp r0, 0 + bne _080A8D00 + movs r0, 0 +_080A8D1A: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80A8CF0 + + thumb_func_start sub_80A8D20 +sub_80A8D20: + push {lr} + movs r0, 0 + bl sub_80A7AE8 + lsls r0, 16 + asrs r0, 16 + ldr r2, _080A8D50 + lsls r1, r0, 5 + subs r1, r0 + lsls r1, 4 + ldr r0, [r2] + adds r0, r1 + movs r1, 0x90 + lsls r1, 1 + adds r0, r1 + bl sub_809CDB8 + movs r1, 0 + cmp r0, 0x1 + bne _080A8D4A + movs r1, 0x1 +_080A8D4A: + adds r0, r1, 0 + pop {r1} + bx r1 + .align 2, 0 +_080A8D50: .4byte gUnknown_3001B84 + thumb_func_end sub_80A8D20 + + thumb_func_start sub_80A8D54 +sub_80A8D54: + push {r4,r5,lr} + sub sp, 0x14 + mov r1, sp + strh r0, [r1] + mov r0, sp + bl sub_80A7B94 + mov r0, sp + ldrh r1, [r0] + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0x1 + beq _080A8D76 + cmp r0, 0x6 + beq _080A8D76 + cmp r0, 0x21 + bne _080A8D7C +_080A8D76: + bl sub_808D3BC + b _080A8E94 +_080A8D7C: + cmp r0, 0x2 + beq _080A8D88 + cmp r0, 0x7 + beq _080A8D88 + cmp r0, 0x22 + bne _080A8D8E +_080A8D88: + bl sub_808D3F8 + b _080A8E94 +_080A8D8E: + cmp r0, 0x3 + beq _080A8D9A + cmp r0, 0x8 + beq _080A8D9A + cmp r0, 0x23 + bne _080A8DA0 +_080A8D9A: + bl sub_808D33C + b _080A8E94 +_080A8DA0: + adds r0, r1, 0 + subs r0, 0xA + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x3 + bhi _080A8DF8 + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + adds r5, r0, 0 + subs r5, 0xA + bl sub_8098F88 + lsls r0, 24 + cmp r0, 0 + bne _080A8E92 + movs r0, 0x9 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _080A8DD6 + add r4, sp, 0x4 + adds r0, r4, 0 + bl sub_808D6A4 + b _080A8DDE +_080A8DD6: + add r4, sp, 0x4 + adds r0, r4, 0 + bl sub_808D654 +_080A8DDE: + cmp r5, r0 + bge _080A8E92 + ldr r2, _080A8DF4 + lsls r0, r5, 2 + adds r0, r4, r0 + ldr r1, [r0] + movs r0, 0x58 + muls r1, r0 + ldr r0, [r2] + adds r0, r1 + b _080A8E94 + .align 2, 0 +_080A8DF4: .4byte gUnknown_203B45C +_080A8DF8: + adds r0, r1, 0 + subs r0, 0xE + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0xF + bhi _080A8E92 + movs r0, 0 + movs r1, 0x10 + bl sub_8001658 + lsls r0, 16 + asrs r0, 16 + bl sub_8002658 + lsls r0, 24 + lsrs r1, r0, 24 + cmp r1, 0 + beq _080A8E92 + mov r0, sp + movs r2, 0 + ldrsh r0, [r0, r2] + adds r5, r0, 0 + subs r5, 0xE + add r4, sp, 0x4 + adds r0, r1, 0 + adds r1, r4, 0 + movs r2, 0 + movs r3, 0 + bl sub_8092638 + movs r1, 0 + ldrsh r0, [r4, r1] + cmp r5, r0 + bge _080A8E92 + ldr r2, _080A8E6C + ldr r0, [r4, 0x8] + adds r0, r5 + movs r1, 0x58 + muls r1, r0 + ldr r0, [r2] + adds r4, r0, r1 + movs r0, 0x9 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + beq _080A8E70 + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080A8E92 + ldrb r0, [r4, 0x2] + cmp r0, 0 + bne _080A8E92 + adds r0, r4, 0 + b _080A8E94 + .align 2, 0 +_080A8E6C: .4byte gUnknown_203B45C +_080A8E70: + ldrb r1, [r4] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080A8E92 + ldrb r0, [r4, 0x2] + cmp r0, 0 + bne _080A8E92 + movs r1, 0 + ldrb r0, [r4, 0x4] + cmp r0, 0x41 + bne _080A8E8A + movs r1, 0x1 +_080A8E8A: + cmp r1, 0 + bne _080A8E92 + adds r0, r4, 0 + b _080A8E94 +_080A8E92: + movs r0, 0 +_080A8E94: + add sp, 0x14 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80A8D54 + + thumb_func_start sub_80A8E9C +sub_80A8E9C: + push {lr} + lsls r0, 16 + asrs r0, 16 + ldr r2, _080A8EBC + lsls r1, r0, 5 + subs r1, r0 + lsls r1, 4 + ldr r0, [r2] + adds r0, r1 + movs r1, 0x2 + ldrsh r0, [r0, r1] + bl sub_80A8D54 + pop {r1} + bx r1 + .align 2, 0 +_080A8EBC: .4byte gUnknown_3001B84 + thumb_func_end sub_80A8E9C + + thumb_func_start sub_80A8EC0 +sub_80A8EC0: + push {r4,r5,lr} + sub sp, 0x4 + adds r4, r0, 0 + mov r0, sp + strh r1, [r0] + mov r5, sp + adds r5, 0x2 + adds r1, r5, 0 + bl sub_80A7DDC + mov r0, sp + movs r1, 0 + ldrsh r0, [r0, r1] + bl sub_80A8D54 + cmp r0, 0 + beq _080A8EF0 + adds r1, r0, 0 + adds r1, 0x4C + adds r0, r4, 0 + movs r2, 0xA + bl sub_80922B4 + b _080A8F44 +_080A8EF0: + mov r0, sp + movs r2, 0 + ldrsh r1, [r0, r2] + cmp r1, 0x20 + bne _080A8F00 + movs r0, 0 + ldrsh r1, [r5, r0] + b _080A8F34 +_080A8F00: + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080A8F3C + mov r0, sp + movs r1, 0 + ldrsh r2, [r0, r1] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 2 + ldr r1, _080A8F2C + adds r0, r1 + cmp r2, 0x34 + beq _080A8F20 + cmp r2, 0x64 + bne _080A8F30 +_080A8F20: + ldr r1, [r0, 0x4] + adds r0, r4, 0 + bl strcpy + b _080A8F44 + .align 2, 0 +_080A8F2C: .4byte gUnknown_811E63C +_080A8F30: + movs r2, 0x2 + ldrsh r1, [r0, r2] +_080A8F34: + adds r0, r4, 0 + bl sub_808D8BC + b _080A8F44 +_080A8F3C: + ldr r1, _080A8F4C + adds r0, r4, 0 + bl strcpy +_080A8F44: + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080A8F4C: .4byte gUnknown_811825C + thumb_func_end sub_80A8EC0 + + thumb_func_start sub_80A8F50 +sub_80A8F50: + push {r4,r5,lr} + sub sp, 0x80 + adds r4, r0, 0 + adds r5, r2, 0 + lsls r1, 16 + asrs r1, 16 + mov r0, sp + bl sub_80A8EC0 + adds r0, r4, 0 + mov r1, sp + adds r2, r5, 0 + bl sub_8092310 + add sp, 0x80 + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80A8F50 + + thumb_func_start sub_80A8F74 +sub_80A8F74: + push {lr} + adds r3, r1, 0 + lsls r0, 16 + asrs r0, 16 + ldr r2, _080A8F98 + lsls r1, r0, 5 + subs r1, r0 + lsls r1, 4 + ldr r0, [r2] + adds r0, r1 + movs r2, 0x2 + ldrsh r1, [r0, r2] + adds r0, r3, 0 + bl sub_80A8EC0 + pop {r0} + bx r0 + .align 2, 0 +_080A8F98: .4byte gUnknown_3001B84 + thumb_func_end sub_80A8F74 + + thumb_func_start sub_80A8F9C +sub_80A8F9C: + push {lr} + adds r3, r1, 0 + lsls r0, 16 + asrs r0, 16 + ldr r2, _080A8FC4 + lsls r1, r0, 5 + subs r1, r0 + lsls r1, 4 + ldr r0, [r2] + adds r2, r0, r1 + movs r0, 0x2 + ldrsh r1, [r2, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080A8FC8 + movs r0, 0 + str r0, [r3] + str r0, [r3, 0x4] + b _080A8FD0 + .align 2, 0 +_080A8FC4: .4byte gUnknown_3001B84 +_080A8FC8: + ldr r0, [r2, 0xC] + ldr r1, [r2, 0x10] + str r0, [r3] + str r1, [r3, 0x4] +_080A8FD0: + movs r1, 0x2 + ldrsh r0, [r2, r1] + pop {r1} + bx r1 + thumb_func_end sub_80A8F9C + + thumb_func_start sub_80A8FD8 +sub_80A8FD8: + push {lr} + adds r3, r1, 0 + lsls r0, 16 + asrs r0, 16 + ldr r2, _080A9000 + lsls r1, r0, 5 + subs r1, r0 + lsls r1, 4 + ldr r0, [r2] + adds r2, r0, r1 + movs r0, 0x2 + ldrsh r1, [r2, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080A9004 + movs r0, 0 + str r0, [r3] + b _080A901E + .align 2, 0 +_080A9000: .4byte gUnknown_3001B84 +_080A9004: + movs r1, 0xA2 + lsls r1, 1 + adds r0, r2, r1 + ldr r0, [r0] + ldr r1, [r2, 0x14] + adds r0, r1 + str r0, [r3] + movs r1, 0xA4 + lsls r1, 1 + adds r0, r2, r1 + ldr r0, [r0] + ldr r1, [r2, 0x18] + adds r0, r1 +_080A901E: + str r0, [r3, 0x4] + movs r1, 0x2 + ldrsh r0, [r2, r1] + pop {r1} + bx r1 + thumb_func_end sub_80A8FD8 + + thumb_func_start sub_80A9028 +sub_80A9028: + push {r4,lr} + lsls r0, 16 + asrs r0, 16 + ldr r3, _080A904C + lsls r2, r0, 5 + subs r2, r0 + lsls r2, 4 + ldr r4, [r3] + adds r4, r2 + adds r0, r4, 0 + bl sub_80A9F20 + movs r1, 0x2 + ldrsh r0, [r4, r1] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080A904C: .4byte gUnknown_3001B84 + thumb_func_end sub_80A9028 + + thumb_func_start sub_80A9050 +sub_80A9050: + push {r4,lr} + adds r4, r1, 0 + lsls r0, 16 + asrs r0, 16 + ldr r2, _080A9078 + lsls r1, r0, 5 + subs r1, r0 + lsls r1, 4 + ldr r0, [r2] + adds r2, r0, r1 + movs r0, 0x2 + ldrsh r1, [r2, r0] + movs r0, 0x1 + negs r0, r0 + adds r3, r0, 0 + cmp r1, r0 + bne _080A907C + strb r3, [r4] + b _080A9086 + .align 2, 0 +_080A9078: .4byte gUnknown_3001B84 +_080A907C: + movs r1, 0xA1 + lsls r1, 1 + adds r0, r2, r1 + ldrb r0, [r0] + strb r0, [r4] +_080A9086: + movs r1, 0x2 + ldrsh r0, [r2, r1] + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80A9050 + + thumb_func_start sub_80A9090 +sub_80A9090: + push {lr} + lsls r0, 16 + asrs r0, 16 + lsls r1, 24 + asrs r3, r1, 24 + ldr r2, _080A90C4 + lsls r1, r0, 5 + subs r1, r0 + lsls r1, 4 + ldr r0, [r2] + adds r2, r0, r1 + movs r0, 0x2 + ldrsh r1, [r2, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080A90BA + movs r1, 0xA1 + lsls r1, 1 + adds r0, r2, r1 + strb r3, [r0] +_080A90BA: + movs r1, 0x2 + ldrsh r0, [r2, r1] + pop {r1} + bx r1 + .align 2, 0 +_080A90C4: .4byte gUnknown_3001B84 + thumb_func_end sub_80A9090 + + thumb_func_start sub_80A90C8 +sub_80A90C8: + lsls r0, 16 + asrs r0, 16 + ldr r2, _080A90E4 + lsls r1, r0, 5 + subs r1, r0 + lsls r1, 4 + ldr r0, [r2] + adds r0, r1 + movs r1, 0xA0 + lsls r1, 1 + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + bx lr + .align 2, 0 +_080A90E4: .4byte gUnknown_3001B84 + thumb_func_end sub_80A90C8 + + thumb_func_start sub_80A90E8 +sub_80A90E8: + push {r4,r5,lr} + sub sp, 0x10 + lsls r0, 16 + asrs r2, r0, 16 + lsls r1, 16 + asrs r3, r1, 16 + cmp r2, r3 + beq _080A9196 + ldr r1, _080A916C + lsls r0, r2, 5 + subs r0, r2 + lsls r0, 4 + ldr r1, [r1] + adds r5, r1, r0 + lsls r0, r3, 5 + subs r0, r3 + lsls r0, 4 + adds r4, r1, r0 + movs r1, 0x2 + ldrsh r0, [r5, r1] + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080A9196 + movs r2, 0x2 + ldrsh r0, [r4, r2] + cmp r0, r1 + beq _080A9196 + movs r3, 0xA2 + lsls r3, 1 + adds r0, r5, r3 + ldr r0, [r0] + ldr r1, [r5, 0x14] + adds r0, r1 + str r0, [sp] + movs r2, 0xA4 + lsls r2, 1 + adds r0, r5, r2 + ldr r0, [r0] + ldr r1, [r5, 0x18] + adds r0, r1 + str r0, [sp, 0x4] + adds r3, r4, r3 + ldr r0, [r3] + ldr r1, [r4, 0x14] + adds r0, r1 + str r0, [sp, 0x8] + adds r2, r4, r2 + ldr r0, [r2] + ldr r1, [r4, 0x18] + adds r0, r1 + add r2, sp, 0x8 + str r0, [r2, 0x4] + movs r1, 0x2 + ldrsh r0, [r5, r1] + cmp r0, 0x24 + bgt _080A9170 + adds r1, r5, 0 + adds r1, 0xC + adds r3, r4, 0 + adds r3, 0xC + mov r0, sp + bl sub_8002DF0 + b _080A917E + .align 2, 0 +_080A916C: .4byte gUnknown_3001B84 +_080A9170: + adds r1, r5, 0 + adds r1, 0xC + adds r3, r4, 0 + adds r3, 0xC + mov r0, sp + bl sub_8002D54 +_080A917E: + lsls r0, 24 + asrs r1, r0, 24 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080A9196 + movs r2, 0xA1 + lsls r2, 1 + adds r0, r5, r2 + strb r1, [r0] + movs r0, 0x1 + b _080A9198 +_080A9196: + movs r0, 0 +_080A9198: + add sp, 0x10 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80A90E8 + + thumb_func_start sub_80A91A0 +sub_80A91A0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + lsls r0, 16 + asrs r2, r0, 16 + lsls r1, 16 + asrs r4, r1, 16 + cmp r2, r4 + beq _080A928E + ldr r1, _080A9260 + lsls r0, r2, 5 + subs r0, r2 + lsls r0, 4 + ldr r1, [r1] + adds r7, r1, r0 + lsls r0, r4, 5 + subs r0, r4 + lsls r0, 4 + adds r1, r0 + mov r8, r1 + movs r1, 0x2 + ldrsh r0, [r7, r1] + movs r2, 0x1 + negs r2, r2 + mov r10, r2 + cmp r0, r10 + beq _080A928E + mov r3, r8 + movs r1, 0x2 + ldrsh r0, [r3, r1] + cmp r0, r10 + beq _080A928E + movs r3, 0xA2 + lsls r3, 1 + adds r0, r7, r3 + ldr r0, [r0] + ldr r1, [r7, 0x14] + adds r0, r1 + str r0, [sp] + movs r2, 0xA4 + lsls r2, 1 + adds r0, r7, r2 + ldr r0, [r0] + ldr r1, [r7, 0x18] + adds r0, r1 + str r0, [sp, 0x4] + add r3, r8 + ldr r0, [r3] + mov r3, r8 + ldr r1, [r3, 0x14] + adds r0, r1 + str r0, [sp, 0x8] + add r2, r8 + ldr r0, [r2] + ldr r1, [r3, 0x18] + adds r0, r1 + add r4, sp, 0x8 + str r0, [r4, 0x4] + adds r5, r7, 0 + adds r5, 0xC + mov r6, r8 + adds r6, 0xC + mov r0, sp + adds r1, r5, 0 + adds r2, r4, 0 + adds r3, r6, 0 + bl sub_8002DF0 + lsls r0, 24 + asrs r0, 24 + mov r9, r0 + mov r0, sp + adds r1, r5, 0 + adds r2, r4, 0 + adds r3, r6, 0 + bl sub_8002D54 + lsls r0, 24 + asrs r1, r0, 24 + cmp r9, r10 + beq _080A928E + cmp r1, r10 + beq _080A928E + movs r2, 0x2 + ldrsh r0, [r7, r2] + cmp r0, 0x24 + bgt _080A9264 + movs r3, 0xA1 + lsls r3, 1 + adds r0, r7, r3 + mov r2, r9 + strb r2, [r0] + b _080A926C + .align 2, 0 +_080A9260: .4byte gUnknown_3001B84 +_080A9264: + movs r3, 0xA1 + lsls r3, 1 + adds r0, r7, r3 + strb r1, [r0] +_080A926C: + mov r2, r8 + movs r3, 0x2 + ldrsh r0, [r2, r3] + cmp r0, 0x25 + bgt _080A927A + mov r0, r9 + b _080A927C +_080A927A: + adds r0, r1, 0 +_080A927C: + movs r1, 0x5 + bl sub_8002984 + movs r1, 0xA1 + lsls r1, 1 + add r1, r8 + strb r0, [r1] + movs r0, 0x1 + b _080A9290 +_080A928E: + movs r0, 0 +_080A9290: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80A91A0 + + thumb_func_start sub_80A92A0 +sub_80A92A0: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r9, r1 + adds r4, r2, 0 + lsls r0, 16 + asrs r6, r0, 16 + ldr r0, _080A931C + ldr r0, [r0] + mov r12, r0 + movs r2, 0 + movs r0, 0x1 + negs r0, r0 + mov r8, r0 + movs r5, 0x80 + lsls r5, 9 +_080A92C2: + cmp r2, r6 + beq _080A9320 + mov r1, r12 + movs r7, 0x2 + ldrsh r0, [r1, r7] + cmp r0, r8 + beq _080A9320 + movs r0, 0x8E + lsls r0, 1 + add r0, r12 + ldr r0, [r0] + mov r1, r9 + ands r0, r1 + cmp r0, 0 + beq _080A9320 + movs r0, 0xA2 + lsls r0, 1 + add r0, r12 + ldr r1, [r0] + ldr r0, [r3] + cmp r1, r0 + bge _080A9320 + movs r0, 0xA6 + lsls r0, 1 + add r0, r12 + ldr r1, [r0] + ldr r0, [r4] + cmp r1, r0 + ble _080A9320 + movs r0, 0xA4 + lsls r0, 1 + add r0, r12 + ldr r1, [r0] + ldr r0, [r3, 0x4] + cmp r1, r0 + bge _080A9320 + movs r0, 0xA8 + lsls r0, 1 + add r0, r12 + ldr r1, [r0] + ldr r0, [r4, 0x4] + cmp r1, r0 + ble _080A9320 + adds r0, r2, 0 + b _080A9338 + .align 2, 0 +_080A931C: .4byte gUnknown_3001B84 +_080A9320: + adds r0, r5, 0 + movs r7, 0x80 + lsls r7, 9 + adds r5, r7 + asrs r2, r0, 16 + movs r0, 0xF8 + lsls r0, 1 + add r12, r0 + cmp r2, 0x17 + ble _080A92C2 + movs r0, 0x1 + negs r0, r0 +_080A9338: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80A92A0 + + thumb_func_start sub_80A9344 +sub_80A9344: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + mov r9, r1 + str r2, [sp] + adds r5, r3, 0 + lsls r0, 16 + asrs r0, 16 + mov r8, r0 + ldr r0, _080A93C4 + ldr r0, [r0] + mov r12, r0 + movs r4, 0 + movs r0, 0x1 + negs r0, r0 + mov r10, r0 + movs r7, 0x80 + lsls r7, 9 +_080A936E: + cmp r4, r8 + beq _080A93C8 + mov r1, r12 + movs r2, 0x2 + ldrsh r0, [r1, r2] + cmp r0, r10 + beq _080A93C8 + movs r0, 0x8E + lsls r0, 1 + add r0, r12 + ldr r0, [r0] + mov r6, r9 + ands r0, r6 + cmp r0, 0 + beq _080A93C8 + movs r0, 0xA2 + lsls r0, 1 + add r0, r12 + ldr r1, [r0] + mov r6, r12 + ldr r0, [r6, 0x14] + adds r2, r1, r0 + movs r0, 0xA4 + lsls r0, 1 + add r0, r12 + ldr r1, [r0] + ldr r0, [r6, 0x18] + adds r3, r1, r0 + ldr r0, [r5] + cmp r2, r0 + bge _080A93C8 + ldr r1, [sp] + ldr r0, [r1] + cmp r2, r0 + ble _080A93C8 + ldr r0, [r5, 0x4] + cmp r3, r0 + bge _080A93C8 + ldr r0, [r1, 0x4] + cmp r3, r0 + ble _080A93C8 + adds r0, r4, 0 + b _080A93E0 + .align 2, 0 +_080A93C4: .4byte gUnknown_3001B84 +_080A93C8: + adds r0, r7, 0 + movs r2, 0x80 + lsls r2, 9 + adds r7, r2 + asrs r4, r0, 16 + movs r6, 0xF8 + lsls r6, 1 + add r12, r6 + cmp r4, 0x17 + ble _080A936E + movs r0, 0x1 + negs r0, r0 +_080A93E0: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80A9344 + + thumb_func_start sub_80A93F0 +sub_80A93F0: + push {r4-r7,lr} + sub sp, 0x10 + lsls r0, 16 + asrs r0, 16 + lsls r1, 24 + lsrs r6, r1, 24 + ldr r2, _080A947C + lsls r1, r0, 5 + subs r1, r0 + lsls r1, 4 + ldr r0, [r2] + adds r0, r1 + mov r12, r0 + movs r0, 0xA2 + lsls r0, 1 + add r0, r12 + ldr r0, [r0] + cmp r0, 0 + bge _080A941A + ldr r1, _080A9480 + adds r0, r1 +_080A941A: + asrs r5, r0, 11 + str r5, [sp] + movs r0, 0xA4 + lsls r0, 1 + add r0, r12 + ldr r0, [r0] + cmp r0, 0 + bge _080A942E + ldr r7, _080A9480 + adds r0, r7 +_080A942E: + asrs r4, r0, 11 + str r4, [sp, 0x4] + movs r0, 0xA6 + lsls r0, 1 + add r0, r12 + ldr r0, [r0] + subs r1, r0, 0x1 + cmp r1, 0 + bge _080A9444 + ldr r7, _080A9484 + adds r1, r0, r7 +_080A9444: + asrs r2, r1, 11 + movs r0, 0xA8 + lsls r0, 1 + add r0, r12 + ldr r0, [r0] + subs r1, r0, 0x1 + cmp r1, 0 + bge _080A9458 + ldr r7, _080A9484 + adds r1, r0, r7 +_080A9458: + asrs r3, r1, 11 + subs r0, r2, r5 + adds r0, 0x1 + str r0, [sp, 0x8] + subs r0, r3, r4 + adds r0, 0x1 + add r2, sp, 0x8 + str r0, [r2, 0x4] + adds r0, r6, 0 + mov r1, sp + bl sub_80A5934 + lsls r0, 24 + lsrs r0, 24 + add sp, 0x10 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080A947C: .4byte gUnknown_3001B84 +_080A9480: .4byte 0x000007ff +_080A9484: .4byte 0x000007fe + thumb_func_end sub_80A93F0 + + thumb_func_start sub_80A9488 +sub_80A9488: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + adds r5, r0, 0 + adds r7, r1, 0 + mov r8, r2 + ldr r0, [r7] + cmp r0, 0 + bge _080A94A0 + ldr r1, _080A9528 + adds r0, r1 +_080A94A0: + asrs r0, 11 + mov r12, r0 + str r0, [sp] + ldr r0, [r7, 0x4] + cmp r0, 0 + bge _080A94B0 + ldr r3, _080A9528 + adds r0, r3 +_080A94B0: + asrs r4, r0, 11 + str r4, [sp, 0x4] + mov r6, r8 + ldr r3, [r6] + subs r0, r3, 0x1 + cmp r0, 0 + bge _080A94C2 + ldr r6, _080A952C + adds r0, r3, r6 +_080A94C2: + asrs r1, r0, 11 + mov r0, r8 + ldr r3, [r0, 0x4] + subs r0, r3, 0x1 + cmp r0, 0 + bge _080A94D2 + ldr r6, _080A952C + adds r0, r3, r6 +_080A94D2: + asrs r2, r0, 11 + mov r3, r12 + subs r0, r1, r3 + adds r0, 0x1 + str r0, [sp, 0x8] + subs r0, r2, r4 + adds r0, 0x1 + add r2, sp, 0x8 + str r0, [r2, 0x4] + movs r6, 0x8E + lsls r6, 1 + adds r0, r5, r6 + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + adds r4, r2, 0 + cmp r0, 0 + beq _080A9504 + mov r0, sp + adds r1, r4, 0 + bl sub_80A585C + lsls r0, 24 + cmp r0, 0 + bne _080A9522 +_080A9504: + movs r1, 0x8E + lsls r1, 1 + adds r0, r5, r1 + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080A9530 + mov r0, sp + adds r1, r4, 0 + bl sub_80A58C8 + lsls r0, 24 + cmp r0, 0 + beq _080A9530 +_080A9522: + movs r0, 0x1 + b _080A95A0 + .align 2, 0 +_080A9528: .4byte 0x000007ff +_080A952C: .4byte 0x000007fe +_080A9530: + movs r3, 0x8E + lsls r3, 1 + adds r0, r5, r3 + ldr r0, [r0] + movs r1, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080A9556 + movs r6, 0 + ldrsh r0, [r5, r6] + adds r2, r7, 0 + mov r3, r8 + bl sub_80A92A0 + lsls r0, 16 + cmp r0, 0 + blt _080A9556 + movs r0, 0x4 + b _080A95A0 +_080A9556: + movs r1, 0x8E + lsls r1, 1 + adds r0, r5, r1 + ldr r0, [r0] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080A957A + movs r0, 0x4 + adds r1, r7, 0 + mov r2, r8 + bl sub_80AC4C8 + lsls r0, 16 + cmp r0, 0 + blt _080A957A + movs r0, 0x8 + b _080A95A0 +_080A957A: + movs r3, 0x8E + lsls r3, 1 + adds r0, r5, r3 + ldr r0, [r0] + movs r1, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080A959E + movs r0, 0x40 + adds r1, r7, 0 + mov r2, r8 + bl sub_80ADCA0 + lsls r0, 16 + cmp r0, 0 + blt _080A959E + movs r0, 0x10 + b _080A95A0 +_080A959E: + movs r0, 0 +_080A95A0: + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80A9488 + + thumb_func_start sub_80A95AC +sub_80A95AC: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + adds r5, r0, 0 + adds r7, r1, 0 + mov r8, r2 + ldr r0, [r7] + cmp r0, 0 + bge _080A95C6 + ldr r1, _080A96BC + adds r0, r1 +_080A95C6: + asrs r0, 11 + mov r9, r0 + str r0, [sp] + ldr r0, [r7, 0x4] + cmp r0, 0 + bge _080A95D6 + ldr r2, _080A96BC + adds r0, r2 +_080A95D6: + asrs r4, r0, 11 + str r4, [sp, 0x4] + mov r6, r8 + ldr r3, [r6] + subs r0, r3, 0x1 + cmp r0, 0 + bge _080A95E8 + ldr r6, _080A96C0 + adds r0, r3, r6 +_080A95E8: + asrs r1, r0, 11 + mov r0, r8 + ldr r3, [r0, 0x4] + subs r0, r3, 0x1 + cmp r0, 0 + bge _080A95F8 + ldr r6, _080A96C0 + adds r0, r3, r6 +_080A95F8: + asrs r2, r0, 11 + mov r3, r9 + subs r0, r1, r3 + adds r0, 0x1 + str r0, [sp, 0x8] + subs r0, r2, r4 + adds r0, 0x1 + add r2, sp, 0x8 + str r0, [r2, 0x4] + movs r6, 0x8E + lsls r6, 1 + adds r0, r5, r6 + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + adds r4, r2, 0 + cmp r0, 0 + beq _080A962C + mov r0, sp + adds r1, r4, 0 + bl sub_80A585C + lsls r0, 24 + cmp r0, 0 + beq _080A962C + b _080A973C +_080A962C: + movs r1, 0x8E + lsls r1, 1 + adds r0, r5, r1 + ldr r0, [r0] + movs r1, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080A964A + mov r0, sp + adds r1, r4, 0 + bl sub_80A58C8 + lsls r0, 24 + cmp r0, 0 + bne _080A973C +_080A964A: + movs r4, 0x8E + lsls r4, 1 + adds r0, r5, r4 + ldr r0, [r0] + movs r1, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080A96C8 + movs r2, 0 + ldrsh r0, [r5, r2] + movs r1, 0x44 + adds r2, r7, 0 + mov r3, r8 + bl sub_80A92A0 + lsls r0, 16 + asrs r2, r0, 16 + mov r9, r2 + cmp r2, 0 + blt _080A96C8 + ldr r1, _080A96C4 + lsls r0, r2, 5 + subs r0, r2 + lsls r0, 4 + ldr r1, [r1] + adds r6, r1, r0 + adds r0, r6, r4 + ldr r1, [r0] + movs r0, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080A973C + movs r0, 0x80 + lsls r0, 2 + ands r1, r0 + cmp r1, 0 + beq _080A96A8 + adds r4, 0x26 + adds r0, r5, r4 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x5 + bl sub_8002984 + adds r4, r6, r4 + strb r0, [r4] +_080A96A8: + movs r3, 0 + ldrsh r0, [r5, r3] + mov r1, r9 + bl sub_80A89D0 +_080A96B2: + lsls r0, 24 + cmp r0, 0 + bne _080A9738 + b _080A973C + .align 2, 0 +_080A96BC: .4byte 0x000007ff +_080A96C0: .4byte 0x000007fe +_080A96C4: .4byte gUnknown_3001B84 +_080A96C8: + movs r6, 0x8E + lsls r6, 1 + adds r0, r5, r6 + ldr r0, [r0] + movs r1, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080A9708 + movs r0, 0x44 + adds r1, r7, 0 + mov r2, r8 + bl sub_80AC4C8 + lsls r0, 16 + asrs r4, r0, 16 + cmp r4, 0 + blt _080A9708 + add r1, sp, 0x10 + adds r0, r4, 0 + bl sub_80AC3E0 + ldr r0, [sp, 0x10] + movs r1, 0x40 + ands r0, r1 + cmp r0, 0 + beq _080A973C + movs r1, 0 + ldrsh r0, [r5, r1] + adds r1, r4, 0 + bl sub_80A8A5C + b _080A96B2 +_080A9708: + movs r2, 0x8E + lsls r2, 1 + adds r0, r5, r2 + ldr r0, [r0] + movs r1, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080A9740 + movs r0, 0x40 + adds r1, r7, 0 + mov r2, r8 + bl sub_80ADCA0 + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0 + blt _080A9740 + movs r3, 0 + ldrsh r0, [r5, r3] + bl sub_80A8ACC + lsls r0, 24 + cmp r0, 0 + beq _080A973C +_080A9738: + movs r0, 0x2 + b _080A9742 +_080A973C: + movs r0, 0x1 + b _080A9742 +_080A9740: + movs r0, 0 +_080A9742: + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80A95AC + + thumb_func_start sub_80A9750 +sub_80A9750: + push {r4,lr} + mov r12, r0 + lsls r1, 16 + lsrs r1, 16 + adds r4, r1, 0 + movs r3, 0xFF + ands r3, r1 + movs r2, 0xF0 + lsls r2, 4 + ands r2, r1 + cmp r3, 0 + beq _080A9770 + movs r0, 0xB0 + lsls r0, 1 + add r0, r12 + strh r3, [r0] +_080A9770: + cmp r2, 0 + beq _080A977C + movs r0, 0xAF + lsls r0, 1 + add r0, r12 + strh r2, [r0] +_080A977C: + movs r2, 0xB0 + lsls r2, 1 + add r2, r12 + ldrh r0, [r2] + cmp r0, 0x1 + bne _080A97A8 + movs r0, 0x80 + lsls r0, 5 + cmp r1, r0 + beq _080A97B6 + movs r0, 0xB2 + lsls r0, 1 + add r0, r12 + ldr r0, [r0] + ldr r2, _080A97A4 + cmp r0, 0 + bgt _080A97A0 + b _080A9E98 +_080A97A0: + b _080A97C0 + .align 2, 0 +_080A97A4: .4byte 0x00000807 +_080A97A8: + cmp r0, 0x2 + beq _080A97AE + b _080A9E8C +_080A97AE: + movs r0, 0x80 + lsls r0, 5 + cmp r4, r0 + bne _080A97C6 +_080A97B6: + movs r1, 0xB2 + lsls r1, 1 + add r1, r12 + movs r0, 0x4 + str r0, [r1] +_080A97C0: + movs r2, 0x80 + lsls r2, 4 + b _080A9E98 +_080A97C6: + movs r0, 0xB2 + lsls r0, 1 + add r0, r12 + ldr r0, [r0] + cmp r0, 0 + bgt _080A97C0 + mov r1, r12 + ldrh r0, [r1, 0x8] + subs r0, 0xC + lsls r0, 16 + asrs r1, r0, 16 + ldr r0, _080A97F0 + cmp r1, r0 + bls _080A97E4 + b _080A9E7E +_080A97E4: + lsls r0, r1, 2 + ldr r1, _080A97F4 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080A97F0: .4byte 0x00000197 +_080A97F4: .4byte _080A97F8 + .align 2, 0 +_080A97F8: + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E60 + .4byte _080A9E60 + .4byte _080A9E7E + .4byte _080A9E60 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E60 + .4byte _080A9E60 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E68 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E60 + .4byte _080A9E60 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E60 + .4byte _080A9E60 + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E60 + .4byte _080A9E60 + .4byte _080A9E7E + .4byte _080A9E60 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E60 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E60 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E60 + .4byte _080A9E60 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E60 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E60 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E60 + .4byte _080A9E60 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E60 + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E60 + .4byte _080A9E60 + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E60 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E60 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E7E + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 + .4byte _080A9E58 +_080A9E58: + ldr r2, _080A9E5C + b _080A9E98 + .align 2, 0 +_080A9E5C: .4byte 0x00000807 +_080A9E60: + ldr r2, _080A9E64 + b _080A9E98 + .align 2, 0 +_080A9E64: .4byte 0x00000307 +_080A9E68: + movs r0, 0xB4 + lsls r0, 1 + add r0, r12 + movs r2, 0 + ldrsh r1, [r0, r2] + ldr r2, _080A9E84 + cmp r1, r2 + beq _080A9E98 + ldr r0, _080A9E88 + cmp r1, r0 + beq _080A9E98 +_080A9E7E: + movs r2, 0xC0 + lsls r2, 2 + b _080A9E98 + .align 2, 0 +_080A9E84: .4byte 0x00000807 +_080A9E88: .4byte 0x00000307 +_080A9E8C: + ldr r1, _080A9EC4 + ldrh r0, [r2] + lsls r0, 1 + adds r0, r1 + movs r4, 0 + ldrsh r2, [r0, r4] +_080A9E98: + movs r0, 0xE0 + lsls r0, 3 + ands r0, r2 + cmp r0, 0 + bne _080A9EEE + movs r0, 0xAF + lsls r0, 1 + add r0, r12 + ldrh r1, [r0] + movs r0, 0xC0 + lsls r0, 2 + cmp r1, r0 + beq _080A9EEE + cmp r1, r0 + bgt _080A9EC8 + movs r3, 0x80 + lsls r3, 1 + cmp r1, r3 + beq _080A9EDA + movs r0, 0x80 + lsls r0, 2 + b _080A9ED4 + .align 2, 0 +_080A9EC4: .4byte gUnknown_8117F64 +_080A9EC8: + movs r3, 0x80 + lsls r3, 3 + cmp r1, r3 + beq _080A9EDE + movs r0, 0x80 + lsls r0, 4 +_080A9ED4: + cmp r1, r0 + beq _080A9EEC + b _080A9EEE +_080A9EDA: + orrs r2, r0 + b _080A9EEE +_080A9EDE: + movs r1, 0x80 + lsls r1, 2 + adds r0, r1, 0 + orrs r2, r0 + lsls r0, r2, 16 + asrs r2, r0, 16 + b _080A9EEE +_080A9EEC: + orrs r2, r3 +_080A9EEE: + movs r1, 0xB4 + lsls r1, 1 + add r1, r12 + ldrh r3, [r1] + movs r4, 0 + ldrsh r0, [r1, r4] + cmp r0, r2 + beq _080A9F02 + strh r2, [r1] + b _080A9F0C +_080A9F02: + movs r0, 0x80 + lsls r0, 5 + ands r0, r3 + cmp r0, 0 + beq _080A9F16 +_080A9F0C: + movs r1, 0xAE + lsls r1, 1 + add r1, r12 + movs r0, 0x1 + strb r0, [r1] +_080A9F16: + movs r0, 0 + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80A9750 + + thumb_func_start sub_80A9F20 +sub_80A9F20: + push {r4,r5,lr} + sub sp, 0x10 + adds r5, r0, 0 + ldr r2, [r1] + ldr r4, [r5, 0x14] + subs r0, r2, r4 + str r0, [sp] + ldr r3, [r1, 0x4] + ldr r1, [r5, 0x18] + subs r0, r3, r1 + str r0, [sp, 0x4] + adds r2, r4 + str r2, [sp, 0x8] + adds r3, r1 + add r2, sp, 0x8 + str r3, [r2, 0x4] + ldr r1, [r5, 0x28] + ldr r0, [sp] + cmp r0, r1 + blt _080A9F5E + ldr r1, [r5, 0x30] + ldr r0, [sp, 0x8] + cmp r0, r1 + bge _080A9F5E + ldr r1, [r5, 0x2C] + ldr r0, [sp, 0x4] + cmp r0, r1 + blt _080A9F5E + ldr r0, [r5, 0x34] + cmp r3, r0 + blt _080A9F62 +_080A9F5E: + movs r0, 0x1 + b _080A9F8C +_080A9F62: + adds r0, r5, 0 + mov r1, sp + bl sub_80A9488 + cmp r0, 0 + bne _080A9F8C + movs r0, 0xA2 + lsls r0, 1 + adds r2, r5, r0 + ldr r0, [sp] + ldr r1, [sp, 0x4] + str r0, [r2] + str r1, [r2, 0x4] + movs r0, 0xA6 + lsls r0, 1 + adds r2, r5, r0 + ldr r0, [sp, 0x8] + ldr r1, [sp, 0xC] + str r0, [r2] + str r1, [r2, 0x4] + movs r0, 0 +_080A9F8C: + add sp, 0x10 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80A9F20 + + thumb_func_start sub_80A9F94 +sub_80A9F94: + push {r4-r6,lr} + sub sp, 0x10 + adds r4, r0, 0 + movs r2, 0xA2 + lsls r2, 1 + adds r0, r4, r2 + ldr r0, [r0] + ldr r2, [r1] + adds r0, r2 + str r0, [sp] + movs r3, 0xA4 + lsls r3, 1 + adds r0, r4, r3 + ldr r0, [r0] + ldr r1, [r1, 0x4] + adds r0, r1 + str r0, [sp, 0x4] + adds r3, 0x4 + adds r0, r4, r3 + ldr r0, [r0] + adds r0, r2 + str r0, [sp, 0x8] + movs r2, 0xA8 + lsls r2, 1 + adds r0, r4, r2 + ldr r0, [r0] + adds r0, r1 + add r1, sp, 0x8 + str r0, [r1, 0x4] + movs r6, 0 + ldr r3, [r4, 0x28] + ldr r0, [sp] + adds r2, r1, 0 + cmp r0, r3 + bge _080A9FE4 + str r3, [sp] + ldr r0, [r4, 0xC] + adds r0, r3, r0 + str r0, [sp, 0x8] + b _080A9FF4 +_080A9FE4: + ldr r1, [r4, 0x30] + ldr r0, [sp, 0x8] + cmp r0, r1 + blt _080A9FF6 + ldr r0, [r4, 0xC] + subs r0, r1, r0 + str r0, [sp] + str r1, [sp, 0x8] +_080A9FF4: + movs r6, 0x1 +_080A9FF6: + ldr r1, [r4, 0x2C] + ldr r0, [sp, 0x4] + cmp r0, r1 + bge _080AA008 + str r1, [sp, 0x4] + ldr r0, [r4, 0x10] + adds r0, r1, r0 + str r0, [r2, 0x4] + b _080AA018 +_080AA008: + ldr r1, [r4, 0x34] + ldr r0, [r2, 0x4] + cmp r0, r1 + blt _080AA01A + ldr r0, [r4, 0x10] + subs r0, r1, r0 + str r0, [sp, 0x4] + str r1, [r2, 0x4] +_080AA018: + movs r6, 0x1 +_080AA01A: + adds r0, r4, 0 + mov r1, sp + bl sub_80A9488 + adds r5, r0, 0 + cmp r5, 0 + beq _080AA034 + adds r0, r4, 0 + movs r1, 0 + bl sub_80AAF68 + adds r0, r5, 0 + b _080AA06A +_080AA034: + movs r3, 0xA2 + lsls r3, 1 + adds r2, r4, r3 + ldr r0, [sp] + ldr r1, [sp, 0x4] + str r0, [r2] + str r1, [r2, 0x4] + movs r0, 0xA6 + lsls r0, 1 + adds r2, r4, r0 + ldr r0, [sp, 0x8] + ldr r1, [sp, 0xC] + str r0, [r2] + str r1, [r2, 0x4] + cmp r6, 0 + bne _080AA060 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80AAF68 + movs r0, 0 + b _080AA06A +_080AA060: + adds r0, r4, 0 + movs r1, 0 + bl sub_80AAF68 + movs r0, 0x1 +_080AA06A: + add sp, 0x10 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80A9F94 + + thumb_func_start sub_80AA074 +sub_80AA074: + push {r4-r7,lr} + sub sp, 0x10 + adds r4, r0, 0 + movs r2, 0xA2 + lsls r2, 1 + adds r0, r4, r2 + ldr r0, [r0] + ldr r2, [r1] + adds r0, r2 + str r0, [sp] + movs r3, 0xA4 + lsls r3, 1 + adds r0, r4, r3 + ldr r0, [r0] + ldr r1, [r1, 0x4] + adds r0, r1 + str r0, [sp, 0x4] + adds r3, 0x4 + adds r0, r4, r3 + ldr r0, [r0] + adds r0, r2 + str r0, [sp, 0x8] + movs r2, 0xA8 + lsls r2, 1 + adds r0, r4, r2 + ldr r0, [r0] + adds r0, r1 + add r1, sp, 0x8 + str r0, [r1, 0x4] + ldr r3, [r4, 0x28] + ldr r0, [sp] + adds r5, r1, 0 + cmp r0, r3 + bge _080AA0C2 + str r3, [sp] + ldr r0, [r4, 0xC] + adds r0, r3, r0 + str r0, [sp, 0x8] + b _080AA0D2 +_080AA0C2: + ldr r1, [r4, 0x30] + ldr r0, [sp, 0x8] + cmp r0, r1 + blt _080AA0D2 + ldr r0, [r4, 0xC] + subs r0, r1, r0 + str r0, [sp] + str r1, [sp, 0x8] +_080AA0D2: + ldr r1, [r4, 0x2C] + ldr r0, [sp, 0x4] + cmp r0, r1 + bge _080AA0E4 + str r1, [sp, 0x4] + ldr r0, [r4, 0x10] + adds r0, r1, r0 + str r0, [r5, 0x4] + b _080AA0F4 +_080AA0E4: + ldr r1, [r4, 0x34] + ldr r0, [r5, 0x4] + cmp r0, r1 + blt _080AA0F4 + ldr r0, [r4, 0x10] + subs r0, r1, r0 + str r0, [sp, 0x4] + str r1, [r5, 0x4] +_080AA0F4: + adds r0, r4, 0 + mov r1, sp + adds r2, r5, 0 + bl sub_80A95AC + adds r6, r0, 0 + cmp r6, 0 + bne _080AA170 + movs r3, 0xA2 + lsls r3, 1 + adds r2, r4, r3 + ldr r0, [sp] + ldr r1, [sp, 0x4] + str r0, [r2] + str r1, [r2, 0x4] + movs r0, 0xA6 + lsls r0, 1 + adds r2, r4, r0 + ldr r0, [sp, 0x8] + ldr r1, [sp, 0xC] + str r0, [r2] + str r1, [r2, 0x4] + movs r1, 0x8E + lsls r1, 1 + adds r0, r4, r1 + ldr r0, [r0] + movs r1, 0x10 + ands r0, r1 + cmp r0, 0 + beq _080AA170 + movs r0, 0x20 + mov r1, sp + adds r2, r5, 0 + bl sub_80ADCA0 + lsls r0, 16 + asrs r5, r0, 16 + cmp r5, 0 + blt _080AA166 + movs r2, 0x9F + lsls r2, 1 + adds r7, r4, r2 + movs r3, 0 + ldrsh r0, [r7, r3] + cmp r0, r5 + beq _080AA170 + movs r1, 0 + ldrsh r0, [r4, r1] + adds r1, r5, 0 + bl sub_80A8ACC + lsls r0, 24 + cmp r0, 0 + beq _080AA170 + strh r5, [r7] + movs r6, 0x2 + b _080AA170 +_080AA166: + movs r2, 0x9F + lsls r2, 1 + adds r1, r4, r2 + ldr r0, _080AA17C + strh r0, [r1] +_080AA170: + adds r0, r6, 0 + add sp, 0x10 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080AA17C: .4byte 0x0000ffff + thumb_func_end sub_80AA074 + + thumb_func_start sub_80AA180 +sub_80AA180: + push {r4-r7,lr} + sub sp, 0x10 + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + adds r7, r3, 0 + movs r0, 0x4 + ands r0, r5 + cmp r0, 0 + beq _080AA220 + movs r1, 0 + ldrsh r0, [r4, r1] + movs r1, 0x80 + bl sub_80A9344 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + blt _080AA220 + mov r1, sp + bl sub_80A8FD8 + movs r2, 0xA2 + lsls r2, 1 + adds r0, r4, r2 + ldr r1, [r0] + ldr r0, [r4, 0x14] + adds r1, r0 + ldr r0, [sp] + subs r0, r1 + str r0, [sp, 0x8] + movs r3, 0xA4 + lsls r3, 1 + adds r0, r4, r3 + ldr r0, [r0] + ldr r1, [r4, 0x18] + adds r0, r1 + ldr r1, [sp, 0x4] + subs r1, r0 + add r0, sp, 0x8 + str r1, [r0, 0x4] + bl sub_8002C60 + lsls r0, 24 + asrs r1, r0, 24 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080AA2B2 + movs r0, 0xA1 + lsls r0, 1 + adds r2, r4, r0 + lsls r0, r1, 24 + lsrs r0, 24 + strb r0, [r2] + ldr r3, _080AA21C + adds r1, r4, r3 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + lsls r0, 24 + asrs r0, 24 + cmp r1, r0 + beq _080AA20A + movs r0, 0xAE + lsls r0, 1 + adds r1, r4, r0 + movs r0, 0x1 + strb r0, [r1] +_080AA20A: + movs r1, 0 + ldrsb r1, [r2, r1] + adds r0, r4, 0 + bl sub_80AA3F8 + lsls r0, 24 + cmp r0, 0 + bne _080AA2AE + b _080AA2B2 + .align 2, 0 +_080AA21C: .4byte 0x0000015d +_080AA220: + movs r0, 0x8 + ands r0, r5 + cmp r0, 0 + beq _080AA2B2 + movs r0, 0x80 + adds r1, r6, 0 + adds r2, r7, 0 + bl sub_80AC554 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + blt _080AA2B2 + mov r1, sp + bl sub_80AC448 + movs r1, 0xA2 + lsls r1, 1 + adds r0, r4, r1 + ldr r1, [r0] + ldr r0, [r4, 0x14] + adds r1, r0 + ldr r0, [sp] + subs r0, r1 + str r0, [sp, 0x8] + add r0, sp, 0x8 + movs r2, 0xA4 + lsls r2, 1 + adds r1, r4, r2 + ldr r2, [r1] + ldr r1, [r4, 0x18] + adds r2, r1 + ldr r1, [sp, 0x4] + subs r1, r2 + str r1, [r0, 0x4] + bl sub_8002C60 + lsls r0, 24 + asrs r1, r0, 24 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080AA2B2 + movs r3, 0xA1 + lsls r3, 1 + adds r2, r4, r3 + lsls r0, r1, 24 + lsrs r0, 24 + strb r0, [r2] + adds r3, 0x1B + adds r1, r4, r3 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + lsls r0, 24 + asrs r0, 24 + cmp r1, r0 + beq _080AA29E + movs r0, 0xAE + lsls r0, 1 + adds r1, r4, r0 + movs r0, 0x1 + strb r0, [r1] +_080AA29E: + movs r1, 0 + ldrsb r1, [r2, r1] + adds r0, r4, 0 + bl sub_80AA3F8 + lsls r0, 24 + cmp r0, 0 + beq _080AA2B2 +_080AA2AE: + movs r0, 0x3 + b _080AA2B4 +_080AA2B2: + movs r0, 0 +_080AA2B4: + add sp, 0x10 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80AA180 + + thumb_func_start sub_80AA2BC +sub_80AA2BC: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x20 + adds r7, r0, 0 + mov r8, r1 + ldr r0, [r2] + ldr r1, [r2, 0x4] + str r0, [sp] + str r1, [sp, 0x4] + ldr r0, [r3] + ldr r1, [r3, 0x4] + str r0, [sp, 0x10] + str r1, [sp, 0x14] + ldr r0, [sp] + cmp r0, 0 + bge _080AA2E6 + ldr r1, _080AA3C4 + adds r0, r1 +_080AA2E6: + asrs r0, 11 + str r0, [sp, 0x8] + ldr r0, [sp, 0x4] + cmp r0, 0 + bge _080AA2F4 + ldr r2, _080AA3C4 + adds r0, r2 +_080AA2F4: + asrs r0, 11 + add r1, sp, 0x8 + str r0, [r1, 0x4] + ldr r4, [sp, 0x10] + subs r0, r4, 0x1 + mov r10, r1 + cmp r0, 0 + bge _080AA308 + ldr r1, _080AA3C8 + adds r0, r4, r1 +_080AA308: + asrs r2, r0, 11 + add r0, sp, 0x10 + ldr r4, [r0, 0x4] + subs r1, r4, 0x1 + mov r9, r0 + cmp r1, 0 + bge _080AA31A + ldr r0, _080AA3C8 + adds r1, r4, r0 +_080AA31A: + asrs r3, r1, 11 + ldr r0, [sp, 0x8] + subs r0, r2, r0 + adds r0, 0x1 + str r0, [sp, 0x18] + mov r1, r10 + ldr r0, [r1, 0x4] + subs r0, r3, r0 + adds r0, 0x1 + add r1, sp, 0x18 + str r0, [r1, 0x4] + movs r0, 0x4 + mov r2, r8 + ands r0, r2 + cmp r0, 0 + beq _080AA394 + movs r1, 0 + ldrsh r0, [r7, r1] + movs r1, 0x80 + mov r2, sp + mov r3, r9 + bl sub_80A92A0 + lsls r0, 16 + asrs r5, r0, 16 + cmp r5, 0 + blt _080AA394 + ldr r1, _080AA3CC + lsls r0, r5, 5 + subs r0, r5 + lsls r0, 4 + ldr r1, [r1] + adds r6, r1, r0 + movs r2, 0x8E + lsls r2, 1 + adds r0, r6, r2 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 2 + ands r0, r1 + cmp r0, 0 + beq _080AA384 + movs r4, 0xA1 + lsls r4, 1 + adds r0, r7, r4 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x5 + bl sub_8002984 + adds r4, r6, r4 + strb r0, [r4] +_080AA384: + movs r1, 0 + ldrsh r0, [r7, r1] + adds r1, r5, 0 + bl sub_80A89D0 + lsls r0, 24 + cmp r0, 0 + bne _080AA3BE +_080AA394: + movs r0, 0x8 + mov r2, r8 + ands r0, r2 + cmp r0, 0 + beq _080AA3D0 + movs r0, 0x80 + mov r1, sp + mov r2, r9 + bl sub_80AC4C8 + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0 + blt _080AA3D0 + movs r2, 0 + ldrsh r0, [r7, r2] + bl sub_80A8A5C + lsls r0, 24 + cmp r0, 0 + beq _080AA3D0 +_080AA3BE: + movs r0, 0x3 + b _080AA3E6 + .align 2, 0 +_080AA3C4: .4byte 0x000007ff +_080AA3C8: .4byte 0x000007fe +_080AA3CC: .4byte gUnknown_3001B84 +_080AA3D0: + movs r0, 0x10 + mov r1, r10 + add r2, sp, 0x18 + bl sub_80A595C + lsls r0, 24 + cmp r0, 0 + bne _080AA3E4 + movs r0, 0 + b _080AA3E6 +_080AA3E4: + movs r0, 0x6 +_080AA3E6: + add sp, 0x20 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80AA2BC + + thumb_func_start sub_80AA3F8 +sub_80AA3F8: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x40 + adds r6, r0, 0 + lsls r1, 24 + asrs r1, 24 + str r1, [sp, 0x28] + movs r2, 0x80 + lsls r2, 1 + mov r0, sp + bl sub_8002BB8 + ldr r4, [sp] + ldr r5, [sp, 0x4] + movs r0, 0xA2 + lsls r0, 1 + adds r0, r6 + mov r9, r0 + ldr r0, [r0] + adds r0, r4 + str r0, [sp, 0x8] + movs r1, 0xA4 + lsls r1, 1 + adds r1, r6 + mov r10, r1 + ldr r0, [r1] + adds r0, r5 + add r2, sp, 0x8 + str r0, [r2, 0x4] + movs r1, 0xA6 + lsls r1, 1 + adds r0, r6, r1 + ldr r0, [r0] + adds r0, r4 + str r0, [sp, 0x10] + adds r1, 0x4 + adds r0, r6, r1 + ldr r0, [r0] + adds r0, r5 + add r3, sp, 0x10 + str r0, [r3, 0x4] + adds r0, r6, 0 + movs r1, 0xC + bl sub_80AA2BC + adds r7, r0, 0 + cmp r7, 0x3 + bne _080AA462 +_080AA45E: + movs r0, 0x1 + b _080AA650 +_080AA462: + ldr r0, [r6, 0xC] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + movs r2, 0x80 + lsls r2, 2 + mov r8, r2 + add r0, r8 + muls r0, r4 + cmp r0, 0 + bge _080AA47A + adds r0, 0xFF +_080AA47A: + asrs r0, 8 + str r0, [sp, 0x2C] + ldr r0, [r6, 0x10] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + add r0, r8 + muls r0, r5 + cmp r0, 0 + bge _080AA490 + adds r0, 0xFF +_080AA490: + asrs r0, 8 + str r0, [sp, 0x30] + mov r1, r9 + ldr r0, [r1] + ldr r1, [r6, 0x14] + adds r0, r1 + ldr r2, [sp, 0x2C] + adds r0, r2 + ldr r2, _080AA4F4 + adds r0, r2 + str r0, [sp, 0x18] + mov r1, r10 + ldr r0, [r1] + ldr r1, [r6, 0x18] + adds r0, r1 + ldr r1, [sp, 0x30] + adds r0, r1 + adds r0, r2 + add r2, sp, 0x18 + str r0, [r2, 0x4] + movs r1, 0xC0 + lsls r1, 3 + ldr r0, [sp, 0x18] + adds r0, r1 + str r0, [sp, 0x20] + ldr r0, [r2, 0x4] + adds r0, r1 + add r3, sp, 0x20 + str r0, [r3, 0x4] + ldr r0, _080AA4F8 + mov r9, r0 + ldr r0, [sp, 0x28] + lsls r1, r0, 2 + add r9, r1 + mov r0, r9 + ldr r0, [r0] + str r0, [sp, 0x34] + ldr r0, _080AA4FC + adds r0, r1, r0 + ldr r0, [r0] + str r0, [sp, 0x38] + ldr r0, _080AA500 + adds r1, r0 + ldr r1, [r1] + str r1, [sp, 0x3C] + mov r10, r8 + mov r9, r2 + mov r8, r3 + b _080AA568 + .align 2, 0 +_080AA4F4: .4byte 0xfffffd00 +_080AA4F8: .4byte gUnknown_8117FF0 +_080AA4FC: .4byte gUnknown_8118010 +_080AA500: .4byte gUnknown_8118030 +_080AA504: + ldr r1, [r6, 0x28] + ldr r0, [sp, 0x18] + cmp r0, r1 + bge _080AA50E + b _080AA64E +_080AA50E: + ldr r1, [r6, 0x30] + ldr r0, [sp, 0x20] + cmp r0, r1 + blt _080AA518 + b _080AA64E +_080AA518: + ldr r1, [r6, 0x2C] + mov r2, r9 + ldr r0, [r2, 0x4] + cmp r0, r1 + bge _080AA524 + b _080AA64E +_080AA524: + ldr r1, [r6, 0x34] + mov r2, r8 + ldr r0, [r2, 0x4] + cmp r0, r1 + blt _080AA530 + b _080AA64E +_080AA530: + adds r0, r6, 0 + movs r1, 0xC + mov r2, r9 + mov r3, r8 + bl sub_80AA2BC + adds r7, r0, 0 + cmp r7, 0x3 + beq _080AA45E + ldr r0, [sp, 0x18] + adds r0, r4 + str r0, [sp, 0x18] + mov r1, r9 + ldr r0, [r1, 0x4] + adds r0, r5 + str r0, [r1, 0x4] + ldr r0, [sp, 0x20] + adds r0, r4 + str r0, [sp, 0x20] + mov r2, r8 + ldr r0, [r2, 0x4] + adds r0, r5 + str r0, [r2, 0x4] + cmp r7, 0x6 + beq _080AA572 + movs r0, 0x80 + lsls r0, 1 + add r10, r0 +_080AA568: + ldr r1, [sp, 0x34] + cmp r10, r1 + blt _080AA504 + cmp r7, 0x6 + bne _080AA64E +_080AA572: + ldr r2, [sp, 0x38] + cmp r10, r2 + bge _080AA5DC +_080AA578: + ldr r1, [sp, 0x18] + ldr r0, [r6, 0x28] + cmp r1, r0 + blt _080AA64E + ldr r1, [sp, 0x20] + ldr r0, [r6, 0x30] + cmp r1, r0 + bge _080AA64E + mov r0, r9 + ldr r1, [r0, 0x4] + ldr r0, [r6, 0x2C] + cmp r1, r0 + blt _080AA64E + mov r2, r8 + ldr r1, [r2, 0x4] + ldr r0, [r6, 0x34] + cmp r1, r0 + bge _080AA64E + adds r0, r6, 0 + movs r1, 0x4 + mov r2, r9 + mov r3, r8 + bl sub_80AA2BC + adds r7, r0, 0 + cmp r7, 0x3 + bne _080AA5B0 + b _080AA45E +_080AA5B0: + ldr r0, [sp, 0x18] + adds r0, r4 + str r0, [sp, 0x18] + mov r1, r9 + ldr r0, [r1, 0x4] + adds r0, r5 + str r0, [r1, 0x4] + ldr r0, [sp, 0x20] + adds r0, r4 + str r0, [sp, 0x20] + mov r2, r8 + ldr r0, [r2, 0x4] + adds r0, r5 + str r0, [r2, 0x4] + cmp r7, 0x6 + bne _080AA5E0 + movs r0, 0x80 + lsls r0, 1 + add r10, r0 + ldr r1, [sp, 0x38] + cmp r10, r1 + blt _080AA578 +_080AA5DC: + cmp r7, 0x6 + beq _080AA64E +_080AA5E0: + movs r2, 0 + mov r10, r2 + ldr r0, [sp, 0x3C] + cmp r10, r0 + bge _080AA64E +_080AA5EA: + ldr r1, [sp, 0x18] + ldr r0, [r6, 0x28] + cmp r1, r0 + blt _080AA64E + ldr r1, [sp, 0x20] + ldr r0, [r6, 0x30] + cmp r1, r0 + bge _080AA64E + mov r2, r9 + ldr r1, [r2, 0x4] + ldr r0, [r6, 0x2C] + cmp r1, r0 + blt _080AA64E + mov r0, r8 + ldr r1, [r0, 0x4] + ldr r0, [r6, 0x34] + cmp r1, r0 + bge _080AA64E + adds r0, r6, 0 + movs r1, 0x4 + mov r2, r9 + mov r3, r8 + bl sub_80AA2BC + adds r7, r0, 0 + cmp r7, 0x3 + bne _080AA622 + b _080AA45E +_080AA622: + cmp r7, 0x6 + beq _080AA64E + ldr r0, [sp, 0x18] + adds r0, r4 + str r0, [sp, 0x18] + mov r1, r9 + ldr r0, [r1, 0x4] + adds r0, r5 + str r0, [r1, 0x4] + ldr r0, [sp, 0x20] + adds r0, r4 + str r0, [sp, 0x20] + mov r2, r8 + ldr r0, [r2, 0x4] + adds r0, r5 + str r0, [r2, 0x4] + movs r0, 0x80 + lsls r0, 1 + add r10, r0 + ldr r1, [sp, 0x3C] + cmp r10, r1 + blt _080AA5EA +_080AA64E: + movs r0, 0 +_080AA650: + add sp, 0x40 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80AA3F8 + + thumb_func_start sub_80AA660 +sub_80AA660: + push {r4,lr} + adds r4, r0, 0 + movs r0, 0x80 + lsls r0, 1 + bl sub_80AC4C8 + lsls r0, 16 + asrs r1, r0, 16 + cmp r1, 0 + blt _080AA686 + movs r2, 0 + ldrsh r0, [r4, r2] + bl sub_80A8A5C + lsls r0, 24 + cmp r0, 0 + beq _080AA686 + movs r0, 0x4 + b _080AA688 +_080AA686: + movs r0, 0 +_080AA688: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80AA660 + + thumb_func_start sub_80AA690 +sub_80AA690: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + adds r7, r0, 0 + lsls r1, 24 + asrs r1, 24 + mov r9, r1 + movs r2, 0x80 + lsls r2, 1 + mov r0, sp + bl sub_8002BB8 + ldr r5, [sp] + ldr r6, [sp, 0x4] + ldr r0, [r7, 0xC] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + movs r1, 0x80 + lsls r1, 2 + mov r8, r1 + add r0, r8 + muls r0, r5 + cmp r0, 0 + bge _080AA6CA + adds r0, 0xFF +_080AA6CA: + asrs r3, r0, 8 + ldr r0, [r7, 0x10] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + add r0, r8 + muls r0, r6 + cmp r0, 0 + bge _080AA6DE + adds r0, 0xFF +_080AA6DE: + asrs r4, r0, 8 + movs r2, 0xA2 + lsls r2, 1 + adds r0, r7, r2 + ldr r0, [r0] + ldr r1, [r7, 0x14] + adds r0, r1 + adds r0, r3 + ldr r2, _080AA76C + adds r0, r2 + str r0, [sp, 0x8] + movs r1, 0xA4 + lsls r1, 1 + adds r0, r7, r1 + ldr r0, [r0] + ldr r1, [r7, 0x18] + adds r0, r1 + adds r0, r4 + adds r0, r2 + add r2, sp, 0x8 + str r0, [r2, 0x4] + movs r1, 0xC0 + lsls r1, 3 + ldr r0, [sp, 0x8] + adds r0, r1 + str r0, [sp, 0x10] + ldr r0, [r2, 0x4] + adds r0, r1 + add r3, sp, 0x10 + str r0, [r3, 0x4] + ldr r1, _080AA770 + mov r4, r9 + lsls r0, r4, 2 + adds r0, r1 + ldr r0, [r0] + mov r10, r0 + mov r9, r8 + mov r8, r2 + adds r4, r3, 0 + cmp r9, r10 + bge _080AA79C +_080AA730: + ldr r1, [r7, 0x28] + ldr r0, [sp, 0x8] + cmp r0, r1 + blt _080AA79C + ldr r1, [r7, 0x30] + ldr r0, [sp, 0x10] + cmp r0, r1 + bge _080AA79C + ldr r1, [r7, 0x2C] + mov r2, r8 + ldr r0, [r2, 0x4] + cmp r0, r1 + blt _080AA79C + ldr r1, [r7, 0x34] + ldr r0, [r4, 0x4] + cmp r0, r1 + bge _080AA79C + adds r0, r7, 0 + mov r1, r8 + adds r2, r4, 0 + bl sub_80AA660 + cmp r0, 0x4 + beq _080AA774 + cmp r0, 0x4 + bhi _080AA778 + cmp r0, 0 + bne _080AA778 + b _080AA79C + .align 2, 0 +_080AA76C: .4byte 0xfffffd00 +_080AA770: .4byte gUnknown_8117FF0 +_080AA774: + movs r0, 0x1 + b _080AA79E +_080AA778: + ldr r0, [sp, 0x8] + adds r0, r5 + str r0, [sp, 0x8] + mov r1, r8 + ldr r0, [r1, 0x4] + adds r0, r6 + str r0, [r1, 0x4] + ldr r0, [sp, 0x10] + adds r0, r5 + str r0, [sp, 0x10] + ldr r0, [r4, 0x4] + adds r0, r6 + str r0, [r4, 0x4] + movs r2, 0x80 + lsls r2, 1 + add r9, r2 + cmp r9, r10 + blt _080AA730 +_080AA79C: + movs r0, 0 +_080AA79E: + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80AA690 + + thumb_func_start sub_80AA7B0 +sub_80AA7B0: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x20 + adds r7, r0, 0 + adds r6, r1, 0 + mov r12, r2 + ldr r2, [sp, 0x38] + ldr r0, [r3] + ldr r1, [r3, 0x4] + str r0, [sp] + str r1, [sp, 0x4] + ldr r0, [r2] + ldr r1, [r2, 0x4] + str r0, [sp, 0x10] + str r1, [sp, 0x14] + ldr r0, [sp] + cmp r0, 0 + bge _080AA7DA + ldr r1, _080AA884 + adds r0, r1 +_080AA7DA: + asrs r0, 11 + str r0, [sp, 0x8] + ldr r0, [sp, 0x4] + cmp r0, 0 + bge _080AA7E8 + ldr r2, _080AA884 + adds r0, r2 +_080AA7E8: + asrs r0, 11 + add r1, sp, 0x8 + str r0, [r1, 0x4] + ldr r4, [sp, 0x10] + subs r0, r4, 0x1 + mov r8, r1 + cmp r0, 0 + bge _080AA7FC + ldr r5, _080AA888 + adds r0, r4, r5 +_080AA7FC: + asrs r2, r0, 11 + add r4, sp, 0x10 + ldr r1, [r4, 0x4] + subs r0, r1, 0x1 + cmp r0, 0 + bge _080AA80C + ldr r5, _080AA888 + adds r0, r1, r5 +_080AA80C: + asrs r3, r0, 11 + ldr r0, [sp, 0x8] + subs r0, r2, r0 + adds r0, 0x1 + str r0, [sp, 0x18] + mov r1, r8 + ldr r0, [r1, 0x4] + subs r0, r3, r0 + adds r0, 0x1 + add r1, sp, 0x18 + str r0, [r1, 0x4] + movs r0, 0x4 + mov r2, r12 + ands r0, r2 + adds r5, r1, 0 + cmp r0, 0 + beq _080AA890 + movs r1, 0 + ldrsh r0, [r7, r1] + movs r1, 0x80 + mov r2, sp + adds r3, r4, 0 + bl sub_80A92A0 + lsls r0, 16 + asrs r4, r0, 16 + cmp r4, 0 + blt _080AA890 + adds r0, r4, 0 + bl sub_80A8BBC + lsls r0, 16 + ldr r2, _080AA88C + adds r0, r2 + lsrs r0, 16 + cmp r0, 0xF + bhi _080AA890 + adds r0, r4, 0 + bl sub_80A8E9C + cmp r0, 0 + beq _080AA890 + strh r4, [r6] + movs r5, 0xA1 + lsls r5, 1 + adds r0, r7, r5 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + movs r1, 0x5 + bl sub_8002984 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + adds r0, r4, 0 + bl sub_80A9090 + movs r0, 0x5 + b _080AA8AE + .align 2, 0 +_080AA884: .4byte 0x000007ff +_080AA888: .4byte 0x000007fe +_080AA88C: .4byte 0xfff20000 +_080AA890: + movs r1, 0x1 + negs r1, r1 + adds r0, r1, 0 + strh r0, [r6] + movs r0, 0x10 + mov r1, r8 + adds r2, r5, 0 + bl sub_80A595C + lsls r0, 24 + cmp r0, 0 + bne _080AA8AC + movs r0, 0 + b _080AA8AE +_080AA8AC: + movs r0, 0x6 +_080AA8AE: + add sp, 0x20 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80AA7B0 + + thumb_func_start sub_80AA8BC +sub_80AA8BC: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x30 + adds r6, r0, 0 + str r1, [sp, 0x1C] + lsls r2, 24 + asrs r2, 24 + mov r8, r2 + movs r2, 0x80 + lsls r2, 1 + add r0, sp, 0x4 + mov r1, r8 + bl sub_8002BB8 + ldr r4, [sp, 0x4] + ldr r5, [sp, 0x8] + ldr r0, [r6, 0xC] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + movs r1, 0x80 + lsls r1, 2 + mov r9, r1 + add r0, r9 + muls r0, r4 + cmp r0, 0 + bge _080AA8FA + adds r0, 0xFF +_080AA8FA: + asrs r0, 8 + str r0, [sp, 0x20] + ldr r0, [r6, 0x10] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + add r0, r9 + muls r0, r5 + cmp r0, 0 + bge _080AA910 + adds r0, 0xFF +_080AA910: + asrs r0, 8 + str r0, [sp, 0x24] + movs r2, 0xA2 + lsls r2, 1 + adds r0, r6, r2 + ldr r0, [r0] + ldr r1, [r6, 0x14] + adds r0, r1 + ldr r7, [sp, 0x20] + adds r0, r7 + ldr r2, _080AA9F0 + adds r0, r2 + str r0, [sp, 0xC] + movs r1, 0xA4 + lsls r1, 1 + adds r0, r6, r1 + ldr r0, [r0] + ldr r1, [r6, 0x18] + adds r0, r1 + ldr r7, [sp, 0x24] + adds r0, r7 + adds r0, r2 + add r2, sp, 0xC + str r0, [r2, 0x4] + movs r1, 0xC0 + lsls r1, 3 + ldr r0, [sp, 0xC] + adds r0, r1 + str r0, [sp, 0x14] + ldr r0, [r2, 0x4] + adds r0, r1 + add r3, sp, 0x14 + str r0, [r3, 0x4] + ldr r0, _080AA9F4 + mov r7, r8 + lsls r1, r7, 2 + adds r0, r1, r0 + ldr r0, [r0] + mov r10, r0 + ldr r0, _080AA9F8 + adds r0, r1, r0 + ldr r0, [r0] + str r0, [sp, 0x28] + ldr r0, _080AA9FC + adds r1, r0 + ldr r1, [r1] + str r1, [sp, 0x2C] + movs r1, 0 + movs r7, 0x1 + negs r7, r7 + adds r0, r7, 0 + ldr r7, [sp, 0x1C] + strh r0, [r7] + mov r8, r2 + adds r7, r3, 0 + cmp r9, r10 + bge _080AA9E8 +_080AA982: + ldr r1, [r6, 0x28] + ldr r0, [sp, 0xC] + cmp r0, r1 + bge _080AA98C + b _080AAAD4 +_080AA98C: + ldr r1, [r6, 0x30] + ldr r0, [sp, 0x14] + cmp r0, r1 + blt _080AA996 + b _080AAAD4 +_080AA996: + ldr r1, [r6, 0x2C] + mov r2, r8 + ldr r0, [r2, 0x4] + cmp r0, r1 + bge _080AA9A2 + b _080AAAD4 +_080AA9A2: + ldr r1, [r6, 0x34] + ldr r0, [r7, 0x4] + cmp r0, r1 + blt _080AA9AC + b _080AAAD4 +_080AA9AC: + str r7, [sp] + adds r0, r6, 0 + ldr r1, [sp, 0x1C] + movs r2, 0xC + mov r3, r8 + bl sub_80AA7B0 + adds r1, r0, 0 + cmp r1, 0x5 + beq _080AAA66 + ldr r0, [sp, 0xC] + adds r0, r4 + str r0, [sp, 0xC] + mov r2, r8 + ldr r0, [r2, 0x4] + adds r0, r5 + str r0, [r2, 0x4] + ldr r0, [sp, 0x14] + adds r0, r4 + str r0, [sp, 0x14] + ldr r0, [r7, 0x4] + adds r0, r5 + str r0, [r7, 0x4] + cmp r1, 0x6 + beq _080AAA5A + movs r0, 0x80 + lsls r0, 1 + add r9, r0 + cmp r9, r10 + blt _080AA982 +_080AA9E8: + cmp r1, 0x6 + bne _080AAAD4 + b _080AAA5A + .align 2, 0 +_080AA9F0: .4byte 0xfffffd00 +_080AA9F4: .4byte gUnknown_8117FF0 +_080AA9F8: .4byte gUnknown_8118010 +_080AA9FC: .4byte gUnknown_8118030 +_080AAA00: + ldr r1, [sp, 0xC] + ldr r0, [r6, 0x28] + cmp r1, r0 + blt _080AAAD4 + ldr r1, [sp, 0x14] + ldr r0, [r6, 0x30] + cmp r1, r0 + bge _080AAAD4 + mov r0, r8 + ldr r1, [r0, 0x4] + ldr r0, [r6, 0x2C] + cmp r1, r0 + blt _080AAAD4 + ldr r1, [r7, 0x4] + ldr r0, [r6, 0x34] + cmp r1, r0 + bge _080AAAD4 + str r7, [sp] + adds r0, r6, 0 + ldr r1, [sp, 0x1C] + movs r2, 0x4 + mov r3, r8 + bl sub_80AA7B0 + adds r1, r0, 0 + cmp r1, 0x5 + beq _080AAA66 + ldr r0, [sp, 0xC] + adds r0, r4 + str r0, [sp, 0xC] + mov r2, r8 + ldr r0, [r2, 0x4] + adds r0, r5 + str r0, [r2, 0x4] + ldr r0, [sp, 0x14] + adds r0, r4 + str r0, [sp, 0x14] + ldr r0, [r7, 0x4] + adds r0, r5 + str r0, [r7, 0x4] + cmp r1, 0x6 + bne _080AAA6A + movs r0, 0x80 + lsls r0, 1 + add r9, r0 +_080AAA5A: + ldr r2, [sp, 0x28] + cmp r9, r2 + blt _080AAA00 + cmp r1, 0x6 + bne _080AAA6A + b _080AAAD4 +_080AAA66: + movs r0, 0x1 + b _080AAAD6 +_080AAA6A: + movs r0, 0 + mov r9, r0 + ldr r1, [sp, 0x2C] + cmp r9, r1 + bge _080AAAD4 +_080AAA74: + ldr r1, [sp, 0xC] + ldr r0, [r6, 0x28] + cmp r1, r0 + blt _080AAAD4 + ldr r1, [sp, 0x14] + ldr r0, [r6, 0x30] + cmp r1, r0 + bge _080AAAD4 + mov r2, r8 + ldr r1, [r2, 0x4] + ldr r0, [r6, 0x2C] + cmp r1, r0 + blt _080AAAD4 + ldr r1, [r7, 0x4] + ldr r0, [r6, 0x34] + cmp r1, r0 + bge _080AAAD4 + str r7, [sp] + adds r0, r6, 0 + ldr r1, [sp, 0x1C] + movs r2, 0x4 + mov r3, r8 + bl sub_80AA7B0 + adds r1, r0, 0 + cmp r1, 0x5 + beq _080AAA66 + cmp r1, 0x6 + beq _080AAAD4 + ldr r0, [sp, 0xC] + adds r0, r4 + str r0, [sp, 0xC] + mov r1, r8 + ldr r0, [r1, 0x4] + adds r0, r5 + str r0, [r1, 0x4] + ldr r0, [sp, 0x14] + adds r0, r4 + str r0, [sp, 0x14] + ldr r0, [r7, 0x4] + adds r0, r5 + str r0, [r7, 0x4] + movs r2, 0x80 + lsls r2, 1 + add r9, r2 + ldr r0, [sp, 0x2C] + cmp r9, r0 + blt _080AAA74 +_080AAAD4: + movs r0, 0 +_080AAAD6: + add sp, 0x30 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80AA8BC + + thumb_func_start sub_80AAAE8 +sub_80AAAE8: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x80 + adds r5, r0, 0 + adds r3, r1, 0 + lsls r2, 24 + asrs r4, r2, 24 + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x78] + movs r2, 0xAF + lsls r2, 1 + adds r1, r5, r2 + movs r0, 0xC0 + lsls r0, 2 + strh r0, [r1] + movs r6, 0xB0 + lsls r6, 1 + adds r1, r5, r6 + movs r0, 0x1 + strh r0, [r1] + ldr r0, [sp, 0x78] + cmp r4, r0 + beq _080AAB26 + movs r1, 0xA1 + lsls r1, 1 + adds r0, r5, r1 + strb r4, [r0] +_080AAB26: + subs r0, r3, 0x1 + cmp r0, 0x13 + bls _080AAB2E + b _080AAEB8 +_080AAB2E: + lsls r0, 2 + ldr r1, _080AAB38 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080AAB38: .4byte _080AAB3C + .align 2, 0 +_080AAB3C: + .4byte _080AAB8C + .4byte _080AAD60 + .4byte _080AAC9C + .4byte _080AAC9C + .4byte _080AAC9C + .4byte _080AAB9E + .4byte _080AAB9E + .4byte _080AAB9E + .4byte _080AAD7C + .4byte _080AADF4 + .4byte _080AAE06 + .4byte _080AAEB8 + .4byte _080AAEB8 + .4byte _080AAEB8 + .4byte _080AAEB8 + .4byte _080AAEB8 + .4byte _080AAEB8 + .4byte _080AAEB8 + .4byte _080AAE32 + .4byte _080AAE9C +_080AAB8C: + movs r4, 0xB2 + lsls r4, 1 + adds r1, r5, r4 + movs r0, 0 + str r0, [r1] + movs r6, 0xC0 + lsls r6, 2 + str r6, [sp, 0x78] + b _080AAD6E +_080AAB9E: + movs r0, 0x1 + negs r0, r0 + cmp r4, r0 + beq _080AAC88 + movs r6, 0 + movs r0, 0xB2 + lsls r0, 1 + adds r1, r5, r0 + movs r0, 0x4 + str r0, [r1] + cmp r3, 0x7 + beq _080AABD2 + cmp r3, 0x7 + bhi _080AABC0 + cmp r3, 0x6 + beq _080AABC6 + b _080AABEA +_080AABC0: + cmp r3, 0x8 + beq _080AABDE + b _080AABEA +_080AABC6: + movs r1, 0x90 + lsls r1, 4 + str r1, [sp, 0x78] + movs r2, 0x1 + str r2, [sp, 0x7C] + b _080AABFC +_080AABD2: + movs r3, 0x80 + lsls r3, 4 + str r3, [sp, 0x78] + movs r0, 0x2 + str r0, [sp, 0x7C] + b _080AABFC +_080AABDE: + movs r1, 0xA0 + lsls r1, 4 + str r1, [sp, 0x78] + movs r2, 0x4 + str r2, [sp, 0x7C] + b _080AABFC +_080AABEA: + movs r3, 0xB2 + lsls r3, 1 + adds r1, r5, r3 + movs r0, 0 + str r0, [r1] + ldr r0, _080AAC20 + str r0, [sp, 0x78] + movs r1, 0 + str r1, [sp, 0x7C] +_080AABFC: + movs r2, 0x80 + lsls r2, 1 + add r0, sp, 0x28 + adds r1, r4, 0 + bl sub_8002BB8 + ldr r0, [sp, 0x28] + ldr r1, [sp, 0x2C] + str r0, [sp, 0x38] + str r1, [sp, 0x3C] + movs r2, 0 + mov r10, r2 + add r3, sp, 0x40 + mov r9, r3 + add r4, sp, 0x30 + mov r8, r4 + b _080AAC42 + .align 2, 0 +_080AAC20: .4byte 0x00000807 +_080AAC24: + cmp r6, 0x1 + bne _080AAC3E + ldr r0, [sp, 0x38] + str r0, [sp, 0x30] + mov r6, r8 + str r7, [r6, 0x4] + adds r0, r5, 0 + mov r1, r8 + bl sub_80AA074 + adds r6, r0, 0 + cmp r6, 0x2 + beq _080AAC78 +_080AAC3E: + movs r0, 0x1 + add r10, r0 +_080AAC42: + ldr r1, [sp, 0x7C] + cmp r10, r1 + bge _080AAC74 + add r4, sp, 0x38 + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80AA074 + adds r6, r0, 0 + cmp r6, 0x2 + beq _080AAC78 + cmp r6, 0x1 + bne _080AAC3E + movs r7, 0 + str r7, [sp, 0x40] + ldr r0, [r4, 0x4] + mov r2, r9 + str r0, [r2, 0x4] + adds r0, r5, 0 + mov r1, r9 + bl sub_80AA074 + adds r6, r0, 0 + cmp r6, 0x2 + bne _080AAC24 +_080AAC74: + cmp r6, 0x2 + bne _080AAC7E +_080AAC78: + movs r3, 0x1 + negs r3, r3 + b _080AAD6C +_080AAC7E: + adds r0, r5, 0 + movs r1, 0x1 + bl sub_80AAF68 + b _080AAEC0 +_080AAC88: + movs r4, 0xB2 + lsls r4, 1 + adds r1, r5, r4 + movs r0, 0 + str r0, [r1] + ldr r6, _080AAC98 + str r6, [sp, 0x78] + b _080AAD6E + .align 2, 0 +_080AAC98: .4byte 0x00000807 +_080AAC9C: + movs r0, 0x1 + negs r0, r0 + cmp r4, r0 + beq _080AAD60 + movs r0, 0xB2 + lsls r0, 1 + adds r1, r5, r0 + movs r0, 0x4 + str r0, [r1] + cmp r3, 0x4 + beq _080AACCE + cmp r3, 0x4 + bhi _080AACBC + cmp r3, 0x3 + beq _080AACC2 + b _080AACE6 +_080AACBC: + cmp r3, 0x5 + beq _080AACDA + b _080AACE6 +_080AACC2: + movs r1, 0x90 + lsls r1, 4 + str r1, [sp, 0x78] + movs r2, 0x1 + mov r9, r2 + b _080AACF6 +_080AACCE: + movs r3, 0x80 + lsls r3, 4 + str r3, [sp, 0x78] + movs r6, 0x2 + mov r9, r6 + b _080AACF6 +_080AACDA: + movs r0, 0xA0 + lsls r0, 4 + str r0, [sp, 0x78] + movs r1, 0x4 + mov r9, r1 + b _080AACF6 +_080AACE6: + movs r2, 0xB2 + lsls r2, 1 + adds r1, r5, r2 + movs r0, 0 + str r0, [r1] + ldr r3, _080AAD5C + str r3, [sp, 0x78] + mov r9, r0 +_080AACF6: + movs r2, 0x80 + lsls r2, 1 + add r0, sp, 0x48 + adds r1, r4, 0 + bl sub_8002BB8 + ldr r0, [sp, 0x48] + ldr r1, [sp, 0x4C] + str r0, [sp, 0x50] + str r1, [sp, 0x54] + movs r6, 0 + cmp r6, r9 + bge _080AAD52 + add r4, sp, 0x50 + mov r8, r4 + add r7, sp, 0x58 +_080AAD16: + adds r0, r5, 0 + mov r1, r8 + bl sub_80A9F94 + cmp r0, 0 + beq _080AAD4C + movs r4, 0 + str r4, [sp, 0x58] + mov r1, r8 + ldr r0, [r1, 0x4] + str r0, [r7, 0x4] + adds r0, r5, 0 + adds r1, r7, 0 + bl sub_80A9F94 + cmp r0, 0 + beq _080AAD4C + ldr r0, [sp, 0x50] + str r0, [sp, 0x60] + add r1, sp, 0x60 + str r4, [r1, 0x4] + adds r0, r5, 0 + bl sub_80A9F94 + cmp r0, 0 + beq _080AAD4C + mov r9, r4 +_080AAD4C: + adds r6, 0x1 + cmp r6, r9 + blt _080AAD16 +_080AAD52: + adds r0, r5, 0 + mov r1, r9 + bl sub_80AAF68 + b _080AAEC0 + .align 2, 0 +_080AAD5C: .4byte 0x00000807 +_080AAD60: + movs r2, 0xB2 + lsls r2, 1 + adds r1, r5, r2 + movs r0, 0 + str r0, [r1] + ldr r3, _080AAD78 +_080AAD6C: + str r3, [sp, 0x78] +_080AAD6E: + adds r0, r5, 0 + movs r1, 0 + bl sub_80AAF68 + b _080AAEC0 + .align 2, 0 +_080AAD78: .4byte 0x00000807 +_080AAD7C: + movs r6, 0x8E + lsls r6, 1 + adds r0, r5, r6 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 5 + ands r0, r1 + cmp r0, 0 + beq _080AAD9C + ldr r0, _080AAD98 + ldr r0, [r0] + adds r0, 0x28 + strb r4, [r0] + b _080AADA6 + .align 2, 0 +_080AAD98: .4byte gUnknown_3001B80 +_080AAD9C: + ldr r0, _080AADF0 + ldr r0, [r0] + adds r0, 0x28 + movs r1, 0xFF + strb r1, [r0] +_080AADA6: + movs r1, 0xB2 + lsls r1, 1 + adds r0, r5, r1 + movs r1, 0 + str r1, [r0] + movs r2, 0x80 + lsls r2, 4 + str r2, [sp, 0x78] + movs r3, 0xA1 + lsls r3, 1 + adds r1, r5, r3 + movs r0, 0x4 + strb r0, [r1] + movs r6, 0x1 + negs r6, r6 + cmp r4, r6 + bne _080AADCA + b _080AAEC0 +_080AADCA: + movs r2, 0x80 + lsls r2, 1 + add r0, sp, 0x68 + adds r1, r4, 0 + bl sub_8002BB8 + ldr r0, [sp, 0x68] + ldr r1, [sp, 0x6C] + str r0, [sp, 0x70] + str r1, [sp, 0x74] + add r1, sp, 0x70 + adds r0, r5, 0 + bl sub_80AA074 + cmp r0, 0x2 + bne _080AAEC0 + str r6, [sp, 0x78] + b _080AAEC0 + .align 2, 0 +_080AADF0: .4byte gUnknown_3001B80 +_080AADF4: + movs r4, 0xA1 + lsls r4, 1 + adds r0, r5, r4 + movs r1, 0 + ldrsb r1, [r0, r1] + adds r0, r5, 0 + bl sub_80AA3F8 + b _080AAEC0 +_080AAE06: + movs r6, 0xA1 + lsls r6, 1 + adds r0, r5, r6 + movs r1, 0 + ldrsb r1, [r0, r1] + adds r0, r5, 0 + bl sub_80AA690 + lsls r0, 24 + cmp r0, 0 + bne _080AAEC0 + movs r0, 0 + mov r1, sp + movs r2, 0x9 + bl sub_809D710 + adds r0, r5, 0 + movs r1, 0 + mov r2, sp + bl sub_80A8940 + b _080AAEC0 +_080AAE32: + add r6, sp, 0xC + movs r1, 0xA1 + lsls r1, 1 + adds r0, r5, r1 + movs r2, 0 + ldrsb r2, [r0, r2] + adds r0, r5, 0 + adds r1, r6, 0 + bl sub_80AA8BC + lsls r0, 24 + cmp r0, 0 + beq _080AAE84 + add r4, sp, 0x10 + movs r0, 0 + adds r1, r4, 0 + movs r2, 0x6 + bl sub_809D710 + movs r2, 0 + ldrsh r0, [r6, r2] + adds r1, r5, 0 + adds r1, 0x40 + adds r2, r4, 0 + bl sub_80A88D8 + adds r0, r5, 0 + movs r1, 0 + movs r2, 0 + bl sub_80A8940 + movs r3, 0 + ldrsh r0, [r6, r3] + bl sub_80A8E9C + adds r2, r0, 0 + movs r0, 0x7 + movs r1, 0 + bl sub_809B1C0 + b _080AAE8E +_080AAE84: + movs r0, 0x7 + movs r1, 0 + movs r2, 0 + bl sub_809B1C0 +_080AAE8E: + movs r4, 0x90 + lsls r4, 1 + adds r0, r5, r4 + movs r1, 0x5 + bl sub_809CD8C + b _080AAEC0 +_080AAE9C: + add r4, sp, 0x1C + ldr r2, _080AAEB4 + movs r0, 0 + adds r1, r4, 0 + bl sub_809D710 + adds r0, r5, 0 + movs r1, 0 + adds r2, r4, 0 + bl sub_80A8940 + b _080AAEC0 + .align 2, 0 +_080AAEB4: .4byte 0x00000195 +_080AAEB8: + adds r0, r5, 0 + movs r1, 0 + bl sub_80AAF68 +_080AAEC0: + movs r0, 0x1 + negs r0, r0 + ldr r6, [sp, 0x78] + cmp r6, r0 + beq _080AAF04 + movs r0, 0xB4 + lsls r0, 1 + adds r2, r5, r0 + movs r1, 0 + ldrsh r0, [r2, r1] + cmp r6, r0 + beq _080AAF04 + movs r3, 0xAE + lsls r3, 1 + adds r1, r5, r3 + movs r0, 0 + strb r0, [r1] + movs r4, 0xB8 + lsls r4, 1 + adds r0, r5, r4 + strh r6, [r2] + movs r1, 0xA1 + lsls r1, 1 + adds r3, r5, r1 + ldrb r1, [r3] + subs r4, 0x13 + adds r2, r5, r4 + strb r1, [r2] + movs r2, 0 + ldrsb r2, [r3, r2] + ldr r1, [sp, 0x78] + bl sub_80A6EFC + b _080AAF54 +_080AAF04: + movs r6, 0xAE + lsls r6, 1 + adds r2, r5, r6 + ldrb r0, [r2] + cmp r0, 0 + bne _080AAF2A + ldr r0, _080AAF64 + adds r1, r5, r0 + movs r3, 0xA1 + lsls r3, 1 + adds r0, r5, r3 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r1, r0 + beq _080AAF54 +_080AAF2A: + movs r0, 0 + strb r0, [r2] + movs r4, 0xB8 + lsls r4, 1 + adds r0, r5, r4 + movs r6, 0xB4 + lsls r6, 1 + adds r1, r5, r6 + movs r2, 0 + ldrsh r1, [r1, r2] + movs r3, 0xA1 + lsls r3, 1 + adds r4, r5, r3 + ldrb r2, [r4] + subs r6, 0xB + adds r3, r5, r6 + strb r2, [r3] + movs r2, 0 + ldrsb r2, [r4, r2] + bl sub_80A6EFC +_080AAF54: + add sp, 0x80 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080AAF64: .4byte 0x0000015d + thumb_func_end sub_80AAAE8 + + thumb_func_start sub_80AAF68 +sub_80AAF68: + push {r4,lr} + adds r4, r0, 0 + movs r1, 0x8E + lsls r1, 1 + adds r0, r4, r1 + ldr r0, [r0] + movs r1, 0x80 + lsls r1, 7 + ands r0, r1 + cmp r0, 0 + beq _080AB002 + movs r2, 0 + ldrsh r0, [r4, r2] + movs r1, 0x1 + bl sub_80A93F0 + lsls r0, 24 + cmp r0, 0 + beq _080AAFD0 + movs r1, 0xE4 + lsls r1, 1 + adds r0, r4, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + cmp r1, 0 + bne _080AAFA6 + movs r0, 0xB5 + lsls r0, 1 + adds r1, r4, r0 + adds r0, 0x4C + b _080AAFB4 +_080AAFA6: + movs r0, 0xDB + lsls r0, 1 + cmp r1, r0 + beq _080AAFC2 + subs r0, 0x4C + adds r1, r4, r0 + adds r0, 0x56 +_080AAFB4: + strh r0, [r1] + movs r2, 0xB6 + lsls r2, 1 + adds r1, r4, r2 + movs r0, 0x1 + negs r0, r0 + str r0, [r1] +_080AAFC2: + movs r1, 0 + ldrsh r0, [r4, r1] + movs r1, 0x80 + lsls r1, 17 + bl sub_80A8750 + b _080AB002 +_080AAFD0: + movs r2, 0xE4 + lsls r2, 1 + adds r0, r4, r2 + movs r2, 0 + ldrsh r1, [r0, r2] + movs r0, 0xDB + lsls r0, 1 + cmp r1, r0 + bne _080AAFF6 + subs r0, 0x4C + adds r1, r4, r0 + adds r0, 0x56 + strh r0, [r1] + movs r2, 0xB6 + lsls r2, 1 + adds r1, r4, r2 + movs r0, 0x1 + negs r0, r0 + str r0, [r1] +_080AAFF6: + movs r1, 0 + ldrsh r0, [r4, r1] + movs r1, 0x80 + lsls r1, 17 + bl sub_80A86C8 +_080AB002: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80AAF68 + + thumb_func_start sub_80AB008 +sub_80AB008: + movs r1, 0 + ldrsh r0, [r0, r1] + bx lr + thumb_func_end sub_80AB008 + + thumb_func_start sub_80AB010 +sub_80AB010: + ldr r2, [r0, 0xC] + ldr r3, [r0, 0x10] + str r2, [r1] + str r3, [r1, 0x4] + bx lr + thumb_func_end sub_80AB010 + + thumb_func_start sub_80AB01C +sub_80AB01C: + push {r4,lr} + adds r3, r0, 0 + adds r4, r1, 0 + cmp r4, 0 + beq _080AB05C + movs r0, 0xA2 + lsls r0, 1 + adds r2, r3, r0 + ldr r1, [r4] + ldr r0, [r3, 0x14] + subs r0, r1, r0 + str r0, [r2] + movs r0, 0xA6 + lsls r0, 1 + adds r2, r3, r0 + ldr r0, [r3, 0x14] + adds r1, r0 + str r1, [r2] + movs r0, 0xA4 + lsls r0, 1 + adds r2, r3, r0 + ldr r1, [r4, 0x4] + ldr r0, [r3, 0x18] + subs r0, r1, r0 + str r0, [r2] + movs r0, 0xA8 + lsls r0, 1 + adds r2, r3, r0 + ldr r0, [r3, 0x18] + adds r1, r0 + str r1, [r2] + b _080AB0C2 +_080AB05C: + movs r0, 0xA2 + lsls r0, 1 + adds r2, r3, r0 + ldr r0, [r3, 0x20] + ldr r1, [r3, 0x14] + subs r0, r1 + str r0, [r2] + movs r0, 0xA6 + lsls r0, 1 + adds r2, r3, r0 + ldr r0, [r3, 0x20] + ldr r1, [r3, 0x14] + adds r0, r1 + str r0, [r2] + movs r0, 0xA4 + lsls r0, 1 + adds r2, r3, r0 + ldr r0, [r3, 0x24] + ldr r1, [r3, 0x18] + subs r0, r1 + str r0, [r2] + movs r0, 0xA8 + lsls r0, 1 + adds r2, r3, r0 + ldr r0, [r3, 0x24] + ldr r1, [r3, 0x18] + adds r0, r1 + str r0, [r2] + movs r2, 0xAA + lsls r2, 1 + adds r1, r3, r2 + adds r2, 0x4 + adds r0, r3, r2 + str r4, [r0] + str r4, [r1] + movs r0, 0xA1 + lsls r0, 1 + adds r2, r3, r0 + movs r1, 0 + ldrsb r1, [r2, r1] + movs r0, 0x1C + ldrsb r0, [r3, r0] + cmp r1, r0 + beq _080AB0BE + movs r0, 0xAE + lsls r0, 1 + adds r1, r3, r0 + movs r0, 0x1 + strb r0, [r1] +_080AB0BE: + ldrb r0, [r3, 0x1C] + strb r0, [r2] +_080AB0C2: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80AB01C + + thumb_func_start sub_80AB0C8 +sub_80AB0C8: + push {r4,lr} + ldr r3, [r1] + ldr r4, [r1, 0x4] + str r3, [r0, 0x28] + str r4, [r0, 0x2C] + ldr r1, [r2] + ldr r2, [r2, 0x4] + str r1, [r0, 0x30] + str r2, [r0, 0x34] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80AB0C8 + + thumb_func_start sub_80AB0E0 +sub_80AB0E0: + adds r3, r0, 0 + movs r2, 0xA2 + lsls r2, 1 + adds r0, r3, r2 + ldr r0, [r0] + ldr r2, [r3, 0x14] + adds r0, r2 + str r0, [r1] + movs r2, 0xA4 + lsls r2, 1 + adds r0, r3, r2 + ldr r0, [r0] + ldr r2, [r3, 0x18] + adds r0, r2 + str r0, [r1, 0x4] + bx lr + thumb_func_end sub_80AB0E0 + + thumb_func_start sub_80AB100 +sub_80AB100: + push {lr} + bl sub_80A9F20 + pop {r1} + bx r1 + thumb_func_end sub_80AB100 + + thumb_func_start sub_80AB10C +sub_80AB10C: + push {r4,lr} + adds r3, r0, 0 + movs r4, 0xAA + lsls r4, 1 + adds r0, r3, r4 + ldr r0, [r0] + str r0, [r1] + movs r1, 0xAC + lsls r1, 1 + adds r0, r3, r1 + ldr r0, [r0] + str r0, [r2] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80AB10C + + thumb_func_start sub_80AB12C +sub_80AB12C: + movs r2, 0xAA + lsls r2, 1 + adds r0, r2 + str r1, [r0] + bx lr + thumb_func_end sub_80AB12C + + thumb_func_start sub_80AB138 +sub_80AB138: + movs r2, 0xA1 + lsls r2, 1 + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + bx lr + thumb_func_end sub_80AB138 + + thumb_func_start sub_80AB144 +sub_80AB144: + push {lr} + adds r3, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080AB17C + movs r0, 0xA1 + lsls r0, 1 + adds r2, r3, r0 + lsls r0, r1, 24 + lsrs r0, 24 + strb r0, [r2] + ldr r2, _080AB180 + adds r1, r3, r2 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + lsls r0, 24 + asrs r0, 24 + cmp r1, r0 + beq _080AB17C + movs r0, 0xAE + lsls r0, 1 + adds r1, r3, r0 + movs r0, 0x1 + strb r0, [r1] +_080AB17C: + pop {r0} + bx r0 + .align 2, 0 +_080AB180: .4byte 0x0000015d + thumb_func_end sub_80AB144 + + thumb_func_start sub_80AB184 +sub_80AB184: + push {lr} + lsls r1, 16 + lsrs r1, 16 + bl sub_80A9750 + pop {r0} + bx r0 + thumb_func_end sub_80AB184 + + thumb_func_start sub_80AB194 +sub_80AB194: + push {lr} + mov r12, r0 + lsls r1, 16 + asrs r1, 16 + adds r3, r1, 0 + cmp r1, 0 + bne _080AB1A8 + movs r0, 0xE0 + lsls r0, 1 + adds r3, r0, 0 +_080AB1A8: + movs r0, 0xB5 + lsls r0, 1 + add r0, r12 + strh r3, [r0] + movs r0, 0xB6 + lsls r0, 1 + add r0, r12 + str r2, [r0] + pop {r0} + bx r0 + thumb_func_end sub_80AB194 + + thumb_func_start nullsub_211 +nullsub_211: + bx lr + thumb_func_end nullsub_211 + + thumb_func_start sub_80AB1C0 +sub_80AB1C0: + push {lr} + adds r1, r0, 0 + movs r2, 0xAE + lsls r2, 1 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080AB1DE + adds r2, 0x14 + adds r0, r1, r2 + bl sub_80A66F8 + lsls r0, 24 + lsrs r0, 24 + b _080AB1E0 +_080AB1DE: + movs r0, 0x1 +_080AB1E0: + pop {r1} + bx r1 + thumb_func_end sub_80AB1C0 + + thumb_func_start sub_80AB1E4 +sub_80AB1E4: + push {lr} + adds r1, r0, 0 + movs r2, 0xB5 + lsls r2, 1 + adds r0, r1, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + bne _080AB206 + movs r2, 0xB8 + lsls r2, 1 + adds r0, r1, r2 + bl sub_80A671C + lsls r0, 24 + lsrs r0, 24 + b _080AB208 +_080AB206: + movs r0, 0x1 +_080AB208: + pop {r1} + bx r1 + thumb_func_end sub_80AB1E4 + + thumb_func_start sub_80AB20C +sub_80AB20C: + movs r2, 0x8E + lsls r2, 1 + adds r0, r2 + ldr r0, [r0] + str r0, [r1] + bx lr + thumb_func_end sub_80AB20C + + thumb_func_start sub_80AB218 +sub_80AB218: + push {lr} + movs r2, 0 + ldrsh r0, [r0, r2] + bl sub_80A86C8 + pop {r0} + bx r0 + thumb_func_end sub_80AB218 + + thumb_func_start sub_80AB228 +sub_80AB228: + push {lr} + movs r2, 0 + ldrsh r0, [r0, r2] + bl sub_80A8750 + pop {r0} + bx r0 + thumb_func_end sub_80AB228 + + thumb_func_start sub_80AB238 +sub_80AB238: + push {lr} + movs r2, 0xB8 + lsls r2, 1 + adds r0, r2 + bl sub_80A6EC8 + pop {r0} + bx r0 + thumb_func_end sub_80AB238 + + thumb_func_start sub_80AB248 +sub_80AB248: + push {lr} + bl sub_80A9F94 + pop {r1} + bx r1 + thumb_func_end sub_80AB248 + + thumb_func_start sub_80AB254 +sub_80AB254: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x3C + ldr r0, _080AB29C + ldr r5, [r0] + movs r0, 0 + mov r9, r0 +_080AB266: + movs r2, 0x2 + ldrsh r1, [r5, r2] + movs r3, 0x1 + negs r3, r3 + mov r8, r3 + adds r0, r3, 0 + cmp r1, r0 + bne _080AB278 + b _080AB47C +_080AB278: + adds r4, r5, 0 + adds r4, 0x38 + ldr r1, _080AB2A0 + adds r0, r4, 0 + bl sub_809DA70 + lsls r0, 16 + asrs r3, r0, 16 + cmp r3, 0 + beq _080AB2A4 + cmp r3, 0x4 + beq _080AB292 + b _080AB44C +_080AB292: + mov r0, r9 + bl sub_80A8684 + b _080AB47C + .align 2, 0 +_080AB29C: .4byte gUnknown_3001B84 +_080AB2A0: .4byte gUnknown_8118280 +_080AB2A4: + movs r0, 0x8E + lsls r0, 1 + adds r2, r5, r0 + ldr r1, [r2] + movs r0, 0x80 + lsls r0, 4 + ands r0, r1 + cmp r0, 0 + bne _080AB2B8 + b _080AB42E +_080AB2B8: + str r3, [sp, 0xC] + add r0, sp, 0x8 + mov r1, r8 + strb r1, [r0] + str r3, [sp, 0x10] + movs r3, 0x90 + lsls r3, 1 + adds r0, r5, r3 + add r1, sp, 0xC + add r3, sp, 0x10 + add r4, sp, 0x14 + str r4, [sp] + ldr r2, [r2] + str r2, [sp, 0x4] + add r2, sp, 0x8 + bl sub_809CDC8 + subs r0, 0x1 + mov r8, r4 + cmp r0, 0x7 + bls _080AB2E4 + b _080AB44C +_080AB2E4: + lsls r0, 2 + ldr r1, _080AB2F0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080AB2F0: .4byte _080AB2F4 + .align 2, 0 +_080AB2F4: + .4byte _080AB314 + .4byte _080AB314 + .4byte _080AB326 + .4byte _080AB44C + .4byte _080AB314 + .4byte _080AB44C + .4byte _080AB44C + .4byte _080AB314 +_080AB314: + ldr r1, [sp, 0xC] + add r0, sp, 0x8 + movs r2, 0 + ldrsb r2, [r0, r2] + ldr r3, [sp, 0x10] + adds r0, r5, 0 + bl sub_80AAAE8 + b _080AB44C +_080AB326: + add r4, sp, 0x1C + adds r0, r4, 0 + bl sub_809D248 + ldr r1, [sp, 0x1C] + ldr r0, [sp, 0x14] + adds r6, r1, r0 + ldr r1, [r4, 0x4] + mov r2, r8 + ldr r0, [r2, 0x4] + adds r7, r1, r0 + movs r3, 0xA2 + lsls r3, 1 + adds r0, r5, r3 + ldr r1, [r0] + ldr r0, [r5, 0x14] + adds r0, r1, r0 + cmp r0, 0 + bge _080AB34E + adds r0, 0xFF +_080AB34E: + asrs r0, 8 + subs r0, r6, r0 + str r0, [sp, 0x24] + movs r1, 0xA4 + lsls r1, 1 + adds r0, r5, r1 + ldr r1, [r0] + ldr r0, [r5, 0x18] + adds r0, r1, r0 + cmp r0, 0 + bge _080AB366 + adds r0, 0xFF +_080AB366: + asrs r0, 8 + subs r0, r7, r0 + add r1, sp, 0x24 + str r0, [r1, 0x4] + adds r0, r6, 0 + subs r0, 0x10 + lsls r0, 8 + str r0, [sp, 0x2C] + adds r0, r6, 0 + adds r0, 0x10 + lsls r0, 8 + str r0, [sp, 0x34] + subs r0, r7, 0x4 + lsls r0, 8 + add r2, sp, 0x2C + str r0, [r2, 0x4] + adds r0, r7, 0 + adds r0, 0x1C + lsls r0, 8 + add r3, sp, 0x34 + str r0, [r3, 0x4] + ldr r0, [sp, 0xC] + adds r4, r1, 0 + cmp r0, 0xC + bne _080AB3C4 + adds r0, r5, 0 + movs r1, 0xC + bl sub_80AA180 + cmp r0, 0 + bne _080AB44C + ldr r0, [sp, 0x24] + adds r0, 0x10 + cmp r0, 0x20 + bhi _080AB44C + movs r0, 0x1C + negs r0, r0 + ldr r1, [r4, 0x4] + cmp r1, r0 + blt _080AB44C + cmp r1, 0x4 + bgt _080AB44C + movs r2, 0x1 + negs r2, r2 + adds r0, r5, 0 + movs r1, 0x13 + b _080AB426 +_080AB3C4: + ldr r0, [sp, 0x24] + adds r0, 0x10 + cmp r0, 0x20 + bhi _080AB3DA + movs r0, 0x1C + negs r0, r0 + ldr r1, [r4, 0x4] + cmp r1, r0 + blt _080AB3DA + cmp r1, 0x4 + ble _080AB44C +_080AB3DA: + adds r0, r4, 0 + bl sub_8002C60 + add r1, sp, 0x8 + strb r0, [r1] + lsls r0, 24 + movs r1, 0xFF + lsls r1, 24 + cmp r0, r1 + beq _080AB44C + ldr r0, [sp, 0xC] + cmp r0, 0x11 + beq _080AB410 + cmp r0, 0x11 + bhi _080AB3FE + cmp r0, 0x10 + beq _080AB404 + b _080AB44C +_080AB3FE: + cmp r0, 0x12 + beq _080AB41C + b _080AB44C +_080AB404: + add r0, sp, 0x8 + movs r2, 0 + ldrsb r2, [r0, r2] + adds r0, r5, 0 + movs r1, 0x6 + b _080AB426 +_080AB410: + add r0, sp, 0x8 + movs r2, 0 + ldrsb r2, [r0, r2] + adds r0, r5, 0 + movs r1, 0x7 + b _080AB426 +_080AB41C: + add r0, sp, 0x8 + movs r2, 0 + ldrsb r2, [r0, r2] + adds r0, r5, 0 + movs r1, 0x8 +_080AB426: + movs r3, 0 + bl sub_80AAAE8 + b _080AB44C +_080AB42E: + movs r0, 0x80 + lsls r0, 5 + ands r1, r0 + cmp r1, 0 + beq _080AB440 + adds r0, r5, 0 + bl sub_80AB5D4 + b _080AB44C +_080AB440: + ldr r3, _080AB4C4 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x1 + bl sub_809D8C0 +_080AB44C: + movs r2, 0xAE + lsls r2, 1 + adds r1, r5, r2 + ldrb r0, [r1] + cmp r0, 0 + beq _080AB47C + movs r0, 0 + strb r0, [r1] + movs r3, 0xB8 + lsls r3, 1 + adds r0, r5, r3 + adds r2, 0xC + adds r1, r5, r2 + movs r3, 0 + ldrsh r1, [r1, r3] + subs r2, 0x26 + adds r4, r5, r2 + ldrb r2, [r4] + ldr r3, _080AB4C8 + strb r2, [r3, r5] + movs r2, 0 + ldrsb r2, [r4, r2] + bl sub_80A6EFC +_080AB47C: + mov r0, r9 + adds r0, 0x1 + lsls r0, 16 + asrs r0, 16 + mov r9, r0 + movs r0, 0xF8 + lsls r0, 1 + adds r5, r0 + mov r1, r9 + cmp r1, 0x17 + bgt _080AB494 + b _080AB266 +_080AB494: + ldr r0, _080AB4CC + ldr r6, [r0] + ldr r0, _080AB4D0 + ldr r5, [r0] + movs r0, 0 + str r0, [r6] + str r0, [r6, 0x4] + movs r2, 0x2 + ldrsh r1, [r5, r2] + subs r0, 0x1 + cmp r1, r0 + beq _080AB4BE + movs r3, 0x8E + lsls r3, 1 + adds r0, r5, r3 + ldr r1, [r0] + movs r3, 0x80 + lsls r3, 6 + ands r3, r1 + cmp r3, 0 + beq _080AB4D4 +_080AB4BE: + bl sub_80AB5A4 + b _080AB594 + .align 2, 0 +_080AB4C4: .4byte gUnknown_811828C +_080AB4C8: .4byte 0x0000015d +_080AB4CC: .4byte gUnknown_3001B80 +_080AB4D0: .4byte gUnknown_3001B84 +_080AB4D4: + movs r0, 0x80 + lsls r0, 5 + ands r1, r0 + cmp r1, 0 + beq _080AB590 + ldr r7, [r6, 0x24] + cmp r7, 0 + bge _080AB51E + adds r2, r6, 0 + adds r2, 0x2C + str r3, [r6, 0x24] + str r3, [r6, 0x2C] + movs r1, 0xA2 + lsls r1, 1 + adds r0, r5, r1 + ldr r0, [r0] + ldr r1, [r5, 0x14] + adds r0, r1 + str r0, [r2, 0x4] + movs r3, 0xA4 + lsls r3, 1 + adds r0, r5, r3 + ldr r0, [r0] + ldr r1, [r5, 0x18] + adds r0, r1 + str r0, [r2, 0x8] + adds r0, r6, 0 + movs r2, 0 + movs r1, 0x2 +_080AB50E: + str r2, [r0, 0x8] + str r2, [r0] + str r2, [r0, 0x4] + subs r1, 0x1 + adds r0, 0xC + cmp r1, 0 + bge _080AB50E + b _080AB594 +_080AB51E: + adds r2, r7, 0x1 + adds r0, r2, 0 + cmp r2, 0 + bge _080AB52A + adds r0, r7, 0 + adds r0, 0x40 +_080AB52A: + asrs r1, r0, 6 + lsls r0, r1, 6 + subs r1, r2, r0 + str r1, [r6, 0x24] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, 0x2C + adds r0, r6 + mov r8, r0 + movs r1, 0xA2 + lsls r1, 1 + adds r0, r5, r1 + ldr r2, [r0] + ldr r0, [r5, 0x14] + adds r2, r0 + mov r3, r8 + str r2, [r3, 0x4] + adds r1, 0x4 + adds r0, r5, r1 + ldr r1, [r0] + ldr r0, [r5, 0x18] + adds r1, r0 + str r1, [r3, 0x8] + lsls r0, r7, 1 + adds r0, r7 + lsls r0, 2 + adds r0, 0x2C + adds r0, r6, r0 + ldr r3, [r0, 0x4] + ldr r0, [r0, 0x8] + subs r0, r1, r0 + subs r2, r3 + cmp r2, 0 + bge _080AB572 + negs r2, r2 +_080AB572: + adds r4, r2, 0 + cmp r0, 0 + bge _080AB57A + negs r0, r0 +_080AB57A: + cmp r0, r4 + bge _080AB580 + adds r0, r2, 0 +_080AB580: + mov r2, r8 + str r0, [r2] + cmp r0, 0 + bgt _080AB58C + str r7, [r6, 0x24] + b _080AB594 +_080AB58C: + str r0, [r6] + b _080AB594 +_080AB590: + bl sub_80AB5A4 +_080AB594: + add sp, 0x3C + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80AB254 + + thumb_func_start sub_80AB5A4 +sub_80AB5A4: + push {lr} + ldr r3, _080AB5D0 + ldr r0, [r3] + movs r2, 0x1 + negs r2, r2 + str r2, [r0, 0x24] + adds r0, 0x28 + movs r1, 0xFF + strb r1, [r0] + ldr r3, [r3] + movs r1, 0 + movs r0, 0x2 +_080AB5BC: + str r2, [r3, 0x8] + str r1, [r3] + str r1, [r3, 0x4] + subs r0, 0x1 + adds r3, 0xC + cmp r0, 0 + bge _080AB5BC + pop {r0} + bx r0 + .align 2, 0 +_080AB5D0: .4byte gUnknown_3001B80 + thumb_func_end sub_80AB5A4 + + thumb_func_start sub_80AB5D4 +sub_80AB5D4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x2C + mov r9, r0 + ldr r4, _080AB6BC + movs r2, 0x9E + lsls r2, 1 + add r2, r9 + movs r0, 0 + ldrsh r1, [r2, r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + ldr r3, [r4] + adds r0, r3 + mov r8, r0 + adds r0, r1, 0 + adds r5, r4, 0 + cmp r0, 0 + bne _080AB604 + b _080AB9E6 +_080AB604: + movs r1, 0xAF + lsls r1, 1 + add r1, r9 + movs r0, 0xC0 + lsls r0, 2 + strh r0, [r1] + movs r1, 0xB0 + lsls r1, 1 + add r1, r9 + movs r0, 0x1 + strh r0, [r1] + movs r0, 0x8E + lsls r0, 1 + add r0, r9 + ldr r2, [r0] + movs r0, 0x80 + lsls r0, 6 + ands r2, r0 + cmp r2, 0 + beq _080AB6D4 + movs r2, 0xA1 + lsls r2, 1 + add r2, r9 + movs r0, 0 + ldrsb r0, [r2, r0] + cmp r0, 0x4 + bne _080AB64C + movs r0, 0xB4 + lsls r0, 1 + add r0, r9 + movs r3, 0 + ldrsh r1, [r0, r3] + movs r0, 0x80 + lsls r0, 4 + cmp r1, r0 + beq _080AB670 +_080AB64C: + movs r1, 0xB2 + lsls r1, 1 + add r1, r9 + movs r0, 0 + str r0, [r1] + movs r1, 0xB4 + lsls r1, 1 + add r1, r9 + movs r0, 0x80 + lsls r0, 4 + strh r0, [r1] + movs r0, 0x4 + strb r0, [r2] + movs r1, 0xAE + lsls r1, 1 + add r1, r9 + movs r0, 0x1 + strb r0, [r1] +_080AB670: + ldr r0, [r5] + adds r2, r0, 0 + adds r2, 0x28 + movs r1, 0 + ldrsb r1, [r2, r1] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080AB69C + movs r2, 0x80 + lsls r2, 1 + mov r0, sp + bl sub_8002BB8 + ldr r0, [sp] + ldr r1, [sp, 0x4] + str r0, [sp, 0x8] + str r1, [sp, 0xC] + add r1, sp, 0x8 + mov r0, r9 + bl sub_80A9F94 +_080AB69C: + mov r4, r8 + ldr r0, [r4, 0x8] + cmp r0, 0 + blt _080AB6A6 + b _080AB9E6 +_080AB6A6: + ldr r0, [r5] + ldr r0, [r0, 0x24] + cmp r0, 0 + bge _080AB6B0 + b _080AB9E6 +_080AB6B0: + str r0, [r4, 0x8] + movs r0, 0 + str r0, [r4] + str r0, [r4, 0x4] + b _080AB9E6 + .align 2, 0 +_080AB6BC: .4byte gUnknown_3001B80 +_080AB6C0: + ldr r5, [sp, 0x28] + ldr r0, [r5, 0x4] + adds r0, r7, r0 + str r0, [r5, 0x4] + b _080AB7E2 +_080AB6CA: + ldr r1, [sp, 0x28] + ldr r0, [r1, 0x4] + subs r0, r7 + str r0, [r1, 0x4] + b _080AB7E2 +_080AB6D4: + movs r0, 0xA2 + lsls r0, 1 + add r0, r9 + ldr r1, [r0] + mov r5, r9 + ldr r0, [r5, 0x14] + adds r0, r1, r0 + str r0, [sp, 0x20] + movs r0, 0xA4 + lsls r0, 1 + add r0, r9 + ldr r1, [r0] + ldr r0, [r5, 0x18] + adds r0, r1, r0 + str r0, [sp, 0x24] + ldr r0, [sp, 0x20] + ldr r1, [sp, 0x24] + str r0, [sp, 0x10] + str r1, [sp, 0x14] + mov r1, r8 + ldr r0, [r1, 0x8] + cmp r0, 0 + bge _080AB710 + ldr r0, [r3, 0x24] + cmp r0, 0 + bge _080AB70A + b _080AB9E6 +_080AB70A: + str r0, [r1, 0x8] + str r2, [r1] + str r2, [r1, 0x4] +_080AB710: + mov r2, r8 + ldr r7, [r2] + movs r3, 0x1 + mov r10, r3 + mov r5, sp + adds r5, 0x10 + str r5, [sp, 0x28] +_080AB71E: + mov r0, r8 + ldr r1, [r0, 0x8] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, 0x2C + ldr r2, _080AB754 + ldr r1, [r2] + adds r1, r0 + mov r12, r1 + ldr r6, [r1, 0x4] + ldr r5, [sp, 0x10] + subs r4, r6, r5 + adds r2, r4, 0 + ldr r1, [r1, 0x8] + ldr r0, [sp, 0x14] + subs r3, r1, r0 + cmp r4, 0 + ble _080AB75E + cmp r2, r7 + ble _080AB758 + adds r0, r7, r5 + str r0, [sp, 0x10] + movs r4, 0 + mov r10, r4 + b _080AB75A + .align 2, 0 +_080AB754: .4byte gUnknown_3001B80 +_080AB758: + str r6, [sp, 0x10] +_080AB75A: + adds r1, r2, 0 + b _080AB778 +_080AB75E: + cmp r4, 0 + bge _080AB776 + cmn r2, r7 + bge _080AB770 + subs r0, r5, r7 + str r0, [sp, 0x10] + movs r5, 0 + mov r10, r5 + b _080AB772 +_080AB770: + str r6, [sp, 0x10] +_080AB772: + negs r1, r2 + b _080AB778 +_080AB776: + movs r1, 0 +_080AB778: + cmp r3, 0 + ble _080AB78E + cmp r3, r7 + bgt _080AB6C0 + mov r4, r12 + ldr r0, [r4, 0x8] + str r0, [sp, 0x14] + cmp r3, r1 + ble _080AB7A2 + adds r1, r3, 0 + b _080AB7A2 +_080AB78E: + cmp r3, 0 + bge _080AB7A2 + cmn r3, r7 + blt _080AB6CA + mov r5, r12 + ldr r0, [r5, 0x8] + str r0, [sp, 0x14] + cmn r3, r1 + bge _080AB7A2 + negs r1, r3 +_080AB7A2: + mov r0, r10 + cmp r0, 0 + beq _080AB7E2 + subs r7, r1 + cmp r7, 0 + ble _080AB7E2 + ldr r1, _080AB7D4 + ldr r0, [r1] + mov r3, r8 + ldr r2, [r3, 0x8] + ldr r0, [r0, 0x24] + cmp r2, r0 + beq _080AB7D8 + adds r1, r2, 0x1 + adds r0, r1, 0 + cmp r1, 0 + bge _080AB7C8 + adds r0, r2, 0 + adds r0, 0x40 +_080AB7C8: + asrs r0, 6 + lsls r0, 6 + subs r0, r1, r0 + mov r4, r8 + str r0, [r4, 0x8] + b _080AB7DC + .align 2, 0 +_080AB7D4: .4byte gUnknown_3001B80 +_080AB7D8: + movs r5, 0 + mov r10, r5 +_080AB7DC: + mov r0, r10 + cmp r0, 0 + bne _080AB71E +_080AB7E2: + mov r1, r8 + ldr r0, [r1, 0x8] + bl sub_80ABA00 + adds r6, r0, 0 + ldr r0, _080AB860 + ldr r7, [r0] + movs r2, 0x9E + lsls r2, 1 + add r2, r9 + mov r10, r2 + movs r3, 0 + ldrsh r2, [r2, r3] + subs r1, r2, 0x1 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r1, r7, 0x4 + adds r1, r0 + ldr r0, _080AB864 + lsls r2, 2 + adds r2, r0 + ldr r1, [r1] + ldr r0, [r2] + adds r1, r0 + mov r12, r1 + mov r4, r8 + ldr r1, [r4, 0x8] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, 0x2C + adds r0, r7, r0 + ldr r3, [r0, 0x4] + ldr r2, [sp, 0x10] + ldr r1, [r0, 0x8] + ldr r5, [sp, 0x28] + ldr r0, [r5, 0x4] + subs r1, r0 + subs r3, r2 + cmp r3, 0 + bge _080AB838 + negs r3, r3 +_080AB838: + adds r4, r3, 0 + cmp r1, 0 + bge _080AB840 + negs r1, r1 +_080AB840: + cmp r1, r4 + bge _080AB846 + adds r1, r3, 0 +_080AB846: + adds r6, r1 + mov r0, r8 + str r6, [r0, 0x4] + cmp r6, r12 + bgt _080AB86C + ldr r0, [r0] + cmp r0, 0 + ble _080AB8B2 + ldr r1, _080AB868 + adds r0, r1 + mov r2, r8 + b _080AB8B0 + .align 2, 0 +_080AB860: .4byte gUnknown_3001B80 +_080AB864: .4byte gUnknown_8118050 +_080AB868: .4byte 0xffffff00 +_080AB86C: + mov r3, r10 + movs r4, 0 + ldrsh r1, [r3, r4] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 11 + cmp r6, r0 + bgt _080AB88E + mov r5, r8 + ldr r0, [r5] + cmp r0, 0xFF + bgt _080AB8B2 + movs r1, 0x80 + lsls r1, 1 + adds r0, r1 + str r0, [r5] + b _080AB8B2 +_080AB88E: + subs r1, 0x1 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, r7, r0 + ldr r0, [r0] + cmp r0, 0xFF + bgt _080AB8A2 + movs r0, 0x80 + lsls r0, 1 +_080AB8A2: + mov r2, r8 + ldr r1, [r2] + cmp r1, r0 + bge _080AB8B2 + movs r3, 0x80 + lsls r3, 1 + adds r0, r1, r3 +_080AB8B0: + str r0, [r2] +_080AB8B2: + ldr r0, _080AB96C + ldr r3, [r0] + mov r4, r8 + ldr r0, [r4, 0x8] + subs r0, 0x40 + ldr r2, [r3, 0x24] + subs r1, r2, r0 + adds r0, r1, 0 + cmp r1, 0 + bge _080AB8C8 + adds r0, 0x3F +_080AB8C8: + asrs r0, 6 + lsls r0, 6 + subs r0, r1, r0 + cmp r0, 0x3B + ble _080AB8FC + adds r1, r2, 0x5 + adds r0, r1, 0 + cmp r1, 0 + bge _080AB8DE + adds r0, r2, 0 + adds r0, 0x44 +_080AB8DE: + asrs r0, 6 + lsls r0, 6 + subs r0, r1, r0 + mov r5, r8 + str r0, [r5, 0x8] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + adds r0, r3, 0 + adds r0, 0x30 + adds r0, r1 + ldr r1, [r0, 0x4] + ldr r0, [r0] + str r0, [sp, 0x10] + str r1, [sp, 0x14] +_080AB8FC: + mov r0, r9 + ldr r1, [sp, 0x28] + bl sub_80A9F20 + adds r6, r0, 0 + cmp r6, 0 + bne _080AB9E6 + ldr r0, [sp, 0x10] + ldr r1, [sp, 0x20] + subs r0, r1 + str r0, [sp, 0x18] + ldr r2, [sp, 0x28] + ldr r1, [r2, 0x4] + ldr r3, [sp, 0x24] + subs r1, r3 + add r0, sp, 0x18 + str r1, [r0, 0x4] + movs r5, 0xA1 + lsls r5, 1 + add r5, r9 + movs r4, 0 + ldrsb r4, [r5, r4] + bl sub_8002C60 + adds r1, r0, 0 + lsls r1, 24 + asrs r1, 24 + adds r0, r4, 0 + bl sub_8002B04 + strb r0, [r5] + mov r4, r8 + ldr r0, [r4] + cmp r0, 0 + ble _080AB970 + movs r1, 0xB2 + lsls r1, 1 + add r1, r9 + movs r0, 0x4 + str r0, [r1] + ldr r1, [r4] + movs r0, 0x80 + lsls r0, 2 + movs r2, 0x80 + lsls r2, 4 + cmp r1, r0 + ble _080AB95E + movs r2, 0xA0 + lsls r2, 4 +_080AB95E: + adds r4, r2, 0 + mov r0, r9 + movs r1, 0x1 + bl sub_80AAF68 + b _080AB982 + .align 2, 0 +_080AB96C: .4byte gUnknown_3001B80 +_080AB970: + ldr r4, _080AB9F8 + movs r0, 0xB2 + lsls r0, 1 + add r0, r9 + str r6, [r0] + mov r0, r9 + movs r1, 0 + bl sub_80AAF68 +_080AB982: + movs r0, 0xAE + lsls r0, 1 + add r0, r9 + ldrb r0, [r0] + cmp r0, 0 + bne _080AB9B6 + movs r0, 0xB4 + lsls r0, 1 + add r0, r9 + movs r5, 0 + ldrsh r0, [r0, r5] + cmp r4, r0 + bne _080AB9B6 + ldr r1, _080AB9FC + add r1, r9 + movs r0, 0xA1 + lsls r0, 1 + add r0, r9 + ldrb r1, [r1] + lsls r1, 24 + asrs r1, 24 + ldrb r0, [r0] + lsls r0, 24 + asrs r0, 24 + cmp r1, r0 + beq _080AB9E6 +_080AB9B6: + movs r1, 0xAE + lsls r1, 1 + add r1, r9 + movs r0, 0 + strb r0, [r1] + movs r0, 0xB8 + lsls r0, 1 + add r0, r9 + movs r1, 0xB4 + lsls r1, 1 + add r1, r9 + strh r4, [r1] + movs r3, 0xA1 + lsls r3, 1 + add r3, r9 + ldrb r1, [r3] + ldr r2, _080AB9FC + add r2, r9 + strb r1, [r2] + movs r2, 0 + ldrsb r2, [r3, r2] + adds r1, r4, 0 + bl sub_80A6EFC +_080AB9E6: + add sp, 0x2C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080AB9F8: .4byte 0x00000807 +_080AB9FC: .4byte 0x0000015d + thumb_func_end sub_80AB5D4 + + thumb_func_start sub_80ABA00 +sub_80ABA00: + push {r4,r5,lr} + adds r1, r0, 0 + movs r4, 0 + ldr r0, _080ABA34 + ldr r2, [r0] + ldr r3, [r2, 0x24] + adds r5, r0, 0 + cmp r3, r1 + ble _080ABA38 + adds r1, 0x1 + cmp r1, r3 + bge _080ABA72 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, 0x2C + adds r2, r0, r2 + subs r1, r3, r1 +_080ABA24: + ldr r0, [r2] + adds r4, r0 + adds r2, 0xC + subs r1, 0x1 + cmp r1, 0 + bne _080ABA24 + b _080ABA72 + .align 2, 0 +_080ABA34: .4byte gUnknown_3001B80 +_080ABA38: + cmp r3, r1 + bge _080ABA72 + adds r1, 0x1 + cmp r1, 0x3F + bgt _080ABA58 + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 2 + adds r0, 0x2C + adds r2, r0, r2 +_080ABA4C: + ldr r0, [r2] + adds r4, r0 + adds r2, 0xC + adds r1, 0x1 + cmp r1, 0x3F + ble _080ABA4C +_080ABA58: + ldr r1, [r5] + ldr r0, [r1, 0x24] + cmp r0, 0 + ble _080ABA72 + adds r2, r1, 0 + adds r2, 0x2C + adds r1, r0, 0 +_080ABA66: + ldr r0, [r2] + adds r4, r0 + adds r2, 0xC + subs r1, 0x1 + cmp r1, 0 + bne _080ABA66 +_080ABA72: + adds r0, r4, 0 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80ABA00 + + thumb_func_start sub_80ABA7C +sub_80ABA7C: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + ldr r0, _080ABB50 + ldr r5, [r0] + movs r0, 0 + mov r8, r0 + movs r1, 0xA2 + lsls r1, 1 + adds r4, r5, r1 + movs r2, 0x1 + negs r2, r2 + mov r9, r2 +_080ABA9A: + movs r1, 0x2 + ldrsh r0, [r5, r1] + cmp r0, r9 + beq _080ABB2C + ldr r0, [r4] + ldr r1, [r5, 0x14] + adds r0, r1 + str r0, [sp] + ldr r0, [r4, 0x4] + ldr r1, [r5, 0x18] + adds r0, r1 + str r0, [sp, 0x4] + ldr r1, [r4, 0x10] + ldr r0, [r4, 0x14] + adds r7, r1, r0 + ldr r0, [r4, 0x20] + cmp r0, 0 + ble _080ABADA + subs r0, 0x1 + str r0, [r4, 0x20] + cmp r0, 0 + bgt _080ABADA + ldrh r0, [r4, 0x1C] + subs r0, 0x1 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0x1 + bhi _080ABADA + ldrh r1, [r4, 0x1C] + adds r0, r5, 0 + bl sub_80A9750 +_080ABADA: + movs r2, 0xB8 + lsls r2, 1 + adds r6, r5, r2 + adds r0, r6, 0 + bl sub_80A66D4 + lsls r0, 24 + cmp r0, 0 + beq _080ABAFE + movs r0, 0 + strb r0, [r4, 0x18] + movs r0, 0x24 + ldrsh r1, [r4, r0] + movs r2, 0x19 + ldrsb r2, [r4, r2] + adds r0, r6, 0 + bl sub_80A6EFC +_080ABAFE: + movs r1, 0x26 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080ABB1E + adds r1, r0, 0 + movs r2, 0xA1 + lsls r2, 1 + adds r0, r5, r2 + movs r2, 0 + ldrsb r2, [r0, r2] + ldr r3, [r4, 0x28] + adds r0, r6, 0 + bl sub_80A74F0 + movs r0, 0 + strh r0, [r4, 0x26] +_080ABB1E: + movs r0, 0x8 + ldrsh r1, [r5, r0] + adds r0, r6, 0 + mov r2, sp + adds r3, r7, 0 + bl sub_80A7524 +_080ABB2C: + mov r0, r8 + adds r0, 0x1 + lsls r0, 16 + asrs r0, 16 + mov r8, r0 + movs r1, 0xF8 + lsls r1, 1 + adds r4, r1 + adds r5, r1 + cmp r0, 0x17 + ble _080ABA9A + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080ABB50: .4byte gUnknown_3001B84 + thumb_func_end sub_80ABA7C + + thumb_func_start sub_80ABB54 +sub_80ABB54: + push {r4,r5,lr} + ldr r4, _080ABB90 + movs r0, 0xE2 + lsls r0, 5 + movs r1, 0x6 + bl MemoryAlloc + str r0, [r4] + adds r1, r0, 0 + ldr r0, _080ABB94 + adds r5, r0, 0 + movs r4, 0xE2 + lsls r4, 1 + movs r2, 0x80 + lsls r2, 9 + adds r3, r2, 0 +_080ABB74: + ldrh r0, [r1, 0x6] + orrs r0, r5 + strh r0, [r1, 0x6] + adds r0, r2, 0 + adds r2, r3 + asrs r0, 16 + adds r1, r4 + cmp r0, 0xF + ble _080ABB74 + bl sub_80ABB98 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080ABB90: .4byte gUnknown_3001B88 +_080ABB94: .4byte 0x0000ffff + thumb_func_end sub_80ABB54 + + thumb_func_start sub_80ABB98 +sub_80ABB98: + push {r4-r6,lr} + ldr r0, _080ABBD0 + ldr r4, [r0] + movs r1, 0 + movs r6, 0x1 + negs r6, r6 + movs r5, 0x80 + lsls r5, 9 +_080ABBA8: + movs r2, 0x6 + ldrsh r0, [r4, r2] + cmp r0, r6 + beq _080ABBB6 + adds r0, r1, 0 + bl sub_80AC168 +_080ABBB6: + adds r0, r5, 0 + movs r1, 0x80 + lsls r1, 9 + adds r5, r1 + asrs r1, r0, 16 + movs r2, 0xE2 + lsls r2, 1 + adds r4, r2 + cmp r1, 0xF + ble _080ABBA8 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080ABBD0: .4byte gUnknown_3001B88 + thumb_func_end sub_80ABB98 + + thumb_func_start sub_80ABBD4 +sub_80ABBD4: + push {r4,lr} + bl sub_80ABB98 + ldr r4, _080ABBEC + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080ABBEC: .4byte gUnknown_3001B88 + thumb_func_end sub_80ABBD4 + + thumb_func_start sub_80ABBF0 +sub_80ABBF0: + push {r4-r7,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 16 + asrs r4, 16 + lsls r1, 16 + asrs r7, r1, 16 + lsls r2, 24 + asrs r6, r2, 24 + ldr r1, _080ABC54 + adds r0, r4, 0 + bl sub_80A77D0 + adds r5, r0, 0 + ldr r1, _080ABC58 + str r6, [sp] + movs r0, 0 + adds r2, r4, 0 + adds r3, r7, 0 + bl Log + lsls r1, r7, 3 + ldr r0, [r5, 0x4] + adds r0, r1 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + ldr r0, [r0, 0x4] + adds r0, r1 + ldr r5, [r0, 0xC] + ldr r0, [r0, 0x8] + cmp r0, 0 + ble _080ABC4A + adds r4, r0, 0 +_080ABC34: + movs r0, 0x1 + negs r0, r0 + adds r1, r5, 0 + adds r2, r7, 0 + adds r3, r6, 0 + bl sub_80ABD88 + subs r4, 0x1 + adds r5, 0x18 + cmp r4, 0 + bne _080ABC34 +_080ABC4A: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080ABC54: .4byte gUnknown_81183E4 +_080ABC58: .4byte gUnknown_81183F0 + thumb_func_end sub_80ABBF0 + + thumb_func_start sub_80ABC5C +sub_80ABC5C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + asrs r7, r0, 16 + lsls r1, 24 + asrs r5, r1, 24 + ldr r1, _080ABCC4 + movs r0, 0 + adds r2, r7, 0 + bl Log + movs r1, 0 + ldr r0, _080ABCC8 + ldr r4, [r0] + movs r0, 0x1 + negs r0, r0 + mov r8, r0 + movs r6, 0x80 + lsls r6, 9 +_080ABC84: + movs r2, 0x6 + ldrsh r0, [r4, r2] + cmp r0, r8 + beq _080ABCA6 + movs r2, 0x8 + ldrsh r0, [r4, r2] + cmp r0, r7 + bne _080ABCA6 + cmp r5, 0 + blt _080ABCA0 + movs r0, 0xA + ldrsb r0, [r4, r0] + cmp r0, r5 + bne _080ABCA6 +_080ABCA0: + adds r0, r1, 0 + bl sub_80AC168 +_080ABCA6: + adds r0, r6, 0 + movs r1, 0x80 + lsls r1, 9 + adds r6, r1 + asrs r1, r0, 16 + movs r2, 0xE2 + lsls r2, 1 + adds r4, r2 + cmp r1, 0xF + ble _080ABC84 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080ABCC4: .4byte gUnknown_8118414 +_080ABCC8: .4byte gUnknown_3001B88 + thumb_func_end sub_80ABC5C + + thumb_func_start sub_80ABCCC +sub_80ABCCC: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + ldr r1, _080ABD40 + movs r0, 0 + bl Log + movs r6, 0 + ldr r0, _080ABD44 + ldr r4, [r0] + movs r0, 0x1 + negs r0, r0 + mov r8, r0 + movs r1, 0x92 + lsls r1, 1 + adds r5, r4, r1 + mov r7, sp +_080ABCF0: + movs r1, 0x6 + ldrsh r0, [r4, r1] + cmp r0, r8 + beq _080ABD20 + ldr r0, [r5] + ldr r1, [r4, 0x14] + adds r0, r1 + str r0, [sp] + ldr r0, [r5, 0x4] + ldr r1, [r4, 0x18] + adds r0, r1 + str r0, [r7, 0x4] + movs r1, 0xA2 + lsls r1, 1 + adds r0, r4, r1 + mov r1, sp + bl sub_80A675C + lsls r0, 24 + cmp r0, 0 + bne _080ABD20 + adds r0, r6, 0 + bl sub_80AC168 +_080ABD20: + adds r0, r6, 0x1 + lsls r0, 16 + asrs r6, r0, 16 + movs r0, 0xE2 + lsls r0, 1 + adds r5, r0 + adds r4, r0 + cmp r6, 0xF + ble _080ABCF0 + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080ABD40: .4byte gUnknown_811842C +_080ABD44: .4byte gUnknown_3001B88 + thumb_func_end sub_80ABCCC + + thumb_func_start sub_80ABD48 +sub_80ABD48: + push {r4-r7,lr} + lsls r0, 16 + asrs r4, r0, 16 + movs r3, 0 + ldr r0, _080ABD6C + ldr r1, [r0] + movs r6, 0xE2 + lsls r6, 1 + movs r2, 0x80 + lsls r2, 9 + adds r5, r2, 0 +_080ABD5E: + movs r7, 0x6 + ldrsh r0, [r1, r7] + cmp r0, r4 + bne _080ABD70 + adds r0, r3, 0 + b _080ABD80 + .align 2, 0 +_080ABD6C: .4byte gUnknown_3001B88 +_080ABD70: + adds r0, r2, 0 + adds r2, r5 + asrs r3, r0, 16 + adds r1, r6 + cmp r3, 0xF + ble _080ABD5E + movs r0, 0x1 + negs r0, r0 +_080ABD80: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80ABD48 + + thumb_func_start sub_80ABD88 +sub_80ABD88: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x14 + mov r8, r1 + lsls r0, 16 + asrs r7, r0, 16 + lsls r2, 16 + asrs r2, 16 + mov r10, r2 + lsls r3, 24 + asrs r3, 24 + mov r9, r3 + ldrb r4, [r1] + cmp r4, 0x1A + bne _080ABDDA + movs r0, 0 + movs r1, 0x28 + bl sub_8001658 + cmp r0, 0x1 + bgt _080ABDBC + movs r4, 0x1B + b _080ABDDA +_080ABDBC: + movs r0, 0 + movs r1, 0x29 + bl sub_8001658 + cmp r0, 0 + bne _080ABDD4 + movs r0, 0 + movs r1, 0x27 + bl sub_8001658 + adds r0, 0x1C + b _080ABDD6 +_080ABDD4: + adds r0, 0x2B +_080ABDD6: + lsls r0, 16 + asrs r4, r0, 16 +_080ABDDA: + lsls r1, r4, 2 + ldr r0, _080ABE10 + adds r6, r1, r0 + cmp r7, 0 + bge _080ABE40 + cmp r4, 0xE + bgt _080ABDF4 + cmp r4, 0xD + blt _080ABDF4 + adds r0, r4, 0 + bl sub_80ABD48 + adds r7, r0, 0 +_080ABDF4: + cmp r7, 0 + bge _080ABE40 + movs r3, 0 + ldr r0, _080ABE14 + ldr r5, [r0] + movs r0, 0x6 + ldrsh r1, [r5, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080ABE18 + movs r7, 0 + b _080ABE40 + .align 2, 0 +_080ABE10: .4byte gUnknown_811ED20 +_080ABE14: .4byte gUnknown_3001B88 +_080ABE18: + adds r0, r3, 0x1 + lsls r0, 16 + asrs r3, r0, 16 + movs r1, 0xE2 + lsls r1, 1 + adds r5, r1 + cmp r3, 0xF + bgt _080ABE36 + movs r2, 0x6 + ldrsh r1, [r5, r2] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080ABE18 + adds r7, r3, 0 +_080ABE36: + cmp r7, 0 + bge _080ABE40 + movs r0, 0x1 + negs r0, r0 + b _080AC142 +_080ABE40: + ldr r1, _080ABEA8 + lsls r0, r7, 3 + subs r0, r7 + lsls r0, 4 + adds r0, r7 + lsls r0, 2 + ldr r1, [r1] + adds r5, r1, r0 + ldr r1, _080ABEAC + mov r3, r8 + ldrb r0, [r3] + str r0, [sp] + movs r2, 0 + ldrsh r0, [r6, r2] + str r0, [sp, 0x4] + mov r3, r10 + str r3, [sp, 0x8] + mov r0, r9 + str r0, [sp, 0xC] + movs r0, 0 + adds r2, r7, 0 + adds r3, r4, 0 + bl Log + movs r2, 0 + movs r3, 0x6 + ldrsh r1, [r5, r3] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080ABE80 + movs r2, 0x1 +_080ABE80: + str r2, [sp, 0x10] + strh r7, [r5, 0x4] + strh r4, [r5, 0x6] + mov r0, r10 + strh r0, [r5, 0x8] + mov r1, r9 + strb r1, [r5, 0xA] + ldrh r0, [r6] + subs r0, 0x1 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0xE + bls _080ABE9C + b _080ABF8C +_080ABE9C: + lsls r0, 2 + ldr r1, _080ABEB0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080ABEA8: .4byte gUnknown_3001B88 +_080ABEAC: .4byte gUnknown_8118448 +_080ABEB0: .4byte _080ABEB4 + .align 2, 0 +_080ABEB4: + .4byte _080ABEF0 + .4byte _080ABF7C + .4byte _080ABF46 + .4byte _080ABF54 + .4byte _080ABF54 + .4byte _080ABF5E + .4byte _080ABF68 + .4byte _080ABF72 + .4byte _080ABF3C + .4byte _080ABEFA + .4byte _080ABEF0 + .4byte _080ABF06 + .4byte _080ABF2C + .4byte _080ABF1E + .4byte _080ABF12 +_080ABEF0: + movs r2, 0x8E + lsls r2, 1 + adds r1, r5, r2 + movs r0, 0 + b _080ABF94 +_080ABEFA: + movs r3, 0x8E + lsls r3, 1 + adds r1, r5, r3 + movs r0, 0x80 + lsls r0, 10 + b _080ABF94 +_080ABF06: + movs r0, 0x8E + lsls r0, 1 + adds r1, r5, r0 + movs r0, 0x80 + lsls r0, 11 + b _080ABF94 +_080ABF12: + movs r2, 0x8E + lsls r2, 1 + adds r1, r5, r2 + movs r0, 0x83 + lsls r0, 18 + b _080ABF94 +_080ABF1E: + movs r3, 0x8E + lsls r3, 1 + adds r1, r5, r3 + ldr r0, _080ABF28 + b _080ABF94 + .align 2, 0 +_080ABF28: .4byte 0x220c0000 +_080ABF2C: + movs r0, 0x8E + lsls r0, 1 + adds r1, r5, r0 + ldr r0, _080ABF38 + b _080ABF94 + .align 2, 0 +_080ABF38: .4byte 0x20010000 +_080ABF3C: + movs r2, 0x8E + lsls r2, 1 + adds r1, r5, r2 + movs r0, 0x5 + b _080ABF94 +_080ABF46: + movs r3, 0x8E + lsls r3, 1 + adds r1, r5, r3 + ldr r0, _080ABF50 + b _080ABF94 + .align 2, 0 +_080ABF50: .4byte 0x22000184 +_080ABF54: + movs r0, 0x8E + lsls r0, 1 + adds r1, r5, r0 + adds r0, 0x68 + b _080ABF94 +_080ABF5E: + movs r2, 0x8E + lsls r2, 1 + adds r1, r5, r2 + movs r0, 0x44 + b _080ABF94 +_080ABF68: + movs r3, 0x8E + lsls r3, 1 + adds r1, r5, r3 + movs r0, 0x84 + b _080ABF94 +_080ABF72: + movs r0, 0x8E + lsls r0, 1 + adds r1, r5, r0 + adds r0, 0x64 + b _080ABF94 +_080ABF7C: + movs r2, 0x8E + lsls r2, 1 + adds r1, r5, r2 + ldr r0, _080ABF88 + b _080ABF94 + .align 2, 0 +_080ABF88: .4byte 0x020000c4 +_080ABF8C: + movs r3, 0x8E + lsls r3, 1 + adds r1, r5, r3 + ldr r0, _080ABFA8 +_080ABF94: + str r0, [r1] + ldrb r0, [r6, 0x2] + cmp r0, 0 + bne _080ABFAC + mov r1, r8 + ldrb r0, [r1, 0x2] + lsls r0, 11 + str r0, [r5, 0xC] + ldrb r0, [r1, 0x3] + b _080ABFB4 + .align 2, 0 +_080ABFA8: .4byte 0x02000185 +_080ABFAC: + ldrb r0, [r6, 0x2] + lsls r0, 11 + str r0, [r5, 0xC] + ldrb r0, [r6, 0x3] +_080ABFB4: + lsls r0, 11 + str r0, [r5, 0x10] + ldr r0, [r5, 0xC] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + str r0, [r5, 0x14] + ldr r0, [r5, 0x10] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + str r0, [r5, 0x18] + mov r2, r8 + ldrb r0, [r2, 0x1] + strb r0, [r5, 0x1C] + adds r2, 0x4 + adds r4, r5, 0 + adds r4, 0x20 + ldrb r1, [r2, 0x2] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _080ABFFC + mov r3, r8 + ldrb r0, [r3, 0x4] + lsls r3, r0, 11 + str r3, [r5, 0x20] + ldrb r1, [r2, 0x2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080ABFFC + movs r1, 0x80 + lsls r1, 3 + adds r0, r3, r1 + str r0, [r5, 0x20] +_080ABFFC: + ldrb r1, [r2, 0x3] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _080AC01E + ldrb r0, [r2, 0x1] + lsls r3, r0, 11 + str r3, [r4, 0x4] + ldrb r1, [r2, 0x3] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080AC01E + movs r2, 0x80 + lsls r2, 3 + adds r0, r3, r2 + str r0, [r4, 0x4] +_080AC01E: + ldr r3, [sp, 0x10] + cmp r3, 0 + beq _080AC076 + ldrb r1, [r5, 0x1C] + movs r2, 0x90 + lsls r2, 1 + adds r0, r5, r2 + movs r3, 0 + strb r1, [r0] + movs r0, 0x92 + lsls r0, 1 + adds r2, r5, r0 + ldr r0, [r5, 0x20] + ldr r1, [r5, 0x14] + subs r0, r1 + str r0, [r2] + movs r1, 0x96 + lsls r1, 1 + adds r2, r5, r1 + ldr r0, [r5, 0x20] + ldr r1, [r5, 0x14] + adds r0, r1 + str r0, [r2] + movs r0, 0x94 + lsls r0, 1 + adds r2, r5, r0 + ldr r0, [r5, 0x24] + ldr r1, [r5, 0x18] + subs r0, r1 + str r0, [r2] + movs r1, 0x98 + lsls r1, 1 + adds r2, r5, r1 + ldr r0, [r5, 0x24] + ldr r1, [r5, 0x18] + adds r0, r1 + str r0, [r2] + movs r2, 0x9A + lsls r2, 1 + adds r1, r5, r2 + adds r2, 0x4 + adds r0, r5, r2 + str r3, [r0] + str r3, [r1] +_080AC076: + adds r0, r5, 0 + adds r0, 0x28 + adds r1, r5, 0 + adds r1, 0x30 + bl sub_80A5778 + ldr r3, [sp, 0x10] + cmp r3, 0 + beq _080AC0C0 + movs r0, 0x9F + lsls r0, 1 + adds r1, r5, r0 + movs r2, 0 + movs r0, 0x80 + lsls r0, 4 + strh r0, [r1] + movs r3, 0x9E + lsls r3, 1 + adds r1, r5, r3 + movs r0, 0x1 + strb r0, [r1] + movs r1, 0xA0 + lsls r1, 1 + adds r0, r5, r1 + strh r2, [r0] + movs r2, 0xA2 + lsls r2, 1 + adds r0, r5, r2 + movs r3, 0x6 + ldrsh r2, [r5, r3] + movs r3, 0x8E + lsls r3, 1 + adds r1, r5, r3 + ldr r3, [r1] + adds r1, r7, 0 + bl sub_80A75CC +_080AC0C0: + adds r4, r5, 0 + adds r4, 0x38 + ldr r1, _080AC154 + mov r0, r9 + str r0, [sp] + adds r0, r4, 0 + adds r2, r5, 0 + mov r3, r10 + bl sub_809D600 + adds r6, r4, 0 + mov r1, r8 + ldr r2, [r1, 0xC] + cmp r2, 0 + bne _080AC0F2 + movs r2, 0xA2 + lsls r2, 1 + adds r0, r5, r2 + bl sub_80A66A4 + lsls r0, 24 + ldr r2, _080AC158 + cmp r0, 0 + beq _080AC0F2 + ldr r2, _080AC15C +_080AC0F2: + adds r0, r6, 0 + movs r1, 0x1 + bl sub_809D6D8 + adds r1, r4, 0 + mov r3, r8 + ldr r2, [r3, 0x10] + cmp r2, 0 + bne _080AC108 + ldr r0, _080AC160 + ldr r2, [r0, 0x38] +_080AC108: + adds r0, r1, 0 + movs r1, 0x2 + bl sub_809D6D8 + mov r0, r8 + ldr r2, [r0, 0x14] + cmp r2, 0 + bne _080AC11C + ldr r0, _080AC160 + ldr r2, [r0, 0x68] +_080AC11C: + adds r0, r4, 0 + movs r1, 0x3 + bl sub_809D6D8 + mov r1, r8 + ldr r2, [r1, 0x8] + cmp r2, 0 + beq _080AC140 + adds r0, r4, 0 + movs r1, 0 + bl sub_809D6D8 + ldr r3, _080AC164 + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl sub_809D8C0 +_080AC140: + adds r0, r7, 0 +_080AC142: + add sp, 0x14 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080AC154: .4byte gUnknown_81182A0 +_080AC158: .4byte gUnknown_81182F4 +_080AC15C: .4byte gUnknown_8118350 +_080AC160: .4byte gUnknown_812F1F8 +_080AC164: .4byte gUnknown_81184A4 + thumb_func_end sub_80ABD88 + + thumb_func_start sub_80AC168 +sub_80AC168: + push {r4,lr} + adds r2, r0, 0 + lsls r2, 16 + asrs r2, 16 + ldr r1, _080AC1A4 + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 4 + adds r0, r2 + lsls r0, 2 + ldr r1, [r1] + adds r4, r1, r0 + ldr r1, _080AC1A8 + movs r0, 0 + bl Log + movs r1, 0xA2 + lsls r1, 1 + adds r0, r4, r1 + bl sub_80A7658 + adds r0, r4, 0 + adds r0, 0x38 + bl sub_809D648 + ldr r0, _080AC1AC + strh r0, [r4, 0x6] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AC1A4: .4byte gUnknown_3001B88 +_080AC1A8: .4byte gUnknown_81184B0 +_080AC1AC: .4byte 0x0000ffff + thumb_func_end sub_80AC168 + + thumb_func_start sub_80AC1B0 +sub_80AC1B0: + push {lr} + adds r3, r1, 0 + lsls r0, 16 + asrs r0, 16 + ldr r2, _080AC1F0 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, [r2] + adds r2, r0, r1 + movs r0, 0x6 + ldrsh r1, [r2, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080AC1EA + movs r1, 0x8E + lsls r1, 1 + adds r0, r2, r1 + ldr r1, [r0] + orrs r1, r3 + str r1, [r0] + movs r3, 0xA2 + lsls r3, 1 + adds r0, r2, r3 + bl sub_80A6688 +_080AC1EA: + pop {r0} + bx r0 + .align 2, 0 +_080AC1F0: .4byte gUnknown_3001B88 + thumb_func_end sub_80AC1B0 + + thumb_func_start sub_80AC1F4 +sub_80AC1F4: + push {r4,lr} + adds r4, r1, 0 + lsls r0, 16 + asrs r0, 16 + ldr r2, _080AC238 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, [r2] + adds r3, r0, r1 + movs r0, 0x6 + ldrsh r1, [r3, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080AC232 + movs r0, 0x8E + lsls r0, 1 + adds r2, r3, r0 + ldr r0, _080AC23C + eors r0, r4 + ldr r1, [r2] + ands r1, r0 + str r1, [r2] + movs r2, 0xA2 + lsls r2, 1 + adds r0, r3, r2 + bl sub_80A6688 +_080AC232: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AC238: .4byte gUnknown_3001B88 +_080AC23C: .4byte 0x337fffff + thumb_func_end sub_80AC1F4 + + thumb_func_start sub_80AC240 +sub_80AC240: + push {lr} + lsls r0, 16 + asrs r0, 16 + ldr r2, _080AC268 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, [r2] + adds r2, r0, r1 + movs r0, 0x6 + ldrsh r1, [r2, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080AC26C + movs r0, 0 + b _080AC270 + .align 2, 0 +_080AC268: .4byte gUnknown_3001B88 +_080AC26C: + adds r0, r2, 0 + adds r0, 0x38 +_080AC270: + pop {r1} + bx r1 + thumb_func_end sub_80AC240 + + thumb_func_start sub_80AC274 +sub_80AC274: + push {r4,lr} + adds r4, r1, 0 + lsls r0, 16 + asrs r0, 16 + lsls r2, 16 + asrs r3, r2, 16 + ldr r2, _080AC2A0 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, [r2] + adds r2, r0, r1 + movs r0, 0x6 + ldrsh r1, [r2, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080AC2A4 + movs r0, 0 + b _080AC2B4 + .align 2, 0 +_080AC2A0: .4byte gUnknown_3001B88 +_080AC2A4: + adds r0, r2, 0 + adds r0, 0x38 + adds r1, r4, 0 + adds r2, r3, 0 + bl sub_809D6E4 + lsls r0, 24 + lsrs r0, 24 +_080AC2B4: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80AC274 + + thumb_func_start sub_80AC2BC +sub_80AC2BC: + push {r4-r6,lr} + adds r3, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r3, 16 + asrs r3, 16 + ldr r1, _080AC2F4 + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 4 + adds r0, r3 + lsls r0, 2 + ldr r1, [r1] + adds r4, r1, r0 + ldr r1, _080AC2F8 + movs r0, 0 + adds r2, r3, 0 + bl Log + movs r0, 0x6 + ldrsh r1, [r4, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080AC2FC + movs r0, 0 + b _080AC314 + .align 2, 0 +_080AC2F4: .4byte gUnknown_3001B88 +_080AC2F8: .4byte gUnknown_81184CC +_080AC2FC: + adds r0, r4, 0 + adds r0, 0x38 + ldr r3, _080AC31C + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_809D790 + movs r0, 0x9E + lsls r0, 1 + adds r1, r4, r0 + movs r0, 0x1 + strb r0, [r1] +_080AC314: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080AC31C: .4byte gUnknown_8118504 + thumb_func_end sub_80AC2BC + + thumb_func_start sub_80AC320 +sub_80AC320: + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + asrs r7, r0, 16 + ldr r0, _080AC374 + ldr r4, [r0] + movs r5, 0 + movs r0, 0x1 + negs r0, r0 + mov r8, r0 + movs r6, 0x80 + lsls r6, 9 +_080AC33A: + movs r1, 0x6 + ldrsh r0, [r4, r1] + cmp r0, r8 + beq _080AC352 + adds r0, r4, 0 + adds r0, 0x38 + adds r1, r7, 0 + bl sub_809D968 + orrs r5, r0 + lsls r0, r5, 24 + lsrs r5, r0, 24 +_080AC352: + adds r0, r6, 0 + movs r1, 0x80 + lsls r1, 9 + adds r6, r1 + asrs r0, 16 + movs r1, 0xE2 + lsls r1, 1 + adds r4, r1 + cmp r0, 0xF + ble _080AC33A + adds r0, r5, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080AC374: .4byte gUnknown_3001B88 + thumb_func_end sub_80AC320 + + thumb_func_start sub_80AC378 +sub_80AC378: + push {r4-r7,lr} + ldr r0, _080AC3BC + ldr r4, [r0] + movs r5, 0 + movs r7, 0x1 + negs r7, r7 + movs r6, 0x80 + lsls r6, 9 +_080AC388: + movs r1, 0x6 + ldrsh r0, [r4, r1] + cmp r0, r7 + beq _080AC39E + adds r0, r4, 0 + adds r0, 0x38 + bl sub_809D92C + orrs r5, r0 + lsls r0, r5, 24 + lsrs r5, r0, 24 +_080AC39E: + adds r0, r6, 0 + movs r1, 0x80 + lsls r1, 9 + adds r6, r1 + asrs r0, 16 + movs r1, 0xE2 + lsls r1, 1 + adds r4, r1 + cmp r0, 0xF + ble _080AC388 + adds r0, r5, 0 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080AC3BC: .4byte gUnknown_3001B88 + thumb_func_end sub_80AC378 + + thumb_func_start sub_80AC3C0 +sub_80AC3C0: + lsls r0, 16 + asrs r0, 16 + ldr r2, _080AC3DC + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, [r2] + adds r0, r1 + movs r1, 0x6 + ldrsh r0, [r0, r1] + bx lr + .align 2, 0 +_080AC3DC: .4byte gUnknown_3001B88 + thumb_func_end sub_80AC3C0 + + thumb_func_start sub_80AC3E0 +sub_80AC3E0: + lsls r0, 16 + asrs r0, 16 + ldr r3, _080AC404 + lsls r2, r0, 3 + subs r2, r0 + lsls r2, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, [r3] + adds r0, r2 + movs r3, 0x8E + lsls r3, 1 + adds r2, r0, r3 + ldr r2, [r2] + str r2, [r1] + movs r1, 0x6 + ldrsh r0, [r0, r1] + bx lr + .align 2, 0 +_080AC404: .4byte gUnknown_3001B88 + thumb_func_end sub_80AC3E0 + + thumb_func_start sub_80AC408 +sub_80AC408: + push {lr} + adds r3, r1, 0 + lsls r0, 16 + asrs r0, 16 + ldr r2, _080AC434 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, [r2] + adds r2, r0, r1 + movs r0, 0x6 + ldrsh r1, [r2, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080AC438 + movs r0, 0 + str r0, [r3] + str r0, [r3, 0x4] + b _080AC440 + .align 2, 0 +_080AC434: .4byte gUnknown_3001B88 +_080AC438: + ldr r0, [r2, 0xC] + ldr r1, [r2, 0x10] + str r0, [r3] + str r1, [r3, 0x4] +_080AC440: + movs r1, 0x6 + ldrsh r0, [r2, r1] + pop {r1} + bx r1 + thumb_func_end sub_80AC408 + + thumb_func_start sub_80AC448 +sub_80AC448: + push {lr} + adds r3, r1, 0 + lsls r0, 16 + asrs r0, 16 + ldr r2, _080AC474 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, [r2] + adds r2, r0, r1 + movs r0, 0x6 + ldrsh r1, [r2, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080AC478 + movs r0, 0 + str r0, [r3] + b _080AC492 + .align 2, 0 +_080AC474: .4byte gUnknown_3001B88 +_080AC478: + movs r1, 0x92 + lsls r1, 1 + adds r0, r2, r1 + ldr r0, [r0] + ldr r1, [r2, 0x14] + adds r0, r1 + str r0, [r3] + movs r1, 0x94 + lsls r1, 1 + adds r0, r2, r1 + ldr r0, [r0] + ldr r1, [r2, 0x18] + adds r0, r1 +_080AC492: + str r0, [r3, 0x4] + movs r1, 0x6 + ldrsh r0, [r2, r1] + pop {r1} + bx r1 + thumb_func_end sub_80AC448 + + thumb_func_start sub_80AC49C +sub_80AC49C: + push {r4,lr} + lsls r0, 16 + asrs r0, 16 + ldr r3, _080AC4C4 + lsls r2, r0, 3 + subs r2, r0 + lsls r2, 4 + adds r2, r0 + lsls r2, 2 + ldr r4, [r3] + adds r4, r2 + adds r0, r4, 0 + bl sub_80AC6AC + movs r1, 0x6 + ldrsh r0, [r4, r1] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080AC4C4: .4byte gUnknown_3001B88 + thumb_func_end sub_80AC49C + + thumb_func_start sub_80AC4C8 +sub_80AC4C8: + push {r4-r7,lr} + adds r7, r0, 0 + adds r4, r1, 0 + ldr r0, _080AC530 + ldr r3, [r0] + movs r5, 0 + movs r0, 0x1 + negs r0, r0 + mov r12, r0 + movs r6, 0x80 + lsls r6, 9 +_080AC4DE: + movs r1, 0x6 + ldrsh r0, [r3, r1] + cmp r0, r12 + beq _080AC534 + movs r1, 0x8E + lsls r1, 1 + adds r0, r3, r1 + ldr r0, [r0] + ands r0, r7 + cmp r0, 0 + beq _080AC534 + adds r1, 0x8 + adds r0, r3, r1 + ldr r1, [r0] + ldr r0, [r2] + cmp r1, r0 + bge _080AC534 + movs r1, 0x96 + lsls r1, 1 + adds r0, r3, r1 + ldr r1, [r0] + ldr r0, [r4] + cmp r1, r0 + ble _080AC534 + movs r1, 0x94 + lsls r1, 1 + adds r0, r3, r1 + ldr r1, [r0] + ldr r0, [r2, 0x4] + cmp r1, r0 + bge _080AC534 + movs r1, 0x98 + lsls r1, 1 + adds r0, r3, r1 + ldr r1, [r0] + ldr r0, [r4, 0x4] + cmp r1, r0 + ble _080AC534 + adds r0, r5, 0 + b _080AC54C + .align 2, 0 +_080AC530: .4byte gUnknown_3001B88 +_080AC534: + adds r0, r6, 0 + movs r1, 0x80 + lsls r1, 9 + adds r6, r1 + asrs r5, r0, 16 + movs r0, 0xE2 + lsls r0, 1 + adds r3, r0 + cmp r5, 0xF + ble _080AC4DE + movs r0, 0x1 + negs r0, r0 +_080AC54C: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80AC4C8 + + thumb_func_start sub_80AC554 +sub_80AC554: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r8, r0 + mov r10, r1 + adds r4, r2, 0 + ldr r0, _080AC5C8 + ldr r0, [r0] + mov r12, r0 + movs r6, 0 + movs r0, 0x1 + negs r0, r0 + mov r9, r0 + movs r7, 0x80 + lsls r7, 9 +_080AC576: + mov r1, r12 + movs r2, 0x6 + ldrsh r0, [r1, r2] + cmp r0, r9 + beq _080AC5CC + movs r0, 0x8E + lsls r0, 1 + add r0, r12 + ldr r0, [r0] + mov r5, r8 + ands r0, r5 + cmp r0, 0 + beq _080AC5CC + movs r0, 0x92 + lsls r0, 1 + add r0, r12 + ldr r1, [r0] + mov r5, r12 + ldr r0, [r5, 0x14] + adds r2, r1, r0 + movs r0, 0x94 + lsls r0, 1 + add r0, r12 + ldr r1, [r0] + ldr r0, [r5, 0x18] + adds r3, r1, r0 + ldr r0, [r4] + cmp r2, r0 + bge _080AC5CC + mov r1, r10 + ldr r0, [r1] + cmp r2, r0 + ble _080AC5CC + ldr r0, [r4, 0x4] + cmp r3, r0 + bge _080AC5CC + ldr r0, [r1, 0x4] + cmp r3, r0 + ble _080AC5CC + adds r0, r6, 0 + b _080AC5E4 + .align 2, 0 +_080AC5C8: .4byte gUnknown_3001B88 +_080AC5CC: + adds r0, r7, 0 + movs r2, 0x80 + lsls r2, 9 + adds r7, r2 + asrs r6, r0, 16 + movs r5, 0xE2 + lsls r5, 1 + add r12, r5 + cmp r6, 0xF + ble _080AC576 + movs r0, 0x1 + negs r0, r0 +_080AC5E4: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80AC554 + + thumb_func_start sub_80AC5F4 +sub_80AC5F4: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x10 + mov r8, r0 + adds r5, r1, 0 + adds r6, r2, 0 + ldr r0, [r5] + cmp r0, 0 + bge _080AC60C + ldr r1, _080AC670 + adds r0, r1 +_080AC60C: + asrs r0, 11 + mov r12, r0 + str r0, [sp] + ldr r0, [r5, 0x4] + cmp r0, 0 + bge _080AC61C + ldr r3, _080AC670 + adds r0, r3 +_080AC61C: + asrs r4, r0, 11 + str r4, [sp, 0x4] + ldr r3, [r6] + subs r0, r3, 0x1 + cmp r0, 0 + bge _080AC62C + ldr r7, _080AC674 + adds r0, r3, r7 +_080AC62C: + asrs r1, r0, 11 + ldr r3, [r6, 0x4] + subs r0, r3, 0x1 + cmp r0, 0 + bge _080AC63A + ldr r7, _080AC674 + adds r0, r3, r7 +_080AC63A: + asrs r2, r0, 11 + mov r3, r12 + subs r0, r1, r3 + adds r0, 0x1 + str r0, [sp, 0x8] + subs r0, r2, r4 + adds r0, 0x1 + add r2, sp, 0x8 + str r0, [r2, 0x4] + movs r0, 0x8E + lsls r0, 1 + add r0, r8 + ldr r0, [r0] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080AC678 + mov r0, sp + adds r1, r2, 0 + bl sub_80A585C + lsls r0, 24 + cmp r0, 0 + beq _080AC678 + movs r0, 0x1 + b _080AC6A0 + .align 2, 0 +_080AC670: .4byte 0x000007ff +_080AC674: .4byte 0x000007fe +_080AC678: + movs r0, 0x8E + lsls r0, 1 + add r0, r8 + ldr r0, [r0] + movs r1, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080AC69E + movs r0, 0x1 + negs r0, r0 + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_80A92A0 + lsls r0, 16 + cmp r0, 0 + blt _080AC69E + movs r0, 0x4 + b _080AC6A0 +_080AC69E: + movs r0, 0 +_080AC6A0: + add sp, 0x10 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80AC5F4 + + thumb_func_start sub_80AC6AC +sub_80AC6AC: + push {r4,r5,lr} + sub sp, 0x10 + adds r5, r0, 0 + ldr r2, [r1] + ldr r4, [r5, 0x14] + subs r0, r2, r4 + str r0, [sp] + ldr r3, [r1, 0x4] + ldr r1, [r5, 0x18] + subs r0, r3, r1 + str r0, [sp, 0x4] + adds r2, r4 + str r2, [sp, 0x8] + adds r3, r1 + add r2, sp, 0x8 + str r3, [r2, 0x4] + ldr r1, [r5, 0x28] + ldr r0, [sp] + cmp r0, r1 + blt _080AC6EA + ldr r1, [r5, 0x30] + ldr r0, [sp, 0x8] + cmp r0, r1 + bge _080AC6EA + ldr r1, [r5, 0x2C] + ldr r0, [sp, 0x4] + cmp r0, r1 + blt _080AC6EA + ldr r0, [r5, 0x34] + cmp r3, r0 + blt _080AC6EE +_080AC6EA: + movs r0, 0x1 + b _080AC718 +_080AC6EE: + adds r0, r5, 0 + mov r1, sp + bl sub_80AC5F4 + cmp r0, 0 + bne _080AC718 + movs r0, 0x92 + lsls r0, 1 + adds r2, r5, r0 + ldr r0, [sp] + ldr r1, [sp, 0x4] + str r0, [r2] + str r1, [r2, 0x4] + movs r0, 0x96 + lsls r0, 1 + adds r2, r5, r0 + ldr r0, [sp, 0x8] + ldr r1, [sp, 0xC] + str r0, [r2] + str r1, [r2, 0x4] + movs r0, 0 +_080AC718: + add sp, 0x10 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80AC6AC + + thumb_func_start sub_80AC720 +sub_80AC720: + push {r4,r5,lr} + sub sp, 0x10 + adds r4, r0, 0 + movs r2, 0x92 + lsls r2, 1 + adds r0, r4, r2 + ldr r0, [r0] + ldr r2, [r1] + adds r0, r2 + str r0, [sp] + movs r3, 0x94 + lsls r3, 1 + adds r0, r4, r3 + ldr r0, [r0] + ldr r1, [r1, 0x4] + adds r0, r1 + str r0, [sp, 0x4] + adds r3, 0x4 + adds r0, r4, r3 + ldr r0, [r0] + adds r0, r2 + str r0, [sp, 0x8] + movs r2, 0x98 + lsls r2, 1 + adds r0, r4, r2 + ldr r0, [r0] + adds r0, r1 + add r1, sp, 0x8 + str r0, [r1, 0x4] + movs r5, 0 + ldr r3, [r4, 0x28] + ldr r0, [sp] + adds r2, r1, 0 + cmp r0, r3 + bge _080AC770 + str r3, [sp] + ldr r0, [r4, 0xC] + adds r0, r3, r0 + str r0, [sp, 0x8] + b _080AC780 +_080AC770: + ldr r1, [r4, 0x30] + ldr r0, [sp, 0x8] + cmp r0, r1 + blt _080AC782 + ldr r0, [r4, 0xC] + subs r0, r1, r0 + str r0, [sp] + str r1, [sp, 0x8] +_080AC780: + movs r5, 0x1 +_080AC782: + ldr r1, [r4, 0x2C] + ldr r0, [sp, 0x4] + cmp r0, r1 + bge _080AC794 + str r1, [sp, 0x4] + ldr r0, [r4, 0x10] + adds r0, r1, r0 + str r0, [r2, 0x4] + b _080AC7A4 +_080AC794: + ldr r1, [r4, 0x34] + ldr r0, [r2, 0x4] + cmp r0, r1 + blt _080AC7A6 + ldr r0, [r4, 0x10] + subs r0, r1, r0 + str r0, [sp, 0x4] + str r1, [r2, 0x4] +_080AC7A4: + movs r5, 0x1 +_080AC7A6: + adds r0, r4, 0 + mov r1, sp + bl sub_80AC5F4 + cmp r0, 0 + bne _080AC7D8 + movs r3, 0x92 + lsls r3, 1 + adds r2, r4, r3 + ldr r0, [sp] + ldr r1, [sp, 0x4] + str r0, [r2] + str r1, [r2, 0x4] + movs r0, 0x96 + lsls r0, 1 + adds r2, r4, r0 + ldr r0, [sp, 0x8] + ldr r1, [sp, 0xC] + str r0, [r2] + str r1, [r2, 0x4] + cmp r5, 0 + bne _080AC7D6 + movs r0, 0 + b _080AC7D8 +_080AC7D6: + movs r0, 0x1 +_080AC7D8: + add sp, 0x10 + pop {r4,r5} + pop {r1} + bx r1 + thumb_func_end sub_80AC720 + + thumb_func_start sub_80AC7E0 +sub_80AC7E0: + movs r1, 0x4 + ldrsh r0, [r0, r1] + bx lr + thumb_func_end sub_80AC7E0 + + thumb_func_start sub_80AC7E8 +sub_80AC7E8: + ldr r2, [r0, 0xC] + ldr r3, [r0, 0x10] + str r2, [r1] + str r3, [r1, 0x4] + bx lr + thumb_func_end sub_80AC7E8 + + thumb_func_start sub_80AC7F4 +sub_80AC7F4: + push {r4,lr} + adds r3, r0, 0 + adds r4, r1, 0 + cmp r4, 0 + beq _080AC834 + movs r0, 0x92 + lsls r0, 1 + adds r2, r3, r0 + ldr r1, [r4] + ldr r0, [r3, 0x14] + subs r0, r1, r0 + str r0, [r2] + movs r0, 0x96 + lsls r0, 1 + adds r2, r3, r0 + ldr r0, [r3, 0x14] + adds r1, r0 + str r1, [r2] + movs r0, 0x94 + lsls r0, 1 + adds r2, r3, r0 + ldr r1, [r4, 0x4] + ldr r0, [r3, 0x18] + subs r0, r1, r0 + str r0, [r2] + movs r0, 0x98 + lsls r0, 1 + adds r2, r3, r0 + ldr r0, [r3, 0x18] + adds r1, r0 + str r1, [r2] + b _080AC89A +_080AC834: + movs r0, 0x92 + lsls r0, 1 + adds r2, r3, r0 + ldr r0, [r3, 0x20] + ldr r1, [r3, 0x14] + subs r0, r1 + str r0, [r2] + movs r0, 0x96 + lsls r0, 1 + adds r2, r3, r0 + ldr r0, [r3, 0x20] + ldr r1, [r3, 0x14] + adds r0, r1 + str r0, [r2] + movs r0, 0x94 + lsls r0, 1 + adds r2, r3, r0 + ldr r0, [r3, 0x24] + ldr r1, [r3, 0x18] + subs r0, r1 + str r0, [r2] + movs r0, 0x98 + lsls r0, 1 + adds r2, r3, r0 + ldr r0, [r3, 0x24] + ldr r1, [r3, 0x18] + adds r0, r1 + str r0, [r2] + movs r2, 0x9A + lsls r2, 1 + adds r1, r3, r2 + adds r2, 0x4 + adds r0, r3, r2 + str r4, [r0] + str r4, [r1] + movs r0, 0x90 + lsls r0, 1 + adds r2, r3, r0 + movs r1, 0 + ldrsb r1, [r2, r1] + movs r0, 0x1C + ldrsb r0, [r3, r0] + cmp r1, r0 + beq _080AC896 + movs r0, 0x9E + lsls r0, 1 + adds r1, r3, r0 + movs r0, 0x1 + strb r0, [r1] +_080AC896: + ldrb r0, [r3, 0x1C] + strb r0, [r2] +_080AC89A: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80AC7F4 + + thumb_func_start sub_80AC8A0 +sub_80AC8A0: + push {r4,lr} + ldr r3, [r1] + ldr r4, [r1, 0x4] + str r3, [r0, 0x28] + str r4, [r0, 0x2C] + ldr r1, [r2] + ldr r2, [r2, 0x4] + str r1, [r0, 0x30] + str r2, [r0, 0x34] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80AC8A0 + + thumb_func_start sub_80AC8B8 +sub_80AC8B8: + adds r3, r0, 0 + movs r2, 0x92 + lsls r2, 1 + adds r0, r3, r2 + ldr r0, [r0] + ldr r2, [r3, 0x14] + adds r0, r2 + str r0, [r1] + movs r2, 0x94 + lsls r2, 1 + adds r0, r3, r2 + ldr r0, [r0] + ldr r2, [r3, 0x18] + adds r0, r2 + str r0, [r1, 0x4] + bx lr + thumb_func_end sub_80AC8B8 + + thumb_func_start sub_80AC8D8 +sub_80AC8D8: + push {lr} + bl sub_80AC6AC + pop {r1} + bx r1 + thumb_func_end sub_80AC8D8 + + thumb_func_start sub_80AC8E4 +sub_80AC8E4: + push {r4,lr} + adds r3, r0, 0 + movs r4, 0x9A + lsls r4, 1 + adds r0, r3, r4 + ldr r0, [r0] + str r0, [r1] + movs r1, 0x9C + lsls r1, 1 + adds r0, r3, r1 + ldr r0, [r0] + str r0, [r2] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80AC8E4 + + thumb_func_start sub_80AC904 +sub_80AC904: + movs r2, 0x9A + lsls r2, 1 + adds r0, r2 + str r1, [r0] + bx lr + thumb_func_end sub_80AC904 + + thumb_func_start sub_80AC910 +sub_80AC910: + movs r2, 0x90 + lsls r2, 1 + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + bx lr + thumb_func_end sub_80AC910 + + thumb_func_start sub_80AC91C +sub_80AC91C: + push {lr} + adds r2, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080AC934 + movs r3, 0x90 + lsls r3, 1 + adds r0, r2, r3 + strb r1, [r0] +_080AC934: + pop {r0} + bx r0 + thumb_func_end sub_80AC91C + + thumb_func_start sub_80AC938 +sub_80AC938: + push {r4,r5,lr} + lsls r1, 16 + adds r3, r0, 0 + movs r0, 0xFF + lsls r0, 16 + ands r0, r1 + lsrs r0, 16 + cmp r0, 0 + beq _080AC958 + ldr r1, _080AC954 + lsls r0, 1 + adds r0, r1 + b _080AC95E + .align 2, 0 +_080AC954: .4byte gUnknown_81183A0 +_080AC958: + movs r5, 0x9F + lsls r5, 1 + adds r0, r3, r5 +_080AC95E: + movs r1, 0 + ldrsh r2, [r0, r1] + movs r5, 0x9F + lsls r5, 1 + adds r1, r3, r5 + ldrh r4, [r1] + movs r5, 0 + ldrsh r0, [r1, r5] + cmp r0, r2 + beq _080AC97C + strh r2, [r1] + movs r0, 0x9E + lsls r0, 1 + adds r1, r3, r0 + b _080AC98C +_080AC97C: + movs r0, 0x80 + lsls r0, 5 + ands r0, r4 + cmp r0, 0 + beq _080AC990 + movs r5, 0x9E + lsls r5, 1 + adds r1, r3, r5 +_080AC98C: + movs r0, 0x1 + strb r0, [r1] +_080AC990: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80AC938 + + thumb_func_start sub_80AC998 +sub_80AC998: + push {lr} + lsls r1, 16 + asrs r1, 16 + adds r2, r1, 0 + cmp r1, 0 + bne _080AC9AA + movs r1, 0xE0 + lsls r1, 1 + adds r2, r1, 0 +_080AC9AA: + movs r1, 0xA0 + lsls r1, 1 + adds r0, r1 + strh r2, [r0] + pop {r0} + bx r0 + thumb_func_end sub_80AC998 + + thumb_func_start sub_80AC9B8 +sub_80AC9B8: + push {lr} + adds r1, r0, 0 + movs r2, 0x9E + lsls r2, 1 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080AC9D6 + adds r2, 0x8 + adds r0, r1, r2 + bl sub_80A66F8 + lsls r0, 24 + lsrs r0, 24 + b _080AC9D8 +_080AC9D6: + movs r0, 0x1 +_080AC9D8: + pop {r1} + bx r1 + thumb_func_end sub_80AC9B8 + + thumb_func_start sub_80AC9DC +sub_80AC9DC: + push {lr} + adds r1, r0, 0 + movs r2, 0xA0 + lsls r2, 1 + adds r0, r1, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + bne _080AC9FE + movs r2, 0xA2 + lsls r2, 1 + adds r0, r1, r2 + bl sub_80A671C + lsls r0, 24 + lsrs r0, 24 + b _080ACA00 +_080AC9FE: + movs r0, 0x1 +_080ACA00: + pop {r1} + bx r1 + thumb_func_end sub_80AC9DC + + thumb_func_start sub_80ACA04 +sub_80ACA04: + movs r2, 0x8E + lsls r2, 1 + adds r0, r2 + ldr r0, [r0] + str r0, [r1] + bx lr + thumb_func_end sub_80ACA04 + + thumb_func_start sub_80ACA10 +sub_80ACA10: + push {lr} + movs r2, 0x4 + ldrsh r0, [r0, r2] + bl sub_80AC1B0 + pop {r0} + bx r0 + thumb_func_end sub_80ACA10 + + thumb_func_start sub_80ACA20 +sub_80ACA20: + push {lr} + movs r2, 0x4 + ldrsh r0, [r0, r2] + bl sub_80AC1F4 + pop {r0} + bx r0 + thumb_func_end sub_80ACA20 + + thumb_func_start sub_80ACA30 +sub_80ACA30: + push {lr} + bl sub_80AC720 + pop {r1} + bx r1 + thumb_func_end sub_80ACA30 + + thumb_func_start sub_80ACA3C +sub_80ACA3C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, _080ACA7C + ldr r5, [r0] + movs r7, 0 + movs r0, 0x1 + negs r0, r0 + mov r8, r0 + movs r1, 0x9E + lsls r1, 1 + adds r6, r5, r1 +_080ACA54: + movs r3, 0x6 + ldrsh r0, [r5, r3] + cmp r0, r8 + beq _080ACAB2 + adds r4, r5, 0 + adds r4, 0x38 + adds r0, r4, 0 + ldr r1, _080ACA80 + bl sub_809DA70 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + beq _080ACA84 + cmp r0, 0x4 + bne _080ACA90 + adds r0, r7, 0 + bl sub_80AC168 + b _080ACAB2 + .align 2, 0 +_080ACA7C: .4byte gUnknown_3001B88 +_080ACA80: .4byte gUnknown_8118524 +_080ACA84: + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x1 + ldr r3, _080ACAD0 + bl sub_809D8C0 +_080ACA90: + ldrb r0, [r6] + cmp r0, 0 + beq _080ACAB2 + movs r0, 0 + strb r0, [r6] + movs r1, 0xA2 + lsls r1, 1 + adds r0, r5, r1 + ldrh r2, [r6, 0x2] + movs r3, 0xF8 + lsls r3, 5 + adds r1, r3, 0 + ands r1, r2 + lsls r2, 24 + asrs r2, 24 + bl sub_80A6EFC +_080ACAB2: + adds r0, r7, 0x1 + lsls r0, 16 + asrs r7, r0, 16 + movs r0, 0xE2 + lsls r0, 1 + adds r6, r0 + adds r5, r0 + cmp r7, 0xF + ble _080ACA54 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080ACAD0: .4byte gUnknown_8118530 + thumb_func_end sub_80ACA3C + + thumb_func_start sub_80ACAD4 +sub_80ACAD4: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + ldr r0, _080ACB8C + ldr r6, [r0] + movs r0, 0 + mov r8, r0 + movs r1, 0x1 + negs r1, r1 + mov r9, r1 + movs r2, 0x90 + lsls r2, 1 + adds r4, r6, r2 +_080ACAF2: + movs r0, 0x6 + ldrsh r1, [r6, r0] + mov r2, r9 + lsls r0, r2, 16 + asrs r0, 16 + cmp r1, r0 + beq _080ACB64 + ldr r0, [r4, 0x4] + ldr r1, [r6, 0x14] + adds r0, r1 + str r0, [sp] + ldr r0, [r4, 0x8] + ldr r1, [r6, 0x18] + adds r0, r1 + str r0, [sp, 0x4] + ldr r1, [r4, 0x14] + ldr r0, [r4, 0x18] + adds r7, r1, r0 + movs r0, 0xA2 + lsls r0, 1 + adds r5, r6, r0 + adds r0, r5, 0 + bl sub_80A66D4 + lsls r0, 24 + cmp r0, 0 + beq _080ACB40 + movs r0, 0 + strb r0, [r4, 0x1C] + ldrh r2, [r4, 0x1E] + movs r0, 0xF8 + lsls r0, 5 + adds r1, r0, 0 + ands r1, r2 + lsls r2, 24 + asrs r2, 24 + adds r0, r5, 0 + bl sub_80A6EFC +_080ACB40: + movs r1, 0x20 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080ACB5A + adds r1, r0, 0 + movs r2, 0 + ldrsb r2, [r4, r2] + adds r0, r5, 0 + movs r3, 0 + bl sub_80A7040 + movs r0, 0 + strh r0, [r4, 0x20] +_080ACB5A: + adds r0, r5, 0 + mov r1, sp + adds r2, r7, 0 + bl sub_80A7664 +_080ACB64: + mov r0, r8 + adds r0, 0x1 + lsls r0, 16 + asrs r0, 16 + mov r8, r0 + movs r0, 0xE2 + lsls r0, 1 + adds r4, r0 + adds r6, r0 + mov r1, r8 + cmp r1, 0xF + ble _080ACAF2 + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080ACB8C: .4byte gUnknown_3001B88 + thumb_func_end sub_80ACAD4 + + thumb_func_start sub_80ACB90 +sub_80ACB90: + push {r4,r5,lr} + ldr r4, _080ACBCC + movs r0, 0xE2 + lsls r0, 5 + movs r1, 0x6 + bl MemoryAlloc + str r0, [r4] + adds r1, r0, 0 + ldr r0, _080ACBD0 + adds r5, r0, 0 + movs r4, 0xE2 + lsls r4, 1 + movs r2, 0x80 + lsls r2, 9 + adds r3, r2, 0 +_080ACBB0: + ldrh r0, [r1, 0x6] + orrs r0, r5 + strh r0, [r1, 0x6] + adds r0, r2, 0 + adds r2, r3 + asrs r0, 16 + adds r1, r4 + cmp r0, 0xF + ble _080ACBB0 + bl sub_80ACBD4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080ACBCC: .4byte gUnknown_3001B8C +_080ACBD0: .4byte 0x0000ffff + thumb_func_end sub_80ACB90 + + thumb_func_start sub_80ACBD4 +sub_80ACBD4: + push {r4-r6,lr} + ldr r0, _080ACC0C + ldr r4, [r0] + movs r1, 0 + movs r6, 0x1 + negs r6, r6 + movs r5, 0x80 + lsls r5, 9 +_080ACBE4: + movs r2, 0x6 + ldrsh r0, [r4, r2] + cmp r0, r6 + beq _080ACBF2 + adds r0, r1, 0 + bl sub_80AD080 +_080ACBF2: + adds r0, r5, 0 + movs r1, 0x80 + lsls r1, 9 + adds r5, r1 + asrs r1, r0, 16 + movs r2, 0xE2 + lsls r2, 1 + adds r4, r2 + cmp r1, 0xF + ble _080ACBE4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080ACC0C: .4byte gUnknown_3001B8C + thumb_func_end sub_80ACBD4 + + thumb_func_start sub_80ACC10 +sub_80ACC10: + push {r4,lr} + bl sub_80ACBD4 + ldr r4, _080ACC28 + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080ACC28: .4byte gUnknown_3001B8C + thumb_func_end sub_80ACC10 + + thumb_func_start sub_80ACC2C +sub_80ACC2C: + push {r4-r7,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 16 + asrs r4, 16 + lsls r1, 16 + asrs r7, r1, 16 + lsls r2, 24 + asrs r6, r2, 24 + ldr r1, _080ACC90 + adds r0, r4, 0 + bl sub_80A77D0 + adds r5, r0, 0 + ldr r1, _080ACC94 + str r6, [sp] + movs r0, 0 + adds r2, r4, 0 + adds r3, r7, 0 + bl Log + lsls r1, r7, 3 + ldr r0, [r5, 0x4] + adds r0, r1 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + ldr r0, [r0, 0x4] + adds r0, r1 + ldr r5, [r0, 0x14] + ldr r0, [r0, 0x10] + cmp r0, 0 + ble _080ACC86 + adds r4, r0, 0 +_080ACC70: + movs r0, 0x1 + negs r0, r0 + adds r1, r5, 0 + adds r2, r7, 0 + adds r3, r6, 0 + bl sub_80ACDC4 + subs r4, 0x1 + adds r5, 0xC + cmp r4, 0 + bne _080ACC70 +_080ACC86: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080ACC90: .4byte gUnknown_8118610 +_080ACC94: .4byte gUnknown_811861C + thumb_func_end sub_80ACC2C + + thumb_func_start sub_80ACC98 +sub_80ACC98: + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + asrs r7, r0, 16 + lsls r1, 24 + asrs r5, r1, 24 + ldr r1, _080ACD00 + movs r0, 0 + adds r2, r7, 0 + bl Log + movs r1, 0 + ldr r0, _080ACD04 + ldr r4, [r0] + movs r0, 0x1 + negs r0, r0 + mov r8, r0 + movs r6, 0x80 + lsls r6, 9 +_080ACCC0: + movs r2, 0x6 + ldrsh r0, [r4, r2] + cmp r0, r8 + beq _080ACCE2 + movs r2, 0x8 + ldrsh r0, [r4, r2] + cmp r0, r7 + bne _080ACCE2 + cmp r5, 0 + blt _080ACCDC + movs r0, 0xA + ldrsb r0, [r4, r0] + cmp r0, r5 + bne _080ACCE2 +_080ACCDC: + adds r0, r1, 0 + bl sub_80AD080 +_080ACCE2: + adds r0, r6, 0 + movs r1, 0x80 + lsls r1, 9 + adds r6, r1 + asrs r1, r0, 16 + movs r2, 0xE2 + lsls r2, 1 + adds r4, r2 + cmp r1, 0xF + ble _080ACCC0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080ACD00: .4byte gUnknown_8118640 +_080ACD04: .4byte gUnknown_3001B8C + thumb_func_end sub_80ACC98 + + thumb_func_start sub_80ACD08 +sub_80ACD08: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + ldr r1, _080ACD7C + movs r0, 0 + bl Log + movs r6, 0 + ldr r0, _080ACD80 + ldr r4, [r0] + movs r0, 0x1 + negs r0, r0 + mov r8, r0 + movs r1, 0x92 + lsls r1, 1 + adds r5, r4, r1 + mov r7, sp +_080ACD2C: + movs r1, 0x6 + ldrsh r0, [r4, r1] + cmp r0, r8 + beq _080ACD5C + ldr r0, [r5] + ldr r1, [r4, 0x14] + adds r0, r1 + str r0, [sp] + ldr r0, [r5, 0x4] + ldr r1, [r4, 0x18] + adds r0, r1 + str r0, [r7, 0x4] + movs r1, 0xA2 + lsls r1, 1 + adds r0, r4, r1 + mov r1, sp + bl sub_80A675C + lsls r0, 24 + cmp r0, 0 + bne _080ACD5C + adds r0, r6, 0 + bl sub_80AD080 +_080ACD5C: + adds r0, r6, 0x1 + lsls r0, 16 + asrs r6, r0, 16 + movs r0, 0xE2 + lsls r0, 1 + adds r5, r0 + adds r4, r0 + cmp r6, 0xF + ble _080ACD2C + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080ACD7C: .4byte gUnknown_8118658 +_080ACD80: .4byte gUnknown_3001B8C + thumb_func_end sub_80ACD08 + + thumb_func_start sub_80ACD84 +sub_80ACD84: + push {r4-r7,lr} + lsls r0, 16 + asrs r4, r0, 16 + movs r3, 0 + ldr r0, _080ACDA8 + ldr r1, [r0] + movs r6, 0xE2 + lsls r6, 1 + movs r2, 0x80 + lsls r2, 9 + adds r5, r2, 0 +_080ACD9A: + movs r7, 0x6 + ldrsh r0, [r1, r7] + cmp r0, r4 + bne _080ACDAC + adds r0, r3, 0 + b _080ACDBC + .align 2, 0 +_080ACDA8: .4byte gUnknown_3001B8C +_080ACDAC: + adds r0, r2, 0 + adds r2, r5 + asrs r3, r0, 16 + adds r1, r6 + cmp r3, 0xF + ble _080ACD9A + movs r0, 0x1 + negs r0, r0 +_080ACDBC: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80ACD84 + + thumb_func_start sub_80ACDC4 +sub_80ACDC4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + adds r7, r1, 0 + lsls r0, 16 + asrs r6, r0, 16 + lsls r2, 16 + asrs r2, 16 + mov r10, r2 + lsls r3, 24 + asrs r3, 24 + mov r9, r3 + ldrb r0, [r7] + lsls r0, 2 + ldr r1, _080ACE08 + adds r0, r1 + mov r8, r0 + ldr r3, _080ACE0C + cmp r6, 0 + bge _080ACE38 + movs r2, 0 + ldr r5, [r3] + movs r0, 0x6 + ldrsh r1, [r5, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080ACE10 + movs r6, 0 + b _080ACE38 + .align 2, 0 +_080ACE08: .4byte gUnknown_811EE38 +_080ACE0C: .4byte gUnknown_3001B8C +_080ACE10: + adds r0, r2, 0x1 + lsls r0, 16 + asrs r2, r0, 16 + movs r1, 0xE2 + lsls r1, 1 + adds r5, r1 + cmp r2, 0xF + bgt _080ACE2E + movs r4, 0x6 + ldrsh r1, [r5, r4] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080ACE10 + adds r6, r2, 0 +_080ACE2E: + cmp r6, 0 + bge _080ACE38 + movs r0, 0x1 + negs r0, r0 + b _080AD062 +_080ACE38: + lsls r0, r6, 3 + subs r0, r6 + lsls r0, 4 + adds r0, r6 + lsls r0, 2 + ldr r1, [r3] + adds r5, r1, r0 + ldr r1, _080ACE9C + ldrb r3, [r7] + mov r2, r8 + movs r4, 0 + ldrsh r0, [r2, r4] + str r0, [sp] + mov r0, r10 + str r0, [sp, 0x4] + mov r2, r9 + str r2, [sp, 0x8] + movs r0, 0 + adds r2, r6, 0 + bl Log + movs r2, 0 + movs r3, 0x6 + ldrsh r1, [r5, r3] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080ACE72 + movs r2, 0x1 +_080ACE72: + str r2, [sp, 0xC] + strh r6, [r5, 0x4] + ldrb r0, [r7] + strh r0, [r5, 0x6] + mov r4, r10 + strh r4, [r5, 0x8] + mov r0, r9 + strb r0, [r5, 0xA] + mov r1, r8 + ldrh r0, [r1] + subs r0, 0x1 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x4 + bhi _080ACEEC + lsls r0, 2 + ldr r1, _080ACEA0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080ACE9C: .4byte gUnknown_8118674 +_080ACEA0: .4byte _080ACEA4 + .align 2, 0 +_080ACEA4: + .4byte _080ACEB8 + .4byte _080ACEEC + .4byte _080ACEC4 + .4byte _080ACED0 + .4byte _080ACEDC +_080ACEB8: + movs r2, 0x8E + lsls r2, 1 + adds r1, r5, r2 + movs r0, 0x81 + lsls r0, 22 + b _080ACEF4 +_080ACEC4: + movs r4, 0x8E + lsls r4, 1 + adds r1, r5, r4 + movs r0, 0x83 + lsls r0, 18 + b _080ACEF4 +_080ACED0: + movs r0, 0x8E + lsls r0, 1 + adds r1, r5, r0 + movs r0, 0x88 + lsls r0, 22 + b _080ACEF4 +_080ACEDC: + movs r2, 0x8E + lsls r2, 1 + adds r1, r5, r2 + ldr r0, _080ACEE8 + b _080ACEF4 + .align 2, 0 +_080ACEE8: .4byte 0x22020000 +_080ACEEC: + movs r3, 0x8E + lsls r3, 1 + adds r1, r5, r3 + ldr r0, _080ACF08 +_080ACEF4: + str r0, [r1] + mov r4, r8 + ldrb r0, [r4, 0x2] + cmp r0, 0 + bne _080ACF0C + ldrb r0, [r7, 0x2] + lsls r0, 11 + str r0, [r5, 0xC] + ldrb r0, [r7, 0x3] + b _080ACF16 + .align 2, 0 +_080ACF08: .4byte 0x220c0000 +_080ACF0C: + mov r1, r8 + ldrb r0, [r1, 0x2] + lsls r0, 11 + str r0, [r5, 0xC] + ldrb r0, [r1, 0x3] +_080ACF16: + lsls r0, 11 + str r0, [r5, 0x10] + ldr r0, [r5, 0xC] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + str r0, [r5, 0x14] + ldr r0, [r5, 0x10] + lsrs r1, r0, 31 + adds r0, r1 + asrs r0, 1 + str r0, [r5, 0x18] + ldrb r0, [r7, 0x1] + strb r0, [r5, 0x1C] + adds r2, r7, 0x4 + adds r4, r5, 0 + adds r4, 0x20 + ldrb r1, [r2, 0x2] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _080ACF5A + ldrb r0, [r7, 0x4] + lsls r3, r0, 11 + str r3, [r5, 0x20] + ldrb r1, [r2, 0x2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080ACF5A + movs r1, 0x80 + lsls r1, 3 + adds r0, r3, r1 + str r0, [r5, 0x20] +_080ACF5A: + ldrb r1, [r2, 0x3] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _080ACF7C + ldrb r0, [r2, 0x1] + lsls r3, r0, 11 + str r3, [r4, 0x4] + ldrb r1, [r2, 0x3] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080ACF7C + movs r2, 0x80 + lsls r2, 3 + adds r0, r3, r2 + str r0, [r4, 0x4] +_080ACF7C: + ldr r3, [sp, 0xC] + cmp r3, 0 + beq _080ACFD2 + ldrb r1, [r5, 0x1C] + movs r4, 0x90 + lsls r4, 1 + adds r0, r5, r4 + movs r3, 0 + strb r1, [r0] + movs r0, 0x92 + lsls r0, 1 + adds r2, r5, r0 + ldr r0, [r5, 0x20] + ldr r1, [r5, 0x14] + subs r0, r1 + str r0, [r2] + movs r1, 0x96 + lsls r1, 1 + adds r2, r5, r1 + ldr r0, [r5, 0x20] + ldr r1, [r5, 0x14] + adds r0, r1 + str r0, [r2] + adds r4, 0x8 + adds r2, r5, r4 + ldr r0, [r5, 0x24] + ldr r1, [r5, 0x18] + subs r0, r1 + str r0, [r2] + movs r0, 0x98 + lsls r0, 1 + adds r2, r5, r0 + ldr r0, [r5, 0x24] + ldr r1, [r5, 0x18] + adds r0, r1 + str r0, [r2] + movs r2, 0x9A + lsls r2, 1 + adds r1, r5, r2 + adds r4, 0x10 + adds r0, r5, r4 + str r3, [r0] + str r3, [r1] +_080ACFD2: + adds r0, r5, 0 + adds r0, 0x28 + adds r1, r5, 0 + adds r1, 0x30 + bl sub_80A5778 + ldr r0, [sp, 0xC] + cmp r0, 0 + beq _080AD01A + movs r2, 0x9F + lsls r2, 1 + adds r1, r5, r2 + movs r2, 0 + movs r0, 0x80 + lsls r0, 4 + strh r0, [r1] + movs r3, 0x9E + lsls r3, 1 + adds r1, r5, r3 + movs r0, 0x1 + strb r0, [r1] + movs r4, 0xA0 + lsls r4, 1 + adds r0, r5, r4 + strh r2, [r0] + movs r1, 0xA2 + lsls r1, 1 + adds r0, r5, r1 + movs r3, 0x6 + ldrsh r2, [r5, r3] + subs r4, 0x24 + adds r1, r5, r4 + ldr r3, [r1] + adds r1, r6, 0 + bl sub_80A7688 +_080AD01A: + adds r4, r5, 0 + adds r4, 0x38 + ldr r1, _080AD074 + mov r0, r9 + str r0, [sp] + adds r0, r4, 0 + adds r2, r5, 0 + mov r3, r10 + bl sub_809D600 + ldr r2, [r7, 0x8] + cmp r2, 0 + bne _080AD04C + mov r1, r8 + movs r3, 0 + ldrsh r0, [r1, r3] + cmp r0, 0x1 + bne _080AD048 + ldr r0, _080AD078 + movs r1, 0xB0 + lsls r1, 2 + adds r0, r1 + ldr r2, [r0] +_080AD048: + cmp r2, 0 + beq _080AD060 +_080AD04C: + adds r0, r4, 0 + movs r1, 0 + bl sub_809D6D8 + ldr r3, _080AD07C + adds r0, r4, 0 + movs r1, 0 + movs r2, 0 + bl sub_809D8C0 +_080AD060: + adds r0, r6, 0 +_080AD062: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080AD074: .4byte gUnknown_8118544 +_080AD078: .4byte gUnknown_812F1F8 +_080AD07C: .4byte gUnknown_81186CC + thumb_func_end sub_80ACDC4 + + thumb_func_start sub_80AD080 +sub_80AD080: + push {r4,lr} + adds r2, r0, 0 + lsls r2, 16 + asrs r2, 16 + ldr r1, _080AD0BC + lsls r0, r2, 3 + subs r0, r2 + lsls r0, 4 + adds r0, r2 + lsls r0, 2 + ldr r1, [r1] + adds r4, r1, r0 + ldr r1, _080AD0C0 + movs r0, 0 + bl Log + movs r1, 0xA2 + lsls r1, 1 + adds r0, r4, r1 + bl sub_80A7714 + adds r0, r4, 0 + adds r0, 0x38 + bl sub_809D648 + ldr r0, _080AD0C4 + strh r0, [r4, 0x6] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AD0BC: .4byte gUnknown_3001B8C +_080AD0C0: .4byte gUnknown_81186D8 +_080AD0C4: .4byte 0x0000ffff + thumb_func_end sub_80AD080 + + thumb_func_start sub_80AD0C8 +sub_80AD0C8: + push {lr} + adds r3, r1, 0 + lsls r0, 16 + asrs r0, 16 + ldr r2, _080AD108 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, [r2] + adds r2, r0, r1 + movs r0, 0x6 + ldrsh r1, [r2, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080AD102 + movs r1, 0x8E + lsls r1, 1 + adds r0, r2, r1 + ldr r1, [r0] + orrs r1, r3 + str r1, [r0] + movs r3, 0xA2 + lsls r3, 1 + adds r0, r2, r3 + bl sub_80A6688 +_080AD102: + pop {r0} + bx r0 + .align 2, 0 +_080AD108: .4byte gUnknown_3001B8C + thumb_func_end sub_80AD0C8 + + thumb_func_start sub_80AD10C +sub_80AD10C: + push {r4,lr} + adds r4, r1, 0 + lsls r0, 16 + asrs r0, 16 + ldr r2, _080AD150 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, [r2] + adds r3, r0, r1 + movs r0, 0x6 + ldrsh r1, [r3, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080AD14A + movs r0, 0x8E + lsls r0, 1 + adds r2, r3, r0 + ldr r0, _080AD154 + eors r0, r4 + ldr r1, [r2] + ands r1, r0 + str r1, [r2] + movs r2, 0xA2 + lsls r2, 1 + adds r0, r3, r2 + bl sub_80A6688 +_080AD14A: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AD150: .4byte gUnknown_3001B8C +_080AD154: .4byte 0x337fffff + thumb_func_end sub_80AD10C + + thumb_func_start sub_80AD158 +sub_80AD158: + push {lr} + lsls r0, 16 + asrs r0, 16 + ldr r2, _080AD180 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, [r2] + adds r2, r0, r1 + movs r0, 0x6 + ldrsh r1, [r2, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080AD184 + movs r0, 0 + b _080AD188 + .align 2, 0 +_080AD180: .4byte gUnknown_3001B8C +_080AD184: + adds r0, r2, 0 + adds r0, 0x38 +_080AD188: + pop {r1} + bx r1 + thumb_func_end sub_80AD158 + + thumb_func_start sub_80AD18C +sub_80AD18C: + push {r4,lr} + adds r4, r1, 0 + lsls r0, 16 + asrs r0, 16 + lsls r2, 16 + asrs r3, r2, 16 + ldr r2, _080AD1B8 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, [r2] + adds r2, r0, r1 + movs r0, 0x6 + ldrsh r1, [r2, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080AD1BC + movs r0, 0 + b _080AD1CC + .align 2, 0 +_080AD1B8: .4byte gUnknown_3001B8C +_080AD1BC: + adds r0, r2, 0 + adds r0, 0x38 + adds r1, r4, 0 + adds r2, r3, 0 + bl sub_809D6E4 + lsls r0, 24 + lsrs r0, 24 +_080AD1CC: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80AD18C + + thumb_func_start sub_80AD1D4 +sub_80AD1D4: + push {r4-r6,lr} + adds r3, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + lsls r3, 16 + asrs r3, 16 + ldr r1, _080AD20C + lsls r0, r3, 3 + subs r0, r3 + lsls r0, 4 + adds r0, r3 + lsls r0, 2 + ldr r1, [r1] + adds r4, r1, r0 + ldr r1, _080AD210 + movs r0, 0 + adds r2, r3, 0 + bl Log + movs r0, 0x6 + ldrsh r1, [r4, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080AD214 + movs r0, 0 + b _080AD22C + .align 2, 0 +_080AD20C: .4byte gUnknown_3001B8C +_080AD210: .4byte gUnknown_81186F4 +_080AD214: + adds r0, r4, 0 + adds r0, 0x38 + ldr r3, _080AD234 + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_809D790 + movs r0, 0x9E + lsls r0, 1 + adds r1, r4, r0 + movs r0, 0x1 + strb r0, [r1] +_080AD22C: + pop {r4-r6} + pop {r1} + bx r1 + .align 2, 0 +_080AD234: .4byte gUnknown_811872C + thumb_func_end sub_80AD1D4 + + thumb_func_start sub_80AD238 +sub_80AD238: + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + asrs r7, r0, 16 + ldr r0, _080AD28C + ldr r4, [r0] + movs r5, 0 + movs r0, 0x1 + negs r0, r0 + mov r8, r0 + movs r6, 0x80 + lsls r6, 9 +_080AD252: + movs r1, 0x6 + ldrsh r0, [r4, r1] + cmp r0, r8 + beq _080AD26A + adds r0, r4, 0 + adds r0, 0x38 + adds r1, r7, 0 + bl sub_809D968 + orrs r5, r0 + lsls r0, r5, 24 + lsrs r5, r0, 24 +_080AD26A: + adds r0, r6, 0 + movs r1, 0x80 + lsls r1, 9 + adds r6, r1 + asrs r0, 16 + movs r1, 0xE2 + lsls r1, 1 + adds r4, r1 + cmp r0, 0xF + ble _080AD252 + adds r0, r5, 0 + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080AD28C: .4byte gUnknown_3001B8C + thumb_func_end sub_80AD238 + + thumb_func_start sub_80AD290 +sub_80AD290: + push {r4-r7,lr} + ldr r0, _080AD2D4 + ldr r4, [r0] + movs r5, 0 + movs r7, 0x1 + negs r7, r7 + movs r6, 0x80 + lsls r6, 9 +_080AD2A0: + movs r1, 0x6 + ldrsh r0, [r4, r1] + cmp r0, r7 + beq _080AD2B6 + adds r0, r4, 0 + adds r0, 0x38 + bl sub_809D92C + orrs r5, r0 + lsls r0, r5, 24 + lsrs r5, r0, 24 +_080AD2B6: + adds r0, r6, 0 + movs r1, 0x80 + lsls r1, 9 + adds r6, r1 + asrs r0, 16 + movs r1, 0xE2 + lsls r1, 1 + adds r4, r1 + cmp r0, 0xF + ble _080AD2A0 + adds r0, r5, 0 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080AD2D4: .4byte gUnknown_3001B8C + thumb_func_end sub_80AD290 + + thumb_func_start sub_80AD2D8 +sub_80AD2D8: + lsls r0, 16 + asrs r0, 16 + ldr r2, _080AD2F4 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, [r2] + adds r0, r1 + movs r1, 0x6 + ldrsh r0, [r0, r1] + bx lr + .align 2, 0 +_080AD2F4: .4byte gUnknown_3001B8C + thumb_func_end sub_80AD2D8 + + thumb_func_start sub_80AD2F8 +sub_80AD2F8: + lsls r0, 16 + asrs r0, 16 + ldr r3, _080AD31C + lsls r2, r0, 3 + subs r2, r0 + lsls r2, 4 + adds r2, r0 + lsls r2, 2 + ldr r0, [r3] + adds r0, r2 + movs r3, 0x8E + lsls r3, 1 + adds r2, r0, r3 + ldr r2, [r2] + str r2, [r1] + movs r1, 0x6 + ldrsh r0, [r0, r1] + bx lr + .align 2, 0 +_080AD31C: .4byte gUnknown_3001B8C + thumb_func_end sub_80AD2F8 + + thumb_func_start sub_80AD320 +sub_80AD320: + push {lr} + adds r3, r1, 0 + lsls r0, 16 + asrs r0, 16 + ldr r2, _080AD34C + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, [r2] + adds r2, r0, r1 + movs r0, 0x6 + ldrsh r1, [r2, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080AD350 + movs r0, 0 + str r0, [r3] + str r0, [r3, 0x4] + b _080AD358 + .align 2, 0 +_080AD34C: .4byte gUnknown_3001B8C +_080AD350: + ldr r0, [r2, 0xC] + ldr r1, [r2, 0x10] + str r0, [r3] + str r1, [r3, 0x4] +_080AD358: + movs r1, 0x6 + ldrsh r0, [r2, r1] + pop {r1} + bx r1 + thumb_func_end sub_80AD320 + + thumb_func_start sub_80AD360 +sub_80AD360: + push {lr} + adds r3, r1, 0 + lsls r0, 16 + asrs r0, 16 + ldr r2, _080AD38C + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 4 + adds r1, r0 + lsls r1, 2 + ldr r0, [r2] + adds r2, r0, r1 + movs r0, 0x6 + ldrsh r1, [r2, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080AD390 + movs r0, 0 + str r0, [r3] + b _080AD3AA + .align 2, 0 +_080AD38C: .4byte gUnknown_3001B8C +_080AD390: + movs r1, 0x92 + lsls r1, 1 + adds r0, r2, r1 + ldr r0, [r0] + ldr r1, [r2, 0x14] + adds r0, r1 + str r0, [r3] + movs r1, 0x94 + lsls r1, 1 + adds r0, r2, r1 + ldr r0, [r0] + ldr r1, [r2, 0x18] + adds r0, r1 +_080AD3AA: + str r0, [r3, 0x4] + movs r1, 0x6 + ldrsh r0, [r2, r1] + pop {r1} + bx r1 + thumb_func_end sub_80AD360 + + thumb_func_start sub_80AD3B4 +sub_80AD3B4: + push {r4,lr} + lsls r0, 16 + asrs r0, 16 + ldr r3, _080AD3DC + lsls r2, r0, 3 + subs r2, r0 + lsls r2, 4 + adds r2, r0 + lsls r2, 2 + ldr r4, [r3] + adds r4, r2 + adds r0, r4, 0 + bl sub_80AD3E0 + movs r1, 0x6 + ldrsh r0, [r4, r1] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080AD3DC: .4byte gUnknown_3001B8C + thumb_func_end sub_80AD3B4 + + thumb_func_start sub_80AD3E0 +sub_80AD3E0: + push {r4-r7,lr} + mov r12, r0 + ldr r3, [r1] + ldr r2, [r0, 0x14] + subs r6, r3, r2 + ldr r1, [r1, 0x4] + ldr r0, [r0, 0x18] + subs r7, r1, r0 + adds r4, r3, r2 + adds r5, r1, r0 + mov r1, r12 + ldr r0, [r1, 0x28] + cmp r6, r0 + blt _080AD40E + ldr r0, [r1, 0x30] + cmp r4, r0 + bge _080AD40E + ldr r0, [r1, 0x2C] + cmp r7, r0 + blt _080AD40E + ldr r0, [r1, 0x34] + cmp r5, r0 + blt _080AD412 +_080AD40E: + movs r0, 0x1 + b _080AD428 +_080AD412: + movs r0, 0x92 + lsls r0, 1 + add r0, r12 + str r6, [r0] + str r7, [r0, 0x4] + movs r0, 0x96 + lsls r0, 1 + add r0, r12 + str r4, [r0] + str r5, [r0, 0x4] + movs r0, 0 +_080AD428: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80AD3E0 + + thumb_func_start sub_80AD430 +sub_80AD430: + push {r4-r6,lr} + mov r12, r0 + movs r0, 0x92 + lsls r0, 1 + add r0, r12 + ldr r0, [r0] + ldr r2, [r1] + adds r5, r0, r2 + movs r0, 0x94 + lsls r0, 1 + add r0, r12 + ldr r0, [r0] + ldr r1, [r1, 0x4] + adds r6, r0, r1 + movs r0, 0x96 + lsls r0, 1 + add r0, r12 + ldr r0, [r0] + adds r3, r0, r2 + movs r0, 0x98 + lsls r0, 1 + add r0, r12 + ldr r0, [r0] + adds r4, r0, r1 + mov r0, r12 + ldr r1, [r0, 0x28] + cmp r5, r1 + bge _080AD470 + adds r5, r1, 0 + ldr r0, [r0, 0xC] + adds r3, r1, r0 + b _080AD47E +_080AD470: + mov r2, r12 + ldr r1, [r2, 0x30] + cmp r3, r1 + blt _080AD47E + ldr r0, [r2, 0xC] + subs r5, r1, r0 + adds r3, r1, 0 +_080AD47E: + mov r0, r12 + ldr r1, [r0, 0x2C] + cmp r6, r1 + bge _080AD48E + adds r6, r1, 0 + ldr r0, [r0, 0x10] + adds r4, r1, r0 + b _080AD49C +_080AD48E: + mov r2, r12 + ldr r1, [r2, 0x34] + cmp r4, r1 + blt _080AD49C + ldr r0, [r2, 0x10] + subs r6, r1, r0 + adds r4, r1, 0 +_080AD49C: + movs r0, 0x92 + lsls r0, 1 + add r0, r12 + str r5, [r0] + str r6, [r0, 0x4] + movs r0, 0x96 + lsls r0, 1 + add r0, r12 + str r3, [r0] + str r4, [r0, 0x4] + movs r0, 0 + pop {r4-r6} + pop {r1} + bx r1 + thumb_func_end sub_80AD430 + + thumb_func_start sub_80AD4B8 +sub_80AD4B8: + movs r1, 0x4 + ldrsh r0, [r0, r1] + bx lr + thumb_func_end sub_80AD4B8 + + thumb_func_start sub_80AD4C0 +sub_80AD4C0: + ldr r2, [r0, 0xC] + ldr r3, [r0, 0x10] + str r2, [r1] + str r3, [r1, 0x4] + bx lr + thumb_func_end sub_80AD4C0 + + thumb_func_start sub_80AD4CC +sub_80AD4CC: + push {r4,lr} + adds r3, r0, 0 + adds r4, r1, 0 + cmp r4, 0 + beq _080AD50C + movs r0, 0x92 + lsls r0, 1 + adds r2, r3, r0 + ldr r1, [r4] + ldr r0, [r3, 0x14] + subs r0, r1, r0 + str r0, [r2] + movs r0, 0x96 + lsls r0, 1 + adds r2, r3, r0 + ldr r0, [r3, 0x14] + adds r1, r0 + str r1, [r2] + movs r0, 0x94 + lsls r0, 1 + adds r2, r3, r0 + ldr r1, [r4, 0x4] + ldr r0, [r3, 0x18] + subs r0, r1, r0 + str r0, [r2] + movs r0, 0x98 + lsls r0, 1 + adds r2, r3, r0 + ldr r0, [r3, 0x18] + adds r1, r0 + str r1, [r2] + b _080AD572 +_080AD50C: + movs r0, 0x92 + lsls r0, 1 + adds r2, r3, r0 + ldr r0, [r3, 0x20] + ldr r1, [r3, 0x14] + subs r0, r1 + str r0, [r2] + movs r0, 0x96 + lsls r0, 1 + adds r2, r3, r0 + ldr r0, [r3, 0x20] + ldr r1, [r3, 0x14] + adds r0, r1 + str r0, [r2] + movs r0, 0x94 + lsls r0, 1 + adds r2, r3, r0 + ldr r0, [r3, 0x24] + ldr r1, [r3, 0x18] + subs r0, r1 + str r0, [r2] + movs r0, 0x98 + lsls r0, 1 + adds r2, r3, r0 + ldr r0, [r3, 0x24] + ldr r1, [r3, 0x18] + adds r0, r1 + str r0, [r2] + movs r2, 0x9A + lsls r2, 1 + adds r1, r3, r2 + adds r2, 0x4 + adds r0, r3, r2 + str r4, [r0] + str r4, [r1] + movs r0, 0x90 + lsls r0, 1 + adds r2, r3, r0 + movs r1, 0 + ldrsb r1, [r2, r1] + movs r0, 0x1C + ldrsb r0, [r3, r0] + cmp r1, r0 + beq _080AD56E + movs r0, 0x9E + lsls r0, 1 + adds r1, r3, r0 + movs r0, 0x1 + strb r0, [r1] +_080AD56E: + ldrb r0, [r3, 0x1C] + strb r0, [r2] +_080AD572: + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80AD4CC + + thumb_func_start sub_80AD578 +sub_80AD578: + push {r4,lr} + ldr r3, [r1] + ldr r4, [r1, 0x4] + str r3, [r0, 0x28] + str r4, [r0, 0x2C] + ldr r1, [r2] + ldr r2, [r2, 0x4] + str r1, [r0, 0x30] + str r2, [r0, 0x34] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80AD578 + + thumb_func_start sub_80AD590 +sub_80AD590: + adds r3, r0, 0 + movs r2, 0x92 + lsls r2, 1 + adds r0, r3, r2 + ldr r0, [r0] + ldr r2, [r3, 0x14] + adds r0, r2 + str r0, [r1] + movs r2, 0x94 + lsls r2, 1 + adds r0, r3, r2 + ldr r0, [r0] + ldr r2, [r3, 0x18] + adds r0, r2 + str r0, [r1, 0x4] + bx lr + thumb_func_end sub_80AD590 + + thumb_func_start sub_80AD5B0 +sub_80AD5B0: + push {lr} + bl sub_80AD3E0 + pop {r1} + bx r1 + thumb_func_end sub_80AD5B0 + + thumb_func_start sub_80AD5BC +sub_80AD5BC: + push {r4,lr} + adds r3, r0, 0 + movs r4, 0x9A + lsls r4, 1 + adds r0, r3, r4 + ldr r0, [r0] + str r0, [r1] + movs r1, 0x9C + lsls r1, 1 + adds r0, r3, r1 + ldr r0, [r0] + str r0, [r2] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80AD5BC + + thumb_func_start sub_80AD5DC +sub_80AD5DC: + movs r2, 0x9A + lsls r2, 1 + adds r0, r2 + str r1, [r0] + bx lr + thumb_func_end sub_80AD5DC + + thumb_func_start sub_80AD5E8 +sub_80AD5E8: + movs r2, 0x90 + lsls r2, 1 + adds r0, r2 + ldrb r0, [r0] + strb r0, [r1] + bx lr + thumb_func_end sub_80AD5E8 + + thumb_func_start sub_80AD5F4 +sub_80AD5F4: + push {lr} + adds r2, r0, 0 + lsls r1, 24 + asrs r1, 24 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080AD60C + movs r3, 0x90 + lsls r3, 1 + adds r0, r2, r3 + strb r1, [r0] +_080AD60C: + pop {r0} + bx r0 + thumb_func_end sub_80AD5F4 + + thumb_func_start sub_80AD610 +sub_80AD610: + push {r4,r5,lr} + lsls r1, 16 + adds r3, r0, 0 + movs r0, 0xFF + lsls r0, 16 + ands r0, r1 + lsrs r0, 16 + cmp r0, 0 + beq _080AD630 + ldr r1, _080AD62C + lsls r0, 1 + adds r0, r1 + b _080AD636 + .align 2, 0 +_080AD62C: .4byte gUnknown_81185F2 +_080AD630: + movs r5, 0x9F + lsls r5, 1 + adds r0, r3, r5 +_080AD636: + movs r1, 0 + ldrsh r2, [r0, r1] + movs r5, 0x9F + lsls r5, 1 + adds r1, r3, r5 + ldrh r4, [r1] + movs r5, 0 + ldrsh r0, [r1, r5] + cmp r0, r2 + beq _080AD654 + strh r2, [r1] + movs r0, 0x9E + lsls r0, 1 + adds r1, r3, r0 + b _080AD664 +_080AD654: + movs r0, 0x80 + lsls r0, 5 + ands r0, r4 + cmp r0, 0 + beq _080AD668 + movs r5, 0x9E + lsls r5, 1 + adds r1, r3, r5 +_080AD664: + movs r0, 0x1 + strb r0, [r1] +_080AD668: + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80AD610 + + thumb_func_start sub_80AD670 +sub_80AD670: + push {lr} + lsls r1, 16 + asrs r1, 16 + adds r2, r1, 0 + cmp r1, 0 + bne _080AD682 + movs r1, 0xE0 + lsls r1, 1 + adds r2, r1, 0 +_080AD682: + movs r1, 0xA0 + lsls r1, 1 + adds r0, r1 + strh r2, [r0] + pop {r0} + bx r0 + thumb_func_end sub_80AD670 + + thumb_func_start sub_80AD690 +sub_80AD690: + push {lr} + adds r1, r0, 0 + movs r2, 0x9E + lsls r2, 1 + adds r0, r1, r2 + ldrb r0, [r0] + cmp r0, 0 + bne _080AD6AE + adds r2, 0x8 + adds r0, r1, r2 + bl sub_80A66F8 + lsls r0, 24 + lsrs r0, 24 + b _080AD6B0 +_080AD6AE: + movs r0, 0x1 +_080AD6B0: + pop {r1} + bx r1 + thumb_func_end sub_80AD690 + + thumb_func_start sub_80AD6B4 +sub_80AD6B4: + push {lr} + adds r1, r0, 0 + movs r2, 0xA0 + lsls r2, 1 + adds r0, r1, r2 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r0, 0 + bne _080AD6D6 + movs r2, 0xA2 + lsls r2, 1 + adds r0, r1, r2 + bl sub_80A671C + lsls r0, 24 + lsrs r0, 24 + b _080AD6D8 +_080AD6D6: + movs r0, 0x1 +_080AD6D8: + pop {r1} + bx r1 + thumb_func_end sub_80AD6B4 + + thumb_func_start sub_80AD6DC +sub_80AD6DC: + movs r2, 0x8E + lsls r2, 1 + adds r0, r2 + ldr r0, [r0] + str r0, [r1] + bx lr + thumb_func_end sub_80AD6DC + + thumb_func_start sub_80AD6E8 +sub_80AD6E8: + push {lr} + movs r2, 0x4 + ldrsh r0, [r0, r2] + bl sub_80AD0C8 + pop {r0} + bx r0 + thumb_func_end sub_80AD6E8 + + thumb_func_start sub_80AD6F8 +sub_80AD6F8: + push {lr} + movs r2, 0x4 + ldrsh r0, [r0, r2] + bl sub_80AD10C + pop {r0} + bx r0 + thumb_func_end sub_80AD6F8 + + thumb_func_start sub_80AD708 +sub_80AD708: + push {lr} + bl sub_80AD430 + pop {r1} + bx r1 + thumb_func_end sub_80AD708 + + thumb_func_start sub_80AD714 +sub_80AD714: + push {r4-r7,lr} + mov r7, r8 + push {r7} + ldr r0, _080AD754 + ldr r5, [r0] + movs r7, 0 + movs r0, 0x1 + negs r0, r0 + mov r8, r0 + movs r1, 0x9E + lsls r1, 1 + adds r6, r5, r1 +_080AD72C: + movs r3, 0x6 + ldrsh r0, [r5, r3] + cmp r0, r8 + beq _080AD78A + adds r4, r5, 0 + adds r4, 0x38 + adds r0, r4, 0 + ldr r1, _080AD758 + bl sub_809DA70 + lsls r0, 16 + asrs r0, 16 + cmp r0, 0 + beq _080AD75C + cmp r0, 0x4 + bne _080AD768 + adds r0, r7, 0 + bl sub_80AD080 + b _080AD78A + .align 2, 0 +_080AD754: .4byte gUnknown_3001B8C +_080AD758: .4byte gUnknown_811874C +_080AD75C: + adds r0, r4, 0 + movs r1, 0 + movs r2, 0x1 + ldr r3, _080AD7A8 + bl sub_809D8C0 +_080AD768: + ldrb r0, [r6] + cmp r0, 0 + beq _080AD78A + movs r0, 0 + strb r0, [r6] + movs r1, 0xA2 + lsls r1, 1 + adds r0, r5, r1 + ldrh r2, [r6, 0x2] + movs r3, 0xF8 + lsls r3, 5 + adds r1, r3, 0 + ands r1, r2 + lsls r2, 24 + asrs r2, 24 + bl sub_80A6EFC +_080AD78A: + adds r0, r7, 0x1 + lsls r0, 16 + asrs r7, r0, 16 + movs r0, 0xE2 + lsls r0, 1 + adds r6, r0 + adds r5, r0 + cmp r7, 0xF + ble _080AD72C + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080AD7A8: .4byte gUnknown_8118758 + thumb_func_end sub_80AD714 + + thumb_func_start sub_80AD7AC +sub_80AD7AC: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x8 + ldr r0, _080AD864 + ldr r6, [r0] + movs r0, 0 + mov r8, r0 + movs r1, 0x1 + negs r1, r1 + mov r9, r1 + movs r2, 0x90 + lsls r2, 1 + adds r4, r6, r2 +_080AD7CA: + movs r0, 0x6 + ldrsh r1, [r6, r0] + mov r2, r9 + lsls r0, r2, 16 + asrs r0, 16 + cmp r1, r0 + beq _080AD83C + ldr r0, [r4, 0x4] + ldr r1, [r6, 0x14] + adds r0, r1 + str r0, [sp] + ldr r0, [r4, 0x8] + ldr r1, [r6, 0x18] + adds r0, r1 + str r0, [sp, 0x4] + ldr r1, [r4, 0x14] + ldr r0, [r4, 0x18] + adds r7, r1, r0 + movs r0, 0xA2 + lsls r0, 1 + adds r5, r6, r0 + adds r0, r5, 0 + bl sub_80A66D4 + lsls r0, 24 + cmp r0, 0 + beq _080AD818 + movs r0, 0 + strb r0, [r4, 0x1C] + ldrh r2, [r4, 0x1E] + movs r0, 0xF8 + lsls r0, 5 + adds r1, r0, 0 + ands r1, r2 + lsls r2, 24 + asrs r2, 24 + adds r0, r5, 0 + bl sub_80A6EFC +_080AD818: + movs r1, 0x20 + ldrsh r0, [r4, r1] + cmp r0, 0 + beq _080AD832 + adds r1, r0, 0 + movs r2, 0 + ldrsb r2, [r4, r2] + adds r0, r5, 0 + movs r3, 0 + bl sub_80A7040 + movs r0, 0 + strh r0, [r4, 0x20] +_080AD832: + adds r0, r5, 0 + mov r1, sp + adds r2, r7, 0 + bl sub_80A7720 +_080AD83C: + mov r0, r8 + adds r0, 0x1 + lsls r0, 16 + asrs r0, 16 + mov r8, r0 + movs r0, 0xE2 + lsls r0, 1 + adds r4, r0 + adds r6, r0 + mov r1, r8 + cmp r1, 0xF + ble _080AD7CA + add sp, 0x8 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080AD864: .4byte gUnknown_3001B8C + thumb_func_end sub_80AD7AC + + thumb_func_start sub_80AD868 +sub_80AD868: + ldr r1, _080AD870 + movs r0, 0 + str r0, [r1] + bx lr + .align 2, 0 +_080AD870: .4byte gUnknown_203B4B8 + thumb_func_end sub_80AD868 + + thumb_func_start sub_80AD874 +sub_80AD874: + ldr r1, _080AD87C + movs r0, 0 + str r0, [r1] + bx lr + .align 2, 0 +_080AD87C: .4byte gUnknown_203B4B8 + thumb_func_end sub_80AD874 + + thumb_func_start sub_80AD880 +sub_80AD880: + push {lr} + lsls r0, 16 + asrs r0, 16 + ldr r1, _080AD898 + bl sub_80A77D0 + ldr r1, _080AD89C + ldr r0, [r0, 0x8] + str r0, [r1] + pop {r0} + bx r0 + .align 2, 0 +_080AD898: .4byte gUnknown_8118798 +_080AD89C: .4byte gUnknown_203B4B8 + thumb_func_end sub_80AD880 + + thumb_func_start sub_80AD8A0 +sub_80AD8A0: + lsls r0, 16 + ldr r1, _080AD8B0 + asrs r0, 13 + ldr r1, [r1] + adds r1, r0 + adds r0, r1, 0 + bx lr + .align 2, 0 +_080AD8B0: .4byte gUnknown_203B4B8 + thumb_func_end sub_80AD8A0 + + thumb_func_start sub_80AD8B4 +sub_80AD8B4: + push {r4,lr} + adds r4, r1, 0 + lsls r0, 16 + ldr r1, _080AD910 + asrs r0, 13 + ldr r1, [r1] + adds r2, r1, r0 + ldrb r1, [r2, 0x2] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _080AD8E4 + ldrb r0, [r2] + lsls r3, r0, 11 + str r3, [r4] + ldrb r1, [r2, 0x2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080AD8E4 + movs r1, 0x80 + lsls r1, 3 + adds r0, r3, r1 + str r0, [r4] +_080AD8E4: + ldrb r1, [r2, 0x3] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _080AD906 + ldrb r0, [r2, 0x1] + lsls r3, r0, 11 + str r3, [r4, 0x4] + ldrb r1, [r2, 0x3] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080AD906 + movs r1, 0x80 + lsls r1, 3 + adds r0, r3, r1 + str r0, [r4, 0x4] +_080AD906: + ldrb r0, [r2, 0x6] + pop {r4} + pop {r1} + bx r1 + .align 2, 0 +_080AD910: .4byte gUnknown_203B4B8 + thumb_func_end sub_80AD8B4 + + thumb_func_start sub_80AD914 +sub_80AD914: + push {r4,r5,lr} + adds r4, r1, 0 + adds r5, r2, 0 + lsls r0, 16 + ldr r1, _080AD98C + asrs r0, 13 + ldr r1, [r1] + adds r2, r1, r0 + ldr r0, [r3] + ldr r1, [r3, 0x4] + str r0, [r4] + str r1, [r4, 0x4] + ldrb r1, [r2, 0x2] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _080AD94E + ldrb r0, [r2] + lsls r3, r0, 11 + str r3, [r4] + ldrb r1, [r2, 0x2] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080AD94E + movs r1, 0x80 + lsls r1, 3 + adds r0, r3, r1 + str r0, [r4] +_080AD94E: + ldrb r1, [r2, 0x3] + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + bne _080AD970 + ldrb r0, [r2, 0x1] + lsls r3, r0, 11 + str r3, [r4, 0x4] + ldrb r1, [r2, 0x3] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080AD970 + movs r1, 0x80 + lsls r1, 3 + adds r0, r3, r1 + str r0, [r4, 0x4] +_080AD970: + ldrb r1, [r2, 0x4] + lsls r1, 11 + ldr r0, [r4] + adds r0, r1 + str r0, [r5] + ldrb r1, [r2, 0x5] + lsls r1, 11 + ldr r0, [r4, 0x4] + adds r0, r1 + str r0, [r5, 0x4] + ldrb r0, [r2, 0x6] + pop {r4,r5} + pop {r1} + bx r1 + .align 2, 0 +_080AD98C: .4byte gUnknown_203B4B8 + thumb_func_end sub_80AD914 + + thumb_func_start sub_80AD990 +sub_80AD990: + push {r4,lr} + ldr r4, _080AD9C8 + movs r0, 0x80 + lsls r0, 3 + movs r1, 0x6 + bl MemoryAlloc + str r0, [r4] + adds r1, r0, 0 + ldr r0, _080AD9CC + adds r4, r0, 0 + movs r2, 0x80 + lsls r2, 9 + adds r3, r2, 0 +_080AD9AC: + ldrh r0, [r1, 0x2] + orrs r0, r4 + strh r0, [r1, 0x2] + adds r0, r2, 0 + adds r2, r3 + asrs r0, 16 + adds r1, 0x20 + cmp r0, 0x1F + ble _080AD9AC + bl sub_80AD9D0 + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AD9C8: .4byte gUnknown_3001B90 +_080AD9CC: .4byte 0x0000ffff + thumb_func_end sub_80AD990 + + thumb_func_start sub_80AD9D0 +sub_80AD9D0: + push {r4-r6,lr} + ldr r0, _080ADA04 + ldr r4, [r0] + movs r1, 0 + movs r6, 0x1 + negs r6, r6 + movs r5, 0x80 + lsls r5, 9 +_080AD9E0: + movs r2, 0x2 + ldrsh r0, [r4, r2] + cmp r0, r6 + beq _080AD9EE + adds r0, r1, 0 + bl sub_80ADC34 +_080AD9EE: + adds r0, r5, 0 + movs r1, 0x80 + lsls r1, 9 + adds r5, r1 + asrs r1, r0, 16 + adds r4, 0x20 + cmp r1, 0x1F + ble _080AD9E0 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080ADA04: .4byte gUnknown_3001B90 + thumb_func_end sub_80AD9D0 + + thumb_func_start sub_80ADA08 +sub_80ADA08: + push {r4,lr} + bl sub_80AD9D0 + ldr r4, _080ADA20 + ldr r0, [r4] + bl MemoryFree + movs r0, 0 + str r0, [r4] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080ADA20: .4byte gUnknown_3001B90 + thumb_func_end sub_80ADA08 + + thumb_func_start sub_80ADA24 +sub_80ADA24: + push {r4-r7,lr} + sub sp, 0x4 + adds r4, r0, 0 + lsls r4, 16 + asrs r4, 16 + lsls r1, 16 + asrs r7, r1, 16 + lsls r2, 24 + asrs r6, r2, 24 + ldr r1, _080ADA88 + adds r0, r4, 0 + bl sub_80A77D0 + adds r5, r0, 0 + ldr r1, _080ADA8C + str r6, [sp] + movs r0, 0 + adds r2, r4, 0 + adds r3, r7, 0 + bl Log + lsls r1, r7, 3 + ldr r0, [r5, 0x4] + adds r0, r1 + lsls r1, r6, 2 + adds r1, r6 + lsls r1, 3 + ldr r0, [r0, 0x4] + adds r0, r1 + ldr r5, [r0, 0x1C] + ldr r0, [r0, 0x18] + cmp r0, 0 + ble _080ADA7E + adds r4, r0, 0 +_080ADA68: + movs r0, 0x1 + negs r0, r0 + adds r1, r5, 0 + adds r2, r7, 0 + adds r3, r6, 0 + bl sub_80ADB00 + subs r4, 0x1 + adds r5, 0xC + cmp r4, 0 + bne _080ADA68 +_080ADA7E: + add sp, 0x4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080ADA88: .4byte gUnknown_81187DC +_080ADA8C: .4byte gUnknown_81187E8 + thumb_func_end sub_80ADA24 + + thumb_func_start sub_80ADA90 +sub_80ADA90: + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r0, 16 + asrs r7, r0, 16 + lsls r1, 24 + asrs r5, r1, 24 + ldr r1, _080ADAF8 + movs r0, 0 + adds r2, r7, 0 + adds r3, r5, 0 + bl Log + movs r1, 0 + ldr r0, _080ADAFC + ldr r4, [r0] + movs r0, 0x1 + negs r0, r0 + mov r8, r0 + movs r6, 0x80 + lsls r6, 9 +_080ADABA: + movs r2, 0x2 + ldrsh r0, [r4, r2] + cmp r0, r8 + beq _080ADADC + movs r2, 0x4 + ldrsh r0, [r4, r2] + cmp r0, r7 + bne _080ADADC + cmp r5, 0 + blt _080ADAD6 + movs r0, 0x6 + ldrsb r0, [r4, r0] + cmp r0, r5 + bne _080ADADC +_080ADAD6: + adds r0, r1, 0 + bl sub_80ADC34 +_080ADADC: + adds r0, r6, 0 + movs r1, 0x80 + lsls r1, 9 + adds r6, r1 + asrs r1, r0, 16 + adds r4, 0x20 + cmp r1, 0x1F + ble _080ADABA + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080ADAF8: .4byte gUnknown_811880C +_080ADAFC: .4byte gUnknown_3001B90 + thumb_func_end sub_80ADA90 + + thumb_func_start sub_80ADB00 +sub_80ADB00: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x14 + mov r8, r1 + lsls r0, 16 + asrs r7, r0, 16 + lsls r2, 16 + asrs r6, r2, 16 + lsls r3, 24 + asrs r3, 24 + mov r9, r3 + ldr r5, [r1, 0x8] + cmp r7, 0 + bge _080ADB60 + ldr r0, _080ADB38 + ldr r4, [r0] + movs r2, 0 + movs r0, 0x2 + ldrsh r1, [r4, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080ADB3C + movs r7, 0 + b _080ADB68 + .align 2, 0 +_080ADB38: .4byte gUnknown_3001B90 +_080ADB3C: + adds r0, r2, 0x1 + lsls r0, 16 + asrs r2, r0, 16 + adds r4, 0x20 + cmp r2, 0x1F + bgt _080ADB56 + movs r3, 0x2 + ldrsh r1, [r4, r3] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080ADB3C + adds r7, r2, 0 +_080ADB56: + cmp r7, 0 + bge _080ADB68 + movs r0, 0x1 + negs r0, r0 + b _080ADC24 +_080ADB60: + ldr r0, _080ADBA0 + lsls r1, r7, 5 + ldr r0, [r0] + adds r4, r0, r1 +_080ADB68: + ldr r1, _080ADBA4 + movs r0, 0 + ldrsh r3, [r5, r0] + str r6, [sp] + mov r2, r9 + str r2, [sp, 0x4] + mov r2, r8 + ldr r0, [r2, 0x8] + ldr r0, [r0, 0x8] + str r0, [sp, 0x8] + movs r0, 0 + adds r2, r7, 0 + bl Log + strh r7, [r4] + ldrh r0, [r5] + strh r0, [r4, 0x2] + strh r6, [r4, 0x4] + mov r3, r9 + strb r3, [r4, 0x6] + movs r6, 0x2 + ldrsh r0, [r5, r6] + cmp r0, 0x1 + blt _080ADBA8 + cmp r0, 0x2 + bgt _080ADBA8 + movs r0, 0x60 + b _080ADBAA + .align 2, 0 +_080ADBA0: .4byte gUnknown_3001B90 +_080ADBA4: .4byte gUnknown_8118828 +_080ADBA8: + movs r0, 0x20 +_080ADBAA: + str r0, [r4, 0x8] + mov r3, r8 + ldrb r0, [r3] + lsls r1, r0, 11 + ldrb r0, [r3, 0x1] + lsls r2, r0, 11 + mov r5, r8 + adds r5, 0x4 + add r6, sp, 0xC + mov r12, r6 + ldrb r6, [r5, 0x2] + movs r0, 0x4 + ands r0, r6 + cmp r0, 0 + bne _080ADBDE + ldrb r0, [r3, 0x4] + lsls r3, r0, 11 + str r3, [sp, 0xC] + movs r0, 0x2 + ands r0, r6 + cmp r0, 0 + beq _080ADBDE + movs r6, 0x80 + lsls r6, 3 + adds r0, r3, r6 + str r0, [sp, 0xC] +_080ADBDE: + ldrb r6, [r5, 0x3] + movs r0, 0x4 + ands r0, r6 + cmp r0, 0 + bne _080ADC02 + ldrb r0, [r5, 0x1] + lsls r3, r0, 11 + mov r0, r12 + str r3, [r0, 0x4] + movs r0, 0x2 + ands r0, r6 + cmp r0, 0 + beq _080ADC02 + movs r5, 0x80 + lsls r5, 3 + adds r0, r3, r5 + mov r6, r12 + str r0, [r6, 0x4] +_080ADC02: + ldr r0, [sp, 0xC] + str r0, [r4, 0xC] + ldr r0, [sp, 0xC] + adds r0, r1 + str r0, [r4, 0x14] + ldr r0, [sp, 0x10] + str r0, [r4, 0x10] + ldr r0, [sp, 0x10] + adds r0, r2 + str r0, [r4, 0x18] + mov r1, r8 + ldr r0, [r1, 0x8] + ldr r0, [r0, 0x8] + str r0, [r4, 0x1C] + bl sub_80A7A78 + adds r0, r7, 0 +_080ADC24: + add sp, 0x14 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80ADB00 + + thumb_func_start sub_80ADC34 +sub_80ADC34: + push {r4,lr} + adds r2, r0, 0 + lsls r2, 16 + asrs r2, 16 + ldr r0, _080ADC58 + lsls r1, r2, 5 + ldr r4, [r0] + adds r4, r1 + ldr r1, _080ADC5C + movs r0, 0 + bl Log + ldr r0, _080ADC60 + strh r0, [r4, 0x2] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080ADC58: .4byte gUnknown_3001B90 +_080ADC5C: .4byte gUnknown_811886C +_080ADC60: .4byte 0x0000ffff + thumb_func_end sub_80ADC34 + + thumb_func_start sub_80ADC64 +sub_80ADC64: + push {lr} + adds r3, r1, 0 + lsls r0, 16 + ldr r1, _080ADC84 + asrs r0, 11 + ldr r1, [r1] + adds r2, r1, r0 + movs r0, 0x2 + ldrsh r1, [r2, r0] + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080ADC88 + movs r0, 0 + b _080ADC9A + .align 2, 0 +_080ADC84: .4byte gUnknown_3001B90 +_080ADC88: + ldr r0, [r2, 0x1C] + str r0, [r3] + movs r0, 0x2 + strh r0, [r3, 0x4] + ldrh r0, [r2, 0x4] + strh r0, [r3, 0x6] + ldrb r0, [r2, 0x6] + strb r0, [r3, 0x8] + movs r0, 0x1 +_080ADC9A: + pop {r1} + bx r1 + thumb_func_end sub_80ADC64 + + thumb_func_start sub_80ADCA0 +sub_80ADCA0: + push {r4-r7,lr} + adds r7, r0, 0 + adds r4, r1, 0 + ldr r0, _080ADCEC + ldr r3, [r0] + movs r5, 0 + movs r0, 0x1 + negs r0, r0 + mov r12, r0 + movs r6, 0x80 + lsls r6, 9 +_080ADCB6: + movs r1, 0x2 + ldrsh r0, [r3, r1] + cmp r0, r12 + beq _080ADCF0 + ldr r0, [r3, 0x8] + ands r0, r7 + cmp r0, 0 + beq _080ADCF0 + ldr r1, [r3, 0xC] + ldr r0, [r2] + cmp r1, r0 + bge _080ADCF0 + ldr r1, [r3, 0x14] + ldr r0, [r4] + cmp r1, r0 + ble _080ADCF0 + ldr r1, [r3, 0x10] + ldr r0, [r2, 0x4] + cmp r1, r0 + bge _080ADCF0 + ldr r1, [r3, 0x18] + ldr r0, [r4, 0x4] + cmp r1, r0 + ble _080ADCF0 + adds r0, r5, 0 + b _080ADD04 + .align 2, 0 +_080ADCEC: .4byte gUnknown_3001B90 +_080ADCF0: + adds r0, r6, 0 + movs r1, 0x80 + lsls r1, 9 + adds r6, r1 + asrs r5, r0, 16 + adds r3, 0x20 + cmp r5, 0x1F + ble _080ADCB6 + movs r0, 0x1 + negs r0, r0 +_080ADD04: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80ADCA0 + + thumb_func_start sub_80ADD0C +sub_80ADD0C: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r8, r0 + adds r6, r1, 0 + adds r5, r2, 0 + ldr r0, _080ADD74 + ldr r4, [r0] + movs r7, 0 + movs r0, 0x1 + negs r0, r0 + mov r9, r0 + movs r1, 0x80 + lsls r1, 9 + mov r12, r1 +_080ADD2C: + movs r1, 0x2 + ldrsh r0, [r4, r1] + cmp r0, r9 + beq _080ADD78 + ldr r0, [r4, 0x8] + mov r1, r8 + ands r0, r1 + cmp r0, 0 + beq _080ADD78 + ldr r0, [r4, 0xC] + ldr r1, [r4, 0x14] + adds r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r2, r0, 1 + ldr r0, [r4, 0x10] + ldr r1, [r4, 0x18] + adds r0, r1 + lsrs r1, r0, 31 + adds r0, r1 + asrs r3, r0, 1 + ldr r0, [r5] + cmp r2, r0 + bge _080ADD78 + ldr r0, [r6] + cmp r2, r0 + ble _080ADD78 + ldr r0, [r5, 0x4] + cmp r3, r0 + bge _080ADD78 + ldr r0, [r6, 0x4] + cmp r3, r0 + ble _080ADD78 + adds r0, r7, 0 + b _080ADD8C + .align 2, 0 +_080ADD74: .4byte gUnknown_3001B90 +_080ADD78: + mov r0, r12 + movs r1, 0x80 + lsls r1, 9 + add r12, r1 + asrs r7, r0, 16 + adds r4, 0x20 + cmp r7, 0x1F + ble _080ADD2C + movs r0, 0x1 + negs r0, r0 +_080ADD8C: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80ADD0C + + thumb_func_start nullsub_124 +nullsub_124: + bx lr + thumb_func_end nullsub_124 + + thumb_func_start sub_80ADD9C +sub_80ADD9C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x30 + str r0, [sp, 0x20] + str r1, [sp, 0x24] + str r2, [sp, 0x28] + str r3, [sp, 0x2C] + ldr r5, [sp, 0x54] + ldr r0, [sp, 0x5C] + mov r9, r0 + movs r0, 0x93 + lsls r0, 4 + movs r1, 0x7 + bl MemoryAlloc + mov r10, r0 + ldr r0, _080ADEB4 + ldr r7, _080ADEB8 + adds r1, r7, 0 + bl sub_800A9EC + adds r6, r0, 0 + add r4, sp, 0x1C + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80901D8 + ldrb r5, [r4] + ldrb r4, [r4, 0x1] + cmp r5, 0x3E + bls _080ADDE2 + movs r5, 0x3E +_080ADDE2: + cmp r4, 0 + bgt _080ADDE8 + movs r4, 0x1 +_080ADDE8: + adds r0, r5, 0 + bl sub_8090298 + cmp r4, r0 + blt _080ADDFA + adds r0, r5, 0 + bl sub_8090298 + subs r4, r0, 0x1 +_080ADDFA: + ldr r2, [r6, 0x4] + ldr r1, [r2] + lsls r0, r5, 2 + adds r0, r1 + lsls r1, r4, 4 + ldr r0, [r0] + adds r0, r1 + movs r3, 0 + ldrsh r1, [r0, r3] + ldr r2, [r2, 0x4] + lsls r0, r1, 3 + subs r0, r1 + lsls r0, 2 + adds r0, r2 + ldrb r0, [r0, 0x2] + mov r8, r0 + adds r0, r6, 0 + bl sub_800AA14 + ldr r1, _080ADEBC + ldr r0, _080ADEC0 + add r0, r8 + ldrb r5, [r0] + add r0, sp, 0x10 + adds r2, r5, 0 + bl sprintf + add r0, sp, 0x10 + adds r1, r7, 0 + bl sub_800A9EC + adds r4, r0, 0 + ldr r0, [sp, 0x28] + movs r1, 0 + adds r2, r4, 0 + bl sub_800AE28 + adds r0, r4, 0 + bl sub_800AA14 + ldr r1, _080ADEC4 + add r0, sp, 0x10 + mov r2, r8 + bl sprintf + add r0, sp, 0x10 + adds r1, r7, 0 + bl sub_800A908 + ldr r1, [sp, 0x20] + str r0, [r1] + ldr r1, _080ADEC8 + add r0, sp, 0x10 + adds r2, r5, 0 + bl sprintf + add r0, sp, 0x10 + adds r1, r7, 0 + bl sub_800A9EC + adds r4, r0, 0 + ldr r1, _080ADECC + ldr r0, [sp, 0x2C] + adds r2, r4, 0 + bl sub_800AAA8 + adds r0, r4, 0 + bl sub_800AA14 + mov r2, r8 + cmp r2, 0x3F + bgt _080ADED4 + ldr r1, _080ADED0 + add r0, sp, 0x10 + adds r2, r5, 0 + bl sprintf + add r0, sp, 0x10 + adds r1, r7, 0 + bl sub_800A9EC + adds r4, r0, 0 + mov r0, r10 + movs r1, 0x93 + lsls r1, 4 + adds r2, r4, 0 + bl sub_800AAA8 + adds r0, r4, 0 + bl sub_800AA14 + b _080ADEFC + .align 2, 0 +_080ADEB4: .4byte gUnknown_8118890 +_080ADEB8: .4byte gUnknown_83B0000 +_080ADEBC: .4byte gUnknown_811889C +_080ADEC0: .4byte gUnknown_8108EC0 +_080ADEC4: .4byte gUnknown_81188A8 +_080ADEC8: .4byte gUnknown_81188B4 +_080ADECC: .4byte 0x00001194 +_080ADED0: .4byte gUnknown_81188C0 +_080ADED4: + ldr r1, _080ADF80 + add r0, sp, 0x10 + mov r2, r8 + ldr r3, [sp, 0x58] + bl sprintf + add r0, sp, 0x10 + adds r1, r7, 0 + bl sub_800A9EC + adds r4, r0, 0 + movs r1, 0x90 + lsls r1, 2 + mov r0, r10 + adds r2, r4, 0 + bl sub_800AAA8 + adds r0, r4, 0 + bl sub_800AA14 +_080ADEFC: + movs r5, 0 + ldr r3, [sp, 0x60] + cmp r5, r3 + bge _080ADF52 +_080ADF04: + mov r0, r8 + bl sub_8097F40 + lsls r0, 24 + movs r7, 0 + cmp r0, 0 + beq _080ADF14 + movs r7, 0x3 +_080ADF14: + movs r4, 0 + adds r6, r5, 0x1 + cmp r4, r9 + bge _080ADF4A +_080ADF1C: + ldr r0, [sp, 0x64] + str r0, [sp] + str r7, [sp, 0x4] + mov r1, r10 + str r1, [sp, 0x8] + mov r2, r8 + str r2, [sp, 0xC] + adds r0, r4, 0 + adds r1, r5, 0 + mov r2, r9 + ldr r3, [sp, 0x60] + bl sub_80ADFB8 + mov r1, r9 + muls r1, r5 + adds r1, r4 + lsls r1, 1 + ldr r3, [sp, 0x50] + adds r1, r3 + strh r0, [r1] + adds r4, 0x1 + cmp r4, r9 + blt _080ADF1C +_080ADF4A: + adds r5, r6, 0 + ldr r0, [sp, 0x60] + cmp r5, r0 + blt _080ADF04 +_080ADF52: + ldr r1, _080ADF84 + add r0, sp, 0x10 + mov r2, r8 + bl sprintf + ldr r1, _080ADF88 + add r0, sp, 0x10 + bl sub_800A908 + ldr r1, [sp, 0x24] + str r0, [r1] + mov r0, r10 + bl MemoryFree + add sp, 0x30 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080ADF80: .4byte gUnknown_81188CC +_080ADF84: .4byte gUnknown_81188DC +_080ADF88: .4byte gUnknown_83B0000 + thumb_func_end sub_80ADD9C + + thumb_func_start sub_80ADF8C +sub_80ADF8C: + push {r4,lr} + adds r4, r0, 0 + ldr r0, [sp, 0xC] + cmp r4, 0 + blt _080ADFB0 + cmp r1, 0 + blt _080ADFB0 + cmp r4, r2 + bge _080ADFB0 + cmp r1, r3 + bge _080ADFB0 + adds r0, r1, 0 + muls r0, r2 + adds r0, r4, r0 + lsls r0, 1 + ldr r1, [sp, 0x8] + adds r0, r1 + ldrh r0, [r0] +_080ADFB0: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_80ADF8C + + thumb_func_start sub_80ADFB8 +sub_80ADFB8: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x30 + mov r9, r0 + mov r10, r1 + adds r6, r2, 0 + mov r8, r3 + ldr r4, [sp, 0x5C] + movs r7, 0 + ldr r0, [sp, 0x50] + str r0, [sp] + ldr r1, [sp, 0x54] + str r1, [sp, 0x4] + mov r0, r9 + mov r1, r10 + bl sub_80ADF8C + str r0, [sp, 0x28] + cmp r4, 0x3F + ble _080AE000 + mov r0, r9 + cmp r0, 0x17 + bgt _080ADFFC + mov r1, r10 + cmp r1, 0x17 + bgt _080ADFFC + lsls r0, r1, 1 + add r0, r10 + lsls r0, 3 + add r0, r9 + b _080AE24E +_080ADFFC: + ldr r0, [sp, 0x54] + b _080AE254 +_080AE000: + mov r0, r10 + adds r0, 0x1 + str r0, [sp, 0x2C] + ldr r1, [sp, 0x50] + str r1, [sp] + ldr r0, [sp, 0x54] + str r0, [sp, 0x4] + mov r0, r9 + ldr r1, [sp, 0x2C] + adds r2, r6, 0 + mov r3, r8 + bl sub_80ADF8C + str r0, [sp, 0x8] + mov r4, r9 + adds r4, 0x1 + ldr r1, [sp, 0x50] + str r1, [sp] + ldr r0, [sp, 0x54] + str r0, [sp, 0x4] + adds r0, r4, 0 + ldr r1, [sp, 0x2C] + adds r2, r6, 0 + mov r3, r8 + bl sub_80ADF8C + str r0, [sp, 0xC] + ldr r1, [sp, 0x50] + str r1, [sp] + ldr r0, [sp, 0x54] + str r0, [sp, 0x4] + adds r0, r4, 0 + mov r1, r10 + adds r2, r6, 0 + mov r3, r8 + bl sub_80ADF8C + str r0, [sp, 0x10] + mov r5, r10 + subs r5, 0x1 + ldr r1, [sp, 0x50] + str r1, [sp] + ldr r0, [sp, 0x54] + str r0, [sp, 0x4] + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + mov r3, r8 + bl sub_80ADF8C + str r0, [sp, 0x14] + ldr r1, [sp, 0x50] + str r1, [sp] + ldr r0, [sp, 0x54] + str r0, [sp, 0x4] + mov r0, r9 + adds r1, r5, 0 + adds r2, r6, 0 + mov r3, r8 + bl sub_80ADF8C + str r0, [sp, 0x18] + subs r4, 0x2 + ldr r1, [sp, 0x50] + str r1, [sp] + ldr r0, [sp, 0x54] + str r0, [sp, 0x4] + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + mov r3, r8 + bl sub_80ADF8C + str r0, [sp, 0x1C] + ldr r1, [sp, 0x50] + str r1, [sp] + ldr r0, [sp, 0x54] + str r0, [sp, 0x4] + adds r0, r4, 0 + mov r1, r10 + adds r2, r6, 0 + mov r3, r8 + bl sub_80ADF8C + str r0, [sp, 0x20] + ldr r1, [sp, 0x50] + str r1, [sp] + ldr r0, [sp, 0x54] + str r0, [sp, 0x4] + adds r0, r4, 0 + ldr r1, [sp, 0x2C] + adds r2, r6, 0 + mov r3, r8 + bl sub_80ADF8C + adds r1, r0, 0 + str r1, [sp, 0x24] + ldr r0, [sp, 0x28] + cmp r0, 0x1 + bne _080AE12A + movs r7, 0xFF + ldr r0, [sp, 0x8] + cmp r0, 0 + bne _080AE0D2 + movs r7, 0xFE +_080AE0D2: + ldr r0, [sp, 0xC] + cmp r0, 0 + bne _080AE0DE + movs r0, 0x3 + negs r0, r0 + ands r7, r0 +_080AE0DE: + ldr r0, [sp, 0x10] + cmp r0, 0 + bne _080AE0EA + movs r0, 0x5 + negs r0, r0 + ands r7, r0 +_080AE0EA: + ldr r0, [sp, 0x14] + cmp r0, 0 + bne _080AE0F6 + movs r0, 0x9 + negs r0, r0 + ands r7, r0 +_080AE0F6: + ldr r0, [sp, 0x18] + cmp r0, 0 + bne _080AE102 + movs r0, 0x11 + negs r0, r0 + ands r7, r0 +_080AE102: + ldr r0, [sp, 0x1C] + cmp r0, 0 + bne _080AE10E + movs r0, 0x21 + negs r0, r0 + ands r7, r0 +_080AE10E: + ldr r0, [sp, 0x20] + cmp r0, 0 + bne _080AE11A + movs r0, 0x41 + negs r0, r0 + ands r7, r0 +_080AE11A: + cmp r1, 0 + bne _080AE124 + movs r0, 0x81 + negs r0, r0 + ands r7, r0 +_080AE124: + movs r0, 0x80 + lsls r0, 2 + b _080AE248 +_080AE12A: + ldr r0, [sp, 0x28] + cmp r0, 0x2 + bne _080AE192 + movs r7, 0xFF + ldr r0, [sp, 0x8] + cmp r0, 0x2 + beq _080AE13A + movs r7, 0xFE +_080AE13A: + ldr r0, [sp, 0xC] + cmp r0, 0x2 + beq _080AE146 + movs r0, 0x3 + negs r0, r0 + ands r7, r0 +_080AE146: + ldr r0, [sp, 0x10] + cmp r0, 0x2 + beq _080AE152 + movs r0, 0x5 + negs r0, r0 + ands r7, r0 +_080AE152: + ldr r0, [sp, 0x14] + cmp r0, 0x2 + beq _080AE15E + movs r0, 0x9 + negs r0, r0 + ands r7, r0 +_080AE15E: + ldr r0, [sp, 0x18] + cmp r0, 0x2 + beq _080AE16A + movs r0, 0x11 + negs r0, r0 + ands r7, r0 +_080AE16A: + ldr r0, [sp, 0x1C] + cmp r0, 0x2 + beq _080AE176 + movs r0, 0x21 + negs r0, r0 + ands r7, r0 +_080AE176: + ldr r0, [sp, 0x20] + cmp r0, 0x2 + beq _080AE182 + movs r0, 0x41 + negs r0, r0 + ands r7, r0 +_080AE182: + cmp r1, 0x2 + beq _080AE18C + movs r0, 0x81 + negs r0, r0 + ands r7, r0 +_080AE18C: + movs r0, 0x80 + lsls r0, 1 + b _080AE248 +_080AE192: + ldr r1, [sp, 0x28] + cmp r1, 0x3 + bne _080AE1FC + movs r7, 0xFF + ldr r0, [sp, 0x8] + cmp r0, 0x3 + beq _080AE1A2 + movs r7, 0xFE +_080AE1A2: + ldr r0, [sp, 0xC] + cmp r0, 0x3 + beq _080AE1AE + movs r0, 0x3 + negs r0, r0 + ands r7, r0 +_080AE1AE: + ldr r0, [sp, 0x10] + cmp r0, 0x3 + beq _080AE1BA + movs r0, 0x5 + negs r0, r0 + ands r7, r0 +_080AE1BA: + ldr r0, [sp, 0x14] + cmp r0, 0x3 + beq _080AE1C6 + movs r0, 0x9 + negs r0, r0 + ands r7, r0 +_080AE1C6: + ldr r0, [sp, 0x18] + cmp r0, 0x3 + beq _080AE1D2 + movs r0, 0x11 + negs r0, r0 + ands r7, r0 +_080AE1D2: + ldr r0, [sp, 0x1C] + cmp r0, 0x3 + beq _080AE1DE + movs r0, 0x21 + negs r0, r0 + ands r7, r0 +_080AE1DE: + ldr r0, [sp, 0x20] + cmp r0, 0x3 + beq _080AE1EA + movs r0, 0x41 + negs r0, r0 + ands r7, r0 +_080AE1EA: + ldr r0, [sp, 0x24] + cmp r0, 0x3 + beq _080AE1F6 + movs r0, 0x81 + negs r0, r0 + ands r7, r0 +_080AE1F6: + movs r0, 0x80 + lsls r0, 1 + b _080AE248 +_080AE1FC: + ldr r0, [sp, 0x8] + cmp r0, 0 + bne _080AE204 + movs r7, 0x1 +_080AE204: + ldr r0, [sp, 0xC] + cmp r0, 0 + bne _080AE20E + movs r0, 0x2 + orrs r7, r0 +_080AE20E: + ldr r0, [sp, 0x10] + cmp r0, 0 + bne _080AE218 + movs r0, 0x4 + orrs r7, r0 +_080AE218: + ldr r0, [sp, 0x14] + cmp r0, 0 + bne _080AE222 + movs r0, 0x8 + orrs r7, r0 +_080AE222: + ldr r0, [sp, 0x18] + cmp r0, 0 + bne _080AE22C + movs r0, 0x10 + orrs r7, r0 +_080AE22C: + ldr r0, [sp, 0x1C] + cmp r0, 0 + bne _080AE236 + movs r0, 0x20 + orrs r7, r0 +_080AE236: + ldr r0, [sp, 0x20] + cmp r0, 0 + bne _080AE240 + movs r0, 0x40 + orrs r7, r0 +_080AE240: + ldr r0, [sp, 0x24] + cmp r0, 0 + bne _080AE24A + movs r0, 0x80 +_080AE248: + orrs r7, r0 +_080AE24A: + lsls r0, r7, 1 + adds r0, r7 +_080AE24E: + ldr r1, [sp, 0x58] + adds r0, r1, r0 + ldrb r0, [r0] +_080AE254: + add sp, 0x30 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_80ADFB8 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/code_8272724.s b/asm/code_8272724.s new file mode 100644 index 00000000..ff08ec22 --- /dev/null +++ b/asm/code_8272724.s @@ -0,0 +1,551 @@ + .include "constants/gba_constants.inc" + .include "asm/macros.inc" + + .syntax unified + + .section .rodata + + .space 0x3C + + .text + + thumb_func_start _08272760 +_08272760: + push {lr} + adds r1, r0, 0 + ldr r0, _08272770 + bl _08272774 + pop {r0} + bx r0 + .align 2, 0 +_08272770: .4byte 0x02027370 + thumb_func_end _08272760 + + thumb_func_start _08272774 +_08272774: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x10 + lsls r2, r1, 3 + adds r2, r1 + lsls r2, 3 + adds r4, r0, r2 + movs r1, 0x8 + ldrsh r0, [r4, r1] + cmp r0, 0 + ble _08272860 + ldr r0, [r4, 0xC] + cmp r0, 0x6 + bne _082727B0 + movs r2, 0x4 + ldrsh r1, [r4, r2] + ldr r0, [r4, 0x24] + adds r0, 0x2 + lsls r0, 3 + muls r0, r1 + lsls r0, 2 + ldr r1, [r4, 0x18] + adds r1, r0 + movs r3, 0x8 + ldrsh r0, [r4, r3] + subs r2, r0, 0x2 + b _082727B6 +_082727B0: + ldr r1, [r4, 0x18] + movs r5, 0x8 + ldrsh r2, [r4, r5] +_082727B6: + ldr r0, [r4, 0x20] + adds r3, r0, 0 + adds r3, 0x8 + str r3, [sp] + adds r0, 0x9 + mov r10, r0 + movs r3, 0 + movs r5, 0x4 + ldrsh r0, [r4, r5] + ldr r5, [r4, 0x28] + str r5, [sp, 0x8] + ldr r5, [r4, 0x1C] + str r5, [sp, 0x4] + adds r5, r4, 0 + adds r5, 0x44 + str r5, [sp, 0xC] + cmp r3, r0 + bge _0827284E + subs r7, r2, 0x1 + mov r9, r3 +_082727DE: + adds r2, r1, 0 + movs r0, 0x20 + adds r0, r2 + mov r12, r0 + adds r3, 0x1 + mov r8, r3 + cmp r7, 0 + ble _08272824 + ldr r1, [sp] + lsls r6, r1, 2 + adds r3, r7, 0 + mov r0, r10 + lsls r5, r0, 2 +_082727F8: + ldr r0, [r2, 0x8] + str r0, [r2] + ldr r0, [r2, 0xC] + str r0, [r2, 0x4] + ldr r0, [r2, 0x10] + str r0, [r2, 0x8] + ldr r0, [r2, 0x14] + str r0, [r2, 0xC] + ldr r0, [r2, 0x18] + str r0, [r2, 0x10] + ldr r0, [r2, 0x1C] + str r0, [r2, 0x14] + adds r1, r6, r2 + ldr r0, [r1] + str r0, [r2, 0x18] + adds r0, r5, r2 + ldr r0, [r0] + str r0, [r2, 0x1C] + adds r2, r1, 0 + subs r3, 0x1 + cmp r3, 0 + bne _082727F8 +_08272824: + ldr r0, [r2, 0x8] + str r0, [r2] + ldr r0, [r2, 0xC] + str r0, [r2, 0x4] + ldr r0, [r2, 0x10] + str r0, [r2, 0x8] + ldr r0, [r2, 0x14] + str r0, [r2, 0xC] + ldr r0, [r2, 0x18] + str r0, [r2, 0x10] + ldr r0, [r2, 0x1C] + str r0, [r2, 0x14] + mov r1, r9 + str r1, [r2, 0x18] + str r1, [r2, 0x1C] + mov r1, r12 + mov r3, r8 + movs r2, 0x4 + ldrsh r0, [r4, r2] + cmp r3, r0 + blt _082727DE +_0827284E: + ldr r3, [sp, 0x8] + str r3, [r4, 0x30] + ldr r5, [sp, 0x4] + str r5, [r4, 0x34] + ldr r0, [r4, 0x2C] + str r0, [r4, 0x38] + movs r0, 0x1 + ldr r1, [sp, 0xC] + strb r0, [r1] +_08272860: + add sp, 0x10 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end _08272774 + + thumb_func_start _08272870 +_08272870: + push {lr} + adds r1, r0, 0 + ldr r0, _08272880 + bl _08272884 + pop {r0} + bx r0 + .align 2, 0 +_08272880: .4byte 0x02027370 + thumb_func_end _08272870 + + thumb_func_start _08272884 +_08272884: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0xC + lsls r2, r1, 3 + adds r2, r1 + lsls r2, 3 + adds r5, r0, r2 + movs r1, 0x8 + ldrsh r0, [r5, r1] + cmp r0, 0 + ble _08272994 + ldr r0, [r5, 0xC] + cmp r0, 0x6 + bne _082728B0 + movs r2, 0x8 + ldrsh r0, [r5, r2] + subs r0, 0x2 + mov r9, r0 + b _082728B6 +_082728B0: + movs r0, 0x8 + ldrsh r3, [r5, r0] + mov r9, r3 +_082728B6: + movs r1, 0x8 + ldrsh r0, [r5, r1] + subs r0, 0x1 + movs r3, 0x4 + ldrsh r2, [r5, r3] + muls r0, r2 + lsls r0, 5 + ldr r1, [r5, 0x18] + adds r1, r0 + ldr r0, [r5, 0x20] + adds r0, 0x8 + mov r10, r0 + movs r4, 0 + ldr r0, [r5, 0x28] + str r0, [sp] + ldr r3, [r5, 0x1C] + str r3, [sp, 0x8] + adds r0, r5, 0 + adds r0, 0x44 + str r0, [sp, 0x4] + cmp r4, r2 + bge _08272982 + mov r12, r4 + movs r2, 0x1 + negs r2, r2 + add r2, r9 + mov r8, r2 +_082728EC: + adds r2, r1, 0 + mov r3, r9 + cmp r3, 0x1 + bgt _0827291A + ldr r0, [r1, 0x14] + str r0, [r1, 0x1C] + ldr r0, [r1, 0x10] + str r0, [r1, 0x18] + ldr r0, [r1, 0xC] + str r0, [r1, 0x14] + ldr r0, [r1, 0x8] + str r0, [r1, 0x10] + ldr r0, [r1, 0x4] + str r0, [r1, 0xC] + ldr r0, [r1] + str r0, [r1, 0x8] + mov r0, r12 + str r0, [r1, 0x4] + str r0, [r1] + adds r7, r1, 0 + adds r7, 0x20 + adds r6, r4, 0x1 + b _08272976 +_0827291A: + mov r3, r10 + lsls r0, r3, 2 + subs r3, r1, r0 + adds r7, r1, 0 + adds r7, 0x20 + adds r6, r4, 0x1 + mov r1, r8 + cmp r1, 0 + ble _08272958 + adds r4, r0, 0 +_0827292E: + ldr r0, [r2, 0x14] + str r0, [r2, 0x1C] + ldr r0, [r2, 0x10] + str r0, [r2, 0x18] + ldr r0, [r2, 0xC] + str r0, [r2, 0x14] + ldr r0, [r2, 0x8] + str r0, [r2, 0x10] + ldr r0, [r2, 0x4] + str r0, [r2, 0xC] + ldr r0, [r2] + str r0, [r2, 0x8] + ldr r0, [r3, 0x1C] + str r0, [r2, 0x4] + ldr r0, [r3, 0x18] + str r0, [r2] + subs r2, r4 + subs r3, r4 + subs r1, 0x1 + cmp r1, 0 + bne _0827292E +_08272958: + ldr r0, [r2, 0x14] + str r0, [r2, 0x1C] + ldr r0, [r2, 0x10] + str r0, [r2, 0x18] + ldr r0, [r2, 0xC] + str r0, [r2, 0x14] + ldr r0, [r2, 0x8] + str r0, [r2, 0x10] + ldr r0, [r2, 0x4] + str r0, [r2, 0xC] + ldr r0, [r2] + str r0, [r2, 0x8] + mov r3, r12 + str r3, [r2, 0x4] + str r3, [r2] +_08272976: + adds r1, r7, 0 + adds r4, r6, 0 + movs r2, 0x4 + ldrsh r0, [r5, r2] + cmp r4, r0 + blt _082728EC +_08272982: + ldr r3, [sp] + str r3, [r5, 0x30] + ldr r0, [sp, 0x8] + str r0, [r5, 0x34] + ldr r0, [r5, 0x2C] + str r0, [r5, 0x38] + movs r0, 0x1 + ldr r1, [sp, 0x4] + strb r0, [r1] +_08272994: + add sp, 0xC + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end _08272884 + + thumb_func_start _082729A4 +_082729A4: + push {lr} + adds r1, r0, 0 + ldr r0, _082729B4 + bl _082729B8 + pop {r0} + bx r0 + .align 2, 0 +_082729B4: .4byte 0x02027370 + thumb_func_end _082729A4 + + thumb_func_start _082729B8 +_082729B8: + push {r4-r7,lr} + mov r7, r8 + push {r7} + lsls r2, r1, 3 + adds r2, r1 + lsls r2, 3 + adds r4, r0, r2 + ldr r2, [r4, 0x18] + ldr r0, [r4, 0x20] + adds r1, r0, 0 + adds r1, 0x8 + adds r5, r0, 0 + adds r5, 0x9 + movs r3, 0 + movs r6, 0x4 + ldrsh r0, [r4, r6] + cmp r3, r0 + bge _08272A5A + lsls r1, 2 + mov r8, r1 + lsls r6, r5, 2 + movs r5, 0 +_082729E4: + ldr r0, [r2, 0x14] + str r0, [r2, 0xC] + ldr r0, [r2, 0x18] + str r0, [r2, 0x10] + ldr r0, [r2, 0x1C] + str r0, [r2, 0x14] + mov r0, r8 + adds r1, r0, r2 + ldr r0, [r1] + str r0, [r2, 0x18] + adds r0, r6, r2 + ldr r0, [r0] + str r0, [r2, 0x1C] + adds r7, r2, 0 + adds r7, 0x20 + adds r3, 0x1 + mov r12, r3 + movs r3, 0x4 +_08272A08: + ldr r0, [r1, 0x8] + str r0, [r1] + ldr r0, [r1, 0xC] + str r0, [r1, 0x4] + ldr r0, [r1, 0x10] + str r0, [r1, 0x8] + ldr r0, [r1, 0x14] + str r0, [r1, 0xC] + ldr r0, [r1, 0x18] + str r0, [r1, 0x10] + ldr r0, [r1, 0x1C] + str r0, [r1, 0x14] + mov r0, r8 + adds r2, r0, r1 + ldr r0, [r2] + str r0, [r1, 0x18] + adds r0, r6, r1 + ldr r0, [r0] + str r0, [r1, 0x1C] + adds r1, r2, 0 + subs r3, 0x1 + cmp r3, 0 + bge _08272A08 + ldr r0, [r2, 0x8] + str r0, [r2] + ldr r0, [r2, 0xC] + str r0, [r2, 0x4] + ldr r0, [r2, 0x10] + str r0, [r2, 0x8] + ldr r0, [r2, 0x14] + str r0, [r2, 0xC] + str r5, [r2, 0x10] + str r5, [r2, 0x14] + str r5, [r2, 0x18] + str r5, [r2, 0x1C] + adds r2, r7, 0 + mov r3, r12 + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r3, r0 + blt _082729E4 +_08272A5A: + ldr r0, [r4, 0x28] + str r0, [r4, 0x30] + ldr r0, [r4, 0x1C] + str r0, [r4, 0x34] + ldr r0, [r4, 0x2C] + str r0, [r4, 0x38] + adds r1, r4, 0 + adds r1, 0x44 + movs r0, 0x1 + strb r0, [r1] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end _082729B8 + + thumb_func_start _08272A78 +_08272A78: + push {lr} + adds r1, r0, 0 + ldr r0, _08272A88 + bl _08272A8C + pop {r0} + bx r0 + .align 2, 0 +_08272A88: .4byte 0x02027370 + thumb_func_end _08272A78 + + thumb_func_start _08272A8C +_08272A8C: + push {r4-r7,lr} + lsls r2, r1, 3 + adds r2, r1 + lsls r2, 3 + adds r4, r0, r2 + ldr r2, [r4, 0x18] + ldr r0, [r4, 0x20] + adds r1, r0, 0 + adds r1, 0x8 + movs r3, 0 + movs r5, 0x4 + ldrsh r0, [r4, r5] + cmp r3, r0 + bge _08272B20 + mov r12, r3 + lsls r5, r1, 2 +_08272AAC: + mov r0, r12 + str r0, [r2, 0xC] + ldr r0, [r2, 0x14] + str r0, [r2, 0x10] + ldr r0, [r2, 0x18] + str r0, [r2, 0x14] + ldr r0, [r2, 0x1C] + str r0, [r2, 0x18] + adds r1, r5, r2 + ldr r0, [r1] + str r0, [r2, 0x1C] + adds r6, r2, 0 + adds r6, 0x20 + adds r7, r3, 0x1 + movs r3, 0x4 +_08272ACA: + ldr r0, [r1, 0x4] + str r0, [r1] + ldr r0, [r1, 0x8] + str r0, [r1, 0x4] + ldr r0, [r1, 0xC] + str r0, [r1, 0x8] + ldr r0, [r1, 0x10] + str r0, [r1, 0xC] + ldr r0, [r1, 0x14] + str r0, [r1, 0x10] + ldr r0, [r1, 0x18] + str r0, [r1, 0x14] + ldr r0, [r1, 0x1C] + str r0, [r1, 0x18] + adds r2, r5, r1 + ldr r0, [r2] + str r0, [r1, 0x1C] + adds r1, r2, 0 + subs r3, 0x1 + cmp r3, 0 + bge _08272ACA + ldr r0, [r2, 0x4] + str r0, [r2] + ldr r0, [r2, 0x8] + str r0, [r2, 0x4] + ldr r0, [r2, 0xC] + str r0, [r2, 0x8] + ldr r0, [r2, 0x10] + str r0, [r2, 0xC] + ldr r0, [r2, 0x14] + str r0, [r2, 0x10] + ldr r0, [r2, 0x18] + str r0, [r2, 0x14] + ldr r0, [r2, 0x1C] + str r0, [r2, 0x18] + mov r1, r12 + str r1, [r2, 0x1C] + adds r2, r6, 0 + adds r3, r7, 0 + movs r1, 0x4 + ldrsh r0, [r4, r1] + cmp r3, r0 + blt _08272AAC +_08272B20: + ldr r0, [r4, 0x28] + str r0, [r4, 0x30] + ldr r0, [r4, 0x1C] + str r0, [r4, 0x34] + ldr r0, [r4, 0x2C] + str r0, [r4, 0x38] + adds r1, r4, 0 + adds r1, 0x44 + movs r0, 0x1 + strb r0, [r1] + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end _08272A8C + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/crt0.s b/asm/crt0.s new file mode 100644 index 00000000..fe1f1273 --- /dev/null +++ b/asm/crt0.s @@ -0,0 +1,103 @@ + .include "constants/gba_constants.inc" + + .syntax unified + + .global Start + + .text + + .arm + +Start: @ 8000000 + b Init + + .include "asm/rom_header.inc" + + .arm + .align 2, 0 + .global Init +Init: @ 80000C0 + mov r0, PSR_IRQ_MODE + msr cpsr_cf, r0 + ldr sp, sp_irq + mov r0, PSR_SYS_MODE + msr cpsr_cf, r0 + ldr sp, sp_sys + ldr r1, =INTR_VECTOR + adr r0, IntrMain + str r0, [r1] + ldr r1, =AgbMain + mov lr, pc + bx r1 + b Init + + .align 2, 0 +sp_sys: .word IWRAM_END - 0x100 +sp_irq: .word IWRAM_END - 0x60 + + .pool + + .arm + .align 2, 0 + .global IntrMain +IntrMain: @ 8000104 + mov r3, REG_BASE + add r3, r3, 0x200 + ldr r2, [r3, OFFSET_REG_IE - 0x200] + ldrh r1, [r3, OFFSET_REG_IME - 0x200] + mrs r0, spsr + stmdb sp!, {r0-r3,lr} + mov r0, 1 + strh r0, [r3, OFFSET_REG_IME - 0x200] + and r1, r2, r2, lsr 16 + mov r12, 0 + ands r0, r1, INTR_FLAG_SERIAL | INTR_FLAG_TIMER3 + bne IntrMain_FoundIntr + add r12, r12, 0x4 + ands r0, r1, INTR_FLAG_VBLANK + bne IntrMain_FoundIntr + add r12, r12, 0x4 + ands r0, r1, INTR_FLAG_VCOUNT + bne IntrMain_FoundIntr + add r12, r12, 0x4 + ands r0, r1, INTR_FLAG_TIMER2 + bne IntrMain_FoundIntr + add r12, r12, 0x4 + ands r0, r1, INTR_FLAG_TIMER3 + bne IntrMain_FoundIntr + add r12, r12, 0x4 + ands r0, r1, INTR_FLAG_GAMEPAK + strbne r0, [r3, OFFSET_REG_SOUNDCNT_X - 0x200] +IntrMain_Loop: + bne IntrMain_Loop +IntrMain_FoundIntr: + strh r0, [r3, OFFSET_REG_IF - 0x200] + mov r1, INTR_FLAG_GAMEPAK | INTR_FLAG_SERIAL + bic r2, r2, r0 + and r1, r1, r2 + strh r1, [r3, OFFSET_REG_IE - 0x200] + mrs r3, cpsr + bic r3, r3, PSR_I_BIT | PSR_F_BIT | PSR_MODE_MASK + orr r3, r3, PSR_SYS_MODE + msr cpsr_cf, r3 + ldr r1, =gIntrTable + add r1, r1, r12 + ldr r0, [r1] + stmdb sp!, {lr} + adr lr, IntrMain_RetAddr + bx r0 +IntrMain_RetAddr: + ldmia sp!, {lr} + mrs r3, cpsr + bic r3, r3, PSR_I_BIT | PSR_F_BIT | PSR_MODE_MASK + orr r3, r3, PSR_I_BIT | PSR_IRQ_MODE + msr cpsr_cf, r3 + ldmia sp!, {r0-r3,lr} + strh r2, [r3, OFFSET_REG_IE - 0x200] + strh r1, [r3, OFFSET_REG_IME - 0x200] + msr spsr_cf, r0 + bx lr + + .pool + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/libc.s b/asm/libc.s new file mode 100644 index 00000000..59d5db1e --- /dev/null +++ b/asm/libc.s @@ -0,0 +1,9071 @@ + .include "asm/macros.inc" + + .syntax unified + + .text + + thumb_func_start memcpy +memcpy: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r5, 0 + adds r3, r1, 0 + cmp r2, 0xF + bls _080B2700 + adds r0, r3, 0 + orrs r0, r5 + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _080B2700 + adds r1, r5, 0 +_080B26DA: + ldm r3!, {r0} + stm r1!, {r0} + ldm r3!, {r0} + stm r1!, {r0} + ldm r3!, {r0} + stm r1!, {r0} + ldm r3!, {r0} + stm r1!, {r0} + subs r2, 0x10 + cmp r2, 0xF + bhi _080B26DA + cmp r2, 0x3 + bls _080B26FE +_080B26F4: + ldm r3!, {r0} + stm r1!, {r0} + subs r2, 0x4 + cmp r2, 0x3 + bhi _080B26F4 +_080B26FE: + adds r4, r1, 0 +_080B2700: + subs r2, 0x1 + movs r0, 0x1 + negs r0, r0 + cmp r2, r0 + beq _080B271A + adds r1, r0, 0 +_080B270C: + ldrb r0, [r3] + strb r0, [r4] + adds r3, 0x1 + adds r4, 0x1 + subs r2, 0x1 + cmp r2, r1 + bne _080B270C +_080B271A: + adds r0, r5, 0 + pop {r4,r5,pc} + thumb_func_end memcpy + + thumb_func_start memset +memset: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r3, r5, 0 + cmp r2, 0x3 + bls _080B2766 + movs r0, 0x3 + ands r0, r5 + cmp r0, 0 + bne _080B2766 + adds r1, r5, 0 + movs r0, 0xFF + ands r4, r0 + lsls r3, r4, 8 + orrs r3, r4 + lsls r0, r3, 16 + orrs r3, r0 + cmp r2, 0xF + bls _080B275A +_080B2746: + stm r1!, {r3} + stm r1!, {r3} + stm r1!, {r3} + stm r1!, {r3} + subs r2, 0x10 + cmp r2, 0xF + bhi _080B2746 + b _080B275A +_080B2756: + stm r1!, {r3} + subs r2, 0x4 +_080B275A: + cmp r2, 0x3 + bhi _080B2756 + adds r3, r1, 0 + b _080B2766 +_080B2762: + strb r4, [r3] + adds r3, 0x1 +_080B2766: + adds r0, r2, 0 + subs r2, 0x1 + cmp r0, 0 + bne _080B2762 + adds r0, r5, 0 + pop {r4,r5,pc} + thumb_func_end memset + + thumb_func_start _sprintf_r +_sprintf_r: + push {r2,r3} + push {r4,r5,lr} + sub sp, 0x58 + ldr r4, [sp, 0x64] + mov r3, sp + movs r5, 0 + movs r2, 0x82 + lsls r2, 2 + strh r2, [r3, 0xC] + str r1, [sp] + str r1, [sp, 0x10] + ldr r1, _080B27AC + str r1, [sp, 0x8] + str r1, [sp, 0x14] + str r0, [sp, 0x54] + add r2, sp, 0x68 + mov r0, sp + adds r1, r4, 0 + bl vfprintf + ldr r1, [sp] + strb r5, [r1] + add sp, 0x58 + pop {r4,r5} + pop {r3} + add sp, 0x8 + bx r3 + .align 2, 0 +_080B27AC: .4byte 0x7fffffff + thumb_func_end _sprintf_r + + thumb_func_start sprintf +sprintf: + push {r1-r3} + push {r4,lr} + sub sp, 0x58 + ldr r1, [sp, 0x60] + mov r3, sp + movs r4, 0 + movs r2, 0x82 + lsls r2, 2 + strh r2, [r3, 0xC] + str r0, [sp] + str r0, [sp, 0x10] + ldr r0, _080B27E8 + str r0, [sp, 0x8] + str r0, [sp, 0x14] + ldr r0, _080B27EC + ldr r0, [r0] + str r0, [sp, 0x54] + add r2, sp, 0x64 + mov r0, sp + bl vfprintf + ldr r1, [sp] + strb r4, [r1] + add sp, 0x58 + pop {r4} + pop {r3} + add sp, 0xC + bx r3 + .align 2, 0 +_080B27E8: .4byte 0x7fffffff +_080B27EC: .4byte gUnknown_203B7A8 + thumb_func_end sprintf + + thumb_func_start strcat +strcat: + push {r4-r6,lr} + adds r2, r0, 0 + adds r6, r1, 0 + adds r4, r2, 0 + movs r0, 0x3 + ands r0, r4 + cmp r0, 0 + bne _080B2826 + ldr r1, [r4] + ldr r5, _080B280C + adds r0, r1, r5 + bics r0, r1 + ldr r3, _080B2810 + b _080B281C + .align 2, 0 +_080B280C: .4byte 0xfefefeff +_080B2810: .4byte 0x80808080 +_080B2814: + adds r2, 0x4 + ldr r1, [r2] + adds r0, r1, r5 + bics r0, r1 +_080B281C: + ands r0, r3 + cmp r0, 0 + beq _080B2814 + b _080B2826 +_080B2824: + adds r2, 0x1 +_080B2826: + ldrb r0, [r2] + cmp r0, 0 + bne _080B2824 + adds r0, r2, 0 + adds r1, r6, 0 + bl strcpy + adds r0, r4, 0 + pop {r4-r6,pc} + thumb_func_end strcat + + thumb_func_start strcmp +strcmp: + push {r4,r5,lr} + adds r2, r0, 0 + adds r3, r1, 0 + orrs r0, r3 + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _080B287E + ldr r1, [r2] + ldr r0, [r3] + cmp r1, r0 + bne _080B287E + ldr r5, _080B2864 + ldr r4, _080B2868 +_080B2854: + ldr r1, [r2] + adds r0, r1, r5 + bics r0, r1 + ands r0, r4 + cmp r0, 0 + beq _080B286C + movs r0, 0 + b _080B2890 + .align 2, 0 +_080B2864: .4byte 0xfefefeff +_080B2868: .4byte 0x80808080 +_080B286C: + adds r2, 0x4 + adds r3, 0x4 + ldr r1, [r2] + ldr r0, [r3] + cmp r1, r0 + beq _080B2854 + b _080B287E +_080B287A: + adds r2, 0x1 + adds r3, 0x1 +_080B287E: + ldrb r0, [r2] + cmp r0, 0 + beq _080B288A + ldrb r1, [r3] + cmp r0, r1 + beq _080B287A +_080B288A: + ldrb r2, [r2] + ldrb r3, [r3] + subs r0, r2, r3 +_080B2890: + pop {r4,r5,pc} + thumb_func_end strcmp + + thumb_func_start strcpy +strcpy: + push {r4-r6,lr} + adds r6, r0, 0 + adds r3, r6, 0 + adds r2, r1, 0 + adds r0, r2, 0 + orrs r0, r6 + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _080B28CC + ldr r1, [r2] + ldr r5, _080B28B4 + adds r0, r1, r5 + bics r0, r1 + ldr r4, _080B28B8 + b _080B28C6 + .align 2, 0 +_080B28B4: .4byte 0xfefefeff +_080B28B8: .4byte 0x80808080 +_080B28BC: + ldm r2!, {r0} + stm r3!, {r0} + ldr r1, [r2] + adds r0, r1, r5 + bics r0, r1 +_080B28C6: + ands r0, r4 + cmp r0, 0 + beq _080B28BC +_080B28CC: + ldrb r0, [r2] + strb r0, [r3] + lsls r0, 24 + adds r2, 0x1 + adds r3, 0x1 + cmp r0, 0 + bne _080B28CC + adds r0, r6, 0 + pop {r4-r6,pc} + thumb_func_end strcpy + + thumb_func_start strlen +strlen: + push {r4,r5,lr} + adds r1, r0, 0 + adds r5, r1, 0 + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _080B2918 + adds r2, r1, 0 + ldr r1, [r2] + ldr r4, _080B28FC + adds r0, r1, r4 + bics r0, r1 + ldr r3, _080B2900 + b _080B290C + .align 2, 0 +_080B28FC: .4byte 0xfefefeff +_080B2900: .4byte 0x80808080 +_080B2904: + adds r2, 0x4 + ldr r1, [r2] + adds r0, r1, r4 + bics r0, r1 +_080B290C: + ands r0, r3 + cmp r0, 0 + beq _080B2904 + adds r1, r2, 0 + b _080B2918 +_080B2916: + adds r1, 0x1 +_080B2918: + ldrb r0, [r1] + cmp r0, 0 + bne _080B2916 + subs r0, r1, r5 + pop {r4,r5,pc} + thumb_func_end strlen + + thumb_func_start strncpy +strncpy: + push {r4-r7,lr} + adds r7, r0, 0 + adds r4, r7, 0 + adds r3, r1, 0 + adds r0, r3, 0 + orrs r0, r7 + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _080B2966 + cmp r2, 0x3 + bls _080B2966 + ldr r1, [r3] + ldr r6, _080B2948 + adds r0, r1, r6 + bics r0, r1 + ldr r5, _080B294C + b _080B2960 + .align 2, 0 +_080B2948: .4byte 0xfefefeff +_080B294C: .4byte 0x80808080 +_080B2950: + subs r2, 0x4 + ldm r3!, {r0} + stm r4!, {r0} + cmp r2, 0x3 + bls _080B2966 + ldr r1, [r3] + adds r0, r1, r6 + bics r0, r1 +_080B2960: + ands r0, r5 + cmp r0, 0 + beq _080B2950 +_080B2966: + cmp r2, 0 + beq _080B297A + subs r2, 0x1 + ldrb r0, [r3] + strb r0, [r4] + lsls r0, 24 + adds r3, 0x1 + adds r4, 0x1 + cmp r0, 0 + bne _080B2966 +_080B297A: + adds r0, r2, 0 + subs r2, 0x1 + cmp r0, 0 + beq _080B2990 + movs r1, 0 +_080B2984: + strb r1, [r4] + adds r4, 0x1 + adds r0, r2, 0 + subs r2, 0x1 + cmp r0, 0 + bne _080B2984 +_080B2990: + adds r0, r7, 0 + pop {r4-r7,pc} + thumb_func_end strncpy + + thumb_func_start __sprint +__sprint: + push {r4,lr} + adds r4, r1, 0 + ldr r1, [r4, 0x8] + cmp r1, 0 + beq _080B29AC + adds r1, r4, 0 + bl sub_80B4EA4 + movs r1, 0 + str r1, [r4, 0x8] + str r1, [r4, 0x4] + b _080B29B0 +_080B29AC: + str r1, [r4, 0x4] + movs r0, 0 +_080B29B0: + pop {r4,pc} + thumb_func_end __sprint + + thumb_func_start __sbprintf +__sbprintf: + push {r4,r5,lr} + ldr r4, _080B2A24 + add sp, r4 + adds r5, r0, 0 + ldr r0, [r5, 0x54] + str r0, [sp, 0x54] + mov r3, sp + movs r0, 0x3 + negs r0, r0 + ldrh r4, [r5, 0xC] + ands r0, r4 + movs r4, 0 + strh r0, [r3, 0xC] + ldrh r0, [r5, 0xE] + strh r0, [r3, 0xE] + ldr r0, [r5, 0x1C] + str r0, [sp, 0x1C] + ldr r0, [r5, 0x24] + str r0, [sp, 0x24] + add r0, sp, 0x58 + str r0, [sp] + str r0, [sp, 0x10] + movs r0, 0x80 + lsls r0, 3 + str r0, [sp, 0x8] + str r0, [sp, 0x14] + str r4, [sp, 0x18] + mov r0, sp + bl vfprintf + adds r4, r0, 0 + cmp r4, 0 + blt _080B2A04 + mov r0, sp + bl sub_80B4A34 + cmp r0, 0 + beq _080B2A04 + movs r4, 0x1 + negs r4, r4 +_080B2A04: + mov r1, sp + movs r0, 0x40 + ldrh r1, [r1, 0xC] + ands r0, r1 + cmp r0, 0 + beq _080B2A18 + movs r0, 0x40 + ldrh r1, [r5, 0xC] + orrs r0, r1 + strh r0, [r5, 0xC] +_080B2A18: + adds r0, r4, 0 + movs r3, 0x8B + lsls r3, 3 + add sp, r3 + pop {r4,r5,pc} + .align 2, 0 +_080B2A24: .4byte 0xfffffba8 + thumb_func_end __sbprintf + + thumb_func_start vfprintf +vfprintf: + push {r4,r5,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r3, r2, 0 + ldr r0, [r4, 0x54] + adds r1, r4, 0 + adds r2, r5, 0 + bl _vfprintf_r + pop {r4,r5,pc} + thumb_func_end vfprintf + + thumb_func_start _vfprintf_r +_vfprintf_r: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + ldr r4, _080B2AA4 + add sp, r4 + str r0, [sp, 0x1DC] + str r1, [sp, 0x1E0] + adds r4, r2, 0 + mov r10, r3 + bl sub_80B516C + ldr r0, [r0] + str r0, [sp, 0x1F8] + movs r1, 0 + add r0, sp, 0x1D0 + str r1, [r0] + ldr r1, [sp, 0x1E0] + ldr r0, [r1, 0x54] + cmp r0, 0 + bne _080B2A6E + ldr r0, _080B2AA8 + ldr r0, [r0] + str r0, [r1, 0x54] +_080B2A6E: + ldr r2, [sp, 0x1E0] + ldr r1, [r2, 0x54] + ldr r0, [r1, 0x38] + cmp r0, 0 + bne _080B2A7E + adds r0, r1, 0 + bl sub_80B4BC4 +_080B2A7E: + movs r0, 0x8 + ldr r1, [sp, 0x1E0] + ldrh r1, [r1, 0xC] + ands r0, r1 + cmp r0, 0 + beq _080B2A92 + ldr r2, [sp, 0x1E0] + ldr r0, [r2, 0x10] + cmp r0, 0 + bne _080B2AAC +_080B2A92: + ldr r0, [sp, 0x1E0] + bl sub_80B3B34 + cmp r0, 0 + beq _080B2AAC + movs r0, 0x1 + negs r0, r0 + bl _080B398C + .align 2, 0 +_080B2AA4: .4byte 0xfffffde0 +_080B2AA8: .4byte gUnknown_203B7A8 +_080B2AAC: + movs r0, 0x1A + ldr r1, [sp, 0x1E0] + ldrh r1, [r1, 0xC] + ands r0, r1 + cmp r0, 0xA + bne _080B2AD0 + ldr r2, [sp, 0x1E0] + movs r1, 0xE + ldrsh r0, [r2, r1] + cmp r0, 0 + blt _080B2AD0 + adds r0, r2, 0 + adds r1, r4, 0 + mov r2, r10 + bl __sbprintf + bl _080B398C +_080B2AD0: + str r4, [sp, 0x1E4] + add r1, sp, 0x1C + add r5, sp, 0x28 + str r5, [sp, 0x1C] + movs r0, 0 + str r0, [r1, 0x8] + str r0, [r1, 0x4] + movs r2, 0 + str r2, [sp, 0x1F0] + mov r9, r1 + movs r4, 0xE6 + lsls r4, 1 + add r4, sp + str r4, [sp, 0x214] + movs r0, 0xE8 + lsls r0, 1 + add r0, sp + str r0, [sp, 0x218] +_080B2AF4: + ldr r1, [sp, 0x1E4] + mov r8, r1 +_080B2AF8: + ldr r0, _080B2BA4 + ldr r0, [r0] + ldr r1, _080B2BA8 + ldr r3, [r1] + ldr r2, [sp, 0x218] + str r2, [sp] + ldr r1, [sp, 0x214] + ldr r2, [sp, 0x1E4] + bl sub_80B5774 + adds r4, r0, 0 + cmp r4, 0 + ble _080B2B26 + ldr r0, [sp, 0x1E4] + adds r0, r4 + str r0, [sp, 0x1E4] + add r0, sp, 0x1CC + ldr r0, [r0] + cmp r0, 0x25 + bne _080B2AF8 + ldr r1, [sp, 0x1E4] + subs r1, 0x1 + str r1, [sp, 0x1E4] +_080B2B26: + ldr r2, [sp, 0x1E4] + mov r0, r8 + subs r6, r2, r0 + cmp r6, 0 + beq _080B2B5E + str r0, [r5] + str r6, [r5, 0x4] + mov r1, r9 + ldr r0, [r1, 0x8] + adds r0, r6 + str r0, [r1, 0x8] + adds r5, 0x8 + ldr r0, [r1, 0x4] + adds r0, 0x1 + str r0, [r1, 0x4] + cmp r0, 0x7 + ble _080B2B58 + ldr r0, [sp, 0x1E0] + bl __sprint + cmp r0, 0 + beq _080B2B56 + bl _080B3978 +_080B2B56: + add r5, sp, 0x28 +_080B2B58: + ldr r2, [sp, 0x1F0] + adds r2, r6 + str r2, [sp, 0x1F0] +_080B2B5E: + cmp r4, 0 + bgt _080B2B66 + bl _080B3960 +_080B2B66: + ldr r4, [sp, 0x1E4] + adds r4, 0x1 + str r4, [sp, 0x1E4] + movs r0, 0 + str r0, [sp, 0x1EC] + movs r1, 0 + str r1, [sp, 0x208] + movs r2, 0 + str r2, [sp, 0x1F4] + movs r6, 0x1 + negs r6, r6 + ldr r0, _080B2BAC + add r0, sp + strb r2, [r0] +_080B2B82: + ldr r0, [sp, 0x1E4] + ldrb r0, [r0] + str r0, [sp, 0x1E8] + ldr r1, [sp, 0x1E4] + adds r1, 0x1 + str r1, [sp, 0x1E4] +_080B2B8E: + ldr r0, [sp, 0x1E8] + subs r0, 0x20 + cmp r0, 0x58 + bls _080B2B98 + b _080B324A +_080B2B98: + lsls r0, 2 + ldr r1, _080B2BB0 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080B2BA4: .4byte gUnknown_203B7A8 +_080B2BA8: .4byte gUnknown_203B7AC +_080B2BAC: .4byte 0x000001c9 +_080B2BB0: .4byte _080B2BB4 + .align 2, 0 +_080B2BB4: + .4byte _080B2D18 + .4byte _080B324A + .4byte _080B324A + .4byte _080B2D30 + .4byte _080B324A + .4byte _080B324A + .4byte _080B324A + .4byte _080B324A + .4byte _080B324A + .4byte _080B324A + .4byte _080B2D34 + .4byte _080B2D4E + .4byte _080B324A + .4byte _080B2D4A + .4byte _080B2D5C + .4byte _080B324A + .4byte _080B2DBC + .4byte _080B2DC0 + .4byte _080B2DC0 + .4byte _080B2DC0 + .4byte _080B2DC0 + .4byte _080B2DC0 + .4byte _080B2DC0 + .4byte _080B2DC0 + .4byte _080B2DC0 + .4byte _080B2DC0 + .4byte _080B324A + .4byte _080B324A + .4byte _080B324A + .4byte _080B324A + .4byte _080B324A + .4byte _080B324A + .4byte _080B324A + .4byte _080B324A + .4byte _080B324A + .4byte _080B324A + .4byte _080B2E2A + .4byte _080B2E7C + .4byte _080B324A + .4byte _080B2E7C + .4byte _080B324A + .4byte _080B324A + .4byte _080B324A + .4byte _080B324A + .4byte _080B2DE4 + .4byte _080B324A + .4byte _080B324A + .4byte _080B3032 + .4byte _080B324A + .4byte _080B324A + .4byte _080B324A + .4byte _080B324A + .4byte _080B324A + .4byte _080B30CA + .4byte _080B324A + .4byte _080B324A + .4byte _080B3106 + .4byte _080B324A + .4byte _080B324A + .4byte _080B324A + .4byte _080B324A + .4byte _080B324A + .4byte _080B324A + .4byte _080B324A + .4byte _080B324A + .4byte _080B324A + .4byte _080B324A + .4byte _080B2E18 + .4byte _080B2E32 + .4byte _080B2E7C + .4byte _080B2E7C + .4byte _080B2E7C + .4byte _080B2DE8 + .4byte _080B2E32 + .4byte _080B324A + .4byte _080B324A + .4byte _080B2DEC + .4byte _080B324A + .4byte _080B2FEC + .4byte _080B303A + .4byte _080B3068 + .4byte _080B2E0E + .4byte _080B324A + .4byte _080B3088 + .4byte _080B324A + .4byte _080B30D2 + .4byte _080B324A + .4byte _080B324A + .4byte _080B3110 +_080B2D18: + ldr r1, _080B2D2C + add r1, sp + ldrb r0, [r1] + cmp r0, 0 + beq _080B2D24 + b _080B2B82 +_080B2D24: + movs r0, 0x20 + strb r0, [r1] + b _080B2B82 + .align 2, 0 +_080B2D2C: .4byte 0x000001c9 +_080B2D30: + movs r0, 0x1 + b _080B2DFC +_080B2D34: + movs r4, 0x4 + add r10, r4 + mov r0, r10 + subs r0, 0x4 + ldr r0, [r0] + str r0, [sp, 0x1F4] + cmp r0, 0 + blt _080B2D46 + b _080B2B82 +_080B2D46: + negs r0, r0 + str r0, [sp, 0x1F4] +_080B2D4A: + movs r0, 0x4 + b _080B2E10 +_080B2D4E: + ldr r1, _080B2D58 + add r1, sp + movs r0, 0x2B + strb r0, [r1] + b _080B2B82 + .align 2, 0 +_080B2D58: .4byte 0x000001c9 +_080B2D5C: + ldr r2, [sp, 0x1E4] + ldrb r2, [r2] + str r2, [sp, 0x1E8] + ldr r4, [sp, 0x1E4] + adds r4, 0x1 + str r4, [sp, 0x1E4] + cmp r2, 0x2A + bne _080B2D86 + movs r0, 0x4 + add r10, r0 + mov r0, r10 + subs r0, 0x4 + ldr r4, [r0] + adds r6, r4, 0 + movs r0, 0x1 + negs r0, r0 + cmp r6, r0 + blt _080B2D82 + b _080B2B82 +_080B2D82: + adds r6, r0, 0 + b _080B2B82 +_080B2D86: + movs r4, 0 + ldr r0, [sp, 0x1E8] + b _080B2DA6 +_080B2D8C: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 1 + subs r0, 0x30 + ldr r1, [sp, 0x1E8] + adds r4, r0, r1 + ldr r2, [sp, 0x1E4] + ldrb r2, [r2] + str r2, [sp, 0x1E8] + ldr r0, [sp, 0x1E4] + adds r0, 0x1 + str r0, [sp, 0x1E4] + adds r0, r2, 0 +_080B2DA6: + subs r0, 0x30 + cmp r0, 0x9 + bls _080B2D8C + adds r6, r4, 0 + movs r0, 0x1 + negs r0, r0 + cmp r6, r0 + blt _080B2DB8 + b _080B2B8E +_080B2DB8: + adds r6, r0, 0 + b _080B2B8E +_080B2DBC: + movs r0, 0x80 + b _080B2E10 +_080B2DC0: + movs r4, 0 +_080B2DC2: + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 1 + subs r0, 0x30 + ldr r2, [sp, 0x1E8] + adds r4, r0, r2 + ldr r0, [sp, 0x1E4] + ldrb r0, [r0] + str r0, [sp, 0x1E8] + ldr r1, [sp, 0x1E4] + adds r1, 0x1 + str r1, [sp, 0x1E4] + subs r0, 0x30 + cmp r0, 0x9 + bls _080B2DC2 + str r4, [sp, 0x1F4] + b _080B2B8E +_080B2DE4: + movs r0, 0x8 + b _080B2DFC +_080B2DE8: + movs r0, 0x40 + b _080B2E06 +_080B2DEC: + ldr r0, [sp, 0x1E4] + ldrb r0, [r0] + cmp r0, 0x6C + bne _080B2E04 + ldr r1, [sp, 0x1E4] + adds r1, 0x1 + str r1, [sp, 0x1E4] + movs r0, 0x20 +_080B2DFC: + ldr r2, [sp, 0x1EC] + orrs r2, r0 + str r2, [sp, 0x1EC] + b _080B2B82 +_080B2E04: + movs r0, 0x10 +_080B2E06: + ldr r4, [sp, 0x1EC] + orrs r4, r0 + str r4, [sp, 0x1EC] + b _080B2B82 +_080B2E0E: + movs r0, 0x20 +_080B2E10: + ldr r1, [sp, 0x1EC] + orrs r1, r0 + str r1, [sp, 0x1EC] + b _080B2B82 +_080B2E18: + add r2, sp, 0x68 + mov r8, r2 + movs r4, 0x4 + add r10, r4 + mov r0, r10 + subs r0, 0x4 + ldr r0, [r0] + strb r0, [r2] + b _080B3258 +_080B2E2A: + movs r0, 0x10 + ldr r1, [sp, 0x1EC] + orrs r1, r0 + str r1, [sp, 0x1EC] +_080B2E32: + movs r0, 0x10 + ldr r2, [sp, 0x1EC] + ands r0, r2 + cmp r0, 0 + beq _080B2E42 + movs r4, 0x4 + add r10, r4 + b _080B2E5E +_080B2E42: + movs r0, 0x40 + ldr r1, [sp, 0x1EC] + ands r0, r1 + cmp r0, 0 + beq _080B2E5A + movs r2, 0x4 + add r10, r2 + mov r0, r10 + subs r0, 0x4 + movs r1, 0 + ldrsh r4, [r0, r1] + b _080B2E64 +_080B2E5A: + movs r2, 0x4 + add r10, r2 +_080B2E5E: + mov r0, r10 + subs r0, 0x4 + ldr r4, [r0] +_080B2E64: + cmp r4, 0 + bge _080B2E72 + negs r4, r4 + ldr r1, _080B2E78 + add r1, sp + movs r0, 0x2D + strb r0, [r1] +_080B2E72: + movs r2, 0x1 + b _080B315E + .align 2, 0 +_080B2E78: .4byte 0x000001c9 +_080B2E7C: + movs r0, 0x1 + negs r0, r0 + cmp r6, r0 + bne _080B2E88 + movs r6, 0x6 + b _080B2E98 +_080B2E88: + ldr r4, [sp, 0x1E8] + cmp r4, 0x67 + beq _080B2E92 + cmp r4, 0x47 + bne _080B2E98 +_080B2E92: + cmp r6, 0 + bne _080B2E98 + movs r6, 0x1 +_080B2E98: + movs r0, 0x8 + ldr r1, [sp, 0x1EC] + ands r0, r1 + movs r2, 0x8 + add r10, r2 + mov r0, r10 + subs r0, 0x8 + ldr r1, [r0] + ldr r2, [r0, 0x4] + str r1, [sp, 0x1FC] + str r2, [sp, 0x200] + ldr r0, [sp, 0x1FC] + ldr r1, [sp, 0x200] + bl sub_80B6180 + cmp r0, 0 + beq _080B2EEC + ldr r3, _080B2EE0 + ldr r2, _080B2EDC + ldr r0, [sp, 0x1FC] + ldr r1, [sp, 0x200] + bl __ltdf2 + cmp r0, 0 + bge _080B2ED2 + ldr r1, _080B2EE4 + add r1, sp + movs r0, 0x2D + strb r0, [r1] +_080B2ED2: + ldr r2, _080B2EE8 + mov r8, r2 + movs r3, 0x3 + b _080B3262 + .align 2, 0 +_080B2EDC: .4byte 0x00000000 +_080B2EE0: .4byte 0x00000000 +_080B2EE4: .4byte 0x000001c9 +_080B2EE8: .4byte gUnknown_826FE04 +_080B2EEC: + ldr r0, [sp, 0x1FC] + ldr r1, [sp, 0x200] + bl sub_80B61A4 + cmp r0, 0 + beq _080B2F04 + ldr r4, _080B2F00 + mov r8, r4 + movs r3, 0x3 + b _080B3262 + .align 2, 0 +_080B2F00: .4byte gUnknown_826FE08 +_080B2F04: + movs r0, 0x80 + lsls r0, 1 + ldr r1, [sp, 0x1EC] + orrs r1, r0 + str r1, [sp, 0x1EC] + str r1, [sp] + add r0, sp, 0x1C8 + str r0, [sp, 0x4] + add r0, sp, 0x1D4 + str r0, [sp, 0x8] + ldr r2, [sp, 0x1E8] + str r2, [sp, 0xC] + add r0, sp, 0x1D8 + str r0, [sp, 0x10] + ldr r0, [sp, 0x1DC] + ldr r1, [sp, 0x1FC] + ldr r2, [sp, 0x200] + adds r3, r6, 0 + bl sub_80B399C + mov r8, r0 + ldr r4, [sp, 0x1E8] + cmp r4, 0x67 + beq _080B2F38 + cmp r4, 0x47 + bne _080B2F5A +_080B2F38: + add r0, sp, 0x1D4 + ldr r1, [r0] + movs r0, 0x4 + negs r0, r0 + cmp r1, r0 + ble _080B2F48 + cmp r1, r6 + ble _080B2F56 +_080B2F48: + movs r0, 0x45 + ldr r1, [sp, 0x1E8] + cmp r1, 0x67 + bne _080B2F52 + movs r0, 0x65 +_080B2F52: + str r0, [sp, 0x1E8] + b _080B2F5A +_080B2F56: + movs r2, 0x67 + str r2, [sp, 0x1E8] +_080B2F5A: + ldr r4, [sp, 0x1E8] + cmp r4, 0x65 + bgt _080B2F80 + add r0, sp, 0x1D4 + ldr r1, [r0] + subs r1, 0x1 + str r1, [r0] + add r0, sp, 0x14 + ldr r2, [sp, 0x1E8] + bl sub_80B3A90 + str r0, [sp, 0x204] + add r0, sp, 0x1D8 + ldr r0, [r0] + ldr r1, [sp, 0x204] + adds r3, r1, r0 + cmp r0, 0x1 + bgt _080B2FC0 + b _080B2FB6 +_080B2F80: + ldr r4, [sp, 0x1E8] + cmp r4, 0x66 + bne _080B2FA8 + add r0, sp, 0x1D4 + ldr r0, [r0] + cmp r0, 0 + ble _080B2FA4 + adds r3, r0, 0 + cmp r6, 0 + bne _080B2F9E + movs r0, 0x1 + ldr r1, [sp, 0x1EC] + ands r0, r1 + cmp r0, 0 + beq _080B2FD0 +_080B2F9E: + adds r0, r3, 0x1 + adds r3, r0, r6 + b _080B2FD0 +_080B2FA4: + adds r3, r6, 0x2 + b _080B2FD0 +_080B2FA8: + add r0, sp, 0x1D4 + ldr r1, [r0] + add r0, sp, 0x1D8 + ldr r0, [r0] + cmp r1, r0 + blt _080B2FC4 + adds r3, r1, 0 +_080B2FB6: + movs r0, 0x1 + ldr r2, [sp, 0x1EC] + ands r0, r2 + cmp r0, 0 + beq _080B2FD0 +_080B2FC0: + adds r3, 0x1 + b _080B2FD0 +_080B2FC4: + cmp r1, 0 + bgt _080B2FCE + adds r0, 0x2 + subs r3, r0, r1 + b _080B2FD0 +_080B2FCE: + adds r3, r0, 0x1 +_080B2FD0: + add r0, sp, 0x1C8 + ldrb r0, [r0] + adds r7, r5, 0 + adds r7, 0x8 + cmp r0, 0 + bne _080B2FDE + b _080B3266 +_080B2FDE: + ldr r1, _080B2FE8 + add r1, sp + movs r0, 0x2D + strb r0, [r1] + b _080B3266 + .align 2, 0 +_080B2FE8: .4byte 0x000001c9 +_080B2FEC: + movs r0, 0x10 + ldr r4, [sp, 0x1EC] + ands r0, r4 + cmp r0, 0 + beq _080B3006 + movs r0, 0x4 + add r10, r0 + mov r0, r10 + subs r0, 0x4 + ldr r0, [r0] + ldr r1, [sp, 0x1F0] + str r1, [r0] + b _080B2AF4 +_080B3006: + movs r0, 0x40 + ldr r2, [sp, 0x1EC] + ands r2, r0 + cmp r2, 0 + beq _080B3022 + movs r4, 0x4 + add r10, r4 + mov r0, r10 + subs r0, 0x4 + ldr r0, [r0] + add r1, sp, 0x1F0 + ldrh r1, [r1] + strh r1, [r0] + b _080B2AF4 +_080B3022: + movs r2, 0x4 + add r10, r2 + mov r0, r10 + subs r0, 0x4 + ldr r0, [r0] + ldr r4, [sp, 0x1F0] + str r4, [r0] + b _080B2AF4 +_080B3032: + movs r0, 0x10 + ldr r1, [sp, 0x1EC] + orrs r1, r0 + str r1, [sp, 0x1EC] +_080B303A: + movs r0, 0x10 + ldr r2, [sp, 0x1EC] + ands r0, r2 + cmp r0, 0 + bne _080B305A + movs r0, 0x40 + ldr r1, [sp, 0x1EC] + ands r0, r1 + cmp r0, 0 + beq _080B305A + movs r2, 0x4 + add r10, r2 + mov r0, r10 + subs r0, 0x4 + ldrh r4, [r0] + b _080B3064 +_080B305A: + movs r4, 0x4 + add r10, r4 + mov r0, r10 + subs r0, 0x4 + ldr r4, [r0] +_080B3064: + movs r2, 0 + b _080B3156 +_080B3068: + movs r0, 0x4 + add r10, r0 + mov r0, r10 + subs r0, 0x4 + ldr r4, [r0] + movs r2, 0x2 + ldr r1, _080B3084 + str r1, [sp, 0x210] + ldr r0, [sp, 0x1EC] + orrs r0, r2 + str r0, [sp, 0x1EC] + movs r1, 0x78 + str r1, [sp, 0x1E8] + b _080B3156 + .align 2, 0 +_080B3084: .4byte gUnknown_826FE0C +_080B3088: + movs r2, 0x4 + add r10, r2 + mov r0, r10 + subs r0, 0x4 + ldr r0, [r0] + mov r8, r0 + cmp r0, 0 + bne _080B309C + ldr r4, _080B30BC + mov r8, r4 +_080B309C: + cmp r6, 0 + blt _080B30C0 + mov r0, r8 + movs r1, 0 + adds r2, r6, 0 + bl sub_80B57A0 + cmp r0, 0 + beq _080B30B8 + mov r1, r8 + subs r3, r0, r1 + cmp r3, r6 + bgt _080B30B8 + b _080B325A +_080B30B8: + adds r3, r6, 0 + b _080B325A + .align 2, 0 +_080B30BC: .4byte gUnknown_826FE20 +_080B30C0: + mov r0, r8 + bl strlen + adds r3, r0, 0 + b _080B325A +_080B30CA: + movs r0, 0x10 + ldr r2, [sp, 0x1EC] + orrs r2, r0 + str r2, [sp, 0x1EC] +_080B30D2: + movs r0, 0x10 + ldr r4, [sp, 0x1EC] + ands r0, r4 + cmp r0, 0 + beq _080B30E2 + movs r0, 0x4 + add r10, r0 + b _080B30FC +_080B30E2: + movs r0, 0x40 + ldr r1, [sp, 0x1EC] + ands r0, r1 + cmp r0, 0 + beq _080B30F8 + movs r2, 0x4 + add r10, r2 + mov r0, r10 + subs r0, 0x4 + ldrh r4, [r0] + b _080B3102 +_080B30F8: + movs r4, 0x4 + add r10, r4 +_080B30FC: + mov r0, r10 + subs r0, 0x4 + ldr r4, [r0] +_080B3102: + movs r2, 0x1 + b _080B3156 +_080B3106: + ldr r0, _080B310C + str r0, [sp, 0x210] + b _080B3114 + .align 2, 0 +_080B310C: .4byte gUnknown_826FE28 +_080B3110: + ldr r1, _080B3134 + str r1, [sp, 0x210] +_080B3114: + movs r0, 0x10 + ldr r2, [sp, 0x1EC] + ands r0, r2 + cmp r0, 0 + bne _080B3138 + movs r0, 0x40 + ldr r1, [sp, 0x1EC] + ands r0, r1 + cmp r0, 0 + beq _080B3138 + movs r2, 0x4 + add r10, r2 + mov r0, r10 + subs r0, 0x4 + ldrh r4, [r0] + b _080B3142 + .align 2, 0 +_080B3134: .4byte gUnknown_826FE0C +_080B3138: + movs r4, 0x4 + add r10, r4 + mov r0, r10 + subs r0, 0x4 + ldr r4, [r0] +_080B3142: + movs r2, 0x2 + movs r0, 0x1 + ldr r1, [sp, 0x1EC] + ands r0, r1 + cmp r0, 0 + beq _080B3156 + cmp r4, 0 + beq _080B3156 + orrs r1, r2 + str r1, [sp, 0x1EC] +_080B3156: + ldr r1, _080B31A0 + add r1, sp + movs r0, 0 + strb r0, [r1] +_080B315E: + str r6, [sp, 0x208] + cmp r6, 0 + blt _080B316E + movs r0, 0x81 + negs r0, r0 + ldr r1, [sp, 0x1EC] + ands r1, r0 + str r1, [sp, 0x1EC] +_080B316E: + movs r0, 0xE2 + lsls r0, 1 + add r0, sp + mov r8, r0 + cmp r4, 0 + bne _080B3184 + adds r7, r5, 0 + adds r7, 0x8 + ldr r1, [sp, 0x208] + cmp r1, 0 + beq _080B323C +_080B3184: + cmp r2, 0x1 + beq _080B31E2 + cmp r2, 0x1 + bcc _080B31A8 + cmp r2, 0x2 + beq _080B321C + ldr r2, _080B31A4 + mov r8, r2 + mov r0, r8 + bl strlen + adds r3, r0, 0 + b _080B3262 + .align 2, 0 +_080B31A0: .4byte 0x000001c9 +_080B31A4: .4byte gUnknown_826FE3C +_080B31A8: + adds r7, r5, 0 + adds r7, 0x8 + movs r2, 0x7 +_080B31AE: + movs r0, 0x1 + negs r0, r0 + add r8, r0 + adds r0, r4, 0 + ands r0, r2 + adds r1, r0, 0 + adds r1, 0x30 + mov r0, r8 + strb r1, [r0] + lsrs r4, 3 + cmp r4, 0 + bne _080B31AE + movs r0, 0x1 + ldr r2, [sp, 0x1EC] + ands r0, r2 + cmp r0, 0 + beq _080B323C + cmp r1, 0x30 + beq _080B323C + movs r4, 0x1 + negs r4, r4 + add r8, r4 + movs r0, 0x30 + mov r1, r8 + strb r0, [r1] + b _080B323C +_080B31E2: + adds r7, r5, 0 + adds r7, 0x8 + cmp r4, 0x9 + bls _080B320C +_080B31EA: + movs r2, 0x1 + negs r2, r2 + add r8, r2 + adds r0, r4, 0 + movs r1, 0xA + bl __umodsi3 + adds r0, 0x30 + mov r1, r8 + strb r0, [r1] + adds r0, r4, 0 + movs r1, 0xA + bl sub_80B688C + adds r4, r0, 0 + cmp r4, 0x9 + bhi _080B31EA +_080B320C: + movs r2, 0x1 + negs r2, r2 + add r8, r2 + adds r0, r4, 0 + adds r0, 0x30 + mov r4, r8 + strb r0, [r4] + b _080B323C +_080B321C: + adds r7, r5, 0 + adds r7, 0x8 + movs r1, 0xF +_080B3222: + movs r0, 0x1 + negs r0, r0 + add r8, r0 + adds r0, r4, 0 + ands r0, r1 + ldr r2, [sp, 0x210] + adds r0, r2, r0 + ldrb r0, [r0] + mov r2, r8 + strb r0, [r2] + lsrs r4, 4 + cmp r4, 0 + bne _080B3222 +_080B323C: + add r4, sp, 0x14 + mov r1, r8 + subs r0, r4, r1 + movs r2, 0xD8 + lsls r2, 1 + adds r3, r0, r2 + b _080B3266 +_080B324A: + ldr r4, [sp, 0x1E8] + cmp r4, 0 + bne _080B3252 + b _080B3960 +_080B3252: + add r0, sp, 0x68 + mov r8, r0 + strb r4, [r0] +_080B3258: + movs r3, 0x1 +_080B325A: + ldr r1, _080B3284 + add r1, sp + movs r0, 0 + strb r0, [r1] +_080B3262: + adds r7, r5, 0 + adds r7, 0x8 +_080B3266: + str r3, [sp, 0x20C] + ldr r2, [sp, 0x208] + cmp r3, r2 + bge _080B3270 + str r2, [sp, 0x20C] +_080B3270: + ldr r0, _080B3284 + add r0, sp + ldrb r0, [r0] + cmp r0, 0 + beq _080B3288 + ldr r4, [sp, 0x20C] + adds r4, 0x1 + str r4, [sp, 0x20C] + b _080B3298 + .align 2, 0 +_080B3284: .4byte 0x000001c9 +_080B3288: + movs r0, 0x2 + ldr r1, [sp, 0x1EC] + ands r0, r1 + cmp r0, 0 + beq _080B3298 + ldr r2, [sp, 0x20C] + adds r2, 0x2 + str r2, [sp, 0x20C] +_080B3298: + movs r0, 0x84 + ldr r4, [sp, 0x1EC] + ands r0, r4 + cmp r0, 0 + bne _080B3318 + ldr r0, [sp, 0x1F4] + ldr r1, [sp, 0x20C] + subs r4, r0, r1 + cmp r4, 0 + ble _080B3318 + ldr r1, _080B3344 + cmp r4, 0x10 + ble _080B32EC + mov r6, r9 +_080B32B4: + str r1, [r5] + movs r0, 0x10 + str r0, [r5, 0x4] + ldr r0, [r6, 0x8] + adds r0, 0x10 + str r0, [r6, 0x8] + adds r5, r7, 0 + ldr r0, [r6, 0x4] + adds r0, 0x1 + str r0, [r6, 0x4] + cmp r0, 0x7 + ble _080B32E2 + ldr r0, [sp, 0x1E0] + mov r1, r9 + str r3, [sp, 0x21C] + bl __sprint + ldr r3, [sp, 0x21C] + cmp r0, 0 + beq _080B32DE + b _080B3978 +_080B32DE: + add r5, sp, 0x28 + ldr r1, _080B3344 +_080B32E2: + subs r4, 0x10 + adds r7, r5, 0 + adds r7, 0x8 + cmp r4, 0x10 + bgt _080B32B4 +_080B32EC: + str r1, [r5] + str r4, [r5, 0x4] + mov r2, r9 + ldr r0, [r2, 0x8] + adds r0, r4 + str r0, [r2, 0x8] + adds r5, r7, 0 + ldr r0, [r2, 0x4] + adds r0, 0x1 + str r0, [r2, 0x4] + cmp r0, 0x7 + ble _080B3318 + ldr r0, [sp, 0x1E0] + mov r1, r9 + str r3, [sp, 0x21C] + bl __sprint + ldr r3, [sp, 0x21C] + cmp r0, 0 + beq _080B3316 + b _080B3978 +_080B3316: + add r5, sp, 0x28 +_080B3318: + ldr r1, _080B3348 + add r1, sp + ldrb r0, [r1] + cmp r0, 0 + beq _080B334C + str r1, [r5] + movs r0, 0x1 + str r0, [r5, 0x4] + mov r4, r9 + ldr r0, [r4, 0x8] + adds r0, 0x1 + str r0, [r4, 0x8] + adds r5, 0x8 + ldr r0, [r4, 0x4] + adds r0, 0x1 + str r0, [r4, 0x4] + cmp r0, 0x7 + ble _080B338C + ldr r0, [sp, 0x1E0] + mov r1, r9 + b _080B337C + .align 2, 0 +_080B3344: .4byte gUnknown_826FDE4 +_080B3348: .4byte 0x000001c9 +_080B334C: + movs r2, 0x2 + ldr r0, [sp, 0x1EC] + ands r0, r2 + cmp r0, 0 + beq _080B338C + add r1, sp, 0x1C4 + movs r0, 0x30 + strb r0, [r1] + add r0, sp, 0x1E8 + ldrb r0, [r0] + strb r0, [r1, 0x1] + str r1, [r5] + str r2, [r5, 0x4] + mov r1, r9 + ldr r0, [r1, 0x8] + adds r0, 0x2 + str r0, [r1, 0x8] + adds r5, 0x8 + ldr r0, [r1, 0x4] + adds r0, 0x1 + str r0, [r1, 0x4] + cmp r0, 0x7 + ble _080B338C + ldr r0, [sp, 0x1E0] +_080B337C: + str r3, [sp, 0x21C] + bl __sprint + ldr r3, [sp, 0x21C] + cmp r0, 0 + beq _080B338A + b _080B3978 +_080B338A: + add r5, sp, 0x28 +_080B338C: + movs r0, 0x84 + ldr r2, [sp, 0x1EC] + ands r0, r2 + cmp r0, 0x80 + bne _080B3408 + ldr r0, [sp, 0x1F4] + ldr r1, [sp, 0x20C] + subs r4, r0, r1 + cmp r4, 0 + ble _080B3408 + ldr r1, _080B34A4 + cmp r4, 0x10 + ble _080B33DC + mov r6, r9 +_080B33A8: + str r1, [r5] + movs r0, 0x10 + str r0, [r5, 0x4] + ldr r0, [r6, 0x8] + adds r0, 0x10 + str r0, [r6, 0x8] + adds r5, 0x8 + ldr r0, [r6, 0x4] + adds r0, 0x1 + str r0, [r6, 0x4] + cmp r0, 0x7 + ble _080B33D6 + ldr r0, [sp, 0x1E0] + mov r1, r9 + str r3, [sp, 0x21C] + bl __sprint + ldr r3, [sp, 0x21C] + cmp r0, 0 + beq _080B33D2 + b _080B3978 +_080B33D2: + add r5, sp, 0x28 + ldr r1, _080B34A4 +_080B33D6: + subs r4, 0x10 + cmp r4, 0x10 + bgt _080B33A8 +_080B33DC: + str r1, [r5] + str r4, [r5, 0x4] + mov r2, r9 + ldr r0, [r2, 0x8] + adds r0, r4 + str r0, [r2, 0x8] + adds r5, 0x8 + ldr r0, [r2, 0x4] + adds r0, 0x1 + str r0, [r2, 0x4] + cmp r0, 0x7 + ble _080B3408 + ldr r0, [sp, 0x1E0] + mov r1, r9 + str r3, [sp, 0x21C] + bl __sprint + ldr r3, [sp, 0x21C] + cmp r0, 0 + beq _080B3406 + b _080B3978 +_080B3406: + add r5, sp, 0x28 +_080B3408: + ldr r0, [sp, 0x208] + subs r4, r0, r3 + cmp r4, 0 + ble _080B3476 + ldr r1, _080B34A4 + cmp r4, 0x10 + ble _080B344C + mov r6, r9 +_080B3418: + str r1, [r5] + movs r0, 0x10 + str r0, [r5, 0x4] + ldr r0, [r6, 0x8] + adds r0, 0x10 + str r0, [r6, 0x8] + adds r5, 0x8 + ldr r0, [r6, 0x4] + adds r0, 0x1 + str r0, [r6, 0x4] + cmp r0, 0x7 + ble _080B3446 + ldr r0, [sp, 0x1E0] + mov r1, r9 + str r3, [sp, 0x21C] + bl __sprint + ldr r3, [sp, 0x21C] + cmp r0, 0 + beq _080B3442 + b _080B3978 +_080B3442: + add r5, sp, 0x28 + ldr r1, _080B34A4 +_080B3446: + subs r4, 0x10 + cmp r4, 0x10 + bgt _080B3418 +_080B344C: + str r1, [r5] + str r4, [r5, 0x4] + mov r1, r9 + ldr r0, [r1, 0x8] + adds r0, r4 + str r0, [r1, 0x8] + adds r5, 0x8 + ldr r0, [r1, 0x4] + adds r0, 0x1 + str r0, [r1, 0x4] + cmp r0, 0x7 + ble _080B3476 + ldr r0, [sp, 0x1E0] + str r3, [sp, 0x21C] + bl __sprint + ldr r3, [sp, 0x21C] + cmp r0, 0 + beq _080B3474 + b _080B3978 +_080B3474: + add r5, sp, 0x28 +_080B3476: + movs r0, 0x80 + lsls r0, 1 + ldr r2, [sp, 0x1EC] + ands r0, r2 + cmp r0, 0 + bne _080B34A8 + mov r4, r8 + str r4, [r5] + str r3, [r5, 0x4] + mov r1, r9 + ldr r0, [r1, 0x8] + adds r0, r3 + str r0, [r1, 0x8] + adds r5, 0x8 + ldr r0, [r1, 0x4] + adds r0, 0x1 + str r0, [r1, 0x4] + cmp r0, 0x7 + bgt _080B349E + b _080B38BE +_080B349E: + ldr r0, [sp, 0x1E0] + b _080B38B4 + .align 2, 0 +_080B34A4: .4byte gUnknown_826FDF4 +_080B34A8: + ldr r2, [sp, 0x1E8] + cmp r2, 0x65 + bgt _080B34B0 + b _080B3794 +_080B34B0: + ldr r3, _080B357C + ldr r2, _080B3578 + ldr r0, [sp, 0x1FC] + ldr r1, [sp, 0x200] + bl __eqdf2 + cmp r0, 0 + bne _080B3588 + ldr r0, _080B3580 + str r0, [r5] + movs r6, 0x1 + str r6, [r5, 0x4] + mov r4, r9 + ldr r0, [r4, 0x8] + adds r0, 0x1 + str r0, [r4, 0x8] + adds r5, 0x8 + ldr r0, [r4, 0x4] + adds r0, 0x1 + str r0, [r4, 0x4] + cmp r0, 0x7 + ble _080B34EC + ldr r0, [sp, 0x1E0] + mov r1, r9 + bl __sprint + cmp r0, 0 + beq _080B34EA + b _080B3978 +_080B34EA: + add r5, sp, 0x28 +_080B34EC: + add r0, sp, 0x1D4 + ldr r1, [r0] + add r4, sp, 0x1D8 + ldr r0, [r4] + cmp r1, r0 + blt _080B3502 + ldr r0, [sp, 0x1EC] + ands r0, r6 + cmp r0, 0 + bne _080B3502 + b _080B38BE +_080B3502: + ldr r0, [sp, 0x1F8] + str r0, [r5] + str r6, [r5, 0x4] + mov r1, r9 + ldr r0, [r1, 0x8] + adds r0, 0x1 + str r0, [r1, 0x8] + adds r5, 0x8 + ldr r0, [r1, 0x4] + adds r0, 0x1 + str r0, [r1, 0x4] + cmp r0, 0x7 + ble _080B352A + ldr r0, [sp, 0x1E0] + bl __sprint + cmp r0, 0 + beq _080B3528 + b _080B3978 +_080B3528: + add r5, sp, 0x28 +_080B352A: + ldr r0, [r4] + subs r4, r0, 0x1 + cmp r4, 0 + bgt _080B3534 + b _080B38BE +_080B3534: + ldr r1, _080B3584 + cmp r4, 0x10 + ble _080B356C + mov r6, r9 +_080B353C: + str r1, [r5] + movs r0, 0x10 + str r0, [r5, 0x4] + ldr r0, [r6, 0x8] + adds r0, 0x10 + str r0, [r6, 0x8] + adds r5, 0x8 + ldr r0, [r6, 0x4] + adds r0, 0x1 + str r0, [r6, 0x4] + cmp r0, 0x7 + ble _080B3566 + ldr r0, [sp, 0x1E0] + mov r1, r9 + bl __sprint + cmp r0, 0 + beq _080B3562 + b _080B3978 +_080B3562: + add r5, sp, 0x28 + ldr r1, _080B3584 +_080B3566: + subs r4, 0x10 + cmp r4, 0x10 + bgt _080B353C +_080B356C: + str r1, [r5] + str r4, [r5, 0x4] + mov r2, r9 + ldr r0, [r2, 0x8] + adds r0, r4 + b _080B38A2 + .align 2, 0 +_080B3578: .4byte 0x00000000 +_080B357C: .4byte 0x00000000 +_080B3580: .4byte gUnknown_826FE58 +_080B3584: .4byte gUnknown_826FDF4 +_080B3588: + add r6, sp, 0x1D4 + ldr r2, [r6] + cmp r2, 0 + bgt _080B3670 + ldr r0, _080B3668 + str r0, [r5] + movs r4, 0x1 + str r4, [r5, 0x4] + mov r1, r9 + ldr r0, [r1, 0x8] + adds r0, 0x1 + str r0, [r1, 0x8] + adds r5, 0x8 + ldr r0, [r1, 0x4] + adds r0, 0x1 + str r0, [r1, 0x4] + cmp r0, 0x7 + ble _080B35BA + ldr r0, [sp, 0x1E0] + bl __sprint + cmp r0, 0 + beq _080B35B8 + b _080B3978 +_080B35B8: + add r5, sp, 0x28 +_080B35BA: + ldr r2, [sp, 0x1F8] + str r2, [r5] + str r4, [r5, 0x4] + mov r4, r9 + ldr r0, [r4, 0x8] + adds r0, 0x1 + str r0, [r4, 0x8] + adds r5, 0x8 + ldr r0, [r4, 0x4] + adds r0, 0x1 + str r0, [r4, 0x4] + cmp r0, 0x7 + ble _080B35E4 + ldr r0, [sp, 0x1E0] + mov r1, r9 + bl __sprint + cmp r0, 0 + beq _080B35E2 + b _080B3978 +_080B35E2: + add r5, sp, 0x28 +_080B35E4: + ldr r0, [r6] + negs r4, r0 + cmp r4, 0 + ble _080B364A + ldr r1, _080B366C + cmp r4, 0x10 + ble _080B3624 + mov r6, r9 +_080B35F4: + str r1, [r5] + movs r0, 0x10 + str r0, [r5, 0x4] + ldr r0, [r6, 0x8] + adds r0, 0x10 + str r0, [r6, 0x8] + adds r5, 0x8 + ldr r0, [r6, 0x4] + adds r0, 0x1 + str r0, [r6, 0x4] + cmp r0, 0x7 + ble _080B361E + ldr r0, [sp, 0x1E0] + mov r1, r9 + bl __sprint + cmp r0, 0 + beq _080B361A + b _080B3978 +_080B361A: + add r5, sp, 0x28 + ldr r1, _080B366C +_080B361E: + subs r4, 0x10 + cmp r4, 0x10 + bgt _080B35F4 +_080B3624: + str r1, [r5] + str r4, [r5, 0x4] + mov r1, r9 + ldr r0, [r1, 0x8] + adds r0, r4 + str r0, [r1, 0x8] + adds r5, 0x8 + ldr r0, [r1, 0x4] + adds r0, 0x1 + str r0, [r1, 0x4] + cmp r0, 0x7 + ble _080B364A + ldr r0, [sp, 0x1E0] + bl __sprint + cmp r0, 0 + beq _080B3648 + b _080B3978 +_080B3648: + add r5, sp, 0x28 +_080B364A: + mov r2, r8 + str r2, [r5] + add r0, sp, 0x1D8 + ldr r1, [r0] + str r1, [r5, 0x4] + mov r4, r9 + ldr r0, [r4, 0x8] + adds r0, r1 + str r0, [r4, 0x8] + adds r5, 0x8 + ldr r0, [r4, 0x4] + adds r0, 0x1 + str r0, [r4, 0x4] + b _080B38AC + .align 2, 0 +_080B3668: .4byte gUnknown_826FE58 +_080B366C: .4byte gUnknown_826FDF4 +_080B3670: + add r4, sp, 0x1D8 + ldr r1, [r4] + cmp r2, r1 + blt _080B372C + mov r0, r8 + str r0, [r5] + str r1, [r5, 0x4] + mov r2, r9 + ldr r0, [r2, 0x8] + adds r0, r1 + str r0, [r2, 0x8] + adds r5, 0x8 + ldr r0, [r2, 0x4] + adds r0, 0x1 + str r0, [r2, 0x4] + cmp r0, 0x7 + ble _080B36A2 + ldr r0, [sp, 0x1E0] + mov r1, r9 + bl __sprint + cmp r0, 0 + beq _080B36A0 + b _080B3978 +_080B36A0: + add r5, sp, 0x28 +_080B36A2: + ldr r1, [r6] + ldr r0, [r4] + subs r4, r1, r0 + cmp r4, 0 + ble _080B370A + ldr r1, _080B3724 + cmp r4, 0x10 + ble _080B36E4 + mov r6, r9 +_080B36B4: + str r1, [r5] + movs r0, 0x10 + str r0, [r5, 0x4] + ldr r0, [r6, 0x8] + adds r0, 0x10 + str r0, [r6, 0x8] + adds r5, 0x8 + ldr r0, [r6, 0x4] + adds r0, 0x1 + str r0, [r6, 0x4] + cmp r0, 0x7 + ble _080B36DE + ldr r0, [sp, 0x1E0] + mov r1, r9 + bl __sprint + cmp r0, 0 + beq _080B36DA + b _080B3978 +_080B36DA: + add r5, sp, 0x28 + ldr r1, _080B3724 +_080B36DE: + subs r4, 0x10 + cmp r4, 0x10 + bgt _080B36B4 +_080B36E4: + str r1, [r5] + str r4, [r5, 0x4] + mov r1, r9 + ldr r0, [r1, 0x8] + adds r0, r4 + str r0, [r1, 0x8] + adds r5, 0x8 + ldr r0, [r1, 0x4] + adds r0, 0x1 + str r0, [r1, 0x4] + cmp r0, 0x7 + ble _080B370A + ldr r0, [sp, 0x1E0] + bl __sprint + cmp r0, 0 + beq _080B3708 + b _080B3978 +_080B3708: + add r5, sp, 0x28 +_080B370A: + movs r1, 0x1 + ldr r0, [sp, 0x1EC] + ands r0, r1 + cmp r0, 0 + bne _080B3716 + b _080B38BE +_080B3716: + ldr r0, _080B3728 + str r0, [r5] + str r1, [r5, 0x4] + mov r2, r9 + ldr r0, [r2, 0x8] + adds r0, 0x1 + b _080B38A2 + .align 2, 0 +_080B3724: .4byte gUnknown_826FDF4 +_080B3728: .4byte gUnknown_826FE5C +_080B372C: + mov r0, r8 + str r0, [r5] + str r2, [r5, 0x4] + mov r1, r9 + ldr r0, [r1, 0x8] + adds r0, r2 + str r0, [r1, 0x8] + adds r5, 0x8 + ldr r0, [r1, 0x4] + adds r0, 0x1 + str r0, [r1, 0x4] + cmp r0, 0x7 + ble _080B3754 + ldr r0, [sp, 0x1E0] + bl __sprint + cmp r0, 0 + beq _080B3752 + b _080B3978 +_080B3752: + add r5, sp, 0x28 +_080B3754: + ldr r0, [r6] + add r8, r0 + ldr r0, _080B3790 + str r0, [r5] + movs r0, 0x1 + str r0, [r5, 0x4] + mov r2, r9 + ldr r0, [r2, 0x8] + adds r0, 0x1 + str r0, [r2, 0x8] + adds r5, 0x8 + ldr r0, [r2, 0x4] + adds r0, 0x1 + str r0, [r2, 0x4] + cmp r0, 0x7 + ble _080B3784 + ldr r0, [sp, 0x1E0] + mov r1, r9 + bl __sprint + cmp r0, 0 + beq _080B3782 + b _080B3978 +_080B3782: + add r5, sp, 0x28 +_080B3784: + mov r0, r8 + str r0, [r5] + ldr r1, [r4] + ldr r0, [r6] + subs r1, r0 + b _080B389A + .align 2, 0 +_080B3790: .4byte gUnknown_826FE5C +_080B3794: + add r4, sp, 0x1D8 + ldr r0, [r4] + cmp r0, 0x1 + bgt _080B37A6 + movs r1, 0x1 + ldr r0, [sp, 0x1EC] + ands r0, r1 + cmp r0, 0 + beq _080B386C +_080B37A6: + add r1, sp, 0x1C4 + mov r2, r8 + ldrb r0, [r2] + strb r0, [r1] + movs r0, 0x1 + add r8, r0 + movs r0, 0x2E + strb r0, [r1, 0x1] + str r1, [r5] + movs r0, 0x2 + str r0, [r5, 0x4] + mov r1, r9 + ldr r0, [r1, 0x8] + adds r0, 0x2 + str r0, [r1, 0x8] + adds r5, 0x8 + ldr r0, [r1, 0x4] + adds r0, 0x1 + str r0, [r1, 0x4] + cmp r0, 0x7 + ble _080B37DE + ldr r0, [sp, 0x1E0] + bl __sprint + cmp r0, 0 + beq _080B37DC + b _080B3978 +_080B37DC: + add r5, sp, 0x28 +_080B37DE: + ldr r3, _080B3808 + ldr r2, _080B3804 + ldr r0, [sp, 0x1FC] + ldr r1, [sp, 0x200] + bl __nedf2 + cmp r0, 0 + beq _080B380C + mov r2, r8 + str r2, [r5] + ldr r1, [r4] + subs r0, r1, 0x1 + str r0, [r5, 0x4] + mov r4, r9 + ldr r0, [r4, 0x8] + subs r0, 0x1 + adds r0, r1 + b _080B3878 + .align 2, 0 +_080B3804: .4byte 0x00000000 +_080B3808: .4byte 0x00000000 +_080B380C: + ldr r0, [r4] + subs r4, r0, 0x1 + cmp r4, 0 + ble _080B3894 + ldr r1, _080B3868 + cmp r4, 0x10 + ble _080B384C + mov r6, r9 +_080B381C: + str r1, [r5] + movs r0, 0x10 + str r0, [r5, 0x4] + ldr r0, [r6, 0x8] + adds r0, 0x10 + str r0, [r6, 0x8] + adds r5, 0x8 + ldr r0, [r6, 0x4] + adds r0, 0x1 + str r0, [r6, 0x4] + cmp r0, 0x7 + ble _080B3846 + ldr r0, [sp, 0x1E0] + mov r1, r9 + bl __sprint + cmp r0, 0 + beq _080B3842 + b _080B3978 +_080B3842: + add r5, sp, 0x28 + ldr r1, _080B3868 +_080B3846: + subs r4, 0x10 + cmp r4, 0x10 + bgt _080B381C +_080B384C: + str r1, [r5] + str r4, [r5, 0x4] + mov r1, r9 + ldr r0, [r1, 0x8] + adds r0, r4 + str r0, [r1, 0x8] + adds r5, 0x8 + ldr r0, [r1, 0x4] + adds r0, 0x1 + str r0, [r1, 0x4] + cmp r0, 0x7 + ble _080B3894 + ldr r0, [sp, 0x1E0] + b _080B388A + .align 2, 0 +_080B3868: .4byte gUnknown_826FDF4 +_080B386C: + mov r2, r8 + str r2, [r5] + str r1, [r5, 0x4] + mov r4, r9 + ldr r0, [r4, 0x8] + adds r0, 0x1 +_080B3878: + str r0, [r4, 0x8] + adds r5, 0x8 + ldr r0, [r4, 0x4] + adds r0, 0x1 + str r0, [r4, 0x4] + cmp r0, 0x7 + ble _080B3894 + ldr r0, [sp, 0x1E0] + mov r1, r9 +_080B388A: + bl __sprint + cmp r0, 0 + bne _080B3978 + add r5, sp, 0x28 +_080B3894: + add r0, sp, 0x14 + str r0, [r5] + ldr r1, [sp, 0x204] +_080B389A: + str r1, [r5, 0x4] + mov r2, r9 + ldr r0, [r2, 0x8] + adds r0, r1 +_080B38A2: + str r0, [r2, 0x8] + adds r5, 0x8 + ldr r0, [r2, 0x4] + adds r0, 0x1 + str r0, [r2, 0x4] +_080B38AC: + cmp r0, 0x7 + ble _080B38BE + ldr r0, [sp, 0x1E0] + mov r1, r9 +_080B38B4: + bl __sprint + cmp r0, 0 + bne _080B3978 + add r5, sp, 0x28 +_080B38BE: + movs r0, 0x4 + ldr r4, [sp, 0x1EC] + ands r4, r0 + cmp r4, 0 + beq _080B392A + ldr r0, [sp, 0x1F4] + ldr r1, [sp, 0x20C] + subs r4, r0, r1 + cmp r4, 0 + ble _080B392A + ldr r1, _080B395C + cmp r4, 0x10 + ble _080B3908 + mov r6, r9 +_080B38DA: + str r1, [r5] + movs r0, 0x10 + str r0, [r5, 0x4] + ldr r0, [r6, 0x8] + adds r0, 0x10 + str r0, [r6, 0x8] + adds r5, 0x8 + ldr r0, [r6, 0x4] + adds r0, 0x1 + str r0, [r6, 0x4] + cmp r0, 0x7 + ble _080B3902 + ldr r0, [sp, 0x1E0] + mov r1, r9 + bl __sprint + cmp r0, 0 + bne _080B3978 + add r5, sp, 0x28 + ldr r1, _080B395C +_080B3902: + subs r4, 0x10 + cmp r4, 0x10 + bgt _080B38DA +_080B3908: + str r1, [r5] + str r4, [r5, 0x4] + mov r2, r9 + ldr r0, [r2, 0x8] + adds r0, r4 + str r0, [r2, 0x8] + ldr r0, [r2, 0x4] + adds r0, 0x1 + str r0, [r2, 0x4] + cmp r0, 0x7 + ble _080B392A + ldr r0, [sp, 0x1E0] + mov r1, r9 + bl __sprint + cmp r0, 0 + bne _080B3978 +_080B392A: + ldr r0, [sp, 0x20C] + ldr r4, [sp, 0x1F4] + cmp r0, r4 + bge _080B3934 + adds r0, r4, 0 +_080B3934: + ldr r1, [sp, 0x1F0] + adds r1, r0 + str r1, [sp, 0x1F0] + mov r2, r9 + ldr r0, [r2, 0x8] + cmp r0, 0 + beq _080B394E + ldr r0, [sp, 0x1E0] + mov r1, r9 + bl __sprint + cmp r0, 0 + bne _080B3978 +_080B394E: + movs r0, 0 + mov r4, r9 + str r0, [r4, 0x4] + add r5, sp, 0x28 + bl _080B2AF4 + .align 2, 0 +_080B395C: .4byte gUnknown_826FDE4 +_080B3960: + mov r1, r9 + ldr r0, [r1, 0x8] + cmp r0, 0 + beq _080B3972 + ldr r0, [sp, 0x1E0] + bl __sprint + cmp r0, 0 + bne _080B3978 +_080B3972: + movs r0, 0 + mov r1, r9 + str r0, [r1, 0x4] +_080B3978: + movs r0, 0x40 + ldr r2, [sp, 0x1E0] + ldrh r2, [r2, 0xC] + ands r0, r2 + movs r1, 0x1 + negs r1, r1 + cmp r0, 0 + bne _080B398A + ldr r1, [sp, 0x1F0] +_080B398A: + adds r0, r1, 0 +_080B398C: + movs r3, 0x88 + lsls r3, 2 + add sp, r3 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7,pc} + thumb_func_end _vfprintf_r + + thumb_func_start sub_80B399C +sub_80B399C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + str r0, [sp, 0x18] + adds r5, r2, 0 + adds r4, r1, 0 + mov r8, r3 + ldr r6, [sp, 0x3C] + ldr r0, [sp, 0x44] + mov r10, r0 + ldr r1, [sp, 0x48] + mov r9, r1 + cmp r1, 0x66 + bne _080B39C2 + movs r7, 0x3 + b _080B39D2 +_080B39C2: + mov r0, r9 + cmp r0, 0x65 + beq _080B39CC + cmp r0, 0x45 + bne _080B39D0 +_080B39CC: + movs r1, 0x1 + add r8, r1 +_080B39D0: + movs r7, 0x2 +_080B39D2: + lsls r0, r4, 31 + lsrs r0, 31 + cmp r0, 0 + beq _080B39E8 + adds r1, r5, 0 + adds r0, r4, 0 + bl __negdf2 + adds r5, r1, 0 + adds r4, r0, 0 + movs r0, 0x2D +_080B39E8: + ldr r1, [sp, 0x40] + strb r0, [r1] + mov r0, r8 + str r0, [sp] + mov r1, r10 + str r1, [sp, 0x4] + add r0, sp, 0x10 + str r0, [sp, 0x8] + add r0, sp, 0x14 + str r0, [sp, 0xC] + ldr r0, [sp, 0x18] + adds r2, r5, 0 + adds r1, r4, 0 + adds r3, r7, 0 + bl sub_80B3D3C + adds r7, r0, 0 + mov r1, r9 + cmp r1, 0x67 + beq _080B3A14 + cmp r1, 0x47 + bne _080B3A1C +_080B3A14: + movs r0, 0x1 + ands r6, r0 + cmp r6, 0 + beq _080B3A70 +_080B3A1C: + mov r0, r8 + adds r6, r7, r0 + mov r1, r9 + cmp r1, 0x66 + bne _080B3A4C + ldrb r0, [r7] + cmp r0, 0x30 + bne _080B3A46 + ldr r3, _080B3A8C + ldr r2, _080B3A88 + adds r1, r5, 0 + adds r0, r4, 0 + bl __nedf2 + cmp r0, 0 + beq _080B3A46 + mov r1, r8 + negs r0, r1 + adds r0, 0x1 + mov r1, r10 + str r0, [r1] +_080B3A46: + mov r1, r10 + ldr r0, [r1] + adds r6, r0 +_080B3A4C: + ldr r3, _080B3A8C + ldr r2, _080B3A88 + adds r1, r5, 0 + adds r0, r4, 0 + bl __eqdf2 + cmp r0, 0 + bne _080B3A5E + str r6, [sp, 0x14] +_080B3A5E: + ldr r0, [sp, 0x14] + cmp r0, r6 + bcs _080B3A70 + movs r1, 0x30 +_080B3A66: + strb r1, [r0] + adds r0, 0x1 + str r0, [sp, 0x14] + cmp r0, r6 + bcc _080B3A66 +_080B3A70: + ldr r0, [sp, 0x14] + subs r0, r7 + ldr r1, [sp, 0x4C] + str r0, [r1] + adds r0, r7, 0 + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7,pc} + .align 2, 0 +_080B3A88: .4byte 0x00000000 +_080B3A8C: .4byte 0x00000000 + thumb_func_end sub_80B399C + + thumb_func_start sub_80B3A90 +sub_80B3A90: + push {r4-r7,lr} + sub sp, 0x134 + adds r7, r0, 0 + adds r6, r1, 0 + strb r2, [r7] + adds r5, r7, 0x1 + cmp r6, 0 + bge _080B3AA6 + negs r6, r6 + movs r0, 0x2D + b _080B3AA8 +_080B3AA6: + movs r0, 0x2B +_080B3AA8: + strb r0, [r7, 0x1] + adds r5, 0x1 + add r4, sp, 0x134 + cmp r6, 0x9 + ble _080B3AEA +_080B3AB2: + subs r4, 0x1 + adds r0, r6, 0 + movs r1, 0xA + bl __modsi3 + adds r0, 0x30 + strb r0, [r4] + adds r0, r6, 0 + movs r1, 0xA + bl __divsi3 + adds r6, r0, 0 + cmp r6, 0x9 + bgt _080B3AB2 + subs r4, 0x1 + adds r0, 0x30 + strb r0, [r4] + add r0, sp, 0x134 + cmp r4, r0 + bcs _080B3AF8 + adds r1, r0, 0 +_080B3ADC: + ldrb r0, [r4] + strb r0, [r5] + adds r4, 0x1 + adds r5, 0x1 + cmp r4, r1 + bcc _080B3ADC + b _080B3AF8 +_080B3AEA: + movs r0, 0x30 + strb r0, [r5] + adds r5, 0x1 + adds r0, r6, 0 + adds r0, 0x30 + strb r0, [r5] + adds r5, 0x1 +_080B3AF8: + subs r0, r5, r7 + add sp, 0x134 + pop {r4-r7,pc} + thumb_func_end sub_80B3A90 + + thumb_func_start vsprintf +vsprintf: + push {r4,r5,lr} + sub sp, 0x58 + mov r4, sp + movs r5, 0 + movs r3, 0x82 + lsls r3, 2 + strh r3, [r4, 0xC] + str r0, [sp] + str r0, [sp, 0x10] + ldr r0, _080B3B2C + str r0, [sp, 0x8] + str r0, [sp, 0x14] + ldr r0, _080B3B30 + ldr r0, [r0] + str r0, [sp, 0x54] + mov r0, sp + bl vfprintf + ldr r1, [sp] + strb r5, [r1] + add sp, 0x58 + pop {r4,r5,pc} + .align 2, 0 +_080B3B2C: .4byte 0x7fffffff +_080B3B30: .4byte gUnknown_203B7A8 + thumb_func_end vsprintf + + thumb_func_start sub_80B3B34 +sub_80B3B34: + push {r4,r5,lr} + adds r4, r0, 0 + ldr r0, [r4, 0x54] + cmp r0, 0 + bne _080B3B44 + ldr r0, _080B3B70 + ldr r0, [r0] + str r0, [r4, 0x54] +_080B3B44: + ldr r1, [r4, 0x54] + ldr r0, [r1, 0x38] + cmp r0, 0 + bne _080B3B52 + adds r0, r1, 0 + bl sub_80B4BC4 +_080B3B52: + ldrh r1, [r4, 0xC] + movs r0, 0x8 + ands r0, r1 + lsls r0, 16 + asrs r5, r0, 16 + cmp r5, 0 + bne _080B3BAC + movs r0, 0x10 + ands r0, r1 + cmp r0, 0 + bne _080B3B74 + movs r0, 0x1 + negs r0, r0 + b _080B3BDE + .align 2, 0 +_080B3B70: .4byte gUnknown_203B7A8 +_080B3B74: + movs r0, 0x4 + ands r0, r1 + cmp r0, 0 + beq _080B3BA4 + ldr r1, [r4, 0x30] + cmp r1, 0 + beq _080B3B92 + adds r0, r4, 0 + adds r0, 0x40 + cmp r1, r0 + beq _080B3B90 + ldr r0, [r4, 0x54] + bl _free_r +_080B3B90: + str r5, [r4, 0x30] +_080B3B92: + movs r0, 0x25 + negs r0, r0 + ldrh r1, [r4, 0xC] + ands r0, r1 + movs r1, 0 + strh r0, [r4, 0xC] + str r1, [r4, 0x4] + ldr r0, [r4, 0x10] + str r0, [r4] +_080B3BA4: + movs r0, 0x8 + ldrh r1, [r4, 0xC] + orrs r0, r1 + strh r0, [r4, 0xC] +_080B3BAC: + ldr r0, [r4, 0x10] + cmp r0, 0 + bne _080B3BB8 + adds r0, r4, 0 + bl sub_80B517C +_080B3BB8: + ldrh r1, [r4, 0xC] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080B3BCE + movs r0, 0 + str r0, [r4, 0x8] + ldr r0, [r4, 0x14] + negs r0, r0 + str r0, [r4, 0x18] + b _080B3BDC +_080B3BCE: + movs r0, 0x2 + ands r0, r1 + movs r1, 0 + cmp r0, 0 + bne _080B3BDA + ldr r1, [r4, 0x14] +_080B3BDA: + str r1, [r4, 0x8] +_080B3BDC: + movs r0, 0 +_080B3BDE: + pop {r4,r5,pc} + thumb_func_end sub_80B3B34 + + thumb_func_start sub_80B3BE0 +sub_80B3BE0: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x18 + str r0, [sp] + str r1, [sp, 0x4] + ldr r7, [r1, 0x10] + ldr r0, [r0, 0x10] + cmp r0, r7 + bge _080B3BFC + movs r0, 0 + b _080B3D30 +_080B3BFC: + ldr r0, [sp, 0x4] + adds r0, 0x14 + mov r8, r0 + subs r7, 0x1 + lsls r0, r7, 2 + mov r1, r8 + adds r1, r0 + str r1, [sp, 0xC] + ldr r4, [sp] + adds r4, 0x14 + adds r5, r4, r0 + ldr r1, [r1] + adds r1, 0x1 + ldr r2, [r5] + mov r10, r2 + mov r0, r10 + bl sub_80B688C + str r0, [sp, 0x8] + mov r3, r8 + str r3, [sp, 0x14] + str r4, [sp, 0x10] + cmp r0, 0 + beq _080B3CA6 + movs r6, 0 + mov r9, r6 + ldr r0, _080B3C90 + mov r12, r0 +_080B3C34: + mov r2, r8 + adds r2, 0x4 + mov r8, r2 + subs r2, 0x4 + ldm r2!, {r1} + adds r0, r1, 0 + mov r3, r12 + ands r0, r3 + ldr r2, [sp, 0x8] + muls r0, r2 + mov r3, r9 + adds r2, r0, r3 + lsrs r0, r1, 16 + ldr r3, [sp, 0x8] + adds r1, r0, 0 + muls r1, r3 + lsrs r0, r2, 16 + adds r3, r1, r0 + lsrs r0, r3, 16 + mov r9, r0 + ldr r0, [r4] + mov r1, r12 + ands r0, r1 + ands r2, r1 + subs r0, r2 + adds r2, r0, r6 + asrs r6, r2, 16 + ldr r0, [r4] + lsrs r1, r0, 16 + mov r0, r12 + ands r3, r0 + subs r1, r3 + adds r0, r1, r6 + asrs r6, r0, 16 + strh r0, [r4] + strh r2, [r4, 0x2] + adds r4, 0x4 + ldr r1, [sp, 0xC] + cmp r8, r1 + bls _080B3C34 + mov r2, r10 + cmp r2, 0 + bne _080B3CA6 + ldr r4, [sp, 0x10] + b _080B3C96 + .align 2, 0 +_080B3C90: .4byte 0x0000ffff +_080B3C94: + subs r7, 0x1 +_080B3C96: + subs r5, 0x4 + cmp r5, r4 + bls _080B3CA2 + ldr r0, [r5] + cmp r0, 0 + beq _080B3C94 +_080B3CA2: + ldr r3, [sp] + str r7, [r3, 0x10] +_080B3CA6: + ldr r0, [sp] + ldr r1, [sp, 0x4] + bl sub_80B5DD0 + cmp r0, 0 + blt _080B3D2E + ldr r0, [sp, 0x8] + adds r0, 0x1 + str r0, [sp, 0x8] + movs r6, 0 + mov r9, r6 + ldr r4, [sp, 0x10] + ldr r1, [sp, 0x14] + mov r8, r1 + lsls r2, r7, 2 + mov r10, r2 + ldr r5, _080B3D18 +_080B3CC8: + mov r3, r8 + adds r3, 0x4 + mov r8, r3 + subs r3, 0x4 + ldm r3!, {r1} + adds r0, r1, 0 + ands r0, r5 + mov r3, r9 + adds r2, r0, r3 + lsrs r1, 16 + lsrs r0, r2, 16 + adds r3, r1, r0 + lsrs r0, r3, 16 + mov r9, r0 + ldr r1, [r4] + adds r0, r1, 0 + ands r0, r5 + ands r2, r5 + subs r0, r2 + adds r2, r0, r6 + asrs r6, r2, 16 + lsrs r1, 16 + ands r3, r5 + subs r1, r3 + adds r0, r1, r6 + asrs r6, r0, 16 + strh r0, [r4] + strh r2, [r4, 0x2] + adds r4, 0x4 + ldr r1, [sp, 0xC] + cmp r8, r1 + bls _080B3CC8 + ldr r4, [sp, 0x10] + mov r2, r10 + adds r5, r4, r2 + ldr r0, [r5] + cmp r0, 0 + bne _080B3D2E + b _080B3D1E + .align 2, 0 +_080B3D18: .4byte 0x0000ffff +_080B3D1C: + subs r7, 0x1 +_080B3D1E: + subs r5, 0x4 + cmp r5, r4 + bls _080B3D2A + ldr r0, [r5] + cmp r0, 0 + beq _080B3D1C +_080B3D2A: + ldr r3, [sp] + str r7, [r3, 0x10] +_080B3D2E: + ldr r0, [sp, 0x8] +_080B3D30: + add sp, 0x18 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7,pc} + thumb_func_end sub_80B3BE0 + + thumb_func_start sub_80B3D3C +sub_80B3D3C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x84 + mov r10, r0 + str r3, [sp, 0xC] + ldr r4, [sp, 0xAC] + str r1, [sp, 0x40] + str r2, [sp, 0x44] + ldr r2, [r0, 0x40] + cmp r2, 0 + beq _080B3D74 + ldr r0, [r0, 0x44] + str r0, [r2, 0x4] + mov r0, r10 + ldr r1, [r0, 0x44] + movs r0, 0x1 + lsls r0, r1 + str r0, [r2, 0x8] + mov r0, r10 + adds r1, r2, 0 + bl sub_80B5908 + movs r0, 0 + mov r1, r10 + str r0, [r1, 0x40] +_080B3D74: + movs r0, 0x80 + lsls r0, 24 + ldr r1, [sp, 0x40] + ands r0, r1 + cmp r0, 0 + beq _080B3D90 + movs r0, 0x1 + str r0, [r4] + ldr r0, _080B3D8C + ands r1, r0 + str r1, [sp, 0x40] + b _080B3D92 + .align 2, 0 +_080B3D8C: .4byte 0x7fffffff +_080B3D90: + str r0, [r4] +_080B3D92: + ldr r1, _080B3DD4 + ldr r2, [sp, 0x40] + adds r0, r2, 0 + ands r0, r1 + cmp r0, r1 + bne _080B3DE8 + ldr r0, _080B3DD8 + ldr r3, [sp, 0xA8] + str r0, [r3] + ldr r0, _080B3DDC + mov r9, r0 + ldr r1, [sp, 0x44] + cmp r1, 0 + bne _080B3DBA + ldr r0, _080B3DE0 + ands r2, r0 + cmp r2, 0 + bne _080B3DBA + ldr r2, _080B3DE4 + mov r9, r2 +_080B3DBA: + ldr r3, [sp, 0xB0] + cmp r3, 0 + beq _080B3E0C + mov r1, r9 + ldrb r0, [r1, 0x3] + adds r1, 0x3 + cmp r0, 0 + beq _080B3DCC + adds r1, 0x5 +_080B3DCC: + ldr r2, [sp, 0xB0] + str r1, [r2] + b _080B3E0C + .align 2, 0 +_080B3DD4: .4byte 0x7ff00000 +_080B3DD8: .4byte 0x0000270f +_080B3DDC: .4byte gUnknown_826FE6C +_080B3DE0: .4byte 0x000fffff +_080B3DE4: .4byte gUnknown_826FE60 +_080B3DE8: + ldr r3, _080B3E18 + ldr r2, _080B3E14 + ldr r0, [sp, 0x40] + ldr r1, [sp, 0x44] + bl __eqdf2 + cmp r0, 0 + bne _080B3E20 + movs r0, 0x1 + ldr r3, [sp, 0xA8] + str r0, [r3] + ldr r0, _080B3E1C + mov r9, r0 + ldr r1, [sp, 0xB0] + cmp r1, 0 + beq _080B3E0C + adds r0, 0x1 + str r0, [r1] +_080B3E0C: + mov r0, r9 + bl _080B4A26 + .align 2, 0 +_080B3E14: .4byte 0x00000000 +_080B3E18: .4byte 0x00000000 +_080B3E1C: .4byte gUnknown_826FE70 +_080B3E20: + add r0, sp, 0x8 + str r0, [sp] + mov r0, r10 + ldr r1, [sp, 0x40] + ldr r2, [sp, 0x44] + add r3, sp, 0x4 + bl sub_80B6008 + str r0, [sp, 0x5C] + ldr r2, [sp, 0x40] + lsls r0, r2, 1 + lsrs r0, 21 + mov r8, r0 + cmp r0, 0 + beq _080B3E70 + ldr r0, [sp, 0x40] + ldr r1, [sp, 0x44] + str r0, [sp, 0x48] + str r1, [sp, 0x4C] + ldr r0, _080B3E64 + ldr r1, [sp, 0x48] + ands r1, r0 + str r1, [sp, 0x48] + ldr r0, _080B3E68 + adds r2, r1, 0 + orrs r2, r0 + str r2, [sp, 0x48] + ldr r3, _080B3E6C + add r8, r3 + movs r0, 0 + str r0, [sp, 0x58] + ldr r6, [sp, 0x8] + b _080B3ED0 + .align 2, 0 +_080B3E64: .4byte 0x000fffff +_080B3E68: .4byte 0x3ff00000 +_080B3E6C: .4byte 0xfffffc01 +_080B3E70: + ldr r1, [sp, 0x8] + ldr r0, [sp, 0x4] + adds r2, r1, r0 + ldr r3, _080B3E98 + adds r3, r2 + mov r8, r3 + adds r6, r1, 0 + cmp r3, 0x20 + ble _080B3EA0 + movs r0, 0x40 + subs r0, r3 + ldr r4, [sp, 0x40] + lsls r4, r0 + ldr r1, _080B3E9C + adds r0, r2, r1 + ldr r2, [sp, 0x44] + lsrs r2, r0 + adds r0, r2, 0 + orrs r4, r0 + b _080B3EAA + .align 2, 0 +_080B3E98: .4byte 0x00000432 +_080B3E9C: .4byte 0x00000412 +_080B3EA0: + movs r0, 0x20 + mov r3, r8 + subs r0, r3 + ldr r4, [sp, 0x44] + lsls r4, r0 +_080B3EAA: + adds r0, r4, 0 + bl __floatsidf + cmp r4, 0 + bge _080B3EBC + ldr r3, _080B3F80 + ldr r2, _080B3F7C + bl __adddf3 +_080B3EBC: + str r0, [sp, 0x48] + str r1, [sp, 0x4C] + ldr r1, _080B3F84 + ldr r0, [sp, 0x48] + adds r1, r0, r1 + str r1, [sp, 0x48] + ldr r2, _080B3F88 + add r8, r2 + movs r3, 0x1 + str r3, [sp, 0x58] +_080B3ED0: + ldr r2, _080B3F8C + ldr r3, _080B3F90 + ldr r0, [sp, 0x48] + ldr r1, [sp, 0x4C] + bl __subdf3 + ldr r2, _080B3F94 + ldr r3, _080B3F98 + bl __muldf3 + ldr r2, _080B3F9C + ldr r3, _080B3FA0 + bl __adddf3 + adds r5, r1, 0 + adds r4, r0, 0 + mov r0, r8 + bl __floatsidf + ldr r2, _080B3FA4 + ldr r3, _080B3FA8 + bl __muldf3 + adds r3, r1, 0 + adds r2, r0, 0 + adds r1, r5, 0 + adds r0, r4, 0 + bl __adddf3 + str r0, [sp, 0x6C] + str r1, [sp, 0x70] + bl __fixdfsi + str r0, [sp, 0x24] + ldr r2, _080B3FAC + ldr r3, _080B3FB0 + ldr r0, [sp, 0x6C] + ldr r1, [sp, 0x70] + bl __ltdf2 + cmp r0, 0 + bge _080B3F40 + ldr r0, [sp, 0x24] + bl __floatsidf + adds r3, r1, 0 + adds r2, r0, 0 + ldr r0, [sp, 0x6C] + ldr r1, [sp, 0x70] + bl __nedf2 + cmp r0, 0 + beq _080B3F40 + ldr r0, [sp, 0x24] + subs r0, 0x1 + str r0, [sp, 0x24] +_080B3F40: + movs r1, 0x1 + str r1, [sp, 0x2C] + ldr r2, [sp, 0x24] + cmp r2, 0x16 + bhi _080B3F6A + ldr r1, _080B3FB4 + lsls r0, r2, 3 + adds r0, r1 + ldr r2, [r0] + ldr r3, [r0, 0x4] + ldr r0, [sp, 0x40] + ldr r1, [sp, 0x44] + bl __ltdf2 + cmp r0, 0 + bge _080B3F66 + ldr r3, [sp, 0x24] + subs r3, 0x1 + str r3, [sp, 0x24] +_080B3F66: + movs r0, 0 + str r0, [sp, 0x2C] +_080B3F6A: + mov r1, r8 + subs r0, r6, r1 + subs r4, r0, 0x1 + cmp r4, 0 + blt _080B3FB8 + movs r2, 0 + str r2, [sp, 0x10] + str r4, [sp, 0x34] + b _080B3FC0 + .align 2, 0 +_080B3F7C: .4byte 0x41f00000 +_080B3F80: .4byte 0x00000000 +_080B3F84: .4byte 0xfe100000 +_080B3F88: .4byte 0xfffffbcd +_080B3F8C: .4byte 0x3ff80000 +_080B3F90: .4byte 0x00000000 +_080B3F94: .4byte 0x3fd287a7 +_080B3F98: .4byte 0x636f4361 +_080B3F9C: .4byte 0x3fc68a28 +_080B3FA0: .4byte 0x8b60c8b3 +_080B3FA4: .4byte 0x3fd34413 +_080B3FA8: .4byte 0x509f79fb +_080B3FAC: .4byte 0x00000000 +_080B3FB0: .4byte 0x00000000 +_080B3FB4: .4byte gUnknown_826FEC0 +_080B3FB8: + negs r4, r4 + str r4, [sp, 0x10] + movs r3, 0 + str r3, [sp, 0x34] +_080B3FC0: + ldr r0, [sp, 0x24] + cmp r0, 0 + blt _080B3FD4 + movs r1, 0 + str r1, [sp, 0x14] + str r0, [sp, 0x38] + ldr r2, [sp, 0x34] + adds r2, r0 + str r2, [sp, 0x34] + b _080B3FE4 +_080B3FD4: + ldr r3, [sp, 0x10] + ldr r0, [sp, 0x24] + subs r3, r0 + str r3, [sp, 0x10] + negs r1, r0 + str r1, [sp, 0x14] + movs r2, 0 + str r2, [sp, 0x38] +_080B3FE4: + ldr r3, [sp, 0xC] + cmp r3, 0x9 + bls _080B3FEE + movs r0, 0 + str r0, [sp, 0xC] +_080B3FEE: + movs r5, 0x1 + ldr r1, [sp, 0xC] + cmp r1, 0x5 + ble _080B3FFC + subs r1, 0x4 + str r1, [sp, 0xC] + movs r5, 0 +_080B3FFC: + movs r2, 0x1 + str r2, [sp, 0x30] + ldr r3, [sp, 0xC] + cmp r3, 0x5 + bhi _080B4076 + lsls r0, r3, 2 + ldr r1, _080B4010 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080B4010: .4byte _080B4014 + .align 2, 0 +_080B4014: + .4byte _080B402C + .4byte _080B402C + .4byte _080B403E + .4byte _080B405A + .4byte _080B4042 + .4byte _080B405E +_080B402C: + movs r0, 0x1 + negs r0, r0 + str r0, [sp, 0x18] + str r0, [sp, 0x20] + movs r1, 0x12 + mov r8, r1 + movs r2, 0 + str r2, [sp, 0xA4] + b _080B4076 +_080B403E: + movs r3, 0 + str r3, [sp, 0x30] +_080B4042: + ldr r0, [sp, 0xA4] + cmp r0, 0 + bgt _080B404C + movs r1, 0x1 + str r1, [sp, 0xA4] +_080B404C: + ldr r2, [sp, 0xA4] + mov r8, r2 + mov r3, r8 + str r3, [sp, 0x20] + mov r0, r8 + str r0, [sp, 0x18] + b _080B4076 +_080B405A: + movs r1, 0 + str r1, [sp, 0x30] +_080B405E: + ldr r2, [sp, 0xA4] + ldr r3, [sp, 0x24] + adds r0, r2, r3 + adds r1, r0, 0x1 + mov r8, r1 + mov r2, r8 + str r2, [sp, 0x18] + str r0, [sp, 0x20] + cmp r1, 0 + bgt _080B4076 + movs r3, 0x1 + mov r8, r3 +_080B4076: + movs r4, 0x4 + movs r0, 0 + mov r1, r10 + str r0, [r1, 0x44] + mov r2, r8 + cmp r2, 0x17 + bls _080B4096 + movs r1, 0 +_080B4086: + adds r1, 0x1 + lsls r4, 1 + adds r0, r4, 0 + adds r0, 0x14 + cmp r0, r8 + bls _080B4086 + mov r3, r10 + str r1, [r3, 0x44] +_080B4096: + mov r0, r10 + ldr r1, [r0, 0x44] + bl sub_80B58B0 + mov r1, r10 + str r0, [r1, 0x40] + str r0, [sp, 0x74] + mov r9, r0 + ldr r2, [sp, 0x18] + cmp r2, 0xE + bls _080B40AE + b _080B4420 +_080B40AE: + cmp r5, 0 + bne _080B40B4 + b _080B4420 +_080B40B4: + ldr r0, [sp, 0x40] + ldr r1, [sp, 0x44] + str r0, [sp, 0x78] + str r1, [sp, 0x7C] + str r0, [sp, 0x48] + str r1, [sp, 0x4C] + ldr r1, [sp, 0x24] + str r1, [sp, 0x28] + str r2, [sp, 0x1C] + movs r7, 0x2 + cmp r1, 0 + ble _080B4144 + ldr r0, _080B413C + movs r2, 0xF + ands r1, r2 + lsls r1, 3 + adds r3, r1, r0 + ldr r0, [r3] + ldr r1, [r3, 0x4] + str r0, [sp, 0x6C] + str r1, [sp, 0x70] + ldr r1, [sp, 0x24] + asrs r4, r1, 4 + movs r0, 0x10 + ands r0, r4 + cmp r0, 0 + beq _080B4100 + ands r4, r2 + ldr r0, _080B4140 + ldr r2, [r0, 0x20] + ldr r3, [r0, 0x24] + ldr r0, [sp, 0x78] + ldr r1, [sp, 0x7C] + bl __divdf3 + str r0, [sp, 0x40] + str r1, [sp, 0x44] + movs r7, 0x3 +_080B4100: + cmp r4, 0 + beq _080B4128 + ldr r5, _080B4140 +_080B4106: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _080B4120 + adds r7, 0x1 + ldr r2, [r5] + ldr r3, [r5, 0x4] + ldr r0, [sp, 0x6C] + ldr r1, [sp, 0x70] + bl __muldf3 + str r0, [sp, 0x6C] + str r1, [sp, 0x70] +_080B4120: + asrs r4, 1 + adds r5, 0x8 + cmp r4, 0 + bne _080B4106 +_080B4128: + ldr r0, [sp, 0x40] + ldr r1, [sp, 0x44] + ldr r2, [sp, 0x6C] + ldr r3, [sp, 0x70] + bl __divdf3 + str r0, [sp, 0x40] + str r1, [sp, 0x44] + b _080B4190 + .align 2, 0 +_080B413C: .4byte gUnknown_826FEC0 +_080B4140: .4byte gUnknown_826FF88 +_080B4144: + ldr r2, [sp, 0x24] + negs r6, r2 + cmp r6, 0 + beq _080B4190 + ldr r1, _080B4238 + movs r0, 0xF + ands r0, r6 + lsls r0, 3 + adds r0, r1 + ldr r1, [r0, 0x4] + ldr r0, [r0] + ldr r2, [sp, 0x78] + ldr r3, [sp, 0x7C] + bl __muldf3 + str r0, [sp, 0x40] + str r1, [sp, 0x44] + asrs r4, r6, 4 + cmp r4, 0 + beq _080B4190 + ldr r5, _080B423C +_080B416E: + movs r0, 0x1 + ands r0, r4 + cmp r0, 0 + beq _080B4188 + adds r7, 0x1 + ldr r0, [r5] + ldr r1, [r5, 0x4] + ldr r2, [sp, 0x40] + ldr r3, [sp, 0x44] + bl __muldf3 + str r0, [sp, 0x40] + str r1, [sp, 0x44] +_080B4188: + asrs r4, 1 + adds r5, 0x8 + cmp r4, 0 + bne _080B416E +_080B4190: + ldr r3, [sp, 0x2C] + cmp r3, 0 + beq _080B41CE + ldr r2, _080B4240 + ldr r3, _080B4244 + ldr r0, [sp, 0x40] + ldr r1, [sp, 0x44] + bl __ltdf2 + cmp r0, 0 + bge _080B41CE + ldr r0, [sp, 0x18] + cmp r0, 0 + ble _080B41CE + ldr r1, [sp, 0x20] + cmp r1, 0 + bgt _080B41B4 + b _080B440C +_080B41B4: + str r1, [sp, 0x18] + ldr r2, [sp, 0x24] + subs r2, 0x1 + str r2, [sp, 0x24] + ldr r0, _080B4248 + ldr r1, _080B424C + ldr r2, [sp, 0x40] + ldr r3, [sp, 0x44] + bl __muldf3 + str r0, [sp, 0x40] + str r1, [sp, 0x44] + adds r7, 0x1 +_080B41CE: + adds r0, r7, 0 + bl __floatsidf + ldr r2, [sp, 0x40] + ldr r3, [sp, 0x44] + bl __muldf3 + ldr r2, _080B4250 + ldr r3, _080B4254 + bl __adddf3 + str r0, [sp, 0x50] + str r1, [sp, 0x54] + ldr r0, _080B4258 + ldr r3, [sp, 0x50] + adds r0, r3, r0 + str r0, [sp, 0x50] + ldr r1, [sp, 0x18] + cmp r1, 0 + bne _080B4264 + movs r2, 0 + str r2, [sp, 0x64] + movs r3, 0 + str r3, [sp, 0x68] + ldr r2, _080B425C + ldr r3, _080B4260 + ldr r0, [sp, 0x40] + ldr r1, [sp, 0x44] + bl __subdf3 + adds r5, r1, 0 + adds r4, r0, 0 + ldr r2, [sp, 0x50] + ldr r3, [sp, 0x54] + bl __gtdf2 + cmp r0, 0 + ble _080B421C + b _080B4796 +_080B421C: + ldr r0, [sp, 0x50] + ldr r1, [sp, 0x54] + bl __negdf2 + adds r3, r1, 0 + adds r2, r0, 0 + adds r1, r5, 0 + adds r0, r4, 0 + bl __ltdf2 + cmp r0, 0 + bge _080B4236 + b _080B478E +_080B4236: + b _080B440C + .align 2, 0 +_080B4238: .4byte gUnknown_826FEC0 +_080B423C: .4byte gUnknown_826FF88 +_080B4240: .4byte 0x3ff00000 +_080B4244: .4byte 0x00000000 +_080B4248: .4byte 0x40240000 +_080B424C: .4byte 0x00000000 +_080B4250: .4byte 0x401c0000 +_080B4254: .4byte 0x00000000 +_080B4258: .4byte 0xfcc00000 +_080B425C: .4byte 0x40140000 +_080B4260: .4byte 0x00000000 +_080B4264: + ldr r0, [sp, 0x30] + cmp r0, 0 + beq _080B4334 + ldr r1, _080B4294 + ldr r0, [sp, 0x18] + subs r0, 0x1 + lsls r0, 3 + adds r0, r1 + ldr r2, [r0] + ldr r3, [r0, 0x4] + ldr r0, _080B4298 + ldr r1, _080B429C + bl __divdf3 + ldr r2, [sp, 0x50] + ldr r3, [sp, 0x54] + bl __subdf3 + str r0, [sp, 0x50] + str r1, [sp, 0x54] + movs r1, 0 + mov r8, r1 + b _080B42C0 + .align 2, 0 +_080B4294: .4byte gUnknown_826FEC0 +_080B4298: .4byte 0x3fe00000 +_080B429C: .4byte 0x00000000 +_080B42A0: + ldr r1, _080B4328 + ldr r0, _080B4324 + ldr r2, [sp, 0x50] + ldr r3, [sp, 0x54] + bl __muldf3 + str r0, [sp, 0x50] + str r1, [sp, 0x54] + ldr r1, _080B4328 + ldr r0, _080B4324 + adds r3, r5, 0 + adds r2, r4, 0 + bl __muldf3 + str r0, [sp, 0x40] + str r1, [sp, 0x44] +_080B42C0: + ldr r0, [sp, 0x40] + ldr r1, [sp, 0x44] + bl __fixdfsi + adds r6, r0, 0 + bl __floatsidf + adds r3, r1, 0 + adds r2, r0, 0 + ldr r0, [sp, 0x40] + ldr r1, [sp, 0x44] + bl __subdf3 + adds r5, r1, 0 + adds r4, r0, 0 + adds r0, r6, 0 + adds r0, 0x30 + mov r2, r9 + strb r0, [r2] + movs r3, 0x1 + add r9, r3 + adds r1, r5, 0 + adds r0, r4, 0 + ldr r2, [sp, 0x50] + ldr r3, [sp, 0x54] + bl __ltdf2 + cmp r0, 0 + bge _080B42FC + b _080B4A06 +_080B42FC: + ldr r0, _080B432C + ldr r1, _080B4330 + adds r3, r5, 0 + adds r2, r4, 0 + bl __subdf3 + ldr r2, [sp, 0x50] + ldr r3, [sp, 0x54] + bl __ltdf2 + cmp r0, 0 + bge _080B4316 + b _080B4520 +_080B4316: + movs r0, 0x1 + add r8, r0 + ldr r1, [sp, 0x18] + cmp r8, r1 + blt _080B42A0 + b _080B440C + .align 2, 0 +_080B4324: .4byte 0x40240000 +_080B4328: .4byte 0x00000000 +_080B432C: .4byte 0x3ff00000 +_080B4330: .4byte 0x00000000 +_080B4334: + ldr r1, _080B4354 + ldr r0, [sp, 0x18] + subs r0, 0x1 + lsls r0, 3 + adds r0, r1 + ldr r1, [r0, 0x4] + ldr r0, [r0] + ldr r2, [sp, 0x50] + ldr r3, [sp, 0x54] + bl __muldf3 + str r0, [sp, 0x50] + str r1, [sp, 0x54] + movs r2, 0x1 + mov r8, r2 + b _080B436C + .align 2, 0 +_080B4354: .4byte gUnknown_826FEC0 +_080B4358: + movs r3, 0x1 + add r8, r3 + ldr r1, _080B4400 + ldr r0, _080B43FC + adds r3, r5, 0 + adds r2, r4, 0 + bl __muldf3 + str r0, [sp, 0x40] + str r1, [sp, 0x44] +_080B436C: + ldr r0, [sp, 0x40] + ldr r1, [sp, 0x44] + bl __fixdfsi + adds r6, r0, 0 + bl __floatsidf + adds r3, r1, 0 + adds r2, r0, 0 + ldr r0, [sp, 0x40] + ldr r1, [sp, 0x44] + bl __subdf3 + adds r5, r1, 0 + adds r4, r0, 0 + adds r0, r6, 0 + adds r0, 0x30 + mov r1, r9 + strb r0, [r1] + movs r2, 0x1 + add r9, r2 + ldr r3, [sp, 0x18] + cmp r8, r3 + bne _080B4358 + ldr r6, _080B4404 + ldr r7, _080B4408 + adds r1, r7, 0 + adds r0, r6, 0 + ldr r2, [sp, 0x50] + ldr r3, [sp, 0x54] + bl __adddf3 + adds r3, r1, 0 + adds r2, r0, 0 + adds r1, r5, 0 + adds r0, r4, 0 + bl __gtdf2 + cmp r0, 0 + ble _080B43BE + b _080B4520 +_080B43BE: + adds r1, r7, 0 + adds r0, r6, 0 + ldr r2, [sp, 0x50] + ldr r3, [sp, 0x54] + bl __subdf3 + adds r3, r1, 0 + adds r2, r0, 0 + adds r1, r5, 0 + adds r0, r4, 0 + bl __ltdf2 + cmp r0, 0 + bge _080B440C + movs r0, 0x1 + negs r0, r0 + add r9, r0 + mov r1, r9 + ldrb r1, [r1] + cmp r1, 0x30 + beq _080B43EA + b _080B4546 +_080B43EA: + movs r2, 0x1 + negs r2, r2 + add r9, r2 + mov r3, r9 + ldrb r3, [r3] + cmp r3, 0x30 + beq _080B43EA + b _080B4546 + .align 2, 0 +_080B43FC: .4byte 0x40240000 +_080B4400: .4byte 0x00000000 +_080B4404: .4byte 0x3fe00000 +_080B4408: .4byte 0x00000000 +_080B440C: + ldr r1, [sp, 0x74] + mov r9, r1 + ldr r2, [sp, 0x48] + ldr r3, [sp, 0x4C] + str r2, [sp, 0x40] + str r3, [sp, 0x44] + ldr r3, [sp, 0x28] + str r3, [sp, 0x24] + ldr r0, [sp, 0x1C] + str r0, [sp, 0x18] +_080B4420: + ldr r0, [sp, 0x4] + cmp r0, 0 + bge _080B4428 + b _080B455C +_080B4428: + ldr r1, [sp, 0x24] + cmp r1, 0xE + ble _080B4430 + b _080B455C +_080B4430: + ldr r1, _080B447C + ldr r2, [sp, 0x24] + lsls r0, r2, 3 + adds r0, r1 + ldr r1, [r0] + ldr r2, [r0, 0x4] + str r1, [sp, 0x6C] + str r2, [sp, 0x70] + ldr r2, [sp, 0xA4] + cmp r2, 0 + bge _080B4488 + ldr r3, [sp, 0x18] + cmp r3, 0 + bgt _080B4488 + movs r0, 0 + str r0, [sp, 0x64] + movs r1, 0 + str r1, [sp, 0x68] + cmp r3, 0 + bge _080B445A + b _080B478E +_080B445A: + ldr r2, _080B4480 + ldr r3, _080B4484 + ldr r0, [sp, 0x6C] + ldr r1, [sp, 0x70] + bl __muldf3 + adds r3, r1, 0 + adds r2, r0, 0 + ldr r0, [sp, 0x40] + ldr r1, [sp, 0x44] + bl __ledf2 + cmp r0, 0 + bgt _080B4478 + b _080B478E +_080B4478: + b _080B4796 + .align 2, 0 +_080B447C: .4byte gUnknown_826FEC0 +_080B4480: .4byte 0x40140000 +_080B4484: .4byte 0x00000000 +_080B4488: + movs r2, 0x1 + mov r8, r2 + b _080B44AC +_080B448E: + ldr r1, _080B4550 + ldr r0, _080B454C + bl __muldf3 + str r0, [sp, 0x40] + str r1, [sp, 0x44] + ldr r2, _080B4554 + ldr r3, _080B4558 + bl __eqdf2 + cmp r0, 0 + bne _080B44A8 + b _080B4A06 +_080B44A8: + movs r3, 0x1 + add r8, r3 +_080B44AC: + ldr r0, [sp, 0x40] + ldr r1, [sp, 0x44] + ldr r2, [sp, 0x6C] + ldr r3, [sp, 0x70] + bl __divdf3 + bl __fixdfsi + adds r6, r0, 0 + bl __floatsidf + ldr r2, [sp, 0x6C] + ldr r3, [sp, 0x70] + bl __muldf3 + adds r3, r1, 0 + adds r2, r0, 0 + ldr r0, [sp, 0x40] + ldr r1, [sp, 0x44] + bl __subdf3 + adds r3, r1, 0 + adds r2, r0, 0 + adds r0, r6, 0 + adds r0, 0x30 + mov r1, r9 + strb r0, [r1] + movs r0, 0x1 + add r9, r0 + ldr r1, [sp, 0x18] + cmp r8, r1 + bne _080B448E + adds r1, r3, 0 + adds r0, r2, 0 + bl __adddf3 + adds r5, r1, 0 + adds r4, r0, 0 + ldr r2, [sp, 0x6C] + ldr r3, [sp, 0x70] + bl __gtdf2 + cmp r0, 0 + bgt _080B4520 + adds r1, r5, 0 + adds r0, r4, 0 + ldr r2, [sp, 0x6C] + ldr r3, [sp, 0x70] + bl __eqdf2 + cmp r0, 0 + beq _080B4516 + b _080B4A06 +_080B4516: + movs r0, 0x1 + ands r0, r6 + cmp r0, 0 + bne _080B4520 + b _080B4A06 +_080B4520: + movs r0, 0x30 +_080B4522: + movs r2, 0x1 + negs r2, r2 + add r9, r2 + mov r3, r9 + ldrb r3, [r3] + cmp r3, 0x39 + bne _080B453E + ldr r1, [sp, 0x74] + cmp r9, r1 + bne _080B4522 + ldr r2, [sp, 0x24] + adds r2, 0x1 + str r2, [sp, 0x24] + strb r0, [r1] +_080B453E: + mov r3, r9 + ldrb r0, [r3] + adds r0, 0x1 + strb r0, [r3] +_080B4546: + movs r0, 0x1 + add r9, r0 + b _080B4A06 + .align 2, 0 +_080B454C: .4byte 0x40240000 +_080B4550: .4byte 0x00000000 +_080B4554: .4byte 0x00000000 +_080B4558: .4byte 0x00000000 +_080B455C: + ldr r5, [sp, 0x10] + ldr r6, [sp, 0x14] + movs r1, 0 + str r1, [sp, 0x60] + movs r2, 0 + str r2, [sp, 0x64] + ldr r3, [sp, 0x30] + cmp r3, 0 + beq _080B45D2 + ldr r1, [sp, 0xC] + cmp r1, 0x1 + bgt _080B4590 + ldr r2, [sp, 0x58] + cmp r2, 0 + beq _080B4588 + ldr r3, _080B4584 + adds r3, r0 + mov r8, r3 + b _080B45BC + .align 2, 0 +_080B4584: .4byte 0x00000433 +_080B4588: + ldr r1, [sp, 0x8] + movs r0, 0x36 + subs r0, r1 + b _080B45BA +_080B4590: + ldr r4, [sp, 0x18] + subs r4, 0x1 + ldr r0, [sp, 0x14] + cmp r0, r4 + blt _080B459E + subs r6, r0, r4 + b _080B45AE +_080B459E: + ldr r1, [sp, 0x14] + subs r4, r1 + ldr r2, [sp, 0x38] + adds r2, r4 + str r2, [sp, 0x38] + adds r1, r4 + str r1, [sp, 0x14] + movs r6, 0 +_080B45AE: + ldr r3, [sp, 0x18] + mov r8, r3 + cmp r3, 0 + bge _080B45BC + subs r5, r3 + movs r0, 0 +_080B45BA: + mov r8, r0 +_080B45BC: + ldr r1, [sp, 0x10] + add r1, r8 + str r1, [sp, 0x10] + ldr r2, [sp, 0x34] + add r2, r8 + str r2, [sp, 0x34] + mov r0, r10 + movs r1, 0x1 + bl sub_80B5B18 + str r0, [sp, 0x64] +_080B45D2: + cmp r5, 0 + ble _080B45F4 + ldr r3, [sp, 0x34] + cmp r3, 0 + ble _080B45F4 + mov r8, r3 + cmp r8, r5 + ble _080B45E4 + mov r8, r5 +_080B45E4: + ldr r0, [sp, 0x10] + mov r1, r8 + subs r0, r1 + str r0, [sp, 0x10] + subs r5, r1 + ldr r2, [sp, 0x34] + subs r2, r1 + str r2, [sp, 0x34] +_080B45F4: + ldr r3, [sp, 0x14] + cmp r3, 0 + ble _080B4642 + ldr r0, [sp, 0x30] + cmp r0, 0 + beq _080B4636 + cmp r6, 0 + ble _080B4626 + mov r0, r10 + ldr r1, [sp, 0x64] + adds r2, r6, 0 + bl sub_80B5C98 + str r0, [sp, 0x64] + mov r0, r10 + ldr r1, [sp, 0x64] + ldr r2, [sp, 0x5C] + bl sub_80B5B2C + adds r4, r0, 0 + mov r0, r10 + ldr r1, [sp, 0x5C] + bl sub_80B5908 + str r4, [sp, 0x5C] +_080B4626: + ldr r1, [sp, 0x14] + subs r4, r1, r6 + cmp r4, 0 + beq _080B4642 + mov r0, r10 + ldr r1, [sp, 0x5C] + adds r2, r4, 0 + b _080B463C +_080B4636: + mov r0, r10 + ldr r1, [sp, 0x5C] + ldr r2, [sp, 0x14] +_080B463C: + bl sub_80B5C98 + str r0, [sp, 0x5C] +_080B4642: + mov r0, r10 + movs r1, 0x1 + bl sub_80B5B18 + str r0, [sp, 0x68] + ldr r2, [sp, 0x38] + cmp r2, 0 + ble _080B465C + mov r0, r10 + ldr r1, [sp, 0x68] + bl sub_80B5C98 + str r0, [sp, 0x68] +_080B465C: + ldr r3, [sp, 0xC] + cmp r3, 0x1 + bgt _080B4698 + ldr r0, [sp, 0x44] + cmp r0, 0 + bne _080B4694 + ldr r0, _080B468C + ldr r1, [sp, 0x40] + ands r0, r1 + cmp r0, 0 + bne _080B4694 + ldr r0, _080B4690 + ands r1, r0 + cmp r1, 0 + beq _080B4694 + ldr r1, [sp, 0x10] + adds r1, 0x1 + str r1, [sp, 0x10] + ldr r2, [sp, 0x34] + adds r2, 0x1 + str r2, [sp, 0x34] + movs r3, 0x1 + str r3, [sp, 0x3C] + b _080B4698 + .align 2, 0 +_080B468C: .4byte 0x000fffff +_080B4690: .4byte 0x7ff00000 +_080B4694: + movs r0, 0 + str r0, [sp, 0x3C] +_080B4698: + ldr r1, [sp, 0x38] + cmp r1, 0 + beq _080B46C4 + ldr r2, [sp, 0x68] + ldr r1, [r2, 0x10] + subs r1, 0x1 + lsls r1, 2 + adds r0, r2, 0 + adds r0, 0x14 + adds r0, r1 + ldr r0, [r0] + bl sub_80B5A3C + ldr r1, [sp, 0x34] + adds r1, 0x20 + subs r1, r0 + mov r8, r1 + movs r0, 0x1F + mov r3, r8 + ands r3, r0 + mov r8, r3 + b _080B46D2 +_080B46C4: + ldr r0, [sp, 0x34] + adds r0, 0x1 + mov r8, r0 + movs r0, 0x1F + mov r1, r8 + ands r1, r0 + mov r8, r1 +_080B46D2: + mov r2, r8 + cmp r2, 0 + beq _080B46DE + movs r0, 0x20 + subs r2, r0, r2 + mov r8, r2 +_080B46DE: + mov r3, r8 + cmp r3, 0x4 + ble _080B46EA + movs r0, 0x4 + negs r0, r0 + b _080B46F2 +_080B46EA: + mov r3, r8 + cmp r3, 0x3 + bgt _080B4702 + movs r0, 0x1C +_080B46F2: + add r8, r0 + ldr r1, [sp, 0x10] + add r1, r8 + str r1, [sp, 0x10] + add r5, r8 + ldr r2, [sp, 0x34] + add r2, r8 + str r2, [sp, 0x34] +_080B4702: + ldr r3, [sp, 0x10] + cmp r3, 0 + ble _080B4714 + mov r0, r10 + ldr r1, [sp, 0x5C] + adds r2, r3, 0 + bl sub_80B5D30 + str r0, [sp, 0x5C] +_080B4714: + ldr r0, [sp, 0x34] + cmp r0, 0 + ble _080B4726 + mov r0, r10 + ldr r1, [sp, 0x68] + ldr r2, [sp, 0x34] + bl sub_80B5D30 + str r0, [sp, 0x68] +_080B4726: + ldr r1, [sp, 0x2C] + cmp r1, 0 + beq _080B4764 + ldr r0, [sp, 0x5C] + ldr r1, [sp, 0x68] + bl sub_80B5DD0 + cmp r0, 0 + bge _080B4764 + ldr r2, [sp, 0x24] + subs r2, 0x1 + str r2, [sp, 0x24] + mov r0, r10 + ldr r1, [sp, 0x5C] + movs r2, 0xA + movs r3, 0 + bl sub_80B5920 + str r0, [sp, 0x5C] + ldr r3, [sp, 0x30] + cmp r3, 0 + beq _080B4760 + mov r0, r10 + ldr r1, [sp, 0x64] + movs r2, 0xA + movs r3, 0 + bl sub_80B5920 + str r0, [sp, 0x64] +_080B4760: + ldr r0, [sp, 0x20] + str r0, [sp, 0x18] +_080B4764: + ldr r1, [sp, 0x18] + cmp r1, 0 + bgt _080B47A8 + ldr r2, [sp, 0xC] + cmp r2, 0x2 + ble _080B47A8 + cmp r1, 0 + blt _080B478E + mov r0, r10 + ldr r1, [sp, 0x68] + movs r2, 0x5 + movs r3, 0 + bl sub_80B5920 + str r0, [sp, 0x68] + ldr r0, [sp, 0x5C] + ldr r1, [sp, 0x68] + bl sub_80B5DD0 + cmp r0, 0 + bgt _080B4796 +_080B478E: + ldr r3, [sp, 0xA4] + mvns r3, r3 + str r3, [sp, 0x24] + b _080B49DE +_080B4796: + movs r0, 0x31 + mov r1, r9 + strb r0, [r1] + movs r2, 0x1 + add r9, r2 + ldr r3, [sp, 0x24] + adds r3, 0x1 + str r3, [sp, 0x24] + b _080B49DE +_080B47A8: + ldr r0, [sp, 0x30] + cmp r0, 0 + bne _080B47B0 + b _080B4926 +_080B47B0: + cmp r5, 0 + ble _080B47C0 + mov r0, r10 + ldr r1, [sp, 0x64] + adds r2, r5, 0 + bl sub_80B5D30 + str r0, [sp, 0x64] +_080B47C0: + ldr r1, [sp, 0x64] + str r1, [sp, 0x60] + ldr r2, [sp, 0x3C] + cmp r2, 0 + beq _080B47F2 + ldr r1, [r1, 0x4] + mov r0, r10 + bl sub_80B58B0 + str r0, [sp, 0x64] + adds r0, 0xC + ldr r1, [sp, 0x60] + adds r1, 0xC + ldr r3, [sp, 0x60] + ldr r2, [r3, 0x10] + lsls r2, 2 + adds r2, 0x8 + bl memcpy + mov r0, r10 + ldr r1, [sp, 0x64] + movs r2, 0x1 + bl sub_80B5D30 + str r0, [sp, 0x64] +_080B47F2: + movs r0, 0x1 + mov r8, r0 + mov r1, r8 + ldr r2, [sp, 0x44] + ands r2, r1 + str r2, [sp, 0x80] + b _080B4848 +_080B4800: + mov r0, r10 + ldr r1, [sp, 0x5C] + movs r2, 0xA + movs r3, 0 + bl sub_80B5920 + str r0, [sp, 0x5C] + ldr r3, [sp, 0x60] + ldr r0, [sp, 0x64] + cmp r3, r0 + bne _080B4828 + mov r0, r10 + ldr r1, [sp, 0x64] + movs r2, 0xA + movs r3, 0 + bl sub_80B5920 + str r0, [sp, 0x64] + str r0, [sp, 0x60] + b _080B4844 +_080B4828: + mov r0, r10 + ldr r1, [sp, 0x60] + movs r2, 0xA + movs r3, 0 + bl sub_80B5920 + str r0, [sp, 0x60] + mov r0, r10 + ldr r1, [sp, 0x64] + movs r2, 0xA + movs r3, 0 + bl sub_80B5920 + str r0, [sp, 0x64] +_080B4844: + movs r1, 0x1 + add r8, r1 +_080B4848: + ldr r0, [sp, 0x5C] + ldr r1, [sp, 0x68] + bl sub_80B3BE0 + adds r7, r0, 0 + adds r7, 0x30 + ldr r0, [sp, 0x5C] + ldr r1, [sp, 0x60] + bl sub_80B5DD0 + adds r4, r0, 0 + mov r0, r10 + ldr r1, [sp, 0x68] + ldr r2, [sp, 0x64] + bl sub_80B5E10 + adds r5, r0, 0 + ldr r0, [r5, 0xC] + cmp r0, 0 + bne _080B487C + ldr r0, [sp, 0x5C] + adds r1, r5, 0 + bl sub_80B5DD0 + adds r6, r0, 0 + b _080B487E +_080B487C: + movs r6, 0x1 +_080B487E: + mov r0, r10 + adds r1, r5, 0 + bl sub_80B5908 + cmp r6, 0 + bne _080B48AA + ldr r2, [sp, 0xC] + cmp r2, 0 + bne _080B48AA + ldr r3, [sp, 0x80] + cmp r3, 0 + bne _080B48AA + cmp r7, 0x39 + beq _080B48FC + cmp r4, 0 + ble _080B48A0 + adds r7, 0x1 +_080B48A0: + mov r0, r9 + strb r7, [r0] + movs r1, 0x1 + add r9, r1 + b _080B49DE +_080B48AA: + cmp r4, 0 + blt _080B48BE + cmp r4, 0 + bne _080B48F4 + ldr r2, [sp, 0xC] + cmp r2, 0 + bne _080B48F4 + ldr r3, [sp, 0x80] + cmp r3, 0 + bne _080B48F4 +_080B48BE: + cmp r6, 0 + ble _080B48EE + mov r0, r10 + ldr r1, [sp, 0x5C] + movs r2, 0x1 + bl sub_80B5D30 + str r0, [sp, 0x5C] + ldr r1, [sp, 0x68] + bl sub_80B5DD0 + adds r6, r0, 0 + cmp r6, 0 + bgt _080B48E8 + cmp r6, 0 + bne _080B48EE + adds r0, r7, 0 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080B48EE +_080B48E8: + adds r7, 0x1 + cmp r7, 0x3A + beq _080B48FC +_080B48EE: + mov r2, r9 + strb r7, [r2] + b _080B49A6 +_080B48F4: + cmp r6, 0 + ble _080B4914 + cmp r7, 0x39 + bne _080B4908 +_080B48FC: + movs r0, 0x39 + mov r1, r9 + strb r0, [r1] + movs r2, 0x1 + add r9, r2 + b _080B497C +_080B4908: + adds r0, r7, 0x1 + mov r3, r9 + strb r0, [r3] + movs r0, 0x1 + add r9, r0 + b _080B49DE +_080B4914: + mov r1, r9 + strb r7, [r1] + movs r2, 0x1 + add r9, r2 + ldr r3, [sp, 0x18] + cmp r8, r3 + beq _080B4924 + b _080B4800 +_080B4924: + b _080B4958 +_080B4926: + movs r0, 0x1 + mov r8, r0 + b _080B493E +_080B492C: + mov r0, r10 + ldr r1, [sp, 0x5C] + movs r2, 0xA + movs r3, 0 + bl sub_80B5920 + str r0, [sp, 0x5C] + movs r1, 0x1 + add r8, r1 +_080B493E: + ldr r0, [sp, 0x5C] + ldr r1, [sp, 0x68] + bl sub_80B3BE0 + adds r7, r0, 0 + adds r7, 0x30 + mov r2, r9 + strb r7, [r2] + movs r3, 0x1 + add r9, r3 + ldr r0, [sp, 0x18] + cmp r8, r0 + blt _080B492C +_080B4958: + mov r0, r10 + ldr r1, [sp, 0x5C] + movs r2, 0x1 + bl sub_80B5D30 + str r0, [sp, 0x5C] + ldr r1, [sp, 0x68] + bl sub_80B5DD0 + adds r4, r0, 0 + cmp r4, 0 + bgt _080B497C + cmp r4, 0 + bne _080B49BE + movs r0, 0x1 + ands r7, r0 + cmp r7, 0 + beq _080B49BE +_080B497C: + movs r1, 0x1 + negs r1, r1 + add r9, r1 + mov r2, r9 + ldrb r2, [r2] + cmp r2, 0x39 + bne _080B499E +_080B498A: + ldr r3, [sp, 0x74] + cmp r9, r3 + beq _080B49AC + movs r0, 0x1 + negs r0, r0 + add r9, r0 + mov r1, r9 + ldrb r1, [r1] + cmp r1, 0x39 + beq _080B498A +_080B499E: + mov r2, r9 + ldrb r0, [r2] + adds r0, 0x1 + strb r0, [r2] +_080B49A6: + movs r3, 0x1 + add r9, r3 + b _080B49DE +_080B49AC: + ldr r0, [sp, 0x24] + adds r0, 0x1 + str r0, [sp, 0x24] + movs r0, 0x31 + ldr r1, [sp, 0x74] + strb r0, [r1] + adds r1, 0x1 + mov r9, r1 + b _080B49DE +_080B49BE: + movs r2, 0x1 + negs r2, r2 + add r9, r2 + mov r3, r9 + ldrb r3, [r3] + cmp r3, 0x30 + bne _080B49DA +_080B49CC: + movs r0, 0x1 + negs r0, r0 + add r9, r0 + mov r1, r9 + ldrb r1, [r1] + cmp r1, 0x30 + beq _080B49CC +_080B49DA: + movs r2, 0x1 + add r9, r2 +_080B49DE: + mov r0, r10 + ldr r1, [sp, 0x68] + bl sub_80B5908 + ldr r3, [sp, 0x64] + cmp r3, 0 + beq _080B4A06 + ldr r0, [sp, 0x60] + cmp r0, 0 + beq _080B49FE + cmp r0, r3 + beq _080B49FE + mov r0, r10 + ldr r1, [sp, 0x60] + bl sub_80B5908 +_080B49FE: + mov r0, r10 + ldr r1, [sp, 0x64] + bl sub_80B5908 +_080B4A06: + mov r0, r10 + ldr r1, [sp, 0x5C] + bl sub_80B5908 + movs r0, 0 + mov r1, r9 + strb r0, [r1] + ldr r0, [sp, 0x24] + adds r0, 0x1 + ldr r2, [sp, 0xA8] + str r0, [r2] + ldr r3, [sp, 0xB0] + cmp r3, 0 + beq _080B4A24 + str r1, [r3] +_080B4A24: + ldr r0, [sp, 0x74] +_080B4A26: + add sp, 0x84 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7,pc} + thumb_func_end sub_80B3D3C + + thumb_func_start sub_80B4A34 +sub_80B4A34: + push {r4-r6,lr} + adds r4, r0, 0 + cmp r4, 0 + bne _080B4A50 + ldr r0, _080B4A48 + ldr r0, [r0] + ldr r1, _080B4A4C + bl sub_80B50D0 + b _080B4AC6 + .align 2, 0 +_080B4A48: .4byte gUnknown_203B7A8 +_080B4A4C: .4byte sub_80B4A34 +_080B4A50: + ldr r0, [r4, 0x54] + cmp r0, 0 + bne _080B4A5C + ldr r0, _080B4A90 + ldr r0, [r0] + str r0, [r4, 0x54] +_080B4A5C: + ldr r1, [r4, 0x54] + ldr r0, [r1, 0x38] + cmp r0, 0 + bne _080B4A6A + adds r0, r1, 0 + bl sub_80B4BC4 +_080B4A6A: + movs r0, 0xC + ldrsh r1, [r4, r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + beq _080B4AC4 + ldr r6, [r4, 0x10] + cmp r6, 0 + beq _080B4AC4 + ldr r0, [r4] + subs r5, r0, r6 + str r6, [r4] + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _080B4AA2 + ldr r0, [r4, 0x14] + b _080B4AA4 + .align 2, 0 +_080B4A90: .4byte gUnknown_203B7A8 +_080B4A94: + movs r0, 0x40 + ldrh r1, [r4, 0xC] + orrs r0, r1 + strh r0, [r4, 0xC] + movs r0, 0x1 + negs r0, r0 + b _080B4AC6 +_080B4AA2: + movs r0, 0 +_080B4AA4: + str r0, [r4, 0x8] + cmp r5, 0 + ble _080B4AC4 +_080B4AAA: + ldr r0, [r4, 0x1C] + ldr r3, [r4, 0x24] + adds r1, r6, 0 + adds r2, r5, 0 + bl _call_via_r3 + adds r1, r0, 0 + cmp r1, 0 + ble _080B4A94 + adds r6, r1 + subs r5, r1 + cmp r5, 0 + bgt _080B4AAA +_080B4AC4: + movs r0, 0 +_080B4AC6: + pop {r4-r6,pc} + thumb_func_end sub_80B4A34 + + thumb_func_start sub_80B4AC8 +sub_80B4AC8: + push {r4,lr} + movs r4, 0 + str r4, [r0] + str r4, [r0, 0x4] + str r4, [r0, 0x8] + strh r1, [r0, 0xC] + strh r2, [r0, 0xE] + str r4, [r0, 0x10] + str r4, [r0, 0x18] + str r0, [r0, 0x1C] + ldr r1, _080B4AF0 + str r1, [r0, 0x20] + ldr r1, _080B4AF4 + str r1, [r0, 0x24] + ldr r1, _080B4AF8 + str r1, [r0, 0x28] + ldr r1, _080B4AFC + str r1, [r0, 0x2C] + str r3, [r0, 0x54] + pop {r4,pc} + .align 2, 0 +_080B4AF0: .4byte sub_80B61F0 +_080B4AF4: .4byte sub_80B6224 +_080B4AF8: .4byte sub_80B6264 +_080B4AFC: .4byte sub_80B62A4 + thumb_func_end sub_80B4AC8 + + thumb_func_start sub_80B4B00 +sub_80B4B00: + push {r4-r6,lr} + adds r5, r1, 0 + movs r1, 0x58 + adds r6, r5, 0 + muls r6, r1 + adds r1, r6, 0 + adds r1, 0xC + bl sub_80B53B4 + adds r4, r0, 0 + cmp r4, 0 + beq _080B4B2C + adds r0, 0xC + movs r1, 0 + str r1, [r4] + str r5, [r4, 0x4] + str r0, [r4, 0x8] + adds r2, r6, 0 + bl memset + adds r0, r4, 0 + b _080B4B2E +_080B4B2C: + movs r0, 0 +_080B4B2E: + pop {r4-r6,pc} + thumb_func_end sub_80B4B00 + + thumb_func_start sub_80B4B30 +sub_80B4B30: + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, [r5, 0x38] + cmp r0, 0 + bne _080B4B40 + adds r0, r5, 0 + bl sub_80B4BC4 +_080B4B40: + movs r0, 0xEC + lsls r0, 1 + adds r4, r5, r0 + b _080B4B4A +_080B4B48: + ldr r4, [r4] +_080B4B4A: + ldr r2, [r4, 0x8] + ldr r0, [r4, 0x4] + b _080B4B5A +_080B4B50: + movs r3, 0xC + ldrsh r1, [r2, r3] + cmp r1, 0 + beq _080B4B7C + adds r2, 0x58 +_080B4B5A: + subs r0, 0x1 + cmp r0, 0 + bge _080B4B50 + ldr r0, [r4] + cmp r0, 0 + bne _080B4B48 + adds r0, r5, 0 + movs r1, 0x4 + bl sub_80B4B00 + str r0, [r4] + cmp r0, 0 + bne _080B4B48 + movs r0, 0xC + str r0, [r5] + movs r0, 0 + b _080B4B9C +_080B4B7C: + movs r0, 0x1 + strh r0, [r2, 0xC] + str r1, [r2] + str r1, [r2, 0x8] + str r1, [r2, 0x4] + str r1, [r2, 0x10] + str r1, [r2, 0x14] + str r1, [r2, 0x18] + ldr r0, _080B4BA0 + strh r0, [r2, 0xE] + str r1, [r2, 0x30] + str r1, [r2, 0x34] + str r1, [r2, 0x44] + str r1, [r2, 0x48] + str r5, [r2, 0x54] + adds r0, r2, 0 +_080B4B9C: + pop {r4,r5,pc} + .align 2, 0 +_080B4BA0: .4byte 0x0000ffff + thumb_func_end sub_80B4B30 + + thumb_func_start sub_80B4BA4 +sub_80B4BA4: + push {lr} + ldr r1, _080B4BB0 + bl sub_80B50D0 + pop {pc} + .align 2, 0 +_080B4BB0: .4byte sub_80B4A34 + thumb_func_end sub_80B4BA4 + + thumb_func_start sub_80B4BB4 +sub_80B4BB4: + push {lr} + ldr r0, _080B4BC0 + ldr r0, [r0] + bl sub_80B4BA4 + pop {pc} + .align 2, 0 +_080B4BC0: .4byte gUnknown_203B7A8 + thumb_func_end sub_80B4BB4 + + thumb_func_start sub_80B4BC4 +sub_80B4BC4: + push {r4,r5,lr} + adds r5, r0, 0 + ldr r0, _080B4C20 + str r0, [r5, 0x3C] + movs r0, 0x1 + str r0, [r5, 0x38] + movs r0, 0xF2 + lsls r0, 1 + adds r4, r5, r0 + adds r0, r4, 0 + movs r1, 0x4 + movs r2, 0 + adds r3, r5, 0 + bl sub_80B4AC8 + movs r1, 0x8F + lsls r1, 2 + adds r0, r5, r1 + movs r1, 0x9 + movs r2, 0x1 + adds r3, r5, 0 + bl sub_80B4AC8 + movs r1, 0xA5 + lsls r1, 2 + adds r0, r5, r1 + movs r1, 0xA + movs r2, 0x2 + adds r3, r5, 0 + bl sub_80B4AC8 + movs r0, 0xEC + lsls r0, 1 + adds r1, r5, r0 + movs r0, 0 + str r0, [r1] + movs r0, 0xEE + lsls r0, 1 + adds r1, r5, r0 + movs r0, 0x3 + str r0, [r1] + movs r1, 0xF0 + lsls r1, 1 + adds r0, r5, r1 + str r4, [r0] + pop {r4,r5,pc} + .align 2, 0 +_080B4C20: .4byte sub_80B4BA4 + thumb_func_end sub_80B4BC4 + + thumb_func_start _free_r +_free_r: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r9, r0 + adds r4, r1, 0 + cmp r4, 0 + bne _080B4C36 + b _080B4DDA +_080B4C36: + bl __malloc_lock + adds r5, r4, 0 + subs r5, 0x8 + ldr r1, [r5, 0x4] + movs r6, 0x2 + negs r6, r6 + ands r6, r1 + adds r7, r5, r6 + ldr r4, [r7, 0x4] + movs r0, 0x4 + negs r0, r0 + ands r4, r0 + ldr r0, _080B4C98 + mov r12, r0 + ldr r0, [r0, 0x8] + cmp r7, r0 + bne _080B4CA4 + adds r6, r4 + movs r4, 0x1 + ands r1, r4 + cmp r1, 0 + bne _080B4C72 + ldr r0, [r5] + subs r5, r0 + adds r6, r0 + ldr r3, [r5, 0xC] + ldr r2, [r5, 0x8] + str r3, [r2, 0xC] + str r2, [r3, 0x8] +_080B4C72: + adds r0, r6, 0 + orrs r0, r4 + str r0, [r5, 0x4] + mov r2, r12 + str r5, [r2, 0x8] + ldr r0, _080B4C9C + ldr r0, [r0] + cmp r6, r0 + bcc _080B4C8E + ldr r0, _080B4CA0 + ldr r1, [r0] + mov r0, r9 + bl _malloc_trim_r +_080B4C8E: + mov r0, r9 + bl nullsub_127 + b _080B4DDA + .align 2, 0 +_080B4C98: .4byte gUnknown_203B7C0 +_080B4C9C: .4byte gUnknown_203BBC8 +_080B4CA0: .4byte gUnknown_203BBCC +_080B4CA4: + str r4, [r7, 0x4] + movs r0, 0 + mov r8, r0 + movs r0, 0x1 + ands r1, r0 + cmp r1, 0 + bne _080B4CD0 + ldr r0, [r5] + subs r5, r0 + adds r6, r0 + ldr r1, [r5, 0x8] + mov r0, r12 + adds r0, 0x8 + cmp r1, r0 + bne _080B4CC8 + movs r2, 0x1 + mov r8, r2 + b _080B4CD0 +_080B4CC8: + ldr r3, [r5, 0xC] + adds r2, r1, 0 + str r3, [r2, 0xC] + str r2, [r3, 0x8] +_080B4CD0: + adds r0, r7, r4 + ldr r0, [r0, 0x4] + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080B4D08 + adds r6, r4 + ldr r1, [r7, 0x8] + mov r0, r8 + cmp r0, 0 + bne _080B4D00 + ldr r0, _080B4CFC + cmp r1, r0 + bne _080B4D00 + movs r2, 0x1 + mov r8, r2 + str r5, [r1, 0xC] + str r5, [r1, 0x8] + str r1, [r5, 0xC] + str r1, [r5, 0x8] + b _080B4D08 + .align 2, 0 +_080B4CFC: .4byte gUnknown_203B7C8 +_080B4D00: + ldr r3, [r7, 0xC] + adds r2, r1, 0 + str r3, [r2, 0xC] + str r2, [r3, 0x8] +_080B4D08: + movs r1, 0x1 + adds r0, r6, 0 + orrs r0, r1 + str r0, [r5, 0x4] + adds r0, r5, r6 + str r6, [r0] + mov r0, r8 + cmp r0, 0 + bne _080B4DD4 + ldr r0, _080B4D38 + cmp r6, r0 + bhi _080B4D40 + lsrs r4, r6, 3 + ldr r2, _080B4D3C + adds r0, r4, 0 + asrs r0, 2 + lsls r1, r0 + ldr r0, [r2, 0x4] + orrs r0, r1 + str r0, [r2, 0x4] + lsls r0, r4, 3 + adds r3, r0, r2 + ldr r2, [r3, 0x8] + b _080B4DCC + .align 2, 0 +_080B4D38: .4byte 0x000001ff +_080B4D3C: .4byte gUnknown_203B7C0 +_080B4D40: + lsrs r1, r6, 9 + cmp r1, 0 + bne _080B4D4A + lsrs r4, r6, 3 + b _080B4D92 +_080B4D4A: + cmp r1, 0x4 + bhi _080B4D56 + lsrs r0, r6, 6 + adds r4, r0, 0 + adds r4, 0x38 + b _080B4D92 +_080B4D56: + cmp r1, 0x14 + bhi _080B4D60 + adds r4, r1, 0 + adds r4, 0x5B + b _080B4D92 +_080B4D60: + cmp r1, 0x54 + bhi _080B4D6C + lsrs r0, r6, 12 + adds r4, r0, 0 + adds r4, 0x6E + b _080B4D92 +_080B4D6C: + movs r0, 0xAA + lsls r0, 1 + cmp r1, r0 + bhi _080B4D7C + lsrs r0, r6, 15 + adds r4, r0, 0 + adds r4, 0x77 + b _080B4D92 +_080B4D7C: + ldr r0, _080B4D8C + cmp r1, r0 + bhi _080B4D90 + lsrs r0, r6, 18 + adds r4, r0, 0 + adds r4, 0x7C + b _080B4D92 + .align 2, 0 +_080B4D8C: .4byte 0x00000554 +_080B4D90: + movs r4, 0x7E +_080B4D92: + lsls r0, r4, 3 + ldr r7, _080B4DB0 + adds r3, r0, r7 + ldr r2, [r3, 0x8] + cmp r2, r3 + bne _080B4DB4 + adds r0, r4, 0 + asrs r0, 2 + movs r1, 0x1 + lsls r1, r0 + ldr r0, [r7, 0x4] + orrs r0, r1 + str r0, [r7, 0x4] + b _080B4DCC + .align 2, 0 +_080B4DB0: .4byte gUnknown_203B7C0 +_080B4DB4: + ldr r0, [r2, 0x4] + movs r1, 0x4 + negs r1, r1 + b _080B4DC4 +_080B4DBC: + ldr r2, [r2, 0x8] + cmp r2, r3 + beq _080B4DCA + ldr r0, [r2, 0x4] +_080B4DC4: + ands r0, r1 + cmp r6, r0 + bcc _080B4DBC +_080B4DCA: + ldr r3, [r2, 0xC] +_080B4DCC: + str r3, [r5, 0xC] + str r2, [r5, 0x8] + str r5, [r3, 0x8] + str r5, [r2, 0xC] +_080B4DD4: + mov r0, r9 + bl nullsub_127 +_080B4DDA: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7,pc} + thumb_func_end _free_r + + thumb_func_start _malloc_trim_r +_malloc_trim_r: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + adds r4, r1, 0 + bl __malloc_lock + ldr r0, _080B4E6C + mov r8, r0 + ldr r0, [r0, 0x8] + ldr r6, [r0, 0x4] + movs r0, 0x4 + negs r0, r0 + ands r6, r0 + subs r4, r6, r4 + movs r5, 0x80 + lsls r5, 5 + ldr r1, _080B4E70 + adds r4, r1 + adds r0, r4, 0 + adds r1, r5, 0 + bl sub_80B688C + subs r0, 0x1 + lsls r4, r0, 12 + cmp r4, r5 + blt _080B4E62 + adds r0, r7, 0 + movs r1, 0 + bl _sbrk_r + adds r2, r0, 0 + mov r1, r8 + ldr r0, [r1, 0x8] + adds r0, r6 + cmp r2, r0 + bne _080B4E62 + negs r1, r4 + adds r0, r7, 0 + bl _sbrk_r + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + bne _080B4E7C + adds r0, r7, 0 + movs r1, 0 + bl _sbrk_r + adds r2, r0, 0 + mov r0, r8 + ldr r3, [r0, 0x8] + subs r6, r2, r3 + cmp r6, 0xF + ble _080B4E62 + ldr r1, _080B4E74 + ldr r0, _080B4E78 + ldr r0, [r0] + subs r0, r2, r0 + str r0, [r1] + movs r0, 0x1 + orrs r6, r0 + str r6, [r3, 0x4] +_080B4E62: + adds r0, r7, 0 + bl nullsub_127 + movs r0, 0 + b _080B4E98 + .align 2, 0 +_080B4E6C: .4byte gUnknown_203B7C0 +_080B4E70: .4byte 0x00000fef +_080B4E74: .4byte gUnknown_203BBDC +_080B4E78: .4byte gUnknown_203BBD0 +_080B4E7C: + mov r1, r8 + ldr r2, [r1, 0x8] + subs r0, r6, r4 + movs r1, 0x1 + orrs r0, r1 + str r0, [r2, 0x4] + ldr r1, _080B4EA0 + ldr r0, [r1] + subs r0, r4 + str r0, [r1] + adds r0, r7, 0 + bl nullsub_127 + movs r0, 0x1 +_080B4E98: + pop {r3} + mov r8, r3 + pop {r4-r7,pc} + .align 2, 0 +_080B4EA0: .4byte gUnknown_203BBDC + thumb_func_end _malloc_trim_r + + thumb_func_start sub_80B4EA4 +sub_80B4EA4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + adds r5, r0, 0 + mov r10, r1 + ldr r6, [r1, 0x8] + cmp r6, 0 + bne _080B4EBC + b _080B50B2 +_080B4EBC: + movs r0, 0x8 + ldrh r1, [r5, 0xC] + ands r0, r1 + cmp r0, 0 + beq _080B4ECC + ldr r0, [r5, 0x10] + cmp r0, 0 + bne _080B4ED8 +_080B4ECC: + adds r0, r5, 0 + bl sub_80B3B34 + cmp r0, 0 + beq _080B4ED8 + b _080B50BE +_080B4ED8: + mov r2, r10 + ldr r2, [r2] + mov r8, r2 + movs r6, 0 + ldrh r1, [r5, 0xC] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080B4F2C +_080B4EEA: + ldr r0, [r5, 0x1C] + ldr r3, [r5, 0x24] + cmp r6, 0 + bne _080B4F00 +_080B4EF2: + mov r1, r8 + ldr r7, [r1] + ldr r6, [r1, 0x4] + movs r2, 0x8 + add r8, r2 + cmp r6, 0 + beq _080B4EF2 +_080B4F00: + adds r2, r6, 0 + movs r1, 0x80 + lsls r1, 3 + cmp r6, r1 + bls _080B4F0C + adds r2, r1, 0 +_080B4F0C: + adds r1, r7, 0 + bl _call_via_r3 + adds r4, r0, 0 + cmp r4, 0 + bgt _080B4F1A + b _080B50B6 +_080B4F1A: + adds r7, r4 + subs r6, r4 + mov r1, r10 + ldr r0, [r1, 0x8] + subs r0, r4 + str r0, [r1, 0x8] + cmp r0, 0 + bne _080B4EEA + b _080B50B2 +_080B4F2C: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080B4FE6 +_080B4F34: + ldrh r1, [r5, 0xC] + ldr r0, [r5, 0x8] + ldr r3, [r5] + cmp r6, 0 + bne _080B4F4C +_080B4F3E: + mov r2, r8 + ldr r7, [r2] + ldr r6, [r2, 0x4] + movs r2, 0x8 + add r8, r2 + cmp r6, 0 + beq _080B4F3E +_080B4F4C: + adds r4, r0, 0 + movs r2, 0x80 + lsls r2, 2 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _080B4F7A + cmp r6, r4 + bcs _080B4F60 + adds r4, r6, 0 +_080B4F60: + adds r0, r3, 0 + adds r1, r7, 0 + adds r2, r4, 0 + bl sub_80B5820 + ldr r0, [r5, 0x8] + subs r0, r4 + str r0, [r5, 0x8] + ldr r0, [r5] + adds r0, r4 + str r0, [r5] + adds r4, r6, 0 + b _080B4FD4 +_080B4F7A: + ldr r0, [r5, 0x10] + cmp r3, r0 + bls _080B4FA2 + cmp r6, r4 + bls _080B4FA2 + adds r0, r3, 0 + adds r1, r7, 0 + adds r2, r4, 0 + bl sub_80B5820 + ldr r0, [r5] + adds r0, r4 + str r0, [r5] + adds r0, r5, 0 + bl sub_80B4A34 + cmp r0, 0 + beq _080B4FA0 + b _080B50B6 +_080B4FA0: + b _080B4FD4 +_080B4FA2: + ldr r4, [r5, 0x14] + cmp r6, r4 + bcc _080B4FBC + ldr r0, [r5, 0x1C] + ldr r3, [r5, 0x24] + adds r1, r7, 0 + adds r2, r4, 0 + bl _call_via_r3 + adds r4, r0, 0 + cmp r4, 0 + ble _080B50B6 + b _080B4FD4 +_080B4FBC: + adds r4, r6, 0 + adds r0, r3, 0 + adds r1, r7, 0 + adds r2, r4, 0 + bl sub_80B5820 + ldr r0, [r5, 0x8] + subs r0, r4 + str r0, [r5, 0x8] + ldr r0, [r5] + adds r0, r4 + str r0, [r5] +_080B4FD4: + adds r7, r4 + subs r6, r4 + mov r1, r10 + ldr r0, [r1, 0x8] + subs r0, r4 + str r0, [r1, 0x8] + cmp r0, 0 + bne _080B4F34 + b _080B50B2 +_080B4FE6: + movs r2, 0 + str r2, [sp] +_080B4FEA: + cmp r6, 0 + bne _080B5000 + movs r0, 0 + str r0, [sp] +_080B4FF2: + mov r1, r8 + ldr r7, [r1] + ldr r6, [r1, 0x4] + movs r2, 0x8 + add r8, r2 + cmp r6, 0 + beq _080B4FF2 +_080B5000: + ldr r0, [sp] + cmp r0, 0 + bne _080B5024 + adds r0, r7, 0 + movs r1, 0xA + adds r2, r6, 0 + bl sub_80B57A0 + adds r1, r0, 0 + cmp r1, 0 + beq _080B501C + subs r0, r7, 0x1 + subs r1, r0 + b _080B501E +_080B501C: + adds r1, r6, 0x1 +_080B501E: + mov r9, r1 + movs r2, 0x1 + str r2, [sp] +_080B5024: + mov r2, r9 + cmp r9, r6 + bls _080B502C + adds r2, r6, 0 +_080B502C: + ldr r0, [r5, 0x8] + ldr r1, [r5, 0x14] + adds r4, r0, r1 + ldr r0, [r5, 0x10] + ldr r3, [r5] + cmp r3, r0 + bls _080B505A + cmp r2, r4 + ble _080B505A + adds r0, r3, 0 + adds r1, r7, 0 + adds r2, r4, 0 + bl sub_80B5820 + ldr r0, [r5] + adds r0, r4 + str r0, [r5] + adds r0, r5, 0 + bl sub_80B4A34 + cmp r0, 0 + bne _080B50B6 + b _080B508A +_080B505A: + adds r4, r1, 0 + cmp r2, r4 + blt _080B5074 + ldr r0, [r5, 0x1C] + ldr r3, [r5, 0x24] + adds r1, r7, 0 + adds r2, r4, 0 + bl _call_via_r3 + adds r4, r0, 0 + cmp r4, 0 + ble _080B50B6 + b _080B508A +_080B5074: + adds r4, r2, 0 + adds r0, r3, 0 + adds r1, r7, 0 + bl sub_80B5820 + ldr r0, [r5, 0x8] + subs r0, r4 + str r0, [r5, 0x8] + ldr r0, [r5] + adds r0, r4 + str r0, [r5] +_080B508A: + mov r0, r9 + subs r0, r4 + mov r9, r0 + cmp r0, 0 + bne _080B50A2 + adds r0, r5, 0 + bl sub_80B4A34 + cmp r0, 0 + bne _080B50B6 + movs r1, 0 + str r1, [sp] +_080B50A2: + adds r7, r4 + subs r6, r4 + mov r2, r10 + ldr r0, [r2, 0x8] + subs r0, r4 + str r0, [r2, 0x8] + cmp r0, 0 + bne _080B4FEA +_080B50B2: + movs r0, 0 + b _080B50C2 +_080B50B6: + movs r0, 0x40 + ldrh r1, [r5, 0xC] + orrs r0, r1 + strh r0, [r5, 0xC] +_080B50BE: + movs r0, 0x1 + negs r0, r0 +_080B50C2: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7,pc} + thumb_func_end sub_80B4EA4 + + thumb_func_start sub_80B50D0 +sub_80B50D0: + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r1 + movs r7, 0 + movs r1, 0xEC + lsls r1, 1 + adds r6, r0, r1 + cmp r6, 0 + beq _080B5108 +_080B50E4: + ldr r5, [r6, 0x8] + ldr r4, [r6, 0x4] + b _080B50FC +_080B50EA: + movs r1, 0xC + ldrsh r0, [r5, r1] + cmp r0, 0 + beq _080B50FA + adds r0, r5, 0 + bl _call_via_r8 + orrs r7, r0 +_080B50FA: + adds r5, 0x58 +_080B50FC: + subs r4, 0x1 + cmp r4, 0 + bge _080B50EA + ldr r6, [r6] + cmp r6, 0 + bne _080B50E4 +_080B5108: + adds r0, r7, 0 + pop {r3} + mov r8, r3 + pop {r4-r7,pc} + thumb_func_end sub_80B50D0 + + thumb_func_start sub_80B5110 +sub_80B5110: + push {r4-r6,lr} + adds r5, r0, 0 + adds r6, r1, 0 + adds r4, r2, 0 + cmp r4, 0 + beq _080B5144 + ldr r1, _080B5138 + adds r0, r4, 0 + bl strcmp + cmp r0, 0 + beq _080B5140 + ldr r1, _080B513C + adds r0, r4, 0 + bl strcmp + cmp r0, 0 + beq _080B5140 + movs r0, 0 + b _080B5146 + .align 2, 0 +_080B5138: .4byte gUnknown_826FEB0 +_080B513C: .4byte gUnknown_826FEA8 +_080B5140: + str r6, [r5, 0x30] + str r4, [r5, 0x34] +_080B5144: + ldr r0, _080B5148 +_080B5146: + pop {r4-r6,pc} + .align 2, 0 +_080B5148: .4byte gUnknown_826FEB0 + thumb_func_end sub_80B5110 + + thumb_func_start sub_80B514C +sub_80B514C: + ldr r0, _080B5150 + bx lr + .align 2, 0 +_080B5150: .4byte gUnknown_826FE78 + thumb_func_end sub_80B514C + + thumb_func_start sub_80B5154 +sub_80B5154: + push {lr} + adds r3, r0, 0 + adds r2, r1, 0 + ldr r0, _080B5168 + ldr r0, [r0] + adds r1, r3, 0 + bl sub_80B5110 + pop {pc} + .align 2, 0 +_080B5168: .4byte gUnknown_203B7A8 + thumb_func_end sub_80B5154 + + thumb_func_start sub_80B516C +sub_80B516C: + push {lr} + ldr r0, _080B5178 + ldr r0, [r0] + bl sub_80B514C + pop {pc} + .align 2, 0 +_080B5178: .4byte gUnknown_203B7A8 + thumb_func_end sub_80B516C + + thumb_func_start sub_80B517C +sub_80B517C: + push {r4-r7,lr} + sub sp, 0x3C + adds r4, r0, 0 + movs r0, 0x2 + ldrh r1, [r4, 0xC] + ands r0, r1 + cmp r0, 0 + bne _080B5212 + movs r2, 0xE + ldrsh r0, [r4, r2] + cmp r0, 0 + blt _080B51A4 + ldr r0, [r4, 0x54] + movs r2, 0xE + ldrsh r1, [r4, r2] + mov r2, sp + bl sub_80B67D8 + cmp r0, 0 + bge _080B51B6 +_080B51A4: + movs r7, 0 + movs r6, 0x80 + lsls r6, 3 + movs r1, 0x80 + lsls r1, 4 + adds r0, r1, 0 + ldrh r2, [r4, 0xC] + orrs r0, r2 + b _080B51FA +_080B51B6: + movs r7, 0 + ldr r1, [sp, 0x4] + movs r0, 0xF0 + lsls r0, 8 + ands r1, r0 + movs r0, 0x80 + lsls r0, 6 + cmp r1, r0 + bne _080B51CA + movs r7, 0x1 +_080B51CA: + movs r6, 0x80 + lsls r6, 3 + movs r0, 0x80 + lsls r0, 8 + cmp r1, r0 + bne _080B51F0 + ldr r1, [r4, 0x28] + ldr r0, _080B51EC + cmp r1, r0 + bne _080B51F0 + adds r0, r6, 0 + ldrh r1, [r4, 0xC] + orrs r0, r1 + strh r0, [r4, 0xC] + str r6, [r4, 0x4C] + b _080B51FC + .align 2, 0 +_080B51EC: .4byte sub_80B6264 +_080B51F0: + movs r2, 0x80 + lsls r2, 4 + adds r0, r2, 0 + ldrh r1, [r4, 0xC] + orrs r0, r1 +_080B51FA: + strh r0, [r4, 0xC] +_080B51FC: + ldr r0, [r4, 0x54] + adds r1, r6, 0 + bl sub_80B53B4 + adds r2, r0, 0 + cmp r2, 0 + bne _080B5220 + movs r0, 0x2 + ldrh r2, [r4, 0xC] + orrs r0, r2 + strh r0, [r4, 0xC] +_080B5212: + adds r0, r4, 0 + adds r0, 0x43 + str r0, [r4] + str r0, [r4, 0x10] + movs r0, 0x1 + str r0, [r4, 0x14] + b _080B524E +_080B5220: + ldr r1, [r4, 0x54] + ldr r0, _080B5254 + str r0, [r1, 0x3C] + movs r0, 0x80 + movs r5, 0 + ldrh r1, [r4, 0xC] + orrs r0, r1 + strh r0, [r4, 0xC] + str r2, [r4] + str r2, [r4, 0x10] + str r6, [r4, 0x14] + cmp r7, 0 + beq _080B524E + movs r2, 0xE + ldrsh r0, [r4, r2] + bl isatty + cmp r0, 0 + beq _080B524E + movs r0, 0x1 + ldrh r1, [r4, 0xC] + orrs r0, r1 + strh r0, [r4, 0xC] +_080B524E: + add sp, 0x3C + pop {r4-r7,pc} + .align 2, 0 +_080B5254: .4byte sub_80B4BA4 + thumb_func_end sub_80B517C + + thumb_func_start sub_80B5258 +sub_80B5258: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x4 + str r0, [sp] + ldr r0, _080B52CC + ldr r0, [r0, 0x8] + mov r8, r0 + ldr r7, [r0, 0x4] + movs r0, 0x4 + negs r0, r0 + ands r7, r0 + mov r2, r8 + adds r4, r2, r7 + ldr r0, _080B52D0 + ldr r0, [r0] + adds r1, r0 + adds r6, r1, 0 + adds r6, 0x10 + ldr r3, _080B52D4 + mov r10, r3 + ldr r0, [r3] + movs r2, 0x1 + negs r2, r2 + mov r9, r2 + cmp r0, r9 + beq _080B529A + ldr r3, _080B52D8 + adds r6, r1, r3 + ldr r0, _080B52DC + ands r6, r0 +_080B529A: + ldr r0, [sp] + adds r1, r6, 0 + bl _sbrk_r + adds r5, r0, 0 + cmp r5, r9 + beq _080B539C + cmp r5, r4 + bcs _080B52B2 + ldr r0, _080B52CC + cmp r8, r0 + bne _080B539C +_080B52B2: + ldr r1, _080B52E0 + ldr r0, [r1] + adds r2, r0, r6 + str r2, [r1] + cmp r5, r4 + bne _080B52E4 + adds r2, r6, r7 + ldr r3, _080B52CC + ldr r1, [r3, 0x8] + movs r0, 0x1 + orrs r2, r0 + str r2, [r1, 0x4] + b _080B5384 + .align 2, 0 +_080B52CC: .4byte gUnknown_203B7C0 +_080B52D0: .4byte gUnknown_203BBCC +_080B52D4: .4byte gUnknown_203BBD0 +_080B52D8: .4byte 0x0000100f +_080B52DC: .4byte 0xfffff000 +_080B52E0: .4byte gUnknown_203BBDC +_080B52E4: + mov r3, r10 + ldr r0, [r3] + cmp r0, r9 + bne _080B52F0 + str r5, [r3] + b _080B52F6 +_080B52F0: + subs r0, r5, r4 + adds r0, r2, r0 + str r0, [r1] +_080B52F6: + adds r1, r5, 0 + adds r1, 0x8 + movs r0, 0x7 + ands r1, r0 + cmp r1, 0 + beq _080B530A + movs r0, 0x8 + subs r4, r0, r1 + adds r5, r4 + b _080B530C +_080B530A: + movs r4, 0 +_080B530C: + adds r0, r5, r6 + movs r1, 0x80 + lsls r1, 5 + subs r1, 0x1 + ands r0, r1 + movs r1, 0x80 + lsls r1, 5 + subs r0, r1, r0 + adds r4, r0 + ldr r0, [sp] + adds r1, r4, 0 + bl _sbrk_r + adds r2, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r2, r0 + beq _080B539C + ldr r1, _080B5354 + ldr r0, [r1] + adds r0, r4 + str r0, [r1] + ldr r1, _080B5358 + str r5, [r1, 0x8] + subs r0, r2, r5 + adds r2, r0, r4 + movs r3, 0x1 + orrs r2, r3 + str r2, [r5, 0x4] + cmp r8, r1 + beq _080B5384 + cmp r7, 0xF + bhi _080B535C + str r3, [r5, 0x4] + b _080B539C + .align 2, 0 +_080B5354: .4byte gUnknown_203BBDC +_080B5358: .4byte gUnknown_203B7C0 +_080B535C: + subs r7, 0xC + movs r0, 0x8 + negs r0, r0 + ands r7, r0 + mov r2, r8 + ldr r0, [r2, 0x4] + ands r0, r3 + orrs r0, r7 + str r0, [r2, 0x4] + adds r1, r2, r7 + movs r0, 0x5 + str r0, [r1, 0x4] + str r0, [r1, 0x8] + cmp r7, 0xF + bls _080B5384 + mov r1, r8 + adds r1, 0x8 + ldr r0, [sp] + bl _free_r +_080B5384: + ldr r0, _080B53A8 + ldr r2, _080B53AC + ldr r1, [r0] + ldr r0, [r2] + cmp r1, r0 + bls _080B5392 + str r1, [r2] +_080B5392: + ldr r2, _080B53B0 + ldr r0, [r2] + cmp r1, r0 + bls _080B539C + str r1, [r2] +_080B539C: + add sp, 0x4 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7,pc} + .align 2, 0 +_080B53A8: .4byte gUnknown_203BBDC +_080B53AC: .4byte gUnknown_203BBD4 +_080B53B0: .4byte gUnknown_203BBD8 + thumb_func_end sub_80B5258 + + thumb_func_start sub_80B53B4 +sub_80B53B4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + str r0, [sp] + adds r1, 0xB + cmp r1, 0x16 + ble _080B53D6 + movs r0, 0x8 + negs r0, r0 + mov r8, r0 + mov r2, r8 + ands r2, r1 + mov r8, r2 + b _080B53DA +_080B53D6: + movs r3, 0x10 + mov r8, r3 +_080B53DA: + ldr r0, [sp] + bl __malloc_lock + ldr r0, _080B5420 + cmp r8, r0 + bhi _080B542E + mov r4, r8 + lsrs r4, 3 + mov r12, r4 + ldr r0, _080B5424 + mov r7, r8 + adds r2, r7, r0 + ldr r5, [r2, 0xC] + cmp r5, r2 + bne _080B5402 + adds r2, r5, 0 + adds r2, 0x8 + ldr r5, [r2, 0xC] + cmp r5, r2 + beq _080B5428 +_080B5402: + ldr r2, [r5, 0x4] + movs r0, 0x4 + negs r0, r0 + ands r2, r0 + ldr r6, [r5, 0xC] + ldr r4, [r5, 0x8] + str r6, [r4, 0xC] + str r4, [r6, 0x8] + adds r2, r5, r2 + ldr r0, [r2, 0x4] + movs r1, 0x1 + orrs r0, r1 + str r0, [r2, 0x4] + b _080B575A + .align 2, 0 +_080B5420: .4byte 0x000001f7 +_080B5424: .4byte gUnknown_203B7C0 +_080B5428: + movs r0, 0x2 + add r12, r0 + b _080B54DA +_080B542E: + mov r2, r8 + lsrs r1, r2, 9 + cmp r1, 0 + bne _080B543A + lsrs r2, 3 + b _080B548A +_080B543A: + cmp r1, 0x4 + bhi _080B5448 + mov r3, r8 + lsrs r0, r3, 6 + adds r0, 0x38 + mov r12, r0 + b _080B548C +_080B5448: + cmp r1, 0x14 + bhi _080B5452 + adds r1, 0x5B + mov r12, r1 + b _080B548C +_080B5452: + cmp r1, 0x54 + bhi _080B5460 + mov r4, r8 + lsrs r0, r4, 12 + adds r0, 0x6E + mov r12, r0 + b _080B548C +_080B5460: + movs r0, 0xAA + lsls r0, 1 + cmp r1, r0 + bhi _080B5472 + mov r7, r8 + lsrs r0, r7, 15 + adds r0, 0x77 + mov r12, r0 + b _080B548C +_080B5472: + ldr r0, _080B5484 + cmp r1, r0 + bhi _080B5488 + mov r1, r8 + lsrs r0, r1, 18 + adds r0, 0x7C + mov r12, r0 + b _080B548C + .align 2, 0 +_080B5484: .4byte 0x00000554 +_080B5488: + movs r2, 0x7E +_080B548A: + mov r12, r2 +_080B548C: + mov r3, r12 + lsls r0, r3, 3 + ldr r1, _080B54B0 + adds r4, r0, r1 + ldr r5, [r4, 0xC] + cmp r5, r4 + beq _080B54D6 + ldr r1, [r5, 0x4] + movs r0, 0x4 + negs r0, r0 + ands r1, r0 + mov r7, r8 + subs r3, r1, r7 + cmp r3, 0xF + ble _080B54B4 + adds r0, 0x3 + add r12, r0 + b _080B54D6 + .align 2, 0 +_080B54B0: .4byte gUnknown_203B7C0 +_080B54B4: + cmp r3, 0 + blt _080B54BA + b _080B56F4 +_080B54BA: + ldr r5, [r5, 0xC] + cmp r5, r4 + beq _080B54D6 + ldr r1, [r5, 0x4] + movs r0, 0x4 + negs r0, r0 + ands r1, r0 + mov r2, r8 + subs r3, r1, r2 + cmp r3, 0xF + ble _080B54B4 + movs r3, 0x1 + negs r3, r3 + add r12, r3 +_080B54D6: + movs r4, 0x1 + add r12, r4 +_080B54DA: + ldr r0, _080B5518 + ldr r5, [r0, 0x8] + mov r10, r0 + cmp r5, r10 + bne _080B54E6 + b _080B55E8 +_080B54E6: + ldr r1, [r5, 0x4] + movs r0, 0x4 + negs r0, r0 + ands r1, r0 + mov r7, r8 + subs r3, r1, r7 + cmp r3, 0xF + ble _080B551C + adds r2, r5, r7 + movs r1, 0x1 + adds r0, r7, 0 + orrs r0, r1 + str r0, [r5, 0x4] + mov r4, r10 + str r2, [r4, 0xC] + str r2, [r4, 0x8] + str r4, [r2, 0xC] + str r4, [r2, 0x8] + adds r0, r3, 0 + orrs r0, r1 + str r0, [r2, 0x4] + adds r0, r2, r3 + str r3, [r0] + b _080B575A + .align 2, 0 +_080B5518: .4byte gUnknown_203B7C8 +_080B551C: + mov r7, r10 + str r7, [r7, 0xC] + str r7, [r7, 0x8] + cmp r3, 0 + blt _080B5532 + adds r2, r5, r1 + ldr r0, [r2, 0x4] + movs r1, 0x1 + orrs r0, r1 + str r0, [r2, 0x4] + b _080B575A +_080B5532: + ldr r0, _080B5554 + cmp r1, r0 + bhi _080B5558 + lsrs r2, r1, 3 + mov r3, r10 + subs r3, 0x8 + adds r0, r2, 0 + asrs r0, 2 + movs r1, 0x1 + lsls r1, r0 + ldr r0, [r3, 0x4] + orrs r0, r1 + str r0, [r3, 0x4] + lsls r0, r2, 3 + adds r6, r0, r3 + ldr r4, [r6, 0x8] + b _080B55E0 + .align 2, 0 +_080B5554: .4byte 0x000001ff +_080B5558: + lsrs r2, r1, 9 + cmp r2, 0 + bne _080B5562 + lsrs r2, r1, 3 + b _080B55A6 +_080B5562: + cmp r2, 0x4 + bhi _080B556E + lsrs r0, r1, 6 + adds r2, r0, 0 + adds r2, 0x38 + b _080B55A6 +_080B556E: + cmp r2, 0x14 + bhi _080B5576 + adds r2, 0x5B + b _080B55A6 +_080B5576: + cmp r2, 0x54 + bhi _080B5582 + lsrs r0, r1, 12 + adds r2, r0, 0 + adds r2, 0x6E + b _080B55A6 +_080B5582: + movs r0, 0xAA + lsls r0, 1 + cmp r2, r0 + bhi _080B5592 + lsrs r0, r1, 15 + adds r2, r0, 0 + adds r2, 0x77 + b _080B55A6 +_080B5592: + ldr r0, _080B55A0 + cmp r2, r0 + bhi _080B55A4 + lsrs r0, r1, 18 + adds r2, r0, 0 + adds r2, 0x7C + b _080B55A6 + .align 2, 0 +_080B55A0: .4byte 0x00000554 +_080B55A4: + movs r2, 0x7E +_080B55A6: + lsls r0, r2, 3 + ldr r3, _080B55C4 + adds r6, r0, r3 + ldr r4, [r6, 0x8] + cmp r4, r6 + bne _080B55C8 + adds r0, r2, 0 + asrs r0, 2 + movs r1, 0x1 + lsls r1, r0 + ldr r7, _080B55C4 + ldr r0, [r7, 0x4] + orrs r0, r1 + str r0, [r7, 0x4] + b _080B55E0 + .align 2, 0 +_080B55C4: .4byte gUnknown_203B7C0 +_080B55C8: + ldr r0, [r4, 0x4] + movs r2, 0x4 + negs r2, r2 + b _080B55D8 +_080B55D0: + ldr r4, [r4, 0x8] + cmp r4, r6 + beq _080B55DE + ldr r0, [r4, 0x4] +_080B55D8: + ands r0, r2 + cmp r1, r0 + bcc _080B55D0 +_080B55DE: + ldr r6, [r4, 0xC] +_080B55E0: + str r6, [r5, 0xC] + str r4, [r5, 0x8] + str r5, [r6, 0x8] + str r5, [r4, 0xC] +_080B55E8: + mov r0, r12 + cmp r0, 0 + bge _080B55F0 + adds r0, 0x3 +_080B55F0: + asrs r0, 2 + movs r6, 0x1 + lsls r6, r0 + ldr r0, _080B5614 + ldr r1, [r0, 0x4] + cmp r6, r1 + bhi _080B56B2 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _080B5626 + movs r0, 0x4 + negs r0, r0 + mov r2, r12 + ands r0, r2 + adds r0, 0x4 + mov r12, r0 + b _080B561C + .align 2, 0 +_080B5614: .4byte gUnknown_203B7C0 +_080B5618: + movs r3, 0x4 + add r12, r3 +_080B561C: + lsls r6, 1 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _080B5618 +_080B5626: + ldr r4, _080B56A4 + mov r9, r4 +_080B562A: + mov r7, r12 + str r7, [sp, 0x4] + mov r1, r12 + lsls r0, r1, 3 + mov r3, r9 + adds r2, r0, r3 + adds r4, r2, 0 +_080B5638: + ldr r5, [r4, 0xC] + cmp r5, r4 + beq _080B5658 + movs r0, 0x4 + negs r0, r0 +_080B5642: + ldr r1, [r5, 0x4] + ands r1, r0 + mov r7, r8 + subs r3, r1, r7 + cmp r3, 0xF + bgt _080B5708 + cmp r3, 0 + bge _080B5730 + ldr r5, [r5, 0xC] + cmp r5, r4 + bne _080B5642 +_080B5658: + adds r4, 0x8 + movs r0, 0x1 + add r12, r0 + mov r0, r12 + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _080B5638 +_080B5668: + ldr r0, [sp, 0x4] + ands r0, r1 + cmp r0, 0 + beq _080B56A8 + ldr r3, [sp, 0x4] + subs r3, 0x1 + str r3, [sp, 0x4] + subs r2, 0x8 + ldr r0, [r2, 0x8] + cmp r0, r2 + beq _080B5668 +_080B567E: + lsls r6, 1 + mov r4, r9 + ldr r1, [r4, 0x4] + cmp r6, r1 + bhi _080B56B2 + cmp r6, 0 + beq _080B56B2 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + bne _080B562A +_080B5694: + movs r7, 0x4 + add r12, r7 + lsls r6, 1 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _080B5694 + b _080B562A + .align 2, 0 +_080B56A4: .4byte gUnknown_203B7C0 +_080B56A8: + mov r1, r9 + ldr r0, [r1, 0x4] + bics r0, r6 + str r0, [r1, 0x4] + b _080B567E +_080B56B2: + ldr r2, _080B56F0 + ldr r0, [r2, 0x8] + ldr r0, [r0, 0x4] + movs r4, 0x4 + negs r4, r4 + ands r0, r4 + mov r7, r8 + subs r3, r0, r7 + cmp r0, r8 + bcc _080B56CA + cmp r3, 0xF + bgt _080B5744 +_080B56CA: + ldr r0, [sp] + mov r1, r8 + bl sub_80B5258 + ldr r1, _080B56F0 + ldr r0, [r1, 0x8] + ldr r0, [r0, 0x4] + ands r0, r4 + mov r2, r8 + subs r3, r0, r2 + cmp r0, r8 + bcc _080B56E6 + cmp r3, 0xF + bgt _080B5744 +_080B56E6: + ldr r0, [sp] + bl nullsub_127 + movs r0, 0 + b _080B5764 + .align 2, 0 +_080B56F0: .4byte gUnknown_203B7C0 +_080B56F4: + ldr r6, [r5, 0xC] + ldr r4, [r5, 0x8] + str r6, [r4, 0xC] + str r4, [r6, 0x8] + adds r2, r5, r1 + ldr r0, [r2, 0x4] + movs r1, 0x1 + orrs r0, r1 + str r0, [r2, 0x4] + b _080B575A +_080B5708: + mov r4, r8 + adds r2, r5, r4 + movs r1, 0x1 + orrs r4, r1 + str r4, [r5, 0x4] + ldr r6, [r5, 0xC] + ldr r4, [r5, 0x8] + str r6, [r4, 0xC] + str r4, [r6, 0x8] + mov r7, r10 + str r2, [r7, 0xC] + str r2, [r7, 0x8] + str r7, [r2, 0xC] + str r7, [r2, 0x8] + adds r0, r3, 0 + orrs r0, r1 + str r0, [r2, 0x4] + adds r0, r2, r3 + str r3, [r0] + b _080B575A +_080B5730: + adds r2, r5, r1 + ldr r0, [r2, 0x4] + movs r1, 0x1 + orrs r0, r1 + str r0, [r2, 0x4] + ldr r6, [r5, 0xC] + ldr r4, [r5, 0x8] + str r6, [r4, 0xC] + str r4, [r6, 0x8] + b _080B575A +_080B5744: + ldr r2, _080B5770 + ldr r5, [r2, 0x8] + movs r1, 0x1 + mov r0, r8 + orrs r0, r1 + str r0, [r5, 0x4] + mov r4, r8 + adds r0, r5, r4 + str r0, [r2, 0x8] + orrs r3, r1 + str r3, [r0, 0x4] +_080B575A: + ldr r0, [sp] + bl nullsub_127 + adds r0, r5, 0 + adds r0, 0x8 +_080B5764: + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7,pc} + .align 2, 0 +_080B5770: .4byte gUnknown_203B7C0 + thumb_func_end sub_80B53B4 + + thumb_func_start sub_80B5774 +sub_80B5774: + sub sp, 0x4 + cmp r1, 0 + bne _080B577C + mov r1, sp +_080B577C: + cmp r2, 0 + beq _080B5798 + cmp r3, 0 + bne _080B578A + movs r0, 0x1 + negs r0, r0 + b _080B579A +_080B578A: + ldrb r0, [r2] + str r0, [r1] + ldrb r0, [r2] + cmp r0, 0 + beq _080B5798 + movs r0, 0x1 + b _080B579A +_080B5798: + movs r0, 0 +_080B579A: + add sp, 0x4 + bx lr + thumb_func_end sub_80B5774 + + thumb_func_start sub_80B57A0 +sub_80B57A0: + push {r4-r7,lr} + adds r5, r1, 0 + adds r1, r0, 0 + movs r0, 0xFF + ands r5, r0 + cmp r2, 0x3 + bls _080B5814 + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _080B5814 + adds r4, r1, 0 + movs r6, 0 + movs r1, 0 +_080B57BC: + lsls r0, r6, 8 + adds r6, r0, r5 + adds r1, 0x1 + cmp r1, 0x3 + bls _080B57BC + cmp r2, 0x3 + bls _080B57FA + ldr r0, _080B5800 + mov r12, r0 + ldr r7, _080B5804 +_080B57D0: + ldr r1, [r4] + eors r1, r6 + mov r3, r12 + adds r0, r1, r3 + bics r0, r1 + ands r0, r7 + cmp r0, 0 + beq _080B57F2 + adds r1, r4, 0 + movs r3, 0 +_080B57E4: + ldrb r0, [r1] + cmp r0, r5 + beq _080B580E + adds r1, 0x1 + adds r3, 0x1 + cmp r3, 0x3 + bls _080B57E4 +_080B57F2: + subs r2, 0x4 + adds r4, 0x4 + cmp r2, 0x3 + bhi _080B57D0 +_080B57FA: + adds r1, r4, 0 + b _080B5814 + .align 2, 0 +_080B5800: .4byte 0xfefefeff +_080B5804: .4byte 0x80808080 +_080B5808: + ldrb r0, [r1] + cmp r0, r5 + bne _080B5812 +_080B580E: + adds r0, r1, 0 + b _080B581E +_080B5812: + adds r1, 0x1 +_080B5814: + adds r0, r2, 0 + subs r2, 0x1 + cmp r0, 0 + bne _080B5808 + movs r0, 0 +_080B581E: + pop {r4-r7,pc} + thumb_func_end sub_80B57A0 + + thumb_func_start sub_80B5820 +sub_80B5820: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r5, 0 + adds r3, r1, 0 + cmp r3, r5 + bcs _080B5852 + adds r0, r3, r2 + cmp r5, r0 + bcs _080B5852 + adds r3, r0, 0 + adds r4, r5, r2 + subs r2, 0x1 + movs r0, 0x1 + negs r0, r0 + cmp r2, r0 + beq _080B58A4 + adds r1, r0, 0 +_080B5842: + subs r4, 0x1 + subs r3, 0x1 + ldrb r0, [r3] + strb r0, [r4] + subs r2, 0x1 + cmp r2, r1 + bne _080B5842 + b _080B58A4 +_080B5852: + cmp r2, 0xF + bls _080B588A + adds r0, r3, 0 + orrs r0, r4 + movs r1, 0x3 + ands r0, r1 + cmp r0, 0 + bne _080B588A + adds r1, r3, 0 +_080B5864: + ldm r1!, {r0} + stm r4!, {r0} + ldm r1!, {r0} + stm r4!, {r0} + ldm r1!, {r0} + stm r4!, {r0} + ldm r1!, {r0} + stm r4!, {r0} + subs r2, 0x10 + cmp r2, 0xF + bhi _080B5864 + cmp r2, 0x3 + bls _080B5888 +_080B587E: + ldm r1!, {r0} + stm r4!, {r0} + subs r2, 0x4 + cmp r2, 0x3 + bhi _080B587E +_080B5888: + adds r3, r1, 0 +_080B588A: + subs r2, 0x1 + movs r0, 0x1 + negs r0, r0 + cmp r2, r0 + beq _080B58A4 + adds r1, r0, 0 +_080B5896: + ldrb r0, [r3] + strb r0, [r4] + adds r3, 0x1 + adds r4, 0x1 + subs r2, 0x1 + cmp r2, r1 + bne _080B5896 +_080B58A4: + adds r0, r5, 0 + pop {r4,r5,pc} + thumb_func_end sub_80B5820 + + thumb_func_start __malloc_lock +__malloc_lock: + bx lr + thumb_func_end __malloc_lock + + thumb_func_start nullsub_127 +nullsub_127: + bx lr + thumb_func_end nullsub_127 + + thumb_func_start sub_80B58B0 +sub_80B58B0: + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + ldr r0, [r4, 0x4C] + cmp r0, 0 + bne _080B58CC + adds r0, r4, 0 + movs r1, 0x4 + movs r2, 0x10 + bl sub_80B6748 + str r0, [r4, 0x4C] + cmp r0, 0 + beq _080B58F4 +_080B58CC: + ldr r1, [r4, 0x4C] + lsls r0, r6, 2 + adds r2, r0, r1 + ldr r1, [r2] + cmp r1, 0 + beq _080B58DE + ldr r0, [r1] + str r0, [r2] + b _080B58FC +_080B58DE: + movs r5, 0x1 + lsls r5, r6 + lsls r2, r5, 2 + adds r2, 0x14 + adds r0, r4, 0 + movs r1, 0x1 + bl sub_80B6748 + adds r1, r0, 0 + cmp r1, 0 + bne _080B58F8 +_080B58F4: + movs r0, 0 + b _080B5904 +_080B58F8: + str r6, [r1, 0x4] + str r5, [r1, 0x8] +_080B58FC: + movs r0, 0 + str r0, [r1, 0x10] + str r0, [r1, 0xC] + adds r0, r1, 0 +_080B5904: + pop {r4-r6,pc} + thumb_func_end sub_80B58B0 + + thumb_func_start sub_80B5908 +sub_80B5908: + adds r3, r0, 0 + adds r2, r1, 0 + cmp r2, 0 + beq _080B591E + ldr r0, [r2, 0x4] + ldr r1, [r3, 0x4C] + lsls r0, 2 + adds r0, r1 + ldr r1, [r0] + str r1, [r2] + str r2, [r0] +_080B591E: + bx lr + thumb_func_end sub_80B5908 + + thumb_func_start sub_80B5920 +sub_80B5920: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + mov r9, r0 + adds r5, r1, 0 + adds r4, r2, 0 + mov r8, r3 + ldr r6, [r5, 0x10] + adds r3, r5, 0 + adds r3, 0x14 + movs r7, 0 + ldr r0, _080B59B4 + mov r12, r0 +_080B593C: + ldr r1, [r3] + adds r0, r1, 0 + mov r2, r12 + ands r0, r2 + adds r2, r0, 0 + muls r2, r4 + add r2, r8 + lsrs r1, 16 + adds r0, r1, 0 + muls r0, r4 + lsrs r1, r2, 16 + adds r0, r1 + lsrs r1, r0, 16 + mov r8, r1 + lsls r0, 16 + mov r1, r12 + ands r2, r1 + adds r0, r2 + stm r3!, {r0} + adds r7, 0x1 + cmp r7, r6 + blt _080B593C + mov r2, r8 + cmp r2, 0 + beq _080B59AA + ldr r0, [r5, 0x8] + cmp r6, r0 + blt _080B599A + ldr r1, [r5, 0x4] + adds r1, 0x1 + mov r0, r9 + bl sub_80B58B0 + adds r4, r0, 0 + adds r0, 0xC + adds r1, r5, 0 + adds r1, 0xC + ldr r2, [r5, 0x10] + lsls r2, 2 + adds r2, 0x8 + bl memcpy + mov r0, r9 + adds r1, r5, 0 + bl sub_80B5908 + adds r5, r4, 0 +_080B599A: + lsls r1, r6, 2 + adds r0, r5, 0 + adds r0, 0x14 + adds r0, r1 + mov r1, r8 + str r1, [r0] + adds r6, 0x1 + str r6, [r5, 0x10] +_080B59AA: + adds r0, r5, 0 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7,pc} + .align 2, 0 +_080B59B4: .4byte 0x0000ffff + thumb_func_end sub_80B5920 + + thumb_func_start sub_80B59B8 +sub_80B59B8: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r7, r0, 0 + adds r4, r1, 0 + adds r6, r2, 0 + mov r8, r3 + mov r0, r8 + adds r0, 0x8 + movs r1, 0x9 + bl __divsi3 + movs r1, 0 + movs r2, 0x1 + cmp r0, 0x1 + ble _080B59E0 +_080B59D8: + lsls r2, 1 + adds r1, 0x1 + cmp r0, r2 + bgt _080B59D8 +_080B59E0: + adds r0, r7, 0 + bl sub_80B58B0 + adds r1, r0, 0 + ldr r0, [sp, 0x18] + str r0, [r1, 0x14] + movs r0, 0x1 + str r0, [r1, 0x10] + movs r5, 0x9 + cmp r6, 0x9 + ble _080B5A12 + adds r4, 0x9 +_080B59F8: + ldrb r3, [r4] + subs r3, 0x30 + adds r4, 0x1 + adds r0, r7, 0 + movs r2, 0xA + bl sub_80B5920 + adds r1, r0, 0 + adds r5, 0x1 + cmp r5, r6 + blt _080B59F8 + adds r4, 0x1 + b _080B5A14 +_080B5A12: + adds r4, 0xA +_080B5A14: + cmp r5, r8 + bge _080B5A32 + mov r0, r8 + subs r5, r0, r5 +_080B5A1C: + ldrb r3, [r4] + subs r3, 0x30 + adds r4, 0x1 + adds r0, r7, 0 + movs r2, 0xA + bl sub_80B5920 + adds r1, r0, 0 + subs r5, 0x1 + cmp r5, 0 + bne _080B5A1C +_080B5A32: + adds r0, r1, 0 + pop {r3} + mov r8, r3 + pop {r4-r7,pc} + thumb_func_end sub_80B59B8 + + thumb_func_start sub_80B5A3C +sub_80B5A3C: + adds r1, r0, 0 + movs r2, 0 + ldr r0, _080B5A8C + ands r0, r1 + cmp r0, 0 + bne _080B5A4C + movs r2, 0x10 + lsls r1, 16 +_080B5A4C: + movs r0, 0xFF + lsls r0, 24 + ands r0, r1 + cmp r0, 0 + bne _080B5A5A + adds r2, 0x8 + lsls r1, 8 +_080B5A5A: + movs r0, 0xF0 + lsls r0, 24 + ands r0, r1 + cmp r0, 0 + bne _080B5A68 + adds r2, 0x4 + lsls r1, 4 +_080B5A68: + movs r0, 0xC0 + lsls r0, 24 + ands r0, r1 + cmp r0, 0 + bne _080B5A76 + adds r2, 0x2 + lsls r1, 2 +_080B5A76: + cmp r1, 0 + blt _080B5A90 + adds r2, 0x1 + movs r0, 0x80 + lsls r0, 23 + ands r0, r1 + cmp r0, 0 + bne _080B5A90 + movs r0, 0x20 + b _080B5A92 + .align 2, 0 +_080B5A8C: .4byte 0xffff0000 +_080B5A90: + adds r0, r2, 0 +_080B5A92: + bx lr + thumb_func_end sub_80B5A3C + + thumb_func_start sub_80B5A94 +sub_80B5A94: + adds r3, r0, 0 + ldr r1, [r3] + movs r0, 0x7 + ands r0, r1 + cmp r0, 0 + beq _080B5AC4 + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _080B5AAC + movs r0, 0 + b _080B5B14 +_080B5AAC: + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080B5ABC + lsrs r0, r1, 1 + str r0, [r3] + movs r0, 0x1 + b _080B5B14 +_080B5ABC: + lsrs r0, r1, 2 + str r0, [r3] + movs r0, 0x2 + b _080B5B14 +_080B5AC4: + movs r2, 0 + ldr r0, _080B5B0C + ands r0, r1 + cmp r0, 0 + bne _080B5AD2 + movs r2, 0x10 + lsrs r1, 16 +_080B5AD2: + movs r0, 0xFF + ands r0, r1 + cmp r0, 0 + bne _080B5ADE + adds r2, 0x8 + lsrs r1, 8 +_080B5ADE: + movs r0, 0xF + ands r0, r1 + cmp r0, 0 + bne _080B5AEA + adds r2, 0x4 + lsrs r1, 4 +_080B5AEA: + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + bne _080B5AF6 + adds r2, 0x2 + lsrs r1, 2 +_080B5AF6: + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + bne _080B5B10 + adds r2, 0x1 + lsrs r1, 1 + cmp r1, 0 + bne _080B5B10 + movs r0, 0x20 + b _080B5B14 + .align 2, 0 +_080B5B0C: .4byte 0x0000ffff +_080B5B10: + str r1, [r3] + adds r0, r2, 0 +_080B5B14: + bx lr + thumb_func_end sub_80B5A94 + + thumb_func_start sub_80B5B18 +sub_80B5B18: + push {r4,lr} + adds r4, r1, 0 + movs r1, 0x1 + bl sub_80B58B0 + str r4, [r0, 0x14] + movs r1, 0x1 + str r1, [r0, 0x10] + pop {r4,pc} + thumb_func_end sub_80B5B18 + + thumb_func_start sub_80B5B2C +sub_80B5B2C: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x24 + adds r3, r0, 0 + adds r4, r1, 0 + adds r5, r2, 0 + ldr r1, [r4, 0x10] + ldr r0, [r5, 0x10] + cmp r1, r0 + bge _080B5B4C + str r4, [sp] + adds r4, r5, 0 + ldr r5, [sp] +_080B5B4C: + ldr r1, [r4, 0x4] + ldr r6, [r4, 0x10] + ldr r0, [r5, 0x10] + mov r8, r0 + mov r2, r8 + adds r2, r6, r2 + str r2, [sp, 0x4] + ldr r0, [r4, 0x8] + cmp r2, r0 + ble _080B5B62 + adds r1, 0x1 +_080B5B62: + adds r0, r3, 0 + bl sub_80B58B0 + str r0, [sp] + adds r7, r0, 0 + adds r7, 0x14 + ldr r1, [sp, 0x4] + lsls r0, r1, 2 + adds r2, r7, r0 + str r2, [sp, 0x8] + str r0, [sp, 0x18] + adds r1, r4, 0 + adds r1, 0x14 + lsls r3, r6, 2 + adds r2, r5, 0 + adds r2, 0x14 + mov r5, r8 + lsls r4, r5, 2 + ldr r0, [sp, 0x8] + cmp r7, r0 + bcs _080B5B96 + movs r0, 0 +_080B5B8E: + stm r7!, {r0} + ldr r5, [sp, 0x8] + cmp r7, r5 + bcc _080B5B8E +_080B5B96: + str r1, [sp, 0x8] + adds r3, r1, r3 + str r3, [sp, 0xC] + mov r8, r2 + add r4, r8 + str r4, [sp, 0x10] + ldr r0, [sp] + adds r0, 0x14 + mov r9, r0 + mov r1, r9 + str r1, [sp, 0x20] + cmp r8, r4 + bcs _080B5C5E +_080B5BB0: + mov r2, r8 + ldm r2!, {r6} + str r2, [sp, 0x14] + ldr r0, _080B5C6C + ands r6, r0 + mov r4, r9 + adds r4, 0x4 + str r4, [sp, 0x1C] + cmp r6, 0 + beq _080B5C08 + ldr r7, [sp, 0x8] + mov r5, r9 + movs r1, 0 + mov r12, r1 + mov r10, r0 +_080B5BCE: + ldm r7!, {r3} + adds r0, r3, 0 + mov r2, r10 + ands r0, r2 + adds r1, r0, 0 + muls r1, r6 + ldr r2, [r5] + adds r0, r2, 0 + mov r4, r10 + ands r0, r4 + adds r1, r0 + mov r0, r12 + adds r4, r1, r0 + lsrs r1, r4, 16 + lsrs r3, 16 + adds r0, r3, 0 + muls r0, r6 + lsrs r2, 16 + adds r0, r2 + adds r2, r0, r1 + lsrs r0, r2, 16 + mov r12, r0 + strh r2, [r5] + strh r4, [r5, 0x2] + adds r5, 0x4 + ldr r1, [sp, 0xC] + cmp r7, r1 + bcc _080B5BCE + str r0, [r5] +_080B5C08: + mov r2, r8 + ldrh r6, [r2, 0x2] + cmp r6, 0 + beq _080B5C50 + ldr r7, [sp, 0x8] + mov r5, r9 + movs r4, 0 + mov r12, r4 + ldr r2, [r5] + ldr r3, _080B5C6C +_080B5C1C: + ldm r7!, {r1} + adds r0, r1, 0 + ands r0, r3 + muls r0, r6 + ldrh r4, [r5, 0x2] + adds r4, r0 + mov r8, r4 + add r4, r12 + lsrs r0, r4, 16 + mov r12, r0 + strh r4, [r5] + strh r2, [r5, 0x2] + adds r5, 0x4 + lsrs r1, 16 + muls r1, r6 + ldr r0, [r5] + ands r0, r3 + adds r1, r0 + mov r4, r12 + adds r2, r1, r4 + lsrs r0, r2, 16 + mov r12, r0 + ldr r1, [sp, 0xC] + cmp r7, r1 + bcc _080B5C1C + str r2, [r5] +_080B5C50: + ldr r2, [sp, 0x14] + mov r8, r2 + ldr r4, [sp, 0x1C] + mov r9, r4 + ldr r5, [sp, 0x10] + cmp r8, r5 + bcc _080B5BB0 +_080B5C5E: + ldr r0, [sp, 0x20] + ldr r1, [sp, 0x18] + adds r5, r0, r1 + ldr r2, [sp, 0x4] + cmp r2, 0 + ble _080B5C82 + b _080B5C7A + .align 2, 0 +_080B5C6C: .4byte 0x0000ffff +_080B5C70: + ldr r4, [sp, 0x4] + subs r4, 0x1 + str r4, [sp, 0x4] + cmp r4, 0 + ble _080B5C82 +_080B5C7A: + subs r5, 0x4 + ldr r0, [r5] + cmp r0, 0 + beq _080B5C70 +_080B5C82: + ldr r5, [sp, 0x4] + ldr r0, [sp] + str r5, [r0, 0x10] + ldr r0, [sp] + add sp, 0x24 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7,pc} + thumb_func_end sub_80B5B2C + + thumb_func_start sub_80B5C98 +sub_80B5C98: + push {r4-r7,lr} + mov r7, r8 + push {r7} + mov r8, r0 + adds r7, r1, 0 + adds r6, r2, 0 + movs r1, 0x3 + ands r1, r6 + cmp r1, 0 + beq _080B5CC2 + ldr r0, _080B5CE4 + subs r1, 0x1 + lsls r1, 2 + adds r1, r0 + ldr r2, [r1] + mov r0, r8 + adds r1, r7, 0 + movs r3, 0 + bl sub_80B5920 + adds r7, r0, 0 +_080B5CC2: + asrs r6, 2 + cmp r6, 0 + beq _080B5D28 + mov r0, r8 + ldr r5, [r0, 0x48] + adds r4, r5, 0 + cmp r5, 0 + bne _080B5D04 + ldr r1, _080B5CE8 + bl sub_80B5B18 + mov r1, r8 + str r0, [r1, 0x48] + adds r5, r0, 0 + str r4, [r5] + b _080B5D04 + .align 2, 0 +_080B5CE4: .4byte gUnknown_826FEB4 +_080B5CE8: .4byte 0x00000271 +_080B5CEC: + ldr r0, [r5] + adds r4, r0, 0 + cmp r0, 0 + bne _080B5D02 + mov r0, r8 + adds r1, r5, 0 + adds r2, r5, 0 + bl sub_80B5B2C + str r0, [r5] + str r4, [r0] +_080B5D02: + adds r5, r0, 0 +_080B5D04: + movs r0, 0x1 + ands r0, r6 + cmp r0, 0 + beq _080B5D22 + mov r0, r8 + adds r1, r7, 0 + adds r2, r5, 0 + bl sub_80B5B2C + adds r4, r0, 0 + mov r0, r8 + adds r1, r7, 0 + bl sub_80B5908 + adds r7, r4, 0 +_080B5D22: + asrs r6, 1 + cmp r6, 0 + bne _080B5CEC +_080B5D28: + adds r0, r7, 0 + pop {r3} + mov r8, r3 + pop {r4-r7,pc} + thumb_func_end sub_80B5C98 + + thumb_func_start sub_80B5D30 +sub_80B5D30: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + mov r10, r0 + mov r8, r1 + adds r5, r2, 0 + asrs r6, r5, 5 + ldr r1, [r1, 0x4] + mov r2, r8 + ldr r0, [r2, 0x10] + adds r0, r6, r0 + adds r7, r0, 0x1 + ldr r2, [r2, 0x8] + cmp r7, r2 + ble _080B5D5A +_080B5D52: + adds r1, 0x1 + lsls r2, 1 + cmp r7, r2 + bgt _080B5D52 +_080B5D5A: + mov r0, r10 + bl sub_80B58B0 + mov r9, r0 + mov r4, r9 + adds r4, 0x14 + mov r0, r8 + adds r0, 0x14 + cmp r6, 0 + ble _080B5D7A + movs r1, 0 + adds r2, r6, 0 +_080B5D72: + stm r4!, {r1} + subs r2, 0x1 + cmp r2, 0 + bne _080B5D72 +_080B5D7A: + adds r3, r0, 0 + mov r1, r8 + ldr r0, [r1, 0x10] + lsls r0, 2 + adds r6, r3, r0 + movs r0, 0x1F + ands r5, r0 + cmp r5, 0 + beq _080B5DAC + movs r0, 0x20 + subs r1, r0, r5 + movs r2, 0 +_080B5D92: + ldr r0, [r3] + lsls r0, r5 + orrs r0, r2 + stm r4!, {r0} + ldm r3!, {r2} + lsrs r2, r1 + cmp r3, r6 + bcc _080B5D92 + str r2, [r4] + cmp r2, 0 + beq _080B5DB4 + adds r7, 0x1 + b _080B5DB4 +_080B5DAC: + ldm r3!, {r0} + stm r4!, {r0} + cmp r3, r6 + bcc _080B5DAC +_080B5DB4: + subs r0, r7, 0x1 + mov r2, r9 + str r0, [r2, 0x10] + mov r0, r10 + mov r1, r8 + bl sub_80B5908 + mov r0, r9 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7,pc} + thumb_func_end sub_80B5D30 + + thumb_func_start sub_80B5DD0 +sub_80B5DD0: + push {r4,r5,lr} + adds r2, r0, 0 + adds r5, r1, 0 + ldr r0, [r2, 0x10] + ldr r1, [r5, 0x10] + subs r0, r1 + cmp r0, 0 + bne _080B5E0C + adds r4, r2, 0 + adds r4, 0x14 + lsls r1, 2 + adds r3, r4, r1 + adds r0, r5, 0 + adds r0, 0x14 + adds r1, r0, r1 +_080B5DEE: + subs r3, 0x4 + subs r1, 0x4 + ldr r0, [r3] + ldr r2, [r1] + cmp r0, r2 + beq _080B5E06 + movs r1, 0x1 + cmp r0, r2 + bcs _080B5E02 + subs r1, 0x2 +_080B5E02: + adds r0, r1, 0 + b _080B5E0C +_080B5E06: + cmp r3, r4 + bhi _080B5DEE + movs r0, 0 +_080B5E0C: + pop {r4,r5,pc} + thumb_func_end sub_80B5DD0 + + thumb_func_start sub_80B5E10 +sub_80B5E10: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + adds r6, r0, 0 + adds r5, r1, 0 + mov r8, r2 + adds r0, r5, 0 + mov r1, r8 + bl sub_80B5DD0 + adds r4, r0, 0 + cmp r4, 0 + bne _080B5E42 + adds r0, r6, 0 + movs r1, 0 + bl sub_80B58B0 + adds r7, r0, 0 + movs r0, 0x1 + str r0, [r7, 0x10] + str r4, [r7, 0x14] + b _080B5EF2 +_080B5E42: + cmp r4, 0 + bge _080B5E50 + adds r7, r5, 0 + mov r5, r8 + mov r8, r7 + movs r4, 0x1 + b _080B5E52 +_080B5E50: + movs r4, 0 +_080B5E52: + ldr r1, [r5, 0x4] + adds r0, r6, 0 + bl sub_80B58B0 + adds r7, r0, 0 + str r4, [r7, 0xC] + ldr r0, [r5, 0x10] + mov r9, r0 + adds r6, r5, 0 + adds r6, 0x14 + lsls r0, 2 + adds r0, r6 + mov r10, r0 + mov r1, r8 + ldr r0, [r1, 0x10] + movs r3, 0x14 + add r3, r8 + mov r12, r3 + lsls r0, 2 + add r0, r12 + str r0, [sp] + adds r4, r7, 0 + adds r4, 0x14 + movs r5, 0 + ldr r0, _080B5EDC + mov r8, r0 +_080B5E86: + ldm r6!, {r1} + str r1, [sp, 0x4] + mov r3, r8 + ands r1, r3 + mov r0, r12 + adds r0, 0x4 + mov r12, r0 + subs r0, 0x4 + ldm r0!, {r2} + adds r0, r2, 0 + ands r0, r3 + subs r1, r0 + adds r0, r1, r5 + asrs r5, r0, 16 + ldr r1, [sp, 0x4] + lsrs r3, r1, 16 + lsrs r2, 16 + subs r3, r2 + adds r1, r3, r5 + asrs r5, r1, 16 + strh r1, [r4] + strh r0, [r4, 0x2] + adds r4, 0x4 + ldr r3, [sp] + cmp r12, r3 + bcc _080B5E86 + cmp r6, r10 + bcs _080B5EE6 + ldr r2, _080B5EDC +_080B5EC0: + ldm r6!, {r1} + adds r0, r1, 0 + ands r0, r2 + adds r0, r5 + asrs r5, r0, 16 + lsrs r1, 16 + adds r1, r5 + asrs r5, r1, 16 + strh r1, [r4] + strh r0, [r4, 0x2] + adds r4, 0x4 + cmp r6, r10 + bcc _080B5EC0 + b _080B5EE6 + .align 2, 0 +_080B5EDC: .4byte 0x0000ffff +_080B5EE0: + movs r0, 0x1 + negs r0, r0 + add r9, r0 +_080B5EE6: + subs r4, 0x4 + ldr r0, [r4] + cmp r0, 0 + beq _080B5EE0 + mov r1, r9 + str r1, [r7, 0x10] +_080B5EF2: + adds r0, r7, 0 + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7,pc} + thumb_func_end sub_80B5E10 + + thumb_func_start sub_80B5F00 +sub_80B5F00: + push {r4,lr} + ldr r2, _080B5F14 + ands r2, r0 + ldr r0, _080B5F18 + adds r2, r0 + cmp r2, 0 + ble _080B5F1C + adds r3, r2, 0 + movs r4, 0 + b _080B5F46 + .align 2, 0 +_080B5F14: .4byte 0x7ff00000 +_080B5F18: .4byte 0xfcc00000 +_080B5F1C: + negs r0, r2 + asrs r2, r0, 20 + cmp r2, 0x13 + bgt _080B5F30 + movs r0, 0x80 + lsls r0, 12 + adds r3, r0, 0 + asrs r3, r2 + movs r4, 0 + b _080B5F46 +_080B5F30: + movs r3, 0 + subs r2, 0x14 + cmp r2, 0x1E + bgt _080B5F42 + movs r0, 0x1F + subs r0, r2 + movs r1, 0x1 + lsls r1, r0 + b _080B5F44 +_080B5F42: + movs r1, 0x1 +_080B5F44: + adds r4, r1, 0 +_080B5F46: + adds r1, r4, 0 + adds r0, r3, 0 + pop {r4,pc} + thumb_func_end sub_80B5F00 + + thumb_func_start sub_80B5F4C +sub_80B5F4C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x4 + adds r4, r1, 0 + movs r1, 0x14 + adds r1, r0 + mov r8, r1 + ldr r0, [r0, 0x10] + lsls r0, 2 + adds r5, r1, r0 + subs r5, 0x4 + ldr r2, [r5] + adds r0, r2, 0 + str r2, [sp] + bl sub_80B5A3C + adds r3, r0, 0 + movs r0, 0x20 + subs r0, r3 + str r0, [r4] + ldr r2, [sp] + cmp r3, 0xA + bgt _080B5FAC + movs r0, 0xB + subs r0, r3 + adds r1, r2, 0 + lsrs r1, r0 + ldr r0, _080B5F94 + adds r6, r1, 0 + orrs r6, r0 + cmp r5, r8 + bls _080B5F98 + subs r5, 0x4 + ldr r1, [r5] + b _080B5F9A + .align 2, 0 +_080B5F94: .4byte 0x3ff00000 +_080B5F98: + movs r1, 0 +_080B5F9A: + adds r0, r3, 0 + adds r0, 0x15 + lsls r2, r0 + movs r0, 0xB + subs r0, r3 + lsrs r1, r0 + adds r7, r2, 0 + orrs r7, r1 + b _080B5FF8 +_080B5FAC: + cmp r5, r8 + bls _080B5FB6 + subs r5, 0x4 + ldr r4, [r5] + b _080B5FB8 +_080B5FB6: + movs r4, 0 +_080B5FB8: + subs r3, 0xB + cmp r3, 0 + beq _080B5FF0 + lsls r2, r3 + movs r0, 0x20 + subs r0, r3 + adds r1, r4, 0 + lsrs r1, r0 + ldr r0, _080B5FDC + orrs r1, r0 + adds r6, r2, 0 + orrs r6, r1 + cmp r5, r8 + bls _080B5FE0 + subs r5, 0x4 + ldr r2, [r5] + b _080B5FE2 + .align 2, 0 +_080B5FDC: .4byte 0x3ff00000 +_080B5FE0: + movs r2, 0 +_080B5FE2: + lsls r4, r3 + movs r0, 0x20 + subs r0, r3 + lsrs r2, r0 + adds r7, r4, 0 + orrs r7, r2 + b _080B5FF8 +_080B5FF0: + ldr r0, _080B6004 + adds r6, r2, 0 + orrs r6, r0 + adds r7, r4, 0 +_080B5FF8: + adds r1, r7, 0 + adds r0, r6, 0 + add sp, 0x4 + pop {r3} + mov r8, r3 + pop {r4-r7,pc} + .align 2, 0 +_080B6004: .4byte 0x3ff00000 + thumb_func_end sub_80B5F4C + + thumb_func_start sub_80B6008 +sub_80B6008: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x8 + mov r9, r3 + ldr r3, [sp, 0x28] + mov r10, r3 + adds r5, r2, 0 + adds r4, r1, 0 + movs r1, 0x1 + bl sub_80B58B0 + adds r6, r0, 0 + movs r0, 0x14 + adds r0, r6 + mov r8, r0 + ldr r2, _080B6070 + adds r1, r4, 0 + ands r2, r1 + str r2, [sp, 0x4] + ldr r0, _080B6074 + ands r4, r0 + lsrs r7, r4, 20 + cmp r7, 0 + beq _080B6046 + movs r0, 0x80 + lsls r0, 13 + orrs r0, r2 + str r0, [sp, 0x4] +_080B6046: + str r5, [sp] + cmp r5, 0 + beq _080B6090 + mov r0, sp + bl sub_80B5A94 + adds r2, r0, 0 + cmp r2, 0 + beq _080B6078 + movs r0, 0x20 + subs r0, r2 + ldr r1, [sp, 0x4] + lsls r1, r0 + ldr r0, [sp] + orrs r0, r1 + str r0, [r6, 0x14] + ldr r0, [sp, 0x4] + lsrs r0, r2 + str r0, [sp, 0x4] + b _080B607C + .align 2, 0 +_080B6070: .4byte 0x000fffff +_080B6074: .4byte 0x7fffffff +_080B6078: + ldr r0, [sp] + str r0, [r6, 0x14] +_080B607C: + ldr r0, [sp, 0x4] + mov r1, r8 + str r0, [r1, 0x4] + movs r1, 0x1 + cmp r0, 0 + beq _080B608A + movs r1, 0x2 +_080B608A: + str r1, [r6, 0x10] + adds r4, r1, 0 + b _080B60A4 +_080B6090: + add r0, sp, 0x4 + bl sub_80B5A94 + adds r2, r0, 0 + ldr r0, [sp, 0x4] + str r0, [r6, 0x14] + movs r0, 0x1 + str r0, [r6, 0x10] + movs r4, 0x1 + adds r2, 0x20 +_080B60A4: + cmp r7, 0 + beq _080B60C0 + ldr r3, _080B60BC + adds r0, r2, r3 + adds r0, r7, r0 + mov r1, r9 + str r0, [r1] + movs r0, 0x35 + subs r0, r2 + mov r3, r10 + str r0, [r3] + b _080B60DC + .align 2, 0 +_080B60BC: .4byte 0xfffffbcd +_080B60C0: + ldr r1, _080B60EC + adds r0, r2, r1 + mov r3, r9 + str r0, [r3] + lsls r0, r4, 2 + add r0, r8 + subs r0, 0x4 + ldr r0, [r0] + bl sub_80B5A3C + lsls r1, r4, 5 + subs r1, r0 + mov r0, r10 + str r1, [r0] +_080B60DC: + adds r0, r6, 0 + add sp, 0x8 + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7,pc} + .align 2, 0 +_080B60EC: .4byte 0xfffffbce + thumb_func_end sub_80B6008 + + thumb_func_start sub_80B60F0 +sub_80B60F0: + push {r4-r7,lr} + sub sp, 0x10 + adds r4, r0, 0 + adds r5, r1, 0 + mov r1, sp + bl sub_80B5F4C + str r0, [sp, 0x8] + str r1, [sp, 0xC] + add r1, sp, 0x4 + adds r0, r5, 0 + bl sub_80B5F4C + adds r7, r1, 0 + adds r6, r0, 0 + ldr r2, [sp] + ldr r0, [sp, 0x4] + subs r2, r0 + ldr r0, [r4, 0x10] + ldr r1, [r5, 0x10] + subs r0, r1 + lsls r0, 5 + adds r0, r2, r0 + cmp r0, 0 + ble _080B612C + lsls r0, 20 + ldr r1, [sp, 0x8] + adds r0, r1, r0 + str r0, [sp, 0x8] + b _080B6130 +_080B612C: + lsls r0, 20 + subs r6, r0 +_080B6130: + ldr r0, [sp, 0x8] + ldr r1, [sp, 0xC] + adds r3, r7, 0 + adds r2, r6, 0 + bl __divdf3 + add sp, 0x10 + pop {r4-r7,pc} + thumb_func_end sub_80B60F0 + + thumb_func_start sub_80B6140 +sub_80B6140: + push {r4,lr} + adds r4, r0, 0 + ldr r1, _080B615C + ldr r0, _080B6158 + cmp r4, 0x17 + bgt _080B6164 + ldr r0, _080B6160 + lsls r1, r4, 3 + adds r1, r0 + ldr r0, [r1] + ldr r1, [r1, 0x4] + b _080B6176 + .align 2, 0 +_080B6158: .4byte 0x3ff00000 +_080B615C: .4byte 0x00000000 +_080B6160: .4byte gUnknown_826FEC0 +_080B6164: + cmp r4, 0 + ble _080B6176 +_080B6168: + ldr r3, _080B617C + ldr r2, _080B6178 + bl __muldf3 + subs r4, 0x1 + cmp r4, 0 + bgt _080B6168 +_080B6176: + pop {r4,pc} + .align 2, 0 +_080B6178: .4byte 0x40240000 +_080B617C: .4byte 0x00000000 + thumb_func_end sub_80B6140 + + thumb_func_start sub_80B6180 +sub_80B6180: + ldr r3, _080B619C + ands r3, r0 + negs r2, r1 + orrs r2, r1 + lsrs r2, 31 + orrs r3, r2 + ldr r0, _080B61A0 + subs r3, r0, r3 + negs r0, r3 + orrs r3, r0 + lsrs r3, 31 + movs r0, 0x1 + subs r0, r3 + bx lr + .align 2, 0 +_080B619C: .4byte 0x7fffffff +_080B61A0: .4byte 0x7ff00000 + thumb_func_end sub_80B6180 + + thumb_func_start sub_80B61A4 +sub_80B61A4: + ldr r3, _080B61BC + ands r3, r0 + negs r2, r1 + orrs r2, r1 + lsrs r2, 31 + orrs r3, r2 + ldr r0, _080B61C0 + subs r3, r0, r3 + lsrs r3, 31 + adds r0, r3, 0 + bx lr + .align 2, 0 +_080B61BC: .4byte 0x7fffffff +_080B61C0: .4byte 0x7ff00000 + thumb_func_end sub_80B61A4 + + thumb_func_start _sbrk_r +_sbrk_r: + push {r4,r5,lr} + adds r5, r0, 0 + adds r0, r1, 0 + ldr r4, _080B61EC + movs r1, 0 + str r1, [r4] + bl _sbrk + adds r1, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080B61E6 + ldr r0, [r4] + cmp r0, 0 + beq _080B61E6 + str r0, [r5] +_080B61E6: + adds r0, r1, 0 + pop {r4,r5,pc} + .align 2, 0 +_080B61EC: .4byte gUnknown_203B034 + thumb_func_end _sbrk_r + + thumb_func_start sub_80B61F0 +sub_80B61F0: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r3, r2, 0 + ldr r0, [r5, 0x54] + movs r2, 0xE + ldrsh r1, [r5, r2] + adds r2, r4, 0 + bl sub_80B685C + adds r1, r0, 0 + cmp r1, 0 + blt _080B6212 + ldr r0, [r5, 0x50] + adds r0, r1 + str r0, [r5, 0x50] + b _080B621A +_080B6212: + ldr r0, _080B6220 + ldrh r2, [r5, 0xC] + ands r0, r2 + strh r0, [r5, 0xC] +_080B621A: + adds r0, r1, 0 + pop {r4,r5,pc} + .align 2, 0 +_080B6220: .4byte 0xffffefff + thumb_func_end sub_80B61F0 + + thumb_func_start sub_80B6224 +sub_80B6224: + push {r4-r6,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + movs r0, 0x80 + lsls r0, 1 + ldrh r1, [r4, 0xC] + ands r0, r1 + cmp r0, 0 + beq _080B6246 + ldr r0, [r4, 0x54] + movs r2, 0xE + ldrsh r1, [r4, r2] + movs r2, 0 + movs r3, 0x2 + bl sub_80B682C +_080B6246: + ldr r0, _080B6260 + ldrh r1, [r4, 0xC] + ands r0, r1 + strh r0, [r4, 0xC] + ldr r0, [r4, 0x54] + movs r2, 0xE + ldrsh r1, [r4, r2] + adds r2, r5, 0 + adds r3, r6, 0 + bl sub_80B6718 + pop {r4-r6,pc} + .align 2, 0 +_080B6260: .4byte 0xffffefff + thumb_func_end sub_80B6224 + + thumb_func_start sub_80B6264 +sub_80B6264: + push {r4,r5,lr} + adds r5, r0, 0 + adds r4, r1, 0 + adds r3, r2, 0 + ldr r0, [r5, 0x54] + movs r2, 0xE + ldrsh r1, [r5, r2] + adds r2, r4, 0 + bl sub_80B682C + adds r1, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080B6290 + ldr r0, _080B628C + ldrh r2, [r5, 0xC] + ands r0, r2 + strh r0, [r5, 0xC] + b _080B629E + .align 2, 0 +_080B628C: .4byte 0xffffefff +_080B6290: + movs r2, 0x80 + lsls r2, 5 + adds r0, r2, 0 + ldrh r2, [r5, 0xC] + orrs r0, r2 + strh r0, [r5, 0xC] + str r1, [r5, 0x50] +_080B629E: + adds r0, r1, 0 + pop {r4,r5,pc} + thumb_func_end sub_80B6264 + + thumb_func_start sub_80B62A4 +sub_80B62A4: + push {lr} + ldr r2, [r0, 0x54] + movs r3, 0xE + ldrsh r1, [r0, r3] + adds r0, r2, 0 + bl sub_80B67A0 + pop {pc} + thumb_func_end sub_80B62A4 + + thumb_func_start findslot +findslot: + adds r3, r0, 0 + movs r1, 0 + ldr r2, _080B62BC + b _080B62C8 + .align 2, 0 +_080B62BC: .4byte gUnknown_2039E28 +_080B62C0: + adds r2, 0x8 + adds r1, 0x1 + cmp r1, 0x13 + bgt _080B62CE +_080B62C8: + ldr r0, [r2] + cmp r0, r3 + bne _080B62C0 +_080B62CE: + adds r0, r1, 0 + bx lr + thumb_func_end findslot + + thumb_func_start sub_80B62D4 +sub_80B62D4: + adds r2, r0, 0 + ldr r0, _080B62E8 + ldr r1, [r0] + ldr r0, [r1, 0x4] + movs r3, 0xE + ldrsh r0, [r0, r3] + cmp r2, r0 + bne _080B62F0 + ldr r0, _080B62EC + b _080B6316 + .align 2, 0 +_080B62E8: .4byte gUnknown_203B7A8 +_080B62EC: .4byte gUnknown_2039E1C +_080B62F0: + ldr r0, [r1, 0x8] + movs r3, 0xE + ldrsh r0, [r0, r3] + cmp r2, r0 + bne _080B6304 + ldr r0, _080B6300 + b _080B6316 + .align 2, 0 +_080B6300: .4byte gUnknown_2039E20 +_080B6304: + ldr r0, [r1, 0xC] + movs r1, 0xE + ldrsh r0, [r0, r1] + cmp r2, r0 + beq _080B6314 + adds r0, r2, 0 + subs r0, 0x20 + b _080B6318 +_080B6314: + ldr r0, _080B631C +_080B6316: + ldr r0, [r0] +_080B6318: + bx lr + .align 2, 0 +_080B631C: .4byte gUnknown_2039E24 + thumb_func_end sub_80B62D4 + + thumb_func_start sub_80B6320 +sub_80B6320: + push {r4,r5,lr} + sub sp, 0xC + ldr r4, _080B637C + str r4, [sp] + movs r3, 0x3 + str r3, [sp, 0x8] + movs r0, 0 + str r0, [sp, 0x4] + movs r5, 0x1 + adds r0, r5, 0 + mov r1, sp + swi 0xAB + adds r2, r0, 0 + ldr r5, _080B6380 + str r2, [r5] + str r4, [sp] + str r3, [sp, 0x8] + movs r0, 0x4 + str r0, [sp, 0x4] + ldr r3, _080B6384 + movs r4, 0x1 + adds r0, r4, 0 + mov r1, sp + swi 0xAB + adds r2, r0, 0 + ldr r0, _080B6388 + str r2, [r0] + str r2, [r3] + ldr r2, _080B638C + adds r1, r2, 0 + subs r4, 0x2 + adds r0, r2, 0 + adds r0, 0x98 +_080B6362: + str r4, [r0] + subs r0, 0x8 + cmp r0, r1 + bge _080B6362 + movs r0, 0 + ldr r1, [r5] + str r1, [r2] + str r0, [r2, 0x4] + ldr r1, [r3] + str r1, [r2, 0x8] + str r0, [r2, 0xC] + add sp, 0xC + pop {r4,r5,pc} + .align 2, 0 +_080B637C: .4byte gUnknown_826FFD8 +_080B6380: .4byte gUnknown_2039E1C +_080B6384: .4byte gUnknown_2039E20 +_080B6388: .4byte gUnknown_2039E24 +_080B638C: .4byte gUnknown_2039E28 + thumb_func_end sub_80B6320 + + thumb_func_start sub_80B6390 +sub_80B6390: + push {r4,lr} + movs r3, 0x13 + movs r4, 0 + adds r0, r3, 0 + adds r1, r4, 0 + swi 0xAB + adds r2, r0, 0 + adds r0, r2, 0 + pop {r4,pc} + thumb_func_end sub_80B6390 + + thumb_func_start sub_80B63A4 +sub_80B63A4: + push {r4,r5,lr} + adds r5, r0, 0 + bl sub_80B67CC + adds r4, r0, 0 + bl sub_80B6390 + str r0, [r4] + adds r0, r5, 0 + pop {r4,r5,pc} + thumb_func_end sub_80B63A4 + + thumb_func_start sub_80B63B8 +sub_80B63B8: + push {lr} + adds r1, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080B63C8 + adds r0, r1, 0 + b _080B63CE +_080B63C8: + adds r0, r1, 0 + bl sub_80B63A4 +_080B63CE: + pop {pc} + thumb_func_end sub_80B63B8 + + thumb_func_start sub_80B63D0 +sub_80B63D0: + push {r4,r5,lr} + sub sp, 0xC + adds r4, r1, 0 + adds r5, r2, 0 + bl sub_80B62D4 + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r3, 0x6 + adds r0, r3, 0 + mov r1, sp + swi 0xAB + adds r2, r0, 0 + adds r0, r2, 0 + add sp, 0xC + pop {r4,r5,pc} + thumb_func_end sub_80B63D0 + + thumb_func_start sub_80B63F4 +sub_80B63F4: + push {r4-r7,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r7, r2, 0 + bl sub_80B62D4 + bl findslot + adds r6, r0, 0 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r7, 0 + bl sub_80B63D0 + cmp r0, 0 + bge _080B641E + movs r0, 0x1 + negs r0, r0 + bl sub_80B63A4 + b _080B6434 +_080B641E: + subs r2, r7, r0 + cmp r6, 0x14 + beq _080B6432 + ldr r0, _080B6438 + lsls r1, r6, 3 + adds r0, 0x4 + adds r1, r0 + ldr r0, [r1] + adds r0, r2 + str r0, [r1] +_080B6432: + adds r0, r2, 0 +_080B6434: + pop {r4-r7,pc} + .align 2, 0 +_080B6438: .4byte gUnknown_2039E28 + thumb_func_end sub_80B63F4 + + thumb_func_start sub_80B643C +sub_80B643C: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0x8 + mov r8, r0 + adds r5, r1, 0 + adds r4, r2, 0 + bl sub_80B62D4 + adds r7, r0, 0 + bl findslot + adds r6, r0, 0 + cmp r4, 0x1 + bne _080B6472 + cmp r6, 0x14 + bne _080B6464 + movs r0, 0x1 + negs r0, r0 + b _080B64B4 +_080B6464: + ldr r0, _080B64BC + lsls r1, r6, 3 + adds r0, 0x4 + adds r1, r0 + ldr r0, [r1] + adds r5, r0 + movs r4, 0 +_080B6472: + cmp r4, 0x2 + bne _080B6484 + str r7, [sp] + movs r3, 0xC + adds r0, r3, 0 + mov r1, sp + swi 0xAB + adds r2, r0, 0 + adds r5, r2 +_080B6484: + mov r0, r8 + bl sub_80B62D4 + str r0, [sp] + str r5, [sp, 0x4] + movs r3, 0xA + adds r0, r3, 0 + mov r1, sp + swi 0xAB + adds r2, r0, 0 + cmp r6, 0x14 + beq _080B64AA + cmp r2, 0 + bne _080B64AA + ldr r0, _080B64BC + lsls r1, r6, 3 + adds r0, 0x4 + adds r1, r0 + str r5, [r1] +_080B64AA: + movs r0, 0x1 + negs r0, r0 + cmp r2, 0 + bne _080B64B4 + adds r0, r5, 0 +_080B64B4: + add sp, 0x8 + pop {r3} + mov r8, r3 + pop {r4-r7,pc} + .align 2, 0 +_080B64BC: .4byte gUnknown_2039E28 + thumb_func_end sub_80B643C + + thumb_func_start sub_80B64C0 +sub_80B64C0: + push {lr} + bl sub_80B643C + bl sub_80B63B8 + pop {pc} + thumb_func_end sub_80B64C0 + + thumb_func_start sub_80B64CC +sub_80B64CC: + push {r4,r5,lr} + sub sp, 0xC + adds r4, r1, 0 + adds r5, r2, 0 + bl sub_80B62D4 + str r0, [sp] + str r4, [sp, 0x4] + str r5, [sp, 0x8] + movs r3, 0x5 + adds r0, r3, 0 + mov r1, sp + swi 0xAB + adds r2, r0, 0 + adds r0, r2, 0 + add sp, 0xC + pop {r4,r5,pc} + thumb_func_end sub_80B64CC + + thumb_func_start _write +_write: + push {r4-r7,lr} + adds r4, r0, 0 + adds r5, r1, 0 + adds r6, r2, 0 + bl sub_80B62D4 + bl findslot + adds r7, r0, 0 + adds r0, r4, 0 + adds r1, r5, 0 + adds r2, r6, 0 + bl sub_80B64CC + movs r1, 0x1 + negs r1, r1 + cmp r0, r1 + beq _080B6518 + cmp r0, r6 + bne _080B6520 +_080B6518: + adds r0, r1, 0 + bl sub_80B63A4 + b _080B6536 +_080B6520: + subs r2, r6, r0 + cmp r7, 0x14 + beq _080B6534 + ldr r0, _080B6538 + lsls r1, r7, 3 + adds r0, 0x4 + adds r1, r0 + ldr r0, [r1] + adds r0, r2 + str r0, [r1] +_080B6534: + adds r0, r2, 0 +_080B6536: + pop {r4-r7,pc} + .align 2, 0 +_080B6538: .4byte gUnknown_2039E28 + thumb_func_end _write + + thumb_func_start _swiopen +_swiopen: + push {r4-r7,lr} + mov r7, r8 + push {r7} + sub sp, 0xC + adds r7, r0, 0 + adds r4, r1, 0 + movs r5, 0 + movs r6, 0x1 + negs r6, r6 + adds r0, r6, 0 + bl findslot + mov r8, r0 + cmp r0, 0x14 + bne _080B655E + adds r0, r6, 0 + b _080B65D2 +_080B655E: + movs r0, 0x2 + ands r0, r4 + cmp r0, 0 + beq _080B6568 + movs r5, 0x2 +_080B6568: + movs r0, 0x80 + lsls r0, 2 + ands r0, r4 + cmp r0, 0 + beq _080B6576 + movs r0, 0x4 + orrs r5, r0 +_080B6576: + movs r0, 0x80 + lsls r0, 3 + ands r0, r4 + cmp r0, 0 + beq _080B6584 + movs r0, 0x4 + orrs r5, r0 +_080B6584: + movs r1, 0x8 + ands r4, r1 + cmp r4, 0 + beq _080B6594 + movs r0, 0x5 + negs r0, r0 + ands r5, r0 + orrs r5, r1 +_080B6594: + str r7, [sp] + adds r0, r7, 0 + bl strlen + str r0, [sp, 0x8] + str r5, [sp, 0x4] + movs r2, 0x1 + adds r0, r2, 0 + mov r1, sp + swi 0xAB + adds r3, r0, 0 + cmp r3, 0 + blt _080B65CC + ldr r0, _080B65C8 + mov r1, r8 + lsls r2, r1, 3 + adds r1, r2, r0 + str r3, [r1] + adds r0, 0x4 + adds r2, r0 + movs r0, 0 + str r0, [r2] + adds r0, r3, 0 + adds r0, 0x20 + b _080B65D2 + .align 2, 0 +_080B65C8: .4byte gUnknown_2039E28 +_080B65CC: + adds r0, r3, 0 + bl sub_80B63A4 +_080B65D2: + add sp, 0xC + pop {r3} + mov r8, r3 + pop {r4-r7,pc} + thumb_func_end _swiopen + + thumb_func_start sub_80B65DC +sub_80B65DC: + push {r1-r3} + push {lr} + ldr r1, [sp, 0x4] + bl _swiopen + bl sub_80B63B8 + pop {r3} + add sp, 0xC + bx r3 + thumb_func_end sub_80B65DC + + thumb_func_start sub_80B65F0 +sub_80B65F0: + push {lr} + sub sp, 0x4 + bl sub_80B62D4 + str r0, [sp] + bl findslot + adds r1, r0, 0 + cmp r1, 0x14 + beq _080B6610 + ldr r0, _080B6620 + lsls r1, 3 + adds r1, r0 + movs r0, 0x1 + negs r0, r0 + str r0, [r1] +_080B6610: + movs r3, 0x2 + adds r0, r3, 0 + mov r1, sp + swi 0xAB + adds r2, r0, 0 + adds r0, r2, 0 + add sp, 0x4 + pop {pc} + .align 2, 0 +_080B6620: .4byte gUnknown_2039E28 + thumb_func_end sub_80B65F0 + + thumb_func_start sub_80B6624 +sub_80B6624: + push {lr} + bl sub_80B65F0 + bl sub_80B63B8 + pop {pc} + thumb_func_end sub_80B6624 + + thumb_func_start sub_80B6630 +sub_80B6630: + mov r12, r3 + mov r3, r8 + push {r3} + mov r3, r12 + movs r2, 0x18 + ldr r3, _080B664C + adds r0, r2, 0 + adds r1, r3, 0 + swi 0xAB + mov r8, r0 + pop {r3} + mov r8, r3 + bx lr + .align 2, 0 +_080B664C: .4byte 0x00020026 + thumb_func_end sub_80B6630 + + thumb_func_start sub_80B6650 +sub_80B6650: + mov r12, r3 + mov r3, r8 + push {r3} + mov r3, r12 + movs r2, 0x18 + ldr r3, _080B666C + adds r0, r2, 0 + adds r1, r3, 0 + swi 0xAB + mov r8, r0 + pop {r3} + mov r8, r3 + bx lr + .align 2, 0 +_080B666C: .4byte 0x00020026 + thumb_func_end sub_80B6650 + + thumb_func_start sub_80B6670 +sub_80B6670: + movs r0, 0x1 + bx lr + thumb_func_end sub_80B6670 + + thumb_func_start _sbrk +_sbrk: + push {r4-r6,lr} + adds r6, r0, 0 + ldr r4, _080B66A4 + ldr r0, [r4] + cmp r0, 0 + bne _080B6684 + ldr r0, _080B66A8 + str r0, [r4] +_080B6684: + ldr r5, [r4] + adds r0, r5, r6 + cmp r0, sp + bls _080B669A + ldr r1, _080B66AC + movs r0, 0x1 + movs r2, 0x20 + bl _write + bl abort +_080B669A: + ldr r0, [r4] + adds r0, r6 + str r0, [r4] + adds r0, r5, 0 + pop {r4-r6,pc} + .align 2, 0 +_080B66A4: .4byte gUnknown_2039E18 +_080B66A8: .4byte end +_080B66AC: .4byte gUnknown_826FFDC + thumb_func_end _sbrk + + thumb_func_start sub_80B66B0 +sub_80B66B0: + movs r0, 0x80 + lsls r0, 6 + str r0, [r1, 0x4] + movs r0, 0 + bx lr + thumb_func_end sub_80B66B0 + + thumb_func_start sub_80B66BC +sub_80B66BC: + movs r0, 0x1 + negs r0, r0 + bx lr + thumb_func_end sub_80B66BC + + thumb_func_start nullsub_213 +nullsub_213: + bx lr + thumb_func_end nullsub_213 + + thumb_func_start sub_80B66C8 +sub_80B66C8: + push {r4,r5,lr} + adds r2, r0, 0 + adds r3, r1, 0 + cmp r2, 0 + beq _080B66E6 + movs r4, 0x11 + movs r5, 0 + adds r0, r4, 0 + adds r1, r5, 0 + swi 0xAB + adds r5, r0, 0 + adds r4, r5, 0 + str r4, [r2] + movs r0, 0 + str r0, [r2, 0x4] +_080B66E6: + cmp r3, 0 + beq _080B66F0 + movs r0, 0 + str r0, [r3] + str r0, [r3, 0x4] +_080B66F0: + movs r0, 0 + pop {r4,r5,pc} + thumb_func_end sub_80B66C8 + + thumb_func_start sub_80B66F4 +sub_80B66F4: + push {r4,r5,lr} + adds r2, r0, 0 + movs r4, 0x10 + movs r5, 0 + adds r0, r4, 0 + adds r1, r5, 0 + swi 0xAB + adds r3, r0, 0 + cmp r2, 0 + beq _080B6712 + str r3, [r2] + movs r0, 0 + str r0, [r2, 0x4] + str r0, [r2, 0x8] + str r0, [r2, 0xC] +_080B6712: + adds r0, r3, 0 + pop {r4,r5,pc} + thumb_func_end sub_80B66F4 + + thumb_func_start sub_80B6718 +sub_80B6718: + push {r4,r5,lr} + adds r5, r0, 0 + adds r0, r1, 0 + adds r1, r2, 0 + adds r2, r3, 0 + ldr r4, _080B6744 + movs r3, 0 + str r3, [r4] + bl _write + adds r1, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080B673E + ldr r0, [r4] + cmp r0, 0 + beq _080B673E + str r0, [r5] +_080B673E: + adds r0, r1, 0 + pop {r4,r5,pc} + .align 2, 0 +_080B6744: .4byte gUnknown_203B034 + thumb_func_end sub_80B6718 + + thumb_func_start sub_80B6748 +sub_80B6748: + push {r4,lr} + muls r1, r2 + bl sub_80B53B4 + adds r4, r0, 0 + cmp r4, 0 + bne _080B675A + movs r0, 0 + b _080B679E +_080B675A: + adds r0, r4, 0 + subs r0, 0x8 + ldr r0, [r0, 0x4] + movs r1, 0x4 + negs r1, r1 + ands r0, r1 + subs r2, r0, 0x4 + cmp r2, 0x24 + bhi _080B6794 + adds r1, r4, 0 + cmp r2, 0x13 + bls _080B678A + movs r0, 0 + stm r1!, {r0} + str r0, [r4, 0x4] + adds r1, 0x4 + cmp r2, 0x1B + bls _080B678A + stm r1!, {r0} + stm r1!, {r0} + cmp r2, 0x23 + bls _080B678A + stm r1!, {r0} + stm r1!, {r0} +_080B678A: + movs r0, 0 + stm r1!, {r0} + stm r1!, {r0} + str r0, [r1] + b _080B679C +_080B6794: + adds r0, r4, 0 + movs r1, 0 + bl memset +_080B679C: + adds r0, r4, 0 +_080B679E: + pop {r4,pc} + thumb_func_end sub_80B6748 + + thumb_func_start sub_80B67A0 +sub_80B67A0: + push {r4,r5,lr} + adds r5, r0, 0 + adds r0, r1, 0 + ldr r4, _080B67C8 + movs r1, 0 + str r1, [r4] + bl sub_80B6624 + adds r1, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080B67C2 + ldr r0, [r4] + cmp r0, 0 + beq _080B67C2 + str r0, [r5] +_080B67C2: + adds r0, r1, 0 + pop {r4,r5,pc} + .align 2, 0 +_080B67C8: .4byte gUnknown_203B034 + thumb_func_end sub_80B67A0 + + thumb_func_start sub_80B67CC +sub_80B67CC: + ldr r0, _080B67D4 + ldr r0, [r0] + bx lr + .align 2, 0 +_080B67D4: .4byte gUnknown_203B7A8 + thumb_func_end sub_80B67CC + + thumb_func_start sub_80B67D8 +sub_80B67D8: + push {r4,r5,lr} + adds r5, r0, 0 + adds r0, r1, 0 + adds r1, r2, 0 + ldr r4, _080B6800 + movs r2, 0 + str r2, [r4] + bl sub_80B66B0 + adds r1, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080B67FC + ldr r0, [r4] + cmp r0, 0 + beq _080B67FC + str r0, [r5] +_080B67FC: + adds r0, r1, 0 + pop {r4,r5,pc} + .align 2, 0 +_080B6800: .4byte gUnknown_203B034 + thumb_func_end sub_80B67D8 + + thumb_func_start abort +abort: + mov r12, r3 + mov r3, r8 + push {r3} + mov r3, r12 + movs r2, 0x18 + ldr r3, _080B6820 + adds r0, r2, 0 + adds r1, r3, 0 + swi 0xAB + mov r8, r0 + pop {r3} + mov r8, r3 + bx lr + .align 2, 0 +_080B6820: .4byte 0x00020022 + thumb_func_end abort + + thumb_func_start isatty +isatty: + movs r0, 0x1 + bx lr + thumb_func_end isatty + + thumb_func_start alarm +alarm: + bx lr + thumb_func_end alarm + + thumb_func_start sub_80B682C +sub_80B682C: + push {r4,r5,lr} + adds r5, r0, 0 + adds r0, r1, 0 + adds r1, r2, 0 + adds r2, r3, 0 + ldr r4, _080B6858 + movs r3, 0 + str r3, [r4] + bl sub_80B64C0 + adds r1, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080B6852 + ldr r0, [r4] + cmp r0, 0 + beq _080B6852 + str r0, [r5] +_080B6852: + adds r0, r1, 0 + pop {r4,r5,pc} + .align 2, 0 +_080B6858: .4byte gUnknown_203B034 + thumb_func_end sub_80B682C + + thumb_func_start sub_80B685C +sub_80B685C: + push {r4,r5,lr} + adds r5, r0, 0 + adds r0, r1, 0 + adds r1, r2, 0 + adds r2, r3, 0 + ldr r4, _080B6888 + movs r3, 0 + str r3, [r4] + bl sub_80B63F4 + adds r1, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + bne _080B6882 + ldr r0, [r4] + cmp r0, 0 + beq _080B6882 + str r0, [r5] +_080B6882: + adds r0, r1, 0 + pop {r4,r5,pc} + .align 2, 0 +_080B6888: .4byte gUnknown_203B034 + thumb_func_end sub_80B685C + + thumb_func_start sub_80B688C +sub_80B688C: + cmp r1, 0 + beq _080B68FA + movs r3, 0x1 + movs r2, 0 + push {r4} + cmp r0, r1 + bcc _080B68F4 + movs r4, 0x1 + lsls r4, 28 +_080B689E: + cmp r1, r4 + bcs _080B68AC + cmp r1, r0 + bcs _080B68AC + lsls r1, 4 + lsls r3, 4 + b _080B689E +_080B68AC: + lsls r4, 3 +_080B68AE: + cmp r1, r4 + bcs _080B68BC + cmp r1, r0 + bcs _080B68BC + lsls r1, 1 + lsls r3, 1 + b _080B68AE +_080B68BC: + cmp r0, r1 + bcc _080B68C4 + subs r0, r1 + orrs r2, r3 +_080B68C4: + lsrs r4, r1, 1 + cmp r0, r4 + bcc _080B68D0 + subs r0, r4 + lsrs r4, r3, 1 + orrs r2, r4 +_080B68D0: + lsrs r4, r1, 2 + cmp r0, r4 + bcc _080B68DC + subs r0, r4 + lsrs r4, r3, 2 + orrs r2, r4 +_080B68DC: + lsrs r4, r1, 3 + cmp r0, r4 + bcc _080B68E8 + subs r0, r4 + lsrs r4, r3, 3 + orrs r2, r4 +_080B68E8: + cmp r0, 0 + beq _080B68F4 + lsrs r3, 4 + beq _080B68F4 + lsrs r1, 4 + b _080B68BC +_080B68F4: + adds r0, r2, 0 + pop {r4} + mov pc, lr +_080B68FA: + push {lr} + bl __div0 + movs r0, 0 + pop {pc} + thumb_func_end sub_80B688C + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/m4a.s b/asm/m4a.s new file mode 100644 index 00000000..71336705 --- /dev/null +++ b/asm/m4a.s @@ -0,0 +1,4625 @@ + .include "constants/gba_constants.inc" + .include "asm/macros.inc" + + .syntax unified + + .text + + thumb_func_start umul3232H32 +umul3232H32: + adr r2, _080AE268 + bx r2 + .arm +_080AE268: + umull r2, r3, r0, r1 + add r0, r3, 0 + bx lr + thumb_func_end umul3232H32 + + thumb_func_start SoundMain +SoundMain: + ldr r0, _080AE2E0 + ldr r0, [r0] + ldr r2, _080AE2E4 + ldr r3, [r0] + cmp r2, r3 + beq _080AE282 + bx lr +_080AE282: + adds r3, 0x1 + str r3, [r0] + push {r4-r7,lr} + mov r1, r8 + mov r2, r9 + mov r3, r10 + mov r4, r11 + push {r0-r4} + sub sp, 0x18 + ldrb r1, [r0, 0xC] + cmp r1, 0 + beq _080AE2A6 + ldr r2, _080AE2EC + ldrb r2, [r2] + cmp r2, 0xA0 + bcs _080AE2A4 + adds r2, 0xE4 +_080AE2A4: + adds r1, r2 +_080AE2A6: + str r1, [sp, 0x14] + ldr r3, [r0, 0x20] + cmp r3, 0 + beq _080AE2B6 + ldr r0, [r0, 0x24] + bl call_r3 + ldr r0, [sp, 0x18] +_080AE2B6: + ldr r3, [r0, 0x28] + bl call_r3 + ldr r0, [sp, 0x18] + ldr r3, [r0, 0x10] + mov r8, r3 + ldr r5, _080AE2F0 + adds r5, r0 + ldrb r4, [r0, 0x4] + subs r7, r4, 0x1 + bls _080AE2D6 + ldrb r1, [r0, 0xB] + subs r1, r7 + mov r2, r8 + muls r2, r1 + adds r5, r2 +_080AE2D6: + str r5, [sp, 0x8] + ldr r6, _080AE2F4 + ldr r3, _080AE2E8 + bx r3 + .align 2, 0 +_080AE2E0: .4byte SOUND_INFO_PTR +_080AE2E4: .4byte 0x68736d53 +_080AE2E8: .4byte SoundMainRAM_Buffer + 1 +_080AE2EC: .4byte 0x04000006 +_080AE2F0: .4byte 0x00000350 +_080AE2F4: .4byte 0x00000630 + thumb_func_end SoundMain + + thumb_func_start sub_80AE2F8 +sub_80AE2F8: + ldrb r3, [r0, 0x5] + cmp r3, 0 + beq _080AE358 + adr r1, _080AE304 + bx r1 + .arm +_080AE304: + cmp r4, 0x2 + addeq r7, r0, 0x350 + addne r7, r5, r8 + mov r4, r8 +_080AE314: + ldrsb r0, [r5, r6] + ldrsb r1, [r5] + add r0, r0, r1 + ldrsb r1, [r7, r6] + add r0, r0, r1 + ldrsb r1, [r7], 0x1 + add r0, r0, r1 + mul r1, r0, r3 + mov r0, r1, asr 9 + tst r0, 0x80 + addne r0, r0, 0x1 + strb r0, [r5, r6] + strb r0, [r5], 0x1 + subs r4, r4, 0x1 + bgt _080AE314 + add r0, pc, 0x2F + bx r0 + .thumb +_080AE358: + movs r0, 0 + mov r1, r8 + adds r6, r5 + lsrs r1, 3 + bcc _080AE366 + stm r5!, {r0} + stm r6!, {r0} +_080AE366: + lsrs r1, 1 + bcc _080AE372 + stm r5!, {r0} + stm r6!, {r0} + stm r5!, {r0} + stm r6!, {r0} +_080AE372: + stm r5!, {r0} + stm r6!, {r0} + stm r5!, {r0} + stm r6!, {r0} + stm r5!, {r0} + stm r6!, {r0} + stm r5!, {r0} + stm r6!, {r0} + subs r1, 0x1 + bgt _080AE372 + ldr r4, [sp, 0x18] + ldr r0, [r4, 0x18] + mov r12, r0 + ldrb r0, [r4, 0x6] + adds r4, 0x50 +_080AE390: + str r0, [sp, 0x4] + ldr r3, [r4, 0x24] + ldr r0, [sp, 0x14] + cmp r0, 0 + beq _080AE3B0 + ldr r1, _080AE3AC + ldrb r1, [r1] + cmp r1, 0xA0 + bcs _080AE3A4 + adds r1, 0xE4 +_080AE3A4: + cmp r1, r0 + bcc _080AE3B0 + b _080AE682 + .align 2, 0 +_080AE3AC: .4byte 0x04000006 +_080AE3B0: + ldrb r6, [r4] + movs r0, 0xC7 + tst r0, r6 + bne _080AE3BA + b _080AE678 +_080AE3BA: + movs r0, 0x80 + tst r0, r6 + beq _080AE3EA + movs r0, 0x40 + tst r0, r6 + bne _080AE3FA + movs r6, 0x3 + strb r6, [r4] + adds r0, r3, 0 + adds r0, 0x10 + str r0, [r4, 0x28] + ldr r0, [r3, 0xC] + str r0, [r4, 0x18] + movs r5, 0 + strb r5, [r4, 0x9] + str r5, [r4, 0x1C] + ldrb r2, [r3, 0x3] + movs r0, 0xC0 + tst r0, r2 + beq _080AE442 + movs r0, 0x10 + orrs r6, r0 + strb r6, [r4] + b _080AE442 +_080AE3EA: + ldrb r5, [r4, 0x9] + movs r0, 0x4 + tst r0, r6 + beq _080AE400 + ldrb r0, [r4, 0xD] + subs r0, 0x1 + strb r0, [r4, 0xD] + bhi _080AE450 +_080AE3FA: + movs r0, 0 + strb r0, [r4] + b _080AE678 +_080AE400: + movs r0, 0x40 + tst r0, r6 + beq _080AE420 + ldrb r0, [r4, 0x7] + muls r5, r0 + lsrs r5, 8 + ldrb r0, [r4, 0xC] + cmp r5, r0 + bhi _080AE450 +_080AE412: + ldrb r5, [r4, 0xC] + cmp r5, 0 + beq _080AE3FA + movs r0, 0x4 + orrs r6, r0 + strb r6, [r4] + b _080AE450 +_080AE420: + movs r2, 0x3 + ands r2, r6 + cmp r2, 0x2 + bne _080AE43E + ldrb r0, [r4, 0x5] + muls r5, r0 + lsrs r5, 8 + ldrb r0, [r4, 0x6] + cmp r5, r0 + bhi _080AE450 + adds r5, r0, 0 + beq _080AE412 + subs r6, 0x1 + strb r6, [r4] + b _080AE450 +_080AE43E: + cmp r2, 0x3 + bne _080AE450 +_080AE442: + ldrb r0, [r4, 0x4] + adds r5, r0 + cmp r5, 0xFF + bcc _080AE450 + movs r5, 0xFF + subs r6, 0x1 + strb r6, [r4] +_080AE450: + strb r5, [r4, 0x9] + ldr r0, [sp, 0x18] + ldrb r0, [r0, 0x7] + adds r0, 0x1 + muls r0, r5 + lsrs r5, r0, 4 + ldrb r0, [r4, 0x2] + muls r0, r5 + lsrs r0, 8 + strb r0, [r4, 0xA] + ldrb r0, [r4, 0x3] + muls r0, r5 + lsrs r0, 8 + strb r0, [r4, 0xB] + movs r0, 0x10 + ands r0, r6 + str r0, [sp, 0x10] + beq _080AE484 + adds r0, r3, 0 + adds r0, 0x10 + ldr r1, [r3, 0x8] + adds r0, r1 + str r0, [sp, 0xC] + ldr r0, [r3, 0xC] + subs r0, r1 + str r0, [sp, 0x10] +_080AE484: + ldr r5, [sp, 0x8] + ldr r2, [r4, 0x18] + ldr r3, [r4, 0x28] + adr r0, _080AE490 + bx r0 + .arm +_080AE490: + str r8, [sp] + ldrb r10, [r4, 0xA] + ldrb r11, [r4, 0xB] + mov r10, r10, lsl 16 + mov r11, r11, lsl 16 + ldrb r0, [r4, 0x1] + tst r0, 0x8 + beq _080AE5D0 +_080AE4B0: + cmp r2, 0x4 + ble _080AE520 + subs r2, r2, r8 + movgt lr, 0 + bgt _080AE4DC + mov lr, r8 + add r2, r2, r8 + sub r8, r2, 0x4 + sub lr, lr, r8 + ands r2, r2, 0x3 + moveq r2, 0x4 +_080AE4DC: + ldr r6, [r5] + ldr r7, [r5, 0x630] +_080AE4E4: + ldrsb r0, [r3], 0x1 + mul r1, r10, r0 + bic r1, r1, 0xFF0000 + add r6, r1, r6, ror 8 + mul r1, r11, r0 + bic r1, r1, 0xFF0000 + add r7, r1, r7, ror 8 + adds r5, r5, 0x40000000 + bcc _080AE4E4 + str r7, [r5, 0x630] + str r6, [r5], 0x4 + subs r8, r8, 0x4 + bgt _080AE4DC + adds r8, r8, lr + beq _080AE664 +_080AE520: + ldr r6, [r5] + ldr r7, [r5, 0x630] +_080AE528: + ldrsb r0, [r3], 0x1 + mul r1, r10, r0 + bic r1, r1, 0xFF0000 + add r6, r1, r6, ror 8 + mul r1, r11, r0 + bic r1, r1, 0xFF0000 + add r7, r1, r7, ror 8 + subs r2, r2, 0x1 + beq _080AE598 +_080AE54C: + adds r5, r5, 0x40000000 + bcc _080AE528 + str r7, [r5, 0x630] + str r6, [r5], 0x4 + subs r8, r8, 0x4 + bgt _080AE4B0 + b _080AE664 +_080AE568: + ldr r0, [sp, 0x18] + cmp r0, 0 + beq _080AE58C + ldr r3, [sp, 0x14] + rsb r9, r2, 0 +_080AE57C: + adds r2, r0, r2 + bgt _080AE634 + sub r9, r9, r0 + b _080AE57C +_080AE58C: + ldmia sp!, {r4,r12} + mov r2, 0 + b _080AE5A8 +_080AE598: + ldr r2, [sp, 0x10] + cmp r2, 0 + ldrne r3, [sp, 0xC] + bne _080AE54C +_080AE5A8: + strb r2, [r4] + mov r0, r5, lsr 30 + bic r5, r5, 0xC0000000 + rsb r0, r0, 0x3 + mov r0, r0, lsl 3 + mov r6, r6, ror r0 + mov r7, r7, ror r0 + str r7, [r5, 0x630] + str r6, [r5], 0x4 + b _080AE66C +_080AE5D0: + stmdb sp!, {r4,r12} + ldr lr, [r4, 0x1C] + ldr r1, [r4, 0x20] + mul r4, r12, r1 + ldrsb r0, [r3] + ldrsb r1, [r3, 0x1]! + sub r1, r1, r0 +_080AE5EC: + ldr r6, [r5] + ldr r7, [r5, 0x630] +_080AE5F4: + mul r9, lr, r1 + add r9, r0, r9, asr 23 + mul r12, r10, r9 + bic r12, r12, 0xFF0000 + add r6, r12, r6, ror 8 + mul r12, r11, r9 + bic r12, r12, 0xFF0000 + add r7, r12, r7, ror 8 + add lr, lr, r4 + movs r9, lr, lsr 23 + beq _080AE640 + bic lr, lr, 0x3F800000 + subs r2, r2, r9 + ble _080AE568 + subs r9, r9, 0x1 + addeq r0, r0, r1 +_080AE634: + ldrsbne r0, [r3, r9]! + ldrsb r1, [r3, 0x1]! + sub r1, r1, r0 +_080AE640: + adds r5, r5, 0x40000000 + bcc _080AE5F4 + str r7, [r5, 0x630] + str r6, [r5], 0x4 + subs r8, r8, 0x4 + bgt _080AE5EC + sub r3, r3, 0x1 + ldmia sp!, {r4,r12} + str lr, [r4, 0x1C] +_080AE664: + str r2, [r4, 0x18] + str r3, [r4, 0x28] +_080AE66C: + ldr r8, [sp] + add r0, pc, 0x1 + bx r0 + .thumb +_080AE678: + ldr r0, [sp, 0x4] + subs r0, 0x1 + ble _080AE682 + adds r4, 0x40 + b _080AE390 +_080AE682: + ldr r0, [sp, 0x18] + ldr r3, _080AE698 + str r3, [r0] + add sp, 0x1C + pop {r0-r7} + mov r8, r0 + mov r9, r1 + mov r10, r2 + mov r11, r3 + pop {r3} + +call_r3: + bx r3 + + .align 2, 0 +_080AE698: .4byte 0x68736D53 + thumb_func_end sub_80AE2F8 + + thumb_func_start sub_80AE69C +sub_80AE69C: + mov r12, r4 + movs r1, 0 + movs r2, 0 + movs r3, 0 + movs r4, 0 + stm r0!, {r1-r4} + stm r0!, {r1-r4} + stm r0!, {r1-r4} + stm r0!, {r1-r4} + mov r4, r12 + bx lr + thumb_func_end sub_80AE69C + + thumb_func_start sub_80AE6B4 +sub_80AE6B4: + ldr r3, [r0, 0x2C] + cmp r3, 0 + beq _080AE6D2 + ldr r1, [r0, 0x34] + ldr r2, [r0, 0x30] + cmp r2, 0 + beq _080AE6C6 + str r1, [r2, 0x34] + b _080AE6C8 +_080AE6C6: + str r1, [r3, 0x20] +_080AE6C8: + cmp r1, 0 + beq _080AE6CE + str r2, [r1, 0x30] +_080AE6CE: + movs r1, 0 + str r1, [r0, 0x2C] +_080AE6D2: + bx lr + thumb_func_end sub_80AE6B4 + + thumb_func_start sub_80AE6D4 +sub_80AE6D4: + push {r4,r5,lr} + adds r5, r1, 0 + ldr r4, [r5, 0x20] + cmp r4, 0 + beq _080AE6F8 +_080AE6DE: + ldrb r1, [r4] + movs r0, 0xC7 + tst r0, r1 + beq _080AE6EC + movs r0, 0x40 + orrs r1, r0 + strb r1, [r4] +_080AE6EC: + adds r0, r4, 0 + bl sub_80AE6B4 + ldr r4, [r4, 0x34] + cmp r4, 0 + bne _080AE6DE +_080AE6F8: + movs r0, 0 + strb r0, [r5] + pop {r4,r5} + pop {r0} + bx r0 + thumb_func_end sub_80AE6D4 + + thumb_func_start sub_80AE704 +sub_80AE704: + mov r12, lr + movs r1, 0x24 + ldr r2, _080AE734 +_080AE70A: + ldr r3, [r2] + bl _080AE71E + stm r0!, {r3} + adds r2, 0x4 + subs r1, 0x1 + bgt _080AE70A + bx r12 + thumb_func_end sub_80AE704 + + .align 2, 0 + .thumb_func +_080AE71C: + ldrb r3, [r2] + + .thumb_func +_080AE71E: + push {r0} + lsrs r0, r2, 25 + bne _080AE730 + ldr r0, _080AE734 + cmp r2, r0 + bcc _080AE72E + lsrs r0, r2, 14 + beq _080AE730 +_080AE72E: + movs r3, 0 +_080AE730: + pop {r0} + bx lr + .align 2, 0 +_080AE734: .4byte gUnknown_826F98C + + thumb_func_start sub_80AE738 +sub_80AE738: + ldr r2, [r1, 0x40] +_080AE73A: + adds r3, r2, 0x1 + str r3, [r1, 0x40] + ldrb r3, [r2] + b _080AE71E + thumb_func_end sub_80AE738 + + thumb_func_start sub_80AE744 +sub_80AE744: + push {lr} +_080AE746: + ldr r2, [r1, 0x40] + ldrb r0, [r2, 0x3] + lsls r0, 8 + ldrb r3, [r2, 0x2] + orrs r0, r3 + lsls r0, 8 + ldrb r3, [r2, 0x1] + orrs r0, r3 + lsls r0, 8 + bl _080AE71C + orrs r0, r3 + str r0, [r1, 0x40] + pop {r0} + bx r0 + thumb_func_end sub_80AE744 + + thumb_func_start sub_80AE764 +sub_80AE764: + ldrb r2, [r1, 0x2] + cmp r2, 0x3 + bcs _080AE77C + lsls r2, 2 + adds r3, r1, r2 + ldr r2, [r1, 0x40] + adds r2, 0x4 + str r2, [r3, 0x44] + ldrb r2, [r1, 0x2] + adds r2, 0x1 + strb r2, [r1, 0x2] + b sub_80AE744 +_080AE77C: + b sub_80AE6D4 + thumb_func_end sub_80AE764 + + thumb_func_start sub_80AE780 +sub_80AE780: + ldrb r2, [r1, 0x2] + cmp r2, 0 + beq _080AE792 + subs r2, 0x1 + strb r2, [r1, 0x2] + lsls r2, 2 + adds r3, r1, r2 + ldr r2, [r3, 0x44] + str r2, [r1, 0x40] +_080AE792: + bx lr + thumb_func_end sub_80AE780 + + thumb_func_start sub_80AE794 +sub_80AE794: + push {lr} + ldr r2, [r1, 0x40] + ldrb r3, [r2] + cmp r3, 0 + bne _080AE7A4 + adds r2, 0x1 + str r2, [r1, 0x40] + b _080AE746 +_080AE7A4: + ldrb r3, [r1, 0x3] + adds r3, 0x1 + strb r3, [r1, 0x3] + mov r12, r3 + bl sub_80AE738 + cmp r12, r3 + bcs _080AE7B6 + b _080AE746 +_080AE7B6: + movs r3, 0 + strb r3, [r1, 0x3] + adds r2, 0x5 + str r2, [r1, 0x40] + pop {r0} + bx r0 + thumb_func_end sub_80AE794 + + thumb_func_start sub_80AE7C4 +sub_80AE7C4: + mov r12, lr + bl sub_80AE738 + strb r3, [r1, 0x1D] + bx r12 + thumb_func_end sub_80AE7C4 + + thumb_func_start sub_80AE7D0 +sub_80AE7D0: + mov r12, lr + bl sub_80AE738 + lsls r3, 1 + strh r3, [r0, 0x1C] + ldrh r2, [r0, 0x1E] + muls r3, r2 + lsrs r3, 8 + strh r3, [r0, 0x20] + bx r12 + thumb_func_end sub_80AE7D0 + + thumb_func_start sub_80AE7E4 +sub_80AE7E4: + mov r12, lr + bl sub_80AE738 + strb r3, [r1, 0xA] + ldrb r3, [r1] + movs r2, 0xC + orrs r3, r2 + strb r3, [r1] + bx r12 + thumb_func_end sub_80AE7E4 + + thumb_func_start sub_80AE7F8 +sub_80AE7F8: + mov r12, lr + ldr r2, [r1, 0x40] + ldrb r3, [r2] + adds r2, 0x1 + str r2, [r1, 0x40] + lsls r2, r3, 1 + adds r2, r3 + lsls r2, 2 + ldr r3, [r0, 0x30] + adds r2, r3 + ldr r3, [r2] + bl _080AE71E + str r3, [r1, 0x24] + ldr r3, [r2, 0x4] + bl _080AE71E + str r3, [r1, 0x28] + ldr r3, [r2, 0x8] + bl _080AE71E + str r3, [r1, 0x2C] + bx r12 + thumb_func_end sub_80AE7F8 + + thumb_func_start sub_80AE828 +sub_80AE828: + mov r12, lr + bl sub_80AE738 + strb r3, [r1, 0x12] + ldrb r3, [r1] + movs r2, 0x3 + orrs r3, r2 + strb r3, [r1] + bx r12 + thumb_func_end sub_80AE828 + + thumb_func_start sub_80AE83C +sub_80AE83C: + mov r12, lr + bl sub_80AE738 + subs r3, 0x40 + strb r3, [r1, 0x14] + ldrb r3, [r1] + movs r2, 0x3 + orrs r3, r2 + strb r3, [r1] + bx r12 + thumb_func_end sub_80AE83C + + thumb_func_start sub_80AE850 +sub_80AE850: + mov r12, lr + bl sub_80AE738 + subs r3, 0x40 + strb r3, [r1, 0xE] + ldrb r3, [r1] + movs r2, 0xC + orrs r3, r2 + strb r3, [r1] + bx r12 + thumb_func_end sub_80AE850 + + thumb_func_start sub_80AE864 +sub_80AE864: + mov r12, lr + bl sub_80AE738 + strb r3, [r1, 0xF] + ldrb r3, [r1] + movs r2, 0xC + orrs r3, r2 + strb r3, [r1] + bx r12 + thumb_func_end sub_80AE864 + + thumb_func_start sub_80AE878 +sub_80AE878: + mov r12, lr + bl sub_80AE738 + strb r3, [r1, 0x1B] + bx r12 + thumb_func_end sub_80AE878 + + thumb_func_start sub_80AE884 +sub_80AE884: + mov r12, lr + bl sub_80AE738 + ldrb r0, [r1, 0x18] + cmp r0, r3 + beq _080AE89A + strb r3, [r1, 0x18] + ldrb r3, [r1] + movs r2, 0xF + orrs r3, r2 + strb r3, [r1] +_080AE89A: + bx r12 + thumb_func_end sub_80AE884 + + thumb_func_start sub_80AE89C +sub_80AE89C: + mov r12, lr + bl sub_80AE738 + subs r3, 0x40 + strb r3, [r1, 0xC] + ldrb r3, [r1] + movs r2, 0xC + orrs r3, r2 + strb r3, [r1] + bx r12 + thumb_func_end sub_80AE89C + + thumb_func_start sub_80AE8B0 +sub_80AE8B0: + mov r12, lr + ldr r2, [r1, 0x40] + ldrb r3, [r2] + adds r2, 0x1 + ldr r0, _080AE8C4 + adds r0, r3 + bl _080AE73A + strb r3, [r0] + bx r12 + .align 2, 0 +_080AE8C4: .4byte 0x04000060 + thumb_func_end sub_80AE8B0 + + thumb_func_start m4aSoundVSync +m4aSoundVSync: + ldr r0, _080AEB74 + ldr r0, [r0] + ldr r2, _080AEB78 + ldr r3, [r0] + subs r3, r2 + cmp r3, 0x1 + bhi _080AE908 + ldrb r1, [r0, 0x4] + subs r1, 0x1 + strb r1, [r0, 0x4] + bgt _080AE908 + ldrb r1, [r0, 0xB] + strb r1, [r0, 0x4] + ldr r2, _080AE90C + ldr r1, [r2, 0x8] + lsls r1, 7 + bcc _080AE8EE + ldr r1, _080AE910 + str r1, [r2, 0x8] +_080AE8EE: + ldr r1, [r2, 0x14] + lsls r1, 7 + bcc _080AE8F8 + ldr r1, _080AE910 + str r1, [r2, 0x14] +_080AE8F8: + movs r1, 0x4 + lsls r1, 8 + strh r1, [r2, 0xA] + strh r1, [r2, 0x16] + movs r1, 0xB6 + lsls r1, 8 + strh r1, [r2, 0xA] + strh r1, [r2, 0x16] +_080AE908: + bx lr + .align 2, 0 +_080AE90C: .4byte 0x040000bc +_080AE910: .4byte 0x84400004 + thumb_func_end m4aSoundVSync + + thumb_func_start sub_80AE914 +sub_80AE914: + ldr r2, _080AEB78 + ldr r3, [r0, 0x34] + cmp r2, r3 + beq _080AE91E + bx lr +_080AE91E: + adds r3, 0x1 + str r3, [r0, 0x34] + push {r0,lr} + ldr r3, [r0, 0x38] + cmp r3, 0 + beq _080AE930 + ldr r0, [r0, 0x3C] + bl _080AEB6C +_080AE930: + pop {r0} + push {r4-r7} + mov r4, r8 + mov r5, r9 + mov r6, r10 + mov r7, r11 + push {r4-r7} + adds r7, r0, 0 + ldr r0, [r7, 0x4] + cmp r0, 0 + bge _080AE948 + b _080AEB5C +_080AE948: + ldr r0, _080AEB74 + ldr r0, [r0] + mov r8, r0 + adds r0, r7, 0 + bl sub_80AF800 + ldr r0, [r7, 0x4] + cmp r0, 0 + bge _080AE95C + b _080AEB5C +_080AE95C: + ldrh r0, [r7, 0x22] + ldrh r1, [r7, 0x20] + adds r0, r1 + b _080AEAAC +_080AE964: + ldrb r6, [r7, 0x8] + ldr r5, [r7, 0x2C] + movs r3, 0x1 + movs r4, 0 +_080AE96C: + ldrb r0, [r5] + movs r1, 0x80 + tst r1, r0 + bne _080AE976 + b _080AEA88 +_080AE976: + mov r10, r3 + orrs r4, r3 + mov r11, r4 + ldr r4, [r5, 0x20] + cmp r4, 0 + beq _080AE9AA +_080AE982: + ldrb r1, [r4] + movs r0, 0xC7 + tst r0, r1 + beq _080AE99E + ldrb r0, [r4, 0x10] + cmp r0, 0 + beq _080AE9A4 + subs r0, 0x1 + strb r0, [r4, 0x10] + bne _080AE9A4 + movs r0, 0x40 + orrs r1, r0 + strb r1, [r4] + b _080AE9A4 +_080AE99E: + adds r0, r4, 0 + bl sub_80AF2FC +_080AE9A4: + ldr r4, [r4, 0x34] + cmp r4, 0 + bne _080AE982 +_080AE9AA: + ldrb r3, [r5] + movs r0, 0x40 + tst r0, r3 + beq _080AEA28 + adds r0, r5, 0 + bl sub_80AF310 + movs r0, 0x80 + strb r0, [r5] + movs r0, 0x2 + strb r0, [r5, 0xF] + movs r0, 0x40 + strb r0, [r5, 0x13] + movs r0, 0x16 + strb r0, [r5, 0x19] + movs r0, 0x1 + adds r1, r5, 0x6 + strb r0, [r1, 0x1E] + b _080AEA28 +_080AE9D0: + ldr r2, [r5, 0x40] + ldrb r1, [r2] + cmp r1, 0x80 + bcs _080AE9DC + ldrb r1, [r5, 0x7] + b _080AE9E6 +_080AE9DC: + adds r2, 0x1 + str r2, [r5, 0x40] + cmp r1, 0xBD + bcc _080AE9E6 + strb r1, [r5, 0x7] +_080AE9E6: + cmp r1, 0xCF + bcc _080AE9FC + mov r0, r8 + ldr r3, [r0, 0x38] + adds r0, r1, 0 + subs r0, 0xCF + adds r1, r7, 0 + adds r2, r5, 0 + bl _080AEB6C + b _080AEA28 +_080AE9FC: + cmp r1, 0xB0 + bls _080AEA1E + adds r0, r1, 0 + subs r0, 0xB1 + strb r0, [r7, 0xA] + mov r3, r8 + ldr r3, [r3, 0x34] + lsls r0, 2 + ldr r3, [r3, r0] + adds r0, r7, 0 + adds r1, r5, 0 + bl _080AEB6C + ldrb r0, [r5] + cmp r0, 0 + beq _080AEA84 + b _080AEA28 +_080AEA1E: + ldr r0, _080AEB70 + subs r1, 0x80 + adds r1, r0 + ldrb r0, [r1] + strb r0, [r5, 0x1] +_080AEA28: + ldrb r0, [r5, 0x1] + cmp r0, 0 + beq _080AE9D0 + subs r0, 0x1 + strb r0, [r5, 0x1] + ldrb r1, [r5, 0x19] + cmp r1, 0 + beq _080AEA84 + ldrb r0, [r5, 0x17] + cmp r0, 0 + beq _080AEA84 + ldrb r0, [r5, 0x1C] + cmp r0, 0 + beq _080AEA4A + subs r0, 0x1 + strb r0, [r5, 0x1C] + b _080AEA84 +_080AEA4A: + ldrb r0, [r5, 0x1A] + adds r0, r1 + strb r0, [r5, 0x1A] + adds r1, r0, 0 + subs r0, 0x40 + lsls r0, 24 + bpl _080AEA5E + lsls r2, r1, 24 + asrs r2, 24 + b _080AEA62 +_080AEA5E: + movs r0, 0x80 + subs r2, r0, r1 +_080AEA62: + ldrb r0, [r5, 0x17] + muls r0, r2 + asrs r2, r0, 6 + ldrb r0, [r5, 0x16] + eors r0, r2 + lsls r0, 24 + beq _080AEA84 + strb r2, [r5, 0x16] + ldrb r0, [r5] + ldrb r1, [r5, 0x18] + cmp r1, 0 + bne _080AEA7E + movs r1, 0xC + b _080AEA80 +_080AEA7E: + movs r1, 0x3 +_080AEA80: + orrs r0, r1 + strb r0, [r5] +_080AEA84: + mov r3, r10 + mov r4, r11 +_080AEA88: + subs r6, 0x1 + ble _080AEA94 + movs r0, 0x50 + adds r5, r0 + lsls r3, 1 + b _080AE96C +_080AEA94: + ldr r0, [r7, 0xC] + adds r0, 0x1 + str r0, [r7, 0xC] + cmp r4, 0 + bne _080AEAA6 + movs r0, 0x80 + lsls r0, 24 + str r0, [r7, 0x4] + b _080AEB5C +_080AEAA6: + str r4, [r7, 0x4] + ldrh r0, [r7, 0x22] + subs r0, 0x96 +_080AEAAC: + strh r0, [r7, 0x22] + cmp r0, 0x96 + bcc _080AEAB4 + b _080AE964 +_080AEAB4: + ldrb r2, [r7, 0x8] + ldr r5, [r7, 0x2C] +_080AEAB8: + ldrb r0, [r5] + movs r1, 0x80 + tst r1, r0 + beq _080AEB52 + movs r1, 0xF + tst r1, r0 + beq _080AEB52 + mov r9, r2 + adds r0, r7, 0 + adds r1, r5, 0 + bl sub_80AF8C8 + ldr r4, [r5, 0x20] + cmp r4, 0 + beq _080AEB48 +_080AEAD6: + ldrb r1, [r4] + movs r0, 0xC7 + tst r0, r1 + bne _080AEAE6 + adds r0, r4, 0 + bl sub_80AF2FC + b _080AEB42 +_080AEAE6: + ldrb r0, [r4, 0x1] + movs r6, 0x7 + ands r6, r0 + ldrb r3, [r5] + movs r0, 0x3 + tst r0, r3 + beq _080AEB04 + bl sub_80AEBC0 + cmp r6, 0 + beq _080AEB04 + ldrb r0, [r4, 0x1D] + movs r1, 0x1 + orrs r0, r1 + strb r0, [r4, 0x1D] +_080AEB04: + ldrb r3, [r5] + movs r0, 0xC + tst r0, r3 + beq _080AEB42 + ldrb r1, [r4, 0x8] + movs r0, 0x8 + ldrsb r0, [r5, r0] + adds r2, r1, r0 + bpl _080AEB18 + movs r2, 0 +_080AEB18: + cmp r6, 0 + beq _080AEB36 + mov r0, r8 + ldr r3, [r0, 0x30] + adds r1, r2, 0 + ldrb r2, [r5, 0x9] + adds r0, r6, 0 + bl _080AEB6C + str r0, [r4, 0x20] + ldrb r0, [r4, 0x1D] + movs r1, 0x2 + orrs r0, r1 + strb r0, [r4, 0x1D] + b _080AEB42 +_080AEB36: + adds r1, r2, 0 + ldrb r2, [r5, 0x9] + ldr r0, [r4, 0x24] + bl sub_80AEE80 + str r0, [r4, 0x20] +_080AEB42: + ldr r4, [r4, 0x34] + cmp r4, 0 + bne _080AEAD6 +_080AEB48: + ldrb r0, [r5] + movs r1, 0xF0 + ands r0, r1 + strb r0, [r5] + mov r2, r9 +_080AEB52: + subs r2, 0x1 + ble _080AEB5C + movs r0, 0x50 + adds r5, r0 + bgt _080AEAB8 +_080AEB5C: + ldr r0, _080AEB78 + str r0, [r7, 0x34] + pop {r0-r7} + mov r8, r0 + mov r9, r1 + mov r10, r2 + mov r11, r3 + pop {r3} +_080AEB6C: + bx r3 + .align 2, 0 +_080AEB70: .4byte gUnknown_826FC00 +_080AEB74: .4byte SOUND_INFO_PTR +_080AEB78: .4byte 0x68736d53 + thumb_func_end sub_80AE914 + + thumb_func_start sub_80AEB7C +sub_80AEB7C: + push {r4-r6,lr} + adds r5, r1, 0 + ldrb r1, [r5] + movs r0, 0x80 + tst r0, r1 + beq _080AEBB4 + ldr r4, [r5, 0x20] + cmp r4, 0 + beq _080AEBB2 + movs r6, 0 +_080AEB90: + ldrb r0, [r4] + cmp r0, 0 + beq _080AEBAA + ldrb r0, [r4, 0x1] + movs r3, 0x7 + ands r0, r3 + beq _080AEBA8 + ldr r3, _080AEBBC + ldr r3, [r3] + ldr r3, [r3, 0x2C] + bl _080AEB6C +_080AEBA8: + strb r6, [r4] +_080AEBAA: + str r6, [r4, 0x2C] + ldr r4, [r4, 0x34] + cmp r4, 0 + bne _080AEB90 +_080AEBB2: + str r4, [r5, 0x20] +_080AEBB4: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080AEBBC: .4byte SOUND_INFO_PTR + thumb_func_end sub_80AEB7C + + thumb_func_start sub_80AEBC0 +sub_80AEBC0: + ldrb r1, [r4, 0x12] + movs r0, 0x14 + ldrsb r2, [r4, r0] + movs r3, 0x80 + adds r3, r2 + muls r3, r1 + ldrb r0, [r5, 0x10] + muls r0, r3 + asrs r0, 14 + cmp r0, 0xFF + bls _080AEBD8 + movs r0, 0xFF +_080AEBD8: + strb r0, [r4, 0x2] + movs r3, 0x7F + subs r3, r2 + muls r3, r1 + ldrb r0, [r5, 0x11] + muls r0, r3 + asrs r0, 14 + cmp r0, 0xFF + bls _080AEBEC + movs r0, 0xFF +_080AEBEC: + strb r0, [r4, 0x3] + bx lr + thumb_func_end sub_80AEBC0 + + thumb_func_start sub_80AEBF0 +sub_80AEBF0: + push {r4-r7,lr} + mov r4, r8 + mov r5, r9 + mov r6, r10 + mov r7, r11 + push {r4-r7} + sub sp, 0x18 + str r1, [sp] + adds r5, r2, 0 + ldr r1, _080AEDE8 + ldr r1, [r1] + str r1, [sp, 0x4] + ldr r1, _080AEDEC + adds r0, r1 + ldrb r0, [r0] + strb r0, [r5, 0x4] + ldr r3, [r5, 0x40] + ldrb r0, [r3] + cmp r0, 0x80 + bcs _080AEC36 + strb r0, [r5, 0x5] + adds r3, 0x1 + ldrb r0, [r3] + cmp r0, 0x80 + bcs _080AEC34 + strb r0, [r5, 0x6] + adds r3, 0x1 + ldrb r0, [r3] + cmp r0, 0x80 + bcs _080AEC34 + ldrb r1, [r5, 0x4] + adds r1, r0 + strb r1, [r5, 0x4] + adds r3, 0x1 +_080AEC34: + str r3, [r5, 0x40] +_080AEC36: + movs r0, 0 + str r0, [sp, 0x14] + adds r4, r5, 0 + adds r4, 0x24 + ldrb r2, [r4] + movs r0, 0xC0 + tst r0, r2 + beq _080AEC88 + ldrb r3, [r5, 0x5] + movs r0, 0x40 + tst r0, r2 + beq _080AEC56 + ldr r1, [r5, 0x2C] + adds r1, r3 + ldrb r0, [r1] + b _080AEC58 +_080AEC56: + adds r0, r3, 0 +_080AEC58: + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 2 + ldr r0, [r5, 0x28] + adds r1, r0 + mov r9, r1 + mov r6, r9 + ldrb r1, [r6] + movs r0, 0xC0 + tst r0, r1 + beq _080AEC70 + b _080AEDD6 +_080AEC70: + movs r0, 0x80 + tst r0, r2 + beq _080AEC8C + ldrb r1, [r6, 0x3] + movs r0, 0x80 + tst r0, r1 + beq _080AEC84 + subs r1, 0xC0 + lsls r1, 1 + str r1, [sp, 0x14] +_080AEC84: + ldrb r3, [r6, 0x1] + b _080AEC8C +_080AEC88: + mov r9, r4 + ldrb r3, [r5, 0x5] +_080AEC8C: + str r3, [sp, 0x8] + ldr r6, [sp] + ldrb r1, [r6, 0x9] + ldrb r0, [r5, 0x1D] + adds r0, r1 + cmp r0, 0xFF + bls _080AEC9C + movs r0, 0xFF +_080AEC9C: + str r0, [sp, 0x10] + mov r6, r9 + ldrb r0, [r6] + movs r6, 0x7 + ands r6, r0 + str r6, [sp, 0xC] + beq _080AECDC + ldr r0, [sp, 0x4] + ldr r4, [r0, 0x1C] + cmp r4, 0 + bne _080AECB4 + b _080AEDD6 +_080AECB4: + subs r6, 0x1 + lsls r0, r6, 6 + adds r4, r0 + ldrb r1, [r4] + movs r0, 0xC7 + tst r0, r1 + beq _080AED30 + movs r0, 0x40 + tst r0, r1 + bne _080AED30 + ldrb r1, [r4, 0x13] + ldr r0, [sp, 0x10] + cmp r1, r0 + bcc _080AED30 + beq _080AECD4 + b _080AEDD6 +_080AECD4: + ldr r0, [r4, 0x2C] + cmp r0, r5 + bcs _080AED30 + b _080AEDD6 +_080AECDC: + ldr r6, [sp, 0x10] + adds r7, r5, 0 + movs r2, 0 + mov r8, r2 + ldr r4, [sp, 0x4] + ldrb r3, [r4, 0x6] + adds r4, 0x50 +_080AECEA: + ldrb r1, [r4] + movs r0, 0xC7 + tst r0, r1 + beq _080AED30 + movs r0, 0x40 + tst r0, r1 + beq _080AED04 + cmp r2, 0 + bne _080AED08 + adds r2, 0x1 + ldrb r6, [r4, 0x13] + ldr r7, [r4, 0x2C] + b _080AED22 +_080AED04: + cmp r2, 0 + bne _080AED24 +_080AED08: + ldrb r0, [r4, 0x13] + cmp r0, r6 + bcs _080AED14 + adds r6, r0, 0 + ldr r7, [r4, 0x2C] + b _080AED22 +_080AED14: + bhi _080AED24 + ldr r0, [r4, 0x2C] + cmp r0, r7 + bls _080AED20 + adds r7, r0, 0 + b _080AED22 +_080AED20: + bcc _080AED24 +_080AED22: + mov r8, r4 +_080AED24: + adds r4, 0x40 + subs r3, 0x1 + bgt _080AECEA + mov r4, r8 + cmp r4, 0 + beq _080AEDD6 +_080AED30: + adds r0, r4, 0 + bl sub_80AF2FC + movs r1, 0 + str r1, [r4, 0x30] + ldr r3, [r5, 0x20] + str r3, [r4, 0x34] + cmp r3, 0 + beq _080AED44 + str r4, [r3, 0x30] +_080AED44: + str r4, [r5, 0x20] + str r5, [r4, 0x2C] + ldrb r0, [r5, 0x1B] + strb r0, [r5, 0x1C] + cmp r0, r1 + beq _080AED56 + adds r1, r5, 0 + bl sub_80AEE30 +_080AED56: + ldr r0, [sp] + adds r1, r5, 0 + bl sub_80AF8C8 + ldr r0, [r5, 0x4] + str r0, [r4, 0x10] + ldr r0, [sp, 0x10] + strb r0, [r4, 0x13] + ldr r0, [sp, 0x8] + strb r0, [r4, 0x8] + ldr r0, [sp, 0x14] + strb r0, [r4, 0x14] + mov r6, r9 + ldrb r0, [r6] + strb r0, [r4, 0x1] + ldr r7, [r6, 0x4] + str r7, [r4, 0x24] + ldr r0, [r6, 0x8] + str r0, [r4, 0x4] + ldrh r0, [r5, 0x1E] + strh r0, [r4, 0xC] + bl sub_80AEBC0 + ldrb r1, [r4, 0x8] + movs r0, 0x8 + ldrsb r0, [r5, r0] + adds r3, r1, r0 + bpl _080AED90 + movs r3, 0 +_080AED90: + ldr r6, [sp, 0xC] + cmp r6, 0 + beq _080AEDBE + mov r6, r9 + ldrb r0, [r6, 0x2] + strb r0, [r4, 0x1E] + ldrb r1, [r6, 0x3] + movs r0, 0x80 + tst r0, r1 + bne _080AEDAA + movs r0, 0x70 + tst r0, r1 + bne _080AEDAC +_080AEDAA: + movs r1, 0x8 +_080AEDAC: + strb r1, [r4, 0x1F] + ldrb r2, [r5, 0x9] + adds r1, r3, 0 + ldr r0, [sp, 0xC] + ldr r3, [sp, 0x4] + ldr r3, [r3, 0x30] + bl _080AEB6C + b _080AEDC8 +_080AEDBE: + ldrb r2, [r5, 0x9] + adds r1, r3, 0 + adds r0, r7, 0 + bl sub_80AEE80 +_080AEDC8: + str r0, [r4, 0x20] + movs r0, 0x80 + strb r0, [r4] + ldrb r1, [r5] + movs r0, 0xF0 + ands r0, r1 + strb r0, [r5] +_080AEDD6: + add sp, 0x18 + pop {r0-r7} + mov r8, r0 + mov r9, r1 + mov r10, r2 + mov r11, r3 + pop {r0} + bx r0 + .align 2, 0 +_080AEDE8: .4byte SOUND_INFO_PTR +_080AEDEC: .4byte gUnknown_826FC00 + thumb_func_end sub_80AEBF0 + + thumb_func_start sub_80AEDF0 +sub_80AEDF0: + push {r4,r5} + ldr r2, [r1, 0x40] + ldrb r3, [r2] + cmp r3, 0x80 + bcs _080AEE02 + strb r3, [r1, 0x5] + adds r2, 0x1 + str r2, [r1, 0x40] + b _080AEE04 +_080AEE02: + ldrb r3, [r1, 0x5] +_080AEE04: + ldr r1, [r1, 0x20] + cmp r1, 0 + beq _080AEE2C + movs r4, 0x83 + movs r5, 0x40 +_080AEE0E: + ldrb r2, [r1] + tst r2, r4 + beq _080AEE26 + tst r2, r5 + bne _080AEE26 + ldrb r0, [r1, 0x11] + cmp r0, r3 + bne _080AEE26 + movs r0, 0x40 + orrs r2, r0 + strb r2, [r1] + b _080AEE2C +_080AEE26: + ldr r1, [r1, 0x34] + cmp r1, 0 + bne _080AEE0E +_080AEE2C: + pop {r4,r5} + bx lr + thumb_func_end sub_80AEDF0 + + thumb_func_start sub_80AEE30 +sub_80AEE30: + movs r2, 0 + strb r2, [r1, 0x16] + strb r2, [r1, 0x1A] + ldrb r2, [r1, 0x18] + cmp r2, 0 + bne _080AEE40 + movs r2, 0xC + b _080AEE42 +_080AEE40: + movs r2, 0x3 +_080AEE42: + ldrb r3, [r1] + orrs r3, r2 + strb r3, [r1] + bx lr + thumb_func_end sub_80AEE30 + + thumb_func_start sub_80AEE4C +sub_80AEE4C: + ldr r2, [r1, 0x40] + adds r3, r2, 0x1 + str r3, [r1, 0x40] + ldrb r3, [r2] + bx lr + thumb_func_end sub_80AEE4C + + thumb_func_start sub_80AEE58 +sub_80AEE58: + mov r12, lr + bl sub_80AEE4C + strb r3, [r1, 0x19] + cmp r3, 0 + bne _080AEE68 + bl sub_80AEE30 +_080AEE68: + bx r12 + thumb_func_end sub_80AEE58 + + thumb_func_start sub_80AEE6C +sub_80AEE6C: + mov r12, lr + bl sub_80AEE4C + strb r3, [r1, 0x17] + cmp r3, 0 + bne _080AEE7C + bl sub_80AEE30 +_080AEE7C: + bx r12 + thumb_func_end sub_80AEE6C + + thumb_func_start sub_80AEE80 +sub_80AEE80: + push {r4-r7,lr} + mov r12, r0 + lsls r1, 24 + lsrs r6, r1, 24 + lsls r7, r2, 24 + cmp r6, 0xB2 + bls _080AEE94 + movs r6, 0xB2 + movs r7, 0xFF + lsls r7, 24 +_080AEE94: + ldr r3, _080AEEDC + adds r0, r6, r3 + ldrb r5, [r0] + ldr r4, _080AEEE0 + movs r2, 0xF + adds r0, r5, 0 + ands r0, r2 + lsls r0, 2 + adds r0, r4 + lsrs r1, r5, 4 + ldr r5, [r0] + lsrs r5, r1 + adds r0, r6, 0x1 + adds r0, r3 + ldrb r1, [r0] + adds r0, r1, 0 + ands r0, r2 + lsls r0, 2 + adds r0, r4 + lsrs r1, 4 + ldr r0, [r0] + lsrs r0, r1 + mov r1, r12 + ldr r4, [r1, 0x4] + subs r0, r5 + adds r1, r7, 0 + bl umul3232H32 + adds r1, r0, 0 + adds r1, r5, r1 + adds r0, r4, 0 + bl umul3232H32 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080AEEDC: .4byte gUnknown_826FA1C +_080AEEE0: .4byte gUnknown_826FAD0 + thumb_func_end sub_80AEE80 + + thumb_func_start nullsub_212 +nullsub_212: + bx lr + thumb_func_end nullsub_212 + + thumb_func_start sub_80AEEE8 +sub_80AEEE8: + adds r2, r0, 0 + ldr r3, [r2, 0x34] + ldr r0, _080AEEFC + cmp r3, r0 + bne _080AEEFA + ldr r0, [r2, 0x4] + ldr r1, _080AEF00 + ands r0, r1 + str r0, [r2, 0x4] +_080AEEFA: + bx lr + .align 2, 0 +_080AEEFC: .4byte 0x68736d53 +_080AEF00: .4byte 0x7fffffff + thumb_func_end sub_80AEEE8 + + thumb_func_start sub_80AEF04 +sub_80AEF04: + adds r2, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r3, [r2, 0x34] + ldr r0, _080AEF20 + cmp r3, r0 + bne _080AEF1C + strh r1, [r2, 0x26] + strh r1, [r2, 0x24] + movs r0, 0x80 + lsls r0, 1 + strh r0, [r2, 0x28] +_080AEF1C: + bx lr + .align 2, 0 +_080AEF20: .4byte 0x68736d53 + thumb_func_end sub_80AEF04 + + thumb_func_start sub_80AEF24 +sub_80AEF24: + push {r4-r6,lr} + ldr r0, _080AEF78 + movs r1, 0x2 + negs r1, r1 + ands r0, r1 + ldr r1, _080AEF7C + ldr r2, _080AEF80 + bl CpuSet + ldr r0, _080AEF84 + bl sub_80AF324 + ldr r0, _080AEF88 + bl sub_80AF1E0 + ldr r0, _080AEF8C + bl sub_80AF4C0 + ldr r0, _080AEF90 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + beq _080AEF72 + ldr r5, _080AEF94 + adds r6, r0, 0 +_080AEF56: + ldr r4, [r5] + ldr r1, [r5, 0x4] + ldrb r2, [r5, 0x8] + adds r0, r4, 0 + bl sub_80AF664 + ldrh r0, [r5, 0xA] + strb r0, [r4, 0xB] + ldr r0, _080AEF98 + str r0, [r4, 0x18] + adds r5, 0xC + subs r6, 0x1 + cmp r6, 0 + bne _080AEF56 +_080AEF72: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080AEF78: .4byte sub_80AE2F8 +_080AEF7C: .4byte SoundMainRAM_Buffer +_080AEF80: .4byte 0x04000100 +_080AEF84: .4byte gUnknown_2039ED0 +_080AEF88: .4byte gUnknown_203AF10 +_080AEF8C: .4byte 0x0096e500 +_080AEF90: .4byte 0x00000008 +_080AEF94: .4byte 0x09e8665c +_080AEF98: .4byte gUnknown_2000A30 + thumb_func_end sub_80AEF24 + + thumb_func_start m4aSoundMain +m4aSoundMain: + push {lr} + bl SoundMain + pop {r0} + bx r0 + thumb_func_end m4aSoundMain + + thumb_func_start sub_80AEFA8 +sub_80AEFA8: + push {lr} + lsls r0, 16 + ldr r2, _080AEFCC + ldr r1, _080AEFD0 + lsrs r0, 13 + adds r0, r1 + ldrh r3, [r0, 0x4] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 2 + adds r1, r2 + ldr r2, [r1] + ldr r1, [r0] + adds r0, r2, 0 + bl sub_80AF6DC + pop {r0} + bx r0 + .align 2, 0 +_080AEFCC: .4byte 0x09e8665c +_080AEFD0: .4byte 0x09e866bc + thumb_func_end sub_80AEFA8 + + thumb_func_start sub_80AEFD4 +sub_80AEFD4: + push {lr} + lsls r0, 16 + ldr r2, _080AF000 + ldr r1, _080AF004 + lsrs r0, 13 + adds r0, r1 + ldrh r3, [r0, 0x4] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + ldr r3, [r1] + ldr r2, [r0] + cmp r3, r2 + beq _080AF008 + adds r0, r1, 0 + adds r1, r2, 0 + bl sub_80AF6DC + b _080AF01C + .align 2, 0 +_080AF000: .4byte 0x09e8665c +_080AF004: .4byte 0x09e866bc +_080AF008: + ldr r2, [r1, 0x4] + ldrh r0, [r1, 0x4] + cmp r0, 0 + beq _080AF014 + cmp r2, 0 + bge _080AF01C +_080AF014: + adds r0, r1, 0 + adds r1, r3, 0 + bl sub_80AF6DC +_080AF01C: + pop {r0} + bx r0 + thumb_func_end sub_80AEFD4 + + thumb_func_start sub_80AF020 +sub_80AF020: + push {lr} + lsls r0, 16 + ldr r2, _080AF04C + ldr r1, _080AF050 + lsrs r0, 13 + adds r0, r1 + ldrh r3, [r0, 0x4] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + ldr r3, [r1] + ldr r2, [r0] + cmp r3, r2 + beq _080AF054 + adds r0, r1, 0 + adds r1, r2, 0 + bl sub_80AF6DC + b _080AF070 + .align 2, 0 +_080AF04C: .4byte 0x09e8665c +_080AF050: .4byte 0x09e866bc +_080AF054: + ldr r2, [r1, 0x4] + ldrh r0, [r1, 0x4] + cmp r0, 0 + bne _080AF066 + adds r0, r1, 0 + adds r1, r3, 0 + bl sub_80AF6DC + b _080AF070 +_080AF066: + cmp r2, 0 + bge _080AF070 + adds r0, r1, 0 + bl sub_80AEEE8 +_080AF070: + pop {r0} + bx r0 + thumb_func_end sub_80AF020 + + thumb_func_start sub_80AF074 +sub_80AF074: + push {lr} + lsls r0, 16 + ldr r2, _080AF0A0 + ldr r1, _080AF0A4 + lsrs r0, 13 + adds r0, r1 + ldrh r3, [r0, 0x4] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 2 + adds r1, r2 + ldr r2, [r1] + ldr r1, [r2] + ldr r0, [r0] + cmp r1, r0 + bne _080AF09A + adds r0, r2, 0 + bl sub_80AF7C0 +_080AF09A: + pop {r0} + bx r0 + .align 2, 0 +_080AF0A0: .4byte 0x09e8665c +_080AF0A4: .4byte 0x09e866bc + thumb_func_end sub_80AF074 + + thumb_func_start sub_80AF0A8 +sub_80AF0A8: + push {lr} + lsls r0, 16 + ldr r2, _080AF0D4 + ldr r1, _080AF0D8 + lsrs r0, 13 + adds r0, r1 + ldrh r3, [r0, 0x4] + lsls r1, r3, 1 + adds r1, r3 + lsls r1, 2 + adds r1, r2 + ldr r2, [r1] + ldr r1, [r2] + ldr r0, [r0] + cmp r1, r0 + bne _080AF0CE + adds r0, r2, 0 + bl sub_80AEEE8 +_080AF0CE: + pop {r0} + bx r0 + .align 2, 0 +_080AF0D4: .4byte 0x09e8665c +_080AF0D8: .4byte 0x09e866bc + thumb_func_end sub_80AF0A8 + + thumb_func_start sub_80AF0DC +sub_80AF0DC: + push {r4,r5,lr} + ldr r0, _080AF100 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + beq _080AF0FA + ldr r5, _080AF104 + adds r4, r0, 0 +_080AF0EC: + ldr r0, [r5] + bl sub_80AF7C0 + adds r5, 0xC + subs r4, 0x1 + cmp r4, 0 + bne _080AF0EC +_080AF0FA: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080AF100: .4byte 0x00000008 +_080AF104: .4byte 0x09e8665c + thumb_func_end sub_80AF0DC + + thumb_func_start sub_80AF108 +sub_80AF108: + push {lr} + bl sub_80AEEE8 + pop {r0} + bx r0 + thumb_func_end sub_80AF108 + + thumb_func_start sub_80AF114 +sub_80AF114: + push {r4,r5,lr} + ldr r0, _080AF138 + lsls r0, 16 + lsrs r0, 16 + cmp r0, 0 + beq _080AF132 + ldr r5, _080AF13C + adds r4, r0, 0 +_080AF124: + ldr r0, [r5] + bl sub_80AEEE8 + adds r5, 0xC + subs r4, 0x1 + cmp r4, 0 + bne _080AF124 +_080AF132: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080AF138: .4byte 0x00000008 +_080AF13C: .4byte 0x09e8665c + thumb_func_end sub_80AF114 + + thumb_func_start sub_80AF140 +sub_80AF140: + push {lr} + lsls r1, 16 + lsrs r1, 16 + bl sub_80AEF04 + pop {r0} + bx r0 + thumb_func_end sub_80AF140 + + thumb_func_start sub_80AF150 +sub_80AF150: + adds r2, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r3, [r2, 0x34] + ldr r0, _080AF168 + cmp r3, r0 + bne _080AF166 + strh r1, [r2, 0x26] + strh r1, [r2, 0x24] + ldr r0, _080AF16C + strh r0, [r2, 0x28] +_080AF166: + bx lr + .align 2, 0 +_080AF168: .4byte 0x68736d53 +_080AF16C: .4byte 0x00000101 + thumb_func_end sub_80AF150 + + thumb_func_start sub_80AF170 +sub_80AF170: + adds r2, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r3, [r2, 0x34] + ldr r0, _080AF190 + cmp r3, r0 + bne _080AF18E + strh r1, [r2, 0x26] + strh r1, [r2, 0x24] + movs r0, 0x2 + strh r0, [r2, 0x28] + ldr r0, [r2, 0x4] + ldr r1, _080AF194 + ands r0, r1 + str r0, [r2, 0x4] +_080AF18E: + bx lr + .align 2, 0 +_080AF190: .4byte 0x68736d53 +_080AF194: .4byte 0x7fffffff + thumb_func_end sub_80AF170 + + thumb_func_start sub_80AF198 +sub_80AF198: + push {r4-r7,lr} + ldrb r5, [r0, 0x8] + ldr r4, [r0, 0x2C] + cmp r5, 0 + ble _080AF1DA + movs r7, 0x80 +_080AF1A4: + ldrb r1, [r4] + adds r0, r7, 0 + ands r0, r1 + cmp r0, 0 + beq _080AF1D2 + movs r6, 0x40 + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _080AF1D2 + adds r0, r4, 0 + bl sub_80AF310 + strb r7, [r4] + movs r0, 0x2 + strb r0, [r4, 0xF] + strb r6, [r4, 0x13] + movs r0, 0x16 + strb r0, [r4, 0x19] + adds r1, r4, 0 + adds r1, 0x24 + movs r0, 0x1 + strb r0, [r1] +_080AF1D2: + subs r5, 0x1 + adds r4, 0x50 + cmp r5, 0 + bgt _080AF1A4 +_080AF1DA: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80AF198 + + thumb_func_start sub_80AF1E0 +sub_80AF1E0: + push {r4-r6,lr} + sub sp, 0x4 + adds r5, r0, 0 + ldr r1, _080AF2A8 + movs r0, 0x8F + strh r0, [r1] + ldr r3, _080AF2AC + movs r2, 0 + strh r2, [r3] + ldr r0, _080AF2B0 + movs r1, 0x8 + strb r1, [r0] + adds r0, 0x6 + strb r1, [r0] + adds r0, 0x10 + strb r1, [r0] + subs r0, 0x14 + movs r1, 0x80 + strb r1, [r0] + adds r0, 0x8 + strb r1, [r0] + adds r0, 0x10 + strb r1, [r0] + subs r0, 0xD + strb r2, [r0] + movs r0, 0x77 + strb r0, [r3] + ldr r0, _080AF2B4 + ldr r4, [r0] + ldr r6, [r4] + ldr r0, _080AF2B8 + cmp r6, r0 + bne _080AF2A0 + adds r0, r6, 0x1 + str r0, [r4] + ldr r1, _080AF2BC + ldr r0, _080AF2C0 + str r0, [r1, 0x20] + ldr r0, _080AF2C4 + str r0, [r1, 0x44] + ldr r0, _080AF2C8 + str r0, [r1, 0x4C] + ldr r0, _080AF2CC + str r0, [r1, 0x70] + ldr r0, _080AF2D0 + str r0, [r1, 0x74] + ldr r0, _080AF2D4 + str r0, [r1, 0x78] + ldr r0, _080AF2D8 + str r0, [r1, 0x7C] + adds r2, r1, 0 + adds r2, 0x80 + ldr r0, _080AF2DC + str r0, [r2] + adds r1, 0x84 + ldr r0, _080AF2E0 + str r0, [r1] + str r5, [r4, 0x1C] + ldr r0, _080AF2E4 + str r0, [r4, 0x28] + ldr r0, _080AF2E8 + str r0, [r4, 0x2C] + ldr r0, _080AF2EC + str r0, [r4, 0x30] + ldr r0, _080AF2F0 + movs r1, 0 + strb r0, [r4, 0xC] + str r1, [sp] + ldr r2, _080AF2F4 + mov r0, sp + adds r1, r5, 0 + bl CpuSet + movs r0, 0x1 + strb r0, [r5, 0x1] + movs r0, 0x11 + strb r0, [r5, 0x1C] + adds r1, r5, 0 + adds r1, 0x41 + movs r0, 0x2 + strb r0, [r1] + adds r1, 0x1B + movs r0, 0x22 + strb r0, [r1] + adds r1, 0x25 + movs r0, 0x3 + strb r0, [r1] + adds r1, 0x1B + movs r0, 0x44 + strb r0, [r1] + adds r1, 0x24 + movs r0, 0x4 + strb r0, [r1, 0x1] + movs r0, 0x88 + strb r0, [r1, 0x1C] + str r6, [r4] +_080AF2A0: + add sp, 0x4 + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080AF2A8: .4byte 0x04000084 +_080AF2AC: .4byte 0x04000080 +_080AF2B0: .4byte 0x04000063 +_080AF2B4: .4byte SOUND_INFO_PTR +_080AF2B8: .4byte 0x68736d53 +_080AF2BC: .4byte gUnknown_203AE80 +_080AF2C0: .4byte sub_80B019C +_080AF2C4: .4byte sub_80AEE58 +_080AF2C8: .4byte sub_80AEE6C +_080AF2CC: .4byte sub_80B02F4 +_080AF2D0: .4byte sub_80AEDF0 +_080AF2D4: .4byte sub_80AF41C +_080AF2D8: .4byte sub_80AEB7C +_080AF2DC: .4byte sub_80AF800 +_080AF2E0: .4byte sub_80AF8C8 +_080AF2E4: .4byte sub_80AFADC +_080AF2E8: .4byte sub_80AFA24 +_080AF2EC: .4byte sub_80AF97C +_080AF2F0: .4byte 0x00000000 +_080AF2F4: .4byte 0x05000040 + thumb_func_end sub_80AF1E0 + + thumb_func_start sub_80AF2F8 +sub_80AF2F8: + swi 0x2A + bx lr + thumb_func_end sub_80AF2F8 + + thumb_func_start sub_80AF2FC +sub_80AF2FC: + push {lr} + ldr r1, _080AF30C + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .align 2, 0 +_080AF30C: .4byte gUnknown_203AF08 + thumb_func_end sub_80AF2FC + + thumb_func_start sub_80AF310 +sub_80AF310: + push {lr} + ldr r1, _080AF320 + ldr r1, [r1] + bl _call_via_r1 + pop {r0} + bx r0 + .align 2, 0 +_080AF320: .4byte gUnknown_203AF0C + thumb_func_end sub_80AF310 + + thumb_func_start sub_80AF324 +sub_80AF324: + push {r4,r5,lr} + sub sp, 0x4 + adds r5, r0, 0 + movs r3, 0 + str r3, [r5] + ldr r1, _080AF3DC + ldr r0, [r1] + movs r2, 0x80 + lsls r2, 18 + ands r0, r2 + cmp r0, 0 + beq _080AF340 + ldr r0, _080AF3E0 + str r0, [r1] +_080AF340: + ldr r1, _080AF3E4 + ldr r0, [r1] + ands r0, r2 + cmp r0, 0 + beq _080AF34E + ldr r0, _080AF3E0 + str r0, [r1] +_080AF34E: + ldr r0, _080AF3E8 + movs r2, 0x80 + lsls r2, 3 + adds r1, r2, 0 + strh r1, [r0] + adds r0, 0xC + strh r1, [r0] + ldr r1, _080AF3EC + movs r0, 0x8F + strh r0, [r1] + subs r1, 0x2 + ldr r2, _080AF3F0 + adds r0, r2, 0 + strh r0, [r1] + ldr r2, _080AF3F4 + ldrb r1, [r2] + movs r0, 0x3F + ands r0, r1 + movs r1, 0x40 + orrs r0, r1 + strb r0, [r2] + ldr r1, _080AF3F8 + movs r2, 0xD4 + lsls r2, 2 + adds r0, r5, r2 + str r0, [r1] + adds r1, 0x4 + ldr r0, _080AF3FC + str r0, [r1] + adds r1, 0x8 + movs r2, 0x98 + lsls r2, 4 + adds r0, r5, r2 + str r0, [r1] + adds r1, 0x4 + ldr r0, _080AF400 + str r0, [r1] + ldr r0, _080AF404 + str r5, [r0] + str r3, [sp] + ldr r2, _080AF408 + mov r0, sp + adds r1, r5, 0 + bl CpuSet + movs r0, 0x8 + strb r0, [r5, 0x6] + movs r0, 0xF + strb r0, [r5, 0x7] + ldr r0, _080AF40C + str r0, [r5, 0x38] + ldr r0, _080AF410 + str r0, [r5, 0x28] + str r0, [r5, 0x2C] + str r0, [r5, 0x30] + str r0, [r5, 0x3C] + ldr r4, _080AF414 + adds r0, r4, 0 + bl sub_80AE704 + str r4, [r5, 0x34] + movs r0, 0x80 + lsls r0, 11 + bl sub_80AF41C + ldr r0, _080AF418 + str r0, [r5] + add sp, 0x4 + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080AF3DC: .4byte 0x040000c4 +_080AF3E0: .4byte 0x84400004 +_080AF3E4: .4byte 0x040000d0 +_080AF3E8: .4byte 0x040000c6 +_080AF3EC: .4byte 0x04000084 +_080AF3F0: .4byte 0x0000a90e +_080AF3F4: .4byte 0x04000089 +_080AF3F8: .4byte 0x040000bc +_080AF3FC: .4byte 0x040000a0 +_080AF400: .4byte 0x040000a4 +_080AF404: .4byte SOUND_INFO_PTR +_080AF408: .4byte 0x050003ec +_080AF40C: .4byte sub_80AEBF0 +_080AF410: .4byte nullsub_139 +_080AF414: .4byte gUnknown_203AE80 +_080AF418: .4byte 0x68736d53 + thumb_func_end sub_80AF324 + + thumb_func_start sub_80AF41C +sub_80AF41C: + push {r4-r6,lr} + adds r2, r0, 0 + ldr r0, _080AF49C + ldr r4, [r0] + movs r0, 0xF0 + lsls r0, 12 + ands r0, r2 + lsrs r2, r0, 16 + movs r6, 0 + strb r2, [r4, 0x8] + ldr r1, _080AF4A0 + subs r0, r2, 0x1 + lsls r0, 1 + adds r0, r1 + ldrh r5, [r0] + str r5, [r4, 0x10] + movs r0, 0xC6 + lsls r0, 3 + adds r1, r5, 0 + bl __divsi3 + strb r0, [r4, 0xB] + ldr r0, _080AF4A4 + muls r0, r5 + ldr r1, _080AF4A8 + adds r0, r1 + ldr r1, _080AF4AC + bl __divsi3 + adds r1, r0, 0 + str r1, [r4, 0x14] + movs r0, 0x80 + lsls r0, 17 + bl __divsi3 + adds r0, 0x1 + asrs r0, 1 + str r0, [r4, 0x18] + ldr r0, _080AF4B0 + strh r6, [r0] + ldr r4, _080AF4B4 + ldr r0, _080AF4B8 + adds r1, r5, 0 + bl __divsi3 + negs r0, r0 + strh r0, [r4] + bl sub_80AF628 + ldr r1, _080AF4BC +_080AF480: + ldrb r0, [r1] + cmp r0, 0x9F + beq _080AF480 + ldr r1, _080AF4BC +_080AF488: + ldrb r0, [r1] + cmp r0, 0x9F + bne _080AF488 + ldr r1, _080AF4B0 + movs r0, 0x80 + strh r0, [r1] + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080AF49C: .4byte SOUND_INFO_PTR +_080AF4A0: .4byte gUnknown_826FB00 +_080AF4A4: .4byte 0x00091d1b +_080AF4A8: .4byte 0x00001388 +_080AF4AC: .4byte 0x00002710 +_080AF4B0: .4byte 0x04000102 +_080AF4B4: .4byte 0x04000100 +_080AF4B8: .4byte 0x00044940 +_080AF4BC: .4byte 0x04000006 + thumb_func_end sub_80AF41C + + thumb_func_start sub_80AF4C0 +sub_80AF4C0: + push {r4,r5,lr} + adds r3, r0, 0 + ldr r0, _080AF54C + ldr r5, [r0] + ldr r1, [r5] + ldr r0, _080AF550 + cmp r1, r0 + bne _080AF546 + adds r0, r1, 0x1 + str r0, [r5] + movs r4, 0xFF + ands r4, r3 + cmp r4, 0 + beq _080AF4E2 + movs r0, 0x7F + ands r4, r0 + strb r4, [r5, 0x5] +_080AF4E2: + movs r4, 0xF0 + lsls r4, 4 + ands r4, r3 + cmp r4, 0 + beq _080AF502 + lsrs r0, r4, 8 + strb r0, [r5, 0x6] + movs r4, 0xC + adds r0, r5, 0 + adds r0, 0x50 + movs r1, 0 +_080AF4F8: + strb r1, [r0] + subs r4, 0x1 + adds r0, 0x40 + cmp r4, 0 + bne _080AF4F8 +_080AF502: + movs r4, 0xF0 + lsls r4, 8 + ands r4, r3 + cmp r4, 0 + beq _080AF510 + lsrs r0, r4, 12 + strb r0, [r5, 0x7] +_080AF510: + movs r4, 0xB0 + lsls r4, 16 + ands r4, r3 + cmp r4, 0 + beq _080AF52E + movs r0, 0xC0 + lsls r0, 14 + ands r0, r4 + lsrs r4, r0, 14 + ldr r2, _080AF554 + ldrb r1, [r2] + movs r0, 0x3F + ands r0, r1 + orrs r0, r4 + strb r0, [r2] +_080AF52E: + movs r4, 0xF0 + lsls r4, 12 + ands r4, r3 + cmp r4, 0 + beq _080AF542 + bl sub_80AF5AC + adds r0, r4, 0 + bl sub_80AF41C +_080AF542: + ldr r0, _080AF550 + str r0, [r5] +_080AF546: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_080AF54C: .4byte SOUND_INFO_PTR +_080AF550: .4byte 0x68736d53 +_080AF554: .4byte 0x04000089 + thumb_func_end sub_80AF4C0 + + thumb_func_start sub_80AF558 +sub_80AF558: + push {r4-r7,lr} + ldr r0, _080AF5A4 + ldr r6, [r0] + ldr r1, [r6] + ldr r0, _080AF5A8 + cmp r1, r0 + bne _080AF59E + adds r0, r1, 0x1 + str r0, [r6] + movs r5, 0xC + adds r4, r6, 0 + adds r4, 0x50 + movs r0, 0 +_080AF572: + strb r0, [r4] + subs r5, 0x1 + adds r4, 0x40 + cmp r5, 0 + bgt _080AF572 + ldr r4, [r6, 0x1C] + cmp r4, 0 + beq _080AF59A + movs r5, 0x1 + movs r7, 0 +_080AF586: + lsls r0, r5, 24 + lsrs r0, 24 + ldr r1, [r6, 0x2C] + bl _call_via_r1 + strb r7, [r4] + adds r5, 0x1 + adds r4, 0x40 + cmp r5, 0x4 + ble _080AF586 +_080AF59A: + ldr r0, _080AF5A8 + str r0, [r6] +_080AF59E: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080AF5A4: .4byte SOUND_INFO_PTR +_080AF5A8: .4byte 0x68736d53 + thumb_func_end sub_80AF558 + + thumb_func_start sub_80AF5AC +sub_80AF5AC: + push {lr} + sub sp, 0x4 + ldr r0, _080AF60C + ldr r2, [r0] + ldr r1, [r2] + ldr r3, _080AF610 + adds r0, r1, r3 + cmp r0, 0x1 + bhi _080AF604 + adds r0, r1, 0 + adds r0, 0xA + str r0, [r2] + ldr r1, _080AF614 + ldr r0, [r1] + movs r3, 0x80 + lsls r3, 18 + ands r0, r3 + cmp r0, 0 + beq _080AF5D6 + ldr r0, _080AF618 + str r0, [r1] +_080AF5D6: + ldr r1, _080AF61C + ldr r0, [r1] + ands r0, r3 + cmp r0, 0 + beq _080AF5E4 + ldr r0, _080AF618 + str r0, [r1] +_080AF5E4: + ldr r0, _080AF620 + movs r3, 0x80 + lsls r3, 3 + adds r1, r3, 0 + strh r1, [r0] + adds r0, 0xC + strh r1, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0xD4 + lsls r0, 2 + adds r1, r2, r0 + ldr r2, _080AF624 + mov r0, sp + bl CpuSet +_080AF604: + add sp, 0x4 + pop {r0} + bx r0 + .align 2, 0 +_080AF60C: .4byte SOUND_INFO_PTR +_080AF610: .4byte 0x978c92ad +_080AF614: .4byte 0x040000c4 +_080AF618: .4byte 0x84400004 +_080AF61C: .4byte 0x040000d0 +_080AF620: .4byte 0x040000c6 +_080AF624: .4byte 0x05000318 + thumb_func_end sub_80AF5AC + + thumb_func_start sub_80AF628 +sub_80AF628: + push {r4,lr} + ldr r0, _080AF658 + ldr r2, [r0] + ldr r3, [r2] + ldr r0, _080AF65C + cmp r3, r0 + beq _080AF650 + ldr r0, _080AF660 + movs r4, 0xB6 + lsls r4, 8 + adds r1, r4, 0 + strh r1, [r0] + adds r0, 0xC + strh r1, [r0] + ldrb r0, [r2, 0x4] + movs r0, 0 + strb r0, [r2, 0x4] + adds r0, r3, 0 + subs r0, 0xA + str r0, [r2] +_080AF650: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AF658: .4byte SOUND_INFO_PTR +_080AF65C: .4byte 0x68736d53 +_080AF660: .4byte 0x040000c6 + thumb_func_end sub_80AF628 + + thumb_func_start sub_80AF664 +sub_80AF664: + push {r4-r7,lr} + adds r7, r0, 0 + adds r6, r1, 0 + lsls r2, 24 + lsrs r4, r2, 24 + cmp r4, 0 + beq _080AF6C8 + cmp r4, 0x10 + bls _080AF678 + movs r4, 0x10 +_080AF678: + ldr r0, _080AF6D0 + ldr r5, [r0] + ldr r1, [r5] + ldr r0, _080AF6D4 + cmp r1, r0 + bne _080AF6C8 + adds r0, r1, 0x1 + str r0, [r5] + adds r0, r7, 0 + bl sub_80AF310 + str r6, [r7, 0x2C] + strb r4, [r7, 0x8] + movs r0, 0x80 + lsls r0, 24 + str r0, [r7, 0x4] + cmp r4, 0 + beq _080AF6AC + movs r1, 0 +_080AF69E: + strb r1, [r6] + subs r0, r4, 0x1 + lsls r0, 24 + lsrs r4, r0, 24 + adds r6, 0x50 + cmp r4, 0 + bne _080AF69E +_080AF6AC: + ldr r0, [r5, 0x20] + cmp r0, 0 + beq _080AF6BC + str r0, [r7, 0x38] + ldr r0, [r5, 0x24] + str r0, [r7, 0x3C] + movs r0, 0 + str r0, [r5, 0x20] +_080AF6BC: + str r7, [r5, 0x24] + ldr r0, _080AF6D8 + str r0, [r5, 0x20] + ldr r0, _080AF6D4 + str r0, [r5] + str r0, [r7, 0x34] +_080AF6C8: + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080AF6D0: .4byte SOUND_INFO_PTR +_080AF6D4: .4byte 0x68736d53 +_080AF6D8: .4byte sub_80AE914 + thumb_func_end sub_80AF664 + + thumb_func_start sub_80AF6DC +sub_80AF6DC: + push {r4-r7,lr} + mov r7, r8 + push {r7} + adds r5, r0, 0 + adds r7, r1, 0 + ldr r1, [r5, 0x34] + ldr r0, _080AF7BC + cmp r1, r0 + bne _080AF7B2 + ldrb r0, [r5, 0xB] + ldrb r2, [r7, 0x2] + cmp r0, 0 + beq _080AF71E + ldr r0, [r5] + cmp r0, 0 + beq _080AF708 + ldr r1, [r5, 0x2C] + movs r0, 0x40 + ldrb r1, [r1] + ands r0, r1 + cmp r0, 0 + bne _080AF714 +_080AF708: + ldr r1, [r5, 0x4] + ldrh r0, [r5, 0x4] + cmp r0, 0 + beq _080AF71E + cmp r1, 0 + blt _080AF71E +_080AF714: + ldrb r0, [r7, 0x2] + adds r2, r0, 0 + ldrb r0, [r5, 0x9] + cmp r0, r2 + bhi _080AF7B2 +_080AF71E: + ldr r0, [r5, 0x34] + adds r0, 0x1 + str r0, [r5, 0x34] + movs r1, 0 + str r1, [r5, 0x4] + str r7, [r5] + ldr r0, [r7, 0x4] + str r0, [r5, 0x30] + strb r2, [r5, 0x9] + str r1, [r5, 0xC] + movs r0, 0x96 + strh r0, [r5, 0x1C] + strh r0, [r5, 0x20] + adds r0, 0x6A + strh r0, [r5, 0x1E] + strh r1, [r5, 0x22] + strh r1, [r5, 0x24] + movs r6, 0 + ldr r4, [r5, 0x2C] + ldrb r1, [r7] + cmp r6, r1 + bge _080AF77E + ldrb r0, [r5, 0x8] + cmp r6, r0 + bge _080AF79E + mov r8, r6 +_080AF752: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80AEB7C + movs r0, 0xC0 + strb r0, [r4] + mov r1, r8 + str r1, [r4, 0x20] + lsls r1, r6, 2 + adds r0, r7, 0 + adds r0, 0x8 + adds r0, r1 + ldr r0, [r0] + str r0, [r4, 0x40] + adds r6, 0x1 + adds r4, 0x50 + ldrb r0, [r7] + cmp r6, r0 + bge _080AF77E + ldrb r1, [r5, 0x8] + cmp r6, r1 + blt _080AF752 +_080AF77E: + ldrb r0, [r5, 0x8] + cmp r6, r0 + bge _080AF79E + movs r1, 0 + mov r8, r1 +_080AF788: + adds r0, r5, 0 + adds r1, r4, 0 + bl sub_80AEB7C + mov r0, r8 + strb r0, [r4] + adds r6, 0x1 + adds r4, 0x50 + ldrb r1, [r5, 0x8] + cmp r6, r1 + blt _080AF788 +_080AF79E: + movs r0, 0x80 + ldrb r1, [r7, 0x3] + ands r0, r1 + cmp r0, 0 + beq _080AF7AE + ldrb r0, [r7, 0x3] + bl sub_80AF4C0 +_080AF7AE: + ldr r0, _080AF7BC + str r0, [r5, 0x34] +_080AF7B2: + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080AF7BC: .4byte 0x68736d53 + thumb_func_end sub_80AF6DC + + thumb_func_start sub_80AF7C0 +sub_80AF7C0: + push {r4-r6,lr} + adds r6, r0, 0 + ldr r1, [r6, 0x34] + ldr r0, _080AF7FC + cmp r1, r0 + bne _080AF7F6 + adds r0, r1, 0x1 + str r0, [r6, 0x34] + ldr r0, [r6, 0x4] + movs r1, 0x80 + lsls r1, 24 + orrs r0, r1 + str r0, [r6, 0x4] + ldrb r4, [r6, 0x8] + ldr r5, [r6, 0x2C] + cmp r4, 0 + ble _080AF7F2 +_080AF7E2: + adds r0, r6, 0 + adds r1, r5, 0 + bl sub_80AEB7C + subs r4, 0x1 + adds r5, 0x50 + cmp r4, 0 + bgt _080AF7E2 +_080AF7F2: + ldr r0, _080AF7FC + str r0, [r6, 0x34] +_080AF7F6: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_080AF7FC: .4byte 0x68736d53 + thumb_func_end sub_80AF7C0 + + thumb_func_start sub_80AF800 +sub_80AF800: + push {r4-r7,lr} + adds r6, r0, 0 + ldrh r1, [r6, 0x24] + cmp r1, 0 + beq _080AF8C2 + ldrh r0, [r6, 0x26] + subs r0, 0x1 + strh r0, [r6, 0x26] + ldr r3, _080AF840 + adds r2, r3, 0 + lsls r0, 16 + lsrs r3, r0, 16 + cmp r3, 0 + bne _080AF8C2 + strh r1, [r6, 0x26] + ldrh r1, [r6, 0x28] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + beq _080AF844 + adds r0, r1, 0 + adds r0, 0x10 + strh r0, [r6, 0x28] + ands r0, r2 + cmp r0, 0xFF + bls _080AF896 + movs r0, 0x80 + lsls r0, 1 + strh r0, [r6, 0x28] + strh r3, [r6, 0x24] + b _080AF896 + .align 2, 0 +_080AF840: .4byte 0x0000ffff +_080AF844: + adds r0, r1, 0 + subs r0, 0x10 + strh r0, [r6, 0x28] + ands r0, r2 + lsls r0, 16 + cmp r0, 0 + bgt _080AF896 + ldrb r5, [r6, 0x8] + ldr r4, [r6, 0x2C] + cmp r5, 0 + ble _080AF876 +_080AF85A: + adds r0, r6, 0 + adds r1, r4, 0 + bl sub_80AEB7C + movs r0, 0x1 + ldrh r7, [r6, 0x28] + ands r0, r7 + cmp r0, 0 + bne _080AF86E + strb r0, [r4] +_080AF86E: + subs r5, 0x1 + adds r4, 0x50 + cmp r5, 0 + bgt _080AF85A +_080AF876: + movs r0, 0x1 + ldrh r1, [r6, 0x28] + ands r0, r1 + cmp r0, 0 + beq _080AF88A + ldr r0, [r6, 0x4] + movs r1, 0x80 + lsls r1, 24 + orrs r0, r1 + b _080AF88E +_080AF88A: + movs r0, 0x80 + lsls r0, 24 +_080AF88E: + str r0, [r6, 0x4] + movs r0, 0 + strh r0, [r6, 0x24] + b _080AF8C2 +_080AF896: + ldrb r5, [r6, 0x8] + ldr r4, [r6, 0x2C] + cmp r5, 0 + ble _080AF8C2 + movs r3, 0x80 + movs r7, 0 + movs r2, 0x3 +_080AF8A4: + ldrb r1, [r4] + adds r0, r3, 0 + ands r0, r1 + cmp r0, 0 + beq _080AF8BA + ldrh r7, [r6, 0x28] + lsrs r0, r7, 2 + strb r0, [r4, 0x13] + adds r0, r1, 0 + orrs r0, r2 + strb r0, [r4] +_080AF8BA: + subs r5, 0x1 + adds r4, 0x50 + cmp r5, 0 + bgt _080AF8A4 +_080AF8C2: + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80AF800 + + thumb_func_start sub_80AF8C8 +sub_80AF8C8: + push {r4,lr} + adds r2, r1, 0 + movs r0, 0x1 + ldrb r1, [r2] + ands r0, r1 + cmp r0, 0 + beq _080AF92C + ldrb r3, [r2, 0x13] + ldrb r1, [r2, 0x12] + adds r0, r3, 0 + muls r0, r1 + lsrs r3, r0, 5 + ldrb r4, [r2, 0x18] + cmp r4, 0x1 + bne _080AF8F0 + movs r0, 0x16 + ldrsb r0, [r2, r0] + adds r0, 0x80 + muls r0, r3 + lsrs r3, r0, 7 +_080AF8F0: + movs r0, 0x14 + ldrsb r0, [r2, r0] + lsls r0, 1 + movs r1, 0x15 + ldrsb r1, [r2, r1] + adds r1, r0, r1 + cmp r4, 0x2 + bne _080AF906 + movs r0, 0x16 + ldrsb r0, [r2, r0] + adds r1, r0 +_080AF906: + movs r0, 0x80 + negs r0, r0 + cmp r1, r0 + bge _080AF912 + adds r1, r0, 0 + b _080AF918 +_080AF912: + cmp r1, 0x7F + ble _080AF918 + movs r1, 0x7F +_080AF918: + adds r0, r1, 0 + adds r0, 0x80 + muls r0, r3 + lsrs r0, 8 + strb r0, [r2, 0x10] + movs r0, 0x7F + subs r0, r1 + muls r0, r3 + lsrs r0, 8 + strb r0, [r2, 0x11] +_080AF92C: + ldrb r1, [r2] + movs r0, 0x4 + ands r0, r1 + adds r3, r1, 0 + cmp r0, 0 + beq _080AF970 + movs r0, 0xE + ldrsb r0, [r2, r0] + ldrb r1, [r2, 0xF] + muls r0, r1 + movs r1, 0xC + ldrsb r1, [r2, r1] + adds r1, r0 + lsls r1, 2 + movs r0, 0xA + ldrsb r0, [r2, r0] + lsls r0, 8 + adds r1, r0 + movs r0, 0xB + ldrsb r0, [r2, r0] + lsls r0, 8 + adds r1, r0 + ldrb r0, [r2, 0xD] + adds r1, r0, r1 + ldrb r0, [r2, 0x18] + cmp r0, 0 + bne _080AF96A + movs r0, 0x16 + ldrsb r0, [r2, r0] + lsls r0, 4 + adds r1, r0 +_080AF96A: + asrs r0, r1, 8 + strb r0, [r2, 0x8] + strb r1, [r2, 0x9] +_080AF970: + movs r0, 0xFA + ands r0, r3 + strb r0, [r2] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80AF8C8 + + thumb_func_start sub_80AF97C +sub_80AF97C: + push {r4-r7,lr} + lsls r0, 24 + lsrs r0, 24 + lsls r1, 24 + lsrs r5, r1, 24 + lsls r2, 24 + lsrs r2, 24 + mov r12, r2 + cmp r0, 0x4 + bne _080AF9B4 + cmp r5, 0x14 + bhi _080AF998 + movs r5, 0 + b _080AF9A6 +_080AF998: + adds r0, r5, 0 + subs r0, 0x15 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x3B + bls _080AF9A6 + movs r5, 0x3B +_080AF9A6: + ldr r0, _080AF9B0 + adds r0, r5, r0 + ldrb r0, [r0] + b _080AFA16 + .align 2, 0 +_080AF9B0: .4byte gUnknown_826FBB4 +_080AF9B4: + cmp r5, 0x23 + bhi _080AF9C0 + movs r0, 0 + mov r12, r0 + movs r5, 0 + b _080AF9D2 +_080AF9C0: + adds r0, r5, 0 + subs r0, 0x24 + lsls r0, 24 + lsrs r5, r0, 24 + cmp r5, 0x82 + bls _080AF9D2 + movs r5, 0x82 + movs r1, 0xFF + mov r12, r1 +_080AF9D2: + ldr r3, _080AFA1C + adds r0, r5, r3 + ldrb r6, [r0] + ldr r4, _080AFA20 + movs r2, 0xF + adds r0, r6, 0 + ands r0, r2 + lsls r0, 1 + adds r0, r4 + movs r7, 0 + ldrsh r1, [r0, r7] + asrs r0, r6, 4 + adds r6, r1, 0 + asrs r6, r0 + adds r0, r5, 0x1 + adds r0, r3 + ldrb r1, [r0] + adds r0, r1, 0 + ands r0, r2 + lsls r0, 1 + adds r0, r4 + movs r2, 0 + ldrsh r0, [r0, r2] + asrs r1, 4 + asrs r0, r1 + subs r0, r6 + mov r7, r12 + muls r7, r0 + adds r0, r7, 0 + asrs r0, 8 + adds r0, r6, r0 + movs r1, 0x80 + lsls r1, 4 + adds r0, r1 +_080AFA16: + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_080AFA1C: .4byte gUnknown_826FB18 +_080AFA20: .4byte gUnknown_826FB9C + thumb_func_end sub_80AF97C + + thumb_func_start sub_80AFA24 +sub_80AFA24: + lsls r0, 24 + lsrs r0, 24 + adds r1, r0, 0 + cmp r0, 0x2 + beq _080AFA4C + cmp r0, 0x2 + bgt _080AFA38 + cmp r0, 0x1 + beq _080AFA3E + b _080AFA60 +_080AFA38: + cmp r1, 0x3 + beq _080AFA54 + b _080AFA60 +_080AFA3E: + ldr r1, _080AFA48 + movs r0, 0x8 + strb r0, [r1] + adds r1, 0x2 + b _080AFA68 + .align 2, 0 +_080AFA48: .4byte 0x04000063 +_080AFA4C: + ldr r1, _080AFA50 + b _080AFA62 + .align 2, 0 +_080AFA50: .4byte 0x04000069 +_080AFA54: + ldr r1, _080AFA5C + movs r0, 0 + b _080AFA6A + .align 2, 0 +_080AFA5C: .4byte 0x04000070 +_080AFA60: + ldr r1, _080AFA70 +_080AFA62: + movs r0, 0x8 + strb r0, [r1] + adds r1, 0x4 +_080AFA68: + movs r0, 0x80 +_080AFA6A: + strb r0, [r1] + bx lr + .align 2, 0 +_080AFA70: .4byte 0x04000079 + thumb_func_end sub_80AFA24 + + thumb_func_start sub_80AFA74 +sub_80AFA74: + push {r4,lr} + adds r1, r0, 0 + ldrb r0, [r1, 0x2] + lsls r2, r0, 24 + lsrs r4, r2, 24 + ldrb r3, [r1, 0x3] + lsls r0, r3, 24 + lsrs r3, r0, 24 + cmp r4, r3 + bcc _080AFA94 + lsrs r0, r2, 25 + cmp r0, r3 + bcc _080AFAA0 + movs r0, 0xF + strb r0, [r1, 0x1B] + b _080AFAAE +_080AFA94: + lsrs r0, 25 + cmp r0, r4 + bcc _080AFAA0 + movs r0, 0xF0 + strb r0, [r1, 0x1B] + b _080AFAAE +_080AFAA0: + movs r0, 0xFF + strb r0, [r1, 0x1B] + ldrb r2, [r1, 0x3] + ldrb r3, [r1, 0x2] + adds r0, r2, r3 + lsrs r0, 4 + b _080AFABE +_080AFAAE: + ldrb r2, [r1, 0x3] + ldrb r3, [r1, 0x2] + adds r0, r2, r3 + lsrs r0, 4 + strb r0, [r1, 0xA] + cmp r0, 0xF + bls _080AFAC0 + movs r0, 0xF +_080AFABE: + strb r0, [r1, 0xA] +_080AFAC0: + ldrb r2, [r1, 0x6] + ldrb r3, [r1, 0xA] + adds r0, r2, 0 + muls r0, r3 + adds r0, 0xF + asrs r0, 4 + strb r0, [r1, 0x19] + ldrb r0, [r1, 0x1C] + ldrb r2, [r1, 0x1B] + ands r0, r2 + strb r0, [r1, 0x1B] + pop {r4} + pop {r0} + bx r0 + thumb_func_end sub_80AFA74 + + thumb_func_start sub_80AFADC +sub_80AFADC: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + sub sp, 0x1C + ldr r0, _080AFAFC + ldr r0, [r0] + str r0, [sp, 0x4] + ldrb r0, [r0, 0xA] + cmp r0, 0 + beq _080AFB00 + subs r0, 0x1 + ldr r1, [sp, 0x4] + strb r0, [r1, 0xA] + b _080AFB06 + .align 2, 0 +_080AFAFC: .4byte SOUND_INFO_PTR +_080AFB00: + movs r0, 0xE + ldr r2, [sp, 0x4] + strb r0, [r2, 0xA] +_080AFB06: + movs r6, 0x1 + ldr r0, [sp, 0x4] + ldr r4, [r0, 0x1C] +_080AFB0C: + ldrb r1, [r4] + movs r0, 0xC7 + ands r0, r1 + adds r2, r6, 0x1 + mov r10, r2 + movs r2, 0x40 + adds r2, r4 + mov r9, r2 + cmp r0, 0 + bne _080AFB22 + b _080AFF0C +_080AFB22: + cmp r6, 0x2 + beq _080AFB54 + cmp r6, 0x2 + bgt _080AFB30 + cmp r6, 0x1 + beq _080AFB36 + b _080AFB8C +_080AFB30: + cmp r6, 0x3 + beq _080AFB6C + b _080AFB8C +_080AFB36: + ldr r0, _080AFB48 + str r0, [sp, 0x8] + ldr r7, _080AFB4C + ldr r2, _080AFB50 + str r2, [sp, 0xC] + adds r0, 0x4 + str r0, [sp, 0x10] + adds r2, 0x2 + b _080AFB9C + .align 2, 0 +_080AFB48: .4byte 0x04000060 +_080AFB4C: .4byte 0x04000062 +_080AFB50: .4byte 0x04000063 +_080AFB54: + ldr r0, _080AFB60 + str r0, [sp, 0x8] + ldr r7, _080AFB64 + ldr r2, _080AFB68 + b _080AFB94 + .align 2, 0 +_080AFB60: .4byte 0x04000061 +_080AFB64: .4byte 0x04000068 +_080AFB68: .4byte 0x04000069 +_080AFB6C: + ldr r0, _080AFB80 + str r0, [sp, 0x8] + ldr r7, _080AFB84 + ldr r2, _080AFB88 + str r2, [sp, 0xC] + adds r0, 0x4 + str r0, [sp, 0x10] + adds r2, 0x2 + b _080AFB9C + .align 2, 0 +_080AFB80: .4byte 0x04000070 +_080AFB84: .4byte 0x04000072 +_080AFB88: .4byte 0x04000073 +_080AFB8C: + ldr r0, _080AFBEC + str r0, [sp, 0x8] + ldr r7, _080AFBF0 + ldr r2, _080AFBF4 +_080AFB94: + str r2, [sp, 0xC] + adds r0, 0xB + str r0, [sp, 0x10] + adds r2, 0x4 +_080AFB9C: + str r2, [sp, 0x14] + ldr r0, [sp, 0x4] + ldrb r0, [r0, 0xA] + str r0, [sp] + ldr r2, [sp, 0xC] + ldrb r0, [r2] + mov r8, r0 + adds r2, r1, 0 + movs r0, 0x80 + ands r0, r2 + cmp r0, 0 + beq _080AFC92 + movs r3, 0x40 + adds r0, r3, 0 + ands r0, r2 + lsls r0, 24 + lsrs r5, r0, 24 + adds r0, r6, 0x1 + mov r10, r0 + movs r1, 0x40 + adds r1, r4 + mov r9, r1 + cmp r5, 0 + bne _080AFCB6 + movs r0, 0x3 + strb r0, [r4] + strb r0, [r4, 0x1D] + adds r0, r4, 0 + str r3, [sp, 0x18] + bl sub_80AFA74 + ldr r3, [sp, 0x18] + cmp r6, 0x2 + beq _080AFC04 + cmp r6, 0x2 + bgt _080AFBF8 + cmp r6, 0x1 + beq _080AFBFE + b _080AFC58 + .align 2, 0 +_080AFBEC: .4byte 0x04000071 +_080AFBF0: .4byte 0x04000078 +_080AFBF4: .4byte 0x04000079 +_080AFBF8: + cmp r6, 0x3 + beq _080AFC10 + b _080AFC58 +_080AFBFE: + ldrb r0, [r4, 0x1F] + ldr r2, [sp, 0x8] + strb r0, [r2] +_080AFC04: + ldr r0, [r4, 0x24] + lsls r0, 6 + ldrb r1, [r4, 0x1E] + adds r0, r1, r0 + strb r0, [r7] + b _080AFC64 +_080AFC10: + ldr r1, [r4, 0x24] + ldr r0, [r4, 0x28] + cmp r1, r0 + beq _080AFC38 + ldr r2, [sp, 0x8] + strb r3, [r2] + ldr r1, _080AFC4C + ldr r2, [r4, 0x24] + ldr r0, [r2] + str r0, [r1] + adds r1, 0x4 + ldr r0, [r2, 0x4] + str r0, [r1] + adds r1, 0x4 + ldr r0, [r2, 0x8] + str r0, [r1] + adds r1, 0x4 + ldr r0, [r2, 0xC] + str r0, [r1] + str r2, [r4, 0x28] +_080AFC38: + ldr r0, [sp, 0x8] + strb r5, [r0] + ldrb r0, [r4, 0x1E] + strb r0, [r7] + ldrb r0, [r4, 0x1E] + cmp r0, 0 + beq _080AFC50 + movs r0, 0xC0 + b _080AFC72 + .align 2, 0 +_080AFC4C: .4byte 0x04000090 +_080AFC50: + movs r1, 0x80 + negs r1, r1 + strb r1, [r4, 0x1A] + b _080AFC74 +_080AFC58: + ldrb r0, [r4, 0x1E] + strb r0, [r7] + ldr r0, [r4, 0x24] + lsls r0, 3 + ldr r2, [sp, 0x10] + strb r0, [r2] +_080AFC64: + ldrb r0, [r4, 0x4] + adds r0, 0x8 + mov r8, r0 + ldrb r0, [r4, 0x1E] + cmp r0, 0 + beq _080AFC72 + movs r0, 0x40 +_080AFC72: + strb r0, [r4, 0x1A] +_080AFC74: + ldrb r1, [r4, 0x4] + movs r2, 0 + strb r1, [r4, 0xB] + movs r0, 0xFF + ands r0, r1 + adds r1, r6, 0x1 + mov r10, r1 + movs r1, 0x40 + adds r1, r4 + mov r9, r1 + cmp r0, 0 + bne _080AFC8E + b _080AFDCA +_080AFC8E: + strb r2, [r4, 0x9] + b _080AFDF8 +_080AFC92: + movs r0, 0x4 + ands r0, r2 + cmp r0, 0 + beq _080AFCC4 + ldrb r0, [r4, 0xD] + subs r0, 0x1 + strb r0, [r4, 0xD] + movs r2, 0xFF + ands r0, r2 + lsls r0, 24 + adds r1, r6, 0x1 + mov r10, r1 + movs r2, 0x40 + adds r2, r4 + mov r9, r2 + cmp r0, 0 + ble _080AFCB6 + b _080AFE0A +_080AFCB6: + lsls r0, r6, 24 + lsrs r0, 24 + bl sub_80AFA24 + movs r0, 0 + strb r0, [r4] + b _080AFF08 +_080AFCC4: + movs r0, 0x40 + ands r0, r1 + adds r2, r6, 0x1 + mov r10, r2 + movs r2, 0x40 + adds r2, r4 + mov r9, r2 + cmp r0, 0 + beq _080AFD04 + movs r0, 0x3 + ands r0, r1 + cmp r0, 0 + beq _080AFD04 + movs r0, 0xFC + ands r0, r1 + movs r2, 0 + strb r0, [r4] + ldrb r1, [r4, 0x7] + strb r1, [r4, 0xB] + movs r0, 0xFF + ands r0, r1 + cmp r0, 0 + beq _080AFD36 + movs r0, 0x1 + ldrb r1, [r4, 0x1D] + orrs r0, r1 + strb r0, [r4, 0x1D] + cmp r6, 0x3 + beq _080AFDF8 + ldrb r2, [r4, 0x7] + mov r8, r2 + b _080AFDF8 +_080AFD04: + ldrb r0, [r4, 0xB] + cmp r0, 0 + bne _080AFDF8 + cmp r6, 0x3 + bne _080AFD16 + movs r0, 0x1 + ldrb r1, [r4, 0x1D] + orrs r0, r1 + strb r0, [r4, 0x1D] +_080AFD16: + adds r0, r4, 0 + bl sub_80AFA74 + movs r0, 0x3 + ldrb r2, [r4] + ands r0, r2 + cmp r0, 0 + bne _080AFD6A + ldrb r0, [r4, 0x9] + subs r0, 0x1 + strb r0, [r4, 0x9] + movs r1, 0xFF + ands r0, r1 + lsls r0, 24 + cmp r0, 0 + bgt _080AFD66 +_080AFD36: + ldrb r2, [r4, 0xC] + ldrb r1, [r4, 0xA] + adds r0, r2, 0 + muls r0, r1 + adds r0, 0xFF + asrs r0, 8 + movs r1, 0 + strb r0, [r4, 0x9] + lsls r0, 24 + cmp r0, 0 + beq _080AFCB6 + movs r0, 0x4 + ldrb r2, [r4] + orrs r0, r2 + strb r0, [r4] + movs r0, 0x1 + ldrb r1, [r4, 0x1D] + orrs r0, r1 + strb r0, [r4, 0x1D] + cmp r6, 0x3 + beq _080AFE0A + movs r2, 0x8 + mov r8, r2 + b _080AFE0A +_080AFD66: + ldrb r0, [r4, 0x7] + b _080AFDF6 +_080AFD6A: + cmp r0, 0x1 + bne _080AFD76 +_080AFD6E: + ldrb r0, [r4, 0x19] + strb r0, [r4, 0x9] + movs r0, 0x7 + b _080AFDF6 +_080AFD76: + cmp r0, 0x2 + bne _080AFDBA + ldrb r0, [r4, 0x9] + subs r0, 0x1 + strb r0, [r4, 0x9] + movs r1, 0xFF + ands r0, r1 + lsls r0, 24 + ldrb r2, [r4, 0x19] + lsls r1, r2, 24 + cmp r0, r1 + bgt _080AFDB6 +_080AFD8E: + ldrb r0, [r4, 0x6] + cmp r0, 0 + bne _080AFD9E + movs r0, 0xFC + ldrb r1, [r4] + ands r0, r1 + strb r0, [r4] + b _080AFD36 +_080AFD9E: + ldrb r0, [r4] + subs r0, 0x1 + strb r0, [r4] + movs r0, 0x1 + ldrb r2, [r4, 0x1D] + orrs r0, r2 + strb r0, [r4, 0x1D] + cmp r6, 0x3 + beq _080AFD6E + movs r0, 0x8 + mov r8, r0 + b _080AFD6E +_080AFDB6: + ldrb r0, [r4, 0x5] + b _080AFDF6 +_080AFDBA: + ldrb r0, [r4, 0x9] + adds r0, 0x1 + strb r0, [r4, 0x9] + movs r1, 0xFF + ands r0, r1 + ldrb r2, [r4, 0xA] + cmp r0, r2 + bcc _080AFDF4 +_080AFDCA: + ldrb r0, [r4] + subs r0, 0x1 + movs r2, 0 + strb r0, [r4] + ldrb r1, [r4, 0x5] + strb r1, [r4, 0xB] + movs r0, 0xFF + ands r0, r1 + cmp r0, 0 + beq _080AFD8E + movs r0, 0x1 + ldrb r1, [r4, 0x1D] + orrs r0, r1 + strb r0, [r4, 0x1D] + ldrb r0, [r4, 0xA] + strb r0, [r4, 0x9] + cmp r6, 0x3 + beq _080AFDF8 + ldrb r2, [r4, 0x5] + mov r8, r2 + b _080AFDF8 +_080AFDF4: + ldrb r0, [r4, 0x4] +_080AFDF6: + strb r0, [r4, 0xB] +_080AFDF8: + ldrb r0, [r4, 0xB] + subs r0, 0x1 + strb r0, [r4, 0xB] + ldr r0, [sp] + cmp r0, 0 + bne _080AFE0A + subs r0, 0x1 + str r0, [sp] + b _080AFD04 +_080AFE0A: + movs r0, 0x2 + ldrb r1, [r4, 0x1D] + ands r0, r1 + cmp r0, 0 + beq _080AFE82 + cmp r6, 0x3 + bgt _080AFE4A + movs r0, 0x8 + ldrb r2, [r4, 0x1] + ands r0, r2 + cmp r0, 0 + beq _080AFE4A + ldr r0, _080AFE34 + ldrb r0, [r0] + cmp r0, 0x3F + bgt _080AFE3C + ldr r0, [r4, 0x20] + adds r0, 0x2 + ldr r1, _080AFE38 + b _080AFE46 + .align 2, 0 +_080AFE34: .4byte 0x04000089 +_080AFE38: .4byte 0x000007fc +_080AFE3C: + cmp r0, 0x7F + bgt _080AFE4A + ldr r0, [r4, 0x20] + adds r0, 0x1 + ldr r1, _080AFE58 +_080AFE46: + ands r0, r1 + str r0, [r4, 0x20] +_080AFE4A: + cmp r6, 0x4 + beq _080AFE5C + ldr r0, [r4, 0x20] + ldr r1, [sp, 0x10] + strb r0, [r1] + b _080AFE6A + .align 2, 0 +_080AFE58: .4byte 0x000007fe +_080AFE5C: + ldr r2, [sp, 0x10] + ldrb r0, [r2] + movs r1, 0x8 + ands r1, r0 + ldr r0, [r4, 0x20] + orrs r0, r1 + strb r0, [r2] +_080AFE6A: + movs r0, 0xC0 + ldrb r1, [r4, 0x1A] + ands r0, r1 + adds r1, r4, 0 + adds r1, 0x21 + ldrb r1, [r1] + adds r0, r1, r0 + strb r0, [r4, 0x1A] + movs r2, 0xFF + ands r0, r2 + ldr r1, [sp, 0x14] + strb r0, [r1] +_080AFE82: + movs r0, 0x1 + ldrb r2, [r4, 0x1D] + ands r0, r2 + cmp r0, 0 + beq _080AFF08 + ldr r1, _080AFECC + ldrb r0, [r1] + ldrb r2, [r4, 0x1C] + bics r0, r2 + ldrb r2, [r4, 0x1B] + orrs r0, r2 + strb r0, [r1] + cmp r6, 0x3 + bne _080AFED4 + ldr r0, _080AFED0 + ldrb r1, [r4, 0x9] + adds r0, r1, r0 + ldrb r0, [r0] + ldr r2, [sp, 0xC] + strb r0, [r2] + movs r1, 0x80 + adds r0, r1, 0 + ldrb r2, [r4, 0x1A] + ands r0, r2 + cmp r0, 0 + beq _080AFF08 + ldr r0, [sp, 0x8] + strb r1, [r0] + ldrb r0, [r4, 0x1A] + ldr r1, [sp, 0x14] + strb r0, [r1] + movs r0, 0x7F + ldrb r2, [r4, 0x1A] + ands r0, r2 + strb r0, [r4, 0x1A] + b _080AFF08 + .align 2, 0 +_080AFECC: .4byte 0x04000081 +_080AFED0: .4byte gUnknown_826FBF0 +_080AFED4: + movs r0, 0xF + mov r1, r8 + ands r1, r0 + mov r8, r1 + ldrb r2, [r4, 0x9] + lsls r0, r2, 4 + add r0, r8 + ldr r1, [sp, 0xC] + strb r0, [r1] + movs r2, 0x80 + ldrb r0, [r4, 0x1A] + orrs r0, r2 + ldr r1, [sp, 0x14] + strb r0, [r1] + cmp r6, 0x1 + bne _080AFF08 + ldr r0, [sp, 0x8] + ldrb r1, [r0] + movs r0, 0x8 + ands r0, r1 + cmp r0, 0 + bne _080AFF08 + ldrb r0, [r4, 0x1A] + orrs r0, r2 + ldr r1, [sp, 0x14] + strb r0, [r1] +_080AFF08: + movs r0, 0 + strb r0, [r4, 0x1D] +_080AFF0C: + mov r6, r10 + mov r4, r9 + cmp r6, 0x4 + bgt _080AFF16 + b _080AFB0C +_080AFF16: + add sp, 0x1C + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + thumb_func_end sub_80AFADC + + thumb_func_start sub_80AFF28 +sub_80AFF28: + push {r4,lr} + adds r2, r0, 0 + lsls r1, 16 + lsrs r1, 16 + ldr r3, [r2, 0x34] + ldr r0, _080AFF4C + cmp r3, r0 + bne _080AFF44 + strh r1, [r2, 0x1E] + ldrh r4, [r2, 0x1C] + adds r0, r1, 0 + muls r0, r4 + asrs r0, 8 + strh r0, [r2, 0x20] +_080AFF44: + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080AFF4C: .4byte 0x68736d53 + thumb_func_end sub_80AFF28 + + thumb_func_start sub_80AFF50 +sub_80AFF50: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r4, r0, 0 + lsls r1, 16 + lsrs r7, r1, 16 + lsls r6, r2, 16 + ldr r3, [r4, 0x34] + ldr r0, _080AFFB4 + cmp r3, r0 + bne _080AFFA8 + adds r0, r3, 0x1 + str r0, [r4, 0x34] + ldrb r2, [r4, 0x8] + ldr r1, [r4, 0x2C] + movs r5, 0x1 + cmp r2, 0 + ble _080AFFA4 + movs r0, 0x80 + mov r8, r0 + lsrs r6, 18 + movs r0, 0x3 + mov r12, r0 +_080AFF80: + adds r0, r7, 0 + ands r0, r5 + cmp r0, 0 + beq _080AFF9A + ldrb r3, [r1] + mov r0, r8 + ands r0, r3 + cmp r0, 0 + beq _080AFF9A + strb r6, [r1, 0x13] + mov r0, r12 + orrs r0, r3 + strb r0, [r1] +_080AFF9A: + subs r2, 0x1 + adds r1, 0x50 + lsls r5, 1 + cmp r2, 0 + bgt _080AFF80 +_080AFFA4: + ldr r0, _080AFFB4 + str r0, [r4, 0x34] +_080AFFA8: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080AFFB4: .4byte 0x68736d53 + thumb_func_end sub_80AFF50 + + thumb_func_start sub_80AFFB8 +sub_80AFFB8: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r4, r0, 0 + lsls r1, 16 + lsrs r1, 16 + mov r12, r1 + lsls r2, 16 + lsrs r6, r2, 16 + ldr r3, [r4, 0x34] + ldr r0, _080B0028 + cmp r3, r0 + bne _080B001A + adds r0, r3, 0x1 + str r0, [r4, 0x34] + ldrb r2, [r4, 0x8] + ldr r3, [r4, 0x2C] + movs r5, 0x1 + cmp r2, 0 + ble _080B0016 + movs r0, 0x80 + mov r9, r0 + lsls r0, r6, 16 + asrs r7, r0, 24 + movs r0, 0xC + mov r8, r0 +_080AFFF0: + mov r0, r12 + ands r0, r5 + cmp r0, 0 + beq _080B000C + ldrb r1, [r3] + mov r0, r9 + ands r0, r1 + cmp r0, 0 + beq _080B000C + strb r7, [r3, 0xB] + strb r6, [r3, 0xD] + mov r0, r8 + orrs r0, r1 + strb r0, [r3] +_080B000C: + subs r2, 0x1 + adds r3, 0x50 + lsls r5, 1 + cmp r2, 0 + bgt _080AFFF0 +_080B0016: + ldr r0, _080B0028 + str r0, [r4, 0x34] +_080B001A: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080B0028: .4byte 0x68736d53 + thumb_func_end sub_80AFFB8 + + thumb_func_start sub_80B002C +sub_80B002C: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + adds r4, r0, 0 + lsls r1, 16 + lsrs r7, r1, 16 + lsls r2, 24 + lsrs r6, r2, 24 + ldr r3, [r4, 0x34] + ldr r0, _080B0090 + cmp r3, r0 + bne _080B0084 + adds r0, r3, 0x1 + str r0, [r4, 0x34] + ldrb r2, [r4, 0x8] + ldr r1, [r4, 0x2C] + movs r5, 0x1 + cmp r2, 0 + ble _080B0080 + movs r0, 0x80 + mov r8, r0 + movs r0, 0x3 + mov r12, r0 +_080B005C: + adds r0, r7, 0 + ands r0, r5 + cmp r0, 0 + beq _080B0076 + ldrb r3, [r1] + mov r0, r8 + ands r0, r3 + cmp r0, 0 + beq _080B0076 + strb r6, [r1, 0x15] + mov r0, r12 + orrs r0, r3 + strb r0, [r1] +_080B0076: + subs r2, 0x1 + adds r1, 0x50 + lsls r5, 1 + cmp r2, 0 + bgt _080B005C +_080B0080: + ldr r0, _080B0090 + str r0, [r4, 0x34] +_080B0084: + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080B0090: .4byte 0x68736d53 + thumb_func_end sub_80B002C + + thumb_func_start sub_80B0094 +sub_80B0094: + adds r1, r0, 0 + movs r2, 0 + movs r0, 0 + strb r0, [r1, 0x1A] + strb r0, [r1, 0x16] + ldrb r0, [r1, 0x18] + cmp r0, 0 + bne _080B00A8 + movs r0, 0xC + b _080B00AA +_080B00A8: + movs r0, 0x3 +_080B00AA: + ldrb r2, [r1] + orrs r0, r2 + strb r0, [r1] + bx lr + thumb_func_end sub_80B0094 + + thumb_func_start sub_80B00B4 +sub_80B00B4: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r6, r0, 0 + lsls r1, 16 + lsrs r1, 16 + mov r10, r1 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + ldr r1, [r6, 0x34] + ldr r0, _080B0124 + cmp r1, r0 + bne _080B0114 + adds r0, r1, 0x1 + str r0, [r6, 0x34] + ldrb r5, [r6, 0x8] + ldr r4, [r6, 0x2C] + movs r7, 0x1 + cmp r5, 0 + ble _080B0110 + mov r9, r8 +_080B00E4: + mov r0, r10 + ands r0, r7 + cmp r0, 0 + beq _080B0106 + movs r0, 0x80 + ldrb r1, [r4] + ands r0, r1 + cmp r0, 0 + beq _080B0106 + mov r0, r8 + strb r0, [r4, 0x17] + mov r1, r9 + cmp r1, 0 + bne _080B0106 + adds r0, r4, 0 + bl sub_80B0094 +_080B0106: + subs r5, 0x1 + adds r4, 0x50 + lsls r7, 1 + cmp r5, 0 + bgt _080B00E4 +_080B0110: + ldr r0, _080B0124 + str r0, [r6, 0x34] +_080B0114: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080B0124: .4byte 0x68736d53 + thumb_func_end sub_80B00B4 + + thumb_func_start sub_80B0128 +sub_80B0128: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r6, r0, 0 + lsls r1, 16 + lsrs r1, 16 + mov r10, r1 + lsls r2, 24 + lsrs r2, 24 + mov r8, r2 + ldr r1, [r6, 0x34] + ldr r0, _080B0198 + cmp r1, r0 + bne _080B0188 + adds r0, r1, 0x1 + str r0, [r6, 0x34] + ldrb r5, [r6, 0x8] + ldr r4, [r6, 0x2C] + movs r7, 0x1 + cmp r5, 0 + ble _080B0184 + mov r9, r8 +_080B0158: + mov r0, r10 + ands r0, r7 + cmp r0, 0 + beq _080B017A + movs r0, 0x80 + ldrb r1, [r4] + ands r0, r1 + cmp r0, 0 + beq _080B017A + mov r0, r8 + strb r0, [r4, 0x19] + mov r1, r9 + cmp r1, 0 + bne _080B017A + adds r0, r4, 0 + bl sub_80B0094 +_080B017A: + subs r5, 0x1 + adds r4, 0x50 + lsls r7, 1 + cmp r5, 0 + bgt _080B0158 +_080B0184: + ldr r0, _080B0198 + str r0, [r6, 0x34] +_080B0188: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080B0198: .4byte 0x68736d53 + thumb_func_end sub_80B0128 + + thumb_func_start sub_80B019C +sub_80B019C: + push {r4-r6,lr} + adds r4, r0, 0 + adds r6, r1, 0 + ldr r1, [r6, 0x40] + ldrb r5, [r1] + adds r2, r1, 0x1 + str r2, [r6, 0x40] + ldr r0, [r4, 0x18] + ldrb r1, [r1, 0x1] + adds r3, r1, r0 + adds r0, r2, 0x1 + str r0, [r6, 0x40] + ldrb r2, [r2, 0x1] + adds r0, 0x1 + str r0, [r6, 0x40] + cmp r5, 0x11 + bls _080B01C0 + b _080B02EE +_080B01C0: + lsls r0, r5, 2 + ldr r1, _080B01CC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080B01CC: .4byte _080B01D0 + .align 2, 0 +_080B01D0: + .4byte _080B0218 + .4byte _080B021C + .4byte _080B0224 + .4byte _080B022C + .4byte _080B0236 + .4byte _080B0244 + .4byte _080B0252 + .4byte _080B025A + .4byte _080B0262 + .4byte _080B026A + .4byte _080B0272 + .4byte _080B027A + .4byte _080B0282 + .4byte _080B0290 + .4byte _080B029E + .4byte _080B02AC + .4byte _080B02BA + .4byte _080B02C8 +_080B0218: + strb r2, [r3] + b _080B02EE +_080B021C: + ldrb r1, [r3] + adds r0, r1, r2 + strb r0, [r3] + b _080B02EE +_080B0224: + ldrb r1, [r3] + subs r0, r1, r2 + strb r0, [r3] + b _080B02EE +_080B022C: + ldr r0, [r4, 0x18] + adds r0, r2 + ldrb r0, [r0] + strb r0, [r3] + b _080B02EE +_080B0236: + ldr r0, [r4, 0x18] + adds r0, r2 + ldrb r1, [r3] + ldrb r0, [r0] + adds r0, r1, r0 + strb r0, [r3] + b _080B02EE +_080B0244: + ldr r0, [r4, 0x18] + adds r0, r2 + ldrb r1, [r3] + ldrb r0, [r0] + subs r0, r1, r0 + strb r0, [r3] + b _080B02EE +_080B0252: + ldrb r3, [r3] + cmp r3, r2 + beq _080B02D4 + b _080B02E8 +_080B025A: + ldrb r3, [r3] + cmp r3, r2 + bne _080B02D4 + b _080B02E8 +_080B0262: + ldrb r3, [r3] + cmp r3, r2 + bhi _080B02D4 + b _080B02E8 +_080B026A: + ldrb r3, [r3] + cmp r3, r2 + bcs _080B02D4 + b _080B02E8 +_080B0272: + ldrb r3, [r3] + cmp r3, r2 + bls _080B02D4 + b _080B02E8 +_080B027A: + ldrb r3, [r3] + cmp r3, r2 + bcc _080B02D4 + b _080B02E8 +_080B0282: + ldr r0, [r4, 0x18] + adds r0, r2 + ldrb r3, [r3] + ldrb r0, [r0] + cmp r3, r0 + beq _080B02D4 + b _080B02E8 +_080B0290: + ldr r0, [r4, 0x18] + adds r0, r2 + ldrb r3, [r3] + ldrb r0, [r0] + cmp r3, r0 + bne _080B02D4 + b _080B02E8 +_080B029E: + ldr r0, [r4, 0x18] + adds r0, r2 + ldrb r3, [r3] + ldrb r0, [r0] + cmp r3, r0 + bhi _080B02D4 + b _080B02E8 +_080B02AC: + ldr r0, [r4, 0x18] + adds r0, r2 + ldrb r3, [r3] + ldrb r0, [r0] + cmp r3, r0 + bcs _080B02D4 + b _080B02E8 +_080B02BA: + ldr r0, [r4, 0x18] + adds r0, r2 + ldrb r3, [r3] + ldrb r0, [r0] + cmp r3, r0 + bls _080B02D4 + b _080B02E8 +_080B02C8: + ldr r0, [r4, 0x18] + adds r0, r2 + ldrb r3, [r3] + ldrb r0, [r0] + cmp r3, r0 + bcs _080B02E8 +_080B02D4: + ldr r0, _080B02E4 + ldr r2, [r0] + adds r0, r4, 0 + adds r1, r6, 0 + bl _call_via_r2 + b _080B02EE + .align 2, 0 +_080B02E4: .4byte gUnknown_203AE84 +_080B02E8: + ldr r0, [r6, 0x40] + adds r0, 0x4 + str r0, [r6, 0x40] +_080B02EE: + pop {r4-r6} + pop {r0} + bx r0 + thumb_func_end sub_80B019C + + thumb_func_start sub_80B02F4 +sub_80B02F4: + push {lr} + ldr r2, [r1, 0x40] + ldrb r3, [r2] + adds r2, 0x1 + str r2, [r1, 0x40] + ldr r2, _080B0310 + lsls r3, 2 + adds r3, r2 + ldr r2, [r3] + bl _call_via_r2 + pop {r0} + bx r0 + .align 2, 0 +_080B0310: .4byte gUnknown_826FC34 + thumb_func_end sub_80B02F4 + + thumb_func_start sub_80B0314 +sub_80B0314: + push {lr} + ldr r2, _080B0324 + ldr r2, [r2] + bl _call_via_r2 + pop {r0} + bx r0 + .align 2, 0 +_080B0324: .4byte gUnknown_203AE80 + thumb_func_end sub_80B0314 + + thumb_func_start sub_80B0328 +sub_80B0328: + push {r4,lr} + ldr r2, [r1, 0x40] + ldr r0, _080B0360 + ands r4, r0 + ldrb r0, [r2] + orrs r4, r0 + ldrb r0, [r2, 0x1] + lsls r3, r0, 8 + ldr r0, _080B0364 + ands r4, r0 + orrs r4, r3 + ldrb r0, [r2, 0x2] + lsls r3, r0, 16 + ldr r0, _080B0368 + ands r4, r0 + orrs r4, r3 + ldrb r0, [r2, 0x3] + lsls r3, r0, 24 + ldr r0, _080B036C + ands r4, r0 + orrs r4, r3 + str r4, [r1, 0x28] + adds r2, 0x4 + str r2, [r1, 0x40] + pop {r4} + pop {r0} + bx r0 + .align 2, 0 +_080B0360: .4byte 0xffffff00 +_080B0364: .4byte 0xffff00ff +_080B0368: .4byte 0xff00ffff +_080B036C: .4byte 0x00ffffff + thumb_func_end sub_80B0328 + + thumb_func_start sub_80B0370 +sub_80B0370: + ldr r0, [r1, 0x40] + ldrb r2, [r0] + adds r0, r1, 0 + adds r0, 0x24 + strb r2, [r0] + ldr r0, [r1, 0x40] + adds r0, 0x1 + str r0, [r1, 0x40] + bx lr + thumb_func_end sub_80B0370 + + thumb_func_start sub_80B0384 +sub_80B0384: + ldr r0, [r1, 0x40] + ldrb r2, [r0] + adds r0, r1, 0 + adds r0, 0x2C + strb r2, [r0] + ldr r0, [r1, 0x40] + adds r0, 0x1 + str r0, [r1, 0x40] + bx lr + thumb_func_end sub_80B0384 + + thumb_func_start sub_80B0398 +sub_80B0398: + ldr r0, [r1, 0x40] + ldrb r0, [r0] + adds r2, r1, 0 + adds r2, 0x2D + strb r0, [r2] + ldr r0, [r1, 0x40] + adds r0, 0x1 + str r0, [r1, 0x40] + bx lr + thumb_func_end sub_80B0398 + + thumb_func_start sub_80B03AC +sub_80B03AC: + ldr r0, [r1, 0x40] + ldrb r0, [r0] + adds r2, r1, 0 + adds r2, 0x2E + strb r0, [r2] + ldr r0, [r1, 0x40] + adds r0, 0x1 + str r0, [r1, 0x40] + bx lr + thumb_func_end sub_80B03AC + + thumb_func_start sub_80B03C0 +sub_80B03C0: + ldr r0, [r1, 0x40] + ldrb r0, [r0] + adds r2, r1, 0 + adds r2, 0x2F + strb r0, [r2] + ldr r0, [r1, 0x40] + adds r0, 0x1 + str r0, [r1, 0x40] + bx lr + thumb_func_end sub_80B03C0 + + thumb_func_start sub_80B03D4 +sub_80B03D4: + ldr r0, [r1, 0x40] + ldrb r2, [r0] + strb r2, [r1, 0x1E] + adds r0, 0x1 + str r0, [r1, 0x40] + bx lr + thumb_func_end sub_80B03D4 + + thumb_func_start sub_80B03E0 +sub_80B03E0: + ldr r0, [r1, 0x40] + ldrb r2, [r0] + strb r2, [r1, 0x1F] + adds r0, 0x1 + str r0, [r1, 0x40] + bx lr + thumb_func_end sub_80B03E0 + + thumb_func_start sub_80B03EC +sub_80B03EC: + ldr r0, [r1, 0x40] + ldrb r0, [r0] + adds r2, r1, 0 + adds r2, 0x26 + strb r0, [r2] + ldr r0, [r1, 0x40] + adds r0, 0x1 + str r0, [r1, 0x40] + bx lr + thumb_func_end sub_80B03EC + + thumb_func_start ply_xswee +ply_xswee: + ldr r0, [r1, 0x40] + ldrb r0, [r0] + adds r2, r1, 0 + adds r2, 0x27 + strb r0, [r2] + ldr r0, [r1, 0x40] + adds r0, 0x1 + str r0, [r1, 0x40] + bx lr + thumb_func_end ply_xswee + + thumb_func_start nullsub_139 +nullsub_139: + bx lr + thumb_func_end nullsub_139 + + .align 2, 0 @ Don't pad with nop. diff --git a/asm/macros.inc b/asm/macros.inc new file mode 100644 index 00000000..156b2b09 --- /dev/null +++ b/asm/macros.inc @@ -0,0 +1 @@ + .include "asm/macros/function.inc" diff --git a/asm/macros/function.inc b/asm/macros/function.inc new file mode 100644 index 00000000..67fb373a --- /dev/null +++ b/asm/macros/function.inc @@ -0,0 +1,29 @@ + .macro arm_func_start name + .align 2, 0 + .global \name + .arm + .type \name, function + .endm + + .macro arm_func_end name + .size \name, .-\name + .endm + + .macro thumb_func_start name + .align 2, 0 + .global \name + .thumb + .thumb_func + .type \name, function + .endm + + .macro non_word_aligned_thumb_func_start name + .global \name + .thumb + .thumb_func + .type \name, function + .endm + + .macro thumb_func_end name + .size \name, .-\name + .endm diff --git a/asm/rom_header.inc b/asm/rom_header.inc new file mode 100644 index 00000000..09b95ece --- /dev/null +++ b/asm/rom_header.inc @@ -0,0 +1,52 @@ + .global RomHeaderNintendoLogo +RomHeaderNintendoLogo: + .byte 0x24,0xff,0xae,0x51,0x69,0x9a,0xa2,0x21 + .byte 0x3d,0x84,0x82,0x0a,0x84,0xe4,0x09,0xad + .byte 0x11,0x24,0x8b,0x98,0xc0,0x81,0x7f,0x21 + .byte 0xa3,0x52,0xbe,0x19,0x93,0x09,0xce,0x20 + .byte 0x10,0x46,0x4a,0x4a,0xf8,0x27,0x31,0xec + .byte 0x58,0xc7,0xe8,0x33,0x82,0xe3,0xce,0xbf + .byte 0x85,0xf4,0xdf,0x94,0xce,0x4b,0x09,0xc1 + .byte 0x94,0x56,0x8a,0xc0,0x13,0x72,0xa7,0xfc + .byte 0x9f,0x84,0x4d,0x73,0xa3,0xca,0x9a,0x61 + .byte 0x58,0x97,0xa3,0x27,0xfc,0x03,0x98,0x76 + .byte 0x23,0x1d,0xc7,0x61,0x03,0x04,0xae,0x56 + .byte 0xbf,0x38,0x84,0x00,0x40,0xa7,0x0e,0xfd + .byte 0xff,0x52,0xfe,0x03,0x6f,0x95,0x30,0xf1 + .byte 0x97,0xfb,0xc0,0x85,0x60,0xd6,0x80,0x25 + .byte 0xa9,0x63,0xbe,0x03,0x01,0x4e,0x38,0xe2 + .byte 0xf9,0xa2,0x34,0xff,0xbb,0x3e,0x03,0x44 + .byte 0x78,0x00,0x90,0xcb,0x88,0x11,0x3a,0x94 + .byte 0x65,0xc0,0x7c,0x63,0x87,0xf0,0x3c,0xaf + .byte 0xd6,0x25,0xe4,0x8b,0x38,0x0a,0xac,0x72 + .byte 0x21,0xd4,0xf8,0x07 + +RomHeaderGameTitle: + .ascii "POKE DUNGEON" + +RomHeaderGameCode: + .ascii "B24E" + +RomHeaderMakerCode: + .ascii "01" + +RomHeaderMagic: + .byte 0x96 + +RomHeaderMainUnitCode: + .byte 0 + +RomHeaderDeviceType: + .byte 0 + +RomHeaderReserved1: + .space 7 + +RomHeaderSoftwareVersion: + .byte 0 + +RomHeaderChecksum: + .byte 0xA4 + +RomHeaderReserved2: + .space 2 diff --git a/asm/syscall.s b/asm/syscall.s new file mode 100644 index 00000000..d114f31e --- /dev/null +++ b/asm/syscall.s @@ -0,0 +1,34 @@ + .include "asm/macros.inc" + + .syntax unified + + .text + + thumb_func_start CpuSet +CpuSet: + swi 0xB + bx lr + thumb_func_end CpuSet + + thumb_func_start SoundBiasReset +SoundBiasReset: + movs r0, 0 + swi 0x19 + bx lr + thumb_func_end SoundBiasReset + + thumb_func_start SoundBiasSet +SoundBiasSet: + movs r0, 0x1 + swi 0x19 + bx lr + thumb_func_end SoundBiasSet + + thumb_func_start VBlankIntrWait +VBlankIntrWait: + movs r2, 0 + swi 0x5 + bx lr + thumb_func_end VBlankIntrWait + + .align 2, 0 @ Don't pad with nop. diff --git a/constants/gba_constants.inc b/constants/gba_constants.inc new file mode 100644 index 00000000..9d59c8fc --- /dev/null +++ b/constants/gba_constants.inc @@ -0,0 +1,490 @@ + .set PSR_USR_MODE, 0x00000010 + .set PSR_FIQ_MODE, 0x00000011 + .set PSR_IRQ_MODE, 0x00000012 + .set PSR_SVC_MODE, 0x00000013 + .set PSR_ABT_MODE, 0x00000017 + .set PSR_UND_MODE, 0x0000001b + .set PSR_SYS_MODE, 0x0000001f + .set PSR_MODE_MASK, 0x0000001f + .set PSR_T_BIT, 0x00000020 + .set PSR_F_BIT, 0x00000040 + .set PSR_I_BIT, 0x00000080 + + .set EWRAM_START, 0x02000000 + .set EWRAM_END, EWRAM_START + 0x40000 + .set IWRAM_START, 0x03000000 + .set IWRAM_END, IWRAM_START + 0x8000 + + .set PLTT, 0x5000000 + .set BG_PLTT, PLTT + .set OBJ_PLTT, PLTT + 0x200 + + .set VRAM, 0x6000000 + .set BG_VRAM, VRAM + .set OBJ_VRAM0, VRAM + 0x10000 @ text-mode BG + .set OBJ_VRAM1, VRAM + 0x14000 @ bitmap-mode BG + + .set OAM, 0x7000000 + + .set SOUND_INFO_PTR, 0x3007FF0 + .set INTR_CHECK, 0x3007FF8 + .set INTR_VECTOR, 0x3007FFC + + .set INTR_FLAG_VBLANK, 1 << 0 + .set INTR_FLAG_HBLANK, 1 << 1 + .set INTR_FLAG_VCOUNT, 1 << 2 + .set INTR_FLAG_TIMER0, 1 << 3 + .set INTR_FLAG_TIMER1, 1 << 4 + .set INTR_FLAG_TIMER2, 1 << 5 + .set INTR_FLAG_TIMER3, 1 << 6 + .set INTR_FLAG_SERIAL, 1 << 7 + .set INTR_FLAG_DMA0, 1 << 8 + .set INTR_FLAG_DMA1, 1 << 9 + .set INTR_FLAG_DMA2, 1 << 10 + .set INTR_FLAG_DMA3, 1 << 11 + .set INTR_FLAG_KEYPAD, 1 << 12 + .set INTR_FLAG_GAMEPAK, 1 << 13 + + .set VCOUNT_VBLANK, 160 + .set TOTAL_SCANLINES, 228 + + .set REG_BASE, 0x4000000 @ I/O register base address + +@ I/O register offsets + .set OFFSET_REG_DISPCNT, 0x0 + .set OFFSET_REG_DISPSTAT, 0x4 + .set OFFSET_REG_VCOUNT, 0x6 + .set OFFSET_REG_BG0CNT, 0x8 + .set OFFSET_REG_BG1CNT, 0xa + .set OFFSET_REG_BG2CNT, 0xc + .set OFFSET_REG_BG3CNT, 0xe + .set OFFSET_REG_BG0HOFS, 0x10 + .set OFFSET_REG_BG0VOFS, 0x12 + .set OFFSET_REG_BG1HOFS, 0x14 + .set OFFSET_REG_BG1VOFS, 0x16 + .set OFFSET_REG_BG2HOFS, 0x18 + .set OFFSET_REG_BG2VOFS, 0x1a + .set OFFSET_REG_BG3HOFS, 0x1c + .set OFFSET_REG_BG3VOFS, 0x1e + .set OFFSET_REG_BG2PA, 0x20 + .set OFFSET_REG_BG2PB, 0x22 + .set OFFSET_REG_BG2PC, 0x24 + .set OFFSET_REG_BG2PD, 0x26 + .set OFFSET_REG_BG2X_L, 0x28 + .set OFFSET_REG_BG2X_H, 0x2a + .set OFFSET_REG_BG2Y_L, 0x2c + .set OFFSET_REG_BG2Y_H, 0x2e + .set OFFSET_REG_BG3PA, 0x30 + .set OFFSET_REG_BG3PB, 0x32 + .set OFFSET_REG_BG3PC, 0x34 + .set OFFSET_REG_BG3PD, 0x36 + .set OFFSET_REG_BG3X_L, 0x38 + .set OFFSET_REG_BG3X_H, 0x3a + .set OFFSET_REG_BG3Y_L, 0x3c + .set OFFSET_REG_BG3Y_H, 0x3e + .set OFFSET_REG_WIN0H, 0x40 + .set OFFSET_REG_WIN1H, 0x42 + .set OFFSET_REG_WIN0V, 0x44 + .set OFFSET_REG_WIN1V, 0x46 + .set OFFSET_REG_WININ, 0x48 + .set OFFSET_REG_WINOUT, 0x4a + .set OFFSET_REG_MOSAIC, 0x4c + .set OFFSET_REG_BLDCNT, 0x50 + .set OFFSET_REG_BLDALPHA, 0x52 + .set OFFSET_REG_BLDY, 0x54 + + .set OFFSET_REG_SOUND1CNT, 0x60 + .set OFFSET_REG_SOUND1CNT_L, 0x60 + .set OFFSET_REG_NR10, 0x60 + .set OFFSET_REG_SOUND1CNT_H, 0x62 + .set OFFSET_REG_NR11, 0x62 + .set OFFSET_REG_NR12, 0x63 + .set OFFSET_REG_SOUND1CNT_X, 0x64 + .set OFFSET_REG_NR13, 0x64 + .set OFFSET_REG_NR14, 0x65 + .set OFFSET_REG_SOUND2CNT, 0x68 + .set OFFSET_REG_SOUND2CNT_L, 0x68 + .set OFFSET_REG_NR21, 0x68 + .set OFFSET_REG_NR22, 0x69 + .set OFFSET_REG_SOUND2CNT_H, 0x6c + .set OFFSET_REG_NR23, 0x6c + .set OFFSET_REG_NR24, 0x6d + .set OFFSET_REG_SOUND3CNT, 0x70 + .set OFFSET_REG_SOUND3CNT_L, 0x70 + .set OFFSET_REG_NR30, 0x70 + .set OFFSET_REG_SOUND3CNT_H, 0x72 + .set OFFSET_REG_NR31, 0x72 + .set OFFSET_REG_NR32, 0x73 + .set OFFSET_REG_SOUND3CNT_X, 0x74 + .set OFFSET_REG_NR33, 0x74 + .set OFFSET_REG_NR34, 0x75 + .set OFFSET_REG_SOUND4CNT, 0x78 + .set OFFSET_REG_SOUND4CNT_L, 0x78 + .set OFFSET_REG_NR41, 0x78 + .set OFFSET_REG_NR42, 0x79 + .set OFFSET_REG_SOUND4CNT_H, 0x7c + .set OFFSET_REG_NR43, 0x7c + .set OFFSET_REG_NR44, 0x7d + .set OFFSET_REG_SOUNDCNT, 0x80 + .set OFFSET_REG_SOUNDCNT_L, 0x80 + .set OFFSET_REG_NR50, 0x80 + .set OFFSET_REG_NR51, 0x81 + .set OFFSET_REG_SOUNDCNT_H, 0x82 + .set OFFSET_REG_SOUNDCNT_X, 0x84 + .set OFFSET_REG_NR52, 0x84 + .set OFFSET_REG_SOUNDBIAS, 0x88 + .set OFFSET_REG_WAVE_RAM, 0x90 + .set OFFSET_REG_WAVE_RAM0, 0x90 + .set OFFSET_REG_WAVE_RAM0_L, 0x90 + .set OFFSET_REG_WAVE_RAM0_H, 0x92 + .set OFFSET_REG_WAVE_RAM1, 0x94 + .set OFFSET_REG_WAVE_RAM1_L, 0x94 + .set OFFSET_REG_WAVE_RAM1_H, 0x96 + .set OFFSET_REG_WAVE_RAM2, 0x98 + .set OFFSET_REG_WAVE_RAM2_L, 0x98 + .set OFFSET_REG_WAVE_RAM2_H, 0x9a + .set OFFSET_REG_WAVE_RAM3, 0x9c + .set OFFSET_REG_WAVE_RAM3_L, 0x9c + .set OFFSET_REG_WAVE_RAM3_H, 0x9e + .set OFFSET_REG_FIFO, 0xa0 + .set OFFSET_REG_FIFO_A, 0xa0 + .set OFFSET_REG_FIFO_A_L, 0xa0 + .set OFFSET_REG_FIFO_A_H, 0xa2 + .set OFFSET_REG_FIFO_B, 0xa4 + .set OFFSET_REG_FIFO_B_L, 0xa4 + .set OFFSET_REG_FIFO_B_H, 0xa6 + + .set OFFSET_REG_DMA0, 0xb0 + .set OFFSET_REG_DMA0SAD, 0xb0 + .set OFFSET_REG_DMA0SAD_L, 0xb0 + .set OFFSET_REG_DMA0SAD_H, 0xb2 + .set OFFSET_REG_DMA0DAD, 0xb4 + .set OFFSET_REG_DMA0DAD_L, 0xb4 + .set OFFSET_REG_DMA0DAD_H, 0xb6 + .set OFFSET_REG_DMA0CNT, 0xb8 + .set OFFSET_REG_DMA0CNT_L, 0xb8 + .set OFFSET_REG_DMA0CNT_H, 0xba + .set OFFSET_REG_DMA1, 0xbc + .set OFFSET_REG_DMA1SAD, 0xbc + .set OFFSET_REG_DMA1SAD_L, 0xbc + .set OFFSET_REG_DMA1SAD_H, 0xbe + .set OFFSET_REG_DMA1DAD, 0xc0 + .set OFFSET_REG_DMA1DAD_L, 0xc0 + .set OFFSET_REG_DMA1DAD_H, 0xc2 + .set OFFSET_REG_DMA1CNT, 0xc4 + .set OFFSET_REG_DMA1CNT_L, 0xc4 + .set OFFSET_REG_DMA1CNT_H, 0xc6 + .set OFFSET_REG_DMA2, 0xc8 + .set OFFSET_REG_DMA2SAD, 0xc8 + .set OFFSET_REG_DMA2SAD_L, 0xc8 + .set OFFSET_REG_DMA2SAD_H, 0xca + .set OFFSET_REG_DMA2DAD, 0xcc + .set OFFSET_REG_DMA2DAD_L, 0xcc + .set OFFSET_REG_DMA2DAD_H, 0xce + .set OFFSET_REG_DMA2CNT, 0xd0 + .set OFFSET_REG_DMA2CNT_L, 0xd0 + .set OFFSET_REG_DMA2CNT_H, 0xd2 + .set OFFSET_REG_DMA3, 0xd4 + .set OFFSET_REG_DMA3SAD, 0xd4 + .set OFFSET_REG_DMA3SAD_L, 0xd4 + .set OFFSET_REG_DMA3SAD_H, 0xd6 + .set OFFSET_REG_DMA3DAD, 0xd8 + .set OFFSET_REG_DMA3DAD_L, 0xd8 + .set OFFSET_REG_DMA3DAD_H, 0xda + .set OFFSET_REG_DMA3CNT, 0xdc + .set OFFSET_REG_DMA3CNT_L, 0xdc + .set OFFSET_REG_DMA3CNT_H, 0xde + + .set OFFSET_REG_TM0CNT, 0x100 + .set OFFSET_REG_TM0CNT_L, 0x100 + .set OFFSET_REG_TM0CNT_H, 0x102 + .set OFFSET_REG_TM1CNT, 0x104 + .set OFFSET_REG_TM1CNT_L, 0x104 + .set OFFSET_REG_TM1CNT_H, 0x106 + .set OFFSET_REG_TM2CNT, 0x108 + .set OFFSET_REG_TM2CNT_L, 0x108 + .set OFFSET_REG_TM2CNT_H, 0x10a + .set OFFSET_REG_TM3CNT, 0x10c + .set OFFSET_REG_TM3CNT_L, 0x10c + .set OFFSET_REG_TM3CNT_H, 0x10e + + .set OFFSET_REG_SIOCNT, 0x128 + .set OFFSET_REG_SIODATA8, 0x12a + .set OFFSET_REG_SIODATA32, 0x120 + .set OFFSET_REG_SIOMLT_SEND, 0x12a + .set OFFSET_REG_SIOMLT_RECV, 0x120 + .set OFFSET_REG_SIOMULTI0, 0x120 + .set OFFSET_REG_SIOMULTI1, 0x122 + .set OFFSET_REG_SIOMULTI2, 0x124 + .set OFFSET_REG_SIOMULTI3, 0x126 + + .set OFFSET_REG_KEYINPUT, 0x130 + .set OFFSET_REG_KEYCNT, 0x132 + + .set OFFSET_REG_RCNT, 0x134 + + .set OFFSET_REG_JOYCNT, 0x140 + .set OFFSET_REG_JOYSTAT, 0x158 + .set OFFSET_REG_JOY_RECV, 0x150 + .set OFFSET_REG_JOY_RECV_L, 0x150 + .set OFFSET_REG_JOY_RECV_H, 0x152 + .set OFFSET_REG_JOY_TRANS, 0x154 + .set OFFSET_REG_JOY_TRANS_L, 0x154 + .set OFFSET_REG_JOY_TRANS_H, 0x156 + + .set OFFSET_REG_IME, 0x208 + .set OFFSET_REG_IE, 0x200 + .set OFFSET_REG_IF, 0x202 + + .set OFFSET_REG_WAITCNT, 0x204 + +@ I/O register addresses + .set REG_DISPCNT, REG_BASE + OFFSET_REG_DISPCNT + .set REG_DISPSTAT, REG_BASE + OFFSET_REG_DISPSTAT + .set REG_VCOUNT, REG_BASE + OFFSET_REG_VCOUNT + .set REG_BG0CNT, REG_BASE + OFFSET_REG_BG0CNT + .set REG_BG1CNT, REG_BASE + OFFSET_REG_BG1CNT + .set REG_BG2CNT, REG_BASE + OFFSET_REG_BG2CNT + .set REG_BG3CNT, REG_BASE + OFFSET_REG_BG3CNT + .set REG_BG0HOFS, REG_BASE + OFFSET_REG_BG0HOFS + .set REG_BG0VOFS, REG_BASE + OFFSET_REG_BG0VOFS + .set REG_BG1HOFS, REG_BASE + OFFSET_REG_BG1HOFS + .set REG_BG1VOFS, REG_BASE + OFFSET_REG_BG1VOFS + .set REG_BG2HOFS, REG_BASE + OFFSET_REG_BG2HOFS + .set REG_BG2VOFS, REG_BASE + OFFSET_REG_BG2VOFS + .set REG_BG3HOFS, REG_BASE + OFFSET_REG_BG3HOFS + .set REG_BG3VOFS, REG_BASE + OFFSET_REG_BG3VOFS + .set REG_BG2PA, REG_BASE + OFFSET_REG_BG2PA + .set REG_BG2PB, REG_BASE + OFFSET_REG_BG2PB + .set REG_BG2PC, REG_BASE + OFFSET_REG_BG2PC + .set REG_BG2PD, REG_BASE + OFFSET_REG_BG2PD + .set REG_BG2X_L, REG_BASE + OFFSET_REG_BG2X_L + .set REG_BG2X_H, REG_BASE + OFFSET_REG_BG2X_H + .set REG_BG2Y_L, REG_BASE + OFFSET_REG_BG2Y_L + .set REG_BG2Y_H, REG_BASE + OFFSET_REG_BG2Y_H + .set REG_BG3PA, REG_BASE + OFFSET_REG_BG3PA + .set REG_BG3PB, REG_BASE + OFFSET_REG_BG3PB + .set REG_BG3PC, REG_BASE + OFFSET_REG_BG3PC + .set REG_BG3PD, REG_BASE + OFFSET_REG_BG3PD + .set REG_BG3X_L, REG_BASE + OFFSET_REG_BG3X_L + .set REG_BG3X_H, REG_BASE + OFFSET_REG_BG3X_H + .set REG_BG3Y_L, REG_BASE + OFFSET_REG_BG3Y_L + .set REG_BG3Y_H, REG_BASE + OFFSET_REG_BG3Y_H + .set REG_WIN0H, REG_BASE + OFFSET_REG_WIN0H + .set REG_WIN1H, REG_BASE + OFFSET_REG_WIN1H + .set REG_WIN0V, REG_BASE + OFFSET_REG_WIN0V + .set REG_WIN1V, REG_BASE + OFFSET_REG_WIN1V + .set REG_WININ, REG_BASE + OFFSET_REG_WININ + .set REG_WINOUT, REG_BASE + OFFSET_REG_WINOUT + .set REG_MOSAIC, REG_BASE + OFFSET_REG_MOSAIC + .set REG_BLDCNT, REG_BASE + OFFSET_REG_BLDCNT + .set REG_BLDALPHA, REG_BASE + OFFSET_REG_BLDALPHA + .set REG_BLDY, REG_BASE + OFFSET_REG_BLDY + + .set REG_SOUND1CNT, REG_BASE + OFFSET_REG_SOUND1CNT + .set REG_SOUND1CNT_L, REG_BASE + OFFSET_REG_SOUND1CNT_L + .set REG_NR10, REG_BASE + OFFSET_REG_NR10 + .set REG_SOUND1CNT_H, REG_BASE + OFFSET_REG_SOUND1CNT_H + .set REG_NR11, REG_BASE + OFFSET_REG_NR11 + .set REG_NR12, REG_BASE + OFFSET_REG_NR12 + .set REG_SOUND1CNT_X, REG_BASE + OFFSET_REG_SOUND1CNT_X + .set REG_NR13, REG_BASE + OFFSET_REG_NR13 + .set REG_NR14, REG_BASE + OFFSET_REG_NR14 + .set REG_SOUND2CNT, REG_BASE + OFFSET_REG_SOUND2CNT + .set REG_SOUND2CNT_L, REG_BASE + OFFSET_REG_SOUND2CNT_L + .set REG_NR21, REG_BASE + OFFSET_REG_NR21 + .set REG_NR22, REG_BASE + OFFSET_REG_NR22 + .set REG_SOUND2CNT_H, REG_BASE + OFFSET_REG_SOUND2CNT_H + .set REG_NR23, REG_BASE + OFFSET_REG_NR23 + .set REG_NR24, REG_BASE + OFFSET_REG_NR24 + .set REG_SOUND3CNT, REG_BASE + OFFSET_REG_SOUND3CNT + .set REG_SOUND3CNT_L, REG_BASE + OFFSET_REG_SOUND3CNT_L + .set REG_NR30, REG_BASE + OFFSET_REG_NR30 + .set REG_SOUND3CNT_H, REG_BASE + OFFSET_REG_SOUND3CNT_H + .set REG_NR31, REG_BASE + OFFSET_REG_NR31 + .set REG_NR32, REG_BASE + OFFSET_REG_NR32 + .set REG_SOUND3CNT_X, REG_BASE + OFFSET_REG_SOUND3CNT_X + .set REG_NR33, REG_BASE + OFFSET_REG_NR33 + .set REG_NR34, REG_BASE + OFFSET_REG_NR34 + .set REG_SOUND4CNT, REG_BASE + OFFSET_REG_SOUND4CNT + .set REG_SOUND4CNT_L, REG_BASE + OFFSET_REG_SOUND4CNT_L + .set REG_NR41, REG_BASE + OFFSET_REG_NR41 + .set REG_NR42, REG_BASE + OFFSET_REG_NR42 + .set REG_SOUND4CNT_H, REG_BASE + OFFSET_REG_SOUND4CNT_H + .set REG_NR43, REG_BASE + OFFSET_REG_NR43 + .set REG_NR44, REG_BASE + OFFSET_REG_NR44 + .set REG_SOUNDCNT, REG_BASE + OFFSET_REG_SOUNDCNT + .set REG_SOUNDCNT_L, REG_BASE + OFFSET_REG_SOUNDCNT_L + .set REG_NR50, REG_BASE + OFFSET_REG_NR50 + .set REG_NR51, REG_BASE + OFFSET_REG_NR51 + .set REG_SOUNDCNT_H, REG_BASE + OFFSET_REG_SOUNDCNT_H + .set REG_SOUNDCNT_X, REG_BASE + OFFSET_REG_SOUNDCNT_X + .set REG_NR52, REG_BASE + OFFSET_REG_NR52 + .set REG_SOUNDBIAS, REG_BASE + OFFSET_REG_SOUNDBIAS + .set REG_WAVE_RAM, REG_BASE + OFFSET_REG_WAVE_RAM + .set REG_WAVE_RAM0, REG_BASE + OFFSET_REG_WAVE_RAM0 + .set REG_WAVE_RAM0_L, REG_BASE + OFFSET_REG_WAVE_RAM0_L + .set REG_WAVE_RAM0_H, REG_BASE + OFFSET_REG_WAVE_RAM0_H + .set REG_WAVE_RAM1, REG_BASE + OFFSET_REG_WAVE_RAM1 + .set REG_WAVE_RAM1_L, REG_BASE + OFFSET_REG_WAVE_RAM1_L + .set REG_WAVE_RAM1_H, REG_BASE + OFFSET_REG_WAVE_RAM1_H + .set REG_WAVE_RAM2, REG_BASE + OFFSET_REG_WAVE_RAM2 + .set REG_WAVE_RAM2_L, REG_BASE + OFFSET_REG_WAVE_RAM2_L + .set REG_WAVE_RAM2_H, REG_BASE + OFFSET_REG_WAVE_RAM2_H + .set REG_WAVE_RAM3, REG_BASE + OFFSET_REG_WAVE_RAM3 + .set REG_WAVE_RAM3_L, REG_BASE + OFFSET_REG_WAVE_RAM3_L + .set REG_WAVE_RAM3_H, REG_BASE + OFFSET_REG_WAVE_RAM3_H + .set REG_FIFO, REG_BASE + OFFSET_REG_FIFO + .set REG_FIFO_A, REG_BASE + OFFSET_REG_FIFO_A + .set REG_FIFO_A_L, REG_BASE + OFFSET_REG_FIFO_A_L + .set REG_FIFO_A_H, REG_BASE + OFFSET_REG_FIFO_A_H + .set REG_FIFO_B, REG_BASE + OFFSET_REG_FIFO_B + .set REG_FIFO_B_L, REG_BASE + OFFSET_REG_FIFO_B_L + .set REG_FIFO_B_H, REG_BASE + OFFSET_REG_FIFO_B_H + + .set REG_DMA0, REG_BASE + OFFSET_REG_DMA0 + .set REG_DMA0SAD, REG_BASE + OFFSET_REG_DMA0SAD + .set REG_DMA0SAD_L, REG_BASE + OFFSET_REG_DMA0SAD_L + .set REG_DMA0SAD_H, REG_BASE + OFFSET_REG_DMA0SAD_H + .set REG_DMA0DAD, REG_BASE + OFFSET_REG_DMA0DAD + .set REG_DMA0DAD_L, REG_BASE + OFFSET_REG_DMA0DAD_L + .set REG_DMA0DAD_H, REG_BASE + OFFSET_REG_DMA0DAD_H + .set REG_DMA0CNT, REG_BASE + OFFSET_REG_DMA0CNT + .set REG_DMA0CNT_L, REG_BASE + OFFSET_REG_DMA0CNT_L + .set REG_DMA0CNT_H, REG_BASE + OFFSET_REG_DMA0CNT_H + .set REG_DMA1, REG_BASE + OFFSET_REG_DMA1 + .set REG_DMA1SAD, REG_BASE + OFFSET_REG_DMA1SAD + .set REG_DMA1SAD_L, REG_BASE + OFFSET_REG_DMA1SAD_L + .set REG_DMA1SAD_H, REG_BASE + OFFSET_REG_DMA1SAD_H + .set REG_DMA1DAD, REG_BASE + OFFSET_REG_DMA1DAD + .set REG_DMA1DAD_L, REG_BASE + OFFSET_REG_DMA1DAD_L + .set REG_DMA1DAD_H, REG_BASE + OFFSET_REG_DMA1DAD_H + .set REG_DMA1CNT, REG_BASE + OFFSET_REG_DMA1CNT + .set REG_DMA1CNT_L, REG_BASE + OFFSET_REG_DMA1CNT_L + .set REG_DMA1CNT_H, REG_BASE + OFFSET_REG_DMA1CNT_H + .set REG_DMA2, REG_BASE + OFFSET_REG_DMA2 + .set REG_DMA2SAD, REG_BASE + OFFSET_REG_DMA2SAD + .set REG_DMA2SAD_L, REG_BASE + OFFSET_REG_DMA2SAD_L + .set REG_DMA2SAD_H, REG_BASE + OFFSET_REG_DMA2SAD_H + .set REG_DMA2DAD, REG_BASE + OFFSET_REG_DMA2DAD + .set REG_DMA2DAD_L, REG_BASE + OFFSET_REG_DMA2DAD_L + .set REG_DMA2DAD_H, REG_BASE + OFFSET_REG_DMA2DAD_H + .set REG_DMA2CNT, REG_BASE + OFFSET_REG_DMA2CNT + .set REG_DMA2CNT_L, REG_BASE + OFFSET_REG_DMA2CNT_L + .set REG_DMA2CNT_H, REG_BASE + OFFSET_REG_DMA2CNT_H + .set REG_DMA3, REG_BASE + OFFSET_REG_DMA3 + .set REG_DMA3SAD, REG_BASE + OFFSET_REG_DMA3SAD + .set REG_DMA3SAD_L, REG_BASE + OFFSET_REG_DMA3SAD_L + .set REG_DMA3SAD_H, REG_BASE + OFFSET_REG_DMA3SAD_H + .set REG_DMA3DAD, REG_BASE + OFFSET_REG_DMA3DAD + .set REG_DMA3DAD_L, REG_BASE + OFFSET_REG_DMA3DAD_L + .set REG_DMA3DAD_H, REG_BASE + OFFSET_REG_DMA3DAD_H + .set REG_DMA3CNT, REG_BASE + OFFSET_REG_DMA3CNT + .set REG_DMA3CNT_L, REG_BASE + OFFSET_REG_DMA3CNT_L + .set REG_DMA3CNT_H, REG_BASE + OFFSET_REG_DMA3CNT_H + + .set REG_TM0CNT, REG_BASE + OFFSET_REG_TM0CNT + .set REG_TM0CNT_L, REG_BASE + OFFSET_REG_TM0CNT_L + .set REG_TM0CNT_H, REG_BASE + OFFSET_REG_TM0CNT_H + .set REG_TM1CNT, REG_BASE + OFFSET_REG_TM1CNT + .set REG_TM1CNT_L, REG_BASE + OFFSET_REG_TM1CNT_L + .set REG_TM1CNT_H, REG_BASE + OFFSET_REG_TM1CNT_H + .set REG_TM2CNT, REG_BASE + OFFSET_REG_TM2CNT + .set REG_TM2CNT_L, REG_BASE + OFFSET_REG_TM2CNT_L + .set REG_TM2CNT_H, REG_BASE + OFFSET_REG_TM2CNT_H + .set REG_TM3CNT, REG_BASE + OFFSET_REG_TM3CNT + .set REG_TM3CNT_L, REG_BASE + OFFSET_REG_TM3CNT_L + .set REG_TM3CNT_H, REG_BASE + OFFSET_REG_TM3CNT_H + + .set REG_SIOCNT, REG_BASE + OFFSET_REG_SIOCNT + .set REG_SIODATA8, REG_BASE + OFFSET_REG_SIODATA8 + .set REG_SIODATA32, REG_BASE + OFFSET_REG_SIODATA32 + .set REG_SIOMLT_SEND, REG_BASE + OFFSET_REG_SIOMLT_SEND + .set REG_SIOMLT_RECV, REG_BASE + OFFSET_REG_SIOMLT_RECV + .set REG_SIOMULTI0, REG_BASE + OFFSET_REG_SIOMULTI0 + .set REG_SIOMULTI1, REG_BASE + OFFSET_REG_SIOMULTI1 + .set REG_SIOMULTI2, REG_BASE + OFFSET_REG_SIOMULTI2 + .set REG_SIOMULTI3, REG_BASE + OFFSET_REG_SIOMULTI3 + + .set REG_KEYINPUT, REG_BASE + OFFSET_REG_KEYINPUT + .set REG_KEYCNT, REG_BASE + OFFSET_REG_KEYCNT + + .set REG_RCNT, REG_BASE + OFFSET_REG_RCNT + + .set REG_JOYCNT, REG_BASE + OFFSET_REG_JOYCNT + .set REG_JOYSTAT, REG_BASE + OFFSET_REG_JOYSTAT + .set REG_JOY_RECV, REG_BASE + OFFSET_REG_JOY_RECV + .set REG_JOY_RECV_L, REG_BASE + OFFSET_REG_JOY_RECV_L + .set REG_JOY_RECV_H, REG_BASE + OFFSET_REG_JOY_RECV_H + .set REG_JOY_TRANS, REG_BASE + OFFSET_REG_JOY_TRANS + .set REG_JOY_TRANS_L, REG_BASE + OFFSET_REG_JOY_TRANS_L + .set REG_JOY_TRANS_H, REG_BASE + OFFSET_REG_JOY_TRANS_H + + .set REG_IME, REG_BASE + OFFSET_REG_IME + .set REG_IE, REG_BASE + OFFSET_REG_IE + .set REG_IF, REG_BASE + OFFSET_REG_IF + + .set REG_WAITCNT, REG_BASE + OFFSET_REG_WAITCNT + +@ DMA register constants + + .set DMA_DEST_INC, 0x0000 + .set DMA_DEST_DEC, 0x0020 + .set DMA_DEST_FIXED, 0x0040 + .set DMA_DEST_RELOAD, 0x0060 + .set DMA_SRC_INC, 0x0000 + .set DMA_SRC_DEC, 0x0080 + .set DMA_SRC_FIXED, 0x0100 + .set DMA_REPEAT, 0x0200 + .set DMA_16BIT, 0x0000 + .set DMA_32BIT, 0x0400 + .set DMA_DREQ_ON, 0x0800 + .set DMA_START_NOW, 0x0000 + .set DMA_START_VBLANK, 0x1000 + .set DMA_START_HBLANK, 0x2000 + .set DMA_START_SPECIAL, 0x3000 + .set DMA_INTR_ENABLE, 0x4000 + .set DMA_ENABLE, 0x8000 + +@ OAM attribute constants + + .set OAM_OBJ_NORMAL, 0x00000000 + .set OAM_OBJ_BLEND, 0x00000400 + .set OAM_OBJ_WINDOW, 0x00000800 + + .set OAM_AFFINE_NONE, 0x00000000 + .set OAM_AFFINE_NORMAL_SIZE, 0x00000100 + .set OAM_OBJ_DISABLED, 0x00000200 + .set OAM_AFFINE_DOUBLE_SIZE, 0x00000300 + + .set OAM_MOSAIC_OFF, 0x00000000 + .set OAM_MOSAIC_ON, 0x00001000 + + .set OAM_4BPP, 0x00000000 + .set OAM_8BPP, 0x00002000 + + .set OAM_H_FLIP, 0x10000000 + .set OAM_V_FLIP, 0x20000000 + + .set OAM_SQUARE, 0x00000000 + .set OAM_H_RECTANGLE, 0x00004000 + .set OAM_V_RECTANGLE, 0x00008000 + .set OAM_SIZE_0, 0x00000000 + .set OAM_SIZE_1, 0x40000000 + .set OAM_SIZE_2, 0x80000000 + .set OAM_SIZE_3, 0xc0000000 + + .set OAM_SIZE_8x8, OAM_SIZE_0 | OAM_SQUARE + .set OAM_SIZE_16x16, OAM_SIZE_1 | OAM_SQUARE + .set OAM_SIZE_32x32, OAM_SIZE_2 | OAM_SQUARE + .set OAM_SIZE_64x64, OAM_SIZE_3 | OAM_SQUARE + + .set OAM_SIZE_16x8, OAM_SIZE_0 | OAM_H_RECTANGLE + .set OAM_SIZE_32x8, OAM_SIZE_1 | OAM_H_RECTANGLE + .set OAM_SIZE_32x16, OAM_SIZE_2 | OAM_H_RECTANGLE + .set OAM_SIZE_64x32, OAM_SIZE_3 | OAM_H_RECTANGLE + + .set OAM_SIZE_8x16, OAM_SIZE_0 | OAM_V_RECTANGLE + .set OAM_SIZE_8x32, OAM_SIZE_1 | OAM_V_RECTANGLE + .set OAM_SIZE_16x32, OAM_SIZE_2 | OAM_V_RECTANGLE + .set OAM_SIZE_32x64, OAM_SIZE_3 | OAM_V_RECTANGLE diff --git a/data/data.s b/data/data.s new file mode 100644 index 00000000..e14ec6c8 --- /dev/null +++ b/data/data.s @@ -0,0 +1,12259 @@ + .section .rodata + + .asciz "pksdir0" + + .global gUnknown_80B690C +gUnknown_80B690C: @ 80B690C + .incbin "baserom.gba", 0xB690C, 0x88 + + .global gUnknown_80B6994 +gUnknown_80B6994: @ 80B6994 + .incbin "baserom.gba", 0xB6994, 0x28 + + .global gUnknown_80B69BC +gUnknown_80B69BC: @ 80B69BC + .incbin "baserom.gba", 0xB69BC, 0x3C + + .global gUnknown_80B69F8 +gUnknown_80B69F8: @ 80B69F8 + .incbin "baserom.gba", 0xB69F8, 0x30 + + .global gUnknown_80B6A28 +gUnknown_80B6A28: @ 80B6A28 + .incbin "baserom.gba", 0xB6A28, 0xC + + .global gUnknown_80B6A34 +gUnknown_80B6A34: @ 80B6A34 + .incbin "baserom.gba", 0xB6A34, 0x48 + + .global gUnknown_80B6A7C +gUnknown_80B6A7C: @ 80B6A7C + .incbin "baserom.gba", 0xB6A7C, 0x24 + + .global gUnknown_80B6AA0 +gUnknown_80B6AA0: @ 80B6AA0 + .incbin "baserom.gba", 0xB6AA0, 0x74 + + .global gUnknown_80B6B14 +gUnknown_80B6B14: @ 80B6B14 + .incbin "baserom.gba", 0xB6B14, 0x64 + + .global gUnknown_80B6B78 +gUnknown_80B6B78: @ 80B6B78 + .incbin "baserom.gba", 0xB6B78, 0x10 + + .global gUnknown_80B6B88 +gUnknown_80B6B88: @ 80B6B88 + .incbin "baserom.gba", 0xB6B88, 0x54 + + .global gUnknown_80B6BDC +gUnknown_80B6BDC: @ 80B6BDC + .incbin "baserom.gba", 0xB6BDC, 0xDC + + .global gUnknown_80B6CB8 +gUnknown_80B6CB8: @ 80B6CB8 + .incbin "baserom.gba", 0xB6CB8, 0xD8 + + .global gUnknown_80B6D90 +gUnknown_80B6D90: @ 80B6D90 + .incbin "baserom.gba", 0xB6D90, 0x3B4 + + .global gUnknown_80B7144 +gUnknown_80B7144: @ 80B7144 + .incbin "baserom.gba", 0xB7144, 0x8 + + .global gUnknown_80B714C +gUnknown_80B714C: @ 80B714C + .incbin "baserom.gba", 0xB714C, 0x54 + + .global gUnknown_80B71A0 +gUnknown_80B71A0: @ 80B71A0 + .incbin "baserom.gba", 0xB71A0, 0x44 + + .global gUnknown_80B71E4 +gUnknown_80B71E4: @ 80B71E4 + .incbin "baserom.gba", 0xB71E4, 0xE8 + + .global gUnknown_80B72CC +gUnknown_80B72CC: @ 80B72CC + .incbin "baserom.gba", 0xB72CC, 0x4C + + .global gUnknown_80B7318 +gUnknown_80B7318: @ 80B7318 + .incbin "baserom.gba", 0xB7318, 0xC + + .global gUnknown_80B7324 +gUnknown_80B7324: @ 80B7324 + .incbin "baserom.gba", 0xB7324, 0x2C + + .global gUnknown_80B7350 +gUnknown_80B7350: @ 80B7350 + .incbin "baserom.gba", 0xB7350, 0xC + + .global gUnknown_80B735C +gUnknown_80B735C: @ 80B735C + .incbin "baserom.gba", 0xB735C, 0x1C + + .global gUnknown_80B7378 +gUnknown_80B7378: @ 80B7378 + .incbin "baserom.gba", 0xB7378, 0x10 + + .global gUnknown_80B7388 +gUnknown_80B7388: @ 80B7388 + .incbin "baserom.gba", 0xB7388, 0xC + + .global gUnknown_80B7394 +gUnknown_80B7394: @ 80B7394 + .incbin "baserom.gba", 0xB7394, 0xAA8 + + .global gUnknown_80B7E3C +gUnknown_80B7E3C: @ 80B7E3C + .incbin "baserom.gba", 0xB7E3C, 0x7C + + .global gUnknown_80B7EB8 +gUnknown_80B7EB8: @ 80B7EB8 + .incbin "baserom.gba", 0xB7EB8, 0xC + + .global gUnknown_80B7EC4 +gUnknown_80B7EC4: @ 80B7EC4 + .incbin "baserom.gba", 0xB7EC4, 0x38 + + .global gUnknown_80B7EFC +gUnknown_80B7EFC: @ 80B7EFC + .incbin "baserom.gba", 0xB7EFC, 0x18 + + .global gUnknown_80B7F14 +gUnknown_80B7F14: @ 80B7F14 + .incbin "baserom.gba", 0xB7F14, 0xC + + .global gUnknown_80B7F20 +gUnknown_80B7F20: @ 80B7F20 + .incbin "baserom.gba", 0xB7F20, 0x68 + + .global gUnknown_80B7F88 +gUnknown_80B7F88: @ 80B7F88 + .incbin "baserom.gba", 0xB7F88, 0xC + + .global gUnknown_80B7F94 +gUnknown_80B7F94: @ 80B7F94 + .incbin "baserom.gba", 0xB7F94, 0x74 + + .global gUnknown_80B8008 +gUnknown_80B8008: @ 80B8008 + .incbin "baserom.gba", 0xB8008, 0x22 + + .global gUnknown_80B802A +gUnknown_80B802A: @ 80B802A + .incbin "baserom.gba", 0xB802A, 0x140 + + .global gUnknown_80B816A +gUnknown_80B816A: @ 80B816A + .incbin "baserom.gba", 0xB816A, 0x140 + + .global gUnknown_80B82AA +gUnknown_80B82AA: @ 80B82AA + .incbin "baserom.gba", 0xB82AA, 0x140 + + .global gUnknown_80B83EA +gUnknown_80B83EA: @ 80B83EA + .incbin "baserom.gba", 0xB83EA, 0x152 + + .global gUnknown_80B853C +gUnknown_80B853C: @ 80B853C + .incbin "baserom.gba", 0xB853C, 0x40 + + .global gUnknown_80B857C +gUnknown_80B857C: @ 80B857C + .incbin "baserom.gba", 0xB857C, 0x60 + + .global gUnknown_80B85DC +gUnknown_80B85DC: @ 80B85DC + .incbin "baserom.gba", 0xB85DC, 0xC8 + + .global gUnknown_80B86A4 +gUnknown_80B86A4: @ 80B86A4 + .incbin "baserom.gba", 0xB86A4, 0x10 + + .global gUnknown_80B86B4 +gUnknown_80B86B4: @ 80B86B4 + .incbin "baserom.gba", 0xB86B4, 0x100 + + .global gUnknown_80B87B4 +gUnknown_80B87B4: @ 80B87B4 + .incbin "baserom.gba", 0xB87B4, 0x8 + + .global gUnknown_80B87BC +gUnknown_80B87BC: @ 80B87BC + .incbin "baserom.gba", 0xB87BC, 0x8 + + .global gUnknown_80B87C4 +gUnknown_80B87C4: @ 80B87C4 + .incbin "baserom.gba", 0xB87C4, 0x20 + + .global gUnknown_80B87E4 +gUnknown_80B87E4: @ 80B87E4 + .incbin "baserom.gba", 0xB87E4, 0x20 + + .global gUnknown_80B8804 +gUnknown_80B8804: @ 80B8804 + .incbin "baserom.gba", 0xB8804, 0x10 + + .global gUnknown_80B8814 +gUnknown_80B8814: @ 80B8814 + .incbin "baserom.gba", 0xB8814, 0x10 + + .global gUnknown_80B8824 +gUnknown_80B8824: @ 80B8824 + .incbin "baserom.gba", 0xB8824, 0x24 + + .global gUnknown_80B8848 +gUnknown_80B8848: @ 80B8848 + .incbin "baserom.gba", 0xB8848, 0x20 + + .global gUnknown_80B8868 +gUnknown_80B8868: @ 80B8868 + .incbin "baserom.gba", 0xB8868, 0x48 + + .global gUnknown_80B88B0 +gUnknown_80B88B0: @ 80B88B0 + .incbin "baserom.gba", 0xB88B0, 0x8 + + .global gUnknown_80B88B8 +gUnknown_80B88B8: @ 80B88B8 + .incbin "baserom.gba", 0xB88B8, 0x8 + + .global gUnknown_80B88C0 +gUnknown_80B88C0: @ 80B88C0 + .incbin "baserom.gba", 0xB88C0, 0xC + + .global gUnknown_80B88CC +gUnknown_80B88CC: @ 80B88CC + .incbin "baserom.gba", 0xB88CC, 0x18 + + .global gUnknown_80B88E4 +gUnknown_80B88E4: @ 80B88E4 + .incbin "baserom.gba", 0xB88E4, 0x200 + + .global gUnknown_80B8AE4 +gUnknown_80B8AE4: @ 80B8AE4 + .incbin "baserom.gba", 0xB8AE4, 0x800 + + .global gUnknown_80B92E4 +gUnknown_80B92E4: @ 80B92E4 + .incbin "baserom.gba", 0xB92E4, 0x400 + + .global gUnknown_80B96E4 +gUnknown_80B96E4: @ 80B96E4 + .incbin "baserom.gba", 0xB96E4, 0x4B0 + + .global gUnknown_80B9B94 +gUnknown_80B9B94: @ 80B9B94 + .incbin "baserom.gba", 0xB9B94, 0x8 + + .global gUnknown_80B9B9C +gUnknown_80B9B9C: @ 80B9B9C + .incbin "baserom.gba", 0xB9B9C, 0x1C + + .global gUnknown_80B9BB8 +gUnknown_80B9BB8: @ 80B9BB8 + .incbin "baserom.gba", 0xB9BB8, 0x39 + + .global gUnknown_80B9BF1 +gUnknown_80B9BF1: @ 80B9BF1 + .incbin "baserom.gba", 0xB9BF1, 0xF + + .global gUnknown_80B9C00 +gUnknown_80B9C00: @ 80B9C00 + .incbin "baserom.gba", 0xB9C00, 0x60 + + .global gUnknown_80B9C60 +gUnknown_80B9C60: @ 80B9C60 + .incbin "baserom.gba", 0xB9C60, 0xC + + .global gUnknown_80B9C6C +gUnknown_80B9C6C: @ 80B9C6C + .incbin "baserom.gba", 0xB9C6C, 0x8 + + .global gUnknown_80B9C74 +gUnknown_80B9C74: @ 80B9C74 + .incbin "baserom.gba", 0xB9C74, 0x8 + + .global gUnknown_80B9C7C +gUnknown_80B9C7C: @ 80B9C7C + .incbin "baserom.gba", 0xB9C7C, 0x20 + + .global gUnknown_80B9C9C +gUnknown_80B9C9C: @ 80B9C9C + .incbin "baserom.gba", 0xB9C9C, 0x28 + + .global gUnknown_80B9CC4 +gUnknown_80B9CC4: @ 80B9CC4 + .incbin "baserom.gba", 0xB9CC4, 0x3F00 + + .global gUnknown_80BDBC4 +gUnknown_80BDBC4: @ 80BDBC4 + .incbin "baserom.gba", 0xBDBC4, 0x3C78 + + .global gUnknown_80C183C +gUnknown_80C183C: @ 80C183C + .incbin "baserom.gba", 0xC183C, 0xCB40 + + .global gUnknown_80CE37C +gUnknown_80CE37C: @ 80CE37C + .incbin "baserom.gba", 0xCE37C, 0x3C0 + + .global gUnknown_80CE73C +gUnknown_80CE73C: @ 80CE73C + .incbin "baserom.gba", 0xCE73C, 0x40 + + .global gUnknown_80CE77C +gUnknown_80CE77C: @ 80CE77C + .incbin "baserom.gba", 0xCE77C, 0xC + + .global gUnknown_80CE788 +gUnknown_80CE788: @ 80CE788 + .incbin "baserom.gba", 0xCE788, 0x14 + + .global gUnknown_80CE79C +gUnknown_80CE79C: @ 80CE79C + .incbin "baserom.gba", 0xCE79C, 0x198 + + .global gUnknown_80CE934 +gUnknown_80CE934: @ 80CE934 + .incbin "baserom.gba", 0xCE934, 0x4B40 + + .global gUnknown_80D3474 +gUnknown_80D3474: @ 80D3474 + .incbin "baserom.gba", 0xD3474, 0xF0 + + .global gUnknown_80D3564 +gUnknown_80D3564: @ 80D3564 + .incbin "baserom.gba", 0xD3564, 0xC + + .global gUnknown_80D3570 +gUnknown_80D3570: @ 80D3570 + .incbin "baserom.gba", 0xD3570, 0x94C + + .global gUnknown_80D3EBC +gUnknown_80D3EBC: @ 80D3EBC + .incbin "baserom.gba", 0xD3EBC, 0x20 + + .global gUnknown_80D3EDC +gUnknown_80D3EDC: @ 80D3EDC + .incbin "baserom.gba", 0xD3EDC, 0x10 + + .global gUnknown_80D3EEC +gUnknown_80D3EEC: @ 80D3EEC + .incbin "baserom.gba", 0xD3EEC, 0x10 + + .global gUnknown_80D3EFC +gUnknown_80D3EFC: @ 80D3EFC + .incbin "baserom.gba", 0xD3EFC, 0x18 + + .global gUnknown_80D3F14 +gUnknown_80D3F14: @ 80D3F14 + .incbin "baserom.gba", 0xD3F14, 0x100 + + .global gUnknown_80D4014 +gUnknown_80D4014: @ 80D4014 + .incbin "baserom.gba", 0xD4014, 0x48 + + .global gUnknown_80D405C +gUnknown_80D405C: @ 80D405C + .incbin "baserom.gba", 0xD405C, 0x8 + + .global gUnknown_80D4064 +gUnknown_80D4064: @ 80D4064 + .incbin "baserom.gba", 0xD4064, 0x8 + + .global gUnknown_80D406C +gUnknown_80D406C: @ 80D406C + .incbin "baserom.gba", 0xD406C, 0x8 + + .global gUnknown_80D4074 +gUnknown_80D4074: @ 80D4074 + .incbin "baserom.gba", 0xD4074, 0x8 + + .global gUnknown_80D407C +gUnknown_80D407C: @ 80D407C + .incbin "baserom.gba", 0xD407C, 0x4 + + .global gUnknown_80D4080 +gUnknown_80D4080: @ 80D4080 + .incbin "baserom.gba", 0xD4080, 0xC + + .global gUnknown_80D408C +gUnknown_80D408C: @ 80D408C + .incbin "baserom.gba", 0xD408C, 0x38 + + .global gUnknown_80D40C4 +gUnknown_80D40C4: @ 80D40C4 + .incbin "baserom.gba", 0xD40C4, 0x20 + + .global gUnknown_80D40E4 +gUnknown_80D40E4: @ 80D40E4 + .incbin "baserom.gba", 0xD40E4, 0x8 + + .global gUnknown_80D40EC +gUnknown_80D40EC: @ 80D40EC + .incbin "baserom.gba", 0xD40EC, 0x8 + + .global gUnknown_80D40F4 +gUnknown_80D40F4: @ 80D40F4 + .incbin "baserom.gba", 0xD40F4, 0x8 + + .global gUnknown_80D40FC +gUnknown_80D40FC: @ 80D40FC + .incbin "baserom.gba", 0xD40FC, 0x8 + + .global gUnknown_80D4104 +gUnknown_80D4104: @ 80D4104 + .incbin "baserom.gba", 0xD4104, 0x1C + + .global gUnknown_80D4120 +gUnknown_80D4120: @ 80D4120 + .incbin "baserom.gba", 0xD4120, 0x4 + + .global gUnknown_80D4124 +gUnknown_80D4124: @ 80D4124 + .incbin "baserom.gba", 0xD4124, 0x20 + + .global gUnknown_80D4144 +gUnknown_80D4144: @ 80D4144 + .incbin "baserom.gba", 0xD4144, 0x48 + + .global gUnknown_80D418C +gUnknown_80D418C: @ 80D418C + .incbin "baserom.gba", 0xD418C, 0x24 + + .global gUnknown_80D41B0 +gUnknown_80D41B0: @ 80D41B0 + .incbin "baserom.gba", 0xD41B0, 0x14 + + .global gUnknown_80D41C4 +gUnknown_80D41C4: @ 80D41C4 + .incbin "baserom.gba", 0xD41C4, 0x28 + + .global gUnknown_80D41EC +gUnknown_80D41EC: @ 80D41EC + .incbin "baserom.gba", 0xD41EC, 0x30 + + .global gUnknown_80D421C +gUnknown_80D421C: @ 80D421C + .incbin "baserom.gba", 0xD421C, 0x6C + + .global gUnknown_80D4288 +gUnknown_80D4288: @ 80D4288 + .incbin "baserom.gba", 0xD4288, 0x38 + + .global gUnknown_80D42C0 +gUnknown_80D42C0: @ 80D42C0 + .incbin "baserom.gba", 0xD42C0, 0x14 + + .global gUnknown_80D42D4 +gUnknown_80D42D4: @ 80D42D4 + .incbin "baserom.gba", 0xD42D4, 0x80 + + .global gUnknown_80D4354 +gUnknown_80D4354: @ 80D4354 + .incbin "baserom.gba", 0xD4354, 0x44 + + .global gUnknown_80D4398 +gUnknown_80D4398: @ 80D4398 + .incbin "baserom.gba", 0xD4398, 0x40 + + .global gUnknown_80D43D8 +gUnknown_80D43D8: @ 80D43D8 + .incbin "baserom.gba", 0xD43D8, 0x60 + + .global gUnknown_80D4438 +gUnknown_80D4438: @ 80D4438 + .incbin "baserom.gba", 0xD4438, 0x14 + + .global gUnknown_80D444C +gUnknown_80D444C: @ 80D444C + .incbin "baserom.gba", 0xD444C, 0x64 + + .global gUnknown_80D44B0 +gUnknown_80D44B0: @ 80D44B0 + .incbin "baserom.gba", 0xD44B0, 0x18 + + .global gUnknown_80D44C8 +gUnknown_80D44C8: @ 80D44C8 + .incbin "baserom.gba", 0xD44C8, 0xE4 + + .global gUnknown_80D45AC +gUnknown_80D45AC: @ 80D45AC + .incbin "baserom.gba", 0xD45AC, 0x48 + + .global gUnknown_80D45F4 +gUnknown_80D45F4: @ 80D45F4 + .incbin "baserom.gba", 0xD45F4, 0x74 + + .global gUnknown_80D4668 +gUnknown_80D4668: @ 80D4668 + .incbin "baserom.gba", 0xD4668, 0xD4 + + .global gUnknown_80D473C +gUnknown_80D473C: @ 80D473C + .incbin "baserom.gba", 0xD473C, 0x64 + + .global gUnknown_80D47A0 +gUnknown_80D47A0: @ 80D47A0 + .incbin "baserom.gba", 0xD47A0, 0x18 + + .global gUnknown_80D47B8 +gUnknown_80D47B8: @ 80D47B8 + .incbin "baserom.gba", 0xD47B8, 0x10 + + .global gUnknown_80D47C8 +gUnknown_80D47C8: @ 80D47C8 + .incbin "baserom.gba", 0xD47C8, 0x60 + + .global gUnknown_80D4828 +gUnknown_80D4828: @ 80D4828 + .incbin "baserom.gba", 0xD4828, 0x8 + + .global gUnknown_80D4830 +gUnknown_80D4830: @ 80D4830 + .incbin "baserom.gba", 0xD4830, 0x2C + + .global gUnknown_80D485C +gUnknown_80D485C: @ 80D485C + .incbin "baserom.gba", 0xD485C, 0x24 + + .global gUnknown_80D4880 +gUnknown_80D4880: @ 80D4880 + .incbin "baserom.gba", 0xD4880, 0x20 + + .global gUnknown_80D48A0 +gUnknown_80D48A0: @ 80D48A0 + .incbin "baserom.gba", 0xD48A0, 0xC + + .global gUnknown_80D48AC +gUnknown_80D48AC: @ 80D48AC + .incbin "baserom.gba", 0xD48AC, 0x18 + + .global gUnknown_80D48C4 +gUnknown_80D48C4: @ 80D48C4 + .incbin "baserom.gba", 0xD48C4, 0x18 + + .global gUnknown_80D48DC +gUnknown_80D48DC: @ 80D48DC + .incbin "baserom.gba", 0xD48DC, 0x18 + + .global gUnknown_80D48F4 +gUnknown_80D48F4: @ 80D48F4 + .incbin "baserom.gba", 0xD48F4, 0x4 + + .global gUnknown_80D48F8 +gUnknown_80D48F8: @ 80D48F8 + .incbin "baserom.gba", 0xD48F8, 0x8 + + .global gUnknown_80D4900 +gUnknown_80D4900: @ 80D4900 + .incbin "baserom.gba", 0xD4900, 0x4 + + .global gUnknown_80D4904 +gUnknown_80D4904: @ 80D4904 + .incbin "baserom.gba", 0xD4904, 0x4 + + .global gUnknown_80D4908 +gUnknown_80D4908: @ 80D4908 + .incbin "baserom.gba", 0xD4908, 0x8 + + .global gUnknown_80D4910 +gUnknown_80D4910: @ 80D4910 + .incbin "baserom.gba", 0xD4910, 0x10 + + .global gUnknown_80D4920 +gUnknown_80D4920: @ 80D4920 + .incbin "baserom.gba", 0xD4920, 0x8 + + .global gUnknown_80D4928 +gUnknown_80D4928: @ 80D4928 + .incbin "baserom.gba", 0xD4928, 0xC + + .global gUnknown_80D4934 +gUnknown_80D4934: @ 80D4934 + .incbin "baserom.gba", 0xD4934, 0xC + + .global gUnknown_80D4940 +gUnknown_80D4940: @ 80D4940 + .incbin "baserom.gba", 0xD4940, 0xC + + .global gUnknown_80D494C +gUnknown_80D494C: @ 80D494C + .incbin "baserom.gba", 0xD494C, 0xC + + .global gUnknown_80D4958 +gUnknown_80D4958: @ 80D4958 + .incbin "baserom.gba", 0xD4958, 0xC + + .global gUnknown_80D4964 +gUnknown_80D4964: @ 80D4964 + .incbin "baserom.gba", 0xD4964, 0xC + + .global gUnknown_80D4970 +gUnknown_80D4970: @ 80D4970 + .incbin "baserom.gba", 0xD4970, 0x8 + + .global gUnknown_80D4978 +gUnknown_80D4978: @ 80D4978 + .incbin "baserom.gba", 0xD4978, 0xC + + .global gUnknown_80D4984 +gUnknown_80D4984: @ 80D4984 + .incbin "baserom.gba", 0xD4984, 0xC + + .global gUnknown_80D4990 +gUnknown_80D4990: @ 80D4990 + .incbin "baserom.gba", 0xD4990, 0xC + + .global gUnknown_80D499C +gUnknown_80D499C: @ 80D499C + .incbin "baserom.gba", 0xD499C, 0xC + + .global gUnknown_80D49A8 +gUnknown_80D49A8: @ 80D49A8 + .incbin "baserom.gba", 0xD49A8, 0xC + + .global gUnknown_80D49B4 +gUnknown_80D49B4: @ 80D49B4 + .incbin "baserom.gba", 0xD49B4, 0x8 + + .global gUnknown_80D49BC +gUnknown_80D49BC: @ 80D49BC + .incbin "baserom.gba", 0xD49BC, 0x10 + + .global gUnknown_80D49CC +gUnknown_80D49CC: @ 80D49CC + .incbin "baserom.gba", 0xD49CC, 0x10 + + .global gUnknown_80D49DC +gUnknown_80D49DC: @ 80D49DC + .incbin "baserom.gba", 0xD49DC, 0x4 + + .global gUnknown_80D49E0 +gUnknown_80D49E0: @ 80D49E0 + .incbin "baserom.gba", 0xD49E0, 0xA24 + + .global gUnknown_80D5404 +gUnknown_80D5404: @ 80D5404 + .incbin "baserom.gba", 0xD5404, 0xAC4 + + .global gUnknown_80D5EC8 +gUnknown_80D5EC8: @ 80D5EC8 + .incbin "baserom.gba", 0xD5EC8, 0x1ADC + + .global gUnknown_80D79A4 +gUnknown_80D79A4: @ 80D79A4 + .incbin "baserom.gba", 0xD79A4, 0xEE4 + + .global gUnknown_80D8888 +gUnknown_80D8888: @ 80D8888 + .incbin "baserom.gba", 0xD8888, 0x1740 + + .global gUnknown_80D9FC8 +gUnknown_80D9FC8: @ 80D9FC8 + .incbin "baserom.gba", 0xD9FC8, 0xAD0 + + .global gUnknown_80DAA98 +gUnknown_80DAA98: @ 80DAA98 + .incbin "baserom.gba", 0xDAA98, 0x4D8 + + .global gUnknown_80DAF70 +gUnknown_80DAF70: @ 80DAF70 + .incbin "baserom.gba", 0xDAF70, 0x18 + + .global gUnknown_80DAF88 +gUnknown_80DAF88: @ 80DAF88 + .incbin "baserom.gba", 0xDAF88, 0x18 + + .global gUnknown_80DAFA0 +gUnknown_80DAFA0: @ 80DAFA0 + .incbin "baserom.gba", 0xDAFA0, 0x20 + + .global gUnknown_80DAFC0 +gUnknown_80DAFC0: @ 80DAFC0 + .incbin "baserom.gba", 0xDAFC0, 0xD8 + + .global gUnknown_80DB098 +gUnknown_80DB098: @ 80DB098 + .incbin "baserom.gba", 0xDB098, 0x60 + + .global gUnknown_80DB0F8 +gUnknown_80DB0F8: @ 80DB0F8 + .incbin "baserom.gba", 0xDB0F8, 0x3FC + + .global gUnknown_80DB4F4 +gUnknown_80DB4F4: @ 80DB4F4 + .incbin "baserom.gba", 0xDB4F4, 0x44 + + .global gUnknown_80DB538 +gUnknown_80DB538: @ 80DB538 + .incbin "baserom.gba", 0xDB538, 0x18 + + .global gUnknown_80DB550 +gUnknown_80DB550: @ 80DB550 + .incbin "baserom.gba", 0xDB550, 0x18 + + .global gUnknown_80DB568 +gUnknown_80DB568: @ 80DB568 + .incbin "baserom.gba", 0xDB568, 0x18 + + .global gUnknown_80DB580 +gUnknown_80DB580: @ 80DB580 + .incbin "baserom.gba", 0xDB580, 0x18 + + .global gUnknown_80DB598 +gUnknown_80DB598: @ 80DB598 + .incbin "baserom.gba", 0xDB598, 0xC + + .global gUnknown_80DB5A4 +gUnknown_80DB5A4: @ 80DB5A4 + .incbin "baserom.gba", 0xDB5A4, 0xC + + .global gUnknown_80DB5B0 +gUnknown_80DB5B0: @ 80DB5B0 + .incbin "baserom.gba", 0xDB5B0, 0x8 + + .global gUnknown_80DB5B8 +gUnknown_80DB5B8: @ 80DB5B8 + .incbin "baserom.gba", 0xDB5B8, 0x8 + + .global gUnknown_80DB5C0 +gUnknown_80DB5C0: @ 80DB5C0 + .incbin "baserom.gba", 0xDB5C0, 0x14 + + .global gUnknown_80DB5D4 +gUnknown_80DB5D4: @ 80DB5D4 + .incbin "baserom.gba", 0xDB5D4, 0x24 + + .global gUnknown_80DB5F8 +gUnknown_80DB5F8: @ 80DB5F8 + .incbin "baserom.gba", 0xDB5F8, 0x24 + + .global gUnknown_80DB61C +gUnknown_80DB61C: @ 80DB61C + .incbin "baserom.gba", 0xDB61C, 0x1C + + .global gUnknown_80DB638 +gUnknown_80DB638: @ 80DB638 + .incbin "baserom.gba", 0xDB638, 0x1C + + .global gUnknown_80DB654 +gUnknown_80DB654: @ 80DB654 + .incbin "baserom.gba", 0xDB654, 0x8 + + .global gUnknown_80DB65C +gUnknown_80DB65C: @ 80DB65C + .incbin "baserom.gba", 0xDB65C, 0x8 + + .global gUnknown_80DB664 +gUnknown_80DB664: @ 80DB664 + .incbin "baserom.gba", 0xDB664, 0x24 + + .global gUnknown_80DB688 +gUnknown_80DB688: @ 80DB688 + .incbin "baserom.gba", 0xDB688, 0x1C + + .global gUnknown_80DB6A4 +gUnknown_80DB6A4: @ 80DB6A4 + .incbin "baserom.gba", 0xDB6A4, 0x18 + + .global gUnknown_80DB6BC +gUnknown_80DB6BC: @ 80DB6BC + .incbin "baserom.gba", 0xDB6BC, 0x20 + + .global gUnknown_80DB6DC +gUnknown_80DB6DC: @ 80DB6DC + .incbin "baserom.gba", 0xDB6DC, 0x18 + + .global gUnknown_80DB6F4 +gUnknown_80DB6F4: @ 80DB6F4 + .incbin "baserom.gba", 0xDB6F4, 0x18 + + .global gUnknown_80DB70C +gUnknown_80DB70C: @ 80DB70C + .incbin "baserom.gba", 0xDB70C, 0x18 + + .global gUnknown_80DB724 +gUnknown_80DB724: @ 80DB724 + .incbin "baserom.gba", 0xDB724, 0x8 + + .global gUnknown_80DB72C +gUnknown_80DB72C: @ 80DB72C + .incbin "baserom.gba", 0xDB72C, 0xC + + .global gUnknown_80DB738 +gUnknown_80DB738: @ 80DB738 + .incbin "baserom.gba", 0xDB738, 0x10 + + .global gUnknown_80DB748 +gUnknown_80DB748: @ 80DB748 + .incbin "baserom.gba", 0xDB748, 0x18 + + .global gUnknown_80DB760 +gUnknown_80DB760: @ 80DB760 + .incbin "baserom.gba", 0xDB760, 0x18 + + .global gUnknown_80DB778 +gUnknown_80DB778: @ 80DB778 + .incbin "baserom.gba", 0xDB778, 0x18 + + .global gUnknown_80DB790 +gUnknown_80DB790: @ 80DB790 + .incbin "baserom.gba", 0xDB790, 0x18 + + .global gUnknown_80DB7A8 +gUnknown_80DB7A8: @ 80DB7A8 + .incbin "baserom.gba", 0xDB7A8, 0x10 + + .global gUnknown_80DB7B8 +gUnknown_80DB7B8: @ 80DB7B8 + .incbin "baserom.gba", 0xDB7B8, 0x18 + + .global gUnknown_80DB7D0 +gUnknown_80DB7D0: @ 80DB7D0 + .incbin "baserom.gba", 0xDB7D0, 0x18 + + .global gUnknown_80DB7E8 +gUnknown_80DB7E8: @ 80DB7E8 + .incbin "baserom.gba", 0xDB7E8, 0x18 + + .global gUnknown_80DB800 +gUnknown_80DB800: @ 80DB800 + .incbin "baserom.gba", 0xDB800, 0x18 + + .global gUnknown_80DB818 +gUnknown_80DB818: @ 80DB818 + .incbin "baserom.gba", 0xDB818, 0x18 + + .global gUnknown_80DB830 +gUnknown_80DB830: @ 80DB830 + .incbin "baserom.gba", 0xDB830, 0x10 + + .global gUnknown_80DB840 +gUnknown_80DB840: @ 80DB840 + .incbin "baserom.gba", 0xDB840, 0x18 + + .global gUnknown_80DB858 +gUnknown_80DB858: @ 80DB858 + .incbin "baserom.gba", 0xDB858, 0x18 + + .global gUnknown_80DB870 +gUnknown_80DB870: @ 80DB870 + .incbin "baserom.gba", 0xDB870, 0x18 + + .global gUnknown_80DB888 +gUnknown_80DB888: @ 80DB888 + .incbin "baserom.gba", 0xDB888, 0x18 + + .global gUnknown_80DB8A0 +gUnknown_80DB8A0: @ 80DB8A0 + .incbin "baserom.gba", 0xDB8A0, 0x14 + + .global gUnknown_80DB8B4 +gUnknown_80DB8B4: @ 80DB8B4 + .incbin "baserom.gba", 0xDB8B4, 0x18 + + .global gUnknown_80DB8CC +gUnknown_80DB8CC: @ 80DB8CC + .incbin "baserom.gba", 0xDB8CC, 0x18 + + .global gUnknown_80DB8E4 +gUnknown_80DB8E4: @ 80DB8E4 + .incbin "baserom.gba", 0xDB8E4, 0x8 + + .global gUnknown_80DB8EC +gUnknown_80DB8EC: @ 80DB8EC + .incbin "baserom.gba", 0xDB8EC, 0x10 + + .global gUnknown_80DB8FC +gUnknown_80DB8FC: @ 80DB8FC + .incbin "baserom.gba", 0xDB8FC, 0x18 + + .global gUnknown_80DB914 +gUnknown_80DB914: @ 80DB914 + .incbin "baserom.gba", 0xDB914, 0x18 + + .global gUnknown_80DB92C +gUnknown_80DB92C: @ 80DB92C + .incbin "baserom.gba", 0xDB92C, 0x8 + + .global gUnknown_80DB934 +gUnknown_80DB934: @ 80DB934 + .incbin "baserom.gba", 0xDB934, 0x10 + + .global gUnknown_80DB944 +gUnknown_80DB944: @ 80DB944 + .incbin "baserom.gba", 0xDB944, 0x18 + + .global gUnknown_80DB95C +gUnknown_80DB95C: @ 80DB95C + .incbin "baserom.gba", 0xDB95C, 0x18 + + .global gUnknown_80DB974 +gUnknown_80DB974: @ 80DB974 + .incbin "baserom.gba", 0xDB974, 0x10 + + .global gUnknown_80DB984 +gUnknown_80DB984: @ 80DB984 + .incbin "baserom.gba", 0xDB984, 0x10 + + .global gUnknown_80DB994 +gUnknown_80DB994: @ 80DB994 + .incbin "baserom.gba", 0xDB994, 0xC + + .global gUnknown_80DB9A0 +gUnknown_80DB9A0: @ 80DB9A0 + .incbin "baserom.gba", 0xDB9A0, 0x8 + + .global gUnknown_80DB9A8 +gUnknown_80DB9A8: @ 80DB9A8 + .incbin "baserom.gba", 0xDB9A8, 0x8 + + .global gUnknown_80DB9B0 +gUnknown_80DB9B0: @ 80DB9B0 + .incbin "baserom.gba", 0xDB9B0, 0xC + + .global gUnknown_80DB9BC +gUnknown_80DB9BC: @ 80DB9BC + .incbin "baserom.gba", 0xDB9BC, 0x28 + + .global gUnknown_80DB9E4 +gUnknown_80DB9E4: @ 80DB9E4 + .incbin "baserom.gba", 0xDB9E4, 0x28 + + .global gUnknown_80DBA0C +gUnknown_80DBA0C: @ 80DBA0C + .incbin "baserom.gba", 0xDBA0C, 0x40 + + .global gUnknown_80DBA4C +gUnknown_80DBA4C: @ 80DBA4C + .incbin "baserom.gba", 0xDBA4C, 0xC + + .global gUnknown_80DBA58 +gUnknown_80DBA58: @ 80DBA58 + .incbin "baserom.gba", 0xDBA58, 0x18 + + .global gUnknown_80DBA70 +gUnknown_80DBA70: @ 80DBA70 + .incbin "baserom.gba", 0xDBA70, 0x18 + + .global gUnknown_80DBA88 +gUnknown_80DBA88: @ 80DBA88 + .incbin "baserom.gba", 0xDBA88, 0x18 + + .global gUnknown_80DBAA0 +gUnknown_80DBAA0: @ 80DBAA0 + .incbin "baserom.gba", 0xDBAA0, 0x30 + + .global gUnknown_80DBAD0 +gUnknown_80DBAD0: @ 80DBAD0 + .incbin "baserom.gba", 0xDBAD0, 0x38 + + .global gUnknown_80DBB08 +gUnknown_80DBB08: @ 80DBB08 + .incbin "baserom.gba", 0xDBB08, 0x30 + + .global gUnknown_80DBB38 +gUnknown_80DBB38: @ 80DBB38 + .incbin "baserom.gba", 0xDBB38, 0x64 + + .global gUnknown_80DBB9C +gUnknown_80DBB9C: @ 80DBB9C + .incbin "baserom.gba", 0xDBB9C, 0x8C + + .global gUnknown_80DBC28 +gUnknown_80DBC28: @ 80DBC28 + .incbin "baserom.gba", 0xDBC28, 0x38 + + .global gUnknown_80DBC60 +gUnknown_80DBC60: @ 80DBC60 + .incbin "baserom.gba", 0xDBC60, 0x38 + + .global gUnknown_80DBC98 +gUnknown_80DBC98: @ 80DBC98 + .incbin "baserom.gba", 0xDBC98, 0x2C + + .global gUnknown_80DBCC4 +gUnknown_80DBCC4: @ 80DBCC4 + .incbin "baserom.gba", 0xDBCC4, 0x24 + + .global gUnknown_80DBCE8 +gUnknown_80DBCE8: @ 80DBCE8 + .incbin "baserom.gba", 0xDBCE8, 0x3C + + .global gUnknown_80DBD24 +gUnknown_80DBD24: @ 80DBD24 + .incbin "baserom.gba", 0xDBD24, 0x34 + + .global gUnknown_80DBD58 +gUnknown_80DBD58: @ 80DBD58 + .incbin "baserom.gba", 0xDBD58, 0x14 + + .global gUnknown_80DBD6C +gUnknown_80DBD6C: @ 80DBD6C + .incbin "baserom.gba", 0xDBD6C, 0x14 + + .global gUnknown_80DBD80 +gUnknown_80DBD80: @ 80DBD80 + .incbin "baserom.gba", 0xDBD80, 0x8 + + .global gUnknown_80DBD88 +gUnknown_80DBD88: @ 80DBD88 + .incbin "baserom.gba", 0xDBD88, 0x10 + + .global gUnknown_80DBD98 +gUnknown_80DBD98: @ 80DBD98 + .incbin "baserom.gba", 0xDBD98, 0x18 + + .global gUnknown_80DBDB0 +gUnknown_80DBDB0: @ 80DBDB0 + .incbin "baserom.gba", 0xDBDB0, 0x18 + + .global gUnknown_80DBDC8 +gUnknown_80DBDC8: @ 80DBDC8 + .incbin "baserom.gba", 0xDBDC8, 0x10 + + .global gUnknown_80DBDD8 +gUnknown_80DBDD8: @ 80DBDD8 + .incbin "baserom.gba", 0xDBDD8, 0x18 + + .global gUnknown_80DBDF0 +gUnknown_80DBDF0: @ 80DBDF0 + .incbin "baserom.gba", 0xDBDF0, 0x18 + + .global gUnknown_80DBE08 +gUnknown_80DBE08: @ 80DBE08 + .incbin "baserom.gba", 0xDBE08, 0xC + + .global gUnknown_80DBE14 +gUnknown_80DBE14: @ 80DBE14 + .incbin "baserom.gba", 0xDBE14, 0x4 + + .global gUnknown_80DBE18 +gUnknown_80DBE18: @ 80DBE18 + .incbin "baserom.gba", 0xDBE18, 0x4 + + .global gUnknown_80DBE1C +gUnknown_80DBE1C: @ 80DBE1C + .incbin "baserom.gba", 0xDBE1C, 0x10 + + .global gUnknown_80DBE2C +gUnknown_80DBE2C: @ 80DBE2C + .incbin "baserom.gba", 0xDBE2C, 0x4 + + .global gUnknown_80DBE30 +gUnknown_80DBE30: @ 80DBE30 + .incbin "baserom.gba", 0xDBE30, 0xC + + .global gUnknown_80DBE3C +gUnknown_80DBE3C: @ 80DBE3C + .incbin "baserom.gba", 0xDBE3C, 0x18 + + .global gUnknown_80DBE54 +gUnknown_80DBE54: @ 80DBE54 + .incbin "baserom.gba", 0xDBE54, 0x18 + + .global gUnknown_80DBE6C +gUnknown_80DBE6C: @ 80DBE6C + .incbin "baserom.gba", 0xDBE6C, 0x10 + + .global gUnknown_80DBE7C +gUnknown_80DBE7C: @ 80DBE7C + .incbin "baserom.gba", 0xDBE7C, 0x1C + + .global gUnknown_80DBE98 +gUnknown_80DBE98: @ 80DBE98 + .incbin "baserom.gba", 0xDBE98, 0x18 + + .global gUnknown_80DBEB0 +gUnknown_80DBEB0: @ 80DBEB0 + .incbin "baserom.gba", 0xDBEB0, 0x60 + + .global gUnknown_80DBF10 +gUnknown_80DBF10: @ 80DBF10 + .incbin "baserom.gba", 0xDBF10, 0x8 + + .global gUnknown_80DBF18 +gUnknown_80DBF18: @ 80DBF18 + .incbin "baserom.gba", 0xDBF18, 0x8 + + .global gUnknown_80DBF20 +gUnknown_80DBF20: @ 80DBF20 + .incbin "baserom.gba", 0xDBF20, 0xC + + .global gUnknown_80DBF2C +gUnknown_80DBF2C: @ 80DBF2C + .incbin "baserom.gba", 0xDBF2C, 0x8 + + .global gUnknown_80DBF34 +gUnknown_80DBF34: @ 80DBF34 + .incbin "baserom.gba", 0xDBF34, 0x8 + + .global gUnknown_80DBF3C +gUnknown_80DBF3C: @ 80DBF3C + .incbin "baserom.gba", 0xDBF3C, 0x10 + + .global gUnknown_80DBF4C +gUnknown_80DBF4C: @ 80DBF4C + .incbin "baserom.gba", 0xDBF4C, 0x14 + + .global gUnknown_80DBF60 +gUnknown_80DBF60: @ 80DBF60 + .incbin "baserom.gba", 0xDBF60, 0x10 + + .global gUnknown_80DBF70 +gUnknown_80DBF70: @ 80DBF70 + .incbin "baserom.gba", 0xDBF70, 0x18 + + .global gUnknown_80DBF88 +gUnknown_80DBF88: @ 80DBF88 + .incbin "baserom.gba", 0xDBF88, 0x18 + + .global gUnknown_80DBFA0 +gUnknown_80DBFA0: @ 80DBFA0 + .incbin "baserom.gba", 0xDBFA0, 0x10 + + .global gUnknown_80DBFB0 +gUnknown_80DBFB0: @ 80DBFB0 + .incbin "baserom.gba", 0xDBFB0, 0x1C + + .global gUnknown_80DBFCC +gUnknown_80DBFCC: @ 80DBFCC + .incbin "baserom.gba", 0xDBFCC, 0x18 + + .global gUnknown_80DBFE4 +gUnknown_80DBFE4: @ 80DBFE4 + .incbin "baserom.gba", 0xDBFE4, 0x8 + + .global gUnknown_80DBFEC +gUnknown_80DBFEC: @ 80DBFEC + .incbin "baserom.gba", 0xDBFEC, 0x14 + + .global gUnknown_80DC000 +gUnknown_80DC000: @ 80DC000 + .incbin "baserom.gba", 0xDC000, 0x10 + + .global gUnknown_80DC010 +gUnknown_80DC010: @ 80DC010 + .incbin "baserom.gba", 0xDC010, 0x10 + + .global gUnknown_80DC020 +gUnknown_80DC020: @ 80DC020 + .incbin "baserom.gba", 0xDC020, 0x1C + + .global gUnknown_80DC03C +gUnknown_80DC03C: @ 80DC03C + .incbin "baserom.gba", 0xDC03C, 0x18 + + .global gUnknown_80DC054 +gUnknown_80DC054: @ 80DC054 + .incbin "baserom.gba", 0xDC054, 0x10 + + .global gUnknown_80DC064 +gUnknown_80DC064: @ 80DC064 + .incbin "baserom.gba", 0xDC064, 0x20 + + .global gUnknown_80DC084 +gUnknown_80DC084: @ 80DC084 + .incbin "baserom.gba", 0xDC084, 0x8 + + .global gUnknown_80DC08C +gUnknown_80DC08C: @ 80DC08C + .incbin "baserom.gba", 0xDC08C, 0x4 + + .global gUnknown_80DC090 +gUnknown_80DC090: @ 80DC090 + .incbin "baserom.gba", 0xDC090, 0x10 + + .global gUnknown_80DC0A0 +gUnknown_80DC0A0: @ 80DC0A0 + .incbin "baserom.gba", 0xDC0A0, 0x1C + + .global gUnknown_80DC0BC +gUnknown_80DC0BC: @ 80DC0BC + .incbin "baserom.gba", 0xDC0BC, 0x18 + + .global gUnknown_80DC0D4 +gUnknown_80DC0D4: @ 80DC0D4 + .incbin "baserom.gba", 0xDC0D4, 0x10 + + .global gUnknown_80DC0E4 +gUnknown_80DC0E4: @ 80DC0E4 + .incbin "baserom.gba", 0xDC0E4, 0x18 + + .global gUnknown_80DC0FC +gUnknown_80DC0FC: @ 80DC0FC + .incbin "baserom.gba", 0xDC0FC, 0x20 + + .global gUnknown_80DC11C +gUnknown_80DC11C: @ 80DC11C + .incbin "baserom.gba", 0xDC11C, 0x18 + + .global gUnknown_80DC134 +gUnknown_80DC134: @ 80DC134 + .incbin "baserom.gba", 0xDC134, 0x30 + + .global gUnknown_80DC164 +gUnknown_80DC164: @ 80DC164 + .incbin "baserom.gba", 0xDC164, 0x3C + + .global gUnknown_80DC1A0 +gUnknown_80DC1A0: @ 80DC1A0 + .incbin "baserom.gba", 0xDC1A0, 0x5C + + .global gUnknown_80DC1FC +gUnknown_80DC1FC: @ 80DC1FC + .incbin "baserom.gba", 0xDC1FC, 0x34 + + .global gUnknown_80DC230 +gUnknown_80DC230: @ 80DC230 + .incbin "baserom.gba", 0xDC230, 0x10 + + .global gUnknown_80DC240 +gUnknown_80DC240: @ 80DC240 + .incbin "baserom.gba", 0xDC240, 0x1C + + .global gUnknown_80DC25C +gUnknown_80DC25C: @ 80DC25C + .incbin "baserom.gba", 0xDC25C, 0x18 + + .global gUnknown_80DC274 +gUnknown_80DC274: @ 80DC274 + .incbin "baserom.gba", 0xDC274, 0x18 + + .global gUnknown_80DC28C +gUnknown_80DC28C: @ 80DC28C + .incbin "baserom.gba", 0xDC28C, 0x14 + + .global gUnknown_80DC2A0 +gUnknown_80DC2A0: @ 80DC2A0 + .incbin "baserom.gba", 0xDC2A0, 0xC + + .global gUnknown_80DC2AC +gUnknown_80DC2AC: @ 80DC2AC + .incbin "baserom.gba", 0xDC2AC, 0x18 + + .global gUnknown_80DC2C4 +gUnknown_80DC2C4: @ 80DC2C4 + .incbin "baserom.gba", 0xDC2C4, 0x18 + + .global gUnknown_80DC2DC +gUnknown_80DC2DC: @ 80DC2DC + .incbin "baserom.gba", 0xDC2DC, 0x1C + + .global gUnknown_80DC2F8 +gUnknown_80DC2F8: @ 80DC2F8 + .incbin "baserom.gba", 0xDC2F8, 0x18 + + .global gUnknown_80DC310 +gUnknown_80DC310: @ 80DC310 + .incbin "baserom.gba", 0xDC310, 0xC + + .global gUnknown_80DC31C +gUnknown_80DC31C: @ 80DC31C + .incbin "baserom.gba", 0xDC31C, 0x18 + + .global gUnknown_80DC334 +gUnknown_80DC334: @ 80DC334 + .incbin "baserom.gba", 0xDC334, 0x18 + + .global gUnknown_80DC34C +gUnknown_80DC34C: @ 80DC34C + .incbin "baserom.gba", 0xDC34C, 0x30 + + .global gUnknown_80DC37C +gUnknown_80DC37C: @ 80DC37C + .incbin "baserom.gba", 0xDC37C, 0x18 + + .global gUnknown_80DC394 +gUnknown_80DC394: @ 80DC394 + .incbin "baserom.gba", 0xDC394, 0x30 + + .global gUnknown_80DC3C4 +gUnknown_80DC3C4: @ 80DC3C4 + .incbin "baserom.gba", 0xDC3C4, 0x8 + + .global gUnknown_80DC3CC +gUnknown_80DC3CC: @ 80DC3CC + .incbin "baserom.gba", 0xDC3CC, 0xC + + .global gUnknown_80DC3D8 +gUnknown_80DC3D8: @ 80DC3D8 + .incbin "baserom.gba", 0xDC3D8, 0x8 + + .global gUnknown_80DC3E0 +gUnknown_80DC3E0: @ 80DC3E0 + .incbin "baserom.gba", 0xDC3E0, 0x8 + + .global gUnknown_80DC3E8 +gUnknown_80DC3E8: @ 80DC3E8 + .incbin "baserom.gba", 0xDC3E8, 0xC + + .global gUnknown_80DC3F4 +gUnknown_80DC3F4: @ 80DC3F4 + .incbin "baserom.gba", 0xDC3F4, 0xC + + .global gUnknown_80DC400 +gUnknown_80DC400: @ 80DC400 + .incbin "baserom.gba", 0xDC400, 0xC + + .global gUnknown_80DC40C +gUnknown_80DC40C: @ 80DC40C + .incbin "baserom.gba", 0xDC40C, 0x4 + + .global gUnknown_80DC410 +gUnknown_80DC410: @ 80DC410 + .incbin "baserom.gba", 0xDC410, 0x8 + + .global gUnknown_80DC418 +gUnknown_80DC418: @ 80DC418 + .incbin "baserom.gba", 0xDC418, 0x8 + + .global gUnknown_80DC420 +gUnknown_80DC420: @ 80DC420 + .incbin "baserom.gba", 0xDC420, 0x8 + + .global gUnknown_80DC428 +gUnknown_80DC428: @ 80DC428 + .incbin "baserom.gba", 0xDC428, 0x10 + + .global gUnknown_80DC438 +gUnknown_80DC438: @ 80DC438 + .incbin "baserom.gba", 0xDC438, 0x10 + + .global gUnknown_80DC448 +gUnknown_80DC448: @ 80DC448 + .incbin "baserom.gba", 0xDC448, 0x1C + + .global gUnknown_80DC464 +gUnknown_80DC464: @ 80DC464 + .incbin "baserom.gba", 0xDC464, 0x18 + + .global gUnknown_80DC47C +gUnknown_80DC47C: @ 80DC47C + .incbin "baserom.gba", 0xDC47C, 0x18 + + .global gUnknown_80DC494 +gUnknown_80DC494: @ 80DC494 + .incbin "baserom.gba", 0xDC494, 0x10 + + .global gUnknown_80DC4A4 +gUnknown_80DC4A4: @ 80DC4A4 + .incbin "baserom.gba", 0xDC4A4, 0x8 + + .global gUnknown_80DC4AC +gUnknown_80DC4AC: @ 80DC4AC + .incbin "baserom.gba", 0xDC4AC, 0x10 + + .global gUnknown_80DC4BC +gUnknown_80DC4BC: @ 80DC4BC + .incbin "baserom.gba", 0xDC4BC, 0x1C + + .global gUnknown_80DC4D8 +gUnknown_80DC4D8: @ 80DC4D8 + .incbin "baserom.gba", 0xDC4D8, 0x18 + + .global gUnknown_80DC4F0 +gUnknown_80DC4F0: @ 80DC4F0 + .incbin "baserom.gba", 0xDC4F0, 0x28 + + .global gUnknown_80DC518 +gUnknown_80DC518: @ 80DC518 + .incbin "baserom.gba", 0xDC518, 0xC + + .global gUnknown_80DC524 +gUnknown_80DC524: @ 80DC524 + .incbin "baserom.gba", 0xDC524, 0x10 + + .global gUnknown_80DC534 +gUnknown_80DC534: @ 80DC534 + .incbin "baserom.gba", 0xDC534, 0x18 + + .global gUnknown_80DC54C +gUnknown_80DC54C: @ 80DC54C + .incbin "baserom.gba", 0xDC54C, 0x18 + + .global gUnknown_80DC564 +gUnknown_80DC564: @ 80DC564 + .incbin "baserom.gba", 0xDC564, 0x20 + + .global gUnknown_80DC584 +gUnknown_80DC584: @ 80DC584 + .incbin "baserom.gba", 0xDC584, 0x20 + + .global gUnknown_80DC5A4 +gUnknown_80DC5A4: @ 80DC5A4 + .incbin "baserom.gba", 0xDC5A4, 0x18 + + .global gUnknown_80DC5BC +gUnknown_80DC5BC: @ 80DC5BC + .incbin "baserom.gba", 0xDC5BC, 0x18 + + .global gUnknown_80DC5D4 +gUnknown_80DC5D4: @ 80DC5D4 + .incbin "baserom.gba", 0xDC5D4, 0x18 + + .global gUnknown_80DC5EC +gUnknown_80DC5EC: @ 80DC5EC + .incbin "baserom.gba", 0xDC5EC, 0x8 + + .global gUnknown_80DC5F4 +gUnknown_80DC5F4: @ 80DC5F4 + .incbin "baserom.gba", 0xDC5F4, 0x24 + + .global gUnknown_80DC618 +gUnknown_80DC618: @ 80DC618 + .incbin "baserom.gba", 0xDC618, 0x5C + + .global gUnknown_80DC674 +gUnknown_80DC674: @ 80DC674 + .incbin "baserom.gba", 0xDC674, 0x58 + + .global gUnknown_80DC6CC +gUnknown_80DC6CC: @ 80DC6CC + .incbin "baserom.gba", 0xDC6CC, 0x5C + + .global gUnknown_80DC728 +gUnknown_80DC728: @ 80DC728 + .incbin "baserom.gba", 0xDC728, 0x60 + + .global gUnknown_80DC788 +gUnknown_80DC788: @ 80DC788 + .incbin "baserom.gba", 0xDC788, 0x2C + + .global gUnknown_80DC7B4 +gUnknown_80DC7B4: @ 80DC7B4 + .incbin "baserom.gba", 0xDC7B4, 0x48 + + .global gUnknown_80DC7FC +gUnknown_80DC7FC: @ 80DC7FC + .incbin "baserom.gba", 0xDC7FC, 0x20 + + .global gUnknown_80DC81C +gUnknown_80DC81C: @ 80DC81C + .incbin "baserom.gba", 0xDC81C, 0x28 + + .global gUnknown_80DC844 +gUnknown_80DC844: @ 80DC844 + .incbin "baserom.gba", 0xDC844, 0x20 + + .global gUnknown_80DC864 +gUnknown_80DC864: @ 80DC864 + .incbin "baserom.gba", 0xDC864, 0x28 + + .global gUnknown_80DC88C +gUnknown_80DC88C: @ 80DC88C + .incbin "baserom.gba", 0xDC88C, 0x20 + + .global gUnknown_80DC8AC +gUnknown_80DC8AC: @ 80DC8AC + .incbin "baserom.gba", 0xDC8AC, 0x1C + + .global gUnknown_80DC8C8 +gUnknown_80DC8C8: @ 80DC8C8 + .incbin "baserom.gba", 0xDC8C8, 0x14 + + .global gUnknown_80DC8DC +gUnknown_80DC8DC: @ 80DC8DC + .incbin "baserom.gba", 0xDC8DC, 0x14 + + .global gUnknown_80DC8F0 +gUnknown_80DC8F0: @ 80DC8F0 + .incbin "baserom.gba", 0xDC8F0, 0x8 + + .global gUnknown_80DC8F8 +gUnknown_80DC8F8: @ 80DC8F8 + .incbin "baserom.gba", 0xDC8F8, 0xC + + .global gUnknown_80DC904 +gUnknown_80DC904: @ 80DC904 + .incbin "baserom.gba", 0xDC904, 0x18 + + .global gUnknown_80DC91C +gUnknown_80DC91C: @ 80DC91C + .incbin "baserom.gba", 0xDC91C, 0x18 + + .global gUnknown_80DC934 +gUnknown_80DC934: @ 80DC934 + .incbin "baserom.gba", 0xDC934, 0x8 + + .global gUnknown_80DC93C +gUnknown_80DC93C: @ 80DC93C + .incbin "baserom.gba", 0xDC93C, 0x14 + + .global gUnknown_80DC950 +gUnknown_80DC950: @ 80DC950 + .incbin "baserom.gba", 0xDC950, 0x18 + + .global gUnknown_80DC968 +gUnknown_80DC968: @ 80DC968 + .incbin "baserom.gba", 0xDC968, 0x18 + + .global gUnknown_80DC980 +gUnknown_80DC980: @ 80DC980 + .incbin "baserom.gba", 0xDC980, 0x8 + + .global gUnknown_80DC988 +gUnknown_80DC988: @ 80DC988 + .incbin "baserom.gba", 0xDC988, 0x10 + + .global gUnknown_80DC998 +gUnknown_80DC998: @ 80DC998 + .incbin "baserom.gba", 0xDC998, 0xC + + .global gUnknown_80DC9A4 +gUnknown_80DC9A4: @ 80DC9A4 + .incbin "baserom.gba", 0xDC9A4, 0xC + + .global gUnknown_80DC9B0 +gUnknown_80DC9B0: @ 80DC9B0 + .incbin "baserom.gba", 0xDC9B0, 0x18 + + .global gUnknown_80DC9C8 +gUnknown_80DC9C8: @ 80DC9C8 + .incbin "baserom.gba", 0xDC9C8, 0x20 + + .global gUnknown_80DC9E8 +gUnknown_80DC9E8: @ 80DC9E8 + .incbin "baserom.gba", 0xDC9E8, 0x18 + + .global gUnknown_80DCA00 +gUnknown_80DCA00: @ 80DCA00 + .incbin "baserom.gba", 0xDCA00, 0x18 + + .global gUnknown_80DCA18 +gUnknown_80DCA18: @ 80DCA18 + .incbin "baserom.gba", 0xDCA18, 0xC + + .global gUnknown_80DCA24 +gUnknown_80DCA24: @ 80DCA24 + .incbin "baserom.gba", 0xDCA24, 0x8 + + .global gUnknown_80DCA2C +gUnknown_80DCA2C: @ 80DCA2C + .incbin "baserom.gba", 0xDCA2C, 0x8 + + .global gUnknown_80DCA34 +gUnknown_80DCA34: @ 80DCA34 + .incbin "baserom.gba", 0xDCA34, 0x84 + + .global gUnknown_80DCAB8 +gUnknown_80DCAB8: @ 80DCAB8 + .incbin "baserom.gba", 0xDCAB8, 0x18 + + .global gUnknown_80DCAD0 +gUnknown_80DCAD0: @ 80DCAD0 + .incbin "baserom.gba", 0xDCAD0, 0x28C + + .global gUnknown_80DCD5C +gUnknown_80DCD5C: @ 80DCD5C + .incbin "baserom.gba", 0xDCD5C, 0x34 + + .global gUnknown_80DCD90 +gUnknown_80DCD90: @ 80DCD90 + .incbin "baserom.gba", 0xDCD90, 0x28 + + .global gUnknown_80DCDB8 +gUnknown_80DCDB8: @ 80DCDB8 + .incbin "baserom.gba", 0xDCDB8, 0x24 + + .global gUnknown_80DCDDC +gUnknown_80DCDDC: @ 80DCDDC + .incbin "baserom.gba", 0xDCDDC, 0x3C + + .global gUnknown_80DCE18 +gUnknown_80DCE18: @ 80DCE18 + .incbin "baserom.gba", 0xDCE18, 0x20 + + .global gUnknown_80DCE38 +gUnknown_80DCE38: @ 80DCE38 + .incbin "baserom.gba", 0xDCE38, 0x30 + + .global gUnknown_80DCE68 +gUnknown_80DCE68: @ 80DCE68 + .incbin "baserom.gba", 0xDCE68, 0x48 + + .global gUnknown_80DCEB0 +gUnknown_80DCEB0: @ 80DCEB0 + .incbin "baserom.gba", 0xDCEB0, 0x2C + + .global gUnknown_80DCEDC +gUnknown_80DCEDC: @ 80DCEDC + .incbin "baserom.gba", 0xDCEDC, 0x68 + + .global gUnknown_80DCF44 +gUnknown_80DCF44: @ 80DCF44 + .incbin "baserom.gba", 0xDCF44, 0x44 + + .global gUnknown_80DCF88 +gUnknown_80DCF88: @ 80DCF88 + .incbin "baserom.gba", 0xDCF88, 0x24 + + .global gUnknown_80DCFAC +gUnknown_80DCFAC: @ 80DCFAC + .incbin "baserom.gba", 0xDCFAC, 0x48 + + .global gUnknown_80DCFF4 +gUnknown_80DCFF4: @ 80DCFF4 + .incbin "baserom.gba", 0xDCFF4, 0x60 + + .global gUnknown_80DD054 +gUnknown_80DD054: @ 80DD054 + .incbin "baserom.gba", 0xDD054, 0x44 + + .global gUnknown_80DD098 +gUnknown_80DD098: @ 80DD098 + .incbin "baserom.gba", 0xDD098, 0x48 + + .global gUnknown_80DD0E0 +gUnknown_80DD0E0: @ 80DD0E0 + .incbin "baserom.gba", 0xDD0E0, 0x24 + + .global gUnknown_80DD104 +gUnknown_80DD104: @ 80DD104 + .incbin "baserom.gba", 0xDD104, 0x44 + + .global gUnknown_80DD148 +gUnknown_80DD148: @ 80DD148 + .incbin "baserom.gba", 0xDD148, 0x18 + + .global gUnknown_80DD160 +gUnknown_80DD160: @ 80DD160 + .incbin "baserom.gba", 0xDD160, 0x18 + + .global gUnknown_80DD178 +gUnknown_80DD178: @ 80DD178 + .incbin "baserom.gba", 0xDD178, 0x18 + + .global gUnknown_80DD190 +gUnknown_80DD190: @ 80DD190 + .incbin "baserom.gba", 0xDD190, 0x18 + + .global gUnknown_80DD1A8 +gUnknown_80DD1A8: @ 80DD1A8 + .incbin "baserom.gba", 0xDD1A8, 0x20 + + .global gUnknown_80DD1C8 +gUnknown_80DD1C8: @ 80DD1C8 + .incbin "baserom.gba", 0xDD1C8, 0x24 + + .global gUnknown_80DD1EC +gUnknown_80DD1EC: @ 80DD1EC + .incbin "baserom.gba", 0xDD1EC, 0x54 + + .global gUnknown_80DD240 +gUnknown_80DD240: @ 80DD240 + .incbin "baserom.gba", 0xDD240, 0x30 + + .global gUnknown_80DD270 +gUnknown_80DD270: @ 80DD270 + .incbin "baserom.gba", 0xDD270, 0x40 + + .global gUnknown_80DD2B0 +gUnknown_80DD2B0: @ 80DD2B0 + .incbin "baserom.gba", 0xDD2B0, 0x8 + + .global gUnknown_80DD2B8 +gUnknown_80DD2B8: @ 80DD2B8 + .incbin "baserom.gba", 0xDD2B8, 0x8 + + .global gUnknown_80DD2C0 +gUnknown_80DD2C0: @ 80DD2C0 + .incbin "baserom.gba", 0xDD2C0, 0xC + + .global gUnknown_80DD2CC +gUnknown_80DD2CC: @ 80DD2CC + .incbin "baserom.gba", 0xDD2CC, 0x8 + + .global gUnknown_80DD2D4 +gUnknown_80DD2D4: @ 80DD2D4 + .incbin "baserom.gba", 0xDD2D4, 0x8 + + .global gUnknown_80DD2DC +gUnknown_80DD2DC: @ 80DD2DC + .incbin "baserom.gba", 0xDD2DC, 0x8 + + .global gUnknown_80DD2E4 +gUnknown_80DD2E4: @ 80DD2E4 + .incbin "baserom.gba", 0xDD2E4, 0x8 + + .global gUnknown_80DD2EC +gUnknown_80DD2EC: @ 80DD2EC + .incbin "baserom.gba", 0xDD2EC, 0xC + + .global gUnknown_80DD2F8 +gUnknown_80DD2F8: @ 80DD2F8 + .incbin "baserom.gba", 0xDD2F8, 0x18 + + .global gUnknown_80DD310 +gUnknown_80DD310: @ 80DD310 + .incbin "baserom.gba", 0xDD310, 0x18 + + .global gUnknown_80DD328 +gUnknown_80DD328: @ 80DD328 + .incbin "baserom.gba", 0xDD328, 0x18 + + .global gUnknown_80DD340 +gUnknown_80DD340: @ 80DD340 + .incbin "baserom.gba", 0xDD340, 0x18 + + .global gUnknown_80DD358 +gUnknown_80DD358: @ 80DD358 + .incbin "baserom.gba", 0xDD358, 0x18 + + .global gUnknown_80DD370 +gUnknown_80DD370: @ 80DD370 + .incbin "baserom.gba", 0xDD370, 0x18 + + .global gUnknown_80DD388 +gUnknown_80DD388: @ 80DD388 + .incbin "baserom.gba", 0xDD388, 0x98 + + .global gUnknown_80DD420 +gUnknown_80DD420: @ 80DD420 + .incbin "baserom.gba", 0xDD420, 0xA4 + + .global gUnknown_80DD4C4 +gUnknown_80DD4C4: @ 80DD4C4 + .incbin "baserom.gba", 0xDD4C4, 0x30 + + .global gUnknown_80DD4F4 +gUnknown_80DD4F4: @ 80DD4F4 + .incbin "baserom.gba", 0xDD4F4, 0x40 + + .global gUnknown_80DD534 +gUnknown_80DD534: @ 80DD534 + .incbin "baserom.gba", 0xDD534, 0x30 + + .global gUnknown_80DD564 +gUnknown_80DD564: @ 80DD564 + .incbin "baserom.gba", 0xDD564, 0x30 + + .global gUnknown_80DD594 +gUnknown_80DD594: @ 80DD594 + .incbin "baserom.gba", 0xDD594, 0x24 + + .global gUnknown_80DD5B8 +gUnknown_80DD5B8: @ 80DD5B8 + .incbin "baserom.gba", 0xDD5B8, 0x54 + + .global gUnknown_80DD60C +gUnknown_80DD60C: @ 80DD60C + .incbin "baserom.gba", 0xDD60C, 0x30 + + .global gUnknown_80DD63C +gUnknown_80DD63C: @ 80DD63C + .incbin "baserom.gba", 0xDD63C, 0x28 + + .global gUnknown_80DD664 +gUnknown_80DD664: @ 80DD664 + .incbin "baserom.gba", 0xDD664, 0xC + + .global gUnknown_80DD670 +gUnknown_80DD670: @ 80DD670 + .incbin "baserom.gba", 0xDD670, 0xC + + .global gUnknown_80DD67C +gUnknown_80DD67C: @ 80DD67C + .incbin "baserom.gba", 0xDD67C, 0xC + + .global gUnknown_80DD688 +gUnknown_80DD688: @ 80DD688 + .incbin "baserom.gba", 0xDD688, 0xC + + .global gUnknown_80DD694 +gUnknown_80DD694: @ 80DD694 + .incbin "baserom.gba", 0xDD694, 0x8 + + .global gUnknown_80DD69C +gUnknown_80DD69C: @ 80DD69C + .incbin "baserom.gba", 0xDD69C, 0x8 + + .global gUnknown_80DD6A4 +gUnknown_80DD6A4: @ 80DD6A4 + .incbin "baserom.gba", 0xDD6A4, 0x10 + + .global gUnknown_80DD6B4 +gUnknown_80DD6B4: @ 80DD6B4 + .incbin "baserom.gba", 0xDD6B4, 0x8 + + .global gUnknown_80DD6BC +gUnknown_80DD6BC: @ 80DD6BC + .incbin "baserom.gba", 0xDD6BC, 0x8 + + .global gUnknown_80DD6C4 +gUnknown_80DD6C4: @ 80DD6C4 + .incbin "baserom.gba", 0xDD6C4, 0xC + + .global gUnknown_80DD6D0 +gUnknown_80DD6D0: @ 80DD6D0 + .incbin "baserom.gba", 0xDD6D0, 0x10 + + .global gUnknown_80DD6E0 +gUnknown_80DD6E0: @ 80DD6E0 + .incbin "baserom.gba", 0xDD6E0, 0xC + + .global gUnknown_80DD6EC +gUnknown_80DD6EC: @ 80DD6EC + .incbin "baserom.gba", 0xDD6EC, 0x18 + + .global gUnknown_80DD704 +gUnknown_80DD704: @ 80DD704 + .incbin "baserom.gba", 0xDD704, 0x18 + + .global gUnknown_80DD71C +gUnknown_80DD71C: @ 80DD71C + .incbin "baserom.gba", 0xDD71C, 0x30 + + .global gUnknown_80DD74C +gUnknown_80DD74C: @ 80DD74C + .incbin "baserom.gba", 0xDD74C, 0x18 + + .global gUnknown_80DD764 +gUnknown_80DD764: @ 80DD764 + .incbin "baserom.gba", 0xDD764, 0x98 + + .global gUnknown_80DD7FC +gUnknown_80DD7FC: @ 80DD7FC + .incbin "baserom.gba", 0xDD7FC, 0xA4 + + .global gUnknown_80DD8A0 +gUnknown_80DD8A0: @ 80DD8A0 + .incbin "baserom.gba", 0xDD8A0, 0x30 + + .global gUnknown_80DD8D0 +gUnknown_80DD8D0: @ 80DD8D0 + .incbin "baserom.gba", 0xDD8D0, 0x28 + + .global gUnknown_80DD8F8 +gUnknown_80DD8F8: @ 80DD8F8 + .incbin "baserom.gba", 0xDD8F8, 0xC + + .global gUnknown_80DD904 +gUnknown_80DD904: @ 80DD904 + .incbin "baserom.gba", 0xDD904, 0xC + + .global gUnknown_80DD910 +gUnknown_80DD910: @ 80DD910 + .incbin "baserom.gba", 0xDD910, 0xC + + .global gUnknown_80DD91C +gUnknown_80DD91C: @ 80DD91C + .incbin "baserom.gba", 0xDD91C, 0x10 + + .global gUnknown_80DD92C +gUnknown_80DD92C: @ 80DD92C + .incbin "baserom.gba", 0xDD92C, 0x8 + + .global gUnknown_80DD934 +gUnknown_80DD934: @ 80DD934 + .incbin "baserom.gba", 0xDD934, 0x8 + + .global gUnknown_80DD93C +gUnknown_80DD93C: @ 80DD93C + .incbin "baserom.gba", 0xDD93C, 0x8 + + .global gUnknown_80DD944 +gUnknown_80DD944: @ 80DD944 + .incbin "baserom.gba", 0xDD944, 0x8 + + .global gUnknown_80DD94C +gUnknown_80DD94C: @ 80DD94C + .incbin "baserom.gba", 0xDD94C, 0xC + + .global gUnknown_80DD958 +gUnknown_80DD958: @ 80DD958 + .incbin "baserom.gba", 0xDD958, 0x18 + + .global gUnknown_80DD970 +gUnknown_80DD970: @ 80DD970 + .incbin "baserom.gba", 0xDD970, 0x7C + + .global gUnknown_80DD9EC +gUnknown_80DD9EC: @ 80DD9EC + .incbin "baserom.gba", 0xDD9EC, 0x5C + + .global gUnknown_80DDA48 +gUnknown_80DDA48: @ 80DDA48 + .incbin "baserom.gba", 0xDDA48, 0x1C + + .global gUnknown_80DDA64 +gUnknown_80DDA64: @ 80DDA64 + .incbin "baserom.gba", 0xDDA64, 0x1C + + .global gUnknown_80DDA80 +gUnknown_80DDA80: @ 80DDA80 + .incbin "baserom.gba", 0xDDA80, 0x20 + + .global gUnknown_80DDAA0 +gUnknown_80DDAA0: @ 80DDAA0 + .incbin "baserom.gba", 0xDDAA0, 0x2C + + .global gUnknown_80DDACC +gUnknown_80DDACC: @ 80DDACC + .incbin "baserom.gba", 0xDDACC, 0x18 + + .global gUnknown_80DDAE4 +gUnknown_80DDAE4: @ 80DDAE4 + .incbin "baserom.gba", 0xDDAE4, 0x18 + + .global gUnknown_80DDAFC +gUnknown_80DDAFC: @ 80DDAFC + .incbin "baserom.gba", 0xDDAFC, 0x28 + + .global gUnknown_80DDB24 +gUnknown_80DDB24: @ 80DDB24 + .incbin "baserom.gba", 0xDDB24, 0x3C + + .global gUnknown_80DDB60 +gUnknown_80DDB60: @ 80DDB60 + .incbin "baserom.gba", 0xDDB60, 0x48 + + .global gUnknown_80DDBA8 +gUnknown_80DDBA8: @ 80DDBA8 + .incbin "baserom.gba", 0xDDBA8, 0x54 + + .global gUnknown_80DDBFC +gUnknown_80DDBFC: @ 80DDBFC + .incbin "baserom.gba", 0xDDBFC, 0x34 + + .global gUnknown_80DDC30 +gUnknown_80DDC30: @ 80DDC30 + .incbin "baserom.gba", 0xDDC30, 0x40 + + .global gUnknown_80DDC70 +gUnknown_80DDC70: @ 80DDC70 + .incbin "baserom.gba", 0xDDC70, 0x4C + + .global gUnknown_80DDCBC +gUnknown_80DDCBC: @ 80DDCBC + .incbin "baserom.gba", 0xDDCBC, 0x70 + + .global gUnknown_80DDD2C +gUnknown_80DDD2C: @ 80DDD2C + .incbin "baserom.gba", 0xDDD2C, 0x5C + + .global gUnknown_80DDD88 +gUnknown_80DDD88: @ 80DDD88 + .incbin "baserom.gba", 0xDDD88, 0x34 + + .global gUnknown_80DDDBC +gUnknown_80DDDBC: @ 80DDDBC + .incbin "baserom.gba", 0xDDDBC, 0x1C + + .global gUnknown_80DDDD8 +gUnknown_80DDDD8: @ 80DDDD8 + .incbin "baserom.gba", 0xDDDD8, 0x48 + + .global gUnknown_80DDE20 +gUnknown_80DDE20: @ 80DDE20 + .incbin "baserom.gba", 0xDDE20, 0x38 + + .global gUnknown_80DDE58 +gUnknown_80DDE58: @ 80DDE58 + .incbin "baserom.gba", 0xDDE58, 0x68 + + .global gUnknown_80DDEC0 +gUnknown_80DDEC0: @ 80DDEC0 + .incbin "baserom.gba", 0xDDEC0, 0x6C + + .global gUnknown_80DDF2C +gUnknown_80DDF2C: @ 80DDF2C + .incbin "baserom.gba", 0xDDF2C, 0x8C + + .global gUnknown_80DDFB8 +gUnknown_80DDFB8: @ 80DDFB8 + .incbin "baserom.gba", 0xDDFB8, 0x64 + + .global gUnknown_80DE01C +gUnknown_80DE01C: @ 80DE01C + .incbin "baserom.gba", 0xDE01C, 0x50 + + .global gUnknown_80DE06C +gUnknown_80DE06C: @ 80DE06C + .incbin "baserom.gba", 0xDE06C, 0x54 + + .global gUnknown_80DE0C0 +gUnknown_80DE0C0: @ 80DE0C0 + .incbin "baserom.gba", 0xDE0C0, 0x64 + + .global gUnknown_80DE124 +gUnknown_80DE124: @ 80DE124 + .incbin "baserom.gba", 0xDE124, 0x54 + + .global gUnknown_80DE178 +gUnknown_80DE178: @ 80DE178 + .incbin "baserom.gba", 0xDE178, 0x3C + + .global gUnknown_80DE1B4 +gUnknown_80DE1B4: @ 80DE1B4 + .incbin "baserom.gba", 0xDE1B4, 0x30 + + .global gUnknown_80DE1E4 +gUnknown_80DE1E4: @ 80DE1E4 + .incbin "baserom.gba", 0xDE1E4, 0x9C + + .global gUnknown_80DE280 +gUnknown_80DE280: @ 80DE280 + .incbin "baserom.gba", 0xDE280, 0x30 + + .global gUnknown_80DE2B0 +gUnknown_80DE2B0: @ 80DE2B0 + .incbin "baserom.gba", 0xDE2B0, 0xB8 + + .global gUnknown_80DE368 +gUnknown_80DE368: @ 80DE368 + .incbin "baserom.gba", 0xDE368, 0xC8 + + .global gUnknown_80DE430 +gUnknown_80DE430: @ 80DE430 + .incbin "baserom.gba", 0xDE430, 0x5C + + .global gUnknown_80DE48C +gUnknown_80DE48C: @ 80DE48C + .incbin "baserom.gba", 0xDE48C, 0x2C + + .global gUnknown_80DE4B8 +gUnknown_80DE4B8: @ 80DE4B8 + .incbin "baserom.gba", 0xDE4B8, 0x38 + + .global gUnknown_80DE4F0 +gUnknown_80DE4F0: @ 80DE4F0 + .incbin "baserom.gba", 0xDE4F0, 0x34 + + .global gUnknown_80DE524 +gUnknown_80DE524: @ 80DE524 + .incbin "baserom.gba", 0xDE524, 0xF0 + + .global gUnknown_80DE614 +gUnknown_80DE614: @ 80DE614 + .incbin "baserom.gba", 0xDE614, 0x34 + + .global gUnknown_80DE648 +gUnknown_80DE648: @ 80DE648 + .incbin "baserom.gba", 0xDE648, 0x4C + + .global gUnknown_80DE694 +gUnknown_80DE694: @ 80DE694 + .incbin "baserom.gba", 0xDE694, 0x40 + + .global gUnknown_80DE6D4 +gUnknown_80DE6D4: @ 80DE6D4 + .incbin "baserom.gba", 0xDE6D4, 0x80 + + .global gUnknown_80DE754 +gUnknown_80DE754: @ 80DE754 + .incbin "baserom.gba", 0xDE754, 0x64 + + .global gUnknown_80DE7B8 +gUnknown_80DE7B8: @ 80DE7B8 + .incbin "baserom.gba", 0xDE7B8, 0x30 + + .global gUnknown_80DE7E8 +gUnknown_80DE7E8: @ 80DE7E8 + .incbin "baserom.gba", 0xDE7E8, 0x20 + + .global gUnknown_80DE808 +gUnknown_80DE808: @ 80DE808 + .incbin "baserom.gba", 0xDE808, 0x28 + + .global gUnknown_80DE830 +gUnknown_80DE830: @ 80DE830 + .incbin "baserom.gba", 0xDE830, 0x34 + + .global gUnknown_80DE864 +gUnknown_80DE864: @ 80DE864 + .incbin "baserom.gba", 0xDE864, 0x50 + + .global gUnknown_80DE8B4 +gUnknown_80DE8B4: @ 80DE8B4 + .incbin "baserom.gba", 0xDE8B4, 0x64 + + .global gUnknown_80DE918 +gUnknown_80DE918: @ 80DE918 + .incbin "baserom.gba", 0xDE918, 0x24 + + .global gUnknown_80DE93C +gUnknown_80DE93C: @ 80DE93C + .incbin "baserom.gba", 0xDE93C, 0x18 + + .global gUnknown_80DE954 +gUnknown_80DE954: @ 80DE954 + .incbin "baserom.gba", 0xDE954, 0x38 + + .global gUnknown_80DE98C +gUnknown_80DE98C: @ 80DE98C + .incbin "baserom.gba", 0xDE98C, 0x64 + + .global gUnknown_80DE9F0 +gUnknown_80DE9F0: @ 80DE9F0 + .incbin "baserom.gba", 0xDE9F0, 0x68 + + .global gUnknown_80DEA58 +gUnknown_80DEA58: @ 80DEA58 + .incbin "baserom.gba", 0xDEA58, 0x5C + + .global gUnknown_80DEAB4 +gUnknown_80DEAB4: @ 80DEAB4 + .incbin "baserom.gba", 0xDEAB4, 0x64 + + .global gUnknown_80DEB18 +gUnknown_80DEB18: @ 80DEB18 + .incbin "baserom.gba", 0xDEB18, 0x3C + + .global gUnknown_80DEB54 +gUnknown_80DEB54: @ 80DEB54 + .incbin "baserom.gba", 0xDEB54, 0xAC + + .global gUnknown_80DEC00 +gUnknown_80DEC00: @ 80DEC00 + .incbin "baserom.gba", 0xDEC00, 0x70 + + .global gUnknown_80DEC70 +gUnknown_80DEC70: @ 80DEC70 + .incbin "baserom.gba", 0xDEC70, 0x50 + + .global gUnknown_80DECC0 +gUnknown_80DECC0: @ 80DECC0 + .incbin "baserom.gba", 0xDECC0, 0x3C + + .global gUnknown_80DECFC +gUnknown_80DECFC: @ 80DECFC + .incbin "baserom.gba", 0xDECFC, 0x48 + + .global gUnknown_80DED44 +gUnknown_80DED44: @ 80DED44 + .incbin "baserom.gba", 0xDED44, 0x4 + + .global gUnknown_80DED48 +gUnknown_80DED48: @ 80DED48 + .incbin "baserom.gba", 0xDED48, 0x18 + + .global gUnknown_80DED60 +gUnknown_80DED60: @ 80DED60 + .incbin "baserom.gba", 0xDED60, 0x18 + + .global gUnknown_80DED78 +gUnknown_80DED78: @ 80DED78 + .incbin "baserom.gba", 0xDED78, 0x40 + + .global gUnknown_80DEDB8 +gUnknown_80DEDB8: @ 80DEDB8 + .incbin "baserom.gba", 0xDEDB8, 0x50 + + .global gUnknown_80DEE08 +gUnknown_80DEE08: @ 80DEE08 + .incbin "baserom.gba", 0xDEE08, 0x3C + + .global gUnknown_80DEE44 +gUnknown_80DEE44: @ 80DEE44 + .incbin "baserom.gba", 0xDEE44, 0x1C + + .global gUnknown_80DEE60 +gUnknown_80DEE60: @ 80DEE60 + .incbin "baserom.gba", 0xDEE60, 0x1C + + .global gUnknown_80DEE7C +gUnknown_80DEE7C: @ 80DEE7C + .incbin "baserom.gba", 0xDEE7C, 0x40 + + .global gUnknown_80DEEBC +gUnknown_80DEEBC: @ 80DEEBC + .incbin "baserom.gba", 0xDEEBC, 0x28 + + .global gUnknown_80DEEE4 +gUnknown_80DEEE4: @ 80DEEE4 + .incbin "baserom.gba", 0xDEEE4, 0x20 + + .global gUnknown_80DEF04 +gUnknown_80DEF04: @ 80DEF04 + .incbin "baserom.gba", 0xDEF04, 0x24 + + .global gUnknown_80DEF28 +gUnknown_80DEF28: @ 80DEF28 + .incbin "baserom.gba", 0xDEF28, 0x58 + + .global gUnknown_80DEF80 +gUnknown_80DEF80: @ 80DEF80 + .incbin "baserom.gba", 0xDEF80, 0x5C + + .global gUnknown_80DEFDC +gUnknown_80DEFDC: @ 80DEFDC + .incbin "baserom.gba", 0xDEFDC, 0x68 + + .global gUnknown_80DF044 +gUnknown_80DF044: @ 80DF044 + .incbin "baserom.gba", 0xDF044, 0x5C + + .global gUnknown_80DF0A0 +gUnknown_80DF0A0: @ 80DF0A0 + .incbin "baserom.gba", 0xDF0A0, 0x40 + + .global gUnknown_80DF0E0 +gUnknown_80DF0E0: @ 80DF0E0 + .incbin "baserom.gba", 0xDF0E0, 0x58 + + .global gUnknown_80DF138 +gUnknown_80DF138: @ 80DF138 + .incbin "baserom.gba", 0xDF138, 0x5C + + .global gUnknown_80DF194 +gUnknown_80DF194: @ 80DF194 + .incbin "baserom.gba", 0xDF194, 0x2C + + .global gUnknown_80DF1C0 +gUnknown_80DF1C0: @ 80DF1C0 + .incbin "baserom.gba", 0xDF1C0, 0x48 + + .global gUnknown_80DF208 +gUnknown_80DF208: @ 80DF208 + .incbin "baserom.gba", 0xDF208, 0x48 + + .global gUnknown_80DF250 +gUnknown_80DF250: @ 80DF250 + .incbin "baserom.gba", 0xDF250, 0xB4 + + .global gUnknown_80DF304 +gUnknown_80DF304: @ 80DF304 + .incbin "baserom.gba", 0xDF304, 0x2C + + .global gUnknown_80DF330 +gUnknown_80DF330: @ 80DF330 + .incbin "baserom.gba", 0xDF330, 0x50 + + .global gUnknown_80DF380 +gUnknown_80DF380: @ 80DF380 + .incbin "baserom.gba", 0xDF380, 0x34 + + .global gUnknown_80DF3B4 +gUnknown_80DF3B4: @ 80DF3B4 + .incbin "baserom.gba", 0xDF3B4, 0x64 + + .global gUnknown_80DF418 +gUnknown_80DF418: @ 80DF418 + .incbin "baserom.gba", 0xDF418, 0x34 + + .global gUnknown_80DF44C +gUnknown_80DF44C: @ 80DF44C + .incbin "baserom.gba", 0xDF44C, 0x20 + + .global gUnknown_80DF46C +gUnknown_80DF46C: @ 80DF46C + .incbin "baserom.gba", 0xDF46C, 0x88 + + .global gUnknown_80DF4F4 +gUnknown_80DF4F4: @ 80DF4F4 + .incbin "baserom.gba", 0xDF4F4, 0x50 + + .global gUnknown_80DF544 +gUnknown_80DF544: @ 80DF544 + .incbin "baserom.gba", 0xDF544, 0x50 + + .global gUnknown_80DF594 +gUnknown_80DF594: @ 80DF594 + .incbin "baserom.gba", 0xDF594, 0x50 + + .global gUnknown_80DF5E4 +gUnknown_80DF5E4: @ 80DF5E4 + .incbin "baserom.gba", 0xDF5E4, 0x58 + + .global gUnknown_80DF63C +gUnknown_80DF63C: @ 80DF63C + .incbin "baserom.gba", 0xDF63C, 0x58 + + .global gUnknown_80DF694 +gUnknown_80DF694: @ 80DF694 + .incbin "baserom.gba", 0xDF694, 0x5C + + .global gUnknown_80DF6F0 +gUnknown_80DF6F0: @ 80DF6F0 + .incbin "baserom.gba", 0xDF6F0, 0x20 + + .global gUnknown_80DF710 +gUnknown_80DF710: @ 80DF710 + .incbin "baserom.gba", 0xDF710, 0x2C + + .global gUnknown_80DF73C +gUnknown_80DF73C: @ 80DF73C + .incbin "baserom.gba", 0xDF73C, 0x40 + + .global gUnknown_80DF77C +gUnknown_80DF77C: @ 80DF77C + .incbin "baserom.gba", 0xDF77C, 0x58 + + .global gUnknown_80DF7D4 +gUnknown_80DF7D4: @ 80DF7D4 + .incbin "baserom.gba", 0xDF7D4, 0x9C + + .global gUnknown_80DF870 +gUnknown_80DF870: @ 80DF870 + .incbin "baserom.gba", 0xDF870, 0x44 + + .global gUnknown_80DF8B4 +gUnknown_80DF8B4: @ 80DF8B4 + .incbin "baserom.gba", 0xDF8B4, 0x38 + + .global gUnknown_80DF8EC +gUnknown_80DF8EC: @ 80DF8EC + .incbin "baserom.gba", 0xDF8EC, 0x3C + + .global gUnknown_80DF928 +gUnknown_80DF928: @ 80DF928 + .incbin "baserom.gba", 0xDF928, 0x24 + + .global gUnknown_80DF94C +gUnknown_80DF94C: @ 80DF94C + .incbin "baserom.gba", 0xDF94C, 0x20 + + .global gUnknown_80DF96C +gUnknown_80DF96C: @ 80DF96C + .incbin "baserom.gba", 0xDF96C, 0x38 + + .global gUnknown_80DF9A4 +gUnknown_80DF9A4: @ 80DF9A4 + .incbin "baserom.gba", 0xDF9A4, 0x4C + + .global gUnknown_80DF9F0 +gUnknown_80DF9F0: @ 80DF9F0 + .incbin "baserom.gba", 0xDF9F0, 0x8 + + .global gUnknown_80DF9F8 +gUnknown_80DF9F8: @ 80DF9F8 + .incbin "baserom.gba", 0xDF9F8, 0xB0 + + .global gUnknown_80DFAA8 +gUnknown_80DFAA8: @ 80DFAA8 + .incbin "baserom.gba", 0xDFAA8, 0x6C + + .global gUnknown_80DFB14 +gUnknown_80DFB14: @ 80DFB14 + .incbin "baserom.gba", 0xDFB14, 0xBC + + .global gUnknown_80DFBD0 +gUnknown_80DFBD0: @ 80DFBD0 + .incbin "baserom.gba", 0xDFBD0, 0x18 + + .global gUnknown_80DFBE8 +gUnknown_80DFBE8: @ 80DFBE8 + .incbin "baserom.gba", 0xDFBE8, 0x4 + + .global gUnknown_80DFBEC +gUnknown_80DFBEC: @ 80DFBEC + .incbin "baserom.gba", 0xDFBEC, 0x18 + + .global gUnknown_80DFC04 +gUnknown_80DFC04: @ 80DFC04 + .incbin "baserom.gba", 0xDFC04, 0x14 + + .global gUnknown_80DFC18 +gUnknown_80DFC18: @ 80DFC18 + .incbin "baserom.gba", 0xDFC18, 0x1C + + .global gUnknown_80DFC34 +gUnknown_80DFC34: @ 80DFC34 + .incbin "baserom.gba", 0xDFC34, 0x18 + + .global gUnknown_80DFC4C +gUnknown_80DFC4C: @ 80DFC4C + .incbin "baserom.gba", 0xDFC4C, 0x4 + + .global gUnknown_80DFC50 +gUnknown_80DFC50: @ 80DFC50 + .incbin "baserom.gba", 0xDFC50, 0xC + + .global gUnknown_80DFC5C +gUnknown_80DFC5C: @ 80DFC5C + .incbin "baserom.gba", 0xDFC5C, 0x18 + + .global gUnknown_80DFC74 +gUnknown_80DFC74: @ 80DFC74 + .incbin "baserom.gba", 0xDFC74, 0x18 + + .global gUnknown_80DFC8C +gUnknown_80DFC8C: @ 80DFC8C + .incbin "baserom.gba", 0xDFC8C, 0x10 + + .global gUnknown_80DFC9C +gUnknown_80DFC9C: @ 80DFC9C + .incbin "baserom.gba", 0xDFC9C, 0x18 + + .global gUnknown_80DFCB4 +gUnknown_80DFCB4: @ 80DFCB4 + .incbin "baserom.gba", 0xDFCB4, 0x18 + + .global gUnknown_80DFCCC +gUnknown_80DFCCC: @ 80DFCCC + .incbin "baserom.gba", 0xDFCCC, 0x18 + + .global gUnknown_80DFCE4 +gUnknown_80DFCE4: @ 80DFCE4 + .incbin "baserom.gba", 0xDFCE4, 0x18 + + .global gUnknown_80DFCFC +gUnknown_80DFCFC: @ 80DFCFC + .incbin "baserom.gba", 0xDFCFC, 0x18 + + .global gUnknown_80DFD14 +gUnknown_80DFD14: @ 80DFD14 + .incbin "baserom.gba", 0xDFD14, 0x14 + + .global gUnknown_80DFD28 +gUnknown_80DFD28: @ 80DFD28 + .incbin "baserom.gba", 0xDFD28, 0x18 + + .global gUnknown_80DFD40 +gUnknown_80DFD40: @ 80DFD40 + .incbin "baserom.gba", 0xDFD40, 0x18 + + .global gUnknown_80DFD58 +gUnknown_80DFD58: @ 80DFD58 + .incbin "baserom.gba", 0xDFD58, 0x18 + + .global gUnknown_80DFD70 +gUnknown_80DFD70: @ 80DFD70 + .incbin "baserom.gba", 0xDFD70, 0xC + + .global gUnknown_80DFD7C +gUnknown_80DFD7C: @ 80DFD7C + .incbin "baserom.gba", 0xDFD7C, 0x10 + + .global gUnknown_80DFD8C +gUnknown_80DFD8C: @ 80DFD8C + .incbin "baserom.gba", 0xDFD8C, 0x18 + + .global gUnknown_80DFDA4 +gUnknown_80DFDA4: @ 80DFDA4 + .incbin "baserom.gba", 0xDFDA4, 0x18 + + .global gUnknown_80DFDBC +gUnknown_80DFDBC: @ 80DFDBC + .incbin "baserom.gba", 0xDFDBC, 0x18 + + .global gUnknown_80DFDD4 +gUnknown_80DFDD4: @ 80DFDD4 + .incbin "baserom.gba", 0xDFDD4, 0x30 + + .global gUnknown_80DFE04 +gUnknown_80DFE04: @ 80DFE04 + .incbin "baserom.gba", 0xDFE04, 0x18 + + .global gUnknown_80DFE1C +gUnknown_80DFE1C: @ 80DFE1C + .incbin "baserom.gba", 0xDFE1C, 0x30 + + .global gUnknown_80DFE4C +gUnknown_80DFE4C: @ 80DFE4C + .incbin "baserom.gba", 0xDFE4C, 0x50 + + .global gUnknown_80DFE9C +gUnknown_80DFE9C: @ 80DFE9C + .incbin "baserom.gba", 0xDFE9C, 0x34 + + .global gUnknown_80DFED0 +gUnknown_80DFED0: @ 80DFED0 + .incbin "baserom.gba", 0xDFED0, 0x5C + + .global gUnknown_80DFF2C +gUnknown_80DFF2C: @ 80DFF2C + .incbin "baserom.gba", 0xDFF2C, 0x78 + + .global gUnknown_80DFFA4 +gUnknown_80DFFA4: @ 80DFFA4 + .incbin "baserom.gba", 0xDFFA4, 0x6C + + .global gUnknown_80E0010 +gUnknown_80E0010: @ 80E0010 + .incbin "baserom.gba", 0xE0010, 0x64 + + .global gUnknown_80E0074 +gUnknown_80E0074: @ 80E0074 + .incbin "baserom.gba", 0xE0074, 0x20 + + .global gUnknown_80E0094 +gUnknown_80E0094: @ 80E0094 + .incbin "baserom.gba", 0xE0094, 0x74 + + .global gUnknown_80E0108 +gUnknown_80E0108: @ 80E0108 + .incbin "baserom.gba", 0xE0108, 0x44 + + .global gUnknown_80E014C +gUnknown_80E014C: @ 80E014C + .incbin "baserom.gba", 0xE014C, 0xC + + .global gUnknown_80E0158 +gUnknown_80E0158: @ 80E0158 + .incbin "baserom.gba", 0xE0158, 0x14 + + .global gUnknown_80E016C +gUnknown_80E016C: @ 80E016C + .incbin "baserom.gba", 0xE016C, 0x18 + + .global gUnknown_80E0184 +gUnknown_80E0184: @ 80E0184 + .incbin "baserom.gba", 0xE0184, 0x1C + + .global gUnknown_80E01A0 +gUnknown_80E01A0: @ 80E01A0 + .incbin "baserom.gba", 0xE01A0, 0x24 + + .global gUnknown_80E01C4 +gUnknown_80E01C4: @ 80E01C4 + .incbin "baserom.gba", 0xE01C4, 0x2C + + .global gUnknown_80E01F0 +gUnknown_80E01F0: @ 80E01F0 + .incbin "baserom.gba", 0xE01F0, 0x28 + + .global gUnknown_80E0218 +gUnknown_80E0218: @ 80E0218 + .incbin "baserom.gba", 0xE0218, 0x30 + + .global gUnknown_80E0248 +gUnknown_80E0248: @ 80E0248 + .incbin "baserom.gba", 0xE0248, 0x1C + + .global gUnknown_80E0264 +gUnknown_80E0264: @ 80E0264 + .incbin "baserom.gba", 0xE0264, 0x20 + + .global gUnknown_80E0284 +gUnknown_80E0284: @ 80E0284 + .incbin "baserom.gba", 0xE0284, 0x18 + + .global gUnknown_80E029C +gUnknown_80E029C: @ 80E029C + .incbin "baserom.gba", 0xE029C, 0x18 + + .global gUnknown_80E02B4 +gUnknown_80E02B4: @ 80E02B4 + .incbin "baserom.gba", 0xE02B4, 0x18 + + .global gUnknown_80E02CC +gUnknown_80E02CC: @ 80E02CC + .incbin "baserom.gba", 0xE02CC, 0x18 + + .global gUnknown_80E02E4 +gUnknown_80E02E4: @ 80E02E4 + .incbin "baserom.gba", 0xE02E4, 0xC + + .global gUnknown_80E02F0 +gUnknown_80E02F0: @ 80E02F0 + .incbin "baserom.gba", 0xE02F0, 0xC + + .global gUnknown_80E02FC +gUnknown_80E02FC: @ 80E02FC + .incbin "baserom.gba", 0xE02FC, 0xC + + .global gUnknown_80E0308 +gUnknown_80E0308: @ 80E0308 + .incbin "baserom.gba", 0xE0308, 0x8 + + .global gUnknown_80E0310 +gUnknown_80E0310: @ 80E0310 + .incbin "baserom.gba", 0xE0310, 0x8 + + .global gUnknown_80E0318 +gUnknown_80E0318: @ 80E0318 + .incbin "baserom.gba", 0xE0318, 0xC + + .global gUnknown_80E0324 +gUnknown_80E0324: @ 80E0324 + .incbin "baserom.gba", 0xE0324, 0xC + + .global gUnknown_80E0330 +gUnknown_80E0330: @ 80E0330 + .incbin "baserom.gba", 0xE0330, 0x18 + + .global gUnknown_80E0348 +gUnknown_80E0348: @ 80E0348 + .incbin "baserom.gba", 0xE0348, 0x18 + + .global gUnknown_80E0360 +gUnknown_80E0360: @ 80E0360 + .incbin "baserom.gba", 0xE0360, 0x18 + + .global gUnknown_80E0378 +gUnknown_80E0378: @ 80E0378 + .incbin "baserom.gba", 0xE0378, 0x18 + + .global gUnknown_80E0390 +gUnknown_80E0390: @ 80E0390 + .incbin "baserom.gba", 0xE0390, 0x10 + + .global gUnknown_80E03A0 +gUnknown_80E03A0: @ 80E03A0 + .incbin "baserom.gba", 0xE03A0, 0xC + + .global gUnknown_80E03AC +gUnknown_80E03AC: @ 80E03AC + .incbin "baserom.gba", 0xE03AC, 0xC + + .global gUnknown_80E03B8 +gUnknown_80E03B8: @ 80E03B8 + .incbin "baserom.gba", 0xE03B8, 0xC + + .global gUnknown_80E03C4 +gUnknown_80E03C4: @ 80E03C4 + .incbin "baserom.gba", 0xE03C4, 0x30 + + .global gUnknown_80E03F4 +gUnknown_80E03F4: @ 80E03F4 + .incbin "baserom.gba", 0xE03F4, 0x18 + + .global gUnknown_80E040C +gUnknown_80E040C: @ 80E040C + .incbin "baserom.gba", 0xE040C, 0x10 + + .global gUnknown_80E041C +gUnknown_80E041C: @ 80E041C + .incbin "baserom.gba", 0xE041C, 0x18 + + .global gUnknown_80E0434 +gUnknown_80E0434: @ 80E0434 + .incbin "baserom.gba", 0xE0434, 0x28 + + .global gUnknown_80E045C +gUnknown_80E045C: @ 80E045C + .incbin "baserom.gba", 0xE045C, 0x28 + + .global gUnknown_80E0484 +gUnknown_80E0484: @ 80E0484 + .incbin "baserom.gba", 0xE0484, 0x30 + + .global gUnknown_80E04B4 +gUnknown_80E04B4: @ 80E04B4 + .incbin "baserom.gba", 0xE04B4, 0x40 + + .global gUnknown_80E04F4 +gUnknown_80E04F4: @ 80E04F4 + .incbin "baserom.gba", 0xE04F4, 0xCC + + .global gUnknown_80E05C0 +gUnknown_80E05C0: @ 80E05C0 + .incbin "baserom.gba", 0xE05C0, 0x3C + + .global gUnknown_80E05FC +gUnknown_80E05FC: @ 80E05FC + .incbin "baserom.gba", 0xE05FC, 0x44 + + .global gUnknown_80E0640 +gUnknown_80E0640: @ 80E0640 + .incbin "baserom.gba", 0xE0640, 0x30 + + .global gUnknown_80E0670 +gUnknown_80E0670: @ 80E0670 + .incbin "baserom.gba", 0xE0670, 0x38 + + .global gUnknown_80E06A8 +gUnknown_80E06A8: @ 80E06A8 + .incbin "baserom.gba", 0xE06A8, 0x54 + + .global gUnknown_80E06FC +gUnknown_80E06FC: @ 80E06FC + .incbin "baserom.gba", 0xE06FC, 0x18 + + .global gUnknown_80E0714 +gUnknown_80E0714: @ 80E0714 + .incbin "baserom.gba", 0xE0714, 0x18 + + .global gUnknown_80E072C +gUnknown_80E072C: @ 80E072C + .incbin "baserom.gba", 0xE072C, 0x18 + + .global gUnknown_80E0744 +gUnknown_80E0744: @ 80E0744 + .incbin "baserom.gba", 0xE0744, 0xC + + .global gUnknown_80E0750 +gUnknown_80E0750: @ 80E0750 + .incbin "baserom.gba", 0xE0750, 0x4 + + .global gUnknown_80E0754 +gUnknown_80E0754: @ 80E0754 + .incbin "baserom.gba", 0xE0754, 0xC + + .global gUnknown_80E0760 +gUnknown_80E0760: @ 80E0760 + .incbin "baserom.gba", 0xE0760, 0x18 + + .global gUnknown_80E0778 +gUnknown_80E0778: @ 80E0778 + .incbin "baserom.gba", 0xE0778, 0x60 + + .global gUnknown_80E07D8 +gUnknown_80E07D8: @ 80E07D8 + .incbin "baserom.gba", 0xE07D8, 0x14 + + .global gUnknown_80E07EC +gUnknown_80E07EC: @ 80E07EC + .incbin "baserom.gba", 0xE07EC, 0x18 + + .global gUnknown_80E0804 +gUnknown_80E0804: @ 80E0804 + .incbin "baserom.gba", 0xE0804, 0x18 + + .global gUnknown_80E081C +gUnknown_80E081C: @ 80E081C + .incbin "baserom.gba", 0xE081C, 0x8 + + .global gUnknown_80E0824 +gUnknown_80E0824: @ 80E0824 + .incbin "baserom.gba", 0xE0824, 0x4 + + .global gUnknown_80E0828 +gUnknown_80E0828: @ 80E0828 + .incbin "baserom.gba", 0xE0828, 0x14 + + .global gUnknown_80E083C +gUnknown_80E083C: @ 80E083C + .incbin "baserom.gba", 0xE083C, 0x18 + + .global gUnknown_80E0854 +gUnknown_80E0854: @ 80E0854 + .incbin "baserom.gba", 0xE0854, 0x18 + + .global gUnknown_80E086C +gUnknown_80E086C: @ 80E086C + .incbin "baserom.gba", 0xE086C, 0x94 + + .global gUnknown_80E0900 +gUnknown_80E0900: @ 80E0900 + .incbin "baserom.gba", 0xE0900, 0x1C + + .global gUnknown_80E091C +gUnknown_80E091C: @ 80E091C + .incbin "baserom.gba", 0xE091C, 0x18 + + .global gUnknown_80E0934 +gUnknown_80E0934: @ 80E0934 + .incbin "baserom.gba", 0xE0934, 0x4 + + .global gUnknown_80E0938 +gUnknown_80E0938: @ 80E0938 + .incbin "baserom.gba", 0xE0938, 0x10 + + .global gUnknown_80E0948 +gUnknown_80E0948: @ 80E0948 + .incbin "baserom.gba", 0xE0948, 0x20 + + .global gUnknown_80E0968 +gUnknown_80E0968: @ 80E0968 + .incbin "baserom.gba", 0xE0968, 0x28 + + .global gUnknown_80E0990 +gUnknown_80E0990: @ 80E0990 + .incbin "baserom.gba", 0xE0990, 0x18 + + .global gUnknown_80E09A8 +gUnknown_80E09A8: @ 80E09A8 + .incbin "baserom.gba", 0xE09A8, 0x18 + + .global gUnknown_80E09C0 +gUnknown_80E09C0: @ 80E09C0 + .incbin "baserom.gba", 0xE09C0, 0x18 + + .global gUnknown_80E09D8 +gUnknown_80E09D8: @ 80E09D8 + .incbin "baserom.gba", 0xE09D8, 0x34 + + .global gUnknown_80E0A0C +gUnknown_80E0A0C: @ 80E0A0C + .incbin "baserom.gba", 0xE0A0C, 0x3C + + .global gUnknown_80E0A48 +gUnknown_80E0A48: @ 80E0A48 + .incbin "baserom.gba", 0xE0A48, 0x74 + + .global gUnknown_80E0ABC +gUnknown_80E0ABC: @ 80E0ABC + .incbin "baserom.gba", 0xE0ABC, 0x80 + + .global gUnknown_80E0B3C +gUnknown_80E0B3C: @ 80E0B3C + .incbin "baserom.gba", 0xE0B3C, 0x98 + + .global gUnknown_80E0BD4 +gUnknown_80E0BD4: @ 80E0BD4 + .incbin "baserom.gba", 0xE0BD4, 0x78 + + .global gUnknown_80E0C4C +gUnknown_80E0C4C: @ 80E0C4C + .incbin "baserom.gba", 0xE0C4C, 0x24 + + .global gUnknown_80E0C70 +gUnknown_80E0C70: @ 80E0C70 + .incbin "baserom.gba", 0xE0C70, 0x160 + + .global gUnknown_80E0DD0 +gUnknown_80E0DD0: @ 80E0DD0 + .incbin "baserom.gba", 0xE0DD0, 0x108 + + .global gUnknown_80E0ED8 +gUnknown_80E0ED8: @ 80E0ED8 + .incbin "baserom.gba", 0xE0ED8, 0x1F0 + + .global gUnknown_80E10C8 +gUnknown_80E10C8: @ 80E10C8 + .incbin "baserom.gba", 0xE10C8, 0x144 + + .global gUnknown_80E120C +gUnknown_80E120C: @ 80E120C + .incbin "baserom.gba", 0xE120C, 0x160 + + .global gUnknown_80E136C +gUnknown_80E136C: @ 80E136C + .incbin "baserom.gba", 0xE136C, 0xB4 + + .global gUnknown_80E1420 +gUnknown_80E1420: @ 80E1420 + .incbin "baserom.gba", 0xE1420, 0x15C + + .global gUnknown_80E157C +gUnknown_80E157C: @ 80E157C + .incbin "baserom.gba", 0xE157C, 0x120 + + .global gUnknown_80E169C +gUnknown_80E169C: @ 80E169C + .incbin "baserom.gba", 0xE169C, 0x12C + + .global gUnknown_80E17C8 +gUnknown_80E17C8: @ 80E17C8 + .incbin "baserom.gba", 0xE17C8, 0x74 + + .global gUnknown_80E183C +gUnknown_80E183C: @ 80E183C + .incbin "baserom.gba", 0xE183C, 0x2C + + .global gUnknown_80E1868 +gUnknown_80E1868: @ 80E1868 + .incbin "baserom.gba", 0xE1868, 0x1C8 + + .global gUnknown_80E1A30 +gUnknown_80E1A30: @ 80E1A30 + .incbin "baserom.gba", 0xE1A30, 0xA8 + + .global gUnknown_80E1AD8 +gUnknown_80E1AD8: @ 80E1AD8 + .incbin "baserom.gba", 0xE1AD8, 0xB0 + + .global gUnknown_80E1B88 +gUnknown_80E1B88: @ 80E1B88 + .incbin "baserom.gba", 0xE1B88, 0x1FC + + .global gUnknown_80E1D84 +gUnknown_80E1D84: @ 80E1D84 + .incbin "baserom.gba", 0xE1D84, 0x178 + + .global gUnknown_80E1EFC +gUnknown_80E1EFC: @ 80E1EFC + .incbin "baserom.gba", 0xE1EFC, 0x1C + + .global gUnknown_80E1F18 +gUnknown_80E1F18: @ 80E1F18 + .incbin "baserom.gba", 0xE1F18, 0x18 + + .global gUnknown_80E1F30 +gUnknown_80E1F30: @ 80E1F30 + .incbin "baserom.gba", 0xE1F30, 0xC + + .global gUnknown_80E1F3C +gUnknown_80E1F3C: @ 80E1F3C + .incbin "baserom.gba", 0xE1F3C, 0x4 + + .global gUnknown_80E1F40 +gUnknown_80E1F40: @ 80E1F40 + .incbin "baserom.gba", 0xE1F40, 0x14 + + .global gUnknown_80E1F54 +gUnknown_80E1F54: @ 80E1F54 + .incbin "baserom.gba", 0xE1F54, 0xC + + .global gUnknown_80E1F60 +gUnknown_80E1F60: @ 80E1F60 + .incbin "baserom.gba", 0xE1F60, 0x10 + + .global gUnknown_80E1F70 +gUnknown_80E1F70: @ 80E1F70 + .incbin "baserom.gba", 0xE1F70, 0x10 + + .global gUnknown_80E1F80 +gUnknown_80E1F80: @ 80E1F80 + .incbin "baserom.gba", 0xE1F80, 0x14 + + .global gUnknown_80E1F94 +gUnknown_80E1F94: @ 80E1F94 + .incbin "baserom.gba", 0xE1F94, 0x14 + + .global gUnknown_80E1FA8 +gUnknown_80E1FA8: @ 80E1FA8 + .incbin "baserom.gba", 0xE1FA8, 0x1C + + .global gUnknown_80E1FC4 +gUnknown_80E1FC4: @ 80E1FC4 + .incbin "baserom.gba", 0xE1FC4, 0x18 + + .global gUnknown_80E1FDC +gUnknown_80E1FDC: @ 80E1FDC + .incbin "baserom.gba", 0xE1FDC, 0x14 + + .global gUnknown_80E1FF0 +gUnknown_80E1FF0: @ 80E1FF0 + .incbin "baserom.gba", 0xE1FF0, 0x18 + + .global gUnknown_80E2008 +gUnknown_80E2008: @ 80E2008 + .incbin "baserom.gba", 0xE2008, 0x18 + + .global gUnknown_80E2020 +gUnknown_80E2020: @ 80E2020 + .incbin "baserom.gba", 0xE2020, 0x10 + + .global gUnknown_80E2030 +gUnknown_80E2030: @ 80E2030 + .incbin "baserom.gba", 0xE2030, 0x38 + + .global gUnknown_80E2068 +gUnknown_80E2068: @ 80E2068 + .incbin "baserom.gba", 0xE2068, 0x50 + + .global gUnknown_80E20B8 +gUnknown_80E20B8: @ 80E20B8 + .incbin "baserom.gba", 0xE20B8, 0x28 + + .global gUnknown_80E20E0 +gUnknown_80E20E0: @ 80E20E0 + .incbin "baserom.gba", 0xE20E0, 0x28 + + .global gUnknown_80E2108 +gUnknown_80E2108: @ 80E2108 + .incbin "baserom.gba", 0xE2108, 0x28 + + .global gUnknown_80E2130 +gUnknown_80E2130: @ 80E2130 + .incbin "baserom.gba", 0xE2130, 0x60 + + .global gUnknown_80E2190 +gUnknown_80E2190: @ 80E2190 + .incbin "baserom.gba", 0xE2190, 0x28 + + .global gUnknown_80E21B8 +gUnknown_80E21B8: @ 80E21B8 + .incbin "baserom.gba", 0xE21B8, 0x60 + + .global gUnknown_80E2218 +gUnknown_80E2218: @ 80E2218 + .incbin "baserom.gba", 0xE2218, 0x28 + + .global gUnknown_80E2240 +gUnknown_80E2240: @ 80E2240 + .incbin "baserom.gba", 0xE2240, 0x28 + + .global gUnknown_80E2268 +gUnknown_80E2268: @ 80E2268 + .incbin "baserom.gba", 0xE2268, 0x28 + + .global gUnknown_80E2290 +gUnknown_80E2290: @ 80E2290 + .incbin "baserom.gba", 0xE2290, 0x24 + + .global gUnknown_80E22B4 +gUnknown_80E22B4: @ 80E22B4 + .incbin "baserom.gba", 0xE22B4, 0x1C + + .global gUnknown_80E22D0 +gUnknown_80E22D0: @ 80E22D0 + .incbin "baserom.gba", 0xE22D0, 0x20 + + .global gUnknown_80E22F0 +gUnknown_80E22F0: @ 80E22F0 + .incbin "baserom.gba", 0xE22F0, 0x2C + + .global gUnknown_80E231C +gUnknown_80E231C: @ 80E231C + .incbin "baserom.gba", 0xE231C, 0x18 + + .global gUnknown_80E2334 +gUnknown_80E2334: @ 80E2334 + .incbin "baserom.gba", 0xE2334, 0x18 + + .global gUnknown_80E234C +gUnknown_80E234C: @ 80E234C + .incbin "baserom.gba", 0xE234C, 0x20 + + .global gUnknown_80E236C +gUnknown_80E236C: @ 80E236C + .incbin "baserom.gba", 0xE236C, 0x3C + + .global gUnknown_80E23A8 +gUnknown_80E23A8: @ 80E23A8 + .incbin "baserom.gba", 0xE23A8, 0x48 + + .global gUnknown_80E23F0 +gUnknown_80E23F0: @ 80E23F0 + .incbin "baserom.gba", 0xE23F0, 0x18 + + .global gUnknown_80E2408 +gUnknown_80E2408: @ 80E2408 + .incbin "baserom.gba", 0xE2408, 0x38 + + .global gUnknown_80E2440 +gUnknown_80E2440: @ 80E2440 + .incbin "baserom.gba", 0xE2440, 0x18 + + .global gUnknown_80E2458 +gUnknown_80E2458: @ 80E2458 + .incbin "baserom.gba", 0xE2458, 0x18 + + .global gUnknown_80E2470 +gUnknown_80E2470: @ 80E2470 + .incbin "baserom.gba", 0xE2470, 0x40 + + .global gUnknown_80E24B0 +gUnknown_80E24B0: @ 80E24B0 + .incbin "baserom.gba", 0xE24B0, 0x28 + + .global gUnknown_80E24D8 +gUnknown_80E24D8: @ 80E24D8 + .incbin "baserom.gba", 0xE24D8, 0x20 + + .global gUnknown_80E24F8 +gUnknown_80E24F8: @ 80E24F8 + .incbin "baserom.gba", 0xE24F8, 0x5C + + .global gUnknown_80E2554 +gUnknown_80E2554: @ 80E2554 + .incbin "baserom.gba", 0xE2554, 0x60 + + .global gUnknown_80E25B4 +gUnknown_80E25B4: @ 80E25B4 + .incbin "baserom.gba", 0xE25B4, 0x40 + + .global gUnknown_80E25F4 +gUnknown_80E25F4: @ 80E25F4 + .incbin "baserom.gba", 0xE25F4, 0x1C + + .global gUnknown_80E2610 +gUnknown_80E2610: @ 80E2610 + .incbin "baserom.gba", 0xE2610, 0x30 + + .global gUnknown_80E2640 +gUnknown_80E2640: @ 80E2640 + .incbin "baserom.gba", 0xE2640, 0x40 + + .global gUnknown_80E2680 +gUnknown_80E2680: @ 80E2680 + .incbin "baserom.gba", 0xE2680, 0x30 + + .global gUnknown_80E26B0 +gUnknown_80E26B0: @ 80E26B0 + .incbin "baserom.gba", 0xE26B0, 0x40 + + .global gUnknown_80E26F0 +gUnknown_80E26F0: @ 80E26F0 + .incbin "baserom.gba", 0xE26F0, 0x38 + + .global gUnknown_80E2728 +gUnknown_80E2728: @ 80E2728 + .incbin "baserom.gba", 0xE2728, 0x44 + + .global gUnknown_80E276C +gUnknown_80E276C: @ 80E276C + .incbin "baserom.gba", 0xE276C, 0x38 + + .global gUnknown_80E27A4 +gUnknown_80E27A4: @ 80E27A4 + .incbin "baserom.gba", 0xE27A4, 0x70 + + .global gUnknown_80E2814 +gUnknown_80E2814: @ 80E2814 + .incbin "baserom.gba", 0xE2814, 0x2C + + .global gUnknown_80E2840 +gUnknown_80E2840: @ 80E2840 + .incbin "baserom.gba", 0xE2840, 0x34 + + .global gUnknown_80E2874 +gUnknown_80E2874: @ 80E2874 + .incbin "baserom.gba", 0xE2874, 0x24 + + .global gUnknown_80E2898 +gUnknown_80E2898: @ 80E2898 + .incbin "baserom.gba", 0xE2898, 0x40 + + .global gUnknown_80E28D8 +gUnknown_80E28D8: @ 80E28D8 + .incbin "baserom.gba", 0xE28D8, 0x2C + + .global gUnknown_80E2904 +gUnknown_80E2904: @ 80E2904 + .incbin "baserom.gba", 0xE2904, 0x68 + + .global gUnknown_80E296C +gUnknown_80E296C: @ 80E296C + .incbin "baserom.gba", 0xE296C, 0x34 + + .global gUnknown_80E29A0 +gUnknown_80E29A0: @ 80E29A0 + .incbin "baserom.gba", 0xE29A0, 0x30 + + .global gUnknown_80E29D0 +gUnknown_80E29D0: @ 80E29D0 + .incbin "baserom.gba", 0xE29D0, 0x3C + + .global gUnknown_80E2A0C +gUnknown_80E2A0C: @ 80E2A0C + .incbin "baserom.gba", 0xE2A0C, 0x10 + + .global gUnknown_80E2A1C +gUnknown_80E2A1C: @ 80E2A1C + .incbin "baserom.gba", 0xE2A1C, 0x40 + + .global gUnknown_80E2A5C +gUnknown_80E2A5C: @ 80E2A5C + .incbin "baserom.gba", 0xE2A5C, 0x24 + + .global gUnknown_80E2A80 +gUnknown_80E2A80: @ 80E2A80 + .incbin "baserom.gba", 0xE2A80, 0x28 + + .global gUnknown_80E2AA8 +gUnknown_80E2AA8: @ 80E2AA8 + .incbin "baserom.gba", 0xE2AA8, 0x3C + + .global gUnknown_80E2AE4 +gUnknown_80E2AE4: @ 80E2AE4 + .incbin "baserom.gba", 0xE2AE4, 0x70 + + .global gUnknown_80E2B54 +gUnknown_80E2B54: @ 80E2B54 + .incbin "baserom.gba", 0xE2B54, 0x3C + + .global gUnknown_80E2B90 +gUnknown_80E2B90: @ 80E2B90 + .incbin "baserom.gba", 0xE2B90, 0x50 + + .global gUnknown_80E2BE0 +gUnknown_80E2BE0: @ 80E2BE0 + .incbin "baserom.gba", 0xE2BE0, 0x68 + + .global gUnknown_80E2C48 +gUnknown_80E2C48: @ 80E2C48 + .incbin "baserom.gba", 0xE2C48, 0x4C + + .global gUnknown_80E2C94 +gUnknown_80E2C94: @ 80E2C94 + .incbin "baserom.gba", 0xE2C94, 0x40 + + .global gUnknown_80E2CD4 +gUnknown_80E2CD4: @ 80E2CD4 + .incbin "baserom.gba", 0xE2CD4, 0x14 + + .global gUnknown_80E2CE8 +gUnknown_80E2CE8: @ 80E2CE8 + .incbin "baserom.gba", 0xE2CE8, 0x48 + + .global gUnknown_80E2D30 +gUnknown_80E2D30: @ 80E2D30 + .incbin "baserom.gba", 0xE2D30, 0x30 + + .global gUnknown_80E2D60 +gUnknown_80E2D60: @ 80E2D60 + .incbin "baserom.gba", 0xE2D60, 0x1C + + .global gUnknown_80E2D7C +gUnknown_80E2D7C: @ 80E2D7C + .incbin "baserom.gba", 0xE2D7C, 0x54 + + .global gUnknown_80E2DD0 +gUnknown_80E2DD0: @ 80E2DD0 + .incbin "baserom.gba", 0xE2DD0, 0x50 + + .global gUnknown_80E2E20 +gUnknown_80E2E20: @ 80E2E20 + .incbin "baserom.gba", 0xE2E20, 0x34 + + .global gUnknown_80E2E54 +gUnknown_80E2E54: @ 80E2E54 + .incbin "baserom.gba", 0xE2E54, 0x60 + + .global gUnknown_80E2EB4 +gUnknown_80E2EB4: @ 80E2EB4 + .incbin "baserom.gba", 0xE2EB4, 0x60 + + .global gUnknown_80E2F14 +gUnknown_80E2F14: @ 80E2F14 + .incbin "baserom.gba", 0xE2F14, 0x30 + + .global gUnknown_80E2F44 +gUnknown_80E2F44: @ 80E2F44 + .incbin "baserom.gba", 0xE2F44, 0x34 + + .global gUnknown_80E2F78 +gUnknown_80E2F78: @ 80E2F78 + .incbin "baserom.gba", 0xE2F78, 0x28 + + .global gUnknown_80E2FA0 +gUnknown_80E2FA0: @ 80E2FA0 + .incbin "baserom.gba", 0xE2FA0, 0x4C + + .global gUnknown_80E2FEC +gUnknown_80E2FEC: @ 80E2FEC + .incbin "baserom.gba", 0xE2FEC, 0x44 + + .global gUnknown_80E3030 +gUnknown_80E3030: @ 80E3030 + .incbin "baserom.gba", 0xE3030, 0x48 + + .global gUnknown_80E3078 +gUnknown_80E3078: @ 80E3078 + .incbin "baserom.gba", 0xE3078, 0x2C + + .global gUnknown_80E30A4 +gUnknown_80E30A4: @ 80E30A4 + .incbin "baserom.gba", 0xE30A4, 0x2C + + .global gUnknown_80E30D0 +gUnknown_80E30D0: @ 80E30D0 + .incbin "baserom.gba", 0xE30D0, 0x4C + + .global gUnknown_80E311C +gUnknown_80E311C: @ 80E311C + .incbin "baserom.gba", 0xE311C, 0x30 + + .global gUnknown_80E314C +gUnknown_80E314C: @ 80E314C + .incbin "baserom.gba", 0xE314C, 0x30 + + .global gUnknown_80E317C +gUnknown_80E317C: @ 80E317C + .incbin "baserom.gba", 0xE317C, 0x20 + + .global gUnknown_80E319C +gUnknown_80E319C: @ 80E319C + .incbin "baserom.gba", 0xE319C, 0x3C + + .global gUnknown_80E31D8 +gUnknown_80E31D8: @ 80E31D8 + .incbin "baserom.gba", 0xE31D8, 0x24 + + .global gUnknown_80E31FC +gUnknown_80E31FC: @ 80E31FC + .incbin "baserom.gba", 0xE31FC, 0x24 + + .global gUnknown_80E3220 +gUnknown_80E3220: @ 80E3220 + .incbin "baserom.gba", 0xE3220, 0x28 + + .global gUnknown_80E3248 +gUnknown_80E3248: @ 80E3248 + .incbin "baserom.gba", 0xE3248, 0x40 + + .global gUnknown_80E3288 +gUnknown_80E3288: @ 80E3288 + .incbin "baserom.gba", 0xE3288, 0x3C + + .global gUnknown_80E32C4 +gUnknown_80E32C4: @ 80E32C4 + .incbin "baserom.gba", 0xE32C4, 0x58 + + .global gUnknown_80E331C +gUnknown_80E331C: @ 80E331C + .incbin "baserom.gba", 0xE331C, 0x5C + + .global gUnknown_80E3378 +gUnknown_80E3378: @ 80E3378 + .incbin "baserom.gba", 0xE3378, 0x24 + + .global gUnknown_80E339C +gUnknown_80E339C: @ 80E339C + .incbin "baserom.gba", 0xE339C, 0x3C + + .global gUnknown_80E33D8 +gUnknown_80E33D8: @ 80E33D8 + .incbin "baserom.gba", 0xE33D8, 0x58 + + .global gUnknown_80E3430 +gUnknown_80E3430: @ 80E3430 + .incbin "baserom.gba", 0xE3430, 0x80 + + .global gUnknown_80E34B0 +gUnknown_80E34B0: @ 80E34B0 + .incbin "baserom.gba", 0xE34B0, 0x40 + + .global gUnknown_80E34F0 +gUnknown_80E34F0: @ 80E34F0 + .incbin "baserom.gba", 0xE34F0, 0x3C + + .global gUnknown_80E352C +gUnknown_80E352C: @ 80E352C + .incbin "baserom.gba", 0xE352C, 0x30 + + .global gUnknown_80E355C +gUnknown_80E355C: @ 80E355C + .incbin "baserom.gba", 0xE355C, 0x50 + + .global gUnknown_80E35AC +gUnknown_80E35AC: @ 80E35AC + .incbin "baserom.gba", 0xE35AC, 0x3C + + .global gUnknown_80E35E8 +gUnknown_80E35E8: @ 80E35E8 + .incbin "baserom.gba", 0xE35E8, 0x24 + + .global gUnknown_80E360C +gUnknown_80E360C: @ 80E360C + .incbin "baserom.gba", 0xE360C, 0x38 + + .global gUnknown_80E3644 +gUnknown_80E3644: @ 80E3644 + .incbin "baserom.gba", 0xE3644, 0x38 + + .global gUnknown_80E367C +gUnknown_80E367C: @ 80E367C + .incbin "baserom.gba", 0xE367C, 0x14 + + .global gUnknown_80E3690 +gUnknown_80E3690: @ 80E3690 + .incbin "baserom.gba", 0xE3690, 0x188 + + .global gUnknown_80E3818 +gUnknown_80E3818: @ 80E3818 + .incbin "baserom.gba", 0xE3818, 0x180 + + .global gUnknown_80E3998 +gUnknown_80E3998: @ 80E3998 + .incbin "baserom.gba", 0xE3998, 0x184 + + .global gUnknown_80E3B1C +gUnknown_80E3B1C: @ 80E3B1C + .incbin "baserom.gba", 0xE3B1C, 0xDC + + .global gUnknown_80E3BF8 +gUnknown_80E3BF8: @ 80E3BF8 + .incbin "baserom.gba", 0xE3BF8, 0x1EC + + .global gUnknown_80E3DE4 +gUnknown_80E3DE4: @ 80E3DE4 + .incbin "baserom.gba", 0xE3DE4, 0xB4 + + .global gUnknown_80E3E98 +gUnknown_80E3E98: @ 80E3E98 + .incbin "baserom.gba", 0xE3E98, 0x17C + + .global gUnknown_80E4014 +gUnknown_80E4014: @ 80E4014 + .incbin "baserom.gba", 0xE4014, 0x11C + + .global gUnknown_80E4130 +gUnknown_80E4130: @ 80E4130 + .incbin "baserom.gba", 0xE4130, 0xAC + + .global gUnknown_80E41DC +gUnknown_80E41DC: @ 80E41DC + .incbin "baserom.gba", 0xE41DC, 0x138 + + .global gUnknown_80E4314 +gUnknown_80E4314: @ 80E4314 + .incbin "baserom.gba", 0xE4314, 0x16C + + .global gUnknown_80E4480 +gUnknown_80E4480: @ 80E4480 + .incbin "baserom.gba", 0xE4480, 0x24 + + .global gUnknown_80E44A4 +gUnknown_80E44A4: @ 80E44A4 + .incbin "baserom.gba", 0xE44A4, 0x5C + + .global gUnknown_80E4500 +gUnknown_80E4500: @ 80E4500 + .incbin "baserom.gba", 0xE4500, 0x50 + + .global gUnknown_80E4550 +gUnknown_80E4550: @ 80E4550 + .incbin "baserom.gba", 0xE4550, 0x64 + + .global gUnknown_80E45B4 +gUnknown_80E45B4: @ 80E45B4 + .incbin "baserom.gba", 0xE45B4, 0x58 + + .global gUnknown_80E460C +gUnknown_80E460C: @ 80E460C + .incbin "baserom.gba", 0xE460C, 0x44 + + .global gUnknown_80E4650 +gUnknown_80E4650: @ 80E4650 + .incbin "baserom.gba", 0xE4650, 0x3C + + .global gUnknown_80E468C +gUnknown_80E468C: @ 80E468C + .incbin "baserom.gba", 0xE468C, 0x3C + + .global gUnknown_80E46C8 +gUnknown_80E46C8: @ 80E46C8 + .incbin "baserom.gba", 0xE46C8, 0x3C + + .global gUnknown_80E4704 +gUnknown_80E4704: @ 80E4704 + .incbin "baserom.gba", 0xE4704, 0x40 + + .global gUnknown_80E4744 +gUnknown_80E4744: @ 80E4744 + .incbin "baserom.gba", 0xE4744, 0x44 + + .global gUnknown_80E4788 +gUnknown_80E4788: @ 80E4788 + .incbin "baserom.gba", 0xE4788, 0x50 + + .global gUnknown_80E47D8 +gUnknown_80E47D8: @ 80E47D8 + .incbin "baserom.gba", 0xE47D8, 0x54 + + .global gUnknown_80E482C +gUnknown_80E482C: @ 80E482C + .incbin "baserom.gba", 0xE482C, 0x7C + + .global gUnknown_80E48A8 +gUnknown_80E48A8: @ 80E48A8 + .incbin "baserom.gba", 0xE48A8, 0x40 + + .global gUnknown_80E48E8 +gUnknown_80E48E8: @ 80E48E8 + .incbin "baserom.gba", 0xE48E8, 0x40 + + .global gUnknown_80E4928 +gUnknown_80E4928: @ 80E4928 + .incbin "baserom.gba", 0xE4928, 0x3C + + .global gUnknown_80E4964 +gUnknown_80E4964: @ 80E4964 + .incbin "baserom.gba", 0xE4964, 0x38 + + .global gUnknown_80E499C +gUnknown_80E499C: @ 80E499C + .incbin "baserom.gba", 0xE499C, 0x28 + + .global gUnknown_80E49C4 +gUnknown_80E49C4: @ 80E49C4 + .incbin "baserom.gba", 0xE49C4, 0x4C + + .global gUnknown_80E4A10 +gUnknown_80E4A10: @ 80E4A10 + .incbin "baserom.gba", 0xE4A10, 0x18 + + .global gUnknown_80E4A28 +gUnknown_80E4A28: @ 80E4A28 + .incbin "baserom.gba", 0xE4A28, 0x18 + + .global gUnknown_80E4A40 +gUnknown_80E4A40: @ 80E4A40 + .incbin "baserom.gba", 0xE4A40, 0xEDC + + .global gUnknown_80E591C +gUnknown_80E591C: @ 80E591C + .incbin "baserom.gba", 0xE591C, 0x74 + + .global gUnknown_80E5990 +gUnknown_80E5990: @ 80E5990 + .incbin "baserom.gba", 0xE5990, 0x18 + + .global gUnknown_80E59A8 +gUnknown_80E59A8: @ 80E59A8 + .incbin "baserom.gba", 0xE59A8, 0x20 + + .global gUnknown_80E59C8 +gUnknown_80E59C8: @ 80E59C8 + .incbin "baserom.gba", 0xE59C8, 0x18 + + .global gUnknown_80E59E0 +gUnknown_80E59E0: @ 80E59E0 + .incbin "baserom.gba", 0xE59E0, 0x18 + + .global gUnknown_80E59F8 +gUnknown_80E59F8: @ 80E59F8 + .incbin "baserom.gba", 0xE59F8, 0x68 + + .global gUnknown_80E5A60 +gUnknown_80E5A60: @ 80E5A60 + .incbin "baserom.gba", 0xE5A60, 0x18 + + .global gUnknown_80E5A78 +gUnknown_80E5A78: @ 80E5A78 + .incbin "baserom.gba", 0xE5A78, 0x18 + + .global gUnknown_80E5A90 +gUnknown_80E5A90: @ 80E5A90 + .incbin "baserom.gba", 0xE5A90, 0x6C + + .global gUnknown_80E5AFC +gUnknown_80E5AFC: @ 80E5AFC + .incbin "baserom.gba", 0xE5AFC, 0x38 + + .global gUnknown_80E5B34 +gUnknown_80E5B34: @ 80E5B34 + .incbin "baserom.gba", 0xE5B34, 0x18 + + .global gUnknown_80E5B4C +gUnknown_80E5B4C: @ 80E5B4C + .incbin "baserom.gba", 0xE5B4C, 0x40 + + .global gUnknown_80E5B8C +gUnknown_80E5B8C: @ 80E5B8C + .incbin "baserom.gba", 0xE5B8C, 0x38 + + .global gUnknown_80E5BC4 +gUnknown_80E5BC4: @ 80E5BC4 + .incbin "baserom.gba", 0xE5BC4, 0x18 + + .global gUnknown_80E5BDC +gUnknown_80E5BDC: @ 80E5BDC + .incbin "baserom.gba", 0xE5BDC, 0x3C + + .global gUnknown_80E5C18 +gUnknown_80E5C18: @ 80E5C18 + .incbin "baserom.gba", 0xE5C18, 0x9C + + .global gUnknown_80E5CB4 +gUnknown_80E5CB4: @ 80E5CB4 + .incbin "baserom.gba", 0xE5CB4, 0x18 + + .global gUnknown_80E5CCC +gUnknown_80E5CCC: @ 80E5CCC + .incbin "baserom.gba", 0xE5CCC, 0x40 + + .global gUnknown_80E5D0C +gUnknown_80E5D0C: @ 80E5D0C + .incbin "baserom.gba", 0xE5D0C, 0x3C + + .global gUnknown_80E5D48 +gUnknown_80E5D48: @ 80E5D48 + .incbin "baserom.gba", 0xE5D48, 0x58 + + .global gUnknown_80E5DA0 +gUnknown_80E5DA0: @ 80E5DA0 + .incbin "baserom.gba", 0xE5DA0, 0x50 + + .global gUnknown_80E5DF0 +gUnknown_80E5DF0: @ 80E5DF0 + .incbin "baserom.gba", 0xE5DF0, 0x6C + + .global gUnknown_80E5E5C +gUnknown_80E5E5C: @ 80E5E5C + .incbin "baserom.gba", 0xE5E5C, 0x60 + + .global gUnknown_80E5EBC +gUnknown_80E5EBC: @ 80E5EBC + .incbin "baserom.gba", 0xE5EBC, 0x60 + + .global gUnknown_80E5F1C +gUnknown_80E5F1C: @ 80E5F1C + .incbin "baserom.gba", 0xE5F1C, 0x64 + + .global gUnknown_80E5F80 +gUnknown_80E5F80: @ 80E5F80 + .incbin "baserom.gba", 0xE5F80, 0x4C + + .global gUnknown_80E5FCC +gUnknown_80E5FCC: @ 80E5FCC + .incbin "baserom.gba", 0xE5FCC, 0x64 + + .global gUnknown_80E6030 +gUnknown_80E6030: @ 80E6030 + .incbin "baserom.gba", 0xE6030, 0x70 + + .global gUnknown_80E60A0 +gUnknown_80E60A0: @ 80E60A0 + .incbin "baserom.gba", 0xE60A0, 0x34 + + .global gUnknown_80E60D4 +gUnknown_80E60D4: @ 80E60D4 + .incbin "baserom.gba", 0xE60D4, 0x18 + + .global gUnknown_80E60EC +gUnknown_80E60EC: @ 80E60EC + .incbin "baserom.gba", 0xE60EC, 0x18 + + .global gUnknown_80E6104 +gUnknown_80E6104: @ 80E6104 + .incbin "baserom.gba", 0xE6104, 0x50 + + .global gUnknown_80E6154 +gUnknown_80E6154: @ 80E6154 + .incbin "baserom.gba", 0xE6154, 0x20 + + .global gUnknown_80E6174 +gUnknown_80E6174: @ 80E6174 + .incbin "baserom.gba", 0xE6174, 0x18 + + .global gUnknown_80E618C +gUnknown_80E618C: @ 80E618C + .incbin "baserom.gba", 0xE618C, 0x18 + + .global gUnknown_80E61A4 +gUnknown_80E61A4: @ 80E61A4 + .incbin "baserom.gba", 0xE61A4, 0x1C + + .global gUnknown_80E61C0 +gUnknown_80E61C0: @ 80E61C0 + .incbin "baserom.gba", 0xE61C0, 0x24 + + .global gUnknown_80E61E4 +gUnknown_80E61E4: @ 80E61E4 + .incbin "baserom.gba", 0xE61E4, 0x30 + + .global gUnknown_80E6214 +gUnknown_80E6214: @ 80E6214 + .incbin "baserom.gba", 0xE6214, 0x54 + + .global gUnknown_80E6268 +gUnknown_80E6268: @ 80E6268 + .incbin "baserom.gba", 0xE6268, 0x5C + + .global gUnknown_80E62C4 +gUnknown_80E62C4: @ 80E62C4 + .incbin "baserom.gba", 0xE62C4, 0x50 + + .global gUnknown_80E6314 +gUnknown_80E6314: @ 80E6314 + .incbin "baserom.gba", 0xE6314, 0x44 + + .global gUnknown_80E6358 +gUnknown_80E6358: @ 80E6358 + .incbin "baserom.gba", 0xE6358, 0x20 + + .global gUnknown_80E6378 +gUnknown_80E6378: @ 80E6378 + .incbin "baserom.gba", 0xE6378, 0x24 + + .global gUnknown_80E639C +gUnknown_80E639C: @ 80E639C + .incbin "baserom.gba", 0xE639C, 0x5C + + .global gUnknown_80E63F8 +gUnknown_80E63F8: @ 80E63F8 + .incbin "baserom.gba", 0xE63F8, 0x50 + + .global gUnknown_80E6448 +gUnknown_80E6448: @ 80E6448 + .incbin "baserom.gba", 0xE6448, 0x64 + + .global gUnknown_80E64AC +gUnknown_80E64AC: @ 80E64AC + .incbin "baserom.gba", 0xE64AC, 0x7C + + .global gUnknown_80E6528 +gUnknown_80E6528: @ 80E6528 + .incbin "baserom.gba", 0xE6528, 0x14 + + .global gUnknown_80E653C +gUnknown_80E653C: @ 80E653C + .incbin "baserom.gba", 0xE653C, 0x18 + + .global gUnknown_80E6554 +gUnknown_80E6554: @ 80E6554 + .incbin "baserom.gba", 0xE6554, 0x18 + + .global gUnknown_80E656C +gUnknown_80E656C: @ 80E656C + .incbin "baserom.gba", 0xE656C, 0x6C + + .global gUnknown_80E65D8 +gUnknown_80E65D8: @ 80E65D8 + .incbin "baserom.gba", 0xE65D8, 0x44 + + .global gUnknown_80E661C +gUnknown_80E661C: @ 80E661C + .incbin "baserom.gba", 0xE661C, 0x40 + + .global gUnknown_80E665C +gUnknown_80E665C: @ 80E665C + .incbin "baserom.gba", 0xE665C, 0x20 + + .global gUnknown_80E667C +gUnknown_80E667C: @ 80E667C + .incbin "baserom.gba", 0xE667C, 0x40 + + .global gUnknown_80E66BC +gUnknown_80E66BC: @ 80E66BC + .incbin "baserom.gba", 0xE66BC, 0x18 + + .global gUnknown_80E66D4 +gUnknown_80E66D4: @ 80E66D4 + .incbin "baserom.gba", 0xE66D4, 0x74 + + .global gUnknown_80E6748 +gUnknown_80E6748: @ 80E6748 + .incbin "baserom.gba", 0xE6748, 0x18 + + .global gUnknown_80E6760 +gUnknown_80E6760: @ 80E6760 + .incbin "baserom.gba", 0xE6760, 0x74 + + .global gUnknown_80E67D4 +gUnknown_80E67D4: @ 80E67D4 + .incbin "baserom.gba", 0xE67D4, 0x18 + + .global gUnknown_80E67EC +gUnknown_80E67EC: @ 80E67EC + .incbin "baserom.gba", 0xE67EC, 0xB0 + + .global gUnknown_80E689C +gUnknown_80E689C: @ 80E689C + .incbin "baserom.gba", 0xE689C, 0x18 + + .global gUnknown_80E68B4 +gUnknown_80E68B4: @ 80E68B4 + .incbin "baserom.gba", 0xE68B4, 0x84 + + .global gUnknown_80E6938 +gUnknown_80E6938: @ 80E6938 + .incbin "baserom.gba", 0xE6938, 0x18 + + .global gUnknown_80E6950 +gUnknown_80E6950: @ 80E6950 + .incbin "baserom.gba", 0xE6950, 0x60 + + .global gUnknown_80E69B0 +gUnknown_80E69B0: @ 80E69B0 + .incbin "baserom.gba", 0xE69B0, 0x18 + + .global gUnknown_80E69C8 +gUnknown_80E69C8: @ 80E69C8 + .incbin "baserom.gba", 0xE69C8, 0x48 + + .global gUnknown_80E6A10 +gUnknown_80E6A10: @ 80E6A10 + .incbin "baserom.gba", 0xE6A10, 0x18 + + .global gUnknown_80E6A28 +gUnknown_80E6A28: @ 80E6A28 + .incbin "baserom.gba", 0xE6A28, 0x4C + + .global gUnknown_80E6A74 +gUnknown_80E6A74: @ 80E6A74 + .incbin "baserom.gba", 0xE6A74, 0x18 + + .global gUnknown_80E6A8C +gUnknown_80E6A8C: @ 80E6A8C + .incbin "baserom.gba", 0xE6A8C, 0xEC + + .global gUnknown_80E6B78 +gUnknown_80E6B78: @ 80E6B78 + .incbin "baserom.gba", 0xE6B78, 0x18 + + .global gUnknown_80E6B90 +gUnknown_80E6B90: @ 80E6B90 + .incbin "baserom.gba", 0xE6B90, 0x64 + + .global gUnknown_80E6BF4 +gUnknown_80E6BF4: @ 80E6BF4 + .incbin "baserom.gba", 0xE6BF4, 0x18 + + .global gUnknown_80E6C0C +gUnknown_80E6C0C: @ 80E6C0C + .incbin "baserom.gba", 0xE6C0C, 0x44 + + .global gUnknown_80E6C50 +gUnknown_80E6C50: @ 80E6C50 + .incbin "baserom.gba", 0xE6C50, 0x18 + + .global gUnknown_80E6C68 +gUnknown_80E6C68: @ 80E6C68 + .incbin "baserom.gba", 0xE6C68, 0x68 + + .global gUnknown_80E6CD0 +gUnknown_80E6CD0: @ 80E6CD0 + .incbin "baserom.gba", 0xE6CD0, 0x18 + + .global gUnknown_80E6CE8 +gUnknown_80E6CE8: @ 80E6CE8 + .incbin "baserom.gba", 0xE6CE8, 0x6C + + .global gUnknown_80E6D54 +gUnknown_80E6D54: @ 80E6D54 + .incbin "baserom.gba", 0xE6D54, 0x18 + + .global gUnknown_80E6D6C +gUnknown_80E6D6C: @ 80E6D6C + .incbin "baserom.gba", 0xE6D6C, 0x70 + + .global gUnknown_80E6DDC +gUnknown_80E6DDC: @ 80E6DDC + .incbin "baserom.gba", 0xE6DDC, 0x18 + + .global gUnknown_80E6DF4 +gUnknown_80E6DF4: @ 80E6DF4 + .incbin "baserom.gba", 0xE6DF4, 0x5C + + .global gUnknown_80E6E50 +gUnknown_80E6E50: @ 80E6E50 + .incbin "baserom.gba", 0xE6E50, 0x2C + + .global gUnknown_80E6E7C +gUnknown_80E6E7C: @ 80E6E7C + .incbin "baserom.gba", 0xE6E7C, 0x18 + + .global gUnknown_80E6E94 +gUnknown_80E6E94: @ 80E6E94 + .incbin "baserom.gba", 0xE6E94, 0x18 + + .global gUnknown_80E6EAC +gUnknown_80E6EAC: @ 80E6EAC + .incbin "baserom.gba", 0xE6EAC, 0x74 + + .global gUnknown_80E6F20 +gUnknown_80E6F20: @ 80E6F20 + .incbin "baserom.gba", 0xE6F20, 0x18 + + .global gUnknown_80E6F38 +gUnknown_80E6F38: @ 80E6F38 + .incbin "baserom.gba", 0xE6F38, 0x18 + + .global gUnknown_80E6F50 +gUnknown_80E6F50: @ 80E6F50 + .incbin "baserom.gba", 0xE6F50, 0x6C + + .global gUnknown_80E6FBC +gUnknown_80E6FBC: @ 80E6FBC + .incbin "baserom.gba", 0xE6FBC, 0x60 + + .global gUnknown_80E701C +gUnknown_80E701C: @ 80E701C + .incbin "baserom.gba", 0xE701C, 0x74 + + .global gUnknown_80E7090 +gUnknown_80E7090: @ 80E7090 + .incbin "baserom.gba", 0xE7090, 0x3C + + .global gUnknown_80E70CC +gUnknown_80E70CC: @ 80E70CC + .incbin "baserom.gba", 0xE70CC, 0x48 + + .global gUnknown_80E7114 +gUnknown_80E7114: @ 80E7114 + .incbin "baserom.gba", 0xE7114, 0x64 + + .global gUnknown_80E7178 +gUnknown_80E7178: @ 80E7178 + .incbin "baserom.gba", 0xE7178, 0x6C + + .global gUnknown_80E71E4 +gUnknown_80E71E4: @ 80E71E4 + .incbin "baserom.gba", 0xE71E4, 0x18 + + .global gUnknown_80E71FC +gUnknown_80E71FC: @ 80E71FC + .incbin "baserom.gba", 0xE71FC, 0x18 + + .global gUnknown_80E7214 +gUnknown_80E7214: @ 80E7214 + .incbin "baserom.gba", 0xE7214, 0x64 + + .global gUnknown_80E7278 +gUnknown_80E7278: @ 80E7278 + .incbin "baserom.gba", 0xE7278, 0x18 + + .global gUnknown_80E7290 +gUnknown_80E7290: @ 80E7290 + .incbin "baserom.gba", 0xE7290, 0x5C + + .global gUnknown_80E72EC +gUnknown_80E72EC: @ 80E72EC + .incbin "baserom.gba", 0xE72EC, 0x18 + + .global gUnknown_80E7304 +gUnknown_80E7304: @ 80E7304 + .incbin "baserom.gba", 0xE7304, 0x40 + + .global gUnknown_80E7344 +gUnknown_80E7344: @ 80E7344 + .incbin "baserom.gba", 0xE7344, 0x18 + + .global gUnknown_80E735C +gUnknown_80E735C: @ 80E735C + .incbin "baserom.gba", 0xE735C, 0x50 + + .global gUnknown_80E73AC +gUnknown_80E73AC: @ 80E73AC + .incbin "baserom.gba", 0xE73AC, 0x18 + + .global gUnknown_80E73C4 +gUnknown_80E73C4: @ 80E73C4 + .incbin "baserom.gba", 0xE73C4, 0x44 + + .global gUnknown_80E7408 +gUnknown_80E7408: @ 80E7408 + .incbin "baserom.gba", 0xE7408, 0x18 + + .global gUnknown_80E7420 +gUnknown_80E7420: @ 80E7420 + .incbin "baserom.gba", 0xE7420, 0x48 + + .global gUnknown_80E7468 +gUnknown_80E7468: @ 80E7468 + .incbin "baserom.gba", 0xE7468, 0x18 + + .global gUnknown_80E7480 +gUnknown_80E7480: @ 80E7480 + .incbin "baserom.gba", 0xE7480, 0x48 + + .global gUnknown_80E74C8 +gUnknown_80E74C8: @ 80E74C8 + .incbin "baserom.gba", 0xE74C8, 0x18 + + .global gUnknown_80E74E0 +gUnknown_80E74E0: @ 80E74E0 + .incbin "baserom.gba", 0xE74E0, 0x4C + + .global gUnknown_80E752C +gUnknown_80E752C: @ 80E752C + .incbin "baserom.gba", 0xE752C, 0x18 + + .global gUnknown_80E7544 +gUnknown_80E7544: @ 80E7544 + .incbin "baserom.gba", 0xE7544, 0x44 + + .global gUnknown_80E7588 +gUnknown_80E7588: @ 80E7588 + .incbin "baserom.gba", 0xE7588, 0x18 + + .global gUnknown_80E75A0 +gUnknown_80E75A0: @ 80E75A0 + .incbin "baserom.gba", 0xE75A0, 0x58 + + .global gUnknown_80E75F8 +gUnknown_80E75F8: @ 80E75F8 + .incbin "baserom.gba", 0xE75F8, 0x18 + + .global gUnknown_80E7610 +gUnknown_80E7610: @ 80E7610 + .incbin "baserom.gba", 0xE7610, 0x1C + + .global gUnknown_80E762C +gUnknown_80E762C: @ 80E762C + .incbin "baserom.gba", 0xE762C, 0x18 + + .global gUnknown_80E7644 +gUnknown_80E7644: @ 80E7644 + .incbin "baserom.gba", 0xE7644, 0x40 + + .global gUnknown_80E7684 +gUnknown_80E7684: @ 80E7684 + .incbin "baserom.gba", 0xE7684, 0x34 + + .global gUnknown_80E76B8 +gUnknown_80E76B8: @ 80E76B8 + .incbin "baserom.gba", 0xE76B8, 0x30 + + .global gUnknown_80E76E8 +gUnknown_80E76E8: @ 80E76E8 + .incbin "baserom.gba", 0xE76E8, 0x48 + + .global gUnknown_80E7730 +gUnknown_80E7730: @ 80E7730 + .incbin "baserom.gba", 0xE7730, 0x54 + + .global gUnknown_80E7784 +gUnknown_80E7784: @ 80E7784 + .incbin "baserom.gba", 0xE7784, 0x18 + + .global gUnknown_80E779C +gUnknown_80E779C: @ 80E779C + .incbin "baserom.gba", 0xE779C, 0x20 + + .global gUnknown_80E77BC +gUnknown_80E77BC: @ 80E77BC + .incbin "baserom.gba", 0xE77BC, 0x8 + + .global gUnknown_80E77C4 +gUnknown_80E77C4: @ 80E77C4 + .incbin "baserom.gba", 0xE77C4, 0x8 + + .global gUnknown_80E77CC +gUnknown_80E77CC: @ 80E77CC + .incbin "baserom.gba", 0xE77CC, 0xC + + .global gUnknown_80E77D8 +gUnknown_80E77D8: @ 80E77D8 + .incbin "baserom.gba", 0xE77D8, 0xC + + .global gUnknown_80E77E4 +gUnknown_80E77E4: @ 80E77E4 + .incbin "baserom.gba", 0xE77E4, 0xC + + .global gUnknown_80E77F0 +gUnknown_80E77F0: @ 80E77F0 + .incbin "baserom.gba", 0xE77F0, 0x8 + + .global gUnknown_80E77F8 +gUnknown_80E77F8: @ 80E77F8 + .incbin "baserom.gba", 0xE77F8, 0xC + + .global gUnknown_80E7804 +gUnknown_80E7804: @ 80E7804 + .incbin "baserom.gba", 0xE7804, 0x4 + + .global gUnknown_80E7808 +gUnknown_80E7808: @ 80E7808 + .incbin "baserom.gba", 0xE7808, 0x4 + + .global gUnknown_80E780C +gUnknown_80E780C: @ 80E780C + .incbin "baserom.gba", 0xE780C, 0x18 + + .global gUnknown_80E7824 +gUnknown_80E7824: @ 80E7824 + .incbin "baserom.gba", 0xE7824, 0x14 + + .global gUnknown_80E7838 +gUnknown_80E7838: @ 80E7838 + .incbin "baserom.gba", 0xE7838, 0x10 + + .global gUnknown_80E7848 +gUnknown_80E7848: @ 80E7848 + .incbin "baserom.gba", 0xE7848, 0x4 + + .global gUnknown_80E784C +gUnknown_80E784C: @ 80E784C + .incbin "baserom.gba", 0xE784C, 0x8 + + .global gUnknown_80E7854 +gUnknown_80E7854: @ 80E7854 + .incbin "baserom.gba", 0xE7854, 0x8 + + .global gUnknown_80E785C +gUnknown_80E785C: @ 80E785C + .incbin "baserom.gba", 0xE785C, 0x10 + + .global gUnknown_80E786C +gUnknown_80E786C: @ 80E786C + .incbin "baserom.gba", 0xE786C, 0x28 + + .global gUnknown_80E7894 +gUnknown_80E7894: @ 80E7894 + .incbin "baserom.gba", 0xE7894, 0x44 + + .global gUnknown_80E78D8 +gUnknown_80E78D8: @ 80E78D8 + .incbin "baserom.gba", 0xE78D8, 0x20 + + .global gUnknown_80E78F8 +gUnknown_80E78F8: @ 80E78F8 + .incbin "baserom.gba", 0xE78F8, 0x1C + + .global gUnknown_80E7914 +gUnknown_80E7914: @ 80E7914 + .incbin "baserom.gba", 0xE7914, 0x24 + + .global gUnknown_80E7938 +gUnknown_80E7938: @ 80E7938 + .incbin "baserom.gba", 0xE7938, 0x5C + + .global gUnknown_80E7994 +gUnknown_80E7994: @ 80E7994 + .incbin "baserom.gba", 0xE7994, 0x50 + + .global gUnknown_80E79E4 +gUnknown_80E79E4: @ 80E79E4 + .incbin "baserom.gba", 0xE79E4, 0x64 + + .global gUnknown_80E7A48 +gUnknown_80E7A48: @ 80E7A48 + .incbin "baserom.gba", 0xE7A48, 0x7C + + .global gUnknown_80E7AC4 +gUnknown_80E7AC4: @ 80E7AC4 + .incbin "baserom.gba", 0xE7AC4, 0x1C + + .global gUnknown_80E7AE0 +gUnknown_80E7AE0: @ 80E7AE0 + .incbin "baserom.gba", 0xE7AE0, 0x34 + + .global gUnknown_80E7B14 +gUnknown_80E7B14: @ 80E7B14 + .incbin "baserom.gba", 0xE7B14, 0x34 + + .global gUnknown_80E7B48 +gUnknown_80E7B48: @ 80E7B48 + .incbin "baserom.gba", 0xE7B48, 0x20 + + .global gUnknown_80E7B68 +gUnknown_80E7B68: @ 80E7B68 + .incbin "baserom.gba", 0xE7B68, 0x20 + + .global gUnknown_80E7B88 +gUnknown_80E7B88: @ 80E7B88 + .incbin "baserom.gba", 0xE7B88, 0x40 + + .global gUnknown_80E7BC8 +gUnknown_80E7BC8: @ 80E7BC8 + .incbin "baserom.gba", 0xE7BC8, 0x24 + + .global gUnknown_80E7BEC +gUnknown_80E7BEC: @ 80E7BEC + .incbin "baserom.gba", 0xE7BEC, 0x5C + + .global gUnknown_80E7C48 +gUnknown_80E7C48: @ 80E7C48 + .incbin "baserom.gba", 0xE7C48, 0x50 + + .global gUnknown_80E7C98 +gUnknown_80E7C98: @ 80E7C98 + .incbin "baserom.gba", 0xE7C98, 0x2C + + .global gUnknown_80E7CC4 +gUnknown_80E7CC4: @ 80E7CC4 + .incbin "baserom.gba", 0xE7CC4, 0x7C + + .global gUnknown_80E7D40 +gUnknown_80E7D40: @ 80E7D40 + .incbin "baserom.gba", 0xE7D40, 0x18 + + .global gUnknown_80E7D58 +gUnknown_80E7D58: @ 80E7D58 + .incbin "baserom.gba", 0xE7D58, 0x18 + + .global gUnknown_80E7D70 +gUnknown_80E7D70: @ 80E7D70 + .incbin "baserom.gba", 0xE7D70, 0xC4 + + .global gUnknown_80E7E34 +gUnknown_80E7E34: @ 80E7E34 + .incbin "baserom.gba", 0xE7E34, 0x18 + + .global gUnknown_80E7E4C +gUnknown_80E7E4C: @ 80E7E4C + .incbin "baserom.gba", 0xE7E4C, 0x18 + + .global gUnknown_80E7E64 +gUnknown_80E7E64: @ 80E7E64 + .incbin "baserom.gba", 0xE7E64, 0x18 + + .global gUnknown_80E7E7C +gUnknown_80E7E7C: @ 80E7E7C + .incbin "baserom.gba", 0xE7E7C, 0x10 + + .global gUnknown_80E7E8C +gUnknown_80E7E8C: @ 80E7E8C + .incbin "baserom.gba", 0xE7E8C, 0x18 + + .global gUnknown_80E7EA4 +gUnknown_80E7EA4: @ 80E7EA4 + .incbin "baserom.gba", 0xE7EA4, 0x18 + + .global gUnknown_80E7EBC +gUnknown_80E7EBC: @ 80E7EBC + .incbin "baserom.gba", 0xE7EBC, 0x8 + + .global gUnknown_80E7EC4 +gUnknown_80E7EC4: @ 80E7EC4 + .incbin "baserom.gba", 0xE7EC4, 0x10 + + .global gUnknown_80E7ED4 +gUnknown_80E7ED4: @ 80E7ED4 + .incbin "baserom.gba", 0xE7ED4, 0x18 + + .global gUnknown_80E7EEC +gUnknown_80E7EEC: @ 80E7EEC + .incbin "baserom.gba", 0xE7EEC, 0x18 + + .global gUnknown_80E7F04 +gUnknown_80E7F04: @ 80E7F04 + .incbin "baserom.gba", 0xE7F04, 0x18 + + .global gUnknown_80E7F1C +gUnknown_80E7F1C: @ 80E7F1C + .incbin "baserom.gba", 0xE7F1C, 0x8 + + .global gUnknown_80E7F24 +gUnknown_80E7F24: @ 80E7F24 + .incbin "baserom.gba", 0xE7F24, 0x8 + + .global gUnknown_80E7F2C +gUnknown_80E7F2C: @ 80E7F2C + .incbin "baserom.gba", 0xE7F2C, 0x10 + + .global gUnknown_80E7F3C +gUnknown_80E7F3C: @ 80E7F3C + .incbin "baserom.gba", 0xE7F3C, 0x18 + + .global gUnknown_80E7F54 +gUnknown_80E7F54: @ 80E7F54 + .incbin "baserom.gba", 0xE7F54, 0x18 + + .global gUnknown_80E7F6C +gUnknown_80E7F6C: @ 80E7F6C + .incbin "baserom.gba", 0xE7F6C, 0x28 + + .global gUnknown_80E7F94 +gUnknown_80E7F94: @ 80E7F94 + .incbin "baserom.gba", 0xE7F94, 0x10C + + .global gUnknown_80E80A0 +gUnknown_80E80A0: @ 80E80A0 + .incbin "baserom.gba", 0xE80A0, 0x40 + + .global gUnknown_80E80E0 +gUnknown_80E80E0: @ 80E80E0 + .incbin "baserom.gba", 0xE80E0, 0x46 + + .global gUnknown_80E8126 +gUnknown_80E8126: @ 80E8126 + .incbin "baserom.gba", 0xE8126, 0x42 + + .global gUnknown_80E8168 +gUnknown_80E8168: @ 80E8168 + .incbin "baserom.gba", 0xE8168, 0x18 + + .global gUnknown_80E8180 +gUnknown_80E8180: @ 80E8180 + .incbin "baserom.gba", 0xE8180, 0x54 + + .global gUnknown_80E81D4 +gUnknown_80E81D4: @ 80E81D4 + .incbin "baserom.gba", 0xE81D4, 0x608 + + .global gUnknown_80E87DC +gUnknown_80E87DC: @ 80E87DC + .incbin "baserom.gba", 0xE87DC, 0x18 + + .global gUnknown_80E87F4 +gUnknown_80E87F4: @ 80E87F4 + .incbin "baserom.gba", 0xE87F4, 0x24 + + .global gUnknown_80E8818 +gUnknown_80E8818: @ 80E8818 + .incbin "baserom.gba", 0xE8818, 0x18 + + .global gUnknown_80E8830 +gUnknown_80E8830: @ 80E8830 + .incbin "baserom.gba", 0xE8830, 0x18 + + .global gUnknown_80E8848 +gUnknown_80E8848: @ 80E8848 + .incbin "baserom.gba", 0xE8848, 0x14 + + .global gUnknown_80E885C +gUnknown_80E885C: @ 80E885C + .incbin "baserom.gba", 0xE885C, 0x10 + + .global gUnknown_80E886C +gUnknown_80E886C: @ 80E886C + .incbin "baserom.gba", 0xE886C, 0x18 + + .global gUnknown_80E8884 +gUnknown_80E8884: @ 80E8884 + .incbin "baserom.gba", 0xE8884, 0x8 + + .global gUnknown_80E888C +gUnknown_80E888C: @ 80E888C + .incbin "baserom.gba", 0xE888C, 0x14 + + .global gUnknown_80E88A0 +gUnknown_80E88A0: @ 80E88A0 + .incbin "baserom.gba", 0xE88A0, 0x28 + + .global gUnknown_80E88C8 +gUnknown_80E88C8: @ 80E88C8 + .incbin "baserom.gba", 0xE88C8, 0x58 + + .global gUnknown_80E8920 +gUnknown_80E8920: @ 80E8920 + .incbin "baserom.gba", 0xE8920, 0x48 + + .global gUnknown_80E8968 +gUnknown_80E8968: @ 80E8968 + .incbin "baserom.gba", 0xE8968, 0x48 + + .global gUnknown_80E89B0 +gUnknown_80E89B0: @ 80E89B0 + .incbin "baserom.gba", 0xE89B0, 0x4C + + .global gUnknown_80E89FC +gUnknown_80E89FC: @ 80E89FC + .incbin "baserom.gba", 0xE89FC, 0x44 + + .global gUnknown_80E8A40 +gUnknown_80E8A40: @ 80E8A40 + .incbin "baserom.gba", 0xE8A40, 0x3C + + .global gUnknown_80E8A7C +gUnknown_80E8A7C: @ 80E8A7C + .incbin "baserom.gba", 0xE8A7C, 0x4C + + .global gUnknown_80E8AC8 +gUnknown_80E8AC8: @ 80E8AC8 + .incbin "baserom.gba", 0xE8AC8, 0x8 + + .global gUnknown_80E8AD0 +gUnknown_80E8AD0: @ 80E8AD0 + .incbin "baserom.gba", 0xE8AD0, 0x10 + + .global gUnknown_80E8AE0 +gUnknown_80E8AE0: @ 80E8AE0 + .incbin "baserom.gba", 0xE8AE0, 0xC + + .global gUnknown_80E8AEC +gUnknown_80E8AEC: @ 80E8AEC + .incbin "baserom.gba", 0xE8AEC, 0x10 + + .global gUnknown_80E8AFC +gUnknown_80E8AFC: @ 80E8AFC + .incbin "baserom.gba", 0xE8AFC, 0x14 + + .global gUnknown_80E8B10 +gUnknown_80E8B10: @ 80E8B10 + .incbin "baserom.gba", 0xE8B10, 0x10 + + .global gUnknown_80E8B20 +gUnknown_80E8B20: @ 80E8B20 + .incbin "baserom.gba", 0xE8B20, 0xC + + .global gUnknown_80E8B2C +gUnknown_80E8B2C: @ 80E8B2C + .incbin "baserom.gba", 0xE8B2C, 0x14 + + .global gUnknown_80E8B40 +gUnknown_80E8B40: @ 80E8B40 + .incbin "baserom.gba", 0xE8B40, 0x10 + + .global gUnknown_80E8B50 +gUnknown_80E8B50: @ 80E8B50 + .incbin "baserom.gba", 0xE8B50, 0x10 + + .global gUnknown_80E8B60 +gUnknown_80E8B60: @ 80E8B60 + .incbin "baserom.gba", 0xE8B60, 0x8 + + .global gUnknown_80E8B68 +gUnknown_80E8B68: @ 80E8B68 + .incbin "baserom.gba", 0xE8B68, 0xC + + .global gUnknown_80E8B74 +gUnknown_80E8B74: @ 80E8B74 + .incbin "baserom.gba", 0xE8B74, 0x8 + + .global gUnknown_80E8B7C +gUnknown_80E8B7C: @ 80E8B7C + .incbin "baserom.gba", 0xE8B7C, 0x18 + + .global gUnknown_80E8B94 +gUnknown_80E8B94: @ 80E8B94 + .incbin "baserom.gba", 0xE8B94, 0x38 + + .global gUnknown_80E8BCC +gUnknown_80E8BCC: @ 80E8BCC + .incbin "baserom.gba", 0xE8BCC, 0x2C + + .global gUnknown_80E8BF8 +gUnknown_80E8BF8: @ 80E8BF8 + .incbin "baserom.gba", 0xE8BF8, 0x50 + + .global gUnknown_80E8C48 +gUnknown_80E8C48: @ 80E8C48 + .incbin "baserom.gba", 0xE8C48, 0x50 + + .global gUnknown_80E8C98 +gUnknown_80E8C98: @ 80E8C98 + .incbin "baserom.gba", 0xE8C98, 0x14C + + .global gUnknown_80E8DE4 +gUnknown_80E8DE4: @ 80E8DE4 + .incbin "baserom.gba", 0xE8DE4, 0x1CC + + .global gUnknown_80E8FB0 +gUnknown_80E8FB0: @ 80E8FB0 + .incbin "baserom.gba", 0xE8FB0, 0x15C + + .global gUnknown_80E910C +gUnknown_80E910C: @ 80E910C + .incbin "baserom.gba", 0xE910C, 0xC8 + + .global gUnknown_80E91D4 +gUnknown_80E91D4: @ 80E91D4 + .incbin "baserom.gba", 0xE91D4, 0x64C + + .global gUnknown_80E9820 +gUnknown_80E9820: @ 80E9820 + .incbin "baserom.gba", 0xE9820, 0x100 + + .global gUnknown_80E9920 +gUnknown_80E9920: @ 80E9920 + .incbin "baserom.gba", 0xE9920, 0x66C + + .global gUnknown_80E9F8C +gUnknown_80E9F8C: @ 80E9F8C + .incbin "baserom.gba", 0xE9F8C, 0xED0 + + .global gUnknown_80EAE5C +gUnknown_80EAE5C: @ 80EAE5C + .incbin "baserom.gba", 0xEAE5C, 0x5C + + .global gUnknown_80EAEB8 +gUnknown_80EAEB8: @ 80EAEB8 + .incbin "baserom.gba", 0xEAEB8, 0x2E0 + + .global gUnknown_80EB198 +gUnknown_80EB198: @ 80EB198 + .incbin "baserom.gba", 0xEB198, 0x88 + + .global gUnknown_80EB220 +gUnknown_80EB220: @ 80EB220 + .incbin "baserom.gba", 0xEB220, 0xD0 + + .global gUnknown_80EB2F0 +gUnknown_80EB2F0: @ 80EB2F0 + .incbin "baserom.gba", 0xEB2F0, 0x108 + + .global gUnknown_80EB3F8 +gUnknown_80EB3F8: @ 80EB3F8 + .incbin "baserom.gba", 0xEB3F8, 0x334 + + .global gUnknown_80EB72C +gUnknown_80EB72C: @ 80EB72C + .incbin "baserom.gba", 0xEB72C, 0x2EC + + .global gUnknown_80EBA18 +gUnknown_80EBA18: @ 80EBA18 + .incbin "baserom.gba", 0xEBA18, 0x6C0C + + .global gUnknown_80F2624 +gUnknown_80F2624: @ 80F2624 + .incbin "baserom.gba", 0xF2624, 0xE0 + + .global gUnknown_80F2704 +gUnknown_80F2704: @ 80F2704 + .incbin "baserom.gba", 0xF2704, 0x38 + + .global gUnknown_80F273C +gUnknown_80F273C: @ 80F273C + .incbin "baserom.gba", 0xF273C, 0x20 + + .global gUnknown_80F275C +gUnknown_80F275C: @ 80F275C + .incbin "baserom.gba", 0xF275C, 0x32 + + .global gUnknown_80F278E +gUnknown_80F278E: @ 80F278E + .incbin "baserom.gba", 0xF278E, 0x36 + + .global gUnknown_80F27C4 +gUnknown_80F27C4: @ 80F27C4 + .incbin "baserom.gba", 0xF27C4, 0x18 + + .global gUnknown_80F27DC +gUnknown_80F27DC: @ 80F27DC + .incbin "baserom.gba", 0xF27DC, 0x90 + + .global gUnknown_80F286C +gUnknown_80F286C: @ 80F286C + .incbin "baserom.gba", 0xF286C, 0x2C + + .global gUnknown_80F2898 +gUnknown_80F2898: @ 80F2898 + .incbin "baserom.gba", 0xF2898, 0x5C + + .global gUnknown_80F28F4 +gUnknown_80F28F4: @ 80F28F4 + .incbin "baserom.gba", 0xF28F4, 0x1950 + + .global gUnknown_80F4244 +gUnknown_80F4244: @ 80F4244 + .incbin "baserom.gba", 0xF4244, 0x20 + + .global gUnknown_80F4264 +gUnknown_80F4264: @ 80F4264 + .incbin "baserom.gba", 0xF4264, 0x14 + + .global gUnknown_80F4278 +gUnknown_80F4278: @ 80F4278 + .incbin "baserom.gba", 0xF4278, 0x18 + + .global gUnknown_80F4290 +gUnknown_80F4290: @ 80F4290 + .incbin "baserom.gba", 0xF4290, 0x18 + + .global gUnknown_80F42A8 +gUnknown_80F42A8: @ 80F42A8 + .incbin "baserom.gba", 0xF42A8, 0x18 + + .global gUnknown_80F42C0 +gUnknown_80F42C0: @ 80F42C0 + .incbin "baserom.gba", 0xF42C0, 0x10 + + .global gUnknown_80F42D0 +gUnknown_80F42D0: @ 80F42D0 + .incbin "baserom.gba", 0xF42D0, 0x20 + + .global gUnknown_80F42F0 +gUnknown_80F42F0: @ 80F42F0 + .incbin "baserom.gba", 0xF42F0, 0x100 + + .global gUnknown_80F43F0 +gUnknown_80F43F0: @ 80F43F0 + .incbin "baserom.gba", 0xF43F0, 0x36 + + .global gUnknown_80F4426 +gUnknown_80F4426: @ 80F4426 + .incbin "baserom.gba", 0xF4426, 0x22 + + .global gUnknown_80F4448 +gUnknown_80F4448: @ 80F4448 + .incbin "baserom.gba", 0xF4448, 0x20 + + .global gUnknown_80F4468 +gUnknown_80F4468: @ 80F4468 + .incbin "baserom.gba", 0xF4468, 0x130 + + .global gUnknown_80F4598 +gUnknown_80F4598: @ 80F4598 + .incbin "baserom.gba", 0xF4598, 0x72C + + .global gUnknown_80F4CC4 +gUnknown_80F4CC4: @ 80F4CC4 + .incbin "baserom.gba", 0xF4CC4, 0x40 + + .global gUnknown_80F4D04 +gUnknown_80F4D04: @ 80F4D04 + .incbin "baserom.gba", 0xF4D04, 0x40 + + .global gUnknown_80F4D44 +gUnknown_80F4D44: @ 80F4D44 + .incbin "baserom.gba", 0xF4D44, 0x20 + + .global gUnknown_80F4D64 +gUnknown_80F4D64: @ 80F4D64 + .incbin "baserom.gba", 0xF4D64, 0x28 + + .global gUnknown_80F4D8C +gUnknown_80F4D8C: @ 80F4D8C + .incbin "baserom.gba", 0xF4D8C, 0x14 + + .global gUnknown_80F4DA0 +gUnknown_80F4DA0: @ 80F4DA0 + .incbin "baserom.gba", 0xF4DA0, 0x2 + + .global gUnknown_80F4DA2 +gUnknown_80F4DA2: @ 80F4DA2 + .incbin "baserom.gba", 0xF4DA2, 0x2 + + .global gUnknown_80F4DA4 +gUnknown_80F4DA4: @ 80F4DA4 + .incbin "baserom.gba", 0xF4DA4, 0x2 + + .global gUnknown_80F4DA6 +gUnknown_80F4DA6: @ 80F4DA6 + .incbin "baserom.gba", 0xF4DA6, 0x2 + + .global gUnknown_80F4DA8 +gUnknown_80F4DA8: @ 80F4DA8 + .incbin "baserom.gba", 0xF4DA8, 0x2 + + .global gUnknown_80F4DAA +gUnknown_80F4DAA: @ 80F4DAA + .incbin "baserom.gba", 0xF4DAA, 0x2 + + .global gUnknown_80F4DAC +gUnknown_80F4DAC: @ 80F4DAC + .incbin "baserom.gba", 0xF4DAC, 0x2 + + .global gUnknown_80F4DAE +gUnknown_80F4DAE: @ 80F4DAE + .incbin "baserom.gba", 0xF4DAE, 0x2 + + .global gUnknown_80F4DB0 +gUnknown_80F4DB0: @ 80F4DB0 + .incbin "baserom.gba", 0xF4DB0, 0x2 + + .global gUnknown_80F4DB2 +gUnknown_80F4DB2: @ 80F4DB2 + .incbin "baserom.gba", 0xF4DB2, 0x2 + + .global gUnknown_80F4DB4 +gUnknown_80F4DB4: @ 80F4DB4 + .incbin "baserom.gba", 0xF4DB4, 0x2 + + .global gUnknown_80F4DB6 +gUnknown_80F4DB6: @ 80F4DB6 + .incbin "baserom.gba", 0xF4DB6, 0x2 + + .global gUnknown_80F4DB8 +gUnknown_80F4DB8: @ 80F4DB8 + .incbin "baserom.gba", 0xF4DB8, 0x2 + + .global gUnknown_80F4DBA +gUnknown_80F4DBA: @ 80F4DBA + .incbin "baserom.gba", 0xF4DBA, 0x2 + + .global gUnknown_80F4DBC +gUnknown_80F4DBC: @ 80F4DBC + .incbin "baserom.gba", 0xF4DBC, 0x2 + + .global gUnknown_80F4DBE +gUnknown_80F4DBE: @ 80F4DBE + .incbin "baserom.gba", 0xF4DBE, 0x2 + + .global gUnknown_80F4DC0 +gUnknown_80F4DC0: @ 80F4DC0 + .incbin "baserom.gba", 0xF4DC0, 0x2 + + .global gUnknown_80F4DC2 +gUnknown_80F4DC2: @ 80F4DC2 + .incbin "baserom.gba", 0xF4DC2, 0x2 + + .global gUnknown_80F4DC4 +gUnknown_80F4DC4: @ 80F4DC4 + .incbin "baserom.gba", 0xF4DC4, 0x2 + + .global gUnknown_80F4DC6 +gUnknown_80F4DC6: @ 80F4DC6 + .incbin "baserom.gba", 0xF4DC6, 0x2 + + .global gUnknown_80F4DC8 +gUnknown_80F4DC8: @ 80F4DC8 + .incbin "baserom.gba", 0xF4DC8, 0x2 + + .global gUnknown_80F4DCA +gUnknown_80F4DCA: @ 80F4DCA + .incbin "baserom.gba", 0xF4DCA, 0x2 + + .global gUnknown_80F4DCC +gUnknown_80F4DCC: @ 80F4DCC + .incbin "baserom.gba", 0xF4DCC, 0x2 + + .global gUnknown_80F4DCE +gUnknown_80F4DCE: @ 80F4DCE + .incbin "baserom.gba", 0xF4DCE, 0x2 + + .global gUnknown_80F4DD0 +gUnknown_80F4DD0: @ 80F4DD0 + .incbin "baserom.gba", 0xF4DD0, 0x2 + + .global gUnknown_80F4DD2 +gUnknown_80F4DD2: @ 80F4DD2 + .incbin "baserom.gba", 0xF4DD2, 0x2 + + .global gUnknown_80F4DD4 +gUnknown_80F4DD4: @ 80F4DD4 + .incbin "baserom.gba", 0xF4DD4, 0x2 + + .global gUnknown_80F4DD6 +gUnknown_80F4DD6: @ 80F4DD6 + .incbin "baserom.gba", 0xF4DD6, 0x2 + + .global gUnknown_80F4DD8 +gUnknown_80F4DD8: @ 80F4DD8 + .incbin "baserom.gba", 0xF4DD8, 0x2 + + .global gUnknown_80F4DDA +gUnknown_80F4DDA: @ 80F4DDA + .incbin "baserom.gba", 0xF4DDA, 0x2 + + .global gUnknown_80F4DDC +gUnknown_80F4DDC: @ 80F4DDC + .incbin "baserom.gba", 0xF4DDC, 0x4 + + .global gUnknown_80F4DE0 +gUnknown_80F4DE0: @ 80F4DE0 + .incbin "baserom.gba", 0xF4DE0, 0x2 + + .global gUnknown_80F4DE2 +gUnknown_80F4DE2: @ 80F4DE2 + .incbin "baserom.gba", 0xF4DE2, 0x2 + + .global gUnknown_80F4DE4 +gUnknown_80F4DE4: @ 80F4DE4 + .incbin "baserom.gba", 0xF4DE4, 0x2 + + .global gUnknown_80F4DE6 +gUnknown_80F4DE6: @ 80F4DE6 + .incbin "baserom.gba", 0xF4DE6, 0x2 + + .global gUnknown_80F4DE8 +gUnknown_80F4DE8: @ 80F4DE8 + .incbin "baserom.gba", 0xF4DE8, 0x2 + + .global gUnknown_80F4DEA +gUnknown_80F4DEA: @ 80F4DEA + .incbin "baserom.gba", 0xF4DEA, 0x2 + + .global gUnknown_80F4DEC +gUnknown_80F4DEC: @ 80F4DEC + .incbin "baserom.gba", 0xF4DEC, 0x2 + + .global gUnknown_80F4DEE +gUnknown_80F4DEE: @ 80F4DEE + .incbin "baserom.gba", 0xF4DEE, 0x2 + + .global gUnknown_80F4DF0 +gUnknown_80F4DF0: @ 80F4DF0 + .incbin "baserom.gba", 0xF4DF0, 0x2 + + .global gUnknown_80F4DF2 +gUnknown_80F4DF2: @ 80F4DF2 + .incbin "baserom.gba", 0xF4DF2, 0x2 + + .global gUnknown_80F4DF4 +gUnknown_80F4DF4: @ 80F4DF4 + .incbin "baserom.gba", 0xF4DF4, 0x2 + + .global gUnknown_80F4DF6 +gUnknown_80F4DF6: @ 80F4DF6 + .incbin "baserom.gba", 0xF4DF6, 0x2 + + .global gUnknown_80F4DF8 +gUnknown_80F4DF8: @ 80F4DF8 + .incbin "baserom.gba", 0xF4DF8, 0x2 + + .global gUnknown_80F4DFA +gUnknown_80F4DFA: @ 80F4DFA + .incbin "baserom.gba", 0xF4DFA, 0x2 + + .global gUnknown_80F4DFC +gUnknown_80F4DFC: @ 80F4DFC + .incbin "baserom.gba", 0xF4DFC, 0x2 + + .global gUnknown_80F4DFE +gUnknown_80F4DFE: @ 80F4DFE + .incbin "baserom.gba", 0xF4DFE, 0x2 + + .global gUnknown_80F4E00 +gUnknown_80F4E00: @ 80F4E00 + .incbin "baserom.gba", 0xF4E00, 0x2 + + .global gUnknown_80F4E02 +gUnknown_80F4E02: @ 80F4E02 + .incbin "baserom.gba", 0xF4E02, 0x2 + + .global gUnknown_80F4E04 +gUnknown_80F4E04: @ 80F4E04 + .incbin "baserom.gba", 0xF4E04, 0x2 + + .global gUnknown_80F4E06 +gUnknown_80F4E06: @ 80F4E06 + .incbin "baserom.gba", 0xF4E06, 0x2 + + .global gUnknown_80F4E08 +gUnknown_80F4E08: @ 80F4E08 + .incbin "baserom.gba", 0xF4E08, 0x2 + + .global gUnknown_80F4E0A +gUnknown_80F4E0A: @ 80F4E0A + .incbin "baserom.gba", 0xF4E0A, 0x2 + + .global gUnknown_80F4E0C +gUnknown_80F4E0C: @ 80F4E0C + .incbin "baserom.gba", 0xF4E0C, 0x2 + + .global gUnknown_80F4E0E +gUnknown_80F4E0E: @ 80F4E0E + .incbin "baserom.gba", 0xF4E0E, 0x2 + + .global gUnknown_80F4E10 +gUnknown_80F4E10: @ 80F4E10 + .incbin "baserom.gba", 0xF4E10, 0x2 + + .global gUnknown_80F4E12 +gUnknown_80F4E12: @ 80F4E12 + .incbin "baserom.gba", 0xF4E12, 0x2 + + .global gUnknown_80F4E14 +gUnknown_80F4E14: @ 80F4E14 + .incbin "baserom.gba", 0xF4E14, 0x2 + + .global gUnknown_80F4E16 +gUnknown_80F4E16: @ 80F4E16 + .incbin "baserom.gba", 0xF4E16, 0x2 + + .global gUnknown_80F4E18 +gUnknown_80F4E18: @ 80F4E18 + .incbin "baserom.gba", 0xF4E18, 0x2 + + .global gUnknown_80F4E1A +gUnknown_80F4E1A: @ 80F4E1A + .incbin "baserom.gba", 0xF4E1A, 0x2 + + .global gUnknown_80F4E1C +gUnknown_80F4E1C: @ 80F4E1C + .incbin "baserom.gba", 0xF4E1C, 0x2 + + .global gUnknown_80F4E1E +gUnknown_80F4E1E: @ 80F4E1E + .incbin "baserom.gba", 0xF4E1E, 0x2 + + .global gUnknown_80F4E20 +gUnknown_80F4E20: @ 80F4E20 + .incbin "baserom.gba", 0xF4E20, 0x2 + + .global gUnknown_80F4E22 +gUnknown_80F4E22: @ 80F4E22 + .incbin "baserom.gba", 0xF4E22, 0xA + + .global gUnknown_80F4E2C +gUnknown_80F4E2C: @ 80F4E2C + .incbin "baserom.gba", 0xF4E2C, 0x4 + + .global gUnknown_80F4E30 +gUnknown_80F4E30: @ 80F4E30 + .incbin "baserom.gba", 0xF4E30, 0x4 + + .global gUnknown_80F4E34 +gUnknown_80F4E34: @ 80F4E34 + .incbin "baserom.gba", 0xF4E34, 0x4 + + .global gUnknown_80F4E38 +gUnknown_80F4E38: @ 80F4E38 + .incbin "baserom.gba", 0xF4E38, 0x4 + + .global gUnknown_80F4E3C +gUnknown_80F4E3C: @ 80F4E3C + .incbin "baserom.gba", 0xF4E3C, 0x4 + + .global gUnknown_80F4E40 +gUnknown_80F4E40: @ 80F4E40 + .incbin "baserom.gba", 0xF4E40, 0x8 + + .global gUnknown_80F4E48 +gUnknown_80F4E48: @ 80F4E48 + .incbin "baserom.gba", 0xF4E48, 0x4 + + .global gUnknown_80F4E4C +gUnknown_80F4E4C: @ 80F4E4C + .incbin "baserom.gba", 0xF4E4C, 0x4 + + .global gUnknown_80F4E50 +gUnknown_80F4E50: @ 80F4E50 + .incbin "baserom.gba", 0xF4E50, 0x4 + + .global gUnknown_80F4E54 +gUnknown_80F4E54: @ 80F4E54 + .incbin "baserom.gba", 0xF4E54, 0x4 + + .global gUnknown_80F4E58 +gUnknown_80F4E58: @ 80F4E58 + .incbin "baserom.gba", 0xF4E58, 0x4 + + .global gUnknown_80F4E5C +gUnknown_80F4E5C: @ 80F4E5C + .incbin "baserom.gba", 0xF4E5C, 0x4 + + .global gUnknown_80F4E60 +gUnknown_80F4E60: @ 80F4E60 + .incbin "baserom.gba", 0xF4E60, 0x10 + + .global gUnknown_80F4E70 +gUnknown_80F4E70: @ 80F4E70 + .incbin "baserom.gba", 0xF4E70, 0x4 + + .global gUnknown_80F4E74 +gUnknown_80F4E74: @ 80F4E74 + .incbin "baserom.gba", 0xF4E74, 0x4 + + .global gUnknown_80F4E78 +gUnknown_80F4E78: @ 80F4E78 + .incbin "baserom.gba", 0xF4E78, 0x4 + + .global gUnknown_80F4E7C +gUnknown_80F4E7C: @ 80F4E7C + .incbin "baserom.gba", 0xF4E7C, 0x4 + + .global gUnknown_80F4E80 +gUnknown_80F4E80: @ 80F4E80 + .incbin "baserom.gba", 0xF4E80, 0x4 + + .global gUnknown_80F4E84 +gUnknown_80F4E84: @ 80F4E84 + .incbin "baserom.gba", 0xF4E84, 0x4 + + .global gUnknown_80F4E88 +gUnknown_80F4E88: @ 80F4E88 + .incbin "baserom.gba", 0xF4E88, 0x4 + + .global gUnknown_80F4E8C +gUnknown_80F4E8C: @ 80F4E8C + .incbin "baserom.gba", 0xF4E8C, 0x4 + + .global gUnknown_80F4E90 +gUnknown_80F4E90: @ 80F4E90 + .incbin "baserom.gba", 0xF4E90, 0x4 + + .global gUnknown_80F4E94 +gUnknown_80F4E94: @ 80F4E94 + .incbin "baserom.gba", 0xF4E94, 0x4 + + .global gUnknown_80F4E98 +gUnknown_80F4E98: @ 80F4E98 + .incbin "baserom.gba", 0xF4E98, 0x4 + + .global gUnknown_80F4E9C +gUnknown_80F4E9C: @ 80F4E9C + .incbin "baserom.gba", 0xF4E9C, 0x4 + + .global gUnknown_80F4EA0 +gUnknown_80F4EA0: @ 80F4EA0 + .incbin "baserom.gba", 0xF4EA0, 0x4 + + .global gUnknown_80F4EA4 +gUnknown_80F4EA4: @ 80F4EA4 + .incbin "baserom.gba", 0xF4EA4, 0x4 + + .global gUnknown_80F4EA8 +gUnknown_80F4EA8: @ 80F4EA8 + .incbin "baserom.gba", 0xF4EA8, 0x4 + + .global gUnknown_80F4EAC +gUnknown_80F4EAC: @ 80F4EAC + .incbin "baserom.gba", 0xF4EAC, 0x4 + + .global gUnknown_80F4EB0 +gUnknown_80F4EB0: @ 80F4EB0 + .incbin "baserom.gba", 0xF4EB0, 0x4 + + .global gUnknown_80F4EB4 +gUnknown_80F4EB4: @ 80F4EB4 + .incbin "baserom.gba", 0xF4EB4, 0x4 + + .global gUnknown_80F4EB8 +gUnknown_80F4EB8: @ 80F4EB8 + .incbin "baserom.gba", 0xF4EB8, 0x4 + + .global gUnknown_80F4EBC +gUnknown_80F4EBC: @ 80F4EBC + .incbin "baserom.gba", 0xF4EBC, 0x4 + + .global gUnknown_80F4EC0 +gUnknown_80F4EC0: @ 80F4EC0 + .incbin "baserom.gba", 0xF4EC0, 0x4 + + .global gUnknown_80F4EC4 +gUnknown_80F4EC4: @ 80F4EC4 + .incbin "baserom.gba", 0xF4EC4, 0x4 + + .global gUnknown_80F4EC8 +gUnknown_80F4EC8: @ 80F4EC8 + .incbin "baserom.gba", 0xF4EC8, 0x4 + + .global gUnknown_80F4ECC +gUnknown_80F4ECC: @ 80F4ECC + .incbin "baserom.gba", 0xF4ECC, 0x4 + + .global gUnknown_80F4ED0 +gUnknown_80F4ED0: @ 80F4ED0 + .incbin "baserom.gba", 0xF4ED0, 0x4 + + .global gUnknown_80F4ED4 +gUnknown_80F4ED4: @ 80F4ED4 + .incbin "baserom.gba", 0xF4ED4, 0x4 + + .global gUnknown_80F4ED8 +gUnknown_80F4ED8: @ 80F4ED8 + .incbin "baserom.gba", 0xF4ED8, 0x4 + + .global gUnknown_80F4EDC +gUnknown_80F4EDC: @ 80F4EDC + .incbin "baserom.gba", 0xF4EDC, 0x4 + + .global gUnknown_80F4EE0 +gUnknown_80F4EE0: @ 80F4EE0 + .incbin "baserom.gba", 0xF4EE0, 0x4 + + .global gUnknown_80F4EE4 +gUnknown_80F4EE4: @ 80F4EE4 + .incbin "baserom.gba", 0xF4EE4, 0x4 + + .global gUnknown_80F4EE8 +gUnknown_80F4EE8: @ 80F4EE8 + .incbin "baserom.gba", 0xF4EE8, 0x4 + + .global gUnknown_80F4EEC +gUnknown_80F4EEC: @ 80F4EEC + .incbin "baserom.gba", 0xF4EEC, 0x4 + + .global gUnknown_80F4EF0 +gUnknown_80F4EF0: @ 80F4EF0 + .incbin "baserom.gba", 0xF4EF0, 0x4 + + .global gUnknown_80F4EF4 +gUnknown_80F4EF4: @ 80F4EF4 + .incbin "baserom.gba", 0xF4EF4, 0x4 + + .global gUnknown_80F4EF8 +gUnknown_80F4EF8: @ 80F4EF8 + .incbin "baserom.gba", 0xF4EF8, 0x4 + + .global gUnknown_80F4EFC +gUnknown_80F4EFC: @ 80F4EFC + .incbin "baserom.gba", 0xF4EFC, 0x4 + + .global gUnknown_80F4F00 +gUnknown_80F4F00: @ 80F4F00 + .incbin "baserom.gba", 0xF4F00, 0x4 + + .global gUnknown_80F4F04 +gUnknown_80F4F04: @ 80F4F04 + .incbin "baserom.gba", 0xF4F04, 0x4 + + .global gUnknown_80F4F08 +gUnknown_80F4F08: @ 80F4F08 + .incbin "baserom.gba", 0xF4F08, 0x4 + + .global gUnknown_80F4F0C +gUnknown_80F4F0C: @ 80F4F0C + .incbin "baserom.gba", 0xF4F0C, 0x4 + + .global gUnknown_80F4F10 +gUnknown_80F4F10: @ 80F4F10 + .incbin "baserom.gba", 0xF4F10, 0x8 + + .global gUnknown_80F4F18 +gUnknown_80F4F18: @ 80F4F18 + .incbin "baserom.gba", 0xF4F18, 0x4 + + .global gUnknown_80F4F1C +gUnknown_80F4F1C: @ 80F4F1C + .incbin "baserom.gba", 0xF4F1C, 0x4 + + .global gUnknown_80F4F20 +gUnknown_80F4F20: @ 80F4F20 + .incbin "baserom.gba", 0xF4F20, 0x4 + + .global gUnknown_80F4F24 +gUnknown_80F4F24: @ 80F4F24 + .incbin "baserom.gba", 0xF4F24, 0x4 + + .global gUnknown_80F4F28 +gUnknown_80F4F28: @ 80F4F28 + .incbin "baserom.gba", 0xF4F28, 0x4 + + .global gUnknown_80F4F2C +gUnknown_80F4F2C: @ 80F4F2C + .incbin "baserom.gba", 0xF4F2C, 0x4 + + .global gUnknown_80F4F30 +gUnknown_80F4F30: @ 80F4F30 + .incbin "baserom.gba", 0xF4F30, 0x2 + + .global gUnknown_80F4F32 +gUnknown_80F4F32: @ 80F4F32 + .incbin "baserom.gba", 0xF4F32, 0x2 + + .global gUnknown_80F4F34 +gUnknown_80F4F34: @ 80F4F34 + .incbin "baserom.gba", 0xF4F34, 0x2 + + .global gUnknown_80F4F36 +gUnknown_80F4F36: @ 80F4F36 + .incbin "baserom.gba", 0xF4F36, 0x2 + + .global gUnknown_80F4F38 +gUnknown_80F4F38: @ 80F4F38 + .incbin "baserom.gba", 0xF4F38, 0x2 + + .global gUnknown_80F4F3A +gUnknown_80F4F3A: @ 80F4F3A + .incbin "baserom.gba", 0xF4F3A, 0x2 + + .global gUnknown_80F4F3C +gUnknown_80F4F3C: @ 80F4F3C + .incbin "baserom.gba", 0xF4F3C, 0x2 + + .global gUnknown_80F4F3E +gUnknown_80F4F3E: @ 80F4F3E + .incbin "baserom.gba", 0xF4F3E, 0x2 + + .global gUnknown_80F4F40 +gUnknown_80F4F40: @ 80F4F40 + .incbin "baserom.gba", 0xF4F40, 0x2 + + .global gUnknown_80F4F42 +gUnknown_80F4F42: @ 80F4F42 + .incbin "baserom.gba", 0xF4F42, 0x4 + + .global gUnknown_80F4F46 +gUnknown_80F4F46: @ 80F4F46 + .incbin "baserom.gba", 0xF4F46, 0x2 + + .global gUnknown_80F4F48 +gUnknown_80F4F48: @ 80F4F48 + .incbin "baserom.gba", 0xF4F48, 0x4 + + .global gUnknown_80F4F4C +gUnknown_80F4F4C: @ 80F4F4C + .incbin "baserom.gba", 0xF4F4C, 0x4 + + .global gUnknown_80F4F50 +gUnknown_80F4F50: @ 80F4F50 + .incbin "baserom.gba", 0xF4F50, 0x4 + + .global gUnknown_80F4F54 +gUnknown_80F4F54: @ 80F4F54 + .incbin "baserom.gba", 0xF4F54, 0x4 + + .global gUnknown_80F4F58 +gUnknown_80F4F58: @ 80F4F58 + .incbin "baserom.gba", 0xF4F58, 0x4 + + .global gUnknown_80F4F5C +gUnknown_80F4F5C: @ 80F4F5C + .incbin "baserom.gba", 0xF4F5C, 0x4 + + .global gUnknown_80F4F60 +gUnknown_80F4F60: @ 80F4F60 + .incbin "baserom.gba", 0xF4F60, 0x4 + + .global gUnknown_80F4F64 +gUnknown_80F4F64: @ 80F4F64 + .incbin "baserom.gba", 0xF4F64, 0x4 + + .global gUnknown_80F4F68 +gUnknown_80F4F68: @ 80F4F68 + .incbin "baserom.gba", 0xF4F68, 0x4 + + .global gUnknown_80F4F6C +gUnknown_80F4F6C: @ 80F4F6C + .incbin "baserom.gba", 0xF4F6C, 0x4 + + .global gUnknown_80F4F70 +gUnknown_80F4F70: @ 80F4F70 + .incbin "baserom.gba", 0xF4F70, 0x2 + + .global gUnknown_80F4F72 +gUnknown_80F4F72: @ 80F4F72 + .incbin "baserom.gba", 0xF4F72, 0x2 + + .global gUnknown_80F4F74 +gUnknown_80F4F74: @ 80F4F74 + .incbin "baserom.gba", 0xF4F74, 0x2 + + .global gUnknown_80F4F76 +gUnknown_80F4F76: @ 80F4F76 + .incbin "baserom.gba", 0xF4F76, 0x2 + + .global gUnknown_80F4F78 +gUnknown_80F4F78: @ 80F4F78 + .incbin "baserom.gba", 0xF4F78, 0x2 + + .global gUnknown_80F4F7A +gUnknown_80F4F7A: @ 80F4F7A + .incbin "baserom.gba", 0xF4F7A, 0x2 + + .global gUnknown_80F4F7C +gUnknown_80F4F7C: @ 80F4F7C + .incbin "baserom.gba", 0xF4F7C, 0x2 + + .global gUnknown_80F4F7E +gUnknown_80F4F7E: @ 80F4F7E + .incbin "baserom.gba", 0xF4F7E, 0x2 + + .global gUnknown_80F4F80 +gUnknown_80F4F80: @ 80F4F80 + .incbin "baserom.gba", 0xF4F80, 0x2 + + .global gUnknown_80F4F82 +gUnknown_80F4F82: @ 80F4F82 + .incbin "baserom.gba", 0xF4F82, 0x2 + + .global gUnknown_80F4F84 +gUnknown_80F4F84: @ 80F4F84 + .incbin "baserom.gba", 0xF4F84, 0x2 + + .global gUnknown_80F4F86 +gUnknown_80F4F86: @ 80F4F86 + .incbin "baserom.gba", 0xF4F86, 0x4 + + .global gUnknown_80F4F8A +gUnknown_80F4F8A: @ 80F4F8A + .incbin "baserom.gba", 0xF4F8A, 0x2 + + .global gUnknown_80F4F8C +gUnknown_80F4F8C: @ 80F4F8C + .incbin "baserom.gba", 0xF4F8C, 0x2 + + .global gUnknown_80F4F8E +gUnknown_80F4F8E: @ 80F4F8E + .incbin "baserom.gba", 0xF4F8E, 0x2 + + .global gUnknown_80F4F90 +gUnknown_80F4F90: @ 80F4F90 + .incbin "baserom.gba", 0xF4F90, 0x2 + + .global gUnknown_80F4F92 +gUnknown_80F4F92: @ 80F4F92 + .incbin "baserom.gba", 0xF4F92, 0x2 + + .global gUnknown_80F4F94 +gUnknown_80F4F94: @ 80F4F94 + .incbin "baserom.gba", 0xF4F94, 0xE + + .global gUnknown_80F4FA2 +gUnknown_80F4FA2: @ 80F4FA2 + .incbin "baserom.gba", 0xF4FA2, 0x2 + + .global gUnknown_80F4FA4 +gUnknown_80F4FA4: @ 80F4FA4 + .incbin "baserom.gba", 0xF4FA4, 0x2 + + .global gUnknown_80F4FA6 +gUnknown_80F4FA6: @ 80F4FA6 + .incbin "baserom.gba", 0xF4FA6, 0x2 + + .global gUnknown_80F4FA8 +gUnknown_80F4FA8: @ 80F4FA8 + .incbin "baserom.gba", 0xF4FA8, 0x2 + + .global gUnknown_80F4FAA +gUnknown_80F4FAA: @ 80F4FAA + .incbin "baserom.gba", 0xF4FAA, 0x2 + + .global gUnknown_80F4FAC +gUnknown_80F4FAC: @ 80F4FAC + .incbin "baserom.gba", 0xF4FAC, 0x2 + + .global gUnknown_80F4FAE +gUnknown_80F4FAE: @ 80F4FAE + .incbin "baserom.gba", 0xF4FAE, 0x4 + + .global gUnknown_80F4FB2 +gUnknown_80F4FB2: @ 80F4FB2 + .incbin "baserom.gba", 0xF4FB2, 0x2 + + .global gUnknown_80F4FB4 +gUnknown_80F4FB4: @ 80F4FB4 + .incbin "baserom.gba", 0xF4FB4, 0x2 + + .global gUnknown_80F4FB6 +gUnknown_80F4FB6: @ 80F4FB6 + .incbin "baserom.gba", 0xF4FB6, 0x2 + + .global gUnknown_80F4FB8 +gUnknown_80F4FB8: @ 80F4FB8 + .incbin "baserom.gba", 0xF4FB8, 0x2 + + .global gUnknown_80F4FBA +gUnknown_80F4FBA: @ 80F4FBA + .incbin "baserom.gba", 0xF4FBA, 0x2 + + .global gUnknown_80F4FBC +gUnknown_80F4FBC: @ 80F4FBC + .incbin "baserom.gba", 0xF4FBC, 0x2 + + .global gUnknown_80F4FBE +gUnknown_80F4FBE: @ 80F4FBE + .incbin "baserom.gba", 0xF4FBE, 0x2 + + .global gUnknown_80F4FC0 +gUnknown_80F4FC0: @ 80F4FC0 + .incbin "baserom.gba", 0xF4FC0, 0x2 + + .global gUnknown_80F4FC2 +gUnknown_80F4FC2: @ 80F4FC2 + .incbin "baserom.gba", 0xF4FC2, 0x2 + + .global gUnknown_80F4FC4 +gUnknown_80F4FC4: @ 80F4FC4 + .incbin "baserom.gba", 0xF4FC4, 0x2 + + .global gUnknown_80F4FC6 +gUnknown_80F4FC6: @ 80F4FC6 + .incbin "baserom.gba", 0xF4FC6, 0x2 + + .global gUnknown_80F4FC8 +gUnknown_80F4FC8: @ 80F4FC8 + .incbin "baserom.gba", 0xF4FC8, 0x3C + + .global gUnknown_80F5004 +gUnknown_80F5004: @ 80F5004 + .incbin "baserom.gba", 0xF5004, 0x2 + + .global gUnknown_80F5006 +gUnknown_80F5006: @ 80F5006 + .incbin "baserom.gba", 0xF5006, 0x2 + + .global gUnknown_80F5008 +gUnknown_80F5008: @ 80F5008 + .incbin "baserom.gba", 0xF5008, 0x2 + + .global gUnknown_80F500A +gUnknown_80F500A: @ 80F500A + .incbin "baserom.gba", 0xF500A, 0x10 + + .global gUnknown_80F501A +gUnknown_80F501A: @ 80F501A + .incbin "baserom.gba", 0xF501A, 0x10 + + .global gUnknown_80F502A +gUnknown_80F502A: @ 80F502A + .incbin "baserom.gba", 0xF502A, 0x10 + + .global gUnknown_80F503A +gUnknown_80F503A: @ 80F503A + .incbin "baserom.gba", 0xF503A, 0x2 + + .global gUnknown_80F503C +gUnknown_80F503C: @ 80F503C + .incbin "baserom.gba", 0xF503C, 0x2 + + .global gUnknown_80F503E +gUnknown_80F503E: @ 80F503E + .incbin "baserom.gba", 0xF503E, 0x2 + + .global gUnknown_80F5040 +gUnknown_80F5040: @ 80F5040 + .incbin "baserom.gba", 0xF5040, 0x2 + + .global gUnknown_80F5042 +gUnknown_80F5042: @ 80F5042 + .incbin "baserom.gba", 0xF5042, 0x2 + + .global gUnknown_80F5044 +gUnknown_80F5044: @ 80F5044 + .incbin "baserom.gba", 0xF5044, 0x2 + + .global gUnknown_80F5046 +gUnknown_80F5046: @ 80F5046 + .incbin "baserom.gba", 0xF5046, 0x2 + + .global gUnknown_80F5048 +gUnknown_80F5048: @ 80F5048 + .incbin "baserom.gba", 0xF5048, 0x4 + + .global gUnknown_80F504C +gUnknown_80F504C: @ 80F504C + .incbin "baserom.gba", 0xF504C, 0x54 + + .global gUnknown_80F50A0 +gUnknown_80F50A0: @ 80F50A0 + .incbin "baserom.gba", 0xF50A0, 0x54 + + .global gUnknown_80F50F4 +gUnknown_80F50F4: @ 80F50F4 + .incbin "baserom.gba", 0xF50F4, 0xA8 + + .global gUnknown_80F519C +gUnknown_80F519C: @ 80F519C + .incbin "baserom.gba", 0xF519C, 0x4 + + .global gUnknown_80F51A0 +gUnknown_80F51A0: @ 80F51A0 + .incbin "baserom.gba", 0xF51A0, 0x4 + + .global gUnknown_80F51A4 +gUnknown_80F51A4: @ 80F51A4 + .incbin "baserom.gba", 0xF51A4, 0x10 + + .global gUnknown_80F51B4 +gUnknown_80F51B4: @ 80F51B4 + .incbin "baserom.gba", 0xF51B4, 0x10 + + .global gUnknown_80F51C4 +gUnknown_80F51C4: @ 80F51C4 + .incbin "baserom.gba", 0xF51C4, 0x10 + + .global gUnknown_80F51D4 +gUnknown_80F51D4: @ 80F51D4 + .incbin "baserom.gba", 0xF51D4, 0x10 + + .global gUnknown_80F51E4 +gUnknown_80F51E4: @ 80F51E4 + .incbin "baserom.gba", 0xF51E4, 0x8 + + .global gUnknown_80F51EC +gUnknown_80F51EC: @ 80F51EC + .incbin "baserom.gba", 0xF51EC, 0x20 + + .global gUnknown_80F520C +gUnknown_80F520C: @ 80F520C + .incbin "baserom.gba", 0xF520C, 0x20 + + .global gUnknown_80F522C +gUnknown_80F522C: @ 80F522C + .incbin "baserom.gba", 0xF522C, 0x288 + + .global gUnknown_80F54B4 +gUnknown_80F54B4: @ 80F54B4 + .incbin "baserom.gba", 0xF54B4, 0x40 + + .global gUnknown_80F54F4 +gUnknown_80F54F4: @ 80F54F4 + .incbin "baserom.gba", 0xF54F4, 0xA0 + + .global gUnknown_80F5594 +gUnknown_80F5594: @ 80F5594 + .incbin "baserom.gba", 0xF5594, 0x28 + + .global gUnknown_80F55BC +gUnknown_80F55BC: @ 80F55BC + .incbin "baserom.gba", 0xF55BC, 0x30 + + .global gUnknown_80F55EC +gUnknown_80F55EC: @ 80F55EC + .incbin "baserom.gba", 0xF55EC, 0x30 + + .global gUnknown_80F561C +gUnknown_80F561C: @ 80F561C + .incbin "baserom.gba", 0xF561C, 0x4C + + .global gUnknown_80F5668 +gUnknown_80F5668: @ 80F5668 + .incbin "baserom.gba", 0xF5668, 0x98 + + .global gUnknown_80F5700 +gUnknown_80F5700: @ 80F5700 + .incbin "baserom.gba", 0xF5700, 0xCA + + .global gUnknown_80F57CA +gUnknown_80F57CA: @ 80F57CA + .incbin "baserom.gba", 0xF57CA, 0x2 + + .global gUnknown_80F57CC +gUnknown_80F57CC: @ 80F57CC + .incbin "baserom.gba", 0xF57CC, 0x2 + + .global gUnknown_80F57CE +gUnknown_80F57CE: @ 80F57CE + .incbin "baserom.gba", 0xF57CE, 0x2 + + .global gUnknown_80F57D0 +gUnknown_80F57D0: @ 80F57D0 + .incbin "baserom.gba", 0xF57D0, 0x2 + + .global gUnknown_80F57D2 +gUnknown_80F57D2: @ 80F57D2 + .incbin "baserom.gba", 0xF57D2, 0x2 + + .global gUnknown_80F57D4 +gUnknown_80F57D4: @ 80F57D4 + .incbin "baserom.gba", 0xF57D4, 0x120 + + .global gUnknown_80F58F4 +gUnknown_80F58F4: @ 80F58F4 + .incbin "baserom.gba", 0xF58F4, 0x84 + + .global gUnknown_80F5978 +gUnknown_80F5978: @ 80F5978 + .incbin "baserom.gba", 0xF5978, 0x4C + + .global gUnknown_80F59C4 +gUnknown_80F59C4: @ 80F59C4 + .incbin "baserom.gba", 0xF59C4, 0x4 + + .global gUnknown_80F59C8 +gUnknown_80F59C8: @ 80F59C8 + .incbin "baserom.gba", 0xF59C8, 0x348 + + .global gUnknown_80F5D10 +gUnknown_80F5D10: @ 80F5D10 + .incbin "baserom.gba", 0xF5D10, 0x260 + + .global gUnknown_80F5F70 +gUnknown_80F5F70: @ 80F5F70 + .incbin "baserom.gba", 0xF5F70, 0x3C + + .global gUnknown_80F5FAC +gUnknown_80F5FAC: @ 80F5FAC + .incbin "baserom.gba", 0xF5FAC, 0x130 + + .global gUnknown_80F60DC +gUnknown_80F60DC: @ 80F60DC + .incbin "baserom.gba", 0xF60DC, 0x1C + + .global gUnknown_80F60F8 +gUnknown_80F60F8: @ 80F60F8 + .incbin "baserom.gba", 0xF60F8, 0x8 + + .global gUnknown_80F6100 +gUnknown_80F6100: @ 80F6100 + .incbin "baserom.gba", 0xF6100, 0x8 + + .global gUnknown_80F6108 +gUnknown_80F6108: @ 80F6108 + .incbin "baserom.gba", 0xF6108, 0x4 + + .global gUnknown_80F610C +gUnknown_80F610C: @ 80F610C + .incbin "baserom.gba", 0xF610C, 0x4 + + .global gUnknown_80F6110 +gUnknown_80F6110: @ 80F6110 + .incbin "baserom.gba", 0xF6110, 0x8 + + .global gUnknown_80F6118 +gUnknown_80F6118: @ 80F6118 + .incbin "baserom.gba", 0xF6118, 0x8 + + .global gUnknown_80F6120 +gUnknown_80F6120: @ 80F6120 + .incbin "baserom.gba", 0xF6120, 0x88 + + .global gUnknown_80F61A8 +gUnknown_80F61A8: @ 80F61A8 + .incbin "baserom.gba", 0xF61A8, 0x8 + + .global gUnknown_80F61B0 +gUnknown_80F61B0: @ 80F61B0 + .incbin "baserom.gba", 0xF61B0, 0x8 + + .global gUnknown_80F61B8 +gUnknown_80F61B8: @ 80F61B8 + .incbin "baserom.gba", 0xF61B8, 0xC + + .global gUnknown_80F61C4 +gUnknown_80F61C4: @ 80F61C4 + .incbin "baserom.gba", 0xF61C4, 0x8 + + .global gUnknown_80F61CC +gUnknown_80F61CC: @ 80F61CC + .incbin "baserom.gba", 0xF61CC, 0x8 + + .global gUnknown_80F61D4 +gUnknown_80F61D4: @ 80F61D4 + .incbin "baserom.gba", 0xF61D4, 0x8 + + .global gUnknown_80F61DC +gUnknown_80F61DC: @ 80F61DC + .incbin "baserom.gba", 0xF61DC, 0x10 + + .global gUnknown_80F61EC +gUnknown_80F61EC: @ 80F61EC + .incbin "baserom.gba", 0xF61EC, 0x30 + + .global gUnknown_80F621C +gUnknown_80F621C: @ 80F621C + .incbin "baserom.gba", 0xF621C, 0x8 + + .global gUnknown_80F6224 +gUnknown_80F6224: @ 80F6224 + .incbin "baserom.gba", 0xF6224, 0x88 + + .global gUnknown_80F62AC +gUnknown_80F62AC: @ 80F62AC + .incbin "baserom.gba", 0xF62AC, 0x4 + + .global gUnknown_80F62B0 +gUnknown_80F62B0: @ 80F62B0 + .incbin "baserom.gba", 0xF62B0, 0x60 + + .global gUnknown_80F6310 +gUnknown_80F6310: @ 80F6310 + .incbin "baserom.gba", 0xF6310, 0x60 + + .global gUnknown_80F6370 +gUnknown_80F6370: @ 80F6370 + .incbin "baserom.gba", 0xF6370, 0x60 + + .global gUnknown_80F63D0 +gUnknown_80F63D0: @ 80F63D0 + .incbin "baserom.gba", 0xF63D0, 0x60 + + .global gUnknown_80F6430 +gUnknown_80F6430: @ 80F6430 + .incbin "baserom.gba", 0xF6430, 0x48 + + .global gUnknown_80F6478 +gUnknown_80F6478: @ 80F6478 + .incbin "baserom.gba", 0xF6478, 0x18 + + .global gUnknown_80F6490 +gUnknown_80F6490: @ 80F6490 + .incbin "baserom.gba", 0xF6490, 0x24 + + .global gUnknown_80F64B4 +gUnknown_80F64B4: @ 80F64B4 + .incbin "baserom.gba", 0xF64B4, 0x24 + + .global gUnknown_80F64D8 +gUnknown_80F64D8: @ 80F64D8 + .incbin "baserom.gba", 0xF64D8, 0x24 + + .global gUnknown_80F64FC +gUnknown_80F64FC: @ 80F64FC + .incbin "baserom.gba", 0xF64FC, 0x24 + + .global gUnknown_80F6520 +gUnknown_80F6520: @ 80F6520 + .incbin "baserom.gba", 0xF6520, 0x24 + + .global gUnknown_80F6544 +gUnknown_80F6544: @ 80F6544 + .incbin "baserom.gba", 0xF6544, 0x24 + + .global gUnknown_80F6568 +gUnknown_80F6568: @ 80F6568 + .incbin "baserom.gba", 0xF6568, 0x88 + + .global gUnknown_80F65F0 +gUnknown_80F65F0: @ 80F65F0 + .incbin "baserom.gba", 0xF65F0, 0x14 + + .global gUnknown_80F6604 +gUnknown_80F6604: @ 80F6604 + .incbin "baserom.gba", 0xF6604, 0x20 + + .global gUnknown_80F6624 +gUnknown_80F6624: @ 80F6624 + .incbin "baserom.gba", 0xF6624, 0x78 + + .global gUnknown_80F669C +gUnknown_80F669C: @ 80F669C + .incbin "baserom.gba", 0xF669C, 0x18 + + .global gUnknown_80F66B4 +gUnknown_80F66B4: @ 80F66B4 + .incbin "baserom.gba", 0xF66B4, 0x14 + + .global gUnknown_80F66C8 +gUnknown_80F66C8: @ 80F66C8 + .incbin "baserom.gba", 0xF66C8, 0x20 + + .global gUnknown_80F66E8 +gUnknown_80F66E8: @ 80F66E8 + .incbin "baserom.gba", 0xF66E8, 0x20 + + .global gUnknown_80F6708 +gUnknown_80F6708: @ 80F6708 + .incbin "baserom.gba", 0xF6708, 0x34 + + .global gUnknown_80F673C +gUnknown_80F673C: @ 80F673C + .incbin "baserom.gba", 0xF673C, 0x3C + + .global gUnknown_80F6778 +gUnknown_80F6778: @ 80F6778 + .incbin "baserom.gba", 0xF6778, 0x10 + + .global gUnknown_80F6788 +gUnknown_80F6788: @ 80F6788 + .incbin "baserom.gba", 0xF6788, 0xC + + .global gUnknown_80F6794 +gUnknown_80F6794: @ 80F6794 + .incbin "baserom.gba", 0xF6794, 0x14 + + .global gUnknown_80F67A8 +gUnknown_80F67A8: @ 80F67A8 + .incbin "baserom.gba", 0xF67A8, 0xC + + .global gUnknown_80F67B4 +gUnknown_80F67B4: @ 80F67B4 + .incbin "baserom.gba", 0xF67B4, 0x10 + + .global gUnknown_80F67C4 +gUnknown_80F67C4: @ 80F67C4 + .incbin "baserom.gba", 0xF67C4, 0x10 + + .global gUnknown_80F67D4 +gUnknown_80F67D4: @ 80F67D4 + .incbin "baserom.gba", 0xF67D4, 0x8 + + .global gUnknown_80F67DC +gUnknown_80F67DC: @ 80F67DC + .incbin "baserom.gba", 0xF67DC, 0x8 + + .global gUnknown_80F67E4 +gUnknown_80F67E4: @ 80F67E4 + .incbin "baserom.gba", 0xF67E4, 0x8 + + .global gUnknown_80F67EC +gUnknown_80F67EC: @ 80F67EC + .incbin "baserom.gba", 0xF67EC, 0x20 + + .global gUnknown_80F680C +gUnknown_80F680C: @ 80F680C + .incbin "baserom.gba", 0xF680C, 0x20 + + .global gUnknown_80F682C +gUnknown_80F682C: @ 80F682C + .incbin "baserom.gba", 0xF682C, 0x10 + + .global gUnknown_80F683C +gUnknown_80F683C: @ 80F683C + .incbin "baserom.gba", 0xF683C, 0x14 + + .global gUnknown_80F6850 +gUnknown_80F6850: @ 80F6850 + .incbin "baserom.gba", 0xF6850, 0x10 + + .global gUnknown_80F6860 +gUnknown_80F6860: @ 80F6860 + .incbin "baserom.gba", 0xF6860, 0x104 + + .global gUnknown_80F6964 +gUnknown_80F6964: @ 80F6964 + .incbin "baserom.gba", 0xF6964, 0x18 + + .global gUnknown_80F697C +gUnknown_80F697C: @ 80F697C + .incbin "baserom.gba", 0xF697C, 0x14 + + .global gUnknown_80F6990 +gUnknown_80F6990: @ 80F6990 + .incbin "baserom.gba", 0xF6990, 0xC + + .global gUnknown_80F699C +gUnknown_80F699C: @ 80F699C + .incbin "baserom.gba", 0xF699C, 0xC + + .global gUnknown_80F69A8 +gUnknown_80F69A8: @ 80F69A8 + .incbin "baserom.gba", 0xF69A8, 0x2C + + .global gUnknown_80F69D4 +gUnknown_80F69D4: @ 80F69D4 + .incbin "baserom.gba", 0xF69D4, 0x18 + + .global gUnknown_80F69EC +gUnknown_80F69EC: @ 80F69EC + .incbin "baserom.gba", 0xF69EC, 0x18 + + .global gUnknown_80F6A04 +gUnknown_80F6A04: @ 80F6A04 + .incbin "baserom.gba", 0xF6A04, 0xC + + .global gUnknown_80F6A10 +gUnknown_80F6A10: @ 80F6A10 + .incbin "baserom.gba", 0xF6A10, 0xC + + .global gUnknown_80F6A1C +gUnknown_80F6A1C: @ 80F6A1C + .incbin "baserom.gba", 0xF6A1C, 0xC + + .global gUnknown_80F6A28 +gUnknown_80F6A28: @ 80F6A28 + .incbin "baserom.gba", 0xF6A28, 0xC + + .global gUnknown_80F6A34 +gUnknown_80F6A34: @ 80F6A34 + .incbin "baserom.gba", 0xF6A34, 0xC + + .global gUnknown_80F6A40 +gUnknown_80F6A40: @ 80F6A40 + .incbin "baserom.gba", 0xF6A40, 0xA + + .global gUnknown_80F6A4A +gUnknown_80F6A4A: @ 80F6A4A + .incbin "baserom.gba", 0xF6A4A, 0x1BC + + .global gUnknown_80F6C06 +gUnknown_80F6C06: @ 80F6C06 + .incbin "baserom.gba", 0xF6C06, 0x11A + + .global gUnknown_80F6D20 +gUnknown_80F6D20: @ 80F6D20 + .incbin "baserom.gba", 0xF6D20, 0xAC + + .global gUnknown_80F6DCC +gUnknown_80F6DCC: @ 80F6DCC + .incbin "baserom.gba", 0xF6DCC, 0x9 + + .global gUnknown_80F6DD5 +gUnknown_80F6DD5: @ 80F6DD5 + .incbin "baserom.gba", 0xF6DD5, 0x23 + + .global gUnknown_80F6DF8 +gUnknown_80F6DF8: @ 80F6DF8 + .incbin "baserom.gba", 0xF6DF8, 0xCF0 + + .global gUnknown_80F7AE8 +gUnknown_80F7AE8: @ 80F7AE8 + .incbin "baserom.gba", 0xF7AE8, 0x2 + + .global gUnknown_80F7AEA +gUnknown_80F7AEA: @ 80F7AEA + .incbin "baserom.gba", 0xF7AEA, 0xE + + .global gUnknown_80F7AF8 +gUnknown_80F7AF8: @ 80F7AF8 + .incbin "baserom.gba", 0xF7AF8, 0x4 + + .global gUnknown_80F7AFC +gUnknown_80F7AFC: @ 80F7AFC + .incbin "baserom.gba", 0xF7AFC, 0x8 + + .global gUnknown_80F7B04 +gUnknown_80F7B04: @ 80F7B04 + .incbin "baserom.gba", 0xF7B04, 0x10 + + .global gUnknown_80F7B14 +gUnknown_80F7B14: @ 80F7B14 + .incbin "baserom.gba", 0xF7B14, 0x13C + + .global gUnknown_80F7C50 +gUnknown_80F7C50: @ 80F7C50 + .incbin "baserom.gba", 0xF7C50, 0x4 + + .global gUnknown_80F7C54 +gUnknown_80F7C54: @ 80F7C54 + .incbin "baserom.gba", 0xF7C54, 0x31C + + .global gUnknown_80F7F70 +gUnknown_80F7F70: @ 80F7F70 + .incbin "baserom.gba", 0xF7F70, 0x194 + + .global gUnknown_80F8104 +gUnknown_80F8104: @ 80F8104 + .incbin "baserom.gba", 0xF8104, 0x2C + + .global gUnknown_80F8130 +gUnknown_80F8130: @ 80F8130 + .incbin "baserom.gba", 0xF8130, 0x838 + + .global gUnknown_80F8968 +gUnknown_80F8968: @ 80F8968 + .incbin "baserom.gba", 0xF8968, 0xC + + .global gUnknown_80F8974 +gUnknown_80F8974: @ 80F8974 + .incbin "baserom.gba", 0xF8974, 0x14 + + .global gUnknown_80F8988 +gUnknown_80F8988: @ 80F8988 + .incbin "baserom.gba", 0xF8988, 0xC + + .global gUnknown_80F8994 +gUnknown_80F8994: @ 80F8994 + .incbin "baserom.gba", 0xF8994, 0x20 + + .global gUnknown_80F89B4 +gUnknown_80F89B4: @ 80F89B4 + .incbin "baserom.gba", 0xF89B4, 0x20 + + .global gUnknown_80F89D4 +gUnknown_80F89D4: @ 80F89D4 + .incbin "baserom.gba", 0xF89D4, 0x4 + + .global gUnknown_80F89D8 +gUnknown_80F89D8: @ 80F89D8 + .incbin "baserom.gba", 0xF89D8, 0x1C + + .global gUnknown_80F89F4 +gUnknown_80F89F4: @ 80F89F4 + .incbin "baserom.gba", 0xF89F4, 0x18 + + .global gUnknown_80F8A0C +gUnknown_80F8A0C: @ 80F8A0C + .incbin "baserom.gba", 0xF8A0C, 0x1C + + .global gUnknown_80F8A28 +gUnknown_80F8A28: @ 80F8A28 + .incbin "baserom.gba", 0xF8A28, 0x24 + + .global gUnknown_80F8A4C +gUnknown_80F8A4C: @ 80F8A4C + .incbin "baserom.gba", 0xF8A4C, 0x20 + + .global gUnknown_80F8A6C +gUnknown_80F8A6C: @ 80F8A6C + .incbin "baserom.gba", 0xF8A6C, 0x18 + + .global gUnknown_80F8A84 +gUnknown_80F8A84: @ 80F8A84 + .incbin "baserom.gba", 0xF8A84, 0x2C + + .global gUnknown_80F8AB0 +gUnknown_80F8AB0: @ 80F8AB0 + .incbin "baserom.gba", 0xF8AB0, 0x2C + + .global gUnknown_80F8ADC +gUnknown_80F8ADC: @ 80F8ADC + .incbin "baserom.gba", 0xF8ADC, 0x30 + + .global gUnknown_80F8B0C +gUnknown_80F8B0C: @ 80F8B0C + .incbin "baserom.gba", 0xF8B0C, 0x18 + + .global gUnknown_80F8B24 +gUnknown_80F8B24: @ 80F8B24 + .incbin "baserom.gba", 0xF8B24, 0x1C + + .global gUnknown_80F8B40 +gUnknown_80F8B40: @ 80F8B40 + .incbin "baserom.gba", 0xF8B40, 0x24 + + .global gUnknown_80F8B64 +gUnknown_80F8B64: @ 80F8B64 + .incbin "baserom.gba", 0xF8B64, 0x24 + + .global gUnknown_80F8B88 +gUnknown_80F8B88: @ 80F8B88 + .incbin "baserom.gba", 0xF8B88, 0x2C + + .global gUnknown_80F8BB4 +gUnknown_80F8BB4: @ 80F8BB4 + .incbin "baserom.gba", 0xF8BB4, 0x2C + + .global gUnknown_80F8BE0 +gUnknown_80F8BE0: @ 80F8BE0 + .incbin "baserom.gba", 0xF8BE0, 0x60 + + .global gUnknown_80F8C40 +gUnknown_80F8C40: @ 80F8C40 + .incbin "baserom.gba", 0xF8C40, 0x4 + + .global gUnknown_80F8C44 +gUnknown_80F8C44: @ 80F8C44 + .incbin "baserom.gba", 0xF8C44, 0x4 + + .global gUnknown_80F8C48 +gUnknown_80F8C48: @ 80F8C48 + .incbin "baserom.gba", 0xF8C48, 0x34 + + .global gUnknown_80F8C7C +gUnknown_80F8C7C: @ 80F8C7C + .incbin "baserom.gba", 0xF8C7C, 0x2C + + .global gUnknown_80F8CA8 +gUnknown_80F8CA8: @ 80F8CA8 + .incbin "baserom.gba", 0xF8CA8, 0x3C + + .global gUnknown_80F8CE4 +gUnknown_80F8CE4: @ 80F8CE4 + .incbin "baserom.gba", 0xF8CE4, 0x4 + + .global gUnknown_80F8CE8 +gUnknown_80F8CE8: @ 80F8CE8 + .incbin "baserom.gba", 0xF8CE8, 0x1C + + .global gUnknown_80F8D04 +gUnknown_80F8D04: @ 80F8D04 + .incbin "baserom.gba", 0xF8D04, 0x1C + + .global gUnknown_80F8D20 +gUnknown_80F8D20: @ 80F8D20 + .incbin "baserom.gba", 0xF8D20, 0x24 + + .global gUnknown_80F8D44 +gUnknown_80F8D44: @ 80F8D44 + .incbin "baserom.gba", 0xF8D44, 0x1C + + .global gUnknown_80F8D60 +gUnknown_80F8D60: @ 80F8D60 + .incbin "baserom.gba", 0xF8D60, 0x1C + + .global gUnknown_80F8D7C +gUnknown_80F8D7C: @ 80F8D7C + .incbin "baserom.gba", 0xF8D7C, 0x38 + + .global gUnknown_80F8DB4 +gUnknown_80F8DB4: @ 80F8DB4 + .incbin "baserom.gba", 0xF8DB4, 0x2C + + .global gUnknown_80F8DE0 +gUnknown_80F8DE0: @ 80F8DE0 + .incbin "baserom.gba", 0xF8DE0, 0x24 + + .global gUnknown_80F8E04 +gUnknown_80F8E04: @ 80F8E04 + .incbin "baserom.gba", 0xF8E04, 0x24 + + .global gUnknown_80F8E28 +gUnknown_80F8E28: @ 80F8E28 + .incbin "baserom.gba", 0xF8E28, 0x4 + + .global gUnknown_80F8E2C +gUnknown_80F8E2C: @ 80F8E2C + .incbin "baserom.gba", 0xF8E2C, 0x28 + + .global gUnknown_80F8E54 +gUnknown_80F8E54: @ 80F8E54 + .incbin "baserom.gba", 0xF8E54, 0x24 + + .global gUnknown_80F8E78 +gUnknown_80F8E78: @ 80F8E78 + .incbin "baserom.gba", 0xF8E78, 0x34 + + .global gUnknown_80F8EAC +gUnknown_80F8EAC: @ 80F8EAC + .incbin "baserom.gba", 0xF8EAC, 0x18 + + .global gUnknown_80F8EC4 +gUnknown_80F8EC4: @ 80F8EC4 + .incbin "baserom.gba", 0xF8EC4, 0x4 + + .global gUnknown_80F8EC8 +gUnknown_80F8EC8: @ 80F8EC8 + .incbin "baserom.gba", 0xF8EC8, 0x1C + + .global gUnknown_80F8EE4 +gUnknown_80F8EE4: @ 80F8EE4 + .incbin "baserom.gba", 0xF8EE4, 0x24 + + .global gUnknown_80F8F08 +gUnknown_80F8F08: @ 80F8F08 + .incbin "baserom.gba", 0xF8F08, 0x18 + + .global gUnknown_80F8F20 +gUnknown_80F8F20: @ 80F8F20 + .incbin "baserom.gba", 0xF8F20, 0x18 + + .global gUnknown_80F8F38 +gUnknown_80F8F38: @ 80F8F38 + .incbin "baserom.gba", 0xF8F38, 0x1C + + .global gUnknown_80F8F54 +gUnknown_80F8F54: @ 80F8F54 + .incbin "baserom.gba", 0xF8F54, 0x34 + + .global gUnknown_80F8F88 +gUnknown_80F8F88: @ 80F8F88 + .incbin "baserom.gba", 0xF8F88, 0x24 + + .global gUnknown_80F8FAC +gUnknown_80F8FAC: @ 80F8FAC + .incbin "baserom.gba", 0xF8FAC, 0x18 + + .global gUnknown_80F8FC4 +gUnknown_80F8FC4: @ 80F8FC4 + .incbin "baserom.gba", 0xF8FC4, 0x34 + + .global gUnknown_80F8FF8 +gUnknown_80F8FF8: @ 80F8FF8 + .incbin "baserom.gba", 0xF8FF8, 0x4 + + .global gUnknown_80F8FFC +gUnknown_80F8FFC: @ 80F8FFC + .incbin "baserom.gba", 0xF8FFC, 0x1C + + .global gUnknown_80F9018 +gUnknown_80F9018: @ 80F9018 + .incbin "baserom.gba", 0xF9018, 0x38 + + .global gUnknown_80F9050 +gUnknown_80F9050: @ 80F9050 + .incbin "baserom.gba", 0xF9050, 0x4 + + .global gUnknown_80F9054 +gUnknown_80F9054: @ 80F9054 + .incbin "baserom.gba", 0xF9054, 0x40 + + .global gUnknown_80F9094 +gUnknown_80F9094: @ 80F9094 + .incbin "baserom.gba", 0xF9094, 0x34 + + .global gUnknown_80F90C8 +gUnknown_80F90C8: @ 80F90C8 + .incbin "baserom.gba", 0xF90C8, 0x14 + + .global gUnknown_80F90DC +gUnknown_80F90DC: @ 80F90DC + .incbin "baserom.gba", 0xF90DC, 0x38 + + .global gUnknown_80F9114 +gUnknown_80F9114: @ 80F9114 + .incbin "baserom.gba", 0xF9114, 0x28 + + .global gUnknown_80F913C +gUnknown_80F913C: @ 80F913C + .incbin "baserom.gba", 0xF913C, 0x14 + + .global gUnknown_80F9150 +gUnknown_80F9150: @ 80F9150 + .incbin "baserom.gba", 0xF9150, 0x4 + + .global gUnknown_80F9154 +gUnknown_80F9154: @ 80F9154 + .incbin "baserom.gba", 0xF9154, 0x4 + + .global gUnknown_80F9158 +gUnknown_80F9158: @ 80F9158 + .incbin "baserom.gba", 0xF9158, 0x1C + + .global gUnknown_80F9174 +gUnknown_80F9174: @ 80F9174 + .incbin "baserom.gba", 0xF9174, 0x1C + + .global gUnknown_80F9190 +gUnknown_80F9190: @ 80F9190 + .incbin "baserom.gba", 0xF9190, 0x18 + + .global gUnknown_80F91A8 +gUnknown_80F91A8: @ 80F91A8 + .incbin "baserom.gba", 0xF91A8, 0x20 + + .global gUnknown_80F91C8 +gUnknown_80F91C8: @ 80F91C8 + .incbin "baserom.gba", 0xF91C8, 0x18 + + .global gUnknown_80F91E0 +gUnknown_80F91E0: @ 80F91E0 + .incbin "baserom.gba", 0xF91E0, 0xC + + .global gUnknown_80F91EC +gUnknown_80F91EC: @ 80F91EC + .incbin "baserom.gba", 0xF91EC, 0x4 + + .global gUnknown_80F91F0 +gUnknown_80F91F0: @ 80F91F0 + .incbin "baserom.gba", 0xF91F0, 0x174 + + .global gUnknown_80F9364 +gUnknown_80F9364: @ 80F9364 + .incbin "baserom.gba", 0xF9364, 0x1C + + .global gUnknown_80F9380 +gUnknown_80F9380: @ 80F9380 + .incbin "baserom.gba", 0xF9380, 0x4 + + .global gUnknown_80F9384 +gUnknown_80F9384: @ 80F9384 + .incbin "baserom.gba", 0xF9384, 0x20 + + .global gUnknown_80F93A4 +gUnknown_80F93A4: @ 80F93A4 + .incbin "baserom.gba", 0xF93A4, 0x24 + + .global gUnknown_80F93C8 +gUnknown_80F93C8: @ 80F93C8 + .incbin "baserom.gba", 0xF93C8, 0x20 + + .global gUnknown_80F93E8 +gUnknown_80F93E8: @ 80F93E8 + .incbin "baserom.gba", 0xF93E8, 0x20 + + .global gUnknown_80F9408 +gUnknown_80F9408: @ 80F9408 + .incbin "baserom.gba", 0xF9408, 0x1C + + .global gUnknown_80F9424 +gUnknown_80F9424: @ 80F9424 + .incbin "baserom.gba", 0xF9424, 0x18 + + .global gUnknown_80F943C +gUnknown_80F943C: @ 80F943C + .incbin "baserom.gba", 0xF943C, 0x20 + + .global gUnknown_80F945C +gUnknown_80F945C: @ 80F945C + .incbin "baserom.gba", 0xF945C, 0x20 + + .global gUnknown_80F947C +gUnknown_80F947C: @ 80F947C + .incbin "baserom.gba", 0xF947C, 0x20 + + .global gUnknown_80F949C +gUnknown_80F949C: @ 80F949C + .incbin "baserom.gba", 0xF949C, 0x28 + + .global gUnknown_80F94C4 +gUnknown_80F94C4: @ 80F94C4 + .incbin "baserom.gba", 0xF94C4, 0x14 + + .global gUnknown_80F94D8 +gUnknown_80F94D8: @ 80F94D8 + .incbin "baserom.gba", 0xF94D8, 0x18 + + .global gUnknown_80F94F0 +gUnknown_80F94F0: @ 80F94F0 + .incbin "baserom.gba", 0xF94F0, 0x20 + + .global gUnknown_80F9510 +gUnknown_80F9510: @ 80F9510 + .incbin "baserom.gba", 0xF9510, 0x20 + + .global gUnknown_80F9530 +gUnknown_80F9530: @ 80F9530 + .incbin "baserom.gba", 0xF9530, 0x1C + + .global gUnknown_80F954C +gUnknown_80F954C: @ 80F954C + .incbin "baserom.gba", 0xF954C, 0x20 + + .global gUnknown_80F956C +gUnknown_80F956C: @ 80F956C + .incbin "baserom.gba", 0xF956C, 0x20 + + .global gUnknown_80F958C +gUnknown_80F958C: @ 80F958C + .incbin "baserom.gba", 0xF958C, 0x18 + + .global gUnknown_80F95A4 +gUnknown_80F95A4: @ 80F95A4 + .incbin "baserom.gba", 0xF95A4, 0x18 + + .global gUnknown_80F95BC +gUnknown_80F95BC: @ 80F95BC + .incbin "baserom.gba", 0xF95BC, 0x1C + + .global gUnknown_80F95D8 +gUnknown_80F95D8: @ 80F95D8 + .incbin "baserom.gba", 0xF95D8, 0x14 + + .global gUnknown_80F95EC +gUnknown_80F95EC: @ 80F95EC + .incbin "baserom.gba", 0xF95EC, 0x14 + + .global gUnknown_80F9600 +gUnknown_80F9600: @ 80F9600 + .incbin "baserom.gba", 0xF9600, 0x14 + + .global gUnknown_80F9614 +gUnknown_80F9614: @ 80F9614 + .incbin "baserom.gba", 0xF9614, 0x1C + + .global gUnknown_80F9630 +gUnknown_80F9630: @ 80F9630 + .incbin "baserom.gba", 0xF9630, 0x24 + + .global gUnknown_80F9654 +gUnknown_80F9654: @ 80F9654 + .incbin "baserom.gba", 0xF9654, 0x1C + + .global gUnknown_80F9670 +gUnknown_80F9670: @ 80F9670 + .incbin "baserom.gba", 0xF9670, 0x18 + + .global gUnknown_80F9688 +gUnknown_80F9688: @ 80F9688 + .incbin "baserom.gba", 0xF9688, 0x20 + + .global gUnknown_80F96A8 +gUnknown_80F96A8: @ 80F96A8 + .incbin "baserom.gba", 0xF96A8, 0x14 + + .global gUnknown_80F96BC +gUnknown_80F96BC: @ 80F96BC + .incbin "baserom.gba", 0xF96BC, 0x30 + + .global gUnknown_80F96EC +gUnknown_80F96EC: @ 80F96EC + .incbin "baserom.gba", 0xF96EC, 0x20 + + .global gUnknown_80F970C +gUnknown_80F970C: @ 80F970C + .incbin "baserom.gba", 0xF970C, 0x1C + + .global gUnknown_80F9728 +gUnknown_80F9728: @ 80F9728 + .incbin "baserom.gba", 0xF9728, 0x18 + + .global gUnknown_80F9740 +gUnknown_80F9740: @ 80F9740 + .incbin "baserom.gba", 0xF9740, 0x20 + + .global gUnknown_80F9760 +gUnknown_80F9760: @ 80F9760 + .incbin "baserom.gba", 0xF9760, 0x4 + + .global gUnknown_80F9764 +gUnknown_80F9764: @ 80F9764 + .incbin "baserom.gba", 0xF9764, 0x2F0 + + .global gUnknown_80F9A54 +gUnknown_80F9A54: @ 80F9A54 + .incbin "baserom.gba", 0xF9A54, 0x78 + + .global gUnknown_80F9ACC +gUnknown_80F9ACC: @ 80F9ACC + .incbin "baserom.gba", 0xF9ACC, 0x20 + + .global gUnknown_80F9AEC +gUnknown_80F9AEC: @ 80F9AEC + .incbin "baserom.gba", 0xF9AEC, 0x24 + + .global gUnknown_80F9B10 +gUnknown_80F9B10: @ 80F9B10 + .incbin "baserom.gba", 0xF9B10, 0x24 + + .global gUnknown_80F9B34 +gUnknown_80F9B34: @ 80F9B34 + .incbin "baserom.gba", 0xF9B34, 0x24 + + .global gUnknown_80F9B58 +gUnknown_80F9B58: @ 80F9B58 + .incbin "baserom.gba", 0xF9B58, 0x1C + + .global gUnknown_80F9B74 +gUnknown_80F9B74: @ 80F9B74 + .incbin "baserom.gba", 0xF9B74, 0x20 + + .global gUnknown_80F9B94 +gUnknown_80F9B94: @ 80F9B94 + .incbin "baserom.gba", 0xF9B94, 0x1C + + .global gUnknown_80F9BB0 +gUnknown_80F9BB0: @ 80F9BB0 + .incbin "baserom.gba", 0xF9BB0, 0x28 + + .global gUnknown_80F9BD8 +gUnknown_80F9BD8: @ 80F9BD8 + .incbin "baserom.gba", 0xF9BD8, 0x30 + + .global gUnknown_80F9C08 +gUnknown_80F9C08: @ 80F9C08 + .incbin "baserom.gba", 0xF9C08, 0x24 + + .global gUnknown_80F9C2C +gUnknown_80F9C2C: @ 80F9C2C + .incbin "baserom.gba", 0xF9C2C, 0x20 + + .global gUnknown_80F9C4C +gUnknown_80F9C4C: @ 80F9C4C + .incbin "baserom.gba", 0xF9C4C, 0x24 + + .global gUnknown_80F9C70 +gUnknown_80F9C70: @ 80F9C70 + .incbin "baserom.gba", 0xF9C70, 0x1C + + .global gUnknown_80F9C8C +gUnknown_80F9C8C: @ 80F9C8C + .incbin "baserom.gba", 0xF9C8C, 0x30 + + .global gUnknown_80F9CBC +gUnknown_80F9CBC: @ 80F9CBC + .incbin "baserom.gba", 0xF9CBC, 0x4 + + .global gUnknown_80F9CC0 +gUnknown_80F9CC0: @ 80F9CC0 + .incbin "baserom.gba", 0xF9CC0, 0x2C + + .global gUnknown_80F9CEC +gUnknown_80F9CEC: @ 80F9CEC + .incbin "baserom.gba", 0xF9CEC, 0x3C + + .global gUnknown_80F9D28 +gUnknown_80F9D28: @ 80F9D28 + .incbin "baserom.gba", 0xF9D28, 0x5C + + .global gUnknown_80F9D84 +gUnknown_80F9D84: @ 80F9D84 + .incbin "baserom.gba", 0xF9D84, 0x8 + + .global gUnknown_80F9D8C +gUnknown_80F9D8C: @ 80F9D8C + .incbin "baserom.gba", 0xF9D8C, 0x20 + + .global gUnknown_80F9DAC +gUnknown_80F9DAC: @ 80F9DAC + .incbin "baserom.gba", 0xF9DAC, 0x44 + + .global gUnknown_80F9DF0 +gUnknown_80F9DF0: @ 80F9DF0 + .incbin "baserom.gba", 0xF9DF0, 0x54 + + .global gUnknown_80F9E44 +gUnknown_80F9E44: @ 80F9E44 + .incbin "baserom.gba", 0xF9E44, 0x20 + + .global gUnknown_80F9E64 +gUnknown_80F9E64: @ 80F9E64 + .incbin "baserom.gba", 0xF9E64, 0x1C + + .global gUnknown_80F9E80 +gUnknown_80F9E80: @ 80F9E80 + .incbin "baserom.gba", 0xF9E80, 0x48 + + .global gUnknown_80F9EC8 +gUnknown_80F9EC8: @ 80F9EC8 + .incbin "baserom.gba", 0xF9EC8, 0x24 + + .global gUnknown_80F9EEC +gUnknown_80F9EEC: @ 80F9EEC + .incbin "baserom.gba", 0xF9EEC, 0x18 + + .global gUnknown_80F9F04 +gUnknown_80F9F04: @ 80F9F04 + .incbin "baserom.gba", 0xF9F04, 0x28 + + .global gUnknown_80F9F2C +gUnknown_80F9F2C: @ 80F9F2C + .incbin "baserom.gba", 0xF9F2C, 0x78 + + .global gUnknown_80F9FA4 +gUnknown_80F9FA4: @ 80F9FA4 + .incbin "baserom.gba", 0xF9FA4, 0x44 + + .global gUnknown_80F9FE8 +gUnknown_80F9FE8: @ 80F9FE8 + .incbin "baserom.gba", 0xF9FE8, 0x1C + + .global gUnknown_80FA004 +gUnknown_80FA004: @ 80FA004 + .incbin "baserom.gba", 0xFA004, 0x2C + + .global gUnknown_80FA030 +gUnknown_80FA030: @ 80FA030 + .incbin "baserom.gba", 0xFA030, 0x28 + + .global gUnknown_80FA058 +gUnknown_80FA058: @ 80FA058 + .incbin "baserom.gba", 0xFA058, 0x38 + + .global gUnknown_80FA090 +gUnknown_80FA090: @ 80FA090 + .incbin "baserom.gba", 0xFA090, 0x38 + + .global gUnknown_80FA0C8 +gUnknown_80FA0C8: @ 80FA0C8 + .incbin "baserom.gba", 0xFA0C8, 0x28 + + .global gUnknown_80FA0F0 +gUnknown_80FA0F0: @ 80FA0F0 + .incbin "baserom.gba", 0xFA0F0, 0x30 + + .global gUnknown_80FA120 +gUnknown_80FA120: @ 80FA120 + .incbin "baserom.gba", 0xFA120, 0x4 + + .global gUnknown_80FA124 +gUnknown_80FA124: @ 80FA124 + .incbin "baserom.gba", 0xFA124, 0x13C + + .global gUnknown_80FA260 +gUnknown_80FA260: @ 80FA260 + .incbin "baserom.gba", 0xFA260, 0x50 + + .global gUnknown_80FA2B0 +gUnknown_80FA2B0: @ 80FA2B0 + .incbin "baserom.gba", 0xFA2B0, 0x40 + + .global gUnknown_80FA2F0 +gUnknown_80FA2F0: @ 80FA2F0 + .incbin "baserom.gba", 0xFA2F0, 0x3C + + .global gUnknown_80FA32C +gUnknown_80FA32C: @ 80FA32C + .incbin "baserom.gba", 0xFA32C, 0x40 + + .global gUnknown_80FA36C +gUnknown_80FA36C: @ 80FA36C + .incbin "baserom.gba", 0xFA36C, 0x4 + + .global gUnknown_80FA370 +gUnknown_80FA370: @ 80FA370 + .incbin "baserom.gba", 0xFA370, 0x24 + + .global gUnknown_80FA394 +gUnknown_80FA394: @ 80FA394 + .incbin "baserom.gba", 0xFA394, 0x24 + + .global gUnknown_80FA3B8 +gUnknown_80FA3B8: @ 80FA3B8 + .incbin "baserom.gba", 0xFA3B8, 0x50 + + .global gUnknown_80FA408 +gUnknown_80FA408: @ 80FA408 + .incbin "baserom.gba", 0xFA408, 0x40 + + .global gUnknown_80FA448 +gUnknown_80FA448: @ 80FA448 + .incbin "baserom.gba", 0xFA448, 0x1C + + .global gUnknown_80FA464 +gUnknown_80FA464: @ 80FA464 + .incbin "baserom.gba", 0xFA464, 0x70 + + .global gUnknown_80FA4D4 +gUnknown_80FA4D4: @ 80FA4D4 + .incbin "baserom.gba", 0xFA4D4, 0x4 + + .global gUnknown_80FA4D8 +gUnknown_80FA4D8: @ 80FA4D8 + .incbin "baserom.gba", 0xFA4D8, 0x28 + + .global gUnknown_80FA500 +gUnknown_80FA500: @ 80FA500 + .incbin "baserom.gba", 0xFA500, 0x2C + + .global gUnknown_80FA52C +gUnknown_80FA52C: @ 80FA52C + .incbin "baserom.gba", 0xFA52C, 0x4 + + .global gUnknown_80FA530 +gUnknown_80FA530: @ 80FA530 + .incbin "baserom.gba", 0xFA530, 0x1C + + .global gUnknown_80FA54C +gUnknown_80FA54C: @ 80FA54C + .incbin "baserom.gba", 0xFA54C, 0x34 + + .global gUnknown_80FA580 +gUnknown_80FA580: @ 80FA580 + .incbin "baserom.gba", 0xFA580, 0x34 + + .global gUnknown_80FA5B4 +gUnknown_80FA5B4: @ 80FA5B4 + .incbin "baserom.gba", 0xFA5B4, 0x40 + + .global gUnknown_80FA5F4 +gUnknown_80FA5F4: @ 80FA5F4 + .incbin "baserom.gba", 0xFA5F4, 0x28 + + .global gUnknown_80FA61C +gUnknown_80FA61C: @ 80FA61C + .incbin "baserom.gba", 0xFA61C, 0x1C + + .global gUnknown_80FA638 +gUnknown_80FA638: @ 80FA638 + .incbin "baserom.gba", 0xFA638, 0x20 + + .global gUnknown_80FA658 +gUnknown_80FA658: @ 80FA658 + .incbin "baserom.gba", 0xFA658, 0x24 + + .global gUnknown_80FA67C +gUnknown_80FA67C: @ 80FA67C + .incbin "baserom.gba", 0xFA67C, 0x20 + + .global gUnknown_80FA69C +gUnknown_80FA69C: @ 80FA69C + .incbin "baserom.gba", 0xFA69C, 0x20 + + .global gUnknown_80FA6BC +gUnknown_80FA6BC: @ 80FA6BC + .incbin "baserom.gba", 0xFA6BC, 0x18 + + .global gUnknown_80FA6D4 +gUnknown_80FA6D4: @ 80FA6D4 + .incbin "baserom.gba", 0xFA6D4, 0x14 + + .global gUnknown_80FA6E8 +gUnknown_80FA6E8: @ 80FA6E8 + .incbin "baserom.gba", 0xFA6E8, 0x20 + + .global gUnknown_80FA708 +gUnknown_80FA708: @ 80FA708 + .incbin "baserom.gba", 0xFA708, 0x4 + + .global gUnknown_80FA70C +gUnknown_80FA70C: @ 80FA70C + .incbin "baserom.gba", 0xFA70C, 0x4 + + .global gUnknown_80FA710 +gUnknown_80FA710: @ 80FA710 + .incbin "baserom.gba", 0xFA710, 0x24 + + .global gUnknown_80FA734 +gUnknown_80FA734: @ 80FA734 + .incbin "baserom.gba", 0xFA734, 0x24 + + .global gUnknown_80FA758 +gUnknown_80FA758: @ 80FA758 + .incbin "baserom.gba", 0xFA758, 0x20 + + .global gUnknown_80FA778 +gUnknown_80FA778: @ 80FA778 + .incbin "baserom.gba", 0xFA778, 0x24 + + .global gUnknown_80FA79C +gUnknown_80FA79C: @ 80FA79C + .incbin "baserom.gba", 0xFA79C, 0x20 + + .global gUnknown_80FA7BC +gUnknown_80FA7BC: @ 80FA7BC + .incbin "baserom.gba", 0xFA7BC, 0x20 + + .global gUnknown_80FA7DC +gUnknown_80FA7DC: @ 80FA7DC + .incbin "baserom.gba", 0xFA7DC, 0x24 + + .global gUnknown_80FA800 +gUnknown_80FA800: @ 80FA800 + .incbin "baserom.gba", 0xFA800, 0x1C + + .global gUnknown_80FA81C +gUnknown_80FA81C: @ 80FA81C + .incbin "baserom.gba", 0xFA81C, 0x4 + + .global gUnknown_80FA820 +gUnknown_80FA820: @ 80FA820 + .incbin "baserom.gba", 0xFA820, 0x4 + + .global gUnknown_80FA824 +gUnknown_80FA824: @ 80FA824 + .incbin "baserom.gba", 0xFA824, 0x20 + + .global gUnknown_80FA844 +gUnknown_80FA844: @ 80FA844 + .incbin "baserom.gba", 0xFA844, 0x24 + + .global gUnknown_80FA868 +gUnknown_80FA868: @ 80FA868 + .incbin "baserom.gba", 0xFA868, 0x20 + + .global gUnknown_80FA888 +gUnknown_80FA888: @ 80FA888 + .incbin "baserom.gba", 0xFA888, 0x20 + + .global gUnknown_80FA8A8 +gUnknown_80FA8A8: @ 80FA8A8 + .incbin "baserom.gba", 0xFA8A8, 0x14 + + .global gUnknown_80FA8BC +gUnknown_80FA8BC: @ 80FA8BC + .incbin "baserom.gba", 0xFA8BC, 0x24 + + .global gUnknown_80FA8E0 +gUnknown_80FA8E0: @ 80FA8E0 + .incbin "baserom.gba", 0xFA8E0, 0x2C + + .global gUnknown_80FA90C +gUnknown_80FA90C: @ 80FA90C + .incbin "baserom.gba", 0xFA90C, 0x28 + + .global gUnknown_80FA934 +gUnknown_80FA934: @ 80FA934 + .incbin "baserom.gba", 0xFA934, 0x28 + + .global gUnknown_80FA95C +gUnknown_80FA95C: @ 80FA95C + .incbin "baserom.gba", 0xFA95C, 0x20 + + .global gUnknown_80FA97C +gUnknown_80FA97C: @ 80FA97C + .incbin "baserom.gba", 0xFA97C, 0x24 + + .global gUnknown_80FA9A0 +gUnknown_80FA9A0: @ 80FA9A0 + .incbin "baserom.gba", 0xFA9A0, 0x20 + + .global gUnknown_80FA9C0 +gUnknown_80FA9C0: @ 80FA9C0 + .incbin "baserom.gba", 0xFA9C0, 0x1C + + .global gUnknown_80FA9DC +gUnknown_80FA9DC: @ 80FA9DC + .incbin "baserom.gba", 0xFA9DC, 0x18 + + .global gUnknown_80FA9F4 +gUnknown_80FA9F4: @ 80FA9F4 + .incbin "baserom.gba", 0xFA9F4, 0x18 + + .global gUnknown_80FAA0C +gUnknown_80FAA0C: @ 80FAA0C + .incbin "baserom.gba", 0xFAA0C, 0x20 + + .global gUnknown_80FAA2C +gUnknown_80FAA2C: @ 80FAA2C + .incbin "baserom.gba", 0xFAA2C, 0x1C + + .global gUnknown_80FAA48 +gUnknown_80FAA48: @ 80FAA48 + .incbin "baserom.gba", 0xFAA48, 0x20 + + .global gUnknown_80FAA68 +gUnknown_80FAA68: @ 80FAA68 + .incbin "baserom.gba", 0xFAA68, 0x24 + + .global gUnknown_80FAA8C +gUnknown_80FAA8C: @ 80FAA8C + .incbin "baserom.gba", 0xFAA8C, 0x20 + + .global gUnknown_80FAAAC +gUnknown_80FAAAC: @ 80FAAAC + .incbin "baserom.gba", 0xFAAAC, 0x1C + + .global gUnknown_80FAAC8 +gUnknown_80FAAC8: @ 80FAAC8 + .incbin "baserom.gba", 0xFAAC8, 0x20 + + .global gUnknown_80FAAE8 +gUnknown_80FAAE8: @ 80FAAE8 + .incbin "baserom.gba", 0xFAAE8, 0x20 + + .global gUnknown_80FAB08 +gUnknown_80FAB08: @ 80FAB08 + .incbin "baserom.gba", 0xFAB08, 0x20 + + .global gUnknown_80FAB28 +gUnknown_80FAB28: @ 80FAB28 + .incbin "baserom.gba", 0xFAB28, 0x18 + + .global gUnknown_80FAB40 +gUnknown_80FAB40: @ 80FAB40 + .incbin "baserom.gba", 0xFAB40, 0x2C + + .global gUnknown_80FAB6C +gUnknown_80FAB6C: @ 80FAB6C + .incbin "baserom.gba", 0xFAB6C, 0x24 + + .global gUnknown_80FAB90 +gUnknown_80FAB90: @ 80FAB90 + .incbin "baserom.gba", 0xFAB90, 0x2C + + .global gUnknown_80FABBC +gUnknown_80FABBC: @ 80FABBC + .incbin "baserom.gba", 0xFABBC, 0x4 + + .global gUnknown_80FABC0 +gUnknown_80FABC0: @ 80FABC0 + .incbin "baserom.gba", 0xFABC0, 0x18 + + .global gUnknown_80FABD8 +gUnknown_80FABD8: @ 80FABD8 + .incbin "baserom.gba", 0xFABD8, 0x20 + + .global gUnknown_80FABF8 +gUnknown_80FABF8: @ 80FABF8 + .incbin "baserom.gba", 0xFABF8, 0x20 + + .global gUnknown_80FAC18 +gUnknown_80FAC18: @ 80FAC18 + .incbin "baserom.gba", 0xFAC18, 0x20 + + .global gUnknown_80FAC38 +gUnknown_80FAC38: @ 80FAC38 + .incbin "baserom.gba", 0xFAC38, 0x1C + + .global gUnknown_80FAC54 +gUnknown_80FAC54: @ 80FAC54 + .incbin "baserom.gba", 0xFAC54, 0x20 + + .global gUnknown_80FAC74 +gUnknown_80FAC74: @ 80FAC74 + .incbin "baserom.gba", 0xFAC74, 0x14 + + .global gUnknown_80FAC88 +gUnknown_80FAC88: @ 80FAC88 + .incbin "baserom.gba", 0xFAC88, 0x1C + + .global gUnknown_80FACA4 +gUnknown_80FACA4: @ 80FACA4 + .incbin "baserom.gba", 0xFACA4, 0x20 + + .global gUnknown_80FACC4 +gUnknown_80FACC4: @ 80FACC4 + .incbin "baserom.gba", 0xFACC4, 0x20 + + .global gUnknown_80FACE4 +gUnknown_80FACE4: @ 80FACE4 + .incbin "baserom.gba", 0xFACE4, 0x18 + + .global gUnknown_80FACFC +gUnknown_80FACFC: @ 80FACFC + .incbin "baserom.gba", 0xFACFC, 0x14 + + .global gUnknown_80FAD10 +gUnknown_80FAD10: @ 80FAD10 + .incbin "baserom.gba", 0xFAD10, 0x1C + + .global gUnknown_80FAD2C +gUnknown_80FAD2C: @ 80FAD2C + .incbin "baserom.gba", 0xFAD2C, 0x20 + + .global gUnknown_80FAD4C +gUnknown_80FAD4C: @ 80FAD4C + .incbin "baserom.gba", 0xFAD4C, 0x20 + + .global gUnknown_80FAD6C +gUnknown_80FAD6C: @ 80FAD6C + .incbin "baserom.gba", 0xFAD6C, 0x20 + + .global gUnknown_80FAD8C +gUnknown_80FAD8C: @ 80FAD8C + .incbin "baserom.gba", 0xFAD8C, 0x24 + + .global gUnknown_80FADB0 +gUnknown_80FADB0: @ 80FADB0 + .incbin "baserom.gba", 0xFADB0, 0x28 + + .global gUnknown_80FADD8 +gUnknown_80FADD8: @ 80FADD8 + .incbin "baserom.gba", 0xFADD8, 0x28 + + .global gUnknown_80FAE00 +gUnknown_80FAE00: @ 80FAE00 + .incbin "baserom.gba", 0xFAE00, 0x1C + + .global gUnknown_80FAE1C +gUnknown_80FAE1C: @ 80FAE1C + .incbin "baserom.gba", 0xFAE1C, 0x20 + + .global gUnknown_80FAE3C +gUnknown_80FAE3C: @ 80FAE3C + .incbin "baserom.gba", 0xFAE3C, 0x1C + + .global gUnknown_80FAE58 +gUnknown_80FAE58: @ 80FAE58 + .incbin "baserom.gba", 0xFAE58, 0x24 + + .global gUnknown_80FAE7C +gUnknown_80FAE7C: @ 80FAE7C + .incbin "baserom.gba", 0xFAE7C, 0x24 + + .global gUnknown_80FAEA0 +gUnknown_80FAEA0: @ 80FAEA0 + .incbin "baserom.gba", 0xFAEA0, 0x28 + + .global gUnknown_80FAEC8 +gUnknown_80FAEC8: @ 80FAEC8 + .incbin "baserom.gba", 0xFAEC8, 0x28 + + .global gUnknown_80FAEF0 +gUnknown_80FAEF0: @ 80FAEF0 + .incbin "baserom.gba", 0xFAEF0, 0x2C + + .global gUnknown_80FAF1C +gUnknown_80FAF1C: @ 80FAF1C + .incbin "baserom.gba", 0xFAF1C, 0x20 + + .global gUnknown_80FAF3C +gUnknown_80FAF3C: @ 80FAF3C + .incbin "baserom.gba", 0xFAF3C, 0x20 + + .global gUnknown_80FAF5C +gUnknown_80FAF5C: @ 80FAF5C + .incbin "baserom.gba", 0xFAF5C, 0x30 + + .global gUnknown_80FAF8C +gUnknown_80FAF8C: @ 80FAF8C + .incbin "baserom.gba", 0xFAF8C, 0x20 + + .global gUnknown_80FAFAC +gUnknown_80FAFAC: @ 80FAFAC + .incbin "baserom.gba", 0xFAFAC, 0x24 + + .global gUnknown_80FAFD0 +gUnknown_80FAFD0: @ 80FAFD0 + .incbin "baserom.gba", 0xFAFD0, 0x20 + + .global gUnknown_80FAFF0 +gUnknown_80FAFF0: @ 80FAFF0 + .incbin "baserom.gba", 0xFAFF0, 0x14 + + .global gUnknown_80FB004 +gUnknown_80FB004: @ 80FB004 + .incbin "baserom.gba", 0xFB004, 0x18 + + .global gUnknown_80FB01C +gUnknown_80FB01C: @ 80FB01C + .incbin "baserom.gba", 0xFB01C, 0x2C + + .global gUnknown_80FB048 +gUnknown_80FB048: @ 80FB048 + .incbin "baserom.gba", 0xFB048, 0x2C + + .global gUnknown_80FB074 +gUnknown_80FB074: @ 80FB074 + .incbin "baserom.gba", 0xFB074, 0x28 + + .global gUnknown_80FB09C +gUnknown_80FB09C: @ 80FB09C + .incbin "baserom.gba", 0xFB09C, 0x28 + + .global gUnknown_80FB0C4 +gUnknown_80FB0C4: @ 80FB0C4 + .incbin "baserom.gba", 0xFB0C4, 0x1C + + .global gUnknown_80FB0E0 +gUnknown_80FB0E0: @ 80FB0E0 + .incbin "baserom.gba", 0xFB0E0, 0x2C + + .global gUnknown_80FB10C +gUnknown_80FB10C: @ 80FB10C + .incbin "baserom.gba", 0xFB10C, 0x24 + + .global gUnknown_80FB130 +gUnknown_80FB130: @ 80FB130 + .incbin "baserom.gba", 0xFB130, 0x30 + + .global gUnknown_80FB160 +gUnknown_80FB160: @ 80FB160 + .incbin "baserom.gba", 0xFB160, 0x1C + + .global gUnknown_80FB17C +gUnknown_80FB17C: @ 80FB17C + .incbin "baserom.gba", 0xFB17C, 0x2C + + .global gUnknown_80FB1A8 +gUnknown_80FB1A8: @ 80FB1A8 + .incbin "baserom.gba", 0xFB1A8, 0x1C + + .global gUnknown_80FB1C4 +gUnknown_80FB1C4: @ 80FB1C4 + .incbin "baserom.gba", 0xFB1C4, 0x1C + + .global gUnknown_80FB1E0 +gUnknown_80FB1E0: @ 80FB1E0 + .incbin "baserom.gba", 0xFB1E0, 0x24 + + .global gUnknown_80FB204 +gUnknown_80FB204: @ 80FB204 + .incbin "baserom.gba", 0xFB204, 0x18 + + .global gUnknown_80FB21C +gUnknown_80FB21C: @ 80FB21C + .incbin "baserom.gba", 0xFB21C, 0x24 + + .global gUnknown_80FB240 +gUnknown_80FB240: @ 80FB240 + .incbin "baserom.gba", 0xFB240, 0x1C + + .global gUnknown_80FB25C +gUnknown_80FB25C: @ 80FB25C + .incbin "baserom.gba", 0xFB25C, 0x20 + + .global gUnknown_80FB27C +gUnknown_80FB27C: @ 80FB27C + .incbin "baserom.gba", 0xFB27C, 0x30 + + .global gUnknown_80FB2AC +gUnknown_80FB2AC: @ 80FB2AC + .incbin "baserom.gba", 0xFB2AC, 0x20 + + .global gUnknown_80FB2CC +gUnknown_80FB2CC: @ 80FB2CC + .incbin "baserom.gba", 0xFB2CC, 0x14 + + .global gUnknown_80FB2E0 +gUnknown_80FB2E0: @ 80FB2E0 + .incbin "baserom.gba", 0xFB2E0, 0x20 + + .global gUnknown_80FB300 +gUnknown_80FB300: @ 80FB300 + .incbin "baserom.gba", 0xFB300, 0x18 + + .global gUnknown_80FB318 +gUnknown_80FB318: @ 80FB318 + .incbin "baserom.gba", 0xFB318, 0x4 + + .global gUnknown_80FB31C +gUnknown_80FB31C: @ 80FB31C + .incbin "baserom.gba", 0xFB31C, 0x1C + + .global gUnknown_80FB338 +gUnknown_80FB338: @ 80FB338 + .incbin "baserom.gba", 0xFB338, 0x24 + + .global gUnknown_80FB35C +gUnknown_80FB35C: @ 80FB35C + .incbin "baserom.gba", 0xFB35C, 0x4 + + .global gUnknown_80FB360 +gUnknown_80FB360: @ 80FB360 + .incbin "baserom.gba", 0xFB360, 0x20 + + .global gUnknown_80FB380 +gUnknown_80FB380: @ 80FB380 + .incbin "baserom.gba", 0xFB380, 0x4 + + .global gUnknown_80FB384 +gUnknown_80FB384: @ 80FB384 + .incbin "baserom.gba", 0xFB384, 0x4 + + .global gUnknown_80FB388 +gUnknown_80FB388: @ 80FB388 + .incbin "baserom.gba", 0xFB388, 0x1C + + .global gUnknown_80FB3A4 +gUnknown_80FB3A4: @ 80FB3A4 + .incbin "baserom.gba", 0xFB3A4, 0x28 + + .global gUnknown_80FB3CC +gUnknown_80FB3CC: @ 80FB3CC + .incbin "baserom.gba", 0xFB3CC, 0x4 + + .global gUnknown_80FB3D0 +gUnknown_80FB3D0: @ 80FB3D0 + .incbin "baserom.gba", 0xFB3D0, 0x10 + + .global gUnknown_80FB3E0 +gUnknown_80FB3E0: @ 80FB3E0 + .incbin "baserom.gba", 0xFB3E0, 0x18 + + .global gUnknown_80FB3F8 +gUnknown_80FB3F8: @ 80FB3F8 + .incbin "baserom.gba", 0xFB3F8, 0x1C + + .global gUnknown_80FB414 +gUnknown_80FB414: @ 80FB414 + .incbin "baserom.gba", 0xFB414, 0x4 + + .global gUnknown_80FB418 +gUnknown_80FB418: @ 80FB418 + .incbin "baserom.gba", 0xFB418, 0x4 + + .global gUnknown_80FB41C +gUnknown_80FB41C: @ 80FB41C + .incbin "baserom.gba", 0xFB41C, 0x20 + + .global gUnknown_80FB43C +gUnknown_80FB43C: @ 80FB43C + .incbin "baserom.gba", 0xFB43C, 0x1C + + .global gUnknown_80FB458 +gUnknown_80FB458: @ 80FB458 + .incbin "baserom.gba", 0xFB458, 0x28 + + .global gUnknown_80FB480 +gUnknown_80FB480: @ 80FB480 + .incbin "baserom.gba", 0xFB480, 0x30 + + .global gUnknown_80FB4B0 +gUnknown_80FB4B0: @ 80FB4B0 + .incbin "baserom.gba", 0xFB4B0, 0x24 + + .global gUnknown_80FB4D4 +gUnknown_80FB4D4: @ 80FB4D4 + .incbin "baserom.gba", 0xFB4D4, 0x1C + + .global gUnknown_80FB4F0 +gUnknown_80FB4F0: @ 80FB4F0 + .incbin "baserom.gba", 0xFB4F0, 0x1C + + .global gUnknown_80FB50C +gUnknown_80FB50C: @ 80FB50C + .incbin "baserom.gba", 0xFB50C, 0x20 + + .global gUnknown_80FB52C +gUnknown_80FB52C: @ 80FB52C + .incbin "baserom.gba", 0xFB52C, 0x1C + + .global gUnknown_80FB548 +gUnknown_80FB548: @ 80FB548 + .incbin "baserom.gba", 0xFB548, 0x1C + + .global gUnknown_80FB564 +gUnknown_80FB564: @ 80FB564 + .incbin "baserom.gba", 0xFB564, 0x1C + + .global gUnknown_80FB580 +gUnknown_80FB580: @ 80FB580 + .incbin "baserom.gba", 0xFB580, 0x18 + + .global gUnknown_80FB598 +gUnknown_80FB598: @ 80FB598 + .incbin "baserom.gba", 0xFB598, 0x1C + + .global gUnknown_80FB5B4 +gUnknown_80FB5B4: @ 80FB5B4 + .incbin "baserom.gba", 0xFB5B4, 0x20 + + .global gUnknown_80FB5D4 +gUnknown_80FB5D4: @ 80FB5D4 + .incbin "baserom.gba", 0xFB5D4, 0x24 + + .global gUnknown_80FB5F8 +gUnknown_80FB5F8: @ 80FB5F8 + .incbin "baserom.gba", 0xFB5F8, 0x18 + + .global gUnknown_80FB610 +gUnknown_80FB610: @ 80FB610 + .incbin "baserom.gba", 0xFB610, 0x18 + + .global gUnknown_80FB628 +gUnknown_80FB628: @ 80FB628 + .incbin "baserom.gba", 0xFB628, 0x24 + + .global gUnknown_80FB64C +gUnknown_80FB64C: @ 80FB64C + .incbin "baserom.gba", 0xFB64C, 0x1C + + .global gUnknown_80FB668 +gUnknown_80FB668: @ 80FB668 + .incbin "baserom.gba", 0xFB668, 0x20 + + .global gUnknown_80FB688 +gUnknown_80FB688: @ 80FB688 + .incbin "baserom.gba", 0xFB688, 0x1C + + .global gUnknown_80FB6A4 +gUnknown_80FB6A4: @ 80FB6A4 + .incbin "baserom.gba", 0xFB6A4, 0x1C + + .global gUnknown_80FB6C0 +gUnknown_80FB6C0: @ 80FB6C0 + .incbin "baserom.gba", 0xFB6C0, 0x18 + + .global gUnknown_80FB6D8 +gUnknown_80FB6D8: @ 80FB6D8 + .incbin "baserom.gba", 0xFB6D8, 0x24 + + .global gUnknown_80FB6FC +gUnknown_80FB6FC: @ 80FB6FC + .incbin "baserom.gba", 0xFB6FC, 0x1C + + .global gUnknown_80FB718 +gUnknown_80FB718: @ 80FB718 + .incbin "baserom.gba", 0xFB718, 0x24 + + .global gUnknown_80FB73C +gUnknown_80FB73C: @ 80FB73C + .incbin "baserom.gba", 0xFB73C, 0x28 + + .global gUnknown_80FB764 +gUnknown_80FB764: @ 80FB764 + .incbin "baserom.gba", 0xFB764, 0x1C + + .global gUnknown_80FB780 +gUnknown_80FB780: @ 80FB780 + .incbin "baserom.gba", 0xFB780, 0x20 + + .global gUnknown_80FB7A0 +gUnknown_80FB7A0: @ 80FB7A0 + .incbin "baserom.gba", 0xFB7A0, 0x1C + + .global gUnknown_80FB7BC +gUnknown_80FB7BC: @ 80FB7BC + .incbin "baserom.gba", 0xFB7BC, 0x20 + + .global gUnknown_80FB7DC +gUnknown_80FB7DC: @ 80FB7DC + .incbin "baserom.gba", 0xFB7DC, 0x18 + + .global gUnknown_80FB7F4 +gUnknown_80FB7F4: @ 80FB7F4 + .incbin "baserom.gba", 0xFB7F4, 0x1C + + .global gUnknown_80FB810 +gUnknown_80FB810: @ 80FB810 + .incbin "baserom.gba", 0xFB810, 0x24 + + .global gUnknown_80FB834 +gUnknown_80FB834: @ 80FB834 + .incbin "baserom.gba", 0xFB834, 0x28 + + .global gUnknown_80FB85C +gUnknown_80FB85C: @ 80FB85C + .incbin "baserom.gba", 0xFB85C, 0x24 + + .global gUnknown_80FB880 +gUnknown_80FB880: @ 80FB880 + .incbin "baserom.gba", 0xFB880, 0x1C + + .global gUnknown_80FB89C +gUnknown_80FB89C: @ 80FB89C + .incbin "baserom.gba", 0xFB89C, 0x20 + + .global gUnknown_80FB8BC +gUnknown_80FB8BC: @ 80FB8BC + .incbin "baserom.gba", 0xFB8BC, 0x28 + + .global gUnknown_80FB8E4 +gUnknown_80FB8E4: @ 80FB8E4 + .incbin "baserom.gba", 0xFB8E4, 0x1C + + .global gUnknown_80FB900 +gUnknown_80FB900: @ 80FB900 + .incbin "baserom.gba", 0xFB900, 0x24 + + .global gUnknown_80FB924 +gUnknown_80FB924: @ 80FB924 + .incbin "baserom.gba", 0xFB924, 0x1C + + .global gUnknown_80FB940 +gUnknown_80FB940: @ 80FB940 + .incbin "baserom.gba", 0xFB940, 0x20 + + .global gUnknown_80FB960 +gUnknown_80FB960: @ 80FB960 + .incbin "baserom.gba", 0xFB960, 0x18 + + .global gUnknown_80FB978 +gUnknown_80FB978: @ 80FB978 + .incbin "baserom.gba", 0xFB978, 0x1C + + .global gUnknown_80FB994 +gUnknown_80FB994: @ 80FB994 + .incbin "baserom.gba", 0xFB994, 0x1C + + .global gUnknown_80FB9B0 +gUnknown_80FB9B0: @ 80FB9B0 + .incbin "baserom.gba", 0xFB9B0, 0x28 + + .global gUnknown_80FB9D8 +gUnknown_80FB9D8: @ 80FB9D8 + .incbin "baserom.gba", 0xFB9D8, 0x18 + + .global gUnknown_80FB9F0 +gUnknown_80FB9F0: @ 80FB9F0 + .incbin "baserom.gba", 0xFB9F0, 0x24 + + .global gUnknown_80FBA14 +gUnknown_80FBA14: @ 80FBA14 + .incbin "baserom.gba", 0xFBA14, 0x24 + + .global gUnknown_80FBA38 +gUnknown_80FBA38: @ 80FBA38 + .incbin "baserom.gba", 0xFBA38, 0x28 + + .global gUnknown_80FBA60 +gUnknown_80FBA60: @ 80FBA60 + .incbin "baserom.gba", 0xFBA60, 0x20 + + .global gUnknown_80FBA80 +gUnknown_80FBA80: @ 80FBA80 + .incbin "baserom.gba", 0xFBA80, 0x20 + + .global gUnknown_80FBAA0 +gUnknown_80FBAA0: @ 80FBAA0 + .incbin "baserom.gba", 0xFBAA0, 0x20 + + .global gUnknown_80FBAC0 +gUnknown_80FBAC0: @ 80FBAC0 + .incbin "baserom.gba", 0xFBAC0, 0x24 + + .global gUnknown_80FBAE4 +gUnknown_80FBAE4: @ 80FBAE4 + .incbin "baserom.gba", 0xFBAE4, 0x20 + + .global gUnknown_80FBB04 +gUnknown_80FBB04: @ 80FBB04 + .incbin "baserom.gba", 0xFBB04, 0x24 + + .global gUnknown_80FBB28 +gUnknown_80FBB28: @ 80FBB28 + .incbin "baserom.gba", 0xFBB28, 0x24 + + .global gUnknown_80FBB4C +gUnknown_80FBB4C: @ 80FBB4C + .incbin "baserom.gba", 0xFBB4C, 0x2C + + .global gUnknown_80FBB78 +gUnknown_80FBB78: @ 80FBB78 + .incbin "baserom.gba", 0xFBB78, 0x1C + + .global gUnknown_80FBB94 +gUnknown_80FBB94: @ 80FBB94 + .incbin "baserom.gba", 0xFBB94, 0x24 + + .global gUnknown_80FBBB8 +gUnknown_80FBBB8: @ 80FBBB8 + .incbin "baserom.gba", 0xFBBB8, 0x1C + + .global gUnknown_80FBBD4 +gUnknown_80FBBD4: @ 80FBBD4 + .incbin "baserom.gba", 0xFBBD4, 0x1C + + .global gUnknown_80FBBF0 +gUnknown_80FBBF0: @ 80FBBF0 + .incbin "baserom.gba", 0xFBBF0, 0x24 + + .global gUnknown_80FBC14 +gUnknown_80FBC14: @ 80FBC14 + .incbin "baserom.gba", 0xFBC14, 0x24 + + .global gUnknown_80FBC38 +gUnknown_80FBC38: @ 80FBC38 + .incbin "baserom.gba", 0xFBC38, 0x24 + + .global gUnknown_80FBC5C +gUnknown_80FBC5C: @ 80FBC5C + .incbin "baserom.gba", 0xFBC5C, 0x20 + + .global gUnknown_80FBC7C +gUnknown_80FBC7C: @ 80FBC7C + .incbin "baserom.gba", 0xFBC7C, 0x28 + + .global gUnknown_80FBCA4 +gUnknown_80FBCA4: @ 80FBCA4 + .incbin "baserom.gba", 0xFBCA4, 0x24 + + .global gUnknown_80FBCC8 +gUnknown_80FBCC8: @ 80FBCC8 + .incbin "baserom.gba", 0xFBCC8, 0x28 + + .global gUnknown_80FBCF0 +gUnknown_80FBCF0: @ 80FBCF0 + .incbin "baserom.gba", 0xFBCF0, 0x28 + + .global gUnknown_80FBD18 +gUnknown_80FBD18: @ 80FBD18 + .incbin "baserom.gba", 0xFBD18, 0x24 + + .global gUnknown_80FBD3C +gUnknown_80FBD3C: @ 80FBD3C + .incbin "baserom.gba", 0xFBD3C, 0x1C + + .global gUnknown_80FBD58 +gUnknown_80FBD58: @ 80FBD58 + .incbin "baserom.gba", 0xFBD58, 0x20 + + .global gUnknown_80FBD78 +gUnknown_80FBD78: @ 80FBD78 + .incbin "baserom.gba", 0xFBD78, 0x24 + + .global gUnknown_80FBD9C +gUnknown_80FBD9C: @ 80FBD9C + .incbin "baserom.gba", 0xFBD9C, 0x28 + + .global gUnknown_80FBDC4 +gUnknown_80FBDC4: @ 80FBDC4 + .incbin "baserom.gba", 0xFBDC4, 0x2C + + .global gUnknown_80FBDF0 +gUnknown_80FBDF0: @ 80FBDF0 + .incbin "baserom.gba", 0xFBDF0, 0x24 + + .global gUnknown_80FBE14 +gUnknown_80FBE14: @ 80FBE14 + .incbin "baserom.gba", 0xFBE14, 0x28 + + .global gUnknown_80FBE3C +gUnknown_80FBE3C: @ 80FBE3C + .incbin "baserom.gba", 0xFBE3C, 0x4 + + .global gUnknown_80FBE40 +gUnknown_80FBE40: @ 80FBE40 + .incbin "baserom.gba", 0xFBE40, 0x24 + + .global gUnknown_80FBE64 +gUnknown_80FBE64: @ 80FBE64 + .incbin "baserom.gba", 0xFBE64, 0x20 + + .global gUnknown_80FBE84 +gUnknown_80FBE84: @ 80FBE84 + .incbin "baserom.gba", 0xFBE84, 0x1C + + .global gUnknown_80FBEA0 +gUnknown_80FBEA0: @ 80FBEA0 + .incbin "baserom.gba", 0xFBEA0, 0x20 + + .global gUnknown_80FBEC0 +gUnknown_80FBEC0: @ 80FBEC0 + .incbin "baserom.gba", 0xFBEC0, 0x24 + + .global gUnknown_80FBEE4 +gUnknown_80FBEE4: @ 80FBEE4 + .incbin "baserom.gba", 0xFBEE4, 0x20 + + .global gUnknown_80FBF04 +gUnknown_80FBF04: @ 80FBF04 + .incbin "baserom.gba", 0xFBF04, 0x24 + + .global gUnknown_80FBF28 +gUnknown_80FBF28: @ 80FBF28 + .incbin "baserom.gba", 0xFBF28, 0x28 + + .global gUnknown_80FBF50 +gUnknown_80FBF50: @ 80FBF50 + .incbin "baserom.gba", 0xFBF50, 0x18 + + .global gUnknown_80FBF68 +gUnknown_80FBF68: @ 80FBF68 + .incbin "baserom.gba", 0xFBF68, 0x1C + + .global gUnknown_80FBF84 +gUnknown_80FBF84: @ 80FBF84 + .incbin "baserom.gba", 0xFBF84, 0x18 + + .global gUnknown_80FBF9C +gUnknown_80FBF9C: @ 80FBF9C + .incbin "baserom.gba", 0xFBF9C, 0x1C + + .global gUnknown_80FBFB8 +gUnknown_80FBFB8: @ 80FBFB8 + .incbin "baserom.gba", 0xFBFB8, 0x20 + + .global gUnknown_80FBFD8 +gUnknown_80FBFD8: @ 80FBFD8 + .incbin "baserom.gba", 0xFBFD8, 0x28 + + .global gUnknown_80FC000 +gUnknown_80FC000: @ 80FC000 + .incbin "baserom.gba", 0xFC000, 0x28 + + .global gUnknown_80FC028 +gUnknown_80FC028: @ 80FC028 + .incbin "baserom.gba", 0xFC028, 0x2C + + .global gUnknown_80FC054 +gUnknown_80FC054: @ 80FC054 + .incbin "baserom.gba", 0xFC054, 0x20 + + .global gUnknown_80FC074 +gUnknown_80FC074: @ 80FC074 + .incbin "baserom.gba", 0xFC074, 0x10 + + .global gUnknown_80FC084 +gUnknown_80FC084: @ 80FC084 + .incbin "baserom.gba", 0xFC084, 0xC + + .global gUnknown_80FC090 +gUnknown_80FC090: @ 80FC090 + .incbin "baserom.gba", 0xFC090, 0xC + + .global gUnknown_80FC09C +gUnknown_80FC09C: @ 80FC09C + .incbin "baserom.gba", 0xFC09C, 0x10 + + .global gUnknown_80FC0AC +gUnknown_80FC0AC: @ 80FC0AC + .incbin "baserom.gba", 0xFC0AC, 0xC + + .global gUnknown_80FC0B8 +gUnknown_80FC0B8: @ 80FC0B8 + .incbin "baserom.gba", 0xFC0B8, 0x10 + + .global gUnknown_80FC0C8 +gUnknown_80FC0C8: @ 80FC0C8 + .incbin "baserom.gba", 0xFC0C8, 0xC + + .global gUnknown_80FC0D4 +gUnknown_80FC0D4: @ 80FC0D4 + .incbin "baserom.gba", 0xFC0D4, 0x10 + + .global gUnknown_80FC0E4 +gUnknown_80FC0E4: @ 80FC0E4 + .incbin "baserom.gba", 0xFC0E4, 0x18 + + .global gUnknown_80FC0FC +gUnknown_80FC0FC: @ 80FC0FC + .incbin "baserom.gba", 0xFC0FC, 0x18 + + .global gUnknown_80FC114 +gUnknown_80FC114: @ 80FC114 + .incbin "baserom.gba", 0xFC114, 0x4 + + .global gUnknown_80FC118 +gUnknown_80FC118: @ 80FC118 + .incbin "baserom.gba", 0xFC118, 0x4 + + .global gUnknown_80FC11C +gUnknown_80FC11C: @ 80FC11C + .incbin "baserom.gba", 0xFC11C, 0x1C + + .global gUnknown_80FC138 +gUnknown_80FC138: @ 80FC138 + .incbin "baserom.gba", 0xFC138, 0x4 + + .global gUnknown_80FC13C +gUnknown_80FC13C: @ 80FC13C + .incbin "baserom.gba", 0xFC13C, 0x1C + + .global gUnknown_80FC158 +gUnknown_80FC158: @ 80FC158 + .incbin "baserom.gba", 0xFC158, 0x4 + + .global gUnknown_80FC15C +gUnknown_80FC15C: @ 80FC15C + .incbin "baserom.gba", 0xFC15C, 0x24 + + .global gUnknown_80FC180 +gUnknown_80FC180: @ 80FC180 + .incbin "baserom.gba", 0xFC180, 0x4 + + .global gUnknown_80FC184 +gUnknown_80FC184: @ 80FC184 + .incbin "baserom.gba", 0xFC184, 0x20 + + .global gUnknown_80FC1A4 +gUnknown_80FC1A4: @ 80FC1A4 + .incbin "baserom.gba", 0xFC1A4, 0x20 + + .global gUnknown_80FC1C4 +gUnknown_80FC1C4: @ 80FC1C4 + .incbin "baserom.gba", 0xFC1C4, 0x2C + + .global gUnknown_80FC1F0 +gUnknown_80FC1F0: @ 80FC1F0 + .incbin "baserom.gba", 0xFC1F0, 0x28 + + .global gUnknown_80FC218 +gUnknown_80FC218: @ 80FC218 + .incbin "baserom.gba", 0xFC218, 0x4 + + .global gUnknown_80FC21C +gUnknown_80FC21C: @ 80FC21C + .incbin "baserom.gba", 0xFC21C, 0x2C + + .global gUnknown_80FC248 +gUnknown_80FC248: @ 80FC248 + .incbin "baserom.gba", 0xFC248, 0x28 + + .global gUnknown_80FC270 +gUnknown_80FC270: @ 80FC270 + .incbin "baserom.gba", 0xFC270, 0x4 + + .global gUnknown_80FC274 +gUnknown_80FC274: @ 80FC274 + .incbin "baserom.gba", 0xFC274, 0x24 + + .global gUnknown_80FC298 +gUnknown_80FC298: @ 80FC298 + .incbin "baserom.gba", 0xFC298, 0x20 + + .global gUnknown_80FC2B8 +gUnknown_80FC2B8: @ 80FC2B8 + .incbin "baserom.gba", 0xFC2B8, 0x20 + + .global gUnknown_80FC2D8 +gUnknown_80FC2D8: @ 80FC2D8 + .incbin "baserom.gba", 0xFC2D8, 0x24 + + .global gUnknown_80FC2FC +gUnknown_80FC2FC: @ 80FC2FC + .incbin "baserom.gba", 0xFC2FC, 0x20 + + .global gUnknown_80FC31C +gUnknown_80FC31C: @ 80FC31C + .incbin "baserom.gba", 0xFC31C, 0x20 + + .global gUnknown_80FC33C +gUnknown_80FC33C: @ 80FC33C + .incbin "baserom.gba", 0xFC33C, 0x24 + + .global gUnknown_80FC360 +gUnknown_80FC360: @ 80FC360 + .incbin "baserom.gba", 0xFC360, 0x28 + + .global gUnknown_80FC388 +gUnknown_80FC388: @ 80FC388 + .incbin "baserom.gba", 0xFC388, 0x2C + + .global gUnknown_80FC3B4 +gUnknown_80FC3B4: @ 80FC3B4 + .incbin "baserom.gba", 0xFC3B4, 0x24 + + .global gUnknown_80FC3D8 +gUnknown_80FC3D8: @ 80FC3D8 + .incbin "baserom.gba", 0xFC3D8, 0x24 + + .global gUnknown_80FC3FC +gUnknown_80FC3FC: @ 80FC3FC + .incbin "baserom.gba", 0xFC3FC, 0x2C + + .global gUnknown_80FC428 +gUnknown_80FC428: @ 80FC428 + .incbin "baserom.gba", 0xFC428, 0x2C + + .global gUnknown_80FC454 +gUnknown_80FC454: @ 80FC454 + .incbin "baserom.gba", 0xFC454, 0xD8 + + .global gUnknown_80FC52C +gUnknown_80FC52C: @ 80FC52C + .incbin "baserom.gba", 0xFC52C, 0x2C + + .global gUnknown_80FC558 +gUnknown_80FC558: @ 80FC558 + .incbin "baserom.gba", 0xFC558, 0x1C + + .global gUnknown_80FC574 +gUnknown_80FC574: @ 80FC574 + .incbin "baserom.gba", 0xFC574, 0x10 + + .global gUnknown_80FC584 +gUnknown_80FC584: @ 80FC584 + .incbin "baserom.gba", 0xFC584, 0x24 + + .global gUnknown_80FC5A8 +gUnknown_80FC5A8: @ 80FC5A8 + .incbin "baserom.gba", 0xFC5A8, 0x24 + + .global gUnknown_80FC5CC +gUnknown_80FC5CC: @ 80FC5CC + .incbin "baserom.gba", 0xFC5CC, 0x14 + + .global gUnknown_80FC5E0 +gUnknown_80FC5E0: @ 80FC5E0 + .incbin "baserom.gba", 0xFC5E0, 0x18 + + .global gUnknown_80FC5F8 +gUnknown_80FC5F8: @ 80FC5F8 + .incbin "baserom.gba", 0xFC5F8, 0x4 + + .global gUnknown_80FC5FC +gUnknown_80FC5FC: @ 80FC5FC + .incbin "baserom.gba", 0xFC5FC, 0x18 + + .global gUnknown_80FC614 +gUnknown_80FC614: @ 80FC614 + .incbin "baserom.gba", 0xFC614, 0x40 + + .global gUnknown_80FC654 +gUnknown_80FC654: @ 80FC654 + .incbin "baserom.gba", 0xFC654, 0x24 + + .global gUnknown_80FC678 +gUnknown_80FC678: @ 80FC678 + .incbin "baserom.gba", 0xFC678, 0x18 + + .global gUnknown_80FC690 +gUnknown_80FC690: @ 80FC690 + .incbin "baserom.gba", 0xFC690, 0x14 + + .global gUnknown_80FC6A4 +gUnknown_80FC6A4: @ 80FC6A4 + .incbin "baserom.gba", 0xFC6A4, 0x4 + + .global gUnknown_80FC6A8 +gUnknown_80FC6A8: @ 80FC6A8 + .incbin "baserom.gba", 0xFC6A8, 0x28 + + .global gUnknown_80FC6D0 +gUnknown_80FC6D0: @ 80FC6D0 + .incbin "baserom.gba", 0xFC6D0, 0x2C + + .global gUnknown_80FC6FC +gUnknown_80FC6FC: @ 80FC6FC + .incbin "baserom.gba", 0xFC6FC, 0x14 + + .global gUnknown_80FC710 +gUnknown_80FC710: @ 80FC710 + .incbin "baserom.gba", 0xFC710, 0x4 + + .global gUnknown_80FC714 +gUnknown_80FC714: @ 80FC714 + .incbin "baserom.gba", 0xFC714, 0x4 + + .global gUnknown_80FC718 +gUnknown_80FC718: @ 80FC718 + .incbin "baserom.gba", 0xFC718, 0x14 + + .global gUnknown_80FC72C +gUnknown_80FC72C: @ 80FC72C + .incbin "baserom.gba", 0xFC72C, 0x4 + + .global gUnknown_80FC730 +gUnknown_80FC730: @ 80FC730 + .incbin "baserom.gba", 0xFC730, 0x4 + + .global gUnknown_80FC734 +gUnknown_80FC734: @ 80FC734 + .incbin "baserom.gba", 0xFC734, 0x18 + + .global gUnknown_80FC74C +gUnknown_80FC74C: @ 80FC74C + .incbin "baserom.gba", 0xFC74C, 0x24 + + .global gUnknown_80FC770 +gUnknown_80FC770: @ 80FC770 + .incbin "baserom.gba", 0xFC770, 0x20 + + .global gUnknown_80FC790 +gUnknown_80FC790: @ 80FC790 + .incbin "baserom.gba", 0xFC790, 0x1C + + .global gUnknown_80FC7AC +gUnknown_80FC7AC: @ 80FC7AC + .incbin "baserom.gba", 0xFC7AC, 0x1C + + .global gUnknown_80FC7C8 +gUnknown_80FC7C8: @ 80FC7C8 + .incbin "baserom.gba", 0xFC7C8, 0x24 + + .global gUnknown_80FC7EC +gUnknown_80FC7EC: @ 80FC7EC + .incbin "baserom.gba", 0xFC7EC, 0x30 + + .global gUnknown_80FC81C +gUnknown_80FC81C: @ 80FC81C + .incbin "baserom.gba", 0xFC81C, 0x38 + + .global gUnknown_80FC854 +gUnknown_80FC854: @ 80FC854 + .incbin "baserom.gba", 0xFC854, 0x34 + + .global gUnknown_80FC888 +gUnknown_80FC888: @ 80FC888 + .incbin "baserom.gba", 0xFC888, 0x38 + + .global gUnknown_80FC8C0 +gUnknown_80FC8C0: @ 80FC8C0 + .incbin "baserom.gba", 0xFC8C0, 0x30 + + .global gUnknown_80FC8F0 +gUnknown_80FC8F0: @ 80FC8F0 + .incbin "baserom.gba", 0xFC8F0, 0x30 + + .global gUnknown_80FC920 +gUnknown_80FC920: @ 80FC920 + .incbin "baserom.gba", 0xFC920, 0x5C + + .global gUnknown_80FC97C +gUnknown_80FC97C: @ 80FC97C + .incbin "baserom.gba", 0xFC97C, 0x24 + + .global gUnknown_80FC9A0 +gUnknown_80FC9A0: @ 80FC9A0 + .incbin "baserom.gba", 0xFC9A0, 0x20 + + .global gUnknown_80FC9C0 +gUnknown_80FC9C0: @ 80FC9C0 + .incbin "baserom.gba", 0xFC9C0, 0x28 + + .global gUnknown_80FC9E8 +gUnknown_80FC9E8: @ 80FC9E8 + .incbin "baserom.gba", 0xFC9E8, 0x28 + + .global gUnknown_80FCA10 +gUnknown_80FCA10: @ 80FCA10 + .incbin "baserom.gba", 0xFCA10, 0x2C + + .global gUnknown_80FCA3C +gUnknown_80FCA3C: @ 80FCA3C + .incbin "baserom.gba", 0xFCA3C, 0x24 + + .global gUnknown_80FCA60 +gUnknown_80FCA60: @ 80FCA60 + .incbin "baserom.gba", 0xFCA60, 0x4 + + .global gUnknown_80FCA64 +gUnknown_80FCA64: @ 80FCA64 + .incbin "baserom.gba", 0xFCA64, 0x2C + + .global gUnknown_80FCA90 +gUnknown_80FCA90: @ 80FCA90 + .incbin "baserom.gba", 0xFCA90, 0x30 + + .global gUnknown_80FCAC0 +gUnknown_80FCAC0: @ 80FCAC0 + .incbin "baserom.gba", 0xFCAC0, 0x28 + + .global gUnknown_80FCAE8 +gUnknown_80FCAE8: @ 80FCAE8 + .incbin "baserom.gba", 0xFCAE8, 0x2C + + .global gUnknown_80FCB14 +gUnknown_80FCB14: @ 80FCB14 + .incbin "baserom.gba", 0xFCB14, 0x2C + + .global gUnknown_80FCB40 +gUnknown_80FCB40: @ 80FCB40 + .incbin "baserom.gba", 0xFCB40, 0x30 + + .global gUnknown_80FCB70 +gUnknown_80FCB70: @ 80FCB70 + .incbin "baserom.gba", 0xFCB70, 0x28 + + .global gUnknown_80FCB98 +gUnknown_80FCB98: @ 80FCB98 + .incbin "baserom.gba", 0xFCB98, 0x34 + + .global gUnknown_80FCBCC +gUnknown_80FCBCC: @ 80FCBCC + .incbin "baserom.gba", 0xFCBCC, 0x2C + + .global gUnknown_80FCBF8 +gUnknown_80FCBF8: @ 80FCBF8 + .incbin "baserom.gba", 0xFCBF8, 0x20 + + .global gUnknown_80FCC18 +gUnknown_80FCC18: @ 80FCC18 + .incbin "baserom.gba", 0xFCC18, 0x34 + + .global gUnknown_80FCC4C +gUnknown_80FCC4C: @ 80FCC4C + .incbin "baserom.gba", 0xFCC4C, 0x30 + + .global gUnknown_80FCC7C +gUnknown_80FCC7C: @ 80FCC7C + .incbin "baserom.gba", 0xFCC7C, 0x30 + + .global gUnknown_80FCCAC +gUnknown_80FCCAC: @ 80FCCAC + .incbin "baserom.gba", 0xFCCAC, 0x38 + + .global gUnknown_80FCCE4 +gUnknown_80FCCE4: @ 80FCCE4 + .incbin "baserom.gba", 0xFCCE4, 0x4 + + .global gUnknown_80FCCE8 +gUnknown_80FCCE8: @ 80FCCE8 + .incbin "baserom.gba", 0xFCCE8, 0x24 + + .global gUnknown_80FCD0C +gUnknown_80FCD0C: @ 80FCD0C + .incbin "baserom.gba", 0xFCD0C, 0x1C + + .global gUnknown_80FCD28 +gUnknown_80FCD28: @ 80FCD28 + .incbin "baserom.gba", 0xFCD28, 0x2C + + .global gUnknown_80FCD54 +gUnknown_80FCD54: @ 80FCD54 + .incbin "baserom.gba", 0xFCD54, 0x4 + + .global gUnknown_80FCD58 +gUnknown_80FCD58: @ 80FCD58 + .incbin "baserom.gba", 0xFCD58, 0x30 + + .global gUnknown_80FCD88 +gUnknown_80FCD88: @ 80FCD88 + .incbin "baserom.gba", 0xFCD88, 0x2C + + .global gUnknown_80FCDB4 +gUnknown_80FCDB4: @ 80FCDB4 + .incbin "baserom.gba", 0xFCDB4, 0x2C + + .global gUnknown_80FCDE0 +gUnknown_80FCDE0: @ 80FCDE0 + .incbin "baserom.gba", 0xFCDE0, 0x20 + + .global gUnknown_80FCE00 +gUnknown_80FCE00: @ 80FCE00 + .incbin "baserom.gba", 0xFCE00, 0x34 + + .global gUnknown_80FCE34 +gUnknown_80FCE34: @ 80FCE34 + .incbin "baserom.gba", 0xFCE34, 0x28 + + .global gUnknown_80FCE5C +gUnknown_80FCE5C: @ 80FCE5C + .incbin "baserom.gba", 0xFCE5C, 0x28 + + .global gUnknown_80FCE84 +gUnknown_80FCE84: @ 80FCE84 + .incbin "baserom.gba", 0xFCE84, 0x2C + + .global gUnknown_80FCEB0 +gUnknown_80FCEB0: @ 80FCEB0 + .incbin "baserom.gba", 0xFCEB0, 0x2C + + .global gUnknown_80FCEDC +gUnknown_80FCEDC: @ 80FCEDC + .incbin "baserom.gba", 0xFCEDC, 0x20 + + .global gUnknown_80FCEFC +gUnknown_80FCEFC: @ 80FCEFC + .incbin "baserom.gba", 0xFCEFC, 0x1C + + .global gUnknown_80FCF18 +gUnknown_80FCF18: @ 80FCF18 + .incbin "baserom.gba", 0xFCF18, 0x20 + + .global gUnknown_80FCF38 +gUnknown_80FCF38: @ 80FCF38 + .incbin "baserom.gba", 0xFCF38, 0x18 + + .global gUnknown_80FCF50 +gUnknown_80FCF50: @ 80FCF50 + .incbin "baserom.gba", 0xFCF50, 0x24 + + .global gUnknown_80FCF74 +gUnknown_80FCF74: @ 80FCF74 + .incbin "baserom.gba", 0xFCF74, 0x4 + + .global gUnknown_80FCF78 +gUnknown_80FCF78: @ 80FCF78 + .incbin "baserom.gba", 0xFCF78, 0x4 + + .global gUnknown_80FCF7C +gUnknown_80FCF7C: @ 80FCF7C + .incbin "baserom.gba", 0xFCF7C, 0x4 + + .global gUnknown_80FCF80 +gUnknown_80FCF80: @ 80FCF80 + .incbin "baserom.gba", 0xFCF80, 0x24 + + .global gUnknown_80FCFA4 +gUnknown_80FCFA4: @ 80FCFA4 + .incbin "baserom.gba", 0xFCFA4, 0x18 + + .global gUnknown_80FCFBC +gUnknown_80FCFBC: @ 80FCFBC + .incbin "baserom.gba", 0xFCFBC, 0x28 + + .global gUnknown_80FCFE4 +gUnknown_80FCFE4: @ 80FCFE4 + .incbin "baserom.gba", 0xFCFE4, 0x34 + + .global gUnknown_80FD018 +gUnknown_80FD018: @ 80FD018 + .incbin "baserom.gba", 0xFD018, 0x28 + + .global gUnknown_80FD040 +gUnknown_80FD040: @ 80FD040 + .incbin "baserom.gba", 0xFD040, 0x1C + + .global gUnknown_80FD05C +gUnknown_80FD05C: @ 80FD05C + .incbin "baserom.gba", 0xFD05C, 0x4 + + .global gUnknown_80FD060 +gUnknown_80FD060: @ 80FD060 + .incbin "baserom.gba", 0xFD060, 0x2C + + .global gUnknown_80FD08C +gUnknown_80FD08C: @ 80FD08C + .incbin "baserom.gba", 0xFD08C, 0x28 + + .global gUnknown_80FD0B4 +gUnknown_80FD0B4: @ 80FD0B4 + .incbin "baserom.gba", 0xFD0B4, 0x4 + + .global gUnknown_80FD0B8 +gUnknown_80FD0B8: @ 80FD0B8 + .incbin "baserom.gba", 0xFD0B8, 0x4C + + .global gUnknown_80FD104 +gUnknown_80FD104: @ 80FD104 + .incbin "baserom.gba", 0xFD104, 0x24 + + .global gUnknown_80FD128 +gUnknown_80FD128: @ 80FD128 + .incbin "baserom.gba", 0xFD128, 0x24 + + .global gUnknown_80FD14C +gUnknown_80FD14C: @ 80FD14C + .incbin "baserom.gba", 0xFD14C, 0x24 + + .global gUnknown_80FD170 +gUnknown_80FD170: @ 80FD170 + .incbin "baserom.gba", 0xFD170, 0x1C + + .global gUnknown_80FD18C +gUnknown_80FD18C: @ 80FD18C + .incbin "baserom.gba", 0xFD18C, 0x24 + + .global gUnknown_80FD1B0 +gUnknown_80FD1B0: @ 80FD1B0 + .incbin "baserom.gba", 0xFD1B0, 0x1C + + .global gUnknown_80FD1CC +gUnknown_80FD1CC: @ 80FD1CC + .incbin "baserom.gba", 0xFD1CC, 0x20 + + .global gUnknown_80FD1EC +gUnknown_80FD1EC: @ 80FD1EC + .incbin "baserom.gba", 0xFD1EC, 0x20 + + .global gUnknown_80FD20C +gUnknown_80FD20C: @ 80FD20C + .incbin "baserom.gba", 0xFD20C, 0x20 + + .global gUnknown_80FD22C +gUnknown_80FD22C: @ 80FD22C + .incbin "baserom.gba", 0xFD22C, 0x28 + + .global gUnknown_80FD254 +gUnknown_80FD254: @ 80FD254 + .incbin "baserom.gba", 0xFD254, 0x28 + + .global gUnknown_80FD27C +gUnknown_80FD27C: @ 80FD27C + .incbin "baserom.gba", 0xFD27C, 0x18 + + .global gUnknown_80FD294 +gUnknown_80FD294: @ 80FD294 + .incbin "baserom.gba", 0xFD294, 0x20 + + .global gUnknown_80FD2B4 +gUnknown_80FD2B4: @ 80FD2B4 + .incbin "baserom.gba", 0xFD2B4, 0x18 + + .global gUnknown_80FD2CC +gUnknown_80FD2CC: @ 80FD2CC + .incbin "baserom.gba", 0xFD2CC, 0x10 + + .global gUnknown_80FD2DC +gUnknown_80FD2DC: @ 80FD2DC + .incbin "baserom.gba", 0xFD2DC, 0x1C + + .global gUnknown_80FD2F8 +gUnknown_80FD2F8: @ 80FD2F8 + .incbin "baserom.gba", 0xFD2F8, 0x28 + + .global gUnknown_80FD320 +gUnknown_80FD320: @ 80FD320 + .incbin "baserom.gba", 0xFD320, 0x30 + + .global gUnknown_80FD350 +gUnknown_80FD350: @ 80FD350 + .incbin "baserom.gba", 0xFD350, 0x20 + + .global gUnknown_80FD370 +gUnknown_80FD370: @ 80FD370 + .incbin "baserom.gba", 0xFD370, 0x30 + + .global gUnknown_80FD3A0 +gUnknown_80FD3A0: @ 80FD3A0 + .incbin "baserom.gba", 0xFD3A0, 0x28 + + .global gUnknown_80FD3C8 +gUnknown_80FD3C8: @ 80FD3C8 + .incbin "baserom.gba", 0xFD3C8, 0x4 + + .global gUnknown_80FD3CC +gUnknown_80FD3CC: @ 80FD3CC + .incbin "baserom.gba", 0xFD3CC, 0x4 + + .global gUnknown_80FD3D0 +gUnknown_80FD3D0: @ 80FD3D0 + .incbin "baserom.gba", 0xFD3D0, 0x20 + + .global gUnknown_80FD3F0 +gUnknown_80FD3F0: @ 80FD3F0 + .incbin "baserom.gba", 0xFD3F0, 0x1C + + .global gUnknown_80FD40C +gUnknown_80FD40C: @ 80FD40C + .incbin "baserom.gba", 0xFD40C, 0x24 + + .global gUnknown_80FD430 +gUnknown_80FD430: @ 80FD430 + .incbin "baserom.gba", 0xFD430, 0x4 + + .global gUnknown_80FD434 +gUnknown_80FD434: @ 80FD434 + .incbin "baserom.gba", 0xFD434, 0x1C + + .global gUnknown_80FD450 +gUnknown_80FD450: @ 80FD450 + .incbin "baserom.gba", 0xFD450, 0x4 + + .global gUnknown_80FD454 +gUnknown_80FD454: @ 80FD454 + .incbin "baserom.gba", 0xFD454, 0x18 + + .global gUnknown_80FD46C +gUnknown_80FD46C: @ 80FD46C + .incbin "baserom.gba", 0xFD46C, 0x18 + + .global gUnknown_80FD484 +gUnknown_80FD484: @ 80FD484 + .incbin "baserom.gba", 0xFD484, 0x2C + + .global gUnknown_80FD4B0 +gUnknown_80FD4B0: @ 80FD4B0 + .incbin "baserom.gba", 0xFD4B0, 0x14 + + .global gUnknown_80FD4C4 +gUnknown_80FD4C4: @ 80FD4C4 + .incbin "baserom.gba", 0xFD4C4, 0x18 + + .global gUnknown_80FD4DC +gUnknown_80FD4DC: @ 80FD4DC + .incbin "baserom.gba", 0xFD4DC, 0x24 + + .global gUnknown_80FD500 +gUnknown_80FD500: @ 80FD500 + .incbin "baserom.gba", 0xFD500, 0x24 + + .global gUnknown_80FD524 +gUnknown_80FD524: @ 80FD524 + .incbin "baserom.gba", 0xFD524, 0x24 + + .global gUnknown_80FD548 +gUnknown_80FD548: @ 80FD548 + .incbin "baserom.gba", 0xFD548, 0x8 + + .global gUnknown_80FD550 +gUnknown_80FD550: @ 80FD550 + .incbin "baserom.gba", 0xFD550, 0x24 + + .global gUnknown_80FD574 +gUnknown_80FD574: @ 80FD574 + .incbin "baserom.gba", 0xFD574, 0x4 + + .global gUnknown_80FD578 +gUnknown_80FD578: @ 80FD578 + .incbin "baserom.gba", 0xFD578, 0x4 + + .global gUnknown_80FD57C +gUnknown_80FD57C: @ 80FD57C + .incbin "baserom.gba", 0xFD57C, 0x18 + + .global gUnknown_80FD594 +gUnknown_80FD594: @ 80FD594 + .incbin "baserom.gba", 0xFD594, 0x24 + + .global gUnknown_80FD5B8 +gUnknown_80FD5B8: @ 80FD5B8 + .incbin "baserom.gba", 0xFD5B8, 0x24 + + .global gUnknown_80FD5DC +gUnknown_80FD5DC: @ 80FD5DC + .incbin "baserom.gba", 0xFD5DC, 0x2C + + .global gUnknown_80FD608 +gUnknown_80FD608: @ 80FD608 + .incbin "baserom.gba", 0xFD608, 0x20 + + .global gUnknown_80FD628 +gUnknown_80FD628: @ 80FD628 + .incbin "baserom.gba", 0xFD628, 0x1C + + .global gUnknown_80FD644 +gUnknown_80FD644: @ 80FD644 + .incbin "baserom.gba", 0xFD644, 0x4 + + .global gUnknown_80FD648 +gUnknown_80FD648: @ 80FD648 + .incbin "baserom.gba", 0xFD648, 0xA0 + + .global gUnknown_80FD6E8 +gUnknown_80FD6E8: @ 80FD6E8 + .incbin "baserom.gba", 0xFD6E8, 0xA0 + + .global gUnknown_80FD788 +gUnknown_80FD788: @ 80FD788 + .incbin "baserom.gba", 0xFD788, 0x24 + + .global gUnknown_80FD7AC +gUnknown_80FD7AC: @ 80FD7AC + .incbin "baserom.gba", 0xFD7AC, 0x28 + + .global gUnknown_80FD7D4 +gUnknown_80FD7D4: @ 80FD7D4 + .incbin "baserom.gba", 0xFD7D4, 0x20 + + .global gUnknown_80FD7F4 +gUnknown_80FD7F4: @ 80FD7F4 + .incbin "baserom.gba", 0xFD7F4, 0x4 + + .global gUnknown_80FD7F8 +gUnknown_80FD7F8: @ 80FD7F8 + .incbin "baserom.gba", 0xFD7F8, 0x288 + + .global gUnknown_80FDA80 +gUnknown_80FDA80: @ 80FDA80 + .incbin "baserom.gba", 0xFDA80, 0x20 + + .global gUnknown_80FDAA0 +gUnknown_80FDAA0: @ 80FDAA0 + .incbin "baserom.gba", 0xFDAA0, 0x2C + + .global gUnknown_80FDACC +gUnknown_80FDACC: @ 80FDACC + .incbin "baserom.gba", 0xFDACC, 0x18 + + .global gUnknown_80FDAE4 +gUnknown_80FDAE4: @ 80FDAE4 + .incbin "baserom.gba", 0xFDAE4, 0x20 + + .global gUnknown_80FDB04 +gUnknown_80FDB04: @ 80FDB04 + .incbin "baserom.gba", 0xFDB04, 0x28 + + .global gUnknown_80FDB2C +gUnknown_80FDB2C: @ 80FDB2C + .incbin "baserom.gba", 0xFDB2C, 0x30 + + .global gUnknown_80FDB5C +gUnknown_80FDB5C: @ 80FDB5C + .incbin "baserom.gba", 0xFDB5C, 0x20 + + .global gUnknown_80FDB7C +gUnknown_80FDB7C: @ 80FDB7C + .incbin "baserom.gba", 0xFDB7C, 0x24 + + .global gUnknown_80FDBA0 +gUnknown_80FDBA0: @ 80FDBA0 + .incbin "baserom.gba", 0xFDBA0, 0x18 + + .global gUnknown_80FDBB8 +gUnknown_80FDBB8: @ 80FDBB8 + .incbin "baserom.gba", 0xFDBB8, 0x18 + + .global gUnknown_80FDBD0 +gUnknown_80FDBD0: @ 80FDBD0 + .incbin "baserom.gba", 0xFDBD0, 0x20 + + .global gUnknown_80FDBF0 +gUnknown_80FDBF0: @ 80FDBF0 + .incbin "baserom.gba", 0xFDBF0, 0x28 + + .global gUnknown_80FDC18 +gUnknown_80FDC18: @ 80FDC18 + .incbin "baserom.gba", 0xFDC18, 0x28 + + .global gUnknown_80FDC40 +gUnknown_80FDC40: @ 80FDC40 + .incbin "baserom.gba", 0xFDC40, 0x3C + + .global gUnknown_80FDC7C +gUnknown_80FDC7C: @ 80FDC7C + .incbin "baserom.gba", 0xFDC7C, 0x20 + + .global gUnknown_80FDC9C +gUnknown_80FDC9C: @ 80FDC9C + .incbin "baserom.gba", 0xFDC9C, 0x4 + + .global gUnknown_80FDCA0 +gUnknown_80FDCA0: @ 80FDCA0 + .incbin "baserom.gba", 0xFDCA0, 0x4 + + .global gUnknown_80FDCA4 +gUnknown_80FDCA4: @ 80FDCA4 + .incbin "baserom.gba", 0xFDCA4, 0x24 + + .global gUnknown_80FDCC8 +gUnknown_80FDCC8: @ 80FDCC8 + .incbin "baserom.gba", 0xFDCC8, 0x1C + + .global gUnknown_80FDCE4 +gUnknown_80FDCE4: @ 80FDCE4 + .incbin "baserom.gba", 0xFDCE4, 0x1C + + .global gUnknown_80FDD00 +gUnknown_80FDD00: @ 80FDD00 + .incbin "baserom.gba", 0xFDD00, 0x20 + + .global gUnknown_80FDD20 +gUnknown_80FDD20: @ 80FDD20 + .incbin "baserom.gba", 0xFDD20, 0x28 + + .global gUnknown_80FDD48 +gUnknown_80FDD48: @ 80FDD48 + .incbin "baserom.gba", 0xFDD48, 0x40 + + .global gUnknown_80FDD88 +gUnknown_80FDD88: @ 80FDD88 + .incbin "baserom.gba", 0xFDD88, 0x20 + + .global gUnknown_80FDDA8 +gUnknown_80FDDA8: @ 80FDDA8 + .incbin "baserom.gba", 0xFDDA8, 0x4 + + .global gUnknown_80FDDAC +gUnknown_80FDDAC: @ 80FDDAC + .incbin "baserom.gba", 0xFDDAC, 0x24 + + .global gUnknown_80FDDD0 +gUnknown_80FDDD0: @ 80FDDD0 + .incbin "baserom.gba", 0xFDDD0, 0x20 + + .global gUnknown_80FDDF0 +gUnknown_80FDDF0: @ 80FDDF0 + .incbin "baserom.gba", 0xFDDF0, 0x28 + + .global gUnknown_80FDE18 +gUnknown_80FDE18: @ 80FDE18 + .incbin "baserom.gba", 0xFDE18, 0x54 + + .global gUnknown_80FDE6C +gUnknown_80FDE6C: @ 80FDE6C + .incbin "baserom.gba", 0xFDE6C, 0x4C + + .global gUnknown_80FDEB8 +gUnknown_80FDEB8: @ 80FDEB8 + .incbin "baserom.gba", 0xFDEB8, 0x48 + + .global gUnknown_80FDF00 +gUnknown_80FDF00: @ 80FDF00 + .incbin "baserom.gba", 0xFDF00, 0x40 + + .global gUnknown_80FDF40 +gUnknown_80FDF40: @ 80FDF40 + .incbin "baserom.gba", 0xFDF40, 0x30 + + .global gUnknown_80FDF70 +gUnknown_80FDF70: @ 80FDF70 + .incbin "baserom.gba", 0xFDF70, 0x48 + + .global gUnknown_80FDFB8 +gUnknown_80FDFB8: @ 80FDFB8 + .incbin "baserom.gba", 0xFDFB8, 0x30 + + .global gUnknown_80FDFE8 +gUnknown_80FDFE8: @ 80FDFE8 + .incbin "baserom.gba", 0xFDFE8, 0x20 + + .global gUnknown_80FE008 +gUnknown_80FE008: @ 80FE008 + .incbin "baserom.gba", 0xFE008, 0x2C + + .global gUnknown_80FE034 +gUnknown_80FE034: @ 80FE034 + .incbin "baserom.gba", 0xFE034, 0x2C + + .global gUnknown_80FE060 +gUnknown_80FE060: @ 80FE060 + .incbin "baserom.gba", 0xFE060, 0x4C + + .global gUnknown_80FE0AC +gUnknown_80FE0AC: @ 80FE0AC + .incbin "baserom.gba", 0xFE0AC, 0x48 + + .global gUnknown_80FE0F4 +gUnknown_80FE0F4: @ 80FE0F4 + .incbin "baserom.gba", 0xFE0F4, 0x4 + + .global gUnknown_80FE0F8 +gUnknown_80FE0F8: @ 80FE0F8 + .incbin "baserom.gba", 0xFE0F8, 0x3C + + .global gUnknown_80FE134 +gUnknown_80FE134: @ 80FE134 + .incbin "baserom.gba", 0xFE134, 0x34 + + .global gUnknown_80FE168 +gUnknown_80FE168: @ 80FE168 + .incbin "baserom.gba", 0xFE168, 0x3C + + .global gUnknown_80FE1A4 +gUnknown_80FE1A4: @ 80FE1A4 + .incbin "baserom.gba", 0xFE1A4, 0x68 + + .global gUnknown_80FE20C +gUnknown_80FE20C: @ 80FE20C + .incbin "baserom.gba", 0xFE20C, 0x5C + + .global gUnknown_80FE268 +gUnknown_80FE268: @ 80FE268 + .incbin "baserom.gba", 0xFE268, 0x24 + + .global gUnknown_80FE28C +gUnknown_80FE28C: @ 80FE28C + .incbin "baserom.gba", 0xFE28C, 0x44 + + .global gUnknown_80FE2D0 +gUnknown_80FE2D0: @ 80FE2D0 + .incbin "baserom.gba", 0xFE2D0, 0x1C + + .global gUnknown_80FE2EC +gUnknown_80FE2EC: @ 80FE2EC + .incbin "baserom.gba", 0xFE2EC, 0x1C + + .global gUnknown_80FE308 +gUnknown_80FE308: @ 80FE308 + .incbin "baserom.gba", 0xFE308, 0x28 + + .global gUnknown_80FE330 +gUnknown_80FE330: @ 80FE330 + .incbin "baserom.gba", 0xFE330, 0x3C + + .global gUnknown_80FE36C +gUnknown_80FE36C: @ 80FE36C + .incbin "baserom.gba", 0xFE36C, 0x20 + + .global gUnknown_80FE38C +gUnknown_80FE38C: @ 80FE38C + .incbin "baserom.gba", 0xFE38C, 0x30 + + .global gUnknown_80FE3BC +gUnknown_80FE3BC: @ 80FE3BC + .incbin "baserom.gba", 0xFE3BC, 0x2C + + .global gUnknown_80FE3E8 +gUnknown_80FE3E8: @ 80FE3E8 + .incbin "baserom.gba", 0xFE3E8, 0x24 + + .global gUnknown_80FE40C +gUnknown_80FE40C: @ 80FE40C + .incbin "baserom.gba", 0xFE40C, 0x28 + + .global gUnknown_80FE434 +gUnknown_80FE434: @ 80FE434 + .incbin "baserom.gba", 0xFE434, 0x20 + + .global gUnknown_80FE454 +gUnknown_80FE454: @ 80FE454 + .incbin "baserom.gba", 0xFE454, 0x4 + + .global gUnknown_80FE458 +gUnknown_80FE458: @ 80FE458 + .incbin "baserom.gba", 0xFE458, 0x20 + + .global gUnknown_80FE478 +gUnknown_80FE478: @ 80FE478 + .incbin "baserom.gba", 0xFE478, 0x40 + + .global gUnknown_80FE4B8 +gUnknown_80FE4B8: @ 80FE4B8 + .incbin "baserom.gba", 0xFE4B8, 0x1C + + .global gUnknown_80FE4D4 +gUnknown_80FE4D4: @ 80FE4D4 + .incbin "baserom.gba", 0xFE4D4, 0x20 + + .global gUnknown_80FE4F4 +gUnknown_80FE4F4: @ 80FE4F4 + .incbin "baserom.gba", 0xFE4F4, 0x2C + + .global gUnknown_80FE520 +gUnknown_80FE520: @ 80FE520 + .incbin "baserom.gba", 0xFE520, 0x48 + + .global gUnknown_80FE568 +gUnknown_80FE568: @ 80FE568 + .incbin "baserom.gba", 0xFE568, 0x58 + + .global gUnknown_80FE5C0 +gUnknown_80FE5C0: @ 80FE5C0 + .incbin "baserom.gba", 0xFE5C0, 0x30 + + .global gUnknown_80FE5F0 +gUnknown_80FE5F0: @ 80FE5F0 + .incbin "baserom.gba", 0xFE5F0, 0x4C + + .global gUnknown_80FE63C +gUnknown_80FE63C: @ 80FE63C + .incbin "baserom.gba", 0xFE63C, 0x20 + + .global gUnknown_80FE65C +gUnknown_80FE65C: @ 80FE65C + .incbin "baserom.gba", 0xFE65C, 0x18 + + .global gUnknown_80FE674 +gUnknown_80FE674: @ 80FE674 + .incbin "baserom.gba", 0xFE674, 0x1C + + .global gUnknown_80FE690 +gUnknown_80FE690: @ 80FE690 + .incbin "baserom.gba", 0xFE690, 0x24 + + .global gUnknown_80FE6B4 +gUnknown_80FE6B4: @ 80FE6B4 + .incbin "baserom.gba", 0xFE6B4, 0x20 + + .global gUnknown_80FE6D4 +gUnknown_80FE6D4: @ 80FE6D4 + .incbin "baserom.gba", 0xFE6D4, 0x14 + + .global gUnknown_80FE6E8 +gUnknown_80FE6E8: @ 80FE6E8 + .incbin "baserom.gba", 0xFE6E8, 0xC + + .global gUnknown_80FE6F4 +gUnknown_80FE6F4: @ 80FE6F4 + .incbin "baserom.gba", 0xFE6F4, 0x14 + + .global gUnknown_80FE708 +gUnknown_80FE708: @ 80FE708 + .incbin "baserom.gba", 0xFE708, 0x4 + + .global gUnknown_80FE70C +gUnknown_80FE70C: @ 80FE70C + .incbin "baserom.gba", 0xFE70C, 0x14 + + .global gUnknown_80FE720 +gUnknown_80FE720: @ 80FE720 + .incbin "baserom.gba", 0xFE720, 0x4 + + .global gUnknown_80FE724 +gUnknown_80FE724: @ 80FE724 + .incbin "baserom.gba", 0xFE724, 0xC + + .global gUnknown_80FE730 +gUnknown_80FE730: @ 80FE730 + .incbin "baserom.gba", 0xFE730, 0xC + + .global gUnknown_80FE73C +gUnknown_80FE73C: @ 80FE73C + .incbin "baserom.gba", 0xFE73C, 0xC + + .global gUnknown_80FE748 +gUnknown_80FE748: @ 80FE748 + .incbin "baserom.gba", 0xFE748, 0x1C + + .global gUnknown_80FE764 +gUnknown_80FE764: @ 80FE764 + .incbin "baserom.gba", 0xFE764, 0x24 + + .global gUnknown_80FE788 +gUnknown_80FE788: @ 80FE788 + .incbin "baserom.gba", 0xFE788, 0x20 + + .global gUnknown_80FE7A8 +gUnknown_80FE7A8: @ 80FE7A8 + .incbin "baserom.gba", 0xFE7A8, 0x18 + + .global gUnknown_80FE7C0 +gUnknown_80FE7C0: @ 80FE7C0 + .incbin "baserom.gba", 0xFE7C0, 0x24 + + .global gUnknown_80FE7E4 +gUnknown_80FE7E4: @ 80FE7E4 + .incbin "baserom.gba", 0xFE7E4, 0x24 + + .global gUnknown_80FE808 +gUnknown_80FE808: @ 80FE808 + .incbin "baserom.gba", 0xFE808, 0xE8 + + .global gUnknown_80FE8F0 +gUnknown_80FE8F0: @ 80FE8F0 + .incbin "baserom.gba", 0xFE8F0, 0x4 + + .global gUnknown_80FE8F4 +gUnknown_80FE8F4: @ 80FE8F4 + .incbin "baserom.gba", 0xFE8F4, 0x4 + + .global gUnknown_80FE8F8 +gUnknown_80FE8F8: @ 80FE8F8 + .incbin "baserom.gba", 0xFE8F8, 0x14 + + .global gUnknown_80FE90C +gUnknown_80FE90C: @ 80FE90C + .incbin "baserom.gba", 0xFE90C, 0x14 + + .global gUnknown_80FE920 +gUnknown_80FE920: @ 80FE920 + .incbin "baserom.gba", 0xFE920, 0xC + + .global gUnknown_80FE92C +gUnknown_80FE92C: @ 80FE92C + .incbin "baserom.gba", 0xFE92C, 0x14 + + .global gUnknown_80FE940 +gUnknown_80FE940: @ 80FE940 + .incbin "baserom.gba", 0xFE940, 0xC + + .global gUnknown_80FE94C +gUnknown_80FE94C: @ 80FE94C + .incbin "baserom.gba", 0xFE94C, 0x4 + + .global gUnknown_80FE950 +gUnknown_80FE950: @ 80FE950 + .incbin "baserom.gba", 0xFE950, 0x4 + + .global gUnknown_80FE954 +gUnknown_80FE954: @ 80FE954 + .incbin "baserom.gba", 0xFE954, 0x8 + + .global gUnknown_80FE95C +gUnknown_80FE95C: @ 80FE95C + .incbin "baserom.gba", 0xFE95C, 0x4 + + .global gUnknown_80FE960 +gUnknown_80FE960: @ 80FE960 + .incbin "baserom.gba", 0xFE960, 0x4 + + .global gUnknown_80FE964 +gUnknown_80FE964: @ 80FE964 + .incbin "baserom.gba", 0xFE964, 0x14 + + .global gUnknown_80FE978 +gUnknown_80FE978: @ 80FE978 + .incbin "baserom.gba", 0xFE978, 0x10 + + .global gUnknown_80FE988 +gUnknown_80FE988: @ 80FE988 + .incbin "baserom.gba", 0xFE988, 0x10 + + .global gUnknown_80FE998 +gUnknown_80FE998: @ 80FE998 + .incbin "baserom.gba", 0xFE998, 0x10 + + .global gUnknown_80FE9A8 +gUnknown_80FE9A8: @ 80FE9A8 + .incbin "baserom.gba", 0xFE9A8, 0x10 + + .global gUnknown_80FE9B8 +gUnknown_80FE9B8: @ 80FE9B8 + .incbin "baserom.gba", 0xFE9B8, 0x10 + + .global gUnknown_80FE9C8 +gUnknown_80FE9C8: @ 80FE9C8 + .incbin "baserom.gba", 0xFE9C8, 0x4 + + .global gUnknown_80FE9CC +gUnknown_80FE9CC: @ 80FE9CC + .incbin "baserom.gba", 0xFE9CC, 0x1C + + .global gUnknown_80FE9E8 +gUnknown_80FE9E8: @ 80FE9E8 + .incbin "baserom.gba", 0xFE9E8, 0x10 + + .global gUnknown_80FE9F8 +gUnknown_80FE9F8: @ 80FE9F8 + .incbin "baserom.gba", 0xFE9F8, 0x18 + + .global gUnknown_80FEA10 +gUnknown_80FEA10: @ 80FEA10 + .incbin "baserom.gba", 0xFEA10, 0x18 + + .global gUnknown_80FEA28 +gUnknown_80FEA28: @ 80FEA28 + .incbin "baserom.gba", 0xFEA28, 0x1C + + .global gUnknown_80FEA44 +gUnknown_80FEA44: @ 80FEA44 + .incbin "baserom.gba", 0xFEA44, 0xC + + .global gUnknown_80FEA50 +gUnknown_80FEA50: @ 80FEA50 + .incbin "baserom.gba", 0xFEA50, 0x18 + + .global gUnknown_80FEA68 +gUnknown_80FEA68: @ 80FEA68 + .incbin "baserom.gba", 0xFEA68, 0x18 + + .global gUnknown_80FEA80 +gUnknown_80FEA80: @ 80FEA80 + .incbin "baserom.gba", 0xFEA80, 0xC + + .global gUnknown_80FEA8C +gUnknown_80FEA8C: @ 80FEA8C + .incbin "baserom.gba", 0xFEA8C, 0x38 + + .global gUnknown_80FEAC4 +gUnknown_80FEAC4: @ 80FEAC4 + .incbin "baserom.gba", 0xFEAC4, 0x24 + + .global gUnknown_80FEAE8 +gUnknown_80FEAE8: @ 80FEAE8 + .incbin "baserom.gba", 0xFEAE8, 0x20 + + .global gUnknown_80FEB08 +gUnknown_80FEB08: @ 80FEB08 + .incbin "baserom.gba", 0xFEB08, 0x28 + + .global gUnknown_80FEB30 +gUnknown_80FEB30: @ 80FEB30 + .incbin "baserom.gba", 0xFEB30, 0x30 + + .global gUnknown_80FEB60 +gUnknown_80FEB60: @ 80FEB60 + .incbin "baserom.gba", 0xFEB60, 0x28 + + .global gUnknown_80FEB88 +gUnknown_80FEB88: @ 80FEB88 + .incbin "baserom.gba", 0xFEB88, 0x4 + + .global gUnknown_80FEB8C +gUnknown_80FEB8C: @ 80FEB8C + .incbin "baserom.gba", 0xFEB8C, 0x4 + + .global gUnknown_80FEB90 +gUnknown_80FEB90: @ 80FEB90 + .incbin "baserom.gba", 0xFEB90, 0x2C + + .global gUnknown_80FEBBC +gUnknown_80FEBBC: @ 80FEBBC + .incbin "baserom.gba", 0xFEBBC, 0x20 + + .global gUnknown_80FEBDC +gUnknown_80FEBDC: @ 80FEBDC + .incbin "baserom.gba", 0xFEBDC, 0x1C + + .global gUnknown_80FEBF8 +gUnknown_80FEBF8: @ 80FEBF8 + .incbin "baserom.gba", 0xFEBF8, 0x30 + + .global gUnknown_80FEC28 +gUnknown_80FEC28: @ 80FEC28 + .incbin "baserom.gba", 0xFEC28, 0x20 + + .global gUnknown_80FEC48 +gUnknown_80FEC48: @ 80FEC48 + .incbin "baserom.gba", 0xFEC48, 0x34 + + .global gUnknown_80FEC7C +gUnknown_80FEC7C: @ 80FEC7C + .incbin "baserom.gba", 0xFEC7C, 0x24 + + .global gUnknown_80FECA0 +gUnknown_80FECA0: @ 80FECA0 + .incbin "baserom.gba", 0xFECA0, 0x1C + + .global gUnknown_80FECBC +gUnknown_80FECBC: @ 80FECBC + .incbin "baserom.gba", 0xFECBC, 0x24 + + .global gUnknown_80FECE0 +gUnknown_80FECE0: @ 80FECE0 + .incbin "baserom.gba", 0xFECE0, 0x20 + + .global gUnknown_80FED00 +gUnknown_80FED00: @ 80FED00 + .incbin "baserom.gba", 0xFED00, 0x4 + + .global gUnknown_80FED04 +gUnknown_80FED04: @ 80FED04 + .incbin "baserom.gba", 0xFED04, 0x4 + + .global gUnknown_80FED08 +gUnknown_80FED08: @ 80FED08 + .incbin "baserom.gba", 0xFED08, 0x4 + + .global gUnknown_80FED0C +gUnknown_80FED0C: @ 80FED0C + .incbin "baserom.gba", 0xFED0C, 0x24 + + .global gUnknown_80FED30 +gUnknown_80FED30: @ 80FED30 + .incbin "baserom.gba", 0xFED30, 0x38 + + .global gUnknown_80FED68 +gUnknown_80FED68: @ 80FED68 + .incbin "baserom.gba", 0xFED68, 0x20 + + .global gUnknown_80FED88 +gUnknown_80FED88: @ 80FED88 + .incbin "baserom.gba", 0xFED88, 0x20 + + .global gUnknown_80FEDA8 +gUnknown_80FEDA8: @ 80FEDA8 + .incbin "baserom.gba", 0xFEDA8, 0x20 + + .global gUnknown_80FEDC8 +gUnknown_80FEDC8: @ 80FEDC8 + .incbin "baserom.gba", 0xFEDC8, 0x20 + + .global gUnknown_80FEDE8 +gUnknown_80FEDE8: @ 80FEDE8 + .incbin "baserom.gba", 0xFEDE8, 0x1C + + .global gUnknown_80FEE04 +gUnknown_80FEE04: @ 80FEE04 + .incbin "baserom.gba", 0xFEE04, 0x28 + + .global gUnknown_80FEE2C +gUnknown_80FEE2C: @ 80FEE2C + .incbin "baserom.gba", 0xFEE2C, 0x28 + + .global gUnknown_80FEE54 +gUnknown_80FEE54: @ 80FEE54 + .incbin "baserom.gba", 0xFEE54, 0x2C + + .global gUnknown_80FEE80 +gUnknown_80FEE80: @ 80FEE80 + .incbin "baserom.gba", 0xFEE80, 0x24 + + .global gUnknown_80FEEA4 +gUnknown_80FEEA4: @ 80FEEA4 + .incbin "baserom.gba", 0xFEEA4, 0x24 + + .global gUnknown_80FEEC8 +gUnknown_80FEEC8: @ 80FEEC8 + .incbin "baserom.gba", 0xFEEC8, 0x24 + + .global gUnknown_80FEEEC +gUnknown_80FEEEC: @ 80FEEEC + .incbin "baserom.gba", 0xFEEEC, 0x20 + + .global gUnknown_80FEF0C +gUnknown_80FEF0C: @ 80FEF0C + .incbin "baserom.gba", 0xFEF0C, 0x24 + + .global gUnknown_80FEF30 +gUnknown_80FEF30: @ 80FEF30 + .incbin "baserom.gba", 0xFEF30, 0x1C + + .global gUnknown_80FEF4C +gUnknown_80FEF4C: @ 80FEF4C + .incbin "baserom.gba", 0xFEF4C, 0x4 + + .global gUnknown_80FEF50 +gUnknown_80FEF50: @ 80FEF50 + .incbin "baserom.gba", 0xFEF50, 0x4 + + .global gUnknown_80FEF54 +gUnknown_80FEF54: @ 80FEF54 + .incbin "baserom.gba", 0xFEF54, 0x20 + + .global gUnknown_80FEF74 +gUnknown_80FEF74: @ 80FEF74 + .incbin "baserom.gba", 0xFEF74, 0x24 + + .global gUnknown_80FEF98 +gUnknown_80FEF98: @ 80FEF98 + .incbin "baserom.gba", 0xFEF98, 0x38 + + .global gUnknown_80FEFD0 +gUnknown_80FEFD0: @ 80FEFD0 + .incbin "baserom.gba", 0xFEFD0, 0x24 + + .global gUnknown_80FEFF4 +gUnknown_80FEFF4: @ 80FEFF4 + .incbin "baserom.gba", 0xFEFF4, 0x28 + + .global gUnknown_80FF01C +gUnknown_80FF01C: @ 80FF01C + .incbin "baserom.gba", 0xFF01C, 0x4 + + .global gUnknown_80FF020 +gUnknown_80FF020: @ 80FF020 + .incbin "baserom.gba", 0xFF020, 0x60 + + .global gUnknown_80FF080 +gUnknown_80FF080: @ 80FF080 + .incbin "baserom.gba", 0xFF080, 0x58 + + .global gUnknown_80FF0D8 +gUnknown_80FF0D8: @ 80FF0D8 + .incbin "baserom.gba", 0xFF0D8, 0x64 + + .global gUnknown_80FF13C +gUnknown_80FF13C: @ 80FF13C + .incbin "baserom.gba", 0xFF13C, 0x78 + + .global gUnknown_80FF1B4 +gUnknown_80FF1B4: @ 80FF1B4 + .incbin "baserom.gba", 0xFF1B4, 0x78 + + .global gUnknown_80FF22C +gUnknown_80FF22C: @ 80FF22C + .incbin "baserom.gba", 0xFF22C, 0x64 + + .global gUnknown_80FF290 +gUnknown_80FF290: @ 80FF290 + .incbin "baserom.gba", 0xFF290, 0x80 + + .global gUnknown_80FF310 +gUnknown_80FF310: @ 80FF310 + .incbin "baserom.gba", 0xFF310, 0x84 + + .global gUnknown_80FF394 +gUnknown_80FF394: @ 80FF394 + .incbin "baserom.gba", 0xFF394, 0x54 + + .global gUnknown_80FF3E8 +gUnknown_80FF3E8: @ 80FF3E8 + .incbin "baserom.gba", 0xFF3E8, 0x58 + + .global gUnknown_80FF440 +gUnknown_80FF440: @ 80FF440 + .incbin "baserom.gba", 0xFF440, 0x60 + + .global gUnknown_80FF4A0 +gUnknown_80FF4A0: @ 80FF4A0 + .incbin "baserom.gba", 0xFF4A0, 0x78 + + .global gUnknown_80FF518 +gUnknown_80FF518: @ 80FF518 + .incbin "baserom.gba", 0xFF518, 0x64 + + .global gUnknown_80FF57C +gUnknown_80FF57C: @ 80FF57C + .incbin "baserom.gba", 0xFF57C, 0x6C + + .global gUnknown_80FF5E8 +gUnknown_80FF5E8: @ 80FF5E8 + .incbin "baserom.gba", 0xFF5E8, 0x8C + + .global gUnknown_80FF674 +gUnknown_80FF674: @ 80FF674 + .incbin "baserom.gba", 0xFF674, 0x4 + + .global gUnknown_80FF678 +gUnknown_80FF678: @ 80FF678 + .incbin "baserom.gba", 0xFF678, 0x2C + + .global gUnknown_80FF6A4 +gUnknown_80FF6A4: @ 80FF6A4 + .incbin "baserom.gba", 0xFF6A4, 0x54 + + .global gUnknown_80FF6F8 +gUnknown_80FF6F8: @ 80FF6F8 + .incbin "baserom.gba", 0xFF6F8, 0x38 + + .global gUnknown_80FF730 +gUnknown_80FF730: @ 80FF730 + .incbin "baserom.gba", 0xFF730, 0x3C + + .global gUnknown_80FF76C +gUnknown_80FF76C: @ 80FF76C + .incbin "baserom.gba", 0xFF76C, 0x4 + + .global gUnknown_80FF770 +gUnknown_80FF770: @ 80FF770 + .incbin "baserom.gba", 0xFF770, 0x4 + + .global gUnknown_80FF774 +gUnknown_80FF774: @ 80FF774 + .incbin "baserom.gba", 0xFF774, 0x78 + + .global gUnknown_80FF7EC +gUnknown_80FF7EC: @ 80FF7EC + .incbin "baserom.gba", 0xFF7EC, 0xA1C + + .global gUnknown_8100208 +gUnknown_8100208: @ 8100208 + .incbin "baserom.gba", 0x100208, 0x1C + + .global gUnknown_8100224 +gUnknown_8100224: @ 8100224 + .incbin "baserom.gba", 0x100224, 0x28 + + .global gUnknown_810024C +gUnknown_810024C: @ 810024C + .incbin "baserom.gba", 0x10024C, 0x24 + + .global gUnknown_8100270 +gUnknown_8100270: @ 8100270 + .incbin "baserom.gba", 0x100270, 0x28 + + .global gUnknown_8100298 +gUnknown_8100298: @ 8100298 + .incbin "baserom.gba", 0x100298, 0x20 + + .global gUnknown_81002B8 +gUnknown_81002B8: @ 81002B8 + .incbin "baserom.gba", 0x1002B8, 0x20 + + .global gUnknown_81002D8 +gUnknown_81002D8: @ 81002D8 + .incbin "baserom.gba", 0x1002D8, 0x24 + + .global gUnknown_81002FC +gUnknown_81002FC: @ 81002FC + .incbin "baserom.gba", 0x1002FC, 0x60 + + .global gUnknown_810035C +gUnknown_810035C: @ 810035C + .incbin "baserom.gba", 0x10035C, 0x60 + + .global gUnknown_81003BC +gUnknown_81003BC: @ 81003BC + .incbin "baserom.gba", 0x1003BC, 0x24 + + .global gUnknown_81003E0 +gUnknown_81003E0: @ 81003E0 + .incbin "baserom.gba", 0x1003E0, 0x24 + + .global gUnknown_8100404 +gUnknown_8100404: @ 8100404 + .incbin "baserom.gba", 0x100404, 0x24 + + .global gUnknown_8100428 +gUnknown_8100428: @ 8100428 + .incbin "baserom.gba", 0x100428, 0x24 + + .global gUnknown_810044C +gUnknown_810044C: @ 810044C + .incbin "baserom.gba", 0x10044C, 0x48 + + .global gUnknown_8100494 +gUnknown_8100494: @ 8100494 + .incbin "baserom.gba", 0x100494, 0x30 + + .global gUnknown_81004C4 +gUnknown_81004C4: @ 81004C4 + .incbin "baserom.gba", 0x1004C4, 0x20 + + .global gUnknown_81004E4 +gUnknown_81004E4: @ 81004E4 + .incbin "baserom.gba", 0x1004E4, 0x4 + + .global gUnknown_81004E8 +gUnknown_81004E8: @ 81004E8 + .incbin "baserom.gba", 0x1004E8, 0x4 + + .global gUnknown_81004EC +gUnknown_81004EC: @ 81004EC + .incbin "baserom.gba", 0x1004EC, 0x4 + + .global gUnknown_81004F0 +gUnknown_81004F0: @ 81004F0 + .incbin "baserom.gba", 0x1004F0, 0x34 + + .global gUnknown_8100524 +gUnknown_8100524: @ 8100524 + .incbin "baserom.gba", 0x100524, 0x24 + + .global gUnknown_8100548 +gUnknown_8100548: @ 8100548 + .incbin "baserom.gba", 0x100548, 0x24 + + .global gUnknown_810056C +gUnknown_810056C: @ 810056C + .incbin "baserom.gba", 0x10056C, 0x28 + + .global gUnknown_8100594 +gUnknown_8100594: @ 8100594 + .incbin "baserom.gba", 0x100594, 0x24 + + .global gUnknown_81005B8 +gUnknown_81005B8: @ 81005B8 + .incbin "baserom.gba", 0x1005B8, 0x24 + + .global gUnknown_81005DC +gUnknown_81005DC: @ 81005DC + .incbin "baserom.gba", 0x1005DC, 0x34 + + .global gUnknown_8100610 +gUnknown_8100610: @ 8100610 + .incbin "baserom.gba", 0x100610, 0x30 + + .global gUnknown_8100640 +gUnknown_8100640: @ 8100640 + .incbin "baserom.gba", 0x100640, 0x20 + + .global gUnknown_8100660 +gUnknown_8100660: @ 8100660 + .incbin "baserom.gba", 0x100660, 0x44 + + .global gUnknown_81006A4 +gUnknown_81006A4: @ 81006A4 + .incbin "baserom.gba", 0x1006A4, 0x28 + + .global gUnknown_81006CC +gUnknown_81006CC: @ 81006CC + .incbin "baserom.gba", 0x1006CC, 0x2C + + .global gUnknown_81006F8 +gUnknown_81006F8: @ 81006F8 + .incbin "baserom.gba", 0x1006F8, 0x28 + + .global gUnknown_8100720 +gUnknown_8100720: @ 8100720 + .incbin "baserom.gba", 0x100720, 0x20 + + .global gUnknown_8100740 +gUnknown_8100740: @ 8100740 + .incbin "baserom.gba", 0x100740, 0x1C + + .global gUnknown_810075C +gUnknown_810075C: @ 810075C + .incbin "baserom.gba", 0x10075C, 0xC + + .global gUnknown_8100768 +gUnknown_8100768: @ 8100768 + .incbin "baserom.gba", 0x100768, 0x30 + + .global gUnknown_8100798 +gUnknown_8100798: @ 8100798 + .incbin "baserom.gba", 0x100798, 0x88 + + .global gUnknown_8100820 +gUnknown_8100820: @ 8100820 + .incbin "baserom.gba", 0x100820, 0x24 + + .global gUnknown_8100844 +gUnknown_8100844: @ 8100844 + .incbin "baserom.gba", 0x100844, 0x3C + + .global gUnknown_8100880 +gUnknown_8100880: @ 8100880 + .incbin "baserom.gba", 0x100880, 0xA8 + + .global gUnknown_8100928 +gUnknown_8100928: @ 8100928 + .incbin "baserom.gba", 0x100928, 0xDC + + .global gUnknown_8100A04 +gUnknown_8100A04: @ 8100A04 + .incbin "baserom.gba", 0x100A04, 0x17C + + .global gUnknown_8100B80 +gUnknown_8100B80: @ 8100B80 + .incbin "baserom.gba", 0x100B80, 0x40 + + .global gUnknown_8100BC0 +gUnknown_8100BC0: @ 8100BC0 + .incbin "baserom.gba", 0x100BC0, 0xD0 + + .global gUnknown_8100C90 +gUnknown_8100C90: @ 8100C90 + .incbin "baserom.gba", 0x100C90, 0x2C + + .global gUnknown_8100CBC +gUnknown_8100CBC: @ 8100CBC + .incbin "baserom.gba", 0x100CBC, 0x20 + + .global gUnknown_8100CDC +gUnknown_8100CDC: @ 8100CDC + .incbin "baserom.gba", 0x100CDC, 0x60 + + .global gUnknown_8100D3C +gUnknown_8100D3C: @ 8100D3C + .incbin "baserom.gba", 0x100D3C, 0x74 + + .global gUnknown_8100DB0 +gUnknown_8100DB0: @ 8100DB0 + .incbin "baserom.gba", 0x100DB0, 0xB4 + + .global gUnknown_8100E64 +gUnknown_8100E64: @ 8100E64 + .incbin "baserom.gba", 0x100E64, 0x24 + + .global gUnknown_8100E88 +gUnknown_8100E88: @ 8100E88 + .incbin "baserom.gba", 0x100E88, 0x8C + + .global gUnknown_8100F14 +gUnknown_8100F14: @ 8100F14 + .incbin "baserom.gba", 0x100F14, 0xF0 + + .global gUnknown_8101004 +gUnknown_8101004: @ 8101004 + .incbin "baserom.gba", 0x101004, 0x4C + + .global gUnknown_8101050 +gUnknown_8101050: @ 8101050 + .incbin "baserom.gba", 0x101050, 0x80 + + .global gUnknown_81010D0 +gUnknown_81010D0: @ 81010D0 + .incbin "baserom.gba", 0x1010D0, 0x94 + + .global gUnknown_8101164 +gUnknown_8101164: @ 8101164 + .incbin "baserom.gba", 0x101164, 0xDC + + .global gUnknown_8101240 +gUnknown_8101240: @ 8101240 + .incbin "baserom.gba", 0x101240, 0xD0 + + .global gUnknown_8101310 +gUnknown_8101310: @ 8101310 + .incbin "baserom.gba", 0x101310, 0x6C + + .global gUnknown_810137C +gUnknown_810137C: @ 810137C + .incbin "baserom.gba", 0x10137C, 0x8C + + .global gUnknown_8101408 +gUnknown_8101408: @ 8101408 + .incbin "baserom.gba", 0x101408, 0x38 + + .global gUnknown_8101440 +gUnknown_8101440: @ 8101440 + .incbin "baserom.gba", 0x101440, 0x70 + + .global gUnknown_81014B0 +gUnknown_81014B0: @ 81014B0 + .incbin "baserom.gba", 0x1014B0, 0x54 + + .global gUnknown_8101504 +gUnknown_8101504: @ 8101504 + .incbin "baserom.gba", 0x101504, 0x9C + + .global gUnknown_81015A0 +gUnknown_81015A0: @ 81015A0 + .incbin "baserom.gba", 0x1015A0, 0x34 + + .global gUnknown_81015D4 +gUnknown_81015D4: @ 81015D4 + .incbin "baserom.gba", 0x1015D4, 0x14 + + .global gUnknown_81015E8 +gUnknown_81015E8: @ 81015E8 + .incbin "baserom.gba", 0x1015E8, 0x3C + + .global gUnknown_8101624 +gUnknown_8101624: @ 8101624 + .incbin "baserom.gba", 0x101624, 0x38 + + .global gUnknown_810165C +gUnknown_810165C: @ 810165C + .incbin "baserom.gba", 0x10165C, 0xF4 + + .global gUnknown_8101750 +gUnknown_8101750: @ 8101750 + .incbin "baserom.gba", 0x101750, 0x3C + + .global gUnknown_810178C +gUnknown_810178C: @ 810178C + .incbin "baserom.gba", 0x10178C, 0x28 + + .global gUnknown_81017B4 +gUnknown_81017B4: @ 81017B4 + .incbin "baserom.gba", 0x1017B4, 0x30 + + .global gUnknown_81017E4 +gUnknown_81017E4: @ 81017E4 + .incbin "baserom.gba", 0x1017E4, 0xB4 + + .global gUnknown_8101898 +gUnknown_8101898: @ 8101898 + .incbin "baserom.gba", 0x101898, 0x54 + + .global gUnknown_81018EC +gUnknown_81018EC: @ 81018EC + .incbin "baserom.gba", 0x1018EC, 0x2C + + .global gUnknown_8101918 +gUnknown_8101918: @ 8101918 + .incbin "baserom.gba", 0x101918, 0x24 + + .global gUnknown_810193C +gUnknown_810193C: @ 810193C + .incbin "baserom.gba", 0x10193C, 0x34 + + .global gUnknown_8101970 +gUnknown_8101970: @ 8101970 + .incbin "baserom.gba", 0x101970, 0x24 + + .global gUnknown_8101994 +gUnknown_8101994: @ 8101994 + .incbin "baserom.gba", 0x101994, 0x50 + + .global gUnknown_81019E4 +gUnknown_81019E4: @ 81019E4 + .incbin "baserom.gba", 0x1019E4, 0x20 + + .global gUnknown_8101A04 +gUnknown_8101A04: @ 8101A04 + .incbin "baserom.gba", 0x101A04, 0x34 + + .global gUnknown_8101A38 +gUnknown_8101A38: @ 8101A38 + .incbin "baserom.gba", 0x101A38, 0x64 + + .global gUnknown_8101A9C +gUnknown_8101A9C: @ 8101A9C + .incbin "baserom.gba", 0x101A9C, 0x38 + + .global gUnknown_8101AD4 +gUnknown_8101AD4: @ 8101AD4 + .incbin "baserom.gba", 0x101AD4, 0x15C + + .global gUnknown_8101C30 +gUnknown_8101C30: @ 8101C30 + .incbin "baserom.gba", 0x101C30, 0x8C + + .global gUnknown_8101CBC +gUnknown_8101CBC: @ 8101CBC + .incbin "baserom.gba", 0x101CBC, 0xD0 + + .global gUnknown_8101D8C +gUnknown_8101D8C: @ 8101D8C + .incbin "baserom.gba", 0x101D8C, 0x14 + + .global gUnknown_8101DA0 +gUnknown_8101DA0: @ 8101DA0 + .incbin "baserom.gba", 0x101DA0, 0x7C + + .global gUnknown_8101E1C +gUnknown_8101E1C: @ 8101E1C + .incbin "baserom.gba", 0x101E1C, 0x90 + + .global gUnknown_8101EAC +gUnknown_8101EAC: @ 8101EAC + .incbin "baserom.gba", 0x101EAC, 0x1C4 + + .global gUnknown_8102070 +gUnknown_8102070: @ 8102070 + .incbin "baserom.gba", 0x102070, 0x34 + + .global gUnknown_81020A4 +gUnknown_81020A4: @ 81020A4 + .incbin "baserom.gba", 0x1020A4, 0x30 + + .global gUnknown_81020D4 +gUnknown_81020D4: @ 81020D4 + .incbin "baserom.gba", 0x1020D4, 0x34 + + .global gUnknown_8102108 +gUnknown_8102108: @ 8102108 + .incbin "baserom.gba", 0x102108, 0x50 + + .global gUnknown_8102158 +gUnknown_8102158: @ 8102158 + .incbin "baserom.gba", 0x102158, 0x38 + + .global gUnknown_8102190 +gUnknown_8102190: @ 8102190 + .incbin "baserom.gba", 0x102190, 0x70 + + .global gUnknown_8102200 +gUnknown_8102200: @ 8102200 + .incbin "baserom.gba", 0x102200, 0x54 + + .global gUnknown_8102254 +gUnknown_8102254: @ 8102254 + .incbin "baserom.gba", 0x102254, 0xA4 + + .global gUnknown_81022F8 +gUnknown_81022F8: @ 81022F8 + .incbin "baserom.gba", 0x1022F8, 0x34 + + .global gUnknown_810232C +gUnknown_810232C: @ 810232C + .incbin "baserom.gba", 0x10232C, 0x6C + + .global gUnknown_8102398 +gUnknown_8102398: @ 8102398 + .incbin "baserom.gba", 0x102398, 0x2C + + .global gUnknown_81023C4 +gUnknown_81023C4: @ 81023C4 + .incbin "baserom.gba", 0x1023C4, 0x3C + + .global gUnknown_8102400 +gUnknown_8102400: @ 8102400 + .incbin "baserom.gba", 0x102400, 0x54 + + .global gUnknown_8102454 +gUnknown_8102454: @ 8102454 + .incbin "baserom.gba", 0x102454, 0x24 + + .global gUnknown_8102478 +gUnknown_8102478: @ 8102478 + .incbin "baserom.gba", 0x102478, 0x13C + + .global gUnknown_81025B4 +gUnknown_81025B4: @ 81025B4 + .incbin "baserom.gba", 0x1025B4, 0x20 + + .global gUnknown_81025D4 +gUnknown_81025D4: @ 81025D4 + .incbin "baserom.gba", 0x1025D4, 0x3C + + .global gUnknown_8102610 +gUnknown_8102610: @ 8102610 + .incbin "baserom.gba", 0x102610, 0xB4 + + .global gUnknown_81026C4 +gUnknown_81026C4: @ 81026C4 + .incbin "baserom.gba", 0x1026C4, 0x48 + + .global gUnknown_810270C +gUnknown_810270C: @ 810270C + .incbin "baserom.gba", 0x10270C, 0x20 + + .global gUnknown_810272C +gUnknown_810272C: @ 810272C + .incbin "baserom.gba", 0x10272C, 0x90 + + .global gUnknown_81027BC +gUnknown_81027BC: @ 81027BC + .incbin "baserom.gba", 0x1027BC, 0x54 + + .global gUnknown_8102810 +gUnknown_8102810: @ 8102810 + .incbin "baserom.gba", 0x102810, 0x30 + + .global gUnknown_8102840 +gUnknown_8102840: @ 8102840 + .incbin "baserom.gba", 0x102840, 0x2C + + .global gUnknown_810286C +gUnknown_810286C: @ 810286C + .incbin "baserom.gba", 0x10286C, 0x4C + + .global gUnknown_81028B8 +gUnknown_81028B8: @ 81028B8 + .incbin "baserom.gba", 0x1028B8, 0x1C + + .global gUnknown_81028D4 +gUnknown_81028D4: @ 81028D4 + .incbin "baserom.gba", 0x1028D4, 0x44 + + .global gUnknown_8102918 +gUnknown_8102918: @ 8102918 + .incbin "baserom.gba", 0x102918, 0x30 + + .global gUnknown_8102948 +gUnknown_8102948: @ 8102948 + .incbin "baserom.gba", 0x102948, 0x3C + + .global gUnknown_8102984 +gUnknown_8102984: @ 8102984 + .incbin "baserom.gba", 0x102984, 0x30 + + .global gUnknown_81029B4 +gUnknown_81029B4: @ 81029B4 + .incbin "baserom.gba", 0x1029B4, 0x64 + + .global gUnknown_8102A18 +gUnknown_8102A18: @ 8102A18 + .incbin "baserom.gba", 0x102A18, 0xC + + .global gUnknown_8102A24 +gUnknown_8102A24: @ 8102A24 + .incbin "baserom.gba", 0x102A24, 0x50 + + .global gUnknown_8102A74 +gUnknown_8102A74: @ 8102A74 + .incbin "baserom.gba", 0x102A74, 0x28 + + .global gUnknown_8102A9C +gUnknown_8102A9C: @ 8102A9C + .incbin "baserom.gba", 0x102A9C, 0x74 + + .global gUnknown_8102B10 +gUnknown_8102B10: @ 8102B10 + .incbin "baserom.gba", 0x102B10, 0xC + + .global gUnknown_8102B1C +gUnknown_8102B1C: @ 8102B1C + .incbin "baserom.gba", 0x102B1C, 0x38 + + .global gUnknown_8102B54 +gUnknown_8102B54: @ 8102B54 + .incbin "baserom.gba", 0x102B54, 0x70 + + .global gUnknown_8102BC4 +gUnknown_8102BC4: @ 8102BC4 + .incbin "baserom.gba", 0x102BC4, 0x20 + + .global gUnknown_8102BE4 +gUnknown_8102BE4: @ 8102BE4 + .incbin "baserom.gba", 0x102BE4, 0x4C + + .global gUnknown_8102C30 +gUnknown_8102C30: @ 8102C30 + .incbin "baserom.gba", 0x102C30, 0x24 + + .global gUnknown_8102C54 +gUnknown_8102C54: @ 8102C54 + .incbin "baserom.gba", 0x102C54, 0x44 + + .global gUnknown_8102C98 +gUnknown_8102C98: @ 8102C98 + .incbin "baserom.gba", 0x102C98, 0x18 + + .global gUnknown_8102CB0 +gUnknown_8102CB0: @ 8102CB0 + .incbin "baserom.gba", 0x102CB0, 0x48 + + .global gUnknown_8102CF8 +gUnknown_8102CF8: @ 8102CF8 + .incbin "baserom.gba", 0x102CF8, 0x3C + + .global gUnknown_8102D34 +gUnknown_8102D34: @ 8102D34 + .incbin "baserom.gba", 0x102D34, 0x18 + + .global gUnknown_8102D4C +gUnknown_8102D4C: @ 8102D4C + .incbin "baserom.gba", 0x102D4C, 0x30 + + .global gUnknown_8102D7C +gUnknown_8102D7C: @ 8102D7C + .incbin "baserom.gba", 0x102D7C, 0x80 + + .global gUnknown_8102DFC +gUnknown_8102DFC: @ 8102DFC + .incbin "baserom.gba", 0x102DFC, 0x30 + + .global gUnknown_8102E2C +gUnknown_8102E2C: @ 8102E2C + .incbin "baserom.gba", 0x102E2C, 0x28 + + .global gUnknown_8102E54 +gUnknown_8102E54: @ 8102E54 + .incbin "baserom.gba", 0x102E54, 0x1C + + .global gUnknown_8102E70 +gUnknown_8102E70: @ 8102E70 + .incbin "baserom.gba", 0x102E70, 0x4C + + .global gUnknown_8102EBC +gUnknown_8102EBC: @ 8102EBC + .incbin "baserom.gba", 0x102EBC, 0x24 + + .global gUnknown_8102EE0 +gUnknown_8102EE0: @ 8102EE0 + .incbin "baserom.gba", 0x102EE0, 0x18 + + .global gUnknown_8102EF8 +gUnknown_8102EF8: @ 8102EF8 + .incbin "baserom.gba", 0x102EF8, 0x38 + + .global gUnknown_8102F30 +gUnknown_8102F30: @ 8102F30 + .incbin "baserom.gba", 0x102F30, 0x34 + + .global gUnknown_8102F64 +gUnknown_8102F64: @ 8102F64 + .incbin "baserom.gba", 0x102F64, 0x20 + + .global gUnknown_8102F84 +gUnknown_8102F84: @ 8102F84 + .incbin "baserom.gba", 0x102F84, 0x28 + + .global gUnknown_8102FAC +gUnknown_8102FAC: @ 8102FAC + .incbin "baserom.gba", 0x102FAC, 0x18 + + .global gUnknown_8102FC4 +gUnknown_8102FC4: @ 8102FC4 + .incbin "baserom.gba", 0x102FC4, 0x14 + + .global gUnknown_8102FD8 +gUnknown_8102FD8: @ 8102FD8 + .incbin "baserom.gba", 0x102FD8, 0x7C + + .global gUnknown_8103054 +gUnknown_8103054: @ 8103054 + .incbin "baserom.gba", 0x103054, 0x84 + + .global gUnknown_81030D8 +gUnknown_81030D8: @ 81030D8 + .incbin "baserom.gba", 0x1030D8, 0x38 + + .global gUnknown_8103110 +gUnknown_8103110: @ 8103110 + .incbin "baserom.gba", 0x103110, 0x30 + + .global gUnknown_8103140 +gUnknown_8103140: @ 8103140 + .incbin "baserom.gba", 0x103140, 0x48 + + .global gUnknown_8103188 +gUnknown_8103188: @ 8103188 + .incbin "baserom.gba", 0x103188, 0xA0 + + .global gUnknown_8103228 +gUnknown_8103228: @ 8103228 + .incbin "baserom.gba", 0x103228, 0xE8 + + .global gUnknown_8103310 +gUnknown_8103310: @ 8103310 + .incbin "baserom.gba", 0x103310, 0x30 + + .global gUnknown_8103340 +gUnknown_8103340: @ 8103340 + .incbin "baserom.gba", 0x103340, 0x60 + + .global gUnknown_81033A0 +gUnknown_81033A0: @ 81033A0 + .incbin "baserom.gba", 0x1033A0, 0xC + + .global gUnknown_81033AC +gUnknown_81033AC: @ 81033AC + .incbin "baserom.gba", 0x1033AC, 0x90 + + .global gUnknown_810343C +gUnknown_810343C: @ 810343C + .incbin "baserom.gba", 0x10343C, 0x40 + + .global gUnknown_810347C +gUnknown_810347C: @ 810347C + .incbin "baserom.gba", 0x10347C, 0xC + + .global gUnknown_8103488 +gUnknown_8103488: @ 8103488 + .incbin "baserom.gba", 0x103488, 0x78 + + .global gUnknown_8103500 +gUnknown_8103500: @ 8103500 + .incbin "baserom.gba", 0x103500, 0x2C + + .global gUnknown_810352C +gUnknown_810352C: @ 810352C + .incbin "baserom.gba", 0x10352C, 0x4C + + .global gUnknown_8103578 +gUnknown_8103578: @ 8103578 + .incbin "baserom.gba", 0x103578, 0x5C + + .global gUnknown_81035D4 +gUnknown_81035D4: @ 81035D4 + .incbin "baserom.gba", 0x1035D4, 0x44 + + .global gUnknown_8103618 +gUnknown_8103618: @ 8103618 + .incbin "baserom.gba", 0x103618, 0x64 + + .global gUnknown_810367C +gUnknown_810367C: @ 810367C + .incbin "baserom.gba", 0x10367C, 0x14 + + .global gUnknown_8103690 +gUnknown_8103690: @ 8103690 + .incbin "baserom.gba", 0x103690, 0x38 + + .global gUnknown_81036C8 +gUnknown_81036C8: @ 81036C8 + .incbin "baserom.gba", 0x1036C8, 0xD8 + + .global gUnknown_81037A0 +gUnknown_81037A0: @ 81037A0 + .incbin "baserom.gba", 0x1037A0, 0x34 + + .global gUnknown_81037D4 +gUnknown_81037D4: @ 81037D4 + .incbin "baserom.gba", 0x1037D4, 0x4C + + .global gUnknown_8103820 +gUnknown_8103820: @ 8103820 + .incbin "baserom.gba", 0x103820, 0x24 + + .global gUnknown_8103844 +gUnknown_8103844: @ 8103844 + .incbin "baserom.gba", 0x103844, 0x30 + + .global gUnknown_8103874 +gUnknown_8103874: @ 8103874 + .incbin "baserom.gba", 0x103874, 0x34 + + .global gUnknown_81038A8 +gUnknown_81038A8: @ 81038A8 + .incbin "baserom.gba", 0x1038A8, 0x50 + + .global gUnknown_81038F8 +gUnknown_81038F8: @ 81038F8 + .incbin "baserom.gba", 0x1038F8, 0xC + + .global gUnknown_8103904 +gUnknown_8103904: @ 8103904 + .incbin "baserom.gba", 0x103904, 0x34 + + .global gUnknown_8103938 +gUnknown_8103938: @ 8103938 + .incbin "baserom.gba", 0x103938, 0x16C + + .global gUnknown_8103AA4 +gUnknown_8103AA4: @ 8103AA4 + .incbin "baserom.gba", 0x103AA4, 0x40 + + .global gUnknown_8103AE4 +gUnknown_8103AE4: @ 8103AE4 + .incbin "baserom.gba", 0x103AE4, 0x4C + + .global gUnknown_8103B30 +gUnknown_8103B30: @ 8103B30 + .incbin "baserom.gba", 0x103B30, 0x28 + + .global gUnknown_8103B58 +gUnknown_8103B58: @ 8103B58 + .incbin "baserom.gba", 0x103B58, 0x80 + + .global gUnknown_8103BD8 +gUnknown_8103BD8: @ 8103BD8 + .incbin "baserom.gba", 0x103BD8, 0x28 + + .global gUnknown_8103C00 +gUnknown_8103C00: @ 8103C00 + .incbin "baserom.gba", 0x103C00, 0x3C + + .global gUnknown_8103C3C +gUnknown_8103C3C: @ 8103C3C + .incbin "baserom.gba", 0x103C3C, 0x38 + + .global gUnknown_8103C74 +gUnknown_8103C74: @ 8103C74 + .incbin "baserom.gba", 0x103C74, 0x50 + + .global gUnknown_8103CC4 +gUnknown_8103CC4: @ 8103CC4 + .incbin "baserom.gba", 0x103CC4, 0x48 + + .global gUnknown_8103D0C +gUnknown_8103D0C: @ 8103D0C + .incbin "baserom.gba", 0x103D0C, 0x44 + + .global gUnknown_8103D50 +gUnknown_8103D50: @ 8103D50 + .incbin "baserom.gba", 0x103D50, 0x3C + + .global gUnknown_8103D8C +gUnknown_8103D8C: @ 8103D8C + .incbin "baserom.gba", 0x103D8C, 0xC + + .global gUnknown_8103D98 +gUnknown_8103D98: @ 8103D98 + .incbin "baserom.gba", 0x103D98, 0x40 + + .global gUnknown_8103DD8 +gUnknown_8103DD8: @ 8103DD8 + .incbin "baserom.gba", 0x103DD8, 0x50 + + .global gUnknown_8103E28 +gUnknown_8103E28: @ 8103E28 + .incbin "baserom.gba", 0x103E28, 0xC + + .global gUnknown_8103E34 +gUnknown_8103E34: @ 8103E34 + .incbin "baserom.gba", 0x103E34, 0x70 + + .global gUnknown_8103EA4 +gUnknown_8103EA4: @ 8103EA4 + .incbin "baserom.gba", 0x103EA4, 0x68 + + .global gUnknown_8103F0C +gUnknown_8103F0C: @ 8103F0C + .incbin "baserom.gba", 0x103F0C, 0x40 + + .global gUnknown_8103F4C +gUnknown_8103F4C: @ 8103F4C + .incbin "baserom.gba", 0x103F4C, 0x80 + + .global gUnknown_8103FCC +gUnknown_8103FCC: @ 8103FCC + .incbin "baserom.gba", 0x103FCC, 0x3C + + .global gUnknown_8104008 +gUnknown_8104008: @ 8104008 + .incbin "baserom.gba", 0x104008, 0x3C + + .global gUnknown_8104044 +gUnknown_8104044: @ 8104044 + .incbin "baserom.gba", 0x104044, 0xC + + .global gUnknown_8104050 +gUnknown_8104050: @ 8104050 + .incbin "baserom.gba", 0x104050, 0x7C + + .global gUnknown_81040CC +gUnknown_81040CC: @ 81040CC + .incbin "baserom.gba", 0x1040CC, 0x48 + + .global gUnknown_8104114 +gUnknown_8104114: @ 8104114 + .incbin "baserom.gba", 0x104114, 0x30 + + .global gUnknown_8104144 +gUnknown_8104144: @ 8104144 + .incbin "baserom.gba", 0x104144, 0xC + + .global gUnknown_8104150 +gUnknown_8104150: @ 8104150 + .incbin "baserom.gba", 0x104150, 0x5C + + .global gUnknown_81041AC +gUnknown_81041AC: @ 81041AC + .incbin "baserom.gba", 0x1041AC, 0x4C + + .global gUnknown_81041F8 +gUnknown_81041F8: @ 81041F8 + .incbin "baserom.gba", 0x1041F8, 0x48 + + .global gUnknown_8104240 +gUnknown_8104240: @ 8104240 + .incbin "baserom.gba", 0x104240, 0x6C + + .global gUnknown_81042AC +gUnknown_81042AC: @ 81042AC + .incbin "baserom.gba", 0x1042AC, 0xC + + .global gUnknown_81042B8 +gUnknown_81042B8: @ 81042B8 + .incbin "baserom.gba", 0x1042B8, 0x58 + + .global gUnknown_8104310 +gUnknown_8104310: @ 8104310 + .incbin "baserom.gba", 0x104310, 0x8C + + .global gUnknown_810439C +gUnknown_810439C: @ 810439C + .incbin "baserom.gba", 0x10439C, 0x24 + + .global gUnknown_81043C0 +gUnknown_81043C0: @ 81043C0 + .incbin "baserom.gba", 0x1043C0, 0x1C + + .global gUnknown_81043DC +gUnknown_81043DC: @ 81043DC + .incbin "baserom.gba", 0x1043DC, 0x74 + + .global gUnknown_8104450 +gUnknown_8104450: @ 8104450 + .incbin "baserom.gba", 0x104450, 0x64 + + .global gUnknown_81044B4 +gUnknown_81044B4: @ 81044B4 + .incbin "baserom.gba", 0x1044B4, 0x5C + + .global gUnknown_8104510 +gUnknown_8104510: @ 8104510 + .incbin "baserom.gba", 0x104510, 0x2C + + .global gUnknown_810453C +gUnknown_810453C: @ 810453C + .incbin "baserom.gba", 0x10453C, 0x34 + + .global gUnknown_8104570 +gUnknown_8104570: @ 8104570 + .incbin "baserom.gba", 0x104570, 0x40 + + .global gUnknown_81045B0 +gUnknown_81045B0: @ 81045B0 + .incbin "baserom.gba", 0x1045B0, 0x48 + + .global gUnknown_81045F8 +gUnknown_81045F8: @ 81045F8 + .incbin "baserom.gba", 0x1045F8, 0x7C + + .global gUnknown_8104674 +gUnknown_8104674: @ 8104674 + .incbin "baserom.gba", 0x104674, 0x2C + + .global gUnknown_81046A0 +gUnknown_81046A0: @ 81046A0 + .incbin "baserom.gba", 0x1046A0, 0x2C + + .global gUnknown_81046CC +gUnknown_81046CC: @ 81046CC + .incbin "baserom.gba", 0x1046CC, 0x78 + + .global gUnknown_8104744 +gUnknown_8104744: @ 8104744 + .incbin "baserom.gba", 0x104744, 0x28 + + .global gUnknown_810476C +gUnknown_810476C: @ 810476C + .incbin "baserom.gba", 0x10476C, 0xC + + .global gUnknown_8104778 +gUnknown_8104778: @ 8104778 + .incbin "baserom.gba", 0x104778, 0xC + + .global gUnknown_8104784 +gUnknown_8104784: @ 8104784 + .incbin "baserom.gba", 0x104784, 0xC + + .global gUnknown_8104790 +gUnknown_8104790: @ 8104790 + .incbin "baserom.gba", 0x104790, 0x20 + + .global gUnknown_81047B0 +gUnknown_81047B0: @ 81047B0 + .incbin "baserom.gba", 0x1047B0, 0x9C + + .global gUnknown_810484C +gUnknown_810484C: @ 810484C + .incbin "baserom.gba", 0x10484C, 0x3C + + .global gUnknown_8104888 +gUnknown_8104888: @ 8104888 + .incbin "baserom.gba", 0x104888, 0x40 + + .global gUnknown_81048C8 +gUnknown_81048C8: @ 81048C8 + .incbin "baserom.gba", 0x1048C8, 0x4C + + .global gUnknown_8104914 +gUnknown_8104914: @ 8104914 + .incbin "baserom.gba", 0x104914, 0x1C + + .global gUnknown_8104930 +gUnknown_8104930: @ 8104930 + .incbin "baserom.gba", 0x104930, 0x50 + + .global gUnknown_8104980 +gUnknown_8104980: @ 8104980 + .incbin "baserom.gba", 0x104980, 0x18 + + .global gUnknown_8104998 +gUnknown_8104998: @ 8104998 + .incbin "baserom.gba", 0x104998, 0x3C + + .global gUnknown_81049D4 +gUnknown_81049D4: @ 81049D4 + .incbin "baserom.gba", 0x1049D4, 0xAC + + .global gUnknown_8104A80 +gUnknown_8104A80: @ 8104A80 + .incbin "baserom.gba", 0x104A80, 0x1C + + .global gUnknown_8104A9C +gUnknown_8104A9C: @ 8104A9C + .incbin "baserom.gba", 0x104A9C, 0x2C + + .global gUnknown_8104AC8 +gUnknown_8104AC8: @ 8104AC8 + .incbin "baserom.gba", 0x104AC8, 0xC + + .global gUnknown_8104AD4 +gUnknown_8104AD4: @ 8104AD4 + .incbin "baserom.gba", 0x104AD4, 0x118 + + .global gUnknown_8104BEC +gUnknown_8104BEC: @ 8104BEC + .incbin "baserom.gba", 0x104BEC, 0x24 + + .global gUnknown_8104C10 +gUnknown_8104C10: @ 8104C10 + .incbin "baserom.gba", 0x104C10, 0x44 + + .global gUnknown_8104C54 +gUnknown_8104C54: @ 8104C54 + .incbin "baserom.gba", 0x104C54, 0x60 + + .global gUnknown_8104CB4 +gUnknown_8104CB4: @ 8104CB4 + .incbin "baserom.gba", 0x104CB4, 0x2C + + .global gUnknown_8104CE0 +gUnknown_8104CE0: @ 8104CE0 + .incbin "baserom.gba", 0x104CE0, 0xC + + .global gUnknown_8104CEC +gUnknown_8104CEC: @ 8104CEC + .incbin "baserom.gba", 0x104CEC, 0x74 + + .global gUnknown_8104D60 +gUnknown_8104D60: @ 8104D60 + .incbin "baserom.gba", 0x104D60, 0x7C + + .global gUnknown_8104DDC +gUnknown_8104DDC: @ 8104DDC + .incbin "baserom.gba", 0x104DDC, 0x30 + + .global gUnknown_8104E0C +gUnknown_8104E0C: @ 8104E0C + .incbin "baserom.gba", 0x104E0C, 0x48 + + .global gUnknown_8104E54 +gUnknown_8104E54: @ 8104E54 + .incbin "baserom.gba", 0x104E54, 0xC + + .global gUnknown_8104E60 +gUnknown_8104E60: @ 8104E60 + .incbin "baserom.gba", 0x104E60, 0x9C + + .global gUnknown_8104EFC +gUnknown_8104EFC: @ 8104EFC + .incbin "baserom.gba", 0x104EFC, 0x34 + + .global gUnknown_8104F30 +gUnknown_8104F30: @ 8104F30 + .incbin "baserom.gba", 0x104F30, 0x34 + + .global gUnknown_8104F64 +gUnknown_8104F64: @ 8104F64 + .incbin "baserom.gba", 0x104F64, 0x64 + + .global gUnknown_8104FC8 +gUnknown_8104FC8: @ 8104FC8 + .incbin "baserom.gba", 0x104FC8, 0xC + + .global gUnknown_8104FD4 +gUnknown_8104FD4: @ 8104FD4 + .incbin "baserom.gba", 0x104FD4, 0x54 + + .global gUnknown_8105028 +gUnknown_8105028: @ 8105028 + .incbin "baserom.gba", 0x105028, 0xC + + .global gUnknown_8105034 +gUnknown_8105034: @ 8105034 + .incbin "baserom.gba", 0x105034, 0xC + + .global gUnknown_8105040 +gUnknown_8105040: @ 8105040 + .incbin "baserom.gba", 0x105040, 0x74 + + .global gUnknown_81050B4 +gUnknown_81050B4: @ 81050B4 + .incbin "baserom.gba", 0x1050B4, 0x58 + + .global gUnknown_810510C +gUnknown_810510C: @ 810510C + .incbin "baserom.gba", 0x10510C, 0x70 + + .global gUnknown_810517C +gUnknown_810517C: @ 810517C + .incbin "baserom.gba", 0x10517C, 0x54 + + .global gUnknown_81051D0 +gUnknown_81051D0: @ 81051D0 + .incbin "baserom.gba", 0x1051D0, 0x74 + + .global gUnknown_8105244 +gUnknown_8105244: @ 8105244 + .incbin "baserom.gba", 0x105244, 0xD8 + + .global gUnknown_810531C +gUnknown_810531C: @ 810531C + .incbin "baserom.gba", 0x10531C, 0x44 + + .global gUnknown_8105360 +gUnknown_8105360: @ 8105360 + .incbin "baserom.gba", 0x105360, 0x48 + + .global gUnknown_81053A8 +gUnknown_81053A8: @ 81053A8 + .incbin "baserom.gba", 0x1053A8, 0x8C + + .global gUnknown_8105434 +gUnknown_8105434: @ 8105434 + .incbin "baserom.gba", 0x105434, 0x4 + + .global gUnknown_8105438 +gUnknown_8105438: @ 8105438 + .incbin "baserom.gba", 0x105438, 0x68 + + .global gUnknown_81054A0 +gUnknown_81054A0: @ 81054A0 + .incbin "baserom.gba", 0x1054A0, 0x44 + + .global gUnknown_81054E4 +gUnknown_81054E4: @ 81054E4 + .incbin "baserom.gba", 0x1054E4, 0x28 + + .global gUnknown_810550C +gUnknown_810550C: @ 810550C + .incbin "baserom.gba", 0x10550C, 0x40 + + .global gUnknown_810554C +gUnknown_810554C: @ 810554C + .incbin "baserom.gba", 0x10554C, 0xC + + .global gUnknown_8105558 +gUnknown_8105558: @ 8105558 + .incbin "baserom.gba", 0x105558, 0x9C + + .global gUnknown_81055F4 +gUnknown_81055F4: @ 81055F4 + .incbin "baserom.gba", 0x1055F4, 0x74 + + .global gUnknown_8105668 +gUnknown_8105668: @ 8105668 + .incbin "baserom.gba", 0x105668, 0xC + + .global gUnknown_8105674 +gUnknown_8105674: @ 8105674 + .incbin "baserom.gba", 0x105674, 0x44 + + .global gUnknown_81056B8 +gUnknown_81056B8: @ 81056B8 + .incbin "baserom.gba", 0x1056B8, 0x24 + + .global gUnknown_81056DC +gUnknown_81056DC: @ 81056DC + .incbin "baserom.gba", 0x1056DC, 0xBC + + .global gUnknown_8105798 +gUnknown_8105798: @ 8105798 + .incbin "baserom.gba", 0x105798, 0x4 + + .global gUnknown_810579C +gUnknown_810579C: @ 810579C + .incbin "baserom.gba", 0x10579C, 0x80 + + .global gUnknown_810581C +gUnknown_810581C: @ 810581C + .incbin "baserom.gba", 0x10581C, 0x8C + + .global gUnknown_81058A8 +gUnknown_81058A8: @ 81058A8 + .incbin "baserom.gba", 0x1058A8, 0x1C + + .global gUnknown_81058C4 +gUnknown_81058C4: @ 81058C4 + .incbin "baserom.gba", 0x1058C4, 0x1C + + .global gUnknown_81058E0 +gUnknown_81058E0: @ 81058E0 + .incbin "baserom.gba", 0x1058E0, 0x5C + + .global gUnknown_810593C +gUnknown_810593C: @ 810593C + .incbin "baserom.gba", 0x10593C, 0x38 + + .global gUnknown_8105974 +gUnknown_8105974: @ 8105974 + .incbin "baserom.gba", 0x105974, 0x94 + + .global gUnknown_8105A08 +gUnknown_8105A08: @ 8105A08 + .incbin "baserom.gba", 0x105A08, 0xCC + + .global gUnknown_8105AD4 +gUnknown_8105AD4: @ 8105AD4 + .incbin "baserom.gba", 0x105AD4, 0x4C + + .global gUnknown_8105B20 +gUnknown_8105B20: @ 8105B20 + .incbin "baserom.gba", 0x105B20, 0x48 + + .global gUnknown_8105B68 +gUnknown_8105B68: @ 8105B68 + .incbin "baserom.gba", 0x105B68, 0x40 + + .global gUnknown_8105BA8 +gUnknown_8105BA8: @ 8105BA8 + .incbin "baserom.gba", 0x105BA8, 0x4C + + .global gUnknown_8105BF4 +gUnknown_8105BF4: @ 8105BF4 + .incbin "baserom.gba", 0x105BF4, 0x138 + + .global gUnknown_8105D2C +gUnknown_8105D2C: @ 8105D2C + .incbin "baserom.gba", 0x105D2C, 0x54 + + .global gUnknown_8105D80 +gUnknown_8105D80: @ 8105D80 + .incbin "baserom.gba", 0x105D80, 0x1C + + .global gUnknown_8105D9C +gUnknown_8105D9C: @ 8105D9C + .incbin "baserom.gba", 0x105D9C, 0x78 + + .global gUnknown_8105E14 +gUnknown_8105E14: @ 8105E14 + .incbin "baserom.gba", 0x105E14, 0x74 + + .global gUnknown_8105E88 +gUnknown_8105E88: @ 8105E88 + .incbin "baserom.gba", 0x105E88, 0x70 + + .global gUnknown_8105EF8 +gUnknown_8105EF8: @ 8105EF8 + .incbin "baserom.gba", 0x105EF8, 0x40 + + .global gUnknown_8105F38 +gUnknown_8105F38: @ 8105F38 + .incbin "baserom.gba", 0x105F38, 0x3C + + .global gUnknown_8105F74 +gUnknown_8105F74: @ 8105F74 + .incbin "baserom.gba", 0x105F74, 0x2C + + .global gUnknown_8105FA0 +gUnknown_8105FA0: @ 8105FA0 + .incbin "baserom.gba", 0x105FA0, 0x38 + + .global gUnknown_8105FD8 +gUnknown_8105FD8: @ 8105FD8 + .incbin "baserom.gba", 0x105FD8, 0x4C + + .global gUnknown_8106024 +gUnknown_8106024: @ 8106024 + .incbin "baserom.gba", 0x106024, 0x44 + + .global gUnknown_8106068 +gUnknown_8106068: @ 8106068 + .incbin "baserom.gba", 0x106068, 0xC + + .global gUnknown_8106074 +gUnknown_8106074: @ 8106074 + .incbin "baserom.gba", 0x106074, 0x48 + + .global gUnknown_81060BC +gUnknown_81060BC: @ 81060BC + .incbin "baserom.gba", 0x1060BC, 0x48 + + .global gUnknown_8106104 +gUnknown_8106104: @ 8106104 + .incbin "baserom.gba", 0x106104, 0x3C + + .global gUnknown_8106140 +gUnknown_8106140: @ 8106140 + .incbin "baserom.gba", 0x106140, 0xD4 + + .global gUnknown_8106214 +gUnknown_8106214: @ 8106214 + .incbin "baserom.gba", 0x106214, 0x30 + + .global gUnknown_8106244 +gUnknown_8106244: @ 8106244 + .incbin "baserom.gba", 0x106244, 0x38 + + .global gUnknown_810627C +gUnknown_810627C: @ 810627C + .incbin "baserom.gba", 0x10627C, 0x2C + + .global gUnknown_81062A8 +gUnknown_81062A8: @ 81062A8 + .incbin "baserom.gba", 0x1062A8, 0xC + + .global gUnknown_81062B4 +gUnknown_81062B4: @ 81062B4 + .incbin "baserom.gba", 0x1062B4, 0x34 + + .global gUnknown_81062E8 +gUnknown_81062E8: @ 81062E8 + .incbin "baserom.gba", 0x1062E8, 0x80 + + .global gUnknown_8106368 +gUnknown_8106368: @ 8106368 + .incbin "baserom.gba", 0x106368, 0x28 + + .global gUnknown_8106390 +gUnknown_8106390: @ 8106390 + .incbin "baserom.gba", 0x106390, 0x34 + + .global gUnknown_81063C4 +gUnknown_81063C4: @ 81063C4 + .incbin "baserom.gba", 0x1063C4, 0xC + + .global gUnknown_81063D0 +gUnknown_81063D0: @ 81063D0 + .incbin "baserom.gba", 0x1063D0, 0x30 + + .global gUnknown_8106400 +gUnknown_8106400: @ 8106400 + .incbin "baserom.gba", 0x106400, 0x3C + + .global gUnknown_810643C +gUnknown_810643C: @ 810643C + .incbin "baserom.gba", 0x10643C, 0x2C + + .global gUnknown_8106468 +gUnknown_8106468: @ 8106468 + .incbin "baserom.gba", 0x106468, 0x24 + + .global gUnknown_810648C +gUnknown_810648C: @ 810648C + .incbin "baserom.gba", 0x10648C, 0x30 + + .global gUnknown_81064BC +gUnknown_81064BC: @ 81064BC + .incbin "baserom.gba", 0x1064BC, 0x44 + + .global gUnknown_8106500 +gUnknown_8106500: @ 8106500 + .incbin "baserom.gba", 0x106500, 0x34 + + .global gUnknown_8106534 +gUnknown_8106534: @ 8106534 + .incbin "baserom.gba", 0x106534, 0x2C + + .global gUnknown_8106560 +gUnknown_8106560: @ 8106560 + .incbin "baserom.gba", 0x106560, 0x48 + + .global gUnknown_81065A8 +gUnknown_81065A8: @ 81065A8 + .incbin "baserom.gba", 0x1065A8, 0x4 + + .global gUnknown_81065AC +gUnknown_81065AC: @ 81065AC + .incbin "baserom.gba", 0x1065AC, 0x60 + + .global gUnknown_810660C +gUnknown_810660C: @ 810660C + .incbin "baserom.gba", 0x10660C, 0x4 + + .global gUnknown_8106610 +gUnknown_8106610: @ 8106610 + .incbin "baserom.gba", 0x106610, 0x2C + + .global gUnknown_810663C +gUnknown_810663C: @ 810663C + .incbin "baserom.gba", 0x10663C, 0x20 + + .global gUnknown_810665C +gUnknown_810665C: @ 810665C + .incbin "baserom.gba", 0x10665C, 0x30 + + .global gUnknown_810668C +gUnknown_810668C: @ 810668C + .incbin "baserom.gba", 0x10668C, 0x48 + + .global gUnknown_81066D4 +gUnknown_81066D4: @ 81066D4 + .incbin "baserom.gba", 0x1066D4, 0x1C + + .global gUnknown_81066F0 +gUnknown_81066F0: @ 81066F0 + .incbin "baserom.gba", 0x1066F0, 0x2C + + .global gUnknown_810671C +gUnknown_810671C: @ 810671C + .incbin "baserom.gba", 0x10671C, 0x4 + + .global gUnknown_8106720 +gUnknown_8106720: @ 8106720 + .incbin "baserom.gba", 0x106720, 0x58 + + .global gUnknown_8106778 +gUnknown_8106778: @ 8106778 + .incbin "baserom.gba", 0x106778, 0x44 + + .global gUnknown_81067BC +gUnknown_81067BC: @ 81067BC + .incbin "baserom.gba", 0x1067BC, 0x24 + + .global gUnknown_81067E0 +gUnknown_81067E0: @ 81067E0 + .incbin "baserom.gba", 0x1067E0, 0x54 + + .global gUnknown_8106834 +gUnknown_8106834: @ 8106834 + .incbin "baserom.gba", 0x106834, 0x58 + + .global gUnknown_810688C +gUnknown_810688C: @ 810688C + .incbin "baserom.gba", 0x10688C, 0x44 + + .global gUnknown_81068D0 +gUnknown_81068D0: @ 81068D0 + .incbin "baserom.gba", 0x1068D0, 0x48 + + .global gUnknown_8106918 +gUnknown_8106918: @ 8106918 + .incbin "baserom.gba", 0x106918, 0x1C + + .global gUnknown_8106934 +gUnknown_8106934: @ 8106934 + .incbin "baserom.gba", 0x106934, 0x48 + + .global gUnknown_810697C +gUnknown_810697C: @ 810697C + .incbin "baserom.gba", 0x10697C, 0x14 + + .global gUnknown_8106990 +gUnknown_8106990: @ 8106990 + .incbin "baserom.gba", 0x106990, 0x2C + + .global gUnknown_81069BC +gUnknown_81069BC: @ 81069BC + .incbin "baserom.gba", 0x1069BC, 0x18 + + .global gUnknown_81069D4 +gUnknown_81069D4: @ 81069D4 + .incbin "baserom.gba", 0x1069D4, 0x20 + + .global gUnknown_81069F4 +gUnknown_81069F4: @ 81069F4 + .incbin "baserom.gba", 0x1069F4, 0x28 + + .global gUnknown_8106A1C +gUnknown_8106A1C: @ 8106A1C + .incbin "baserom.gba", 0x106A1C, 0x30 + + .global gUnknown_8106A4C +gUnknown_8106A4C: @ 8106A4C + .incbin "baserom.gba", 0x106A4C, 0x4 + + .global gUnknown_8106A50 +gUnknown_8106A50: @ 8106A50 + .incbin "baserom.gba", 0x106A50, 0x4 + + .global gUnknown_8106A54 +gUnknown_8106A54: @ 8106A54 + .incbin "baserom.gba", 0x106A54, 0x38 + + .global gUnknown_8106A8C +gUnknown_8106A8C: @ 8106A8C + .incbin "baserom.gba", 0x106A8C, 0x3C + + .global gUnknown_8106AC8 +gUnknown_8106AC8: @ 8106AC8 + .incbin "baserom.gba", 0x106AC8, 0x20 + + .global gUnknown_8106AE8 +gUnknown_8106AE8: @ 8106AE8 + .incbin "baserom.gba", 0x106AE8, 0x4 + + .global gUnknown_8106AEC +gUnknown_8106AEC: @ 8106AEC + .incbin "baserom.gba", 0x106AEC, 0x64 + + .global gUnknown_8106B50 +gUnknown_8106B50: @ 8106B50 + .incbin "baserom.gba", 0x106B50, 0x10 + + .global gUnknown_8106B60 +gUnknown_8106B60: @ 8106B60 + .incbin "baserom.gba", 0x106B60, 0xC + + .global gUnknown_8106B6C +gUnknown_8106B6C: @ 8106B6C + .incbin "baserom.gba", 0x106B6C, 0x20 + + .global gUnknown_8106B8C +gUnknown_8106B8C: @ 8106B8C + .incbin "baserom.gba", 0x106B8C, 0x24 + + .global gUnknown_8106BB0 +gUnknown_8106BB0: @ 8106BB0 + .incbin "baserom.gba", 0x106BB0, 0x4 + + .global gUnknown_8106BB4 +gUnknown_8106BB4: @ 8106BB4 + .incbin "baserom.gba", 0x106BB4, 0x4 + + .global gUnknown_8106BB8 +gUnknown_8106BB8: @ 8106BB8 + .incbin "baserom.gba", 0x106BB8, 0x4 + + .global gUnknown_8106BBC +gUnknown_8106BBC: @ 8106BBC + .incbin "baserom.gba", 0x106BBC, 0x4 + + .global gUnknown_8106BC0 +gUnknown_8106BC0: @ 8106BC0 + .incbin "baserom.gba", 0x106BC0, 0x4 + + .global gUnknown_8106BC4 +gUnknown_8106BC4: @ 8106BC4 + .incbin "baserom.gba", 0x106BC4, 0x4 + + .global gUnknown_8106BC8 +gUnknown_8106BC8: @ 8106BC8 + .incbin "baserom.gba", 0x106BC8, 0x4 + + .global gUnknown_8106BCC +gUnknown_8106BCC: @ 8106BCC + .incbin "baserom.gba", 0x106BCC, 0x4 + + .global gUnknown_8106BD0 +gUnknown_8106BD0: @ 8106BD0 + .incbin "baserom.gba", 0x106BD0, 0x4 + + .global gUnknown_8106BD4 +gUnknown_8106BD4: @ 8106BD4 + .incbin "baserom.gba", 0x106BD4, 0xC + + .global gUnknown_8106BE0 +gUnknown_8106BE0: @ 8106BE0 + .incbin "baserom.gba", 0x106BE0, 0xC + + .global gUnknown_8106BEC +gUnknown_8106BEC: @ 8106BEC + .incbin "baserom.gba", 0x106BEC, 0x8 + + .global gUnknown_8106BF4 +gUnknown_8106BF4: @ 8106BF4 + .incbin "baserom.gba", 0x106BF4, 0xC + + .global gUnknown_8106C00 +gUnknown_8106C00: @ 8106C00 + .incbin "baserom.gba", 0x106C00, 0x18 + + .global gUnknown_8106C18 +gUnknown_8106C18: @ 8106C18 + .incbin "baserom.gba", 0x106C18, 0x18 + + .global gUnknown_8106C30 +gUnknown_8106C30: @ 8106C30 + .incbin "baserom.gba", 0x106C30, 0x60 + + .global gUnknown_8106C90 +gUnknown_8106C90: @ 8106C90 + .incbin "baserom.gba", 0x106C90, 0x8 + + .global gUnknown_8106C98 +gUnknown_8106C98: @ 8106C98 + .incbin "baserom.gba", 0x106C98, 0x4 + + .global gUnknown_8106C9C +gUnknown_8106C9C: @ 8106C9C + .incbin "baserom.gba", 0x106C9C, 0x10 + + .global gUnknown_8106CAC +gUnknown_8106CAC: @ 8106CAC + .incbin "baserom.gba", 0x106CAC, 0x18 + + .global gUnknown_8106CC4 +gUnknown_8106CC4: @ 8106CC4 + .incbin "baserom.gba", 0x106CC4, 0x4 + + .global gUnknown_8106CC8 +gUnknown_8106CC8: @ 8106CC8 + .incbin "baserom.gba", 0x106CC8, 0x4 + + .global gUnknown_8106CCC +gUnknown_8106CCC: @ 8106CCC + .incbin "baserom.gba", 0x106CCC, 0x1C + + .global gUnknown_8106CE8 +gUnknown_8106CE8: @ 8106CE8 + .incbin "baserom.gba", 0x106CE8, 0xC + + .global gUnknown_8106CF4 +gUnknown_8106CF4: @ 8106CF4 + .incbin "baserom.gba", 0x106CF4, 0x14 + + .global gUnknown_8106D08 +gUnknown_8106D08: @ 8106D08 + .incbin "baserom.gba", 0x106D08, 0x60 + + .global gUnknown_8106D68 +gUnknown_8106D68: @ 8106D68 + .incbin "baserom.gba", 0x106D68, 0x24 + + .global gUnknown_8106D8C +gUnknown_8106D8C: @ 8106D8C + .incbin "baserom.gba", 0x106D8C, 0x18 + + .global gUnknown_8106DA4 +gUnknown_8106DA4: @ 8106DA4 + .incbin "baserom.gba", 0x106DA4, 0x24 + + .global gUnknown_8106DC8 +gUnknown_8106DC8: @ 8106DC8 + .incbin "baserom.gba", 0x106DC8, 0x60 + + .global gUnknown_8106E28 +gUnknown_8106E28: @ 8106E28 + .incbin "baserom.gba", 0x106E28, 0x4 + + .global gUnknown_8106E2C +gUnknown_8106E2C: @ 8106E2C + .incbin "baserom.gba", 0x106E2C, 0x4 + + .global gUnknown_8106E30 +gUnknown_8106E30: @ 8106E30 + .incbin "baserom.gba", 0x106E30, 0x4 + + .global gUnknown_8106E34 +gUnknown_8106E34: @ 8106E34 + .incbin "baserom.gba", 0x106E34, 0x14 + + .global gUnknown_8106E48 +gUnknown_8106E48: @ 8106E48 + .incbin "baserom.gba", 0x106E48, 0x14 + + .global gUnknown_8106E5C +gUnknown_8106E5C: @ 8106E5C + .incbin "baserom.gba", 0x106E5C, 0x10 + + .global gUnknown_8106E6C +gUnknown_8106E6C: @ 8106E6C + .incbin "baserom.gba", 0x106E6C, 0x14 + + .global gUnknown_8106E80 +gUnknown_8106E80: @ 8106E80 + .incbin "baserom.gba", 0x106E80, 0x18 + + .global gUnknown_8106E98 +gUnknown_8106E98: @ 8106E98 + .incbin "baserom.gba", 0x106E98, 0x8 + + .global gUnknown_8106EA0 +gUnknown_8106EA0: @ 8106EA0 + .incbin "baserom.gba", 0x106EA0, 0x8 + + .global gUnknown_8106EA8 +gUnknown_8106EA8: @ 8106EA8 + .incbin "baserom.gba", 0x106EA8, 0x8 + + .global gUnknown_8106EB0 +gUnknown_8106EB0: @ 8106EB0 + .incbin "baserom.gba", 0x106EB0, 0x18 + + .global gUnknown_8106EC8 +gUnknown_8106EC8: @ 8106EC8 + .incbin "baserom.gba", 0x106EC8, 0x27 + + .global gUnknown_8106EEF +gUnknown_8106EEF: @ 8106EEF + .incbin "baserom.gba", 0x106EEF, 0xD + + .global gUnknown_8106EFC +gUnknown_8106EFC: @ 8106EFC + .incbin "baserom.gba", 0x106EFC, 0x8 + + .global gUnknown_8106F04 +gUnknown_8106F04: @ 8106F04 + .incbin "baserom.gba", 0x106F04, 0x8 + + .global gUnknown_8106F0C +gUnknown_8106F0C: @ 8106F0C + .incbin "baserom.gba", 0x106F0C, 0x8 + + .global gUnknown_8106F14 +gUnknown_8106F14: @ 8106F14 + .incbin "baserom.gba", 0x106F14, 0x8 + + .global gUnknown_8106F1C +gUnknown_8106F1C: @ 8106F1C + .incbin "baserom.gba", 0x106F1C, 0x8 + + .global gUnknown_8106F24 +gUnknown_8106F24: @ 8106F24 + .incbin "baserom.gba", 0x106F24, 0x30 + + .global gUnknown_8106F54 +gUnknown_8106F54: @ 8106F54 + .incbin "baserom.gba", 0x106F54, 0x10 + + .global gUnknown_8106F64 +gUnknown_8106F64: @ 8106F64 + .incbin "baserom.gba", 0x106F64, 0x8 + + .global gUnknown_8106F6C +gUnknown_8106F6C: @ 8106F6C + .incbin "baserom.gba", 0x106F6C, 0x10 + + .global gUnknown_8106F7C +gUnknown_8106F7C: @ 8106F7C + .incbin "baserom.gba", 0x106F7C, 0x28 + + .global gUnknown_8106FA4 +gUnknown_8106FA4: @ 8106FA4 + .incbin "baserom.gba", 0x106FA4, 0x9 + + .global gUnknown_8106FAD +gUnknown_8106FAD: @ 8106FAD + .incbin "baserom.gba", 0x106FAD, 0x8 + + .global gUnknown_8106FB5 +gUnknown_8106FB5: @ 8106FB5 + .incbin "baserom.gba", 0x106FB5, 0x8 + + .global gUnknown_8106FBD +gUnknown_8106FBD: @ 8106FBD + .incbin "baserom.gba", 0x106FBD, 0x8 + + .global gUnknown_8106FC5 +gUnknown_8106FC5: @ 8106FC5 + .incbin "baserom.gba", 0x106FC5, 0x8 + + .global gUnknown_8106FCD +gUnknown_8106FCD: @ 8106FCD + .incbin "baserom.gba", 0x106FCD, 0x8 + + .global gUnknown_8106FD5 +gUnknown_8106FD5: @ 8106FD5 + .incbin "baserom.gba", 0x106FD5, 0x8 + + .global gUnknown_8106FDD +gUnknown_8106FDD: @ 8106FDD + .incbin "baserom.gba", 0x106FDD, 0x8 + + .global gUnknown_8106FE5 +gUnknown_8106FE5: @ 8106FE5 + .incbin "baserom.gba", 0x106FE5, 0x2B + + .global gUnknown_8107010 +gUnknown_8107010: @ 8107010 + .incbin "baserom.gba", 0x107010, 0x8 + + .global gUnknown_8107018 +gUnknown_8107018: @ 8107018 + .incbin "baserom.gba", 0x107018, 0x160 + + .global gUnknown_8107178 +gUnknown_8107178: @ 8107178 + .incbin "baserom.gba", 0x107178, 0x5C + + .global gUnknown_81071D4 +gUnknown_81071D4: @ 81071D4 + .incbin "baserom.gba", 0x1071D4, 0xC + + .global gUnknown_81071E0 +gUnknown_81071E0: @ 81071E0 + .incbin "baserom.gba", 0x1071E0, 0x44 + + .global gUnknown_8107224 +gUnknown_8107224: @ 8107224 + .incbin "baserom.gba", 0x107224, 0x10 + + .global gUnknown_8107234 +gUnknown_8107234: @ 8107234 + .incbin "baserom.gba", 0x107234, 0xE0 + + .global gUnknown_8107314 +gUnknown_8107314: @ 8107314 + .incbin "baserom.gba", 0x107314, 0x44 + + .global gUnknown_8107358 +gUnknown_8107358: @ 8107358 + .incbin "baserom.gba", 0x107358, 0x1C + + .global gUnknown_8107374 +gUnknown_8107374: @ 8107374 + .incbin "baserom.gba", 0x107374, 0xC + + .global gUnknown_8107380 +gUnknown_8107380: @ 8107380 + .incbin "baserom.gba", 0x107380, 0x1C + + .global gUnknown_810739C +gUnknown_810739C: @ 810739C + .incbin "baserom.gba", 0x10739C, 0x38 + + .global gUnknown_81073D4 +gUnknown_81073D4: @ 81073D4 + .incbin "baserom.gba", 0x1073D4, 0x38 + + .global gUnknown_810740C +gUnknown_810740C: @ 810740C + .incbin "baserom.gba", 0x10740C, 0x40 + + .global gUnknown_810744C +gUnknown_810744C: @ 810744C + .incbin "baserom.gba", 0x10744C, 0x18 + + .global gUnknown_8107464 +gUnknown_8107464: @ 8107464 + .incbin "baserom.gba", 0x107464, 0x98 + + .global gUnknown_81074FC +gUnknown_81074FC: @ 81074FC + .incbin "baserom.gba", 0x1074FC, 0x48 + + .global gUnknown_8107544 +gUnknown_8107544: @ 8107544 + .incbin "baserom.gba", 0x107544, 0xB0 + + .global gUnknown_81075F4 +gUnknown_81075F4: @ 81075F4 + .incbin "baserom.gba", 0x1075F4, 0xC + + .global gUnknown_8107600 +gUnknown_8107600: @ 8107600 + .incbin "baserom.gba", 0x107600, 0x8 + + .global gUnknown_8107608 +gUnknown_8107608: @ 8107608 + .incbin "baserom.gba", 0x107608, 0x8 + + .global gUnknown_8107610 +gUnknown_8107610: @ 8107610 + .incbin "baserom.gba", 0x107610, 0x20 + + .global gUnknown_8107630 +gUnknown_8107630: @ 8107630 + .incbin "baserom.gba", 0x107630, 0x8 + + .global gUnknown_8107638 +gUnknown_8107638: @ 8107638 + .incbin "baserom.gba", 0x107638, 0x4 + + .global gUnknown_810763C +gUnknown_810763C: @ 810763C + .incbin "baserom.gba", 0x10763C, 0x9 + + .global gUnknown_8107645 +gUnknown_8107645: @ 8107645 + .incbin "baserom.gba", 0x107645, 0xF + + .global gUnknown_8107654 +gUnknown_8107654: @ 8107654 + .incbin "baserom.gba", 0x107654, 0x30 + + .global gUnknown_8107684 +gUnknown_8107684: @ 8107684 + .incbin "baserom.gba", 0x107684, 0x8 + + .global gUnknown_810768C +gUnknown_810768C: @ 810768C + .incbin "baserom.gba", 0x10768C, 0xC + + .global gUnknown_8107698 +gUnknown_8107698: @ 8107698 + .incbin "baserom.gba", 0x107698, 0x24 + + .global gUnknown_81076BC +gUnknown_81076BC: @ 81076BC + .incbin "baserom.gba", 0x1076BC, 0x8 + + .global gUnknown_81076C4 +gUnknown_81076C4: @ 81076C4 + .incbin "baserom.gba", 0x1076C4, 0x20 + + .global gUnknown_81076E4 +gUnknown_81076E4: @ 81076E4 + .incbin "baserom.gba", 0x1076E4, 0x70 + + .global gUnknown_8107754 +gUnknown_8107754: @ 8107754 + .incbin "baserom.gba", 0x107754, 0x8 + + .global gUnknown_810775C +gUnknown_810775C: @ 810775C + .incbin "baserom.gba", 0x10775C, 0xC + + .global gUnknown_8107768 +gUnknown_8107768: @ 8107768 + .incbin "baserom.gba", 0x107768, 0x8 + + .global gUnknown_8107770 +gUnknown_8107770: @ 8107770 + .incbin "baserom.gba", 0x107770, 0x14 + + .global gUnknown_8107784 +gUnknown_8107784: @ 8107784 + .incbin "baserom.gba", 0x107784, 0x4 + + .global gUnknown_8107788 +gUnknown_8107788: @ 8107788 + .incbin "baserom.gba", 0x107788, 0x4 + + .global gUnknown_810778C +gUnknown_810778C: @ 810778C + .incbin "baserom.gba", 0x10778C, 0x4 + + .global gUnknown_8107790 +gUnknown_8107790: @ 8107790 + .incbin "baserom.gba", 0x107790, 0x8 + + .global gUnknown_8107798 +gUnknown_8107798: @ 8107798 + .incbin "baserom.gba", 0x107798, 0x10 + + .global gUnknown_81077A8 +gUnknown_81077A8: @ 81077A8 + .incbin "baserom.gba", 0x1077A8, 0x40 + + .global gUnknown_81077E8 +gUnknown_81077E8: @ 81077E8 + .incbin "baserom.gba", 0x1077E8, 0x40 + + .global gUnknown_8107828 +gUnknown_8107828: @ 8107828 + .incbin "baserom.gba", 0x107828, 0x85C + + .global gUnknown_8108084 +gUnknown_8108084: @ 8108084 + .incbin "baserom.gba", 0x108084, 0xDD4 + + .global gUnknown_8108E58 +gUnknown_8108E58: @ 8108E58 + .incbin "baserom.gba", 0x108E58, 0x68 + + .global gUnknown_8108EC0 +gUnknown_8108EC0: @ 8108EC0 + .incbin "baserom.gba", 0x108EC0, 0x50 + + .global gUnknown_8108F10 +gUnknown_8108F10: @ 8108F10 + .incbin "baserom.gba", 0x108F10, 0x8 + + .global gUnknown_8108F18 +gUnknown_8108F18: @ 8108F18 + .incbin "baserom.gba", 0x108F18, 0x14 + + .global gUnknown_8108F2C +gUnknown_8108F2C: @ 8108F2C + .incbin "baserom.gba", 0x108F2C, 0x14 + + .global gUnknown_8108F40 +gUnknown_8108F40: @ 8108F40 + .incbin "baserom.gba", 0x108F40, 0x2 + + .global gUnknown_8108F42 +gUnknown_8108F42: @ 8108F42 + .incbin "baserom.gba", 0x108F42, 0x8 + + .global gUnknown_8108F4A +gUnknown_8108F4A: @ 8108F4A + .incbin "baserom.gba", 0x108F4A, 0x6 + + .global gUnknown_8108F50 +gUnknown_8108F50: @ 8108F50 + .incbin "baserom.gba", 0x108F50, 0x14 + + .global gUnknown_8108F64 +gUnknown_8108F64: @ 8108F64 + .incbin "baserom.gba", 0x108F64, 0x800 + + .global gUnknown_8109764 +gUnknown_8109764: @ 8109764 + .incbin "baserom.gba", 0x109764, 0xC + + .global gUnknown_8109770 +gUnknown_8109770: @ 8109770 + .incbin "baserom.gba", 0x109770, 0x8 + + .global gUnknown_8109778 +gUnknown_8109778: @ 8109778 + .incbin "baserom.gba", 0x109778, 0x4 + + .global gUnknown_810977C +gUnknown_810977C: @ 810977C + .incbin "baserom.gba", 0x10977C, 0x8 + + .global gUnknown_8109784 +gUnknown_8109784: @ 8109784 + .incbin "baserom.gba", 0x109784, 0x8 + + .global gUnknown_810978C +gUnknown_810978C: @ 810978C + .incbin "baserom.gba", 0x10978C, 0x8 + + .global gUnknown_8109794 +gUnknown_8109794: @ 8109794 + .incbin "baserom.gba", 0x109794, 0x10 + + .global gUnknown_81097A4 +gUnknown_81097A4: @ 81097A4 + .incbin "baserom.gba", 0x1097A4, 0xC + + .global gUnknown_81097B0 +gUnknown_81097B0: @ 81097B0 + .incbin "baserom.gba", 0x1097B0, 0x14 + + .global gUnknown_81097C4 +gUnknown_81097C4: @ 81097C4 + .incbin "baserom.gba", 0x1097C4, 0x1 + + .global gUnknown_81097C5 +gUnknown_81097C5: @ 81097C5 + .incbin "baserom.gba", 0x1097C5, 0x1B + + .global gUnknown_81097E0 +gUnknown_81097E0: @ 81097E0 + .incbin "baserom.gba", 0x1097E0, 0x8 + + .global gUnknown_81097E8 +gUnknown_81097E8: @ 81097E8 + .incbin "baserom.gba", 0x1097E8, 0x10 + + .global gUnknown_81097F8 +gUnknown_81097F8: @ 81097F8 + .incbin "baserom.gba", 0x1097F8, 0x18 + + .global gUnknown_8109810 +gUnknown_8109810: @ 8109810 + .incbin "baserom.gba", 0x109810, 0x1C + + .global gUnknown_810982C +gUnknown_810982C: @ 810982C + .incbin "baserom.gba", 0x10982C, 0x10 + + .global gUnknown_810983C +gUnknown_810983C: @ 810983C + .incbin "baserom.gba", 0x10983C, 0x68 + + .global gUnknown_81098A4 +gUnknown_81098A4: @ 81098A4 + .incbin "baserom.gba", 0x1098A4, 0x8 + + .global gUnknown_81098AC +gUnknown_81098AC: @ 81098AC + .incbin "baserom.gba", 0x1098AC, 0x18 + + .global gUnknown_81098C4 +gUnknown_81098C4: @ 81098C4 + .incbin "baserom.gba", 0x1098C4, 0xC + + .global gUnknown_81098D0 +gUnknown_81098D0: @ 81098D0 + .incbin "baserom.gba", 0x1098D0, 0xC + + .global gUnknown_81098DC +gUnknown_81098DC: @ 81098DC + .incbin "baserom.gba", 0x1098DC, 0x4 + + .global gUnknown_81098E0 +gUnknown_81098E0: @ 81098E0 + .incbin "baserom.gba", 0x1098E0, 0xC + + .global gUnknown_81098EC +gUnknown_81098EC: @ 81098EC + .incbin "baserom.gba", 0x1098EC, 0x1C + + .global gUnknown_8109908 +gUnknown_8109908: @ 8109908 + .incbin "baserom.gba", 0x109908, 0x4 + + .global gUnknown_810990C +gUnknown_810990C: @ 810990C + .incbin "baserom.gba", 0x10990C, 0x4 + + .global gUnknown_8109910 +gUnknown_8109910: @ 8109910 + .incbin "baserom.gba", 0x109910, 0x18 + + .global gUnknown_8109928 +gUnknown_8109928: @ 8109928 + .incbin "baserom.gba", 0x109928, 0x3 + + .global gUnknown_810992B +gUnknown_810992B: @ 810992B + .incbin "baserom.gba", 0x10992B, 0x1 + + .global gUnknown_810992C +gUnknown_810992C: @ 810992C + .incbin "baserom.gba", 0x10992C, 0x4 + + .global gUnknown_8109930 +gUnknown_8109930: @ 8109930 + .incbin "baserom.gba", 0x109930, 0x24 + + .global gUnknown_8109954 +gUnknown_8109954: @ 8109954 + .incbin "baserom.gba", 0x109954, 0x30 + + .global gUnknown_8109984 +gUnknown_8109984: @ 8109984 + .incbin "baserom.gba", 0x109984, 0x10 + + .global gUnknown_8109994 +gUnknown_8109994: @ 8109994 + .incbin "baserom.gba", 0x109994, 0x314 + + .global gUnknown_8109CA8 +gUnknown_8109CA8: @ 8109CA8 + .incbin "baserom.gba", 0x109CA8, 0x18 + + .global gUnknown_8109CC0 +gUnknown_8109CC0: @ 8109CC0 + .incbin "baserom.gba", 0x109CC0, 0x14 + + .global gUnknown_8109CD4 +gUnknown_8109CD4: @ 8109CD4 + .incbin "baserom.gba", 0x109CD4, 0x10 + + .global gUnknown_8109CE4 +gUnknown_8109CE4: @ 8109CE4 + .incbin "baserom.gba", 0x109CE4, 0x10 + + .global gUnknown_8109CF4 +gUnknown_8109CF4: @ 8109CF4 + .incbin "baserom.gba", 0x109CF4, 0x3C + + .global gUnknown_8109D30 +gUnknown_8109D30: @ 8109D30 + .incbin "baserom.gba", 0x109D30, 0x620 + + .global gUnknown_810A350 +gUnknown_810A350: @ 810A350 + .incbin "baserom.gba", 0x10A350, 0xB + + .global gUnknown_810A35B +gUnknown_810A35B: @ 810A35B + .incbin "baserom.gba", 0x10A35B, 0x10 + + .global gUnknown_810A36B +gUnknown_810A36B: @ 810A36B + .incbin "baserom.gba", 0x10A36B, 0xD + + .global gUnknown_810A378 +gUnknown_810A378: @ 810A378 + .incbin "baserom.gba", 0x10A378, 0x18 + + .global gUnknown_810A390 +gUnknown_810A390: @ 810A390 + .incbin "baserom.gba", 0x10A390, 0x60 + + .global gUnknown_810A3F0 +gUnknown_810A3F0: @ 810A3F0 + .incbin "baserom.gba", 0x10A3F0, 0x190 + + .global gUnknown_810A580 +gUnknown_810A580: @ 810A580 + .incbin "baserom.gba", 0x10A580, 0x288 + + .global gUnknown_810A808 +gUnknown_810A808: @ 810A808 + .incbin "baserom.gba", 0x10A808, 0x288 + + .global gUnknown_810AA90 +gUnknown_810AA90: @ 810AA90 + .incbin "baserom.gba", 0x10AA90, 0x1D0 + + .global gUnknown_810AC60 +gUnknown_810AC60: @ 810AC60 + .incbin "baserom.gba", 0x10AC60, 0x2 + + .global gUnknown_810AC62 +gUnknown_810AC62: @ 810AC62 + .incbin "baserom.gba", 0x10AC62, 0x2 + + .global gUnknown_810AC64 +gUnknown_810AC64: @ 810AC64 + .incbin "baserom.gba", 0x10AC64, 0x2 + + .global gUnknown_810AC66 +gUnknown_810AC66: @ 810AC66 + .incbin "baserom.gba", 0x10AC66, 0x2 + + .global gUnknown_810AC68 +gUnknown_810AC68: @ 810AC68 + .incbin "baserom.gba", 0x10AC68, 0x2 + + .global gUnknown_810AC6A +gUnknown_810AC6A: @ 810AC6A + .incbin "baserom.gba", 0x10AC6A, 0x12 + + .global gUnknown_810AC7C +gUnknown_810AC7C: @ 810AC7C + .incbin "baserom.gba", 0x10AC7C, 0x14 + + .global gUnknown_810AC90 +gUnknown_810AC90: @ 810AC90 + .incbin "baserom.gba", 0x10AC90, 0x28 + + .global gUnknown_810ACB8 +gUnknown_810ACB8: @ 810ACB8 + .incbin "baserom.gba", 0x10ACB8, 0x2 + + .global gUnknown_810ACBA +gUnknown_810ACBA: @ 810ACBA + .incbin "baserom.gba", 0x10ACBA, 0x2 + + .global gUnknown_810ACBC +gUnknown_810ACBC: @ 810ACBC + .incbin "baserom.gba", 0x10ACBC, 0x2 + + .global gUnknown_810ACBE +gUnknown_810ACBE: @ 810ACBE + .incbin "baserom.gba", 0x10ACBE, 0x2 + + .global gUnknown_810ACC0 +gUnknown_810ACC0: @ 810ACC0 + .incbin "baserom.gba", 0x10ACC0, 0x4C + + .global gUnknown_810AD0C +gUnknown_810AD0C: @ 810AD0C + .incbin "baserom.gba", 0x10AD0C, 0x40 + + .global gUnknown_810AD4C +gUnknown_810AD4C: @ 810AD4C + .incbin "baserom.gba", 0x10AD4C, 0xD8 + + .global gUnknown_810AE24 +gUnknown_810AE24: @ 810AE24 + .incbin "baserom.gba", 0x10AE24, 0x12C + + .global gUnknown_810AF50 +gUnknown_810AF50: @ 810AF50 + .incbin "baserom.gba", 0x10AF50, 0xFC + + .global gUnknown_810B04C +gUnknown_810B04C: @ 810B04C + .incbin "baserom.gba", 0x10B04C, 0x400 + + .global gUnknown_810B44C +gUnknown_810B44C: @ 810B44C + .incbin "baserom.gba", 0x10B44C, 0x7C + + .global gUnknown_810B4C8 +gUnknown_810B4C8: @ 810B4C8 + .incbin "baserom.gba", 0x10B4C8, 0x4C0 + + .global gUnknown_810B988 +gUnknown_810B988: @ 810B988 + .incbin "baserom.gba", 0x10B988, 0x1284 + + .global gUnknown_810CC0C +gUnknown_810CC0C: @ 810CC0C + .incbin "baserom.gba", 0x10CC0C, 0x2F4 + + .global gUnknown_810CF00 +gUnknown_810CF00: @ 810CF00 + .incbin "baserom.gba", 0x10CF00, 0xC + + .global gUnknown_810CF0C +gUnknown_810CF0C: @ 810CF0C + .incbin "baserom.gba", 0x10CF0C, 0x10 + + .global gUnknown_810CF1C +gUnknown_810CF1C: @ 810CF1C + .incbin "baserom.gba", 0x10CF1C, 0x70C + + .global gUnknown_810D628 +gUnknown_810D628: @ 810D628 + .incbin "baserom.gba", 0x10D628, 0x730 + + .global gUnknown_810DD58 +gUnknown_810DD58: @ 810DD58 + .incbin "baserom.gba", 0x10DD58, 0x10 + + .global gUnknown_810DD68 +gUnknown_810DD68: @ 810DD68 + .incbin "baserom.gba", 0x10DD68, 0x18 + + .global gUnknown_810DD80 +gUnknown_810DD80: @ 810DD80 + .incbin "baserom.gba", 0x10DD80, 0x1C + + .global gUnknown_810DD9C +gUnknown_810DD9C: @ 810DD9C + .incbin "baserom.gba", 0x10DD9C, 0x1C + + .global gUnknown_810DDB8 +gUnknown_810DDB8: @ 810DDB8 + .incbin "baserom.gba", 0x10DDB8, 0x18 + + .global gUnknown_810DDD0 +gUnknown_810DDD0: @ 810DDD0 + .incbin "baserom.gba", 0x10DDD0, 0x14 + + .global gUnknown_810DDE4 +gUnknown_810DDE4: @ 810DDE4 + .incbin "baserom.gba", 0x10DDE4, 0x18 + + .global gUnknown_810DDFC +gUnknown_810DDFC: @ 810DDFC + .incbin "baserom.gba", 0x10DDFC, 0x10 + + .global gUnknown_810DE0C +gUnknown_810DE0C: @ 810DE0C + .incbin "baserom.gba", 0x10DE0C, 0x14 + + .global gUnknown_810DE20 +gUnknown_810DE20: @ 810DE20 + .incbin "baserom.gba", 0x10DE20, 0x4 + + .global gUnknown_810DE24 +gUnknown_810DE24: @ 810DE24 + .incbin "baserom.gba", 0x10DE24, 0x4 + + .global gUnknown_810DE28 +gUnknown_810DE28: @ 810DE28 + .incbin "baserom.gba", 0x10DE28, 0x10 + + .global gUnknown_810DE38 +gUnknown_810DE38: @ 810DE38 + .incbin "baserom.gba", 0x10DE38, 0x14 + + .global gUnknown_810DE4C +gUnknown_810DE4C: @ 810DE4C + .incbin "baserom.gba", 0x10DE4C, 0x4 + + .global gUnknown_810DE50 +gUnknown_810DE50: @ 810DE50 + .incbin "baserom.gba", 0x10DE50, 0x4 + + .global gUnknown_810DE54 +gUnknown_810DE54: @ 810DE54 + .incbin "baserom.gba", 0x10DE54, 0x4 + + .global gUnknown_810DE58 +gUnknown_810DE58: @ 810DE58 + .incbin "baserom.gba", 0x10DE58, 0x14 + + .global gUnknown_810DE6C +gUnknown_810DE6C: @ 810DE6C + .incbin "baserom.gba", 0x10DE6C, 0x14 + + .global gUnknown_810DE80 +gUnknown_810DE80: @ 810DE80 + .incbin "baserom.gba", 0x10DE80, 0x18 + + .global gUnknown_810DE98 +gUnknown_810DE98: @ 810DE98 + .incbin "baserom.gba", 0x10DE98, 0x1C + + .global gUnknown_810DEB4 +gUnknown_810DEB4: @ 810DEB4 + .incbin "baserom.gba", 0x10DEB4, 0x14 + + .global gUnknown_810DEC8 +gUnknown_810DEC8: @ 810DEC8 + .incbin "baserom.gba", 0x10DEC8, 0x14 + + .global gUnknown_810DEDC +gUnknown_810DEDC: @ 810DEDC + .incbin "baserom.gba", 0x10DEDC, 0x18 + + .global gUnknown_810DEF4 +gUnknown_810DEF4: @ 810DEF4 + .incbin "baserom.gba", 0x10DEF4, 0x84 + + .global gUnknown_810DF78 +gUnknown_810DF78: @ 810DF78 + .incbin "baserom.gba", 0x10DF78, 0xC + + .global gUnknown_810DF84 +gUnknown_810DF84: @ 810DF84 + .incbin "baserom.gba", 0x10DF84, 0x14 + + .global gUnknown_810DF98 +gUnknown_810DF98: @ 810DF98 + .incbin "baserom.gba", 0x10DF98, 0x1C + + .global gUnknown_810DFB4 +gUnknown_810DFB4: @ 810DFB4 + .incbin "baserom.gba", 0x10DFB4, 0x14 + + .global gUnknown_810DFC8 +gUnknown_810DFC8: @ 810DFC8 + .incbin "baserom.gba", 0x10DFC8, 0x4 + + .global gUnknown_810DFCC +gUnknown_810DFCC: @ 810DFCC + .incbin "baserom.gba", 0x10DFCC, 0x60 + + .global gUnknown_810E02C +gUnknown_810E02C: @ 810E02C + .incbin "baserom.gba", 0x10E02C, 0x48 + + .global gUnknown_810E074 +gUnknown_810E074: @ 810E074 + .incbin "baserom.gba", 0x10E074, 0x39B4 + + .global gUnknown_8111A28 +gUnknown_8111A28: @ 8111A28 + .incbin "baserom.gba", 0x111A28, 0x80C + + .global gUnknown_8112234 +gUnknown_8112234: @ 8112234 + .incbin "baserom.gba", 0x112234, 0x1D8 + + .global gUnknown_811240C +gUnknown_811240C: @ 811240C + .incbin "baserom.gba", 0x11240C, 0x808 + + .global gUnknown_8112C14 +gUnknown_8112C14: @ 8112C14 + .incbin "baserom.gba", 0x112C14, 0xE8 + + .global gUnknown_8112CFC +gUnknown_8112CFC: @ 8112CFC + .incbin "baserom.gba", 0x112CFC, 0x384 + + .global gUnknown_8113080 +gUnknown_8113080: @ 8113080 + .incbin "baserom.gba", 0x113080, 0x7BC + + .global gUnknown_811383C +gUnknown_811383C: @ 811383C + .incbin "baserom.gba", 0x11383C, 0x14 + + .global gUnknown_8113850 +gUnknown_8113850: @ 8113850 + .incbin "baserom.gba", 0x113850, 0x18 + + .global gUnknown_8113868 +gUnknown_8113868: @ 8113868 + .incbin "baserom.gba", 0x113868, 0x8 + + .global gUnknown_8113870 +gUnknown_8113870: @ 8113870 + .incbin "baserom.gba", 0x113870, 0x28 + + .global gUnknown_8113898 +gUnknown_8113898: @ 8113898 + .incbin "baserom.gba", 0x113898, 0x28 + + .global gUnknown_81138C0 +gUnknown_81138C0: @ 81138C0 + .incbin "baserom.gba", 0x1138C0, 0x10 + + .global gUnknown_81138D0 +gUnknown_81138D0: @ 81138D0 + .incbin "baserom.gba", 0x1138D0, 0x14 + + .global gUnknown_81138E4 +gUnknown_81138E4: @ 81138E4 + .incbin "baserom.gba", 0x1138E4, 0x1C + + .global gUnknown_8113900 +gUnknown_8113900: @ 8113900 + .incbin "baserom.gba", 0x113900, 0x18 + + .global gUnknown_8113918 +gUnknown_8113918: @ 8113918 + .incbin "baserom.gba", 0x113918, 0x1C + + .global gUnknown_8113934 +gUnknown_8113934: @ 8113934 + .incbin "baserom.gba", 0x113934, 0x1C + + .global gUnknown_8113950 +gUnknown_8113950: @ 8113950 + .incbin "baserom.gba", 0x113950, 0x24 + + .global gUnknown_8113974 +gUnknown_8113974: @ 8113974 + .incbin "baserom.gba", 0x113974, 0x1C + + .global gUnknown_8113990 +gUnknown_8113990: @ 8113990 + .incbin "baserom.gba", 0x113990, 0x24 + + .global gUnknown_81139B4 +gUnknown_81139B4: @ 81139B4 + .incbin "baserom.gba", 0x1139B4, 0x4 + + .global gUnknown_81139B8 +gUnknown_81139B8: @ 81139B8 + .incbin "baserom.gba", 0x1139B8, 0x14 + + .global gUnknown_81139CC +gUnknown_81139CC: @ 81139CC + .incbin "baserom.gba", 0x1139CC, 0x4 + + .global gUnknown_81139D0 +gUnknown_81139D0: @ 81139D0 + .incbin "baserom.gba", 0x1139D0, 0x460 + + .global gUnknown_8113E30 +gUnknown_8113E30: @ 8113E30 + .incbin "baserom.gba", 0x113E30, 0x18E8 + + .global gUnknown_8115718 +gUnknown_8115718: @ 8115718 + .incbin "baserom.gba", 0x115718, 0x258 + + .global gUnknown_8115970 +gUnknown_8115970: @ 8115970 + .incbin "baserom.gba", 0x115970, 0x6C + + .global gUnknown_81159DC +gUnknown_81159DC: @ 81159DC + .incbin "baserom.gba", 0x1159DC, 0x50 + + .global gUnknown_8115A2C +gUnknown_8115A2C: @ 8115A2C + .incbin "baserom.gba", 0x115A2C, 0x54 + + .global gUnknown_8115A80 +gUnknown_8115A80: @ 8115A80 + .incbin "baserom.gba", 0x115A80, 0x5C + + .global gUnknown_8115ADC +gUnknown_8115ADC: @ 8115ADC + .incbin "baserom.gba", 0x115ADC, 0x60 + + .global gUnknown_8115B3C +gUnknown_8115B3C: @ 8115B3C + .incbin "baserom.gba", 0x115B3C, 0x68 + + .global gUnknown_8115BA4 +gUnknown_8115BA4: @ 8115BA4 + .incbin "baserom.gba", 0x115BA4, 0x50 + + .global gUnknown_8115BF4 +gUnknown_8115BF4: @ 8115BF4 + .incbin "baserom.gba", 0x115BF4, 0x58 + + .global gUnknown_8115C4C +gUnknown_8115C4C: @ 8115C4C + .incbin "baserom.gba", 0x115C4C, 0x6C + + .global gUnknown_8115CB8 +gUnknown_8115CB8: @ 8115CB8 + .incbin "baserom.gba", 0x115CB8, 0x5C + + .global gUnknown_8115D14 +gUnknown_8115D14: @ 8115D14 + .incbin "baserom.gba", 0x115D14, 0x48 + + .global gUnknown_8115D5C +gUnknown_8115D5C: @ 8115D5C + .incbin "baserom.gba", 0x115D5C, 0x38 + + .global gUnknown_8115D94 +gUnknown_8115D94: @ 8115D94 + .incbin "baserom.gba", 0x115D94, 0x40 + + .global gUnknown_8115DD4 +gUnknown_8115DD4: @ 8115DD4 + .incbin "baserom.gba", 0x115DD4, 0x2C + + .global gUnknown_8115E00 +gUnknown_8115E00: @ 8115E00 + .incbin "baserom.gba", 0x115E00, 0x28 + + .global gUnknown_8115E28 +gUnknown_8115E28: @ 8115E28 + .incbin "baserom.gba", 0x115E28, 0x2C + + .global gUnknown_8115E54 +gUnknown_8115E54: @ 8115E54 + .incbin "baserom.gba", 0x115E54, 0x2C + + .global gUnknown_8115E80 +gUnknown_8115E80: @ 8115E80 + .incbin "baserom.gba", 0x115E80, 0x14 + + .global gUnknown_8115E94 +gUnknown_8115E94: @ 8115E94 + .incbin "baserom.gba", 0x115E94, 0xC8 + + .global gUnknown_8115F5C +gUnknown_8115F5C: @ 8115F5C + .incbin "baserom.gba", 0x115F5C, 0x24 + + .global gUnknown_8115F80 +gUnknown_8115F80: @ 8115F80 + .incbin "baserom.gba", 0x115F80, 0x24 + + .global gUnknown_8115FA4 +gUnknown_8115FA4: @ 8115FA4 + .incbin "baserom.gba", 0x115FA4, 0x24 + + .global gUnknown_8115FC8 +gUnknown_8115FC8: @ 8115FC8 + .incbin "baserom.gba", 0x115FC8, 0x20 + + .global gUnknown_8115FE8 +gUnknown_8115FE8: @ 8115FE8 + .incbin "baserom.gba", 0x115FE8, 0x34 + + .global gUnknown_811601C +gUnknown_811601C: @ 811601C + .incbin "baserom.gba", 0x11601C, 0xC + + .global gUnknown_8116028 +gUnknown_8116028: @ 8116028 + .incbin "baserom.gba", 0x116028, 0x18 + + .global gUnknown_8116040 +gUnknown_8116040: @ 8116040 + .incbin "baserom.gba", 0x116040, 0xA8 + + .global gUnknown_81160E8 +gUnknown_81160E8: @ 81160E8 + .incbin "baserom.gba", 0x1160E8, 0x24 + + .global gUnknown_811610C +gUnknown_811610C: @ 811610C + .incbin "baserom.gba", 0x11610C, 0x20 + + .global gUnknown_811612C +gUnknown_811612C: @ 811612C + .incbin "baserom.gba", 0x11612C, 0x8 + + .global gUnknown_8116134 +gUnknown_8116134: @ 8116134 + .incbin "baserom.gba", 0x116134, 0x14 + + .global gUnknown_8116148 +gUnknown_8116148: @ 8116148 + .incbin "baserom.gba", 0x116148, 0x14 + + .global gUnknown_811615C +gUnknown_811615C: @ 811615C + .incbin "baserom.gba", 0x11615C, 0x10 + + .global gUnknown_811616C +gUnknown_811616C: @ 811616C + .incbin "baserom.gba", 0x11616C, 0x10 + + .global gUnknown_811617C +gUnknown_811617C: @ 811617C + .incbin "baserom.gba", 0x11617C, 0x4 + + .global gUnknown_8116180 +gUnknown_8116180: @ 8116180 + .incbin "baserom.gba", 0x116180, 0x8 + + .global gUnknown_8116188 +gUnknown_8116188: @ 8116188 + .incbin "baserom.gba", 0x116188, 0x8 + + .global gUnknown_8116190 +gUnknown_8116190: @ 8116190 + .incbin "baserom.gba", 0x116190, 0x18 + + .global gUnknown_81161A8 +gUnknown_81161A8: @ 81161A8 + .incbin "baserom.gba", 0x1161A8, 0x10 + + .global gUnknown_81161B8 +gUnknown_81161B8: @ 81161B8 + .incbin "baserom.gba", 0x1161B8, 0x10 + + .global gUnknown_81161C8 +gUnknown_81161C8: @ 81161C8 + .incbin "baserom.gba", 0x1161C8, 0x10 + + .global gUnknown_81161D8 +gUnknown_81161D8: @ 81161D8 + .incbin "baserom.gba", 0x1161D8, 0x10 + + .global gUnknown_81161E8 +gUnknown_81161E8: @ 81161E8 + .incbin "baserom.gba", 0x1161E8, 0x10 + + .global gUnknown_81161F8 +gUnknown_81161F8: @ 81161F8 + .incbin "baserom.gba", 0x1161F8, 0x10 + + .global gUnknown_8116208 +gUnknown_8116208: @ 8116208 + .incbin "baserom.gba", 0x116208, 0x10 + + .global gUnknown_8116218 +gUnknown_8116218: @ 8116218 + .incbin "baserom.gba", 0x116218, 0x10 + + .global gUnknown_8116228 +gUnknown_8116228: @ 8116228 + .incbin "baserom.gba", 0x116228, 0x10 + + .global gUnknown_8116238 +gUnknown_8116238: @ 8116238 + .incbin "baserom.gba", 0x116238, 0x10 + + .global gUnknown_8116248 +gUnknown_8116248: @ 8116248 + .incbin "baserom.gba", 0x116248, 0x10 + + .global gUnknown_8116258 +gUnknown_8116258: @ 8116258 + .incbin "baserom.gba", 0x116258, 0x10 + + .global gUnknown_8116268 +gUnknown_8116268: @ 8116268 + .incbin "baserom.gba", 0x116268, 0x10 + + .global gUnknown_8116278 +gUnknown_8116278: @ 8116278 + .incbin "baserom.gba", 0x116278, 0x10 + + .global gUnknown_8116288 +gUnknown_8116288: @ 8116288 + .incbin "baserom.gba", 0x116288, 0x10 + + .global gUnknown_8116298 +gUnknown_8116298: @ 8116298 + .incbin "baserom.gba", 0x116298, 0x10 + + .global gUnknown_81162A8 +gUnknown_81162A8: @ 81162A8 + .incbin "baserom.gba", 0x1162A8, 0x10 + + .global gUnknown_81162B8 +gUnknown_81162B8: @ 81162B8 + .incbin "baserom.gba", 0x1162B8, 0x10 + + .global gUnknown_81162C8 +gUnknown_81162C8: @ 81162C8 + .incbin "baserom.gba", 0x1162C8, 0x10 + + .global gUnknown_81162D8 +gUnknown_81162D8: @ 81162D8 + .incbin "baserom.gba", 0x1162D8, 0x10 + + .global gUnknown_81162E8 +gUnknown_81162E8: @ 81162E8 + .incbin "baserom.gba", 0x1162E8, 0x10 + + .global gUnknown_81162F8 +gUnknown_81162F8: @ 81162F8 + .incbin "baserom.gba", 0x1162F8, 0x10 + + .global gUnknown_8116308 +gUnknown_8116308: @ 8116308 + .incbin "baserom.gba", 0x116308, 0x10 + + .global gUnknown_8116318 +gUnknown_8116318: @ 8116318 + .incbin "baserom.gba", 0x116318, 0xA4 + + .global gUnknown_81163BC +gUnknown_81163BC: @ 81163BC + .incbin "baserom.gba", 0x1163BC, 0x28 + + .global gUnknown_81163E4 +gUnknown_81163E4: @ 81163E4 + .incbin "baserom.gba", 0x1163E4, 0xC + + .global gUnknown_81163F0 +gUnknown_81163F0: @ 81163F0 + .incbin "baserom.gba", 0x1163F0, 0x3C + + .global gUnknown_811642C +gUnknown_811642C: @ 811642C + .incbin "baserom.gba", 0x11642C, 0x4C + + .global gUnknown_8116478 +gUnknown_8116478: @ 8116478 + .incbin "baserom.gba", 0x116478, 0x10 + + .global gUnknown_8116488 +gUnknown_8116488: @ 8116488 + .incbin "baserom.gba", 0x116488, 0x54 + + .global gUnknown_81164DC +gUnknown_81164DC: @ 81164DC + .incbin "baserom.gba", 0x1164DC, 0x8 + + .global gUnknown_81164E4 +gUnknown_81164E4: @ 81164E4 + .incbin "baserom.gba", 0x1164E4, 0x54 + + .global gUnknown_8116538 +gUnknown_8116538: @ 8116538 + .incbin "baserom.gba", 0x116538, 0xC + + .global gUnknown_8116544 +gUnknown_8116544: @ 8116544 + .incbin "baserom.gba", 0x116544, 0x1C + + .global gUnknown_8116560 +gUnknown_8116560: @ 8116560 + .incbin "baserom.gba", 0x116560, 0xC + + .global gUnknown_811656C +gUnknown_811656C: @ 811656C + .incbin "baserom.gba", 0x11656C, 0x1C + + .global gUnknown_8116588 +gUnknown_8116588: @ 8116588 + .incbin "baserom.gba", 0x116588, 0xC + + .global gUnknown_8116594 +gUnknown_8116594: @ 8116594 + .incbin "baserom.gba", 0x116594, 0x34 + + .global gUnknown_81165C8 +gUnknown_81165C8: @ 81165C8 + .incbin "baserom.gba", 0x1165C8, 0xC + + .global gUnknown_81165D4 +gUnknown_81165D4: @ 81165D4 + .incbin "baserom.gba", 0x1165D4, 0x20 + + .global gUnknown_81165F4 +gUnknown_81165F4: @ 81165F4 + .incbin "baserom.gba", 0x1165F4, 0x18 + + .global gUnknown_811660C +gUnknown_811660C: @ 811660C + .incbin "baserom.gba", 0x11660C, 0x1C + + .global gUnknown_8116628 +gUnknown_8116628: @ 8116628 + .incbin "baserom.gba", 0x116628, 0x1C + + .global gUnknown_8116644 +gUnknown_8116644: @ 8116644 + .incbin "baserom.gba", 0x116644, 0x20 + + .global gUnknown_8116664 +gUnknown_8116664: @ 8116664 + .incbin "baserom.gba", 0x116664, 0x20 + + .global gUnknown_8116684 +gUnknown_8116684: @ 8116684 + .incbin "baserom.gba", 0x116684, 0x30 + + .global gUnknown_81166B4 +gUnknown_81166B4: @ 81166B4 + .incbin "baserom.gba", 0x1166B4, 0xC + + .global gUnknown_81166C0 +gUnknown_81166C0: @ 81166C0 + .incbin "baserom.gba", 0x1166C0, 0x18 + + .global gUnknown_81166D8 +gUnknown_81166D8: @ 81166D8 + .incbin "baserom.gba", 0x1166D8, 0x20 + + .global gUnknown_81166F8 +gUnknown_81166F8: @ 81166F8 + .incbin "baserom.gba", 0x1166F8, 0xC + + .global gUnknown_8116704 +gUnknown_8116704: @ 8116704 + .incbin "baserom.gba", 0x116704, 0xC + + .global gUnknown_8116710 +gUnknown_8116710: @ 8116710 + .incbin "baserom.gba", 0x116710, 0x28 + + .global gUnknown_8116738 +gUnknown_8116738: @ 8116738 + .incbin "baserom.gba", 0x116738, 0x28 + + .global gUnknown_8116760 +gUnknown_8116760: @ 8116760 + .incbin "baserom.gba", 0x116760, 0x28 + + .global gUnknown_8116788 +gUnknown_8116788: @ 8116788 + .incbin "baserom.gba", 0x116788, 0x4 + + .global gUnknown_811678C +gUnknown_811678C: @ 811678C + .incbin "baserom.gba", 0x11678C, 0x4 + + .global gUnknown_8116790 +gUnknown_8116790: @ 8116790 + .incbin "baserom.gba", 0x116790, 0x4 + + .global gUnknown_8116794 +gUnknown_8116794: @ 8116794 + .incbin "baserom.gba", 0x116794, 0x28 + + .global gUnknown_81167BC +gUnknown_81167BC: @ 81167BC + .incbin "baserom.gba", 0x1167BC, 0x28 + + .global gUnknown_81167E4 +gUnknown_81167E4: @ 81167E4 + .incbin "baserom.gba", 0x1167E4, 0x4 + + .global gUnknown_81167E8 +gUnknown_81167E8: @ 81167E8 + .incbin "baserom.gba", 0x1167E8, 0x4 + + .global gUnknown_81167EC +gUnknown_81167EC: @ 81167EC + .incbin "baserom.gba", 0x1167EC, 0x30 + + .global gUnknown_811681C +gUnknown_811681C: @ 811681C + .incbin "baserom.gba", 0x11681C, 0x28 + + .global gUnknown_8116844 +gUnknown_8116844: @ 8116844 + .incbin "baserom.gba", 0x116844, 0x4 + + .global gUnknown_8116848 +gUnknown_8116848: @ 8116848 + .incbin "baserom.gba", 0x116848, 0x60 + + .global gUnknown_81168A8 +gUnknown_81168A8: @ 81168A8 + .incbin "baserom.gba", 0x1168A8, 0x67C + + .global gUnknown_8116F24 +gUnknown_8116F24: @ 8116F24 + .incbin "baserom.gba", 0x116F24, 0x76 + + .global gUnknown_8116F9A +gUnknown_8116F9A: @ 8116F9A + .incbin "baserom.gba", 0x116F9A, 0x66 + + .global gUnknown_8117000 +gUnknown_8117000: @ 8117000 + .incbin "baserom.gba", 0x117000, 0x2B8 + + .global gUnknown_81172B8 +gUnknown_81172B8: @ 81172B8 + .incbin "baserom.gba", 0x1172B8, 0x30 + + .global gUnknown_81172E8 +gUnknown_81172E8: @ 81172E8 + .incbin "baserom.gba", 0x1172E8, 0xC + + .global gUnknown_81172F4 +gUnknown_81172F4: @ 81172F4 + .incbin "baserom.gba", 0x1172F4, 0x20 + + .global gUnknown_8117314 +gUnknown_8117314: @ 8117314 + .incbin "baserom.gba", 0x117314, 0x10 + + .global gUnknown_8117324 +gUnknown_8117324: @ 8117324 + .incbin "baserom.gba", 0x117324, 0x18 + + .global gUnknown_811733C +gUnknown_811733C: @ 811733C + .incbin "baserom.gba", 0x11733C, 0x18 + + .global gUnknown_8117354 +gUnknown_8117354: @ 8117354 + .incbin "baserom.gba", 0x117354, 0x18 + + .global gUnknown_811736C +gUnknown_811736C: @ 811736C + .incbin "baserom.gba", 0x11736C, 0x54 + + .global gUnknown_81173C0 +gUnknown_81173C0: @ 81173C0 + .incbin "baserom.gba", 0x1173C0, 0x178 + + .global gUnknown_8117538 +gUnknown_8117538: @ 8117538 + .incbin "baserom.gba", 0x117538, 0x28 + + .global gUnknown_8117560 +gUnknown_8117560: @ 8117560 + .incbin "baserom.gba", 0x117560, 0xC + + .global gUnknown_811756C +gUnknown_811756C: @ 811756C + .incbin "baserom.gba", 0x11756C, 0x28 + + .global gUnknown_8117594 +gUnknown_8117594: @ 8117594 + .incbin "baserom.gba", 0x117594, 0x4C + + .global gUnknown_81175E0 +gUnknown_81175E0: @ 81175E0 + .incbin "baserom.gba", 0x1175E0, 0xC + + .global gUnknown_81175EC +gUnknown_81175EC: @ 81175EC + .incbin "baserom.gba", 0x1175EC, 0x58 + + .global gUnknown_8117644 +gUnknown_8117644: @ 8117644 + .incbin "baserom.gba", 0x117644, 0xC + + .global gUnknown_8117650 +gUnknown_8117650: @ 8117650 + .incbin "baserom.gba", 0x117650, 0x48 + + .global gUnknown_8117698 +gUnknown_8117698: @ 8117698 + .incbin "baserom.gba", 0x117698, 0xC + + .global gUnknown_81176A4 +gUnknown_81176A4: @ 81176A4 + .incbin "baserom.gba", 0x1176A4, 0x2C + + .global gUnknown_81176D0 +gUnknown_81176D0: @ 81176D0 + .incbin "baserom.gba", 0x1176D0, 0xC + + .global gUnknown_81176DC +gUnknown_81176DC: @ 81176DC + .incbin "baserom.gba", 0x1176DC, 0x1C + + .global gUnknown_81176F8 +gUnknown_81176F8: @ 81176F8 + .incbin "baserom.gba", 0x1176F8, 0x8 + + .global gUnknown_8117700 +gUnknown_8117700: @ 8117700 + .incbin "baserom.gba", 0x117700, 0x34 + + .global gUnknown_8117734 +gUnknown_8117734: @ 8117734 + .incbin "baserom.gba", 0x117734, 0xC + + .global gUnknown_8117740 +gUnknown_8117740: @ 8117740 + .incbin "baserom.gba", 0x117740, 0x14 + + .global gUnknown_8117754 +gUnknown_8117754: @ 8117754 + .incbin "baserom.gba", 0x117754, 0x1C + + .global gUnknown_8117770 +gUnknown_8117770: @ 8117770 + .incbin "baserom.gba", 0x117770, 0x14 + + .global gUnknown_8117784 +gUnknown_8117784: @ 8117784 + .incbin "baserom.gba", 0x117784, 0x18 + + .global gUnknown_811779C +gUnknown_811779C: @ 811779C + .incbin "baserom.gba", 0x11779C, 0x20 + + .global gUnknown_81177BC +gUnknown_81177BC: @ 81177BC + .incbin "baserom.gba", 0x1177BC, 0x10 + + .global gUnknown_81177CC +gUnknown_81177CC: @ 81177CC + .incbin "baserom.gba", 0x1177CC, 0xC + + .global gUnknown_81177D8 +gUnknown_81177D8: @ 81177D8 + .incbin "baserom.gba", 0x1177D8, 0x14 + + .global gUnknown_81177EC +gUnknown_81177EC: @ 81177EC + .incbin "baserom.gba", 0x1177EC, 0x8 + + .global gUnknown_81177F4 +gUnknown_81177F4: @ 81177F4 + .incbin "baserom.gba", 0x1177F4, 0x64 + + .global gUnknown_8117858 +gUnknown_8117858: @ 8117858 + .incbin "baserom.gba", 0x117858, 0xC + + .global gUnknown_8117864 +gUnknown_8117864: @ 8117864 + .incbin "baserom.gba", 0x117864, 0x24 + + .global gUnknown_8117888 +gUnknown_8117888: @ 8117888 + .incbin "baserom.gba", 0x117888, 0xC + + .global gUnknown_8117894 +gUnknown_8117894: @ 8117894 + .incbin "baserom.gba", 0x117894, 0x2C + + .global gUnknown_81178C0 +gUnknown_81178C0: @ 81178C0 + .incbin "baserom.gba", 0x1178C0, 0x20 + + .global gUnknown_81178E0 +gUnknown_81178E0: @ 81178E0 + .incbin "baserom.gba", 0x1178E0, 0x14 + + .global gUnknown_81178F4 +gUnknown_81178F4: @ 81178F4 + .incbin "baserom.gba", 0x1178F4, 0x1F0 + + .global gUnknown_8117AE4 +gUnknown_8117AE4: @ 8117AE4 + .incbin "baserom.gba", 0x117AE4, 0x3A8 + + .global gUnknown_8117E8C +gUnknown_8117E8C: @ 8117E8C + .incbin "baserom.gba", 0x117E8C, 0x50 + + .global gUnknown_8117EDC +gUnknown_8117EDC: @ 8117EDC + .incbin "baserom.gba", 0x117EDC, 0x20 + + .global gUnknown_8117EFC +gUnknown_8117EFC: @ 8117EFC + .incbin "baserom.gba", 0x117EFC, 0x14 + + .global gUnknown_8117F10 +gUnknown_8117F10: @ 8117F10 + .incbin "baserom.gba", 0x117F10, 0x54 + + .global gUnknown_8117F64 +gUnknown_8117F64: @ 8117F64 + .incbin "baserom.gba", 0x117F64, 0x6A + + .global gUnknown_8117FCE +gUnknown_8117FCE: @ 8117FCE + .incbin "baserom.gba", 0x117FCE, 0x22 + + .global gUnknown_8117FF0 +gUnknown_8117FF0: @ 8117FF0 + .incbin "baserom.gba", 0x117FF0, 0x20 + + .global gUnknown_8118010 +gUnknown_8118010: @ 8118010 + .incbin "baserom.gba", 0x118010, 0x20 + + .global gUnknown_8118030 +gUnknown_8118030: @ 8118030 + .incbin "baserom.gba", 0x118030, 0x20 + + .global gUnknown_8118050 +gUnknown_8118050: @ 8118050 + .incbin "baserom.gba", 0x118050, 0x3C + + .global gUnknown_811808C +gUnknown_811808C: @ 811808C + .incbin "baserom.gba", 0x11808C, 0xC + + .global gUnknown_8118098 +gUnknown_8118098: @ 8118098 + .incbin "baserom.gba", 0x118098, 0x24 + + .global gUnknown_81180BC +gUnknown_81180BC: @ 81180BC + .incbin "baserom.gba", 0x1180BC, 0x1C + + .global gUnknown_81180D8 +gUnknown_81180D8: @ 81180D8 + .incbin "baserom.gba", 0x1180D8, 0x18 + + .global gUnknown_81180F0 +gUnknown_81180F0: @ 81180F0 + .incbin "baserom.gba", 0x1180F0, 0xC + + .global gUnknown_81180FC +gUnknown_81180FC: @ 81180FC + .incbin "baserom.gba", 0x1180FC, 0x20 + + .global gUnknown_811811C +gUnknown_811811C: @ 811811C + .incbin "baserom.gba", 0x11811C, 0x54 + + .global gUnknown_8118170 +gUnknown_8118170: @ 8118170 + .incbin "baserom.gba", 0x118170, 0xC + + .global gUnknown_811817C +gUnknown_811817C: @ 811817C + .incbin "baserom.gba", 0x11817C, 0xC + + .global gUnknown_8118188 +gUnknown_8118188: @ 8118188 + .incbin "baserom.gba", 0x118188, 0xC + + .global gUnknown_8118194 +gUnknown_8118194: @ 8118194 + .incbin "baserom.gba", 0x118194, 0x1C + + .global gUnknown_81181B0 +gUnknown_81181B0: @ 81181B0 + .incbin "baserom.gba", 0x1181B0, 0x44 + + .global gUnknown_81181F4 +gUnknown_81181F4: @ 81181F4 + .incbin "baserom.gba", 0x1181F4, 0x24 + + .global gUnknown_8118218 +gUnknown_8118218: @ 8118218 + .incbin "baserom.gba", 0x118218, 0x38 + + .global gUnknown_8118250 +gUnknown_8118250: @ 8118250 + .incbin "baserom.gba", 0x118250, 0xC + + .global gUnknown_811825C +gUnknown_811825C: @ 811825C + .incbin "baserom.gba", 0x11825C, 0x24 + + .global gUnknown_8118280 +gUnknown_8118280: @ 8118280 + .incbin "baserom.gba", 0x118280, 0xC + + .global gUnknown_811828C +gUnknown_811828C: @ 811828C + .incbin "baserom.gba", 0x11828C, 0x14 + + .global gUnknown_81182A0 +gUnknown_81182A0: @ 81182A0 + .incbin "baserom.gba", 0x1182A0, 0x54 + + .global gUnknown_81182F4 +gUnknown_81182F4: @ 81182F4 + .incbin "baserom.gba", 0x1182F4, 0x5C + + .global gUnknown_8118350 +gUnknown_8118350: @ 8118350 + .incbin "baserom.gba", 0x118350, 0x50 + + .global gUnknown_81183A0 +gUnknown_81183A0: @ 81183A0 + .incbin "baserom.gba", 0x1183A0, 0x44 + + .global gUnknown_81183E4 +gUnknown_81183E4: @ 81183E4 + .incbin "baserom.gba", 0x1183E4, 0xC + + .global gUnknown_81183F0 +gUnknown_81183F0: @ 81183F0 + .incbin "baserom.gba", 0x1183F0, 0x24 + + .global gUnknown_8118414 +gUnknown_8118414: @ 8118414 + .incbin "baserom.gba", 0x118414, 0x18 + + .global gUnknown_811842C +gUnknown_811842C: @ 811842C + .incbin "baserom.gba", 0x11842C, 0x1C + + .global gUnknown_8118448 +gUnknown_8118448: @ 8118448 + .incbin "baserom.gba", 0x118448, 0x5C + + .global gUnknown_81184A4 +gUnknown_81184A4: @ 81184A4 + .incbin "baserom.gba", 0x1184A4, 0xC + + .global gUnknown_81184B0 +gUnknown_81184B0: @ 81184B0 + .incbin "baserom.gba", 0x1184B0, 0x1C + + .global gUnknown_81184CC +gUnknown_81184CC: @ 81184CC + .incbin "baserom.gba", 0x1184CC, 0x38 + + .global gUnknown_8118504 +gUnknown_8118504: @ 8118504 + .incbin "baserom.gba", 0x118504, 0x20 + + .global gUnknown_8118524 +gUnknown_8118524: @ 8118524 + .incbin "baserom.gba", 0x118524, 0xC + + .global gUnknown_8118530 +gUnknown_8118530: @ 8118530 + .incbin "baserom.gba", 0x118530, 0x14 + + .global gUnknown_8118544 +gUnknown_8118544: @ 8118544 + .incbin "baserom.gba", 0x118544, 0xAE + + .global gUnknown_81185F2 +gUnknown_81185F2: @ 81185F2 + .incbin "baserom.gba", 0x1185F2, 0x1E + + .global gUnknown_8118610 +gUnknown_8118610: @ 8118610 + .incbin "baserom.gba", 0x118610, 0xC + + .global gUnknown_811861C +gUnknown_811861C: @ 811861C + .incbin "baserom.gba", 0x11861C, 0x24 + + .global gUnknown_8118640 +gUnknown_8118640: @ 8118640 + .incbin "baserom.gba", 0x118640, 0x18 + + .global gUnknown_8118658 +gUnknown_8118658: @ 8118658 + .incbin "baserom.gba", 0x118658, 0x1C + + .global gUnknown_8118674 +gUnknown_8118674: @ 8118674 + .incbin "baserom.gba", 0x118674, 0x58 + + .global gUnknown_81186CC +gUnknown_81186CC: @ 81186CC + .incbin "baserom.gba", 0x1186CC, 0xC + + .global gUnknown_81186D8 +gUnknown_81186D8: @ 81186D8 + .incbin "baserom.gba", 0x1186D8, 0x1C + + .global gUnknown_81186F4 +gUnknown_81186F4: @ 81186F4 + .incbin "baserom.gba", 0x1186F4, 0x38 + + .global gUnknown_811872C +gUnknown_811872C: @ 811872C + .incbin "baserom.gba", 0x11872C, 0x20 + + .global gUnknown_811874C +gUnknown_811874C: @ 811874C + .incbin "baserom.gba", 0x11874C, 0xC + + .global gUnknown_8118758 +gUnknown_8118758: @ 8118758 + .incbin "baserom.gba", 0x118758, 0x40 + + .global gUnknown_8118798 +gUnknown_8118798: @ 8118798 + .incbin "baserom.gba", 0x118798, 0x44 + + .global gUnknown_81187DC +gUnknown_81187DC: @ 81187DC + .incbin "baserom.gba", 0x1187DC, 0xC + + .global gUnknown_81187E8 +gUnknown_81187E8: @ 81187E8 + .incbin "baserom.gba", 0x1187E8, 0x24 + + .global gUnknown_811880C +gUnknown_811880C: @ 811880C + .incbin "baserom.gba", 0x11880C, 0x1C + + .global gUnknown_8118828 +gUnknown_8118828: @ 8118828 + .incbin "baserom.gba", 0x118828, 0x44 + + .global gUnknown_811886C +gUnknown_811886C: @ 811886C + .incbin "baserom.gba", 0x11886C, 0x24 + + .global gUnknown_8118890 +gUnknown_8118890: @ 8118890 + .incbin "baserom.gba", 0x118890, 0xC + + .global gUnknown_811889C +gUnknown_811889C: @ 811889C + .incbin "baserom.gba", 0x11889C, 0xC + + .global gUnknown_81188A8 +gUnknown_81188A8: @ 81188A8 + .incbin "baserom.gba", 0x1188A8, 0xC + + .global gUnknown_81188B4 +gUnknown_81188B4: @ 81188B4 + .incbin "baserom.gba", 0x1188B4, 0xC + + .global gUnknown_81188C0 +gUnknown_81188C0: @ 81188C0 + .incbin "baserom.gba", 0x1188C0, 0xC + + .global gUnknown_81188CC +gUnknown_81188CC: @ 81188CC + .incbin "baserom.gba", 0x1188CC, 0x10 + + .global gUnknown_81188DC +gUnknown_81188DC: @ 81188DC + .incbin "baserom.gba", 0x1188DC, 0x14 + + .global gUnknown_81188F0 +gUnknown_81188F0: @ 81188F0 + .incbin "baserom.gba", 0x1188F0, 0x3204 + + .global gUnknown_811BAF4 +gUnknown_811BAF4: @ 811BAF4 + .incbin "baserom.gba", 0x11BAF4, 0x2764 + + .global gUnknown_811E258 +gUnknown_811E258: @ 811E258 + .incbin "baserom.gba", 0x11E258, 0x39C + + .global gUnknown_811E5F4 +gUnknown_811E5F4: @ 811E5F4 + .incbin "baserom.gba", 0x11E5F4, 0x48 + + .global gUnknown_811E63C +gUnknown_811E63C: @ 811E63C + .incbin "baserom.gba", 0x11E63C, 0x6E4 + + .global gUnknown_811ED20 +gUnknown_811ED20: @ 811ED20 + .incbin "baserom.gba", 0x11ED20, 0x118 + + .global gUnknown_811EE38 +gUnknown_811EE38: @ 811EE38 + .incbin "baserom.gba", 0x11EE38, 0x103C0 + + .global gUnknown_812F1F8 +gUnknown_812F1F8: @ 812F1F8 + .incbin "baserom.gba", 0x12F1F8, 0x3184 + + .global gUnknown_813237C +gUnknown_813237C: @ 813237C + .incbin "baserom.gba", 0x13237C, 0x13D610 + + .global gUnknown_826F98C +gUnknown_826F98C: @ 826F98C + .incbin "baserom.gba", 0x26F98C, 0x90 + + .global gUnknown_826FA1C +gUnknown_826FA1C: @ 826FA1C + .incbin "baserom.gba", 0x26FA1C, 0xB4 + + .global gUnknown_826FAD0 +gUnknown_826FAD0: @ 826FAD0 + .incbin "baserom.gba", 0x26FAD0, 0x30 + + .global gUnknown_826FB00 +gUnknown_826FB00: @ 826FB00 + .incbin "baserom.gba", 0x26FB00, 0x18 + + .global gUnknown_826FB18 +gUnknown_826FB18: @ 826FB18 + .incbin "baserom.gba", 0x26FB18, 0x84 + + .global gUnknown_826FB9C +gUnknown_826FB9C: @ 826FB9C + .incbin "baserom.gba", 0x26FB9C, 0x18 + + .global gUnknown_826FBB4 +gUnknown_826FBB4: @ 826FBB4 + .incbin "baserom.gba", 0x26FBB4, 0x3C + + .global gUnknown_826FBF0 +gUnknown_826FBF0: @ 826FBF0 + .incbin "baserom.gba", 0x26FBF0, 0x10 + + .global gUnknown_826FC00 +gUnknown_826FC00: @ 826FC00 + .incbin "baserom.gba", 0x26FC00, 0x34 + + .global gUnknown_826FC34 +gUnknown_826FC34: @ 826FC34 + .incbin "baserom.gba", 0x26FC34, 0x30 diff --git a/data/data_8270000.s b/data/data_8270000.s new file mode 100644 index 00000000..433f5914 --- /dev/null +++ b/data/data_8270000.s @@ -0,0 +1,5 @@ + .section .rodata + + .global gUnknown_8270000 +gUnknown_8270000: @ 8270000 + .incbin "baserom.gba", 0x270000, 0x2724 diff --git a/data/libc_data.s b/data/libc_data.s new file mode 100644 index 00000000..688e3c21 --- /dev/null +++ b/data/libc_data.s @@ -0,0 +1,85 @@ + .section .rodata + + .global gUnknown_826FDE4 +gUnknown_826FDE4: @ 826FDE4 + .incbin "baserom.gba", 0x26FDE4, 0x10 + + .global gUnknown_826FDF4 +gUnknown_826FDF4: @ 826FDF4 + .incbin "baserom.gba", 0x26FDF4, 0x10 + + .global gUnknown_826FE04 +gUnknown_826FE04: @ 826FE04 + .incbin "baserom.gba", 0x26FE04, 0x4 + + .global gUnknown_826FE08 +gUnknown_826FE08: @ 826FE08 + .incbin "baserom.gba", 0x26FE08, 0x4 + + .global gUnknown_826FE0C +gUnknown_826FE0C: @ 826FE0C + .incbin "baserom.gba", 0x26FE0C, 0x14 + + .global gUnknown_826FE20 +gUnknown_826FE20: @ 826FE20 + .incbin "baserom.gba", 0x26FE20, 0x8 + + .global gUnknown_826FE28 +gUnknown_826FE28: @ 826FE28 + .incbin "baserom.gba", 0x26FE28, 0x14 + + .global gUnknown_826FE3C +gUnknown_826FE3C: @ 826FE3C + .incbin "baserom.gba", 0x26FE3C, 0x1C + + .global gUnknown_826FE58 +gUnknown_826FE58: @ 826FE58 + .incbin "baserom.gba", 0x26FE58, 0x4 + + .global gUnknown_826FE5C +gUnknown_826FE5C: @ 826FE5C + .incbin "baserom.gba", 0x26FE5C, 0x4 + + .global gUnknown_826FE60 +gUnknown_826FE60: @ 826FE60 + .incbin "baserom.gba", 0x26FE60, 0xC + + .global gUnknown_826FE6C +gUnknown_826FE6C: @ 826FE6C + .incbin "baserom.gba", 0x26FE6C, 0x4 + + .global gUnknown_826FE70 +gUnknown_826FE70: @ 826FE70 + .incbin "baserom.gba", 0x26FE70, 0x8 + + .global gUnknown_826FE78 +gUnknown_826FE78: @ 826FE78 + .incbin "baserom.gba", 0x26FE78, 0x30 + + .global gUnknown_826FEA8 +gUnknown_826FEA8: @ 826FEA8 + .incbin "baserom.gba", 0x26FEA8, 0x8 + + .global gUnknown_826FEB0 +gUnknown_826FEB0: @ 826FEB0 + .incbin "baserom.gba", 0x26FEB0, 0x4 + + .global gUnknown_826FEB4 +gUnknown_826FEB4: @ 826FEB4 + .incbin "baserom.gba", 0x26FEB4, 0xC + + .global gUnknown_826FEC0 +gUnknown_826FEC0: @ 826FEC0 + .incbin "baserom.gba", 0x26FEC0, 0xC8 + + .global gUnknown_826FF88 +gUnknown_826FF88: @ 826FF88 + .incbin "baserom.gba", 0x26FF88, 0x50 + + .global gUnknown_826FFD8 +gUnknown_826FFD8: @ 826FFD8 + .incbin "baserom.gba", 0x26FFD8, 0x4 + + .global gUnknown_826FFDC +gUnknown_826FFDC: @ 826FFDC + .incbin "baserom.gba", 0x26FFDC, 0x24 diff --git a/data/unk_data.s b/data/unk_data.s new file mode 100644 index 00000000..7dbe868c --- /dev/null +++ b/data/unk_data.s @@ -0,0 +1,19 @@ + .section .rodata + + .incbin "baserom.gba", 0x300000, 0x500 + + .global gUnknown_8300500 +gUnknown_8300500: @ 8300500 + .incbin "baserom.gba", 0x300500, 0x7FB00 + + .global gUnknown_8380000 +gUnknown_8380000: @ 8380000 + .incbin "baserom.gba", 0x380000, 0x30000 + + .global gUnknown_83B0000 +gUnknown_83B0000: @ 83B0000 + .incbin "baserom.gba", 0x3B0000, 0x160000 + + .global gUnknown_8510000 +gUnknown_8510000: @ 8510000 + .incbin "baserom.gba", 0x510000 diff --git a/include/gba/defines.h b/include/gba/defines.h new file mode 100644 index 00000000..7fd429d9 --- /dev/null +++ b/include/gba/defines.h @@ -0,0 +1,62 @@ +#ifndef GUARD_GBA_DEFINES +#define GUARD_GBA_DEFINES + +#include + +#define TRUE 1 +#define FALSE 0 + +#define IWRAM_DATA __attribute__((section("iwram_data"))) +#define EWRAM_DATA __attribute__((section("ewram_data"))) + +#define ALIGNED(n) __attribute__((aligned(n))) + +#define SOUND_INFO_PTR (*(struct SoundInfo **)0x3007FF0) +#define INTR_CHECK (*(u16 *)0x3007FF8) +#define INTR_VECTOR (*(void **)0x3007FFC) + +#define PLTT 0x5000000 +#define PLTT_SIZE 0x400 + +#define BG_PLTT PLTT +#define BG_PLTT_SIZE 0x200 + +#define OBJ_PLTT (PLTT + 0x200) +#define OBJ_PLTT_SIZE 0x200 + +#define VRAM 0x6000000 +#define VRAM_SIZE 0x18000 + +#define BG_VRAM VRAM +#define BG_VRAM_SIZE 0x10000 +#define BG_CHAR_ADDR(n) (void *)(BG_VRAM + (0x4000 * (n))) +#define BG_SCREEN_ADDR(n) (void *)(BG_VRAM + (0x800 * (n))) +#define BG_TILE_ADDR(n) (void *)(BG_VRAM + (0x80 * (n))) + +// text-mode BG +#define OBJ_VRAM0 (void *)(VRAM + 0x10000) +#define OBJ_VRAM0_SIZE 0x8000 + +// bitmap-mode BG +#define OBJ_VRAM1 (void *)(VRAM + 0x14000) +#define OBJ_VRAM1_SIZE 0x4000 + +#define OAM 0x7000000 +#define OAM_SIZE 0x400 + +#define DISPLAY_WIDTH 240 +#define DISPLAY_HEIGHT 160 + +#define TILE_SIZE_4BPP 32 +#define TILE_SIZE_8BPP 64 + +#define TOTAL_OBJ_TILE_COUNT 1024 + +#define RGB(r, g, b) ((r) | ((g) << 5) | ((b) << 10)) + +#define RGB_BLACK RGB(0, 0, 0) +#define RGB_WHITE RGB(31, 31, 31) + +#define WIN_RANGE(a, b) (((a) << 8) | (b)) + +#endif // GUARD_GBA_DEFINES diff --git a/include/gba/flash_internal.h b/include/gba/flash_internal.h new file mode 100644 index 00000000..48d88433 --- /dev/null +++ b/include/gba/flash_internal.h @@ -0,0 +1,73 @@ +#ifndef GUARD_GBA_FLASH_INTERNAL_H +#define GUARD_GBA_FLASH_INTERNAL_H + +#define FLASH_BASE ((u8 *)0xE000000) + +#define FLASH_WRITE(addr, data) ((*(vu8 *)(FLASH_BASE + (addr))) = (data)) + +#define FLASH_ROM_SIZE_1M 131072 // 1 megabit ROM + +#define SECTORS_PER_BANK 16 + +struct FlashSector +{ + u32 size; + u8 shift; + u16 count; + u16 top; +}; + +struct FlashType { + u32 romSize; + struct FlashSector sector; + u16 wait[2]; // game pak bus read/write wait + + // TODO: add support for anonymous unions/structs if possible + union { + struct { + u8 makerId; + u8 deviceId; + } separate; + u16 joined; + } ids; +}; + +struct FlashSetupInfo +{ + u16 (*programFlashSector)(u16, u8 *); + u16 (*eraseFlashChip)(void); + u16 (*eraseFlashSector)(u16); + u16 (*waitForFlashWrite)(u8, u8 *, u8); + const u16 *maxTime; + struct FlashType type; +}; + +extern u16 gFlashNumRemainingBytes; + +extern u16 (*ProgramFlashSector)(u16, u8 *); +extern u16 (*EraseFlashChip)(void); +extern u16 (*EraseFlashSector)(u16); +extern u16 (*WaitForFlashWrite)(u8, u8 *, u8); +extern const u16 *gFlashMaxTime; +extern const struct FlashType *gFlash; + +extern u8 (*PollFlashStatus)(u8 *); +extern u8 gFlashTimeoutFlag; + +extern const struct FlashSetupInfo MX29L010; +extern const struct FlashSetupInfo LE26FV10N1TS; +extern const struct FlashSetupInfo DefaultFlash; + +void SwitchFlashBank(u8 bankNum); +u16 ReadFlashId(void); +void StartFlashTimer(u8 phase); +void SetReadFlash1(u16 *dest); +void StopFlashTimer(void); + +u16 WaitForFlashWrite_Common(u8 phase, u8 *addr, u8 lastData); + +u16 EraseFlashChip_MX(void); +u16 EraseFlashSector_MX(u16 sectorNum); +u16 ProgramFlashSector_MX(u16 sectorNum, u8 *src); + +#endif // GUARD_GBA_FLASH_INTERNAL_H diff --git a/include/gba/gba.h b/include/gba/gba.h new file mode 100644 index 00000000..42ae3cdd --- /dev/null +++ b/include/gba/gba.h @@ -0,0 +1,11 @@ +#ifndef GUARD_GBA_GBA_H +#define GUARD_GBA_GBA_H + +#include "gba/defines.h" +#include "gba/io_reg.h" +#include "gba/types.h" +#include "gba/multiboot.h" +#include "gba/syscall.h" +#include "gba/macro.h" + +#endif // GUARD_GBA_GBA_H diff --git a/include/gba/io_reg.h b/include/gba/io_reg.h new file mode 100644 index 00000000..6dbe5e8e --- /dev/null +++ b/include/gba/io_reg.h @@ -0,0 +1,727 @@ +#ifndef GUARD_GBA_IO_REG_H +#define GUARD_GBA_IO_REG_H + +#define REG_BASE 0x4000000 // I/O register base address + +// I/O register offsets + +#define REG_OFFSET_DISPCNT 0x0 +#define REG_OFFSET_DISPSTAT 0x4 +#define REG_OFFSET_VCOUNT 0x6 +#define REG_OFFSET_BG0CNT 0x8 +#define REG_OFFSET_BG1CNT 0xa +#define REG_OFFSET_BG2CNT 0xc +#define REG_OFFSET_BG3CNT 0xe +#define REG_OFFSET_BG0HOFS 0x10 +#define REG_OFFSET_BG0VOFS 0x12 +#define REG_OFFSET_BG1HOFS 0x14 +#define REG_OFFSET_BG1VOFS 0x16 +#define REG_OFFSET_BG2HOFS 0x18 +#define REG_OFFSET_BG2VOFS 0x1a +#define REG_OFFSET_BG3HOFS 0x1c +#define REG_OFFSET_BG3VOFS 0x1e +#define REG_OFFSET_BG2PA 0x20 +#define REG_OFFSET_BG2PB 0x22 +#define REG_OFFSET_BG2PC 0x24 +#define REG_OFFSET_BG2PD 0x26 +#define REG_OFFSET_BG2X 0x28 +#define REG_OFFSET_BG2X_L 0x28 +#define REG_OFFSET_BG2X_H 0x2a +#define REG_OFFSET_BG2Y 0x2c +#define REG_OFFSET_BG2Y_L 0x2c +#define REG_OFFSET_BG2Y_H 0x2e +#define REG_OFFSET_BG3PA 0x30 +#define REG_OFFSET_BG3PB 0x32 +#define REG_OFFSET_BG3PC 0x34 +#define REG_OFFSET_BG3PD 0x36 +#define REG_OFFSET_BG3X 0x38 +#define REG_OFFSET_BG3X_L 0x38 +#define REG_OFFSET_BG3X_H 0x3a +#define REG_OFFSET_BG3Y 0x3c +#define REG_OFFSET_BG3Y_L 0x3c +#define REG_OFFSET_BG3Y_H 0x3e +#define REG_OFFSET_WIN0H 0x40 +#define REG_OFFSET_WIN1H 0x42 +#define REG_OFFSET_WIN0V 0x44 +#define REG_OFFSET_WIN1V 0x46 +#define REG_OFFSET_WININ 0x48 +#define REG_OFFSET_WINOUT 0x4a +#define REG_OFFSET_MOSAIC 0x4c +#define REG_OFFSET_BLDCNT 0x50 +#define REG_OFFSET_BLDALPHA 0x52 +#define REG_OFFSET_BLDY 0x54 + +#define REG_OFFSET_SOUND1CNT_L 0x60 +#define REG_OFFSET_NR10 0x60 +#define REG_OFFSET_SOUND1CNT_H 0x62 +#define REG_OFFSET_NR11 0x62 +#define REG_OFFSET_NR12 0x63 +#define REG_OFFSET_SOUND1CNT_X 0x64 +#define REG_OFFSET_NR13 0x64 +#define REG_OFFSET_NR14 0x65 +#define REG_OFFSET_SOUND2CNT_L 0x68 +#define REG_OFFSET_NR21 0x68 +#define REG_OFFSET_NR22 0x69 +#define REG_OFFSET_SOUND2CNT_H 0x6c +#define REG_OFFSET_NR23 0x6c +#define REG_OFFSET_NR24 0x6d +#define REG_OFFSET_SOUND3CNT_L 0x70 +#define REG_OFFSET_NR30 0x70 +#define REG_OFFSET_SOUND3CNT_H 0x72 +#define REG_OFFSET_NR31 0x72 +#define REG_OFFSET_NR32 0x73 +#define REG_OFFSET_SOUND3CNT_X 0x74 +#define REG_OFFSET_NR33 0x74 +#define REG_OFFSET_NR34 0x75 +#define REG_OFFSET_SOUND4CNT_L 0x78 +#define REG_OFFSET_NR41 0x78 +#define REG_OFFSET_NR42 0x79 +#define REG_OFFSET_SOUND4CNT_H 0x7c +#define REG_OFFSET_NR43 0x7c +#define REG_OFFSET_NR44 0x7d +#define REG_OFFSET_SOUNDCNT_L 0x80 +#define REG_OFFSET_NR50 0x80 +#define REG_OFFSET_NR51 0x81 +#define REG_OFFSET_SOUNDCNT_H 0x82 +#define REG_OFFSET_SOUNDCNT_X 0x84 +#define REG_OFFSET_NR52 0x84 +#define REG_OFFSET_SOUNDBIAS 0x88 +#define REG_OFFSET_SOUNDBIAS_L 0x88 +#define REG_OFFSET_SOUNDBIAS_H 0x89 +#define REG_OFFSET_WAVE_RAM0 0x90 +#define REG_OFFSET_WAVE_RAM1 0x94 +#define REG_OFFSET_WAVE_RAM2 0x98 +#define REG_OFFSET_WAVE_RAM3 0x9c +#define REG_OFFSET_FIFO_A 0xa0 +#define REG_OFFSET_FIFO_B 0xa4 + +#define REG_OFFSET_DMA0 0xb0 +#define REG_OFFSET_DMA0SAD 0xb0 +#define REG_OFFSET_DMA0SAD_L 0xb0 +#define REG_OFFSET_DMA0SAD_H 0xb2 +#define REG_OFFSET_DMA0DAD 0xb4 +#define REG_OFFSET_DMA0DAD_L 0xb4 +#define REG_OFFSET_DMA0DAD_H 0xb6 +#define REG_OFFSET_DMA0CNT 0xb8 +#define REG_OFFSET_DMA0CNT_L 0xb8 +#define REG_OFFSET_DMA0CNT_H 0xba +#define REG_OFFSET_DMA1 0xbc +#define REG_OFFSET_DMA1SAD 0xbc +#define REG_OFFSET_DMA1SAD_L 0xbc +#define REG_OFFSET_DMA1SAD_H 0xbe +#define REG_OFFSET_DMA1DAD 0xc0 +#define REG_OFFSET_DMA1DAD_L 0xc0 +#define REG_OFFSET_DMA1DAD_H 0xc2 +#define REG_OFFSET_DMA1CNT 0xc4 +#define REG_OFFSET_DMA1CNT_L 0xc4 +#define REG_OFFSET_DMA1CNT_H 0xc6 +#define REG_OFFSET_DMA2 0xc8 +#define REG_OFFSET_DMA2SAD 0xc8 +#define REG_OFFSET_DMA2SAD_L 0xc8 +#define REG_OFFSET_DMA2SAD_H 0xca +#define REG_OFFSET_DMA2DAD 0xcc +#define REG_OFFSET_DMA2DAD_L 0xcc +#define REG_OFFSET_DMA2DAD_H 0xce +#define REG_OFFSET_DMA2CNT 0xd0 +#define REG_OFFSET_DMA2CNT_L 0xd0 +#define REG_OFFSET_DMA2CNT_H 0xd2 +#define REG_OFFSET_DMA3 0xd4 +#define REG_OFFSET_DMA3SAD 0xd4 +#define REG_OFFSET_DMA3SAD_L 0xd4 +#define REG_OFFSET_DMA3SAD_H 0xd6 +#define REG_OFFSET_DMA3DAD 0xd8 +#define REG_OFFSET_DMA3DAD_L 0xd8 +#define REG_OFFSET_DMA3DAD_H 0xda +#define REG_OFFSET_DMA3CNT 0xdc +#define REG_OFFSET_DMA3CNT_L 0xdc +#define REG_OFFSET_DMA3CNT_H 0xde + +#define REG_OFFSET_TMCNT 0x100 +#define REG_OFFSET_TM0CNT 0x100 +#define REG_OFFSET_TM0CNT_L 0x100 +#define REG_OFFSET_TM0CNT_H 0x102 +#define REG_OFFSET_TM1CNT 0x104 +#define REG_OFFSET_TM1CNT_L 0x104 +#define REG_OFFSET_TM1CNT_H 0x106 +#define REG_OFFSET_TM2CNT 0x108 +#define REG_OFFSET_TM2CNT_L 0x108 +#define REG_OFFSET_TM2CNT_H 0x10a +#define REG_OFFSET_TM3CNT 0x10c +#define REG_OFFSET_TM3CNT_L 0x10c +#define REG_OFFSET_TM3CNT_H 0x10e + +#define REG_OFFSET_SIOCNT 0x128 +#define REG_OFFSET_SIODATA8 0x12a +#define REG_OFFSET_SIODATA32 0x120 +#define REG_OFFSET_SIOMLT_SEND 0x12a +#define REG_OFFSET_SIOMLT_RECV 0x120 +#define REG_OFFSET_SIOMULTI0 0x120 +#define REG_OFFSET_SIOMULTI1 0x122 +#define REG_OFFSET_SIOMULTI2 0x124 +#define REG_OFFSET_SIOMULTI3 0x126 + +#define REG_OFFSET_KEYINPUT 0x130 +#define REG_OFFSET_KEYCNT 0x132 + +#define REG_OFFSET_RCNT 0x134 + +#define REG_OFFSET_JOYCNT 0x140 +#define REG_OFFSET_JOYSTAT 0x158 +#define REG_OFFSET_JOY_RECV 0x150 +#define REG_OFFSET_JOY_RECV_L 0x150 +#define REG_OFFSET_JOY_RECV_H 0x152 +#define REG_OFFSET_JOY_TRANS 0x154 +#define REG_OFFSET_JOY_TRANS_L 0x154 +#define REG_OFFSET_JOY_TRANS_H 0x156 + +#define REG_OFFSET_IME 0x208 +#define REG_OFFSET_IE 0x200 +#define REG_OFFSET_IF 0x202 + +#define REG_OFFSET_WAITCNT 0x204 + +// I/O register addresses + +#define REG_ADDR_DISPCNT (REG_BASE + REG_OFFSET_DISPCNT) +#define REG_ADDR_DISPSTAT (REG_BASE + REG_OFFSET_DISPSTAT) +#define REG_ADDR_VCOUNT (REG_BASE + REG_OFFSET_VCOUNT) +#define REG_ADDR_BG0CNT (REG_BASE + REG_OFFSET_BG0CNT) +#define REG_ADDR_BG1CNT (REG_BASE + REG_OFFSET_BG1CNT) +#define REG_ADDR_BG2CNT (REG_BASE + REG_OFFSET_BG2CNT) +#define REG_ADDR_BG3CNT (REG_BASE + REG_OFFSET_BG3CNT) +#define REG_ADDR_BG0HOFS (REG_BASE + REG_OFFSET_BG0HOFS) +#define REG_ADDR_BG0VOFS (REG_BASE + REG_OFFSET_BG0VOFS) +#define REG_ADDR_BG1HOFS (REG_BASE + REG_OFFSET_BG1HOFS) +#define REG_ADDR_BG1VOFS (REG_BASE + REG_OFFSET_BG1VOFS) +#define REG_ADDR_BG2HOFS (REG_BASE + REG_OFFSET_BG2HOFS) +#define REG_ADDR_BG2VOFS (REG_BASE + REG_OFFSET_BG2VOFS) +#define REG_ADDR_BG3HOFS (REG_BASE + REG_OFFSET_BG3HOFS) +#define REG_ADDR_BG3VOFS (REG_BASE + REG_OFFSET_BG3VOFS) +#define REG_ADDR_BG2PA (REG_BASE + REG_OFFSET_BG2PA) +#define REG_ADDR_BG2PB (REG_BASE + REG_OFFSET_BG2PB) +#define REG_ADDR_BG2PC (REG_BASE + REG_OFFSET_BG2PC) +#define REG_ADDR_BG2PD (REG_BASE + REG_OFFSET_BG2PD) +#define REG_ADDR_BG2X (REG_BASE + REG_OFFSET_BG2X) +#define REG_ADDR_BG2X_L (REG_BASE + REG_OFFSET_BG2X_L) +#define REG_ADDR_BG2X_H (REG_BASE + REG_OFFSET_BG2X_H) +#define REG_ADDR_BG2Y (REG_BASE + REG_OFFSET_BG2Y) +#define REG_ADDR_BG2Y_L (REG_BASE + REG_OFFSET_BG2Y_L) +#define REG_ADDR_BG2Y_H (REG_BASE + REG_OFFSET_BG2Y_H) +#define REG_ADDR_BG3PA (REG_BASE + REG_OFFSET_BG3PA) +#define REG_ADDR_BG3PB (REG_BASE + REG_OFFSET_BG3PB) +#define REG_ADDR_BG3PC (REG_BASE + REG_OFFSET_BG3PC) +#define REG_ADDR_BG3PD (REG_BASE + REG_OFFSET_BG3PD) +#define REG_ADDR_BG3X (REG_BASE + REG_OFFSET_BG3X) +#define REG_ADDR_BG3X_L (REG_BASE + REG_OFFSET_BG3X_L) +#define REG_ADDR_BG3X_H (REG_BASE + REG_OFFSET_BG3X_H) +#define REG_ADDR_BG3Y (REG_BASE + REG_OFFSET_BG3Y) +#define REG_ADDR_BG3Y_L (REG_BASE + REG_OFFSET_BG3Y_L) +#define REG_ADDR_BG3Y_H (REG_BASE + REG_OFFSET_BG3Y_H) +#define REG_ADDR_WIN0H (REG_BASE + REG_OFFSET_WIN0H) +#define REG_ADDR_WIN1H (REG_BASE + REG_OFFSET_WIN1H) +#define REG_ADDR_WIN0V (REG_BASE + REG_OFFSET_WIN0V) +#define REG_ADDR_WIN1V (REG_BASE + REG_OFFSET_WIN1V) +#define REG_ADDR_WININ (REG_BASE + REG_OFFSET_WININ) +#define REG_ADDR_WINOUT (REG_BASE + REG_OFFSET_WINOUT) +#define REG_ADDR_MOSAIC (REG_BASE + REG_OFFSET_MOSAIC) +#define REG_ADDR_BLDCNT (REG_BASE + REG_OFFSET_BLDCNT) +#define REG_ADDR_BLDALPHA (REG_BASE + REG_OFFSET_BLDALPHA) +#define REG_ADDR_BLDY (REG_BASE + REG_OFFSET_BLDY) + +#define REG_ADDR_SOUND1CNT_L (REG_BASE + REG_OFFSET_SOUND1CNT_L) +#define REG_ADDR_NR10 (REG_BASE + REG_OFFSET_NR10) +#define REG_ADDR_SOUND1CNT_H (REG_BASE + REG_OFFSET_SOUND1CNT_H) +#define REG_ADDR_NR11 (REG_BASE + REG_OFFSET_NR11) +#define REG_ADDR_NR12 (REG_BASE + REG_OFFSET_NR12) +#define REG_ADDR_SOUND1CNT_X (REG_BASE + REG_OFFSET_SOUND1CNT_X) +#define REG_ADDR_NR13 (REG_BASE + REG_OFFSET_NR13) +#define REG_ADDR_NR14 (REG_BASE + REG_OFFSET_NR14) +#define REG_ADDR_SOUND2CNT_L (REG_BASE + REG_OFFSET_SOUND2CNT_L) +#define REG_ADDR_NR21 (REG_BASE + REG_OFFSET_NR21) +#define REG_ADDR_NR22 (REG_BASE + REG_OFFSET_NR22) +#define REG_ADDR_SOUND2CNT_H (REG_BASE + REG_OFFSET_SOUND2CNT_H) +#define REG_ADDR_NR23 (REG_BASE + REG_OFFSET_NR23) +#define REG_ADDR_NR24 (REG_BASE + REG_OFFSET_NR24) +#define REG_ADDR_SOUND3CNT_L (REG_BASE + REG_OFFSET_SOUND3CNT_L) +#define REG_ADDR_NR30 (REG_BASE + REG_OFFSET_NR30) +#define REG_ADDR_SOUND3CNT_H (REG_BASE + REG_OFFSET_SOUND3CNT_H) +#define REG_ADDR_NR31 (REG_BASE + REG_OFFSET_NR31) +#define REG_ADDR_NR32 (REG_BASE + REG_OFFSET_NR32) +#define REG_ADDR_SOUND3CNT_X (REG_BASE + REG_OFFSET_SOUND3CNT_X) +#define REG_ADDR_NR33 (REG_BASE + REG_OFFSET_NR33) +#define REG_ADDR_NR34 (REG_BASE + REG_OFFSET_NR34) +#define REG_ADDR_SOUND4CNT_L (REG_BASE + REG_OFFSET_SOUND4CNT_L) +#define REG_ADDR_NR41 (REG_BASE + REG_OFFSET_NR41) +#define REG_ADDR_NR42 (REG_BASE + REG_OFFSET_NR42) +#define REG_ADDR_SOUND4CNT_H (REG_BASE + REG_OFFSET_SOUND4CNT_H) +#define REG_ADDR_NR43 (REG_BASE + REG_OFFSET_NR43) +#define REG_ADDR_NR44 (REG_BASE + REG_OFFSET_NR44) +#define REG_ADDR_SOUNDCNT_L (REG_BASE + REG_OFFSET_SOUNDCNT_L) +#define REG_ADDR_NR50 (REG_BASE + REG_OFFSET_NR50) +#define REG_ADDR_NR51 (REG_BASE + REG_OFFSET_NR51) +#define REG_ADDR_SOUNDCNT_H (REG_BASE + REG_OFFSET_SOUNDCNT_H) +#define REG_ADDR_SOUNDCNT_X (REG_BASE + REG_OFFSET_SOUNDCNT_X) +#define REG_ADDR_NR52 (REG_BASE + REG_OFFSET_NR52) +#define REG_ADDR_SOUNDBIAS (REG_BASE + REG_OFFSET_SOUNDBIAS) +#define REG_ADDR_SOUNDBIAS_L (REG_BASE + REG_OFFSET_SOUNDBIAS_L) +#define REG_ADDR_SOUNDBIAS_H (REG_BASE + REG_OFFSET_SOUNDBIAS_H) +#define REG_ADDR_WAVE_RAM0 (REG_BASE + REG_OFFSET_WAVE_RAM0) +#define REG_ADDR_WAVE_RAM1 (REG_BASE + REG_OFFSET_WAVE_RAM1) +#define REG_ADDR_WAVE_RAM2 (REG_BASE + REG_OFFSET_WAVE_RAM2) +#define REG_ADDR_WAVE_RAM3 (REG_BASE + REG_OFFSET_WAVE_RAM3) +#define REG_ADDR_FIFO_A (REG_BASE + REG_OFFSET_FIFO_A) +#define REG_ADDR_FIFO_B (REG_BASE + REG_OFFSET_FIFO_B) + +#define REG_ADDR_DMA0 (REG_BASE + REG_OFFSET_DMA0) +#define REG_ADDR_DMA0SAD (REG_BASE + REG_OFFSET_DMA0SAD) +#define REG_ADDR_DMA0DAD (REG_BASE + REG_OFFSET_DMA0DAD) +#define REG_ADDR_DMA0CNT (REG_BASE + REG_OFFSET_DMA0CNT) +#define REG_ADDR_DMA0CNT_L (REG_BASE + REG_OFFSET_DMA0CNT_L) +#define REG_ADDR_DMA0CNT_H (REG_BASE + REG_OFFSET_DMA0CNT_H) +#define REG_ADDR_DMA1 (REG_BASE + REG_OFFSET_DMA1) +#define REG_ADDR_DMA1SAD (REG_BASE + REG_OFFSET_DMA1SAD) +#define REG_ADDR_DMA1DAD (REG_BASE + REG_OFFSET_DMA1DAD) +#define REG_ADDR_DMA1CNT (REG_BASE + REG_OFFSET_DMA1CNT) +#define REG_ADDR_DMA1CNT_L (REG_BASE + REG_OFFSET_DMA1CNT_L) +#define REG_ADDR_DMA1CNT_H (REG_BASE + REG_OFFSET_DMA1CNT_H) +#define REG_ADDR_DMA2 (REG_BASE + REG_OFFSET_DMA2) +#define REG_ADDR_DMA2SAD (REG_BASE + REG_OFFSET_DMA2SAD) +#define REG_ADDR_DMA2DAD (REG_BASE + REG_OFFSET_DMA2DAD) +#define REG_ADDR_DMA2CNT (REG_BASE + REG_OFFSET_DMA2CNT) +#define REG_ADDR_DMA2CNT_L (REG_BASE + REG_OFFSET_DMA2CNT_L) +#define REG_ADDR_DMA2CNT_H (REG_BASE + REG_OFFSET_DMA2CNT_H) +#define REG_ADDR_DMA3 (REG_BASE + REG_OFFSET_DMA3) +#define REG_ADDR_DMA3SAD (REG_BASE + REG_OFFSET_DMA3SAD) +#define REG_ADDR_DMA3DAD (REG_BASE + REG_OFFSET_DMA3DAD) +#define REG_ADDR_DMA3CNT (REG_BASE + REG_OFFSET_DMA3CNT) +#define REG_ADDR_DMA3CNT_L (REG_BASE + REG_OFFSET_DMA3CNT_L) +#define REG_ADDR_DMA3CNT_H (REG_BASE + REG_OFFSET_DMA3CNT_H) + +#define REG_ADDR_TMCNT (REG_BASE + REG_OFFSET_TMCNT) +#define REG_ADDR_TM0CNT (REG_BASE + REG_OFFSET_TM0CNT) +#define REG_ADDR_TM0CNT_L (REG_BASE + REG_OFFSET_TM0CNT_L) +#define REG_ADDR_TM0CNT_H (REG_BASE + REG_OFFSET_TM0CNT_H) +#define REG_ADDR_TM1CNT (REG_BASE + REG_OFFSET_TM1CNT) +#define REG_ADDR_TM1CNT_L (REG_BASE + REG_OFFSET_TM1CNT_L) +#define REG_ADDR_TM1CNT_H (REG_BASE + REG_OFFSET_TM1CNT_H) +#define REG_ADDR_TM2CNT (REG_BASE + REG_OFFSET_TM2CNT) +#define REG_ADDR_TM2CNT_L (REG_BASE + REG_OFFSET_TM2CNT_L) +#define REG_ADDR_TM2CNT_H (REG_BASE + REG_OFFSET_TM2CNT_H) +#define REG_ADDR_TM3CNT (REG_BASE + REG_OFFSET_TM3CNT) +#define REG_ADDR_TM3CNT_L (REG_BASE + REG_OFFSET_TM3CNT_L) +#define REG_ADDR_TM3CNT_H (REG_BASE + REG_OFFSET_TM3CNT_H) + +#define REG_ADDR_SIOCNT (REG_BASE + REG_OFFSET_SIOCNT) +#define REG_ADDR_SIODATA8 (REG_BASE + REG_OFFSET_SIODATA8) +#define REG_ADDR_SIODATA32 (REG_BASE + REG_OFFSET_SIODATA32) +#define REG_ADDR_SIOMLT_SEND (REG_BASE + REG_OFFSET_SIOMLT_SEND) +#define REG_ADDR_SIOMLT_RECV (REG_BASE + REG_OFFSET_SIOMLT_RECV) +#define REG_ADDR_SIOMULTI0 (REG_BASE + REG_OFFSET_SIOMULTI0) +#define REG_ADDR_SIOMULTI1 (REG_BASE + REG_OFFSET_SIOMULTI1) +#define REG_ADDR_SIOMULTI2 (REG_BASE + REG_OFFSET_SIOMULTI2) +#define REG_ADDR_SIOMULTI3 (REG_BASE + REG_OFFSET_SIOMULTI3) + +#define REG_ADDR_KEYINPUT (REG_BASE + REG_OFFSET_KEYINPUT) +#define REG_ADDR_KEYCNT (REG_BASE + REG_OFFSET_KEYCNT) + +#define REG_ADDR_RCNT (REG_BASE + REG_OFFSET_RCNT) + +#define REG_ADDR_JOYCNT (REG_BASE + REG_OFFSET_JOYCNT) +#define REG_ADDR_JOYSTAT (REG_BASE + REG_OFFSET_JOYSTAT) +#define REG_ADDR_JOY_RECV (REG_BASE + REG_OFFSET_JOY_RECV) +#define REG_ADDR_JOY_RECV_L (REG_BASE + REG_OFFSET_JOY_RECV_L) +#define REG_ADDR_JOY_RECV_H (REG_BASE + REG_OFFSET_JOY_RECV_H) +#define REG_ADDR_JOY_TRANS (REG_BASE + REG_OFFSET_JOY_TRANS) +#define REG_ADDR_JOY_TRANS_L (REG_BASE + REG_OFFSET_JOY_TRANS_L) +#define REG_ADDR_JOY_TRANS_H (REG_BASE + REG_OFFSET_JOY_TRANS_H) + +#define REG_ADDR_IME (REG_BASE + REG_OFFSET_IME) +#define REG_ADDR_IE (REG_BASE + REG_OFFSET_IE) +#define REG_ADDR_IF (REG_BASE + REG_OFFSET_IF) + +#define REG_ADDR_WAITCNT (REG_BASE + REG_OFFSET_WAITCNT) + +// I/O registers + +#define REG_DISPCNT (*(vu16 *)REG_ADDR_DISPCNT) +#define REG_DISPSTAT (*(vu16 *)REG_ADDR_DISPSTAT) +#define REG_VCOUNT (*(vu16 *)REG_ADDR_VCOUNT) +#define REG_BG0CNT (*(vu16 *)REG_ADDR_BG0CNT) +#define REG_BG1CNT (*(vu16 *)REG_ADDR_BG1CNT) +#define REG_BG2CNT (*(vu16 *)REG_ADDR_BG2CNT) +#define REG_BG3CNT (*(vu16 *)REG_ADDR_BG3CNT) +#define REG_BG0HOFS (*(vu16 *)REG_ADDR_BG0HOFS) +#define REG_BG0VOFS (*(vu16 *)REG_ADDR_BG0VOFS) +#define REG_BG1HOFS (*(vu16 *)REG_ADDR_BG1HOFS) +#define REG_BG1VOFS (*(vu16 *)REG_ADDR_BG1VOFS) +#define REG_BG2HOFS (*(vu16 *)REG_ADDR_BG2HOFS) +#define REG_BG2VOFS (*(vu16 *)REG_ADDR_BG2VOFS) +#define REG_BG3HOFS (*(vu16 *)REG_ADDR_BG3HOFS) +#define REG_BG3VOFS (*(vu16 *)REG_ADDR_BG3VOFS) +#define REG_BG2PA (*(vu16 *)REG_ADDR_BG2PA) +#define REG_BG2PB (*(vu16 *)REG_ADDR_BG2PB) +#define REG_BG2PC (*(vu16 *)REG_ADDR_BG2PC) +#define REG_BG2PD (*(vu16 *)REG_ADDR_BG2PD) +#define REG_BG2X (*(vu32 *)REG_ADDR_BG2X) +#define REG_BG2X_L (*(vu16 *)REG_ADDR_BG2X_L) +#define REG_BG2X_H (*(vu16 *)REG_ADDR_BG2X_H) +#define REG_BG2Y (*(vu32 *)REG_ADDR_BG2Y) +#define REG_BG2Y_L (*(vu16 *)REG_ADDR_BG2Y_L) +#define REG_BG2Y_H (*(vu16 *)REG_ADDR_BG2Y_H) +#define REG_BG3PA (*(vu16 *)REG_ADDR_BG3PA) +#define REG_BG3PB (*(vu16 *)REG_ADDR_BG3PB) +#define REG_BG3PC (*(vu16 *)REG_ADDR_BG3PC) +#define REG_BG3PD (*(vu16 *)REG_ADDR_BG3PD) +#define REG_BG3X (*(vu32 *)REG_ADDR_BG3X) +#define REG_BG3X_L (*(vu16 *)REG_ADDR_BG3X_L) +#define REG_BG3X_H (*(vu16 *)REG_ADDR_BG3X_H) +#define REG_BG3Y (*(vu32 *)REG_ADDR_BG3Y) +#define REG_BG3Y_L (*(vu16 *)REG_ADDR_BG3Y_L) +#define REG_BG3Y_H (*(vu16 *)REG_ADDR_BG3Y_H) +#define REG_WIN0H (*(vu16 *)REG_ADDR_WIN0H) +#define REG_WIN1H (*(vu16 *)REG_ADDR_WIN1H) +#define REG_WIN0V (*(vu16 *)REG_ADDR_WIN0V) +#define REG_WIN1V (*(vu16 *)REG_ADDR_WIN1V) +#define REG_WININ (*(vu16 *)REG_ADDR_WININ) +#define REG_WINOUT (*(vu16 *)REG_ADDR_WINOUT) +#define REG_MOSAIC (*(vu16 *)REG_ADDR_MOSAIC) +#define REG_BLDCNT (*(vu16 *)REG_ADDR_BLDCNT) +#define REG_BLDALPHA (*(vu16 *)REG_ADDR_BLDALPHA) +#define REG_BLDY (*(vu16 *)REG_ADDR_BLDY) + +#define REG_SOUND1CNT_L (*(vu16 *)REG_ADDR_SOUND1CNT_L) +#define REG_NR10 (*(vu8 *)REG_ADDR_NR10) +#define REG_SOUND1CNT_H (*(vu16 *)REG_ADDR_SOUND1CNT_H) +#define REG_NR11 (*(vu8 *)REG_ADDR_NR11) +#define REG_NR12 (*(vu8 *)REG_ADDR_NR12) +#define REG_SOUND1CNT_X (*(vu16 *)REG_ADDR_SOUND1CNT_X) +#define REG_NR13 (*(vu8 *)REG_ADDR_NR13) +#define REG_NR14 (*(vu8 *)REG_ADDR_NR14) +#define REG_SOUND2CNT_L (*(vu16 *)REG_ADDR_SOUND2CNT_L) +#define REG_NR21 (*(vu8 *)REG_ADDR_NR21) +#define REG_NR22 (*(vu8 *)REG_ADDR_NR22) +#define REG_SOUND2CNT_H (*(vu16 *)REG_ADDR_SOUND2CNT_H) +#define REG_NR23 (*(vu8 *)REG_ADDR_NR23) +#define REG_NR24 (*(vu8 *)REG_ADDR_NR24) +#define REG_SOUND3CNT_L (*(vu16 *)REG_ADDR_SOUND3CNT_L) +#define REG_NR30 (*(vu8 *)REG_ADDR_NR30) +#define REG_SOUND3CNT_H (*(vu16 *)REG_ADDR_SOUND3CNT_H) +#define REG_NR31 (*(vu8 *)REG_ADDR_NR31) +#define REG_NR32 (*(vu8 *)REG_ADDR_NR32) +#define REG_SOUND3CNT_X (*(vu16 *)REG_ADDR_SOUND3CNT_X) +#define REG_NR33 (*(vu8 *)REG_ADDR_NR33) +#define REG_NR34 (*(vu8 *)REG_ADDR_NR34) +#define REG_SOUND4CNT_L (*(vu16 *)REG_ADDR_SOUND4CNT_L) +#define REG_NR41 (*(vu8 *)REG_ADDR_NR41) +#define REG_NR42 (*(vu8 *)REG_ADDR_NR42) +#define REG_SOUND4CNT_H (*(vu16 *)REG_ADDR_SOUND4CNT_H) +#define REG_NR43 (*(vu8 *)REG_ADDR_NR43) +#define REG_NR44 (*(vu8 *)REG_ADDR_NR44) +#define REG_SOUNDCNT_L (*(vu16 *)REG_ADDR_SOUNDCNT_L) +#define REG_NR50 (*(vu8 *)REG_ADDR_NR50) +#define REG_NR51 (*(vu8 *)REG_ADDR_NR51) +#define REG_SOUNDCNT_H (*(vu16 *)REG_ADDR_SOUNDCNT_H) +#define REG_SOUNDCNT_X (*(vu16 *)REG_ADDR_SOUNDCNT_X) +#define REG_NR52 (*(vu8 *)REG_ADDR_NR52) +#define REG_SOUNDBIAS (*(vu16 *)REG_ADDR_SOUNDBIAS) +#define REG_SOUNDBIAS_L (*(vu8 *)REG_ADDR_SOUNDBIAS_L) +#define REG_SOUNDBIAS_H (*(vu8 *)REG_ADDR_SOUNDBIAS_H) +#define REG_WAVE_RAM0 (*(vu32 *)REG_ADDR_WAVE_RAM0) +#define REG_WAVE_RAM1 (*(vu32 *)REG_ADDR_WAVE_RAM1) +#define REG_WAVE_RAM2 (*(vu32 *)REG_ADDR_WAVE_RAM2) +#define REG_WAVE_RAM3 (*(vu32 *)REG_ADDR_WAVE_RAM3) +#define REG_FIFO_A (*(vu32 *)REG_ADDR_FIFO_A) +#define REG_FIFO_B (*(vu32 *)REG_ADDR_FIFO_B) + +#define REG_DMA0SAD (*(vu32 *)REG_ADDR_DMA0SAD) +#define REG_DMA0DAD (*(vu32 *)REG_ADDR_DMA0DAD) +#define REG_DMA0CNT (*(vu32 *)REG_ADDR_DMA0CNT) +#define REG_DMA0CNT_L (*(vu16 *)REG_ADDR_DMA0CNT_L) +#define REG_DMA0CNT_H (*(vu16 *)REG_ADDR_DMA0CNT_H) + +#define REG_DMA1SAD (*(vu32 *)REG_ADDR_DMA1SAD) +#define REG_DMA1DAD (*(vu32 *)REG_ADDR_DMA1DAD) +#define REG_DMA1CNT (*(vu32 *)REG_ADDR_DMA1CNT) +#define REG_DMA1CNT_L (*(vu16 *)REG_ADDR_DMA1CNT_L) +#define REG_DMA1CNT_H (*(vu16 *)REG_ADDR_DMA1CNT_H) + +#define REG_DMA2SAD (*(vu32 *)REG_ADDR_DMA2SAD) +#define REG_DMA2DAD (*(vu32 *)REG_ADDR_DMA2DAD) +#define REG_DMA2CNT (*(vu32 *)REG_ADDR_DMA2CNT) +#define REG_DMA2CNT_L (*(vu16 *)REG_ADDR_DMA2CNT_L) +#define REG_DMA2CNT_H (*(vu16 *)REG_ADDR_DMA2CNT_H) + +#define REG_DMA3SAD (*(vu32 *)REG_ADDR_DMA3SAD) +#define REG_DMA3DAD (*(vu32 *)REG_ADDR_DMA3DAD) +#define REG_DMA3CNT (*(vu32 *)REG_ADDR_DMA3CNT) +#define REG_DMA3CNT_L (*(vu16 *)REG_ADDR_DMA3CNT_L) +#define REG_DMA3CNT_H (*(vu16 *)REG_ADDR_DMA3CNT_H) + +#define REG_TMCNT(n) (*(vu16 *)(REG_ADDR_TMCNT + ((n) * 4))) +#define REG_TM0CNT (*(vu32 *)REG_ADDR_TM0CNT) +#define REG_TM0CNT_L (*(vu16 *)REG_ADDR_TM0CNT_L) +#define REG_TM0CNT_H (*(vu16 *)REG_ADDR_TM0CNT_H) +#define REG_TM1CNT (*(vu32 *)REG_ADDR_TM1CNT) +#define REG_TM1CNT_L (*(vu16 *)REG_ADDR_TM1CNT_L) +#define REG_TM1CNT_H (*(vu16 *)REG_ADDR_TM1CNT_H) +#define REG_TM2CNT (*(vu32 *)REG_ADDR_TM2CNT) +#define REG_TM2CNT_L (*(vu16 *)REG_ADDR_TM2CNT_L) +#define REG_TM2CNT_H (*(vu16 *)REG_ADDR_TM2CNT_H) +#define REG_TM3CNT (*(vu32 *)REG_ADDR_TM3CNT) +#define REG_TM3CNT_L (*(vu16 *)REG_ADDR_TM3CNT_L) +#define REG_TM3CNT_H (*(vu16 *)REG_ADDR_TM3CNT_H) + +#define REG_SIOCNT (*(vu16 *)REG_ADDR_SIOCNT) +#define REG_SIODATA8 (*(vu16 *)REG_ADDR_SIODATA8) +#define REG_SIODATA32 (*(vu32 *)REG_ADDR_SIODATA32) +#define REG_SIOMLT_SEND (*(vu16 *)REG_ADDR_SIOMLT_SEND) +#define REG_SIOMLT_RECV (*(vu64 *)REG_ADDR_SIOMLT_RECV) +#define REG_SIOMULTI0 (*(vu16 *)REG_ADDR_SIOMULTI0) +#define REG_SIOMULTI1 (*(vu16 *)REG_ADDR_SIOMULTI1) +#define REG_SIOMULTI2 (*(vu16 *)REG_ADDR_SIOMULTI2) +#define REG_SIOMULTI3 (*(vu16 *)REG_ADDR_SIOMULTI3) + +#define REG_KEYINPUT (*(vu16 *)REG_ADDR_KEYINPUT) +#define REG_KEYCNT (*(vu16 *)REG_ADDR_KEYCNT) + +#define REG_RCNT (*(vu16 *)REG_ADDR_RCNT) + +#define REG_IME (*(vu16 *)REG_ADDR_IME) +#define REG_IE (*(vu16 *)REG_ADDR_IE) +#define REG_IF (*(vu16 *)REG_ADDR_IF) + +#define REG_WAITCNT (*(vu16 *)REG_ADDR_WAITCNT) + +// I/O register fields + +// DISPCNT +#define DISPCNT_MODE_0 0x0000 // BG0: text, BG1: text, BG2: text, BG3: text +#define DISPCNT_MODE_1 0x0001 // BG0: text, BG1: text, BG2: affine, BG3: off +#define DISPCNT_MODE_2 0x0002 // BG0: off, BG1: off, BG2: affine, BG3: affine +#define DISPCNT_MODE_3 0x0003 // Bitmap mode, 240x160, BGR555 color +#define DISPCNT_MODE_4 0x0004 // Bitmap mode, 240x160, 256 color palette +#define DISPCNT_MODE_5 0x0005 // Bitmap mode, 160x128, BGR555 color +#define DISPCNT_OBJ_1D_MAP 0x0040 +#define DISPCNT_FORCED_BLANK 0x0080 +#define DISPCNT_BG0_ON 0x0100 +#define DISPCNT_BG1_ON 0x0200 +#define DISPCNT_BG2_ON 0x0400 +#define DISPCNT_BG3_ON 0x0800 +#define DISPCNT_BG_ALL_ON 0x0F00 +#define DISPCNT_OBJ_ON 0x1000 +#define DISPCNT_WIN0_ON 0x2000 +#define DISPCNT_WIN1_ON 0x4000 +#define DISPCNT_OBJWIN_ON 0x8000 + +// DISPSTAT +#define DISPSTAT_VBLANK 0x0001 // in V-Blank +#define DISPSTAT_HBLANK 0x0002 // in H-Blank +#define DISPSTAT_VCOUNT 0x0004 // V-Count match +#define DISPSTAT_VBLANK_INTR 0x0008 // V-Blank interrupt enabled +#define DISPSTAT_HBLANK_INTR 0x0010 // H-Blank interrupt enabled +#define DISPSTAT_VCOUNT_INTR 0x0020 // V-Count interrupt enabled + +// BGCNT +#define BGCNT_PRIORITY(n) (n) // Values 0 - 3. Lower priority BGs will be drawn on top of higher priority BGs. +#define BGCNT_CHARBASE(n) ((n) << 2) // Values 0 - 3. Base block for tile pixel data. +#define BGCNT_MOSAIC 0x0040 +#define BGCNT_16COLOR 0x0000 // 4 bits per pixel +#define BGCNT_256COLOR 0x0080 // 8 bits per pixel +#define BGCNT_SCREENBASE(n) ((n) << 8) // Values 0 - 31. Base block for tile map. +#define BGCNT_WRAP 0x2000 // Only affects affine BGs. Text BGs wrap by default. +#define BGCNT_TXT256x256 0x0000 // Internal screen size size of text mode BG in pixels. +#define BGCNT_TXT512x256 0x4000 +#define BGCNT_TXT256x512 0x8000 +#define BGCNT_TXT512x512 0xC000 +#define BGCNT_AFF128x128 0x0000 // Internal screen size size of affine mode BG in pixels. +#define BGCNT_AFF256x256 0x4000 +#define BGCNT_AFF512x512 0x8000 +#define BGCNT_AFF1024x1024 0xC000 + +// BLDCNT +// Bits 0-5 select layers for the 1st target +#define BLDCNT_TGT1_BG0 (1 << 0) +#define BLDCNT_TGT1_BG1 (1 << 1) +#define BLDCNT_TGT1_BG2 (1 << 2) +#define BLDCNT_TGT1_BG3 (1 << 3) +#define BLDCNT_TGT1_OBJ (1 << 4) +#define BLDCNT_TGT1_BD (1 << 5) +// Bits 6-7 select the special effect +#define BLDCNT_EFFECT_NONE (0 << 6) // no special effect +#define BLDCNT_EFFECT_BLEND (1 << 6) // 1st+2nd targets mixed (controlled by BLDALPHA) +#define BLDCNT_EFFECT_LIGHTEN (2 << 6) // 1st target becomes whiter (controlled by BLDY) +#define BLDCNT_EFFECT_DARKEN (3 << 6) // 1st target becomes blacker (controlled by BLDY) +// Bits 8-13 select layers for the 2nd target +#define BLDCNT_TGT2_BG0 (1 << 8) +#define BLDCNT_TGT2_BG1 (1 << 9) +#define BLDCNT_TGT2_BG2 (1 << 10) +#define BLDCNT_TGT2_BG3 (1 << 11) +#define BLDCNT_TGT2_OBJ (1 << 12) +#define BLDCNT_TGT2_BD (1 << 13) + +// BLDALPHA +#define BLDALPHA_BLEND(target1, target2) (((target2) << 8) | (target1)) + +// SOUNDCNT_H +#define SOUND_CGB_MIX_QUARTER 0x0000 +#define SOUND_CGB_MIX_HALF 0x0001 +#define SOUND_CGB_MIX_FULL 0x0002 +#define SOUND_A_MIX_HALF 0x0000 +#define SOUND_A_MIX_FULL 0x0004 +#define SOUND_B_MIX_HALF 0x0000 +#define SOUND_B_MIX_FULL 0x0008 +#define SOUND_ALL_MIX_FULL 0x000E +#define SOUND_A_RIGHT_OUTPUT 0x0100 +#define SOUND_A_LEFT_OUTPUT 0x0200 +#define SOUND_A_TIMER_0 0x0000 +#define SOUND_A_TIMER_1 0x0400 +#define SOUND_A_FIFO_RESET 0x0800 +#define SOUND_B_RIGHT_OUTPUT 0x1000 +#define SOUND_B_LEFT_OUTPUT 0x2000 +#define SOUND_B_TIMER_0 0x0000 +#define SOUND_B_TIMER_1 0x4000 +#define SOUND_B_FIFO_RESET 0x8000 + +// SOUNDCNT_X +#define SOUND_1_ON 0x0001 +#define SOUND_2_ON 0x0002 +#define SOUND_3_ON 0x0004 +#define SOUND_4_ON 0x0008 +#define SOUND_MASTER_ENABLE 0x0080 + +// DMA +#define DMA_DEST_INC 0x0000 +#define DMA_DEST_DEC 0x0020 +#define DMA_DEST_FIXED 0x0040 +#define DMA_DEST_RELOAD 0x0060 +#define DMA_SRC_INC 0x0000 +#define DMA_SRC_DEC 0x0080 +#define DMA_SRC_FIXED 0x0100 +#define DMA_REPEAT 0x0200 +#define DMA_16BIT 0x0000 +#define DMA_32BIT 0x0400 +#define DMA_DREQ_ON 0x0800 +#define DMA_START_NOW 0x0000 +#define DMA_START_VBLANK 0x1000 +#define DMA_START_HBLANK 0x2000 +#define DMA_START_SPECIAL 0x3000 +#define DMA_START_MASK 0x3000 +#define DMA_INTR_ENABLE 0x4000 +#define DMA_ENABLE 0x8000 + +// timer +#define TIMER_1CLK 0x00 +#define TIMER_64CLK 0x01 +#define TIMER_256CLK 0x02 +#define TIMER_1024CLK 0x03 +#define TIMER_INTR_ENABLE 0x40 +#define TIMER_ENABLE 0x80 + +// serial +#define SIO_ID 0x0030 // Communication ID + +#define SIO_8BIT_MODE 0x0000 // Normal 8-bit communication mode +#define SIO_32BIT_MODE 0x1000 // Normal 32-bit communication mode +#define SIO_MULTI_MODE 0x2000 // Multi-player communication mode +#define SIO_UART_MODE 0x3000 // UART communication mode + +#define SIO_9600_BPS 0x0000 // baud rate 9600 bps +#define SIO_38400_BPS 0x0001 // 38400 bps +#define SIO_57600_BPS 0x0002 // 57600 bps +#define SIO_115200_BPS 0x0003 // 115200 bps + +#define SIO_MULTI_SI 0x0004 // Multi-player communication SI terminal +#define SIO_MULTI_SD 0x0008 // SD terminal +#define SIO_MULTI_BUSY 0x0080 + +#define SIO_ERROR 0x0040 // Detect error +#define SIO_START 0x0080 // Start transfer +#define SIO_ENABLE 0x0080 // Enable SIO + +#define SIO_INTR_ENABLE 0x4000 + +#define SIO_MULTI_SI_SHIFT 2 +#define SIO_MULTI_SI_MASK 0x1 +#define SIO_MULTI_DI_SHIFT 3 +#define SIO_MULTI_DI_MASK 0x1 + +// keys +#define A_BUTTON 0x0001 +#define B_BUTTON 0x0002 +#define SELECT_BUTTON 0x0004 +#define START_BUTTON 0x0008 +#define DPAD_RIGHT 0x0010 +#define DPAD_LEFT 0x0020 +#define DPAD_UP 0x0040 +#define DPAD_DOWN 0x0080 +#define R_BUTTON 0x0100 +#define L_BUTTON 0x0200 +#define KEYS_MASK 0x03FF +#define KEY_INTR_ENABLE 0x0400 +#define KEY_OR_INTR 0x0000 +#define KEY_AND_INTR 0x8000 +#define DPAD_ANY 0x00F0 +#define JOY_EXCL_DPAD 0x030F + +// interrupt flags +#define INTR_FLAG_VBLANK (1 << 0) +#define INTR_FLAG_HBLANK (1 << 1) +#define INTR_FLAG_VCOUNT (1 << 2) +#define INTR_FLAG_TIMER0 (1 << 3) +#define INTR_FLAG_TIMER1 (1 << 4) +#define INTR_FLAG_TIMER2 (1 << 5) +#define INTR_FLAG_TIMER3 (1 << 6) +#define INTR_FLAG_SERIAL (1 << 7) +#define INTR_FLAG_DMA0 (1 << 8) +#define INTR_FLAG_DMA1 (1 << 9) +#define INTR_FLAG_DMA2 (1 << 10) +#define INTR_FLAG_DMA3 (1 << 11) +#define INTR_FLAG_KEYPAD (1 << 12) +#define INTR_FLAG_GAMEPAK (1 << 13) + +// WAITCNT +#define WAITCNT_SRAM_4 (0 << 0) +#define WAITCNT_SRAM_3 (1 << 0) +#define WAITCNT_SRAM_2 (2 << 0) +#define WAITCNT_SRAM_8 (3 << 0) +#define WAITCNT_SRAM_MASK (3 << 0) + +#define WAITCNT_WS0_N_4 (0 << 2) +#define WAITCNT_WS0_N_3 (1 << 2) +#define WAITCNT_WS0_N_2 (2 << 2) +#define WAITCNT_WS0_N_8 (3 << 2) +#define WAITCNT_WS0_N_MASK (3 << 2) + +#define WAITCNT_WS0_S_2 (0 << 4) +#define WAITCNT_WS0_S_1 (1 << 4) + +#define WAITCNT_WS1_N_4 (0 << 5) +#define WAITCNT_WS1_N_3 (1 << 5) +#define WAITCNT_WS1_N_2 (2 << 5) +#define WAITCNT_WS1_N_8 (3 << 5) +#define WAITCNT_WS1_N_MASK (3 << 5) + +#define WAITCNT_WS1_S_4 (0 << 7) +#define WAITCNT_WS1_S_1 (1 << 7) + +#define WAITCNT_WS2_N_4 (0 << 8) +#define WAITCNT_WS2_N_3 (1 << 8) +#define WAITCNT_WS2_N_2 (2 << 8) +#define WAITCNT_WS2_N_8 (3 << 8) +#define WAITCNT_WS2_N_MASK (3 << 8) + +#define WAITCNT_WS2_S_8 (0 << 10) +#define WAITCNT_WS2_S_1 (1 << 10) + +#define WAITCNT_PHI_OUT_NONE (0 << 11) +#define WAITCNT_PHI_OUT_4MHZ (1 << 11) +#define WAITCNT_PHI_OUT_8MHZ (2 << 11) +#define WAITCNT_PHI_OUT_16MHZ (3 << 11) +#define WAITCNT_PHI_OUT_MASK (3 << 11) + +#define WAITCNT_PREFETCH_ENABLE (1 << 14) + +#define WAITCNT_AGB (0 << 15) +#define WAITCNT_CGB (1 << 15) + +#endif // GUARD_GBA_IO_REG_H diff --git a/include/gba/m4a_internal.h b/include/gba/m4a_internal.h new file mode 100644 index 00000000..ff92fcc4 --- /dev/null +++ b/include/gba/m4a_internal.h @@ -0,0 +1,463 @@ +#ifndef GUARD_M4A_INTERNAL_H +#define GUARD_M4A_INTERNAL_H + +#include "gba/gba.h" + +// ASCII encoding of 'Smsh' in reverse +// This is presumably short for SMASH, the developer of MKS4AGB. +#define ID_NUMBER 0x68736D53 + +#define C_V 0x40 // center value for PAN, BEND, and TUNE + +#define SOUND_MODE_REVERB_VAL 0x0000007F +#define SOUND_MODE_REVERB_SET 0x00000080 +#define SOUND_MODE_MAXCHN 0x00000F00 +#define SOUND_MODE_MAXCHN_SHIFT 8 +#define SOUND_MODE_MASVOL 0x0000F000 +#define SOUND_MODE_MASVOL_SHIFT 12 +#define SOUND_MODE_FREQ_05734 0x00010000 +#define SOUND_MODE_FREQ_07884 0x00020000 +#define SOUND_MODE_FREQ_10512 0x00030000 +#define SOUND_MODE_FREQ_13379 0x00040000 +#define SOUND_MODE_FREQ_15768 0x00050000 +#define SOUND_MODE_FREQ_18157 0x00060000 +#define SOUND_MODE_FREQ_21024 0x00070000 +#define SOUND_MODE_FREQ_26758 0x00080000 +#define SOUND_MODE_FREQ_31536 0x00090000 +#define SOUND_MODE_FREQ_36314 0x000A0000 +#define SOUND_MODE_FREQ_40137 0x000B0000 +#define SOUND_MODE_FREQ_42048 0x000C0000 +#define SOUND_MODE_FREQ 0x000F0000 +#define SOUND_MODE_FREQ_SHIFT 16 +#define SOUND_MODE_DA_BIT_9 0x00800000 +#define SOUND_MODE_DA_BIT_8 0x00900000 +#define SOUND_MODE_DA_BIT_7 0x00A00000 +#define SOUND_MODE_DA_BIT_6 0x00B00000 +#define SOUND_MODE_DA_BIT 0x00B00000 +#define SOUND_MODE_DA_BIT_SHIFT 20 + +struct WaveData +{ + u16 type; + u16 status; + u32 freq; + u32 loopStart; + u32 size; // number of samples + s8 data[1]; // samples +}; + +#define TONEDATA_TYPE_CGB 0x07 +#define TONEDATA_TYPE_FIX 0x08 +#define TONEDATA_TYPE_SPL 0x40 // key split +#define TONEDATA_TYPE_RHY 0x80 // rhythm + +#define TONEDATA_P_S_PAN 0xc0 +#define TONEDATA_P_S_PAM TONEDATA_P_S_PAN + +struct ToneData +{ + u8 type; + u8 key; + u8 length; // sound length (compatible sound) + u8 pan_sweep; // pan or sweep (compatible sound ch. 1) + struct WaveData *wav; + u8 attack; + u8 decay; + u8 sustain; + u8 release; +}; + +struct CgbChannel +{ + u8 sf; + u8 ty; + u8 rightVolume; + u8 leftVolume; + u8 at; + u8 de; + u8 su; + u8 re; + u8 ky; + u8 ev; + u8 eg; + u8 ec; + u8 echoVolume; + u8 echoLength; + u8 d1; + u8 d2; + u8 gt; + u8 mk; + u8 ve; + u8 pr; + u8 rp; + u8 d3[3]; + u8 d5; + u8 sg; + u8 n4; + u8 pan; + u8 panMask; + u8 mo; + u8 le; + u8 sw; + u32 fr; + u32 wp; + u32 cp; + u32 tp; + u32 pp; + u32 np; + u8 d4[8]; +}; + +struct MusicPlayerTrack; + +struct SoundChannel +{ + u8 status; + u8 type; + u8 rightVolume; + u8 leftVolume; + u8 attack; + u8 decay; + u8 sustain; + u8 release; + u8 ky; + u8 ev; + u8 er; + u8 el; + u8 echoVolume; + u8 echoLength; + u8 d1; + u8 d2; + u8 gt; + u8 mk; + u8 ve; + u8 pr; + u8 rp; + u8 d3[3]; + u32 ct; + u32 fw; + u32 freq; + struct WaveData *wav; + u32 cp; + struct MusicPlayerTrack *track; + u32 pp; + u32 np; + u32 d4; + u16 xpi; + u16 xpc; +}; + +#define MAX_DIRECTSOUND_CHANNELS 12 + +#define PCM_DMA_BUF_SIZE 1584 // size of Direct Sound buffer + +struct SoundInfo +{ + // This field is normally equal to ID_NUMBER but it is set to other + // values during sensitive operations for locking purposes. + // This field should be volatile but isn't. This could potentially cause + // race conditions. + u32 ident; + + vu8 pcmDmaCounter; + + // Direct Sound + u8 reverb; + u8 maxChans; + u8 masterVolume; + u8 freq; + + u8 mode; + u8 c15; + u8 pcmDmaPeriod; // number of V-blanks per PCM DMA + u8 maxLines; + u8 gap[3]; + s32 pcmSamplesPerVBlank; + s32 pcmFreq; + s32 divFreq; + struct CgbChannel *cgbChans; + u32 func; + u32 intp; + void (*CgbSound)(void); + void (*CgbOscOff)(u8); + u32 (*MidiKeyToCgbFreq)(u8, u8, u8); + u32 MPlayJumpTable; + u32 plynote; + u32 ExtVolPit; + u8 gap2[16]; + struct SoundChannel chans[MAX_DIRECTSOUND_CHANNELS]; + s8 pcmBuffer[PCM_DMA_BUF_SIZE * 2]; +}; + +struct SongHeader +{ + u8 trackCount; + u8 blockCount; + u8 priority; + u8 reverb; + struct ToneData *tone; + u8 *part[1]; +}; + +struct PokemonCrySong +{ + u8 trackCount; + u8 blockCount; + u8 priority; + u8 reverb; + struct ToneData *tone; + u8 *part[2]; + u8 gap; + u8 part0; // 0x11 + u8 tuneValue; // 0x12 + u8 gotoCmd; // 0x13 + u32 gotoTarget; // 0x14 + u8 part1; // 0x18 + u8 tuneValue2; // 0x19 + u8 cont[2]; // 0x1A + u8 volCmd; // 0x1C + u8 volumeValue; // 0x1D + u8 unkCmd0D[2]; // 0x1E + u32 unkCmd0DParam; // 0x20 + u8 xreleCmd[2]; // 0x24 + u8 releaseValue; // 0x26 + u8 panCmd; + u8 panValue; // 0x28 + u8 tieCmd; // 0x29 + u8 tieKeyValue; // 0x2A + u8 tieVelocityValue; // 0x2B + u8 unkCmd0C[2]; // 0x2C + u16 unkCmd0CParam; // 0x2E + u8 end[2]; // 0x30 +}; + +#define MPT_FLG_VOLSET 0x01 +#define MPT_FLG_VOLCHG 0x03 +#define MPT_FLG_PITSET 0x04 +#define MPT_FLG_PITCHG 0x0C +#define MPT_FLG_START 0x40 +#define MPT_FLG_EXIST 0x80 + +struct MusicPlayerTrack +{ + u8 flags; + u8 wait; + u8 patternLevel; + u8 repN; + u8 gateTime; + u8 key; + u8 velocity; + u8 runningStatus; + u8 keyM; + u8 pitM; + s8 keyShift; + s8 keyShiftX; + s8 tune; + u8 pitX; + s8 bend; + u8 bendRange; + u8 volMR; + u8 volML; + u8 vol; + u8 volX; + s8 pan; + s8 panX; + s8 modM; + u8 mod; + u8 modT; + u8 lfoSpeed; + u8 lfoSpeedC; + u8 lfoDelay; + u8 lfoDelayC; + u8 priority; + u8 echoVolume; + u8 echoLength; + struct SoundChannel *chan; + struct ToneData tone; + u8 gap[10]; + u16 unk_3A; + u32 unk_3C; + u8 *cmdPtr; + u8 *patternStack[3]; +}; + +#define MUSICPLAYER_STATUS_TRACK 0x0000ffff +#define MUSICPLAYER_STATUS_PAUSE 0x80000000 + +#define MAX_MUSICPLAYER_TRACKS 16 + +#define TEMPORARY_FADE 0x0001 +#define FADE_IN 0x0002 +#define FADE_VOL_MAX 64 +#define FADE_VOL_SHIFT 2 + +struct MusicPlayerInfo +{ + struct SongHeader *songHeader; + u32 status; + u8 trackCount; + u8 priority; + u8 cmd; + u8 unk_B; + u32 clock; + u8 gap[8]; + u8 *memAccArea; + u16 tempoD; + u16 tempoU; + u16 tempoI; + u16 tempoC; + u16 fadeOI; + u16 fadeOC; + u16 fadeOV; + struct MusicPlayerTrack *tracks; + struct ToneData *tone; + u32 ident; + u32 func; + u32 intp; +}; + +struct MusicPlayer +{ + struct MusicPlayerInfo *info; + struct MusicPlayerTrack *track; + u8 unk_8; + u16 unk_A; +}; + +struct Song +{ + struct SongHeader *header; + u16 ms; + u16 me; +}; + +extern const struct MusicPlayer gMPlayTable[]; +extern const struct Song gSongTable[]; + + + +extern u8 gMPlayMemAccArea[]; + +//u8 gPokemonCrySong[52]; +//u8 gPokemonCrySongs[52 * MAX_POKEMON_CRIES]; + +#define MAX_POKEMON_CRIES 2 + +extern struct PokemonCrySong gPokemonCrySong; +extern struct PokemonCrySong gPokemonCrySongs[]; + +extern struct MusicPlayerInfo gPokemonCryMusicPlayers[]; +extern struct MusicPlayerTrack gPokemonCryTracks[]; + +extern char SoundMainRAM[]; + +extern void *gMPlayJumpTable[]; + +typedef void (*XcmdFunc)(struct MusicPlayerInfo *, struct MusicPlayerTrack *); +extern const XcmdFunc gXcmdTable[]; + +extern struct CgbChannel gCgbChans[]; + +extern const u8 gScaleTable[]; +extern const u32 gFreqTable[]; +extern const u16 gPcmSamplesPerVBlankTable[]; + +extern const u8 gCgbScaleTable[]; +extern const s16 gCgbFreqTable[]; +extern const u8 gNoiseTable[]; + +extern const struct PokemonCrySong gPokemonCrySongTemplate; + +extern const struct ToneData voicegroup_pokemon_cry; + +extern char gNumMusicPlayers[]; +extern char gMaxLines[]; + +#define NUM_MUSIC_PLAYERS ((u16)gNumMusicPlayers) +#define MAX_LINES ((u32)gMaxLines) + +u32 umul3232H32(u32 multiplier, u32 multiplicand); +void SoundMain(void); +void SoundMainBTM(void); +void TrackStop(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track); +void MPlayMain(void); +void RealClearChain(void *x); + +void MPlayContinue(struct MusicPlayerInfo *mplayInfo); +void MPlayStart(struct MusicPlayerInfo *mplayInfo, struct SongHeader *songHeader); +void m4aMPlayStop(struct MusicPlayerInfo *mplayInfo); +void FadeOutBody(struct MusicPlayerInfo *mplayInfo); +void TrkVolPitSet(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track); +void MPlayFadeOut(struct MusicPlayerInfo *mplayInfo, u16 speed); +void ClearChain(void *x); +void Clear64byte(void *addr); +void SoundInit(struct SoundInfo *soundInfo); +void MPlayExtender(struct CgbChannel *cgbChans); +void m4aSoundMode(u32 mode); +void MPlayOpen(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track, u8 a3); +void CgbSound(void); +void CgbOscOff(u8); +u32 MidiKeyToCgbFreq(u8, u8, u8); +void DummyFunc(void); +void MPlayJumpTableCopy(void **mplayJumpTable); +void SampleFreqSet(u32 freq); +void m4aSoundVSyncOn(void); +void m4aSoundVSyncOff(void); + +void ClearModM(struct MusicPlayerTrack *track); +void m4aMPlayModDepthSet(struct MusicPlayerInfo *mplayInfo, u16 trackBits, u8 modDepth); +void m4aMPlayLFOSpeedSet(struct MusicPlayerInfo *mplayInfo, u16 trackBits, u8 lfoSpeed); + +struct MusicPlayerInfo *SetPokemonCryTone(struct ToneData *tone); +void SetPokemonCryVolume(u8 val); +void SetPokemonCryPanpot(s8 val); +void SetPokemonCryPitch(s16 val); +void SetPokemonCryLength(u16 val); +void SetPokemonCryRelease(u8 val); +void SetPokemonCryProgress(u32 val); +int IsPokemonCryPlaying(struct MusicPlayerInfo *mplayInfo); +void SetPokemonCryChorus(s8 val); +void SetPokemonCryStereo(u32 val); +void SetPokemonCryPriority(u8 val); + +// sound command handler functions +void ply_fine(struct MusicPlayerInfo *, struct MusicPlayerTrack *); +void ply_goto(struct MusicPlayerInfo *, struct MusicPlayerTrack *); +void ply_patt(struct MusicPlayerInfo *, struct MusicPlayerTrack *); +void ply_pend(struct MusicPlayerInfo *, struct MusicPlayerTrack *); +void ply_rept(struct MusicPlayerInfo *, struct MusicPlayerTrack *); +void ply_memacc(struct MusicPlayerInfo *, struct MusicPlayerTrack *); +void ply_prio(struct MusicPlayerInfo *, struct MusicPlayerTrack *); +void ply_tempo(struct MusicPlayerInfo *, struct MusicPlayerTrack *); +void ply_keysh(struct MusicPlayerInfo *, struct MusicPlayerTrack *); +void ply_voice(struct MusicPlayerInfo *, struct MusicPlayerTrack *); +void ply_vol(struct MusicPlayerInfo *, struct MusicPlayerTrack *); +void ply_pan(struct MusicPlayerInfo *, struct MusicPlayerTrack *); +void ply_bend(struct MusicPlayerInfo *, struct MusicPlayerTrack *); +void ply_bendr(struct MusicPlayerInfo *, struct MusicPlayerTrack *); +void ply_lfos(struct MusicPlayerInfo *, struct MusicPlayerTrack *); +void ply_lfodl(struct MusicPlayerInfo *, struct MusicPlayerTrack *); +void ply_mod(struct MusicPlayerInfo *, struct MusicPlayerTrack *); +void ply_modt(struct MusicPlayerInfo *, struct MusicPlayerTrack *); +void ply_tune(struct MusicPlayerInfo *, struct MusicPlayerTrack *); +void ply_port(struct MusicPlayerInfo *, struct MusicPlayerTrack *); +void ply_xcmd(struct MusicPlayerInfo *, struct MusicPlayerTrack *); +void ply_endtie(struct MusicPlayerInfo *, struct MusicPlayerTrack *); +void ply_note(struct MusicPlayerInfo *, struct MusicPlayerTrack *); + +// extended sound command handler functions +void ply_xxx(struct MusicPlayerInfo *, struct MusicPlayerTrack *); +void ply_xwave(struct MusicPlayerInfo *, struct MusicPlayerTrack *); +void ply_xtype(struct MusicPlayerInfo *, struct MusicPlayerTrack *); +void ply_xatta(struct MusicPlayerInfo *, struct MusicPlayerTrack *); +void ply_xdeca(struct MusicPlayerInfo *, struct MusicPlayerTrack *); +void ply_xsust(struct MusicPlayerInfo *, struct MusicPlayerTrack *); +void ply_xrele(struct MusicPlayerInfo *, struct MusicPlayerTrack *); +void ply_xiecv(struct MusicPlayerInfo *, struct MusicPlayerTrack *); +void ply_xiecl(struct MusicPlayerInfo *, struct MusicPlayerTrack *); +void ply_xleng(struct MusicPlayerInfo *, struct MusicPlayerTrack *); +void ply_xswee(struct MusicPlayerInfo *, struct MusicPlayerTrack *); +void ply_xcmd_0C(struct MusicPlayerInfo *, struct MusicPlayerTrack *); +void ply_xcmd_0D(struct MusicPlayerInfo *, struct MusicPlayerTrack *); + +#endif // GUARD_M4A_INTERNAL_H diff --git a/include/gba/macro.h b/include/gba/macro.h new file mode 100644 index 00000000..a0edf2a4 --- /dev/null +++ b/include/gba/macro.h @@ -0,0 +1,137 @@ +#ifndef GUARD_GBA_MACRO_H +#define GUARD_GBA_MACRO_H + +#define CPU_FILL(value, dest, size, bit) \ +{ \ + vu##bit tmp = (vu##bit)(value); \ + CpuSet((void *)&tmp, \ + dest, \ + CPU_SET_##bit##BIT | CPU_SET_SRC_FIXED | ((size)/(bit/8) & 0x1FFFFF)); \ +} + +#define CpuFill16(value, dest, size) CPU_FILL(value, dest, size, 16) +#define CpuFill32(value, dest, size) CPU_FILL(value, dest, size, 32) + +#define CPU_COPY(src, dest, size, bit) CpuSet(src, dest, CPU_SET_##bit##BIT | ((size)/(bit/8) & 0x1FFFFF)) + +#define CpuCopy16(src, dest, size) CPU_COPY(src, dest, size, 16) +#define CpuCopy32(src, dest, size) CPU_COPY(src, dest, size, 32) + +#define CpuFastFill(value, dest, size) \ +{ \ + vu32 tmp = (vu32)(value); \ + CpuFastSet((void *)&tmp, \ + dest, \ + CPU_FAST_SET_SRC_FIXED | ((size)/(32/8) & 0x1FFFFF)); \ +} + +#define CpuFastFill16(value, dest, size) CpuFastFill(((value) << 16) | (value), (dest), (size)) + +#define CpuFastCopy(src, dest, size) CpuFastSet(src, dest, ((size)/(32/8) & 0x1FFFFF)) + +#define DmaSet(dmaNum, src, dest, control) \ +{ \ + vu32 *dmaRegs = (vu32 *)REG_ADDR_DMA##dmaNum; \ + dmaRegs[0] = (vu32)(src); \ + dmaRegs[1] = (vu32)(dest); \ + dmaRegs[2] = (vu32)(control); \ + dmaRegs[2]; \ +} + +#define DMA_FILL(dmaNum, value, dest, size, bit) \ +{ \ + vu##bit tmp = (vu##bit)(value); \ + DmaSet(dmaNum, \ + &tmp, \ + dest, \ + (DMA_ENABLE | DMA_START_NOW | DMA_##bit##BIT | DMA_SRC_FIXED | DMA_DEST_INC) << 16 \ + | ((size)/(bit/8))); \ +} + +#define DmaFill16(dmaNum, value, dest, size) DMA_FILL(dmaNum, value, dest, size, 16) +#define DmaFill32(dmaNum, value, dest, size) DMA_FILL(dmaNum, value, dest, size, 32) + +// Note that the DMA clear macros cause the DMA control value to be calculated +// at runtime rather than compile time. The size is divided by the DMA transfer +// unit size (2 or 4 bytes) and then combined with the DMA control flags using a +// bitwise OR operation. + +#define DMA_CLEAR(dmaNum, dest, size, bit) \ +{ \ + vu##bit *_dest = (vu##bit *)(dest); \ + u32 _size = size; \ + DmaFill##bit(dmaNum, 0, _dest, _size); \ +} + +#define DmaClear16(dmaNum, dest, size) DMA_CLEAR(dmaNum, dest, size, 16) +#define DmaClear32(dmaNum, dest, size) DMA_CLEAR(dmaNum, dest, size, 32) + +#define DMA_COPY(dmaNum, src, dest, size, bit) \ + DmaSet(dmaNum, \ + src, \ + dest, \ + (DMA_ENABLE | DMA_START_NOW | DMA_##bit##BIT | DMA_SRC_INC | DMA_DEST_INC) << 16 \ + | ((size)/(bit/8))) + +#define DmaCopy16(dmaNum, src, dest, size) DMA_COPY(dmaNum, src, dest, size, 16) +#define DmaCopy32(dmaNum, src, dest, size) DMA_COPY(dmaNum, src, dest, size, 32) + +#define DmaStop(dmaNum) \ +{ \ + vu16 *dmaRegs = (vu16 *)REG_ADDR_DMA##dmaNum; \ + dmaRegs[5] &= ~(DMA_START_MASK | DMA_DREQ_ON | DMA_REPEAT); \ + dmaRegs[5] &= ~DMA_ENABLE; \ + dmaRegs[5]; \ +} + +#define DmaCopyLarge(dmaNum, src, dest, size, block, bit) \ +{ \ + const void *_src = src; \ + void *_dest = dest; \ + u32 _size = size; \ + while (1) \ + { \ + DmaCopy##bit(dmaNum, _src, _dest, (block)); \ + _src += (block); \ + _dest += (block); \ + _size -= (block); \ + if (_size <= (block)) \ + { \ + DmaCopy##bit(dmaNum, _src, _dest, _size); \ + break; \ + } \ + } \ +} + +#define DmaClearLarge(dmaNum, dest, size, block, bit) \ +{ \ + u32 _size = size; \ + while (1) \ + { \ + DmaFill##bit(dmaNum, 0, dest, (block)); \ + dest += (block); \ + _size -= (block); \ + if (_size <= (block)) \ + { \ + DmaFill##bit(dmaNum, 0, dest, _size); \ + break; \ + } \ + } \ +} + +#define DmaCopyLarge16(dmaNum, src, dest, size, block) DmaCopyLarge(dmaNum, src, dest, size, block, 16) + +#define DmaCopyLarge32(dmaNum, src, dest, size, block) DmaCopyLarge(dmaNum, src, dest, size, block, 32) + +#define DmaCopyDefvars(dmaNum, src, dest, size, bit) \ +{ \ + const void *_src = src; \ + void *_dest = dest; \ + u32 _size = size; \ + DmaCopy##bit(dmaNum, _src, _dest, _size); \ +} + +#define DmaCopy16Defvars(dmaNum, src, dest, size) DmaCopyDefvars(dmaNum, src, dest, size, 16) +#define DmaCopy32Defvars(dmaNum, src, dest, size) DmaCopyDefvars(dmaNum, src, dest, size, 32) + +#endif // GUARD_GBA_MACRO_H diff --git a/include/gba/multiboot.h b/include/gba/multiboot.h new file mode 100644 index 00000000..e88b43a1 --- /dev/null +++ b/include/gba/multiboot.h @@ -0,0 +1,55 @@ +#ifndef GUARD_GBA_MULTIBOOT_H +#define GUARD_GBA_MULTIBOOT_H + +#define MULTIBOOT_NCHILD 3 // Maximum number of slaves +#define MULTIBOOT_HEADER_SIZE 0xc0 // Header size +#define MULTIBOOT_SEND_SIZE_MIN 0x100 // Minimum transmission size +#define MULTIBOOT_SEND_SIZE_MAX 0x40000 // Maximum transmission size + +struct MultiBootParam +{ + u32 system_work[5]; + u8 handshake_data; + u8 padding; + u16 handshake_timeout; + u8 probe_count; + u8 client_data[MULTIBOOT_NCHILD]; + u8 palette_data; + u8 response_bit; + u8 client_bit; + u8 reserved1; + u8 *boot_srcp; + u8 *boot_endp; + u8 *masterp; + u8 *reserved2[MULTIBOOT_NCHILD]; + u32 system_work2[4]; + u8 sendflag; + u8 probe_target_bit; + u8 check_wait; + u8 server_type; +}; + +#define MULTIBOOT_ERROR_04 0x04 +#define MULTIBOOT_ERROR_08 0x08 +#define MULTIBOOT_ERROR_0c 0x0c +#define MULTIBOOT_ERROR_40 0x40 +#define MULTIBOOT_ERROR_44 0x44 +#define MULTIBOOT_ERROR_48 0x48 +#define MULTIBOOT_ERROR_4c 0x4c +#define MULTIBOOT_ERROR_80 0x80 +#define MULTIBOOT_ERROR_84 0x84 +#define MULTIBOOT_ERROR_88 0x88 +#define MULTIBOOT_ERROR_8c 0x8c +#define MULTIBOOT_ERROR_NO_PROBE_TARGET 0x50 +#define MULTIBOOT_ERROR_NO_DLREADY 0x60 +#define MULTIBOOT_ERROR_BOOT_FAILURE 0x70 +#define MULTIBOOT_ERROR_HANDSHAKE_FAILURE 0x71 + +#define MULTIBOOT_CONNECTION_CHECK_WAIT 15 + +#define MULTIBOOT_SERVER_TYPE_NORMAL 0 +#define MULTIBOOT_SERVER_TYPE_QUICK 1 + +#define MULTIBOOT_HANDSHAKE_TIMEOUT 400 + +#endif // GUARD_GBA_MULTIBOOT_H diff --git a/include/gba/syscall.h b/include/gba/syscall.h new file mode 100644 index 00000000..deddec5b --- /dev/null +++ b/include/gba/syscall.h @@ -0,0 +1,48 @@ +#ifndef GUARD_GBA_SYSCALL_H +#define GUARD_GBA_SYSCALL_H + +#define RESET_EWRAM 0x01 +#define RESET_IWRAM 0x02 +#define RESET_PALETTE 0x04 +#define RESET_VRAM 0x08 +#define RESET_OAM 0x10 +#define RESET_SIO_REGS 0x20 +#define RESET_SOUND_REGS 0x40 +#define RESET_REGS 0x80 +#define RESET_ALL 0xFF + +void SoftReset(u32 resetFlags); + +void RegisterRamReset(u32 resetFlags); + +void VBlankIntrWait(void); + +u16 Sqrt(u32 num); + +u16 ArcTan2(s16 x, s16 y); + +#define CPU_SET_SRC_FIXED 0x01000000 +#define CPU_SET_16BIT 0x00000000 +#define CPU_SET_32BIT 0x04000000 + +void CpuSet(const void *src, void *dest, u32 control); + +#define CPU_FAST_SET_SRC_FIXED 0x01000000 + +void CpuFastSet(const void *src, void *dest, u32 control); + +void BgAffineSet(struct BgAffineSrcData *src, struct BgAffineDstData *dest, s32 count); + +void ObjAffineSet(struct ObjAffineSrcData *src, void *dest, s32 count, s32 offset); + +void LZ77UnCompWram(const void *src, void *dest); + +void LZ77UnCompVram(const void *src, void *dest); + +void RLUnCompWram(const void *src, void *dest); + +void RLUnCompVram(const void *src, void *dest); + +int MultiBoot(struct MultiBootParam *mp); + +#endif // GUARD_GBA_SYSCALL_H diff --git a/include/gba/types.h b/include/gba/types.h new file mode 100644 index 00000000..480619d2 --- /dev/null +++ b/include/gba/types.h @@ -0,0 +1,129 @@ +#ifndef GUARD_GBA_TYPES_H +#define GUARD_GBA_TYPES_H + +#include + +typedef uint8_t u8; +typedef uint16_t u16; +typedef uint32_t u32; +typedef uint64_t u64; +typedef int8_t s8; +typedef int16_t s16; +typedef int32_t s32; +typedef int64_t s64; + +typedef volatile u8 vu8; +typedef volatile u16 vu16; +typedef volatile u32 vu32; +typedef volatile u64 vu64; +typedef volatile s8 vs8; +typedef volatile s16 vs16; +typedef volatile s32 vs32; +typedef volatile s64 vs64; + +typedef float f32; +typedef double f64; + +typedef u8 bool8; +typedef u16 bool16; +typedef u32 bool32; + +struct PlttData +{ + u16 r:5; // red + u16 g:5; // green + u16 b:5; // blue + u16 unused_15:1; +} /*__attribute__((packed))*/; + +struct OamData +{ + /*0x00*/ u32 y:8; + /*0x01*/ u32 affineMode:2; // 0x1, 0x2 = 0x3 + u32 objMode:2; // 0x4, 0x8 = 0xC + u32 mosaic:1; // 0x10 + u32 bpp:1; // 0x20 + u32 shape:2; // 0x40, 0x80 + + /*0x02*/ u32 x:9; + u32 matrixNum:5; // bits 3/4 are h-flip/v-flip if not in affine mode + u32 size:2; + + /*0x04*/ u16 tileNum:10; + u16 priority:2; + u16 paletteNum:4; + /*0x06*/ u16 affineParam; +}; + +#define ST_OAM_OBJ_NORMAL 0 +#define ST_OAM_OBJ_BLEND 1 +#define ST_OAM_OBJ_WINDOW 2 + +#define ST_OAM_AFFINE_OFF 0 +#define ST_OAM_AFFINE_NORMAL 1 +#define ST_OAM_AFFINE_ERASE 2 +#define ST_OAM_AFFINE_DOUBLE 3 + +#define ST_OAM_AFFINE_ON_MASK 1 +#define ST_OAM_AFFINE_DOUBLE_MASK 2 + +#define ST_OAM_4BPP 0 +#define ST_OAM_8BPP 1 + +#define ST_OAM_SQUARE 0 +#define ST_OAM_H_RECTANGLE 1 +#define ST_OAM_V_RECTANGLE 2 + +struct BgAffineSrcData +{ + s32 texX; + s32 texY; + s16 scrX; + s16 scrY; + s16 sx; + s16 sy; + u16 alpha; +}; + +struct BgAffineDstData +{ + s16 pa; + s16 pb; + s16 pc; + s16 pd; + s32 dx; + s32 dy; +}; + +struct ObjAffineSrcData +{ + s16 xScale; + s16 yScale; + u16 rotation; +}; + +// Multi-player SIO Control Structure +struct SioMultiCnt +{ + u16 baudRate:2; // baud rate + u16 si:1; // SI terminal + u16 sd:1; // SD terminal + u16 id:2; // ID + u16 error:1; // error flag + u16 enable:1; // SIO enable + u16 unused_11_8:4; + u16 mode:2; // communication mode (should equal 2) + u16 intrEnable:1; // IRQ enable + u16 unused_15:1; + u16 data; // data +}; + +#define ST_SIO_MULTI_MODE 2 // Multi-player communication mode + +// baud rate +#define ST_SIO_9600_BPS 0 // 9600 bps +#define ST_SIO_38400_BPS 1 // 38400 bps +#define ST_SIO_57600_BPS 2 // 57600 bps +#define ST_SIO_115200_BPS 3 // 115200 bps + +#endif // GUARD_GBA_TYPES_H diff --git a/include/global.h b/include/global.h new file mode 100644 index 00000000..75592d51 --- /dev/null +++ b/include/global.h @@ -0,0 +1,39 @@ +#ifndef GUARD_GLOBAL_H +#define GUARD_GLOBAL_H + +#include "gba/gba.h" + +// IDE support +#ifdef __APPLE__ +#define _(x) x +#define __(x) x +#define INCBIN_U8 {0} +#define INCBIN_U16 {0} +#define INCBIN_U32 {0} +#define INCBIN_S8 {0} +#define INCBIN_S16 {0} +#define INCBIN_S32 {0} +void * memcpy (void *, const void *, size_t); +void * memset (void *, int, size_t); +int strcmp (const char *, const char *); +#endif + +// Prevent cross-jump optimization. +#define BLOCK_CROSS_JUMP asm(""); + +// to help in decompiling +#define asm_comment(x) asm volatile("@ -- " x " -- ") + +#define asm_unified(x) asm(".syntax unified\n" x "\n.syntax divided\n") + +#define nonmatching(fndec, x) {\ +__attribute__((naked))\ +fndec\ +{\ + asm_unified(x);\ +}\ +} + +#define ARRAY_COUNT(array) (sizeof(array) / sizeof((array)[0])) + +#endif // GUARD_GLOBAL_H diff --git a/ld_script.sed b/ld_script.sed new file mode 100644 index 00000000..65e2610d --- /dev/null +++ b/ld_script.sed @@ -0,0 +1,14 @@ +// { + r sym_ewram.ld + d +} + +// { + r sym_ewram2.ld + d +} + +// { + r sym_iwram.ld + d +} diff --git a/ld_script.txt b/ld_script.txt new file mode 100644 index 00000000..dd4aeeda --- /dev/null +++ b/ld_script.txt @@ -0,0 +1,107 @@ +ENTRY(Start) + +SECTIONS { + . = 0x2000000; + + ewram (NOLOAD) : + ALIGN(4) + { + ewram_start = .; + + . = ALIGN(4); + src/agb_flash.o(.bss); + . = ALIGN(4); + tools/agbcc/lib/libgcc.a:fp-bit.o(.bss); + . = ALIGN(4); + tools/agbcc/lib/libgcc.a:dp-bit.o(.bss); + + . = 0x40000; + } + + . = 0x3000000; + + iwram (NOLOAD) : + ALIGN(4) + { + iwram_start = .; + + . = 0x8000; + } + + . = 0x8000000; + + .text : + ALIGN(4) + { + asm/crt0.o(.text); + asm/code.o(.text); + src/main.o(.text); + asm/code_800B540.o(.text); + asm/m4a.o(.text); + asm/syscall.o(.text); + src/agb_flash.o(.text); + src/agb_flash_1m.o(.text); + src/agb_flash_mx.o(.text); + src/agb_flash_le.o(.text); + tools/agbcc/lib/libgcc.a:_call_via_rX.o(.text); + tools/agbcc/lib/libgcc.a:_divsi3.o(.text); + tools/agbcc/lib/libgcc.a:_dvmd_tls.o(.text); + tools/agbcc/lib/libgcc.a:_fixunssfsi.o(.text); + tools/agbcc/lib/libgcc.a:_modsi3.o(.text); + tools/agbcc/lib/libgcc.a:_umodsi3.o(.text); + tools/agbcc/lib/libgcc.a:fp-bit.o(.text); + tools/agbcc/lib/libgcc.a:_muldi3.o(.text); + tools/agbcc/lib/libgcc.a:dp-bit.o(.text); + tools/agbcc/lib/libgcc.a:_lshrdi3.o(.text); + tools/agbcc/lib/libgcc.a:_negdi2.o(.text); + asm/libc.o(.text); + } =0 + + .rodata : + ALIGN(4) + { + data/data.o(.rodata); + src/agb_flash.o(.rodata); + src/agb_flash_1m.o(.rodata); + src/agb_flash_mx.o(.rodata); + src/agb_flash_le.o(.rodata); + data/libc_data.o(.rodata); + data/data_8270000.o(.rodata); + } =0 + + unk_code_section : + ALIGN(4) + { + unk_code = .; + asm/code_8272724.o(.rodata); + asm/code_8272724.o(.text); + unk_code_end = .; + } + + unk_code_ram_end = unk_code_ram + (unk_code_end - unk_code); + end = unk_code_ram_end; + + . = 0x8300000; + unk_data : + ALIGN(4) + { + data/unk_data.o(.rodata); + } + + /* DWARF 2 sections */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + .debug_info 0 : { *(.debug_info) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + + /* Discard everything not specifically mentioned above. */ + /DISCARD/ : + { + *(*); + } +} diff --git a/rom.md5 b/rom.md5 new file mode 100644 index 00000000..f65c7f69 --- /dev/null +++ b/rom.md5 @@ -0,0 +1 @@ +2100CF6F17E12CD34F1513647DFA506B pmd_red.gba diff --git a/src/agb_flash.c b/src/agb_flash.c new file mode 100644 index 00000000..11e2085a --- /dev/null +++ b/src/agb_flash.c @@ -0,0 +1,284 @@ +#include "gba/gba.h" +#include "gba/flash_internal.h" + +static u8 sTimerNum; +static u16 sTimerCount; +static vu16 *sTimerReg; +static u16 sSavedIme; + +void SetReadFlash1(u16 *dest); + +void SwitchFlashBank(u8 bankNum) +{ + FLASH_WRITE(0x5555, 0xAA); + FLASH_WRITE(0x2AAA, 0x55); + FLASH_WRITE(0x5555, 0xB0); + FLASH_WRITE(0x0000, bankNum); +} + +#define DELAY() \ +do { \ + vu16 i; \ + for (i = 20000; i != 0; i--) \ + ; \ +} while (0) + +u16 ReadFlashId(void) +{ + u16 flashId; + u16 readFlash1Buffer[0x20]; + u8 (*readFlash1)(u8 *); + + SetReadFlash1(readFlash1Buffer); + readFlash1 = (u8 (*)(u8 *))((s32)readFlash1Buffer + 1); + + // Enter ID mode. + FLASH_WRITE(0x5555, 0xAA); + FLASH_WRITE(0x2AAA, 0x55); + FLASH_WRITE(0x5555, 0x90); + DELAY(); + + flashId = readFlash1(FLASH_BASE + 1) << 8; + flashId |= readFlash1(FLASH_BASE); + + // Leave ID mode. + FLASH_WRITE(0x5555, 0xAA); + FLASH_WRITE(0x2AAA, 0x55); + FLASH_WRITE(0x5555, 0xF0); + FLASH_WRITE(0x5555, 0xF0); + DELAY(); + + return flashId; +} + +void FlashTimerIntr(void) +{ + if (sTimerCount != 0 && --sTimerCount == 0) + gFlashTimeoutFlag = 1; +} + +u16 SetFlashTimerIntr(u8 timerNum, void (**intrFunc)(void)) +{ + if (timerNum >= 4) + return 1; + + sTimerNum = timerNum; + sTimerReg = ®_TMCNT(sTimerNum); + *intrFunc = FlashTimerIntr; + return 0; +} + +void StartFlashTimer(u8 phase) +{ + const u16 *maxTime = &gFlashMaxTime[phase * 3]; + sSavedIme = REG_IME; + REG_IME = 0; + sTimerReg[1] = 0; + REG_IE |= (INTR_FLAG_TIMER0 << sTimerNum); + gFlashTimeoutFlag = 0; + sTimerCount = *maxTime++; + *sTimerReg++ = *maxTime++; + *sTimerReg-- = *maxTime++; + REG_IF = (INTR_FLAG_TIMER0 << sTimerNum); + REG_IME = 1; +} + +void StopFlashTimer(void) +{ + REG_IME = 0; + *sTimerReg++ = 0; + *sTimerReg-- = 0; + REG_IE &= ~(INTR_FLAG_TIMER0 << sTimerNum); + REG_IME = sSavedIme; +} + +u8 ReadFlash1(u8 *addr) +{ + return *addr; +} + +void SetReadFlash1(u16 *dest) +{ + u16 *src; + u16 i; + + PollFlashStatus = (u8 (*)(u8 *))((s32)dest + 1); + + src = (u16 *)ReadFlash1; + src = (u16 *)((s32)src & ~1); + + i = ((s32)SetReadFlash1 - (s32)ReadFlash1) >> 1; + + while (i != 0) + { + *dest++ = *src++; + i--; + } +} + +void ReadFlash_Core(u8 *src, u8 *dest, u32 size) +{ + while (size-- != 0) + { + *dest++ = *src++; + } +} + +void ReadFlash(u16 sectorNum, u32 offset, u8 *dest, u32 size) +{ + u8 *src; + u16 i; + u16 readFlash_Core_Buffer[0x40]; + u16 *funcSrc; + u16 *funcDest; + void (*readFlash_Core)(u8 *, u8 *, u32); + + REG_WAITCNT = (REG_WAITCNT & ~WAITCNT_SRAM_MASK) | WAITCNT_SRAM_8; + + if (gFlash->romSize == FLASH_ROM_SIZE_1M) + { + SwitchFlashBank(sectorNum / SECTORS_PER_BANK); + sectorNum %= SECTORS_PER_BANK; + } + + funcSrc = (u16 *)ReadFlash_Core; + funcSrc = (u16 *)((s32)funcSrc & ~1); + funcDest = readFlash_Core_Buffer; + + i = ((s32)ReadFlash - (s32)ReadFlash_Core) >> 1; + + while (i != 0) + { + *funcDest++ = *funcSrc++; + i--; + } + + readFlash_Core = (void (*)(u8 *, u8 *, u32))((s32)readFlash_Core_Buffer + 1); + + src = FLASH_BASE + (sectorNum << gFlash->sector.shift) + offset; + + readFlash_Core(src, dest, size); +} + +u32 VerifyFlashSector_Core(u8 *src, u8 *tgt, u32 size) +{ + while (size-- != 0) + { + if (*tgt++ != *src++) + return (u32)(tgt - 1); + } + + return 0; +} + +u32 VerifyFlashSector(u16 sectorNum, u8 *src) +{ + u16 i; + u16 verifyFlashSector_Core_Buffer[0x80]; + u16 *funcSrc; + u16 *funcDest; + u8 *tgt; + u16 size; + u32 (*verifyFlashSector_Core)(u8 *, u8 *, u32); + + REG_WAITCNT = (REG_WAITCNT & ~WAITCNT_SRAM_MASK) | WAITCNT_SRAM_8; + + if (gFlash->romSize == FLASH_ROM_SIZE_1M) + { + SwitchFlashBank(sectorNum / SECTORS_PER_BANK); + sectorNum %= SECTORS_PER_BANK; + } + + funcSrc = (u16 *)VerifyFlashSector_Core; + funcSrc = (u16 *)((s32)funcSrc & ~1); + funcDest = verifyFlashSector_Core_Buffer; + + i = ((s32)VerifyFlashSector - (s32)VerifyFlashSector_Core) >> 1; + + while (i != 0) + { + *funcDest++ = *funcSrc++; + i--; + } + + verifyFlashSector_Core = (u32 (*)(u8 *, u8 *, u32))((s32)verifyFlashSector_Core_Buffer + 1); + + tgt = FLASH_BASE + (sectorNum << gFlash->sector.shift); + size = gFlash->sector.size; + + return verifyFlashSector_Core(src, tgt, size); +} + +u32 VerifyFlashSectorNBytes(u16 sectorNum, u8 *src, u32 n) +{ + u16 i; + u16 verifyFlashSector_Core_Buffer[0x80]; + u16 *funcSrc; + u16 *funcDest; + u8 *tgt; + u32 (*verifyFlashSector_Core)(u8 *, u8 *, u32); + + if (gFlash->romSize == FLASH_ROM_SIZE_1M) + { + SwitchFlashBank(sectorNum / SECTORS_PER_BANK); + sectorNum %= SECTORS_PER_BANK; + } + + REG_WAITCNT = (REG_WAITCNT & ~WAITCNT_SRAM_MASK) | WAITCNT_SRAM_8; + + funcSrc = (u16 *)VerifyFlashSector_Core; + funcSrc = (u16 *)((s32)funcSrc & ~1); + funcDest = verifyFlashSector_Core_Buffer; + + i = ((s32)VerifyFlashSector - (s32)VerifyFlashSector_Core) >> 1; + + while (i != 0) + { + *funcDest++ = *funcSrc++; + i--; + } + + verifyFlashSector_Core = (u32 (*)(u8 *, u8 *, u32))((s32)verifyFlashSector_Core_Buffer + 1); + + tgt = FLASH_BASE + (sectorNum << gFlash->sector.shift); + + return verifyFlashSector_Core(src, tgt, n); +} + +u32 ProgramFlashSectorAndVerify(u16 sectorNum, u8 *src) +{ + u8 i; + u32 result; + + for (i = 0; i < 3; i++) + { + result = ProgramFlashSector(sectorNum, src); + if (result != 0) + continue; + + result = VerifyFlashSector(sectorNum, src); + if (result == 0) + break; + } + + return result; +} + +u32 ProgramFlashSectorAndVerifyNBytes(u16 sectorNum, u8 *src, u32 n) +{ + u8 i; + u32 result; + + for (i = 0; i < 3; i++) + { + result = ProgramFlashSector(sectorNum, src); + if (result != 0) + continue; + + result = VerifyFlashSectorNBytes(sectorNum, src, n); + if (result == 0) + break; + } + + return result; +} diff --git a/src/agb_flash_1m.c b/src/agb_flash_1m.c new file mode 100644 index 00000000..85ee0a27 --- /dev/null +++ b/src/agb_flash_1m.c @@ -0,0 +1,85 @@ +#include "gba/gba.h" +#include "gba/flash_internal.h" + +static const char AgbLibFlashVersion[] = "FLASH1M_V102"; + +const struct FlashSetupInfo * const sSetupInfos[] = +{ + &MX29L010, + &LE26FV10N1TS, + &DefaultFlash +}; + +u16 IdentifyFlash(void) +{ + u16 result; + u16 flashId; + const struct FlashSetupInfo * const *setupInfo; + + REG_WAITCNT = (REG_WAITCNT & ~WAITCNT_SRAM_MASK) | WAITCNT_SRAM_8; + + flashId = ReadFlashId(); + + setupInfo = sSetupInfos; + result = 1; + + for (;;) + { + if ((*setupInfo)->type.ids.separate.makerId == 0) + break; + + if (flashId == (*setupInfo)->type.ids.joined) + { + result = 0; + break; + } + + setupInfo++; + } + + ProgramFlashSector = (*setupInfo)->programFlashSector; + EraseFlashChip = (*setupInfo)->eraseFlashChip; + EraseFlashSector = (*setupInfo)->eraseFlashSector; + WaitForFlashWrite = (*setupInfo)->waitForFlashWrite; + gFlashMaxTime = (*setupInfo)->maxTime; + gFlash = &(*setupInfo)->type; + + return result; +} + +u16 WaitForFlashWrite_Common(u8 phase, u8 *addr, u8 lastData) +{ + u16 result = 0; + u8 status; + + StartFlashTimer(phase); + + while ((status = PollFlashStatus(addr)) != lastData) + { + if (status & 0x20) + { + // The write operation exceeded the flash chip's time limit. + + if (PollFlashStatus(addr) == lastData) + break; + + FLASH_WRITE(0x5555, 0xF0); + result = phase | 0xA000u; + break; + } + + if (gFlashTimeoutFlag) + { + if (PollFlashStatus(addr) == lastData) + break; + + FLASH_WRITE(0x5555, 0xF0); + result = phase | 0xC000u; + break; + } + } + + StopFlashTimer(); + + return result; +} diff --git a/src/agb_flash_le.c b/src/agb_flash_le.c new file mode 100644 index 00000000..f05b3431 --- /dev/null +++ b/src/agb_flash_le.c @@ -0,0 +1,30 @@ +#include "gba/gba.h" +#include "gba/flash_internal.h" + +const u16 leMaxTime[] = +{ + 10, 65469, TIMER_ENABLE | TIMER_INTR_ENABLE | TIMER_256CLK, + 10, 65469, TIMER_ENABLE | TIMER_INTR_ENABLE | TIMER_256CLK, + 2000, 65469, TIMER_ENABLE | TIMER_INTR_ENABLE | TIMER_256CLK, + 2000, 65469, TIMER_ENABLE | TIMER_INTR_ENABLE | TIMER_256CLK, +}; + +const struct FlashSetupInfo LE26FV10N1TS = +{ + ProgramFlashSector_MX, + EraseFlashChip_MX, + EraseFlashSector_MX, + WaitForFlashWrite_Common, + leMaxTime, + { + 131072, // ROM size + { + 4096, // sector size + 12, // bit shift to multiply by sector size (4096 == 1 << 12) + 32, // number of sectors + 0 // appears to be unused + }, + { 3, 1 }, // wait state setup data + { { 0x62, 0x13 } } // ID + } +}; diff --git a/src/agb_flash_mx.c b/src/agb_flash_mx.c new file mode 100644 index 00000000..50df6095 --- /dev/null +++ b/src/agb_flash_mx.c @@ -0,0 +1,166 @@ +#include "gba/gba.h" +#include "gba/flash_internal.h" + +const u16 mxMaxTime[] = +{ + 10, 65469, TIMER_ENABLE | TIMER_INTR_ENABLE | TIMER_256CLK, + 10, 65469, TIMER_ENABLE | TIMER_INTR_ENABLE | TIMER_256CLK, + 2000, 65469, TIMER_ENABLE | TIMER_INTR_ENABLE | TIMER_256CLK, + 2000, 65469, TIMER_ENABLE | TIMER_INTR_ENABLE | TIMER_256CLK, +}; + +const struct FlashSetupInfo MX29L010 = +{ + ProgramFlashSector_MX, + EraseFlashChip_MX, + EraseFlashSector_MX, + WaitForFlashWrite_Common, + mxMaxTime, + { + 131072, // ROM size + { + 4096, // sector size + 12, // bit shift to multiply by sector size (4096 == 1 << 12) + 32, // number of sectors + 0 // appears to be unused + }, + { 3, 1 }, // wait state setup data + { { 0xC2, 0x09 } } // ID + } +}; + +const struct FlashSetupInfo DefaultFlash = +{ + ProgramFlashSector_MX, + EraseFlashChip_MX, + EraseFlashSector_MX, + WaitForFlashWrite_Common, + mxMaxTime, + { + 131072, // ROM size + { + 4096, // sector size + 12, // bit shift to multiply by sector size (4096 == 1 << 12) + 32, // number of sectors + 0 // appears to be unused + }, + { 3, 1 }, // wait state setup data + { { 0x00, 0x00 } } // ID of 0 + } +}; + +u16 EraseFlashChip_MX(void) +{ + u16 result; + u16 readFlash1Buffer[0x20]; + + REG_WAITCNT = (REG_WAITCNT & ~WAITCNT_SRAM_MASK) | gFlash->wait[0]; + + FLASH_WRITE(0x5555, 0xAA); + FLASH_WRITE(0x2AAA, 0x55); + FLASH_WRITE(0x5555, 0x80); + FLASH_WRITE(0x5555, 0xAA); + FLASH_WRITE(0x2AAA, 0x55); + FLASH_WRITE(0x5555, 0x10); + + SetReadFlash1(readFlash1Buffer); + + result = WaitForFlashWrite(3, FLASH_BASE, 0xFF); + + REG_WAITCNT = (REG_WAITCNT & ~WAITCNT_SRAM_MASK) | WAITCNT_SRAM_8; + + return result; +} + +u16 EraseFlashSector_MX(u16 sectorNum) +{ + u16 numTries; + u16 result; + u8 *addr; + u16 readFlash1Buffer[0x20]; + + if (sectorNum >= gFlash->sector.count) + return 0x80FF; + + SwitchFlashBank(sectorNum / SECTORS_PER_BANK); + sectorNum %= SECTORS_PER_BANK; + + numTries = 0; + +try_erase: + REG_WAITCNT = (REG_WAITCNT & ~WAITCNT_SRAM_MASK) | gFlash->wait[0]; + + addr = FLASH_BASE + (sectorNum << gFlash->sector.shift); + + FLASH_WRITE(0x5555, 0xAA); + FLASH_WRITE(0x2AAA, 0x55); + FLASH_WRITE(0x5555, 0x80); + FLASH_WRITE(0x5555, 0xAA); + FLASH_WRITE(0x2AAA, 0x55); + *addr = 0x30; + + SetReadFlash1(readFlash1Buffer); + + result = WaitForFlashWrite(2, addr, 0xFF); + + if (!(result & 0xA000) || numTries != 0) + goto done; + + numTries = 1; + + goto try_erase; + +done: + REG_WAITCNT = (REG_WAITCNT & ~WAITCNT_SRAM_MASK) | WAITCNT_SRAM_8; + + return result; +} + +static u16 ProgramByte(u8 *src, u8 *dest) +{ + FLASH_WRITE(0x5555, 0xAA); + FLASH_WRITE(0x2AAA, 0x55); + FLASH_WRITE(0x5555, 0xA0); + *dest = *src; + + return WaitForFlashWrite(1, dest, *src); +} + +u16 ProgramFlashSector_MX(u16 sectorNum, u8 *src) +{ + u16 result; + u8 *dest; + u16 readFlash1Buffer[0x20]; + + if (sectorNum >= gFlash->sector.count) + return 0x80FF; + + result = EraseFlashSector_MX(sectorNum); + + if (result != 0) + return result; + + SwitchFlashBank(sectorNum / SECTORS_PER_BANK); + sectorNum %= SECTORS_PER_BANK; + + SetReadFlash1(readFlash1Buffer); + + REG_WAITCNT = (REG_WAITCNT & ~WAITCNT_SRAM_MASK) | gFlash->wait[0]; + + gFlashNumRemainingBytes = gFlash->sector.size; + dest = FLASH_BASE + (sectorNum << gFlash->sector.shift); + + while (gFlashNumRemainingBytes > 0) + { + result = ProgramByte(src, dest); + + if (result != 0) + break; + + gFlashNumRemainingBytes--; + src++; + dest++; + } + + return result; +} diff --git a/src/main.c b/src/main.c new file mode 100644 index 00000000..212822e7 --- /dev/null +++ b/src/main.c @@ -0,0 +1,108 @@ +#include "global.h" + +extern char ewram_start[]; + +extern u16 gUnknown_202D7FC; +extern u8 gUnknown_202D7FE; + +extern char alt_203B038[]; + +extern char gUnknown_203B038[]; +extern char gUnknown_203BC04[]; + +extern char iwram_start[]; + +extern char alt_3001B58[]; + +extern char unk_code_ram[]; +extern char unk_code_ram_end[]; + +extern u8 gUnknown_80B9BF1[]; + +extern char gUnknown_8270000[]; + +extern char unk_code[]; + +extern void sub_800CDA8(int); +extern void sub_800B540(void); +extern void sub_800CF0C(void); +extern void SeedRng(u8 *); +extern void sub_8004D78(void); +extern void nullsub_9(void); +extern void nullsub_6(void); +extern void sub_80047E8(void); +extern void InitBGPaletteBuffer(void); +extern void sub_80057E8(void); +extern void sub_800A8C4(void); +extern void sub_8006218(void); +extern void sub_80098A0(void); +extern void sub_80096E0(void); +extern void sub_800B6F4(int, void *); +extern void GameLoop(void); +extern void Hang(void); +extern void sub_800CE54(void); + +void AgbMain(void) +{ + u8 value[4]; + u8 seed[6]; + + REG_WAITCNT = WAITCNT_PREFETCH_ENABLE | WAITCNT_WS0_S_1 | WAITCNT_WS0_N_3; + + DmaStop(0); + DmaStop(1); + DmaStop(2); + DmaStop(3); + + if (gUnknown_203BC04 - gUnknown_203B038 > 0) + CpuCopy32(gUnknown_8270000, gUnknown_203B038, gUnknown_203BC04 - gUnknown_203B038); + + if (alt_203B038 - ewram_start > 0) + { + memset(value, 0, 4); + CpuSet(&value, ewram_start, CPU_SET_SRC_FIXED | CPU_SET_32BIT | (((alt_203B038 - ewram_start) / 4) & 0x1FFFFF)); + } + + if (unk_code_ram_end - unk_code_ram > 0) + CpuCopy32(unk_code, unk_code_ram, unk_code_ram_end - unk_code_ram); + + if (alt_3001B58 - iwram_start > 0) + { + memset(value, 0, 4); + CpuSet(&value, iwram_start, CPU_SET_SRC_FIXED | CPU_SET_32BIT | (((alt_3001B58 - iwram_start) / 4) & 0x1FFFFF)); + } + + REG_WIN0H = 0; + REG_WIN1H = 0; + REG_WIN0V = 0; + REG_WIN1V = 0; + REG_WININ = 16191; + REG_WINOUT = 61; + gUnknown_202D7FC = REG_BLDCNT = 15426; + REG_BLDALPHA = 1546; + gUnknown_202D7FE = 0; + REG_BG0CNT = 11264; + REG_BG1CNT = 11521; + REG_BG2CNT = 11786; + REG_BG3CNT = 12043; + REG_DISPCNT = 32704; + sub_800CDA8(1); + sub_800B540(); + sub_800CF0C(); + memcpy(seed, gUnknown_80B9BF1, 6); + SeedRng(seed); + sub_8004D78(); + nullsub_9(); + nullsub_6(); + sub_80047E8(); + InitBGPaletteBuffer(); + sub_80057E8(); + sub_800A8C4(); + sub_8006218(); + sub_80098A0(); + sub_80096E0(); + sub_800B6F4(1, sub_800CE54); + REG_DISPCNT = 32576; + GameLoop(); + Hang(); +} diff --git a/sym_ewram.txt b/sym_ewram.txt new file mode 100644 index 00000000..ebfde641 --- /dev/null +++ b/sym_ewram.txt @@ -0,0 +1,1054 @@ + .space 0x8F0 + +gUnknown_20008F0: @ 20008F0 + .space 0x80 + +gUnknown_2000970: @ 2000970 + .space 0xC0 + +gUnknown_2000A30: @ 2000A30 + .space 0x50 + +gUnknown_2000A80: @ 2000A80 + .space 0x8 + +gUnknown_2000A88: @ 2000A88 + .space 0x400 + +gUnknown_2000E88: @ 2000E88 + .space 0x20 + +gUnknown_2000EA8: @ 2000EA8 + .space 0x8 + +gUnknown_2000EB0: @ 2000EB0 + .space 0x20 + +gUnknown_2000ED0: @ 2000ED0 + .space 0x300 + +gUnknown_20011D0: @ 20011D0 + .space 0x24000 + +gUnknown_20251D0: @ 20251D0 + .space 0x20 + +gUnknown_20251F0: @ 20251F0 + .space 0x400 + +gUnknown_20255F0: @ 20255F0 + .space 0x10 + +gUnknown_2025600: @ 2025600 + .space 0x2C + +gUnknown_202562C: @ 202562C + .space 0xC + +gUnknown_2025638: @ 2025638 + .space 0x10 + +gUnknown_2025648: @ 2025648 + .space 0x10 + +gUnknown_2025658: @ 2025658 + .space 0x10 + +gUnknown_2025668: @ 2025668 + .space 0x8 + +gUnknown_2025670: @ 2025670 + .space 0x2 + +gUnknown_2025672: @ 2025672 + .space 0x10 + +gUnknown_2025682: @ 2025682 + .space 0x12 + +gUnknown_2025694: @ 2025694 + .space 0x4 + +gUnknown_2025698: @ 2025698 + .space 0x8 + +gUnknown_20256A0: @ 20256A0 + .space 0x808 + +gUnknown_2025EA8: @ 2025EA8 + .space 0x400 + +gUnknown_20262A8: @ 20262A8 + .space 0x400 + +gUnknown_20266A8: @ 20266A8 + .space 0x8 + +gUnknown_20266B0: @ 20266B0 + .space 0x780 + +gUnknown_2026E30: @ 2026E30 + .space 0x8 + +gUnknown_2026E38: @ 2026E38 + .space 0x4 + +gUnknown_2026E3C: @ 2026E3C + .space 0x4 + +gUnknown_2026E40: @ 2026E40 + .space 0x4 + +gUnknown_2026E44: @ 2026E44 + .space 0x4 + +gUnknown_2026E48: @ 2026E48 + .space 0x4 + +gUnknown_2026E4C: @ 2026E4C + .space 0x2 + +gUnknown_2026E4E: @ 2026E4E + .space 0x2 + +gUnknown_2026E50: @ 2026E50 + .space 0x4 + +gUnknown_2026E54: @ 2026E54 + .space 0x4 + +gUnknown_2026E58: @ 2026E58 + .space 0x8 + +gUnknown_2026E60: @ 2026E60 + .space 0x288 + +gUnknown_20270E8: @ 20270E8 + .space 0x288 + +gUnknown_2027370: @ 2027370 + .space 0x48 + +gUnknown_20273B8: @ 20273B8 + .space 0xD8 + +gUnknown_2027490: @ 2027490 + .space 0x8 + +gUnknown_2027498: @ 2027498 + .space 0x2 + +gUnknown_202749A: @ 202749A + .space 0xB + +gUnknown_20274A5: @ 20274A5 + .space 0x1 + +gUnknown_20274A6: @ 20274A6 + .space 0x6 + +gUnknown_20274AC: @ 20274AC + .space 0x4 + +gUnknown_20274B0: @ 20274B0 + .space 0x4 + +gUnknown_20274B4: @ 20274B4 + .space 0x3B00 + +gUnknown_202AFB4: @ 202AFB4 + .space 0xC + +gUnknown_202AFC0: @ 202AFC0 + .space 0x60 + +gUnknown_202B020: @ 202B020 + .space 0x4 + +gUnknown_202B024: @ 202B024 + .space 0x4 + +gUnknown_202B028: @ 202B028 + .space 0x8 + +gUnknown_202B030: @ 202B030 + .space 0x4 + +gUnknown_202B034: @ 202B034 + .space 0x4 + +gUnknown_202B038: @ 202B038 + .space 0x2 + +gUnknown_202B03A: @ 202B03A + .space 0x7FE + +gUnknown_202B838: @ 202B838 + .space 0x800 + +gUnknown_202C038: @ 202C038 + .space 0x800 + +gUnknown_202C838: @ 202C838 + .space 0x720 + +gUnknown_202CF58: @ 202CF58 + .space 0xE0 + +gUnknown_202D038: @ 202D038 + .space 0x4 + +gUnknown_202D03C: @ 202D03C + .space 0x1C + +gUnknown_202D058: @ 202D058 + .space 0x10 + +gUnknown_202D068: @ 202D068 + .space 0x4 + +gUnknown_202D06C: @ 202D06C + .space 0xC + +gUnknown_202D078: @ 202D078 + .space 0x20 + +gUnknown_202D098: @ 202D098 + .space 0x120 + +gUnknown_202D1B8: @ 202D1B8 + .space 0x40 + +gUnknown_202D1F8: @ 202D1F8 + .space 0x40 + +gUnknown_202D238: @ 202D238 + .space 0x4 + +gUnknown_202D23C: @ 202D23C + .space 0x4 + +gUnknown_202D240: @ 202D240 + .space 0x60 + +gUnknown_202D2A0: @ 202D2A0 + .space 0x4 + +gUnknown_202D2A4: @ 202D2A4 + .space 0x4 + +gUnknown_202D2A8: @ 202D2A8 + .space 0x110 + +gUnknown_202D3B8: @ 202D3B8 + .space 0xF0 + +gUnknown_202D4A8: @ 202D4A8 + .space 0x4 + +gUnknown_202D4AC: @ 202D4AC + .space 0x4 + +gUnknown_202D4B0: @ 202D4B0 + .space 0x4 + +gUnknown_202D4B4: @ 202D4B4 + .space 0x4 + +gUnknown_202D4B8: @ 202D4B8 + .space 0x120 + +gIntrTable: @ 202D5D8 + .space 0x18 + +gUnknown_202D5F0: @ 202D5F0 + .space 0x18 + +gUnknown_202D608: @ 202D608 + .space 0x40 + +gUnknown_202D648: @ 202D648 + .space 0x40 + +gUnknown_202D688: @ 202D688 + .space 0x2 + +gUnknown_202D68A: @ 202D68A + .space 0x2 + +gUnknown_202D68C: @ 202D68C + .space 0x2 + +gUnknown_202D68E: @ 202D68E + .space 0x2 + +gUnknown_202D690: @ 202D690 + .space 0x2 + +gUnknown_202D692: @ 202D692 + .space 0x2 + +gUnknown_202D694: @ 202D694 + .space 0x4 + +gUnknown_202D698: @ 202D698 + .space 0x8 + +gUnknown_202D6A0: @ 202D6A0 + .space 0x8 + +gUnknown_202D6A8: @ 202D6A8 + .space 0x8 + +gUnknown_202D6B0: @ 202D6B0 + .space 0x8 + +gUnknown_202D6B8: @ 202D6B8 + .space 0x1 + +gUnknown_202D6B9: @ 202D6B9 + .space 0x141 + +gUnknown_202D7FA: @ 202D7FA + .space 0x2 + +gUnknown_202D7FC: @ 202D7FC + .space 0x2 + +gUnknown_202D7FE: @ 202D7FE + .space 0x2 + +gUnknown_202D800: @ 202D800 + .space 0x8 + +gUnknown_202D808: @ 202D808 + .space 0x108 + +gUnknown_202D910: @ 202D910 + .space 0x4 + +gUnknown_202D914: @ 202D914 + .space 0x20C + +gUnknown_202DB20: @ 202DB20 + .space 0x10 + +gUnknown_202DB30: @ 202DB30 + .space 0x20 + +gUnknown_202DB50: @ 202DB50 + .space 0x8 + +gUnknown_202DB58: @ 202DB58 + .space 0x8 + +gUnknown_202DB60: @ 202DB60 + .space 0x8 + +gUnknown_202DB68: @ 202DB68 + .space 0x4 + +gUnknown_202DB6C: @ 202DB6C + .space 0x4 + +gUnknown_202DB70: @ 202DB70 + .space 0x4 + +gUnknown_202DB74: @ 202DB74 + .space 0x4 + +gUnknown_202DB78: @ 202DB78 + .space 0x40 + +gUnknown_202DBB8: @ 202DBB8 + .space 0x140 + +gUnknown_202DCF8: @ 202DCF8 + .space 0x120 + +gUnknown_202DE18: @ 202DE18 + .space 0x1 + +gUnknown_202DE19: @ 202DE19 + .space 0x3 + +gUnknown_202DE1C: @ 202DE1C + .space 0x4 + +gUnknown_202DE20: @ 202DE20 + .space 0x2 + +gUnknown_202DE22: @ 202DE22 + .space 0x2 + +gUnknown_202DE24: @ 202DE24 + .space 0x4 + +gUnknown_202DE28: @ 202DE28 + .space 0x8 + +gUnknown_202DE30: @ 202DE30 + .space 0x28 + +gUnknown_202DE58: @ 202DE58 + .space 0x50 + +gUnknown_202DEA8: @ 202DEA8 + .space 0xF0 + +gUnknown_202DF98: @ 202DF98 + .space 0x50 + +gUnknown_202DFE8: @ 202DFE8 + .space 0x50 + +gUnknown_202E038: @ 202E038 + .space 0x50 + +gUnknown_202E088: @ 202E088 + .space 0xA0 + +gUnknown_202E128: @ 202E128 + .space 0xA0 + +gUnknown_202E1C8: @ 202E1C8 + .space 0x50 + +gUnknown_202E218: @ 202E218 + .space 0xA0 + +gUnknown_202E2B8: @ 202E2B8 + .space 0x320 + +gUnknown_202E5D8: @ 202E5D8 + .space 0x50 + +gUnknown_202E628: @ 202E628 + .space 0xB8 + +gUnknown_202E6E0: @ 202E6E0 + .space 0x8 + +gUnknown_202E6E8: @ 202E6E8 + .space 0x50 + +gUnknown_202E738: @ 202E738 + .space 0x4 + +gUnknown_202E73C: @ 202E73C + .space 0x4 + +gUnknown_202E740: @ 202E740 + .space 0x4 + +gUnknown_202E744: @ 202E744 + .space 0x4 + +gUnknown_202E748: @ 202E748 + .space 0x34 + +gUnknown_202E77C: @ 202E77C + .space 0x4 + +gUnknown_202E780: @ 202E780 + .space 0x4 + +gUnknown_202E784: @ 202E784 + .space 0x4 + +gUnknown_202E788: @ 202E788 + .space 0x4 + +gUnknown_202E78C: @ 202E78C + .space 0x4 + +gUnknown_202E790: @ 202E790 + .space 0x1 + +gUnknown_202E791: @ 202E791 + .space 0x3 + +gUnknown_202E794: @ 202E794 + .space 0x4 + +gUnknown_202E798: @ 202E798 + .space 0x3E8 + +gUnknown_202EB80: @ 202EB80 + .space 0x40 + +gUnknown_202EBC0: @ 202EBC0 + .space 0x50 + +gUnknown_202EC10: @ 202EC10 + .space 0x4 + +gUnknown_202EC14: @ 202EC14 + .space 0x4 + +gUnknown_202EC18: @ 202EC18 + .space 0x4 + +gUnknown_202EC1C: @ 202EC1C + .space 0x4 + +gUnknown_202EC20: @ 202EC20 + .space 0x8 + +gUnknown_202EC28: @ 202EC28 + .space 0x10 + +gUnknown_202EC38: @ 202EC38 + .space 0x8 + +gUnknown_202EC40: @ 202EC40 + .space 0x8 + +gUnknown_202EC48: @ 202EC48 + .space 0x4 + +gUnknown_202EC4C: @ 202EC4C + .space 0x4 + +gUnknown_202EC50: @ 202EC50 + .space 0x38 + +gUnknown_202EC88: @ 202EC88 + .space 0x4 + +gUnknown_202EC8C: @ 202EC8C + .space 0x4 + +gUnknown_202EC90: @ 202EC90 + .space 0x4 + +gUnknown_202EC94: @ 202EC94 + .space 0x4 + +gUnknown_202EC98: @ 202EC98 + .space 0x4 + +gUnknown_202EC9C: @ 202EC9C + .space 0x4 + +gUnknown_202ECA0: @ 202ECA0 + .space 0x4 + +gUnknown_202ECA4: @ 202ECA4 + .space 0x84 + +gUnknown_202ED28: @ 202ED28 + .space 0x8 + +gUnknown_202ED30: @ 202ED30 + .space 0x88 + +gUnknown_202EDB8: @ 202EDB8 + .space 0x8 + +gUnknown_202EDC0: @ 202EDC0 + .space 0x8 + +gUnknown_202EDC8: @ 202EDC8 + .space 0x4 + +gUnknown_202EDCC: @ 202EDCC + .space 0x4 + +gUnknown_202EDD0: @ 202EDD0 + .space 0x4 + +gUnknown_202EDD4: @ 202EDD4 + .space 0x4 + +gUnknown_202EDD8: @ 202EDD8 + .space 0x4 + +gUnknown_202EDDC: @ 202EDDC + .space 0xC + +gUnknown_202EDE8: @ 202EDE8 + .space 0x14 + +gUnknown_202EDFC: @ 202EDFC + .space 0x4 + +gUnknown_202EE00: @ 202EE00 + .space 0x1 + +gUnknown_202EE01: @ 202EE01 + .space 0x1 + +gUnknown_202EE02: @ 202EE02 + .space 0x2 + +gUnknown_202EE04: @ 202EE04 + .space 0x4 + +gUnknown_202EE08: @ 202EE08 + .space 0x4 + +gUnknown_202EE0C: @ 202EE0C + .space 0x4 + +gUnknown_202EE10: @ 202EE10 + .space 0x28 + +gUnknown_202EE38: @ 202EE38 + .space 0x1 + +gUnknown_202EE39: @ 202EE39 + .space 0x1 + +gUnknown_202EE3A: @ 202EE3A + .space 0xA + +gUnknown_202EE44: @ 202EE44 + .space 0x28 + +gUnknown_202EE6C: @ 202EE6C + .space 0x4 + +gUnknown_202EE70: @ 202EE70 + .space 0x6 + +gUnknown_202EE76: @ 202EE76 + .space 0x12 + +gUnknown_202EE88: @ 202EE88 + .space 0x4 + +gUnknown_202EE8C: @ 202EE8C + .space 0x300 + +gUnknown_202F18C: @ 202F18C + .space 0x4 + +gUnknown_202F190: @ 202F190 + .space 0x18 + +gUnknown_202F1A8: @ 202F1A8 + .space 0x1 + +gUnknown_202F1A9: @ 202F1A9 + .space 0x1 + +gUnknown_202F1AA: @ 202F1AA + .space 0x1 + +gUnknown_202F1AB: @ 202F1AB + .space 0x1 + +gUnknown_202F1AC: @ 202F1AC + .space 0x1 + +gUnknown_202F1AD: @ 202F1AD + .space 0x1 + +gUnknown_202F1AE: @ 202F1AE + .space 0x2 + +gUnknown_202F1B0: @ 202F1B0 + .space 0x2 + +gUnknown_202F1B2: @ 202F1B2 + .space 0x2 + +gUnknown_202F1B4: @ 202F1B4 + .space 0x4 + +gUnknown_202F1B8: @ 202F1B8 + .space 0x10 + +gUnknown_202F1C8: @ 202F1C8 + .space 0x4 + +gUnknown_202F1CC: @ 202F1CC + .space 0x4 + +gUnknown_202F1D0: @ 202F1D0 + .space 0x4 + +gUnknown_202F1D4: @ 202F1D4 + .space 0x4 + +gUnknown_202F1D8: @ 202F1D8 + .space 0x4 + +gUnknown_202F1DC: @ 202F1DC + .space 0x4 + +gUnknown_202F1E0: @ 202F1E0 + .space 0x1 + +gUnknown_202F1E1: @ 202F1E1 + .space 0x7 + +gUnknown_202F1E8: @ 202F1E8 + .space 0x8 + +gUnknown_202F1F0: @ 202F1F0 + .space 0x8 + +gUnknown_202F1F8: @ 202F1F8 + .space 0x4 + +gUnknown_202F1FC: @ 202F1FC + .space 0x4 + +gUnknown_202F200: @ 202F200 + .space 0x8 + +gUnknown_202F208: @ 202F208 + .space 0x4 + +gUnknown_202F20C: @ 202F20C + .space 0x4 + +gUnknown_202F210: @ 202F210 + .space 0x4 + +gUnknown_202F214: @ 202F214 + .space 0x4 + +gUnknown_202F218: @ 202F218 + .space 0x1 + +gUnknown_202F219: @ 202F219 + .space 0x1 + +gUnknown_202F21A: @ 202F21A + .space 0x2 + +gUnknown_202F21C: @ 202F21C + .space 0x4 + +gUnknown_202F220: @ 202F220 + .space 0x1 + +gUnknown_202F221: @ 202F221 + .space 0x1 + +gUnknown_202F222: @ 202F222 + .space 0x2 + +gUnknown_202F224: @ 202F224 + .space 0x4 + +gUnknown_202F228: @ 202F228 + .space 0x4 + +gUnknown_202F22C: @ 202F22C + .space 0x1 + +gUnknown_202F22D: @ 202F22D + .space 0x1 + +gUnknown_202F22E: @ 202F22E + .space 0x2 + +gUnknown_202F230: @ 202F230 + .space 0x1 + +gUnknown_202F231: @ 202F231 + .space 0x7 + +gUnknown_202F238: @ 202F238 + .space 0x8 + +gUnknown_202F240: @ 202F240 + .space 0x8 + +gUnknown_202F248: @ 202F248 + .space 0x10 + +gUnknown_202F258: @ 202F258 + .space 0x8 + +gUnknown_202F260: @ 202F260 + .space 0x8 + +gUnknown_202F268: @ 202F268 + .space 0x8 + +gUnknown_202F270: @ 202F270 + .space 0x8 + +gUnknown_202F278: @ 202F278 + .space 0x60 + +gUnknown_202F2D8: @ 202F2D8 + .space 0x8 + +gUnknown_202F2E0: @ 202F2E0 + .space 0x8 + +gUnknown_202F2E8: @ 202F2E8 + .space 0x10 + +gUnknown_202F2F8: @ 202F2F8 + .space 0x4 + +gUnknown_202F2FC: @ 202F2FC + .space 0x4 + +gUnknown_202F300: @ 202F300 + .space 0x8 + +gUnknown_202F308: @ 202F308 + .space 0x4 + +gUnknown_202F30C: @ 202F30C + .space 0x4 + +gUnknown_202F310: @ 202F310 + .space 0x4 + +gUnknown_202F314: @ 202F314 + .space 0x8 + +gUnknown_202F31C: @ 202F31C + .space 0x8 + +gUnknown_202F324: @ 202F324 + .space 0x8 + +gUnknown_202F32C: @ 202F32C + .space 0x1 + +gUnknown_202F32D: @ 202F32D + .space 0x3 + +gUnknown_202F330: @ 202F330 + .space 0x20 + +gUnknown_202F350: @ 202F350 + .space 0x8 + +gUnknown_202F358: @ 202F358 + .space 0x20 + +gUnknown_202F378: @ 202F378 + .space 0x8 + +gUnknown_202F380: @ 202F380 + .space 0x8 + +gUnknown_202F388: @ 202F388 + .space 0x8 + +gUnknown_202F390: @ 202F390 + .space 0x20 + +gUnknown_202F3B0: @ 202F3B0 + .space 0x20 + +gUnknown_202F3D0: @ 202F3D0 + .space 0x8 + +gUnknown_202F3D8: @ 202F3D8 + .space 0x8 + +gUnknown_202F3E0: @ 202F3E0 + .space 0x4 + +gUnknown_202F3E4: @ 202F3E4 + .space 0x4 + +gUnknown_202F3E8: @ 202F3E8 + .space 0x18 + +gUnknown_202F400: @ 202F400 + .space 0x90E8 + +gUnknown_20384E8: @ 20384E8 + .space 0x8 + +gUnknown_20384F0: @ 20384F0 + .space 0x4B0 + +gUnknown_20389A0: @ 20389A0 + .space 0x4 + +gUnknown_20389A4: @ 20389A4 + .space 0x4 + +gUnknown_20389A8: @ 20389A8 + .space 0x268 + +gUnknown_2038C10: @ 2038C10 + .space 0x18 + +gUnknown_2038C28: @ 2038C28 + .space 0x3C + +gUnknown_2038C64: @ 2038C64 + .space 0x4 + +gUnknown_2038C68: @ 2038C68 + .space 0x4 + +gUnknown_2038C6C: @ 2038C6C + .space 0x4 + +gUnknown_2038C70: @ 2038C70 + .space 0x10 + +gUnknown_2038C80: @ 2038C80 + .space 0x8 + +gUnknown_2038C88: @ 2038C88 + .space 0x600 + +gUnknown_2039288: @ 2039288 + .space 0x60 + +gUnknown_20392E8: @ 20392E8 + .space 0xD8 + +gUnknown_20393C0: @ 20393C0 + .space 0x88 + +gUnknown_2039448: @ 2039448 + .space 0x330 + +gUnknown_2039778: @ 2039778 + .space 0xC8 + +gUnknown_2039840: @ 2039840 + .space 0x68 + +gUnknown_20398A8: @ 20398A8 + .space 0x4 + +gUnknown_20398AC: @ 20398AC + .space 0x4 + +gUnknown_20398B0: @ 20398B0 + .space 0x4 + +gUnknown_20398B4: @ 20398B4 + .space 0x4 + +gUnknown_20398B8: @ 20398B8 + .space 0x1 + +gUnknown_20398B9: @ 20398B9 + .space 0x1 + +gUnknown_20398BA: @ 20398BA + .space 0x2 + +gUnknown_20398BC: @ 20398BC + .space 0x2 + +gUnknown_20398BE: @ 20398BE + .space 0x2 + +gUnknown_20398C0: @ 20398C0 + .space 0x4 + +gUnknown_20398C4: @ 20398C4 + .space 0x4 + +gUnknown_20398C8: @ 20398C8 + .space 0x10 + +gUnknown_20398D8: @ 20398D8 + .space 0x78 + +gUnknown_2039950: @ 2039950 + .space 0x8 + +gUnknown_2039958: @ 2039958 + .space 0x10 + +gUnknown_2039968: @ 2039968 + .space 0x10 + +gUnknown_2039978: @ 2039978 + .space 0x8 + +gUnknown_2039980: @ 2039980 + .space 0x10 + +gUnknown_2039990: @ 2039990 + .space 0x2 + +gUnknown_2039992: @ 2039992 + .space 0x6 + +gUnknown_2039998: @ 2039998 + .space 0x44 + +gUnknown_20399DC: @ 20399DC + .space 0x2 + +gUnknown_20399DE: @ 20399DE + .space 0x2 + +gUnknown_20399E0: @ 20399E0 + .space 0x8 + +gUnknown_20399E8: @ 20399E8 + .space 0x14 + +gUnknown_20399FC: @ 20399FC + .space 0x34 + +gUnknown_2039A30: @ 2039A30 + .space 0x2 + +gUnknown_2039A32: @ 2039A32 + .space 0x2 + +gUnknown_2039A34: @ 2039A34 + .space 0x2 + +gUnknown_2039A36: @ 2039A36 + .space 0x2 + +gUnknown_2039A38: @ 2039A38 + .space 0x88 + +gUnknown_2039AC0: @ 2039AC0 + .space 0x88 + +gUnknown_2039B48: @ 2039B48 + .space 0x208 + +gUnknown_2039D50: @ 2039D50 + .space 0x48 + +gUnknown_2039D98: @ 2039D98 + .space 0xC + +gUnknown_2039DA4: @ 2039DA4 + .space 0x4 + +gUnknown_2039DA8: @ 2039DA8 + .space 0x8 + +gUnknown_2039DB0: @ 2039DB0 + .space 0x10 + +gUnknown_2039DC0: @ 2039DC0 + .space 0xC + +gUnknown_2039DCC: @ 2039DCC + .space 0x2 + +gUnknown_2039DCE: @ 2039DCE + .space 0x2 + +gUnknown_2039DD0: @ 2039DD0 + .space 0x4 + +gUnknown_2039DD4: @ 2039DD4 + .space 0x4 + +gUnknown_2039DD8: @ 2039DD8 + .space 0x8 + +gUnknown_2039DE0: @ 2039DE0 + .space 0x4 diff --git a/sym_ewram2.txt b/sym_ewram2.txt new file mode 100644 index 00000000..41be4ef5 --- /dev/null +++ b/sym_ewram2.txt @@ -0,0 +1,700 @@ + .align 2 +gUnknown_2039E18: @ 2039E18 + .space 0x4 + +gUnknown_2039E1C: @ 2039E1C + .space 0x4 + +gUnknown_2039E20: @ 2039E20 + .space 0x4 + +gUnknown_2039E24: @ 2039E24 + .space 0x4 + +gUnknown_2039E28: @ 2039E28 + .space 0xA8 + +gUnknown_2039ED0: @ 2039ED0 + .space 0xFB0 + +gUnknown_203AE80: @ 203AE80 + .space 0x4 + +gUnknown_203AE84: @ 203AE84 + .space 0x84 + +gUnknown_203AF08: @ 203AF08 + .space 0x4 + +gUnknown_203AF0C: @ 203AF0C + .space 0x4 + +gUnknown_203AF10: @ 203AF10 + .space 0x100 + +gFlashTimeoutFlag: @ 203B010 + .space 0x4 + +PollFlashStatus: @ 203B014 + .space 0x4 + +WaitForFlashWrite: @ 203B018 + .space 0x4 + +ProgramFlashSector: @ 203B01C + .space 0x4 + +gFlash: @ 203B020 + .space 0x4 + +gFlashNumRemainingBytes: @ 203B024 + .space 0x4 + +EraseFlashChip: @ 203B028 + .space 0x4 + +EraseFlashSector: @ 203B02C + .space 0x4 + +gFlashMaxTime: @ 203B030 + .space 0x4 + +gUnknown_203B034: @ 203B034 + .space 0x4 + +alt_203B038: + +gUnknown_203B038: @ 203B038 + .space 0x4 + +gUnknown_203B03C: @ 203B03C + .space 0x4 + +gUnknown_203B040: @ 203B040 + .space 0x30 + +gUnknown_203B070: @ 203B070 + .space 0x4 + +gUnknown_203B074: @ 203B074 + .space 0x4 + +gUnknown_203B078: @ 203B078 + .space 0x4 + +gUnknown_203B07C: @ 203B07C + .space 0x4 + +gUnknown_203B080: @ 203B080 + .space 0x4 + +gUnknown_203B084: @ 203B084 + .space 0x4 + +gUnknown_203B088: @ 203B088 + .space 0x4 + +gUnknown_203B08C: @ 203B08C + .space 0x4 + +gUnknown_203B090: @ 203B090 + .space 0x4 + +gUnknown_203B094: @ 203B094 + .space 0x4 + +gUnknown_203B098: @ 203B098 + .space 0x1 + +gUnknown_203B099: @ 203B099 + .space 0x1 + +gUnknown_203B09A: @ 203B09A + .space 0x1 + +gUnknown_203B09B: @ 203B09B + .space 0x1 + +gUnknown_203B09C: @ 203B09C + .space 0x4 + +gUnknown_203B0A0: @ 203B0A0 + .space 0x4 + +gUnknown_203B0A4: @ 203B0A4 + .space 0x4 + +gUnknown_203B0A8: @ 203B0A8 + .space 0x2 + +gUnknown_203B0AA: @ 203B0AA + .space 0x2 + +gUnknown_203B0AC: @ 203B0AC + .space 0x2 + +gUnknown_203B0AE: @ 203B0AE + .space 0x2 + +gUnknown_203B0B0: @ 203B0B0 + .space 0x2 + +gUnknown_203B0B2: @ 203B0B2 + .space 0x2 + +gUnknown_203B0B4: @ 203B0B4 + .space 0x4 + +gUnknown_203B0B8: @ 203B0B8 + .space 0x4 + +gUnknown_203B0BC: @ 203B0BC + .space 0x2 + +gUnknown_203B0BE: @ 203B0BE + .space 0xE + +gUnknown_203B0CC: @ 203B0CC + .space 0x4 + +gUnknown_203B0D0: @ 203B0D0 + .space 0x4 + +gUnknown_203B0D4: @ 203B0D4 + .space 0x4 + +gUnknown_203B0D8: @ 203B0D8 + .space 0x4 + +gUnknown_203B0DC: @ 203B0DC + .space 0x8 + +gUnknown_203B0E4: @ 203B0E4 + .space 0x4 + +gUnknown_203B0E8: @ 203B0E8 + .space 0x4 + +gUnknown_203B0EC: @ 203B0EC + .space 0x60 + +gUnknown_203B14C: @ 203B14C + .space 0x4 + +gUnknown_203B150: @ 203B150 + .space 0x2C + +gUnknown_203B17C: @ 203B17C + .space 0x4 + +gUnknown_203B180: @ 203B180 + .space 0x4 + +gUnknown_203B184: @ 203B184 + .space 0x4 + +gUnknown_203B188: @ 203B188 + .space 0x4 + +gUnknown_203B18C: @ 203B18C + .space 0x4 + +gUnknown_203B190: @ 203B190 + .space 0x4 + +gUnknown_203B194: @ 203B194 + .space 0x4 + +gUnknown_203B198: @ 203B198 + .space 0x60 + +gUnknown_203B1F8: @ 203B1F8 + .space 0x4 + +gUnknown_203B1FC: @ 203B1FC + .space 0x4 + +gUnknown_203B200: @ 203B200 + .space 0x4 + +gUnknown_203B204: @ 203B204 + .space 0x4 + +gUnknown_203B208: @ 203B208 + .space 0x4 + +gUnknown_203B20C: @ 203B20C + .space 0x4 + +gUnknown_203B210: @ 203B210 + .space 0x4 + +gUnknown_203B214: @ 203B214 + .space 0x4 + +gUnknown_203B218: @ 203B218 + .space 0x4 + +gUnknown_203B21C: @ 203B21C + .space 0x4 + +gUnknown_203B220: @ 203B220 + .space 0x4 + +gUnknown_203B224: @ 203B224 + .space 0x4 + +gUnknown_203B228: @ 203B228 + .space 0x2 + +gUnknown_203B22A: @ 203B22A + .space 0x2 + +gUnknown_203B22C: @ 203B22C + .space 0x4 + +gUnknown_203B230: @ 203B230 + .space 0x4 + +gUnknown_203B234: @ 203B234 + .space 0x4 + +gUnknown_203B238: @ 203B238 + .space 0x4 + +gUnknown_203B23C: @ 203B23C + .space 0x4 + +gUnknown_203B240: @ 203B240 + .space 0x4 + +gUnknown_203B244: @ 203B244 + .space 0x4 + +gUnknown_203B248: @ 203B248 + .space 0x4 + +gUnknown_203B24C: @ 203B24C + .space 0x2 + +gUnknown_203B24E: @ 203B24E + .space 0x2 + +gUnknown_203B250: @ 203B250 + .space 0x4 + +gUnknown_203B254: @ 203B254 + .space 0x4 + +gUnknown_203B258: @ 203B258 + .space 0x4 + +gUnknown_203B25C: @ 203B25C + .space 0x4 + +gUnknown_203B260: @ 203B260 + .space 0x4 + +gUnknown_203B264: @ 203B264 + .space 0x4 + +gUnknown_203B268: @ 203B268 + .space 0x4 + +gUnknown_203B26C: @ 203B26C + .space 0x4 + +gUnknown_203B270: @ 203B270 + .space 0x4 + +gUnknown_203B274: @ 203B274 + .space 0x4 + +gUnknown_203B278: @ 203B278 + .space 0x4 + +gUnknown_203B27C: @ 203B27C + .space 0x4 + +gUnknown_203B280: @ 203B280 + .space 0x4 + +gUnknown_203B284: @ 203B284 + .space 0x4 + +gUnknown_203B288: @ 203B288 + .space 0x2 + +gUnknown_203B28A: @ 203B28A + .space 0x2 + +gUnknown_203B28C: @ 203B28C + .space 0x4 + +gUnknown_203B290: @ 203B290 + .space 0x4 + +gUnknown_203B294: @ 203B294 + .space 0x4 + +gUnknown_203B298: @ 203B298 + .space 0x4 + +gUnknown_203B29C: @ 203B29C + .space 0x2 + +gUnknown_203B29E: @ 203B29E + .space 0x2 + +gUnknown_203B2A0: @ 203B2A0 + .space 0x4 + +gUnknown_203B2A4: @ 203B2A4 + .space 0x4 + +gUnknown_203B2A8: @ 203B2A8 + .space 0x2 + +gUnknown_203B2AA: @ 203B2AA + .space 0x2 + +gUnknown_203B2AC: @ 203B2AC + .space 0x4 + +gUnknown_203B2B0: @ 203B2B0 + .space 0x4 + +gUnknown_203B2B4: @ 203B2B4 + .space 0x4 + +gUnknown_203B2B8: @ 203B2B8 + .space 0x4 + +gUnknown_203B2BC: @ 203B2BC + .space 0x4 + +gUnknown_203B2C0: @ 203B2C0 + .space 0x4 + +gUnknown_203B2C4: @ 203B2C4 + .space 0x4 + +gUnknown_203B2C8: @ 203B2C8 + .space 0x4 + +gUnknown_203B2CC: @ 203B2CC + .space 0x4 + +gUnknown_203B2D0: @ 203B2D0 + .space 0x2 + +gUnknown_203B2D2: @ 203B2D2 + .space 0x2 + +gUnknown_203B2D4: @ 203B2D4 + .space 0x4 + +gUnknown_203B2D8: @ 203B2D8 + .space 0x4 + +gUnknown_203B2DC: @ 203B2DC + .space 0x4 + +gUnknown_203B2E0: @ 203B2E0 + .space 0x4 + +gUnknown_203B2E4: @ 203B2E4 + .space 0x4 + +gUnknown_203B2E8: @ 203B2E8 + .space 0x4 + +gUnknown_203B2EC: @ 203B2EC + .space 0x4 + +gUnknown_203B2F0: @ 203B2F0 + .space 0x4 + +gUnknown_203B2F4: @ 203B2F4 + .space 0x4 + +gUnknown_203B2F8: @ 203B2F8 + .space 0x4 + +gUnknown_203B2FC: @ 203B2FC + .space 0x4 + +gUnknown_203B300: @ 203B300 + .space 0x4 + +gUnknown_203B304: @ 203B304 + .space 0x4 + +gUnknown_203B308: @ 203B308 + .space 0x4 + +gUnknown_203B30C: @ 203B30C + .space 0x4 + +gUnknown_203B310: @ 203B310 + .space 0x4 + +gUnknown_203B314: @ 203B314 + .space 0x4 + +gUnknown_203B318: @ 203B318 + .space 0x4 + +gUnknown_203B31C: @ 203B31C + .space 0x4 + +gUnknown_203B320: @ 203B320 + .space 0x4 + +gUnknown_203B324: @ 203B324 + .space 0x4 + +gUnknown_203B328: @ 203B328 + .space 0x4 + +gUnknown_203B32C: @ 203B32C + .space 0x4 + +gUnknown_203B330: @ 203B330 + .space 0x4 + +gUnknown_203B334: @ 203B334 + .space 0x4 + +gUnknown_203B338: @ 203B338 + .space 0x4 + +gUnknown_203B33C: @ 203B33C + .space 0x4 + +gUnknown_203B340: @ 203B340 + .space 0x4 + +gUnknown_203B344: @ 203B344 + .space 0x4 + +gUnknown_203B348: @ 203B348 + .space 0x4 + +gUnknown_203B34C: @ 203B34C + .space 0x4 + +gUnknown_203B350: @ 203B350 + .space 0x4 + +gUnknown_203B354: @ 203B354 + .space 0x4 + +gUnknown_203B358: @ 203B358 + .space 0x4 + +gUnknown_203B35C: @ 203B35C + .space 0x4 + +gUnknown_203B360: @ 203B360 + .space 0x4 + +gUnknown_203B364: @ 203B364 + .space 0x4 + +gUnknown_203B368: @ 203B368 + .space 0x4 + +gUnknown_203B36C: @ 203B36C + .space 0x4 + +gUnknown_203B370: @ 203B370 + .space 0x4 + +gUnknown_203B374: @ 203B374 + .space 0x4 + +gUnknown_203B378: @ 203B378 + .space 0x10 + +gUnknown_203B388: @ 203B388 + .space 0x30 + +gUnknown_203B3B8: @ 203B3B8 + .space 0x30 + +gUnknown_203B3E8: @ 203B3E8 + .space 0x4 + +gUnknown_203B3EC: @ 203B3EC + .space 0x4 + +gUnknown_203B3F0: @ 203B3F0 + .space 0x4 + +gUnknown_203B3F4: @ 203B3F4 + .space 0x4 + +gUnknown_203B3F8: @ 203B3F8 + .space 0x4 + +gUnknown_203B3FC: @ 203B3FC + .space 0x4 + +gUnknown_203B400: @ 203B400 + .space 0x4 + +gUnknown_203B404: @ 203B404 + .space 0x4 + +gUnknown_203B408: @ 203B408 + .space 0x4 + +gUnknown_203B40C: @ 203B40C + .space 0x1 + +gUnknown_203B40D: @ 203B40D + .space 0x3 + +gUnknown_203B410: @ 203B410 + .space 0x4 + +gUnknown_203B414: @ 203B414 + .space 0x4 + +gUnknown_203B418: @ 203B418 + .space 0x4 + +gUnknown_203B41C: @ 203B41C + .space 0x4 + +gUnknown_203B420: @ 203B420 + .space 0x8 + +gUnknown_203B428: @ 203B428 + .space 0x8 + +gUnknown_203B430: @ 203B430 + .space 0x4 + +gUnknown_203B434: @ 203B434 + .space 0x4 + +gUnknown_203B438: @ 203B438 + .space 0x4 + +gUnknown_203B43C: @ 203B43C + .space 0x4 + +gUnknown_203B440: @ 203B440 + .space 0x4 + +gUnknown_203B444: @ 203B444 + .space 0xC + +gUnknown_203B450: @ 203B450 + .space 0x4 + +gUnknown_203B454: @ 203B454 + .space 0x4 + +gUnknown_203B458: @ 203B458 + .space 0x4 + +gUnknown_203B45C: @ 203B45C + .space 0x4 + +gUnknown_203B460: @ 203B460 + .space 0x4 + +gUnknown_203B464: @ 203B464 + .space 0x4 + +gUnknown_203B468: @ 203B468 + .space 0x4 + +gUnknown_203B46C: @ 203B46C + .space 0x4 + +gUnknown_203B470: @ 203B470 + .space 0x4 + +gUnknown_203B474: @ 203B474 + .space 0x8 + +gUnknown_203B47C: @ 203B47C + .space 0x4 + +gUnknown_203B480: @ 203B480 + .space 0x4 + +gUnknown_203B484: @ 203B484 + .space 0x4 + +gUnknown_203B488: @ 203B488 + .space 0x4 + +gUnknown_203B48C: @ 203B48C + .space 0x4 + +gUnknown_203B490: @ 203B490 + .space 0x4 + +gUnknown_203B494: @ 203B494 + .space 0x4 + +gUnknown_203B498: @ 203B498 + .space 0x4 + +gUnknown_203B49C: @ 203B49C + .space 0x1 + +gUnknown_203B49D: @ 203B49D + .space 0x3 + +gUnknown_203B4A0: @ 203B4A0 + .space 0xC + +gUnknown_203B4AC: @ 203B4AC + .space 0x4 + +gUnknown_203B4B0: @ 203B4B0 + .space 0x4 + +gUnknown_203B4B4: @ 203B4B4 + .space 0x4 + +gUnknown_203B4B8: @ 203B4B8 + .space 0x2F0 + +gUnknown_203B7A8: @ 203B7A8 + .space 0x4 + +gUnknown_203B7AC: @ 203B7AC + .space 0x14 + +gUnknown_203B7C0: @ 203B7C0 + .space 0x8 + +gUnknown_203B7C8: @ 203B7C8 + .space 0x400 + +gUnknown_203BBC8: @ 203BBC8 + .space 0x4 + +gUnknown_203BBCC: @ 203BBCC + .space 0x4 + +gUnknown_203BBD0: @ 203BBD0 + .space 0x4 + +gUnknown_203BBD4: @ 203BBD4 + .space 0x4 + +gUnknown_203BBD8: @ 203BBD8 + .space 0x4 + +gUnknown_203BBDC: @ 203BBDC + .space 0x28 + +gUnknown_203BC04: @ 203BC04 diff --git a/sym_iwram.txt b/sym_iwram.txt new file mode 100644 index 00000000..918f767a --- /dev/null +++ b/sym_iwram.txt @@ -0,0 +1,77 @@ +SoundMainRAM_Buffer: @ 3000000 + .space 0x400 + +gUnknown_3000400: @ 3000400 + .space 0x800 + +gUnknown_3000C00: @ 3000C00 + .space 0x294 + +gUnknown_3000E94: @ 3000E94 + .space 0x144 + +gUnknown_3000FD8: @ 3000FD8 + .space 0x10 + +gUnknown_3000FE8: @ 3000FE8 + .space 0x30 + +gUnknown_3001018: @ 3001018 + .space 0x180 + +gUnknown_3001198: @ 3001198 + .space 0x9C0 + +alt_3001B58: + +unk_code_ram: @ 3001B58 + +gUnknown_3001B58: @ 3001B58 + .space 0x2 + +gUnknown_3001B5A: @ 3001B5A + .space 0x2 + +gUnknown_3001B5C: @ 3001B5C + .space 0x4 + +gUnknown_3001B60: @ 3001B60 + .space 0x4 + +gUnknown_3001B64: @ 3001B64 + .space 0x4 + +gUnknown_3001B68: @ 3001B68 + .space 0x4 + +gUnknown_3001B6C: @ 3001B6C + .space 0x4 + +gUnknown_3001B70: @ 3001B70 + .space 0x4 + +gUnknown_3001B74: @ 3001B74 + .space 0x4 + +gUnknown_3001B78: @ 3001B78 + .space 0x4 + +gUnknown_3001B7C: @ 3001B7C + .space 0x4 + +gUnknown_3001B80: @ 3001B80 + .space 0x4 + +gUnknown_3001B84: @ 3001B84 + .space 0x4 + +gUnknown_3001B88: @ 3001B88 + .space 0x4 + +gUnknown_3001B8C: @ 3001B8C + .space 0x4 + +gUnknown_3001B90: @ 3001B90 + .space 0x2470 + +gUnknown_3004000: @ 3004000